snow 1 年之前
父節點
當前提交
d85f0d854b

文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/0.js


+ 2 - 2
src/config/env.development.js

@@ -3,7 +3,7 @@ module.exports = {
   title: '采销平台',
   baseUrl: 'http://wx.wxhr.sit.futurelab.tv',
   api: {
-    baseApi: 'http://stocknew.test241.wanyuhengtong.com/'
+    baseApi: 'http://stock.api.caixiao365.com/'
     // baseApi: 'http://stockwm.test241.wanyuhengtong.com/'
   },
   webUrl: 'http://project.web.caixiao365.com/#/test-good-share?id=',
@@ -21,7 +21,7 @@ module.exports = {
   // 结算平台url
   // settlementPlatformUrl: 'http://127.0.0.1:8848',
   // 结算平台url
-  settlementPlatformUrl: 'http://webcx.test241.wanyuhengtong.com/',
+  settlementPlatformUrl: 'http://fin.caixiao365.com/',
   // token加密key
   secretKey: 'key123',
   loginTitle: '',

+ 5 - 1
src/views/businessReportQuery/businessSaleReport/components/table24.vue

@@ -173,7 +173,11 @@ export default {
       })
       if (code === 0) {
         // const { list, count } = data;
-        this.tableData = data
+        const list = Object.keys(data).reduce((prev, currentKey) => ([...prev, data[currentKey]]), [])
+        const totalItem = list.shift()
+        list.push(totalItem)
+        console.log(list)
+        this.tableData = list
       } else if (code >= 100 && code <= 104) {
         await this.logout()
       } else {

+ 177 - 180
src/views/reportQuery/purchaseReport/components/table8.vue

@@ -1,68 +1,68 @@
 <template>
-    <div>
-      <ex-table
-        v-loading="loading"
-        :table="table"
-        :data="tableData"
-        :columns="table8"
-        :page="pageInfo"
-        :size="size"
-        @page-curr-change="handlePageChange"
-        @page-size-change="handleSizeChange"
-        @screen-reset="
-          pageInfo.curr = 1;
-          parmValue.page = 1;
-          searchList();
-        "
-        @screen-submit="
-          pageInfo.curr = 1;
-          parmValue.page = 1;
-          searchList();
-        "
-        @selection="selection_change"
-      >
-        <template #table-header="{}">
-          <div style="width: 100%">
-            <el-row style="padding: 0 0 0 80px">
-             
-               <el-col :span="6" style="width: 363px;">
-                <periodDatePickerActive
-                      :start="parmValue.start_date"
-                      :end="parmValue.end_date"
-                      :placeholder="'创建'"
-                      :width="'165px'"
-                      :size="searchSize"
-                      @timeReturned="time"
-                    />
-              </el-col>  
-              <el-col :span="4" style="width: 66px; float: right">       
-                <el-button type="primary" style="margin-left:30px;" @click="download" :size="searchSize"  class="fr">
-                    导出
-                </el-button>
-              </el-col>
-              <el-col :span="3" style="width: 66px; float: right">
-                <el-button
-                  :size="searchSize"
-                  type="primary"
-                  style="float: right; margin-left: 5px"
-                  @click="searchList"
-                >
-                  刷新
-                </el-button>
-              </el-col>
-              <el-col :span="4" style="width: 66px; float: right">
-                <el-button
-                  type="warning"
-                  class="fr"
-                  :size="searchSize"
-                  @click="restSearch"
-                >
-                  重置
-                </el-button>
-              </el-col>  
-            </el-row>
-            <!-- <el-row style="padding: 10px 0 0 0">
-              
+  <div>
+    <ex-table
+      v-loading="loading"
+      :table="table"
+      :data="tableData"
+      :columns="table8"
+      :page="pageInfo"
+      :size="size"
+      @page-curr-change="handlePageChange"
+      @page-size-change="handleSizeChange"
+      @screen-reset="
+        pageInfo.curr = 1;
+        parmValue.page = 1;
+        searchList();
+      "
+      @screen-submit="
+        pageInfo.curr = 1;
+        parmValue.page = 1;
+        searchList();
+      "
+      @selection="selection_change"
+    >
+      <template #table-header="{}">
+        <div style="width: 100%">
+          <el-row style="padding: 0 0 0 80px">
+
+            <el-col :span="6" style="width: 363px;">
+              <periodDatePickerActive
+                :start="parmValue.start_date"
+                :end="parmValue.end_date"
+                :placeholder="'创建'"
+                :width="'165px'"
+                :size="searchSize"
+                @timeReturned="time"
+              />
+            </el-col>
+            <el-col :span="4" style="width: 66px; float: right">
+              <el-button type="primary" style="margin-left:30px;" :size="searchSize" class="fr" @click="download">
+                导出
+              </el-button>
+            </el-col>
+            <el-col :span="3" style="width: 66px; float: right">
+              <el-button
+                :size="searchSize"
+                type="primary"
+                style="float: right; margin-left: 5px"
+                @click="searchList"
+              >
+                刷新
+              </el-button>
+            </el-col>
+            <el-col :span="4" style="width: 66px; float: right">
+              <el-button
+                type="warning"
+                class="fr"
+                :size="searchSize"
+                @click="restSearch"
+              >
+                重置
+              </el-button>
+            </el-col>
+          </el-row>
+          <!-- <el-row style="padding: 10px 0 0 0">
+
               <el-col :span="6" style="width: 363px;">
                 <periodDatePickerActive
                       :start="parmValue.start_date"
@@ -72,8 +72,8 @@
                       :size="searchSize"
                       @timeReturned="time"
                     />
-              </el-col>  
-              <el-col :span="4" style="width: 66px; float: right">       
+              </el-col>
+              <el-col :span="4" style="width: 66px; float: right">
                 <el-button type="primary" style="margin-left:30px;" @click="download" :size="searchSize"  class="fr">
                     导出
                 </el-button>
@@ -97,53 +97,51 @@
                 >
                   重置
                 </el-button>
-              </el-col>     
+              </el-col>
             </el-row> -->
-          </div>
-       </template>
+        </div>
+      </template>
 
-        
-      </ex-table>
-    </div>
+    </ex-table>
+  </div>
 
-  
 </template>
-   <script>
-import mixinPage from "@/mixins/elPaginationHandle";
-import resToken from "@/mixins/resToken";
-import urlConfig from "@/apis/url-config";
-import asyncRequest from "@/apis/service/reportQuery/purchaseReport";
-import periodDatePickerActive from "../period-date-picker/main.vue";
-import { table8} from "./columns";
-import { mapGetters } from "vuex";
+<script>
+import mixinPage from '@/mixins/elPaginationHandle'
+import resToken from '@/mixins/resToken'
+import urlConfig from '@/apis/url-config'
+import asyncRequest from '@/apis/service/reportQuery/purchaseReport'
+import periodDatePickerActive from '../period-date-picker/main.vue'
+import { table8 } from './columns'
+import { mapGetters } from 'vuex'
 
 export default {
-  name: "purchaseOrder",
-  mixins: [mixinPage, resToken],
+  name: 'PurchaseOrder',
   components: {
     periodDatePickerActive
   },
+  mixins: [mixinPage, resToken],
   computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
-    
+    ...mapGetters(['tablebtnSize', 'searchSize', 'size'])
+
   },
   data() {
     return {
-      //选中数组
+      // 选中数组
       changeList: [],
-      //全局url
+      // 全局url
       fileUrl: urlConfig.baseURL,
-      //loading
+      // loading
       loading: false,
-      //请求参数集合
+      // 请求参数集合
       parmValue: {
-        
-        start_date: "", //起始时间
-        end_date: "", // 结束时间
+
+        start_date: '', // 起始时间
+        end_date: '', // 结束时间
 
         page: 1, // 页码
-        size: 15, // 每页显示条数
-       
+        size: 15 // 每页显示条数
+
       },
       // 表格 - 数据集合
       tableData: [],
@@ -151,162 +149,161 @@ export default {
       table: {
         stripe: true,
         border: true,
-        _defaultHeader_: ["setcol"],
+        _defaultHeader_: ['setcol']
       },
       // 表格 - 分页
       pageInfo: {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       },
       // 表格表头 - 列参数
-      table8: table8,
-    };
+      table8: table8
+    }
   },
   mounted() {
-
-    this.searchList();
+    this.searchList()
   },
 
   methods: {
-    //初始化http请求
+    // 初始化http请求
     async searchList() {
       if (
-        (this.parmValue.start_date !== "" && this.parmValue.end_date === "") ||
-        (this.parmValue.start_date === "" && this.parmValue.end_date !== "")
+        (this.parmValue.start_date !== '' && this.parmValue.end_date === '') ||
+        (this.parmValue.start_date === '' && this.parmValue.end_date !== '')
       ) {
-        this.$message.warning("时间区间不完整!");
-        return;
+        this.$message.warning('时间区间不完整!')
+        return
       }
       // return;
-      this.loading = true;
-      
-      const res = await asyncRequest.reportorderreturnlist(this.parmValue);
+      this.loading = true
+
+      const res = await asyncRequest.reportorderreturnlist(this.parmValue)
       if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list;
-        this.pageInfo.total = Number(res.data.count);
+        this.tableData = res.data.list
+        this.pageInfo.total = Number(res.data.count)
       } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
+        await this.logout()
       } else {
         this.$message.warning(res.message)
-        this.tableData = [];
-        this.pageInfo.total = 0;
+        this.tableData = []
+        this.pageInfo.total = 0
       }
-      this.loading = false;
+      this.loading = false
     },
-   
-    //重置
+
+    // 重置
     restSearch() {
       this.parmValue = {
-        start_date: "", //新建起始时间
-        end_date: "", // 新建结束时间
+        start_date: '', // 新建起始时间
+        end_date: '', // 新建结束时间
         page: 1, // 页码
-        size: 15, // 每页显示条数
-      };
+        size: 15 // 每页显示条数
+      }
       // 表格 - 分页
       this.pageInfo = {
         size: 15,
         curr: 1,
-        total: 0,
-      };
-      this.searchList();
+        total: 0
+      }
+      this.searchList()
     },
