Commit 6c534cf1 by 李少勇

组数调用的接口方法修改

parent 4fb4f2ea
......@@ -25,7 +25,7 @@ export default {
// console.log('valid', valid)
// })
const loading = this.loading('正在校验数据');
const rtnmsg = await Api.post(this.requestPrefix + '/checkAll', {
const rtnmsg = await Api.post('/service/gitopn/checkAll', {
...this.model,
transName: this.trnName,
userId: window.sessionStorage.userId || 'ZL',
......@@ -70,8 +70,10 @@ export default {
break;
case 'setpan':
let setfegRequest = buildFn.buildSetfeg(this.model, this.trnName);
let setglgRequest = buildFn.buildSetglg(this.model, this.trnName);
this.processSetpan(setfegRequest, setglgRequest);
// 此处利用回调是为了等setfeg的接口调用完成后才去获取setglg参数,由于setglg参数依赖于setfeg函数的返回值
this.processSetpan(setfegRequest, () => {
return buildFn.buildSetglg(this.model, this.trnName)
});
break;
case 'docpan':
let docpanRequest = buildFn.builDocpan(this.model, this.trnName);
......@@ -84,7 +86,6 @@ export default {
default:
return;
}
},
// 点击获取按钮拉取当前key字段下的表单数据
queryFormData(key) {
......
......@@ -4,7 +4,8 @@ import Utils from '~/utils';
export default {
async processLiaccv(liaccvRequest) {
const loading = this.loading('正在请求数据');
let rtnmsg = await Api.post('/service/liaccv/assertLiaccv', liaccvRequest);
let objtyp = setfegRequest.rec.objtyp;
let rtnmsg = await Api.post(`/service/${ objtyp.toLowerCase() }/liaccv/assertLiaccv`, liaccvRequest);
if (rtnmsg.respCode == SUCCESS) {
Utils.copyValueFromVO(this.model.liaccv, rtnmsg.data);
}
......
......@@ -4,7 +4,8 @@ import Utils from '~/utils';
export default {
async processTrndoc(trndocRequest) {
const loading = this.loading('正在请求数据')
let rtnmsg = await Api.post('/service/docpan/assertTrndoc', trndocRequest);
let objtyp = setfegRequest.rec.objtyp;
let rtnmsg = await Api.post(`/service/${ objtyp.toLowerCase() }/docpan/assertTrndoc`, trndocRequest);
if (rtnmsg.respCode == SUCCESS) {
Utils.copyValueFromVO(this.model.docpan, rtnmsg.data);
}
......
......@@ -3,9 +3,9 @@ import Utils from '~/utils';
export default {
async processLiaall(liaallRequest) {
//组数据,发post请求
const loading = this.loading('正在请求数据')
let rtnmsg = await Api.post('/service/liaall/assertLiaall', liaallRequest);
let objtyp = setfegRequest.rec.objtyp;
let rtnmsg = await Api.post(`/service/${ objtyp.toLowerCase() }/liaall/assertLiaall`, liaallRequest);
if (rtnmsg.respCode == SUCCESS) {
Utils.copyValueFromVO(this.model.liaall, rtnmsg.data);
}
......
......@@ -2,9 +2,9 @@ import Api from '~/service/Api';
export default {
async processGlentry(glentryRequest) {
//组数据,发post请求
const loading = this.loading('正在请求数据')
let rtnmsg = await Api.post('/service/gle/assertGle', glentryRequest);
let objtyp = setfegRequest.rec.objtyp;
let rtnmsg = await Api.post(`/service/${ objtyp.toLowerCase() }/gle/assertGle`, glentryRequest);
if (rtnmsg.respCode == SUCCESS) {
this.model.setmod.glemod.gleshwstm = rtnmsg.data.gleshwstm;
}
......
import Api from '~/service/Api';
export default {
async processSetpan(setfegRequest, setglgRequest) {
async processSetpan(setfegRequest, fn) {
let loading = this.loading('正在请求试算费用');
let rtnmsg = await Api.post('/service/setmod/calcSettleDetail', setfegRequest);
if (rtnmsg.respCode == SUCCESS) {
let objtyp = setfegRequest.rec.objtyp;
let rtnmsg = await Api.post(`/service/${ objtyp.toLowerCase() }/setmod/calcSettleDetail`, setfegRequest);
if (rtnmsg.respCode === SUCCESS) {
this.model.setmod.setfeg = rtnmsg.data.setfeg;
this.model.setmod.ref = rtnmsg.data.ref;
this.model.setmod.doccur = rtnmsg.data.doccur;
this.model.setmod.docamt = rtnmsg.data.docamt;
// 试算账务
if (this.model.setmod.setfeg.setfel.length > 0) {
if (this.model.setmod.setfeg.setfel.length === 0) {
loading = this.loading('正在请求试算账务');
let res = await Api.post('/service/setmod/calcPayDetail', setglgRequest);
let setglgRequestParams = fn()
let res = await Api.post(`/service/${ objtyp.toLowerCase() }/setmod/calcPayDetail`, setglgRequestParams);
if (res.respCode == SUCCESS) {
this.model.setmod.setglg = res.data.setglg;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment