Browse Source

财务-纸质归档

wangqiang 2 years atrás
parent
commit
7a38767caf

+ 25 - 0
src/api/cw/workContract/ContractFilePaperService.js

@@ -0,0 +1,25 @@
+import request from '@/utils/httpRequest'
+
+export default class ContractFilePaperService {
+  save (param) {
+    return request({
+      url: '/contract/contractPaperFile/save',
+      method: 'post',
+      data: param
+    })
+  }
+  updateStatusById (param) {
+    return request({
+      url: '/contract/contractPaperFile/updateStatusById',
+      method: 'post',
+      data: param
+    })
+  }
+  findByContractInfoId (id) {
+    return request({
+      url: '/contract/contractPaperFile/findByContractInfoId',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+}

+ 41 - 48
src/views/modules/cw/workContract/ContractFileForm.vue

@@ -179,40 +179,30 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item  prop="department" label="所属部门">
-            <SelectTree
-              ref="officeTree"
-              :props="{
-                  value: 'id',             // ID字段名
-                  label: 'name',         // 显示名称
-                  children: 'children'    // 子级字段名
-                }"
-              :disabled="true"
-              :url="`/sys/office/treeData?type=1`"
-              :value="inputForm.department"
-              :accordion="true"
-              size="medium"
-              @getValue="(value) => {inputForm.department=value}"/>
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="12">
-          <el-form-item label="案卷号" prop="filedNo"
-                        :rules="[{required: true, message: '请输入案卷号', trigger: 'blur'}
+          <el-form-item label="所属部门" prop="departmentName"
+                        :rules="[{required: true, message: '所属部门', trigger: 'blur'}
                  ]">
-            <el-input maxlength="15" v-model="inputForm.filedNo" placeholder="请输入案卷号"
-            ></el-input>
+            <el-input maxlength="64" :disabled="true" v-model="inputForm.departmentName" 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="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"
@@ -339,6 +329,7 @@
         visible: false,
         loading: false,
         returnForm: {
+          departmentName: '', // 部门名称
           customerId: '',  // 客户id
           uscCode: '',
           filedNo: '',
@@ -366,6 +357,7 @@
           contractFees: []
         },
         inputForm: {
+          departmentName: '', // 部门名称
           customerId: '',  // 客户id
           uscCode: '',
           customerNo: '',
@@ -477,14 +469,14 @@
       }
     },
     methods: {
-      checkFiledNo () {
-        let filedNo = this.inputForm.filedNo
-        let confirmFiledNo = this.inputForm.confirmFiledNo
-        if (filedNo !== confirmFiledNo) {
-          this.$message.warning(`案卷号和确认案卷号不一致`)
-          this.inputForm.confirmFiledNo = ''
-        }
-      },
+      // 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
       },
@@ -515,6 +507,7 @@
         this.dataListNew = []
         this.method = method
         this.inputForm = {
+          departmentName: '', // 部门名称
           customerId: '',  // 客户id
           uscCode: '',
           customerNo: '',
@@ -823,16 +816,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('请填写确认案卷号')
-          }
+          // 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

+ 991 - 0
src/views/modules/cw/workContract/ContractFilePaperForm.vue

