瀏覽代碼

代码提交:
0919合同管理-合同登记

sunruiqi 2 年之前
父節點
當前提交
9fd1edd137

+ 18 - 2
src/views/modules/sys/workContract/WorkContractForm.vue

@@ -124,7 +124,9 @@
         <el-col :span="24">
           <el-form-item label="收费标准" prop="contractFees">
             <el-checkbox-group v-model="inputForm.contractFees">
-              <el-checkbox @change="changeContractFee" v-for="item in $dictUtils.getDictList('contract_fee')" :label="item.label" >{{item.label}}</el-checkbox>
+              <el-checkbox @change="changeContractFee" v-for="item in $dictUtils.getDictList('contract_fee')" :label="item.value">
+                {{item.label}}
+              </el-checkbox>
             </el-checkbox-group>
           </el-form-item>
         </el-col>
@@ -216,6 +218,7 @@
           contractAmount: '',
           contractOpposite: '',
           contractFees: [],
+          fees: '',
           contractFee: '',
           describes: '',
           contractSpecial: '',
@@ -235,6 +238,7 @@
           contractAmount: '',
           contractOpposite: '',
           contractFees: [],
+          fees: '',
           contractFee: '',
           describes: '',
           contractSpecial: '',
@@ -339,6 +343,7 @@
           contractAmount: '',
           contractOpposite: '',
           contractFees: [],
+          fees: '',
           contractFee: '',
           describes: '',
           contractSpecial: '',
@@ -373,7 +378,16 @@
             this.loading = true
             this.workContractService.findById(this.inputForm.id).then(({data}) => {
               this.inputForm = this.recover(this.inputForm, data)
-              this.inputForm.contractFees = []
+              console.log('data', data)
+              const f = []
+              if (data.fees !== null && data.fees !== undefined && data.fees !== '') {
+                data.fees.split(',').forEach(item => {
+                  if (item !== null && item !== undefined && item !== '') {
+                    f.push(item)
+                  }
+                })
+              }
+              this.inputForm.contractFees = f
               this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentList, 'workContract')
               this.loading = false
             })
@@ -385,6 +399,7 @@
       async saveForm1 () {
         this.loading = true
         this.inputForm.workAttachmentList = this.$refs.uploadComponent.getDataList()
+        this.inputForm.fees = this.inputForm.contractFees.join(',')
         this.inputForm.status = '1'
         let _p = null
         await this.workContractService.save(this.inputForm).then(({data}) => {
@@ -410,6 +425,7 @@
             this.loading = true
             this.inputForm.workAttachmentList = this.$refs.uploadComponent.getDataList()
             this.inputForm.status = '2'
+            this.inputForm.contractFees = this.inputForm.contractFees.join(',')
             await this.workContractService.save(this.inputForm).then(({data}) => {
               callback(data.businessTable, data.businessId, this.inputForm)
               this.$refs.inputForm.resetFields()

+ 11 - 2
src/views/modules/sys/workContract/WorkContractForm2.vue

@@ -130,7 +130,7 @@
             <el-col :span="12">
               <el-form-item label="收费标准" prop="contractFees">
                 <el-checkbox-group v-model="inputForm.contractFees" @change="changeContractFee">
-                  <el-checkbox  v-for="item in $dictUtils.getDictList('contract_fee')" :label="item.label" >{{item.label}}</el-checkbox>
+                  <el-checkbox  v-for="item in $dictUtils.getDictList('contract_fee')" :label="item.value" >{{item.label}}</el-checkbox>
                 </el-checkbox-group>
               </el-form-item>
             </el-col>
@@ -348,7 +348,16 @@
             this.loading = true
             this.workContractService.findById(this.inputForm.id).then(({data}) => {
               this.inputForm = this.recover(this.inputForm, data)
-              this.inputForm.contractFees = []
+              console.log('data', data)
+              const f = []
+              if (data.fees !== null && data.fees !== undefined && data.fees !== '') {
+                data.fees.split(',').forEach(item => {
+                  if (item !== null && item !== undefined && item !== '') {
+                    f.push(item)
+                  }
+                })
+              }
+              this.inputForm.contractFees = f
               this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentList, 'workContract')
             })
           }

+ 75 - 22
src/views/modules/sys/workContract/WorkContractList.vue

@@ -185,7 +185,9 @@
           type: '',
           filedType: '',
           contractAmounts: [],
-          createBy: ''
+          createBy: '',
+          procInsId: '',
+          processDefinitionId: ''
         },
         dataList: [],
         tablePage: {
@@ -238,6 +240,7 @@
           this.loading = false
         })
         this.processService.getByName('合同登记新建').then(({data}) => {
+          console.log(data)
           if (!this.commonJS.isEmpty(data.id)) {
             this.processDefinitionId = data.id
             this.procDefKey = data.key
@@ -274,7 +277,12 @@
           }).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')}
+              query: {
+                readOnly: true,
+                title: row.name + '流程详情',
+                formTitle: row.name + '流程详情',
+                businessId: row.id,
+                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')}
             })
           })
         }
