From 8e406765dc18262aee583dcb4f427e92cfe4cf8a Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 12 Mar 2024 12:30:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=9B=B4=E6=96=B0=EF=BC=8C?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E9=80=89=E6=8B=A9=E6=94=B9=E6=88=90=E6=89=AB?= =?UTF-8?q?=E6=8F=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.js | 2 +- src/pages.json | 7 + src/pages/deviceReport/addForm.vue | 122 ++++++--- src/pages/mine/index.vue | 3 +- src/pages/overhaulOrder/addForm.vue | 109 +++++++- src/pages/overhaulOrder/addServiceRecord.vue | 4 +- src/pages/overhaulOrder/reqairOrderList.vue | 256 +++++++++++++++++++ src/pages/repairOrder/addForm.vue | 98 ++++++- src/pages/repairOrder/detail.vue | 151 ++++++++++- src/pages/repairOrder/index.vue | 4 +- src/pages/repairOrder/transfer.vue | 107 +++++++- src/pages/upkeepOrder/addServiceRecord.vue | 9 +- 12 files changed, 800 insertions(+), 72 deletions(-) create mode 100644 src/pages/overhaulOrder/reqairOrderList.vue diff --git a/src/config.js b/src/config.js index acd21c9..c9200a4 100644 --- a/src/config.js +++ b/src/config.js @@ -1,6 +1,6 @@ // 应用全局配置 module.exports = { - baseUrl: process.env.NODE_ENV === 'development' ? 'http://192.168.0.172:12080' : 'http://dev.ccwin-in.com:25202', + baseUrl: process.env.NODE_ENV === 'development' ? 'http://192.168.0.106:12080' : 'http://dev.ccwin-in.com:25202', baseApi:process.env.NODE_ENV === 'development' ? '/admin-api' : '/api/admin-api', // 应用信息 appInfo: { diff --git a/src/pages.json b/src/pages.json index 66f3a32..7c4ad62 100644 --- a/src/pages.json +++ b/src/pages.json @@ -122,6 +122,13 @@ "navigationBarBackgroundColor": "#409eff", "navigationBarTextStyle": "white" } + },{ + "path": "pages/overhaulOrder/reqairOrderList", + "style": { + "navigationBarTitleText": "选择维修工单", + "navigationBarBackgroundColor": "#409eff", + "navigationBarTextStyle": "white" + } },{ "path": "pages/upkeepOrder/index", "style": { diff --git a/src/pages/deviceReport/addForm.vue b/src/pages/deviceReport/addForm.vue index 8ffff44..acafdee 100644 --- a/src/pages/deviceReport/addForm.vue +++ b/src/pages/deviceReport/addForm.vue @@ -5,7 +5,7 @@ - + + + + + {{selectFormat(form.type,appDeviceMoldType)}} {{`请选择类型`}} @@ -28,7 +28,7 @@ - + + + + + 扫描 + + + + + + + + - + + + + @@ -85,17 +101,21 @@ deviceName: '', factoryAreaName: '', factoryAreaNumber: '', - receiverType: '' + type: '' }, singleColumnShow: false, singleColumnDefaultValue: [], singleColumnList: [], - imgList: [] + imgList: [], } }, methods: { // 扫描设备条码 chickRightButton(field) { + if(!this.form.type){ + this.$modal.showToast('请先选择类型') + return; + } uni.scanCode({ success: function(res) { this.form.deviceNumber = res.result @@ -104,8 +124,12 @@ }); }, blur() { - if (this.form.deviceNumber) { - this.getDetailsByNumber() + if(this.form.deviceNumber){ + this.getDetailsByNumber() + }else{ + this.form.deviceName ='' + this.form.factoryAreaName = '' + this.form.factoryAreaNumber = '' } }, // 获取厂区列表 @@ -125,29 +149,55 @@ // 根据设备/模具号查询信息 getDetailsByNumber() { if (this.type == 'DEVICE'||this.type == 'TECH') { - deviceApi.getDeviceByFactoryAreaNumber(this.form.factoryAreaNumber).then((res) => { - if (res.data && res.data.length > 0) { - res.data.map(item => { - item.value = item.number - item.label = item.name - }) - this.deviceList = res.data - } else { - this.deviceList = [] + deviceApi.getDeviceDetailsByNumber({ + number:this.form.deviceNumber, + type:this.type + }).then((res) => { + // if (res.data && res.data.length > 0) { + // res.data.map(item => { + // item.value = item.number + // item.label = item.name + // }) + // this.deviceList = res.data + // } else { + // this.deviceList = [] + // } + if(!res.data){ + this.$modal.showToast('找不到该设备') + this.form.deviceName ='' + this.form.factoryAreaName = '' + this.form.factoryAreaNumber = '' + return; } - }).catch(()=>{}) + this.form.deviceName = res.data.name + this.form.factoryAreaName = res.data.factoryAreaName + this.form.factoryAreaNumber = res.data.factoryAreaNumber + }).catch(()=>{ + this.$modal.showToast('找不到该设备') + this.form.deviceName ='' + this.form.factoryAreaName = '' + this.form.factoryAreaNumber = '' + }) } else if (this.type == 'MOLD') { - moldApi.getMoldByFactoryAreaNumber(this.form.factoryAreaNumber).then((res) => { - if (res.data && res.data.length > 0) { - res.data.map(item => { - item.value = item.number - item.label = item.name - }) - this.deviceList = res.data - } else { - this.deviceList = [] + moldApi.getMoldDetailsByNumber({ + number:this.form.deviceNumber + }).then((res) => { + if(!res.data){ + this.$modal.showToast('找不到该设备') + this.form.deviceName ='' + this.form.factoryAreaName = '' + this.form.factoryAreaNumber = '' + return; } - }).catch(()=>{}) + this.form.deviceName = res.data.name + this.form.factoryAreaName = res.data.factoryAreaName + this.form.factoryAreaNumber = res.data.factoryAreaNumber + }).catch(()=>{ + this.$modal.showToast('找不到该设备') + this.form.deviceName ='' + this.form.factoryAreaName = '' + this.form.factoryAreaNumber = '' + }) } }, // 触发提交表单 @@ -165,7 +215,7 @@ this.$modal.showToast(`请选择${this.type=='DEVICE'||this.type=='TECH'?'设备' : '模具'}`) return; } - if (!this.form.receiverType) { + if (!this.form.type) { this.$modal.showToast(`请选择类型'}`) return; } @@ -173,7 +223,6 @@ describes: this.form.describes, deviceNumber: this.form.deviceNumber, factoryAreaNumber: this.form.factoryAreaNumber, - receiverType: this.form.receiverType, type: this.type, filePathList: this.imgList, } @@ -227,8 +276,9 @@ this.form.deviceName = '' this.getDetailsByNumber() } - if (this.field == 'receiverType') { + if (this.field == 'type') { this.type = this.form[this.field] + this.getDetailsByNumber() } this.singleColumnShow = false this.$emit('singleColumn', this.field, this.form[this.field]) @@ -275,8 +325,8 @@ title:'模具报修' }) this.appDeviceMoldType = this.appDeviceMoldType.filter((item => item.value == "MOLD")) - this.form.receiverType = this.appDeviceMoldType[0].value } + this.form.type = this.appDeviceMoldType[0].value this.getFactoryAreaList() } } diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue index 52c8637..cff4c65 100644 --- a/src/pages/mine/index.vue +++ b/src/pages/mine/index.vue @@ -1,5 +1,5 @@