@@ -0,0 +1,991 @@
+<template>
+  <div>
+    <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="formReadOnly"
+             label-width="150px">
+
+      <el-divider content-position="left"><i class="el-icon-document"></i> 客户信息</el-divider>
+      <el-row  :gutter="0">
+        <el-col :span="12">
+          <el-form-item label="委托方联系人" prop="clientContacts"
+                        :rules="[
+                          // {required: true, message: '委托方联系人', trigger: 'blur'}
+                 ]">
+            <el-input maxlength="100" :disabled="true" @focus="openWorkClient2()" v-model="inputForm.clientContacts" placeholder="请选择委托方联系人">
+              <el-button slot="append" :disabled="true" icon="el-icon-search" @click="openWorkClient2()"></el-button>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="客户编号" prop="customerNo"
+                        :rules="[
+                   ]">
+            <el-input :disabled="true" v-model="inputForm.customerNo" placeholder="请填写客户编号" clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="统一社会信用代码" prop="uscCode"
+                        :rules="[
+                   ]">
+            <el-input :disabled="true" v-model="inputForm.uscCode" placeholder="请填写统一社会信用代码" clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="委托方联系人电话" prop="clientContactsPhone"
+                        :rules="[
+                          // {required: true, message: '委托方联系人电话', trigger: 'blur'}
+                 ]">
+            <el-input maxlength="15" :disabled="true" v-model="inputForm.clientContactsPhone" placeholder="请输入委托方联系人电话"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="地址" prop="address"
+                        :rules="[
+                   ]">
+            <el-input :disabled="true" v-model="inputForm.address" placeholder="地址" clearable></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-divider content-position="left"><i class="el-icon-document"></i> 基本信息</el-divider>
+      <el-row  :gutter="0">
+        <el-col :span="12">
+          <el-form-item label="合同名称" prop="contractName"
+                        :rules="[{required: true, message: '合同名称不能为空', trigger: 'blur'}
+                 ]">
+            <el-input v-model="inputForm.contractName" :disabled="true" placeholder="请输入合同名称"     clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="合同编号" prop="contractNo">
+            <el-input maxlength="64" :disabled="true" v-model="inputForm.contractNo" placeholder="自动生成"></el-input>
+          </el-form-item>
+        </el-col>
+        <!--        <el-col :span="12">-->
+        <!--          <el-form-item label="合同状态" prop="contractStatus">-->
+        <!--            <el-input maxlength="64" v-model="inputForm.contractStatus" :disabled="true" placeholder="请输入合同状态"></el-input>-->
+        <!--          </el-form-item>-->
+        <!--        </el-col>-->
+        <el-col :span="12">
+          <el-form-item label="付款主体" prop="payerSubject"
+                        :rules="[{required: true, message: '付款主体不能为空', trigger: 'blur'}
+                 ]">
+            <el-select :disabled="true" v-model="inputForm.payerSubject" placeholder="请选择付款主体" style="width:100%;">
+              <el-option
+                v-for="item in $dictUtils.getDictList('cw_payment_subject')"
+                :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="paymentMethod"
+                        :rules="[{required: true, message: '付款方式不能为空', trigger: 'blur'}
+                 ]">
+            <el-select :disabled="true" v-model="inputForm.paymentMethod" placeholder="请选择付款方式" style="width:100%;">
+              <el-option
+                v-for="item in $dictUtils.getDictList('cw_payment_method')"
+                :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="signingDate"
+                        :rules="[
+                {required: true, message:'请输入签约日期', trigger:'blur'}
+               ]">
+            <el-date-picker
+              :disabled="true"
+              placement="bottom-start"
+              value-format="yyyy-MM-dd"
+              v-model="inputForm.signingDate"
+              style="width: 100%"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <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'}
+               ]">
+            <el-input maxlength="15" :disabled="true" v-model="inputForm.contractAmount" placeholder="请输入合同金额(元)"
+                      @keyup.native="inputForm.contractAmount = twoDecimalPlaces(inputForm.contractAmount)"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="合同实际金额" prop="actualContractAmount"
+                        :rules="[{required: true, message: '请填写合同实际金额', trigger: 'blur'}
+                 ]">
+            <el-input maxlength="64" :disabled="true" v-model="inputForm.actualContractAmount" ></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="合同份数" prop="contractNum"
+                        :rules="[{required: true, message: '合同份数', trigger: 'blur'}
+                 ]">
+            <el-input maxlength="64" :disabled="true" v-model="inputForm.contractNum" placeholder="请输入合同份数"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="对方合同编号" prop="contractOpposite">
+            <el-input maxlength="64" :disabled="true" 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" :disabled="true" 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%" :disabled="true" placeholder="请选择收费标准" v-model="inputForm.contractFee"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="修改次数" prop="changeNum"
+                        :rules="[{required: true, message: '修改次数', trigger: 'blur'}
+                 ]">
+            <el-input maxlength="64" :disabled="true" v-model="inputForm.changeNum" placeholder="请输入修改次数"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="所属部门" prop="departmentName"
+                        :rules="[{required: true, message: '所属部门', trigger: 'blur'}
+                 ]">
+            <el-input maxlength="64" :disabled="true" v-model="inputForm.departmentName" placeholder="请输入所属部门"></el-input>
+          </el-form-item>
+<!--          <el-form-item  prop="department" label="所属部门">-->
+<!--            <SelectTree-->
+<!--              ref="officeTree"-->
+<!--              :props="{-->
+<!--                  value: 'id',             // ID字段名-->
+<!--                  label: 'name',         // 显示名称-->
+<!--                  children: 'children'    // 子级字段名-->
+<!--                }"-->
+<!--              :disabled="true"-->
+<!--              :url="`/sys/office/treeData?type=1`"-->
+<!--              :value="inputForm.department"-->
+<!--              :accordion="true"-->
+<!--              size="medium"-->
+<!--              @getValue="(value) => {inputForm.department=value}"/>-->
+<!--          </el-form-item>-->
+        </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'}
+                 ]">
+            <el-input maxlength="64" :disabled="true" v-model="inputForm.createBy" placeholder="请输入创建人"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="创建时间" prop="createDate">
+            <el-date-picker
+              placement="bottom-start"
+              value-format="yyyy-MM-dd"
+              v-model="inputForm.createDate"
+              style="width: 100%"
+              :disabled="true"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="付款约定" prop="paymentAgreement">
+            <el-input maxlength="64" :disabled="true" type="textarea" 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">
+        <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>
+
+
+      <el-image-viewer
+        v-if="showViewer"
+        :on-close="closeViewer"
+        :url-list="[url]"
+        zIndex="9999"/>
+    <WorkClientChooseForm ref="workClientChooseForm" @getWorkClientChoose="getWorkClientChoose"></WorkClientChooseForm>
+    <WorkClientChooseRadio ref="workClientChooseRadio" @getWorkClientRadioChoose="getWorkClientChoose2"></WorkClientChooseRadio>
+  </div>
+</template>
+
+<script>
+  import ContractInfoService from '@/api/cw/workContract/ContractInfoService'
+  import ContractFilePaperService from '@/api/cw/workContract/ContractFilePaperService'
+  // 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 WorkClientChooseRadio from '../workClientInfo/WorkClientChooseRadio'
+  import OSSSerive, {
+    httpRequest,
+    toHref,
+    openWindowOnUrl,
+    handleRemove,
+    fileName
+  } from '@/api/sys/OSSService'
+  import moment from 'moment'
+  import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
+  export default {
+    data () {
+      return {
+        visable: false,
+        gridData: [],
+        radio: 0,
+        tableData: [],
+        dataList: [],
+        dataListNew: [],
+        title: '',
+        method: '',
+        isSubmit: false,
+        visible: false,
+        loading: false,
+        returnForm: {
+          departmentName: '', // 部门名称
+          customerId: '',  // 客户id
+          uscCode: '',
+          filedNo: '',
+          confirmFiledNo: '',
+          clientId: '',
+          name: '',
+          contractDate: '',
+          effectiveDate: '',
+          closingDate: '',
+          contractType: '',
+          contractAmountType: '',
+          contractAmount: '',
+          contractOpposite: '',
+          fees: '',
+          contractFee: '',
+          describes: '',
+          contractSpecial: '',
+          remarks: '',
+          clientName: '',
+          status: '',
+          contractProperList: [],
+          contractInfoList: [],
+          customerNo: '',
+          customerName: '',
+          contractFees: []
+        },
+        inputForm: {
+          departmentName: '', // 部门名称
+          customerId: '',  // 客户id
+          uscCode: '',
+          customerNo: '',
+          contractFee: '',
+          contractFees: [],
+          contractOpposite: '',
+          contractAmountType: '',
+          contractNo: '',
+          contractName: '',
+          payerSubject: '',
+          paymentMethod: '',
+          contractInfoId: '',
+          signingDate: '',
+          contractAmount: '',
+          actualContractAmount: '',
+          contractNum: '',
+          contractStatus: '',
+          paymentAgreement: '',
+          changeNum: '',
+          department: '',
+          clientContacts: '',
+          clientContactsPhone: '',
+          contractApprovalType: '',
+          createBy: JSON.parse(localStorage.getItem('user')).name,
+          createId: JSON.parse(localStorage.getItem('user')).id,
+          createDate: '',
+          contractProperList: [],
+          contractInfoList: [],
+          filedNo: '',
+          confirmFiledNo: ''
+        },
+        activeName: 'archiveFile',
+        filesArra2: [],
+        fileList: [],
+        isFlag: true,
+        showViewer: false, // 显示查看器
+        url: '',
+        rowurl: '',
+        src: '',
+        onedit: false,
+        type: '',
+        loadProgress: 0, // 动态显示进度条
+        progressFlag: false, // 关闭进度条
+        promi: null,
+        keyWatch: '',
+        tableKeyClient: '1'
+      }
+    },
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      },
+      status: {
+        type: String,
+        default: ''
+      }
+    },
+    components: {
+      ElImageViewer,
+      UpLoadComponent,
+      WorkClientChooseForm,
+      SelectTree,
+      WorkClientChooseRadio
+    },
+    ossService: null,
+    // workContractService: null,
+    contractInfoService: null,
+    // contractFileService: null,
+    contractFilePaperService: null,
+    created () {
+      this.ossService = new OSSSerive()
+      // this.workContractService = new WorkContractService()
+      this.contractInfoService = new ContractInfoService()
+      // this.contractFileService = new ContractFileService()
+      this.contractFilePaperService = new ContractFilePaperService()
+    },
+    mounted () {
+      window.onPreview = this.onPreview
+    },
+    computed: {
+      officeName () {
+        return JSON.parse(localStorage.getItem('user')).officeDTO.name
+      },
+      bus: {
+        get () {
+          this.$refs.archiveFile.setDividerName('附件', false)
+          this.$refs.uploadFile.setDividerName('附件', false)
+          return this.businessId
+        },
+        set (val) {
+          this.businessId = val
+        }
+      }
+    },
+    watch: {
+      'keyWatch': {
+        handler (newVal) {
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
+          } else {
+            this.$nextTick(() => {
+              this.$refs.inputForm.resetFields()
+            })
+          }
+        }
+      }
+    },
+    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
+      },
+      uploadVideoProcess (event, file, fileList) {
+        this.progressFlag = true // 显示进度条
+        this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
+        if (this.loadProgress >= 100) {
+          this.loadProgress = 100
+          setTimeout(() => { this.progressFlag = false }, 1000) // 一秒后关闭进度条
+        }
+      },
+      async toHref (row) {
+        toHref(row)
+      },
+      onPreview (url) {
+        this.url = url
+        this.showViewer = true
+      },
+      // 关闭查看器
+      closeViewer () {
+        this.url = ''
+        this.showViewer = false
+      },
+      init (method, id) {
+        // console.log(method)
+        // console.log('id', id)
+        this.dataList = []
+        this.dataListNew = []
+        this.method = method
+        this.inputForm = {
+          departmentName: '', // 部门名称
+          customerId: '',  // 客户id
+          uscCode: '',
+          customerNo: '',
+          contractFee: '',
+          contractFees: [],
+          contractOpposite: '',
+          contractAmountType: '',
+          contractNo: '',
+          contractName: '',
+          payerSubject: '',
+          paymentMethod: '',
+          signingDate: '',
+          contractAmount: '',
+          actualContractAmount: '',
+          contractNum: '',
+          contractStatus: '',
+          paymentAgreement: '',
+          changeNum: '',
+          department: this.officeName,
+          clientContacts: '',
+          contractInfoId: '',
+          clientContactsPhone: '',
+          contractApprovalType: '',
+          createBy: JSON.parse(localStorage.getItem('user')).name,
+          createId: JSON.parse(localStorage.getItem('user')).id,
+          createDate: '',
+          contractProperList: [],
+          contractInfoList: [],
+          cwWorkClientContactDTOList: [],
+          filedNo: '',
+          confirmFiledNo: ''
+        }
+        this.inputForm.id = id
+        if (method === 'add') {
+          this.title = `新建合同登记`
+        } else if (method === 'edit') {
+          this.title = '修改合同登记'
+        } else if (method === 'view') {
+          this.inputForm.showVi = false
+          this.title = '查看合同登记'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          this.loading = true
+          this.$refs.uploadFile.clearUpload()
+          this.$refs.archiveFile.clearUpload()
+          // 查询合同登记数据
+          console.log('this.inputForm.id', this.inputForm.id)
+          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'
+            }
+            console.log('data', data)
+            console.log('this.inputForm.department', this.inputForm.department)
+            this.$refs.uploadFile.newUpload('view', this.inputForm.contractProperList, 'cwWorkContract', null, null, null, null, false)
+            this.$refs.archiveFile.newUpload('view', this.inputForm.contractInfoList, 'cwWorkContract', null, null, null, null, false)
+            this.loading = false
+          })
+        }
+        )
+      },
+      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))
+      },
+      removeEvent (row, rowIndex, type) {
+        if (type === 'client') {
+          this.$refs.contactTable.remove(row)
+          this.inputForm.cwWorkClientContactDTOList.splice(rowIndex, 1)
+        }
+      },
+      openWorkClient () {
+        this.$refs.workClientChooseForm.init()
+      },
+      openWorkClient2 () {
+        this.$refs.workClientChooseRadio.init()
+      },
+      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()
+          })
+        })
+      },
+      getWorkClientChoose2 (list) {
+        if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
+          this.inputForm.cwWorkClientContactDTOList = []
+        }
+        console.log('list', list)
+        let _this = this
+        let _list = list
+        const waitForEach = function () {
+          return new Promise(function (resolve, reject) {
+            _this.inputForm.cwWorkClientContactDTOList.forEach(client => {
+              if (_list.no === client.no) {
+                _this.$message.error('已存在客户 “' + client.name + '”,请重新选择')
+                throw new Error('已存在客户 “' + client.name + '”,请重新选择')
+              }
+            })
+            resolve()
+          })
+        }
+        waitForEach().then(() => {
+          // eslint-disable-next-line no-unused-vars
+          let item = {
+            no: list.no,
+            name: list.name
+          }
+          console.log('list', list)
+          this.inputForm.customerNo = list.no
+          this.inputForm.uscCode = list.uscCode
+          this.inputForm.address = list.address
+          this.inputForm.customerId = list.id
+          this.inputForm.cwWorkClientContactDTOList.push(item)
+          this.inputForm.clientContacts = list.name
+          this.inputForm.clientContactsPhone = list.mobile
+        })
+      },
+      // 表单提交
+      // 暂存
+      saveForm (callback) {
+        if (this.$refs.archiveFile.checkProgress() || this.$refs.uploadFile.checkProgress()) {
+          this.loading = false
+          throw new Error()
+        } else {
+          let _this = this
+          const wait = function () {
+            return new Promise((resolve, reject) => {
+              // 合同登记暂存
+              if (_this.status === 'startAndHold' || _this.status === 'startAndHoldFiled') {
+                _this.loading = true
+                if (_this.status === 'startAndHold') {
+                  _this.inputForm.status = '1'
+                }
+                if (_this.status === 'startAndHoldFiled') {
+                  _this.inputForm.status = '5'
+                }
+              }
+              console.log('actualContractAmount', _this.inputForm.actualContractAmount)
+              // eslint-disable-next-line no-unused-vars
+              // 合同登记归档暂存
+              if (_this.status === 'startAndHoldFiled') {
+                _this.inputForm.filedPaperType = '1'
+                _this.inputForm.contractInfoId = _this.businessId
+                _this.inputForm.contractInfoList = _this.$refs.archiveFile.getDataList()
+                console.log('actualContractAmount', _this.inputForm.actualContractAmount)
+                // this.inputForm.contractInfoList = this.$refs.uploadFile.getDataList()
+                _this.contractFilePaperService.save(_this.inputForm).then(() => {
+                  // _this.contractInfoService.updateInfo(_this.inputForm).then(() => {
+                  //   resolve()
+                  // })
+                  resolve()
+                })
+              }
+            })
+          }
+          wait().then(() => {
+            this.$refs.inputForm.resetFields()
+            this.loading = false
+            // this.businessId = ''
+            callback()
+          })
+        }
+      },
+      // 送审
+      startForm (callback) {
+        if (this.$refs.archiveFile.checkProgress() || this.$refs.uploadFile.checkProgress()) {
+          this.loading = false
+          throw new Error()
+        } else {
+          let id = this.inputForm.id
+          this.loading = true
+          this.inputForm.status = '5'
+          this.inputForm.filedPaperType = '2'
+          this.inputForm.contractProperList = []
+          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
+          this.inputForm.contractInfoList = this.$refs.archiveFile.getDataList()
+          // console.log('this.inputForm', this.inputForm)
+          // this.inputForm.contractProperList = this.$refs.uploadFile.getDataList()
+          this.contractFilePaperService.save(this.inputForm).then(({data}) => {
+            // console.log('data', data)
+            callback(data.businessTable, data.businessId, this.inputForm)
+            this.$refs.inputForm.resetFields()
+            this.loading = false
+          })
+          // 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
+          // })
+        }
+      },
+      // 通过
+      agreeForm (callback) {
+        if (this.$refs.archiveFile.checkProgress() || this.$refs.uploadFile.checkProgress()) {
+          this.loading = false
+          throw new Error()
+        } else {
+          let id = this.inputForm.id
+          this.loading = true
+          this.inputForm.status = '5'
+          this.inputForm.filedPaperType = '5'
+          // this.inputForm.contractInfoList = this.$refs.archiveFile.getDataList()
+          this.inputForm.contractProperList = []
+          // console.log('this.inputForm.contractProperList', this.inputForm.contractProperList)
+          // this.contractInfoService.updateInfo(this.inputForm)
+          this.inputForm.contractInfoId = id
+          // this.inputForm.contractInfoList = this.$refs.uploadFile.getDataList()
+          this.contractFilePaperService.save(this.inputForm).then(({data}) => {
+            callback(data.businessTable, data.businessId, this.inputForm)
+            this.$refs.inputForm.resetFields()
+            this.loading = false
+            this.businessId = ''
+          })
+          // this.contractFileService.save(this.inputForm).then(({data}) => {
+          //   callback(data.businessTable, data.businessId, this.inputForm)
+          //   this.$refs.inputForm.resetFields()
+          //   this.loading = false
+          //   this.businessId = ''
+          // })
+        }
+      },
+      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 = ''
+        this.visible = false
+        this.showVi = true
+        this.$refs.archiveFile.clearUpload()
+        this.$refs.uploadFile.clearUpload()
+      },
+      httpRequest (file) {
+        httpRequest(file, fileName(file), 'workContract')
+      },
+      handleRemove () {
+        this.fileList = handleRemove()
+      },
+      changes (file, fileList) {
+        this.dataListNew = []
+        this.dataList.forEach((item) => {
+          this.dataListNew.push(item)
+        })
+        fileList.forEach((item) => {
+          item.createDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          item.createBy = this.$store.state.user.name
+          this.dataListNew.push(item)
+        })
+        const isLt2M = file.size / 1024 / 1024 < 300
+        if (isLt2M === false) {
+          this.$message.error('文件大小不能超过 ' + 300 + 'M !')
+          this.fileList = []
+          this.filesArra2 = []
+        }
+      },
+      async showFile (row) {
+        await openWindowOnUrl(row)
+      },
+      // 排序
+      sortChangeHandle (column) {
+        this.orders = []
+        if (column.order != null) {
+          this.orders.push({column: this.$utils.toLine(column.prop), asc: column.order === 'ascending'})
+        }
+        this.refreshList()
+      },
+      deleteMsgById (row, index) {
+        this.dataListNew.splice(index, 1)
+        if (row.id !== null && row.id !== '' && row.id !== undefined) {
+          this.ossService.deleteMsgById(row.id)
+        }
+      },
+      twoDecimalPlaces (num) {
+        let str = num.toString()
+        var len1 = str.substr(0, 1)
+        var len2 = str.substr(1, 1)
+        // eslint-disable-next-line eqeqeq
+        if (str.length > 1 && len1 == 0 && len2 != '.') {
+          str = str.substr(1, 1)
+        }
+        // eslint-disable-next-line eqeqeq
+        if (len1 == '.') {
+          str = ''
+        }
+        // eslint-disable-next-line eqeqeq
+        if (str.indexOf('.') != -1) {
+          var str_ = str.substr(str.indexOf('.') + 1)
+          // eslint-disable-next-line eqeqeq
+          if (str_.indexOf('.') != -1) {
+            str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
+          }
+          if (str_.length > 2) {
+            this.$message.warning(`金额小数点后只能输入两位,请正确输入!`)
+            return (str = '')
+          }
+        }
+        // eslint-disable-next-line no-useless-escape
+        str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
+        return str
+      },
+      positiveInteger (num) {
+        let str = num.toString()
+        var len1 = str.substr(0, 1)
+        var len2 = str.substr(1, 1)
+        // eslint-disable-next-line eqeqeq
+        if (str.length > 1 && len1 == 0 && len2 != '.') {
+          str = str.substr(1, 1)
+        }
+        // eslint-disable-next-line eqeqeq
+        if (len1 == '.') {
+          str = ''
+        }
+        // eslint-disable-next-line no-useless-escape
+        str = str.replace(/[^\d^]+/g, '') // 保留数字
+        return str
+      },
+      tableRowClassName ({row, rowIndex}) {
+        row.index = rowIndex
+      },
+      handleRadioChange (val) {
+        if (val) {
+          this.radio = val.index
+        }
+      },
+      // 关闭窗口时调用
+      closeXTable () {
+        this.closePop()
+      },
+      rowStyle (event) {
+        return 'cursor:pointer;'
+      },
+      closePop () {
+        this.visable = false
+      },
+      updateStatusById (type) {
+        if (this.$refs.archiveFile.checkProgress() || this.$refs.uploadFile.checkProgress()) {
+          this.loading = false
+          throw new Error()
+        } else {
+          // console.log('type' + type)
+          if (type === 'agree') {
+            this.inputForm.filedPaperType = '5'
+            // this.contractFileService.updateStatusById(this.inputForm)
+            this.contractFilePaperService.updateStatusById(this.inputForm)
+          }
+          // 驳回
+          if (type === 'reject') {
+            this.inputForm.filedPaperType = '4'
+            // this.contractFileService.updateStatusById(this.inputForm)
+            this.contractFilePaperService.updateStatusById(this.inputForm)
+          }
+          if (type === 'reback') {
+            this.inputForm.filedPaperType = '3'
+            // this.contractFileService.updateStatusById(this.inputForm)
+            this.contractFilePaperService.updateStatusById(this.inputForm)
+          }
+        }
+      },
+      checkData () {
+        let begin = this.inputForm.effectiveDate
+        let close = this.inputForm.closingDate
+        if (close < begin) {
+          this.$message.warning(`合同终止日期要大于合同开始日期`)
+          this.inputForm.closingDate = ''
+        }
+      }
+    }
+  }
+</script>
+
+<style>
+  .tid_40 .vxe-body--column .vxe-cell{
+    padding: 1px;
+    text-align: center;
+  }
+  .tid_40 .vxe-header--row .col--last{
+    text-align: center;
+  }
+  .tid_45 .vxe-body--column .vxe-cell{
+    padding: 1px;
+    text-align: center;
+  }
+  .tid_45 .vxe-header--row .col--last{
+    text-align: center;
+  }
+</style>
+
+<style scoped>
+  .avatar{
+    height: 100px;
+  }
+  .el-divider__text {
+    font-weight: bold;
+    font-size: 16px;
+  }
+</style>

