2022-03-17 10:26:34 +00:00
|
|
|
|
<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">
|
2022-03-31 05:46:52 +00:00
|
|
|
|
<view class="title flexs">工单编号:</view>
|
2022-03-31 10:34:17 +00:00
|
|
|
|
<input type="text" disabled class="input" :value="targetObj.workOrderNo" />
|
2022-03-28 03:19:05 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
2022-03-31 05:46:52 +00:00
|
|
|
|
<view class="title flexs">项目编号:</view>
|
2022-03-31 10:34:17 +00:00
|
|
|
|
<input type="text" disabled class="input" :value="targetObj.projectNo" />
|
2022-03-28 03:19:05 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
2022-03-31 05:46:52 +00:00
|
|
|
|
<view class="title flexs">项目名称:</view>
|
2022-03-31 10:34:17 +00:00
|
|
|
|
<input type="text" disabled class="input input-black" :value="targetObj.projectName" />
|
2022-03-28 03:19:05 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
2022-03-31 05:46:52 +00:00
|
|
|
|
<view class="title flexs">产品类型:</view>
|
2022-04-15 10:44:40 +00:00
|
|
|
|
<!-- <input type="text" disabled class="input" v-model="targetObj.productType" placeholder="请填写产品类型" :style="{color: targetObj.productType!='' ? '#000' : ''}" /> -->
|
|
|
|
|
<picker class="input input-black" mode="selector" :value="productIndex" :range="productTypeList" :range-key="'name'" @change="changePicker(0,$event)">
|
|
|
|
|
<view>{{productTypeList[productIndex].name}}</view>
|
|
|
|
|
</picker>
|
2022-03-28 03:19:05 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
2022-03-31 05:46:52 +00:00
|
|
|
|
<view class="title flexs">安装位置:</view>
|
2022-03-31 10:34:17 +00:00
|
|
|
|
<input type="text" class="input" v-model="targetObj.installLocation" placeholder="请填写安装位置(例:详细地址+某某栋11楼会议室)" :style="{color: targetObj.installLocation!='' ? '#000' : ''}" />
|
2022-03-28 03:19:05 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
2022-04-12 00:50:56 +00:00
|
|
|
|
<view class="title flexs">维保类型:</view>
|
2022-04-15 10:44:40 +00:00
|
|
|
|
<!-- <input type="text" disabled class="input" v-model="targetObj.faultType" placeholder="请填写维保类型(例:供电不足)" :style="{color: targetObj.faultType!='' ? '#000' : ''}" /> -->
|
|
|
|
|
<picker class="input input-black" mode="selector" :value="faultIndex" :range="faultTypeList" :range-key="'name'" @change="changePicker(1,$event)">
|
|
|
|
|
<view>{{faultTypeList[faultIndex].name}}</view>
|
|
|
|
|
</picker>
|
2022-03-28 03:19:05 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
2022-03-31 05:46:52 +00:00
|
|
|
|
<view class="title flexs">紧急程度:</view>
|
2022-03-31 10:34:17 +00:00
|
|
|
|
<input type="text" disabled class="input" placeholder="" :value="targetObj.urgentDegree" />
|
2022-03-28 03:19:05 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
2022-04-12 00:50:56 +00:00
|
|
|
|
<view class="title flexs"> 维保说明:</view>
|
|
|
|
|
<textarea class="input line-h36" v-model="targetObj.faultExplain" style="height: 110rpx;" placeholder="请输入维保说明" :style="{color: targetObj.faultExplain!='' ? '#000' : ''}" />
|
2022-03-28 03:19:05 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
2022-04-12 00:50:56 +00:00
|
|
|
|
<view class="title flexs">维保图片:</view>
|
2022-03-28 03:19:05 +00:00
|
|
|
|
<view class="input">
|
2022-03-31 10:34:17 +00:00
|
|
|
|
<view v-for="(item,index) in targetObj.faultImgList" :key="index" v-if="targetObj.faultImgList.length!=0">
|
2022-03-30 10:51:24 +00:00
|
|
|
|
<image class="img" :src="item" mode="aspectFill" ></image>
|
|
|
|
|
</view>
|
2022-03-31 10:34:17 +00:00
|
|
|
|
<view v-if="targetObj.faultImgList.length!=2" @tap="chooseImg" class="img disjcac" style="background-color: #DDDDDD;">
|
2022-03-31 05:46:52 +00:00
|
|
|
|
<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">
|
2022-03-31 05:46:52 +00:00
|
|
|
|
<view class="title flexs">报 单 人:</view>
|
2022-03-31 10:34:17 +00:00
|
|
|
|
<input type="text" style="margin-left: 14rpx;" disabled class="input" placeholder="" :value="targetObj.reporter" />
|
2022-03-28 03:19:05 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
2022-03-31 05:46:52 +00:00
|
|
|
|
<view class="title flexs">报单时间:</view>
|
2022-03-31 10:34:17 +00:00
|
|
|
|
<input type="text" disabled disabled class="input" placeholder="" :value="targetObj.declarationTime" />
|
2022-03-28 03:19:05 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
2022-03-31 05:46:52 +00:00
|
|
|
|
<view class="title flexs">服务方式:</view>
|
2022-04-15 10:44:40 +00:00
|
|
|
|
<!-- <input type="text" disabled v-model="targetObj.serviceMode" class="input input-black" placeholder="请填写服务方式(例:上门服务)" :style="{color: targetObj.serviceMode!='' ? '#000' : ''}" /> -->
|
|
|
|
|
<picker class="input input-black" mode="selector" :value="serviceModeIndex" :range="serviceModeList" :range-key="'name'" @change="changePicker(2,$event)">
|
|
|
|
|
<view>{{serviceModeList[serviceModeIndex].name}}</view>
|
|
|
|
|
</picker>
|
2022-03-28 03:19:05 +00:00
|
|
|
|
</view>
|
2022-04-18 09:08:12 +00:00
|
|
|
|
<view class="li" @tap="getAddress">
|
2022-03-31 05:46:52 +00:00
|
|
|
|
<view class="title flexs">定位地址:</view>
|
2022-03-31 10:34:17 +00:00
|
|
|
|
<input type="text" disabled class="input" :value="targetObj.address" />
|
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>
|
2022-03-17 10:26:34 +00:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-03-28 03:19:05 +00:00
|
|
|
|
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
|
2022-04-15 10:44:40 +00:00
|
|
|
|
import statusNav from '@/components/status-nav.vue';
|
|
|
|
|
import footTabOne from "@/components/foot-tabs/foot-tab-one.vue"
|
|
|
|
|
import {handleWorkOrderGet,handleWorkOrderSubmit,getProductType,getFaultType,getServiceMode,uploadImg} from '@/jsFile/public-api.js';
|
|
|
|
|
var QQMapWX = require('@/jsFile/map/qqmap-wx-jssdk.min.js');
|
2022-04-22 10:39:36 +00:00
|
|
|
|
var qqmapsdk = new QQMapWX({
|
|
|
|
|
key: 'QNHBZ-55RKF-OMFJJ-NPU7O-EPSDH-ACBAA'
|
|
|
|
|
});
|
2022-04-15 10:44:40 +00:00
|
|
|
|
// 解决H5跨域
|
|
|
|
|
const jsonp = function(url, data) {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
// 1.初始化url
|
|
|
|
|
let dataString = url.indexOf('?') === -1 ? '?' : '&'
|
|
|
|
|
let callbackName = `jsonpCB_${ Date.now() }`;
|
|
|
|
|
url += `${ dataString }callback=${ callbackName }`
|
|
|
|
|
if(data) {
|
|
|
|
|
// 2.有请求参数,依次添加到url
|
|
|
|
|
for(let k in data) {
|
|
|
|
|
url += `&${ k }=${ data[k] }`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let scriptNode = document.createElement('script');
|
|
|
|
|
scriptNode.src = url;
|
|
|
|
|
// 3. callback
|
|
|
|
|
window[callbackName] = (result) => {
|
|
|
|
|
result ? resolve(result) : reject('没有返回数据');
|
|
|
|
|
delete window[callbackName];
|
|
|
|
|
document.body.removeChild(scriptNode);
|
|
|
|
|
}
|
|
|
|
|
// 4. 异常情况
|
|
|
|
|
scriptNode.addEventListener('error', () => {
|
|
|
|
|
reject('接口返回数据失败');
|
|
|
|
|
delete window[callbackName];
|
|
|
|
|
document.body.removeChild(scriptNode);
|
|
|
|
|
}, false)
|
|
|
|
|
// 5. 开始请求
|
|
|
|
|
document.body.appendChild(scriptNode)
|
|
|
|
|
})
|
|
|
|
|
}
|
2022-03-17 10:26:34 +00:00
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
footTabOne,
|
2022-03-25 10:33:33 +00:00
|
|
|
|
statusNav,
|
|
|
|
|
containerSubgroupTwo
|
2022-03-17 10:26:34 +00:00
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2022-03-31 10:34:17 +00:00
|
|
|
|
targetObj:{
|
|
|
|
|
workOrderNo:'GD20211203-001',// 工单编号
|
|
|
|
|
projectNo:'GD20211203-001', // 项目编号
|
|
|
|
|
projectName:'湖南省林业科学院11楼会议室P2.5', // 项目名称
|
|
|
|
|
productType:'一拳超人', // 产品类型
|
|
|
|
|
installLocation:'手臂', // 安装位置
|
2022-04-12 00:50:56 +00:00
|
|
|
|
faultType:'脱节', // 维保类型
|
2022-03-31 10:34:17 +00:00
|
|
|
|
urgentDegree:'紧急', // 紧急程度
|
2022-04-12 00:50:56 +00:00
|
|
|
|
faultExplain:'摔了一跤', // 维保说明
|
|
|
|
|
faultImgList:[], // 维保图片
|
2022-03-31 10:34:17 +00:00
|
|
|
|
reporter:'林某', // 报单人
|
|
|
|
|
declarationTime:'2022/3/31 12:01:00', //报单时间
|
|
|
|
|
serviceMode: '手把手' ,// 服务方式
|
|
|
|
|
address:'四川省成都市成华区' ,// 定位地址
|
|
|
|
|
startTime:'' ,// 开始时间
|
|
|
|
|
endTime:'', // 结束时间
|
|
|
|
|
maintenanceTime:'',// 维保用时
|
|
|
|
|
waitingTime:'',// 等待时长
|
|
|
|
|
maintainer:'陈志远',//主维保人
|
|
|
|
|
ifParts:false,//是否更换配件
|
|
|
|
|
workDescribe:'',// 工作描述
|
|
|
|
|
maintenanceImgList:[],//维保图片
|
2022-04-12 00:50:56 +00:00
|
|
|
|
faultReason:'',//维保原因
|
2022-03-31 10:34:17 +00:00
|
|
|
|
maintenancePersonnel:''//维保人员
|
|
|
|
|
},
|
2022-04-15 10:44:40 +00:00
|
|
|
|
productTypeList:[
|
2022-04-22 10:39:36 +00:00
|
|
|
|
{id:1,name:'不显示'}
|
2022-04-15 10:44:40 +00:00
|
|
|
|
],//产品类型
|
|
|
|
|
productIndex:0,//产品类型下标
|
|
|
|
|
faultTypeList:[
|
2022-04-22 10:39:36 +00:00
|
|
|
|
{id:2,name:'参数错误'}
|
2022-04-15 10:44:40 +00:00
|
|
|
|
],//维保类型
|
|
|
|
|
faultIndex:0,//维保类型下标
|
|
|
|
|
serviceModeList:[
|
2022-04-22 10:39:36 +00:00
|
|
|
|
{id:1,name:'上门服务'}
|
2022-04-15 10:44:40 +00:00
|
|
|
|
],//服务方式
|
|
|
|
|
serviceModeIndex:0,//服务方式下标
|
|
|
|
|
flag:true,
|
2022-04-18 09:08:12 +00:00
|
|
|
|
temporaryImg:[],//暂存图片id
|
|
|
|
|
addressFlag:true
|
2022-03-17 10:26:34 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2022-03-31 10:34:17 +00:00
|
|
|
|
onShow() {
|
|
|
|
|
uni.removeStorageSync('partsList');
|
|
|
|
|
uni.removeStorageSync('targetObj');
|
|
|
|
|
},
|
2022-04-06 08:05:38 +00:00
|
|
|
|
onLoad(op) {
|
2022-04-13 12:36:32 +00:00
|
|
|
|
if(op.id!=undefined) {
|
|
|
|
|
this.orderId = op.id;
|
|
|
|
|
this.handleWorkOrderGet(this.orderId);
|
|
|
|
|
}
|
2022-04-18 09:08:12 +00:00
|
|
|
|
// 更新定位地址
|
|
|
|
|
this.getAddress();
|
2022-04-06 08:05:38 +00:00
|
|
|
|
},
|
2022-03-17 10:26:34 +00:00
|
|
|
|
methods: {
|
2022-04-18 09:08:12 +00:00
|
|
|
|
// app获取经纬度和详细地址
|
|
|
|
|
getAddress(){
|
|
|
|
|
this.$toolAll.tools.showToast('正在获取定位...')
|
|
|
|
|
// #ifdef APP-PLUS
|
|
|
|
|
if(this.addressFlag) {
|
|
|
|
|
this.addressFlag = false;
|
|
|
|
|
uni.getLocation({
|
|
|
|
|
type: 'gcj02',
|
|
|
|
|
geocode:true,
|
|
|
|
|
success: (res)=> {
|
|
|
|
|
this.$toolAll.tools.showToast('定位成功');
|
|
|
|
|
// console.log(res,'app');
|
|
|
|
|
this.targetObj.address = `${res.address.province}${res.address.city}${res.address.district}${res.address.street || ''}${res.address.streetNum || ''}${res.address.poiName || ''}`
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
this.addressFlag = true;
|
|
|
|
|
},2000)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.$toolAll.tools.showToast('请勿重复获取定位...')
|
|
|
|
|
}
|
|
|
|
|
// #endif
|
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
|
|
this.getAddressWx();
|
|
|
|
|
// #endif
|
|
|
|
|
// #ifdef H5
|
|
|
|
|
this.getAddressH5();
|
|
|
|
|
// #endif
|
|
|
|
|
},
|
|
|
|
|
// 微信获取经纬度和详细地址
|
|
|
|
|
getAddressWx(){
|
|
|
|
|
if(this.addressFlag) {
|
|
|
|
|
this.addressFlag = false;
|
|
|
|
|
uni.getLocation({
|
|
|
|
|
type: 'gcj02',
|
|
|
|
|
geocode:true,
|
|
|
|
|
success: (res)=> {
|
|
|
|
|
// console.log(res,'地址信息');
|
|
|
|
|
qqmapsdk.reverseGeocoder({
|
|
|
|
|
location: {latitude: res.latitude, longitude: res.longitude},
|
|
|
|
|
success:(res)=> {
|
|
|
|
|
console.log(res,'WX');
|
|
|
|
|
this.$toolAll.tools.showToast('定位成功');
|
|
|
|
|
this.targetObj.address = `${res.result.address_component.province}${res.result.address_component.city}${res.result.address_component.district}${res.result.address_component.street || ''}(${res.result.address_component.street_number || ''})`
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
this.addressFlag = true;
|
|
|
|
|
},2000)
|
|
|
|
|
},
|
|
|
|
|
fail(err) {
|
|
|
|
|
console.log(err)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.$toolAll.tools.showToast('请勿重复获取定位...')
|
|
|
|
|
}
|
2022-04-15 10:44:40 +00:00
|
|
|
|
},
|
|
|
|
|
getAddressH5(){
|
2022-04-18 09:08:12 +00:00
|
|
|
|
if(this.addressFlag) {
|
|
|
|
|
this.addressFlag = false;
|
|
|
|
|
uni.getLocation({
|
|
|
|
|
type: 'gcj02',//wgs84 gcj02
|
|
|
|
|
altitude: true,
|
|
|
|
|
geocode: true,
|
|
|
|
|
success: (res)=> {
|
|
|
|
|
let str = `output=jsonp&key=QNHBZ-55RKF-OMFJJ-NPU7O-EPSDH-ACBAA&location=${res.latitude},${res.longitude}`
|
|
|
|
|
jsonp('https://apis.map.qq.com/ws/geocoder/v1/?'+str,{}).then(res=>{
|
|
|
|
|
console.log(res,'H5');
|
|
|
|
|
this.$toolAll.tools.showToast('定位成功');
|
|
|
|
|
this.targetObj.address = `${res.result.address_component.province}${res.result.address_component.city}${res.result.address_component.district}${res.result.address_component.street || ''}(${res.result.address_component.street_number || ''})`
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
this.addressFlag = true;
|
|
|
|
|
},2000)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.$toolAll.tools.showToast('请勿重复获取定位...')
|
|
|
|
|
}
|
2022-04-15 10:44:40 +00:00
|
|
|
|
},
|
|
|
|
|
// 改变产品类型、维保类型、服务方式
|
|
|
|
|
changePicker(index,e) {
|
|
|
|
|
switch (index){
|
|
|
|
|
case 0:
|
|
|
|
|
// 产品类型
|
|
|
|
|
this.productIndex = e.detail.value;
|
|
|
|
|
this.targetObj.productType = this.productTypeList[this.productIndex].name;
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
// 维保类型
|
|
|
|
|
this.faultIndex = e.detail.value;
|
|
|
|
|
this.targetObj.faultType = this.faultTypeList[this.faultIndex].name;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
// 服务方式
|
|
|
|
|
this.serviceModeIndex = e.detail.value;
|
|
|
|
|
this.targetObj.serviceMode = this.serviceModeList[this.serviceModeIndex].name;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-04-06 08:05:38 +00:00
|
|
|
|
// 查看信息签到执行
|
2022-04-13 12:36:32 +00:00
|
|
|
|
handleWorkOrderGet(id){
|
2022-04-06 08:05:38 +00:00
|
|
|
|
let params = {
|
2022-04-13 12:36:32 +00:00
|
|
|
|
order_id:id,
|
|
|
|
|
steps:1
|
2022-04-06 08:05:38 +00:00
|
|
|
|
}
|
2022-04-13 12:36:32 +00:00
|
|
|
|
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;//项目名称
|
2022-04-15 10:44:40 +00:00
|
|
|
|
this.targetObj.installLocation = dataObj.installation_location;//安装位置
|
|
|
|
|
this.targetObj.faultExplain = dataObj.failure_description;//维保说明
|
2022-04-13 12:36:32 +00:00
|
|
|
|
this.targetObj.urgentDegree = dataObj.emergency_level_view;//紧急程度
|
|
|
|
|
this.targetObj.reporter = dataObj.order_contact;//报单人
|
|
|
|
|
this.targetObj.declarationTime = dataObj.order_times;//报单时间
|
2022-04-22 10:39:36 +00:00
|
|
|
|
|
|
|
|
|
// 产品类型
|
|
|
|
|
if(dataObj.form.product_type.length) {
|
|
|
|
|
this.productTypeList = [];
|
|
|
|
|
dataObj.form.product_type.forEach((item,index)=>{
|
|
|
|
|
this.productTypeList.push(item);
|
|
|
|
|
if(item.id==dataObj.product_type) {
|
|
|
|
|
this.productIndex = index;
|
|
|
|
|
this.targetObj.productType = item.name;//产品类型
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 维保类型
|
|
|
|
|
if(dataObj.form.fault_type.length) {
|
|
|
|
|
this.faultTypeList = [];
|
|
|
|
|
dataObj.form.fault_type.forEach((item,index)=>{
|
|
|
|
|
this.faultTypeList.push(item);
|
|
|
|
|
if(item.id==dataObj.fault_type) {
|
|
|
|
|
this.faultIndex = index;
|
|
|
|
|
this.targetObj.faultType = item.name;//维保类型
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 服务方式
|
|
|
|
|
if(dataObj.form.service_method.length) {
|
|
|
|
|
this.serviceModeList = [];
|
|
|
|
|
dataObj.form.service_method.forEach((item,index)=>{
|
|
|
|
|
this.serviceModeList.push(item);
|
|
|
|
|
if(item.id==dataObj.service_method) {
|
|
|
|
|
this.serviceModeIndex = index;
|
|
|
|
|
this.targetObj.serviceMode = item.name;//服务方式
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
2022-04-13 12:36:32 +00:00
|
|
|
|
}
|
2022-04-06 08:05:38 +00:00
|
|
|
|
})
|
|
|
|
|
},
|
2022-03-30 10:51:24 +00:00
|
|
|
|
// 上传图片
|
|
|
|
|
chooseImg(){
|
|
|
|
|
uni.chooseImage({
|
|
|
|
|
count:1,
|
|
|
|
|
sourceType:['album','camera'],
|
|
|
|
|
success: (res) => {
|
|
|
|
|
let imgsrc = res.tempFilePaths[0];
|
2022-04-15 10:44:40 +00:00
|
|
|
|
// 获取上传图片id
|
|
|
|
|
uploadImg({path:imgsrc}).then(res=>{
|
|
|
|
|
if(res.code) {
|
|
|
|
|
this.temporaryImg.push(res.data.id);
|
|
|
|
|
this.targetObj.faultImgList.push(imgsrc);
|
|
|
|
|
}
|
|
|
|
|
})
|
2022-05-13 09:39:50 +00:00
|
|
|
|
},fail:(err)=> {
|
|
|
|
|
this.$toolAll.tools.checkQx(err.code);
|
|
|
|
|
}
|
2022-03-30 10:51:24 +00:00
|
|
|
|
})
|
|
|
|
|
},
|
2022-04-13 12:36:32 +00:00
|
|
|
|
// 签到事件
|
2022-03-28 03:19:05 +00:00
|
|
|
|
goWorkOrderThree() {
|
2022-03-31 05:46:52 +00:00
|
|
|
|
if(this.checkEmpty()){
|
|
|
|
|
if(this.flag) {
|
|
|
|
|
this.flag = false;
|
2022-03-31 10:34:17 +00:00
|
|
|
|
this.targetObj.startTime = this.$toolAll.tools.returnCurrentTime('-',0);
|
|
|
|
|
uni.setStorageSync('targetObj',this.targetObj);
|
2022-04-13 12:36:32 +00:00
|
|
|
|
let params = {
|
|
|
|
|
steps:1,
|
2022-04-18 09:08:12 +00:00
|
|
|
|
order_id:this.orderId,//工单id
|
|
|
|
|
start_address:this.targetObj.address,//开工地址
|
2022-04-15 10:44:40 +00:00
|
|
|
|
product_type:this.productTypeList[this.productIndex].id,//产品类型
|
|
|
|
|
installation_location:this.targetObj.installLocation,//安装位置
|
|
|
|
|
fault_type:this.faultTypeList[this.faultIndex].id,//维保类型
|
|
|
|
|
failure_description:this.targetObj.faultExplain,//维保说明
|
|
|
|
|
fault_picture:this.temporaryImg.join(','),//维保图片
|
|
|
|
|
service_method:this.serviceModeList[this.serviceModeIndex].id//服务方式
|
2022-04-13 12:36:32 +00:00
|
|
|
|
}
|
|
|
|
|
handleWorkOrderSubmit(params).then(res=>{
|
|
|
|
|
if(res.code) {
|
|
|
|
|
uni.navigateTo({
|
2022-04-26 02:01:23 +00:00
|
|
|
|
url: `/pagesA/workOrder/workorderTwo?id=${this.orderId}`
|
2022-04-13 12:36:32 +00:00
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.flag = true;
|
2022-03-31 05:46:52 +00:00
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 判空
|
|
|
|
|
checkEmpty(){
|
|
|
|
|
let result = false;
|
2022-04-22 10:39:36 +00:00
|
|
|
|
if(!this.targetObj.installLocation) {
|
2022-03-31 05:46:52 +00:00
|
|
|
|
this.$toolAll.tools.showToast('请填写安装位置');
|
2022-03-31 10:34:17 +00:00
|
|
|
|
} else if(!this.targetObj.faultExplain) {
|
2022-04-12 00:50:56 +00:00
|
|
|
|
this.$toolAll.tools.showToast('请填写维保说明');
|
2022-03-31 10:34:17 +00:00
|
|
|
|
} else if(this.targetObj.faultImgList.length==0) {
|
2022-04-12 00:50:56 +00:00
|
|
|
|
this.$toolAll.tools.showToast('请添加维保图片');
|
2022-03-31 05:46:52 +00:00
|
|
|
|
} else {
|
|
|
|
|
result = true;
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2022-03-17 10:26:34 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
2022-03-25 10:33:33 +00:00
|
|
|
|
.submit-button {
|
2022-03-17 10:26:34 +00:00
|
|
|
|
margin-top: 60rpx;
|
|
|
|
|
}
|
2022-03-25 10:33:33 +00:00
|
|
|
|
|
2022-03-17 10:26:34 +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;
|
2022-03-31 05:46:52 +00:00
|
|
|
|
/* width: 150rpx; */
|
2022-03-17 10:26:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.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-17 10:26:34 +00:00
|
|
|
|
}
|
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;
|
|
|
|
|
}
|
2022-03-17 10:26:34 +00:00
|
|
|
|
</style>
|