Commit 089094d2 authored by 郭晓清's avatar 郭晓清

Merge branch 'master' of https://git.banshouhui.com/lijundan/self-support

# Conflicts:
#	src/pages/order/detail.vue
parents 20a4ad96 4aec5b1c
...@@ -8,6 +8,7 @@ const UNI_APP = { ...@@ -8,6 +8,7 @@ const UNI_APP = {
apiUrl: 'http://192.168.1.22', //java端域名请求头 apiUrl: 'http://192.168.1.22', //java端域名请求头
// apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头 // apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
}, },
qn_base_url: 'https://qn-static.banshouhui.com/self-support/' qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'http://deudn.c.pp.cc/',
} }
module.exports = UNI_APP; module.exports = UNI_APP;
...@@ -7,7 +7,8 @@ const UNI_APP = { ...@@ -7,7 +7,8 @@ const UNI_APP = {
systemUrl: { systemUrl: {
apiUrl:'https://system.banshouhui.com', //java端域名请求头 apiUrl:'https://system.banshouhui.com', //java端域名请求头
}, },
qn_base_url: 'https://qn-static.banshouhui.com/self-support/' qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'https://qn-static.banshouhui.com'
} }
module.exports = UNI_APP; module.exports = UNI_APP;
...@@ -7,6 +7,7 @@ const UNI_APP = { ...@@ -7,6 +7,7 @@ const UNI_APP = {
systemUrl: { systemUrl: {
apiUrl: 'https://system.dev.banshouhui.com', //java端域名请求头 apiUrl: 'https://system.dev.banshouhui.com', //java端域名请求头
}, },
qn_base_url: 'https://qn-static.banshouhui.com/self-support/' qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'https://qn-static.banshouhui.com'
} }
module.exports = UNI_APP; module.exports = UNI_APP;
...@@ -159,7 +159,8 @@ export default { ...@@ -159,7 +159,8 @@ export default {
setUserData(userInfo) { setUserData(userInfo) {
if (userInfo && userInfo.token) { if (userInfo && userInfo.token) {
// 如果已经登录则直接获取相关信息 // 如果已经登录则直接获取相关信息
this.$u.vuex('vuex_token',userInfo.token); // RTOKENf22df8e7b9db396f560e8f61bebceea2000cb05c this.$u.vuex('vuex_token',userInfo.token);
this.$u.vuex('vuex_token',"RTOKEN7493e6defc2f1a77782f105dc297a9366763fec5");
this.$u.vuex('vuex_user', userInfo); this.$u.vuex('vuex_user', userInfo);
this.$u.vuex('vuex_wx_uid', userInfo.wxopenid); this.$u.vuex('vuex_wx_uid', userInfo.wxopenid);
} else { } else {
......
...@@ -8,93 +8,109 @@ let orderApiFun = function(vm){ ...@@ -8,93 +8,109 @@ let orderApiFun = function(vm){
* 工单数量查询接口 * 工单数量查询接口
*/ */
let listOrderCount = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/queryOrdersCount/V2', params); let listOrderCount = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/queryOrdersCount/V2', params);
/** /**
* 工单列表接口 * 工单列表接口
*/ */
let listOrder = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/' + vm.vuex_token + '/list', params); let listOrder = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/' + vm.vuex_token + '/list', params);
/** /**
* 获取师傅的预约日历 * 获取师傅的预约日历
*/ */
let workerCalendar = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/appointment/calendar', params); let workerCalendar = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/appointment/calendar', params);
/** /**
* 师傅预约 * 师傅预约
*/ */
let workerAppointment = async (params = {}, orderId) => await vm.$u.post('/wxh-worker-rest/rest/order/traceAndAppointment/trace/V2/' + vm.vuex_token + '/'+orderId, params) let workerAppointment = async (params = {}, orderId) => await vm.$u.post('/wxh-worker-rest/rest/order/traceAndAppointment/trace/V2/' + vm.vuex_token + '/'+orderId, params)
// 联系顾客时间更新接口,暂时没有 // 联系顾客时间更新接口,暂时没有
/** /**
* 师傅签到接口 * 师傅签到接口
*/ */
let maintainWorkerCheckin = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token + '/order/'+orderId+'/maintainWorkerCheckin', params,{'content-type': 'application/x-www-form-urlencoded'}); let maintainWorkerCheckin = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token + '/order/'+orderId+'/maintainWorkerCheckin', params,{'content-type': 'application/x-www-form-urlencoded'});
/** /**
* 订单详情查询 * 订单详情查询
*/ */
let orderDetail = async (params = {},orderId) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/'+ vm.vuex_token+'/'+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/rest/order/v2/getFeedBack/' + vm.vuex_token, params) let feedbackConfig = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/v2/getFeedBack/' + vm.vuex_token, params)
/* 预约+过程反馈 接口 */ /* 预约+过程反馈 接口 */
let traceAndAppointment = async (params = {}, orderId) => await vm.$u.post('/wxh-worker-rest/rest/order/traceAndAppointment/trace/V2/' + vm.vuex_token + `/`+orderId, params) let traceAndAppointment = async (params = {}, orderId) => await vm.$u.post('/wxh-worker-rest/rest/order/traceAndAppointment/trace/V2/' + vm.vuex_token + `/`+orderId, params)
/* 师傅拒单 */ /* 师傅拒单 */
let rejectOrder = async (params = {}, orderId) => await vm.$u.get(prefix + vm.vuex_token + `/order/${orderId}/workerReject/V2`, params) let rejectOrder = async (params = {}, orderId) => await vm.$u.get(prefix + vm.vuex_token + `/order/${orderId}/workerReject/V2`, params)
/** /**
* 查询工单操作记录列表接口 * 查询工单操作记录列表接口
*/ */
let listOrderRecord = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/record/'+ vm.vuex_token+'/listOrderRecord/'+params.orderId, params); let listOrderRecord = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/record/'+ vm.vuex_token+'/listOrderRecord/'+params.orderId, params);
/** /**
* 接单 * 接单
*/ */
let orderAccept = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token+'/order/'+orderId+'/accept', params); let orderAccept = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token+'/order/'+orderId+'/accept', params);
/** /**
* 抢单 * 抢单
*/ */
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(prefix + vm.vuex_token+'/photo/standard', params); let orderStandard = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token+'/photo/standard', params);
/** /**
* 保存图片信息 * 保存图片信息
*/ */
let saveImage = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token + '/order/'+orderId+'/maintain/saveImage', params); let saveImage = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token + '/order/'+orderId+'/maintain/saveImage', params);
/** /**
* 获取师傅水印 or 默认水印 * 获取师傅水印 or 默认水印
*/ */
let getWatermark = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/photo/watermark', params); let getWatermark = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/photo/watermark', params);
/** /**
* 获取师傅开放可选时间段 * 获取师傅开放可选时间段
*/ */
let openTimerange = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/appointment/timerange', params); let openTimerange = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/appointment/timerange', params);
/** /**
* 联系时间接口 * 联系时间接口
*/ */
let contactTime = async (params = {},orderId) => await vm.$u.get('/wxh-worker-rest/rest/order/record/'+ vm.vuex_token+'/contact/'+orderId, params); let contactTime = async (params = {},orderId) => await vm.$u.get('/wxh-worker-rest/rest/order/record/'+ vm.vuex_token+'/contact/'+orderId, params);
/** /**
* 检查是否可以拒单 * 检查是否可以拒单
*/ */
let checkRejectable = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/'+ vm.vuex_token+'/wokerOrder/checkRejectable', params); let checkRejectable = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/'+ vm.vuex_token+'/wokerOrder/checkRejectable', params);
/** /**
* 获取签到距离 * 获取签到距离
*/ */
let getSignDistance = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/' + vm.vuex_token + `/wokerOrder/sign/distance`, params) let getSignDistance = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/' + vm.vuex_token + `/wokerOrder/sign/distance`, params)
/**
* 获取订单的完工项目(配置+数据)
*/
let getCompleteConfigAndData= async (orderId) => await vm.$u.get(prefix+ vm.vuex_token+'/order/'+ orderId +'/maintain/info');
/**
* 查询措施
*/
let getMeasure= async (params = {}) => await vm.$u.get('wxh-worker-rest/rest/service/'+ vm.vuex_token+'/measure/queryMeasureItems', params);
/**
* 保存售后记录
*/
let saveCompleteData = async (params = {},orderId) => await vm.$u.post(prefix+ vm.vuex_token+'/order/'+ orderId +'/maintain/saveMaintainInfoV2', params);
const orderApi = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
listOrderCount, listOrderCount,
...@@ -106,7 +122,6 @@ let orderApiFun = function(vm){ ...@@ -106,7 +122,6 @@ let orderApiFun = function(vm){
listOrderRecord, listOrderRecord,
orderAccept, orderAccept,
orderGan, orderGan,
maintainWorkerCheckin,
feedbackConfig, feedbackConfig,
traceAndAppointment, traceAndAppointment,
rejectOrder, rejectOrder,
...@@ -116,10 +131,13 @@ let orderApiFun = function(vm){ ...@@ -116,10 +131,13 @@ let orderApiFun = function(vm){
openTimerange, openTimerange,
contactTime, contactTime,
checkRejectable, checkRejectable,
getSignDistance getSignDistance,
getCompleteConfigAndData,
getMeasure,
saveCompleteData
} }
return orderApi return orderApi
} }
module.exports = { module.exports = {
orderApiFun orderApiFun
} }
\ No newline at end of file
...@@ -96,9 +96,9 @@ ...@@ -96,9 +96,9 @@
}, },
data() { data() {
return { return {
currentDay: 0, currentDay: null,
currentTime: null, currentTime: null,
appointTime: now, appointTime: null,
appointRange: "", appointRange: "",
num: 0, num: 0,
hasLast: false hasLast: false
...@@ -106,9 +106,9 @@ ...@@ -106,9 +106,9 @@
}, },
watch: { watch: {
title() { title() {
this.currentDay = 0 this.currentDay = null
this.appointTime = now
this.currentTime = null this.currentTime = null
this.appointTime = null
this.appointRange = "" this.appointRange = ""
} }
}, },
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
</template> </template>
<script> <script>
import objMixin from './objMixin' import arrMixin from './arrMixin'
export default { export default {
name: 'XhRadio', name: 'XhRadio',
components: {}, components: {},
mixins: [objMixin], mixins: [arrMixin],
props: {}, props: {},
filters:{}, filters:{},
data() { data() {
......
...@@ -75,21 +75,14 @@ ...@@ -75,21 +75,14 @@
deep:true, deep:true,
immediate: true, immediate: true,
}, },
// 'value'(val, oldVal){
// if(val){
// this.imgList = val.map(img =>{
// return {path:img}
// })
// }
// }
}, },
mounted() { mounted() {
if(this.value){ if(this.value){
this.imgList = this.value.map(img =>{ this.imgList = this.value.map(img =>{
return {path: img} return {path: img, src:img}
}) })
this.setValue()
} }
this.setValue()
}, },
methods: { methods: {
selectUpload(){ selectUpload(){
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
}, },
watch: { watch: {
specificationId(val, oldVal){ specificationId(val, oldVal){
this.initComponent() this.initComponent()
}, },
}, },
mounted() { mounted() {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<view> <view>
<view v-if="showCountTime" class="bottom-left-view"> <view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', {'timeout': timeout}]"><text>{{tagText}}</text></view> <view :class="['bottom-tag-view', {'timeout': timeout}]"><text>{{tagText}}</text></view>
<u-count-down :timestamp="timestamp" font-size="44" <u-count-down :timestamp="timestamp" font-size="44" show-days
:color="timeout ? '#FA5A49' : '#FF930D'" @change="handleChange" ref="order-count-down"></u-count-down> :color="timeout ? '#FA5A49' : '#FF930D'" @change="handleChange" ref="order-count-down"></u-count-down>
</view> </view>
<view v-else-if="showTime"> <view v-else-if="showTime">
...@@ -98,42 +98,12 @@ ...@@ -98,42 +98,12 @@
data() { data() {
return { return {
timeout: false, timeout: false,
timestamp: 0, timestamp: 0,
orderType: 0
}; };
}, },
computed: { computed: {
/*
orderStatus:
待接单 orderStatus<31 工单状态小于31
待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空
待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空
待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80
审核中 orderStatus ==85 or orderStatus == 87 工单状态 等于85 或者 等于有87
异常 orderStatus ==86 or orderStatus == 88 工单状态 等于86 或者 等于有88
已完工 orderStatus in(80,81,89,110) 工单状态 等于80 or 81 or 89 or 110
*/
orderText() { // 按钮文字 orderText() { // 按钮文字
if (!this.orderType) {
if (this.orderData.orderStatus < 31) {
this.orderType = 0
} else if (this.orderData.orderStatus == 31) {
if (this.orderData.appointmentDatetime) {
return this.orderType = 2
} else {
this.orderType = 1
}
} else if (this.orderData.orderStatus > 31 && this.orderData.orderStatus < 80) {
this.orderType = 3
} else if (this.orderData.orderStatus == 85 && this.orderData.orderStatus == 87) {
this.orderType = 4
} else if (this.orderData.orderStatus == 86 && this.orderData.orderStatus == 88) {
this.orderType = 5
} else if ([80, 81, 89, 110].indexOf(this.orderData.orderStatus) != -1) {
this.orderType = 6
} else {
this.orderType = 0
}
}
return this.typeTexts[this.orderType] return this.typeTexts[this.orderType]
}, },
buttonStyle() { // 按钮样式 buttonStyle() { // 按钮样式
...@@ -229,12 +199,43 @@ ...@@ -229,12 +199,43 @@
'exception': 5, // 异常单、 'exception': 5, // 异常单、
'finish': 6, //已完工 'finish': 6, //已完工
} }
},
orderType() {
return this.types[this.type]
} }
}, },
created() { created() {
/*
orderStatus:
待接单 orderStatus<31 工单状态小于31
待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空
待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空
待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80
审核中 orderStatus ==85 or orderStatus == 87 工单状态 等于85 或者 等于有87
异常 orderStatus ==86 or orderStatus == 88 工单状态 等于86 或者 等于有88
已完工 orderStatus in(80,81,89,110) 工单状态 等于80 or 81 or 89 or 110
*/
if (!this.type) {
if (this.orderData.orderStatus < 31) {
this.orderType = 0
} else if (this.orderData.orderStatus == 31) {
if (this.orderData.appointmentDatetime) {
return this.orderType = 2
} else {
this.orderType = 1
}
} else if (this.orderData.orderStatus > 31 && this.orderData.orderStatus < 80) {
this.orderType = 3
} else if (this.orderData.orderStatus == 85 && this.orderData.orderStatus == 87) {
this.orderType = 4
} else if (this.orderData.orderStatus == 86 && this.orderData.orderStatus == 88) {
this.orderType = 5
} else if ([80, 81, 89, 110].indexOf(this.orderData.orderStatus) != -1) {
this.orderType = 6
} else {
this.orderType = 0
}
} else {
this.orderType = this.types[this.type]
}
this.timeout = this.orderData.currentOverTime < new Date().getTime() this.timeout = this.orderData.currentOverTime < new Date().getTime()
this.timestamp = Math.round(Math.abs(this.orderData.currentOverTime - new Date().getTime()) / 1000) this.timestamp = Math.round(Math.abs(this.orderData.currentOverTime - new Date().getTime()) / 1000)
}, },
...@@ -247,7 +248,6 @@ ...@@ -247,7 +248,6 @@
this.$emit('click') this.$emit('click')
}, },
handleChange(timestamp) { handleChange(timestamp) {
console.log(timestamp)
if (this.timeout) this.$refs['order-count-down'].seconds += 2 if (this.timeout) this.$refs['order-count-down'].seconds += 2
if (timestamp == 0 && !this.timeout) { if (timestamp == 0 && !this.timeout) {
setTimeout(()=> { setTimeout(()=> {
......
...@@ -32,11 +32,12 @@ ...@@ -32,11 +32,12 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
height: 100vh; height: 100vh;
background-color: #f4f5f7; background-color: #f4f5f7;
padding: 0rpx 30rpx 0 30rpx; padding: 0rpx 30rpx 0 30rpx;
overflow-y: auto; overflow-y: auto;
&.fixed { &.fixed {
height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
该组件仅用于拍照后返回图片,与业务不关联,目前最多一次可以拍10张图片 该组件仅用于拍照后返回图片,与业务不关联,目前最多一次可以拍10张图片
``` ```
### 因为相机组件需要全屏展示,所以加载该组件需要在当前页面隐藏顶部导航栏和底部的TabBar ### 因为相机组件需要全屏展示,所以加载该组件需要在当前页面隐藏顶部导航栏,底部的TabBar以及其他页面元素
``` ```
uni.hideTabBar() uni.hideTabBar()
``` ```
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</view> </view>
</view> </view>
<!-- 订单推荐吸顶 --> <!-- 订单推荐吸顶 -->
<u-sticky offset-top="60"> <u-sticky offset-top="0">
<view class="sticky"> <view class="sticky">
<text>订单推荐</text> <text>订单推荐</text>
</view> </view>
...@@ -35,17 +35,24 @@ ...@@ -35,17 +35,24 @@
立即入驻 立即入驻
</u-button> </u-button>
</view> </view>
<view v-else-if="!needSettled && orderList.length > 0" class="order-item-view"> <template v-else>
<view v-for="(item, index) in orderList" :key="index"> <!-- 入驻成功之后无推荐订单 -->
<OrderCell :orderData="item" type="waitAccept" :location="location" @click="handleClick(item.orderId)" <view v-if="orderList.length <= 0 && loadedOrder" class="no-order-view">
@action="handleAction(item.orderId)"> </OrderCell> <NoOrder />
</view> </view>
<u-loadmore :status="currentLoadStatus" bgColor="#f2f2f2"></u-loadmore> <view v-else class="order-item-view">
</view> <!-- <scroll-view scroll-y style="margin-bottom: 20rpx;" @scrolltolower="reachBottom"
<!-- 入驻成功之后无推荐订单 --> scroll-anchoring> -->
<view v-else-if="!needSettled && orderList.length <= 0" class="no-order-view"> <view v-for="(item, index) in orderList" :key="index">
<NoOrder/> <OrderCell :orderData="item" type="waitAccept" :location="location"
</view> @click="handleClick(item.orderId)" @action="handleAction(item.orderId)">
</OrderCell>
</view>
<u-loadmore :status="currentLoadStatus" bgColor="#F4F5F7"></u-loadmore>
<!-- </scroll-view> -->
</view>
</template>
</view> </view>
</view> </view>
<!-- </view> --> <!-- </view> -->
...@@ -60,7 +67,7 @@ ...@@ -60,7 +67,7 @@
<script> <script>
import util from "@/utils/util.js"; import util from "@/utils/util.js";
import TabBarPage from "@/components/tabBarList/index.vue" import TabBarPage from "@/components/tabBarList/index.vue"
import NoOrder from "@/components/order/noOrder.vue" import NoOrder from "@/components/order/noOrder.vue"
const app = getApp(); const app = getApp();
import OrderCell from "@/components/order/index.vue"; import OrderCell from "@/components/order/index.vue";
...@@ -68,7 +75,7 @@ ...@@ -68,7 +75,7 @@
export default { export default {
components: { components: {
OrderCell, OrderCell,
TabBarPage, TabBarPage,
NoOrder NoOrder
}, },
data() { data() {
...@@ -78,23 +85,22 @@ ...@@ -78,23 +85,22 @@
title: false, title: false,
title: "Hello", title: "Hello",
loaded: false, loaded: false,
loadedOrder: false,
needSettled: true, needSettled: true,
count: 0, // 推荐订单数量 count: 0, // 推荐订单数量
messageList: [], messageList: [],
loadStatus: ["more", "loading", "noMore"],
currentLoadStatus: "loading", currentLoadStatus: "loading",
orderList: [], orderList: [],
search: { search: {
token: "", token: "",
pageNumber: 0, pageNumber: 0,
pageSize: 10, pageSize: 100,
}, },
bottomLoading: false
}; };
}, },
watch: { watch: {
vuex_token(val, oldVal) { vuex_token(val, oldVal) {
// 监听token变化,如果更新则重新加载页面数据 // 监听token变化,如果更新则重新加载页面数据
console.log('', val, oldVal) console.log('', val, oldVal)
val && this.initSettleInfo() val && this.initSettleInfo()
} }
...@@ -120,43 +126,47 @@ ...@@ -120,43 +126,47 @@
}, },
shouyeyouImage() { shouyeyouImage() {
return process.uniEnv.qn_base_url + 'shouyeyou.png' return process.uniEnv.qn_base_url + 'shouyeyou.png'
}, },
weiruzhuImage() { weiruzhuImage() {
return process.uniEnv.qn_base_url + 'weiruzhu.png' return process.uniEnv.qn_base_url + 'weiruzhu.png'
}, },
}, },
onLoad() { onLoad() {
this.getOrderCount() this.getOrderCount()
}, },
onShow() { onShow() {
// 每次进入页面都刷新入驻状态 // 每次进入页面都刷新入驻状态
if (this.vuex_token) { if (this.vuex_token) {
this.initSettleInfo(); this.initSettleInfo();
} }
// else {
// // 初始化订单数据
// this.loadOrderList();
// }
}, },
onPullDownRefresh() { onPullDownRefresh() {
console.log('------下拉刷新------') console.log('------下拉刷新------')
// 下拉刷洗 // 下拉刷洗
this.initSettleInfo() this.initSettleInfo()
}, },
onReachBottom() {
console.log('----------底部-------------', this.currentLoadStatus)
if (this.currentLoadStatus != 'loadmore') return
this.currentLoadStatus == 'loading'
this.loadOrderList()
},
// onPageScroll(obj) {
// console.log('---------scroll---------', obj)
// },
methods: { methods: {
handleClick(orderId) { // 点击了cell handleClick(orderId) { // 点击了cell
console.log('点击了cell') console.log('点击了cell')
this.viewOderItem(orderId) this.viewOderItem(orderId)
}, },
handleAction(orderId) { // 点击了按钮 handleAction(orderId) { // 点击了按钮
console.log('点击了按钮') console.log('点击了按钮')
this.viewOderItem(orderId) this.viewOderItem(orderId)
}, },
viewOderItem(orderId) { // 跳转工单详情页面 viewOderItem(orderId) { // 跳转工单详情页面
uni.navigateTo({ uni.navigateTo({
url: 'pages/order/detail?id=' + orderId url: 'pages/order/detail?id=' + orderId
}) })
}, },
async initSettleInfo() { async initSettleInfo() {
let self = this; let self = this;
...@@ -165,15 +175,17 @@ ...@@ -165,15 +175,17 @@
if (result && result.record) { if (result && result.record) {
vm.loaded = true; vm.loaded = true;
vm.needSettled = result.needSettled; vm.needSettled = result.needSettled;
vm.needSettled = false
vm.status = Number(result.record.status || '0'); vm.status = Number(result.record.status || '0');
// vm.status = 8 // vm.status = 8
} }
}; };
await app.getBaseInfo(self, callBack); await app.getBaseInfo(self, callBack);
this.orderList = []
// 加载消息列表 // 加载消息列表
self.loadMessageList(); self.loadMessageList();
self.search.pageNumber = 0
self.loadedOrder = false
self.loadOrderList(); self.loadOrderList();
}, },
loadMessageList() { loadMessageList() {
...@@ -193,14 +205,54 @@ ...@@ -193,14 +205,54 @@
}, },
loadOrderList() { loadOrderList() {
console.log('-----------准备加载推荐列表-----------') console.log('-----------准备加载推荐列表-----------')
this.search.pageNumber += 1
let self = this; let self = this;
// 加载订单列表 // 加载订单列表
self.search.token = self.vuex_token; self.search.token = self.vuex_token;
self.$u.api.listByRecommendOrder(self.search).then((res) => { self.$u.api.listByRecommendOrder(self.search).then((res) => {
uni.stopPullDownRefresh() // 结束下拉刷新 uni.stopPullDownRefresh() // 结束下拉刷新
self.loadedOrder = true
/*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/
// if (res.data.list) {
// if (res.data.list.length == 0 && res.data.total > 0) {
// res.data.total = 15
// res.data.list = [{
// orderServiceType: '安装', // 服务类型:安装、维修
// categoryName: '充电桩', // 品类:充电桩
// orderBusinessTypeText: '分配单', // 业务类型:分配单、订单池
// orderNumber: 'OR2021041809827', // 工单编号
// contactName: '郭小清', // 客户信息
// contactPhone: '13631612077', // 联系方式
// contactAddress: '湾街道荔枝花园D座125号', // 详细地址
// contactAddressLatitud: '116.3896', // 联系人地址经度
// contactAddressLongitud: '39.91917', // 联系人地址纬度
// orderStatus: 0, // 工单状态
// appointmentDatetime: '', // 预约时间
// currentWillOverTime: 10000, // 剩余时间
// currentOverTime: new Date().getTime() + 10000, // 超过时间点
// auditDatetime: '2021.04.19 12:45:09', // 审核时间
// submissionTime: '2021.04.19 16:24:48', // 提交时间
// auditResults: {}, // 审核结果
// orderBusinessType: 'R', // 业务类型 R 为抢单
// orderId: '1100000216'
// }]
// res.data.list = [...res.data.list, ...res.data.list, ...res.data.list, ...res.data
// .list,
// ...res.data.list, ...res.data.list, ...res.data.list, ...res.data.list, ...
// res
// .data.list, ...res.data.list
// ]
// }
// }
/*↑↑↑↑↑↑↑↑↑↑测试数据↑↑↑↑↑↑↑↑↑↑↑↑↑*/
if (res.code == 200) { if (res.code == 200) {
if (res.data && res.data.list && res.data.list.length > 0) { if (res.data && res.data.list && res.data.list.length > 0) {
if (self.search.pageNumber == 1) {
self.orderList = []
}
self.orderList.push(...res.data.list); self.orderList.push(...res.data.list);
self.currentLoadStatus = res.data.total > self.orderList.length ? 'loadmore' : 'nomore'
} }
} else { } else {
console.log(res.message, "初始化订单列表异常"); console.log(res.message, "初始化订单列表异常");
...@@ -210,29 +262,12 @@ ...@@ -210,29 +262,12 @@
onRestore() { onRestore() {
this.triggered = "restore"; this.triggered = "restore";
}, },
reachBottom() { // reachBottom() {
console.log("-----bottom will-----"); // console.log(this.currentLoadStatus)
if (this.bottomLoading || this.currentLoadStatus == this.loadStatus[2]) { // if (this.currentLoadStatus != 'loadmore') return
return; // this.currentLoadStatus == 'loading'
} // this.loadOrderList()
console.log("-----bottom did-----"); // },
this.bottomLoading = true;
setTimeout(() => {
// 加载更多数据
// ...
this.orderList.push(...[{}, {}, {}, {}, {}, {}, {}, {}, {}, {}]);
// 加载完成
this.currentLoadStatus = false /*是否还有*/ ?
this.loadStatus[1] :
this.loadStatus[2];
this.$nextTick(function() {
this.bottomLoading = false;
});
}, 1000);
},
// clickSwiper(index) {}, // clickSwiper(index) {},
handleScroll() { handleScroll() {
console.log("-----scroll-------"); console.log("-----scroll-------");
...@@ -276,29 +311,29 @@ ...@@ -276,29 +311,29 @@
}); });
} }
}, },
// 获取订单数量 // 获取订单数量
getOrderCount() { getOrderCount() {
var self = this; // 加载订单列表 var self = this; // 加载订单列表
self.$u.api.listOrderCount().then((res) => { self.$u.api.listOrderCount().then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log("===", res.data) console.log("===", res.data)
if (res.data) { if (res.data) {
var count = 0 var count = 0
for (var i in res.data) { for (var i in res.data) {
count += res.data[i] count += res.data[i]
} }
// 修改tab总数 // 修改tab总数
uni.setTabBarBadge({ uni.setTabBarBadge({
index: 1, index: 1,
text: String(count) text: String(count)
}) })
} }
} else { } else {
console.log(res.message, "获取订单数量失败!"); console.log(res.message, "获取订单数量失败!");
} }
}); });
}, },
}, },
}; };
</script> </script>
...@@ -414,24 +449,26 @@ ...@@ -414,24 +449,26 @@
background-color: #ffffff; background-color: #ffffff;
border-radius: 12rpx; border-radius: 12rpx;
min-height: 460rpx; min-height: 460rpx;
.tip-view-image {
width: 328rpx; .tip-view-image {
height: 200rpx; width: 328rpx;
margin-top: 30rpx; height: 200rpx;
margin-top: 30rpx;
} }
.tip-other { .tip-other {
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
margin-bottom: 20rpx; margin-bottom: 20rpx;
}
.settle-button {
} }
.settle-button {}
} }
.order-item-view { .order-item-view {
background-color: #F4F5F7; background-color: #F4F5F7;
border-radius: 12rpx; border-radius: 12rpx;
margin-bottom: 20rpx;
} }
} }
} }
......
...@@ -77,13 +77,22 @@ ...@@ -77,13 +77,22 @@
</scroll-view> </scroll-view>
</view> </view>
<view class="btn-wrap flex-xc"> <view class="btn-wrap flex-xc">
<u-button class="btn-submit" @click="nextStep" :custom-style="buttonStyle" <u-button class="btn-submit" @click="saveComplete"
type="primary" shape="circle" :hover-class="submitStatus ? '' : 'none'">
暂存
</u-button>
<u-button class="btn-submit" @click="nextStep" v-if="tabIndex===list.length - 1"
type="primary" shape="circle" :hover-class="submitStatus ? '' : 'none'">
交付
</u-button>
<u-button class="btn-submit" @click="nextStep" :custom-style="buttonStyle" v-else
type="primary" shape="circle" :hover-class="submitStatus ? '' : 'none'"> type="primary" shape="circle" :hover-class="submitStatus ? '' : 'none'">
下一步 下一步
</u-button> </u-button>
</view> </view>
</view> </view>
<take-photo v-else @close="closeTake"></take-photo> <take-photo v-else @close="closeTake"></take-photo>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
...@@ -176,12 +185,13 @@ ...@@ -176,12 +185,13 @@
if (option) { if (option) {
this.orderId = option.orderId this.orderId = option.orderId
this.categoryId = option.categoryId this.categoryId = option.categoryId
this.orderServiceType = option.orderServiceType this.orderServiceType = decodeURIComponent(option.orderServiceType)
} else { } else {
this.orderId = 9708719 this.orderId = 9708719
this.categoryId = 88 this.categoryId = 88
this.orderServiceType = '安装' this.orderServiceType = '安装'
} }
this.getCompleteData()
}, },
onReady() { onReady() {
this.$refs.uForm.setRules(this.rules); this.$refs.uForm.setRules(this.rules);
...@@ -192,18 +202,6 @@ ...@@ -192,18 +202,6 @@
//console.log(this.form.name, 'form.name') //console.log(this.form.name, 'form.name')
}, },
computed: { computed: {
getCompleteData() {
let self = this
if(self.orderId){
self.$u.api.getCompleteConfigAndData(self.orderId).then((res) => {
if (res.code == 200) {
self.list = res.data.config
} else {
console.log(res.message, "获取订单详情失败!");
}
});
}
},
mixingImage() { mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png' return process.uniEnv.qn_base_url + 'mixing.png'
}, },
...@@ -226,6 +224,51 @@ ...@@ -226,6 +224,51 @@
} }
}, },
methods: { methods: {
getCompleteData() {//获取工单配置的完工项目
let self = this
if(self.orderId){
self.$u.api.getCompleteConfigAndData(self.orderId).then((res) => {
if (res.code == 200) {
self.list = res.data.config
self.form = res.data.value
} else {
console.log(res.message, "获取订单完工项目失败!");
}
});
}
},
saveComplete(){// 保存完工信息
let self = this
let param = {}
self.list.forEach((panel)=>{
param[panel.panelFieldsName] = []
panel.items.forEach((group) =>{
group.items.forEach((ele)=>{
if(self.form[ele.fieldsName]){
param[panel.panelFieldsName].push({
"fieldsName": ele.fieldsName,
"fieldsType": ele.fieldsType,
"fieldsValue": self.form[ele.fieldsName],
"required": ele.required,
})
}
})
})
})
self.$u.api.saveCompleteData(param,self.orderId).then((res)=>{
if (res.code == 200) {
this.$refs.uToast.show({
title: '保存成功',
type: 'success',
})
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
}
})
},
getTakeStatus(event) { getTakeStatus(event) {
this.takeStatus = event.status this.takeStatus = event.status
this.fileIndex = event.index.toString() this.fileIndex = event.index.toString()
...@@ -260,10 +303,9 @@ ...@@ -260,10 +303,9 @@
}else{ }else{
this.$set(this.form,innerItem.fieldsName,data.value) this.$set(this.form,innerItem.fieldsName,data.value)
} }
console.log(this.form, 'this.form')
}, },
nextStep() { nextStep() {
if (this.tabIndex < this.list.length) { if (this.tabIndex < this.list.length - 1) {
this.tabIndex++ this.tabIndex++
this.arr = [] this.arr = []
this.$nextTick(function() { this.$nextTick(function() {
...@@ -600,5 +642,15 @@ ...@@ -600,5 +642,15 @@
.btn-wrap { .btn-wrap {
width: 100%; width: 100%;
padding: 20rpx 0 40rpx 0; padding: 20rpx 0 40rpx 0;
display: flex;
justify-content: center;
align-items: center;
} }
.btn-save {
color: #FFFFFF;
background-color: #2272FF;
font-size: 32rpx;
font-weight: bold;
}
</style> </style>
...@@ -44,18 +44,20 @@ ...@@ -44,18 +44,20 @@
<view v-else class="order-item-more"> <view v-else class="order-item-more">
<view class="line-view"></view> <view class="line-view"></view>
<view class="order-cell between-cell"> <view class="order-cell between-cell">
<text>品牌:</text> <text class="cell-title">品牌:</text>
<text>{{ order.brandName }}</text> <text>{{ order.brandName }}</text>
</view> </view>
<view class="order-cell between-cell"> <view class="order-cell between-cell">
<text>数量:</text> <text class="cell-title">数量:</text>
<text>x{{ order.orderProductCount }}</text> <text>x{{ order.orderProductCount }}</text>
</view> </view>
<view class="order-cell between-cell"> <view class="order-cell between-cell">
<text>充电桩信息:</text> <text>充电桩信息:</text>
<text class="cell-title">充电桩信息:</text>
<text>{{ order.serviceContent }}</text> <text>{{ order.serviceContent }}</text>
</view> </view>
<!-- <view class="order-cell between-cell"> <!-- <view class="order-cell between-cell">
<!-- <view class="order-cell between-cell">
<text>备注:</text> <text>备注:</text>
<text>{{ order.serviceContent }}</text> <text>{{ order.serviceContent }}</text>
</view> --> </view> -->
...@@ -765,6 +767,7 @@ ...@@ -765,6 +767,7 @@
.order-item-more { .order-item-more {
font-size: 26rpx; font-size: 26rpx;
color: #333333; color: #333333;
text-align: right;
.line-view { .line-view {
background-color: #F4F5F7; background-color: #F4F5F7;
height: 2rpx; height: 2rpx;
...@@ -954,7 +957,7 @@ ...@@ -954,7 +957,7 @@
color: #333333; color: #333333;
line-height: 48rpx; line-height: 48rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
text-align: left;
} }
.between-cell { .between-cell {
...@@ -962,4 +965,8 @@ ...@@ -962,4 +965,8 @@
justify-content: space-between; justify-content: space-between;
align-items: flex-start; align-items: flex-start;
} }
.cell-title {
text-align: left;
flex-shrink: 0;
}
</style> </style>
...@@ -3,27 +3,14 @@ ...@@ -3,27 +3,14 @@
<view class="feedback-box bg"> <view class="feedback-box bg">
<u-navbar back-icon-color="#FFFFFF" :background="background" title="过程反馈" titleColor="#FFFFFF" :border-bottom="false"></u-navbar> <u-navbar back-icon-color="#FFFFFF" :background="background" title="过程反馈" titleColor="#FFFFFF" :border-bottom="false"></u-navbar>
<view class="content u-p-l-30 u-p-r-30"> <view class="content u-p-l-30 u-p-r-30">
<!-- <view class="width-320 u-m-t-20">
<u-subsection
:bold="false"
:current="curSub"
:list="subList"
active-color="white"
bg-color="white"
height="72"
inactive-color="#666"
button-color="#2272FF"
border-radius="36"
></u-subsection>
</view> -->
<view class="top-tab"> <view class="top-tab">
<u-tabs <u-tabs
:list="tabList" :list="options"
:current="curTab" :current="curTab"
height="60" height="60"
gutter="89" gutter="89"
bar-height="4" bar-height="4"
bar-width="44" bar-width="44"
bg-color="none" bg-color="none"
active-color="#FFFFFF" active-color="#FFFFFF"
inactive-color="#DEDEDE" inactive-color="#DEDEDE"
...@@ -32,41 +19,47 @@ ...@@ -32,41 +19,47 @@
@change="changeTab" @change="changeTab"
></u-tabs> ></u-tabs>
</view> </view>
<!-- <view class="con-box">
</view> -->
<view class="content-view"> <view class="content-view">
<view class="con-box"> <view class="con-box">
<view class="title">{{feedback.own.title}}</view> <view class="title">{{ traceTitles[0] }}</view>
<view class="u-flex u-flex-wrap"> <view class="u-flex u-flex-wrap">
<view <view
v-for="(item, index) in options[curTab]" v-for="(item, index) in options[curTab]['owns']"
:key="index" :key="index"
@click="changeOwn(index)" @click="changeOwn(index, item.name, item.types)"
:class="{'txt-item':true,'active': (trace.reasonRelegation == index)}"> :class="{ 'txt-item': true, active: curOwn == index }"
<text class="txt">{{item}}</text> >
<text class="txt">{{ item.name }}</text>
</view>
</view> </view>
</view> <u-gap height="30"></u-gap>
<u-gap height="30"></u-gap> <view class="title">{{ traceTitles[1] }}</view>
<view class="title">{{feedback.type.title}}</view> <view class="u-flex u-flex-wrap">
<view class="u-flex u-flex-wrap"> <view
<view v-for="(txt, index) in options[curTab]['owns'][curOwn]['types']"
v-for="(txt, index) in options[curTab][trace.reasonRelegation]" :key="index"
:key="index" @click="changeType(index, txt)"
@click="changeType(txt)" :class="{ 'txt-item': true, active: trace.reason == txt }"
:class="{'txt-item':true,'active': (trace.reason == txt)}" style="width: 306rpx;margin-right: 18rpx"> style="width: 306rpx;margin-right: 18rpx"
<text class="txt">{{txt}}</text> >
<text class="txt">{{ txt }}</text>
</view>
</view>
<view class="input-view" v-show="showRemark">
<u-input v-model="trace.remark" class="textarea" height="156" type="textarea" placeholder="请补充详细说明,以便于记录您的接单信用分"></u-input>
</view> </view>
</view> </view>
<view class="input-view" v-show="showRemark"> <view class="time-view">
<u-input v-model="trace.remark" class="textarea" height="156" type="textarea" placeholder="请补充详细说明,以便于记录您的接单信用分"></u-input> <appoint-time
:dateList="dateList"
:title="appointTitle"
:timeList="timeList"
@dateChange="dateChange"
@timeChange="timeChange"
@weekChange="weekChange"
></appoint-time>
</view> </view>
</view> </view>
<view class="time-view">
<appoint-time :dateList="dateList" :title="appointTitle" :timeList="timeList" @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time>
</view>
</view>
</view> </view>
<view class="bottom-view"> <view class="bottom-view">
<button class="btn, bottom-btn" @click="submitForm" :loading="submiting" :disabled="disabledSubmit"><text class="button-text">确定</text></button> <button class="btn, bottom-btn" @click="submitForm" :loading="submiting" :disabled="disabledSubmit"><text class="button-text">确定</text></button>
...@@ -75,425 +68,436 @@ ...@@ -75,425 +68,436 @@
</template> </template>
<script> <script>
let now = new Date(new Date().toLocaleDateString()).getTime() let now = new Date(new Date().toLocaleDateString()).getTime();
import appointTime from '@/components/appoint/appoint-time.vue' import appointTime from '@/components/appoint/appoint-time.vue';
export default { export default {
data() { data() {
return { return {
orderId: null, orderId: null,
categoryId: null, categoryId: null,
showRemark: false, background: {
submiting: false, backgroundColor: 'none'
dateList: [ },
{day: now, timeRange: []}, feedback: null,
{day: now + (1*86400000), timeRange: []}, options: [
{day: now + (2*86400000), timeRange: []}, {
{day: now + (3*86400000), timeRange: []}, name: '报备',
{day: now + (4*86400000), timeRange: []}, owns: [
{day: now + (5*86400000), timeRange: []}, {
{day: now + (6*86400000), timeRange: []}, name: '客户',
], types: ['等客户报装电表', '等客户与物业沟通', '等客户改造电源', '客户不确定安装时间', '等客户通知安装时间', '客户电话未打通', '客户反馈暂不安装']
timeList: [ },
{"name":"06:00-08:00","pkey":"appointment_range_8","disabled":false}, { name: '个人', types: [] },
{"name":"08:00-10:00","pkey":"appointment_range_10","disabled":false}, { name: '客观', types: [] }
{"name":"10:00-12:00","pkey":"appointment_range_12","disabled":false}, ]
{"name":"12:00-14:00","pkey":"appointment_range_14","disabled":false},
{"name":"14:00-16:00","pkey":"appointment_range_16","disabled":false},
{"name":"16:00-18:00","pkey":"appointment_range_18","disabled":false},
{"name":"18:00-20:00","pkey":"appointment_range_20","disabled":false},
{"name":"20:00-22:00","pkey":"appointment_range_22","disabled":false},
{"name":"22:00-24:00","pkey":"appointment_range_24","disabled":false}
],
background: {
backgroundColor: 'none',
},
tabList: [{name: '报单'}, {name: '改约'}],
curTab: 0,
feedback: {
own:{
title:'问题归属',
},
type:{
title:'问题类型',
},
},
appoint:{
'报单': '下次联系时间',
'改约': '预约时间',
},
config: null,
options: [],
trace: {
reasonType: '报单', // 反馈类型
reasonRelegation: '', // 反馈归属
reason: '', // 反馈原因
appointmentDatetime: null, // 预约时间
appointmentDatetimeRange: '', // 预约时间段类型
nextTraceDatetime: '', // 下次跟踪时间
remark: '', // 备注
}, },
appointTitle: "预约时间", { name: '改约', owns: [{ name: '客户', types: ['有事耽搁', '未带齐工具', '个人改约', '其他'] }, { name: '个人', types: [] }, { name: '客观', types: [] }] }
num: 0, ],
}; dateList: [
}, { day: now, timeRange: [] },
components:{ { day: now + 1 * 86400000, timeRange: [] },
appointTime { day: now + 2 * 86400000, timeRange: [] },
}, { day: now + 3 * 86400000, timeRange: [] },
watch: { { day: now + 4 * 86400000, timeRange: [] },
vuex_token(val) { { day: now + 5 * 86400000, timeRange: [] },
this.initPageData() { day: now + 6 * 86400000, timeRange: [] }
],
timeList: [
{ name: '06:00-08:00', pkey: 'appointment_range_8', disabled: false },
{ name: '08:00-10:00', pkey: 'appointment_range_10', disabled: false },
{ name: '10:00-12:00', pkey: 'appointment_range_12', disabled: false },
{ name: '12:00-14:00', pkey: 'appointment_range_14', disabled: false },
{ name: '14:00-16:00', pkey: 'appointment_range_16', disabled: false },
{ name: '16:00-18:00', pkey: 'appointment_range_18', disabled: false },
{ name: '18:00-20:00', pkey: 'appointment_range_20', disabled: false },
{ name: '20:00-22:00', pkey: 'appointment_range_22', disabled: false },
{ name: '22:00-24:00', pkey: 'appointment_range_24', disabled: false }
],
traceTitles: ['问题归属', '问题类型'],
appointTitle: '预约时间',
appoint: ['下次联系时间', '预约时间'],
trace: {
reasonType: '报单', // 反馈类型
reasonRelegation: '', // 反馈归属
reason: '', // 反馈原因
appointmentDatetime: null, // 预约时间
appointmentDatetimeRange: '', // 预约时间段类型
nextTraceDatetime: '', // 下次跟踪时间
remark: '' // 备注
},
dateItem: null,
timeItem: null,
showRemark: false,
submiting: false,
curTab: 0,
curOwn: 0,
num: 0
};
},
components: {
appointTime
},
watch: {
vuex_token(val) {
this.initPageData();
}
},
computed: {
disabledSubmit() {
let self = this;
if (self.trace.reasonType && self.trace.reasonType == '报备') {
if (self.trace.reasonRelegation && self.trace.reason && self.trace.nextTraceDatetime && self.trace.appointmentDatetimeRange) {
return false;
}
} else if (self.trace.reasonType && self.trace.reasonType == '改约') {
if (self.trace.reasonRelegation && self.trace.reason && self.trace.appointmentDatetime && self.trace.appointmentDatetimeRange) {
return false;
}
}
return true;
}
},
async onLoad(e) {
this.orderId = 1;
this.categoryId = 88;
if (e) {
this.orderId = e.orderId || null;
this.categoryId = e.categoryId || null;
}
uni.showLoading({
title: '数据加载中',
mask: true
});
await this.initPageData();
},
methods: {
/* 初始化页面数据 */
async initPageData() {
let self = this;
await Promise.all([self.loadCalendar(), self.loadTimerange()]);
let params = { categoryId: self.categoryId };
let res = await self.$u.api.feedbackConfig(params);
if (res && res.code == 200) {
self.feedback = res.data;
self.buildConfig();
} }
uni.hideLoading();
}, },
computed: { /* 组装数据项参数 */
disabledSubmit() { buildConfig() {
let self = this let self = this;
if(self.trace.reasonType && self.trace.reasonType == '报备'){ if (self.feedback) {
if(self.trace.reasonRelegation && self.trace.reason let tabs = Object.keys(self.feedback);
&& self.trace.nextTraceDatetime && self.trace.appointmentDatetimeRange) { let tabVals = Object.values(self.feedback);
return false let configs = [];
tabs.forEach(function(tab, index) {
let row = tabVals[index];
let owns = Object.keys(row);
let ownVals = Object.values(row);
configs[index] = { name: tab, owns: [] };
if(tab == '改约') {
self.appoint[index] = '预约时间'
} else if(tab == '报备') {
self.appoint[index] = '下次联系时间'
} }
} else if(self.trace.reasonType && self.trace.reasonType == '改约') { owns.forEach(function(own, key) {
if(self.trace.reasonRelegation && self.trace.reason configs[index]['owns'][key] = { name: own, types: ownVals[key] };
&& self.trace.appointmentDatetime && self.trace.appointmentDatetimeRange) { });
return false });
}
}
return true // 数组改写需要刷新绑定数据
}, self.options = configs;
}, this.initParams()
async onLoad(e) {
this.orderId = 1
this.categoryId = 88
if(e) {
this.orderId = e.orderId || null
this.categoryId = e.categoryId || null
} }
uni.showLoading({
title: "数据加载中",
mask: true
})
await this.initPageData()
}, },
methods: { /* 初始化参数 */
/* 初始化页面数据 */ initParams() {
async initPageData() { let self = this;
let self = this if (self.options) {
let params = {categoryId: self.categoryId} let tabList = self.options[self.curTab]
let pse = await Promise.all([self.$u.api.feedbackConfig(params), self.loadCalendar(), self.loadTimerange()]) self.trace.reasonType = tabList.name;
let res = pse[0] self.trace.reasonRelegation = tabList['owns'][self.curOwn].name;
if(res && res.code == 200) { self.trace.reason = tabList['owns'][self.curOwn]['types'][0];
self.config = res.data self.appointTitle = self.appoint[self.curTab]
self.initParams() self.trace.remark = '';
self.buildConfig() if (self.trace.reasonType == '改约') {
} self.showRemark = true;
uni.hideLoading() if (self.dateList && self.timeList) {
},
/* 组装参数 */
buildConfig() {
let self = this
if(self.config) {
let tabs = Object.keys(self.config)
let list = Object.values(self.config)
tabs.forEach(function(tab, index){
self.tabList[index] = {name: tab}
self.options[index] = list[index]
})
}
},
/* 初始化参数 */
initParams() {
let self = this
if(self.config) {
let tabs = Object.keys(self.config)
let list = Object.values(self.config)
let relegation = Object.keys(list[self.curTab])[0]
let types = Object.values(list[self.curTab][relegation])
self.trace.reasonType = tabs[self.curTab]
self.trace.reasonRelegation = relegation
self.trace.reason = types[0]
if(self.trace.reasonType == '改约') {
self.showRemark = true
self.appointTitle = '预约时间'
if(self.dateList && self.timeList) {
self.timeList.map((item, index) => {
if(self.dateList.indexOf(item.pkey) > -1) {
item.disabled = true
} else {
item.disabled = false
}
})
}
} else {
self.showRemark = false
self.trace.remark = ''
self.appointTitle = '下次联系时间'
self.timeList.map((item, index) => { self.timeList.map((item, index) => {
item.disabled = false if (self.dateItem
}) && self.dateItem.timeRange.indexOf(item.pkey) > -1) {
item.disabled = true;
} else {
item.disabled = false;
}
});
} }
} else {
self.showRemark = false;
self.timeList.map((item, index) => {
item.disabled = false;
});
} }
}, }
},
/* 加载日历数据 */
async loadCalendar() { /* 加载日历数据 */
let self = this async loadCalendar() {
let params = { let self = this;
num: this.num let res = await this.$u.api.workerCalendar({num: this.num});
} if (res && res.code == 200) {
let res = await this.$u.api.workerCalendar(params) self.dateList = res.data;
if(res && res.code == 200) { }
self.dateList = res.data },
}
}, /* 加载预约时间段 */
async loadTimerange() {
/* 加载预约时间段 */ let self = this;
async loadTimerange() { let res = await this.$u.api.openTimerange();
let self = this if (res && res.code == 200) {
let res = await this.$u.api.openTimerange() let list = res.data;
if(res && res.code == 200) { list.map((item, index) => {
let list = res.data item.disabled = false;
list.map((item, index) => { });
item.disabled = false self.timeList = list;
}) }
self.timeList = list },
/**
* 切换tab项
*/
changeTab(index) {
this.curTab = index;
this.initParams();
},
changeOwn(index, own, types) {
let self = this;
self.curOwn = index;
self.trace.reasonRelegation = own;
self.trace.reason = types[0];
},
changeType(index, type) {
this.trace.reason = type;
},
weekChange(data) {
// 点击下一周
console.log(data, 'week-data');
if (data && data.time) {
let num = data.num;
let time = data.time;
this.num = num;
if (num == 0) {
this.loadCalendar();
} else {
this.loadCalendar();
} }
}, }
},
/** dateChange(data) {
* 切换tab项 // 点击日期选择
*/ console.log(data, 'week-data');
changeTab(index) { let self = this;
this.curTab = index; self.dateItem = data.item
this.initParams() if (self.trace.reasonType == '报备') {
}, self.trace.appointmentDatetime = null;
changeOwn(key) { self.trace.nextTraceDatetime = data.item.day;
let self = this self.timeList.map((item, index) => {
self.trace.reasonRelegation = key item.disabled = false;
self.trace.reason = self.options[self.curTab][key][0] });
}, } else if (self.trace.reasonType == '改约') {
changeType(key) { self.trace.appointmentDatetime = data.item.day;
this.trace.reason = key self.trace.nextTraceDatetime = null;
}, self.timeList.map((item, index) => {
weekChange(data){ if (data.item.timeRange.indexOf(item.pkey) > -1) {
// 点击下一周 item.disabled = true;
console.log(data,'week-data')
if (data && data.time) {
let num = data.num
let time = data.time
this.num = num
if (num == 0) {
this.loadCalendar()
} else { } else {
this.loadCalendar() item.disabled = false;
} }
});
} }
self.trace.appointmentDatetimeRange = '';
}, },
dateChange(data){ timeChange(data) {
// 点击日期选择 // 时间段选择变化
console.log(data,'week-data') console.log(data, 'week-data');
let self = this this.trace.appointmentDatetimeRange = data.item.pkey;
if(self.trace.reasonType == '报备') { this.timeItem = data.item
self.trace.appointmentDatetime = null },
self.trace.nextTraceDatetime = data.item.day async submitForm() {
self.timeList.map((item, index) => { let self = this;
item.disabled = false self.orderId = 666;
}) if (!self.orderId) {
} else if(self.trace.reasonType == '改约') { uni.showToast({
self.trace.appointmentDatetime = data.item.day icon: error,
self.trace.nextTraceDatetime = null title: '工单ID不能为空'
self.timeList.map((item, index) => { });
if(data.item.timeRange.indexOf(item.pkey) > -1) { return false;
item.disabled = true }
} else {
item.disabled = false self.submiting = true;
} let res = await self.$u.api.traceAndAppointment(self.trace, self.orderId);
}) self.submiting = false;
}
},
timeChange(data){
// 时间段选择变化
console.log(data,'week-data')
this.trace.appointmentDatetimeRange = data.item
},
async submitForm() {
let self = this
self.orderId = 666
if(!self.orderId) {
uni.showToast({
icon:error,
title:"工单ID不能为空"
})
return false
}
self.submiting = true
let res = await self.$u.api.traceAndAppointment(self.trace, self.orderId)
self.submiting = false
},
} }
} }
};
</script> </script>
<style lang="scss"> <style lang="scss">
.bg { .bg {
width: 750rpx; width: 750rpx;
height: 100vh; height: 100vh;
overflow: auto; overflow: auto;
background-color: #F4F5F7; background-color: #f4f5f7;
background-image: linear-gradient(to top, #F4F5F7 0%, #2272FF 50%); background-image: linear-gradient(to top, #f4f5f7 0%, #2272ff 50%);
background-size: 750rpx 600rpx; background-size: 750rpx 600rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
.feedback-box { .feedback-box {
display: flex;
flex-direction: column;
.header {
padding: 12rpx 30rpx 40rpx 30rpx;
display: flex; display: flex;
flex-direction: column; justify-content: space-between;
.header { align-items: center;
padding: 12rpx 30rpx 40rpx 30rpx; .title {
display: flex; font-size: 40rpx;
justify-content: space-between; font-weight: bold;
align-items: center; color: #ffffff;
.title {
font-size: 40rpx;
font-weight: bold;
color: #FFFFFF;
}
} }
} }
/deep/ .u-subsection{ }
padding:4rpx!important; /deep/ .u-subsection {
} padding: 4rpx !important;
.top-tab{ }
text-align: center; .top-tab {
} text-align: center;
.content { }
display: flex; .content {
flex-direction: column; display: flex;
overflow: hidden; flex-direction: column;
margin-bottom: 188rpx; overflow: hidden;
.content-view { margin-bottom: 188rpx;
height: 100%; .content-view {
height: 100%;
border-radius: 12rpx;
overflow: auto;
margin-top: 30rpx;
.time-view {
border-radius: 12rpx; border-radius: 12rpx;
overflow: auto; background-color: #ffffff;
margin-top:30rpx; padding-bottom: 20rpx;
.time-view {
border-radius: 12rpx;
background-color: #FFFFFF;
padding-bottom: 20rpx;
}
} }
} }
.bottom-view { }
position: fixed; .bottom-view {
bottom: 44rpx; position: fixed;
width: 100%; bottom: 44rpx;
width: 100%;
}
.bottom-btn {
height: 104rpx;
width: 600rpx;
display: flex;
align-items: center;
justify-content: center;
.button-text {
font-size: 32rpx;
font-weight: bold;
} }
.bottom-btn { }
height: 104rpx;
width: 600rpx; .con-box {
display: flex; padding: 30rpx 30rpx 8rpx 30rpx;
align-items: center; border-radius: 12rpx;
justify-content: center; background-color: #ffffff;
.button-text { .title {
font-size: 32rpx; font-weight: bold;
font-weight: bold; font-size: 32rpx;
} line-height: 32rpx;
color: #333;
} }
& > .u-flex {
.con-box{ margin-top: 40rpx;
padding: 30rpx 30rpx 8rpx 30rpx; margin-right: -24rpx;
border-radius: 12rpx; .txt-item {
background-color: #FFFFFF; border-radius: 12rpx;
.title{ padding: 24rpx 38rpx;
font-weight: bold; width: 196rpx;
font-size: 32rpx; height: 72rpx;
line-height: 32rpx; text-align: center;
color: #333; margin-right: 22rpx;
} margin-bottom: 20rpx;
&>.u-flex{ background-color: #f4f5f7;
margin-top:40rpx; &.active {
margin-right:-24rpx; background-color: #2272ff;
.txt-item{ .txt {
border-radius: 12rpx; color: #fff;
padding:24rpx 24rpx; text-overflow: ellipsis;
width: 196rpx; overflow: hidden;
height: 72rpx; white-space: nowrap;
text-align: center;
margin-right: 22rpx;
margin-bottom: 20rpx;
background-color: #F4F5F7;
&.active{
background-color: #2272FF;
.txt{
color: #fff;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
} }
} }
} }
.txt{
display:block;
font-size: 26rpx;
line-height: 26rpx;
color: #333;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.input-view {
margin-bottom: 24rpx;
}
.textarea{
/deep/ .u-input{
textarea{
margin-top:20rpx;
border: 2rpx solid #ECECEC;
padding:18rpx 30rpx;
}
}
}
} }
.btn{
padding:30rpx; .txt {
border-radius: 52rpx; display: block;
line-height: 44rpx; font-size: 26rpx;
font-size:32rpx; line-height: 26rpx;
text-align: center; color: #333;
background-color: #2272FF; text-overflow: ellipsis;
color:#fff; overflow: hidden;
&::after{ white-space: nowrap;
content:'';
height:0;
border: none;
}
} }
button[disabled]:not([type]) { .input-view {
background: #D1D4D4; margin-bottom: 24rpx;
color: #FFFFFF;
} }
.btn{ .textarea {
padding:30rpx; /deep/ .u-input {
border-radius: 52rpx; textarea {
line-height: 44rpx; margin-top: 20rpx;
font-size:32rpx; border: 2rpx solid #ececec;
text-align: center; padding: 18rpx 30rpx;
background-color: #2272FF; }
color:#fff;
&::after{
content:'';
height:0;
} }
} }
.width-320{ }
width:320rpx; .btn {
padding: 30rpx;
border-radius: 52rpx;
line-height: 44rpx;
font-size: 32rpx;
text-align: center;
background-color: #2272ff;
color: #fff;
&::after {
content: '';
height: 0;
border: none;
}
}
button[disabled]:not([type]) {
background: #d1d4d4;
color: #ffffff;
}
.btn {
padding: 30rpx;
border-radius: 52rpx;
line-height: 44rpx;
font-size: 32rpx;
text-align: center;
background-color: #2272ff;
color: #fff;
&::after {
content: '';
height: 0;
} }
}
.width-320 {
width: 320rpx;
}
</style> </style>
...@@ -176,6 +176,7 @@ ...@@ -176,6 +176,7 @@
}, },
reachBottom(e) { reachBottom(e) {
console.log('-------底部-------', this.loadStatus)
if (this.loadStatus != 'loadmore') return if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading' this.loadStatus == 'loading'
this.getOrderList(this.currentIndex) this.getOrderList(this.currentIndex)
...@@ -194,6 +195,40 @@ ...@@ -194,6 +195,40 @@
var self = this; var self = this;
self.$u.api.listOrder(param).then((res) => { self.$u.api.listOrder(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
/*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/
// res.data.type = self.orderType
// if (res.data.list) {
// if (res.data.list.length == 0 && res.data.total > 0) {
// res.data.total = 15
// res.data.list = [{
// orderServiceType: '安装', // 服务类型:安装、维修
// categoryName: '充电桩', // 品类:充电桩
// orderBusinessTypeText: '分配单', // 业务类型:分配单、订单池
// orderNumber: 'OR2021041809827', // 工单编号
// contactName: '郭小清', // 客户信息
// contactPhone: '13631612077', // 联系方式
// contactAddress: '湾街道荔枝花园D座125号', // 详细地址
// contactAddressLatitud: '116.3896', // 联系人地址经度
// contactAddressLongitud: '39.91917', // 联系人地址纬度
// orderStatus: 0, // 工单状态
// appointmentDatetime: '', // 预约时间
// currentWillOverTime: 10000, // 剩余时间
// currentOverTime: new Date().getTime() + 10000, // 超过时间点
// auditDatetime: '2021.04.19 12:45:09', // 审核时间
// submissionTime: '2021.04.19 16:24:48', // 提交时间
// auditResults: {}, // 审核结果
// orderBusinessType: 'R', // 业务类型 R 为抢单
// orderId: '1100000216'
// }]
// res.data.list = [...res.data.list, ...res.data.list, ...res.data.list, ...res.data
// .list,
// ...res.data.list, ...res.data.list, ...res.data.list, ...res.data.list, ...
// res
// .data.list, ...res.data.list
// ]
// }
// }
/*↑↑↑↑↑↑↑↑↑↑测试数据↑↑↑↑↑↑↑↑↑↑↑↑↑*/
// 后台需要返回type,防止数据返回延迟期间点击了其他的tab // 后台需要返回type,防止数据返回延迟期间点击了其他的tab
if (res.data.type != self.orderType) return if (res.data.type != self.orderType) return
self.triggered = false; self.triggered = false;
...@@ -228,7 +263,7 @@ ...@@ -228,7 +263,7 @@
item.count = res.data.toCheckinCount item.count = res.data.toCheckinCount
} else if (item.name === '待完工') { } else if (item.name === '待完工') {
item.count = res.data.toFinishCount item.count = res.data.toFinishCount
} else if (item.name === '待审核') { } else if (item.name === '审核中') {
item.count = res.data.reviewingCount item.count = res.data.reviewingCount
} else if (item.name === '异常单') { } else if (item.name === '异常单') {
item.count = res.data.exceptionCount item.count = res.data.exceptionCount
......
...@@ -39,7 +39,7 @@ uploader.getQnToken = function(params) { ...@@ -39,7 +39,7 @@ uploader.getQnToken = function(params) {
*region: 地区 默认为:ECN *region: 地区 默认为:ECN
*/ */
resolve({ resolve({
visitPrefix: data.host || '', visitPrefix: data.host || globalUrl.qn_asset_url,
token: data.token || '', token: data.token || '',
folderPath: data.folderPath || '', folderPath: data.folderPath || '',
region: "ECN" region: "ECN"
......
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