获取当前位置兼容H5、小程序、app
parent
eb1c0ac14d
commit
8dbd9af5b9
|
@ -27,3 +27,18 @@ export function handleWorkOrderGet(data) {
|
|||
export function handleWorkOrderSubmit(data) {
|
||||
return request.post("/universal/api.order/process_order", data);
|
||||
}
|
||||
|
||||
// 获取产品类型
|
||||
export function getProductType() {
|
||||
return request.get("/universal/api.project/project_type");
|
||||
}
|
||||
|
||||
// 获取维保类型
|
||||
export function getFaultType() {
|
||||
return request.get("/universal/api.order/fault_type");
|
||||
}
|
||||
|
||||
// 获取服务方式
|
||||
export function getServiceMode() {
|
||||
return request.get("/universal/api.order/fault_type");
|
||||
}
|
|
@ -9,8 +9,8 @@ console.log(ENV,'当前环境'); // development:开发环境 test:测试环
|
|||
const hostapi = 'https://7and5.cn';
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
// const hostapi = '/web';
|
||||
const hostapi = 'https://7and5.cn';
|
||||
const hostapi = '/web';
|
||||
// const hostapi = 'https://7and5.cn';
|
||||
// #endif
|
||||
// 清理所有缓存并前往授权页
|
||||
const goLogin = () => {
|
||||
|
|
|
@ -104,13 +104,15 @@ const tools = {
|
|||
},
|
||||
// h5
|
||||
getAddressH5(){
|
||||
uni.showLoading({
|
||||
title: '定位中...',
|
||||
mask:true
|
||||
});
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
type: 'gcj02', // wgs84 gcj02
|
||||
altitude: true,
|
||||
// geocode: true, // wgs84
|
||||
success: (res)=> {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask:true
|
||||
});
|
||||
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');
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
{
|
||||
"pages": [{
|
||||
"pages": [ {
|
||||
"path": "pages/workOrder/punchCard",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人中心",
|
||||
"navigationStyle": "custom" //禁用原生导航栏,微信小程序可用
|
||||
}
|
||||
},{
|
||||
"path": "pages/guide-page/guide-page",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
|
|
|
@ -79,11 +79,16 @@
|
|||
address:"湖南省长沙市高新开发区谷园路109号像素大厦1205"
|
||||
},
|
||||
],
|
||||
list_rows:20,
|
||||
page:1,
|
||||
total:0
|
||||
}
|
||||
},
|
||||
onLoad(op) {
|
||||
// 调用查询客户列表事件
|
||||
this.queryFunEv();
|
||||
if(op.key_word!=undefined) {
|
||||
// 调用查询客户列表事件
|
||||
this.queryFunEv(op.key_word);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 前往客户详情
|
||||
|
@ -93,8 +98,14 @@
|
|||
})
|
||||
},
|
||||
// 查询客户列表事件
|
||||
queryFunEv(){
|
||||
queryFun({type_id:1}).then(res=>{
|
||||
queryFunEv(keyword){
|
||||
let params = {
|
||||
type_id:1,
|
||||
keyword,
|
||||
list_rows:this.list_rows,
|
||||
page:this.page
|
||||
}
|
||||
queryFun(params).then(res=>{
|
||||
if(res.code) {
|
||||
|
||||
}
|
||||
|
|
|
@ -128,17 +128,27 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
list_rows:20,
|
||||
page:1,
|
||||
total:0
|
||||
}
|
||||
},
|
||||
onLoad(op) {
|
||||
// 调用查询客户列表事件
|
||||
this.queryFunEv();
|
||||
if(op.key_word!=undefined) {
|
||||
// 调用查询(备品)列表事件
|
||||
this.queryFunEv(op.key_word);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 查询客户列表事件
|
||||
queryFunEv(){
|
||||
queryFun({type_id:3}).then(res=>{
|
||||
// 查询(备品)列表事件
|
||||
queryFunEv(keyword){
|
||||
let params = {
|
||||
type_id:3,
|
||||
keyword,
|
||||
list_rows:this.list_rows,
|
||||
page:this.page
|
||||
}
|
||||
queryFun(params).then(res=>{
|
||||
if(res.code) {
|
||||
|
||||
}
|
||||
|
|
|
@ -116,11 +116,16 @@
|
|||
},
|
||||
|
||||
],
|
||||
list_rows:20,
|
||||
page:1,
|
||||
total:0
|
||||
}
|
||||
},
|
||||
onLoad(op) {
|
||||
// 调用查询客户列表事件
|
||||
this.queryFunEv();
|
||||
if(op.key_word!=undefined) {
|
||||
// 调用查询(项目)列表事件
|
||||
this.queryFunEv(op.key_word);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
projectDetailsFun(){
|
||||
|
@ -128,9 +133,15 @@
|
|||
url:"/pages/dataQuery/projectDetails"
|
||||
})
|
||||
},
|
||||
// 查询客户列表事件
|
||||
// 查询(项目)列表事件
|
||||
queryFunEv(){
|
||||
queryFun({type_id:2}).then(res=>{
|
||||
let params = {
|
||||
type_id:2,
|
||||
keyword,
|
||||
list_rows:this.list_rows,
|
||||
page:this.page
|
||||
}
|
||||
queryFun(params).then(res=>{
|
||||
if(res.code) {
|
||||
|
||||
}
|
||||
|
|
|
@ -190,7 +190,6 @@
|
|||
'/pages/dataQuery/projectQuery',
|
||||
'/pages/dataQuery/dataQuery'
|
||||
]
|
||||
|
||||
uni.navigateTo({
|
||||
url: `${urls[index]}?key_word=${this.key_word}`
|
||||
})
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view class="indication-point fon24 disjcac">{{index}}/{{projectObj.completed_img.length}}</view>
|
||||
<view class="indication-point fon24 disjcac">{{index}}/{{imgNum}}</view>
|
||||
</view>
|
||||
<view class="title">{{projectObj.project_name}}</view>
|
||||
<view class="code">{{projectObj.project_number}}</view>
|
||||
|
@ -117,6 +117,7 @@
|
|||
},
|
||||
],
|
||||
projectObj:'',
|
||||
imgNum:0,//图片数量
|
||||
typeId:1,//记录类型 1:维修记录 2:保养记录 3: 巡检记录
|
||||
list_rows:200,
|
||||
page:1,
|
||||
|
@ -160,7 +161,7 @@
|
|||
}).then(res => {
|
||||
if (res.code) {
|
||||
this.projectObj = res.data;
|
||||
console.log(this.projectObj);
|
||||
this.imgNum = this.projectObj.completed_img.length;
|
||||
} else {
|
||||
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
<view slot="content" style="margin: -30rpx -30rpx -0rpx;">
|
||||
<view class="pad-s20 bacf">
|
||||
<view class="project-list-input">
|
||||
<input type="text" class="int" value="" placeholder="请输入关键字" placeholder-style="color:#999999;" />
|
||||
<input @confirm="getData" type="text" @input="keywordInput" class="int" v-model="inputData" placeholder="请输入关键字" placeholder-style="color:#999999;" />
|
||||
<view class="xian"></view>
|
||||
<image class="search" src="../../static/iocn/ss.png" mode="aspectFill" lazy-load></image>
|
||||
<image @tap="getData" class="search" src="../../static/iocn/ss.png" mode="aspectFill" lazy-load></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="screen bbot mar-sx20">
|
||||
|
@ -71,6 +71,7 @@
|
|||
import footTabOne from "../../components/foot-tabs/foot-tab-one.vue"
|
||||
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
|
||||
import pitera from '@/components/nothing/pitera.vue';
|
||||
import {getProductType} from '@/jsFile/public-api.js';
|
||||
export default {
|
||||
components: {
|
||||
footTabOne,
|
||||
|
@ -84,7 +85,7 @@
|
|||
})
|
||||
return {
|
||||
statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 40,
|
||||
inputData: "",
|
||||
inputData: "",//关键字
|
||||
date: currentDate,
|
||||
initial_value:'产品类型',
|
||||
array: [],
|
||||
|
@ -113,6 +114,10 @@
|
|||
this.getProjectType();
|
||||
},
|
||||
methods: {
|
||||
// 关键字输入框监听事件
|
||||
keywordInput(){
|
||||
this.dataList.page = 1;
|
||||
},
|
||||
// 查询项目列表
|
||||
getData() {
|
||||
if(this.dataList.page==1) this.dataList.data = [];
|
||||
|
@ -120,7 +125,8 @@
|
|||
product_type:this.productType,
|
||||
completion_time:this.completion_time,
|
||||
list_rows: this.dataList.list_rows,
|
||||
page: this.dataList.page
|
||||
page: this.dataList.page,
|
||||
keyword:this.inputData
|
||||
}).then(res => {
|
||||
if (res.code) {
|
||||
// 设置项目总数
|
||||
|
@ -136,7 +142,7 @@
|
|||
},
|
||||
// 查询产品类型
|
||||
getProjectType(){
|
||||
this.$requst.get('/universal/api.project/project_type').then(res=>{
|
||||
getProductType().then(res=>{
|
||||
if(res.code) {
|
||||
this.array = res.data;
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
|
||||
<script>
|
||||
import yyMmDdHhSs from '@/components/dates/yy-mm-dd-hh-ss.vue';
|
||||
import {getFaultType} from '@/jsFile/public-api.js';
|
||||
import {
|
||||
uploadImg
|
||||
} from '@/jsFile/public-api.js';
|
||||
|
@ -106,17 +107,13 @@
|
|||
methods: {
|
||||
// 获取维保类型
|
||||
getType() {
|
||||
// /universal/api.order/fault_type
|
||||
this.$requst.post('/universal/api.work_order/fault_type').then(res => {
|
||||
// this.$toolAll.tools.showToast(res.msg);
|
||||
if (res.code == 1) {
|
||||
getFaultType().then(res=>{
|
||||
if (res.code) {
|
||||
this.faultTypeData = [...res.data]
|
||||
} else {
|
||||
|
||||
|
||||
this.faultTypeData = [...res.data]
|
||||
} else {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
openDatetimePicker() {
|
||||
this.$refs.myPicker.show();
|
||||
|
@ -175,7 +172,6 @@
|
|||
},
|
||||
submitButton() {
|
||||
this.data.fault_type = this.faultTypeData[this.indexType].id
|
||||
|
||||
if (this.data.is_device == 0) {
|
||||
if (!this.data.device_name) {
|
||||
this.$toolAll.tools.showToast("请填写设备名称或型号");
|
||||
|
@ -186,34 +182,25 @@
|
|||
this.$toolAll.tools.showToast("请扫描设备二维码");
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!this.data.username) {
|
||||
this.$toolAll.tools.showToast("请填写您的姓名");
|
||||
return
|
||||
}
|
||||
var reg_tel =
|
||||
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; //11位手机号码正则
|
||||
|
||||
if (!reg_tel.test(this.data.phone)) {
|
||||
if (this.$toolAll.tools.isPhone(this.data.phone)) {
|
||||
this.$toolAll.tools.showToast("请正确填写您的电话");
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
console.log(this.data)
|
||||
this.$requst.post('/universal/api.work_order/repair', this.data).then(res => {
|
||||
if (res.code == 1) {
|
||||
console.log(res)
|
||||
this.$requst.post('/universal/api.order/repair', this.data).then(res => {
|
||||
if (res.code) {
|
||||
this.$toolAll.tools.showToast('提交成功');
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack({delta:1})
|
||||
},1000)
|
||||
} else {
|
||||
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
|
||||
console.log(this.data)
|
||||
|
||||
|
||||
},
|
||||
|
||||
mapFun() {
|
||||
|
|
|
@ -160,7 +160,7 @@
|
|||
},
|
||||
],
|
||||
userInfo: {},
|
||||
ifAuthentication:false,//是否认证
|
||||
ifAuthentication:0,//是否认证
|
||||
userHeadImg:''//用户头像
|
||||
}
|
||||
},
|
||||
|
@ -229,10 +229,11 @@
|
|||
this.headList[0].num = this.userInfo.credit
|
||||
this.headList[1].num = this.userInfo.project_number
|
||||
this.headList[2].num = this.userInfo.evaluate
|
||||
this.percentageList[0].num= this.userInfo.reserve_rate-0
|
||||
this.percentageList[1].num= this.userInfo.visit_rate-0
|
||||
this.percentageList[2].num= this.userInfo.repair_rate-0
|
||||
this.userHeadImg = this.userInfo.avatar;
|
||||
this.percentageList[0].num= this.userInfo.reserve_rate*1//预约及时率
|
||||
this.percentageList[1].num= this.userInfo.visit_rate*1//上面准时率
|
||||
this.percentageList[2].num= this.userInfo.repair_rate*1//项目报修率
|
||||
this.userHeadImg = this.userInfo.avatar;//用户头像
|
||||
this.ifAuthentication = this.userInfo.is_check;//是否实名认证0:未认证 1:已认证
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -195,8 +195,8 @@
|
|||
<view class="mar-s30">
|
||||
<scroll-view scroll-x>
|
||||
<view :class="solutionList.length == 4 ? 'disjbac' : 'disac'">
|
||||
<view @tap="goDetail(0,item.id)" class="posir flexs" v-for="(item,index) in solutionList" :key="index" style="width: 23%;height: 214rpx;" :style="{marginRight: solutionList.length != 4 ? '20rpx' : ''}">
|
||||
<image style="width: 100%;height: 214rpx;" class="radius10 " :src="item.imgsrc" mode="aspectFill"></image>
|
||||
<view @tap="goDetail(0,item.id)" class="posir flexs" v-for="(item,index) in solutionList" :key="index" style="width: 23%;height: 110px;" :style="{marginRight: solutionList.length != 4 ? '20rpx' : ''}">
|
||||
<image style="width: 100%;height: 110px;" class="radius10 " :src="item.imgsrc" mode="aspectFill"></image>
|
||||
<view class="posia solution-title clips1">{{item.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -246,8 +246,8 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
role: 2, // 1:业务员 2:表示客户 3:表示客服 4:表示工程师
|
||||
role: uni.getStorageSync('type_id'), // 1:业务员 2:表示客户 3:表示客服 4:表示工程师
|
||||
role: 1, // 1:业务员 2:表示客户 3:表示客服 4:表示工程师
|
||||
// role: uni.getStorageSync('type_id'), // 1:业务员 2:表示客户 3:表示客服 4:表示工程师
|
||||
statusHeight: uni.getSystemInfoSync().statusBarHeight + 50,
|
||||
messageNumber: 0 ,// 消息数量
|
||||
noticeList:[{id:1,title:'2021年11月06日公司团建,维保服务暂停一天服务暂停一天服务暂停一天。一天服务暂停一天服务暂停一天。'}],//公告
|
||||
|
@ -348,6 +348,7 @@
|
|||
this.contactPhone = homeObj.contact;//客服联系电话
|
||||
this.project_count = homeObj.project_count;//项目数量
|
||||
this.fault_count = homeObj.fault_count;//实时工单数量
|
||||
// 重构公告列表
|
||||
if(homeObj.notice.length) {
|
||||
homeObj.notice.forEach(item=>{
|
||||
let obj = {
|
||||
|
|
|
@ -32,7 +32,10 @@
|
|||
</view>
|
||||
<view class="li">
|
||||
<view class="title flexs">产品类型:</view>
|
||||
<input type="text" class="input" v-model="targetObj.productType" placeholder="请填写产品类型" :style="{color: targetObj.productType!='' ? '#000' : ''}" />
|
||||
<!-- <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>
|
||||
</view>
|
||||
<view class="li">
|
||||
<view class="title flexs">安装位置:</view>
|
||||
|
@ -40,7 +43,10 @@
|
|||
</view>
|
||||
<view class="li">
|
||||
<view class="title flexs">维保类型:</view>
|
||||
<input type="text" class="input" v-model="targetObj.faultType" placeholder="请填写维保类型(例:供电不足)" :style="{color: targetObj.faultType!='' ? '#000' : ''}" />
|
||||
<!-- <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>
|
||||
</view>
|
||||
<view class="li">
|
||||
<view class="title flexs">紧急程度:</view>
|
||||
|
@ -73,7 +79,10 @@
|
|||
</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' : ''}" />
|
||||
<!-- <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>
|
||||
</view>
|
||||
<view class="li">
|
||||
<view class="title flexs">定位地址:</view>
|
||||
|
@ -88,9 +97,44 @@
|
|||
|
||||
<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';
|
||||
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');
|
||||
var qqmapsdk = new QQMapWX({
|
||||
key: 'QNHBZ-55RKF-OMFJJ-NPU7O-EPSDH-ACBAA'
|
||||
});
|
||||
// 解决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)
|
||||
})
|
||||
}
|
||||
export default {
|
||||
components: {
|
||||
footTabOne,
|
||||
|
@ -124,7 +168,20 @@
|
|||
faultReason:'',//维保原因
|
||||
maintenancePersonnel:''//维保人员
|
||||
},
|
||||
flag:true
|
||||
productTypeList:[
|
||||
{id:1,name:'产品1'},{id:2,name:'产品2'},
|
||||
],//产品类型
|
||||
productIndex:0,//产品类型下标
|
||||
faultTypeList:[
|
||||
{id:1,name:'产品1'},{id:2,name:'产品2'},
|
||||
],//维保类型
|
||||
faultIndex:0,//维保类型下标
|
||||
serviceModeList:[
|
||||
{id:1,name:'上门服务'},{id:2,name:'线上服务'},
|
||||
],//服务方式
|
||||
serviceModeIndex:0,//服务方式下标
|
||||
flag:true,
|
||||
temporaryImg:[]//暂存图片id
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
@ -136,8 +193,100 @@
|
|||
this.orderId = op.id;
|
||||
this.handleWorkOrderGet(this.orderId);
|
||||
}
|
||||
this.getProductType();
|
||||
this.getFaultType();
|
||||
this.getAddressH5();
|
||||
},
|
||||
methods: {
|
||||
// 定位地址
|
||||
getAddress() {
|
||||
|
||||
},
|
||||
getAddressH5(){
|
||||
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.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 || ''})`
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
// 改变产品类型、维保类型、服务方式
|
||||
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;
|
||||
}
|
||||
},
|
||||
// 获取产品类型
|
||||
getProductType() {
|
||||
getProductType().then(res=>{
|
||||
if(res.code) {
|
||||
this.productTypeList = res.data;
|
||||
if(this.productTypeList.length) {
|
||||
// this.productIndex = this.productTypeList.findIndex(item=>{return item.name==this.targetObj.productType});
|
||||
// 筛选默认选中项
|
||||
this.productTypeList.forEach((item,index)=>{
|
||||
if(item.name==this.targetObj.productType) {
|
||||
this.productIndex = index;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取维保类型
|
||||
getFaultType() {
|
||||
getFaultType().then(res=>{
|
||||
if(res.code) {
|
||||
this.faultTypeList = res.data;
|
||||
if(this.faultTypeList.length) {
|
||||
// this.faultIndex = this.faultTypeList.findIndex(item=>{return item.name==this.targetObj.faultType});
|
||||
// 筛选默认选中项
|
||||
this.faultTypeList.forEach((item,index)=>{
|
||||
if(item.name==this.targetObj.faultType) {
|
||||
this.faultIndex = index;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取服务方式
|
||||
getServiceMode() {
|
||||
getServiceMode().then(res=>{
|
||||
if(res.code) {
|
||||
this.serviceModeList = res.data;
|
||||
if(this.serviceModeList.length) {
|
||||
// this.serviceModeIndex = this.serviceModeList.findIndex(item=>{return item.name==this.targetObj.serviceMode});
|
||||
// 筛选默认选中项
|
||||
this.serviceModeList.forEach((item,index)=>{
|
||||
if(item.name==this.targetObj.serviceMode) {
|
||||
this.serviceModeIndex = index;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查看信息签到执行
|
||||
handleWorkOrderGet(id){
|
||||
let params = {
|
||||
|
@ -150,10 +299,19 @@
|
|||
this.targetObj.workOrderNo = dataObj.order_number;//工单编号
|
||||
this.targetObj.projectNo = dataObj.project_number;//项目编号
|
||||
this.targetObj.projectName = dataObj.project_name;//项目名称
|
||||
this.targetObj.productType = dataObj.product_type;//产品类型
|
||||
this.targetObj.installLocation = dataObj.installation_location;//安装位置
|
||||
this.targetObj.faultType = dataObj.fault_type;//维保类型
|
||||
this.targetObj.faultExplain = dataObj.failure_description;//维保说明
|
||||
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;//定位地址
|
||||
this.targetObj.serviceMode = dataObj.service_method_view;//服务方式
|
||||
// this.targetObj.address = dataObj.order_times;//定位地址
|
||||
// 调用查询产品类型事件
|
||||
this.getProductType();
|
||||
// 调用查询故障类型事件
|
||||
this.getFaultType();
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -164,7 +322,13 @@
|
|||
sourceType:['album','camera'],
|
||||
success: (res) => {
|
||||
let imgsrc = res.tempFilePaths[0];
|
||||
this.targetObj.faultImgList.push(imgsrc);
|
||||
// 获取上传图片id
|
||||
uploadImg({path:imgsrc}).then(res=>{
|
||||
if(res.code) {
|
||||
this.temporaryImg.push(res.data.id);
|
||||
this.targetObj.faultImgList.push(imgsrc);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -179,12 +343,12 @@
|
|||
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//服务方式
|
||||
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//服务方式
|
||||
}
|
||||
handleWorkOrderSubmit(params).then(res=>{
|
||||
if(res.code) {
|
||||
|
|
|
@ -139,7 +139,7 @@
|
|||
// 签署工程师合作协议
|
||||
this.imgList[3] = res.data.agreement_document;
|
||||
// 技能证书
|
||||
this.imgList[3] = res.data.skills_certificate;
|
||||
this.imgList[4] = res.data.skills_certificate;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -237,7 +237,6 @@
|
|||
this.imgList.forEach((item,index)=>{
|
||||
if(current==index) arr.push(item);
|
||||
})
|
||||
console.log(this.imgList);
|
||||
if(arr.length) {
|
||||
uni.previewImage({
|
||||
current:current,
|
||||
|
|
Loading…
Reference in New Issue