index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <!-- 提货查询 -->
  3. <div class="<%= code %>">
  4. <Filter @search="updateColumn" />
  5. <contextMenu :contextMenuList="btnList">
  6. <a-table :columns="columns"
  7. class="srcollYTable"
  8. :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
  9. :pagination="false"
  10. :expandedRowKeys="expandedRowKeys"
  11. :customRow="Rowclick"
  12. rowKey="key"
  13. :data-source="tableList">
  14. <!-- 额外的展开行 -->
  15. <template #expandedRowRender="{ record }">
  16. <BtnList :btnList="handleTableList(firstBtn, record)"
  17. @onClick="btnClick(record)" />
  18. </template>
  19. <!-- 提货状态 -->
  20. <template #takeorderstatus="{ record }">
  21. <a>{{ getPickUpStateName(record.takeorderstatus) }}</a>
  22. </template>
  23. <!-- 提货/ 收货人-->
  24. <template #takemode="{ record }">
  25. <a>{{ getTakeStateName(record.takemode)}}</a>
  26. </template>
  27. <!-- 物流信息 -->
  28. <template #expresscompany="{ record }">
  29. <a>{{ record.expresscompany + "-" + record.expressnum}}</a>
  30. </template>
  31. <!-- 商品数量 -->
  32. <template #qty="{ record }">
  33. <a>{{ record.qty + record.enumdicname}}</a>
  34. </template>
  35. <!-- 地址 -->
  36. <template #address="{ record }">
  37. <a>{{ record.provincename + record.cityname + record.districtname + record.address}}</a>
  38. </template>
  39. <template #userinfotype="{ record }">
  40. <a>{{ record.userinfotype === 1 ? '个人' : '企业' }}</a>
  41. </template>
  42. </a-table>
  43. </contextMenu>
  44. <ControlModal :selectedRow="selectedRow"
  45. @refresh="getData" />
  46. </div>
  47. </template>
  48. <script lang="ts">
  49. import { defineComponent, initData, getTableColumns, getTableEvent, contextMenu, BtnList, _getBtnList, queryTableList } from '@/common/export/table';
  50. import Filter from '../../compoments/filter/index.vue';
  51. import { handleTableList } from './setup';
  52. import ControlModal from './compoments/controlModal/index.vue';
  53. import { QhjTradeGoodsPickup } from '@/services/go/ermcp/qhj/interface';
  54. import { getPickUpStateName, getTakeStateName } from '@/common/constants/enumsName';
  55. import { TableEventCB, BtnList as BtnListType } from '@/common/setup/table/interface';
  56. import { ref } from 'vue';
  57. import { queryTradeGoodsPickup } from '@/services/go/ermcp/qhj';
  58. export default defineComponent({
  59. name: '<%= code %>',
  60. components: { Filter, contextMenu, BtnList, ControlModal },
  61. setup() {
  62. // 表头数据
  63. const { columns, registerColumn, updateColumn } = getTableColumns();
  64. // 表格操作按钮列表
  65. const [firstBtn] = _getBtnList('platinum_pick_query_tab', true).value;
  66. const btnList = ref<BtnListType[]>([]);
  67. const event: TableEventCB = {
  68. contextmenuCB: (record: QhjTradeGoodsPickup) => {
  69. btnList.value = handleTableList(firstBtn, record);
  70. },
  71. };
  72. // 表格事件
  73. const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<QhjTradeGoodsPickup>(event);
  74. // 表格列表数据
  75. const { loading, tableList, queryTable } = queryTableList<QhjTradeGoodsPickup>();
  76. function getData() {
  77. // 获取列表数据
  78. queryTable(queryTradeGoodsPickup).then((res) => {
  79. tableList.value = res.map((el) => {
  80. return { ...el, key: String(el.takeorderid) };
  81. });
  82. });
  83. }
  84. // 1:备货中 完成备货
  85. // 2:待取货(自提) 确认取货
  86. // 4:待收货(邮寄) 上传物流信息、确认收货
  87. initData(() => {
  88. // 获取列表数据
  89. getData();
  90. // 注册表头信息 过滤
  91. registerColumn('table_pcweb_qhj_pickup_query', ['reqtime', 'pickupgoodsname', 'takeorderstatus', 'goodsname']);
  92. });
  93. return {
  94. btnList,
  95. columns,
  96. getData,
  97. updateColumn,
  98. expandedRowKeys,
  99. selectedRow,
  100. Rowclick,
  101. firstBtn,
  102. loading,
  103. tableList,
  104. queryTable,
  105. btnClick,
  106. getPickUpStateName,
  107. getTakeStateName,
  108. handleTableList,
  109. };
  110. },
  111. });
  112. </script>
  113. <style lang="less">
  114. .<%= code % > {
  115. }
  116. </style>;