|
|
|
@ -107,7 +107,7 @@ import { FormTypes, getRefPromise, VALIDATE_NO_PASSED, validateFormAndTables } f
|
|
|
|
|
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep' |
|
|
|
|
import JDictSelectTag from '@/components/dict/JDictSelectTag' |
|
|
|
|
import JSelectCompany from '../../../../components/jeecgbiz/JSelectCompany' |
|
|
|
|
import { getAction, getCurrentTime, getStringArry, httpAction } from '@api/manage' |
|
|
|
|
import { getAction, getCurrentTime, getRecord, getStringArry, httpAction } from '@api/manage' |
|
|
|
|
import pick from 'lodash.pick' |
|
|
|
|
import { accMul } from '../../../../../common/common' |
|
|
|
|
|
|
|
|
@ -171,7 +171,7 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
title: '火工品物料组', |
|
|
|
|
key: 'materialGroup', |
|
|
|
|
type: FormTypes.input, |
|
|
|
|
width:"200px", |
|
|
|
|
width:"150px", |
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
defaultValue:'', |
|
|
|
|
disabled: true |
|
|
|
@ -192,12 +192,13 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
width:"200px", |
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
defaultValue:'', |
|
|
|
|
options:[] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '火工品单位', |
|
|
|
|
key: 'unit', |
|
|
|
|
type: FormTypes.input, |
|
|
|
|
width:"200px", |
|
|
|
|
width:"120px", |
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
defaultValue:'', |
|
|
|
|
disabled:true |
|
|
|
@ -206,7 +207,7 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
title: '请数量', |
|
|
|
|
key: 'quantity', |
|
|
|
|
type: FormTypes.input, |
|
|
|
|
width:"200px", |
|
|
|
|
width:"120px", |
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
defaultValue:'', |
|
|
|
|
}, |
|
|
|
@ -214,7 +215,7 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
title: '实发数量', |
|
|
|
|
key: 'amount', |
|
|
|
|
type: FormTypes.input, |
|
|
|
|
width:"200px", |
|
|
|
|
width:"120px", |
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
defaultValue:'', |
|
|
|
|
disabled: !this.disabled |
|
|
|
@ -262,7 +263,7 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
title: '生产日期', |
|
|
|
|
key: 'producedDate', |
|
|
|
|
type: FormTypes.date, |
|
|
|
|
width: '200px', |
|
|
|
|
width: '150px', |
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
disabled: this.disabled, |
|
|
|
|
defaultValue: '' |
|
|
|
@ -284,14 +285,14 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
defaultValue:'', |
|
|
|
|
}, |
|
|
|
|
// { |
|
|
|
|
// title: '出库表ID', |
|
|
|
|
// key: 'industrialDeliveryId', |
|
|
|
|
// type: FormTypes.input, |
|
|
|
|
// width:"200px", |
|
|
|
|
// placeholder: '请输入${title}', |
|
|
|
|
// defaultValue:'', |
|
|
|
|
// }, |
|
|
|
|
{ |
|
|
|
|
title: '', //缓存库ID |
|
|
|
|
key: 'industrialDeliveryId', |
|
|
|
|
type: FormTypes.input, |
|
|
|
|
width:"0px", |
|
|
|
|
placeholder: '请输入${title}', |
|
|
|
|
defaultValue:'', |
|
|
|
|
}, |
|
|
|
|
// { |
|
|
|
|
// title: '删除标识', |
|
|
|
|
// key: 'delFlag', |
|
|
|
@ -305,9 +306,10 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
url: { |
|
|
|
|
add: "/burst/processIndustrialDelivery/add", |
|
|
|
|
addApply: "/burst/processIndustrialDelivery/addApply", |
|
|
|
|
queryById: "/burst/processIndustrial/queryById", //查询民爆基础信息 |
|
|
|
|
queryPurchaseById: "/burst/processIndustrialDelivery/queryById", |
|
|
|
|
edit: "/burst/processIndustrialDelivery/edit", |
|
|
|
|
processIndustrialUrlList: '/gunpowder/processIndustrialCachelibrary/oneselfList', //查询民爆缓存库物资表 |
|
|
|
|
getFirstNode: '/actProcessIns/getFirstNode', |
|
|
|
|
processIndustrialDeliveryMaterial: { |
|
|
|
|
list: '/burst/processIndustrialDelivery/queryProcessIndustrialDeliveryMaterialByMainId' |
|
|
|
|
}, |
|
|
|
@ -316,6 +318,7 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
historyNumList: [], // |
|
|
|
|
equipmentList: [], // |
|
|
|
|
MBShuJu: [], // |
|
|
|
|
describes: '', //流程标识 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
props: { |
|
|
|
@ -349,24 +352,22 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
let company = sessionStorage.getItem('PARENT_ID') |
|
|
|
|
let puwwcid = sessionStorage.getItem('PUWWC_Id') |
|
|
|
|
let userInfo = sessionStorage.getItem('USER_INFORMATION') |
|
|
|
|
this.popupCallback(company, userInfo, puwwcid) |
|
|
|
|
|
|
|
|
|
if (!this.isNew) { |
|
|
|
|
this.init() |
|
|
|
|
} else { |
|
|
|
|
this.popupCallback(company, userInfo, puwwcid) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//查询民爆 |
|
|
|
|
searchInformation(value){ |
|
|
|
|
|
|
|
|
|
return new Promise( (resolve, reject) => { |
|
|
|
|
return new Promise( async (resolve, reject) => { |
|
|
|
|
let par = { |
|
|
|
|
category: this.accounting |
|
|
|
|
} |
|
|
|
|
let numberList = []; |
|
|
|
|
this.$refs.processIndustrialDeliveryMaterial.getValues((a, b, c) => { |
|
|
|
|
b.forEach(item => { |
|
|
|
|
if (!!item.equipment) { |
|
|
|
|
numberList.push(item.equipment) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
await this.getSurface(); |
|
|
|
|
//查询数据 |
|
|
|
|
// console.log("=-=-=-",par); |
|
|
|
|
getAction(this.url.processIndustrialUrlList,par).then(res =>{ |
|
|
|
@ -378,6 +379,9 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
if (this.processIndustrialDeliveryMaterialTable.columns[1].options.length > 0) { |
|
|
|
|
this.processIndustrialDeliveryMaterialTable.columns[1].options = [] |
|
|
|
|
} |
|
|
|
|
if (this.processIndustrialDeliveryMaterialTable.columns[2].options.length > 0) { |
|
|
|
|
this.processIndustrialDeliveryMaterialTable.columns[2].options = [] |
|
|
|
|
} |
|
|
|
|
nu.forEach(item =>{ |
|
|
|
|
qc.push({ |
|
|
|
|
title: item.coding, |
|
|
|
@ -386,10 +390,10 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
// console.log("qc>>>>>>>>>>>>>>>",qc) |
|
|
|
|
numberList.forEach( it => { |
|
|
|
|
this.historyNumList.forEach( it => { |
|
|
|
|
// console.log("000000",it); |
|
|
|
|
qc.forEach(item =>{ |
|
|
|
|
if( it == item.value ){ |
|
|
|
|
if( it.industrialId == item.value ){ |
|
|
|
|
item.disabled = true; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -425,7 +429,11 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
'industrialName': undefined, |
|
|
|
|
'unit': '', |
|
|
|
|
'quantity': '', |
|
|
|
|
'purpose': '' |
|
|
|
|
'purpose': '', |
|
|
|
|
"unitPrice":'', |
|
|
|
|
"producedDate":'', |
|
|
|
|
"manufacturer":'', |
|
|
|
|
"staleDated": '', |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
@ -436,12 +444,13 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
async getMBShuJu(v){ |
|
|
|
|
let par ={}; |
|
|
|
|
if(!!v){ |
|
|
|
|
par.id = v; |
|
|
|
|
par.materialsNumber = v; |
|
|
|
|
} |
|
|
|
|
par.category = this.assigneesText; |
|
|
|
|
await getAction(this.url.queryById,par).then(res => { |
|
|
|
|
await getAction(this.url.processIndustrialUrlList,par).then(res => { |
|
|
|
|
if(res.success){ |
|
|
|
|
this.MBShuJu = res.result; |
|
|
|
|
this.MBShuJu = []; |
|
|
|
|
this.MBShuJu = res.result.records[0] ; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
@ -452,10 +461,15 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
{ |
|
|
|
|
rowKey: id, |
|
|
|
|
values: { |
|
|
|
|
'industrialId': v.coding, |
|
|
|
|
'industrialId': v.materialsNumber, |
|
|
|
|
'materialGroup': v.materialClassify, |
|
|
|
|
'industrialName': v.name, |
|
|
|
|
'unit': v.unit, |
|
|
|
|
"unitPrice":v.unitPrice, |
|
|
|
|
"producedDate":!!v.producedDate ? v.producedDate : null, |
|
|
|
|
"manufacturer":v.manufacturer , |
|
|
|
|
"staleDated": !!v.staleDated ? v.staleDated : null, |
|
|
|
|
"industrialDeliveryId": v.id |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
@ -468,10 +482,12 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
if(!!record.row.id){ |
|
|
|
|
let same = false; |
|
|
|
|
this.historyNumList.forEach( item =>{ |
|
|
|
|
// console.log("列表值=-",this.historyNumList); |
|
|
|
|
// console.log("列表值=-",item); |
|
|
|
|
if(!!item.industrialId && !!item.industrialName && item.industrialId == record.value ){ |
|
|
|
|
console.log("111====",item); |
|
|
|
|
this.qingKong(record.row.id); |
|
|
|
|
this.isShifu = false; |
|
|
|
|
this.searchInformation(); |
|
|
|
|
same = true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -489,12 +505,13 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
//查询民爆数据 |
|
|
|
|
await this.getMBShuJu(record.value); |
|
|
|
|
this.isShifu = false; |
|
|
|
|
console.log("121212s-=-=",this.MBShuJu); |
|
|
|
|
this.fuZhi(record.row.id,this.MBShuJu); |
|
|
|
|
} |
|
|
|
|
if(record.column.key === "industrialId" && !!record.row.id ){ |
|
|
|
|
this.equipmentList.forEach(item =>{ |
|
|
|
|
if(item.materialsNumber === record.value){ |
|
|
|
|
// console.log("11134234",item); |
|
|
|
|
console.log("11134234",item); |
|
|
|
|
this.fuZhi(record.row.id,item); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
@ -529,7 +546,6 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
this.isabled = false; |
|
|
|
|
this.qeihuan = val; |
|
|
|
|
//查询民爆物资 |
|
|
|
|
this.assigneesText = val |
|
|
|
|
await this.searchInformation(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -540,7 +556,9 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
//驳回 |
|
|
|
|
backTask(){}, |
|
|
|
|
//通过 |
|
|
|
|
passTask(){}, |
|
|
|
|
passTask(){ |
|
|
|
|
this.$emit('passTask'); |
|
|
|
|
}, |
|
|
|
|
//提交申请 |
|
|
|
|
applySubmit(e) { |
|
|
|
|
this.getAllTable().then(tables => { |
|
|
|
@ -549,23 +567,30 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
if (typeof this.classifyIntoFormData !== 'function') { |
|
|
|
|
throw this.throwNotFunction('classifyIntoFormData') |
|
|
|
|
} |
|
|
|
|
let formData = this.classifyIntoFormData(allValues) |
|
|
|
|
let formData = this.classifyIntoFormData(allValues); |
|
|
|
|
console.log("=--=-=-",formData); |
|
|
|
|
/* if (formData.processIndustrialDeliveryMaterialList==0){ |
|
|
|
|
if (formData.processIndustrialDeliveryMaterialList.length < 1){ |
|
|
|
|
this.$message.error('请填写清单内容') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
let qing= false; |
|
|
|
|
formData.processIndustrialDeliveryMaterialList.forEach(item =>{ |
|
|
|
|
if(!item.quantity){ |
|
|
|
|
|
|
|
|
|
qing= true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if(qing){ |
|
|
|
|
this.$message.warning("请填写请发数!"); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
for (let i = 0; i < formData.processIndustrialDeliveryMaterialList.length; i++) { |
|
|
|
|
if (i == 0) { |
|
|
|
|
this.describes = formData.processIndustrialDeliveryMaterialList[i].materialName |
|
|
|
|
this.describes = formData.processIndustrialDeliveryMaterialList[i].industrialName |
|
|
|
|
} else { |
|
|
|
|
this.describes = this.describes + '---' + formData.processIndustrialDeliveryMaterialList[i].materialName |
|
|
|
|
this.describes = this.describes + '---' + formData.processIndustrialDeliveryMaterialList[i].industrialName |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
formData.fileId = getStringArry(formData.fileId) |
|
|
|
|
// if (this.materialPrice != 0 && this.materialPrice != null) { |
|
|
|
@ -600,35 +625,21 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
formData.title = this.processData.title |
|
|
|
|
formData.processInstanceId = this.processData.id |
|
|
|
|
} |
|
|
|
|
if (formData.planType == 1 && formData.materialType != 6) { |
|
|
|
|
console.log('格式化后的数据', formData) |
|
|
|
|
// if (formData.ifDirect == null && this.routePlanName == '采购员') { |
|
|
|
|
// this.$message.error('请选择是否属于直达物资!') |
|
|
|
|
// return; |
|
|
|
|
// } else { |
|
|
|
|
// if (formData.ifDirect == 1) { |
|
|
|
|
// if (formData.ifInspection == null) { |
|
|
|
|
// this.$message.error('请选择是否需要送检!') |
|
|
|
|
// return |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
console.log(formData, '表单数据') |
|
|
|
|
if (this.btndisabled === false) { |
|
|
|
|
// this.btndisabled = true |
|
|
|
|
// httpAction(url, formData, method).then((res) => { |
|
|
|
|
// if (res.success) { |
|
|
|
|
// this.$message.success('提交申请成功!') |
|
|
|
|
// //todo 将表单的数据传给父组件 |
|
|
|
|
// this.$emit('afterSubmit',formData) |
|
|
|
|
// //this.close() |
|
|
|
|
// } else { |
|
|
|
|
// this.$message.error(res.message) |
|
|
|
|
// } |
|
|
|
|
// }).finally(() => { |
|
|
|
|
// this.btndisabled = false |
|
|
|
|
// }) |
|
|
|
|
this.btndisabled = true |
|
|
|
|
httpAction(url, formData, method).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.$message.success('提交申请成功!') |
|
|
|
|
//todo 将表单的数据传给父组件 |
|
|
|
|
this.$emit('loadData') |
|
|
|
|
this.close(); |
|
|
|
|
} else { |
|
|
|
|
this.$message.error(res.message) |
|
|
|
|
} |
|
|
|
|
}).finally(() => { |
|
|
|
|
this.btndisabled = false |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -738,6 +749,55 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
getAssignees(v) { |
|
|
|
|
getAction(this.url.getFirstNode, { |
|
|
|
|
procDefId: v.procDefId, |
|
|
|
|
tableId: v.tableId, |
|
|
|
|
tableName: v.tableName |
|
|
|
|
}).then(res => { |
|
|
|
|
if (res.success) { |
|
|
|
|
if (res.result.users && res.result.users.length > 0) { |
|
|
|
|
// 默认勾选 |
|
|
|
|
let ids = [] |
|
|
|
|
res.result.users.forEach(e => { |
|
|
|
|
ids.push(e.username) |
|
|
|
|
}) |
|
|
|
|
this.assignees = ids.join(',') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
/*回显数据*/ |
|
|
|
|
init() { |
|
|
|
|
// debugger |
|
|
|
|
this.btndisabled = true |
|
|
|
|
var r = this.processData |
|
|
|
|
this.getAssignees(r) |
|
|
|
|
if (!r.tableId) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.getAction(this.url.queryPurchaseById, { |
|
|
|
|
id: r.tableId |
|
|
|
|
}).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
// this.planType = res.result.planType |
|
|
|
|
let formData = res.result |
|
|
|
|
formData.tableName = r.tableName |
|
|
|
|
this.data = formData |
|
|
|
|
if (formData.materialType) { |
|
|
|
|
// this.hieg=false; |
|
|
|
|
// this.fetchDataRake(); |
|
|
|
|
// this.descriptionFetchDatas() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.editAfter() |
|
|
|
|
this.btndisabled = false |
|
|
|
|
} else { |
|
|
|
|
this.$message.error(res.message) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
popupCallback(company, row, puwwcid) { |
|
|
|
|
let res = JSON.parse(row) |
|
|
|
|
let param = {} |
|
|
|
@ -763,14 +823,57 @@ import { accMul } from '../../../../../common/common'
|
|
|
|
|
}, |
|
|
|
|
/** 调用完edit()方法之后会自动调用此方法 */ |
|
|
|
|
editAfter() { |
|
|
|
|
if (this.data.id != null && this.data.id != '' && this.data.id != undefined && this.data.fileId != null && this.data.fileId != '') { |
|
|
|
|
//1、文件回显 |
|
|
|
|
this.data = getRecord(this.data) |
|
|
|
|
} |
|
|
|
|
console.log(this.data, '数据回显') |
|
|
|
|
let fieldval = pick(this.data, 'id', 'company', 'createTime', 'departId', 'createBy', 'type', 'fileId') |
|
|
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.accounting = this.data.type.toString(); |
|
|
|
|
this.form.setFieldsValue(fieldval) |
|
|
|
|
}) |
|
|
|
|
// 加载子表数据 |
|
|
|
|
if (this.model.id) { |
|
|
|
|
let params = { id: this.model.id } |
|
|
|
|
this.requestSubTableData(this.url.processIndustrialDeliveryMaterial.list, params, this.processIndustrialDeliveryMaterialTable) |
|
|
|
|
if (this.data.id) { |
|
|
|
|
let params = { id: this.data.id } |
|
|
|
|
console.log("dfsd") |
|
|
|
|
this.requestSubTableDatas(this.url.processIndustrialDeliveryMaterial.list, params, this.processIndustrialDeliveryMaterialTable) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
/** 查询某个tab的数据 */ |
|
|
|
|
requestSubTableDatas(url, params, tab, success) { |
|
|
|
|
tab.loading = true |
|
|
|
|
getAction(url, params).then(res => { |
|
|
|
|
let { result } = res |
|
|
|
|
let dataSource = [] |
|
|
|
|
if (result) { |
|
|
|
|
if (Array.isArray(result)) { |
|
|
|
|
dataSource = result |
|
|
|
|
} else if (Array.isArray(result.records)) { |
|
|
|
|
dataSource = result.records |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
console.log("result.records",dataSource); |
|
|
|
|
// for (let i = 0; i < dataSource.length; i++) { |
|
|
|
|
// this.listId.push(dataSource[i].materialGroup) |
|
|
|
|
// } |
|
|
|
|
// console.log(this.listId) |
|
|
|
|
|
|
|
|
|
// for (let i = 0; i < this.listId.length; i++) { |
|
|
|
|
// // console.log(this.listId[i])\ |
|
|
|
|
// this.descriptionId(this.listId[i]) |
|
|
|
|
// |
|
|
|
|
// this.fetchMerchandiseNews(this.listId[i]) |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
tab.dataSource = dataSource |
|
|
|
|
|
|
|
|
|
typeof success === 'function' ? success(res) : '' |
|
|
|
|
}).finally(() => { |
|
|
|
|
tab.loading = false |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//校验所有一对一子表表单 |
|
|
|
|
validateSubForm(allValues){ |
|
|
|
|
return new Promise((resolve,reject)=>{ |
|
|
|
|