Commit 5cce97f6 authored by 张海景's avatar 张海景

update:修改报工人员样式

parent ef1a018a
<template>
<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>
<view class="search">
<u-form :model="tableParams" labelAlign="right" class="tableForm">
<u-form-item label="编号" label-width="60px" name="userName">
<uni-easyinput type="text" v-model="tableParams.userName" placeholder="请输入编号" />
</u-form-item>
<u-form-item label="名称" label-width="60px" name="nickName">
<uni-easyinput type="text" v-model="tableParams.nickName" placeholder="请输入名称" />
</u-form-item>
<u-form-item>
<u-button class="btn" @click="getList" type="primary" size="medium">搜索</u-button>
</u-form-item>
</u-form>
</view>
<zb-table ref="zbTable" rowKey="recordId"
:columns="tableColumn" :data="tableData" :stripe="true" @toggleAllSelection="toggleAllSelection"
:columns="tableColumn" :data="tableData" :stripe="true"
@toggleRowSelection="toggleRowSelection">
</zb-table>
</view>
......@@ -22,13 +30,15 @@
},
data() {
return {
tableParams: {
nickName: null,
userName: null,
},
tableData: [],
tableSelectData: [],
nickName: null,
userName: null,
tableColumn: [{
type: 'selection',
width: 35
type: 'radio',
width: 40
},
{
name: 'userName',
......@@ -56,40 +66,10 @@
// }
// },
mounted() {
console.log(this.data, 'this.data')
console.log(this.data.workstationName)
this.getList()
// this.data.workstationName
},
methods: {
rowClick(row, index) {
console.log(this.$refs.zbTable)
this.$refs.zbTable.checkboxSelectedAll({checked: false})
this.$refs.zbTable.toggleRowSelection(row)
},
async commonClick(type) {
if (this.tableSelectData.length == 0) {
return this.$u.toast('请选择一条数据!')
}
// 判断选中的类型是否一致
if (this.tableSelectData.length > 1) {
let flag = false
for (let i = 1; i < this.tableSelectData.length; i++) {
const pre = this.tableSelectData[i - 1]
const cur = this.tableSelectData[i]
flag = cur.type == pre.type
if (!flag) {
break;
}
}
if (!flag) {
return this.$u.toast('请选择状态相同的数据')
}
}
},
async getList() {
let params = {
pageNum: 1,
......@@ -97,10 +77,10 @@
workstationId: this.data.workstationId
}
if (this.userName) {
params.userName = this.userName
params.userName = this.tableParams.userName
}
if (this.nickName) {
params.nickName = this.nickName
params.nickName = this.tableParams.nickName
}
const res = await this.$u.api.userQuery(params)
console.log(res, 'res')
......@@ -114,9 +94,6 @@
}
},
toggleAllSelection(checked, arr) {
this.tableSelectData = arr
},
toggleRowSelection(checked, arr) {
this.tableSelectData = arr
},
......@@ -130,13 +107,11 @@
margin-top: 20rpx;
padding: 0 20rpx;
}
.search{
.tableForm{
display: flex;
margin-bottom:20rpx;
align-items: center;
.u-search{
width: 400rpx !important;
margin-right:20rpx !important;
}
}
.btn{
margin-left:10px;
}
</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