Commit 649404dd by 李伟康

feat(tool): 优化日报提醒功能并调整日报填写页面

- 在 interceptionMixin 中添加 formattedDate 参数,传递给 DailyReport 组件
- 修改 DailyReport 组件,使用 textarea 替代 input,支持多行输入
- 调整 index.vue 页面布局,优化代码格式
1 parent 7fe1f266
...@@ -79,11 +79,12 @@ export default { ...@@ -79,11 +79,12 @@ export default {
// if (wx.__HAS_NOTLOGIN_MODAL) return false; // // if (wx.__HAS_NOTLOGIN_MODAL) return false; //
this.addModalToQueue('日报提醒', '您有未填写的日报,请点击前往。', '前往填写', false, 2, res => { this.addModalToQueue('日报提醒', '您有未填写的日报,请点击前往。', '前往填写', false, 2, res => {
if (res.confirm) { if (res.confirm) {
console.log(formattedDate)
const pages = getCurrentPages(), const pages = getCurrentPages(),
currentPage = pages[pages.length - 1] currentPage = pages[pages.length - 1]
if (currentPage.route == 'pages/boutique/tool/index') uni.$emit('jumpToDailyReport') if (currentPage.route == 'pages/boutique/tool/index') uni.$emit('jumpToDailyReport',formattedDate)
else uni.navigateTo({ else uni.navigateTo({
url: `/pages/boutique/tool/index?componentName=DailyReport` url: `/pages/boutique/tool/index?componentName=DailyReport&currentDate=${formattedDate}`
}) })
} }
}) })
......
...@@ -73,15 +73,16 @@ ...@@ -73,15 +73,16 @@
备注 备注
</view> </view>
<view class="value"> <view class="value">
<input <textarea
class="input" class="textarea"
type="text"
v-model="orderObj.remark" v-model="orderObj.remark"
placeholder-class="placeholder"
placeholder="请输入 (500字以内)" placeholder="请输入 (500字以内)"
placeholder-class="placeholder"
confirm-type="done"
auto-height
:maxlength="500" :maxlength="500"
:disabled="filterDisabled(isEditReport)" :disabled="filterDisabled(isEditReport)"
> ></textarea>
</view> </view>
</view> </view>
</view> </view>
...@@ -636,7 +637,7 @@ export default { ...@@ -636,7 +637,7 @@ export default {
} }
.form-item { .form-item {
height: 96rpx; min-height: 96rpx;
border-bottom: 2rpx solid #f7f7f6; border-bottom: 2rpx solid #f7f7f6;
padding-right: 32rpx; padding-right: 32rpx;
font-size: 28rpx; font-size: 28rpx;
...@@ -675,7 +676,9 @@ export default { ...@@ -675,7 +676,9 @@ export default {
font-size: 28rpx; font-size: 28rpx;
} }
.textarea { .textarea {
width: 100%; width:calc(100% - 24rpx);
margin-left: 24rpx;
text-align: right;
} }
} }
} }
......
<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,20 +17,46 @@ ...@@ -10,20 +17,46 @@
<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'">
<Entrance @entranceClick="entranceClick"></Entrance> <Entrance @entranceClick="entranceClick"></Entrance>
</template> </template>
<template v-else> <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" /> <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>
</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" @setCalendarSelected="selectedDays = $event" /> <component
:is="toolComponentName"
@jump="jump"
:transmission-of-data="transmissionOfData"
:currentDate="currentDate"
:currentMonth="currentMonth"
@setCalendarSelected="selectedDays = $event"
/>
</view> </view>
</view> </view>
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup> <NoticePopup
ref="notice"
title="重要提示"
text="当前页面暂未保存,是否确认退出"
type="warning"
></NoticePopup>
</view> </view>
</template> </template>
...@@ -53,7 +86,7 @@ export default { ...@@ -53,7 +86,7 @@ export default {
UploadProofOfPayment, UploadProofOfPayment,
OrderDetail OrderDetail
}, },
data() { data () {
return { return {
toolComponentName: '', toolComponentName: '',
transmissionOfData: null, transmissionOfData: null,
...@@ -63,14 +96,16 @@ export default { ...@@ -63,14 +96,16 @@ export default {
selectedDays: [] selectedDays: []
} }
}, },
onLoad(options) { onLoad (options) {
if (options.componentName) this.toolComponentName = options.componentName if (options.componentName) this.toolComponentName = options.componentName
uni.$on('jumpToDailyReport', _ => { if (options.currentDate) this.currentDate = options.currentDate
uni.$on('jumpToDailyReport', currentDate => {
this.toolComponentName = 'DailyReport' this.toolComponentName = 'DailyReport'
if (currentDate) this.currentDate = currentDate
}) })
}, },
methods: { methods: {
async entranceClick(item) { async entranceClick (item) {
console.log(item) console.log(item)
if (item.name != 'DailyReport' && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return if (item.name != 'DailyReport' && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
// 保存当前选择的组件信息,但不立即切换 // 保存当前选择的组件信息,但不立即切换
...@@ -110,11 +145,11 @@ export default { ...@@ -110,11 +145,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) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!