按钮防重复点击

This commit is contained in:
2023-08-23 16:26:39 +08:00
parent 6060a36d92
commit f6ba33b0a2
11 changed files with 95 additions and 107 deletions

View File

@ -43,7 +43,7 @@ export default {
}
},
async mounted() {
console.log(this.$route.query?.id)
// console.log(this.$route.query?.id)
this.form.batchCode=this.$route.query?.id;
this.form.startTime=this.$route.query?.startTime;
this.form.overTime=this.$route.query?.overTime;
@ -56,9 +56,9 @@ export default {
pageSize:this.pageSize,
...this.form,
})
if(res.code=== 200){
// if(res.code=== 200){
this.detailList=res.data
}
// }
// console.log("resssss",res)
}
}

View File

@ -73,7 +73,7 @@ export default {
pageNum:this.pageNum,
pageSize:this.pageSize
})
if(res.code === 0){
// if(res.code === 0){
this.notifyList=res.data;
console.log(this.notifyList)
if(this.notifyList.length === 0){
@ -82,7 +82,7 @@ export default {
this.show=false
}
}
},
// },
}
}
</script>

View File

@ -90,12 +90,12 @@ export default {
reportingItem:this.radio ? this.radio : "",
reportingDesc:this.decscripTxt ? this.decscripTxt : ""
})
if(result.code === 200){
// if(result.code === 200){
this.$toast(result.msg)
setTimeout(()=>{
window.android.sendMessage("goBack");
},2000)
}
// }
}else{
this.$toast("报备事项和报备描述必填一项")
}

View File