-    
+
     // 时间函数
     async time(e) {
-      this.parmValue.start_date = e.startTime || "";
-      this.parmValue.end_date = e.endTime || "";
+      this.parmValue.start_date = e.startTime || ''
+      this.parmValue.end_date = e.endTime || ''
       if (
-        (this.parmValue.start_date !== "" && this.parmValue.end_date === "") ||
-        (this.parmValue.start_date === "" && this.parmValue.end_date !== "")
+        (this.parmValue.start_date !== '' && this.parmValue.end_date === '') ||
+        (this.parmValue.start_date === '' && this.parmValue.end_date !== '')
       ) {
-        this.$message.warning("时间区间不完整!");
-        return;
+        this.$message.warning('时间区间不完整!')
+        return
       }
-      this.pageInfo.curr = 1;
-      this.parmValue.page = 1;
-      await this.searchList();
+      this.pageInfo.curr = 1
+      this.parmValue.page = 1
+      await this.searchList()
     },
 
-     //选中触发函数
+    // 选中触发函数
     selection_change(e) {
-      const { list } = e;
-      //选中的数组集合
-      this.changeList = list.length > 0 ? JSON.parse(JSON.stringify(list)) : [];
+      const { list } = e
+      // 选中的数组集合
+      this.changeList = list.length > 0 ? JSON.parse(JSON.stringify(list)) : []
     },
