Commit 2226922b authored by 沈翠玲's avatar 沈翠玲

报工人员多选

parent 8c6f39cb
......@@ -145,10 +145,12 @@ const install = (Vue, vm) => {
getIpqcCode: (params = {}) =>
vm.$u.get(config.adminPath + '/system/autocode/get/IPQC_CODE', params),
//查看人员管理精确查询
getMdWorkunitWorkerByUserName: (params = {}) =>
vm.$u.get(config.adminPath + '/mes/md/workunitWorker/getMdWorkunitWorkerByUserName', params),
//查看人员管理
userQuery: (params = {}) =>
vm.$u.get(config.adminPath + '/mes/md/workunitWorker/getMdWorkunitWorkerByUserName', params),
vm.$u.get(config.adminPath + '/mes/md/workunitWorker/list', params),
//增加缺陷记录
addDefectrecord: (params = {}) =>
vm.$u.putJson(config.adminPath + '/mes/qc/defectrecord', params),
......
......@@ -3,13 +3,20 @@
<view class="search">
<u-form :model="tableParams" labelAlign="right" class="tableForm">
<u-form-item :label="$t('工号')" label-width="60px" name="userName">
<u-input type="text" v-model="tableParams.userName" :placeholder="$t('请扫描/输入工号')" @confirm="confirmUserName($event)"/>
<uni-easyinput type="text" v-model="tableParams.userName" :placeholder="$t('请输入编号')" />
</u-form-item>
<u-form-item :label="$t('姓名')" label-width="60px" name="nickName">
<uni-easyinput type="text" v-model="tableParams.nickName" :placeholder="$t('请输入名称')" />
</u-form-item>
<u-form-item>
<u-button class="btn" @click="handleClick" type="primary" size="medium">{{$t('搜索')}}</u-button>
</u-form-item>
</u-form>
</view>
<view>
<zb-table ref="zbTable" rowKey="userName" :columns="tableColumn" :data="tableData" :stripe="true" @toggleRowSelection="toggleRowSelection"></zb-table>
</view>
<view class="uni-pagination-box"><uni-pagination show-icon :page-size="params.pageSize" :current="params.pageNum" :total="total" @change="change" /></view>
</view>
</template>
......@@ -26,6 +33,8 @@ export default {
data() {
return {
params: {
pageNum: 1,
pageSize: 10,
workunitId: this.data?.workunitId || null
},
total: 0,
......@@ -36,6 +45,10 @@ export default {
tableData: [],
tableSelectData: [],
tableColumn: [
{
type: 'selection',
width: 40
},
{
name: 'userName',
label: i18n.t('工号'),
......@@ -61,15 +74,10 @@ export default {
// }
// },
mounted() {
// this.getList();
this.getList();
// this.data.workstationName
},
methods: {
confirmUserName(e) {
this.tableParams.userName = e
if (!this.tableParams.userName) return this.$u.toast(i18n.t('请输入报工人工号'))
this.handleClick()
},
handleClick() {
if (this.tableParams.userName) {
this.params.userName = this.tableParams.userName;
......@@ -81,16 +89,27 @@ export default {
} else {
delete this.params.nickName
}
this.params.pageNum = 1;
this.getList();
},
async getList() {
const res = await this.$u.api.userQuery(this.params);
if (res.code == 200 && res.data) {
this.tableData.push(res.data)
} else {
this.$u.toast(i18n.t('查不到报工人数据'))
console.log(res, 'res');
if (res.code == 200) {
this.tableData = res.rows.map((item) => {
return {
...item,
workunitName: this.data?.workunitName || null
};
});
this.total = res.total;
}
},
// 分页触发
change(e) {
this.params.pageNum = e.current;
this.getList();
},
toggleRowSelection(checked, arr) {
this.tableSelectData = arr;
......
This diff is collapsed.
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