Commit 4ff8630b by zhangxw

商品改版 场景入口配置联调

1 parent e894ded3
...@@ -72,3 +72,15 @@ export function serviceMerchantRelateQrcode(data) { ...@@ -72,3 +72,15 @@ export function serviceMerchantRelateQrcode(data) {
data.method = `dj.api.smartcarlife.serviceMerchant.relate.qrcode` data.method = `dj.api.smartcarlife.serviceMerchant.relate.qrcode`
return request(data, 'post') return request(data, 'post')
} }
// 获取园区店配置的场景入口
export function getYqMerchantSceneConfigAPI(data) {
data.method = `dj.api.smartcarlife.select.openScene.info`
return request(data, 'post')
}
// 配置园区店场景入口
export function settingYqMerchantSceneAPI(data) {
data.method = `dj.api.smartcarlife.update.openScene.info`
return request(data, 'post')
}
...@@ -90,3 +90,9 @@ export function queryFeeCategoryByType(data) { ...@@ -90,3 +90,9 @@ export function queryFeeCategoryByType(data) {
data.method = `${path}smartcarlife.feeCategory.queryFeeCategoryByType` data.method = `${path}smartcarlife.feeCategory.queryFeeCategoryByType`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 2.0场景 素材可选的服务项目
export function getProductServiceItems(data) {
data.method = `dj.api.smartcarlife.vd.item.list.single`
return request(data)
}
...@@ -11,7 +11,8 @@ export const TYPE_NAME = "confType" ...@@ -11,7 +11,8 @@ export const TYPE_NAME = "confType"
*/ */
export const BaseData = { export const BaseData = {
channelType: "channelType", channelType: "channelType",
productType: "productType" productType: "productType",
productServiceItemList: "productServiceItemList"
} }
/** /**
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* @Last Modified time: 2020-11-15 10:22:06 * @Last Modified time: 2020-11-15 10:22:06
*/ */
import { getChannelType, getProductType } from "@/api/sys.base" import { getChannelType, getProductType, getProductServiceItems } from "@/api/sys.base"
// import { // import {
// BaseData // BaseData
// } from '@/common/constants' // } from '@/common/constants'
...@@ -19,7 +19,9 @@ export default { ...@@ -19,7 +19,9 @@ export default {
// 渠道类型 // 渠道类型
channelType: [], channelType: [],
// 产品分类 // 产品分类
productType: [] productType: [],
// 2.0场景素材可选服务项目
productServiceItemList: []
}, },
actions: { actions: {
/** /**
...@@ -29,10 +31,19 @@ export default { ...@@ -29,10 +31,19 @@ export default {
*/ */
init({ state, dispatch, commit }) { init({ state, dispatch, commit }) {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
Promise.all([getChannelType({}), getProductType({})]).then( Promise.all([getChannelType({}), getProductType({}), getProductServiceItems({})]).then(
async ([channelType, productType]) => { async ([channelType, productType, productServiceItemList]) => {
// 处理服务项目数据
let arr = []
productServiceItemList.forEach(val => {
arr.push({
serviceCode: val.serviceCode,
serviceName: val.serviceName
})
})
state.channelType = channelType state.channelType = channelType
state.productType = productType state.productType = productType
state.productServiceItemList = arr
// console.log(productType, "productType") // console.log(productType, "productType")
await dispatch("save2db", { await dispatch("save2db", {
name: "", name: "",
...@@ -49,6 +60,7 @@ export default { ...@@ -49,6 +60,7 @@ export default {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
state.channelType = [] state.channelType = []
state.productType = [] state.productType = []
state.productServiceItemList = []
await dispatch("save2db", { await dispatch("save2db", {
name: "", name: "",
value: state value: state
...@@ -101,8 +113,8 @@ export default { ...@@ -101,8 +113,8 @@ export default {
state = state =
(await dispatch("getFromdb", "base")) || (await dispatch("init")) (await dispatch("getFromdb", "base")) || (await dispatch("init"))
} }
const { channelType, productType } = state const { channelType, productType, productServiceItemList } = state
resolve({ channelType, productType }) resolve({ channelType, productType, productServiceItemList })
}) })
}, },
/** /**
......
...@@ -33,7 +33,8 @@ export default { ...@@ -33,7 +33,8 @@ export default {
copyGoodsCode: '', copyGoodsCode: '',
shoppingMallFlag: '0', shoppingMallFlag: '0',
goodsSpecificationSingleList: [], goodsSpecificationSingleList: [],
specificationSingleDetailList: [] specificationSingleDetailList: [],
selectedSceneCode: ''
} }
}, },
mutations: { mutations: {
......
...@@ -8,13 +8,15 @@ ...@@ -8,13 +8,15 @@
<el-tabs v-model="searchForm.sceneType"> <el-tabs v-model="searchForm.sceneType">
<!-- <el-tab-pane label="1.0新车车损升级" <!-- <el-tab-pane label="1.0新车车损升级"
name="0" /> --> name="0" /> -->
<el-tab-pane label="1.1次新车精品升级" <el-tab-pane :label="sceneList['1']"
name="1" /> name="1" />
<!-- <el-tab-pane label="1.2次新车膨胀金活动" <!-- <el-tab-pane label="1.2次新车膨胀金活动"
name="2" /> --> name="2" /> -->
<el-tab-pane v-if="!specialAccout" <el-tab-pane v-if="!specialAccout"
label="1.3售后直播众筹活动" :label="sceneList['3']"
name="3" /> name="3" />
<el-tab-pane :label="sceneList['0']"
name="0" />
</el-tabs> </el-tabs>
<el-card class="finance_list_summary" <el-card class="finance_list_summary"
:body-style="{ padding: 0 }" :body-style="{ padding: 0 }"
...@@ -517,7 +519,6 @@ ...@@ -517,7 +519,6 @@
<auth-button :data="scope" /> <auth-button :data="scope" />
</template> </template>
</el-table-column> </el-table-column>
</el-table-column>
</el-table> </el-table>
<el-pagination background <el-pagination background
@size-change="handleSizeChange" @size-change="handleSizeChange"
...@@ -549,6 +550,7 @@ import funnelOption from '../index/funnelOption' ...@@ -549,6 +550,7 @@ import funnelOption from '../index/funnelOption'
import { getServiceStore, getParkStore } from '@api/editCustomer' import { getServiceStore, getParkStore } from '@api/editCustomer'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import { sceneList } from "@/common/constants"
import { import {
divisionTypeList, divisionTypeList,
payTypeList, payTypeList,
...@@ -774,8 +776,9 @@ export default { ...@@ -774,8 +776,9 @@ export default {
sunmmaryVisible: true, // 顶部统计模块 sunmmaryVisible: true, // 顶部统计模块
sellerName_visible: true, // 列表字段:转化员 sellerName_visible: true, // 列表字段:转化员
shopProfitType_visible: true, // 列表字段:流量方比例 shopProfitType_visible: true, // 列表字段:流量方比例
yq_visible: true// 列表字段:园区店 yq_visible: true, // 列表字段:园区店
/** 根据场景控制页面显示隐藏end */ /** 根据场景控制页面显示隐藏end */
sceneList: sceneList
} }
}, },
...@@ -1038,6 +1041,7 @@ export default { ...@@ -1038,6 +1041,7 @@ export default {
// console.log(params) // console.log(params)
// api[apiName](params).then(res => { // api[apiName](params).then(res => {
this.tableData = []
api.getList(params).then(res => { api.getList(params).then(res => {
let temp = 1 let temp = 1
this.tableData = res.list.map((item, index) => { this.tableData = res.list.map((item, index) => {
......
...@@ -228,6 +228,24 @@ ...@@ -228,6 +228,24 @@
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
<!-- 2.0场景 服务项目字段 -->
<div v-if="formData['sceneType'] === 0">
<el-form-item prop="serviceItems"
label="包含服务项目"
id="serviceItems"
:label-width="'120px'"
class="dis-in-block"
:style="{'margin-bottom': '22px'}">
<div v-for="(subItem, subIndex) in productServiceItemList" :key="subIndex">
<el-input
v-model.trim="subItem.serviceName"
placeholder="服务项目"
style="width: 432px;margin-bottom: 15px;"
disabled>
</el-input>
</div>
</el-form-item>
</div>
</div> </div>
<div> <div>
<div v-for="(item, index) in i.formBlock" :key="index" style="position: relative;"> <div v-for="(item, index) in i.formBlock" :key="index" style="position: relative;">
...@@ -416,7 +434,8 @@ import { uploadImg, uploadVideo } from '@/api/sys.base' ...@@ -416,7 +434,8 @@ import { uploadImg, uploadVideo } from '@/api/sys.base'
import { positionTypeList, applicableModelTypeList } from '@/common/constants' import { positionTypeList, applicableModelTypeList } from '@/common/constants'
import { limitPrice } from '@/common/format' import { limitPrice } from '@/common/format'
const SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}-info` const SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}-info`
import { membraneTypeList } from '@/common/constants.js' import { membraneTypeList, BaseData } from '@/common/constants.js'
import { mapActions } from 'vuex'
export default { export default {
name: 'productForm', name: 'productForm',
data() { data() {
...@@ -468,7 +487,8 @@ export default { ...@@ -468,7 +487,8 @@ export default {
priceReg: /^\d[\d\.]*$/ priceReg: /^\d[\d\.]*$/
}, },
selectedPositionIds: [], selectedPositionIds: [],
membraneTypeList: membraneTypeList membraneTypeList: membraneTypeList,
productServiceItemList: []
} }
}, },
...@@ -555,9 +575,16 @@ export default { ...@@ -555,9 +575,16 @@ export default {
} else if (this.formData.goodsType == 12 || this.formData.goodsType == 14 || this.formData.goodsType == 4 || this.formData.goodsType == 6) { } else if (this.formData.goodsType == 12 || this.formData.goodsType == 14 || this.formData.goodsType == 4 || this.formData.goodsType == 6) {
this.membranesFormBlock = [copyMembranesFormBlock[1]] this.membranesFormBlock = [copyMembranesFormBlock[1]]
} }
this.getProductServiceItemList()
}, },
methods: { methods: {
...mapActions({
get: 'd2admin/base/get'
}),
async getProductServiceItemList() {
this.productServiceItemList = await this.get(BaseData.productServiceItemList)
},
selectBlur() { selectBlur() {
this.editOptionIndex = -1 this.editOptionIndex = -1
this.showOptionInput = false this.showOptionInput = false
...@@ -666,7 +693,8 @@ export default { ...@@ -666,7 +693,8 @@ export default {
// 全选 // 全选
selectAll(value, targetItem) { selectAll(value, targetItem) {
if (targetItem.name == 'positionIds') { if (targetItem.name == 'positionIds') {
if (this.formData.positionIds.length < deepClone(positionTypeList).length) { // (deepClone(positionTypeList).length + 1) 会有个全选选项 需处理
if (this.formData.positionIds.length < (deepClone(positionTypeList).length + 1)) {
this.formData.positionIds = deepClone(positionTypeList).map(item=>{ this.formData.positionIds = deepClone(positionTypeList).map(item=>{
return item.position return item.position
}) })
...@@ -780,6 +808,7 @@ export default { ...@@ -780,6 +808,7 @@ export default {
deductionStandard: item.deductionStandard deductionStandard: item.deductionStandard
}) })
} }
if (this.formData.sceneType === 0) this.formData.productServiceItemList = this.productServiceItemList
this.formData.goodsPositionList = arr this.formData.goodsPositionList = arr
this.$emit('handleAddConfirm', this.formData) this.$emit('handleAddConfirm', this.formData)
} else { } else {
......
...@@ -47,15 +47,21 @@ ...@@ -47,15 +47,21 @@
:key="indx" :key="indx"
:src="val.content ? val.content : val"> :src="val.content ? val.content : val">
<div style="width: 100%;"> <div style="width: 100%;">
<span class="message-item-span"> <div class="line-block">
<span class="label">场景:</span> <span class="message-item-span">
{{ goodsInfoData.sceneName || '--' }} <span class="label">场景:</span>
</span> {{ goodsInfoData.sceneName || '--' }}
<span class="message-item-span"> </span>
<span class="label">品牌:</span> <span class="message-item-span">
{{ goodsInfoData.brandMerchantName || '--' }} <span class="label">品牌:</span>
</span> {{ goodsInfoData.brandMerchantName || '--' }}
<span class="message-item-span" v-if="goodsInfoData.goodsType == 1"> </span>
<span class="message-item-span">
<span class="label">供应方:</span>
{{ goodsInfoData.supplierName || '--' }}
</span>
</div>
<span class="message-item-block" v-if="goodsInfoData.goodsType == 1">
<span class="label">适用车型:</span> <span class="label">适用车型:</span>
{{ goodsInfoData.applicableModelNames || '--' }} {{ goodsInfoData.applicableModelNames || '--' }}
</span> </span>
...@@ -63,6 +69,10 @@ ...@@ -63,6 +69,10 @@
<span class="label">部位:</span> <span class="label">部位:</span>
{{ goodsInfoData.positionNames || '--' }} {{ goodsInfoData.positionNames || '--' }}
</span> </span>
<span class="message-item-block" v-if="goodsInfoData.selectedSceneCode == 0">
<span class="label">包含服务项目:</span>
<span>{{ goodsInfoData.serviceItems || '--' }}</span>
</span>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
...@@ -75,8 +85,8 @@ ...@@ -75,8 +85,8 @@
<script> <script>
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { getProductInfo } from '@/api/product' import { getProductInfo } from '@/api/product'
import { positionTypeList, applicableModelTypeList } from '@/common/constants' import { positionTypeList, applicableModelTypeList, BaseData } from '@/common/constants'
import { mapMutations, mapGetters } from 'vuex' import { mapMutations, mapGetters, mapActions } from 'vuex'
export default { export default {
name: 'sourceMaterial', name: 'sourceMaterial',
data() { data() {
...@@ -95,8 +105,17 @@ export default { ...@@ -95,8 +105,17 @@ export default {
computed: { computed: {
...mapGetters('goodsInfoData', { goodsInfoData: 'getGoodsInfoData' }) ...mapGetters('goodsInfoData', { goodsInfoData: 'getGoodsInfoData' })
}, },
mounted() {
this.getProductServiceItemList()
},
methods: { methods: {
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']), ...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
...mapActions({
get: 'd2admin/base/get'
}),
async getProductServiceItemList() {
this.productServiceItemList = await this.get(BaseData.productServiceItemList)
},
changeSelect(value) { changeSelect(value) {
// 获取素材详情数据 // 获取素材详情数据
getProductInfo({ getProductInfo({
...@@ -119,7 +138,8 @@ export default { ...@@ -119,7 +138,8 @@ export default {
status: this.goodsInfoData.status, status: this.goodsInfoData.status,
linkMerchants: [], linkMerchants: [],
speciLinkMerchants: [], speciLinkMerchants: [],
selectedSceneCode: tempVal.sceneType selectedSceneCode: tempVal.sceneType,
serviceItems: this.productServiceItemList.map(v => {return v.serviceName})?.join(',') // 暂时不可配置 拿所有服务项目
} }
this.setUpdateGoodsInfo(ObjData) this.setUpdateGoodsInfo(ObjData)
}) })
...@@ -143,20 +163,23 @@ export default { ...@@ -143,20 +163,23 @@ export default {
display: flex; display: flex;
padding: 16px; padding: 16px;
background: #F9F9F9; background: #F9F9F9;
span{ .line-block{
display: inline-block; display: flex;
} .message-item-span{
.message-item-span{ flex: 1;
width: 33%; .label{
.label{ flex-shrink: 0;
color: #666666; display: inline-block;
width: 154px; color: #666666;
text-align: right; width: 154px;
text-align: right;
}
} }
} }
.message-item-block{ .message-item-block{
width: 100%; display: flex;
.label{ .label{
flex-shrink: 0;
color: #666666; color: #666666;
width: 154px; width: 154px;
text-align: right; text-align: right;
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
<span>规格明细</span> <span>规格明细</span>
<el-button type="text" @click="saveShopConfirm" v-if="goodsInfoData.status != 1 && goodsInfoData.status != 2">保存</el-button> <el-button type="text" @click="saveShopConfirm" v-if="goodsInfoData.status != 1 && goodsInfoData.status != 2">保存</el-button>
</div> </div>
<singleSpecificationForm v-if="goodsInfoData.specificationType == '1'" @handleAddConfirm="handleAddConfirm"></singleSpecificationForm> <singleSpecificationForm v-if="goodsInfoData.specificationType == '1'" @handleAddConfirm="handleAddConfirm" :productServiceItemList="productServiceItemList"></singleSpecificationForm>
<multipleSpecificationForm ref="multipleSpecificationFormRef" v-else @handleAddConfirm="handleAddConfirm"></multipleSpecificationForm> <multipleSpecificationForm ref="multipleSpecificationFormRef" v-else @handleAddConfirm="handleAddConfirm" :productServiceItemList="productServiceItemList"></multipleSpecificationForm>
</div> </div>
<div class="sync_type_class"> <div class="sync_type_class">
<span>同步至采购商城:</span> <span>同步至采购商城:</span>
...@@ -33,7 +33,8 @@ import { deepClone } from '@/common/util' ...@@ -33,7 +33,8 @@ import { deepClone } from '@/common/util'
import multipleSpecificationForm from './multipleSpecificationForm.vue' import multipleSpecificationForm from './multipleSpecificationForm.vue'
import singleSpecificationForm from './singleSpecificationForm.vue' import singleSpecificationForm from './singleSpecificationForm.vue'
import { addOrEditBaseGoods, saveTempGoods } from '@/api/commodity' import { addOrEditBaseGoods, saveTempGoods } from '@/api/commodity'
import { mapGetters, mapMutations } from 'vuex' import { mapGetters, mapMutations, mapActions } from 'vuex'
import { BaseData } from '@/common/constants.js'
export default { export default {
name: 'specifications', name: 'specifications',
components: { components: {
...@@ -43,7 +44,8 @@ export default { ...@@ -43,7 +44,8 @@ export default {
data() { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
productPositionTypeList: [] productPositionTypeList: [],
productServiceItemList: []
} }
}, },
computed: { computed: {
...@@ -54,8 +56,15 @@ export default { ...@@ -54,8 +56,15 @@ export default {
// 多规格 // 多规格
this.goodsInfoData.specificationType = '2' this.goodsInfoData.specificationType = '2'
} }
this.getProductServiceItemList()
}, },
methods: { methods: {
...mapActions({
get: 'd2admin/base/get'
}),
async getProductServiceItemList() {
this.productServiceItemList = await this.get(BaseData.productServiceItemList)
},
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']), ...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
handleSpecsEdit(num) { handleSpecsEdit(num) {
if (!this.goodsInfoData.goodsId.length) { if (!this.goodsInfoData.goodsId.length) {
...@@ -149,7 +158,9 @@ export default { ...@@ -149,7 +158,9 @@ export default {
type: item.type, type: item.type,
stock: 999999, stock: 999999,
purchasePrice: item.purchasePrice, purchasePrice: item.purchasePrice,
warningValue: item.warningValue warningValue: item.warningValue,
upgradeGoodsServiceItemsList: deepClone(this.productServiceItemList).filter(v => item.serviceItemArr.includes(v.serviceCode)),
serviceYears: item.serviceYears
}) })
}) })
goodsSpecificationList = arr goodsSpecificationList = arr
...@@ -189,7 +200,9 @@ export default { ...@@ -189,7 +200,9 @@ export default {
type: item.type, type: item.type,
stock: 999999, stock: 999999,
purchasePrice: item.purchasePrice, purchasePrice: item.purchasePrice,
warningValue: item.warningValue warningValue: item.warningValue,
upgradeGoodsServiceItemsList: deepClone(this.productServiceItemList).filter(v => item.serviceItemArr.includes(v.serviceCode)),
serviceYears: item.serviceYears,
}) })
}) })
} }
...@@ -225,7 +238,9 @@ export default { ...@@ -225,7 +238,9 @@ export default {
upgradePrice: val.upgradePrice, upgradePrice: val.upgradePrice,
warningValue: val.warningValue, warningValue: val.warningValue,
warrantyPeriod: val.warrantyPeriod, warrantyPeriod: val.warrantyPeriod,
editGoodNameInput: false editGoodNameInput: false,
serviceItemArr: val.upgradeGoodsServiceItemsList?.map(v => { return v.serviceCode }) || [],
serviceYears: val.serviceYears
} }
}) })
let specificationDetailList = [] let specificationDetailList = []
......
...@@ -91,7 +91,8 @@ export default { ...@@ -91,7 +91,8 @@ export default {
copyGoodsCode: '', copyGoodsCode: '',
shoppingMallFlag: '0', shoppingMallFlag: '0',
goodsSpecificationSingleList: [], goodsSpecificationSingleList: [],
specificationSingleDetailList: [] specificationSingleDetailList: [],
selectedSceneCode: ''
}, },
editGoodsData: false editGoodsData: false
} }
...@@ -174,7 +175,9 @@ export default { ...@@ -174,7 +175,9 @@ export default {
upgradePrice: val.upgradePrice, upgradePrice: val.upgradePrice,
warningValue: val.warningValue, warningValue: val.warningValue,
warrantyPeriod: val.warrantyPeriod, warrantyPeriod: val.warrantyPeriod,
editGoodNameInput: false editGoodNameInput: false,
serviceItemArr: val.upgradeGoodsServiceItemsList?.map(v => { return v.serviceCode }) || [],
serviceYears: val.serviceYears
} }
}) })
res.goodsSpecificationNameList && res.goodsSpecificationNameList.forEach(val => { res.goodsSpecificationNameList && res.goodsSpecificationNameList.forEach(val => {
...@@ -287,7 +290,7 @@ export default { ...@@ -287,7 +290,7 @@ export default {
}) })
}, },
filterEmpty(data) { filterEmpty(data) {
return (data ?? '') === '' return data instanceof Array ? data.length <= 0 : (data ?? '') === ''
}, },
checkGoodsInfo(num, callback) { checkGoodsInfo(num, callback) {
// 根据规格类型赋值进行校验判断 // 根据规格类型赋值进行校验判断
...@@ -322,13 +325,23 @@ export default { ...@@ -322,13 +325,23 @@ export default {
item.purchasePriceEmpty = true item.purchasePriceEmpty = true
item.specificationDataEmpty = true item.specificationDataEmpty = true
if (this.goodsInfoData.goodsType == 1) item.positionEmpty = true if (this.goodsInfoData.goodsType == 1) item.positionEmpty = true
if (this.goodsInfoData.selectedSceneCode === 0) {
item.serviceYearsEmpty = true
item.serviceItemArrEmpty = true
}
return item return item
}) })
this.goodsInfoData.goodsSpecificationList = arr this.goodsInfoData.goodsSpecificationList = arr
this.goodsInfoData.goodsSpecificationSingleList = arr this.goodsInfoData.goodsSpecificationSingleList = arr
let specialList = [] let specialList = []
if (this.goodsInfoData.goodsType == 1) specialList = ['position'] if (this.goodsInfoData.goodsType == 1) { // 膜类 位置 质保 采购价 必填
let requiredList = ['specificationData', 'shopPrice', ...specialList, 'shopMinPrice', 'purchasePrice', 'upgradePrice', 'warrantyPeriod'] specialList = ['position', 'purchasePrice', 'warrantyPeriod']
} else if (this.goodsInfoData.selectedSceneCode === 0) { // 2.0 场景 服务项目 服务时间必填
specialList = ['serviceItemArr', 'serviceYears']
} else { // 其余商品类型 采购价 质保必填
specialList = ['purchasePrice', 'warrantyPeriod']
}
let requiredList = ['specificationData', 'shopPrice', ...specialList, 'shopMinPrice', 'upgradePrice']
for (var i = 0; i < confirmShopData.length; i++) { for (var i = 0; i < confirmShopData.length; i++) {
const item = confirmShopData[i] const item = confirmShopData[i]
if (this.goodsInfoData.specificationType == '2') item.specificationData = item.specsValueList.join(';~;') if (this.goodsInfoData.specificationType == '2') item.specificationData = item.specsValueList.join(';~;')
...@@ -341,7 +354,7 @@ export default { ...@@ -341,7 +354,7 @@ export default {
} catch (error) { } catch (error) {
return document.getElementById('specificationDetailList').scrollIntoView() return document.getElementById('specificationDetailList').scrollIntoView()
} }
if ((Number(item.shopPrice) > Number(item.shopMinPrice)) || Number(item.shopPrice) > Number(item.upgradePrice)) { if (this.formatPrice(i)) {
return document.getElementById('specificationDetailList').scrollIntoView() return document.getElementById('specificationDetailList').scrollIntoView()
} }
} }
...@@ -354,13 +367,16 @@ export default { ...@@ -354,13 +367,16 @@ export default {
item.warrantyPeriod = item.warrantyPeriod && parseFloat(item.warrantyPeriod) item.warrantyPeriod = item.warrantyPeriod && parseFloat(item.warrantyPeriod)
item.purchasePrice = item.purchasePrice && parseFloat(item.purchasePrice) item.purchasePrice = item.purchasePrice && parseFloat(item.purchasePrice)
item.warningValue = item.warningValue && parseFloat(item.warningValue) item.warningValue = item.warningValue && parseFloat(item.warningValue)
item.serviceYears = item.serviceYears && parseFloat(item.serviceYears)
delete item.shopPriceEmpty delete item.shopPriceEmpty
delete item.shopMinPriceEmpty delete item.shopMinPriceEmpty
delete item.upgradePriceEmpty delete item.upgradePriceEmpty
delete item.warrantyPeriodEmpty delete item.warrantyPeriodEmpty
delete item.purchasePriceEmpty delete item.purchasePriceEmpty
delete item.positionEmpty delete item.positionEmpty
delete item.specificationDataEmpty delete item.specificationDataEmpty
delete item.serviceYearsEmpty
delete item.serviceItemArrEmpty
} }
// 对比商品数据 下架/草稿商品是否有变化 提交/关联门店 // 对比商品数据 下架/草稿商品是否有变化 提交/关联门店
if (![1, 2].includes(this.goodsInfoData.status) && num && JSON.stringify(confirmShopData) !== JSON.stringify(this.copyUpgradeGoodsList)) { if (![1, 2].includes(this.goodsInfoData.status) && num && JSON.stringify(confirmShopData) !== JSON.stringify(this.copyUpgradeGoodsList)) {
...@@ -383,6 +399,13 @@ export default { ...@@ -383,6 +399,13 @@ export default {
} }
callback() callback()
}, },
// 校验零售价成本价最低价关系
formatPrice(index) {
let item = this.goodsInfoData.goodsSpecificationSingleList[index]
return (!this.filterEmpty(item.shopPrice) && !this.filterEmpty(item.shopMinPrice) && Number(item.shopPrice) > Number(item.shopMinPrice))
|| (!this.filterEmpty(item.upgradePrice) && !this.filterEmpty(item.shopPrice) && Number(item.shopPrice) > Number(item.upgradePrice))
|| (!this.filterEmpty(item.shopMinPrice) && !this.filterEmpty(item.upgradePrice) && Number(item.shopMinPrice) > Number(item.upgradePrice))
},
saveAssignByMerchantEvent(data, isDelete) { saveAssignByMerchantEvent(data, isDelete) {
let flag = this.goodsInfoData.distributionType == '1' let flag = this.goodsInfoData.distributionType == '1'
// flag true按规格保存 // flag true按规格保存
......
...@@ -261,7 +261,8 @@ export default { ...@@ -261,7 +261,8 @@ export default {
goodsDescList: data.goodsDescList, goodsDescList: data.goodsDescList,
goodsPositionList: data.goodsPositionList || [], goodsPositionList: data.goodsPositionList || [],
carTypeList: data.carTypeList, carTypeList: data.carTypeList,
convertedValue: data.convertedValue convertedValue: data.convertedValue,
productServiceItemList: data.productServiceItemList
} }
params.goodsImgList.forEach(i => { params.goodsImgList.forEach(i => {
delete i.createdDate delete i.createdDate
......
...@@ -130,7 +130,7 @@ export default { ...@@ -130,7 +130,7 @@ export default {
methods: { methods: {
changeScene(value) { changeScene(value) {
if (value == 1) { if (value == 1 || value == 0) {
this.yqStoreVisible = true this.yqStoreVisible = true
} else if (value == 3) { } else if (value == 3) {
this.yqStoreVisible = false this.yqStoreVisible = false
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<el-button type="text" /> <el-button type="text" />
<div slot="auth-button" <div slot="auth-button"
slot-scope="scope" slot-scope="scope"
v-if="scope.scope.scene" v-if="!filterEmpty(scope.scope.scene)"
class="btnClass"> class="btnClass">
<!-- <auth-button slot="auth-button" <!-- <auth-button slot="auth-button"
:data="scope.scope" /> --> :data="scope.scope" /> -->
...@@ -449,7 +449,7 @@ export default { ...@@ -449,7 +449,7 @@ export default {
label: "业务场景", label: "业务场景",
prop: "scene", prop: "scene",
formatter: (cellValue) => { formatter: (cellValue) => {
if (!cellValue.scene) return '' if (this.filterEmpty(cellValue.scene)) return ''
return sceneList[cellValue.scene] return sceneList[cellValue.scene]
} }
}, },
...@@ -701,6 +701,10 @@ export default { ...@@ -701,6 +701,10 @@ export default {
} }
}) })
}, },
// 校验是否有值
filterEmpty(data) {
return (data ?? '') === ''
},
filterNode(value, data, node) { filterNode(value, data, node) {
if (!value) return true if (!value) return true
let parentNode = node.parent let parentNode = node.parent
......
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
<scene-entry-dialog :scene-entry-visible="sceneEntryVisible" <scene-entry-dialog :scene-entry-visible="sceneEntryVisible"
:info="recordInfo" :info="recordInfo"
v-if="sceneEntryVisible" v-if="sceneEntryVisible"
@dialogClose="sceneDialogClose" /> @dialogClose="sceneDialogClose"
@keyDowmGetList="keyDowmGetList" />
</d2-container> </d2-container>
</template> </template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!