Reimburse.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <script setup lang="ts">
  2. import { ref, reactive } from 'vue'
  3. import { ElMessage } from 'element-plus'
  4. import ReimburseFrom from './ReimburseFrom.vue'
  5. import { GlobalStore } from '@/stores/index'
  6. import { Reimburse_UserList } from '@/api/Reimburse/index'
  7. import TableBase from '@/components/TableBase/index.vue'
  8. import { ColumnProps } from '@/components/TableBase/interface/index'
  9. import { useTablePublic } from '@/hooks/useTablePublic'
  10. const data = reactive({
  11. fromDatas:{T_uuid:''}
  12. })
  13. let date = new Date()
  14. const year = date.getFullYear()
  15. const month = date.getMonth()
  16. const salaryFromData = reactive({
  17. year: year + '',
  18. month: (month < 10 ? '0' : '') + month,
  19. T_uuid: ''
  20. })
  21. const globalStore = GlobalStore()
  22. const TableRef = ref<InstanceType<typeof TableBase> | null>(null)
  23. const ReimburseFromRef = ref<InstanceType<typeof ReimburseFrom> | null>(null)
  24. const { tableRowClassName } = useTablePublic()
  25. const tableRowClassNameHandle = (data: any): any => tableRowClassName(data.row.T_uuid, salaryFromData.T_uuid)
  26. // 搜索以及参数
  27. const columns: ColumnProps[] = [
  28. { prop: 'T_name', label: '姓名' },
  29. // { prop: 'T_post_name', label: '职位' },
  30. { prop: 'T_wait_audit', label: '状态' }
  31. ]
  32. const searchs = reactive({
  33. T_name: '',
  34. T_dept: ''
  35. })
  36. const initParam = {
  37. User_tokey: globalStore.GET_User_tokey,
  38. T_name: '',
  39. T_dept: ''
  40. }
  41. const searchHandle = () => {
  42. initParam.T_name = searchs.T_name
  43. initParam.T_dept = searchs.T_dept
  44. TableRef.value?.searchTable()
  45. }
  46. const getSalaryParams = (row: any) => {
  47. console.log('点击222',row.T_uuid)
  48. userInfo.name = row.T_name
  49. userInfo.T_dept = row.T_dept_name
  50. userInfo.T_post = row.T_post_name
  51. salaryFromData.T_uuid = row.T_uuid
  52. data.fromDatas.T_uuid = row.T_uuid //yj
  53. getSalary()
  54. }
  55. const getSalary = async () => {
  56. console.log('点击')
  57. }
  58. const userInfo = reactive({
  59. squareUrl: 'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png',
  60. name: '',
  61. T_dept: '',
  62. T_post: ''
  63. })
  64. </script>
  65. <template>
  66. <div class="salary">
  67. <div style="width: 290px" class="salary-table">
  68. <TableBase
  69. ref="TableRef"
  70. :columns="columns"
  71. :requestApi="Reimburse_UserList"
  72. :initParam="initParam"
  73. layout="prev, pager, next"
  74. :rowClick="getSalaryParams"
  75. :tableRowClassName="tableRowClassNameHandle">
  76. <template #table-header>
  77. <el-row :gutter="24" class="input-suffix margin-left-0 margin-right-0">
  78. <el-col :span="24" class="d-flex padding-right-0 padding-left-0">
  79. <span class="inline-flex">姓名:</span>
  80. <el-input v-model="searchs.T_name" type="text" />
  81. <el-button type="primary" @click="searchHandle" style="margin-left: 5px;">搜索</el-button>
  82. </el-col>
  83. </el-row>
  84. </template>
  85. </TableBase>
  86. </div>
  87. <el-row class="h-100 f-1 margin-left-3">
  88. <el-col :span="24" class="h-100" style="overflow: hidden; display: flex; flex-direction: column">
  89. <el-card class="b-r m-b-3">
  90. <h3 class="title m-b-5">员工基本信息</h3>
  91. <div class="info-content">
  92. <el-avatar shape="square" size="large" :src="userInfo.squareUrl" />
  93. <div class="info-name">
  94. <h4>名字:{{ userInfo.name }}</h4>
  95. <h4>
  96. <span>部门:{{ userInfo.T_dept }}</span>
  97. <span>岗位:{{ userInfo.T_post }}</span>
  98. </h4>
  99. </div>
  100. </div>
  101. </el-card>
  102. <ReimburseFrom ref="ReimburseFromRef" :fromDatas="data.fromDatas"></ReimburseFrom>
  103. </el-col>
  104. </el-row>
  105. </div>
  106. </template>
  107. <style scoped lang="scss">
  108. @import './index.scss';
  109. </style>