index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <BsPageWrapper class="table-demo">
  3. <bs-table v-bind="tableOptions">
  4. <template #searchRight>
  5. <div>
  6. <a-button type="primary" @click="handleOpponentRegistration">
  7. <span>竞争对手登记</span>
  8. </a-button>
  9. </div>
  10. </template>
  11. <template #slotVue_default="{ row }">
  12. <a-dropdown>
  13. <a class="ant-dropdown-link" @click.prevent>{{ row.qualificationManage }}</a>
  14. <template #overlay>
  15. <a-menu>
  16. <a-menu-item>
  17. <a-table :dataSource="row.qualificationList" :columns="columns" :pagination="false" style="width: 350px;"/>
  18. </a-menu-item>
  19. </a-menu>
  20. </template>
  21. </a-dropdown>
  22. </template>
  23. </bs-table>
  24. </BsPageWrapper>
  25. </template>
  26. <script setup lang="jsx">
  27. import BsTable, { useBsTable } from '/@/components/BsUi/Table/index.js';
  28. import { onMounted, ref } from 'vue';
  29. import { useRouter } from 'vue-router';
  30. import { DISPLAY_STATE } from '/@/components/BsUi/constant.js';
  31. const router = useRouter();
  32. const columns = ref([
  33. {
  34. title: '资质名称',
  35. dataIndex: 'qualificationList',
  36. key: 'qualificationList',
  37. align: 'center',
  38. width: '200px',
  39. customRender: ({record}) => {
  40. console.log('4343', record);
  41. return <div style="text-align: left;">{record.qualificationName[0].valueName}</div>
  42. },
  43. },
  44. ]);
  45. onMounted(() => {});
  46. const { tableOptions, setTablePropsValue, getTablePropsValue, refreshTable } = useBsTable({
  47. tableOptions: {
  48. url: '/supports/competitor/queryPage',
  49. gridOptions: {
  50. loading: false,
  51. columns: [
  52. {
  53. type: 'seq',
  54. width: 80,
  55. },
  56. {
  57. field: 'competitorName',
  58. title: '竞争对手名称',
  59. align: 'center',
  60. },
  61. {
  62. field: 'competitorId',
  63. title: '竞争对手ID',
  64. align: 'center',
  65. },
  66. {
  67. field: 'formerName',
  68. title: '曾用名',
  69. align: 'center',
  70. },
  71. {
  72. field: 'address',
  73. title: '注册地址',
  74. align: 'center',
  75. },
  76. {
  77. // field: 'flatsType',
  78. title: '单位类型',
  79. align: 'center',
  80. slots: {
  81. default({ row, column }) {
  82. return <span>{row?.attribute?.[0].valueName}</span>;
  83. },
  84. },
  85. },
  86. {
  87. field: 'registeredCapital',
  88. title: '注册资本(元)',
  89. align: 'center',
  90. },
  91. {
  92. field: 'registeredTime',
  93. title: '注册日期',
  94. align: 'center',
  95. },
  96. {
  97. field: 'employeeNumber',
  98. title: '员工人数',
  99. align: 'center',
  100. },
  101. {
  102. field: 'qualificationManage',
  103. title: '累计资质管理',
  104. align: 'center',
  105. slots: {
  106. default: 'slotVue_default',
  107. },
  108. },
  109. {
  110. field: 'biddingNumber',
  111. title: '已登记参标数量',
  112. align: 'center',
  113. },
  114. {
  115. field: 'winningNumber',
  116. title: '已登记中标数量',
  117. align: 'center',
  118. },
  119. {
  120. field: 'createUserId',
  121. title: '添加人',
  122. align: 'center',
  123. slots: {
  124. default({ row, column }) {
  125. return <span>{row?.createUserId?.actualName}</span>;
  126. },
  127. },
  128. },
  129. {
  130. field: 'createTime',
  131. title: '添加时间',
  132. align: 'center',
  133. },
  134. {
  135. cellRender: {
  136. name: 'CellOption',
  137. extraProps: {
  138. buttons: [
  139. {
  140. title: '查看详情',
  141. code: 'view',
  142. display: ({ row }) => {
  143. return DISPLAY_STATE.VISIBLE;
  144. },
  145. disabled({ row }) {
  146. return false;
  147. },
  148. onClick({ row }) {
  149. goDetailPage(row);
  150. },
  151. extraProps: {},
  152. },
  153. ],
  154. },
  155. },
  156. },
  157. ],
  158. },
  159. searchConfig: {
  160. enabled: true,
  161. fieldSpan: 4,
  162. fields: [
  163. {
  164. field: '',
  165. component: 'a-input',
  166. componentProps: {
  167. placeholder: '请输入竞争对手名称',
  168. },
  169. },
  170. {
  171. field: '',
  172. component: 'a-select',
  173. componentProps: {
  174. placeholder: '请选择单位类型',
  175. },
  176. },
  177. {
  178. field: '',
  179. component: 'a-select',
  180. componentProps: {
  181. placeholder: '请选择资质',
  182. },
  183. },
  184. ],
  185. },
  186. },
  187. });
  188. const goDetailPage = (record) => {
  189. console.log(record.id);
  190. router.push({
  191. path: '/support-manage/competition/opponent/opponent-detail',
  192. query: {
  193. id: record.id,
  194. },
  195. });
  196. };
  197. const handleOpponentRegistration = () => {
  198. router.push('/support-manage/competition/opponent/create-opponent');
  199. };
  200. </script>
  201. <style scoped lang="scss">
  202. .table-demo {
  203. }
  204. </style>