瀏覽代碼

财务-合同归档

wangqiang 2 年之前
父節點
當前提交
6ed5c57701

+ 15 - 1
src/api/cw/workContract/ContractFileService.js

@@ -10,9 +10,23 @@ export default class ContractFileService {
   }
   updateStatusById (param) {
     return request({
-      url: '/workContract/workContractFile/updateStatusById',
+      url: '/contract/contractFile/updateStatusById',
       method: 'post',
       data: param
     })
   }
+  findById (id) {
+    return request({
+      url: '/contract/contractFile/findById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  findByContractInfoId (id) {
+    return request({
+      url: '/contract/contractFile/findByContractInfoId',
+      method: 'get',
+      params: {id: id}
+    })
+  }
 }

+ 7 - 0
src/api/cw/workContract/ContractInfoService.js

@@ -29,6 +29,13 @@ export default class ContractInfoService {
       params: {id: id}
     })
   }
+  findByContractId (id) {
+    return request({
+      url: '/contract/registration/findByContractId',
+      method: 'get',
+      params: {id: id}
+    })
+  }
   updateStatusById (param) {
     return request({
       url: '/contract/registration/updateStatusById',

+ 167 - 54
src/views/modules/cw/workContract/ContractFileForm.vue

@@ -174,8 +174,70 @@
         </el-col>
 
       </el-row>
+    </el-form>
+      <el-tabs v-model="activeName" type="border-card" @tab-click="tabHandleClick">
+        <el-tab-pane label="合同正文" name="uploadFile">
+          <!--        合同正文-->
+          <UpLoadComponent ref="uploadFile"></UpLoadComponent>
+        </el-tab-pane>
+        <el-tab-pane label="参与签约方" name="contactParty">
+          <el-row :gutter="15">
+            <el-button style="margin-bottom: 15px" type="primary" :disabled="true" size="medium" @click="insertEvent('contact')" plain>
+              新增
+            </el-button>
+          </el-row>
+          <el-row  :gutter="15">
+            <vxe-table
+              border
+              :column-config="{resizable: true}"
+              show-overflow
+              show-footer
+              :key="2"
+              ref="contactTable"
+              class="vxe-table-element"
+              :data="inputForm.cwWorkClientContactDTOList"
+              style=""
+              @cell-click=""
+              @edit-closed=""
+              highlight-current-row
+              :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: false}"
+            >
+              <vxe-column type="seq" width="60" align="center" title="序号"></vxe-column>
+              <vxe-table-column align="center" field="customerNo" title="客户编号" :edit-render="{}">
+                <template v-slot:edit="scope">
+                  <el-input v-model="scope.row.customerNo" placeholder="客户编号" clearable></el-input>
+                </template>
+              </vxe-table-column>
+              <vxe-table-column align="center" field="customerName" title="客户名称" :edit-render="{}">
+                <template v-slot:edit="scope">
+                  <el-form-item label="客户名称" prop="clientId">
+                    <work-client-select
+                      :size="'medium'"
+                      :value="clientId"
+                      :disabled="method==='view'"
+                      @getValue='(clientId,customerName) => {inputForm.clientId=scope.row.clientId;inputForm.clientName=scope.row.customerName}'
+                    >
+                    </work-client-select>
+                  </el-form-item>
+                  <!--                  <el-input v-model="scope.row.customerName" placeholder="客户名称" clearable></el-input>-->
+                </template>
+              </vxe-table-column>
+              <vxe-table-column align="center" title="操作" width="100">
+                <template v-slot="scope">
+                  <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'contact')">删除</el-button>
+                </template>
+              </vxe-table-column>
+            </vxe-table>
+          </el-row>
+        </el-tab-pane>
+        <el-tab-pane label="合同归档文件" name="archiveFile">
+          <!--        合同归档文件-->
+          <UpLoadComponent ref="archiveFile"></UpLoadComponent>
+        </el-tab-pane>
+
+      </el-tabs>
+
 
-      </el-form>
       <el-image-viewer
         v-if="showViewer"
         :on-close="closeViewer"
@@ -186,7 +248,8 @@
 
 <script>
   import ContractInfoService from '@/api/cw/workContract/ContractInfoService'
-  import ContractFileService from '@/api/cw/workContract/ContractFileService'
+  import ContractFileService from '../../../../api/cw/workContract/ContractFileService'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
   import OSSSerive, {
     httpRequest,
     toHref,
@@ -226,13 +289,18 @@
           contractSpecial: '',
           remarks: '',
           clientName: '',
-          status: ''
+          status: '',
+          contractProperList: [],
+          contractInfoList: [],
+          customerNo: '',
+          customerName: ''
         },
         inputForm: {
           contractNo: '',
           contractName: '',
           payerSubject: '',
           paymentMethod: '',
+          contractInfoId: '',
           signingDate: '',
           contractAmount: '',
           actualContractAmount: '',
@@ -246,8 +314,11 @@
           contractApprovalType: '',
           createBy: JSON.parse(localStorage.getItem('user')).name,
           createId: JSON.parse(localStorage.getItem('user')).id,
-          createDate: ''
+          createDate: '',
+          contractProperList: [],
+          contractInfoList: []
         },
+        activeName: 'archiveFile',
         filesArra2: [],
         fileList: [],
         isFlag: true,
@@ -259,7 +330,8 @@
         type: '',
         loadProgress: 0, // 动态显示进度条
         progressFlag: false, // 关闭进度条
-        promi: null
+        promi: null,
+        keyWatch: ''
       }
     },
     props: {
@@ -270,15 +342,15 @@
       formReadOnly: {
         type: Boolean,
         default: false
+      },
+      status: {
+        type: String,
+        default: ''
       }
     },
     components: {
-      ElImageViewer
-    },
-    computed: {
-      officeName () {
-        return JSON.parse(localStorage.getItem('user')).officeDTO.name
-      }
+      ElImageViewer,
+      UpLoadComponent
     },
     ossService: null,
     // workContractService: null,
