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

报工人员多选

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