前4个模块的数据

This commit is contained in:
2022-10-21 14:09:21 +08:00
parent 0e99211669
commit c892dcfe98
12 changed files with 264 additions and 118 deletions

161
src/utils/wmsDic.js Normal file
View File

@@ -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
}