From 23c7c65fb3efea26da8d055bcb5d4b7da833c309 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 6 Feb 2024 15:54:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E4=BF=AE=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/deviceReport/addForm.vue | 88 ++++++++- pages/deviceReport/index.vue | 3 +- pages/overhaulOrder/addForm.vue | 70 ++++++- pages/overhaulOrder/addServiceRecord.vue | 226 +++++++++++++++++------ pages/overhaulOrder/detail.vue | 112 ++++++----- pages/overhaulOrder/index.vue | 1 - pages/overhaulOrder/transfer.vue | 10 +- pages/repairOrder/addServiceRecord.vue | 20 +- pages/repairOrder/detail.vue | 8 +- 9 files changed, 394 insertions(+), 144 deletions(-) diff --git a/pages/deviceReport/addForm.vue b/pages/deviceReport/addForm.vue index 7766976..04c6f43 100644 --- a/pages/deviceReport/addForm.vue +++ b/pages/deviceReport/addForm.vue @@ -12,12 +12,23 @@ 扫描 - + - + + + + + {{selectFormat(form.receiverType,appDeviceMoldType)}} + + + {{`请选择类型`}} + + + + @@ -26,24 +37,32 @@ + @@ -153,7 +199,15 @@ .add-form-container { min-height: calc(100vh - 140rpx); background: white; - padding: 0px 30rpx 140rpx; + padding: 0px 0rpx 140rpx; + } + + .u-form-item { + padding: 20rpx 30rpx; + } + + .disabled { + background: #f5f5f5; } .list { @@ -190,7 +244,25 @@ } } } +.select { + display: flex; + align-items: center; + height: 72rpx; + width: 100%; + + .input { + flex: 1; + font-size: 28rpx; + color: #000000; + } + + .placeholder { + flex: 1; + font-size: 28rpx; + color: rgb(192, 196, 204); + } + } .footer { position: fixed; bottom: 0px; diff --git a/pages/deviceReport/index.vue b/pages/deviceReport/index.vue index f7fbd75..d0c9323 100644 --- a/pages/deviceReport/index.vue +++ b/pages/deviceReport/index.vue @@ -33,7 +33,7 @@ - @@ -170,6 +170,7 @@ align-items: center; border-top: 1px solid #E4E4E4; padding: 20rpx 0px; + height: 90rpx; } } diff --git a/pages/overhaulOrder/addForm.vue b/pages/overhaulOrder/addForm.vue index 64ecfb9..edffb3a 100644 --- a/pages/overhaulOrder/addForm.vue +++ b/pages/overhaulOrder/addForm.vue @@ -2,10 +2,10 @@ - + - + {{selectFormat(form.maintenanceNumber,repairOrderList)}} @@ -16,10 +16,18 @@ - - + + + + {{selectFormat(form.deviceNumber,deviceList)}} + + + {{`请输入${type=='DEVICE'?'设备' : '模具'}名称`}} + + + - + @@ -51,6 +59,7 @@ import * as moldApi from "@/api/mold.js" import * as dictApi from "@/api/dict.js" import * as repairOrderApi from "@/api/repairOrder.js" + import * as deviceApi from "@/api/device.js" export default { @@ -70,6 +79,8 @@ singleColumnList: [], field: '', faultType: [], //故障类型字典项 + deviceList: [], //设备列表 + isDisabled:false,//判断设备列表是否可以选择 } }, methods: { @@ -80,6 +91,10 @@ this.$modal.showToast('请输入故障描述') return; } + if (!this.form.deviceNumber) { + this.$modal.showToast('请选择设备名称或者维修工单') + return; + } if (!this.form.faultType) { this.$modal.showToast('请选择故障类型') return; @@ -88,6 +103,7 @@ id: this.form && this.form.id ? this.form.id : '', describes: this.form.describes, maintenanceNumber: this.form.maintenanceNumber, + deviceNumber: this.form.deviceNumber, faultType: this.form.faultType, } if (this.form.id) { @@ -141,8 +157,8 @@ this.form.classes = ''; this.form.faultType = '' } else { - this.form = {} + this.isDisabled = false } }, // @@ -158,6 +174,7 @@ // 单列模式 openSingleColumn(field, val, list) { if (field == 'maintenanceNumber' && this.form.id) return; + if (field == 'deviceNumber' && this.isDisabled) return; this.singleColumnList = list this.field = field if (val) { @@ -169,15 +186,22 @@ }, // 单列模式点击确定之后 chooseSingleColumn(e) { - console.log(e[0]) this.form[this.field] = e[0].value if (this.field == 'maintenanceNumber') { this.choosesingleColumnItem = this.singleColumnList.filter(item => item.number == e[0].value) this.form.deviceName = this.choosesingleColumnItem[0].name + this.form.deviceNumber = this.choosesingleColumnItem[0].deviceNumber this.form.factoryAreaName = this.choosesingleColumnItem[0].factoryAreaName this.form.factoryAreaNumber = this.choosesingleColumnItem[0].factoryAreaNumber + this.isDisabled = true // this.form.deviceNumber = e[0].value } + if (this.field == 'deviceNumber') { + this.choosesingleColumnItem = this.singleColumnList.filter(item => item.number == e[0].value) + this.form.deviceName = this.choosesingleColumnItem[0].name + this.form.factoryAreaName = this.choosesingleColumnItem[0].factoryAreaName + this.form.factoryAreaNumber = this.choosesingleColumnItem[0].factoryAreaNumber + } this.singleColumnShow = false this.$emit('singleColumn', this.field, this.form[this.field]) this.$forceUpdate() @@ -196,6 +220,27 @@ }) }, + // 获取设备/模具列表 + async getDeviceList() { + if(this.type == 'DEVICE'){ + await deviceApi.deviceList().then(res => { + res.data.map(item => { + item.value = item.number + item.label = item.name + }) + this.deviceList = res.data + }) + }else if(this.type == 'MOLD'){ + await moldApi.moldList().then(res => { + res.data.map(item => { + item.value = item.number + item.label = item.name + }) + this.deviceList = res.data + }) + } + + }, }, async onLoad(option) { if (option.type) this.type = option.type; @@ -206,11 +251,14 @@ describes: data.describes, maintenanceNumber: data.maintenanceNumber, deviceName: data.name, + deviceNumber: data.deviceNumber, factoryAreaName: data.factoryAreaName, faultType: data.faultType, } + this.isDisabled = this.form.maintenanceNumber ? true:false }; await this.getRepairOrderList() + this.getDeviceList() this.faultType = await dictApi.getDict('fault_type') } } @@ -220,7 +268,13 @@ .add-form-container { min-height: calc(100vh - 140rpx); background: white; - padding: 0px 30rpx 140rpx; + padding: 0px 0rpx 140rpx; + } + .u-form-item{ + padding: 20rpx 30rpx; + } + .disabled{ + background: #f5f5f5; } .list { diff --git a/pages/overhaulOrder/addServiceRecord.vue b/pages/overhaulOrder/addServiceRecord.vue index 66a44d2..68f2519 100644 --- a/pages/overhaulOrder/addServiceRecord.vue +++ b/pages/overhaulOrder/addServiceRecord.vue @@ -2,19 +2,22 @@ - - + + - - + + - - + + - + + + + - - {{selectFormatCheck(form.maintenances,selecUserList)}} + + {{selectFormatCheck(form.chargePeoples,selecUserList)}} 请选择维修人员 @@ -22,12 +25,42 @@ + + + + {{selectFormat(form.status,jxDetailsStatus)}} + + + {{`请选择完成情况`}} + + + + + + + + {{formatDate}} + + + {{`请选择完成时间`}} + + + + + + + + + + + + *备件 - + @@ -64,7 +97,7 @@ - + {{selectFormat(form1.number,sparePartsList)}} @@ -101,13 +134,15 @@ + @@ -344,7 +340,7 @@ view { &:nth-child(1) { - width: 160rpx; + width: 180rpx; } &:nth-child(2) { diff --git a/pages/overhaulOrder/index.vue b/pages/overhaulOrder/index.vue index 87bcabd..2ae7307 100644 --- a/pages/overhaulOrder/index.vue +++ b/pages/overhaulOrder/index.vue @@ -47,7 +47,6 @@ 编辑 - diff --git a/pages/overhaulOrder/transfer.vue b/pages/overhaulOrder/transfer.vue index 2202ef4..c19988f 100644 --- a/pages/overhaulOrder/transfer.vue +++ b/pages/overhaulOrder/transfer.vue @@ -3,9 +3,9 @@ - + - {{selectFormat(form.receiverType,deviceMoldType)}} + {{selectFormat(form.receiverType,appDeviceMoldType)}} {{`请选择类型`}} @@ -77,7 +77,7 @@ return { loading: false, type: "", - deviceMoldType: [], //类型列表字典 + appDeviceMoldType: [], //类型列表字典 form: { id: '', receiverType: "", @@ -252,8 +252,8 @@ async onLoad(option) { if (option.type) this.type = option.type; if (option.id) this.form.id = option.id; - this.deviceMoldType = await dictApi.getDict('device_mold_type') - this.deviceMoldType = this.deviceMoldType.filter(item => item.value != this.type) + this.appDeviceMoldType = await dictApi.getDict('app_device_mold_type') + this.appDeviceMoldType = this.appDeviceMoldType.filter(item => item.value != this.type) } } diff --git a/pages/repairOrder/addServiceRecord.vue b/pages/repairOrder/addServiceRecord.vue index b667054..feeff7f 100644 --- a/pages/repairOrder/addServiceRecord.vue +++ b/pages/repairOrder/addServiceRecord.vue @@ -27,7 +27,7 @@ *备件 - + @@ -132,7 +132,7 @@ describes1: '', workOut: '', maintenances: '', - itemNUmbers: [], + itemNumbers: [], }, form1: { number: "", @@ -160,7 +160,7 @@ this.$modal.showToast('请选择维修人员') return; } - if (this.form.itemNUmbers.length === 0) { + if (this.form.itemNumbers.length === 0) { this.$modal.showToast('请选择备件') return; } @@ -253,7 +253,7 @@ }, // 多选选择框回显 selectFormatCheck(val, array) { - const arr = val.split(',') + const arr = val.split(',').map(Number) let str = array.filter(item => arr.includes(item.id)).map(item => item.name).join(',') return str }, @@ -315,20 +315,20 @@ this.$modal.showToast('请输入数量') return; } - if (this.form.itemNUmbers && this.form.itemNUmbers.length > 0) { - let arr = this.form.itemNUmbers.filter(item => item.number == this.form1.number) + if (this.form.itemNumbers && this.form.itemNumbers.length > 0) { + let arr = this.form.itemNumbers.filter(item => item.number == this.form1.number) if (arr && arr.length > 0) { this.$modal.showToast('该备件已添加') return; } } - this.form.itemNUmbers.push(this.form1) + this.form.itemNumbers.push(this.form1) this.isPopupShow = false }, // 删除备件 delSpareParts(index) { - this.form.itemNUmbers.splice(index, 1) + this.form.itemNumbers.splice(index, 1) } }, @@ -339,8 +339,8 @@ if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option .data)).id) { this.form = JSON.parse(decodeURIComponent(option.data)) - this.$set(this.form,'itemNUmbers',this.form.items) - + this.$set(this.form,'itemNumbers',this.form.items) +console.log('99',this.form) }; await this.getSelecUser() await this.getSparePartsList() diff --git a/pages/repairOrder/detail.vue b/pages/repairOrder/detail.vue index ebbcae6..2064bc5 100644 --- a/pages/repairOrder/detail.vue +++ b/pages/repairOrder/detail.vue @@ -246,6 +246,10 @@ }, // APP维修工单接单、点击完成、验证 orderClick(type) { + if(!this.serviceList || this.serviceList&&this.serviceList.length == 0){ + this.$modal.showToast('请添加维修内容') + return; + } const data = { number: this.data.number, status: this.data.status, @@ -295,8 +299,10 @@ this.getRepairOrderDetaiList() }) }) - }, + transfer(){ + this.$tab.navigateTo(`/pages/repairOrder/transfer?type=${this.type}&id=${this.data.id}`) + } }, async onLoad(option) { if (option.type) this.type = option.type;