|
|
|
@ -60,7 +60,14 @@
|
|
|
|
|
@valueChange ="onSelect" |
|
|
|
|
:rowNumber="true" |
|
|
|
|
:rowSelection="true" |
|
|
|
|
:actionButton="true"/> |
|
|
|
|
:actionButton="true" |
|
|
|
|
@added="addid" |
|
|
|
|
> |
|
|
|
|
<!-- <template v-slot:qing="props">--> |
|
|
|
|
<!-- <a-input v-decorator="['pleaseSendNumber']" placeholder="请输入" style="width: 100%" @change="shuru" type="number"/>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
|
|
|
|
|
</j-editable-table> |
|
|
|
|
</a-tab-pane> |
|
|
|
|
</a-tabs> |
|
|
|
|
<div class="div_process"> |
|
|
|
@ -104,8 +111,8 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
|
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
accountingAttributesVal: '', |
|
|
|
|
heid: true, |
|
|
|
|
addId : '', |
|
|
|
|
bigIdMerchandiseNewsList:[], |
|
|
|
|
labelCol: { |
|
|
|
|
xs: { span: 24 }, |
|
|
|
@ -194,6 +201,7 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
|
|
|
|
|
width:"200px", |
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
defaultValue:'', |
|
|
|
|
// slotName: 'qing' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '实发数', |
|
|
|
@ -334,24 +342,29 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
|
|
|
|
|
console.log(userInfo) |
|
|
|
|
// userInfo.company=company; |
|
|
|
|
this.popupCallback(company,userInfo); |
|
|
|
|
this.fetchData(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//请数量输入 |
|
|
|
|
addid(val){ |
|
|
|
|
this.addId = val.row.id; |
|
|
|
|
// console.log(this.addId); |
|
|
|
|
}, |
|
|
|
|
//核算属性切换 |
|
|
|
|
isMaterialType(val){ |
|
|
|
|
if(val !== undefined){ |
|
|
|
|
this.accountingAttributesVal = val; |
|
|
|
|
this.heid = false; |
|
|
|
|
this.fetchData(val); |
|
|
|
|
} |
|
|
|
|
// console.log("执行l",val); |
|
|
|
|
}, |
|
|
|
|
//table 值改变触发 |
|
|
|
|
onSelect(record) { |
|
|
|
|
console.log(record) |
|
|
|
|
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); |
|
|
|
|
this.fetchMerchandiseNews(record.row.materialGroup,1); |
|
|
|
|
} |
|
|
|
|
if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment !== ''){ |
|
|
|
|
if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment !== '' && record.row.actualSendNumber === '' ){ |
|
|
|
|
// console.log("执行materialNumber") |
|
|
|
|
let materialName = { } |
|
|
|
|
this.bigIdMerchandiseNewsList.forEach( item => { |
|
|
|
@ -361,7 +374,7 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
|
|
|
|
|
unit: item.materialsUnit, |
|
|
|
|
supplierName: item.supplierName, |
|
|
|
|
price: item.price, |
|
|
|
|
residueNumber : item.residueNumber === undefined ? 0 : item.residueNumber, |
|
|
|
|
// residueNumber : item.residueNumber === undefined ? 0 : item.residueNumber, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -376,96 +389,183 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
|
|
|
|
|
'materialUnit': materialName.unit, |
|
|
|
|
'supplier': materialName.supplierName, |
|
|
|
|
'materialPrice': materialName.price, |
|
|
|
|
'actualSendNumber': materialName.residueNumber, |
|
|
|
|
'materialAmount': materialName.price * materialName.residueNumber, |
|
|
|
|
// 'actualSendNumber': materialName.residueNumber, |
|
|
|
|
// 'materialAmount': materialName.price * materialName.residueNumber, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
this.$refs.processMaterialsDeliveryList.setValues(values); |
|
|
|
|
} |
|
|
|
|
// |
|
|
|
|
// if(record.row.pleaseSendNumber !== '' && record.row.materialPrice !== '' && record.row.pleaseSendNumber !== undefined && record.row.materialPrice !== undefined){ |
|
|
|
|
// // record.row.materialAmount = record.row.materialQuantity * record.row.materialPrice; |
|
|
|
|
// 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, |
|
|
|
|
// 'materialAmount': record.row.pleaseSendNumber * record.row.materialPrice, |
|
|
|
|
// }, |
|
|
|
|
// }, |
|
|
|
|
// ] |
|
|
|
|
// this.$refs.processMaterialsDeliveryList.setValues(values); |
|
|
|
|
// } |
|
|
|
|
let a = false; |
|
|
|
|
let numberStar = 0; |
|
|
|
|
let numberEnd = 0; |
|
|
|
|
// 根据请发数量计算 |
|
|
|
|
if(record.row.pleaseSendNumber !== '' && record.row.pleaseSendNumber !== undefined){ |
|
|
|
|
// record.row.materialAmount = record.row.materialQuantity * record.row.materialPrice; |
|
|
|
|
let num = 0; |
|
|
|
|
this.bigIdMerchandiseNewsList.forEach( item =>{ |
|
|
|
|
console.log("item",item); |
|
|
|
|
numberStar = item.batch.substring(0,item.batch.indexOf("/")); |
|
|
|
|
numberEnd = item.batch.slice(numberStar.length+1); |
|
|
|
|
num = record.row.pleaseSendNumber - item.residueNumber; |
|
|
|
|
if(num > 0){ |
|
|
|
|
// 限制最大数量 |
|
|
|
|
record.row.pleaseSendNumber = item.residueNumber; |
|
|
|
|
record.row.actualSendNumber = record.row.pleaseSendNumber; |
|
|
|
|
this.$refs.processMaterialsDeliveryList.handleClickAdd(); |
|
|
|
|
a =true; |
|
|
|
|
}else{ |
|
|
|
|
record.row.actualSendNumber = record.row.pleaseSendNumber; |
|
|
|
|
// 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, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
this.$refs.processMaterialsDeliveryList.setValues(values); |
|
|
|
|
//重新赋值 |
|
|
|
|
if(a){ |
|
|
|
|
let merchandiseNewser = {}; |
|
|
|
|
let merchandiseNews = {}; |
|
|
|
|
let is = false; |
|
|
|
|
let onIs= false; |
|
|
|
|
do{ |
|
|
|
|
// console.log("numberStar",parseInt(numberStar)+1) |
|
|
|
|
merchandiseNewser =await this.fetchMerchandiseNews(drop,parseInt(numberStar)+1); |
|
|
|
|
// console.log(merchandiseNewser); |
|
|
|
|
merchandiseNewser.forEach( item => { |
|
|
|
|
merchandiseNews = item; |
|
|
|
|
}); |
|
|
|
|
// console.log(merchandiseNews); |
|
|
|
|
let sum = num - merchandiseNews.residueNumber; |
|
|
|
|
if( sum > 0 ){ |
|
|
|
|
// console.log("大于"); |
|
|
|
|
// console.log("numberEnd",numberEnd); |
|
|
|
|
// console.log("merchandiseNews.batch.substring()",merchandiseNews.batch.substring(0,merchandiseNews.batch.indexOf("/"))); |
|
|
|
|
//第三批 |
|
|
|
|
let isLose = parseInt(numberEnd) - parseInt( merchandiseNews.batch.substring(0,merchandiseNews.batch.indexOf("/")) ); |
|
|
|
|
if(isLose === 0 ){ |
|
|
|
|
onIs = true; |
|
|
|
|
}else { |
|
|
|
|
is = true; |
|
|
|
|
numberStar = numberStar+1; |
|
|
|
|
this.$refs.processMaterialsDeliveryList.handleClickAdd(); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
sum = num; |
|
|
|
|
// console.log("小于"); |
|
|
|
|
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': record.row.materialPrice, |
|
|
|
|
'actualSendNumber': sum, |
|
|
|
|
'materialAmount': sum * record.row.materialPrice, |
|
|
|
|
'pleaseSendNumber' : sum, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
this.$refs.processMaterialsDeliveryList.setValues(values); |
|
|
|
|
if(onIs){ |
|
|
|
|
this.$message.warn('没有更多批次了'); |
|
|
|
|
is = false; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
}while (is); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
fetchMerchandiseNews(value){ //查询物料清单信息 |
|
|
|
|
fetchMerchandiseNews(value,batch){ //查询物料清单信息 |
|
|
|
|
//查询大品类数据 |
|
|
|
|
let par = { |
|
|
|
|
delFlag: 0, |
|
|
|
|
descriptionId:value, |
|
|
|
|
} |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
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 |
|
|
|
|
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 |
|
|
|
|
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 |
|
|
|
|
} |
|
|
|
|
// console.log(this.processUdgetPlanMaterialTable.columns[1].options); |
|
|
|
|
this.bigIdMerchandiseNewsList = res.result; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
fetchData(){ //查询物料组 |
|
|
|
|
fetchData(value){ //查询物料组 |
|
|
|
|
//查询大品类数据 |
|
|
|
|
let par = { |
|
|
|
|
delFlag: 0, |
|
|
|
|
accountingAttributes: this.accountingAttributesVal, |
|
|
|
|
accountingAttributes: value, |
|
|
|
|
} |
|
|
|
|
getAction(this.url.descriptionRake,par).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|