123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665 |
- <template>
- <!--工单详情-->
- <!--工单详情-->
- <view class="workDetail">
- <view class="con">
- <image src="http://resource.weilaibike.com/yunwei/detail.png" @click="goHome" class="bike"></image>
- <view class="work">
- <view style="font-size:28rpx; white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width:80%;">{{detail.reason}}</view>
- <view style="font-size:40rpx;margin-top:15rpx;">
- <text> {{detail.bike_no}}</text>
- <text style="margin-left:10rpx;"> (级别:{{detail.times}}级)</text>
- </view>
- </view>
- <view class="info flex">
- <view>
- <view>创建人</view>
- <view class="msg">{{detail.created_man}}</view>
- </view>
- <view>
- <view>处理人</view>
- <view class="msg">{{detail.received_name ? detail.received_name:'暂无'}}</view>
- </view>
- <view>
- <view>关闭人</view>
- <view class="msg">{{detail.work_over_name ?detail.work_over_name : '暂无'}}</view>
- </view>
- </view>
- <view class="position flex">
- <image src="http://resource.weilaibike.com/yunwei/pos.png"></image>
- <view style="color:#000;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;width:80%;">发生位置:{{detail.location}}</view>
- </view>
- </view>
- <view class="loading">工单进程</view>
- <view class="step">
- <view class="flexCC" style="margin-top:20rpx;">
- <image src="http://resource.weilaibike.com/yunwei/circle1.png" class="circle"></image>
- <image src="http://resource.weilaibike.com/yunwei/ellipsis.png" class="line"></image>
- <image src="http://resource.weilaibike.com/yunwei/circle1.png" class="circle"></image>
- <image src="http://resource.weilaibike.com/yunwei/ellipsis.png" class="line"></image>
- <image src="http://resource.weilaibike.com/yunwei/circle1.png" class="circle"></image>
- <image src="http://resource.weilaibike.com/yunwei/ellipsis.png" class="line"></image>
- <image src="http://resource.weilaibike.com/yunwei/circle1.png" class="circle"></image>
- </view>
- <view class="list" style="width:100%;">
- <view class="stepCon flexB" v-if="four">
- <view>
- <view>已完成</view>
- <view style="color:#FF6300;">{{detail.work_over_name}}</view>
- </view>
- <view>{{detail.work_over_time}}</view>
- </view>
- <view class="stepCon flexB" v-if="three">
- <view>
- <view>已处理</view>
- <view style="color:#FF6300;">{{detail.work_over_name}}</view>
- </view>
- <view>{{detail.work_over_time}}</view>
- </view>
- <view class="stepCon flexB" v-if="two">
- <view>
- <view>处理中</view>
- <view style="color:#FF6300;">{{detail.received_name}}</view>
- </view>
- <view>{{detail.received_at}}</view>
- </view>
- <view class="stepCon flexB" v-if="one">
- <view>
- <view>待接单</view>
- <view style="color:#FF6300;">{{detail.created_man}}</view>
- </view>
- <view>{{detail.created_at}}</view>
- </view>
- </view>
- </view>
- <view class="operate">
- <view class="flexC" @click="alarm">查看警报</view>
- <image src="http://resource.weilaibike.com/yunwei/btn.png" @click="openICon"></image>
- </view>
- <!-- 查看警报 -->
- <view class="cover" v-if="alarmShow" @click="closeAlarm"></view>
- <view class="alarmCon " v-if="alarmShow">
- <view class="alarmTitle flexC">
- <text>{{detail.bike_no}}报警列表</text>
- </view>
- <view class="alarmTab flexC">
- <view @click="alarmChoose" v-bind:data-state="0">限制报警类型</view>
- <view @click="alarmChoose" v-bind:data-state="1">不限制报警类型</view>
- </view>
- <scroll-view scroll-y="true" class="scroll">
- <view class="scrollCon">
- <view class="alList" v-for="(item,index2) in alarmList" :key='index2'>
- <view>{{item.type_name}}</view>
- <view class="source flexB">
- <text>来源:{{item.source}}</text>
- <text>时间:{{item.created_at}}</text>
- </view>
- </view>
- <view class="no" v-if="alarmList.length == 0">
- <image src="http://resource.weilaibike.com/none.png"></image>
- <view>暂无相关数据~</view>
- </view>
- </view>
- </scroll-view>
- <view>
- </view>
- </view>
- <!-- 显示操作步骤 -->
- <view class="cover" v-if="iconShow" @click="closeIcon"></view>
- <view class="icon" v-if="iconShow" :style="screenHeight=='xSeries' ? 'bottom:27%' : 'bottom:12%'">
- <view class="button" @click="closeIcon">
- <image src="http://resource.weilaibike.com/common/button.png" :style="screenHeight=='xSeries' ? 'bottom:16%' : 'bottom:-2%'"></image>
- </view>
- <view @click="finish" v-if="detail.planned==2">
- <text>已处理好,正常关闭</text>
- <image src="http://resource.weilaibike.com/common/finish.png"></image>
- </view>
- <view @click="reported" v-if="detail.planned==2">
- <text>可以上线,但有情况需要上报组长处理</text>
- <image src="http://resource.weilaibike.com/common/online.png"></image>
- </view>
- <view @click="reported" v-if="detail.planned==2">
- <text>有故障,报告组长并下线车辆</text>
- <image src="http://resource.weilaibike.com/common/outline.png"></image>
- </view>
- <view @click="getWork" v-if="detail.planned==1">
- <text>领取工单</text>
- <image src="http://resource.weilaibike.com/common/get.png"></image>
- </view>
- </view>
- <!-- 上报组长弹框 -->
- <view class="cover" v-if="commitShow" @click="closeIcon"></view>
- <view class="commit" v-if="commitShow">
- <view v-if="inpShow">
- <view class="title">生成组长工单</view>
- <input placeholder="请输入报告组长内容" bindinput="input"></input>
- </view>
- <view v-else>
- <view class="title">完成并关闭工单</view>
- <view class="detail">已处理好,正常</view>
- </view>
- <view style="text-align:right;">
- <text @click="cancel">取消</text>
- <text style="margin:0 50rpx 0 80rpx;" @click="submit">确定</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- var app = getApp()
- export default {
- data() {
- return {
- planned: 2,
- iconShow: false, //是否显示图标弹窗
- commitShow: false, //上报组长
- inpShow: true, //显示输入框还是显示完成
- detail: [],
- one: false,
- two: false,
- three: false,
- four: false,
- id: '',
- value: '',
- screenHeight: '', //屏幕可视高度
- alarmShow: false, //是否显示警报弹窗【true 显示 false 不显示】
- topNum: 0, //返回顶部
- alarmState: 0, // 【0 限制警报类型 1 不限制报警类型】
- page: 1, //当前页面
- skipDetail: false,
- alarmList: ""
- }
- },
- onLoad(options) {
- this.id = options.id
- this.status();
- },
- methods: {
- status: function() {
- uni.showLoading({
- title: '加载中...',
- })
- app.request('work_order/workOrderDetail?work_order_id=' + this.id, '', 'GET').then(res => {
- console.log(res);
- uni.hideLoading();
- if (res.statusCode == 200) {
- this.detail = res.data,
- this.skipDetail = true
- if (res.data.planned == 4) {
- this.one = true,
- this.two = true,
- this.three = true,
- this.four = true
- } else if (res.data.planned == 3) {
- this.one = true,
- this.two = true,
- this.three = true
- } else if (res.data.planned == 2) {
- this.one = true,
- this.two = true
- } else if (res.data.planned == 1) {
- this.one = true
- }
- }
- })
- },
- alarm: function() {
- this.alarmShow = true
- this.getAlarm();
- },
- getAlarm: function() {
- uni.showLoading({
- title: '加载中...',
- })
- app.request('work_order/getWarningByWorkOrderId?id=' + this.id + '&is_limit_type=' + this.alarmState, '',
- 'GET').then(res => {
- uni.hideLoading();
- if (res.statusCode == 200) {
- this.alarmList = res.data
- }
- console.log(res)
- })
- },
- closeAlarm: function() {
- this.alarmShow = false
- },
- alarmChoose: function(e) {
- let state = e.currentTarget.dataset.state;
- this.alarmState = state,
- this.alarmList = []
- this.getAlarm();
- // sthis.goTop();
- },
- goHome: function() {
- if (this.skipDetail) {
- uni.reLaunch({
- url: '/pages/logs/logs?bike_no=' + this.detail.bike_no,
- })
- } else {
- uni.showToast({
- title: '页面加载完后再试',
- icon: 'none'
- })
- }
- },
- //打开图标弹窗
- openICon: function() {
- if (this.detail.planned == 4) {
- uni.showToast({
- title: '已完成',
- icon: 'none'
- })
- } else {
- this.iconShow = true
- }
- },
- //关闭图标弹窗
- closeIcon: function() {
- this.iconShow = false,
- this.commitShow = false,
- this.inpShow = false
- },
- //领取工单
- getWork: function() {
- uni.showLoading({
- title: '接单中..',
- })
- app.request('work_order/receive?work_order_id=' + this.id, '', 'GET').then(res => {
- uni.hideLoading();
- this.status()
- uni.showToast({
- title: '接单成功',
- icon: 'none'
- })
- this.iconShow = false
- })
- },
- //上报组长
- reported: function() {
- this.commitShow = true,
- this.iconShow = false,
- this.inpShow = true
- },
- //完成
- finish: function() {
- this.iconShow = false,
- this.commitShow = true,
- this.inpShow = false
- },
- //取消按钮
- cancel: function() {
- this.commitShow = false
- },
- //确定按钮
- submit: function() {
- uni.showLoading({
- title: '加载中...',
- })
- let condition = this.inpShow
- if (condition == true) {
- //调上报组长接口
- var data = {
- work_order_id: this.id,
- remark: this.value
- }
- app.request('work_order/upgrade', data, 'POST').then(res => {
- uni.hideLoading();
- console.log(res);
- if (res.statusCode == 200) {
- uni.showToast({
- title: '上报成功',
- icon: 'none'
- })
- this.inpShow = false,
- this.iconShow = false,
- this.commitShow = false
- this.status()
- }
- })
- } else {
- app.request('work_order/over?work_order_id=' + this.id, '', 'GET').then(res => {
- if (res.statusCode == 200) {
- uni.showToast({
- title: '处理完成',
- icon: 'none'
- })
- this.inpShow = false,
- this.iconShow = false,
- this.commitShow = false
- this.status()
- }
- })
- }
- },
- }
- }
- </script>
- <style>
- @import url("/static/css/base.css");
- /* pages/workDetail/workDetail.wxss */
- .workDetail .con {
- height: 380rpx;
- width: 95%;
- margin: 30rpx auto 0;
- background: url('http://resource.weilaibike.com/yunwei/workbg2.png') no-repeat;
- background-size: cover;
- position: relative;
- }
- /* .con>view {
- height: 50%;
- } */
- .con view {
- font-size: 26rpx;
- color: #fff;
- /* margin-top: 15rpx; */
- padding-left: 20rpx;
- }
- .con .bike {
- position: absolute;
- top: 0;
- right: 21rpx;
- width: 160rpx;
- height: 50rpx;
- }
- .con .reason {
- font-size: 32rpx;
- padding: 40rpx 0 10rpx 20rpx;
- }
- .con .work {
- display: flex;
- flex-direction: column;
- justify-content: center;
- padding-left: 68rpx;
- height: 50%;
- }
- .con .iconfont {
- font-size: 100rpx;
- color: #fff;
- position: absolute;
- bottom: 37rpx;
- right: 65rpx;
- }
- .info {
- height: 25%;
- }
- .info>view {
- width: 27.33%;
- text-align: center;
- }
- .info view {
- color: #212121;
- font-size: 24rpx;
- }
- .info .msg {
- font-weight: bold;
- margin-top: 15rpx;
- }
- .position {
- height: 25%;
- }
- .position image {
- width: 24rpx;
- height: 28rpx;
- margin-left: 15rpx;
- }
- .position view {
- font-size: 22rpx;
- }
- .loading {
- width: 90%;
- margin: 0 auto;
- font-size: 34rpx;
- font-weight: bold;
- padding: 35rpx 0 24rpx 0;
- }
- .step {
- width: 90%;
- margin: 0 auto;
- display: flex;
- justify-content: flex-start;
- }
- .step .circle {
- height: 28rpx;
- width: 28rpx;
- margin-bottom: 13rpx;
- }
- .step .line {
- height: 125rpx;
- width: 6rpx;
- }
- .stepCon {
- width: 95%;
- height: 114rpx;
- margin: 20rpx 0 0 20rpx;
- box-shadow: 0 0 6rpx 0 rgba(216, 216, 216, 1);
- border-radius: 10rpx;
- padding: 5rpx 40rpx;
- box-sizing: border-box;
- }
- .stepCon view {
- font-size: 24rpx;
- color: #4d4d4d;
- padding: 8rpx 0;
- }
- .icon {
- position: absolute;
- right: 12%;
- z-index: 9999;
- text-align: right;
- }
- .operate image {
- height: 148rpx;
- width: 148rpx;
- }
- .operate {
- width: 95%;
- margin: 0 auto;
- display: flex;
- justify-content: space-between;
- }
- .operate view {
- font-size: 28rpx;
- width: 200rpx;
- height: 88rpx;
- background: linear-gradient(to right, rgba(253, 142, 111, 1) 0%, rgba(249, 129, 12, 1) 100%);
- box-shadow: 0 12rpx 26rpx 0 rgba(255, 189, 165, 1);
- color: #fff;
- border-radius: 10rpx;
- margin-top: 20rpx;
- }
- .icon view {
- margin-bottom: 30rpx;
- }
- .icon image {
- height: 60rpx;
- width: 60rpx;
- vertical-align: middle;
- margin-left: 20rpx;
- }
- .icon view text {
- font-size: 26rpx;
- padding: 10rpx 40rpx;
- border-radius: 10rpx;
- background: rgba(0, 0, 0, 0.5);
- color: #fff;
- }
- .button image {
- width: 200rpx;
- height: 200rpx;
- position: fixed;
- right: 10rpx;
- }
- .commit {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- background: #fff;
- width: 640rpx;
- height: 296rpx;
- z-index: 9999;
- border-radius: 8rpx;
- padding: 20rpx;
- box-sizing: border-box;
- }
- .commit input {
- font-size: 28rpx;
- border-bottom: 1px solid #000;
- margin: 40rpx 0;
- padding-bottom: 15rpx;
- }
- .commit .placeholder {
- font-size: 24rpx;
- color: #ADADAD;
- }
- .commit .title {
- font-size: 34rpx;
- color: #282828;
- font-weight: 600;
- }
- .commit .detail {
- margin: 40rpx 0;
- font-size: 26rpx;
- }
- .commit text {
- font-size: 26rpx;
- color: #F9831F;
- }
- /* 警报弹窗 */
- .alarmCon {
- background: #fff;
- position: fixed;
- bottom: 0%;
- left: 0%;
- z-index: 9999;
- width: 100%;
- border-top-left-radius: 25rpx;
- border-top-right-radius: 25rpx;
- }
- .alarmTitle {
- width: 100%;
- padding-top: 20rpx;
- }
- .alarmTab {
- width: 90%;
- margin: 20rpx auto 0rpx;
- background: #fff;
- padding: 15rpx;
- }
- .alarmTitle text {
- font-size: 32rpx;
- font-weight: 600;
- }
- .alarmTab view {
- font-size: 28rpx;
- padding: 15rpx 30rpx;
- color: #F9831F;
- border: 1px solid #F9831F;
- }
- .alarmTab view:first-child {
- border-top-left-radius: 15rpx;
- border-bottom-left-radius: 15rpx;
- }
- .alarmTab view:last-child {
- border-top-right-radius: 15rpx;
- border-bottom-right-radius: 15rpx;
- }
- .alarmTab .cur {
- background: #F9831F;
- color: #fff;
- }
- .alarmCon .alList:first-child {
- margin-top: 20rpx;
- }
- .alList {
- width: 90%;
- margin: 0rpx auto 20rpx;
- box-shadow: 0 0 13rpx 0 rgba(216, 216, 216, 1);
- border-radius: 10rpx;
- padding: 15rpx 20rpx;
- }
- .alList .source {
- font-size: 26rpx;
- margin-top: 15rpx;
- color: #555;
- }
- .no {
- width: 100%;
- margin: 0 auto;
- text-align: center;
- margin-top: 121rpx;
- }
- .no image {
- width: 200rpx;
- height: 200rpx;
- margin-bottom: 20rpx;
- }
- .scroll {
- height: 840rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .scrollCon {
- padding: 0rpx 0 20rpx 0;
- }
- </style>
|