index.js 2.18 KB
Newer Older
fukai 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
import Api from '~/service/Api';
import Utils from '~/utils';
import commonFunctions from '~/mixin/commonFunctions.js';
export default {
  mixins: [commonFunctions],
  methods: {
    // 初始化
    initYapin(requestParams) {
      this.model.ypnmod.buildParams = requestParams;
      this.processYapin();
    },
    buildYapin() {
      let params = {
        ...this.model.ypnmod.buildParams,
				modifySet:this.model.ypnmod.modifySet,
				ypInfoVo:this.model.ypnmod.ypInfoVo,
				ypInfoVos:this.model.ypnmod.ypInfoVos,
				limmod:this.model.limmod
      };
      return params
    },
    async processYapin(requestParams) {
      if(requestParams){
        this.model.ypnmod.buildParams = requestParams
      }
      const loading = this.loading('正在请求押品');
      let yapinRequest = this.buildYapin()
      let objtyp = yapinRequest.rec.objtyp;
      let params = {
        ...yapinRequest,
			};
		
			let rtnmsg = await Api.post(`/${this.moduleRouter()}/${objtyp.toLowerCase()}/lim/yapinQuery`, params);
			
      if (rtnmsg.respCode === SUCCESS) {
				this.model.ypnmod.ypInfoVo = rtnmsg.data.ypInfoVo;
				this.model.ypnmod.ypInfoVos = rtnmsg.data.ypInfoVos;
      }
      loading.close();
      return rtnmsg;
  
    },
    // 查询
    async queryYapin() {
      if (this.root) {
         this.root.handleCheckPromise().then(async () => {
            //如果校验成功 执行名单筛查
            const loading = this.loading('正在筛查押品');
            let yapinRequest = this.buildYapin();
            let objtyp = '';
            if (yapinRequest && yapinRequest.rec) {
              objtyp = yapinRequest.rec.objtyp;
            }
            if (objtyp === '') {
              objtyp = 'GID';
            }
            let rtnmsg = await Api.post(`/${this.moduleRouter()}/${objtyp.toLowerCase()}/yp/QueryTymd`, yapinRequest);
            if (rtnmsg.respCode === SUCCESS) {
              if (rtnmsg.data) {
                this.model.ypnmod.ypList = rtnmsg.data.ypList;
                this.model.ypnmod.caseno = rtnmsg.data.caseno;  
                this.model.ypnmod.excuteflg = rtnmsg.data.excuteflg;
              }
            }
            loading.close();
         })
      }
    },
  },
};