|
|
@ -1,5 +1,9 @@ |
|
|
|
<style lang="scss"> |
|
|
|
.container{ |
|
|
|
min-height:100%; |
|
|
|
background:#f6f6f6; |
|
|
|
padding:30rpx 0; |
|
|
|
|
|
|
|
.cu-navbar{ |
|
|
|
.action>button{ |
|
|
|
background:rgba(255, 255, 255, 0.1); |
|
|
@ -17,7 +21,7 @@ |
|
|
|
<template> |
|
|
|
<view class="container"> |
|
|
|
<cu-navbar text="采收信息" style="--bg:#10C176;--c:#fff;" isBack> |
|
|
|
<button slot="right" class="cu-btn round">提交</button> |
|
|
|
<button slot="right" class="cu-btn round" @click="submit">提交</button> |
|
|
|
</cu-navbar> |
|
|
|
|
|
|
|
<u-form class="card inline" :model="formData" :rules="rules" ref="form" labelWidth="auto"> |
|
|
@ -26,28 +30,48 @@ |
|
|
|
:key="k" |
|
|
|
v-bind="v" |
|
|
|
:field="k" |
|
|
|
:required="!!rules[k]"/> |
|
|
|
:required="!!rules[k]" |
|
|
|
:value="/^select$/.test(v.type)?fields[k].value:formData[k]"/> |
|
|
|
</u-form> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import request from '@/common/request' |
|
|
|
export default { |
|
|
|
data(){ |
|
|
|
return{ |
|
|
|
fields:{ |
|
|
|
num:{label:"采收数量",suffix:'kg'}, |
|
|
|
batch:{label:"收获批次号",btnText:"生成", btnFun(){console.log('asdfafd')}}, |
|
|
|
director:{label:"负责人",type:"select"}, |
|
|
|
recoveryDate:{label:"采收时间",type:"calendar"}, |
|
|
|
recoveryType:{label:"采收状态",type:"select"}, |
|
|
|
harvestNum:{label:"采收数量",suffix:'kg'}, |
|
|
|
harvestBatch:{label:"收获批次号",btnText:"生成", btnFun:()=>this.formData.harvestBatch=`CS${new Date().format('yyyyMMdd')}${new Date().getTime()}`}, |
|
|
|
principal:{label:"负责人",type:"select"}, |
|
|
|
harvestTime:{label:"采收时间",type:"calendar"}, |
|
|
|
status:{label:"采收状态",type:"select",columns:[[{label:"本次采收完后续还会采收",value:"1"},{label:"已全部采收完",value:"2"}]],value:[null]}, |
|
|
|
}, |
|
|
|
formData:{ |
|
|
|
name:"", |
|
|
|
harvestNum:"", |
|
|
|
harvestBatch:"", |
|
|
|
principal:"", |
|
|
|
harvestTime:"", |
|
|
|
status:"", |
|
|
|
plantSchedulId:"",//种植计划id |
|
|
|
plotId:"", |
|
|
|
}, |
|
|
|
rules:{ |
|
|
|
|
|
|
|
harvestNum: {required:true, message:"必填!", trigger:"blur"}, |
|
|
|
harvestBatch:{required:true, message:"必填!", trigger:"blur"}, |
|
|
|
principal:{required:true, message:"必填!", trigger:"blur"}, |
|
|
|
harvestTime:{required:true, message:"必填!", trigger:"blur"}, |
|
|
|
status:{required:true, message:"必填!", trigger:"blur"}, |
|
|
|
plantSchedulId:{required:true, message:"必填!", trigger:"blur"}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options){ |
|
|
|
this.formData.plantSchedulId=options.plantId |
|
|
|
this.formData.plotId=options.plotId |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
submit(){}, |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |