ソースを参照

feat: 合同管理部分对接接口,修复考勤统计表部分显示问题

qiny 1 年間 前
コミット
70892063fb

+ 16 - 0
client/src/router/modules/remaining.ts

@@ -344,6 +344,22 @@ const remainingRouter: AppRouteRecordRaw[] = [
         meta: {
           title: '薪资管理'
         }
+      },
+      {
+        path: 'departmentalSalary',
+        component: () => import('@/views/OaSystem/salaryManagement/DepartmentalSalary/index.vue'),
+        name: 'departmentalSalary',
+        meta: {
+          title: '部门薪资'
+        }
+      },
+      {
+        path: 'mySalary',
+        component: () => import('@/views/OaSystem/salaryManagement/MySalary/index.vue'),
+        name: 'mySalary',
+        meta: {
+          title: '我的薪资'
+        }
       }
     ]
   },

+ 29 - 28
client/src/utils/PubsubService.ts

@@ -3,50 +3,51 @@
  * 一个简单的发布者、订阅者模式,提供了发布、订阅、删除的方法
  * from chinyan
  */
-const PubsubService = (function () {
-  const topics: Record<string, ((params?: any) => void)[]> = {}
+class PubsubService {
+  private topics: Record<string, ((params?: any) => void)[]> = {}
 
-  function publish(topic: string, data: any) {
-    if (!topics[topic]) return
-    topics[topic].forEach((fn) => fn(data))
+  // 发布事件
+  publish(topic: string, data: any) {
+    if (!this.topics[topic]) return
+    this.topics[topic].forEach((fn) => fn(data))
   }
 
-  function subscribe(topic: string, callback: (params?: any) => void) {
-    if (!topics[topic]) {
-      topics[topic] = []
+  // 订阅事件
+  subscribe(topic: string, callback: (params?: any) => void) {
+    if (!this.topics[topic]) {
+      this.topics[topic] = []
     }
 
-    if (topics[topic].includes(callback)) {
-      return // 已经订阅过,不重复添加
+    if (!this.topics[topic].includes(callback)) {
+      this.topics[topic].push(callback)
     }
 
-    topics[topic].push(callback)
-
-    return function unsubscribe() {
-      const index = topics[topic].indexOf(callback)
+    // 返回取消订阅的方法
+    return () => {
+      const index = this.topics[topic].indexOf(callback)
       if (index !== -1) {
-        topics[topic].splice(index, 1)
+        this.topics[topic].splice(index, 1)
       }
     }
   }
 
-  function clearAllSub() {
-    for (const key in topics) {
-      topics[key] = []
-    }
+  // 清空所有订阅者
+  clearAllSub() {
+    this.topics = {}
   }
 
   // 清空某个主题的订阅者
-  function clearSubsByTopic(topic: string) {
-    topics[topic] = []
+  clearSubsByTopic(topic: string) {
+    if (this.topics[topic]) {
+      this.topics[topic] = []
+    }
   }
 
-  return {
-    publish,
-    subscribe,
-    clearSubsByTopic,
-    clearAllSub
+  // 判断是否有某个主题的订阅者
+  hasSubsByTopic(topic: string) {
+    return this.topics[topic] && this.topics[topic].length > 0
   }
-})()
+}
 
-export default PubsubService
+// 实例化并导出单例
+export default new PubsubService()

+ 6 - 1
client/src/views/OaSystem/attendanceCenter/dep.vue

@@ -518,12 +518,17 @@ onMounted(() => {
 
       .spans {
         width: 100%;
-        height: 100%;
+        height: 24px;
         font-size: 14px !important;
         font-weight: 800;
         color: #f23c3c;
         cursor: pointer;
         user-select: none;
+        margin: 0;
+        padding: 0;
+        display: flex;
+        justify-content: center;
+        align-items: center;
       }
 
       .sw {

+ 20 - 13
client/src/views/OaSystem/contractManagement/ContractChange/index.vue

@@ -19,44 +19,51 @@ defineOptions({
 
 const pageKey = 'contract-change'
 const request = {
-  url: '',
-  params: {}
+  url: '/contractF/page',
+  params: {
+    type: 1 // 类型(1变更 2解除 3撤销 4终止 5纠纷)
+  }
 }
 const column = [
-  {
-    label: '日期',
-    prop: 'date'
-  },
   {
     label: '合同编号',
-    prop: 'code'
+    prop: 'contractNumber'
+    // width: 190
   },
   {
     label: '合同名称',
-    prop: 'name',
+    prop: 'contractName',
+    // width: 300,
     tooltip: true
   },
   {
     label: '变更内容',
-    prop: 'content',
+    prop: 'changeDetail',
+    // width: 280,
     tooltip: true
   },
   {
     label: '原合同金额(万元)',
-    prop: 'money'
+    prop: 'contractAmount',
+    width: 200,
+    align: 'center'
   },
   {
     label: '变更金额(万元)',
-    prop: 'changeMoney'
+    prop: 'changeAmount',
+    width: 200,
+    align: 'center'
   },
   {
     label: '变更原因',
-    prop: 'type',
+    prop: 'changeReason',
+    // width: 300,
     tooltip: true
   },
   {
     label: '备注',
-    prop: 'other',
+    prop: 'bz',
+    // width: 300,
     tooltip: true
   }
 ]

+ 13 - 13
client/src/views/OaSystem/contractManagement/ContractDispute/index.vue

@@ -19,44 +19,44 @@ defineOptions({
 
 const pageKey = 'contract-dispute'
 const request = {
-  url: '',
-  params: {}
+  url: '/contractF/page',
+  params: {
+    type: 5 // 类型(1变更 2解除 3撤销 4终止 5纠纷)
+  }
 }
 const column = [
-  {
-    label: '日期',
-    prop: 'date'
-  },
   {
     label: '合同编号',
-    prop: 'code'
+    prop: 'contractNumber'
   },
   {
     label: '合同名称',
-    prop: 'name',
+    prop: 'contractName',
     tooltip: true
   },
   {
     label: '纠纷原因',
-    prop: 'content',
+    prop: 'changeReason',
     tooltip: true
   },
   {
     label: '原合同金额(万元)',
-    prop: 'money'
+    prop: 'contractAmount',
+    width: 200
   },
   {
     label: '纠纷金额(万元)',
-    prop: 'changeMoney'
+    prop: 'changeAmount',
+    width: 200
   },
   {
     label: '解决争议方式',
-    prop: 'type',
+    prop: 'changeDetail',
     tooltip: true
   },
   {
     label: '备注',
-    prop: 'other',
+    prop: 'bz',
     tooltip: true
   }
 ]

+ 13 - 13
client/src/views/OaSystem/contractManagement/RescindContract/index.vue

@@ -19,44 +19,44 @@ defineOptions({
 
 const pageKey = 'rescind-contract'
 const request = {
-  url: '',
-  params: {}
+  url: '/contractF/page',
+  params: {
+    type: 3 // 类型(1变更 2解除 3撤销 4终止 5纠纷)
+  }
 }
 const column = [
-  {
-    label: '日期',
-    prop: 'date'
-  },
   {
     label: '合同编号',
-    prop: 'code'
+    prop: 'contractNumber'
   },
   {
     label: '合同名称',
-    prop: 'name',
+    prop: 'contractName',
     tooltip: true
   },
   {
     label: '撤销原因',
-    prop: 'content',
+    prop: 'changeReason',
     tooltip: true
   },
   {
     label: '原合同金额(万元)',
-    prop: 'money'
+    prop: 'contractAmount',
+    width: 200
   },
   {
     label: '撤销金额(万元)',
-    prop: 'changeMoney'
+    prop: 'changeAmount',
+    width: 200
   },
   {
     label: '撤销方式',
-    prop: 'type',
+    prop: 'changeDetail',
     tooltip: true
   },
   {
     label: '备注',
-    prop: 'other',
+    prop: 'bz',
     tooltip: true
   }
 ]

+ 13 - 13
client/src/views/OaSystem/contractManagement/TerminateContract/index.vue

@@ -19,44 +19,44 @@ defineOptions({
 
 const pageKey = 'terminate-contract'
 const request = {
-  url: '',
-  params: {}
+  url: '/contractF/page',
+  params: {
+    type: 2 // 类型(1变更 2解除 3撤销 4终止 5纠纷)
+  }
 }
 const column = [
-  {
-    label: '日期',
-    prop: 'date'
-  },
   {
     label: '合同编号',
-    prop: 'code'
+    prop: 'contractNumber'
   },
   {
     label: '合同名称',
-    prop: 'name',
+    prop: 'contractName',
     tooltip: true
   },
   {
     label: '解除原因',
-    prop: 'content',
+    prop: 'changeReason',
     tooltip: true
   },
   {
     label: '原合同金额(万元)',
-    prop: 'money'
+    prop: 'contractAmount',
+    width: 200
   },
   {
     label: '解除金额(万元)',
-    prop: 'changeMoney'
+    prop: 'changeAmount',
+    width: 200
   },
   {
     label: '解除方式',
-    prop: 'type',
+    prop: 'changeDetail',
     tooltip: true
   },
   {
     label: '备注',
-    prop: 'other',
+    prop: 'bz',
     tooltip: true
   }
 ]

+ 12 - 12
client/src/views/OaSystem/contractManagement/TerminationOfContract/index.vue

@@ -19,39 +19,39 @@ defineOptions({
 
 const pageKey = 'termination-Of-contract'
 const request = {
-  url: '',
-  params: {}
+  url: '/contractF/page',
+  params: {
+    type: 4 // 类型(1变更 2解除 3撤销 4终止 5纠纷)
+  }
 }
 const column = [
-  {
-    label: '日期',
-    prop: 'date'
-  },
   {
     label: '合同编号',
-    prop: 'code'
+    prop: 'contractNumber'
   },
   {
     label: '合同名称',
-    prop: 'name',
+    prop: 'contractName',
     tooltip: true
   },
   {
     label: '终止原因',
-    prop: 'content',
+    prop: 'changeReason',
     tooltip: true
   },
   {
     label: '原合同金额(万元)',
-    prop: 'money'
+    prop: 'contractAmount',
+    width: 200
   },
   {
     label: '终止金额(万元)',
-    prop: 'changeMoney'
+    prop: 'changeAmount',
+    width: 200
   },
   {
     label: '备注',
-    prop: 'other',
+    prop: 'bz',
     tooltip: true
   }
 ]

+ 27 - 15
client/src/views/OaSystem/contractManagement/components/Form.vue

@@ -1,18 +1,19 @@
 <template>
   <el-form :inline="true" class="searchBox">
-    <el-form-item label="合同日期:" class="form">
+    <el-form-item label="合同日期:" class="form select-date">
       <el-date-picker
-        v-model="queryParams.date"
-        type="date"
-        placeholder="请选择月份"
-        :clearable="false"
+        v-model="queryParams.contractTime"
+        type="daterange"
+        range-separator="到"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"
       />
     </el-form-item>
     <el-form-item label="合同编号" class="form">
-      <el-input v-model="queryParams.code" clearable />
+      <el-input v-model="queryParams.contractNumber" clearable />
     </el-form-item>
     <el-form-item label="合同名称" class="form project-name">
-      <el-input v-model="queryParams.name" clearable />
+      <el-input v-model="queryParams.contractName" clearable />
     </el-form-item>
     <el-form-item class="search-button">
       <el-button type="primary" :icon="Search" @click="onSearchHandle">查询</el-button>
@@ -34,20 +35,28 @@ interface IProps {
 const { pageKey } = defineProps<IProps>()
 
 interface IQuery {
-  date: string // 合同日期
-  code: string // 合同编号
-  name: string // 合同名称
+  contractTime: string[] // 合同日期
+  contractNumber: string // 合同编号
+  contractName: string // 合同名称
 }
 const queryParams = reactive<IQuery>({
-  date: moment().format('YYYY-MM-DD'),
-  code: '',
-  name: ''
+  contractTime: [],
+  contractNumber: '',
+  contractName: ''
 })
 
 // 查询
 const onSearchHandle: () => void = () => {
-  queryParams.date = moment(queryParams.date).format('YYYY-MM-DD')
-  const params = { ...queryParams }
+  queryParams.contractTime =
+    queryParams.contractTime?.length > 0
+      ? [
+          moment(queryParams.contractTime[0]).format('YYYY-MM-DD') + ' 00:00:00',
+          moment(queryParams.contractTime[1]).format('YYYY-MM-DD') + ' 23:59:59'
+        ]
+      : []
+  const params = {
+    ...queryParams
+  }
   // 发布查询事件
   PubsubService.publish(pageKey, params)
   // onSearch?.(queryParams)
@@ -55,6 +64,9 @@ const onSearchHandle: () => void = () => {
 </script>
 
 <style scoped lang="scss">
+.select-date {
+  width: 330px !important;
+}
 .project-name {
   width: 400px !important;
 }

+ 34 - 17
client/src/views/OaSystem/contractManagement/components/Table.vue

@@ -12,9 +12,14 @@
           height: '50px'
         }"
       >
-        <el-table-column label="序号" width="60" align="center" v-if="showIndex">
+        <el-table-column label="序号" width="60" align="center">
           <template #default="scope">{{ scope.$index + 1 }}</template>
         </el-table-column>
+        <el-table-column label="日期" width="130">
+          <template #default="scope">{{
+            moment(scope.row.createTime).format('YYYY-MM-DD')
+          }}</template>
+        </el-table-column>
         <el-table-column
           v-for="item in column"
           :key="item.prop"
@@ -22,25 +27,27 @@
           :label="item.label"
           :width="item.width"
           :align="item.align"
+          :show-overflow-tooltip="item.tooltip"
         />
       </el-table>
     </div>
-    <div class="pageBox" v-if="dataSource.length > 0">
-      <el-pagination
-        :page-size="20"
-        background
-        layout="total, prev, pager, next"
-        :total="pageTotal"
-        :current-page="pageNo"
-        @current-change="currentChange"
-      />
-    </div>
+  </div>
+  <div class="pageBox" v-if="dataSource.length > 0">
+    <el-pagination
+      :page-size="20"
+      background
+      layout="total, prev, pager, next"
+      :total="pageTotal"
+      :current-page="pageNo"
+      @current-change="currentChange"
+    />
   </div>
 </template>
 <script lang="ts" setup>
 import { ref, onMounted } from 'vue'
 import http from '@/config/axios'
 import PubsubService from '@/utils/PubsubService'
+import moment from 'moment'
 
 interface ITable {
   pageKey: string // 页面的唯一标识
@@ -60,7 +67,7 @@ interface ITable {
 }
 
 const props = defineProps<ITable>()
-const { pageKey, request, column, showIndex } = props
+const { pageKey, request, column } = props
 
 const loading = ref(false)
 const dataSource = ref([])
@@ -90,17 +97,23 @@ onMounted(() => {
 
 onBeforeUnmount(() => {
   window.removeEventListener('resize', updateTableHeight)
+  // 取消订阅
+  if (PubsubService.hasSubsByTopic(pageKey)) {
+    PubsubService.clearSubsByTopic(pageKey)
+  }
 })
-
 // 获取数据
 const getDataSource = (params = {}) => {
   if (!request.url || request.url == '') return
   loading.value = true
   http
-    .get({
-      url: request.url,
-      params: { ...request.params, ...params, pageNo: pageNo.value, pageSize: 20 }
-    })
+    .get(
+      {
+        url: request.url,
+        params: { ...request.params, ...params, pageNo: pageNo.value, pageSize: 20 }
+      },
+      '/business'
+    )
     .then((res) => {
       ElMessage.success(`数据查询成功`)
       loading.value = false
@@ -123,8 +136,12 @@ const currentChange = (page) => {
 <style scoped lang="scss">
 .tableBox {
   margin-top: 10px;
+  width: 100%;
+  overflow-x: auto;
 }
 .pageBox {
   margin-top: 10px;
+  display: flex;
+  justify-content: flex-end;
 }
 </style>

+ 63 - 0
client/src/views/OaSystem/contractManagement/interface.ts

@@ -0,0 +1,63 @@
+export interface ContractFVO {
+  /**
+   * 创建时间
+   */
+  createTime?: number
+  /**
+   * 备注
+   */
+  bz?: null | string
+  /**
+   * 金额(万元)
+   */
+  changeAmount?: number | null
+  /**
+   * 内容 / 解决方式
+   */
+  changeDetail?: null | string
+  /**
+   * 原因
+   */
+  changeReason?: null | string
+  /**
+   * 原合同金额(万元)
+   */
+  contractAmount?: number | null
+  /**
+   * 合同id
+   */
+  contractId?: null | string
+  /**
+   * 合同名称
+   */
+  contractName?: null | string
+  /**
+   * 合同编号
+   */
+  contractNumber?: null | string
+  /**
+   * 部门ID
+   */
+  deptId?: null | string
+  /**
+   * 部门名称
+   */
+  deptName?: null | string
+  /**
+   * 主键ID
+   */
+  id?: null | string
+  /**
+   * 用户昵称
+   */
+  nickname?: null | string
+  /**
+   * 类型(1变更  2解除 3撤销 4终止 5纠纷)
+   */
+  type?: number | null
+  /**
+   * 用户ID
+   */
+  userId?: null | string
+  [property: string]: any
+}

+ 9 - 0
client/src/views/OaSystem/salaryManagement/DepartmentalSalary/index.vue

@@ -0,0 +1,9 @@
+<template>
+  <div>部门薪资</div>
+</template>
+<script lang="ts" setup>
+/**
+ * @description 部门薪资
+ */
+</script>
+<style scoped lang="scss"></style>

+ 9 - 0
client/src/views/OaSystem/salaryManagement/MySalary/index.vue

@@ -0,0 +1,9 @@
+<template>
+  <div>我的薪资</div>
+</template>
+<script lang="ts" setup>
+/**
+ * @description 我的薪资
+ */
+</script>
+<style scoped lang="scss"></style>

+ 9 - 0
client/src/views/OaSystem/salaryManagement/components/SearchForm.vue

@@ -0,0 +1,9 @@
+<template>
+  <div>查询表单</div>
+</template>
+<script lang="ts" setup>
+/**
+ * @description 查询表单
+ */
+</script>
+<style scoped lang="scss"></style>

+ 9 - 3
client/src/views/OaSystem/salaryManagement/components/TemplateImport.vue

@@ -1,6 +1,6 @@
 <template>
-  <el-dialog title="导入工资表" v-model="dialogVisible" width="500px" :show-close="false">
-    <el-form :model="formData" label-width="100px">
+  <el-dialog title="导入工资表" v-model="dialogVisible" width="350px" :show-close="false">
+    <el-form :model="formData" label-width="100px" class="template-form">
       <el-form-item label="选择导入月份">
         <el-date-picker
           v-model="importDate"
@@ -50,4 +50,10 @@ const submitForm = () => {
   dialogVisible.value = false
 }
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.template-form {
+  :deep(.el-input) {
+    width: 180px;
+  }
+}
+</style>

+ 1 - 1
client_h5/src/pages/myLogs/Daily/MyLogs.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="log-calendar">
     <van-calendar
-      title="手机端仅能查看近两个月填报情况"
+      title="手机端仅能查看近三个月内填报情况"
       :show-title="true"
       :poppable="false"
       :show-confirm="false"