index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div>
  3. <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
  4. <m-table
  5. v-loading="loading"
  6. :items="items"
  7. :headers="headers"
  8. :page-size="pageInfo.size"
  9. :page-current="pageInfo.current"
  10. :total="total"
  11. @page-change="onPageChange"
  12. >
  13. <template #actions="{ row }">
  14. <m-button type="primary" text @click="onClaim(row)">分润认领</m-button>
  15. </template>
  16. </m-table>
  17. <ClaimForm ref="claimFormRef" @success="onInit" />
  18. </div>
  19. </template>
  20. <script>
  21. import { dateFormat } from '@/utils/date'
  22. import { getProfitSharingClaim } from '@/api/salary'
  23. import ClaimForm from '../components/form.vue'
  24. export default {
  25. name: 'salaryClaimSharing',
  26. components: {
  27. ClaimForm
  28. },
  29. data () {
  30. return {
  31. searchItems: [
  32. {
  33. label: '月份',
  34. prop: 'month',
  35. type: 'datePicker',
  36. options: {
  37. clearable: false,
  38. type: 'month',
  39. format: 'yyyy-MM',
  40. valueFormat: 'yyyy-MM',
  41. placeholder: '选择查询月份'
  42. }
  43. },
  44. {
  45. label: '客户编号',
  46. prop: 'customerId',
  47. type: 'input',
  48. options: {
  49. placeholder: '请输入客户编号'
  50. }
  51. },
  52. {
  53. label: '科目名称',
  54. prop: 'subjectName',
  55. type: 'input',
  56. options: {
  57. placeholder: '请输入科目名称'
  58. }
  59. }
  60. ],
  61. searchValues: {
  62. subjectName: null,
  63. customerId: null,
  64. month: dateFormat('YYYY-mm', new Date())
  65. },
  66. headers: [
  67. { label: '客户编号', prop: 'customerId' },
  68. { label: '一级科目编码/名称', prop: 'oneLevelSubject' },
  69. { label: '二级科目编码/名称', prop: 'twoLevelSubject' },
  70. { label: '金额', prop: 'amount' },
  71. { label: '机构名称', prop: 'organizationName' },
  72. { label: '统一认证号1', prop: 'unifiedCertificationNumber1' },
  73. { label: '员工姓名1', prop: 'employeeName1' },
  74. { label: '统一认证号2', prop: 'unifiedCertificationNumber2' },
  75. { label: '员工姓名2', prop: 'employeeName2' },
  76. { label: '数据日期', prop: 'dataDate' },
  77. { label: '管户层级标识', prop: 'customerLevelIdentifier' },
  78. { label: '客户类别标识', prop: 'customerCategoryIdentifier' },
  79. { label: '员工分润比例', prop: 'employeeProfitSharingRatio' },
  80. { label: '操作', prop: 'actions', fixed: 'right' }
  81. ],
  82. items: [],
  83. total: 0,
  84. pageInfo: {
  85. current: 1,
  86. size: 10
  87. },
  88. loading: false
  89. }
  90. },
  91. created () {
  92. this.onInit()
  93. },
  94. methods: {
  95. async onInit () {
  96. this.loading = true
  97. try {
  98. const { data } = await getProfitSharingClaim({
  99. ...this.pageInfo,
  100. ...this.searchValues
  101. })
  102. this.items = data.records
  103. this.total = data.total
  104. } catch (error) {
  105. this.$message.error(error)
  106. } finally {
  107. this.loading = false
  108. }
  109. },
  110. onClaim (item) {
  111. this.$refs.claimFormRef.open(item)
  112. },
  113. onSearch () {
  114. this.pageInfo.current = 1
  115. this.onInit()
  116. },
  117. onPageChange (index) {
  118. this.pageInfo.current = index
  119. this.onInit()
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. /* 自定义样式 */
  126. </style>