1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
| <template>
| <div class="app-container">
| <el-row :gutter="20">
| <el-form
| :model="queryParams"
| ref="queryRef"
| :rules="rules"
| :inline="true"
| v-show="showSearch"
| label-width="68px"
| >
| <el-row :gutter="20">
| <el-col :span="6">
| <el-form-item label="料号" prop="itemCode">
| <el-input
| style="width: 240px"
| v-model="queryParams.itemCode"
| placeholder="请输入料号"
| clearable
| @keyup.enter="handleQuery"
| />
| </el-form-item>
| </el-col>
| <el-col :span="18" style="text-align: right">
| <el-form-item>
| <el-button type="primary" icon="Search" @click="handleQuery"
| >查询</el-button
| >
| <el-button icon="Refresh" @click="resetQuery">重置</el-button>
| </el-form-item>
| </el-col>
| </el-row>
| </el-form>
| </el-row>
| <el-row :gutter="10" class="mb8">
| <el-col :span="1.5">
| <el-button
| type="success"
| plain
| icon="Refresh"
| @click="handleRefresh"
| v-hasPermi="['apsPartRouteStat:edit']"
| >更新</el-button
| >
| </el-col>
| <right-toolbar
| v-model:showSearch="showSearch"
| @queryTable="getList"
| ></right-toolbar>
| </el-row>
|
| <HxlhTable
| style="width: 100%"
| :columns="columns"
| :data="planList"
| :loading="loading"
| :height="height"
| @on-checkbox="handleCheckboxChange"
| :page="page"
| @changePageNo="changePageNo"
| @changePageSize="changePageSize"
| :expand-config="expandConfig"
| :subGridOptions="subGridOptions"
| >
| </HxlhTable>
| </div>
| </template>
|
| <script setup name="ApsPlatePlan">
| import {
| listPlan,
| examplePlan,
| confirmPart,
| } from "@/api/mainPlan/apsPlatePlan.js";
| import { listProcessRoute } from "@/api/basicData/processRoute.js";
| import HxlhTable from "@/components/HxlhTable/index.vue";
| import { ref } from "vue";
| import { getToken } from "@/utils/auth.js";
| import { ElMessage } from "element-plus";
|
| const { proxy } = getCurrentInstance();
| // 分页属性
| const page = ref({
| total: 0,
| current: 1,
| size: 10
| });
| const {
| aps_is_suspended,
| aps_document_status,
| aps_account,
| aps_business_type,
| } = proxy.useDict(
| "aps_is_suspended",
| "aps_document_status",
| "aps_account",
| "aps_business_type"
| );
|
| const exampleList = ref([]);
| const planList = ref([]);
| const loading = ref(true);
| const showSearch = ref(true);
| const single = ref(true);
| const total = ref(0);
| const daterangePlanStartDay = ref([]);
| const daterangePlanEndDay = ref([]);
|
| const height = ref(document.documentElement.clientHeight - 270 + "px;");
| const isVisible = ref(false);
| const isError = ref(false);
| const planned = ref(true);
| const batchNumber = ref(null);
| const exampleHeight = ref("500px");
| const uploadRef = ref();
|
| /*** 用户导入参数 */
| const upload = reactive({
| // 是否显示弹出层(用户导入)
| open: false,
| // 弹出层标题(用户导入)
| title: "",
| // 是否禁用上传
| isUploading: false,
| // 是否更新已经存在的用户数据
| updateSupport: 0,
| // 设置上传的请求头部
| headers: { Authorization: "Bearer " + getToken(), local: "zhl" },
| // 上传的地址
| url: import.meta.env.VITE_APP_BASE_API + "/aps/apsPlatePlan/importData",
| });
|
| // 表格配置
| const exampleColumns = ref([
| { type: "seq", title: "序号", width: 60 },
| {
| title: "主计划员",
| field: "masterPlanner",
| width: 100,
| },
| {
| title: "周日",
| field: "weekDay",
| width: 100,
| formatter: ({ cellValue, row, column }) => {
| if (cellValue) {
| const weekDay = new Date(cellValue);
| const year = weekDay.getFullYear();
| const month = String(weekDay.getMonth() + 1).padStart(2, "0");
| const day = String(weekDay.getDate()).padStart(2, "0");
| return `${month}-${day}`;
| }
| return "";
| },
| },
| {
| title: "周度",
| field: "weekCycle",
| width: 80,
| },
| {
| title: "主件料号",
| field: "mainPartNumber",
| width: 150,
| },
| {
| title: "主件图号",
| field: "mainPartDrawingNumber",
| width: 150,
| },
| {
| title: "客户名称",
| field: "customer",
| width: 200,
| },
| {
| title: "业务类型",
| field: "businessType",
| width: 150,
| },
| {
| title: "单据号",
| field: "documentNumber",
| width: 150,
| },
| {
| title: "需求分类",
| field: "requirementType",
| width: 150,
| },
| {
| title: "单据状态",
| field: "documentStatus",
| width: 100,
| },
| {
| title: "料号",
| field: "itemNumber",
| width: 150,
| },
| {
| title: "图号",
| field: "drawingNo",
| width: 150,
| },
| {
| title: "版本号",
| field: "versionNumber",
| width: 100,
| },
| {
| title: "生产数量",
| field: "productionQuantity",
| width: 100,
| },
| {
| title: "良品数量",
| field: "goodProductsQuantity",
| width: 100,
| },
| {
| title: "工序号",
| field: "processNumber",
| width: 150,
| },
| {
| title: "工作中心",
| field: "workCenter",
| width: 150,
| },
| {
| title: "所属部门",
| field: "department",
| width: 100,
| },
| {
| title: "计划开工日",
| field: "planStartDay",
| width: 100,
| },
| {
| title: "计划完工日",
| field: "planEndDay",
| width: 100,
| },
| {
| title: "备料料号",
| field: "standbyNumber",
| width: 100,
| },
| {
| title: "备料名称",
| field: "standbyName",
| width: 200,
| },
| {
| title: "备料库存",
| field: "standbyStock",
| width: 100,
| },
| {
| title: "下道工序所属部门",
| field: "nextProcessDeparment",
| width: 180,
| },
| {
| title: "是否挂起",
| field: "isSuspended",
| width: 100,
| },
| {
| title: "外协标识",
| field: "isOutsourcing",
| width: 100,
| },
| {
| title: "账套",
| field: "account",
| width: 100,
| },
| // {
| // title: '上阶物料',
| // field: 'advancedMaterials',
| // width: 100,
| // },
| // {
| // title: '上阶单据号',
| // field: 'advancedDocumentNumber',
| // width: 100,
| // },
| // {
| // title: '上阶需求日期',
| // field: 'advancedRequirementDay',
| // width: 150,
| // },
| // {
| // title: '计划齐套',
| // field: 'isPlanComplete',
| // width: 100,
| // },
| // {
| // title: '库存齐套',
| // field: 'isStockComplete',
| // width: 100,
| // },
| // {
| // title: '是否有折返工序',
| // field: 'hasTurnback',
| // width: 150,
| // },
| // {
| // title: '风险标识',
| // field: 'hasRisk',
| // width: 100,
| // },
| ]);
|
| // 表格配置
| const columns = ref([
| {
| field: "expand",
| type: "expand",
| width: 60,
| align: "center",
| slots: { content: "expandContent" },
| },
| { type: "checkbox", width: 60, align: "center" },
| {
| title: "工艺路线ID",
| field: "mainPartNumber",
| },
| {
| title: "工艺路线版本",
| field: "businessType",
| },
| {
| title: "料号",
| field: "documentNumber",
| },
| {
| title: "生效日期",
| field: "requirementType",
| },
| {
| title: "失效日期",
| field: "documentStatus",
| },
| {
| title: "集成日期",
| field: "itemNumber",
| },
| {
| title: "适用工厂",
| field: "drawingNo",
| },
| ]);
|
| const data = reactive({
| form: {},
| queryParams: {
| pageNum: 1,
| pageSize: 10,
| customer: null,
| documentNumber: null,
| itemCode: null,
| },
| rules: {
| itemCode: [{ required: true, message: "请输入料号", trigger: "blur" }],
| },
| });
|
| const { queryParams, form, rules } = toRefs(data);
| function changePageNo(currentPage) {
| queryParams.value.pageNum = currentPage;
| page.value.current = currentPage;
| getList();
| }
| function changePageSize(pageSize) {
| page.value.current = 1;
| queryParams.value.pageNum = 1;
| queryParams.value.pageSize = pageSize;
| getList();
| }
| /** 查询钣金计划临时管理列表 */
| function getExampleList() {
| loading.value = true;
| queryParams.value = {};
| queryParams.value.batchNumber = batchNumber.value;
| examplePlan(queryParams.value).then((response) => {
| exampleList.value = response.rows;
| total.value = response.total;
| loading.value = false;
| });
| }
|
| /** 查询零件计划管理列表 */
| function getList() {
| loading.value = true;
| queryParams.value.params = {};
| if (null != daterangePlanStartDay && "" !== daterangePlanStartDay) {
| queryParams.value.params["beginPlanStartDay"] =
| daterangePlanStartDay.value[0];
| queryParams.value.params["endPlanStartDay"] =
| daterangePlanStartDay.value[1];
| }
| if (null != daterangePlanEndDay && "" !== daterangePlanEndDay) {
| queryParams.value.params["beginPlanEndDay"] = daterangePlanEndDay.value[0];
| queryParams.value.params["endPlanEndDay"] = daterangePlanEndDay.value[1];
| }
| listPlan(queryParams.value).then((response) => {
| planList.value = response.rows;
| loading.value = false;
| });
| }
|
| /** 搜索按钮操作 */
| function handleQuery() {
| proxy.$refs["queryRef"].validate((valid) => {
| if (valid) {
| getList();
| }
| });
| }
|
| /** 重置按钮操作 */
| function resetQuery() {
| daterangePlanStartDay.value = [];
| daterangePlanEndDay.value = [];
| proxy.resetForm("queryRef");
| handleQuery();
| }
|
| // 多选框选中数据
| const handleCheckboxChange = (data) => {
| console.log(data);
| };
|
| /** 批量修改计划开工日按钮操作 */
| function plannedStart() {}
|
| /** 批量修改计划完工日按钮操作 */
| function plannedEnd() {}
|
| /** 导入按钮操作 */
| function handleImport() {
| upload.title = "钣金计划数据上传";
| upload.open = true;
| }
|
| /** 导出按钮操作 */
| function handleExport() {
| proxy.download(
| "aps/apsPlatePlan/export",
| {
| ...queryParams.value,
| },
| `plan_${new Date().getTime()}.xlsx`
| );
| }
|
| /** 下载模板操作 */
| function importTemplate() {
| proxy.download(
| "system/user/importTemplate",
| {},
| `user_template_${new Date().getTime()}.xlsx`
| );
| }
|
| /** buildEexample */
| function buildEexample() {
| proxy.$refs["uploadRef"].submit();
| }
|
| /**文件上传中处理 */
| const handleFileUploadProgress = (event, file, fileList) => {
| upload.isUploading = true;
| };
|
| /** 文件上传成功处理 */
| const handleFileSuccess = (response, file, fileList) => {
| if (response.code == "200") {
| batchNumber.value = response.data;
| isVisible.value = true;
| planned.value = false;
| isError.value = false;
| getExampleList();
| } else {
| isError.value = true;
| proxy.$alert(
| "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
| response.msg +
| "</div>",
| "导入结果",
| { dangerouslyUseHTMLString: true }
| );
| }
| proxy.$refs["uploadRef"].handleRemove(file);
| upload.isUploading = false;
| };
|
| /** 上传并解析按钮操作 */
| function uploadParse() {
| queryParams.value.params = {};
| queryParams.value.params["batchNumber"] = batchNumber.value;
| confirmPart(queryParams.value).then((response) => {
| exampleList.value = response.rows;
| loading.value = false;
| isVisible.value = false;
| isError.value = false;
| planned.value = true;
| upload.open = false;
| ElMessage({
| message: "气体管路计划数据已成功上传和解析",
| type: "success",
| });
| getList();
| });
| }
|
| /** dialog取消 */
| function dialogCancel() {
| if (uploadRef.value) {
| uploadRef.value.clearFiles();
| }
| isVisible.value = false;
| isError.value = false;
| planned.value = true;
| upload.open = false;
| upload.isUploading = false;
| }
| /*定义下拉二级表*/
|
| const subGridOptions = reactive({
| border: true,
| showOverflow: true,
| columns: [
| {
| title: "工艺路线ID",
| field: "itemNo",
| width: 150,
| align: "center",
| },
| {
| title: "工序序号",
| field: "workOrderNo",
| width: 150,
| align: "center",
| },
| {
| title: "工序名称",
| field: "processNumber",
| width: 100,
| align: "center",
| },
| {
| title: "生效日期",
| field: "processName",
| width: 150,
| align: "center",
| },
| {
| title: "失效日期",
| field: "processPlanStartDay",
| width: 200,
| align: "center",
| },
| {
| title: "集成日期",
| field: "processPlanEndDay",
| width: 200,
| align: "center",
| },
| {
| title: "适用工厂",
| field: "standardTime",
| width: 90,
| align: "center",
| },
| {
| title: "适用车间",
| field: "processOrder",
| width: 90,
| align: "center",
| },
| {
| title: "产能模型",
| field: "integrationDay",
| width: 160,
| align: "center",
| },
| {
| title: "设计产能",
| field: "integrationDay",
| width: 160,
| align: "center",
| },
| ],
| });
| const expandConfig = ref({
| lazy: true,
| loadMethod({ row }) {
| // 调用接口
| return listProcessRoute({ workOrderNo: row.documentNumber }).then(
| (data) => {
| row.subList = data.rows;
| }
| );
| },
| });
|
| getList();
| </script>
| <style lang="css" scoped>
| h4 {
| font-weight: bold;
| }
| </style>
|
|