index.vue 3.5 KB

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