From c892dcfe98c4060d390c8642d3ada31b93c55895 Mon Sep 17 00:00:00 2001 From: juzi <819872918@qq.com> Date: Fri, 21 Oct 2022 14:09:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=89=8D4=E4=B8=AA=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/wmsDic.js | 161 ++++++++++++++++++ src/views/wmsInStore/acceptGoods.vue | 18 +- src/views/wmsInStore/inStoreDocuments.vue | 20 +-- src/views/wmsInStore/warehouseOperation.vue | 14 +- .../wmsInventoryManagement/inventory.vue | 14 +- .../wmsInventoryManagement/inventoryQuery.vue | 32 ++-- .../wmsInventoryManagement/locationQuery.vue | 17 +- .../wmsInventoryManagement/stockTaking.vue | 22 +-- src/views/wmsOutStore/outStoreDocuments.vue | 17 +- src/views/wmsOutStore/outStoreOperation.vue | 17 +- .../wmsStatisticalReports/inventoryReport.vue | 30 ++-- .../wmsStatisticalReports/outStoreReport.vue | 20 +-- 12 files changed, 264 insertions(+), 118 deletions(-) create mode 100644 src/utils/wmsDic.js diff --git a/src/utils/wmsDic.js b/src/utils/wmsDic.js new file mode 100644 index 0000000..2001824 --- /dev/null +++ b/src/utils/wmsDic.js @@ -0,0 +1,161 @@ +import moment from 'moment' +// 托盘List +export function getTrayList() { + let trayID = 'TP' + for (let i = 0; i < 3; i++) { + trayID += parseInt(Math.random() * 89 + 10) + } + return trayID +} +// 成品内控码List +export function getProductList() { + let prodCode = 'CP' + for (let i = 0; i < 5; i++) { + prodCode += parseInt(Math.random() * 89 + 10) + } + return prodCode +} + +// 客户标签号List +export function getCustomerCodeList() { + let customerCode = '2022' + for (let i = 0; i < 5; i++) { + customerCode += parseInt(Math.random() * 89 + 10) + } + return customerCode +} + +// 成品规格List +export function getProductSpecList() { + const list = ['50*50mm', '70*50mm', '70*70mm', '100*50mm', '100*70mm', '100*100mm', '100*120mm', '120*120mm'] + const spec = list[parseInt(Math.random() * (list.length))] + return spec +} + +// 批次List +export function getBatchList() { + let batch = '2022' + for (let i = 0; i < 8; i++) { + batch += parseInt(Math.random() * 89 + 10) + } + return batch +} + +// 包装机List +export function getPackList() { + let batch = '0' + batch += parseInt(Math.random() * 8 + 1) + return batch +} + +// 入库单号List +export function getReceiptNoList() { + let receiptNo = 'RQD2022' + for (let i = 0; i < 3; i++) { + receiptNo += parseInt(Math.random() * 89 + 10) + } + return receiptNo +} + +// 出库单号List +export function getOutboundNoList() { + let receiptNo = 'CKD2022' + for (let i = 0; i < 3; i++) { + receiptNo += parseInt(Math.random() * 89 + 10) + } + return receiptNo +} + +// 盘点单号List +export function getInventoryNoList() { + let inventoryNumber = 'PD2022' + for (let i = 0; i < 3; i++) { + inventoryNumber += parseInt(Math.random() * 89 + 10) + } + return inventoryNumber +} + +// 入库作业号List +export function getOperationCodeList() { + let operationCode = 'RQ' + for (let i = 0; i < 5; i++) { + operationCode += parseInt(Math.random() * 89 + 10) + } + return operationCode +} + +// 出库库作业号List +export function getOperationCode2List() { + let operationCode = 'CQ' + for (let i = 0; i < 5; i++) { + operationCode += parseInt(Math.random() * 89 + 10) + } + return operationCode +} + +// 库区 +const KQList = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'] +export function getKQList() { + let KQ = '' + KQ += KQList[parseInt(Math.random() * KQList.length)] + return KQ +} +// 货位 +export function getHWList() { + let HW = 'HW' + HW += KQList[parseInt(Math.random() * KQList.length)] + for (let i = 0; i < 2; i++) { + HW += parseInt(Math.random() * 9) + HW += parseInt(Math.random() * 8 + 1) + } + return HW +} + +// 缓存区 +export function getHCQList() { + let HW = 'HCQ' + HW += KQList[parseInt(Math.random() * KQList.length)] + for (let i = 0; i < 2; i++) { + HW += parseInt(Math.random() * 9) + HW += parseInt(Math.random() * 8 + 1) + } + return HW +} + +// 司机/AGB编号List +export function getDriverCodeList() { + let driverCode = 'D' + for (let i = 0; i < 5; i++) { + driverCode += parseInt(Math.random() * 89 + 10) + } + return driverCode +} + +// 随机生成开始和结束时间 +export function getTimeArr() { + const sj = parseInt(Math.random() * 365) + const sj2 = sj + parseInt(Math.random() * 60 + 1) + const temp = [] + const start = moment().subtract(sj2, 'days').subtract(sj2, 'hour').subtract(sj2, 'minutes').subtract(sj2, 'seconds').format('YYYY-MM-DD hh:mm:ss') + temp.push(start) + const end = moment().subtract(sj, 'days').subtract(sj, 'hour').subtract(sj, 'minutes').subtract(sj, 'seconds').format('YYYY-MM-DD hh:mm:ss') + temp.push(end) + return temp +} + +// 物料编码List +export function getMaterialCodeList() { + let materialCode = 'WL' + for (let i = 0; i < 4; i++) { + materialCode += parseInt(Math.random() * 89 + 10) + } + return materialCode +} + +// 名字 +const nameList = ['张明', '李燕', '王国庆', '张强', '周敏'] +export function getNameList() { + let name = 'WL' + name = nameList[parseInt(Math.random() * (nameList.length))] + return name +} diff --git a/src/views/wmsInStore/acceptGoods.vue b/src/views/wmsInStore/acceptGoods.vue index aa4f71b..68a63be 100644 --- a/src/views/wmsInStore/acceptGoods.vue +++ b/src/views/wmsInStore/acceptGoods.vue @@ -36,6 +36,7 @@ import Pagination from '@/components/Pagination' import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn' import { tableHeight } from '@/utils/index' import accetpGoodsAdd from './components/accetpGoodsAdd.vue' +import { getTrayList, getProductList, getCustomerCodeList, getProductSpecList, getBatchList, getPackList } from '@/utils/wmsDic' const topBtnConfig = [ { type: 'add', @@ -127,18 +128,15 @@ export default { getList() { const temp = [] const num = 20 - const spcList = ['50*50m', '100*50m', '100*100m', '70*100m', '100*120m'] - const packCodeList = ['01', '02', '03', '04', '05'] for (let i = 0; i < num; i++) { const obj = {} - obj.trayID = '1020' + i - obj.internalControlCode = '202210200001' + i - obj.customerCode = '20221020100' + i - obj.num = parseInt(Math.random() * 200 + 100) - const sj = Math.floor(Math.random() * 5) - obj.productDpec = spcList[sj] - obj.batch = '20221003' + i - obj.packCode = packCodeList[sj] + obj.trayID = getTrayList() + obj.internalControlCode = getProductList() + obj.customerCode = getCustomerCodeList() + obj.num = parseInt(Math.random() * 1000) + obj.productDpec = getProductSpecList() + obj.batch = getBatchList() + obj.packCode = getPackList() temp.push(obj) } this.list = temp diff --git a/src/views/wmsInStore/inStoreDocuments.vue b/src/views/wmsInStore/inStoreDocuments.vue index 6660abe..db69fbd 100644 --- a/src/views/wmsInStore/inStoreDocuments.vue +++ b/src/views/wmsInStore/inStoreDocuments.vue @@ -36,6 +36,7 @@ import Pagination from '@/components/Pagination' import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn' import { tableHeight } from '@/utils/index' import inStoreDocumentsAdd from './components/inStoreDocumentsAdd.vue' +import { getTrayList, getReceiptNoList, getProductList, getCustomerCodeList, getProductSpecList, getBatchList, getPackList } from '@/utils/wmsDic' const topBtnConfig = [ { type: 'add', @@ -131,19 +132,16 @@ export default { getList() { const temp = [] const num = 20 - const spcList = ['50*50m', '100*50m', '100*100m', '70*100m', '100*120m'] - const packCodeList = ['01', '02', '03', '04', '05'] for (let i = 0; i < num; i++) { const obj = {} - obj.receiptNo = '200101' + i - obj.trayID = '1020' + i - obj.internalControlCode = '202210200001' + i - obj.customerCode = '20221020100' + i - obj.num = parseInt(Math.random() * 200 + 100) - const sj = Math.floor(Math.random() * 5) - obj.productDpec = spcList[sj] - obj.batch = '20221003' + i - obj.packCode = packCodeList[sj] + obj.receiptNo = getReceiptNoList() + obj.trayID = getTrayList() + obj.internalControlCode = getProductList() + obj.customerCode = getCustomerCodeList() + obj.num = parseInt(Math.random() * 1000) + obj.productDpec = getProductSpecList() + obj.batch = getBatchList() + obj.packCode = getPackList() temp.push(obj) } this.list = temp diff --git a/src/views/wmsInStore/warehouseOperation.vue b/src/views/wmsInStore/warehouseOperation.vue index 789f697..540fb16 100644 --- a/src/views/wmsInStore/warehouseOperation.vue +++ b/src/views/wmsInStore/warehouseOperation.vue @@ -24,6 +24,7 @@ import HeadForm from '@/components/basicData/HeadForm' import BaseTable from '@/components/BaseTable' import Pagination from '@/components/Pagination' import { tableHeight } from '@/utils/index' +import { getOperationCodeList, getReceiptNoList, getHWList, getDriverCodeList, getTimeArr } from '@/utils/wmsDic' const tableProps = [ { prop: 'operationCode', @@ -105,12 +106,13 @@ export default { const num = 20 for (let i = 0; i < num; i++) { const obj = {} - obj.operationCode = '200101' + i - obj.receiptNo = '1020' + i - obj.goodsArea = '1-1-' + i - obj.startTime = '2022-10-' + (i + 1) - obj.endTime = '2022-10-' + (i + 2) - obj.driverCode = 'd20152' + i + const timeArrList = getTimeArr() + obj.operationCode = getOperationCodeList() + obj.receiptNo = getReceiptNoList() + obj.goodsArea = getHWList() + obj.startTime = timeArrList[0] + obj.endTime = timeArrList[1] + obj.driverCode = getDriverCodeList() temp.push(obj) } this.list = temp diff --git a/src/views/wmsInventoryManagement/inventory.vue b/src/views/wmsInventoryManagement/inventory.vue index 4202f46..59b0df8 100644 --- a/src/views/wmsInventoryManagement/inventory.vue +++ b/src/views/wmsInventoryManagement/inventory.vue @@ -7,8 +7,6 @@ :height="tableH" :table-config="tableProps" :table-data="list" - :is-loading="listLoading" - @clickTopBtn="clickTopBtn" />