报价/完单流程开发

This commit is contained in:
donqi 2022-09-25 00:22:59 +08:00
parent 27a49359ec
commit 99084cf6be
4 changed files with 353 additions and 150 deletions

View File

@ -13,8 +13,8 @@ export default {
}) })
let userInfo = _this.getCurUserInfo(); let userInfo = _this.getCurUserInfo();
// request 触发前拼接 url // request 触发前拼接 url
args.url = 'https://www.opsoul.com' + args.url; // args.url = 'https://www.opsoul.com' + args.url;
// args.url = 'http://127.0.0.1:80' + args.url; args.url = 'http://127.0.0.1:80' + args.url;
// args.url = 'http://192.168.2.42:80' + args.url; // args.url = 'http://192.168.2.42:80' + args.url;
if (!args.data) { if (!args.data) {
@ -606,5 +606,21 @@ export default {
data: params data: params
}) })
return res[1].data; return res[1].data;
},
async changeOrderPrice(params = {}) {
let res = await uni.request({
url: '/order/detail/app/change/price',
method: 'POST',
data: params
})
return res[1].data;
},
async getChangeOrderPrice(params = {}) {
let res = await uni.request({
url: '/order/detail/app/getChangePrice',
method: 'POST',
data: params
})
return res[1].data;
} }
} }

View File

