|
|
@@ -1,16 +1,16 @@
|
|
|
<template>
|
|
|
<view class="work-container">
|
|
|
<!-- 宫格组件 -->
|
|
|
- <uni-section title="日常办公" type="line"></uni-section>
|
|
|
+ <uni-section :title="flowList.ftypeList[0].typeName" type="line"></uni-section>
|
|
|
<view class="grid-body">
|
|
|
<uni-grid :column="4" :showBorder="false" @change="changeProcessGrid">
|
|
|
- <uni-grid-item :index="1">
|
|
|
+ <uni-grid-item v-for="(item, index) in flowList.fList" :index="index">
|
|
|
<view class="grid-item-box">
|
|
|
<text class="ygoa-icon icon-outsourcing"></text>
|
|
|
- <text class="text">外协结算</text>
|
|
|
+ <text class="text">{{ item.modelName }}</text>
|
|
|
</view>
|
|
|
</uni-grid-item>
|
|
|
- <uni-grid-item :index="2">
|
|
|
+ <!-- <uni-grid-item :index="2">
|
|
|
<view class="grid-item-box">
|
|
|
<text class="ygoa-icon icon-apply-car"></text>
|
|
|
<text class="text">用车申请</text>
|
|
|
@@ -57,14 +57,19 @@
|
|
|
<text class="ygoa-icon icon-apply-sign-contract"></text>
|
|
|
<text class="text">合同会签</text>
|
|
|
</view>
|
|
|
- </uni-grid-item>
|
|
|
- <uni-grid-item :index="10">
|
|
|
+ </uni-grid-item> -->
|
|
|
+ </uni-grid>
|
|
|
+ </view>
|
|
|
+ <uni-section title="考勤管理" type="line"></uni-section>
|
|
|
+ <view class="grid-body">
|
|
|
+ <uni-grid :column="4" :showBorder="false" @change="changeAttendanceGrid">
|
|
|
+ <uni-grid-item :index="1">
|
|
|
<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">
|
|
|
+ <uni-grid-item :index="2">
|
|
|
<view class="grid-item-box">
|
|
|
<text class="ygoa-icon icon-location"></text>
|
|
|
<text class="text">打卡</text>
|
|
|
@@ -122,15 +127,49 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import cuiCalculator from "@/components/cui-calculator/cui-calculator.vue"
|
|
|
- import { ref } from "vue"
|
|
|
- // import $modal from "@/plugins/modal.js"
|
|
|
+ import { onMounted, ref } from "vue"
|
|
|
import $tab from "@/plugins/tab.js"
|
|
|
import { getUserInfo } from '@/utils/auth'
|
|
|
import { useUserStore } from '@/store/user.js'
|
|
|
+ import { getFlowList } from '@/api/work.js'
|
|
|
+
|
|
|
+ const userStore = useUserStore()
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ initFlowList()
|
|
|
+ })
|
|
|
+
|
|
|
+ const flowList = ref({
|
|
|
+ fList: [],
|
|
|
+ ftypeList: [
|
|
|
+ {
|
|
|
+ typeName: '日常办公'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ })
|
|
|
+
|
|
|
+ function initFlowList() {
|
|
|
+ const staffId = userStore.user.useId
|
|
|
+ const unitId = userStore.user.unitId
|
|
|
+ getFlowList(staffId, unitId).then(res => {
|
|
|
+ flowList.value = res.returnParams // 设置flowList
|
|
|
+ console.log('getFlowList', flowList.value);
|
|
|
+ })
|
|
|
+ }
|
|
|
function changeProcessGrid(e) { // 点击流程宫格
|
|
|
console.log('changeProcessGrid', e);
|
|
|
+ const flow = flowList.value.fList[e.detail.index]
|
|
|
+ console.log('flow', flow);
|
|
|
// 跳转流程申请页面
|
|
|
- $tab.navigateTo('/pages/work/edit/index?title=' + '')
|
|
|
+ // $tab.navigateTo('/pages/work/edit/index?title=' + '')
|
|
|
+ }
|
|
|
+ function changeAttendanceGrid(e) {
|
|
|
+ if (1 == e.detail.index) { // 考勤
|
|
|
+
|
|
|
+ }
|
|
|
+ if (2 == e.detail.index) { // 打卡
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
function changeDiaryGrid(e) {
|
|
|
if (1 == e.detail.index) {
|
|
|
@@ -148,41 +187,29 @@
|
|
|
function changeToolsGrid(e) { // 点击工具宫格
|
|
|
switch (e.detail.index) {
|
|
|
case 1:
|
|
|
- openCalculatorPopup()
|
|
|
+ openCalculatorPopup() // 打开计算器弹出层
|
|
|
break
|
|
|
case 2:
|
|
|
- openClearCachePopup()
|
|
|
+ openClearCachePopup() // 打开清除缓存弹出层
|
|
|
break
|
|
|
default:
|
|
|
}
|
|
|
- console.log('changeToolsGrid', e);
|
|
|
- // $tab.navigateTo('/pages/work/edit/index?title=' + '')
|
|
|
- // $modal.showToast('模块建设中~')
|
|
|
}
|
|
|
// 计算器
|
|
|
const calculatorPopup = ref(null)
|
|
|
function openCalculatorPopup() { // 打开计算器弹出层
|
|
|
calculatorPopup.value.open()
|
|
|
}
|
|
|
- function closeCalculatorPopup() { // 关闭计算器弹出层
|
|
|
- calculatorPopup.value.close()
|
|
|
- }
|
|
|
// 清除缓存
|
|
|
const clearCacheDialog = ref(null)
|
|
|
function openClearCachePopup() { // 打开清除缓存弹出层
|
|
|
clearCacheDialog.value.open()
|
|
|
}
|
|
|
- function closeClearCachePopup() { // 关闭清除缓存弹出层
|
|
|
- clearCacheDialog.value.close()
|
|
|
- }
|
|
|
// const userStore = useUserStore()
|
|
|
function clearCache() {
|
|
|
const userInfo = getUserInfo()
|
|
|
uni.clearStorageSync();
|
|
|
- // console.log('userStore.user', userStore.user);
|
|
|
- // console.log('userInfo', userInfo);
|
|
|
uni.setStorageSync('userInfo', userInfo)
|
|
|
- // console.log('userInfo', userStore.user);
|
|
|
// 提示用户缓存清理成功
|
|
|
uni.showToast({
|
|
|
title: '缓存清理成功',
|