4月26日提交

master
rosehan 2 years ago
parent 316728bc0a
commit d16fec3405
  1. 3
      pages.json
  2. 122
      pages/mine/base/baseList.vue
  3. 11
      pages/traceability-product/machining/materialsList.vue
  4. 2
      utils/request.js

@ -1,5 +1,6 @@
{
"pages": [{
"pages": [
{
"path": "pages/login",
"style": {
"navigationBarTitleText": "登录"

@ -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>

@ -11,7 +11,7 @@
</view>
<!-- 页面 列表 -->
<z-paging ref="paging" v-model="listData" :pagingStyle="padingStyle" @query="getListData">
<z-paging ref="paging" v-model="productList" :pagingStyle="padingStyle" @query="getListData">
<view class="v-pages-list v-container m-t-extra">
<view v-for="(item,index) in productList" class="v-pages-list-item" :key="index"
@click="getProduct(item)">
@ -60,6 +60,9 @@
top: '150rpx'
},
Product: -1,
queryParams: {
processingName: null,
},
productList: [],
selectData: [],
saveData: [],
@ -78,8 +81,8 @@
try {
const queryParams = {
pageNo: pageNo,
pageSize: pageSize,
processingName: this.queryParams.processingName,
pageSize: pageSize,
processingName: this.queryParams.processingName
}
const res = await ProductApi.getSelfOroducedProductsAndInventory(queryParams)
this.$refs.paging.complete(res.data.list)
@ -146,4 +149,4 @@
</script>
<style>
</style>
</style>

@ -13,7 +13,7 @@ const request = config => {
config.header = config.header || {}
if (getAccessToken() && !isToken) {
// config.header['Authorization'] = 'Bearer ' + getAccessToken()
config.header['Authorization'] = 'Bearer ' + '86cf8fbb9d9d4d4fab5c491bdd7d907b'
config.header['Authorization'] = 'Bearer ' + '888cfc9e0903437b87e44ef7064c7171'
}
// 设置租户 TODO 芋艿:强制 1 先
config.header['tenant-id'] = '1';

Loading…
Cancel
Save