<template>
|
<view class="container">
|
<cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask">
|
<block slot="backText">返回</block>
|
<block slot="content">选择设备</block>
|
<block slot="right">
|
<view @click="search">
|
<image class="search" src="/static/icon/sear.png" style="width: 25px; height: 25px;" alt="" />
|
</view>
|
</block>
|
</cu-custom>
|
|
<view style="width: 100%;">
|
<uni-popup ref="popup" background-color="#fff" :type="type">
|
<view class="popupView" style="height: auto; margin-top: 85px;">
|
<!-- 基础表单校验 -->
|
<uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext">
|
<uni-group title="" top="0">
|
<uni-forms-item name="name" label="姓名:">
|
<uni-easyinput placeholder="请输入姓名检索" v-model="formData.name" />
|
</uni-forms-item>
|
</uni-group>
|
</uni-forms>
|
|
<view class="flex">
|
|
<view
|
class="cuIcon-search flex-sub bg-blue padding-sm margin-left-lg margin-right-lg margin-xs text-sm text-center"
|
@click="searBut">查询
|
</view>
|
<view
|
class="cuIcon-refresh flex-sub bg-white solids padding-sm margin-left-lg margin-right-lg margin-xs radius text-sm text-center"
|
@click="resetTask">重置</view>
|
</view>
|
</view>
|
</uni-popup>
|
|
</view>
|
<mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback">
|
<!-- 列表信息开始 -->
|
<view class="content">
|
|
<uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index"
|
@click="onClickProductionTask(item)">
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">工号:</view>
|
<view class="flex-sub bg-white padding-xs text-right margin-xs">{{item.workNo}}</view>
|
</view>
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">姓名:</view>
|
<view class="flex-sub bg-white padding-xs text-bold text-right margin-xs">{{item.realname}}
|
</view>
|
</view>
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">电话:</view>
|
<view class="flex-sub bg-white padding-xs text-right margin-xs">{{item.phone}}</view>
|
</view>
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">职务:</view>
|
<view class="flex-sub bg-white padding-xs text-right margin-xs">
|
{{item.post_dictText}}
|
</view>
|
</view>
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">部门:</view>
|
<view class="flex-sub bg-white padding-xs text-right margin-xs">
|
{{item.orgCodeTxt}}
|
</view>
|
</view>
|
</uni-card>
|
|
</view>
|
|
</mescroll-uni>
|
|
</view>
|
</template>
|
|
<script>
|
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
export default {
|
mixins: [MescrollMixin], // 使用mixin
|
data() {
|
return {
|
type: 'top',
|
formData: {
|
num: '',
|
name: ''
|
},
|
url: {
|
stallList: "/sys/user/list"
|
},
|
upOption: {
|
page: {
|
num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
|
size: 10 // 每页数据的数量
|
},
|
noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
|
empty: {
|
tip: '~ 暂无数据 ~', // 提示
|
|
},
|
loading: '',
|
text: '全部',
|
isShowNoMore: false,
|
textNoMore: '我是有底线的 >_<'
|
},
|
msgList: [], //列表数据
|
announcement1: [],
|
msg1Count: "",
|
msg1Title: "",
|
}
|
},
|
computed: {
|
top() {
|
return this.CustomBar * 2 + 10
|
},
|
style() {
|
var StatusBar = this.StatusBar;
|
var CustomBar = this.CustomBar;
|
var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
|
return style
|
},
|
},
|
|
created() {
|
|
|
|
},
|
methods: {
|
search() {
|
this.$refs.popup.open();
|
},
|
upCallback(page) {
|
//联网加载数据
|
|
this.$http.get(this.url.stallList, {
|
params: {
|
pageNo: page.num,
|
pageSize: page.size,
|
column: "createTime",
|
order: "desc"
|
}
|
}).then(res => {
|
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
this.announcement1 = res.data.result.records
|
this.mescroll.endSuccess(this.announcement1.length);
|
console.log("url", res)
|
//设置列表数据
|
if (res.data.success) {
|
console.log("res", res.data)
|
this.msg1Count = res.data.result.total
|
this.msg1Title = "通知(" + res.data.result.total + ")";
|
for (let annItem of this.announcement1) {
|
this.msgList.push(annItem)
|
}
|
}
|
if (page.num == 1) {
|
this.msgList = []; //如果是第一页需手动制空列表
|
this.msgList = this.msgList.concat(this.announcement1); //追加新数据
|
}
|
|
}).catch(() => {
|
//联网失败, 结束加载
|
this.mescroll.endErr();
|
})
|
},
|
|
|
searBut() {
|
this.$refs.popup.close()
|
this.msgList = [];
|
this.$http.get(this.url.stallList, {
|
params: {
|
pageNo: 1,
|
pageSize: this.upOption.page.size,
|
name: this.formData.realname,
|
column: "createTime",
|
order: "desc",
|
}
|
}).then(res => {
|
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
|
this.announcement1 = res.data.result.records
|
this.mescroll.endSuccess(this.announcement1.length);
|
console.log("url", res)
|
//设置列表数据
|
if (res.data.success) {
|
console.log("res", res.data)
|
this.msg1Count = res.data.result.total
|
this.msg1Title = "通知(" + res.data.result.total + ")";
|
for (let annItem of this.announcement1) {
|
this.msgList.push(annItem)
|
}
|
}
|
if (page.num == 1) {
|
this.msgList = []; //如果是第一页需手动制空列表
|
this.msgList = this.msgList.concat(this.announcement1); //追加新数据
|
}
|
|
}).catch(() => {
|
//联网失败, 结束加载
|
this.mescroll.endErr();
|
})
|
|
|
|
|
},
|
|
resetTask() {
|
this.formData.realname = '',
|
this.mescroll.resetUpScroll()
|
this.$refs.popup.close()
|
},
|
|
onClickProductionTask(item) {
|
uni.$emit('choes', {
|
msg: JSON.stringify(item)
|
})
|
|
uni.navigateBack({
|
delta: 1
|
})
|
|
|
},
|
},
|
|
}
|
</script>
|
|
<style>
|
.footer-box__item_content {
|
font-size: 12px;
|
color: #666;
|
}
|
|
.footer-box__item_input {
|
text-align: right;
|
font-size: 13px;
|
color: #000;
|
}
|
|
.footer-box {
|
padding: 10rpx;
|
display: flex;
|
justify-content: space-between;
|
flex-direction: row;
|
}
|
|
.footer-box__item_title {
|
margin-left: 10rpx;
|
font-size: 24v;
|
font-size: 12px;
|
color: #999;
|
}
|
|
.margin-bottom {
|
margin: 0 30px;
|
}
|
|
.input {
|
text-align: right;
|
}
|
|
.cu-form-group {
|
padding-left: 25px;
|
display: flex;
|
justify-content: space-between;
|
flex-direction: row;
|
}
|
|
.text {
|
font-size: 10pt;
|
text-align: right;
|
}
|
|
.content {
|
margin-top: 5px;
|
}
|
|
.content scroll-view {
|
scrollIndicator: "none"
|
}
|
|
.footer-box-btn {
|
padding: 10rpx;
|
display: flex;
|
justify-content: space-between;
|
flex-direction: row;
|
background: white;
|
}
|
|
.button-rese {
|
height: 50rpx;
|
display: flex;
|
margin-top: 10rpx;
|
line-height: 50rpx;
|
justify-content: center;
|
border-radius: 5px;
|
color: #FFFFFF;
|
/* 这里可以改成渐变: background:linear-gradient(to right, #FFDE28,#FF3228) */
|
background-color: #1890FF;
|
font-size: 28rpx;
|
|
}
|
</style>
|