From 0f7b7f1a8e1b72c04d8a32858dea5e40b7f67c9b Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期六, 22 六月 2024 19:23:15 +0800
Subject: [PATCH] 导出

---
 src/views/mdc/processParam/index.vue  |  106 +++++++++++++-------------
 src/views/mdc/alarm-statistics.vue    |   31 ++++++-
 src/views/mdc/output-statistics.vue   |   26 +++++-
 src/views/mdc/efficiency-analysis.vue |   26 +++++-
 src/views/dnc/document/index.vue      |    4 
 5 files changed, 126 insertions(+), 67 deletions(-)

diff --git a/src/views/dnc/document/index.vue b/src/views/dnc/document/index.vue
index a88a9d7..e94c58c 100644
--- a/src/views/dnc/document/index.vue
+++ b/src/views/dnc/document/index.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2024-05-16 22:40:01
  * @LastEditors: Sneed
- * @LastEditTime: 2024-06-18 21:51:57
+ * @LastEditTime: 2024-06-22 18:08:04
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/document/index.vue
 -->
 <template>
@@ -309,7 +309,7 @@
                         }
                     }]).then(res => {
                         if (res.success) {
-                            this.visible = false
+                            this.visible1 = false
                             this.search()
                         } else {
                             this.$message.error(res.msg)
diff --git a/src/views/mdc/alarm-statistics.vue b/src/views/mdc/alarm-statistics.vue
index 2993ed3..9ada019 100644
--- a/src/views/mdc/alarm-statistics.vue
+++ b/src/views/mdc/alarm-statistics.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2024-04-09 22:11:21
  * @LastEditors: Sneed
- * @LastEditTime: 2024-06-20 23:54:23
+ * @LastEditTime: 2024-06-22 18:50:49
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/alarm-statistics.vue
  * 鏁堢巼鍒嗘瀽
 -->
@@ -26,7 +26,8 @@
                         </el-main>
                         <el-footer>
                             <el-button type="primary" @click="query()">鏌ヨ</el-button>
-                            <el-button @click="exportExcel">瀵煎嚭</el-button>
+                            <!-- <el-button @click="exportExcel">瀵煎嚭</el-button> -->
+                            <exportDialog ref="export" @export="exportExcel"></exportDialog>
                         </el-footer>
                     </el-container>
                 </el-aside>
@@ -55,12 +56,13 @@
 import MYTree from './MYTree.vue'
 import Shift from './components/ShiftAlarm.vue'
 import Time from './components/TimeAlarm.vue'
-
+import exportDialog from '@/layout/components/exportDialog.vue'
 export default {
     components: {
         MYTree,
         Shift,
-        Time
+        Time,
+        exportDialog
     },
     watch: {
         activeName() {
@@ -100,8 +102,27 @@
         // })
     },
     methods: {
+        exportExcel(statisticalMethod) {
+            let { start, end } = this.$refs.export.format(this.time[0], this.time[1], statisticalMethod)
+            this.$HTTP.post(`/api/blade-mdc/alarm/export-alarm`, {
+                startTime: start,
+                endTime: end,
+                enums: statisticalMethod,
+                month: 0,
+                queryTime: '',
+                shiftIndex: 1,
+                week: 0,
+                year: 0,
+                workstationId: this.treeChecked.toString()
+            }).then(res => {
+                if (res.success) {
+                    window.open(res.data.link)
+                } else {
+                    this.$message.error(res.msg)
+                }
+            })
+        },
         query(firstWorkKey) {
-            console.log('------')
             let workstationId = firstWorkKey ? [firstWorkKey] : [...this.treeChecked]
             this.$nextTick(() => {
                 this.$refs[this.activeName].init({
diff --git a/src/views/mdc/efficiency-analysis.vue b/src/views/mdc/efficiency-analysis.vue
index b489b88..7d0e50e 100644
--- a/src/views/mdc/efficiency-analysis.vue
+++ b/src/views/mdc/efficiency-analysis.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2024-04-09 22:11:21
  * @LastEditors: Sneed
- * @LastEditTime: 2024-06-20 23:53:51
+ * @LastEditTime: 2024-06-22 18:34:40
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/efficiency-analysis.vue
  * 鏁堢巼鍒嗘瀽
 -->
@@ -33,7 +33,8 @@
                         </el-main>
                         <el-footer>
                             <el-button type="primary" @click="query">鏌ヨ</el-button>
-                            <el-button @click="exportExcel">瀵煎嚭</el-button>
+                            <!-- <el-button @click="exportExcel">瀵煎嚭</el-button> -->
+                            <exportDialog @export="exportExcel"></exportDialog>
                         </el-footer>
                     </el-container>
                 </el-aside>
@@ -59,12 +60,13 @@
 import MYTree from './MYTree.vue'
 import Shift from './components/Shift.vue'
 import Time from './components/Time.vue'
-
+import exportDialog from '@/layout/components/exportDialog.vue'
 export default {
     components: {
         MYTree,
         Shift,
-        Time
+        Time,
+        exportDialog
     },
     watch: {
         activeName() {
@@ -188,6 +190,22 @@
         this.query()
     },
     methods: {
+        exportExcel(statisticalMethod) {
+            this.$HTTP.post(`/api/blade-mdc/efficiency-analysis/export`, {
+                startDate: this.time[0],
+                endDate: this.time[1],
+                statisticalMethod,
+                productivityType: this.productivityType,
+                shiftIndexList: [1, 2],
+                workStationIdList: this.treeChecked
+            }).then(res => {
+                if (res.success) {
+                    window.open(res.data.link)
+                } else {
+                    this.$message.error(res.msg)
+                }
+            })
+        },
         query() {
             this.$refs[this.activeName].init({
                 endDate: this.time[1],
diff --git a/src/views/mdc/output-statistics.vue b/src/views/mdc/output-statistics.vue
index b4cd903..4f18459 100644
--- a/src/views/mdc/output-statistics.vue
+++ b/src/views/mdc/output-statistics.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2024-04-09 22:11:21
  * @LastEditors: Sneed
- * @LastEditTime: 2024-06-20 23:54:27
+ * @LastEditTime: 2024-06-22 18:35:47
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/output-statistics.vue
  * 鏁堢巼鍒嗘瀽
 -->
@@ -26,7 +26,8 @@
                         </el-main>
                         <el-footer>
                             <el-button type="primary" @click="query">鏌ヨ</el-button>
-                            <el-button @click="exportExcel">瀵煎嚭</el-button>
+                            <!-- <el-button @click="exportExcel">瀵煎嚭</el-button> -->
+                            <exportDialog @export="exportExcel"></exportDialog>
                         </el-footer>
                     </el-container>
                 </el-aside>
@@ -58,12 +59,13 @@
 import MYTree from './MYTree.vue'
 import Shift from './components/Shift.vue'
 import Time from './components/Time.vue'
-
+import exportDialog from '@/layout/components/exportDialog.vue'
 export default {
     components: {
         MYTree,
         Shift,
-        Time
+        Time,
+        exportDialog
     },
     watch: {
         activeName() {
@@ -180,6 +182,22 @@
         this.query()
     },
     methods: {
+        exportExcel(statisticalMethod) {
+            this.$HTTP.post(`/api/blade-mdc/output/export`, {
+                startDate: this.time[0],
+                endDate: this.time[1],
+                statisticalMethod,
+                queryType: 1,
+                shiftIndexList: [1, 2],
+                workStationIdList: this.treeChecked
+            }).then(res => {
+                if (res.success) {
+                    window.open(res.data.link)
+                } else {
+                    this.$message.error(res.msg)
+                }
+            })
+        },
         query() {
             this.$refs[this.activeName].init({
                 endDate: this.time[1],
diff --git a/src/views/mdc/processParam/index.vue b/src/views/mdc/processParam/index.vue
index 118f469..b33e583 100644
--- a/src/views/mdc/processParam/index.vue
+++ b/src/views/mdc/processParam/index.vue
@@ -1,57 +1,7 @@
 <!--
- * ......................................&&.........................
- * ....................................&&&..........................
- * .................................&&&&............................
- * ...............................&&&&..............................
- * .............................&&&&&&..............................
- * ...........................&&&&&&....&&&..&&&&&&&&&&&&&&&........
- * ..................&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&..............
- * ................&...&&&&&&&&&&&&&&&&&&&&&&&&&&&&.................
- * .......................&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.........
- * ...................&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&...............
- * ..................&&&   &&&&&&&&&&&&&&&&&&&&&&&&&&&&&............
- * ...............&&&&&@  &&&&&&&&&&..&&&&&&&&&&&&&&&&&&&...........
- * ..............&&&&&&&&&&&&&&&.&&....&&&&&&&&&&&&&..&&&&&.........
- * ..........&&&&&&&&&&&&&&&&&&...&.....&&&&&&&&&&&&&...&&&&........
- * ........&&&&&&&&&&&&&&&&&&&.........&&&&&&&&&&&&&&&....&&&.......
- * .......&&&&&&&&.....................&&&&&&&&&&&&&&&&.....&&......
- * ........&&&&&.....................&&&&&&&&&&&&&&&&&&.............
- * ..........&...................&&&&&&&&&&&&&&&&&&&&&&&............
- * ................&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&............
- * ..................&&&&&&&&&&&&&&&&&&&&&&&&&&&&..&&&&&............
- * ..............&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&....&&&&&............
- * ...........&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&......&&&&............
- * .........&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.........&&&&............
- * .......&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&...........&&&&............
- * ......&&&&&&&&&&&&&&&&&&&...&&&&&&...............&&&.............
- * .....&&&&&&&&&&&&&&&&............................&&..............
- * ....&&&&&&&&&&&&&&&.................&&...........................
- * ...&&&&&&&&&&&&&&&.....................&&&&......................
- * ...&&&&&&&&&&.&&&........................&&&&&...................
- * ..&&&&&&&&&&&..&&..........................&&&&&&&...............
- * ..&&&&&&&&&&&&...&............&&&.....&&&&...&&&&&&&.............
- * ..&&&&&&&&&&&&&.................&&&.....&&&&&&&&&&&&&&...........
- * ..&&&&&&&&&&&&&&&&..............&&&&&&&&&&&&&&&&&&&&&&&&.........
- * ..&&.&&&&&&&&&&&&&&&&&.........&&&&&&&&&&&&&&&&&&&&&&&&&&&.......
- * ...&&..&&&&&&&&&&&&.........&&&&&&&&&&&&&&&&...&&&&&&&&&&&&......
- * ....&..&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&...........&&&&&&&&.....
- * .......&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&..............&&&&&&&....
- * .......&&&&&.&&&&&&&&&&&&&&&&&&..&&&&&&&&...&..........&&&&&&....
- * ........&&&.....&&&&&&&&&&&&&.....&&&&&&&&&&...........&..&&&&...
- * .......&&&........&&&.&&&&&&&&&.....&&&&&.................&&&&...
- * .......&&&...............&&&&&&&.......&&&&&&&&............&&&...
- * ........&&...................&&&&&&.........................&&&..
- * .........&.....................&&&&........................&&....
- * ...............................&&&.......................&&......
- * ................................&&......................&&.......
- * .................................&&..............................
- * ..................................&..............................
- -->
-
-<!--
  * @Date: 2024-04-09 22:11:21
  * @LastEditors: Sneed
- * @LastEditTime: 2024-04-26 21:23:30
+ * @LastEditTime: 2024-06-22 19:21:12
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/processParam/index.vue
  瀹炴椂鐪嬫澘
 -->
@@ -75,11 +25,14 @@
                             <el-col :span="4">
                                 <!-- <el-switch v-model="isShowTable" class="mb-2" active-text="鏁版嵁琛�" inactive-text="缁熻鍥�" /> -->
                             </el-col>
-                            <el-col :span="20" style='text-align: right;'>
+                            <el-col :span="18" style='text-align: right;'>
                                 <el-date-picker :max-range="3" :clearable="true" value-format="YYYY-MM-DD"
                                     style="width: 250px" v-model="time" type="daterange" range-separator="-"
                                     start-placeholder="" end-placeholder="" :disabled-date="disabledDate"
                                     @calendar-change="change" />
+                            </el-col>
+                            <el-col :span="2" style='text-align: right;'>
+                                <el-button type="primary" @click="exportExcel">瀵煎嚭</el-button>
                             </el-col>
                         </el-row>
                         <TimeLine v-model="timeRange" ref="timeLine"></TimeLine>
@@ -114,6 +67,19 @@
                 </div>
             </template>
         </el-drawer>
+        <scDialog v-model="visible">
+            <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">
+                鍏ㄩ��
+            </el-checkbox>
+            <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
+                <el-checkbox v-for="city in list" :key="city.id" :label="city.id" :value="city.id">
+                    {{ city.description }}
+                </el-checkbox>
+            </el-checkbox-group>
+            <template #footer>
+                <el-button type="primary" @click="save">纭畾</el-button>
+            </template>
+        </scDialog>
     </el-main>
 </template>
 
@@ -162,6 +128,10 @@
                 let min = moment(this.timeStart, 'YYYY-MM-DD').subtract(3, 'd').format('YYYY-MM-DD')
                 return !moment(Date).isBetween(min, max);
             },
+            visible: false,
+            checkAll: false,
+            isIndeterminate: false,
+            checkedCities: []
         }
     },
     created() {
@@ -169,6 +139,38 @@
         this.init()
     },
     methods: {
+        handleCheckAllChange(val) {
+            this.checkedCities = val ? this.list.map(v => v.id) : []
+            this.isIndeterminate = false
+        },
+        handleCheckedCitiesChange(value) {
+            console.log(value)
+            this.checkAll = value.length === this.list.length
+            this.isIndeterminate = value.length > 0 && value.length < this.list.length
+        },
+        save() {
+            console.log(this.checkedCities)
+            this.$HTTP.post(`/api/blade-mdc/process-parameter/excel/export`, {
+                collectItem: this.list.filter(v => this.checkedCities.includes(v.id)),
+                endTime: this.timeRange.endTime,
+                startTime: this.timeRange.startTime,
+                methodEnum: 'HOUR',
+                workstationId: this.treeChecked.toString(),
+                workstationName: ''
+            }).then(res => {
+                if (res.success) {
+                    window.open(res.data.link)
+                } else {
+                    this.$message.error(res.msg)
+                }
+            })
+        },
+        exportExcel() {
+            this.checkAll = false
+            this.isIndeterminate = false
+            this.checkedCities = []
+            this.visible = true
+        },
         init() {
             this.$HTTP.get('/api/blade-mdc/process-parameter').then(res => {
                 if (res.code === 200) {

--
Gitblit v1.9.3