Browse Source

feat(work/diary/edit): 日报编辑页面

wangpx 1 year ago
parent
commit
8c8eb8e839

+ 1 - 1
pages.json

@@ -77,7 +77,7 @@
 			"path" : "pages/work/diary/edit",
 			"path" : "pages/work/diary/edit",
 			"style" : 
 			"style" : 
 			{
 			{
-				"navigationBarTitleText" : "编辑日报",
+				"navigationBarTitleText" : "日报编辑",
 				"enablePullDownRefresh" : false
 				"enablePullDownRefresh" : false
 			}
 			}
 		},
 		},

+ 2 - 2
pages/message/index.vue

@@ -3,8 +3,8 @@
 		<!-- <uni-nav-bar :border="false" :fixed="true">
 		<!-- <uni-nav-bar :border="false" :fixed="true">
 			<template v-slot:left>研发部</template>
 			<template v-slot:left>研发部</template>
 			<template v-slot:right>用户1</template>
 			<template v-slot:right>用户1</template>
-		</uni-nav-bar>
-		<view class="grid-body">
+		</uni-nav-bar> -->
+		<!-- <view class="grid-body">
 			<uni-grid :column="2" :square="false" :showBorder="false" @change="changeIndexGrid">
 			<uni-grid :column="2" :square="false" :showBorder="false" @change="changeIndexGrid">
 				<uni-grid-item :index="1">
 				<uni-grid-item :index="1">
 					<view class="grid-item-box">
 					<view class="grid-item-box">

+ 3 - 3
pages/mine/waitWork/waitWork.vue