@@ -285,7 +293,11 @@
         //   return item.id
         // })[0]
         // this.$refs.workContractForm2.init('edit', id)
-        this.start1(row)
+        if (row.status === '3' || row.status === '4') {
+          this.start2(row)
+        } else {
+          this.start1(row)
+        }
       },
       // 查看
       view (id) {
@@ -333,7 +345,8 @@
                 formType: data.data.formType,
                 formUrl: data.data.formUrl,
                 formTitle: processTitle,
-                businessId: 'false'
+                businessId: 'false',
+                isShow: false
               }
             })
           })
@@ -357,36 +370,76 @@
                 formUrl: data.data.formUrl,
                 formTitle: processTitle,
                 businessTable: 'work_contract_info',
-                businessId: row.id
+                businessId: row.id,
+                isShow: false
               }
             })
           })
       },
-      reback (row) {
+      start2 (row) {
         // 读取流程表单
         let tabTitle = `发起流程【合同登记新建】`
         let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
         this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
           businessId: row.id,
           businessTable: 'work_contract_info',
+          status: 'startAndClose'
+        }).then((data) => {
+          this.$router.push({
+            path: '/flowable/task/TaskForm',
+            query: {
+              procDefId: this.processDefinitionId,
+              procDefKey: this.procDefKey,
+              status: 'startAndClose',
+              title: tabTitle,
+              formType: data.data.formType,
+              formUrl: data.data.formUrl,
+              formTitle: processTitle,
+              businessTable: 'work_contract_info',
+              businessId: row.id,
+              isShow: false
+            }
+          })
+        })
+      },
+      reback (row) {
+        this.$confirm(`确定撤回流程吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
           taskId: row.procInsId,
-          status: 'startAndHold'}).then((data) => {
-            this.$router.push({
-              path: '/flowable/task/TaskForm',
-              query: {
-                procDefId: this.processDefinitionId,
-                procDefKey: this.procDefKey,
-                status: 'reback',
-                title: tabTitle,
-                formType: data.data.formType,
-                formUrl: data.data.formUrl,
-                formTitle: processTitle,
-                businessTable: 'work_contract_info',
-                businessId: row.id,
-                taskId: row.procInsId
-              }
-            })
+          type: 'warning'
+        }).then(() => {
+          console.log(row)
+          this.taskService.backNodes(row.procInsId).then(({data}) => {
+            let backNodes = data
+            if (backNodes.length > 0) {
+              let backTaskDefKey = backNodes[0].taskDefKey
+              this.taskService.back({
+                taskId: row.procInsId,
+                backTaskDefKey: backTaskDefKey,
+                isShow: false,
+                ...this.auditForm
+              }).then(({data}) => {
+                this.updateStatusById(row, 'reback')
+                this.$message.success('回退成功')
+              })
+            }
           })
+        })
+      },
+      updateStatusById (row, type) {
+        if (type === 'agree') {
+          row.status = '5'
+          this.workContractService.updateStatusById(row)
+        }
+        if (type === 'reject') {
+          row.status = '4'
+          this.workContractService.updateStatusById(row)
+        }
+        if (type === 'reback') {
+          row.status = '3'
+          this.workContractService.updateStatusById(row)
+        }
       }
     }
   }