From 7201c26792532d03b4c050a6f060d950be95f738 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 28 Nov 2023 15:46:50 +0800 Subject: [PATCH 1/5] fix bugs --- .env.dev | 2 +- .../analysis/balanceAnalysis/index copy.vue | 270 ++++++++ .../core/analysis/balanceAnalysis/index.vue | 599 +++++++++++------- .../base/alarm/Record/AddOrUpdate.vue | 6 +- .../DataCollection/CollectionConfig.vue | 4 +- .../DataCollection/components/BasicDrawer.vue | 49 +- src/views/equipment/monitor/SearchBar.vue | 4 + src/views/extend/processFlow/index.vue | 9 +- .../components/BomSelection.vue | 10 +- .../components/ProcessBomList.vue | 16 + .../components/ProcessDetail.vue | 39 +- .../components/ProcessInfo.vue | 27 +- 12 files changed, 760 insertions(+), 275 deletions(-) create mode 100644 src/views/core/analysis/balanceAnalysis/index copy.vue diff --git a/.env.dev b/.env.dev index 962b91c1..3497fe49 100644 --- a/.env.dev +++ b/.env.dev @@ -16,7 +16,7 @@ VUE_APP_TITLE = MES系统 VUE_APP_BASE_API = 'http://192.168.0.33:48082' # VUE_APP_BASE_API = 'http://192.168.4.173:48080' # VUE_APP_BASE_API = 'http://192.168.2.173:48080' -# VUE_APP_BASE_API = 'http://192.168.1.49:48080' +# VUE_APP_BASE_API = 'http://192.168.1.49:48082' # VUE_APP_BASE_API = 'http://192.168.1.8:48082' # VUE_APP_BASE_API = 'http://192.168.4.159:48080' # VUE_APP_BASE_API = 'http://192.168.1.56:48082' diff --git a/src/views/core/analysis/balanceAnalysis/index copy.vue b/src/views/core/analysis/balanceAnalysis/index copy.vue new file mode 100644 index 00000000..7d5fca73 --- /dev/null +++ b/src/views/core/analysis/balanceAnalysis/index copy.vue @@ -0,0 +1,270 @@ + + + diff --git a/src/views/core/analysis/balanceAnalysis/index.vue b/src/views/core/analysis/balanceAnalysis/index.vue index 7adceb4a..5579da4a 100644 --- a/src/views/core/analysis/balanceAnalysis/index.vue +++ b/src/views/core/analysis/balanceAnalysis/index.vue @@ -1,137 +1,231 @@ diff --git a/src/views/equipment/base/alarm/Record/AddOrUpdate.vue b/src/views/equipment/base/alarm/Record/AddOrUpdate.vue index 660f3aa4..28544fe2 100644 --- a/src/views/equipment/base/alarm/Record/AddOrUpdate.vue +++ b/src/views/equipment/base/alarm/Record/AddOrUpdate.vue @@ -54,13 +54,15 @@ export default { alarmContent: null, alarmValue: null, // 缺少报警编号字段, 用 alarmValue 代替 + alarmCode: null, + equipmentCode: null }, orderFormRows: [ [ { input: true, label: '设备编码', - prop: 'equipment', + prop: 'equipmentCode', }, { datetime: true, @@ -70,7 +72,7 @@ export default { { input: true, label: '报警编号', - prop: 'alarmValue', + prop: 'alarmCode', }, { input: true, diff --git a/src/views/equipment/base/config/DataCollection/CollectionConfig.vue b/src/views/equipment/base/config/DataCollection/CollectionConfig.vue index 64b25d33..abba9d4d 100644 --- a/src/views/equipment/base/config/DataCollection/CollectionConfig.vue +++ b/src/views/equipment/base/config/DataCollection/CollectionConfig.vue @@ -304,7 +304,7 @@ export default { filter: publicFormatter('unit_dict'), }, { - prop: 'equipment_param_type', + prop: 'equipmentParamType', label: '设备参数类型', filter: (val) => val != null @@ -312,7 +312,7 @@ export default { : '-', }, { - prop: 'production_param_type', + prop: 'productionParamType', label: '生产参数类型', filter: (val) => val != null diff --git a/src/views/equipment/base/config/DataCollection/components/BasicDrawer.vue b/src/views/equipment/base/config/DataCollection/components/BasicDrawer.vue index 92b8039b..a2f09855 100644 --- a/src/views/equipment/base/config/DataCollection/components/BasicDrawer.vue +++ b/src/views/equipment/base/config/DataCollection/components/BasicDrawer.vue @@ -61,7 +61,7 @@ 关联表名
- {{ form.plcTableName }} + {{ form.plcName }}
@@ -73,9 +73,17 @@ class="title" label="设备名" style="font-size: 16px; margin: 8px 0"> - + + + @@ -83,9 +91,17 @@ class="title" label="设备关联表名" style="font-size: 16px; margin: 8px 0"> - + + + @@ -202,6 +218,8 @@ export default { total: 0, form: {}, list: [], + eqList: [], + plcList: [], attrTitle: '', attrForm: { id: null, @@ -257,7 +275,7 @@ export default { { select: true, label: '设备参数类型', - prop: 'equipment_param_type', + prop: 'equipmentParamType', options: [ { label: '一般参数', value: 1 }, { label: '工艺参数', value: 2 }, @@ -274,7 +292,7 @@ export default { { select: true, label: '生产参数类型', - prop: 'production_param_type', + prop: 'productionParamType', options: [ // { label: '进片数量', value: 1 }, // { label: '出片数量', value: 2 }, @@ -380,6 +398,17 @@ export default { mounted() { this.shouldRefreshPageView = false; this.mode = this.defaultMode || 'detail'; + + if (this.mode != 'detail') { + this.$axios('/base/core-equipment/listAll').then(({ code, data }) => { + this.eqList = data; + }); + this.$axios({ + url: '/base/equipment-plc/page', + }).then(({ code, data }) => { + this.plcList = data.list; + }); + } for (const section of this.sections) { // 请求具体信息 if ('url' in section) { @@ -479,6 +508,8 @@ export default { defaultValue: '', description: '', remark: '', + equipmentParamType: '', + productionParamType: '', alarmContent: '', }; this.attrTitle = '添加参数绑定信息'; diff --git a/src/views/equipment/monitor/SearchBar.vue b/src/views/equipment/monitor/SearchBar.vue index 5ecc8031..1cc50e7c 100644 --- a/src/views/equipment/monitor/SearchBar.vue +++ b/src/views/equipment/monitor/SearchBar.vue @@ -17,6 +17,8 @@ { const { code } = await this.http( '/extend/process-flow/copy', - 'post', + 'get', { id, } @@ -333,10 +333,11 @@ export default { async getList() { this.loading = true; - const { code, data } = await this.recv(this.queryParams); + // const { code, data } = await this.recv(this.queryParams); + const { code, data } = await this.http('/extend/process-flow/listAll', 'get'); if (code == 0) { - this.list = data.list; - this.total = data.total; + this.list = data; + // this.total = data.total; this.loading = false; return; } diff --git a/src/views/extend/processFlowView/components/BomSelection.vue b/src/views/extend/processFlowView/components/BomSelection.vue index 75bfa061..fbdd0219 100644 --- a/src/views/extend/processFlowView/components/BomSelection.vue +++ b/src/views/extend/processFlowView/components/BomSelection.vue @@ -28,7 +28,7 @@ export default { // }, props: { currentSelect: { - type: String, + type: String | Number, default: null, }, list: { @@ -59,8 +59,16 @@ export default { }, currentSelect: { handler(val) { + // val: string this.selected = val; this.randomKey = Math.random(); + // 更新选中状态 + if (val) { + this.list__inner.forEach((item) => { + if (item.id == val) item.disabled = false; + else item.disabled = true; + }); + } }, immediate: true, }, diff --git a/src/views/extend/processFlowView/components/ProcessBomList.vue b/src/views/extend/processFlowView/components/ProcessBomList.vue index d56eb442..a086d547 100644 --- a/src/views/extend/processFlowView/components/ProcessBomList.vue +++ b/src/views/extend/processFlowView/components/ProcessBomList.vue @@ -77,6 +77,17 @@ :bom-list="bomList" :value="selectedBoms" @update="selectedBoms = $event" /> + + + 取消 + + 确定 + + @@ -95,6 +106,7 @@ export default { }, data() { return { + btnLoading: false, open: false, eqList: [], bomList: [], @@ -170,6 +182,7 @@ export default { }); }, submitForm() { + this.btnLoading = true; // 现将子组件的修改提交更新至本组件 this.$refs.bomSelector.commit(); // 再提交至后端 @@ -187,11 +200,14 @@ export default { if (code == 0) { this.$message.success('操作成功'); this.getList(this.currentDet); + this.btnLoading = false; this.cancel(); } else { + this.btnLoading = false; this.$message.error('操作失败'); } } else { + this.btnLoading = false; this.$message.info('请选择设备'); } }); diff --git a/src/views/extend/processFlowView/components/ProcessDetail.vue b/src/views/extend/processFlowView/components/ProcessDetail.vue index 81d27ce9..68c0dac2 100644 --- a/src/views/extend/processFlowView/components/ProcessDetail.vue +++ b/src/views/extend/processFlowView/components/ProcessDetail.vue @@ -62,6 +62,16 @@ @cancel="cancel" @confirm="submitForm"> + + 取消 + + 确定 + + @@ -102,7 +112,9 @@ export default { input: true, label: '工序名称', prop: 'name', - rules: [{ required: true, message: '工序名称不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '工序名称不能为空', trigger: 'blur' }, + ], }, ], [ @@ -111,7 +123,9 @@ export default { label: '工段', prop: 'sectionId', url: '/base/core-workshop-section/listAll', - rules: [{ required: true, message: '工段不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '工段不能为空', trigger: 'blur' }, + ], bind: { filterable: true, }, @@ -139,6 +153,7 @@ export default { }, currentDet: null, currentNode: null, + btnLoading: false }; }, watch: { @@ -221,7 +236,7 @@ export default { node.attr('container/stroke', '#0b58ff'); const { detId, detName, detDesc, processId, sectionId, sectionName } = node.attrs; - console.log('node clicked!', node) + console.log('node clicked!', node); this.currentDet = {}; this.$set(this.currentDet, 'detId', detId?.text); this.$set(this.currentDet, 'sectionId', sectionId?.text); @@ -354,6 +369,7 @@ export default { }, handleEdit() { + console.log('edit: ', this.currentDet); this.form.name = this.currentDet.detName; this.form.sectionId = this.currentDet.sectionId; this.form.remark = this.currentDet.detDesc; @@ -379,6 +395,7 @@ export default { if (!valid) { return; } + this.btnLoading = true; // 修改的提交 if (this.form.id != null) { this.updateProcess() @@ -392,9 +409,20 @@ export default { sectionName: { text: sectionName }, detDesc: { text: remark }, }); + // 修改currentDet + this.currentDet = { + ...this.currentDet, + detName: name, + sectionId: sectionId, + sectionName: sectionName, + detDesc: remark, + }; + this.btnLoading = false; }); }) - .catch((err) => {}); + .catch((err) => { + this.btnLoading = false; + }); return; } @@ -412,11 +440,14 @@ export default { .then((node) => { if (!node) { this.$modal.msgError('创建节点失败'); + this.btnLoading = false; return; } + this.btnLoading = false; this.graph.addNode(node); }) .catch((err) => { + this.btnLoading = false; return; }); }); diff --git a/src/views/extend/processFlowView/components/ProcessInfo.vue b/src/views/extend/processFlowView/components/ProcessInfo.vue index 705fefba..af64dc8c 100644 --- a/src/views/extend/processFlowView/components/ProcessInfo.vue +++ b/src/views/extend/processFlowView/components/ProcessInfo.vue @@ -21,12 +21,12 @@ - + - + @@ -39,11 +39,12 @@ From a5c17d2276d72cb9856a6412d5aecb43a1731ada Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 28 Nov 2023 16:14:24 +0800 Subject: [PATCH 2/5] fix conflicts --- .../core/analysis/balanceAnalysis/index.vue | 78 ++++++++++--------- .../equipment/base/alarm/Record/index.vue | 19 +---- 2 files changed, 43 insertions(+), 54 deletions(-) diff --git a/src/views/core/analysis/balanceAnalysis/index.vue b/src/views/core/analysis/balanceAnalysis/index.vue index 5579da4a..8ce3b630 100644 --- a/src/views/core/analysis/balanceAnalysis/index.vue +++ b/src/views/core/analysis/balanceAnalysis/index.vue @@ -162,50 +162,54 @@ export default { buildProps(nameData) { return new Promise((resolve, reject) => { - const dateArr = Array.from( - new Set( - nameData - .map((item) => (item.tree == 1 ? item.name : undefined)) - .filter((v) => v) - ) - ); - // 排个序 - dateArr.sort().forEach((date) => { - this.tableProps.push({ - label: date, - align: 'center', - children: [ - { - prop: date + '_eq_ct', - label: '设备CT', - align: 'center', - }, - { - prop: date + '_eq_tt', - label: '设备TT', - align: 'center', - }, - { - prop: date + '_pl_ct', - label: '产线CT', - align: 'center', - }, - { - prop: date + '_pl_tt', - label: '产线TT', - align: 'center', - }, - ], + try { + const dateArr = Array.from( + new Set( + nameData + .map((item) => (item.tree == 1 ? item.name : undefined)) + .filter((v) => v) + ) + ); + // 排个序 + dateArr.sort().forEach((date) => { + this.tableProps.push({ + label: date, + align: 'center', + children: [ + { + prop: date + '_eq_ct', + label: '设备CT', + align: 'center', + }, + { + prop: date + '_eq_tt', + label: '设备TT', + align: 'center', + }, + { + prop: date + '_pl_ct', + label: '产线CT', + align: 'center', + }, + { + prop: date + '_pl_tt', + label: '产线TT', + align: 'center', + }, + ], + }); }); - }); - resolve(); + resolve(); + } catch (err) { + reject(err); + } }); }, async buildTableData(data) { /** 处理 工段 分组 */ - const sectionList = data.map(item => {}) + const sectionList = data.map((item) => {}); }, setRowSpan(arr) { diff --git a/src/views/equipment/base/alarm/Record/index.vue b/src/views/equipment/base/alarm/Record/index.vue index c4f93007..91a9f310 100644 --- a/src/views/equipment/base/alarm/Record/index.vue +++ b/src/views/equipment/base/alarm/Record/index.vue @@ -59,14 +59,9 @@ - - diff --git a/src/views/equipment/base/inspection/Record/index.vue b/src/views/equipment/base/inspection/Record/index.vue index 77b995ad..5dcee26b 100644 --- a/src/views/equipment/base/inspection/Record/index.vue +++ b/src/views/equipment/base/inspection/Record/index.vue @@ -93,7 +93,7 @@ export default { tableProps: [ { prop: 'configName', label: '配置名称' }, { prop: 'equipmentName', label: '设备名称' }, - // { prop: 'lineName', label: '数据来源' }, + { prop: 'origin', label: '数据来源', filter: (val) => ['', '手动', '自动'][val] }, // { prop: 'sectionName', label: '计划巡检时间' }, { prop: 'actualTime', label: '实际巡检时间', filter: parseTime }, // { prop: 'maintenanceDetail', label: '完成状态' }, From 27faa04c7a225de6a65b0dff5b6494d70b39fb70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Wed, 29 Nov 2023 08:48:09 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/quality/monitoring/statisticalData/index.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/quality/monitoring/statisticalData/index.vue b/src/views/quality/monitoring/statisticalData/index.vue index 756e2a64..f489f16c 100644 --- a/src/views/quality/monitoring/statisticalData/index.vue +++ b/src/views/quality/monitoring/statisticalData/index.vue @@ -259,10 +259,11 @@ export default { }, mounted() { if (this.$route.query.woIdString) { - console.log(this.$route.query.woIdString); - this.queryParams.workOrderIdList = [this.$route.query.woIdString] + console.log(this.$route.query.woIdString) + this.queryParams.workOrderIdList = this.$route.query.woIdString.split(',') + // this.queryParams.workOrderIdList = [this.$route.query.woIdString] // let arr =[] - this.searchBarFormConfig[0].defaultSelect = [this.$route.query.woIdString] + this.searchBarFormConfig[0].defaultSelect = this.$route.query.woIdString.split(',') console.log(this.searchBarFormConfig[0].defaultSelect); } // if (this.$route.params.startTime && this.$route.params.endTime) {