Commit 47b0488a by zhangquan

门店车主优选列表

1 parent 76519711
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
</div> </div>
<div slot="saleStoreSlot"> <div slot="saleStoreSlot">
<el-button v-if="!disabled" class="el-icon-plus" size="small" @click="closeDialog">选择门店</el-button> <el-button v-if="!disabled" class="el-icon-plus" size="small" @click="closeDialog">选择门店</el-button>
<template v-if="merchantRequestList && merchantRequestList.length"> <template v-if="saleMerchantList && saleMerchantList.length">
<GLTable class="selected-table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams" :tableData="merchantRequestList"> <GLTable class="selected-table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams" :tableData="saleMerchantList">
<div slot="activityPriceSlot" slot-scope="scope"> <div slot="activityPriceSlot" slot-scope="scope">
<format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" v-model="scope.scope.activityPrice"></format-input> <format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" v-model="scope.scope.activityPrice"></format-input>
</div> </div>
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</GLFooter> </GLFooter>
<selectCarDialog v-if="carDialogVisible" :echoData="vehicleSeriesRequestList" @handleClose="handleCarSeriesClose" @handleConfirm="handleConfirm" :dialogVisible="carDialogVisible"></selectCarDialog> <selectCarDialog v-if="carDialogVisible" :echoData="vehicleSeriesRequestList" @handleClose="handleCarSeriesClose" @handleConfirm="handleConfirm" :dialogVisible="carDialogVisible"></selectCarDialog>
<selectGoods v-if="goodsVisible" :routeInfo="routeInfo" :dialogVisible="goodsVisible" @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></selectGoods> <selectGoods v-if="goodsVisible" :routeInfo="routeInfo" :dialogVisible="goodsVisible" @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></selectGoods>
<selectMerchantDialog @confirmDialog="confirmDialog" @closeDialog="closeDialog" :goodsId="formObj.smartcarlifeInfoId" :selectedList="merchantRequestList" v-if="merchantDialogVisible" :isVisible="merchantDialogVisible"></selectMerchantDialog> <selectMerchantDialog @confirmDialog="confirmDialog" @closeDialog="closeDialog" :goodsId="formObj.smartcarlifeInfoId" :selectedList="saleMerchantList" v-if="merchantDialogVisible" :isVisible="merchantDialogVisible"></selectMerchantDialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -176,7 +176,7 @@ export default { ...@@ -176,7 +176,7 @@ export default {
associationClassifyFirstId: '', associationClassifyFirstId: '',
associationClassifySecondId: '' associationClassifySecondId: ''
}, },
merchantRequestList:[], saleMerchantList:[],
vehicleSeriesRequestList: [], vehicleSeriesRequestList: [],
myRule: { myRule: {
selectGoodsName: [ selectGoodsName: [
...@@ -220,13 +220,13 @@ export default { ...@@ -220,13 +220,13 @@ export default {
saleStore: [{ saleStore: [{
required: true, required: true,
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
const target = this.merchantRequestList.find(item => !item.activityPrice) const target = this.saleMerchantList.find(item => !item.activityPrice)
const hasNegTarget = this.merchantRequestList.find(item => { const hasNegTarget = this.saleMerchantList.find(item => {
let activityPrice = item.activityPrice || 0 let activityPrice = item.activityPrice || 0
let depositPrice = this.formObj.depositPrice || 0 let depositPrice = this.formObj.depositPrice || 0
return +activityPrice < +depositPrice return +activityPrice < +depositPrice
}) })
if(!this.merchantRequestList.length){ if(!this.saleMerchantList.length){
callback(new Error('请选择门店')) callback(new Error('请选择门店'))
}else if(target){ }else if(target){
callback(new Error('请输入门店活动价')) callback(new Error('请输入门店活动价'))
...@@ -350,7 +350,7 @@ export default { ...@@ -350,7 +350,7 @@ export default {
this.goodsVisible = false this.goodsVisible = false
}, },
handleGoodsConfirm(e){ handleGoodsConfirm(e){
if(this.formObj.smartcarlifeInfoId!=e?.id) this.merchantRequestList = [] if(this.formObj.smartcarlifeInfoId!=e?.id) this.saleMerchantList = []
let { id: smartcarlifeInfoId, goodsName, goodsImage, minSellPrice, retailPrice } = e || {} let { id: smartcarlifeInfoId, goodsName, goodsImage, minSellPrice, retailPrice } = e || {}
minSellPrice = minSellPrice ? Number(Number(minSellPrice/100).toFixed(2)) : 0 minSellPrice = minSellPrice ? Number(Number(minSellPrice/100).toFixed(2)) : 0
retailPrice = retailPrice ? Number(Number(retailPrice/100).toFixed(2)) : 0 retailPrice = retailPrice ? Number(Number(retailPrice/100).toFixed(2)) : 0
...@@ -383,7 +383,7 @@ export default { ...@@ -383,7 +383,7 @@ export default {
this.validateField('carSeriesName') this.validateField('carSeriesName')
}, },
confirmDialog(e){ confirmDialog(e){
this.merchantRequestList = e || [] this.saleMerchantList = e || []
this.closeDialog() this.closeDialog()
this.validateField('saleStore') this.validateField('saleStore')
}, },
...@@ -394,8 +394,8 @@ export default { ...@@ -394,8 +394,8 @@ export default {
this.merchantDialogVisible = !this.merchantDialogVisible this.merchantDialogVisible = !this.merchantDialogVisible
}, },
handleDel(row) { handleDel(row) {
const idx = this.merchantRequestList.findIndex(item => item.id == row.id) const idx = this.saleMerchantList.findIndex(item => item.id == row.id)
this.merchantRequestList.splice(idx, 1) this.saleMerchantList.splice(idx, 1)
}, },
selectCategory(e){ selectCategory(e){
this.formObj.associationClassifyFirstId = e?.parent?.id this.formObj.associationClassifyFirstId = e?.parent?.id
...@@ -411,7 +411,7 @@ export default { ...@@ -411,7 +411,7 @@ export default {
delete obj.retailPrice delete obj.retailPrice
delete obj.coverList delete obj.coverList
let merchantRequestList = this.merchantRequestList.map(item => { let saleMerchantList = this.saleMerchantList.map(item => {
let { merchantId, merchantName, activityPrice } = item let { merchantId, merchantName, activityPrice } = item
let price = this.formObj.paymentType==1 ? 0 : this.formObj.depositPrice let price = this.formObj.paymentType==1 ? 0 : this.formObj.depositPrice
let retainagePrice = activityPrice - price let retainagePrice = activityPrice - price
...@@ -425,7 +425,7 @@ export default { ...@@ -425,7 +425,7 @@ export default {
} }
}) })
const params = { const params = {
saleMerchantList: merchantRequestList, saleMerchantList: saleMerchantList,
vehicleSeriesRequestList :this.vehicleSeriesRequestList, vehicleSeriesRequestList :this.vehicleSeriesRequestList,
...obj ...obj
} }
...@@ -469,7 +469,7 @@ export default { ...@@ -469,7 +469,7 @@ export default {
} }
this.formObj.goodsType = '1' this.formObj.goodsType = '1'
this.formObj.coverList = [res.goodsImage] this.formObj.coverList = [res.goodsImage]
this.merchantRequestList = res.saleMerchantList?.map(item => { this.saleMerchantList = res.saleMerchantList?.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, activityPrice} return {...item, activityPrice}
}) || [] }) || []
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
</div> </div>
<div slot="saleStoreSlot"> <div slot="saleStoreSlot">
<el-button v-if="!disabled" class="el-icon-plus" size="small" @click="closeDialog">选择门店</el-button> <el-button v-if="!disabled" class="el-icon-plus" size="small" @click="closeDialog">选择门店</el-button>
<template v-if="merchantRequestList && merchantRequestList.length"> <template v-if="saleMerchantList && saleMerchantList.length">
<GLTable class="selected-table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams" :tableData="merchantRequestList"> <GLTable class="selected-table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams" :tableData="saleMerchantList">
<div slot="activityPriceSlot" slot-scope="scope"> <div slot="activityPriceSlot" slot-scope="scope">
<format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" v-model="scope.scope.activityPrice"></format-input> <format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" v-model="scope.scope.activityPrice"></format-input>
</div> </div>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<el-button v-if="!disabled" type="primary" @click="handleSave">确定</el-button> <el-button v-if="!disabled" type="primary" @click="handleSave">确定</el-button>
</GLFooter> </GLFooter>
<selectGoods v-if="goodsVisible" :routeInfo="routeInfo" :dialogVisible="goodsVisible" :goodsInfo="formObj" @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></selectGoods> <selectGoods v-if="goodsVisible" :routeInfo="routeInfo" :dialogVisible="goodsVisible" :goodsInfo="formObj" @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></selectGoods>
<selectMerchantDialog @confirmDialog="confirmDialog" @closeDialog="closeDialog" :goodsId="formObj.smartcarlifeInfoId" :selectedList="merchantRequestList" v-if="merchantDialogVisible" :isVisible="merchantDialogVisible"></selectMerchantDialog> <selectMerchantDialog @confirmDialog="confirmDialog" @closeDialog="closeDialog" :goodsId="formObj.smartcarlifeInfoId" :selectedList="saleMerchantList" v-if="merchantDialogVisible" :isVisible="merchantDialogVisible"></selectMerchantDialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -119,7 +119,7 @@ export default { ...@@ -119,7 +119,7 @@ export default {
associationClassifyFirstId: '', associationClassifyFirstId: '',
introduction: '' introduction: ''
}, },
merchantRequestList:[], saleMerchantList:[],
goodsList: [], goodsList: [],
myRule: { myRule: {
selectBtnSlot: [ selectBtnSlot: [
...@@ -151,9 +151,9 @@ export default { ...@@ -151,9 +151,9 @@ export default {
saleStoreSlot: [{ saleStoreSlot: [{
required: true, required: true,
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
const _target = this.merchantRequestList.find(item => !item.activityPrice) const _target = this.saleMerchantList.find(item => !item.activityPrice)
const _integralTarget = this.merchantRequestList.find(item => !item.giveIntegral) const _integralTarget = this.saleMerchantList.find(item => !item.giveIntegral)
if(!this.merchantRequestList.length){ if(!this.saleMerchantList.length){
callback(new Error('请选择门店')) callback(new Error('请选择门店'))
}else if(_target){ }else if(_target){
callback(new Error('请输入门店活动价')) callback(new Error('请输入门店活动价'))
...@@ -292,7 +292,7 @@ export default { ...@@ -292,7 +292,7 @@ export default {
this.goodsVisible = false this.goodsVisible = false
}, },
handleGoodsConfirm(e){ handleGoodsConfirm(e){
if(this.formObj.smartcarlifeInfoId!=e?.id) this.merchantRequestList = [] if(this.formObj.smartcarlifeInfoId!=e?.id) this.saleMerchantList = []
let { id: smartcarlifeInfoId, goodsName, goodsImage, minSellPrice, retailPrice } = e || {} let { id: smartcarlifeInfoId, goodsName, goodsImage, minSellPrice, retailPrice } = e || {}
minSellPrice = minSellPrice ? Number(Number(minSellPrice/100).toFixed(2)) : 0 minSellPrice = minSellPrice ? Number(Number(minSellPrice/100).toFixed(2)) : 0
retailPrice = retailPrice ? Number(Number(retailPrice/100).toFixed(2)) : 0 retailPrice = retailPrice ? Number(Number(retailPrice/100).toFixed(2)) : 0
...@@ -301,8 +301,8 @@ export default { ...@@ -301,8 +301,8 @@ export default {
this.validateField(['selectBtnSlot','goodsInfoSlot']) this.validateField(['selectBtnSlot','goodsInfoSlot'])
}, },
confirmDialog(e){ confirmDialog(e){
this.merchantRequestList = e || [] this.saleMerchantList = e || []
this.merchantRequestList.map(item => this.$set(item, 'giveIntegral', '')) this.saleMerchantList.map(item => this.$set(item, 'giveIntegral', ''))
this.validateField('saleStoreSlot') this.validateField('saleStoreSlot')
this.closeDialog() this.closeDialog()
}, },
...@@ -313,8 +313,8 @@ export default { ...@@ -313,8 +313,8 @@ export default {
this.merchantDialogVisible = !this.merchantDialogVisible this.merchantDialogVisible = !this.merchantDialogVisible
}, },
handleDel(row) { handleDel(row) {
const idx = this.merchantRequestList.findIndex(item => item.id == row.id) const idx = this.saleMerchantList.findIndex(item => item.id == row.id)
this.merchantRequestList.splice(idx, 1) this.saleMerchantList.splice(idx, 1)
}, },
getParams(){ getParams(){
let obj = JSON.parse(JSON.stringify(this.formObj)) let obj = JSON.parse(JSON.stringify(this.formObj))
...@@ -326,13 +326,13 @@ export default { ...@@ -326,13 +326,13 @@ export default {
delete obj.source delete obj.source
delete obj.method delete obj.method
let merchantRequestList = this.merchantRequestList.map(item => { let saleMerchantList = this.saleMerchantList.map(item => {
let { merchantId, merchantName, activityPrice, giveIntegral } = item let { merchantId, merchantName, activityPrice, giveIntegral } = item
activityPrice = activityPrice ? Number(Number(activityPrice*10*10).toFixed(0)) : 0 activityPrice = activityPrice ? Number(Number(activityPrice*10*10).toFixed(0)) : 0
return {merchantId , merchantName, activityPrice, giveIntegral} return {merchantId , merchantName, activityPrice, giveIntegral}
}) })
const params = { const params = {
saleMerchantList: merchantRequestList, saleMerchantList: saleMerchantList,
...obj ...obj
} }
if(this.routeInfo.id) params.id = this.routeInfo.id if(this.routeInfo.id) params.id = this.routeInfo.id
...@@ -377,7 +377,7 @@ export default { ...@@ -377,7 +377,7 @@ export default {
this.formObj.source = '2', this.formObj.source = '2',
this.formObj.method = '2', this.formObj.method = '2',
this.formObj.coverList = [res.goodsImage] this.formObj.coverList = [res.goodsImage]
this.merchantRequestList = res.saleMerchantList?.map(item => { this.saleMerchantList = res.saleMerchantList?.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, activityPrice} return {...item, activityPrice}
}) || [] }) || []
......
...@@ -150,11 +150,11 @@ ...@@ -150,11 +150,11 @@
}, },
{ {
label: '分类名称', label: '分类名称',
name: 'goodsName', name: 'associationClassifyFirstId',
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'confId', optionId: 'id',
optionLabel: 'confName' optionLabel: 'categoryName',
}, },
{ {
label: '来源', label: '来源',
...@@ -165,10 +165,10 @@ ...@@ -165,10 +165,10 @@
id: '', id: '',
name: '全部' name: '全部'
}, },
{ // {
id: '1', // id: '1',
name: '云中鹤' // name: '云中鹤'
}, // },
{ {
id: '2', id: '2',
name: '嘀加智享' name: '嘀加智享'
...@@ -252,9 +252,25 @@ ...@@ -252,9 +252,25 @@
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' } pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
} }
}, },
created() {}, created() {
this.getCategory()
},
mounted() {}, mounted() {},
methods: { methods: {
getCategory(){
const params = {
pageSize: 10000,
pageNum: 1,
categoryType: 2
}
this.$apis.category.getCategoryListApi(params).then(res => {
if(res?.list?.length){
const _target = this.searchFormData.find(item => item.name == 'associationClassifyFirstId')
_target && (_target.optionList = res.list)
console.log(this.searchFormData)
}
})
},
selectCategory(e){ selectCategory(e){
this.tableSearchForm.associationClassifyFirstId = e?.parent?.id this.tableSearchForm.associationClassifyFirstId = e?.parent?.id
this.tableSearchForm.associationClassifySecondId = e?.data?.id this.tableSearchForm.associationClassifySecondId = e?.data?.id
......
...@@ -333,13 +333,6 @@ ...@@ -333,13 +333,6 @@
// this.flatData(item.childs, id) // this.flatData(item.childs, id)
// }) // })
// }, // },
getCarSeriList(conText, payload) {
apis.case.getCarSeriesApi({needCarSeries:true}).then(res => {
if(res?.length){
conText.commit('SET_CARSERI_LIST', { list: res })
}
})
},
handleConfirm(){ handleConfirm(){
// console.log(this.selectdData) // console.log(this.selectdData)
this.$emit('handleConfirm', this.selectdData) this.$emit('handleConfirm', this.selectdData)
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<el-switch v-model="scope.scope.isOpen" @change="updateState(scope.scope)"></el-switch> <el-switch v-model="scope.scope.isOpen" @change="updateState(scope.scope)"></el-switch>
</template> </template>
<div class="table-btns btn-wrap" slot="auth-button" slot-scope="scope"> <div class="table-btns btn-wrap" slot="auth-button" slot-scope="scope">
<template v-if="activeName==5"> <el-button type="text" @click="viewGoods(scope.scope, 1)">查看</el-button></template> <template v-if="activeName==5 || activeName==6"> <el-button type="text" @click="viewGoods(scope.scope, 1)">查看</el-button></template>
<template v-else> <template v-else>
<template v-if="scope.scope.confType != 1"> <template v-if="scope.scope.confType != 1">
<el-button type="text" v-if="scope.scope.contentType == 1" @click="handleConfig(scope.scope)">{{ scope.scope.status == 0 ? '待配置' : '编辑' }}</el-button> <el-button type="text" v-if="scope.scope.contentType == 1" @click="handleConfig(scope.scope)">{{ scope.scope.status == 0 ? '待配置' : '编辑' }}</el-button>
...@@ -119,7 +119,7 @@ export default { ...@@ -119,7 +119,7 @@ export default {
label: '商品名称', label: '商品名称',
name: 'goodsName', name: 'goodsName',
type: 'input', type: 'input',
filter: '5' filter: '5, 6'
}, },
{ {
label: '创建日期', label: '创建日期',
...@@ -127,7 +127,26 @@ export default { ...@@ -127,7 +127,26 @@ export default {
type: 'date', type: 'date',
addHtml: 'createdDate', addHtml: 'createdDate',
isClear: true, isClear: true,
filter: '1,2,3,4,5' filter: '1,2,3,4,5,6'
},
{
label: '来源',
name: 'sourse',
type: 'select',
placeholder: '请选择',
optionList: [
{
confId: '',
confName: '全部'
},
{
confId: '2',
confName: '嘀加智享'
},
],
optionId: 'confId',
optionLabel: 'confName',
filter: '6'
}, },
{ {
label: '商品分类', label: '商品分类',
...@@ -135,6 +154,26 @@ export default { ...@@ -135,6 +154,26 @@ export default {
addHtml: 'categorySlot', addHtml: 'categorySlot',
filter: '5' filter: '5'
}, },
{
label: '商品分类',
name: 'associationClassifyFirstId',
type: 'select',
placeholder: '请选择',
optionList: [],
optionId: 'id',
optionLabel: 'categoryName',
filter: '6'
},
// {
// label: '来源',
// name: 'sourse',
// type: 'select',
// placeholder: '请选择',
// optionId: 'confId',
// optionLabel: 'confName',
// optionsName: 'contentTypeList',
// filter: '2'
// },
], ],
getListApi: this.$apis.store.getChannelTopicList, getListApi: this.$apis.store.getChannelTopicList,
tableParams: { tableParams: {
...@@ -212,12 +251,12 @@ export default { ...@@ -212,12 +251,12 @@ export default {
label: '商品名称', label: '商品名称',
width: 200, width: 200,
prop: 'goodsName', prop: 'goodsName',
filter: '5' filter: '5, 6'
}, },
{ {
label: '缩略图', label: '缩略图',
addHtml: 'imageSlot', addHtml: 'imageSlot',
filter: '5' filter: '5, 6'
}, },
{ {
label: '收款方式', label: '收款方式',
...@@ -239,12 +278,30 @@ export default { ...@@ -239,12 +278,30 @@ export default {
label: '门店活动价(元)', label: '门店活动价(元)',
width: 150, width: 150,
formatter: cellValue => { formatter: cellValue => {
let item = cellValue.merchantList && cellValue.merchantList[0] ? cellValue.merchantList[0] : {} let item = cellValue.saleMerchantList && cellValue.saleMerchantList[0] ? cellValue.saleMerchantList[0] : {}
return item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0 return item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0
}, },
filter: '5' filter: '5'
}, },
{ {
label: '销售价格(元)',
width: 150,
formatter: cellValue => {
let item = cellValue.saleMerchantList && cellValue.saleMerchantList[0] ? cellValue.saleMerchantList[0] : {}
return item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0
},
filter: '6'
},
{
label: '赠送积分',
width: 150,
formatter: cellValue => {
let item = cellValue.saleMerchantList && cellValue.saleMerchantList[0] ? cellValue.saleMerchantList[0] : {}
return item.giveIntegral || 0
},
filter: '6'
},
{
label: '分类', label: '分类',
width: 150, width: 150,
formatter: cellValue => { formatter: cellValue => {
...@@ -253,9 +310,23 @@ export default { ...@@ -253,9 +310,23 @@ export default {
filter: '5' filter: '5'
}, },
{ {
label: '商品分类',
width: 150,
prop: 'associationClassifyFirstName',
filter: '6'
},
{
label: '来源',
width: 150,
formatter: cellValue => {
return '嘀加智享平台'
},
filter: '6'
},
{
label: '状态', label: '状态',
addHtml: 'statusSlot', addHtml: 'statusSlot',
filter: '5' filter: '5,6'
}, },
{ {
label: '状态', label: '状态',
...@@ -268,26 +339,26 @@ export default { ...@@ -268,26 +339,26 @@ export default {
{ {
label: '创建日期', label: '创建日期',
prop: 'createdDate', prop: 'createdDate',
filter: '1,2,3,4,5', filter: '1,2,3,4,5,6',
minWidth: 180 minWidth: 180
}, },
{ {
label: '更新日期', label: '更新日期',
prop: 'updatedDate', prop: 'updatedDate',
minWidth: 180, minWidth: 180,
filter: '1,2,3,4,5' filter: '1,2,3,4,5,6'
}, },
{ {
label: '操作人', label: '操作人',
prop: 'updatedBy', prop: 'updatedBy',
filter: '1,2,3,4' filter: '1,2,3,4,5,6'
}, },
{ // {
label: '操作人', // label: '操作人',
width: 120, // width: 120,
prop: 'operator', // prop: 'operator',
filter: '5' // filter: '5,6'
}, // },
{ {
label: '操作', label: '操作',
addHtml: 'auth-button', addHtml: 'auth-button',
...@@ -316,6 +387,7 @@ export default { ...@@ -316,6 +387,7 @@ export default {
}, },
created() { created() {
this.getconfigMerchant() this.getconfigMerchant()
this.getCategory()
}, },
mounted() {}, mounted() {},
computed: { computed: {
...@@ -329,6 +401,19 @@ export default { ...@@ -329,6 +401,19 @@ export default {
SET_CHANNEL_STYLE: 'channel/SET_CHANNEL_STYLE', SET_CHANNEL_STYLE: 'channel/SET_CHANNEL_STYLE',
SET_CHANNEL_TYPE: 'channel/SET_CHANNEL_TYPE' SET_CHANNEL_TYPE: 'channel/SET_CHANNEL_TYPE'
}), }),
getCategory(){
const params = {
pageSize: 10000,
pageNum: 1,
categoryType: 2
}
this.$apis.category.getCategoryListApi(params).then(res => {
if(res?.list?.length){
const _target = this.formData.find(item => item.name == 'associationClassifyFirstId')
_target && (_target.optionList = res.list)
}
})
},
selectCategory(e){ selectCategory(e){
this.ClassifyInfo.associationClassifyFirstId = e?.parent?.id this.ClassifyInfo.associationClassifyFirstId = e?.parent?.id
this.ClassifyInfo.associationClassifySecondId = e?.data?.id this.ClassifyInfo.associationClassifySecondId = e?.data?.id
...@@ -352,8 +437,9 @@ export default { ...@@ -352,8 +437,9 @@ export default {
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.searchForm = this.getParams() this.searchForm = this.getParams()
if(this.activeName == 5){ if(this.activeName == 5 || this.activeName == 6){
this.searchForm.apiType = 5 this.searchForm.goodsType = this.activeName == 5 ? '1' : '2' //1是配置2是车主
this.searchForm.apiType = 5 //在api.js判断是否更换接口
this.searchForm.merchantId =this.merchantId this.searchForm.merchantId =this.merchantId
const {associationClassifyFirstId, associationClassifySecondId} = this.ClassifyInfo const {associationClassifyFirstId, associationClassifySecondId} = this.ClassifyInfo
this.searchForm.associationClassifyFirstId = associationClassifyFirstId this.searchForm.associationClassifyFirstId = associationClassifyFirstId
...@@ -379,7 +465,7 @@ export default { ...@@ -379,7 +465,7 @@ export default {
} }
} else { } else {
this[formName].forEach((item, index) => { this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) { if (this.activeName != 6 && item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName])) this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') { if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {} const temp = {}
...@@ -436,7 +522,7 @@ export default { ...@@ -436,7 +522,7 @@ export default {
title = type == 1 ? '查看商品' : '编辑商品' title = type == 1 ? '查看商品' : '编辑商品'
} }
const queryStr = encodeURIComponent(JSON.stringify(params)) const queryStr = encodeURIComponent(JSON.stringify(params))
this.$router.push({ path: `/goods/add/`+queryStr,query: { $title: title }}) this.$router.push({ path: `/goods/${this.activeName==5? 'add' : 'addPrefer'}/`+queryStr,query: { $title: title }})
}, },
handleClick() { handleClick() {
this.SET_CHANNEL_TYPE({ channelType: this.activeName }) this.SET_CHANNEL_TYPE({ channelType: this.activeName })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!