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

fix:财务管理新增批量导入功能

刘恒 2 лет назад
Родитель
Сommit
812b41e068

+ 10 - 0
src/http/moudules/task.js

@@ -1841,3 +1841,13 @@ export const findOrderCompanyList = () => {
   })
 }
 
+//增加类型导入
+export const addTypeImportExcel = (data) => {
+  return axios({
+    url: "/fnc/plyFee/importDataAddType",
+    method: "post",
+    data
+  })
+}
+
+

+ 57 - 0
src/views/FinancialManagement/CarInsurance/CompanySettlement/CarInsurance/DocumentaryFeesDetail.vue

@@ -434,6 +434,23 @@
         >
       </span>
     </el-dialog>
+    <el-dialog :visible.sync="importVisible" width="25%">
+      <el-upload
+        style="margin-bottom: 10px"
+        action="#"
+        class="upload-demo"
+        :limit="1"
+        :auto-upload="false"
+        :on-change="drivinguploadExcel"
+        ref="upload3"
+        :file-list="excelFileList"
+      >
+        <el-button size="small" type="primary">点击上传</el-button>
+      </el-upload>
+      <el-button size="small" type="primary" @click="templateDownload(1)"
+        >模板下载</el-button
+      >
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -676,6 +693,12 @@ export default {
             return this.handExport();
           },
         },
