diff --git a/src/pages/repairOrder/detail.vue b/src/pages/repairOrder/detail.vue index 7441ea8..4a299a9 100644 --- a/src/pages/repairOrder/detail.vue +++ b/src/pages/repairOrder/detail.vue @@ -409,7 +409,7 @@ }) }, transfer() { - this.$tab.navigateTo(`/pages/repairOrder/transfer?type=${this.data.type}&id=${this.data.id}`) + this.$tab.navigateTo(`/pages/repairOrder/transfer?type=${this.data.type}&id=${this.data.id}&deviceNumber=${this.data.deviceNumber}`) }, previewImage(current, array) { uni.previewImage({ diff --git a/src/pages/repairOrder/transfer.vue b/src/pages/repairOrder/transfer.vue index ce1a886..dac0772 100644 --- a/src/pages/repairOrder/transfer.vue +++ b/src/pages/repairOrder/transfer.vue @@ -2,6 +2,17 @@ + + + + {{selectFormat(form.status,tansferType)}} + + + {{`请选择转办类型`}} + + + + @@ -13,13 +24,24 @@ - + + + + {{selectFormat(form.factoryAreaNumber,factoryAreaList)}} + + + {{`请选择厂区名称`}} + + + + + 扫描 - + @@ -82,6 +104,7 @@ deviceNumber: '', deviceName: '', receiverUserId: '', + status:0 }, deviceList: [], //设备列表 singleColumnShow: false, @@ -91,6 +114,16 @@ // 维修人员 selecUserList: [], //维修人员 isShowSelecUser: false, + + // 转办类型 + tansferType:[{ + value:0, + label:'设备' + },{ + value:1, + label:'人员' + }], + deviceNumber:'',//主页面设备编码 } }, methods: { @@ -101,8 +134,15 @@ this.$modal.showToast('请选择类型') return; } - if (!this.form.deviceNumber) { - this.$modal.showToast(`请选择${this.type=='DEVICE'||this.type=='TECH'?'设备' : '模具'}编码`) + if(this.form.status == 0){ + if (!this.form.deviceNumber) { + this.$modal.showToast(`请选择${this.type=='DEVICE'||this.type=='TECH'?'设备' : '模具'}编码`) + return; + } + } + + if (!this.form.factoryAreaNumber) { + this.$modal.showToast('请选择厂区') return; } if (!this.form.receiverUserId) { @@ -112,9 +152,10 @@ const data = { id: this.form && this.form.id ? this.form.id : '', receiverType: this.form.receiverType, - deviceNumber: this.form.deviceNumber, + deviceNumber: this.form.status == 0 ? this.form.deviceNumber : this.deviceNumber, receiverUserId: this.form.receiverUserId, factoryAreaNumber: this.form.factoryAreaNumber, + status: this.form.status, } this.$modal.confirm('是否转办维修工单').then(() => { this.$modal.loading('加载中') @@ -257,6 +298,8 @@ this.form.factoryAreaNumber = this.choosesingleColumnItem[0].factoryAreaNumber this.form.receiverUserId = undefined this.getSelecUser() + }else if(this.field == 'factoryAreaNumber'){ + this.getSelecUser() } this.singleColumnShow = false this.$emit('singleColumn', this.field, this.form[this.field]) @@ -288,7 +331,6 @@ let data = { classType: this.type, factoryAreaNumber: this.form.factoryAreaNumber, - flag: 1 } let arr = [] if (this.form.maintenances) { @@ -324,13 +366,30 @@ this.form[this.field] = this.chooseUserInfo this.isShowSelecUser = false }, + // 获取厂区列表 + getFactoryAreaList() { + deptApi.getFactoryAreaList().then((res) => { + if (res.data && res.data.length > 0) { + res.data.map(item => { + item.value = item.id + item.label = item.name + }) + this.factoryAreaList = res.data + } else { + this.factoryAreaList = [] + } + }).catch(()=>{}) + }, }, async onLoad(option) { if (option.type) this.type = option.type; if (option.id) this.form.id = option.id; + if (option.deviceNumber) this.deviceNumber = option.deviceNumber; + this.deviceMoldType = await dictApi.getDict('app_device_mold_type') this.form.receiverType = this.deviceMoldType[0].value // this.deviceMoldType = this.deviceMoldType.filter(item => item.value != this.type) + this.getFactoryAreaList() } }