Commit 9a15ee9d by cen

fix: 修复防抖点击

1 parent 6c1503be
<!--工单信息卡片-->
<template>
<view class="order-card" v-debounce.stop="cardClick">
<view class="order-card" @click.stop="cardClick">
<view class="order-card-top-box flex justify-between">
<text>{{ orderCardDetail.customer.customerName }}</text>
<view class="status text-center" :style="{ color: orderCardDetail.statuscolor, 'background-color': orderCardDetail.statusbackground }">
......@@ -32,7 +32,7 @@
</view>
<view v-if="orderCardDetail.subOrderList.length > 2" class="goods-more">
<text v-debounce="showAllGoodsList">
<text @click="showAllGoodsList">
{{ orderCardDetail.showAllGoodsListFlag ? '收起' : '查看全部' }}
</text>
(共{{ orderCardDetail.subOrderList.length }}件)
......@@ -91,19 +91,19 @@
<PublishPopup ref="recordOrderPopup" popupClass="recordOrderPopup" type="center" :showClose="true" title="请选择录单入口">
<template #content>
<view class="modatcontent">
<view class="modalbox com" :class="selectType == 1 ? 'act' : ''" v-debounce="[changeType, 1]">
<view class="modalbox com" :class="selectType == 1 ? 'act' : ''" @click="changeType(1)">
<view class="sprite-icon icon-create-order"></view>
新增工单
</view>
<view class="modalbox cancle" :class="selectType == 2 ? 'act' : ''" v-debounce="[changeType, 2]">
<view class="modalbox cancle" :class="selectType == 2 ? 'act' : ''" @click="changeType(2)">
<view class="sprite-icon icon-defeat-order"></view>
战败下单
</view>
<view v-if="isSettingExpiredTraffic && !isScan" class="modalbox cancle" :class="selectType == 3 ? 'act' : ''" v-debounce="[changeType, 3]">
<view v-if="isSettingExpiredTraffic && !isScan" class="modalbox cancle" :class="selectType == 3 ? 'act' : ''" @click="changeType(3)">
<view class="sprite-icon icon-expiration"></view>
失效客户
</view>
<view class="modalbox cancle" v-if="orderCardDetail.constructionFlag !== 'Y' && orderCardDetail.selectPayType !== 1 && orderCardDetail.selectPayType !== 3 && orderCardDetail.selectPayType !== 4 && orderCardDetail.status !== 9" :class="selectType == 4 ? 'act' : ''" v-debounce.stop="[changeType, 4]">
<view class="modalbox cancle" v-if="orderCardDetail.constructionFlag !== 'Y' && orderCardDetail.selectPayType !== 1 && orderCardDetail.selectPayType !== 3 && orderCardDetail.selectPayType !== 4 && orderCardDetail.status !== 9" :class="selectType == 4 ? 'act' : ''" @click="changeType(4)">
<view class="sprite-icon icon-revoke"></view>
撤销工单
</view>
......@@ -111,8 +111,8 @@
</template>
<template #footer>
<view class="footer-box flex justify-center">
<view class="cancle-btn btn" v-debounce.stop="cancelSelection">取消</view>
<view class="sure-btn btn" v-debounce.stop="confirmSelection">确认</view>
<view class="cancle-btn btn" @click.stop="cancelSelection">取消</view>
<view class="sure-btn btn" @click.stop="confirmSelection">确认</view>
</view>
</template>
</PublishPopup>
......@@ -124,6 +124,7 @@ import { interceptionMixin } from '@/mixin/index'
import utils from '@/utils/utils'
import { checkDailyReport, showNextModal } from '@/utils/modalUtils'
import PublishPopup from '@/components/PublishPopup.vue'
import { debounce } from 'lodash'
export default {
mixins: [interceptionMixin],
name: 'OrderCard',
......@@ -197,12 +198,12 @@ export default {
},
methods: {
// 查看全部商品
showAllGoodsList(e) {
showAllGoodsList: debounce(function (e) {
this.$emit('toggle-goods-list', {
item: this.orderCardDetail,
flag: !this.orderCardDetail.showAllGoodsListFlag
})
},
}, 300),
async jumpClick(name, item) {
// 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 ,9 已撤销 , 10 已关闭 , 11 已失效
// constructionFlag 施工标识(Y:已施工;N||null:未施工)
......@@ -275,10 +276,10 @@ export default {
})
}
},
changeType(type) {
changeType: debounce(function (type) {
this.selectType = type
},
async confirmSelection() {
}, 300),
confirmSelection: debounce(async function () {
this.$refs.recordOrderPopup.closePopup()
console.log('this.selectType', this.selectType)
if (this.selectType == 1) {
......@@ -301,13 +302,13 @@ export default {
this.$emit('refresh')
})
}
},
}, 300),
cancelSelection() {
this.$refs.recordOrderPopup.closePopup()
},
cardClick() {
cardClick: debounce(function () {
this.jumpClick(this.orderCardDetail.status == 3 ? 'ConfirmOrder' : this.orderCardDetail.status == 1 ? 'CreateOrder' : 'OrderDetail', this.orderCardDetail)
}
}, 300)
}
}
</script>
......
......@@ -21,7 +21,7 @@
</view>
<view class="flex justify-between align-center">
<view class="date-box-value">{{ successDate }}</view>
<view class="handlerBtn" v-debounce.stop="openDate">编辑</view>
<view class="handlerBtn" @click.stop="openDate">编辑</view>
</view>
</view>
<!-- 商品信息 -->
......@@ -95,17 +95,17 @@
<view v-else>{{ orderInfo[item.key] || '' }}</view>
</view>
</view>
<view v-if="item.copy" class="copy-btn" v-debounce="[setCopyData, orderInfo[item.key]]">
<view v-if="item.copy" class="copy-btn" @click="setCopyData(orderInfo[item.key])">
<view class="sprite-icon icon-icon-copy copy"></view>
</view>
<view class="customize-btn" v-if="item.dateChange" v-debounce.stop="customizeDate">自定义</view>
<view class="customize-btn" v-if="item.dateChange" @click.stop="customizeDate">自定义</view>
</view>
<view v-if="(orderInfo.selectPayType == 2 || orderInfo.selectPayType == 5 || orderInfo.selectPayType == 6 || orderInfo.selectPayType == 7) && orderInfo.payVoucherList.length">
<view class="flex align-center pt-8">
<view class="label">付款凭证</view>
<view class="image-box">
<view class="value" v-debounce.stop="previewImage" v-for="(item, index) in orderInfo.payVoucherList" :key="index">
<view class="value" @click.stop="previewImage" v-for="(item, index) in orderInfo.payVoucherList" :key="index">
<view class="image">
<!-- <image src="{{item.payVoucher}}" /> -->
</view>
......@@ -146,7 +146,7 @@
{{ item.enum ? item.enum[orderInfo[item.key]] : orderInfo[item.key] || '' }}
</view>
</view>
<view v-if="item.copy" class="copy-btn" v-debounce="[setCopyData, orderInfo[item.key]]">
<view v-if="item.copy" class="copy-btn" @click="setCopyData(orderInfo[item.key])">
<view class="sprite-icon icon-icon-copy copy"></view>
</view>
</view>
......@@ -163,8 +163,8 @@
</view>
<view class="flex align-center footer-box justify-center">
<view class="edit btn" v-debounce.stop="edit">修改</view>
<view class="confirm btn" v-debounce.stop="confirm">确认</view>
<view class="edit btn" @click.stop="edit">修改</view>
<view class="confirm btn" @click.stop="confirm">确认</view>
</view>
</view>
<PublishPopup ref="tipsPopup" popupClass="tipsPopup" type="center" :showClose="true" :showTitle="false" @confirm="confirmTips">
......@@ -191,7 +191,7 @@
<view class="popup-top">
<view class="popup-top-box flex align-center">
<text class="popup-top-box-title">工单确认码</text>
<uni-icons v-debounce.stop="closePopup" class="icon-close" type="closeempty"></uni-icons>
<uni-icons @click.stop="closePopup" class="icon-close" type="closeempty"></uni-icons>
</view>
</view>
</template>
......@@ -213,6 +213,7 @@ import order_mixins from '../../order_mixins.js'
import dayjs from 'dayjs'
import PublishPopup from '@/components/PublishPopup.vue'
import OrderPopup from '@/components/OrderPopup/index.vue'
import { debounce } from 'lodash'
export default {
name: 'OrderConfirm',
props: {
......
......@@ -43,7 +43,7 @@
</template>
</GlCell>
</view>
<view v-debounce.stop="submit" class="btn">战败下单</view>
<view @click.stop="submit" class="btn">战败下单</view>
</scroll-view>
</view>
<!-- 弹窗 -->
......@@ -61,6 +61,7 @@ import Package from './Package.vue'
import SkuGoods from './SkuGoods.vue'
import { checkDailyReport, showNextModal } from '@/utils/modalUtils'
import { DEFEAT_FORM_LIST, popupTypeEnum, payTypeList } from '../contant'
import { debounce } from 'lodash'
export default {
name: 'DefeatOrder',
components: {
......@@ -413,7 +414,7 @@ export default {
},
// 提交
async submit() {
submit: debounce(async function () {
// 校验是否填写昨日日报
let staffCheck = await checkDailyReport()
if (staffCheck) return false
......@@ -478,7 +479,7 @@ export default {
})
this.$emit('jump', 'OrderManagement')
}
},
}, 300),
// 计算所有产品的总价
changeTotalPrice() {
let total = 0
......
<template>
<view class="order-detail">
<view class="common-title">{{ orderInfo.constructionFlag == 'Y' && orderInfo.status != 10 ? '完成施工' : '工单详情' }}</view>
<view class="px-48 scroll-y" :class="{ 'construction-flag-y': orderInfo && orderInfo.constructionFlag !== 'Y' && !isMake }" v-if="orderInfo">
<view v-if="isShow" class="px-48 scroll-y" :class="{ 'construction-flag-y': orderInfo && orderInfo.constructionFlag !== 'Y' && !isMake }">
<view class="top-tips flex align-center" v-if="orderInfo.status != 10 && orderInfo.status != 9 && orderInfo.constructionFlag !== 'Y'">
<uni-icons class="checkbox-filled" type="checkbox-filled" color="#4ac18e"></uni-icons>
<view>
......@@ -294,7 +294,8 @@ export default {
warrantyCardList: [],
isMake: true,
selectDate: null,
warrantyEditObj: {}
warrantyEditObj: {},
isShow: false
}
},
async mounted() {},
......@@ -308,6 +309,11 @@ export default {
return res
},
async getDetail(orderCode) {
this.isShow = false
uni.showLoading({
title: '加载中...',
mask: true
})
const userInfo = uni.$storage.get('userInfo')
const positionTypeList = (await this.getPositionList()) || []
let _this = this
......@@ -396,6 +402,8 @@ export default {
if (data.customer && data.customer.carSeriesName) {
data.carType = `${data.customer.carBrand || ''}-${data.customer.carChildsBrandName || ''}-${data.customer.carSeriesName || ''}`
}
this.isShow = true
uni.hideLoading()
this.orderInfo = data
console.log(this.orderInfo, 'this.orderInfo')
console.log(this.orderInfo.selectPayType, this.orderInfo.constructionFlag)
......@@ -444,6 +452,10 @@ export default {
// })
// }
})
.catch(error => {
console.log(error)
uni.hideLoading()
})
},
getServiceBaseInfo(merchantId) {
uni.$api.boutiqueApi
......@@ -598,6 +610,9 @@ export default {
confirmCalendar() {
this.rangeSelect(this.selectDate)
},
setCopyData(e) {
utils.setCopyData(`${e}`)
},
// 修改订单时间
rangeSelect(date) {
let { orderInfo } = this
......
......@@ -16,10 +16,10 @@
<text class="required">*</text>
</view>
<view class="upload-box flex flex-wrap">
<view class="upload-item" v-debounce.stop="selectImg"></view>
<view class="upload-item" @click.stop="selectImg"></view>
<view v-for="(item, index) in payVoucherList" :key="index" class="previewImageList">
<image :src="item"></image>
<view class="close-box" v-debounce="[deleteImg, index]">
<view class="close-box" @click="deleteImg(index)">
<uni-icons class="icon-close" type="closeempty" color="#ffffff"></uni-icons>
</view>
</view>
......@@ -27,11 +27,12 @@
</view>
</view>
</view>
<view class="uploadBtn" v-debounce.stop="confirm">确定提交</view>
<view class="uploadBtn" @click.stop="confirm">确定提交</view>
</view>
</template>
<script>
import { uploadFile } from '@/utils/ossUploadFile/uploadFile.js'
import { debounce } from 'lodash'
export default {
name: 'UploadProofOfPayment',
props: {
......@@ -70,7 +71,7 @@ export default {
let url = await uploadFile(tempFilePaths[0])
this.payVoucherList.push(url)
},
confirm(e) {
confirm: debounce(function (e) {
console.log(this.transmissionOfData)
let { outTradeNo, payVoucherList } = this
if (payVoucherList.length && outTradeNo) {
......@@ -78,7 +79,7 @@ export default {
} else {
uni.showToast({ title: '交易流水号或付款凭证不能为空!', icon: 'none' })
}
},
}, 300),
deleteImg(index) {
this.payVoucherList.splice(index, 1)
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!