flying-monkey/pages/workOrder/workOrder.vue

305 lines
11 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view class="content">
<statusNav returnColor="#c2c2c2" navBarTitle="处理工单"></statusNav>
<container-subgroup-two>
<view slot="content" style="margin: -20rpx -25rpx 0rpx;">
<view class="work-order-schedule">
<view class="li">
<view class="icon on icon-after">1</view>
<view class="text">签到执行</view>
</view>
<view class="li">
<view class="icon icon-after">2</view>
<view class="text">填写维保单</view>
</view>
<view class="li">
<view class="icon">3</view>
<view class="text">结算审核</view>
</view>
</view>
<view class="work-order-from">
<view class="li">
<view class="title flexs">工单编号</view>
<input type="text" disabled class="input" :value="targetObj.workOrderNo" />
</view>
<view class="li">
<view class="title flexs">项目编号</view>
<input type="text" disabled class="input" :value="targetObj.projectNo" />
</view>
<view class="li">
<view class="title flexs">项目名称</view>
<input type="text" disabled class="input input-black" :value="targetObj.projectName" />
</view>
<view class="li">
<view class="title flexs">产品类型</view>
<input type="text" class="input" v-model="targetObj.productType" placeholder="请填写产品类型" :style="{color: targetObj.productType!='' ? '#000' : ''}" />
</view>
<view class="li">
<view class="title flexs">安装位置:</view>
<input type="text" class="input" v-model="targetObj.installLocation" placeholder="请填写安装位置(例:详细地址+某某栋11楼会议室)" :style="{color: targetObj.installLocation!='' ? '#000' : ''}" />
</view>
<view class="li">
<view class="title flexs">维保类型:</view>
<input type="text" class="input" v-model="targetObj.faultType" placeholder="请填写维保类型(例:供电不足)" :style="{color: targetObj.faultType!='' ? '#000' : ''}" />
</view>
<view class="li">
<view class="title flexs">紧急程度:</view>
<input type="text" disabled class="input" placeholder="" :value="targetObj.urgentDegree" />
</view>
<view class="li">
<view class="title flexs"> 维保说明:</view>
<textarea class="input line-h36" v-model="targetObj.faultExplain" style="height: 110rpx;" placeholder="请输入维保说明" :style="{color: targetObj.faultExplain!='' ? '#000' : ''}" />
</view>
<view class="li">
<view class="title flexs">维保图片:</view>
<view class="input">
<view v-for="(item,index) in targetObj.faultImgList" :key="index" v-if="targetObj.faultImgList.length!=0">
<image class="img" :src="item" mode="aspectFill" ></image>
</view>
<view v-if="targetObj.faultImgList.length!=2" @tap="chooseImg" class="img disjcac" style="background-color: #DDDDDD;">
<image src="/static/iocn/jia.png" style="width: 80rpx;height: 80rpx;position: relative!important;" lazy-load></image>
</view>
</view>
</view>
</view>
<view class="work-order-from">
<view class="li">
<view class="title flexs">报 单 人:</view>
<input type="text" style="margin-left: 14rpx;" disabled class="input" placeholder="" :value="targetObj.reporter" />
</view>
<view class="li">
<view class="title flexs">报单时间:</view>
<input type="text" disabled disabled class="input" placeholder="" :value="targetObj.declarationTime" />
</view>
<view class="li">
<view class="title flexs">服务方式:</view>
<input type="text" v-model="targetObj.serviceMode" class="input input-black" placeholder="请填写服务方式(例:上门服务)" :style="{color: targetObj.serviceMode!='' ? '#000' : ''}" />
</view>
<view class="li">
<view class="title flexs">定位地址:</view>
<input type="text" disabled class="input" :value="targetObj.address" />
</view>
</view>
<button class="submit-button" @click="goWorkOrderThree()" type="default"></button>
</view>
</container-subgroup-two>
</view>
</template>
<script>
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
import statusNav from '../../components/status-nav.vue';
import footTabOne from "../../components/foot-tabs/foot-tab-one.vue"
import {handleWorkOrderGet,handleWorkOrderSubmit} from '../../jsFile/public-api.js';
export default {
components: {
footTabOne,
statusNav,
containerSubgroupTwo
},
data() {
return {
targetObj:{
workOrderNo:'GD20211203-001',// 工单编号
projectNo:'GD20211203-001', // 项目编号
projectName:'湖南省林业科学院11楼会议室P2.5', // 项目名称
productType:'一拳超人', // 产品类型
installLocation:'手臂', // 安装位置
faultType:'脱节', // 维保类型
urgentDegree:'紧急', // 紧急程度
faultExplain:'摔了一跤', // 维保说明
faultImgList:[], // 维保图片
reporter:'林某', // 报单人
declarationTime:'2022/3/31 12:01:00', //报单时间
serviceMode: '手把手' ,// 服务方式
address:'四川省成都市成华区' ,// 定位地址
startTime:'' ,// 开始时间
endTime:'', // 结束时间
maintenanceTime:'',// 维保用时
waitingTime:'',// 等待时长
maintainer:'陈志远',//主维保人
ifParts:false,//是否更换配件
workDescribe:'',// 工作描述
maintenanceImgList:[],//维保图片
faultReason:'',//维保原因
maintenancePersonnel:''//维保人员
},
flag:true
}
},
onShow() {
uni.removeStorageSync('partsList');
uni.removeStorageSync('targetObj');
},
onLoad(op) {
if(op.id!=undefined) {
this.orderId = op.id;
this.handleWorkOrderGet(this.orderId);
}
},
methods: {
// 查看信息签到执行
handleWorkOrderGet(id){
let params = {
order_id:id,
steps:1
}
handleWorkOrderGet(params).then(res=>{
if(res.code) {
let dataObj = res.data;
this.targetObj.workOrderNo = dataObj.order_number;//工单编号
this.targetObj.projectNo = dataObj.project_number;//项目编号
this.targetObj.projectName = dataObj.project_name;//项目名称
this.targetObj.urgentDegree = dataObj.emergency_level_view;//紧急程度
this.targetObj.reporter = dataObj.order_contact;//报单人
this.targetObj.declarationTime = dataObj.order_times;//报单时间
this.targetObj.address = dataObj.order_times;//定位地址
}
})
},
// 上传图片
chooseImg(){
uni.chooseImage({
count:1,
sourceType:['album','camera'],
success: (res) => {
let imgsrc = res.tempFilePaths[0];
this.targetObj.faultImgList.push(imgsrc);
}
})
},
// 签到事件
goWorkOrderThree() {
if(this.checkEmpty()){
if(this.flag) {
this.flag = false;
this.targetObj.startTime = this.$toolAll.tools.returnCurrentTime('-',0);
uni.setStorageSync('targetObj',this.targetObj);
let params = {
steps:1,
order_id:this.orderId || 14,//工单id
start_address:'四川省成都市成华区',//开工地址
a:this.targetObj.productType,//产品类型
b:this.targetObj.installLocation,//安装位置
c:this.targetObj.faultType,//维保类型
d:this.targetObj.faultExplain,//维保说明
e:this.targetObj.maintenanceImgList,//维保图片
f:this.targetObj.serviceMode//服务方式
}
handleWorkOrderSubmit(params).then(res=>{
if(res.code) {
uni.navigateTo({
url: `/pages/workOrder/workorderTwo?id=${this.orderId}`
})
}
this.flag = true;
})
}
}
},
// 判空
checkEmpty(){
let result = false;
if(!this.targetObj.productType) {
this.$toolAll.tools.showToast('请填写产品类型');
} else if(!this.targetObj.installLocation) {
this.$toolAll.tools.showToast('请填写安装位置');
} else if(!this.targetObj.faultType) {
this.$toolAll.tools.showToast('请填写维保类型');
} else if(!this.targetObj.faultExplain) {
this.$toolAll.tools.showToast('请填写维保说明');
} else if(this.targetObj.faultImgList.length==0) {
this.$toolAll.tools.showToast('请添加维保图片');
} else if(!this.targetObj.serviceMode) {
this.$toolAll.tools.showToast('请填写服务方式');
} else {
result = true;
}
return result;
}
}
}
</script>
<style>
.submit-button {
margin-top: 60rpx;
}
.work-order-schedule {
display: flex;
padding: 22rpx 29rpx;
margin-top: 10rpx;
background-color: #FFFFFF;
justify-content: space-between;
}
.work-order-schedule .icon {
width: 38rpx;
height: 38rpx;
color: #FFFFFF;
margin: auto;
position: relative;
font-size: 24rpx;
margin-bottom: 10rpx;
text-align: center;
line-height: 38rpx;
background-color: #999999;
border-radius: 50%;
}
.work-order-schedule .on {
background-color: #5391F3
}
.work-order-schedule .text {
font-size: 24rpx;
color: #333333;
}
.work-order-schedule .icon-after::after {
content: "";
width: 265rpx;
height: 2rpx;
background-color: #999999;
position: absolute;
top: 19rpx;
left: 38rpx;
}
.work-order-from {
margin-top: 10rpx;
background-color: #FFFFFF;
}
.work-order-from .li {
display: flex;
padding: 20rpx 40rpx;
border-bottom: 2rpx solid #ececec;
}
.work-order-from .li .title {
font-size: 26rpx;
/* width: 150rpx; */
}
.work-order-from .li .input {
font-size: 24rpx;
color: #8b8b8b;
flex: 1;
padding-left: 15rpx;
display: flex;
}
.work-order-from .li .input .img {
width: 169rpx;
height: 127rpx;
margin-right: 10rpx;
}
.work-order-from .li .input-black {
color: #292929;
}
</style>