index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <script setup lang="tsx">
  2. import { NCollapse, NCollapseItem, NTag } from 'naive-ui';
  3. import { commonStatus } from '@/constants/business';
  4. import { fetchGetStoreList } from '@/service/api/xsb-manage/store-info';
  5. import { useTable } from '@/components/zt/Table/hooks/useTable';
  6. import { $t } from '@/locales';
  7. const columns: NaiveUI.TableColumn<Api.Store.ShopDetail>[] = [
  8. {
  9. key: 'hbStationNo',
  10. title: '商家门店编码',
  11. width: 250,
  12. render: row => {
  13. return (
  14. <NCollapse>
  15. <NCollapseItem title={row.hbStationNo} name={`${row.hbStationId}hbStationNo`}>
  16. <div class={'ml-6'}>
  17. 联系电话:<span class={'text-gray'}>{row.tel} </span>
  18. </div>
  19. <div class={'ml-6'}>
  20. 联系人:<span class={'text-gray'}>{row.shopOwner} </span>
  21. </div>
  22. <div class={'ml-6'}>
  23. 门店经度:<span class={'text-gray'}>{row.shopLng} </span>
  24. </div>
  25. <div class={'ml-6'}>
  26. 门店维度:<span class={'text-gray'}>{row.shopLat} </span>
  27. </div>
  28. {/* <div class={'ml-6'}>
  29. 时段接单量: <span class={'text-gray'}>{row.shopOwner} </span>
  30. </div> */}
  31. </NCollapseItem>
  32. </NCollapse>
  33. );
  34. }
  35. },
  36. {
  37. key: 'shopName',
  38. title: '门店名称',
  39. align: 'center',
  40. width: 200
  41. },
  42. {
  43. key: 'address',
  44. title: '地址',
  45. align: 'center',
  46. width: 200,
  47. render: row => {
  48. return (
  49. <div>
  50. {row.province}
  51. {row.city}
  52. {row.shopAddress}
  53. </div>
  54. );
  55. }
  56. },
  57. {
  58. key: 'runStatus',
  59. title: '经营状态',
  60. align: 'center',
  61. render: row => {
  62. const tagMap: Record<Api.Common.commonStatus, NaiveUI.ThemeColor> = {
  63. 1: 'success',
  64. 0: 'warning'
  65. };
  66. const status = row.runStatus || 0;
  67. const label = $t(commonStatus[status]);
  68. return <NTag type={tagMap[status]}>{label}</NTag>;
  69. }
  70. },
  71. {
  72. key: 'shopStatus',
  73. title: '营业状态',
  74. align: 'center',
  75. render: row => {
  76. const tagMap: Record<Api.Common.commonStatus, NaiveUI.ThemeColor> = {
  77. 1: 'success',
  78. 0: 'error'
  79. };
  80. const labelArr = ['停业中', '营业中'];
  81. const status = row.shopStatus || 0;
  82. const label = labelArr[status];
  83. return <NTag type={tagMap[status]}>{label}</NTag>;
  84. }
  85. },
  86. {
  87. key: 'businessTime',
  88. title: '营业时间',
  89. align: 'center',
  90. width: 200,
  91. ellipsis: {
  92. tooltip: true
  93. }
  94. },
  95. {
  96. key: 'notice',
  97. title: '门店公告',
  98. align: 'center',
  99. render: row => {
  100. return <div>{row.notice || '--'}</div>;
  101. }
  102. }
  103. ];
  104. const [registerTable] = useTable({
  105. searchFormConfig: {
  106. schemas: [
  107. {
  108. label: '门店名称',
  109. component: 'NInput',
  110. field: 'shopName'
  111. },
  112. {
  113. field: 'hbStationNo',
  114. label: '商家门店编码',
  115. component: 'NInput'
  116. }
  117. ],
  118. inline: false,
  119. size: 'small',
  120. labelPlacement: 'left',
  121. isFull: false
  122. },
  123. tableConfig: {
  124. keyField: 'id',
  125. title: '门店信息',
  126. showAddButton: false
  127. }
  128. });
  129. </script>
  130. <template>
  131. <LayoutTable>
  132. <ZTable :columns="columns" :show-table-action="false" :api="fetchGetStoreList" @register="registerTable"></ZTable>
  133. </LayoutTable>
  134. </template>
  135. <style scoped></style>