Przeglądaj źródła

剩余BV及流水查询

theo 3 lat temu
rodzic
commit
f46ab6139c

+ 2 - 0
backendApi/config/menu.php

@@ -50,6 +50,8 @@ return [
             ['name'=>'订单列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-list-export', 'routePath'=>'shop/order-list-export', 'show'=>0,],
             ['name'=>'订单PDF导出', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-list-export-pdf', 'routePath'=>'shop/order-list-export-pdf', 'show'=>0,],
             ['name'=>'订单发货', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-delivery', 'routePath'=>'shop/order-delivery', 'show'=>0,],
+            ['name'=>'Remain BV', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'remain-pv', 'routePath'=>'shop/remain-pv', 'show'=>1,], // 剩余BV
+            ['name'=>'Remain BV flow', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'flow-remain-pv', 'routePath'=>'shop/flow-remain-pv', 'show'=>1,], // 剩余BV流水
 //            ['name'=>'External mall order list', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-shop-list', 'routePath'=>'shop/order-shop-list', 'show'=>1,],//外部商城订单列表
             // ['name'=>'External mall entry list', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-dec-list', 'routePath'=>'shop/order-dec-list', 'show'=>1,],//外部商城报单列表
             // ['name'=>'List of qualified orders of external mall', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-standard-list', 'routePath'=>'shop/order-standard-list', 'show'=>1,],//外部商城达标订单列表

+ 2 - 0
backendApi/config/urlManagerRules.php

@@ -66,6 +66,8 @@ return [
             'POST import-order-standard' => 'import-order-standard',
             'GET order-list-export-pdf/<orderSn>' => 'order-list-export-pdf',
             'GET dec-order-list-export-pdf/<orderSn>' => 'dec-order-list-export-pdf',
+            'GET remain-pv' => 'remain-pv',
+            'GET flow-remain-pv' => 'flow-remain-pv',
         ],
     ],
     [

+ 34 - 0
backendApi/modules/v1/controllers/ShopController.php

@@ -17,6 +17,8 @@ use backendApi\modules\v1\models\lists\shop\OrderList;
 use backendApi\modules\v1\models\lists\shop\OrderShopList;
 use backendApi\modules\v1\models\lists\shop\OrderStandardList;
 use backendApi\modules\v1\models\lists\shop\PackageList;
+use backendApi\modules\v1\models\lists\shop\RemainPvList;
+use backendApi\modules\v1\models\lists\shop\FlowRemainPvList;
 use common\helpers\Cache;
 use common\helpers\Date;
 use common\helpers\Form;
@@ -735,4 +737,36 @@ class ShopController extends BaseController {
         }
         return static::notice('Illegal request', 400); // 非法请求
     }
+
+    /*
+     * 剩余BV页
+     *
+     */
+    public function actionRemainPv()
+    {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new RemainPvList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
+
+    /*
+     * 剩余BV流水
+     *
+     */
+    public function actionFlowRemainPv()
+    {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new FlowRemainPvList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
 }

+ 118 - 0
backendApi/modules/v1/models/lists/shop/FlowRemainPvList.php

@@ -0,0 +1,118 @@
+<?php
+
+namespace backendApi\modules\v1\models\lists\shop;
+
+use common\helpers\Cache;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\DataListInterface;
+use common\libs\dataList\column\DateTime;
+use common\models\FlowRemainPv;
+use Yii;
+
+class FlowRemainPvList extends \common\libs\dataList\DataList implements DataListInterface {
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName() {
+        return '剩余BV流水';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle() {
+        $this->listData = FlowRemainPv::lists($this->condition, $this->params, [
+            'select' => 'FR.*,U.USER_NAME,U.REAL_NAME,U.IS_DEC',
+            'orderBy' => 'FR.UPDATED_AT DESC,FR.ID DESC',
+            'from' => FlowRemainPv::tableName() . ' AS FR',
+            'join' => [
+                ['LEFT JOIN', \common\models\User::tableName() . ' AS U', 'FR.USER_ID=U.ID'],
+            ],
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        foreach ($this->listData['list'] as $key => $value) {
+//            $this->listData['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_STATUS']]['label'] ?? '';
+        }
+
+    }
+
+    /**
+     * 要展示和导出的所有字段
+     * @return array
+     */
+    public function getColumn() {
+        if (!$this->columns) {
+            $this->columns = [
+                'ID' => null,
+                'PERIOD_NUM' => [
+                    'header' => 'Period Number', // 期数
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'USER_NAME' => [
+                    'header' => 'Member code',//会员编号
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'valueOther' => [
+                        'tag' => ['type' => 'info', 'size' => 'small', 'class' => 'no-border']
+                    ],
+                ],
+                'REAL_NAME' => [
+                    'header' => 'Member name',//会员姓名
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                    'valueOther' => [
+                        'tag' => ['type' => 'success', 'size' => 'small', 'class' => 'no-border']
+                    ],
+                ],
+                'REMAIN_PV_FLOW' => [
+                    'header' => 'Remain Pv Flow',
+                    'headerOther' => [
+                        'width' => '150',
+                        'prop' => 'REMAIN_PV_FLOW',
+                    ],
+                ],
+                'REMAIN_PV_TOTAL' => [
+                    'header' => 'Remain Pv Total',
+                    'headerOther' => [
+                        'width' => '150',
+                        'prop' => 'REMAIN_PV_TOTAL',
+                    ],
+                ],
+                'UPDATED_AT' => [
+                    'header' => 'Updated Time',//创建时间
+                    'value' => function ($row) {
+                        return (new DateTime([
+                            'value' => $row['UPDATED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '170'],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes() {
+        if (!$this->filterTypes) {
+            $this->filterTypes = [
+                'UPDATED_AT' => ['isUserTable' => false, 'name' => 'Updated Time', 'other' => 'date'], // 创建时间
+                'PERIOD_NUM' => ['isUserTable' => false, 'name' => 'Period Number'], // 期数
+                'USER_NAME' => ['isUserTable' => false, 'name' => 'Member Code'], // 会员编号
+                'REAL_NAME' => ['isUserTable' => false, 'name' => 'Member Name'], // 会员姓名
+            ];
+        }
+        return $this->filterTypes;
+    }
+}

+ 104 - 0
backendApi/modules/v1/models/lists/shop/RemainPvList.php

@@ -0,0 +1,104 @@
+<?php
+
+namespace backendApi\modules\v1\models\lists\shop;
+
+use common\helpers\Cache;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\DataListInterface;
+use common\libs\dataList\column\DateTime;
+use common\models\RemainPv;
+use Yii;
+
+class RemainPvList extends \common\libs\dataList\DataList implements DataListInterface {
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName() {
+        return '剩余BV';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle() {
+        $this->listData = RemainPv::lists($this->condition, $this->params, [
+            'select' => 'FR.*,U.USER_NAME,U.REAL_NAME,U.IS_DEC',
+            'orderBy' => 'FR.UPDATED_AT DESC,FR.ID DESC',
+            'from' => RemainPv::tableName() . ' AS FR',
+            'join' => [
+                ['LEFT JOIN', \common\models\User::tableName() . ' AS U', 'FR.USER_ID=U.ID'],
+            ],
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        foreach ($this->listData['list'] as $key => $value) {
+//            $this->listData['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_STATUS']]['label'] ?? '';
+        }
+
+    }
+
+    /**
+     * 要展示和导出的所有字段
+     * @return array
+     */
+    public function getColumn() {
+        if (!$this->columns) {
+            $this->columns = [
+                'ID' => null,
+                'USER_NAME' => [
+                    'header' => 'Member code',//会员编号
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'valueOther' => [
+                        'tag' => ['type' => 'info', 'size' => 'small', 'class' => 'no-border']
+                    ],
+                ],
+                'REAL_NAME' => [
+                    'header' => 'Member name',//会员姓名
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                    'valueOther' => [
+                        'tag' => ['type' => 'success', 'size' => 'small', 'class' => 'no-border']
+                    ],
+                ],
+                'REMAIN_PV' => [
+                    'header' => 'Remain Pv',
+                    'headerOther' => [
+                        'width' => '150',
+                        'prop' => 'REMAIN_PV_FLOW',
+                    ],
+                ],
+                'UPDATED_AT' => [
+                    'header' => 'Updated Time',//创建时间
+                    'value' => function ($row) {
+                        return (new DateTime([
+                            'value' => $row['UPDATED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '170'],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes() {
+        if (!$this->filterTypes) {
+            $this->filterTypes = [
+                'UPDATED_AT' => ['isUserTable' => false, 'name' => 'Updated Time', 'other' => 'date'], // 创建时间
+                'USER_NAME' => ['isUserTable' => false, 'name' => 'Member Code'], // 会员编号
+                'REAL_NAME' => ['isUserTable' => false, 'name' => 'Member Name'], // 会员姓名
+            ];
+        }
+        return $this->filterTypes;
+    }
+}

+ 24 - 0
backendEle/src/router/index.js

@@ -153,6 +153,30 @@ export const constantRouterMap = [
           ],
         },
       },
+      {
+        path: '/shop/remain-pv',
+        component: _import('shop/remain-pv'),
+        name: 'shop_remain-pv',
+        meta: {
+          title: 'Remain BV', // 剩余BV
+          breadcrumb: [
+            {title: 'Dashboard', path: '/dashboard/index'}, // Dashboard
+            {title: 'Shopping Mall', path: '/shop/index'} // 商城管理
+          ],
+        },
+      },
+      {
+        path: '/shop/flow-remain-pv',
+        component: _import('shop/flow-remain-pv'),
+        name: 'shop_flow-remain-pv',
+        meta: {
+          title: 'Remain BV flow', // 剩余BV流水
+          breadcrumb: [
+            {title: 'Dashboard', path: '/dashboard/index'}, // Dashboard
+            {title: 'Shopping Mall', path: '/shop/index'} // 商城管理
+          ],
+        },
+      },
     ],
   },
   {

+ 90 - 0
backendEle/src/views/shop/flow-remain-pv.vue

@@ -0,0 +1,90 @@
+<template>
+  <div v-loading="loading">
+    <div class="white-box">
+      <div class="filter-box">
+        <filter-user :filter-types="filterTypes" @select-value="handleFilterUser"></filter-user>
+      </div>
+      <el-table class="table-box" ref="multipleTable" :data="tableData" stripe style="width: 100%;" :height="tool.getTableHeight()">
+        <el-table-column v-for="(tableHeader, key) in tableHeaders" :key="key" :label="tableHeader.header" :width="tableHeader.other.width ? tableHeader.other.width : ''" :prop="tableHeader.other.prop ? tableHeader.other.prop : null">
+          <template slot-scope="scope">
+            <template v-if="scope.row[tableHeader.index].other.tag" >
+              <el-tag :type="scope.row[tableHeader.index].other.tag.type ? scope.row[tableHeader.index].other.tag.type : null" :size="scope.row[tableHeader.index].other.tag.size ? scope.row[tableHeader.index].other.tag.size : null" :class="scope.row[tableHeader.index].other.tag.class ? scope.row[tableHeader.index].other.tag.class : null" >{{scope.row[tableHeader.index].value}}</el-tag>
+            </template>
+            <template v-else>
+              <div v-html="scope.row[tableHeader.index].value"></div>
+            </template>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="white-box-footer">
+        <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import network from '@/utils/network'
+import tool from '@/utils/tool'
+import baseInfo from '@/utils/baseInfo'
+import FilterUser from '../../components/FilterUser'
+import permission from '@/utils/permission'
+import Pagination from '@/components/Pagination'
+import filterHelper from '@/utils/filterHelper'
+
+export default {
+  name: 'shop_flow-remain-pv',
+  components: {FilterUser, Pagination},
+  mounted () {
+    this.getData()
+  },
+  data () {
+    return {
+      tableHeaders: null,
+      tableData: null,
+      loading: true,
+      multipleSelection: [],
+      currentPage: 1,
+      totalPages: 1,
+      totalCount: 1,
+      pageSize: 20,
+      tool: tool,
+      permission: permission,
+      baseDecLevels: baseInfo.decLevels(),
+      baseEmpLevels: baseInfo.empLevels(),
+      filterTypes: null,
+      filterModel: {}
+    }
+  },
+  methods: {
+    handleCurrentChange (page) {
+      this.getData(page, this.pageSize)
+    },
+    handleSizeChange (pageSize) {
+      this.getData(this.currentPage, pageSize)
+    },
+    handleFilterUser (filterData) {
+      filterHelper.handleFilterUser(this, filterData)
+    },
+    getData (page, pageSize) {
+      network.getPageData(this, 'shop/flow-remain-pv', page, pageSize, this.filterModel, response => {
+        this.filterTypes = response.filterTypes
+      })
+    }
+  }
+}
+
+</script>
+
+<style scoped>
+  .table-box .el-form-item__label {
+    width: 100px;
+    color: #99a9bf;
+  }
+
+  .table-box .el-form-item {
+    width: 30%;
+    margin-right: 0;
+    margin-bottom: 0;
+  }
+</style>

+ 90 - 0
backendEle/src/views/shop/remain-pv.vue

@@ -0,0 +1,90 @@
+<template>
+  <div v-loading="loading">
+    <div class="white-box">
+      <div class="filter-box">
+        <filter-user :filter-types="filterTypes" @select-value="handleFilterUser"></filter-user>
+      </div>
+      <el-table class="table-box" ref="multipleTable" :data="tableData" stripe style="width: 100%;" :height="tool.getTableHeight()">
+        <el-table-column v-for="(tableHeader, key) in tableHeaders" :key="key" :label="tableHeader.header" :width="tableHeader.other.width ? tableHeader.other.width : ''" :prop="tableHeader.other.prop ? tableHeader.other.prop : null">
+          <template slot-scope="scope">
+            <template v-if="scope.row[tableHeader.index].other.tag" >
+              <el-tag :type="scope.row[tableHeader.index].other.tag.type ? scope.row[tableHeader.index].other.tag.type : null" :size="scope.row[tableHeader.index].other.tag.size ? scope.row[tableHeader.index].other.tag.size : null" :class="scope.row[tableHeader.index].other.tag.class ? scope.row[tableHeader.index].other.tag.class : null" >{{scope.row[tableHeader.index].value}}</el-tag>
+            </template>
+            <template v-else>
+              <div v-html="scope.row[tableHeader.index].value"></div>
+            </template>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="white-box-footer">
+        <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import network from '@/utils/network'
+import tool from '@/utils/tool'
+import baseInfo from '@/utils/baseInfo'
+import FilterUser from '../../components/FilterUser'
+import permission from '@/utils/permission'
+import Pagination from '@/components/Pagination'
+import filterHelper from '@/utils/filterHelper'
+
+export default {
+  name: 'shop_remain-pv',
+  components: {FilterUser, Pagination},
+  mounted () {
+    this.getData()
+  },
+  data () {
+    return {
+      tableHeaders: null,
+      tableData: null,
+      loading: true,
+      multipleSelection: [],
+      currentPage: 1,
+      totalPages: 1,
+      totalCount: 1,
+      pageSize: 20,
+      tool: tool,
+      permission: permission,
+      baseDecLevels: baseInfo.decLevels(),
+      baseEmpLevels: baseInfo.empLevels(),
+      filterTypes: null,
+      filterModel: {}
+    }
+  },
+  methods: {
+    handleCurrentChange (page) {
+      this.getData(page, this.pageSize)
+    },
+    handleSizeChange (pageSize) {
+      this.getData(this.currentPage, pageSize)
+    },
+    handleFilterUser (filterData) {
+      filterHelper.handleFilterUser(this, filterData)
+    },
+    getData (page, pageSize) {
+      network.getPageData(this, 'shop/remain-pv', page, pageSize, this.filterModel, response => {
+        this.filterTypes = response.filterTypes
+      })
+    }
+  }
+}
+
+</script>
+
+<style scoped>
+  .table-box .el-form-item__label {
+    width: 100px;
+    color: #99a9bf;
+  }
+
+  .table-box .el-form-item {
+    width: 30%;
+    margin-right: 0;
+    margin-bottom: 0;
+  }
+</style>