瀏覽代碼

导出按钮的实现

mushencc 3 年之前
父節點
當前提交
661e941793

+ 1 - 2
src/views/BasicSettings/AdditionalProject/index.vue

@@ -141,7 +141,6 @@ export default {
           ...row
         }
       }).then(res => {
-        console.log(res)
         if (res.code == 200) {
           this.total = res.data.total
           this.tableData = res.data.data
@@ -219,7 +218,7 @@ export default {
       this.$Message.error(err.msg || '上传失败')
     },
     async exportData () {
-      const res = await this.axios('/api/parts_classify_export', { params: { ...this.proxyObj } })
+      const res = await this.axios('/api/project_ext_export')
       if (res.code == 200) {
         let url = `${this.$store.state.ip}/api/storage/${res.data.file}`
         location.href = url

+ 12 - 1
src/views/BasicSettings/CustomerFiles/list.vue

@@ -18,13 +18,17 @@
           <Button type="success" ghost icon="md-exit" style="margin-right:10px;"
             >导入</Button
           >
+         
         </Upload>
+        <Button type="success" ghost icon='ios-download-outline' style="margin-right:10px;" @click='exportData()'
+            >导出</Button
+          >
         <Button
           type="primary"
           @click="handleGoPage(1, '')"
           style="margin-right:10px;"
           >新增</Button
-        >
+        > 
       </slot>
     </Toptitle>
     <div class="content">
@@ -489,6 +493,13 @@ export default {
       });
       // }
     },
+     async exportData(){
+            const res = await this.axios('/api/custom_export')
+           if(res.code == 200){
+                let url = `${this.$store.state.ip}/api/storage/${res.data.file}`
+                location.href = url
+            }
+        },
   },
   // 监听属性 类似于data概念
   computed: {},

+ 12 - 2
src/views/BasicSettings/EmployeeManage/EmployeeManage.vue

@@ -19,7 +19,9 @@
       <div class="content_right">
         <div class="content_right_topform">
           <Form :label-width="90"
-                :model="searchData">
+                :model="searchData"
+                style="display:flex;justify-content:space-between;">
+                <div>
             <FormItem label="员工姓名:">
               <Input type="text"
                      size="small"
@@ -40,7 +42,8 @@
                         :label="item.label"
                         :value="item.value" />
               </Select>
-            </FormItem>
+            </FormItem></div>
+            <Button @click="exportData()" type="primary" style="margin-right: 10px">批量导出</Button>
           </Form>
           <div class="content_right_topfrom_btn">
             <Button type="primary"
@@ -281,6 +284,13 @@ export default {
     this.initData(this.searchData)
   },
   methods: {
+    async exportData(){
+            const res = await this.axios('/api/employee_export')
+           if(res.code == 200){
+                let url = `${this.$store.state.ip}/api/storage/${res.data.file}`
+                location.href = url
+            }
+        },
     initData (row) {
       this.tableLoading = true
       this.axios({

+ 9 - 1
src/views/BasicSettings/OverStandardPrice/list.vue

@@ -12,12 +12,13 @@
               :page_index='page_index'
               :total='total'>
       <div slot='titleButton'>
+      <Button @click="exportData()" type="primary" style="margin-right: 10px">批量导出</Button>
         <Button @click="handleSet('',-1,1)"
                 type='primary'
                 style="margin-right:10px;">新增方案</Button>
       </div>
       <template slot='set'
-                slot-scope='{row,index}'>
+                slot-scope='{row,index}'>    
         <div class="table-set">
           <a style="margin:0 5px"
              @click="handleSet(row,index,2)">编辑</a>
@@ -71,6 +72,13 @@ export default {
 
   },
   methods: {
+    async exportData(){
+            const res = await this.axios('/api/overdraft_export')
+           if(res.code == 200){
+                let url = `${this.$store.state.ip}/api/storage/${res.data.file}`
+                location.href = url
+            }
+        },
     init (row) {
       this.proxyObj = row
       this.axios.get('/api/overdraft_list', {

+ 8 - 0
src/views/BasicSettings/SuppliersManage/SippliersList.vue

@@ -6,6 +6,7 @@
                 type="primary"
                 style="margin-right:10px;">新增分类</Button> -->
         <Button type="primary" style="margin-right: 10px">导入</Button>
+        <Button @click="exportData()" type="primary" style="margin-right: 10px">导出</Button>
         <Button
           type="primary"
           @click="handleGoPage(1, '')"
@@ -366,6 +367,13 @@ export default {
         });
       }
     },
+    async exportData(){
+            const res = await this.axios('/api/supply_export')
+           if(res.code == 200){
+                let url = `${this.$store.state.ip}/api/storage/${res.data.file}`
+                location.href = url
+            }
+        }
   },
   // 监听属性 类似于data概念
   computed: {},

+ 9 - 1
src/views/BasicSettings/SuppliersManage/SippliersStockPriceList.vue

@@ -59,6 +59,7 @@
         <div class="content_body_btn">
           <Button type="primary"
                   style="margin-right:10px;">导入</Button>
+           <Button @click="exportData()" type="primary" style="margin-right: 10px">导出</Button>
           <Button type="primary"
                   @click="handleSet(1,'')">新增</Button>
         </div>
@@ -234,7 +235,14 @@ export default {
     changePage (e) {
       this.pageIndex = e;
       this.initData()
-    }
+    },
+     async exportData(){
+            const res = await this.axios('/api/supply_material_export')
+           if(res.code == 200){
+                let url = `${this.$store.state.ip}/api/storage/${res.data.file}`
+                location.href = url
+            }
+        }
   },
   // 监听属性 类似于data概念
   computed: {},