lb #12

Merged
gtz217 merged 27 commits from lb into master 2022-11-18 17:04:51 +08:00
2 changed files with 27 additions and 7 deletions
Showing only changes of commit e5ed3b092c - Show all commits

View File

@ -73,9 +73,9 @@ const LifeRemainComponent = {
computed: { computed: {
statusColor() { statusColor() {
const colors = [ const colors = [
'rgba(255,84,76,0.6)', // red < 0 'rgba(255,84,76,0.6)', // red < 10%
'#FFBD43', // yellow < 10 '#FFBD43', // yellow < 20%
'rgba(142,254,83,0.6)' // green >= 10 'rgba(142,254,83,0.6)' // green
] ]
return this.injectData.remain < 0 ? colors[0] : this.injectData.remain < 10 ? colors[1] : colors[2] return this.injectData.remain < 0 ? colors[0] : this.injectData.remain < 10 ? colors[1] : colors[2]
} }
@ -160,6 +160,8 @@ export const sparepartsProps = [
{ prop: 'location', label: '库位', align: 'center' } { prop: 'location', label: '库位', align: 'center' }
] ]
// TODO: 2022.11.17 修改数据和剩余寿命组件
export const sparepartsDatalist = [ export const sparepartsDatalist = [
{ 'name': '激光打孔', 'eq': 'A2一次固化机', 'pl': 'C线', 'update_time': '2007-08-31 09:15:24', 'remain': -32, 'stock': 457, 'location': '库位74' }, { 'name': '激光打孔', 'eq': 'A2一次固化机', 'pl': 'C线', 'update_time': '2007-08-31 09:15:24', 'remain': -32, 'stock': 457, 'location': '库位74' },
{ 'name': '磨边单元', 'eq': 'B1一次冷却机', 'pl': 'C线', 'update_time': '2016-10-02 22:23:09', 'remain': -95, 'stock': 5600, 'location': '库位10' }, { 'name': '磨边单元', 'eq': 'B1一次冷却机', 'pl': 'C线', 'update_time': '2016-10-02 22:23:09', 'remain': -95, 'stock': 5600, 'location': '库位10' },

View File

@ -27,14 +27,18 @@
<ul class="report-item__list"> <ul class="report-item__list">
<li v-if="!item.quantity"> <li v-if="!item.quantity">
<span class="icon icon-no-reports" /> <span class="icon icon-no-reports" />
<span>暂无报表</span> <span style="color: #909090;">暂无报表</span>
</li> </li>
<template v-else> <template v-else>
<li v-for="n in item.quantity" :key="n"> <li v-for="n in item.reportNames" :key="n">
<span class="icon" />
<span>{{ n }}</span>
</li>
<!-- <li v-for="n in item.quantity" :key="n">
<span class="icon" /> <span class="icon" />
<span>报表{{ n }}</span> <span>报表{{ n }}</span>
</li> </li> -->
</template> </template>
</ul> </ul>
</div> </div>
@ -212,7 +216,21 @@ export default {
init() { init() {
list({}).then(res => { list({}).then(res => {
this.allNum = 0 this.allNum = 0
this.sortList = res.data this.sortList = res.data.map(item => {
if (item.name === '能源') {
return { ...item, reportNames: ['产线电量日能耗统计'] }
} else if (item.name === '订单') {
return { ...item, reportNames: ['订单历史记录', '在线订单进度'] }
} else if (item.name === '设备') {
return { ...item, reportNames: ['设备报警', '设备加工数量统计', '设备OEE'] }
} else if (item.name === '人员') {
return { ...item, reportNames: ['班组加工数量统计'] }
} else if (item.name === '产线') {
return { ...item, reportNames: ['产线日产量统计', '产线历史产量记录'] }
} else {
return item
}
})
res.data.forEach(item => { res.data.forEach(item => {
this.allNum += item.quantity this.allNum += item.quantity
}) })