index.js 3.34 KB
Newer Older
zenghuan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
import Api from "~/service/Api";
import moment from "moment";

export default {
    methods: {
        async handleSearch() {
            let rcvdatsta = this.model.rcvp.rcvdatsta;
            if (!rcvdatsta || rcvdatsta == "") {
                this.$notify.error({
                    title: this.$t("financing.错误"),
                    message: this.$t("financing.查询开始日期必输!"),
                });
                return;
            }
            let rcvdatend = this.model.rcvp.rcvdatend;
            if (!rcvdatend || rcvdatend == "") {
                this.$notify.error({
                    title: this.$t("financing.错误"),
                    message: this.$t("financing.查询结束日期必输!"),
                });
                return;
            }

            this.load = true;
fukai committed
25
            let rtnmsg = await Api.post("/gjzf/msgsel/query", {
zenghuan committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
                ...this.model.rcvp,
                dir: "<",
                pageNum: this.pagination.pageNum,
                pageSize: this.pagination.pageSize,
                rcvdatsta: moment(rcvdatsta).format("YYYY-MM-DD"),
                rcvdatend: moment(rcvdatend).format("YYYY-MM-DD"),
            });
            if (rtnmsg.respCode == SUCCESS) {
                this.load = false;
                this.stmData.data = [];
                const {list} = rtnmsg.data;
                const {codes:{sta1}} = this;
            
                list.forEach(v=>{
                    for(let i in sta1){
                        if(sta1[i].value == v.sta){
                            v.sta = sta1[i].label;
                        }
                    }
                })
                this.stmData.data = list;
                this.pagination = {
                    pageNum: rtnmsg.data.pageNum || 1,
                    pageSize: rtnmsg.data.pageSize || 10,
                    total: parseInt(rtnmsg.data.total),
                };
            } else {
                this.$notify.error({
                    title: this.$t("financing.错误"),
                    message: this.$t("financing.服务请求失败!"),
                });
            }
            this.load = false;
        },
        async handleReset() {
            this.model.rcvp.msgtyp = "";
            this.model.rcvp.rcvdatsta = new Date();
            this.model.rcvp.rcvdatend = new Date();
            this.model.rcvp.subtyp = "";
            this.model.rcvp.sndbak = "";
            this.model.rcvp.revbak = "";
            this.model.rcvp.actbic = "";
            this.model.rcvp.othref = "";
            this.model.rcvp.ownref = "";
            this.model.rcvp.cur = "";
            this.model.rcvp.act = "";
            this.model.rcvp.amtmin = "";
            this.model.rcvp.amtmax = "";
            this.model.rcvp.chnipt = "";
            this.model.rcvp.rspsta = "";
            this.model.rcvp.dtlchg = "";
            this.model.rcvp.sta = "";
            this.model.rcvp.gpi="";
        },
        // pageSize改变
        handleSizeChange(val) {
            this.pagination.pageNum = 1;
            this.pagination.pageSize = val;
            this.handleSearch();
        },
        // 页码改变
        handleCurrentChange(val) {
            this.pagination.pageNum = val;
            this.handleSearch();
        },
        handleSelectionChange(val){
            this.multipleSelection = val;
        }
    },
};