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 store from './store'
import uView from 'uview-ui'; import uView from 'uview-ui';
import {defineObj,defineArray} from 'black-knight/lib/config/custom' import {defineObj,defineArray} from 'black-knight/lib/config/custom'
import {provise} from 'black-knight/lib/config/tools'
Vue.use(uView) Vue.use(uView)
Vue.prototype.$store=store Vue.prototype.$store=store
Vue.prototype.$defineArray=defineArray Vue.prototype.$defineArray=defineArray
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$provise=new provise()
App.mpType = 'app' App.mpType = 'app'
const app = new Vue({ const app = new Vue({
...App, ...App,

28
pages/home/index.vue

@ -305,7 +305,7 @@
<view style="display:flex;"> <view style="display:flex;">
<view class="card mana"> <view class="card mana">
<view class="title"> <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>
<view class="item" v-for="(v,k) in massif.plotList||[]" :key="k"> <view class="item" v-for="(v,k) in massif.plotList||[]" :key="k">
<text class="over">{{v.plotName}}</text> <text>{{v.realityArea}}</text> <text class="over">{{v.plotName}}</text> <text>{{v.realityArea}}</text>
@ -391,9 +391,9 @@ import request,{host} from '@/common/request.js'
}, },
watch:{ watch:{
"$store.state.plantBaseInfoId"(n){ "$store.state.plantBaseInfoId"(n){
this.getMassif(n) this.getMassif()
this.getBaseInfo(n) this.getBaseInfo()
this.getStock(n) this.getStock()
} }
}, },
onLoad() { onLoad() {
@ -403,6 +403,8 @@ import request,{host} from '@/common/request.js'
}else{ }else{
this.$store.commit("setBaseId", this.$store.getters['userInfo'].plantBaseInfoId) this.$store.commit("setBaseId", this.$store.getters['userInfo'].plantBaseInfoId)
} }
this.$provise.on("updateMassif", this.getMassif())
this.$provise.on("updateStock", this.getStock())
}, },
methods: { methods: {
async getHeadImg(){ 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",{ var res=await request("/api/plantIndex/queryPlot",{
params:{plantBaseId} params:{plantBaseId: this.$store.state.plantBaseInfoId}
}) })
if(res.statu){ if(res.statu){
this.massif=res.data 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",{ var res=await request("/api/plantIndex/queryFarmWorkAndInput",{
params:{plantBaseId} params:{plantBaseId: this.$store.state.plantBaseInfoId}
}) })
if(res.statu){ if(res.statu){
this.baseInfo=res.data 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",{ var res=await request("/api/plantIndex/queryWarehouse",{
params:{baseId} params:{baseId: this.$store.state.plantBaseInfoId}
}) })
if(res.statu){ if(res.statu){
this.stockList=res.data 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> </script>

2
pages/massif/collectList.vue

@ -52,7 +52,7 @@
</style> </style>
<template> <template>
<view class="container flex"> <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> <scroll-view scroll-y>
<view class="card" v-for="(v,k) in list" :key="k" @click="toSpecs(v)"> <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){ if(res.statu){
this.eventChannel.emit("update") this.eventChannel.emit("update")
uni.navigateBack() uni.navigateBack()
//
if(!this.formData.id){
this.$provise.emit("updateMassif")
}
}else{ }else{
uni.showModal({ uni.showModal({
title:"提示", title:"提示",

4
pages/warehouse/info.vue

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

Loading…
Cancel
Save