Commit 47b0488a by zhangquan

门店车主优选列表

1 parent 76519711
......@@ -24,8 +24,8 @@
</div>
<div slot="saleStoreSlot">
<el-button v-if="!disabled" class="el-icon-plus" size="small" @click="closeDialog">选择门店</el-button>
<template v-if="merchantRequestList && merchantRequestList.length">
<GLTable class="selected-table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams" :tableData="merchantRequestList">
<template v-if="saleMerchantList && saleMerchantList.length">
<GLTable class="selected-table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams" :tableData="saleMerchantList">
<div slot="activityPriceSlot" slot-scope="scope">
<format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" v-model="scope.scope.activityPrice"></format-input>
</div>
......@@ -61,7 +61,7 @@
</GLFooter>
<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>
<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>
</template>
<script>
......@@ -176,7 +176,7 @@ export default {
associationClassifyFirstId: '',
associationClassifySecondId: ''
},
merchantRequestList:[],
saleMerchantList:[],
vehicleSeriesRequestList: [],
myRule: {
selectGoodsName: [
......@@ -220,13 +220,13 @@ export default {
saleStore: [{
required: true,
validator: (rule, value, callback) => {
const target = this.merchantRequestList.find(item => !item.activityPrice)
const hasNegTarget = this.merchantRequestList.find(item => {
const target = this.saleMerchantList.find(item => !item.activityPrice)
const hasNegTarget = this.saleMerchantList.find(item => {
let activityPrice = item.activityPrice || 0
let depositPrice = this.formObj.depositPrice || 0
return +activityPrice < +depositPrice
})
if(!this.merchantRequestList.length){
if(!this.saleMerchantList.length){
callback(new Error('请选择门店'))
}else if(target){
callback(new Error('请输入门店活动价'))
......@@ -350,7 +350,7 @@ export default {
this.goodsVisible = false
},
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 || {}
minSellPrice = minSellPrice ? Number(Number(minSellPrice/100).toFixed(2)) : 0
retailPrice = retailPrice ? Number(Number(retailPrice/100).toFixed(2)) : 0
......@@ -383,7 +383,7 @@ export default {
this.validateField('carSeriesName')
},
confirmDialog(e){
this.merchantRequestList = e || []
this.saleMerchantList = e || []
this.closeDialog()
this.validateField('saleStore')
},
......@@ -394,8 +394,8 @@ export default {
this.merchantDialogVisible = !this.merchantDialogVisible
},
handleDel(row) {
const idx = this.merchantRequestList.findIndex(item => item.id == row.id)
this.merchantRequestList.splice(idx, 1)
const idx = this.saleMerchantList.findIndex(item => item.id == row.id)
this.saleMerchantList.splice(idx, 1)
},
selectCategory(e){
this.formObj.associationClassifyFirstId = e?.parent?.id
......@@ -411,7 +411,7 @@ export default {
delete obj.retailPrice
delete obj.coverList
let merchantRequestList = this.merchantRequestList.map(item => {
let saleMerchantList = this.saleMerchantList.map(item => {
let { merchantId, merchantName, activityPrice } = item
let price = this.formObj.paymentType==1 ? 0 : this.formObj.depositPrice
let retainagePrice = activityPrice - price
......@@ -425,7 +425,7 @@ export default {
}
})
const params = {
saleMerchantList: merchantRequestList,
saleMerchantList: saleMerchantList,
vehicleSeriesRequestList :this.vehicleSeriesRequestList,
...obj
}
......@@ -469,7 +469,7 @@ export default {
}
this.formObj.goodsType = '1'
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
return {...item, activityPrice}
}) || []
......
......@@ -14,8 +14,8 @@
</div>
<div slot="saleStoreSlot">
<el-button v-if="!disabled" class="el-icon-plus" size="small" @click="closeDialog">选择门店</el-button>
<template v-if="merchantRequestList && merchantRequestList.length">
<GLTable class="selected-table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams" :tableData="merchantRequestList">
<template v-if="saleMerchantList && saleMerchantList.length">
<GLTable class="selected-table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams" :tableData="saleMerchantList">
<div slot="activityPriceSlot" slot-scope="scope">
<format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" v-model="scope.scope.activityPrice"></format-input>
</div>
......@@ -38,7 +38,7 @@
<el-button v-if="!disabled" type="primary" @click="handleSave">确定</el-button>
</GLFooter>
<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>
</template>
<script>
......@@ -119,7 +119,7 @@ export default {
associationClassifyFirstId: '',
introduction: ''
},
merchantRequestList:[],
saleMerchantList:[],
goodsList: [],
myRule: {
selectBtnSlot: [
......@@ -151,9 +151,9 @@ export default {
saleStoreSlot: [{
required: true,
validator: (rule, value, callback) => {
const _target = this.merchantRequestList.find(item => !item.activityPrice)
const _integralTarget = this.merchantRequestList.find(item => !item.giveIntegral)
if(!this.merchantRequestList.length){
const _target = this.saleMerchantList.find(item => !item.activityPrice)
const _integralTarget = this.saleMerchantList.find(item => !item.giveIntegral)
if(!this.saleMerchantList.length){
callback(new Error('请选择门店'))
}else if(_target){
callback(new Error('请输入门店活动价'))
......@@ -292,7 +292,7 @@ export default {
this.goodsVisible = false
},
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 || {}
minSellPrice = minSellPrice ? Number(Number(minSellPrice/100).toFixed(2)) : 0
retailPrice = retailPrice ? Number(Number(retailPrice/100).toFixed(2)) : 0
......@@ -301,8 +301,8 @@ export default {
this.validateField(['selectBtnSlot','goodsInfoSlot'])
},
confirmDialog(e){
this.merchantRequestList = e || []
this.merchantRequestList.map(item => this.$set(item, 'giveIntegral', ''))
this.saleMerchantList = e || []
this.saleMerchantList.map(item => this.$set(item, 'giveIntegral', ''))
this.validateField('saleStoreSlot')
this.closeDialog()
},
......@@ -313,8 +313,8 @@ export default {
this.merchantDialogVisible = !this.merchantDialogVisible
},
handleDel(row) {
const idx = this.merchantRequestList.findIndex(item => item.id == row.id)
this.merchantRequestList.splice(idx, 1)
const idx = this.saleMerchantList.findIndex(item => item.id == row.id)
this.saleMerchantList.splice(idx, 1)
},
getParams(){
let obj = JSON.parse(JSON.stringify(this.formObj))
......@@ -326,13 +326,13 @@ export default {
delete obj.source
delete obj.method
let merchantRequestList = this.merchantRequestList.map(item => {
let saleMerchantList = this.saleMerchantList.map(item => {
let { merchantId, merchantName, activityPrice, giveIntegral } = item
activityPrice = activityPrice ? Number(Number(activityPrice*10*10).toFixed(0)) : 0
return {merchantId , merchantName, activityPrice, giveIntegral}
})
const params = {
saleMerchantList: merchantRequestList,
saleMerchantList: saleMerchantList,
...obj
}
if(this.routeInfo.id) params.id = this.routeInfo.id
......@@ -377,7 +377,7 @@ export default {
this.formObj.source = '2',
this.formObj.method = '2',
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
return {...item, activityPrice}
}) || []
......
......@@ -150,11 +150,11 @@
},
{
label: '分类名称',
name: 'goodsName',
name: 'associationClassifyFirstId',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName'
optionId: 'id',
optionLabel: 'categoryName',
},
{
label: '来源',
......@@ -165,10 +165,10 @@
id: '',
name: '全部'
},
{
id: '1',
name: '云中鹤'
},
// {
// id: '1',
// name: '云中鹤'
// },
{
id: '2',
name: '嘀加智享'
......@@ -252,9 +252,25 @@
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
created() {},
created() {
this.getCategory()
},
mounted() {},
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){
this.tableSearchForm.associationClassifyFirstId = e?.parent?.id
this.tableSearchForm.associationClassifySecondId = e?.data?.id
......
......@@ -333,13 +333,6 @@
// 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(){
// console.log(this.selectdData)
this.$emit('handleConfirm', this.selectdData)
......
......@@ -39,7 +39,7 @@
<el-switch v-model="scope.scope.isOpen" @change="updateState(scope.scope)"></el-switch>
</template>
<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-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>
......@@ -119,7 +119,7 @@ export default {
label: '商品名称',
name: 'goodsName',
type: 'input',
filter: '5'
filter: '5, 6'
},
{
label: '创建日期',
......@@ -127,7 +127,26 @@ export default {
type: 'date',
addHtml: 'createdDate',
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: '商品分类',
......@@ -135,6 +154,26 @@ export default {
addHtml: 'categorySlot',
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,
tableParams: {
......@@ -212,12 +251,12 @@ export default {
label: '商品名称',
width: 200,
prop: 'goodsName',
filter: '5'
filter: '5, 6'
},
{
label: '缩略图',
addHtml: 'imageSlot',
filter: '5'
filter: '5, 6'
},
{
label: '收款方式',
......@@ -239,12 +278,30 @@ export default {
label: '门店活动价(元)',
width: 150,
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
},
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: '分类',
width: 150,
formatter: cellValue => {
......@@ -253,9 +310,23 @@ export default {
filter: '5'
},
{
label: '商品分类',
width: 150,
prop: 'associationClassifyFirstName',
filter: '6'
},
{
label: '来源',
width: 150,
formatter: cellValue => {
return '嘀加智享平台'
},
filter: '6'
},
{
label: '状态',
addHtml: 'statusSlot',
filter: '5'
filter: '5,6'
},
{
label: '状态',
......@@ -268,26 +339,26 @@ export default {
{
label: '创建日期',
prop: 'createdDate',
filter: '1,2,3,4,5',
filter: '1,2,3,4,5,6',
minWidth: 180
},
{
label: '更新日期',
prop: 'updatedDate',
minWidth: 180,
filter: '1,2,3,4,5'
filter: '1,2,3,4,5,6'
},
{
label: '操作人',
prop: 'updatedBy',
filter: '1,2,3,4'
},
{
label: '操作人',
width: 120,
prop: 'operator',
filter: '5'
filter: '1,2,3,4,5,6'
},
// {
// label: '操作人',
// width: 120,
// prop: 'operator',
// filter: '5,6'
// },
{
label: '操作',
addHtml: 'auth-button',
......@@ -316,6 +387,7 @@ export default {
},
created() {
this.getconfigMerchant()
this.getCategory()
},
mounted() {},
computed: {
......@@ -329,6 +401,19 @@ export default {
SET_CHANNEL_STYLE: 'channel/SET_CHANNEL_STYLE',
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){
this.ClassifyInfo.associationClassifyFirstId = e?.parent?.id
this.ClassifyInfo.associationClassifySecondId = e?.data?.id
......@@ -352,8 +437,9 @@ export default {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = this.getParams()
if(this.activeName == 5){
this.searchForm.apiType = 5
if(this.activeName == 5 || this.activeName == 6){
this.searchForm.goodsType = this.activeName == 5 ? '1' : '2' //1是配置2是车主
this.searchForm.apiType = 5 //在api.js判断是否更换接口
this.searchForm.merchantId =this.merchantId
const {associationClassifyFirstId, associationClassifySecondId} = this.ClassifyInfo
this.searchForm.associationClassifyFirstId = associationClassifyFirstId
......@@ -379,7 +465,7 @@ export default {
}
} else {
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]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
......@@ -436,7 +522,7 @@ export default {
title = type == 1 ? '查看商品' : '编辑商品'
}
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() {
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!