2 Комити e89d274dab ... 95ab87fc3b

Аутор SHA1 Порука Датум
  lazy 95ab87fc3b Merge branch 'dev1.2.0' of http://192.168.0.200:3000/suf/factoring-trade-front-end-v2 into 1.2.0 пре 3 дана
  lazy da00d32c15 fix:采购合同管理修改审核、审核变更合同签署方式 пре 3 дана

+ 2 - 2
src/router/moudules/tradeManagement.js

@@ -108,7 +108,7 @@ export default {
       meta: { title: '采购合同管理' },
       children: [
         {
-          path: '/purchaseContractManagement/purchaseContractReview/:id',
+          path: '/purchaseContractManagement/purchaseContractReview/:id/:infoId',
           name: 'PurchaseContractReview',
           component: () => import('@/views/purchaseContractManagement/purchaseContractReview'),
           hidden: true,
@@ -122,7 +122,7 @@ export default {
           meta: { title: '签署审核', activeMenu: '/tradeManagement/purchaseContractManagement' }
         },
         {
-          path: '/purchaseContractManagement/changeContractReview/:id',
+          path: '/purchaseContractManagement/changeContractReview/:id/:infoId',
           name: 'PurchaseContractChangeReview',
           component: () => import('@/views/purchaseContractManagement/changeContractReview'),
           hidden: true,

+ 83 - 22
src/views/purchaseContractManagement/components/ChangeContractReviewContent.vue

@@ -47,29 +47,50 @@
       <template v-if="ruleForm.approvalConclusion == 'pass'">
         <el-form-item label="合同签署方式" prop="signMode" style="width: 60%;"
           :rules="[
-            { required: ruleForm.approvalConclusion === 'pass', message: '请选择合同签署方式', trigger: 'change' }
+            { required: ruleForm.approvalConclusion === 'pass' && (ruleForm.signMode !== null) || ruleForm.signMode !== '', message: '请选择合同签署方式', trigger: 'change' }
           ]">
-          <el-checkbox v-model="ruleForm.signMode" @change="createFile" :true-label="1" :false-label="0" :disabled="isView">线上电子签</el-checkbox>
-        </el-form-item>
-        <el-form-item label="采购合同文件" prop="fileStorage" style="width: calc(66% - 15px);">
-          <cy-upload
-            ref="fileStorage"
-            :upload-params="{ mouldName: 'reconsiderAdjustFile' }"
-            :file-data="fileStorage"
-            :upload-from-orange-status="true"
-            placeholder="请上传附件"
-            disabled
-          />
-        </el-form-item>
-        <el-form-item label="上传合同文件" prop="upload"
-          :rules="[
-            { required: ruleForm.approvalConclusion === 'pass', message: '请选择上传合同文件', trigger: 'change' }
-          ]">
-          <el-radio-group v-model="ruleForm.upload" @change="changeUpload" :disabled="isView">
-            <el-radio :label="1">是</el-radio>
-            <el-radio :label="0">否</el-radio>
+          <!-- <el-checkbox v-model="ruleForm.signMode" @change="createFile" :true-label="1" :false-label="0" :disabled="isView">线上电子签</el-checkbox> -->
+          <el-radio-group :disabled="isView" v-model="ruleForm.signMode" @change="esignRadioChange">
+            <el-radio :label="1">线上电子签</el-radio>
+            <el-radio :label="0">线下电子签</el-radio>
           </el-radio-group>
         </el-form-item>
+        <template v-if="ruleForm.signMode === 0">
+          <el-form-item label="采购合同文件" style="width: 100%;" class="form-required">
+            <cy-upload
+              ref="purchContractOfflineRef"
+              :upload-params="{ mouldName: 'purchaseContractSupplementOfflineSignFile' }"
+              :file-data="fileStorages"
+              :file-type="'pdf'"
+              :upload-from-orange-status="true"
+              :is-call-back="true"
+              @call-back="offlineSignFileCallBack"
+              :disabled="isView"
+              placeholder="请上传附件"
+            />
+          </el-form-item>
+        </template>
+        <template v-if="ruleForm.signMode === 1">
+          <el-form-item label="采购合同文件" prop="fileStorage" style="width: calc(66% - 15px);">
+            <cy-upload
+              ref="fileStorage"
+              :upload-params="{ mouldName: 'reconsiderAdjustFile' }"
+              :file-data="fileStorage"
+              :upload-from-orange-status="true"
+              placeholder="请上传附件"
+              disabled
+            />
+          </el-form-item>
+          <el-form-item label="上传合同文件" prop="upload"
+            :rules="[
+              { required: ruleForm.approvalConclusion === 'pass', message: '请选择上传合同文件', trigger: 'change' }
+            ]">
+            <el-radio-group v-model="ruleForm.upload" @change="changeUpload" :disabled="isView">
+              <el-radio :label="1">是</el-radio>
+              <el-radio :label="0">否</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </template>
       </template>
       <el-form-item
         label="审批意见:"
@@ -82,7 +103,7 @@
       >
         <el-input v-model="ruleForm.approvalComment" type="textarea" style="width: 100%;" rows="3" clearable :disabled="isView"></el-input>
       </el-form-item>
-      <div style="width: 100%;" v-if="ruleForm.upload == 1 && ruleForm.approvalConclusion == 'pass'">
+      <div style="width: 100%;" v-if="ruleForm.upload == 1 && ruleForm.approvalConclusion == 'pass' && ruleForm.signMode === 1">
         <el-table
           :data="ruleForm.uploadPurchSupplementContracts"
           style="width: 100%">
@@ -144,6 +165,7 @@ export default {
   data() {
     return {
       key: 0,
+      tempPurchContractApproval: {}, // 临时变量存储电子签信息
       ruleForm: {
         approvalConclusion: 'pass',
         approvalComment: '',
@@ -170,7 +192,8 @@ export default {
           { required: true, message: '请输入合同生效日', trigger: 'blur' }
         ]
       },
-      fileStorage: []
+      fileStorage: [],
+      fileStorages: []
     }
   },
   props: ["isView", "info"],
@@ -198,6 +221,21 @@ export default {
             }
           })
         } else if(this.ruleForm.approvalConclusion == 'pass' || !this.ruleForm.approvalConclusion) {
+
+          // add by lx at 2024-11-20 合同签署增加线下电子签模式
+          if (this.ruleForm.signMode !== '' && this.ruleForm.signMode === 0) {
+            const purchContractOfflineFiles = this.$refs.purchContractOfflineRef.getFileLists
+
+            if (purchContractOfflineFiles && purchContractOfflineFiles.length === 0) {
+              this.$message.warning('请上传采购合同文件')
+              return
+            }
+
+            if (purchContractOfflineFiles && purchContractOfflineFiles.length) {
+              this.ruleForm.fileIds = purchContractOfflineFiles.map(item => item.id)
+            }
+          }
+
           this.$refs.ruleForm.validate(flag => {
             if(flag) {
               res(this.getParams())
@@ -259,6 +297,25 @@ export default {
         })
       }
     },
+    // 合同签署方式-radio-change
+    esignRadioChange(val) {
+      if (val === 0) {
+        this.ruleForm.fileStorage = []
+        // this.ruleForm.purchContractApproval.platform = {}
+      }
+      if (val === 1) {
+        // this.ruleForm.purchContractApproval = this.tempPurchContractApproval
+        this.createFile(val)
+      }
+    },
+    // 线下签署-采购合同文件上传成功回调
+    offlineSignFileCallBack() {
+      const purchContractOfflineFiles = this.$refs.purchContractOfflineRef.getFileLists
+
+      if (purchContractOfflineFiles && purchContractOfflineFiles.length) {
+        this.ruleForm.fileIds = purchContractOfflineFiles.map(item => item.id)
+      }
+    },
     changeUpload(val) {
       if(val == 1 && (!this.ruleForm.uploadPurchSupplementContracts || this.ruleForm.uploadPurchSupplementContracts.length === 0)) {
         this.ruleForm.uploadPurchSupplementContracts = []
@@ -324,6 +381,10 @@ export default {
             this.fileStorage = []
             this.fileStorage.push(this.info.fileStorage)
           }
+
+          if (this.info.fileStorages) {
+            this.fileStorages = this.info.fileStorages
+          }
         }
       },
       immediate: true

+ 99 - 34
src/views/purchaseContractManagement/components/PurchaseContractReviewContent.vue

@@ -90,7 +90,7 @@
         <el-input v-model="ruleForm.approvalSettleCycle.settleCycle" style="width: 100px;"  class="two-form-item" :disabled="isView" />
         {{ ruleForm.approvalSettleCycle.settleCycleMethod == 'salesContractSettleCycleMethod_fixed' ? '天' : '个自然月' }}
       </el-form-item>
-      
+
       <cy-info-title style="margin-top: 10px;">需方收货人
         <span v-if="!isView" style="position: absolute; right: 10px; top: 0; font-weight: 400; color: #5ac4fc; cursor: pointer;" @click="ruleForm.userList.push({ name: '', idCard: '', mobile: '', id: '' })">新增</span>
       </cy-info-title>
@@ -134,7 +134,7 @@
           </el-table-column>
         </el-table>
       </div>
-      
+
       <cy-info-title style="margin-top: 10px;">增值税要求</cy-info-title>
       <el-form-item label="发票类型" prop="approvalVatInfo.receiptType">
         <el-select v-model="ruleForm.approvalVatInfo.receiptType" placeholder="请选择发票类型" clearable style="width: 100%" :disabled="isView">
@@ -182,7 +182,7 @@
           </el-table-column>
         </el-table>
       </div>
-      
+
       <cy-info-title style="margin-top: 10px;">电子签信息</cy-info-title>
       <el-form-item label="审批结论" prop="purchContractApproval.approvalConclusion">
         <el-radio-group v-model="ruleForm.purchContractApproval.approvalConclusion" @change="setOtherInfo">
@@ -193,39 +193,63 @@
       <template v-if="ruleForm.purchContractApproval.approvalConclusion == 'pass'">
         <el-form-item label="合同签署方式" prop="purchContractApproval.signMode" style="width: 60%;"
           :rules="[
-            { required: ruleForm.purchContractApproval.approvalConclusion == 'pass', message: '请选择合同签署方式', trigger: 'change' }
+            { required: ruleForm.approvalConclusion === 'pass' && (ruleForm.purchContractApproval.signMode !== null || ruleForm.purchContractApproval.signMode !== ''), message: '请选择合同签署方式', trigger: 'change' }
           ]">
           <!-- <el-checkbox v-model="ruleForm.purchContractApproval.signMode" @change="createFile" :true-label="1" :false-label="0" :disabled="isView">线上电子签</el-checkbox> -->
