Browse Source

优化

master
陈裕财 3 years ago
parent
commit
04b1f3d4e1
  1. 3
      src/components/MdpDateRangeX/index.vue
  2. 60
      src/views/xm/core/xmIteration/XmIterationEdit.vue

3
src/components/MdpDateRangeX/index.vue

@ -192,6 +192,9 @@ export default {
}else if(dates && dates.length===0){
this.value[this.startKey]=null
this.value[this.endKey]=null
}else{
this.value[this.startKey]=null
this.value[this.endKey]=null
}
this.$emit('input',this.value)
}else if(this.value instanceof Array){

60
src/views/xm/core/xmIteration/XmIterationEdit.vue

@ -162,34 +162,44 @@
this.userSelectVisible = false;
},
editSomeFields(row,fieldName,$event){
editSomeFields(row,fieldName,$event){
if(this.opType==='add'){
return;
}
let params={};
params['ids']=[row].map(i=>i.id)
if(fieldName=='adminUserid'){
params['adminUserid']=$event[0].userid
params['adminUsername']=$event[0].username
}else if(fieldName=='startTime'){
params['startTime']=row.startTime
params['endTime']=row.endTime
}else{
params[fieldName]=$event
}
}
this.$refs.editForm.validate((vali)=>{
if(!vali){
this.$notify({position:'bottom-left',showClose:true,message:"表单检查不通过,请修改后提交", type: 'error' });
return;
}else{
let params={};
params['ids']=[row].map(i=>i.id)
if(fieldName=='adminUserid'){
params['adminUserid']=$event[0].userid
params['adminUsername']=$event[0].username
}else if(fieldName=='startTime'){
params['startTime']=row.startTime
params['endTime']=row.endTime
}else{
params[fieldName]=$event
}
var func = editSomeFieldsXmIteration
func(params).then(res=>{
let tips = res.data.tips;
if(tips.isOk){
this.editFormBak=[...this.editForm]
Object.assign(this.editForm,params)
this.$emit('edit-fields',params)
}else{
Object.assign(this.editForm,this.editFormBak)
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
}
}).catch((e)=>Object.assign(this.editForm,this.editFormBak))
}
});
var func = editSomeFieldsXmIteration
func(params).then(res=>{
let tips = res.data.tips;
if(tips.isOk){
this.editFormBak=[...this.editForm]
Object.assign(this.editForm,params)
this.$emit('edit-fields',params)
}else{
Object.assign(this.editForm,this.editFormBak)
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
}
}).catch((e)=>Object.assign(this.editForm,this.editFormBak))
},
initData(){
this.editForm=Object.assign(this.editForm, this.xmIteration);

Loading…
Cancel
Save