Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
laravelzh
Project
Project
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
冯超鹏
laravelzh
Commits
2b4865bc
Commit
2b4865bc
authored
Dec 18, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新工单流程
parent
39910790
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
18 deletions
+77
-18
AlarmOrderController.php
app/Http/Controllers/AlarmOrderController.php
+5
-0
2020_12_18_090236_add_alarm_order_id_to_userimage_table.php
...20_12_18_090236_add_alarm_order_id_to_userimage_table.php
+32
-0
index.vue
resources/js/views/alarm-order/index.vue
+40
-18
No files found.
app/Http/Controllers/AlarmOrderController.php
View file @
2b4865bc
...
...
@@ -158,6 +158,11 @@ class AlarmOrderController extends Controller
->
first
();
// 工单进度
$order
[
'step'
]
=
AlarmOrderSchedule
::
where
(
'alarm_order_id'
,
'='
,
$request
->
input
(
'id'
))
->
get
();
// 图片
$order
[
'images'
]
=
DB
::
table
(
'userimage'
)
->
select
(
'path'
)
->
where
(
'alarm_order_id'
,
$request
->
input
(
'id'
))
->
get
()
->
toArray
();
return
$this
->
jsonSuccessData
(
$order
);
}
...
...
database/migrations/2020_12_18_090236_add_alarm_order_id_to_userimage_table.php
0 → 100644
View file @
2b4865bc
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
AddAlarmOrderIdToUserimageTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'userimage'
,
function
(
Blueprint
$table
)
{
$table
->
integer
(
'alarm_order_id'
)
->
default
(
0
)
->
comment
(
'报警工单ID'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'userimage'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'alarm_order_id'
);
});
}
}
resources/js/views/alarm-order/index.vue
View file @
2b4865bc
...
...
@@ -9,8 +9,8 @@
placeholder=
"请选择"
>
<el-option
v-for=
"
item
in alarmOrderUsersData"
:key=
"i
tem.id
"
v-for=
"
(item, i)
in alarmOrderUsersData"
:key=
"i
+ '1u'
"
:label=
"item.name"
:value=
"item.id"
>
...
...
@@ -30,8 +30,8 @@
placeholder=
"请选择"
>
<el-option
v-for=
"
item
in optionStatus"
:key=
"i
tem.value
"
v-for=
"
(item,ind)
in optionStatus"
:key=
"i
nd + '2s'
"
:label=
"item.label"
:value=
"item.value"
>
...
...
@@ -99,7 +99,7 @@
<el-table-column
label=
"工单状态"
width=
"130"
>
<
template
slot-scope=
"scope"
>
<span>
<el-tag
:type=
"
scope.row.state==1 ? 'success' : 'warning' "
effect=
"dark"
>
{{
orderStateFilter
(
scope
.
row
.
state
)
}}
</el-tag>
<el-tag
:type=
"
orderStateFilter(scope.row.state, 'type')"
effect=
"dark"
>
{{
orderStateFilter
(
scope
.
row
.
state
,
'content'
)
}}
</el-tag>
</span>
</
template
>
</el-table-column>
...
...
@@ -124,7 +124,7 @@
</el-tooltip>
<el-dialog
title=
"工单详细信息"
:visible
.
sync=
"dialogTableVisible"
width=
"70%"
>
<el-steps
:active=
"order_content.isorderone"
align-center
style=
"margin-bottom: 40px;"
>
<el-step
v-for=
"
item in order_step"
:key=
"item.schedule
"
:title=
"stepFilter(item.schedule)"
:description=
"item.created_at + item.content"
></el-step>
<el-step
v-for=
"
(item, oindex) in order_step"
:key=
"oindex + '1o'
"
:title=
"stepFilter(item.schedule)"
:description=
"item.created_at + item.content"
></el-step>
</el-steps>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
...
...
@@ -177,11 +177,21 @@
<el-form-item
label=
"是否属实"
>
{{ isVerifiedFilter(order_content.is_verified) }}
</el-form-item>
<el-form-item
label=
"进度"
>
{{ isOrderOneFilter(order_content.isorderone) }}
</el-form-item>
<el-form-item
size=
"large"
>
<el-button
type=
"primary"
@
click=
"onSubmitDetail(order_content.id)"
>
确认
</el-button>
<el-button
type=
"primary"
:disabled=
"order_content.isorderone < 4 ? true : false"
@
click=
"onSubmitDetail(order_content.id)"
>
确认
</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
<div
class=
"demo-image__preview"
>
<el-image
v-for=
"(item, index) in order_content.images"
:key=
"index + '1m'"
style=
"width: 100px; height: 100px"
:src=
"item.path"
:preview-src-list=
"order_content.srcList"
>
</el-image>
</div>
</el-col>
</el-row>
</el-dialog>
...
...
@@ -303,7 +313,7 @@ export default {
formSearch
:
{
order_num
:
''
,
deviceNum
:
''
,
state
:
0
,
state
:
99
,
timeRange
:
null
,
page
:
1
,
limit
:
20
,
...
...
@@ -364,7 +374,6 @@ export default {
onSubmitDetail
(
id
)
{
const
data
=
{
state
:
2
,
isorderone
:
4
,
schedule
:
JSON
.
stringify
({
'schedule'
:
1
,
'content'
:
'恭喜,你的工单完成啦!'
,
}),
...
...
@@ -372,6 +381,8 @@ export default {
alarmOrderUpdate
(
data
,
id
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
$message
.
success
(
'恭喜,你的工单完成啦!'
);
this
.
dialogTableVisible
=
false
;
this
.
dataSearch
();
}
}).
catch
(
err
=>
{
console
.
log
(
err
);
...
...
@@ -391,8 +402,10 @@ export default {
},
isOrderOneFilter
(
id
)
{
const
steps
=
[];
steps
[
1
]
=
'到达现场'
;
steps
[
2
]
=
'未到达现场'
;
steps
[
1
]
=
'开始'
;
steps
[
2
]
=
'等待'
;
steps
[
3
]
=
'检修'
;
steps
[
4
]
=
'完成'
;
return
steps
[
id
];
},
stepFilter
(
step
)
{
...
...
@@ -401,7 +414,6 @@ export default {
steps
[
2
]
=
'已接单'
;
steps
[
3
]
=
'进行中'
;
steps
[
4
]
=
'已完成'
;
steps
[
5
]
=
'异常终止'
;
return
steps
[
step
];
},
alarmShow
(
data
)
{
...
...
@@ -413,13 +425,18 @@ export default {
this
.
orderDetail
(
data
.
id
);
this
.
dialogTableVisible
=
true
;
},
orderStateFilter
(
state
)
{
orderStateFilter
(
state
,
type
)
{
const
status
=
[];
status
[
0
]
=
'未接单'
;
status
[
1
]
=
'进行中'
;
status
[
2
]
=
'完成'
;
status
[
3
]
=
'异常终止'
;
return
status
[
state
];
status
[
0
]
=
{
content
:
'未接单'
,
type
:
'danger'
};
status
[
1
]
=
{
content
:
'进行中'
,
type
:
'warning'
};
status
[
2
]
=
{
content
:
'完成'
,
type
:
'success'
};
status
[
3
]
=
{
content
:
'异常终止'
,
type
:
'info'
};
if
(
type
===
'type'
)
{
return
status
[
state
].
type
;
}
if
(
type
===
'content'
)
{
return
status
[
state
].
content
;
}
},
// 工单详情
orderDetail
(
id
)
{
...
...
@@ -436,6 +453,11 @@ export default {
if
(
response
.
code
===
200
)
{
console
.
log
(
response
.
data
);
this
.
order_content
=
response
.
data
;
const
srcList
=
[];
for
(
var
key
in
response
.
data
.
images
)
{
srcList
.
push
(
response
.
data
.
images
[
key
].
path
);
}
this
.
order_content
.
srcList
=
srcList
;
const
order_step
=
response
.
data
.
step
;
for
(
var
step
in
all_steps
)
{
if
(
order_step
[
step
])
{
...
...
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