+ 125 - 152
src/views/modules/cw/workContract/ContractNameForm.vue

@@ -56,22 +56,17 @@
       <el-divider content-position="left"><i class="el-icon-document"></i> 基本信息</el-divider>
       <el-row  :gutter="0">
         <el-col :span="12">
-          <el-form-item label="合同编号" prop="contractNo">
-            <el-input maxlength="64" :disabled="true" v-model="inputForm.contractNo" placeholder="自动生成"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
           <el-form-item label="合同名称" prop="contractName"
                         :rules="[{required: true, message: '合同名称不能为空', trigger: 'blur'}
                  ]">
-            <el-input v-model="inputForm.contractName"  placeholder="请输入合同名称"     clearable></el-input>
+            <el-input v-model="inputForm.contractName" placeholder="请输入合同名称"     clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="合同编号" prop="contractNo">
+            <el-input maxlength="64" :disabled="true" v-model="inputForm.contractNo" placeholder="自动生成"></el-input>
           </el-form-item>
         </el-col>
-<!--        <el-col :span="12">-->
-<!--          <el-form-item label="合同状态" prop="contractStatus">-->
-<!--            <el-input maxlength="64" :disabled="true" v-model="inputForm.contractStatus" placeholder="请输入合同状态"></el-input>-->
-<!--          </el-form-item>-->
-<!--        </el-col>-->
         <el-col :span="12">
           <el-form-item label="付款主体" prop="payerSubject"
                         :rules="[{required: true, message: '付款主体不能为空', trigger: 'blur'}