@ -1,66 +1,167 @@
<template> <template>
<!-- 报价/客户支付模态框 --> <!-- 报价/客户支付模态框 -->
<view class="cu-modal" :class="show?'show':''"> <view class="cu-modal" :class="show?'show':''">
<view class="cu-dialog"> <view class="cu-dialog">
<view class="cu-bar bg-white justify-end solid-bottom"> <view class="cu-bar bg-white justify-end solid-bottom">
<view class="content">到付款单/二维码收付</view> <view class="content">到付款单/二维码支付</view>
<view class="action" data-modal="showNewServPriceModal" @click="hideModal"> <view class="action" data-modal="showNewServPriceOfflineModal" @click="hideModal">
<text class="cuIcon-close text-red"></text> <text class="cuIcon-close text-red"></text>
</view> </view>
</view> </view>
<view class="padding padding-lr-xl bg-white text-left"> <view class="padding padding-lr-xl bg-white text-left">
<view>上门后新增的报价</view> <view class="text-lg">上门后新增的报价</view>
<view class="flex justify-start margin-top-sm align-center"> <radio-group class="padding-tb-sm">
<text>报价总额</text> <view class="padding-tb-sm" @click="changePayAction(0)">
<input class="radius-input" v-model="newPrice"></input> <radio style="transform:scale(0.7)" class="main-color" :checked="payAction === 0"></radio>
<text></text> <text class="margin-left">无报价直接拍照完单</text>
</view> </view>
<view class="margin-top text-sm text-red"> <view class="padding-tb-sm flex justify-start align-start" @click="changePayAction(1)">
<view>无新增支付则无需填写</view> <radio style="transform:scale(0.7)" class="main-color" :checked="payAction === 1"></radio>
<view>预先报价待再次上门的需填写/如维修类</view> <view class="margin-left">
</view> <view>上门有加单请客户支付</view>
</view> <view class="flex justify-start margin-top-sm align-center">
<view class="cu-bar bg-white solid-top"> <text>加单总额</text>
<view class="action margin-0 flex-sub text-black" data-modal="showNewServPriceModal" <input class="radius-input inline-input" v-model="newPriceForA1"></input>
@click="newServPrice">确定报价</view> <text class="margin-left-xs"></text>
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="showNewServPriceModal" <view class="cu-btn line-main-color sm margin-left" v-if="priceObj && priceObj.changeMoney"
@click="letCustomerPay">请客户支付</view> @click="changeOrderPrice(newPriceForA1)">修改报价</view>
</view> <view class="cu-btn line-main-color sm margin-left" v-else
</view> @click="changeOrderPrice(newPriceForA1)">确认报价</view>
</view> </view>
</template> </view>
</view>
<view class="padding-tb-sm flex justify-start align-start" @click="changePayAction(2)">
<radio style="transform:scale(0.7)" class="main-color" :checked="payAction === 2"></radio>
<view class="margin-left">
<view>上门报价类给现场客户的报价</view>
<view class="flex justify-start margin-top-sm align-center">
<text>报价总额</text>
<input class="radius-input inline-input" v-model="newPriceForA2"></input>
<text class="margin-left-xs"></text>
<view class="cu-btn line-main-color sm margin-left" v-if="priceObj && priceObj.changeMoney"
@click="changeOrderPrice(newPriceForA2)">修改报价</view>
<view class="cu-btn line-main-color sm margin-left" v-else
@click="changeOrderPrice(newPriceForA2)">确认报价</view>
</view>
</view>
</view>
</radio-group>
<view class="margin-top-sm">
<textarea style="width: 100%; height: 200rpx;" class="solid radius text-left padding-sm"
v-model="remark" maxlength="-1"
placeholder="报价额需符合双方约定并把关键内容附上。如保内维修XX含配件XXX等分别XX元。如约定下单方寄配件则订单内“申请配件发起”。"></textarea>
</view>
</view>
<view class="cu-bar bg-white solid-top">
<view class="action margin-0 flex-sub text-black" data-modal="showNewServPriceOfflineModal"
@click="hideModal">退出/再次上门</view>
<view class="action margin-0 flex-sub text-main-color solid-left" v-if="priceObj && priceObj.payStatus === 0"
data-modal="showPayQrcodeModal" @tap="makePayQrcode($event)">请客户支付</view>
<view class="action margin-0 flex-sub text-main-color solid-left"
data-modal="showNewServPriceOfflineModal" @tap="hideModal" @click="goFinishOrder" v-else>去完单</view>
</view>
</view>
<pay-qrcode ref="payQrcode" :show="showPayQrcodeModal" :data="data" @finishQrPay="finishQrPay"></pay-qrcode>
</view>
</template>
<script> <script>
export default { import payQrcode from '@/pages/order-manage/modal/pay-qrcode.vue';
export default {
nama: 'new-serv-price', nama: 'new-serv-price',
props: { components: {
show: { payQrcode
type: Boolean, },
default: false props: {
}, show: {
data: { type: Boolean,
type: Object, default: false
default: {} },
} data: {
}, type: Object,
data() { default: {}
}
},
data() {
return { return {
newPrice: '' priceObj: null,
} payAction: 0,
}, newPriceForA2: null,
newPriceForA1: null,
newPrice: null,
showPayQrcodeModal: false
}
},
methods: { methods: {
init(priceObj) {
this.priceObj = priceObj;
if (priceObj && priceObj.type) {
this.payAction = priceObj.type;
let money = priceObj.changeMoney;
if (this.payAction === 1) {
this.newPriceForA1 = money;
} else if (this.payAction === 2) {
this.newPriceForA2 = money;
}
}
},
resetData() {
this.payAction = 0;
this.newPrice = null;
this.newPriceForA2 = null;
this.newPriceForA1 = null;
this.priceObj = null;
},
hideModal(e) { hideModal(e) {
uni.$emit(this.$globalFun.HIDE_MODAL, e); this.resetData();
uni.$emit(this.$globalFun.HIDE_MODAL, e);
}, },
newServPrice(e) { async resetPriceChangedInfo() {
uni.$emit(this.$globalFun.NEW_SERV_PRICE, e) let res = await this.$request.getChangeOrderPrice(this.data);
if (res && res.code === 0) {
this.resetData();
this.init(res.data);
}
}, },
letCustomerPay(e) { changePayAction(payAction) {
uni.$emit(this.$globalFun.LET_CUSTOMER_PAY, e) this.payAction = payAction;
} },
} async changeOrderPrice(newPrice) {
} let res = await this.$request.changeOrderPrice({
</script> orderDetailId: this.data.orderDetailId,
changeMoney: newPrice,
<style> type: this.payAction
});
if (res && res.code === 0) {
this.resetPriceChangedInfo();
uni.showToast({
icon: 'success',
title: '修改成功',
duration: 1000
})
}
},
async makePayQrcode(e) {
let res = await this.$request.qrPay(this.data);
if (res && res.code === 0) {
this.showPayQrcodeModal = true;
this.$refs.payQrcode.showQrcode(res.data.expend.qrcode_url);
}
},
finishQrPay(e) {
this.showPayQrcodeModal = false;
this.resetPriceChangedInfo();
},
goFinishOrder() {
this.$emit('finishOrder', this.data);
}
}
}
</script>
<style scoped>
.inline-input {
flex-basis: 25%;
}
</style> </style>

