Commit 2b4865bc authored by Administrator's avatar Administrator

更新工单流程

parent 39910790
......@@ -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);
}
......
<?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');
});
}
}
......@@ -9,8 +9,8 @@
placeholder="请选择"
>
<el-option
v-for="item in alarmOrderUsersData"
:key="item.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="item.value"
v-for="(item,ind) in optionStatus"
:key="ind + '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]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment