Browse Source

Merge branch 'dev' of http://git.echepei.com/caojunjie/Smart_platform_ui into dev

QuKatie 3 years ago
parent
commit
ff362af78d

File diff suppressed because it is too large
+ 0 - 0
public/cdn/avue/2.8.18/avue.min.js


+ 1 - 0
src/views/workManagement/main-items/configuration/mainList.json

@@ -14,6 +14,7 @@
   "editBtn": false,
   "viewBtn": false,
   "delBtn": false,
+  "showSummary": true,
   "menuWidth": 220,
   "column": [
     {

+ 32 - 4
src/views/workManagement/main-items/list.vue

@@ -7,6 +7,7 @@
       :page.sync="page"
       :search.sync="search"
       :table-loading="loading"
+      :summary-method="summaryMethod"
       @row-del="rowDel"
       @row-update="rowUpdate"
       @row-save="rowSave"
@@ -62,6 +63,8 @@
   import option from "./configuration/mainList.json";
   import { getList,deleteMain } from "@/api/workManagement/mainProject";
   import reportDialog from "@/components/report-dialog/main";
+  import { micrometerFormat } from "@/util/validate";
+  import _ from "lodash";
 
 export default {
   data() {
@@ -89,10 +92,10 @@ export default {
     };
   },
   created() {
-
+    // option.height = window.innerHeight - 380 ;
   },
   mounted() {
-    option.height = window.innerHeight - 380 ;
+
   },
   components: {
     reportDialog
@@ -142,9 +145,8 @@ export default {
       this.getList(this.page, params);
       done();
     },
-    refreshChange(params,done) {
+    refreshChange(params) {
       this.getList(this.page,params);
-      done();
     },
     //删除列表后面的删除按钮触发触发(row, index, done)
     rowDel(row, index, done) {
@@ -189,6 +191,32 @@ export default {
     saveColumn(row, column) {
       console.log(row, column);
     },
+    summaryMethod({ columns, data }) {
+      const sums = [];
+      if (columns.length > 0) {
+        columns.forEach((item, index) => {
+          sums[0] = "合计";
+          if (
+            item.property == "debitAmount" ||
+            item.property == "settlmentAmount"
+          ) {
+            let qtySum = 0;
+            let instoreSum = 0;
+            data.forEach(e => {
+              qtySum = _.add(qtySum, Number(e.debitAmount));
+              instoreSum = _.add(instoreSum, Number(e.settlmentAmount));
+            });
+            if (item.property == "debitAmount") {
+              sums[index] = micrometerFormat(qtySum);
+            }
+            if (item.property == "settlmentAmount") {
+              sums[index] = micrometerFormat(instoreSum);
+            }
+          }
+        });
+      }
+      return sums;
+    },
     //打开详情页
     beforeOpenPage(row, index) {
       this.$router.push({

+ 1 - 1
src/views/workManagement/receipt/settleAccounts.vue

@@ -72,7 +72,7 @@
       };
     },
     mounted() {
-      option.height = window.innerHeight - 340 ;
+      // option.height = window.innerHeight - 340 ;
     },
     methods: {
       getList(page,params={}) {

+ 1 - 1
src/views/workManagement/receipt/statisticalList.vue

@@ -77,7 +77,7 @@
 
     },
     mounted() {
-      option.height = window.innerHeight - 320 ;
+      // option.height = window.innerHeight - 320 ;
     },
     methods: {
       rowDel() {

+ 8 - 0
src/views/workManagement/task/configuration/mainList.json

@@ -16,6 +16,14 @@
   "delBtn": false,
   "menuWidth": 150,
   "searchLabelWidth": 100,
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [
+    {
+      "name": "amount",
+      "type": "sum"
+    }
+  ],
   "column": [
     {
       "label": "状态",

+ 1 - 1
src/views/workManagement/task/index.vue

@@ -86,7 +86,7 @@
 
     },
     mounted() {
-      option.height = window.innerHeight - 350 ;
+      // option.height = window.innerHeight - 350 ;
     },
     methods: {
       //完工

Some files were not shown because too many files changed in this diff