Переглянути джерело

Merge branch 'dev' of http://39.101.143.165:8090/dong_k/tenant-Platform into dev

祁鹏飞 3 місяців тому
батько
коміт
4fb576f9bc

+ 7 - 0
src/api/modules/finance.ts

@@ -68,6 +68,13 @@ const financeApi = (axiosInstance: ApiInstance) => ({
     exportPlatformReceivable: (data: any) => axiosInstance.post('/receivable/exportPlatFormReceivable', data),
     exportPlatformReceivable: (data: any) => axiosInstance.post('/receivable/exportPlatFormReceivable', data),
     // 导入修改
     // 导入修改
     importPlatformExcel: (data: any) => axiosInstance.post('/receivable/importPlatFormReceivable', data),
     importPlatformExcel: (data: any) => axiosInstance.post('/receivable/importPlatFormReceivable', data),
+
+
+    //私有协议-模版下载
+    exportTemplateReceivableList: (data: any) => axiosInstance.post('/receivable/exportTemplateReceivableList', data),
+    // 私有协议-导入修改
+    importReceivableListUpdate: (data: any) => axiosInstance.post('/receivable/importReceivableListUpdate', data),
+
     // 应付账款-提现审核
     // 应付账款-提现审核
     amountAuditingList: (data: any) => axiosInstance.post('/amountAuditing/auditList', data), // 提现列表
     amountAuditingList: (data: any) => axiosInstance.post('/amountAuditing/auditList', data), // 提现列表
     amountAuditingIsLock: (data: string) => axiosInstance.get(`/amountAuditing/isLock?id=${data}`), // 判断领取按钮是否锁定
     amountAuditingIsLock: (data: string) => axiosInstance.get(`/amountAuditing/isLock?id=${data}`), // 判断领取按钮是否锁定

+ 9 - 5
src/views/insurancePolicy/index.vue

@@ -1738,7 +1738,7 @@ const handleSalesmanSelect = (data: any) => {
       quoteData.value = []
       quoteData.value = []
       ruleFilterCompany({
       ruleFilterCompany({
         value: insurancePolicyForm.value.productId
         value: insurancePolicyForm.value.productId
-      })
+      },null)
     }
     }
     // 更新业务员信息
     // 更新业务员信息
     insurancePolicyForm.value.salesman = data.name
     insurancePolicyForm.value.salesman = data.name
@@ -2351,7 +2351,7 @@ const handleChange = (item: any, type: any) => {
       }
       }
       break;
       break;
     case 'insurance':
     case 'insurance':
-      ruleFilterCompany(item)
+      ruleFilterCompany(item,null)
       let list4 = optionObj.value.insuranceType.filter(a => a.label != item.label)
       let list4 = optionObj.value.insuranceType.filter(a => a.label != item.label)
       list4.forEach(a => a.checked = false)
       list4.forEach(a => a.checked = false)
       item.checked = true
       item.checked = true
