|
|
@@ -94,15 +94,41 @@
|
|
|
</div>
|
|
|
<div class="dispatch-toolbar-icons">
|
|
|
<el-tooltip content="刷新" placement="top">
|
|
|
- <el-button square size="mini">
|
|
|
+ <el-button
|
|
|
+ square
|
|
|
+ size="mini"
|
|
|
+ :loading="dispatchRefreshLoading"
|
|
|
+ @click="handleDispatchRefresh"
|
|
|
+ >
|
|
|
<i class="el-icon-refresh"></i>
|
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
|
- <el-tooltip content="列设置" placement="top">
|
|
|
- <el-button square size="mini">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom-end"
|
|
|
+ width="220"
|
|
|
+ trigger="click"
|
|
|
+ popper-class="dispatch-column-popover"
|
|
|
+ >
|
|
|
+ <div class="dispatch-column-settings">
|
|
|
+ <div class="dispatch-column-settings__title">列设置</div>
|
|
|
+ <el-checkbox-group
|
|
|
+ v-model="dispatchVisibleColumns"
|
|
|
+ class="dispatch-column-settings__list"
|
|
|
+ @change="handleDispatchColumnVisibleChange"
|
|
|
+ >
|
|
|
+ <el-checkbox
|
|
|
+ v-for="column in dispatchColumnOptions"
|
|
|
+ :key="column.key"
|
|
|
+ :label="column.key"
|
|
|
+ >
|
|
|
+ {{ column.label }}
|
|
|
+ </el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </div>
|
|
|
+ <el-button slot="reference" square size="mini">
|
|
|
<i class="el-icon-s-operation"></i>
|
|
|
</el-button>
|
|
|
- </el-tooltip>
|
|
|
+ </el-popover>
|
|
|
<el-tooltip
|
|
|
:content="dotLineFullscreen ? '退出全屏' : '全屏展示'"
|
|
|
placement="top"
|
|
|
@@ -122,6 +148,7 @@
|
|
|
|
|
|
<div class="dispatch-table-wrap">
|
|
|
<el-table
|
|
|
+ ref="dispatchTable"
|
|
|
:data="pagedDispatchObjectRows"
|
|
|
border
|
|
|
size="small"
|
|
|
@@ -153,6 +180,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
+ v-if="isDispatchColumnVisible('displayName')"
|
|
|
prop="displayName"
|
|
|
label="工位名称"
|
|
|
align="center"
|
|
|
@@ -160,6 +188,7 @@
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
+ v-if="isDispatchColumnVisible('code')"
|
|
|
prop="code"
|
|
|
label="编码"
|
|
|
align="center"
|
|
|
@@ -167,6 +196,7 @@
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
+ v-if="isDispatchColumnVisible('assetCode')"
|
|
|
prop="assetCode"
|
|
|
label="设备编码"
|
|
|
align="center"
|
|
|
@@ -174,6 +204,7 @@
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
+ v-if="isDispatchColumnVisible('assetName')"
|
|
|
prop="assetName"
|
|
|
label="设备名称"
|
|
|
align="center"
|
|
|
@@ -181,6 +212,7 @@
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
+ v-if="isDispatchColumnVisible('assetModelType')"
|
|
|
prop="assetModelType"
|
|
|
label="设备型号"
|
|
|
align="center"
|
|
|
@@ -188,6 +220,7 @@
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
+ v-if="isDispatchColumnVisible('assetCategoryLevelPath')"
|
|
|
prop="assetCategoryLevelPath"
|
|
|
label="设备类型"
|
|
|
align="center"
|
|
|
@@ -195,6 +228,7 @@
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
+ v-if="isDispatchColumnVisible('status')"
|
|
|
prop="status"
|
|
|
label="状态"
|
|
|
align="center"
|
|
|
@@ -204,7 +238,12 @@
|
|
|
{{ getDispatchStatusText(row.status) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="数量" align="center" width="140">
|
|
|
+ <el-table-column
|
|
|
+ v-if="isDispatchColumnVisible('quantity')"
|
|
|
+ label="数量"
|
|
|
+ align="center"
|
|
|
+ width="140"
|
|
|
+ >
|
|
|
<template slot-scope="{ row }">
|
|
|
<el-input
|
|
|
:value="row.quantity"
|
|
|
@@ -216,6 +255,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
+ v-if="isDispatchColumnVisible('startTime')"
|
|
|
label="计划开始时间"
|
|
|
align="center"
|
|
|
min-width="220"
|
|
|
@@ -234,6 +274,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
+ v-if="isDispatchColumnVisible('endTime')"
|
|
|
label="计划完成时间"
|
|
|
align="center"
|
|
|
min-width="220"
|
|
|
@@ -262,7 +303,12 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="88" align="center">
|
|
|
+ <el-table-column
|
|
|
+ v-if="isDispatchColumnVisible('action')"
|
|
|
+ label="操作"
|
|
|
+ width="88"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
<template slot-scope="{ row }">
|
|
|
<el-popconfirm
|
|
|
v-if="canResetDispatchRow(row)"
|
|
|
@@ -626,11 +672,55 @@
|
|
|
dispatchRowDraftMap: {},
|
|
|
dispatchAssignmentMap: {},
|
|
|
dispatchToolbarLoading: false,
|
|
|
+ dispatchRefreshLoading: false,
|
|
|
dispatchReportType: 1,
|
|
|
+ dispatchColumnOptions: [
|
|
|
+ { key: 'displayName', label: '工位名称' },
|
|
|
+ { key: 'code', label: '编码' },
|
|
|
+ { key: 'assetCode', label: '设备编码' },
|
|
|
+ { key: 'assetName', label: '设备名称' },
|
|
|
+ { key: 'assetModelType', label: '设备型号' },
|
|
|
+ { key: 'assetCategoryLevelPath', label: '设备类型' },
|
|
|
+ { key: 'status', label: '状态' },
|
|
|
+ { key: 'quantity', label: '数量' },
|
|
|
+ { key: 'startTime', label: '计划开始时间' },
|
|
|
+ { key: 'endTime', label: '计划完成时间' },
|
|
|
+ { key: 'action', label: '操作' }
|
|
|
+ ],
|
|
|
+ dispatchColumnVisible: {
|
|
|
+ displayName: true,
|
|
|
+ code: true,
|
|
|
+ assetCode: true,
|
|
|
+ assetName: true,
|
|
|
+ assetModelType: true,
|
|
|
+ assetCategoryLevelPath: true,
|
|
|
+ status: true,
|
|
|
+ quantity: true,
|
|
|
+ startTime: true,
|
|
|
+ endTime: true,
|
|
|
+ action: true
|
|
|
+ },
|
|
|
suppressTaskListAssignReloadUntil: 0
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
+ dispatchVisibleColumns: {
|
|
|
+ get() {
|
|
|
+ return this.dispatchColumnOptions
|
|
|
+ .filter((item) => this.dispatchColumnVisible[item.key] !== false)
|
|
|
+ .map((item) => item.key);
|
|
|
+ },
|
|
|
+ set(keys) {
|
|
|
+ const visibleKeys = new Set(keys);
|
|
|
+ this.dispatchColumnOptions.forEach((item) => {
|
|
|
+ this.$set(
|
|
|
+ this.dispatchColumnVisible,
|
|
|
+ item.key,
|
|
|
+ visibleKeys.has(item.key)
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
dispatchTaskTabs() {
|
|
|
const groupMap = new Map();
|
|
|
(this.taskList || []).forEach((item) => {
|
|
|
@@ -844,6 +934,18 @@
|
|
|
this.currentPlan?.workOrderSingleReport;
|
|
|
return this.normalizeDispatchReportType(value);
|
|
|
},
|
|
|
+ isDispatchColumnVisible(key) {
|
|
|
+ return this.dispatchColumnVisible[key] !== false;
|
|
|
+ },
|
|
|
+ handleDispatchColumnVisibleChange(keys) {
|
|
|
+ if (!keys.length) {
|
|
|
+ this.dispatchVisibleColumns = ['displayName'];
|
|
|
+ this.$message.warning('至少保留一列');
|
|
|
+ }
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.dispatchTable?.doLayout?.();
|
|
|
+ });
|
|
|
+ },
|
|
|
parseDispatchQuantity(value) {
|
|
|
if (value === null || value === undefined || value === '') {
|
|
|
return null;
|
|
|
@@ -1256,6 +1358,20 @@
|
|
|
this.$message.warning(e.message || '获取派单数据失败');
|
|
|
}
|
|
|
},
|
|
|
+ async handleDispatchRefresh() {
|
|
|
+ if (this.dispatchRefreshLoading) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.dispatchRefreshLoading = true;
|
|
|
+ try {
|
|
|
+ await this.loadDispatchAssignData();
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.dispatchTable?.doLayout?.();
|
|
|
+ });
|
|
|
+ } finally {
|
|
|
+ this.dispatchRefreshLoading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
isEmptyDispatchQuantity(value) {
|
|
|
if (value === null || value === undefined || value === '') {
|
|
|
return true;
|
|
|
@@ -2063,6 +2179,12 @@
|
|
|
font-weight: 500;
|
|
|
color: #909399;
|
|
|
text-align: center;
|
|
|
+ transition: all 0.18s ease;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-tabs__item:not(.is-active):hover {
|
|
|
+ color: #1683d8;
|
|
|
+ background: #f4f9ff;
|
|
|
}
|
|
|
|
|
|
.el-tabs__item.is-active {
|
|
|
@@ -2131,6 +2253,13 @@
|
|
|
.dispatch-toolbar ::v-deep .el-button {
|
|
|
border-radius: 4px;
|
|
|
font-weight: 600;
|
|
|
+ transition: all 0.18s ease;
|
|
|
+ }
|
|
|
+
|
|
|
+ .dispatch-toolbar ::v-deep .el-button:not(.el-button--primary):hover {
|
|
|
+ color: #1683d8;
|
|
|
+ border-color: #bfdcf5;
|
|
|
+ background: #f4f9ff;
|
|
|
}
|
|
|
|
|
|
.dispatch-toolbar-left ::v-deep .el-button--primary {
|
|
|
@@ -2342,6 +2471,21 @@
|
|
|
background: #eef7ff;
|
|
|
}
|
|
|
|
|
|
+ .el-table__body-wrapper::-webkit-scrollbar {
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-table__body-wrapper::-webkit-scrollbar-thumb {
|
|
|
+ border: 2px solid #fff;
|
|
|
+ border-radius: 999px;
|
|
|
+ background: #c9d4e2;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-table__body-wrapper::-webkit-scrollbar-thumb:hover {
|
|
|
+ background: #aeb9c8;
|
|
|
+ }
|
|
|
+
|
|
|
.el-table td,
|
|
|
.el-table th {
|
|
|
padding-top: 6px;
|
|
|
@@ -2355,6 +2499,16 @@
|
|
|
.el-table__fixed-right {
|
|
|
box-shadow: -4px 0 8px rgba(0, 0, 0, 0.04);
|
|
|
}
|
|
|
+
|
|
|
+ .config-table-control .el-input__inner {
|
|
|
+ border-color: #e1e8f0;
|
|
|
+ background: #fbfdff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .config-table-control .el-input__inner:focus {
|
|
|
+ border-color: #1f8ceb;
|
|
|
+ box-shadow: 0 0 0 2px rgba(31, 140, 235, 0.08);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@media (max-width: 576px) {
|
|
|
@@ -2393,3 +2547,36 @@
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .dispatch-column-popover {
|
|
|
+ padding: 12px 14px;
|
|
|
+ border: 1px solid #e6edf5;
|
|
|
+ border-radius: 8px;
|
|
|
+ box-shadow: 0 8px 24px rgba(31, 45, 61, 0.12);
|
|
|
+
|
|
|
+ .dispatch-column-settings__title {
|
|
|
+ margin-bottom: 10px;
|
|
|
+ color: #263445;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+
|
|
|
+ .dispatch-column-settings__list {
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
|
+ gap: 8px 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-checkbox {
|
|
|
+ margin-right: 0;
|
|
|
+ color: #4b5563;
|
|
|
+ line-height: 22px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-checkbox__label {
|
|
|
+ padding-left: 6px;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|