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

update:修改报工人员样式

parent ef1a018a
<template> <template>
<view class="dmodel-table"> <view class="dmodel-table">
<view class="search"> <view class="search">
<u-search :showAction="false" v-model="userName" inputAlign="center" placeholder="请输入编号" ></u-search> <u-form :model="tableParams" labelAlign="right" class="tableForm">
<u-search :showAction="false" v-model="nickName" inputAlign="center" placeholder="请输入名称" ></u-search> <u-form-item label="编号" label-width="60px" name="userName">
<u-button type="primary" @click="getList" size="medium">搜索</u-button> <uni-easyinput type="text" v-model="tableParams.userName" placeholder="请输入编号" />
</view> </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" <zb-table ref="zbTable" rowKey="recordId"
:columns="tableColumn" :data="tableData" :stripe="true" @toggleAllSelection="toggleAllSelection" :columns="tableColumn" :data="tableData" :stripe="true"
@toggleRowSelection="toggleRowSelection"> @toggleRowSelection="toggleRowSelection">
</zb-table> </zb-table>
</view> </view>
...@@ -22,13 +30,15 @@ ...@@ -22,13 +30,15 @@
}, },
data() { data() {
return { return {
tableParams: {
nickName: null,
userName: null,
},
tableData: [], tableData: [],
tableSelectData: [], tableSelectData: [],
nickName: null,
userName: null,
tableColumn: [{ tableColumn: [{
type: 'selection', type: 'radio',
width: 35 width: 40
}, },
{ {
name: 'userName', name: 'userName',
...@@ -56,40 +66,10 @@ ...@@ -56,40 +66,10 @@
// } // }
// }, // },
mounted() { mounted() {
console.log(this.data, 'this.data')
console.log(this.data.workstationName)
this.getList() this.getList()
// this.data.workstationName // this.data.workstationName
}, },
methods: { 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() { async getList() {
let params = { let params = {
pageNum: 1, pageNum: 1,
...@@ -97,10 +77,10 @@ ...@@ -97,10 +77,10 @@
workstationId: this.data.workstationId workstationId: this.data.workstationId
} }
if (this.userName) { if (this.userName) {
params.userName = this.userName params.userName = this.tableParams.userName
} }
if (this.nickName) { if (this.nickName) {
params.nickName = this.nickName params.nickName = this.tableParams.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')
...@@ -114,9 +94,6 @@ ...@@ -114,9 +94,6 @@
} }
}, },
toggleAllSelection(checked, arr) {
this.tableSelectData = arr
},
toggleRowSelection(checked, arr) { toggleRowSelection(checked, arr) {
this.tableSelectData = arr this.tableSelectData = arr
}, },
...@@ -130,13 +107,11 @@ ...@@ -130,13 +107,11 @@
margin-top: 20rpx; margin-top: 20rpx;
padding: 0 20rpx; padding: 0 20rpx;
} }
.search{ .tableForm{
display: flex; display: flex;
margin-bottom:20rpx; margin-bottom:20rpx;
align-items: center; }
.u-search{ .btn{
width: 400rpx !important; margin-left:10px;
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