|
|
|
@ -58,10 +58,10 @@
|
|
|
|
|
:columns="processSmaterialsScrapListTable.columns" |
|
|
|
|
:dataSource="processSmaterialsScrapListTable.dataSource" |
|
|
|
|
:maxHeight="300" |
|
|
|
|
:disabled="formDisabled" |
|
|
|
|
:isabled="isabled" |
|
|
|
|
:dragSortType="accounting" |
|
|
|
|
:sections = section |
|
|
|
|
:materialNature = materialNature |
|
|
|
|
:rowNumber="true" |
|
|
|
|
:rowSelection="true" |
|
|
|
|
@valueChange ="onSelect" |
|
|
|
@ -134,6 +134,7 @@
|
|
|
|
|
return { |
|
|
|
|
heid: true, |
|
|
|
|
isabled : true, |
|
|
|
|
materialNature : null, //资产类型 |
|
|
|
|
qeihuan : true, //切换类型 |
|
|
|
|
deliveryType : true, //查询物资库类型 |
|
|
|
|
disabl : true, //输入控制 |
|
|
|
@ -239,7 +240,7 @@
|
|
|
|
|
title: '实际报废数量', |
|
|
|
|
key: 'actualNumber', |
|
|
|
|
type: FormTypes.inputNumber, |
|
|
|
|
disabled: !this.disabled, |
|
|
|
|
disabled: this.allotBaoNumber, |
|
|
|
|
width: '130px', |
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
defaultValue: '' |
|
|
|
@ -304,6 +305,7 @@
|
|
|
|
|
queryByIdMerchandiseNews: "/merchandisenews/processMerchandiseNews/queryById", |
|
|
|
|
queryPageDepare: '/hy/processMaterialsDelivery/queryPageDepare',//查询部门 |
|
|
|
|
wasteMaterialsUrlList: '/wastematerials/processWasteMaterials/list', //查询账外物料组数据 |
|
|
|
|
wasteMaterialsUrlId: '/wastematerials/processWasteMaterials/queryById', //查询账外物料组数据 |
|
|
|
|
getForm: '/actBusiness/getForm', |
|
|
|
|
add: '/hy/processSmaterialsScrap/add', |
|
|
|
|
edit: '/hy/processSmaterialsScrap/edit', |
|
|
|
@ -327,6 +329,7 @@
|
|
|
|
|
equipmentList:[], |
|
|
|
|
accounting: undefined, //类型 |
|
|
|
|
historyNumList : [], //列表数据 |
|
|
|
|
BaoFeiNumList : [], //报废列表数据 |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -343,6 +346,7 @@
|
|
|
|
|
isNew: { type: Boolean, default: false, required: false }, |
|
|
|
|
/*是否处理流程*/ |
|
|
|
|
task: { type: Boolean, default: false, required: false }, |
|
|
|
|
allotBaoNumber: { type: Boolean, default: false, required: false }, |
|
|
|
|
//流程表单data |
|
|
|
|
formData: { |
|
|
|
|
type: Object, |
|
|
|
@ -390,7 +394,8 @@
|
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
//如果是流程中表单,则需要加载流程表单data |
|
|
|
|
this.showFlowData() |
|
|
|
|
this.showFlowData(); |
|
|
|
|
console.log("dfgsdf",this.allotBaoNumber); |
|
|
|
|
let company = sessionStorage.getItem('PARENT_ID') |
|
|
|
|
let userInfo = sessionStorage.getItem('USER_INFORMATION') |
|
|
|
|
this.department(userInfo); |
|
|
|
@ -415,36 +420,49 @@
|
|
|
|
|
this.equipmentList.forEach( item =>{ |
|
|
|
|
// console.log(item) |
|
|
|
|
if(item.merchandiseNewsId == value){ |
|
|
|
|
materialName = { |
|
|
|
|
equipment : item.merchandiseNewsId, |
|
|
|
|
materialName: item.materialDescription, |
|
|
|
|
materialUnit: item.materialsUnit, |
|
|
|
|
materialGroup: item.materialGroup, |
|
|
|
|
supplierName: item.supplierId, |
|
|
|
|
materialPrice: item.materialPrice, |
|
|
|
|
descriptionId: item.descriptionId, |
|
|
|
|
wasteMaterialsId: item.id |
|
|
|
|
if(!item.materialNature){ |
|
|
|
|
this.$message.warning("该物资没有资产类型"); |
|
|
|
|
return |
|
|
|
|
}else{ |
|
|
|
|
this.materialNature = item.materialNature; |
|
|
|
|
materialName = { |
|
|
|
|
equipment : item.merchandiseNewsId, |
|
|
|
|
materialName: item.materialDescription, |
|
|
|
|
materialUnit: item.materialsUnit, |
|
|
|
|
materialGroup: item.materialGroup, |
|
|
|
|
supplierName: item.supplierId, |
|
|
|
|
materialPrice: item.materialPrice, |
|
|
|
|
descriptionId: item.descriptionId, |
|
|
|
|
wasteMaterialsId: item.id |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(Object.keys(materialName).length > 0){ |
|
|
|
|
|
|
|
|
|
let values = [ |
|
|
|
|
{ |
|
|
|
|
rowKey: id, |
|
|
|
|
values: { |
|
|
|
|
'equipment': materialName.equipment, |
|
|
|
|
'materialGroup': materialName.materialGroup, |
|
|
|
|
'materialName': materialName.materialName, |
|
|
|
|
'materialUnit': materialName.materialUnit, |
|
|
|
|
'supplierId': materialName.supplierName, |
|
|
|
|
'materialPrice': materialName.materialPrice, |
|
|
|
|
// 'actualSendNumber': materialName.residueNumber, |
|
|
|
|
'wasteMaterialsId': materialName.wasteMaterialsId |
|
|
|
|
// 'materialAmount': materialName.price * materialName.residueNumber |
|
|
|
|
this.processSmaterialsScrapListTable.columns[0].options.push({ |
|
|
|
|
title: materialName.materialGroup, |
|
|
|
|
value: materialName.descriptionId, |
|
|
|
|
}) |
|
|
|
|
let values = [ |
|
|
|
|
{ |
|
|
|
|
rowKey: id, |
|
|
|
|
values: { |
|
|
|
|
'equipment': materialName.equipment, |
|
|
|
|
'materialGroup': materialName.descriptionId, |
|
|
|
|
'materialName': materialName.materialName, |
|
|
|
|
'materialUnit': materialName.materialUnit, |
|
|
|
|
'supplierId': materialName.supplierName, |
|
|
|
|
'materialPrice': materialName.materialPrice, |
|
|
|
|
// 'actualSendNumber': materialName.residueNumber, |
|
|
|
|
'wasteMaterialsId': materialName.wasteMaterialsId |
|
|
|
|
// 'materialAmount': materialName.price * materialName.residueNumber |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
this.$refs.processSmaterialsScrapList.setValues(values); |
|
|
|
|
] |
|
|
|
|
this.$refs.processSmaterialsScrapList.setValues(values); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
qingKong(id){ //清空 |
|
|
|
|
let values = [ |
|
|
|
@ -503,6 +521,7 @@
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(!sous){ |
|
|
|
|
//根据ID查询 |
|
|
|
|
await this.searchInformation(record.value); |
|
|
|
|
} |
|
|
|
|
this.fuZhi(record.row.id,record.value); |
|
|
|
@ -510,20 +529,45 @@
|
|
|
|
|
await this.jinYong(); |
|
|
|
|
} |
|
|
|
|
//计算金额 |
|
|
|
|
if(record.column.key = "materialAmount" && !!record.row.scrapNumber && this.disabled){ |
|
|
|
|
let values = [ |
|
|
|
|
{ |
|
|
|
|
rowKey: record.row.id, |
|
|
|
|
values: { |
|
|
|
|
// 'scrapNumber': record.row.scrapNumber > 0 ? record.row.scrapNumber : 1 , |
|
|
|
|
'materialAmount': accMul(record.row.materialAmount,record.row.materialPrice) > 0 ? accMul(record.row.materialAmount,record.row.materialPrice) : 1 * record.row.materialPrice, |
|
|
|
|
if(record.column.key = "actualNumber" && !!record.row.scrapNumber && !this.allotBaoNumber){ |
|
|
|
|
let ase = 0; |
|
|
|
|
let bao = false; |
|
|
|
|
this.BaoFeiNumList.forEach(item =>{ |
|
|
|
|
|
|
|
|
|
if(item.merchandiseNewsId === record.row.equipment){ |
|
|
|
|
// console.log("11-=-=",item); |
|
|
|
|
|
|
|
|
|
if(record.row.actualNumber > item.materialQuantity){ |
|
|
|
|
this.$message.warning("实际报废数大于库存数!"); |
|
|
|
|
bao = true; |
|
|
|
|
let values = [ |
|
|
|
|
{ |
|
|
|
|
rowKey: record.row.id, |
|
|
|
|
values: { |
|
|
|
|
'actualNumber': null , |
|
|
|
|
'materialAmount': null, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
this.$refs.processSmaterialsScrapList.setValues(values); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
this.$refs.processSmaterialsScrapList.setValues(values); |
|
|
|
|
}) |
|
|
|
|
if(!bao){ |
|
|
|
|
ase = accMul(record.row.actualNumber,record.row.materialPrice) > 0 ? accMul(record.row.actualNumber,record.row.materialPrice) : 1 * record.row.materialPrice; |
|
|
|
|
let values = [ |
|
|
|
|
{ |
|
|
|
|
rowKey: record.row.id, |
|
|
|
|
values: { |
|
|
|
|
// 'scrapNumber': record.row.scrapNumber > 0 ? record.row.scrapNumber : 1 , |
|
|
|
|
'materialAmount': ase, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
this.$refs.processSmaterialsScrapList.setValues(values); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -534,7 +578,7 @@
|
|
|
|
|
this.isabled = false; |
|
|
|
|
this.qeihuan = val; |
|
|
|
|
this.accounting = val; |
|
|
|
|
this.searchInformation(); |
|
|
|
|
await this.searchInformation(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//查询账外数据 |
|
|
|
@ -552,6 +596,9 @@
|
|
|
|
|
if(!!value){ |
|
|
|
|
par.merchandiseNewsId = value; |
|
|
|
|
} |
|
|
|
|
if(!!this.materialNature){ |
|
|
|
|
par.materialNature = this.materialNature; |
|
|
|
|
} |
|
|
|
|
// console.log("par",par); |
|
|
|
|
let numberList = []; |
|
|
|
|
this.$refs.processSmaterialsScrapList.getValues((a, b, c) => { |
|
|
|
@ -724,6 +771,16 @@
|
|
|
|
|
disabled : true }]; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
let p = { |
|
|
|
|
id : item.wasteMaterialsId |
|
|
|
|
} |
|
|
|
|
this.BaoFeiNumList = []; |
|
|
|
|
getAction(this.url.wasteMaterialsUrlId,p).then( res=>{ |
|
|
|
|
// console.log("账外数据",res); |
|
|
|
|
if(res.success){ |
|
|
|
|
this.BaoFeiNumList.push(res.result); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
@ -739,45 +796,41 @@
|
|
|
|
|
}, |
|
|
|
|
/*通过审批*/ |
|
|
|
|
passTask() { |
|
|
|
|
// if(!this.allotShuNumber){ |
|
|
|
|
// this.getAllTable().then(tables => { |
|
|
|
|
// return validateFormAndTables(this.form, tables) |
|
|
|
|
// }).then(allValues => { |
|
|
|
|
// console.log('所有数据', allValues) |
|
|
|
|
// if(!!allValues.tablesValue[0].values[0] ){ |
|
|
|
|
// let all = false; |
|
|
|
|
// allValues.tablesValue[0].values.forEach( it => { |
|
|
|
|
// if(!it.allotSendNumber){ |
|
|
|
|
// this.$message.warning("请填写实发调拨数据!"); |
|
|
|
|
// all = true; |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
// if(all){ |
|
|
|
|
// return |
|
|
|
|
// }else{ |
|
|
|
|
// let formData = this.classifyIntoFormData(allValues); |
|
|
|
|
// // console.log("124234123",formData); |
|
|
|
|
// let method = 'put' |
|
|
|
|
// httpAction(this.url.edit, formData, method).then((res) => { |
|
|
|
|
// if (res.success) { |
|
|
|
|
// this.$emit('passTask') |
|
|
|
|
// } |
|
|
|
|
// }).finally(() => { |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// |
|
|
|
|
// }else{ |
|
|
|
|
// this.$emit('passTask') |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!this.allotBaoNumber){ |
|
|
|
|
this.getAllTable().then(tables => { |
|
|
|
|
return validateFormAndTables(this.form, tables) |
|
|
|
|
}).then(allValues => { |
|
|
|
|
console.log('所有数据', allValues) |
|
|
|
|
if(!!allValues.tablesValue[0].values[0] ){ |
|
|
|
|
let all = false; |
|
|
|
|
allValues.tablesValue[0].values.forEach( it => { |
|
|
|
|
if(!it.actualNumber){ |
|
|
|
|
all = true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if(all){ |
|
|
|
|
this.$message.warning("请填写实际报废数量!"); |
|
|
|
|
return |
|
|
|
|
}else{ |
|
|
|
|
let formData = this.classifyIntoFormData(allValues); |
|
|
|
|
console.log("124234123",formData); |
|
|
|
|
let method = 'put' |
|
|
|
|
httpAction(this.url.edit, formData, method).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.$emit('passTask') |
|
|
|
|
} |
|
|
|
|
}).finally(() => { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
this.$emit('passTask') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.$emit('passTask') |
|
|
|
|
// this.$emit('passTask') |
|
|
|
|
}, |
|
|
|
|
/*驳回审批*/ |
|
|
|
|
backTask() { |
|
|
|
@ -788,7 +841,7 @@
|
|
|
|
|
this.getAllTable().then(tables => { |
|
|
|
|
return validateFormAndTables(this.form, tables) |
|
|
|
|
}).then(allValues => { |
|
|
|
|
console.log('所有数据', allValues) |
|
|
|
|
// console.log('所有数据', allValues) |
|
|
|
|
if (typeof this.classifyIntoFormData !== 'function') { |
|
|
|
|
throw this.throwNotFunction('classifyIntoFormData') |
|
|
|
|
} |
|
|
|
@ -800,6 +853,12 @@
|
|
|
|
|
this.describes = this.describes + '---' + formData.processSmaterialsScrapListList[i].materialName |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(!!this.materialNature){ |
|
|
|
|
formData.assets = this.materialNature; |
|
|
|
|
}else{ |
|
|
|
|
this.$message.warning("资产类型错误!"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
formData.describes = this.describes |
|
|
|
|
formData.fileId = getStringArry(formData.fileId) |
|
|
|
|
let is_project=sessionStorage.getItem('IS_PROJECT'); |
|
|
|
@ -843,6 +902,7 @@
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
console.log('提交方法', method) |
|
|
|
|
console.log('提交的数据', formData) |
|
|
|
|
if(this.btndisabled === false){ |
|
|
|
|
this.btndisabled = true |
|
|
|
|
httpAction(url, formData, method).then((res) => { |
|
|
|
@ -945,14 +1005,14 @@
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
// console.log('000000000000>', this.data) |
|
|
|
|
let fieldval = pick(this.data, 'id', 'company', 'createTime', 'departId', 'createBy', 'materialType', 'processOutflowId', 'fileId', 'opinion') |
|
|
|
|
let fieldval = pick(this.data, 'id', 'company', 'createTime', 'departId', 'createBy', 'materialType', 'fileId', 'opinion') |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.form.setFieldsValue(fieldval) |
|
|
|
|
}) |
|
|
|
|
// 加载子表数据 |
|
|
|
|
if (this.data.id) { |
|
|
|
|
let params = { id: this.data.id } |
|
|
|
|
this.requestSubTableData(this.url.processSmaterialsScrapList.list, params, this.processSmaterialsScrapListTable) |
|
|
|
|
this.requestSubTableDatas(this.url.processSmaterialsScrapList.list, params, this.processSmaterialsScrapListTable) |
|
|
|
|
// console.log(this.processSmaterialsScrapListTable,"this.processSmaterialsScrapListTable") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|