Commit bf4c7bf952b5baa635d5a6df1f2a5de5dea1f8df
1 parent
c6d0a4d5
调整-11-29-a
Showing
3 changed files
with
1 additions
and
239 deletions
trash-garbage/src/main/java/com/trash/garbage/controller/GarbageOrderController.java
| ... | ... | @@ -323,8 +323,7 @@ public class GarbageOrderController { |
| 323 | 323 | |
| 324 | 324 | @GetMapping("/webDetail/{id}") |
| 325 | 325 | public Result<OrderDetailVo> queryOrderWebDetail(@PathVariable("id") String id) { |
| 326 | - System.out.println("进入"); | |
| 327 | - return Result.OK(garOrderService.queryOrderDetail(id)); | |
| 326 | + return Result.OK(garOrderService.queryOrderWebDetail(id)); | |
| 328 | 327 | } |
| 329 | 328 | |
| 330 | 329 | @GetMapping("/queryByCarCode/{carCode}") | ... | ... |
trash-ui/src/router/index.js
| ... | ... | @@ -65,25 +65,6 @@ export const constantRoutes = [ |
| 65 | 65 | } |
| 66 | 66 | ] |
| 67 | 67 | }, |
| 68 | - { | |
| 69 | - path: '/ask', | |
| 70 | - component: Layout, | |
| 71 | - redirect: '/ask/list', | |
| 72 | - name: 'Ask', | |
| 73 | - meta: { | |
| 74 | - title: '电子联单', | |
| 75 | - icon: 'form' | |
| 76 | - }, | |
| 77 | - children: [ | |
| 78 | - { | |
| 79 | - path: 'orderDetail/:orderId', | |
| 80 | - name: 'OrderDetail', | |
| 81 | - component: () => import('@/views/ask/ask/orderDetail.vue'), | |
| 82 | - meta: { title: '订单详情', icon: 'detail' }, | |
| 83 | - props: true | |
| 84 | - } | |
| 85 | - ] | |
| 86 | - }, | |
| 87 | 68 | { |
| 88 | 69 | path: '/user', |
| 89 | 70 | component: Layout, | ... | ... |
trash-ui/src/views/ask/ask/orderDetail.vue deleted
100644 → 0
| 1 | - | |
| 2 | -<template> | |
| 3 | - <div class="order-detail-container"> | |
| 4 | - <div class="header"> | |
| 5 | - <h1>装修垃圾收运处电子联单</h1> | |
| 6 | - </div> | |
| 7 | - | |
| 8 | - <div class="order-info"> | |
| 9 | - <div class="order-number"> | |
| 10 | - <span>联单编号:<span class="highlight">{{ form.garOrderNumber }}</span></span> | |
| 11 | - </div> | |
| 12 | - | |
| 13 | - <table class="detail-table"> | |
| 14 | - <!-- 投放端信息 --> | |
| 15 | - <tr> | |
| 16 | - <td colspan="4" class="section-header"> | |
| 17 | - 投放端信息 | |
| 18 | - </td> | |
| 19 | - </tr> | |
| 20 | - <tr> | |
| 21 | - <td class="label">投放点编号</td> | |
| 22 | - <td>{{ form.dropPointId || '-' }}</td> | |
| 23 | - <td class="label">运距</td> | |
| 24 | - <td>{{ form.transportDistance || '-' }}</td> | |
| 25 | - </tr> | |
| 26 | - <tr> | |
| 27 | - <td class="label">投放点名称</td> | |
| 28 | - <td>{{ form.garOrderName || '-' }}</td> | |
| 29 | - <td class="label">订单时间</td> | |
| 30 | - <td>{{ form.garOrderTime || '-' }}</td> | |
| 31 | - </tr> | |
| 32 | - <tr> | |
| 33 | - <td class="label">联系电话</td> | |
| 34 | - <td>{{ form.garOrderPhone || '-' }}</td> | |
| 35 | - <td class="label">车次</td> | |
| 36 | - <td v-if="form.dropCarNum!==0">{{ form.dropCarNum }}/{{ dropCarNum }}</td> | |
| 37 | - <td v-else>-</td> | |
| 38 | - </tr> | |
| 39 | - <tr> | |
| 40 | - <td class="label">投放地址</td> | |
| 41 | - <td colspan="3">{{ form.dropAddress || '-' }}</td> | |
| 42 | - </tr> | |
| 43 | - | |
| 44 | - <!-- 运输端信息 --> | |
| 45 | - <tr> | |
| 46 | - <td colspan="4" class="section-header"> | |
| 47 | - 运输端信息 | |
| 48 | - </td> | |
| 49 | - </tr> | |
| 50 | - <tr> | |
| 51 | - <td class="label">运输单位</td> | |
| 52 | - <td>{{ form.garOrderHandlerCompanyName || '-' }}</td> | |
| 53 | - <td class="label">运输时间</td> | |
| 54 | - <td>{{ form.garCreateTime || '-' }}</td> | |
| 55 | - </tr> | |
| 56 | - <tr> | |
| 57 | - <td class="label">车牌号</td> | |
| 58 | - <td>{{ form.garCarCode || '-' }}</td> | |
| 59 | - <td class="label">驾驶员</td> | |
| 60 | - <td>{{ form.garOrderHandlerName || '-' }}</td> | |
| 61 | - </tr> | |
| 62 | - | |
| 63 | - <!-- 处置端信息 --> | |
| 64 | - <tr> | |
| 65 | - <td colspan="4" class="section-header"> | |
| 66 | - 处置端信息 | |
| 67 | - </td> | |
| 68 | - </tr> | |
| 69 | - <tr> | |
| 70 | - <td class="label">处置场名称</td> | |
| 71 | - <td>{{ form.disposalSiteName || '-' }}</td> | |
| 72 | - <td class="label">接收时间</td> | |
| 73 | - <td>{{ form.garUpdateTime || '-' }}</td> | |
| 74 | - </tr> | |
| 75 | - <tr> | |
| 76 | - <td class="label">接收车牌</td> | |
| 77 | - <td>{{ form.garHandlerCarCode || '-' }}</td> | |
| 78 | - <td class="label">载重(吨)</td> | |
| 79 | - <td>{{ form.garCarryingWeight || '-' }}</td> | |
| 80 | - </tr> | |
| 81 | - | |
| 82 | - <!-- 备注 --> | |
| 83 | - <tr> | |
| 84 | - <td class="label">备注</td> | |
| 85 | - <td colspan="3">{{ form.garRemark || '-' }}</td> | |
| 86 | - </tr> | |
| 87 | - </table> | |
| 88 | - </div> | |
| 89 | - | |
| 90 | - <div class="actions"> | |
| 91 | - <el-button type="primary" @click="handlePrint">打印</el-button> | |
| 92 | - <el-button type="primary" @click="exportToPDF">导出PDF</el-button> | |
| 93 | - </div> | |
| 94 | - </div> | |
| 95 | -</template> | |
| 96 | - | |
| 97 | -<script>import { getAsk } from "@/api/ask/ask"; | |
| 98 | -import html2pdf from 'html2pdf.js' | |
| 99 | - | |
| 100 | -export default { | |
| 101 | - name: "OrderDetail", | |
| 102 | - data() { | |
| 103 | - return { | |
| 104 | - // 表单参数 | |
| 105 | - form: {}, | |
| 106 | - dropCarNum: 0 | |
| 107 | - }; | |
| 108 | - }, | |
| 109 | - created() { | |
| 110 | - const orderId = this.$route.params.orderId || this.$route.query.orderId; | |
| 111 | - if (orderId) { | |
| 112 | - this.getOrderDetail(orderId); | |
| 113 | - } else { | |
| 114 | - this.$message.error("缺少订单ID参数"); | |
| 115 | - } | |
| 116 | - }, | |
| 117 | - methods: { | |
| 118 | - /** 获取订单详情 */ | |
| 119 | - getOrderDetail(orderId) { | |
| 120 | - getAsk(orderId).then(response => { | |
| 121 | - this.form = response.data; | |
| 122 | - }).catch(error => { | |
| 123 | - this.$message.error("获取订单详情失败: " + error.message); | |
| 124 | - }); | |
| 125 | - }, | |
| 126 | - | |
| 127 | - /** 导出为PDF */ | |
| 128 | - exportToPDF() { | |
| 129 | - const element = document.querySelector('.order-detail-container'); | |
| 130 | - | |
| 131 | - const opt = { | |
| 132 | - margin: 10, | |
| 133 | - filename: `装修垃圾收运处电子联单_${this.form.garOrderNumber}.pdf`, | |
| 134 | - image: { type: 'jpeg', quality: 0.98 }, | |
| 135 | - html2canvas: { scale: 2 }, | |
| 136 | - jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' } | |
| 137 | - }; | |
| 138 | - | |
| 139 | - html2pdf().set(opt).from(element).save(); | |
| 140 | - }, | |
| 141 | - | |
| 142 | - /** 打印 */ | |
| 143 | - handlePrint() { | |
| 144 | - window.print(); | |
| 145 | - } | |
| 146 | - } | |
| 147 | -}; | |
| 148 | -</script> | |
| 149 | - | |
| 150 | -<style lang="scss" scoped>.order-detail-container { | |
| 151 | - max-width: 1000px; | |
| 152 | - margin: 0 auto; | |
| 153 | - padding: 20px; | |
| 154 | - background: #fff; | |
| 155 | - | |
| 156 | - .header { | |
| 157 | - text-align: center; | |
| 158 | - margin-bottom: 20px; | |
| 159 | - | |
| 160 | - h1 { | |
| 161 | - font-size: 24px; | |
| 162 | - color: #333; | |
| 163 | - margin: 0; | |
| 164 | - } | |
| 165 | - } | |
| 166 | - | |
| 167 | - .order-info { | |
| 168 | - .order-number { | |
| 169 | - font-size: 18px; | |
| 170 | - margin-bottom: 20px; | |
| 171 | - | |
| 172 | - .highlight { | |
| 173 | - color: red; | |
| 174 | - font-weight: bold; | |
| 175 | - } | |
| 176 | - } | |
| 177 | - | |
| 178 | - .detail-table { | |
| 179 | - width: 100%; | |
| 180 | - border-collapse: collapse; | |
| 181 | - font-size: 14px; | |
| 182 | - text-align: left; | |
| 183 | - margin-bottom: 20px; | |
| 184 | - | |
| 185 | - .section-header { | |
| 186 | - background: #f5f7fa; | |
| 187 | - font-weight: 600; | |
| 188 | - padding: 10px; | |
| 189 | - } | |
| 190 | - | |
| 191 | - td { | |
| 192 | - border: 1px solid #333; | |
| 193 | - padding: 10px; | |
| 194 | - | |
| 195 | - &.label { | |
| 196 | - background-color: #f9f9f9; | |
| 197 | - font-weight: 500; | |
| 198 | - width: 20%; | |
| 199 | - } | |
| 200 | - } | |
| 201 | - } | |
| 202 | - } | |
| 203 | - | |
| 204 | - .actions { | |
| 205 | - text-align: center; | |
| 206 | - | |
| 207 | - .el-button { | |
| 208 | - margin: 0 10px; | |
| 209 | - } | |
| 210 | - } | |
| 211 | -} | |
| 212 | - | |
| 213 | -@media print { | |
| 214 | - .actions { | |
| 215 | - display: none; | |
| 216 | - } | |
| 217 | -} | |
| 218 | -</style> |