Commit 4b48e871 by 潘际乾

获取请求参数的函数getRequestDataFn提取至commonProcess

parent df69cb12
......@@ -13,25 +13,25 @@ export default {
return Api.post(this.declareParams.trnName+"/init",{params})
},
save(params){
return Api.post(this.declareParams.trnName+"/saveData", Utils.getRequestDataFn.call(this, params))
return Api.post(this.declareParams.trnName+"/saveData", this.wrapper(params))
},
exeuteCheck(rulePath,params){
return Api.post(this.declareParams.trnName+"/executeCheck/"+rulePath, Utils.getRequestDataFn.call(this, params))
return Api.post(this.declareParams.trnName+"/executeCheck/"+rulePath, this.wrapper(params))
},
executeDefault(rulePath,params)
{
return Api.post(this.declareParams.trnName+"/executeDefault/"+rulePath, Utils.getRequestDataFn.call(this, params))
return Api.post(this.declareParams.trnName+"/executeDefault/"+rulePath, this.wrapper(params))
},
executeRule(rulePath,params)
{
return Api.post(this.declareParams.trnName+"/executeRule/"+rulePath, Utils.getRequestDataFn.call(this, params))
return Api.post(this.declareParams.trnName+"/executeRule/"+rulePath, this.wrapper(params))
},
async checkAll(params){
const res = await Api.post(this.declareParams.trnName+"/checkAll", Utils.getRequestDataFn.call(this, params))
const res = await Api.post(this.declareParams.trnName+"/checkAll", this.wrapper(params))
return res
},
pedding(params){
return Api.post(this.declareParams.trnName+"/pending", Utils.getRequestDataFn.call(this, params))
return Api.post(this.declareParams.trnName+"/pending", this.wrapper(params))
},
async restoreDisplay()
{
......@@ -43,7 +43,7 @@ export default {
},
executeNotify(params)
{
return Api.post(this.declareParams.trnName+"/executeNotify", Utils.getRequestDataFn.call(this, params))
return Api.post(this.declareParams.trnName+"/executeNotify", this.wrapper(params))
},
}
}
\ No newline at end of file
......@@ -97,6 +97,26 @@ export default {
return "blur";
},
/**
* 以函数形式获取model(请求参数),保证取到的是最新赋值的
* @param {any} params 参数
* @returns
*/
wrapper(params) {
params = params || {}
const fn = async () => {
const that = this;
const data = await new Promise(resolve => {
// 保证前一次请求结果赋值VO完成
setTimeout(() => {
const d = Utils.flatObject(that.model)
resolve(d)
}, 0)
})
return {...data, params}
}
return fn;
},
/**
* 更新Model
* @param {any} data model数据
*/
......
......@@ -2,7 +2,7 @@ import Api from "~/service/Api"
import Utils from "~/utils/index"
export default {
async onDitpButgetref() {
let rtnmsg = await Api.post("ditopn/executeRule/ditp.butgetref", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/executeRule/ditp.butgetref", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
this.model.didgrp.rec.ownref=rtnmsg.data.didgrp_rec_ownref
......@@ -16,7 +16,7 @@ export default {
}
},
async onAplpDet() {
let rtnmsg = await Api.post("ditopn/executeRule/ditp.aplp.det", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/executeRule/ditp.aplp.det", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
// console.log(rtnmsg.data);
......@@ -29,7 +29,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/benp_det", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/benp_det", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -43,7 +43,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/revclause_buttxmsel", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/revclause_buttxmsel", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -57,7 +57,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/lcrgod_buttxmsel", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/lcrgod_buttxmsel", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -71,7 +71,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/lcrdoc_buttxmsel", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/lcrdoc_buttxmsel", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -85,7 +85,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/adlcnd_buttxmsel", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/adlcnd_buttxmsel", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -99,7 +99,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/insbnk_buttxmsel", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/insbnk_buttxmsel", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -113,7 +113,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/rmbp_det", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/rmbp_det", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -127,7 +127,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/defdet_buttxmsel", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/defdet_buttxmsel", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -141,7 +141,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/preper_buttxmsel", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/preper_buttxmsel", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -155,7 +155,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/setmod_det", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/setmod_det", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -169,7 +169,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/liaall_butmisamt", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/liaall_butmisamt", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -183,7 +183,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/liaall_butmissig", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/liaall_butmissig", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -197,7 +197,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/wrkp_det", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/wrkp_det", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -211,7 +211,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/othp_det", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/othp_det", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -225,7 +225,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/limpts_get1", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/limpts_get1", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -239,7 +239,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/limpts_get2", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/limpts_get2", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -253,7 +253,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("ditopn/limmod_trycal", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/limmod_trycal", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -267,7 +267,7 @@ export default {
// this.root.$refs.modelForm.validate(async valid => {
// if (!valid)
// return;
// let rtnmsg = await Api.post("ditopn/liaccv_add", Utils.getRequestDataFn.call(this))
// let rtnmsg = await Api.post("ditopn/liaccv_add", this.wrapper())
// if (rtnmsg.respCode == "AAAAAA") {
// //TODO 处理数据逻辑
......@@ -276,7 +276,7 @@ export default {
// this.$notify.error({ title: '错误', message: '服务请求失败!' });
// }
// })
let rtnmsg = await Api.post("ditopn/executeRule/liaall.liaccv.add", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/executeRule/liaall.liaccv.add", this.wrapper())
//const that = this.root;
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -294,7 +294,7 @@ export default {
// this.root.$refs.modelForm.validate(async valid => {
// if (!valid)
// return;
// let rtnmsg = await Api.post("ditopn/executeRule/liaall.liaccv.del", Utils.getRequestDataFn.call(this))
// let rtnmsg = await Api.post("ditopn/executeRule/liaall.liaccv.del", this.wrapper())
// if (rtnmsg.respCode == "AAAAAA") {
// //TODO 处理数据逻辑
......@@ -303,7 +303,7 @@ export default {
// this.$notify.error({ title: '错误', message: '服务请求失败!' });
// }
// })
let rtnmsg = await Api.post("ditopn/executeRule/liaall.liaccv.del", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/executeRule/liaall.liaccv.del", this.wrapper())
//const that = this.root;
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -328,14 +328,14 @@ export default {
let rtnmsg
if (cortyp == 'SWT'|| cortyp == 'FMT' || cortyp == 'CMT') {
this.model.setmod.msgmod.doccod = row.id
rtnmsg = await Api.post('cptopn/msgmod_butshw', { data: Utils.getRequestDataFn.call(this) })
rtnmsg = await Api.post('cptopn/msgmod_butshw', { data: this.wrapper() })
} else {
this.model.trnmod.trndoc.doccod = row.id
this.model.trnmod.trndoc.cortyp = cortyp
const params = {
index: index
}
rtnmsg = await Api.post("ditopn/executeDocpan", Utils.getRequestDataFn.call(this, params))
rtnmsg = await Api.post("ditopn/executeDocpan", this.wrapper(params))
}
if (rtnmsg.respCode == "AAAAAA") {
if (cortyp == 'SWT' || cortyp == 'FMT' || cortyp == 'CMT') {
......@@ -390,7 +390,7 @@ export default {
const params = {
index: index
}
let rtnmsg = await Api.post("ditopn/executeDocpanDetail", { ...Utils.getRequestDataFn.call(this), params })
let rtnmsg = await Api.post("ditopn/executeDocpanDetail", { ...this.wrapper(), params })
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
this.title = row.pandsc
......@@ -400,21 +400,21 @@ export default {
}
},
async BlurBennam(e){
let rtnmsg = await Api.post("ditopn/executeDefault/ditp.remark", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/executeDefault/ditp.remark", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
this.model.ditp.remark = rtnmsg.data.ditp_remark
}
},
async BlurAplname(e){
let rtnmsg = await Api.post("ditopn/executeDefault/ditp.remark", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/executeDefault/ditp.remark", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
this.model.ditp.remark = rtnmsg.data.ditp_remark
}
},
async BlurSignam(e){
let rtnmsg = await Api.post("ditopn/executeDefault/ditp.remark", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("ditopn/executeDefault/ditp.remark", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
this.model.ditp.remark = rtnmsg.data.ditp_remark
......@@ -436,7 +436,7 @@ export default {
// didgrp.iss.pts.extkey
async changeExtkey( ){
let rtnmsg = await Api.post("ditopn/executeRule/didgrp.iss.pts.extkey",{...Utils.getRequestDataFn.call(this)})
let rtnmsg = await Api.post("ditopn/executeRule/didgrp.iss.pts.extkey",{...this.wrapper()})
if (rtnmsg.respCode == "AAAAAA") {
Utils.copyValueFromVO(this.model,rtnmsg.data);
}
......
......@@ -5,7 +5,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("sptsel/usfmod_shwflt", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("sptsel/usfmod_shwflt", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -19,7 +19,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("sptsel/butypt", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("sptsel/butypt", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -33,7 +33,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("sptsel/dlmft", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("sptsel/dlmft", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -47,7 +47,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("sptsel/dlaxq", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("sptsel/dlaxq", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -61,7 +61,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("sptsel/butimg", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("sptsel/butimg", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......
......@@ -11,7 +11,7 @@ export default {
that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
this.model.trncorco.trnstm = res.data.trncorco_trnstm;
})
// let rtnmsg = await Api.post("trnrel/executeRule/searow", Utils.getRequestDataFn.call(this))
// let rtnmsg = await Api.post("trnrel/executeRule/searow", this.wrapper())
// if (rtnmsg.respCode == "AAAAAA") {
// //TODO 处理数据逻辑
// this.stmData.data = rtnmsg.data.trncorco_trnstm.rows;
......@@ -36,7 +36,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/seactr", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/seactr", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -51,7 +51,7 @@ export default {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/searow", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/searow", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -65,7 +65,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/dsp", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/dsp", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -79,7 +79,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/imgmod_newimg", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/imgmod_newimg", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -93,7 +93,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/imgmod_newhisimg", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/imgmod_newhisimg", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -107,7 +107,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/diacon_butdia", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/diacon_butdia", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -121,7 +121,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/imgmod_hisimg", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/imgmod_hisimg", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -139,7 +139,7 @@ export default {
that.model.trncorco.selinr = {
"rows": that.multipleSelection.map(idx => that.model.trncorco.trnstm.rows[idx])
}
const data = Utils.getRequestDataFn.call(this)
const data = this.wrapper()
let rtnmsg = await Api.post("/trnrel/executeRule/relrow", data)
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -169,7 +169,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/printe", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/printe", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -183,7 +183,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/reprow", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/reprow", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -200,7 +200,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
// if (!valid)
// return;
let rtnmsg = await Api.post("trnrel/rejrow", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/rejrow", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
// var cacheFileName = rtnmsg.data.cacheFileName;
......@@ -231,7 +231,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/relcor", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/relcor", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -245,7 +245,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/exi", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/exi", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -260,7 +260,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/recpan_det", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/recpan_det", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -274,7 +274,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/syswrn_butshw", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/syswrn_butshw", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -288,7 +288,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/recpan_notmap", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/recpan_notmap", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -302,7 +302,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/recpan_butspt", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/recpan_butspt", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -316,7 +316,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/recpan_inc", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/recpan_inc", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -330,7 +330,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/recpan_butord", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/recpan_butord", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -344,7 +344,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/imgmod_image", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/imgmod_image", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -358,7 +358,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/recpan_incben", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/recpan_incben", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......@@ -372,7 +372,7 @@ export default {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("trnrel/inftxt_buttxmsel", Utils.getRequestDataFn.call(this))
let rtnmsg = await Api.post("trnrel/inftxt_buttxmsel", this.wrapper())
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
......
......@@ -142,22 +142,6 @@ export default class Utils {
return output.join('');
}
static getRequestDataFn(params) {
params = params||{}
const fn = async () => {
const that = this;
const data = await new Promise(resolve => {
// 保证前一次请求结果赋值VO完成
setTimeout(() => {
const d = Utils.flatObject(that.model)
resolve(d)
}, 0)
})
return {...data, params}
}
return fn;
}
static positioningErrorMsg(fieldErrors, formFields) {
let firstErrorItem = null
for (let i = 0; i < formFields.length; i++) {
......
......@@ -360,39 +360,36 @@ import Utils from "~/utils/index"
export default {
inject: ['root'],
props: ["model", "codes"],
components: { SetpanDialog },
data() {
return {
dialogVisible2: false,
dialog2: {
feetxtinf:"",
feetxt:"",
},
index: 0,
data:[]
};
},
methods: {
...Event,
dispDefault(){
Api.post("cptopn/executeDefault/mac",Utils.getRequestDataFn.call(this)).then(res=>{
Utils.copyValueFromVO(this.model, res.data)
props: ["model", "codes"],
components: { SetpanDialog },
data() {
return {
dialogVisible2: false,
dialog2: {
feetxtinf:"",
feetxt:"",
},
index: 0,
data:[]
};
},
methods: {
...Event,
dispDefault(){
this.executeDefault("mac").then(res=>{
Utils.copyValueFromVO(this.model, res.data)
})
},
detail2(index, row) {
Api.post("cptopn/executeRule/det",Utils.getRequestDataFn.call(this)).then(res=>{
this.dialogVisible2 = true;
this.index = index;
this.dialog2 = row
})
this.executeRule("det").then(res=>{
this.dialogVisible2 = true;
this.index = index;
this.dialog2 = row
})
},
},
created: function () {},
},
created: function () {},
};
</script>
<style>
......
......@@ -147,8 +147,7 @@ export default {
this.model.didgrp.rec.tenmaxday = 0;
this.model.didgrp.blk.defdet = "";
}
const arg = Utils.getRequestDataFn.call(this);
Api.post("ditopn/executeCheck/didgrp.rec.avbby", arg).then(
this.executeCheck("didgrp.rec.avbby").then(
(res) => {
if (res.respCode == "AAAAAA"){
Utils.copyValueFromVO(this.model, res.data);
......@@ -157,8 +156,7 @@ export default {
);
},
recTenmaxdayEvent(){
const arg = Utils.getRequestDataFn.call(this);
Api.post("ditopn/executeDefault/didgrp.rec.tenmaxday", arg).then(
this.executeDefault("didgrp.rec.tenmaxday").then(
(res) => {
if (res.respCode = "AAAAAA"){
Utils.copyValueFromVO(this.model, res.data);
......
......@@ -528,16 +528,14 @@ export default {
this.centerDialogVisible = false;
console.log(this.model);
this.model.trnmod.trndoc.doceot.splice(this.index, 1, this.dialog);
let res = Api.post(
"ditopn/executeRule/trnmod.trndoc.doccur.butaddok",
Utils.getRequestDataFn.call(this)
);
if(res.data.respCode=="AAAAAA"){
//TODO
}else{
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
this.executeRule("trnmod.trndoc.doccur.butaddok").then(res => {
if(res.data.respCode=="AAAAAA"){
//TODO
}else{
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
})
},
},
created: function () {},
......
......@@ -734,8 +734,7 @@ export default {
}
},
nom1CurEvent(){
const data = Utils.flatObject(this.model);
Api.post("ditopn/executeDefault/didgrp.cbs.nom1.cur", Utils.getRequestDataFn.call(this)).then(
this.executeDefault("didgrp.cbs.nom1.cur").then(
(res) => {
if (res.respCode = "AAAAAA"){
Utils.copyValueFromVO(this.model, res.data);
......
......@@ -433,26 +433,26 @@ export default {
},
// 第二个表格
detail1(index, row) {
Api.post("ditopn/executeDefault/det",Utils.getRequestDataFn.call(this)).then(res=>{
this.executeDefault("det").then(res=>{
this.dialogVisible = true;
this.dialog = row;
this.index = index;
this.dialog = row;
this.index = index;
})
},
dispDefault(){
Api.post("ditopn/executeDefault/mac",Utils.getRequestDataFn.call(this)).then(res=>{
Utils.copyValueFromVO(this.model, res.data)
this.executeDefault("mac").then(res=>{
Utils.copyValueFromVO(this.model, res.data)
})
},
// 第三个表格
detail2(index, row) {
Api.post("ditopn/executeRule/det",Utils.getRequestDataFn.call(this)).then(res=>{
this.dialogVisible2 = true;
this.index = index;
this.dialog2 = row
})
this.executeRule("det").then(res=>{
this.dialogVisible2 = true;
this.index = index;
this.dialog2 = row
})
},
},
created: function () {},
......
......@@ -147,8 +147,7 @@ export default {
this.model.didgrp.rec.tenmaxday = 0;
this.model.didgrp.blk.defdet = "";
}
const arg = Utils.getRequestDataFn.call(this);
Api.post("ditopn/executeCheck/didgrp.rec.avbby", arg).then(
this.executeCheck("didgrp.rec.avbby").then(
(res) => {
if (res.respCode == "AAAAAA"){
Utils.copyValueFromVO(this.model, res.data);
......@@ -157,8 +156,7 @@ export default {
);
},
recTenmaxdayEvent(){
const arg = Utils.getRequestDataFn.call(this);
Api.post("ditopn/executeDefault/didgrp.rec.tenmaxday", arg).then(
this.executeDefault("didgrp.rec.tenmaxday").then(
(res) => {
if (res.respCode = "AAAAAA"){
Utils.copyValueFromVO(this.model, res.data);
......
......@@ -528,16 +528,14 @@ export default {
this.centerDialogVisible = false;
console.log(this.model);
this.model.trnmod.trndoc.doceot.splice(this.index, 1, this.dialog);
let res = Api.post(
"ditopn/executeRule/trnmod.trndoc.doccur.butaddok",
Utils.getRequestDataFn.call(this)
);
if(res.data.respCode=="AAAAAA"){
//TODO
this.executeRule("trnmod.trndoc.doccur.butaddok").then(res => {
if(res.data.respCode=="AAAAAA"){
//TODO
}else{
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
}else{
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
})
},
},
created: function () {},
......
......@@ -713,8 +713,7 @@ export default {
}
},
nom1CurEvent(){
const data = Utils.flatObject(this.model);
Api.post("ditopn/executeDefault/didgrp.cbs.nom1.cur", Utils.getRequestDataFn.call(this)).then(
this.executeDefault("didgrp.cbs.nom1.cur").then(
(res) => {
if (res.respCode = "AAAAAA"){
Utils.copyValueFromVO(this.model, res.data);
......
......@@ -432,26 +432,26 @@ export default {
},
// 第二个表格
detail1(index, row) {
Api.post("ditopn/executeDefault/det",Utils.getRequestDataFn.call(this)).then(res=>{
this.executeDefault("det").then(res=>{
this.dialogVisible = true;
this.dialog = row;
this.index = index;
this.dialog = row;
this.index = index;
})
},
dispDefault(){
Api.post("ditopn/executeDefault/mac",Utils.getRequestDataFn.call(this)).then(res=>{
Utils.copyValueFromVO(this.model, res.data)
this.executeDefault("mac").then(res=>{
Utils.copyValueFromVO(this.model, res.data)
})
},
// 第三个表格
detail2(index, row) {
Api.post("ditopn/executeRule/det",Utils.getRequestDataFn.call(this)).then(res=>{
this.dialogVisible2 = true;
this.index = index;
this.dialog2 = row
})
this.executeRule("det").then(res=>{
this.dialogVisible2 = true;
this.index = index;
this.dialog2 = row
})
},
},
created: function () {},
......
......@@ -194,7 +194,7 @@ export default {
console.log("进入office交易");
if(1) return
let rtnmsg = await Api.post("office/init",Utils.getRequestDataFn.call(this, {}))
let rtnmsg = await this.init()
console.log(rtnmsg)
if(rtnmsg.code == SUCCESS)
{
......
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