Commit 88f8b03e by 李伟康

Merge branch 'V4.56.0' of http://192.168.3.233:8090/glsx/gl_tape into V4.56.0

2 parents 0a947084 f5eb9af1
......@@ -20,7 +20,7 @@
"type" : "uniCloud"
},
{
"playground" : "custom",
"playground" : "standard",
"type" : "uni-app:app-android"
}
]
......
......@@ -15,6 +15,9 @@ export default {
computed: {
...mapState('audio', ['isEnd', 'isStart'])
},
globalData: {
userInfo: uni.getStorageSync('release_userInfo')
},
onLaunch: async function () {
this.onKeep()
this.setAPPVersion()
......
......@@ -15,11 +15,13 @@ import MessageBox from './components/MessageBox/index'
import wnCanvas from './components/Canvas/wn-canvas'
import UpdateBox from './components/UpdateBox'
import webView from './components/WebView'
import debounce from './utils/debounce.js'
Vue.use(webView)
Vue.component('GlsxImage', GlsxImage)
Vue.component('MessageBox', MessageBox)
Vue.component('wnCanvas', wnCanvas)
Vue.component('UpdateBox', UpdateBox)
Vue.directive('debounce', debounce)
Vue.config.productionTip = false
App.mpType = 'app'
// Vue.prototype.$ossDomain = config.OSS_DOMAIN
......
<!--工单信息卡片-->
<template>
<view class="order-card" @click="() => jumpClick(orderCardDetail.status == 3 ? 'ConfirmOrder' : orderCardDetail.status == 1 ? 'CreateOrder' : 'OrderDetail', orderCardDetail)">
<view class="order-card" v-debounce.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 @click.stop="showAllGoodsList">
<text v-debounce="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' : ''" @click.stop="changeType(1)">
<view class="modalbox com" :class="selectType == 1 ? 'act' : ''" v-debounce="[changeType, 1]">
<view class="sprite-icon icon-create-order"></view>
新增工单
</view>
<view class="modalbox cancle" :class="selectType == 2 ? 'act' : ''" @click.stop="changeType(2)">
<view class="modalbox cancle" :class="selectType == 2 ? 'act' : ''" v-debounce="[changeType, 2]">
<view class="sprite-icon icon-defeat-order"></view>
战败下单
</view>
<view v-if="isSettingExpiredTraffic && !isScan" class="modalbox cancle" :class="selectType == 3 ? 'act' : ''" @click.stop="changeType(3)">
<view v-if="isSettingExpiredTraffic && !isScan" class="modalbox cancle" :class="selectType == 3 ? 'act' : ''" v-debounce="[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' : ''" @click.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' : ''" v-debounce.stop="[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" @click.stop="cancelSelection">取消</view>
<view class="sure-btn btn" @click.stop="confirmSelection">确认</view>
<view class="cancle-btn btn" v-debounce.stop="cancelSelection">取消</view>
<view class="sure-btn btn" v-debounce.stop="confirmSelection">确认</view>
</view>
</template>
</PublishPopup>
......@@ -304,6 +304,9 @@ export default {
},
cancelSelection() {
this.$refs.recordOrderPopup.closePopup()
},
cardClick() {
this.jumpClick(this.orderCardDetail.status == 3 ? 'ConfirmOrder' : this.orderCardDetail.status == 1 ? 'CreateOrder' : 'OrderDetail', this.orderCardDetail)
}
}
}
......@@ -362,6 +365,7 @@ export default {
background-color: #fff;
position: absolute;
bottom: 0;
border-radius: 0 0 toRpx(32) toRpx(32);
.btn {
width: 40%;
height: toRpx(80);
......
......@@ -21,7 +21,7 @@
</view>
<view class="flex justify-between align-center">
<view class="date-box-value">{{ successDate }}</view>
<view class="handlerBtn" @click="openDate">编辑</view>
<view class="handlerBtn" v-debounce.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" @click="setCopyData(orderInfo[item.key])">
<view v-if="item.copy" class="copy-btn" v-debounce="[setCopyData, orderInfo[item.key]]">
<view class="sprite-icon icon-icon-copy copy"></view>
</view>
<view class="customize-btn" v-if="item.dateChange" @click.stop="customizeDate">自定义</view>
<view class="customize-btn" v-if="item.dateChange" v-debounce.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" @click="previewImage" v-for="(item, index) in orderInfo.payVoucherList" :key="index">
<view class="value" v-debounce.stop="previewImage" v-for="(item, index) in orderInfo.payVoucherList" :key="index">
<view class="image">
<!-- <image src="{{item.payVoucher}}" /> -->
</view>
......@@ -130,24 +130,26 @@
<view class="order-info pt-16">
<view class="flex align-center pt-16" v-for="(item, index) in customerObj" :key="index">
<view class="label">{{ item.label }}</view>
<view class="value" :style="{ color: item.color || '#333' }">
<view v-if="item.arr">
<view v-if="orderInfo[item.arr[1]]" class="flex">
<view v-for="(i, ind) in item.arr" :key="ind">
<view class="value-item text-hide">
<text v-if="ind == 1" class="lineText">|</text>
{{ orderInfo[i] }}
<view class="flex flex-1">
<view class="value" :style="{ color: item.color || '#333' }">
<view v-if="item.arr">
<view v-if="orderInfo[item.arr[1]]" class="flex">
<view v-for="(i, ind) in item.arr" :key="ind">
<view class="value-item text-hide">
<text v-if="ind == 1" class="lineText">|</text>
{{ orderInfo[i] }}
</view>
</view>
</view>
</view>
<view v-else>
{{ item.enum ? item.enum[orderInfo[item.key]] : orderInfo[item.key] || '' }}
</view>
</view>
<view v-else>
{{ item.enum ? item.enum[orderInfo[item.key]] : orderInfo[item.key] || '' }}
<view v-if="item.copy" class="copy-btn" v-debounce="[setCopyData, orderInfo[item.key]]">
<view class="sprite-icon icon-icon-copy copy"></view>
</view>
</view>
<view v-if="item.copy" class="copy-btn" @click="setCopyData(orderInfo[item.key])">
<view class="sprite-icon icon-icon-copy copy"></view>
</view>
</view>
</view>
<view v-if="orderInfo.selectPayType == 0">
......@@ -161,8 +163,8 @@
</view>
<view class="flex align-center footer-box justify-center">
<view class="edit btn" @click="edit">修改</view>
<view class="confirm btn" @click="confirm">确认</view>
<view class="edit btn" v-debounce.stop="edit">修改</view>
<view class="confirm btn" v-debounce.stop="confirm">确认</view>
</view>
</view>
<PublishPopup ref="tipsPopup" popupClass="tipsPopup" type="center" :showClose="true" :showTitle="false" @confirm="confirmTips">
......@@ -189,7 +191,7 @@
<view class="popup-top">
<view class="popup-top-box flex align-center">
<text class="popup-top-box-title">工单确认码</text>
<uni-icons @click="closePopup" class="icon-close" type="closeempty"></uni-icons>
<uni-icons v-debounce.stop="closePopup" class="icon-close" type="closeempty"></uni-icons>
</view>
</view>
</template>
......@@ -507,7 +509,10 @@ export default {
obj.outTradeNo = outTradeNo
}
console.log(obj)
uni.showLoading()
uni.showLoading({
title: '提交中...',
mask: true
})
// 状态更新 需刷新工单列表和预约管理列表
utils.refreshPageData()
uni.$api.boutiqueApi.createPayOrder(obj).then(data => {
......@@ -704,6 +709,9 @@ export default {
.py-16 {
padding: toRpx(16) 0;
}
.flex-1 {
flex: 1;
}
.date-box {
display: flex;
align-items: center;
......@@ -885,7 +893,6 @@ export default {
font-size: toRpx(26);
font-weight: 400;
white-space: wrap;
flex: 1;
}
}
}
......
......@@ -7,24 +7,19 @@
<GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @inputBlur="inputBlur" @handleCell="handleCell">
<!-- 使用v-for循环渲染产品组件,减少重复代码 -->
<template slot="frontGear">
<Product v-if="orderObj.frontGear" @changeTotalPrice="changeTotalPrice" :list="orderObj.frontGear" :positionTypeList="positionTypeList"
:baseConfigData="baseConfigData"></Product>
<Product v-if="orderObj.frontGear" @changeTotalPrice="changeTotalPrice" :list="orderObj.frontGear" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product>
</template>
<template slot="frontWindow">
<Product v-if="orderObj.frontWindow" @changeTotalPrice="changeTotalPrice" :list="orderObj.frontWindow" :positionTypeList="positionTypeList"
:baseConfigData="baseConfigData"></Product>
<Product v-if="orderObj.frontWindow" @changeTotalPrice="changeTotalPrice" :list="orderObj.frontWindow" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product>
</template>
<template slot="rearWindow">
<Product v-if="orderObj.rearWindow" @changeTotalPrice="changeTotalPrice" :list="orderObj.rearWindow" :positionTypeList="positionTypeList"
:baseConfigData="baseConfigData"></Product>
<Product v-if="orderObj.rearWindow" @changeTotalPrice="changeTotalPrice" :list="orderObj.rearWindow" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product>
</template>
<template slot="rearGear">
<Product v-if="orderObj.rearGear" @changeTotalPrice="changeTotalPrice" :list="orderObj.rearGear" :positionTypeList="positionTypeList"
:baseConfigData="baseConfigData"></Product>
<Product v-if="orderObj.rearGear" @changeTotalPrice="changeTotalPrice" :list="orderObj.rearGear" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product>
</template>
<template slot="sunRoof">
<Product v-if="orderObj.sunRoof" @changeTotalPrice="changeTotalPrice" :list="orderObj.sunRoof" :positionTypeList="positionTypeList"
:baseConfigData="baseConfigData"></Product>
<Product v-if="orderObj.sunRoof" @changeTotalPrice="changeTotalPrice" :list="orderObj.sunRoof" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product>
</template>
<template slot="package">
<Package v-if="orderObj.package" @changeTotalPrice="changeTotalPrice" :list="orderObj.package" :positionTypeList="positionTypeList"></Package>
......@@ -48,7 +43,7 @@
</template>
</GlCell>
</view>
<view @click="submit" class="btn">战败下单</view>
<view v-debounce.stop="submit" class="btn">战败下单</view>
</scroll-view>
</view>
<!-- 弹窗 -->
......@@ -206,6 +201,7 @@ export default {
console.log(options, 'options')
},
mounted() {
uni.$track.add({ eventCode: 'app_defeat_order' })
console.log('mounted', this.orderCreateType)
this.userInfo = uni.$storage.get('userInfo') || {}
this.baseConfigData = uni.$storage.get('mock_data') || {}
......@@ -382,6 +378,18 @@ export default {
}
}
if (this.orderObj.standNo) {
const vinRex = /[A-Z0-9]{17}$/
console.log(this.orderObj.standNo, vinRex.test(this.orderObj.standNo))
if (!vinRex.test(this.orderObj.standNo)) {
uni.showToast({
title: `请输入正确的VIN码`,
icon: 'none'
})
return false
}
}
// 处理onlyLabel为true的特殊校验
if (onlyLabelItem.length > 0) {
// 检查frontGear、frontWindow、rearGear、rearWindow、sunRoof和couponInfo字段中是否至少有一个不为空
......@@ -456,10 +464,14 @@ export default {
delete obj.customerName
delete obj.customerPhone
console.log(obj, 'rucan')
uni.showLoading({
title: '提交中...',
mask: true
})
const res = await uni.$api.boutiqueApi.notUpgradeOrder({ json: JSON.stringify(obj) })
console.log(res, '===submit')
if (res) {
uni.hideLoading()
uni.showToast({
title: '保存成功',
icon: 'success'
......
<template>
<view class="order-management">
<view class="search-box">
<input class="search-input" v-model="keyword" placeholder="输入客户姓名/商品名称/订单编号/手机号搜索" />
<input class="search-input" placeholder-class="placeholder" v-model="keyword" confirm-type="search" @confirm="handleSearch" placeholder="输入客户姓名/商品名称/订单编号/手机号搜索" />
<view class="clear flex" @click="clear">
<uni-icons type="closeempty" size="16" v-if="keyword"></uni-icons>
</view>
</view>
<view class="tab-container flex justify-between">
......@@ -223,6 +226,7 @@ export default {
}
},
mounted() {
uni.$track.add({ eventCode: 'app_order_management' })
this.localUserInfo = uni.$storage.get('userInfo') || {}
this.search()
this.startWaitOrderPolling()
......@@ -231,6 +235,10 @@ export default {
this.clearWaitOrderPolling()
},
methods: {
clear() {
this.keyword = ''
this.search()
},
search() {
// 判断是不是超管 && !this.localUserInfo.isSuper
// ,不是只能筛选当前4s店的
......@@ -530,6 +538,13 @@ export default {
background: linear-gradient(-44.4deg, #94c2ff00 0%, #5294ff 100%);
filter: blur(24px);
}
.clear {
position: absolute;
right: toRpx(18);
top: toRpx(10);
height: 100%;
padding: 0 48rpx;
}
.search-input {
text-align: center;
......@@ -537,10 +552,28 @@ export default {
border-radius: toRpx(40);
opacity: 1;
background: #f5f7fa;
.uni-input-placeholder {
color: #999ea8;
font-size: toRpx(28);
}
.placeholder {
height: 100%;
color: #999ea8;
font-family: uniicons;
display: flex;
align-items: center;
justify-content: center;
&::after {
display: block;
content: '\e654';
margin-left: 8rpx;
height: 100%;
display: flex;
align-items: center;
font-size: 36rpx;
}
}
}
}
......
......@@ -8,7 +8,7 @@
交易流水号
<text class="required">*</text>
</view>
<input v-model="outTradeNo" class="uni-input" maxlength="100" placeholder="请输入" />
<input v-model="outTradeNo" type="number" class="uni-input" maxlength="32" placeholder="请输入" />
</view>
<view class="payment">
<view class="payment-label">
......@@ -16,10 +16,10 @@
<text class="required">*</text>
</view>
<view class="upload-box flex flex-wrap">
<view class="upload-item" @click="selectImg"></view>
<view class="upload-item" v-debounce.stop="selectImg"></view>
<view v-for="(item, index) in payVoucherList" :key="index" class="previewImageList">
<image :src="item"></image>
<view class="close-box" @click="deleteImg(index)">
<view class="close-box" v-debounce="[deleteImg, index]">
<uni-icons class="icon-close" type="closeempty" color="#ffffff"></uni-icons>
</view>
</view>
......@@ -27,7 +27,7 @@
</view>
</view>
</view>
<view class="uploadBtn" @click="confirm">确定提交</view>
<view class="uploadBtn" v-debounce.stop="confirm">确定提交</view>
</view>
</template>
<script>
......@@ -95,8 +95,12 @@ export default {
})
obj.outTradeNo = this.outTradeNo
}
console.log(obj)
uni.showLoading({
title: '提交中...',
mask: true
})
uni.$api.boutiqueApi.createPayOrder(obj).then(data => {
uni.hideLoading()
uni.showToast({ title: '提交成功', icon: 'success' })
this.$emit('jump', 'OrderDetail', data)
})
......
<template>
<view class="detail-box">
<view class="nav-bar">
<view
class="back"
@click="backPage"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
<view class="back" @click="backPage">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">展业工具</view>
</view>
......@@ -17,46 +10,20 @@
<view class="detail-left">
<view class="common-title">展业</view>
<view class="content">
<image
class="banner"
src="../../../assets/images/common/tool_banner.png"
mode="scaleToFill"
/>
<image class="banner" src="../../../assets/images/common/tool_banner.png" mode="scaleToFill" />
<template v-if="toolComponentName !== 'DailyReport'">
<Entrance @entranceClick="entranceClick"></Entrance>
</template>
<template v-else>
<uni-calendar
ref="calendar"
:clearDate="false"
:endDate="endDate"
:showMonth="false"
@monthSwitch="currentMonth = `${$event.year}-${$event.month}`"
@change="currentDate = $event.fulldate"
backgroundColor="transparent"
:selected="selectedDays"
:date="currentDate"
/>
<uni-calendar ref="calendar" :clearDate="false" :endDate="endDate" :showMonth="false" @monthSwitch="currentMonth = `${$event.year}-${$event.month}`" @change="currentDate = $event.fulldate" backgroundColor="transparent" :selected="selectedDays" :date="currentDate" />
</template>
</view>
</view>
<view class="detail-right">
<component
:is="toolComponentName"
@jump="jump"
:transmission-of-data="transmissionOfData"
:currentDate="currentDate"
:currentMonth="currentMonth"
@setCalendarSelected="selectedDays = $event"
/>
<component :is="toolComponentName" @jump="jump" :transmission-of-data="transmissionOfData" :currentDate="currentDate" :currentMonth="currentMonth" @setCalendarSelected="selectedDays = $event" />
</view>
</view>
<NoticePopup
ref="notice"
title="重要提示"
text="当前页面暂未保存,是否确认退出"
type="warning"
></NoticePopup>
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
</view>
</template>
......@@ -86,7 +53,7 @@ export default {
UploadProofOfPayment,
OrderDetail
},
data () {
data() {
return {
toolComponentName: '',
transmissionOfData: null,
......@@ -96,7 +63,7 @@ export default {
selectedDays: []
}
},
onLoad (options) {
onLoad(options) {
if (options.componentName) this.toolComponentName = options.componentName
if (options.currentDate) this.currentDate = options.currentDate
uni.$on('jumpToDailyReport', currentDate => {
......@@ -105,7 +72,7 @@ export default {
})
},
methods: {
async entranceClick (item) {
async entranceClick(item) {
console.log(item)
if (item.name != 'DailyReport' && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
// 保存当前选择的组件信息,但不立即切换
......@@ -145,11 +112,11 @@ export default {
// 打开弹窗
this.$refs.notice.open()
},
backPage () {
backPage() {
uni.navigateBack()
},
// name:跳转组件名,val:跳转参数
jump (name, val) {
jump(name, val) {
this.toolComponentName = name
console.log(this.toolComponentName, val)
if (val) {
......
// utils/debounce.js
const debounce = {
bind(el, binding) {
// 支持函数、数组[函数, 参数...]或对象{fn: 函数, params: 参数数组, delay: 延迟时间}格式
if (typeof binding.value !== 'function' && !Array.isArray(binding.value) && (!binding.value || typeof binding.value !== 'object')) {
console.warn('v-debounce binding value must be a function, array or object')
return
}
// 解析参数
let fn,
params = [],
delay = 300
const stopPropagation = binding.modifiers && binding.modifiers.stop
if (typeof binding.value === 'function') {
fn = binding.value
} else if (Array.isArray(binding.value)) {
;[fn, ...params] = binding.value
} else if (typeof binding.value === 'object') {
fn = binding.value.fn
params = binding.value.params || []
delay = binding.value.delay || delay
}
// 如果没有提供函数,直接返回
if (typeof fn !== 'function') {
console.warn('v-debounce: function is required')
return
}
// 获取延迟时间
if (binding.arg) {
delay = parseInt(binding.arg) || delay
}
let timer = null
const debounceFn = function (event) {
// 处理.stop修饰符
if (stopPropagation && event && typeof event.stopPropagation === 'function') {
event.stopPropagation()
}
if (timer) {
clearTimeout(timer)
}
// 收集事件参数
const eventArgs = arguments.length ? Array.from(arguments) : []
timer = setTimeout(() => {
// 合并预设参数和事件参数
const allParams = [...params, ...eventArgs]
fn.apply(this, allParams)
timer = null
}, delay)
}
el._debounceFn = debounceFn
el.addEventListener('click', debounceFn)
},
update(el, binding) {
// 当绑定值发生变化时重新绑定
if (binding.value !== binding.oldValue) {
// 移除旧的事件监听
if (el._debounceFn) {
el.removeEventListener('click', el._debounceFn)
el._debounceFn = null
}
// 重新绑定,逻辑与bind相同
if (typeof binding.value !== 'function' && !Array.isArray(binding.value) && (!binding.value || typeof binding.value !== 'object')) {
console.warn('v-debounce binding value must be a function, array or object')
return
}
let fn,
params = [],
delay = 300
const stopPropagation = binding.modifiers && binding.modifiers.stop
if (typeof binding.value === 'function') {
fn = binding.value
} else if (Array.isArray(binding.value)) {
;[fn, ...params] = binding.value
} else if (typeof binding.value === 'object') {
fn = binding.value.fn
params = binding.value.params || []
delay = binding.value.delay || delay
}
if (typeof fn !== 'function') {
console.warn('v-debounce: function is required')
return
}
if (binding.arg) {
delay = parseInt(binding.arg) || delay
}
let timer = null
const debounceFn = function (event) {
if (stopPropagation && event && typeof event.stopPropagation === 'function') {
event.stopPropagation()
}
if (timer) {
clearTimeout(timer)
}
const eventArgs = arguments.length ? Array.from(arguments) : []
timer = setTimeout(() => {
const allParams = [...params, ...eventArgs]
fn.apply(this, allParams)
timer = null
}, delay)
}
el._debounceFn = debounceFn
el.addEventListener('click', debounceFn)
}
},
unbind(el) {
if (el._debounceFn) {
el.removeEventListener('click', el._debounceFn)
el._debounceFn = null
}
}
}
export default debounce
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!