Przeglądaj źródła

feat(word/edit): 流程申请页面

wangpx 1 rok temu
rodzic
commit
4c29829ce2

+ 2 - 2
components/ygoa/processList.vue

@@ -5,7 +5,7 @@
 				<uni-row>
 					<uni-col :xs="4" :sm="2">
 						<view class="icon_container">
-							<text class="iconfont" :class="process.type"></text>
+							<text class="ygoa-icon" :class="process.type"></text>
 						</view>
 					</uni-col>
 					<uni-col :xs="20" :sm="22">
@@ -64,7 +64,7 @@
 <style lang="scss">
 	@import url("@/static/font/ygoa/iconfont.css");
 
-	.iconfont {
+	.ygoa-icon {
 		font-size: 3rem;
 	}
 

+ 8 - 0
pages.json

@@ -57,6 +57,14 @@
 				"enablePullDownRefresh": false
 			}
 		},
+		{
+			"path" : "pages/work/edit/index",
+			"style" : 
+			{
+				"navigationBarTitleText" : "发起流程",
+				"enablePullDownRefresh" : false
+			}
+		},
 		{
 			"path" : "pages/contacts/group/index",
 			"style" : 

+ 1 - 1
pages/message/index.vue

@@ -43,7 +43,7 @@
 									<view class="message_mid_container">
 										<uni-col :span="19">
 											<text class="message_title hidden_over">
-												<text :class="message.icon" class="iconfont"></text>
+												<text :class="message.icon" class="ygoa-icon"></text>
 												{{ message.title }}
 											</text>
 										</uni-col>

+ 9 - 4
pages/process/detail/index.vue

@@ -113,14 +113,19 @@
 	import { onLoad } from '@dcloudio/uni-app'
 	let fileList = reactive([])
 	function handleSelect(e) {
-		console.log('handleSelect', e);
+		console.log('handleSelect', e)
+		for (const file of e.tempFiles) {
+			fileList.push(file)
+		}
+		console.log('fileList', fileList)
 	}
 	function handleProgress(e) {
-		console.log('handleProgress', e);
+		console.log('handleProgress', e)
 	}
 	function handleDelete(e) {
-		console.log('handleDelete', e);
-		console.log('handleDelete.target', e.target);
+		console.log('handleDelete', e)
+		fileList.splice(fileList.indexOf(e.tempFiles), 1)
+		console.log('fileList', fileList)
 	}
 	onLoad((options) => {
 		// 获取传入的标题参数

+ 10 - 8
pages/process/index.vue

@@ -42,7 +42,7 @@
 <script setup lang="ts">
 	import processList from '@/components/ygoa/processList.vue'
 	import { onMounted, reactive, ref } from 'vue';
-	const items = reactive(['待办', '在办', '办结', '我的'])
+	const items = reactive(['我的', '待办', '在办', '办结'])
 	let processes = reactive([])
 	const current = ref(-1)
 	onMounted(() => {
@@ -75,6 +75,8 @@
 		current.value = currentIndex
 		switch (currentIndex) {
 			case 0:
+			case 1:
+			case 2:
 				processes = [
 					{
 						id: 1,
@@ -102,12 +104,12 @@
 					}
 				]
 				break;
-			case 1:
-				processes = []
-				break;
-			case 2:
-				processes = []
-				break;
+			// case 1:
+			// 	processes = []
+			// 	break;
+			// case 2:
+			// 	processes = []
+			// 	break;
 			case 3:
 				processes = []
 				break;
@@ -118,7 +120,7 @@
 <style lang="scss">
 	@import url("@/static/font/ygoa/iconfont.css");
 
-	.iconfont {
+	.ygoa-icon {
 		font-size: 3rem;
 	}
 

+ 104 - 0
pages/work/edit/index.vue

@@ -0,0 +1,104 @@
+<template>
+	<view>
+		<uni-card margin="10px" spacing="0">
+			<uni-forms label-position="left" :label-width="110" :border="true">
+				<uni-forms-item v-for="(item, index) in formElements" :label="item.elementName" :key="index">
+					<uni-easyinput v-if="'多少小时'==item.elementName" :disabled="true" placeholder="请输入内容"
+						:value="diffHours"></uni-easyinput>
+					<uni-easyinput v-else-if="'0'==item.type" :disabled="'0'==item.canEdit" placeholder="请输入内容"
+						:value="item.defaultValue"></uni-easyinput>
+					<!-- 开始时间选择器 -->
+					<uni-datetime-picker :end="endTime" @change="setTimeRange(item)"
+						v-else-if="timeFlag&&'9'==item.type&&'开始时间'==item.elementName" v-model="item.defaultValue"
+						:clear-icon="false" type="datetime" />
+					<!-- 结束时间选择器 -->
+					<uni-datetime-picker :start="startTime" @change="setTimeRange(item)" :disabled="disableEndTime"
+						:placeholder="disableEndTime?'请先选择开始时间':'选择日期时间'"
+						v-else-if="timeFlag&&'9'==item.type&&'结束时间'==item.elementName" v-model="item.defaultValue"
+						:clear-icon="false" type="datetime" />
+					<!-- 其他时间选择器 -->
+					<uni-datetime-picker v-else-if="'9'==item.type" v-model="item.defaultValue" type="datetime" />
+				</uni-forms-item>
+			</uni-forms>
+		</uni-card>
+		<uni-card margin="10px" spacing="0">
+			<uni-list-item>
+				<template v-slot:header>
+					上传附件
+				</template>
+			</uni-list-item>
+			<uni-list-item>
+				<template v-slot:body>
+					<uni-file-picker v-model="fileList" :autoUpload="false" mode="list" limit="5" file-mediatype="all"
+						title="选择文件" @select="handleSelect" @progress="handleProgress" @delete="handleDelete"></uni-file-picker>
+				</template>
+			</uni-list-item>
+			<button type="primary" @click="submitProcess">提交</button>
+		</uni-card>
+	</view>
+</template>
+
+<script setup lang="ts">
+	import { onMounted, reactive, ref } from 'vue'
+	import { onLoad } from '@dcloudio/uni-app'
+	onLoad((options) => {
+		// 获取传入的标题参数
+		const title = options.title || '流程申请';
+		// 设置导航栏标题
+		uni.setNavigationBarTitle({
+			title: title
+		});
+	})
+	let formElements = reactive([{ elementName: 'EU单号', canEdit: '0', defaultValue: 'YGTX-WXJS027', type: '0', }, { elementName: '发起人', canEdit: '0', defaultValue: '账号1', type: '0', }, { elementName: '外协类别', canEdit: '1', defaultValue: '', type: '0', }, { elementName: '外协人姓名', canEdit: '1', defaultValue: '', type: '0', }, { elementName: '开始时间', canEdit: '1', defaultValue: '', type: '9', }, { elementName: '结束时间', canEdit: '1', defaultValue: '', type: '9', }, { elementName: '多少小时', canEdit: '1', defaultValue: '', type: '0', }, { elementName: '开户行', canEdit: '0', defaultValue: '', type: '0', }, { elementName: '开户号', canEdit: '0', defaultValue: '', type: '0', }, { elementName: '综合管理部审批', canEdit: '0', defaultValue: '', type: '13', }, { elementName: '财务审批', canEdit: '0', defaultValue: '', type: '13', }, { elementName: '总经理审批', canEdit: '0', defaultValue: '', type: '13', }])
+	const startTime = ref('') // 开始时间
+	const endTime = ref('') // 结束时间
+	const diffHours = ref(' ') // 时间差
+	const timeFlag = ref(false) // 是否计算时间差
+	const disableEndTime = ref(false) // 禁用 结束时间选择器
+	onMounted(() => {
+		const startEle = formElements.find((item) => '开始时间' == item.elementName)
+		const endEle = formElements.find((item) => '结束时间' == item.elementName)
+		if (startEle && endEle) { // 判断是否需要计算时间差
+			timeFlag.value = true
+			disableEndTime.value = true // 计算时间差时默认禁用结束时间选择器
+		}
+	})
+	function setTimeRange(e) {
+		if (timeFlag.value && '开始时间' == e.elementName) {
+			startTime.value = e.defaultValue // 设置 开始时间
+			disableEndTime.value = false // 解除 结束时间选择器 禁用
+		}
+		if (timeFlag.value && '结束时间' == e.elementName) {
+			endTime.value = e.defaultValue // 设置 结束时间
+		}
+		if (timeFlag.value && startTime.value && endTime.value) {
+			const start = new Date(startTime.value).getTime() // 获取  开始时间 时间戳
+			const end = new Date(endTime.value).getTime() // 获取  结束时间 时间戳
+			const diffSec = Math.abs(end - start) // 获取 时间戳 差值
+			diffHours.value = (diffSec / 1000 / 60 / 60).toFixed(2) // 计算 时间差值 并格式化 为只有2位小数
+		}
+	}
+
+	let fileList = reactive([]) // 文件列表
+	function handleSelect(e) { // 新增文件
+		console.log('handleSelect', e)
+		for (const file of e.tempFiles) {
+			fileList.push(file)
+		}
+	}
+	function handleProgress(e) { // 文件上传
+		console.log('handleProgress', e)
+	}
+	function handleDelete(e) { // 移除文件
+		console.log('handleDelete', e)
+		fileList.splice(fileList.indexOf(e.tempFiles), 1)
+	}
+	
+	function submitProcess() { // 提交表单
+		console.log('submitProcess')
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 54 - 24
pages/work/index.vue

@@ -1,81 +1,111 @@
 <template>
 	<view class="work-container">
 		<!-- 宫格组件 -->
-		<uni-section title="系统管理" type="line"></uni-section>
+		<uni-section title="日常办公" type="line"></uni-section>
 		<view class="grid-body">
-			<uni-grid :column="4" :showBorder="false" @change="changeGrid">
-				<uni-grid-item>
+			<uni-grid :column="4" :showBorder="false" @change="changeProcessGrid">
+				<uni-grid-item :index="1">
 					<view class="grid-item-box">
-						<text class="iconfont icon-outsourcing"></text>
+						<text class="ygoa-icon icon-outsourcing"></text>
 						<text class="text">外协结算</text>
 					</view>
 				</uni-grid-item>
-				<uni-grid-item>
+				<uni-grid-item :index="2">
 					<view class="grid-item-box">
-						<text class="iconfont icon-apply-car"></text>
+						<text class="ygoa-icon icon-apply-car"></text>
 						<text class="text">用车申请</text>
 					</view>
 				</uni-grid-item>
-				<uni-grid-item>
+				<uni-grid-item :index="3">
 					<view class="grid-item-box">
-						<text class="iconfont icon-apply-business"></text>
+						<text class="ygoa-icon icon-apply-business"></text>
 						<text class="text">出差申请</text>
 					</view>
 				</uni-grid-item>
-				<uni-grid-item>
+				<uni-grid-item :index="4">
 					<view class="grid-item-box">
-						<text class="iconfont icon-apply-out"></text>
+						<text class="ygoa-icon icon-apply-out"></text>
 						<text class="text">外出申请</text>
 					</view>
 				</uni-grid-item>
-				<uni-grid-item>
+				<uni-grid-item :index="5">
 					<view class="grid-item-box">
-						<text class="iconfont icon-apply-expense"></text>
+						<text class="ygoa-icon icon-apply-expense"></text>
 						<text class="text">费用报销</text>
 					</view>
 				</uni-grid-item>
-				<uni-grid-item>
+				<uni-grid-item :index="6">
 					<view class="grid-item-box">
-						<text class="iconfont icon-apply-overtime"></text>
+						<text class="ygoa-icon icon-apply-overtime"></text>
 						<text class="text">加班申请</text>
 					</view>
 				</uni-grid-item>
-				<uni-grid-item>
+				<uni-grid-item :index="7">
 					<view class="grid-item-box">
-						<text class="iconfont icon-apply-leave"></text>
+						<text class="ygoa-icon icon-apply-leave"></text>
 						<text class="text">请假申请</text>
 					</view>
 				</uni-grid-item>
-				<uni-grid-item>
+				<uni-grid-item :index="8">
 					<view class="grid-item-box">
-						<text class="iconfont icon-apply-purchase"></text>
+						<text class="ygoa-icon icon-apply-purchase"></text>
 						<text class="text">采购申请</text>
 					</view>
 				</uni-grid-item>
-				<uni-grid-item>
+				<uni-grid-item :index="9">
 					<view class="grid-item-box">
-						<text class="iconfont icon-apply-sign-contract"></text>
+						<text class="ygoa-icon icon-apply-sign-contract"></text>
 						<text class="text">合同会签</text>
 					</view>
 				</uni-grid-item>
 			</uni-grid>
 		</view>
+
+		<uni-section title="系统工具" type="line"></uni-section>
+		<view class="grid-body">
+			<uni-grid :column="4" :showBorder="false" @change="changeToolsGrid">
+				<uni-grid-item :index="1">
+					<view class="grid-item-box">
+						<text class="ygoa-icon icon-calculator"></text>
+						<text class="text">计算器</text>
+					</view>
+				</uni-grid-item>
+				<uni-grid-item :index="2">
+					<view class="grid-item-box">
+						<text class="ygoa-icon icon-clear-cache"></text>
+						<text class="text">清除缓存</text>
+					</view>
+				</uni-grid-item>
+			</uni-grid>
+		</view>
 	</view>
 </template>
 
 <script setup lang="ts">
 	import { ref } from "vue"
-	import $modal from "@/plugins/modal.js"
-	function changeGrid(e) {
-		$modal.showToast('模块建设中~')
+	// import $modal from "@/plugins/modal.js"
+	import $tab from "@/plugins/tab.js"
+	function changeProcessGrid(e) {
+		console.log('changeProcessGrid', e);
+		$tab.navigateTo('/pages/work/edit/index?title=' + '')
+		// $modal.showToast('模块建设中~')
+	}
+	
+	function changeToolsGrid(e) {
+		console.log('changeToolsGrid', e);
+		$tab.navigateTo('/pages/work/edit/index?title=' + '')
+		// $modal.showToast('模块建设中~')
 	}
 </script>
 
 <style lang="scss">
 	@import "@/static/font/ygoa/iconfont.css";
-	.iconfont {
+
+	.ygoa-icon {
 		font-size: 30px;
+		color: #468bf0;
 	}
+
 	/* #ifndef APP-NVUE */
 	page {
 		display: flex;

+ 68 - 16
static/font/ygoa/iconfont.css

@@ -1,24 +1,16 @@
 @font-face {
-  font-family: "iconfont"; /* Project id  */
-  src: url('iconfont.ttf?t=1730777499069') format('truetype');
+  font-family: "ygoa-icon"; /* Project id 4732186 */
+  src: url('iconfont.ttf?t=1731029986563') format('truetype');
 }
 
-.iconfont {
-  font-family: "iconfont" !important;
+.ygoa-icon {
+  font-family: "ygoa-icon" !important;
   font-size: 16px;
   font-style: normal;
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale;
 }
 
-.icon-announce:before {
-  content: "\e650";
-}
-
-.icon-notify:before {
-  content: "\e611";
-}
-
 .icon-apply-purchase:before {
   content: "\e675";
 }
@@ -51,11 +43,71 @@
   content: "\e66a";
 }
 
-.icon-apply-annual-leave:before {
-  content: "\e66b";
-}
-
 .icon-apply-sign-contract:before {
   content: "\e623";
 }
 
+.icon-calculator2:before {
+  content: "\eb18";
+}
+
+.icon-calculator:before {
+  content: "\e649";
+}
+
+.icon-clear-cache:before {
+  content: "\e655";
+}
+
+.icon-clock-in:before {
+  content: "\e612";
+}
+
+.icon-kaoqindaka:before {
+  content: "\e690";
+}
+
+.icon-init-process:before {
+  content: "\e630";
+}
+
+.icon-announce:before {
+  content: "\e650";
+}
+
+.icon-notify:before {
+  content: "\e611";
+}
+
+.icon-message:before {
+  content: "\e604";
+}
+
+.icon-message_:before {
+  content: "\e6c8";
+}
+
+.icon-shouye:before {
+  content: "\e65d";
+}
+
+.icon-shouye1:before {
+  content: "\e607";
+}
+
+.icon-process:before {
+  content: "\e600";
+}
+
+.icon-process_:before {
+  content: "\e6c7";
+}
+
+.icon-contacts:before {
+  content: "\e610";
+}
+
+.icon-contacts_:before {
+  content: "\e6c6";
+}
+

BIN
static/font/ygoa/iconfont.ttf