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

异常签约+现场拍照

parent 8cb99bc6
......@@ -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
......@@ -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)
......@@ -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 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 = {
listByRecommendOrder,
......@@ -63,7 +77,10 @@ let orderApiFun = function(vm){
orderAccept,
orderGan,
maintainWorkerCheckin,
feedbackConfig
feedbackConfig,
orderStandard,
saveImage,
getWatermark
}
return orderApi
}
......
......@@ -112,16 +112,19 @@
</view>
</view>
<take-photo type="test" v-if="takeStatus" @close="closeTake"></take-photo>
<!-- <PopView title="aaaa" message="bbbb" :visible.sync="visibale" @click="handleClick"/> -->
</view>
</template>
<script>
import appointTime from '@/components/appoint/appoint-time.vue'
import takePhoto from '@/components/take/index.vue'
// import PopView from "@/components/popView/index.vue"
export default {
components: {
appointTime,
'take-photo': takePhoto
'take-photo': takePhoto,
// PopView
},
data() {
return {
......@@ -149,7 +152,7 @@
btnClass:'appoint-btn',
takeStatus:false,
errorSignIn:false,
scenePhoto: false
scenePhoto: true
}
},
onLoad(option) {
......@@ -187,10 +190,25 @@
uni.hideTabBar()
this.takeStatus = true
},
closeTake() {
closeTake(img) {
console.log(img)
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() { // 获取工单详情
let self = this
......@@ -198,10 +216,10 @@
var data = {
'orderId': self.orderId
};
self.$u.api.orderDetail(data).then((res) => {
self.$u.api.orderDetail(data, self.orderId).then((res) => {
if (res.code == 200) {
console.log("===", res.data.list[0])
self.order = res.data.list[0]
console.log("===", res.data)
self.order = res.data
this.getCurrentBtn()
// self.order.operationType = "accept"
// }else{
......
......@@ -51,11 +51,10 @@
pageSize: 10,
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
indexStatus: {
0: 'waitAccept',
1: 'waitAppointment',
2: 'waitCheckIn',
3: 'waitFinish',
4: 'exception',
0: 'waitAppointment',
1: 'waitCheckIn',
2: 'waitFinish',
3: 'exception',
5: 'finish'
},
orderList: [],
......@@ -145,7 +144,7 @@
// 页面数据
getOrderList(index) {
// 状态处理
this.pageNumber += 1
// this.pageNumber += 1
var param = {
pageNumber: this.pageNumber,
pageSize: this.pageSize,
......
......@@ -4,30 +4,34 @@
<view class="topView">
<view :class="['topItemView', {'active':activeTop===ikey}]" @click="handleTopItemChange(ikey,item)"
v-for="(item,ikey) in dataList" :key="ikey">
<text :class="['ph-lst-top-index', {'active':activeTop===ikey}]">{{ ikey + 1 }}</text>
<text class="topItemTitle">{{item.type}}</text>
</view>
</view>
<view class="rightView">
<view class="right-view-title">拍照项有:</view>
<template v-for="(item,ikey) in rightList">
<view class="rightItemView" @click="rightItemClick(item,ikey)" :key="ikey">
<view :class="['rightContentView', {'active':item.imageList[0]}]">
<view class="rightItemView" @click="take(item,ikey)" :key="ikey">
<view :class="['rightContentView', {'active':item.images[0]}]">
<text class="ph-lst-item-index">{{ ikey + 1 }}</text>
<text class="">{{item.name}}</text>
<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> -->
</view>
<view class="rightImageView" v-if="item.imageList.length > 0">
<image class="rightImage" v-for="(image, index) in item.imageList.slice(0 , 10)" :src="image"
<view class="rightImageView" v-if="item.images.length > 0">
<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>
</view>
</view>
</template>
<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>
<take-photo type="test" v-if="takeStatus" :currentItem="currentItemDate" @close="closeTake"></take-photo>
<!-- <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>
<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">
<view class="ph-list-pop-title">
<text>是否一键清空系统展示的图片?</text>
......@@ -44,14 +48,20 @@
确定
</u-button>
</view>
</u-popup>
</u-popup> -->
</view>
</template>
<script>
import takePhoto from '@/components/take/index.vue'
export default {
components: {
'take-photo': takePhoto
},
data() {
return {
takeStatus: false,
currentItemDate:{},
topList: [],
activeTop: 0,
leftList: [],
......@@ -60,9 +70,11 @@
systemId: '',
brand: '',
brandId: '',
orderId:'',
dataList: [],
loading: true,
isPopShow: false
isPopShow: false,
userWatermark:{}
}
},
onLoad(e) {
......@@ -70,14 +82,21 @@
if (e && e.brandId) {
this.brandId = e.brandId
}
if (e && e.brand) {
this.brand = e.brand
uni.setNavigationBarTitle({
title: this.brand
});
uni.setNavigationBarTitle({
title: "郭小清"
});
// 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) {
this.systemId = e.systemId
......@@ -86,8 +105,8 @@
if (e && e.classifyId) {
this.classifyId = e.classifyId
}
this.getListData()
// this.getListData()
this.getListDataNew()
},
......@@ -108,7 +127,6 @@
}
}
}
return true
},
customStyleCancel() {
......@@ -127,7 +145,6 @@
}
}
},
methods: {
getListData: function() {
this.loading = true
......@@ -149,17 +166,60 @@
}
}
})
},
handleData: function(result) {
getListDataNew() {
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
const globalData = getApp().globalData
globalData.photo.productList = result
this.dataList = result
if (result.length > 0) {
var item = result[0]
globalData.photo.waterSetting = item.userWatermark
globalData.photo.waterSetting = this.userWatermark
this.rightList = item.list
}
},
......@@ -176,7 +236,6 @@
duration: 0
});
},
// 点击图片
handleClickImage(item, index) {
uni.previewImage({
......@@ -184,7 +243,6 @@
current: index
})
},
//右侧点击
rightItemClick: function(item, ikey) {
const photo = getApp().globalData.photo
......@@ -196,7 +254,6 @@
url: '/pages/photo/take'
})
},
// 清除图片
handleClickSure: function() {
this.$u.cloudApi.cleanImage({
......@@ -207,6 +264,42 @@
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