|
@@ -329,7 +329,7 @@
|
|
|
<tr>
|
|
<tr>
|
|
|
<th style="width:160px">工位</th>
|
|
<th style="width:160px">工位</th>
|
|
|
<th style="width:300px">工位名称</th>
|
|
<th style="width:300px">工位名称</th>
|
|
|
- <th id="thDayCapacity">当天产量</th>
|
|
|
|
|
|
|
+ <th id="thDayPlan">当天计划</th>
|
|
|
<th id="thShiftCapacity">当班产量</th>
|
|
<th id="thShiftCapacity">当班产量</th>
|
|
|
<th id="thPrevShiftCapacity">上班产量</th>
|
|
<th id="thPrevShiftCapacity">上班产量</th>
|
|
|
</tr>
|
|
</tr>
|
|
@@ -419,20 +419,23 @@
|
|
|
var today = formatMd(now);
|
|
var today = formatMd(now);
|
|
|
var yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1);
|
|
var yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1);
|
|
|
var ymd = formatMd(yesterday);
|
|
var ymd = formatMd(yesterday);
|
|
|
- var dayEl = document.getElementById('thDayCapacity');
|
|
|
|
|
|
|
+ var dayEl = document.getElementById('thDayPlan');
|
|
|
var shiftEl = document.getElementById('thShiftCapacity');
|
|
var shiftEl = document.getElementById('thShiftCapacity');
|
|
|
var prevEl = document.getElementById('thPrevShiftCapacity');
|
|
var prevEl = document.getElementById('thPrevShiftCapacity');
|
|
|
- if (dayEl) dayEl.textContent = today + '产量';
|
|
|
|
|
|
|
+ var curShift, prevShift;
|
|
|
if (hour >= 8 && hour < 20) {
|
|
if (hour >= 8 && hour < 20) {
|
|
|
- if (shiftEl) shiftEl.textContent = today + '白班';
|
|
|
|
|
- if (prevEl) prevEl.textContent = ymd + '夜班';
|
|
|
|
|
|
|
+ curShift = today + '白班';
|
|
|
|
|
+ prevShift = ymd + '夜班';
|
|
|
} else if (hour >= 20) {
|
|
} else if (hour >= 20) {
|
|
|
- if (shiftEl) shiftEl.textContent = today + '夜班';
|
|
|
|
|
- if (prevEl) prevEl.textContent = today + '白班';
|
|
|
|
|
|
|
+ curShift = today + '夜班';
|
|
|
|
|
+ prevShift = today + '白班';
|
|
|
} else {
|
|
} else {
|
|
|
- if (shiftEl) shiftEl.textContent = ymd + '夜班';
|
|
|
|
|
- if (prevEl) prevEl.textContent = ymd + '白班';
|
|
|
|
|
|
|
+ curShift = ymd + '夜班';
|
|
|
|
|
+ prevShift = ymd + '白班';
|
|
|
}
|
|
}
|
|
|
|
|
+ if (dayEl) dayEl.textContent = curShift + '计划';
|
|
|
|
|
+ if (shiftEl) shiftEl.textContent = curShift + '实际';
|
|
|
|
|
+ if (prevEl) prevEl.textContent = prevShift + '产量';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function updateClock() {
|
|
function updateClock() {
|
|
@@ -940,7 +943,7 @@
|
|
|
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.real + '</td>';
|
|
|
|
|
|
|
+ html += '<td class="op-val">' + (r.plan || 0) + '</td>';
|
|
|
html += '<td class="op-val">' + r.shift + '</td>';
|
|
html += '<td class="op-val">' + r.shift + '</td>';
|
|
|
html += '<td class="op-val">' + (r.prevShift || 0) + '</td>';
|
|
html += '<td class="op-val">' + (r.prevShift || 0) + '</td>';
|
|
|
html += '</tr>';
|
|
html += '</tr>';
|
|
@@ -959,6 +962,26 @@
|
|
|
return n >= fromNum && n <= toNum;
|
|
return n >= fromNum && n <= toNum;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function lookupOpPlan(code) {
|
|
|
|
|
+ var plans = mockData.opPlans || {};
|
|
|
|
|
+ var c = String(code || '').toUpperCase();
|
|
|
|
|
+ if (plans[c] != null && plans[c] !== '') return Number(plans[c]) || 0;
|
|
|
|
|
+ var n = parseOprnoNum(c);
|
|
|
|
|
+ if (n < 0) return 0;
|
|
|
|
|
+ var k3 = 'OP' + ('000' + n).slice(-3);
|
|
|
|
|
+ if (plans[k3] != null && plans[k3] !== '') return Number(plans[k3]) || 0;
|
|
|
|
|
+ var k2 = 'OP' + n;
|
|
|
|
|
+ if (plans[k2] != null && plans[k2] !== '') return Number(plans[k2]) || 0;
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ function applyOpPlansToTable() {
|
|
|
|
|
+ var list = mockData.opTable || [];
|
|
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
|
|
+ list[i].plan = lookupOpPlan(list[i].code);
|
|
|
|
|
+ }
|
|
|
|
|
+ renderTable();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function applyLatestPlanNumsToTable(planNums) {}
|
|
function applyLatestPlanNumsToTable(planNums) {}
|
|
|
function calcRatePercent(actual, plan) {
|
|
function calcRatePercent(actual, plan) {
|
|
|
actual = Number(actual) || 0;
|
|
actual = Number(actual) || 0;
|
|
@@ -987,10 +1010,11 @@
|
|
|
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;
|
|
|
|
|
+ if (parseOprnoNum(code) === 70) continue;
|
|
|
out.push({
|
|
out.push({
|
|
|
code: code,
|
|
code: code,
|
|
|
name: p.title || '',
|
|
name: p.title || '',
|
|
|
- real: 0,
|
|
|
|
|
|
|
+ plan: lookupOpPlan(code),
|
|
|
shift: 0,
|
|
shift: 0,
|
|
|
prevShift: 0,
|
|
prevShift: 0,
|
|
|
_opNum: parseOprnoNum(code)
|
|
_opNum: parseOprnoNum(code)
|
|
@@ -1015,7 +1039,6 @@
|
|
|
if (list[i] && list[i].code) oprnos.push(list[i].code);
|
|
if (list[i] && list[i].code) oprnos.push(list[i].code);
|
|
|
}
|
|
}
|
|
|
if (!oprnos.length) return;
|
|
if (!oprnos.length) return;
|
|
|
- fetchCapacityInto('dayCapacityData', LINE_SN, oprnos, 'real', {});
|
|
|
|
|
fetchCapacityInto('shiftCapacityData', LINE_SN, oprnos, 'shift', { fixedTwoShift: 'true' });
|
|
fetchCapacityInto('shiftCapacityData', LINE_SN, oprnos, 'shift', { fixedTwoShift: 'true' });
|
|
|
fetchCapacityInto('prevShiftCapacityData', LINE_SN, oprnos, 'prevShift', { fixedTwoShift: 'true' });
|
|
fetchCapacityInto('prevShiftCapacityData', LINE_SN, oprnos, 'prevShift', { fixedTwoShift: 'true' });
|
|
|
}
|
|
}
|
|
@@ -1152,6 +1175,8 @@
|
|
|
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;
|
|
if (elPlan) elPlan.textContent = mockData.cards.planProduction;
|
|
|
|
|
+ mockData.opPlans = d.opPlans || {};
|
|
|
|
|
+ applyOpPlansToTable();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|