@@ -293,25 +365,37 @@
     mounted () {
       window.onPreview = this.onPreview
     },
+    computed: {
+      officeName () {
+        return JSON.parse(localStorage.getItem('user')).officeDTO.name
+      },
+      bus: {
+        get () {
+          this.$refs.archiveFile.setDividerName('附件')
+          return this.businessId
+        },
+        set (val) {
+          this.businessId = val
+        }
+      }
+    },
     watch: {
-      'businessId': {
+      'keyWatch': {
         handler (newVal) {
-          if (this.businessId && this.businessId !== 'false') {
-            this.ossService = new OSSSerive()
-            this.init('edit', this.businessId)
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
           } else {
-            // this.$refs.inputForm.resetFields()
-            // this.visible = false
-            // this.showVi = true
-            // this.$refs.uploadComponent.clearUpload()
-            this.init('clean', '')
+            this.$nextTick(() => {
+              this.$refs.inputForm.resetFields()
+            })
           }
-        },
-        immediate: true,
-        deep: false
+        }
       }
     },
     methods: {
+      getKeyWatch (keyWatch) {
+        this.keyWatch = keyWatch
+      },
       uploadVideoProcess (event, file, fileList) {
         this.progressFlag = true // 显示进度条
         this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
@@ -334,6 +418,7 @@
       },
       init (method, id) {
         console.log(method)
+        console.log('id', id)
         this.dataList = []
         this.dataListNew = []
         this.method = method
@@ -356,7 +441,10 @@
           contractApprovalType: '',
           createBy: JSON.parse(localStorage.getItem('user')).name,
           createId: JSON.parse(localStorage.getItem('user')).id,
-          createDate: ''
+          createDate: '',
+          contractProperList: [],
+          contractInfoList: [],
+          cwWorkClientContactDTOList: []
         }
         this.inputForm.id = id
         if (method === 'add') {
@@ -372,30 +460,49 @@
         this.loading = false
         this.$nextTick(() => {
           this.$refs.inputForm.resetFields()
-          if (method === 'edit' || method === 'view') { // 修改或者查看
-            this.loading = true
-            this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
-              if (this.commonJS.isEmpty(data.id)) {
-                this.contractFileService.findById(this.inputForm.id).then(({data}) => {
-                  this.contractInfoService.findById(data.contractInfoId).then(({data}) => {
-                    this.saveData(data)
-                    if (this.formReadOnly) {
-                      method = 'view'
-                    }
-                  })
+          // if (method === 'edit' || method === 'view') { // 修改或者查看
+          this.loading = true
+          this.contractInfoService.findById(this.inputForm.id).then(data1 => {
+            this.$refs.archiveFile.clearUpload()
+            this.$refs.uploadFile.clearUpload()
+            this.inputForm.contractProperList = data1.data.contractProperList
+            console.log('data1.id', data1.data.id)
+            console.log('data1.data.filedType', data1.data.filedType)
+            if ((data1.data.filedType !== '0' & data1.data.filedType !== undefined) || data1.data.id === undefined) {
+              console.log('data1.22222')
+              this.contractFileService.findById(this.inputForm.id).then(data2 => {
+                this.inputForm.contractProperList = data2.data.contractProperList
+                this.inputForm.contractInfoList = data2.data.contractInfoList
+                console.log('data2', data2)
+                this.contractInfoService.findById(data2.data.contractInfoId).then(data3 => {
+                  data3.data.contractProperList = this.inputForm.contractProperList
+                  data3.data.contractInfoList = this.inputForm.contractInfoList
+                  this.$refs.archiveFile.newUpload(method, data3.data.contractInfoList, 'cwWorkContract', 300, '合同登记文件')
+                  this.$refs.uploadFile.newUpload('view', data3.data.contractProperList, 'cwWorkContract', 300, '合同归档文件')
+                  this.saveData(data3.data, method)
+                  if (this.formReadOnly) {
+                    method = 'view'
+                  }
                 })
-              } else {
-                this.saveData(data)
-                if (this.formReadOnly) {
-                  method = 'view'
-                }
+              })
+            } else {
+              console.log('进来了22')
+              this.$refs.uploadFile.newUpload('view', data1.data.contractProperList, 'cwWorkContract', 300, '合同登记文件')
+              this.saveData(data1.data, method)
+              if (this.formReadOnly) {
+                method = 'view'
               }
-              this.loading = false
-            })
-          }
-        })
+            }
+            this.loading = false
+          })
+        }
+        )
       },
