Commit 39910790 authored by Administrator's avatar Administrator

工单详情

parent 68363ce4
......@@ -21,8 +21,8 @@ export function alarmOrderStore(data) {
// 更新
export function alarmOrderUpdate(data, id) {
return request({
url: '/alarm_order/' + id,
method: 'patch',
url: '/alarm_order/order_ok?id=' + id,
method: 'post',
data,
});
}
......
......@@ -176,10 +176,8 @@
<el-form-item label="是否到达现场">{{ isLiveFilter(order_content.is_live) }}</el-form-item>
<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>
<template slot="scope">
<el-button>完成</el-button>
</template>
<el-form-item size="large">
<el-button type="primary" @click="onSubmitDetail(order_content.id)">确认</el-button>
</el-form-item>
</el-form>
</el-col>
......@@ -193,7 +191,7 @@
<script>
import clip from '@/utils/clipboard';
import BackToTop from '@/components/BackToTop';
import { alarmOrderUsers, alarmOrderList, alarmOrderDetail } from '@/api/alarmOrder';
import { alarmOrderUsers, alarmOrderList, alarmOrderDetail, alarmOrderUpdate } from '@/api/alarmOrder';
import Vue from 'vue';
import VueAMap from 'vue-amap';
import { AMapManager } from 'vue-amap';
......@@ -363,6 +361,22 @@ export default {
this.alarmOrdersData();
},
methods: {
onSubmitDetail(id) {
const data = {
state: 2,
isorderone: 4,
schedule: JSON.stringify({
'schedule': 1, 'content': '恭喜,你的工单完成啦!',
}),
};
alarmOrderUpdate(data, id).then(response => {
if (response.code === 200) {
this.$message.success('恭喜,你的工单完成啦!');
}
}).catch(err => {
console.log(err);
});
},
isLiveFilter(id) {
const steps = [];
steps[1] = '到达现场';
......@@ -411,13 +425,13 @@ export default {
orderDetail(id) {
alarmOrderDetail(id).then(response => {
const all_steps = [{
schedule: 1, content: '未接单', created_at: '',
schedule: 1, content: '', created_at: '',
}, {
schedule: 2, content: '进行中', created_at: '',
schedule: 2, content: '', created_at: '',
}, {
schedule: 3, content: '完成', created_at: '',
schedule: 3, content: '', created_at: '',
}, {
schedule: 4, content: '异常终止', created_at: '',
schedule: 4, content: '', created_at: '',
}];
if (response.code === 200) {
console.log(response.data);
......
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