|
|
|
@ -75,9 +75,10 @@
|
|
|
|
|
:isabled="isabled" |
|
|
|
|
:rowNumber="true" |
|
|
|
|
:rowSelection="true" |
|
|
|
|
:appropriationPlan ="this.libraryInvisible" |
|
|
|
|
:actionButton="!task" |
|
|
|
|
@valueChange="onSelect" |
|
|
|
|
@descriptionFetch="descriptionFetchData" |
|
|
|
|
@descriptionFetch="fetchMerchandiseNews" |
|
|
|
|
/> |
|
|
|
|
</a-tab-pane> |
|
|
|
|
</a-tabs> |
|
|
|
@ -175,7 +176,7 @@
|
|
|
|
|
dictCode: '', |
|
|
|
|
width: '200px', |
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
disabled: this.disabled, |
|
|
|
|
disabled: true, |
|
|
|
|
options: [] |
|
|
|
|
// props:{title: 'show title'} |
|
|
|
|
// scopedSlots: { customRender: 'edit' },//引入的插槽 |
|
|
|
@ -420,58 +421,89 @@
|
|
|
|
|
// console.log(record) |
|
|
|
|
// console.log("keykey",record.column.key) |
|
|
|
|
let isDB = true |
|
|
|
|
if (!!record.row.materialGroup) { |
|
|
|
|
if (this.issh){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (!!record.row.id && this.materialGroupId !== record.row.materialGroup && record.column.key !== "allotNumber" ) { |
|
|
|
|
// console.log("record.row.materialGroup") |
|
|
|
|
await this.fetchMerchandiseNews(record.row.materialGroup, 1) |
|
|
|
|
let value = [ |
|
|
|
|
{ |
|
|
|
|
rowKey: record.row.id, |
|
|
|
|
values: { |
|
|
|
|
'equipment': '', |
|
|
|
|
'materialGroup': record.row.materialGroup, |
|
|
|
|
'materialName': '', |
|
|
|
|
'materialUnit': '', |
|
|
|
|
'supplierId': '', |
|
|
|
|
'materialPrice': '', |
|
|
|
|
// 'number': '', |
|
|
|
|
'allotNumber': '', |
|
|
|
|
'materialAmount': '' |
|
|
|
|
} |
|
|
|
|
// if (!!record.row.materialGroup) { |
|
|
|
|
// if (this.issh){ |
|
|
|
|
// return; |
|
|
|
|
// } |
|
|
|
|
// if (!!record.row.id && this.materialGroupId !== record.row.materialGroup && record.column.key !== "allotNumber" ) { |
|
|
|
|
// // console.log("record.row.materialGroup") |
|
|
|
|
// await this.fetchMerchandiseNews(record.row.materialGroup, 1) |
|
|
|
|
// let value = [ |
|
|
|
|
// { |
|
|
|
|
// rowKey: record.row.id, |
|
|
|
|
// values: { |
|
|
|
|
// 'equipment': '', |
|
|
|
|
// 'materialGroup': record.row.materialGroup, |
|
|
|
|
// 'materialName': '', |
|
|
|
|
// 'materialUnit': '', |
|
|
|
|
// 'supplierId': '', |
|
|
|
|
// 'materialPrice': '', |
|
|
|
|
// // 'number': '', |
|
|
|
|
// 'allotNumber': '', |
|
|
|
|
// 'materialAmount': '' |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// ] |
|
|
|
|
// this.$nextTick(() => { |
|
|
|
|
// this.$refs.processMaterialsAllotList.setValues(value) |
|
|
|
|
// }) |
|
|
|
|
// this.materialGroupId = record.row.materialGroup |
|
|
|
|
// isDB = false |
|
|
|
|
// } |
|
|
|
|
// |
|
|
|
|
// } |
|
|
|
|
if (!!record.row.equipment && !record.row.allotNumber && isDB && this.materialGroupId !== record.row.materialGroup) { |
|
|
|
|
console.log("执行materialNumber") |
|
|
|
|
|
|
|
|
|
await this.$refs.processMaterialsAllotList.getValues((a, b, c) => { |
|
|
|
|
// console.log("bbbbbbbbbbbbbb",b) |
|
|
|
|
b.forEach(item => { |
|
|
|
|
if (item.equipment === record.row.equipment && !!item.materialGroup && !record.row.materialGroup) { |
|
|
|
|
let values = [ |
|
|
|
|
{ |
|
|
|
|
rowKey: record.row.id, |
|
|
|
|
values: { |
|
|
|
|
'equipment': record.row.equipment, |
|
|
|
|
'materialGroup': '', |
|
|
|
|
'materialName': '', |
|
|
|
|
'materialUnit': '', |
|
|
|
|
'supplierId': '', |
|
|
|
|
'materialPrice': '', |
|
|
|
|
'allotNumber': '', |
|
|
|
|
'materialAmount': '' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
// console.log("sadf1111") |
|
|
|
|
this.$refs.processMaterialsAllotList.setValues(values) |
|
|
|
|
return ; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs.processMaterialsAllotList.setValues(value) |
|
|
|
|
}) |
|
|
|
|
this.materialGroupId = record.row.materialGroup |
|
|
|
|
isDB = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if ( !!record.row.materialGroup && record.row.equipment !== '' && record.row.allotNumber === '' && isDB) { |
|
|
|
|
// console.log("执行materialNumber") |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
let materialName = {} |
|
|
|
|
this.bigIdMerchandiseNewsList.forEach(item => { |
|
|
|
|
if (item.merchandiseNewsId === record.row.equipment) { |
|
|
|
|
materialName = { |
|
|
|
|
name: item.merchandiseName, |
|
|
|
|
unit: item.materialsUnit, |
|
|
|
|
materialGroup: item.materialClassify, |
|
|
|
|
supplierName: item.supplierId, |
|
|
|
|
price: item.materialPrice |
|
|
|
|
// number : item.residueNumber === undefined ? 0 : item.residueNumber, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
console.log("materialName",materialName); |
|
|
|
|
if(Object.keys(materialName).length > 0){ |
|
|
|
|
let values = [ |
|
|
|
|
{ |
|
|
|
|
rowKey: record.row.id, |
|
|
|
|
values: { |
|
|
|
|
'equipment': record.row.equipment, |
|
|
|
|
'materialGroup': record.row.materialGroup, |
|
|
|
|
'materialGroup': materialName.materialGroup, |
|
|
|
|
'materialName': materialName.name, |
|
|
|
|
'materialUnit': materialName.unit, |
|
|
|
|
'supplierId': materialName.supplierName, |
|
|
|
@ -536,8 +568,6 @@
|
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
//你的逻辑代码 |
|
|
|
|
let par = { |
|
|
|
|
delFlag: 0, |
|
|
|
|
descriptionId: value, |
|
|
|
|
departId: this.libraryInvisible |
|
|
|
|
} |
|
|
|
|
this.bigIdMerchandiseNewsList = [] |
|
|
|
@ -594,37 +624,41 @@
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
descriptionFetchData(value) { //查询物料组 |
|
|
|
|
descriptionFetchData(type,value) { //查询物料组 |
|
|
|
|
//查询数据 |
|
|
|
|
let par = { |
|
|
|
|
delFlag: 0, |
|
|
|
|
accountingAttributes: value |
|
|
|
|
// departId: this.data.departId |
|
|
|
|
} |
|
|
|
|
getAction(this.url.descriptionRake, par).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
|
|
|
|
|
if (this.processMaterialsAllotListTable.columns[0].options.length > 0) { |
|
|
|
|
this.processMaterialsAllotListTable.columns[0].options = [] |
|
|
|
|
} |
|
|
|
|
res.result.forEach(item => { |
|
|
|
|
this.processMaterialsAllotListTable.columns[0].options.push({ |
|
|
|
|
title: item.materialClassify, |
|
|
|
|
value: item.descriptionId |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// let par = { |
|
|
|
|
// delFlag: 0, |
|
|
|
|
// accountingAttributes: value |
|
|
|
|
// // departId: this.data.departId |
|
|
|
|
// } |
|
|
|
|
// getAction(this.url.descriptionRake, par).then((res) => { |
|
|
|
|
// if (res.success) { |
|
|
|
|
// |
|
|
|
|
// if (this.processMaterialsAllotListTable.columns[0].options.length > 0) { |
|
|
|
|
// this.processMaterialsAllotListTable.columns[0].options = [] |
|
|
|
|
// } |
|
|
|
|
// res.result.forEach(item => { |
|
|
|
|
// this.processMaterialsAllotListTable.columns[0].options.push({ |
|
|
|
|
// title: item.materialClassify, |
|
|
|
|
// value: item.descriptionId |
|
|
|
|
// }) |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
getAction(this.url.unitWasteNameUrl, null).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
if (this.processMaterialsAllotListTable.columns[6].options.length > 0) { |
|
|
|
|
this.processMaterialsAllotListTable.columns[6].options = [] |
|
|
|
|
} |
|
|
|
|
res.result.forEach(item => { |
|
|
|
|
let is= false; |
|
|
|
|
if(item.unit === value){ |
|
|
|
|
is = true; |
|
|
|
|
} |
|
|
|
|
this.processMaterialsAllotListTable.columns[6].options.push({ |
|
|
|
|
title: item.departName, |
|
|
|
|
value: item.unit |
|
|
|
|
value: item.unit, |
|
|
|
|
disabled : is |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -638,7 +672,8 @@
|
|
|
|
|
this.materialTypeRecord = val; |
|
|
|
|
if (!!val && !!this.libraryInvisible ) { |
|
|
|
|
this.heid = false |
|
|
|
|
this.descriptionFetchData(val,this.libraryInvisible) |
|
|
|
|
// this.descriptionFetchData(val,this.libraryInvisible) |
|
|
|
|
this.fetchMerchandiseNews() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
/*回显数据*/ |
|
|
|
|