View File

@ -1,94 +1,167 @@
<template> <template>
<!-- 报价/客户支付模态框 --> <!-- 报价/客户支付模态框 -->
<view class="cu-modal" :class="show?'show':''"> <view class="cu-modal" :class="show?'show':''">
<view class="cu-dialog"> <view class="cu-dialog">
<view class="cu-bar bg-white justify-end solid-bottom"> <view class="cu-bar bg-white justify-end solid-bottom">
<view class="content">上门报价与加单</view> <view class="content">上门报价与加单</view>
<view class="action" data-modal="showNewServPriceModal" @click="hideModal"> <view class="action" data-modal="showNewServPriceOnlineModal" @click="hideModal">
<text class="cuIcon-close text-red"></text> <text class="cuIcon-close text-red"></text>
</view> </view>
</view> </view>
<view class="padding padding-lr-xl bg-white text-left"> <view class="padding padding-lr-xl bg-white text-left">
<view class="text-lg">上门后新增的报价</view> <view class="text-lg">上门后新增的报价</view>
<radio-group class="padding-tb-sm"> <radio-group class="padding-tb-sm">
<view class="padding-tb-sm" @click="chooseCompanySize(0)"> <view class="padding-tb-sm" @click="changePayAction(0)">
<radio style="transform:scale(0.7)" class="main-color" <radio style="transform:scale(0.7)" class="main-color" :checked="payAction === 0"></radio>
:checked="payAction === 0"></radio> <text class="margin-left">无报价直接拍照完单</text>
<text class="margin-left">无报价直接拍照完单</text> </view>
</view> <view class="padding-tb-sm flex justify-start align-start" @click="changePayAction(1)">
<view class="padding-tb-sm flex justify-start align-start" @click="chooseCompanySize(0)"> <radio style="transform:scale(0.7)" class="main-color" :checked="payAction === 1"></radio>
<radio style="transform:scale(0.7)" class="main-color" <view class="margin-left">
:checked="payAction === 1"></radio> <view>上门有加单请客户支付</view>
<view class="margin-left"> <view class="flex justify-start margin-top-sm align-center">
<view>上门有加单请客户支付</view> <text>加单总额</text>
<view class="flex justify-start margin-top-sm align-center"> <input class="radius-input inline-input" v-model="newPriceForA1"></input>
<text>加单总额</text> <text class="margin-left-xs"></text>
<input class="radius-input inline-input" v-model="newPrice"></input> <view class="cu-btn line-main-color sm margin-left" v-if="priceObj && priceObj.changeMoney"
<text class="margin-left-xs"></text> @click="changeOrderPrice(newPriceForA1)">修改报价</view>
<view class="cu-btn line-main-color sm margin-left">修改报价</view> <view class="cu-btn line-main-color sm margin-left" v-else
</view> @click="changeOrderPrice(newPriceForA1)">确认报价</view>
</view> </view>
</view> </view>
<view class="padding-tb-sm flex justify-start align-start" @click="chooseCompanySize(0)"> </view>
<radio style="transform:scale(0.7)" class="main-color" <view class="padding-tb-sm flex justify-start align-start" @click="changePayAction(2)">
:checked="payAction === 2"></radio> <radio style="transform:scale(0.7)" class="main-color" :checked="payAction === 2"></radio>
<view class="margin-left"> <view class="margin-left">
<view>上门报价类给下单方报价</view> <view>上门报价类给下单方报价</view>
<view class="flex justify-start margin-top-sm align-center"> <view class="flex justify-start margin-top-sm align-center">
<text>报价总额</text> <text>报价总额</text>
<input class="radius-input inline-input" v-model="newPrice"></input> <input class="radius-input inline-input" v-model="newPriceForA2"></input>
<text class="margin-left-xs"></text> <text class="margin-left-xs"></text>
<view class="cu-btn line-main-color sm margin-left">修改报价</view> <view class="cu-btn line-main-color sm margin-left" v-if="priceObj && priceObj.changeMoney"
</view> @click="changeOrderPrice(newPriceForA2)">修改报价</view>
</view> <view class="cu-btn line-main-color sm margin-left" v-else
</view> @click="changeOrderPrice(newPriceForA2)">确认报价</view>
</radio-group> </view>
</view> </view>
<view class="cu-bar bg-white solid-top"> </view>
<view class="action margin-0 flex-sub text-black" data-modal="showNewServPriceOnlineModal" </radio-group>
@click="newServPrice">退出</view> <view class="margin-top-sm">
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="showNewServPriceOnlineModal" <textarea style="width: 100%; height: 200rpx;" class="solid radius text-left padding-sm"
@click="letCustomerPay">去完单</view> v-model="remark" maxlength="-1"
</view> placeholder="报价额需符合双方约定并把关键内容附上。如保内维修XX含配件XXX等分别XX元。如约定下单方寄配件则订单内“申请配件发起”。"></textarea>
</view> </view>
</view> </view>
</template> <view class="cu-bar bg-white solid-top">
<view class="action margin-0 flex-sub text-black" data-modal="showNewServPriceOnlineModal"
@click="hideModal">退出/再次上门</view>
<view class="action margin-0 flex-sub text-main-color solid-left" v-if="priceObj && priceObj.payStatus === 0"
data-modal="showPayQrcodeModal" @tap="makePayQrcode($event)">请客户支付</view>
<view class="action margin-0 flex-sub text-main-color solid-left"
data-modal="showNewServPriceOnlineModal" @tap="hideModal" @click="goFinishOrder" v-else>去完单</view>
</view>
</view>
<pay-qrcode ref="payQrcode" :show="showPayQrcodeModal" :data="data" @finishQrPay="finishQrPay"></pay-qrcode>
</view>
</template>
<script> <script>
export default { import payQrcode from '@/pages/order-manage/modal/pay-qrcode.vue';
export default {
nama: 'new-serv-price', nama: 'new-serv-price',
props: { components: {
show: { payQrcode
type: Boolean, },
default: false props: {
}, show: {
data: { type: Boolean,
type: Object, default: false
default: {} },
} data: {
}, type: Object,
data() { default: {}
}
},
data() {
return { return {
priceObj: null,
payAction: 0, payAction: 0,
newPrice: '' newPriceForA2: null,
} newPriceForA1: null,
}, newPrice: null,
showPayQrcodeModal: false
}
},
methods: { methods: {
init(priceObj) {
this.priceObj = priceObj;
if (priceObj && priceObj.type) {
this.payAction = priceObj.type;
let money = priceObj.changeMoney;
if (this.payAction === 1) {
this.newPriceForA1 = money;
} else if (this.payAction === 2) {
this.newPriceForA2 = money;
}
}
},
resetData() {
this.payAction = 0;
this.newPrice = null;
this.newPriceForA2 = null;
this.newPriceForA1 = null;
this.priceObj = null;
},
hideModal(e) { hideModal(e) {
uni.$emit(this.$globalFun.HIDE_MODAL, e); this.resetData();
uni.$emit(this.$globalFun.HIDE_MODAL, e);
}, },
newServPrice(e) { async resetPriceChangedInfo() {
uni.$emit(this.$globalFun.NEW_SERV_PRICE, e) let res = await this.$request.getChangeOrderPrice(this.data);
if (res && res.code === 0) {
this.resetData();
this.init(res.data);
}
}, },
letCustomerPay(e) { changePayAction(payAction) {
uni.$emit(this.$globalFun.LET_CUSTOMER_PAY, e) this.payAction = payAction;
} },
} async changeOrderPrice(newPrice) {
} let res = await this.$request.changeOrderPrice({
</script> orderDetailId: this.data.orderDetailId,
changeMoney: newPrice,
<style scoped> type: this.payAction
.inline-input { });
flex-basis: 25%; if (res && res.code === 0) {
} this.resetPriceChangedInfo();
uni.showToast({
icon: 'success',
title: '修改成功',
duration: 1000
})
}
},
async makePayQrcode(e) {
let res = await this.$request.qrPay(this.data);
if (res && res.code === 0) {
this.showPayQrcodeModal = true;
this.$refs.payQrcode.showQrcode(res.data.expend.qrcode_url);
}
},
finishQrPay(e) {
this.showPayQrcodeModal = false;
this.resetPriceChangedInfo();
},
goFinishOrder() {
this.$emit('finishOrder', this.data);
}
}
}
</script>
<style scoped>
.inline-input {
flex-basis: 25%;
}
</style> </style>

