XMLWAN 2 年 前
コミット
31f9574e98
共有4 個のファイルを変更した80 個の追加21 個の削除を含む
  1. 2 2
      config/index.js
  2. 8 9
      src/xt_pages/stock/stockInOrderAdd.vue
  3. 1 2
      src/xt_pages/stock/stockInOrderEdit.vue
  4. 69 8
      src/xt_pages/workforce/components/template_table.vue

+ 2 - 2
config/index.js ファイルの表示

27
     // can be overwritten by process.env.HOST
27
     // can be overwritten by process.env.HOST
28
     // if you want dev by ip, please set host: '0.0.0.0'
28
     // if you want dev by ip, please set host: '0.0.0.0'
29
 
29
 
30
-    // host: 'xt.test.sgjyun.com',
30
+    host: 'xt.test.sgjyun.com',
31
     //  host: 'xt.kuyicloud.com',
31
     //  host: 'xt.kuyicloud.com',
32
    // host: 'xt.test.sgjyun.com',
32
    // host: 'xt.test.sgjyun.com',
33
-   host: 'localhost',
33
+  //  host: 'localhost',
34
     port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
34
     port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
35
     autoOpenBrowser: true,
35
     autoOpenBrowser: true,
36
     errorOverlay: true,
36
     errorOverlay: true,

+ 8 - 9
src/xt_pages/stock/stockInOrderAdd.vue ファイルの表示

7
 
7
 
8
       <div style="float:right;">
8
       <div style="float:right;">
9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
10
-        <el-button size="small" type="primary" @click="submit()" class="filter-item"  v-loading="loading">保 存</el-button>
10
+        <el-button size="small" type="primary" @click="submit()" class="filter-item" v-loading="loading">保 存</el-button>
11
         <el-button size="small" type="primary" v-show="showCheck" @click="toCheck()" class="filter-item">审 核</el-button>
11
         <el-button size="small" type="primary" v-show="showCheck" @click="toCheck()" class="filter-item">审 核</el-button>
12
         <!-- <el-button size="small" type="primary" v-show="showReturnCheck" @click="toReturnCheck()" class="filter-item">反 审 核</el-button> -->
12
         <!-- <el-button size="small" type="primary" v-show="showReturnCheck" @click="toReturnCheck()" class="filter-item">反 审 核</el-button> -->
13
       </div>
13
       </div>
14
     </div>
14
     </div>
15
-    <div class="app-container">
15
+    <div class="app-container" v-loading="loading">
16
 
16
 
17
       <stock-in-dialog ref="dialog" :propForm="propForm"
17
       <stock-in-dialog ref="dialog" :propForm="propForm"
18
                        :visibility="isVisibility"
18
                        :visibility="isVisibility"
