Commit 8410202b by 李伟康

refactor(boutique): 重构展业工具页面结构并优化组件交互

- 调整页面布局格式化,提升代码可读性
- 优化导航栏返回按钮结构
- 重构日历组件集成方式
- 改进组件切换逻辑,支持页面重定向
- 完善异常订单弹窗展示
- 优化数据处理流程和错误处理机制
- 添加员工列表多选功能支持
- 增强表单验证和禁用状态控制
- 改进表格组件宽度计算逻辑
- 优化数据过滤算法,支持品牌和场景代码筛选
- 添加数值格式化处理功能
- 实现动态表单渲染功能
1 parent d0694349
<template> <template>
<view class="detail-box"> <view class="detail-box">
<view class="nav-bar"> <view class="nav-bar">
<view class="back" @click="backPage"> <view
<uni-icons type="left" :size="20" color="#000"></uni-icons> class="back"
@click="backPage"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view> </view>
<view class="title">展业工具</view> <view class="title">展业工具</view>
</view> </view>
...@@ -10,37 +17,92 @@ ...@@ -10,37 +17,92 @@
<view class="detail-left"> <view class="detail-left">
<view class="common-title">展业</view> <view class="common-title">展业</view>
<view class="content"> <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'"> <template v-if="toolComponentName === 'DailyReport'">
<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> </template>
<template v-else-if="toolComponentName === 'WageAppeal'"> <template v-else-if="toolComponentName === 'WageAppeal'">
<MonthCalendar @confirm="confirmMonth"></MonthCalendar> <MonthCalendar @confirm="confirmMonth"></MonthCalendar>
</template> </template>
<template v-else> <template v-else>
<Entrance @entranceClick="entranceClick" :type="1"></Entrance> <Entrance
@entranceClick="entranceClick"
:type="1"
></Entrance>
</template> </template>
</view> </view>
</view> </view>
<view class="detail-right"> <view class="detail-right">
<component :is="toolComponentName" @jump="jump" :transmission-of-data="transmissionOfData" :currentDate="currentDate" :currentMonth="currentMonth" :lastMonth="lastMonth" @setCalendarSelected="selectedDays = $event" :enterType="enterType" /> <component
:is="toolComponentName"
@jump="jump"
:transmission-of-data="transmissionOfData"
:currentDate="currentDate"
:currentMonth="currentMonth"
:lastMonth="lastMonth"
@setCalendarSelected="selectedDays = $event"
:enterType="enterType"
/>
</view> </view>
</view> </view>
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup> <NoticePopup
ref="notice"
title="重要提示"
text="当前页面暂未保存,是否确认退出"
type="warning"
></NoticePopup>
<!-- 学习中心权限弹窗 --> <!-- 学习中心权限弹窗 -->
<StudyPopup :show.sync="showStudyPermissionPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden"> <StudyPopup
<StudyCenterPermissionPopup :lockReason="lockReason" @confirm="handleStudyPermissionConfirm" /> :show.sync="showStudyPermissionPopup"
title=""
:width="848"
:height="870"
:topImage="require('@/assets/images/common/warning-notice.png')"
:topImageWidth="848"
:topImageHeight="248"
style="overflow: hidden"
>
<StudyCenterPermissionPopup
:lockReason="lockReason"
@confirm="handleStudyPermissionConfirm"
/>
</StudyPopup> </StudyPopup>
<!-- 异常订单锁单弹窗,样式与车险工具页保持一致 --> <!-- 异常订单锁单弹窗,样式与车险工具页保持一致 -->
<ErrorOrderPopup :show.sync="showErrorOrderPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden"> <ErrorOrderPopup
:show.sync="showErrorOrderPopup"
title=""
:width="848"
:height="870"
:topImage="require('@/assets/images/common/warning-notice.png')"
:topImageWidth="848"
:topImageHeight="248"
style="overflow: hidden"
>
<view> <view>
<view class="error-order-title">异常订单提醒</view> <view class="error-order-title">异常订单提醒</view>
<view class="error-order-content">存在{{ abnormalOrderCount }} 条异常订单未处理,请尽快处理!</view> <view class="error-order-content">存在{{ abnormalOrderCount }} 条异常订单未处理,请尽快处理!</view>
</view> </view>
<template #footer> <template #footer>
<view class="flex justify-between error-order-footer"> <view class="flex justify-between error-order-footer">
<view class="footer-btn sure flex-1" @click="showErrorOrderPopup = false">好的</view> <view
class="footer-btn sure flex-1"
@click="showErrorOrderPopup = false"
>好的</view>
</view> </view>
</template> </template>
</ErrorOrderPopup> </ErrorOrderPopup>
...@@ -83,7 +145,7 @@ export default { ...@@ -83,7 +145,7 @@ export default {
MonthCalendar, MonthCalendar,
ErrorOrderPopup ErrorOrderPopup
}, },
data() { data () {
return { return {
toolComponentName: '', toolComponentName: '',
transmissionOfData: null, transmissionOfData: null,
...@@ -100,7 +162,7 @@ export default { ...@@ -100,7 +162,7 @@ export default {
enterType: '' enterType: ''
} }
}, },
onLoad(options) { onLoad (options) {
if (options.componentName) this.toolComponentName = options.componentName if (options.componentName) this.toolComponentName = options.componentName
if (options.currentDate) this.setCurrentDate(options.currentDate) if (options.currentDate) this.setCurrentDate(options.currentDate)
if (options.enterType) this.enterType = options.enterType if (options.enterType) this.enterType = options.enterType
...@@ -121,15 +183,15 @@ export default { ...@@ -121,15 +183,15 @@ export default {
} }
}) })
}, },
onUnload() { onUnload () {
uni.$off('showErrorOrderPopup') uni.$off('showErrorOrderPopup')
}, },
methods: { methods: {
setCurrentDate(currentDate) { setCurrentDate (currentDate) {
this.currentDate = currentDate this.currentDate = currentDate
this.currentMonth = dayjs(currentDate).format('YYYY-MM') this.currentMonth = dayjs(currentDate).format('YYYY-MM')
}, },
async entranceClick(item) { async entranceClick (item) {
if (this.toolComponentName == item.name) return if (this.toolComponentName == item.name) return
const noInterceptPage = ['DailyReport'] const noInterceptPage = ['DailyReport']
// 原禁止提单inspectionOfProhibitionBill方法被替换getLimitRecord // 原禁止提单inspectionOfProhibitionBill方法被替换getLimitRecord
...@@ -148,8 +210,14 @@ export default { ...@@ -148,8 +210,14 @@ export default {
// 如果当前组件是OrderManagement,直接切换组件,不显示弹窗 // 如果当前组件是OrderManagement,直接切换组件,不显示弹窗
// 只有从CreateOrder、DefeatOrder切换其他组件时需要二次确认 // 只有从CreateOrder、DefeatOrder切换其他组件时需要二次确认
if (this.toolComponentName !== 'CreateOrder' && this.toolComponentName !== 'DefeatOrder') { if (this.toolComponentName !== 'CreateOrder' && this.toolComponentName !== 'DefeatOrder') {
if (selectedItem.page) {
uni.redirectTo({
url: `${selectedItem.page}?componentName=${selectedItem.name}`
})
} else {
this.toolComponentName = selectedItem.name this.toolComponentName = selectedItem.name
this.transmissionOfData = null this.transmissionOfData = null
}
return return
} }
...@@ -159,6 +227,11 @@ export default { ...@@ -159,6 +227,11 @@ export default {
text: '确认退出', text: '确认退出',
type: 'default', type: 'default',
callback: () => { callback: () => {
if (selectedItem.page) {
uni.redirectTo({
url: `${selectedItem.page}?componentName=${selectedItem.name}`
})
} else {
// 点击确认后才切换组件 // 点击确认后才切换组件
this.toolComponentName = selectedItem.name this.toolComponentName = selectedItem.name
// if (selectedItem.name !== 'CreateOrder') { // if (selectedItem.name !== 'CreateOrder') {
...@@ -170,6 +243,7 @@ export default { ...@@ -170,6 +243,7 @@ export default {
this.transmissionOfData = null this.transmissionOfData = null
this.$refs.notice.close() this.$refs.notice.close()
} }
}
}, },
{ {
text: '继续编辑', text: '继续编辑',
...@@ -183,11 +257,11 @@ export default { ...@@ -183,11 +257,11 @@ export default {
// 打开弹窗 // 打开弹窗
this.$refs.notice.open() this.$refs.notice.open()
}, },
backPage() { backPage () {
uni.navigateBack() uni.navigateBack()
}, },
// name:跳转组件名,val:跳转参数 // name:跳转组件名,val:跳转参数
jump(name, val) { jump (name, val) {
this.toolComponentName = name this.toolComponentName = name
console.log(this.toolComponentName, val) console.log(this.toolComponentName, val)
if (val) { if (val) {
...@@ -195,13 +269,13 @@ export default { ...@@ -195,13 +269,13 @@ export default {
} }
}, },
// 跳转学习中心 // 跳转学习中心
handleStudyPermissionConfirm() { handleStudyPermissionConfirm () {
this.showStudyPermissionPopup = false this.showStudyPermissionPopup = false
console.log(this.lockReason,'lockReason') console.log(this.lockReason, 'lockReason')
if (this.lockReason == '2') { if (this.lockReason == '2') {
uni.navigateTo({ url: '/pages/common/serviceDetail/index?moduleType=9' }) uni.navigateTo({ url: '/pages/common/serviceDetail/index?moduleType=9' })
return return
}else{ } else {
uni.navigateBack({ uni.navigateBack({
success: () => { success: () => {
setTimeout(() => { setTimeout(() => {
...@@ -213,7 +287,7 @@ export default { ...@@ -213,7 +287,7 @@ export default {
}, },
// 确认选择的月份 // 确认选择的月份
confirmMonth(month) { confirmMonth (month) {
this.lastMonth = month this.lastMonth = month
} }
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
@clickAdd="addItem(index)" @clickAdd="addItem(index)"
> >
<template v-slot:customCell="{row, colIndex}"> <template v-slot:customCell="{row, colIndex}">
{{ row[colIndex].value || '-' }} {{ formatValue(row[colIndex].value) }}
</template> </template>
</Table> </Table>
</template> </template>
...@@ -112,6 +112,9 @@ export default { ...@@ -112,6 +112,9 @@ export default {
}, },
confirm (data, c_index, index) { confirm (data, c_index, index) {
this.$set(this.list[index].children, c_index, utils.deepClone(data)) this.$set(this.list[index].children, c_index, utils.deepClone(data))
},
formatValue (value) {
return value != null ? value : '-'
} }
} }
} }
......
<template> <template>
<div> <view class="daily-report">
驻店日报 <view class="common-title">
</div> 基础信息
</view>
<template v-if="loadComplete">
<template v-if="list.length">
<view class="daily-report-container">
<template v-for="(i,index) in list">
<view
:class="['list-item',{'block':['group','divider','textarea'].includes(i.type)},{'list-box':i.type == 'group'}]"
:key="index"
v-if="itemShow(i)"
>
<template v-if="i.type != 'group'">
<template v-if="i.type == 'divider'">
<view class="divider flex">
<view class="text">{{ i.label }}</view>
</view>
</template>
<template v-else>
<FormItem
:formItem="i"
:rules="i.rules"
@onSelect="onSelect($event, index)"
@onInput="onInput($event, index)"
:disabled="itemDisabled(i)"
/>
</template>
</template>
<template v-else>
<view class="list-title flex">
{{ i.label }}
</view>
<template v-if="i.children.length">
<template v-for="(c,c_index) in i.children">
<FormItem
class="form-item"
:formItem="c"
:key="c_index"
:rules="i.childrenRules[c.key]"
@onSelect="onSelect($event,index, c_index)"
@onInput="onInput($event, index, c_index)"
:disabled="itemDisabled(c)"
/>
</template>
</template>
</template>
</view>
</template>
</view>
<view class="footer">
<Footer>
<view class="btn">保存</view>
</Footer>
</view>
</template>
<nothing v-else />
</template>
<EditForm
ref="editForm"
@onDel="delItem"
@onConfirm="confirm"
/>
</view>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { import Nothing from '../components/Nothing'
name: '', import Table from '../components/Table'
import Footer from '../components/Footer'
import utils from '@/utils/utils'
import EditForm from '../components/EditForm'
import FormItem from '../components/FormItem.vue'
export default {
name: 'StoreDailyReport',
components: { Table, Nothing, Footer, EditForm, FormItem },
props: {
templateData: {
type: Array,
default: () => []
}
},
data () { data () {
return { return {
loadComplete: false,
list: []
}
},
watch: {
templateData: {
handler (val) {
if (!this.list.length) this.list = utils.deepClone(val)
this.loadComplete = true
},
immediate: true,
deep: true
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
itemShow (i) {
if (i.rules) {
let { keys, result } = i.rules,
{ list } = this
if (keys && result) {
let params = keys.map((c, index) => `val${index + 1}`),
// 将 new Function 改为 eval 方式
func = eval(`(function(${params.join(',')}) { return ${result}; })`),
value = []
keys.map(key => {
let item = list.find(i => i.key == key)
if (item) value.push(item.value || null)
})
return func(...value)
} else return true
} else {
return true
} }
},
handleRowClick (row, rowIndex, index) {
let parent = this.list[index]
this.$refs.editForm.open(row, rowIndex, index, parent)
},
delItem (c_index, index) {
this.list[index].children.splice(c_index, 1)
},
addItem (index) {
let { templateData } = this
this.list[index].children.push(templateData[index].children[0])
let data = this.list[index].children[this.list[index].children.length - 1],
c_index = this.list[index].children.length - 1,
parent = this.list[index]
this.$refs.editForm.open(data, c_index, index, parent)
},
confirm (data, c_index, index) {
this.$set(this.list[index].children, c_index, utils.deepClone(data))
},
onInput (val, index, c_index = -1) {
if (c_index == -1) this.$set(this.list[index], 'value', val)
else this.$set(this.list[index].children[c_index], 'value', val)
},
onSelect (val, index, c_index = -1) {
if (c_index == -1) this.$set(this.list[index], 'value', val)
else this.$set(this.list[index].children[c_index], 'value', val)
},
itemDisabled (i) {
let disabled = i.disabled
if (i.disabledFun) {
let { keys, result } = i.disabledFun,
{ list } = this,
params = keys.map((i, index) => `val${index + 1}`),
// 将 new Function 改为 eval 方式
func = eval(`(function(${params.join(',')}) { return ${result}; })`),
value = []
keys.map(key => {
let item = list.find(i => i.key == key)
if (item) value.push(item.value || null)
})
return func(...value)
}
return disabled
},
} }
}
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.daily-report {
height: 100%;
position: relative;
&-container {
height: calc(100% - #{toRpx(256)});
padding: 0 48rpx;
box-sizing: border-box;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
gap: 24rpx 32rpx;
align-content: start;
.list-item ,.form-item{
width: calc((100% - 32rpx) / 2);
}
.block {
width: 100%;
}
.divider {
color: #999999;
font-size: 24rpx;
line-height: 32rpx;
position: relative;
justify-content: center;
.text {
position: relative;
padding: 0 24rpx;
}
&::before,
&:after {
content: '';
position: absolute;
top: 50%;
transform: translateY(-50%);
border-top: 1px dashed #999999;
width: calc(50% - #{toRpx(72)});
height: 0;
}
&::before {
left: 0;
}
&::after {
right: 0;
}
}
.list-box {
width: 100%;
border-radius: 32rpx;
display: flex;
flex-wrap: wrap;
gap: 24rpx 32rpx;
.list-title {
color: #333333;
width: 100%;
font-size: 32rpx;
font-weight: 500;
line-height: 48rpx;
padding: 8rpx 32rpx 0 0;
}
}
.no-child {
padding-bottom: 0;
}
}
&-box {
position: absolute;
width: calc(100% - #{toRpx(96)});
height: calc(100% - #{toRpx(80)});
border-radius: 32rpx;
background: #fff;
top: 48rpx;
left: 50%;
transform: translateX(-50%);
padding: 0 0 32rpx 32rpx;
overflow-x: auto;
.list-title {
font-size: 32rpx;
font-weight: 600;
line-height: 44rpx;
padding: 32rpx 0 24rpx;
position: sticky;
top: 0;
z-index: 50;
background: #fff;
}
}
.footer {
height: 136rpx;
.btn {
margin: 0 168rpx;
width: 100%;
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 80rpx;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
font-size: 28rpx;
font-weight: 500;
}
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -37,6 +37,8 @@ export default { ...@@ -37,6 +37,8 @@ export default {
const { userInfo, params } = this, const { userInfo, params } = this,
{ cacheData } = params { cacheData } = params
this.currentId = '' this.currentId = ''
this.currentIds = []
this.chooseList = []
if (!search && cacheData && cacheData.length) { if (!search && cacheData && cacheData.length) {
this.initData(cacheData) this.initData(cacheData)
if (searchValue) this.handleSearch(searchValue) if (searchValue) this.handleSearch(searchValue)
...@@ -54,12 +56,21 @@ export default { ...@@ -54,12 +56,21 @@ export default {
this.updateParams(params, data || []) this.updateParams(params, data || [])
}, },
initData (list) { initData (list) {
const { data, data: { key } } = this const { data, data: { key }, params: { multiple } } = this
if (data[key]) { if (data[key]) {
if (!multiple) {
this.currentId = data[key] this.currentId = data[key]
let item = list.find(i => i.uuid == this.currentId) let item = list.find(i => i.uuid == this.currentId)
this.$emit('choose', item) this.$emit('choose', item)
} else {
let arr = data[key]
this.chooseList = arr.map(i => list.find(e => e.uuid == i))
this.currentIds = arr
this.$emit('choose', this.chooseList)
}
} }
this.list = list this.list = list
this.$emit('onComplete') this.$emit('onComplete')
}, },
...@@ -71,7 +82,6 @@ export default { ...@@ -71,7 +82,6 @@ export default {
} else this.originalDataSearch(searchValue) } else this.originalDataSearch(searchValue)
}, },
originalDataSearch (searchValue) { originalDataSearch (searchValue) {
console.log(searchValue, '===')
if (!searchValue) this.searchStatus = false if (!searchValue) this.searchStatus = false
else { else {
searchValue = searchValue.toUpperCase() searchValue = searchValue.toUpperCase()
...@@ -86,11 +96,25 @@ export default { ...@@ -86,11 +96,25 @@ export default {
} }
}, },
choose (i) { choose (i) {
let { params: { multiple }, currentIds } = this
if (!multiple) {
this.currentId = i.uuid this.currentId = i.uuid
this.$emit('choose', i) this.$emit('choose', i)
} else {
let index = currentIds.indexOf(i.uuid)
if (index == -1) {
this.currentIds.push(i.uuid)
this.chooseList.push(i)
} else {
this.currentIds.splice(index, 1)
this.chooseList.splice(index, 1)
}
this.$emit('choose', this.chooseList)
}
}, },
checkActive (i) { checkActive (i) {
let { currentId, data: { key }, data } = this let { currentId, currentIds, data: { key }, data } = this
if (currentIds && currentIds.length) return currentIds.includes(i.uuid)
return currentId ? i.uuid == currentId : i.uuid == data[key] return currentId ? i.uuid == currentId : i.uuid == data[key]
} }
} }
......
...@@ -20,10 +20,11 @@ const componentConfig = { ...@@ -20,10 +20,11 @@ const componentConfig = {
}, },
1: { 1: {
name: 'EmployeeList', name: 'EmployeeList',
title: '交付专员', title: '多选',
multiple: true,
placeholder: '请输入姓名', placeholder: '请输入姓名',
nullTips: '请选择交付专员', nullTips: '请选择交付专员',
idKey: ['deliveryId'], idKey: ['userId'],
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
...@@ -43,16 +44,6 @@ const componentConfig = { ...@@ -43,16 +44,6 @@ const componentConfig = {
4: { 4: {
}, },
5: {
name: 'Calendar',
title: '日历',
placeholder: '请选择日期',
nullTips: '请选择日期',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}
} }
export default { componentConfig } export default { componentConfig }
...@@ -247,6 +247,9 @@ export default { ...@@ -247,6 +247,9 @@ export default {
background: #94c2ff33; background: #94c2ff33;
.form-item { .form-item {
margin-bottom: 16rpx; margin-bottom: 16rpx;
&:last-child {
margin-bottom: 0;
}
} }
} }
} }
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
v-if="item.required" v-if="item.required"
>*</text> >*</text>
</view> </view>
<view class="item-content flex"> <view :class="['item-content flex', { 'disabled': disabled }]">
<template v-if="item.disabled"> <template v-if="item.disabled || disabled">
<view :class="['select flex']">{{ item.value }} <view :class="['select flex']">{{ item.value }}
</view> </view>
</template> </template>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
@input="input" @input="input"
/> />
</template> </template>
<template v-else-if="item.type == 'select'"> <template v-else-if="item.type == 'select' || item.type == 'multipleSelect'">
<template v-if="item.optionsKey"> <template v-if="item.optionsKey">
<view <view
:class="['select flex', { 'placeholderStyle': !item.value }]" :class="['select flex', { 'placeholderStyle': !item.value }]"
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
:key="r_index" :key="r_index"
:value="i.value" :value="i.value"
:checked="i.value == item.value" :checked="i.value == item.value"
>{{ i.value }}</radio> >{{ i.label }}</radio>
</radio-group> </radio-group>
</template> </template>
<template v-else-if="item.type == 'numberInput'"> <template v-else-if="item.type == 'numberInput'">
...@@ -144,6 +144,10 @@ export default { ...@@ -144,6 +144,10 @@ export default {
type: Object, type: Object,
default: () => ({}) default: () => ({})
}, },
disabled: {
type: Boolean,
default: false
},
}, },
watch: { watch: {
formItem: { formItem: {
...@@ -162,6 +166,7 @@ export default { ...@@ -162,6 +166,7 @@ export default {
popupType () { popupType () {
let { item } = this, let { item } = this,
popupType = { popupType = {
multipleSelect: 1,
datetime: 5, datetime: 5,
carBrandSelect: 3 carBrandSelect: 3
}[item.type] || 0 }[item.type] || 0
...@@ -184,7 +189,6 @@ export default { ...@@ -184,7 +189,6 @@ export default {
select (e) { select (e) {
let { item } = this let { item } = this
if (item.optionsKey || item.type == 'datetime' || item.type == 'carBrandSelect') { if (item.optionsKey || item.type == 'datetime' || item.type == 'carBrandSelect') {
console.log(this.popupType)
this.$emit('openSelect', item, this.popupType) this.$emit('openSelect', item, this.popupType)
} else { } else {
this.$emit('onSelect', item.options[e.detail.value].value) this.$emit('onSelect', item.options[e.detail.value].value)
...@@ -344,7 +348,7 @@ export default { ...@@ -344,7 +348,7 @@ export default {
} }
}, },
numberBlur(){ numberBlur () {
this.numberViewKey = Date.now() this.numberViewKey = Date.now()
} }
} }
...@@ -364,13 +368,14 @@ export default { ...@@ -364,13 +368,14 @@ export default {
font-weight: 400; font-weight: 400;
line-height: 40rpx; line-height: 40rpx;
flex-shrink: 0; flex-shrink: 0;
padding-right: 8rpx;
.required { .required {
color: #f24724; color: #f24724;
} }
} }
&-content { &-content {
flex: 1; flex: 1;
max-width: 75%; max-width: 70%;
margin-left: auto; margin-left: auto;
.input, .input,
.radio-group { .radio-group {
...@@ -386,7 +391,9 @@ export default { ...@@ -386,7 +391,9 @@ export default {
} }
} }
} }
.sprite-icon { .sprite-icon,
.unit {
flex-shrink: 0;
margin-left: 8rpx; margin-left: 8rpx;
} }
} }
...@@ -397,6 +404,7 @@ export default { ...@@ -397,6 +404,7 @@ export default {
.radio-group { .radio-group {
width: 100%; width: 100%;
font-size: 28rpx; font-size: 28rpx;
border: none;
&::placeholder { &::placeholder {
color: #999999; color: #999999;
} }
......
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
:style="tableStyle" :style="tableStyle"
> >
<!-- 表格 --> <!-- 表格 -->
<view class="table"> <view
class="table"
:id="id"
>
<!-- 第一行:表头 --> <!-- 第一行:表头 -->
<view class="table-row header-row"> <view class="table-row header-row">
<!-- 左上角固定单元格 --> <!-- 左上角固定单元格 -->
...@@ -67,7 +70,10 @@ ...@@ -67,7 +70,10 @@
</view> </view>
</view> </view>
<template v-if="hasFooter"> <template v-if="hasFooter">
<view class="footer-row"> <view
class="footer-row"
:style="{width:tableWidth}"
>
<view <view
class="add" class="add"
@click="$emit('clickAdd')" @click="$emit('clickAdd')"
...@@ -130,17 +136,24 @@ export default { ...@@ -130,17 +136,24 @@ export default {
}, },
data () { data () {
return { return {
tableData: [] tableData: [],
tableWidth: ''
} }
}, },
watch: { watch: {
data: { data: {
handler (val) { handler (val) {
this.tableData = val || [] this.tableData = val || []
this.getTableWidth()
}, },
immediate: true immediate: true
} }
}, },
computed: {
id () {
return 'table-' + this.tableIndex
},
},
mounted () { mounted () {
}, },
methods: { methods: {
...@@ -150,6 +163,16 @@ export default { ...@@ -150,6 +163,16 @@ export default {
handleRowClick (row, rowIndex) { handleRowClick (row, rowIndex) {
this.$emit('rowClick', row, rowIndex, this.tableIndex) this.$emit('rowClick', row, rowIndex, this.tableIndex)
}, },
getTableWidth () {
const query = uni.createSelectorQuery()
query.select(`#${this.id}`).boundingClientRect(data => {
if (data && data.width) this.tableWidth = data.width + 'px'
}).exec()
if (!this.tableWidth) setTimeout(() => {
this.getTableWidth()
}, 500)
}
} }
} }
</script> </script>
...@@ -157,7 +180,7 @@ export default { ...@@ -157,7 +180,7 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.table-container { .table-container {
width: 100%; width: 100%;
height: 100%; // height: 100%;
} }
.table-scroll { .table-scroll {
......
...@@ -95,7 +95,7 @@ export default { ...@@ -95,7 +95,7 @@ export default {
selectedDays: [], selectedDays: [],
lastMonth: dayjs().subtract(1, 'month').format('YYYY-MM'), lastMonth: dayjs().subtract(1, 'month').format('YYYY-MM'),
enterType: '', enterType: '',
templateData:[] templateData: []
} }
}, },
computed: { computed: {
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
// '2.3.2': 110202, //售后延保 // '2.3.2': 110202, //售后延保
*/ */
BASE_SCENE_CODE () { BASE_SCENE_CODE () {
return [100101, 100102, 100103, 110101, 110102, 110201, 110202] return [100101, 100102,100103, 110101, 110102, 110201, 110202]
}, },
title () { title () {
...@@ -185,8 +185,33 @@ export default { ...@@ -185,8 +185,33 @@ export default {
} }
}) })
.filter(item => { .filter(item => {
if (item.type == 'group' && item.children.length) {
item.children = item.children.filter(child => {
// 品牌过滤
if (child.filterBrandId && child.filterBrandId.length) {
return !isSubset(child.filterBrandId, CAR_BRAND_ID)
} else {
return child.brandId?.length ? hasCommonElement(child.brandId, CAR_BRAND_ID) : true
}
}).filter(child => {
// 基础场景代码过滤 // 基础场景代码过滤
return item.baseSceneCode.length ? hasCommonElement(item.baseSceneCode, BASE_SCENE_CODE) : true return child.baseSceneCode.length ? hasCommonElement(child.baseSceneCode, BASE_SCENE_CODE) : true
})
}
// 基础场景代码过滤
if (item.type == 'divider') {
if (!item.qgCode) {
let hasQY = hasCommonElement(item.qyCode, BASE_SCENE_CODE),
hasYB = hasCommonElement(item.ybCode, BASE_SCENE_CODE)
if (item.isQY || item.isYB) {
if (item.isQY) return hasQY && !hasYB
if (item.isYB) return hasYB && !hasQY
} else return hasQY && hasYB
} else {
return hasCommonElement(item.qgCode, BASE_SCENE_CODE)
}
}
else return item.baseSceneCode?.length ? hasCommonElement(item.baseSceneCode, BASE_SCENE_CODE) : true
}) })
this.templateData = templateData this.templateData = templateData
console.log(templateData) console.log(templateData)
......
<template> <template>
<view class="detail-box"> <view class="detail-box">
<view class="nav-bar"> <view class="nav-bar">
<view class="back" @click="backPage"> <view
<uni-icons type="left" :size="20" color="#000"></uni-icons> class="back"
@click="backPage"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view> </view>
<view class="title">展业工具</view> <view class="title">展业工具</view>
</view> </view>
...@@ -10,27 +17,70 @@ ...@@ -10,27 +17,70 @@
<view class="detail-left"> <view class="detail-left">
<view class="common-title">展业</view> <view class="common-title">展业</view>
<view class="content"> <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'"> <template v-if="toolComponentName === 'DailyReport'">
<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> </template>
<template v-else-if="toolComponentName === 'WageAppeal'"> <template v-else-if="toolComponentName === 'WageAppeal'">
<MonthCalendar @confirm="confirmMonth"></MonthCalendar> <MonthCalendar @confirm="confirmMonth"></MonthCalendar>
</template> </template>
<template v-else> <template v-else>
<Entrance @entranceClick="entranceClick" :type="1"></Entrance> <Entrance
@entranceClick="entranceClick"
:type="1"
></Entrance>
</template> </template>
</view> </view>
</view> </view>
<view class="detail-right"> <view class="detail-right">
<component :is="toolComponentName" @jump="jump" :transmission-of-data="transmissionOfData" :currentDate="currentDate" :currentMonth="currentMonth" :lastMonth="lastMonth" @setCalendarSelected="selectedDays = $event" :enterType="enterType" /> <component
:is="toolComponentName"
@jump="jump"
:transmission-of-data="transmissionOfData"
:currentDate="currentDate"
:currentMonth="currentMonth"
:lastMonth="lastMonth"
@setCalendarSelected="selectedDays = $event"
:enterType="enterType"
/>
</view> </view>
</view> </view>
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup> <NoticePopup
ref="notice"
title="重要提示"
text="当前页面暂未保存,是否确认退出"
type="warning"
></NoticePopup>
<!-- 学习中心权限弹窗 --> <!-- 学习中心权限弹窗 -->
<StudyPopup :show.sync="showStudyPermissionPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden"> <StudyPopup
<StudyCenterPermissionPopup :lockReason="lockReason" @confirm="handleStudyPermissionConfirm" /> :show.sync="showStudyPermissionPopup"
title=""
:width="848"
:height="870"
:topImage="require('@/assets/images/common/warning-notice.png')"
:topImageWidth="848"
:topImageHeight="248"
style="overflow: hidden"
>
<StudyCenterPermissionPopup
:lockReason="lockReason"
@confirm="handleStudyPermissionConfirm"
/>
</StudyPopup> </StudyPopup>
<!-- 异常订单锁单弹窗(与 HomeFrame 逻辑保持一致) --> <!-- 异常订单锁单弹窗(与 HomeFrame 逻辑保持一致) -->
...@@ -50,7 +100,10 @@ ...@@ -50,7 +100,10 @@
</view> </view>
<template #footer> <template #footer>
<view class="flex justify-between error-order-footer"> <view class="flex justify-between error-order-footer">
<view class="footer-btn sure flex-1" @click="showErrorOrderPopup = false"> <view
class="footer-btn sure flex-1"
@click="showErrorOrderPopup = false"
>
好的 好的
</view> </view>
</view> </view>
...@@ -102,7 +155,7 @@ export default { ...@@ -102,7 +155,7 @@ export default {
MonthCalendar, MonthCalendar,
ErrorOrderPopup ErrorOrderPopup
}, },
data() { data () {
return { return {
toolComponentName: '', toolComponentName: '',
transmissionOfData: null, transmissionOfData: null,
...@@ -119,7 +172,7 @@ export default { ...@@ -119,7 +172,7 @@ export default {
enterType: '' enterType: ''
} }
}, },
onLoad(options) { onLoad (options) {
if (options.componentName) this.toolComponentName = options.componentName if (options.componentName) this.toolComponentName = options.componentName
if (options.currentDate) this.setCurrentDate(options.currentDate) if (options.currentDate) this.setCurrentDate(options.currentDate)
if (options.enterType) this.enterType = options.enterType if (options.enterType) this.enterType = options.enterType
...@@ -140,15 +193,15 @@ export default { ...@@ -140,15 +193,15 @@ export default {
} }
}) })
}, },
onUnload() { onUnload () {
uni.$off('showErrorOrderPopup') uni.$off('showErrorOrderPopup')
}, },
methods: { methods: {
setCurrentDate(currentDate) { setCurrentDate (currentDate) {
this.currentDate = currentDate this.currentDate = currentDate
this.currentMonth = dayjs(currentDate).format('YYYY-MM') this.currentMonth = dayjs(currentDate).format('YYYY-MM')
}, },
async entranceClick(item) { async entranceClick (item) {
if (this.toolComponentName == item.name) return if (this.toolComponentName == item.name) return
const noInterceptPage = ['DailyReport'] const noInterceptPage = ['DailyReport']
// if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return // if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
...@@ -173,8 +226,15 @@ export default { ...@@ -173,8 +226,15 @@ export default {
// 如果当前组件是OrderManagement,直接切换组件,不显示弹窗 // 如果当前组件是OrderManagement,直接切换组件,不显示弹窗
// 只有从CreateOrder、DefeatOrder切换其他组件时需要二次确认 // 只有从CreateOrder、DefeatOrder切换其他组件时需要二次确认
if (this.toolComponentName !== 'CreateOrder' && this.toolComponentName !== 'DefeatOrder' && this.toolComponentName !== 'UpdateOrderInfo') { if (this.toolComponentName !== 'CreateOrder' && this.toolComponentName !== 'DefeatOrder' && this.toolComponentName !== 'UpdateOrderInfo') {
if (selectedItem.page) {
uni.redirectTo({
url: `${selectedItem.page}?componentName=${selectedItem.name}`
})
} else {
this.toolComponentName = selectedItem.name this.toolComponentName = selectedItem.name
this.transmissionOfData = null this.transmissionOfData = null
}
return return
} }
...@@ -185,6 +245,11 @@ export default { ...@@ -185,6 +245,11 @@ export default {
type: 'default', type: 'default',
callback: () => { callback: () => {
// 点击确认后才切换组件 // 点击确认后才切换组件
if (selectedItem.page) {
uni.redirectTo({
url: `${selectedItem.page}?componentName=${selectedItem.name}`
})
} else {
this.toolComponentName = selectedItem.name this.toolComponentName = selectedItem.name
// if (selectedItem.name !== 'CreateOrder') { // if (selectedItem.name !== 'CreateOrder') {
// this.transmissionOfData = null // this.transmissionOfData = null
...@@ -195,6 +260,7 @@ export default { ...@@ -195,6 +260,7 @@ export default {
this.transmissionOfData = null this.transmissionOfData = null
this.$refs.notice.close() this.$refs.notice.close()
} }
}
}, },
{ {
text: '继续编辑', text: '继续编辑',
...@@ -208,18 +274,18 @@ export default { ...@@ -208,18 +274,18 @@ export default {
// 打开弹窗 // 打开弹窗
this.$refs.notice.open() this.$refs.notice.open()
}, },
backPage() { backPage () {
uni.navigateBack() uni.navigateBack()
}, },
// name:跳转组件名,val:跳转参数 // name:跳转组件名,val:跳转参数
jump(name, val) { jump (name, val) {
this.toolComponentName = name this.toolComponentName = name
if (val) { if (val) {
this.transmissionOfData = val this.transmissionOfData = val
} }
}, },
// 跳转学习中心 // 跳转学习中心
handleStudyPermissionConfirm() { handleStudyPermissionConfirm () {
this.showStudyPermissionPopup = false this.showStudyPermissionPopup = false
uni.navigateBack({ uni.navigateBack({
success: () => { success: () => {
...@@ -230,7 +296,7 @@ export default { ...@@ -230,7 +296,7 @@ export default {
}) })
}, },
// 确认选择的月份 // 确认选择的月份
confirmMonth(month) { confirmMonth (month) {
this.lastMonth = month this.lastMonth = month
}, },
} }
...@@ -278,7 +344,6 @@ export default { ...@@ -278,7 +344,6 @@ export default {
justify-content: space-between; justify-content: space-between;
font-size: toRpx(34); font-size: toRpx(34);
} }
} }
.error-order-title { .error-order-title {
text-align: center; text-align: center;
...@@ -297,7 +362,7 @@ export default { ...@@ -297,7 +362,7 @@ export default {
margin-top: toRpx(64); margin-top: toRpx(64);
margin-bottom: toRpx(48); margin-bottom: toRpx(48);
width: 100%; width: 100%;
.cancel{ .cancel {
height: toRpx(88); height: toRpx(88);
border-radius: toRpx(64); border-radius: toRpx(64);
opacity: 1; opacity: 1;
...@@ -309,7 +374,7 @@ export default { ...@@ -309,7 +374,7 @@ export default {
font-size: toRpx(32); font-size: toRpx(32);
font-weight: 400; font-weight: 400;
} }
.sure{ .sure {
height: toRpx(88); height: toRpx(88);
border-radius: toRpx(64); border-radius: toRpx(64);
opacity: 1; opacity: 1;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!