|
|
@ -315,6 +315,7 @@ export const MdpFormMixin = { |
|
|
if(this.currOpType=='add' || this.currOpType=='subAdd' || this.currOpType=='detail'){ |
|
|
if(this.currOpType=='add' || this.currOpType=='subAdd' || this.currOpType=='detail'){ |
|
|
return false; |
|
|
return false; |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
|
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -331,9 +332,8 @@ export const MdpFormMixin = { |
|
|
return true; |
|
|
return true; |
|
|
}, |
|
|
}, |
|
|
editSomeFields(row,fieldName,$event){ |
|
|
editSomeFields(row,fieldName,$event){ |
|
|
if(!this.editSomeFieldQxCheck()){ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var params={}; |
|
|
var params={}; |
|
|
var that=this; |
|
|
var that=this; |
|
|
var sels=[row] |
|
|
var sels=[row] |
|
|
@ -346,6 +346,9 @@ export const MdpFormMixin = { |
|
|
} |
|
|
} |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
if(!this.editSomeFieldQxCheck()){ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
this.setPks(sels,params); |
|
|
this.setPks(sels,params); |
|
|
var apiName="apis.editSomeFields" |
|
|
var apiName="apis.editSomeFields" |
|
|
if(!this.apiCheck(this.apis.editSomeFields,apiName)){ |
|
|
if(!this.apiCheck(this.apis.editSomeFields,apiName)){ |
|
|
@ -353,22 +356,33 @@ export const MdpFormMixin = { |
|
|
} |
|
|
} |
|
|
this.load.editSomeFields=true; |
|
|
this.load.editSomeFields=true; |
|
|
var func = this.apis.editSomeFields; |
|
|
var func = this.apis.editSomeFields; |
|
|
func(params).then(res=>{ |
|
|
|
|
|
var tips = res.data.tips; |
|
|
|
|
|
if(tips.isOk){ |
|
|
|
|
|
Object.assign(row,params) |
|
|
|
|
|
that.afterEditSomeFields(res,tips.isOk,params,row) |
|
|
|
|
|
that.dataBak=Object.assign({},this.editForm) |
|
|
|
|
|
}else{ |
|
|
|
|
|
if(this.dataBak && this.justPkIsMatch(row,this.dataBak)){ |
|
|
|
|
|
Object.assign(row,this.dataBak) |
|
|
|
|
|
} |
|
|
|
|
|
that.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) |
|
|
|
|
|
|
|
|
var form=this.$refs['editFormRef']; |
|
|
|
|
|
if(!form){ |
|
|
|
|
|
form=this.$refs['editForm']; |
|
|
|
|
|
} |
|
|
|
|
|
form.validate((valid) => { |
|
|
|
|
|
if (valid) { |
|
|
|
|
|
func(params).then(res=>{ |
|
|
|
|
|
var tips = res.data.tips; |
|
|
|
|
|
if(tips.isOk){ |
|
|
|
|
|
Object.assign(row,params) |
|
|
|
|
|
that.afterEditSomeFields(res,tips.isOk,params,row) |
|
|
|
|
|
that.dataBak=Object.assign({},this.editForm) |
|
|
|
|
|
}else{ |
|
|
|
|
|
if(this.dataBak && this.justPkIsMatch(row,this.dataBak)){ |
|
|
|
|
|
Object.assign(row,this.dataBak) |
|
|
|
|
|
} |
|
|
|
|
|
that.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch(err=>{ |
|
|
|
|
|
this.load.editSomeFields=false; |
|
|
|
|
|
}); |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}).catch(err=>{ |
|
|
|
|
|
this.load.editSomeFields=false; |
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
afterSubmit(res,isOk,currOpType){ |
|
|
afterSubmit(res,isOk,currOpType){ |
|
|
if(isOk && currOpType=='add'){ |
|
|
if(isOk && currOpType=='add'){ |
|
|
|