|
|
|
@ -54,9 +54,10 @@
|
|
|
|
|
<j-upload v-decorator="['fileId']" :trigger-change="true"></j-upload> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<!-- <a-col :span="8" > |
|
|
|
|
<a-form-item label="流程说明" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<!--<a-col :span="24" > |
|
|
|
|
<a-form-item label="流程说明" > |
|
|
|
|
<j-editor v-decorator="[ 'opinion', {} ]" triggerChange></j-editor> |
|
|
|
|
<!–<a-input type="textarea" v-decorator="[ 'opinion' ]" :rows="4" />–> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col>--> |
|
|
|
|
</a-row> |
|
|
|
@ -103,14 +104,23 @@
|
|
|
|
|
</a-tab-pane> |
|
|
|
|
|
|
|
|
|
</a-tabs> |
|
|
|
|
<div class="div_process"> |
|
|
|
|
<span>流程说明:</span> |
|
|
|
|
<j-editor v-decorator="[ 'opinion', {} ]" triggerChange></j-editor> |
|
|
|
|
</div> |
|
|
|
|
<j-form-container > |
|
|
|
|
<a-form :form="form"> |
|
|
|
|
<a-row> |
|
|
|
|
<a-col :span="24" > |
|
|
|
|
<a-form-item label="流程说明" > |
|
|
|
|
<j-editor v-decorator="[ 'opinion', {} ]" triggerChange></j-editor> |
|
|
|
|
<!--<a-input type="textarea" v-decorator="[ 'opinion' ]" :rows="4" />--> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
</a-row> |
|
|
|
|
</a-form> |
|
|
|
|
</j-form-container> |
|
|
|
|
|
|
|
|
|
<div class="div_process"> |
|
|
|
|
<a-form-item v-if="!disabled" :wrapperCol="{ span: 24 }" style="text-align: center"> |
|
|
|
|
<a-button type="primary" :disabled="disabled||btndisabled" @click="handleSubmit">保存</a-button> |
|
|
|
|
<!-- <a-button style="margin-left: 8px" type="primary" :disabled="disabled||btndisabled" @click="applySubmit">提交申请</a-button>--> |
|
|
|
|
<a-button style="margin-left: 8px" :disabled="disabled" @click="close">取消</a-button> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item v-if="task" :wrapperCol="{ span: 24 }" style="text-align: center"> |
|
|
|
@ -160,6 +170,8 @@
|
|
|
|
|
materialGroups:'', |
|
|
|
|
materialId :'', |
|
|
|
|
bigIdRakeList:[], |
|
|
|
|
materialPrice:0, |
|
|
|
|
materialAmount:0, |
|
|
|
|
hieg:true, |
|
|
|
|
historyBigId:[], |
|
|
|
|
isHistoryBigId:false, |
|
|
|
@ -386,6 +398,7 @@
|
|
|
|
|
url: { |
|
|
|
|
add: '/hy/processUdgetPlan/add', |
|
|
|
|
edit: '/hy/processUdgetPlan/edit', |
|
|
|
|
applyBusiness:'/actBusiness/apply', |
|
|
|
|
queryById: '/hy/processUdgetPlan/queryById', |
|
|
|
|
selectdeparment:'/sys/selectByUser', |
|
|
|
|
descriptionRakeUrl: "/description/processDescription/list", |
|
|
|
@ -461,7 +474,6 @@
|
|
|
|
|
created() { |
|
|
|
|
//如果是流程中表单,则需要加载流程表单data |
|
|
|
|
//this.showFlowData() |
|
|
|
|
console.log(this.isNew,'-------------') |
|
|
|
|
if (!this.isNew){ |
|
|
|
|
this.init(); |
|
|
|
|
} |
|
|
|
@ -646,6 +658,11 @@
|
|
|
|
|
if(record.row.materialQuantity !== '' && record.row.materialPrice !== '' && record.row.materialQuantity !== undefined && record.row.materialPrice !== undefined){ |
|
|
|
|
// record.row.materialAmount = record.row.materialQuantity * record.row.materialPrice; |
|
|
|
|
// console.log("3出发了",record.row); |
|
|
|
|
//如果单价大于5万 |
|
|
|
|
if(record.row.materialPrice>50000){ |
|
|
|
|
this.materialPrice=record.row.materialPrice |
|
|
|
|
} |
|
|
|
|
//回填数据 |
|
|
|
|
if(record.row.id !== undefined){ |
|
|
|
|
let values = [ |
|
|
|
|
{ |
|
|
|
@ -838,6 +855,34 @@
|
|
|
|
|
backTask() { |
|
|
|
|
this.$emit('backTask') |
|
|
|
|
}, |
|
|
|
|
/*提交申请*/ |
|
|
|
|
applySubmit(e) { |
|
|
|
|
this.handleSubmit (e) |
|
|
|
|
this.getAllTable().then(tables => { |
|
|
|
|
return validateFormAndTables(this.form, tables) |
|
|
|
|
}).then(allValues=> { |
|
|
|
|
if (typeof this.classifyIntoFormData !== 'function') { |
|
|
|
|
throw this.throwNotFunction('classifyIntoFormData') |
|
|
|
|
} |
|
|
|
|
let formData = this.classifyIntoFormData(allValues) |
|
|
|
|
if(!formData.processUdgetPlanMaterialList.length>0){ |
|
|
|
|
this.$message.error('填写数据不完整,禁止提交申请!') |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
var params = {} |
|
|
|
|
params.priority = 1; |
|
|
|
|
this.postFormAction(this.url.applyBusiness,params).then(res => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
|
this.loadData(); |
|
|
|
|
this.modalVisible = false; |
|
|
|
|
}else { |
|
|
|
|
this.$message.error(res.message) |
|
|
|
|
} |
|
|
|
|
}).finally(()=>this.submitLoading = false); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
addBefore() { |
|
|
|
|
this.form.resetFields() |
|
|
|
|
this.processUdgetPlanMaterialTable.dataSource = [] |
|
|
|
@ -856,7 +901,8 @@
|
|
|
|
|
this.data = getRecord(this.data) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
let fieldval = pick(this.data, 'id','company', 'createTime', 'sysOrgCode', 'createBy', 'materialType', 'processPlan', 'needTime', 'orderNumber', 'fileId') |
|
|
|
|
console.log(this.data,'数据回显') |
|
|
|
|
let fieldval = pick(this.data, 'id','company', 'createTime', 'sysOrgCode', 'createBy', 'materialType', 'processPlan', 'needTime', 'orderNumber', 'fileId','opinion') |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.form.setFieldsValue(fieldval) |
|
|
|
|
}) |
|
|
|
@ -917,40 +963,47 @@
|
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
formData.fileId = getStringArry(formData.fileId) |
|
|
|
|
formData.materialPrice=this.materialPrice; |
|
|
|
|
formData.materialAmount=this.materialAmount; |
|
|
|
|
|
|
|
|
|
if (new Date(formData.createTime).getTime()/100>new Date(formData.needTime).getTime()/100){ |
|
|
|
|
this.$message.error("需求时间不能小于当前流程发起时间") |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
console.log(formData,'提交数据') |
|
|
|
|
console.log(this.processData,'流程数据') |
|
|
|
|
this.$emit('afterSubmit',formData) |
|
|
|
|
// this.form.validateFields((err, values) => { |
|
|
|
|
// if (!err) { |
|
|
|
|
// formData.procDefId = this.processData.id; |
|
|
|
|
// formData.procDeTitle = this.processData.name; |
|
|
|
|
// formData.title=this.processData.description; |
|
|
|
|
// if (!formData.tableName)formData.tableName = this.processData.businessTable; |
|
|
|
|
// var url = this.url.add; |
|
|
|
|
// let method='post'; |
|
|
|
|
// if (!this.isNew){ |
|
|
|
|
// url = this.url.edit; |
|
|
|
|
// method='put'; |
|
|
|
|
// } |
|
|
|
|
// this.btndisabled = true; |
|
|
|
|
// httpAction(url,formData,method).then((res)=>{ |
|
|
|
|
// if (res.success){ |
|
|
|
|
// //this.$message.success("保存成功!") |
|
|
|
|
// //todo 将表单的数据传给父组件 |
|
|
|
|
// this.$emit('afterSubmit',formData) |
|
|
|
|
// }else { |
|
|
|
|
// this.$message.error(res.message) |
|
|
|
|
// } |
|
|
|
|
// }).finally(()=>{ |
|
|
|
|
// this.btndisabled = false; |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
console.log(this.materialAmount,'采购总价') |
|
|
|
|
console.log(formData,'表单数据') |
|
|
|
|
console.log(this.opinion,'流程说明') |
|
|
|
|
this.form.validateFields((err, values) => { |
|
|
|
|
if (!err) { |
|
|
|
|
formData.procDefId = this.processData.id; |
|
|
|
|
formData.procDeTitle = this.processData.name; |
|
|
|
|
formData.title=this.processData.description; |
|
|
|
|
if (!formData.tableName)formData.tableName = this.processData.businessTable; |
|
|
|
|
var url = this.url.add; |
|
|
|
|
let method='post'; |
|
|
|
|
if (!this.isNew){ |
|
|
|
|
url = this.url.edit; |
|
|
|
|
method='put'; |
|
|
|
|
} |
|
|
|
|
this.btndisabled = true; |
|
|
|
|
httpAction(url,formData,method).then((res)=>{ |
|
|
|
|
if (res.success){ |
|
|
|
|
//this.$message.success("保存成功!") |
|
|
|
|
//todo 将表单的数据传给父组件 |
|
|
|
|
this.$emit('afterSubmit',formData) |
|
|
|
|
}else { |
|
|
|
|
this.$message.error(res.message) |
|
|
|
|
} |
|
|
|
|
}).finally(()=>{ |
|
|
|
|
this.btndisabled = false; |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|