Просмотр исходного кода

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

祁鹏飞 3 месяцев назад
Родитель
Сommit
2a83574b6d

+ 8 - 0
src/views/insurancePolicy/orderDetail.vue

@@ -201,6 +201,14 @@
               <span>{{ detailData?.order?.payTime || '--' }}</span>
             </span>
           </el-col>
+          <el-col :span="6" class="TBMsgItem">
+            <span class="label">报价车型</span>
+            <span class="value">
+              <span>{{ detailData?.carInfoVo?.brandName || '--' }} / {{ detailData?.carInfoVo?.seatCount || '--' }}/{{
+                detailData?.carInfoVo?.displacement || '--' }}/{{ detailData?.carInfoVo?.purchasePrice || '--' }}/{{
+                  detailData?.carInfoVo?.carYear || '--' }}</span>
+            </span>
+          </el-col>
         </el-row>
         <div class="title">
           <div>车船税</div>

+ 79 - 11
src/views/platform/ticket.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="ticket" >
+  <div class="ticket">
     <div class="search-list">
       <div class="search-left">
         <el-select v-model="logicJudge">
@@ -65,7 +65,7 @@
     </div>
     <el-table :data="tableData" style="height: calc(100% - 340px)">
       <template #empty>
-        <div v-if="noData">暂无应收,点击<el-button link type="primary">导入应收</el-button></div>
+        <div v-if="noData">暂无应收,点击<el-button link type="primary" @click="batchShow = true">导入应收</el-button></div>
         <div v-else>没有符合的应收单据~</div>
       </template>
       <el-table-column prop="licenseNo" label="车牌号"></el-table-column>
@@ -200,6 +200,36 @@
       <el-button type="primary" @click="handelComfirm(CountFormRef)">确定结算</el-button>
     </template>
   </el-dialog>
+  <el-dialog v-model="batchShow" width="800" title="数据导入">
+    <div style="display: flex; align-items: center; justify-content: center; margin-bottom: 10px">
+      下载「标准导入模板」,编辑后上传;系统将自动匹配相关字段
+      <el-button link type="primary" @click="downloadTemplate">下载模板</el-button>
+    </div>
+    <el-upload class="upload-demo " drag accept=".xls, .xlsx" :auto-upload="false" @change="uploadJYFile">
+      <div class="flex f-c a-c">
+        <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+        <div class="el-upload__text">
+          点击或将文件拖拽到这里上传
+        </div>
+        <a style="color: #999; font-size: 12px">目前支持的文件类型为*.xls, *.xlsx</a>
+      </div>
+    </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>
+    <template #footer>
+      <el-button class="border-[#0083FF] color-[#0083FF]" plain @click="batchShow = false">取消</el-button>
+      <el-button type="primary" @click="batchShow = false">确定</el-button>
+    </template>
+  </el-dialog>
 </template>
 
 <script setup lang="ts">
@@ -211,7 +241,7 @@ import { ElMessage, FormInstance } from "element-plus";
 let route = useRoute()
 let router = useRouter()
 const CountFormRef = ref<FormInstance>()
-
+const batchShow = ref(false)//数据导入弹窗
 const selectedList = ref([])//选中的应收单据
 const options = ref()//保险公司
 const insurerContract = ref()//保险公司协议