@ -37,15 +37,15 @@ export default {
methods:{
async getList(){
let result=await getToDoList();
if(result.code === 200){
// if(result.code === 200){
this.todolist=result.data;
if(this.todolist.length === 0){
if(this.todolist?.length === 0){
this.show=true
}else {
this.show=false
}
console.log("this.todolist",this.todolist.length)
}
// console.log("this.todolist",this.todolist?.length)
// }
},
async noPass(item){
let result=await toDoAudit({

View File

@ -57,68 +57,28 @@
</div>
</div>
<div class="serviceType">
<div class="trailerService">
<div class="trailerService" v-for="(item,index) in supplierServiceList" :key="index">
<div class="serviceline">
<span class="service">拖车服务:</span>
<span class="service">{{ item.name }}:</span>
<span class="line"></span>
</div>
<van-radio-group v-model="trailerService" @change="change" class="radioWrap">
<van-radio name="故障——平板拖车" class="item">
故障平板拖车
<img
slot="icon"
slot-scope="props"
:src="props.checked ? activeIcon : inactiveIcon"
>
</van-radio>
<van-radio name=" 事故——平板拖车" class="item">
事故平板拖车
<img
slot="icon"
slot-scope="props"
:src="props.checked ? activeIcon : inactiveIcon"
>
</van-radio>
</van-radio-group>
</div>
<div class="smallRepairService">
<div class="serviceline">
<span class="service">小修服务:</span>
<span class="line"></span>
</div>
<van-radio-group v-model="smallRepairService" @change="change2" class="radioWrap">
<van-radio name="换胎" class="item">
换胎
<img
slot="icon"
slot-scope="props"
:src="props.checked ? activeIcon : inactiveIcon"
>
</van-radio>
<van-radio name="搭电" class="item">
搭电
<img
slot="icon"
slot-scope="props"
:src="props.checked ? activeIcon : inactiveIcon"
>
</van-radio>
<van-radio name="送油" class="item">
送油
<img
slot="icon"
slot-scope="props"
:src="props.checked ? activeIcon : inactiveIcon"
>
</van-radio>
<van-radio name="送水" class="item">
送水
<van-radio :name="item2.name" class="item" v-for="(item2,index2) in item.children" :key="index2">
{{item2.name }}
<img
slot="icon"
slot-scope="props"
:src="props.checked ? activeIcon : inactiveIcon"
>
</van-radio>
<!-- <van-radio name=" 事故——平板拖车" class="item">-->
<!-- 事故平板拖车-->
<!-- <img-->
<!-- slot="icon"-->
<!-- slot-scope="props"-->
<!-- :src="props.checked ? activeIcon : inactiveIcon"-->
<!-- >-->
<!-- </van-radio>-->
</van-radio-group>
</div>
</div>
@ -129,7 +89,7 @@
<script>
import {myMixins} from "@/utils/myMixins"
import {vehicleTypeList,saveVehicle,getInfoById} from "@/api/mine"
import {vehicleTypeList,saveVehicle,getInfoById,supplierServiceTree} from "@/api/mine"
import TwoCommonBtn from "@/components/twoBtnCommon.vue"
import CellGroup from "@/components/cellGroup.vue";
export default {
@ -146,7 +106,8 @@ export default {
typeList:[],//车辆类型列表
selectedOption:'1',//车辆类型
id:'',//车辆Id
serviceIds:''//车辆服务种类
serviceIds:'',//车辆服务种类,
supplierServiceList:[]
}
},
async mounted() {
@ -159,7 +120,10 @@ export default {
this.selectedOption=selectElement.value;
});
await this.getTypeList();
await this.vehicleInfo()
if( this.id){
await this.vehicleInfo()
}
await this.getSupplierServiceTree();
},
methods:{
async getTypeList() {
@ -168,21 +132,26 @@ export default {
this.typeList=result.data
}
},
async getSupplierServiceTree(){
let res = await supplierServiceTree();
this.supplierServiceList=res.data
},
async vehicleInfo(){
let res= await getInfoById({
vehicleId:this.id
})
if(res.code === 200){
// if(res.code === 200){
let result=res.data;
this.id=result.vehicleId
this.carNum=result.plateNumber
this.isJoin=result.hasPolymerization.code
this.selectedOption=result.vehicleType;
this.serviceIds=result.serviceIds
}
// }
},
change(e) {
this.trailerService=e
console.log(" this.trailerService", this.trailerService)
},
change2(e) {
this.smallRepairService=e
@ -194,17 +163,18 @@ export default {
this.$router.back()
},
async submitBtn(){
let res=await saveVehicle({
vehicleId:this.id ? this.id : '',
plateNumber:this.carNum ? this.carNum :'',
vehicleType:this.selectedOption ? this.selectedOption : '',
hasPolymerization:Number(this.isJoin ? this.isJoin : '') ,
serviceIds:this.serviceIds ? this.serviceIds : []
})
if(res.code === 200){
if(!(this.carNum && this.selectedOption && this.isJoin)){
this.$toast('必填字段未填写')
}else{
await saveVehicle({
vehicleId:this.id ? this.id : '',
plateNumber:this.carNum ? this.carNum :'',
vehicleType:this.selectedOption ? this.selectedOption : '',
hasPolymerization:Number(this.isJoin ? this.isJoin : '') ,
serviceIds:this.serviceIds ? this.serviceIds : []
})
if(this.id){
this.$toast('修改成功')
}else{
this.$toast('添加成功')
}
@ -229,6 +199,7 @@ export default {
}
.wrap{
@include wh(100%,100%);
overflow-y: auto;
}
.addContentWrap{
margin-left: 16px;
@ -301,10 +272,11 @@ export default {
}
}
.btn{
margin-left: 8px;
//margin-left: 8px;
width: 90%;
position: fixed;
bottom: 30px;
margin: 40px 0 30px 8px;
//position: fixed;
//bottom: 30px;
}
}
</style>

View File

@ -64,7 +64,7 @@ export default {
pageNum:this.pageNum,
pageSize:this.pageSize
})
if(result.code === 200){
// if(result.code === 200){
this.total=result.total
if(this.pageNum == 1){// 第一页直接赋值
this.vehicleList=result.data;
@ -73,20 +73,20 @@ export default {
let arr = result.data;
this.vehicleList = preList.concat(arr)
}
}
// }
},
deleteItem(id){//删除车辆
this.show=true
this.id=id
},
async handleConfirm(){//调删除车辆接口
let result= await deleteVehicle({
await deleteVehicle({
vehicleId:this.id
})
if(result.code === 200){
// if(result.code === 200){
this.$toast('删除成功');
await this.getVehicleList();
}
await this.getVehicleList();
// }
},
updateVehicle(item){//修改
this.$router.push({

View File

@ -90,7 +90,6 @@ export default {
this.userOrderId = urlParams.get('userOrderId');
this.orderCode=urlParams.get('orderCode');
this.taskOrderId=urlParams.get('taskOrderId') ? urlParams.get('taskOrderId') : '';
// console.log(this.queryType)
await this.getDetail();
},
methods:{
@ -101,9 +100,9 @@ export default {
orderCode:this.orderCode,
taskOrderId:this.taskOrderId ? this.taskOrderId : ''
})
if(result.code === 200){
this.orderDetailInfo=result.data;
}
// if(result.code === 200){
this.orderDetailInfo=result;
// }
}
}
}