Ver Fonte

Merge remote-tracking branch 'origin/master'

yewc há 1 ano atrás
pai
commit
64ba8b5b1a

+ 2 - 1
client/src/utils/dict.ts

@@ -149,5 +149,6 @@ export enum DICT_TYPE {
   POST_TYPE = 'post_type',
   ABILITY_LEVEL = 'ABILITY_LEVEL',
   INVOICE_OUT_STATUS = 'INVOICE_OUT_STATUS',
-  INVOICE_TYPE = 'invoice_type'
+  INVOICE_TYPE = 'invoice_type',
+  SUBCONTRACT_SING_TYPE = 'subContract_sign_type' //待定
 }

+ 94 - 64
client/src/views/OaSystem/home/homeStaff.vue

@@ -54,6 +54,13 @@ import CardItemSeven3 from './components/CardItemSeven3.vue'
 import HandleEvents from './components/HandleEvents.vue'
 import ProjectTimeChart from './components/TimeChart.vue'
 import BarList from './components/BarList.vue'
+import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
+import { useQuery } from '@tanstack/vue-query'
+import { getRecordsDetail } from '@/api/oa/staffRecords'
+import { dateFormatter2 } from '@/utils/formatTime'
+import { DICT_TYPE, getDictLabel } from '@/utils/dict'
+import moment from 'moment'
+import { getWorkdayList, getAttendanceSheetListMine } from '@/api/oa/attendanceCenter'
 
 const router = useRouter()
 const moreHandle = () => {
@@ -85,7 +92,7 @@ const barListData = [
   }
 ]
 