-     //导出文件 
+    // 导出文件
     async download() {
-      let start_date = new Date(this.parmValue.start_date).valueOf();
-      let end_date = new Date(this.parmValue.end_date).valueOf();
-      let flag = end_date - start_date > 30 * 24 * 60 * 60 * 1000;
-      if(this.parmValue.start_date != "" && this.parmValue.end_date != ""){
-        if(flag){
-          this.$message.warning("导出文件的时间区间不能超过30天")
-          return;
+      const start_date = new Date(this.parmValue.start_date).valueOf()
+      const end_date = new Date(this.parmValue.end_date).valueOf()
+      const flag = end_date - start_date > 30 * 24 * 60 * 60 * 1000
+      if (this.parmValue.start_date != '' && this.parmValue.end_date != '') {
+        if (flag) {
+          this.$message.warning('导出文件的时间区间不能超过30天')
+          return
         }
-      }else{
-        this.$message.warning("请选择导出文件的时间区间")
-        return;
+      } else {
+        this.$message.warning('请选择导出文件的时间区间')
+        return
       }
-      let model = JSON.parse(JSON.stringify(this.parmValue))
+      const model = JSON.parse(JSON.stringify(this.parmValue))
       // model.is_export = 1;
       if (!this.loading) {
-        this.loading = true;
-        let httpType = `aplication/zip`;
+        this.loading = true
+        const httpType = `aplication/zip`
         axios({
-          method: "post",
-          url: this.fileUrl + "admin/reportorderreturnlist",
-          responseType: "blob",
+          method: 'post',
+          url: this.fileUrl + 'admin/reportorderreturnlistexport',
+          responseType: 'blob',
           data: model,
           headers: {
             // 'Content-Type': 'multipart/form-data',
             // Accept: "application/vnd.ms-excel"
-            Accept: httpType,
-          },
+            Accept: httpType
+          }
         })
           .then((res) => {
             // console.log(res)
             // console.log(this.fileUrl)
             // return;
             if (res && res.status == 200 && res.data) {
-              let url = window.URL.createObjectURL(
+              const url = window.URL.createObjectURL(
                 new Blob([res.data], {
                   // type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8",
                   type: httpType
                 })
-              );
-              let link = document.createElement("a");
-              link.style.display = "none";
-              link.href = url;
-              let excelName = "售后明细报表.zip";
-              link.setAttribute("download", excelName);
-              document.body.appendChild(link);
-              link.click();
-              link.remove();
-              window.URL.revokeObjectURL(url); //释放掉blob对象
-              this.$message.success(`导出成功!`);
+              )
+              const link = document.createElement('a')
+              link.style.display = 'none'
+              link.href = url
+              const excelName = '售后明细报表.zip'
+              link.setAttribute('download', excelName)
+              document.body.appendChild(link)
+              link.click()
+              link.remove()
+              window.URL.revokeObjectURL(url) // 释放掉blob对象
+              this.$message.success(`导出成功!`)
               setTimeout(() => {
-                this.loading = false;
-              }, 500);
+                this.loading = false
+              }, 500)
             } else {
-              this.$message.error(res.data.message);
+              this.$message.error(res.data.message)
               setTimeout(() => {
-                this.loading = false;
-              }, 500);
+                this.loading = false
+              }, 500)
             }
           })
           .catch((error) => {
-            console.log(error);
-            this.loading = false;
-          });
+            console.log(error)
+            this.loading = false
+          })
       }