View File

@ -174,8 +174,8 @@
</view> </view>
<view v-if="order.orderStatus === 3"> <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" @click="showServOrderDetail(order)">查看</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showNewServPriceOfflineModal" @tap="showModal($event, order)" v-show="order.orderDetailId != null && order.payStatus === 0">报价/完单</button> <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click = "changePrice($event, order)" data-ref="newServPriceOffline" data-modal="showNewServPriceOfflineModal" v-show="order.orderDetailId != null && order.payType === 1">报价/完单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showNewServPriceOnlineModal" @tap="showModal($event, order)" v-show="order.orderDetailId != null && order.payStatus === 1">报价/完单</button> <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click = "changePrice($event, order)" data-ref="newServPriceOnline" data-modal="showNewServPriceOnlineModal" v-show="order.orderDetailId != null && order.payType === 0">报价/完单</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" @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)" v-show="order.orderDetailId != null">重新排期</button> <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)" v-show="order.orderDetailId != null">重新排期</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="finishOrder(order)" v-if="order.payStatus === 1" v-show="order.orderDetailId != null">发起完单</button> <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="finishOrder(order)" v-if="order.payStatus === 1" v-show="order.orderDetailId != null">发起完单</button>
@ -246,8 +246,8 @@
<!-- 模态框 --> <!-- 模态框 -->
<time-arrange :show="showTimeArrangeModal" :data="curOrder" :curDate="curDate" @showArrangeFailTime="showArrangeFailTime" @editServTime="editServTime"></time-arrange> <time-arrange :show="showTimeArrangeModal" :data="curOrder" :curDate="curDate" @showArrangeFailTime="showArrangeFailTime" @editServTime="editServTime"></time-arrange>
<time-arrange-fail :show="showArrangeFailTimeModal" :data="curOrder"></time-arrange-fail> <time-arrange-fail :show="showArrangeFailTimeModal" :data="curOrder"></time-arrange-fail>
<new-serv-price-online :show="showNewServPriceOnlineModal" :data="curOrder"></new-serv-price-online> <new-serv-price-online ref="newServPriceOnline" :show="showNewServPriceOnlineModal" :data="curOrder" @finishOrder="finishOrder"></new-serv-price-online>
<new-serv-price-offline :show="showNewServPriceOfflineModal" :data="curOrder"></new-serv-price-offline> <new-serv-price-offline ref="newServPriceOffline" :show="showNewServPriceOfflineModal" :data="curOrder" @finishOrder="finishOrder"></new-serv-price-offline>
<pay-qrcode ref="payQrcode" :show="showPayQrcodeModal" :data="curOrder" @finishQrPay="finishQrPay"></pay-qrcode> <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> <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> <urgent-msg :show="sendUrgentMsgModal" @hideModal="hideModal"></urgent-msg>
@ -276,7 +276,7 @@
import editTimeArrange from '@/pages/order-manage/modal/edit-time-arrange.vue'; import editTimeArrange from '@/pages/order-manage/modal/edit-time-arrange.vue';
import dispatchOrder from '@/pages/order-manage/dispatch-order.vue'; import dispatchOrder from '@/pages/order-manage/dispatch-order.vue';
import newServPriceOnline from '@/pages/order-manage/modal/new-serv-price-online.vue'; import newServPriceOnline from '@/pages/order-manage/modal/new-serv-price-online.vue';
import newServPriceOffline from '@/pages/order-manage/modal/new-serv-price-online.vue'; import newServPriceOffline from '@/pages/order-manage/modal/new-serv-price-offline.vue';
import payQrcode from '@/pages/order-manage/modal/pay-qrcode.vue'; import payQrcode from '@/pages/order-manage/modal/pay-qrcode.vue';
import urgentMsg from '@/pages/order-manage/modal/urgent-msg.vue'; import urgentMsg from '@/pages/order-manage/modal/urgent-msg.vue';
import picModal from '@/components/modal/pic-modal.vue'; import picModal from '@/components/modal/pic-modal.vue';
@ -917,6 +917,19 @@
title: '拒绝接单失败' title: '拒绝接单失败'
}) })
} }
},
async getChangedPrice(order) {
let res = await this.$request.getChangeOrderPrice(order);
if (res && res.code === 0 && res.data) {
return res.data;
}
return null;
},
async changePrice(e, order) {
let priceObj = await this.getChangedPrice(order);
let refName = e.currentTarget.dataset.ref;
this.$refs[refName].init(priceObj);
this.showModal(e, order);
} }
} }
} }