Просмотр исходного кода

css(process/detail,work/edit):提示文字和时间选择器日历,大字版样式
perf(work/edit):出差流程 出差时间实现自动计算
fix(work/edit):校验方法执行过快,数据还未保存完毕就进行校验导致数据填写后校验还是显示未填写,创建表单时推荐将自动生成的数据前置

wangpx 1 год назад
Родитель
Сommit
f3e2b0a27a
2 измененных файлов с 270 добавлено и 114 удалено
  1. 114 23
      pages/process/detail/index.vue
  2. 156 91
      pages/work/edit/index.vue

+ 114 - 23
pages/process/detail/index.vue

@@ -8,15 +8,14 @@
 					:label-width="125" :border="true">
 					<view v-for="(elem, index) in formElements" :key="index">
 						<uni-forms-item
-							v-if="!(elem.elementName.endsWith('审批') && '' == elem.defaultValue && ['0', undefined].includes(elem.canEdit))"
-							:label="elem.elementName" :name="elem.elementId">
+							v-if="!(elem.elementName.endsWith('审批') && '' == elem.defaultValue && ['0', undefined].includes(elem.canEdit)) && ('' != elem.defaultValue || 1 == elem.canEdit)" :label="elem.elementName" :name="elem.elementId">
 							<view class="element_value_container">
 								<view v-if="'1' == elem.canEdit && '8' != elem.type" class="element_value">
 									<!-- 富文本框 -->
-									<uni-easyinput v-if="'1' == elem.type" placeholder="请输入内容"
+									<uni-easyinput v-if="'1' == elem.type" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" placeholder="请输入内容"
 										v-model="elem.defaultValue" type="textarea"></uni-easyinput>
 									<!-- 文本框 -->
-									<uni-easyinput v-else-if="'0' == elem.type" placeholder="请输入内容"
+									<uni-easyinput v-else-if="'0' == elem.type" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" placeholder="请输入内容"
 										v-model="elem.defaultValue" type="text"></uni-easyinput>
 									<!-- 下拉框 -->
 									<picker class="picker_container" v-else-if="'2' == elem.type"
@@ -46,14 +45,14 @@
 									</view>
 								</view>
 								<!-- TODO 修改后端 我的 在办 办结 接口签名图片地址返回参数为sealImgPath -->
-								<view v-else-if="typeof elem.defaultValue === 'string' && elem.defaultValue.startsWith('/shares')" class="signature_img">
-									<img style="width: 100%;" mode="widthFix"
-										:src="config.baseUrlPre + elem.defaultValue" />
-								</view>
 								<view v-else-if="typeof elem.sealImgPath === 'string' && elem.sealImgPath.startsWith('/shares')" class="signature_img">
 									<img style="width: 100%;" mode="widthFix"
 										:src="config.baseUrlPre + elem.sealImgPath" />
 								</view>
+								<view v-else-if="typeof elem.defaultValue === 'string' && elem.defaultValue.startsWith('/shares')" class="signature_img">
+									<img style="width: 100%;" mode="widthFix"
+										:src="config.baseUrlPre + elem.defaultValue" />
+								</view>
 								<text class="element_value" v-else>{{ elem.defaultValue }}</text>
 							</view>
 						</uni-forms-item>
@@ -71,7 +70,7 @@
 					<uni-forms-item :name="elem.tableField" v-for="(elem, itemIndex) in table"
 						:label="repeatingForm.elementItem[itemIndex].elementName.slice(3)" :key="itemIndex">
 						<uni-easyinput placeholder="请输入内容" v-model="elem.defaultValue"
-							:type="fieldTypeDict[repeatingForm.elementItem[itemIndex].fieldType.value] || 'text'"></uni-easyinput>
+							:type="fieldTypeDict[repeatingForm.elementItem[itemIndex].fieldType.value] || 'text'" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"></uni-easyinput>
 					</uni-forms-item>
 				</uni-forms>
 				<!-- <view class="repeating_table_button_container">
