WMS系统文件新增,NPM添加功能(kr-print-designer打印功能插件=》预计作为二维码条码使用) (moment时间简易处理插件)(stylus stylus-loader css样式预处理)
This commit is contained in:
@@ -1,27 +1,61 @@
|
||||
const getters = {
|
||||
sidebar: (state) => state.app.sidebar,
|
||||
size: (state) => state.app.size,
|
||||
device: (state) => state.app.device,
|
||||
visitedViews: (state) => state.tagsView.visitedViews,
|
||||
cachedViews: (state) => state.tagsView.cachedViews,
|
||||
token: (state) => state.user.token,
|
||||
avatar: (state) => state.user.avatar,
|
||||
name: (state) => state.user.name,
|
||||
userId: (state) => state.user.userInfo.userId,
|
||||
introduction: (state) => state.user.introduction,
|
||||
roles: (state) => state.user.roles,
|
||||
permissions: (state) => state.user.permissions,
|
||||
permission_routes: (state) => state.permission.routes,
|
||||
userinfo: (state) => state.user.userInfo,
|
||||
topbarRouters: (state) => state.permission.topbarRouters,
|
||||
defaultRoutes: (state) => state.permission.defaultRoutes,
|
||||
sidebarRouters: (state) => state.permission.sidebarRouters,
|
||||
onlineUserNum: (state) => state.socket.onlineNum,
|
||||
noticeList: (state) => state.socket.noticeList,
|
||||
//质量管理模块
|
||||
currentWorkOrder_first: (state) => state.quality.currentWorkOrder_first,
|
||||
currentWorkOrder_again: (state) => state.quality.currentWorkOrder_again,
|
||||
currentWorkOrder_thirty: (state) => state.quality.currentWorkOrder_thirty,
|
||||
firstquality_time: (state) => state.quality.firstquality_time,
|
||||
sidebar: (state) => state.app.sidebar,
|
||||
size: (state) => state.app.size,
|
||||
device: (state) => state.app.device,
|
||||
visitedViews: (state) => state.tagsView.visitedViews,
|
||||
cachedViews: (state) => state.tagsView.cachedViews,
|
||||
token: (state) => state.user.token,
|
||||
avatar: (state) => state.user.avatar,
|
||||
name: (state) => state.user.name,
|
||||
userId: (state) => state.user.userInfo.userId,
|
||||
introduction: (state) => state.user.introduction,
|
||||
roles: (state) => state.user.roles,
|
||||
permissions: (state) => state.user.permissions,
|
||||
permission_routes: (state) => state.permission.routes,
|
||||
userinfo: (state) => state.user.userInfo,
|
||||
topbarRouters: (state) => state.permission.topbarRouters,
|
||||
defaultRoutes: (state) => state.permission.defaultRoutes,
|
||||
sidebarRouters: (state) => state.permission.sidebarRouters,
|
||||
onlineUserNum: (state) => state.socket.onlineNum,
|
||||
noticeList: (state) => state.socket.noticeList,
|
||||
//质量管理模块
|
||||
currentWorkOrder_first: (state) => state.quality.currentWorkOrder_first,
|
||||
currentWorkOrder_again: (state) => state.quality.currentWorkOrder_again,
|
||||
currentWorkOrder_thirty: (state) => state.quality.currentWorkOrder_thirty,
|
||||
firstquality_time: (state) => state.quality.firstquality_time,
|
||||
|
||||
// 字典相关
|
||||
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', 'wms_check_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,
|
||||
carrierList: state => state.wms.carrierList,
|
||||
carrierMap: state => state.wms.carrierMap,
|
||||
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
|
||||
}
|
||||
export default getters
|
||||
export default getters
|
||||
42
src/store/modules/dict.js
Normal file
42
src/store/modules/dict.js
Normal file
@@ -0,0 +1,42 @@
|
||||
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})))
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
113
src/store/modules/wms.js
Normal file
113
src/store/modules/wms.js
Normal file
@@ -0,0 +1,113 @@
|
||||
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";
|
||||
import {listWmsCarrier} from "@/api/wms/carrier";
|
||||
const state = {
|
||||
supplierList: [],
|
||||
customerList: [],
|
||||
carrierList: [],
|
||||
carrierMap: new Map(),
|
||||
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_CARRIER(state, list) {
|
||||
state.carrierList = list;
|
||||
state.carrierMap = new Map();
|
||||
list.forEach((carrier) => {
|
||||
state.carrierMap.set(carrier.id, carrier.carrierName)
|
||||
})
|
||||
},
|
||||
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);
|
||||
})
|
||||
},
|
||||
getCarrier({commit}) {
|
||||
return listWmsCarrier({}, {page: 0, size: 1000})
|
||||
.then(res => {
|
||||
const {content} = res
|
||||
commit('SET_CARRIER', 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
|
||||
}
|
||||
Reference in New Issue
Block a user