<template>
|
<view>
|
<!-- 搜索框 -->
|
<view class="status_bar">
|
<!-- 这里是状态栏 -->
|
</view>
|
<uni-nav-bar left-icon="left" title="规划申请单" @clickLeft="back" @clickRight="scan" :fixed="true"
|
:border="false" rightWidth="160rpx" leftWidth="160rpx"
|
>
|
<block slot="right">
|
<view class="city">
|
<view>
|
<text class="uni-nav-bar-text">{{user.username}}</text>
|
</view>
|
<uni-icons type="arrowdown" color="#333333" size="20" />
|
</view>
|
</block>
|
</uni-nav-bar>
|
<!-- 搜索框 -->
|
<view class="search-bg">
|
<u-search placeholder="输入" v-model="keyword" :clearabled="true" @custom="search()" @search="search()"></u-search>
|
</view>
|
<view>
|
<!-- 客户列表 -->
|
<view class="c-list" @click="getDetails(item.id)" v-for="(item,index) in csmtrList" :key="index">
|
<view class="titles">
|
<y-title :title="item.name"></y-title>
|
</view>
|
<view style="display: grid;grid-template-columns: 1fr 3fr;">
|
<view class="list-item1">业务员</view><view class="list-item2">{{item.userId$}}</view>
|
<view class="list-item1">业务类型</view><view class="list-item2">{{item.planType$}}</view>
|
<view class="list-item1">规划单号</view><view class="list-item2">{{item.uuid}}</view>
|
<view class="list-item1">所需</view><view class="list-item2">{{item.planNeed$}}</view>
|
<view class="list-item1">规划员</view><view class="list-item2">{{item.planner$}}</view>
|
<view class="list-item1">跟踪项目</view><view class="list-item2 color-main">{{item.cstmrId$}}</view>
|
<view class="list-item1">进度</view><view class="list-item2">{{item.settle$}}</view>
|
<view class="list-item1">添加日期</view><view class="list-item2">{{item.createTime$}}</view>
|
</view>
|
</view>
|
</view>
|
<!-- <uni-load-more :status="status" :icon-size="16" :content-text="contentText" /> -->
|
<u-empty v-if="true" icon="../../../static/image/emptyList.png" v-show="csmtrList.length <= 0" />
|
<view>
|
<!-- 普通弹窗 -->
|
<uni-popup ref="popup" background-color="#fff">
|
<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
|
<view>
|
<button v-for="item in planType" class="button btnn" type="primary" @click="add(item.value)">{{item.name}}</button>
|
</view>
|
</view>
|
</uni-popup>
|
</view>
|
|
<view class="fxbtn">
|
<uni-icons type="plusempty" color="#fff" @click="gotoggle()" ></uni-icons>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import user from '@/pages/api/user/user.js'
|
export default {
|
data() {
|
return {
|
keyword: '',
|
user: {
|
username: '',
|
id: 0,
|
type: ''
|
},
|
falg: true,
|
csmtrList: [],
|
last_id: '',
|
reload: false,
|
status: 'more',
|
curr:2,
|
contentText: {
|
contentdown: '上拉加载更多',
|
contentrefresh: '加载中',
|
contentnomore: '没有更多'
|
},
|
type: 'center',
|
planType :[
|
{
|
name:'立体库(货架)',
|
value: 1
|
},
|
{
|
name:'立体库(集成)',
|
value: 2
|
},
|
{
|
name:'四向穿梭库/两向穿梭库',
|
value: 3
|
},
|
{
|
name:'阁楼货架/钢平台',
|
value: 4
|
},
|
{
|
name:'周转容器',
|
value: 5
|
},
|
{
|
name:'平库',
|
value: 6
|
},
|
]
|
}
|
},
|
onLoad() {
|
|
},
|
onShow() {
|
let that = this
|
uni.$on('isRefresh',function(data){
|
that.user.username = data.title
|
that.user.id = data.id
|
that.user.type = data.key
|
that.falg = false
|
})
|
if (this.falg) {
|
this.getDetail()
|
}
|
setTimeout(()=> {
|
this.getCsmtr1()
|
},50)
|
},
|
onReachBottom() {
|
this.status = 'more';
|
this.getCsmtr()
|
},
|
methods: {
|
async getDetail() {
|
let res = await user.getDetail()
|
if (res.code === 200) {
|
this.user.username = res.data.username
|
this.user.id = res.data.id
|
} else if (res.code === 403) {
|
this.backLogin(res)
|
}
|
},
|
gotoggle() {
|
this.toggle('right')
|
},
|
add(val) {
|
let addPlan = 'addPlan'
|
if (val > 1) {
|
addPlan = 'addPlan' + val
|
}
|
uni.navigateTo({
|
url:'/pages/business/plan/' + addPlan,
|
})
|
},
|
toggle(type) {
|
this.type = type
|
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
|
this.$refs.popup.open(type)
|
},
|
getCsmtr1(e) {
|
let that = this
|
that.csmtrList = []
|
uni.showLoading({})
|
let param = {curr:1,limit:4,dept_id: 0,user_id: 67}
|
if (this.user.type == 'user_id') {
|
param = {curr:1,limit:4,user_id: that.user.id}
|
} else if(this.user.type == 'dept_id') {
|
param = {curr:1,limit:4,dept_id: that.user.id}
|
} else {
|
param = {curr:1,limit:4}
|
}
|
uni.request({
|
url: that.baseUrl + '/plan/page/auth',
|
header: {'token' : uni.getStorageSync('token'),},
|
data: {curr:1,limit:4,deptId:19},
|
method:'GET',
|
success(result) {
|
if (result.statusCode === 404) {
|
uni.showToast({title: '请重新登录', icon: "none", position: 'top'})
|
return
|
}
|
var res = result.data
|
if (res.code === 200) {
|
let list = res.data.records
|
that.csmtrList = that.reload ? list : that.csmtrList.concat(list);
|
if (res.data.records.length == 0) {
|
that.status = 'noMore'
|
}
|
} else if (res.code === 403) {
|
uni.showToast({title: res.msg, icon: "none", position: 'top'})
|
setTimeout(() => {
|
uni.reLaunch({
|
url: '../../login/login'
|
});
|
}, 1000);
|
} else {
|
uni.showToast({title: res.msg, icon: "none",position: 'top'})
|
}
|
},
|
fail(result) {
|
uni.showToast({title: '请求失败'})
|
setTimeout(() => {
|
uni.reLaunch({
|
url: '../../login/login'
|
});
|
}, 1000);
|
},
|
complete() {
|
uni.hideLoading()
|
}
|
})
|
},
|
getCsmtr() {
|
let that = this
|
uni.showLoading({})
|
let param = {curr:that.curr,limit:4,dept_id: 0,user_id: 67}
|
if (this.user.type == 'user_id') {
|
param = {curr:that.curr,limit:4,user_id: that.user.id}
|
} else if(this.user.type == 'dept_id') {
|
param = {curr:that.curr,limit:4,dept_id: that.user.id}
|
} else {
|
param = {curr:that.curr,limit:4}
|
}
|
uni.request({
|
url: that.baseUrl + '/plan/page/auth',
|
header: {'token' : uni.getStorageSync('token'),},
|
data: {curr:that.curr,limit:4},
|
method:'GET',
|
success(result) {
|
if (result.statusCode === 404) {
|
uni.showToast({title: '请重新登录', icon: "none", position: 'top'})
|
return
|
}
|
var res = result.data
|
if (res.code === 200) {
|
let list = res.data.records
|
that.csmtrList = that.reload ? list : that.csmtrList.concat(list);
|
that.curr = that.curr + 1
|
if (res.data.records.length == 0) {
|
that.status = 'noMore'
|
}
|
} else if (res.code === 403) {
|
uni.showToast({title: res.msg, icon: "none", position: 'top'})
|
setTimeout(() => {
|
uni.reLaunch({
|
url: '../../login/login'
|
});
|
}, 1000);
|
} else {
|
uni.showToast({title: res.msg, icon: "none",position: 'top'})
|
}
|
},
|
fail(result) {
|
uni.showToast({title: '请求失败'})
|
setTimeout(() => {
|
uni.reLaunch({
|
url: '../../login/login'
|
});
|
}, 1000);
|
},
|
complete() {
|
uni.hideLoading()
|
}
|
})
|
},
|
getDetails(id) {
|
uni.navigateTo({
|
url: '/pages/business/plan/planDetails?id=' + id
|
})
|
},
|
// ---
|
search() {
|
|
},
|
back() {
|
uni.navigateBack({
|
})
|
},
|
scan() {
|
uni.navigateTo({
|
url: '/pages/authority/authority'
|
})
|
},
|
}
|
}
|
</script>
|
|
<style>
|
.btnn {
|
margin-top: 10px;
|
}
|
.btnn:first-child {
|
margin-top: 20px;
|
}
|
.popup-content {
|
margin-top: 260rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
background-color: #fff;
|
}
|
.popup-height {
|
display: height;
|
width: 300px;
|
}
|
.c-list {
|
width: 96%;
|
min-height: 100rpx;
|
background-color: #fff;
|
border-radius: 10rpx;
|
margin: 20rpx 2% 0 2%;
|
display: flex;
|
flex-direction: column;
|
font-size: 24rpx;
|
}
|
/* 父view 换 scroll-view */
|
.c-list:last-child {
|
margin-bottom: 20px;
|
}
|
.list-item1 {
|
|
height: 45rpx;
|
line-height: 45rpx;
|
color: #909399;
|
text-indent: 30rpx;
|
}
|
.list-item2 {
|
height: 45rpx;
|
line-height: 45rpx;
|
color: black;
|
}
|
.color-main {
|
color: #55aaff
|
}
|
.titles {
|
padding-left: 10rpx;
|
text-indent: 5rpx;
|
margin-top: 10rpx;
|
}
|
/* .title {
|
height: 60rpx;
|
line-height: 70rpx;
|
font-size: 28rpx;
|
font-weight: 900;
|
color: #303133;
|
} */
|
</style>
|