index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <div class="customer-management">
  3. <a-tabs v-model:activeKey="activeKey" class="tabs">
  4. <a-tab-pane v-for="(item, index) in tabsOptions" :key="index">
  5. <template #tab>
  6. <span @click="item.onClick(item.params)">
  7. <component :is="item.icon"></component>
  8. {{ item.title }}
  9. </span>
  10. </template>
  11. </a-tab-pane>
  12. </a-tabs>
  13. <bs-table v-bind="tableOptions">
  14. <template #searchRight>
  15. <div>
  16. <a-button type="primary" @click="openCuleDrawer">
  17. <span>服务商入库登记</span>
  18. </a-button>
  19. </div>
  20. </template>
  21. </bs-table>
  22. </div>
  23. </template>
  24. <script setup lang="jsx">
  25. import { ref, reactive } from "vue"
  26. import BsTable, { useBsTable } from '/@/components/BsUi/Table/index.js';
  27. import { DISPLAY_STATE } from '/@/components/BsUi/constant.js';
  28. const activeKey = ref(0)
  29. const tabsOptions = [
  30. {
  31. title: '全部',
  32. icon: 'AppstoreOutlined',
  33. params: {
  34. a: 1
  35. },
  36. onClick: (value) => {
  37. console.log(value);
  38. },
  39. },
  40. {
  41. title: '客户列表',
  42. icon: 'TeamOutlined',
  43. params: {
  44. },
  45. onClick: (value) => {
  46. },
  47. },
  48. {
  49. title: '审核中',
  50. icon: 'FileSyncOutlined',
  51. params: {
  52. },
  53. onClick: (value) => {
  54. },
  55. },
  56. {
  57. title: '无效客户',
  58. icon: 'UserDeleteOutlined',
  59. params: {
  60. },
  61. onClick: (value) => {
  62. },
  63. },
  64. ]
  65. const {
  66. tableOptions,
  67. setTablePropsValue: setValue,
  68. getTablePropsValue: getValue,
  69. } = useBsTable({
  70. tableOptions: {
  71. url:'',
  72. gridOptions: {
  73. loading: false,
  74. columns: [
  75. {
  76. type: 'seq',
  77. width: 80,
  78. },
  79. {
  80. field: 'id',
  81. title: '状态',
  82. },
  83. {
  84. field: 'id',
  85. title: '流水号',
  86. },
  87. {
  88. field: 'id',
  89. title: '来源',
  90. },
  91. {
  92. field: 'name',
  93. title: '服务商名称',
  94. },
  95. {
  96. field: 'name1',
  97. title: '服务商ID',
  98. },
  99. {
  100. field: 'name2',
  101. title: '服务商地区',
  102. },
  103. {
  104. field: 'name',
  105. title: '服务商地址',
  106. },
  107. {
  108. field: 'name',
  109. title: '服务商类型',
  110. },
  111. {
  112. field: 'name',
  113. title: '联系人',
  114. },
  115. {
  116. field: 'name',
  117. title: '联系电话',
  118. },
  119. {
  120. field: 'name',
  121. title: '注册时间',
  122. },
  123. {
  124. // fixed: 'right',
  125. cellRender: {
  126. name: 'CellOption',
  127. extraProps: {
  128. buttons: [
  129. {
  130. title: '查看详情',
  131. code: 'view',
  132. display: ({ row }) => {
  133. return DISPLAY_STATE.VISIBLE;
  134. },
  135. disabled({ row }) {
  136. return false;
  137. },
  138. onClick({ row }) { },
  139. extraProps: {},
  140. },
  141. ],
  142. },
  143. },
  144. },
  145. ],
  146. },
  147. searchConfig: {
  148. enabled: true,
  149. fieldSpan: 4,
  150. fields: [
  151. {
  152. field: 'name',
  153. label: '客户名称',
  154. component: 'a-input',
  155. componentProps: {
  156. placeholder: '请输入客户名称',
  157. },
  158. },
  159. {
  160. field: 'name',
  161. label: '客户地址',
  162. component: 'a-input',
  163. componentProps: {
  164. placeholder: '请输入客户地址',
  165. },
  166. },
  167. {
  168. field: 'name',
  169. label: '客户类型',
  170. component: 'a-select',
  171. componentProps: {
  172. placeholder: '请输入客户类型',
  173. },
  174. },
  175. ],
  176. onSearch() {
  177. fetchTableData();
  178. },
  179. onReset() {
  180. fetchTableData();
  181. },
  182. },
  183. pagerConfig: {
  184. enabled: true,
  185. pageSize: 10,
  186. pageNum: 1,
  187. total: 0,
  188. isFixed:false
  189. },
  190. toolbarConfig: {
  191. onRefresh() {
  192. fetchTableData();
  193. },
  194. },
  195. },
  196. });
  197. </script>
  198. <style lang="scss" scoped>
  199. .customer-management {
  200. background-color: #fff;
  201. height: 100%;
  202. .tabs {
  203. padding: 0 24px;
  204. :deep(.anticon) {
  205. margin: 0;
  206. }
  207. }
  208. }
  209. </style>