From 76eae90606b2dc2f22eea0e1b2b32a8109863627 Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Wed, 17 Aug 2022 15:08:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=81=E6=96=99=E6=B7=BB=E5=8A=A0=E7=89=A9?= =?UTF-8?q?=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/getData1.js | 7 +++++-- src/pages/login/Home.vue | 2 +- src/pages/proj/SearchMater.vue | 2 ++ src/pages/proj/SendMater.vue | 34 +++++++++++++++++++++++++++++----- 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/src/config/getData1.js b/src/config/getData1.js index a8e9a80..59f4ea2 100644 --- a/src/config/getData1.js +++ b/src/config/getData1.js @@ -31,14 +31,17 @@ export const taskOperation = (uuid, type) => post2('api/ash/hand/taskoperation', // 1.1查询工序设备点位 export const sendMaterialqueryDevice = () => post('api/pda/sendMaterial/queryDevice', {}) // 1.2压制叫料确定 -export const sendMaterialconfirm = (wid, did, pid, pcode, qty, vcode, isfull) => post('api/pda/sendMaterial/confirm', { +export const sendMaterialconfirm = (wid, did, pid, pcode, qty, vcode, isfull, mcode, mid, mname) => post('api/pda/sendMaterial/confirm', { workprocedure_id: wid, device_id: did, point_id: pid, point_code: pcode, qty: qty, vehicle_code: vcode, - is_full: isfull + is_full: isfull, + material_code: mcode, + material_id: mid, + material_name: mname }) // 压制叫料 diff --git a/src/pages/login/Home.vue b/src/pages/login/Home.vue index 2598532..74ea106 100644 --- a/src/pages/login/Home.vue +++ b/src/pages/login/Home.vue @@ -53,7 +53,7 @@ export default { methods: { toPage (e) { let name = e.path.substr(2) - if (name === 'CheckManage' || name === 'ConveyorLine' || name === 'BindMaterPoint') { + if (name === 'CheckManage' || name === 'ConveyorLine' || name === 'BindMaterPoint' || name === 'SendMater') { this.$store.dispatch('setKeepAlive', [name]) } this.$router.push(e.path.substr(2)) diff --git a/src/pages/proj/SearchMater.vue b/src/pages/proj/SearchMater.vue index 0696677..02c3d73 100644 --- a/src/pages/proj/SearchMater.vue +++ b/src/pages/proj/SearchMater.vue @@ -107,6 +107,8 @@ export default { }) } else if (this.$route.query.url === 'BindMaterPoint') { this.$router.push('/BindMaterPoint') + } else if (this.$route.query.url === 'SendMater') { + this.$router.push('/SendMater') } else { this.$router.push({ path: 'CheckManage', diff --git a/src/pages/proj/SendMater.vue b/src/pages/proj/SendMater.vue index 3d503aa..80f68de 100644 --- a/src/pages/proj/SendMater.vue +++ b/src/pages/proj/SendMater.vue @@ -42,7 +42,7 @@
物料编码
- +
- +
@@ -83,7 +83,7 @@ import SearchBox from '@components/SearchBox.vue' import DropdownMenu from '@components/DropdownMenu.vue' import {sendMaterialqueryDevice, sendMaterialconfirm} from '@config/getData1' export default { - name: 'BindPalletPoint', + name: 'SendMater', components: { NavBar, SearchBox, @@ -94,6 +94,8 @@ export default { val1: '', val2: '', val3: '', + materId: '', + materCode: '', option1: [], active1: '', open1: false, @@ -109,6 +111,19 @@ export default { disabled1: false } }, + beforeRouteLeave (to, from, next) { + if (to.path === '/home' || to.path === '/login') { + this.$store.dispatch('setKeepAlive', []) + } + next() + }, + activated () { + if (JSON.stringify(this.$store.getters.receiveMaterObj) !== '{}') { + this.materCode = this.$store.getters.receiveMaterObj.material_code + this.materId = this.$store.getters.receiveMaterObj.material_id + this.val3 = this.$store.getters.receiveMaterObj.material_name + } + }, created () { this._sendMaterialqueryDevice() }, @@ -139,12 +154,12 @@ export default { /** 确认 */ async _sendMaterialconfirm () { this.disabled1 = true - if (this.val1 === '' || this.val2 === '' || this.active1 === '' || this.active2 === '' || this.active3 === '' || this.active4 === '') { + if (this.val1 === '' || this.val2 === '' || this.val3 === '' || this.active1 === '' || this.active2 === '' || this.active3 === '' || this.active4 === '') { this.disabled1 = false return } try { - let res = await sendMaterialconfirm(this.option1[this.active1].value, this.option2[this.active2].value, this.option3[this.active3].value, this.option3[this.active3].point_code, this.val2, this.val1, this.option4[this.active4].value) + let res = await sendMaterialconfirm(this.option1[this.active1].value, this.option2[this.active2].value, this.option3[this.active3].value, this.option3[this.active3].point_code, this.val2, this.val1, this.option4[this.active4].value, this.materCode, this.materId, this.val3) if (res.code === '1') { this.toast(res.desc) this.toCancle() @@ -160,6 +175,9 @@ export default { toCancle () { this.val1 = '' this.val2 = '' + this.val3 = '' + this.materId = '' + this.materCode = '' this.active1 = '' this.active2 = '' this.active3 = '' @@ -219,6 +237,12 @@ export default { dropdownMenu4 (i) { this.active4 = i + '' this.open4 = false + }, + getMater () { + this.$router.push({ + path: '/SearchMater', + query: {url: 'SendMater'} + }) } } }