Browse Source

提交账单明细

caojunjie 2 years ago
parent
commit
a70dc38bbe

+ 4 - 0
src/enums/column-name.js

@@ -199,6 +199,10 @@ const columnName = [{
   name: '财务账单明细'
 },
 {
+  code: 60.1,
+  name: '财务账单明细'
+},
+{
   code: 61,
   name: '财务付费申请'
 },

+ 238 - 0
src/views/financialManagement/mBillDetails/billDetails.vue

@@ -0,0 +1,238 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               :data="dataList"
+               ref="crud"
+               v-model="form"
+               :page.sync="page"
+               :search.sync="search"
+               :table-loading="loading"
+               :cell-style="cellStyle"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               :row-style="rowStyle"
+               @on-load="onLoad"
+               @saveColumn="saveColumn"
+               @resetColumn="resetColumn"
+               @search-criteria-switch="searchCriteriaSwitch"
+    >
+      <template slot="corpIdSearch">
+        <select-component
+          v-model="search.corpId"
+          :configuration="configuration"
+        ></select-component>
+      </template>
+      <template slot="costTypeSearch">
+        <breakdown-select
+          v-model="search.costType"
+          :configuration="breakConfiguration"
+        ></breakdown-select>
+      </template>
+      <template slot-scope="scope" slot="corpId">
+        <span>{{ scope.row.corpName }}</span>
+      </template>
+      <template slot-scope="scope" slot="costType">
+        <span>{{ scope.row.itemName }}</span>
+      </template>
+      <template slot-scope="scope" slot="billType">
+        <span>{{ scope.row.billType == "申请"?"付费":"收费" }}</span>
+      </template>
+      <template slot-scope="scope" slot="menu">
+        <el-button
+          type="text"
+          icon="el-icon-delete"
+          size="small"
+          :disabled="scope.row.billType === '申请' ||  scope.row.settlementAmount != 0"
+          @click.stop="rowDel(scope.row)"
+        >删除
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import option from "./configuration/mainList.json";
+  import { getBillList, removeDetail } from "@/api/financialManagement/paymentRequest";
+  import _ from "lodash";
+
+  export default {
+    data() {
+      return {
+        loading : false,
+        form: {},
+        search:{
+          dc:this.$route.query.dc,
+          corpId:this.$route.query.corpId
+        },
+        detailData:{},
+        option: {},
+        parentId:0,
+        dataList: [],
+        page: {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        },
+        query:{},
+        configuration:{
+          multipleChoices:false,
+          multiple:false,
+          disabled:false,
+          searchShow:true,
+          collapseTags:false,
+          clearable:true,
+          placeholder:'请点击右边按钮选择',
+          dicData:[]
+        },
+        breakConfiguration:{
+          multipleChoices:false,
+          multiple:false,
+          disabled:false,
+          searchShow:true,
+          collapseTags:false,
+          clearable:true,
+          placeholder:'请点击右边按钮选择',
+          dicData:[]
+        },
+      }
+    },
+    async created() {
+      this.option = await this.getColumnData(this.getColumnName(60.1), option);
+      this.$router.$avueRouter.closeTag(window.location.hash.slice(1))
+    },
+    mounted() {
+      // option.height = window.innerHeight - 200 ;
+    },
+    methods: {
+      rowStyle(data){
+        if(_.subtract(data.row.settlementAmount, data.row.amount) < 0){
+          return  {
+            color: "rgba(220,0,0,0.56)"
+          }
+        }
+      },
+      //新单打开
+      addReceipt(row){
+        console.log(1)
+      },
+      //编辑打开
+      editOpen(row){
+        console.log(1)
+      },
+      searchReset() {
+        console.log('1')
+      },
+      selectionChange() {
+        console.log('1')
+      },
+      sizeChange() {
+        console.log('1')
+      },
+      currentChange(val) {
+        this.page.currentPage = val
+      },
+      refreshChange(params) {
+        this.onLoad(this.page,params);
+      },
+      //点击搜索按钮触发
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done()
+      },
+
+      paramsAdjustment(params) {
+        params = Object.assign({}, this.search);
+        if (params.createTime &&  params.createTime.length !==0 ) {  //合同
+          params.createStartDate = params.createTime[0]+ " " + "00:00:00";
+          params.createEndDate = params.createTime[1] + " " + "23:59:59";
+          this.$delete(params,'createTime')
+        }
+        return params
+      },
+
+      onLoad(page, params = {}) {
+        this.loading = true;
+        params = this.paramsAdjustment(params)
+        // console.log(params)
+        getBillList(page.currentPage, page.pageSize,params).then(res=>{
+          this.dataList = res.data.data.records
+          this.page.total = res.data.data.total
+          if (this.page.total) {
+            this.option.height = window.innerHeight - 240;
+          }
+        }).finally(()=>{
+          this.loading = false;
+        })
+      },
+      searchCriteriaSwitch(type){
+        if (type){
+          this.option.height = this.option.height - 96
+        }else {
+          this.option.height = this.option.height + 96
+        }
+        this.$refs.crud.getTableHeight()
+      },
+      cellStyle() {
+        return "padding:0;height:40px;";
+      },
+      //列保存触发
+      async saveColumn() {
+        const inSave = await this.saveColumnData(
+          this.getColumnName(60.1),
+          this.option
+        );
+        if (inSave) {
+          this.$message.success("保存成功");
+          //关闭窗口
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+      },
+      async resetColumn() {
+        const inSave = await this.delColumnData(
+          this.getColumnName(60.1),
+          option
+        );
+        if (inSave) {
+          this.$message.success("重置成功");
+          this.option = option;
+          //关闭窗口
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+      },
+      rowDel(row){
+        this.$confirm("确定删除数据?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          if (row.id) {
+            removeDetail({ids: row.id}).then(res => {
+              this.$message({
+                type: 'success',
+                message: '删除成功!'
+              })
+              this.dataList.splice(row.$index, 1);
+            })
+          } else {
+            this.$message({
+              type: "success",
+              message: "删除成功!"
+            });
+            this.dataList.splice(row.$index, 1);
+          }
+        });
+      },
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 132 - 0
src/views/financialManagement/mBillDetails/configuration/mainList.json

@@ -0,0 +1,132 @@
+{
+  "lazy": true,
+  "tip": false,
+  "searchShow": true,
+  "searchMenuSpan": 24,
+  "dialogWidth": "60%",
+  "align": "center",
+  "searchSpan": 8,
+  "height": "auto",
+  "searchMenuPosition": "right",
+  "border": true,
+  "index": true,
+  "selection": false,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "menuWidth": 80,
+  "stripe": true,
+  "dialogClickModal": false,
+  "searchLabelWidth": 120,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "addBtn":false,
+  "menu": false,
+  "headerAlign": "center",
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [
+    {
+      "name": "amount",
+      "type": "sum"
+    },
+    {
+      "name": "settlementAmount",
+      "type": "sum"
+    }
+  ],
+  "column": [
+    {
+      "label": "合同号",
+      "prop": "accSysNo",
+      "search": true,
+      "overHidden": true,
+      "width": 120,
+      "index": 2
+    },
+    {
+      "label": "提单号",
+      "prop": "srcBillNo",
+      "search": true,
+      "overHidden": true,
+      "width": 120,
+      "index": 3
+    },
+    {
+      "label": "往来单位",
+      "prop": "corpId",
+      "search": true,
+      "overHidden": true,
+      "width": 200,
+      "index": 4
+    },
+    {
+      "label": "所属公司",
+      "prop": "belongToCorpId",
+      "overHidden": true,
+      "width": 200,
+      "index": 5
+    },
+    {
+      "label": "单据来源",
+      "prop": "dc",
+      "type": "select",
+      "search": true,
+      "overHidden": true,
+      "index": 1,
+      "width": 120,
+      "dicData": [
+        {
+          "label": "付费",
+          "value": "c"
+        },
+        {
+          "label": "收费",
+          "value": "d"
+        }
+      ]
+    },
+    {
+      "label": "费用名称",
+      "prop": "costType",
+      "search": true,
+      "overHidden": true,
+      "width": 150,
+      "index": 6
+    },
+    {
+      "label": "账单金额",
+      "prop": "amount",
+      "overHidden": true,
+      "width": 120,
+      "index": 7
+    },
+    {
+      "label": "结算金额",
+      "prop": "settlementAmount",
+      "width": 120,
+      "overHidden": true,
+      "index": 8
+    },
+    {
+      "label": "未算金额",
+      "prop": "outstandingAmount",
+      "width": 120,
+      "overHidden": true,
+      "index": 9
+    },
+    {
+      "label": "账单日期",
+      "prop": "createTime",
+      "type": "date",
+      "search": true,
+      "unlinkPanels": true,
+      "searchRange": true,
+      "overHidden": true,
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "width": 200,
+      "index": 10
+    }
+  ]
+}

+ 6 - 2
src/views/generalLedger/accountsReceivable/index.vue

@@ -126,9 +126,13 @@ export default {
   },
   methods:{
     //跳转
-    jump(){
+    jump(row){
       this.$router.push({
-        path: '/financialManagement/billDetails/billDetails'
+        path: '/financialManagement/mBillDetails/billDetails',
+        query:{
+          ...row,
+          dc:"d"
+        }
       });
     },
     //刷新

+ 6 - 2
src/views/generalLedger/ledgerPayable/index.vue

@@ -126,9 +126,13 @@ export default {
   },
   methods:{
     //跳转
-    jump(){
+    jump(row){
       this.$router.push({
-        path: '/financialManagement/billDetails/billDetails'
+        path: '/financialManagement/mBillDetails/billDetails',
+        query:{
+          ...row,
+          dc:"c"
+        }
       });
     },
     //刷新

+ 0 - 1
src/views/landTransportation/bulkCargo/index.vue

@@ -1057,7 +1057,6 @@ export default {
       this.rowCell({id: this.$route.query.id}, 0)
       this.$router.$avueRouter.closeTag(window.location.hash.slice(1))
       this.home = true
-      // this.$router.push({ query: {} });
     }
   },
   async created() {