-          <el-checkbox v-model="ruleForm.purchContractApproval.signMode" @change="createFile" :true-label="1" :false-label="''" :disabled="isView">线上电子签</el-checkbox>
-        </el-form-item>
-        <el-form-item label="贸易平台">
-          <el-input v-model="ruleForm.purchContractApproval.platform.platformName" style="width: 100%;" disabled></el-input>
-        </el-form-item>
-        <el-form-item label="认证状态" prop="purchContractApproval.platform.authStatus">
-          <el-input :value="ruleForm.purchContractApproval.platform.authStatus == 1 ? '已认证' : '未认证'" style="width: 100%;" disabled></el-input>
-        </el-form-item>
-        <el-form-item label="自动签署状态" prop="purchContractApproval.platform.autoSignStatus">
-          <el-input :value="ruleForm.purchContractApproval.platform.autoSignStatus == 1 ? '已签署' : '未签署'" style="width: 100%;" disabled></el-input>
-        </el-form-item>
-        <el-form-item label="采购合同文件" prop="purchContractApproval.fileStorage" style="width: calc(66% - 15px);">
-          <cy-upload
-            ref="fileStorage"
-            :upload-params="{ mouldName: 'reconsiderAdjustFile' }"
-            :file-data="ruleForm.purchContractApproval.fileStorage"
-            :upload-from-orange-status="true"
-            placeholder="请上传附件"
-            disabled
-          />
-        </el-form-item>
-        <el-form-item label="上传合同文件" prop="purchContractApproval.upload"
-          :rules="[
-            { required: ruleForm.purchContractApproval.approvalConclusion === 'pass', message: '请选择上传合同文件', trigger: 'change' }
-          ]">
-          <el-radio-group v-model="ruleForm.purchContractApproval.upload" @change="changeUpload" :disabled="isView">
-            <el-radio :label="1">是</el-radio>
-            <el-radio :label="0">否</el-radio>
+          <el-radio-group :disabled="isView" v-model="ruleForm.purchContractApproval.signMode" @change="esignRadioChange">
+            <el-radio :label="1">线上电子签</el-radio>
+            <el-radio :label="0">线下电子签</el-radio>
           </el-radio-group>
