index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <ele-page flex-table>
  3. <ele-check-card
  4. v-if="alarmData.length > 0"
  5. v-model="checked"
  6. :items="alarmData"
  7. @change="handleCardChange"
  8. :row="{ gutter: 12 }"
  9. :column="{ span: 4 }"
  10. style="
  11. background-color: #fff;
  12. padding: 12px 0 0 12px;
  13. border-radius: 6px;
  14. "
  15. >
  16. <template #item="{ item }">
  17. <div style="padding: 18px" class="flex-col items-center">
  18. <ele-text size="md">{{ item.title }}</ele-text>
  19. <ele-count-up
  20. :end-val="item.content"
  21. style="font-size: 26px"
  22. />
  23. </div>
  24. </template>
  25. </ele-check-card>
  26. <order-page
  27. ref="pageRef"
  28. :pageConfig="pageConfig"
  29. permissionKey="orderAlert"
  30. style="padding: 12px 0"
  31. :prop-columns="columns"
  32. >
  33. <template #toolbar>
  34. <el-button
  35. type="success"
  36. plain
  37. class="ele-btn-icon"
  38. :icon="DownloadOutlined"
  39. v-permission="'recycleOrder:orderAlert:export'"
  40. @click="exportData"
  41. >
  42. 导出订单明细
  43. </el-button>
  44. </template>
  45. </order-page>
  46. </ele-page>
  47. </template>
  48. <script setup>
  49. import { ref, reactive, getCurrentInstance } from 'vue';
  50. import { DownloadOutlined } from '@/components/icons';
  51. import OrderPage from '@/views/recycleOrder/components/order-page-all.vue';
  52. const { proxy } = getCurrentInstance();
  53. defineOptions({ name: 'recycleOrderAlert' });
  54. //获取统计数据
  55. const alarmData = ref([]);
  56. // 预警类型:1物流预警 2到货预警 3审核超时 4确认收货预警
  57. // 已揽件-物流异常
  58. let alarmTypes = {
  59. 1: '已揽件-物流异常',
  60. 2: '已签收-收货超时',
  61. 3: '已收货-审核超时',
  62. 4: '已到仓-收货超时'
  63. };
  64. const getStatisticsData = async () => {
  65. proxy.$http
  66. .get('/order/orderInfo/getOrderWarnStatistics')
  67. .then((res) => {
  68. if (res.data.code === 200) {
  69. alarmData.value = res.data.data.map((item) => ({
  70. value: item.alarmType,
  71. title: alarmTypes[item.alarmType],
  72. content: item.alarmNum,
  73. col: {
  74. md: 3,
  75. style: { marginBottom: '12px', width: '180px' }
  76. }
  77. }));
  78. }
  79. });
  80. };
  81. getStatisticsData();
  82. /** 页面组件实例 */
  83. const pageRef = ref(null);
  84. const pageConfig = reactive({
  85. pageUrl: '/order/orderInfo/getOrderWarnList',
  86. exportUrl: '/order/orderInfo/orderWarnExport',
  87. fileName: '订单预警',
  88. cacheKey: 'recycleOrderAlertTable',
  89. where: {
  90. alarmType: ''
  91. }
  92. });
  93. const columns = ref([
  94. {
  95. type: 'selection',
  96. columnKey: 'selection',
  97. width: 50,
  98. align: 'center',
  99. fixed: 'left'
  100. },
  101. {
  102. label: '单号',
  103. prop: 'orderNumber',
  104. slot: 'orderNumber',
  105. minWidth: 230
  106. },
  107. { label: '客户', prop: 'customer', slot: 'customer', minWidth: 360 },
  108. { label: '金额', prop: 'amount', slot: 'amount', minWidth: 160 },
  109. {
  110. label: '状态',
  111. prop: 'status',
  112. slot: 'status',
  113. width: '166'
  114. },
  115. { label: '时间', prop: 'time', slot: 'time', minWidth: 210 },
  116. { label: '预警时间', prop: 'alarmTime', minWidth: 160 },
  117. { label: '备注', prop: 'remarks', slot: 'remarks' },
  118. {
  119. columnKey: 'action',
  120. label: '操作',
  121. width: 182,
  122. align: 'center',
  123. slot: 'action',
  124. hideInPrint: true,
  125. hideInExport: true,
  126. fixed: 'right'
  127. }
  128. ]);
  129. //导出数据
  130. function exportData() {
  131. pageRef.value?.exportData('订单预警');
  132. }
  133. // 卡片选中
  134. const handleCardChange = (value) => {
  135. pageConfig.where.alarmType = value;
  136. pageRef.value?.reload();
  137. };
  138. // 选中值
  139. const checked = ref();
  140. // 数据
  141. const items = ref([
  142. {
  143. value: 1,
  144. title: '已揽件-物流异常',
  145. content: 12,
  146. col: { md: 3, style: { marginBottom: '12px', width: '180px' } }
  147. },
  148. {
  149. value: 2,
  150. title: '已签收-收货超时',
  151. content: 5,
  152. col: { md: 3, style: { marginBottom: '12px', width: '180px' } }
  153. },
  154. {
  155. value: 3,
  156. title: '已收货-审核超时',
  157. content: 12,
  158. col: { md: 3, style: { marginBottom: '12px', width: '180px' } }
  159. },
  160. {
  161. value: 4,
  162. title: '已到仓-收货超时',
  163. content: 12,
  164. col: { md: 3, style: { marginBottom: '12px', width: '180px' } }
  165. }
  166. ]);
  167. </script>