index.js 3.97 KB
Newer Older
WH 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 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
import Api from '~/service/Api';
import { getTrnNameByInr } from "~/service/business/common";
import moment from 'moment';

export default {
  methods: {
    async handleSearch() {
      let opndatfrom = this.model.infcon.opndatfrom;
      if (!opndatfrom || opndatfrom == '') {
        this.$notify.error({ title: '错误', message: '查询开始日期必输!' });
        return;
      }
      let opndatto = this.model.infcon.opndatto;
      if (!opndatto || opndatto == '') {
        this.$notify.error({ title: '错误', message: '查询结束日期必输!' });
        return;
      }
      let params = {
        ...this.model.infcon,
        pageIndex: this.pagination.pageIndex,
        pageSize: this.pagination.pageSize,
        opndatfrom:moment(opndatfrom).format('YYYY-MM-DD'),
        opndatto:moment(opndatto).format('YYYY-MM-DD'),
      };
      let rtnmsg = await Api.post('/service/infbod/getList', params);
      if (rtnmsg.respCode == SUCCESS) {
        this.stmData.data = [];
        this.stmData.data = rtnmsg.data.list;
        // debugger
        this.pagination.total = rtnmsg.data.total;
      } else {
        this.$notify.error({ title: '错误', message: '服务请求失败!' });
      }
    },

    async handleReset() {
      this.model.infcon.seaownref = '';
      this.model.infcon.opndatfrom = new Date();
      this.model.infcon.opndatto = new Date();
      this.model.infcon.searef = '';
      this.model.infcon.pty.extkey = '';
      this.model.infcon.usr.extkey = '';
      this.model.infcon.searol = '';
      this.model.infcon.pty.nam = '';
      this.model.infcon.seapty = '';
      this.model.infcon.curtxt1 = '';
      this.model.infcon.nam = '';
      this.model.infcon.seaamtfr = '';
      this.model.infcon.seaamtto = '';
      this.model.infcon.seasta = '';
      this.model.infcon.doctypcod = '';

    },

    // pageSize改变
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.pagination.pageIndex = 1;
      this.pagination.pageSize = val;
      this.handleSearch();
    },
    // 页码改变
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.pagination.pageIndex = val;
      this.handleSearch();
    },

    // 详情
    async details(row) {
      const params = {
        //根据xx字段 查询详情表的数据
        inr:row.inr,
        userId: window.sessionStorage.userId || 'ZL',
        ownref: row.ownref,
      };
      const res = await Api.post('/service/infbod/getDetail', params);
      if (res.respCode === SUCCESS) {
        this.trnData.data = res.data;
      }
    },

83 84 85 86 87 88 89
    toBotdav() {
      // 点击开立,清空从待经办进来的时候带的行参数
      localStorage.setItem('row_botdav', null)
      localStorage.setItem('review_botdav',null)
      this.$router.history.push('/business-new/bottdav');
    },

WH committed
90 91 92 93 94 95 96 97 98 99 100 101
    // 关闭详情弹框
    closeDetailsDialog(refId) {
      this.$refs[refId].doClose();
      console.log('close');
    },

    // 处理
    async handler(row) {
      this.initdialog = true;
      this.currentHandleRow = row
      const params = {
        //根据xx字段 查询处理的数据
liaoxing committed
102
        seaownref: row.seaownref,
WH committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
      };
      const res = await Api.post('/service/infbod/dealWithByOwnref', params);
      if (res.respCode === SUCCESS) {
        if (res.data) {
          this.handlerDataList = []
          Object.keys(res.data).map((item) => {
            this.handlerDataList.push({
              label: item,
              value: res.data[item]
            })
          })
        }
      }
    },

    handleClick (btn) {
      if (btn.value === 'N') {
        return
      }
      let filterRoute = this.btnRouteMap.filter((item) => {
        return item.label === btn.label
      })
      this.$router.history.push({
        path: filterRoute[0].route,
        query: {
          inr: this.currentHandleRow.inr
        }
      });
131
      this.initdialog = false;
WH committed
132 133 134 135 136 137 138
    },
    // 关闭处理弹框
    closeHandlerDialog() {
      this.initdialog = false;
    },
  },
};