Commit 8410202b by 李伟康

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

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