whj il y a 2 ans
Parent
commit
ae3a6fccba
2 fichiers modifiés avec 62 ajouts et 22 suppressions
  1. 32 0
      src/api/report/instoredetail.js
  2. 30 22
      src/views/dashboard/InStoreStatistics.vue

+ 32 - 0
src/api/report/instoredetail.js

@@ -156,3 +156,35 @@ export function getOutStoreFormReport (parameter) {
     }
   })
 }
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function exportInSpareNum (parameter) {
+  return axios({
+    url: '/store/in-store-forms/inSpareNum/export?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
+}
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function exportOutSpareNum (parameter) {
+  return axios({
+    url: '/store/out-store-forms/outSpareNum/export?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
+}

+ 30 - 22
src/views/dashboard/InStoreStatistics.vue

@@ -42,13 +42,13 @@
                     tableLayout="auto"
                     :scroll="{x: 1, y: BaseTool.Constant.scrollY }"
                     rowKey="month">
-                    <!-- <span slot="action" slot-scope="record">
+                    <span slot="action" slot-scope="record">
                       <template>
-                        <a @click="handleView(record)">查看明细</a>
-                        <a-divider type="vertical" />
+                        <!-- <a @click="handleView(record)">查看明细</a> -->
+                        <!-- <a-divider type="vertical" /> -->
                         <a @click="doExportDetail(record)">导出</a>
                       </template>
-                    </span> -->
+                    </span>
                   </a-table>
                 </div>
               </a-col>
@@ -63,7 +63,7 @@
 </template>
 
 <script>
-import { getOutStoreFormReport, getInStoreFormReport } from '@/api/report/instoredetail'
+import { getOutStoreFormReport, getInStoreFormReport, exportOutSpareNum, exportInSpareNum } from '@/api/report/instoredetail'
 import { Chart } from '@antv/g2'
 import PrintInRepairReport from '@/views/dashboard/modules/PrintInRepairReport'
 // import DetailRepairReport from '@/views/dashboard/modules/DetailRepairReport'
@@ -116,14 +116,14 @@ export default {
           title: '数量',
           width: 120,
           dataIndex: 'num'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: 120,
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
         }
-        // {
-        //   title: '操作',
-        //   key: 'action',
-        //   width: '200px',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'action' }
-        // }
       ]
     }
   },
@@ -195,16 +195,24 @@ export default {
     //     this.BaseTool.UPLOAD.downLoadExportExcel(file)
     //   })
     // },
-    // doExportDetail (record) {
-    //   const parameter = {
-    //     ...this.queryParam,
-    //     month: record.month,
-    //     year: record.year
-    //   }
-    //   exportMonthReportBig24Month(parameter).then(file => {
-    //     this.BaseTool.UPLOAD.downLoadExportExcel(file)
-    //   })
-    // },
+    doExportDetail (record) {
+      console.log(record)
+      const parameter = {
+        startMonth: record.month,
+        year: record.year
+      }
+      if (this.searchType === 1) {
+        exportInSpareNum(parameter)
+          .then(file => {
+            this.BaseTool.UPLOAD.downLoadExportExcel(file)
+          })
+      } else {
+        exportOutSpareNum(parameter)
+          .then(file => {
+            this.BaseTool.UPLOAD.downLoadExportExcel(file)
+          })
+      }
+    },
     handlePrint (record) {
       const modal = this.$refs.basePrintModal
       this.visible = false