projects/mesxc-zhp #259

Merged
juzi merged 2 commits from projects/mesxc-zhp into projects/mesxc-test 2024-03-21 16:36:16 +08:00
12 changed files with 220 additions and 195 deletions

View File

@ -1,7 +1,7 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-03-13 14:57:16
# @LastEditTime: 2024-03-21 14:45:52
# @LastEditors: zhp
# @Description:
###
@ -25,7 +25,7 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
# VUE_APP_BASE_API = 'http://192.168.1.47:48082'
# socket地址
VUE_APP_Socket_API = 'ws://192.168.0.30:8888'
VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
# 积木报表指向地址

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-07-19 15:18:30
* @LastEditors: zhp
* @LastEditTime: 2024-03-12 09:34:06
* @LastEditTime: 2024-03-21 16:07:39
* @Description:
-->
<template>
@ -633,7 +633,7 @@ export default {
this.eqConfig.data = eqArr
this.$refs['eqScrollBoard'].updateRows(eqArr)
this.$refs.productLineChart.initChart(['D61', 'D62', 'D63', 'D64', 'D65',], [98, 97, 98.7, 98.5, 98.3,], [3134, 2323, 3232, 3233, 2321])
this.getList()
// this.getList()
this.initWebSocket()
this.SJGInitWebSocket()
this.getTimes()
@ -671,52 +671,52 @@ export default {
// removeEventListener('resize', resizeFun)
// },
methods: {
getList() {
this.$axios.get(
'base/core-production-line/listAll',
'get',
this.queryParams
).then((res) => {
// console.log('11111', res);
this.productLineList = res.data
})
this.$axios.get(
'base/quality-inspection-record/dayStatistics',
'get',
).then((res) => {
// console.log('11111', res);
let processArr = qualityMonthList.map((item, index) => [
// console.log(item)
`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
</span>`,
// formatDate(item.planStartTime) || '',
`
<span style="color:rgba(255,255,255,0.5)" >${item.productionLineName || ''}
</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.sectionName || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.count || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.inspectionTypeName || ''}</span>`,
])
this.processConfig.data = processArr
this.$refs['processScrollBoard'].updateRows(processArr)
// if (res.data.length !==0) {
// let processArr = res.data.map((item, index) => [
// // console.log(item)
// `<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
// </span>`,
// // formatDate(item.planStartTime) || '',
// `
// <span style="color:rgba(255,255,255,0.5)" >${item.productionLineName || ''}
// </span>`,
// `<span style="color:rgba(255,255,255,0.5)">${item.sectionName || ''}</span>`,
// `<span style="color:rgba(255,255,255,0.5)">${item.count || ''}</span>`,
// `<span style="color:rgba(255,255,255,0.5)">${item.inspectionTypeName || ''}</span>`,
// ])
// this.processConfig.data = processArr
// this.$refs['processScrollBoard'].updateRows(processArr)
// }
})
},
// getList() {
// // this.$axios.get(
// // 'base/core-production-line/listAll',
// // 'get',
// // this.queryParams
// // ).then((res) => {
// // // console.log('11111', res);
// // this.productLineList = res.data
// // })
// this.$axios.get(
// 'base/quality-inspection-record/dayStatistics',
// 'get',
// ).then((res) => {
// // console.log('11111', res);
// let processArr = qualityMonthList.map((item, index) => [
// // console.log(item)
// `<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
// </span>`,
// // formatDate(item.planStartTime) || '',
// `
// <span style="color:rgba(255,255,255,0.5)" >${item.productionLineName || ''}
// </span>`,
// `<span style="color:rgba(255,255,255,0.5)">${item.sectionName || ''}</span>`,
// `<span style="color:rgba(255,255,255,0.5)">${item.count || ''}</span>`,
// `<span style="color:rgba(255,255,255,0.5)">${item.inspectionTypeName || ''}</span>`,
// ])
// this.processConfig.data = processArr
// this.$refs['processScrollBoard'].updateRows(processArr)
// // if (res.data.length !==0) {
// // let processArr = res.data.map((item, index) => [
// // // console.log(item)
// // `<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
// // </span>`,
// // // formatDate(item.planStartTime) || '',
// // `
// // <span style="color:rgba(255,255,255,0.5)" >${item.productionLineName || ''}
// // </span>`,
// // `<span style="color:rgba(255,255,255,0.5)">${item.sectionName || ''}</span>`,
// // `<span style="color:rgba(255,255,255,0.5)">${item.count || ''}</span>`,
// // `<span style="color:rgba(255,255,255,0.5)">${item.inspectionTypeName || ''}</span>`,
// // ])
// // this.processConfig.data = processArr
// // this.$refs['processScrollBoard'].updateRows(processArr)
// // }
// })
// },
getTimes() {
setInterval(this.getTimesInterval, 1000);
},
@ -837,24 +837,25 @@ export default {
this.$refs['eqScrollBoard'].updateRows(eqArr)
// console.log(SJGWsData.orderList)
} else if (this.SJGWsData.type === 'productline') {
console.log('aaaaaaaaaaaaaaaaaaa', this.SJGWsData);
// console.log(this.wsData.detData);
let nameList = []
let passRateList = []
let outputNumList = []
// console.log('2222222222', this.productLineList);
this.productLineList.forEach((item) => {
// this.productLineList.forEach((item) => {
this.SJGWsData.detData.forEach((ele) => {
if (item.id == ele.productionLineId) {
if (item.name.substr(0, 1) == "D") {
console.log(ele)
nameList.push(item.name)
// if (item.id == ele.productionLineId) {
// if (item.name.substr(0, 1) == "D") {
// console.log(ele)
nameList.push(ele.lineName)
outputNumList.push(ele.outputNum)
passRateList.push(ele.passRate)
}
}
// }
// }
})
})
// })
// progressRateList = EnergyNameList
// let EnergyDataList = []
// this.SJGWsData.detData.forEach((ele) => {
@ -864,7 +865,22 @@ export default {
// console.log(this.EnergyMonitoringNameList)
// console.log(this.EnergyMonitoringList)
// this.$nextTick(() => {
this.$refs.productLineChart.initChart(Array.from(new Set(nameList)), passRateList, outputNumList)
this.$refs.productLineChart.initChart(nameList, passRateList, outputNumList)
} else if (this.SJGInitWebSocket === 'inspection') {
let processArr = qualityMonthList.map((item, index) => [
// console.log(item)
`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
</span>`,
// formatDate(item.planStartTime) || '',
`
<span style="color:rgba(255,255,255,0.5)" >${item.productionLineName || ''}
</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.sectionName || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.count || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.inspectionTypeName || ''}</span>`,
])
this.processConfig.data = processArr
this.$refs['processScrollBoard'].updateRows(processArr)
}
},
//

View File

@ -1,12 +1,12 @@
<!--
* @Author: zhp
* @Date: 2023-12-08 13:46:17
* @LastEditTime: 2024-03-15 14:54:38
* @LastEditTime: 2024-03-21 10:40:52
* @LastEditors: zhp
* @Description:
-->
<template>
<el-drawer :visible.sync="visible" :show-close="true" :wrapper-closable="false" class="drawer" size="50%">
<el-drawer :visible.sync="visible" :show-close="true" :wrapper-closable="true" class="drawer" size="50%">
<small-title slot="title" :no-padding="true" @close="handleClose">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
@ -114,7 +114,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="原料等级" prop="materialGrade">
<el-select :disabled="isdetail" v-model="dataForm.materialGrade" placeholder="请选择" style="width: 100%;">
<el-select :disabled="isdetail" v-model="dataForm.materialGrade" placeholder="请选择">
<el-option v-for="item in gradeList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
@ -122,14 +122,14 @@
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input :disabled="isdetail" v-model="dataForm.remark" placeholder="请填写备注" style="width: 100%;">
<el-input @input="onInput" :disabled="isdetail" v-model="dataForm.remark" placeholder="请填写备注">
</el-input>
</el-form-item>
</el-form>
<!-- </div> -->
<div class="attr-list" v-if="idAttrShow">
<!-- <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
<!-- <div class="attr-list" v-if="idAttrShow"> -->
<!-- <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
设备物料明细
</small-title>
@ -147,9 +147,9 @@
</base-table>
<pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" /> -->
</div>
<!-- </div> -->
</div>
<div class="drawer-body__footer">
<div v-if="!isdetail" class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
@ -237,7 +237,7 @@ export default {
checkValueList: [],
checkResult: '',
materialGrade: undefined,
remark:null,
remark:undefined,
},
productAttrList: [],
visible: false,
@ -257,6 +257,9 @@ export default {
mounted() {
},
methods: {
onInput() {
this.$forceUpdate();
},
judgeValue(val, minValue, maxValue, index) {
if (val >= minValue && val <= maxValue) {
console.log(val)
@ -268,7 +271,7 @@ export default {
}
},
handleClose() {
this.ingredientList = undefined
this.ingredientList = []
console.log(222222222);
},
dataFormSubmit() {
@ -454,17 +457,17 @@ export default {
// });
// },
init(id, isdetail) {
this.initData()
// this.initData()
this.getDict()
this.ingredientList = []
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
if (id) {
this.idAttrShow = true
} else {
this.idAttrShow = false
}
// if (id) {
// this.idAttrShow = true
// } else {
// this.idAttrShow = false
// }
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
@ -537,9 +540,9 @@ export default {
//
// this.getList();
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
// if (this.urlOptions.isGetCode) {
// this.getCode()
// }
}
});
},
@ -553,12 +556,12 @@ export default {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id,this.dataForm.id);
});
}
// addNew(id) {
// this.addOrUpdateVisible = true;
// this.$nextTick(() => {
// this.$refs.addOrUpdate.init(id,this.dataForm.id);
// });
// }
}
};
</script>

View File

@ -118,6 +118,7 @@ export default {
labelField: 'name',
valueField: 'id',
param: 'materialId',
filterable: true
},
{
type: 'datePicker',

View File

@ -32,7 +32,7 @@
<!-- </span> -->
<el-tabs style="margin-top: 10px;" v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="天" name="day">
<div id="mapDayMain" style="height: 500px;width: 1000px;"></div>
<div id="mapDayMain" style="margin-bottom: 30px;height: 500px;width: 1000px;"></div>
<div id="listDayMain" style="height: 500px;width: 1000px;"></div>
</el-tab-pane>
<el-tab-pane label="周" name="week">
@ -232,18 +232,23 @@ export default {
var option;
option = {
title: {
text: '各类型缺陷对比图'
text: '各类型缺陷对比图',
// top:'5px'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: mapLegendData
data: mapLegendData,
top: "10%",
y: 'top',
x:'left'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
top:'20%',
containLabel: true
},
// toolbox: {
@ -299,7 +304,7 @@ export default {
trigger: 'axis'
},
legend: {
data: ['缺陷数量', '缺陷率']
data: ['缺陷数量', '缺陷率'],
},
grid: {
left: '3%',
@ -345,15 +350,15 @@ export default {
type: 'bar',
barWidth: '3%',
data: listNumArr,
label: {
show: true, //
position: 'top', //
// formatter: '{c}%',//
textStyle: { //
color: 'black',//
fontSize: 20//
}
}
// label: {
// show: true, //
// position: 'top', //
// // formatter: '{c}%',//
// textStyle: { //
// color: 'black',//
// fontSize: 12//
// }
// }
},
{
name: '缺陷率',
@ -464,6 +469,7 @@ export default {
this.queryParams.endTime = val.checkTime ? val.checkTime[1] : undefined
this.getList()
this.getData()
}
console.log(val);
}

View File

@ -101,6 +101,7 @@ export default {
label: '报废原因',
placeholder: '报废原因',
param: 'content',
// filterable: true
},
{
type: 'select',
@ -109,6 +110,7 @@ export default {
labelField: 'name',
valueField: 'id',
param: 'typeId',
filterable: true
},
{
type: 'button',

View File

@ -107,6 +107,7 @@ export default {
labelField: 'name',
valueField: 'id',
param: 'workOrderId',
filterable: true
},
{
type: 'select',
@ -115,6 +116,7 @@ export default {
labelField: 'name',
valueField: 'id',
param: 'teamId',
filterable: true
},
{
type: 'button',

View File

@ -17,10 +17,10 @@
@mouseleave="factoryListOpen = false">
{{ currentFactory?.label || '点我选择设备' }}
<div class="factory-list__wrapper" :class="{ open: factoryListOpen }">
<ul class="factory-list" v-if="sidebarContent.length" @click.prevent="factoryChangeHandler">
<li v-for="fc in sidebarContent" :key="fc.id" :data-value="fc.id" class="factory-list__item"
<ul class="factory-list" v-if="sidebarContent.length" @click.capture="factoryChangeHandler">
<li v-for="fc in sidebarContent" :key="fc.id" class="factory-list__item"
:class="{ 'is-current': fc.id == currentFactory?.id }">
<span>
<span :data-value="fc.id">
{{ fc.label }}
</span>
<svg-icon v-if="fc.id == currentFactory?.id" icon-class="Confirm" style="height: 14px; width: 14px" />
@ -95,12 +95,12 @@ export default {
factoryListOpen: false,
currentFactory: null,
factoryList: [
{ name: '1', value: 1 },
{ name: '2', value: 2 },
{ name: '3', value: 3 },
{ name: '4', value: 4 },
{ name: '5', value: 5 },
{ name: '6', value: 6 },
// { name: '1', value: 1 },
// { name: '2', value: 2 },
// { name: '3', value: 3 },
// { name: '4', value: 4 },
// { name: '5', value: 5 },
// { name: '6', value: 6 },
],
sidebarContent: [
// {
@ -486,14 +486,12 @@ export default {
},
async getTree(id) {
getTreeData({id:id}).then((res) => {
console.log(res.data);
this.sidebarContent = res.data;
this.buildTree(res.data);
console.log('tree', this.sidebarContent);
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
const res = await getTreeData({ id: id })
console.log(res.data)
this.buildTree(res.data);
this.sidebarContent = res.data;
console.log('tree', this.sidebarContent)
console.log(this.sidebarContent);
// const { data } = await this.$axios('/base/core-factory/getTreeByWorkOrder');
// console.log(data)
@ -504,10 +502,13 @@ export default {
},
factoryChangeHandler(event) {
this.factoryListOpen = false;
this.currentFactory =undefined
this.factoryListOpen = false
console.log(event.target.dataset);
const fcId = event.target.dataset.value;
this.handleSidebarItemClick({ id: fcId, type: '工厂' });
this.currentFactory = this.sidebarContent.find((item) => item.id == fcId);
this.currentFactory = this.sidebarContent.find((item) => item.id == fcId)
console.log(this.currentFactory);
},
handleSidebarItemClick({ label, id, type }) {

View File

@ -6,83 +6,60 @@
-->
<template>
<div class="app-container allow-overflow">
<!-- 搜索工作栏 -->
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<div class="app-container allow-overflow">
<!-- 搜索工作栏 -->
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
<el-row>
<el-col class="custom-tabs">
<el-tabs
v-model="activeName"
:stretch="true"
@tab-click="handleTabClick">
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
<!-- 列表 -->
<base-table
class="base-table__margin"
:table-props="tableProps"
:page="1"
:limit="10"
:table-data="list"
@emitFun="handleEmitFun"></base-table>
</el-tab-pane>
<el-tab-pane
:label="'\u3000可视化\u3000'"
name="graph"
style="overflow: inherit">
<div
v-if="activeName == 'graph'"
class="graph"
style="
<el-row>
<el-col class="custom-tabs">
<el-tabs v-model="activeName" :stretch="true" @tab-click="handleTabClick">
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
<!-- 列表 -->
<base-table class="base-table__margin" :table-props="tableProps" :page="1" :limit="10" :max-height="tableH"
:table-data="list" @emitFun="handleEmitFun"></base-table>
</el-tab-pane>
<el-tab-pane :label="'\u3000可视化\u3000'" name="graph" style="overflow: inherit">
<div v-if="activeName == 'graph'" class="graph" style="
overflow: inherit;
display: flex;
flex-direction: column;
position: relative;
">
<div class="blue-title">各设备加工数量</div>
<div class="legend">
<div class="legend-item">
<span class="icon blue"></span>
<span class="text">工作时长</span>
</div>
<div class="legend-item">
<span class="icon green"></span>
<span class="text">停机时长</span>
</div>
<div class="legend-item">
<span class="icon purple"></span>
<span class="text">故障时长</span>
</div>
<div class="legend-item">
<span class="icon yellow"></span>
<span class="text">速度开动率</span>
</div>
</div>
<div class="graph-grid">
<div class="bg-grid grid-line">
<div
class="grid-item"
v-for="item in list.length"
:key="item"></div>
</div>
<div class="blue-title">各设备加工数量</div>
<div class="legend">
<div class="legend-item">
<span class="icon blue"></span>
<span class="text">工作时长</span>
</div>
<div class="legend-item">
<span class="icon green"></span>
<span class="text">停机时长</span>
</div>
<div class="legend-item">
<span class="icon purple"></span>
<span class="text">故障时长</span>
</div>
<div class="legend-item">
<span class="icon yellow"></span>
<span class="text">速度开动率</span>
</div>
</div>
<div class="graph-grid">
<div class="bg-grid grid-line">
<div class="grid-item" v-for="item in list.length" :key="item"></div>
</div>
<div class="bg-grid grid-charts">
<pie-chart
v-for="item in list"
:key="item.id"
:value="item" />
<!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> -->
</div>
</div>
</div>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
</div>
<div class="bg-grid grid-charts">
<pie-chart v-for="item in list" :key="item.id" :value="item" />
<!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> -->
</div>
</div>
</div>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
</div>
</template>
<script>
@ -116,7 +93,8 @@ export default {
// btnName: '',
// }
// : undefined,
// ].filter((v) => v),
// ].filter((v) => v),
tableH: this.tableHeight(260),
tableProps: [
{ prop: 'factoryName', label: '工厂' },
{ prop: 'lineName', label: '产线' },
@ -331,7 +309,10 @@ export default {
list: [],
};
},
created() {
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getWorkOrder()
// this.getLine();
this.getList();

View File

@ -2,13 +2,14 @@
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2023-12-01 16:41:40
* @LastEditTime: 2024-03-21 15:14:04
* @Description:
-->
<template>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
<base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
:table-data="list">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> -->
</base-table>
@ -81,6 +82,7 @@ export default {
// // exportURL: exportPackingExcel,
// },
tableProps,
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi(`base:packaging-print-log:update`)
? {
@ -172,6 +174,9 @@ export default {
// AddOrUpdate,
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList()
this.getDict()
},

View File

@ -2,13 +2,14 @@
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2024-03-01 10:27:29
* @LastEditTime: 2024-03-21 15:17:05
* @Description:
-->
<template>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
<base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
:table-data="list">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> -->
</base-table>
@ -118,6 +119,7 @@ export default {
startTime: undefined,
endTime:undefined,
},
tableH: this.tableHeight(260),
formConfig: [
{
type: 'select',
@ -125,7 +127,8 @@ export default {
selectOptions: [],
labelField: 'name',
valueField: 'name',
param: 'workOrderName'
param: 'workOrderName',
filterable: true
},
// {
// type: 'datePicker',
@ -181,6 +184,9 @@ export default {
// AddOrUpdate,
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList()
this.getDict()
},

View File

@ -74,14 +74,16 @@ export default {
multiple: true,
labelField: 'name',
valueField: 'id',
defaultSelect: []
defaultSelect: [],
filterable: true
},
{
type: 'select',
label: '产品',
placeholder: '请选择产品',
param: 'productionId',
selectOptions: [],
selectOptions: [],
filterable: true
},
// {
// type: 'input',