index.js 3.97 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 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 96 97 98 99 100 101 102 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
import {getDectyp, init, initSpt, resolveResponse, save, saveSpt} from "../../../../../../service/business/rmb";
import Utils from "../../../../../../utils";
import commonFunctions from "../../../../../../mixin/commonFunctions";

export default {
    mixins: [commonFunctions],
	methods: {
		saveTcr() {
            this.$refs['modelForm'].validate(async (validStatic) => {
                if (validStatic) {
                    const businessType = this.$route.query.businessType;
                    if (businessType && businessType === "SPT") {
                        const sptInr = this.$route.query.businessInr;
                        saveSpt('rmb2112', this.model, sptInr).then(response => {
                            resolveResponse.bind(this)(response);
                        });
                    } else {
                        save('rmb2112', this.model).then(response => {
                            resolveResponse.bind(this)(response);
                        });
                    }
                } else {
                    // 前端校验失败
                    this.$notify({
                        title: '失败',
                        message: '校验失败',
                        type: 'error',
                    });
                }
            })
        },

        init(transName, pblInr) {
            this.model.pblmod.dectyp = getDectyp(transName);
            this.model.pblmod.wrkpbl.inr = pblInr;
            init('rmb2112', this.model).then(response => {
                if (response.respCode === SUCCESS) {
                    Utils.copyValueFromVoData(this.model, response.data);
                }
            })
        },

        initSpt(sptInr) {
            initSpt('rmb2112', this.model, sptInr).then(response => {
                if (response.respCode === SUCCESS) {
                    Utils.copyValueFromVoData(this.model.recgrp, response.data.recgrp);
                }
            })
        },

		// commitAll() {
		// 	this.$refs['modelForm'].validate(async (validStatic) => {
		// 		if (validStatic) {
		// 			this.all()
		// 		} else {
		// 			// 前端校验失败
		// 			this.$notify({
		// 				title: '失败',
		// 				message: '校验失败',
		// 				type: 'error',
		// 			});
		// 		}
		// 	})
		// },
		// async all() {
		// 	let tbkVoList = this.model.tdb2111.tbkVoList.slice(this.model.oldtbk)
		// 	let rtnmsg = await Api.post('/report/rmbsel/add2111All', tbkVoList)
		// 	if (rtnmsg.respCode == SUCCESS) {
		// 		this.$notify({
		// 			title: "成功",
		// 			message: "提交成功",
		// 			type: "success",
		// 		});
		// 		this.$store.commit('delTagsArry', this.$route.path);
		// 		this.$router.back()
		// 	}else{
		// 		this.$notify({
		// 			title: "失败",
		// 			message: "提交失败",
		// 			type: "error",
		// 		});
		// 	}
		// },
		// onChangeNewnum() {
		// 	let num = Number(this.model.tdb2111.tdbVo.paymentlist);
		// 	let count = this.model.oldtbk
		// 	if(num > 0) {
		// 		//页面个数
		// 		let cha = 0
		// 		if(this.model.tdb2111.tbkVoList){
		// 			cha = this.model.tdb2111.tbkVoList.length -count
		// 		}
		// 		if(cha < num) {
		//
		// 			// 新增页面
		// 			for(let i = 0;i < (num-cha);i++) {
		// 				this.model.tdb2111.tbkVoList.push({
		// 					objtyp:'TDB',
		// 					objinr:this.model.tdb2111.tdbVo.inr,
		// 					sta: '',
		// 					listopertype: '1',
		// 					seqno: i+ count+1,
		// 					balofpaycode: '',
		// 					bustypecode: '',
		// 					payamt: '',
		// 					bustypelist: '',
		// 					actualpayercode: '',
		// 					actualpayername: '',
		// 					ifprepayment: '',
		// 					prepayerscale: 0.00,
		// 					accountperiod: 0,
		// 					custstate: '',
		// 					certificateno: '',
		// 					contractno: '',
		// 					csta: '',
		// 					addword: '',
		// 				});
		// 			}
		// 		}else{
		// 			//删除多余的标签
		// 			this.model.tdb2111.tbkVoList.splice(num, cha -num)
        // }
		// 	}else{
		// 		this.model.tdb2111.tbkVoList.splice(count,this.model.tdb2111.tbkVoList.length-count)
		// 	}
		//
		// },
	}
}