Commit 62be992a authored by chenzj's avatar chenzj

退料申请编码新增

parent 30712cee
...@@ -273,6 +273,12 @@ const install = (Vue, vm) => { ...@@ -273,6 +273,12 @@ const install = (Vue, vm) => {
params params
), ),
//自动生成接口
genCode: (ruleCode) => vm.$u.get(config.adminPath +
'/system/autocode/get/' + ruleCode
),
//首页相关api //首页相关api
getIndexCardInfo: (params = {}) => getIndexCardInfo: (params = {}) =>
vm.$u.get(config.adminPath + '/mobile/index/getIndexCardInfo', params), vm.$u.get(config.adminPath + '/mobile/index/getIndexCardInfo', params),
......
...@@ -1353,6 +1353,7 @@ export default { ...@@ -1353,6 +1353,7 @@ export default {
applyNum: 1, applyNum: 1,
workorderCode: null workorderCode: null
}, },
applyNo: null,
printTemplateData: null, printTemplateData: null,
printTemplateVisible: false, printTemplateVisible: false,
userTempVisible: false, userTempVisible: false,
...@@ -2805,19 +2806,15 @@ export default { ...@@ -2805,19 +2806,15 @@ export default {
this.materialReturnSelected.isQualified = this.materialReturnFormData.isQualified; this.materialReturnSelected.isQualified = this.materialReturnFormData.isQualified;
this.materialReturnFormVisible = false; this.materialReturnFormVisible = false;
}, },
formatDateRandom() { async formatDateRandom() {
const date = new Date(); await this.$u.api.genCode('MATERIAL_RETURN_CODE').then((item) =>{
const year = date.getFullYear(); console.log(item);
const month = (date.getMonth() + 1).toString().padStart(2, '0'); this.applyNo = item;
const day = date.getDate().toString().padStart(2, '0'); });
let randomNumber = Math.floor(Math.random() * 10000); },
randomNumber = randomNumber.toString().padStart(4, '0'); materialReturnSave() {
return `SN${year}${month}${day}${randomNumber}` this.formatDateRandom()
}, const taskInfo = this.tableSelectData[0];
materialReturnSave() {
let a=null;
const taskInfo = this.tableSelectData[0];
const apply_no = this.formatDateRandom()
const rst = this.materialReturnList.map((s) => { const rst = this.materialReturnList.map((s) => {
let data = { let data = {
itemId: s.itemId, itemId: s.itemId,
...@@ -2828,7 +2825,7 @@ export default { ...@@ -2828,7 +2825,7 @@ export default {
workOrderId: s.workorderId, workOrderId: s.workorderId,
batchNo: s.batchCode, batchNo: s.batchCode,
packNo: s.packNo, packNo: s.packNo,
applyNo: apply_no, applyNo: this.applyNo,
isQualified: s.isQualified isQualified: s.isQualified
}; };
a=a+s.applyNum; a=a+s.applyNum;
...@@ -2856,14 +2853,14 @@ export default { ...@@ -2856,14 +2853,14 @@ export default {
values:{ values:{
detail:[ detail:[
{ {
barcode: apply_no, barcode: this.applyNo,
showText: '退料单号:'+apply_no, showText: '退料单号:'+this.applyNo,
gp: i+1 gp: i+1
}, },
{ {
barcode: apply_no, barcode: this.applyNo,
showText: '退料单号:'+apply_no, showText: '退料单号:'+this.applyNo,
gp: i+1 gp: i+1
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment