后台接口对接
This commit is contained in:
parent
28fd05cfca
commit
f66125314e
|
|
@ -13,17 +13,21 @@ export default {
|
|||
})
|
||||
let userInfo = _this.getCurUserInfo();
|
||||
// request 触发前拼接 url
|
||||
// args.url = 'https://www.opsoul.com' + args.url;
|
||||
args.url = 'http://127.0.0.1:80' + args.url;
|
||||
// args.url = 'http://10.45.137.214:80' + args.url;
|
||||
args.url = 'https://www.opsoul.com' + args.url;
|
||||
// args.url = 'http://127.0.0.1:80' + args.url;
|
||||
// args.url = 'http://192.168.2.42:80' + args.url;
|
||||
|
||||
if (!args.data) {
|
||||
args.data = {}
|
||||
}
|
||||
if (args.data instanceof Object) {
|
||||
args.data.deptId = globalData.deptId;
|
||||
args.data.from = globalData.from;
|
||||
if (!args.data.workerId) {
|
||||
args.data.workerId = userInfo.workerId;
|
||||
}
|
||||
}
|
||||
|
||||
if (!args.header) {
|
||||
args.header = {}
|
||||
}
|
||||
|
|
@ -480,5 +484,13 @@ export default {
|
|||
method: 'POST'
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async qrPay(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/pay/ali/qr',
|
||||
method: 'POST',
|
||||
data: params.orderMasterId
|
||||
})
|
||||
return res[1].data;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,6 +84,10 @@
|
|||
curDate: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
ifRollback2WS: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
|
@ -126,7 +130,7 @@
|
|||
this.resetData();
|
||||
this.$emit('showArrangeFailTime', e)
|
||||
},
|
||||
arrangeTime(e) {
|
||||
async arrangeTime(e) {
|
||||
if (!(this.time || this.timeRange)) {
|
||||
uni.showToast({
|
||||
title: '请选择时间'
|
||||
|
|
@ -134,7 +138,7 @@
|
|||
return;
|
||||
}
|
||||
let datetime = this.date + ' ' + (this.time || this.timeRange) + ':00';
|
||||
this.$emit('editServTime', this.data.orderDetailId, datetime);
|
||||
this.$emit('editServTime', this.data.orderDetailId, datetime, this.ifRollback2WS);
|
||||
this.hideModal(e);
|
||||
},
|
||||
changeReasonRadio(e) {
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<view class="cu-modal" :class="show?'show':''">
|
||||
<view class="cu-dialog">
|
||||
<view class="cu-bar bg-white justify-end">
|
||||
<view class="content">扫码支付</view>
|
||||
<view class="action" data-modal="showPayQrcodeModal" @click="hideModal">
|
||||
<view class="content">支付宝扫码支付</view>
|
||||
<view class="action" data-modal="showPayQrcodeModal" @click="finishQrPay">
|
||||
<text class="cuIcon-close text-red"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -13,9 +13,11 @@
|
|||
<ayQrcode ref="qrcode" :modal="modal_qr" :url="url" @hideQrcode="hideQrcode" :height="300"
|
||||
:width="300" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="text-center padding-bottom-xl">
|
||||
<view>请客户扫描码付款后方能提交完单</view>
|
||||
<view class="text-red">必须按二维码生成金额支付</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -25,6 +27,7 @@
|
|||
|
||||
export default {
|
||||
nama: 'pay-qrcode',
|
||||
emits: ['finishQrPay'],
|
||||
components: {
|
||||
ayQrcode
|
||||
},
|
||||
|
|
@ -46,8 +49,8 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
hideModal(e) {
|
||||
uni.$emit(this.$globalFun.HIDE_MODAL, e);
|
||||
finishQrPay(e) {
|
||||
this.$emit('finishQrPay', e);
|
||||
},
|
||||
// 展示二维码
|
||||
showQrcode(url) {
|
||||
|
|
|
|||
|
|
@ -74,8 +74,9 @@
|
|||
<view v-if="order.orderStatus === 0" class="right-tag padding-lr-sm padding-tb-xs bg-cyan">新</view>
|
||||
<view v-else-if="order.orderStatus === 1" class="right-tag padding-lr-sm padding-tb-xs bg-main-color">未</view>
|
||||
<view v-else-if="order.orderStatus === 2" class="right-tag padding-lr-sm padding-tb-xs bg-yellow">待</view>
|
||||
<view v-else-if="order.orderStatus === 3 || order.orderStatus === 6" class="right-tag padding-lr-sm padding-tb-xs bg-purple">服</view>
|
||||
<view v-else-if="order.orderStatus === 4" class="right-tag padding-lr-sm padding-tb-xs bg-yellow">确</view>
|
||||
<view v-else-if="order.orderStatus === 3" class="right-tag padding-lr-sm padding-tb-xs bg-purple">服</view>
|
||||
<view v-else-if="order.orderStatus === 6" class="right-tag padding-lr-sm padding-tb-xs bg-orange">确</view>
|
||||
<view v-else-if="order.orderStatus === 4" class="right-tag padding-lr-sm padding-tb-xs bg-green">完</view>
|
||||
</view>
|
||||
<view>
|
||||
<view v-for="(tag, index1) in order.tags" v-if="tag.level === 'error'" class='cu-tag margin-right-xs radius line-red margin-top-xs'>{{tag.content}}</view>
|
||||
|
|
@ -134,24 +135,24 @@
|
|||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="makePhoneCall(order.customerPhone)">联系客户</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)">修改时间</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">立即上门</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="workBegin(order)">立即上门</button>
|
||||
</view>
|
||||
<view v-if="order.orderStatus === 3">
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showNewServPriceModal" @tap="showModal($event, order)">改价</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="makePhoneCall(order.customerPhone)">联系客户</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)">修改时间</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="finishOrder(order)">拍照回单</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)">重新排期</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="finishOrder(order)">发起完单</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showPayQrcodeModal" @tap="makePayQrcode($event, order)">生成付款码</button>
|
||||
</view>
|
||||
<view v-if="order.orderStatus === 4">
|
||||
<!-- <view v-if="order.orderStatus === 4">
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="sendUrgentMsgModal" @tap="showModal($event, order)">师傅急报</button>
|
||||
</view>
|
||||
<view v-if="order.orderStatus === 'afterSaleService'">
|
||||
</view> -->
|
||||
<!-- <view v-if="order.orderStatus === 'afterSaleService'">
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="makePhoneCall(order.customerPhone)">联系客户</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)">修改时间</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">立即上门</button>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="margin-top-sm solid-top padding-top-sm" v-if="order.afterSaleType === 'finished'">
|
||||
<view class="flex justify-start align-end">
|
||||
<text>退单申请:</text>
|
||||
|
|
@ -209,8 +210,8 @@
|
|||
<time-arrange :show="showTimeArrangeModal" :data="curOrder" :curDate="curDate" @showArrangeFailTime="showArrangeFailTime" @editServTime="editServTime"></time-arrange>
|
||||
<time-arrange-fail :show="showArrangeFailTimeModal" :data="curOrder"></time-arrange-fail>
|
||||
<new-serv-price :show="showNewServPriceModal" :data="curOrder"></new-serv-price>
|
||||
<pay-qrcode ref="payQrcode" :show="showPayQrcodeModal" :data="curOrder"></pay-qrcode>
|
||||
<edit-time-arrange :show="showEditTimeArrangeModal" :data="curOrder" :curDate="curDate" @showArrangeFailTime="showArrangeFailTime" @editServTime="editServTime"></edit-time-arrange>
|
||||
<pay-qrcode ref="payQrcode" :show="showPayQrcodeModal" :data="curOrder" @finishQrPay="finishQrPay"></pay-qrcode>
|
||||
<edit-time-arrange :show="showEditTimeArrangeModal" :data="curOrder" :curDate="curDate" @showArrangeFailTime="showArrangeFailTime" @editServTime="editServTime" :ifRollback2WS="true"></edit-time-arrange>
|
||||
<urgent-msg :show="sendUrgentMsgModal" @hideModal="hideModal"></urgent-msg>
|
||||
<pic-modal ref="showPicModal" :imgList="picModalImgList"></pic-modal>
|
||||
<!-- popup -->
|
||||
|
|
@ -559,7 +560,7 @@
|
|||
data: data
|
||||
});
|
||||
},
|
||||
async editServTime(id, datetime) {
|
||||
async editServTime(id, datetime, ifRollback2WS) {
|
||||
let reqFunName = "updateDetailOrder";
|
||||
if (this.tabCur === 0) {
|
||||
reqFunName = "updateOrder"
|
||||
|
|
@ -569,18 +570,39 @@
|
|||
revTime: datetime
|
||||
});
|
||||
if (res.code === 0) {
|
||||
let finishFlag = false;
|
||||
if (ifRollback2WS) {
|
||||
let statusUpdateRes = await this.updateOrderDetailStatus(id, 2);
|
||||
if (statusUpdateRes && statusUpdateRes.code === 0) {
|
||||
finishFlag = true;
|
||||
}
|
||||
}
|
||||
if (finishFlag) {
|
||||
this.reloadMasterOrderPage();
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'success'
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
async updateOrderDetailStatus(orderDetailId, status) {
|
||||
let res = await this.$request.updateDetailOrder({
|
||||
id: orderDetailId,
|
||||
orderStatus: status,
|
||||
workBeginTime: ''
|
||||
});
|
||||
return res;
|
||||
},
|
||||
showArrangeFailTime(e) {
|
||||
this.showTimeArrangeModal = false;
|
||||
this.showEditTimeArrangeModal = false;
|
||||
this.showArrangeFailTimeModal = true;
|
||||
},
|
||||
finishQrPay(e) {
|
||||
this.hideModal(e);
|
||||
this.reloadMasterOrderPage();
|
||||
},
|
||||
togglePopup(e, orderInfo) {
|
||||
if (this.ifShowPageMeta) {
|
||||
this.$refs[e.currentTarget.dataset.popup].close();
|
||||
|
|
@ -602,19 +624,38 @@
|
|||
phoneNumber: phoneNum
|
||||
})
|
||||
},
|
||||
makePayQrcode(e, orderInfo) {
|
||||
this.$refs.payQrcode.showQrcode('http://10.45.81.125:8081/portal/' + Math.random());
|
||||
async makePayQrcode(e, orderInfo) {
|
||||
if (orderInfo.payStatus === 1) {
|
||||
uni.showToast({
|
||||
title: '订单已支付,不要重复付款!',
|
||||
icon: 'none'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let res = await this.$request.qrPay(orderInfo);
|
||||
if (res && res.code === 0) {
|
||||
this.$refs.payQrcode.showQrcode(res.data.expend.qrcode_url);
|
||||
this.showModal(e, orderInfo);
|
||||
}
|
||||
},
|
||||
showServOrderDetail(order) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order-manage/serv-detail?order=' + encodeURIComponent(JSON.stringify(order))
|
||||
})
|
||||
},
|
||||
finishOrder(order) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order-manage/finish-order?order=' + encodeURIComponent(JSON.stringify(order))
|
||||
// finishOrder(order) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/order-manage/finish-order?order=' + encodeURIComponent(JSON.stringify(order))
|
||||
// })
|
||||
// },
|
||||
async finishOrder(order) {
|
||||
let res = await this.updateOrderDetailStatus(order.orderDetailId, 6);
|
||||
if (res && res.code === 0) {
|
||||
this.reloadMasterOrderPage();
|
||||
uni.showToast({
|
||||
icon: 'success'
|
||||
})
|
||||
}
|
||||
},
|
||||
updateRefundStatus(status, index) {
|
||||
this.orderList[index].refundStatus = status;
|
||||
|
|
@ -625,6 +666,20 @@
|
|||
getCanAssignList(order) {
|
||||
this.$refs.dispatchOrder.$children[0].loadData(order);
|
||||
},
|
||||
async workBegin(order) {
|
||||
let curDate = new Date();
|
||||
let formatCurDate = curDate.getFullYear() + '-' + (curDate.getMonth() + 1) + '-' + curDate.getDate()
|
||||
+ ' ' + curDate.getHours() + ':' + curDate.getMinutes() + ':' + curDate.getSeconds();
|
||||
let params = {
|
||||
id: order.orderDetailId,
|
||||
orderStatus: 3,
|
||||
workBeginTime: formatCurDate
|
||||
}
|
||||
let res = await this.$request.updateDetailOrder(params);
|
||||
if (res && res.code === 0) {
|
||||
this.reloadMasterOrderPage();
|
||||
}
|
||||
},
|
||||
/* modal,popup确认或关闭后的回调 */
|
||||
async showAfterSalePic() {
|
||||
// TODO:查询该售后单中的拒绝原因中上传的截图
|
||||
|
|
|
|||
|
|
@ -82,15 +82,15 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 完成记录 -->
|
||||
<view class="bg-white margin-lr-sm padding-lr padding-bottom margin-top-sm" v-for="(item, index) in servDetail.finishRecord" v-if="servDetail.orderStatus === 3">
|
||||
<view class="bg-white margin-lr-sm padding-lr padding-bottom margin-top-sm" v-for="(item, index) in servDetail.standardList">
|
||||
<view class="cu-bar solid-bottom">
|
||||
<view class="action bar-first-action">
|
||||
<text class="cuIcon-titles text-main-color"></text> 完成记录({{item.finishList.length}})
|
||||
<text class="cuIcon-titles text-main-color"></text> 完成记录
|
||||
</view>
|
||||
<view class='cu-tag bg-purple radius light margin-right-sm'>{{item.finishTime}}</view>
|
||||
<view class='cu-tag bg-purple radius light margin-right-sm' v-if="item.finishTime">{{item.finishTime}}</view>
|
||||
</view>
|
||||
<view class="margin-top-sm">
|
||||
<product-picked :pickedList="item.finishList" :columnTitleArr="servedColumnHeaders" :showToServNum="true"></product-picked>
|
||||
<product-picked :pickedList="[item]" :columnTitleArr="servedColumnHeaders" :valFieldArr="servedValFields"></product-picked>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 订单编码和时间 -->
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
</view>
|
||||
发送急报
|
||||
</view>
|
||||
<view v-if="servDetail.orderStatus === 2 && !servDetail.workBeginTime" class="bg-main-color submit" @click="workBegin">立即上门</view>
|
||||
<view v-if="servDetail.orderStatus === 2" class="bg-main-color submit" @click="workBegin">立即上门</view>
|
||||
</view>
|
||||
<uni-popup ref="orderManage" type="bottom" @change="changePopupState">
|
||||
<view class="bg-white text-center">
|
||||
|
|
@ -224,6 +224,9 @@
|
|||
let res = await this.$request.updateDetailOrder(params);
|
||||
if (res && res.code === 0) {
|
||||
this.loadData(this.servDetail.orderDetailId);
|
||||
uni.showToast({
|
||||
icon: 'success'
|
||||
})
|
||||
}
|
||||
},
|
||||
showModal(e) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue