From 32a5fcab3975507a5b2338c4627ae0031e5c64ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com> Date: Mon, 18 Nov 2024 17:58:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/orderdetails.vue | 100 +++++++++++++++++++++++++++++------ pages/staff/staff.vue | 7 ++- 2 files changed, 90 insertions(+), 17 deletions(-) diff --git a/pages/index/orderdetails.vue b/pages/index/orderdetails.vue index bd11d37..f3b426b 100644 --- a/pages/index/orderdetails.vue +++ b/pages/index/orderdetails.vue @@ -12,12 +12,12 @@ - - - - - - + + + + + + {{ detailData.workerName }} @@ -39,10 +39,12 @@ 手机号: {{ detailData.buyUserPhone }} - + 引车员: {{ detailData.leadManName }} + 更换引车员 + 车型: {{ detailData.carType }} @@ -99,14 +101,12 @@ {{ index + 1 }} - {{ item.title }} {{ item.createTime }} 施工人员: {{ item.nickname }} - {{ item.content }} @@ -115,17 +115,12 @@ - - - + - - - @@ -236,6 +231,9 @@ + { + this.leadManList.push(res.data) + let result = this.leadManList + .map((subArray, subArrayIndex) => { + const index = subArray.findIndex(item => item.id === this.detailData.leadManId); + if (index !== -1) { + // 返回的是子数组的索引和匹配项的索引 + return {subArrayIndex, itemIndex: index}; + } else { + // 没有找到匹配项,返回 null 或 undefined + return null; + } + }) + .filter(item => item !== null); // 过滤掉没有匹配的项 + let index = result[0].itemIndex + // let subArrayIndex = result[0].subArrayIndex + this.defaultIndex = [index] + }) + }, + cancelLeadMan() { + this.showLeadMan = false + }, + confirmLeadMan(e) { + this.nickname = e.value[0].nickname + this.leadManId = e.value[0].id + this.showLeadMan = false + let data = { + partnerId: uni.getStorageSync('partnerId'), + id: this.inspectionId, + leadManId: this.leadManId + } + + request({ + url: '/system/info/updateLeadMan', + method: 'post', + data: data + }).then(res => { + uni.showToast({ + title: '修改成功' + }) + this.getindex() + }) + }, //查询重审可以选择的项目 getProject() { request({ @@ -452,6 +509,7 @@ export default { method: 'post', data: inspectionInfo }) + uni.navigateBack(); return } else if (this.tbindex == 2 && this.isRetrial == 2) { //跳转到修改工单页面 @@ -459,7 +517,7 @@ export default { url: '/pages/index/Neworder?inspectionInfoId=' + this.inspectionInfoId }) return - }else if (this.tbindex == 0 && this.isRetrial == 0) { + } else if (this.tbindex == 0 && this.isRetrial == 0) { status = 1 } inspectionInfo.selectType = status @@ -658,6 +716,16 @@ export default { deletePic1(event) { this[`fileList${event.name}`].splice(event.index, 1) }, + }, + mounted() { + // 在组件挂载后启动定时器 + this.timer = setInterval(this.getindex, 3000); + }, + beforeDestroy() { + // 在组件销毁前清除定时器 + if (this.timer) { + clearInterval(this.timer); + } } } diff --git a/pages/staff/staff.vue b/pages/staff/staff.vue index ec4d0c9..23144d1 100644 --- a/pages/staff/staff.vue +++ b/pages/staff/staff.vue @@ -38,7 +38,7 @@ {{ item.goodsName }} - 接待员:{{ item.workerName }} + 当前检测人:{{ item.workerName }} 检测项目:{{ item.projectName }} @@ -61,6 +61,11 @@ 订单号: {{ item.orderNo }} + + + 引车员: + {{ item.leadManName }} + 车牌号: