Browse Source

修改零用页面搜索

master
邓宏 2 years ago
parent
commit
8e9dc0c2f9
  1. 2
      main.js
  2. 28
      pages/home/index.vue
  3. 2
      pages/massif/collectList.vue
  4. 4
      pages/massif/info.vue
  5. 4
      pages/warehouse/info.vue

2
main.js

@ -3,12 +3,14 @@ import App from './App'
import store from './store'
import uView from 'uview-ui';
import {defineObj,defineArray} from 'black-knight/lib/config/custom'
import {provise} from 'black-knight/lib/config/tools'
Vue.use(uView)
Vue.prototype.$store=store
Vue.prototype.$defineArray=defineArray
Vue.config.productionTip = false
Vue.prototype.$provise=new provise()
App.mpType = 'app'
const app = new Vue({
...App,

28
pages/home/index.vue

@ -305,7 +305,7 @@
<view style="display:flex;">
<view class="card mana">
<view class="title">
<text class="plant-dikuaimianji"/> 地块管理 <text class="more" @click="toMassif">更多>></text>
<text class="plant-dikuaimianji"/> 地块管理 <text class="more" @click="$u.route({type:'switchTab',url:'pages/massif/index'})">更多>></text>
</view>
<view class="item" v-for="(v,k) in massif.plotList||[]" :key="k">
<text class="over">{{v.plotName}}</text> <text>{{v.realityArea}}</text>
@ -391,9 +391,9 @@ import request,{host} from '@/common/request.js'
},
watch:{
"$store.state.plantBaseInfoId"(n){
this.getMassif(n)
this.getBaseInfo(n)
this.getStock(n)
this.getMassif()
this.getBaseInfo()
this.getStock()
}
},
onLoad() {
@ -403,6 +403,8 @@ import request,{host} from '@/common/request.js'
}else{
this.$store.commit("setBaseId", this.$store.getters['userInfo'].plantBaseInfoId)
}
this.$provise.on("updateMassif", this.getMassif())
this.$provise.on("updateStock", this.getStock())
},
methods: {
async getHeadImg(){
@ -412,9 +414,9 @@ import request,{host} from '@/common/request.js'
}
},
//
async getMassif(plantBaseId){
async getMassif(){
var res=await request("/api/plantIndex/queryPlot",{
params:{plantBaseId}
params:{plantBaseId: this.$store.state.plantBaseInfoId}
})
if(res.statu){
this.massif=res.data
@ -442,9 +444,9 @@ import request,{host} from '@/common/request.js'
})
}
},
async getBaseInfo(plantBaseId){
async getBaseInfo(){
var res=await request("/api/plantIndex/queryFarmWorkAndInput",{
params:{plantBaseId}
params:{plantBaseId: this.$store.state.plantBaseInfoId}
})
if(res.statu){
this.baseInfo=res.data
@ -457,9 +459,9 @@ import request,{host} from '@/common/request.js'
}
},
//
async getStock(baseId){
async getStock(){
var res=await request("/api/plantIndex/queryWarehouse",{
params:{baseId}
params:{baseId: this.$store.state.plantBaseInfoId}
})
if(res.statu){
this.stockList=res.data
@ -471,6 +473,10 @@ import request,{host} from '@/common/request.js'
})
}
},
}
},
onUnload(){
this.$provise.off("updateMassif")
this.$provise.off("updateStock")
},
}
</script>

2
pages/massif/collectList.vue

@ -52,7 +52,7 @@
</style>
<template>
<view class="container flex">
<d-search v-model="searchVal.search" @click="clean();search(0)"/>
<d-search v-model="searchVal.search" @search="clean();search()"/>
<scroll-view scroll-y>
<view class="card" v-for="(v,k) in list" :key="k" @click="toSpecs(v)">

4
pages/massif/info.vue

@ -122,6 +122,10 @@ import request from '@/common/request'
if(res.statu){
this.eventChannel.emit("update")
uni.navigateBack()
//
if(!this.formData.id){
this.$provise.emit("updateMassif")
}
}else{
uni.showModal({
title:"提示",

4
pages/warehouse/info.vue

@ -124,6 +124,10 @@ import request from '@/common/request.js'
if(res.statu){
this.eventChannel.emit("update")
uni.navigateBack()
//
if(!this.formData.id){
this.$provise.emit("updateStock")
}
}else{
uni.showModal({
title:"提示",

Loading…
Cancel
Save