Commit 077fb56e by zhangxw

v4.20.0 商品模块需求开发

1 parent af5cd745
import request from "./request"
const path = 'dj.api.smartcarlife.'
// 获取上架管理 列表数据
export function getGroundingManageList(data) {
data.method = `${path}merchantGoodsInfo.page`
return request(data)
}
// 获取上架商品详情
export function getMerchantGoodsInfo(data) {
data.method = `${path}merchantGoodsInfo.getById`
return request(data)
}
// 删除
export function delGroundingById(data) {
data.method = `${path}merchantGoodsInfo.deleteById`
return request(data)
}
// 批量审核
export function batchReviewAPI(data) {
data.method = `${path}merchantGoodsInfo.updateBatchWaitAudit`
return request(data)
}
// 上下架
export function updateGoodsStatus(data) {
data.method = `${path}merchantGoodsInfo.updateStatus`
return request(data)
}
// 添加编辑上架信息
export function addOrUpdateAPI(data) {
data.method = `${path}merchantGoodsInfo.insertOrUpdate`
return request(data)
}
// 获取门店开通的场景
export function getSceneTypeListByMerchantId(data) {
data.method = `${path}scenemerchantref.listScene`
return request(data)
}
// 获取类目商品两级选择框数据
export function getAllGroupByCategory(data) {
data.method = `${path}productManager.getAllGroupByCategory`
return request(data)
}
\ No newline at end of file
import request from "./request"
const path = 'dj.api.smartcarlife.'
// 获取产品管理 列表数据
export function getProductManageList(data) {
data.method = `${path}productManager.page`
return request(data)
}
// 新增产品
export function addProductManage(data) {
data.method = `${path}productManager.add`
return request(data)
}
// 编辑产品
export function UpdateProductManage(data) {
data.method = `${path}productManager.update`
return request(data)
}
\ No newline at end of file
......@@ -457,10 +457,10 @@ export const sceneCodeList = [
]
// 所属场景
export const sceneList = {
1: "1.1精品升级",
2: "1.2次新车转化",
3: "1.3售后众筹",
0: "2.0会员权益/升级"
1: "精品升级",
2: "次新车转化",
3: "售后众筹",
0: "会员权益/升级"
}
// 导流方下拉选项对应
......@@ -482,10 +482,10 @@ export const attrToVal = [
]
export const sceneType = {
1: "1.1精品升级",
2: "1.2次新车转化",
3: "1.3售后众筹",
0: "2.0会员权益/升级"
1: "精品升级",
2: "次新车转化",
3: "售后众筹",
0: "会员权益/升级"
}
export const proportionType = {
......
......@@ -170,6 +170,10 @@ export default {
if (targetItem.name == 'sceneType') {
this.$emit('handleChangeSelect', value)
}
// 选择分类与所属系列联动
if (targetItem.name == 'goodsType') {
this.$emit('handleChangeSelect', value)
}
},
handleInputDown(e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
......
......@@ -317,21 +317,22 @@ export default {
// item[this.tableParams.mutiSelectUniqueKey]
// }))
//
if (this.filterListData) {
res[this.tableParams.listName] && res[this.tableParams.listName].forEach((val, index) => {
const shopPriceArr = []
let stockTotal = 0
val.ownSerialNum = index
res[this.tableParams.listName] && res[this.tableParams.listName].forEach((val, index) => {
if (!val.goodsInfo) val.goodsInfo = {}
const shopPriceArr = []
val.ownSerialNum = index
if (this.filterListData) {
val.upgradeGoodsList && val.upgradeGoodsList.forEach(v => {
v.goodsInfo = {}
shopPriceArr.push(v.upgradePrice)
v.listShowShopPrice = v.upgradePrice
v.listShowStock = v.stock
v.listShowSpecificationData = val.goodsSpecificationNameList?.length > 1 ? v.specificationData.replace(/;~;/g, ' ') : '-'
v.listShowSpecificationData = val.goodsSpecificationNameList?.length > 1 ? (v.specificationData && v.specificationData?.replace(/;~;/g, ' ')) : '-'
v.goodsInfo.goodsName = v.upgradeGoodsName
v.goodsInfo.productName = val.goodsInfo.goodsName
stockTotal += v.stock
v.goodsInfo.goodsTypeName = val.goodsInfo?.goodsTypeName
v.goodsInfo.type = v.type || '-'
v.goodsInfo.thumbUrl = val.goodsInfo.thumbUrl
v.goodsSpecificationNameList = val.goodsSpecificationNameList
v.upgradeGoodsMerchantRefList = val.upgradeGoodsMerchantRefList
v.createdDate = val.createdDate
v.updatedDate = val.updatedDate
})
const minPrice = shopPriceArr.length ? Math.min(...shopPriceArr) : 0
......@@ -339,9 +340,9 @@ export default {
// 父商品规格数量
val.listShowSpecificationData = val.goodsSpecificationNameList?.length > 1 && val.upgradeGoodsList?.length > 0 ? 'X' + val.upgradeGoodsList.length : '-'
val.listShowShopPrice = minPrice == maxPrice ? maxPrice : minPrice + '~' + maxPrice
val.listShowStock = stockTotal
})
}
val.goodsInfo.type = '-'
}
})
this.data = res[this.tableParams.listName]
if (this.tableParams.needUnique) {
let temp = 1
......
......@@ -23,18 +23,16 @@ export default {
upgradeGoodsList: [],
distributionType: '0',
goodsSpecificationNameList: [],
linkMerchants: [],
speciLinkMerchants: [],
status: '',
goodsSpecificationList: [],
goodsPositionList: [],
applicableModelNames: '',
positionNames: '',
copyGoodsCode: '',
shoppingMallFlag: '0',
goodsSpecificationSingleList: [],
specificationSingleDetailList: [],
selectedSceneCode: ''
selectedSceneCode: '',
goodsType: ''
}
},
mutations: {
......
<!-- 表单 -->
<template>
<div class="grounding-detail" v-if="show">
<el-form :model="formData"
:rules="rules"
:ref="formRef + 'd2FormRuleForm'"
v-loading="$store.state.d2admin.loading.value">
<slot name="title" />
<div v-for="(i, idx) in formList"
:key="idx"
class="grounding-form-block d2-container-content">
<p v-show="i.title"
class="edit-sub-title">
{{ i.title }}
</p>
<div class="flex_item">
<div v-for="(item, index) in i.formBlock" :key="index" :class="item.type === 'incidBox' ? 'item message-box' : 'item'">
<!-- 商品附带信息 -->
<div v-if="formData['upgradeGoodsName'] && item.type === 'incidBox'">
<el-form-item :prop="item.name"
:label="item.label ? item.label + ':' : ''"
:id="item.name"
:label-width="item.label ? '160px' : '0px'"
class="dis-in-block"
style="margin-bottom: 0">
<div class="incid_box">
<div class="item" v-for="(subItem, subIndex) in item.detailInfo" :key="subIndex">
<div class="label">{{ subItem.label }}:</div>
<div class="value">{{ formData[subItem.value] }}</div>
</div>
<!-- 商品分类 1太阳膜 -->
<div class="item" v-if="formData[item.key] == '1'">
<div class="label">部位:</div>
<div class="value">{{ formData['positionNames'] }}</div>
</div>
<!-- 商品分类 权益升级 (线上47) -->
<div class="item" v-if="equitySceneType.includes(formData[item.key]) || formData['sceneType'] == 0">
<div class="label">服务项目:</div>
<div class="value">{{ serviceItems }}</div>
</div>
</div>
</el-form-item>
</div>
<!-- 审核信息 -->
<div v-else-if="item.type === 'checkView'">
<el-timeline v-show="formData[item.name]">
<el-timeline-item v-for="(reviewInfo,infoId) in formData[item.name]"
color="#0bbd87"
:key="infoId"
:timestamp="reviewInfo.updatedDateStr">
{{ reviewInfo.reviewMessage }}
</el-timeline-item>
</el-timeline>
</div>
<div v-else>
<el-form-item :prop="item.name"
:label="item.label ? item.label + ':' : ''"
:id="item.name"
:label-width="item.label ? '160px' : '0px'"
class="dis-in-block"
style="margin-bottom: 0">
<div>{{ formData[item.name] }}</div>
</el-form-item>
</div>
</div>
</div>
</div>
<el-form-item style="margin-top: 40px;text-align: center;">
<el-button type="primary"
@click="handleUp"
class="width_100"
v-if="examineFlag && formData.status == 4"
:disabled="$store.state.d2admin.loading.value">
审核
</el-button>
<el-button class="width_100 cancel-btn"
type="primary"
plain
@click="handleClose">
返回
</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { deepClone } from '@/common/util'
import { mapActions } from 'vuex'
import { baseConfig } from "@/main"
export default {
name: 'groundingForm',
data() {
return {
equitySceneType: baseConfig.equitySceneType || [],
userInfo: this.$store.state.d2admin.user.info,
formData: {},
selectedValue: '',
show: false,
examineFlag: false,
serviceItems: ''
}
},
props: {
formRef: {
type: String,
default: ''
},
rules: {
type: Object,
default: () => { }
},
originData: {
type: Object,
default: () => {
return {}
}
},
formList: {
type: Array,
default: () => { }
},
productServiceItemList: {
type: Array,
default: () => { }
}
},
watch: {
originData: {
handler(newVal) {
if (newVal) {
this.formData = deepClone(this.originData)
}
},
deep: true
},
formData: {
handler(newVal) {
if (newVal) {
this.filterEditForm()
}
},
deep: true
}
},
mounted() {
this.formData = deepClone(this.originData)
this.copyFormList = deepClone(this.formList)
this.$nextTick(() => {
const $store = this.$store.getters['d2admin/auth/curBtns']
const btnId = '9031101' // 审核权限ID
const _item = $store?.find(i => (i.authId === btnId))
if (_item) {
this.examineFlag = true
}
})
// 默认显示所有服务项目 (暂时不可配置 显示全部)
this.serviceItems = this.productServiceItemList?.map(v => { return v.serviceName })?.join(',') || ''
this.filterEditForm()
},
methods: {
...mapActions({
get: 'd2admin/base/get'
}),
// 出来form表单显示内容
filterEditForm() {
let { copyFormList, formData } = this
// 1 太阳膜 2 (1.3场景商品)
let shopType = formData?.goodsType == 1 ? '1' : formData?.sceneType == 3 ? '2' : ''
let shopForm = deepClone(copyFormList[1].formBlock)
let spliceForm = shopType == '1' ? ['giftCost', 'recoveryCost', 'virtualAccountCost'] : shopType == '2' ? ['productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost'] : ['productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'upgradeSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost']
// 未勾选基础商品类型
if (!this.formData.productType?.includes(1)) spliceForm.push('baseSupplyModeStr')
// 赠送成本:仅产品类型选择“基础产品”时展示
if (formData.productType?.includes(1)) spliceForm.indexOf('giftCost') > -1 && spliceForm.splice(spliceForm.indexOf('giftCost'), 1)
// 回收成本:仅产品类型选择“升级产品”且升级/产品供货模式选择“门店回收原厂+嘀加”时展示
if (formData.productType?.includes(2) && formData.upgradeSupplyMode == 4) {
spliceForm.indexOf('recoveryCost') > -1 && spliceForm.splice(spliceForm.indexOf('recoveryCost'), 1)
}
// 虚拟对账成本:仅产品类型选择“升级产品”且升级/产品供货模式选择“门店套码+嘀加”“ 服务商自采+嘀加”时展示
if ((formData.productType?.includes(2) && formData.upgradeSupplyMode == 3) || (formData.productType?.includes(2) && formData.upgradeSupplyMode == 5)) {
spliceForm.indexOf('virtualAccountCost') > -1 && spliceForm.splice(spliceForm.indexOf('virtualAccountCost'), 1)
}
// 仅选中基础产品类型 不展示 售价字段
if (formData.productType?.length == 1 && formData.productType?.includes(1)) spliceForm.push('sellPrice', 'minSellPrice', 'upgradeProductCost', 'upgradeSupplyModeStr')
let newForm = shopForm.filter(v => !spliceForm?.includes(v.name))
this.$set(this.formList[1], 'formBlock', newForm)
this.$nextTick(() => {
this.show = true
})
},
// 选择框-添加其他属性
selectAddAttr(value, targetItem) {
if (targetItem.name === 'goodsCode') {
var tempVal = targetItem.optionList.find(item => item.goodsCode === value)
this.formData.goodsTypeName = tempVal.goodsTypeName
this.formData.thumbUrl = tempVal.thumbUrl
this.formData.sapCode = tempVal.sapCode
}
this.selectedValue = value
},
handleClose() {
this.$emit('handleClose')
},
jumpScroll(idName) {
document.getElementById(idName).scrollIntoView()
},
filterEmpty(data) {
return (data ?? '') === ''
},
handleUp(e) {
this.$refs[this.formRef + 'd2FormRuleForm'].validate((valid, options) => {
if (valid) {
let arr = []
this.formData.goodsPositionList = arr
this.$emit('handleAddConfirm', { ...this.formData, num: e })
} else {
var needRuleList = Object.keys(options)
this.jumpScroll(needRuleList[0])
return true
}
})
}
}
}
</script>
<style lang="scss" scoped>
.grounding-detail{
.grounding-form-block {
padding: 20px 0px;
.flex_item{
display: flex;
flex-flow: wrap;
.item {
flex: 0 0 33%;
}
.message-box{
flex: 0 0 100%;
font-size: 14px;
.incid_box{
margin: 10px 0;
background: #F9F9F9;
border-radius: 8px;
display: flex;
flex-wrap: wrap;
padding: 15px;
.item{
flex: 0 0 33%;
display: flex;
.label{
flex-shrink: 0;
color: #666666;
width: 100px;
text-align: right;
}
}
}
}
}
}
.width_100{
display: inline-block;
width: 100px;
}
}
</style>
export const productList = [{
confId: 1,
confName: '基础产品'
}, {
confId: 2,
confName: '升级产品'
}]
export const baseSupplyModeList = [{
confId: 1,
confName: '嘀加'
}, {
confId: 2,
confName: '门店'
}]
// 太阳膜升级产品供货模式
export const upgradeSupplyModeList = [{
confId: 1,
confName: '嘀加'
}, {
confId: 3,
confName: '门店套码+嘀加'
}, {
confId: 4,
confName: '门店回收原厂+嘀加'
}, {
confId: 5,
confName: '服务商自采+嘀加'
}]
// 1.3场景 升级产品供货模式
export const crowdUpgradeSupplyModeList = [{
confId: 1,
confName: '嘀加'
}, {
confId: 2,
confName: '门店'
}]
<!-- 查看上架 -->
<template>
<d2-container class="edit-commodity">
<div class="" v-if="show">
<detail
ref="d2GroundingDetail"
:rules="rules"
form-name="grounding"
:origin-data="editData"
:form-list="editForm"
:productServiceItemList="productServiceItemList"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose"></detail>
</div>
</d2-container>
</template>
<script>
import { getMerchantGoodsInfo, batchReviewAPI } from '@api/grounding'
import detail from './components/detail.vue'
import { sceneList } from '@/common/constants.js'
import { mapActions } from 'vuex'
import { deepClone, Util } from '@/common/util'
import { BaseData, positionTypeList } from '@/common/constants'
import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList} from './constants/data'
export default {
name: 'groundingDetail',
components: {
detail
},
data() {
return {
rules: {
merchantName: [{ required: true }],
sceneName: [{ required: true }],
goodsName: [{ required: true }],
productTypeStr: [{ required: true }],
baseSupplyModeStr: [{ required: true }],
upgradeSupplyModeStr: [{ required: true }],
sellPrice: [{ required: true }],
minSellPrice: [{ required: true }],
upgradeProductCost: [{ required: true }],
giftCost: [{ required: true }],
recoveryCost: [{ required: true }],
virtualAccountCost: [{ required: true }],
warrantyTypeStr: {required: true}
},
editForm: [{
title: '门店信息',
formBlock: [{
name: 'merchantName',
label: '上架门店'
}, {
name: 'sceneName',
label: '业务场景'
}]
}, {
title: '商品信息',
formBlock: [{
name: 'goodsName',
label: '上架商品',
type: 'incidBox',
key: 'goodsType',
detailInfo: [{
label: '商品名称',
value: 'upgradeGoodsName'
}, {
label: '商品编码',
value: 'type'
}, {
label: '参考售价/元',
value: 'upgradePrice'
}, {
label: '所属素材',
value: 'goodsName'
}, {
label: '所属分类',
value: 'goodsTypeName'
}]
}, {
name: 'goodsAlias',
label: '商品别名'
}, {
name: 'warrantyTypeStr',
label: '质保卡类型'
}, {
name: 'productTypeStr',
label: '产品类型'
}, {
name: 'baseSupplyModeStr',
label: '基础产品供货模式'
}, {
name: 'upgradeSupplyModeStr',
label: '升级/产品供货模式'
}, {
name: 'sellPrice',
label: '售价/元'
}, {
name: 'minSellPrice',
label: '最低售价/元'
}, {
name: 'upgradeProductCost',
label: '产品、升级成本/元'
}, {
name: 'giftCost',
label: '赠送成本/元'
}, {
name: 'recoveryCost',
label: '回收成本/元'
}, {
name: 'virtualAccountCost',
label: '虚拟对账成本/元'
}]
}, {
title: '操作信息',
formBlock: [{
type: 'checkView',
name: 'reviewLogList'
}]
}],
show: false,
editData: {},
examineFlag: false,
warrantyTypeShow: {
0: '质保卡',
1: '质保权益卡'
},
detailId: '',
productServiceItemList: []
}
},
mounted() {
// 获取商品详情
let id = this.$route.params.id
this.detailId = id
this.getProductServiceItemList()
if (!id) return
this.getDetailInfo(id)
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
async getProductServiceItemList() {
this.productServiceItemList = await this.get(BaseData.productServiceItemList)
},
getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(res => {
let productType = []
if (res?.upgradeProductFlag == 'Y') productType.push(2)
if (res?.baseProductFlag == 'Y') productType.push(1)
let productTypeTextArr = []
// 太阳膜回显 部位
let positionNamesArr = res?.goodsType == 1 ? deepClone(positionTypeList).filter(val => res.upgradeGoods.position == val.position) : []
// 产品类型
productList.forEach(v => {
if (productType.includes(v.confId)) productTypeTextArr.push(v.confName)
})
res.reviewLogList?.forEach(val => {
val.updatedDateStr = val.updatedDate ? Util.dateFormate(val.updatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
})
let arr = []
if (res.sceneType == 3) { // 1.3场景 升级产品供货模式
arr = crowdUpgradeSupplyModeList
}
if (res.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高)
arr = upgradeSupplyModeList
}
res.productTypeStr = productTypeTextArr?.length ? productTypeTextArr.join(';') : '-'
res.warrantyTypeStr = this.warrantyTypeShow[res?.warrantyType] || '-'
res.baseSupplyModeStr = baseSupplyModeList?.filter(v => v.confId == res.baseSupplyMode)[0]?.confName || ''
res.upgradeSupplyModeStr = arr?.filter(v => v.confId == res.upgradeSupplyMode)[0]?.confName || ''
res.sceneName = sceneList[res.sceneType] || '-'
res.upgradePrice = res.upgradeGoods?.upgradePrice || '-'
res.positionNames = positionNamesArr.length ? positionNamesArr[0]?.confName : ''
res.productType = productType
this.editData = res || {}
this.$nextTick(() => {
this.show = true
})
})
},
handleAddConfirm() {
this.$confirm('<p>审核通过后,商品完成上架,对应的门店可使用该商品</p>是否确定审核?', '提示', {
confirmButtonText: '确定',
dangerouslyUseHTMLString: true,
type: 'warning'
}).then(() => {
batchReviewAPI({ ids: [this.detailId] }).then(res => {
this.notice.okTips()
this.handleClose(true)
})
}).catch(err => {
console.log(err)
})
},
handleClose(isRefresh = false) {
if (isRefresh) {
this.close({ tagName: '/grounding' })
this.$router.push({ name: 'grounding' })
this.close({ tagName: '/grounding' })
} else {
this.$confirm('内容未保存,是否返回?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
this.close({ tagName: '/grounding' })
this.$router.push({ name: 'grounding' })
this.close({ tagName: '/grounding' })
})
}
},
handleAddClose() {
this.handleClose(true)
}
}
}
</script>
<style lang="scss" scoped></style>
\ No newline at end of file
<!-- 查看详情 -->
<template>
<el-drawer size="60%"
class="drawerContainer"
:with-header="false"
:visible.sync="drawerDetailVisible"
:before-close="handleDrawerClose">
<div class="d2-drawer-content car-txt"
style="background: #F2F4F7;">
<div class="d2-drawer-block title-block">
<p class="parentGoods">
产品详情
</p>
<p class="close-icon"
@click="handleDrawerClose">
×
</p>
</div>
<el-form class="child-drawer-block"
label-width="110px"
:inline="true"
v-for="(item,index) in commodityInfo.upgradeGoodsList"
:key="index">
<p class="car-sub-head">
商品{{ index + 1 }}-{{ item.upgradeGoodsName }}
</p>
<el-form-item class="d2-drawer-item"
label="编码:">
<span>{{ item.type }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="品牌方:">
<span>{{ commodityInfo.goodsInfo.brandMerchantName || '--' }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="类目:">
<span>{{ commodityInfo.goodsInfo.goodsTypeName }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="参考售价/元:">
<span>{{ !filterEmpty(item.upgradePrice) ? item.upgradePrice : '无' }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="采购价/元:">
<span>{{ !filterEmpty(item.purchasePrice) ? item.purchasePrice : '无' }}</span>
</el-form-item>
<el-form-item
class="d2-drawer-item"
label="质保年限:">
<span>{{ !filterEmpty(item.warrantyPeriod) ? (item.warrantyPeriod + '年') : '无' }}</span>
</el-form-item>
</el-form>
</div>
</el-drawer>
</template>
<script>
import { getGoodsInfoById } from '@/api/commodity'
export default {
name: 'DrawerDetail',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
commodityInfo: {}
}
},
props: {
drawerDetailVisible: {
type: Boolean,
default: false
},
commodityInfoId: {
type: [String, Number],
default: () => { }
}
},
mounted() {
this.getInfo(this.commodityInfoId)
},
methods: {
handleDrawerClose() {
this.$emit('handleDrawerClose')
},
getInfo(id) {
getGoodsInfoById({ id: id }).then(res => {
this.commodityInfo = res
})
},
filterEmpty(data) {
return data instanceof Array ? data.length <= 0 : (data ?? '') === ''
}
}
}
</script>
<style lang="scss" scoped>
::v-deep.drawerContainer {
.el-drawer__body {
overflow: scroll;
}
.d2-drawer-content .close-icon {
font-size: 24px;
height: 22px;
line-height: 22px;
cursor: pointer;
}
.d2-drawer-content .d2-drawer-block {
border-bottom: 1px solid #e7eaec;
padding: 0 20px 20px;
margin-bottom: 20px;
background: #ffffff;
}
.d2-drawer-content .d2-drawer-block.title-block {
position: relative;
display: flex;
justify-content: space-between;
padding: 20px 20px;
background: #ffffff;
}
.d2-drawer-block .d2-drawer-item {
width: 47%;
margin-bottom: 0;
}
.d2-drawer-block .d2-drawer-row {
width: 100%;
margin-bottom: 0;
}
.parentGoods {
font-family: PingFangSC-Medium;
font-size: 18px;
color: #333333;
line-height: 28px;
font-weight: 600;
}
.parent-type {
font-family: PingFangSC-Regular;
font-size: 16px;
color: #666666;
line-height: 24px;
font-weight: 400;
padding-left: 15px;
}
.car-txt .examineP {
font-family: PingFangSC-Regular;
font-size: 16px;
margin-left: auto;
margin-right: 40px;
padding: 3px;
}
.d2-drawer-content .child-drawer-block {
border-bottom: 1px solid #e7eaec;
padding: 20px 20px 20px;
margin-bottom: 20px;
background: #ffffff;
margin: 10px 8px 0 10px;
}
.child-drawer-block .d2-drawer-item {
font-family: PingFangSC-Regular;
font-size: 14px;
color: #333333;
font-weight: 400;
width: 30%;
margin: 0 0 0 0;
}
/* .child-drawer-block .d2-drawer-row {
width: 100%;
margin-bottom: 0;
} */
.child-drawer-block .car-sub-head {
font-family: PingFangSC-Medium;
font-size: 16px;
color: #333333;
line-height: 24px;
font-weight: 600;
}
.timeline-item_wrapper {
.el-form-item__content {
width: calc(100% - 110px);
}
.el-timeline-item__wrapper {
display: flex;
align-items: center;
justify-content: space-between;
// margin-top: 5px;
}
.el-timeline-item__timestamp.is-bottom {
margin-top: 0;
}
}
.timeline-item_wrapper .el-timeline-item__tail {
position: absolute;
left: 4px;
height: 100%;
top: 8px;
border-left: 2px solid #e4e7ed;
}
.timeline-item_wrapper .el-timeline-item__node--normal {
left: -1px;
top: 8px;
width: 12px;
height: 12px;
}
}
</style>
<template>
<div class="sourceMaterial-form" id="sourceMaterial-form">
<div class="title">产品系列-SPU</div>
<productForm v-if="show"
ref="d2GoodsProductForm"
:rules="rules"
:add-or-edit="addOrEdit"
form-name="product"
:origin-data="editData"
:form-list="editForm"
:form-ref="proFormRef"
:isProduct="false"
@handleAddBrandSupplyConfirm="handleAddBrandSupplyConfirm"
@handleEditBrandSupplyConfirm="handleEditBrandSupplyConfirm">
</productForm>
</div>
</template>
<script>
import { deepClone } from '@/common/util'
import { mapActions } from 'vuex'
import { getBrandSupplyMerchant, addBrandSupplyMerchant, editBrandSupplyMerchant, getProductTypeBySceneId } from '@/api/product'
import productForm from './productForm.vue'
export default {
name: 'sourceMaterial',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
show: false,
rules: {
goodsName: [{ required: true, message: '请输入产品名称', trigger: 'change' }],
goodsType: [{ required: true, message: '请选择类目', trigger: 'change' }],
supplierCode: [{ required: true, message: '请选择供应方', trigger: 'change'}],
sapCode: [{
validator: (rule, value, cb) => {
if (value && (!/^[0-9A-Za-z]+$/.test(value))) {
return cb(new Error('只能输入数字或字母'))
} else {
cb()
}
},
trigger: 'change'
}],
thumbUrl: [{ required: true, message: '请选择缩略图', trigger: 'blur' }],
positionIds: [{ required: true, message: '请选择部位', trigger: 'change' }],
convertedValue: [{ required: true, message: '请输入比例换算', trigger: 'change'}]
},
editData: {
goodsName: '',
goodsType: '',
goodsTypeName: '',
sapCode: '',
brandMerchantCode: '',
brandMerchantName: '',
supplierCode: '',
supplierName: '',
thumbUrl: '',
goodsImgList: [],
goodsDescList: [],
videoUrl: '',
convertedValue: '',
positionIds: [],
carTypeList: [1, 2, 3, 4],
goodsPositionList: [],
goodsSource: 0
},
proFormRef: 'pro',
editForm: [{
formBlock: [
{
name: 'goodsName',
label: '产品名称',
type: 'input',
maxlength: 20,
width: '432px'
},
{
name: 'goodsType',
label: '类目',
isRequired: true,
type: 'select',
isClear: false,
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
width: '432px'
}, {
name: 'sapCode',
label: '编号',
type: 'input',
maxlength: 32,
width: '432px'
}, {
name: 'brandMerchantCode',
label: '品牌方',
isRequired: true,
type: 'special-select',
isClear: true,
optionList: [],
optionId: 'id',
optionLabel: 'relatedPartyName',
partitionFlag: 1,
width: '432px'
}, {
name: 'supplierCode',
label: '供应方',
isRequired: true,
type: 'select',
isClear: true,
optionList: [],
optionId: 'id',
optionLabel: 'relatedPartyName',
partitionFlag: 2,
width: '432px'
}, {
name: 'thumbUrl',
label: '缩略图',
type: 'photo',
tips: ['注:用于小程序主页商品列表配图展示', '请上传2M以内的jpg、jpeg、png图片,建议图片尺寸256*216'],
maxPhotoNum: 1
}, {
name: 'goodsImgList',
label: '产品主图',
type: 'photo',
tips: ['注:用于在小程序商品详情页的顶部展示', '请上传2M以内的jpg、jpeg、png图片,建议图片尺寸256*216'],
maxPhotoNum: 10
}, {
name: 'videoUrl',
label: '产品视频',
type: 'video',
tips: ['注:作为商品详情页顶部展示,格式建议mp4,大小不超过20M'],
maxPhotoNum: 1
}, {
name: 'goodsDescList',
label: '详情描述',
type: 'descList',
maxlength: 256
}]
}],
baseData: {
productType: []
}
}
},
components: {
productForm: productForm
},
props: {
addOrEdit: String,
formData: Object
},
mounted() {
if (this.addOrEdit === 'edit') {
this.show = false
this.editData = deepClone(this.formData)
this.editData.brandMerchantCode = Number(deepClone(this.formData).brandMerchantCode) || ''
this.editData.supplierCode = Number(deepClone(this.formData).supplierCode) || ''
if (!this.editData.goodsDescList) this.editData.goodsDescList = []
// 太阳膜默认适用全部车型 部位回显
if (this.editData.goodsType == 1) {
this.editData.carTypeList = deepClone(this.formData).carTypeList ? deepClone(this.formData).carTypeList : [1, 2, 3, 4]
this.editData.positionIds = deepClone(this.formData)?.goodsPositionList?.map(item => { return item.position })
}
this.editData.goodsImgList = this.editData.goodsImgList || []
this.editData.goodsImgList.forEach(i => {
delete i.createdDate
delete i.updatedDate
})
this.editData.goodsDescList.forEach(i => {
delete i.createdDate
delete i.updatedDate
})
this.$nextTick(() => {
this.show = true
})
} else {
this.show = true
}
// 获取品牌方/供应方数据 1品牌商 2供应方
this.getBrandSupplyList(1)
this.getBrandSupplyList(2)
// 获取类目
this.getGoodTypeList()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
getGoodTypeList() {
getProductTypeBySceneId({}).then(res => {
this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == 'goodsType')].optionList = res
})
},
// 获取品牌/供应方
getBrandSupplyList(num) {
getBrandSupplyMerchant({
partitionFlag: num
}).then(res => {
if (num == 1) {
this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == 'brandMerchantCode')].optionList = res
} else {
this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == 'supplierCode')].optionList = res
}
})
},
// 新增品牌商/供应商
handleAddBrandSupplyConfirm(data) {
addBrandSupplyMerchant(data).then(res => {
this.getBrandSupplyList(data.partitionFlag)
})
},
// 编辑删除 品牌商/供应商
handleEditBrandSupplyConfirm(data) {
editBrandSupplyMerchant(data).then(res => {
this.getBrandSupplyList(data.partitionFlag)
})
}
}
}
</script>
<style lang="scss" scoped>
.sourceMaterial-form{
background: #ffffff;
.title{
height: 50px;
line-height: 50px;
padding: 0 20px;
border-bottom: 1px solid #E5E5E5;
font-size: 16px;
font-weight: 600;
color: #333333;
}
}
</style>
\ No newline at end of file
<template>
<div class="specifications-form" ref="specifications-form">
<p class="title">产品信息-SKU</p>
<div class="content-box">
<div class="sync_type_class">
<span class="label"><span class="color-red">*</span>使用模式:</span>
<el-radio-group v-model="goodsInfoData.shoppingMallFlag">
<el-radio :label="'1'">采购上架及分发至单店</el-radio>
<el-radio :label="'0'">仅分发至单店</el-radio>
</el-radio-group>
</div>
<div style="margin-left: 120px;">
<div class="add-btns">
<el-button icon="el-icon-plus" v-if="goodsInfoData.specificationType == '2'" @click="handleSpecsEdit(1)">新增规格</el-button>
<el-button icon="el-icon-plus" v-if="goodsInfoData.specificationType == '1'" @click="addShop">新增商品</el-button>
<div class="assi_type">
<span>规格:</span>
<el-radio-group v-model="goodsInfoData.specificationType">
<el-radio :label="'1'">单规格</el-radio>
<el-radio :label="'2'">多规格</el-radio>
</el-radio-group>
</div>
</div>
<div class="speci-box" id="specificationDetailList">
<singleSpecificationForm ref="singleSpecificationFormRef" v-show="goodsInfoData.specificationType == '1'" :productServiceItemList="productServiceItemList"></singleSpecificationForm>
<multipleSpecificationForm ref="multipleSpecificationFormRef" v-show="goodsInfoData.specificationType == '2'" :productServiceItemList="productServiceItemList"></multipleSpecificationForm>
</div>
</div>
</div>
</div>
</template>
<script>
import multipleSpecificationForm from './multipleSpecificationForm.vue'
import singleSpecificationForm from './singleSpecificationForm.vue'
import { mapGetters, mapMutations, mapActions } from 'vuex'
import { BaseData } from '@/common/constants.js'
export default {
name: 'specifications',
components: {
singleSpecificationForm,
multipleSpecificationForm
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
productPositionTypeList: [],
productServiceItemList: []
}
},
computed: {
...mapGetters('goodsInfoData', {goodsInfoData: 'getGoodsInfoData'})
},
mounted() {
if (this.goodsInfoData.goodsSpecificationNameList?.length > 1) {
// 多规格
this.goodsInfoData.specificationType = '2'
}
this.getProductServiceItemList()
},
methods: {
...mapActions({
get: 'd2admin/base/get'
}),
async getProductServiceItemList() {
this.productServiceItemList = await this.get(BaseData.productServiceItemList)
},
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
// 新增规格
handleSpecsEdit(num) {
this.$refs['multipleSpecificationFormRef'].handleSpecsEdit(num)
},
// 新增商品
addShop() {
this.$refs['singleSpecificationFormRef'].addShop()
}
}
}
</script>
<style lang="scss" scoped>
.specifications-form{
margin-top: 20px;
background: #ffffff;
.title{
height: 50px;
line-height: 50px;
padding: 0 20px;
border-bottom: 1px solid #E5E5E5;
font-size: 16px;
font-weight: 600;
color: #333333;
}
.content-box{
padding: 20px 20px 40px 20px;
}
.add-btns{
display: flex;
justify-content: space-between;
font-size: 14px;
.el-button{
width: 140px;
}
}
.speci-box {
width: 100%;
.title-tip {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 15px;
height: 40px;
font-weight: bold;
background: #F2F4F7;
}
}
.sync_type_class{
font-size: 14px;
padding: 20px 0;
.label{
display: inline-block;
text-align: right;
width: 120px;
.color-red{
color: #eb4e4e;
font-size: 14px;
margin-right: 4px;
cursor: pointer;
}
}
}
}
</style>
\ No newline at end of file
<!-- 商品管理 -->
<template>
<d2-container class="product-manage">
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'100px'"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<auth-button category="Button" style="{display: inline-block}" :show-btn-ids="['9030701']" />
</span>
<auth-button category="Button" style="{display: inline-block}" :show-btn-ids="['9030702']" />
</d2-table-header>
<d2-table ref="productManageTable"
:has-num="false"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
:filter-list-data="true">
<div class="material" slot="img" slot-scope="scope">
<img class="pro-img" :src="scope.scope.goodsInfo.thumbUrl">
<span class="good_name">{{ scope.scope.baseGoodsName || scope.scope.goodsInfo.goodsName }}</span>
</div>
<div v-if="Object.keys(scope.scope).includes('upgradeGoodsList')"
slot="auth-button"
slot-scope="scope">
<el-button type="text"
size="mini"
style="margin-right: 10px;"
@click="handleCommodityDetail(scope.scope)">
查看
</el-button>
<!-- <auth-button :data="scope.scope"></auth-button> -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9030703']" />
</span>
<auth-button :data="scope.scope"
:show-btn-ids="['9030706']" />
</div>
</d2-table>
</div>
<!-- 查看面板 -->
<drawer-detail v-if="drawerDetailVisible"
:drawer-detail-visible="drawerDetailVisible"
:commodity-info-id="commodityDetailInfoId"
@handleDrawerClose="handleDrawerClose" />
</d2-container>
</template>
<script>
import { Util } from '@/common/util'
import { getProductManageList } from '@api/productManage'
import { getProductTypeBySceneId } from '@api/product'
import { mapActions, mapState } from 'vuex'
import { baseGoodsDelete } from '@api/commodity'
import drawerDetail from './components/drawerDetail.vue'
export default {
name: 'Commodity',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
searchForm: {
commodityCode: '',
baseGoodsName: '',
goodsType: '',
baseGoodsStatus: '',
type: ''
},
showFormData: [{
label: 'ID',
name: 'commodityCode',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '商品名称',
name: 'baseGoodsName',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '商品编码',
name: 'type',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '类目',
name: 'goodsType',
type: 'select',
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
optionsName: 'productTypeList'
}, {
label: '商品状态',
name: 'baseGoodsStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'statusList'
},
],
getListApi: getProductManageList,
// 表格参数
tableParams: {
needUnique: true,
mutiSelectUniqueKey: 'uniqueVal',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: {
width: '170'
},
tableColumns: [{
label: '序号',
prop: 'ownSerialNum',
type: 'ownSerialNum',
width: '100'
}, {
label: 'ID',
prop: 'commodityCode',
formatter: (cellValue) => {
return cellValue.commodityCode
},
width: 200
}, {
label: '商品名称',
parentProp: 'goodsInfo',
prop: 'baseGoodsName',
width: '200',
addHtml: 'img'
}, {
label: '商品编码',
parentProp: 'goodsInfo',
prop: 'type',
}, {
label: '类目',
parentProp: 'goodsInfo',
prop: 'goodsTypeName'
}, {
label: '规格',
prop: 'listShowSpecificationData',
width: '160'
}, {
label: '参考售价',
prop: 'listShowShopPrice',
width: '120'
}, {
label: '商品状态',
prop: 'status',
width: '100px',
className: (cellValue) => {
return {
0: 'ashSpot',
1: 'greenSpot',
2: 'yellowSpot',
3: 'ashSpot'
}[cellValue.status]
},
formatter: (cellValue) => {
return {
0: '待上架',
1: '上架',
2: '部分上架',
3: '草稿'
}[cellValue.status]
}
}, {
label: '创建日期',
prop: 'createdDate',
formatter: (cellValue) => {
return cellValue.createdDate ? Util.dateFormate(cellValue.createdDate, 'YYYY-MM-DD HH:mm:ss') : ''
},
width: 160
}, {
label: '更新日期',
prop: 'updatedDate',
formatter: (cellValue) => {
return cellValue.updatedDate ? Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
},
width: 160
}
]
},
// 商品详情
drawerDetailVisible: false,
// 基本数据
baseData: {
productTypeList: [],
statusList: [{
confId: 0,
confValue: '待上架'
}, {
confId: 1,
confValue: '上架'
}, {
confId: 2,
confValue: '部分上架'
}, {
confId: 3,
confValue: '草稿'
}]
}
}
},
components: {
drawerDetail
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
var allOpt = { confId: '', confValue: '全部' }
this.baseData.statusList.unshift(allOpt)
// 获取全部类目
getProductTypeBySceneId({ sceneType: '' }).then(res => {
this.baseData.productTypeList = res
this.getBaseData()
})
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
this.baseData.productTypeList.unshift({
categoryType: '',
categoryName: '全部'
})
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
keyDowmGetList() {
this.$refs.commodityTable.refreshTable()
},
handleReset() {
this.searchForm = {
commodityCode: '',
baseGoodsName: '',
goodsType: '',
baseGoodsStatus: '',
type: ''
}
},
handleAdd(form) {
this.close({ tagName: '/editProductManage' })
this.$router.push({
name: 'editProductManage',
params: {
addOrEdit: 'add',
form: form
}
})
},
handleExport() {
var params = this.searchForm
params.method = 'dj.api.smartcarlife.productManager.export.async'
const list = [
...this.dowloadList,
{
name: '基础商品列表',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
handleEdit(row) {
this.close({ tagName: '/editProductManage' })
this.$router.push({
name: 'editProductManage',
params: {
addOrEdit: 'edit',
id: row.id
}
})
},
handleDelete(row) {
var html = '需下架商品才可以删除!'
row.status == 1 || row.status == 2
? this.$confirm(html, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
})
: this.$confirm('删除后不可恢复,是否删除?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
baseGoodsDelete({ baseGoodsId: row.id }).then(res => {
this.notice.okTips()
this.$refs.productManageTable.refreshTable()
})
}).catch(err => {
console.log(err)
})
},
handleCommodityDetail(row) {
this.drawerDetailVisible = true
this.commodityDetailInfoId = row.id
},
handleDrawerClose() {
this.drawerDetailVisible = false
}
}
}
</script>
<style scoped>
.material {
padding: 0 20px;
display: flex;
justify-content: left;
align-items: center;
}
.good_name {
margin-left: 20px;
}
</style>
<style>
.product-manage {
position: relative;
}
.product-manage .pro-img {
width: 36px;
height: 36px;
}
.product-manage .custom-input {
display: inline-block;
width: 220px;
}
.product-manage p {
margin: 0;
}
</style>
......@@ -31,15 +31,15 @@ export default {
activeName: "1",
tabPaneList: [
{
label: "1.1精品升级",
label: "精品升级",
name: "1"
},
{
label: "1.3众筹订单",
label: "售后众筹",
name: "2"
},
{
label: "2.0车损升级",
label: "会员权益/升级",
name: "3"
}
],
......
......@@ -85,18 +85,18 @@ export default {
[
{
confId: 1,
confLabel: '1.1精品升级'
confLabel: '精品升级'
}, {
confId: 2,
confLabel: '1.2次新车转化',
confLabel: '次新车转化',
disabled: true
}, {
confId: 3,
confLabel: '1.3售后众筹'
confLabel: '售后众筹'
},
{
confId: 0,
confLabel: '2.0会员权益/升级',
confLabel: '会员权益/升级',
// disabled: true
}
]
......
......@@ -120,7 +120,7 @@ export default {
numList: [
{
confId: 0,
confLabel: '1.0'
confLabel: '2.0'
}, {
confId: 1,
confLabel: '1.1'
......
......@@ -2,7 +2,7 @@
dj_dev_19.0版本
代码合并操作人:张晓玮,张立顺,陈婉清
代码合并操作人:张晓玮
代码合并检查人:张杰
......@@ -14,36 +14,10 @@ dev_v4.19.0 版本功能需求
#### 涉及应用列表版本应用信息
| gitlab地址 | 分支标识 | 分支创建人 | 分支合并人 | 代码检查人 |
| ------------------------------------------------------------ | ----------------- | ---------- | ---------- | ---------- |
| http://192.168.3.233:8090/glsx-business/dj-car-boutique-work-wechat | dev_v4.19.0 | 张立顺 | 张立顺 | 张杰 |
| http://192.168.3.233:8090/saas_plus/business-assistant | saas+v4.19.0_0418 | 张立顺 | 张立顺 | 张杰 |
| http://192.168.3.233:8090/glsx-business/dj-car-boutique-work-wechat | dev_v4.19.0 | 张立顺 | 张立顺 | 张杰 |
| http://192.168.3.233:8090/saas_plus/dj-car-life-system | dev_v4.19.0 | 张晓玮 | 张晓玮 | 张杰 |
| http://192.168.3.233:8090/saas_plus/dj-car-weapp-smartshop | dev_v4.19.0 | 张立顺 | 张立顺 | 张杰 |
代码合并记录
dj_dev_16.0版本
代码合并操作人:王琦琳,张晓伟
代码合并检查人:张杰
### 需求列表
dev_v4.18.0 版本功能需求
#### 涉及应用列表版本应用信息
| gitlab地址 | 分支标识 | 分支创建人 | 分支合并人 | 代码检查人 |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ---------- | ---------- | ---------- |
| http://192.168.3.233:8090/glsx-business/dj-car-boutique-work-wechat | [dev_v4.18.0](http://qcimg01.glsx.com.cn:7060/group1/M00/04/57/wKgD3mP9oNyAF5L3AAFf6CsJYvg142.png) | 张晓玮 | 张晓玮 | 张杰 |
| http://192.168.3.233:8090/saas_plus/dj-car-life-system | dev_v4.18.0 | 王琦琳 | 王琦琳 | 张杰 |
| http://192.168.3.233:8090/saas_plus/dj-car-boutique-work-wechat | [dev_v4.19.0](http://qcimg01.glsx.com.cn:7060/group1/M00/04/57/wKgD3mP9oNyAF5L3AAFf6CsJYvg142.png) | 张立顺 | 张晓玮 | 张杰 |
| http://192.168.3.233:8090/saas_plus/dj-car-life-system | dev_v4.19.0 | 王琦琳 | 张晓玮 | 张杰 |
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!