@@ -136,12 +136,12 @@ function showProcessDetail(process) {
 
 
 function goToTodos() {
 function goToTodos() {
 	// 跳转到待办任务列表详情页面
 	// 跳转到待办任务列表详情页面
-	$tabs.switchTab('/pages/work/index');
+	$tabs.switchTab('/pages/process/index');
 }
 }
 
 
 function goToProcesses() {
 function goToProcesses() {
-	// 跳转到流程列表详情页面
-	$tabs.switchTab('/pages/process/index');
+	// 跳转到流程申请详情页面
+	$tabs.switchTab('/pages/work/index');
 }
 }
 </script>
 </script>
 
 

+ 100 - 3
pages/work/diary/edit.vue

@@ -1,17 +1,114 @@
 <template>
 <template>
 	<view>
 	<view>
-		编辑日报
+		<uni-nav-bar :title="date" right-text="确定" @clickRight="dialog"></uni-nav-bar>
+		<view class="diary_content">
+			<uni-list>
+				<uni-list-item>
+					<template v-slot:header>
+						<view class="date">任务</view>
+					</template>
+					<template v-slot:footer>
+						<view class="content">
+							<uni-easyinput type="textarea" v-model="TODO" :maxlength="-1" :autoHeight="true"
+								placeholder="请输入内容"></uni-easyinput>
+						</view>
+					</template>
+				</uni-list-item>
+				<uni-list-item>
+					<template v-slot:header>
+						<view class="date">完成</view>
+					</template>
+					<template v-slot:footer>
+						<view class="content">
+							<uni-easyinput type="textarea" v-model="DONE" :maxlength="-1" :autoHeight="true"
+								placeholder="请输入内容"></uni-easyinput>
+						</view>
+					</template>
+				</uni-list-item>
+				<uni-list-item>
+					<template v-slot:header>
+						<view class="date">反馈</view>
+					</template>
+					<template v-slot:footer>
+						<view class="content">
+							<uni-easyinput type="textarea" v-model="BUG" :maxlength="-1" :autoHeight="true"
+								placeholder="请输入内容"></uni-easyinput>
+						</view>
+					</template>
+				</uni-list-item>
+				<uni-list-item>
+					<template v-slot:header>
+						<view class="date">备注</view>
+					</template>
+					<template v-slot:footer>
+						<view class="content">
+							<uni-easyinput type="textarea" v-model="remark" :maxlength="-1" :autoHeight="true"
+								placeholder="请输入内容"></uni-easyinput>
+						</view>
+					</template>
+				</uni-list-item>
+
+				<uni-list-item>
+					<template v-slot:footer>
+						<view class="content">
+							<button @click="dialog" type="primary">提交</button>
+						</view>
+					</template>
+				</uni-list-item>
+			</uni-list>
+		</view>
+		<!-- 确认提交弹出层 -->
+		<view class="popup_container">
+			<uni-popup ref="submitDialog" type="dialog">
+				<uni-popup-dialog type="success" title="确认提交" @confirm="submit"></uni-popup-dialog>
+			</uni-popup>
+		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script setup lang="ts">
 <script setup lang="ts">
 	import { ref } from 'vue'
 	import { ref } from 'vue'
-	import { onLoad } from '@dcloudio/uni-app';
+	import { onLoad } from '@dcloudio/uni-app'
+	const date = ref('')
+
+	const TODO = ref('')
+	const DONE = ref('')
+	const BUG = ref('')
+	const remark = ref('')
 	onLoad((option) => {
 	onLoad((option) => {
-		console.log('option', option);
+		if (isNaN(Number(option.day))) {
+			date.value = "11/12 周" + option.day
+		} else {
+			date.value = "第 " + option.day + " 周"
+		}
 	})
 	})
+	const submitDialog = ref(null)
+	function dialog() {
+		submitDialog.value.open()
+	}
+	function submit() {
+		console.log('submit');
+		console.log('TODO', JSON.stringify(TODO.value));
+		console.log('DONE', JSON.stringify(DONE.value));
+		console.log('BUG', JSON.stringify(BUG.value));
+		console.log('remark', JSON.stringify(remark.value));
+	}
 </script>
 </script>
 
 
 <style lang="scss">
 <style lang="scss">
+	.diary_content {
+		.date {
+			text-align: center;
+			width: 20%;
+			margin: auto 0;
+		}
+
+		.content {
+			width: 100%;
 
 
+			textarea {
+				height: 15vh !important;
+			}
+		}
+	}
 </style>
 </style>

+ 49 - 47
pages/work/diary/index.vue

@@ -40,41 +40,30 @@
 						</view>
 						</view>
 					</template>
 					</template>
 				</uni-list-item>
 				</uni-list-item>
-				<uni-list-item @click="toEditDiary(day)" v-for="(day, index) in '一二三四五六日'" :key="index" clickable>
-					<!-- <template v-slot:footer>
+				<uni-list-item @click="toEditDiary(scrollInto)" clickable>
+					<template v-slot:header>
+						<view class="date">
+							<uni-row>本周</uni-row>
+							<uni-row>11.11-11.17</uni-row>
+						</view>
+					</template>
+					<template v-slot:footer>
 						<view class="content">
 						<view class="content">
-							<view style="margin-bottom: 5px;">
-									<uni-row gutter="10">
-										<uni-col :span="12">周{{day}}</uni-col>
-										<uni-col :span="12">11.1{{index+1}}</uni-col>
-									</uni-row>
-							</view>
 							<uni-row :gutter="10">
 							<uni-row :gutter="10">
-								<uni-col :span="4">
-									<text>任务</text>
-								</uni-col>
-								<uni-col :span="20">
-									<uni-easyinput type="textarea" v-model="TODO" disabled autoHeight placeholder="请输入内容"></uni-easyinput>
-								</uni-col>
-							</uni-row>
-							<uni-row :gutter="10">
-								<uni-col :span="4">
-									<text>完成</text>
-								</uni-col>
-								<uni-col :span="20">
-									<uni-easyinput type="textarea" v-model="DONE" disabled autoHeight placeholder="请输入内容"></uni-easyinput>
+								<uni-col :span="8">
+									<uni-easyinput type="textarea" disabled v-model="TODO" autoHeight placeholder="请输入内容"></uni-easyinput>
 								</uni-col>
 								</uni-col>
-							</uni-row>
-							<uni-row :gutter="10">
-								<uni-col :span="4">
-									<text>反馈</text>
+								<uni-col :span="8">
+									<uni-easyinput type="textarea" disabled v-model="DONE" autoHeight placeholder="请输入内容"></uni-easyinput>
 								</uni-col>
 								</uni-col>
-								<uni-col :span="20">
-									<uni-easyinput type="textarea" v-model="TAG" disabled autoHeight placeholder="请输入内容"></uni-easyinput>
+								<uni-col :span="8">
+									<uni-easyinput type="textarea" disabled v-model="BUG" autoHeight placeholder="请输入内容"></uni-easyinput>
 								</uni-col>
 								</uni-col>
 							</uni-row>
 							</uni-row>
 						</view>
 						</view>
-					</template> -->
+					</template>
+				</uni-list-item>
+				<uni-list-item @click="toEditDiary(day)" v-for="(day, index) in '一二三四五六日'" :key="index" clickable>
 					<template v-slot:header>
 					<template v-slot:header>
 						<view class="date">
 						<view class="date">
 							<uni-row :gutter="10">周{{day}}</uni-row>
 							<uni-row :gutter="10">周{{day}}</uni-row>
@@ -85,13 +74,13 @@
 						<view class="content">
 						<view class="content">
 							<uni-row :gutter="10">
 							<uni-row :gutter="10">
 								<uni-col :span="8">
 								<uni-col :span="8">
-									<uni-easyinput type="textarea" v-model="TODO" disabled autoHeight placeholder="请输入内容"></uni-easyinput>
+									<uni-easyinput type="textarea" disabled v-model="TODO" autoHeight placeholder="请输入内容"></uni-easyinput>
 								</uni-col>
 								</uni-col>
 								<uni-col :span="8">
 								<uni-col :span="8">
-									<uni-easyinput type="textarea" v-model="DONE" disabled autoHeight placeholder="请输入内容"></uni-easyinput>
+									<uni-easyinput type="textarea" disabled v-model="DONE" autoHeight placeholder="请输入内容"></uni-easyinput>
 								</uni-col>
 								</uni-col>
 								<uni-col :span="8">
 								<uni-col :span="8">
-									<uni-easyinput type="textarea" v-model="TAG" disabled autoHeight placeholder="请输入内容"></uni-easyinput>
+									<uni-easyinput type="textarea" disabled v-model="BUG" autoHeight placeholder="请输入内容"></uni-easyinput>
 								</uni-col>
 								</uni-col>
 							</uni-row>
 							</uni-row>
 						</view>
 						</view>
@@ -112,12 +101,15 @@
 <script setup lang="ts">
 <script setup lang="ts">
 	import { onMounted, reactive, ref } from 'vue'
 	import { onMounted, reactive, ref } from 'vue'
 	import $tab from '@/plugins/tab.js'
 	import $tab from '@/plugins/tab.js'
+
 	const TODO = ref('1. 完成 通讯录 页面\n2. 完成 人员信息 页面')
 	const TODO = ref('1. 完成 通讯录 页面\n2. 完成 人员信息 页面')
 	const DONE = ref('1. 完成 通讯录 页面\n2. 完成 通讯录人员信息 页面\n3. 解决 地图无法正常显示定位 问题')
 	const DONE = ref('1. 完成 通讯录 页面\n2. 完成 通讯录人员信息 页面\n3. 解决 地图无法正常显示定位 问题')
-	const TAG = ref('原生 map 组件仅提供查看地图功能,不提供定位功能')
-	function toEditDiary(e) {
-		console.log('toEditDiary', e);
-		$tab.navigateTo('/pages/work/diary/edit?day=' + e)
+	const BUG = ref('原生 map 组件仅提供查看地图功能,不提供定位功能')
+
+	function toEditDiary(day) {
+		console.log('toEditDiary', day);
+		// getWeekNumber(new Date())
+		$tab.navigateTo('/pages/work/diary/edit?day=' + day)
 	}
 	}
 	const rightDrawer = ref(null)
 	const rightDrawer = ref(null)
 	function showDrawer() {
 	function showDrawer() {
@@ -186,21 +178,32 @@
 	}
 	}
 	function getWeekNumber(date) {
 	function getWeekNumber(date) {
 		// 创建一个新的日期对象,传入日期
 		// 创建一个新的日期对象,传入日期
-		const tempDate = new Date(date.getTime())
-
-		// 将日期调整到该年的第一天(1月1日)
-		tempDate.setDate(tempDate.getDate() + 4 - (tempDate.getDay() || 7))
+		const tempDate = new Date('2019-12-31 15:56:02')
+		let day = tempDate.getDay()
 
 
-		// 获取该年1月1日对应的周四所在的日期
-		const yearStart = new Date(tempDate.getFullYear(), 0, 1)
+		// 调整到同一周的周四
+		// day 为 0(即周日),则使用 7 代替 day
+		tempDate.setDate(tempDate.getDate() + 4 - (day || 7))
+		// 将日期调整到 周四 这年的第一天(1月1日)
+		const year = new Date(tempDate.getFullYear(), 0, 1)
 
 
 		// 计算并返回当前日期所在的周数
 		// 计算并返回当前日期所在的周数
-		const weekNumber = Math.ceil(((tempDate - yearStart) / 86400000 + 1) / 7)
-		// 计算年份
-		let year = date.getFullYear()
-		if (weekNumber == 1 && date.getDate() >= 7) year += 1
+		const week = Math.ceil(((tempDate - year) / 86400000 + 1) / 7)
 
 
-		return weekNumber
+		let _date = {
+			year: year.getFullYear(),
+			week,
+			day
+		}
+		console.log('_date', _date);
+		return week
+	}
+	function getTotalWeeksInYear(date) {
+		// 创建一个新的日期对象,传入日期
+		const tempDate = new Date(date)
+		const year = tempDate.getFullYear()
+		const startOfYear = new Date(year, 0, 1); // 1 月 1 日
+		const endOfYear = new Date(year, 11, 31); // 12 月 31 日
 	}
 	}
 </script>
 </script>
 
 
@@ -279,7 +282,6 @@
 			width: 100%;
 			width: 100%;
 
 
 			.is-disabled {
 			.is-disabled {
-				background-color: #fff !important;
 				color: #000 !important;
 				color: #000 !important;
 			}
 			}
 		}
 		}

+ 13 - 1
pages/work/index.vue

@@ -58,6 +58,18 @@
 						<text class="text">合同会签</text>
 						<text class="text">合同会签</text>
 					</view>
 					</view>
 				</uni-grid-item>
 				</uni-grid-item>
+				<uni-grid-item :index="10">
+					<view class="grid-item-box">
+						<text class="ygoa-icon icon-checkIn"></text>
+						<text class="text">考勤</text>
+					</view>
+				</uni-grid-item>
+				<uni-grid-item :index="11">
+					<view class="grid-item-box">
+						<text class="ygoa-icon icon-location"></text>
+						<text class="text">打卡</text>
+					</view>
+				</uni-grid-item>
 			</uni-grid>
 			</uni-grid>
 		</view>
 		</view>
 		<uni-section title="日报周报" type="line"></uni-section>
 		<uni-section title="日报周报" type="line"></uni-section>
@@ -176,7 +188,7 @@
 	@import "@/static/font/ygoa/iconfont.css";
 	@import "@/static/font/ygoa/iconfont.css";
 
 
 	.ygoa-icon {
 	.ygoa-icon {
-		font-size: 30px;
+		font-size: 80rpx;
 		// color: #468bf0;
 		// color: #468bf0;
 	}
 	}