From eeb58ba02cad96efd72f838bbe4baf32c4159f29 Mon Sep 17 00:00:00 2001 From: xiepeng Date: Thu, 9 May 2024 18:08:07 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dirving-inspections-list.vue | 3 +- .../driving-item-check-list.vue | 285 +++++--- .../driving-inspections/driving-item-list.vue | 28 +- .../driving-item-promise-list.vue | 622 ++++++++++++++++++ 4 files changed, 846 insertions(+), 92 deletions(-) create mode 100644 pages/application/driving-inspections/driving-item-promise-list.vue diff --git a/pages/application/driving-inspections/dirving-inspections-list.vue b/pages/application/driving-inspections/dirving-inspections-list.vue index eea9496..3447ce9 100644 --- a/pages/application/driving-inspections/dirving-inspections-list.vue +++ b/pages/application/driving-inspections/dirving-inspections-list.vue @@ -44,7 +44,8 @@ 运单状态:
出车前
行车中
-
收车后
+
收车后
+
待承诺
diff --git a/pages/application/driving-inspections/driving-item-check-list.vue b/pages/application/driving-inspections/driving-item-check-list.vue index 41589ea..fec0125 100644 --- a/pages/application/driving-inspections/driving-item-check-list.vue +++ b/pages/application/driving-inspections/driving-item-check-list.vue @@ -5,7 +5,7 @@ {{CHECKTYPE_NAME}}排查项 - + 检查项名称:{{item.CHECKITEMNAME}} 检查项说明:{{item.REMARKS}} @@ -29,9 +29,38 @@ - + + 承诺项:{{item.INQUIRYCONTENT}} + + + + + + + + + + + + + 不是 + + + + + + 不涉及 + + + + + + + + + @@ -54,7 +83,7 @@ - + 实时照片 *照片说明:车辆正前方、左右两侧45°角及车尾部拍照 @@ -81,6 +110,7 @@ + @@ -133,7 +163,8 @@ modalName:null, imgList:[], liveImgs: [], - } + promiseList: [], + } }, onLoad(e){ this.todayDate = formatDate(new Date(), 'yyyy-MM-dd hh:mm'); @@ -142,6 +173,7 @@ this.WAYBILLREGISTRATION_ID = e.WAYBILLREGISTRATION_ID; console.log(this.WAYBILLREGISTRATION_ID) this.getData(); + this.getData2(); loginSession(); }, onShow() { @@ -396,6 +428,40 @@ }); }, + getData2() { + var _this = this; + console.log(_this) + uni.showLoading({ + title: '请稍候' + }) + uni.request({ + url: basePath + '/app/drivingtype/safetycommitment', + method: 'POST', + dataType: 'json', + header: { + 'Content-type':'application/x-www-form-urlencoded' + }, + data: { + CHECKTYPE_ID: _this.CHECKTYPE_ID, + USER_NAME : loginUser.NAME, + CORPINFO_ID:loginUser.CORPINFO_ID, + USER_ID:loginUser.USER_ID, + }, + success: (res) => { + if("success" == res.data.result){ + uni.hideLoading(); + _this.pd=res.data.pd; + _this.promiseList = res.data.varList; + } else { + uni.showToast({ + title: res.data.message, + duration: 2000 + }); + } + } + }); + }, + openAuth(permissionID){ this.permissionID = permissionID; setTimeout(()=>{ @@ -515,79 +581,137 @@ }); }, - goSubmit(){ - var _this = this; - let required = true - uni.showLoading({ - title: '请稍候' - }) - - if (_this.liveImgs.length <= 0) { - uni.showToast({ - icon: 'none', - title: '请上传车辆检查照片', - duration: 1500 - }); - return; - } - if (_this.liveImgs.length < 4) { - uni.showToast({ - icon: 'none', - title: '车辆检查需要4张照片', - duration: 1500 - }); - return; + goSubmit() { + if(this.CHECKTYPE_NAME !== "待承诺") { + var _this = this; + let required = true + uni.showLoading({ + title: '请稍候' + }) + if (_this.liveImgs.length <= 0) { + uni.showToast({ + icon: 'none', + title: '请上传车辆检查照片', + duration: 1500 + }); + return; + } + if (_this.liveImgs.length < 4) { + uni.showToast({ + icon: 'none', + title: '车辆检查需要4张照片', + duration: 1500 + }); + return; + } + if (_this.imgList.length <= 0) { + uni.showToast({ + icon: 'none', + title: '请签字', + duration: 1500 + }); + return; + } + var files = []; + var signtime = []; + const formData = {} + this.uploadImgFaults(files, signtime) + formData.SIGNTIME = signtime + formData.CORPINFO_ID = loginUser.CORPINFO_ID + formData.USER_ID = loginUser.USER_ID + formData.USER_NAME = loginUser.USERNAME + formData.CHECKTYPE_ID = this.CHECKTYPE_ID + formData.IMG_PATH = this.liveImgs.map(item => { + return item.filePath + }).join(",") + formData.checklist = JSON.stringify(this.list) + if (this.CHECKTYPE_NAME == "出车前" || this.CHECKTYPE_NAME == "行车中") { + formData.WAYBILLSTATUS = 1 + } else if (this.CHECKTYPE_NAME == "收车后") { + formData.WAYBILLSTATUS = 2 + }else if (this.CHECKTYPE_NAME == "待承诺"){ + formData.WAYBILLSTATUS = 3 + } + formData.WAYBILLREGISTRATION_ID = this.WAYBILLREGISTRATION_ID + console.log(JSON.stringify(this.list)) + uni.uploadFile({ + url: basePath + 'app/drivingitem/add', + files: files, + formData: formData, + success: (res) => { + uni.showToast({ + icon: 'none', + title: '保存成功', + duration: 2000 + }); + _this.goback() + }, + fail: (err) => { + uni.hideLoading(); + uni.showModal({ + content: err.errMsg, + showCancel: false + }); + } + }) + }else{ + var _this = this; + let required = true + uni.showLoading({ + title: '请稍候' + }) + if (_this.imgList.length <= 0) { + uni.showToast({ + icon: 'none', + title: '请签字', + duration: 1500 + }); + return; + } + var files = []; + var signtime = []; + const formData = {} + this.uploadImgFaults(files, signtime) + formData.SIGNTIME = signtime + formData.CORPINFO_ID = loginUser.CORPINFO_ID + formData.USER_ID = loginUser.USER_ID + formData.USER_NAME = loginUser.USERNAME + formData.CHECKTYPE_ID = this.CHECKTYPE_ID + formData.IMG_PATH = this.liveImgs.map(item => { + return item.filePath + }).join(",") + formData.checklist = JSON.stringify(this.promiseList) + if (this.CHECKTYPE_NAME == "出车前" || this.CHECKTYPE_NAME == "行车中") { + formData.WAYBILLSTATUS = 1 + } else if (this.CHECKTYPE_NAME == "收车后") { + formData.WAYBILLSTATUS = 2 + }else if (this.CHECKTYPE_NAME == "待承诺"){ + formData.WAYBILLSTATUS = 3 + } + formData.WAYBILLREGISTRATION_ID = this.WAYBILLREGISTRATION_ID + console.log(JSON.stringify(this.list)) + uni.uploadFile({ + url: basePath + 'app/commitentitem/add', + files: files, + formData: formData, + success: (res) => { + uni.showToast({ + icon: 'none', + title: '保存成功', + duration: 2000 + }); + _this.goback() + }, + fail: (err) => { + uni.hideLoading(); + uni.showModal({ + content: err.errMsg, + showCancel: false + }); + } + }) } - if (_this.imgList.length <= 0) { - uni.showToast({ - icon: 'none', - title: '请签字', - duration: 1500 - }); - return; - } - - var files = []; - var signtime = []; - const formData={} - this.uploadImgFaults(files,signtime) - formData.SIGNTIME = signtime - formData.CORPINFO_ID = loginUser.CORPINFO_ID - formData.USER_ID = loginUser.USER_ID - formData.USER_NAME = loginUser.USERNAME - formData.CHECKTYPE_ID = this.CHECKTYPE_ID - formData.IMG_PATH = this.liveImgs.map(item => { - return item.filePath - }).join(",") - formData.checklist = JSON.stringify(this.list) - if(this.CHECKTYPE_NAME == "出车前" || this.CHECKTYPE_NAME == "行车中"){ - formData.WAYBILLSTATUS = 1 - }else if (this.CHECKTYPE_NAME == "收车后"){ - formData.WAYBILLSTATUS = 2 - } - formData.WAYBILLREGISTRATION_ID = this.WAYBILLREGISTRATION_ID - console.log(JSON.stringify(this.list)) - uni.uploadFile({ - url: basePath+'app/drivingitem/add', - files: files, - formData:formData, - success: (res) => { - uni.showToast({ - icon:'none', - title: '保存成功', - duration: 2000 - }); - _this.goback() - }, - fail: (err) => { - uni.hideLoading(); - uni.showModal({ - content: err.errMsg, - showCancel: false - }); - } - }) - }, + }, goback(){ var pages = getCurrentPages(); // 获取当前页面栈 var prePage = pages[pages.length - 2]; // 上二级页面 @@ -597,7 +721,6 @@ }, //点击合格 checkTrue(e,STATUS) { - let _this=this; _this.list[e.index].ISNORMAL=STATUS; console.log(_this.list[e.index].ISNORMAL) @@ -605,6 +728,14 @@ _this.$set(_this.list[e.index], 'REMARK', _this.list[e.index].REMARK) }, + //点击合格 + checkTrue1(e,STATUS) { + let _this=this; + _this.promiseList[e.index].ISNORMAL=STATUS; + console.log(_this.promiseList[e.index].ISNORMAL) + _this.$forceUpdate();//强制刷新 + _this.$set(_this.promiseList[e.index], 'REMARK', _this.promiseList[e.index].REMARK) + }, } } diff --git a/pages/application/driving-inspections/driving-item-list.vue b/pages/application/driving-inspections/driving-item-list.vue index 929a7c6..e1cf023 100644 --- a/pages/application/driving-inspections/driving-item-list.vue +++ b/pages/application/driving-inspections/driving-item-list.vue @@ -7,12 +7,13 @@ + @@ -104,7 +105,8 @@ //跳转事件 goToList(e) { const index = e.index - if((this.pd.WAYBILLSTATUS === '1' || this.pd.WAYBILLSTATUS === '2' || this.pd.IsExist != '0') && index === 0){ + const WAYBILLSTATUS = this.pd.WAYBILLSTATUS + if((this.pd.WAYBILLSTATUS === '1' || this.pd.WAYBILLSTATUS === '2' || this.pd.IsExist != '0') && index === 1){ uni.showModal({ title: '提示', cancelText: '确认', @@ -112,7 +114,7 @@ content:'您已经完成出车前检查,无需再次检查', }); return; - }else if((this.pd.WAYBILLSTATUS === '2' || this.pd.IsExist == '1' || this.pd.IsExist == '0') && index === 1){ + }else if((this.pd.WAYBILLSTATUS === '2' || this.pd.IsExist == '1' || this.pd.IsExist == '0') && index === 2){ if(this.pd.WAYBILLSTATUS === '0') { uni.showModal({ title: '提示', @@ -122,7 +124,7 @@ }); } return - }else if((this.pd.WAYBILLSTATUS === '2' || this.pd.IsExist == '2' || this.pd.IsExist == '0') && index === 2){ + }else if((this.pd.WAYBILLSTATUS === '2' || this.pd.IsExist == '2' || this.pd.IsExist == '0') && index === 3){ uni.showModal({ title: '提示', cancelText: '确认', @@ -130,16 +132,14 @@ content:'您未进行行车中检查,请按顺序检查', }); return; - } - uni.navigateTo({ - url: '/pages/application/driving-inspections/driving-item-check-list?CHECKTYPE_ID=' + - e.CHECKTYPE_ID + '&CHECKTYPE_NAME=' + e.CHECKTYPE_NAME + '&WAYBILLREGISTRATION_ID=' + e.WAYBILLREGISTRATION_ID - }); - }, - - - } - } + } + uni.navigateTo({ + url: '/pages/application/driving-inspections/driving-item-check-list?CHECKTYPE_ID=' + + e.CHECKTYPE_ID + '&CHECKTYPE_NAME=' + e.CHECKTYPE_NAME + '&WAYBILLREGISTRATION_ID=' + e.WAYBILLREGISTRATION_ID + }); + } + } + }