ソースを参照

Merge branch 'dev1.0.2' of http://192.168.0.200:3000/suf/factoring-trade-front-end-v2 into dev1.0.2

lazy 7 ヶ月 前
コミット
c77bf63d65

+ 10 - 0
src/api/financingManage/index.js

@@ -144,6 +144,16 @@ export function contractMakingSubmit(data) {
   })
 }
 
+// 获取合同制作-合同下载
+export function contractMakingDownload(data) {
+  return request({
+    url: '/contractMaking/exportContractMarking',
+    method: 'post',
+    data,
+    responseType: 'arraybuffer'
+  })
+}
+
 // 获取合同审批详情
 export function getContractApprovalDetails(params) {
   return request({

+ 25 - 6
src/components/Upload/index.vue

@@ -169,7 +169,9 @@ export default {
             name: data[0].originalName,
             url: data[0].path,
             originalName: data[0].originalName,
-            path: data[0].path
+            path: data[0].path,
+            type: data[0]?.type,
+            fileType: data[0]?.fileType
           }
         } else {
           return item
@@ -186,14 +188,16 @@ export default {
       handler(newV) {
         if (newV.length) {
           this.fileLists = newV.map(item => {
-            const { id, path, originalName, absolutePath } = item
+            const { id, path, originalName, absolutePath, type, fileType } = item
             return {
               id,
               url: path,
               name: originalName,
               originalName,
               path,
-              absolutePath
+              absolutePath,
+              type,
+              fileType
             }
           })
         } else {
@@ -215,7 +219,9 @@ export default {
     isUploadBtn: {
       handler(newV) {
         this.$nextTick(() => {
-          this.$refs.upload.$el.querySelector('.el-upload').style.display = newV ? 'block' : 'none'
+          setTimeout(() => {
+            this.$refs.upload.$el.querySelector('.el-upload').style.display = newV ? 'block' : 'none'
+          }, 300)
         })
       },
       immediate: true
@@ -422,19 +428,32 @@ export default {
       if (!this.isPreviewFile) {
         return
       }
-      var idNum = ''; var name = ''
+      var idNum = ''
+      var name = ''
       var absolutePath = ''
+      var type = ''
+      var fileType = ''
       if (file.response) {
         const { response: { data }} = file
         idNum = data[0].id
         name = data[0].name
         absolutePath = data[0].absolutePath
+        fileType = data[0].fileType
+        type = data[0].type
       } else {
         idNum = file.id
         name = file.name
         absolutePath = file.absolutePath
+        fileType = file.fileType
+        type = file.type
+      }
+      // window.open(`#/perview?fileId=${idNum}&name=${name}&absolutePath=${absolutePath}`)
+      const imgType = ['.jpg', '.png', '.jpeg', '.gif', '.bmp']
+      if (imgType.includes(type?.toLowerCase()) || imgType.includes(fileType?.toLowerCase())) {
+        window.open(`#/perview?fileId=${idNum}&name=${name}&absolutePath=${absolutePath}`)
+      } else {
+        window.open(`${process.env.VUE_APP_BASE_API}/fileStorage/preview?fileId=${idNum}&resource=${fileType ? 0 : 1}`)
       }
-      window.open(`#/perview?fileId=${idNum}&name=${name}&absolutePath=${absolutePath}`)
     },
     downloadClick(row) {
       let absolutePath = ''

+ 127 - 50
src/views/creditManage/supplierManage/auditing/auditingMain.vue

@@ -2,29 +2,75 @@
   <div class="auditing-main">
     <cy-info-title>基础信息</cy-info-title>
     <basic-info :details-info="detailsInfo.dueDiligenceAllocation" />
-    <cy-info-title type="collapse" name="主企业审核">
-      <div v-for="(item, index) in detailsInfo.enterprise.creditSituations" :key="index">
-        <main-enterprise :ref="'mainEnterprise'+index" :details-info="item" :disabled="disabled" type-name="主企业审核" />
-      </div>
-    </cy-info-title>
-    <cy-info-title type="collapse" name="企业商誉情况" style="margin-top: 20px">
-      <corporate-goodwill ref="mainCorporate" :disabled="disabled" :details-info="detailsInfo.enterprise" />
-    </cy-info-title>
-    <cy-info-title v-if="detailsInfo.hasGuaranteeEnterprise" type="collapse" name="担保企业审核">
-      <div v-for="(item, index) in detailsInfo.guaranteeEnterprise.creditSituations" :key="index">
-        <main-enterprise :ref="'guaranteeEnterprise' + index" :details-info="item" type-name="担保企业审核" />
-      </div>
-    </cy-info-title>
-    <cy-info-title v-if="detailsInfo.hasGuaranteeEnterprise" type="collapse" name="企业商誉情况">
-      <corporate-goodwill ref="guaranteeCorporate" :details-info="detailsInfo.guaranteeEnterprise" />
-    </cy-info-title>
-    <cy-info-title>
-      综合评估
-      <div v-if="!disabled" slot="right">
-        <el-button type="primary" @click="oneClickEvaluation">一键评估</el-button>
-      </div>
-    </cy-info-title>
-    <assess :details-info="assessData" :has-guarantee-enterprise="detailsInfo.hasGuaranteeEnterprise" />
+    <template v-if="!isBack">
+      <cy-info-title type="collapse" name="主企业审核">
+        <div
+          v-for="(item, index) in detailsInfo.enterprise.creditSituations"
+          :key="index"
+        >
+          <main-enterprise
+            :ref="'mainEnterprise' + index"
+            :details-info="item"
+            :disabled="disabled"
+            type-name="主企业审核"
+          />
+        </div>
+      </cy-info-title>
+      <cy-info-title
+        type="collapse"
+        name="企业商誉情况"
+        style="margin-top: 20px"
+      >
+        <corporate-goodwill
+          ref="mainCorporate"
+          :disabled="disabled"
+          :details-info="detailsInfo.enterprise"
+        />
+      </cy-info-title>
+      <cy-info-title
+        v-if="detailsInfo.hasGuaranteeEnterprise"
+        type="collapse"
+        name="担保企业审核"
+      >
+        <div
+          v-for="(item, index) in detailsInfo.guaranteeEnterprise.creditSituations"
+          :key="index"
+        >
+          <main-enterprise
+            :ref="'guaranteeEnterprise' + index"
+            :details-info="item"
+            type-name="担保企业审核"
+          />
+        </div>
+      </cy-info-title>
+      <cy-info-title
+        v-if="detailsInfo.hasGuaranteeEnterprise"
+        type="collapse"
+        name="企业商誉情况"
+      >
+        <corporate-goodwill
+          ref="guaranteeCorporate"
+          :details-info="detailsInfo.guaranteeEnterprise"
+        />
+      </cy-info-title>
+      <cy-info-title>
+        综合评估
+        <div v-if="!disabled" slot="right">
+          <el-button type="primary" @click="oneClickEvaluation">一键评估</el-button>
+        </div>
+      </cy-info-title>
+      <assess
+        ref="assessRef"
+        :details-info="assessData"
+        :has-guarantee-enterprise="detailsInfo.hasGuaranteeEnterprise"
+      />
+    </template>
+    <conclusion
+      ref="conclusionRef"
+      :details-info="conclusionInfo"
+      :disabled="disabled"
+      @conclusionChange="conclusionChange"
+    />
   </div>
 </template>
 
@@ -35,7 +81,8 @@ export default {
     BasicInfo: () => import('./components/BasicInfo'),
     MainEnterprise: () => import('./components/MainEnterprise'),
     CorporateGoodwill: () => import('./components/CorporateGoodwill/index'),
-    Assess: () => import('./components/Assess')
+    Assess: () => import('./components/Assess'),
+    Conclusion: () => import('./components/Conclusion')
   },
   props: {
     deatailsInfo: {
@@ -60,16 +107,24 @@ export default {
           creditSituations: []
         }
       },
-      assessData: {}
+      assessData: {},
+      conclusionInfo: {},
+      isBack: false
     }
   },
   watch: {
     deatailsInfo: {
       handler(newV) {
         if (newV && Object.keys(newV)) {
-          // const { name, socialCreditCode, riskManagerId, assignDate, cSupplierInfoId } = newV
-          this.detailsInfo = newV
-          this.assessData = newV.supplierApprovalFirst
+          if (newV.approvalConclusion) {
+            this.detailsInfo = newV
+            this.assessData = newV.supplierApprovalFirst
+            this.conclusionInfo = {
+              approvalConclusion: newV.approvalConclusion,
+              approvalComment: newV.approvalComment
+            }
+            this.conclusionChange(newV?.approvalConclusion)
+          }
         }
       },
       immediate: true,
@@ -83,16 +138,26 @@ export default {
     getFirstReview() {
       const { id } = this.$route.params
       const { type } = this.$route.query
-      if (!type) {
+      if (!type && !this.disabled) {
         getFirstReviewInfo({ id }).then(({ data }) => {
           this.detailsInfo = data
+          const { approvalConclusion, approvalComment } = data
+          this.conclusionInfo = {
+            approvalConclusion,
+            approvalComment
+          }
+          this.conclusionChange(approvalConclusion)
         })
       }
     },
-    async getParams(type) {
+    conclusionChange(val) {
+      this.isBack = val === 'back'
+    },
+    async getParams(type, isCalc) {
       const { id } = this.$route.params
       const { taskId } = this.$route.query
       const { enterprise, historyId, guaranteeEnterprise } = this.detailsInfo
+
       var params = {
         taskId,
         id,
@@ -102,33 +167,45 @@ export default {
           creditSituations: []
         }
       }
-      enterprise.creditSituations.forEach(async(item, index) => {
-        const mainEnterpriseData = await this.$refs[`mainEnterprise${index}`][0].validate(type)
-        params.enterprise.creditSituations.push(mainEnterpriseData)
-      })
-      const mainCorporate = await this.$refs.mainCorporate.validate(type)
-      params.enterprise = {
-        ...params.enterprise,
-        ...mainCorporate
-      }
 
-      if (this.detailsInfo.hasGuaranteeEnterprise) {
-        params.guaranteeEnterprise = {
-          id: guaranteeEnterprise.id,
-          creditSituations: []
-        }
-        guaranteeEnterprise.creditSituations.forEach(async(item, index) => {
-          const guaranteeEnterpriseData = await this.$refs[`guaranteeEnterprise${index}`][0].validate(type)
-          params.guaranteeEnterprise.creditSituations.push(guaranteeEnterpriseData)
+      // 是否是退回情况
+      if (!this.isBack) {
+        enterprise.creditSituations.forEach(async(item, index) => {
+          const mainEnterpriseData = await this.$refs[`mainEnterprise${index}`][0].validate(type)
+          params.enterprise.creditSituations.push(mainEnterpriseData)
         })
-        const guaranteeCorporate = await this.$refs.guaranteeCorporate.validate(type)
+        const mainCorporate = await this.$refs.mainCorporate.validate(type)
+        params.enterprise = {
+          ...params.enterprise,
+          ...mainCorporate
+        }
+
+        if (this.detailsInfo.hasGuaranteeEnterprise) {
+          params.guaranteeEnterprise = {
+            id: guaranteeEnterprise.id,
+            creditSituations: []
+          }
+          guaranteeEnterprise.creditSituations.forEach(async(item, index) => {
+            const guaranteeEnterpriseData = await this.$refs[`guaranteeEnterprise${index}`][0].validate(type)
+            params.guaranteeEnterprise.creditSituations.push(guaranteeEnterpriseData)
+          })
+          const guaranteeCorporate = await this.$refs.guaranteeCorporate.validate(type)
+          // eslint-disable-next-line require-atomic-updates
+          params.guaranteeEnterprise = Object.assign({}, params.guaranteeEnterprise, guaranteeCorporate)
+        }
+      }
+
+      // 是否是一键计算
+      if (!isCalc) {
+        const approvalInfo = await this.$refs.conclusionRef.getSubmit(type)
         // eslint-disable-next-line require-atomic-updates
-        params.guaranteeEnterprise = Object.assign({}, params.guaranteeEnterprise, guaranteeCorporate)
+        params = Object.assign({}, params, approvalInfo)
       }
+
       return params
     },
     async oneClickEvaluation() {
-      const data = await this.getParams()
+      const data = await this.getParams('submit', true)
       oneClickEvaluationSubmit({ Loading: true, ...data }).then(({ data }) => {
         this.assessData = data
       })

+ 98 - 0
src/views/creditManage/supplierManage/auditing/components/Conclusion.vue

@@ -0,0 +1,98 @@
+<template>
+  <div class="assess">
+    <el-form ref="ruleForm" :key="key" :model="ruleForm" :rules="rules" label-position="top" label-width="120px" class="rule-form-orange">
+      <el-form-item label="审批结论:" prop="approvalConclusion">
+        <el-radio-group v-model="ruleForm.approvalConclusion" :disabled="disabled" @change="conclusionChange">
+          <el-radio label="pass">通过</el-radio>
+          <el-radio label="back">退回</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item
+        label="审批意见:"
+        style="width: 100%;"
+        class="textarea-content"
+        prop="approvalComment"
+        :rules="[
+          { required: ruleForm.approvalConclusion === 'back' || ruleForm.approvalConclusion === 'veto', message: '请输入审批意见', trigger: 'blur' }
+        ]"
+      >
+        <el-input v-model="ruleForm.approvalComment" :disabled="disabled" type="textarea" style="width: 100%;" rows="3" clearable></el-input>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    detailsInfo: {
+      type: Object,
+      default: () => {}
+    },
+    disabled: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      ruleForm: {
+        approvalConclusion: '',
+        approvalComment: ''
+      },
+      rules: {
+        approvalConclusion: [
+          { required: true, message: '请选择审批结论', trigger: 'change' }
+        ]
+      },
+      key: 0
+    }
+  },
+  watch: {
+    detailsInfo: {
+      handler(newV) {
+        if (newV && Object.keys(newV).length) {
+          const { approvalConclusion, approvalComment } = JSON.parse(JSON.stringify(newV))
+          this.ruleForm.approvalConclusion = approvalConclusion
+          this.ruleForm.approvalComment = approvalComment
+          this.key += 1
+        }
+      },
+      immediate: true,
+      deep: true
+    }
+  },
+  methods: {
+    conclusionChange(val) {
+      this.$emit('conclusionChange', val)
+    },
+    getSubmit(type) {
+      return new Promise((resolve, reject) => {
+        const { approvalConclusion, approvalComment } = this.ruleForm
+        const params = {
+          approvalConclusion,
+          approvalComment
+        }
+        if (type === 'temp') {
+          resolve(params)
+        } else {
+          this.$refs.ruleForm.validate(valid => {
+            if (valid) {
+              resolve(params)
+            } else {
+              reject()
+            }
+          })
+        }
+      })
+    }
+  }
+
+}
+</script>
+
+<style lang="scss" scoped>
+.assess {
+
+}
+</style>

+ 1 - 1
src/views/creditManage/supplierManage/auditing/components/CorporateGoodwill/index.vue

@@ -128,7 +128,7 @@ export default {
           creditDetailFiles: newV.corporateGoodwill.creditDetailFiles || []
         }
         this.$nextTick(() => {
-          this.$refs.ruleForm.clearValidate()
+          this.$refs?.ruleForm?.clearValidate()
         })
       },
       deep: true,

+ 23 - 19
src/views/creditManage/supplierManage/auditingTwo/auditingTwoMain.vue

@@ -2,14 +2,16 @@
   <div class="auditing-main">
     <cy-info-title>基础信息</cy-info-title>
     <basic-info :details-info="detailsInfo.dueDiligenceAllocation" />
-    <cy-info-title type="collapse" name="审核内容">
-      <legal-person v-if="detailsInfo.age > 55" ref="legalPerson" :details-info="detailsInfo" :disabled="disabled" />
-      <audit-content ref="auditContent" :details-info="detailsInfo" :disabled="disabled" />
-      <business-address ref="businessAddress" :details-info="detailsInfo" :disabled="disabled" />
-    </cy-info-title>
-    <cy-info-title type="collapse" name="企业经营情况">
-      <business-situation ref="businessSituation" :details-info="detailsInfo" :disabled="disabled" />
-    </cy-info-title>
+    <template v-if="!isBack">
+      <cy-info-title type="collapse" name="审核内容">
+        <legal-person v-if="detailsInfo.age > 55" ref="legalPerson" :details-info="detailsInfo" :disabled="disabled" />
+        <audit-content ref="auditContent" :details-info="detailsInfo" :disabled="disabled" />
+        <business-address ref="businessAddress" :details-info="detailsInfo" :disabled="disabled" />
+      </cy-info-title>
+      <cy-info-title type="collapse" name="企业经营情况">
+        <business-situation ref="businessSituation" :details-info="detailsInfo" :disabled="disabled" />
+      </cy-info-title>
+    </template>
     <audit-conclusion ref="auditConclusion" :details-info="detailsInfo" :disabled="disabled" @conclusionChange="conclusionChange" />
     <financial-situation v-if="!isBack" ref="financialSituation" :details-info="detailsInfo" :disabled="disabled" />
     <cy-info-title v-if="!isBack">
@@ -82,41 +84,43 @@ export default {
     },
     conclusionChange(val) {
       this.isBack = val
+      this.$emit('tempClick', val)
     },
     async getParams(type) {
       const { id } = this.$route.params
       const { taskId } = this.$route.query
       const { age, ageCompliance, cSupplierInfoHistoryId, cEnterpriseHistoryId, scope, businessAddress } = this.detailsInfo
-      const scopeCompliance = this.$refs.auditContent.getParams()
-      const { mapFilesCompliance, rentalFilesCompliance, waterFilesCompliance, officeFilesCompliance } = this.$refs.businessAddress.getParams()
-      const businessSituation = this.$refs.businessSituation.getParams()
       var params = {}
+
       if (!this.isBack) {
+        const scopeCompliance = this.$refs.auditContent.getParams()
+        const { mapFilesCompliance, rentalFilesCompliance, waterFilesCompliance, officeFilesCompliance } = this.$refs.businessAddress.getParams()
+        const businessSituation = this.$refs.businessSituation.getParams()
         const financialSituation = await this.$refs.financialSituation.getParams(type)
         params = {
           ...params,
-          ...financialSituation
+          ...financialSituation,
+          ...businessSituation,
+          scopeCompliance,
+          mapFilesCompliance,
+          rentalFilesCompliance,
+          waterFilesCompliance,
+          officeFilesCompliance
         }
       }
       params = {
         ...params,
-        ...businessSituation,
         cSupplierInfoId: id,
         cSupplierInfoHistoryId,
         cEnterpriseHistoryId,
         scope,
         businessAddress,
-        scopeCompliance,
-        mapFilesCompliance,
-        rentalFilesCompliance,
-        waterFilesCompliance,
-        officeFilesCompliance,
         taskId,
         ageCompliance,
         age,
         id: this.detailsInfo.id
       }
-      if (age > 55) {
+      if (age > 55 && !this.isBack) {
         const { ageCompliance } = this.$refs.legalPerson.getParams()
         params.ageCompliance = ageCompliance
       }

+ 7 - 2
src/views/creditManage/supplierManage/auditingTwo/index.vue

@@ -10,10 +10,10 @@
         </div>
       </div>
       <div slot="bottom">
-        <auditing-two-main ref="auditingtwoMain" />
+        <auditing-two-main ref="auditingtwoMain" @tempClick="(val) => { isBack = val }" />
         <div class="submit-btn">
           <el-button @click="$router.go(-1)">关闭</el-button>
-          <el-button type="primary" @click="submitForm('temp')">暂存</el-button>
+          <el-button v-if="!isBack" type="primary" @click="submitForm('temp')">暂存</el-button>
           <el-button type="primary" @click="submitForm('submit')">提交</el-button>
         </div>
       </div>
@@ -29,6 +29,11 @@ export default {
     auditingTwoMain: () => import('./auditingTwoMain.vue'),
     SupplierManageView: () => import('../components/SupplierManageView.vue')
   },
+  data() {
+    return {
+      isBack: false
+    }
+  },
   methods: {
     async submitForm(type) {
       const params = await this.$refs.auditingtwoMain.getSubmit(type)

+ 24 - 17
src/views/financingManage/contractPreparation.vue

@@ -13,6 +13,7 @@
         <contract-preparation-content ref="contractPreparationContent" :details-info="detailsInfo" />
         <div class="submit-btn">
           <el-button @click="() => { $router.go(-1) }">取消</el-button>
+          <el-button type="primary" @click="onSubmit('submit', 'download')">下载合同</el-button>
           <el-button type="primary" @click="onSubmit('temp')">暂存</el-button>
           <el-button type="primary" @click="onSubmit('submit')">提交</el-button>
         </div>
@@ -22,7 +23,8 @@
 </template>
 
 <script>
-import { contractMakingDetails, contractMakingSubmit } from '@/api/financingManage'
+import { contractMakingDetails, contractMakingSubmit, contractMakingDownload } from '@/api/financingManage'
+import { exportFile } from '@/utils'
 export default {
   name: 'ContractPreparation',
   components: {
@@ -44,28 +46,33 @@ export default {
         this.detailsInfo = data
       })
     },
-    async onSubmit(type) {
+    async onSubmit(type, downloadType) {
       const { taskId } = this.$route.query
       const { id, reviewQuotaDisburseId, businessNo } = this.detailsInfo
       const data = await this.$refs.contractPreparationContent.getParams(type)
       const params = {
         Loading: true,
-        ...data, 
-        taskId: taskId, 
-        visible: type === 'submit', 
-        id, 
-        reviewQuotaDisburseId, 
-        businessNo 
+        ...data,
+        taskId: taskId,
+        visible: type === 'submit',
+        id,
+        reviewQuotaDisburseId,
+        businessNo
+      }
+      if (downloadType === 'download') {
+        contractMakingDownload(params).then((res) => {
+          exportFile(res)
+        })
+      } else {
+        contractMakingSubmit(params).then(() => {
+          if (type === 'submit') {
+            this.$message.success('合同制作成功')
+          } else {
+            this.$message.success('暂存合同制作成功')
+          }
+          this.$router.go(-1)
+        })
       }
-      contractMakingSubmit(params).then(() => {
-        if (type === 'submit') {
-          this.$message.success('合同制作成功')
-        } else {
-          this.$message.success('暂存合同制作成功')
-        }
-
-        this.$router.go(-1)
-      })
     }
   }
 }

+ 2 - 1
src/views/financingManage/limitExpenditure/components/MortgageDialog.vue

@@ -550,7 +550,8 @@ export default {
               fileStorageList: this.$refs.fileStorageList.getFileLists,
               mortgageCollateralInfoList,
               cardFrontFileStorage: [],
-              cardReverseFileStorage: []
+              cardReverseFileStorage: [],
+              guarAmount: this.approvalComments
             }
             if (this.ruleForm.mortgagorIdType === 'idType_1') {
               params.cardFrontFileStorage = this.$refs.cardFrontFileStorage.getFileLists

+ 2 - 1
src/views/financingManage/limitExpenditure/components/PledgeDialog.vue

@@ -394,7 +394,8 @@ export default {
               fileStorageList: this.$refs.fileStorageList.getFileLists,
               mortgagePledgeInfoList,
               cardFrontFileStorage: [],
-              cardReverseFileStorage: []
+              cardReverseFileStorage: [],
+              guarAmount: this.approvalComments
             }
             if (this.ruleForm.mortgagorIdType === 'idType_1') {
               params.cardFrontFileStorage = this.$refs.cardFrontFileStorage.getFileLists