Commit 5c376c83 authored by 郭晓清's avatar 郭晓清

异常签约+现场拍照

parent 8cb99bc6
...@@ -5,7 +5,7 @@ let orderApiFun = function(vm){ ...@@ -5,7 +5,7 @@ let orderApiFun = function(vm){
/** /**
* 工单数量查询接口 * 工单数量查询接口
*/ */
let listOrderCount = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/queryOrdersCount/V2', params); let listOrderCount = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/'+ vm.vuex_token+'/wokerOrder/queryOrdersCount/V2', params);
/** /**
* 工单列表接口 wxh-worker-rest/rest/order/revision/{token}/list * 工单列表接口 wxh-worker-rest/rest/order/revision/{token}/list
...@@ -31,7 +31,7 @@ let orderApiFun = function(vm){ ...@@ -31,7 +31,7 @@ let orderApiFun = function(vm){
/** /**
* 订单详情查询 * 订单详情查询
*/ */
let orderDetail = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/'+ vm.vuex_token+'/'+params.orderId, params); let orderDetail = async (params = {},orderId) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/'+ vm.vuex_token+'/'+orderId, params);
/* 过程反馈查询接口 */ /* 过程反馈查询接口 */
let feedbackConfig = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rst/order/v2/getFeedBack/' + vm.vuex_token, params) let feedbackConfig = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rst/order/v2/getFeedBack/' + vm.vuex_token, params)
...@@ -50,6 +50,20 @@ let orderApiFun = function(vm){ ...@@ -50,6 +50,20 @@ let orderApiFun = function(vm){
*/ */
let orderGan = async (params = {},orderId) => await vm.$u.post('/wxh-worker-rest/rest/order/revision/applets/'+ vm.vuex_token+'/order/acceptAppletsOrder', params,{'content-type': 'application/x-www-form-urlencoded'}); let orderGan = async (params = {},orderId) => await vm.$u.post('/wxh-worker-rest/rest/order/revision/applets/'+ vm.vuex_token+'/order/acceptAppletsOrder', params,{'content-type': 'application/x-www-form-urlencoded'});
/**
* 获取拍照标准
*/
let orderStandard = async (params = {}) => await vm.$u.get('wxh-worker-rest/rest/'+ vm.vuex_token+'/photo/standard', params);
/**
* 保存图片信息
*/
let saveImage = async (params = {},orderId) => await vm.$u.post('/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/'+orderId+'/maintain/saveImage', params);
/**
* 获取师傅水印 or 默认水印
*/
let getWatermark= async (params = {}) => await vm.$u.get('wxh-worker-rest/rest/'+ vm.vuex_token+'/photo/watermark', params);
const orderApi = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
...@@ -63,7 +77,10 @@ let orderApiFun = function(vm){ ...@@ -63,7 +77,10 @@ let orderApiFun = function(vm){
orderAccept, orderAccept,
orderGan, orderGan,
maintainWorkerCheckin, maintainWorkerCheckin,
feedbackConfig feedbackConfig,
orderStandard,
saveImage,
getWatermark
} }
return orderApi return orderApi
} }
......
...@@ -112,16 +112,19 @@ ...@@ -112,16 +112,19 @@
</view> </view>
</view> </view>
<take-photo type="test" v-if="takeStatus" @close="closeTake"></take-photo> <take-photo type="test" v-if="takeStatus" @close="closeTake"></take-photo>
<!-- <PopView title="aaaa" message="bbbb" :visible.sync="visibale" @click="handleClick"/> -->
</view> </view>
</template> </template>
<script> <script>
import appointTime from '@/components/appoint/appoint-time.vue' import appointTime from '@/components/appoint/appoint-time.vue'
import takePhoto from '@/components/take/index.vue' import takePhoto from '@/components/take/index.vue'
// import PopView from "@/components/popView/index.vue"
export default { export default {
components: { components: {
appointTime, appointTime,
'take-photo': takePhoto 'take-photo': takePhoto,
// PopView
}, },
data() { data() {
return { return {
...@@ -149,7 +152,7 @@ ...@@ -149,7 +152,7 @@
btnClass:'appoint-btn', btnClass:'appoint-btn',
takeStatus:false, takeStatus:false,
errorSignIn:false, errorSignIn:false,
scenePhoto: false scenePhoto: true
} }
}, },
onLoad(option) { onLoad(option) {
...@@ -187,10 +190,25 @@ ...@@ -187,10 +190,25 @@
uni.hideTabBar() uni.hideTabBar()
this.takeStatus = true this.takeStatus = true
}, },
closeTake() { closeTake(img) {
console.log(img)
this.takeStatus = false this.takeStatus = false
// 获取返回的图片 ,如果返回的图片存在则直接异常签约,成功后跳转到去完工页面, // 获取返回的图片 ,如果返回的图片存在则直接异常签约,成功后跳转到去完工页面,
if(img){ // 拍照完成
this.$refs.uToast.show({
title: '签到成功',
type: 'success',
url: 'pages/order/detail',
params: {
id: 1
}
})
}else{
this.$refs.uToast.show({
title: '异常签到失败,请先按要求拍照',
type: 'waning'
})
}
}, },
loadOrderDetail() { // 获取工单详情 loadOrderDetail() { // 获取工单详情
let self = this let self = this
...@@ -198,10 +216,10 @@ ...@@ -198,10 +216,10 @@
var data = { var data = {
'orderId': self.orderId 'orderId': self.orderId
}; };
self.$u.api.orderDetail(data).then((res) => { self.$u.api.orderDetail(data, self.orderId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log("===", res.data.list[0]) console.log("===", res.data)
self.order = res.data.list[0] self.order = res.data
this.getCurrentBtn() this.getCurrentBtn()
// self.order.operationType = "accept" // self.order.operationType = "accept"
// }else{ // }else{
......
...@@ -51,11 +51,10 @@ ...@@ -51,11 +51,10 @@
pageSize: 10, pageSize: 10,
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish //waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
indexStatus: { indexStatus: {
0: 'waitAccept', 0: 'waitAppointment',
1: 'waitAppointment', 1: 'waitCheckIn',
2: 'waitCheckIn', 2: 'waitFinish',
3: 'waitFinish', 3: 'exception',
4: 'exception',
5: 'finish' 5: 'finish'
}, },
orderList: [], orderList: [],
...@@ -145,7 +144,7 @@ ...@@ -145,7 +144,7 @@
// 页面数据 // 页面数据
getOrderList(index) { getOrderList(index) {
// 状态处理 // 状态处理
this.pageNumber += 1 // this.pageNumber += 1
var param = { var param = {
pageNumber: this.pageNumber, pageNumber: this.pageNumber,
pageSize: this.pageSize, pageSize: this.pageSize,
......
...@@ -4,30 +4,34 @@ ...@@ -4,30 +4,34 @@
<view class="topView"> <view class="topView">
<view :class="['topItemView', {'active':activeTop===ikey}]" @click="handleTopItemChange(ikey,item)" <view :class="['topItemView', {'active':activeTop===ikey}]" @click="handleTopItemChange(ikey,item)"
v-for="(item,ikey) in dataList" :key="ikey"> v-for="(item,ikey) in dataList" :key="ikey">
<text :class="['ph-lst-top-index', {'active':activeTop===ikey}]">{{ ikey + 1 }}</text> <text :class="['ph-lst-top-index', {'active':activeTop===ikey}]">{{ ikey + 1 }}</text>
<text class="topItemTitle">{{item.type}}</text> <text class="topItemTitle">{{item.type}}</text>
</view> </view>
</view> </view>
<view class="rightView"> <view class="rightView">
<view class="right-view-title">拍照项有:</view> <view class="right-view-title">拍照项有:</view>
<template v-for="(item,ikey) in rightList"> <template v-for="(item,ikey) in rightList">
<view class="rightItemView" @click="rightItemClick(item,ikey)" :key="ikey"> <view class="rightItemView" @click="take(item,ikey)" :key="ikey">
<view :class="['rightContentView', {'active':item.imageList[0]}]"> <view :class="['rightContentView', {'active':item.images[0]}]">
<text class="ph-lst-item-index">{{ ikey + 1 }}</text> <text class="ph-lst-item-index">{{ ikey + 1 }}</text>
<text class="">{{item.name}}</text> <text class="">{{item.name}}</text>
<image class="ph-list-item-arrow" src="/static/photo/arrow.png"></image> <image class="ph-list-item-arrow" src="/static/photo/arrow.png"></image>
<!-- <text class="rightContent u-m-t-14 u-m-l-30 u-p-b-30">{{item.describe}}</text> --> <!-- <text class="rightContent u-m-t-14 u-m-l-30 u-p-b-30">{{item.describe}}</text> -->
</view> </view>
<view class="rightImageView" v-if="item.imageList.length > 0"> <view class="rightImageView" v-if="item.images.length > 0">
<image class="rightImage" v-for="(image, index) in item.imageList.slice(0 , 10)" :src="image" <image class="rightImage" v-for="(image, index) in item.images.slice(0 , 10)" :src="image"
:key="index" @click.stop="handleClickImage(item, index)" mode="aspectFill"></image> :key="index" @click.stop="handleClickImage(item, index)" mode="aspectFill"></image>
</view> </view>
</view> </view>
</template> </template>
<u-button v-if="activeTop + 1 === dataList.length" class="ph-list-button" type="error" shape="circle" <take-photo type="test" v-if="takeStatus" :currentItem="currentItemDate" @close="closeTake"></take-photo>
:disabled="buttonDisabled" :custom-style="buttonStyle" @click="isPopShow = true">一键清空展示图片</u-button> <!-- <u-button v-if="activeTop + 1 === dataList.length" class="ph-list-button" type="error" shape="circle"
:disabled="buttonDisabled" :custom-style="buttonStyle" @click="isPopShow = true">一键清空展示图片</u-button> -->
</view> </view>
<u-popup border-radius="10" v-model="isPopShow" safe-area-inset-bottom mode="center" width="690rpx"
<!-- <u-popup border-radius="10" v-model="isPopShow" safe-area-inset-bottom mode="center" width="690rpx"
height="600rpx"> height="600rpx">
<view class="ph-list-pop-title"> <view class="ph-list-pop-title">
<text>是否一键清空系统展示的图片?</text> <text>是否一键清空系统展示的图片?</text>
...@@ -44,14 +48,20 @@ ...@@ -44,14 +48,20 @@
确定 确定
</u-button> </u-button>
</view> </view>
</u-popup> </u-popup> -->
</view> </view>
</template> </template>
<script> <script>
import takePhoto from '@/components/take/index.vue'
export default { export default {
components: {
'take-photo': takePhoto
},
data() { data() {
return { return {
takeStatus: false,
currentItemDate:{},
topList: [], topList: [],
activeTop: 0, activeTop: 0,
leftList: [], leftList: [],
...@@ -60,9 +70,11 @@ ...@@ -60,9 +70,11 @@
systemId: '', systemId: '',
brand: '', brand: '',
brandId: '', brandId: '',
orderId:'',
dataList: [], dataList: [],
loading: true, loading: true,
isPopShow: false isPopShow: false,
userWatermark:{}
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -70,14 +82,21 @@ ...@@ -70,14 +82,21 @@
if (e && e.brandId) { if (e && e.brandId) {
this.brandId = e.brandId this.brandId = e.brandId
} }
if (e && e.brand) { uni.setNavigationBarTitle({
this.brand = e.brand title: "郭小清"
uni.setNavigationBarTitle({ });
title: this.brand
}); // if (e && e.brand) {
// this.brand = e.brand!==undefined?e.brand:"郭小清"
// uni.setNavigationBarTitle({
// title: this.brand
// });
// }
if (e && e.orderId) {
this.orderId = e.orderId
} }
if (e && e.systemId) { if (e && e.systemId) {
this.systemId = e.systemId this.systemId = e.systemId
...@@ -86,8 +105,8 @@ ...@@ -86,8 +105,8 @@
if (e && e.classifyId) { if (e && e.classifyId) {
this.classifyId = e.classifyId this.classifyId = e.classifyId
} }
// this.getListData()
this.getListData() this.getListDataNew()
}, },
...@@ -108,7 +127,6 @@ ...@@ -108,7 +127,6 @@
} }
} }
} }
return true return true
}, },
customStyleCancel() { customStyleCancel() {
...@@ -127,7 +145,6 @@ ...@@ -127,7 +145,6 @@
} }
} }
}, },
methods: { methods: {
getListData: function() { getListData: function() {
this.loading = true this.loading = true
...@@ -149,17 +166,60 @@ ...@@ -149,17 +166,60 @@
} }
} }
}) })
}, },
getListDataNew() {
handleData: function(result) { this.loading = true
let self = this
var data = {
partnerCompanyId:this.systemId ,
orderId:this.orderId,
categoryId:this.classifyId,
brandId:this.brandId
};
self.$u.api.orderStandard(data).then((res) => {
this.loading = false
if (res.code == 200) {
console.log("===", res.data)
if(res.data && res.data.length > 0){
let dataList = []
var flag = false;
res.data.forEach(item=>{
if(dataList.length===0 ){
var dataItem = {type:'',list:[]}
dataItem.type = item.type
dataItem.list.push(item)
dataList.push(dataItem)
}else{
dataList.forEach(dataListItem=>{
if(dataListItem.type===item.type){
dataListItem.list.push(item)
flag = true
return false;
}else{
flag = false
}
})
if(!flag){
var dataItem = {type:'',list:[]}
dataItem.type = item.type
dataItem.list.push(item)
dataList.push(dataItem)
}
}
})
this.handleData(dataList)
}
} else {
console.log(res.code.message)
}
});
},
handleData: function(result) {
this.activeTop = 0 this.activeTop = 0
const globalData = getApp().globalData
globalData.photo.productList = result
this.dataList = result this.dataList = result
if (result.length > 0) { if (result.length > 0) {
var item = result[0] var item = result[0]
globalData.photo.waterSetting = item.userWatermark globalData.photo.waterSetting = this.userWatermark
this.rightList = item.list this.rightList = item.list
} }
}, },
...@@ -176,7 +236,6 @@ ...@@ -176,7 +236,6 @@
duration: 0 duration: 0
}); });
}, },
// 点击图片 // 点击图片
handleClickImage(item, index) { handleClickImage(item, index) {
uni.previewImage({ uni.previewImage({
...@@ -184,7 +243,6 @@ ...@@ -184,7 +243,6 @@
current: index current: index
}) })
}, },
//右侧点击 //右侧点击
rightItemClick: function(item, ikey) { rightItemClick: function(item, ikey) {
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
...@@ -196,7 +254,6 @@ ...@@ -196,7 +254,6 @@
url: '/pages/photo/take' url: '/pages/photo/take'
}) })
}, },
// 清除图片 // 清除图片
handleClickSure: function() { handleClickSure: function() {
this.$u.cloudApi.cleanImage({ this.$u.cloudApi.cleanImage({
...@@ -207,6 +264,42 @@ ...@@ -207,6 +264,42 @@
this.getListData() this.getListData()
} }
}) })
},
take(item,ikey) {
this.currentItemDate = item
uni.hideTabBar()
this.takeStatus = true
},
closeTake(img) {
console.log(img)
if(img !==undefined ){
// step1 添加图片
this.currentItemDate.images.push(img)
// step2 保存图片
var data={
type : this.currentItemDate.type,
images : this.currentItemDate.images,
fieldsName:this.currentItemDate.fieldName
}
this.$u.api.saveImage(data,this.orderId).then((res) => {
if (res.code == 200) {
console.log("===", res.data)
} else {
console.log("保存图片异常",res.data.message)
}
});
}
this.takeStatus = false
},
getWatermark(){
this.$u.api.getWatermark(data,this.orderId).then((res) => {
if (res.code == 200) {
console.log("===", res.data)
this.userWatermark = res.data
} else {
console.log("获取水印备注异常",res.data.message)
}
});
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment