|
@@ -13,12 +13,19 @@
|
|
|
bordered>
|
|
|
<!-- 产品分类 -->
|
|
|
<template slot="productType" slot-scope="text, record,index">
|
|
|
- <div style="max-height:80px;width:100%;overflow-y:scroll;">
|
|
|
+ <div style="max-height:126px;width:100%;overflow-y:scroll;">
|
|
|
<a-row v-if="record.productTypeArr && record.productTypeArr.length>0">
|
|
|
- <a-col :span="18">
|
|
|
- <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,con,'typeList')" v-for="con in record.productTypeArr" :key="con.id">
|
|
|
- {{ con.title }}
|
|
|
- </a-tag>
|
|
|
+ <a-col :span="16">
|
|
|
+ <div v-for="con in record.productTypeArr" :key="con.id">
|
|
|
+ <a-tooltip v-if="con.title&&con.title.length > 6" :title="con.title">
|
|
|
+ <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,con,'typeList')">
|
|
|
+ {{ `${con.title.slice(0, 6)}...` }}
|
|
|
+ </a-tag>
|
|
|
+ </a-tooltip>
|
|
|
+ <a-tag v-else style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,con,'typeList')">
|
|
|
+ {{ con.title }}
|
|
|
+ </a-tag>
|
|
|
+ </div>
|
|
|
</a-col>
|
|
|
<a-col :span="4" style="text-align:right;">
|
|
|
<a-tag style="background: #fff; borderStyle: dashed;" @click="addClassifyTag(index, record)" color="blue">
|
|
@@ -37,13 +44,21 @@
|
|
|
</template>
|
|
|
<!-- 品牌 -->
|
|
|
<template slot="productBrand" slot-scope="text, record,index">
|
|
|
- <div style="max-height:106spx;overflow-y:scroll;">
|
|
|
+ <div style="max-height:126px;overflow-y:scroll;">
|
|
|
<a-row v-if="record.productBrandArr && record.productBrandArr.length>0">
|
|
|
- <a-col :span="20">
|
|
|
- <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,item,'brandList')" v-for="item in record.productBrandArr" :key="item.brandSn">
|
|
|
- {{ item.brandName }}
|
|
|
- </a-tag>
|
|
|
+ <a-col :span="16">
|
|
|
+ <div v-for="item in record.productBrandArr" :key="item.brandSn">
|
|
|
+ <a-tooltip v-if="item.brandName&&item.brandName.length > 6" :title="item.brandName">
|
|
|
+ <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,item,'brandList')">
|
|
|
+ {{ `${item.brandName.slice(0, 6)}...` }}
|
|
|
+ </a-tag>
|
|
|
+ </a-tooltip>
|
|
|
+ <a-tag v-else style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,item,'brandList')">
|
|
|
+ {{ item.brandName }}
|
|
|
+ </a-tag>
|
|
|
+ </div>
|
|
|
</a-col>
|
|
|
+
|
|
|
<a-col :span="4" style="text-align:right;">
|
|
|
<a-tag style="background: #fff; borderStyle: dashed;" @click="addBrandTag(index, record)" color="blue">
|
|
|
<a-icon type="plus" /> 选择
|
|
@@ -61,9 +76,9 @@
|
|
|
</template>
|
|
|
<!-- 产品 -->
|
|
|
<template slot="product" slot-scope="text, record,index">
|
|
|
- <div style="max-height:64px;overflow-y:scroll;">
|
|
|
+ <div style="max-height:126px;overflow-y:scroll;">
|
|
|
<a-row v-if="record.productThisList && record.productThisList.length>0">
|
|
|
- <a-col :span="20">
|
|
|
+ <a-col :span="16">
|
|
|
<a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,item,'productList')" v-for="item in record.productThisList" :key="item.productSn">
|
|
|
{{ item.productCode }}
|
|
|
</a-tag>
|
|
@@ -98,7 +113,13 @@
|
|
|
<a-button id="tableType1-add" type="primary" class="button-gray" @click="handleAddRow">+新增一行</a-button>
|
|
|
</div>
|
|
|
<!-- 选择产品品牌 -->
|
|
|
- <chooseBrandModal ref="brandBox" :openModal="openBrandModal" :chooseData="chooseBrand" @close="openBrandModal=false" @ok="handleBrandOk" />
|
|
|
+ <chooseBrandModal
|
|
|
+ pageType="1"
|
|
|
+ ref="brandBox"
|
|
|
+ :openModal="openBrandModal"
|
|
|
+ :chooseData="chooseBrand"
|
|
|
+ @close="openBrandModal=false"
|
|
|
+ @ok="handleBrandOk" />
|
|
|
<!-- 选择产品分类 -->
|
|
|
<chooseTypeModal
|
|
|
ref="typeBox"
|
|
@@ -133,10 +154,10 @@ export default {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
columns: [
|
|
|
- { title: '产品分类', width: '20%', scopedSlots: { customRender: 'productType' }, align: 'center' },
|
|
|
+ { title: '产品分类', width: '30%', scopedSlots: { customRender: 'productType' }, align: 'center' },
|
|
|
{ title: '品牌', width: '30%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
|
|
|
- { title: '产品', width: '35%', scopedSlots: { customRender: 'product' }, align: 'center' },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
|
|
|
+ { title: '产品', width: '30%', scopedSlots: { customRender: 'product' }, align: 'center' },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
|
],
|
|
|
dataSource: [],
|
|
|
openBrandModal: false,
|
|
@@ -230,7 +251,8 @@ export default {
|
|
|
}
|
|
|
newClassifyArr.push(objType2)
|
|
|
const obj = JSON.parse(JSON.stringify(objType2))
|
|
|
- obj.title = item.namePaths.replace(/,/g, '/')
|
|
|
+ const newName = item.namePaths.split(',')
|
|
|
+ obj.title = newName[1]
|
|
|
classifyArr.push(obj)
|
|
|
}
|
|
|
}
|
|
@@ -243,7 +265,9 @@ export default {
|
|
|
}
|
|
|
newClassifyArr.push(objType3)
|
|
|
const obj = JSON.parse(JSON.stringify(objType3))
|
|
|
- obj.title = item.namePaths.replace(/,/g, '/')
|
|
|
+ const newName = item.namePaths.split(',')
|
|
|
+ obj.title = newName[1] + '/' + newName[2]
|
|
|
+ obj.id = typeArr2[2]
|
|
|
classifyArr.push(obj)
|
|
|
}
|
|
|
})
|
|
@@ -305,14 +329,18 @@ export default {
|
|
|
return snArr
|
|
|
},
|
|
|
handleEchoData (name, conArr) {
|
|
|
- conArr.map(item => {
|
|
|
- if (name === 'This') {
|
|
|
- item.code = item.productCode
|
|
|
- item.goodsSn = item.productSn
|
|
|
- } else {
|
|
|
- item.goodsSn = item['product' + name + 'Sn']
|
|
|
- }
|
|
|
- })
|
|
|
+ if (conArr) {
|
|
|
+ conArr.map(item => {
|
|
|
+ if (name === 'This') {
|
|
|
+ item.code = item.productCode
|
|
|
+ item.goodsSn = item.productSn
|
|
|
+ } else {
|
|
|
+ item.goodsSn = item['product' + name + 'Sn']
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ conArr = []
|
|
|
+ }
|
|
|
return conArr
|
|
|
},
|
|
|
handleRowData (row) {
|
|
@@ -379,13 +407,14 @@ export default {
|
|
|
this.dataSource[pos].productTypeArr.splice(i, 1)
|
|
|
this.dataSource[pos].productTypeList.splice(i, 1)
|
|
|
} else if (type === 'brandList') {
|
|
|
- const j = this.dataSource[pos].productBrandArr.findIndex(con => con.brandSn == row.productBrandSn)
|
|
|
+ const j = this.dataSource[pos].productBrandArr.findIndex(con => con.brandSn == row.brandSn)
|
|
|
this.dataSource[pos].productBrandArr.splice(j, 1)
|
|
|
this.dataSource[pos].productBrandList.splice(j, 1)
|
|
|
} else {
|
|
|
const k = this.dataSource[pos].productThisList.findIndex(con => con.productSn == row.productSn)
|
|
|
this.dataSource[pos].productThisList.splice(k, 1)
|
|
|
}
|
|
|
+ this.$forceUpdate()
|
|
|
}
|
|
|
}
|
|
|
}
|