achao 3 年 前
コミット
058cc09379

+ 1 - 1
unimall-admin/config/index.js

@@ -15,7 +15,7 @@ module.exports = {
 
         // can be overwritten by process.env.HOST
         // if you want dev by ip, please set host: '0.0.0.0'
-        host: 'localhost',
+        host: '192.168.110.175',
         port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
         autoOpenBrowser: true,
         errorOverlay: true,

+ 13 - 0
unimall-admin/src/api/MaritimeAdministration.js

@@ -79,3 +79,16 @@ export function importWord(data) {
     })
   })
 }
+
+export function listStatistics(query) {
+  return request({
+    method: 'post',
+    params: {
+      _gp: 'admin.expenditure',
+      _mt: 'listStatistics',
+      page: query.page,
+      limit: query.limit,
+      MaritimeAdministrationDTO: JSON.stringify(query.type)
+    }
+  })
+}

+ 1 - 38
unimall-admin/src/router/route.json

@@ -2,44 +2,7 @@
 
         "redirect": "noredirect",
         "path": "/tools",
-        "children": [
-
-            {
-                "path": "expressBusiness",
-                "meta": {
-                    "noCache": true,
-                    "perms": [
-                        ""
-                    ],
-                    "title": "快递业务"
-                },
-                "name": "expressBusiness",
-                "page": "/express/expressBusiness"
-            },
-            {
-                "path": "settlement",
-                "meta": {
-                    "noCache": true,
-                    "perms": [
-                        ""
-                    ],
-                    "title": "商品结算"
-                },
-                "name": "settlement",
-                "page": "/settlement/settlementManagement"
-            }, {
-                "path": "stock",
-                "meta": {
-                    "noCache": true,
-                    "perms": [
-                        ""
-                    ],
-                    "title": "库存管理"
-                },
-                "name": "stock",
-                "page": "/stock/stockManagement"
-            },
-            {
+        "children": [{
                 "path": "expressBill",
                 "meta": {
                     "noCache": true,

+ 181 - 7
unimall-admin/src/views/dashboard/index.vue

@@ -1,17 +1,191 @@
 <template>
-  <div class="dashboard-container">
-
+  <div class="dashboard-container app-container">
+    <div class="title">金额统计</div>
+    <div class="filter-container">
+      <el-date-picker
+        v-model="selectDate"
+        style="margin-right: 20px"
+        size="small"
+        type="daterange"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"
+      />
 
+      <el-button
+        v-permission="['collectionPayment:collectionpayment:list']"
+        class="filter-item"
+        type="primary"
+        size="mini"
+        icon="el-icon-search"
+        @click="handleFilter"
+      >查找</el-button
+      >
+    </div>
 
+    <!-- 查询结果 -->
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      :summary-method="getSummaries"
+      size="small"
+      element-loading-text="正在查询中。。。"
+      border
+      fit
+      highlight-current-row
+      show-summary
+    >
+      <el-table-column align="center" label="日期" prop="receiptPaymentDate">
+        <template slot-scope="scope"> {{ scope.row.statciDate }}</template>
+      </el-table-column>
+      <el-table-column align="center" label="收入金额" prop="revenueAmount" />
+      <el-table-column
+        align="center"
+        label="支出金额"
+        prop="expenditureAmount"
+      />
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="listQuery.page"
+      :limit.sync="listQuery.limit"
+      @pagination="getList" />
   </div>
 </template>
-
 <script>
+import { dayjs, EventBus } from 'base-core-lib'
+import { listStatistics } from '@/api/MaritimeAdministration'
 
-</script>
+import Pagination from '@/components/Pagination'
+import store from '@/store'
+export default {
+  name: 'CollectionPayment',
+  components: { Pagination },
+  data() {
+    return {
+      isAllowExport: true,
+      countryList: [],
+      modification: [],
+      selectDate: [],
+      date: {
+        year: dayjs().format('YYYY'),
+        month: dayjs().format('MM')
+      },
 
-<style lang="scss">
-
-</style>
+      list: null,
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        limit: 20,
+        type: {
+          startDate: '',
+          endDate: ''
+        }
+      }
+    }
+  },
+  created() {
+    this.selectDate = this.getNowTime()
+    this.getList()
+  },
 
+  methods: {
+    getNowTime() {
+      const start = new Date(new Date().getTime())
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0] // 默认开始时间7天前
+      const end = new Date(new Date().getTime())
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0] // 默认结束时间1天前
+      // const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7)
+      //   .toISOString()
+      //   .replace('T', ' ')
+      //   .split('.')[0] // 默认开始时间7天前
+      // const end = new Date(new Date().getTime() - 3600 * 1000 * 24)
+      //   .toISOString()
+      //   .replace('T', ' ')
+      //   .split('.')[0]// 默认结束时间1天前
+      console.log([start, end])
+      return [start, end]
+    },
+    formatDate(numb, format) {
+      const old = numb - 1
+      const t = Math.round((old - Math.floor(old)) * 24 * 60 * 60)
+      const time = new Date(1900, 0, old, 0, 0, t)
+      const year = time.getFullYear()
+      const month = time.getMonth() + 1
+      const date = time.getDate()
+      return (
+        year +
+        format +
+        (month < 10 ? '0' + month : month) +
+        format +
+        (date < 10 ? '0' + date : date) +
+        ' 00:00:00'
+      )
+    },
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        } 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)
+            sums[index] += ''
+          } else {
+            sums[index] = '--'
+          }
+        } else {
+          // sums[index] = "--";
+        }
+      })
 
