From f846046d8d266d8c636f2cb1182193b503bfe9d4 Mon Sep 17 00:00:00 2001 From: zxx <47968546@163.com> Date: Tue, 31 Oct 2023 11:49:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Middle/Mold/Touch/Reporting.vue | 311 +++++++++++++++++++--- 1 file changed, 281 insertions(+), 30 deletions(-) diff --git a/src/pages/Middle/Mold/Touch/Reporting.vue b/src/pages/Middle/Mold/Touch/Reporting.vue index b050185..4d503b9 100644 --- a/src/pages/Middle/Mold/Touch/Reporting.vue +++ b/src/pages/Middle/Mold/Touch/Reporting.vue @@ -16,7 +16,13 @@
-

【部件】{{ item.component_detail ? item.component_detail.name : '' }}

+

【部件】{{ item.component_detail ? item.component_detail.name : '' }} +
+ + +
+

@@ -46,12 +52,7 @@
-
- - -
+
@@ -66,7 +67,13 @@
-

【部件】{{ ditem.component_detail ? ditem.component_detail.name : '' }}

+

【部件】{{ ditem.component_detail ? ditem.component_detail.name : '' }} +
+ + +
+

@@ -103,12 +110,7 @@
-
- - -
@@ -198,6 +200,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -241,6 +291,7 @@ import BASE_URL from '@/services/mes/api.js'; import XEUtils from 'xe-utils' // 加载xe-utils import JSONbig from 'json-bigint' +import { ref } from 'vue'; export default { name: '', @@ -302,9 +353,51 @@ export default { detailsData4: [], //按部件分组 + detailDataProgress: [], // 工序部门列表 + + + processesDepartmentId: 0, // 按部门id筛选 + department_list: [], // 部门列表 + // department_list_options 默认值为全部 + department_list_options_default: ref("0"), + department_list_options: [ + { + label: "全部部门", + value: "0", + } + ], // 部门列表下拉框 + + processesIsComplete: 0, // 按是否完成筛选 + IsCompleteDefault: ref("0"), + IsCompleteOptions: [ + { + label: "未完成", + value: "0", + }, + { + label: "已完成", + value: "1", + } + ], // 是否完成下拉框 + + + processesIsSend: 0, // 按是否已发料筛选 + IsSendDefault: ref("0"), + IsSendOptions: [ + { + label: "未发料", + value: "0", + }, + { + label: "已发料", + value: "1", + } + ], // 是否完成下拉框 + poData: [], tips: ["点一", "点二", "点三"], current_mold_production_order_component_processes: [], + current_mold_production_order_component: [], formOptions2: { data: { }, @@ -479,6 +572,8 @@ export default { this.$refs.inputx.focus(); this.loadPoData(); + this.loadDataProgress(185208273404694528, 0); + this.loadDeaprtmentData(); }, 200) //149433255169363968 @@ -496,10 +591,12 @@ export default { if (this.tabKey == '2') { this.loadPoData(); } + if (this.tabKey == '3') { + this.loadDataProgress(0, 0); + this.loadDeaprtmentData(); + } }, loadPoData() { - - this.$mk.post({ url: `${BASE_URL.BASE_URL}/MoldProductionOrder/Get/TouchScreen/v1/mold/production/order/touchScreen/order/list`, loading: "搜索中...", @@ -524,12 +621,53 @@ export default { console.log(this.poData) }); }, + + loadDeaprtmentData() { + this.$mk.post({ + url: `${BASE_URL.BASE_URL}/BaseDepartment/v1/base/department/list`, + loading: "加载中...", + data: { + "ptyid": 0, + "company_id": parseInt(process.env.VUE_APP_COMPANY_ID), + "search_rules": [ + ], + "end_time": 0, + "company_token": process.env.VUE_APP_COMPANYTOKEN, + "store_id": 0, + "order_bys": [], + "limit": 0, + "project_token": process.env.VUE_APP_APPTOKEN, + "beid": parseInt(process.env.VUE_APP_BEID), + "page": 1, + "start_time": 0 + }, + useBigInt: true, + }).then(a => { + this.department_list = JSON.parse(JSON.stringify(a.data.BaseDepartment)); + // 将department_list 中的name值赋值给department_list_options + this.department_list_options = this.department_list.map(item => { + return { + value: item.id, + label: item.name + } + }) + // 将department_list_options 前面加上全部 + this.department_list_options.unshift({ + label: "全部部门", + value: "0", + }) + + }); + }, selectPoInfo(row) { this.loadProductionOrder({ id: row.id }) }, - loadData({ key }) { + selectPoProgressInfo(row) { + this.loadProductionOrder({ id: row.production_id }) + }, + loadData({ key }) { this.loading = true this.$mk.post({ url: `${BASE_URL.BASE_URL}/MoldProductionOrder/Get/TouchScreen/v1/mold/production/order/touchScreen/search`, @@ -555,13 +693,9 @@ export default { }).then(a => { this.loading = false this.tableDataOrders = JSON.parse(JSON.stringify(a.data.mold_production_order || [])); - - if (this.tableDataOrders.length) { this.loadProductionOrder({ id: this.tableDataOrders[0].id }); } - - }).catch((a) => { this.loading = false this.$mk.error(a.data.msg); @@ -569,6 +703,86 @@ export default { }, + loadDataProgress() { + + // 定义 search_rules + let search_rules = [ + ] + if (this.processesDepartmentId > 0) { + // 有部门id search_rules 条件加上 department_id + search_rules.push({ + "column": "department_id", + "mode": "=", + "value": this.processesDepartmentId + }) + } + if (this.processesIsComplete > 0) { + // 没有部门id search_rules 条件加上 is_complete 默认为0 + search_rules.push({ + "column": "is_complete", + "mode": "=", + "value": this.processesIsComplete + }) + } else { + search_rules.push({ + "column": "is_complete", + "mode": "=", + "value": "0", + }) + } + if (this.processesIsSend > 0) { + // 没有部门id search_rules 条件加上 is_complete 默认为0 + search_rules.push({ + "column": "is_send", + "mode": "=", + "value": this.processesIsSend + }) + } else { + search_rules.push({ + "column": "is_send", + "mode": "=", + "value": "0" + }) + } + this.loading = true + this.$mk.post({ + url: `${BASE_URL.BASE_URL}/MoldProductionOrder/Get/TouchScreen/v1/mold/production/order/touchScreen/processes/list`, + loading: "查询中...", + data: { + "beid": parseInt(process.env.VUE_APP_BEID), + "ptyid": 0, + "company_id": parseInt(process.env.VUE_APP_COMPANY_ID), + "store_id": 0, + "project_token": process.env.VUE_APP_APPTOKEN, + "company_token": process.env.VUE_APP_COMPANYTOKEN, + "search_rules": search_rules, + "order_bys": [ + ], + "page": 1, + "limit": 200, + "start_time": 0, + "end_time": 0 + }, + useBigInt: true, + }).then(a => { + this.loading = false + this.detailDataProgress = JSON.parse(JSON.stringify(a.data.mold_production_order_touch_screen_processes || [])); + + this.detailDataProgress.forEach(item => { + + item.department_name = item.department_detail.name + item.production_code = item.production_detail.code + item.process_name = item.process_detail.name + }) + + // this.detailDataProgress 中将 production_code 等于 "" 的数据删除 + this.detailDataProgress = this.detailDataProgress.filter(item => item.production_code != "") + }).catch((a) => { + this.loading = false + this.$mk.error(a.data.msg); + }); + }, + keydownEvent(e) { let event = e.$event; const input = event.target; @@ -721,8 +935,16 @@ export default { if (item.department_id.toString() == id.toString()) { ds.push(item); + } + this.current_mold_production_order_component.forEach(item1 => { + if (item.component_line == item1.component_line) { + item.component_img = item1.component_img; + } + }) }) + + this.detailsData = ds; } @@ -732,14 +954,16 @@ export default { else if (code) { - - - this.current_mold_production_order_component_processes.forEach(item => { // 循环所有的 // 如果当前的部门编码等于输入的部门编码 if (item.department_detail && item.department_detail.code == code) { ds.push(item); } + this.current_mold_production_order_component.forEach(item1 => { + if (item.component_line == item1.component_line) { + item.component_img = item1.component_img; + } + }) }) this.detailsData = ds; @@ -769,7 +993,7 @@ export default { let ds3 = JSON.parse(JSON.stringify(row.department_progress || [])); let ds4 = JSON.parse(JSON.stringify(row.mold_production_order_component || [])); - + this.current_mold_production_order_component = JSON.parse(JSON.stringify(row.mold_production_order_component || [])); ds3.forEach(item => { item.progressList = []; @@ -955,6 +1179,22 @@ export default { return progress; }, + DepartmentChange(e) { + this.processesDepartmentId = e + this.department_list_options_default = ref(e) + this.loadDataProgress() + }, + IsCompleteChange(e) { + this.processesIsComplete = e + this.IsCompleteDefault = ref(e) + this.loadDataProgress() + }, + IsSendChange(e) { + this.processesIsSend = e + this.IsSendDefault = ref(e) + this.loadDataProgress() + } + }, // 监听属性 @@ -1003,10 +1243,12 @@ export default { padding: 10px; width: 100px; - img { - width: 80px; - height: 80px; - } + +} + +.imagePanel img { + width: 80px; + height: 80px; } .oplinks2 svg { @@ -1109,11 +1351,20 @@ export default { top: 15px; } +.card-item h3 { + position: relative; + padding-bottom: 10px; + margin: 0; + height: 60px; + line-height: 60px; +} + .card-item-progress-img { position: absolute; - right: 5px; - bottom: 15px; + right: 65px; + top: 10px; + line-height: 0px; } .bottom-toast {