-      saveData (data) {
+      tabHandleClick (event) {
+        // console.log(event)
+      },
+      saveData (data, method) {
+        console.log('data', data)
         this.inputForm = this.recover(this.inputForm, data)
         this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
       },
@@ -417,6 +524,8 @@
         if (this.status === 'startAndHoldFiled') {
           this.inputForm.filedType = '1'
           this.inputForm.contractInfoId = this.businessId
+          this.inputForm.contractInfoList = this.$refs.archiveFile.getDataList()
+          // this.inputForm.contractInfoList = this.$refs.uploadFile.getDataList()
           this.contractFileService.save(this.inputForm)
         }
         this.$refs.inputForm.resetFields()
@@ -434,12 +543,13 @@
         console.log('inputForm', this.inputForm)
         this.inputForm.filedType = '2'
         this.inputForm.contractInfoId = id
+        this.inputForm.contractInfoList = this.$refs.archiveFile.getDataList()
+        this.inputForm.contractProperList = this.$refs.uploadFile.getDataList()
         this.contractFileService.save(this.inputForm).then(({data}) => {
           console.log('data', data)
           callback(data.businessTable, data.businessId, this.inputForm)
           this.$refs.inputForm.resetFields()
           this.loading = false
-          this.businessId = ''
         })
       },
       // 通过
@@ -447,10 +557,12 @@
         let id = this.inputForm.id
         this.loading = true
         this.inputForm.status = '5'
