Commit f983cdec by zhangquan

第一轮bug修复

1 parent ca3f9633
...@@ -28,7 +28,11 @@ ...@@ -28,7 +28,11 @@
</div> </div>
<div class="category-style" v-if="scope.scope.categoryStyle == 2"> <div class="category-style" v-if="scope.scope.categoryStyle == 2">
<img src="@/assets/category/recommend.png"> <img src="@/assets/category/recommend.png">
<span>种草模式</span> <span>种草模式A</span>
</div>
<div class="category-style" v-if="scope.scope.categoryStyle == 3">
<img src="@/assets/category/recommend2.png">
<span>种草模式B</span>
</div> </div>
</div> </div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
......
...@@ -164,7 +164,8 @@ const MerchantColumns = [ ...@@ -164,7 +164,8 @@ const MerchantColumns = [
addHtml: 'giveIntegralSlot' addHtml: 'giveIntegralSlot'
} }
] ]
const defaultExpreeCol = [ const defaultExpreeColFn =(vn) =>{
return [
{ {
label: '配送方式', label: '配送方式',
name: 'deliveryType', name: 'deliveryType',
...@@ -178,13 +179,17 @@ const defaultExpreeCol = [ ...@@ -178,13 +179,17 @@ const defaultExpreeCol = [
}], }],
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
isDisabled: false isDisabled: false,
handleRadioChange: (e)=>{
vn.changeMethod(e, true)
}
}, },
{ {
label: '运费/元', label: '运费/元',
name: 'expressFee', name: 'expressFee',
addHtml: 'expressFeeSlot', addHtml: 'expressFeeSlot',
isDisabled: false isDisabled: false,
isHide: false
}, },
{ {
label: '服务说明', label: '服务说明',
...@@ -195,7 +200,7 @@ const defaultExpreeCol = [ ...@@ -195,7 +200,7 @@ const defaultExpreeCol = [
showLimit: true, showLimit: true,
maxlength: 200 maxlength: 200
}, },
] ]}
const selfGoodsExpreeCol = [ const selfGoodsExpreeCol = [
{ {
...@@ -259,38 +264,7 @@ export default { ...@@ -259,38 +264,7 @@ export default {
isHide: false isHide: false
}, },
], ],
expressInfoFormData: [ expressInfoFormData: defaultExpreeColFn(this),
{
label: '配送方式',
name: 'deliveryType',
type: 'radio',
optionList: [{
confId: 2,
confName: '快递发货'
},{
confId: 1,
confName: '到店核销'
}],
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false
},
{
label: '运费/元',
name: 'expressFee',
addHtml: 'expressFeeSlot',
isDisabled: false
},
{
label: '服务说明',
name: 'introduction',
type: 'input',
inputType: 'textarea',
isDisabled: false,
showLimit: true,
maxlength: 200
},
],
formObj: { formObj: {
goodsSource: 1, goodsSource: 1,
deliveryType: 2, deliveryType: 2,
...@@ -341,7 +315,11 @@ export default { ...@@ -341,7 +315,11 @@ export default {
saleStoreSlot: [{ saleStoreSlot: [{
required: true, required: true,
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
const _target = this.saleMerchantList.find(item => !item.activityPrice || !item.originalPrice) const _target = this.saleMerchantList.find(item => {
let activityPrice = item.activityPrice || 0
let originalPrice = item.originalPrice || 0
return !(+activityPrice) || !(+originalPrice)
})
const _integralTarget = this.saleMerchantList.find(item => !item.giveIntegral && item.giveIntegral!==0) const _integralTarget = this.saleMerchantList.find(item => !item.giveIntegral && item.giveIntegral!==0)
const hasTarget = this.saleMerchantList.find(item => { const hasTarget = this.saleMerchantList.find(item => {
let originalPrice = item.originalPrice || 0 let originalPrice = item.originalPrice || 0
...@@ -490,8 +468,16 @@ export default { ...@@ -490,8 +468,16 @@ export default {
} }
}, },
methods: { methods: {
changeMethod(e, isClear){
const _target = this.expressInfoFormData.find(item => item.name == 'expressFee')
if(_target){
_target.isHide= e==1
if(e==1 && this.formObj.goodsSource==1) this.formObj.expressFee = ''
}
},
changeSource(e, isClear){ changeSource(e, isClear){
this.expressInfoFormData = e==2 ? selfGoodsExpreeCol : defaultExpreeCol this.expressInfoFormData = e==2 ? selfGoodsExpreeCol : defaultExpreeColFn(this)
this.goodsFormData.forEach(item => { this.goodsFormData.forEach(item => {
item.isHide = (item.name == 'retailPrice' || item.name == 'minSellPrice') && e==2 item.isHide = (item.name == 'retailPrice' || item.name == 'minSellPrice') && e==2
}) })
...@@ -709,7 +695,8 @@ export default { ...@@ -709,7 +695,8 @@ export default {
categoryName: res.associationClassifySecondName, categoryName: res.associationClassifySecondName,
id: res.associationClassifySecondId id: res.associationClassifySecondId
} }
this.changeSource() this.changeSource(res.goodsSource)
this.changeMethod(res.deliveryType)
this.formObj.goodsType = '2' //1配置升级, 2车主优选 this.formObj.goodsType = '2' //1配置升级, 2车主优选
this.formObj.coverList =res.goodsImage ? [res.goodsImage] : [] this.formObj.coverList =res.goodsImage ? [res.goodsImage] : []
this.formObj.styleBImgList = res.styleBImg ? [res.styleBImg] : [] this.formObj.styleBImgList = res.styleBImg ? [res.styleBImg] : []
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
<el-button :size="size" <el-button :size="size"
type="primary" type="primary"
@click="resetTable">查询</el-button> @click="resetTable">查询</el-button>
<el-button :size="size" v-if="goodsInfo.goodsSource==2"
@click="resetSearch">重置</el-button>
</span> </span>
</glsx-combi-form> </glsx-combi-form>
<GLTable ref="goodsRef" <GLTable ref="goodsRef"
...@@ -202,6 +204,14 @@ export default { ...@@ -202,6 +204,14 @@ export default {
resetTable() { resetTable() {
this.$refs.goodsRef.refreshTable() this.$refs.goodsRef.refreshTable()
}, },
resetSearch(){
this.searchForm = {
goodsName: '',
discoverGoodsId: '',
goodsType: ''
}
this.resetTable()
},
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
if(this.goodsInfo.goodsSource==2){ if(this.goodsInfo.goodsSource==2){
......
...@@ -24,14 +24,32 @@ ...@@ -24,14 +24,32 @@
<span :class="['status', scope.scope.goodsStatus==1 ? 'success-status': 'error-status']"></span> <span :class="['status', scope.scope.goodsStatus==1 ? 'success-status': 'error-status']"></span>
<span>{{ scope.scope.goodsStatus == 1 ? '上架' : '下架' }}</span> <span>{{ scope.scope.goodsStatus == 1 ? '上架' : '下架' }}</span>
</div> </div>
<div slot="merchantNameSlot" slot-scope="scope">
<template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1">
<span>{{ filterData(scope.scope,'merchantName').slice(0, 1).join('、') }}</span>
<el-popover
placement="top"
width="fit-content"
trigger="hover">
<div v-for="(item,index) in filterData(scope.scope, 'merchantName')" :key="index">
{{ item }}
</div>
<span class="more-info" slot="reference">...[{{ scope.scope.saleMerchantList.length }}]</span>
</el-popover>
</template>
<template v-else>
<span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length">--</span>
<span v-else>{{ filterData(scope.scope, 'merchantName').join('、') }}</span>
</template>
</div>
<div slot="merchantPriceSlot" slot-scope="scope"> <div slot="merchantPriceSlot" slot-scope="scope">
<template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1"> <template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1">
<span>{{ filterData(scope.scope).slice(0, 1).join('、') }}</span> <span>{{ filterData(scope.scope, 'price').slice(0, 1).join('、') }}</span>
<el-popover <el-popover
placement="top" placement="top"
width="fit-content" width="fit-content"
trigger="hover"> trigger="hover">
<div v-for="(item,index) in filterData(scope.scope)" :key="index"> <div v-for="(item,index) in filterData(scope.scope, 'price')" :key="index">
{{ item }} {{ item }}
</div> </div>
<span class="more-info" slot="reference">...[{{ scope.scope.saleMerchantList.length }}]</span> <span class="more-info" slot="reference">...[{{ scope.scope.saleMerchantList.length }}]</span>
...@@ -39,7 +57,7 @@ ...@@ -39,7 +57,7 @@
</template> </template>
<template v-else> <template v-else>
<span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length">--</span> <span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length">--</span>
<span v-else>{{ filterData(scope.scope).join('、') }}</span> <span v-else>{{ filterData(scope.scope, 'price').join('、') }}</span>
</template> </template>
</div> </div>
<div <div
...@@ -58,12 +76,12 @@ ...@@ -58,12 +76,12 @@
</div> </div>
<div slot="giveIntegralSlot" slot-scope="scope"> <div slot="giveIntegralSlot" slot-scope="scope">
<template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1"> <template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1">
<span>{{ filterData(scope.scope, 1).slice(0, 1).join('、') }}</span> <span>{{ filterData(scope.scope, 'score').slice(0, 1).join('、') }}</span>
<el-popover <el-popover
placement="top" placement="top"
width="400" width="400"
trigger="hover"> trigger="hover">
<div v-for="(item,index) in filterData(scope.scope,1)" :key="index"> <div v-for="(item,index) in filterData(scope.scope,'score')" :key="index">
{{ item }} {{ item }}
</div> </div>
<span class="more-info" slot="reference">...({{ scope.scope.saleMerchantList.length }})</span> <span class="more-info" slot="reference">...({{ scope.scope.saleMerchantList.length }})</span>
...@@ -71,7 +89,7 @@ ...@@ -71,7 +89,7 @@
</template> </template>
<template v-else> <template v-else>
<span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length">--</span> <span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length">--</span>
<span v-else>{{ filterData(scope.scope, 1).join('、') }}</span> <span v-else>{{ filterData(scope.scope, 'score').join('、') }}</span>
</template> </template>
</div> </div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
...@@ -197,7 +215,7 @@ export default { ...@@ -197,7 +215,7 @@ export default {
}, },
{ {
label: '来源', label: '来源',
name: 'source', name: 'goodsSource',
type: 'select', type: 'select',
optionList: [ optionList: [
{ {
...@@ -205,17 +223,22 @@ export default { ...@@ -205,17 +223,22 @@ export default {
name: '全部' name: '全部'
}, },
{ {
id: 2,
name: '门店自营'
},
{
id: 1, id: 1,
name: '嘀加智享' name: '嘀加智享'
}, },
{
id: 2,
name: '门店自营'
},
], ],
optionId: 'id', optionId: 'id',
optionLabel: 'name' optionLabel: 'name'
}, },
{
label: '门店名称',
name: 'merchantName',
type: 'input'
},
], ],
getListApi: this.$apis.goods.getGoodsListApi, getListApi: this.$apis.goods.getGoodsListApi,
tableParams: { tableParams: {
...@@ -226,10 +249,10 @@ export default { ...@@ -226,10 +249,10 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '来源', label: '来源',
prop: 'sourse', prop: 'goodsSource',
width: 150, width: 150,
formatter: cellValue => { formatter: cellValue => {
return '嘀加智享平台' return cellValue.goodsSource==1 ? '嘀加智享平台' : '门店自营'
} }
}, },
{ {
...@@ -241,6 +264,12 @@ export default { ...@@ -241,6 +264,12 @@ export default {
label: '缩略图', label: '缩略图',
addHtml: 'imageSlot' addHtml: 'imageSlot'
}, },
{
label: '门店名称',
prop: 'merchantName',
width: 200,
addHtml: 'merchantNameSlot'
},
// { // {
// label: '供货价格(元)', // label: '供货价格(元)',
// formatter: cellValue => { // formatter: cellValue => {
...@@ -411,16 +440,18 @@ export default { ...@@ -411,16 +440,18 @@ export default {
} }
}) })
}, },
filterData({saleMerchantList: list}, notFormat) { filterData({saleMerchantList: list}, type) {
if (notFormat) { if (type=='score') {
return list?.map(item => { return list?.map(item => {
return `${item.merchantName || '--'}:${item.giveIntegral || '0'}` return `${item.merchantName || '--'}:${item.giveIntegral || '0'}`
}) || [] }) || []
} else { } else if(type=='price') {
return list?.map(item => { return list?.map(item => {
let activityPrice = item.activityPrice ? Number((Number(item.activityPrice) / 100).toFixed(2)) : 0 let activityPrice = item.activityPrice ? Number((Number(item.activityPrice) / 100).toFixed(2)) : 0
return `${item.merchantName || '--'}:${activityPrice || '0'}` return `${activityPrice || '0'}`
}) || [] }) || []
}else{
return list?.map(item => item.merchantName) || []
} }
}, },
getParams() { getParams() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!