|
|
|
@ -154,34 +154,40 @@
|
|
|
|
|
|
|
|
|
|
<!-- 用户绑定 -->
|
|
|
|
|
<el-dialog :title="titleUserBind" :visible.sync="openUserBind" width="800px">
|
|
|
|
|
<el-table v-loading="userloading" :data="userList" ref="userBindTable" >
|
|
|
|
|
<el-table-column label="序号" align="center" type="index" width="50" />
|
|
|
|
|
<el-table-column label="员工编号" align="center" prop="userCode" />
|
|
|
|
|
<el-table-column label="姓名" align="center" prop="userName" />
|
|
|
|
|
<el-table-column label="来料类别" align="center" prop="attr1" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-table v-loading="userloading" :data="userList" ref="userBindTable" >
|
|
|
|
|
<el-table-column label="序号" align="center" type="index" width="50" />
|
|
|
|
|
<el-table-column label="员工编号" align="center" prop="userCode" />
|
|
|
|
|
<el-table-column label="姓名" align="center" prop="userName" />
|
|
|
|
|
<el-table-column label="来料类别" align="center" prop="attr1" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag
|
|
|
|
|
:options="dict.type.order_type_ll"
|
|
|
|
|
:value="scope.row.attr1"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column fixed="right" align="center" label="操作" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="danger"
|
|
|
|
|
plain
|
|
|
|
|
@click="deleteUser(scope.row)"
|
|
|
|
|
>
|
|
|
|
|
移除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<div class="button-container">
|
|
|
|
|
<el-button size="mini" type="primary" @click="addUser()" >新增员工</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="所属线体/标准" align="center" prop="attr2List" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-select v-model="scope.row.attr2List" placeholder="请选择" clearable @change="selectBelongTo(scope.row)" multiple>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in belongToOptions"
|
|
|
|
|
:key="item.typeCode"
|
|
|
|
|
:label="item.typeName"
|
|
|
|
|
:value="item.typeCode"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column fixed="right" align="center" label="操作" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button size="small" type="danger" plain @click="deleteUser(scope.row)">移除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<div class="button-container">
|
|
|
|
|
<el-button size="mini" type="primary" @click="addUser()" >新增员工</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="handleClose" >关 闭</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
@ -193,8 +199,10 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listCheckType, getCheckType, delCheckType, addCheckType, updateCheckType } from "@/api/quality/checkType";
|
|
|
|
|
import{ getSelectedUsers, addUserBind, deleteByMaterialCode} from "@/api/quality/userbind";
|
|
|
|
|
import { listCheckType, getCheckType, delCheckType, addCheckType, updateCheckType,
|
|
|
|
|
listBelongToStandars,listBelongToLines
|
|
|
|
|
} from "@/api/quality/checkType";
|
|
|
|
|
import{ getSelectedUsers, addUserBind, deleteByMaterialCode,updateBelongTo} from "@/api/quality/userbind";
|
|
|
|
|
import ItemSelectUser from "./selectUser.vue";
|
|
|
|
|
import ItemConfFile from "./confFile.vue";
|
|
|
|
|
export default {
|
|
|
|
@ -214,19 +222,22 @@ export default {
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
|
|
|
openUserBind: false,
|
|
|
|
|
materialCode: "",
|
|
|
|
|
materialName: "",
|
|
|
|
|
attr1: "",
|
|
|
|
|
openUserBind: false,
|
|
|
|
|
materialCode: "",
|
|
|
|
|
materialName: "",
|
|
|
|
|
attr1: "",
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 检验节点维护表格数据
|
|
|
|
|
checkTypeList: [],
|
|
|
|
|
userList: [],
|
|
|
|
|
userRows: [],
|
|
|
|
|
userList: [],
|
|
|
|
|
userRows: [],
|
|
|
|
|
belongToOptions:[],
|
|
|
|
|
belongToStandars:[],
|
|
|
|
|
belongToLines:[],
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
titleUserBind: "",
|
|
|
|
|
titleUserBind: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 查询参数
|
|
|
|
@ -240,7 +251,7 @@ export default {
|
|
|
|
|
attr1: null,
|
|
|
|
|
factoryCode: null,
|
|
|
|
|
},
|
|
|
|
|
getUserParams: {
|
|
|
|
|
getUserParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
userCode: null,
|
|
|
|
@ -261,6 +272,8 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getBelongToLinesList();
|
|
|
|
|
this.getBelongToStandars()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/** 查询检验节点维护列表 */
|
|
|
|
@ -272,6 +285,19 @@ export default {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 查询所属线体选择列表 */
|
|
|
|
|
getBelongToLinesList() {
|
|
|
|
|
listBelongToLines().then(response => {
|
|
|
|
|
this.belongToLines = response;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 查询所属标准选择列表 */
|
|
|
|
|
getBelongToStandars() {
|
|
|
|
|
listBelongToStandars().then(response => {
|
|
|
|
|
this.belongToStandars = response;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
@ -363,103 +389,121 @@ export default {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `checkType_${new Date().getTime()}.xlsx`)
|
|
|
|
|
},
|
|
|
|
|
/** 人员绑定按钮操作页面 */
|
|
|
|
|
handleBind(row){
|
|
|
|
|
//this.reset();
|
|
|
|
|
this.userloading = true;
|
|
|
|
|
//赋值人员选择提交时使用
|
|
|
|
|
this.materialCode = row.orderCode;
|
|
|
|
|
this.materialName = row.checkName;
|
|
|
|
|
this.attr1 = row.attr1;
|
|
|
|
|
/** 人员绑定按钮操作页面 */
|
|
|
|
|
handleBind(row){
|
|
|
|
|
//this.reset();
|
|
|
|
|
this.userloading = true;
|
|
|
|
|
//赋值人员选择提交时使用
|
|
|
|
|
this.materialCode = row.orderCode;
|
|
|
|
|
this.materialName = row.checkName;
|
|
|
|
|
this.attr1 = row.attr1;
|
|
|
|
|
|
|
|
|
|
this.getUserParams.materialCode = row.orderCode;
|
|
|
|
|
|
|
|
|
|
if(row.orderCode == 'checkTypeSC'|| row.orderCode == 'checkTypeSCXJ' ||
|
|
|
|
|
row.orderCode=='checkTypeCPPC' || row.orderCode=='checkTypeCP'){
|
|
|
|
|
this.belongToOptions = this.belongToLines;
|
|
|
|
|
}else if(row.orderCode == 'checkTypeLL'){
|
|
|
|
|
this.belongToOptions = this.belongToStandars;
|
|
|
|
|
}
|
|
|
|
|
console.log("======"+this.belongToOptions)
|
|
|
|
|
|
|
|
|
|
//查询绑定记录表
|
|
|
|
|
getSelectedUsers(this.getUserParams).then(response => {
|
|
|
|
|
this.userList = response.rows;
|
|
|
|
|
this.openUserBind = true;
|
|
|
|
|
this.titleUserBind = "人员绑定详情";
|
|
|
|
|
this.userloading = false;
|
|
|
|
|
this.userloading = false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
getSelectUserList() {
|
|
|
|
|
this.userloading = true;
|
|
|
|
|
//this.getUserParams.materialCode = orderCode;
|
|
|
|
|
getSelectedUsers(this.getUserParams).then(response => {
|
|
|
|
|
this.userList = response.rows;
|
|
|
|
|
this.userloading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
userSelection(selection) {
|
|
|
|
|
const allRows = this.userRows.concat(selection)
|
|
|
|
|
this.userRows = allRows.reduce((acc, cur) => {
|
|
|
|
|
const hasDuplicate = acc.some(item => item.materialCode === cur.materialCode);
|
|
|
|
|
if (!hasDuplicate) {
|
|
|
|
|
acc.push(cur);
|
|
|
|
|
}
|
|
|
|
|
return acc;
|
|
|
|
|
}, []);
|
|
|
|
|
},
|
|
|
|
|
// 关闭弹窗
|
|
|
|
|
handleClose() {
|
|
|
|
|
this.openUserBind = false;
|
|
|
|
|
},
|
|
|
|
|
// 人员选择
|
|
|
|
|
addUser() {
|
|
|
|
|
this.$refs.itemSelectUser.showFlag = true;
|
|
|
|
|
this.$refs.itemSelectUser.getList();
|
|
|
|
|
},
|
|
|
|
|
//人员选择确认
|
|
|
|
|
},
|
|
|
|
|
getSelectUserList() {
|
|
|
|
|
this.userloading = true;
|
|
|
|
|
//this.getUserParams.materialCode = orderCode;
|
|
|
|
|
getSelectedUsers(this.getUserParams).then(response => {
|
|
|
|
|
this.userList = response.rows;
|
|
|
|
|
this.userloading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
userSelection(selection) {
|
|
|
|
|
const allRows = this.userRows.concat(selection)
|
|
|
|
|
this.userRows = allRows.reduce((acc, cur) => {
|
|
|
|
|
const hasDuplicate = acc.some(item => item.materialCode === cur.materialCode);
|
|
|
|
|
if (!hasDuplicate) {
|
|
|
|
|
acc.push(cur);
|
|
|
|
|
}
|
|
|
|
|
return acc;
|
|
|
|
|
}, []);
|
|
|
|
|
},
|
|
|
|
|
// 关闭弹窗
|
|
|
|
|
handleClose() {
|
|
|
|
|
this.openUserBind = false;
|
|
|
|
|
},
|
|
|
|
|
// 人员选择
|
|
|
|
|
addUser() {
|
|
|
|
|
this.$refs.itemSelectUser.showFlag = true;
|
|
|
|
|
this.$refs.itemSelectUser.getList();
|
|
|
|
|
},
|
|
|
|
|
//人员选择确认
|
|
|
|
|
onSelectUser(obj) {
|
|
|
|
|
let data = {
|
|
|
|
|
materialCode: this.materialCode,
|
|
|
|
|
materialName: this.materialName,
|
|
|
|
|
attr1List: [],
|
|
|
|
|
userCodes: [],
|
|
|
|
|
userNames: [],
|
|
|
|
|
materialCode: this.materialCode,
|
|
|
|
|
materialName: this.materialName,
|
|
|
|
|
attr1List: [],
|
|
|
|
|
userCodes: [],
|
|
|
|
|
userNames: [],
|
|
|
|
|
}
|
|
|
|
|
obj.forEach((item, index) => {
|
|
|
|
|
data.userCodes.push(item.userCode);
|
|
|
|
|
data.userNames.push(item.userName);
|
|
|
|
|
data.attr1List.push(item.attr1);
|
|
|
|
|
});
|
|
|
|
|
addUserBind(data).then(response => {
|
|
|
|
|
if(response.code === 200) {
|
|
|
|
|
this.$modal.msgSuccess("人员绑定成功");
|
|
|
|
|
}else{
|
|
|
|
|
this.$modal.msgError(response.msg);
|
|
|
|
|
}
|
|
|
|
|
this.getSelectUserList();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
deleteUser(row) {
|
|
|
|
|
const userCode = row.userCode;
|
|
|
|
|
const userName = row.userName;
|
|
|
|
|
const data = {
|
|
|
|
|
materialCode: this.materialCode,
|
|
|
|
|
userCode: userCode,
|
|
|
|
|
userName: userName,
|
|
|
|
|
}
|
|
|
|
|
this.$modal.confirm('是否确认删除用户名为"' + userName + '"的数据项?').then(function() {
|
|
|
|
|
return deleteByMaterialCode(data);
|
|
|
|
|
}).then(response => {
|
|
|
|
|
obj.forEach((item, index) => {
|
|
|
|
|
data.userCodes.push(item.userCode);
|
|
|
|
|
data.userNames.push(item.userName);
|
|
|
|
|
data.attr1List.push(item.attr1);
|
|
|
|
|
});
|
|
|
|
|
addUserBind(data).then(response => {
|
|
|
|
|
if(response.code === 200) {
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}else{
|
|
|
|
|
this.$modal.msgError(response.msg);
|
|
|
|
|
this.$modal.msgSuccess("人员绑定成功");
|
|
|
|
|
}else{
|
|
|
|
|
this.$modal.msgError(response.msg);
|
|
|
|
|
}
|
|
|
|
|
this.getSelectUserList();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
deleteUser(row) {
|
|
|
|
|
const userCode = row.userCode;
|
|
|
|
|
const userName = row.userName;
|
|
|
|
|
const data = {
|
|
|
|
|
materialCode: this.materialCode,
|
|
|
|
|
userCode: userCode,
|
|
|
|
|
userName: userName,
|
|
|
|
|
}
|
|
|
|
|
this.getSelectUserList();
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
this.$modal.confirm('是否确认删除用户名为"' + userName + '"的数据项?').then(function() {
|
|
|
|
|
return deleteByMaterialCode(data);
|
|
|
|
|
}).then(response => {
|
|
|
|
|
if(response.code === 200) {
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}else{
|
|
|
|
|
this.$modal.msgError(response.msg);
|
|
|
|
|
}
|
|
|
|
|
this.getSelectUserList();
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
//受控文件弹窗
|
|
|
|
|
handleFile(row) {
|
|
|
|
|
this.checkType = row.orderCode;
|
|
|
|
|
this.checkType = row.orderCode;
|
|
|
|
|
this.$refs.itemConfFile.initFunc(this.checkType);
|
|
|
|
|
this.$refs.itemConfFile.showFlag = true;
|
|
|
|
|
this.$refs.itemConfFile.getList();
|
|
|
|
|
},
|
|
|
|
|
//
|
|
|
|
|
selectBelongTo(row){
|
|
|
|
|
const data = {
|
|
|
|
|
id: row.id,
|
|
|
|
|
attr2List: row.attr2List
|
|
|
|
|
}
|
|
|
|
|
updateBelongTo(data).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("分配成功");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|