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; } }, } }