parent
316728bc0a
commit
d16fec3405
@ -0,0 +1,122 @@ |
||||
<template> |
||||
<view class="v-pages"> |
||||
<!-- 页面 筛选 --> |
||||
<view class="v-pages-filter"> |
||||
<!-- 页面 搜索 --> |
||||
<view class="v-pages-search"> |
||||
<uni-search-bar @confirm="search" v-model="queryParams.baseName" @cancel="cancel" @clear="clear" |
||||
placeholder="请输入基地名称" cancelButton="always"></uni-search-bar> |
||||
</view> |
||||
</view> |
||||
|
||||
<!-- 页面 列表 --> |
||||
<z-paging ref="paging" v-model="listData" :pagingStyle="padingStyle" @query="getListData"> |
||||
<view class="v-pages-list v-container m-t-regular"> |
||||
<view class="v-pages-list-item" v-for="item in listData" :key="item.id" @click="getBase(item.id)"> |
||||
<!-- 页面 卡片 --> |
||||
<view class="v-card" :class="currentBaseID==item.id?'active':''"> |
||||
<image src="@/static/images/icon_select.svg" class="v-card-select"></image> |
||||
<view class="v-card-top row"> |
||||
<!-- 卡片 信息 --> |
||||
<view class="v-card-info"> |
||||
<view class="v-card-title row"> |
||||
<text class="name col">{{ item.baseName }}</text> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<!-- 卡片 下部 --> |
||||
<view class="v-card-bot"> |
||||
<view class="v-page-form small row"> |
||||
<view class="v-form-item col-12"> |
||||
<text>负责人:</text> |
||||
{{ item.baseLeader }} |
||||
</view> |
||||
<view class="v-form-item col-12"> |
||||
<text>创建日期:</text> |
||||
{{ getData(item.createTime) }} |
||||
</view> |
||||
</view> |
||||
</view> |
||||
|
||||
</view> |
||||
</view> |
||||
</view> |
||||
</z-paging> |
||||
<view class="fixed fixedBottom v-container"><button class="v-primary-btn large" @click="saveBase()">保存</button> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getBasePage |
||||
} from '@/api/traceability/base' |
||||
import mix from '@/utils/mix.js' |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
padingStyle: { |
||||
top: '150rpx' |
||||
}, |
||||
currentBaseID: this.$store.state.user.baseId, |
||||
queryParams: { |
||||
baseName: null, |
||||
}, |
||||
listData: [] |
||||
} |
||||
}, |
||||
mixins: [mix], |
||||
methods: { |
||||
// 获取产品数据 |
||||
async getListData(pageNo, pageSize) { |
||||
try { |
||||
const queryParams = { |
||||
pageNo: pageNo, |
||||
pageSize: pageSize, |
||||
baseStatus: 1, |
||||
baseName: this.queryParams.baseName, |
||||
} |
||||
const res = await getBasePage(queryParams) |
||||
this.$refs.paging.complete(res.data.list) |
||||
} catch { |
||||
this.$refs.paging.complete(false); |
||||
} |
||||
}, |
||||
|
||||
//获取当前基地Id |
||||
getBase(id) { |
||||
this.currentBaseID = id |
||||
}, |
||||
|
||||
//确定切换基地 |
||||
async saveBase(){ |
||||
await this.$store.dispatch('changeBaseId',this.currentBaseID) |
||||
uni.redirectTo({ |
||||
url: '/pages/mine/base/index' |
||||
}); |
||||
}, |
||||
|
||||
//确定搜索 |
||||
search(res) { |
||||
this.$refs.paging.reload() |
||||
}, |
||||
|
||||
//清除搜索 |
||||
clear(res) { |
||||
this.queryParams.baseName = null; |
||||
this.$refs.paging.reload() |
||||
}, |
||||
|
||||
//取消搜索 |
||||
cancel(res) { |
||||
this.queryParams.baseName = null; |
||||
this.$refs.paging.reload() |
||||
}, |
||||
} |
||||
|
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
</style> |
Loading…
Reference in new issue