Browse Source

付款结算弹窗 2023-12-06

caojunjie 1 year ago
parent
commit
39a2993e90

+ 101 - 0
src/components/bill/config/mainListsCG.json

@@ -0,0 +1,101 @@
+{
+  "lazy": true,
+  "tip": true,
+  "simplePage": false,
+  "searchShow": true,
+  "reserveSelection": true,
+  "addBtn":false,
+  "editBtn":false,
+  "addRowBtn":false,
+  "cellBtn":false,
+  "cancelBtn":false,
+  "delBtn":false,
+  "refreshBtn": false,
+  "searchMenuPosition": "right",
+  "searchMenuSpan": 24,
+  "searchSpan": 8,
+  "menuWidth": "100",
+  "align": "center",
+  "dialogWidth": "60%",
+  "tree": true,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "menu": true,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "dialogClickModal": false,
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [
+    {
+      "name": "amount",
+      "type": "sum"
+    },
+    {
+      "name": "settlementAmount",
+      "type": "sum"
+    },
+    {
+      "name": "invoiceAmount",
+      "type": "sum"
+    }
+  ],
+  "column": [
+    {
+      "label": "采购单号",
+      "prop": "ordNo",
+      "overHidden": true,
+      "search": true,
+      "width": 150,
+      "index": 2
+    }, {
+      "label": "结算单位",
+      "prop": "customerName",
+      "overHidden": true,
+      "index": 2
+    },
+    {
+      "label": "数量",
+      "prop": "goodsTotalNum",
+      "overHidden": true,
+      "width": 150,
+      "index": 7
+    },
+    {
+      "label": "金额",
+      "prop": "totalMoney",
+      "overHidden": true,
+      "width": 150,
+      "index": 7
+    },
+    {
+      "label": "业务日期",
+      "prop": "businesDate",
+      "searchProp":"businesDateList",
+      "type": "date",
+      "search":true,
+      "searchRange": true,
+      "searchDefaultTime": ["00:00:00", "23:59:59"],
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd HH:mm:ss",
+      "overHidden": true,
+      "index": 14,
+      "width": 250
+    },
+    {
+      "label": "应结日期",
+      "prop": "dueDate",
+      "searchProp":"dueDateList",
+      "type": "date",
+      "search":true,
+      "searchRange": true,
+      "searchDefaultTime": ["00:00:00", "23:59:59"],
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd HH:mm:ss",
+      "overHidden": true,
+      "index": 14,
+      "width": 250
+    }
+  ]
+}

+ 195 - 0
src/components/bill/selectOrderDetailListCG.vue

