From 90614ad7f22db0cf6f18d1a25ea6f5f1aeae113d Mon Sep 17 00:00:00 2001 From: zhaochencheng Date: Wed, 16 Nov 2022 17:37:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=B8=80=E4=BA=9B=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ItemSelect.vue | 69 --------- src/config/business.js | 3 - src/main.js | 16 --- src/permission.js | 5 - src/store/getters.js | 40 +----- src/store/index.js | 6 +- src/store/modules/dict.js | 42 ------ src/store/modules/wms.js | 98 ------------- src/views/components/ItemSelect.vue | 213 ---------------------------- 9 files changed, 5 insertions(+), 487 deletions(-) delete mode 100644 src/components/ItemSelect.vue delete mode 100644 src/config/business.js delete mode 100644 src/store/modules/dict.js delete mode 100644 src/store/modules/wms.js delete mode 100644 src/views/components/ItemSelect.vue diff --git a/src/components/ItemSelect.vue b/src/components/ItemSelect.vue deleted file mode 100644 index 3a07072..0000000 --- a/src/components/ItemSelect.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - - diff --git a/src/config/business.js b/src/config/business.js deleted file mode 100644 index 4b346bd..0000000 --- a/src/config/business.js +++ /dev/null @@ -1,3 +0,0 @@ -export const DICT_TYPES = [ - 'wms_receipt_type', 'wms_shipment_type', 'wms_movement_type' -] diff --git a/src/main.js b/src/main.js index 70e4bd4..bd2b6a2 100644 --- a/src/main.js +++ b/src/main.js @@ -37,21 +37,11 @@ import DictTag from '@/components/DictTag' import VueMeta from 'vue-meta' // 字典数据组件 import DictData from '@/components/DictData' -//wms table组件 -import WmsTable from '@/components/WmsTable' - -import WmsSupplierSelect from '@/components/WmsSupplierSelect' -import WmsCustomerSelect from '@/components/WmsCustomerSelect' -import KrPrintDesigner from "kr-print-designer"; -import "kr-print-designer/lib/kr-print-designer.css"; import DictRadio from '@/components/DictRadio' import DictSelect from '@/components/DictSelect' -import WmsWarehouseCascader from '@/components/WmsWarehouseCascader' -import vuePlugsPrint from '@/utils/vuePlugsPrint' - // 全局方法挂载 Vue.prototype.getDicts = getDicts Vue.prototype.getConfigKey = getConfigKey @@ -71,15 +61,9 @@ Vue.component('Editor', Editor) Vue.component('FileUpload', FileUpload) Vue.component('ImageUpload', ImageUpload) Vue.component('ImagePreview', ImagePreview) -Vue.component('WmsTable',WmsTable) -Vue.component('WmsSupplierSelect',WmsSupplierSelect) -Vue.component('WmsCustomerSelect',WmsCustomerSelect) Vue.component('DictRadio',DictRadio) Vue.component('DictSelect',DictSelect) -Vue.component('WmsWarehouseCascader',WmsWarehouseCascader) -Vue.use(KrPrintDesigner); -Vue.use(vuePlugsPrint); Vue.use(directive) Vue.use(plugins) Vue.use(VueMeta) diff --git a/src/permission.js b/src/permission.js index e8c5141..1055d6a 100644 --- a/src/permission.js +++ b/src/permission.js @@ -22,11 +22,6 @@ router.beforeEach((to, from, next) => { //当页面刷新,vuex里面没值,请求重新获取,数据会重新初始化 if (store.getters.roles.length === 0) { isRelogin.show = true - store.dispatch("wms/getWarehouseList"); - store.dispatch("wms/getAreaList"); - store.dispatch("wms/getRackList"); - store.dispatch('wms/getSuppliers') - store.dispatch('wms/getCustomer') // 判断当前用户是否已拉取完user_info信息 store.dispatch('GetInfo').then(() => { isRelogin.show = false diff --git a/src/store/getters.js b/src/store/getters.js index aaba52f..a7e55ba 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -11,40 +11,8 @@ const getters = { roles: state => state.user.roles, permissions: state => state.user.permissions, permission_routes: state => state.permission.routes, - topbarRouters: state => state.permission.topbarRouters, - defaultRoutes: state => state.permission.defaultRoutes, - sidebarRouters: state => state.permission.sidebarRouters, - - // 字典相关 - items: state => state.dict.items, - dictTypeMap: state => state.dict.dictTypeMap, - opTypes: state => { - const map = state.dict.dictTypeMap - let res = []; - ['wms_receipt_type', 'wms_shipment_type', 'wms_movement_type'].forEach(it => { - if (!map[it]) { - return - } - res = res.concat(map[it]) - }) - return res - }, - opTypeMap: (state, getters) => { - const arr = getters.opTypes, map = {}; - arr.forEach(it => map[it.value] = it.label); - return map; - }, - - // wms相关 - supplierList: state => state.wms.supplierList, - customerList: state => state.wms.customerList, - customerMap: state => state.wms.customerMap, - supplierMap: state => state.wms.supplierMap, - warehouseList: state => state.wms.warehouseList, - warehouseMap: state => state.wms.warehouseMap, - areaList: state => state.wms.areaList, - areaMap: state => state.wms.areaMap, - rackList: state => state.wms.rackList, - rackMap: state => state.wms.rackMap + topbarRouters:state => state.permission.topbarRouters, + defaultRoutes:state => state.permission.defaultRoutes, + sidebarRouters:state => state.permission.sidebarRouters, } -export default getters +export default getters \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index e70241d..53b8437 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -5,8 +5,6 @@ import user from './modules/user' import tagsView from './modules/tagsView' import permission from './modules/permission' import settings from './modules/settings' -import dict from './modules/dict' -import wms from './modules/wms' import getters from './getters' Vue.use(Vuex) @@ -17,9 +15,7 @@ const store = new Vuex.Store({ user, tagsView, permission, - settings, - dict, - wms + settings }, getters }) diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js deleted file mode 100644 index f0883d6..0000000 --- a/src/store/modules/dict.js +++ /dev/null @@ -1,42 +0,0 @@ -import { allWmsItem } from '@/api/wms/item' -import { listByTypes } from '@/api/system/dict/data' -import { DICT_TYPES } from '@/config/business' -export default { - state: { - items: [], - dictTypeMap: {}, - }, - mutations: { - SET_ITEMS(state, list) { - state.items = list - }, - SET_DICT_TYPE_MAP(state, list) { - const map = {}; - list.forEach(it => { - const {dictType} = it; - let arr = map[dictType]; - if (!arr) { - arr = []; - map[dictType] = arr; - } - arr.push(it); - }) - state.dictTypeMap = map; - } - }, - actions: { - loadItems({commit}) { - return allWmsItem() - .then(res => { - commit('SET_ITEMS', res); - return res - }) - }, - loadAllDict({ commit }) { - listByTypes(DICT_TYPES).then(res => { - const { rows } = res - commit('SET_DICT_TYPE_MAP', rows.map(it => ({value: it.dictValue, label: it.dictLabel, dictType: it.dictType}))) - }) - } - } -} diff --git a/src/store/modules/wms.js b/src/store/modules/wms.js deleted file mode 100644 index 7ff0f3d..0000000 --- a/src/store/modules/wms.js +++ /dev/null @@ -1,98 +0,0 @@ -import { listWmsSupplier } from "@/api/wms/supplier"; -import { listWmsWarehouse } from "@/api/wms/warehouse"; -import { listWmsArea } from "@/api/wms/area"; -import { listWmsRack } from "@/api/wms/rack"; -import {listWmsCustomer} from "@/api/wms/customer"; - -const state = { - supplierList: [], - customerList: [], - customerMap: new Map(), - supplierMap: new Map(), - warehouseList: [], - warehouseMap: new Map(), - areaList:[], - areaMap:new Map(), - rackList:[], - rackMap:new Map() -} -const mutations = { - SET_SUPPLIERS(state, list) { - state.supplierList = list; - state.supplierMap = new Map(); - list.forEach((supplier) => { - state.supplierMap.set(supplier.id, supplier.supplierName) - }) - }, - SET_CUSTOMERS(state, list) { - state.customerList = list; - state.customerMap = new Map(); - list.forEach((customer) => { - state.customerMap.set(customer.id, customer.customerName) - }) - }, - SET_WAREHOUSE(state, list){ - state.warehouseList = list; - state.warehouseMap = new Map(); - list.forEach((warehouse) => { - state.warehouseMap.set(warehouse.id, warehouse.warehouseName) - }) - }, - SET_AREA(state, list){ - state.areaList = list; - state.areaMap = new Map(); - list.forEach((area) => { - state.areaMap.set(area.id, area.areaName) - }) - }, - SET_RACK(state, list){ - state.rackList = list; - state.rackMap = new Map(); - list.forEach((rack) => { - state.rackMap.set(rack.id, rack.rackName) - }) - }, -} -const actions = { - getSuppliers({ commit }) { - return listWmsSupplier({}, { page: 0, size: 1000 }) - .then(res => { - const { content } =res - commit('SET_SUPPLIERS', content); - }) - }, - getCustomer({ commit }) { - return listWmsCustomer({}, { page: 0, size: 1000 }) - .then(res => { - const { content } =res - commit('SET_CUSTOMERS', content); - }) - }, - getWarehouseList({ commit }) { - return listWmsWarehouse({}, { page: 0, size: 1000 }) - .then(res => { - const { content } =res - commit('SET_WAREHOUSE', content); - }) - }, - getAreaList({ commit }) { - return listWmsArea({}, { page: 0, size: 1000 }) - .then(res => { - const { content } =res - commit('SET_AREA', content); - }) - }, - getRackList({ commit }) { - return listWmsRack({}, { page: 0, size: 1000 }) - .then(res => { - const { content } =res - commit('SET_RACK', content); - }) - }, -} -export default { - namespaced: true, - state, - mutations, - actions -} diff --git a/src/views/components/ItemSelect.vue b/src/views/components/ItemSelect.vue deleted file mode 100644 index c30438f..0000000 --- a/src/views/components/ItemSelect.vue +++ /dev/null @@ -1,213 +0,0 @@ - - - - -