Browse Source

添加农事 修改农事类型

master
邓宏 2 years ago
parent
commit
ffa65ff829
  1. 36
      pages/massif/add_farming.vue

36
pages/massif/add_farming.vue

@ -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"})
}

Loading…
Cancel
Save