-    },
-  },
-};
+    }
+  }
+}
 </script>
    <style lang="scss" scoped>
 .purchaseOrder {
   // text-align: right;
 }
 </style>
-   
+

+ 107 - 98
src/views/reportQuery/saleReport/components/table21.vue

@@ -28,9 +28,9 @@
               <el-button
                 type="primary"
                 style="margin-left: 30px"
-                @click="download"
                 :size="searchSize"
                 class="fr"
+                @click="download"
               >导出</el-button>
             </el-col>
             <el-col :span="3" style="width: 66px; float: right">
@@ -48,43 +48,43 @@
         </div>
       </template>
       <template #name="{ scope }">
-        <span>{{Array.isArray(scope.row.name) ? scope.row.name.join(",") : scope.row.name}}</span>
+        <span>{{ Array.isArray(scope.row.name) ? scope.row.name.join(",") : scope.row.name }}</span>
       </template>
     </ex-table>
   </div>
 </template>
 <script>
-import mixinPage from "@/mixins/elPaginationHandle";
-import resToken from "@/mixins/resToken";
-import urlConfig from "@/apis/url-config";
-import asyncRequest from "@/apis/service/reportQuery/saleReport";
-import periodDatePickerActive from "../period-date-picker/main.vue";
-import { table21 } from "./columns";
-import { mapGetters } from "vuex";
-import { xs_order_type_options } from "@/assets/js/statusList";
-import * as dayjs from "dayjs";
+import mixinPage from '@/mixins/elPaginationHandle'
+import resToken from '@/mixins/resToken'
+import urlConfig from '@/apis/url-config'
+import asyncRequest from '@/apis/service/reportQuery/saleReport'
+import periodDatePickerActive from '../period-date-picker/main.vue'
+import { table21 } from './columns'
+import { mapGetters } from 'vuex'
+import { xs_order_type_options } from '@/assets/js/statusList'
+import * as dayjs from 'dayjs'
 
 export default {
-  name: "purchaseOrder",
-  mixins: [mixinPage, resToken],
+  name: 'PurchaseOrder',
   components: {
     periodDatePickerActive
   },
+  mixins: [mixinPage, resToken],
   computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"])
+    ...mapGetters(['tablebtnSize', 'searchSize', 'size'])
   },
   data() {
     return {
-      //选中数组
+      // 选中数组
       changeList: [],
-      //全局url
+      // 全局url
       fileUrl: urlConfig.baseURL,
-      //loading
+      // loading
       loading: false,
-      //请求参数集合
+      // 请求参数集合
       parmValue: {
-        start_day: dayjs(this.getStartDate()).format('YYYY-MM-DD'), //起始时间
-        end_day: dayjs(new Date()).format('YYYY-MM-DD'), // 结束时间
+        start_day: dayjs(this.getStartDate()).format('YYYY-MM-DD'), // 起始时间
+        end_day: dayjs(new Date()).format('YYYY-MM-DD') // 结束时间
       },
       // 表格 - 数据集合
       tableData: [],
@@ -93,113 +93,122 @@ export default {
       table: {
         stripe: true,
         border: true,
-        _defaultHeader_: ["setcol"]
+        _defaultHeader_: ['setcol']
       },
       // 表格表头 - 列参数
       table21
-    };
+    }
   },
   mounted() {
-    this.searchList();
+    this.searchList()
   },
 
   methods: {
-    //初始化http请求
+    // 初始化http请求
     async searchList() {
-      if(!this.parmValue.start_day || !this.parmValue.end_day){
-        this.$message.warning("请选择时间区间")
-        this.tableData = [];
-        return;
+      if (!this.parmValue.start_day || !this.parmValue.end_day) {
+        this.$message.warning('请选择时间区间')
+        this.tableData = []
+        return
       }
 
-      this.loading = true;
-      const { code, data, message } = await asyncRequest.sm(this.parmValue);
+      this.loading = true
+      const { code, data, message } = await asyncRequest.sm(this.parmValue)
       if (code === 0) {
-        this.tableData = data;
+        const list = Object.keys(data).reduce((prev, currentKey) => ([
+          ...prev,
+          data[currentKey]
+        ]), [])
+
+        const totalItem = list.shift()
+        list.push(totalItem)
+        // console.log(totalItem)
+        // console.log(Object.keys)
+        this.tableData = list
       } else if (code >= 100 && code <= 104) {
-        await this.logout();
+        await this.logout()
       } else {
-        this.tableData = [];
+        this.tableData = []
       }
-      this.loading = false;
+      this.loading = false
     },
 
-    //重置
+    // 重置
     restSearch() {
       this.parmValue = {
-        start_day: dayjs(this.getStartDate()).format('YYYY-MM-DD'), //起始时间
-        end_day: dayjs(new Date()).format('YYYY-MM-DD'), // 结束时间
-      };
+        start_day: dayjs(this.getStartDate()).format('YYYY-MM-DD'), // 起始时间
+        end_day: dayjs(new Date()).format('YYYY-MM-DD') // 结束时间
+      }
       // 表格 - 分页
-      this.searchList();
+      this.searchList()
     },
-    getStartDate(){
-      const myDate = new Date();
-      myDate.setDate(myDate.getDate() - 29);
+    getStartDate() {
+      const myDate = new Date()
+      myDate.setDate(myDate.getDate() - 29)
       return myDate
     },
     diffDays(days) {
-      let step = 24 * 3600 * 1000;
-      let sDay = new Date(this.parmValue.start_day).valueOf();
-      let eDay = new Date(this.parmValue.end_day).valueOf();
-      let isok = true;
+      const step = 24 * 3600 * 1000
+      const sDay = new Date(this.parmValue.start_day).valueOf()
+      const eDay = new Date(this.parmValue.end_day).valueOf()
+      let isok = true
 
       if (eDay - sDay > step * days) {
-        isok = false;
+        isok = false
       }
 
-      return isok;
+      return isok
     },
-    //选中触发函数
+    // 选中触发函数
     selection_change(e) {
-      const { list } = e;
-      //选中的数组集合
-      this.changeList = list.length > 0 ? JSON.parse(JSON.stringify(list)) : [];
+      const { list } = e
+      // 选中的数组集合
+      this.changeList = list.length > 0 ? JSON.parse(JSON.stringify(list)) : []
     },
     // 时间函数
     async time(e) {
-      this.parmValue.start_day = e.startTime || "";
-      this.parmValue.end_day = e.endTime || "";
+      this.parmValue.start_day = e.startTime || ''
+      this.parmValue.end_day = e.endTime || ''
       if (
-        (this.parmValue.start_day !== "" && this.parmValue.end_day === "") ||
-        (this.parmValue.start_day === "" && this.parmValue.end_day !== "")
+        (this.parmValue.start_day !== '' && this.parmValue.end_day === '') ||
+        (this.parmValue.start_day === '' && this.parmValue.end_day !== '')
       ) {
-        this.$message.warning("时间区间不完整!");
-        return;
+        this.$message.warning('时间区间不完整!')
+        return
       }
 
-      if(!this.diffDays(30)){
-        this.$message.warning("时间区间不能超过30天");
-        return;
+      if (!this.diffDays(30)) {
+        this.$message.warning('时间区间不能超过30天')
+        return
       }
 
-      await this.searchList();
+      await this.searchList()
     },
-    //导出文件
+    // 导出文件
     async download() {
       if (
-        (this.parmValue.start_day !== "" && this.parmValue.end_day === "") ||
-        (this.parmValue.start_day === "" && this.parmValue.end_day !== "")
+        (this.parmValue.start_day !== '' && this.parmValue.end_day === '') ||
+        (this.parmValue.start_day === '' && this.parmValue.end_day !== '')
       ) {
-        this.$message.warning("时间区间不完整!");
-        return;
+        this.$message.warning('时间区间不完整!')
+        return
       }
 
-      if(!this.diffDays(30)){
-        this.$message.warning("时间区间不能超过30天");
-        return;
+      if (!this.diffDays(30)) {
+        this.$message.warning('时间区间不能超过30天')
+        return
       }
 
-      let model = JSON.parse(
+      const model = JSON.parse(
         JSON.stringify(this.parmValue)
-      );
+      )
       if (!this.loading) {
-        this.loading = true;
-        let httpType = `aplication/zip`;
+        this.loading = true
+        const httpType = `aplication/zip`
         axios({
-          method: "post",
-          url: this.fileUrl + "admin/sme",
-          responseType: "blob",
+          method: 'post',
+          url: this.fileUrl + 'admin/sme',
+          responseType: 'blob',
           data: model,
           headers: {
             Accept: httpType
@@ -207,39 +216,39 @@ export default {
         })
           .then(res => {
             if (res && res.status == 200 && res.data) {
-              let url = window.URL.createObjectURL(
+              const url = window.URL.createObjectURL(
                 new Blob([res.data], {
                   type: httpType
                 })
-              );
-              let link = document.createElement("a");
-              link.style.display = "none";
-              link.href = url;
-              let excelName = "本月销售订单情况统计.zip";
-              link.setAttribute("download", excelName);
-              document.body.appendChild(link);
-              link.click();
-              link.remove();
-              window.URL.revokeObjectURL(url); //释放掉blob对象
-              this.$message.success(`导出成功!`);
+              )
+              const link = document.createElement('a')
+              link.style.display = 'none'
+              link.href = url
+              const excelName = '本月销售订单情况统计.zip'
+              link.setAttribute('download', excelName)
+              document.body.appendChild(link)
+              link.click()
+              link.remove()
+              window.URL.revokeObjectURL(url) // 释放掉blob对象
+              this.$message.success(`导出成功!`)
               setTimeout(() => {
-                this.loading = false;
-              }, 500);
+                this.loading = false
+              }, 500)
             } else {
-              this.$message.error(res.data.message);
+              this.$message.error(res.data.message)
               setTimeout(() => {
-                this.loading = false;
-              }, 500);
+                this.loading = false
+              }, 500)
             }
           })
           .catch(error => {
-            console.log(error);
-            this.loading = false;
-          });
+            console.log(error)
+            this.loading = false
+          })
       }
     }
   }
