diff --git a/src/pages/xinrui/equipment/ScanInStore.vue b/src/pages/xinrui/equipment/ScanInStore.vue index 2f9dc19..dac5f16 100644 --- a/src/pages/xinrui/equipment/ScanInStore.vue +++ b/src/pages/xinrui/equipment/ScanInStore.vue @@ -96,9 +96,12 @@ export default { async _queryIODis (e) { let res = await queryIODis(e, this.$store.getters.materObj.iostorinvdtl_id) if (res.code === '1') { - if (this.dataList.indexOf(res.content) > -1) { - } else { + if (!this.dataList.length) { this.dataList.push(res.content) + } else { + if (JSON.stringify(this.dataList).indexOf(JSON.stringify(res.content)) == -1) { + this.dataList.push(res.content) + } } } else { this.Dialog(res.desc) @@ -109,6 +112,9 @@ export default { let res = await confirmDis('0', this.$store.getters.materObj, this.dataList) if (res.code === '1') { this.toast(res.desc) + this.$router.push({ + path: '/SparePartInstore' + }) } else { this.Dialog(res.desc) } diff --git a/src/pages/xinrui/equipment/ScanOutStore.vue b/src/pages/xinrui/equipment/ScanOutStore.vue index 940c75c..2587239 100644 --- a/src/pages/xinrui/equipment/ScanOutStore.vue +++ b/src/pages/xinrui/equipment/ScanOutStore.vue @@ -98,9 +98,12 @@ export default { async _queryIODis (e) { let res = await queryIODis(e, this.$store.getters.materObj.iostorinvdtl_id) if (res.code === '1') { - if (this.dataList.indexOf(res.content) > -1) { - } else { + if (!this.dataList.length) { this.dataList.push(res.content) + } else { + if (JSON.stringify(this.dataList).indexOf(JSON.stringify(res.content)) == -1) { + this.dataList.push(res.content) + } } } else { this.Dialog(res.desc) @@ -111,6 +114,9 @@ export default { let res = await confirmDis('1', this.$store.getters.materObj, this.dataList) if (res.code === '1') { this.toast(res.desc) + this.$router.push({ + path: '/SparePartOutstore' + }) } else { this.Dialog(res.desc) } diff --git a/src/pages/xinrui/equipment/UseReturn.vue b/src/pages/xinrui/equipment/UseReturn.vue index ce77278..472f76e 100644 --- a/src/pages/xinrui/equipment/UseReturn.vue +++ b/src/pages/xinrui/equipment/UseReturn.vue @@ -15,7 +15,7 @@ 备件唯一编码 - + {{e.sparepart_only_id}} @@ -31,7 +31,7 @@ 源单类型 关联设备 - + {{e.material_name}} {{e.material_model}} {{e.material_spec}} @@ -45,7 +45,7 @@
- +
@@ -82,13 +82,18 @@ export default { async _queryReturnDis () { let res = await queryReturnDis(this.val1) if (res.code === '1') { - this.dataList.map((el) => { - if (el.sparepart_only_id === this.val1) { - this.dataList.push(res.content) - } else { - this.toast('关联设备不一致') + this.dataList.length && this.dataList.map((el) => { + if (el.sparepart_only_id !== this.val1) { + if (el.device_code === res.content.device_code) { + this.dataList.push(res.content) + } else { + this.toast('关联设备不一致') + } } }) + if (!this.dataList.length) { + this.dataList.push(res.content) + } } else { this.Dialog(res.desc) }