+          <!-- <el-checkbox-group :min="1" :max="1" :disabled="isView" v-model="ruleForm.purchContractApproval.signMode" @change="esignCheckBoxChange">
+            <el-checkbox @change="createFile" :label="1">线上电子签</el-checkbox>
+            <el-checkbox @change="downEsignChange" :label="0">线下电子签</el-checkbox>
+          </el-checkbox-group> -->
         </el-form-item>
+        <template v-if="ruleForm.purchContractApproval.signMode === 0">
+          <el-form-item label="采购合同文件" prop="purchContractApproval.fileStorages" style="width: 100%;" class="form-required">
+            <cy-upload
+              ref="purchContractOfflineRef"
+              :upload-params="{ mouldName: 'purchaseContractOfflineSignFile' }"
+              :file-data="ruleForm.purchContractApproval.fileStorages"
+              :file-type="'pdf'"
+              :upload-from-orange-status="true"
+              :is-call-back="true"
+              @call-back="offlineSignFileCallBack"
+              :disabled="isView"
+              placeholder="请上传附件"
+            />
+          </el-form-item>
+        </template>
+        <template v-if="ruleForm.purchContractApproval.signMode === 1">
+          <el-form-item label="贸易平台">
+            <el-input v-model="ruleForm.purchContractApproval.platform.platformName" style="width: 100%;" disabled></el-input>
+          </el-form-item>
+          <el-form-item label="认证状态" prop="purchContractApproval.platform.authStatus">
+            <el-input :value="ruleForm.purchContractApproval.platform.authStatus == 1 ? '已认证' : '未认证'" style="width: 100%;" disabled></el-input>
+          </el-form-item>
+          <el-form-item label="自动签署状态" prop="purchContractApproval.platform.autoSignStatus">
+            <el-input :value="ruleForm.purchContractApproval.platform.autoSignStatus == 1 ? '已签署' : '未签署'" style="width: 100%;" disabled></el-input>
+          </el-form-item>
+          <el-form-item label="采购合同文件" prop="purchContractApproval.fileStorage" style="width: calc(66% - 15px);">
+            <cy-upload
+              ref="fileStorage"
+              :upload-params="{ mouldName: 'reconsiderAdjustFile' }"
+              :file-data="ruleForm.purchContractApproval.fileStorage"
+              :upload-from-orange-status="true"
+              placeholder="请上传附件"
+              disabled
+            />
+          </el-form-item>
+          <el-form-item label="上传合同文件" prop="purchContractApproval.upload"
+            :rules="[
+              { required: ruleForm.purchContractApproval.approvalConclusion === 'pass', message: '请选择上传合同文件', trigger: 'change' }
+            ]">
+            <el-radio-group v-model="ruleForm.purchContractApproval.upload" @change="changeUpload" :disabled="isView">
+              <el-radio :label="1">是</el-radio>
+              <el-radio :label="0">否</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </template>
       </template>
 
       <el-form-item
