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 @@