@@ -3683,6 +3683,7 @@ const handleOpen = (scope: any) => {
  * @param item 选中的产品信息
  * @param item 选中的产品信息
  */
  */
 const ruleFilterCompany = (item: any, obj: any) => {
 const ruleFilterCompany = (item: any, obj: any) => {
+  console.log(item, obj)
   let data = {
   let data = {
     productId: item.value,  // 产品ID
     productId: item.value,  // 产品ID
     carInfo: {  // 车辆信息
     carInfo: {  // 车辆信息
@@ -3771,13 +3772,15 @@ const ruleFilterCompany = (item: any, obj: any) => {
           item.agreement = item.agreements[0].id
           item.agreement = item.agreements[0].id
         }
         }
       })
       })
-      quoteData.value?.map((item: any) => {
-        obj.insCompanyVo.map((a: any) => {
+      if (obj) {
+        quoteData.value?.map((item: any) => {
+        obj.insCompanyVo?.map((a: any) => {
           if (item.id == a.id) {
           if (item.id == a.id) {
             item.quoteResult = a;
             item.quoteResult = a;
             item.quoteResult.ordersNo = obj.ordersNo
             item.quoteResult.ordersNo = obj.ordersNo
             item.quoteCode = 200
             item.quoteCode = 200
             item.checked = true
             item.checked = true
+            handleSelect({id: item.id})
             // 如果有错误信息,设置状态为失败 并记录错误信息
             // 如果有错误信息,设置状态为失败 并记录错误信息
             if (obj.errorMessage) {
             if (obj.errorMessage) {
               item.quoteCode = 500
               item.quoteCode = 500
@@ -3788,7 +3791,8 @@ const ruleFilterCompany = (item: any, obj: any) => {
         })
         })
         return item
         return item
       })
       })
-      console.log(quoteData.value)
+      }
+
     } else {
     } else {
       quoteData.value = []
       quoteData.value = []
     }
     }

+ 62 - 5
src/views/receivable/handingFee/index.vue

@@ -504,7 +504,7 @@
           <template #label>导入修改</template>
           <template #label>导入修改</template>
           <div style="display: flex; align-items: center; justify-content: center; margin-bottom: 10px">
           <div style="display: flex; align-items: center; justify-content: center; margin-bottom: 10px">
             下载「标准导入模板」,编辑后上传;系统将自动匹配相关字段
             下载「标准导入模板」,编辑后上传;系统将自动匹配相关字段
-            <el-button link type="primary">下载模板</el-button>
+            <el-button link type="primary" @click="exportData">下载模板</el-button>
           </div>
           </div>
           <el-upload class="upload-demo" drag accept=".xls, .xlsx" :auto-upload="false" @change="uploadJYFile">
           <el-upload class="upload-demo" drag accept=".xls, .xlsx" :auto-upload="false" @change="uploadJYFile">
             <el-icon class="el-icon--upload"><upload-filled /></el-icon>
             <el-icon class="el-icon--upload"><upload-filled /></el-icon>
@@ -513,6 +513,17 @@
             </div>
             </div>
             <a style="color: #999; font-size: 12px">目前支持的文件类型为*.xls, *.xlsx</a>
             <a style="color: #999; font-size: 12px">目前支持的文件类型为*.xls, *.xlsx</a>
           </el-upload>
           </el-upload>
+          <div v-if="importModifyCallback">
+            <div>
+              您将导入 <span style="color:#409eff;">{{ importModifyCallback?.failedNumber +
+                importModifyCallback?.successNumber
+                ||
+                0 }}
+              </span> 条数据,其中 <span style="color:#409eff;">{{ importModifyCallback?.successNumber || 0 }} </span>
+              条正常导入;<span style="color: red;">{{ importModifyCallback?.failedNumber || 0 }}</span> 条不符合要求无法导入。
+            </div>
+            <el-button type="primary" link @click="downloadImportFailedData(importModifyCallback)">下载导入失败文件</el-button>
+          </div>
         </el-tab-pane>
         </el-tab-pane>
       </el-tabs>
       </el-tabs>
       <template #footer>
       <template #footer>
@@ -867,20 +878,30 @@ const handleBatchEditSubmit = async () => {
     batchEditShow.value = false
     batchEditShow.value = false
   }
   }
 }
 }
-
+let importModifyCallback = ref()// 导入数据回调
 const uploadJYFile = async (file) => {
 const uploadJYFile = async (file) => {
   let files = file.raw
   let files = file.raw
   const params = new FormData(); // 声明formData数据类型
   const params = new FormData(); // 声明formData数据类型
   params.append("file", files);
   params.append("file", files);
-  const { code, data, msg } = await api.financeApi.importJyExcel(params)
+  const { code, data, msg } = await api.financeApi.importReceivableListUpdate(params)
   if (code == 200) {
   if (code == 200) {
+    importModifyCallback.value = data
     ElMessage({
     ElMessage({
       message: msg,
       message: msg,
       type: 'success'
       type: 'success'
     })
     })
   }
   }
 }
 }
-
+// 下载导入失败文件
+const downloadImportFailedData = (item) => {
+  const link = document.createElement('a');
+  link.href = item.failFileUrl;
+  link.download = '';
+  // 触发下载
+  document.body.appendChild(link);
+  link.click();
+  document.body.removeChild(link);
+}
 // 分页
 // 分页
 let pages = ref(1)
 let pages = ref(1)
 let size = ref(10)
 let size = ref(10)
@@ -1052,7 +1073,43 @@ const getJyReceivableList = () => {
     }
     }
   })
   })
 }
 }
-
+const exportData = () => {
+  let params = {
+    licenseNo: receivableForm.value?.licenseNo,
+    typeAttr: receivableForm.value?.typeAttr,
+    companyId: receivableForm.value?.companyId,
+    signingStartTime: receivableForm.value?.signingTime?.[0],
+    signingEndTime: receivableForm.value?.signingTime?.[1],
+    orderNo: receivableForm.value?.orderNo,
+    agreementId: receivableForm.value?.agreementId,
+    deptId: receivableForm.value?.deptId?.join(),
+    productName: receivableForm.value?.productName,
+    orderType: receivableForm.value?.orderType,
+    insuredName: receivableForm.value?.insuredName,
+    jyPolicyNo: receivableForm.value?.jyPolicyNo,
+    dockingPerson: receivableForm.value?.dockingPerson,
+    jqStartDate: receivableForm.value?.jqDate?.[0],
+    jqEndDate: receivableForm.value?.jqDate?.[1],
+    syStartDate: receivableForm.value?.syDate?.[0],
+    syEndDate: receivableForm.value?.syDate?.[1],
+  }
+  api.financeApi.exportTemplateReceivableList(params).then((res: any) => {
+    if (res.code == 200) {
+      const link = document.createElement('a');
+      link.href = res.msg;
+      link.download = '';
+      // 触发下载
+      document.body.appendChild(link);
+      link.click();
+      document.body.removeChild(link);
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
 onMounted(() => {
 onMounted(() => {
   if (route.query.id) {
   if (route.query.id) {
     receivableForm.value.invoiceId = route.query.id
     receivableForm.value.invoiceId = route.query.id