|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
- <ele-modal :visible.sync="visible" title="" width="80%" @close="cancel">
|
|
|
+ <ele-modal :visible.sync="visible" title="" width="95%" @close="cancel">
|
|
|
<el-row :gutter="40">
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="11">
|
|
|
<headerTitle>
|
|
|
<template v-slot:title>
|
|
|
可选
|
|
|
@@ -21,14 +21,14 @@
|
|
|
>
|
|
|
</template>
|
|
|
</headerTitle>
|
|
|
- <el-form label-width="100px">
|
|
|
+ <el-form label-width="60px">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item :label="`分类`">
|
|
|
<categorySelect
|
|
|
:pid="type"
|
|
|
:key="type"
|
|
|
- v-model="where.categoryLevelGroupId"
|
|
|
+ v-model="where.categoryId"
|
|
|
/>
|
|
|
<!-- <el-input
|
|
|
placeholder="请输入"
|
|
|
@@ -75,7 +75,7 @@
|
|
|
>
|
|
|
</ele-pro-table>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="13">
|
|
|
<headerTitle
|
|
|
><template v-slot:title
|
|
|
>已关联
|
|
|
@@ -95,14 +95,14 @@
|
|
|
></template
|
|
|
></headerTitle
|
|
|
>
|
|
|
- <el-form label-width="100px">
|
|
|
+ <el-form label-width="60px">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item :label="`分类`">
|
|
|
<categorySelect
|
|
|
:pid="type"
|
|
|
:key="type"
|
|
|
- v-model="whereRight.categoryLevelGroupId"
|
|
|
+ v-model="whereRight.categoryId"
|
|
|
/> </el-form-item
|
|
|
></el-col>
|
|
|
<el-col :span="12">
|
|
|
@@ -169,8 +169,9 @@
|
|
|
<template v-slot:angle="{ row }">
|
|
|
<DictSelection dictName="角度" clearable v-model="row.angle">
|
|
|
</DictSelection>
|
|
|
- </template> </ele-pro-table
|
|
|
- ></el-col>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<div slot="footer" class="footer">
|
|
|
@@ -251,15 +252,18 @@
|
|
|
},
|
|
|
{
|
|
|
label: `${this.catogaryName}分类`,
|
|
|
- prop: 'categoryLevelGroupName'
|
|
|
+ prop: 'categoryLevelGroupName',
|
|
|
+ width: 110
|
|
|
},
|
|
|
{
|
|
|
label: `${this.catogaryName}编码`,
|
|
|
- prop: 'code'
|
|
|
+ prop: 'code',
|
|
|
+ width: 110
|
|
|
},
|
|
|
{
|
|
|
label: `${this.catogaryName}名称`,
|
|
|
- prop: 'name'
|
|
|
+ prop: 'name',
|
|
|
+ width: 110
|
|
|
},
|
|
|
{
|
|
|
label: '型号',
|
|
|
@@ -269,7 +273,10 @@
|
|
|
? [
|
|
|
{
|
|
|
label: '槽数',
|
|
|
- prop: 'modelType'
|
|
|
+ prop: 'slotNum',
|
|
|
+ formatter:(_row, _column, cellValue) => {
|
|
|
+ return _row.extendInfo.slotNum;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
label: '角度',
|
|
|
@@ -283,7 +290,8 @@
|
|
|
{
|
|
|
label: '产能',
|
|
|
slot: 'capacity',
|
|
|
- action: 'capacity'
|
|
|
+ action: 'capacity',
|
|
|
+ width: 240
|
|
|
}
|
|
|
]
|
|
|
: [])
|
|
|
@@ -294,19 +302,22 @@
|
|
|
open (type, row) {
|
|
|
this.type = type;
|
|
|
this.row = row;
|
|
|
+ // console.log('this.row',this.row)
|
|
|
this.getDatasource();
|
|
|
this.getDatasourceRight();
|
|
|
this.visible = true;
|
|
|
},
|
|
|
cancel () {
|
|
|
this.visible = false;
|
|
|
+ this.whereRight = {};
|
|
|
+ this.where = {};
|
|
|
},
|
|
|
async save () {
|
|
|
// if (!this.datasourceRightShow.length) {
|
|
|
// return this.$message.error('请添加关联数据');
|
|
|
// }
|
|
|
const params = {
|
|
|
- mainCategoryId: this.row.categoryLevelId,
|
|
|
+ mainCategoryId: this.row.id,
|
|
|
mainCategoryLevelRootId: this.type,
|
|
|
materialDetailsPOList: this.datasourceRightShow.map((i) => ({
|
|
|
...i,
|
|
|
@@ -355,9 +366,9 @@
|
|
|
reload () {
|
|
|
this.datasourceShow = this.datasource.filter((item) => {
|
|
|
return (
|
|
|
- (!this.where.categoryLevelGroupId ||
|
|
|
- item.categoryLevelGroupId.includes(
|
|
|
- this.where.categoryLevelGroupId
|
|
|
+ (!this.where.categoryId ||
|
|
|
+ item.parentId.includes(
|
|
|
+ this.where.categoryId
|
|
|
)) &&
|
|
|
(!this.where.code || item.code.includes(this.where.code)) &&
|
|
|
(!this.where.name || item.name.includes(this.where.name)) &&
|
|
|
@@ -369,9 +380,9 @@
|
|
|
reloadRight () {
|
|
|
this.datasourceRightShow = this.datasourceRight.filter((item) => {
|
|
|
return (
|
|
|
- (!this.whereRight.categoryLevelGroupId ||
|
|
|
- item.categoryLevelGroupId.includes(
|
|
|
- this.whereRight.categoryLevelGroupId
|
|
|
+ (!this.whereRight.categoryId ||
|
|
|
+ item.parentId.includes(
|
|
|
+ this.whereRight.categoryId
|
|
|
)) &&
|
|
|
(!this.whereRight.code ||
|
|
|
item.code.includes(this.whereRight.code)) &&
|
|
|
@@ -384,16 +395,18 @@
|
|
|
},
|
|
|
async getDatasource () {
|
|
|
const data = await unassociated({
|
|
|
- categoryLevelGroupId: this.idMap[this.type]
|
|
|
+ categoryLevelGroupId: this.idMap[this.type],
|
|
|
+ categoryLevelRootId: this.type,
|
|
|
+ mainCategoryId: this.row.id
|
|
|
});
|
|
|
this.datasource = data.slice(0);
|
|
|
this.datasourceShow = data.slice(0);
|
|
|
},
|
|
|
async getDatasourceRight () {
|
|
|
const data = await getRelatesInformationList({
|
|
|
- mainCategoryId: this.row.categoryLevelId,
|
|
|
- // categoryLevelGroupId: this.idMap[this.type],
|
|
|
- categoryLevelRootId: this.type
|
|
|
+ categoryLevelGroupId: this.idMap[this.type],
|
|
|
+ categoryLevelRootId: this.type,
|
|
|
+ mainCategoryId: this.row.id
|
|
|
});
|
|
|
this.datasourceRight = data.slice(0);
|
|
|
this.datasourceRightShow = data.slice(0);
|