|
|
|
@ -250,6 +250,7 @@
|
|
|
|
|
bigIdRakeList:[], |
|
|
|
|
materialPrice:0, |
|
|
|
|
materialAmount:0, |
|
|
|
|
getMaterialAmount:0, |
|
|
|
|
describes:'', |
|
|
|
|
hiegs:true, |
|
|
|
|
historyBigId:[], |
|
|
|
@ -506,12 +507,14 @@
|
|
|
|
|
descriptionRake: "/description/processDescription/descriptionName", |
|
|
|
|
merchandiseNewsList: "/merchandisenews/processMerchandiseNews/merchandiseNewsList", |
|
|
|
|
historyUrl: '/suppliesstronger/processSuppliesStronger/list', |
|
|
|
|
getFirstNode:'/actProcessIns/getFirstNode', |
|
|
|
|
processUdgetPlanMaterial: { |
|
|
|
|
list: '/hy/processUdgetPlan/queryProcessUdgetPlanMaterialByMainId' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
btndisabled: false, |
|
|
|
|
isShowInput: '', |
|
|
|
|
assignees:'', |
|
|
|
|
// 表单校验 |
|
|
|
|
validatorRules: { |
|
|
|
|
// 'blur'是鼠标失去焦点的时候会触发验证 |
|
|
|
@ -986,6 +989,7 @@
|
|
|
|
|
init(){ |
|
|
|
|
this.btndisabled = true; |
|
|
|
|
var r = this.processData; |
|
|
|
|
this.getAssignees(r); |
|
|
|
|
this.getAction(this.url.queryById,{ |
|
|
|
|
id:r.tableId |
|
|
|
|
}).then((res)=>{ |
|
|
|
@ -1026,29 +1030,25 @@
|
|
|
|
|
throw this.throwNotFunction('classifyIntoFormData') |
|
|
|
|
} |
|
|
|
|
let formData = this.classifyIntoFormData(allValues) |
|
|
|
|
//计算总价 |
|
|
|
|
|
|
|
|
|
for (let i = 0; i < formData.processUdgetPlanMaterialList.length; i++) { |
|
|
|
|
this.materialAmount=this.materialAmount+ formData.processUdgetPlanMaterialList[i].materialAmount; |
|
|
|
|
if (i==0){ |
|
|
|
|
this.describes=formData.processUdgetPlanMaterialList[i].materialName |
|
|
|
|
}else { |
|
|
|
|
this.describes=this.describes+"---"+formData.processUdgetPlanMaterialList[i].materialName |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
formData.fileId = getStringArry(formData.fileId) |
|
|
|
|
formData.materialPrice=this.materialPrice; |
|
|
|
|
formData.materialAmount=this.materialAmount; |
|
|
|
|
formData.describes=this.describes; |
|
|
|
|
if (new Date(formData.createTime).getTime()/100>new Date(formData.needTime).getTime()/100){ |
|
|
|
|
this.$message.error("需求时间不能小于当前流程发起时间") |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
console.log(this.materialAmount,'采购总价') |
|
|
|
|
|
|
|
|
|
console.log(this.opinion,'流程说明') |
|
|
|
|
this.form.validateFields((err, values) => { |
|
|
|
|
if (!err) { |
|
|
|
|
console.log(this.processData,"申请列表传值数据") |
|
|
|
|
formData.procDefId = this.processData.id; |
|
|
|
|
formData.procDeTitle = this.processData.name; |
|
|
|
|
formData.title=this.processData.description; |
|
|
|
@ -1058,6 +1058,16 @@
|
|
|
|
|
if (!this.isNew){ |
|
|
|
|
url = this.url.editFromTableApply; |
|
|
|
|
method='put'; |
|
|
|
|
formData.assignees=this.assignees |
|
|
|
|
formData.tableName = this.processData.tableName; |
|
|
|
|
formData.procDefId = this.processData.procDefId; |
|
|
|
|
formData.procDeTitle = this.processData.processName; |
|
|
|
|
formData.title=this.processData.title; |
|
|
|
|
formData.processInstanceId=this.processData.id; |
|
|
|
|
if (!this.assignees){ |
|
|
|
|
this.$message.error('审批节点未分配候选审批人员,请联系管理员!') |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.btndisabled = true; |
|
|
|
|
console.log(formData,'表单数据') |
|
|
|
@ -1065,6 +1075,7 @@
|
|
|
|
|
if (res.success){ |
|
|
|
|
this.$message.success("提交申请成功!") |
|
|
|
|
//todo 将表单的数据传给父组件 |
|
|
|
|
this.$emit('loadData') |
|
|
|
|
this.close(); |
|
|
|
|
}else { |
|
|
|
|
this.$message.error(res.message) |
|
|
|
@ -1157,25 +1168,20 @@
|
|
|
|
|
throw this.throwNotFunction('classifyIntoFormData') |
|
|
|
|
} |
|
|
|
|
let formData = this.classifyIntoFormData(allValues) |
|
|
|
|
//计算总价 |
|
|
|
|
for (let i = 0; i < formData.processUdgetPlanMaterialList.length; i++) { |
|
|
|
|
this.materialAmount=this.materialAmount+ formData.processUdgetPlanMaterialList[i].materialAmount; |
|
|
|
|
if (i==0){ |
|
|
|
|
this.describes=formData.processUdgetPlanMaterialList[i].materialName |
|
|
|
|
}else { |
|
|
|
|
this.describes=this.describes+"---"+formData.processUdgetPlanMaterialList[i].materialName |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
formData.fileId = getStringArry(formData.fileId) |
|
|
|
|
formData.materialPrice=this.materialPrice; |
|
|
|
|
formData.materialAmount=this.materialAmount; |
|
|
|
|
formData.describes=this.describes; |
|
|
|
|
if (new Date(formData.createTime).getTime()/100>new Date(formData.needTime).getTime()/100){ |
|
|
|
|
this.$message.error("需求时间不能小于当前流程发起时间") |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
console.log(this.materialAmount,'采购总价') |
|
|
|
|
console.log(formData,'表单数据') |
|
|
|
|
console.log(this.opinion,'流程说明') |
|
|
|
|
this.form.validateFields((err, values) => { |
|
|
|
@ -1207,6 +1213,21 @@
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
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(","); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|