@@ -297,6 +321,8 @@
 
 <script>
 import request from '@/utils/request'
+import { deepClone } from '@/utils'
+
 export default {
   components: {
     SignConfirmationContent: () => import('./SignConfirmationContent.vue')
@@ -321,6 +347,7 @@ export default {
     }
     return {
       key: 0,
+      tempPurchContractApproval: {}, // 临时变量存储电子签信息
       ruleForm: {
         purchContractBasicInfo: {},
         purchContractReplenishInfo: {},
@@ -332,7 +359,8 @@ export default {
         approvalVatInfo: {},
         purchContractOtherClause: [],
         purchContractApproval: {
-          platform: {}
+          platform: {},
+          fileStorages: []
         },
         visible: '',
         supplier: {}
@@ -459,6 +487,9 @@ export default {
         Object.keys(this.ruleForm).forEach(key => {
           if(data[key]) {
             this.ruleForm[key] = data[key]
+            if (key === 'purchContractApproval') {
+              this.tempPurchContractApproval = deepClone(data.purchContractApproval)
+            }
           }
         })
         this.$emit('changeResult', this.ruleForm.purchContractApproval?.approvalConclusion)
@@ -505,6 +536,21 @@ export default {
             }
           })
         } else if(this.ruleForm.purchContractApproval.approvalConclusion == 'pass' || !this.ruleForm.purchContractApproval.approvalConclusion) {
+
+          // add by lx at 2024-11-20 合同签署增加线下电子签模式
+          if (this.ruleForm.purchContractApproval.signMode !== '' && this.ruleForm.purchContractApproval.signMode === 0) {
+            const purchContractOfflineFiles = this.$refs.purchContractOfflineRef.getFileLists
+
+            if (purchContractOfflineFiles && purchContractOfflineFiles.length === 0) {
+              this.$message.warning('请上传采购合同文件')
+              return
+            }
+
+            if (purchContractOfflineFiles && purchContractOfflineFiles.length) {
+              this.ruleForm.purchContractApproval.fileIds = purchContractOfflineFiles.map(item => item.id)
+            }
+          }
+
           this.$refs.ruleForm.validate(flag => {
             if(flag) {
               resolve()
@@ -525,7 +571,7 @@ export default {
     createFile(val) {
       if(this.ruleForm.purchContractApproval.approvalConclusion == 'pass' && val == 1) {
         let data = { taskId: this.$route.params.taskId, businessKey: this.$route.params.infoId, ...this.ruleForm }
-        data.visible = 0 
+        data.visible = 0
         data.purchContractApproval = {
           ...this.ruleForm.purchContractApproval
         }
@@ -553,6 +599,25 @@ export default {
         this.ruleForm.purchContractApproval.fileStorage = []
       }
     },
+    // 合同签署方式-radio-change
+    esignRadioChange(val) {
+      if (val === 0) {
+        this.ruleForm.purchContractApproval.fileStorage = []
+        this.ruleForm.purchContractApproval.platform = {}
+      }
+      if (val === 1) {
+        this.ruleForm.purchContractApproval = this.tempPurchContractApproval
+        this.createFile(val)
+      }
+    },
+    // 线下签署-采购合同文件上传成功回调
+    offlineSignFileCallBack() {
+      const purchContractOfflineFiles = this.$refs.purchContractOfflineRef.getFileLists
+
+      if (purchContractOfflineFiles && purchContractOfflineFiles.length) {
+        this.ruleForm.purchContractApproval.fileIds = purchContractOfflineFiles.map(item => item.id)
+      }
+    },
     setOtherInfo(val) {
       this.$emit('changeResult', this.ruleForm.purchContractApproval.approvalConclusion)
       if(val == 'back') {