@@ -0,0 +1,195 @@
+<template>
+  <div>
+    <avue-crud :option="option" :table-loading="loading" :data="data" :search.sync="search" ref="crud"
+      @refresh-change="refreshChange" @selection-change="selectionChange" @search-change="searchChange"
+      @saveColumn="saveColumn" :page.sync="page" @on-load="onLoad">
+      <template slot="costTypeSearch">
+        <breakdown-select v-model="search.costType" :configuration="breakConfiguration"></breakdown-select>
+      </template>
+      <template slot="menuLeft">
+        <el-tabs v-model="activeName" @tab-click="tabHandle">
+          <el-tab-pane label="查询结果" name="searchList"></el-tab-pane>
+          <el-tab-pane label="已选定数据" name="importStaging"></el-tab-pane>
+        </el-tabs>
+      </template>
+      <template slot-scope="scope" slot="menu">
+        <el-button type="text" icon="el-icon-edit" size="small" @click.stop="importStagList(scope.row, scope.index)"
+          v-if="activeName == 'searchList'"
+          :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1">选择
+        </el-button>
+        <el-button type="text" icon="el-icon-delete" size="small" @click.stop="removeStagList(scope.row, scope.index)"
+          v-else>移除
+        </el-button>
+      </template>
+    </avue-crud>
+    <div class="dialogButton">
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="$emit('closeFun')">取 消</el-button>
+        <el-button type="primary" @click="importProMent" :disabled="goodsListSave.length == 0">导入</el-button>
+      </span>
+    </div>
+  </div>
+</template>
+
+<script>
+import optionCG from './config/mainListsCG.json'
+import {getListOrder, orderListBySettlement} from "@/api/financialManagement/paymentRequest";
+
+export default {
+  name: "index",
+  props: {
+    billType: {
+      type: String
+    },
+    flag: {
+      type: Number
+    },
+    params: {
+      type: Object
+    },
+    itemId: {
+      type: String
+    },
+    closeFun: {
+      type: Function
+    }
+  },
+  data() {
+    return {
+      activeName: "searchList",
+      option: optionCG,
+      loading: false,
+      search: {},
+      data: [],
+      selectList: [],
+      page: {
+        pageSize: 20,
+        pagerCount: 1,
+        total: 0,
+        pageSizes: [20, 200, 300, 500, 700, 1000]
+      },
+      breakConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        disabled: false,
+        searchShow: true,
+        collapseTags: false,
+        clearable: true,
+        placeholder: '请点击右边按钮选择',
+        dicData: []
+      },
+      goodsListShow: [],
+      goodsListSave: []
+    }
+  },
+  watch: {
+    'params.corpId'(newVal, oldVal) {
+        console.log(newVal,87)
+      if (newVal != oldVal) {
+        this.onLoad(this.page, this.search)
+      }
+    },
+  },
+  async created() {
+    // this.option = await this.getColumnData(this.getColumnName(281), option);
+  },
+    mounted() {
+        this.onLoad(this.page,this.params)
+    },
+    methods: {
+    importStagList(row, index) {
+      // this.goodsListSave.push(row);
+      this.$refs.crud.toggleSelection([row]);
+    },
+    removeStagList(row, index) {
+      this.goodsListSave.splice(row.$index, 1);
+    },
+    // 标签页切换
+    tabHandle(data) {
+      if (data.name == "searchList") {
+        this.goodsListSave = this.data;
+        this.data = this.goodsListShow;
+        this.page.total = this.page.totalTwo
+      } else if (data.name == "importStaging") {
+        this.goodsListShow = this.data;
+        this.data = this.goodsListSave;
+        this.page.totalTwo = this.page.total;
+        this.page.total = 0;
+      }
+    },
+    refreshChange() {
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      if (params.createStart) {
+        params.createStartDate = params.createStart[0]
+        params.createEndDate = params.createStart[1]
+      }
+      this.onLoad(this.page, params);
+      done()
+    },
+    selectionChange(row) {
+      // this.selectList = row
+      this.goodsListSave = row
+    },
+    onLoad(page, params) {
+      if(params && params.rentStartDate ){
+        params.createStartDate = params.rentStartDate[0] + " " + "00:00:00"?params.rentStartDate[0] + " " + "00:00:00":'';
+        params.createEndDate = params.rentStartDate[1] + " " + "23:59:59"?params.rentStartDate[1] + " " + "23:59:59":'';
+        this.$delete(params, 'rentStartDate')
+      }
+      this.loading = true;
+        // 把老数据进行更新  从父组件调用的子组件方法
+        if (params.customerId != this.params.customerId) {
+            this.params = params
+        }
+      params = {
+        // ...params,
+          ...page,
+          ...this.params
+      }
+
+    // ...this.params 使用之前的老数据 回请求之前的ID造成数据不对
+      params.billType = this.billType
+      if (this.$store.getters.userInfo.tenant_id === "673511") {
+        params.type = "CMY"
+      }
+      params.flag = this.flag
+        if (this.params.bsType == 'XS') {
+            params.settlementType = 'd'
+        }else {
+            params.settlementType = 'c'
+        }
+      orderListBySettlement(page.currentPage, page.pageSize, params).then(res => {
+        this.data = res.data.data.records
+        this.page.total = res.data.data.total
+      }).finally(() => {
+        this.loading = false;
+      })
+        // getListOrder(page.currentPage, page.pageSize, params).then(res => {
+        //     console.log(res,155)
+        //     this.data = res.data.data.records
+        //     this.page.total = res.data.data.total
+        // }).finally(() => {
+        //     this.loading = false;
+        // })
+    },
+    importProMent() {
+      this.$emit('importProMent', this.goodsListSave);
+    },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(281),
+        this.option
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+  }
+}
+</script>
+<style scoped></style>

+ 1 - 1
src/views/tirePartsMall/financialManagement/paymentSettlement/detailsPage.vue

@@ -66,7 +66,7 @@
 </template>
 
 <script>
-import billDetail from "@/components/bill/selectOrderDetailList";
+import billDetail from "@/components/bill/selectOrderDetailListCG";
 import { saveSubmit, collectionAndPayment, revokeCollectionAndPayment, detail, removeItems, getFinanceList, remove } from '@/api/accountingManagement/index.js';
 import { number } from "echarts";