From 3655c4f8a1fc10ddca4aedaa96c3fe2679be6444 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Wed, 8 Feb 2023 17:53:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/massif/add_farming.vue | 61 +++++++------- pages/massif/agrSpecs.vue | 82 ++++++++++++++++++- pages/massif/plant_info.vue | 19 ++++- pages/stock/already.vue | 15 +++- .../d-form/components/d-form/d-form.vue | 8 +- .../d-picker/components/d-picker/d-picker.vue | 5 +- .../d-search/components/d-search/d-search.vue | 2 +- 7 files changed, 145 insertions(+), 47 deletions(-) diff --git a/pages/massif/add_farming.vue b/pages/massif/add_farming.vue index e12491d..b0b7fab 100644 --- a/pages/massif/add_farming.vue +++ b/pages/massif/add_farming.vue @@ -27,6 +27,11 @@ margin:0 30rpx 20rpx 0; width:calc(100%/4 - 30rpx); text-align: center; + transition: all 0.3s; + &.active{ + color:#fff; + background:#10C176; + } } } } @@ -106,22 +111,18 @@ 农事类型 - {{v.label}} + {{v.label}} 自定义+ {{massif.plotName}} - - - - - 阳光玫瑰种植1号地块 + 化肥 中量元素水溶肥 200kg - + @@ -132,7 +133,7 @@ v-bind="v" :field="k" :required="!!rules[k]" - :value="[]"/> + :value="formData[k]"/> @@ -144,37 +145,26 @@ export default { return{ typeList:[], fields:{ - people:{label:"操作人",styleType:"parallel"}, - date:{label:"操作日期",styleType:"parallel",type:"calendar"}, - imgs:{label:"农事图片",type:"upImg"}, - intro:{label:"产品介绍",type:"textarea"}, + principal:{label:"操作人",styleType:"parallel", disabled:true}, + farmingTime:{label:"操作日期",styleType:"parallel",type:"calendar"}, + images:{label:"农事图片",type:"upImg"}, + farmingRemarks:{label:"产品介绍",type:"textarea"}, }, formData:{ - companyId: "", - farmingId: "", - farmingMaterial: "", - farmingPlanId: "", - farmingRemarks: "", - farmingTime: "", - farmingType: "", - inputName: "", - inputQuantity: 0, - inputTotal: 0, - inputType: "", - inventoryId: "", - plotId: this.$store.state.plantBaseInfoId, - principal: "", - principalId: "", - specificationDes: "", - specificationId: "" - }, - rules:{ - intro:{required:true}, + farmingType:"", + principal: this.$store.getters['userInfo'].realname, + farmingTime:"", + images:[], + + plotId:"", + plantBaseInfoId: this.$store.state.plantBaseInfoId, }, + rules:{ }, massif:{} } }, onLoad(options){ + this.formData.plotId=options.plotId this.init() this.getMassifDetail(options.plotId) }, @@ -223,7 +213,12 @@ export default { }) } }) - } + }, + toAdd(){ + uni.navigateTo({ + url:"/pages/stock/already?intoPage=formRecord" + }) + }, }, } \ No newline at end of file diff --git a/pages/massif/agrSpecs.vue b/pages/massif/agrSpecs.vue index 4c49d26..16e7449 100644 --- a/pages/massif/agrSpecs.vue +++ b/pages/massif/agrSpecs.vue @@ -100,6 +100,49 @@ } } } + .agr-picker{ + padding:0 30rpx; + display:flex; + flex-direction: column; + justify-content: space-evenly; + .name{ + display:flex; + align-items: center; + text{ + font-size:16rpx; + &:first-child{ + color:#fff; + background:#10C176; + border-radius:0 20rpx 0 20rpx; + width:80rpx; + height:34rpx; + text-align: center; + line-height: 34rpx; + margin-right:16rpx; + } + &:nth-child(2){ + font-weight: bold; + font-size:20rpx; + } + &:nth-child(3){ + color:#999; + margin-left:6rpx; + } + } + } + .company{ + font-size:16rpx; + &:before{ + content:attr(data-name); + color:#FBA83C; + margin-right:20rpx; + } + &:after{ + content:attr(data-company); + color:#999999; + } + } + } } \ No newline at end of file diff --git a/pages/massif/plant_info.vue b/pages/massif/plant_info.vue index 25bb7b0..551d166 100644 --- a/pages/massif/plant_info.vue +++ b/pages/massif/plant_info.vue @@ -32,9 +32,10 @@ export default { fields:{ harvestNum:{label:"采收数量",suffix:'kg',type:"digit"}, harvestBatch:{label:"收获批次号",btnText:"生成", btnFun:()=>this.formData.harvestBatch=`CS${new Date().format('yyyyMMdd')}${new Date().getTime()}`}, - principal:{label:"负责人",type:"select",columns:[],value:[null]}, + principal:{label:"负责人",type:"select",columns:[],value:[]}, harvestTime:{label:"采收时间",type:"calendar"}, - status:{label:"采收状态",type:"select",columns:[[{label:"本次采收完后续还会采收",value:"1"},{label:"已全部采收完",value:"2"}]],value:[null]}, + status:{label:"采收状态",type:"select",columns:[[{label:"本次采收完后续还会采收",value:"1"},{label:"已全部采收完",value:"2"}]],value:[]}, + warehouseId:{label:"仓库",type:"select",columns:[],value:[]}, }, formData:{ harvestNum:"", @@ -42,6 +43,7 @@ export default { principal:"", harvestTime:"", status:"", + warehouseId:"", plantSchedulId:"",//种植计划id plotId:"",//地块id }, @@ -73,6 +75,19 @@ export default { showCancel:false, }) } + //仓库 下拉选 + var res=await request("/api/plantHarvest/getWarehouse",{ + params:{plantBaseId:this.$store.state.plantBaseInfoId} + }) + if(res.statu){ + this.fields.warehouseId.columns=[res.data.map(v=>({label:v.warehouseName,value:v.id}))] + }else{ + uni.showModal({ + title:"提示", + content:res.msg||"获取仓库选项失败!", + showCancel:false, + }) + } }, submit(){ this.$refs.form.validate().then(async valid=>{ diff --git a/pages/stock/already.vue b/pages/stock/already.vue index dece2bd..258fcaf 100644 --- a/pages/stock/already.vue +++ b/pages/stock/already.vue @@ -76,7 +76,7 @@ - + {{v.agriculturalGoods}} {{v.substanceName}} ({{v.specDescribe}}) @@ -104,9 +104,11 @@ export default { }, list:[], total:0, + intoPage:"",//formRecord 从农事记录进入 } }, - onLoad(){ + onLoad(options){ + this.intoPage=options.intoPage this.search() }, methods:{ @@ -122,8 +124,6 @@ export default { body: this.searchVal }) if(res.statu){ - this.list=this.list.concat(res.data.list) - this.list=this.list.concat(res.data.list) this.list=this.list.concat(res.data.list) this.total=res.data.total this.searchVal.pageNo++ @@ -137,6 +137,13 @@ export default { } } }, + toAddSpecs(id){ + if(this.intoPage=='formRecord'){ + uni.navigateTo({ + url:`/pages/massif/agrSpecs?id=${id}` + }) + } + }, } } \ No newline at end of file diff --git a/uni_modules/d-form/components/d-form/d-form.vue b/uni_modules/d-form/components/d-form/d-form.vue index 53ea9fb..c035d98 100644 --- a/uni_modules/d-form/components/d-form/d-form.vue +++ b/uni_modules/d-form/components/d-form/d-form.vue @@ -167,7 +167,7 @@ &>.u-form-item__body__right{ .u-input{ margin:0; - background:transparent; + background:transparent!important; input{ text-align: right!important; } @@ -207,7 +207,7 @@ - + {{suffix}} @@ -358,6 +358,10 @@ import {computeArea} from '@/common/utils' type:String, default:"", }, + disabled:{ + type:Boolean, + default:false, + }, startPlaceholder:"", endPlaceholder:"", }, diff --git a/uni_modules/d-picker/components/d-picker/d-picker.vue b/uni_modules/d-picker/components/d-picker/d-picker.vue index c612d6b..61c99db 100644 --- a/uni_modules/d-picker/components/d-picker/d-picker.vue +++ b/uni_modules/d-picker/components/d-picker/d-picker.vue @@ -66,10 +66,11 @@ - + + diff --git a/uni_modules/d-search/components/d-search/d-search.vue b/uni_modules/d-search/components/d-search/d-search.vue index b458d65..102ecaf 100644 --- a/uni_modules/d-search/components/d-search/d-search.vue +++ b/uni_modules/d-search/components/d-search/d-search.vue @@ -93,7 +93,7 @@ 猜你想搜 - {{v.label}} + {{v.label}}