+        // this.inputForm.contractInfoList = this.$refs.archiveFile.getDataList()
+        // console.log('this.inputForm.contractProperList', this.inputForm.contractProperList)
         this.contractInfoService.save(this.inputForm)
-        console.log('inputForm', this.inputForm)
-        this.inputForm.filedType = '2'
+        this.inputForm.filedType = '5'
         this.inputForm.contractInfoId = id
+        // this.inputForm.contractInfoList = this.$refs.uploadFile.getDataList()
         this.contractFileService.save(this.inputForm).then(({data}) => {
           callback(data.businessTable, data.businessId, this.inputForm)
           this.$refs.inputForm.resetFields()
@@ -463,6 +575,7 @@
         this.inputForm.clientName = ''
         this.visible = false
         this.showVi = true
+        this.$refs.archiveFile.clearUpload()
       },
       httpRequest (file) {
         httpRequest(file, fileName(file), 'workContract')
@@ -569,17 +682,17 @@
       updateStatusById (type) {
         console.log('type' + type)
         if (type === 'agree') {
-          this.inputForm.status = '5'
-          this.contractInfoService.updateStatusById(this.inputForm)
+          this.inputForm.filedType = '5'
+          this.contractFileService.updateStatusById(this.inputForm)
         }
         // 驳回
         if (type === 'reject') {
-          this.inputForm.status = '4'
-          this.contractInfoService.updateStatusById(this.inputForm)
+          this.inputForm.filedType = '4'
+          this.contractFileService.updateStatusById(this.inputForm)
         }
         if (type === 'reback') {
-          this.inputForm.status = '3'
-          this.contractInfoService.updateStatusById(this.inputForm)
+          this.inputForm.filedType = '3'
+          this.contractFileService.updateStatusById(this.inputForm)
         }
       },
       checkData () {

+ 40 - 31
src/views/modules/cw/workContract/ContractRegistration.vue

@@ -75,8 +75,8 @@
     <div class="bg-white top">
       <vxe-toolbar :refresh="{query: refreshList}" import export print custom>
         <template #buttons>
-          <el-button v-if="hasPermission('sys:project:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
-          <el-button v-if="hasPermission('sys:project:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" plain>删除</el-button>
+          <el-button v-if="hasPermission('cw:workContract:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
+          <el-button v-if="hasPermission('cw:workContract:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" plain>删除</el-button>
         </template>
       </vxe-toolbar>
       <div style="height: calc(100% - 80px);">
@@ -168,7 +168,8 @@
   import WorkContractBorrowMessageForm from './WorkContractBorrowMessageForm'
   // import WorkContractService from '@/api/sys/WorkContractService'
   import ContractInfoService from '../../../../api/cw/workContract/ContractInfoService'
-  import WorkContractFileService from '@/api/sys/WorkContractFileService'
+  // import WorkContractFileService from '@/api/sys/WorkContractFileService'
+  import ContractFileService from '@/api/cw/workContract/ContractFileService'
   import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
   import TaskService from '@/api/flowable/TaskService'
@@ -211,7 +212,7 @@
     },
     // workContractService: null,
     contractInfoService: null,
-    workContractFileService: null,
+    contractFileService: null,
     workContractBorrowService: null,
     taskService: null,
     processService: null,
@@ -219,7 +220,7 @@
     created () {
       // this.workContractService = new WorkContractService()
       this.contractInfoService = new ContractInfoService()
-      this.workContractFileService = new WorkContractFileService()
+      this.contractFileService = new ContractFileService()
       this.workContractBorrowService = new WorkContractBorrowService()
       this.taskService = new TaskService()
       this.processService = new ProcessService()
@@ -430,14 +431,14 @@
         })
       },
       reback (row) {
-        console.log('row', row.procInsId)
+        // console.log('row', row.procInsId)
         this.$confirm(`确定撤回流程吗?`, '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
           this.processService.revokeProcIns(row.procInsId).then(({data}) => {
-            console.log('updateStatusById')
+            // console.log('updateStatusById')
             let form = {status: '3', id: row.id}
             this.updateStatusById(form, 'reback')
             this.$message.success(data)
@@ -446,32 +447,38 @@
         })
       },
       rebackFiled (row) {
+        // console.log('row.taskFiledProcInsId' + row.taskFiledProcInsId)
         this.$confirm(`确定撤回流程吗?`, '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
-          taskId: row.taskFiledId,
           type: 'warning'
         }).then(() => {
-          this.taskService.backNodes(row.taskFiledId).then(({data}) => {
-            let backNodes = data
-            if (backNodes.length > 0) {
-              let backTaskDefKey = backNodes[0].taskDefKey
-              this.taskService.back({
-                taskId: row.taskFiledId,
-                backTaskDefKey: backTaskDefKey,
-                isShow: false,
-                ...this.auditForm
-              }).then(({data}) => {
-                this.updateStatusById(row, 'rebackFiled')
-                this.$message.success('回退成功')
-              })
-            }
+          this.processService.revokeProcIns(row.taskFiledProcInsId).then(({data}) => {
+            // let form = {filedType: '3', id: row.id}
+            this.updateStatusById(row, 'rebackFiled')
+            this.$message.success(data)
+            this.refreshList()
           })
+          // this.taskService.backNodes(row.taskFiledId).then(({data}) => {
+          //   let backNodes = data
+          //   if (backNodes.length > 0) {
+          //     let backTaskDefKey = backNodes[0].taskDefKey
+          //     this.taskService.back({
+          //       taskId: row.taskFiledId,
+          //       backTaskDefKey: backTaskDefKey,
+          //       isShow: false,
+          //       ...this.auditForm
+          //     }).then(({data}) => {
+          //       this.updateStatusById(row, 'rebackFiled')
+          //       this.$message.success('回退成功')
+          //     })
+          //   }
+          // })
         })
       },
       updateStatusById (row, type) {
-        console.log('updateStatusByIdupdateStatusById')
-        console.log(type)
+        // console.log('updateStatusByIdupdateStatusById')
+        // console.log(type)
         if (type === 'agree') {
           row.status = '5'
           this.contractInfoService.updateStatusById(row)
@@ -486,7 +493,7 @@
         }
         if (type === 'rebackFiled') {
           row.filedType = '3'
-          this.workContractFileService.updateStatusById(row)
+          this.contractFileService.updateStatusById(row)
         }
         if (type === 'rebackBorrow') {
           row.borrowType = '0'
@@ -512,7 +519,7 @@
       filed (id) {
         this.processService.getByName('财务-合同登记归档').then(({data}) => {
           if (!this.commonJS.isEmpty(data.id)) {
-            console.log('data', data)
+            // console.log('data', data)
             // 读取流程表单
             let tabTitle = `发起流程【财务-合同登记归档】`
             let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [财务-合同登记归档]`
@@ -544,7 +551,7 @@
       filedAndClose (id) {
         this.processService.getByName('财务-合同登记归档').then(({data}) => {
           if (!this.commonJS.isEmpty(data.id)) {
-            console.log('data', data)
+            // console.log('data', data)
             // 读取流程表单
             let tabTitle = `发起流程【财务-合同登记归档】`
             let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [财务-合同登记归档]`
@@ -574,10 +581,12 @@
       },
       // 归档详情
       detailFiled (row) {
-        if (row.filedType !== '4') {
-          this.workContractFileService.findByContractInfoId(row.id).then(({data}) => {
+        // console.log('row.id', row.id)
+        // eslint-disable-next-line eqeqeq
+        if (!this.commonJS.isEmpty(row.filedType) && row.filedType != '1') {
+          this.contractFileService.findByContractInfoId(row.id).then(({data}) => {
             if (!this.commonJS.isEmpty(data.id)) {
-              console.log('data', data)
+              // console.log('data', data)
               this.taskService.getTaskDef({
                 procInsId: data.procInsId,
                 procDefId: data.processDefinitionId
@@ -589,7 +598,7 @@
                     title: '归档流程详情',
                     formTitle: '归档流程详情',
                     businessId: row.id,
-                    ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')}
+                    ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title')}
                 })
               })
             }

+ 166 - 54
src/views/modules/cw/workContract/ContractRegistrationForm.vue

@@ -106,11 +106,25 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="所属部门" prop="department"
-                        :rules="[{required: true, message: '所属部门', trigger: 'blur'}
-                 ]">
-            <el-input maxlength="64" v-model="inputForm.department" placeholder="请输入所属部门"></el-input>
+          <el-form-item  prop="department" label="所属部门">
+            <SelectTree
+              ref="officeTree"
+              :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+
+              :url="`/sys/office/treeData?type=2`"
+              :value="inputForm.department"
+              :accordion="true"
+              @getValue="(value) => {inputForm.department=value}"/>
           </el-form-item>
+<!--          <el-form-item label="所属部门" prop="department"-->
+<!--                        :rules="[{required: true, message: '所属部门', trigger: 'blur'}-->
+<!--                 ]">-->
+<!--&lt;!&ndash;            <el-input maxlength="64" v-model="inputForm.department" placeholder="请输入所属部门"></el-input>&ndash;&gt;-->
+<!--          </el-form-item>-->
         </el-col>
 
         <el-col :span="12">
@@ -132,19 +146,6 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="合同归档审批类型" prop="contractApprovalType">
-            <el-select :disabled="true" v-model="inputForm.contractApprovalType" placeholder="请选择" style="width:100%;">
-              <el-option
-                v-for="item in $dictUtils.getDictList('contract_type')"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value">
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="12">
           <el-form-item label="创建人" prop="createBy"
                         :rules="[{required: true, message: '创建人', trigger: 'blur'}
                  ]">
@@ -167,18 +168,90 @@
 
       </el-row>
 
+      <el-tabs v-model="activeName" type="border-card" @tab-click="tabHandleClick">
+        <el-tab-pane label="合同正文" name="contractProper">
+          <!--        合同正文-->
+          <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+        </el-tab-pane>
+        <el-tab-pane label="参与签约方" name="contactParty">
+          <el-row :gutter="15">
+            <el-button style="margin-bottom: 15px" type="primary" :disabled="formReadOnly" size="medium" @click="insertEvent('contact')" plain>
+              新增
+            </el-button>
+          </el-row>
+          <el-row  :gutter="15">
+            <vxe-table
+              border
+              :column-config="{resizable: true}"
+              show-overflow
+              show-footer
+              :key="2"
+              ref="contactTable"
+              class="vxe-table-element"
+              :data="inputForm.cwWorkClientContactDTOList"
+              style=""
+              @cell-click=""
+              @edit-closed=""
+              highlight-current-row
+              :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: false}"
+            >
+              <vxe-column type="seq" width="60" align="center" title="序号"></vxe-column>
+              <vxe-table-column align="center" field="customerNo" title="客户编号" :edit-render="{}">
+                <template v-slot:edit="scope">
+                  <el-input v-model="scope.row.customerNo" :disabled="true" placeholder="请填写客户编号" clearable></el-input>
+                </template>
+              </vxe-table-column>
+              <vxe-table-column align="center" field="customerName" title="客户名称" :edit-render="{}">
+                <template slot-scope="scope">
+                  <el-link  type="primary" :underline="false" v-if="hasPermission('cw_work_client:info:view')" @click="view(scope.row.id)">{{scope.row.customerName}}</el-link>
+                  <el-link  type="primary" :underline="false" v-else-if="hasPermission('cw_work_client:info:view')"  @click="view(scope.row.id,)">{{scope.row.customerName}}</el-link>
+                  <span v-else>{{scope.row.customerName}}</span>
+                </template>
+<!--                <template v-slot:edit="scope">-->
+<!--                  <el-form-item label="客户名称" prop="clientId">-->
+<!--                    <work-client-select-->
+<!--                      :size="'medium'"-->
+<!--                      :value="clientId"-->
+<!--                      :disabled="method==='view'"-->
+<!--                      @getValue='(clientId,customerName) => {inputForm.clientId=scope.row.clientId;inputForm.clientName=scope.row.customerName}'-->
+<!--                    >-->
+<!--                    </work-client-select>-->
+<!--                  </el-form-item>-->
+<!--&lt;!&ndash;                  <el-input v-model="scope.row.customerName" placeholder="客户名称" clearable></el-input>&ndash;&gt;-->
+<!--                </template>-->
+              </vxe-table-column>
+              <vxe-table-column align="center" title="操作" width="100">
+                <template v-slot="scope">
+                  <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'contact')">删除</el-button>
+                </template>
+              </vxe-table-column>
+            </vxe-table>
+          </el-row>
+        </el-tab-pane>
+        <el-tab-pane  label="合同归档文件" name="archiveFile">
+          <!--        合同归档文件-->
+          <UpLoadComponent ref="archiveFile"></UpLoadComponent>
+        </el-tab-pane>
+
+      </el-tabs>
+
       </el-form>
       <el-image-viewer
         v-if="showViewer"
         :on-close="closeViewer"
         :url-list="[url]"
         zIndex="9999"/>
+    <WorkClientForm ref="workClientForm"></WorkClientForm>
   </div>
 </template>
 
 <script>
   // import WorkContractService from '@/api/sys/WorkContractService'
   import ContractInfoService from '@/api/cw/workContract/ContractInfoService'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import WorkClientSelect from '@/components/workClientInfoSelect'
+  import WorkClientForm from '../workClientInfo/WorkClientForm'
   import OSSSerive, {
     httpRequest,
     toHref,
@@ -219,8 +292,10 @@
           contractSpecial: '',
           remarks: '',
           clientName: '',
-          workAttachmentList: [],
-          status: ''
+          contractProperList: [],
+          status: '',
+          customerNo: '',
+          customerName: ''
         },
         inputForm: {
           contractNo: '',
@@ -230,18 +305,20 @@
           signingDate: '',
           contractAmount: '',
           actualContractAmount: '',
-          contractNum: '',
-          contractStatus: '',
+          contractNum: '2',
+          contractStatus: '新创建',
           paymentAgreement: '',
-          changeNum: '',
+          changeNum: '0',
           department: '',
           clientContacts: '',
           clientContactsPhone: '',
-          contractApprovalType: '',
           createBy: JSON.parse(localStorage.getItem('user')).name,
           createId: JSON.parse(localStorage.getItem('user')).id,
-          createDate: ''
+          createDate: '',
+          contractProperList: []
         },
+        cwWorkClientContactDTOList: [],
+        activeName: 'contractProper',
         filesArra2: [],
         fileList: [],
         isFlag: true,
@@ -267,7 +344,11 @@
       }
     },
     components: {
-      ElImageViewer
+      ElImageViewer,
+      UpLoadComponent,
+      SelectTree,
+      WorkClientSelect,
+      WorkClientForm
     },
     computed: {
       officeName () {
@@ -294,7 +375,7 @@
             // this.visible = false
             // this.showVi = true
             // this.$refs.uploadComponent.clearUpload()
-            this.init('clean', '')
+            // this.init('clean', '')
           }
         },
         immediate: true,
@@ -323,7 +404,6 @@
         this.showViewer = false
       },
       init (method, id) {
-        console.log(method)
         this.dataList = []
         this.dataListNew = []
         this.method = method
@@ -335,17 +415,18 @@
           signingDate: '',
           contractAmount: '',
           actualContractAmount: '',
-          contractNum: '2',
-          contractStatus: '新创建',
+          contractNum: '',
+          contractStatus: '',
           paymentAgreement: '',
-          changeNum: '0',
-          department: this.officeName,
+          changeNum: '',
+          department: '',
           clientContacts: '',
           clientContactsPhone: '',
-          contractApprovalType: '',
           createBy: JSON.parse(localStorage.getItem('user')).name,
           createId: JSON.parse(localStorage.getItem('user')).id,
-          createDate: ''
+          createDate: '',
+          contractProperList: [],
+          cwWorkClientContactDTOList: []
         }
         this.inputForm.id = id
         if (method === 'add') {
@@ -361,33 +442,60 @@
         this.loading = false
         this.$nextTick(() => {
           this.$refs.inputForm.resetFields()
-          if (method === 'edit' || method === 'view') { // 修改或者查看
-            this.loading = true
-            this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
-              this.inputForm = this.recover(this.inputForm, 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
-              if (this.formReadOnly) {
-                method = 'view'
-              }
-              this.loading = false
-            })
-          }
+          // if (method === 'edit' || method === 'view') { // 修改或者查看
+          this.loading = true
+          this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
+            this.inputForm = this.recover(this.inputForm, 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
+            if (this.formReadOnly) {
+              method = 'view'
+            }
+            this.$refs.uploadComponent.newUpload(method, this.inputForm.contractProperList, 'cwWorkContract', 300, '合同正文')
+            this.$refs.archiveFile.newUpload('view', null, 'cwWorkContract', 300, '合同正文')
+            this.loading = false
+          })
         })
       },
+      // 查看
+      view (id) {
+        this.$refs.workClientForm.init('view', id)
+      },
+      // 新增
+      // eslint-disable-next-line no-dupe-keys
+      async insertEvent (type) {
+        if (type === 'contact') {
+          await this.$refs.contactTable.insert().then((data) => {
+            if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
+              this.inputForm.cwWorkClientContactDTOList = []
+            }
+            this.$nextTick(() => {
+              this.inputForm.cwWorkClientContactDTOList.push(data)
+            })
+          })
+        }
+      },
 
+      // 删除
+      removeEvent (row, rowIndex, type) {
+        if (type === 'contact') {
+          this.$refs.contactTable.remove(row)
+          this.inputForm.cwWorkClientContactDTOList.splice(rowIndex, 1)
+        }
+      },
       // 表单提交
       // 暂存
       async saveForm (callback) {
         this.loading = true
         this.inputForm.status = '1'
+        this.inputForm.contractProperList = this.$refs.uploadComponent.getDataList()
         await this.contractInfoService.save(this.inputForm).then(({data}) => {
           callback()
           this.$refs.inputForm.resetFields()
@@ -403,9 +511,9 @@
           if (valid) {
             this.loading = true
             this.inputForm.status = '2'
+            this.inputForm.contractProperList = this.$refs.uploadComponent.getDataList()
             // this.inputForm.fees = this.inputForm.contractFees.join(',')
             await this.contractInfoService.save(this.inputForm).then(({data}) => {
-              console.log('data', data)
               callback(data.businessTable, data.businessId, this.inputForm)
               this.$refs.inputForm.resetFields()
               this.loading = false
@@ -422,6 +530,7 @@
           if (valid) {
             this.loading = true
             this.inputForm.status = '2'
+            this.inputForm.contractProperList = this.$refs.uploadComponent.getDataList()
             // this.inputForm.fees = this.inputForm.contractFees.join(',')
             await this.contractInfoService.save(this.inputForm).then(({data}) => {
               callback(data.businessTable, data.businessId, this.inputForm)
@@ -439,6 +548,10 @@
         this.inputForm.clientName = ''
         this.visible = false
         this.showVi = true
+        this.$refs.uploadComponent.clearUpload()
+      },
+      tabHandleClick (event) {
+        // console.log(event)
       },
       httpRequest (file) {
         httpRequest(file, fileName(file), 'workContract')
@@ -543,7 +656,6 @@
         this.visable = false
       },
       updateStatusById (type) {
-        console.log('type' + type)
         if (type === 'agree') {
           this.inputForm.status = '5'
           this.contractInfoService.updateStatusById(this.inputForm)