-const panelList = [
+const panelList = reactive([
   {
     label: '参与项目',
     shortLabel: '参',
@@ -93,65 +100,18 @@ const panelList = [
     children: [
       {
         label: '进行',
-        number: '2',
+        number: '',
         key: ''
       },
       {
         label: '验收',
-        number: '2',
+        number: '',
         key: '',
         color: '#05CE9E'
       },
       {
         label: '结项',
-        number: '2',
-        key: ''
-      }
-    ]
-  },
-  {
-    label: '我的任务',
-    shortLabel: '任',
-    unit: '个',
-    children: [
-      {
-        label: '进行',
-        number: '2',
-        key: ''
-      },
-      {
-        label: '延期',
-        number: '1',
-        key: '',
-        color: '#F23C3C'
-      },
-      {
-        label: '完成',
-        number: '18',
-        key: ''
-      }
-    ]
-  },
-  {
-    label: '我的周报',
-    shortLabel: '报',
-    unit: '个',
-
-    children: [
-      {
-        label: '提交',
-        number: '22',
-        key: ''
-      },
-      {
-        label: '缺失',
-        number: '2',
-        key: '',
-        color: '#F23C3C'
-      },
-      {
-        label: '点评',
-        number: '4',
+        number: '',
         key: ''
       }
     ]
@@ -162,19 +122,19 @@ const panelList = [
     unit: '天',
     children: [
       {
-        label: '正常',
-        number: '2',
+        label: '迟到',
+        number: '',
         key: ''
       },
       {
-        label: '异常',
-        number: '2',
+        label: '早退',
+        number: '',
         key: '',
         color: '#F23C3C'
       },
       {
-        label: '请假',
-        number: '2',
+        label: '旷工',
+        number: '',
         key: ''
       }
     ]
@@ -187,17 +147,17 @@ const panelList = [
     children: [
       {
         label: '应休',
-        number: '2',
+        number: '',
         key: ''
       },
       {
         label: '已休',
-        number: '2',
+        number: '',
         key: ''
       },
       {
         label: '剩余',
-        number: '2',
+        number: '',
         key: ''
       }
     ]
@@ -208,17 +168,87 @@ const panelList = [
     children: [
       {
         label: '入职',
-        number: '2020/09/01',
-        key: ''
+        number: ''
       },
       {
         label: '职级',
-        number: 'L10',
+        number: '',
         key: ''
       }
     ]
   }
-]
+])
+const { wsCache } = useCache()
+const user = wsCache.get(CACHE_KEY.USER)
+const userId = user.user.id // 当前登录的编号
+//我的档案
+useQuery(
+  ['fetch-staff-detail-left', userId],
+  async () => {
+    return await getRecordsDetail({ userId })
+  },
+  {
+    onSuccess(data) {
+      panelList[panelList.length - 1]['children'][0]['number'] = dateFormatter2(
+        null,
+        null,
+        data?.rgssj
+      ) as string
+
+      panelList[panelList.length - 1]['children'][1]['number'] = getDictLabel(
+        DICT_TYPE.ABILITY_LEVEL,
+        data?.nldj
+      )
+    }
+  }
+)
+//工作日数据列表
+const queryWorkDayMap = async (): Promise<Record<string, number> | null> => {
+  const params = {
+    dateDay: [
+      moment(new Date()).startOf('month').format('YYYY-MM-DD HH:mm:ss'),
+      moment(new Date()).endOf('month').format('YYYY-MM-DD HH:mm:ss')
+    ], //		日期(数组)
+    dayOfWeek: '', //			星期几
+    holidayRemark: '', //			节假备注,示例值(国庆节)
+    isworkday: '', //		是否工作日
+    year: '', //		年份
+    month: '', //		月份
+    week: '' //		周
+  }
+  const workDayList = await getWorkdayList(params)
+  if (workDayList && workDayList.length > 0) {
+    const map = {}
+    workDayList.forEach((item) => {
+      map[item.dateDay] = item['isworkday']
+    })
+    return map
+  }
+  return null
+}
+//我的考勤
+const queryAttendanceSheetListMine = async () => {
+  const params = {
+    attendanceDate: [
+      moment(new Date()).startOf('month').format('YYYY-MM-DD HH:mm:ss'),
+      moment(new Date()).endOf('month').format('YYYY-MM-DD HH:mm:ss')
+    ], //	考勤时间
+    attendanceStatus: '', //	考勤状态,示例值(2)
+    attendanceType: '', //	考勤类型(1:上午;2:下午),示例值(1)
+    otherMinute: '' //	其他考勤状态分钟(除了出勤)
+  }
+  const workdayMap = await queryWorkDayMap()
+  getAttendanceSheetListMine(params).then((res) => {
+    panelList[1]['children'][0]['number'] = res.filter((item) => item.attendanceStatus === 2).length
+    panelList[1]['children'][1]['number'] = res.filter((item) => item.attendanceStatus === 3).length
+    panelList[1]['children'][2]['number'] = Math.floor(
+      res.filter((item) => {
+        return item.attendanceStatus === 4 && workdayMap[item['attendanceDate']] === 1
+      }).length / 2
+    ).toString()
+  })
+}
+queryAttendanceSheetListMine()
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
client/src/views/OaSystem/home/index.vue

@@ -41,7 +41,7 @@ const roles = userStore.getRoles
 if (roles) {
   if (roles.indexOf('test_leader') != -1 || roles.indexOf('test_dept_manager') != -1) {
     //板块领导||部门经理
-    currentIndex.value = '1'
+    currentIndex.value = '2'
   } else {
     //普通员工
     currentIndex.value = '2'

+ 55 - 18
client/src/views/OaSystem/marketCenter/contractSubOut/applyIndex.vue

@@ -65,23 +65,37 @@
           <el-table-column label="序号" width="60">
             <template #default="scope">{{ scope.$index + 1 }}</template>
           </el-table-column>
-          <el-table-column :show-overflow-tooltip="true" prop="contractName" label="合同名称" />
-          <el-table-column :show-overflow-tooltip="true" prop="applyType" label="合同类型">
-            <template #default="scope">{{ contractType[scope.row.applyType] }}</template>
-          </el-table-column>
           <el-table-column :show-overflow-tooltip="true" prop="projectName" label="项目名称" />
-          <el-table-column :show-overflow-tooltip="true" prop="projectNumber" label="项目编号" />
           <el-table-column prop="zrbm" label="责任部门" width="180" />
-          <el-table-column prop="contractAmount" label="分/外包合同额" width="160" />
-          <el-table-column prop="client" label="供应商" width="160" />
           <el-table-column prop="applyWorker" label="申请人" width="160" />
+          <el-table-column :show-overflow-tooltip="true" prop="applyType" label="申请类型">
+            <template #default="scope">{{
+              scope.row.applyType === 1 ? '分包合同' : scope.row.applyType === 2 ? '外包合同' : ''
+            }}</template>
+          </el-table-column>
+          <el-table-column prop="applyDate" label="申请时间" width="160" />
+          <el-table-column prop="client" label="供应商" width="160" />
+          <el-table-column prop="contractAmount" label="申请金额" width="160" />
           <el-table-column label="是否签合同" width="120">
             <template #default="scope">{{ isSignType[scope.row.isSign] }}</template>
           </el-table-column>
-          <el-table-column label="操作" fixed="right" width="80">
+          <el-table-column label="状态" width="120">
+            <template #default="scope">{{
+              scope.row.isSign == 1
+                ? getDictLabel(DICT_TYPE.CONTRACT_SIGN_STATUS, scope.row.contractSubFlowStatus)
+                : ''
+            }}</template>
+          </el-table-column>
+          <el-table-column label="操作" fixed="right">
             <template #default="scope">
-              <div class="operateBtn" @click="operateClick(scope.row)">
-                <span>查看</span>
+              <div class="operateBtn" style="width: 100%">
+                <span @click="openFlowPage(scope.row)">查看申请流程</span>
+                <span
+                  @click="operateClick(scope.row)"
+                  style="margin-left: 10px"
+                  v-if="scope.row.isSign == 1 && scope.row.contractSubFlowStatus == 1"
+                  >查看合同</span
+                >
               </div>
             </template>
           </el-table-column>
@@ -104,8 +118,9 @@
 import { useRouter } from 'vue-router'
 import { ElMessage } from 'element-plus'
 import { PageParam } from '@/interface/common'
-import { openFlow } from '@/utils/flow'
+import { openFlow, openProcessFlow } from '@/utils/flow'
 import request from '@/config/axios'
+import { DICT_TYPE, getDictLabel } from '@/utils/dict'
 import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
 
 defineOptions({ name: 'ProjectBook' })
@@ -117,12 +132,6 @@ if (routeName === 'MyContractSubOut') {
   const user = wsCache.get(CACHE_KEY.USER)
   userId = user.user.id ? user.user.id : ''
 }
-const contractType = {
-  1: '分包合同',
-  2: '外包合同'
-} as {
-  [key: number]: string
-}
 const isSignType = {
   1: '是',
   0: '否'
@@ -184,6 +193,7 @@ const currentProcess = ref<{
   contractId: string
   applyType: number
   isSign: number
+  contractSubFlowStatus: number
   projectId?: string
   clientId?: string
 } | null>(null)
@@ -195,6 +205,7 @@ const handleSelectionChange = (arrs) => {
     contractId: item.contractId,
     applyType: item.applyType,
     isSign: item.isSign,
+    contractSubFlowStatus: item.contractSubFlowStatus,
     projectId: item.projectId
   }
 }
@@ -208,6 +219,14 @@ const processSubmit = async (): Promise<void> => {
     ElMessage.warning('该合同不能签合同,无法发起合同签订!')
     return
   }
+  if (currentProcess.value?.contractSubFlowStatus === 2) {
+    ElMessage.warning('该合同签订中,无法再发起合同签订!')
+    return
+  }
+  if (currentProcess.value?.contractSubFlowStatus === 1) {
+    ElMessage.warning('该合同已签合同,无法再发起合同签订!')
+    return
+  }
   if (currentProcess.value?.applyType === 1) {
     urlApi = `/subcontract/process`
   } else if (currentProcess.value?.applyType === 2) {
@@ -226,8 +245,21 @@ const processSubmit = async (): Promise<void> => {
     })
 }
 const useMoneySubmit = (): void => {
+  if (currentProcess.value?.isSign == 1) {
+    ElMessageBox.alert('是否前往合同详情页面发起用款申请!', '发起用款', {
+      confirmButtonText: '发起',
+      callback: (action: any) => {
+        if (action === 'confirm') {
+          operateClick({
+            projectId: currentProcess.value?.projectId,
+            contractId: currentProcess.value?.contractId
+          })
+        }
+      }
+    })
+    return
+  }
   const urlApi: string = '/UseMoney/contractProcess'
-  console.log(currentProcess.value)
   request
     .get(
       {
@@ -258,6 +290,11 @@ const operateClick = (row: any) => {
     query: { id: row.projectId, contractId: row.contractId }
   })
 }
+const openFlowPage = (row: any) => {
+  openProcessFlow(router, row.instanceId, {
+    title: '查看申请流程'
+  })
+}
 onMounted(() => {
   tableHeight.value = tableRef.value.clientHeight
 })

+ 1 - 1
client/src/views/OaSystem/projectCenter/projectDetail/components/xmht/ContractReturnedMoney.vue

@@ -60,7 +60,7 @@ const processLookHandle = (row) => {
             {{ getDictLabel(DICT_TYPE.INVOICE_OUT_STATUS, item['flowStatus']) }}
           </td>
           <td>{{ item['invoiceAmount'] }}</td>
-          <td>{{ item['actualReturnAmount'] }}</td>
+          <td>{{ item['returnAmount'] }}</td>
           <td>{{ item['invoiceContent'] }}</td>
           <td>{{ item['invoiceDate'] }}</td>
           <td>{{ item['invoiceNo'] }}</td>

+ 1 - 2
client/src/views/OaSystem/projectCenter/projectDetail/components/xmht/index.vue

@@ -27,8 +27,7 @@
             v-if="projectPermis.projectPermisState.all || projectPermis.projectPermisState.xsLeader"
             @click="
               startUseMoneyMuate({
-                projectId: mContractDetail?.projectId,
-                supplierId: mContractDetail?.clientId
+                projectId: mContractDetail?.projectId
               })
             "
             >用款申请</li