Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform-ui
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
youjj
cloud-platform-ui
Commits
1660e616
Commit
1660e616
authored
Nov 01, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加后台订单取消
parent
69502ce6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
260 additions
and
59 deletions
+260
-59
rentVehicle.js
src/api/order/rentVehicle.js
+2
-2
index.vue
src/views/order/rentVehicleInfo/index.vue
+117
-28
index.vue
src/views/order/tourOrderInfo/index.vue
+141
-29
No files found.
src/api/order/rentVehicle.js
View file @
1660e616
...
@@ -104,8 +104,8 @@ export function calculate(no, params) {
...
@@ -104,8 +104,8 @@ export function calculate(no, params) {
*/
*/
export
function
getViolatePrice
(
no
)
{
export
function
getViolatePrice
(
no
)
{
return
fetch
({
return
fetch
({
url
:
'/api/order/orderRefund/b
ack
-stage/getViolatePrice/'
+
no
,
url
:
'/api/order/orderRefund/b
g
-stage/getViolatePrice/'
+
no
,
method
:
'
pos
t'
,
method
:
'
ge
t'
,
});
});
}
}
...
...
src/views/order/rentVehicleInfo/index.vue
View file @
1660e616
...
@@ -427,6 +427,22 @@
...
@@ -427,6 +427,22 @@
</div>
</div>
</el-form>
</el-form>
</el-dialog>
</el-dialog>
<el-dialog
title=
"取消订单"
:visible
.
sync=
"showDialog"
>
<el-form>
<el-form-item
label=
"违约金金额:"
>
<el-input
v-model=
"violateAmount"
type=
"number"
@
blur=
"checkViolateAmount()"
auto-complete=
"off"
></el-input>
</el-form-item>
<el-form-item>
<span
class=
"label-text"
>
实际违约金是{{changeViolateAmount}}元
</span>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click =
"handleCancelDialog()"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click =
"handleConfirm()"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
</template>
...
@@ -471,6 +487,11 @@ export default {
...
@@ -471,6 +487,11 @@ export default {
depositRefundRecord
:
[],
depositRefundRecord
:
[],
dedTotal
:
''
,
dedTotal
:
''
,
Tel
:
''
,
Tel
:
''
,
showDialog
:
false
,
changeViolateAmount
:
null
,
violateAmount
:
null
,
row
:
null
,
topAmount
:
null
,
form
:
{
form
:
{
couponAmount
:
undefined
,
couponAmount
:
undefined
,
crtHost
:
undefined
,
crtHost
:
undefined
,
...
@@ -693,45 +714,113 @@ export default {
...
@@ -693,45 +714,113 @@ export default {
},
},
methods
:
{
methods
:
{
//取消订单
//取消订单
cancel
(
row
)
{
cancel
(
row
,
changeViolateAmount
)
{
this
.
$confirm
(
'此操作将取消该订单, 是否继续?'
,
'提示'
,
{
let
that
=
this
;
confirmButtonText
:
'确定'
,
if
(
changeViolateAmount
==
null
||
changeViolateAmount
==
0
)
{
cancelButtonText
:
'取消'
,
this
.
$confirm
(
'此操作将取消该订单, 是否继续?'
,
'提示'
,
{
type
:
'warning'
confirmButtonText
:
'确定'
,
}).
then
(()
=>
{
cancelButtonText
:
'取消'
,
let
params
=
{
type
:
'warning'
cancelReason
:
'后台取消'
,
}).
then
(()
=>
{
appUserId
:
row
.
userId
let
params
=
{
}
cancelReason
:
'后台取消'
,
calculate
(
row
.
no
,
params
).
then
(
data
=>
{
appUserId
:
row
.
userId
,
if
(
data
.
status
==
200
)
{
changeViolateAmount
:
null
this
.
$notify
({
title
:
'成功'
,
message
:
'取消订单成功'
,
type
:
'success'
,
duration
:
2000
})
this
.
getList
()
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
'取消订单失败'
,
type
:
'success'
,
duration
:
2000
})
}
}
calculate
(
row
.
no
,
params
).
then
(
data
=>
{
if
(
data
.
status
==
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'取消订单成功'
,
type
:
'success'
,
duration
:
2000
})
this
.
getList
()
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
'取消订单失败'
,
type
:
'fail'
,
duration
:
2000
})
}
})
})
})
}
else
{
// this.$prompt('请输入违约金', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// inputPattern: /^[0-9]*$/,
// inputErrorMessage: '只能输入数字'
// }).then(({ value }) => {
// this.$message({
// type: 'success',
// message: '你的邮箱是: ' + value
// });
// }).catch(() => {
// this.$message({
// type: 'info',
// message: '取消输入'
// });
// });
that
.
showDialog
=
true
that
.
changeViolateAmount
=
changeViolateAmount
that
.
violateAmount
=
changeViolateAmount
that
.
row
=
row
}
},
checkViolateAmount
()
{
console
.
log
(
this
.
topAmount
)
console
.
log
(
this
.
violateAmount
)
if
(
this
.
topAmount
<
this
.
violateAmount
)
{
this
.
$notify
({
title
:
'失败'
,
message
:
'违约金额不能大于最高限制金额'
+
this
.
topAmount
,
type
:
'fail'
,
duration
:
2000
})
}
},
handleConfirm
()
{
let
params
=
{
cancelReason
:
'后台取消'
,
appUserId
:
this
.
row
.
userId
,
changeViolateAmount
:
this
.
violateAmount
}
calculate
(
this
.
row
.
no
,
params
).
then
(
data
=>
{
if
(
data
.
status
==
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'取消订单成功'
,
type
:
'success'
,
duration
:
2000
})
this
.
showDialog
=
false
this
.
getList
()
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
'取消订单失败'
,
type
:
'fail'
,
duration
:
2000
})
}
})
})
},
},
handleCancelDialog
()
{
this
.
showDialog
=
false
},
handleViolatePrice
(
row
)
{
handleViolatePrice
(
row
)
{
let
that
=
this
;
let
params
=
{
let
params
=
{
cancelReason
:
'后台取消'
,
cancelReason
:
'后台取消'
,
appUserId
:
row
.
userId
appUserId
:
row
.
userId
}
}
getViolatePrice
(
row
.
no
).
then
(
data
=>
{
getViolatePrice
(
row
.
no
).
then
(
data
=>
{
if
(
data
.
status
==
200
)
{
if
(
data
.
status
==
200
)
{
console
.
log
(
data
)
that
.
topAmount
=
data
.
data
.
topAmount
;
that
.
cancel
(
row
,
data
.
data
.
cutAmount
);
}
else
{
}
else
{
this
.
$notify
({
this
.
$notify
({
title
:
'失败'
,
title
:
'失败'
,
...
...
src/views/order/tourOrderInfo/index.vue
View file @
1660e616
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
size=
"small"
size=
"small"
v-if=
"scope.row.status == 3 || scope.row.status == 4"
v-if=
"scope.row.status == 3 || scope.row.status == 4"
class=
"el-button el-button--text el-button--small"
class=
"el-button el-button--text el-button--small"
@
click=
"
cancel
(scope.row)"
@
click=
"
handleViolatePrice
(scope.row)"
>
取消订单
</el-button>
>
取消订单
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -130,7 +130,25 @@
...
@@ -130,7 +130,25 @@
<tourOrderDetailModal
:tourRow=
"tourRow"
:insureDetail=
"insureDetail"
v-if=
"tourDialogVisible"
<tourOrderDetailModal
:tourRow=
"tourRow"
:insureDetail=
"insureDetail"
v-if=
"tourDialogVisible"
:tourCostDetail=
"tourCostDetail"
:tourCostDetail=
"tourCostDetail"
v-on:tourOrderDetailDialogEvent=
"tourOrderDetailDialogEvent"
></tourOrderDetailModal>
v-on:tourOrderDetailDialogEvent=
"tourOrderDetailDialogEvent"
></tourOrderDetailModal>
</div>
<el-dialog
title=
"取消订单"
:visible
.
sync=
"showDialog"
>
<el-form>
<el-form-item
label=
"违约金金额:"
>
<el-input
v-model=
"violateAmount"
type=
"number"
@
blur=
"checkViolateAmount()"
auto-complete=
"off"
></el-input>
</el-form-item>
<el-form-item>
<span
class=
"label-text"
>
实际违约金是{{changeViolateAmount}}元
</span>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click =
"handleCancelDialog()"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click =
"handleConfirm()"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</template>
</template>
<
script
>
<
script
>
...
@@ -140,7 +158,8 @@
...
@@ -140,7 +158,8 @@
page
,
page
,
getAllBranchCompany
,
getAllBranchCompany
,
getAllBranchCompanyByZoneId
,
getAllBranchCompanyByZoneId
,
calculate
calculate
,
getViolatePrice
}
from
'api/order/rentVehicle'
;
}
from
'api/order/rentVehicle'
;
import
{
mapGetters
}
from
'vuex'
;
import
{
mapGetters
}
from
'vuex'
;
import
rsCode
from
'../../../utils/rsCode'
;
import
rsCode
from
'../../../utils/rsCode'
;
...
@@ -162,6 +181,11 @@
...
@@ -162,6 +181,11 @@
},
},
data
()
{
data
()
{
return
{
return
{
showDialog
:
false
,
changeViolateAmount
:
null
,
violateAmount
:
null
,
row
:
null
,
topAmount
:
null
,
form
:
{
form
:
{
couponAmount
:
undefined
,
couponAmount
:
undefined
,
crtHost
:
undefined
,
crtHost
:
undefined
,
...
@@ -378,34 +402,122 @@
...
@@ -378,34 +402,122 @@
/**
/**
* 取消订单
* 取消订单
*/
*/
cancel
(
row
)
{
//取消订单
this
.
$confirm
(
'此操作将取消该订单, 是否继续?'
,
'提示'
,
{
cancel
(
row
,
changeViolateAmount
)
{
confirmButtonText
:
'确定'
,
let
that
=
this
;
cancelButtonText
:
'取消'
,
if
(
changeViolateAmount
==
null
||
changeViolateAmount
==
0
)
{
type
:
'warning'
this
.
$confirm
(
'此操作将取消该订单, 是否继续?'
,
'提示'
,
{
}).
then
(()
=>
{
confirmButtonText
:
'确定'
,
let
params
=
{
cancelButtonText
:
'取消'
,
cancelReason
:
'后台取消'
,
type
:
'warning'
appUserId
:
row
.
userId
}).
then
(()
=>
{
}
let
params
=
{
calculate
(
row
.
no
,
params
).
then
(
data
=>
{
cancelReason
:
'后台取消'
,
if
(
data
.
status
==
200
)
{
appUserId
:
row
.
userId
,
this
.
$notify
({
changeViolateAmount
:
null
title
:
'成功'
,
message
:
'取消订单成功'
,
type
:
'success'
,
duration
:
2000
})
this
.
getList
()
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
'取消订单失败'
,
type
:
'success'
,
duration
:
2000
})
}
}
calculate
(
row
.
no
,
params
).
then
(
data
=>
{
if
(
data
.
status
==
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'取消订单成功'
,
type
:
'success'
,
duration
:
2000
})
this
.
getList
()
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
'取消订单失败'
,
type
:
'fail'
,
duration
:
2000
})
}
})
})
}
else
{
// this.$prompt('请输入违约金', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// inputPattern: /^[0-9]*$/,
// inputErrorMessage: '只能输入数字'
// }).then(({ value }) => {
// this.$message({
// type: 'success',
// message: '你的邮箱是: ' + value
// });
// }).catch(() => {
// this.$message({
// type: 'info',
// message: '取消输入'
// });
// });
that
.
showDialog
=
true
that
.
changeViolateAmount
=
changeViolateAmount
that
.
violateAmount
=
changeViolateAmount
that
.
row
=
row
}
},
checkViolateAmount
()
{
console
.
log
(
this
.
topAmount
)
console
.
log
(
this
.
violateAmount
)
if
(
this
.
topAmount
<
this
.
violateAmount
)
{
this
.
$notify
({
title
:
'失败'
,
message
:
'违约金额不能大于最高限制金额'
+
this
.
topAmount
,
type
:
'fail'
,
duration
:
2000
})
})
}
},
handleConfirm
()
{
let
params
=
{
cancelReason
:
'后台取消'
,
appUserId
:
this
.
row
.
userId
,
changeViolateAmount
:
this
.
violateAmount
}
calculate
(
this
.
row
.
no
,
params
).
then
(
data
=>
{
if
(
data
.
status
==
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'取消订单成功'
,
type
:
'success'
,
duration
:
2000
})
this
.
showDialog
=
false
this
.
getList
()
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
'取消订单失败'
,
type
:
'fail'
,
duration
:
2000
})
}
})
},
handleCancelDialog
()
{
this
.
showDialog
=
false
},
handleViolatePrice
(
row
)
{
let
that
=
this
;
let
params
=
{
cancelReason
:
'后台取消'
,
appUserId
:
row
.
userId
}
getViolatePrice
(
row
.
no
).
then
(
data
=>
{
if
(
data
.
status
==
200
)
{
that
.
topAmount
=
data
.
data
.
topAmount
;
that
.
cancel
(
row
,
data
.
data
.
cutAmount
);
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
'获取违约金失败'
,
type
:
'success'
,
duration
:
2000
})
}
})
})
},
},
...
...
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