基础数据-外协厂家管理-新增排序与权限

dev-scheduling
ysn 1 month ago
parent 429c23ea23
commit c6af258443
  1. 231
      src/views/oem/oemCustomer/index.vue

@ -15,21 +15,27 @@
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
@sort-change="sortChange"
>
<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
v-if="permission.oemCustomer_setCapability"
@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 ? "是" : "否" }}
{{ scope.row.virtualMac ? '是' : '否' }}
</span>
</template>
<template #virtualMac-form="{ type, disabled }">
@ -49,12 +55,7 @@
</template>
</avue-crud>
<!-- 设置密码 -->
<changePassword
:show-ip="showIp"
v-if="showIp"
:ec-id="ecId"
@cancel="cancel"
></changePassword>
<changePassword :show-ip="showIp" v-if="showIp" :ec-id="ecId" @cancel="cancel"></changePassword>
<!-- 设置工艺能力 -->
<setCraftAbility
@ -66,18 +67,18 @@
</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 { 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";
} from '@/api/processManagement/processCapability';
import { getDictionary } from '@/api/system/dict';
import changePassword from './changePassword.vue';
import setCraftAbility from './setCraftAbility.vue';
export default {
components: {
changePassword,
@ -95,7 +96,7 @@ export default {
query: {},
loading: true,
selectionList: [],
parentId: "",
parentId: '',
page: {
pageSize: 10,
currentPage: 1,
@ -104,12 +105,12 @@ export default {
option: {
columnSort: true,
tip: false,
height: "auto",
height: 'auto',
calcHeight: 32,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
dialogWidth: "60%",
dialogWidth: '60%',
border: true,
selection: false,
index: true,
@ -120,59 +121,59 @@ export default {
addBtn: false,
delBtn: false,
editBtn: false,
editBtnText: "编辑",
editBtnText: '编辑',
refreshBtn: false,
searchShowBtn: false,
gridBtn: false,
searchIndex: 3,
searchIcon: true,
searchLabelPosition: "left",
searchLabelWidth:'auto',
searchLabelPosition: 'left',
searchLabelWidth: 'auto',
searchGutter: 24,
searchSpan: 6,
menuAlign: "center",
menuAlign: 'center',
gridBtn: false,
searchMenuPosition: "right",
addBtnIcon: " ",
viewBtnIcon: " ",
delBtnIcon: " ",
editBtnIcon: " ",
align: "center",
searchMenuPosition: 'right',
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
align: 'center',
column: [
{
label: "外协代码",
prop: "code",
label: '外协代码',
prop: 'code',
search: true,
sortable: true,
sortable: 'custom',
overHidden: true,
width: 120,
rules: [
{
required: true,
message: "请输入外协代码",
trigger: "blur",
message: '请输入外协代码',
trigger: 'blur',
},
],
},
{
label: "外协名称",
prop: "ocName",
sortable: true,
label: '外协名称',
prop: 'ocName',
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
rules: [
{
required: true,
message: "请输入外协名称",
trigger: "click",
message: '请输入外协名称',
trigger: 'click',
},
],
},
{
label: "外协简称",
prop: "abbreviation",
sortable: true,
label: '外协简称',
prop: 'abbreviation',
sortable: 'custom',
search: false,
overHidden: true,
hide: true,
@ -180,106 +181,105 @@ export default {
rules: [
{
required: true,
message: "请选择镀种分类",
trigger: "click",
message: '请选择镀种分类',
trigger: 'click',
},
],
},
{
label: "工艺能力",
prop: "craftAbility",
sortable: true,
label: '工艺能力',
prop: 'craftAbility',
sortable: 'custom',
search: false,
overHidden: true,
width: 120,
rules: [
{
required: true,
message: "请选择工艺能力",
trigger: "click",
message: '请选择工艺能力',
trigger: 'click',
},
],
},
{
label: "地区",
prop: "region",
sortable: true,
label: '地区',
prop: 'region',
sortable: 'custom',
search: false,
overHidden: true,
width: 120,
rules: [
{
required: true,
message: "请选择地区",
trigger: "click",
message: '请选择地区',
trigger: 'click',
},
],
},
{
label: "地址",
prop: "address",
sortable: true,
label: '地址',
prop: 'address',
sortable: 'custom',
search: false,
overHidden: true,
width: 120,
rules: [
{
required: true,
message: "请选择地址",
trigger: "click",
message: '请选择地址',
trigger: 'click',
},
],
},
{
label: "资质",
prop: "qualification",
sortable: true,
label: '资质',
prop: 'qualification',
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
rules: [
{
required: true,
message: "请输入资质",
trigger: "click",
message: '请输入资质',
trigger: 'click',
},
],
},
{
label: "供货状态",
prop: "curStatusText",
sortable: true,
label: '供货状态',
prop: 'curStatusText',
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
},
{
label: "联系人",
prop: "contactMan",
sortable: true,
label: '联系人',
prop: 'contactMan',
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
rules: [
{
required: true,
message: "请选择联系人",
trigger: "click",
message: '请选择联系人',
trigger: 'click',
},
],
},
{
label: "邮箱",
prop: "email",
label: '邮箱',
prop: 'email',
display: true,
search: false,
overHidden: true,
width: 120,
},
{
label: "联系电话",
prop: "contactPhone",
sortable: true,
label: '联系电话',
prop: 'contactPhone',
sortable: 'custom',
search: false,
overHidden: true,
width: 120,
@ -287,7 +287,7 @@ export default {
// {
// label: "",
// prop: "oemPassword",
// sortable: true,
// sortable: 'custom',
// search: false,
// overHidden: true,
// width: 120,
@ -298,21 +298,13 @@ export default {
};
},
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),
};
},
...mapGetters(['userInfo', 'permission']),
ids() {
let ids = [];
this.selectionList.forEach((ele) => {
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
return ids.join(',');
},
},
methods: {
@ -354,7 +346,7 @@ export default {
},
handleAdd(row) {
this.parentId = row.id;
const column = this.findObject(this.option.column, "parentId");
const column = this.findObject(this.option.column, 'parentId');
column.value = row.id;
column.addDisabled = true;
this.$refs.crud.rowAdd();
@ -397,18 +389,18 @@ export default {
// );
},
rowDel(row, index, done) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.$message({
type: "success",
message: "操作成功!",
type: 'success',
message: '操作成功!',
});
//
done(row);
@ -423,7 +415,7 @@ export default {
//
searchChange(params, done) {
this.query = params;
this.parentId = "";
this.parentId = '';
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
@ -439,16 +431,16 @@ export default {
},
// beforeOpen
beforeOpen(done, type) {
if (["add", "edit"].includes(type)) {
if (['add', 'edit'].includes(type)) {
this.initData();
}
if (["edit", "view"].includes(type)) {
getMenu(this.form.id).then((res) => {
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 = "";
if (this.form.parentId === '0') {
this.form.parentId = '';
}
});
}
@ -456,9 +448,9 @@ export default {
},
// beforeClose
beforeClose(done) {
this.parentId = "";
const column = this.findObject(this.option.column, "parentId");
column.value = "";
this.parentId = '';
const column = this.findObject(this.option.column, 'parentId');
column.value = '';
column.addDisabled = false;
done();
},
@ -474,19 +466,28 @@ export default {
refreshChange() {
this.onLoad(this.page, this.query);
},
sortChange({ prop, order }) {
this.query.descs = undefined;
this.query.ascs = undefined;
let orderByFieldKey = order === 'descending' ? 'descs' : 'ascs';
this.query[orderByFieldKey] = !prop
? undefined
: prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase();
// //
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
})
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;
});
},
},
};

Loading…
Cancel
Save