班组人员组件修改
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…
Reference in New Issue