| | |
| | | <!--表单信息--> |
| | | <el-tab-pane label="表单信息" name="1"> |
| | | <!--初始化流程加载表单信息--> |
| | | <el-col :span="16" :offset="4"> |
| | | <v-form-render :form-data="formRenderData" ref="vFormRef"/> |
| | | <div style="margin-left:15%;margin-bottom: 20px;font-size: 14px;"> |
| | | <el-button type="primary" @click="submitForm">提 交</el-button> |
| | | <el-button type="primary" @click="resetForm">重 置</el-button> |
| | | <el-col :span="16" :offset="4" v-if="formDataList && formDataList.length > 0"> |
| | | <div v-for="(formDataObj, index) in formDataList" :key="index" class="form-warp"> |
| | | <div v-if="formDataObj.current" style="margin-bottom: 15px;color: #409eff">当前阶段:<span style="color: red">{{formDataObj.beforeNodeName}}</span></div> |
| | | <div v-else style="margin-bottom: 15px;color: #409eff">前置阶段:<span style="color: #d5904b">{{formDataObj.beforeNodeName}}</span></div> |
| | | <v-form-render :form-data="formDataObj.formJson" :ref="'form' + index"/> |
| | | </div> |
| | | |
| | | <!-- <v-form-render :form-data="formRenderData" ref="vFormRef"/>--> |
| | | <div style="display: flex;justify-content: center; align-items: center; margin: 20px 0"> |
| | | <el-button type="primary" @click="submitForm">确认并提交</el-button> |
| | | <el-button type="primary" @click="submitForm">协同办理</el-button> |
| | | <el-button type="primary" @click="submitForm">转交他人办理</el-button> |
| | | <!-- <el-button type="primary" @click="resetForm">重 置</el-button>--> |
| | | </div> |
| | | </el-col> |
| | | </el-tab-pane> |
| | |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | formDataList: [], |
| | | taskId: '', |
| | | processName: '', |
| | | // 模型xml数据 |
| | |
| | | deployId: "", // 流程定义编号 |
| | | procDefId: "", // 流程实例编号 |
| | | formRenderData: {}, |
| | | formRenderDataList: [], |
| | | variables: [], // 流程变量数据 |
| | | taskTitle: null, |
| | | taskOpen: false, |
| | |
| | | formJson: {} // 表单json |
| | | }; |
| | | }, |
| | | created() { |
| | | mounted() { |
| | | this.processName = this.$route.query && this.$route.query.processName; |
| | | this.deployId = this.$route.query && this.$route.query.deployId; |
| | | this.taskId = this.$route.query && this.$route.query.taskId; |
| | |
| | | getFlowFormData(taskId) { |
| | | const params = {taskId: taskId} |
| | | flowTaskForm(params).then(res => { |
| | | if (res.data.formJson) { |
| | | // 回显表单 |
| | | this.$refs.vFormRef.setFormJson(res.data.formJson); |
| | | this.formJson = res.data.formJson; |
| | | this.formDataList = res.data |
| | | // this.formRenderDataList = res.data.map(item => item.formJson) |
| | | // console.log("表单数据列表", this.formRenderDataList) |
| | | if (this.formDataList && this.formDataList.length > 0) { |
| | | this.$nextTick(() => { |
| | | // 加载表单填写的数据 |
| | | this.$refs.vFormRef.setFormData(res.data); |
| | | // this.$nextTick(() => { |
| | | // // 表单禁用 |
| | | // this.$refs.vFormRef.disableForm(); |
| | | // }) |
| | | this.formDataList.forEach((formDataObj, index) => { |
| | | console.log("表单数据列表", formDataObj.formJson) |
| | | let that = this |
| | | console.log(eval("that.$refs.form" +index)[0]) |
| | | eval("that.$refs.form" +index)[0].setFormJson(formDataObj.formJsonObj.formJson); |
| | | |
| | | eval("that.$refs.form" +index)[0].setFormData(formDataObj.formJsonObj); |
| | | }) |
| | | } else { |
| | | this.$nextTick(() => { |
| | | // 回显数据 |
| | | this.$refs.vFormRef.setFormJson(res.data); |
| | | this.formJson = res.data; |
| | | this.formJson = this.formDataList[0].formJsonObj.formJson |
| | | }) |
| | | |
| | | } |
| | | // if (res.data.formJson) { |
| | | // // 回显表单 |
| | | // this.$refs.vFormRef.setFormJson(res.data.formJson); |
| | | // this.formJson = res.data.formJson; |
| | | // this.$nextTick(() => { |
| | | // // 加载表单填写的数据 |
| | | // this.$refs.vFormRef.setFormData(res.data); |
| | | // // this.$nextTick(() => { |
| | | // // // 表单禁用 |
| | | // // this.$refs.vFormRef.disableForm(); |
| | | // // }) |
| | | // }) |
| | | // } else { |
| | | // this.$nextTick(() => { |
| | | // // 回显数据 |
| | | // this.$refs.vFormRef.setFormJson(res.data); |
| | | // this.formJson = res.data; |
| | | // }) |
| | | // } |
| | | }).catch(res => { |
| | | console.log("报错了:", res) |
| | | this.goBack(); |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | /** 申请流程表单数据提交 */ |
| | | submitForm() { |
| | | this.$refs.vFormRef.getFormData().then(formData => { |
| | | let that = this |
| | | eval("that.$refs.form" +0)[0].getFormData().then(formData => { |
| | | // 根据当前任务或者流程设计配置的下一步节点 todo 暂时未涉及到考虑网关、表达式和多节点情况 |
| | | getNextFlowNodeByStart({deploymentId: this.deployId, variables: formData}).then(res => { |
| | | const data = res.data; |
| | |
| | | .my-label { |
| | | background: #E1F3D8; |
| | | } |
| | | |
| | | .form-warp { |
| | | padding: 20px; |
| | | margin-bottom: 20px; |
| | | box-shadow: |
| | | inset 0 -3em 3em rgba(0, 0, 0, 0.1), |
| | | 0 0 0 2px rgb(239, 239, 239), |
| | | 0.3em 0.3em 1em rgba(0, 0, 0, 0.3); |
| | | } |
| | | </style> |