697
         this.$refs['tableForm'].validate((valid) => {
697
         this.$refs['tableForm'].validate((valid) => {
698
           if (valid) {
698
           if (valid) {
699
             this.loading = true
699
             this.loading = true
700
-            const loading = this.$loading({
701
-              lock: true,
702
-              text: 'Loading',
703
-              spinner: 'el-icon-loading',
704
-              background: 'rgba(0, 0, 0, 0.7)'
705
-            })
706
             const array = this.recordInfo.recordData
700
             const array = this.recordInfo.recordData
707
             if(this.storehouse_id == 0){
701
             if(this.storehouse_id == 0){
708
               this.$message.error("仓库不能为空!")
702
               this.$message.error("仓库不能为空!")
742
               }
736
               }
743
               this.recordInfo.recordData[i].warehousing_count = this.recordInfo.recordData[i].warehousing_count.toString()
737
               this.recordInfo.recordData[i].warehousing_count = this.recordInfo.recordData[i].warehousing_count.toString()
744
             }
738
             }
745
-        
739
+            const loading = this.$loading({
740
+              lock: true,
741
+              text: 'Loading',
742
+              spinner: 'el-icon-loading',
743
+              background: 'rgba(0, 0, 0, 0.7)'
744
+            })
746
             const params = {
745
             const params = {
747
               'stockIn': this.recordInfo.recordData
746
               'stockIn': this.recordInfo.recordData
748
             }
747
             }

+ 1 - 2
src/xt_pages/stock/stockInOrderEdit.vue ファイルの表示

21
           v-if="is_check == 2"
21
           v-if="is_check == 2"
22
           v-loading="loading"
22
           v-loading="loading"
23
           class="filter-item"
23
           class="filter-item"
24
-          v-loading="loading"
25
           >保 存</el-button
24
           >保 存</el-button
26
         >
25
         >
27
         <el-button
26
         <el-button
43
       </div>
42
       </div>
44
     </div>
43
     </div>
45
 
44
 
46
-    <div class="app-container">
45
+    <div class="app-container" v-loading="loading">
47
       <stock-in-dialog
46
       <stock-in-dialog
48
         ref="dialog"
47
         ref="dialog"
49
         :propForm="propForm"
48
         :propForm="propForm"

+ 69 - 8
src/xt_pages/workforce/components/template_table.vue ファイルの表示

32
         :row-style="{ color: '#303133' }"
32
         :row-style="{ color: '#303133' }"
33
         style="width: 100%"
33
         style="width: 100%"
34
 
34
 
35
-
36
         border
35
         border
37
       >
36
       >
38
         <el-table-column label="姓名" width="120">
37
         <el-table-column label="姓名" width="120">
101
                 :summary-method="getSummaries"
100
                 :summary-method="getSummaries"
102
                 row-class-name="table-row-new-class schedule-table-row" @cell-click="itemClick"
101
                 row-class-name="table-row-new-class schedule-table-row" @cell-click="itemClick"
103
                 sum-text="总数"
102
                 sum-text="总数"
104
-                >
105
       >
103
       >
106
         <el-table-column label="分区" width="80" align="center" fixed
104
         <el-table-column label="分区" width="80" align="center" fixed
107
                          style="width: 100px; background-color: red; display: block;">
105
                          style="width: 100px; background-color: red; display: block;">
469
       //     }
467
       //     }
470
       // },
468
       // },
471
       makeDeviceNumbers: function(device_numbers) {
469
       makeDeviceNumbers: function(device_numbers) {
472
-
470
+        console.log("device_numbers",device_numbers)
471
+        var arr = []
472
+        for(let i=0;i<device_numbers.length;i++){
473
+          arr.push(device_numbers[i])
474
+        }
475
+        arr.sort(this.arraySort('sort'))
476
+        console.log("Arr2332232332",arr)
473
         var maked_device_numbers = []
477
         var maked_device_numbers = []
474
         var weekdays = [1, 2, 3, 4, 5, 6, 7] // 周一-周日
478
         var weekdays = [1, 2, 3, 4, 5, 6, 7] // 周一-周日
475
         var time_types = [1, 2, 3] // 上下晚
479
         var time_types = [1, 2, 3] // 上下晚
476
-        for (let index = 0; index < device_numbers.length; index++) {
477
-          const device_number = device_numbers[index]
480
+        for (let index = 0; index < arr.length; index++) {
481
+          const device_number = arr[index]
478
           if(device_number.zone!=null){
482
           if(device_number.zone!=null){
479
             var zone = {
483
             var zone = {
480
               id: device_number.zone.id,
484
               id: device_number.zone.id,
481
               name: device_number.zone.name,
485
               name: device_number.zone.name,
482
-              type: device_number.zone.type
486
+              type: device_number.zone.type,
487
+              sort:device_number.sort
483
             }
488
             }
484
             var device = {
489
             var device = {
485
               id: device_number.id,
490
               id: device_number.id,
486
               number: device_number.number,
491
               number: device_number.number,
487
               group_id: device_number.group_id,
492
               group_id: device_number.group_id,
488
               zone_id: device_number.zone_id,
493
               zone_id: device_number.zone_id,
489
-              zone: zone
494
+              zone: zone,
495
+              sort:device_number.sort
490
             }
496
             }
491
           }
497
           }
492
 
498
 
511
           maked_device_numbers.push(device)
517
           maked_device_numbers.push(device)
512
         }
518
         }
513
 
519
 
514
-        console.log(maked_device_numbers)
520
+        console.log("数据源23232233223232322323我",maked_device_numbers)
515
         return maked_device_numbers
521
         return maked_device_numbers
516
       },
522
       },
517
       spanMethod({ row, column, rowIndex, columnIndex }) {
523
       spanMethod({ row, column, rowIndex, columnIndex }) {
777
           this.saving = false
783
           this.saving = false
778
           this.is_editing = false
784
           this.is_editing = false
779
         })
785
         })
786
+      },
787
+      getSummaries(param) {
788
+
789
+        const { columns, data } = param;
790
+        const sums = [];
791
+        columns.forEach((column, index) => {
792
+          if (index === 0 || index === 25) {
793
+            sums[index] = "总数";
794
+            return;
795
+          }
796
+          if (index === 1 || index === 24) {
797
+            sums[index] = data.length;
798
+            return;
799
+          }
800
+
801
+          const values = data.map(item => item[column.property]);
802
+
803
+          if (index === 23) {
804
+            sums[index] = values.reduce((prev, curr) => {
805
+              const value = Number(curr);
806
+              if (!isNaN(value)) {
807
+                return prev + curr;
808
+              } else {
809
+                return prev;
810
+              }
811
+            }, 0);
812
+            sums[index];
813
+            return;
814
+          }
815
+
816
+          sums[index] = values.reduce((prev, curr) => {
817
+            if (typeof curr["treat_mode_id"] === "undefined") {
818
+              return prev;
819
+            }
820
+            const value = Number(curr["treat_mode_id"]);
821
+            if (!isNaN(value) && value > 0) {
822
+              return prev + 1;
823
+            } else {
824
+              return prev;
825
+            }
826
+          }, 0);
827
+          sums[index];
828
+        });
829
+        this.$nextTick(() => {
830
+          this.$refs.table.doLayout();
831
+        });
832
+
833
+        return sums;
834
+      },
835
+      arraySort(property) {
836
+        return function (a, b) {
837
+          var value1 = a[property]
838
+          var value2 = b[property]
839
+          return value1 - value2
840
+        }
780
       }
841
       }
781
     }
842
     }
782
   }
843
   }