@@ -117,7 +112,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'}
                ]">
@@ -128,13 +134,8 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="合同实际金额" prop="actualContractAmount"
-                        :rules="[
-                  {required: true, message:'请输入合同实际金额(元)', trigger:'blur'}
-               ]">
-            <el-input maxlength="15" :disabled="true" v-model="inputForm.actualContractAmount" placeholder="请输入合同实际金额(元)"
-                      @keyup.native="inputForm.actualContractAmount = twoDecimalPlaces(inputForm.actualContractAmount)"
-            ></el-input>
+          <el-form-item label="合同实际金额" prop="actualContractAmount">
+            <el-input maxlength="64" :disabled="true" v-model="inputForm.actualContractAmount" ></el-input>
           </el-form-item>
         </el-col>
 
@@ -147,6 +148,46 @@
         </el-col>
 
         <el-col :span="12">
+          <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-col :span="12">
+          <el-form-item label="案卷号" prop="filedNo" v-if="this.inputForm.filedPaperType !== '0' & this.inputForm.filedPaperType !== ''"
+                        :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" v-if="this.inputForm.filedPaperType !== '0' & this.inputForm.filedPaperType !== ''"
+                        :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="changeNum"
                         :rules="[{required: true, message: '修改次数', trigger: 'blur'}
                  ]">
