Browse Source

前端孟祥旭

mxx 3 years ago
parent
commit
f471690641

+ 42 - 1
src/views/statisticalReport/purchaseClosingCashierList.vue

@@ -143,7 +143,10 @@
           class="wenzi"
           class="wenzi"
           :data="warehouseList.records"
           :data="warehouseList.records"
           style="width: 100%; margin-top: 20px"
           style="width: 100%; margin-top: 20px"
-          height="780"
+          ref="warehouseList"
+          border
+          :summary-method="getSummaries"
+          show-summary
           @selection-change="handleSelectionChange"
           @selection-change="handleSelectionChange"
         >
         >
           <el-table-column type="selection" width="55"></el-table-column>
           <el-table-column type="selection" width="55"></el-table-column>
@@ -285,6 +288,38 @@ export default {
     this.showType = this.isShow
     this.showType = this.isShow
   },
   },
   methods: {
   methods: {
+    updated() {
+      this.$nextTick(() => {
+        this.$refs.warehouseList.doLayout()
+      })
+    },
+    //合计
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+        } else if (index === 5 || index === 7 || index === 8 || index === 9) {
+          const values = data.map(item => Number(item[column.property]))
+          if (!values.every(value => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr)
+              if (!isNaN(value)) {
+                return prev + curr
+              } else {
+                return prev
+              }
+            }, 0)
+          } else {
+            sums[index] = '元'
+          }
+        } else {
+          sums[index] = '--'
+        }
+      })
+      return sums
+    },
     //成交
     //成交
     submit() {
     submit() {
       if (!this.warehouseList.transactionPrice) {
       if (!this.warehouseList.transactionPrice) {
@@ -789,6 +824,12 @@ hr {
 .el-input-number--small {
 .el-input-number--small {
   width: 123% !important;
   width: 123% !important;
 }
 }
+/deep/.el-table td,
+.el-table th.is-leaf {
+  border-right: 1px solid #e9ecf7;
+  text-align: center;
+  height: 40px;
+}
 // .danjia{
 // .danjia{
 //   width: 9px;
 //   width: 9px;
 //   height: 9px;
 //   height: 9px;

+ 42 - 1
src/views/statisticalReport/purchaseReceiptStatisticsList.vue

@@ -191,7 +191,10 @@
           class="wenzi"
           class="wenzi"
           :data="warehouseList.records"
           :data="warehouseList.records"
           style="width: 100%; margin-top: 20px"
           style="width: 100%; margin-top: 20px"
-          height="780"
+          ref="warehouseList"
+          border
+          :summary-method="getSummaries"
+          show-summary
         >
         >
           <el-table-column type="selection" width="55"></el-table-column>
           <el-table-column type="selection" width="55"></el-table-column>
           <el-table-column type="index" label="序号" width="50"></el-table-column>
           <el-table-column type="index" label="序号" width="50"></el-table-column>
@@ -353,6 +356,38 @@ export default {
     this.showType = this.isShow
     this.showType = this.isShow
   },
   },
   methods: {
   methods: {
+    updated() {
+      this.$nextTick(() => {
+        this.$refs.warehouseList.doLayout()
+      })
+    },
+    //合计
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+        } else if (index === 5 || index === 7 || index === 8 || index === 9) {
+          const values = data.map(item => Number(item[column.property]))
+          if (!values.every(value => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr)
+              if (!isNaN(value)) {
+                return prev + curr
+              } else {
+                return prev
+              }
+            }, 0)
+          } else {
+            sums[index] = '元'
+          }
+        } else {
+          sums[index] = '--'
+        }
+      })
+      return sums
+    },
     //成交
     //成交
     submit() {
     submit() {
       if (!this.warehouseList.transactionPrice) {
       if (!this.warehouseList.transactionPrice) {
@@ -854,6 +889,12 @@ hr {
 .el-input-number--small {
 .el-input-number--small {
   width: 123% !important;
   width: 123% !important;
 }
 }
+/deep/.el-table td,
+.el-table th.is-leaf {
+  border-right: 1px solid #e9ecf7;
+  text-align: center;
+  height: 40px;
+}
 // .danjia{
 // .danjia{
 //   width: 9px;
 //   width: 9px;
 //   height: 9px;
 //   height: 9px;

+ 42 - 1
src/views/statisticalReport/salesClosingCashierList.vue

@@ -159,8 +159,11 @@
           class="wenzi"
           class="wenzi"
           :data="warehouseList.records"
           :data="warehouseList.records"
           style="width: 100%; margin-top: 20px"
           style="width: 100%; margin-top: 20px"
-          height="780"
           @selection-change="handleSelectionChange"
           @selection-change="handleSelectionChange"
+          ref="warehouseList"
+          border
+          :summary-method="getSummaries"
+          show-summary
         >
         >
           <el-table-column type="selection" width="55"></el-table-column>
           <el-table-column type="selection" width="55"></el-table-column>
           <el-table-column type="index" label="序号" width="50"></el-table-column>
           <el-table-column type="index" label="序号" width="50"></el-table-column>
@@ -307,6 +310,38 @@ export default {
     this.showType = this.isShow
     this.showType = this.isShow
   },
   },
   methods: {
   methods: {
+    updated() {
+      this.$nextTick(() => {
+        this.$refs.warehouseList.doLayout()
+      })
+    },
+    //合计
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+        } else if (index === 5 || index === 7 || index === 8 || index === 9) {
+          const values = data.map(item => Number(item[column.property]))
+          if (!values.every(value => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr)
+              if (!isNaN(value)) {
+                return prev + curr
+              } else {
+                return prev
+              }
+            }, 0)
+          } else {
+            sums[index] = '元'
+          }
+        } else {
+          sums[index] = '--'
+        }
+      })
+      return sums
+    },
     //成交
     //成交
     submit() {
     submit() {
       if (!this.warehouseList.transactionPrice) {
       if (!this.warehouseList.transactionPrice) {
@@ -811,6 +846,12 @@ hr {
 .el-input-number--small {
 .el-input-number--small {
   width: 123% !important;
   width: 123% !important;
 }
 }
+/deep/.el-table td,
+.el-table th.is-leaf {
+  border-right: 1px solid #e9ecf7;
+  text-align: center;
+  height: 40px;
+}
 // .danjia{
 // .danjia{
 //   width: 9px;
 //   width: 9px;
 //   height: 9px;
 //   height: 9px;

+ 54 - 32
src/views/statisticalReport/salesDeliveryReportList.vue

@@ -113,7 +113,9 @@
             :append-to-body="true"
             :append-to-body="true"
           >
           >
             <el-form :model="form">
             <el-form :model="form">
-               <div style=" margin-left: 30%;"><h4>合计发票金额{{}}元,确定提交?</h4></div>
+              <div style=" margin-left: 30%;">
+                <h4>合计发票金额{{}}元,确定提交?</h4>
+              </div>
             </el-form>
             </el-form>
             <div slot="footer" class="dialog-footer">
             <div slot="footer" class="dialog-footer">
               <el-button @click="dialogFormVisible3 = false">取 消</el-button>
               <el-button @click="dialogFormVisible3 = false">取 消</el-button>
@@ -139,7 +141,7 @@
               <el-button @click="dialogFormVisible3 = false">取 消</el-button>
               <el-button @click="dialogFormVisible3 = false">取 消</el-button>
               <el-button type="primary" @click="dialogFormVisible3 = false">提 交</el-button>
               <el-button type="primary" @click="dialogFormVisible3 = false">提 交</el-button>
             </div>
             </div>
-           </el-dialog> -->
+          </el-dialog>-->
           <ws-button type="primary" @click="dialogFormVisible4=true">付款</ws-button>
           <ws-button type="primary" @click="dialogFormVisible4=true">付款</ws-button>
 
 
           <el-dialog
           <el-dialog
@@ -258,10 +260,11 @@
         <el-table
         <el-table
           class="wenzi"
           class="wenzi"
           :data="warehouseList.records"
           :data="warehouseList.records"
-          style="width: 100%; margin-top: 20px"
-          height="780"
+          style="width: 100%; margin-top: 20px; height: 780;"
+          ref="warehouseList"
+          border
+          :summary-method="getSummaries"
           show-summary
           show-summary
-         
         >
         >
           <el-table-column type="selection" width="55"></el-table-column>
           <el-table-column type="selection" width="55"></el-table-column>
           <el-table-column type="index" label="序号" width="50"></el-table-column>
           <el-table-column type="index" label="序号" width="50"></el-table-column>
@@ -410,38 +413,45 @@ export default {
       accessoryTFs: false
       accessoryTFs: false
     }
     }
   },
   },
+
   activated() {
   activated() {
     // this.loaddata()
     // this.loaddata()
     this.getList()
     this.getList()
     this.showType = this.isShow
     this.showType = this.isShow
   },
   },
   methods: {
   methods: {
-//       getSummaries (param) {
-//   const { columns, data } = param
-//   const sums = []
-//   columns.forEach((column, index) => {
-//   if (index === 0) {
-//    sums[index] = '总计'
-//   } else if (index === 5 || index === 6) {
-//    const values = data.map(item => Number(item[column.property]))
-//    if (!values.every(value => isNaN(value))) {
-//    sums[index] = values.reduce((prev, curr) => {
-//     const value = Number(curr)
-//     if (!isNaN(value)) {
-//     return prev + curr
-//     } else {
-//     return prev
-//     }
-//    }, 0)
-//    } else {
-//    sums[index] = 'N/A'
-//    }
-//   } else {
-//    sums[index] = '--'
-//   }
-//   })
-//   return sums
-//  },
+    updated() {
+      this.$nextTick(() => {
+        this.$refs.warehouseList.doLayout()
+      })
+    },
+    //合计
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+        } else if (index === 5 || index === 7 || index === 8 || index === 9) {
+          const values = data.map(item => Number(item[column.property]))
+          if (!values.every(value => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr)
+              if (!isNaN(value)) {
+                return prev + curr
+              } else {
+                return prev
+              }
+            }, 0)
+          } else {
+            sums[index] = '元'
+          }
+        } else {
+          sums[index] = '--'
+        }
+      })
+      return sums
+    },
     //成交
     //成交
     submit() {
     submit() {
       if (!this.warehouseList.transactionPrice) {
       if (!this.warehouseList.transactionPrice) {
@@ -727,7 +737,6 @@ export default {
 .el-button--primary {
 .el-button--primary {
   background-color: #5878e8;
   background-color: #5878e8;
   border-color: #5878e8;
   border-color: #5878e8;
- 
 }
 }
 .el-button--default {
 .el-button--default {
   color: #8890b1;
   color: #8890b1;
@@ -944,6 +953,19 @@ hr {
 .el-input-number--small {
 .el-input-number--small {
   width: 123% !important;
   width: 123% !important;
 }
 }
+.wemzi {
+  height: 780;
+}
+/deep/.el-table td,
+.el-table th.is-leaf {
+  border-right: 1px solid #e9ecf7;
+  text-align: center;
+  height: 40px;
+}
+// .el-table {   overflow: visible !important; }
+// .el-table__footer-wrapper {
+//     margin-top: -23%;
+// }
 // .danjia{
 // .danjia{
 //   width: 9px;
 //   width: 9px;
 //   height: 9px;
 //   height: 9px;