From 61331d1c8aba544a5f41530c1ebf0915375a6bd4 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Thu, 21 Nov 2024 15:07:28 +0800 Subject: [PATCH] 1 --- pages-home/service/todoDetail.vue | 103 +++++++++++++++--------------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/pages-home/service/todoDetail.vue b/pages-home/service/todoDetail.vue index c365fc4..4a0c14a 100644 --- a/pages-home/service/todoDetail.vue +++ b/pages-home/service/todoDetail.vue @@ -196,7 +196,9 @@ export default { safeName: null, safeContact: null, safeMobile: null, - } + }, + //是否可以点击 + canClick:true, }; }, onLoad(data) { @@ -309,8 +311,8 @@ export default { this.yesText = "通过" this.backText = "驳回" } else { - this.yesText = "通过全部" - this.backText = "驳回全部" + this.yesText = "通过" + this.backText = "驳回" } }, getWaresStatus(val) { @@ -354,57 +356,56 @@ export default { }) }, confirmOpe(type) { - // let forSign = true - // if (type == 'yes') { - // this.repairList.map(item=>{ - // if (item.wares.price == null || item.wares.price == ''){ - // 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}) - }) + if(this.selectWares.length==0){ + uni.showToast({ + title: '请选中要审核的配件!', + icon: 'none' }) + return } - request({ - url: url, - method: 'POST', - data: dataObj - }).then((res) => { - if (res.code == 200) { - uni.showToast({ - title: '审批成功!', - icon: 'none' - }) - setTimeout(() => { - uni.navigateBack() - }, 700) + if (this.canClick) { + this.canClick = false + let url = '/admin-api/repair/tw/audit' + let dataObj = { + id: this.id, + type: "01", + status: "yes" == type ? "01" : "02" } - }) + 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 + } + } }, } }