Commit 99eb0bd0 authored by chenzj's avatar chenzj

工作站的人员关联

parent 4032fd35
<template> <template>
<div class="app-container"> <div class="app-container">
<el-table v-loading="loading" :data="workstationworkerList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="workstationworkerList" @selection-change="handleSelectionChange">
<el-table-column label="岗位名称" align="center" prop="postName" /> <!-- <el-table-column label="岗位名称" align="center" prop="postName" /> -->
<el-table-column label="数量" align="center" prop="quantity" /> <!-- <el-table-column label="数量" align="center" prop="quantity" /> -->
<el-table-column label="关联人员" align="center" prop="nickName" />
<el-table-column label="操作" align="center" v-if="optType !='view'" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" v-if="optType !='view'" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
...@@ -26,7 +27,7 @@ ...@@ -26,7 +27,7 @@
<!-- 添加或修改人力资源对话框 --> <!-- 添加或修改人力资源对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="岗位" prop="postId"> <!-- <el-form-item label="岗位" prop="postId">
<el-select v-model="form.postId" placeholder="请选择岗位"> <el-select v-model="form.postId" placeholder="请选择岗位">
<el-option <el-option
v-for="dict in postOptions" v-for="dict in postOptions"
...@@ -35,11 +36,25 @@ ...@@ -35,11 +36,25 @@
:value="dict.postId" :value="dict.postId"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> -->
<el-form-item label="关联人员" prop="nickName">
<el-input v-model="form.nickName" placeholder="请选择关联人员" readonly="readonly" >
<el-button
slot="append"
icon="el-icon-search"
@click="handleBrandSelect"
></el-button>
</el-input>
<BrandSelect
ref="brSelect"
@onSelected="onBrandSelected"
></BrandSelect>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="quantity">
<!-- <el-form-item label="数量" prop="quantity">
<el-input-number :min="1" v-model="form.quantity" placeholder="请输入所需人员数量" /> <el-input-number :min="1" v-model="form.quantity" placeholder="请输入所需人员数量" />
</el-form-item> </el-form-item> -->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
...@@ -52,8 +67,10 @@ ...@@ -52,8 +67,10 @@
<script> <script>
import { listWorkstationworker, getWorkstationworker, delWorkstationworker, addWorkstationworker, updateWorkstationworker } from "@/api/mes/md/workstationworker"; import { listWorkstationworker, getWorkstationworker, delWorkstationworker, addWorkstationworker, updateWorkstationworker } from "@/api/mes/md/workstationworker";
import {listAllPost} from "@/api/system/post"; import {listAllPost} from "@/api/system/post";
import BrandSelect from "@/components/userSelect/single.vue"
export default { export default {
name: "Workstationworker", name: "Workstationworker",
components: {BrandSelect},
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -84,6 +101,9 @@ export default { ...@@ -84,6 +101,9 @@ export default {
postCode: null, postCode: null,
postName: null, postName: null,
quantity: null, quantity: null,
userId: null,
userName: null,
nickName: null
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -136,6 +156,9 @@ export default { ...@@ -136,6 +156,9 @@ export default {
workstationId: this.workstationId, workstationId: this.workstationId,
postId: null, postId: null,
postCode: null, postCode: null,
userId: null,
userName: null,
nickName: null,
postName: null, postName: null,
quantity: null, quantity: null,
remark: null, remark: null,
...@@ -165,6 +188,16 @@ export default { ...@@ -165,6 +188,16 @@ export default {
this.ids = selection.map(item => item.recordId) this.ids = selection.map(item => item.recordId)
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
},
handleBrandSelect(){
this.$refs.brSelect.showFlag = true;
},
onBrandSelected(row){
if(row != undefined && row != null){
this.form.userId = row.userId;
this.form.userName = row.userName;
this.form.nickName = row.nickName;
}
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
......
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