diff --git a/klp-ui/src/App.vue b/klp-ui/src/App.vue index df2ff63b..f616137d 100644 --- a/klp-ui/src/App.vue +++ b/klp-ui/src/App.vue @@ -15,6 +15,8 @@ export default { // 应用启动时全局初始化分类数据 if (this.$store.getters.token) { this.$store.dispatch('category/getCategoryList'); + this.$store.dispatch('category/getProductMap'); + this.$store.dispatch('category/getRawMaterialMap'); } console.log(this.$store) }, diff --git a/klp-ui/src/components/KLPService/Renderer/ProductInfo.vue b/klp-ui/src/components/KLPService/Renderer/ProductInfo.vue new file mode 100644 index 00000000..ce0df4ce --- /dev/null +++ b/klp-ui/src/components/KLPService/Renderer/ProductInfo.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/klp-ui/src/components/KLPService/Renderer/RawMaterialInfo.vue b/klp-ui/src/components/KLPService/Renderer/RawMaterialInfo.vue new file mode 100644 index 00000000..3d484a72 --- /dev/null +++ b/klp-ui/src/components/KLPService/Renderer/RawMaterialInfo.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/klp-ui/src/components/KLPService/index.js b/klp-ui/src/components/KLPService/index.js index 6a9aee4a..7ffcd09b 100644 --- a/klp-ui/src/components/KLPService/index.js +++ b/klp-ui/src/components/KLPService/index.js @@ -5,3 +5,5 @@ export { default as RawMaterialSelect } from './RawMaterialSelect/index.vue'; export { default as CategoryRenderer } from './Renderer/CategoryRenderer.vue'; export { default as UserSelect } from './UserSelect/index.vue'; export { default as WarehouseSelect } from './WarehouseSelect/index.vue'; +export { default as ProductInfo } from './Renderer/ProductInfo.vue'; +export { default as RawMaterialInfo } from './Renderer/RawMaterialInfo.vue'; diff --git a/klp-ui/src/store/modules/category.js b/klp-ui/src/store/modules/category.js index 146e9dea..62fa9d33 100644 --- a/klp-ui/src/store/modules/category.js +++ b/klp-ui/src/store/modules/category.js @@ -1,12 +1,22 @@ import { listCategory } from '@/api/wms/category'; +import { listProduct } from '@/api/wms/product'; +import { listRawMaterial } from '@/api/wms/rawMaterial'; const state = { - categoryList: [] + categoryList: [], + productMap: {}, + rawMaterialMap: {} }; const mutations = { SET_CATEGORY_LIST(state, list) { state.categoryList = list; + }, + SET_PRODUCT_MAP(state, map) { + state.productMap = map; + }, + SET_RAW_MATERIAL_MAP(state, map) { + state.rawMaterialMap = map; } }; @@ -19,6 +29,32 @@ const actions = { commit('SET_CATEGORY_LIST', res.rows || []); return res.rows || []; }); + }, + getProductMap({ state, commit }) { + if (Object.keys(state.productMap).length > 0) { + return Promise.resolve(state.productMap); + } + return listProduct().then(res => { + const map = {}; + res.rows.forEach(item => { + map[item.productId] = item; + }); + commit('SET_PRODUCT_MAP', map); + return map; + }); + }, + getRawMaterialMap({ state, commit }) { + if (Object.keys(state.rawMaterialMap).length > 0) { + return Promise.resolve(state.rawMaterialMap); + } + return listRawMaterial().then(res => { + const map = {}; + res.rows.forEach(item => { + map[item.rawMaterialId] = item; + }); + commit('SET_RAW_MATERIAL_MAP', map); + return map; + }); } }; diff --git a/klp-ui/src/views/login.vue b/klp-ui/src/views/login.vue index c7b9a6df..fb47f7f4 100644 --- a/klp-ui/src/views/login.vue +++ b/klp-ui/src/views/login.vue @@ -142,6 +142,8 @@ export default { } this.$store.dispatch("Login", this.loginForm).then(() => { this.$store.dispatch('category/getCategoryList'); + this.$store.dispatch('category/getProductMap'); + this.$store.dispatch('category/getRawMaterialMap'); this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); }).catch(() => { this.loading = false; diff --git a/klp-ui/src/views/wms/order/index.vue b/klp-ui/src/views/wms/order/index.vue index 8d73e67a..b5170fa2 100644 --- a/klp-ui/src/views/wms/order/index.vue +++ b/klp-ui/src/views/wms/order/index.vue @@ -126,7 +126,7 @@ icon="el-icon-s-operation" @click="showClac(scope.row)" v-if="scope.row.orderStatus === EOrderStatus.NEW" - >智能采购单 + >初次采购推荐 diff --git a/klp-ui/src/views/wms/productSalesScript/index.vue b/klp-ui/src/views/wms/productSalesScript/index.vue index eb8ba277..85da8da0 100644 --- a/klp-ui/src/views/wms/productSalesScript/index.vue +++ b/klp-ui/src/views/wms/productSalesScript/index.vue @@ -59,6 +59,7 @@
产品ID: {{ item.productName }} ({{ item.productCode }})
备注: {{ item.remark }}
+ 详情 修改 删除
diff --git a/klp-ui/src/views/wms/purchasePlan/panels/clac.vue b/klp-ui/src/views/wms/purchasePlan/panels/clac.vue index e22db312..8776ee6d 100644 --- a/klp-ui/src/views/wms/purchasePlan/panels/clac.vue +++ b/klp-ui/src/views/wms/purchasePlan/panels/clac.vue @@ -15,6 +15,8 @@