+      return sums
+    },
+    handleFilter() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    getList() {
+      this.listQuery.type.startDate = dayjs(this.selectDate[0]).format(
+        'YYYY-MM-DD'
+      )
+      this.listQuery.type.endDate = dayjs(this.selectDate[1]).format(
+        'YYYY-MM-DD'
+      )
+      listStatistics(this.listQuery)
+        .then((response) => {
+          this.list = response.data.data.items
+          this.total = response.data.data.total
+          this.listLoading = false
+        })
+        .catch(() => {
+          this.list = []
+          this.total = 0
+          this.listLoading = false
+        })
+    }
+  }
+}
+</script>
+<style scoped lang="scss">
+.title{
+  font-size: 30px;
+  margin-bottom: 40px;
+}
+</style>

+ 9 - 4
unimall-admin/src/views/productSales/productSales.vue

@@ -35,6 +35,7 @@
         @click="handleCreate"
       >添加</el-button>
       <el-button
+        v-if="name=='admin'||name=='kelly'"
         class="filter-item"
         type="primary"
         size="mini"
@@ -51,6 +52,7 @@
         action=""
         accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
         <el-button
+          v-if="name=='admin'||name=='kelly'"
           class="filter-item"
           type="primary"
           size="mini"
@@ -92,16 +94,16 @@
       <el-table-column align="center" label="期初库存" prop="openingInventory" />
       <el-table-column align="center" label="当前库存" prop="currentInventory" />
       <el-table-column align="center" label="单价" prop="price" />
-      <el-table-column align="center" label="单盒成本" prop="singleCost" />
+      <el-table-column v-if="name=='admin'||name=='kelly'" align="center" label="单盒成本" prop="singleCost"/>
       <el-table-column align="center" label="折扣" prop="discount" />
       <el-table-column align="center" label="折后价" prop="discountedPrice" />
       <el-table-column align="center" label="应收金额" prop="amountReceivable" />
       <el-table-column align="center" label="实收金额" prop="paidAmount" />
-      <el-table-column align="center" label="总成本" prop="totalCost" />
-      <el-table-column align="center" label="毛利润" prop="paidAmount" />
+      <el-table-column v-if="name=='admin'||name=='kelly'" align="center" label="总成本" prop="totalCost"/>
+      <el-table-column v-if="name=='admin'||name=='kelly'" align="center" label="毛利润" prop="paidAmount"/>
       <el-table-column align="center" label="支付方式" prop="payType" />
       <el-table-column align="center" label="备注" prop="remarks" />
-      <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
+      <el-table-column align="center" label="操作" class-name="small-padding" width="200px">
         <template slot-scope="scope">
           <el-button
             v-permission="['productSales:productsales:edit']"
@@ -264,6 +266,7 @@ export default {
           type: '银行转账'
         }
       ],
+      name: '',
       currentPage: 1,
       excelFreightspace: [],
       modification: [],
@@ -294,6 +297,8 @@ export default {
   created() {
     this.getList()
     this.currentPage = 1
+    debugger
+    this.name= this.$store.state.user.name
   },
   methods: {
     handleSizeChange(val) {