diff --git a/common/request.js b/common/request.js index 2d6f4b0..356bd2e 100644 --- a/common/request.js +++ b/common/request.js @@ -2,7 +2,7 @@ import store from "@/store" export function host(host='default',suffix='/plant_manage'){ var url=process.env.NODE_ENV === 'development'?{ - // default:`http://dpe74u.natappfree.cc` //陈 + // default:`http://e5ruv4.natappfree.cc` //陈 default:`http://nys8cm.natappfree.cc` //马 // default:`http://7r39sr.natappfree.cc` //何 // default:`http://192.168.0.116:8080` //孙 diff --git a/pages.js b/pages.js index 6d86c53..35dcef5 100644 --- a/pages.js +++ b/pages.js @@ -23,7 +23,7 @@ module.exports = hot((pagesJson)=>{ condition : { current: 0, list: [ - {name:"测试页面",path:"pages/massif/add_farming"}, + {name:"测试页面",path:"pages/stock/agrWarehouse"}, // {name: "地块管理",path: "pages/massif/mana/index","query": ""}, // {name: "地块基本信息",path: "pages/massif/info","query": ""}, {name: "登录",path: "pages/home/login","query": ""}, diff --git a/pages/massif/add_farming.vue b/pages/massif/add_farming.vue index a7506ac..6f6980a 100644 --- a/pages/massif/add_farming.vue +++ b/pages/massif/add_farming.vue @@ -124,11 +124,11 @@ {{massif.plotName}} - + 化肥 中量元素水溶肥 200kg - + @@ -144,7 +144,7 @@ - + @@ -157,19 +157,29 @@ export default { fields:{ principal:{label:"操作人",styleType:"parallel", disabled:true}, farmingTime:{label:"操作日期",styleType:"parallel",type:"calendar"}, - images:{label:"农事图片",type:"upImg"}, + farmingPlanId:{label:"种植计划",type:"select",columns:[],value:[]}, + images:{label:"农事图片",type:"upImg",num:3}, farmingRemarks:{label:"产品介绍",type:"textarea"}, }, formData:{ farmingType:"", principal: this.$store.getters['userInfo'].realname, + farmingPlanId:"", farmingTime:"", images:[], + farmingRemarks:"", plotId:"", plantBaseInfoId: this.$store.state.plantBaseInfoId, }, - rules:{ }, + rules:{ + farmingTime:{required:true,message:"操作日期必填!",trigger:'blur'}, + farmingPlanId:{required:true,message:"种植计划必选!",trigger:'blur'}, + images:{required:true,validator(rule,val,call){ + if(!this.fields.images.value)call(new Error("请上传农事图片!")); + else call() + },trigger:'blur'}, + }, massif:{}, tempType:"", isShow:false, @@ -178,7 +188,7 @@ export default { onLoad(options){ this.formData.plotId=options.plotId this.init() - this.getMassifDetail(options.plotId) + this.getMassifDetail() }, methods:{ async init(){ @@ -192,10 +202,23 @@ export default { showCancel:false, }) } + //种植计划下拉选择 + var res=await request("/api/plantFarming/getPlantPlan",{ + params:{plotId: this.formData.plotId} + }) + if(res.statu){ + this.farmingPlanId.columns=[res.data.map(v=>({}))] + }else{ + uni.showModal({ + title:"提示", + content:res.msg||"获取种植计划选项失败!", + showCancel:false, + }) + } }, - async getMassifDetail(id){ + async getMassifDetail(){ var res=await request("/api/plantPlot/queryById",{ - params:{id} + params:{id:this.formData.plotId} }) if(res.statu){ this.massif=res.data @@ -226,10 +249,25 @@ export default { } }) }, - toAdd(){ - uni.navigateTo({ - url:"/pages/stock/already?intoPage=formRecord" - }) + async addType(){ + if(this.tempType){ + var res=await request("/api/plantFarming/addFarmType",{ + params:{text: this.tempType} + }) + if(res.statu){ + this.isShow=false + this.tempType='' + this.typeList.push({label:v.itemText, value:v.itemValue}) + }else{ + uni.showModal({ + title:"提示", + content:res.msg||"添加农资类型失败!", + showCancel:false, + }) + } + }else{ + uni.showToast({title:"请输入内容!",icon:"none"}) + } }, }, } diff --git a/pages/stock/agrWarehouse.vue b/pages/stock/agrWarehouse.vue new file mode 100644 index 0000000..2827570 --- /dev/null +++ b/pages/stock/agrWarehouse.vue @@ -0,0 +1,52 @@ + + + \ No newline at end of file diff --git a/pages/stock/list.vue b/pages/stock/list.vue index ea6e4d8..4749a53 100644 --- a/pages/stock/list.vue +++ b/pages/stock/list.vue @@ -107,6 +107,56 @@ } } } + .dPicker{ + .stock-picker{ + display:flex; + flex-direction: column; + justify-content: space-evenly; + padding:0 20rpx; + &>.info{ + display:flex; + align-items: center; + text{ + &:first-child{ + color:#fff; + background:#10C176; + height:40rpx; + min-width:80rpx; + text-align: center; + line-height: 40rpx; + border-radius: 0 20rpx 0 20rpx; + margin-right:10rpx; + padding:0 6rpx; + font-size:24rpx; + } + &:nth-child(2){ + &:after{ + content:"("attr(data-unit)")"; + color:#999; + font-size:18rpx; + line-height: 40rpx; + margin-left:6rpx; + } + } + &:nth-child(3){ + margin-left:auto; + color:#F34848; + font-size:20rpx; + } + } + } + &>.company{ + font-size:24rpx; + display: flex; + text{ + color:var(--c); + &:first-child{ + flex-shrink: 0; + } + } + } + } + } } \ No newline at end of file diff --git a/pages/stock/mana.vue b/pages/stock/mana.vue index ab35088..c0e587f 100644 --- a/pages/stock/mana.vue +++ b/pages/stock/mana.vue @@ -11,7 +11,7 @@ } &>.btns{ flex-shrink: 0; - margin:0 30rpx; + margin:0 30rpx 30rpx; display:flex; border-radius: 30rpx; button{ @@ -33,6 +33,7 @@ flex-grow: 1; height:1rpx; .item{ + margin-top:0; &>.info{ display:flex; align-items: center; @@ -99,26 +100,16 @@ color:#fff; background:#10C176; } - // background:transparent; - // border:2rpx solid transparent; - // color:var(--c); - // font-weight: bold; - // font-size:30rpx; - // height:50rpx; - // width:50rpx; - // &:first-child{ - // border-radius: 30rpx 0 0 30rpx; - // border-color:var(--c); - // } - // &:nth-child(2){ - // border-radius: 0 30rpx 30rpx 0; - // border-color:var(--c); - // } } } } } } + &>button{ + flex-shrink: 0; + height: 60rpx!important; + margin:15rpx auto!important; + } }