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

1、财务管理-费用核对-支付接口的对接、批量支付接口对接
2、财务管理-费用核对-保司数据导入模板下载接口对接
3、财务管理-费用核对-渠道数据导入模板下载接口对接

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

+ 37 - 19
src/components/TemplateTable/index.vue

@@ -14,25 +14,25 @@
           <template v-if="f.type === 'input'">
             <el-input clearable v-model.trim="searchDataClone[f.prop]" size="small" :placeholder="'请输入'+f.label"></el-input>
           </template>
-          <template v-else-if="f.type === 'select'">
+          <template v-else-if="f.type === 'company'">
             <el-select size="small" clearable  v-model="searchDataClone[f.prop]" :placeholder="'请输入'+f.label">
               <el-option label="不限" value v-if="f.selectAuto"></el-option>
               <el-option
-                v-for="(s, i) in f.options"
+                v-for="(s, i) in InsCompanyList"
                 :key="i"
-                :label="s.label"
-                :value="s.value"
+                :label="s.name"
+                :value="s.id"
               ></el-option>
             </el-select>
           </template>
-          <template v-else-if="f.type === 'company'">
+          <template v-else-if="f.type === 'select'">
             <el-select size="small" clearable  v-model="searchDataClone[f.prop]" :placeholder="'请输入'+f.label">
               <el-option label="不限" value v-if="f.selectAuto"></el-option>
               <el-option
-                v-for="(s, i) in InsCompanyList"
+                v-for="(s, i) in f.options"
                 :key="i"
-                :label="s.name"
-                :value="s.id"
+                :label="s.label"
+                :value="s.value"
               ></el-option>
             </el-select>
           </template>
@@ -63,8 +63,8 @@
             ></el-date-picker>
           </template>
           <template v-else-if="f.type === 'radio'">
-            <el-radio-group v-model="searchDataClone[f.prop]">
-                <el-radio  v-for="(r, i) in f.radioList" :key="i" :label="r.value">{{r.label}}</el-radio>
+            <el-radio-group v-model="searchDataClone[f.prop]" :placeholder="'请输入'+f.label">
+                <el-radio  v-for="(r, i) in f.radioList" :key="i" :label="r.value" >{{r.label}}</el-radio>
               </el-radio-group>
           </template>
         </template>
@@ -93,7 +93,7 @@
         v-loading="tableConfig.loading" 
         element-loading-text="数据加载中" 
         element-loading-spinner="el-icon-loading" 
-        @selection-change="handleTableCurrentChange"
+        @selection-change="handleSelectionChange"
         :row-style="{ height: '55px' }"
         :cell-style="{ padding: '0px' }"
         :header-cell-style="{ background: '#F2F7FC', fontWeight: '700', color: '#606266' }"
@@ -114,10 +114,15 @@
                     <span>{{ selectDictLabel(dictData[item.dic], scope.row[item.prop]) }}</span>
                     </template>
                 </el-table-column>
+                <el-table-column v-if="item.type === 'statMap'"  :align="'center'"  :width="item.width || ''"  :fixed="item.fixed" show-overflow-tooltip :label="item.label"  :key="item.prop"  :prop="item.prop">
+                    <template slot-scope="scope">
+                    <span>  {{ statMaps(item.options)[scope.row[item.prop]] || '--' }}</span>
+                    </template>
+                </el-table-column>
                 <!-- 自定义内容 -->
                 <slot v-if="item.type ==='slot'" show-overflow-tooltip :name="item.name"></slot>
                 <!-- 常规文本内容 -->
-                <el-table-column v-else :align="'center'"  :width="item.width || ''"  :fixed="item.fixed"  :label="item.label"  :key="item.prop"  :prop="item.prop"></el-table-column>
+                <el-table-column v-if="item.type ==='text'" :align="'center'"  :width="item.width || ''"  :fixed="item.fixed"  :label="item.label"  :key="item.prop"  :prop="item.prop"></el-table-column>
 
             </template>
             <!-- <slot name="operate" :row="scope.row"></slot> -->
@@ -141,7 +146,7 @@
             <el-table-column v-if="tableConfig.optBtns" :min-width="tableConfig.operationWidth || '100'" label="操作" fixed="right"   header-align="center" align="center" >
                 <template slot-scope="scope">
                     <span v-for="(btn, index) in tableConfig.optBtns" :key="index">
-                        <el-button style="margin:0 10px"  v-permission="btn.perm"    @click="btn.click(scope.row, index)" :type="btn.type ||'primary'" :icon="btn.icon" size="small">{{ btn.label }} </el-button>                   
+                        <el-button style="margin:0 10px" v-if="btn.hide(scope.row)"  v-permission="btn.perm"    @click="btn.click(scope.row, index)" :type="btn.type ||'primary'" :icon="btn.icon" size="small">{{ btn.label }} </el-button>                   
                    </span>
                 </template>
               </el-table-column>
