Explorar o código

财务-合同登记借用

wangqiang %!s(int64=2) %!d(string=hai) anos
pai
achega
2a806a240d

+ 60 - 0
src/api/cw/workContract/CwWorkContractBorrowService.js

@@ -0,0 +1,60 @@
+import request from '@/utils/httpRequest'
+
+export default class WorkContractService {
+  save (param) {
+    return request({
+      url: '/contract/workContractBorrow/save',
+      method: 'post',
+      data: param
+    })
+  }
+  updateStatusById (param) {
+    return request({
+      url: '/contract/workContractBorrow/updateStatusById',
+      method: 'post',
+      data: param
+    })
+  }
+  updateStatusByContractInfoId (param) {
+    return request({
+      url: '/contract/workContractBorrow/updateStatusByContractInfoId',
+      method: 'post',
+      data: param
+    })
+  }
+  findById (id) {
+    return request({
+      url: '/contract/workContractBorrow/findById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  findByContractInfoId (id) {
+    return request({
+      url: '/contract/workContractBorrow/findByContractInfoId',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  updateMessageStatusById (param) {
+    return request({
+      url: '/contract/workContractBorrow/updateMessageStatusById',
+      method: 'post',
+      data: param
+    })
+  }
+  deleteById (id) {
+    return request({
+      url: '/contract/workContractBorrow/deleteById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  findMessageList (id) {
+    return request({
+      url: '/contract/workContractBorrow/findMessageList',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+}

+ 1 - 1
src/views/modules/cw/reportCancellApply/ReportCancellApplyTaskForm.vue

@@ -58,7 +58,7 @@
                             :rules="[
                               {required: true, message:'作废原因不能为空', trigger:'blur'}
                    ]">
-                <el-input v-model="inputForm.cancellateReason" placeholder="请填写作废原因" clearable></el-input>
+                <el-input type="textarea" v-model="inputForm.cancellateReason" placeholder="请填写作废原因" clearable></el-input>
               </el-form-item>
             </el-col>
 

+ 158 - 9
src/views/modules/cw/workContract/ContractFileForm.vue

@@ -68,7 +68,18 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="合同金额(元)" prop="contractAmount"
+          <el-form-item label="合同金额类别" prop="contractAmountType"
+                        :rules="[
+                  {required: true, message:'请选择合同金额类别', trigger:'blur'}
+               ]">
+            <el-radio-group :disabled="true" v-model="inputForm.contractAmountType">
+              <el-radio v-for="item in $dictUtils.getDictList('contract_amount_type')" :label="item.value" >{{item.label}}</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="合同金额(元)" prop="contractAmount" v-if="inputForm.contractAmountType === '1'"
                         :rules="[
                   {required: true, message:'请输入合同金额(元)', trigger:'blur'}
                ]">
@@ -98,8 +109,24 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="付款约定" prop="paymentAgreement">
-            <el-input maxlength="64" :disabled="true" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
+          <el-form-item label="对方合同编号" prop="contractOpposite">
+            <el-input :disabled="true" maxlength="64" v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="24">
+          <el-form-item label="收费标准" prop="contractFees">
+            <el-checkbox-group v-model="inputForm.contractFees">
+              <el-checkbox :disabled="true" @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>
+
+        <el-col :span="24">
+          <el-form-item prop="contractFee">
+            <el-input style="width: 100%" placeholder="请选择收费标准" :disabled="true" v-model="inputForm.contractFee"></el-input>
           </el-form-item>
         </el-col>
 
@@ -115,7 +142,21 @@
           <el-form-item label="所属部门" prop="department"
                         :rules="[
                  ]">
-            <el-input maxlength="64" :disabled="true" v-model="inputForm.department" placeholder="请输入所属部门"></el-input>
+            <SelectTree
+              ref="officeTree"
+              :disabled="true"
+              :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+
+              :url="`/sys/office/treeData?type=1`"
+              :value="inputForm.department"
+              :accordion="true"
+              size="medium"
+              @getValue="(value) => {inputForm.department=value}"/>
+<!--            <el-input maxlength="64" :disabled="true" v-model="inputForm.department" placeholder="请输入所属部门"></el-input>-->
           </el-form-item>
         </el-col>
 
@@ -153,6 +194,24 @@
         </el-col>
 
         <el-col :span="12">
+          <el-form-item label="案卷号" prop="filedNo"
+                        :rules="[{required: true, message: '请输入案卷号', trigger: 'blur'}
+                 ]">
+            <el-input maxlength="15" v-model="inputForm.filedNo" placeholder="请输入案卷号"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="确认案卷号" prop="confirmFiledNo"
+                        :rules="[{required: true, message: '请输入确认案卷号', trigger: 'blur'}
+                 ]">
+            <el-input maxlength="15" @change="checkFiledNo" v-model="inputForm.confirmFiledNo" placeholder="请输入确认案卷号"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
           <el-form-item label="创建人" prop="createBy"
                         :rules="[{required: true, message: '创建人', trigger: 'blur'}
                  ]">
@@ -172,6 +231,11 @@
             </el-date-picker>
           </el-form-item>
         </el-col>
+        <el-col :span="12">
+          <el-form-item label="付款约定" prop="paymentAgreement">
+            <el-input maxlength="64" type="textarea" :disabled="true" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
+          </el-form-item>
+        </el-col>
 
       </el-row>
     </el-form>
@@ -244,6 +308,7 @@
   import ContractFileService from '../../../../api/cw/workContract/ContractFileService'
   import UpLoadComponent from '@/views/common/UpLoadComponent'
   import WorkClientChooseForm from '../workClientInfo/WorkClientChooseForm'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
   import OSSSerive, {
     httpRequest,
     toHref,
@@ -268,6 +333,8 @@
         visible: false,
         loading: false,
         returnForm: {
+          filedNo: '',
+          confirmFiledNo: '',
           clientId: '',
           name: '',
           contractDate: '',
@@ -287,9 +354,14 @@
           contractProperList: [],
           contractInfoList: [],
           customerNo: '',
-          customerName: ''
+          customerName: '',
+          contractFees: []
         },
         inputForm: {
+          contractFee: '',
+          contractFees: [],
+          contractOpposite: '',
+          contractAmountType: '',
           contractNo: '',
           contractName: '',
           payerSubject: '',
@@ -310,7 +382,9 @@
           createId: JSON.parse(localStorage.getItem('user')).id,
           createDate: '',
           contractProperList: [],
-          contractInfoList: []
+          contractInfoList: [],
+          filedNo: '',
+          confirmFiledNo: ''
         },
         activeName: 'archiveFile',
         filesArra2: [],
@@ -346,7 +420,8 @@
     components: {
       ElImageViewer,
       UpLoadComponent,
-      WorkClientChooseForm
+      WorkClientChooseForm,
+      SelectTree
     },
     ossService: null,
     // workContractService: null,
@@ -390,6 +465,14 @@
       }
     },
     methods: {
+      checkFiledNo () {
+        let filedNo = this.inputForm.filedNo
+        let confirmFiledNo = this.inputForm.confirmFiledNo
+        if (filedNo !== confirmFiledNo) {
+          this.$message.warning(`案卷号和确认案卷号不一致`)
+          this.inputForm.confirmFiledNo = ''
+        }
+      },
       getKeyWatch (keyWatch) {
         this.keyWatch = keyWatch
       },
@@ -420,6 +503,10 @@
         this.dataListNew = []
         this.method = method
         this.inputForm = {
+          contractFee: '',
+          contractFees: [],
+          contractOpposite: '',
+          contractAmountType: '',
           contractNo: '',
           contractName: '',
           payerSubject: '',
@@ -441,11 +528,12 @@
           createDate: '',
           contractProperList: [],
           contractInfoList: [],
-          cwWorkClientContactDTOList: []
+          cwWorkClientContactDTOList: [],
+          filedNo: '',
+          confirmFiledNo: ''
         }
         this.inputForm.id = id
         if (method === 'add') {
-          // this.inputForm.contractAmountType = '1'
           this.title = `新建合同登记`
         } else if (method === 'edit') {
           this.title = '修改合同登记'
@@ -477,6 +565,28 @@
                 this.contractInfoService.findById(data2.data.contractInfoId).then(async (data3) => {
                   data3.data.contractProperList = this.inputForm.contractProperList
                   data3.data.contractInfoList = this.inputForm.contractInfoList
+                  this.inputForm.contractNo = data3.data.contractNo
+                  this.inputForm.filedNo = data3.data.filedNo
+                  this.inputForm.contractName = data3.data.contractName
+                  this.inputForm.payerSubject = data3.data.payerSubject
+                  this.inputForm.paymentMethod = data3.data.paymentMethod
+                  this.inputForm.signingDate = data3.data.signingDate
+                  this.inputForm.contractAmountType = data3.data.contractAmountType
+                  this.inputForm.contractAmount = data3.data.contractAmount
+                  this.inputForm.actualContractAmount = data3.data.actualContractAmount
+                  this.inputForm.contractNum = data3.data.contractNum
+                  this.inputForm.contractOpposite = data3.data.contractOpposite
+                  this.inputForm.confirmFiledNo = data3.data.confirmFiledNo
+                  this.inputForm.contractFee = data3.data.contractFee
+                  this.inputForm.fees = data3.data.fees
+                  this.inputForm.changeNum = data3.data.changeNum
+                  this.inputForm.department = data3.data.department
+                  console.log('data3.data.department', data3.data.department)
+                  this.inputForm.clientContacts = data3.data.clientContacts
+                  this.inputForm.clientContactsPhone = data3.data.clientContactsPhone
+                  this.inputForm.createBy = data3.data.createBy
+                  this.inputForm.createDate = data3.data.createDate
+                  this.inputForm.paymentAgreement = data3.data.paymentAgreement
                   if (data3.data.filedType === '2' || data3.data.filedType === '5') {
                     // this.$refs.uploadFile.clearUpload()
                     // this.$refs.uploadFile.newUpload('view', data3.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
@@ -492,6 +602,15 @@
                     await this.$refs.uploadFile.clearUpload()
                     this.$refs.uploadFile.newUpload('view', data3.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
                   }
+                  const f = []
+                  if (data3.data.fees !== null && data3.data.fees !== undefined && data3.data.fees !== '') {
+                    data3.data.fees.split(',').forEach(item => {
+                      if (item !== null && item !== undefined && item !== '') {
+                        f.push(item)
+                      }
+                    })
+                  }
+                  this.inputForm.contractFees = f
 
                   // console.log('data3', data3)
                   // console.log('this.inputForm', this.inputForm)
@@ -624,6 +743,16 @@
             this.loading = false
             throw new Error('请填写合同实际金额')
           }
+          if (this.inputForm.filedNo === '' || this.inputForm.filedNo === undefined) {
+            this.loading = false
+            this.$message.error('请填写案卷号')
+            throw new Error('请填写案卷号')
+          }
+          if (this.inputForm.confirmFiledNo === '' || this.inputForm.confirmFiledNo === undefined) {
+            this.loading = false
+            this.$message.error('请填写确认案卷号')
+            throw new Error('请填写确认案卷号')
+          }
           this.contractInfoService.updateInfo(this.inputForm)
           // console.log('inputForm', this.inputForm)
           this.inputForm.contractInfoId = id
@@ -662,6 +791,26 @@
           })
         }
       },
+      changeContractFee () {
+        let fee = ''
+        let fees = this.inputForm.contractFees
+        console.log('fees', fees)
+        if (fees.length > 0) {
+          fees.forEach(i => {
+            if (i === '1') {
+              i = '发改价格[2009]2914号'
+              fee = fee + ';' + i
+            }
+            if (i === '2') {
+              i = '其他'
+              fee = fee + ';' + i
+            }
+            this.inputForm.contractFee = fee.substring(1, fee.length)
+          })
+        } else {
+          this.inputForm.contractFee = ''
+        }
+      },
       close () {
         this.$refs.inputForm.resetFields()
         this.inputForm.clientName = ''

+ 11 - 7
src/views/modules/cw/workContract/ContractNameForm.vue

@@ -106,12 +106,6 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="付款约定" prop="paymentAgreement">
-            <el-input maxlength="64" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="12">
           <el-form-item label="修改次数" prop="changeNum"
                         :rules="[{required: true, message: '修改次数', trigger: 'blur'}
                  ]">
@@ -132,6 +126,7 @@
               :url="`/sys/office/treeData?type=2`"
               :value="inputForm.department"
               :accordion="true"
+              size="medium"
               @getValue="(value) => {inputForm.department=value}"/>
           </el-form-item>
         </el-col>
@@ -175,6 +170,12 @@
           </el-form-item>
         </el-col>
 
+        <el-col :span="12">
+          <el-form-item label="付款约定" prop="paymentAgreement">
+            <el-input type="textarea" maxlength="64" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
+          </el-form-item>
+        </el-col>
+
       </el-row>
     </el-form>
     <el-tabs v-model="activeName" type="border-card" @tab-click="tabHandleClick">
@@ -275,6 +276,8 @@
         visible: false,
         loading: false,
         returnForm: {
+          filedNo: '',
+          confirmFiledNo: '',
           clientId: '',
           name: '',
           contractDate: '',
@@ -376,7 +379,7 @@
       },
       bus: {
         get () {
-          this.$refs.archiveFile.setDividerName('附件')
+          this.$refs.archiveFile.setDividerName('附件', false)
           return this.businessId
         },
         set (val) {
@@ -470,6 +473,7 @@
         this.visible = true
         this.loading = false
         this.$nextTick(() => {
+          this.$refs.archiveFile.setDividerName('附件', false)
           this.$refs.inputForm.resetFields()
             // if (method === 'edit' || method === 'view') { // 修改或者查看
           this.loading = true

+ 104 - 9
src/views/modules/cw/workContract/ContractRegistration.vue

@@ -49,7 +49,7 @@
                   children: 'children'    // 子级字段名
                 }"
 
-          :url="`/sys/office/treeData?type=2`"
+          :url="`/sys/office/treeData?type=1`"
           :value="searchForm.department"
           :accordion="true"
           @getValue="(value) => {searchForm.department=value}"/>
@@ -134,6 +134,11 @@
               <el-button  type="text" @click="detailFiled(scope.row)" :type="$dictUtils.getDictLabel('filed_type_status', scope.row.filedType, '-')" effect="dark" size="mini">{{$dictUtils.getDictLabel("filed_type", scope.row.filedType, '未归档')}} </el-button>
             </template>
           </vxe-column>
+          <vxe-column width="100px"  title="借用状态" field="borrowType" >
+            <template slot-scope="scope">
+              <el-button  type="text" @click="detailBorrow(scope.row)" :type="$dictUtils.getDictLabel('borrow_type_status', scope.row.borrowType, '-')" effect="dark" size="mini">{{$dictUtils.getDictLabel("borrow_type", scope.row.borrowType, '未借用')}} </el-button>
+            </template>
+          </vxe-column>
 
 
           <vxe-column title="操作" width="200px" fixed="right" align="center">
@@ -150,7 +155,13 @@
               <el-button v-if="hasPermission('cw:workContract:filed') && scope.row.status === '5' && scope.row.createId === $store.state.user.id && (scope.row.filedType === '3' || scope.row.filedType === '4')" type="text" size="small" @click="filedAndClose(scope.row.id)">修改</el-button>
               <!--归档撤回-->
               <el-button v-if="hasPermission('cw:workContract:back') && scope.row.status === '5' && scope.row.filedType === '2'" type="text"  size="small" @click="rebackFiled(scope.row)">撤回</el-button>
-              </template>
+              <!--合同借用-->
+              <el-button v-if="hasPermission('sys:workContract:borrow') && scope.row.status === '5' && scope.row.filedType === '5' && (scope.row.borrowType === undefined || scope.row.borrowType === '0' || scope.row.borrowType === '1')" type="text" size="small" @click="borrow(scope.row.id)">借用</el-button>
+              <!--借用撤回-->
+              <el-button v-if="hasPermission('sys:workContract:back') && scope.row.status === '5' && scope.row.filedType === '5' && scope.row.borrowType === '2'" type="text" size="small" @click="rebackBorrow(scope.row)">撤回</el-button>
+              <!--借用归还-->
+              <el-button v-if="hasPermission('sys:workContract:reture') && scope.row.status === '5' && scope.row.filedType === '5' && scope.row.borrowType === '5'" type="text" size="small" @click="retureBorrow(scope.row)">归还合同</el-button>
+            </template>
           </vxe-column>
         </vxe-table>
         <vxe-pager
@@ -181,7 +192,8 @@
   import ContractInfoService from '../../../../api/cw/workContract/ContractInfoService'
   // import WorkContractFileService from '@/api/sys/WorkContractFileService'
   import ContractFileService from '@/api/cw/workContract/ContractFileService'
-  import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
+  // import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
+  import CwWorkContractBorrowService from '@/api/cw/workContract/CwWorkContractBorrowService'
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
   import TaskService from '@/api/flowable/TaskService'
   import ProcessService from '@/api/flowable/ProcessService'
@@ -225,7 +237,8 @@
     // workContractService: null,
     contractInfoService: null,
     contractFileService: null,
-    workContractBorrowService: null,
+    // workContractBorrowService: null,
+    cwWorkContractBorrowService: null,
     taskService: null,
     processService: null,
     userService: null,
@@ -233,7 +246,8 @@
       // this.workContractService = new WorkContractService()
       this.contractInfoService = new ContractInfoService()
       this.contractFileService = new ContractFileService()
-      this.workContractBorrowService = new WorkContractBorrowService()
+      this.cwWorkContractBorrowService = new CwWorkContractBorrowService()
+      // this.workContractBorrowService = new WorkContractBorrowService()
       this.taskService = new TaskService()
       this.processService = new ProcessService()
       this.userService = new UserService()
@@ -510,17 +524,25 @@
         }
         if (type === 'rebackBorrow') {
           row.borrowType = '0'
-          this.workContractBorrowService.updateStatusByContractInfoId(row).then(() => {
-            this.workContractBorrowService.deleteById(row.id)
+          this.cwWorkContractBorrowService.updateStatusByContractInfoId(row).then(() => {
+            this.cwWorkContractBorrowService.deleteById(row.id)
           })
+          // this.workContractBorrowService.updateStatusByContractInfoId(row).then(() => {
+          //   this.workContractBorrowService.deleteById(row.id)
+          // })
         }
         if (type === 'retureBorrow') {
           row.borrowType = '0'
-          this.workContractBorrowService.updateStatusByContractInfoId(row).then(() => {
+          this.cwWorkContractBorrowService.updateStatusByContractInfoId(row).then(() => {
             row.type = 'reture'
             row.borrowType = '5'
-            this.workContractBorrowService.updateMessageStatusById(row)
+            this.cwWorkContractBorrowService.updateMessageStatusById(row)
           })
+          // this.workContractBorrowService.updateStatusByContractInfoId(row).then(() => {
+          //   row.type = 'reture'
+          //   row.borrowType = '5'
+          //   this.workContractBorrowService.updateMessageStatusById(row)
+          // })
         }
       },
       is () {
@@ -617,6 +639,79 @@
             }
           })
         }
+      },
+      // 借用
+      borrow (id) {
+        this.processService.getByName('财务-合同登记借用').then(({data}) => {
+          if (!this.commonJS.isEmpty(data.id)) {
+            console.log('data', data)
+            // 读取流程表单
+            let tabTitle = `发起流程【财务-合同登记借用】`
+            let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [财务-合同登记借用]`
+            this.taskService.getTaskDef({ procDefId: data.id,
+              businessId: id,
+              businessTable: 'cw_work_contract_borrow',
+              status: 'startAndCloseBorrow'}).then((reture) => {
+                this.$router.push({
+                  path: '/flowable/task/TaskForm',
+                  query: {
+                    procDefId: data.id,
+                    procDefKey: data.key,
+                    status: 'startAndCloseBorrow',
+                    title: tabTitle,
+                    formType: reture.data.formType,
+                    formUrl: reture.data.formUrl,
+                    formTitle: processTitle,
+                    businessTable: 'cw_work_contract_borrow',
+                    businessId: id,
+                    isShow: false,
+                    routePath: '/cw/workContract/ContractRegistration'
+                  }
+                })
+              })
+          }
+        })
+      },
+      // 借用详情
+      detailBorrow (row) {
+        this.$refs.workContractBorrowMessageForm.findList(row.id)
+      },
+      // 借用撤回
+      rebackBorrow (row) {
+        this.$confirm(`确定撤回流程吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          taskId: row.taskBorrowId,
+          type: 'warning'
+        }).then(() => {
+          console.log('datas', row.taskBorrowId)
+          this.taskService.backNodes(row.taskBorrowId).then(({data}) => {
+            let backNodes = data
+            if (backNodes.length > 0) {
+              let backTaskDefKey = backNodes[0].taskDefKey
+              this.taskService.back({
+                taskId: row.taskBorrowId,
+                backTaskDefKey: backTaskDefKey,
+                isShow: false,
+                ...this.auditForm
+              }).then(({data}) => {
+                this.updateStatusById(row, 'rebackBorrow')
+                this.$message.success('回退成功')
+              })
+            }
+          })
+        })
+      },
+      // 归还合同
+      retureBorrow (row) {
+        this.$confirm(`确定归还合同吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.updateStatusById(row, 'retureBorrow')
+          this.refreshList()
+        })
       }
     }
   }

+ 90 - 13
src/views/modules/cw/workContract/ContractRegistrationForm.vue

@@ -67,7 +67,18 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="合同金额(元)" prop="contractAmount"
+          <el-form-item label="合同金额类别" prop="contractAmountType"
+                        :rules="[
+                  {required: true, message:'请选择合同金额类别', trigger:'blur'}
+               ]">
+            <el-radio-group v-model="inputForm.contractAmountType">
+              <el-radio v-for="item in $dictUtils.getDictList('contract_amount_type')" :label="item.value" >{{item.label}}</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="合同金额(元)" prop="contractAmount" v-if="inputForm.contractAmountType === '1'"
                         :rules="[
                   {required: true, message:'请输入合同金额(元)', trigger:'blur'}
                ]">
@@ -92,11 +103,35 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="付款约定" prop="paymentAgreement">
-            <el-input maxlength="64" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
+          <el-form-item label="对方合同编号" prop="contractOpposite">
+            <el-input maxlength="64" v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <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.value">
+                {{item.label}}
+              </el-checkbox>
+            </el-checkbox-group>
           </el-form-item>
         </el-col>
 
+        <el-col :span="24">
+          <el-form-item prop="contractFee">
+            <el-input style="width: 100%" placeholder="请选择收费标准" v-model="inputForm.contractFee"></el-input>
+          </el-form-item>
+        </el-col>
+
+<!--        <el-row>-->
+<!--          -->
+<!--        </el-row>-->
+
+<!--        <el-row>-->
+<!--          -->
+<!--        </el-row>-->
+
         <el-col :span="12">
           <el-form-item label="修改次数" prop="changeNum"
                         :rules="[{required: true, message: '修改次数', trigger: 'blur'}
@@ -115,7 +150,7 @@
                   children: 'children'    // 子级字段名
                 }"
 
-              :url="`/sys/office/treeData?type=2`"
+              :url="`/sys/office/treeData?type=1`"
               :value="inputForm.department"
               :accordion="true"
               size="medium"
@@ -125,18 +160,21 @@
 
         <el-col :span="12">
           <el-form-item label="委托方联系人" prop="clientContacts"
-                        :rules="[{required: true, message: '委托方联系人', trigger: 'blur'}
+                        :rules="[
+                          // {required: true, message: '委托方联系人', trigger: 'blur'}
                  ]">
-            <el-input maxlength="100" v-model="inputForm.clientContacts" placeholder="请输入委托方联系人"></el-input>
+            <el-input maxlength="100" @focus="openWorkClient2()" v-model="inputForm.clientContacts" placeholder="请选择委托方联系人">
+              <el-button slot="append"  icon="el-icon-search" @click="openWorkClient2()"></el-button>
+            </el-input>
           </el-form-item>
         </el-col>
 
         <el-col :span="12">
           <el-form-item label="委托方联系人电话" prop="clientContactsPhone"
-                        :rules="[{required: true, message: '委托方联系人电话', trigger: 'blur'}
+                        :rules="[
+                          // {required: true, message: '委托方联系人电话', trigger: 'blur'}
                  ]">
-            <el-input maxlength="15" v-model="inputForm.clientContactsPhone" placeholder="请输入委托方联系人电话"
-                      @keyup.native="inputForm.clientContactsPhone = twoDecimalPlaces(inputForm.clientContactsPhone)"
+            <el-input maxlength="15" :disabled="true" v-model="inputForm.clientContactsPhone" placeholder="请输入委托方联系人电话"
             ></el-input>
           </el-form-item>
         </el-col>
@@ -162,6 +200,12 @@
           </el-form-item>
         </el-col>
 
+        <el-col :span="12">
+          <el-form-item label="付款约定" prop="paymentAgreement">
+            <el-input maxlength="64" type="textarea" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
+          </el-form-item>
+        </el-col>
+
       </el-row>
 
       <el-tabs v-model="activeName" type="border-card" @tab-click="tabHandleClick">
@@ -282,6 +326,8 @@
           customerName: ''
         },
         inputForm: {
+          contractFees: [],
+          contractFee: '',
           contractNo: '',
           contractName: '',
           payerSubject: '',
@@ -300,7 +346,10 @@
           createId: JSON.parse(localStorage.getItem('user')).id,
           createDate: '',
           contractProperList: [],
-          cwWorkClientContactDTOList: []
+          cwWorkClientContactDTOList: [],
+          contractAmountType: '',
+          contractOpposite: '',
+          fees: ''
         },
         activeName: 'contractProper',
         filesArra2: [],
@@ -409,11 +458,14 @@
         this.method = method
         console.log('method', method)
         this.inputForm = {
+          contractFees: [],
+          contractFee: '',
           contractNo: '',
           contractName: '',
           payerSubject: '',
           paymentMethod: '',
           signingDate: '',
+          fees: '',
           contractAmount: '',
           actualContractAmount: '',
           contractNum: '',
@@ -427,7 +479,9 @@
           createId: JSON.parse(localStorage.getItem('user')).id,
           createDate: '',
           contractProperList: [],
-          cwWorkClientContactDTOList: []
+          cwWorkClientContactDTOList: [],
+          contractAmountType: '',
+          contractOpposite: ''
         }
         this.inputForm.id = id
         if (method === 'add') {
@@ -526,6 +580,9 @@
       openWorkClient () {
         this.$refs.workClientChooseForm.init()
       },
+      openWorkClient2 () {
+        this.$refs.workClientChooseForm.init()
+      },
       getWorkClientChoose (list) {
         console.log('list', list)
         if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
@@ -563,6 +620,7 @@
         } else {
           this.loading = true
           this.inputForm.status = '1'
+          this.inputForm.fees = this.inputForm.contractFees.join(',')
           this.inputForm.contractProperList = this.$refs.uploadComponent.getDataList()
           console.log('this.inputForm', this.inputForm)
           await this.contractInfoService.save(this.inputForm).then(({data}) => {
@@ -586,7 +644,7 @@
               this.loading = true
               this.inputForm.status = '2'
               this.inputForm.contractProperList = this.$refs.uploadComponent.getDataList()
-              // this.inputForm.fees = this.inputForm.contractFees.join(',')
+              this.inputForm.fees = this.inputForm.contractFees.join(',')
               await this.contractInfoService.save(this.inputForm).then(({data}) => {
                 callback(data.businessTable, data.businessId, this.inputForm)
                 this.$refs.inputForm.resetFields()
@@ -610,7 +668,7 @@
               this.loading = true
               this.inputForm.status = '2'
               this.inputForm.contractProperList = this.$refs.uploadComponent.getDataList()
-              // this.inputForm.fees = this.inputForm.contractFees.join(',')
+              this.inputForm.fees = this.inputForm.contractFees.join(',')
               await this.contractInfoService.save(this.inputForm).then(({data}) => {
                 callback(data.businessTable, data.businessId, this.inputForm)
                 this.$refs.inputForm.resetFields()
@@ -623,6 +681,25 @@
           })
         }
       },
+      changeContractFee () {
+        let fee = ''
+        let fees = this.inputForm.contractFees
+        if (fees.length > 0) {
+          fees.forEach(i => {
+            if (i === '1') {
+              i = '发改价格[2009]2914号'
+              fee = fee + ';' + i
+            }
+            if (i === '2') {
+              i = '其他'
+              fee = fee + ';' + i
+            }
+            this.inputForm.contractFee = fee.substring(1, fee.length)
+          })
+        } else {
+          this.inputForm.contractFee = ''
+        }
+      },
       close () {
         this.$refs.inputForm.resetFields()
         this.inputForm.clientName = ''

+ 376 - 0
src/views/modules/cw/workContract/CwWorkContractBorrowForm.vue

@@ -0,0 +1,376 @@
+<template>
+<div>
+  <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+           label-width="150px">
+    <el-row  :gutter="0">
+      <el-col :span="12">
+        <el-form-item label="合同名称" prop="contractName">
+          <el-input :disabled="true" v-model="inputForm.contractName"></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="合同编号" prop="contractNo">
+          <el-input :disabled="true" v-model="inputForm.contractNo"></el-input>
+        </el-form-item>
+      </el-col>
+
+<!--      <el-col :span="12">-->
+<!--        <el-form-item label="客户名称" prop="clientName">-->
+<!--          <el-input :disabled="true" v-model="inputForm.clientName"></el-input>-->
+<!--        </el-form-item>-->
+<!--      </el-col>-->
+
+      <el-col :span="12">
+        <el-form-item label="借用人" prop="borrowName">
+          <el-input :disabled="true" v-model="inputForm.borrowName"></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="借用日期" prop="borrowData" :rules="[
+                  {required: true, message:'请填写借用日期', trigger:'blur'}
+               ]">
+          <el-date-picker
+            :disabled="this.inputForm.borrowType === '2'"
+            v-model="inputForm.borrowData"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="大概归还日期" prop="borrowRetData" :rules="[
+                  {required: true, message:'请填写大概归还日期', trigger:'blur'}
+               ]">
+          <el-date-picker
+            :disabled="this.inputForm.borrowType === '2'"
+            v-model="inputForm.borrowRetData"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+
+    </el-row>
+
+    <el-form-item label="备注" prop="remarks">
+      <el-input v-model="inputForm.remarks"
+                :disabled="this.inputForm.borrowType === '2'"
+                type="textarea"
+                :rows="5"
+                maxlength="500"
+                placeholder="请输入备注"
+                show-word-limit>
+      </el-input>
+    </el-form-item>
+
+  </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 type="info" :disabled="true" style="margin-bottom: 15px" size="mini"  @click="openWorkClient">
+          新增参与签约方
+        </el-button>
+      </el-row>
+      <el-row  :gutter="15">
+        <el-form :disabled="method === 'view'">
+          <vxe-table
+            border
+            show-overflow
+            show-footer
+            :column-config="{resizable: true}"
+            ref="contactTable"
+            :key="tableKeyClient"
+            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-table-column align="center" field="no" title="客户编号" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input :readonly="true" v-model="scope.row.no" placeholder="客户编号" clearable></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column align="center" field="name" title="客户名称" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input :readonly="true" v-model="scope.row.name" placeholder="客户名称" clearable></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column align="center" title="操作" width="100">
+              <template v-slot="scope">
+                <el-button size="mini" :disabled="true" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'client')">删除</el-button>
+              </template>
+            </vxe-table-column>
+          </vxe-table>
+        </el-form>
+      </el-row>
+    </el-tab-pane>
+    <el-tab-pane label="合同归档文件" name="archiveFile">
+      <!--        合同归档文件-->
+      <UpLoadComponent ref="archiveFile"></UpLoadComponent>
+    </el-tab-pane>
+
+  </el-tabs>
+  <WorkClientChooseForm ref="workClientChooseForm" @getWorkClientChoose="getWorkClientChoose"></WorkClientChooseForm>
+</div>
+</template>
+
+<script>
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  // import WorkContractService from '@/api/sys/WorkContractService'
+  import ContractInfoService from '@/api/cw/workContract/ContractInfoService'
+  // import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
+  import CwWorkContractBorrowService from '@/api/cw/workContract/CwWorkContractBorrowService'
+  import WorkClientChooseForm from '../workClientInfo/WorkClientChooseForm'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          cwWorkClientContactDTOList: [],
+          id: '',
+          contractName: '',
+          contractNo: '',
+          borrowName: '',
+          borrowData: '',
+          borrowRetData: '',
+          remarks: '',
+          borrowType: '',
+          type: ''
+        },
+        tableKeyClient: '1',
+        activeName: 'uploadFile'
+      }
+    },
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      }
+    },
+    components: {
+      UpLoadComponent,
+      WorkClientChooseForm
+    },
+    // workContractBorrowService: null,
+    cwWorkContractBorrowService: null,
+    // workContractService: null,
+    contractInfoService: null,
+    created () {
+      // this.workContractBorrowService = new WorkContractBorrowService()
+      this.cwWorkContractBorrowService = new CwWorkContractBorrowService()
+      this.contractInfoService = new ContractInfoService()
+      // this.workContractService = new WorkContractService()
+    },
+    watch: {
+      'businessId': {
+        handler (newVal) {
+          if (this.businessId) {
+            this.init(this.businessId)
+          } else {
+            this.$nextTick(() => {
+              this.$refs.inputForm.resetFields()
+            })
+          }
+        },
+        immediate: true,
+        deep: false
+      }
+    },
+    computed: {
+      userName () {
+        return JSON.parse(localStorage.getItem('user')).name
+      }
+    },
+    methods: {
+      init (id) {
+        if (id) {
+          this.loading = true
+          this.inputForm.id = id
+          this.$nextTick(() => {
+            console.log('id', id)
+            this.$refs.inputForm.resetFields()
+            this.cwWorkContractBorrowService.findById(this.inputForm.id).then(({data}) => {
+              if (this.commonJS.isEmpty(data.id)) {
+                this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
+                  this.inputForm = this.recover(this.inputForm, data)
+                  this.inputForm.borrowName = this.userName
+                  this.inputForm.borrowData = new Date()
+                  this.$refs.uploadFile.newUpload('view', data.contractProperList, 'cwWorkContract', null, null, null, null, false)
+                  this.$refs.archiveFile.newUpload('view', data.contractInfoList, 'cwWorkContract', null, null, null, null, false)
+                  console.log('data', data)
+                  this.loading = false
+                })
+                // this.workContractService.findById(this.inputForm.id).then(({data}) => {
+                //   this.inputForm = this.recover(this.inputForm, data)
+                //   this.inputForm.borrowName = this.userName
+                //   this.inputForm.borrowData = new Date()
+                //   this.loading = false
+                // })
+              } else {
+                this.inputForm = this.recover(this.inputForm, data)
+                this.inputForm.borrowName = this.userName
+                this.inputForm.borrowData = new Date()
+                this.loading = false
+              }
+            })
+            // this.workContractBorrowService.findById(this.inputForm.id).then(({data}) => {
+            //   if (this.commonJS.isEmpty(data.id)) {
+            //     this.workContractService.findById(this.inputForm.id).then(({data}) => {
+            //       this.inputForm = this.recover(this.inputForm, data)
+            //       this.inputForm.borrowName = this.userName
+            //       this.inputForm.borrowData = new Date()
+            //       this.loading = false
+            //     })
+            //   } else {
+            //     this.inputForm = this.recover(this.inputForm, data)
+            //     this.inputForm.borrowName = this.userName
+            //     this.inputForm.borrowData = new Date()
+            //     this.loading = false
+            //   }
+            // })
+          })
+        }
+      },
+      tabHandleClick (event) {
+        // console.log(event)
+      },
+      openWorkClient () {
+        this.$refs.workClientChooseForm.init()
+      },
+      removeEvent (row, rowIndex, type) {
+        if (type === 'client') {
+          this.$refs.contactTable.remove(row)
+          this.inputForm.cwWorkClientContactDTOList.splice(rowIndex, 1)
+        }
+      },
+      getWorkClientChoose (list) {
+        // console.log('list', list)
+        if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
+          this.inputForm.cwWorkClientContactDTOList = []
+        }
+        let _this = this
+        let _list = list
+        const waitForEach = function () {
+          return new Promise(function (resolve, reject) {
+            _list.forEach((item) => {
+              _this.inputForm.cwWorkClientContactDTOList.forEach(client => {
+                if (item.no === client.no) {
+                  _this.$message.error('已存在客户 “' + client.name + '”,请重新选择')
+                  throw new Error('已存在客户 “' + client.name + '”,请重新选择')
+                }
+              })
+            })
+            resolve()
+          })
+        }
+        waitForEach().then(() => {
+          list.forEach(item => {
+            this.$refs.contactTable.insertAt(item)
+            this.inputForm.cwWorkClientContactDTOList.push(item)
+            this.tableKeyClient = Math.random()
+          })
+        })
+      },
+      // 表单提交
+      startForm (callback) {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            let id = this.inputForm.id
+            this.loading = true
+            this.inputForm.contractInfoId = id
+            this.inputForm.borrowType = '2'
+            console.log('dosubmit', this.inputForm)
+            this.cwWorkContractBorrowService.save(this.inputForm).then(({data}) => {
+              callback(data.businessTable, data.businessId, this.inputForm)
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            }).catch(() => {
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            })
+            // this.workContractBorrowService.save(this.inputForm).then(({data}) => {
+            //   callback(data.businessTable, data.businessId, this.inputForm)
+            //   this.$refs.inputForm.resetFields()
+            //   this.loading = false
+            // }).catch(() => {
+            //   this.$refs.inputForm.resetFields()
+            //   this.loading = false
+            // })
+          }
+        })
+      },
+      // 同意
+      agreeForm (callback) {
+        this.inputForm.borrowType = '5'
+        this.cwWorkContractBorrowService.updateMessageStatusById(this.inputForm).then(({data}) => {
+          callback(data.businessTable, data.businessId, this.inputForm)
+          this.$refs.inputForm.resetFields()
+          this.loading = false
+        }).catch(() => {
+          this.$refs.inputForm.resetFields()
+          this.loading = false
+        })
+        // this.workContractBorrowService.updateMessageStatusById(this.inputForm).then(({data}) => {
+        //   callback(data.businessTable, data.businessId, this.inputForm)
+        //   this.$refs.inputForm.resetFields()
+        //   this.loading = false
+        // }).catch(() => {
+        //   this.$refs.inputForm.resetFields()
+        //   this.loading = false
+        // })
+      },
+      // 关闭
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.visible = false
+        this.businessId = ''
+      },
+      // 更改状态
+      updateStatusById (type) {
+        console.log('updateStatusById', this.inputForm)
+        if (type === 'agree') {
+          this.inputForm.borrowType = '5'
+          this.cwWorkContractBorrowService.updateStatusById(this.inputForm)
+          // this.workContractBorrowService.updateStatusById(this.inputForm)
+        }
+        if (type === 'reject') {
+          this.inputForm.borrowType = '0'
+          this.cwWorkContractBorrowService.updateStatusById(this.inputForm).then(() => {
+            this.inputForm.borrowType = '3'
+            this.inputForm.type = 'reject'
+            this.cwWorkContractBorrowService.updateMessageStatusById(this.inputForm)
+          })
+          // this.workContractBorrowService.updateStatusById(this.inputForm).then(() => {
+          //   this.inputForm.borrowType = '3'
+          //   this.inputForm.type = 'reject'
+          //   this.workContractBorrowService.updateMessageStatusById(this.inputForm)
+          // })
+        }
+        if (type === 'reback') {
+          this.inputForm.borrowType = '0'
+          this.cwWorkContractBorrowService.updateStatusById(this.inputForm)
+          // this.workContractBorrowService.updateStatusById(this.inputForm)
+        }
+      }
+    }
+  }
+</script>
+
+

+ 12 - 5
src/views/modules/cw/workContract/WorkContractBorrowMessageForm.vue

@@ -26,7 +26,7 @@
                 :data="dataList"
                 :checkbox-config="{}">
 
-                <vxe-column width="300px" title="合同名称" field="name"></vxe-column>
+                <vxe-column width="300px" title="合同名称" field="contractName"></vxe-column>
                 <vxe-column width="100px" title="借用人" field="borrowName" ></vxe-column>
                 <vxe-column width="100px" title="借用状态" field="borrowType" >
                   <template slot-scope="scope">
@@ -49,7 +49,8 @@
 </template>
 
 <script>
-  import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
+  // import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
+  import CwWorkContractBorrowService from '@/api/cw/workContract/CwWorkContractBorrowService'
   export default {
     data () {
       return {
@@ -59,9 +60,11 @@
         dataList: []
       }
     },
-    workContractBorrowService: null,
+    cwWorkContractBorrowService: null,
+    // workContractBorrowService: null,
     created () {
-      this.workContractBorrowService = new WorkContractBorrowService()
+      this.cwWorkContractBorrowService = new CwWorkContractBorrowService()
+      // this.workContractBorrowService = new WorkContractBorrowService()
     },
     methods: {
       // 获取数据列表
@@ -69,10 +72,14 @@
         this.loading = true
         this.visible = true
         this.title = '合同借用详情'
-        this.workContractBorrowService.findMessageList(id).then(({data}) => {
+        this.cwWorkContractBorrowService.findMessageList(id).then(({data}) => {
           this.dataList = data
           this.loading = false
         })
+        // this.workContractBorrowService.findMessageList(id).then(({data}) => {
+        //   this.dataList = data
+        //   this.loading = false
+        // })
       },
       close () {
         this.visible = false