Browse Source

修改地块管理 页面跳转

master
邓宏 2 years ago
parent
commit
1267c1830e
  1. 6
      pages/massif/add_transaction.vue
  2. 12
      pages/massif/mana/farmRecord.vue
  3. 39
      pages/massif/mana/index.vue
  4. 2
      pages/massif/mana/plantPlan.vue
  5. 22
      pages/massif/mana/recovery.vue
  6. 1
      pages/massif/plant_info.vue
  7. 1
      pages/massif/plant_plan.vue

6
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:"提示",

12
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<this.total){
var res=await request("/api/plantFarming/listFarmByPlotId",{
params: {
...this.searchVal,
plotId: this.plotId,
plantScheduleId: this.plantId,
}
})
if(res.statu){

39
pages/massif/mana/index.vue

@ -27,16 +27,19 @@
<swiper :current="tabIndex" @change="tabIndex=$event.detail.current">
<swiper-item>
<plant-plan :plotId="plotId" @trigger="$refs.recovery.reSearch($event.plantId);tabIndex=$event.tabIndex"/>
<plant-plan
:plotId="plotId"
@trigger="plantId=$event"
@farm="farm_plantId=$event"/>
</swiper-item>
<swiper-item>
<farmRecord :plotId="plotId"/>
<farmRecord :plantId="farm_plantId" :plotId="plotId" ref="farmRecord"/>
</swiper-item>
<swiper-item>
<recovery :plotId="plotId" ref="recovery"/>
<recovery :plotId="plotId" :plantId="plantId" ref="recovery" @trigger="recoveryId=$event"/>
</swiper-item>
<swiper-item>
<transactions :plotId="plotId" ref="transactions"/>
<transactions :recoveryId="recoveryId" :plotId="plotId" ref="transactions"/>
</swiper-item>
</swiper>
</view>
@ -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
},

2
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){

22
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.total){
var res=await request("/api/plantHarvest/list",{
params:{
...this.searchVal,
plotId:this.plotId,
plantScheduleId: plantId,
plantScheduleId: this.plantId,
}
})
if(res.statu){
@ -205,6 +206,7 @@ export default {
toAddTransaction(e){
uni.navigateTo({
url:"/pages/massif/add_transaction",
events:{update:()=>{this.$emit("trigger",e.id)}},
success(res){
res.eventChannel.emit('detail',e)
}

1
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,
}

1
pages/massif/plant_plan.vue

@ -49,7 +49,6 @@ export default {
principal:{label:"负责人"},
principalId:{label:"负责人身份证"},
productIntroduce:{label:"产品介绍",type:"textarea"},
},
formData:{
varietyName:"",

Loading…
Cancel
Save