Commit 08f84ca2 by zhangxw

4.18.2紧急版本需求开发

1 parent 24f38147
...@@ -122,3 +122,15 @@ export function saveTempGoods(data) { ...@@ -122,3 +122,15 @@ export function saveTempGoods(data) {
data.method = `${path}basegoods.saveTemp` data.method = `${path}basegoods.saveTemp`
return request(data, "post") return request(data, "post")
} }
// 查询升级商品别名列表
export function getUpgradeGoodsAliasList(data) {
data.method = `${path}smartcarlife.merchantUpgradeGoodsAlias.listByMerchantGoodsRef`
return request(data)
}
// 升级商品别名保存
export function saveUpgradeGoodsAlias(data) {
data.method = `${path}smartcarlife.merchantUpgradeGoodsAlias.save`
return request(data)
}
...@@ -326,14 +326,17 @@ export default { ...@@ -326,14 +326,17 @@ export default {
shopPriceArr.push(v.upgradePrice) shopPriceArr.push(v.upgradePrice)
v.listShowShopPrice = v.upgradePrice v.listShowShopPrice = v.upgradePrice
v.listShowStock = v.stock v.listShowStock = v.stock
v.listShowSpecificationData = v.specificationData ? v.specificationData.replace(/;~;/g, ' ') : '' v.listShowSpecificationData = val.goodsSpecificationNameList?.length > 1 ? v.specificationData.replace(/;~;/g, ' ') : '-'
v.goodsInfo.goodsName = val.baseGoodsName || v.goodsInfo.goodsName // 新数据显示商品名称,历史商品数据显示素材名称 v.goodsInfo.goodsName = v.upgradeGoodsName
v.goodsInfo.productName = val.goodsInfo.goodsName
stockTotal += v.stock stockTotal += v.stock
v.goodsSpecificationNameList = val.goodsSpecificationNameList
v.upgradeGoodsMerchantRefList = val.upgradeGoodsMerchantRefList
}) })
const minPrice = shopPriceArr.length ? Math.min(...shopPriceArr) : 0 const minPrice = shopPriceArr.length ? Math.min(...shopPriceArr) : 0
const maxPrice = shopPriceArr.length ? Math.max(...shopPriceArr) : 0 const maxPrice = shopPriceArr.length ? Math.max(...shopPriceArr) : 0
// 父商品规格数量 // 父商品规格数量
val.listShowSpecificationData = val.upgradeGoodsList && val.upgradeGoodsList.length > 0 ? 'X' + val.upgradeGoodsList.length : '' val.listShowSpecificationData = val.goodsSpecificationNameList?.length > 1 && val.upgradeGoodsList?.length > 0 ? 'X' + val.upgradeGoodsList.length : '-'
val.listShowShopPrice = minPrice == maxPrice ? maxPrice : minPrice + '~' + maxPrice val.listShowShopPrice = minPrice == maxPrice ? maxPrice : minPrice + '~' + maxPrice
val.listShowStock = stockTotal val.listShowStock = stockTotal
}) })
......
...@@ -158,6 +158,12 @@ export const routerName = { ...@@ -158,6 +158,12 @@ export const routerName = {
1: "单独下架" 1: "单独下架"
} }
} }
},
{
authId: "9030209",
parentId: "90302",
label: "商品别名设置",
handle: "handleSettingShopAlias"
} }
], ],
component: _import("goods/commodity") component: _import("goods/commodity")
......
...@@ -117,10 +117,14 @@ ...@@ -117,10 +117,14 @@
<div v-else <div v-else
slot="auth-button-other" slot="auth-button-other"
slot-scope="scope"> slot-scope="scope">
<span v-show="showAloneUpOrDownBT(scope.scope)"> <span style="margin-right: 10px;" v-show="showAloneUpOrDownBT(scope.scope)">
<auth-button :data="scope.scope" <auth-button :data="scope.scope"
:show-btn-ids="['9030208']" /> :show-btn-ids="['9030208']" />
</span> </span>
<span>
<auth-button :data="scope.scope"
:show-btn-ids="['9030209']" />
</span>
</div> </div>
</d2-table> </d2-table>
</div> </div>
...@@ -139,13 +143,20 @@ ...@@ -139,13 +143,20 @@
:drawer-detail-visible="drawerDetailVisible" :drawer-detail-visible="drawerDetailVisible"
:commodity-info-id="commodityDetailInfoId" :commodity-info-id="commodityDetailInfoId"
@handleDrawerClose="handleDrawerClose" /> @handleDrawerClose="handleDrawerClose" />
<!-- 商品别名 -->
<shop-alias-setting
v-if="shopAliasVisible"
:shop-alias-visible="shopAliasVisible"
:shop-alias-info="shopAliasInfo"
@handleShopAliasClose="handleShopAliasClose"
@handleShopAliasConfirm="handleShopAliasConfirm"/>
</d2-container> </d2-container>
</template> </template>
<script> <script>
// exportBaseList // exportBaseList
import { deepClone } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { getList, baseGoodsUpOrDown, baseGoodsDelete, baseGoodsUpOrDownForChild, getBaseGoodsList, commodityAddSeviceMerchant } from '@api/commodity' import { getList, baseGoodsUpOrDown, baseGoodsDelete, baseGoodsUpOrDownForChild, getBaseGoodsList, commodityAddSeviceMerchant, getUpgradeGoodsAliasList, saveUpgradeGoodsAlias } from '@api/commodity'
import { getProductTypeBySceneId } from '@api/product' import { getProductTypeBySceneId } from '@api/product'
import { getParkStore } from '@api/editCustomer' import { getParkStore } from '@api/editCustomer'
import { BaseData, brandMerchantList, sceneCodeList } from '@/common/constants.js' import { BaseData, brandMerchantList, sceneCodeList } from '@/common/constants.js'
...@@ -154,6 +165,7 @@ import { mapActions, mapState } from 'vuex' ...@@ -154,6 +165,7 @@ import { mapActions, mapState } from 'vuex'
// import _ from 'lodash' // import _ from 'lodash'
import storeDetail from './storeDetail' import storeDetail from './storeDetail'
import drawerDetail from './drawerDetail' import drawerDetail from './drawerDetail'
import shopAliasSetting from "./shopAliasSetting"
// import { asyncExportExcel } from '@api/sys.base' // import { asyncExportExcel } from '@api/sys.base'
export default { export default {
name: 'Commodity', name: 'Commodity',
...@@ -181,6 +193,12 @@ export default { ...@@ -181,6 +193,12 @@ export default {
isClear: true, isClear: true,
keyFn: this.keyDowmGetList keyFn: this.keyDowmGetList
}, { }, {
label: '商品别名',
name: 'upgradeGoodsAlias',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '所属场景', label: '所属场景',
name: 'sceneType', name: 'sceneType',
type: 'select', type: 'select',
...@@ -365,6 +383,13 @@ export default { ...@@ -365,6 +383,13 @@ export default {
label: '创建日期', label: '创建日期',
prop: 'createDateStr', prop: 'createDateStr',
width: '155px' width: '155px'
}, {
label: '更新日期',
prop: 'updatedDate',
width: '155px',
formatter: (cellValue) => {
return cellValue.updatedDate ? Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
}
} }
] ]
}, },
...@@ -405,13 +430,16 @@ export default { ...@@ -405,13 +430,16 @@ export default {
}, },
showMoreData: {}, showMoreData: {},
showMoreVisible: false, showMoreVisible: false,
sceneCodeList: [] sceneCodeList: [],
shopAliasVisible: false,
shopAliasInfo: {}
} }
}, },
components: { components: {
storeDetail, storeDetail,
drawerDetail drawerDetail,
shopAliasSetting
}, },
computed: { computed: {
...@@ -450,6 +478,8 @@ export default { ...@@ -450,6 +478,8 @@ export default {
currentPage: 1, currentPage: 1,
pageSize: 9999 pageSize: 9999
}).then(res => { }).then(res => {
let arr = res.list.find(val => val.merchantId == '44211544')
console.log(arr)
this.baseData.merchantServiceList = res.list this.baseData.merchantServiceList = res.list
this.getOptionsList() this.getOptionsList()
}) })
...@@ -669,6 +699,35 @@ export default { ...@@ -669,6 +699,35 @@ export default {
} }
} }
}, },
// 单规格子商品 设置商品别名
handleSettingShopAlias(row) {
getUpgradeGoodsAliasList({ upgradeGoodsId: row.id }).then(res => {
this.shopAliasVisible = true
row.upgradeGoodsMerchantList = res
this.shopAliasInfo = row
})
},
handleShopAliasClose() {
this.shopAliasVisible = false
},
handleShopAliasConfirm(data) {
// 保存接口
let list = []
data?.upgradeGoodsMerchantList?.forEach(val => {
list.push({
upgradeGoodsId: data.id,
alias: val.alias,
yqMerchantId: val.yqMerchantId,
merchantId: val.merchantId
})
})
saveUpgradeGoodsAlias({ list }).then(res => {
this.notice.okTips()
this.shopAliasVisible = false
this.$refs.commodityTable.refreshTable()
})
},
handleDetail(row) { handleDetail(row) {
this.detailData = deepClone(row) this.detailData = deepClone(row)
this.detailVisible = true this.detailVisible = true
......
...@@ -74,7 +74,8 @@ ...@@ -74,7 +74,8 @@
</el-popover> </el-popover>
</el-input> </el-input>
</td> </td>
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0"> <!-- 仅分发至单店时,隐藏采购价/卷,无需填写 -->
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0 && goodsInfoData.shoppingMallFlag !== '0'">
<span class="color-red">*</span> <span class="color-red">*</span>
<el-input <el-input
style="width: 80px;" style="width: 80px;"
...@@ -288,7 +289,7 @@ ...@@ -288,7 +289,7 @@
</el-popover> </el-popover>
</el-input> </el-input>
</td> </td>
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0 && goodsInfoData.shoppingMallFlag !== '0'">
<el-input placeholder="采购价" <el-input placeholder="采购价"
size="small" size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': (filterEmpty(subItem.purchasePrice) || !subItem.purchasePrice) && subItem.purchasePriceEmpty }" :class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': (filterEmpty(subItem.purchasePrice) || !subItem.purchasePrice) && subItem.purchasePriceEmpty }"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<span class="color-red">*</span> <span class="color-red">*</span>
<span>成本/元</span> <span>成本/元</span>
</td> </td>
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0 && goodsInfoData.shoppingMallFlag !== '0'">
<span class="color-red">*</span> <span class="color-red">*</span>
<span>采购价/卷</span> <span>采购价/卷</span>
</td> </td>
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
</el-popover> </el-popover>
</el-input> </el-input>
</td> </td>
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0 && goodsInfoData.shoppingMallFlag !== '0'">
<el-input placeholder="采购价" <el-input placeholder="采购价"
size="small" size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.purchasePrice) && subItem.purchasePriceEmpty }" :class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.purchasePrice) && subItem.purchasePriceEmpty }"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<div class="sync_type_class"> <div class="sync_type_class">
<span>同步至采购商城:</span> <span>同步至采购商城:</span>
<el-radio-group v-model="goodsInfoData.shoppingMallFlag"> <el-radio-group v-model="goodsInfoData.shoppingMallFlag">
<el-radio :label="'1'">采购上架及自营使用</el-radio> <el-radio :label="'1'">采购上架及分发至单店</el-radio>
<el-radio :label="'0'">仅分发至单店</el-radio> <el-radio :label="'0'">仅分发至单店</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
......
...@@ -341,6 +341,8 @@ export default { ...@@ -341,6 +341,8 @@ export default {
} else { // 其余商品类型 采购价 质保必填 } else { // 其余商品类型 采购价 质保必填
specialList = ['purchasePrice', 'warrantyPeriod'] specialList = ['purchasePrice', 'warrantyPeriod']
} }
// 仅分发至单店时,隐藏采购价/卷,无需填写
if (this.goodsInfoData.shoppingMallFlag === '0') specialList.splice(specialList.indexOf('purchasePrice'), 1)
let requiredList = ['specificationData', 'shopPrice', ...specialList, 'shopMinPrice', 'upgradePrice'] let requiredList = ['specificationData', 'shopPrice', ...specialList, 'shopMinPrice', 'upgradePrice']
for (var i = 0; i < confirmShopData.length; i++) { for (var i = 0; i < confirmShopData.length; i++) {
const item = confirmShopData[i] const item = confirmShopData[i]
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<script> <script>
// import _ from 'lodash' // import _ from 'lodash'
import { deepClone } from '@/common/util' import { deepClone, Util } from '@/common/util'
// exportGoodsList // exportGoodsList
import { getList, deleteGoods, checkDeleteGoods, getProductTypeBySceneId } from '@api/product' import { getList, deleteGoods, checkDeleteGoods, getProductTypeBySceneId } from '@api/product'
import { BaseData, brandMerchantList, sceneCodeList } from '@/common/constants.js' import { BaseData, brandMerchantList, sceneCodeList } from '@/common/constants.js'
...@@ -175,6 +175,13 @@ export default { ...@@ -175,6 +175,13 @@ export default {
{ {
label: '创建日期', label: '创建日期',
prop: 'createDateStr' prop: 'createDateStr'
},
{
label: '更新日期',
prop: 'updatedDate',
formatter: (cellValue) => {
return cellValue.updatedDate ? Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
}
} }
// { // {
// label: '状态', // label: '状态',
......
<template>
<d2-dialog title="商品别名设置"
:is-visible.sync="shopAliasVisible"
width="60%"
btn-ok-label="保存"
@confirmDialog="handleShopAliasConfirm"
@closeDialog="handleShopAliasClose"
class="relateStore">
<slot />
<el-row class="tableCon">
<div class="tableBox">
<div class="title">
<span class="message-item-span">
<span class="label">商品名称:</span>
{{ shopAliasInfo.goodsInfo.goodsName || '--' }}
</span>
<span class="message-item-span">
<span class="label">所属系列:</span>
{{ shopAliasInfo.goodsInfo.productName || '--' }}
</span>
<span class="message-item-span">
<span class="label">商品类目:</span>
{{ shopAliasInfo.goodsInfo.goodsTypeName || '--' }}
</span>
</div>
<el-table
:data="shopAliasInfo.upgradeGoodsMerchantList"
height="464px"
class="table"
border>
<el-table-column prop="merchantName"
label="门店名称"
align="center">
</el-table-column>
<el-table-column prop="yqMerchantName"
label="园区店名称"
align="center">
</el-table-column>
<el-table-column prop=""
label="商品别名"
align="center">
<template scope="scope">
<el-input size="small" style="width: 80%;" maxlength="20" v-model.trim="scope.row.alias" placeholder="请输入商品别名"
@change="handleCellEdit(scope.$index, scope.row)"></el-input>
</template>
</el-table-column>
</el-table>
</div>
</el-row>
</d2-dialog>
</template>
<script>
export default {
name: 'ShopAliasSetting',
data() {
return {
}
},
props: {
shopAliasVisible: {
type: Boolean,
default: false
},
shopAliasInfo: {
type: Object,
default: {}
}
},
mounted() {
},
methods: {
handleCellEdit(e, index) {
console.log(e, index)
},
handleShopAliasConfirm() {
this.$emit('handleShopAliasConfirm', this.shopAliasInfo)
},
handleShopAliasClose() {
this.$emit('handleShopAliasClose')
}
}
}
</script>
<style lang="scss" scoped>
.title{
display: flex;
margin: 15px;
.message-item-span{
flex: 1;
}
}
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!