|
|
@ -282,7 +282,9 @@ export default { |
|
|
|
methods:{ |
|
|
|
async init(){ |
|
|
|
//农事类型 |
|
|
|
var res=await request("/api/plantFarming/listFarmName") |
|
|
|
var res=await request("/api/plantFarming/listFarmName",{ |
|
|
|
params:{baseId:this.$store.state.baseInfo.id} |
|
|
|
}) |
|
|
|
if(res.statu){ |
|
|
|
this.typeList=res.data |
|
|
|
}else{ |
|
|
@ -379,23 +381,25 @@ export default { |
|
|
|
}, |
|
|
|
async addType(){ |
|
|
|
if(this.tempType){ |
|
|
|
var res=await request("/common/api/dict/addDictItem",{ |
|
|
|
params:{ |
|
|
|
text: this.tempType, |
|
|
|
dictCode:"farming_type", |
|
|
|
} |
|
|
|
}) |
|
|
|
if(res.statu){ |
|
|
|
// var res=await request("/common/api/dict/addDictItem",{ |
|
|
|
// params:{ |
|
|
|
// text: this.tempType, |
|
|
|
// dictCode:"farming_type", |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// if(res.statu){ |
|
|
|
this.isShow=false |
|
|
|
this.typeList.push({label: this.tempType, value: this.tempType}) |
|
|
|
this.formData.farmingType=this.tempType |
|
|
|
this.tempType='' |
|
|
|
this.typeList.push({label: res.data.itemText, value: res.data.itemValue}) |
|
|
|
}else{ |
|
|
|
uni.showModal({ |
|
|
|
title:"提示", |
|
|
|
content:res.msg||"添加农资类型失败!", |
|
|
|
showCancel:false, |
|
|
|
}) |
|
|
|
} |
|
|
|
// this.typeList.push({label: res.data.itemText, value: res.data.itemValue}) |
|
|
|
// }else{ |
|
|
|
// uni.showModal({ |
|
|
|
// title:"提示", |
|
|
|
// content:res.msg||"添加农资类型失败!", |
|
|
|
// showCancel:false, |
|
|
|
// }) |
|
|
|
// } |
|
|
|
}else{ |
|
|
|
uni.showToast({title:"请输入内容!",icon:"none"}) |
|
|
|
} |
|
|
|