|
|
|
@ -602,7 +602,7 @@
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
async onSelect(record) { |
|
|
|
|
console.log(record,"wer234") |
|
|
|
|
// console.log(record,"wer234") |
|
|
|
|
let isMA = true; |
|
|
|
|
if (!record.row.equipment && !!record.row.materialGroup && !!record.row.materialName |
|
|
|
|
|| !record.row.materialName && !!record.row.materialGroup && !!record.row.equipment ) { |
|
|
|
@ -623,7 +623,10 @@
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
this.processMaterialsDeliveryListTable.columns[3].options = [] |
|
|
|
|
console.log("select==清空数据",record.row); |
|
|
|
|
this.$refs.processMaterialsDeliveryList.setValues(values); |
|
|
|
|
isMA = false; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -671,10 +674,10 @@
|
|
|
|
|
b = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
console.log(this.bigIdMerchandiseNewsList.length,"长度"); |
|
|
|
|
// console.log(this.bigIdMerchandiseNewsList.length,"长度1"); |
|
|
|
|
// console.log("执行materialNumber",b,record.row.materialGroup , this.materialGroupId) |
|
|
|
|
if (record.column.key == 'equipment' && isMA && record.row.equipment !== this.materialGroupId) { |
|
|
|
|
|
|
|
|
|
if (record.column.key == 'equipment' && isMA && record.row.equipment !== this.materialGroupId || |
|
|
|
|
record.column.key == 'materialName' && isMA && record.row.equipment !== this.materialGroupId) { |
|
|
|
|
if (!b) { |
|
|
|
|
if (this.accountingAttributesVal === '1') { |
|
|
|
|
//账外 |
|
|
|
@ -690,7 +693,8 @@
|
|
|
|
|
await this.$refs.processMaterialsDeliveryList.getValues((a, b, c) => { |
|
|
|
|
// console.log("bbbbbbbbbbbbbb",b) |
|
|
|
|
b.forEach(item => { |
|
|
|
|
if (item.equipment === record.row.equipment && !!item.materialGroup && !record.row.materialGroup) { |
|
|
|
|
if (item.equipment === record.row.equipment && !!item.materialGroup && !record.row.materialGroup |
|
|
|
|
|| item.equipment === record.value && !!item.materialGroup && !record.row.materialGroup ) { |
|
|
|
|
// console.log("bbbb====bbbbbb",item.equipment, record.row.equipment, item.materialGroup) |
|
|
|
|
let values = [ |
|
|
|
|
{ |
|
|
|
@ -716,11 +720,12 @@
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// console.log(this.bigIdMerchandiseNewsList.length,"长度2"); |
|
|
|
|
let materialName = {} |
|
|
|
|
this.bigIdMerchandiseNewsList.forEach(item => { |
|
|
|
|
if (item.merchandiseNewsId === record.row.equipment) { |
|
|
|
|
if (item.merchandiseNewsId === record.row.equipment || record.value === item.merchandiseNewsId ) { |
|
|
|
|
materialName = { |
|
|
|
|
equipment : item.merchandiseNewsId, |
|
|
|
|
name: item.merchandiseName, |
|
|
|
|
unit: item.materialsUnit, |
|
|
|
|
materialGroup: item.materialClassify, |
|
|
|
@ -735,7 +740,7 @@
|
|
|
|
|
// console.log("materialName",materialName); |
|
|
|
|
if (record.row.id !== undefined && Object.keys(materialName).length > 0) { |
|
|
|
|
// console.log("materialName",materialName); |
|
|
|
|
|
|
|
|
|
// console.log(this.bigIdMerchandiseNewsList.length,"长度3"); |
|
|
|
|
this.processMaterialsDeliveryListTable.columns[0].options.push({ |
|
|
|
|
title: materialName.materialGroup, |
|
|
|
|
value: materialName.descriptionId |
|
|
|
@ -745,7 +750,7 @@
|
|
|
|
|
{ |
|
|
|
|
rowKey: record.row.id, |
|
|
|
|
values: { |
|
|
|
|
'equipment': record.row.equipment, |
|
|
|
|
'equipment': materialName.equipment, |
|
|
|
|
'materialGroup': materialName.descriptionId, |
|
|
|
|
'materialName': materialName.name, |
|
|
|
|
'materialUnit': materialName.unit, |
|
|
|
@ -772,7 +777,7 @@
|
|
|
|
|
} |
|
|
|
|
this.materialGroupId = record.row.equipment |
|
|
|
|
} |
|
|
|
|
console.log("this.data.materialType",this.deliveryType); |
|
|
|
|
// console.log("this.data.materialType",this.deliveryType); |
|
|
|
|
|
|
|
|
|
// 根据请发数量计算 |
|
|
|
|
if (record.column.key == 'pleaseSendNumber' && isMA || record.column.key == 'actualSendNumber' && isMA) { |
|
|
|
@ -1056,291 +1061,7 @@
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
//table 值改变触发 |
|
|
|
|
// async onSelect(record) { |
|
|
|
|
// // console.log(record) |
|
|
|
|
// if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment === ''){ |
|
|
|
|
// // console.log("执行materialGroup") |
|
|
|
|
// this.fetchMerchandiseNews(record.row.materialGroup,1); |
|
|
|
|
// } |
|
|
|
|
// if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment !== '' && record.row.actualSendNumber === '' ){ |
|
|
|
|
// // console.log("执行materialNumber") |
|
|
|
|
// let materialName = {} |
|
|
|
|
// this.bigIdMerchandiseNewsList.forEach(item => { |
|
|
|
|
// if (item.merchandiseNewsId === record.row.equipment) { |
|
|
|
|
// materialName = { |
|
|
|
|
// name: item.merchandiseName, |
|
|
|
|
// unit: item.materialsUnit, |
|
|
|
|
// supplierName: item.supplierName, |
|
|
|
|
// price: item.price, |
|
|
|
|
// batch: item.batch, |
|
|
|
|
// MaterialsDeliveryId : item.id |
|
|
|
|
// // residueNumber : item.residueNumber === undefined ? 0 : item.residueNumber, |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// let values = [ |
|
|
|
|
// { |
|
|
|
|
// rowKey: record.row.id, |
|
|
|
|
// values: { |
|
|
|
|
// 'equipment': record.row.equipment, |
|
|
|
|
// 'materialGroup': record.row.materialGroup, |
|
|
|
|
// 'materialName': materialName.name, |
|
|
|
|
// 'materialUnit': materialName.unit, |
|
|
|
|
// 'supplier': materialName.supplierName, |
|
|
|
|
// 'materialPrice': materialName.price, |
|
|
|
|
// 'batch' : materialName.batch, |
|
|
|
|
// 'MaterialsDeliveryId': materialName.MaterialsDeliveryId |
|
|
|
|
// // 'actualSendNumber': materialName.residueNumber, |
|
|
|
|
// // 'materialAmount': materialName.price * materialName.residueNumber, |
|
|
|
|
// }, |
|
|
|
|
// }, |
|
|
|
|
// ] |
|
|
|
|
// this.$refs.processMaterialsDeliveryList.setValues(values); |
|
|
|
|
// } |
|
|
|
|
// let a = false; |
|
|
|
|
// // 根据请发数量计算 |
|
|
|
|
// if(record.row.pleaseSendNumber !== '' && record.row.pleaseSendNumber !== undefined){ |
|
|
|
|
// console.log("record.row",record.row); |
|
|
|
|
// let numberStar = 0; |
|
|
|
|
// let numberEnd = 0; |
|
|
|
|
// // record.row.materialAmount = record.row.materialQuantity * record.row.materialPrice; |
|
|
|
|
// // 获取被逻辑删除的字段id |
|
|
|
|
// // let deleteIds = this.$refs.processMaterialsDeliveryList.getDeleteIds(); |
|
|
|
|
// // 获取所有表单的值,并进行验证 |
|
|
|
|
// let batcher = false; |
|
|
|
|
// let { error, values } = this.$refs.processMaterialsDeliveryList.getValuesSync({ }) |
|
|
|
|
// // console.log( values); |
|
|
|
|
// values.forEach( item => { |
|
|
|
|
// //判断是不是操作第一个 |
|
|
|
|
// if(item.id === record.row.id){ |
|
|
|
|
// let bat = record.row.batch.substring(0,record.row.batch.indexOf('/')); |
|
|
|
|
// if(parseInt(bat) === 1){ |
|
|
|
|
// // console.log("第一批"); |
|
|
|
|
// batcher = true; |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// //判断下面是不是有一样的物资 |
|
|
|
|
// if(item.id !== record.row.id && item.equipment === record.row.equipment ){ |
|
|
|
|
// //有 |
|
|
|
|
// let cf = record.row.pleaseSendNumber - record.row.actualSendNumber; |
|
|
|
|
// if(cf < 0 ){ |
|
|
|
|
// let ba = record.row.batch.substring(0,record.row.batch.indexOf('/')); |
|
|
|
|
// if(parseInt(ba) === 1 ){ |
|
|
|
|
// record.row.actualSendNumber = record.row.pleaseSendNumber; |
|
|
|
|
// //请减小 |
|
|
|
|
// let values = [ |
|
|
|
|
// { |
|
|
|
|
// rowKey: record.row.id, |
|
|
|
|
// values: { |
|
|
|
|
// 'equipment': record.row.equipment, |
|
|
|
|
// 'materialGroup': record.row.materialGroup, |
|
|
|
|
// 'materialName': record.row.materialName, |
|
|
|
|
// 'materialUnit': record.row.materialUnit, |
|
|
|
|
// 'supplier': record.row.supplier, |
|
|
|
|
// 'materialPrice': record.row.price , |
|
|
|
|
// 'actualSendNumber': record.row.actualSendNumber, |
|
|
|
|
// 'materialAmount': record.row.price * record.row.actualSendNumber, |
|
|
|
|
// 'pleaseSendNumber' : record.row.pleaseSendNumber, |
|
|
|
|
// 'batch' : record.row.batch, |
|
|
|
|
// }, |
|
|
|
|
// }, |
|
|
|
|
// ] |
|
|
|
|
// this.$refs.processMaterialsDeliveryList.setValues(values); |
|
|
|
|
// this.$refs.processMaterialsDeliveryList.removeRows(item.id); |
|
|
|
|
// }else { |
|
|
|
|
// |
|
|
|
|
// batcher =true; |
|
|
|
|
// } |
|
|
|
|
// |
|
|
|
|
// }else{ |
|
|
|
|
// //请变大 |
|
|
|
|
// this.$refs.processMaterialsDeliveryList.removeRows(item.id); |
|
|
|
|
// |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// |
|
|
|
|
// }) |
|
|
|
|
// //第二行操作 |
|
|
|
|
// if(batcher){ |
|
|
|
|
// // console.log("执行了123") |
|
|
|
|
// let num = 0; |
|
|
|
|
// this.bigIdMerchandiseNewsList.forEach( item =>{ |
|
|
|
|
// // console.log("item",item); |
|
|
|
|
// num = record.row.pleaseSendNumber - item.residueNumber; //第二行显示的数量 |
|
|
|
|
// if(num > 0){ |
|
|
|
|
// // 限制最大数量 |
|
|
|
|
// record.row.pleaseSendNumber = item.residueNumber; |
|
|
|
|
// record.row.actualSendNumber = record.row.pleaseSendNumber; |
|
|
|
|
// record.row.MaterialsDeliveryId = item.id; |
|
|
|
|
// //添加一行 |
|
|
|
|
// this.$refs.processMaterialsDeliveryList.handleClickAdd(); |
|
|
|
|
// this.jiy.push(this.addId); |
|
|
|
|
// a =true; |
|
|
|
|
// }else{ |
|
|
|
|
// record.row.actualSendNumber = record.row.pleaseSendNumber; |
|
|
|
|
// record.row.MaterialsDeliveryId = item.id; |
|
|
|
|
// // console.log("执行了222" ,record.row.actualSendNumber); |
|
|
|
|
// } |
|
|
|
|
// |
|
|
|
|
// }); |
|
|
|
|
// let drop = record.row.materialGroup; |
|
|
|
|
// let values = [ |
|
|
|
|
// { |
|
|
|
|
// rowKey: record.row.id, |
|
|
|
|
// values: { |
|
|
|
|
// 'equipment': record.row.equipment, |
|
|
|
|
// 'materialGroup': record.row.materialGroup, |
|
|
|
|
// 'materialName': record.row.materialName, |
|
|
|
|
// 'materialUnit': record.row.materialUnit, |
|
|
|
|
// 'supplier': record.row.supplier, |
|
|
|
|
// 'materialPrice': record.row.materialPrice, |
|
|
|
|
// 'actualSendNumber': record.row.actualSendNumber, |
|
|
|
|
// 'materialAmount': record.row.actualSendNumber * record.row.materialPrice, |
|
|
|
|
// 'pleaseSendNumber' : record.row.pleaseSendNumber, |
|
|
|
|
// 'batch' : record.row.batch, |
|
|
|
|
// 'MaterialsDeliveryId': record.row.MaterialsDeliveryId, |
|
|
|
|
// }, |
|
|
|
|
// }, |
|
|
|
|
// ] |
|
|
|
|
// this.$refs.processMaterialsDeliveryList.setValues(values); |
|
|
|
|
// //重新赋值 |
|
|
|
|
// if(a){ |
|
|
|
|
// let merchandiseNewser = {}; |
|
|
|
|
// let merchandiseNews = {}; |
|
|
|
|
// let is = false; |
|
|
|
|
// let onIs= false; |
|
|
|
|
// do{ |
|
|
|
|
// if(is){ |
|
|
|
|
// this.$refs.processMaterialsDeliveryList.handleClickAdd(); |
|
|
|
|
// merchandiseNewser =await this.fetchMerchandiseNews(drop,parseInt(numberStar)); |
|
|
|
|
// }else{ |
|
|
|
|
// merchandiseNewser =await this.fetchMerchandiseNews(drop,2); |
|
|
|
|
// } |
|
|
|
|
// merchandiseNewser.forEach( item => { |
|
|
|
|
// merchandiseNews = item; |
|
|
|
|
// }); |
|
|
|
|
// // console.log("numberStar",numberStar) |
|
|
|
|
// numberStar = merchandiseNews.batch.substring(0,merchandiseNews.batch.indexOf("/")); |
|
|
|
|
// numberEnd = merchandiseNews.batch.slice(numberStar.length+1); |
|
|
|
|
// // console.log(merchandiseNews); |
|
|
|
|
// let sum = num - merchandiseNews.residueNumber; //剩余数量 |
|
|
|
|
// let isLose = parseInt(numberEnd) - parseInt(numberStar); |
|
|
|
|
// // console.log("isLose",isLose); |
|
|
|
|
// if(isLose === 0 ){ |
|
|
|
|
// onIs = true; |
|
|
|
|
// } |
|
|
|
|
// if( sum > 0 ){ |
|
|
|
|
// //第三批 |
|
|
|
|
// is = true; |
|
|
|
|
// numberStar = parseInt(numberStar)+1; |
|
|
|
|
// sum = merchandiseNews.residueNumber; |
|
|
|
|
// }else{ |
|
|
|
|
// sum = num; |
|
|
|
|
// // console.log("sum=================>",sum); |
|
|
|
|
// is = false; |
|
|
|
|
// |
|
|
|
|
// } |
|
|
|
|
// let values = [ |
|
|
|
|
// { |
|
|
|
|
// rowKey: this.addId, |
|
|
|
|
// values: { |
|
|
|
|
// 'equipment': record.row.equipment, |
|
|
|
|
// 'materialGroup': record.row.materialGroup, |
|
|
|
|
// 'materialName': record.row.materialName, |
|
|
|
|
// 'materialUnit': record.row.materialUnit, |
|
|
|
|
// 'supplier': record.row.supplier, |
|
|
|
|
// 'materialPrice': merchandiseNews.price ? merchandiseNews.price : 0 , |
|
|
|
|
// 'actualSendNumber': sum , |
|
|
|
|
// 'materialAmount': sum * merchandiseNews.price ? sum * merchandiseNews.price : 0, |
|
|
|
|
// 'pleaseSendNumber' : sum, |
|
|
|
|
// 'batch' : merchandiseNews.batch, |
|
|
|
|
// 'MaterialsDeliveryId': merchandiseNews.id, |
|
|
|
|
// }, |
|
|
|
|
// }, |
|
|
|
|
// ] |
|
|
|
|
// this.$refs.processMaterialsDeliveryList.setValues(values); |
|
|
|
|
// //减小num 数量 |
|
|
|
|
// num = num - merchandiseNews.residueNumber; |
|
|
|
|
// if(onIs){ |
|
|
|
|
// //还要继续查询 |
|
|
|
|
// |
|
|
|
|
// this.$message.warn('暂无更多库存!'); |
|
|
|
|
// is = false; |
|
|
|
|
// return; |
|
|
|
|
// } |
|
|
|
|
// }while (is); |
|
|
|
|
// } |
|
|
|
|
// |
|
|
|
|
// } |
|
|
|
|
// |
|
|
|
|
// } |
|
|
|
|
// |
|
|
|
|
// }, |
|
|
|
|
// fetchMerchandiseNews(value,batch){ //查询物料清单信息 |
|
|
|
|
// //查询大品类数据 |
|
|
|
|
// return new Promise((resolve, reject) => { |
|
|
|
|
// //你的逻辑代码 |
|
|
|
|
// let par = { |
|
|
|
|
// delFlag: 0, |
|
|
|
|
// descriptionId:value, |
|
|
|
|
// batchNum: batch, |
|
|
|
|
// } |
|
|
|
|
// this.bigIdMerchandiseNews = []; |
|
|
|
|
// this.bigIdMerchandiseNewsList = []; |
|
|
|
|
// let qc = []; |
|
|
|
|
// let numberList = []; |
|
|
|
|
// if(this.processMaterialsDeliveryListTable.columns[1].options.length > 0){ |
|
|
|
|
// this.processMaterialsDeliveryListTable.columns[1].options = []; |
|
|
|
|
// } |
|
|
|
|
// this.$refs.processMaterialsDeliveryList.getValues((a,b,c)=>{ |
|
|
|
|
// // console.log(a,b,c) |
|
|
|
|
// b.forEach(item =>{ |
|
|
|
|
// if(item.equipment !== '' && item.equipment !== undefined && item.equipment !== null){ |
|
|
|
|
// numberList.push(item.materialNumber); |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
// }); |
|
|
|
|
// getAction(this.url.merchandiseNewsList,par).then((res)=>{ |
|
|
|
|
// if(res.success){ |
|
|
|
|
// console.log(res.result); |
|
|
|
|
// let newList = res.result; |
|
|
|
|
// // console.log("12312312:"+numberList.length); |
|
|
|
|
// if(numberList.length > 0){ |
|
|
|
|
// newList.forEach( item => { |
|
|
|
|
// qc.push({ |
|
|
|
|
// title : item.materialsNumber, |
|
|
|
|
// value : item.merchandiseNewsId, |
|
|
|
|
// disabled : false |
|
|
|
|
// }) |
|
|
|
|
// }) |
|
|
|
|
// numberList.forEach( num => { |
|
|
|
|
// qc.forEach( i => { |
|
|
|
|
// if(num === i.value){ |
|
|
|
|
// // console.log(num,i.value); |
|
|
|
|
// i.disabled = true; |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
// }) |
|
|
|
|
// this.processMaterialsDeliveryListTable.columns[1].options = qc; |
|
|
|
|
// }else{ |
|
|
|
|
// newList.forEach( item => { |
|
|
|
|
// this.processMaterialsDeliveryListTable.columns[1].options.push({ |
|
|
|
|
// title : item.materialsNumber, |
|
|
|
|
// value : item.merchandiseNewsId, |
|
|
|
|
// disabled : false |
|
|
|
|
// }) |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// // console.log(this.processUdgetPlanMaterialTable.columns[1].options); |
|
|
|
|
// resolve(this.bigIdMerchandiseNewsList = res.result ); |
|
|
|
|
// // return |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
// |
|
|
|
|
// }); |
|
|
|
|
// |
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fetchData(value) { //查询物料组 |
|
|
|
|
// console.log("this.data==============>",this.data) //部门id |
|
|
|
@ -1574,14 +1295,15 @@
|
|
|
|
|
formData.processInstanceId = this.processData.id |
|
|
|
|
} |
|
|
|
|
if (formData.processMaterialsDeliveryListList.length > 0) { |
|
|
|
|
let qing = false |
|
|
|
|
let qing = false; |
|
|
|
|
let quan = false; |
|
|
|
|
formData.processMaterialsDeliveryListList.forEach(item => { |
|
|
|
|
if (!!item.equipment) { |
|
|
|
|
if (!item.pleaseSendNumber) { |
|
|
|
|
qing = true |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning('请填写数据!!!') |
|
|
|
|
quan = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
@ -1589,8 +1311,11 @@
|
|
|
|
|
this.$message.warning('请填写请发数!!!') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if (quan) { |
|
|
|
|
this.$message.warning('请填写数据!!!'); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// console.log('提交方法', method) |
|
|
|
|
if (this.btndisabled === false) { |
|
|
|
|
this.btndisabled = true |
|
|
|
|