@@ -164,7 +205,7 @@
                   children: 'children'    // 子级字段名
                 }"
 
-              :url="`/sys/office/treeData?type=2`"
+              :url="`/sys/office/treeData?type=1`"
               :value="inputForm.department"
               :accordion="true"
               size="medium"
@@ -195,7 +236,7 @@
 
         <el-col :span="12">
           <el-form-item label="付款约定" prop="paymentAgreement">
-            <el-input type="textarea" maxlength="64" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
+            <el-input maxlength="64" type="textarea" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
           </el-form-item>
         </el-col>
 
@@ -301,6 +342,9 @@
         visible: false,
         loading: false,
         returnForm: {
+          filedPaperType: '',
+          filedType: '',
+          contractFees: [],
           actualContractAmount: '',
           uscCode: '',
           customerId: '',  // 客户id
@@ -329,6 +373,12 @@
           customerName: ''
         },
         inputForm: {
+          filedPaperType: '',
+          filedNo: '',
+          confirmFiledNo: '',
+          contractAmountType: '',
+          contractFees: [],
+          contractFee: '',
           customerNo: '',
           uscCode: '',
           customerId: '',  // 客户id
@@ -435,6 +485,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
       },
@@ -471,6 +529,13 @@
           this.title = '合同信息详情'
         }
         this.inputForm = {
+          filedPaperType: '',
+          filedType: '',
+          filedNo: '',
+          confirmFiledNo: '',
+          contractAmountType: '',
+          contractFee: '',
+          contractFees: [],
           customerNo: '',
           uscCode: '',
           customerId: '',  // 客户id
@@ -514,10 +579,14 @@
           this.loading = true
           this.$refs.uploadFile.clearUpload()
           this.$refs.archiveFile.clearUpload()
+          // if (this.inputForm.filedType !== '0') {
+          //   this.$refs.archiveFile.clearUpload()
+          // }
           // 查询合同登记数据
           console.log('this.inputForm.id', this.inputForm.id)
           this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
             this.inputForm = this.recover(this.inputForm, data)
+            console.log('this.inputForm.filedPaperType', this.inputForm.filedPaperType)
             const f = []
             if (data.fees !== null && data.fees !== undefined && data.fees !== '') {
               data.fees.split(',').forEach(item => {
@@ -533,73 +602,11 @@
             console.log('data', data)
             console.log('this.inputForm.contractProperList', this.inputForm.contractProperList)
             console.log('this.inputForm.contractInfoList', this.inputForm.contractInfoList)
-            this.$refs.uploadFile.newUpload('view', this.inputForm.contractProperList, 'cwWorkContract', null, null, null, null, false)
+            this.$refs.uploadFile.newUpload(method, this.inputForm.contractProperList, 'cwWorkContract', null, null, null, null, false)
             this.$refs.archiveFile.newUpload(method, this.inputForm.contractInfoList, 'cwWorkContract', null, null, null, null, false)
             this.loading = false
           })
         }
-        // this.$nextTick(() => {
-        //   this.$refs.archiveFile.setDividerName('附件', false)
-        //   this.$refs.inputForm.resetFields()
-        //     // 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')
-        //         // console.log('data1.data.contractProperList', data1.data.contractProperList)
-        //       this.$refs.uploadFile.clearUpload()
-        //       this.$refs.archiveFile.clearUpload()
-        //       this.$refs.uploadFile.newUpload(method, data1.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
-        //       this.$refs.archiveFile.newUpload(method, data1.data.contractInfoList, 'cwWorkContract', null, null, null, null, false)
-        //       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
-        //           if (data3.data.filedType === '2' || data3.data.filedType === '5') {
-        //             this.$refs.archiveFile.clearUpload()
-        //             // this.$refs.uploadFile.clearUpload()
-        //             // this.$refs.uploadFile.newUpload(method, data3.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
-        //             this.$refs.archiveFile.newUpload(method, data3.data.contractInfoList, 'cwWorkContract', null, null, null, null, false)
-        //           } else {
-        //             this.$refs.archiveFile.clearUpload()
-        //             // this.$refs.uploadFile.clearUpload()
-        //             // this.$refs.uploadFile.newUpload(method, data3.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
-        //             this.$refs.archiveFile.newUpload(method, data3.data.contractInfoList, 'cwWorkContract', null, null, null, null, false)
-        //           }
-        //           console.log('data3', data3)
-        //           this.saveData(data3.data, method)
-        //           if (this.formReadOnly) {
-        //             method = 'view'
-        //           }
-        //         })
-        //       })
-        //     } else {
-        //       console.log('进来了22')
-        //       console.log('this.inputForm.filedType', this.inputForm.filedType)
-        //       this.$refs.uploadFile.clearUpload()
-        //       this.$refs.archiveFile.clearUpload()
-        //       if (this.inputForm.filedType === undefined) {
-        //         this.$refs.archiveFile.newUpload('view', data1.data.contractInfoList, 'cwWorkContract', null, null, null, null, false)
-        //       } else {
-        //         this.$refs.archiveFile.newUpload(method, data1.data.contractInfoList, 'cwWorkContract', null, null, null, null, false)
-        //       }
-        //       this.$refs.uploadFile.newUpload(method, data1.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
-        //       this.saveData(data1.data, method)
-        //       if (this.formReadOnly) {
-        //         method = 'view'
-        //       }
-        //     }
-        //     this.loading = false
-        //   })
-        // }
         )
       },
       // 表单提交  保存数据
