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
06076d4e
Commit
06076d4e
authored
Jul 17, 2019
by
lixy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
违章查询
parent
b57cefce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
323 additions
and
76 deletions
+323
-76
rentVehicle.js
src/api/order/rentVehicle.js
+29
-1
illegalModal.vue
src/views/order/rentVehicleInfo/illegalModal.vue
+257
-0
index.vue
src/views/order/rentVehicleInfo/index.vue
+37
-75
No files found.
src/api/order/rentVehicle.js
View file @
06076d4e
...
...
@@ -6,4 +6,32 @@ export function page(query) {
method
:
'get'
,
params
:
query
});
}
\ No newline at end of file
}
/**
* 根据id获取一条违章查询记录
* @param query
*/
export
function
getOneIllegalRow
(
id
)
{
return
fetch
({
url
:
'/api/order/orderViolation/getOne/'
+
id
,
method
:
'get'
});
}
/**
* 保存违章记录
* @param query
* {price:图片地址(多个逗号分割)
price:退款总金额
detailId:租车订单id
}
*/
export
function
saveOrderViolation
(
params
)
{
return
fetch
({
url
:
'/api/order/orderViolation/saveOrderViolation'
,
method
:
'post'
,
data
:
params
});
}
src/views/order/rentVehicleInfo/illegalModal.vue
0 → 100644
View file @
06076d4e
<
template
>
<el-dialog
title=
"违章查询"
:visible
.
sync=
"isVisible"
>
<el-form>
<el-row>
<el-col
:span=
"24"
>
<el-form-item
label=
"订单号"
>
<span>
{{
row
.
no
}}
</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"订单金额"
>
<span>
{{
row
.
realAmount
}}
</span>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"车牌号"
>
<span>
{{
row
.
vehicleNumberPlat
}}
</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"24"
>
<el-form-item
label=
"用户ID/实名"
>
<span>
{{
row
.
userId
}}
</span>
/
<span>
{{
row
.
username
}}
</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"取车"
>
<span>
{{
dateFormat
(
row
.
orderRentVehicleDetail
.
startTime
)
}}
</span>
</el-form-item>
</el-col>
<el-col
:span=
"16"
>
<el-form-item
label=
"交车公司"
>
<span>
{{
row
.
startCompanyName
}}
</span>
<span>
(
{{
row
.
orderRentVehicleDetail
.
startCityName
}}{{
row
.
orderRentVehicleDetail
.
startAddr
}}
)
</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"还车"
>
<span>
{{
dateFormat
(
row
.
orderRentVehicleDetail
.
endTime
)
}}
</span>
</el-form-item>
</el-col>
<el-col
:span=
"16"
>
<el-form-item
label=
"收车公司"
>
<span><span>
{{
row
.
endCompanyName
}}
</span>
<span>
(
{{
row
.
orderRentVehicleDetail
.
endCityName
}}{{
row
.
orderRentVehicleDetail
.
endAddr
}}
)
</span></span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item
label=
"违章截图"
:style=
"
{display:'block'}">
<!--
<el-upload-->
<!--action="https://xxtest.upyuns.com/api/universal/file/app/unauth/admin/upload"-->
<!--list-type="picture-card"-->
<!--:headers="getHeaderWithToken"-->
<!--:on-success="handleSuccess"-->
<!--:on-remove="handleRemove">-->
<!--
<i
class=
"el-icon-plus"
></i>
-->
<!--
</el-upload>
-->
<!--
<el-dialog
v-model=
"dialogVisible"
size=
"tiny"
>
-->
<!--
<img
width=
"100%"
:src=
"dialogImageUrl"
alt=
""
>
-->
<!--
</el-dialog>
-->
<el-upload
class=
"upload-demo"
:headers=
"getHeaderWithToken"
action=
"https://xxtest.upyuns.com/api/universal/file/app/unauth/admin/upload"
:on-remove=
"handleRemove"
:file-list=
"fileList2"
:on-success=
"handleSuccess"
list-type=
"picture-card"
>
<!--
<div
slot=
"tip"
class=
"el-upload__tip"
>
最多上传5张
</div>
-->
<i
class=
"el-icon-plus"
></i>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item
label=
"违章罚款"
style=
"display: inline-block;"
>
<el-input
v-model=
"price"
type=
"number"
placeholder=
"请输入违章罚款金额"
></el-input>
</el-form-item>
</el-row>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"okHandler('form')"
>
确 定
</el-button>
</div>
</el-dialog>
</
template
>
<
script
>
import
{
page
,
saveOrderViolation
}
from
'api/order/rentVehicle'
;
import
{
mapGetters
}
from
'vuex'
;
import
{
formatDate
}
from
'../../../utils/dateFormattor'
;
import
{
getToken
}
from
'../../../utils/auth'
;
import
{
getOneIllegalRow
}
from
'api/order/rentVehicle'
;
import
ElRow
from
"element-ui/packages/row/src/row"
;
import
ElInput
from
"../../../../node_modules/element-ui/packages/input/src/input.vue"
;
import
ElCol
from
"element-ui/packages/col/src/col"
;
import
ElFormItem
from
"../../../../node_modules/element-ui/packages/form/src/form-item.vue"
;
import
ElForm
from
"../../../../node_modules/element-ui/packages/form/src/form.vue"
;
export
default
{
props
:
[
"row"
],
name
:
'illegalDialog'
,
components
:
{
ElForm
,
ElFormItem
,
ElCol
,
ElInput
,
ElRow
},
data
()
{
return
{
price
:
undefined
,
//违章罚款金额
isVisible
:
false
,
fileList2
:[],
//违章截图
}
},
created
()
{
},
watch
:
{
isVisible
(
newValue
,
oldValue
){
if
(
!
newValue
){
this
.
$emit
(
'illegalEvent'
,
false
);
}
},
},
mounted
()
{
let
that
=
this
;
// if(that.row.refundStatus == 3) {
//refundStatus退款状态 0、未退款 1、已退还所有(取消订单时)2、 已退还部分(保留违章预备金)3、已退还所有押金(扣除该扣除的)
that
.
getOne
(
that
.
row
.
detailId
);
// }
this
.
isVisible
=
true
;
},
computed
:
{
...
mapGetters
([
'elements'
,
]),
getHeaderWithToken
()
{
return
{
Authorization
:
getToken
()};
}
},
methods
:
{
/**
* 根据id查询一条记录
* */
getOne
(
id
){
let
t
=
this
;
getOneIllegalRow
(
id
).
then
(
response
=>
{
if
(
response
.
status
==
200
){
let
arr
=
response
.
data
.
picture
.
split
(
","
);
let
fileList2
=
[];
let
p
=
{};
arr
.
map
(
function
(
item
){
p
=
{
url
:
item
};
fileList2
.
push
(
p
);
});
t
.
price
=
parseFloat
(
response
.
data
.
price
);
t
.
fileList2
=
fileList2
;
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
response
.
menu
,
type
:
'error'
,
duration
:
2000
});
}
})
},
/**
* 上传成功
* */
handleSuccess
(
res
,
file
)
{
let
c
=
{
url
:
res
.
data
};
this
.
fileList2
.
push
(
c
);
this
.
showLoadingBody
=
false
;
},
/**
* 删除违章图片
* */
handleRemove
(
file
,
fileList
){
this
.
fileList2
=
fileList
;
},
/**
* 确定
* */
okHandler
()
{
let
arr
=
[];
this
.
fileList2
.
map
(
function
(
item
){
arr
.
push
(
item
.
url
);
});
let
params
=
{
picture
:
arr
.
join
(
","
),
price
:
this
.
price
,
detailId
:
this
.
row
.
detailId
};
saveOrderViolation
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'创建成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
$emit
(
'illegalEvent'
,
false
);
}
else
{
this
.
$notify
({
title
:
'创建失败'
,
message
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
* 弹框-取消
* */
cancel
()
{
this
.
$emit
(
'illegalEvent'
,
false
);
},
/**
* 格式化时间
* @param timestamp
* @returns {*}
*/
dateFormat
(
timestamp
)
{
let
date
=
new
Date
(
timestamp
);
//时间戳为10位需*1000,时间戳为13位的话不需乘1000
return
formatDate
(
date
,
'yyyy-MM-dd hh:mm:ss'
);
},
}
}
</
script
>
<
style
>
.el-form-item__content
{
display
:
inline-block
;
}
</
style
>
src/views/order/rentVehicleInfo/index.vue
View file @
06076d4e
...
...
@@ -22,7 +22,6 @@
<el-option
:key=
"4"
label=
"待出行"
:value=
"4"
></el-option>
<el-option
:key=
"5"
label=
"出行中"
:value=
"5"
></el-option>
<el-option
:key=
"6"
label=
"已完成"
:value=
"6"
></el-option>
</el-select>
</el-form-item>
</el-col>
...
...
@@ -37,7 +36,6 @@
</el-form>
<el-button
class=
"filter-item"
type=
"primary"
v-waves
icon=
"search"
@
click=
"handleFilter"
>
搜索
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
v-waves
icon=
"delete"
@
click=
"clearSearch"
>
清除搜索
</el-button>
</el-button>
</div>
<el-table
:key=
'tableKey'
:data=
"list"
v-loading
.
body=
"listLoading"
border
fit
highlight-current-row
...
...
@@ -85,7 +83,7 @@
<span>
{{
scope
.
row
.
orderAmount
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"110"
align=
"center"
label=
"状态"
>
<
template
scope=
"scope"
>
<span
v-if=
"scope.row.status == '2'"
>
取消
</span>
...
...
@@ -95,16 +93,19 @@
<span
v-if=
"scope.row.status == '6'"
>
已完成
</span>
</
template
>
</el-table-column>
<!-- <el-table-column align="center" label="操作" width="150">
<el-table-column
align=
"center"
label=
"操作"
width=
"150"
>
<
template
scope=
"scope"
>
<el-button v-if="btn_buy && scope.row.state == 0" size="small" type="success" @click="handleBuy(scope.row)">订单详情</el-button>
<el-button v-if="btn_buy && scope.row.state == 0" size="small" type="success" @click="handleBuy(scope.row)">操作</el-button>
<!--status订单状态\n0--删除\n1--创建订单\n2--取消\n3--待付款\n4--待出行\n5--出行中(进行中)\n6--已完成 refundStatus退款状态 0、未退款 1、已退还所有(取消订单时)2、 已退还部分(保留违章预备金)3、已退还所有押金(扣除该扣除的)-->
<!--v-if="scope.row.status == 6"-->
<el-button
size=
"small"
v-if=
"scope.row.status == 6"
type=
"success"
@
click=
"illegalInquiry(scope.row)"
>
违章查询
</el-button>
</
template
>
</el-table-column>
-->
</el-table-column>
</el-table>
<!--违章查询弹框-->
<Illegal
:row=
"currentRow"
v-if=
"illegalVisible"
v-on:illegalEvent =
"illegalEvent"
></Illegal>
<div
v-show=
"!listLoading"
class=
"pagination-container"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"listQuery.page"
:page-sizes=
"[10,20,30, 50]"
:page-size=
"listQuery.limit"
...
...
@@ -114,16 +115,19 @@
</template>
<
script
>
import
Illegal
from
"./illegalModal"
;
//违章查询
import
{
formatDate
}
from
'../../../utils/dateFormattor'
;
import
{
page
}
from
'api/order/rentVehicle'
;
import
{
mapGetters
}
from
'vuex'
;
import
rsCode
from
'../../../utils/rsCode'
;
import
{
formatDate
}
from
'../../../utils/dateFormattor'
;
export
default
{
name
:
'branchCompanyStock'
,
components
:
{
Illegal
,
},
data
()
{
return
{
form
:
{
...
...
@@ -135,6 +139,7 @@
count
:
null
,
state
:
null
},
illegalVisible
:
false
,
//违章查询弹框
rules
:
{
// companyName: [
// {
...
...
@@ -144,20 +149,6 @@
// }
// ],
},
applyState
:
{
'-1'
:
{
key
:
-
1
,
label
:
'放弃购买'
},
0
:
{
key
:
0
,
label
:
'申请中'
},
1
:
{
key
:
1
,
label
:
'确认购买'
}
},
list
:
null
,
total
:
null
,
listLoading
:
true
,
...
...
@@ -186,36 +177,24 @@
computed
:
{
...
mapGetters
([
'elements'
]),
provinceRegions
()
{
return
getSonRegionByCodes
(
1
);
},
cityRegions
()
{
if
(
!
this
.
$utils
.
isInteger
(
this
.
form
.
addrProvince
))
{
return
null
;
}
return
getSonRegionByCodes
(
this
.
form
.
addrProvince
);
}
])
},
methods
:
{
handleBuy
(
row
)
{
this
.
$confirm
(
'此操作将确认购买, 是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
.
then
(()
=>
{
buyStock
(
row
.
id
)
.
then
(()
=>
{
this
.
$notify
({
title
:
'成功'
,
message
:
'操作成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
getList
();
});
});
/**
* 操作-违章查询按钮,显示违章弹框
*/
illegalInquiry
(
row
){
this
.
currentRow
=
row
;
this
.
illegalVisible
=
true
;
},
/**
* 关闭违章查询弹框
* */
illegalEvent
(
params
){
this
.
illegalVisible
=
false
;
if
(
params
){
console
.
log
(
params
);
}
},
handleCancel
(
row
)
{
this
.
$confirm
(
'此操作将放弃购买, 是否继续?'
,
'提示'
,
{
...
...
@@ -235,26 +214,6 @@
this
.
getList
();
});
});
},
handleDelete
(
row
)
{
this
.
$confirm
(
'此操作将永久删除, 是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
.
then
(()
=>
{
delObj
(
row
.
id
)
.
then
(()
=>
{
this
.
$notify
({
title
:
'成功'
,
message
:
'删除成功'
,
type
:
'success'
,
duration
:
2000
});
const
index
=
this
.
list
.
indexOf
(
row
);
this
.
list
.
splice
(
index
,
1
);
});
});
},
handleFilter
()
{
this
.
listQuery
.
page
=
1
;
...
...
@@ -279,6 +238,9 @@
}
this
.
getList
()
},
/**
* 获取订单列表
*/
getList
()
{
this
.
listLoading
=
true
;
console
.
log
(
this
.
listQuery
)
...
...
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