优化序列号和批次商品的逻辑

This commit is contained in:
季圣华
2021-09-29 19:45:20 +08:00
parent ecb0edca29
commit 7ae0c1585c
18 changed files with 345 additions and 22 deletions

View File

@@ -104,7 +104,21 @@ export const BillModalMixin = {
for(let i=0; i<columns.length; i++){
if(columns[i].key === key) {
if(type){
columns[i].type = FormTypes.input //显示
if(key === 'snList' || key === 'batchNumber') {
if(this.prefixNo === 'XSCK' || this.prefixNo === 'CGTH') {
columns[i].type = FormTypes.popupJsh //显示
} else {
columns[i].type = FormTypes.input //显示
}
} else if(key === 'expirationDate') {
if(this.prefixNo === 'CGRK' || this.prefixNo === 'XSTH') {
columns[i].type = FormTypes.date //显示
} else {
columns[i].type = FormTypes.input //显示
}
} else {
columns[i].type = FormTypes.input //显示
}
} else {
columns[i].type = FormTypes.hidden //隐藏
}
@@ -240,6 +254,13 @@ export const BillModalMixin = {
if(mInfo.sku) {
this.changeFormTypes(this.materialTable.columns, 'sku', 1)
}
if(mInfo.enableSerialNumber === "1") {
this.changeFormTypes(this.materialTable.columns, 'snList', 1)
}
if(mInfo.enableBatchNumber === "1") {
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 1)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 1)
}
let mObj = this.parseInfoToObj(mInfo)
mObj.depotId = mInfo.depotId
mObj.stock = mInfo.stock
@@ -261,6 +282,13 @@ export const BillModalMixin = {
if(mInfo.sku) {
this.changeFormTypes(this.materialTable.columns, 'sku', 1)
}
if(mInfo.enableSerialNumber === "1") {
this.changeFormTypes(this.materialTable.columns, 'snList', 1)
}
if(mInfo.enableBatchNumber === "1") {
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 1)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 1)
}
let mObj = {
rowKey: row.id,
values: this.parseInfoToObj(mInfo)

View File

@@ -103,7 +103,7 @@
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, multi: true,
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '6%', type: FormTypes.input, readonly: true },

View File

@@ -105,7 +105,7 @@
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, multi: true,
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '6%', type: FormTypes.input, readonly: true },

View File

@@ -105,7 +105,7 @@
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, multi: true,
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '6%', type: FormTypes.input, readonly: true },

View File

@@ -112,7 +112,7 @@
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, multi: true,
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '6%', type: FormTypes.input, readonly: true },

View File

@@ -112,7 +112,7 @@
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, multi: true,
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '6%', type: FormTypes.input, readonly: true },

View File

@@ -172,7 +172,7 @@
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, multi: true,
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '6%', type: FormTypes.input, readonly: true },
@@ -181,9 +181,9 @@
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '序列号', key: 'snList', width: '5%', type: FormTypes.input },
{ title: '批号', key: 'batchNumber', width: '5%', type: FormTypes.input },
{ title: '有效期', key: 'expirationDate',width: '7%', type: FormTypes.input },
{ title: '序列号', key: 'snList', width: '7%', type: FormTypes.popupJsh, kind: 'sn', multi: true },
{ title: '批号', key: 'batchNumber', width: '7%', type: FormTypes.popupJsh, kind: 'batch', multi: false },
{ title: '有效期', key: 'expirationDate',width: '5%', type: FormTypes.input, readonly: true },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
@@ -227,6 +227,9 @@
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.fileList = []

View File

@@ -230,6 +230,9 @@
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
this.changeFormTypes(this.materialTable.columns, 'preNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'finishNumber', 0)
if (this.action === 'add') {

View File

@@ -112,7 +112,7 @@
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.hidden },
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, multi: true,
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '6%', type: FormTypes.input, readonly: true },

View File

@@ -155,7 +155,7 @@
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '12%', type: FormTypes.popupJsh, multi: true,
{ title: '条码', key: 'barCode', width: '12%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '9%', type: FormTypes.input, readonly: true },

View File

@@ -157,7 +157,7 @@
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '12%', type: FormTypes.popupJsh, multi: true,
{ title: '条码', key: 'barCode', width: '12%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '9%', type: FormTypes.input, readonly: true },

View File

@@ -177,7 +177,7 @@
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, multi: true,
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '6%', type: FormTypes.input, readonly: true },
@@ -188,7 +188,7 @@
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '序列号', key: 'snList', width: '5%', type: FormTypes.input },
{ title: '批号', key: 'batchNumber', width: '5%', type: FormTypes.input },
{ title: '有效期', key: 'expirationDate',width: '7%', type: FormTypes.input },
{ title: '有效期', key: 'expirationDate',width: '7%', type: FormTypes.date },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
@@ -232,6 +232,9 @@
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.personList.value = ''

View File

@@ -115,7 +115,7 @@
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.hidden },
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, multi: true,
{ title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '6%', type: FormTypes.input, readonly: true },

View File

@@ -186,7 +186,7 @@
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '序列号', key: 'snList', width: '5%', type: FormTypes.input },
{ title: '序列号', key: 'snList', width: '7%', type: FormTypes.popupJsh, kind: 'sn', multi: true },
{ title: '批号', key: 'batchNumber', width: '7%', type: FormTypes.popupJsh, kind: 'batch', multi: false },
{ title: '有效期', key: 'expirationDate',width: '5%', type: FormTypes.input, readonly: true },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.input, readonly: true },
@@ -234,6 +234,9 @@
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
this.changeFormTypes(this.materialTable.columns, 'preNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'finishNumber', 0)
if (this.action === 'add') {