@@ -250,7 +280,7 @@ const getByCompanyId = () => {
 
 const initData = () => {
   // router
-  api.financeApi.getSelectedReceivableList({ orderNos: selectedList.value.map(v => v.orderNo), searchList: searchList.value,logicJudge: logicJudge.value, }).then((res: any) => {
+  api.financeApi.getSelectedReceivableList({ orderNos: selectedList.value.map(v => v.orderNo), searchList: searchList.value, logicJudge: logicJudge.value, }).then((res: any) => {
     if (res.code == 200) {
       tableData.value = res.data
     }
@@ -305,8 +335,51 @@ if (route.query?.contactPersonPhone) {
   initCompany()
   initData()
 }
-
-
+const downloadTemplate = () => {
+  api.financeApi.exportAccountsReceivableInvoiceTemplate({}).then((res: any) => {
+    if (res.code == 200) {
+      const link = document.createElement('a');
+      fetch(res.msg).then((res) => res.blob())
+        .then((blob) => {
+          // 将链接地址字符内容转变成blob地址
+          link.href = URL.createObjectURL(blob)
+          console.log(link.href)
+          link.download = '平台结算导入模版.xlsx' //下载的文件的名字
+          document.body.appendChild(link)
+          link.click()
+        })
+    }
+  })
+}
+let importModifyCallback = ref()// 导入数据回调
+const uploadJYFile = async (file) => {
+  let files = file.raw
+  const params = new FormData(); // 声明formData数据类型
+  params.append("file", files);
+  const { code, data, msg } = await api.financeApi.importAccountsReceivableInvoice(params)
+  if (code == 200) {
+    importModifyCallback.value = data
+    api.financeApi.getSelectedReceivableList({ orderNos: data.orderNos }).then((res: any) => {
+      if (res.code == 200) {
+        tableData.value = res.data
+      }
+    })
+    ElMessage({
+      message: msg,
+      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 noData = ref(true)
 let tableData = ref([])
 const addTicket = () => {
@@ -616,9 +689,4 @@ defineExpose({
   }
 }
 
-:deep(.el-upload-dragger) {
-  padding: unset;
-  border: unset;
-  border-radius: unset;
-}
 </style>

+ 28 - 24
src/views/receivable/documentary/index.vue

@@ -313,7 +313,7 @@
             <el-button class="radius-2px width-100" type="primary" @click="addShow = true">添加应收</el-button>
           </div>
           <div class="col-108 m-r-8">
-            <el-button class="radius-2px width-100" type="primary" @click="handleInvoice">应收开票</el-button>
+            <el-button class="radius-2px width-100" type="primary" @click="handleInvoice">跟单费开票</el-button>
           </div>
           <div class="col-108 m-r-8">
             <el-button class="radius-2px width-100" type="primary" @click="dropdownCommand('删除')">删除</el-button>
@@ -435,7 +435,8 @@
         <el-button type="primary" @click="handleAddSubmit">确定</el-button>
       </template>
     </el-dialog>
-    <el-dialog :close-on-click-modal="false" v-model="batchShow" width="800" :title="`选中修改(已选${selectedData.length}条数据)`">
+    <el-dialog :close-on-click-modal="false" v-model="batchShow" width="800"
+      :title="`选中修改(已选${selectedData.length}条数据)`">
       <div style="display: flex; align-items: center; justify-content: center; margin-bottom: 10px">
         下载「标准导入模板」,编辑后上传;系统将自动匹配相关字段
         <el-button link type="primary">下载模板</el-button>
@@ -639,30 +640,33 @@ const toEdit = (row: any) => {
 let options = ref([])
 const handleInvoice = () => {
   if (selectedList.value.length < 1) {
-    ElMessage({
-      message: '请选择数据!',
-      type: 'warning'
+    myRouter.push({
+    name: 'HandingFeeTicket',
+    query: {
+      invoiceType: activeName.value == '1' ? '2' : activeName.value == '2' ? '4' : ''
+    }
+  })
+  } else {
+    if (selectedList.value.some((item: any) => item.invoiceStatusName == '已开票')) {
+      ElMessage({
+        message: '存在已开票数据,不能开票!',
+        type: 'warning'
+      })
+      return
+    }
+    invoiceShow.value = true
+    let arr = selectedList.value.map((item) => {
+      return item.id
     })
-    return
-  }
-  if (selectedList.value.some((item: any) => item.invoiceStatusName == '已开票')) {
-    ElMessage({
-      message: '存在已开票数据,不能开票!',
-      type: 'warning'
+    api.financeApi.getReceivableCompany({
+      incomeIds: [...arr]
+    }).then((res: any) => {
+      if (res.code == 200) {
+        options.value = res.data
+      }
     })
-    return
   }
-  invoiceShow.value = true
-  let arr = selectedList.value.map((item) => {
-    return item.id
-  })
-  api.financeApi.getReceivableCompany({
-    incomeIds: [...arr]
-  }).then((res: any) => {
-    if (res.code == 200) {
-      options.value = res.data
-    }
-  })
+
 }
 
 const dropdownCommand = (e) => {
@@ -852,7 +856,7 @@ const handleBatchEditSubmit = async () => {
     batchEditShow.value = false
   }
 }
- const downloadImportTemplate = () => {
+const downloadImportTemplate = () => {
   let params = {
     licenseNo: receivableForm.value?.licenseNo,
     typeAttr: receivableForm.value?.typeAttr,