[update] 调年度制修订计划两个流程
This commit is contained in:
+99
-31
@@ -24,7 +24,7 @@
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('processName')">
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:disabled="disabled"
|
||||
:disabled="disabled || processInfoDisabled"
|
||||
:maxLength="50"
|
||||
v-decorator="['processName', validatorRules.processName]" />
|
||||
</a-form-item>
|
||||
@@ -34,7 +34,7 @@
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')">
|
||||
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
|
||||
style="width: 100%"
|
||||
:disabled="disabled"
|
||||
:disabled="disabled || processInfoDisabled"
|
||||
value-format="YYYY-MM-DD"
|
||||
v-decorator="['expirationDate']" />
|
||||
</a-form-item>
|
||||
@@ -45,7 +45,7 @@
|
||||
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
|
||||
:maxLength="500"
|
||||
:rows="4"
|
||||
:disabled="disabled"
|
||||
:disabled="disabled || processInfoDisabled"
|
||||
v-decorator="['processExplain']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -138,6 +138,13 @@ import EngineerInitBaseInfo from './modules/EngineerInitBaseInfo'
|
||||
import ContactSelectApproverBaseInfo from './modules/ContactSelectApproverBaseInfo'
|
||||
import LeaderApproveSentBaseInfo from './modules/LeaderApproveSentBaseInfo'
|
||||
import TableBaseInfo from './modules/TableBaseInfo'
|
||||
import {
|
||||
standardizationInitApproval,
|
||||
standardizationInitSave,
|
||||
standardizationInitTurnTo,
|
||||
standardizationInitAgree,
|
||||
standardizationInitReject
|
||||
} from '@/api/workCenter'
|
||||
|
||||
const personData = [
|
||||
{
|
||||
@@ -199,6 +206,10 @@ export default {
|
||||
computed: {
|
||||
pageTitle () {
|
||||
return this.$t('flowCenter') + this.$route.meta.title
|
||||
},
|
||||
// 流程信息不能编辑
|
||||
processInfoDisabled () {
|
||||
return this.currentNode !== 1
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
@@ -277,9 +288,6 @@ export default {
|
||||
// 有任意一项填了即可
|
||||
// 流程信息表单
|
||||
const processInfoForm = this.processInfoForm.getFieldsValue()
|
||||
// 业务基本信息
|
||||
let ruleForm = {}
|
||||
|
||||
// 流程审批信息
|
||||
const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
|
||||
// 人员信息的数据, 处理成对象
|
||||
@@ -291,12 +299,15 @@ export default {
|
||||
}
|
||||
}
|
||||
// 需要传给后端的
|
||||
let param = {}
|
||||
// 业务基本信息
|
||||
if (this.$refs.basicInfoFormRef) {
|
||||
|
||||
let ruleForm = this.$refs.baseInfoRef.getData()
|
||||
// 该流程中业务基本信息只有表格
|
||||
// ruleForm.dataSource
|
||||
} else {
|
||||
// 需要外层信息至少填了一项
|
||||
const param = { ...processInfoForm, ...ruleForm, ...approvalInfoForm, ...personnelObj }
|
||||
param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj }
|
||||
const flag = Object.values(param).some(v => !!v || v === 0)
|
||||
if (!flag) {
|
||||
// 提示至少填写一项
|
||||
@@ -304,14 +315,17 @@ export default {
|
||||
return
|
||||
}
|
||||
}
|
||||
this.loading = true
|
||||
// 保存到草稿
|
||||
// enterprisePlanApprovalSave(arr).then(res => {
|
||||
// if (res.success) {
|
||||
// this.$message.success(res.message)
|
||||
// } else {
|
||||
// this.$message.warning(res.message)
|
||||
// }
|
||||
// })
|
||||
standardizationInitSave(param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 节点一时候的提交,发起变更
|
||||
handleStart () {
|
||||
@@ -331,7 +345,20 @@ export default {
|
||||
}
|
||||
this.processInfoForm.validateFields((err, values) => {
|
||||
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
|
||||
|
||||
this.$refs.baseInfoRef.getDataValidate((data) => {
|
||||
if (!err && !approvalErr && data) {
|
||||
const param = {} // 传给后端的数据
|
||||
standardizationInitApproval(param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
@@ -349,29 +376,70 @@ export default {
|
||||
const param = Object.assign({}, values)
|
||||
param.userId = userIds
|
||||
param.taskId = this.$route.query.taskId
|
||||
// enterprisePlanApprovalTurnTo(param).then(res => {
|
||||
// if (res.success) {
|
||||
// this.$message.success(res.message)
|
||||
// } else {
|
||||
// this.$message.warning(res.message)
|
||||
// }
|
||||
// }).finally(() => {
|
||||
// this.loading = false
|
||||
// })
|
||||
standardizationInitTurnTo(param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交
|
||||
// 提交(节点4,5,7有提交)
|
||||
handleSubmit () {
|
||||
|
||||
if (this.loading) return
|
||||
// 流程审批信息校验
|
||||
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
|
||||
this.$refs.baseInfoFormRef.getDataValidate(data => {
|
||||
if (approvalErr && data) {
|
||||
// 只有表格
|
||||
// param =
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 同意
|
||||
// 同意(节点2,3,6有同意)
|
||||
handleAgree () {
|
||||
|
||||
if (this.loading) return
|
||||
this.approvalInfoForm.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
this.loading = true
|
||||
const param = Object.assign({}, values)
|
||||
param.taskId = this.$route.query.taskId
|
||||
standardizationInitAgree(param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 驳回
|
||||
// 驳回(节点2,3,6有驳回)
|
||||
handleReject () {
|
||||
|
||||
if (this.loading) return
|
||||
this.approvalInfoForm.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
this.loading = true
|
||||
const param = Object.assign({}, values)
|
||||
param.taskId = this.$route.query.taskId
|
||||
standardizationInitReject(param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user