新增申请附加费功能
This commit is contained in:
parent
2cf2c98e5d
commit
4f84c72707
|
|
@ -15,7 +15,7 @@ export default {
|
|||
// request 触发前拼接 url
|
||||
args.url = 'https://www.opsoul.com:8881' + args.url;
|
||||
// args.url = 'http://127.0.0.1:80' + args.url;
|
||||
// args.url = 'http://192.168.10.103:80' + args.url;
|
||||
// args.url = 'http://192.168.10.104:80' + args.url;
|
||||
|
||||
if (!args.data) {
|
||||
args.data = {}
|
||||
|
|
@ -797,5 +797,17 @@ export default {
|
|||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
}
|
||||
},
|
||||
|
||||
async addOrderAttach(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/order/attach/appAdd',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,150 @@
|
|||
<template>
|
||||
<view class="cu-modal" :class="show?'show':''">
|
||||
<view class="cu-dialog">
|
||||
<view class="cu-bar bg-white justify-end solid-bottom">
|
||||
<view class="content">附加费用申请</view>
|
||||
<view class="action" data-modal="applyExtraChargeModal" @click="hideModal">
|
||||
<text class="cuIcon-close text-red"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white padding text-left">
|
||||
<view class="text-lg padding-top flex justify-start align-center">
|
||||
<text>金额:</text>
|
||||
<input type="digit" class="radius-input inline-input" v-model="moneyAmount"></input>
|
||||
</view>
|
||||
<view class="text-lg padding-top flex justify-start align-center">
|
||||
<text>原因:</text>
|
||||
<input type="text" class="radius-input inline-input" v-model="reason" disabled value="配件费"></input>
|
||||
</view>
|
||||
<view>
|
||||
<view class="padding-tb-sm">上传图片</view>
|
||||
<view class="grid col-3 grid-square">
|
||||
<view class="bg-img" v-for="(item,index) in imgList" :key="index"
|
||||
@tap="viewImage($event, imgList)" :data-url="item">
|
||||
<image :src="item" mode="aspectFill"></image>
|
||||
<view class="cu-tag bg-red" @tap.stop="delImg($event, imgList)" :data-index="index">
|
||||
<text class='cuIcon-close'></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="solids" @tap="chooseImage" v-if="imgList.length < 1">
|
||||
<text class='cuIcon-cameraadd'></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="padding-tb-sm">申请原因</view>
|
||||
<view class="solid">
|
||||
<textarea style="width: 100%; height: 200rpx;" fixed="true" class="radius text-left padding-sm"
|
||||
v-model="remark" maxlength="-1"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-bar bg-white solid-top">
|
||||
<view class="action margin-0 flex-sub text-black" data-modal="applyExtraChargeModal"
|
||||
@click="hideModal">取消</view>
|
||||
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="applyExtraChargeModal"
|
||||
@click="submit">确认</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'applyExtraCharge',
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imgList: [],
|
||||
moneyAmount: '',
|
||||
reason: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hideModal(e) {
|
||||
uni.$emit(this.$globalFun.HIDE_MODAL, e);
|
||||
},
|
||||
chooseImage(e) {
|
||||
uni.chooseMedia({
|
||||
count: 1, //默认9
|
||||
mediaType: ['image'],
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let tempFilePaths = [];
|
||||
res.tempFiles.forEach((fileObj) => {
|
||||
tempFilePaths.push(fileObj.tempFilePath)
|
||||
})
|
||||
if (this.imgList.length != 0) {
|
||||
this.imgList = this.imgList.concat(tempFilePaths)
|
||||
} else {
|
||||
this.imgList = tempFilePaths
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
viewImage(e, imgList) {
|
||||
uni.previewImage({
|
||||
urls: imgList,
|
||||
current: e.currentTarget.dataset.url
|
||||
});
|
||||
},
|
||||
delImg(e, imgList) {
|
||||
uni.showModal({
|
||||
title: '',
|
||||
content: '确定要删除这张图片吗?',
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
imgList.splice(e.currentTarget.dataset.index, 1)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async submit(e) {
|
||||
if (!this.moneyAmount) {
|
||||
uni.showToast({
|
||||
title: '请输入金额',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 调用后端接口,添加附加费
|
||||
let res = await this.$request.addOrderAttach({
|
||||
orderDetailId: this.data.orderDetailId,
|
||||
attachMoney: this.moneyAmount,
|
||||
type: '01'
|
||||
});
|
||||
if (res.code === 0) {
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'success'
|
||||
});
|
||||
this.hideModal(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.grid.col-3.grid-square>view {
|
||||
padding-bottom: calc((100% - 40rpx)/3);
|
||||
height: 0;
|
||||
width: calc((100% - 40rpx)/3);
|
||||
}
|
||||
|
||||
.inline-input {
|
||||
flex-basis: 75%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -569,8 +569,14 @@
|
|||
</view>
|
||||
<view class="occupancy-bottom-bar"></view>
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="cu-bar bg-white tabbar border fixed-bottom-bar" v-if="servDetail.orderDetailId != null && servDetail.orderStatus === 2">
|
||||
<!-- <view class="action" data-popup="orderManage" @click="togglePopup">
|
||||
<view class="cu-bar bg-white tabbar border fixed-bottom-bar" v-if="servDetail.orderDetailId != null && servDetail.orderStatus > 0 && servDetail.orderStatus != 6">
|
||||
<view class="action" data-popup="orderManage" @click="togglePopup">
|
||||
<view class="cuIcon-list"></view> 订单管理
|
||||
</view>
|
||||
<view v-if="servDetail.orderDetailId != null && servDetail.orderStatus === 2" class="bg-main-color submit" @click="workBegin">立即上门</view>
|
||||
</view>
|
||||
<!-- <view class="cu-bar bg-white tabbar border fixed-bottom-bar" v-if="servDetail.orderDetailId != null && servDetail.orderStatus === 2">
|
||||
<view class="action" data-popup="orderManage" @click="togglePopup">
|
||||
<view class="cuIcon-list"></view> 订单管理
|
||||
</view>
|
||||
<view class="action" data-modal="sendUrgentMsgModal" @click="showModal">
|
||||
|
|
@ -578,16 +584,16 @@
|
|||
<view class="cu-tag badge" v-if="servDetail.talkMsgNum > 0">{{servDetail.talkMsgNum}}</view>
|
||||
</view>
|
||||
发送急报
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="action" data-popup="orderManage">
|
||||
</view>
|
||||
<view class="action" data-modal="sendUrgentMsgModal">
|
||||
</view>
|
||||
<view v-if="servDetail.orderStatus === 2" class="bg-main-color submit" @click="workBegin">立即上门</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<uni-popup ref="orderManage" type="bottom" @change="changePopupState">
|
||||
<view class="bg-white text-center">
|
||||
<view v-for="(menu,index) in orderManageMenu" class="padding solid-bottom" :data-action="menu.action" @click="clickOrderManageMenu">
|
||||
<view v-for="(menu,index) in orderManageMenu" class="padding solid-bottom" :data-action="menu.action" :data-modal="menu.modal" @click="clickOrderManageMenu">
|
||||
{{menu.name}}
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -595,18 +601,21 @@
|
|||
<view class="cu-bar bg-white fixed-bottom-bar"></view>
|
||||
</uni-popup>
|
||||
<!-- 模态框 -->
|
||||
<urgent-msg :show="sendUrgentMsgModal" @hideModal="hideModal"></urgent-msg>
|
||||
<urgent-msg :show="sendUrgentMsgModal" @hideModal="hideModal"></urgent-msg>
|
||||
<apply-extra-charge v-if="applyExtraChargeModal" :show="applyExtraChargeModal" :data="servDetail"></apply-extra-charge>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import productPicked from '@/components/goods-card/product-picked.vue';
|
||||
import urgentMsg from '@/pages/order-manage/modal/urgent-msg.vue';
|
||||
import applyExtraCharge from '@/pages/order-manage/modal/apply-extra-charge.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
productPicked,
|
||||
urgentMsg
|
||||
urgentMsg,
|
||||
applyExtraCharge
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -619,33 +628,51 @@
|
|||
servingValFields: ['standardName', 'standardNum', 'waitServerNum'],
|
||||
servedValFields: ['standardName', 'standardNum', 'serverNum'],
|
||||
ifShowPageMeta: false,
|
||||
orderManageMenu: [{
|
||||
name: '申请配件',
|
||||
action: 'applyFittings'
|
||||
}, {
|
||||
orderManageMenu: [
|
||||
// {
|
||||
// name: '申请配件',
|
||||
// action: 'applyFittings'
|
||||
// },
|
||||
{
|
||||
name: '申请附加费',
|
||||
action: ''
|
||||
}, {
|
||||
name: '拍照回单',
|
||||
action: ''
|
||||
}, {
|
||||
name: '指派/撤回订单',
|
||||
action: ''
|
||||
}, {
|
||||
name: '申请退单',
|
||||
action: 'applyCancelOrder'
|
||||
}],
|
||||
action: 'applyExtraCharge',
|
||||
modal: 'applyExtraChargeModal'
|
||||
},
|
||||
// {
|
||||
// name: '拍照回单',
|
||||
// action: ''
|
||||
// },
|
||||
// {
|
||||
// name: '指派/撤回订单',
|
||||
// action: ''
|
||||
// },
|
||||
// {
|
||||
// name: '申请退单',
|
||||
// action: 'applyCancelOrder'
|
||||
// },
|
||||
],
|
||||
sendUrgentMsgModal: false,
|
||||
overtimeRecords: null
|
||||
overtimeRecords: null,
|
||||
applyExtraChargeModal: false
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.bindEvent();
|
||||
if (options && options.order) {
|
||||
this.order = JSON.parse(decodeURIComponent(options.order));
|
||||
}
|
||||
this.loadData();
|
||||
},
|
||||
onUnload() {
|
||||
this.offBindEvent();
|
||||
},
|
||||
methods: {
|
||||
methods: {
|
||||
bindEvent() {
|
||||
uni.$on(this.$globalFun.HIDE_MODAL, this.hideModal);
|
||||
},
|
||||
offBindEvent() {
|
||||
uni.$off(this.$globalFun.HIDE_MODAL);
|
||||
},
|
||||
async loadData() {
|
||||
let orderId = null;
|
||||
let funName = null;
|
||||
|
|
@ -679,6 +706,10 @@
|
|||
applyFittings() {
|
||||
console.log("申请配件")
|
||||
},
|
||||
applyExtraCharge() {
|
||||
console.log("申请charge")
|
||||
this.applyExtraChargeModal = true;
|
||||
},
|
||||
applyCancelOrder() {
|
||||
let params = {
|
||||
orderInfo: this.servDetail.mainServOrder
|
||||
|
|
|
|||
Loading…
Reference in New Issue