@@ -609,15 +616,24 @@
           throw new Error()
         } else {
           if (status === 'save') {
+            if (this.inputForm.filedPaperType !== '0' & this.inputForm.filedPaperType !== '') {
+              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.loading = true
             this.inputForm.status = '5'
             this.inputForm.filedType = '5'
             this.inputForm.contractProperList = this.$refs.uploadFile.getDataList()
             this.inputForm.contractInfoList = this.$refs.archiveFile.getDataList()
-            // console.log('this.inputForm', this.inputForm)
             this.contractInfoService.save(this.inputForm).then(({data}) => {
-              // callback(data.businessTable, data.businessId, this.inputForm)
-              // this.$refs.inputForm.resetFields()
               this.loading = false
               this.close()
             }).catch(() => {
@@ -709,76 +725,14 @@
           this.inputForm.clientContactsPhone = list.mobile
         })
       },
-      // 表单提交
-      // 暂存
-      async saveForm (callback) {
-        // 合同登记暂存
-        if (this.status === 'startAndHold' || this.status === 'startAndHoldFiled') {
-          this.loading = true
-          if (this.status === 'startAndHold') {
-            this.inputForm.status = '1'
-          }
-          if (this.status === 'startAndHoldFiled') {
-            this.inputForm.status = '5'
-          }
-          await this.contractInfoService.save(this.inputForm)
-        }
-        // 合同登记归档暂存
-        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()
-        this.loading = false
-        // this.businessId = ''
-        callback()
-      },
-      // 送审
-      startForm (callback) {
-        // console.log('filedType', this.inputForm.id)
-        let id = this.inputForm.id
-        this.loading = true
-        this.inputForm.status = '5'
-        this.contractInfoService.save(this.inputForm)
-        // 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
-        })
-      },
-      // 通过
-      agreeForm (callback) {
-        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)
-        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()
-          this.loading = false
-          this.businessId = ''
-        })
-      },
       close () {
         this.$refs.inputForm.resetFields()
         this.inputForm.clientName = ''
         this.visible = false
         this.showVi = true
-        this.$refs.archiveFile.clearUpload()
+        // if (this.inputForm.filedType !== '0') {
+        //   this.$refs.archiveFile.clearUpload()
+        // }
       },
       httpRequest (file) {
         httpRequest(file, fileName(file), 'workContract')
@@ -905,6 +859,25 @@
           this.$message.warning(`合同终止日期要大于合同开始日期`)
           this.inputForm.closingDate = ''
         }
