Commit fb9f398f by 张立顺

Merge branch 'SAAS+V4.56.2' into SAAS+V5.8.2

2 parents 23cf8190 2d8af330
...@@ -171,9 +171,13 @@ export default { ...@@ -171,9 +171,13 @@ export default {
}) })
}, },
getSelectingList() { getSelectingList() {
console.log(this.upgradeGoodsInfo, 'this.upgradeGoodsInfo') const upgradeGoodsId = this.upgradeGoodsInfo.upgradeGoodsId || this.upgradeGoodsInfo.id
if (!upgradeGoodsId) {
this.carLoading = false
return
}
this.carLoading = true this.carLoading = true
this.$apis.purchaseShopping.getCanSelectCarBrandList({ upgradeGoodsId: this.upgradeGoodsInfo.upgradeGoodsId || this.upgradeGoodsInfo.upgradeGoodsList[0].id }).then(res => { this.$apis.purchaseShopping.getCanSelectCarBrandList({ upgradeGoodsId }).then(res => {
console.log(res, 'getSelectingList') console.log(res, 'getSelectingList')
this.carLoading = false this.carLoading = false
this.options = res.data this.options = res.data
......
<template> <template>
<div> <div>
<GLDialog destroy-on-close="true" :visible.sync="dialogShow" :hasFooter="false" mode="big" bigTitle="产品详情" :close-on-click-modal="false" @onOk="handleSubmit" @onCancel="handleDetailClose"> <GLDialog destroy-on-close="true" :visible.sync="dialogShow" :hasFooter="false" mode="big" bigTitle="产品详情"
:close-on-click-modal="false" @onOk="handleSubmit" @onCancel="handleDetailClose">
<div class="detail-content"> <div class="detail-content">
<!-- 商品详情 --> <!-- 商品详情 -->
<div class="goodsInfoCom"> <div class="goodsInfoCom">
...@@ -19,17 +20,22 @@ ...@@ -19,17 +20,22 @@
<span class="num">{{ goodsInfo.purchaseOrderCount || 0 }}笔</span> <span class="num">{{ goodsInfo.purchaseOrderCount || 0 }}笔</span>
</span> </span>
</div> </div>
<div class="productCode" v-if="goodsInfo.upgradeGoodsList && goodsInfo.upgradeGoodsList.length > 0">产品编码:{{ goodsInfo.upgradeGoodsList[selectIndex].type }}</div> <div class="productCode" v-if="goodsInfo.upgradeGoodsList && goodsInfo.upgradeGoodsList.length > 0">产品编码:{{
goodsInfo.upgradeGoodsList[selectIndex].type }}</div>
<!--选择商品规格多规格 v-if="!isSkuArguments"--> <!--选择商品规格多规格 v-if="!isSkuArguments"-->
<div class="content fix-header fix-bottom" v-if="goodsInfo.specificationType == 2"> <div class="content fix-header fix-bottom" v-if="goodsInfo.specificationType == 2">
<div class="mask"> <div class="mask">
<div class="mask-content"> <div class="mask-content">
<div class="spec-items"> <div class="spec-items">
<div class="spec-menu-item js-spec-menu skuCon" v-for="(item, index) in goodsTypeList" :key="item.id"> <div class="spec-menu-item js-spec-menu skuCon" v-for="(item, index) in goodsTypeList"
:key="item.id">
<div class="spec-note label">{{ item.name }}:</div> <div class="spec-note label">{{ item.name }}:</div>
<div class="spec-choices"> <div class="spec-choices">
<span v-for="(el, i) in item.propertyList" :key="el.id" class="spec-nor skuItem one-line-ellipsis pointer" :class="{ active: el.selected, disabled: el.disabled }" @click="handleClickSpecs1(item.id, el.id, el, index, i)">{{ el.name }}</span> <span v-for="(el, i) in item.propertyList" :key="el.id"
class="spec-nor skuItem one-line-ellipsis pointer"
:class="{ active: el.selected, disabled: el.disabled }"
@click="handleClickSpecs1(item.id, el.id, el, index, i)">{{ el.name }}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -40,7 +46,8 @@ ...@@ -40,7 +46,8 @@
<div class="skuCon" v-if="goodsInfo.specificationType == 1"> <div class="skuCon" v-if="goodsInfo.specificationType == 1">
<div class="label">规格:</div> <div class="label">规格:</div>
<div class="itemCon"> <div class="itemCon">
<div class="skuItem one-line-ellipsis pointer" :class="{ active: index === selectIndex }" v-for="(item, index) in goodsInfo.upgradeGoodsList" :key="index" @click="singleClick(item, index)"> <div class="skuItem one-line-ellipsis pointer" :class="{ active: index === selectIndex }"
v-for="(item, index) in goodsInfo.upgradeGoodsList" :key="index" @click="singleClick(item, index)">
{{ item.purchaseGoodsName || item.thirdPartyName || item.upgradeGoodsName }} {{ item.purchaseGoodsName || item.thirdPartyName || item.upgradeGoodsName }}
</div> </div>
</div> </div>
...@@ -55,11 +62,15 @@ ...@@ -55,11 +62,15 @@
{{ membraneTypeList.includes(goodsInfo.goodsType) ? `卷(1卷=${goodsInfo.convertedValue || 30}米)` : '件' }} {{ membraneTypeList.includes(goodsInfo.goodsType) ? `卷(1卷=${goodsInfo.convertedValue || 30}米)` : '件' }}
</div> </div>
</div> </div>
<div class="munCom" v-if="upgradeGoodsInfo.suitCarType == 2"> <div class="munCom" v-if="selectedUpgradeGoods && selectedUpgradeGoods.suitCarType == 2">
<div class="label">适用车型:</div> <div class="label">适用车型:</div>
<div class="munItem car-select"> <div class="munItem car-select">
<el-select ref="choose" :clearable="false" width="300" collapse-tags multiple @focus="handleCarDialog" value-key="carTypeId" v-model="goodsInfo.suitCarTypeList" style="margin-left: 20px;width: 300px;" placeholder="请选择"> <el-select ref="choose" :clearable="false" width='300' collapse-tags multiple @focus="handleCarDialog"
<el-option v-for="children in goodsInfo.suitCarTypeList" :key="children.carTypeId" :label="children.carTypeName" :value="children"></el-option> :disabled="!isGoodsSelected" value-key="carTypeId" v-model="goodsInfo.suitCarTypeList"
style="margin-left: 20px;width: 300px;" placeholder="请选择">
<el-option v-for="(children) in goodsInfo.suitCarTypeList" :key="children.carTypeId"
:label="children.carTypeName" :value="children">
</el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
...@@ -83,7 +94,9 @@ ...@@ -83,7 +94,9 @@
</div> </div>
</div> </div>
</GLDialog> </GLDialog>
<carBandDialog v-if="relateStoreVisible" :upgradeGoodsInfo="goodsInfo" @handleRelateStoreConfirm="handleConfirm" :relateStoreVisible.sync="relateStoreVisible" :goodsInfo="goodsInfo"></carBandDialog> <carBandDialog v-if="relateStoreVisible" :upgradeGoodsInfo="carBandUpgradeGoodsInfo"
@handleRelateStoreConfirm="handleConfirm" :relateStoreVisible.sync="relateStoreVisible" :goodsInfo="goodsInfo">
</carBandDialog>
</div> </div>
</template> </template>
...@@ -538,7 +551,7 @@ export default { ...@@ -538,7 +551,7 @@ export default {
}, },
selectItemInfo: { selectItemInfo: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
goodsId: { goodsId: {
type: [String, Number] type: [String, Number]
...@@ -626,6 +639,29 @@ export default { ...@@ -626,6 +639,29 @@ export default {
set(val) { set(val) {
this.$emit('update:visible', val) this.$emit('update:visible', val)
} }
},
isGoodsSelected() {
if (this.goodsInfo.specificationType == 2) {
return this.selectItemList.length === this.goodsTypeList.length && this.goodsTypeList.length > 0
}
return !!this.handleItemInfo.upgradeGoodsId
},
selectedUpgradeGoods() {
if (!this.isGoodsSelected) {
return null
}
if (this.goodsInfo.specificationType == 2) {
return this.upgradeGoodsInfo
}
return this.goodsInfo.upgradeGoodsList?.[this.selectIndex] || this.upgradeGoodsInfo
},
carBandUpgradeGoodsInfo() {
const selected = this.selectedUpgradeGoods || {}
return {
...selected,
upgradeGoodsId: selected.id,
suitCarTypeList: this.goodsInfo.suitCarTypeList || []
}
} }
}, },
watch: { watch: {
...@@ -642,6 +678,7 @@ export default { ...@@ -642,6 +678,7 @@ export default {
}, },
methods: { methods: {
singleClick(item, index) { singleClick(item, index) {
this.goodsInfo.suitCarTypeList = []
this.setHandleItemInfo(item) this.setHandleItemInfo(item)
this.selectIndex = index this.selectIndex = index
this.upgradeGoodsInfo = item this.upgradeGoodsInfo = item
...@@ -651,7 +688,10 @@ export default { ...@@ -651,7 +688,10 @@ export default {
this.goodsInfo.suitCarTypeList = list this.goodsInfo.suitCarTypeList = list
}, },
handleCarDialog() { handleCarDialog() {
console.log('handleCarDialog') if (!this.isGoodsSelected) {
this.$message.warning('请先选择商品规格')
return
}
this.$refs.choose.blur() this.$refs.choose.blur()
this.relateStoreVisible = true this.relateStoreVisible = true
}, },
...@@ -761,12 +801,13 @@ export default { ...@@ -761,12 +801,13 @@ export default {
this.upgradeGoodsInfo = this.orgData.upgradeGoodsList.find(item => item.specificationData == spcName) this.upgradeGoodsInfo = this.orgData.upgradeGoodsList.find(item => item.specificationData == spcName)
console.log(this.upgradeGoodsInfo, ' this.upgradeGoodsInfo') console.log(this.upgradeGoodsInfo, ' this.upgradeGoodsInfo')
} }
// this.upgradeGoodsInfo = selectSpc.suitCarType
this.handleItemInfo.purchasePrice = skusItem.purchasePrice this.handleItemInfo.purchasePrice = skusItem.purchasePrice
//goodsInfo upgradeGoodsList suitCarType this.handleItemInfo.upgradeGoodsId = this.upgradeGoodsInfo?.id || ''
} else { } else {
this.handleItemInfo.purchasePrice = '' this.handleItemInfo.purchasePrice = ''
this.handleItemInfo.upgradeGoodsId = ''
} }
this.goodsInfo.suitCarTypeList = []
// 取出组ID // 取出组ID
let x_selected_grounpIds = [] let x_selected_grounpIds = []
selectItemList.forEach(item => { selectItemList.forEach(item => {
...@@ -889,7 +930,9 @@ export default { ...@@ -889,7 +930,9 @@ export default {
this.setHandleItemInfo(item) this.setHandleItemInfo(item)
} }
console.log(res?.upgradeGoodsList, 'res?.upgradeGoodsList') console.log(res?.upgradeGoodsList, 'res?.upgradeGoodsList')
this.upgradeGoodsInfo = res?.upgradeGoodsList[0] if (res?.specificationType != 2) {
this.upgradeGoodsInfo = res?.upgradeGoodsList[0]
}
}) })
}, },
setHandleItemInfo(item = {}) { setHandleItemInfo(item = {}) {
...@@ -958,7 +1001,7 @@ export default { ...@@ -958,7 +1001,7 @@ export default {
} }
} }
// 如果是专用商品 但没有选适配车型 // 如果是专用商品 但没有选适配车型
if (this.upgradeGoodsInfo.suitCarType == 2 && !this.goodsInfo.suitCarTypeList?.length) { if (this.selectedUpgradeGoods?.suitCarType == 2 && !this.goodsInfo.suitCarTypeList?.length) {
return this.$message({ return this.$message({
message: '请完善商品适用车型', message: '请完善商品适用车型',
type: 'error', type: 'error',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!