This commit is contained in:
xiaofajia 2024-11-21 15:15:02 +08:00
commit 27375030c1

View File

@ -196,7 +196,9 @@ export default {
safeName: null, safeName: null,
safeContact: null, safeContact: null,
safeMobile: null, safeMobile: null,
} },
//
canClick:true,
}; };
}, },
onLoad(data) { onLoad(data) {
@ -309,8 +311,8 @@ export default {
this.yesText = "通过" this.yesText = "通过"
this.backText = "驳回" this.backText = "驳回"
} else { } else {
this.yesText = "通过全部" this.yesText = "通过"
this.backText = "驳回全部" this.backText = "驳回"
} }
}, },
getWaresStatus(val) { getWaresStatus(val) {
@ -354,28 +356,22 @@ export default {
}) })
}, },
confirmOpe(type) { confirmOpe(type) {
// let forSign = true if(this.selectWares.length==0){
// if (type == 'yes') { uni.showToast({
// this.repairList.map(item=>{ title: '请选中要审核的配件!',
// if (item.wares.price == null || item.wares.price == ''){ icon: 'none'
// uni.showToast({ })
// title: '', return
// icon: 'none' }
// }) if (this.canClick) {
// forSign = false this.canClick = false
// return;
// }
// })
// }
// if (!forSign) {
// return;
// }
let url = '/admin-api/repair/tw/audit' let url = '/admin-api/repair/tw/audit'
let dataObj = { let dataObj = {
id: this.id, id: this.id,
type: "01", type: "01",
status: "yes" == type ? "01" : "02" status: "yes" == type ? "01" : "02"
} }
try {
if (this.selectWares && this.selectWares.length > 0) { if (this.selectWares && this.selectWares.length > 0) {
dataObj.items = [...this.selectWares.map(item => { dataObj.items = [...this.selectWares.map(item => {
return { return {
@ -384,9 +380,9 @@ export default {
})] })]
} else { } else {
dataObj.items = [] dataObj.items = []
this.repairList.map((groupItem)=>{ this.repairList.map((groupItem) => {
groupItem.twItemList.map((item)=>{ groupItem.twItemList.map((item) => {
dataObj.items.push({id:item.id}) dataObj.items.push({id: item.id})
}) })
}) })
} }
@ -395,6 +391,7 @@ export default {
method: 'POST', method: 'POST',
data: dataObj data: dataObj
}).then((res) => { }).then((res) => {
this.canClick = true
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
title: '审批成功!', title: '审批成功!',
@ -405,6 +402,10 @@ export default {
}, 700) }, 700)
} }
}) })
} catch (e) {
this.canClick = true
}
}
}, },
} }
} }