新增申请附加费功能

This commit is contained in:
donqi 2024-01-02 23:19:06 +08:00
parent 2cf2c98e5d
commit 4f84c72707
3 changed files with 219 additions and 26 deletions

View File

@ -15,7 +15,7 @@ export default {
// request 触发前拼接 url // request 触发前拼接 url
args.url = 'https://www.opsoul.com:8881' + args.url; args.url = 'https://www.opsoul.com:8881' + 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.10.103:80' + args.url; // args.url = 'http://192.168.10.104:80' + args.url;
if (!args.data) { if (!args.data) {
args.data = {} args.data = {}
@ -797,5 +797,17 @@ export default {
data: params data: params
}) })
return res[1].data; 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;
},
} }

View File

@ -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>

View File

@ -569,8 +569,14 @@
</view> </view>
<view class="occupancy-bottom-bar"></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="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="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 class="cuIcon-list"></view> 订单管理
</view> </view>
<view class="action" data-modal="sendUrgentMsgModal" @click="showModal"> <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 class="cu-tag badge" v-if="servDetail.talkMsgNum > 0">{{servDetail.talkMsgNum}}</view>
</view> </view>
发送急报 发送急报
</view> --> </view>
<view class="action" data-popup="orderManage"> <view class="action" data-popup="orderManage">
</view> </view>
<view class="action" data-modal="sendUrgentMsgModal"> <view class="action" data-modal="sendUrgentMsgModal">
</view> </view>
<view v-if="servDetail.orderStatus === 2" class="bg-main-color submit" @click="workBegin">立即上门</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"> <uni-popup ref="orderManage" type="bottom" @change="changePopupState">
<view class="bg-white text-center"> <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}} {{menu.name}}
</view> </view>
</view> </view>
@ -596,17 +602,20 @@
</uni-popup> </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> </view>
</template> </template>
<script> <script>
import productPicked from '@/components/goods-card/product-picked.vue'; import productPicked from '@/components/goods-card/product-picked.vue';
import urgentMsg from '@/pages/order-manage/modal/urgent-msg.vue'; import urgentMsg from '@/pages/order-manage/modal/urgent-msg.vue';
import applyExtraCharge from '@/pages/order-manage/modal/apply-extra-charge.vue';
export default { export default {
components: { components: {
productPicked, productPicked,
urgentMsg urgentMsg,
applyExtraCharge
}, },
data() { data() {
return { return {
@ -619,33 +628,51 @@
servingValFields: ['standardName', 'standardNum', 'waitServerNum'], servingValFields: ['standardName', 'standardNum', 'waitServerNum'],
servedValFields: ['standardName', 'standardNum', 'serverNum'], servedValFields: ['standardName', 'standardNum', 'serverNum'],
ifShowPageMeta: false, ifShowPageMeta: false,
orderManageMenu: [{ orderManageMenu: [
name: '申请配件', // {
action: 'applyFittings' // name: '',
}, { // action: 'applyFittings'
// },
{
name: '申请附加费', name: '申请附加费',
action: '' action: 'applyExtraCharge',
}, { modal: 'applyExtraChargeModal'
name: '拍照回单', },
action: '' // {
}, { // name: '',
name: '指派/撤回订单', // action: ''
action: '' // },
}, { // {
name: '申请退单', // name: '/',
action: 'applyCancelOrder' // action: ''
}], // },
// {
// name: '退',
// action: 'applyCancelOrder'
// },
],
sendUrgentMsgModal: false, sendUrgentMsgModal: false,
overtimeRecords: null overtimeRecords: null,
applyExtraChargeModal: false
} }
}, },
onLoad(options) { onLoad(options) {
this.bindEvent();
if (options && options.order) { if (options && options.order) {
this.order = JSON.parse(decodeURIComponent(options.order)); this.order = JSON.parse(decodeURIComponent(options.order));
} }
this.loadData(); 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() { async loadData() {
let orderId = null; let orderId = null;
let funName = null; let funName = null;
@ -679,6 +706,10 @@
applyFittings() { applyFittings() {
console.log("申请配件") console.log("申请配件")
}, },
applyExtraCharge() {
console.log("申请charge")
this.applyExtraChargeModal = true;
},
applyCancelOrder() { applyCancelOrder() {
let params = { let params = {
orderInfo: this.servDetail.mainServOrder orderInfo: this.servDetail.mainServOrder