From 6e5fb6b0577eb35a388594e9724cd4d8a799c67b Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Mon, 3 Jul 2023 14:11:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8A=E6=88=90=E5=93=81=E7=9B=98=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/utils.js | 18 ++- src/pages/Login.vue | 2 +- src/pages/homeset/HomePage.vue | 4 +- src/pages/modules/semifinished/index.vue | 2 +- .../semifinished/semi-finished-check.vue | 44 ++++-- .../semi-finished-in-mater-search.vue | 3 + .../semi-finished-instore-search.vue | 4 +- .../semifinished/semi-finished-instore.vue | 2 +- .../semi-finished-out-mater-search.vue | 5 + .../semifinished/semi-finished-outstore.vue | 6 +- .../semifinished/struct-mater-search.vue | 142 ++++++++++++++++++ src/router/index.js | 5 + src/vuex/modules/data.js | 9 ++ src/vuex/types.js | 1 + 14 files changed, 221 insertions(+), 26 deletions(-) create mode 100644 src/pages/modules/semifinished/struct-mater-search.vue diff --git a/src/config/utils.js b/src/config/utils.js index 681c362..a5cd8cd 100644 --- a/src/config/utils.js +++ b/src/config/utils.js @@ -152,10 +152,16 @@ export const accMul = (arg1, arg2) => { * 小数除法 */ export const accDiv = (arg1, arg2) => { - var m = 0 - var s1 = arg1.toString() - var s2 = arg2.toString() - try { m += s1.split('.')[1].length } catch (e) {} - try { m += s2.split('.')[1].length } catch (e) {} - return Number(s1.replace('.', '')) / Number(s2.replace('.', '')) / Math.pow(10, m) + var t1 = 0 + var t2 = 0 + var r1, r2 + try { + t1 = arg1.toString().split('.')[1].length + } catch (e) {} + try { + t2 = arg2.toString().split('.')[1].length + } catch (e) {} + r1 = Number(arg1.toString().replace('.', '')) + r2 = Number(arg2.toString().replace('.', '')) + return (r1 / r2) * Math.pow(10, t2 - t1) } diff --git a/src/pages/Login.vue b/src/pages/Login.vue index 015baae..4effb4d 100644 --- a/src/pages/Login.vue +++ b/src/pages/Login.vue @@ -152,7 +152,7 @@ export default { let res = await handLogin(this.loginname, encrypt(this.password)) this.$store.dispatch('saveUserInfo', JSON.stringify(res.user.user)) this.$store.dispatch('saveToken', res.token) - this.$router.push('/workorderassignment') + this.$router.push('/home') this.disabled = false } catch (e) { this.disabled = false diff --git a/src/pages/homeset/HomePage.vue b/src/pages/homeset/HomePage.vue index 40ee194..6f97727 100644 --- a/src/pages/homeset/HomePage.vue +++ b/src/pages/homeset/HomePage.vue @@ -36,8 +36,10 @@ export default { }, created () { this.$store.dispatch('setMaterObj', '') + this.$store.dispatch('setMaterArr', []) this.$store.dispatch('setKeepAlive', []) localStorage.removeItem('materObj') + localStorage.removeItem('materArr') localStorage.removeItem('keepAlive') this._authority() }, @@ -55,7 +57,7 @@ export default { toPage2 (e) { let url = e.path let name = url.substr(1) - if (name === 'semifinishedinstore' || name === 'semifinishedoutstore') { + if (name === 'semifinishedinstore' || name === 'semifinishedoutstore' || name === 'semifinishedcheck') { this.$store.dispatch('setKeepAlive', [name]) } this.$router.push(url) diff --git a/src/pages/modules/semifinished/index.vue b/src/pages/modules/semifinished/index.vue index e06c88e..077770b 100644 --- a/src/pages/modules/semifinished/index.vue +++ b/src/pages/modules/semifinished/index.vue @@ -26,7 +26,7 @@ export default { }, computed: { title () { - let res = ['半成品入库', '半成品入库查询', '半成品出库', '半成品出库查询', '半成品盘点', '半成品盘点查询', '半成品拼盘查询', '物料查询', '物料查询'][Number(this.$route.meta.guidePath) - 1] + let res = ['半成品入库', '半成品入库查询', '半成品出库', '半成品出库查询', '半成品盘点', '半成品盘点查询', '半成品拼盘查询', '物料查询', '物料查询', '货位物料查询'][Number(this.$route.meta.guidePath) - 1] return res }, ...mapGetters(['keepAlive']) diff --git a/src/pages/modules/semifinished/semi-finished-check.vue b/src/pages/modules/semifinished/semi-finished-check.vue index acd6dc1..288ca0c 100644 --- a/src/pages/modules/semifinished/semi-finished-check.vue +++ b/src/pages/modules/semifinished/semi-finished-check.vue @@ -48,7 +48,7 @@
- + @@ -71,16 +71,16 @@ - - 序号 - 序号 - 序号 - 序号 - 序号 - 序号 - 序号 - 序号 - 序号 + + {{ i + 1 }} + {{ e.sect_name }} + {{e.struct_name}} + {{e.material_code}} + {{e.material_name}} + {{e.canuse_qty | numeric(3)}} + {{ e.unit_weight | numeric(3) }} + {{ e.base_qty | numeric(3) }} + {{ e.storagevehicle_code }} @@ -89,8 +89,10 @@ + + diff --git a/src/router/index.js b/src/router/index.js index 4440a11..de125b1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -21,6 +21,7 @@ const semiFinishedCheckSearch = r => require.ensure([], () => r(require('@page/m const semiFinishedComposeSearch = r => require.ensure([], () => r(require('@page/modules/semifinished/semi-finished-compose-search')), 'semifinished') const semiFinishedInmaterSearch = r => require.ensure([], () => r(require('@page/modules/semifinished/semi-finished-in-mater-search')), 'semifinished') const semiFinishedOutMaterSearch = r => require.ensure([], () => r(require('@page/modules/semifinished/semi-finished-out-mater-search')), 'semifinished') +const structMaterSearch = r => require.ensure([], () => r(require('@page/modules/semifinished/struct-mater-search')), 'semifinished') const Homeset = r => require.ensure([], () => r(require('@page/homeset/index')), 'Homeset') const Home = r => require.ensure([], () => r(require('@page/homeset/HomePage')), 'HomePage') @@ -116,6 +117,10 @@ export default new Router({ path: '/semifinishedoutmatersearch', component: semiFinishedOutMaterSearch, meta: {guidePath: '9'} + }, { + path: '/structmatersearch', + component: structMaterSearch, + meta: {guidePath: '10'} }] }, { diff --git a/src/vuex/modules/data.js b/src/vuex/modules/data.js index e439573..48d1133 100644 --- a/src/vuex/modules/data.js +++ b/src/vuex/modules/data.js @@ -4,6 +4,7 @@ import { getStore, setStore } from '@config/utils.js' const state = { keepAlive: JSON.parse(getStore('keepAlive')) || [], // 缓存页面 materObj: getStore('materObj') || '', // 存储对象 + materArr: JSON.parse(getStore('materArr')) || [], // 存储数组 deviceUuid: getStore('deviceUuid') || '', deviceCode: getStore('deviceCode') || '', isProductonplan: getStore('isProductonplan') || '' @@ -12,6 +13,7 @@ const state = { const getters = { keepAlive: state => state.keepAlive, materObj: state => state.materObj, + materArr: state => state.materArr, deviceUuid: state => state.deviceUuid, deviceCode: state => state.deviceCode, isProductonplan: state => state.isProductonplan @@ -26,6 +28,10 @@ const actions = { setStore('materObj', res) commit(types.SET_MATER_OBJ, res) }, + setMaterArr ({commit}, res) { + setStore('materArr', res) + commit(types.SET_MATER_ARR, res) + }, setDevice ({commit}, res) { setStore('deviceUuid', res.deviceUuid) setStore('deviceCode', res.deviceCode) @@ -44,6 +50,9 @@ const mutations = { [types.SET_MATER_OBJ] (state, res) { state.materObj = res }, + [types.SET_MATER_ARR] (state, res) { + state.materArr = res + }, [types.DATA_DEVICE] (state, res) { state.deviceUuid = res.deviceUuid state.deviceCode = res.deviceCode diff --git a/src/vuex/types.js b/src/vuex/types.js index f1f5dbf..04294b2 100644 --- a/src/vuex/types.js +++ b/src/vuex/types.js @@ -15,6 +15,7 @@ export const SAVE_TOKEN = 'SAVE_TOKEN' // 缓存页面 export const SET_KEEP_ALIVE = 'SET_KEEP_ALIVE' +export const SET_MATER_ARR = 'SET_MATER_ARR' // 数据 export const SET_MATER_OBJ = 'SET_MATER_OBJ'