浏览代码

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

sunruiqi 2 年之前
父节点
当前提交
e8fa0a827b

+ 46 - 16
src/views/modules/sys/workContract/WorkContractForm.vue

@@ -31,7 +31,7 @@
               @cell-click="rowClick"
               :show-header="false"
             >
-              <vxe-column title="" field="entname" ></vxe-column>
+              <vxe-column title="" field="name" ></vxe-column>
             </vxe-table>
             <el-button type="info" slot="reference" @click="getPopTable" style="width: 100%" plain>查询</el-button>
           </el-popover>
@@ -284,7 +284,8 @@
           describes: '',
           contractSpecial: '',
           remarks: '',
-          clientName: ''
+          clientName: '',
+          status: ''
         },
         inputForm: {
           clientId: '',
@@ -304,7 +305,8 @@
           clientName: '',
           permissionFlag: '',
           showVi: true,
-          workAttachmentList: []
+          workAttachmentList: [],
+          status: ''
         },
         filesArra2: [],
         fileList: [],
@@ -320,6 +322,16 @@
         promi: null
       }
     },
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      }
+    },
     components: {
       ElImageViewer
     },
@@ -334,6 +346,22 @@
     mounted () {
       window.onPreview = this.onPreview
     },
+    watch: {
+      'businessId': {
+        handler (newVal) {
+          if (this.businessId) {
+            this.ossService = new OSSSerive()
+            this.init('edit', this.businessId)
+          } else {
+            this.$nextTick(() => {
+              this.$refs.inputForm.resetFields()
+            })
+          }
+        },
+        immediate: true,
+        deep: false
+      }
+    },
     methods: {
       uploadVideoProcess (event, file, fileList) {
         this.progressFlag = true // 显示进度条
@@ -390,9 +418,7 @@
           rowurl: '',
           src: '',
           showVi: true,
-          type: '',
-          permissionFlag: '',
-          workAttachmentList: []
+          status: ''
         }
         this.inputForm.id = id
         if (method === 'add') {
@@ -401,7 +427,7 @@
         } else if (method === 'edit') {
           this.title = '修改合同登记'
         } else if (method === 'view') {
-          this.showVi = false
+          this.inputForm.showVi = false
           this.title = '查看合同登记'
         }
         this.visible = true
@@ -414,13 +440,13 @@
             this.workContractService.findById(this.inputForm.id).then(({data}) => {
               this.inputForm = this.recover(this.inputForm, data)
               this.inputForm.contractFees = []
-              this.inputForm.permissionFlag = true
             })
           }
           this.loading = false
         })
       },
       // 表单提交
+      // 暂存
       async saveForm1 () {
         this.$refs['inputForm'].validate(async (valid) => {
           if (valid) {
@@ -435,6 +461,7 @@
               item.attachmentName = item.name
               this.inputForm.workAttachmentList.push(item)
             })
+            this.inputForm.status = '1'
             let _p = null
             await this.workContractService.save(this.inputForm).then(({data}) => {
               this.loading = false
@@ -454,6 +481,7 @@
           }
         })
       },
+      // 送审
       saveForm (callback) {
         this.$refs['inputForm'].validate(async (valid) => {
           if (valid) {
@@ -468,6 +496,7 @@
               item.attachmentName = item.name
               this.inputForm.workAttachmentList.push(item)
             })
+            this.inputForm.status = '2'
             await this.workContractService.save(this.inputForm).then(({data}) => {
               callback(data.businessTable, data.businessId, this.inputForm)
               this.$refs.inputForm.resetFields()
@@ -584,20 +613,21 @@
         return 'cursor:pointer;'
       },
       async rowClick (event) {
-        let id = this.gridData[event.rowIndex].companyid
+        let id = this.gridData[event.rowIndex].id
         this.inputForm.clientId = id
-        await this.workClientService.enterpriseTicketInfo(id).then((data) => {
-          this.inputForm.clientName = data.data.ENTNAME
+        console.log('id', id)
+        await this.workClientService.findById(id).then((data) => {
+          console.log('data', data)
+          this.inputForm.clientName = data.data.workClientInfo.name
         })
         this.visable = false
       },
       async getPopTable () {
         let name = this.inputForm.clientName
-        if (name !== null && name !== undefined && name !== '') {
-          await this.workClientService.enterpriseSearchByName(name).then(({data}) => {
-            this.gridData = data.data.items
-          })
-        }
+        await this.workClientService.list(name).then(({data}) => {
+          console.log('data', data)
+          this.gridData = data.records
+        })
         this.$refs.pops.updatePopper()
       },
       closePop () {

+ 36 - 12
src/views/modules/sys/workContract/WorkContractList.vue

@@ -20,8 +20,8 @@
           </el-date-picker>
         </el-form-item>
 
-        <el-form-item label="合同状态" prop="type">
-          <el-select v-model="searchForm.type" placeholder="请选择" style="width:100%;">
+        <el-form-item label="合同状态" prop="status">
+          <el-select v-model="searchForm.status" placeholder="请选择" style="width:100%;">
             <el-option
               v-for="item in $dictUtils.getDictList('approval_type')"
               :key="item.value"
@@ -120,9 +120,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="type" >
+                <vxe-column width="100px"  title="状态" field="status" >
                   <template slot-scope="scope">
-                    {{ $dictUtils.getDictLabel("approval_type", scope.row.type, '-') }}
+                    {{ $dictUtils.getDictLabel("approval_type", scope.row.status, '-') }}
                   </template>
                 </vxe-column>
 <!--                <vxe-column width="100px"  title="归档状态" field="filedType" >-->
@@ -139,8 +139,9 @@
                 <vxe-column title="操作" width="200px" fixed="right" align="center">
                     <template  slot-scope="scope">
                       <el-button v-if="hasPermission('sys:workContract:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row.id)">查看</el-button>
-                      <el-button v-if="hasPermission('sys:workContract:edit') " type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
-                      <el-button v-if="hasPermission('sys:workContract:del') " type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+                      <el-button v-if="hasPermission('sys:workContract:edit') && scope.row.status === '1'" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row)">修改</el-button>
+                      <el-button v-if="hasPermission('sys:workContract:del') && scope.row.status === '1'" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+                      <el-button v-if="hasPermission('sys:workContract:back') && scope.row.status === '2'" type="text"  icon="el-icon-back" size="small" @click="del(scope.row.id)">撤回</el-button>
                     </template>
                 </vxe-column>
             </vxe-table>
@@ -246,16 +247,15 @@
       },
       // 新增
       add () {
-        // this.$refs.workContractForm.init('add', '')
         this.start()
       },
       // 修改
-      edit (id) {
-        id = id || this.$refs.workContractTable.getCheckboxRecords().map(item => {
-          return item.id
-        })[0]
+      edit (row) {
+        // row.id || this.$refs.workContractTable.getCheckboxRecords().map(item => {
+        //   return item.id
+        // })[0]
         // this.$refs.workContractForm2.init('edit', id)
-        this.start(id)
+        this.start1(row)
       },
       // 查看
       view (id) {
@@ -306,6 +306,30 @@
               }
             })
           })
+      },
+      start1 (row) {
+        // 读取流程表单
+        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',
+          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',
+                status: 'startAndHold',
+                title: tabTitle,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle,
+                businessTable: 'work_contract_info',
+                businessId: row.id
+              }
+            })
+          })
       }
     }
   }