|
|
|
@ -115,7 +115,14 @@
|
|
|
|
|
icon="el-icon-circle-plus"
|
|
|
|
|
@click="handleProdLineUpdate(scope.row)"
|
|
|
|
|
>关联产线</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-s-check"
|
|
|
|
|
@click="handleUserUpdate(scope.row)"
|
|
|
|
|
>关联人员</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
@ -227,13 +234,67 @@
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog :title="title" :visible.sync="userOpen" width="700px" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-form-item label="工序编号" prop="processCode">
|
|
|
|
|
<el-input v-model="form.processCode" placeholder="请输入工序编号" :disabled="true"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-form-item label="工序名称" prop="processName">
|
|
|
|
|
<el-input v-model="form.processName" placeholder="请输入工序名称" :disabled="true"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-divider content-position="center">工序关联人员信息</el-divider>
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddMesBaseProcessUser">添加人员</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteMesBaseProcessUser">删除</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-table :data="mesBaseProcessUserList" :row-class-name="rowMesBaseProcessUserIndex" @selection-change="handleMesBaseProcessUserSelectionChange" ref="mesBaseProcessUser">
|
|
|
|
|
<el-table-column type="selection" width="50" align="center" />
|
|
|
|
|
<el-table-column label="序号" align="center" prop="index" />
|
|
|
|
|
<el-table-column label="关联人员" align="center" prop="prodlineId" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-select v-model="scope.row.userId" filterable placeholder="请选择关联人员" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in userList"
|
|
|
|
|
:key="item.userId"
|
|
|
|
|
:label="item.nickName"
|
|
|
|
|
:value="item.userId"
|
|
|
|
|
:disabled="isUserDisabled(item.userId)"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitUserForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listProcessInfo, getProcessInfo, delProcessInfo, addProcessInfo, updateProcessInfo } from "@/api/mes/processInfo";
|
|
|
|
|
import {findFactoryList} from "@//api/mes/baseFactoryInfo";
|
|
|
|
|
import {
|
|
|
|
|
listProcessInfo,
|
|
|
|
|
getProcessInfo,
|
|
|
|
|
delProcessInfo,
|
|
|
|
|
addProcessInfo,
|
|
|
|
|
updateProcessInfo,
|
|
|
|
|
getProcessInfoUser, updateProcessInfoUser
|
|
|
|
|
} from "@/api/mes/processInfo";
|
|
|
|
|
import {findProdLineList} from "@//api/mes/baseProdlineInfo";
|
|
|
|
|
import {findUserList} from "@//api/system/user";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "ProcessInfo",
|
|
|
|
@ -246,6 +307,8 @@ export default {
|
|
|
|
|
ids: [],
|
|
|
|
|
// 子表选中数据
|
|
|
|
|
checkedMesBaseProcessProdline: [],
|
|
|
|
|
// 子表选中数据
|
|
|
|
|
checkedMesBaseProcessUser: [],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
// 非多个禁用
|
|
|
|
@ -258,11 +321,14 @@ export default {
|
|
|
|
|
processInfoList: [],
|
|
|
|
|
// 工序关联产线表格数据
|
|
|
|
|
mesBaseProcessProdlineList: [],
|
|
|
|
|
// 工序关联人员表格数据
|
|
|
|
|
mesBaseProcessUserList: [],
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
prodLineOpen: false,
|
|
|
|
|
userOpen: false,
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
@ -302,7 +368,9 @@ export default {
|
|
|
|
|
{ key: 10, label: `更新时间`, visible: true },
|
|
|
|
|
],
|
|
|
|
|
//产线选项
|
|
|
|
|
prodLineList: []
|
|
|
|
|
prodLineList: [],
|
|
|
|
|
//人员选项
|
|
|
|
|
userList: []
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -315,6 +383,9 @@ export default {
|
|
|
|
|
findProdLineList(null).then(response => {
|
|
|
|
|
this.prodLineList = response.data
|
|
|
|
|
})
|
|
|
|
|
findUserList(null).then(response => {
|
|
|
|
|
this.userList = response.data
|
|
|
|
|
})
|
|
|
|
|
listProcessInfo(this.queryParams).then(response => {
|
|
|
|
|
this.processInfoList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
@ -325,6 +396,7 @@ export default {
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.prodLineOpen = false;
|
|
|
|
|
this.userOpen = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
@ -359,6 +431,10 @@ export default {
|
|
|
|
|
// 返回 true 表示禁用,false 表示可用
|
|
|
|
|
return this.mesBaseProcessProdlineList.some(item => item.prodlineId === prodlineId);
|
|
|
|
|
},
|
|
|
|
|
isUserDisabled(userId) {
|
|
|
|
|
// 返回 true 表示禁用,false 表示可用
|
|
|
|
|
return this.mesBaseProcessUserList.some(item => item.userId === userId);
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.processId)
|
|
|
|
@ -392,6 +468,16 @@ export default {
|
|
|
|
|
this.title = "关联产线";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleUserUpdate(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|
const processId = row.processId || this.ids
|
|
|
|
|
getProcessInfoUser(processId).then(response => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
this.mesBaseProcessUserList = response.data.mesBaseProcessUserList;
|
|
|
|
|
this.userOpen = true;
|
|
|
|
|
this.title = "关联人员";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
@ -414,6 +500,21 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 用户提交按钮 */
|
|
|
|
|
submitUserForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.form.mesBaseProcessUserList = this.mesBaseProcessUserList;
|
|
|
|
|
if (this.form.processId != null) {
|
|
|
|
|
updateProcessInfoUser(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.userOpen = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const processIds = row.processId || this.ids;
|
|
|
|
@ -424,10 +525,14 @@ export default {
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
/** 工序关联产线序号 */
|
|
|
|
|
/** 工序关联产线序号 */
|
|
|
|
|
rowMesBaseProcessProdlineIndex({ row, rowIndex }) {
|
|
|
|
|
row.index = rowIndex + 1;
|
|
|
|
|
},
|
|
|
|
|
/** 工序关联产线序号 */
|
|
|
|
|
rowMesBaseProcessUserIndex({ row, rowIndex }) {
|
|
|
|
|
row.index = rowIndex + 1;
|
|
|
|
|
},
|
|
|
|
|
/** 工序关联产线添加按钮操作 */
|
|
|
|
|
handleAddMesBaseProcessProdline() {
|
|
|
|
|
let obj = {};
|
|
|
|
@ -450,6 +555,28 @@ export default {
|
|
|
|
|
handleMesBaseProcessProdlineSelectionChange(selection) {
|
|
|
|
|
this.checkedMesBaseProcessProdline = selection.map(item => item.index)
|
|
|
|
|
},
|
|
|
|
|
/** 工序关联人员添加按钮操作 */
|
|
|
|
|
handleAddMesBaseProcessUser() {
|
|
|
|
|
let obj = {};
|
|
|
|
|
obj.userName = "";
|
|
|
|
|
this.mesBaseProcessUserList.push(obj);
|
|
|
|
|
},
|
|
|
|
|
/** 工序关联人员删除按钮操作 */
|
|
|
|
|
handleDeleteMesBaseProcessUser() {
|
|
|
|
|
if (this.checkedMesBaseProcessUser.length == 0) {
|
|
|
|
|
this.$modal.msgError("请先选择要删除的工序关联人员数据");
|
|
|
|
|
} else {
|
|
|
|
|
const mesBaseProcessUserList = this.mesBaseProcessUserList;
|
|
|
|
|
const checkedMesBaseProcessUser = this.checkedMesBaseProcessUser;
|
|
|
|
|
this.mesBaseProcessUserList = mesBaseProcessUserList.filter(function(item) {
|
|
|
|
|
return checkedMesBaseProcessUser.indexOf(item.index) == -1
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 复选框选中数据 */
|
|
|
|
|
handleMesBaseProcessUserSelectionChange(selection) {
|
|
|
|
|
this.checkedMesBaseProcessUser = selection.map(item => item.index)
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download('mes/processInfo/export', {
|
|
|
|
|