+      },
+      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 = ''
+        }
       }
     }
   }

+ 129 - 1
src/views/modules/cw/workContract/ContractRegistration.vue

@@ -119,6 +119,7 @@
               <span v-else>{{scope.row.contractName}}</span>
             </template>
           </vxe-column>
+          <vxe-column width="200px" title="案卷号" field="filedNo"></vxe-column>
           <vxe-column width="200px" title="签约日期" field="signingDate"></vxe-column>
           <vxe-column width="200px" title="合同金额(元)" field="contractAmount"></vxe-column>
           <vxe-column width="200px" title="所属部门" field="departmentName"></vxe-column>
@@ -134,11 +135,16 @@
               <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" >
+          <vxe-column width="200px"  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 width="200px" title="纸质归档状态" field="filedPaperType">
+            <template slot-scope="scope">
+              <el-button  type="text" @click="detailPaperFiled(scope.row)" :type="$dictUtils.getDictLabel('filed_type_status', scope.row.filedPaperType, '-')" effect="dark" size="mini">{{$dictUtils.getDictLabel("filed_type", scope.row.filedPaperType, '未归档')}} </el-button>
+            </template>
+          </vxe-column>
 
 
           <vxe-column title="操作" width="200px" fixed="right" align="center">
@@ -146,6 +152,7 @@
 <!--              <el-button v-if="hasPermission('cw:workContract:view')" type="text" size="small" @click="view(scope.row.id)">查看</el-button>-->
               <el-button v-if="hasPermission('cw:workContract:edit') && scope.row.status !== '2' && scope.row.status !== '5' && scope.row.createId === $store.state.user.id" type="text" size="small" @click="edit(scope.row)">修改</el-button>
               <el-button v-if="hasPermission('cw:workContract:edit') && scope.row.status === '5' && isAdmin" type="text" size="small" @click="editForm(scope.row.id)">修改</el-button>
+<!--              <el-button v-if="hasPermission('cw:workContract:edit') && scope.row.status === '5' && scope.row.filedType === '5' && scope.row.filedPaperType === '5' && isAdmin" type="text" size="small" @click="editForm(scope.row.id)">修改</el-button>-->
               <el-button v-if="hasPermission('cw:workContract:del') && (scope.row.status === '1' || scope.row.status === '3' || scope.row.status === '4')  && scope.row.createId === $store.state.user.id" type="text" size="small" @click="del(scope.row.id)">删除</el-button>
               <el-button v-if="hasPermission('cw:workContract:back') && scope.row.status === '2'" type="text" size="small" @click="reback(scope.row)">撤回</el-button>
               <el-button v-if="hasPermission('cw:workContract:filed') && scope.row.status === '5' && scope.row.createId === $store.state.user.id && (scope.row.filedType === '0' || scope.row.filedType === undefined)" type="text" size="small" @click="filed(scope.row.id)">归档</el-button>
@@ -161,6 +168,14 @@
               <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>
