Commit b9a31392 by 潘际乾

checkAll的开关

parent 2d7a8217
...@@ -35,10 +35,14 @@ export default { ...@@ -35,10 +35,14 @@ export default {
let data = Utils.flatObject(this.model) let data = Utils.flatObject(this.model)
return Api.post(this.declareParams.trnName+"/executeRule/"+rulePath,{...data,params}) return Api.post(this.declareParams.trnName+"/executeRule/"+rulePath,{...data,params})
}, },
checkAll(params){ async checkAll(params){
params = params||{} params = params||{}
let data = Utils.flatObject(this.model) let data = Utils.flatObject(this.model)
return Api.post(this.declareParams.trnName+"/checkAll",{...data,params}) const res = await Api.post(this.declareParams.trnName+"/checkAll",{...data,params})
if (res.respCode === SUCCESS) {
this.changeFormValidateDisabled(false);
}
return res
}, },
pedding(params){ pedding(params){
params = params||{} params = params||{}
......
...@@ -5,22 +5,31 @@ export default { ...@@ -5,22 +5,31 @@ export default {
mixins: [commonApi,commonDeclare], mixins: [commonApi,commonDeclare],
data: function () { data: function () {
return { return {
defFlag:true
} }
}, },
created: function () {}, // created: function () {},
mounted() { created() {
if(!this.isInDisplay){ if(!this.isInDisplay){
this.ruleWatcher() this.ruleWatcher()
this.ruleCheck() this.ruleCheck()
} }
}, },
methods: { methods: {
openWatch(flag){
this.defFlag = !!flag
},
ruleWatcher() { ruleWatcher() {
if(!this.defaultRules) if(!this.defaultRules)
return return
const that = this; const that = this;
Object.keys(that.defaultRules).forEach(key => { Object.keys(that.defaultRules).forEach(key => {
that.$watch("model." + key, _.debounce(that.defaultRules[key], 1000)) let func = function(){
if(!that.defFlag){
that.defaultRules[key].apply(that)
}
}
that.$watch("model." + key, _.debounce(func, 1000))
}) })
}, },
ruleCheck() { ruleCheck() {
...@@ -46,6 +55,13 @@ export default { ...@@ -46,6 +55,13 @@ export default {
} }
} }
this.rules = res; this.rules = res;
},
changeFormValidateDisabled(flag) {
const fields = this.$refs.modelForm.fields
for (let i = 0; i < fields.length; i++) {
const field = fields[i];
field.validateDisabled = flag
}
} }
}, },
computed:{ computed:{
......
...@@ -15,7 +15,7 @@ export default { ...@@ -15,7 +15,7 @@ export default {
"didgrp.rmb.pts.extkey": defaultDidgrpRmbPtsExtkey, "didgrp.rmb.pts.extkey": defaultDidgrpRmbPtsExtkey,
"setmod.dspflg": defaultSetmodDspflg, "setmod.dspflg": defaultSetmodDspflg,
"liaall.limmod.othp.det": defaultLiaallLimmodOthpDet, "liaall.limmod.othp.det": defaultLiaallLimmodOthpDet,
"mtabut.coninf.oitinf.labinftxt": defaultMtabutConinfOitinfLabinftxt, "mtabut.coninf.oitinf.labinftxt": defaultMtabutConinfOitinfLabinftxt,
"mtabut.coninf.oitset.labinftxt": defaultMtabutConinfOitsetLabinftxt, "mtabut.coninf.oitset.labinftxt": defaultMtabutConinfOitsetLabinftxt,
"ditp.benp.det": defaultDitpBenpDet, "ditp.benp.det": defaultDitpBenpDet,
"liaall.limmod.limpts.lsh": defaultLiaallLimmodLimptsLsh, "liaall.limmod.limpts.lsh": defaultLiaallLimmodLimptsLsh,
......
...@@ -172,13 +172,14 @@ export default { ...@@ -172,13 +172,14 @@ export default {
}, },
methods:{ methods:{
tabClick(vm){ tabClick(vm){
this.$refs.modelForm.validate(valid => { this.changeFormValidateDisabled(true)
if (valid){ // this.$refs.modelForm.validate(valid => {
console.log(1) // if (valid){
}else{ // console.log(1)
console.log(0) // }else{
} // console.log(0)
}) // }
// })
const label = vm.label const label = vm.label
if (label === "账务") { if (label === "账务") {
this.executeRule("setmod.setpan").then(res => { this.executeRule("setmod.setpan").then(res => {
...@@ -195,7 +196,8 @@ export default { ...@@ -195,7 +196,8 @@ export default {
} }
} }
}, },
created:async function(){ mounted:async function(){
this.changeFormValidateDisabled(true);
console.log("进入ditopn交易"); console.log("进入ditopn交易");
let rtnmsg = await this.init() let rtnmsg = await this.init()
if(rtnmsg.respCode == SUCCESS) if(rtnmsg.respCode == SUCCESS)
...@@ -204,9 +206,13 @@ export default { ...@@ -204,9 +206,13 @@ export default {
console.log(rtnmsg) console.log(rtnmsg)
Utils.copyValueFromVO(this.model,rtnmsg.data) Utils.copyValueFromVO(this.model,rtnmsg.data)
console.log(this.model); console.log(this.model);
if(this.isInDisplay) if(this.isInDisplay){
this.restoreDisplay() this.restoreDisplay()
}
const that = this;
this.$nextTick(() => {
that.openWatch(false);
})
} }
else else
{ {
......
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