Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
Project
Project
Details
Activity
Releases
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
bp
op-web-service
Commits
80f84ebc
Commit
80f84ebc
authored
Aug 20, 2021
by
lihui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 8-20提测版本
parent
65c65733
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
533 additions
and
354 deletions
+533
-354
groupmeal.js
server/controllers/groupmeal.js
+20
-0
router.js
server/router.js
+2
-0
addProduc.vue
src/pages/Activity/releaseProduc/components/addProduc.vue
+83
-77
infoEditing.vue
src/pages/Activity/releaseProduc/components/infoEditing.vue
+6
-1
myMap.vue
src/pages/Activity/releaseProduc/components/myMap.vue
+9
-9
spellOrderSet.vue
...pages/Activity/releaseProduc/components/spellOrderSet.vue
+218
-177
index.vue
src/pages/Activity/releaseProduc/index.vue
+32
-16
index.vue
src/pages/Groupmeal/Distrib/index.vue
+103
-46
groupmeal.js
src/service/Groupmeal/groupmeal.js
+53
-27
handlerResponse.js
src/utils/handlerResponse.js
+6
-0
tools.js
src/utils/tools.js
+1
-1
No files found.
server/controllers/groupmeal.js
View file @
80f84ebc
...
@@ -41,6 +41,26 @@ exports.getSaveDeliverer = async ctx => {
...
@@ -41,6 +41,26 @@ exports.getSaveDeliverer = async ctx => {
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 下载配送路线 -lh
exports
.
getDeliveryRoutes
=
async
ctx
=>
{
const
opts
=
{
url
:
`
${
GROUPMEAL_URI
}
/order/deliverer/build_plan`
,
method
:
"POST"
,
json
:
true
,
body
:
ctx
.
request
.
body
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
// 查看下载配送路线记录 -lh
exports
.
getEmailRecords
=
async
ctx
=>
{
const
opts
=
{
url
:
`
${
GROUPMEAL_URI
}
/order/deliverer/plan_down_log`
,
method
:
"POST"
,
json
:
true
,
body
:
ctx
.
request
.
body
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
// 老订单管理
// 老订单管理
...
...
server/router.js
View file @
80f84ebc
...
@@ -100,6 +100,8 @@ router.get(`${API_VERSION}/order/oldbackground/order_print`, groupmeal.orderPrin
...
@@ -100,6 +100,8 @@ router.get(`${API_VERSION}/order/oldbackground/order_print`, groupmeal.orderPrin
router
.
get
(
`
${
API_VERSION
}
/order/oldbackground/order_item_list`
,
groupmeal
.
orderItemList
);
router
.
get
(
`
${
API_VERSION
}
/order/oldbackground/order_item_list`
,
groupmeal
.
orderItemList
);
router
.
get
(
`
${
API_VERSION
}
/order/oldbackground/order_refund_reject`
,
groupmeal
.
orderRefundReject
);
router
.
get
(
`
${
API_VERSION
}
/order/oldbackground/order_refund_reject`
,
groupmeal
.
orderRefundReject
);
router
.
post
(
`
${
API_VERSION
}
/order/oldbackground/order_refund`
,
groupmeal
.
orderRefund
);
router
.
post
(
`
${
API_VERSION
}
/order/oldbackground/order_refund`
,
groupmeal
.
orderRefund
);
router
.
post
(
`
${
API_VERSION
}
/order/deliverer/build_plan`
,
groupmeal
.
getDeliveryRoutes
);
//下载配送路线 -lh
router
.
post
(
`
${
API_VERSION
}
/order/deliverer/plan_down_log`
,
groupmeal
.
getEmailRecords
);
// 查看邮件记录 -lh
// 新订单管理
// 新订单管理
router
.
get
(
`
${
API_VERSION
}
/order/background/order_list`
,
groupmeal
.
newGetOrderList
);
router
.
get
(
`
${
API_VERSION
}
/order/background/order_list`
,
groupmeal
.
newGetOrderList
);
...
...
src/pages/Activity/releaseProduc/components/addProduc.vue
View file @
80f84ebc
...
@@ -10,16 +10,28 @@
...
@@ -10,16 +10,28 @@
>
>
</div>
</div>
<!-- Tab -->
<!-- Tab -->
<el-table
:data=
"comTableData"
border
style=
"width: 100%;margin-bottom:80px;"
:header-cell-style=
"cellClass"
>
<el-table
:data=
"comTableData"
border
style=
"width: 100%;margin-bottom:80px;"
:header-cell-style=
"cellClass"
>
<el-table-column
label=
"显示顺序"
align=
"center"
width=
"50px"
>
<el-table-column
label=
"显示顺序"
align=
"center"
width=
"50px"
>
<el-table-column
label=
""
align=
"center"
width=
"50px"
>
<el-table-column
label=
""
align=
"center"
width=
"50px"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<i
class=
"el-icon-top"
@
click=
"upMove(scope.$index, scope.row)"
style=
"margin-right:15px;"
></i>
<i
class=
"el-icon-top"
@
click=
"upMove(scope.$index, scope.row)"
style=
"margin-right:15px;"
></i>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
""
align=
"center"
width=
"50px"
>
<el-table-column
label=
""
align=
"center"
width=
"50px"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<i
class=
"el-icon-bottom"
@
click=
"upDown(scope.$index, scope.row)"
></i>
<i
class=
"el-icon-bottom"
@
click=
"upDown(scope.$index, scope.row)"
></i>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table-column>
</el-table-column>
...
@@ -39,7 +51,7 @@
...
@@ -39,7 +51,7 @@
<el-table-column
prop=
"total_amount_sold"
label=
"已售数量"
>
<el-table-column
prop=
"total_amount_sold"
label=
"已售数量"
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"inventory_rest"
label=
"剩余库存"
></el-table-column>
<el-table-column
prop=
"inventory_rest"
label=
"剩余库存"
></el-table-column>
<el-table-column
label=
"操作"
width=
"120"
>
<el-table-column
label=
"操作"
width=
"120"
fixed=
"right"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-button
<el-button
type=
"text"
type=
"text"
...
@@ -58,6 +70,7 @@
...
@@ -58,6 +70,7 @@
:title=
"addCommodityTitle"
:title=
"addCommodityTitle"
v-model=
"addCommodityPopup"
v-model=
"addCommodityPopup"
width=
"50%"
width=
"50%"
custom-class=
"add_goods_dialog"
>
>
<el-form
<el-form
:inline=
"true"
:inline=
"true"
...
@@ -114,8 +127,8 @@
...
@@ -114,8 +127,8 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"划线价:"
prop=
"original_price"
>
<el-form-item
label=
"划线价:"
prop=
"original_price"
>
<el-input-number
<el-input-number
class=
"price"
v-model=
"commodityForm.original_price"
v-model=
"commodityForm.original_price"
class=
"price"
:min=
"0"
:min=
"0"
:controls=
"false"
:controls=
"false"
:precision=
"2"
:precision=
"2"
...
@@ -136,7 +149,6 @@
...
@@ -136,7 +149,6 @@
}}
</span>
}}
</span>
剩余库存:
<span>
{{ inventoryRest }}
</span>
剩余库存:
<span>
{{ inventoryRest }}
</span>
</div>
</div>
<div
class=
"purse_limit"
>
<el-form-item
<el-form-item
prop=
"checkedRadio"
prop=
"checkedRadio"
:rules=
"[
:rules=
"[
...
@@ -157,7 +169,7 @@
...
@@ -157,7 +169,7 @@
<el-form-item
<el-form-item
prop=
"num_limit"
prop=
"num_limit"
:show-message=
"
:show-message=
"
commodityForm.checkedRadio === '每人最多买' ? tur
e : false
commodityForm.checkedRadio === '每人最多买' ? tru
e : false
"
"
:rules=
"[
:rules=
"[
{
{
...
@@ -182,8 +194,6 @@
...
@@ -182,8 +194,6 @@
:controls=
"false"
:controls=
"false"
></el-input-number>
></el-input-number>
</el-form-item>
</el-form-item>
</div>
<el-form-item
<el-form-item
label=
"商家:"
label=
"商家:"
prop=
"business1"
prop=
"business1"
...
@@ -296,7 +306,7 @@ import {
...
@@ -296,7 +306,7 @@ import {
}
from
"../../../../service/Activity/index"
;
}
from
"../../../../service/Activity/index"
;
// 当选择(每人最多买时 添加验证(非空))
// 当选择(每人最多买时 添加验证(非空))
let
checkPurseLimit
=
(
rule
,
value
,
callback
)
=>
{
let
checkPurseLimit
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
""
||
value
===
0
)
{
if
(
value
===
""
||
value
===
undefined
||
value
===
0
)
{
return
callback
(
new
Error
(
"请添加限制购买数量"
));
return
callback
(
new
Error
(
"请添加限制购买数量"
));
}
else
{
}
else
{
callback
();
callback
();
...
@@ -335,10 +345,10 @@ var addProduct = {
...
@@ -335,10 +345,10 @@ var addProduct = {
addCommodityTitle
:
""
,
// 标题
addCommodityTitle
:
""
,
// 标题
commodityForm
:
{
commodityForm
:
{
goods_name
:
""
,
goods_name
:
""
,
price
:
null
,
price
:
0
,
original_price
:
null
,
original_price
:
0
,
inventory_total
:
null
,
inventory_total
:
""
,
total_amount_order
:
null
,
total_amount_order
:
""
,
business1
:
""
,
business1
:
""
,
num_limit
:
0
,
// 购买限制数量
num_limit
:
0
,
// 购买限制数量
checkedRadio
:
""
// 购买限制radio
checkedRadio
:
""
// 购买限制radio
...
@@ -363,9 +373,9 @@ var addProduct = {
...
@@ -363,9 +373,9 @@ var addProduct = {
};
};
},
},
methods
:
{
methods
:
{
cellClass
(
{
row
,
column
,
rowIndex
,
columnIndex
})
{
cellClass
(
)
{
if
(
rowIndex
===
1
)
{
if
(
arguments
.
rowIndex
===
1
)
{
return
{
display
:
'none'
}
return
{
display
:
"none"
};
}
}
},
},
...
@@ -740,13 +750,9 @@ export default addProduct;
...
@@ -740,13 +750,9 @@ export default addProduct;
.hide /deep/ .el-upload--picture-card {
.hide /deep/ .el-upload--picture-card {
display: none;
display: none;
}
}
/* 购买限制 */
.purse_limit {
// 商品添加修改dialog-form表单
display: flex;
/deep/ .add_goods_dialog {
justify-content: flex-start;
min-width: 370px;
.limit_radio {
// width: 70% !important;
margin-right: 0;
}
}
}
</
style
>
</
style
>
src/pages/Activity/releaseProduc/components/infoEditing.vue
View file @
80f84ebc
<
template
>
<
template
>
<div
class=
"infoEditing"
>
<div
class=
"infoEditing"
>
<el-form
ref=
"infoEditForm"
:model=
"infoEditForm"
label-width=
"80px"
>
<el-form
ref=
"infoEditForm"
:model=
"infoEditForm"
label-width=
"80px"
@
submit
.
prevent
>
<el-form-item
label=
"标题:"
>
<el-form-item
label=
"标题:"
>
<el-input
v-model=
"infoEditForm.title"
maxlength=
"30"
></el-input>
<el-input
v-model=
"infoEditForm.title"
maxlength=
"30"
></el-input>
</el-form-item>
</el-form-item>
...
...
src/pages/Activity/releaseProduc/components/myMap.vue
View file @
80f84ebc
...
@@ -193,15 +193,15 @@ export default {
...
@@ -193,15 +193,15 @@ export default {
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.mapDialog {
//
.mapDialog {
margin-top: 11vh !important;
//
margin-top: 11vh !important;
display: flex !important;
//
display: flex !important;
flex-direction: column !important;
//
flex-direction: column !important;
background: red !important;
//
background: red !important;
/deep/ .el-dialog__body {
//
/deep/ .el-dialog__body {
height: 90%;
//
height: 90%;
}
//
}
}
//
}
.mapContainer {
.mapContainer {
height: 100%;
height: 100%;
width: 100%;
width: 100%;
...
...
src/pages/Activity/releaseProduc/components/spellOrderSet.vue
View file @
80f84ebc
This diff is collapsed.
Click to expand it.
src/pages/Activity/releaseProduc/index.vue
View file @
80f84ebc
...
@@ -60,13 +60,13 @@ import spellOrderSet from "./components/spellOrderSet.vue";
...
@@ -60,13 +60,13 @@ import spellOrderSet from "./components/spellOrderSet.vue";
import
{
import
{
addMarketing
,
addMarketing
,
marketingInfo
,
marketingInfo
,
updateMarketing
,
updateMarketing
}
from
"../../../service/Activity/index"
;
}
from
"../../../service/Activity/index"
;
export
default
{
export
default
{
components
:
{
components
:
{
infoEditing
,
infoEditing
,
addProduc
,
addProduc
,
spellOrderSet
,
spellOrderSet
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -80,7 +80,7 @@ export default {
...
@@ -80,7 +80,7 @@ export default {
takePlaceIDArr
:
[],
takePlaceIDArr
:
[],
startTime
:
""
,
startTime
:
""
,
endTime
:
""
,
endTime
:
""
,
stepTwoTitle
:
""
,
// 传给addProduct的title
stepTwoTitle
:
""
// 传给addProduct的title
};
};
},
},
...
@@ -146,7 +146,7 @@ export default {
...
@@ -146,7 +146,7 @@ export default {
}
}
let
params
=
{
let
params
=
{
marketing_id
:
marketingId
,
marketing_id
:
marketingId
,
marketing_type
:
"4"
,
marketing_type
:
"4"
};
};
const
res
=
await
marketingInfo
(
params
);
const
res
=
await
marketingInfo
(
params
);
this
.
infoEditArr
=
res
.
result
.
marketing_info
;
this
.
infoEditArr
=
res
.
result
.
marketing_info
;
...
@@ -169,7 +169,7 @@ export default {
...
@@ -169,7 +169,7 @@ export default {
if
(
reg
.
test
(
path
))
return
unescape
(
RegExp
.
$2
.
replace
(
/
\+
/g
,
" "
));
if
(
reg
.
test
(
path
))
return
unescape
(
RegExp
.
$2
.
replace
(
/
\+
/g
,
" "
));
return
""
;
return
""
;
}
}
let
list
=
this
.
$refs
.
infoEdit
.
picSubmitList
.
map
(
(
item
)
=>
{
let
list
=
this
.
$refs
.
infoEdit
.
picSubmitList
.
map
(
item
=>
{
let
rs
=
getUrlParms
(
item
.
url
,
"url"
);
let
rs
=
getUrlParms
(
item
.
url
,
"url"
);
return
rs
;
return
rs
;
});
});
...
@@ -192,14 +192,14 @@ export default {
...
@@ -192,14 +192,14 @@ export default {
end_time
:
dayJs
(
this
.
endDate
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
end_time
:
dayJs
(
this
.
endDate
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
pindan_pic
:
picList
,
pindan_pic
:
picList
,
pindan_desc
:
this
.
$refs
.
infoEdit
.
infoEditForm
.
desc
,
pindan_desc
:
this
.
$refs
.
infoEdit
.
infoEditForm
.
desc
,
take_place_ids
:
this
.
takePlaceIDArr
,
take_place_ids
:
this
.
takePlaceIDArr
};
};
if
(
this
.
$route
.
query
.
marketing_id
==
undefined
)
{
if
(
this
.
$route
.
query
.
marketing_id
==
undefined
)
{
const
res
=
await
addMarketing
(
params
);
const
res
=
await
addMarketing
(
params
);
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
ElMessage
.
success
({
ElMessage
.
success
({
message
:
"添加成功"
,
message
:
"添加成功"
,
type
:
"success"
,
type
:
"success"
});
});
this
.
$router
.
push
({
path
:
"/op/activity/manage"
});
this
.
$router
.
push
({
path
:
"/op/activity/manage"
});
}
else
{
}
else
{
...
@@ -210,7 +210,7 @@ export default {
...
@@ -210,7 +210,7 @@ export default {
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
ElMessage
.
success
({
ElMessage
.
success
({
message
:
"修改成功"
,
message
:
"修改成功"
,
type
:
"success"
,
type
:
"success"
});
});
this
.
$router
.
push
({
path
:
"/op/activity/manage"
});
this
.
$router
.
push
({
path
:
"/op/activity/manage"
});
}
else
{
}
else
{
...
@@ -220,28 +220,45 @@ export default {
...
@@ -220,28 +220,45 @@ export default {
},
},
getTakeTakePlaceListFromChild
(
val
)
{
getTakeTakePlaceListFromChild
(
val
)
{
this
.
takePlaceIDArr
=
val
;
this
.
takePlaceIDArr
=
val
;
}
,
}
},
},
created
()
{
created
()
{
this
.
marketingInfoMet
();
this
.
marketingInfoMet
();
}
,
}
};
};
</
script
>
</
script
>
<
style
scope
>
<
style
lang=
"less"
scope
>
.releaseProduc {
.releaseProduc {
height: 100%;
padding: 30px;
padding: 30px;
box-sizing: border-box;
box-sizing: border-box;
display: flex;
flex-direction: column;
}
@media screen and (max-width: 800px) {
// form表单
.releaseProduc {
padding: 0;
}
}
}
.headTitle {
.headTitle {
height: 30px;
width: 75%;
width: 75%;
font-size: 18px;
font-size: 18px;
margin: 0 auto 40px auto;
margin: 0 auto 40px auto;
}
}
.steps {
height: 60px;
}
/* 内容cotent */
.content {
flex-grow: 1;
}
.steps {
.steps {
display: flex;
display: flex;
justify-content: center;
justify-content: center;
margin-bottom
:
50
px
;
margin-bottom:
35
px;
}
}
.steps /deep/ .el-step__icon {
.steps /deep/ .el-step__icon {
width: 50px;
width: 50px;
...
@@ -250,15 +267,14 @@ export default {
...
@@ -250,15 +267,14 @@ export default {
.steps /deep/ .el-step.is-horizontal .el-step__line {
.steps /deep/ .el-step.is-horizontal .el-step__line {
top: 25px;
top: 25px;
}
}
.stepsBtn {
.stepsBtn {
width: 100%;
width: 100%;
height: 80px;
height: 80px;
line-height: 80px;
line-height: 80px;
background: white;
background: white;
position
:
fixed
;
/*
position: fixed;
bottom
:
0px
;
bottom: 0px;
*/
text-align: center;
text-align: center;
z-index
:
999
;
z-index:
999;
}
}
</
style
>
</
style
>
src/pages/Groupmeal/Distrib/index.vue
View file @
80f84ebc
<
template
>
<
template
>
<Layout>
<Layout>
<el-card
class=
"goods"
>
<el-card
class=
"goods"
v-loading=
"pageLoading"
>
<div
class=
"header"
>
<div
class=
"header"
>
<el-button
type=
"primary"
@
click=
"assignDeliverer"
<el-button
type=
"primary"
@
click=
"assignDeliverer"
>
分配配送员
</el-button
>
分配配送员
</el-button
...
@@ -32,10 +32,10 @@
...
@@ -32,10 +32,10 @@
<el-button
type=
"primary"
@
click=
"handleModify(scope.row)"
<el-button
type=
"primary"
@
click=
"handleModify(scope.row)"
>
修改
</el-button
>
修改
</el-button
>
>
<el-button
type=
"primary"
@
click=
"
handleDownload(scope.row.url
)"
<el-button
type=
"primary"
@
click=
"
downloadDeliveryRoute(scope.row
)"
>
下载配送路线
</el-button
>
下载配送路线
</el-button
>
>
<el-button
type=
"primary"
@
click=
"
handleDownload(scope.row.url
)"
<el-button
type=
"primary"
@
click=
"
getEmailRecord(scope.row
)"
>
发送记录
</el-button
>
发送记录
</el-button
>
>
</
template
>
</
template
>
...
@@ -234,7 +234,7 @@
...
@@ -234,7 +234,7 @@
>
>
<div
<div
class=
"emailListContent"
class=
"emailListContent"
v-loading=
"
true
"
v-loading=
"
emailRecordsLoading
"
element-loading-text=
"拼命加载中"
element-loading-text=
"拼命加载中"
element-loading-spinner=
"el-icon-loading"
element-loading-spinner=
"el-icon-loading"
>
>
...
@@ -261,7 +261,9 @@ import {
...
@@ -261,7 +261,9 @@ import {
getList
,
getList
,
getSaveDeliverer
,
getSaveDeliverer
,
getAddDeliverer
,
getAddDeliverer
,
newGetMarketingList
newGetMarketingList
,
getEmailRecords
,
getDeliveryRoutes
}
from
"../../../service/Groupmeal/groupmeal"
;
}
from
"../../../service/Groupmeal/groupmeal"
;
import
{
ElMessage
}
from
"element-plus"
;
import
{
ElMessage
}
from
"element-plus"
;
export
default
{
export
default
{
...
@@ -275,32 +277,13 @@ export default {
...
@@ -275,32 +277,13 @@ export default {
return
{
return
{
sendEmailDialogVisible
:
false
,
// 发送email弹窗
sendEmailDialogVisible
:
false
,
// 发送email弹窗
myEmialInput
:
""
,
// email地址
myEmialInput
:
""
,
// email地址
deliverer_xlsx_id
:
""
,
// 下载配送路线API参数
isEmailRequire
:
false
,
// 验证emial非空
isEmailRequire
:
false
,
// 验证emial非空
emialHasError
:
false
,
// 验证email格式
emialHasError
:
false
,
// 验证email格式
showEmailTableDialogVisible
:
false
,
// 展示email发送情况的dialog
showEmailTableDialogVisible
:
false
,
// 展示email发送情况的dialog
emailListTableData
:
[
emailRecordsLoading
:
false
,
// table-loading
{
pageLoading
:
false
,
email
:
"2016-05-02"
,
emailListTableData
:
[],
sendTime
:
"王小虎"
,
status
:
"上海市普陀区金沙江路 1518 弄"
},
{
email
:
"2016-05-02"
,
sendTime
:
"王小虎"
,
status
:
"上海市普陀区金沙江路 1518 弄"
},
{
email
:
"2016-05-02"
,
sendTime
:
"王小虎"
,
status
:
"上海市普陀区金沙江路 1518 弄"
},
{
email
:
"2016-05-02"
,
sendTime
:
"王小虎"
,
status
:
"上海市普陀区金沙江路 1518 弄"
}
],
rules
:
{
rules
:
{
name
:
[{
required
:
true
,
message
:
"请输入姓名"
,
trigger
:
"blur"
}],
name
:
[{
required
:
true
,
message
:
"请输入姓名"
,
trigger
:
"blur"
}],
max_capacity
:
[
max_capacity
:
[
...
@@ -442,17 +425,19 @@ export default {
...
@@ -442,17 +425,19 @@ export default {
}
}
},
},
// 下载路线
// 下载路线
handleDownload
(
url
)
{
downloadDeliveryRoute
(
rowInfo
)
{
this
.
deliverer_xlsx_id
=
rowInfo
.
deliverer_xlsx_id
;
this
.
sendEmailDialogVisible
=
true
;
// url && window.open("http://bp-dev.ini.yidian-inc.com" + url);
// url && window.open("http://bp-dev.ini.yidian-inc.com" + url);
var
ENV
;
//
var ENV;
if
(
process
.
env
.
NODE_ENV
==
"development"
)
{
//
if (process.env.NODE_ENV == "development") {
ENV
=
"http://bp-dev.ini.yidian-inc.com/"
;
//
ENV = "http://bp-dev.ini.yidian-inc.com/";
}
else
if
(
process
.
env
.
NODE_ENV
==
"test"
)
{
//
} else if (process.env.NODE_ENV == "test") {
ENV
=
"http://bp-test.ini.yidian-inc.com/"
;
//
ENV = "http://bp-test.ini.yidian-inc.com/";
}
else
{
//
} else {
ENV
=
"http://bp.ini.yidian-inc.com/"
;
//
ENV = "http://bp.ini.yidian-inc.com/";
}
//
}
url
&&
window
.
open
(
ENV
+
url
);
//
url && window.open(ENV + url);
},
},
// 分配保存
// 分配保存
async
save
()
{
async
save
()
{
...
@@ -508,15 +493,22 @@ export default {
...
@@ -508,15 +493,22 @@ export default {
}
}
},
},
/* 邮箱弹窗相关操作 */
/* 邮箱弹窗相关操作 */
// 取消
// 下载路线(API)
async
downloadDeliveryRoutesAPI
()
{
await
getDeliveryRoutes
({
deliverer_xlsx_id
:
this
.
deliverer_xlsx_id
,
email
:
this
.
myEmialInput
+
"@yidian-inc.com"
});
},
// 取消下载路线操作
sendEmailDialogCancel
()
{
sendEmailDialogCancel
()
{
this
.
sendEmailDialogVisible
=
false
;
this
.
myEmialInput
=
""
;
// 清空输入
this
.
myEmialInput
=
""
;
// 清空输入
this
.
isEmailRequire
=
false
;
this
.
isEmailRequire
=
false
;
this
.
emialHasError
=
false
;
this
.
emialHasError
=
false
;
this
.
sendEmailDialogVisible
=
false
;
},
},
// 确认
// 确认
下载路线操作
sendEmailDialogConfirm
()
{
async
sendEmailDialogConfirm
()
{
if
(
this
.
myEmialInput
.
trim
()
===
""
)
{
if
(
this
.
myEmialInput
.
trim
()
===
""
)
{
this
.
isEmailRequire
=
true
;
this
.
isEmailRequire
=
true
;
return
;
return
;
...
@@ -525,14 +517,79 @@ export default {
...
@@ -525,14 +517,79 @@ export default {
this
.
emialHasError
=
true
;
this
.
emialHasError
=
true
;
return
;
return
;
}
}
this
.
sendEmailDialogVisible
=
false
;
try
{
this
.
myEmialInput
=
""
;
// 清空输入
this
.
pageLoading
=
true
;
this
.
isEmailRequire
=
false
;
await
this
.
downloadDeliveryRoutesAPI
();
this
.
emialHasError
=
false
;
this
.
pageLoading
=
false
;
this
.
sendEmailDialogCancel
();
ElMessage
.
success
(
"操作成功"
);
}
catch
(
err
)
{
this
.
pageLoading
=
false
;
if
(
err
)
{
ElMessage
.
error
(
err
);
}
else
{
ElMessage
.
error
(
"请求错误"
);
}
}
// this.myEmialInput = ""; // 清空输入
// this.isEmailRequire = false;
// this.emialHasError = false;
// this.sendEmailDialogVisible = false;
},
// 查看邮箱记录(API)
async
getEmailRecordsAPI
()
{
let
data
=
await
getEmailRecords
({
deliverer_xlsx_id
:
this
.
deliverer_xlsx_id
});
this
.
emailListTableData
=
this
.
formatEmailRecord
(
data
.
result
);
},
// 查看发送记录
async
getEmailRecord
(
rowInfo
)
{
this
.
deliverer_xlsx_id
=
rowInfo
.
deliverer_xlsx_id
;
// 赋值 取参数
this
.
showEmailTableDialogVisible
=
true
;
try
{
this
.
emailRecordsLoading
=
true
;
await
this
.
getEmailRecordsAPI
();
this
.
emailRecordsLoading
=
false
;
}
catch
(
err
)
{
this
.
emailRecordsLoading
=
false
;
if
(
err
)
{
ElMessage
.
error
(
err
);
}
else
{
ElMessage
.
error
(
"请求错误"
);
}
}
},
},
//带emailtable的dialog
//带emailtable的dialog
showEmailDialogCancel
()
{
showEmailDialogCancel
()
{
this
.
showEmailTableDialogVisible
=
false
;
this
.
showEmailTableDialogVisible
=
false
;
},
// 数据转换(api-table展示)
// create_time: "2021-08-19 17:38:05"
// deliverer_xlsx_id: 49
// deliverer_xlsx_log_id: 4
// email: "asdasdasdf"
// send_status: 1
// send_time: ""
// update_time: "2021-08-19 17:38:13"
formatEmailRecord
(
initialData
)
{
let
matchRelation
=
{
"0"
:
"待生成"
,
"1"
:
"生成中"
,
"2"
:
"已发送"
,
"3"
:
"发送失败"
};
let
result
=
initialData
.
map
(
item
=>
{
let
res
=
{
email
:
item
.
email
,
sendTime
:
item
.
send_time
,
status
:
matchRelation
[
item
.
send_status
.
toString
()]
};
return
res
;
});
return
result
;
}
}
}
}
};
};
...
...
src/service/Groupmeal/groupmeal.js
View file @
80f84ebc
import
axios
from
"@/utils/request"
;
import
axios
from
"@/utils/request"
;
import
{
handlerSuccessResponse
}
from
"@/utils/handlerResponse"
;
// 获取主页配送员列表
// 获取主页配送员列表
export
async
function
getList
(
params
)
{
export
async
function
getList
(
params
)
{
const
res
=
await
axios
.
post
(
"/api/v1/order/deliverer/list_day_deliverer_conf"
,
params
);
const
res
=
await
axios
.
post
(
"/api/v1/order/deliverer/list_day_deliverer_conf"
,
params
);
return
res
;
return
res
;
}
}
// 获取分配配送员列表
// 获取分配配送员列表
export
async
function
getDelivererList
(
params
)
{
export
async
function
getDelivererList
(
params
)
{
const
res
=
await
axios
.
post
(
const
res
=
await
axios
.
post
(
...
@@ -26,6 +30,17 @@ export async function getSaveDeliverer(params) {
...
@@ -26,6 +30,17 @@ export async function getSaveDeliverer(params) {
);
);
return
res
;
return
res
;
}
}
// 下载配送路线 -lh
export
async
function
getDeliveryRoutes
(
params
)
{
const
res
=
await
axios
.
post
(
"/api/v1/order/deliverer/build_plan"
,
params
);
return
handlerSuccessResponse
(
res
);
}
// 查看邮件记录 -lh
export
async
function
getEmailRecords
(
params
)
{
const
res
=
await
axios
.
post
(
"/api/v1/order/deliverer/plan_down_log"
,
params
);
//return Promise.reject(res);
return
handlerSuccessResponse
(
res
);
}
// 老订单管理
// 老订单管理
...
@@ -53,7 +68,7 @@ export async function getGoodsList(params) {
...
@@ -53,7 +68,7 @@ export async function getGoodsList(params) {
// 获取自提点
// 获取自提点
export
async
function
getSubShopList
(
params
)
{
export
async
function
getSubShopList
(
params
)
{
const
res
=
await
axios
.
get
(
"/api/v1/order/oldbackground/sub_shop_list"
,{
const
res
=
await
axios
.
get
(
"/api/v1/order/oldbackground/sub_shop_list"
,
{
params
params
});
});
return
res
;
return
res
;
...
@@ -98,21 +113,24 @@ export async function refundOrder(orderId, itemsToRefund) {
...
@@ -98,21 +113,24 @@ export async function refundOrder(orderId, itemsToRefund) {
// 订单驳回
// 订单驳回
export
async
function
orderRefundReject
(
params
)
{
export
async
function
orderRefundReject
(
params
)
{
const
res
=
await
axios
.
get
(
"/api/v1/order/oldbackground/order_refund_reject"
,
{
const
res
=
await
axios
.
get
(
"/api/v1/order/oldbackground/order_refund_reject"
,
{
params
params
});
}
);
return
res
;
return
res
;
}
}
// 导出订单
// 导出订单
export
function
getOrderExportURL
(
eventId
,
type
)
{
export
function
getOrderExportURL
(
eventId
,
type
)
{
var
ENV
;
var
ENV
;
if
(
process
.
env
.
NODE_ENV
==
"development"
)
{
if
(
process
.
env
.
NODE_ENV
==
"development"
)
{
ENV
=
"http://bp-dev.ini.yidian-inc.com/"
ENV
=
"http://bp-dev.ini.yidian-inc.com/"
;
}
else
if
(
process
.
env
.
NODE_ENV
==
"test"
)
{
}
else
if
(
process
.
env
.
NODE_ENV
==
"test"
)
{
ENV
=
"http://bp-test.ini.yidian-inc.com/"
ENV
=
"http://bp-test.ini.yidian-inc.com/"
;
}
else
{
}
else
{
ENV
=
"http://bp.ini.yidian-inc.com/"
ENV
=
"http://bp.ini.yidian-inc.com/"
;
}
}
return
`
${
ENV
}
order/oldbackground/order_export?marketing_id=
${
eventId
}
&type=
${
type
}
`
;
return
`
${
ENV
}
order/oldbackground/order_export?marketing_id=
${
eventId
}
&type=
${
type
}
`
;
}
}
...
@@ -129,23 +147,31 @@ export async function newGetOrderList(params) {
...
@@ -129,23 +147,31 @@ export async function newGetOrderList(params) {
// 获取活动名称
// 获取活动名称
export
async
function
newGetMarketingList
()
{
export
async
function
newGetMarketingList
()
{
const
res
=
await
axios
.
get
(
"/api/v1/order/background/order_condition_marketing_list"
);
const
res
=
await
axios
.
get
(
"/api/v1/order/background/order_condition_marketing_list"
);
return
res
;
return
res
;
}
}
// 获取商品名称
// 获取商品名称
export
async
function
newGetGoodsList
(
params
)
{
export
async
function
newGetGoodsList
(
params
)
{
const
res
=
await
axios
.
get
(
"/api/v1/order/background/order_condition_goods_list"
,
{
const
res
=
await
axios
.
get
(
"/api/v1/order/background/order_condition_goods_list"
,
{
params
params
});
}
);
return
res
;
return
res
;
}
}
// 获取自提点
// 获取自提点
export
async
function
newGetSubShopList
(
params
)
{
export
async
function
newGetSubShopList
(
params
)
{
const
res
=
await
axios
.
get
(
"/api/v1/order/background/order_condition_take_place_list"
,{
const
res
=
await
axios
.
get
(
"/api/v1/order/background/order_condition_take_place_list"
,
{
params
params
});
}
);
return
res
;
return
res
;
}
}
...
@@ -185,12 +211,12 @@ export async function newOrderRefundReject(params) {
...
@@ -185,12 +211,12 @@ export async function newOrderRefundReject(params) {
// 导出订单
// 导出订单
export
function
newGetOrderExportURL
(
eventId
,
type
)
{
export
function
newGetOrderExportURL
(
eventId
,
type
)
{
var
ENV
;
var
ENV
;
if
(
process
.
env
.
NODE_ENV
==
"development"
)
{
if
(
process
.
env
.
NODE_ENV
==
"development"
)
{
ENV
=
"http://bp-dev.ini.yidian-inc.com/"
ENV
=
"http://bp-dev.ini.yidian-inc.com/"
;
}
else
if
(
process
.
env
.
NODE_ENV
==
"test"
)
{
}
else
if
(
process
.
env
.
NODE_ENV
==
"test"
)
{
ENV
=
"http://bp-test.ini.yidian-inc.com/"
ENV
=
"http://bp-test.ini.yidian-inc.com/"
;
}
else
{
}
else
{
ENV
=
"http://bp.ini.yidian-inc.com/"
ENV
=
"http://bp.ini.yidian-inc.com/"
;
}
}
return
`
${
ENV
}
order/background/order_export?marketing_id=
${
eventId
}
&type=
${
type
}
`
;
return
`
${
ENV
}
order/background/order_export?marketing_id=
${
eventId
}
&type=
${
type
}
`
;
}
}
src/utils/handlerResponse.js
0 → 100644
View file @
80f84ebc
export
const
handlerSuccessResponse
=
async
response
=>
{
if
(
!
response
||
response
.
code
!==
0
)
{
return
Promise
.
reject
(
response
.
reason
);
}
return
Promise
.
resolve
(
response
);
};
src/utils/tools.js
View file @
80f84ebc
//验证邮箱合法性 (验证头部信息)
//验证邮箱合法性 (验证头部信息)
export
const
checkEmailName
=
emailName
=>
{
export
const
checkEmailName
=
emailName
=>
{
let
str
=
/
[
a-zA-Z0-9_-
]
+/
;
let
str
=
/
[
a-zA-Z0-9_-
]
+/
;
if
(
str
.
test
(
emailName
))
{
if
(
!
str
.
test
(
emailName
))
{
return
false
;
return
false
;
}
else
{
}
else
{
return
true
;
return
true
;
...
...
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