Browse Source

新增表单

master
邓宏 2 years ago
parent
commit
b82836699f
  1. 3
      pages/massif/plant_plan.vue
  2. 18
      pages/warehouse/info.vue

3
pages/massif/plant_plan.vue

@ -34,6 +34,7 @@ export default {
return{
fields:{
varietyName:{label:"品种名称"},
warehouseNo:{label:"种植编号"},
plantType:{label:"作物类型",type:"select",columns:[[]],value:[]},
plantArea:{label:"种植面积(亩)",type:"digit"},
startTime:{label:"种植开始日期",type:"calendar"},
@ -53,6 +54,7 @@ export default {
},
formData:{
varietyName:"",
warehouseNo:"",
plantType:"",
plantArea:"",
startTime:"",
@ -67,6 +69,7 @@ export default {
},
rules:{
varietyName: {required:true, message:"品种名称必填!", trigger:"blur"},
warehouseNo: {required:true, message:"种植编号必填!", trigger:"blur"},
plantType: {required:true, message:"作物类型必选!", trigger:"blur"},
plantArea: {required:true, type:"number", message:"种植面积必填!", trigger:"blur"},
startTime: {required:true, message:"种植开始日期必选!", trigger:"blur"},

18
pages/warehouse/info.vue

@ -30,6 +30,7 @@ import request from '@/common/request.js'
warehouseName:{label:"仓库名称"},
warehouseAddress:{label:"仓库位置",type:"textarea"},
warehouseVolume:{label:"仓库容量(㎡)", type:"digit",placeholder:"请输入仓库容量"},
goods_type:{label:"存储物品类型",type:"select",columns:[],value:[]},
warehouseType:{label:"仓库类型",type:"select",columns:[[{label:"标签1",value:1},{label:"标签2",value:2}]],value:[]},
contactPeople:{label:"基地管理员"},
contactNumber:{label:"管理员联系方式"},
@ -39,6 +40,7 @@ import request from '@/common/request.js'
warehouseName:"",
warehouseAddress:"",
warehouseVolume:"",
goods_type:'',
warehouseType:"",
contactPeople:"",
contactNumber:"",
@ -49,6 +51,7 @@ import request from '@/common/request.js'
warehouseName:{required:true, message:"仓库名称必填!", trigger:["blur","change"]},
warehouseAddress:{required:true, message:"仓库位置必填!", trigger:["blur","change"]},
warehouseVolume:{required:true, message:"仓库容量必填!", type:"number", trigger:["blur","change"]},
goods_type:{required:true, message:"存储物品类型必填!", trigger:["blur","change"]},
warehouseType:{required:true, message:"仓库类型必选!", trigger:["blur","change"]},
contactPeople:{required:true, message:"基地管理员必填!", trigger:["blur","change"]},
contactNumber:{required:true, validator(rule,val,call){
@ -73,6 +76,7 @@ import request from '@/common/request.js'
},
methods:{
async init(){
//
var res=await request("/common/api/dict/queryDictItemByDictCode",{
method:"post",
params:{dictCode: "warehouse_type"}
@ -86,6 +90,20 @@ import request from '@/common/request.js'
showCancel:false,
})
}
//
var res=await request("/common/api/dict/queryDictItemByDictCode",{
method:"post",
params:{dictCode: "goods_type"}
})
if(res.statu){
this.fields.goods_type.columns=[res.data]
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取仓库类型选项失败!",
showCancel:false,
})
}
},
submit(){
this.$refs.form.validate().then(async valid=>{

Loading…
Cancel
Save