Commit 4aff8c77 by zhangxw

月底版本需求开发联调

1 parent 5039460a
...@@ -59,4 +59,17 @@ export function getAllGoodsList(data) { ...@@ -59,4 +59,17 @@ export function getAllGoodsList(data) {
export function batchUpdateStatus(data) { export function batchUpdateStatus(data) {
data.method = `${path}merchantGoodsInfo.updateBatchOffShelf` data.method = `${path}merchantGoodsInfo.updateBatchOffShelf`
return request(data, 'post') return request(data, 'post')
}
// 批量复制
export function batchUpdateBatchCopy(data) {
data.method = `${path}merchantGoodsInfo.updateBatchCopy`
return request(data, 'post')
}
// 校验上架记录中是否已存在
export function checkGroundingLog(data) {
data.method = `${path}merchantGoodsInfo.existsCount`
return request(data, 'post')
} }
\ No newline at end of file \ No newline at end of file
...@@ -315,3 +315,9 @@ export function insertOrUpdateDiversionMerchantRef(data) { ...@@ -315,3 +315,9 @@ export function insertOrUpdateDiversionMerchantRef(data) {
data.method = `${path2}diversionMerchant.insertOrUpdateDiversionMerchantRef` data.method = `${path2}diversionMerchant.insertOrUpdateDiversionMerchantRef`
return request(data, "post") return request(data, "post")
} }
// 获取服务中心所有门店 支持园区店关键字搜索
export function getAccountMerchantList(data) {
data.method = `${path}merchant.page.withYq`
return request(data, "post")
}
...@@ -96,3 +96,9 @@ export function uploadPDF(data) { ...@@ -96,3 +96,9 @@ export function uploadPDF(data) {
data.method = `${path}smartcarlife.common.uploadPdf` data.method = `${path}smartcarlife.common.uploadPdf`
return request(data, RequestMethods.POST, ["file"]) return request(data, RequestMethods.POST, ["file"])
} }
// 获取太阳膜类商品部位属性
export function getPositionList(data) {
data.method = `${path}smartcarlife.goodsPosition.list`
return request(data)
}
\ No newline at end of file \ No newline at end of file
...@@ -12,7 +12,8 @@ export const TYPE_NAME = "confType" ...@@ -12,7 +12,8 @@ export const TYPE_NAME = "confType"
export const BaseData = { export const BaseData = {
channelType: "channelType", channelType: "channelType",
productType: "productType", productType: "productType",
productServiceItemList: "productServiceItemList" productServiceItemList: "productServiceItemList",
positionTypeList: "positionTypeList" // 太阳膜商品部位
} }
/** /**
...@@ -509,43 +510,43 @@ export const targetType = { ...@@ -509,43 +510,43 @@ export const targetType = {
} }
// 太阳膜部位 // 太阳膜部位
export const positionTypeList = [ // export const positionTypeList = [
{ // {
position: 1, // position: 1,
confName: "前档玻璃", // confName: "前档玻璃",
deductionStandard: 1 // deductionStandard: 1
}, // },
{ // {
position: 2, // position: 2,
confName: "侧后档玻璃", // confName: "侧后档玻璃",
deductionStandard: 2 // deductionStandard: 2
}, // },
{ // {
position: 3, // position: 3,
confName: "单帖侧窗一个", // confName: "单帖侧窗一个",
deductionStandard: 0.4 // deductionStandard: 0.4
}, // },
{ // {
position: 4, // position: 4,
confName: "单帖后档一个", // confName: "单帖后档一个",
deductionStandard: 0.8 // deductionStandard: 0.8
}, // },
{ // {
position: 5, // position: 5,
confName: "单帖小天窗", // confName: "单帖小天窗",
deductionStandard: 0.4 // deductionStandard: 0.4
}, // },
{ // {
position: 6, // position: 6,
confName: "单帖中天窗", // confName: "单帖中天窗",
deductionStandard: 0.8 // deductionStandard: 0.8
}, // },
{ // {
position: 7, // position: 7,
confName: "单帖全景天窗", // confName: "单帖全景天窗",
deductionStandard: 1 // deductionStandard: 1
} // }
] // ]
// 太阳膜适用车型 // 太阳膜适用车型
export const applicableModelTypeList = [ export const applicableModelTypeList = [
{ {
......
...@@ -353,6 +353,14 @@ export const routerName = { ...@@ -353,6 +353,14 @@ export const routerName = {
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleBatchOffShelf" handle: "handleBatchOffShelf"
},
{
authId: "9030909",
parentId: "90309",
label: "批量复制",
category: "Button",
type: "primary",
handle: "handleBatchCopy"
} }
], ],
component: _import("goods/grounding/index") component: _import("goods/grounding/index")
......
...@@ -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, getPositionList } 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: [],
// 太阳膜类商品部位
positionTypeList: []
}, },
actions: { actions: {
/** /**
...@@ -29,10 +31,15 @@ export default { ...@@ -29,10 +31,15 @@ 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({}), getPositionList({})]).then(
async ([channelType, productType]) => { async ([channelType, productType, positionTypeList]) => {
positionTypeList?.forEach(val => { // 之前前端写死的数据 数据整理 不用改动很多
val.position = val.positionValue
val.confName = val.positionName
})
state.channelType = channelType state.channelType = channelType
state.productType = productType state.productType = productType
state.positionTypeList = positionTypeList
// console.log(productType, "productType") // console.log(productType, "productType")
await dispatch("save2db", { await dispatch("save2db", {
name: "", name: "",
...@@ -49,6 +56,7 @@ export default { ...@@ -49,6 +56,7 @@ export default {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
state.channelType = [] state.channelType = []
state.productType = [] state.productType = []
state.positionTypeList = []
await dispatch("save2db", { await dispatch("save2db", {
name: "", name: "",
value: state value: state
...@@ -101,8 +109,8 @@ export default { ...@@ -101,8 +109,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, positionTypeList } = state
resolve({ channelType, productType }) resolve({ channelType, productType, positionTypeList })
}) })
}, },
/** /**
......
...@@ -20,6 +20,12 @@ ...@@ -20,6 +20,12 @@
{{ $$(detail.subOrder,'upgradeGoodsName') }} {{ $$(detail.subOrder,'upgradeGoodsName') }}
</td> </td>
<td class="lb"> <td class="lb">
部位
</td>
<td class="lb">
{{ $$(detail.subOrder,'positionStr') }}
</td>
<td class="lb">
商品别名 商品别名
</td> </td>
<td class="lb"> <td class="lb">
...@@ -39,11 +45,11 @@ ...@@ -39,11 +45,11 @@
数量 数量
</td> </td>
<td>{{ $$(detail.subOrder,'number') }}件</td> <td>{{ $$(detail.subOrder,'number') }}件</td>
<td rowspan="2" <td rowspan="2" colspan="2"
class="lb"> class="lb">
支付金额 支付金额
</td> </td>
<td rowspan="2"> <td rowspan="2" colspan="2">
{{ detail.totalPrice ? '¥ ' + detail.totalPrice : '' }} {{ detail.totalPrice ? '¥ ' + detail.totalPrice : '' }}
</td> </td>
</tr> </tr>
...@@ -344,7 +350,7 @@ ...@@ -344,7 +350,7 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { Util, deepClone } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { shop4sDeductChargeFlagObj, partnerDeductChargeFlagObj, payType, sceneType, proportionType, targetType } from '@/common/constants' import { shop4sDeductChargeFlagObj, partnerDeductChargeFlagObj, payType, sceneType, proportionType, targetType, BaseData } from '@/common/constants'
import { mainOrderDetail, subOrderDetail } from '@api/finance' import { mainOrderDetail, subOrderDetail } from '@api/finance'
export default { export default {
name: 'FinanceDetail', name: 'FinanceDetail',
...@@ -382,21 +388,24 @@ export default { ...@@ -382,21 +388,24 @@ export default {
// shop4sDeductChargeFlagObj: shop4sDeductChargeFlagObj, // shop4sDeductChargeFlagObj: shop4sDeductChargeFlagObj,
// partnerDeductChargeFlagObj: partnerDeductChargeFlagObj, // partnerDeductChargeFlagObj: partnerDeductChargeFlagObj,
ledgerData: [], // 分账信息 ledgerData: [], // 分账信息
reconciliationData: [] // 对账信息 reconciliationData: [], // 对账信息
positionTypeList: [] // 商品部位字典
} }
}, },
mounted() { mounted() {
const row = this.$route.params.rowInfo const row = this.$route.params.rowInfo
console.log(row) this.getBaseData()
this.isSubOrder = !row.hasOwnProperty('subOrderProfitAllocations') this.isSubOrder = !row.hasOwnProperty('subOrderProfitAllocations')
this.getDetail(row) this.getDetail(row)
}, },
methods: { methods: {
...mapActions({ close: 'd2admin/page/close' }), ...mapActions({ close: 'd2admin/page/close' }),
...mapActions("d2admin/base", ["get"]),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getDetail(row) { getDetail(row) {
if (this.$route.params.from && this.$route.params.from == 'orderSupplement') { // 从待补录订单列表跳转过来 if (this.$route.params.from && this.$route.params.from == 'orderSupplement') { // 从待补录订单列表跳转过来
mainOrderDetail({ orderCode: row.inputtedOrderCode }).then(res => { mainOrderDetail({ orderCode: row.inputtedOrderCode }).then(res => {
...@@ -422,6 +431,7 @@ export default { ...@@ -422,6 +431,7 @@ export default {
if (res.goodsOrder?.payOrder?.successDate) { if (res.goodsOrder?.payOrder?.successDate) {
res.goodsOrder.payOrder.successDate = Util.dateFormate(res.goodsOrder.payOrder.successDate, 'YYYY-MM-DD HH:mm:ss') res.goodsOrder.payOrder.successDate = Util.dateFormate(res.goodsOrder.payOrder.successDate, 'YYYY-MM-DD HH:mm:ss')
} }
res.subOrder.positionStr = this.positionTypeList?.filter(val => val.position == res.subOrder?.upgradeGoodsPosition)[0]?.confName || '-'
this.detail = res this.detail = res
const calculateds = res.expenseCategoryCalculateds const calculateds = res.expenseCategoryCalculateds
if (calculateds && calculateds.length > 0) { if (calculateds && calculateds.length > 0) {
...@@ -502,7 +512,7 @@ export default { ...@@ -502,7 +512,7 @@ export default {
background-color: #fafafa; background-color: #fafafa;
} }
&.lb { &.lb {
width: 6em; width: 6.5em;
text-align: center; text-align: center;
background-color: #fafafa; background-color: #fafafa;
} }
......
...@@ -249,6 +249,13 @@ ...@@ -249,6 +249,13 @@
<span>{{ scope.row.goodsName || '-' }}</span> <span>{{ scope.row.goodsName || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodsName"
label="部位"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.positionStr || '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="upgradeGoodsAlias" <el-table-column prop="upgradeGoodsAlias"
label="商品别名" label="商品别名"
align="center"> align="center">
...@@ -792,7 +799,8 @@ export default { ...@@ -792,7 +799,8 @@ export default {
shopProfitType_visible: true, // 列表字段:流量方比例 shopProfitType_visible: true, // 列表字段:流量方比例
yq_visible: true, // 列表字段:园区店 yq_visible: true, // 列表字段:园区店
/** 根据场景控制页面显示隐藏end */ /** 根据场景控制页面显示隐藏end */
sceneList: sceneList sceneList: sceneList,
positionTypeList: [] // 商品部位数据
} }
}, },
...@@ -929,6 +937,7 @@ export default { ...@@ -929,6 +937,7 @@ export default {
...mapActions("d2admin/base", ["get"]), ...mapActions("d2admin/base", ["get"]),
async getBaseData() { async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType) this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.getOptionsList() this.getOptionsList()
}, },
handleAddClose(isRefresh = false) { }, handleAddClose(isRefresh = false) { },
...@@ -1017,7 +1026,7 @@ export default { ...@@ -1017,7 +1026,7 @@ export default {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
if ( if (
this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部' this.baseData[item.optionsName]?.length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部'
) { ) {
const temp = {} const temp = {}
temp[this.showFormData[index].optionId] = '' temp[this.showFormData[index].optionId] = ''
...@@ -1077,6 +1086,7 @@ export default { ...@@ -1077,6 +1086,7 @@ export default {
item.subOrderProfitAllocations.forEach(subItem => { item.subOrderProfitAllocations.forEach(subItem => {
subItem.uniqueKey = temp++ subItem.uniqueKey = temp++
subItem = this.numAddPrefix(subItem) subItem = this.numAddPrefix(subItem)
subItem.positionStr = this.positionTypeList?.filter(val => val.position == subItem.goodsPosition)[0]?.confName || '-'
}) })
} }
item = this.numAddPrefix(item) item = this.numAddPrefix(item)
......
<template>
<d2-dialog title="批量复制"
:is-visible.sync="batchCopyVisible"
width="600px"
btn-ok-label="确定"
@confirmDialog="handleBatchCopyConfirm"
@closeDialog="handleBatchCopyClose"
class="relateStore">
<el-form label-width="120px" :rules="rules" :model="selectData" ref="batchCopyForm">
<el-form-item label="业务场景:">
<el-input style="width: 370px;" v-model="sceneList[selectedScene]" disabled></el-input>
</el-form-item>
<el-form-item label="复制门店:" prop="selectMerchantObj">
<el-select v-model="selectData.selectMerchantObj" remote reserve-keyword
placeholder="请选择复制门店" @visible-change="visibleChange" :remote-method="remoteMethod"
v-el-select-loadmore="interestsLoadmore" style="width: 370px;" value-key="merchantId" filterable>
<el-option v-for="subItem in storeData" :key="subItem.merchantId"
:label="subItem.merchantName" :value="subItem" />
</el-select>
</el-form-item>
</el-form>
<div class="tips">
说明:批量复制至新门店后,系统自动按操作商品,自动更新补充商品对应的上架门店
</div>
</d2-dialog>
</template>
<script>
import { getList, getAccountMerchantList } from '@/api/merchant'
import { sceneList } from '@/common/constants.js'
export default {
name: 'RelateStoreDialog',
data() {
return {
storeData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20,
searchMerchantName: '',
sceneList,
selectData: {},
rules: {selectMerchantObj: [{ required: true, message: '请选择复制门店', trigger: 'blur' }]}
}
},
directives: {
'el-select-loadmore': {
bind(el, binding) {
setTimeout(() => {
const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap'
)
SELECTWRAP_DOM.addEventListener('scroll', function () {
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}, 100)
}
}
},
props: {
batchCopyVisible: {
type: Boolean,
default: false
},
selectedScene: {
type: Number
}
},
mounted() {
this.getList()
},
methods: {
getList() {
let storeApi = this.selectedScene == 2 ? getAccountMerchantList : getList // 会员权益场景 上架门店是账户中心所有门店
storeApi({
merchantName: this.searchMerchantName,
currentPage: this.currentPage,
pageSize: this.pageSize,
scene: this.selectedScene ? this.selectedScene : ''
}).then(res => {
res?.list?.forEach(val => { // 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo) val.merchantId = val.merchantNo
})
this.storeData = this.storeData.concat(res.list)
})
},
// 获取上架门店
remoteMethod(query) {
this.searchMerchantName = query
this.currentPage = 1
this.storeData = []
this.getList() // 请求接口
},
visibleChange(data) {
// 获取焦点重新渲染下拉框数据
if (data) {
if (this.searchMerchantName) {
this.searchMerchantName = ''
this.currentPage = 1
this.storeData = []
this.getList()
}
}
},
// 获取更多上架门店
interestsLoadmore() {
setTimeout(() => {
this.currentPage = this.currentPage + 1
if (this.allPages < this.currentPage) {
this.currentPage = this.allPages
return
}
this.getList()
}, 10)
},
handleBatchCopyConfirm() {
this.$refs['batchCopyForm'].validate((valid) => {
console.log(valid)
if (valid) {
this.$emit('handleBatchCopyConfirm', this.selectData?.selectMerchantObj)
}
})
},
handleBatchCopyClose() {
this.$emit('handleBatchCopyClose')
}
}
}
</script>
<style lang="scss">
.tips{
font-size: 14px;
color: #999;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -237,7 +237,7 @@ export default { ...@@ -237,7 +237,7 @@ export default {
// 1 太阳膜 2 (1.3场景商品) // 1 太阳膜 2 (1.3场景商品)
let shopType = formData?.goodsType == 1 ? '1' : formData?.sceneType == 3 ? '2' : '' let shopType = formData?.goodsType == 1 ? '1' : formData?.sceneType == 3 ? '2' : ''
let shopForm = deepClone(copyFormList[0].formBlock) let shopForm = deepClone(copyFormList[0].formBlock)
let spliceForm = shopType == '1' ? ['giftCost', 'recoveryCost', 'virtualAccountCost'] : shopType == '2' ? ['productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost'] : ['productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'upgradeSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost'] let spliceForm = shopType == '1' ? ['giftCost', 'recoveryCost', 'virtualAccountCost'] : shopType == '2' ? ['positionStr', 'productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost'] : ['positionStr', 'productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'upgradeSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost']
// 未勾选基础商品类型 // 未勾选基础商品类型
if (!this.formData.productType?.includes(1)) spliceForm.push('baseSupplyModeStr') if (!this.formData.productType?.includes(1)) spliceForm.push('baseSupplyModeStr')
// 赠送成本:仅产品类型选择“基础产品”时展示 // 赠送成本:仅产品类型选择“基础产品”时展示
......
...@@ -14,8 +14,21 @@ ...@@ -14,8 +14,21 @@
<div style="padding: 20px;"> <div style="padding: 20px;">
<div v-for="(item, index) in i.formBlock" :key="index" > <div v-for="(item, index) in i.formBlock" :key="index" >
<!-- 单选 --> <!-- 单选 -->
<!-- 太阳膜类商品 上架部位 -->
<div v-if="item.type === 'radio' && formData['goodsType'] == 1 && !item.index">
<el-form-item :prop="item.name"
:label="item.label ? item.label + ':' : ''"
:id="item.name"
:label-width="item.label ? '180px' : '0px'"
class="dis-in-block"
:style="{'margin-bottom': !item.type ? '0px' : '22px'}">
<el-radio-group v-model="formData[item.name]">
<el-radio v-for="(subItem, subIndex) in item.radioGroupList" :key="subIndex" :label="subItem.confId">{{ subItem.confName }}</el-radio>
</el-radio-group>
</el-form-item>
</div>
<!-- 1.3场景显示升级/产品供货模式 --> <!-- 1.3场景显示升级/产品供货模式 -->
<div v-if="item.type === 'radio' && ((formData['productType'] && formData['productType'].includes(item.index)) || ((formData['goodsType'] && formData['goodsType'] != 1) && (formData['sceneType'] && formData['sceneType'] == 3)))"> <div v-if="item.type === 'radio' && item.index && ((formData['productType'] && formData['productType'].includes(item.index)) || ((formData['goodsType'] && formData['goodsType'] != 1) && (formData['sceneType'] && formData['sceneType'] == 3)))">
<el-form-item :prop="item.name" <el-form-item :prop="item.name"
:label="item.label ? item.label + ':' : ''" :label="item.label ? item.label + ':' : ''"
:id="item.name" :id="item.name"
...@@ -213,17 +226,23 @@ ...@@ -213,17 +226,23 @@
v-if="filterEmpty(formData.status) || formData.status == 3"> v-if="filterEmpty(formData.status) || formData.status == 3">
存草稿 存草稿
</el-button> </el-button>
<el-button type="primary"
v-if="addOrEdit == 'add'"
@click="handleUp(3)"
:disabled="$store.state.d2admin.loading.value">
保存并继续新增
</el-button>
<el-button class="width_100 cancel-btn" @click="handleClose"> <el-button class="width_100 cancel-btn" @click="handleClose">
取消 取消
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- store-api (1精品升级 2次新车转化 3售后众筹 查询嘀加的门店数据 getList)(0会员/权益升级 查询账户中心所有4s店 serviceGetMerchantList) --> <!-- store-api (1精品升级 2次新车转化 3售后众筹 查询嘀加的门店数据 getList)(0会员/权益升级 查询账户中心所有4s店 getAccountMerchantList) -->
<relate-store-dialog <relate-store-dialog
v-if="relateStoreVisible" v-if="relateStoreVisible"
ref="formRelateStore" ref="formRelateStore"
:relate-store-visible="relateStoreVisible" :relate-store-visible="relateStoreVisible"
:store-api="formData.sceneType ? getList : serviceGetMerchantList" :store-api="formData.sceneType ? getList : getAccountMerchantList"
:store-search-form="storeSearchForm" :store-search-form="storeSearchForm"
:store-selected="storeSelected" :store-selected="storeSelected"
:selected-scene="formData.sceneType" :selected-scene="formData.sceneType"
...@@ -248,6 +267,20 @@ ...@@ -248,6 +267,20 @@
@keydown.native="handleStoreInput" @keydown.native="handleStoreInput"
clearable /> clearable />
</el-form-item> </el-form-item>
<el-form-item label="服务对接:">
<el-input
v-model.trim="storeSearchForm.yqMerchantName"
placeholder="服务对接"
@keydown.native="handleStoreInput"
clearable />
</el-form-item>
<el-form-item label="服务对接商户号:">
<el-input
v-model.trim="storeSearchForm.yqMerchantId"
placeholder="服务对接商户号"
@keydown.native="handleStoreInput"
clearable />
</el-form-item>
<el-button type="primary" @click="handleSearchStore">搜索</el-button> <el-button type="primary" @click="handleSearchStore">搜索</el-button>
</el-form> </el-form>
</el-row> </el-row>
...@@ -266,12 +299,13 @@ import { limitPrice } from '@/common/format' ...@@ -266,12 +299,13 @@ import { limitPrice } from '@/common/format'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { uploadImg, uploadPDF } from '@/api/sys.base' import { uploadImg, uploadPDF } from '@/api/sys.base'
// import { getSceneTypeListByMerchantId } from '@api/grounding' // import { getSceneTypeListByMerchantId } from '@api/grounding'
import { positionTypeList, membraneTypeList } from '@/common/constants.js' import { membraneTypeList } from '@/common/constants.js'
import { upgradeSupplyModeList, crowdUpgradeSupplyModeList } from "../constants/data" import { upgradeSupplyModeList, crowdUpgradeSupplyModeList } from "../constants/data"
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import relateStoreDialog from "./relateStoreDialog.vue" import relateStoreDialog from "./relateStoreDialog.vue"
import relateStoreTable from './relateStoreTable.vue' import relateStoreTable from './relateStoreTable.vue'
import { getList, serviceGetMerchantList } from '@/api/merchant' import { getList, getAccountMerchantList } from '@/api/merchant'
import { BaseData } from '../../../../common/constants'
export default { export default {
name: 'groundingForm', name: 'groundingForm',
components: { components: {
...@@ -282,7 +316,7 @@ export default { ...@@ -282,7 +316,7 @@ export default {
data() { data() {
return { return {
getList, getList,
serviceGetMerchantList, getAccountMerchantList,
equitySceneType: baseConfig.equitySceneType || [], equitySceneType: baseConfig.equitySceneType || [],
membraneTypeList, membraneTypeList,
formData: {}, formData: {},
...@@ -295,6 +329,7 @@ export default { ...@@ -295,6 +329,7 @@ export default {
merchantGoodsRefList: [{ required: true, message: '请选择上架门店', trigger: 'change' }], merchantGoodsRefList: [{ required: true, message: '请选择上架门店', trigger: 'change' }],
sceneType: [{ required: true, message: '请选择业务场景', trigger: 'change' }], sceneType: [{ required: true, message: '请选择业务场景', trigger: 'change' }],
upgradeGoodsId: [{ required: true, message: '请选择上架商品', trigger: 'change' }], upgradeGoodsId: [{ required: true, message: '请选择上架商品', trigger: 'change' }],
position: [{ required: true, message: '请选择上架部位', trigger: 'change' }],
productType: [{ required: true, message: '请选择产品类型', trigger: 'change' }], productType: [{ required: true, message: '请选择产品类型', trigger: 'change' }],
baseSupplyMode: [{ required: true, message: '请选择基础产品供货模式', trigger: 'change' }], baseSupplyMode: [{ required: true, message: '请选择基础产品供货模式', trigger: 'change' }],
upgradeSupplyMode: [{ required: true, message: '请选择升级/产品供货模式', trigger: 'change' }], upgradeSupplyMode: [{ required: true, message: '请选择升级/产品供货模式', trigger: 'change' }],
...@@ -329,14 +364,17 @@ export default { ...@@ -329,14 +364,17 @@ export default {
relateStoreVisible: false, relateStoreVisible: false,
storeSearchForm: { storeSearchForm: {
merchantName: '', merchantName: '',
merchantId: '' merchantId: '',
yqMerchantName: '',
yqMerchantId: ''
}, },
selectDisabled: false, selectDisabled: false,
dialogObj: {}, dialogObj: {},
uploadFileList: [], uploadFileList: [],
imageFileArr: [], imageFileArr: [],
imgViewerVisible: false, imgViewerVisible: false,
initialIndex: 0 initialIndex: 0,
positionTypeList: []
} }
}, },
...@@ -428,6 +466,7 @@ export default { ...@@ -428,6 +466,7 @@ export default {
}, },
mounted() { mounted() {
this.getBaseData()
this.formData = deepClone(this.originData) this.formData = deepClone(this.originData)
this.copyFormList = deepClone(this.formList) this.copyFormList = deepClone(this.formList)
this.filterEditForm() this.filterEditForm()
...@@ -437,6 +476,9 @@ export default { ...@@ -437,6 +476,9 @@ export default {
...mapActions({ ...mapActions({
get: 'd2admin/base/get' get: 'd2admin/base/get'
}), }),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
handleFileChange(e, targetItem) { handleFileChange(e, targetItem) {
setTimeout(() => { setTimeout(() => {
var reader = new FileReader() var reader = new FileReader()
...@@ -545,14 +587,20 @@ export default { ...@@ -545,14 +587,20 @@ export default {
this.$set(this.formList[0], 'formBlock', newForm) this.$set(this.formList[0], 'formBlock', newForm)
this.$nextTick(() => { this.$nextTick(() => {
// 1.3场景 升级产品供货模式 // 1.3场景 升级产品供货模式
const formIndex = this.formList[0].formBlock.findIndex(subItem => subItem.name == 'upgradeSupplyMode')
if (formData.sceneType == 3) { if (formData.sceneType == 3) {
this.$set(this.formList[0].formBlock[3], 'radioGroupList', crowdUpgradeSupplyModeList) if (formIndex >= 0) this.$set(this.formList[0].formBlock[formIndex], 'radioGroupList', crowdUpgradeSupplyModeList)
} }
// 太阳膜类 升级产品供货模式(优先级高) // 太阳膜类 升级产品供货模式(优先级高)
if (shopType == 1) { if (shopType == 1) {
// 由1.3场景 切换到太阳膜 已选升级供货模式为2 的清除掉 太阳膜供货模式没有2 // 由1.3场景 切换到太阳膜 已选升级供货模式为2 的清除掉 太阳膜供货模式没有2
if (formData.upgradeSupplyMode == 2) this.formData.upgradeSupplyMode = '' if (formData.upgradeSupplyMode == 2) this.formData.upgradeSupplyMode = ''
this.$set(this.formList[0].formBlock[6], 'radioGroupList', upgradeSupplyModeList) if (formIndex > -1) this.$set(this.formList[0].formBlock[formIndex], 'radioGroupList', upgradeSupplyModeList)
// 上架部位
this.formData?.positionNamesArr?.forEach(val => {
val.confId = val.position
})
this.$set(this.formList[0].formBlock[this.formList[0].formBlock.findIndex(subItem => subItem.name == 'position')], 'radioGroupList', this.formData?.positionNamesArr || [])
} }
this.show = true this.show = true
this.$refs[this.formRef + 'd2FormRuleForm'] && this.$refs[this.formRef + 'd2FormRuleForm'].clearValidate() this.$refs[this.formRef + 'd2FormRuleForm'] && this.$refs[this.formRef + 'd2FormRuleForm'].clearValidate()
...@@ -629,13 +677,14 @@ export default { ...@@ -629,13 +677,14 @@ export default {
// 带出上架商品的附带信息 // 带出上架商品的附带信息
if (targetItem.name === 'upgradeGoodsId') { if (targetItem.name === 'upgradeGoodsId') {
let _valueObj = targetItem.optionList.filter(v => v.confId == value)[0]?.valueObj || {} let _valueObj = targetItem.optionList.filter(v => v.confId == value)[0]?.valueObj || {}
let _positionNamesArr = _valueObj?.goodsType == 1 ? deepClone(positionTypeList).filter(it => _valueObj?.position == it.position) : [] let _positionNamesArr = _valueObj?.goodsType == 1 ? deepClone(this.positionTypeList).filter(val => (_valueObj.position + '')?.includes(val.position)) : []
_formData.upgradeGoodsId = value _formData.upgradeGoodsId = value
_formData.upgradeGoodsName = _valueObj?.upgradeGoodsName _formData.upgradeGoodsName = _valueObj?.upgradeGoodsName
_formData.type = _valueObj?.type _formData.type = _valueObj?.type
_formData.upgradePrice = _valueObj?.upgradePrice _formData.upgradePrice = _valueObj?.upgradePrice
_formData.purchasePrice = _valueObj?.purchasePrice _formData.purchasePrice = _valueObj?.purchasePrice
_formData.positionNames = _positionNamesArr.length ? _positionNamesArr[0]?.confName : '' // 部位 _formData.positionNames = _positionNamesArr.length ? _positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位
_formData.positionNamesArr = _positionNamesArr
_formData.goodsName = _valueObj?.goodsName _formData.goodsName = _valueObj?.goodsName
_formData.goodsTypeName = _valueObj?.goodsTypeName _formData.goodsTypeName = _valueObj?.goodsTypeName
_formData.goodsType = _valueObj?.goodsType _formData.goodsType = _valueObj?.goodsType
......
...@@ -29,6 +29,14 @@ ...@@ -29,6 +29,14 @@
label="门店商户号" label="门店商户号"
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column prop="yqMerchantName"
label="服务对接"
align="center">
</el-table-column>
<el-table-column prop="yqMerchantId"
label="服务对接商户号"
align="center">
</el-table-column>
</el-table> </el-table>
<el-pagination small <el-pagination small
background background
...@@ -120,18 +128,20 @@ export default { ...@@ -120,18 +128,20 @@ export default {
}) })
}, },
getSelectingList() { getSelectingList() {
let _storeSearchForm = this.storeSearchForm
if (!this.selectedScene) {
_storeSearchForm.merchantIdName = _storeSearchForm.merchantName // 账户中心所有门店接口查询条件
}
this.storeApi({ this.storeApi({
...this.storeSearchForm, ...this.storeSearchForm,
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
scene: this.selectedScene ? this.selectedScene : '' scene: this.selectedScene
}).then(res => { }).then(res => {
res?.list?.forEach(val => { // 账户中心门店返回商户号字段是merchantNo res?.list?.forEach(val => { // 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo) val.merchantId = val.merchantNo if (val.merchantNo) val.merchantId = val.merchantNo
val?.sceneList?.forEach(subVal => {
if (subVal.scene == this.selectedScene) {
val.yqMerchantId = subVal?.yqMerchant?.merchantId || '-'
val.yqMerchantName = subVal?.yqMerchant?.merchantName || '-'
}
})
}) })
this.selectingData = res.list this.selectingData = res.list
this.total = res.total this.total = res.total
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
</template> </template>
<script> <script>
import { productList, baseSupplyModeList, upgradeSupplyModeList } from "./constants/data" import { productList, baseSupplyModeList, upgradeSupplyModeList } from "./constants/data"
import { getMerchantGoodsInfo, addOrUpdateAPI, getAllGoodsList } from '@api/grounding' import { getMerchantGoodsInfo, addOrUpdateAPI, getAllGoodsList, checkGroundingLog } from '@api/grounding'
import groundingForm from "./components/groundingForm.vue" import groundingForm from "./components/groundingForm.vue"
import { positionTypeList, sceneCodeList } from '@/common/constants.js' import { BaseData, sceneCodeList } from '@/common/constants.js'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
...@@ -71,6 +71,11 @@ export default { ...@@ -71,6 +71,11 @@ export default {
value: 'upgradeCommodityCode' value: 'upgradeCommodityCode'
}] }]
}, { }, {
name: 'position',
label: '上架部位',
type: 'radio',
radioGroupList: []
}, {
name: 'goodsAlias', name: 'goodsAlias',
label: '商品别名', label: '商品别名',
type: 'input', type: 'input',
...@@ -208,6 +213,7 @@ export default { ...@@ -208,6 +213,7 @@ export default {
// 获取全部上架商品 // 获取全部上架商品
this.getSelectingList() this.getSelectingList()
} else { } else {
this.addOrEdit = 'edit'
// 获取商品详情 // 获取商品详情
this.getDetailInfo(id) this.getDetailInfo(id)
} }
...@@ -297,16 +303,18 @@ export default { ...@@ -297,16 +303,18 @@ export default {
const res = new Map() const res = new Map()
return arr.filter((a) => !res.has(a.confId) && res.set(a.confId, 1)) return arr.filter((a) => !res.has(a.confId) && res.set(a.confId, 1))
}, },
getBaseData() { async getBaseData() {
this.editForm.forEach(item => { this.editForm.forEach(item => {
item.formBlock && item.formBlock.forEach(v => { item.formBlock && item.formBlock.forEach(v => {
if (v.type == 'check') { if (v.type == 'check') {
v.checkGroupList = productList // 产品类型 v.checkGroupList = productList // 产品类型
} else if (v.type == 'radio') { } else if (v.type == 'radio') {
if (v.index == '1') { if (v.index == 1) {
v.radioGroupList = baseSupplyModeList // 基础供货模式 v.radioGroupList = baseSupplyModeList // 基础供货模式
} else { } else if (v.index == 2) {
v.radioGroupList = upgradeSupplyModeList // 升级供货模式 v.radioGroupList = upgradeSupplyModeList // 升级供货模式
} else {
v.radioGroupList = []
} }
} }
if (v.name == 'sceneType') { // 业务场景 if (v.name == 'sceneType') { // 业务场景
...@@ -314,16 +322,18 @@ export default { ...@@ -314,16 +322,18 @@ export default {
} }
}) })
}) })
this.positionTypeList = await this.get(BaseData.positionTypeList)
}, },
getDetailInfo(id) { getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(res => { getMerchantGoodsInfo({ id }).then(res => {
const productType = [] const productType = []
const positionNamesArr = res?.goodsType == 1 ? deepClone(positionTypeList).filter(val => res.upgradeGoods.position == val.position) : [] const positionNamesArr = res?.goodsInfo?.goodsType == 1 ? (deepClone(this.positionTypeList)?.filter(val => (res?.upgradeGoods.position + '').includes(val.position)) || []) : []
if (res?.upgradeProductFlag == 'Y') productType.push(2) if (res?.upgradeProductFlag == 'Y') productType.push(2)
if (res?.baseProductFlag == 'Y') productType.push(1) if (res?.baseProductFlag == 'Y') productType.push(1)
res.productType = productType // 产品类型 res.productType = productType // 产品类型
res.upgradePrice = res.upgradeGoods?.upgradePrice // 参考售价 res.upgradePrice = res.upgradeGoods?.upgradePrice // 参考售价
res.positionNames = positionNamesArr.length ? positionNamesArr[0]?.confName : '' // 部位 res.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位
res.positionNamesArr = positionNamesArr
res.purchasePrice = res.upgradeGoods?.purchasePrice // 采购价价 res.purchasePrice = res.upgradeGoods?.purchasePrice // 采购价价
res.upgradeCommodityCode = res?.upgradeCommodityCode // 商品ID res.upgradeCommodityCode = res?.upgradeCommodityCode // 商品ID
res.warrantyPeriod = res?.upgradeGoods?.warrantyPeriod // 质保年限 res.warrantyPeriod = res?.upgradeGoods?.warrantyPeriod // 质保年限
...@@ -358,7 +368,7 @@ export default { ...@@ -358,7 +368,7 @@ export default {
const { num } = data const { num } = data
this.confirm(num, data) this.confirm(num, data)
}, },
confirm(num, data) { confirm(num, data, existCheck = true) {
// 1保存并上架 2存草稿 // 1保存并上架 2存草稿
const formObj = {} const formObj = {}
this.editForm.forEach(val => { this.editForm.forEach(val => {
...@@ -390,31 +400,79 @@ export default { ...@@ -390,31 +400,79 @@ export default {
// 整理上传凭证数据 // 整理上传凭证数据
delete formObj?.productType delete formObj?.productType
const params = { const params = {
saveDraft: num !== 1, saveDraft: num === 2, // 是否存草稿
id: data.id, id: data.id,
...formObj, ...formObj,
merchantGoodsRefList: arr, merchantGoodsRefList: arr,
voucherList: fileArr voucherList: fileArr,
existCheck
}
if (data?.goodsType == 1 && data?.sceneType != 1) return this.$message.error('太阳膜类商品仅支持上架至精品升级场景')
this.editData = data
let checkParams = {
id: data.id || '',
upgradeGoodsId: formObj.upgradeGoodsId,
position: formObj.position || '',
sceneType: formObj.sceneType,
merchantIdList: arr?.map(val => {return val.merchantId})
} }
if (num == 1 && !baseConfig.supplierCode.includes(data.supplierCode)) { // 第三方商品无需走审核流程不用提示 if ((num == 1 || num == 3) && !baseConfig.supplierCode.includes(data.supplierCode)) { // 第三方商品无需走审核流程不用提示
this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', { this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
addOrUpdateAPI(this.dealObjectValue(params)).then(res => { // 校验上架记录中是否已存在
this.notice.okTips() this.checkEvent(checkParams, params, num)
this.handleClose(true)
})
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
} else { } else {
addOrUpdateAPI(this.dealObjectValue(params)).then(res => { // 校验上架记录中是否已存在
this.notice.okTips() this.checkEvent(checkParams, params, num)
this.handleClose(true) }
}) },
checkEvent(checkParams, params, num) {
checkGroundingLog(this.dealObjectValue(checkParams)).then(res => {
if (res >= 1) {
this.$confirm('当前商品在对应门店已存在上架记录,是否确定保存?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
this.confirmEvent(params, num)
})
} else {
this.confirmEvent(params, num)
}
})
},
confirmEvent(params, num) {
let obj = { // 商品信息
position: '',
goodsAlias: '',
warrantyType: '',
productType: [],
baseSupplyMode: '',
upgradeSupplyMode: '',
sellPrice: '',
minSellPrice: '',
upgradeProductCost: '',
giftCost: '',
recoveryCost: '',
virtualAccountCost: ''
} }
addOrUpdateAPI(this.dealObjectValue(params)).then(res => {
this.notice.okTips()
if (num == 3) {
// 保留 上架商品和上架门店上架凭证数据
this.editData = {
...this.editData,
...obj
}
} else { // 保存后跳转列表页
this.handleClose(true)
}
})
}, },
dealObjectValue(obj) { dealObjectValue(obj) {
var param = {} var param = {}
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<script> <script>
import { getMerchantGoodsInfo, batchReviewAPI } from '@api/grounding' import { getMerchantGoodsInfo, batchReviewAPI } from '@api/grounding'
import detail from './components/detail.vue' import detail from './components/detail.vue'
import { sceneList, positionTypeList } from '@/common/constants.js' import { sceneList, BaseData } from '@/common/constants.js'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from './constants/data' import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from './constants/data'
...@@ -72,6 +72,9 @@ export default { ...@@ -72,6 +72,9 @@ export default {
value: 'upgradeCommodityCode' value: 'upgradeCommodityCode'
}] }]
}, { }, {
name: 'positionStr',
label: '上架部位'
}, {
name: 'goodsAlias', name: 'goodsAlias',
label: '商品别名' label: '商品别名'
}, { }, {
...@@ -144,6 +147,7 @@ export default { ...@@ -144,6 +147,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.getBaseData()
// 获取商品详情 // 获取商品详情
const id = this.$route.params.id const id = this.$route.params.id
this.detailId = id this.detailId = id
...@@ -155,6 +159,9 @@ export default { ...@@ -155,6 +159,9 @@ export default {
get: 'd2admin/base/get', get: 'd2admin/base/get',
close: 'd2admin/page/close' close: 'd2admin/page/close'
}), }),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getDetailInfo(id) { getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(res => { getMerchantGoodsInfo({ id }).then(res => {
const productType = [] const productType = []
...@@ -162,7 +169,7 @@ export default { ...@@ -162,7 +169,7 @@ export default {
if (res?.baseProductFlag == 'Y') productType.push(1) if (res?.baseProductFlag == 'Y') productType.push(1)
const productTypeTextArr = [] const productTypeTextArr = []
// 太阳膜回显 部位 // 太阳膜回显 部位
const positionNamesArr = res?.goodsType == 1 ? deepClone(positionTypeList).filter(val => res.upgradeGoods.position == val.position) : [] const positionNamesArr = res?.goodsInfo?.goodsType == 1 ? (deepClone(this.positionTypeList)?.filter(val => (res?.upgradeGoods.position + '').includes(val.position)) || []) : []
// 产品类型 // 产品类型
productList.forEach(v => { productList.forEach(v => {
if (productType.includes(v.confId)) productTypeTextArr.push(v.confName) if (productType.includes(v.confId)) productTypeTextArr.push(v.confName)
...@@ -184,7 +191,7 @@ export default { ...@@ -184,7 +191,7 @@ export default {
res.sceneName = sceneList[res.sceneType] || '-' res.sceneName = sceneList[res.sceneType] || '-'
res.upgradePrice = res.upgradeGoods?.upgradePrice res.upgradePrice = res.upgradeGoods?.upgradePrice
res.purchasePrice = res.upgradeGoods?.purchasePrice res.purchasePrice = res.upgradeGoods?.purchasePrice
res.positionNames = positionNamesArr.length ? positionNamesArr[0]?.confName : '' res.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位
res.productType = productType res.productType = productType
res.serviceItemNames = res.upgradeGoods?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',') res.serviceItemNames = res.upgradeGoods?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',')
res.warrantyPeriod = res.upgradeGoods?.warrantyPeriod res.warrantyPeriod = res.upgradeGoods?.warrantyPeriod
...@@ -193,6 +200,7 @@ export default { ...@@ -193,6 +200,7 @@ export default {
res.thirdPartyCode = res?.upgradeGoods?.thirdPartyCode || '' res.thirdPartyCode = res?.upgradeGoods?.thirdPartyCode || ''
res.entityCardFlag = res?.upgradeGoods?.entityCardFlag res.entityCardFlag = res?.upgradeGoods?.entityCardFlag
res.voucherList = res?.voucherList || [] res.voucherList = res?.voucherList || []
res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || ''
this.editData = res || {} this.editData = res || {}
this.$nextTick(() => { this.$nextTick(() => {
this.show = true this.show = true
......
...@@ -38,6 +38,10 @@ ...@@ -38,6 +38,10 @@
<span style="{display: inline-block};margin-left: 10px"> <span style="{display: inline-block};margin-left: 10px">
<auth-button category="Button" :show-btn-ids="['9030908']" /> <auth-button category="Button" :show-btn-ids="['9030908']" />
</span> </span>
<!-- 批量复制 -->
<span style="{display: inline-block};margin-left: 10px">
<auth-button category="Button" :show-btn-ids="['9030909']" />
</span>
<!-- 导出 --> <!-- 导出 -->
<span style="{display: inline-block};margin-left: 10px"> <span style="{display: inline-block};margin-left: 10px">
<auth-button category="Button" :show-btn-ids="['9030902']" /> <auth-button category="Button" :show-btn-ids="['9030902']" />
...@@ -120,19 +124,29 @@ ...@@ -120,19 +124,29 @@
</div> </div>
</d2-table> </d2-table>
</div> </div>
<batch-copy-dialog
v-if="batchCopyVisible"
ref="formBatchCopy"
:batch-copy-visible="batchCopyVisible"
:selected-scene="batchCopySelectScene"
@handleBatchCopyConfirm="handleBatchCopyConfirm"
@handleBatchCopyClose="handleBatchCopyClose">
</batch-copy-dialog>
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { getProductTypeBySceneId, getList } from '@api/product' import { getProductTypeBySceneId, getList } from '@api/product'
import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById, batchUpdateStatus } from '@api/grounding' import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById, batchUpdateStatus, batchUpdateBatchCopy } from '@api/grounding'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { sceneCodeList, sceneList } from '@/common/constants.js' import { sceneCodeList, sceneList, BaseData } from '@/common/constants.js'
import { getParkStore } from '@api/editCustomer' import { getParkStore } from '@api/editCustomer'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { baseSupplyModeList, upgradeSupplyModeList } from './constants/data' import { baseSupplyModeList, upgradeSupplyModeList } from './constants/data'
import { getShopMerchantList } from '@api/deviceManage' import { getShopMerchantList } from '@api/deviceManage'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import batchCopyDialog from './components/batchCopyDialog.vue'
export default { export default {
components: { batchCopyDialog },
name: 'groundingIndex', name: 'groundingIndex',
data() { data() {
return { return {
...@@ -335,6 +349,14 @@ export default { ...@@ -335,6 +349,14 @@ export default {
prop: 'goodsTypeName', prop: 'goodsTypeName',
width: 140 width: 140
}, { }, {
label: '上架部位',
parentProp: 'goodsInfo',
prop: 'position',
width: 140,
formatter: (cellValue) => {
return deepClone(this.positionTypeList)?.filter(val => cellValue?.position == val.position)[0]?.confName || '-'
}
}, {
label: '商品别名', label: '商品别名',
prop: 'goodsAlias', prop: 'goodsAlias',
formatter: (cellValue) => { formatter: (cellValue) => {
...@@ -444,10 +466,14 @@ export default { ...@@ -444,10 +466,14 @@ export default {
confValue: '已下架' confValue: '已下架'
}] }]
}, },
selfBuildGoodsType: baseConfig.selfBuildGoodsType || '' selfBuildGoodsType: baseConfig.selfBuildGoodsType || '',
batchCopySelectScene: '', // 批量复制选中的场景值
batchCopyVisible: false,
batchCopySelectData: [] // 批量辅助选中的上架数据
} }
}, },
mounted() { mounted() {
this.getBaseData()
var allOpt = { confId: '', confValue: '全部' } var allOpt = { confId: '', confValue: '全部' }
this.baseData.statusList.unshift(allOpt) this.baseData.statusList.unshift(allOpt)
this.baseData.sceneCodeList = deepClone(sceneCodeList) this.baseData.sceneCodeList = deepClone(sceneCodeList)
...@@ -488,6 +514,9 @@ export default { ...@@ -488,6 +514,9 @@ export default {
close: 'd2admin/page/close' close: 'd2admin/page/close'
}), }),
...mapActions('d2admin/user', ['actionSetDownloadList']), ...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getOptionsList() { getOptionsList() {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
...@@ -687,6 +716,39 @@ export default { ...@@ -687,6 +716,39 @@ export default {
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
},
// 批量复制
handleBatchCopy() {
let selectedData = []
if (this.$refs.groundingIndexTable.mutiSelectArr.groundingIndex) {
selectedData = this.$refs.groundingIndexTable.mutiSelectArr.groundingIndex
}
let sceneType = selectedData.map(v => { return v.sceneType }) || []
if (!selectedData.length) return this.$message.warning('请选择上架记录')
if (Array.from(new Set(sceneType))?.length > 1) {
return this.$message.warning('请选择同一业务场景的上架记录')
}
this.batchCopySelectData = selectedData || []
this.batchCopySelectScene = Array.from(new Set(sceneType))[0]
this.batchCopyVisible = true
},
// 批量复制弹窗确定
handleBatchCopyConfirm(data) {
let params = {
ids: this.batchCopySelectData.map(v => { return v.id }) || [], // 商品id
sceneType: this.batchCopySelectScene, // 业务场景
merchantId: data?.merchantId,
merchantName: data?.merchantName
}
batchUpdateBatchCopy(params).then(() => {
this.notice.okTips()
this.$refs.groundingIndexTable.refreshTable()
this.batchCopyVisible = false
})
},
// 批量复制弹窗取消
handleBatchCopyClose() {
this.batchCopyVisible = false
} }
} }
} }
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<script> <script>
import { getGoodsInfoById } from '@/api/commodity' import { getGoodsInfoById } from '@/api/commodity'
import { membraneTypeList, positionTypeList } from '@/common/constants' import { membraneTypeList } from '@/common/constants'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
export default { export default {
...@@ -119,6 +119,10 @@ export default { ...@@ -119,6 +119,10 @@ export default {
commodityInfoId: { commodityInfoId: {
type: [String, Number], type: [String, Number],
default: () => { } default: () => { }
},
positionTypeList: {
type: Array,
default: () => { }
} }
}, },
...@@ -141,8 +145,8 @@ export default { ...@@ -141,8 +145,8 @@ export default {
getInfo(id) { getInfo(id) {
getGoodsInfoById({ id: id }).then(res => { getGoodsInfoById({ id: id }).then(res => {
res?.upgradeGoodsList?.forEach(item => { res?.upgradeGoodsList?.forEach(item => {
let positionNamesArr = item?.goodsInfo?.goodsType == 1 ? deepClone(positionTypeList).filter(val => item.position == val.position) : [] let positionNamesArr = item?.goodsInfo?.goodsType == 1 ? deepClone(this.positionTypeList).filter(val => item.position.includes(val.position)) : []
item.positionNames = positionNamesArr.length ? positionNamesArr[0]?.confName : '' item.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : ''
item.serviceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',') item.serviceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',')
}) })
this.commodityInfo = res this.commodityInfo = res
......
...@@ -211,7 +211,10 @@ ...@@ -211,7 +211,10 @@
<td v-if="goodsInfoData.goodsType == 1"> <td v-if="goodsInfoData.goodsType == 1">
<el-select placeholder="部位" <el-select placeholder="部位"
size="small" size="small"
multiple
collapse-tags
:class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }" :class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }"
style="width: 180px;"
v-model="subItem.position" v-model="subItem.position"
@change="changePosition($event, subIndex)"> @change="changePosition($event, subIndex)">
<el-option v-for="childItem in productPositionTypeList" <el-option v-for="childItem in productPositionTypeList"
...@@ -465,7 +468,7 @@ ...@@ -465,7 +468,7 @@
import { limitPrice } from '@/common/format' import { limitPrice } from '@/common/format'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { mapGetters, mapMutations } from 'vuex' import { mapGetters, mapMutations } from 'vuex'
import { positionTypeList, membraneTypeList } from '@/common/constants' import { membraneTypeList } from '@/common/constants'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import serviceItemsDialog from "./serviceItemsDialog.vue" import serviceItemsDialog from "./serviceItemsDialog.vue"
import { getProductServiceItems } from '@api/productManage' import { getProductServiceItems } from '@api/productManage'
...@@ -532,6 +535,10 @@ export default { ...@@ -532,6 +535,10 @@ export default {
productServiceItemList: { productServiceItemList: {
type: Array, type: Array,
default: () => [] default: () => []
},
positionTypeList: {
type: Array,
default: () => []
} }
}, },
mounted() { mounted() {
...@@ -577,7 +584,7 @@ export default { ...@@ -577,7 +584,7 @@ export default {
}, },
'goodsInfoData.goodsPositionList': { 'goodsInfoData.goodsPositionList': {
handler(newValue) { handler(newValue) {
this.productPositionTypeList = positionTypeList.filter(v => newValue?.indexOf(v.position) > -1) this.productPositionTypeList = this.positionTypeList.filter(v => newValue?.indexOf(v.position) > -1)
}, },
deep: true deep: true
}, },
...@@ -826,7 +833,7 @@ export default { ...@@ -826,7 +833,7 @@ export default {
if (i == 0) { if (i == 0) {
this.goodsInfoData.goodsSpecificationList.push({ this.goodsInfoData.goodsSpecificationList.push({
id: '', id: '',
position: '', position: [],
purchasePrice: '', purchasePrice: '',
specificationData: '', specificationData: '',
specsValueList: [this.goodsInfoData.specificationDetailList[i]?.specificationValueList[j]?.specificationValue], specsValueList: [this.goodsInfoData.specificationDetailList[i]?.specificationValueList[j]?.specificationValue],
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
@change="selectAddAttr($event, item)" @change="selectAddAttr($event, item)"
:style="{'width': item.width || formItemWidth}" :style="{'width': item.width || formItemWidth}"
filterable> filterable>
<el-option label="全选" value="全选" @click.native='selectAll($event, item)' v-if="item.optionList.length"></el-option> <el-option label="全选" value="全选" @click.native='selectAll($event, item)' v-if="$$(item.optionList, 'length')"></el-option>
<el-option v-for="subItem in item.optionList" <el-option v-for="subItem in item.optionList"
:key="subItem[item.optionId]" :key="subItem[item.optionId]"
:label="subItem[item.optionLabel]" :label="subItem[item.optionLabel]"
...@@ -440,10 +440,9 @@ ...@@ -440,10 +440,9 @@
<script> <script>
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { uploadImg, uploadVideo } from '@/api/sys.base' import { uploadImg, uploadVideo } from '@/api/sys.base'
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, BaseData } from '@/common/constants.js' import { membraneTypeList, applicableModelTypeList, BaseData } from '@/common/constants.js'
import { mapActions, mapMutations } from 'vuex' import { mapActions, mapMutations } from 'vuex'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
export default { export default {
...@@ -451,6 +450,7 @@ export default { ...@@ -451,6 +450,7 @@ export default {
data() { data() {
return { return {
equitySceneType: baseConfig.equitySceneType || [], equitySceneType: baseConfig.equitySceneType || [],
solarFilmArr: baseConfig.solarFilmArr || [1, 111, 112],
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
lookImgVisible: false, lookImgVisible: false,
formData: {}, formData: {},
...@@ -463,12 +463,39 @@ export default { ...@@ -463,12 +463,39 @@ export default {
url: '', url: '',
uploadType: '' uploadType: ''
}, },
rules: {
goodsName: [{ required: true, message: '请输入产品名称', trigger: 'change' }, {
validator: (rule, value, cb) => {
if (value && !value.includes('太阳膜') && this.solarFilmArr?.includes(this.formData?.goodsType)) {
return cb(new Error('产品名称必须包含“太阳膜”字样才可将产品挂在太阳膜类目下'))
} else {
cb()
}
},
trigger: 'blur'
}],
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'}]
},
copyMembranesFormBlock: [ copyMembranesFormBlock: [
{ {
name: 'positionIds', name: 'positionIds',
label: '部位', label: '部位',
type: 'multiple-select', type: 'multiple-select',
optionList: deepClone(positionTypeList), optionList: [],
optionId: 'position', optionId: 'position',
optionLabel: 'confName', optionLabel: 'confName',
width: '432px' width: '432px'
...@@ -522,10 +549,6 @@ export default { ...@@ -522,10 +549,6 @@ export default {
type: String, type: String,
default: '100%' default: '100%'
}, },
rules: {
type: Object,
default: () => { }
},
formRef: { formRef: {
type: String, type: String,
default: '' default: ''
...@@ -560,8 +583,9 @@ export default { ...@@ -560,8 +583,9 @@ export default {
deep: true deep: true
}, },
'formData.positionIds': { 'formData.positionIds': {
handler(newVal) { async handler(newVal) {
let arr = deepClone(positionTypeList).filter(val => newVal.indexOf(val.position) > -1) let copyPositionTypeList = await this.get(BaseData.positionTypeList)
let arr = deepClone(copyPositionTypeList)?.filter(val => newVal.indexOf(val.position) > -1)
this.formData.goodsPositionList?.forEach(val => { this.formData.goodsPositionList?.forEach(val => {
arr.forEach(item => { arr.forEach(item => {
if (val.position === item.position) { if (val.position === item.position) {
...@@ -575,19 +599,21 @@ export default { ...@@ -575,19 +599,21 @@ export default {
} }
}, },
mounted() { async mounted() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.formData = deepClone(this.originData) this.formData = deepClone(this.originData)
this.formData.merchantId = this.userInfo.detail.merchantId this.formData.merchantId = this.userInfo.detail.merchantId
this.$nextTick(() => { this.$nextTick(() => {
this.$refs[this.formRef + 'd2FormRuleForm'].clearValidate() this.$refs[this.formRef + 'd2FormRuleForm'].clearValidate()
}) })
let copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock) let copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock)
// 太阳膜类 部位下拉框数据
copyMembranesFormBlock[copyMembranesFormBlock.findIndex(val => val.name == 'positionIds')].optionList = this.positionTypeList
if (this.formData.goodsType == 1) { if (this.formData.goodsType == 1) {
this.membranesFormBlock = copyMembranesFormBlock this.membranesFormBlock = copyMembranesFormBlock
} 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: {
...@@ -595,9 +621,6 @@ export default { ...@@ -595,9 +621,6 @@ export default {
get: 'd2admin/base/get' get: 'd2admin/base/get'
}), }),
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']), ...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
// async getProductServiceItemList() {
// this.productServiceItemList = await this.get(BaseData.productServiceItemList)
// },
selectBlur() { selectBlur() {
this.editOptionIndex = -1 this.editOptionIndex = -1
this.showOptionInput = false this.showOptionInput = false
...@@ -687,6 +710,8 @@ export default { ...@@ -687,6 +710,8 @@ export default {
var tempVal = targetItem.optionList.find(item => item.categoryType === value) var tempVal = targetItem.optionList.find(item => item.categoryType === value)
this.formData.goodsTypeName = tempVal.categoryName this.formData.goodsTypeName = tempVal.categoryName
let copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock) let copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock)
// 太阳膜类 部位下拉框数据
copyMembranesFormBlock[copyMembranesFormBlock.findIndex(val => val.name == 'positionIds')].optionList = this.positionTypeList
this.formData.convertedValue = 30 this.formData.convertedValue = 30
this.membranesFormBlock = [] this.membranesFormBlock = []
if (this.formData.goodsType == 1) { if (this.formData.goodsType == 1) {
...@@ -701,8 +726,8 @@ export default { ...@@ -701,8 +726,8 @@ export default {
selectAll(value, targetItem) { selectAll(value, targetItem) {
let _formData = this.formData let _formData = this.formData
if (targetItem.name == 'positionIds') { if (targetItem.name == 'positionIds') {
if (_formData.positionIds.length < (deepClone(positionTypeList).length + 1)) { if (_formData.positionIds.length < (deepClone(this.positionTypeList).length + 1)) {
_formData.positionIds = deepClone(positionTypeList).map(item=>{ _formData.positionIds = deepClone(this.positionTypeList).map(item=>{
return item.position return item.position
}) })
} else { } else {
...@@ -822,6 +847,9 @@ export default { ...@@ -822,6 +847,9 @@ export default {
this.$emit('handleAddConfirm', this.formData) this.$emit('handleAddConfirm', this.formData)
} else { } else {
var needRuleList = Object.keys(options) var needRuleList = Object.keys(options)
if (this.formData?.goodsName && !this.formData?.goodsName?.includes('太阳膜') && this.solarFilmArr?.includes(this.formData?.goodsType)) { // 太阳膜类目 产品名称关键字与类目不匹配
this.$message.error('产品名称必须包含“太阳膜”字样才可将产品挂在太阳膜类目下')
}
this.jumpScroll(needRuleList[0]) this.jumpScroll(needRuleList[0])
return true return true
} }
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<span>序号</span> <span>序号</span>
</td> </td>
<td> <td>
<span class="color-red">*</span>
<span>商品</span> <span>商品</span>
</td> </td>
<td> <td>
...@@ -114,7 +115,10 @@ ...@@ -114,7 +115,10 @@
<td v-if="goodsInfoData.goodsType == 1"> <td v-if="goodsInfoData.goodsType == 1">
<el-select placeholder="部位" <el-select placeholder="部位"
size="small" size="small"
multiple
collapse-tags
:class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }" :class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }"
style="width: 180px;"
v-model="subItem.position" v-model="subItem.position"
@change="changePosition($event, subIndex)"> @change="changePosition($event, subIndex)">
<el-option v-for="childItem in productPositionTypeList" <el-option v-for="childItem in productPositionTypeList"
...@@ -318,7 +322,7 @@ ...@@ -318,7 +322,7 @@
<script> <script>
import { limitPrice } from '@/common/format' import { limitPrice } from '@/common/format'
import { mapGetters, mapMutations } from 'vuex' import { mapGetters, mapMutations } from 'vuex'
import { positionTypeList, membraneTypeList } from '@/common/constants' import { membraneTypeList } from '@/common/constants'
import { deepClone } from "@/common/util" import { deepClone } from "@/common/util"
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import serviceItemsDialog from "./serviceItemsDialog.vue" import serviceItemsDialog from "./serviceItemsDialog.vue"
...@@ -355,6 +359,10 @@ export default { ...@@ -355,6 +359,10 @@ export default {
productServiceItemList: { productServiceItemList: {
type: Array, type: Array,
default: () => [] default: () => []
},
positionTypeList: {
type: Array,
default: () => []
} }
}, },
watch: { watch: {
...@@ -372,7 +380,7 @@ export default { ...@@ -372,7 +380,7 @@ export default {
}, },
'goodsInfoData.goodsPositionList': { 'goodsInfoData.goodsPositionList': {
handler(newValue) { handler(newValue) {
this.productPositionTypeList = positionTypeList.filter(v => newValue?.indexOf(v.position) > -1) this.productPositionTypeList = this.positionTypeList.filter(v => newValue?.indexOf(v.position) > -1)
}, },
deep: true deep: true
}, },
...@@ -492,7 +500,7 @@ export default { ...@@ -492,7 +500,7 @@ export default {
} }
this.goodsInfoData.goodsSpecificationSingleList.push({ this.goodsInfoData.goodsSpecificationSingleList.push({
id: '', id: '',
position: '', position: [],
purchasePrice: '', purchasePrice: '',
specificationData: '', specificationData: '',
specsValueList: [], specsValueList: [],
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<div class="title">产品系列-SPU</div> <div class="title">产品系列-SPU</div>
<productForm v-if="show" <productForm v-if="show"
ref="d2GoodsProductForm" ref="d2GoodsProductForm"
:rules="rules"
:add-or-edit="addOrEdit" :add-or-edit="addOrEdit"
form-name="product" form-name="product"
:origin-data="editData" :origin-data="editData"
...@@ -27,24 +26,6 @@ export default { ...@@ -27,24 +26,6 @@ export default {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
show: false, 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: { editData: {
goodsName: '', goodsName: '',
goodsType: '', goodsType: '',
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
</div> </div>
</div> </div>
<div class="speci-box" id="specificationDetailList"> <div class="speci-box" id="specificationDetailList">
<singleSpecificationForm ref="singleSpecificationFormRef" v-show="goodsInfoData.specificationType == '1'" :productServiceItemList="productServiceItemList"></singleSpecificationForm> <singleSpecificationForm ref="singleSpecificationFormRef" v-show="goodsInfoData.specificationType == '1'" :productServiceItemList="productServiceItemList" :positionTypeList="positionTypeList"></singleSpecificationForm>
<multipleSpecificationForm ref="multipleSpecificationFormRef" v-show="goodsInfoData.specificationType == '2'" :productServiceItemList="productServiceItemList"></multipleSpecificationForm> <multipleSpecificationForm ref="multipleSpecificationFormRef" v-show="goodsInfoData.specificationType == '2'" :productServiceItemList="productServiceItemList" :positionTypeList="positionTypeList"></multipleSpecificationForm>
</div> </div>
</div> </div>
</div> </div>
...@@ -45,7 +45,8 @@ export default { ...@@ -45,7 +45,8 @@ export default {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
productPositionTypeList: [], productPositionTypeList: [],
productServiceItemList: [] productServiceItemList: [],
positionTypeList: []
} }
}, },
computed: { computed: {
...@@ -56,14 +57,15 @@ export default { ...@@ -56,14 +57,15 @@ export default {
// 多规格 // 多规格
this.goodsInfoData.specificationType = '2' this.goodsInfoData.specificationType = '2'
} }
this.getProductServiceItemList() this.getBaseData()
}, },
methods: { methods: {
...mapActions({ ...mapActions({
get: 'd2admin/base/get' get: 'd2admin/base/get'
}), }),
async getProductServiceItemList() { async getBaseData() {
this.productServiceItemList = await this.get(BaseData.productServiceItemList) this.productServiceItemList = await this.get(BaseData.productServiceItemList)
this.positionTypeList = await this.get(BaseData.positionTypeList)
}, },
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']), ...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
// 新增规格 // 新增规格
......
...@@ -58,7 +58,8 @@ ...@@ -58,7 +58,8 @@
<drawer-detail v-if="drawerDetailVisible" <drawer-detail v-if="drawerDetailVisible"
:drawer-detail-visible="drawerDetailVisible" :drawer-detail-visible="drawerDetailVisible"
:commodity-info-id="commodityDetailInfoId" :commodity-info-id="commodityDetailInfoId"
@handleDrawerClose="handleDrawerClose" /> @handleDrawerClose="handleDrawerClose"
:positionTypeList="positionTypeList"/>
</d2-container> </d2-container>
</template> </template>
...@@ -70,6 +71,7 @@ import { mapActions, mapState } from 'vuex' ...@@ -70,6 +71,7 @@ import { mapActions, mapState } from 'vuex'
import { baseGoodsDelete } from '@api/commodity' import { baseGoodsDelete } from '@api/commodity'
import drawerDetail from './components/drawerDetail.vue' import drawerDetail from './components/drawerDetail.vue'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import { BaseData } from '@/common/constants'
export default { export default {
name: 'Commodity', name: 'Commodity',
data() { data() {
...@@ -219,7 +221,8 @@ export default { ...@@ -219,7 +221,8 @@ export default {
confValue: '草稿' confValue: '草稿'
}] }]
}, },
selfBuildGoodsType: baseConfig.selfBuildGoodsType || '' // 服务商自建类目值 selfBuildGoodsType: baseConfig.selfBuildGoodsType || '', // 服务商自建类目值
positionTypeList: []
} }
}, },
...@@ -250,6 +253,7 @@ export default { ...@@ -250,6 +253,7 @@ export default {
}), }),
...mapActions('d2admin/user', ['actionSetDownloadList']), ...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() { async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.baseData.productTypeList.unshift({ this.baseData.productTypeList.unshift({
categoryType: '', categoryType: '',
categoryName: '全部' categoryName: '全部'
......
...@@ -30,9 +30,8 @@ import { deepClone } from '@/common/util' ...@@ -30,9 +30,8 @@ import { deepClone } from '@/common/util'
import { mapActions, mapGetters, mapMutations } from 'vuex' import { mapActions, mapGetters, mapMutations } from 'vuex'
import sourceMaterial from './components/sourceMaterial.vue' import sourceMaterial from './components/sourceMaterial.vue'
import specifications from './components/specifications.vue' import specifications from './components/specifications.vue'
import { positionTypeList, applicableModelTypeList } from '@/common/constants'
import { addProductManage, UpdateProductManage } from '@api/productManage' import { addProductManage, UpdateProductManage } from '@api/productManage'
import { BaseData, membraneTypeList } from '@/common/constants.js' import { BaseData, membraneTypeList, applicableModelTypeList } from '@/common/constants.js'
import { getGoodsInfoById } from '@api/commodity' import { getGoodsInfoById } from '@api/commodity'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
export default { export default {
...@@ -82,12 +81,14 @@ export default { ...@@ -82,12 +81,14 @@ export default {
editGoodsData: false, editGoodsData: false,
productFormData: { productFormData: {
carTypeList: [1, 2, 3, 4] carTypeList: [1, 2, 3, 4]
} },
positionTypeList: []
} }
}, },
created() { created() {
this.addOrEdit = this.$route.params.addOrEdit this.addOrEdit = this.$route.params.addOrEdit
this.getBaseData()
}, },
mounted() { mounted() {
this.show = false this.show = false
...@@ -110,6 +111,9 @@ export default { ...@@ -110,6 +111,9 @@ export default {
}), }),
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']), ...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
...mapActions({ close: 'd2admin/page/close' }), ...mapActions({ close: 'd2admin/page/close' }),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getGoodsInfo(id) { getGoodsInfo(id) {
getGoodsInfoById({ id: id }).then(res => { getGoodsInfoById({ id: id }).then(res => {
let specificationDetailList = [] let specificationDetailList = []
...@@ -118,9 +122,10 @@ export default { ...@@ -118,9 +122,10 @@ export default {
val?.upgradeGoodsServiceItemsList?.forEach(v => { val?.upgradeGoodsServiceItemsList?.forEach(v => {
v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}`
}) })
console.log(val)
return { return {
id: val.id, id: val.id,
position: val.position, position: (val.position + '')?.split(',')?.map(Number),
purchasePrice: val.purchasePrice, purchasePrice: val.purchasePrice,
specificationData: val.specificationData, specificationData: val.specificationData,
specsValueList: val.specificationData?.split(';~;'), specsValueList: val.specificationData?.split(';~;'),
...@@ -160,7 +165,7 @@ export default { ...@@ -160,7 +165,7 @@ export default {
goodsPositionList: selectedPositions, goodsPositionList: selectedPositions,
goodsName: res.goodsInfo.goodsName, goodsName: res.goodsInfo.goodsName,
applicableModelNames: res.goodsInfo?.goodsType == 1 ? deepClone(applicableModelTypeList).filter(val => res.goodsInfo?.carTypeList?.indexOf(val.confId) > -1).map(item => item.confName).join('/') : '', applicableModelNames: res.goodsInfo?.goodsType == 1 ? deepClone(applicableModelTypeList).filter(val => res.goodsInfo?.carTypeList?.indexOf(val.confId) > -1).map(item => item.confName).join('/') : '',
positionNames: res.goodsInfo?.goodsType == 1 ? deepClone(positionTypeList).filter(val => selectedPositions.indexOf(val.position) > -1).map(item => item.confName).join('/') : '', positionNames: res.goodsInfo?.goodsType == 1 ? deepClone(this.positionTypeList).filter(val => selectedPositions.indexOf(val.position) > -1).map(item => item.confName).join('/') : '',
supplierCode: res.goodsInfo.supplierCode supplierCode: res.goodsInfo.supplierCode
} }
this.productFormData = deepClone(res.goodsInfo) || {} this.productFormData = deepClone(res.goodsInfo) || {}
...@@ -233,7 +238,7 @@ export default { ...@@ -233,7 +238,7 @@ export default {
specsValueList: [item.specificationData], specsValueList: [item.specificationData],
upgradePrice: item.upgradePrice, upgradePrice: item.upgradePrice,
warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : '', // 质保年限 仅膜类 warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : '', // 质保年限 仅膜类
position: productFormData?.goodsType === 1 ? item.position : '', // 部位 仅太阳膜 position: productFormData?.goodsType === 1 ? item.position.join(',') : [], // 部位 仅太阳膜
type: item.type, type: item.type,
thirdPartyCode: item.thirdPartyCode, thirdPartyCode: item.thirdPartyCode,
purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : '', // 采购价 仅上架至采购商城 purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : '', // 采购价 仅上架至采购商城
...@@ -286,7 +291,7 @@ export default { ...@@ -286,7 +291,7 @@ export default {
specificationData: specificationData, specificationData: specificationData,
upgradePrice: item.upgradePrice, upgradePrice: item.upgradePrice,
warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : '', // 质保年限 仅膜类 warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : '', // 质保年限 仅膜类
position: productFormData?.goodsType === 1 ? item.position : '', // 部位 仅太阳膜 position: productFormData?.goodsType === 1 ? item.position?.join(',') : [], // 部位 仅太阳膜
type: item.type, type: item.type,
thirdPartyCode: item.thirdPartyCode, thirdPartyCode: item.thirdPartyCode,
purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : '', // 采购价 仅上架至采购商城 purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : '', // 采购价 仅上架至采购商城
......
...@@ -862,7 +862,7 @@ export default { ...@@ -862,7 +862,7 @@ export default {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === "select") { if (item.type === "select") {
if ( if (
this.baseData[item.optionsName].length && this.baseData[item.optionsName]?.length &&
this.baseData[item.optionsName][0][ this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel this.showFormData[index].optionLabel
] !== "全部" ] !== "全部"
......
...@@ -14,9 +14,11 @@ ...@@ -14,9 +14,11 @@
:label="subItem.label" :label="subItem.label"
class="row-item"> class="row-item">
<div class="" v-if="subItem.isImage"> <div class="" v-if="subItem.isImage">
<img v-if="detailForm[subItem.name]" class="order-img" <div v-if="$$(detailForm[subItem.name], 'length')">
:src="detailForm[subItem.name]" <img v-for="(subVal, subKey) in detailForm[subItem.name]" :key="subKey" class="order-img"
@click="handleEnlargeImg(detailForm[subItem.name])"> :src="subVal"
@click="handleEnlargeImg(subVal)">
</div>
<span v-else>-</span> <span v-else>-</span>
</div> </div>
<span v-else class="detail-txt ellipsis-1" <span v-else class="detail-txt ellipsis-1"
...@@ -114,7 +116,7 @@ ...@@ -114,7 +116,7 @@
<el-dialog :visible="imgVisible" <el-dialog :visible="imgVisible"
:before-close="handleEnlargeImg"> :before-close="handleEnlargeImg">
<img width="100%" <img width="100%"
:src="detailForm.payVoucher" :src="previewImgUrl"
alt="图片"> alt="图片">
</el-dialog> </el-dialog>
</d2-container> </d2-container>
...@@ -193,7 +195,8 @@ export default { ...@@ -193,7 +195,8 @@ export default {
] ]
}, },
hideStatus: false, hideStatus: false,
imgVisible: false // 收款凭证图片弹窗 imgVisible: false, // 收款凭证图片弹窗
previewImgUrl: ''
} }
}, },
...@@ -212,7 +215,7 @@ export default { ...@@ -212,7 +215,7 @@ export default {
}, },
{ {
label: "商户订单号", label: "商户订单号",
name: "outTradeNo" name: "transactionReferenceId"
}, },
{ {
label: "订单时间", label: "订单时间",
...@@ -293,7 +296,7 @@ export default { ...@@ -293,7 +296,7 @@ export default {
}, },
{ {
label: '收款凭证', label: '收款凭证',
name: 'payVoucher', name: 'payVoucherList', // 后端返回对应字段是payVoucher用','隔开
isImage: true isImage: true
} }
] ]
...@@ -323,6 +326,7 @@ export default { ...@@ -323,6 +326,7 @@ export default {
orderManage orderManage
.getOrderDetailApi({ orderCode: this.routeInfo.orderCode }) .getOrderDetailApi({ orderCode: this.routeInfo.orderCode })
.then((res) => { .then((res) => {
res.payVoucherList = res?.payVoucher?.split(',') || []
this.detailForm = res this.detailForm = res
this.orderRefund = res.orderRefund || null this.orderRefund = res.orderRefund || null
this.detailForm.createdDateStr = Util.dateFormate( this.detailForm.createdDateStr = Util.dateFormate(
...@@ -416,8 +420,9 @@ export default { ...@@ -416,8 +420,9 @@ export default {
this.formToRow("detailFormData") this.formToRow("detailFormData")
}) })
}, },
handleEnlargeImg() { handleEnlargeImg(url) {
this.imgVisible = !this.imgVisible this.imgVisible = !this.imgVisible
this.previewImgUrl = url
}, },
handleCancel() { handleCancel() {
this.$router.push({ this.$router.push({
...@@ -471,6 +476,7 @@ export default { ...@@ -471,6 +476,7 @@ export default {
.order-detail .row-item .order-img { .order-detail .row-item .order-img {
width: 80px; width: 80px;
height: 80px; height: 80px;
margin-right: 8px;
cursor: pointer; cursor: pointer;
} }
.detail-txt { .detail-txt {
......
...@@ -98,6 +98,13 @@ ...@@ -98,6 +98,13 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="部位" align="center" width="150" prop="subOrderList">
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p>{{ item.positionStr }}</p>
</span>
</template>
</el-table-column>
<el-table-column label="商品别名" align="center" width="150" prop="subOrderList"> <el-table-column label="商品别名" align="center" width="150" prop="subOrderList">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index"> <span v-for="(item, index) in scope.row.subOrderList" :key="index">
...@@ -522,7 +529,8 @@ export default { ...@@ -522,7 +529,8 @@ export default {
subShopMerchanShowHide: true, subShopMerchanShowHide: true,
ruleVisible: false, ruleVisible: false,
recordInfo: null, recordInfo: null,
ruleInfoVisible: false ruleInfoVisible: false,
positionTypeList: []
} }
}, },
computed: { computed: {
...@@ -601,6 +609,7 @@ export default { ...@@ -601,6 +609,7 @@ export default {
...mapMutations('d2admin/user', ['setUpdateRefesh']), ...mapMutations('d2admin/user', ['setUpdateRefesh']),
...mapActions("d2admin/base", ["get"]), ...mapActions("d2admin/base", ["get"]),
async getBaseData() { async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.baseData.channelTypeList = await this.get(BaseData.channelType) this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.getOptionsList() this.getOptionsList()
}, },
...@@ -715,7 +724,7 @@ export default { ...@@ -715,7 +724,7 @@ export default {
getOptionsList() { getOptionsList() {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') { if (this.baseData[item.optionsName]?.length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {} const temp = {}
temp[this.showFormData[index].optionId] = '' temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部' temp[this.showFormData[index].optionLabel] = '全部'
...@@ -753,6 +762,9 @@ export default { ...@@ -753,6 +762,9 @@ export default {
getList(params).then(res => { getList(params).then(res => {
this.tableData = res.list.map((item) => { this.tableData = res.list.map((item) => {
item.paySuccessDate = item.paySuccessDate ? Util.dateFormate(item.paySuccessDate, 'YYYY-MM-DD HH:mm:ss') : '' item.paySuccessDate = item.paySuccessDate ? Util.dateFormate(item.paySuccessDate, 'YYYY-MM-DD HH:mm:ss') : ''
item.subOrderList?.forEach(val => {
val.positionStr = this.positionTypeList?.filter(subItem => val?.upgradeGoodsPosition == subItem.position)[0]?.confName || '-'
})
return item return item
}) })
this.page.pageNum = res.pageNum this.page.pageNum = res.pageNum
......
...@@ -165,6 +165,9 @@ ...@@ -165,6 +165,9 @@
<el-table-column :prop="'upgradeGoodsName'" <el-table-column :prop="'upgradeGoodsName'"
align="center" align="center"
label="商品名称" /> label="商品名称" />
<el-table-column :prop="'positionStr'"
align="center"
label="部位" />
<el-table-column :prop="'upgradeGoodsAlias'" <el-table-column :prop="'upgradeGoodsAlias'"
align="center" align="center"
label="商品别名" /> label="商品别名" />
...@@ -265,7 +268,7 @@ ...@@ -265,7 +268,7 @@
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import signRefundDialog from './signRefundDialog' import signRefundDialog from './signRefundDialog'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { payType } from '@/common/constants.js' import { payType, BaseData } from '@/common/constants.js'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { goodsOrderDetail } from '@api/order' import { goodsOrderDetail } from '@api/order'
export default { export default {
...@@ -326,7 +329,8 @@ export default { ...@@ -326,7 +329,8 @@ export default {
page: { page: {
pageNum: 1, pageNum: 1,
pageSize: 20 pageSize: 20
} },
positionTypeList: []
} }
}, },
computed: { computed: {
...@@ -336,13 +340,14 @@ export default { ...@@ -336,13 +340,14 @@ export default {
}, },
mounted() { mounted() {
this.signRefundFlag = this.$route.params.signRefundFlag this.signRefundFlag = this.$route.params.signRefundFlag
this.getBaseData()
this.getGoodsOrderDetail() this.getGoodsOrderDetail()
console.log(this.detail) console.log(this.detail)
}, },
methods: { methods: {
...mapActions({ close: 'd2admin/page/close' }), ...mapActions({ close: 'd2admin/page/close' }),
...mapActions("d2admin/base", ["get"]),
// arraySpanMethod({ row, column, rowIndex, columnIndex }) { // arraySpanMethod({ row, column, rowIndex, columnIndex }) {
// if (rowIndex === 1) { // if (rowIndex === 1) {
// if (columnIndex === 0) { // if (columnIndex === 0) {
...@@ -355,6 +360,9 @@ export default { ...@@ -355,6 +360,9 @@ export default {
// getTotalNums() { // getTotalNums() {
// return this.detail.subOrderList.reduce((prev, item) => prev + item.nums, 0) // return this.detail.subOrderList.reduce((prev, item) => prev + item.nums, 0)
// }, // },
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
handleEnlargeImg(url) { handleEnlargeImg(url) {
this.imgVisible = !this.imgVisible this.imgVisible = !this.imgVisible
this.previewImgUrl = url this.previewImgUrl = url
...@@ -409,7 +417,9 @@ export default { ...@@ -409,7 +417,9 @@ export default {
const routerParams = this.$route.params.detail const routerParams = this.$route.params.detail
goodsOrderDetail({ orderCode: routerParams?.orderCode }).then(res => { goodsOrderDetail({ orderCode: routerParams?.orderCode }).then(res => {
console.log(res) res?.subOrderList?.forEach(item => {
item.positionStr = this.positionTypeList?.filter(val => item?.upgradeGoodsPosition == val.position)[0]?.confName || '-'
})
const clientSignatureDTOList = res?.clientSignatureDTOList[0] || [] const clientSignatureDTOList = res?.clientSignatureDTOList[0] || []
this.detail = Object.assign(clientSignatureDTOList, res) this.detail = Object.assign(clientSignatureDTOList, res)
if (this.detail.source == 7) { if (this.detail.source == 7) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!