Commit 0fabb89f authored by chenzj's avatar chenzj

生产报工人员选择框加筛选

parent ef2e8f0f
<template> <template>
<view class="dmodel-table"> <view class="dmodel-table">
<view class="search">
<u-search :showAction="false" v-model="userName" inputAlign="center" placeholder="请输入编号" ></u-search>
<u-search :showAction="false" v-model="nickName" inputAlign="center" placeholder="请输入名称" ></u-search>
<u-button type="primary" @click="getList" size="medium">搜索</u-button>
</view>
<zb-table ref="zbTable" rowKey="recordId" <zb-table ref="zbTable" rowKey="recordId"
:columns="tableColumn" :data="tableData" :stripe="true" @toggleAllSelection="toggl :columns="tableColumn" :data="tableData" :stripe="true" @toggleAllSelection="toggleAllSelection"
eAllSelection"
@toggleRowSelection="toggleRowSelection"> @toggleRowSelection="toggleRowSelection">
</zb-table> </zb-table>
</view> </view>
...@@ -20,20 +24,22 @@ ...@@ -20,20 +24,22 @@
return { return {
tableData: [], tableData: [],
tableSelectData: [], tableSelectData: [],
userName: null,
nickName: null,
tableColumn: [{ tableColumn: [{
type: 'selection', type: 'selection',
width: 35 width: 35
}, },
{
name: 'nickName',
label: '名称',
width: 200,
},
{ {
name: 'userName', name: 'userName',
label: '编号', label: '编号',
width: 160, width: 160,
}, },
{
name: 'nickName',
label: '名称',
width: 200,
},
{ {
name: 'workstationName', name: 'workstationName',
...@@ -57,6 +63,7 @@ ...@@ -57,6 +63,7 @@
// this.data.workstationName // this.data.workstationName
}, },
methods: { methods: {
rowClick(row, index) { rowClick(row, index) {
console.log(this.$refs.zbTable) console.log(this.$refs.zbTable)
this.$refs.zbTable.checkboxSelectedAll({checked: false}) this.$refs.zbTable.checkboxSelectedAll({checked: false})
...@@ -84,11 +91,17 @@ ...@@ -84,11 +91,17 @@
}, },
async getList() { async getList() {
const params = { let params = {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
workstationId: this.data.workstationId workstationId: this.data.workstationId
} }
if (this.userName) {
params.userName = this.userName
}
if (this.nickName) {
params.nickName = this.nickName
}
const res = await this.$u.api.userQuery(params) const res = await this.$u.api.userQuery(params)
console.log(res, 'res') console.log(res, 'res')
if (res.code == 200) { if (res.code == 200) {
...@@ -117,4 +130,13 @@ ...@@ -117,4 +130,13 @@
margin-top: 20rpx; margin-top: 20rpx;
padding: 0 20rpx; padding: 0 20rpx;
} }
.search{
display: flex;
margin-bottom:20rpx;
align-items: center;
.u-search{
width: 400rpx !important;
margin-right:20rpx !important;
}
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment