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

更换财务管理-费用核对-保司、渠道导入接口

lihongxiao 3 лет назад
Родитель
Сommit
874c556f43

+ 2 - 2
config/dev.env.js

@@ -5,7 +5,7 @@ const prodEnv = require('./prod.env')
 module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
   ENV_CONFIG:'"dev"',
-  BASE_URL: '"http://39.98.239.48/web-api"',
-  // BASE_URL: '"http://192.168.0.111:8080/"' //测试服务器
+  // BASE_URL: '"http://39.98.239.48/web-api"',
+  BASE_URL: '"http://192.168.0.111:8080/"' //测试服务器
 
 })

+ 10 - 2
src/http/moudules/cost.js

@@ -10,9 +10,17 @@ export const gainTopList = () => {
 //excel导入接口
 export const importDataAdd = (data) => {
     return axios({
-        url: "/api/inv/insExternalBills/importDataAdd",
+        url: "/api/inv/insExternalBills/importData",
         method: "post",
-        data
+        data,
+    })
+}
+export const importDataAdd1 = (data,params) => {
+    return axios({
+        url: "/api/inv/insExternalBills/importData",
+        method: "post",
+        data,
+        params
     })
 }
 //excel重新导入接口

+ 47 - 56
src/views/FinancialManagement/CostVerification/Baosi.vue

@@ -42,7 +42,6 @@
             size="mini"
             type="primary"
             @click="modifyFun(scope.row)"
-            v-permission="'sys:cost:edit'"
           >修改</el-button>
           <el-button
             v-if="scope.row.importStatus == 1"
@@ -55,13 +54,13 @@
               class="upload"
               ref="reUpload"
               :show-file-list="false"
+            v-if="scope.row.importStatus == 0"
               :limit="1"
               action="#"
               :http-request="reCarfrontChange"
               :multiple="false"
             >
               <el-button
-                v-if="scope.row.importStatus == 0"
                 size="mini"
                 type="primary"
                 @click="reImportFun(scope.row)"
@@ -173,7 +172,7 @@
           @current-change="tableCurrentBatchChange"
           :current-page="queryBatchFrom.pageNum"
           :page-size="queryBatchFrom.pageSize"
-          :page-sizes="[20, 30, 50, 100]"
+          :page-sizes="[10, 20, 50, 100]"
           layout="total, sizes, prev, pager, next, jumper"
           :total="queryBatchFrom.totalSize"
         ></el-pagination>
@@ -210,46 +209,20 @@
         <el-col :span="4">手续费:{{ formBatchDetailData.other }}</el-col>
       </el-row>
     </el-dialog>
-    <el-dialog v-dialogDrag :visible.sync="dialogImport" width="30%" @close="closeImportVisible">
-      保险公司 :
-      <el-select v-model="InsCompany" placeholder="请选择保险公司" style="width:300px" filterable>
-        <el-option
-          v-for="(InsCompanyitem, InsCompanyindex) in InsCompanyList"
-          :key="InsCompanyindex"
-          :label="InsCompanyitem.name"
-          :value="InsCompanyitem.id"
-        ></el-option>
-      </el-select>
-      <span slot="footer" class="dialog-footer">
-        <el-button size="small" @click="dialogImport = false">取 消</el-button>
-        <div style="display:inline-block">
-          <el-upload
-            class="upload"
-            ref="upload"
-            :show-file-list="false"
-            :limit="1"
-            action="#"
-            :before-upload="beforeAvatarUpload"
-            :http-request="carfrontChange"
-            :multiple="false"
-          >
-            <el-button size="small" type="primary" @click="dialogImport = false">确 定</el-button>
-          </el-upload>
-        </div>
-      </span>
-    </el-dialog>
+    <importDialog ref="importDialog" :InsCompanyList="InsCompanyList" @carfrontChange="carfrontChange"></importDialog>
+    <importDialog ref="standardImportDialog" :InsCompanyList="InsCompanyList" @carfrontChange="standardCarfrontChange"></importDialog>
+   
   </div>
 </template>
 <script>
-import batchDialog from './components/batchDialog.vue'
+import importDialog from './components/importDialog.vue'
 import templateTable from '../../../components/TemplateTable/index.vue'
 import { mapState } from 'vuex'
 
 export default {
   name: "baosi",
-  components: { batchDialog,templateTable },
+  components: { templateTable,importDialog },
   created() {
-    console.log(this.perms,1111111111)
     this.$api.cost.gainTopList().then(res => {
       if (res.data) {
         this.InsCompanyList = res.data;
@@ -340,6 +313,10 @@ export default {
       {
         name:'excel导入',
         click: () => {return this.importFun()}
+      },
+      {
+        name:'标准模板导入',
+        click: () => {return this.standardImportFun()}
       }],
       InsCompanyList: [],
       queryFrom: {
@@ -354,6 +331,7 @@ export default {
       },
       batchNum: 0,
       batchNumId: 0,
+      rowInsCompany:'',
       tableData: [],
       loading: false,
       formData: {},
@@ -409,8 +387,6 @@ export default {
         pageSize: 20
       },
       dialogBVatch: false,
-      dialogImport: false,
-      InsCompany: "",
       fileList: []
     };
   },
@@ -558,33 +534,37 @@ export default {
       this.dialogBVatchVisible = true;
     },
     importFun() {
-      this.dialogImport = true;
-      this.InsCompany = "";
-      this.$refs.upload.clearFiles();
+      this.$refs.importDialog.open()
+      this.$refs.importDialog.$refs.upload.clearFiles();
+    },
+    standardImportFun(){
+      this.$refs.standardImportDialog.open()
+      this.$refs.standardImportDialog.$refs.upload.clearFiles();
     },
     // 重新导入
     reImportFun(row) {
       this.batchNum = row.id;
+      this.rowInsCompany=row.insCompanyId
     },
     reCarfrontChange(file) {
       const params = new FormData(); // 声明formData数据类型
       params.append("file", file.file);
       params.append("flag", "1");
       params.append("batchNum", this.batchNum);
-      this.$api.cost.importDataEdit(params).then(res => {
+      params.append("insCompanyId", this.rowInsCompany);
+      this.$api.cost.importDataAdd(params).then(res => {
         if (res.code == 200) {
           this.$message({
             message: res.msg,
             type: "success"
           });
+        this.getList();
         } else {
           this.$message.error(res.msg);
         }
       });
     },
-    closeImportVisible() {
-      this.dialogImport = false;
-    },
+   
     tablePageChange(val) {
       this.queryFrom.pageSize = val;
       this.getList();
@@ -594,27 +574,38 @@ export default {
       this.getList();
     },
     tablePageBatchChange(val) {
-      this.queryFrom.pageSize = val;
+      this.queryBatchFrom.pageSize = val;
       this.getBachList();
     },
     tableCurrentBatchChange(val) {
-      this.queryFrom.pageNum = val;
+      this.queryBatchFrom.pageNum = val;
       this.getBachList();
     },
-    beforeUpload() {},
-    // excel导入前限制
-    beforeAvatarUpload() {},
     // excel导入
-    carfrontChange(file) {
-      if (!this.InsCompany) {
-        this.$refs.upload.clearFiles();
-        this.$message.warning("请先选择保险公司!!!");
-        return;
-      }
+    carfrontChange(file,InsCompany) {
       const params = new FormData(); // 声明formData数据类型
       params.append("file", file.file);
       params.append("flag", "1");
-      params.append("insCompanyId", this.InsCompany);
+      params.append("insCompanyId", InsCompany);
+      this.$api.cost.importDataAdd(params).then(res => {
+        if (res.code == 200) {
+          this.$message({
+            message: res.msg,
+            type: "success"
+          });
+          this.getList();
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    //标准模板导入
+    standardCarfrontChange(file,InsCompany) {
+      const params = new FormData(); // 声明formData数据类型
+      params.append("file", file.file);
+      params.append("flag", "1");
+      params.append("insCompanyId", InsCompany);
+      params.append("standard", "true");
       this.$api.cost.importDataAdd(params).then(res => {
         if (res.code == 200) {
           this.$message({
@@ -626,8 +617,8 @@ export default {
           this.$message.error(res.msg);
         }
       });
-    }
   }
+}
 };
 </script>
   

+ 6 - 6
src/views/FinancialManagement/CostVerification/Channel.vue

@@ -757,11 +757,11 @@ export default {
       this.getList();
     },
     tablePageBatchChange(val) {
-      this.queryFrom.pageSize = val;
+      this.queryBatchFrom.pageSize = val;
       this.getBachList();
     },
     tableCurrentBatchChange(val) {
-      this.queryFrom.pageNum = val;
+      this.queryBatchFrom.pageNum = val;
       this.getBachList();
     },
     tablePagematch1Change(val) {
@@ -782,14 +782,14 @@ export default {
       this.matchPage2.pageNum = val;
       this.mate2(this.batchNumDetailId);
     },
-    uploadImport(file, jiekou,isId,) {
+    uploadImport(file,isId,) {
       const params = new FormData(); // 声明formData数据类型
       params.append("file", file.file);
       params.append("flag", "2");
       if (isId) {
         params.append("batchNum", this.batchNum);
       }
-      jiekou(params).then(res => {
+      this.$api.cost.importDataAdd(params).then(res => {
         if (res.code == 200) {
           this.$message({
             message: res.msg,
@@ -803,10 +803,10 @@ export default {
     },
     // excel导入
     carfrontChange(file) {
-      this.uploadImport(file,this.$api.cost.importDataAdd);
+      this.uploadImport(file);
     },
     reCarfrontChange(file) {
-      this.uploadImport(file, this.$api.cost.importDataEdit,1);
+      this.uploadImport(file,1);
     },
     // 重新导入
     reImportFun(row) {

+ 66 - 0
src/views/FinancialManagement/CostVerification/components/importDialog.vue

@@ -0,0 +1,66 @@
+<template>
+    <el-dialog v-dialogDrag :visible.sync="dialogImport" width="30%" @close="close">
+      保险公司 :
+      <el-select v-model="InsCompany" placeholder="请选择保险公司" style="width:300px" filterable>
+        <el-option
+          v-for="(InsCompanyitem, InsCompanyindex) in InsCompanyList"
+          :key="InsCompanyindex"
+          :label="InsCompanyitem.name"
+          :value="InsCompanyitem.id"
+        ></el-option>
+      </el-select>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="small" @click="dialogImport = false">取 消</el-button>
+        <div style="display:inline-block">
+          <el-upload
+            class="upload"
+            ref="upload"
+            :show-file-list="false"
+            :limit="1"
+            action="#"
+            :before-upload="beforeAvatarUpload"
+            :http-request="carfrontChange"
+            :multiple="false"
+          >
+            <el-button size="small" type="primary" @click="dialogImport = false">确 定</el-button>
+          </el-upload>
+        </div>
+      </span>
+    </el-dialog>
+</template>
+<script>
+export default {
+  name:'importDialog',
+    props:{
+      InsCompanyList:{
+        type:Array,
+        default:[]
+    },
+    },
+  data() {
+    return {
+        dialogImport:false,
+        InsCompany:''
+    }
+},
+methods:{
+    beforeAvatarUpload(){
+    },
+    carfrontChange(file){
+      if (!this.InsCompany) {
+        this.$refs.upload.clearFiles();
+        this.$message.warning("请先选择保险公司!!!");
+        return;
+      }
+        this.$emit("carfrontChange",file,this.InsCompany)
+    },
+    open(){
+      this.InsCompany='',
+      this.dialogImport = true;
+    },
+    close() {
+      this.dialogImport = false;
+    },
+}
+}
+</script>