diff --git a/src/api/pms/device.js b/src/api/pms/device.js index d5f5632..5277189 100644 --- a/src/api/pms/device.js +++ b/src/api/pms/device.js @@ -30,6 +30,37 @@ export function getdeviceInfo() { +//获取设备信息 +export function device(obj) { + return request({ + url: '/mf/device', + method: 'get', + params: obj + }) +} + + +//获取裁片视觉检测工作记录 +export function getOKOrNGList(obj) { + return request({ + url: '/pms/device/getOKOrNGList', + method: 'get', + params: obj + }) +} + + + + + +// 查询设备保养记录 +export function checkRecord(obj) { + return request({ + url: 'pms/checkRecord/list', + method: 'get', + params: obj + }) +} // 查询设备维修单列表 // 设备保养提醒 export function deviceCheck(devCode) { @@ -66,4 +97,13 @@ export function deviceStatusChartByDevice(obj) { method: 'get', params: obj }) +} + +//查询单设备电耗趋势 +export function powerConsumptionTrend(obj) { + return request({ + url: '/mf/powerConsumptionTrend', + method: 'get', + params: obj + }) } \ No newline at end of file diff --git a/src/views/history/components/lcenter.vue b/src/views/history/components/lcenter.vue index eba8163..a6fad1f 100644 --- a/src/views/history/components/lcenter.vue +++ b/src/views/history/components/lcenter.vue @@ -17,7 +17,13 @@ diff --git a/src/views/screen/index.vue b/src/views/screen/index.vue index d686625..2d11b09 100644 --- a/src/views/screen/index.vue +++ b/src/views/screen/index.vue @@ -2,27 +2,37 @@
- - - + + +
- - + +
- + + + + + +
- +
- +
- + + +
@@ -38,22 +48,128 @@ import bottomTable from './components/bottomTable.vue' import imageCard from './components/imageCard.vue' import devInfo from './components/devInfo.vue' import Rbottom1 from './components/rbottom1.vue' +import { device, deviceCheck, getOKOrNGList } from '@/api/pms/device' +import { computed, reactive } from 'vue' - +let devCode = ref('3051903') +let codeList = { + cp: '3051903',//裁片 + pb: '3051502',//平板扫描 + ck: '33202006',//冲孔 + fr: '334011' //缝纫 +} +let is_rate = ref(false) const columns = [ // { type: 'selection' }, // { type: 'index', label: '序号' }, - { prop: 'code', label: '产品编码' }, - { prop: 'status', label: '检查结果', slot: 'status' }, - { prop: 'offset', label: '偏差值' }, - { prop: 'date', label: '检测时间' }, - { prop: 'num', label: '检测数量' }, + { prop: 'productCode', label: '产品编码' }, + { prop: 'checkResult', label: '检查结果', slot: 'checkResult', width: '80px' }, + { prop: 'deviationValue', label: '偏差值' }, + { prop: 'ts', label: '检测时间' }, + { prop: 'checkNum', label: '检测数量' }, ] - +let remind_column = [ + { prop: 'devCode', label: '编码', width: '60px' }, + { prop: 'name', label: '设备名称', }, + { prop: 'subject', label: '保养内容', }, + { prop: 'person', label: '负责人', width: '60px' }, + { prop: 'time', label: '保养时间', width: '75px' } +] +let remind_data = ref() let tableData = ref([ { code: '123456789', status: '正常', offset: '0.00', date: '2021-01-01', num: '100' }, { code: '123456789', status: '正常', offset: '0.00', date: '2021-01-01', num: '100' } ]) + + +let info = reactive({ + name: '', + devCode: '', + file: '', + checkTime: '', + state: 0, + checkNum: 0, + runTime: 0, + errorCount: 0, + electTotal: 0, + speed: 0, + output: 0, + outputToday: 0, + cutNum: 0 +}) +//获取设备信息 +function getDevice() { + device({ devCode: devCode.value }).then(res => { + info.name = res.data.name + info.devCode = res.data.code + info.file = res.data.file + info.checkTime = res.data.checkTime + info.state = res.data.state + info.checkNum = res.data.checkNum || 0 + info.runTime = res.data.runTime + info.errorCount = res.data.errorCount + info.electTotal = res.data.electTotal || 0 + info.output = res.data.output + info.outputToday = res.data.outputToday + info.cutNum = res.data.cutNum || 0 + + + }) +} + +let reqOKOrNGCount = computed(() => { + let ok = 0 + let ng = 0 + tableData.value.forEach(item => { + if (item.checkResult == 'OK') { + ok++ + } else { + ng++ + + } + }) + + return { + ok,ng + } +}) +//裁片视觉检测 工作记录 +function reqOKOrNGList() { + getOKOrNGList({ devCode: devCode.value }).then(res => { + tableData.value = res.data + }) +} + + + +/**获取保养记录 */ +function getDeviceCheck() { + deviceCheck(devCode.value).then(res => { + remind_data.value = res.data + + }) +} + +function init() { + getDevice() + getDeviceCheck() + if (devCode.value == codeList.cp) { + reqOKOrNGList() + } +} + +onMounted(() => { + // devCode.value = localStorage.getItem('devStorage')?JSON.parse(localStorage.getItem('devStorage')).devCode:"" + + init() + if (devCode.value == '33202006') { + is_rate.value = true + } else if (devCode.value == '334011') { + is_rate.value = true + } else { + is_rate.value = false + } +})