@@ -120,7 +119,7 @@
 		</view>
 		<!-- 上传附件 -->
 		<view v-if="processInfo.tinsId || flowInfo.seModel == '1'" class="file_picker_container">
-			<uni-card title="上传附件" :extra="`${subFileList.length}/15`" spacing="0">
+			<uni-card title="上传附件" :extra="`${subFileList.length}/9`" spacing="0">
 				<uni-file-picker ref="filePicker" v-model="subFileList" :auto-upload="true" mode="list" limit="10"
 					file-mediatype="all" @select="handleFileSelect" @progress="handleFileProgress"
 					@success="handleFileSuccess" @fail="handleFileFail" @delete="handleFileDelete" />
@@ -156,7 +155,7 @@
 				<uni-card>
 					<uni-section titleFontSize="1.3rem" title="环节备注" type="line"></uni-section>
 					<view class="remark_content">
-						<uni-easyinput type="textarea" autoHeight v-model="remark" placeholder="请输入"></uni-easyinput>
+						<uni-easyinput type="textarea" autoHeight v-model="remark" placeholder="请输入" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"></uni-easyinput>
 					</view>
 				</uni-card>
 			</view>
@@ -191,7 +190,7 @@
 			<uni-card>
 				<uni-section titleFontSize="1.3rem" title="撤销备注" type="line"></uni-section>
 				<view class="remark_content">
-					<uni-easyinput type="textarea" autoHeight v-model="remark" placeholder="请输入"></uni-easyinput>
+					<uni-easyinput type="textarea" autoHeight v-model="remark" placeholder="请输入" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"></uni-easyinput>
 				</view>
 			</uni-card>
 		</view>
