diff --git a/pages/massif/add_transaction.vue b/pages/massif/add_transaction.vue index 66f5a05..793c1e0 100644 --- a/pages/massif/add_transaction.vue +++ b/pages/massif/add_transaction.vue @@ -100,11 +100,12 @@ export default { buyerType:{required:true,message:"交易类型必选!"}, buyerAddress:{required:true,message:"收货地址必填!"}, }, + eventChannel:null, } }, onLoad(options){ - var eventChannel=this.getOpenerEventChannel() - eventChannel.on("detail", e=>{ + this.eventChannel=this.getOpenerEventChannel() + this.eventChannel.on("detail", e=>{ this.detail=e this.formData.harvestId=e.id }) @@ -151,6 +152,7 @@ export default { }) if(res.statu){ uni.navigateBack() + this.eventChannel.emit("update") }else{ uni.showModal({ title:"提示", diff --git a/pages/massif/mana/farmRecord.vue b/pages/massif/mana/farmRecord.vue index 6060647..0faeb19 100644 --- a/pages/massif/mana/farmRecord.vue +++ b/pages/massif/mana/farmRecord.vue @@ -128,6 +128,10 @@ export default { plotId:{ type:String, default:"" + }, + plantId:{ + type:String, + default:"" } }, data(){ @@ -137,6 +141,7 @@ export default { pageNo:1, pageSize:6, PlantBaseInfoId: this.$store.state.plantBaseInfoId, + plantScheduleId: "", startTime:"", endTime:"", }, @@ -159,12 +164,19 @@ export default { }} }) }, + reSearch(){ + this.list=[] + this.total=0 + this.searchVal.pageNo=1 + this.search() + }, async search(){ if(this.total==0 || this.list.length - + - + - + - + @@ -61,10 +64,38 @@ export default { {name:"交易记录"}, ], plotId:"", + plantId:"", + farm_plantId:"", + recoveryId:"", maps:null, } }, + watch:{ + plantId(n){ + this.$nextTick(()=>{ + this.$refs.recovery.reSearch() + }) + if(n)this.tabIndex=2; + }, + farm_plantId(n){ + this.$nextTick(()=>{ + this.$refs.farmRecord.reSearch() + }) + if(n)this.tabIndex=1; + }, + recoveryId(n){ + this.$nextTick(()=>{ + this.$refs.transactions.reSearch() + }) + if(n)this.tabIndex=3 + }, + tabIndex(n,o){ + if(n!=2)this.plantId=""; + if(n!=1)this.farm_plantId=""; + if(n!=3)this.recoveryId=""; + } + }, onLoad(options){ this.plotId=options.id }, diff --git a/pages/massif/mana/plantPlan.vue b/pages/massif/mana/plantPlan.vue index 32c1eae..dc06f38 100644 --- a/pages/massif/mana/plantPlan.vue +++ b/pages/massif/mana/plantPlan.vue @@ -256,7 +256,7 @@ export default { toAdd(plantId){ uni.navigateTo({ url:`/pages/massif/plant_info?plantId=${plantId}&plotId=${this.plotId}`, - events:{ toRecovery:()=> this.$emit("trigger",{tabIndex:2,plantId}) } + events:{ toRecovery:()=> this.$emit("trigger", plantId) } }) }, del(index){ diff --git a/pages/massif/mana/recovery.vue b/pages/massif/mana/recovery.vue index b75b42e..28a7608 100644 --- a/pages/massif/mana/recovery.vue +++ b/pages/massif/mana/recovery.vue @@ -144,8 +144,12 @@ export default { props:{ plotId:{ type:String, - defaylt:"" + default:"" }, + plantId:{ + type:String, + default:"", + } }, data(){ return{ @@ -164,28 +168,25 @@ export default { }, created(){ this.search() + }, methods:{ - reSearch(plantId){ - this.$nextTick(()=>{ - this.list=[] - this.total=0 - this.searchVal.pageNo=1 - this.search(plantId) - }) + reSearch(){ + this.clean() + this.search() }, clean(){ this.list=[] this.total=0 this.searchVal.pageNo=1 }, - async search(plantId=''){ + async search(){ if(this.total==0||this.list.length{this.$emit("trigger",e.id)}}, success(res){ res.eventChannel.emit('detail',e) } diff --git a/pages/massif/plant_info.vue b/pages/massif/plant_info.vue index 404400d..96ce40a 100644 --- a/pages/massif/plant_info.vue +++ b/pages/massif/plant_info.vue @@ -53,6 +53,7 @@ export default { principal:{required:true, message:"负责人必填!", trigger:"blur"}, harvestTime:{required:true, message:"采收时间必填!", trigger:"blur"}, status:{required:true, message:"采收状态必填!", trigger:"blur"}, + warehouseId:{required:true, message:"仓库必选!"}, }, eventChannel:null, } diff --git a/pages/massif/plant_plan.vue b/pages/massif/plant_plan.vue index bbaeaf4..9efd65b 100644 --- a/pages/massif/plant_plan.vue +++ b/pages/massif/plant_plan.vue @@ -49,7 +49,6 @@ export default { principal:{label:"负责人"}, principalId:{label:"负责人身份证"}, productIntroduce:{label:"产品介绍",type:"textarea"}, - }, formData:{ varietyName:"",