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 e793af64
authored
Feb 27, 2025
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加或删除套餐时通知
1 parent
25ccee51
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
135 additions
and
36 deletions
src/api/shelfManage.js
src/views/goods/shelfManage/components/common/goodTab.vue
src/views/goods/shelfManage/components/common/packageTab.vue
src/views/goods/shelfManage/components/editCon/GoodsInfo.vue
src/views/goods/shelfManage/editContract.vue
src/api/shelfManage.js
View file @
e793af6
...
@@ -64,3 +64,9 @@ export function getMerchantType(data) {
...
@@ -64,3 +64,9 @@ export function getMerchantType(data) {
data
.
method
=
`merchants.api.menu.findAllDictData`
data
.
method
=
`merchants.api.menu.findAllDictData`
return
request
(
data
,
RequestMethods
.
POST
)
return
request
(
data
,
RequestMethods
.
POST
)
}
}
// 嘀加上架查看详情(上架商品及测算)
export
function
getGoodsDetail
(
data
)
{
data
.
method
=
`
${
path
}
detail.goods`
return
request
(
data
,
RequestMethods
.
POST
)
}
src/views/goods/shelfManage/components/common/goodTab.vue
View file @
e793af6
...
@@ -170,6 +170,16 @@ import { limitPrice } from "@/common/format"
...
@@ -170,6 +170,16 @@ import { limitPrice } from "@/common/format"
import
selectGoodsDialog
from
'../../../components/selectGoodsDialog.vue'
import
selectGoodsDialog
from
'../../../components/selectGoodsDialog.vue'
export
default
{
export
default
{
name
:
"GoodTab"
,
name
:
"GoodTab"
,
props
:
{
info
:
{
type
:
Object
,
default
:
()
=>
{
}
},
tabIdx
:
{
type
:
Number
,
default
:
null
}
},
data
()
{
data
()
{
return
{
return
{
businessNature
:
businessNature
,
businessNature
:
businessNature
,
...
@@ -225,7 +235,7 @@ export default {
...
@@ -225,7 +235,7 @@ export default {
computed
:
{},
computed
:
{},
async
mounted
()
{
async
mounted
()
{
console
.
log
(
'
商品'
)
console
.
log
(
'
info'
,
this
.
info
)
},
},
methods
:
{
methods
:
{
...
...
src/views/goods/shelfManage/components/common/packageTab.vue
View file @
e793af6
...
@@ -246,10 +246,12 @@ export default {
...
@@ -246,10 +246,12 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
timeId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
//
timeId: new Date().getTime() + parseInt(Math.random() * 1000),
businessNature
:
businessNature
,
businessNature
:
businessNature
,
loading
:
false
,
loading
:
false
,
packageForm
:
{
packageForm
:
{
timeId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
goodsId
:
null
,
val1
:
""
,
val1
:
""
,
val2
:
""
,
val2
:
""
,
val3
:
""
,
val3
:
""
,
...
@@ -316,7 +318,6 @@ export default {
...
@@ -316,7 +318,6 @@ export default {
// name: e.target.value,
// name: e.target.value,
// timeId: this.timeId
// timeId: this.timeId
// }
// }
this
.
packageForm
.
timeId
=
this
.
timeId
this
.
returnData
()
this
.
returnData
()
}
}
},
},
...
@@ -378,6 +379,7 @@ export default {
...
@@ -378,6 +379,7 @@ export default {
},
},
returnData
()
{
returnData
()
{
// this.packageForm.timeId = this.timeId
this
.
$emit
(
'packageEditInfo'
,
{
info
:
this
.
packageForm
,
idx
:
this
.
tabIdx
})
this
.
$emit
(
'packageEditInfo'
,
{
info
:
this
.
packageForm
,
idx
:
this
.
tabIdx
})
}
}
}
}
...
...
src/views/goods/shelfManage/components/editCon/GoodsInfo.vue
View file @
e793af6
...
@@ -19,10 +19,11 @@
...
@@ -19,10 +19,11 @@
:name=
"item.name"
:name=
"item.name"
closable
>
closable
>
<span
slot=
"label"
><i
class=
"el-icon-warning car-error-txt"
<span
slot=
"label"
><i
class=
"el-icon-warning car-error-txt"
v-if=
"item.valiadError == 'Y'"
/>
{{
item
.
title
+
(
idx
+
1
)
}}
v-if=
"item.valiadError == 'Y'"
/>
{{
item
.
title
?
(
item
.
title
+
(
idx
+
1
)):
item
.
goodsName
}}
</span>
</span>
<span>
<span>
<good-tab
/>
<good-tab
:info=
"item.info"
:tab-idx=
"item.tabIndex"
/>
</span>
</span>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
v-for=
"(item, idx) in packageTabs"
<el-tab-pane
v-for=
"(item, idx) in packageTabs"
...
@@ -31,19 +32,19 @@
...
@@ -31,19 +32,19 @@
:name=
"item.name"
:name=
"item.name"
closable
>
closable
>
<span
slot=
"label"
><i
class=
"el-icon-warning car-error-txt"
<span
slot=
"label"
><i
class=
"el-icon-warning car-error-txt"
v-if=
"item.valiadError == 'Y'"
/>
{{
item
.
title
+
(
idx
+
1
)
}}
v-if=
"item.valiadError == 'Y'"
/>
{{
item
.
title
?
(
item
.
title
+
(
idx
+
1
)):
item
.
goodsName
}}
</span>
</span>
<span>
<span>
<package-tab
@
packageEditInfo=
"getPackageEditInfo"
<package-tab
@
packageEditInfo=
"getPackageEditInfo
_notice
"
:tab-idx=
"item.tabIndex"
/>
:tab-idx=
"item.tabIndex"
/>
</span>
</span>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
key=
"add"
<
!--
<
el-tab-pane
key=
"add"
name=
"add"
>
name=
"add"
>
-->
<!-- //这是增加的按钮 -->
<!-- //这是增加的按钮 -->
<span
slot=
"label"
<!--
<span
slot=
"label"
style=
"padding: 8px; font-size: 20px; font-weight: bold"
>
+
</span>
style=
"padding: 8px; font-size: 20px; font-weight: bold"
>
+
</span>
</el-tab-pane>
</el-tab-pane>
-->
</el-tabs>
</el-tabs>
</div>
</div>
<!--
<div
style=
"padding: 20px;"
>
<!--
<div
style=
"padding: 20px;"
>
...
@@ -67,12 +68,20 @@
...
@@ -67,12 +68,20 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
get
}
from
"sortablejs"
import
{
getGoodsDetail
}
from
"@api/shelfManage.js"
import
goodTab
from
"../common/goodTab.vue"
import
goodTab
from
"../common/goodTab.vue"
import
packageTab
from
"../common/packageTab.vue"
import
packageTab
from
"../common/packageTab.vue"
import
{
deepClone
}
from
"@/common/util"
export
default
{
export
default
{
name
:
'GoodsInfo'
,
name
:
'GoodsInfo'
,
props
:
{},
props
:
{
recordId
:
{
type
:
Number
,
default
:
null
}
},
components
:
{
components
:
{
goodTab
,
goodTab
,
packageTab
packageTab
...
@@ -110,7 +119,46 @@ export default {
...
@@ -110,7 +119,46 @@ export default {
packageInfoList
:
[]
packageInfoList
:
[]
}
}
},
},
mounted
()
{
this
.
getDetail
()
},
methods
:
{
methods
:
{
getDetail
()
{
console
.
log
(
'getGoodsDetail'
)
// this.recordId
getGoodsDetail
({
id
:
1
})
.
then
((
res
)
=>
{
const
goodsList
=
deepClone
(
res
.
goodsList
)
const
packageGoodsList
=
deepClone
(
res
.
packageGoodsList
)
goodsList
.
forEach
((
item
,
idx
)
=>
{
const
length
=
this
.
goodTabs
.
length
const
tabIndex
=
length
==
0
?
length
:
this
.
goodTabs
[
length
-
1
].
tabIndex
+
1
this
.
goodTabs
.
push
({
goodsName
:
item
.
goodsName
,
name
:
'good_'
+
tabIndex
,
tabIndex
:
tabIndex
,
goodId
:
item
.
id
,
info
:
item
})
this
.
tabsValue
=
'good_'
+
tabIndex
})
packageGoodsList
.
forEach
((
item
,
idx
)
=>
{
const
length
=
this
.
packageTabs
.
length
const
tabIndex
=
length
==
0
?
length
:
this
.
packageTabs
[
length
-
1
].
tabIndex
+
1
this
.
packageTabs
.
push
({
goodsName
:
item
.
packageName
,
name
:
'package_'
+
tabIndex
,
tabIndex
:
tabIndex
,
goodId
:
item
.
id
,
info
:
item
})
this
.
tabsValue
=
'package_'
+
tabIndex
})
})
.
catch
((
err
)
=>
{
console
.
log
(
err
)
})
},
addPop
()
{
addPop
()
{
this
.
chooseVisible
=
true
this
.
chooseVisible
=
true
},
},
...
@@ -127,13 +175,13 @@ export default {
...
@@ -127,13 +175,13 @@ export default {
console
.
log
(
'currentName'
,
currentName
)
console
.
log
(
'currentName'
,
currentName
)
// 通过tab标签的切换事件触发增加的函数
// 通过tab标签的切换事件触发增加的函数
// 如果name是add,则调用增加tab的函数
// 如果name是add,则调用增加tab的函数
if
(
currentName
==
"add"
)
{
//
if (currentName == "add") {
// this.addTab()
//
// this.addTab()
this
.
addPop
()
//
this.addPop()
return
false
//
return false
}
else
{
//
} else {
this
.
currentIndex
=
currentName
this
.
currentIndex
=
currentName
}
//
}
},
},
addTab
(
goodType
)
{
addTab
(
goodType
)
{
// 根据已有的tab,再增减
// 根据已有的tab,再增减
...
@@ -242,6 +290,7 @@ export default {
...
@@ -242,6 +290,7 @@ export default {
}
else
{
}
else
{
this
.
packageTabs
=
tabs
.
filter
(
tab
=>
tab
.
name
!==
targetName
)
this
.
packageTabs
=
tabs
.
filter
(
tab
=>
tab
.
name
!==
targetName
)
}
}
this
.
packageNotice
()
// const currentTabIndex = this.goodTabs.findIndex(item => item.name == targetName)
// const currentTabIndex = this.goodTabs.findIndex(item => item.name == targetName)
// // currentTabIndex <= parseInt(self.goodTabsValue)
// // currentTabIndex <= parseInt(self.goodTabsValue)
...
@@ -321,13 +370,35 @@ export default {
...
@@ -321,13 +370,35 @@ export default {
// })
// })
},
},
getPackageEditInfo
(
obj
)
{
// 填写套餐名称时通知
getPackageEditInfo_notice
(
obj
)
{
console
.
log
(
'obj'
,
obj
)
console
.
log
(
'obj'
,
obj
)
this
.
packageTabs
.
find
(
item
=>
item
.
tabIndex
==
obj
.
idx
).
info
=
obj
.
info
this
.
packageTabs
.
find
(
item
=>
item
.
tabIndex
==
obj
.
idx
).
info
=
obj
.
info
this
.
packageNotice
()
},
// 删除套餐时通知
// removePackageTab_notice() {
// this.packageInfoList = []
// this.packageTabs.forEach(item => {
// if (item.info) {
// this.packageInfoList.push(item.info)
// }
// })
// this.$EventBus.$emit('packageInfoList', this.packageInfoList)
// },
// 填写套餐名称时或删除套餐时通知
packageNotice
()
{
this
.
packageInfoList
=
[]
this
.
packageInfoList
=
[]
this
.
packageTabs
.
forEach
(
item
=>
{
this
.
packageTabs
.
forEach
(
item
=>
{
if
(
item
.
info
)
{
if
(
item
.
info
)
{
this
.
packageInfoList
.
push
(
item
.
info
)
const
o
=
{
name
:
item
.
info
.
val1
||
item
.
info
.
packageName
,
virtualCode
:
item
.
info
.
timeId
,
id
:
item
.
info
.
id
}
this
.
packageInfoList
.
push
(
o
)
}
}
})
})
console
.
log
(
'this.packageInfoList'
,
this
.
packageInfoList
)
console
.
log
(
'this.packageInfoList'
,
this
.
packageInfoList
)
...
...
src/views/goods/shelfManage/editContract.vue
View file @
e793af6
...
@@ -8,28 +8,38 @@
...
@@ -8,28 +8,38 @@
-->
-->
<!-- 编辑 - 运营确认 -->
<!-- 编辑 - 运营确认 -->
<
template
>
<
template
>
<d2-container
class=
"edit-contract"
v-loading=
"isLoad"
>
<d2-container
class=
"edit-contract"
v-loading=
"isLoad"
>
<!-- 基础信息 -->
<!-- 基础信息 -->
<base-info
:basic
I
nfo=
"basicInfo"
></base-info>
<base-info
:basic
-i
nfo=
"basicInfo"
></base-info>
<!-- 流量方信息 -->
<!-- 流量方信息 -->
<shop-merchant-info
ref=
"shopMerchant"
:editData=
"merchantEditData"
@
addMerchant=
"handleAddMerchant"
></shop-merchant-info>
<shop-merchant-info
ref=
"shopMerchant"
:edit-data=
"merchantEditData"
@
addMerchant=
"handleAddMerchant"
></shop-merchant-info>
<!-- 流量方信息 - 新增 - 新增商户 -->
<!-- 流量方信息 - 新增 - 新增商户 -->
<add-merchant
v-if=
"addMerVisible"
:addMerVisible=
"addMerVisible"
@
handleClose=
"handleAddMerchant"
></add-merchant>
<add-merchant
v-if=
"addMerVisible"
:add-mer-visible=
"addMerVisible"
@
handleClose=
"handleAddMerchant"
></add-merchant>
<!-- 上架商品及测算 -->
<!-- 上架商品及测算 -->
<goods-info></goods-info>
<goods-info
ref=
"goodsInfo"
:record-id=
"routeObj.id"
></goods-info>
<!-- 分账配置 -->
<!-- 分账配置 -->
<division-config
ref=
"divisionConfig"
></division-config>
<division-config
ref=
"divisionConfig"
></division-config>
<!-- 对账配置 -->
<!-- 对账配置 -->
<finance-config
ref=
"financeConfig"
></finance-config>
<finance-config
ref=
"financeConfig"
></finance-config>
<div
style=
"margin-top: 40px;text-align: center;"
>
<div
style=
"margin-top: 40px;text-align: center;"
>
<el-button
type=
"primary"
@
click=
"handleConfirm('save')"
>
<el-button
type=
"primary"
@
click=
"handleConfirm('save')"
>
提交
提交
</el-button>
</el-button>
<!-- 草稿状态/已下架/新增显示 -->
<!-- 草稿状态/已下架/新增显示 -->
<el-button
type=
"primary"
plain
@
click=
"handleConfirm('draft')"
>
<el-button
type=
"primary"
plain
@
click=
"handleConfirm('draft')"
>
暂存
暂存
</el-button>
</el-button>
<el-button
class=
"cancel-btn"
@
click=
"handleCancel"
>
<el-button
class=
"cancel-btn"
@
click=
"handleCancel"
>
取消
取消
</el-button>
</el-button>
</div>
</div>
...
@@ -57,9 +67,9 @@ export default {
...
@@ -57,9 +67,9 @@ export default {
basicInfo
:
{},
basicInfo
:
{},
merchantEditData
:
{},
merchantEditData
:
{},
editData
:
{
editData
:
{
merchantName
:
''
,
merchantName
:
''
}
,
}
}
;
}
},
},
components
:
{
components
:
{
...
@@ -75,7 +85,7 @@ export default {
...
@@ -75,7 +85,7 @@ export default {
this
.
isLoad
=
true
this
.
isLoad
=
true
this
.
getBasicDetail
()
this
.
getBasicDetail
()
},
},
//方法集合
//
方法集合
methods
:
{
methods
:
{
...
mapActions
({
...
mapActions
({
close
:
'd2admin/page/close'
close
:
'd2admin/page/close'
...
@@ -105,7 +115,7 @@ export default {
...
@@ -105,7 +115,7 @@ export default {
businessCode
:
this
.
routeObj
.
businessCode
,
businessCode
:
this
.
routeObj
.
businessCode
,
merchant
:
this
.
$refs
.
editData
,
merchant
:
this
.
$refs
.
editData
,
settleDistributeRule
:
this
.
$refs
.
divisionConfig
.
submitParams
,
settleDistributeRule
:
this
.
$refs
.
divisionConfig
.
submitParams
,
reconciliationRule
:
this
.
$refs
.
financeConfig
.
submitParams
,
reconciliationRule
:
this
.
$refs
.
financeConfig
.
submitParams
}
}
},
},
handleCancel
()
{
handleCancel
()
{
...
@@ -113,8 +123,8 @@ export default {
...
@@ -113,8 +123,8 @@ export default {
this
.
$router
.
push
({
name
:
'shelfManage'
})
this
.
$router
.
push
({
name
:
'shelfManage'
})
this
.
close
({
tagName
:
'/editContract'
})
this
.
close
({
tagName
:
'/editContract'
})
}
}
}
,
}
}
;
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.cancel-btn
{
.cancel-btn
{
...
...
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