排产看板问题修改

dev-scheduling
zhangdi 2 days ago
parent 446784a596
commit fd4a06ae3e
  1. 22
      src/api/productionSchedulingPlan/basic.js
  2. 153
      src/views/productionSchedulingPlan/schedulingDashboard/index.vue

@ -263,3 +263,25 @@ export const getWorkCenter = (params) => {
params: params, params: params,
}); });
}; };
// 查询班组
export const getTeamSet = (params) => {
return request({
url: '/blade-scheduling/teamSet/findList',
method: 'get',
params: params,
});
};
/**
* 文件流返回
* @param url 接口地址
* @param params 接口参数
*/
export const exportBlob = (url, params) => {
return request({
url: url,
// params: params,
data:params,
method: 'post',
responseType: 'blob',
});
};

@ -11,12 +11,14 @@
filterable filterable
placeholder="请选择" placeholder="请选择"
size="small" size="small"
value-key="id"
@change="teamChange"
> >
<el-option <el-option
v-for="(item, index) in selectTeamOptions" v-for="(item, index) in selectTeamOptions"
:label="item" :label="item.tsName"
:value="item" :value="item"
:key="index" :key="item"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -29,10 +31,12 @@
filterable filterable
placeholder="请选择" placeholder="请选择"
size="small" size="small"
value-key="id"
@change="equipChange"
> >
<el-option <el-option
v-for="(item, index) in selectEquipOptions" v-for="(item, index) in selectEquipOptions"
:label="item" :label="item.deviceName"
:value="item" :value="item"
:key="index" :key="index"
></el-option> ></el-option>
@ -41,19 +45,21 @@
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="工序:"> <el-form-item label="工序:">
<!-- <el-input v-model="formLabelAlign.processName" placeholder="请输入"></el-input> -->
<el-select <el-select
v-model="formLabelAlign.processName" v-model="formLabelAlign.processId"
clearable clearable
filterable filterable
placeholder="请选择" placeholder="请选择"
size="small" size="small"
@change="processChange"
value-key="id"
> >
<el-option <el-option
v-for="(item, index) in selectProcessOptions" v-for="(item, index) in selectProcessOptions"
:label="item.name" :label="item.name"
:value="item.name" :value="item"
:key="index" :key="index"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -84,6 +90,9 @@
<!-- 头部标题和图例 --> <!-- 头部标题和图例 -->
<div class="gantt-header"> <div class="gantt-header">
<div class="status-legend"> <div class="status-legend">
<div class="legend-item">
<el-button type="primary" size="small" @click="exportXls">导出</el-button>
</div>
<div class="legend-item"> <div class="legend-item">
<span class="legend-color completed"></span> <span class="legend-color completed"></span>
<span>已完成</span> <span>已完成</span>
@ -104,11 +113,12 @@
<!-- 左侧信息列表 - 展示车间订单号等信息 --> <!-- 左侧信息列表 - 展示车间订单号等信息 -->
<div class="info-list"> <div class="info-list">
<div class="info-item-title"> <div class="info-item-title">
<div class="info-title-cell info-title-no">车间订单号</div> <div class="info-title-cell">订单信息</div>
<!-- <div class="info-title-cell info-title-no">车间订单号</div>
<div class="info-title-cell info-title-no">零件号</div> <div class="info-title-cell info-title-no">零件号</div>
<div class="info-title-cell">批次号</div> <div class="info-title-cell">批次号</div>
<div class="info-title-cell info-title-num">数量</div> <div class="info-title-cell info-title-num">数量</div>
<div class="info-title-cell info-title-num">质量等级</div> <div class="info-title-cell info-title-num">质量等级</div> -->
</div> </div>
<div class="info-container"> <div class="info-container">
<div <div
@ -121,11 +131,28 @@
}" }"
> >
<div class="info-item"> <div class="info-item">
<div class="info-cell info-title-no">{{ order.woCode }}</div> <el-row>
<el-col :span="12">
<div class="info-item-txt">订单号{{ order.woCode }}</div>
</el-col>
<el-col :span="12">
<div class="info-item-txt">零件号{{ order.partCode }}</div>
</el-col>
<el-col :span="8">
<div class="info-item-txt">批次号{{ order.batchNo }}</div>
</el-col>
<el-col :span="8">
<div class="info-item-txt">数量{{ order.makeQty }}</div>
</el-col>
<el-col :span="8">
<div class="info-item-txt">质量等级{{ order.productIdent }}</div>
</el-col>
</el-row>
<!-- <div class="info-cell info-title-no">{{ order.woCode }}</div>
<div class="info-cell info-title-no">{{ order.partCode }}</div> <div class="info-cell info-title-no">{{ order.partCode }}</div>
<div class="info-cell">{{ order.batchNo }}</div> <div class="info-cell">{{ order.batchNo }}</div>
<div class="info-cell info-title-num">{{ order.makeQty }}</div> <div class="info-cell info-title-num">{{ order.makeQty }}</div>
<div class="info-cell info-title-num">{{ order.productIdent }}</div> <div class="info-cell info-title-num">{{ order.productIdent }}</div> -->
</div> </div>
</div> </div>
</div> </div>
@ -331,7 +358,9 @@
<script> <script>
import { getData, selectEquip, selectTeam } from '@/api/productionSchedulingPlan/scheduling'; import { getData, selectEquip, selectTeam } from '@/api/productionSchedulingPlan/scheduling';
import { getProcessSet } from '@/api/productionSchedulingPlan/basic'; import { getProcessSet, exportBlob,getEquipment,getTeamSet } from '@/api/productionSchedulingPlan/basic';
import { downloadXls } from '@/utils/util';
// import { exportBlob } from '@/api/common';
export default { export default {
name: 'GanttChart', name: 'GanttChart',
data() { data() {
@ -339,8 +368,11 @@ export default {
formLabelAlign: { formLabelAlign: {
startTime: null, // startTime: null, //
teamName: '', // teamName: '', //
teamId: '', //
equipName: '', // equipName: '', //
equipId: '', //
processName: '', // processName: '', //
processId: '', //
woCode: '', // woCode: '', //
}, },
zoomLevel: 12, // (1-4) zoomLevel: 12, // (1-4)
@ -355,7 +387,7 @@ export default {
// //
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 6,
// //
tooltipVisible: false, tooltipVisible: false,
@ -364,8 +396,8 @@ export default {
tooltipY: 0, tooltipY: 0,
// //
baseRowHeight: 36, baseRowHeight: 70,
baseRowChartHeight: 37, baseRowChartHeight: 71,
rowHeights: {}, rowHeights: {},
selectTeamOptions: [], selectTeamOptions: [],
selectEquipOptions: [], selectEquipOptions: [],
@ -423,11 +455,49 @@ export default {
this.getData(); this.getData();
this.calcCurrentTimePosition(); this.calcCurrentTimePosition();
// 线 // 线
// setInterval(() => { setInterval(() => {
// this.calcCurrentTimePosition(); this.calcCurrentTimePosition();
// }, 60000); // }, 600000); //
}, },
methods: { methods: {
processChange(val){
this.formLabelAlign.processName = val.name
},
equipChange(val){
this.formLabelAlign.equipName = val.deviceName
},
teamChange(val){
this.formLabelAlign.teamName = val.tsName
},
//
exportXls() {
exportBlob(`/blade-scheduling/workOrder/exportBoard`, this.formLabelAlign).then(res => {
//
console.log(this.$route.path == '/productionSchedulingPlan/schedulingDashboard/index');
if (this.$route.path == '/productionSchedulingPlan/schedulingDashboard/index') {
downloadXls(res.data, `排产看板数据.xlsx`);
} else {
const blob = res.data;
const reader = new FileReader();
reader.onload = function (e) {
const base64 = e.target.result; // data:application/octet-stream;base64,...
const fileName = '排产看板数据.xlsx'; // Content-Disposition
// 4. postMessage
window.parent.postMessage(
{
type: 'DOWNLOAD_FILE',
base64: base64,
fileName: fileName,
},
'*' // 生产环境建议指定父页面域名(如 "https://parent-domain.com"避免安全风险
);
};
reader.readAsDataURL(blob);
}
});
},
// //
calcCurrentTimePosition() { calcCurrentTimePosition() {
const now = new Date(); const now = new Date();
@ -473,12 +543,12 @@ export default {
}); });
}, },
getSelectEquip() { getSelectEquip() {
selectEquip().then(res => { getEquipment().then(res => {
this.selectEquipOptions = res.data.data; this.selectEquipOptions = res.data.data;
}); });
}, },
getSelectTeam() { getSelectTeam() {
selectTeam().then(res => { getTeamSet().then(res => {
this.selectTeamOptions = res.data.data; this.selectTeamOptions = res.data.data;
}); });
}, },
@ -544,8 +614,11 @@ export default {
this.formLabelAlign = { this.formLabelAlign = {
startTime: new Date().toISOString().substr(0, 10), startTime: new Date().toISOString().substr(0, 10),
teamName: '', teamName: '',
teamId:'',
equipName: '', equipName: '',
equipId:'',
processName: '', processName: '',
processId:'',
woCode: '', woCode: '',
}; };
this.getData(); this.getData();
@ -675,10 +748,10 @@ export default {
getLayerTaskHeight(totalLayers, device) { getLayerTaskHeight(totalLayers, device) {
const rowHeight = this.getRowChartHeight(device); const rowHeight = this.getRowChartHeight(device);
if (totalLayers <= 1) { if (totalLayers <= 1) {
return rowHeight - 18; return rowHeight - 40;
} else { } else {
const totalSpacing = totalLayers * 18; const totalSpacing = totalLayers * 18;
const availableHeight = rowHeight - totalSpacing; const availableHeight = rowHeight - 40 - totalSpacing;
return availableHeight / totalLayers; return availableHeight / totalLayers;
} }
}, },
@ -737,7 +810,7 @@ export default {
} }
.gantt-header { .gantt-header {
height: 15px; height: 35px;
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -780,7 +853,7 @@ export default {
/* 左侧信息列表样式 */ /* 左侧信息列表样式 */
.info-list { .info-list {
width: 480px; width: 450px;
background-color: #f8f9fa; background-color: #f8f9fa;
/* border-right: 1px solid #eee; */ /* border-right: 1px solid #eee; */
flex-shrink: 0; flex-shrink: 0;
@ -795,13 +868,21 @@ export default {
background: #284c89; background: #284c89;
color: #fff; color: #fff;
font-weight: bold; font-weight: bold;
height: 25px; height: 30px;
}
.info-item-txt {
line-height: 25px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 12px;
text-align: center;
} }
.info-title-cell { .info-title-cell {
flex: 1; flex: 1;
text-align: center; text-align: center;
line-height: 25px; line-height: 30px;
border-right: 1px solid #eee; border-right: 1px solid #eee;
font-size: 12px; font-size: 12px;
} }
@ -817,6 +898,7 @@ export default {
.info-item { .info-item {
display: flex; display: flex;
height: 100%; height: 100%;
padding: 5px;
} }
.info-cell { .info-cell {
@ -842,7 +924,7 @@ export default {
/* 图表X轴区域样式 */ /* 图表X轴区域样式 */
.chart-axis { .chart-axis {
height: 25px; height: 30px;
position: relative; position: relative;
} }
@ -851,7 +933,7 @@ export default {
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 25px; height: 30px;
display: flex; display: flex;
background-color: #284c89; background-color: #284c89;
} }
@ -864,7 +946,7 @@ export default {
color: #fff; color: #fff;
font-weight: 500; font-weight: 500;
white-space: nowrap; white-space: nowrap;
line-height: 25px; line-height: 30px;
} }
.minor-labels { .minor-labels {
@ -882,7 +964,7 @@ export default {
font-size: 12px; font-size: 12px;
color: #fff; color: #fff;
white-space: nowrap; white-space: nowrap;
line-height: 25px; line-height: 30px;
padding: 0 2px; padding: 0 2px;
} }
@ -1100,16 +1182,21 @@ export default {
/* 分页样式 */ /* 分页样式 */
.pagination-container { .pagination-container {
position: fixed; /* 固定定位 */ /* position: fixed; */
right: 20px; /* 距离右侧20px */ /* right: 20px;
bottom: 20px; /* 距离底部20px */ bottom: 20px; */
height: 35px;
margin-top: 15px; margin-top: 15px;
background-color: #fff; /* 增加背景色避免与内容重叠时看不清 */ background-color: #fff; /* 增加背景色避免与内容重叠时看不清 */
padding: 10px; /* 增加内边距 */ padding: 10px; /* 增加内边距 */
z-index: 10; z-index: 10;
float: right;
width: calc(100% - 20px);
/* width:100%; */ /* width:100%; */
} }
:deep(.el-pagination) {
float: right;
}
:deep(.el-button--primary) { :deep(.el-button--primary) {
background-color: #284c89 !important; background-color: #284c89 !important;
color: #fff; color: #fff;

Loading…
Cancel
Save