Commit 8f2f797d0d866493e4b7c76097f982d81124e491

Authored by Dunfa Jiang
1 parent 4ba8e6a5

feat:增加批量删除待复核按钮

1   -import request from "@/utils/request";
2   -
3   -export function scanList(query) {
4   - return request({
5   - url: "/scan/task/queryPage",
6   - method: "get",
7   - params: query,
8   - });
9   -}
10   -
11   -export function scanOrderList(query) {
12   - return request({
13   - url: "/scan/order/queryPage",
14   - method: "get",
15   - params: query,
16   - });
17   -}
18   -
19   -export function scanOrderDetailList(query) {
20   - return request({
21   - url: "/scan/specification/queryPage",
22   - method: "get",
23   - params: query,
24   - });
25   -}
26   -
27   -
28   -
29   -export function scanSpecQueryList(query) {
30   - return request({
31   - url: "/scanSpec/queryList",
32   - method: "GET",
33   - params: query,
34   - });
35   -}
36   -
37   -export function scanTaskdetal(id) {
38   - return request({
39   - url: "/scanTask/" + id,
40   - method: "GET"
41   - });
42   -}
43   -
44   -export function scanResultTypeList(query) {
45   - return request({
46   - url: "/sorting/queryScanResultType",
47   - method: "GET",
48   - params: query,
49   - });
50   -}
51   -
52   -
53   -export function deviceTypeQueryList(query) {
54   - return request({
55   - url: "/deviceType/queryList",
56   - method: "GET",
57   - params: query,
58   - });
59   -}
60   -export function sortingStationQueryList(query) {
61   - return request({
62   - url: "/sorting/queryPage",
63   - method: "GET",
64   - params: query,
65   - });
66   -}
67   -
68   -export function businesseQueryList(query) {
69   - return request({
70   - url: "/business/queryPage",
71   - method: "GET",
72   - params: query,
73   - });
74   -}
75   -
76   -export function taskList(query) {
77   - return request({
78   - url: "/scanTask/queryPage",
79   - method: "GET",
80   - params: query,
81   - });
82   -}
83   -
84   -
85   -
86   -export function editSortingStation(query) {
87   - return request({
88   - url: "/sorting",
89   - method: "PUT",
90   - data: query,
91   - });
92   -}
93   -
94   -export function addSortingStation(query) {
95   - return request({
96   - url: "/sorting",
97   - method: "POST",
98   - data: query,
99   - });
100   -}
101   -
102   -export function addScanItem(query) {
103   - return request({
104   - url: "/scanItem",
105   - method: "POST",
106   - data: query,
107   - });
108   -}
109   -
110   -export function deleteScanItem(id) {
111   - return request({
112   - url: "/scanItem/" + id,
113   - method: "DELETE",
114   - });
115   -}
116   -
117   -export function editScanSpec(query) {
118   - return request({
119   - url: "/scanSpec",
120   - method: "PUT",
121   - data: query,
122   - });
123   -}
124   -
125   -
126   -export function editStore(query) {
127   - return request({
128   - url: "/business",
129   - method: "PUT",
130   - data: query,
131   - });
132   -}
133   -
134   -export function deleteStore(id) {
135   - return request({
136   - url: "/business/" + id,
137   - method: "DELETE",
138   - });
139   -}
140   -
141   -
142   -
143   -export function addScanOrder(query) {
144   - return request({
145   - url: "/scan/order",
146   - method: "POST",
147   - data: query,
148   - });
149   -}
150   -
151   -export function addScanSpec(query) {
152   - return request({
153   - url: "/scanSpec",
154   - method: "POST",
155   - data: query,
156   - });
157   -}
158   -
159   -export function scanTaskQueryList(query) {
160   - return request({
161   - url: "/scanItem/queryPage",
162   - method: "GET",
163   - params: query,
164   - });
165   -}
166   -
167   -
168   -export function editScanTask(query) {
169   - return request({
170   - url: "/scanTask",
171   - method: "PUT",
172   - data: query,
173   - });
174   -}
175   -
176   -export function startTask(id) {
177   - return request({
178   - url: `/scanTask/${id}/start`,
179   - method: "PUT"
180   - });
181   -}
182   -
183   -export function pauseTask(id) {
184   - return request({
185   - url: `/scanTask/${id}/pause`,
186   - method: "PUT"
187   - });
188   -}
189   -
190   -
191   -export function finishedTask(id) {
192   - return request({
193   - url: `/scanTask/${id}/finish`,
194   - method: "PUT"
195   - });
196   -}
197   -
198   -
199   -export function searchBusinessInfo(query) {
200   - return request({
201   - url: "/business/detailByNumber",
202   - method: "GET",
203   - params: query,
204   - });
205   -}
206   -
207   -export function addScanTask(query) {
208   - return request({
209   - url: "/scanTask",
210   - method: "POST",
211   - data: query,
212   - });
213   -}
214   -
215   -export function scanCode(query) {
216   - return request({
217   - url: "/scanLog/latest",
218   - method: "GET",
219   - params: query,
220   - });
221   -}
222   -
223   -
224   -
225   -export function deleteScanSpec(id) {
226   - return request({
227   - url: "/scanSpec/" + id,
228   - method: "DELETE"
229   - });
230   -}
231   -
232   -
233   -
234   -export function scanTaskDetail(id) {
235   - return request({
236   - url: "/scan/task/" + id,
237   - method: "GET",
238   - });
239   -}
240   -
241   -export function scanDetailOrder(id) {
242   - return request({
243   - url: "/scan/order/" + id,
244   - method: "GET",
245   - });
246   -}
247   -
  1 +import request from "@/utils/request";
  2 +
  3 +export function scanList(query) {
  4 + return request({
  5 + url: "/scan/task/queryPage",
  6 + method: "get",
  7 + params: query,
  8 + });
  9 +}
  10 +
  11 +export function scanOrderList(query) {
  12 + return request({
  13 + url: "/scan/order/queryPage",
  14 + method: "get",
  15 + params: query,
  16 + });
  17 +}
  18 +
  19 +export function scanOrderDetailList(query) {
  20 + return request({
  21 + url: "/scan/specification/queryPage",
  22 + method: "get",
  23 + params: query,
  24 + });
  25 +}
  26 +
  27 +
  28 +
  29 +export function scanSpecQueryList(query) {
  30 + return request({
  31 + url: "/scanSpec/queryList",
  32 + method: "GET",
  33 + params: query,
  34 + });
  35 +}
  36 +
  37 +export function scanTaskdetal(id) {
  38 + return request({
  39 + url: "/scanTask/" + id,
  40 + method: "GET"
  41 + });
  42 +}
  43 +
  44 +export function scanResultTypeList(query) {
  45 + return request({
  46 + url: "/sorting/queryScanResultType",
  47 + method: "GET",
  48 + params: query,
  49 + });
  50 +}
  51 +
  52 +
  53 +export function deviceTypeQueryList(query) {
  54 + return request({
  55 + url: "/deviceType/queryList",
  56 + method: "GET",
  57 + params: query,
  58 + });
  59 +}
  60 +export function sortingStationQueryList(query) {
  61 + return request({
  62 + url: "/sorting/queryPage",
  63 + method: "GET",
  64 + params: query,
  65 + });
  66 +}
  67 +
  68 +export function businesseQueryList(query) {
  69 + return request({
  70 + url: "/business/queryPage",
  71 + method: "GET",
  72 + params: query,
  73 + });
  74 +}
  75 +
  76 +export function taskList(query) {
  77 + return request({
  78 + url: "/scanTask/queryPage",
  79 + method: "GET",
  80 + params: query,
  81 + });
  82 +}
  83 +
  84 +
  85 +
  86 +export function editSortingStation(query) {
  87 + return request({
  88 + url: "/sorting",
  89 + method: "PUT",
  90 + data: query,
  91 + });
  92 +}
  93 +
  94 +export function addSortingStation(query) {
  95 + return request({
  96 + url: "/sorting",
  97 + method: "POST",
  98 + data: query,
  99 + });
  100 +}
  101 +
  102 +export function addScanItem(query) {
  103 + return request({
  104 + url: "/scanItem",
  105 + method: "POST",
  106 + data: query,
  107 + });
  108 +}
  109 +
  110 +export function deleteScanItem(id) {
  111 + return request({
  112 + url: "/scanItem/" + id,
  113 + method: "DELETE",
  114 + });
  115 +}
  116 +
  117 +export function editScanSpec(query) {
  118 + return request({
  119 + url: "/scanSpec",
  120 + method: "PUT",
  121 + data: query,
  122 + });
  123 +}
  124 +
  125 +
  126 +export function editStore(query) {
  127 + return request({
  128 + url: "/business",
  129 + method: "PUT",
  130 + data: query,
  131 + });
  132 +}
  133 +
  134 +export function deleteStore(id) {
  135 + return request({
  136 + url: "/business/" + id,
  137 + method: "DELETE",
  138 + });
  139 +}
  140 +
  141 +
  142 +
  143 +export function addScanOrder(query) {
  144 + return request({
  145 + url: "/scan/order",
  146 + method: "POST",
  147 + data: query,
  148 + });
  149 +}
  150 +
  151 +export function addScanSpec(query) {
  152 + return request({
  153 + url: "/scanSpec",
  154 + method: "POST",
  155 + data: query,
  156 + });
  157 +}
  158 +
  159 +export function scanTaskQueryList(query) {
  160 + return request({
  161 + url: "/scanItem/queryPage",
  162 + method: "GET",
  163 + params: query,
  164 + });
  165 +}
  166 +
  167 +
  168 +export function editScanTask(query) {
  169 + return request({
  170 + url: "/scanTask",
  171 + method: "PUT",
  172 + data: query,
  173 + });
  174 +}
  175 +
  176 +export function startTask(id) {
  177 + return request({
  178 + url: `/scanTask/${id}/start`,
  179 + method: "PUT"
  180 + });
  181 +}
  182 +
  183 +export function pauseTask(id) {
  184 + return request({
  185 + url: `/scanTask/${id}/pause`,
  186 + method: "PUT"
  187 + });
  188 +}
  189 +
  190 +
  191 +export function finishedTask(id) {
  192 + return request({
  193 + url: `/scanTask/${id}/finish`,
  194 + method: "PUT"
  195 + });
  196 +}
  197 +
  198 +
  199 +export function searchBusinessInfo(query) {
  200 + return request({
  201 + url: "/business/detailByNumber",
  202 + method: "GET",
  203 + params: query,
  204 + });
  205 +}
  206 +
  207 +export function addScanTask(query) {
  208 + return request({
  209 + url: "/scanTask",
  210 + method: "POST",
  211 + data: query,
  212 + });
  213 +}
  214 +
  215 +export function scanCode(query) {
  216 + return request({
  217 + url: "/scanLog/latest",
  218 + method: "GET",
  219 + params: query,
  220 + });
  221 +}
  222 +
  223 +
  224 +
  225 +export function deleteScanSpec(id) {
  226 + return request({
  227 + url: "/scanSpec/" + id,
  228 + method: "DELETE"
  229 + });
  230 +}
  231 +
  232 +
  233 +
  234 +export function scanTaskDetail(id) {
  235 + return request({
  236 + url: "/scan/task/" + id,
  237 + method: "GET",
  238 + });
  239 +}
  240 +
  241 +export function scanDetailOrder(id) {
  242 + return request({
  243 + url: "/scan/order/" + id,
  244 + method: "GET",
  245 + });
  246 +}
  247 +
  248 +
  249 +export function deleteReviewItemTask(id) {
  250 + return request({
  251 + url: `/scanTask/${id}/reviewItem`,
  252 + method: "DELETE",
  253 + });
  254 +}
  255 +