-};
+}
 </script>
 <style lang="scss" scoped>
 .purchaseOrder {

+ 110 - 107
src/views/reportQuery/saleReport/components/table24.vue

@@ -33,14 +33,14 @@
 
             <el-col :span="4" style="margin-right:10px">
               <el-select
-                style="width:100%"
                 v-model="parmValue.flag"
+                style="width:100%"
                 :size="searchSize"
                 @change="searchList"
               >
-                <el-option value label="全部"></el-option>
-                <el-option value="1" label="开通账号的供应商"></el-option>
-                <el-option value="2" label="未开通账号的供应商"></el-option>
+                <el-option value label="全部" />
+                <el-option value="1" label="开通账号的供应商" />
+                <el-option value="2" label="未开通账号的供应商" />
               </el-select>
             </el-col>
 
@@ -48,9 +48,9 @@
               <el-button
                 type="primary"
                 style="margin-left: 30px"
-                @click="download"
                 :size="searchSize"
                 class="fr"
+                @click="download"
               >导出</el-button>
             </el-col>
             <el-col :span="3" style="width: 66px; float: right">
@@ -66,8 +66,8 @@
           <el-row style="margin-top:10px">
             <el-col :span="4" style="margin-right:10px">
               <el-input
-                :size="searchSize"
                 v-model="parmValue.supplierNo"
+                :size="searchSize"
                 placeholder="供应商编码"
                 @blur=" searchList()"
               />
@@ -75,8 +75,8 @@
 
             <el-col :span="4" style="margin-right:10px">
               <el-input
-                :size="searchSize"
                 v-model="parmValue.supplier_name"
+                :size="searchSize"
                 placeholder="供应商名称"
                 @blur="searchList()"
               />
@@ -95,40 +95,40 @@
   </div>
 </template>
 <script>
-import mixinPage from "@/mixins/elPaginationHandle";
-import resToken from "@/mixins/resToken";
-import urlConfig from "@/apis/url-config";
-import asyncRequest from "@/apis/service/reportQuery/saleReport";
-import periodDatePickerActive from "../period-date-picker/main.vue";
-import { table23 } from "./columns";
-import { mapGetters } from "vuex";
-import { xs_order_type_options } from "@/assets/js/statusList";
-import * as dayjs from "dayjs";
+import mixinPage from '@/mixins/elPaginationHandle'
+import resToken from '@/mixins/resToken'
+import urlConfig from '@/apis/url-config'
+import asyncRequest from '@/apis/service/reportQuery/saleReport'
+import periodDatePickerActive from '../period-date-picker/main.vue'
+import { table23 } from './columns'
+import { mapGetters } from 'vuex'
+import { xs_order_type_options } from '@/assets/js/statusList'
+import * as dayjs from 'dayjs'
 
 export default {
-  name: "purchaseOrder",
-  mixins: [mixinPage, resToken],
+  name: 'PurchaseOrder',
   components: {
     periodDatePickerActive
   },
+  mixins: [mixinPage, resToken],
   computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"])
+    ...mapGetters(['tablebtnSize', 'searchSize', 'size'])
   },
   data() {
     return {
-      //选中数组
+      // 选中数组
       changeList: [],
-      //全局url
+      // 全局url
       fileUrl: urlConfig.baseURL,
-      //loading
+      // loading
       loading: false,
-      //请求参数集合
+      // 请求参数集合
       parmValue: {
-        supplier_name: "",
-        supplierNo: "",
-        start_day: dayjs(this.getStartDate()).format('YYYY-MM-DD'), //起始时间
+        supplier_name: '',
+        supplierNo: '',
+        start_day: dayjs(this.getStartDate()).format('YYYY-MM-DD'), // 起始时间
         end_day: dayjs(new Date()).format('YYYY-MM-DD'), // 结束时间
-        flag: "",
+        flag: ''
       },
       // 表格 - 数据集合
       tableData: [],
@@ -137,74 +137,77 @@ export default {
       table: {
         stripe: true,
         border: true,
-        _defaultHeader_: ["setcol"]
+        _defaultHeader_: ['setcol']
       },
       // 表格表头 - 列参数
       table23
-    };
+    }
   },
   mounted() {
-    this.searchList();
+    this.searchList()
   },
 
   methods: {
-    //初始化http请求
+    // 初始化http请求
     async searchList() {
-      if(!this.parmValue.start_day || !this.parmValue.end_day){
-        this.$message.warning("请选择时间区间")
-        this.tableData = [];
-        return;
+      if (!this.parmValue.start_day || !this.parmValue.end_day) {
+        this.$message.warning('请选择时间区间')
+        this.tableData = []
+        return
       }
-      
-      this.loading = true;
-      const { code, data, message } = await asyncRequest.popm(this.parmValue);
+
+      this.loading = true
+      const { code, data, message } = await asyncRequest.popm(this.parmValue)
       if (code === 0) {
         // const { list, count } = data;
-        this.tableData = data;
+        const list = Object.keys(data).reduce((prev, currentKey) => ([...prev, data[currentKey]]), [])
+        const totalItem = list.shift()
+        list.push(totalItem)
+        this.tableData = list
       } else if (code >= 100 && code <= 104) {
-        await this.logout();
+        await this.logout()
       } else {
-        this.tableData = [];
+        this.tableData = []
       }
-      this.loading = false;
+      this.loading = false
     },
-    //重置
+    // 重置
     restSearch() {
       this.parmValue = {
-        start_day: dayjs(this.getStartDate()).format('YYYY-MM-DD'), //起始时间
+        start_day: dayjs(this.getStartDate()).format('YYYY-MM-DD'), // 起始时间
         end_day: dayjs(new Date()).format('YYYY-MM-DD'), // 结束时间
-        supplier_name: "",
-        supplierNo: "",
-        flag: "",
+        supplier_name: '',
+        supplierNo: '',
+        flag: '',
         page: 1, // 页码
         size: 15 // 每页显示条数
-      };
-      this.searchList();
+      }
+      this.searchList()
     },
     // 时间函数
     async time(e) {
-      this.parmValue.start_day = e.startTime || "";
-      this.parmValue.end_day = e.endTime || "";
+      this.parmValue.start_day = e.startTime || ''
+      this.parmValue.end_day = e.endTime || ''
       if (
-        (this.parmValue.start_day !== "" && this.parmValue.end_day === "") ||
-        (this.parmValue.start_day === "" && this.parmValue.end_day !== "")
+        (this.parmValue.start_day !== '' && this.parmValue.end_day === '') ||
+        (this.parmValue.start_day === '' && this.parmValue.end_day !== '')
       ) {
-        this.$message.warning("时间区间不完整!");
-        return;
+        this.$message.warning('时间区间不完整!')
+        return
       }
 
-      if(!this.diffDays(30)){
-        this.$message.warning("时间区间不能超过30天");
-        return;
+      if (!this.diffDays(30)) {
+        this.$message.warning('时间区间不能超过30天')
+        return
       }
 
-      await this.searchList();
+      await this.searchList()
     },
-    //选中触发函数
+    // 选中触发函数
     selection_change(e) {
-      const { list } = e;
-      //选中的数组集合
-      this.changeList = list.length > 0 ? JSON.parse(JSON.stringify(list)) : [];
+      const { list } = e
+      // 选中的数组集合
+      this.changeList = list.length > 0 ? JSON.parse(JSON.stringify(list)) : []
     },
     // getTimeParam() {
     //   const { start_day: start, end_day: end } = this.parmValue;
@@ -227,46 +230,46 @@ export default {
     //     end_day: end_date_chunks.join("-")
     //   };
     // },
-    getStartDate(){
-      const myDate = new Date();
-      myDate.setDate(myDate.getDate() - 29);
+    getStartDate() {
+      const myDate = new Date()
+      myDate.setDate(myDate.getDate() - 29)
       return myDate
     },
     diffDays(days) {
-      let step = 24 * 3600 * 1000;
-      let sDay = new Date(this.parmValue.start_day).valueOf();
-      let eDay = new Date(this.parmValue.end_day).valueOf();
-      let isok = true;
+      const step = 24 * 3600 * 1000
+      const sDay = new Date(this.parmValue.start_day).valueOf()
+      const eDay = new Date(this.parmValue.end_day).valueOf()
+      let isok = true
 
       if (eDay - sDay > step * days) {
-        isok = false;
+        isok = false
       }
 
-      return isok;
+      return isok
     },
-    //导出文件
+    // 导出文件
     async download() {
       if (
-        (this.parmValue.start_day !== "" && this.parmValue.end_day === "") ||
-        (this.parmValue.start_day === "" && this.parmValue.end_day !== "")
+        (this.parmValue.start_day !== '' && this.parmValue.end_day === '') ||
+        (this.parmValue.start_day === '' && this.parmValue.end_day !== '')
       ) {
-        this.$message.warning("时间区间不完整!");
-        return;
+        this.$message.warning('时间区间不完整!')
+        return
       }
 
-      if(!this.diffDays(30)){
-        this.$message.warning("时间区间不能超过30天");
-        return;
+      if (!this.diffDays(30)) {
+        this.$message.warning('时间区间不能超过30天')
+        return
       }
 
-      let model = JSON.parse(JSON.stringify(this.parmValue));
+      const model = JSON.parse(JSON.stringify(this.parmValue))
       if (!this.loading) {
-        this.loading = true;
-        let httpType = `aplication/zip`;
+        this.loading = true
+        const httpType = `aplication/zip`
         axios({
-          method: "post",
-          url: this.fileUrl + "admin/popme",
-          responseType: "blob",
+          method: 'post',
+          url: this.fileUrl + 'admin/popme',
+          responseType: 'blob',
           data: model,
           headers: {
             Accept: httpType
@@ -274,39 +277,39 @@ export default {
         })
           .then(res => {
             if (res && res.status == 200 && res.data) {
-              let url = window.URL.createObjectURL(
+              const url = window.URL.createObjectURL(
                 new Blob([res.data], {
                   type: httpType
                 })
-              );
-              let link = document.createElement("a");
-              link.style.display = "none";
-              link.href = url;
-              let excelName = "本月供应商负责人采购订单情况.zip";
-              link.setAttribute("download", excelName);
-              document.body.appendChild(link);
-              link.click();
-              link.remove();
-              window.URL.revokeObjectURL(url); //释放掉blob对象
-              this.$message.success(`导出成功!`);
+              )
+              const link = document.createElement('a')
+              link.style.display = 'none'
+              link.href = url
+              const excelName = '本月供应商负责人采购订单情况.zip'
+              link.setAttribute('download', excelName)
+              document.body.appendChild(link)
+              link.click()
+              link.remove()
+              window.URL.revokeObjectURL(url) // 释放掉blob对象
+              this.$message.success(`导出成功!`)
               setTimeout(() => {
-                this.loading = false;
-              }, 500);
+                this.loading = false
+              }, 500)
             } else {
-              this.$message.error(res.data.message);
+              this.$message.error(res.data.message)
               setTimeout(() => {
-                this.loading = false;
-              }, 500);
+                this.loading = false
+              }, 500)
             }
           })
           .catch(error => {
-            console.log(error);
-            this.loading = false;
-          });
+            console.log(error)
+            this.loading = false
+          })
       }
     }
   }
-};
+}
 </script>
 <style lang="scss" scoped>
 .purchaseOrder {

部分文件因文件數量過多而無法顯示