Commit 1b1dc516 by liuxin

customModel初始化

parent f4d03b81
...@@ -112,6 +112,19 @@ export default { ...@@ -112,6 +112,19 @@ export default {
loading.close() loading.close()
return rtnmsg return rtnmsg
}, },
async executeCustomRule(rulePath, params, delayCb) {
const loading = this.loading("正在请求数据")
//copy
Utils.copyCustomFromModel(this.customModel, this.model)
console.log(this.customModel)
let rtnmsg = await Api.post(this.requestPrefix + "/executeRule/" + rulePath, this.wrapperCustom(params, delayCb))
if (rtnmsg.respCode == SUCCESS) {
this.updateValueSet(rtnmsg.codeSet)
this.showBackendErrors(rtnmsg.fieldErrors)
}
loading.close()
return rtnmsg
},
async checkAll(params) { async checkAll(params) {
const loading = this.loading("正在校验数据") const loading = this.loading("正在校验数据")
const rtnmsg = await Api.post(this.requestPrefix + "/checkAll", this.wrapper(params)) const rtnmsg = await Api.post(this.requestPrefix + "/checkAll", this.wrapper(params))
......
...@@ -130,11 +130,19 @@ export default { ...@@ -130,11 +130,19 @@ export default {
rulePath = "cnybop.libp" rulePath = "cnybop.libp"
} }
if (!!rulePath) { if (!!rulePath) {
this.executeRule(rulePath).then(res => { // if(rulePath == "setmod.setpan"){
if (res.respCode == SUCCESS) { // this.executeCustomRule(rulePath).then(res => {
this.updateModel(res.data) // if (res.respCode == SUCCESS) {
} // this.updateModel(res.data)
}) // }
// })
// }else{
this.executeRule(rulePath).then(res => {
if (res.respCode == SUCCESS) {
this.updateModel(res.data)
}
})
// }
} }
}, },
/** /**
...@@ -159,6 +167,24 @@ export default { ...@@ -159,6 +167,24 @@ export default {
} }
return fn; return fn;
}, },
wrapperCustom(params,delayCb) {
params = params || {}
params['isCustom'] = true
const fn = async () => {
const that = this;
const data = await new Promise(resolve => {
// 保证前一次请求结果赋值VO完成
setTimeout(() => {
delayCb && delayCb()
const d = Utils.flatObject(that.customModel)
resolve(d)
}, 0)
})
params['keys'] = Object.keys(data)
return { ...data, params }
}
return fn;
},
/** /**
* 用于手动的触发model里属性的 executeDefault * 用于手动的触发model里属性的 executeDefault
* @param {string} rule 执行的 rule path * @param {string} rule 执行的 rule path
......
import Api from "~/service/Api"
import Pub from "../Public"
import Rec from '../Public/Dids/Did'
import Cbs from '../Public/Dids/Did'
export default class customDitopn {
constructor() {
this.data = {
didgrp: {
rec: new Rec().data,
cbs: {
nom1: new Cbs().data.nom1,
max: new Cbs().data.max,
},
apl: {
namelc: "", // 名称 .didgrp.apl.namelc
adrelc: "", // 地址 .didgrp.apl.adrelc
// dbfadrblkcn: "", // Chinese address .didgrp.apl.dbfadrblkcn
// rolsetflg: "", // 备查表相关字段
},
},
// ditp: new Dids().data.Ditp,
// litbenl1blk: "", // XMLPanel litbenl1的内置block .litbenl1blk
// litapll1blk: "", // XMLPanel litapll1的内置block .litapll1blk
// litrmbl1blk: "", // XMLPanel litrmbl1的内置block .litrmbl1blk
setmod: new Pub().data.Setmod,
// mtabut: new Pub().data.Mtabut,
// trnmod: new Pub().data.Trnmod,
// liaall: new Pub().data.Liaall,
// litameadv: "", // 特殊规定 .litameadv
// ameadvrmk: "", // 特殊规定条件 .ameadvrmk
// godnam: "", // 槧物简称 .godnam
// bchname: "", // branch name .bchname
pageId: "" // ctx的key
}
}
}
\ No newline at end of file
...@@ -244,5 +244,15 @@ export default class Utils { ...@@ -244,5 +244,15 @@ export default class Utils {
}); });
return uuid; return uuid;
} }
static copyCustomFromModel(customModel, model){
for(let key in customModel){
if(typeof customModel[key] == "object"){
this.copyCustomFromModel(customModel[key], model[key])
}else{
customModel[key] = model[key]
}
}
}
} }
\ No newline at end of file
...@@ -366,6 +366,18 @@ ...@@ -366,6 +366,18 @@
</c-col> </c-col>
<c-col :span="24"> <c-col :span="24">
<c-form-item label="开证行开证类型" prop="dedgrp.rec.dkflg">
<c-select
v-model="model.dedgrp.rec.dkflg"
style="width: 100%"
placeholder="请选择"
:code="codes.dkflg"
disabled
></c-select>
</c-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="有效地点" prop="dedgrp.rec.expplc"> <el-form-item label="有效地点" prop="dedgrp.rec.expplc">
<c-input <c-input
v-model="model.dedgrp.rec.expplc" v-model="model.dedgrp.rec.expplc"
......
...@@ -128,6 +128,7 @@ import Api from "~/service/Api"; ...@@ -128,6 +128,7 @@ import Api from "~/service/Api";
import Utils from "~/utils/index"; import Utils from "~/utils/index";
import CodeTable from "~/config/CodeTable"; import CodeTable from "~/config/CodeTable";
import Ditopn from "~/model/Ditopn"; import Ditopn from "~/model/Ditopn";
import customDitopn from "~/model/Ditopn/customIndex";
import commonProcess from "~/mixin/commonProcess"; import commonProcess from "~/mixin/commonProcess";
import commonFuncs from "~/mixin/commonFuncs"; import commonFuncs from "~/mixin/commonFuncs";
import Pattern from "~/model/Ditopn/Pattern"; import Pattern from "~/model/Ditopn/Pattern";
...@@ -187,6 +188,7 @@ export default { ...@@ -187,6 +188,7 @@ export default {
tabVal: "ovwp", tabVal: "ovwp",
trnName: "ditopn", trnName: "ditopn",
model: new Ditopn().data, model: new Ditopn().data,
customModel: new customDitopn().data,
checkRules: Check, checkRules: Check,
defaultRules: Default, defaultRules: Default,
pattern: Pattern, pattern: Pattern,
......
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