@@ -243,7 +242,7 @@ import { getProcessFlowInfo, getProcessFormInfo, getProcessFormInfoInFlow, getPr
 import { useUserStore } from '@/store/user.js'
 const fieldTypeDict = {
 	'0': 'text',
-	'1': 'number'
+	'1': 'digit'
 }
 const userStore = useUserStore()
 const processInfo = reactive({
@@ -329,15 +328,21 @@ const fileList = ref([])
 const isCancel = ref(false)
 function initProcessInfo() {
 	if (processInfo.tinsId) {
+		// 待办审批流程表单数据
 		getProcessFormInfoInFlow(userStore.user.useId, processInfo).then(({ returnParams }) => {
 			formElements.value = returnParams.formElements
 			formInfo.value = returnParams.formInfo[0]
 			repeatingForm.value = returnParams.repeatingForm
 			getMainFormRule()
+			console.log('isCancel: ',isCancel);
+			if (returnParams.isCancel == 1) {
+				isCancel.value = true
+			}
 			repeatingFormHasValue()
 			remark.value = flowInfo.value.seModel == '0' ? '同意' : '重新提交'
 		})
 	} else {
+		// 我的 在办 办结流程表单数据
 		getProcessFormInfo(userStore.user.useId, processInfo.insId).then(({ returnParams }) => {
 			formElements.value = returnParams.formElements
 			repeatingForm.value = returnParams.repeatingForm
@@ -712,18 +717,22 @@ function cancelProcess() {
 	position: relative;
 
 	.repeating_table {
+
 		::v-deep .uni-forms {
 			.uni-forms-item__label {
 				font-size: calc(1rem + 0px) !important;
 				line-height: calc(1rem + 0px) !important;
-				font-weight: 600;
+				font-weight: 700;
 			}
 
 			.uni-forms-item__content {
-				font-size: calc(14px + .5*(1rem - 16px)) !important;
+				font-size: calc(14px + (1rem - 16px)) !important;
+				font-weight: 500;
 
 				.uni-easyinput__content-input {
-					font-size: calc(14px + .5*(1rem - 16px)) !important;
+					height: calc(35px + .5*(1rem - 16px)) !important;
+					font-size: calc(14px + (1rem - 16px)) !important;
+					font-weight: 500;
 				}
 			}
 		}
@@ -752,25 +761,47 @@ function cancelProcess() {
 	}
 
 	.main_container {
-		min-height: 60vh;
+		min-height: 40vh;
 
 		::v-deep .uni-forms {
 			.uni-forms-item__label {
 				font-size: calc(1rem + 0px) !important;
 				line-height: calc(1rem + 0px) !important;
-				font-weight: 600;
+				font-weight: 700;
 			}
-
+		
 			.uni-forms-item__content {
-				font-size: calc(14px + .5*(1rem - 16px)) !important;
-
+				font-size: calc(14px + (1rem - 16px)) !important;
+				font-weight: 500;
+				.uni-easyinput__content-textarea {
+					font-size: calc(14px + (1rem - 16px)) !important;
+					font-weight: 500;
+				}
+		
 				.uni-easyinput__content-input {
-					font-size: calc(14px + .5*(1rem - 16px)) !important;
+					height: calc(35px + .5*(1rem - 16px)) !important;
+					font-size: calc(14px + (1rem - 16px)) !important;
+					font-weight: 500;
+					color: #333;
+				}
+		
+				.uni-date {
+					.uni-icons {
+						font-size: calc(22px + 1.2*(1rem - 16px)) !important;
+						font-weight: 500;
+					}
+		
+					.uni-date__x-input {
+						height: auto;
+						font-size: calc(14px + 1.2*(1rem - 16px)) !important;
+						font-weight: 500;
+					}
 				}
 			}
 		}
 
 		.element_value_container {
+			
 			.signature_img {
 				width: 180px;
 			}
@@ -791,15 +822,29 @@ function cancelProcess() {
 				min-width: 100% !important;
 
 				.uni-table-th {
-					min-width: 50px;
+					font-size: calc(14px + 1.2*(1rem - 16px)) !important;
+					min-width: calc(50px + 2.5*(1rem - 16px));
 					background-color: #2979ff;
 					font-weight: bold;
 					color: #fcfcfc;
 				}
+				.uni-table-td {
+					font-size: calc(14px + 1.2*(1rem - 16px)) !important;
+				}
 			}
 		}
 	}
+	::v-deep .file_picker_container {
+		.uni-card {
+			.uni-card__header-content-title {
+				font-size: calc(15px + .5*(1rem - 16px));
+			}
 
+			.uni-card__header-extra-text {
+				font-size: calc(15px + .5*(1rem - 16px));
+			}
+		}
+	}
 	::v-deep .flow_step_container {
 		min-height: 200px;
 
@@ -890,4 +935,50 @@ function cancelProcess() {
 		}
 	}
 }
+::v-deep .uni-calendar__content {
+	margin: -20px;
+	margin-top: 20px;
+	.uni-calendar__header {
+		.uni-calendar__header-text {
+			font-size: calc(14px + .5*(1rem - 16px)) !important;
+		}
+		.uni-calendar__backtoday {
+			padding: 2px 8px 2px 10px !important;
+			font-size: calc(0.75rem + 0px) !important;
+		}
+	}
+	.uni-calendar__box {
+		.uni-calendar__weeks {
+			.uni-calendar__weeks-day {
+				.uni-calendar__weeks-day-text {
+					font-size: calc(14px + .5*(1rem - 16px)) !important;
+				}
+			}
+			.uni-calendar__weeks-item {
+				.uni-calendar-item__weeks-box-item {
+					.uni-calendar-item__weeks-box-circle {
+						width: calc(8px + .5*(1rem - 16px)) !important;
+						height: calc(8px + .5*(1rem - 16px)) !important;
+						top: calc(5px - .25*(1rem - 16px)) !important;
+						right: calc(5px - .25*(1rem - 16px)) !important;
+					}
+					.uni-calendar-item__weeks-box-text {
+						font-size: calc(14px + .5*(1rem - 16px)) !important;
+					}
+					.uni-calendar-item__weeks-lunar-text {
+						font-size: calc(12px + .5*(1rem - 16px)) !important;
+					}
+				}
+			}
+		}
+	}
+	.uni-date-changed {
+		.uni-date-changed--time-date {
+			font-size: calc(14px + 1*(1rem - 16px)) !important;
+		}
+		.uni-datetime-picker-text {
+			font-size: calc(14px + 1*(1rem - 16px)) !important;
+		}
+	}
+}
 </style>

+ 156 - 91
pages/work/edit/index.vue

@@ -10,23 +10,30 @@
 						<uni-forms-item v-if="'0' != elem.canEdit && '8' != elem.type" :name="elem.elementId"
 							:label="elem.elementName">
 							<!-- 关联变量输入框 -->
-							<uni-easyinput v-if="undefined != elem.bindTimeRange" placeholder=""
-								:value="calculateTimeDifference(elem, formElements)"></uni-easyinput>
+							<!-- 计算出差天数 -->
+							<uni-easyinput v-if="undefined != elem.bindTimeRange && elem.elementName == '出差天数'"
+								:type="fieldTypeDict[elem.fieldType] || 'text'"
+								:value="calculateBusinessDifference(elem, formElements)"
+								placeholder=""></uni-easyinput>
+
+							<uni-easyinput v-else-if="undefined != elem.bindTimeRange"
+								:type="fieldTypeDict[elem.fieldType] || 'text'"
+								:value="calculateTimeDifference(elem, formElements)" placeholder=""></uni-easyinput>
 							<!-- 金额转大写 -->
 							<uni-easyinput v-else-if="elem.elementName.endsWith('大写')" placeholder=""
 								:value="computedNumberToChineseCurrency(elem, formElements)"></uni-easyinput>
 							<!-- 主表关联重复表输入框 -->
-							<uni-easyinput v-else-if="elem.BddzText.startsWith('re:')" placeholder=""
-								:value="computedValueToRepeatingForm(elem)"></uni-easyinput>
+							<uni-easyinput v-else-if="elem.BddzText.startsWith('re:')"
+								:type="fieldTypeDict[elem.fieldType] || 'text'"
+								:value="computedValueToRepeatingForm(elem)" placeholder=""></uni-easyinput>
 							<!-- 输入框 -->
 							<uni-easyinput v-else-if="'0' == elem.type" :disabled="'0' == elem.canEdit"
 								:type="fieldTypeDict[elem.fieldType] || 'text'"
 								:placeholder="'0' == elem.canEdit ? '' : '请输入内容'"
-								v-model="elem.defaultValue"></uni-easyinput>
+								v-model="elem.defaultValue" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"></uni-easyinput>
 							<!-- 富文本输入框 -->
 							<uni-easyinput v-else-if="'1' == elem.type" :disabled="'0' == elem.canEdit"
-								:placeholder="'0' == elem.canEdit ? '' : '请输入内容'" v-model="elem.defaultValue"
-								type="textarea"></uni-easyinput>
+								:placeholder="'0' == elem.canEdit ? '' : '请输入内容'" v-model="elem.defaultValue" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" type="textarea"></uni-easyinput>
 							<!-- 下拉框 -->
 							<picker class="picker_container" v-else-if="'2' == elem.type"
 								@change="bindPickerChange($event, elem)" :value="elem.defaultValue"
@@ -34,7 +41,7 @@
 								<view class="uni-input input_text">
 									<!-- 设置默认值为第一个选项 -->
 									{{ elem.defaultValue ? elem.defaultValue : elem.defaultValue =
-									elem.typeDetail.enum[0].enumVname }}
+										elem.typeDetail.enum[0].enumVname }}
 								</view>
 							</picker>
 							<!-- 开始时间选择器 -->
@@ -66,11 +73,8 @@
 					<uni-forms-item :name="elem.tableField" v-for="(elem, itemIndex) in form"
 						:label="repeatingForm.elementItem[itemIndex].elementName.slice(3)" :key="itemIndex">
 						<!-- 自定义关联变量 -->
-						<uni-easyinput v-if="repeatingForm.elementItem[itemIndex].bddzText" :placeholder="''"
-							:value="calculateRepeatingFormExpression(elem, form)"></uni-easyinput>
-						<uni-easyinput v-else placeholder="请输入内容" v-model="elem.defaultValue"
-							:type="fieldTypeDict[repeatingForm.elementItem[itemIndex].fieldType.value] || 'text'"></uni-easyinput>
-					</uni-forms-item>
+						<uni-easyinput v-if="repeatingForm.elementItem[itemIndex].bddzText" :placeholder="''" :type="fieldTypeDict[repeatingForm.elementItem[itemIndex].fieldType.value] || 'text'" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" :value="calculateRepeatingFormExpression(elem, form)"></uni-easyinput>
+						<uni-easyinput v-else placeholder="请输入内容" v-model="elem.defaultValue" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" :type="fieldTypeDict[repeatingForm.elementItem[itemIndex].fieldType.value] || 'text'"></uni-easyinput></uni-forms-item>
 				</uni-forms>
 				<view class="repeating_table_button_container">
 					<uni-row>
@@ -87,7 +91,7 @@
 		</view>
 		<!-- 上传附件 -->
 		<view class="file_picker_container">
-			<uni-card title="上传附件" :extra="`${fileList.length}/15`" spacing="0">
+			<uni-card title="上传附件" :extra="`${fileList.length}/9`" spacing="0">
 				<uni-file-picker ref="filePicker" v-model="fileList" :auto-upload="true" mode="list" limit="10"
 					file-mediatype="all" @select="handleFileSelect" @progress="handleFileProgress"
 					@success="handleFileSuccess" @fail="handleFileFail" @delete="handleFileDelete" />
@@ -112,9 +116,10 @@ import $tab from '@/plugins/tab.js'
 import { convertToChineseCurrency } from '@/utils/ygoa.js'
 import { calCommonExp } from '@/utils/rpn.js'
 import { getProcessInfo, getProcessForm, submitProcessForm, uploadFile, getAttendanceSegment } from '@/api/work.js'
+
 const fieldTypeDict = {
 	'0': 'text',
-	'1': 'number'
+	'1': 'digit'
 }
 let processInfo = reactive({
 	modelName: '流程申请',
@@ -173,6 +178,7 @@ function initProcessForm() {
 		formElements.value = returnParams.formElements
 		repeatingForm.value = returnParams.repeatingForm
 		getValidateRules()
+		computedMainFormValue()
 		// 生成第一个重复表数据
 		if (repeatingForm.value) {
 			addRepeatingFormItem(0)
@@ -184,7 +190,7 @@ function initProcessForm() {
 const timeRangeItems = ref([
 	['开始时间', '结束时间', '多少小时'],
 	['出发时间', '预计返回时间'],
-	['出差时间', '返回时间'],
+	['出差时间', '返回时间', '出差天数'],
 	['出门时间', '预计返回时间'],
 	['开始时间', '结束时间', '合计小时'],
 ])
@@ -197,18 +203,15 @@ function bindTimeRangeData() {
 			// 找到 startName 和 endName 的索引
 			const startIndex = formElements.value.findIndex((item) => item.elementName === startName);
 			const endIndex = formElements.value.findIndex((item) => item.elementName === endName);
-
+			
+			const formatDate = (date) => {
+			    const pad = (num) => num.toString().padStart(2, '0');
+			    return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
+			}
+			
 			// 只有找到 startName 和 endName 后,才检查 bindName
 			if (startIndex !== -1 && endIndex !== -1) {
-				formElements.value[startIndex].defaultValue = new Date(Date.now()).toLocaleString('zh-CN', {
-					year: 'numeric',
-					month: '2-digit',
-					day: '2-digit',
-					hour: '2-digit',
-					minute: '2-digit',
-					second: '2-digit',
-					hour12: false
-				}).replace(/\//g, '-').replace(/, /g, ' ');
+				formElements.value[startIndex].defaultValue = formatDate(new Date())
 				if (bindName) {
 					const bindIndex = formElements.value.findIndex((item) => item.elementName === bindName);
 					if (bindIndex !== -1) {
@@ -233,18 +236,21 @@ function bindTimeRangeData() {
 	});
 }
 // 计算时间差
+function calculateBusinessDifference(item, form) {
+	return item.defaultValue = (calculateTimeDifference(item, form)/7).toFixed(2)
+}
 function calculateTimeDifference(item, form) {
 	// 获取 开始时间 和 结束时间
 	const { startIndex, endIndex } = item.bindTimeRange;
 	const startTime = new Date(form[startIndex].defaultValue);
 	const endTime = new Date(form[endIndex].defaultValue);
-	
+
 	// 检查时间是否合法
 	if (isNaN(startTime.getTime()) || isNaN(endTime.getTime())) {
 		return item.defaultValue = 0
 	}
-	// 改为配置选择
-	const type = item.elementName == '多少小时'?'请假':'加班'
+	// 请假申请的时间差 表单项为合计小时
+	const type = item.elementName == '合计小时' ? '非工作时间' : '工作时间'
 	// 计算时间差
 	const timeDifferenceInHours = calculateWorkingHours(startTime, endTime, type);
 	// const timeDifferenceInMs = endTime - startTime;
@@ -260,12 +266,12 @@ function calculateTimeDifference(item, form) {
 	// 	timeDifferenceInHours = Math.floor(timeDifferenceInHours);
 	// }
 	// 保存到 defaultValue
-	return item.defaultValue = timeDifferenceInHours;
+	return item.defaultValue = Number(timeDifferenceInHours.toFixed(2));
 }
 let workingPeriods = []
 let workDays = [] // 0为周日
 function setAttendanceSegment() {
-	getAttendanceSegment(userStore.user.unitId).then(({returnParams}) => {
+	getAttendanceSegment(userStore.user.unitId).then(({ returnParams }) => {
 		const workTime = returnParams[0].work_time.split(';')
 		for (const time of workTime) {
 			if (time == '') continue
@@ -283,7 +289,7 @@ function setAttendanceSegment() {
 			]
 		}
 		if (workDays.length == 0) {
-			workDays = [1,2,3,4,5,6] // 0为周日
+			workDays = [1, 2, 3, 4, 5, 6, 0] // 0为周日
 		}
 	})
 }
@@ -317,50 +323,50 @@ function calculateWorkingHours(startTime, endTime, type) {
 	let totalMinutes = 0
 
 	// 遍历时间范围的每一天
-	      for (
-	        let currentDate = new Date(startDate);
-	        currentDate <= endDate;
-	        currentDate.setDate(currentDate.getDate() + 1)
-	      ) {
-	        // 如果当前日期不是工作日,跳过
-	        if (isRestdays(currentDate)) continue;
-	
-	        const isStartDay = currentDate.getTime() === startDate.getTime();
-	        const isEndDay = currentDate.getTime() === endDate.getTime();
-	
-	        // 当天的起始和结束时间
-	        const dayStart = isStartDay ? dateToMinutes(startTime) : 0;
-	        const dayEnd = isEndDay ? dateToMinutes(endTime) : 1440; // 1440 = 24 * 60
-					// TODO 改为配置选择
-	        if (type === "请假") {
-	          // 计算工作时间段内的时间
-	          workingPeriods.forEach((period) => {
-	            const periodStart = formatTime(period.start);
-	            const periodEnd = formatTime(period.end);
-	            totalMinutes += calculateOverlap(dayStart, dayEnd, periodStart, periodEnd);
-	          });
-	        } else if (type === "加班") {
-	          // 计算非工作时间段的时间
-	          let nonWorkingMinutes = 0;
-	          let current = dayStart;
-	          for (const period of workingPeriods) {
-	            const periodStart = formatTime(period.start);
-	            const periodEnd = formatTime(period.end);
-	
-	            if (current < periodStart) {
-	              nonWorkingMinutes += calculateOverlap(current, dayEnd, current, periodStart);
-	            }
-	            current = Math.max(current, periodEnd);
-	          }
-	          if (current < dayEnd) {
-	            nonWorkingMinutes += dayEnd - current;
-	          }
-	          totalMinutes += nonWorkingMinutes;
-	        }
-	      }
-	
-	      // 转换为小时
-	      return totalMinutes / 60;
+	for (
+		let currentDate = new Date(startDate);
+		currentDate <= endDate;
+		currentDate.setDate(currentDate.getDate() + 1)
+	) {
+		// 如果当前日期不是工作日,跳过
+		if (isRestdays(currentDate)) continue;
+
+		const isStartDay = currentDate.getTime() === startDate.getTime();
+		const isEndDay = currentDate.getTime() === endDate.getTime();
+
+		// 当天的起始和结束时间
+		const dayStart = isStartDay ? dateToMinutes(startTime) : 0;
+		const dayEnd = isEndDay ? dateToMinutes(endTime) : 1440; // 1440 = 24 * 60
+		// TODO 改为配置选择
+		if (type == "工作时间") {
+			// 计算工作时间段内的时间
+			workingPeriods.forEach((period) => {
+				const periodStart = formatTime(period.start);
+				const periodEnd = formatTime(period.end);
+				totalMinutes += calculateOverlap(dayStart, dayEnd, periodStart, periodEnd);
+			});
+		} else if (type == "非工作时间") {
+			// 计算非工作时间段的时间
+			let nonWorkingMinutes = 0;
+			let current = dayStart;
+			for (const period of workingPeriods) {
+				const periodStart = formatTime(period.start);
+				const periodEnd = formatTime(period.end);
+
+				if (current < periodStart) {
+					nonWorkingMinutes += calculateOverlap(current, dayEnd, current, periodStart);
+				}
+				current = Math.max(current, periodEnd);
+			}
+			if (current < dayEnd) {
+				nonWorkingMinutes += dayEnd - current;
+			}
+			totalMinutes += nonWorkingMinutes;
+		}
+	}
+
+	// 转换为小时
+	return totalMinutes / 60;
 }
 
 function setTimeRange(e) {
@@ -372,12 +378,12 @@ function computedNumberToChineseCurrency(item, form) {
 	return item.defaultValue = convertToChineseCurrency(elem.defaultValue)
 }
 function computedValueToRepeatingForm(item) {
-	const index = repeatingForm.value.elementItem.findIndex(({elementName}) => elementName.slice(3) == item.BddzText.slice(3))
+	const index = repeatingForm.value.elementItem.findIndex(({ elementName }) => elementName.slice(3) == item.BddzText.slice(3))
 	let result = 0
-	for(const formItem of repeatingForm.value.elements) {
+	for (const formItem of repeatingForm.value.elements) {
 		result += Number(formItem[index].defaultValue) || 0
 	}
-	return item.defaultValue = result
+	return item.defaultValue = Number(result.toFixed(2))
 }
 
 // 下拉框
@@ -432,9 +438,10 @@ function calculateRepeatingFormExpression(item, form) {
 	}
 	if (/[^0-9\+\-\*\/\(\)\.]/.test(expression)) {
 		console.error('错误的表达式:', expression);
-		return expression;
+		$modal.msg('自动计算错误,请手动输入')
+		return item.defaultValue = 0;
 	}
-	return item.defaultValue = calCommonExp(expression); // 返回填充后的表达式
+	return item.defaultValue = Number(calCommonExp(expression).toFixed(2)); // 返回填充后的表达式
 }
 
 const fileList = ref([]) // 文件列表
@@ -553,8 +560,8 @@ function getValidateRules() {
 						required: true,
 					},
 					// {
-						// 类型判断 数值型使用string会出错
-						// formatTypeDict: formatTypeDict[elem.fieldType.value] || 'string',
+					// 类型判断 数值型使用string会出错
+					// formatTypeDict: formatTypeDict[elem.fieldType.value] || 'string',
 					// }
 				],
 				label: elem.elementName.slice(3)
@@ -583,10 +590,7 @@ function getValidateRules() {
 }
 
 const button_state = ref(true)
-function submitProcess() { // 提交表单
-	// 禁用提交按钮
-	button_state.value = false
-	// validateMainForm()
+function computedMainFormValue() {
 	// 设置主表校验数据
 	mainFormValue.value = computed(() => {
 		const obj = {};
@@ -596,6 +600,15 @@ function submitProcess() { // 提交表单
 		});
 		return obj;
 	}).value
+}
+function submitProcess() { // 提交表单
+	// 禁用提交按钮
+	button_state.value = false
+	// validateMainForm()
+	computedMainFormValue()
+	console.log('mainFormValue: ',mainFormValue.value);$mainForm
+	console.log('$mainFormRules: ',$mainFormRules.value);
+	console.log('$mainForm: ',$mainForm.value);
 	// 主表数据校验
 	$mainForm.value.validate().then(res => {
 
@@ -660,21 +673,26 @@ function submitProcess() { // 提交表单
 
 		.uni-forms-item__content {
 			.uni-easyinput__content-textarea {
-				font-size: calc(14px + .5*(1rem - 16px)) !important;
+				font-size: calc(14px + 1.2*(1rem - 16px)) !important;
+				font-weight: 500;
 			}
 
 			.uni-easyinput__content-input {
-				font-size: calc(14px + .5*(1rem - 16px)) !important;
+				font-size: calc(14px + 1.2*(1rem - 16px)) !important;
+				font-weight: 500;
 				color: #333;
 			}
 
 			.uni-date {
 				.uni-icons {
-					font-size: calc(22px + .5*(1rem - 16px)) !important;
+					font-size: calc(22px + 1.2*(1rem - 16px)) !important;
+					font-weight: 500;
 				}
 
 				.uni-date__x-input {
-					font-size: calc(14px + .5*(1rem - 16px)) !important;
+					height: auto;
+					font-size: calc(14px + 1.2*(1rem - 16px)) !important;
+					font-weight: 500;
 				}
 			}
 		}
@@ -731,6 +749,7 @@ function submitProcess() { // 提交表单
 		::v-deep .uni-card {
 			.uni-card__header-content-title {
 				font-size: calc(15px + .5*(1rem - 16px));
+				font-weight: 700;
 			}
 
 			.uni-card__header-extra-text {
@@ -792,4 +811,50 @@ function submitProcess() { // 提交表单
 		}
 	}
 }
+::v-deep .uni-calendar__content {
+	margin: -20px;
+	margin-top: 20px;
+	.uni-calendar__header {
+		.uni-calendar__header-text {
+			font-size: calc(14px + .5*(1rem - 16px)) !important;
+		}
+		.uni-calendar__backtoday {
+			padding: 2px 8px 2px 10px !important;
+			font-size: calc(0.75rem + 0px) !important;
+		}
+	}
+	.uni-calendar__box {
+		.uni-calendar__weeks {
+			.uni-calendar__weeks-day {
+				.uni-calendar__weeks-day-text {
+					font-size: calc(14px + .5*(1rem - 16px)) !important;
+				}
+			}
+			.uni-calendar__weeks-item {
+				.uni-calendar-item__weeks-box-item {
+					.uni-calendar-item__weeks-box-circle {
+						width: calc(8px + .5*(1rem - 16px)) !important;
+						height: calc(8px + .5*(1rem - 16px)) !important;
+						top: calc(5px - .25*(1rem - 16px)) !important;
+						right: calc(5px - .25*(1rem - 16px)) !important;
+					}
+					.uni-calendar-item__weeks-box-text {
+						font-size: calc(14px + .5*(1rem - 16px)) !important;
+					}
+					.uni-calendar-item__weeks-lunar-text {
+						font-size: calc(12px + .5*(1rem - 16px)) !important;
+					}
+				}
+			}
+		}
+	}
+	.uni-date-changed {
+		.uni-date-changed--time-date {
+			font-size: calc(14px + 1*(1rem - 16px)) !important;
+		}
+		.uni-datetime-picker-text {
+			font-size: calc(14px + 1*(1rem - 16px)) !important;
+		}
+	}
+}
 </style>