index.js 1.86 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 commonFunctions from '~/mixin/commonFunctions.js';
import { cloneDeep } from "lodash";
import Utils from '~/utils/index.js';
import Pts from '~/components/business/commonModel/Pts.js';

export default {
	mixins: [commonFunctions],
	methods: {
		//获取单据编号
		async onBttpButgetref() {
			let params = {
			btttyp: "BP",
			ptainr: this.model.btdgrp.be1.pts.ptainr,
			ownref: this.model.btdgrp.rec.ownref,
			btdgrp: this.model.btdgrp,
			};
			const loading = this.loading();
			let res = await Api.post("/Lc/ref/btd", params);
			loading.close();
			if (res.respCode == SUCCESS) {
			this.model.btdgrp.rec.ownref = res.data;
			} else {
        this.$message.error(res.respMsg);
      }
		},

		defaultMatdefN1000(){
			if(this.model.btdgrp.rec.matdat != null || this.model.btdgrp.rec.doctypcod === 'P'){
				this.module.btdgrp.blk.matper = ""
			}
			if(this.model.btdgrp.blk.matper != null || this.model.btdgrp.rec.doctypcod === 'P'){
				this.module.btdgrp.blk.matdat = ""
			}
		},

		defaultBtdgrpBlkDocdisN10(){
			if(this.model.btdgrp.blk.docdisflg === ""){
				this.model.btdgrp.blk.docdis = this.model.oldbtdgrp.blk.docdis
			}
		},

		docprbrolDefault() {
			if (this.model.btdgrp.rec.docprbrol == "ADT")
			{
				this.model.btdgrp.prb = cloneDeep(this.model.ltdgrp.adt);
				this.model.btdgrp.prb.pts.rol = "PRB";
				
			}else if (this.model.btdgrp.rec.docprbrol == "BE2")
			{
				this.model.btdgrp.prb = cloneDeep(this.model.ltdgrp.be2);
				this.model.btdgrp.prb.pts.rol = "PRB";
			}else{
				const restObj = {
					pts: new Pts().data,
				}
				this.model.btdgrp.prb = cloneDeep(restObj);
				this.model.btdgrp.prb.pts.rol = "PRB";
			}
    },
    
    async queryAdvData(ltdinr) {
      let res = await Api.post("/Lc/lttdck/queryAdvData", ltdinr);
      if (res.respCode == SUCCESS) {
        return res.data;
      }
    },

	}
}