Bläddra i källkod

元旦回来第一天

mushencc 3 år sedan
förälder
incheckning
8998f08587
3 ändrade filer med 49 tillägg och 13 borttagningar
  1. BIN
      dist (3).zip
  2. 47 11
      src/views/ProductionOrderList/Deliverylist/Deliverylist.vue
  3. 2 2
      vue.config.js

BIN
dist (3).zip


+ 47 - 11
src/views/ProductionOrderList/Deliverylist/Deliverylist.vue

@@ -12,8 +12,9 @@
       :tableData="tableData"
       :pageIndex="pageIndex"
       :total="total"
+      @selectTable='selectTable'
     >
-      <div slot="navButton">
+      <div slot="titleButton">
         <!-- <Button
           v-if="persimissionData['表头设置'] || persimissionData.all"
           @click="setupTableHeader"
@@ -22,6 +23,12 @@
           icon="ios-cog"
           >表头设置</Button
         > -->
+        <Button  
+         type="primary"
+          ghost
+          @click="postData">
+         导出
+        </Button>
       </div>
       <template slot="basicTypeSet" slot-scope="{ row }">
         <div>
@@ -155,13 +162,21 @@ import { mapState } from "vuex";
 export default {
   data() {
     return {
+      chooseData:[],
       url_number_list:[],
       tableColums: [
         {
+          type: "selection",
+          align: "center",
+          key: "selection",
+          minWidth: 100,
+          fixed: "left",
+          title: "全选",
+        },
+        {
           title: "订单编号",
           align: "center",
           key: "order_no",
-          fixed: "left",
           width: "200",
         },
         {
@@ -295,7 +310,7 @@ export default {
       }
       return this.func.computedHeader(this.tableheaders, this.tableColums);
     },
-    set_list() {
+    set_list(){
       return [
         {
           title: "订单编号",
@@ -381,32 +396,53 @@ export default {
           start_placeholder: "开始日期",
           end_placeholder: "结束日期",
         },
-      ];
+      ]
     },
   },
   methods: {
+    selectTable(e){
+        this.chooseData = e;
+        console.log(this.chooseData)
+    },
+     async postData() {
+        let transport_no = [];
+      this.chooseData.forEach(v=>{
+        transport_no.push(v.transport_no)
+      });
+      const res = await this.axios.post("/api/transports_export", {
+        transport_no
+      });
+      if (res.code == 200) {
+        let url = `${this.$store.state.ip}/api/storage/${res.data.file}`;
+        location.href = url;
+      }
+    },
+   
     init(row) {
       this.pageIndex = 1;
       row.page_index = this.pageIndex;
       row.page_size = this.pageSize;
-      this.proxyObj = row;
-      this.getData(row);
+      this.proxyObj = JSON.parse(JSON.stringify(row));
+      this.getData(this.proxyObj);
+     
     },
     getData(row) {
-      this.loading = true;
+      // this.loading = true;
+      console.log(row,1)
       this.axios("/api/orders_out_list", { params: row }).then((res) => {
-        this.loading = false;
+        // this.loading = false;
         if (res.code == 200) {
           this.tableData = res.data.data;
           this.total = res.data.total;
-          this.tableheaders = res.data.tableSet || [];
+          // this.tableheaders = res.data.tableSet || [];
           let data =[];
           res.data.url_number_list.map(v=>{
             let obj={};
-            obj.title = v;
+               obj.title = v||'';
+           
             data.push(obj);
           })
-          this.url_number_list = data;
+          this.set_list[4].option = data;
         }
       });
     },

+ 2 - 2
vue.config.js

@@ -1,8 +1,8 @@
 const axios_default_ip =
   process.env.NODE_ENV == "dev"
-    ? "http://121.41.102.225:82"
+    ? "http://124.71.176.88:882"
     : process.env.NODE_ENV == "test-prd"
-    ? "http://121.41.102.225:82" //测试服
+    ? "http://121.37.173.82:82" //测试服
     : process.env.NODE_ENV == "prd_other"
     ? "http://121.37.173.82:82" //贝斯特
     : "http://124.71.176.88:882";