From c899bb37e354487f222373f58aceb6008bc45c6b Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 26 Sep 2023 11:03:34 +0800 Subject: [PATCH 01/12] update quality inspection record --- src/views/base/equipmentBindGroup/index.vue | 2 +- .../qualityInspectionRecord/dialogForm.vue | 243 ++++++++++++++++++ .../qualityInspectionRecord/index.vue | 51 ++-- 3 files changed, 270 insertions(+), 26 deletions(-) create mode 100644 src/views/quality/monitoring/qualityInspectionRecord/dialogForm.vue diff --git a/src/views/base/equipmentBindGroup/index.vue b/src/views/base/equipmentBindGroup/index.vue index 33477279..bab7525f 100644 --- a/src/views/base/equipmentBindGroup/index.vue +++ b/src/views/base/equipmentBindGroup/index.vue @@ -303,7 +303,7 @@ export default { handleDelete(row) { const id = row.id; this.$modal - .confirm('是否确认删除设备与分组绑定编号为"' + id + '"的数据项?') + .confirm('是否确认删除该分组绑定?') .then(function () { return deleteEquipmentBindGroup(id); }) diff --git a/src/views/quality/monitoring/qualityInspectionRecord/dialogForm.vue b/src/views/quality/monitoring/qualityInspectionRecord/dialogForm.vue new file mode 100644 index 00000000..58fcf31e --- /dev/null +++ b/src/views/quality/monitoring/qualityInspectionRecord/dialogForm.vue @@ -0,0 +1,243 @@ + + + + + + + diff --git a/src/views/quality/monitoring/qualityInspectionRecord/index.vue b/src/views/quality/monitoring/qualityInspectionRecord/index.vue index 9aef665c..2eb641ef 100644 --- a/src/views/quality/monitoring/qualityInspectionRecord/index.vue +++ b/src/views/quality/monitoring/qualityInspectionRecord/index.vue @@ -53,14 +53,15 @@ import { getQualityInspectionRecordPage, exportQualityInspectionRecordExcel, } from '@/api/monitoring/qualityInspectionRecord'; -import Editor from '@/components/Editor'; +// import Editor from '@/components/Editor'; import moment from 'moment'; +// import DialogForm from './dialogForm.vue' import basicPageMixin from '@/mixins/lb/basicPageMixin'; export default { name: 'QualityInspectionRecord', components: { - Editor, + // DialogForm }, mixins: [basicPageMixin], data() { @@ -272,32 +273,32 @@ export default { }, created() { this.getList(); - this.getProductLineList(); + // this.getProductLineList(); }, watch: { // 注册弹窗里产线改变时的监听事件 - 'form.productionLineId': { - handler: function (val) { - if (val == null) return; - this.$axios('/base/workshop-section/listByParentId', { - params: { - id: val, - }, - }).then((response) => { - this.$set( - this.rows[1][1], // 这里索引是硬编码,所以当 this.rows 里数据顺序改变时,此处也要改 - 'options', - response.data.map((item) => { - return { - label: item.name, - value: item.id, - }; - }) - ); - }); - }, - immediate: true, - }, + // 'form.productionLineId': { + // handler: function (val) { + // if (val == null) return; + // this.$axios('/base/workshop-section/listByParentId', { + // params: { + // id: val, + // }, + // }).then((response) => { + // this.$set( + // this.rows[1][1], // 这里索引是硬编码,所以当 this.rows 里数据顺序改变时,此处也要改 + // 'options', + // response.data.map((item) => { + // return { + // label: item.name, + // value: item.id, + // }; + // }) + // ); + // }); + // }, + // immediate: true, + // }, }, methods: { /** 获取搜索栏的产线列表 */ From a4594426c3be15e5002491723688dbb9759b9d3b Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 26 Sep 2023 14:38:30 +0800 Subject: [PATCH 02/12] bugfix --- .../equipment/timing-diagram/output/index.vue | 7 ++-- .../qualityInspectionRecord/dialogForm.vue | 34 ++++++++++++------- .../qualityInspectionRecord/index.vue | 18 +++++++--- 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/src/views/equipment/timing-diagram/output/index.vue b/src/views/equipment/timing-diagram/output/index.vue index 2c01dffd..8f9ad93f 100644 --- a/src/views/equipment/timing-diagram/output/index.vue +++ b/src/views/equipment/timing-diagram/output/index.vue @@ -141,7 +141,7 @@ export default { top: 48, left: 48, right: 24, - bottom: 24, + bottom: 64, }, legend: { top: 0, @@ -171,7 +171,10 @@ export default { }, }, axisLabel: { - color: '#0007', + // show: true, + // textStyle: { + // color: '#0007', + // }, }, data: [], // data: Array(24) diff --git a/src/views/quality/monitoring/qualityInspectionRecord/dialogForm.vue b/src/views/quality/monitoring/qualityInspectionRecord/dialogForm.vue index 58fcf31e..f3c06269 100644 --- a/src/views/quality/monitoring/qualityInspectionRecord/dialogForm.vue +++ b/src/views/quality/monitoring/qualityInspectionRecord/dialogForm.vue @@ -62,7 +62,7 @@ prop="productionLineId" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> + @change="$emit('update', innerDataForm)"> @@ -112,12 +112,11 @@ prop="checkTime" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> + @change="$emit('update', innerDataForm)"> @@ -126,15 +125,17 @@ @@ -163,6 +164,7 @@ export default { inspectionDetList: [], productionLineList: [], sectionList: [], + innerDataForm: {}, }; }, mounted() { @@ -173,12 +175,18 @@ export default { ); }, watch: { - 'dataForm.productionLineId': { + 'innerDataForm.productionLineId': { handler: async function (plId) { if (plId) await this.getWorksectionList(plId); }, immediate: true, }, + dataForm: { + handler: function (dataForm) { + this.innerDataForm = JSON.parse(JSON.stringify(dataForm)); + }, + immediate: true, + }, }, methods: { /** 模拟透传 ref */ @@ -190,8 +198,8 @@ export default { }, async handleProductlineChange(id) { await this.getWorksectionList(id); - this.dataForm.sectionId = null; - this.$emit('update', this.dataForm); + this.innerDataForm.sectionId = null; + this.$emit('update', this.innerDataForm); }, // getCode async getCode(url) { diff --git a/src/views/quality/monitoring/qualityInspectionRecord/index.vue b/src/views/quality/monitoring/qualityInspectionRecord/index.vue index 2eb641ef..8dec558e 100644 --- a/src/views/quality/monitoring/qualityInspectionRecord/index.vue +++ b/src/views/quality/monitoring/qualityInspectionRecord/index.vue @@ -39,7 +39,7 @@ @close="cancel" @cancel="cancel" @confirm="submitForm"> - + @@ -55,13 +55,13 @@ import { } from '@/api/monitoring/qualityInspectionRecord'; // import Editor from '@/components/Editor'; import moment from 'moment'; -// import DialogForm from './dialogForm.vue' +import DialogForm from './dialogForm.vue'; import basicPageMixin from '@/mixins/lb/basicPageMixin'; export default { name: 'QualityInspectionRecord', components: { - // DialogForm + DialogForm, }, mixins: [basicPageMixin], data() { @@ -276,6 +276,12 @@ export default { // this.getProductLineList(); }, watch: { + form: { + handler: function (val) { + console.log('form change:', val); + }, + deep: true + } // 注册弹窗里产线改变时的监听事件 // 'form.productionLineId': { // handler: function (val) { @@ -367,7 +373,11 @@ export default { const id = row.id; getQualityInspectionRecord(id).then((response) => { /** 因为后端返回的时间是时间戳格式,需转换 */ - this.form = this.filterData(response.data, Object.keys(this.form)); + const info = {} + Object.keys(this.form).forEach(key => { + info[key] = response.data[key] + }); + this.form = info; this.open = true; this.title = '修改质量检查信息记录表'; }); From 24ffea330d2c98f68763950d69521aa878492738 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 26 Sep 2023 14:56:00 +0800 Subject: [PATCH 03/12] =?UTF-8?q?update=20=E8=AE=BE=E5=A4=87=E4=BA=A7?= =?UTF-8?q?=E9=87=8F=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipment/timing-diagram/output/index.vue | 3 + .../timing-diagram/output/response.json | 200 ++++++++++++++++++ 2 files changed, 203 insertions(+) create mode 100644 src/views/equipment/timing-diagram/output/response.json diff --git a/src/views/equipment/timing-diagram/output/index.vue b/src/views/equipment/timing-diagram/output/index.vue index 8f9ad93f..47851105 100644 --- a/src/views/equipment/timing-diagram/output/index.vue +++ b/src/views/equipment/timing-diagram/output/index.vue @@ -85,6 +85,7 @@ export default { placeholder: '请选择产线', selectOptions: [], param: 'lineId', + required: true }, { type: 'select', @@ -92,6 +93,7 @@ export default { placeholder: '请选择工段', selectOptions: [], param: 'sectionId', + required: true, }, // 时间段 { @@ -108,6 +110,7 @@ export default { // defaultTime: ['00:00:00', '23:59:59'], placeholder: '选择日期', param: 'recordTime', + required: true }, { type: 'button', diff --git a/src/views/equipment/timing-diagram/output/response.json b/src/views/equipment/timing-diagram/output/response.json new file mode 100644 index 00000000..c3d87799 --- /dev/null +++ b/src/views/equipment/timing-diagram/output/response.json @@ -0,0 +1,200 @@ +{ + "code": 0, + "data": { + "上片机": [ + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695657600000, + "startTime": 1695657600000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695661200000, + "startTime": 1695661200000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695664800000, + "startTime": 1695664800000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695668400000, + "startTime": 1695668400000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695672000000, + "startTime": 1695672000000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695675600000, + "startTime": 1695675600000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695679200000, + "startTime": 1695679200000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695682800000, + "startTime": 1695682800000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695686400000, + "startTime": 1695686400000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695690000000, + "startTime": 1695690000000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695693600000, + "startTime": 1695693600000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695697200000, + "startTime": 1695697200000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695700800000, + "startTime": 1695700800000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695704400000, + "startTime": 1695704400000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695708000000, + "startTime": 1695708000000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695711600000, + "startTime": 1695711600000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695715200000, + "startTime": 1695715200000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695718800000, + "startTime": 1695718800000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695722400000, + "startTime": 1695722400000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695726000000, + "startTime": 1695726000000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695729600000, + "startTime": 1695729600000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695733200000, + "startTime": 1695733200000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695736800000, + "startTime": 1695736800000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695740400000, + "startTime": 1695740400000 + } + ], + "下片机": [] + } +} From 87f56dd9ac5e926bbfd2cf501886136e8a4a32f5 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 26 Sep 2023 15:12:41 +0800 Subject: [PATCH 04/12] update responsejson --- .../equipment/timing-diagram/output/index.vue | 11 +- .../timing-diagram/output/response.json | 171 ++++++++++++++---- 2 files changed, 143 insertions(+), 39 deletions(-) diff --git a/src/views/equipment/timing-diagram/output/index.vue b/src/views/equipment/timing-diagram/output/index.vue index 47851105..51507a1b 100644 --- a/src/views/equipment/timing-diagram/output/index.vue +++ b/src/views/equipment/timing-diagram/output/index.vue @@ -85,7 +85,7 @@ export default { placeholder: '请选择产线', selectOptions: [], param: 'lineId', - required: true + required: true, }, { type: 'select', @@ -110,7 +110,7 @@ export default { // defaultTime: ['00:00:00', '23:59:59'], placeholder: '选择日期', param: 'recordTime', - required: true + required: true, }, { type: 'button', @@ -273,7 +273,14 @@ export default { }); }, + initState() { + this.accumulators = new Map(); + this.templateConfig.series = [] + }, + async getList() { + this.initState(); + const { code, data } = await this.$axios({ url: '/analysis/equipment-analysis/quantity', method: 'get', diff --git a/src/views/equipment/timing-diagram/output/response.json b/src/views/equipment/timing-diagram/output/response.json index c3d87799..38ecd7d0 100644 --- a/src/views/equipment/timing-diagram/output/response.json +++ b/src/views/equipment/timing-diagram/output/response.json @@ -13,40 +13,40 @@ { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 189, + "nokQuantity": 11, "recordTime": 1695661200000, "startTime": 1695661200000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 198, + "nokQuantity": 2, "recordTime": 1695664800000, "startTime": 1695664800000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 197, + "nokQuantity": 3, "recordTime": 1695668400000, "startTime": 1695668400000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 200, + "nokQuantity": 0, "recordTime": 1695672000000, "startTime": 1695672000000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 170, + "nokQuantity": 30, "recordTime": 1695675600000, "startTime": 1695675600000 }, @@ -69,16 +69,16 @@ { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 195, + "nokQuantity": 5, "recordTime": 1695686400000, "startTime": 1695686400000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 198, + "nokQuantity": 2, "recordTime": 1695690000000, "startTime": 1695690000000 }, @@ -93,40 +93,40 @@ { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 197, + "nokQuantity": 3, "recordTime": 1695697200000, "startTime": 1695697200000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 197, + "nokQuantity": 3, "recordTime": 1695700800000, "startTime": 1695700800000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 196, + "nokQuantity": 4, "recordTime": 1695704400000, "startTime": 1695704400000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 193, + "nokQuantity": 7, "recordTime": 1695708000000, "startTime": 1695708000000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 190, + "nokQuantity": 10, "recordTime": 1695711600000, "startTime": 1695711600000 }, @@ -141,24 +141,24 @@ { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 200, + "nokQuantity": 0, "recordTime": 1695718800000, "startTime": 1695718800000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 200, + "nokQuantity": 0, "recordTime": 1695722400000, "startTime": 1695722400000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 198, + "nokQuantity": 2, "recordTime": 1695726000000, "startTime": 1695726000000 }, @@ -173,28 +173,125 @@ { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 189, + "nokQuantity": 11, "recordTime": 1695733200000, "startTime": 1695733200000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 179, + "nokQuantity": 21, "recordTime": 1695736800000, "startTime": 1695736800000 }, { "inQuantity": 200, "outQuantity": 200, - "okQuantity": 199, - "nokQuantity": 1, + "okQuantity": 200, + "nokQuantity": 0, "recordTime": 1695740400000, "startTime": 1695740400000 } ], - "下片机": [] + "下片机": [ + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 190, + "nokQuantity": 10, + "recordTime": 1695672000000, + "startTime": 1695672000000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 177, + "nokQuantity": 23, + "recordTime": 1695675600000, + "startTime": 1695675600000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 198, + "nokQuantity": 2, + "recordTime": 1695679200000, + "startTime": 1695679200000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 200, + "nokQuantity": 0, + "recordTime": 1695682800000, + "startTime": 1695682800000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 185, + "nokQuantity": 15, + "recordTime": 1695686400000, + "startTime": 1695686400000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 198, + "nokQuantity": 2, + "recordTime": 1695690000000, + "startTime": 1695690000000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 200, + "nokQuantity": 0, + "recordTime": 1695693600000, + "startTime": 1695693600000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 193, + "nokQuantity": 7, + "recordTime": 1695697200000, + "startTime": 1695697200000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 200, + "nokQuantity": 0, + "recordTime": 1695700800000, + "startTime": 1695700800000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 200, + "nokQuantity": 0, + "recordTime": 1695704400000, + "startTime": 1695704400000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 192, + "nokQuantity": 8, + "recordTime": 1695708000000, + "startTime": 1695708000000 + }, + { + "inQuantity": 200, + "outQuantity": 200, + "okQuantity": 199, + "nokQuantity": 1, + "recordTime": 1695711600000, + "startTime": 1695711600000 + } + ] } } From 20808c09755a549ec24487d0d18e8d608beac537 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 26 Sep 2023 17:00:46 +0800 Subject: [PATCH 05/12] =?UTF-8?q?update=20=E4=BA=A7=E9=87=8F=E6=97=B6?= =?UTF-8?q?=E5=BA=8F=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipment/timing-diagram/output/index.vue | 141 ++++++++++++------ .../timing-diagram/output/response.json | 36 +++++ 2 files changed, 132 insertions(+), 45 deletions(-) diff --git a/src/views/equipment/timing-diagram/output/index.vue b/src/views/equipment/timing-diagram/output/index.vue index 51507a1b..fb1eb722 100644 --- a/src/views/equipment/timing-diagram/output/index.vue +++ b/src/views/equipment/timing-diagram/output/index.vue @@ -8,7 +8,7 @@