|
@@ -292,7 +292,7 @@
|
|
|
|
|
|
|
|
<div class="mes4-header">
|
|
<div class="mes4-header">
|
|
|
<img class="mes4-logo" src="${ctxStatic}/screen/imgs/ljrLogo.png" alt="logo">
|
|
<img class="mes4-logo" src="${ctxStatic}/screen/imgs/ljrLogo.png" alt="logo">
|
|
|
- <div class="mes4-title">毛坯阶段统计大屏</div>
|
|
|
|
|
|
|
+ <div class="mes4-title">铸造车间统计大屏</div>
|
|
|
<div class="mes4-datetime">
|
|
<div class="mes4-datetime">
|
|
|
<span class="mes4-date" id="mes4Date"></span>
|
|
<span class="mes4-date" id="mes4Date"></span>
|
|
|
<span class="mes4-time" id="mes4Time"></span>
|
|
<span class="mes4-time" id="mes4Time"></span>
|
|
@@ -301,17 +301,17 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mes4-panel p-alert">
|
|
<div class="mes4-panel p-alert">
|
|
|
- <div class="mes4-ptitle"> 产线阶段报警信息 </div>
|
|
|
|
|
|
|
+ <div class="mes4-ptitle"> 产线阶段停机信息 </div>
|
|
|
<div class="mes4-pbody">
|
|
<div class="mes4-pbody">
|
|
|
- <div class="alert-head"><div>序号</div><div>工位 / 报警类型</div></div>
|
|
|
|
|
|
|
+ <div class="alert-head"><div>序号</div><div>工位 / 停机类型</div></div>
|
|
|
<div id="alertList"></div>
|
|
<div id="alertList"></div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mes4-panel p-quality">
|
|
<div class="mes4-panel p-quality">
|
|
|
- <div class="mes4-ptitle"> 近七日产品质检数据分析 </div>
|
|
|
|
|
|
|
+ <div class="mes4-ptitle"> 近七日压铸车间质检数据分析 </div>
|
|
|
<div class="legend-inline">
|
|
<div class="legend-inline">
|
|
|
- <span><i class="dot" style="background:#00FF88"></i>产出</span>
|
|
|
|
|
|
|
+ <span><i class="dot" style="background:#00FF88"></i>产量</span>
|
|
|
<span><i class="dot" style="background:#00C8FF"></i>不良</span>
|
|
<span><i class="dot" style="background:#00C8FF"></i>不良</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="mes4-pbody"><canvas id="chartQuality" class="chart"></canvas></div>
|
|
<div class="mes4-pbody"><canvas id="chartQuality" class="chart"></canvas></div>
|
|
@@ -329,9 +329,10 @@
|
|
|
<tr>
|
|
<tr>
|
|
|
<th style="width:160px">工位</th>
|
|
<th style="width:160px">工位</th>
|
|
|
<th style="width:300px">工位名称</th>
|
|
<th style="width:300px">工位名称</th>
|
|
|
- <th id="thDayPlan">当天计划</th>
|
|
|
|
|
- <th id="thShiftCapacity">当班产量</th>
|
|
|
|
|
- <th id="thPrevShiftCapacity">上班产量</th>
|
|
|
|
|
|
|
+ <th id="thDayPlan">白班计划</th>
|
|
|
|
|
+ <th id="thDayOutput">白班产量</th>
|
|
|
|
|
+ <th id="thNightPlan">夜班计划</th>
|
|
|
|
|
+ <th id="thNightOutput">夜班产量</th>
|
|
|
</tr>
|
|
</tr>
|
|
|
</thead>
|
|
</thead>
|
|
|
<tbody id="opTableBody"></tbody>
|
|
<tbody id="opTableBody"></tbody>
|
|
@@ -358,11 +359,11 @@
|
|
|
<div class="oc-value"><span id="deviceCount">56</span></div>
|
|
<div class="oc-value"><span id="deviceCount">56</span></div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="overview-card">
|
|
<div class="overview-card">
|
|
|
- <div class="oc-label">每日计划</div>
|
|
|
|
|
|
|
+ <div class="oc-label" id="labelPlanProduction">每日计划</div>
|
|
|
<div class="oc-value"><span id="planProduction">221</span></div>
|
|
<div class="oc-value"><span id="planProduction">221</span></div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="overview-card">
|
|
<div class="overview-card">
|
|
|
- <div class="oc-label">实际产量</div>
|
|
|
|
|
|
|
+ <div class="oc-label" id="labelActualProduction">实际产量</div>
|
|
|
<div class="oc-value"><span id="actualProduction">201</span></div>
|
|
<div class="oc-value"><span id="actualProduction">201</span></div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -382,8 +383,8 @@
|
|
|
<div class="mes4-panel p-hourly">
|
|
<div class="mes4-panel p-hourly">
|
|
|
<div class="mes4-ptitle"> 近12小时上下线数据分析 </div>
|
|
<div class="mes4-ptitle"> 近12小时上下线数据分析 </div>
|
|
|
<div class="legend-inline">
|
|
<div class="legend-inline">
|
|
|
- <span><i class="dot" style="background:#00FF88"></i>上线</span>
|
|
|
|
|
- <span><i class="dot" style="background:#00C8FF"></i>下线</span>
|
|
|
|
|
|
|
+ <span><i class="dot" style="background:#00FF88"></i>OP060上线</span>
|
|
|
|
|
+ <span><i class="dot" style="background:#00C8FF"></i>OP100下线</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="mes4-pbody"><canvas id="chartHourly" class="chart"></canvas></div>
|
|
<div class="mes4-pbody"><canvas id="chartHourly" class="chart"></canvas></div>
|
|
|
</div>
|
|
</div>
|
|
@@ -414,28 +415,19 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function updateCapacityHeaders() {
|
|
function updateCapacityHeaders() {
|
|
|
- var now = new Date();
|
|
|
|
|
- var hour = now.getHours();
|
|
|
|
|
- var today = formatMd(now);
|
|
|
|
|
- var yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1);
|
|
|
|
|
- var ymd = formatMd(yesterday);
|
|
|
|
|
- var dayEl = document.getElementById('thDayPlan');
|
|
|
|
|
- var shiftEl = document.getElementById('thShiftCapacity');
|
|
|
|
|
- var prevEl = document.getElementById('thPrevShiftCapacity');
|
|
|
|
|
- var curShift, prevShift;
|
|
|
|
|
- if (hour >= 8 && hour < 20) {
|
|
|
|
|
- curShift = today + '白班';
|
|
|
|
|
- prevShift = ymd + '夜班';
|
|
|
|
|
- } else if (hour >= 20) {
|
|
|
|
|
- curShift = today + '夜班';
|
|
|
|
|
- prevShift = today + '白班';
|
|
|
|
|
- } else {
|
|
|
|
|
- curShift = ymd + '夜班';
|
|
|
|
|
- prevShift = ymd + '白班';
|
|
|
|
|
- }
|
|
|
|
|
- if (dayEl) dayEl.textContent = curShift + '计划';
|
|
|
|
|
- if (shiftEl) shiftEl.textContent = curShift + '实际';
|
|
|
|
|
- if (prevEl) prevEl.textContent = prevShift + '产量';
|
|
|
|
|
|
|
+ var today = formatMd(new Date());
|
|
|
|
|
+ var dayPlanEl = document.getElementById('thDayPlan');
|
|
|
|
|
+ var dayOutEl = document.getElementById('thDayOutput');
|
|
|
|
|
+ var nightPlanEl = document.getElementById('thNightPlan');
|
|
|
|
|
+ var nightOutEl = document.getElementById('thNightOutput');
|
|
|
|
|
+ if (dayPlanEl) dayPlanEl.textContent = today + '白班计划';
|
|
|
|
|
+ if (dayOutEl) dayOutEl.textContent = today + '白班产量';
|
|
|
|
|
+ if (nightPlanEl) nightPlanEl.textContent = today + '夜班计划';
|
|
|
|
|
+ if (nightOutEl) nightOutEl.textContent = today + '夜班产量';
|
|
|
|
|
+ var planLabel = document.getElementById('labelPlanProduction');
|
|
|
|
|
+ var actualLabel = document.getElementById('labelActualProduction');
|
|
|
|
|
+ if (planLabel) planLabel.textContent = today + '每日计划';
|
|
|
|
|
+ if (actualLabel) actualLabel.textContent = today + '实际产量';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function updateClock() {
|
|
function updateClock() {
|
|
@@ -454,18 +446,34 @@
|
|
|
var mockData = {};
|
|
var mockData = {};
|
|
|
/** 本屏产线:XT(工位 OP060-OP100,与 mesLineProcess 一致) */
|
|
/** 本屏产线:XT(工位 OP060-OP100,与 mesLineProcess 一致) */
|
|
|
var LINE_SN = 'XT';
|
|
var LINE_SN = 'XT';
|
|
|
- /** 大屏配置类型:毛坯 */
|
|
|
|
|
|
|
+ /** 大屏配置类型:铸造车间 */
|
|
|
var SCREEN_TYPE = 'MP';
|
|
var SCREEN_TYPE = 'MP';
|
|
|
/** 每小时上下线:上线 OP060 / 下线 OP100 */
|
|
/** 每小时上下线:上线 OP060 / 下线 OP100 */
|
|
|
var HOURLY_API_CFG = { lineSn: LINE_SN, onlineOprno: 'OP060', offlineOprno: 'OP100' };
|
|
var HOURLY_API_CFG = { lineSn: LINE_SN, onlineOprno: 'OP060', offlineOprno: 'OP100' };
|
|
|
|
|
+ function formatHourLabel(h) {
|
|
|
|
|
+ var n = Number(h);
|
|
|
|
|
+ if (isNaN(n)) {
|
|
|
|
|
+ var s = String(h == null ? '' : h);
|
|
|
|
|
+ return s.indexOf('点') >= 0 ? s : (s + '点');
|
|
|
|
|
+ }
|
|
|
|
|
+ return (n % 24) + '点';
|
|
|
|
|
+ }
|
|
|
function buildRecentHourLabels12() {
|
|
function buildRecentHourLabels12() {
|
|
|
var labels = [];
|
|
var labels = [];
|
|
|
var nowH = new Date().getHours();
|
|
var nowH = new Date().getHours();
|
|
|
for (var i = 11; i >= 0; i--) {
|
|
for (var i = 11; i >= 0; i--) {
|
|
|
- labels.push(String((nowH - i + 24) % 24));
|
|
|
|
|
|
|
+ labels.push(formatHourLabel((nowH - i + 24) % 24));
|
|
|
}
|
|
}
|
|
|
return labels;
|
|
return labels;
|
|
|
}
|
|
}
|
|
|
|
|
+ function normalizeHourLabels(labels) {
|
|
|
|
|
+ var out = [];
|
|
|
|
|
+ if (!labels || !labels.length) return buildRecentHourLabels12();
|
|
|
|
|
+ for (var i = 0; i < labels.length; i++) {
|
|
|
|
|
+ out.push(formatHourLabel(labels[i]));
|
|
|
|
|
+ }
|
|
|
|
|
+ return out;
|
|
|
|
|
+ }
|
|
|
function updateHourlyUpDownByApi() {
|
|
function updateHourlyUpDownByApi() {
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
url: '${ctx}/mes/mesProduct/hourlyUpDownOkData',
|
|
url: '${ctx}/mes/mesProduct/hourlyUpDownOkData',
|
|
@@ -484,7 +492,7 @@
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
mockData.hourly = {
|
|
mockData.hourly = {
|
|
|
- labels: d.labels && d.labels.length ? d.labels : buildRecentHourLabels12(),
|
|
|
|
|
|
|
+ labels: normalizeHourLabels(d.labels),
|
|
|
up: d.up,
|
|
up: d.up,
|
|
|
down: d.down,
|
|
down: d.down,
|
|
|
max: 4
|
|
max: 4
|
|
@@ -943,9 +951,10 @@
|
|
|
html += '<tr>';
|
|
html += '<tr>';
|
|
|
html += '<td class="op-col">' + r.code + '</td>';
|
|
html += '<td class="op-col">' + r.code + '</td>';
|
|
|
html += '<td class="op-name">' + r.name + '</td>';
|
|
html += '<td class="op-name">' + r.name + '</td>';
|
|
|
- html += '<td class="op-val">' + (r.plan || 0) + '</td>';
|
|
|
|
|
- html += '<td class="op-val">' + r.shift + '</td>';
|
|
|
|
|
- html += '<td class="op-val">' + (r.prevShift || 0) + '</td>';
|
|
|
|
|
|
|
+ html += '<td class="op-val">' + (r.dayPlan || 0) + '</td>';
|
|
|
|
|
+ html += '<td class="op-val">' + (r.dayOutput || 0) + '</td>';
|
|
|
|
|
+ html += '<td class="op-val">' + (r.nightPlan || 0) + '</td>';
|
|
|
|
|
+ html += '<td class="op-val">' + (r.nightOutput || 0) + '</td>';
|
|
|
html += '</tr>';
|
|
html += '</tr>';
|
|
|
}
|
|
}
|
|
|
var el = document.getElementById('opTableBody');
|
|
var el = document.getElementById('opTableBody');
|
|
@@ -962,8 +971,8 @@
|
|
|
return n >= fromNum && n <= toNum;
|
|
return n >= fromNum && n <= toNum;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function lookupOpPlan(code) {
|
|
|
|
|
- var plans = mockData.opPlans || {};
|
|
|
|
|
|
|
+ function lookupOpPlan(code, plans) {
|
|
|
|
|
+ plans = plans || {};
|
|
|
var c = String(code || '').toUpperCase();
|
|
var c = String(code || '').toUpperCase();
|
|
|
if (plans[c] != null && plans[c] !== '') return Number(plans[c]) || 0;
|
|
if (plans[c] != null && plans[c] !== '') return Number(plans[c]) || 0;
|
|
|
var n = parseOprnoNum(c);
|
|
var n = parseOprnoNum(c);
|
|
@@ -977,7 +986,8 @@
|
|
|
function applyOpPlansToTable() {
|
|
function applyOpPlansToTable() {
|
|
|
var list = mockData.opTable || [];
|
|
var list = mockData.opTable || [];
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
for (var i = 0; i < list.length; i++) {
|
|
|
- list[i].plan = lookupOpPlan(list[i].code);
|
|
|
|
|
|
|
+ list[i].dayPlan = lookupOpPlan(list[i].code, mockData.opPlansDay);
|
|
|
|
|
+ list[i].nightPlan = lookupOpPlan(list[i].code, mockData.opPlansNight);
|
|
|
}
|
|
}
|
|
|
renderTable();
|
|
renderTable();
|
|
|
}
|
|
}
|
|
@@ -991,6 +1001,39 @@
|
|
|
}
|
|
}
|
|
|
function syncAchieveRateWithPlan() {}
|
|
function syncAchieveRateWithPlan() {}
|
|
|
|
|
|
|
|
|
|
+ /** 工位表固定插入 OP070(探伤处理);产量走探伤记录去重口径,不走普通工位 OK 统计 */
|
|
|
|
|
+ function ensureOp070Row(list) {
|
|
|
|
|
+ var out = [];
|
|
|
|
|
+ var has070 = false;
|
|
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
|
|
+ var row = list[i];
|
|
|
|
|
+ if (parseOprnoNum(row.code) === 70) {
|
|
|
|
|
+ if (has070) continue;
|
|
|
|
|
+ row.code = 'OP070';
|
|
|
|
|
+ row.name = '探伤处理';
|
|
|
|
|
+ row._opNum = 70;
|
|
|
|
|
+ row._flaw = true;
|
|
|
|
|
+ row.dayPlan = lookupOpPlan('OP070', mockData.opPlansDay);
|
|
|
|
|
+ row.nightPlan = lookupOpPlan('OP070', mockData.opPlansNight);
|
|
|
|
|
+ has070 = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ out.push(row);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!has070) {
|
|
|
|
|
+ out.push({
|
|
|
|
|
+ code: 'OP070',
|
|
|
|
|
+ name: '探伤处理',
|
|
|
|
|
+ dayPlan: lookupOpPlan('OP070', mockData.opPlansDay),
|
|
|
|
|
+ nightPlan: lookupOpPlan('OP070', mockData.opPlansNight),
|
|
|
|
|
+ dayOutput: 0,
|
|
|
|
|
+ nightOutput: 0,
|
|
|
|
|
+ _opNum: 70,
|
|
|
|
|
+ _flaw: true
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ return out;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function updateLineProcessTableByApi() {
|
|
function updateLineProcessTableByApi() {
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
url: '${ctx}/mes/mesProductScreen/lineProcessList',
|
|
url: '${ctx}/mes/mesProductScreen/lineProcessList',
|
|
@@ -1010,16 +1053,20 @@
|
|
|
if (ls !== LINE_SN) continue;
|
|
if (ls !== LINE_SN) continue;
|
|
|
var code = p.oprno || '';
|
|
var code = p.oprno || '';
|
|
|
if (!isOprnoInRange(code, 60, 100)) continue;
|
|
if (!isOprnoInRange(code, 60, 100)) continue;
|
|
|
|
|
+ // OP070/OP070A 统一由 ensureOp070Row 插入,避免重复
|
|
|
if (parseOprnoNum(code) === 70) continue;
|
|
if (parseOprnoNum(code) === 70) continue;
|
|
|
out.push({
|
|
out.push({
|
|
|
code: code,
|
|
code: code,
|
|
|
name: p.title || '',
|
|
name: p.title || '',
|
|
|
- plan: lookupOpPlan(code),
|
|
|
|
|
- shift: 0,
|
|
|
|
|
- prevShift: 0,
|
|
|
|
|
- _opNum: parseOprnoNum(code)
|
|
|
|
|
|
|
+ dayPlan: lookupOpPlan(code, mockData.opPlansDay),
|
|
|
|
|
+ nightPlan: lookupOpPlan(code, mockData.opPlansNight),
|
|
|
|
|
+ dayOutput: 0,
|
|
|
|
|
+ nightOutput: 0,
|
|
|
|
|
+ _opNum: parseOprnoNum(code),
|
|
|
|
|
+ _flaw: false
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ out = ensureOp070Row(out);
|
|
|
out.sort(function(a, b) { return a._opNum - b._opNum; });
|
|
out.sort(function(a, b) { return a._opNum - b._opNum; });
|
|
|
mockData.opTable = out;
|
|
mockData.opTable = out;
|
|
|
renderTable();
|
|
renderTable();
|
|
@@ -1036,30 +1083,32 @@
|
|
|
if (!list.length) return;
|
|
if (!list.length) return;
|
|
|
var oprnos = [];
|
|
var oprnos = [];
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
for (var i = 0; i < list.length; i++) {
|
|
|
- if (list[i] && list[i].code) oprnos.push(list[i].code);
|
|
|
|
|
|
|
+ if (list[i] && list[i].code && !list[i]._flaw) oprnos.push(list[i].code);
|
|
|
}
|
|
}
|
|
|
- if (!oprnos.length) return;
|
|
|
|
|
- fetchCapacityInto('shiftCapacityData', LINE_SN, oprnos, 'shift', { fixedTwoShift: 'true' });
|
|
|
|
|
- fetchCapacityInto('prevShiftCapacityData', LINE_SN, oprnos, 'prevShift', { fixedTwoShift: 'true' });
|
|
|
|
|
|
|
+ if (oprnos.length) {
|
|
|
|
|
+ fetchCalendarShiftCapacity(LINE_SN, oprnos, 'day', 'dayOutput');
|
|
|
|
|
+ fetchCalendarShiftCapacity(LINE_SN, oprnos, 'night', 'nightOutput');
|
|
|
|
|
+ }
|
|
|
|
|
+ fetchFlawShiftCapacity('day', 'dayOutput');
|
|
|
|
|
+ fetchFlawShiftCapacity('night', 'nightOutput');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function fetchCapacityInto(action, lineSn, oprnos, field, extraData) {
|
|
|
|
|
- var data = { lineSn: lineSn, oprnos: oprnos.join(',') };
|
|
|
|
|
- if (extraData) {
|
|
|
|
|
- for (var k in extraData) {
|
|
|
|
|
- if (extraData.hasOwnProperty(k)) data[k] = extraData[k];
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ function fetchCalendarShiftCapacity(lineSn, oprnos, shiftType, field) {
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
- url: '${ctx}/mes/mesProductRecord/' + action,
|
|
|
|
|
|
|
+ url: '${ctx}/mes/mesProductRecord/calendarShiftCapacityData',
|
|
|
type: 'POST',
|
|
type: 'POST',
|
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
|
- data: data,
|
|
|
|
|
|
|
+ data: {
|
|
|
|
|
+ lineSn: lineSn,
|
|
|
|
|
+ oprnos: oprnos.join(','),
|
|
|
|
|
+ shiftType: shiftType
|
|
|
|
|
+ },
|
|
|
success: function(resp) {
|
|
success: function(resp) {
|
|
|
if (!resp || resp.result !== 'true' || !resp.data) return;
|
|
if (!resp || resp.result !== 'true' || !resp.data) return;
|
|
|
var map = resp.data || {};
|
|
var map = resp.data || {};
|
|
|
var list = mockData.opTable || [];
|
|
var list = mockData.opTable || [];
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
for (var i = 0; i < list.length; i++) {
|
|
|
|
|
+ if (list[i]._flaw) continue;
|
|
|
var code = list[i].code || '';
|
|
var code = list[i].code || '';
|
|
|
var formatted = code.length === 6 ? code.substring(0, 5) : code;
|
|
var formatted = code.length === 6 ? code.substring(0, 5) : code;
|
|
|
list[i][field] = Number(map[code] != null ? map[code] : map[formatted]) || 0;
|
|
list[i][field] = Number(map[code] != null ? map[code] : map[formatted]) || 0;
|
|
@@ -1069,6 +1118,27 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /** OP070 探伤产量:探伤记录管理口径,时间段内有图片的记录按工件码去重 */
|
|
|
|
|
+ function fetchFlawShiftCapacity(shiftType, field) {
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: '${ctx}/mes/mesFlawRecord/calendarShiftDistinctCount',
|
|
|
|
|
+ type: 'POST',
|
|
|
|
|
+ dataType: 'json',
|
|
|
|
|
+ data: { shiftType: shiftType },
|
|
|
|
|
+ success: function(resp) {
|
|
|
|
|
+ if (!resp || resp.result !== 'true') return;
|
|
|
|
|
+ var count = Number(resp.data) || 0;
|
|
|
|
|
+ var list = mockData.opTable || [];
|
|
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
|
|
+ if (list[i]._flaw || parseOprnoNum(list[i].code) === 70) {
|
|
|
|
|
+ list[i][field] = count;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ renderTable();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 近七日产品质检:产出=OP100 OK,不良=返工 OP070-OP100
|
|
// 近七日产品质检:产出=OP100 OK,不良=返工 OP070-OP100
|
|
|
function updateWeekQualityByApi() {
|
|
function updateWeekQualityByApi() {
|
|
|
$.ajax({
|
|
$.ajax({
|
|
@@ -1155,7 +1225,25 @@
|
|
|
renderAlerts();
|
|
renderAlerts();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /** 总览三卡:生产人数 / 设备数量 / 计划产量 <- mesProductScreen 最新配置 */
|
|
|
|
|
|
|
+ function sumPlanMap(map) {
|
|
|
|
|
+ var total = 0;
|
|
|
|
|
+ if (!map) return 0;
|
|
|
|
|
+ for (var k in map) {
|
|
|
|
|
+ if (!map.hasOwnProperty(k)) continue;
|
|
|
|
|
+ total += Number(map[k]) || 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ return total;
|
|
|
|
|
+ }
|
|
|
|
|
+ function refreshOverviewPlanProduction() {
|
|
|
|
|
+ var dayTotal = sumPlanMap(mockData.opPlansDay);
|
|
|
|
|
+ var nightTotal = sumPlanMap(mockData.opPlansNight);
|
|
|
|
|
+ mockData.cards = mockData.cards || {};
|
|
|
|
|
+ mockData.cards.planProduction = dayTotal + nightTotal;
|
|
|
|
|
+ var elPlan = document.getElementById('planProduction');
|
|
|
|
|
+ if (elPlan) elPlan.textContent = mockData.cards.planProduction;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /** 总览:生产人数 / 设备数量;每日计划=当日白班计划合计+夜班计划合计 */
|
|
|
function updateScreenConfigByApi() {
|
|
function updateScreenConfigByApi() {
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
url: '${ctx}/mes/mesProductScreen/latestConfig',
|
|
url: '${ctx}/mes/mesProductScreen/latestConfig',
|
|
@@ -1168,14 +1256,13 @@
|
|
|
mockData.cards = mockData.cards || {};
|
|
mockData.cards = mockData.cards || {};
|
|
|
mockData.cards.productionPeople = Number(d.peopleNums) || 0;
|
|
mockData.cards.productionPeople = Number(d.peopleNums) || 0;
|
|
|
mockData.cards.deviceCount = Number(d.deviceNums) || 0;
|
|
mockData.cards.deviceCount = Number(d.deviceNums) || 0;
|
|
|
- mockData.cards.planProduction = Number(d.planNums) || 0;
|
|
|
|
|
var elPeople = document.getElementById('productionPeople');
|
|
var elPeople = document.getElementById('productionPeople');
|
|
|
var elDevice = document.getElementById('deviceCount');
|
|
var elDevice = document.getElementById('deviceCount');
|
|
|
- var elPlan = document.getElementById('planProduction');
|
|
|
|
|
if (elPeople) elPeople.textContent = mockData.cards.productionPeople;
|
|
if (elPeople) elPeople.textContent = mockData.cards.productionPeople;
|
|
|
if (elDevice) elDevice.textContent = mockData.cards.deviceCount;
|
|
if (elDevice) elDevice.textContent = mockData.cards.deviceCount;
|
|
|
- if (elPlan) elPlan.textContent = mockData.cards.planProduction;
|
|
|
|
|
- mockData.opPlans = d.opPlans || {};
|
|
|
|
|
|
|
+ mockData.opPlansDay = d.opPlansDay || d.opPlans || {};
|
|
|
|
|
+ mockData.opPlansNight = d.opPlansNight || {};
|
|
|
|
|
+ refreshOverviewPlanProduction();
|
|
|
applyOpPlansToTable();
|
|
applyOpPlansToTable();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -1204,7 +1291,7 @@
|
|
|
if (el) el.textContent = mockData.cards.actualProduction;
|
|
if (el) el.textContent = mockData.cards.actualProduction;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /** 实际产量:取本阶段末工位当天 OK 数(半成品 OP100) */
|
|
|
|
|
|
|
+ /** 实际产量:当日(0点–24点)末工位 OP100 OK 数 */
|
|
|
function updateActualProductionByApi() {
|
|
function updateActualProductionByApi() {
|
|
|
var oprno = HOURLY_API_CFG.offlineOprno || 'OP100';
|
|
var oprno = HOURLY_API_CFG.offlineOprno || 'OP100';
|
|
|
$.ajax({
|
|
$.ajax({
|