<p>&quot;<template>\n  &lt;div style=&quot;&quot; class=&quot;formBox&quot;&gt;\n    &lt;rx-error  :message=&quot;errorMessage&quot; v-if=&quot;!taskStatus&quot;&gt;\n    </rx-error>\n    &lt;rx-fit v-if=&quot;taskStatus&quot; style=&quot;padding: 0px;&quot;&gt;\n      <!--任务工具栏-->\n      &lt;div slot=&quot;toolheader&quot; border=&quot;true&quot; foldheader=&quot;true&quot; foldbtn=&quot;false&quot; align=&quot;right&quot;&gt;\n        &lt;div style=&quot;padding: 10px &quot;&gt;\n          &lt;task-tool-bar :bpmTaskDetail=&quot;bpmTaskDetail&quot; :taskConfig=&quot;taskConfig&quot; /&gt;\n        </div>\n      </div>\n      &lt;div class=&quot;fitContainer&quot;&gt;\n        &lt;div class=&quot;contents&quot; style=&quot;text-align: left;&quot;&gt;\n\n          <!--单据实例信息-->\n\n          &lt;bpm-inst-info :bpmInst=&quot;bpmInst&quot; /&gt;\n            <!--   流程状态图   -->\n            &lt;bpm-status class=&quot;contentsStatus&quot; :status=&quot;status&quot;&gt;\n          </bpm-status>\n          <!--显示提交的沟通-->\n          &lt;task-commu :task-linkup-param.sync=&quot;taskLinkupParam&quot;\n                      @commuTaskRevoked=&quot;reloadTaskInfo()&quot; /&gt;\n          <!--表单-->\n\n          <!--<rx-forms ref=\"rxForms\"  />-->\n          &lt;rx-forms ref=&quot;rxForms&quot; v-if=&quot;processConfig.formType=='online'&quot;&gt; </rx-forms>\n          &lt;component ref=&quot;customForm&quot; :is=&quot;formComponent&quot; :pk=&quot;pk&quot; v-else&gt;\n          </component>\n          <!--审批历史-->\n          &lt;bpm-check-history\n            :inst-id=&quot;instId&quot;\n            :bpm-task=&quot;bpmTask&quot;\n            :historyShow.sync=&quot;historyShow&quot; /&gt;\n          <!--留言-->\n          &lt;bpm-inst-msgs :instId=&quot;instId&quot; :msg-show.sync=&quot;msgShow&quot; /&gt;\n          &lt;bpm-inst-logs :instId=&quot;instId&quot; :log-show=&quot;logShow&quot; /&gt;\n        </div>\n      </div>\n    </rx-fit>\n  </div>\n\n</template>\n<script>\n  import {RxDialog, Util,   RxFit,RxTextBoxList,RxUserInfo} from 'jpaas-common-lib';\n  import BpmtaskApi from &quot;@/api/bpm/core/bpmTask&quot; ;\n  import BpmInstMsgs from &quot;./BpmInstMsgs&quot; ;\n  import BpmInstLogs from &quot;./BpmInstLogs&quot; ;\n  import TaskToolBar from &quot;./TaskToolBar&quot; ;\n\n  import RxForms from &quot;./RxForms&quot; ;\n  import BpmInstInfo from &quot;./BpmInstInfo&quot; ;\n  import BpmCheckHistory from &quot;./BpmCheckHistory&quot; ;\n  import TaskCommu from &quot;./TaskCommu&quot; ;\n  import TaskCommuReply from &quot;./TaskCommuReply&quot; ;\n  import FormPcApi from &quot;@/api/form/core/formPc.js&quot; ;\n  import userState from &quot;@/assets/js/userState&quot; ;\n  import RxError from &quot;../../share/rx-error&quot; ;\n  import BpmStatus from &quot;@/views/modules/bpm/core/component/BpmStatus&quot; ;\n\n  export default {\n    name: &quot;BpmTaskStart&quot;,\n    mixins:[userState],\n    components:{\n        RxError,\n      TaskCommuReply,\n      TaskCommu,\n      BpmCheckHistory,\n      BpmInstInfo,\n      RxDialog,\n      TaskToolBar,\n      BpmInstMsgs,\n      BpmInstLogs,\n      RxFit,\n      RxTextBoxList,\n      RxForms,\n      RxUserInfo,\n        BpmStatus\n    },\n    props:{\n      taskId:{\n        type:String,\n        required:true\n      },\n      instId:{\n        type:String,\n        required:true\n      },\n      layerid: String,\n      lydata: Object,\n      destroy:Function\n    },\n    data() {\n      return {\n        title:'任务详情',\n        msgTypes: '',\n        opinion: '',\n        checkType: 'AGREE',\n        historyShow: false,\n        msgShow: false,\n        bpmInst: {instId: ''},\n        bpmTask: {taskId: this.taskId},\n        isCanBack: false,\n        canCheck: true,\n        canRecorveLinkup: false,\n        bpmCmTaskInfos: [],\n        isAllowLinkup: true,\n        backPathResult: {},\n        nodeExecutors: [],\n        processConfig: {\n          formType:&quot;online&quot;\n        },\n        taskConfig: {},\n        bpmTaskDetail:{},\n        msgSubmitting: false,\n        logShow: false,\n        //任务沟通参数\n        taskLinkupParam: {\n          canStartLinkup: false,\n          canRevokeLinkup: false,\n          canReplyLinkup: false,\n          bpmCmTaskInfos: []\n        },\n        //回复沟通任务\n        taskLinkupReply: {\n          msgTypes: '',\n          opinion: '',\n          lpReplyVisible: false,\n        },\n        formComponent:&quot;&quot;,\n        pk:&quot;&quot;,\n        taskStatus:true,\n        errorMessage:&quot;&quot;,\n        //根实例\n        rootVm:true,\n        status:''\n      }\n    },\n\n    created() {\n      this.loadTaskInfo();\n    },\n    methods:{\n      //刷新任务\n      async loadTaskInfo(){\n        let self=this;\n        if(!this.taskId){\n          this.taskId=this.$route.params.taskId;\n        }\n        if(!this.instId){\n          this.instId=this.$route.params.instId;\n        }\n        let res =await BpmtaskApi.getAllDetail(this.taskId);\n        if(!res.success){\n          this.taskStatus=false;\n          this.errorMessage=res.message;\n          return;\n        }\n          this.status = res.data.bpmInst.status;\n        this.bpmTaskDetail=res.data;\n\n        if(res.data.bpmTask==null){\n          if(self.destroy){\n            this.$notification.open({\n              message: '操作提示',\n              description:\n                '当前任务已经完成或删除,请刷新数据界面再操作!',\n              icon: &lt;a-icon type=&quot;smile&quot; style=&quot;color: #108ee9&quot; /&gt;,\n          });\n            Util.closeWindow(self,&quot;ok&quot;,{});\n            return;\n          }else {\n            alert(&quot;当前任务已经完成或删除,请刷新数据界面再操作!&quot;);\n            window.close();\n          }\n        }\n        var result = this.bpmTaskDetail.allowApprove;\n        if(!result.success){\n          this.$notification.open({\n            message: '操作提示',\n            description:\n            result.message,\n            icon: &lt;a-icon type=&quot;smile&quot; style=&quot;color: #108ee9&quot; /&gt;\n        });\n        }\n        Object.assign(self,res.data);\n        var curUser=this.user;\n\n        var contextData={\n          type:&quot;usetask&quot;,\n          curUserId:curUser.userId,\n          curUserName:curUser.fullName,\n          account:curUser.account,\n          deptId:curUser.deptId,\n          nodeId:self.bpmTask.key,\n          nodeName:self.bpmTask.name,\n          instId:self.instId,\n          defId:self.bpmInst.defId,\n          instNo:self.bpmInst.billNo,\n          taskId:self.taskId,\n          tenantId: curUser.tenantId,\n          tenantLabel:curUser.tenantLabel,\n          opinionHistorys:res.data.bpmCheckHistories\n        };\n        self.handFormConfig(res.data.processConfig,res.data.taskConfig,res.data.bpmInst);\n        if(this.processConfig.formType=='online') {\n          self.$refs.rxForms.setData(res.data.formData.data, false, contextData);\n        }\n      },\n      loadView(view)  { // 路由懒加载\n        return () =&gt; import(<code>@/views/${view}</code>);\n      },\n      //处理表单配置。\n      handFormConfig(conf,taskConfig,bpmInst){\n          debugger\n        var config=Util.deepClone(this.processConfig);\n        this.processConfig=Object.assign(config,conf);\n        if(!this.processConfig.formType){\n            var form= taskConfig.form;\n            console.log(form)\n            this.processConfig.formType=&quot;online&quot;\n          this.formComponent=this.loadView(form.component);\n        }\n        //startForm\n        if( taskConfig.form.formpc &amp;&amp; taskConfig.form.formpc.length&gt;0){\n          var form= taskConfig.form.formpc[0];\n          if(form &amp;&amp; form.type==&quot;custom&quot;){\n            this.pk=bpmInst.busKey;\n            this.processConfig.formType=&quot;custom&quot;;\n            this.formComponent=this.loadView(form.component) ;\n            return;\n          }\n        }\n        //获取全局。\n        if( conf.globalForm.formpc &amp;&amp; conf.globalForm.formpc.length&gt;0){\n          var form= conf.globalForm.formpc[0];\n          if(form &amp;&amp; form.type==&quot;custom&quot;){\n            this.pk=bpmInst.busKey;\n            this.processConfig.formType=&quot;custom&quot;;\n            this.formComponent=this.loadView(form.component);\n            return;\n          }\n        }\n      },\n    }\n  }\n</script>\n<style scoped>\n  .formBox{\n    width: 100%;\n    height: 100%;\n    box-sizing: border-box;\n  }\n  .formBox &gt;&gt;&gt; .divdefault{\n    overflow: hidden;\n  }\n  .fitContainer{\n    background: #fff;\n    padding: 10px;\n    padding-right: 0;\n    box-sizing: border-box;\n    height: 100%;\n    width: 100%;\n    overflow: auto;\n  }\n  .contents{\n    background: #fff;\n    min-height: 100%;\n      padding: 0px 10px;\n    box-sizing: border-box;\n      width: 1301px;\n      margin: 0 auto;\n      border: solid 1px #dadde0;\n      position: relative;\n  }\n  .formBox &gt;&gt;&gt; .fit-header{\n    box-shadow: 0px 1px 4px #dddddd;\n  }\n  .contents &gt;&gt;&gt; .table-form&gt;tbody&gt;tr&gt;td{\n    border:1px solid #dadde0!important;\n  }\n  .contents &gt;&gt;&gt; .previewBox{\n    padding: 10px 0 0 0 ;\n  }\n  .contents &gt;&gt;&gt; .table-form&gt;tbody&gt;tr&gt;td:nth-child(odd){\n    color: #8a9199;\n  }\n  .contents &gt;&gt;&gt; .table-form&gt;tbody&gt;tr&gt;td:nth-child(even){\n    color: #46494d;\n  }\n  .contentsStatus{\n      position: absolute;\n      z-index: 2;\n      top: 0px;\n      right: 10px;\n  }\n</style>\n内容:这是一个任务详情页面,展示某个任务的详细信息,包括表单、审批历史、沟通记录等,并提供审批、填写表单、查看历史记录等操作。\n\n根据任务配置信息和流程配置信息,页面会动态展示不同的表单类型:\n\n- <strong>在线表单:</strong> 使用<code>rx-forms</code>组件,根据表单数据动态填充表单内容。\n- <strong>自定义表单:</strong> 动态加载自定义表单组件,并传入相关参数。\n\n页面还包括任务工具栏、流程状态图、提交的沟通、审批历史、留言等功能模块。\n</p>
任务详情页 - 查看、编辑和审批任务

原文地址: https://www.cveoy.top/t/topic/qEB1 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录