Showing
8 changed files
with
253 additions
and
73 deletions
| @@ -9,4 +9,6 @@ VITE_APP_BASE_URL = '' | @@ -9,4 +9,6 @@ VITE_APP_BASE_URL = '' | ||
| 9 | # 七星分拣管理系统/开发环境 | 9 | # 七星分拣管理系统/开发环境 |
| 10 | # VITE_APP_BASE_API = '/api' | 10 | # VITE_APP_BASE_API = '/api' |
| 11 | # VITE_APP_BASE_API = 'https://vue.ruoyi.vip/prod-api' | 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,5 +9,6 @@ VITE_APP_BASE_URL = '/admin/' | ||
| 9 | # 七星分拣管理系统/生产环境 | 9 | # 七星分拣管理系统/生产环境 |
| 10 | # VITE_APP_BASE_API = '/api' | 10 | # VITE_APP_BASE_API = '/api' |
| 11 | VITE_APP_BASE_API = 'http://qixing-dws.boosal.com' | 11 | VITE_APP_BASE_API = 'http://qixing-dws.boosal.com' |
| 12 | +# VITE_APP_BASE_API = 'http://127.0.0.1' | ||
| 12 | # 是否在打包时开启压缩,支持 gzip 和 brotli | 13 | # 是否在打包时开启压缩,支持 gzip 和 brotli |
| 13 | VITE_BUILD_COMPRESS = gzip | 14 | VITE_BUILD_COMPRESS = gzip |
| @@ -41,7 +41,13 @@ export function scanTaskdetal(id) { | @@ -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 | export function deviceTypeQueryList(query) { | 53 | export function deviceTypeQueryList(query) { |
| @@ -85,6 +91,14 @@ export function editSortingStation(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 | export function editScanSpec(query) { | 102 | export function editScanSpec(query) { |
| 89 | return request({ | 103 | return request({ |
| 90 | url: "/scanSpec", | 104 | url: "/scanSpec", |
| @@ -266,7 +266,7 @@ const columnList = ref([ | @@ -266,7 +266,7 @@ const columnList = ref([ | ||
| 266 | { | 266 | { |
| 267 | label: "序号", | 267 | label: "序号", |
| 268 | prop: "id", | 268 | prop: "id", |
| 269 | - width: 200, | 269 | + width: 70, |
| 270 | }, | 270 | }, |
| 271 | { | 271 | { |
| 272 | label: "区县", | 272 | label: "区县", |
| @@ -275,35 +275,43 @@ const columnList = ref([ | @@ -275,35 +275,43 @@ const columnList = ref([ | ||
| 275 | { | 275 | { |
| 276 | label: "分中心名称", | 276 | label: "分中心名称", |
| 277 | prop: "subName", | 277 | prop: "subName", |
| 278 | + width: 200, | ||
| 278 | }, | 279 | }, |
| 279 | { | 280 | { |
| 280 | label: "营业厅名称", | 281 | label: "营业厅名称", |
| 281 | prop: "name", | 282 | prop: "name", |
| 283 | + width: 300, | ||
| 282 | }, | 284 | }, |
| 283 | { | 285 | { |
| 284 | label: "营业厅编号", | 286 | label: "营业厅编号", |
| 285 | prop: "number", | 287 | prop: "number", |
| 288 | + width: 200, | ||
| 286 | }, | 289 | }, |
| 287 | { | 290 | { |
| 288 | label: "地址", | 291 | label: "地址", |
| 289 | prop: "address", | 292 | prop: "address", |
| 293 | + width: 300, | ||
| 290 | }, | 294 | }, |
| 291 | { | 295 | { |
| 292 | label: "联系人", | 296 | label: "联系人", |
| 293 | prop: "contact", | 297 | prop: "contact", |
| 298 | + width: 100, | ||
| 294 | }, | 299 | }, |
| 295 | { | 300 | { |
| 296 | label: "联系电话", | 301 | label: "联系电话", |
| 297 | prop: "contactNumber", | 302 | prop: "contactNumber", |
| 303 | + width: 100, | ||
| 304 | + | ||
| 298 | }, | 305 | }, |
| 299 | { | 306 | { |
| 300 | label: "备注", | 307 | label: "备注", |
| 301 | prop: "remark", | 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 | console.log(route); | 316 | console.log(route); |
| 309 | const data = reactive({ | 317 | const data = reactive({ |
| @@ -35,13 +35,9 @@ | @@ -35,13 +35,9 @@ | ||
| 35 | <el-button icon="Refresh" @click="resetQuery">Reset</el-button> | 35 | <el-button icon="Refresh" @click="resetQuery">Reset</el-button> |
| 36 | </el-form-item> | 36 | </el-form-item> |
| 37 | </el-form> | 37 | </el-form> |
| 38 | + <div class="title">分拣口管理</div> | ||
| 38 | <el-row :gutter="10" class="mb8"> | 39 | <el-row :gutter="10" class="mb8"> |
| 39 | <!-- <el-col :span="1.5"> | 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 | <el-button | 41 | <el-button |
| 46 | type="primary" | 42 | type="primary" |
| 47 | plain | 43 | plain |
| @@ -55,7 +51,11 @@ | @@ -55,7 +51,11 @@ | ||
| 55 | :search="false" | 51 | :search="false" |
| 56 | @queryTable="getList" | 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 | </right-toolbar> | 59 | </right-toolbar> |
| 60 | </el-row> | 60 | </el-row> |
| 61 | 61 | ||
| @@ -71,10 +71,23 @@ | @@ -71,10 +71,23 @@ | ||
| 71 | :width="column.width || 'auto'" | 71 | :width="column.width || 'auto'" |
| 72 | > | 72 | > |
| 73 | <template #default="scope"> | 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 | </span> | 91 | </span> |
| 79 | <span | 92 | <span |
| 80 | v-else-if="column.prop === 'status'" | 93 | v-else-if="column.prop === 'status'" |
| @@ -127,11 +140,11 @@ | @@ -127,11 +140,11 @@ | ||
| 127 | <!-- 添加或修改用户配置对话框 --> | 140 | <!-- 添加或修改用户配置对话框 --> |
| 128 | <el-dialog :title="title" v-model="open" width="500px" append-to-body> | 141 | <el-dialog :title="title" v-model="open" width="500px" append-to-body> |
| 129 | <template #header> | 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 | <el-row> | 148 | <el-row> |
| 136 | <el-col :span="24"> | 149 | <el-col :span="24"> |
| 137 | <el-form-item label="分检口编号" prop="no"> | 150 | <el-form-item label="分检口编号" prop="no"> |
| @@ -143,16 +156,45 @@ | @@ -143,16 +156,45 @@ | ||
| 143 | <el-input v-model="form.name" placeholder="请输入分检口名称" /> | 156 | <el-input v-model="form.name" placeholder="请输入分检口名称" /> |
| 144 | </el-form-item> | 157 | </el-form-item> |
| 145 | </el-col> | 158 | </el-col> |
| 146 | - <el-col :span="24"> | 159 | + <!-- <el-col :span="24"> |
| 147 | <el-form-item label="关联设备类型" prop="deviceTypeIdList"> | 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 | </el-select> | 188 | </el-select> |
| 151 | </el-form-item> | 189 | </el-form-item> |
| 152 | </el-col> | 190 | </el-col> |
| 153 | <el-col :span="24"> | 191 | <el-col :span="24"> |
| 154 | <el-form-item label="满袋数量" prop="fullQuantity"> | 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 | </el-form-item> | 198 | </el-form-item> |
| 157 | </el-col> | 199 | </el-col> |
| 158 | <el-col :span="24"> | 200 | <el-col :span="24"> |
| @@ -224,10 +266,11 @@ import { getToken } from "@/utils/auth"; | @@ -224,10 +266,11 @@ import { getToken } from "@/utils/auth"; | ||
| 224 | import { onMounted, ref } from "vue"; | 266 | import { onMounted, ref } from "vue"; |
| 225 | import { | 267 | import { |
| 226 | sortingStationQueryList, | 268 | sortingStationQueryList, |
| 227 | - // addSortingStation, | 269 | + addSortingStation, |
| 228 | editSortingStation, | 270 | editSortingStation, |
| 229 | // deleteSortingStation, | 271 | // deleteSortingStation, |
| 230 | - deviceTypeQueryList | 272 | + deviceTypeQueryList, |
| 273 | + scanResultTypeList, | ||
| 231 | } from "@/api/system/scan"; | 274 | } from "@/api/system/scan"; |
| 232 | import { ElMessageBox } from "element-plus"; | 275 | import { ElMessageBox } from "element-plus"; |
| 233 | 276 | ||
| @@ -242,28 +285,36 @@ const showSearch = ref(true); | @@ -242,28 +285,36 @@ const showSearch = ref(true); | ||
| 242 | const total = ref(0); | 285 | const total = ref(0); |
| 243 | const dateRange = ref([]); | 286 | const dateRange = ref([]); |
| 244 | const deviceTypeList = ref([]); | 287 | const deviceTypeList = ref([]); |
| 288 | +const scanResultTypeOptionList = ref([]); | ||
| 245 | 289 | ||
| 246 | const columnList = ref([ | 290 | const columnList = ref([ |
| 247 | { | 291 | { |
| 248 | label: "分检口编号", | 292 | label: "分检口编号", |
| 249 | prop: "no", | 293 | prop: "no", |
| 250 | - width: 200, | 294 | + width: 100, |
| 251 | }, | 295 | }, |
| 252 | { | 296 | { |
| 253 | label: "分检口名称", | 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 | label: "满袋数量", | 312 | label: "满袋数量", |
| 262 | - prop: "fullQuantity" | 313 | + prop: "fullQuantity", |
| 263 | }, | 314 | }, |
| 264 | { | 315 | { |
| 265 | label: "备注", | 316 | label: "备注", |
| 266 | - prop: "remark" | 317 | + prop: "remark", |
| 267 | }, | 318 | }, |
| 268 | ]); | 319 | ]); |
| 269 | console.log(route); | 320 | console.log(route); |
| @@ -279,8 +330,15 @@ const data = reactive({ | @@ -279,8 +330,15 @@ const data = reactive({ | ||
| 279 | rules: { | 330 | rules: { |
| 280 | no: [{ required: true, message: "请输入分检口编号", trigger: "blur" }], | 331 | no: [{ required: true, message: "请输入分检口编号", trigger: "blur" }], |
| 281 | name: [{ required: true, message: "请输入分检口名称", trigger: "blur" }], | 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,11 +357,11 @@ function submitForm() { | ||
| 299 | getList(); | 357 | getList(); |
| 300 | }); | 358 | }); |
| 301 | } else { | 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,7 +379,7 @@ function reset() { | ||
| 321 | function handleAdd() { | 379 | function handleAdd() { |
| 322 | reset(); | 380 | reset(); |
| 323 | open.value = true; | 381 | open.value = true; |
| 324 | - title.value = "Add SortingStation"; | 382 | + title.value = "新增分检口"; |
| 325 | } | 383 | } |
| 326 | 384 | ||
| 327 | const clickEdit = (row) => { | 385 | const clickEdit = (row) => { |
| @@ -329,11 +387,15 @@ const clickEdit = (row) => { | @@ -329,11 +387,15 @@ const clickEdit = (row) => { | ||
| 329 | form.value.id = row.id; | 387 | form.value.id = row.id; |
| 330 | form.value.no = row.no; | 388 | form.value.no = row.no; |
| 331 | form.value.name = row.name; | 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 | form.value.fullQuantity = row.fullQuantity; | 396 | form.value.fullQuantity = row.fullQuantity; |
| 334 | form.value.remark = row.remark; | 397 | form.value.remark = row.remark; |
| 335 | 398 | ||
| 336 | - | ||
| 337 | open.value = true; | 399 | open.value = true; |
| 338 | title.value = "编辑分检口"; | 400 | title.value = "编辑分检口"; |
| 339 | }; | 401 | }; |
| @@ -365,7 +427,7 @@ const getList = () => { | @@ -365,7 +427,7 @@ const getList = () => { | ||
| 365 | proxy.addDateRange(queryParams.value, dateRange.value) | 427 | proxy.addDateRange(queryParams.value, dateRange.value) |
| 366 | ).then((res) => { | 428 | ).then((res) => { |
| 367 | loading.value = false; | 429 | loading.value = false; |
| 368 | - dataList.value = res.data.records | 430 | + dataList.value = res.data.records; |
| 369 | console.log(res, 111); | 431 | console.log(res, 111); |
| 370 | total.value = res.data.total; | 432 | total.value = res.data.total; |
| 371 | }); | 433 | }); |
| @@ -378,7 +440,17 @@ const getDeviceTypeList = () => { | @@ -378,7 +440,17 @@ const getDeviceTypeList = () => { | ||
| 378 | console.log(res, 111); | 440 | console.log(res, 111); |
| 379 | deviceTypeList.value = res.data; | 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 | const handleQuery = () => { | 456 | const handleQuery = () => { |
| @@ -447,7 +519,8 @@ const enterDetail = (row) => { | @@ -447,7 +519,8 @@ const enterDetail = (row) => { | ||
| 447 | 519 | ||
| 448 | onMounted(() => { | 520 | onMounted(() => { |
| 449 | getList(); | 521 | getList(); |
| 450 | - getDeviceTypeList() | 522 | + getDeviceTypeList(); |
| 523 | + getScanResultTypeList(); | ||
| 451 | }); | 524 | }); |
| 452 | </script> | 525 | </script> |
| 453 | 526 | ||
| @@ -456,8 +529,8 @@ onMounted(() => { | @@ -456,8 +529,8 @@ onMounted(() => { | ||
| 456 | margin: 10px 0 24px; | 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 | .title { | 536 | .title { |
| @@ -120,7 +120,9 @@ | @@ -120,7 +120,9 @@ | ||
| 120 | <el-button | 120 | <el-button |
| 121 | link | 121 | link |
| 122 | type="primary" | 122 | type="primary" |
| 123 | - :disabled="scope.row.status !== 'WAITING'" | 123 | + :disabled=" |
| 124 | + scope.row.status !== 'WAITING' && scope.row.status !== 'PAUSE' | ||
| 125 | + " | ||
| 124 | @click="editTask(scope.row)" | 126 | @click="editTask(scope.row)" |
| 125 | >编辑</el-button | 127 | >编辑</el-button |
| 126 | > | 128 | > |
| @@ -129,7 +131,9 @@ | @@ -129,7 +131,9 @@ | ||
| 129 | <el-button | 131 | <el-button |
| 130 | link | 132 | link |
| 131 | type="primary" | 133 | type="primary" |
| 132 | - :disabled="scope.row.status !== 'PAUSE'" | 134 | + :disabled=" |
| 135 | + scope.row.status !== 'WAITING' && scope.row.status !== 'PAUSE' | ||
| 136 | + " | ||
| 133 | @click="handleStart(scope.row)" | 137 | @click="handleStart(scope.row)" |
| 134 | >开始</el-button | 138 | >开始</el-button |
| 135 | > | 139 | > |
| @@ -138,11 +142,7 @@ | @@ -138,11 +142,7 @@ | ||
| 138 | <el-button | 142 | <el-button |
| 139 | link | 143 | link |
| 140 | type="primary" | 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 | @click="handlePause(scope.row)" | 146 | @click="handlePause(scope.row)" |
| 147 | >暂停</el-button | 147 | >暂停</el-button |
| 148 | > | 148 | > |
| @@ -215,6 +215,7 @@ import { ElMessageBox } from "element-plus"; | @@ -215,6 +215,7 @@ import { ElMessageBox } from "element-plus"; | ||
| 215 | import { getToken } from "@/utils/auth"; | 215 | import { getToken } from "@/utils/auth"; |
| 216 | import { onMounted, ref } from "vue"; | 216 | import { onMounted, ref } from "vue"; |
| 217 | import { taskList, startTask, pauseTask } from "@/api/system/scan"; | 217 | import { taskList, startTask, pauseTask } from "@/api/system/scan"; |
| 218 | +import { formatDate } from "@/utils/index"; | ||
| 218 | const route = useRoute(); | 219 | const route = useRoute(); |
| 219 | const router = useRouter(); | 220 | const router = useRouter(); |
| 220 | 221 | ||
| @@ -230,28 +231,32 @@ const columnList = ref([ | @@ -230,28 +231,32 @@ const columnList = ref([ | ||
| 230 | { | 231 | { |
| 231 | label: "任务ID", | 232 | label: "任务ID", |
| 232 | prop: "id", | 233 | prop: "id", |
| 233 | - width: 200, | 234 | + width: 70, |
| 234 | }, | 235 | }, |
| 235 | { | 236 | { |
| 236 | label: "任务名称", | 237 | label: "任务名称", |
| 237 | prop: "name", | 238 | prop: "name", |
| 239 | + width: 150, | ||
| 238 | }, | 240 | }, |
| 239 | { | 241 | { |
| 240 | label: "对应营业厅", | 242 | label: "对应营业厅", |
| 241 | prop: "businessName", | 243 | prop: "businessName", |
| 242 | - width: 200, | 244 | + width: 400, |
| 243 | }, | 245 | }, |
| 244 | { | 246 | { |
| 245 | label: "分拣数量", | 247 | label: "分拣数量", |
| 246 | - prop: "completedSpecCount", | 248 | + prop: "totalItemCount", |
| 249 | + width: 200, | ||
| 247 | }, | 250 | }, |
| 248 | { | 251 | { |
| 249 | label: "创建时间", | 252 | label: "创建时间", |
| 250 | prop: "createTime", | 253 | prop: "createTime", |
| 254 | + width: 200, | ||
| 251 | }, | 255 | }, |
| 252 | { | 256 | { |
| 253 | label: "状态", | 257 | label: "状态", |
| 254 | prop: "status", | 258 | prop: "status", |
| 259 | + width: 100, | ||
| 255 | }, | 260 | }, |
| 256 | ]); | 261 | ]); |
| 257 | 262 | ||
| @@ -293,7 +298,10 @@ const getList = () => { | @@ -293,7 +298,10 @@ const getList = () => { | ||
| 293 | taskList(proxy.addDateRange(queryParams.value, dateRange.value)).then( | 298 | taskList(proxy.addDateRange(queryParams.value, dateRange.value)).then( |
| 294 | (res) => { | 299 | (res) => { |
| 295 | loading.value = false; | 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 | console.log(res, 111); | 305 | console.log(res, 111); |
| 298 | total.value = res.data.total; | 306 | total.value = res.data.total; |
| 299 | } | 307 | } |
| @@ -371,10 +379,10 @@ const enterDetail = (row) => { | @@ -371,10 +379,10 @@ const enterDetail = (row) => { | ||
| 371 | 379 | ||
| 372 | const handleStart = (row) => { | 380 | const handleStart = (row) => { |
| 373 | proxy.$modal | 381 | proxy.$modal |
| 374 | - .confirm("确认重新开始此任务?") | 382 | + .confirm("确认开始此任务?") |
| 375 | .then(() => { | 383 | .then(() => { |
| 376 | startTask(row.id).then((res) => { | 384 | startTask(row.id).then((res) => { |
| 377 | - proxy.$modal.msgSuccess("重新开始成功"); | 385 | + proxy.$modal.msgSuccess("开始成功"); |
| 378 | getList(); | 386 | getList(); |
| 379 | }); | 387 | }); |
| 380 | }) | 388 | }) |
| @@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
| 24 | detailData.businessName | 24 | detailData.businessName |
| 25 | }}</el-descriptions-item> | 25 | }}</el-descriptions-item> |
| 26 | <el-descriptions-item label="分拣数量:">{{ | 26 | <el-descriptions-item label="分拣数量:">{{ |
| 27 | - detailData.totalSpecCount | 27 | + detailData.totalItemCount |
| 28 | }}</el-descriptions-item> | 28 | }}</el-descriptions-item> |
| 29 | <el-descriptions-item label="创建时间:">{{ | 29 | <el-descriptions-item label="创建时间:">{{ |
| 30 | detailData.createTime | 30 | detailData.createTime |
| @@ -141,6 +141,9 @@ | @@ -141,6 +141,9 @@ | ||
| 141 | > | 141 | > |
| 142 | {{ scope.row[column.prop] }} | 142 | {{ scope.row[column.prop] }} |
| 143 | </span> | 143 | </span> |
| 144 | + <span v-else-if="column.prop === 'id'"> | ||
| 145 | + {{ scope.row.hideId ? "" : scope.row[column.prop] }} | ||
| 146 | + </span> | ||
| 144 | <span v-else>{{ scope.row[column.prop] }}</span> | 147 | <span v-else>{{ scope.row[column.prop] }}</span> |
| 145 | </template> | 148 | </template> |
| 146 | </el-table-column> | 149 | </el-table-column> |
| @@ -156,7 +159,9 @@ | @@ -156,7 +159,9 @@ | ||
| 156 | <el-button | 159 | <el-button |
| 157 | link | 160 | link |
| 158 | type="primary" | 161 | type="primary" |
| 159 | - :disabled="scope.row.status !== 'WAITING'" | 162 | + :disabled=" |
| 163 | + scope.row.status !== 'WAITING' && scope.row.status !== 'PAUSE' | ||
| 164 | + " | ||
| 160 | @click="handleEdit(scope.row)" | 165 | @click="handleEdit(scope.row)" |
| 161 | >编辑</el-button | 166 | >编辑</el-button |
| 162 | > | 167 | > |
| @@ -166,7 +171,9 @@ | @@ -166,7 +171,9 @@ | ||
| 166 | <el-button | 171 | <el-button |
| 167 | link | 172 | link |
| 168 | type="primary" | 173 | type="primary" |
| 169 | - :disabled="scope.row.status !== 'WAITING'" | 174 | + :disabled=" |
| 175 | + scope.row.status !== 'WAITING' && scope.row.status !== 'PAUSE' | ||
| 176 | + " | ||
| 170 | @click="handleDelete(scope.row)" | 177 | @click="handleDelete(scope.row)" |
| 171 | >删除</el-button | 178 | >删除</el-button |
| 172 | > | 179 | > |
| @@ -224,6 +231,7 @@ | @@ -224,6 +231,7 @@ | ||
| 224 | <el-col :span="24"> | 231 | <el-col :span="24"> |
| 225 | <el-form-item label="条码" prop="barcode"> | 232 | <el-form-item label="条码" prop="barcode"> |
| 226 | <el-input | 233 | <el-input |
| 234 | + ref="barcodeRef" | ||
| 227 | v-model="form.barcode" | 235 | v-model="form.barcode" |
| 228 | placeholder="请输入条码" | 236 | placeholder="请输入条码" |
| 229 | @change="handleBarcodeChange" | 237 | @change="handleBarcodeChange" |
| @@ -232,7 +240,11 @@ | @@ -232,7 +240,11 @@ | ||
| 232 | </el-col> | 240 | </el-col> |
| 233 | <el-col :span="24"> | 241 | <el-col :span="24"> |
| 234 | <el-form-item label="类型" prop="deviceTypeId"> | 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 | <el-option | 248 | <el-option |
| 237 | v-for="item in deviceTypeList" | 249 | v-for="item in deviceTypeList" |
| 238 | :key="item.id" | 250 | :key="item.id" |
| @@ -303,7 +315,8 @@ | @@ -303,7 +315,8 @@ | ||
| 303 | 315 | ||
| 304 | <script setup> | 316 | <script setup> |
| 305 | import { getToken } from "@/utils/auth"; | 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 | import { | 320 | import { |
| 308 | scanSpecQueryList, | 321 | scanSpecQueryList, |
| 309 | deviceTypeQueryList, | 322 | deviceTypeQueryList, |
| @@ -328,15 +341,18 @@ const showSearch = ref(true); | @@ -328,15 +341,18 @@ const showSearch = ref(true); | ||
| 328 | const total = ref(0); | 341 | const total = ref(0); |
| 329 | const dateRange = ref([]); | 342 | const dateRange = ref([]); |
| 330 | 343 | ||
| 344 | +const barcodeRef = ref(); | ||
| 345 | + | ||
| 331 | const columnList = ref([ | 346 | const columnList = ref([ |
| 332 | { | 347 | { |
| 333 | label: "序号", | 348 | label: "序号", |
| 334 | prop: "id", | 349 | prop: "id", |
| 335 | - width: 200, | 350 | + width: 70, |
| 336 | }, | 351 | }, |
| 337 | { | 352 | { |
| 338 | label: "条码", | 353 | label: "条码", |
| 339 | prop: "barcode", | 354 | prop: "barcode", |
| 355 | + width: 300, | ||
| 340 | }, | 356 | }, |
| 341 | { | 357 | { |
| 342 | label: "类型", | 358 | label: "类型", |
| @@ -403,9 +419,23 @@ const getDeviceTypeList = () => { | @@ -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 | form.value.businessName = undefined; | 433 | form.value.businessName = undefined; |
| 408 | form.value.businessId = undefined; | 434 | form.value.businessId = undefined; |
| 435 | + console.log(e); | ||
| 436 | + if (e) { | ||
| 437 | + searchBusiness(); | ||
| 438 | + } | ||
| 409 | }; | 439 | }; |
| 410 | 440 | ||
| 411 | const searchBusiness = () => { | 441 | const searchBusiness = () => { |
| @@ -540,6 +570,11 @@ function handleAdd() { | @@ -540,6 +570,11 @@ function handleAdd() { | ||
| 540 | reset(); | 570 | reset(); |
| 541 | open.value = true; | 571 | open.value = true; |
| 542 | title.value = "扫码录入"; | 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,6 +621,11 @@ const handleEdit = (row) => { | ||
| 586 | form.value.businessName = detailData.value.businessName; | 621 | form.value.businessName = detailData.value.businessName; |
| 587 | form.value.businessId = detailData.value.businessId; | 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 | const goBack = () => { | 631 | const goBack = () => { |
| @@ -664,9 +704,13 @@ const confirmAddTask = () => { | @@ -664,9 +704,13 @@ const confirmAddTask = () => { | ||
| 664 | 704 | ||
| 665 | // Query list | 705 | // Query list |
| 666 | const getList = () => { | 706 | const getList = () => { |
| 667 | - const localStoreTableData = localStorage.getItem("localStoreTableData") | 707 | + let localStoreTableData = localStorage.getItem("localStoreTableData") |
| 668 | ? JSON.parse(localStorage.getItem("localStoreTableData")) | 708 | ? JSON.parse(localStorage.getItem("localStoreTableData")) |
| 669 | : []; | 709 | : []; |
| 710 | + localStoreTableData = localStoreTableData.map((item) => ({ | ||
| 711 | + ...item, | ||
| 712 | + hideId: true, | ||
| 713 | + })); | ||
| 670 | if (!proxy.$route.query.scanTaskId) { | 714 | if (!proxy.$route.query.scanTaskId) { |
| 671 | loading.value = false; | 715 | loading.value = false; |
| 672 | 716 | ||
| @@ -732,6 +776,7 @@ const getDetail = () => { | @@ -732,6 +776,7 @@ const getDetail = () => { | ||
| 732 | scanTaskdetal(proxy.$route.query.scanTaskId).then((res) => { | 776 | scanTaskdetal(proxy.$route.query.scanTaskId).then((res) => { |
| 733 | detailData.value = res.data; | 777 | detailData.value = res.data; |
| 734 | taskForm.value.taskName = detailData.value.name; | 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,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 | onMounted(() => { | 841 | onMounted(() => { |
| 788 | getList(); | 842 | getList(); |
| 789 | getDeviceTypeList(); | 843 | getDeviceTypeList(); |
| @@ -791,6 +845,11 @@ onMounted(() => { | @@ -791,6 +845,11 @@ onMounted(() => { | ||
| 791 | if (proxy.$route.query.scanTaskId) { | 845 | if (proxy.$route.query.scanTaskId) { |
| 792 | getDetail(); | 846 | getDetail(); |
| 793 | } | 847 | } |
| 848 | + window.addEventListener("keydown", handleKeydown); | ||
| 849 | +}); | ||
| 850 | + | ||
| 851 | +onUnmounted(() => { | ||
| 852 | + window.removeEventListener("keydown", handleKeydown); | ||
| 794 | }); | 853 | }); |
| 795 | </script> | 854 | </script> |
| 796 | 855 |
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | detailData.createTime | 11 | detailData.createTime |
| 12 | }}</el-descriptions-item> | 12 | }}</el-descriptions-item> |
| 13 | <el-descriptions-item label="分拣数量:">{{ | 13 | <el-descriptions-item label="分拣数量:">{{ |
| 14 | - detailData.totalSpecCount | 14 | + detailData.totalItemCount |
| 15 | }}</el-descriptions-item> | 15 | }}</el-descriptions-item> |
| 16 | <!-- <el-descriptions-item label="营业厅代码:">{{ | 16 | <!-- <el-descriptions-item label="营业厅代码:">{{ |
| 17 | route.query.bookingRef | 17 | route.query.bookingRef |
| @@ -271,6 +271,8 @@ | @@ -271,6 +271,8 @@ | ||
| 271 | 271 | ||
| 272 | <script setup> | 272 | <script setup> |
| 273 | import { getToken } from "@/utils/auth"; | 273 | import { getToken } from "@/utils/auth"; |
| 274 | +import { formatDate } from "@/utils/index"; | ||
| 275 | + | ||
| 274 | import { onMounted, ref } from "vue"; | 276 | import { onMounted, ref } from "vue"; |
| 275 | import { addScanOrder, scanTaskdetal, scanTaskQueryList, } from "@/api/system/scan"; | 277 | import { addScanOrder, scanTaskdetal, scanTaskQueryList, } from "@/api/system/scan"; |
| 276 | 278 | ||
| @@ -288,43 +290,52 @@ const columnList = ref([ | @@ -288,43 +290,52 @@ const columnList = ref([ | ||
| 288 | { | 290 | { |
| 289 | label: "设备类型", | 291 | label: "设备类型", |
| 290 | prop: "deviceTypeName", | 292 | prop: "deviceTypeName", |
| 291 | - width: 200, | 293 | + width: 100, |
| 292 | }, | 294 | }, |
| 293 | { | 295 | { |
| 294 | label: "规格型号", | 296 | label: "规格型号", |
| 295 | prop: "model", | 297 | prop: "model", |
| 298 | + width: 150, | ||
| 296 | }, | 299 | }, |
| 297 | { | 300 | { |
| 298 | label: "串码", | 301 | label: "串码", |
| 299 | prop: "barcode", | 302 | prop: "barcode", |
| 303 | + width: 150, | ||
| 300 | }, | 304 | }, |
| 301 | { | 305 | { |
| 302 | label: "重量", | 306 | label: "重量", |
| 303 | prop: "weight", | 307 | prop: "weight", |
| 308 | + width: 150, | ||
| 304 | }, | 309 | }, |
| 305 | { | 310 | { |
| 306 | label: "状态", | 311 | label: "状态", |
| 307 | prop: "status", | 312 | prop: "status", |
| 313 | + width: 150, | ||
| 308 | }, | 314 | }, |
| 309 | { | 315 | { |
| 310 | label: "分拣时间", | 316 | label: "分拣时间", |
| 311 | prop: "scanTime", | 317 | prop: "scanTime", |
| 318 | + width: 150, | ||
| 312 | }, | 319 | }, |
| 313 | { | 320 | { |
| 314 | label: "分拣结果", | 321 | label: "分拣结果", |
| 315 | prop: "scanResult", | 322 | prop: "scanResult", |
| 323 | + width: 150 | ||
| 316 | }, | 324 | }, |
| 317 | { | 325 | { |
| 318 | label: "备注", | 326 | label: "备注", |
| 319 | prop: "remark", | 327 | prop: "remark", |
| 328 | + width: 150 | ||
| 320 | }, | 329 | }, |
| 321 | { | 330 | { |
| 322 | label: "分拣人", | 331 | label: "分拣人", |
| 323 | prop: "scanBy", | 332 | prop: "scanBy", |
| 333 | + width: 150, | ||
| 324 | }, | 334 | }, |
| 325 | { | 335 | { |
| 326 | label: "袋码", | 336 | label: "袋码", |
| 327 | prop: "sortingNo", | 337 | prop: "sortingNo", |
| 338 | + width: 150 | ||
| 328 | }, | 339 | }, |
| 329 | ]); | 340 | ]); |
| 330 | 341 | ||
| @@ -427,7 +438,10 @@ const getList = () => { | @@ -427,7 +438,10 @@ const getList = () => { | ||
| 427 | scanTaskQueryList(proxy.addDateRange(queryParams.value, dateRange.value)).then( | 438 | scanTaskQueryList(proxy.addDateRange(queryParams.value, dateRange.value)).then( |
| 428 | (res) => { | 439 | (res) => { |
| 429 | loading.value = false; | 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 | total.value = res.data.total; | 445 | total.value = res.data.total; |
| 432 | } | 446 | } |
| 433 | ); | 447 | ); |
| @@ -501,6 +515,7 @@ const detailData = ref({}); | @@ -501,6 +515,7 @@ const detailData = ref({}); | ||
| 501 | const getDetail = () => { | 515 | const getDetail = () => { |
| 502 | scanTaskdetal(proxy.$route.query.scanTaskId).then((res) => { | 516 | scanTaskdetal(proxy.$route.query.scanTaskId).then((res) => { |
| 503 | detailData.value = res.data; | 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