Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-app-operator-master
Commits
8a7e6896
Commit
8a7e6896
authored
Mar 14, 2023
by
邓春圆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加优惠活动
parent
c464a206
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
13 deletions
+62
-13
product.js
src/api/ecw/product.js
+8
-1
index.vue
src/views/ecw/product/index.vue
+54
-12
No files found.
src/api/ecw/product.js
View file @
8a7e6896
...
...
@@ -79,3 +79,10 @@ export function calculationPrice(data){
data
:
data
})
}
//新增商品可用优惠信息列表
export
function
product_coupon_newProd
(){
return
request
({
url
:
'
/product/coupon/newProd/list
'
,
method
:
'
get
'
,
})
}
src/views/ecw/product/index.vue
View file @
8a7e6896
...
...
@@ -206,7 +206,20 @@
<el-radio
v-model.number=
"form.needBook"
:label=
"1"
>
{{$t('是')}}
</el-radio>
<el-radio
v-model.number=
"form.needBook"
:label=
"0"
>
{{$t('否')}}
</el-radio>
</el-form-item>
<!-- <el-form-item :label="$t('可参与优惠活动')" prop="you">
<el-form-item
v-if=
"this.form.id == null "
:label=
"$t('可参与优惠')"
>
<!-- <el-select multiple v-model="form.couponlds" size="5" style="min-width: 300px; border:1px solid #DCDFE6; border-radius:4px">-->
<!-- <el-option v-for="item in preferentialList" :value="item.couponId" :label="item.titleZh" :key="item.couponId" :disabled="item.mandatory">{{item.titleZh}}</el-option>-->
<!-- </el-select>-->
<div
style=
"width: 300px;height: 400px;border: 1px solid;overflow-y: auto"
>
<div
@
click=
"selectMoveAbout(item)"
style=
"display: flex;justify-content: space-between; align-items: center;"
:style=
"{'cursor':item.mandatory ? 'no-drop' : 'pointer' }"
v-for=
"item in preferentialList"
>
<div>
{{$l(item, 'title')}}
</div>
<i
v-if=
"form.couponIds.includes(item.couponId)"
style=
"margin-right: 20px;"
class=
"el-icon-check"
></i>
</div>
</div>
</el-form-item>
<!-- <el-form-item :label="$t('可参与优惠活动')" prop="you">
<el-select v-model="form.you" :placeholder="$t('可参与优惠活动')" clearable>
<el-option v-for="packageItem in packagingList" :key="packageItem.value" :label="packageItem.label" :value="packageItem.value" />
</el-select>
...
...
@@ -227,7 +240,15 @@
</template>
<
script
>
import
{
createProduct
,
updateProduct
,
deleteProduct
,
getProduct
,
getProductPage
,
exportProductExcel
}
from
"
@/api/ecw/product
"
;
import
{
createProduct
,
updateProduct
,
deleteProduct
,
getProduct
,
getProductPage
,
exportProductExcel
,
product_coupon_newProd
}
from
"
@/api/ecw/product
"
;
import
{
getProductAttrList
}
from
"
@/api/ecw/productAttr
"
;
import
{
getProductTypeList
}
from
"
@/api/ecw/productType
"
;
import
{
getDictDatas
,
DICT_TYPE
}
from
'
@/utils/dict
'
;
...
...
@@ -305,7 +326,8 @@ export default {
auditStatusDictDatas
:
getDictDatas
(
DICT_TYPE
.
AUDIT_STATUS
),
materialList
:
getDictDatas
(
DICT_TYPE
.
ECW_PRODUCT_MATERIAL
),
packagingList
:
getDictDatas
(
DICT_TYPE
.
ECW_PACKAGING_TYPE
),
locationList
:
getDictDatas
(
DICT_TYPE
.
ECW_CONTAINER_LOCATION
)
locationList
:
getDictDatas
(
DICT_TYPE
.
ECW_CONTAINER_LOCATION
),
preferentialList
:[],
};
},
...
...
@@ -360,6 +382,10 @@ export default {
this
.
getAttrList
();
this
.
getTypeList
();
this
.
getList
();
product_coupon_newProd
().
then
(
r
=>
{
this
.
preferentialList
=
r
.
data
this
.
reset
()
})
},
methods
:
{
/** 获取产品属性列表 */
...
...
@@ -433,8 +459,11 @@ export default {
auditStatus
:
undefined
,
status
:
undefined
,
requirements
:
0
,
needBook
:
0
needBook
:
0
,
couponIds
:[],
};
let
c
=
this
.
preferentialList
.
filter
(
i
=>
i
.
isDefault
).
map
(
i
=>
i
.
couponId
)
this
.
form
.
couponIds
=
c
this
.
resetForm
(
"
form
"
);
},
/** 搜索按钮操作 */
...
...
@@ -485,7 +514,6 @@ export default {
}
//商品特性转字符串
this
.
form
.
attrId
=
this
.
form
.
attrArray
.
join
(
'
,
'
);
// 修改的提交
if
(
this
.
form
.
id
!=
null
)
{
updateProduct
(
this
.
form
).
then
(
response
=>
{
...
...
@@ -576,7 +604,21 @@ export default {
ids
:
this
.
ids
}
});
},
selectMoveAbout
(
val
){
if
(
!
val
.
mandatory
){
let
index
=
this
.
form
.
couponIds
.
findIndex
(
i
=>
val
.
couponId
==
i
)
if
(
index
>=
0
){
this
.
form
.
couponIds
.
splice
(
index
,
1
)
}
else
{
this
.
form
.
couponIds
.
push
(
val
.
couponId
)
}
}
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
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