lineup.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <div class="app-container">
  3. <search-form
  4. :list-loading="listLoading"
  5. @change="searchHandle"
  6. />
  7. <table-list
  8. :list-loading="listLoading"
  9. :data="tableData2"
  10. :columns="listConfig"
  11. :current-page="currentPage"
  12. :page-size="pageSize"
  13. :total-records="totalRecords"
  14. @currentChange="pageHandle"
  15. :operationsDefaultLength="6"
  16. />
  17. <popup-edit
  18. :isShow="isDtlShow"
  19. :curObj="curObj"
  20. @close="closePopup"
  21. />
  22. </div>
  23. </template>
  24. <script>
  25. import { arrToObj } from '@/utils'
  26. import SearchForm from './components/searchForm/Lineup'
  27. import PopupEdit from './components/popup/LineupEdit'
  28. import baseTable from '_m/baseTable.js'
  29. export default {
  30. name: 'index',
  31. components: {
  32. SearchForm,
  33. PopupEdit,
  34. },
  35. provide() {
  36. return {
  37. parentData: this
  38. }
  39. },
  40. mixins: [baseTable],
  41. data() {
  42. return {
  43. apiStr: 'user.admreceptsalelist',
  44. searchForm: {},
  45. isDtlShow: false,
  46. curObj: {},
  47. noCreated: true,
  48. }
  49. },
  50. computed: {
  51. tableData2() {
  52. const arr = [...this.tableData]
  53. arr.map(item => {
  54. })
  55. return arr
  56. }
  57. },
  58. created() {
  59. this.searchForm = {
  60. store_type: 'hqc1'
  61. }
  62. this.fetchData()
  63. },
  64. mounted() {
  65. this.listConfig = {
  66. rows: [
  67. { label: '最新轮值', prop: 'recept_create_at' },
  68. { label: '轮值总次数', prop: 'recept_count' },
  69. { label: '置业经理', prop: 'sale_name' },
  70. { label: '头像', prop: 'sale_avatar', type: 'img' },
  71. { label: '门店', prop: 'store_type', type: 'flag', flags: arrToObj(this.$dictData.store_type ) },
  72. { label: '分类', prop: 'sale_type', type: 'flag', flags: arrToObj(this.$dictData.sale_type ) },
  73. { label: '操作', width: 90, type: 'handle2', operations:
  74. [
  75. { label: '轮值记录', func: this.linkRecord, btnType: 'success' },
  76. ]
  77. }
  78. ]
  79. }
  80. },
  81. methods: {
  82. linkRecord (row) {
  83. this.$router.push(`/cust/lineUpRecord?id=${row.id}&name=${row.sale_name}`)
  84. },
  85. delHandle(row) {
  86. this.$msg(`您确定要删除该规则吗?`, 'confirm', () => {
  87. this.$api.user.admsaleuserdel({
  88. id: row.id
  89. }).then(data => {
  90. this.$msgs(`已删除!`)
  91. this.fetchData()
  92. })
  93. }, null, true)
  94. },
  95. openPopup(row) {
  96. if (row && row.id) {
  97. this.curObj = row
  98. } else {
  99. this.curObj = {}
  100. }
  101. this.isDtlShow = true
  102. },
  103. closePopup(obj) {
  104. this.isDtlShow = false
  105. if (obj) {
  106. this.fetchData()
  107. }
  108. }
  109. }
  110. }
  111. </script>