@@ -223,6 +228,15 @@ export default {
         }
     },
   methods: {
+    formatDateTime(date) {
+      let d = new Date(date),
+        month = '' + (d.getMonth() + 1),
+        day = '' + d.getDate(),
+        year = d.getFullYear();
+      if (month.length < 2) month = '0' + month;
+      if (day.length < 2) day = '0' + day;
+      return [year, month, day].join('-');
+    },
     companyFun(){
        this.$api.cost.gainTopList().then(res => {
           if (res.data) {
@@ -230,6 +244,14 @@ export default {
           }
       });
         },
+    statMaps(list) {
+      if (!list) return;
+      let obj = {};
+      list.forEach(item => {
+        obj[item.value || item.id] = item.label || item.value;
+      });
+      return obj;
+    },
     selectDictLabel(dicts, value) {
         if (value === undefined) {
             return '';
@@ -250,12 +272,8 @@ export default {
         return actions.join('');
     },
     // 表格多选
-    selectionChange(e) {
-      this.$emit("selectionChange", e);
-    },
-    // 单选
-    handleTableCurrentChange(currentRow) {
-        this.$emit('changeCurrent', currentRow);
+    handleSelectionChange(currentRow) {
+        this.$emit('selectionChange', currentRow);
     },
 
     handleSizeChange(value) {

+ 15 - 0
src/http/moudules/cost.js

@@ -108,4 +108,19 @@ export const receiveBatchNum= (id) => {
         url: "/api/inv/channelsExternalBillsDetails/receive/"+id,
         method: "get",
     })
+}
+// 支付
+export const pay= (id) => {
+    return axios({
+        url: "/api/inv/channelsExternalBillsDetails/pay/"+id,
+        method: "post",
+    })
+}
+//批量 支付
+export const batchPay= (data) => {
+    return axios({
+        url: "/api/inv/channelsExternalBillsDetails/batchPay",
+        method: "post",
+        data
+    })
 }

+ 13 - 11
src/views/FinancialManagement/CostVerification/Baosi.vue

@@ -269,21 +269,21 @@ export default {
           name:'id',
         },
         {
-          prop:'insCompanyName',label:'保险公司',
+          prop:'insCompanyName',label:'保险公司',type:'text',
         },
         {
-          prop:'mlifta',label:'交强险保费',
+          prop:'mlifta',label:'交强险保费',type:'text',
         },
         {
-          prop:'vavt',label:'车船税',
+          prop:'vavt',label:'车船税',type:'text',
         }, {
-          prop:'other',label:'其他保费',
+          prop:'other',label:'其他保费',type:'text',
         },{
-          prop:'inventoryQuantity',label:'清单数量',
+          prop:'inventoryQuantity',label:'清单数量',type:'text',
         },{
-          prop:'createTime',label:'导入日期',
+          prop:'createTime',label:'导入日期',type:'text',
         },{
-          prop:'createBy',label:'操作人',
+          prop:'createBy',label:'操作人',type:'text',
         },{
           type:'slot',
           name:'importStatus',
@@ -308,10 +308,10 @@ export default {
       },
       btnGroup:[{
         name:'模板下载',
-        click: "changs",
+        click: () => {return this.templateDownload()},
       },
       {
-        name:'excel导入',
+        name:'中煤、简易导入',
         click: () => {return this.importFun()}
       },
       {
@@ -391,8 +391,10 @@ export default {
     };
   },
   methods: {
-    changs(index){
-      console.log(index,1111111)
+    templateDownload(){
+      let a = document.createElement('a')
+      a.href = `${process.env.BASE_URL}/template/finance_ins_model_A.xlsx`;
+      a.click();
     },
     handleSearchList(data){
       if (

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

@@ -20,7 +20,7 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label-width="95px">
-              <el-button type="primary" size="small">模板下载</el-button>
+              <el-button type="primary" size="small" @click='templateDownload'>模板下载</el-button>
               <div style="display:inline-block;margin:0 10px">
                 <el-upload
                   class="upload"
@@ -657,6 +657,11 @@ export default {
     closdialogBVatchVisible(){
       this.dialogBVatch = false;
     },
+    templateDownload(){
+      let a = document.createElement('a')
+      a.href = `${process.env.BASE_URL}/template/finance_channel_model_A.xlsx`;
+      a.click();
+    },
     getBachList() {
       this.$api.cost
         .getchanneQueryPageDetails({

+ 82 - 21
src/views/FinancialManagement/CostVerification/Payment.vue

@@ -2,7 +2,8 @@
     <!--布局容器-->
     <div class="container" style="width: 99%; margin-top: 0px">
         <templateTable :formList="formList" :searchData.sync="searchData" :tableConfig="tableConfig" :btnGroup="btnGroup"
-            :data="tableData" @getList="getList" @handleSearchList="handleSearchList" :pagination="queryFrom">
+            :data="tableData" @getList="getList" @handleSearchList="handleSearchList" :pagination="queryFrom"
+            @selectionChange="selectionChange">
             <el-table-column slot="batchNum" label="批次号" align="center">
                 <template slot-scope="scope">
                     <span class="batchStyle" @click="redirectDetail(scope.row)">{{ scope.row.batchNum }}</span>
@@ -101,7 +102,7 @@ export default {
                 },
                 {
                     label: "业务渠道",
-                    prop: "业务渠道",
+                    prop: "channel",
                     type: 'input'
                 },
                 {
@@ -120,42 +121,63 @@ export default {
                     type: 'select',
                     options: [
                         {
-                            label: '已支付',
-                            value: '1'
-                        }, {
-                            label: '未支付',
+                            label: '未领取',
                             value: '0'
                         },
+                        {
+                            label: '未支付',
+                            value: '1'
+                        },
+                        {
+                            label: '已支付',
+                            value: '2'
+                        },
                     ]
                 },
             ],
             tableConfig: {
                 columns: [
                     {
-                        type: 'slot',
-                        name: 'batchNum',
+                        type: 'slot', name: 'batchNum',
                     },
                     {
-                        prop: 'insCompany', label: '保险公司',
+                        prop: 'insCompany', label: '保险公司', type: 'text',
                     },
                     {
-                        prop: 'plateNum', label: '车牌号',
+                        prop: 'plateNum', label: '车牌号', type: 'text',
                     },
                     {
-                        prop: 'mlifta', label: '交强险保费',
+                        prop: "channel", label: "渠道", type: 'text'
                     },
                     {
-                        prop: 'vavt', label: '车船税',
+                        prop: 'mlifta', label: '交强险保费', type: 'text',
+                    },
+                    {
+                        prop: 'vavt', label: '车船税', type: 'text',
                     }, {
-                        prop: 'other', label: '其他保费',
+                        prop: 'other', label: '其他保费', type: 'text',
                     }, {
-                        prop: 'status', label: '状态',
+                        prop: 'status', label: '状态', type: 'statMap',
+                        options: [
+                            {
+                                label: '未领取',
+                                value: '0'
+                            },
+                            {
+                                label: '未支付',
+                                value: '1'
+                            },
+                            {
+                                label: '已支付',
+                                value: '2'
+                            },
+                        ]
                     }, {
-                        prop: '应付', label: '应付',
+                        prop: 'cope', label: '应付', type: 'text',
                     }, {
-                        prop: '操作人', label: '操作人',
+                        prop: 'payOperator', label: '操作人', type: 'text',
                     }, {
-                        prop: 'payDate', label: '支付日期',
+                        prop: 'payDate', label: '支付日期', type: 'text',
                     }
                 ],
 
@@ -165,13 +187,14 @@ export default {
                 optBtns: [
                     {
                         label: '支付',
+                        hide: (row) => { return row.status == '1' },
                         click: (row, index) => { return this.payFun(row) },
                     }
                 ]
             },
             btnGroup: [{
                 name: '批量支付',
-                click: "changs",
+                click: () => { return this.batchPay() },
             }],
             columns: [
                 {
@@ -230,7 +253,8 @@ export default {
             formDetailData: {},
             formBatchDetailData: {},
             dialogBVatch: false,
-            dialogBVatchVisible: false
+            dialogBVatchVisible: false,
+            selectList: []
         }
     },
     methods: {
@@ -253,8 +277,45 @@ export default {
         handleSearchList(data) {
             this.getList(data)
         },
-        payFun(row) {
-            console.log(row, 1111111)
+        selectionChange(row) {
+            this.selectList = row
+        },
+        async payFun(row) {
+            try {
+                let data = await this.$api.cost.pay(row.id)
+                if (data.code == 200) {
+                    this.$message({
+                        message: "支付成功",
+                        type: "success"
+                    });
+                    this.getList()
+                }
+            } catch (error) {
+                console.log(error);
+            }
+
+        },
+        async batchPay() {
+            let selectList = this.selectList.filter(val => val.status == '1')
+            if (this.selectList.length > 0 && selectList.length > 0) {
+                try {
+                    let data = await this.$api.cost.batchPay(selectList.map(val => { return val.id }))
+                    if (data.code == 200) {
+                        this.$message({
+                            message: "批量支付成功",
+                            type: "success"
+                        });
+                        this.getList()
+                    }
+                } catch (error) {
+                    console.log(error);
+                }
+            } else {
+                this.$message({
+                    message: "请先选择未支付的数据!!!",
+                    type: "warning"
+                });
+            }
         },
         getBachList(batchNum) {
             this.$api.cost