班组人员组件修改
parent
f435d6ab58
commit
4b20f3c356
@ -0,0 +1,218 @@
|
|||||||
|
<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-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table v-loading="loading" :data="userList" ref="myTable" >
|
||||||
|
<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-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
<!-- 添加成员对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||||
|
<SelectUser ref="selectUserRef" @onSelected="closeAfterSelected"></SelectUser>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import {listTeamMembers,delTeamUser,getTeamUserList} from "@/api/device/equTeam";
|
||||||
|
import SelectUser from "./selectUser.vue";
|
||||||
|
export default {
|
||||||
|
name: "itemUser",
|
||||||
|
dicts: ["order_type_ll"],
|
||||||
|
components: { SelectUser },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
open: false,
|
||||||
|
showFlag:false,
|
||||||
|
// 选中数组
|
||||||
|
selectedRows: {},
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
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: {
|
||||||
|
initFunc(_teamId){
|
||||||
|
this.teamId = _teamId;
|
||||||
|
this.queryParams.teamId = _teamId;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 查询表格列表*/
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
getTeamUserList(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;
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加班组人员";
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.selectUserRef.initFunc(this.teamId);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.form.checkType = this.checkType;
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateFile(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addFile(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id;
|
||||||
|
this.$modal.confirm('是否确认删除数据?').then(function() {
|
||||||
|
return delTeamUser(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
|
closeAfterSelected(){
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.labelClassName {
|
||||||
|
width: 100%;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue