班组人员组件修改

master
zhaoxiaolin 1 month ago
parent 4b20f3c356
commit 38ba7fd896

@ -0,0 +1,185 @@
<template>
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="员工工号" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入员工工号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="员工姓名" prop="nickName">
<el-input
v-model="queryParams.nickName"
placeholder="请输入远工姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="userList" ref="myTable" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" type="index" width="50" />
<el-table-column label="员工工号" align="center" prop="userName" width="220"/>
<el-table-column label="员工姓名" align="center" prop="nickName" width="220"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</div>
</template>
<script>
import {listTeamMembers,addTeamUser} from "@/api/device/equTeam";
export default {
name: "SelectUser",
dicts: ["order_type_ll"],
components: { },
data() {
return {
open: false,
showFlag:false,
//
selectedRows: {},
//
single: true,
//
multiple: true,
users:[],
//
showSearch: true,
//
total: 0,
// BOM
userList: null,
deptOptions: undefined,
//
teamId: null,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
teamId: this.teamId,
},
//
rules: {
fileNo: [{ required: true, message: "受控文件编码不能为空", trigger: "blur" }],
startTime: [{ required: true, message: "有效起始时间不能为空", trigger: "blur" }],
endTime: [{ required: true, message: "有效结束时间不能为空", trigger: "blur" }]
},
form:{teamId:this.teamId}
};
},
created() {
this.getList();
},
methods: {
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
this.users = selection;
},
initFunc(_teamId){
this.teamId = _teamId;
this.queryParams.teamId = _teamId;
this.getList();
},
/** 查询表格列表*/
getList() {
this.loading = true;
listTeamMembers(this.queryParams).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
//
reset() {
this.form = {
id: null,
//checkType: null,
startTime: null,
endTime: null,
fileNo: null,
attr1: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null,
delFlag: null,
remark: null,
bz: null,
fileVersion: null
}
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
cancel() {
this.showFlag = false;
this.userList = [];
},
//
handleBomSelectionChange(selection) {
this.selectedRows = selection;
},
submitBomForm() {
this.$emit('onSelected', this.selectedRows);
this.userList = [];
this.showFlag = false;
},
/** 提交按钮 */
submitForm() {
this.form.teamId = this.teamId;
this.form.users = this.users;
addTeamUser(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.$emit('onSelected');
});
}
}
};
</script>
<style scoped>
.labelClassName {
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
Loading…
Cancel
Save