index.js 2.57 KB
Newer Older
wangweidong 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 25 26
import Api from "~/service/Api";
import moment from "moment";

export default {
    methods: {
        async handleSearch() {
            console.log("serach......");

            let opndatfrom = this.model.infcon.opndatfrom;
            if (!opndatfrom || opndatfrom == "") {
                this.$notify.error({
                    title: this.$t("financing.错误"),
                    message: this.$t("financing.查询开始日期必输!"),
                });
                return;
            }
            let opndatto = this.model.infcon.opndatto;
            if (!opndatto || opndatto == "") {
                this.$notify.error({
                    title: this.$t("financing.错误"),
                    message: this.$t("financing.查询结束日期必输!"),
                });
                return;
            }

            this.load = true;
wangweidong committed
27
            let rtnmsg = await Api.post("/funds/ftdsel/query", {
wangweidong committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
                ...this.model.infcon,
                dir: ">",
                pageNum: this.pagination.pageNum,
                pageSize: this.pagination.pageSize,
                opndatfrom: moment(opndatfrom).format("YYYY-MM-DD"),
                opndatto: moment(opndatto).format("YYYY-MM-DD"),
            });
            if (rtnmsg.respCode == SUCCESS) {
                this.load = false;
                this.stmData.data = [];
                this.stmData.data = rtnmsg.data.list;
                this.pagination = {
                    pageNum: rtnmsg.data.pageNum || 1,
                    pageSize: rtnmsg.data.pageSize || 10,
                    total: rtnmsg.data.total,
                };
            } else {
                this.$notify.error({
                    title: this.$t("financing.错误"),
                    message: this.$t("financing.服务请求失败!"),
                });
            }
            this.load = false;
        },
wangweidong committed
52
        //nothing
wangweidong committed
53 54 55 56 57 58 59 60
        async handleReset() {
            this.model.infcon.seaownref = "";
            this.model.infcon.opndatfrom = new Date();
            this.model.infcon.opndatto = new Date();
            this.model.infcon.nam = "";
            this.model.infcon.seacur = "";
            this.model.infcon.eaamtfr = "";
            this.model.infcon.eaamtto = "";
wangweidong committed
61

wangweidong committed
62 63 64 65 66 67 68 69 70 71 72 73 74 75
        },
        // pageSize改变
        handleSizeChange(val) {
            this.pagination.pageNum = 1;
            this.pagination.pageSize = val;
            this.handleSearch();
        },
        // 页码改变
        handleCurrentChange(val) {
            this.pagination.pageNum = val;
            this.handleSearch();
        },
    },
};