+        {
+          name: "增加类型导入",
+          click: (row, index) => {
+            return this.addTypeImport();
+          },
+        },
       ],
       tableData: [],
       pageData: {
@@ -965,6 +988,8 @@ export default {
         isPaginationShow: true,
       },
       addTypeList: [],
+      importVisible: false,
+      excelFileList: [],
     };
   },
   created() {
@@ -1023,6 +1048,35 @@ export default {
     });
   },
   methods: {
+    drivinguploadExcel(file, fileList) {
+      this.progressPercent = 0;
+      const params = new FormData(); // 声明formData数据类型
+
+      params.append("file", file.raw);
+      params.append("type", "2");
+
+      this.$api.task.addTypeImportExcel(params).then((res) => {
+        if (res.code == "200") {
+          this.excelFileList = fileList;
+          this.progressPercent = 100;
+          this.findPage();
+        } else {
+          this.excelFileList = [];
+          this.progressPercent = 0;
+          this.$message.error(res.msg);
+          this.findPage();
+        }
+      });
+    },
+    //增加类型批量导入
+    addTypeImport() {
+      this.importVisible = true;
+    },
+    templateDownload() {
+      let a = document.createElement("a");
+      a.href = `${process.env.BASE_URL}/template/js/cxgd.xls`;
+      a.click();
+    },
     haldDelete(row) {
       this.$confirm("是否确认删除?", "提示", {
         confirmButtonText: "确定",
@@ -1509,6 +1563,9 @@ export default {
 </script>
 
 <style scoped>
+.upload-demo {
+  display: inline-block;
+}
 .avatar {
   border: 1px dashed #d9d9d9;
   padding: 5px;

+ 62 - 4
src/views/FinancialManagement/CarInsurance/CompanySettlement/CarInsurance/HandlingFees.vue

@@ -467,6 +467,23 @@
       >
       </el-progress>
     </el-dialog>
+    <el-dialog :visible.sync="importVisible" width="25%">
+      <el-upload
+        style="margin-bottom: 10px"
+        action="#"
+        class="upload-demo"
+        :limit="1"
+        :auto-upload="false"
+        :on-change="drivinguploadExcel"
+        ref="upload4"
+        :file-list="excelFileList"
+      >
+        <el-button size="small" type="primary">点击上传</el-button>
+      </el-upload>
+      <el-button size="small" type="primary" @click="templateDownload(1)"
+        >模板下载</el-button
+      >
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -485,6 +502,7 @@ export default {
   },
   data() {
     return {
+      excelFileList: [],
       confirmDisabled: false,
       riskcodeList: [],
       formListbatch: [
@@ -997,7 +1015,14 @@ export default {
             return this.handExport();
           },
         },
+        {
+          name: "增加类型导入",
+          click: (row, index) => {
+            return this.addTypeImport();
+          },
+        },
       ],
+      importVisible: false,
       tableData: [],
       dialogVisible: false,
       pageData: {
@@ -1082,6 +1107,30 @@ export default {
     });
   },
   methods: {
+    drivinguploadExcel(file, fileList) {
+      this.progressPercent = 0;
+      const params = new FormData(); // 声明formData数据类型
+
+      params.append("file", file.raw);
+      params.append("type", "1");
+
+      this.$api.task.addTypeImportExcel(params).then((res) => {
+        if (res.code == "200") {
+          this.excelFileList = fileList;
+          this.progressPercent = 100;
+          this.findPage();
+        } else {
+          this.excelFileList = [];
+          this.progressPercent = 0;
+          this.$message.error(res.msg);
+          this.findPage();
+        }
+      });
+    },
+    //增加类型批量导入
+    addTypeImport() {
+      this.importVisible = true;
+    },
     agrmentlist() {
       this.$api.task.findPtlAgreementListNew({ type: "2" }).then((res) => {
         this.agreementTypeoptions = res.data;
@@ -1519,10 +1568,16 @@ export default {
     handleSearchListbatch(data) {
       this.findPagegbatch(data);
     },
-    templateDownload() {
-      let a = document.createElement("a");
-      a.href = `${process.env.BASE_URL}/template/handlingFeeTemplate.xlsx`;
-      a.click();
+    templateDownload(type) {
+      if (type != 1) {
+        let a = document.createElement("a");
+        a.href = `${process.env.BASE_URL}/template/handlingFeeTemplate.xlsx`;
+        a.click();
+      } else {
+        let a = document.createElement("a");
+        a.href = `${process.env.BASE_URL}/template/js/cxsxf.xls`;
+        a.click();
+      }
     },
     haldUpload(row) {
       this.formDataId = row.id;
@@ -1560,6 +1615,9 @@ export default {
 </script>
 
 <style scoped>
+.upload-demo {
+  display: inline-block;
+}
 .customStyle {
   margin-bottom: 20px;
   font-size: 14px;

+ 57 - 0
src/views/FinancialManagement/CarInsurance/CompanySettlement/NoCarInsurance/DocumentaryFeesDetail.vue

@@ -398,6 +398,23 @@
         >
       </span>
     </el-dialog>
+    <el-dialog :visible.sync="importVisible" width="25%">
+      <el-upload
+        style="margin-bottom: 10px"
+        action="#"
+        class="upload-demo"
+        :limit="1"
+        :auto-upload="false"
+        :on-change="drivinguploadExcel"
+        ref="upload3"
+        :file-list="excelFileList"
+      >
+        <el-button size="small" type="primary">点击上传</el-button>
+      </el-upload>
+      <el-button size="small" type="primary" @click="templateDownload(1)"
+        >模板下载</el-button
+      >
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -638,7 +655,14 @@ export default {
             return this.handExport();
           },
         },
+        {
+          name: "增加类型导入",
+          click: (row, index) => {
+            return this.addTypeImport();
+          },
+        },
       ],
+      importVisible: false,
       tableData: [],
       pageData: {
         pageNum: 1,
@@ -880,6 +904,7 @@ export default {
         },
       ],
       addTypeList: [],
+      excelFileList: [],
     };
   },
   created() {
@@ -929,6 +954,35 @@ export default {
     });
   },
   methods: {
+    drivinguploadExcel(file, fileList) {
+      this.progressPercent = 0;
+      const params = new FormData(); // 声明formData数据类型
+
+      params.append("file", file.raw);
+      params.append("type", "4");
+
+      this.$api.task.addTypeImportExcel(params).then((res) => {
+        if (res.code == "200") {
+          this.excelFileList = fileList;
+          this.progressPercent = 100;
+          this.findPage();
+        } else {
+          this.excelFileList = [];
+          this.progressPercent = 0;
+          this.$message.error(res.msg);
+          this.findPage();
+        }
+      });
+    },
+    //增加类型批量导入
+    addTypeImport() {
+      this.importVisible = true;
+    },
+    templateDownload() {
+      let a = document.createElement("a");
+      a.href = `${process.env.BASE_URL}/template/js/fcgd.xls`;
+      a.click();
+    },
     haldDelete(row) {
       this.$confirm("是否确认删除?", "提示", {
         confirmButtonText: "确定",
@@ -1392,6 +1446,9 @@ export default {
 </script>
 
 <style scoped>
+.upload-demo {
+  display: inline-block;
+}
 .avatar {
   border: 1px dashed #d9d9d9;
   padding: 5px;

+ 63 - 4
src/views/FinancialManagement/CarInsurance/CompanySettlement/NoCarInsurance/HandlingFees.vue

@@ -441,6 +441,23 @@
         >
       </span>
     </el-dialog>
+    <el-dialog :visible.sync="importVisible" width="25%">
+      <el-upload
+        style="margin-bottom: 10px"
+        action="#"
+        class="upload-demo"
+        :limit="1"
+        :auto-upload="false"
+        :on-change="drivinguploadExcel"
+        ref="upload4"
+        :file-list="excelFileList"
+      >
+        <el-button size="small" type="primary">点击上传</el-button>
+      </el-upload>
+      <el-button size="small" type="primary" @click="templateDownload(1)"
+        >模板下载</el-button
+      >
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -458,6 +475,7 @@ export default {
   },
   data() {
     return {
+      excelFileList: [],
       confirmDisabled: false,
       rulesAdd: {
         agreeId: [
@@ -907,7 +925,15 @@ export default {
             return this.handExport();
           },
         },
+        {
+          name: "增加类型导入",
+          click: (row, index) => {
+            return this.addTypeImport();
+          },
+        },
       ],
+      importVisible: false,
+
       tableData: [],
       selectionList: [],
       dialogVisible: false,
@@ -988,6 +1014,30 @@ export default {
     this.agrmentlist();
   },
   methods: {
+    drivinguploadExcel(file, fileList) {
+      this.progressPercent = 0;
+      const params = new FormData(); // 声明formData数据类型
+
+      params.append("file", file.raw);
+      params.append("type", "3");
+
+      this.$api.task.addTypeImportExcel(params).then((res) => {
+        if (res.code == "200") {
+          this.excelFileList = fileList;
+          this.progressPercent = 100;
+          this.findPage();
+        } else {
+          this.excelFileList = [];
+          this.progressPercent = 0;
+          this.$message.error(res.msg);
+          this.findPage();
+        }
+      });
+    },
+    //增加类型批量导入
+    addTypeImport() {
+      this.importVisible = true;
+    },
     // 编辑
     editBtn(row) {
       this.formDataEdit = {
@@ -1277,10 +1327,16 @@ export default {
         createTimeEnd,
       });
     },
-    templateDownload() {
-      let a = document.createElement("a");
-      a.href = `${process.env.BASE_URL}/template/noHandlingFeeTemplate.xlsx`;
-      a.click();
+    templateDownload(type) {
+      if (type != 1) {
+        let a = document.createElement("a");
+        a.href = `${process.env.BASE_URL}/template/noHandlingFeeTemplate.xlsx`;
+        a.click();
+      } else {
+        let a = document.createElement("a");
+        a.href = `${process.env.BASE_URL}/template/js/fcsxf.xls`;
+        a.click();
+      }
     },
     //列表数据
     findPage(data) {
@@ -1429,6 +1485,9 @@ export default {
 </script>
 
 <style scoped>
+.upload-demo {
+  display: inline-block;
+}
 .customStyle {
   margin-bottom: 20px;
   font-size: 14px;

+ 60 - 4
src/views/FinancialManagement/CarInsurance/PlatformSettlement/NonVehicleBalance.vue

@@ -881,6 +881,23 @@
         </el-table-column>
       </el-table>
     </el-dialog>
+    <el-dialog :visible.sync="importVisible" width="25%">
+      <el-upload
+        style="margin-bottom: 10px"
+        action="#"
+        class="upload-demo"
+        :limit="1"
+        :auto-upload="false"
+        :on-change="drivinguploadExcel"
+        ref="upload3"
+        :file-list="excelFileList"
+      >
+        <el-button size="small" type="primary">点击上传</el-button>
+      </el-upload>
+      <el-button size="small" type="primary" @click="templateDownload(1)"
+        >模板下载</el-button
+      >
+    </el-dialog>
   </div>
 </template>
   <script>
@@ -900,6 +917,7 @@ export default {
   },
   data() {
     return {
+      excelFileList: [],
       dialogVisibleradio: false,
       tableDataRadio: {},
       fileListRadio: [],
@@ -1066,6 +1084,12 @@ export default {
             return this.handExport();
           },
         },
+        {
+          name: "增加类型导入",
+          click: (row, index) => {
+            return this.addTypeImport();
+          },
+        },
       ],
       tableConfig: {
         columns: [
@@ -1451,6 +1475,7 @@ export default {
         ],
       },
       addTypeList: [],
+      importVisible: false,
     };
   },
 
@@ -1505,6 +1530,30 @@ export default {
   },
 
   methods: {
+    drivinguploadExcel(file, fileList) {
+      this.progressPercent = 0;
+      const params = new FormData(); // 声明formData数据类型
+
+      params.append("file", file.raw);
+      params.append("type", "5");
+
+      this.$api.task.addTypeImportExcel(params).then((res) => {
+        if (res.code == "200") {
+          this.excelFileList = fileList;
+          this.progressPercent = 100;
+          this.findPage();
+        } else {
+          this.excelFileList = [];
+          this.progressPercent = 0;
+          this.$message.error(res.msg);
+          this.findPage();
+        }
+      });
+    },
+    //增加类型批量导入
+    addTypeImport() {
+      this.importVisible = true;
+    },
     //重置表单查询信息
     handleResetForm() {
       this.formData = {};
@@ -1658,10 +1707,17 @@ export default {
           }
         });
     },
-    templateDownload() {
-      let a = document.createElement("a");
-      a.href = `${process.env.BASE_URL}/template/SettlementTemplate.xlsx`;
-      a.click();
+
+    templateDownload(type) {
+      if (type != 1) {
+        let a = document.createElement("a");
+        a.href = `${process.env.BASE_URL}/template/SettlementTemplate.xlsx`;
+        a.click();
+      } else {
+        let a = document.createElement("a");
+        a.href = `${process.env.BASE_URL}/template/js/ptjs.xls`;
+        a.click();
+      }
     },
     selectionChange(row) {
       this.selectionList = [];