فهرست منبع

Merge remote-tracking branch 'origin/master'

lizhenhao 2 سال پیش
والد
کامیت
bc85e6b344
2فایلهای تغییر یافته به همراه57 افزوده شده و 15 حذف شده
  1. 17 4
      src/views/modules/flowable/task/TaskForm.vue
  2. 40 11
      src/views/modules/sys/workContract/WorkContractList.vue

+ 17 - 4
src/views/modules/flowable/task/TaskForm.vue

@@ -58,7 +58,7 @@
       </el-form-item>
     </el-col>
     <el-col :span="16">
-      <el-form-item>
+      <el-form-item v-if="isShow === 'true'">
         <el-checkbox v-model="isAssign">指定下一步处理者(不设置就使用默认处理人)</el-checkbox>
       </el-form-item>
     </el-col>
@@ -218,6 +218,11 @@
         this.auditForm.assignee = null
         this.auditForm.userIds = null
         this.auditForm.message = ''
+        if (this.$route.query.isShow === undefined || this.$route.query.isShow === '') {
+          this.isShow = 'true'
+        } else {
+          this.isShow = this.$route.query.isShow
+        }
       },
       cc (procInsId) {
         if (this.isCC && this.auditForm.userIds) {
@@ -250,10 +255,11 @@
       // 启动流程
       start (vars) {
         if (this.formType === '2') { // 外置表单
-          if (this.status === 'startAndHold') {
+          if (this.status === 'startAndHold' || this.status === 'startAndClose') {
             this.$refs.form.saveForm((businessTable, businessId, inputForm) => {
               vars = {...vars, ...inputForm}
               this.taskService.start({
+                procDefId: this.procDefId,
                 procDefKey: this.procDefKey,
                 businessTable: businessTable,
                 businessId: businessId,
@@ -359,7 +365,14 @@
         }).then(({data}) => {
           this.$message.success('回退成功')
           this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
-          this.$router.push('/flowable/task/TodoList')
+          var num = this.$route.query.num
+          if (num === '2') {
+            this.$router.push('/sys/dashboard/workBench/Pending')
+          } else if (num === '3') {
+            this.$router.push('/sys/dashboard/workBench/PendingList')
+          } else {
+            this.$router.push('/flowable/task/TodoList')
+          }
           this.cc(data)
         })
       },
@@ -418,7 +431,7 @@
       },
       // 关闭
       close () {
-        if (this.status === 'startAndHold') {
+        if (this.status === 'startAndHold' || this.status === 'startAndClose') {
           this.businessId = 'false'
           this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
           this.$router.push('../../../sys/workContract/WorkContractList')

+ 40 - 11
src/views/modules/sys/workContract/WorkContractList.vue

@@ -121,9 +121,9 @@
                 <vxe-column width="100px" title="合同金额(元)" field="contractAmount"></vxe-column>
                 <vxe-column width="100px" title="创建人" field="createBy"></vxe-column>
                 <vxe-column width="150px" title="签订日期" field="contractDate"></vxe-column>
-                <vxe-column width="100px"  title="状态" field="status" >
+                <vxe-column  width="120px" title="流程状态" field="status" >
                   <template slot-scope="scope">
-                    {{ $dictUtils.getDictLabel("approval_type", scope.row.status, '-') }}
+                    <el-button  type="text" @click="detail(scope.row)" :type="$dictUtils.getDictLabel('approval_type_status', scope.row.status, '-')"   effect="dark" size="mini">{{$dictUtils.getDictLabel("approval_type", scope.row.status, '-')}} </el-button>
                   </template>
                 </vxe-column>
 <!--                <vxe-column width="100px"  title="归档状态" field="filedType" >-->
@@ -171,6 +171,8 @@
   import WorkContractService from '@/api/sys/WorkContractService'
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
   import TaskService from '@/api/flowable/TaskService'
+  import ProcessService from '@/api/flowable/ProcessService'
+  import pick from 'lodash.pick'
   export default {
     data () {
       return {
@@ -192,14 +194,18 @@
           pageSize: 10,
           orders: []
         },
+        processDefinitionId: '',
+        procDefKey: '',
         loading: false
       }
     },
     workContractService: null,
     taskService: null,
+    processService: null,
     created () {
       this.workContractService = new WorkContractService()
       this.taskService = new TaskService()
+      this.processService = new ProcessService()
     },
     components: {
       InputNumber,
@@ -231,6 +237,12 @@
           this.tablePage.total = data.total
           this.loading = false
         })
+        this.processService.getByName('合同登记新建').then(({data}) => {
+          if (!this.commonJS.isEmpty(data.id)) {
+            this.processDefinitionId = data.id
+            this.procDefKey = data.key
+          }
+        })
       },
       // 当前页
       currentChangeHandle ({currentPage, pageSize}) {
@@ -250,6 +262,23 @@
       add () {
         this.start()
       },
+      // 新增
+      detail (row) {
+        // eslint-disable-next-line eqeqeq
+        if (!this.commonJS.isEmpty(row.status) && row.status != '1') {
+          console.log(row.procInsId)
+          console.log(row.processDefinitionId)
+          this.taskService.getTaskDef({
+            procInsId: row.procInsId,
+            procDefId: row.processDefinitionId
+          }).then(({data}) => {
+            this.$router.push({
+              path: '/flowable/task/TaskFormDetail',
+              query: {readOnly: true, title: row.name + '流程详情', formTitle: row.name + '流程详情', ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')}
+            })
+          })
+        }
+      },
       // 修改
       edit (row) {
         // row.id || this.$refs.workContractTable.getCheckboxRecords().map(item => {
@@ -292,13 +321,13 @@
         // 读取流程表单
         let tabTitle = `发起流程【合同登记新建】`
         let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
-        this.taskService.getTaskDef({ procDefId: 'Process_1662628133027:6:582ad0be-3329-11ed-bee1-b40ede887c28',
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
           status: 'startAndHold'}).then((data) => {
             this.$router.push({
               path: '/flowable/task/TaskForm',
               query: {
-                procDefId: 'Process_1662628133027:6:582ad0be-3329-11ed-bee1-b40ede887c28',
-                procDefKey: 'Process_1662628133027',
+                procDefId: this.processDefinitionId,
+                procDefKey: this.procDefKey,
                 status: 'startAndHold',
                 title: tabTitle,
                 formType: data.data.formType,
@@ -313,15 +342,15 @@
         // 读取流程表单
         let tabTitle = `发起流程【合同登记新建】`
         let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
-        this.taskService.getTaskDef({ procDefId: 'Process_1662628133027:6:582ad0be-3329-11ed-bee1-b40ede887c28',
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
           businessId: row.id,
           businessTable: 'work_contract_info',
           status: 'startAndHold'}).then((data) => {
             this.$router.push({
               path: '/flowable/task/TaskForm',
               query: {
-                procDefId: 'Process_1662628133027:6:582ad0be-3329-11ed-bee1-b40ede887c28',
-                procDefKey: 'Process_1662628133027',
+                procDefId: this.processDefinitionId,
+                procDefKey: this.procDefKey,
                 status: 'startAndHold',
                 title: tabTitle,
                 formType: data.data.formType,
@@ -337,7 +366,7 @@
         // 读取流程表单
         let tabTitle = `发起流程【合同登记新建】`
         let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
-        this.taskService.getTaskDef({ procDefId: 'Process_1662628133027:6:582ad0be-3329-11ed-bee1-b40ede887c28',
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
           businessId: row.id,
           businessTable: 'work_contract_info',
           taskId: row.procInsId,
@@ -345,8 +374,8 @@
             this.$router.push({
               path: '/flowable/task/TaskForm',
               query: {
-                procDefId: 'Process_1662628133027:6:582ad0be-3329-11ed-bee1-b40ede887c28',
-                procDefKey: 'Process_1662628133027',
+                procDefId: this.processDefinitionId,
+                procDefKey: this.procDefKey,
                 status: 'reback',
                 title: tabTitle,
                 formType: data.data.formType,