Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e5cd6787
authored
Jul 28, 2026
by
wangzhihui
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed
1 parent
6930beeb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
22 deletions
src/views/goods/grounding/constants/data.js
src/views/goods/grounding/utils/productCost.js
src/views/goods/grounding/views/modify/index.vue
src/views/goods/packageManage/components/packageForm/index.vue
src/views/goods/grounding/constants/data.js
View file @
e5cd678
...
@@ -135,7 +135,7 @@ export const packageGoodsForm = [
...
@@ -135,7 +135,7 @@ export const packageGoodsForm = [
isClear
:
false
,
isClear
:
false
,
optionList
:
[],
optionList
:
[],
optionId
:
"serviceItemId"
,
optionId
:
"serviceItemId"
,
optionLabel
:
"serviceItem
sName
"
,
optionLabel
:
"serviceItem
DisplayLabel
"
,
width
:
"432px"
,
width
:
"432px"
,
},
},
{
{
...
...
src/views/goods/grounding/utils/productCost.js
View file @
e5cd678
...
@@ -40,6 +40,35 @@ export function shouldShowServiceItem(goodsType) {
...
@@ -40,6 +40,35 @@ export function shouldShowServiceItem(goodsType) {
return
SERVICE_ITEM_GOODS_TYPES
.
includes
(
Number
(
goodsType
));
return
SERVICE_ITEM_GOODS_TYPES
.
includes
(
Number
(
goodsType
));
}
}
/** 服务项目下拉展示:服务名称/用料标准 */
export
function
formatServiceItemOptionLabel
(
item
=
{})
{
const
serviceItemsName
=
item
.
serviceItemsName
const
materialStandard
=
item
.
materialStandard
if
(
!
serviceItemsName
&&
!
materialStandard
)
{
return
""
;
}
if
(
!
materialStandard
)
{
return
serviceItemsName
;
}
if
(
!
serviceItemsName
)
{
return
materialStandard
;
}
return
`
${
serviceItemsName
}
/
${
materialStandard
}
`
;
}
/** 规范化服务项目选项(id + 下拉展示文案) */
export
function
mapServiceItemOption
(
item
=
{})
{
const
rawId
=
item
.
serviceItemId
??
item
.
id
;
const
normalizedId
=
rawId
===
""
||
rawId
===
null
||
rawId
===
undefined
?
""
:
Number
(
rawId
);
return
{
...
item
,
serviceItemId
:
Number
.
isNaN
(
normalizedId
)
?
rawId
:
normalizedId
,
serviceItemDisplayLabel
:
formatServiceItemOptionLabel
(
item
),
};
}
/** 太阳膜、改色膜、车衣 — 需展示上架部位 */
/** 太阳膜、改色膜、车衣 — 需展示上架部位 */
export
function
shouldShowPosition
(
goodsType
)
{
export
function
shouldShowPosition
(
goodsType
)
{
return
shouldShowServiceItem
(
goodsType
);
return
shouldShowServiceItem
(
goodsType
);
...
...
src/views/goods/grounding/views/modify/index.vue
View file @
e5cd678
...
@@ -27,7 +27,7 @@ import { baseConfig } from "@/main";
...
@@ -27,7 +27,7 @@ import { baseConfig } from "@/main";
import
{
convertYuanToWan
,
filterSpecsStr
}
from
"@/views/goods/filterOption"
;
import
{
convertYuanToWan
,
filterSpecsStr
}
from
"@/views/goods/filterOption"
;
import
groundingForm
from
"@/views/goods/grounding/components/groundingForm.vue"
;
import
groundingForm
from
"@/views/goods/grounding/components/groundingForm.vue"
;
import
{
baseSupplyModeList
,
productList
,
upgradeSupplyModeList
}
from
"@/views/goods/grounding/constants/data"
;
import
{
baseSupplyModeList
,
productList
,
upgradeSupplyModeList
}
from
"@/views/goods/grounding/constants/data"
;
import
{
isSelfOperatedEquityExtended
}
from
"@/views/goods/grounding/utils/productCost"
;
import
{
isSelfOperatedEquityExtended
,
mapServiceItemOption
}
from
"@/views/goods/grounding/utils/productCost"
;
export
default
{
export
default
{
name
:
"EditGrounding"
,
name
:
"EditGrounding"
,
...
@@ -154,7 +154,7 @@ export default {
...
@@ -154,7 +154,7 @@ export default {
isClear
:
false
,
isClear
:
false
,
optionList
:
[],
optionList
:
[],
optionId
:
"serviceItemId"
,
optionId
:
"serviceItemId"
,
optionLabel
:
"serviceItem
sName
"
,
optionLabel
:
"serviceItem
DisplayLabel
"
,
width
:
"432px"
,
width
:
"432px"
,
},
},
{
{
...
@@ -383,10 +383,7 @@ export default {
...
@@ -383,10 +383,7 @@ export default {
pageSize
:
10000
,
pageSize
:
10000
,
currentPage
:
1
,
currentPage
:
1
,
});
});
const
serviceItemList
=
(
serviceItemRes
?.
list
||
[]).
map
(
item
=>
({
const
serviceItemList
=
(
serviceItemRes
?.
list
||
[]).
map
(
mapServiceItemOption
);
...
item
,
serviceItemId
:
item
.
serviceItemId
??
item
.
id
,
}));
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"
)
{
...
...
src/views/goods/packageManage/components/packageForm/index.vue
View file @
e5cd678
...
@@ -648,6 +648,7 @@ import {
...
@@ -648,6 +648,7 @@ import {
isThirdPartyEquityExtended
,
isThirdPartyEquityExtended
,
shouldShowProductCostType
,
shouldShowProductCostType
,
shouldShowServiceItem
,
shouldShowServiceItem
,
mapServiceItemOption
,
}
from
"@/views/goods/grounding/utils/productCost"
;
}
from
"@/views/goods/grounding/utils/productCost"
;
export
default
{
export
default
{
...
@@ -976,16 +977,7 @@ export default {
...
@@ -976,16 +977,7 @@ export default {
pageSize
:
10000
,
pageSize
:
10000
,
currentPage
:
1
,
currentPage
:
1
,
}
);
}
);
this
.
serviceItemList
=
(
serviceItemRes
?.
list
||
[]).
map
((
item
)
=>
{
this
.
serviceItemList
=
(
serviceItemRes
?.
list
||
[]).
map
(
mapServiceItemOption
);
const
serviceItemId
=
item
.
serviceItemId
??
item
.
id
;
const
normalizedId
=
serviceItemId
===
""
||
serviceItemId
===
null
||
serviceItemId
===
undefined
?
""
:
Number
(
serviceItemId
);
return
{
...
item
,
serviceItemId
:
Number
.
isNaN
(
normalizedId
)
?
serviceItemId
:
normalizedId
,
}
;
}
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
err
);
console
.
log
(
err
);
this
.
serviceItemList
=
[];
this
.
serviceItemList
=
[];
...
@@ -1563,7 +1555,7 @@ export default {
...
@@ -1563,7 +1555,7 @@ export default {
_this
.
storeSelected
=
deepClone
(
_this
.
formData
.
merchantGoodsRefList
);
_this
.
storeSelected
=
deepClone
(
_this
.
formData
.
merchantGoodsRefList
);
_this
.
relateStoreVisible
=
true
;
_this
.
relateStoreVisible
=
true
;
}
,
}
,
handleRelateStoreConfirm
(
selectedData
)
{
async
handleRelateStoreConfirm
(
selectedData
)
{
if
(
!
selectedData
.
length
)
{
if
(
!
selectedData
.
length
)
{
this
.
$message
({
this
.
$message
({
message
:
"请选择关联门店"
,
message
:
"请选择关联门店"
,
...
@@ -1573,6 +1565,8 @@ export default {
...
@@ -1573,6 +1565,8 @@ export default {
return
true
;
return
true
;
}
}
const
previousMerchantGoodsRefList
=
deepClone
(
this
.
formData
.
merchantGoodsRefList
||
[]);
// 合并保留旧的 inventoryTypeRefList 数据,防止已选的库存模式丢失
// 合并保留旧的 inventoryTypeRefList 数据,防止已选的库存模式丢失
const
oldMerchantList
=
this
.
formData
.
merchantGoodsRefList
||
[];
const
oldMerchantList
=
this
.
formData
.
merchantGoodsRefList
||
[];
const
mergedData
=
selectedData
.
map
((
newMerchant
)
=>
{
const
mergedData
=
selectedData
.
map
((
newMerchant
)
=>
{
...
@@ -1593,8 +1587,10 @@ export default {
...
@@ -1593,8 +1587,10 @@ export default {
this
.
formData
.
merchantGoodsRefList
=
mergedData
;
this
.
formData
.
merchantGoodsRefList
=
mergedData
;
this
.
updateMerchantGoodsRefList
();
this
.
updateMerchantGoodsRefList
();
this
.
relateStoreVisible
=
false
;
this
.
relateStoreVisible
=
false
;
this
.
$nextTick
(()
=>
{
await
this
.
$nextTick
();
this
.
validateStoreRegionAfterChange
();
await
this
.
validateStoreRegionAfterChange
({
previousMerchantGoodsRefList
,
revertStoresOnCancel
:
true
,
}
);
}
);
}
,
}
,
clearGroundingGoodsList
()
{
clearGroundingGoodsList
()
{
...
@@ -1648,8 +1644,12 @@ export default {
...
@@ -1648,8 +1644,12 @@ export default {
}
,
}
,
/**
/**
* 门店变更后校验区域;不匹配时提示是否清空不符产品
* 门店变更后校验区域;不匹配时提示是否清空不符产品
* @param {Object
}
options
* @param {Array
}
options.previousMerchantGoodsRefList 变更前门店列表(弹窗确认场景取消时回滚)
* @param {Boolean
}
options.revertStoresOnCancel 区域不匹配弹窗点取消时是否回滚门店
*/
*/
async
validateStoreRegionAfterChange
()
{
async
validateStoreRegionAfterChange
(
options
=
{
}
)
{
const
{
previousMerchantGoodsRefList
,
revertStoresOnCancel
}
=
options
;
const
{
merchantGoodsRefList
,
groundingGoodsList
}
=
this
.
formData
;
const
{
merchantGoodsRefList
,
groundingGoodsList
}
=
this
.
formData
;
const
upgradeGoodsIds
=
(
groundingGoodsList
||
[])
const
upgradeGoodsIds
=
(
groundingGoodsList
||
[])
.
map
((
item
)
=>
item
.
upgradeGoodsId
)
.
map
((
item
)
=>
item
.
upgradeGoodsId
)
...
@@ -1693,7 +1693,15 @@ export default {
...
@@ -1693,7 +1693,15 @@ export default {
);
);
this
.
clearInvalidGroundingGoods
(
invalidIds
);
this
.
clearInvalidGroundingGoods
(
invalidIds
);
}
catch
(
_cancel
)
{
}
catch
(
_cancel
)
{
// 取消:门店已变更,仅保留产品不清空
// 弹窗选门店:取消则回滚到确认前门店;删除门店:取消则保留当前门店变更
if
(
revertStoresOnCancel
)
{
this
.
$set
(
this
.
formData
,
"merchantGoodsRefList"
,
deepClone
(
previousMerchantGoodsRefList
||
[])
);
this
.
updateMerchantGoodsRefList
();
}
}
}
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
err
);
console
.
log
(
err
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment