|
@@ -1,23 +1,23 @@
|
|
<template>
|
|
<template>
|
|
<div class="pages-wrap">
|
|
<div class="pages-wrap">
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
- <s-table
|
|
|
|
|
|
+ <a-table
|
|
class="sTable"
|
|
class="sTable"
|
|
style="margin-top:10px;width:100%;"
|
|
style="margin-top:10px;width:100%;"
|
|
ref="table"
|
|
ref="table"
|
|
size="small"
|
|
size="small"
|
|
- :showPagination="false"
|
|
|
|
- :rowKey="(record) => record.id"
|
|
|
|
|
|
+ :pagination="false"
|
|
|
|
+ :rowKey="(record) => record.productScopeSn"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
- :data="loadData"
|
|
|
|
|
|
+ :data-source="dataSource"
|
|
bordered>
|
|
bordered>
|
|
<!-- 产品分类 -->
|
|
<!-- 产品分类 -->
|
|
- <template slot="productType" slot-scope="text, record">
|
|
|
|
- <div style="max-height:64px;overflow-y:scroll;">
|
|
|
|
- <a-row v-if="record.productTypeList && record.productTypeList.length>0">
|
|
|
|
|
|
+ <template slot="productType" slot-scope="text, record,index">
|
|
|
|
+ <div style="max-height:64px;overflow-y:scroll;" v-if="!record.dataSourceOrigin">
|
|
|
|
+ <a-row v-if="record.productTypeArr && record.productTypeArr.length>0">
|
|
<a-col :span="20">
|
|
<a-col :span="20">
|
|
- <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,con,'typeList')" v-for="(con,i) in record.productTypeList" :key="i">
|
|
|
|
- {{ con.dataName }}
|
|
|
|
|
|
+ <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-tag>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="4" style="text-align:right;">
|
|
<a-col :span="4" style="text-align:right;">
|
|
@@ -34,14 +34,15 @@
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</div>
|
|
</div>
|
|
|
|
+ <span v-else v-for="con in record.productTypeArr" :key="con.id">{{ con.title }}</span>
|
|
</template>
|
|
</template>
|
|
<!-- 品牌 -->
|
|
<!-- 品牌 -->
|
|
- <template slot="productBrand" slot-scope="text, record">
|
|
|
|
- <div style="max-height:64px;overflow-y:scroll;">
|
|
|
|
- <a-row v-if="record.productBrandList && record.productBrandList.length>0">
|
|
|
|
|
|
+ <template slot="productBrand" slot-scope="text, record,index">
|
|
|
|
+ <div style="max-height:64px;overflow-y:scroll;" v-if="!record.dataSourceOrigin">
|
|
|
|
+ <a-row v-if="record.productBrandArr && record.productBrandArr.length>0">
|
|
<a-col :span="20">
|
|
<a-col :span="20">
|
|
- <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,item,'brandList')" v-for="(item,j) in record.productBrandList" :key="j">
|
|
|
|
- {{ item.dataName }}
|
|
|
|
|
|
+ <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,item,'brandList')" v-for="item in record.productBrandArr" :key="item.productBrandSn">
|
|
|
|
+ {{ item.brandName }}
|
|
</a-tag>
|
|
</a-tag>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="4" style="text-align:right;">
|
|
<a-col :span="4" style="text-align:right;">
|
|
@@ -58,6 +59,12 @@
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</div>
|
|
</div>
|
|
|
|
+ <span v-else v-for="item in record.productBrandArr" :key="item.brandSn">{{ item.brandName }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 产品 -->
|
|
|
|
+ <template slot="product" slot-scope="text, record">
|
|
|
|
+ <span v-if="record.dataSourceOrigin" v-for="item in record.productThisList" :key="item.productSn">{{ item.productCode }}</span>
|
|
|
|
+ <span v-else>--</span>
|
|
</template>
|
|
</template>
|
|
<!-- 省价特价 -->
|
|
<!-- 省价特价 -->
|
|
<template slot="provincePrice" slot-scope="text, record">
|
|
<template slot="provincePrice" slot-scope="text, record">
|
|
@@ -68,18 +75,26 @@
|
|
:min="0"
|
|
:min="0"
|
|
:step="1"
|
|
:step="1"
|
|
:precision="2"
|
|
:precision="2"
|
|
- placeholder="请输入"/>
|
|
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ v-if="record.dataSourceOrigin"
|
|
|
|
+ :max="record.provincePrice"
|
|
|
|
+ @blur="e=>calculatePrice(e.target.value,record.productScopeSn,'province')"/>
|
|
|
|
+ <span v-else>--</span>
|
|
</template>
|
|
</template>
|
|
<!-- 省价折扣 -->
|
|
<!-- 省价折扣 -->
|
|
<template slot="provinceDiscount" slot-scope="text, record">
|
|
<template slot="provinceDiscount" slot-scope="text, record">
|
|
- <a-input-number
|
|
|
|
- size="small"
|
|
|
|
- style="width:80%;"
|
|
|
|
- v-model="record.provinceDiscountRate"
|
|
|
|
- :min="0"
|
|
|
|
- :step="1"
|
|
|
|
- :precision="0"
|
|
|
|
- placeholder="请输入"/>%
|
|
|
|
|
|
+ <div v-if="!record.dataSourceOrigin">
|
|
|
|
+ <a-input-number
|
|
|
|
+ size="small"
|
|
|
|
+ style="width:80%;"
|
|
|
|
+ v-model="record.provinceDiscountRate"
|
|
|
|
+ :min="0"
|
|
|
|
+ :step="1"
|
|
|
|
+ :max="100"
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ />%
|
|
|
|
+ </div>
|
|
|
|
+ <span v-else>{{ record.provinceDiscountRate?record.provinceDiscountRate:'--' }}</span>
|
|
</template>
|
|
</template>
|
|
<!-- 市价特价 -->
|
|
<!-- 市价特价 -->
|
|
<template slot="cityPrice" slot-scope="text, record">
|
|
<template slot="cityPrice" slot-scope="text, record">
|
|
@@ -90,18 +105,25 @@
|
|
:min="0"
|
|
:min="0"
|
|
:step="1"
|
|
:step="1"
|
|
:precision="2"
|
|
:precision="2"
|
|
- placeholder="请输入"/>
|
|
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ v-if="record.dataSourceOrigin"
|
|
|
|
+ :max="record.cityPrice"
|
|
|
|
+ @blur="e=>calculatePrice(e.target.value,record.productScopeSn,'city')"/>
|
|
|
|
+ <span v-else>--</span>
|
|
</template>
|
|
</template>
|
|
<!-- 市价折扣 -->
|
|
<!-- 市价折扣 -->
|
|
<template slot="cityDiscount" slot-scope="text, record">
|
|
<template slot="cityDiscount" slot-scope="text, record">
|
|
- <a-input-number
|
|
|
|
- size="small"
|
|
|
|
- style="width:80%;"
|
|
|
|
- v-model="record.cityDiscountRate"
|
|
|
|
- :min="0"
|
|
|
|
- :step="1"
|
|
|
|
- :precision="0"
|
|
|
|
- placeholder="请输入"/>%
|
|
|
|
|
|
+ <div v-if="!record.dataSourceOrigin">
|
|
|
|
+ <a-input-number
|
|
|
|
+ size="small"
|
|
|
|
+ style="width:80%;"
|
|
|
|
+ v-model="record.cityDiscountRate"
|
|
|
|
+ :min="0"
|
|
|
|
+ :step="1"
|
|
|
|
+ :max="100"
|
|
|
|
+ placeholder="请输入"/>%
|
|
|
|
+ </div>
|
|
|
|
+ <span v-else>{{ record.cityDiscountRate?record.cityDiscountRate:'--' }}</span>
|
|
</template>
|
|
</template>
|
|
<!-- 特约特价 -->
|
|
<!-- 特约特价 -->
|
|
<template slot="specialPrice" slot-scope="text, record">
|
|
<template slot="specialPrice" slot-scope="text, record">
|
|
@@ -112,40 +134,47 @@
|
|
:min="0"
|
|
:min="0"
|
|
:step="1"
|
|
:step="1"
|
|
:precision="2"
|
|
:precision="2"
|
|
- placeholder="请输入"/>
|
|
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ v-if="record.dataSourceOrigin"
|
|
|
|
+ :max="record.specialPrice"
|
|
|
|
+ @blur="e=>calculatePrice(e.target.value,record.productScopeSn,'special')"/>
|
|
|
|
+ <span v-else>--</span>
|
|
</template>
|
|
</template>
|
|
<!-- 特约折扣 -->
|
|
<!-- 特约折扣 -->
|
|
<template slot="specialDiscount" slot-scope="text, record">
|
|
<template slot="specialDiscount" slot-scope="text, record">
|
|
- <a-input-number
|
|
|
|
- size="small"
|
|
|
|
- style="width:80%;"
|
|
|
|
- v-model="record.specialDiscountRate"
|
|
|
|
- :min="0"
|
|
|
|
- :step="1"
|
|
|
|
- :precision="0"
|
|
|
|
- placeholder="请输入"/>%
|
|
|
|
|
|
+ <div v-if="!record.dataSourceOrigin">
|
|
|
|
+ <a-input-number
|
|
|
|
+ size="small"
|
|
|
|
+ style="width:80%;"
|
|
|
|
+ v-model="record.specialDiscountRate"
|
|
|
|
+ :min="0"
|
|
|
|
+ :step="1"
|
|
|
|
+ :max="100"
|
|
|
|
+ placeholder="请输入"/>%
|
|
|
|
+ </div>
|
|
|
|
+ <span v-else>{{ record.specialDiscountRate ? record.specialDiscountRate:'--' }}</span>
|
|
</template>
|
|
</template>
|
|
<!-- 设置起订量 -->
|
|
<!-- 设置起订量 -->
|
|
- <template slot="setNum" slot-scope="text, record">
|
|
|
|
- <div>
|
|
|
|
- <v-select
|
|
|
|
- v-model="record.unitType"
|
|
|
|
- size="small"
|
|
|
|
- style="width:55%;"
|
|
|
|
- ref="returnReason"
|
|
|
|
- code="SCOPE_UNIT_TYPE"
|
|
|
|
- placeholder="请选择"
|
|
|
|
- allowClear></v-select>
|
|
|
|
- <a-input-number
|
|
|
|
- size="small"
|
|
|
|
- style="margin-left:10px;width:30%;"
|
|
|
|
- v-model="record.unitQty"
|
|
|
|
- :min="0"
|
|
|
|
- :step="1"
|
|
|
|
- :precision="2"
|
|
|
|
- placeholder="请输入"/>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
|
|
+ <template slot="setNum" slot-scope="text, record">
|
|
|
|
+ <div>
|
|
|
|
+ <v-select
|
|
|
|
+ v-model="record.unitType"
|
|
|
|
+ size="small"
|
|
|
|
+ style="width:55%;"
|
|
|
|
+ ref="returnReason"
|
|
|
|
+ code="SCOPE_UNIT_TYPE"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ allowClear></v-select>
|
|
|
|
+ <a-input-number
|
|
|
|
+ size="small"
|
|
|
|
+ style="margin-left:10px;width:30%;"
|
|
|
|
+ v-model="record.unitQty"
|
|
|
|
+ :min="0"
|
|
|
|
+ :step="1"
|
|
|
|
+ :precision="0"
|
|
|
|
+ placeholder="请输入"/>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
<span slot="action" slot-scope="text,record">
|
|
<span slot="action" slot-scope="text,record">
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
@@ -156,29 +185,27 @@
|
|
删除
|
|
删除
|
|
</a-button>
|
|
</a-button>
|
|
</span>
|
|
</span>
|
|
- </s-table>
|
|
|
|
|
|
+ </a-table>
|
|
<div class="btn-cont">
|
|
<div class="btn-cont">
|
|
<a-button id="tableType1-add" type="primary" class="button-gray" @click="handleAddRow">+新增一行</a-button>
|
|
<a-button id="tableType1-add" type="primary" class="button-gray" @click="handleAddRow">+新增一行</a-button>
|
|
</div>
|
|
</div>
|
|
<!-- 选择产品品牌 -->
|
|
<!-- 选择产品品牌 -->
|
|
<chooseBrandModal :openModal="openBrandModal" :chooseData="chooseBrand" @close="openBrandModal=false" @ok="handleBrandOk" />
|
|
<chooseBrandModal :openModal="openBrandModal" :chooseData="chooseBrand" @close="openBrandModal=false" @ok="handleBrandOk" />
|
|
<!-- 选择产品分类 -->
|
|
<!-- 选择产品分类 -->
|
|
- <chooseTypeModal :openModal="openTypeModal" :chooseData="chooseType" @close="openTypeModal=false" @ok="handleTypeOk" />
|
|
|
|
|
|
+ <chooseTypeModal :openModal="openTypeModal" :linkageStatus="false" :chooseData="chooseType" @close="openTypeModal=false" @ok="handleTypeOk" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
-import { VSelect, STable } from '@/components'
|
|
|
|
|
|
+import { VSelect } from '@/components'
|
|
import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
|
|
import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
|
|
import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
|
|
import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
|
|
-import chooseProductsModal from '@/views/common/chooseProductsModal.vue'
|
|
|
|
-
|
|
|
|
-import { sparePartsReturnList } from '@/api/sparePartsReturn'
|
|
|
|
|
|
+import { getNewScopeSn } from '@/api/promotion'
|
|
export default {
|
|
export default {
|
|
name: 'TableType3',
|
|
name: 'TableType3',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
- components: { VSelect, STable, ChooseBrandModal, ChooseTypeModal, chooseProductsModal },
|
|
|
|
|
|
+ components: { VSelect, ChooseBrandModal, ChooseTypeModal },
|
|
props: {
|
|
props: {
|
|
itemSn: {
|
|
itemSn: {
|
|
type: [Number, String],
|
|
type: [Number, String],
|
|
@@ -192,65 +219,138 @@ export default {
|
|
columns: [
|
|
columns: [
|
|
{ title: '产品分类', width: '11%', scopedSlots: { customRender: 'productType' }, align: 'center' },
|
|
{ title: '产品分类', width: '11%', scopedSlots: { customRender: 'productType' }, align: 'center' },
|
|
{ title: '品牌', width: '11%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
|
|
{ title: '品牌', width: '11%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
|
|
- { title: '产品', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
|
|
+ { title: '产品', scopedSlots: { customRender: 'product' }, width: '8%', align: 'center' },
|
|
{ title: '省价原价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
{ title: '省价原价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
- { title: '省价特价', scopedSlots: { customRender: 'provincePrice' }, width: '6%', align: 'right'},
|
|
|
|
- { title: '省价折扣',scopedSlots: { customRender: 'provinceDiscount' },width: '6%', align: 'right'},
|
|
|
|
- { title: '市价原价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
|
- { title: '市价特价', scopedSlots: { customRender: 'cityPrice' },width: '6%', align: 'right' },
|
|
|
|
- { title: '市价折扣',scopedSlots: { customRender: 'cityDiscount' },width: '6%', align: 'right' },
|
|
|
|
|
|
+ { title: '省价特价', scopedSlots: { customRender: 'provincePrice' }, width: '6%', align: 'center' },
|
|
|
|
+ { title: '省价折扣', scopedSlots: { customRender: 'provinceDiscount' }, width: '6%', align: 'center' },
|
|
|
|
+ { title: '市价原价', dataIndex: 'cityPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
|
+ { title: '市价特价', scopedSlots: { customRender: 'cityPrice' }, width: '6%', align: 'center' },
|
|
|
|
+ { title: '市价折扣', scopedSlots: { customRender: 'cityDiscount' }, width: '6%', align: 'center' },
|
|
{ title: '特约原价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
{ title: '特约原价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
- { title: '特约特价', scopedSlots: { customRender: 'specialPrice' },width: '6%', align: 'right'},
|
|
|
|
- { title: '特约折扣', scopedSlots: { customRender: 'specialDiscount' },width: '6%', align: 'right'},
|
|
|
|
- { title: '设置起订量', width: '14%', scopedSlots: { customRender: 'setNum' }, align: 'center' },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
|
|
|
|
|
|
+ { title: '特约特价', scopedSlots: { customRender: 'specialPrice' }, width: '6%', align: 'center' },
|
|
|
|
+ { title: '特约折扣', scopedSlots: { customRender: 'specialDiscount' }, width: '6%', align: 'center' },
|
|
|
|
+ { title: '设置起订量', width: '12%', scopedSlots: { customRender: 'setNum' }, align: 'center' },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
],
|
|
],
|
|
- queryParam: {},
|
|
|
|
dataSource: [],
|
|
dataSource: [],
|
|
openBrandModal: false,
|
|
openBrandModal: false,
|
|
openTypeModal: false,
|
|
openTypeModal: false,
|
|
- openProductsModal: false,
|
|
|
|
- // 加载数据方法 必须为 Promise 对象
|
|
|
|
- loadData: parameter => {
|
|
|
|
- this.spinning = true
|
|
|
|
- return sparePartsReturnList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
|
- let data
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- data = res.data
|
|
|
|
- const no = (data.pageNo - 1) * data.pageSize
|
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
|
- data.list[i].no = no + i + 1
|
|
|
|
- }
|
|
|
|
- this.dataSource = data.list
|
|
|
|
- }
|
|
|
|
- this.spinning = false
|
|
|
|
- return data
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ chooseBrand: [],
|
|
|
|
+ chooseType: [],
|
|
|
|
+ brandTagIndex: null, // 所选品牌位置
|
|
|
|
+ classifyTagIndex: null, // 所选分类位置
|
|
|
|
+ dataSourceOrigin: null // 数据来源 sle 选择产品 null 新增一行品类
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 计算百分比
|
|
|
|
+ calculatePrice (val, sn, typePrice) {
|
|
|
|
+ const _this = this
|
|
|
|
+ const pos = _this.dataSource.findIndex(con => con.productScopeSn == sn)
|
|
|
|
+ const oldPrice = typePrice + 'Price'
|
|
|
|
+ const str = Math.floor(((val / _this.dataSource[pos][oldPrice]) * 100).toFixed(2)) + '%'
|
|
|
|
+ const name = typePrice + 'DiscountRate'
|
|
|
|
+ _this.dataSource[pos][name] = str
|
|
|
|
+ _this.$forceUpdate()
|
|
|
|
+ },
|
|
|
|
+ // 新增产品 数据
|
|
|
|
+ setSourceData (list) {
|
|
|
|
+ this.dataSource = list
|
|
|
|
+ },
|
|
// 新增一行
|
|
// 新增一行
|
|
handleAddRow () {
|
|
handleAddRow () {
|
|
const _this = this
|
|
const _this = this
|
|
- const newData = {
|
|
|
|
- productTypeList: [],
|
|
|
|
- productBrandList: [],
|
|
|
|
- productList: []
|
|
|
|
- }
|
|
|
|
- _this.dataSource.push(newData)
|
|
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ getNewScopeSn({}).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ const newData = {
|
|
|
|
+ productScopeSn: res.data,
|
|
|
|
+ productTypeArr: [],
|
|
|
|
+ productTypeList: [],
|
|
|
|
+ productBrandArr: [],
|
|
|
|
+ productBrandList: []
|
|
|
|
+ }
|
|
|
|
+ _this.dataSource.push(newData)
|
|
|
|
+ } else {
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 添加产品分类
|
|
// 添加产品分类
|
|
addClassifyTag (pos, row) {
|
|
addClassifyTag (pos, row) {
|
|
|
|
+ this.classifyTagIndex = pos
|
|
this.openTypeModal = true
|
|
this.openTypeModal = true
|
|
},
|
|
},
|
|
|
|
+ handleTypeOk (mainArr) {
|
|
|
|
+ const classifyArr = []
|
|
|
|
+ const newClassifyArr = []
|
|
|
|
+ mainArr.forEach(item => {
|
|
|
|
+ if (item.productTypeLevel == 1) {
|
|
|
|
+ if (!item.dataRef.children) {
|
|
|
|
+ const objType1 = {
|
|
|
|
+ productTypeSn1: item.snPaths
|
|
|
|
+ }
|
|
|
|
+ newClassifyArr.push(objType1)
|
|
|
|
+ const obj = JSON.parse(JSON.stringify(objType1))
|
|
|
|
+ obj.title = item.title
|
|
|
|
+ classifyArr.push(obj)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (item.productTypeLevel == 2) {
|
|
|
|
+ if (!item.dataRef.children) {
|
|
|
|
+ const typeArr1 = item.snPaths ? item.snPaths.split(',') : []
|
|
|
|
+ const objType2 = {
|
|
|
|
+ productTypeSn1: typeArr1[0],
|
|
|
|
+ productTypeSn2: typeArr1[1]
|
|
|
|
+ }
|
|
|
|
+ newClassifyArr.push(objType2)
|
|
|
|
+ const obj = JSON.parse(JSON.stringify(objType2))
|
|
|
|
+ obj.title = item.namePaths.replace(/,/g, '/')
|
|
|
|
+ classifyArr.push(obj)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (item.productTypeLevel == 3) {
|
|
|
|
+ const typeArr2 = item.snPaths ? item.snPaths.split(',') : []
|
|
|
|
+ const objType3 = {
|
|
|
|
+ productTypeSn1: typeArr2[0],
|
|
|
|
+ productTypeSn2: typeArr2[1],
|
|
|
|
+ productTypeSn3: typeArr2[2]
|
|
|
|
+ }
|
|
|
|
+ newClassifyArr.push(objType3)
|
|
|
|
+ const obj = JSON.parse(JSON.stringify(objType3))
|
|
|
|
+ obj.title = item.namePaths.replace(/,/g, '/')
|
|
|
|
+ classifyArr.push(obj)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.dataSource[this.classifyTagIndex].productTypeList = newClassifyArr
|
|
|
|
+ this.dataSource[this.classifyTagIndex].productTypeArr = classifyArr
|
|
|
|
+ },
|
|
// 添加产品品牌
|
|
// 添加产品品牌
|
|
addBrandTag (pos, row) {
|
|
addBrandTag (pos, row) {
|
|
|
|
+ this.brandTagIndex = pos
|
|
this.openBrandModal = true
|
|
this.openBrandModal = true
|
|
},
|
|
},
|
|
- // 添加产品
|
|
|
|
- addProductTag () {
|
|
|
|
- this.openProductsModal = true
|
|
|
|
|
|
+ handleBrandOk (conList) {
|
|
|
|
+ const newConList = conList.map(con => {
|
|
|
|
+ return {
|
|
|
|
+ productBrandSn: con.brandSn
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.dataSource[this.brandTagIndex].productBrandArr = conList
|
|
|
|
+ this.dataSource[this.brandTagIndex].productBrandList = newConList
|
|
|
|
+ },
|
|
|
|
+ getResultVal () {
|
|
|
|
+ const resultObj = JSON.parse(JSON.stringify(this.dataSource))
|
|
|
|
+ resultObj.map(item => {
|
|
|
|
+ delete item.productTypeArr
|
|
|
|
+ delete item.productBrandArr
|
|
|
|
+ return item
|
|
|
|
+ })
|
|
|
|
+ return resultObj
|
|
|
|
+ },
|
|
|
|
+ // 关闭时清空表格数据
|
|
|
|
+ reSetTableData () {
|
|
|
|
+ this.dataSource = []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|