index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <order-page ref="pageRef" :pageConfig="pageConfig">
  3. <template #toolbar>
  4. <ele-check-card v-model="checked" :items="items" :row="{ gutter: 12 }">
  5. <template #item="{ item }">
  6. <div style="padding: 18px" class="flex-col items-center">
  7. <ele-text size="md">{{ item.title }}</ele-text>
  8. <ele-count-up :end-val="item.content" style="font-size:26px" />
  9. </div>
  10. </template>
  11. </ele-check-card>
  12. <el-button
  13. type="warning"
  14. plain
  15. v-permission="'recycleOrder:awaitDelivery:batchAudit'"
  16. @click="handleBatchAudit"
  17. >
  18. 批量初审
  19. </el-button>
  20. <el-button
  21. type="success"
  22. plain
  23. v-permission="'recycleOrder:awaitDelivery:batchReceive'"
  24. @click="handleBatchReceive()"
  25. >
  26. 批量确认收货
  27. </el-button>
  28. </template>
  29. <template #action="{ row }">
  30. <div>
  31. <el-button
  32. type="success"
  33. link
  34. v-permission="'recycleOrder:awaitDelivery:detail'"
  35. @click="toOrderDetail(row)"
  36. >
  37. [订单详情]
  38. </el-button>
  39. <el-button
  40. type="warning"
  41. link
  42. v-permission="'recycleOrder:awaitDelivery:log'"
  43. @click="openOrderLog(row)"
  44. >
  45. [订单日志]
  46. </el-button>
  47. <el-button
  48. type="danger"
  49. link
  50. v-permission="'recycleOrder:awaitDelivery:cancel'"
  51. @click="cancelOrder(row)"
  52. >
  53. [取消订单]
  54. </el-button>
  55. <el-button
  56. type="primary"
  57. link
  58. v-permission="'recycleOrder:awaitDelivery:fallback'"
  59. @click="fallbackOrder(row)"
  60. >
  61. [回退状态]
  62. </el-button>
  63. <el-button
  64. type="warning"
  65. link
  66. v-permission="'recycleOrder:awaitDelivery:userTag'"
  67. @click="openEditUserTag(row)"
  68. >
  69. [用户标签]
  70. </el-button>
  71. <el-button
  72. type="success"
  73. link
  74. v-permission="'recycleOrder:awaitDelivery:receive'"
  75. @click="handleBatchReceive(row)"
  76. >
  77. [确认收货]
  78. </el-button>
  79. <el-button
  80. type="danger"
  81. link
  82. v-permission="'recycleOrder:awaitDelivery:interception'"
  83. @click="applyForInterception(row)"
  84. >
  85. [申请拦截退回]
  86. </el-button>
  87. </div>
  88. </template>
  89. <order-log ref="orderLogRef" />
  90. <userBindTag ref="userTagRef" />
  91. </order-page>
  92. </template>
  93. <script setup>
  94. import { ref, reactive } from 'vue';
  95. import { ElMessageBox } from 'element-plus/es';
  96. import { EleMessage } from 'ele-admin-plus/es';
  97. import { DownloadOutlined } from '@/components/icons';
  98. import OrderPage from '@/views/recycleOrder/components/order-page.vue';
  99. import { useDictData } from '@/utils/use-dict-data';
  100. import { useRouter } from 'vue-router';
  101. //订单日志
  102. import orderLog from '@/views/recycleOrder/components/order-log.vue';
  103. //用户标签
  104. import userBindTag from '@/views/recycleOrder/components/user-bind-tag.vue';
  105. defineOptions({ name: 'recycleOrderawaitDelivery' });
  106. let router = useRouter();
  107. /** 页面组件实例 */
  108. const pageRef = ref(null);
  109. const pageConfig = reactive({
  110. pageUrl: '',
  111. exportUrl: '',
  112. fileName: '待签收订单',
  113. cacheKey: 'awaitDeliveryTable'
  114. });
  115. //批量初审
  116. function handleBatchAudit() {
  117. pageRef.value?.operatBatch({
  118. title: '确认批量审核?',
  119. url: '/recycleOrder/batchAudit'
  120. });
  121. }
  122. //批量取消订单
  123. function handleBatchReceive(row) {
  124. pageRef.value?.operatBatch({
  125. title: '确认收货?',
  126. row,
  127. url: '/recycleOrder/batchAudit'
  128. });
  129. }
  130. //订单详情
  131. function toOrderDetail(row) {
  132. router.push({ path: '/recycleOrder/detail', query: { id: row.postId } });
  133. }
  134. //订单日志
  135. const orderLogRef = ref(null);
  136. function openOrderLog(row) {
  137. console.log(row, orderLogRef.value, 'row');
  138. orderLogRef.value?.handleOpen(row);
  139. }
  140. //用户绑定标签
  141. const userTagRef = ref(null);
  142. function openEditUserTag(row) {
  143. userTagRef.value?.handleOpen(row);
  144. }
  145. function messageBoxConfirm({ message, url, row }) {
  146. ElMessageBox.confirm(message, '提示', {
  147. confirmButtonText: '确定',
  148. cancelButtonText: '关闭',
  149. type: 'warning'
  150. }).then(() => {
  151. console.log(row, 'row');
  152. });
  153. }
  154. //取消订单
  155. function cancelOrder(row) {
  156. messageBoxConfirm({ message: '确认取消?', url: '', row });
  157. }
  158. //回退状态
  159. function fallbackOrder(row) {
  160. messageBoxConfirm({ message: '确认回退状态?', url: '', row });
  161. }
  162. //确认收货
  163. function materialPickup(row) {
  164. messageBoxConfirm({ message: '确认收货?', url: '', row });
  165. }
  166. //申请拦截退回
  167. function applyForInterception(row) {
  168. messageBoxConfirm({ message: '确认申请拦截退回?', url: '', row });
  169. }
  170. // 选中值
  171. const checked = ref();
  172. // 数据
  173. const items = ref([
  174. {
  175. value: 1,
  176. title: '已揽件-物流异常',
  177. content: 12,
  178. col: { md: 3, style: { marginBottom: '12px', width: '180px' } }
  179. },
  180. {
  181. value: 2,
  182. title: '已签收-收货超时',
  183. content: 5,
  184. col: { md: 3, style: { marginBottom: '12px', width: '180px' } }
  185. },
  186. {
  187. value: 3,
  188. title: '已收货-审核超时',
  189. content: 12,
  190. col: { md: 3, style: { marginBottom: '12px', width: '180px' } }
  191. },
  192. {
  193. value: 4,
  194. title: '已到仓-收货超时',
  195. content: 12,
  196. col: { md: 3, style: { marginBottom: '12px', width: '180px' } }
  197. }
  198. ]);
  199. </script>