工作站人力资源设置
This commit is contained in:
parent
b2977b8c4d
commit
d2a49f85a4
44
src/api/mes/md/workstationworker.js
Normal file
44
src/api/mes/md/workstationworker.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询人力资源列表
|
||||||
|
export function listWorkstationworker(query) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/md/workstationworker/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询人力资源详细
|
||||||
|
export function getWorkstationworker(recordId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/md/workstationworker/' + recordId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增人力资源
|
||||||
|
export function addWorkstationworker(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/md/workstationworker',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改人力资源
|
||||||
|
export function updateWorkstationworker(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/md/workstationworker',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除人力资源
|
||||||
|
export function delWorkstationworker(recordId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/md/workstationworker/' + recordId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
@ -9,6 +9,14 @@ export function listPost(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询所有可用岗位,以列表方式返回
|
||||||
|
export function listAllPost() {
|
||||||
|
return request({
|
||||||
|
url: '/system/post/listAll',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询岗位详细
|
// 查询岗位详细
|
||||||
export function getPost(postId) {
|
export function getPost(postId) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
<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="toolTypeId">
|
<el-form-item label="工装夹具类型" prop="toolTypeId">
|
||||||
<el-select v-model="form.toolTypeId" @change="onToolTypeChanged" placeholder="请选择类型">
|
<el-select v-model="form.toolTypeId" placeholder="请选择类型">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in toolTypeOptions"
|
v-for="dict in toolTypeOptions"
|
||||||
:key="dict.toolTypeId"
|
:key="dict.toolTypeId"
|
||||||
|
217
src/views/mes/md/workstation/components/worker.vue
Normal file
217
src/views/mes/md/workstation/components/worker.vue
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<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="quantity" />
|
||||||
|
<el-table-column label="操作" align="center" v-if="optType !='view'" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['mes:md:workstationworker:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['mes:md:workstationworker:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<!-- 添加或修改人力资源对话框 -->
|
||||||
|
<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-item label="岗位" prop="postId">
|
||||||
|
<el-select v-model="form.postId" placeholder="请选择岗位">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in postOptions"
|
||||||
|
:key="dict.postId"
|
||||||
|
:label="dict.postName"
|
||||||
|
:value="dict.postId"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="数量" prop="quantity">
|
||||||
|
<el-input-number :min="1" v-model="form.quantity" placeholder="请输入所需人员数量" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listWorkstationworker, getWorkstationworker, delWorkstationworker, addWorkstationworker, updateWorkstationworker } from "@/api/mes/md/workstationworker";
|
||||||
|
import {listAllPost} from "@/api/system/post";
|
||||||
|
export default {
|
||||||
|
name: "Workstationworker",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 人力资源表格数据
|
||||||
|
workstationworkerList: [],
|
||||||
|
postOptions:[],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
workstationId: this.workstationId,
|
||||||
|
postId: null,
|
||||||
|
postCode: null,
|
||||||
|
postName: null,
|
||||||
|
quantity: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
workstationId: [
|
||||||
|
{ required: true, message: "工作站ID不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
postId: [
|
||||||
|
{ required: true, message: "岗位ID不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
quantity: [
|
||||||
|
{ required: true, message: "数量不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
workstationId: undefined,
|
||||||
|
optType: undefined,
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.getPostList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询人力资源列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listWorkstationworker(this.queryParams).then(response => {
|
||||||
|
this.workstationworkerList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getPostList(){
|
||||||
|
listAllPost().then(response =>{
|
||||||
|
this.postOptions = response.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
recordId: null,
|
||||||
|
workstationId: this.workstationId,
|
||||||
|
postId: null,
|
||||||
|
postCode: null,
|
||||||
|
postName: null,
|
||||||
|
quantity: null,
|
||||||
|
remark: null,
|
||||||
|
attr1: null,
|
||||||
|
attr2: null,
|
||||||
|
attr3: null,
|
||||||
|
attr4: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.recordId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加人力资源";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const recordId = row.recordId || this.ids
|
||||||
|
getWorkstationworker(recordId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改人力资源";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.recordId != null) {
|
||||||
|
updateWorkstationworker(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addWorkstationworker(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const recordIds = row.recordId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除此岗位资源').then(function() {
|
||||||
|
return delWorkstationworker(recordIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -251,9 +251,9 @@
|
|||||||
<el-card shadow="always" style="width:400px">
|
<el-card shadow="always" style="width:400px">
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span>人力资源</span>
|
<span>人力资源</span>
|
||||||
<el-button style="float:right; padding 3px 0" v-if="optType !='view'" type="text">新增</el-button>
|
<el-button style="float:right; padding 3px 0" @click="handlePostAdd" v-if="optType !='view'" type="text">新增</el-button>
|
||||||
</div>
|
</div>
|
||||||
人员清单
|
<Workstationworker ref="postList" :optType="optType" :workstationId="form.workstationId"></Workstationworker>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-carousel-item>
|
</el-carousel-item>
|
||||||
<el-carousel-item>
|
<el-carousel-item>
|
||||||
@ -284,10 +284,10 @@ import WorkStationMachine from "./components/machine";
|
|||||||
import MachinerySelectSingle from "@/components/machinerySelect/single.vue";
|
import MachinerySelectSingle from "@/components/machinerySelect/single.vue";
|
||||||
import {addWorkstationmachine} from "@/api/mes/md/workstationmachine";
|
import {addWorkstationmachine} from "@/api/mes/md/workstationmachine";
|
||||||
//人力资源选择与保存
|
//人力资源选择与保存
|
||||||
|
import Workstationworker from "./components/worker";
|
||||||
|
|
||||||
//工装夹具资源选择与保存
|
//工装夹具资源选择与保存
|
||||||
import WorkStationTool from "./components/tool";
|
import WorkStationTool from "./components/tool";
|
||||||
import {addWorkstationtool} from "@/api/mes/md/workstationtool";
|
|
||||||
|
|
||||||
import {listAllProcess} from "@/api/mes/pro/process";
|
import {listAllProcess} from "@/api/mes/pro/process";
|
||||||
import {genCode} from "@/api/system/autocode/rule";
|
import {genCode} from "@/api/system/autocode/rule";
|
||||||
@ -295,7 +295,7 @@ import { listAllWorkshop } from "@/api/mes/md/workshop";
|
|||||||
export default {
|
export default {
|
||||||
name: "Workstation",
|
name: "Workstation",
|
||||||
dicts: ['sys_yes_no'],
|
dicts: ['sys_yes_no'],
|
||||||
components: {WorkStationMachine,MachinerySelectSingle,WorkStationTool},
|
components: {WorkStationMachine,MachinerySelectSingle,Workstationworker,WorkStationTool},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
//自动生成编码
|
//自动生成编码
|
||||||
@ -517,8 +517,11 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//人力资源-岗位新增
|
||||||
//工装夹具资源选择
|
handlePostAdd(){
|
||||||
|
this.$refs.postList.handleAdd();
|
||||||
|
},
|
||||||
|
//工装夹具资源新增
|
||||||
handleToolTypeAdd(){
|
handleToolTypeAdd(){
|
||||||
this.$refs.toolList.handleAdd();
|
this.$refs.toolList.handleAdd();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user