+
+              <el-button v-if="hasPermission('cw:workContract:filed') && scope.row.status === '5' && scope.row.filedType === '5' && scope.row.createId === $store.state.user.id && (scope.row.filedPaperType === '0' || scope.row.filedPaperType === undefined)" type="text" size="small" @click="paperFiled(scope.row.id)">纸质归档</el-button>
+              <!--纸质归档暂存修改-->
+              <el-button v-if="hasPermission('cw:workContract:filed') && scope.row.status === '5' && scope.row.filedType === '5' && scope.row.createId === $store.state.user.id && scope.row.filedPaperType === '1'" type="text" size="small" @click="paperFiled(scope.row.id)">修改</el-button>
+              <!--纸质归档撤回驳回修改-->
+              <el-button v-if="hasPermission('cw:workContract:filed') && scope.row.status === '5' && scope.row.filedType === '5' && scope.row.createId === $store.state.user.id && (scope.row.filedPaperType === '3' || scope.row.filedPaperType === '4')" type="text" size="small" @click="paperFiledAndClose(scope.row.id)">修改</el-button>
+              <!--纸质归档撤回-->
+              <el-button v-if="hasPermission('cw:workContract:back') && scope.row.status === '5' && scope.row.filedType === '5' && scope.row.filedPaperType === '2'" type="text"  size="small" @click="rebackPaperFiled(scope.row)">撤回</el-button>
             </template>
           </vxe-column>
         </vxe-table>
@@ -192,6 +207,7 @@
   import ContractInfoService from '../../../../api/cw/workContract/ContractInfoService'
   // import WorkContractFileService from '@/api/sys/WorkContractFileService'
   import ContractFileService from '@/api/cw/workContract/ContractFileService'
+  import ContractFilePaperService from '@/api/cw/workContract/ContractFilePaperService'
   // import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
   import CwWorkContractBorrowService from '@/api/cw/workContract/CwWorkContractBorrowService'
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
@@ -237,6 +253,7 @@
     // workContractService: null,
     contractInfoService: null,
     contractFileService: null,
+    contractFilePaperService: null,
     // workContractBorrowService: null,
     cwWorkContractBorrowService: null,
     taskService: null,
@@ -246,6 +263,7 @@
       // this.workContractService = new WorkContractService()
       this.contractInfoService = new ContractInfoService()
       this.contractFileService = new ContractFileService()
+      this.contractFilePaperService = new ContractFilePaperService()
       this.cwWorkContractBorrowService = new CwWorkContractBorrowService()
       // this.workContractBorrowService = new WorkContractBorrowService()
       this.taskService = new TaskService()
@@ -522,6 +540,10 @@
           row.filedType = '3'
           this.contractFileService.updateStatusById(row)
         }
+        if (type === 'rebackFiledPaper') {
+          row.filedPaperType = '3'
+          this.contractFilePaperService.updateStatusById(row)
+        }
         if (type === 'rebackBorrow') {
           row.borrowType = '0'
           this.cwWorkContractBorrowService.updateStatusByContractInfoId(row).then(() => {
@@ -712,6 +734,112 @@
           this.updateStatusById(row, 'retureBorrow')
           this.refreshList()
         })
+      },
+      // 纸质归档
+      paperFiled (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_file_paper',
+              status: 'startAndHoldFiled'}).then((reture) => {
+                this.$router.push({
+                  path: '/flowable/task/TaskForm',
+                  query: {
+                    procDefId: data.id,
+                    procDefKey: data.key,
+                    status: 'startAndHoldFiled',
+                    title: tabTitle,
+                    formType: reture.data.formType,
+                    formUrl: reture.data.formUrl,
+                    formTitle: processTitle,
+                    businessTable: 'cw_work_contract_file_paper',
+                    businessId: id,
+                    isShow: false,
+                    routePath: '/cw/workContract/ContractRegistration'
+                  }
+                })
+              })
+          }
+        })
+      },
+      // 纸质归档撤回驳回修改
+      paperFiledAndClose (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_file_paper',
+              status: 'startAndCloseFiled'}).then((reture) => {
+                this.$router.push({
+                  path: '/flowable/task/TaskForm',
+                  query: {
+                    procDefId: data.id,
+                    procDefKey: data.key,
+                    status: 'startAndCloseFiled',
+                    title: tabTitle,
+                    formType: reture.data.formType,
+                    formUrl: reture.data.formUrl,
+                    formTitle: processTitle,
+                    businessTable: 'cw_work_contract_file_paper',
+                    businessId: id,
+                    isShow: false,
+                    routePath: '/cw/workContract/ContractRegistration'
+                  }
+                })
+              })
+          }
+        })
+      },
+      // 纸质归档撤回
+      rebackPaperFiled (row) {
+        // console.log('row.taskFiledProcInsId' + row.taskFiledProcInsId)
+        this.$confirm(`确定撤回流程吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.processService.revokeProcIns(row.taskFiledPaperProcInsId).then(({data}) => {
+            // let form = {filedType: '3', id: row.id}
+            this.updateStatusById(row, 'rebackFiledPaper')
+            this.$message.success(data)
+            this.refreshList()
+          })
+        })
+      },
+      // 纸质归档详情
+      detailPaperFiled (row) {
+        // console.log('row.id', row.id)
+        // eslint-disable-next-line eqeqeq
+        if (!this.commonJS.isEmpty(row.filedPaperType) && row.filedPaperType != '1') {
+          this.contractFilePaperService.findByContractInfoId(row.id).then(({data}) => {
+            if (!this.commonJS.isEmpty(data.id)) {
+              // console.log('data', data)
+              this.taskService.getTaskDef({
+                procInsId: data.procInsId,
+                procDefId: data.processDefinitionId
+              }).then(({data}) => {
+                this.$router.push({
+                  path: '/flowable/task/TaskFormDetail',
+                  query: {
+                    readOnly: true,
+                    title: '纸质归档流程详情',
+                    formTitle: '纸质归档流程详情',
+                    businessId: row.id,
+                    ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title')}
+                })
+              })
+            }
+          })
+        }
       }
     }
   }