|
@@ -13,10 +13,10 @@
|
|
|
bordered>
|
|
|
<!-- 产品分类 -->
|
|
|
<template slot="productType" slot-scope="text, record,index">
|
|
|
- <div style="max-height:64px;overflow-y:scroll;">
|
|
|
+ <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-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,con,'typeList')" v-for="(con,i) in record.productTypeArr" :key="i">
|
|
|
+ <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,con,'typeList')" v-for="con in record.productTypeArr" :key="con.id">
|
|
|
{{ con.title }}
|
|
|
</a-tag>
|
|
|
</a-col>
|
|
@@ -34,13 +34,14 @@
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</div>
|
|
|
+ <span v-else v-for="con in record.productTypeArr" :key="con.id">{{ con.title }}</span>
|
|
|
</template>
|
|
|
<!-- 品牌 -->
|
|
|
<template slot="productBrand" slot-scope="text, record,index">
|
|
|
- <div style="max-height:64px;overflow-y:scroll;">
|
|
|
+ <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-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,item,'brandList')" v-for="(item,j) in record.productBrandArr" :key="j">
|
|
|
+ <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,item,'brandList')" v-for="item in record.productBrandArr" :key="item.brandSn">
|
|
|
{{ item.brandName }}
|
|
|
</a-tag>
|
|
|
</a-col>
|
|
@@ -58,72 +59,100 @@
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</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 slot="provincePrice" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
size="small"
|
|
|
- style="width:80%;"
|
|
|
+ style="width:90%;"
|
|
|
v-model="record.provinceDiscountPrice"
|
|
|
:min="0"
|
|
|
:step="1"
|
|
|
: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 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:90%;"
|
|
|
+ v-model="record.provinceDiscountRate"
|
|
|
+ :min="0"
|
|
|
+ :step="1"
|
|
|
+ :max="100"
|
|
|
+ placeholder="请输入"
|
|
|
+ />%
|
|
|
+ </div>
|
|
|
+ <span v-else>{{ record.provinceDiscountRate?record.provinceDiscountRate:'--' }}</span>
|
|
|
</template>
|
|
|
<!-- 市价特价 -->
|
|
|
<template slot="cityPrice" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
size="small"
|
|
|
- style="width:80%;"
|
|
|
+ style="width:90%;"
|
|
|
v-model="record.cityDiscountPrice"
|
|
|
:min="0"
|
|
|
:step="1"
|
|
|
: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 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:90%;"
|
|
|
+ v-model="record.cityDiscountRate"
|
|
|
+ :min="0"
|
|
|
+ :step="1"
|
|
|
+ :max="100"
|
|
|
+ placeholder="请输入"/>%
|
|
|
+ </div>
|
|
|
+ <span v-else>{{ record.cityDiscountRate?record.cityDiscountRate:'--' }}</span>
|
|
|
</template>
|
|
|
<!-- 特约特价 -->
|
|
|
<template slot="specialPrice" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
size="small"
|
|
|
- style="width:80%;"
|
|
|
+ style="width:90%;"
|
|
|
v-model="record.specialDiscountPrice"
|
|
|
:min="0"
|
|
|
:step="1"
|
|
|
: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 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:90%;"
|
|
|
+ v-model="record.specialDiscountRate"
|
|
|
+ :min="0"
|
|
|
+ :step="1"
|
|
|
+ :max="100"
|
|
|
+ placeholder="请输入"/>%
|
|
|
+ </div>
|
|
|
+ <span v-else>{{ record.specialDiscountRate ? record.specialDiscountRate:'--' }}</span>
|
|
|
</template>
|
|
|
<!-- 设置起订量 -->
|
|
|
<template slot="setNum" slot-scope="text, record">
|
|
@@ -142,7 +171,7 @@
|
|
|
v-model="record.unitQty"
|
|
|
:min="0"
|
|
|
:step="1"
|
|
|
- :precision="2"
|
|
|
+ :precision="0"
|
|
|
placeholder="请输入"/>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -190,16 +219,16 @@ export default {
|
|
|
columns: [
|
|
|
{ title: '产品分类', width: '11%', scopedSlots: { customRender: 'productType' }, 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: '省价特价', 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: '特约特价', scopedSlots: { customRender: 'specialPrice' }, width: '6%', align: 'right' },
|
|
|
- { title: '特约折扣', scopedSlots: { customRender: 'specialDiscount' }, width: '6%', align: 'right' },
|
|
|
+ { 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' }
|
|
|
],
|
|
@@ -209,10 +238,25 @@ export default {
|
|
|
chooseBrand: [],
|
|
|
chooseType: [],
|
|
|
brandTagIndex: null, // 所选品牌位置
|
|
|
- classifyTagIndex: null // 所选分类位置
|
|
|
+ classifyTagIndex: null, // 所选分类位置
|
|
|
+ dataSourceOrigin: null // 数据来源 sle 选择产品 null 新增一行品类
|
|
|
}
|
|
|
},
|
|
|
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 () {
|
|
|
const _this = this
|
|
@@ -296,7 +340,6 @@ export default {
|
|
|
this.dataSource[this.brandTagIndex].productBrandList = newConList
|
|
|
},
|
|
|
getResultVal () {
|
|
|
- debugger
|
|
|
const resultObj = JSON.parse(JSON.stringify(this.dataSource))
|
|
|
resultObj.map(item => {
|
|
|
delete item.productTypeArr
|