|
|
|
|
<template>
|
|
|
|
|
<basic-container>
|
|
|
|
|
<avue-crud
|
|
|
|
|
:option="option"
|
|
|
|
|
:table-loading="loading"
|
|
|
|
|
:data="data"
|
|
|
|
|
v-model="form"
|
|
|
|
|
v-model:page="page"
|
|
|
|
|
ref="crud"
|
|
|
|
|
@row-del="rowDel"
|
|
|
|
|
@search-change="searchChange"
|
|
|
|
|
@search-reset="searchReset"
|
|
|
|
|
@selection-change="selectionChange"
|
|
|
|
|
@current-change="currentChange"
|
|
|
|
|
@size-change="sizeChange"
|
|
|
|
|
@refresh-change="refreshChange"
|
|
|
|
|
@on-load="onLoad"
|
|
|
|
|
>
|
|
|
|
|
<template #menu-left> </template>
|
|
|
|
|
|
|
|
|
|
<template #menu-right="{ size }"> </template>
|
|
|
|
|
<template #menu="scope">
|
|
|
|
|
<el-button type="primary" link @click="setCraftAbility(scope.row)"
|
|
|
|
|
>设置工艺能力</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button type="primary" link @click="changePWD(scope.row)"
|
|
|
|
|
>设置密码</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
<template #virtualMac="scope">
|
|
|
|
|
<span>
|
|
|
|
|
{{ scope.row.virtualMac ? "是" : "否" }}
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
<template #virtualMac-form="{ type, disabled }">
|
|
|
|
|
<el-checkbox v-model="form.virtualMac">虚拟设备</el-checkbox>
|
|
|
|
|
</template>
|
|
|
|
|
<template #virtualMac-label="{ type, disabled }">
|
|
|
|
|
<span></span>
|
|
|
|
|
</template>
|
|
|
|
|
<template #name="{ row }">
|
|
|
|
|
<i :class="row.source" style="margin-right: 5px" />
|
|
|
|
|
<span>{{ row.name }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
<template #source="{ row }">
|
|
|
|
|
<div style="text-align: center">
|
|
|
|
|
<i :class="row.source" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</avue-crud>
|
|
|
|
|
<!-- 设置密码 -->
|
|
|
|
|
<changePassword
|
|
|
|
|
:show-ip="showIp"
|
|
|
|
|
v-if="showIp"
|
|
|
|
|
:ec-id="ecId"
|
|
|
|
|
@cancel="cancel"
|
|
|
|
|
></changePassword>
|
|
|
|
|
|
|
|
|
|
<!-- 设置工艺能力 -->
|
|
|
|
|
<setCraftAbility
|
|
|
|
|
:oc-id="ocId"
|
|
|
|
|
:set-craft-ability-open="setCraftAbilityOpen"
|
|
|
|
|
v-if="setCraftAbilityOpen"
|
|
|
|
|
@cancel="cancel"
|
|
|
|
|
></setCraftAbility>
|
|
|
|
|
</basic-container>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import { getLazyList, remove, update, add, getMenu } from "@/api/system/menu";
|
|
|
|
|
import {getList,getCraftAbility} from "@/api/basicData/oemCustomer"
|
|
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
|
import {
|
|
|
|
|
getQueryAllCaList,
|
|
|
|
|
getQueryAllCaDeatils,
|
|
|
|
|
getQueryAllCaSave,
|
|
|
|
|
getQueryAllCaDel,
|
|
|
|
|
} from "@/api/processManagement/processCapability";
|
|
|
|
|
import { getDictionary } from "@/api/system/dict";
|
|
|
|
|
import changePassword from "./changePassword.vue";
|
|
|
|
|
import setCraftAbility from "./setCraftAbility.vue";
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
changePassword,
|
|
|
|
|
setCraftAbility,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
ocId: null,
|
|
|
|
|
setCraftAbilityOpen: false,
|
|
|
|
|
showIp: false,
|
|
|
|
|
ecId: null,
|
|
|
|
|
bcId: null,
|
|
|
|
|
setCrewOpen: false,
|
|
|
|
|
form: {},
|
|
|
|
|
query: {},
|
|
|
|
|
loading: true,
|
|
|
|
|
selectionList: [],
|
|
|
|
|
parentId: "",
|
|
|
|
|
page: {
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
currentPage: 1,
|
|
|
|
|
total: 0,
|
|
|
|
|
},
|
|
|
|
|
option: {
|
|
|
|
|
columnSort: true,
|
|
|
|
|
tip: false,
|
|
|
|
|
height: "auto",
|
|
|
|
|
calcHeight: 32,
|
|
|
|
|
simplePage: false,
|
|
|
|
|
searchShow: true,
|
|
|
|
|
searchMenuSpan: 6,
|
|
|
|
|
dialogWidth: "60%",
|
|
|
|
|
border: true,
|
|
|
|
|
selection: false,
|
|
|
|
|
index: true,
|
|
|
|
|
menuWidth: 200,
|
|
|
|
|
dialogClickModal: false,
|
|
|
|
|
excelBtn: true,
|
|
|
|
|
viewBtn: false,
|
|
|
|
|
addBtn: false,
|
|
|
|
|
delBtn: false,
|
|
|
|
|
editBtn: false,
|
|
|
|
|
editBtnText: "编辑",
|
|
|
|
|
refreshBtn: false,
|
|
|
|
|
searchShowBtn: false,
|
|
|
|
|
gridBtn: false,
|
|
|
|
|
searchIndex: 3,
|
|
|
|
|
searchIcon: true,
|
|
|
|
|
searchLabelPosition: "left",
|
|
|
|
|
searchLabelPosition: "left",
|
|
|
|
|
searchGutter: 24,
|
|
|
|
|
searchSpan: 6,
|
|
|
|
|
menuAlign: "center",
|
|
|
|
|
gridBtn: false,
|
|
|
|
|
searchMenuPosition: "right",
|
|
|
|
|
addBtnIcon: " ",
|
|
|
|
|
viewBtnIcon: " ",
|
|
|
|
|
delBtnIcon: " ",
|
|
|
|
|
editBtnIcon: " ",
|
|
|
|
|
align: "center",
|
|
|
|
|
column: [
|
|
|
|
|
{
|
|
|
|
|
label: "外协代码",
|
|
|
|
|
prop: "code",
|
|
|
|
|
search: true,
|
|
|
|
|
sortable: true,
|
|
|
|
|
overHidden: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请输入外协代码",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "外协名称",
|
|
|
|
|
prop: "ocName",
|
|
|
|
|
sortable: true,
|
|
|
|
|
search: true,
|
|
|
|
|
overHidden: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请输入外协名称",
|
|
|
|
|
trigger: "click",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "外协简称",
|
|
|
|
|
prop: "abbreviation",
|
|
|
|
|
sortable: true,
|
|
|
|
|
search: true,
|
|
|
|
|
overHidden: true,
|
|
|
|
|
hide: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请选择镀种分类",
|
|
|
|
|
trigger: "click",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "工艺能力",
|
|
|
|
|
prop: "craftAbility",
|
|
|
|
|
sortable: true,
|
|
|
|
|
search: false,
|
|
|
|
|
overHidden: true,
|
|
|
|
|
// width: 120,
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请选择工艺能力",
|
|
|
|
|
trigger: "click",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "地区",
|
|
|
|
|
prop: "region",
|
|
|
|
|
sortable: true,
|
|
|
|
|
search: false,
|
|
|
|
|
overHidden: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请选择地区",
|
|
|
|
|
trigger: "click",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "地址",
|
|
|
|
|
prop: "address",
|
|
|
|
|
sortable: true,
|
|
|
|
|
search: false,
|
|
|
|
|
overHidden: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请选择地址",
|
|
|
|
|
trigger: "click",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "资质",
|
|
|
|
|
prop: "qualification",
|
|
|
|
|
sortable: true,
|
|
|
|
|
search: true,
|
|
|
|
|
overHidden: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请输入资质",
|
|
|
|
|
trigger: "click",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "供货状态",
|
|
|
|
|
prop: "curStatusText",
|
|
|
|
|
sortable: true,
|
|
|
|
|
search: true,
|
|
|
|
|
overHidden: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "联系人",
|
|
|
|
|
prop: "contactMan",
|
|
|
|
|
sortable: true,
|
|
|
|
|
search: true,
|
|
|
|
|
overHidden: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请选择联系人",
|
|
|
|
|
trigger: "click",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "邮箱",
|
|
|
|
|
prop: "email",
|
|
|
|
|
display: true,
|
|
|
|
|
search: false,
|
|
|
|
|
overHidden: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "联系电话",
|
|
|
|
|
prop: "contactPhone",
|
|
|
|
|
sortable: true,
|
|
|
|
|
search: false,
|
|
|
|
|
overHidden: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "密码",
|
|
|
|
|
prop: "oemPassword",
|
|
|
|
|
sortable: true,
|
|
|
|
|
search: false,
|
|
|
|
|
overHidden: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
data: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapGetters(["userInfo", "permission"]),
|
|
|
|
|
permissionList() {
|
|
|
|
|
return {
|
|
|
|
|
addBtn: this.validData(this.permission.menu_add, false),
|
|
|
|
|
viewBtn: this.validData(this.permission.menu_view, false),
|
|
|
|
|
delBtn: this.validData(this.permission.menu_delete, false),
|
|
|
|
|
editBtn: this.validData(this.permission.menu_edit, false),
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
ids() {
|
|
|
|
|
let ids = [];
|
|
|
|
|
this.selectionList.forEach((ele) => {
|
|
|
|
|
ids.push(ele.id);
|
|
|
|
|
});
|
|
|
|
|
return ids.join(",");
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 设置班组、工序、工艺能力
|
|
|
|
|
setCraftAbility(row) {
|
|
|
|
|
this.ocId = row.id;
|
|
|
|
|
this.setCraftAbilityOpen = true;
|
|
|
|
|
},
|
|
|
|
|
changePWD(row) {
|
|
|
|
|
this.ecId = row.id;
|
|
|
|
|
this.showIp = true;
|
|
|
|
|
},
|
|
|
|
|
cancel(isRefresh) {
|
|
|
|
|
this.showIp = false;
|
|
|
|
|
this.isOpen = false;
|
|
|
|
|
this.setCraftAbilityOpen = false;
|
|
|
|
|
if (isRefresh) {
|
|
|
|
|
this.onLoad();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 设置班组人员
|
|
|
|
|
setCrew(bcId) {
|
|
|
|
|
console.log(9999, bcId);
|
|
|
|
|
this.bcId = bcId;
|
|
|
|
|
this.setCrewOpen = true;
|
|
|
|
|
},
|
|
|
|
|
// 设置班组人员弹框关闭
|
|
|
|
|
setCrewOpeSancel(isRefresh) {
|
|
|
|
|
if (isRefresh) {
|
|
|
|
|
this.$refs.myTable.load();
|
|
|
|
|
}
|
|
|
|
|
this.setCrewOpen = false;
|
|
|
|
|
},
|
|
|
|
|
initData() {
|
|
|
|
|
// getMenuTree().then(res => {
|
|
|
|
|
// const column = this.findObject(this.option.column, 'parentId');
|
|
|
|
|
// column.dicData = res.data.data;
|
|
|
|
|
// });
|
|
|
|
|
},
|
|
|
|
|
handleAdd(row) {
|
|
|
|
|
this.parentId = row.id;
|
|
|
|
|
const column = this.findObject(this.option.column, "parentId");
|
|
|
|
|
column.value = row.id;
|
|
|
|
|
column.addDisabled = true;
|
|
|
|
|
this.$refs.crud.rowAdd();
|
|
|
|
|
},
|
|
|
|
|
// 保存
|
|
|
|
|
rowSave(row, done, loading) {
|
|
|
|
|
// add(row).then(
|
|
|
|
|
// res => {
|
|
|
|
|
// // 获取新增数据的相关字段
|
|
|
|
|
// const data = res.data.data;
|
|
|
|
|
// row.id = data.id;
|
|
|
|
|
// this.$message({
|
|
|
|
|
// type: 'success',
|
|
|
|
|
// message: '操作成功!',
|
|
|
|
|
// });
|
|
|
|
|
// // 数据回调进行刷新
|
|
|
|
|
// done(row);
|
|
|
|
|
// },
|
|
|
|
|
// error => {
|
|
|
|
|
// window.console.log(error);
|
|
|
|
|
// loading();
|
|
|
|
|
// }
|
|
|
|
|
// );
|
|
|
|
|
},
|
|
|
|
|
// 修改
|
|
|
|
|
rowUpdate(row, index, done, loading) {
|
|
|
|
|
// update(row).then(
|
|
|
|
|
// () => {
|
|
|
|
|
// this.$message({
|
|
|
|
|
// type: 'success',
|
|
|
|
|
// message: '操作成功!',
|
|
|
|
|
// });
|
|
|
|
|
// // 数据回调进行刷新
|
|
|
|
|
// done(row);
|
|
|
|
|
// },
|
|
|
|
|
// error => {
|
|
|
|
|
// window.console.log(error);
|
|
|
|
|
// loading();
|
|
|
|
|
// }
|
|
|
|
|
// );
|
|
|
|
|
},
|
|
|
|
|
rowDel(row, index, done) {
|
|
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
return remove(row.id);
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "操作成功!",
|
|
|
|
|
});
|
|
|
|
|
// 数据回调进行刷新
|
|
|
|
|
done(row);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 重置
|
|
|
|
|
searchReset() {
|
|
|
|
|
this.query = {};
|
|
|
|
|
this.parentId = 0;
|
|
|
|
|
this.onLoad(this.page);
|
|
|
|
|
},
|
|
|
|
|
// 搜索
|
|
|
|
|
searchChange(params, done) {
|
|
|
|
|
this.query = params;
|
|
|
|
|
this.parentId = "";
|
|
|
|
|
this.page.currentPage = 1;
|
|
|
|
|
this.onLoad(this.page, params);
|
|
|
|
|
done();
|
|
|
|
|
},
|
|
|
|
|
// 选中表格数据
|
|
|
|
|
selectionChange(list) {
|
|
|
|
|
this.selectionList = list;
|
|
|
|
|
},
|
|
|
|
|
//
|
|
|
|
|
selectionClear() {
|
|
|
|
|
this.selectionList = [];
|
|
|
|
|
this.$refs.crud.toggleSelection();
|
|
|
|
|
},
|
|
|
|
|
// 打开弹框 前操作 打开表单前会执行beforeOpen方法
|
|
|
|
|
beforeOpen(done, type) {
|
|
|
|
|
if (["add", "edit"].includes(type)) {
|
|
|
|
|
this.initData();
|
|
|
|
|
}
|
|
|
|
|
if (["edit", "view"].includes(type)) {
|
|
|
|
|
getMenu(this.form.id).then((res) => {
|
|
|
|
|
this.form = Object.assign(res.data.data, {
|
|
|
|
|
hasChildren: this.form.hasChildren,
|
|
|
|
|
});
|
|
|
|
|
if (this.form.parentId === "0") {
|
|
|
|
|
this.form.parentId = "";
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
done();
|
|
|
|
|
},
|
|
|
|
|
// 关闭 弹框 关闭表单前会执行beforeClose方法,
|
|
|
|
|
beforeClose(done) {
|
|
|
|
|
this.parentId = "";
|
|
|
|
|
const column = this.findObject(this.option.column, "parentId");
|
|
|
|
|
column.value = "";
|
|
|
|
|
column.addDisabled = false;
|
|
|
|
|
done();
|
|
|
|
|
},
|
|
|
|
|
// 切换 页码
|
|
|
|
|
currentChange(currentPage) {
|
|
|
|
|
this.page.currentPage = currentPage;
|
|
|
|
|
},
|
|
|
|
|
// 切换页面 数量
|
|
|
|
|
sizeChange(pageSize) {
|
|
|
|
|
this.page.pageSize = pageSize;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
refreshChange() {
|
|
|
|
|
this.onLoad(this.page, this.query);
|
|
|
|
|
},
|
|
|
|
|
// 加载页面数据
|
|
|
|
|
onLoad(page, params = {}) {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
getList({
|
|
|
|
|
current:this.page.currentPage,
|
|
|
|
|
size:this.page.pageSize,
|
|
|
|
|
...this.query
|
|
|
|
|
}).then(res =>{
|
|
|
|
|
this.data = res.data.data.records
|
|
|
|
|
this.page.total = res.data.data.total
|
|
|
|
|
this.loading = false
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|