natasha před 1 rokem
rodič
revize
1022a0f12e

+ 1 - 1
src/components/Header.vue

@@ -51,7 +51,7 @@ export default {
   methods: {
     // 切换登录的注册
     cutLoginReg() {
-      window.location.href = "/";
+      window.location.href = "https://"+window.location.host+"/21st_manager/";
     },
     QuitLogin() {
       removeToken();

+ 5 - 0
src/router/index.js

@@ -154,6 +154,11 @@ export const constantRoutes = [{
         component: () =>
             import ('@/views/content_manage/newspaper_manage/CreateArticle.vue')
     },
+    {
+        path: '/flow_manage',
+        component: () =>
+            import ('@/views/finance_manage/FlowManage.vue')
+    },
     // 404 page must be placed at the end !!!
     { path: '*', redirect: '/', hidden: true }
 ]

+ 1 - 1
src/utils/request.js

@@ -75,7 +75,7 @@ service.interceptors.response.use(
             if (process.env.NODE_ENV === 'development') {
                 router.push(`/login`)
             } else {
-                window.location.href = '/';
+                window.location.href = "https://" + window.location.host + "/21st_manager/#/login";
             }
             return false
         } else {

+ 656 - 0
src/views/finance_manage/FlowManage.vue

@@ -0,0 +1,656 @@
+<template>
+  <div class="manage-root">
+    <Header />
+    <div class="manage-root-contain">
+        <nav-menu class="manage-root-contain-left" :activeMenuIndex="activeMenuIndex"></nav-menu>
+        <div class="manage-root-contain-right ">
+            <breadcrumb :breadcrumbList="breadcrumbList" class="breadcrumb-box"></breadcrumb>
+            <div class="personal-inner">
+                <div class="common-title-box">
+                    <h3>交易流水</h3>
+                    <div class="btn-box">
+                        <ul class="quick-search">
+                            <li v-for="(itemq,indexq) in quickList" :key="indexq">
+                                <a @click="qucikSearch(itemq.value,indexq)" :class="[quickIndex===indexq?'active':'']">{{itemq.label}}</a>
+                                <span class="border" :class="[indexq!==quickList.length-1&&quickIndex!==indexq&&quickIndex-1!==indexq?'':'border-no']"></span>
+                            </li>
+                        </ul>
+                        <el-button type="primary" size="small" @click="handleEdit()">导出报表</el-button>
+                    </div>
+                </div>
+                <div class="proceeds-box">
+                    <h6>收款<span>({{proceedsNumber}}单)</span></h6>
+                    <label v-if="proceedsPriceArr.length==2">¥{{proceedsPriceArr[0]}}.<b>{{proceedsPriceArr[1]}}</b><span>元</span></label>
+                </div>
+                <div class="search-box">
+                    <div class="search-item">
+                        <label>搜索</label>
+                        <el-input
+                            placeholder="商品名称、购买者、交易单号"
+                            v-model="searchInput">
+                            <i slot="suffix" class="el-input__icon el-icon-search" @click="getList(1)" style="cursor: pointer;"></i>
+                        </el-input>
+                    </div>
+                    <div class="search-item">
+                        <label>交易时间</label>
+                        <el-date-picker
+                            v-model="validity"
+                            type="daterange"
+                            size="small"
+                            range-separator="-"
+                            start-placeholder="开始日期"
+                            end-placeholder="结束日期"
+                            value-format="yyyy-MM-dd"
+                            @change="getList(1)">
+                        </el-date-picker>
+                    </div>
+                    <div class="search-item">
+                        <label>学段</label>
+                        <el-select v-model="searchStudy" @change="getList(1)" placeholder="请选择">
+                            <el-option
+                                v-for="item in $studyTypeAll"
+                                :key="item.study_phase"
+                                :label="item.study_phase_name"
+                                :value="item.study_phase">
+                            </el-option>
+                        </el-select>
+                    </div>
+                    <div class="search-item">
+                        <label>商品类型</label>
+                        <el-select v-model="searchGoodsType" @change="getList(1)" placeholder="请选择">
+                            <el-option
+                                v-for="item in goodsTypeList"
+                                :key="item.value"
+                                :label="item.goods_name"
+                                :value="item.value">
+                            </el-option>
+                        </el-select>
+                    </div>
+                    <div class="search-item">
+                        <label>是否使用兑换码</label>
+                        <el-select v-model="searchIsCDKEY" @change="getList(1)" placeholder="请选择">
+                            <el-option
+                                v-for="item in isCDKEYList"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
+                            </el-option>
+                        </el-select>
+                    </div>
+                    <div class="search-item">
+                        <label>交易状态</label>
+                        <el-select v-model="searchStatus" @change="getList(1)" placeholder="请选择">
+                            <el-option
+                                v-for="item in transactionList"
+                                :key="item.status"
+                                :label="item.status_name"
+                                :value="item.status">
+                            </el-option>
+                        </el-select>
+                    </div>
+                    <div class="search-item">
+                        <label>客户所在机构</label>
+                        <el-select v-model="searchOrgid" @change="getList(1)" placeholder="请选择">
+                            <el-option
+                                v-for="item in orgList"
+                                :key="item.id"
+                                :label="item.name"
+                                :value="item.id">
+                            </el-option>
+                        </el-select>
+                    </div>
+                    <div class="search-item">
+                        <label>客户所在省市</label>
+                        <el-cascader
+                            size="medium"
+                            :options="$provinceCityListAll"
+                            v-model="searchArea"
+                            :props="props"
+                            collapse-tags
+                            clearable
+                            @change="getList(1)">
+                        </el-cascader>
+                    </div>
+                    <div class="search-item">
+                        <label>支付渠道</label>
+                        <el-select v-model="searchChannel" @change="getList(1)" placeholder="请选择">
+                            <el-option
+                                v-for="item in channelList"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
+                            </el-option>
+                        </el-select>
+                    </div>
+                </div>
+                <el-table
+                    class="search-table"
+                    :data="tableData"
+                    style="width: 100%"
+                    @sort-change="handleSort"
+                    :default-sort = dataSort
+                    :max-height="tableHeight">
+                    <el-table-column
+                        prop="user_name"
+                        label="用户名"
+                        sortable="custom"
+                        width="200"
+                        class-name="user-info">
+                        <template slot-scope="scope">
+                            <el-image
+                                class="touxiang"
+                                :src="scope.row.image_url?scope.row.image_url:require('../../assets/avatar.png')"
+                                fit="cover" style="width:24px;height:24px;margin-right:8px">
+                            </el-image>
+                            <!-- <img class="touxiang" :src="scope.row.image_url?scope.row.image_url:require('../../assets/avatar.png')" /> -->
+                            <span class="name">{{scope.row.user_name}}</span>
+                        </template>
+                    </el-table-column>
+                    <el-table-column
+                        prop="real_name"
+                        label="真实姓名"
+                        width="112">
+                    </el-table-column>
+                    <el-table-column
+                        prop="sex_name"
+                        label="性别"
+                        width="56">
+                    </el-table-column>
+                    <el-table-column
+                        prop="account_type_name"
+                        label="账户类型"
+                        width="120" >
+                    </el-table-column>
+                    <el-table-column
+                        prop="email"
+                        label="邮箱"
+                        min-width="200">
+                    </el-table-column>
+                    <el-table-column
+                        prop="phone"
+                        label="手机号"
+                        width="144">
+                    </el-table-column>
+                    <el-table-column
+                        prop="status"
+                        label="状态"
+                        width="96" >
+                        <template slot-scope="scope">
+                            <div class="status-box">
+                                <span :style="{background:statusList[scope.row.status].bg}"></span>
+                                <b :style="{color:statusList[scope.row.status].color}">{{statusList[scope.row.status].text}}</b>
+                            </div>
+                        </template>
+                    </el-table-column>
+                    <el-table-column
+                        prop="create_time"
+                        label="创建时间"
+                        sortable="custom"
+                        width="160">
+                        <template slot-scope="scope">
+                            {{scope.row.create_time?scope.row.create_time.substring(0,16):'-'}}
+                        </template>
+                    </el-table-column>
+                    <el-table-column
+                        fixed="right"
+                        label="操作"
+                        width="120">
+                        <template slot-scope="scope">
+                            <el-button
+                                @click.native.prevent="handleEdit(scope.row)"
+                                type="text"
+                                size="small"
+                                class="primary-btn">
+                                编辑
+                            </el-button>
+                            <el-button
+                                @click.native.prevent="handleUp(scope.row, scope.$index)"
+                                type="text"
+                                size="small"
+                                class="primary-btn"
+                                v-if="scope.row.status===0">
+                                开启
+                            </el-button>
+                            <el-button
+                                @click.native.prevent="handleUp(scope.row, scope.$index)"
+                                type="text"
+                                size="small"
+                                class="red-btn"
+                                v-else-if="scope.row.status===1">
+                                停用
+                            </el-button>
+                        </template>
+                    </el-table-column>
+                </el-table>
+                <el-pagination
+                    background
+                    @size-change="handleSizeChange"
+                    @current-change="handleCurrentChange"
+                    :current-page="pageNumber"
+                    :page-sizes="[10, 20, 30, 40]"
+                    :page-size="pageSize"
+                    layout="total, prev, pager, next, sizes, jumper"
+                    :total="total_count">
+                </el-pagination>
+            </div>
+        </div>
+    </div>
+  </div>
+</template>
+
+<script>
+//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+//例如:import 《组件名称》from ‘《组件路径》';
+import Header from "../../components/Header.vue";
+import NavMenu from "../../components/NavMenu.vue"
+import Breadcrumb from '../../components/Breadcrumb.vue';
+import { getLogin } from "@/api/ajax";
+import { mapState } from 'vuex';
+import { cutMoneyFiter } from '@/utils/defined';
+
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: { Header, NavMenu, Breadcrumb },
+  props: {},
+  filters:{
+    cutMoneyFiter,
+  },
+  data() {
+    //这里存放数据
+    return {
+        activeMenuIndex: "flow_manage",
+        breadcrumbList:[
+            {
+                icon:'money-cny-box-line',
+                url:'',
+                text:''
+            },
+            {
+                icon:'',
+                url:'',
+                notLink: true,
+                text:'财务中心'
+            },
+            {
+                icon:'',
+                url:'',
+                text:'交易管理'
+            }
+        ],
+        quickList:[
+            {
+                label:'最近一年',
+                value: -365
+            },
+            {
+                label: '最近一季',
+                value: -120
+            },
+            {
+                label: '最近一月',
+                value: -30
+            },
+            {
+                label: '最近一周',
+                value: -7
+            },
+            {
+                label: '最近一天',
+                value: -1
+            }
+        ], // 快速查询
+        searchInput: '',
+        searchQuick:null,
+        quickIndex: null, // 快速搜索的索引
+        proceedsNumber:'1209', // 收款单数
+        proceedsPrice: 789474, // 收款金额
+        proceedsPriceArr: [],
+        searchType: -1,
+        validity:'',
+        searchStudy: -1,
+        searchStatus: -1,
+        searchGoodsType: -1,
+        searchIsCDKEY: -1,
+        searchOrgid: '',
+        searchArea: [],
+        searchChannel: -1,
+        channelList:[
+            {
+                label: '全部',
+                value: -1
+            },
+            {
+                label: '支付宝',
+                value: 1
+            },
+            {
+                label: '微信支付',
+                value: 2
+            }
+        ],
+        orgList:[
+            {
+                name: '全部',
+                id: ''
+            }
+        ],
+        isCDKEYList: [
+            {
+                label: '全部',
+                value: -1
+            },
+            {
+                label: '已使用',
+                value: 1
+            },
+            {
+                label: '未使用',
+                value: 2
+            }
+        ], // 是否使用兑换码
+        transactionList: [
+            {
+                status_name: '全部',
+                status: -1
+            },
+            {
+                status_name: '支付成功',
+                status: 1
+            },
+            {
+                status_name: '兑换成功',
+                status: 2
+            }
+        ], //交易状态列表
+        goodsTypeList:[
+            {
+                goods_name: '全部',
+                value: -1
+            },
+            {
+                goods_name: '报纸(讲解版)',
+                value: 1
+            },
+            {
+                goods_name: '报纸订阅',
+                value: 2
+            },
+            {
+                goods_name: '报纸',
+                value: 3
+            },
+            {
+                goods_name: '课程',
+                value: 4
+            }
+        ], // 商品类型
+        typeList:[
+            {
+                account_type:-1,
+                account_type_name:'全部'
+            }
+        ],
+        statusList:{
+            1:{
+                text:'正常',
+                bg:'#165DFF',
+                color:''
+            },
+            0:{
+                text:'停用',
+                bg:'#F53F3F',
+                color:'#F53F3F'
+            }
+        },
+        tableData:[],
+        pageSize: window.localStorage.getItem('pageSize')?Number(window.localStorage.getItem('pageSize')):10, 
+        pageNumber: window.localStorage.getItem('pageNumber')?Number(window.localStorage.getItem('pageNumber')):1,
+        tableHeight: "", // 表格高度
+        total_count: 0,
+        dataSort: {},
+        props: { multiple: true },
+    }
+  },
+  //计算属性 类似于data概念
+  computed: {
+    ...mapState(['$studyTypeAll','$provinceCityListAll']),
+  },
+  //监控data中数据变化
+  watch: {},
+  //方法集合
+  methods: {
+    qucikSearch(value,index){
+        this.searchQuick = value,
+        this.quickIndex = index
+    },
+    handleSort(value){
+        let dataSort = {
+            prop: value.prop,
+            order: value.order
+        }
+        this.dataSort = dataSort
+        this.getList()
+    },
+    // 查询列表
+    getList(page){
+        if(page){
+            this.pageNumber = page
+        }
+        // searchArea需要取[1]
+        let MethodName = "/OrgServer/Manager/PageQuery/PageQuerySysUserList";
+        let order_column_list = []
+        if(this.dataSort != {}){
+            if(this.dataSort.order=='descending'){
+                order_column_list = [this.dataSort.prop + ':desc']
+            }else if(this.dataSort.order=='ascending'){
+                // 升序不传值
+                order_column_list = [this.dataSort.prop]
+            }else{
+                order_column_list = ['create_time:desc']
+            }
+        }else{
+            order_column_list = ['create_time:desc']
+        }
+        let data = {
+            search_content:this.searchInput.trim(),
+            account_type:this.searchType,
+            status:this.searchStatus,
+            page_capacity:this.pageSize,
+            cur_page:this.pageNumber,
+            order_column_list: order_column_list
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            if(res.status===1){
+               this.tableData = res.sys_user_list
+               this.total_count = res.total_count
+            }
+        })
+        .catch(() => {
+            this.loading = false
+        });
+    },
+    // 导出报表
+    handleEdit(){
+        // 根据登录用户判断当前用户有没有导出权限
+
+    },
+    // 停用 启用
+    handleUp(row, index) {
+      let Mname = "/OrgServer/Manager/SysUserManager/EnableSysUser";
+      let updataData = JSON.parse(JSON.stringify(row));
+      let data = {
+        id: row.id
+      };
+      if (row.status === 0) {
+        // 下架状态
+        data.is_enable = "true";
+        updataData.status = 1;
+      } else if (row.status === 1) {
+        data.is_enable = "false";
+        updataData.status = 0;
+      }
+      getLogin(Mname, data).then(res => {
+        this.$message.success("操作成功");
+        this.$set(this.tableData, index, updataData);
+      });
+    },
+    handleSizeChange(val) {
+        this.pageSize = val
+        this.pageNumber = 1
+        this.getList()
+    },
+    handleCurrentChange(val) {
+        this.pageNumber = val
+        this.getList()
+    },
+    //计算table高度(动态设置table高度)
+    getTableHeight() {
+      let tableH = 370; //距离页面下方的高度
+      let tableHeightDetil = window.innerHeight - tableH;
+      if (tableHeightDetil <= 300) {
+        this.tableHeight = 300;
+      } else {
+        this.tableHeight = window.innerHeight - tableH;
+      }
+    },
+    // 用户类型列表
+    getOrgList(){
+        let MethodName = "/OrgServer/Client/OrgManager/GetOrgIndexList";
+        let data = {
+            name: '',
+            status: 1,
+            sn: ''
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            if(res.status===1){
+                this.orgList = [
+                    {
+                        name: '全部',
+                        id: ''
+                    }
+                ]
+                this.orgList = this.orgList.concat(res.org_index_list)
+            }
+        })
+        .catch(() => {
+            this.loading = false
+        });
+    }
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.getTableHeight();
+    this.getOrgList()
+    this.getList()
+    this.proceedsPriceArr = cutMoneyFiter(this.proceedsPrice).split('.')
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+
+  },
+  //生命周期-创建之前
+  beforeCreated() { },
+  //生命周期-挂载之前
+  beforeMount() { },
+  //生命周期-更新之前
+  beforUpdate() { },
+  //生命周期-更新之后
+  updated() { },
+  //生命周期-销毁之前
+  beforeDestory() { },
+  //生命周期-销毁完成
+  destoryed() { },
+  //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() { }
+}
+</script>
+<style lang="scss" scoped>
+/* @import url(); 引入css类 */
+</style>
+<style lang="scss">
+.btn-box{
+    display: flex;
+}
+.quick-search{
+    display: flex;
+    list-style: none;
+    padding: 3px;
+    margin: 0 24px;
+    align-items: center;
+    border-radius: 2px;
+    background: #F2F3F5;
+    li{
+        display: flex;
+        align-items: center;
+        a{
+            padding: 2px 12px;
+            color: #4E5969;
+            font-size: 14px;
+            font-weight: 400;
+            line-height: 22px;
+            border-radius: 2px;
+            cursor: pointer;
+            &.active{
+                background: #fff;
+                color: #165DFF;
+                font-weight: 500;
+            }
+        }
+        span{
+            height: 14px;
+            width: 1px;
+            background: #E5E6EB;
+            &.border-no{
+                background: #F2F3F5;
+            }
+        }
+    }
+}
+.proceeds-box{
+    border-radius: 2px;
+    background: #F7F8FA;
+    padding: 16px;
+    margin-top: 24px;
+    h6{
+        color: #1D2129;
+        font-size: 16px;
+        font-weight: 400;
+        line-height: 22px;
+        margin: 0 0 8px 0;
+        span{
+            color:#86909C;
+            font-size: 12px;
+            font-weight: 400;
+            line-height: 20px; 
+        }
+    }
+    label{
+        color: #1D2129;
+        font-size: 22px;
+        font-weight: 700;
+        line-height: 24px;
+        b{
+            font-size: 14px;
+            font-weight: 700;
+            line-height: 24px;
+        }
+        span{
+            color:#4E5969;
+            font-size: 12px;
+            font-weight: 400;
+            line-height: 20px; 
+        } 
+    }
+}
+.el-range-editor--small .el-range-input{
+    background: #F2F3F5;
+}
+.search-item{
+    margin-bottom: 20px;
+}
+.search-table{
+    margin-top: 0;
+}
+</style>

+ 0 - 20
src/views/organize_manage/index.vue

@@ -251,7 +251,6 @@ export default {
         tableHeight: "", // 表格高度
         total_count: 0,
         dataSort: {},
-        province_list:[],
         props: {
           lazy: true,
           lazyLoad (node, resolve) {
@@ -417,30 +416,11 @@ export default {
             }
         });
     },
-    // 获取省份列表
-    getProvinceList(){
-        let MethodName = "/OrgServer/DictManager/GetProvinceList";
-        getLogin(MethodName, {})
-        .then((res) => {
-            if(res.status===1){
-               res.province_list.forEach(item => {
-                    item.children = []
-                    item.label = item.name
-                    item.value = item.id
-               });
-               this.province_list = res.province_list
-            }
-        })
-        .catch(() => {
-            this.loading = false
-        });
-    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
     this.getCreatorList()
     this.getTableHeight();
-    this.getProvinceList()
     this.getList()
   },
   //生命周期 - 挂载完成(可以访问DOM元素)