Commit b9a31392 by 潘际乾

checkAll的开关

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