Browse Source

2023-12-30

cmy 1 year ago
parent
commit
bc1c5c63c9

+ 41 - 3
src/api/shareholder.js

@@ -11,7 +11,7 @@ import request from '@/plugins/request';
  */
 export function updateShareholdingRecord (data) {
     return request({
-        url: 'stockRights/updateShareholdingRecord',
+        url: '/stockRights/updateShareholdingRecord',
         method: 'post',
         data
     });
@@ -34,7 +34,7 @@ export function updateShareholdingRecord (data) {
  */
 export function addShareholder (data) {
     return request({
-        url: 'stockRights/addShareholder',
+        url: '/stockRights/addShareholder',
         method: 'post',
          data
     });
@@ -46,9 +46,47 @@ export function addShareholder (data) {
  */
 export function deleteShareholder (data) {
     return request({
-        url: 'stockRights/deleteShareholder',
+        url: '/stockRights/deleteShareholder',
         method: 'post',
         data
     });
 }
 
+/**
+ * @description 分红发放记录
+ * @param {Object} param data {Object} 传值参数 type类型
+ */
+export function monthShareholderList (data) {
+    return request({
+        url: '/stockRights/monthShareholderList',
+        method: 'get',
+        params:data
+    });
+}
+
+/**
+ * @description 分红发放记录详细
+ * @param {Object} param data {Object} 传值参数 type类型
+ */
+export function stocklst (data) {
+    return request({
+        url: 'stockRights/lst',
+        method: 'get',
+        params: data,
+    });
+}
+
+/**
+ * @description 股权发放记录
+ * @param {Object} param data {Object} 传值参数 type类型
+ */
+export function userShareholderList (data) {
+    return request({
+        url: '/stockRights/userShareholderList',
+        method: 'get',
+        params: data,
+    });
+}
+
+
+

+ 312 - 288
src/pages/user/shareholder/bonus.vue

@@ -1,293 +1,317 @@
 <template>
-<!-- 用户-会员管理-等级列表 -->
-    <div>
-       <Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
-            <div class="new_card_pd">
-                <!-- 筛选条件 -->
-                 <Form ref="levelFrom" :model="levelFrom" inline :label-width="labelWidth" :label-position="labelPosition" @submit.native.prevent>
-                    <FormItem label="状态:"  label-for="status1">
-                        <Select v-model="levelFrom.is_show" placeholder="请选择" clearable element-id="status1" style="width:250px;">
-                            <Option value="1">显示</Option>
-                            <Option value="0">不显示</Option>
-                        </Select>
-                    </FormItem>
-                    <FormItem label="等级名称:"  label-for="title">
-                        <Input  v-model="levelFrom.title"  placeholder="请输入等级名称" style="width:250px;margin-right:14px;"/>
-                        <Button type="primary" @click="userSearchs">查询</Button>
-                    </FormItem>
-                </Form>
-            </div>
-        </Card>
-        <Card :bordered="false" dis-hover class="ivu-mt">
-            <!-- 相关操作 -->
-            <Button v-auth="['admin-user-level_add']" type="primary" @click="add">添加会员等级</Button>
-            <!-- 等级列表表格 -->
-            <Table :columns="columns1" :data="levelLists" ref="table" class="mt25"
-                   :loading="loading" highlight-row
-                   no-userFrom-text="暂无数据"
-                   no-filtered-userFrom-text="暂无筛选结果">
-                <template slot-scope="{ row, index }" slot="icons">
-                    <viewer>
-                        <div class="tabBox_img">
-                            <img v-lazy="row.icon">
-                        </div>
-                    </viewer>
-                </template>
-                <template slot-scope="{ row, index }" slot="is_forevers">
-                    <i-switch v-model="row.is_forever" :value="row.is_forever" :true-value="1" :false-value="0" :disabled="true" size="large">
-                        <span slot="open">永久</span>
-                        <span slot="close">非永久</span>
-                    </i-switch>
-                </template>
-                <template slot-scope="{ row, index }" slot="is_pays">
-                    <i-switch v-model="row.is_pay" :value="row.is_pay" :true-value="1" :false-value="0"  :disabled="true" size="large">
-                        <span slot="open">付费</span>
-                        <span slot="close">免费</span>
-                    </i-switch>
-                </template>
-                <template slot-scope="{ row, index }" slot="is_shows">
-                    <i-switch v-model="row.is_show" :value="row.is_show" :true-value="1" :false-value="0" @on-change="onchangeIsShow(row)" size="large">
-                        <span slot="open">显示</span>
-                        <span slot="close">隐藏</span>
-                    </i-switch>
-                </template>
-                <template slot-scope="{ row, index }" slot="action">
-                    <a @click="edit(row)">编辑</a>
-                    <Divider type="vertical" />
-                    <a @click="changeMenu(row,2,index)">删除</a>
-<!--                    <template>-->
-<!--                        <Dropdown @on-click="changeMenu(row,$event,index)">-->
-<!--                            <a href="javascript:void(0)">-->
-<!--                                更多-->
-<!--                                <Icon type="ios-arrow-down"></Icon>-->
-<!--                            </a>-->
-<!--                            <DropdownMenu slot="list">-->
-<!--&lt;!&ndash;                                <DropdownItem name="1">等级任务</DropdownItem>&ndash;&gt;-->
-<!--                                <DropdownItem name="2">删除等级</DropdownItem>-->
-<!--                            </DropdownMenu>-->
-<!--                        </Dropdown>-->
-<!--                    </template>-->
-                </template>
-            </Table>
-            <div class="acea-row row-right page">
-                <Page :total="total" :current="levelFrom.page" show-elevator show-total @on-change="pageChange"
-                      :page-size="levelFrom.limit"/>
-            </div>
-        </Card>
-        <!-- 等级任务-->
-        <task-list ref="tasks"></task-list>
-    </div>
+	<!-- 用户-会员管理-等级列表 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Tabs value="type1">
+				<TabPane label="每月发放记录" name="type1">
+					<!-- 每月发放记录表格 -->
+					<Table :columns="columns1" :data="list" ref="table" :loading="loading" highlight-row
+						no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+						<template slot-scope="{ row, index }" slot="initial_share">
+							<div>
+								数量:{{row.initial_share_count}}
+							</div>
+							<div>
+								占比:{{row.initial_ratio}}%
+							</div>
+							<div>
+								分润:{{row.grant_initial_price}}
+							</div>
+							<div>
+								单股:{{row.one_price}}
+							</div>
+						</template>
+
+						<template slot-scope="{ row, index }" slot="bonus_share">
+							<div>
+								数量:{{row.bonus_share_count}}
+							</div>
+							<div>
+								占比:{{row.bonus_ratio}}%
+							</div>
+							<div>
+								分润:{{row.grant_bonus_price}}
+							</div>
+							<div>
+								单股:{{row.two_price}}
+							</div>
+						</template>
+
+						<template slot-scope="{ row, index }" slot="action">
+							<a @click="changeholder(row)">详情</a>
+						</template>
+					</Table>
+					<div class="acea-row row-right page">
+						<Page :total="total" :current="listFrom.page" show-elevator show-total @on-change="pageChange"
+							:page-size="listFrom.limit" />
+					</div>
+				</TabPane>
+				<TabPane label="详细记录" name="type2">
+					<div class="new_card_pd">
+						<!-- 筛选条件 -->
+						<Form ref="levelFrom" :model="detailFrom" inline :label-width="labelWidth" :label-position="labelPosition"
+							@submit.native.prevent>
+							<FormItem label="发放时间" label-for="status1">
+								<Select v-model="detailFrom.shareholding_record_id" placeholder="请选择" clearable filterable style="width:250px;">
+									<Option v-for="item in list" :value="item.id">{{item.create_time+"("+item.id+")"}}</Option>
+								</Select>
+								<Button type="primary" @click="searchs">查询</Button>
+							</FormItem>
+						</Form>
+					</div>
+					
+					
+					<!-- 分红详细记录表格 -->
+					<Table :columns="columns2" :data="detailList" ref="table" :loading="detailloading" highlight-row
+						no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+						<template slot-scope="{ row, index }" slot="initial_share">
+							<div>
+								数量:{{row.initial_share_count}}
+							</div>
+							<div>
+								占比:{{row.initial_ratio}}%
+							</div>
+							<div>
+								分润:{{row.grant_initial_price}}
+							</div>
+							<div>
+								单股:{{row.one_price}}
+							</div>
+						</template>
+
+						<template slot-scope="{ row, index }" slot="bonus_share">
+							<div>
+								数量:{{row.bonus_share_count}}
+							</div>
+							<div>
+								占比:{{row.bonus_ratio}}%
+							</div>
+							<div>
+								分润:{{row.grant_bonus_price}}
+							</div>
+							<div>
+								单股:{{row.two_price}}
+							</div>
+						</template>
+
+						<template slot-scope="{ row, index }" slot="action">
+							<a @click="changeholder(row)">详情</a>
+						</template>
+					</Table>
+					<div class="acea-row row-right page">
+						<Page :total="detailtotal" :current="detailFrom.page" show-elevator show-total
+							@on-change="detailPageChange" :page-size="detailFrom.limit" />
+					</div>
+				</TabPane>
+			</Tabs>
+
+		</Card>
+
+	</div>
 </template>
 <script>
-    import { mapState, mapMutations } from 'vuex';
-    import { levelListApi, setShowApi, createApi } from '@/api/user';
-    import editFrom from '@/components/from/from';
-    export default {
-        name: 'user_level',
-        components: { editFrom },
-        data () {
-            return {
-                grid: {
-                    xl: 7,
-                    lg: 7,
-                    md: 12,
-                    sm: 24,
-                    xs: 24
-                },
-                loading: false,
-                columns1: [
-                    {
-                        title: 'ID',
-                        key: 'id',
-                        width: 80
-                    },
-                    {
-                        title: '等级图标',
-                        slot: 'icons',
-                        minWidth: 100
-                    },
-                    {
-                        title: '等级名称',
-                        key: 'name',
-                        minWidth: 120
-                    },
-                    {
-                        title: '等级',
-                        key: 'grade',
-                        minWidth: 100
-                    },
-                    {
-                        title: '享受折扣(%)',
-                        key: 'discount',
-                        minWidth: 100
-                    },
-                    // {
-                    //     title: '有效时间',
-                    //     key: 'valid_date',
-                    //     minWidth: 120
-                    // },
-                    // {
-                    //     title: '是否永久',
-                    //     slot: 'is_forevers',
-                    //     minWidth: 130
-                    // },
-                    // {
-                    //     title: '是否付费',
-                    //     slot: 'is_pays',
-                    //     minWidth: 120
-                    // },
-                    {
-                        title: '是否显示',
-                        slot: 'is_shows',
-                        minWidth: 120
-                    },
-                    {
-                        title: '等级说明',
-                        key: 'explain',
-                        minWidth: 120
-                    },
-                    {
-                        title: '操作',
-                        slot: 'action',
-                        fixed: 'right',
-                        minWidth: 120
-                    }
-                ],
-                levelFrom: {
-                    is_show: '',
-                    title: '',
-                    page: 1,
-                    limit: 10
-                },
-                levelLists: [],
-                total: 0,
-                FromData: null,
-                imgName: '',
-                visible: false,
-                levelId: 0,
-                modalTitleSs: '',
-                titleType: 'level',
-                modelTask: false,
-                num: 0
-            }
-        },
-        created () {
-            this.getList();
-        },
-        computed: {
-            ...mapState('admin/layout', [
-                'isMobile'
-            ]),
-            labelWidth () {
-                return this.isMobile ? undefined : 96;
-            },
-            labelPosition () {
-                return this.isMobile ? 'top' : 'right';
-            }
-        },
-        methods: {
-            ...mapMutations('admin/userLevel', [
-                'getlevelId'
-            ]),
-            // 操作
-            changeMenu (row, name, num) {
-                this.levelId = row.id;
-                switch (name) {
-                case '1':
-                    this.getlevelId(this.levelId);
-                    this.$refs.tasks.modals = true;
-                    this.$refs.tasks.getList();
-                    break;
-                default:
-                    this.del(row, '删除等级', num);
-                }
-            },
-            // 删除
-            del (row, tit, num) {
-                let delfromData = {
-                    title: tit,
-                    num: num,
-                    url: `user/user_level/delete/${row.id}`,
-                    method: 'put',
-                    ids: ''
-                }
-                this.$modalSure(delfromData).then((res) => {
-                    this.$Message.success(res.msg);
-                    this.levelLists.splice(num, 1);
-                    if (!this.levelLists.length) {
-                      this.levelFrom.page =
-                          this.levelFrom.page == 1 ? 1 : this.levelFrom.page - 1;
-                    }
-                    this.getList();
-                }).catch(res => {
-                    this.$Message.error(res.msg);
-                });
-            },
-            // 删除成功
-            // submitModel () {
-            //     this.levelLists.splice(this.delfromData.num, 1)
-            // },
-            // 修改是否显示
-            onchangeIsShow (row) {
-                let data = {
-                    id: row.id,
-                    is_show: row.is_show
-                }
-                setShowApi(data).then(async res => {
-                    this.$Message.success(res.msg);
-                }).catch(res => {
-                    this.$Message.error(res.msg);
-                })
-            },
-            // 等级列表
-            getList () {
-                this.loading = true;
-                this.levelFrom.is_show = this.levelFrom.is_show || '';
-                levelListApi(this.levelFrom).then(async res => {
-                    let data = res.data
-                    this.levelLists = data.list;
-                    this.total = res.data.count;
-                    this.loading = false;
-                }).catch(res => {
-                    this.loading = false;
-                    this.$Message.error(res.msg);
-                })
-            },
-            pageChange (index) {
-                this.levelFrom.page = index;
-                this.getList();
-            },
-            // 添加
-            add () {
-                this.levelId = 0;
-                this.$modalForm(createApi({ id: this.levelId })).then(() => this.getList());
-            },
-            // 编辑
-            edit (row) {
-                this.levelId = row.id;
-                this.$modalForm(createApi({ id: this.levelId })).then(() => this.getList());
-                this.getlevelId(this.levelId);
-            },
-            // 表格搜索
-            userSearchs () {
-                this.levelFrom.page = 1;
-                this.getList();
-            },
-            // 修改成功
-            submitFail () {
-                this.getList();
-            }
-        }
-    }
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		monthShareholderList,
+		userShareholderList
+	} from '@/api/shareholder';
+	export default {
+		name: 'shareholderBonus',
+		computed: {
+			...mapState('admin/layout', [
+				'isMobile'
+			]),
+			labelWidth() {
+				return this.isMobile ? undefined : 80;
+			},
+			labelPosition() {
+				return this.isMobile ? 'top' : 'right';
+			}
+		},
+		data() {
+			return {
+				// 股权发放弹窗
+				modalss: false,
+				// 用户列表弹窗
+				modals: false,
+				loading: false,
+				columns1: [{
+						title: 'ID',
+						key: 'id',
+						width: 80
+					},
+					{
+						title: '月份',
+						key: 'month',
+						minWidth: 50
+					},
+					{
+						title: '毛利润',
+						key: 'gross_profit',
+						minWidth: 100
+					},
+					{
+						title: '原始股',
+						slot: 'initial_share',
+						minWidth: 150
+					},
+					{
+						title: '分红股',
+						slot: 'bonus_share',
+						minWidth: 150
+					},
+					{
+						title: '发放时间',
+						key: 'create_time',
+						minWidth: 130
+					},
+					{
+						title: '发放总分润',
+						key: 'price',
+						minWidth: 130
+					},
+					{
+						title: '操作',
+						slot: 'action',
+						fixed: 'right',
+						minWidth: 120
+					}
+				],
+				columns2: [{
+						title: 'ID',
+						key: 'id',
+						width: 80
+					},
+					{
+						title: '月份',
+						key: 'month',
+						minWidth: 50
+					},
+					{
+						title: '毛利润',
+						key: 'gross_profit',
+						minWidth: 100
+					},
+					{
+						title: '原始股',
+						slot: 'initial_share',
+						minWidth: 150
+					},
+					{
+						title: '分红股',
+						slot: 'bonus_share',
+						minWidth: 150
+					},
+					{
+						title: '发放时间',
+						key: 'create_time',
+						minWidth: 130
+					},
+					{
+						title: '发放总分润',
+						key: 'price',
+						minWidth: 130
+					},
+					{
+						title: '操作',
+						slot: 'action',
+						fixed: 'right',
+						minWidth: 120
+					}
+				],
+				listFrom: {
+					page: 1,
+					limit: 10
+				},
+				fromHolder: {
+					uid: 0,
+					initial_share: 0,
+					bonus_share: 0,
+					initial_status: "1",
+					bonus_status: "1",
+					mark: ''
+				},
+				list: [], //每月发放记录
+				total: 0,
+				detailFrom: {
+					shareholding_record_id: '',
+					page: 1,
+					limit: 10
+				},
+				detailloading: false,
+				detailList: [], //单次发放记录
+				detailTotal: 0,
+			}
+		},
+		created() {
+			this.getList();
+			this.getDetailList();
+		},
+		methods: {
+			// 发放列表
+			getList() {
+				this.loading = true;
+				monthShareholderList(this.listFrom).then(async res => {
+					let data = res.data
+					this.list = data.list.map((re) => {
+						re.one_price = (re.grant_initial_price / 100 * re.initial_ratio / re
+							.initial_share_count).toFixed(2);
+						re.two_price = (re.grant_bonus_price / 100 * re.bonus_ratio / re
+							.bonus_share_count).toFixed(2);
+						return re;
+					});
+					this.total = res.data.count;
+					this.loading = false;
+				}).catch(res => {
+					console.log(res, 'res');
+					this.loading = false;
+					this.$Message.error(res.msg);
+				})
+			},
+			// 发放详细
+			getDetailList() {
+				this.detailloading = true;
+				userShareholderList(this.detailFrom).then(async res => {
+					let data = res.data
+					this.detailList = data.list;
+					this.detailTotal = res.data.count;
+					this.detailloading = false;
+				}).catch(res => {
+					console.log(res, 'res');
+					this.detailloading = false;
+					this.$Message.error(res.msg);
+				})
+			},
+			pageChange(index) {
+				this.listFrom.page = index;
+				this.getList();
+			},
+			detailPageChange(index) {
+				this.detailFrom.page = index;
+				this.getDetailList();
+			},
+			// 表格搜索
+			searchs() {
+				this.detailFrom.page = 1;
+				this.getDetailList();
+			},
+		}
+	}
 </script>
 
-<style scoped lang="stylus">
-    .tabBox_img
-        width 36px
-        height 36px
-        border-radius:4px
-        cursor pointer
-        img
-            width 100%
-            height 100%
-</style>
+<style lang="less">
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 270 - 288
src/pages/user/shareholder/history.vue

@@ -1,293 +1,275 @@
 <template>
-<!-- 用户-会员管理-等级列表 -->
-    <div>
-       <Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
-            <div class="new_card_pd">
-                <!-- 筛选条件 -->
-                 <Form ref="levelFrom" :model="levelFrom" inline :label-width="labelWidth" :label-position="labelPosition" @submit.native.prevent>
-                    <FormItem label="状态:"  label-for="status1">
-                        <Select v-model="levelFrom.is_show" placeholder="请选择" clearable element-id="status1" style="width:250px;">
-                            <Option value="1">显示</Option>
-                            <Option value="0">不显示</Option>
-                        </Select>
-                    </FormItem>
-                    <FormItem label="等级名称:"  label-for="title">
-                        <Input  v-model="levelFrom.title"  placeholder="请输入等级名称" style="width:250px;margin-right:14px;"/>
-                        <Button type="primary" @click="userSearchs">查询</Button>
-                    </FormItem>
-                </Form>
-            </div>
-        </Card>
-        <Card :bordered="false" dis-hover class="ivu-mt">
-            <!-- 相关操作 -->
-            <Button v-auth="['admin-user-level_add']" type="primary" @click="add">添加会员等级</Button>
-            <!-- 等级列表表格 -->
-            <Table :columns="columns1" :data="levelLists" ref="table" class="mt25"
-                   :loading="loading" highlight-row
-                   no-userFrom-text="暂无数据"
-                   no-filtered-userFrom-text="暂无筛选结果">
-                <template slot-scope="{ row, index }" slot="icons">
-                    <viewer>
-                        <div class="tabBox_img">
-                            <img v-lazy="row.icon">
-                        </div>
-                    </viewer>
-                </template>
-                <template slot-scope="{ row, index }" slot="is_forevers">
-                    <i-switch v-model="row.is_forever" :value="row.is_forever" :true-value="1" :false-value="0" :disabled="true" size="large">
-                        <span slot="open">永久</span>
-                        <span slot="close">非永久</span>
-                    </i-switch>
-                </template>
-                <template slot-scope="{ row, index }" slot="is_pays">
-                    <i-switch v-model="row.is_pay" :value="row.is_pay" :true-value="1" :false-value="0"  :disabled="true" size="large">
-                        <span slot="open">付费</span>
-                        <span slot="close">免费</span>
-                    </i-switch>
-                </template>
-                <template slot-scope="{ row, index }" slot="is_shows">
-                    <i-switch v-model="row.is_show" :value="row.is_show" :true-value="1" :false-value="0" @on-change="onchangeIsShow(row)" size="large">
-                        <span slot="open">显示</span>
-                        <span slot="close">隐藏</span>
-                    </i-switch>
-                </template>
-                <template slot-scope="{ row, index }" slot="action">
-                    <a @click="edit(row)">编辑</a>
-                    <Divider type="vertical" />
-                    <a @click="changeMenu(row,2,index)">删除</a>
-<!--                    <template>-->
-<!--                        <Dropdown @on-click="changeMenu(row,$event,index)">-->
-<!--                            <a href="javascript:void(0)">-->
-<!--                                更多-->
-<!--                                <Icon type="ios-arrow-down"></Icon>-->
-<!--                            </a>-->
-<!--                            <DropdownMenu slot="list">-->
-<!--&lt;!&ndash;                                <DropdownItem name="1">等级任务</DropdownItem>&ndash;&gt;-->
-<!--                                <DropdownItem name="2">删除等级</DropdownItem>-->
-<!--                            </DropdownMenu>-->
-<!--                        </Dropdown>-->
-<!--                    </template>-->
-                </template>
-            </Table>
-            <div class="acea-row row-right page">
-                <Page :total="total" :current="levelFrom.page" show-elevator show-total @on-change="pageChange"
-                      :page-size="levelFrom.limit"/>
-            </div>
-        </Card>
-        <!-- 等级任务-->
-        <task-list ref="tasks"></task-list>
-    </div>
+	<!-- 用户-会员管理-等级列表 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
+			<div class="new_card_pd">
+				<!-- 筛选条件 -->
+				<Form ref="levelFrom" :model="listFrom" inline :label-width="labelWidth" :label-position="labelPosition"
+					@submit.native.prevent>
+					<FormItem label="增减:" label-for="status1">
+						<Select v-model="listFrom.pm" placeholder="请选择" clearable style="width:250px;">
+							<Option value="1">增加</Option>
+							<Option value="0">减少</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="类型:" label-for="status1">
+						<Select v-model="listFrom.type" placeholder="请选择" clearable style="width:250px;">
+							<Option value="1">原始股</Option>
+							<Option value="2">分红股</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="股东:" label-for="status1">
+						<Select v-model="listFrom.uid" placeholder="请选择" clearable filterable style="width:250px;">
+							<Option v-for="item in user" :value="item.uid">{{item.real_name+"("+item.phone+")"}}</Option>
+						</Select>
+						<Button type="primary" @click="searchs">查询</Button>
+					</FormItem>
+				</Form>
+			</div>
+		</Card>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Table :columns="columns1" :data="list" ref="table" :loading="loading" highlight-row
+				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+				<template slot-scope="{ row, index }" slot="icons">
+					<viewer>
+						<div class="tabBox_img">
+							<img v-lazy="row.user.avatar">
+						</div>
+					</viewer>
+				</template>
+
+				<template slot-scope="{ row, index }" slot="name">
+					<div>
+						<div class="acea-row">
+							<Icon type="md-male" v-show="row.user.sex === '男'" color="#2db7f5" size="15" class="mr5" />
+							<Icon type="md-female" v-show="row.user.sex === '女'" color="#ed4014" size="15"
+								class="mr5" />
+							<div v-if="row.user.delete_time != null" style="color:#ed4014;">
+								{{row.user.real_name||row.user.nickname}} (已注销)</div>
+							<div v-else v-text="row.user.real_name||row.user.nickname"></div>
+						</div>
+						<div>{{row.user.phone}}</div>
+					</div>
+				</template>
+
+
+				<template slot-scope="{ row, index }" slot="type">
+					<div>
+						<div v-if="row.type==1">
+							原始股
+						</div>
+						<div v-if="row.type==2">
+							分红股
+						</div>
+					</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="number">
+					<div class="number-box">
+
+						<div class="success" v-if="row.pm==1">+{{row.shareholding}}</div>
+						<div class="danger" v-if="row.pm==0">-{{row.shareholding}}</div>
+					</div>
+				</template>
+
+				<template slot-scope="{ row, index }" slot="action">
+					<a @click="del(row)">删除</a>
+					<Divider type="vertical" />
+					<a @click="changeholder(row)">股权</a>
+				</template>
+			</Table>
+			<div class="acea-row row-right page">
+				<Page :total="total" :current="listFrom.page" show-elevator show-total @on-change="pageChange"
+					:page-size="listFrom.limit" />
+			</div>
+		</Card>
+		<Modal v-model="modals" title="用户列表" footerHide class="paymentFooter" scrollable width="900"
+			@on-cancel="modals=false">
+			<user ref="goodslist" :goodsType="1" v-if="modals" @imageObject="getProductId" :serviceProject="1"></user>
+		</Modal>
+	</div>
 </template>
 <script>
-    import { mapState, mapMutations } from 'vuex';
-    import { levelListApi, setShowApi, createApi } from '@/api/user';
-    import editFrom from '@/components/from/from';
-    export default {
-        name: 'user_level',
-        components: { editFrom },
-        data () {
-            return {
-                grid: {
-                    xl: 7,
-                    lg: 7,
-                    md: 12,
-                    sm: 24,
-                    xs: 24
-                },
-                loading: false,
-                columns1: [
-                    {
-                        title: 'ID',
-                        key: 'id',
-                        width: 80
-                    },
-                    {
-                        title: '等级图标',
-                        slot: 'icons',
-                        minWidth: 100
-                    },
-                    {
-                        title: '等级名称',
-                        key: 'name',
-                        minWidth: 120
-                    },
-                    {
-                        title: '等级',
-                        key: 'grade',
-                        minWidth: 100
-                    },
-                    {
-                        title: '享受折扣(%)',
-                        key: 'discount',
-                        minWidth: 100
-                    },
-                    // {
-                    //     title: '有效时间',
-                    //     key: 'valid_date',
-                    //     minWidth: 120
-                    // },
-                    // {
-                    //     title: '是否永久',
-                    //     slot: 'is_forevers',
-                    //     minWidth: 130
-                    // },
-                    // {
-                    //     title: '是否付费',
-                    //     slot: 'is_pays',
-                    //     minWidth: 120
-                    // },
-                    {
-                        title: '是否显示',
-                        slot: 'is_shows',
-                        minWidth: 120
-                    },
-                    {
-                        title: '等级说明',
-                        key: 'explain',
-                        minWidth: 120
-                    },
-                    {
-                        title: '操作',
-                        slot: 'action',
-                        fixed: 'right',
-                        minWidth: 120
-                    }
-                ],
-                levelFrom: {
-                    is_show: '',
-                    title: '',
-                    page: 1,
-                    limit: 10
-                },
-                levelLists: [],
-                total: 0,
-                FromData: null,
-                imgName: '',
-                visible: false,
-                levelId: 0,
-                modalTitleSs: '',
-                titleType: 'level',
-                modelTask: false,
-                num: 0
-            }
-        },
-        created () {
-            this.getList();
-        },
-        computed: {
-            ...mapState('admin/layout', [
-                'isMobile'
-            ]),
-            labelWidth () {
-                return this.isMobile ? undefined : 96;
-            },
-            labelPosition () {
-                return this.isMobile ? 'top' : 'right';
-            }
-        },
-        methods: {
-            ...mapMutations('admin/userLevel', [
-                'getlevelId'
-            ]),
-            // 操作
-            changeMenu (row, name, num) {
-                this.levelId = row.id;
-                switch (name) {
-                case '1':
-                    this.getlevelId(this.levelId);
-                    this.$refs.tasks.modals = true;
-                    this.$refs.tasks.getList();
-                    break;
-                default:
-                    this.del(row, '删除等级', num);
-                }
-            },
-            // 删除
-            del (row, tit, num) {
-                let delfromData = {
-                    title: tit,
-                    num: num,
-                    url: `user/user_level/delete/${row.id}`,
-                    method: 'put',
-                    ids: ''
-                }
-                this.$modalSure(delfromData).then((res) => {
-                    this.$Message.success(res.msg);
-                    this.levelLists.splice(num, 1);
-                    if (!this.levelLists.length) {
-                      this.levelFrom.page =
-                          this.levelFrom.page == 1 ? 1 : this.levelFrom.page - 1;
-                    }
-                    this.getList();
-                }).catch(res => {
-                    this.$Message.error(res.msg);
-                });
-            },
-            // 删除成功
-            // submitModel () {
-            //     this.levelLists.splice(this.delfromData.num, 1)
-            // },
-            // 修改是否显示
-            onchangeIsShow (row) {
-                let data = {
-                    id: row.id,
-                    is_show: row.is_show
-                }
-                setShowApi(data).then(async res => {
-                    this.$Message.success(res.msg);
-                }).catch(res => {
-                    this.$Message.error(res.msg);
-                })
-            },
-            // 等级列表
-            getList () {
-                this.loading = true;
-                this.levelFrom.is_show = this.levelFrom.is_show || '';
-                levelListApi(this.levelFrom).then(async res => {
-                    let data = res.data
-                    this.levelLists = data.list;
-                    this.total = res.data.count;
-                    this.loading = false;
-                }).catch(res => {
-                    this.loading = false;
-                    this.$Message.error(res.msg);
-                })
-            },
-            pageChange (index) {
-                this.levelFrom.page = index;
-                this.getList();
-            },
-            // 添加
-            add () {
-                this.levelId = 0;
-                this.$modalForm(createApi({ id: this.levelId })).then(() => this.getList());
-            },
-            // 编辑
-            edit (row) {
-                this.levelId = row.id;
-                this.$modalForm(createApi({ id: this.levelId })).then(() => this.getList());
-                this.getlevelId(this.levelId);
-            },
-            // 表格搜索
-            userSearchs () {
-                this.levelFrom.page = 1;
-                this.getList();
-            },
-            // 修改成功
-            submitFail () {
-                this.getList();
-            }
-        }
-    }
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		userList
+	} from '@/api/user';
+	import {
+		stocklst,
+	} from '@/api/shareholder';
+	import user from "@/components/userList/index"
+	export default {
+		name: 'shareholderHistory',
+		components: {
+			user
+		},
+		computed: {
+			...mapState('admin/layout', [
+				'isMobile'
+			]),
+			labelWidth() {
+				return this.isMobile ? undefined : 50;
+			},
+			labelPosition() {
+				return this.isMobile ? 'top' : 'right';
+			}
+		},
+		data() {
+			return {
+				// 股权发放弹窗
+				modalss: false,
+				// 用户列表弹窗
+				modals: false,
+				loading: false,
+				columns1: [{
+						title: 'ID',
+						key: 'id',
+						width: 80
+					},
+					{
+						title: '头像',
+						slot: 'icons',
+						minWidth: 50
+					},
+					{
+						title: '用户',
+						slot: 'name',
+						minWidth: 150
+					},
+					{
+						title: '类型',
+						slot: 'type',
+						minWidth: 50
+					},
+					{
+						title: '数量',
+						slot: 'number',
+						minWidth: 80
+					},
+					{
+						title: '变动后',
+						key: 'balance',
+						minWidth: 80
+					},
+					{
+						title: '发放时间',
+						key: 'create_time',
+						minWidth: 130
+					},
+					{
+						title: '备注',
+						key: 'mark',
+						minWidth: 100
+					},
+					{
+						title: '操作',
+						slot: 'action',
+						fixed: 'right',
+						minWidth: 120
+					}
+				],
+				listFrom: {
+					page: 1,
+					limit: 10,
+					type: '',
+					pm: '',
+					uid: '',
+				},
+				fromHolder: {
+					uid: 0,
+					initial_share: 0,
+					bonus_share: 0,
+					initial_status: "1",
+					bonus_status: "1",
+					mark: ''
+				},
+				list: [],
+				total: 0,
+				user: []
+			}
+		},
+		created() {
+			console.log('zs');
+			this.getList();
+			this.userList();
+		},
+		methods: {
+			userList() {
+				userList({
+					is_shareholder: 1,
+					page: 1,
+					limit: 100,
+				}).then((res) => {
+					this.user = res.data.list
+				}).catch((res) => {
+					console.log(res);
+				})
+			},
+			// 等级列表
+			getList() {
+				this.loading = true;
+				stocklst(this.listFrom).then(async res => {
+					let data = res.data
+					this.list = data.list;
+					this.total = res.data.count;
+					this.loading = false;
+				}).catch(res => {
+					console.log(res, 'res');
+					this.loading = false;
+					this.$Message.error(res.msg);
+				})
+			},
+			pageChange(index) {
+				this.listFrom.page = index;
+				this.getList();
+			},
+			// 添加
+			add(uid) {
+				addShareholder({
+					uid
+				}).then((res) => {
+					console.log(res);
+					this.getList();
+					this.$Message.success(res.msg);
+				}).catch((res) => {
+					this.$Message.error(res.msg);
+				})
+			},
+			// 表格搜索
+			searchs() {
+				this.listFrom.page = 1;
+				this.getList();
+			},
+			// 修改成功
+			submitFail() {
+				this.getList();
+			}
+		}
+	}
 </script>
 
-<style scoped lang="stylus">
-    .tabBox_img
-        width 36px
-        height 36px
-        border-radius:4px
-        cursor pointer
-        img
-            width 100%
-            height 100%
-</style>
+<style lang="less">
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+	.number-box {
+		.success {
+			color: #19be6b;
+		}
+
+		.danger {
+			color: #ed4014;
+		}
+	}
+</style>

+ 3 - 24
src/pages/user/shareholder/list.vue

@@ -4,7 +4,6 @@
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 相关操作 -->
 			<Button v-auth="['admin-user-level_add']" type="primary" @click="modals = true">添加股东</Button>
-			<!-- 等级列表表格 -->
 			<Table :columns="columns1" :data="list" ref="table" class="mt25" :loading="loading" highlight-row
 				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
 				<template slot-scope="{ row, index }" slot="icons">
@@ -100,12 +99,12 @@
 					{
 						title: '头像',
 						slot: 'icons',
-						minWidth: 100
+						minWidth: 50
 					},
 					{
 						title: '昵称',
 						slot: 'name',
-						minWidth: 120
+						minWidth: 150
 					},
 					{
 						title: '分红股权',
@@ -146,17 +145,6 @@
 			console.log('zs');
 			this.getList();
 		},
-		computed: {
-			...mapState('admin/layout', [
-				'isMobile'
-			]),
-			labelWidth() {
-				return this.isMobile ? undefined : 96;
-			},
-			labelPosition() {
-				return this.isMobile ? 'top' : 'right';
-			}
-		},
 		methods: {
 			// 确认发放股权
 			comInput(res) {
@@ -222,7 +210,7 @@
 				})
 			},
 			pageChange(index) {
-				this.levelFrom.page = index;
+				this.listFrom.page = index;
 				this.getList();
 			},
 			// 添加
@@ -237,15 +225,6 @@
 					this.$Message.error(res.msg);
 				})
 			},
-			// 表格搜索
-			userSearchs() {
-				this.levelFrom.page = 1;
-				this.getList();
-			},
-			// 修改成功
-			submitFail() {
-				this.getList();
-			}
 		}
 	}
 </script>