index.vue 3.8 KB

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