Showing
8 changed files
with
253 additions
and
73 deletions
| ... | ... | @@ -9,4 +9,6 @@ VITE_APP_BASE_URL = '' | 
| 9 | 9 | # 七星分拣管理系统/开发环境 | 
| 10 | 10 | # VITE_APP_BASE_API = '/api' | 
| 11 | 11 | # VITE_APP_BASE_API = 'https://vue.ruoyi.vip/prod-api' | 
| 12 | -VITE_APP_BASE_API = 'http://qixing-dws.boosal.com' | |
| 12 | +# VITE_APP_BASE_API = 'http://qixing-dws.boosal.com' | |
| 13 | +VITE_APP_BASE_API = 'http://192.168.16.22:8082' | |
| 14 | + | ... | ... | 
| ... | ... | @@ -9,5 +9,6 @@ VITE_APP_BASE_URL = '/admin/' | 
| 9 | 9 | # 七星分拣管理系统/生产环境 | 
| 10 | 10 | # VITE_APP_BASE_API = '/api' | 
| 11 | 11 | VITE_APP_BASE_API = 'http://qixing-dws.boosal.com' | 
| 12 | +# VITE_APP_BASE_API = 'http://127.0.0.1' | |
| 12 | 13 | # 是否在打包时开启压缩,支持 gzip 和 brotli | 
| 13 | 14 | VITE_BUILD_COMPRESS = gzip | 
| \ No newline at end of file | ... | ... | 
| ... | ... | @@ -41,7 +41,13 @@ export function scanTaskdetal(id) { | 
| 41 | 41 | }); | 
| 42 | 42 | } | 
| 43 | 43 | |
| 44 | - | |
| 44 | +export function scanResultTypeList(query) { | |
| 45 | + return request({ | |
| 46 | + url: "/sorting/queryScanResultType", | |
| 47 | + method: "GET", | |
| 48 | + params: query, | |
| 49 | + }); | |
| 50 | +} | |
| 45 | 51 | |
| 46 | 52 | |
| 47 | 53 | export function deviceTypeQueryList(query) { | 
| ... | ... | @@ -85,6 +91,14 @@ export function editSortingStation(query) { | 
| 85 | 91 | }); | 
| 86 | 92 | } | 
| 87 | 93 | |
| 94 | +export function addSortingStation(query) { | |
| 95 | + return request({ | |
| 96 | + url: "/sorting", | |
| 97 | + method: "POST", | |
| 98 | + data: query, | |
| 99 | + }); | |
| 100 | +} | |
| 101 | + | |
| 88 | 102 | export function editScanSpec(query) { | 
| 89 | 103 | return request({ | 
| 90 | 104 | url: "/scanSpec", | ... | ... | 
| ... | ... | @@ -266,7 +266,7 @@ const columnList = ref([ | 
| 266 | 266 | { | 
| 267 | 267 | label: "序号", | 
| 268 | 268 | prop: "id", | 
| 269 | - width: 200, | |
| 269 | + width: 70, | |
| 270 | 270 | }, | 
| 271 | 271 | { | 
| 272 | 272 | label: "区县", | 
| ... | ... | @@ -275,35 +275,43 @@ const columnList = ref([ | 
| 275 | 275 | { | 
| 276 | 276 | label: "分中心名称", | 
| 277 | 277 | prop: "subName", | 
| 278 | + width: 200, | |
| 278 | 279 | }, | 
| 279 | 280 | { | 
| 280 | 281 | label: "营业厅名称", | 
| 281 | 282 | prop: "name", | 
| 283 | + width: 300, | |
| 282 | 284 | }, | 
| 283 | 285 | { | 
| 284 | 286 | label: "营业厅编号", | 
| 285 | 287 | prop: "number", | 
| 288 | + width: 200, | |
| 286 | 289 | }, | 
| 287 | 290 | { | 
| 288 | 291 | label: "地址", | 
| 289 | 292 | prop: "address", | 
| 293 | + width: 300, | |
| 290 | 294 | }, | 
| 291 | 295 | { | 
| 292 | 296 | label: "联系人", | 
| 293 | 297 | prop: "contact", | 
| 298 | + width: 100, | |
| 294 | 299 | }, | 
| 295 | 300 | { | 
| 296 | 301 | label: "联系电话", | 
| 297 | 302 | prop: "contactNumber", | 
| 303 | + width: 100, | |
| 304 | + | |
| 298 | 305 | }, | 
| 299 | 306 | { | 
| 300 | 307 | label: "备注", | 
| 301 | 308 | prop: "remark", | 
| 309 | + width: 200, | |
| 302 | 310 | }, | 
| 303 | - { | |
| 304 | - label: "正则表达", | |
| 305 | - prop: "regular", | |
| 306 | - }, | |
| 311 | + // { | |
| 312 | + // label: "正则表达", | |
| 313 | + // prop: "regular", | |
| 314 | + // }, | |
| 307 | 315 | ]); | 
| 308 | 316 | console.log(route); | 
| 309 | 317 | const data = reactive({ | ... | ... | 
| ... | ... | @@ -35,13 +35,9 @@ | 
| 35 | 35 | <el-button icon="Refresh" @click="resetQuery">Reset</el-button> | 
| 36 | 36 | </el-form-item> | 
| 37 | 37 | </el-form> | 
| 38 | + <div class="title">分拣口管理</div> | |
| 38 | 39 | <el-row :gutter="10" class="mb8"> | 
| 39 | 40 | <!-- <el-col :span="1.5"> | 
| 40 | - <el-button type="primary" plain icon="Plus" @click="handleAdd" | |
| 41 | - >新建</el-button | |
| 42 | - > | |
| 43 | - </el-col> --> | |
| 44 | - <!-- <el-col :span="1.5"> | |
| 45 | 41 | <el-button | 
| 46 | 42 | type="primary" | 
| 47 | 43 | plain | 
| ... | ... | @@ -55,7 +51,11 @@ | 
| 55 | 51 | :search="false" | 
| 56 | 52 | @queryTable="getList" | 
| 57 | 53 | > | 
| 58 | - <div class="title">分拣口管理</div> | |
| 54 | + <el-col :span="1.5"> | |
| 55 | + <el-button type="primary" plain icon="Plus" @click="handleAdd" | |
| 56 | + >新建分检口</el-button | |
| 57 | + > | |
| 58 | + </el-col> | |
| 59 | 59 | </right-toolbar> | 
| 60 | 60 | </el-row> | 
| 61 | 61 | |
| ... | ... | @@ -71,10 +71,23 @@ | 
| 71 | 71 | :width="column.width || 'auto'" | 
| 72 | 72 | > | 
| 73 | 73 | <template #default="scope"> | 
| 74 | - <span | |
| 75 | - v-if="column.prop === 'deviceTypeList'" | |
| 76 | - > | |
| 77 | - {{ scope.row[column.prop] ? scope.row[column.prop].map(item => item.deviceTypeName).join(',') : ''}} | |
| 74 | + <span v-if="column.prop === 'deviceTypeList'"> | |
| 75 | + {{ | |
| 76 | + scope.row[column.prop] | |
| 77 | + ? scope.row[column.prop] | |
| 78 | + .map((item) => item.deviceTypeName) | |
| 79 | + .join(",") | |
| 80 | + : "" | |
| 81 | + }} | |
| 82 | + </span> | |
| 83 | + <span v-else-if="column.prop === 'sortingScanResultTypeList'"> | |
| 84 | + {{ | |
| 85 | + scope.row[column.prop] | |
| 86 | + ? scope.row[column.prop] | |
| 87 | + .map((item) => item.scanResultTypeName) | |
| 88 | + .join(",") | |
| 89 | + : "" | |
| 90 | + }} | |
| 78 | 91 | </span> | 
| 79 | 92 | <span | 
| 80 | 93 | v-else-if="column.prop === 'status'" | 
| ... | ... | @@ -127,11 +140,11 @@ | 
| 127 | 140 | <!-- 添加或修改用户配置对话框 --> | 
| 128 | 141 | <el-dialog :title="title" v-model="open" width="500px" append-to-body> | 
| 129 | 142 | <template #header> | 
| 130 | - <span class="my-header"> | |
| 131 | - <div style="text-align: center">{{ title }}</div> | |
| 132 | - </span> | |
| 133 | - </template> | |
| 134 | - <el-form :model="form" :rules="rules" ref="userRef" label-width="120px"> | |
| 143 | + <span class="my-header"> | |
| 144 | + <div style="text-align: center">{{ title }}</div> | |
| 145 | + </span> | |
| 146 | + </template> | |
| 147 | + <el-form :model="form" :rules="rules" ref="userRef" label-width="140px"> | |
| 135 | 148 | <el-row> | 
| 136 | 149 | <el-col :span="24"> | 
| 137 | 150 | <el-form-item label="分检口编号" prop="no"> | 
| ... | ... | @@ -143,16 +156,45 @@ | 
| 143 | 156 | <el-input v-model="form.name" placeholder="请输入分检口名称" /> | 
| 144 | 157 | </el-form-item> | 
| 145 | 158 | </el-col> | 
| 146 | - <el-col :span="24"> | |
| 159 | + <!-- <el-col :span="24"> | |
| 147 | 160 | <el-form-item label="关联设备类型" prop="deviceTypeIdList"> | 
| 148 | - <el-select v-model="form.deviceTypeIdList" placeholder="请选择关联设备类型" multiple> | |
| 149 | - <el-option v-for="item in deviceTypeList" :key="item.id" :label="item.name" :value="item.id" /> | |
| 161 | + <el-select | |
| 162 | + v-model="form.deviceTypeIdList" | |
| 163 | + placeholder="请选择关联设备类型" | |
| 164 | + multiple | |
| 165 | + > | |
| 166 | + <el-option | |
| 167 | + v-for="item in deviceTypeList" | |
| 168 | + :key="item.id" | |
| 169 | + :label="item.name" | |
| 170 | + :value="item.id" | |
| 171 | + /> | |
| 172 | + </el-select> | |
| 173 | + </el-form-item> | |
| 174 | + </el-col> --> | |
| 175 | + <el-col :span="24"> | |
| 176 | + <el-form-item label="关联扫描结果类型" prop="scanResultTypeList"> | |
| 177 | + <el-select | |
| 178 | + v-model="form.scanResultTypeList" | |
| 179 | + placeholder="请选择关联扫描结果类型" | |
| 180 | + multiple | |
| 181 | + > | |
| 182 | + <el-option | |
| 183 | + v-for="item in scanResultTypeOptionList" | |
| 184 | + :key="item.value" | |
| 185 | + :label="item.label" | |
| 186 | + :value="item.value" | |
| 187 | + /> | |
| 150 | 188 | </el-select> | 
| 151 | 189 | </el-form-item> | 
| 152 | 190 | </el-col> | 
| 153 | 191 | <el-col :span="24"> | 
| 154 | 192 | <el-form-item label="满袋数量" prop="fullQuantity"> | 
| 155 | - <el-input type="number" v-model="form.fullQuantity" placeholder="请输入满袋数量" /> | |
| 193 | + <el-input | |
| 194 | + type="number" | |
| 195 | + v-model="form.fullQuantity" | |
| 196 | + placeholder="请输入满袋数量" | |
| 197 | + /> | |
| 156 | 198 | </el-form-item> | 
| 157 | 199 | </el-col> | 
| 158 | 200 | <el-col :span="24"> | 
| ... | ... | @@ -224,10 +266,11 @@ import { getToken } from "@/utils/auth"; | 
| 224 | 266 | import { onMounted, ref } from "vue"; | 
| 225 | 267 | import { | 
| 226 | 268 | sortingStationQueryList, | 
| 227 | - // addSortingStation, | |
| 269 | + addSortingStation, | |
| 228 | 270 | editSortingStation, | 
| 229 | 271 | // deleteSortingStation, | 
| 230 | - deviceTypeQueryList | |
| 272 | + deviceTypeQueryList, | |
| 273 | + scanResultTypeList, | |
| 231 | 274 | } from "@/api/system/scan"; | 
| 232 | 275 | import { ElMessageBox } from "element-plus"; | 
| 233 | 276 | |
| ... | ... | @@ -242,28 +285,36 @@ const showSearch = ref(true); | 
| 242 | 285 | const total = ref(0); | 
| 243 | 286 | const dateRange = ref([]); | 
| 244 | 287 | const deviceTypeList = ref([]); | 
| 288 | +const scanResultTypeOptionList = ref([]); | |
| 245 | 289 | |
| 246 | 290 | const columnList = ref([ | 
| 247 | 291 | { | 
| 248 | 292 | label: "分检口编号", | 
| 249 | 293 | prop: "no", | 
| 250 | - width: 200, | |
| 294 | + width: 100, | |
| 251 | 295 | }, | 
| 252 | 296 | { | 
| 253 | 297 | label: "分检口名称", | 
| 254 | - prop: "name" | |
| 298 | + prop: "name", | |
| 299 | + width: 200, | |
| 255 | 300 | }, | 
| 301 | + // { | |
| 302 | + // label: "关联设备类型", | |
| 303 | + // prop: "deviceTypeList", | |
| 304 | + // width: 300, | |
| 305 | + // }, | |
| 256 | 306 | { | 
| 257 | - label: "关联设备类型", | |
| 258 | - prop: "deviceTypeList" | |
| 307 | + label: "关联扫描结果类型", | |
| 308 | + prop: "sortingScanResultTypeList", | |
| 309 | + width: 300, | |
| 259 | 310 | }, | 
| 260 | 311 | { | 
| 261 | 312 | label: "满袋数量", | 
| 262 | - prop: "fullQuantity" | |
| 313 | + prop: "fullQuantity", | |
| 263 | 314 | }, | 
| 264 | 315 | { | 
| 265 | 316 | label: "备注", | 
| 266 | - prop: "remark" | |
| 317 | + prop: "remark", | |
| 267 | 318 | }, | 
| 268 | 319 | ]); | 
| 269 | 320 | console.log(route); | 
| ... | ... | @@ -279,8 +330,15 @@ const data = reactive({ | 
| 279 | 330 | rules: { | 
| 280 | 331 | no: [{ required: true, message: "请输入分检口编号", trigger: "blur" }], | 
| 281 | 332 | name: [{ required: true, message: "请输入分检口名称", trigger: "blur" }], | 
| 282 | - deviceTypeIdList: [{ required: true, message: "请选择关联设备类型", trigger: "blur" }], | |
| 283 | - fullQuantity: [{ required: true, message: "请输入满袋数量", trigger: "blur" }], | |
| 333 | + deviceTypeIdList: [ | |
| 334 | + { required: true, message: "请选择关联设备类型", trigger: "blur" }, | |
| 335 | + ], | |
| 336 | + scanResultTypeList: [ | |
| 337 | + { required: true, message: "请选择扫描结果类型", trigger: "blur" }, | |
| 338 | + ], | |
| 339 | + fullQuantity: [ | |
| 340 | + { required: true, message: "请输入满袋数量", trigger: "blur" }, | |
| 341 | + ], | |
| 284 | 342 | }, | 
| 285 | 343 | }); | 
| 286 | 344 | |
| ... | ... | @@ -299,11 +357,11 @@ function submitForm() { | 
| 299 | 357 | getList(); | 
| 300 | 358 | }); | 
| 301 | 359 | } else { | 
| 302 | - // addSortingStation(form.value).then((response) => { | |
| 303 | - // proxy.$modal.msgSuccess("新建成功!"); | |
| 304 | - // open.value = false; | |
| 305 | - // getList(); | |
| 306 | - // }); | |
| 360 | + addSortingStation(form.value).then((response) => { | |
| 361 | + proxy.$modal.msgSuccess("新建成功!"); | |
| 362 | + open.value = false; | |
| 363 | + getList(); | |
| 364 | + }); | |
| 307 | 365 | } | 
| 308 | 366 | } | 
| 309 | 367 | }); | 
| ... | ... | @@ -321,7 +379,7 @@ function reset() { | 
| 321 | 379 | function handleAdd() { | 
| 322 | 380 | reset(); | 
| 323 | 381 | open.value = true; | 
| 324 | - title.value = "Add SortingStation"; | |
| 382 | + title.value = "新增分检口"; | |
| 325 | 383 | } | 
| 326 | 384 | |
| 327 | 385 | const clickEdit = (row) => { | 
| ... | ... | @@ -329,11 +387,15 @@ const clickEdit = (row) => { | 
| 329 | 387 | form.value.id = row.id; | 
| 330 | 388 | form.value.no = row.no; | 
| 331 | 389 | form.value.name = row.name; | 
| 332 | - form.value.deviceTypeIdList = row.deviceTypeList.map(item => item.deviceTypeId + ''); | |
| 390 | + // form.value.deviceTypeIdList = row.deviceTypeList.map( | |
| 391 | + // (item) => item.deviceTypeId + "" | |
| 392 | + // ); | |
| 393 | + form.value.scanResultTypeList = row.sortingScanResultTypeList.map( | |
| 394 | + (item) => item.scanResultType | |
| 395 | + ); | |
| 333 | 396 | form.value.fullQuantity = row.fullQuantity; | 
| 334 | 397 | form.value.remark = row.remark; | 
| 335 | 398 | |
| 336 | - | |
| 337 | 399 | open.value = true; | 
| 338 | 400 | title.value = "编辑分检口"; | 
| 339 | 401 | }; | 
| ... | ... | @@ -365,7 +427,7 @@ const getList = () => { | 
| 365 | 427 | proxy.addDateRange(queryParams.value, dateRange.value) | 
| 366 | 428 | ).then((res) => { | 
| 367 | 429 | loading.value = false; | 
| 368 | - dataList.value = res.data.records | |
| 430 | + dataList.value = res.data.records; | |
| 369 | 431 | console.log(res, 111); | 
| 370 | 432 | total.value = res.data.total; | 
| 371 | 433 | }); | 
| ... | ... | @@ -378,7 +440,17 @@ const getDeviceTypeList = () => { | 
| 378 | 440 | console.log(res, 111); | 
| 379 | 441 | deviceTypeList.value = res.data; | 
| 380 | 442 | }); | 
| 381 | -} | |
| 443 | +}; | |
| 444 | + | |
| 445 | +const getScanResultTypeList = () => { | |
| 446 | + scanResultTypeList().then((res) => { | |
| 447 | + console.log(res, 111); | |
| 448 | + scanResultTypeOptionList.value = Object.keys(res.data).map((key) => ({ | |
| 449 | + label: res.data[key], | |
| 450 | + value: key, | |
| 451 | + })); | |
| 452 | + }); | |
| 453 | +}; | |
| 382 | 454 | |
| 383 | 455 | /** 搜索按钮操作 */ | 
| 384 | 456 | const handleQuery = () => { | 
| ... | ... | @@ -447,7 +519,8 @@ const enterDetail = (row) => { | 
| 447 | 519 | |
| 448 | 520 | onMounted(() => { | 
| 449 | 521 | getList(); | 
| 450 | - getDeviceTypeList() | |
| 522 | + getDeviceTypeList(); | |
| 523 | + getScanResultTypeList(); | |
| 451 | 524 | }); | 
| 452 | 525 | </script> | 
| 453 | 526 | |
| ... | ... | @@ -456,8 +529,8 @@ onMounted(() => { | 
| 456 | 529 | margin: 10px 0 24px; | 
| 457 | 530 | } | 
| 458 | 531 | |
| 459 | -:deep(.is-disabled ){ | |
| 460 | - color: rgb(192, 196, 204) !important; | |
| 532 | +:deep(.is-disabled) { | |
| 533 | + color: rgb(192, 196, 204) !important; | |
| 461 | 534 | } | 
| 462 | 535 | |
| 463 | 536 | .title { | ... | ... | 
| ... | ... | @@ -120,7 +120,9 @@ | 
| 120 | 120 | <el-button | 
| 121 | 121 | link | 
| 122 | 122 | type="primary" | 
| 123 | - :disabled="scope.row.status !== 'WAITING'" | |
| 123 | + :disabled=" | |
| 124 | + scope.row.status !== 'WAITING' && scope.row.status !== 'PAUSE' | |
| 125 | + " | |
| 124 | 126 | @click="editTask(scope.row)" | 
| 125 | 127 | >编辑</el-button | 
| 126 | 128 | > | 
| ... | ... | @@ -129,7 +131,9 @@ | 
| 129 | 131 | <el-button | 
| 130 | 132 | link | 
| 131 | 133 | type="primary" | 
| 132 | - :disabled="scope.row.status !== 'PAUSE'" | |
| 134 | + :disabled=" | |
| 135 | + scope.row.status !== 'WAITING' && scope.row.status !== 'PAUSE' | |
| 136 | + " | |
| 133 | 137 | @click="handleStart(scope.row)" | 
| 134 | 138 | >开始</el-button | 
| 135 | 139 | > | 
| ... | ... | @@ -138,11 +142,7 @@ | 
| 138 | 142 | <el-button | 
| 139 | 143 | link | 
| 140 | 144 | type="primary" | 
| 141 | - :disabled=" | |
| 142 | - (scope.row.status !== 'WAITING' && | |
| 143 | - scope.row.status == 'ONGOING') || | |
| 144 | - scope.row.status == 'PAUSE' | |
| 145 | - " | |
| 145 | + :disabled="scope.row.status !== 'ONGOING'" | |
| 146 | 146 | @click="handlePause(scope.row)" | 
| 147 | 147 | >暂停</el-button | 
| 148 | 148 | > | 
| ... | ... | @@ -215,6 +215,7 @@ import { ElMessageBox } from "element-plus"; | 
| 215 | 215 | import { getToken } from "@/utils/auth"; | 
| 216 | 216 | import { onMounted, ref } from "vue"; | 
| 217 | 217 | import { taskList, startTask, pauseTask } from "@/api/system/scan"; | 
| 218 | +import { formatDate } from "@/utils/index"; | |
| 218 | 219 | const route = useRoute(); | 
| 219 | 220 | const router = useRouter(); | 
| 220 | 221 | |
| ... | ... | @@ -230,28 +231,32 @@ const columnList = ref([ | 
| 230 | 231 | { | 
| 231 | 232 | label: "任务ID", | 
| 232 | 233 | prop: "id", | 
| 233 | - width: 200, | |
| 234 | + width: 70, | |
| 234 | 235 | }, | 
| 235 | 236 | { | 
| 236 | 237 | label: "任务名称", | 
| 237 | 238 | prop: "name", | 
| 239 | + width: 150, | |
| 238 | 240 | }, | 
| 239 | 241 | { | 
| 240 | 242 | label: "对应营业厅", | 
| 241 | 243 | prop: "businessName", | 
| 242 | - width: 200, | |
| 244 | + width: 400, | |
| 243 | 245 | }, | 
| 244 | 246 | { | 
| 245 | 247 | label: "分拣数量", | 
| 246 | - prop: "completedSpecCount", | |
| 248 | + prop: "totalItemCount", | |
| 249 | + width: 200, | |
| 247 | 250 | }, | 
| 248 | 251 | { | 
| 249 | 252 | label: "创建时间", | 
| 250 | 253 | prop: "createTime", | 
| 254 | + width: 200, | |
| 251 | 255 | }, | 
| 252 | 256 | { | 
| 253 | 257 | label: "状态", | 
| 254 | 258 | prop: "status", | 
| 259 | + width: 100, | |
| 255 | 260 | }, | 
| 256 | 261 | ]); | 
| 257 | 262 | |
| ... | ... | @@ -293,7 +298,10 @@ const getList = () => { | 
| 293 | 298 | taskList(proxy.addDateRange(queryParams.value, dateRange.value)).then( | 
| 294 | 299 | (res) => { | 
| 295 | 300 | loading.value = false; | 
| 296 | - dataList.value = res.data.records; | |
| 301 | + dataList.value = res.data.records.map((item) => ({ | |
| 302 | + ...item, | |
| 303 | + createTime: formatDate(item.createTime), | |
| 304 | + })); | |
| 297 | 305 | console.log(res, 111); | 
| 298 | 306 | total.value = res.data.total; | 
| 299 | 307 | } | 
| ... | ... | @@ -371,10 +379,10 @@ const enterDetail = (row) => { | 
| 371 | 379 | |
| 372 | 380 | const handleStart = (row) => { | 
| 373 | 381 | proxy.$modal | 
| 374 | - .confirm("确认重新开始此任务?") | |
| 382 | + .confirm("确认开始此任务?") | |
| 375 | 383 | .then(() => { | 
| 376 | 384 | startTask(row.id).then((res) => { | 
| 377 | - proxy.$modal.msgSuccess("重新开始成功"); | |
| 385 | + proxy.$modal.msgSuccess("开始成功"); | |
| 378 | 386 | getList(); | 
| 379 | 387 | }); | 
| 380 | 388 | }) | ... | ... | 
| ... | ... | @@ -24,7 +24,7 @@ | 
| 24 | 24 | detailData.businessName | 
| 25 | 25 | }}</el-descriptions-item> | 
| 26 | 26 | <el-descriptions-item label="分拣数量:">{{ | 
| 27 | - detailData.totalSpecCount | |
| 27 | + detailData.totalItemCount | |
| 28 | 28 | }}</el-descriptions-item> | 
| 29 | 29 | <el-descriptions-item label="创建时间:">{{ | 
| 30 | 30 | detailData.createTime | 
| ... | ... | @@ -141,6 +141,9 @@ | 
| 141 | 141 | > | 
| 142 | 142 | {{ scope.row[column.prop] }} | 
| 143 | 143 | </span> | 
| 144 | + <span v-else-if="column.prop === 'id'"> | |
| 145 | + {{ scope.row.hideId ? "" : scope.row[column.prop] }} | |
| 146 | + </span> | |
| 144 | 147 | <span v-else>{{ scope.row[column.prop] }}</span> | 
| 145 | 148 | </template> | 
| 146 | 149 | </el-table-column> | 
| ... | ... | @@ -156,7 +159,9 @@ | 
| 156 | 159 | <el-button | 
| 157 | 160 | link | 
| 158 | 161 | type="primary" | 
| 159 | - :disabled="scope.row.status !== 'WAITING'" | |
| 162 | + :disabled=" | |
| 163 | + scope.row.status !== 'WAITING' && scope.row.status !== 'PAUSE' | |
| 164 | + " | |
| 160 | 165 | @click="handleEdit(scope.row)" | 
| 161 | 166 | >编辑</el-button | 
| 162 | 167 | > | 
| ... | ... | @@ -166,7 +171,9 @@ | 
| 166 | 171 | <el-button | 
| 167 | 172 | link | 
| 168 | 173 | type="primary" | 
| 169 | - :disabled="scope.row.status !== 'WAITING'" | |
| 174 | + :disabled=" | |
| 175 | + scope.row.status !== 'WAITING' && scope.row.status !== 'PAUSE' | |
| 176 | + " | |
| 170 | 177 | @click="handleDelete(scope.row)" | 
| 171 | 178 | >删除</el-button | 
| 172 | 179 | > | 
| ... | ... | @@ -224,6 +231,7 @@ | 
| 224 | 231 | <el-col :span="24"> | 
| 225 | 232 | <el-form-item label="条码" prop="barcode"> | 
| 226 | 233 | <el-input | 
| 234 | + ref="barcodeRef" | |
| 227 | 235 | v-model="form.barcode" | 
| 228 | 236 | placeholder="请输入条码" | 
| 229 | 237 | @change="handleBarcodeChange" | 
| ... | ... | @@ -232,7 +240,11 @@ | 
| 232 | 240 | </el-col> | 
| 233 | 241 | <el-col :span="24"> | 
| 234 | 242 | <el-form-item label="类型" prop="deviceTypeId"> | 
| 235 | - <el-select v-model="form.deviceTypeId" placeholder="请选择类型"> | |
| 243 | + <el-select | |
| 244 | + v-model="form.deviceTypeId" | |
| 245 | + placeholder="请选择类型" | |
| 246 | + @change="handleDeviceType" | |
| 247 | + > | |
| 236 | 248 | <el-option | 
| 237 | 249 | v-for="item in deviceTypeList" | 
| 238 | 250 | :key="item.id" | 
| ... | ... | @@ -303,7 +315,8 @@ | 
| 303 | 315 | |
| 304 | 316 | <script setup> | 
| 305 | 317 | import { getToken } from "@/utils/auth"; | 
| 306 | -import { onMounted, ref } from "vue"; | |
| 318 | +import { formatDate } from "@/utils/index"; | |
| 319 | +import { nextTick, onMounted, onUnmounted, ref } from "vue"; | |
| 307 | 320 | import { | 
| 308 | 321 | scanSpecQueryList, | 
| 309 | 322 | deviceTypeQueryList, | 
| ... | ... | @@ -328,15 +341,18 @@ const showSearch = ref(true); | 
| 328 | 341 | const total = ref(0); | 
| 329 | 342 | const dateRange = ref([]); | 
| 330 | 343 | |
| 344 | +const barcodeRef = ref(); | |
| 345 | + | |
| 331 | 346 | const columnList = ref([ | 
| 332 | 347 | { | 
| 333 | 348 | label: "序号", | 
| 334 | 349 | prop: "id", | 
| 335 | - width: 200, | |
| 350 | + width: 70, | |
| 336 | 351 | }, | 
| 337 | 352 | { | 
| 338 | 353 | label: "条码", | 
| 339 | 354 | prop: "barcode", | 
| 355 | + width: 300, | |
| 340 | 356 | }, | 
| 341 | 357 | { | 
| 342 | 358 | label: "类型", | 
| ... | ... | @@ -403,9 +419,23 @@ const getDeviceTypeList = () => { | 
| 403 | 419 | }); | 
| 404 | 420 | }; | 
| 405 | 421 | |
| 406 | -const handleBarcodeChange = () => { | |
| 422 | +const handleDeviceType = (e) => { | |
| 423 | + if (e) { | |
| 424 | + form.value.deviceTypeName = deviceTypeList.value.find( | |
| 425 | + (item) => item.id == e | |
| 426 | + ).name; | |
| 427 | + } else { | |
| 428 | + form.value.deviceTypeName = undefined; | |
| 429 | + } | |
| 430 | +}; | |
| 431 | + | |
| 432 | +const handleBarcodeChange = (e) => { | |
| 407 | 433 | form.value.businessName = undefined; | 
| 408 | 434 | form.value.businessId = undefined; | 
| 435 | + console.log(e); | |
| 436 | + if (e) { | |
| 437 | + searchBusiness(); | |
| 438 | + } | |
| 409 | 439 | }; | 
| 410 | 440 | |
| 411 | 441 | const searchBusiness = () => { | 
| ... | ... | @@ -540,6 +570,11 @@ function handleAdd() { | 
| 540 | 570 | reset(); | 
| 541 | 571 | open.value = true; | 
| 542 | 572 | title.value = "扫码录入"; | 
| 573 | + nextTick(() => { | |
| 574 | + setTimeout(() => { | |
| 575 | + barcodeRef.value.focus(); | |
| 576 | + }, 100); | |
| 577 | + }); | |
| 543 | 578 | } | 
| 544 | 579 | |
| 545 | 580 | // 递归调用接口,直至设备有所返回 | 
| ... | ... | @@ -586,6 +621,11 @@ const handleEdit = (row) => { | 
| 586 | 621 | form.value.businessName = detailData.value.businessName; | 
| 587 | 622 | form.value.businessId = detailData.value.businessId; | 
| 588 | 623 | } | 
| 624 | + nextTick(() => { | |
| 625 | + setTimeout(() => { | |
| 626 | + barcodeRef.value.focus(); | |
| 627 | + }, 100); | |
| 628 | + }); | |
| 589 | 629 | }; | 
| 590 | 630 | |
| 591 | 631 | const goBack = () => { | 
| ... | ... | @@ -664,9 +704,13 @@ const confirmAddTask = () => { | 
| 664 | 704 | |
| 665 | 705 | // Query list | 
| 666 | 706 | const getList = () => { | 
| 667 | - const localStoreTableData = localStorage.getItem("localStoreTableData") | |
| 707 | + let localStoreTableData = localStorage.getItem("localStoreTableData") | |
| 668 | 708 | ? JSON.parse(localStorage.getItem("localStoreTableData")) | 
| 669 | 709 | : []; | 
| 710 | + localStoreTableData = localStoreTableData.map((item) => ({ | |
| 711 | + ...item, | |
| 712 | + hideId: true, | |
| 713 | + })); | |
| 670 | 714 | if (!proxy.$route.query.scanTaskId) { | 
| 671 | 715 | loading.value = false; | 
| 672 | 716 | |
| ... | ... | @@ -732,6 +776,7 @@ const getDetail = () => { | 
| 732 | 776 | scanTaskdetal(proxy.$route.query.scanTaskId).then((res) => { | 
| 733 | 777 | detailData.value = res.data; | 
| 734 | 778 | taskForm.value.taskName = detailData.value.name; | 
| 779 | + detailData.value.createTime = formatDate(detailData.value.createTime); | |
| 735 | 780 | }); | 
| 736 | 781 | }; | 
| 737 | 782 | |
| ... | ... | @@ -784,6 +829,15 @@ const enterDetail = (row) => { | 
| 784 | 829 | }); | 
| 785 | 830 | }; | 
| 786 | 831 | |
| 832 | +const handleKeydown = (e) => { | |
| 833 | + if (e.key === "Enter") { | |
| 834 | + e.preventDefault(); | |
| 835 | + if (open.value) { | |
| 836 | + searchBusiness(); | |
| 837 | + } | |
| 838 | + } | |
| 839 | +}; | |
| 840 | + | |
| 787 | 841 | onMounted(() => { | 
| 788 | 842 | getList(); | 
| 789 | 843 | getDeviceTypeList(); | 
| ... | ... | @@ -791,6 +845,11 @@ onMounted(() => { | 
| 791 | 845 | if (proxy.$route.query.scanTaskId) { | 
| 792 | 846 | getDetail(); | 
| 793 | 847 | } | 
| 848 | + window.addEventListener("keydown", handleKeydown); | |
| 849 | +}); | |
| 850 | + | |
| 851 | +onUnmounted(() => { | |
| 852 | + window.removeEventListener("keydown", handleKeydown); | |
| 794 | 853 | }); | 
| 795 | 854 | </script> | 
| 796 | 855 | ... | ... | 
| ... | ... | @@ -11,7 +11,7 @@ | 
| 11 | 11 | detailData.createTime | 
| 12 | 12 | }}</el-descriptions-item> | 
| 13 | 13 | <el-descriptions-item label="分拣数量:">{{ | 
| 14 | - detailData.totalSpecCount | |
| 14 | + detailData.totalItemCount | |
| 15 | 15 | }}</el-descriptions-item> | 
| 16 | 16 | <!-- <el-descriptions-item label="营业厅代码:">{{ | 
| 17 | 17 | route.query.bookingRef | 
| ... | ... | @@ -271,6 +271,8 @@ | 
| 271 | 271 | |
| 272 | 272 | <script setup> | 
| 273 | 273 | import { getToken } from "@/utils/auth"; | 
| 274 | +import { formatDate } from "@/utils/index"; | |
| 275 | + | |
| 274 | 276 | import { onMounted, ref } from "vue"; | 
| 275 | 277 | import { addScanOrder, scanTaskdetal, scanTaskQueryList, } from "@/api/system/scan"; | 
| 276 | 278 | |
| ... | ... | @@ -288,43 +290,52 @@ const columnList = ref([ | 
| 288 | 290 | { | 
| 289 | 291 | label: "设备类型", | 
| 290 | 292 | prop: "deviceTypeName", | 
| 291 | - width: 200, | |
| 293 | + width: 100, | |
| 292 | 294 | }, | 
| 293 | 295 | { | 
| 294 | 296 | label: "规格型号", | 
| 295 | 297 | prop: "model", | 
| 298 | + width: 150, | |
| 296 | 299 | }, | 
| 297 | 300 | { | 
| 298 | 301 | label: "串码", | 
| 299 | 302 | prop: "barcode", | 
| 303 | + width: 150, | |
| 300 | 304 | }, | 
| 301 | 305 | { | 
| 302 | 306 | label: "重量", | 
| 303 | 307 | prop: "weight", | 
| 308 | + width: 150, | |
| 304 | 309 | }, | 
| 305 | 310 | { | 
| 306 | 311 | label: "状态", | 
| 307 | 312 | prop: "status", | 
| 313 | + width: 150, | |
| 308 | 314 | }, | 
| 309 | 315 | { | 
| 310 | 316 | label: "分拣时间", | 
| 311 | 317 | prop: "scanTime", | 
| 318 | + width: 150, | |
| 312 | 319 | }, | 
| 313 | 320 | { | 
| 314 | 321 | label: "分拣结果", | 
| 315 | 322 | prop: "scanResult", | 
| 323 | + width: 150 | |
| 316 | 324 | }, | 
| 317 | 325 | { | 
| 318 | 326 | label: "备注", | 
| 319 | 327 | prop: "remark", | 
| 328 | + width: 150 | |
| 320 | 329 | }, | 
| 321 | 330 | { | 
| 322 | 331 | label: "分拣人", | 
| 323 | 332 | prop: "scanBy", | 
| 333 | + width: 150, | |
| 324 | 334 | }, | 
| 325 | 335 | { | 
| 326 | 336 | label: "袋码", | 
| 327 | 337 | prop: "sortingNo", | 
| 338 | + width: 150 | |
| 328 | 339 | }, | 
| 329 | 340 | ]); | 
| 330 | 341 | |
| ... | ... | @@ -427,7 +438,10 @@ const getList = () => { | 
| 427 | 438 | scanTaskQueryList(proxy.addDateRange(queryParams.value, dateRange.value)).then( | 
| 428 | 439 | (res) => { | 
| 429 | 440 | loading.value = false; | 
| 430 | - dataList.value = res.data.records | |
| 441 | + dataList.value = res.data.records.map(item => ({ | |
| 442 | + ...item, | |
| 443 | + scanTime:formatDate(item.scanTime) | |
| 444 | + })) | |
| 431 | 445 | total.value = res.data.total; | 
| 432 | 446 | } | 
| 433 | 447 | ); | 
| ... | ... | @@ -501,6 +515,7 @@ const detailData = ref({}); | 
| 501 | 515 | const getDetail = () => { | 
| 502 | 516 | scanTaskdetal(proxy.$route.query.scanTaskId).then((res) => { | 
| 503 | 517 | detailData.value = res.data; | 
| 518 | + detailData.value.createTime = formatDate(detailData.value.createTime) | |
| 504 | 519 | }); | 
| 505 | 520 | }; | 
| 506 | 521 | ... | ... | 
Please
register
or
login
to post a comment