|
|
|
@ -120,6 +120,7 @@
|
|
|
|
|
:rowSelection="true" |
|
|
|
|
:actionButton="true" |
|
|
|
|
@shifu="shifu" |
|
|
|
|
@bumen="bumen" |
|
|
|
|
@descriptionFetch="fetchMerchandiseNews" |
|
|
|
|
> |
|
|
|
|
<template v-slot:action="props"> |
|
|
|
@ -719,6 +720,13 @@
|
|
|
|
|
// console.log('执行了') |
|
|
|
|
this.isShifu = true |
|
|
|
|
}, |
|
|
|
|
bumen() { |
|
|
|
|
this.putUnder = null; //归口部门 |
|
|
|
|
this.form.setFieldsValue({ |
|
|
|
|
putUnder: null |
|
|
|
|
}) |
|
|
|
|
this.fetchMerchandiseNews(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// handleChange(value, key, column) { |
|
|
|
|
// const newData = [...this.data]; |
|
|
|
@ -924,37 +932,29 @@
|
|
|
|
|
}, |
|
|
|
|
//table 值改变触发 |
|
|
|
|
async onSelect(record) { |
|
|
|
|
|
|
|
|
|
let isEr = true |
|
|
|
|
// if (!!record.row.materialGroup) { |
|
|
|
|
// if (!!record.row.id && this.isBu !== record.row.materialGroup) { |
|
|
|
|
// // console.log("1出发了",record.row); |
|
|
|
|
// this.isabled = false |
|
|
|
|
// this.fetchMerchandiseNews(record.row.materialGroup) |
|
|
|
|
// this.isBu = record.row.materialGroup |
|
|
|
|
// let values = [ |
|
|
|
|
// { |
|
|
|
|
// rowKey: record.row.id, |
|
|
|
|
// values: { |
|
|
|
|
// 'materialNumber': '', |
|
|
|
|
// 'materialSeries': '', |
|
|
|
|
// 'materialName': '', |
|
|
|
|
// 'materialUnit': '', |
|
|
|
|
// 'supplierId': '', |
|
|
|
|
// 'materialAmount': '', |
|
|
|
|
// 'materialType': '' |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// ] |
|
|
|
|
// this.$refs.processUdgetPlanMaterial.setValues(values) |
|
|
|
|
// isEr = false |
|
|
|
|
// } |
|
|
|
|
// // if( record.row.id !== undefined && record.row.id !== '' || record.row.materialNumber === '' || record.row.materialNumber === undefined){ |
|
|
|
|
// // console.log("11出发了",record.row); |
|
|
|
|
// // } |
|
|
|
|
// } |
|
|
|
|
// console.log("5555出发了",record.row); |
|
|
|
|
// if ( !!record.row.materialNumber && isEr) { |
|
|
|
|
if (!record.row.materialNumber && !!record.row.materialGroup && !!record.row.materialName |
|
|
|
|
|| !record.row.materialName && !!record.row.materialGroup && !!record.row.materialNumber ) { |
|
|
|
|
console.log("select==清空数据",record.row); |
|
|
|
|
let values = [ |
|
|
|
|
{ |
|
|
|
|
rowKey: record.row.id, |
|
|
|
|
values: { |
|
|
|
|
'materialGroup': '', |
|
|
|
|
'materialNumber': '', |
|
|
|
|
'materialSeries': '', |
|
|
|
|
'materialName': '', |
|
|
|
|
'materialUnit': '', |
|
|
|
|
'supplierId': '', |
|
|
|
|
'materialAmount': '', |
|
|
|
|
'materialType': '' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
this.$refs.processUdgetPlanMaterial.setValues(values); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let b = false |
|
|
|
|
if (this.isShifu) { |
|
|
|
|
// console.log("0出发了",record); |
|
|
|
@ -968,15 +968,16 @@
|
|
|
|
|
await this.fetchMerchandiseNews(null, record.value); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.isShifu = false |
|
|
|
|
if (record.column.key == 'materialNumber' || record.column.key == 'materialName') { |
|
|
|
|
this.isShifu = false; |
|
|
|
|
if (record.column.key == 'materialNumber' && !!record.row.id |
|
|
|
|
|| record.column.key == 'materialName' && !!record.row.id ) { |
|
|
|
|
// console.log("进来了111",record); |
|
|
|
|
// if (!!record.row.materialName && this.isBu !== record.row.materialName) { |
|
|
|
|
// console.log("2出发了"); |
|
|
|
|
console.log("2出发了"); |
|
|
|
|
let materialName = {} |
|
|
|
|
this.bigIdMerchandiseNewsList.forEach(item => { |
|
|
|
|
if (item.id === record.value) { |
|
|
|
|
console.log("=====",item); |
|
|
|
|
// console.log("=====",item); |
|
|
|
|
materialName = { |
|
|
|
|
materialClassify: item.materialClassify, |
|
|
|
|
name: item.merchandiseName, |
|
|
|
@ -993,12 +994,13 @@
|
|
|
|
|
this.putUnder = item.materialDepart; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// console.log("============", this.bigIdMerchandiseNewsList.length); |
|
|
|
|
console.log("===========12312 =", materialName); |
|
|
|
|
if (!!record.row.id && Object.keys(materialName).length > 0) { |
|
|
|
|
await this.$refs.processUdgetPlanMaterial.getValues((a, b, c) => { |
|
|
|
|
// console.log("bbbbbbbbbbbbbb",b) |
|
|
|
|
b.forEach(item => { |
|
|
|
|
if (item.materialNumber === record.value && !!item.materialGroup ) { |
|
|
|
|
if (item.materialNumber === record.value && !!item.materialGroup && item.materialName == materialName.merchandiseName) { |
|
|
|
|
// console.log("bbbbbbbbbbbbbb",b) |
|
|
|
|
let values = [ |
|
|
|
|
{ |
|
|
|
|
rowKey: record.row.id, |
|
|
|
@ -1048,85 +1050,12 @@
|
|
|
|
|
this.isBu = record.value; |
|
|
|
|
isEr = false |
|
|
|
|
} |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (!!record.row.materialNumber && this.isBu !== record.row.materialNumber) { |
|
|
|
|
// console.log("2出发了"); |
|
|
|
|
// let materialName = {} |
|
|
|
|
// this.bigIdMerchandiseNewsList.forEach(item => { |
|
|
|
|
// if (item.id === record.row.materialNumber) { |
|
|
|
|
// materialName = { |
|
|
|
|
// materialClassify: item.materialClassify, |
|
|
|
|
// name: item.merchandiseName, |
|
|
|
|
// unit: item.materialsUnit, |
|
|
|
|
// supplierId: item.supplierId, |
|
|
|
|
// descriptionId: item.descriptionId |
|
|
|
|
// } |
|
|
|
|
// this.form.setFieldsValue({ |
|
|
|
|
// putUnder: item.materialDepart |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// |
|
|
|
|
// if (!!record.row.id && Object.keys(materialName).length > 0) { |
|
|
|
|
// await this.$refs.processUdgetPlanMaterial.getValues((a, b, c) => { |
|
|
|
|
// // console.log("bbbbbbbbbbbbbb",b) |
|
|
|
|
// b.forEach(item => { |
|
|
|
|
// if (item.materialNumber === record.row.materialNumber && !!item.materialGroup && !record.row.materialGroup) { |
|
|
|
|
// let values = [ |
|
|
|
|
// { |
|
|
|
|
// rowKey: record.row.id, |
|
|
|
|
// values: { |
|
|
|
|
// 'materialGroup': '', |
|
|
|
|
// 'materialNumber': '', |
|
|
|
|
// 'materialSeries': '', |
|
|
|
|
// 'materialName': '', |
|
|
|
|
// 'materialUnit': '', |
|
|
|
|
// 'supplierId': '', |
|
|
|
|
// 'materialAmount': '', |
|
|
|
|
// 'materialType': '' |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// ] |
|
|
|
|
// // console.log("sadf1111") |
|
|
|
|
// this.$refs.processUdgetPlanMaterial.setValues(values) |
|
|
|
|
// return |
|
|
|
|
// |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// |
|
|
|
|
// }) |
|
|
|
|
// |
|
|
|
|
// this.processUdgetPlanMaterialTable.columns[0].options.push({ |
|
|
|
|
// title: materialName.materialClassify, |
|
|
|
|
// value: materialName.descriptionId |
|
|
|
|
// }) |
|
|
|
|
// let values = [ |
|
|
|
|
// { |
|
|
|
|
// rowKey: record.row.id, |
|
|
|
|
// values: { |
|
|
|
|
// 'materialNumber': record.row.materialNumber, |
|
|
|
|
// 'materialGroup': materialName.descriptionId, |
|
|
|
|
// // 'materialGroup': this.materialId, |
|
|
|
|
// 'materialSeries': record.row.materialSeries, |
|
|
|
|
// 'materialName': materialName.name, |
|
|
|
|
// 'materialUnit': materialName.unit, |
|
|
|
|
// 'supplierId': materialName.supplierId |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// ] |
|
|
|
|
// this.$refs.processUdgetPlanMaterial.setValues(values) |
|
|
|
|
// this.isBu = record.row.materialNumber |
|
|
|
|
// isEr = false |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//计算金额 |
|
|
|
|
if (!!record.row.materialQuantity && !!record.row.materialPrice && isEr) { |
|
|
|
|
// record.row.materialAmount = record.row.materialQuantity * record.row.materialPrice; |
|
|
|
|
// console.log("3出发了"); |
|
|
|
|
console.log("3出发了"); |
|
|
|
|
//如果单价大于5万 |
|
|
|
|
if (record.row.materialPrice > 50000) { |
|
|
|
|
this.materialPrice = record.row.materialPrice |
|
|
|
@ -1223,7 +1152,7 @@
|
|
|
|
|
this.bigIdMerchandiseNewsList = res.result |
|
|
|
|
// resolve( this.bigIdMerchandiseNewsList ); |
|
|
|
|
} |
|
|
|
|
resolve(this.bigIdMerchandiseNewsList) |
|
|
|
|
resolve() |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|