Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
marketing
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
marketing-web
marketing
Commits
64136ba6
Commit
64136ba6
authored
Sep 13, 2022
by
caoyanzhi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/8月-奥莱定制' into dev
parents
b2110c1a
61f08de8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
24 deletions
+20
-24
form.js
src/views/card/form.js
+20
-24
No files found.
src/views/card/form.js
View file @
64136ba6
...
...
@@ -467,40 +467,33 @@ export default {
getStoreByCode
({
key
:
this
.
storeUuid
,
isClique
:
0
,
pageSize
:
99999
,
currentPage
:
1
}).
then
(
res
=>
{
const
{
result
,
errorCode
}
=
res
||
{};
if
(
errorCode
==
0
&&
Array
.
isArray
(
result
.
result
))
{
this
.
selectedStoreList
=
result
.
result
.
map
(
el
=>
{
const
{
storeId
,
storeCode
,
storeName
}
=
el
;
return
{
storeId
,
storeCode
,
storeName
,
costValueProportion
:
undefined
,
costValue
:
0
};
});
if
(
this
.
isEdit
)
{
// 编辑卡券通过门店选择器添加门店时,需要先过滤掉已经选中的门店,再与form.costStoreList合并
this
.
selectedStoreList
=
this
.
selectedStoreList
.
filter
(
el
=>
this
.
form
.
costStoreList
.
every
(
item
=>
item
.
storeId
!=
el
.
storeId
));
this
.
originStoreList
=
[...
this
.
selectedStoreList
,
...
this
.
form
.
costStoreList
];
}
else
if
(
this
.
isAdd
||
this
.
isCopy
)
{
// 新建卡券时直接覆盖
this
.
originStoreList
=
this
.
selectedStoreList
;
}
this
.
setStoreList
(
result
.
result
);
}
});
}
else
{
getStoreWidgetStore
({
key
:
id
,
pageSize
:
99999
,
currentPage
:
1
}).
then
(
res
=>
{
const
{
result
,
errorCode
}
=
res
||
{};
if
(
errorCode
==
0
&&
Array
.
isArray
(
result
.
result
))
{
this
.
selectedStoreList
=
result
.
result
.
map
(
el
=>
{
const
{
storeId
,
storeCode
,
storeName
}
=
el
;
return
{
storeId
,
storeCode
,
storeName
,
costValueProportion
:
undefined
,
costValue
:
0
};
});
if
(
this
.
isEdit
)
{
// 编辑卡券通过门店选择器添加门店时,需要先过滤掉已经选中的门店,再与form.costStoreList合并
this
.
selectedStoreList
=
this
.
selectedStoreList
.
filter
(
el
=>
this
.
form
.
costStoreList
.
every
(
item
=>
item
.
storeId
!=
el
.
storeId
));
this
.
originStoreList
=
[...
this
.
selectedStoreList
,
...
this
.
form
.
costStoreList
];
}
else
if
(
this
.
isAdd
||
this
.
isCopy
)
{
// 新建卡券时直接覆盖
this
.
originStoreList
=
this
.
selectedStoreList
;
}
this
.
setStoreList
(
result
.
result
);
}
});
}
},
setStoreList
(
storeList
)
{
this
.
selectedStoreList
=
storeList
.
map
(
el
=>
{
const
index
=
this
.
originStoreList
.
findIndex
(
item
=>
item
.
storeId
==
el
.
storeId
);
const
{
storeId
,
storeCode
,
storeName
}
=
el
;
return
{
storeId
,
storeCode
,
storeName
,
costValueProportion
:
index
>=
0
?
this
.
originStoreList
[
index
].
costValueProportion
:
undefined
,
costValue
:
0
};
});
if
(
this
.
isEdit
)
{
// 编辑卡券通过门店选择器添加门店时,需要先过滤掉已经选中的门店,再与form.costStoreList合并
this
.
selectedStoreList
=
this
.
selectedStoreList
.
filter
(
el
=>
this
.
form
.
costStoreList
.
every
(
item
=>
item
.
storeId
!=
el
.
storeId
));
this
.
originStoreList
=
[...
this
.
selectedStoreList
,
...
this
.
form
.
costStoreList
];
}
else
if
(
this
.
isAdd
||
this
.
isCopy
)
{
// 新建卡券时直接覆盖
this
.
originStoreList
=
this
.
selectedStoreList
;
}
},
onSortStore
(
sortType
)
{
this
.
sortType
=
sortType
;
if
(
sortType
==
0
)
{
...
...
@@ -868,6 +861,9 @@ export default {
this
.
form
.
costValueProportion
=
card
.
costValueProportion
;
//成本比例
this
.
form
.
costStoreList
=
(
this
.
isEdit
||
this
.
isInfo
||
this
.
isCopy
)
&&
Array
.
isArray
(
card
.
costStoreList
)
?
card
.
costStoreList
:
[];
this
.
originStoreList
=
this
.
form
.
costStoreList
;
if
(
this
.
isCopy
)
{
this
.
onStoreChange
(
card
.
storeWidgetKey
);
}
}
// 线下适用商品
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment