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,57 +356,56 @@ 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: '',
// icon: 'none'
// })
// forSign = false
// return;
// }
// })
// }
// if (!forSign) {
// return;
// }
let url = '/admin-api/repair/tw/audit'
let dataObj = {
id: this.id,
type: "01",
status: "yes" == type ? "01" : "02"
}
if (this.selectWares && this.selectWares.length > 0) {
dataObj.items = [...this.selectWares.map(item => {
return {
id: item.id
}
})]
} else {
dataObj.items = []
this.repairList.map((groupItem)=>{
groupItem.twItemList.map((item)=>{
dataObj.items.push({id:item.id})
})
}) })
return
} }
request({ if (this.canClick) {
url: url, this.canClick = false
method: 'POST', let url = '/admin-api/repair/tw/audit'
data: dataObj let dataObj = {
}).then((res) => { id: this.id,
if (res.code == 200) { type: "01",
uni.showToast({ status: "yes" == type ? "01" : "02"
title: '审批成功!',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 700)
} }
}) try {
if (this.selectWares && this.selectWares.length > 0) {
dataObj.items = [...this.selectWares.map(item => {
return {
id: item.id
}
})]
} else {
dataObj.items = []
this.repairList.map((groupItem) => {
groupItem.twItemList.map((item) => {
dataObj.items.push({id: item.id})
})
})
}
request({
url: url,
method: 'POST',
data: dataObj
}).then((res) => {
this.canClick = true
if (res.code == 200) {
uni.showToast({
title: '审批成功!',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 700)
}
})
} catch (e) {
this.canClick = true
}
}
}, },
} }
} }