... ...
1   -<template>
2   - <div class="app-container">
3   - <el-descriptions title="" column="3">
4   - <el-descriptions-item label="任务ID:">{{
5   - detailData.id
6   - }}</el-descriptions-item>
7   - <el-descriptions-item label="任务名称:">{{
8   - detailData.name
9   - }}</el-descriptions-item>
10   - <el-descriptions-item label="创建时间:">{{
11   - detailData.createTime
12   - }}</el-descriptions-item>
13   - <el-descriptions-item label="分拣数量:">{{
14   - detailData.totalItemCount
15   - }}</el-descriptions-item>
16   - <!-- <el-descriptions-item label="营业厅代码:">{{
17   - route.query.bookingRef
18   - }}</el-descriptions-item> -->
19   - <el-descriptions-item label="对应营业厅:">{{
20   - detailData.businessName
21   - }}</el-descriptions-item>
22   - </el-descriptions>
23   - <el-divider></el-divider>
24   - <el-form
25   - v-if="false"
26   - :model="queryParams"
27   - ref="queryRef"
28   - v-show="showSearch"
29   - :inline="true"
30   - label-width="100px"
31   - label-position="left"
32   - >
33   - <el-form-item label="Type:" prop="type">
34   - <el-input
35   - v-model="queryParams.type"
36   - placeholder="Please enter type"
37   - clearable
38   - style="width: 240px"
39   - @keyup.enter="handleQuery"
40   - />
41   - </el-form-item>
42   - <el-form-item label="Trans:" prop="trans">
43   - <el-input
44   - v-model="queryParams.trans"
45   - placeholder="Please enter trans"
46   - clearable
47   - style="width: 240px"
48   - @keyup.enter="handleQuery"
49   - />
50   - </el-form-item>
51   - <el-form-item label="Contract No:" prop="contractNo">
52   - <el-input
53   - v-model="queryParams.contractNo"
54   - placeholder="Please enter contractNo"
55   - clearable
56   - style="width: 240px"
57   - @keyup.enter="handleQuery"
58   - />
59   - </el-form-item>
60   - <el-form-item label="Del:" prop="del">
61   - <el-input
62   - v-model="queryParams.del"
63   - placeholder="Please enter del"
64   - clearable
65   - style="width: 240px"
66   - @keyup.enter="handleQuery"
67   - />
68   - </el-form-item>
69   - <el-form-item label="EX-Fact:" prop="exFact">
70   - <el-input
71   - v-model="queryParams.exFact"
72   - placeholder="Please enter exFact"
73   - clearable
74   - style="width: 240px"
75   - @keyup.enter="handleQuery"
76   - />
77   - </el-form-item>
78   - <el-form-item>
79   - <el-button type="primary" icon="Search" @click="handleQuery"
80   - >Search</el-button
81   - >
82   - <el-button icon="Refresh" @click="resetQuery">Reset</el-button>
83   - </el-form-item>
84   - </el-form>
85   - <div class="title">任务详情</div>
86   -
87   - <right-toolbar
88   - v-model:showSearch="showSearch"
89   - :search="false"
90   - @queryTable="getList"
91   - >
92   - <el-row :gutter="10" class="mb8">
93   - <el-col :span="1.5">
94   - <el-button type="primary" plain :disabled="detailData.status !== 'ONGOING'" icon="Plus" @click="addTask"
95   - >新增</el-button
96   - >
97   - </el-col>
98   - <el-col :span="1.5">
99   - <el-button
100   - type="primary"
101   - plain
102   - icon="Download"
103   - @click="handleExportDiff"
104   - >导出回收差异表</el-button
105   - >
106   - </el-col>
107   - <el-col :span="1.5">
108   - <el-button
109   - type="primary"
110   - plain
111   - icon="Download"
112   - @click="handleExportResult"
113   - >导出分拣结果表</el-button
114   - >
115   - </el-col>
116   - </el-row>
117   - </right-toolbar>
118   -
119   - <!-- Table Data -->
120   - <el-table v-loading="loading" :data="dataList">
121   - <el-table-column
122   - v-for="(column, columnIndex) in columnList"
123   - :key="columnIndex"
124   - :label="column.label"
125   - :prop="column.prop"
126   - :show-overflow-tooltip="column.showOverflowTooltip || true"
127   - :align="column.align || 'center'"
128   - :width="column.width || 'auto'"
129   - >
130   - <template #default="scope">
131   - <span
132   - v-if="column.prop === 'status'"
133   - :style="{
134   - fontWeight: 500,
135   - color:
136   - scope.row[column.prop] == 'COMPLETED'
137   - ? '#27B148'
138   - : scope.row[column.prop] === 'WAITING'
139   - ? '#ff6200'
140   - : '#409EFF',
141   - }"
142   - >
143   - {{ scope.row[column.prop] || "/" }}
144   - </span>
145   - <span v-else>{{ scope.row[column.prop] || "/" }}</span>
146   - </template>
147   - </el-table-column>
148   -
149   - <el-table-column
150   - label="操作"
151   - fixed="right"
152   - align="center"
153   - class-name="small-padding fixed-width"
154   - >
155   - <template #default="scope">
156   - <el-tooltip content="删除" placement="top">
157   - <el-button
158   - link
159   - type="primary"
160   - @click="delItem(scope.row)"
161   - >删除</el-button
162   - >
163   - </el-tooltip>
164   - </template>
165   - </el-table-column>
166   - </el-table>
167   -
168   - <pagination
169   - v-show="total > 0"
170   - :total="total"
171   - layout="prev, pager, next"
172   - v-model:page="queryParams.pageNo"
173   - v-model:limit="queryParams.pageSize"
174   - @pagination="getList"
175   - />
176   -
177   - <!-- Add or Edit User Config Dialog -->
178   - <el-dialog :title="title" v-model="open" width="500px" append-to-body>
179   - <el-form :model="form" :rules="rules" @submit.prevent ref="userRef" label-width="120px">
180   - <el-row>
181   - <el-col :span="24">
182   - <el-form-item label="串码" prop="barcode">
183   - <el-input v-model="form.barcode" placeholder="请输入串码" />
184   - </el-form-item>
185   - </el-col>
186   - </el-row>
187   - </el-form>
188   - <template #footer>
189   - <div class="dialog-footer">
190   - <el-button type="primary" :loading="isLoading" @click="submitForm">确认</el-button>
191   - <el-button @click="() => (open = false)">取消</el-button>
192   - </div>
193   - </template>
194   - </el-dialog>
195   -
196   - <el-dialog
197   - :title="upload.title"
198   - v-model="upload.open"
199   - width="400px"
200   - append-to-body
201   - >
202   - <el-upload
203   - ref="uploadRef"
204   - :limit="1"
205   - accept=".xlsx, .xls"
206   - :headers="upload.headers"
207   - :action="upload.url"
208   - :disabled="upload.isUploading"
209   - :on-progress="handleFileUploadProgress"
210   - :on-success="handleFileSuccess"
211   - :auto-upload="false"
212   - drag
213   - >
214   - <el-icon class="el-icon--upload"><upload-filled /></el-icon>
215   - <div class="el-upload__text">
216   - Drag file here, or <em>click to upload</em>
217   - </div>
218   - <template #tip>
219   - <div class="el-upload__tip text-center">
220   - <span>Only xls, xlsx files are allowed.</span>
221   - <!-- <el-link
222   - type="primary"
223   - :underline="false"
224   - style="font-size: 12px; vertical-align: baseline"
225   - @click="importTemplate"
226   - >Download Template</el-link> -->
227   - </div>
228   - </template>
229   - </el-upload>
230   - <template #footer>
231   - <div class="dialog-footer">
232   - <el-button type="primary" @click="submitFileForm">Confirm</el-button>
233   - <el-button @click="upload.open = false">Cancel</el-button>
234   - </div>
235   - </template>
236   - </el-dialog>
237   - </div>
238   -</template>
239   -
240   -<script setup>
241   -import { getToken } from "@/utils/auth";
242   -import { formatDate } from "@/utils/index";
243   -
244   -import { onMounted, ref } from "vue";
245   -import { addScanItem, scanTaskdetal, scanTaskQueryList,deleteScanItem } from "@/api/system/scan";
246   -
247   -const router = useRouter();
248   -const route = useRoute();
249   -const { proxy } = getCurrentInstance();
250   -
251   -const dataList = ref([]);
252   -const loading = ref(true);
253   -const showSearch = ref(true);
254   -const total = ref(0);
255   -const dateRange = ref([]);
256   -
257   -const columnList = ref([
258   - {
259   - label: "设备类型",
260   - prop: "deviceTypeName",
261   - width: 100,
262   - },
263   - {
264   - label: "规格型号",
265   - prop: "model",
266   - width: 150,
267   - },
268   - {
269   - label: "串码",
270   - prop: "barcode",
271   - width: 150,
272   - },
273   - {
274   - label: "重量",
275   - prop: "weight",
276   - width: 150,
277   - },
278   - {
279   - label: "状态",
280   - prop: "status",
281   - width: 150,
282   - },
283   - {
284   - label: "分拣时间",
285   - prop: "scanTime",
286   - width: 200,
287   - },
288   - {
289   - label: "分拣结果",
290   - prop: "scanResult"
291   - },
292   - {
293   - label: "备注",
294   - prop: "remark",
295   - width: 200
296   - },
297   - {
298   - label: "分拣人",
299   - prop: "scanBy",
300   - width: 150,
301   - },
302   - {
303   - label: "分检口号",
304   - prop: "sortingNo",
305   - width: 150
306   - },
307   - {
308   - label: "袋码",
309   - prop: "scanBoxNumber",
310   - width: 180
311   - },
312   -]);
313   -
314   -const data = reactive({
315   - form: {},
316   - queryParams: {
317   - pageNo: 1,
318   - pageSize: 10,
319   - scanTaskId: route.query.scanTaskId
320   - },
321   - rules: {
322   - barcode: [{ required: true, message: "请输入串码", trigger: "blur" }],
323   - },
324   -});
325   -
326   -const { queryParams, form, rules } = toRefs(data);
327   -
328   -const open = ref(false);
329   -const title = ref("");
330   -const isLoading = ref(false)
331   -function submitForm() {
332   - proxy.$refs["userRef"].validate((valid) => {
333   - if (valid) {
334   - isLoading.value = true
335   - addScanItem({
336   - ...form.value,
337   - scanTaskId:route.query.scanTaskId
338   - }).then((response) => {
339   - proxy.$modal.msgSuccess("新增成功!");
340   - open.value = false;
341   -
342   - getList();
343   - }).finally(() => {
344   - isLoading.value = false
345   - })
346   - }
347   - });
348   -}
349   -
350   -const addTask = () => {
351   - reset();
352   - title.value = '新增任务'
353   - open.value = true
354   -}
355   -
356   -const delItem = (row) => {
357   - proxy.$modal
358   - .confirm("确认删除?")
359   - .then(() => {
360   - deleteScanItem(row.id).then((response) => {
361   - proxy.$modal.msgSuccess("删除成功!");
362   - getList();
363   - });
364   - })
365   - .catch(() => {
366   - proxy.$modal.msgWarning("已取消");
367   - });
368   -};
369   -
370   -const handleExportDiff = () => {
371   - proxy.download(
372   - "/scanSpec/difference/export",
373   - {
374   - scanTaskId:route.query.scanTaskId,
375   - status:'COMPLETED'
376   - },
377   - `回收差异表.xlsx`,
378   - {
379   - headers: {}
380   - },
381   - false
382   - );
383   -};
384   -
385   -const handleExportResult = () => {
386   - proxy.download(
387   - "/scanItem/result/export",
388   - {
389   - scanTaskId:route.query.scanTaskId,
390   - status:'COMPLETED'
391   - },
392   - `分拣结果表.xlsx`,
393   - {
394   - headers: {}
395   - },
396   - false
397   - );
398   -};
399   -// Reset operation form
400   -function reset() {
401   - form.value = {
402   - scanTaskId: route.query.scanTaskId,
403   - barcode: undefined
404   - };
405   - proxy.resetForm("userRef");
406   -}
407   -
408   -function handleAdd() {
409   - reset();
410   - open.value = true;
411   - title.value = "Add Order";
412   -}
413   -
414   -// Query list
415   -const getList = () => {
416   - loading.value = true;
417   - scanTaskQueryList(proxy.addDateRange(queryParams.value, dateRange.value)).then(
418   - (res) => {
419   - loading.value = false;
420   - dataList.value = res.data.records.map(item => ({
421   - ...item,
422   - scanTime:formatDate(item.scanTime)
423   - }))
424   - total.value = res.data.total;
425   - }
426   - );
427   -};
428   -
429   -// Search button operation
430   -const handleQuery = () => {
431   - queryParams.value.pageNo = 1;
432   - getList();
433   -};
434   -
435   -// Reset button operation
436   -const resetQuery = () => {
437   - dateRange.value = [];
438   - proxy.resetForm("queryRef");
439   - handleQuery();
440   -};
441   -
442   -const upload = reactive({
443   - open: false,
444   - title: "Import",
445   - isUploading: false,
446   - updateSupport: 0,
447   - headers: { Authorization: "Bearer " + getToken() },
448   - url: import.meta.env.VITE_APP_BASE_API + "/scan/specification/import",
449   -});
450   -
451   -const uploadRef = ref(null);
452   -
453   -const handleImport = () => {
454   - upload.title = "Import";
455   - upload.open = true;
456   - upload.isUploading = false;
457   - upload.updateSupport = 0;
458   -};
459   -
460   -const handleFileUploadProgress = (event, file, fileList) => {
461   - upload.isUploading = true;
462   -};
463   -
464   -const handleFileSuccess = (response, file, fileList) => {
465   - upload.isUploading = false;
466   - if (response.code === 200) {
467   - upload.open = false;
468   - proxy.$modal.msgSuccess(response.msg);
469   - getList(); // Refresh main table
470   - } else {
471   - proxy.$modal.msgError(response.msg);
472   - }
473   -};
474   -
475   -const importTemplate = () => {
476   - proxy.download("/system/user/importTemplate");
477   -};
478   -
479   -const submitFileForm = () => {
480   - uploadRef.value.submit();
481   -};
482   -
483   -const enterDetail = (row) => {
484   - router.push({
485   - path: "/scan-manage/order-manage/order-detail",
486   - query: {
487   - scanTaskId: row.scanTaskId,
488   - scanOrderId: row.id,
489   - },
490   - });
491   -};
492   -
493   -const detailData = ref({});
494   -const getDetail = () => {
495   - scanTaskdetal(proxy.$route.query.scanTaskId).then((res) => {
496   - detailData.value = res.data;
497   - detailData.value.createTime = formatDate(detailData.value.createTime)
498   - });
499   -};
500   -
501   -onMounted(() => {
502   - getList();
503   - getDetail();
504   -});
505   -</script>
506   -
507   -<style lang="scss" scoped>
508   -.el-divider--horizontal {
509   - margin: 10px 0 24px;
510   -}
511   -
512   -.title {
513   - font-weight: 500;
514   - margin: 20px 0px 10px;
515   -}
516   -</style>
  1 +<template>
  2 + <div class="app-container">
  3 + <el-descriptions title="" column="3">
  4 + <el-descriptions-item label="任务ID:">{{
  5 + detailData.id
  6 + }}</el-descriptions-item>
  7 + <el-descriptions-item label="任务名称:">{{
  8 + detailData.name
  9 + }}</el-descriptions-item>
  10 + <el-descriptions-item label="创建时间:">{{
  11 + detailData.createTime
  12 + }}</el-descriptions-item>
  13 + <el-descriptions-item label="分拣数量:">{{
  14 + detailData.totalItemCount
  15 + }}</el-descriptions-item>
  16 + <!-- <el-descriptions-item label="营业厅代码:">{{
  17 + route.query.bookingRef
  18 + }}</el-descriptions-item> -->
  19 + <el-descriptions-item label="对应营业厅:">{{
  20 + detailData.businessName
  21 + }}</el-descriptions-item>
  22 + </el-descriptions>
  23 + <el-divider></el-divider>
  24 + <el-form v-if="false" :model="queryParams" ref="queryRef" v-show="showSearch" :inline="true" label-width="100px"
  25 + label-position="left">
  26 + <el-form-item label="Type:" prop="type">
  27 + <el-input v-model="queryParams.type" placeholder="Please enter type" clearable style="width: 240px"
  28 + @keyup.enter="handleQuery" />
  29 + </el-form-item>
  30 + <el-form-item label="Trans:" prop="trans">
  31 + <el-input v-model="queryParams.trans" placeholder="Please enter trans" clearable style="width: 240px"
  32 + @keyup.enter="handleQuery" />
  33 + </el-form-item>
  34 + <el-form-item label="Contract No:" prop="contractNo">
  35 + <el-input v-model="queryParams.contractNo" placeholder="Please enter contractNo" clearable style="width: 240px"
  36 + @keyup.enter="handleQuery" />
  37 + </el-form-item>
  38 + <el-form-item label="Del:" prop="del">
  39 + <el-input v-model="queryParams.del" placeholder="Please enter del" clearable style="width: 240px"
  40 + @keyup.enter="handleQuery" />
  41 + </el-form-item>
  42 + <el-form-item label="EX-Fact:" prop="exFact">
  43 + <el-input v-model="queryParams.exFact" placeholder="Please enter exFact" clearable style="width: 240px"
  44 + @keyup.enter="handleQuery" />
  45 + </el-form-item>
  46 + <el-form-item>
  47 + <el-button type="primary" icon="Search" @click="handleQuery">Search</el-button>
  48 + <el-button icon="Refresh" @click="resetQuery">Reset</el-button>
  49 + </el-form-item>
  50 + </el-form>
  51 + <div class="title">任务详情</div>
  52 +
  53 + <right-toolbar v-model:showSearch="showSearch" :search="false" @queryTable="getList">
  54 + <el-row :gutter="10" class="mb8">
  55 + <el-col :span="1.5">
  56 + <el-button type="primary" plain :disabled="detailData.status !== 'ONGOING'" icon="Plus"
  57 + @click="addTask">新增</el-button>
  58 + </el-col>
  59 + <el-col :span="1.5">
  60 + <el-button type="primary" plain icon="Download" @click="handleExportDiff">导出回收差异表</el-button>
  61 + </el-col>
  62 + <el-col :span="1.5">
  63 + <el-button type="primary" plain icon="Download" @click="handleExportResult">导出分拣结果表</el-button>
  64 + </el-col>
  65 +
  66 + <el-col :span="1.5">
  67 + <el-button type="primary" plain icon="Delete" @click="handleDeleteCheck">批量删除待复核</el-button>
  68 + </el-col>
  69 + </el-row>
  70 + </right-toolbar>
  71 +
  72 + <!-- Table Data -->
  73 + <el-table v-loading="loading" :data="dataList">
  74 + <el-table-column v-for="(column, columnIndex) in columnList" :key="columnIndex" :label="column.label"
  75 + :prop="column.prop" :show-overflow-tooltip="column.showOverflowTooltip || true"
  76 + :align="column.align || 'center'" :width="column.width || 'auto'">
  77 + <template #default="scope">
  78 + <span v-if="column.prop === 'status'" :style="{
  79 + fontWeight: 500,
  80 + color:
  81 + scope.row[column.prop] == 'COMPLETED'
  82 + ? '#27B148'
  83 + : scope.row[column.prop] === 'WAITING'
  84 + ? '#ff6200'
  85 + : '#409EFF',
  86 + }">
  87 + {{ scope.row[column.prop] || "/" }}
  88 + </span>
  89 + <span v-else>{{ scope.row[column.prop] || "/" }}</span>
  90 + </template>
  91 + </el-table-column>
  92 +
  93 + <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
  94 + <template #default="scope">
  95 + <el-tooltip content="删除" placement="top">
  96 + <el-button link type="primary" @click="delItem(scope.row)">删除</el-button>
  97 + </el-tooltip>
  98 + </template>
  99 + </el-table-column>
  100 + </el-table>
  101 +
  102 + <pagination v-show="total > 0" :total="total" layout="prev, pager, next" v-model:page="queryParams.pageNo"
  103 + v-model:limit="queryParams.pageSize" @pagination="getList" />
  104 +
  105 + <!-- Add or Edit User Config Dialog -->
  106 + <el-dialog :title="title" v-model="open" width="500px" append-to-body>
  107 + <el-form :model="form" :rules="rules" @submit.prevent ref="userRef" label-width="120px">
  108 + <el-row>
  109 + <el-col :span="24">
  110 + <el-form-item label="串码" prop="barcode">
  111 + <el-input v-model="form.barcode" placeholder="请输入串码" />
  112 + </el-form-item>
  113 + </el-col>
  114 + </el-row>
  115 + </el-form>
  116 + <template #footer>
  117 + <div class="dialog-footer">
  118 + <el-button type="primary" :loading="isLoading" @click="submitForm">确认</el-button>
  119 + <el-button @click="() => (open = false)">取消</el-button>
  120 + </div>
  121 + </template>
  122 + </el-dialog>
  123 +
  124 + <el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
  125 + <el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url"
  126 + :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
  127 + :auto-upload="false" drag>
  128 + <el-icon class="el-icon--upload"><upload-filled /></el-icon>
  129 + <div class="el-upload__text">
  130 + Drag file here, or <em>click to upload</em>
  131 + </div>
  132 + <template #tip>
  133 + <div class="el-upload__tip text-center">
  134 + <span>Only xls, xlsx files are allowed.</span>
  135 + <!-- <el-link
  136 + type="primary"
  137 + :underline="false"
  138 + style="font-size: 12px; vertical-align: baseline"
  139 + @click="importTemplate"
  140 + >Download Template</el-link> -->
  141 + </div>
  142 + </template>
  143 + </el-upload>
  144 + <template #footer>
  145 + <div class="dialog-footer">
  146 + <el-button type="primary" @click="submitFileForm">Confirm</el-button>
  147 + <el-button @click="upload.open = false">Cancel</el-button>
  148 + </div>
  149 + </template>
  150 + </el-dialog>
  151 + </div>
  152 +</template>
  153 +
  154 +<script setup>
  155 +import { getToken } from "@/utils/auth";
  156 +import { formatDate } from "@/utils/index";
  157 +
  158 +import { onMounted, ref } from "vue";
  159 +import { addScanItem, scanTaskdetal, scanTaskQueryList, deleteScanItem, deleteReviewItemTask } from "@/api/system/scan";
  160 +
  161 +const router = useRouter();
  162 +const route = useRoute();
  163 +const { proxy } = getCurrentInstance();
  164 +
  165 +const dataList = ref([]);
  166 +const loading = ref(true);
  167 +const showSearch = ref(true);
  168 +const total = ref(0);
  169 +const dateRange = ref([]);
  170 +
  171 +const columnList = ref([
  172 + {
  173 + label: "设备类型",
  174 + prop: "deviceTypeName",
  175 + width: 100,
  176 + },
  177 + {
  178 + label: "规格型号",
  179 + prop: "model",
  180 + width: 150,
  181 + },
  182 + {
  183 + label: "串码",
  184 + prop: "barcode",
  185 + width: 150,
  186 + },
  187 + {
  188 + label: "重量",
  189 + prop: "weight",
  190 + width: 150,
  191 + },
  192 + {
  193 + label: "状态",
  194 + prop: "status",
  195 + width: 150,
  196 + },
  197 + {
  198 + label: "分拣时间",
  199 + prop: "scanTime",
  200 + width: 200,
  201 + },
  202 + {
  203 + label: "分拣结果",
  204 + prop: "scanResult"
  205 + },
  206 + {
  207 + label: "备注",
  208 + prop: "remark",
  209 + width: 200
  210 + },
  211 + {
  212 + label: "分拣人",
  213 + prop: "scanBy",
  214 + width: 150,
  215 + },
  216 + {
  217 + label: "分检口号",
  218 + prop: "sortingNo",
  219 + width: 150
  220 + },
  221 + {
  222 + label: "袋码",
  223 + prop: "scanBoxNumber",
  224 + width: 180
  225 + },
  226 +]);
  227 +
  228 +const data = reactive({
  229 + form: {},
  230 + queryParams: {
  231 + pageNo: 1,
  232 + pageSize: 10,
  233 + scanTaskId: route.query.scanTaskId
  234 + },
  235 + rules: {
  236 + barcode: [{ required: true, message: "请输入串码", trigger: "blur" }],
  237 + },
  238 +});
  239 +
  240 +const { queryParams, form, rules } = toRefs(data);
  241 +
  242 +const open = ref(false);
  243 +const title = ref("");
  244 +const isLoading = ref(false)
  245 +function submitForm() {
  246 + proxy.$refs["userRef"].validate((valid) => {
  247 + if (valid) {
  248 + isLoading.value = true
  249 + addScanItem({
  250 + ...form.value,
  251 + scanTaskId: route.query.scanTaskId
  252 + }).then((response) => {
  253 + proxy.$modal.msgSuccess("新增成功!");
  254 + open.value = false;
  255 +
  256 + getList();
  257 + }).finally(() => {
  258 + isLoading.value = false
  259 + })
  260 + }
  261 + });
  262 +}
  263 +
  264 +const addTask = () => {
  265 + reset();
  266 + title.value = '新增任务'
  267 + open.value = true
  268 +}
  269 +
  270 +const handleDeleteCheck = () => {
  271 + proxy.$modal
  272 + .confirm("确认批量删除待复核?")
  273 + .then(() => {
  274 + deleteReviewItemTask(route.query.scanTaskId).then((response) => {
  275 + proxy.$modal.msgSuccess("批量删除待复核成功!");
  276 + getList();
  277 + });
  278 + })
  279 + .catch(() => {
  280 + proxy.$modal.msgWarning("已取消");
  281 + });
  282 +}
  283 +
  284 +const delItem = (row) => {
  285 + proxy.$modal
  286 + .confirm("确认删除?")
  287 + .then(() => {
  288 + deleteScanItem(row.id).then((response) => {
  289 + proxy.$modal.msgSuccess("删除成功!");
  290 + getList();
  291 + });
  292 + })
  293 + .catch(() => {
  294 + proxy.$modal.msgWarning("已取消");
  295 + });
  296 +};
  297 +
  298 +const handleExportDiff = () => {
  299 + proxy.download(
  300 + "/scanSpec/difference/export",
  301 + {
  302 + scanTaskId: route.query.scanTaskId,
  303 + status: 'COMPLETED'
  304 + },
  305 + `回收差异表.xlsx`,
  306 + {
  307 + headers: {}
  308 + },
  309 + false
  310 + );
  311 +};
  312 +
  313 +const handleExportResult = () => {
  314 + proxy.download(
  315 + "/scanItem/result/export",
  316 + {
  317 + scanTaskId: route.query.scanTaskId,
  318 + status: 'COMPLETED'
  319 + },
  320 + `分拣结果表.xlsx`,
  321 + {
  322 + headers: {}
  323 + },
  324 + false
  325 + );
  326 +};
  327 +// Reset operation form
  328 +function reset() {
  329 + form.value = {
  330 + scanTaskId: route.query.scanTaskId,
  331 + barcode: undefined
  332 + };
  333 + proxy.resetForm("userRef");
  334 +}
  335 +
  336 +function handleAdd() {
  337 + reset();
  338 + open.value = true;
  339 + title.value = "Add Order";
  340 +}
  341 +
  342 +// Query list
  343 +const getList = () => {
  344 + loading.value = true;
  345 + scanTaskQueryList(proxy.addDateRange(queryParams.value, dateRange.value)).then(
  346 + (res) => {
  347 + loading.value = false;
  348 + dataList.value = res.data.records.map(item => ({
  349 + ...item,
  350 + scanTime: formatDate(item.scanTime)
  351 + }))
  352 + total.value = res.data.total;
  353 + }
  354 + );
  355 +};
  356 +
  357 +// Search button operation
  358 +const handleQuery = () => {
  359 + queryParams.value.pageNo = 1;
  360 + getList();
  361 +};
  362 +
  363 +// Reset button operation
  364 +const resetQuery = () => {
  365 + dateRange.value = [];
  366 + proxy.resetForm("queryRef");
  367 + handleQuery();
  368 +};
  369 +
  370 +const upload = reactive({
  371 + open: false,
  372 + title: "Import",
  373 + isUploading: false,
  374 + updateSupport: 0,
  375 + headers: { Authorization: "Bearer " + getToken() },
  376 + url: import.meta.env.VITE_APP_BASE_API + "/scan/specification/import",
  377 +});
  378 +
  379 +const uploadRef = ref(null);
  380 +
  381 +const handleImport = () => {
  382 + upload.title = "Import";
  383 + upload.open = true;
  384 + upload.isUploading = false;
  385 + upload.updateSupport = 0;
  386 +};
  387 +
  388 +const handleFileUploadProgress = (event, file, fileList) => {
  389 + upload.isUploading = true;
  390 +};
  391 +
  392 +const handleFileSuccess = (response, file, fileList) => {
  393 + upload.isUploading = false;
  394 + if (response.code === 200) {
  395 + upload.open = false;
  396 + proxy.$modal.msgSuccess(response.msg);
  397 + getList(); // Refresh main table
  398 + } else {
  399 + proxy.$modal.msgError(response.msg);
  400 + }
  401 +};
  402 +
  403 +const importTemplate = () => {
  404 + proxy.download("/system/user/importTemplate");
  405 +};
  406 +
  407 +const submitFileForm = () => {
  408 + uploadRef.value.submit();
  409 +};
  410 +
  411 +const enterDetail = (row) => {
  412 + router.push({
  413 + path: "/scan-manage/order-manage/order-detail",
  414 + query: {
  415 + scanTaskId: row.scanTaskId,
  416 + scanOrderId: row.id,
  417 + },
  418 + });
  419 +};
  420 +
  421 +const detailData = ref({});
  422 +const getDetail = () => {
  423 + scanTaskdetal(proxy.$route.query.scanTaskId).then((res) => {
  424 + detailData.value = res.data;
  425 + detailData.value.createTime = formatDate(detailData.value.createTime)
  426 + });
  427 +};
  428 +
  429 +onMounted(() => {
  430 + getList();
  431 + getDetail();
  432 +});
  433 +</script>
  434 +
  435 +<style lang="scss" scoped>
  436 +.el-divider--horizontal {
  437 + margin: 10px 0 24px;
  438 +}
  439 +
  440 +.title {
  441 + font-weight: 500;
  442 + margin: 20px 0px 10px;
  443 +}
  444 +</style>
... ...
Please register or login to post a comment