import Api from "~/service/Api";
import moment from "moment";

export default {
  methods: {
    async handleSearch() {
      this.load = true;
      let rtnmsg = await Api.post("/frontend/smdsel", {
        ...this.model,
        pageNumber: this.pagination.pageNum,
        pageSize: this.pagination.pageSize,
      });
      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: parseInt(rtnmsg.data.total),
        };
      } else {
        this.$notify.error({
          title: this.$t("financing.错误"),
          message: this.$t("financing.服务请求失败!"),
        });
      }
      this.load = false;
    },
    async handleReset() {
      this.model.smdp.smdsup.ptpmod.pty.extkey = ''
      this.model.smdp.smdsup.act = ''
      this.model.smdp.smdsup.cur = ''
    },
    // 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;
    }
  },
};