flying-monkey/pages/workOrder/workOrder.vue

247 lines
8.7 KiB
Vue
Raw Normal View History

<template>
<view class="content">
2022-03-28 07:33:10 +00:00
<statusNav returnColor="#c2c2c2" navBarTitle="处理工单"></statusNav>
2022-03-25 10:33:33 +00:00
<container-subgroup-two>
2022-03-28 07:33:10 +00:00
<view slot="content" style="margin: -20rpx -25rpx 0rpx;">
2022-03-28 03:19:05 +00:00
<view class="work-order-schedule">
<view class="li">
2022-03-30 10:51:24 +00:00
<view class="icon on icon-after">1</view>
<view class="text">签到执行</view>
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
2022-03-30 10:51:24 +00:00
<view class="icon icon-after">2</view>
<view class="text">填写维保单</view>
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
2022-03-30 10:51:24 +00:00
<view class="icon">3</view>
<view class="text">结算审核</view>
2022-03-28 03:19:05 +00:00
</view>
</view>
<view class="work-order-from">
<view class="li">
<view class="title flexs">工单编号</view>
2022-03-30 10:51:24 +00:00
<input type="text" disabled class="input" value="GD20211203-001" />
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
<view class="title flexs">项目编号</view>
2022-03-30 10:51:24 +00:00
<input type="text" disabled class="input" value="GD20211203-001" />
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
<view class="title flexs">项目名称</view>
2022-03-30 10:51:24 +00:00
<input type="text" disabled class="input input-black" value="湖南省林业科学院11楼会议室P2.5" />
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
<view class="title flexs">产品类型</view>
2022-03-30 10:51:24 +00:00
<input type="text" class="input" v-model="productType" placeholder="请填写产品类型" :style="{color: productType!='' ? '#000' : ''}" />
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
<view class="title flexs">安装位置</view>
<input type="text" class="input" v-model="installLocation" placeholder="请填写安装位置(例:详细地址+某某栋11楼会议室)" :style="{color: installLocation!='' ? '#000' : ''}" />
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
<view class="title flexs">故障类型</view>
<input type="text" class="input" v-model="faultType" placeholder="请填写故障类型(例:供电不足)" :style="{color: faultType!='' ? '#000' : ''}" />
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
<view class="title flexs">紧急程度</view>
2022-03-30 10:51:24 +00:00
<input type="text" disabled class="input" placeholder="" value="紧急" />
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
<view class="title flexs"> 故障说明</view>
<textarea class="input line-h36" v-model="faultExplain" style="height: 110rpx;" placeholder="请输入故障说明" :style="{color: faultExplain!='' ? '#000' : ''}" />
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
2022-03-30 10:51:24 +00:00
<view class="title flexs">故障图片</view>
2022-03-28 03:19:05 +00:00
<view class="input">
2022-03-30 10:51:24 +00:00
<view v-for="(item,index) in faultImgList" :key="index" v-if="faultImgList.length!=0">
<image class="img" :src="item" mode="aspectFill" ></image>
</view>
<view v-if="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>
2022-03-28 03:19:05 +00:00
</view>
</view>
</view>
<view class="work-order-from">
<view class="li">
<view class="title flexs"> </view>
2022-03-30 10:51:24 +00:00
<input type="text" disabled class="input" placeholder="" value="林某" />
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
<view class="title flexs">报单时间</view>
2022-03-30 10:51:24 +00:00
<input type="text" disabled disabled class="input" placeholder="" value="2021/12/3 12:00:05" />
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
<view class="title flexs">服务方式</view>
<input type="text" v-model="serviceMode" class="input input-black" placeholder="请填写服务方式(例:上门服务)" :style="{color: serviceMode!='' ? '#000' : ''}" />
2022-03-28 03:19:05 +00:00
</view>
<view class="li">
<view class="title flexs">定位地址</view>
2022-03-30 10:51:24 +00:00
<input type="text" disabled class="input" placeholder="定位地址" />
2022-03-28 03:19:05 +00:00
</view>
</view>
<button class="submit-button" @click="goWorkOrderThree()" type="default">签到</button>
2022-03-25 10:33:33 +00:00
</view>
</container-subgroup-two>
</view>
</template>
<script>
2022-03-28 03:19:05 +00:00
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"
export default {
components: {
footTabOne,
2022-03-25 10:33:33 +00:00
statusNav,
containerSubgroupTwo
},
data() {
return {
productType:'', // 产品类型
installLocation:'', // 安装位置
faultType:'', // 故障类型
2022-03-30 10:51:24 +00:00
faultExplain:'', // 故障说明
faultImgList:[], // 故障图片
2022-03-30 10:51:24 +00:00
serviceMode: '' ,// 服务方式
flag:true
}
},
methods: {
2022-03-30 10:51:24 +00:00
// 上传图片
chooseImg(){
uni.chooseImage({
count:1,
sourceType:['album','camera'],
success: (res) => {
let imgsrc = res.tempFilePaths[0];
this.faultImgList.push(imgsrc);
}
})
},
2022-03-28 03:19:05 +00:00
goWorkOrderThree() {
if(this.checkEmpty()){
if(this.flag) {
this.flag = false;
let params = {
a:this.productType,
b:this.installLocation,
c:this.faultType,
d:this.faultExplain,
f:this.faultImgList.join(','),
e:this.serviceMode
}
console.log(params);
uni.navigateTo({
url: "/pages/workOrder/workorderTwo"
})
}
}
},
// 判空
checkEmpty(){
let result = false;
if(!this.productType) {
this.$toolAll.tools.showToast('请填写产品类型');
} else if(!this.installLocation) {
this.$toolAll.tools.showToast('请填写安装位置');
} else if(!this.faultType) {
this.$toolAll.tools.showToast('请填写故障类型');
} else if(!this.faultExplain) {
this.$toolAll.tools.showToast('请填写故障说明');
} else if(this.faultImgList.length==0) {
this.$toolAll.tools.showToast('请添加故障图片');
} else if(!this.serviceMode) {
this.$toolAll.tools.showToast('请填写服务方式');
} else {
result = true;
}
return result;
}
}
}
</script>
<style>
2022-03-25 10:33:33 +00:00
.submit-button {
margin-top: 60rpx;
}
2022-03-25 10:33:33 +00:00
.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;
2022-03-30 10:51:24 +00:00
display: flex;
}
2022-03-25 10:33:33 +00:00
.work-order-from .li .input .img {
width: 169rpx;
height: 127rpx;
margin-right: 10rpx;
}
.work-order-from .li .input-black {
color: #292929;
}
</style>