index.tsx 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. import { Cell, Grid, GridItem } from 'vant'
  2. import { defineComponent, onMounted, reactive, ref } from 'vue'
  3. import styles from '../index.module.less'
  4. import iconSubsidy from '../images/icon-subsidy.png'
  5. import iconNews from '../images/icon-news.png'
  6. import iconPhoto from '../images/icon-photo.png'
  7. import request from '@/helpers/request'
  8. import { state } from '@/state'
  9. import OFullRefresh from '@/components/o-full-refresh'
  10. interface ISalaryRecord {
  11. /**学校补助确认记录ID */
  12. id: string
  13. /**练习补助 */
  14. trainingSalary: number | string
  15. /**课程训练补助 */
  16. courseSalary: number | string
  17. /**一周开始日期 */
  18. startDate: string
  19. /**一周结束日期 */
  20. endDate: string
  21. /**已发练习补助 */
  22. issueTrainingSalary: number | string
  23. /**结算状态 */
  24. withdrawalStatus: 'WAIT' | 'SETTLED' | 'PART_SETTLED' | 'SETTLE_FAIL'
  25. /**管理补助 */
  26. manageSalary: number | string
  27. /**已发课程训练补助 */
  28. issueCourseSalary: number | string
  29. /**已发管理补助 */
  30. issueManageSalary: number | string
  31. }
  32. export default defineComponent({
  33. name: 'approval-manage-agency',
  34. setup() {
  35. const data = reactive({
  36. salaryRecordList: [{}] as ISalaryRecord[],
  37. /**训练照片 */
  38. schoolWeekPhoto: {
  39. /**预计的训练照片数 */
  40. expectPhotoNum: 0,
  41. /**结束日期 */
  42. endDate: '',
  43. /**开始日期 */
  44. startDate: '',
  45. /**训练照片数 */
  46. photoNum: 0
  47. },
  48. /**乐团资讯 */
  49. schoolWeekNews: {
  50. //
  51. /**乐团资讯数 */
  52. newsNum: 0,
  53. /**结束日期 */
  54. endDate: '',
  55. /**开始日期 */
  56. startDate: '',
  57. /**预计的乐团资讯数 */
  58. expectNewsNum: 0
  59. }
  60. })
  61. const refreshing = ref(false)
  62. const getData = async () => {
  63. try {
  64. const res: any = await request.post(`${state.platformApi}/schoolWeekSalaryRecord/manage`)
  65. } catch (error) {}
  66. refreshing.value = false
  67. }
  68. onMounted(() => {
  69. getData()
  70. })
  71. return () => (
  72. <OFullRefresh
  73. v-model:modelValue={refreshing.value}
  74. onRefresh={getData}
  75. style="min-height: calc(100vh - var(--van-nav-bar-height) - var(--header-height))"
  76. >
  77. <div class={styles.wrap}>
  78. {data.salaryRecordList.map((item: ISalaryRecord) => {
  79. return (
  80. <div class={styles.item} style={{ marginTop: 0 }}>
  81. <Cell
  82. center
  83. label={`${item.startDate} 至 ${item.endDate}`}
  84. isLink
  85. to={'/approval-manage-subsidy?salaryId=' + (item.id || '')}
  86. >
  87. {{
  88. title: () => (
  89. <div class={styles.itemTitle}>
  90. <img class={styles.titleIcon} src={iconSubsidy} />
  91. <span>补助确认</span>
  92. </div>
  93. )
  94. }}
  95. </Cell>
  96. <Grid class={styles.grid} columnNum={3} border={false}>
  97. <GridItem>
  98. <div class={styles.gridItem}>
  99. <div class={styles.gridItemTop}>
  100. <span class={styles.topNum}>{item.manageSalary}</span>元
  101. </div>
  102. <div>管理补助</div>
  103. </div>
  104. </GridItem>
  105. <GridItem>
  106. <div class={styles.gridItem}>
  107. <div class={styles.gridItemTop}>
  108. <span class={styles.topNum}>{item.courseSalary}</span>元
  109. </div>
  110. <div>训练补助</div>
  111. </div>
  112. </GridItem>
  113. <GridItem>
  114. <div class={styles.gridItem}>
  115. <div class={styles.gridItemTop}>
  116. <span class={styles.topNum}>{item.trainingSalary}</span>元
  117. </div>
  118. <div>练习奖励</div>
  119. </div>
  120. </GridItem>
  121. </Grid>
  122. </div>
  123. )
  124. })}
  125. <div class={styles.item}>
  126. <Cell
  127. style={{ '--van-cell-value-color': '#333' }}
  128. center
  129. label={`${data.schoolWeekPhoto.startDate} 至 ${data.schoolWeekPhoto.endDate}`}
  130. value={data.schoolWeekPhoto.photoNum + '/' + data.schoolWeekPhoto.expectPhotoNum}
  131. isLink
  132. >
  133. {{
  134. title: () => (
  135. <div class={styles.itemTitle}>
  136. <img class={styles.titleIcon} src={iconNews} />
  137. <span>训练照片</span>
  138. </div>
  139. )
  140. }}
  141. </Cell>
  142. </div>
  143. <div class={styles.item}>
  144. <Cell
  145. style={{ '--van-cell-value-color': '#333' }}
  146. center
  147. label={`${data.schoolWeekNews.startDate} 至 ${data.schoolWeekNews.endDate}`}
  148. value={data.schoolWeekNews.newsNum + '/' + data.schoolWeekNews.expectNewsNum}
  149. isLink
  150. >
  151. {{
  152. title: () => (
  153. <div class={styles.itemTitle}>
  154. <img class={styles.titleIcon} src={iconPhoto} />
  155. <span>乐团资讯</span>
  156. </div>
  157. )
  158. }}
  159. </Cell>
  160. </div>
  161. </div>
  162. </OFullRefresh>
  163. )
  164. }
  165. })