Ver Fonte

user-serve

lhl há 1 ano atrás
pai
commit
1aa6af972f

+ 26 - 0
src/api/finance.js

@@ -183,3 +183,29 @@ export function exportUserRechargeApi (data) {
         params: data
     });
 }
+
+//员工股权提现申请
+export function getYgGqTx(data) {
+	return request({
+	    url: `work/withdrawalList`,
+	    method: 'get',
+	    params: data
+	});
+}
+
+//work/withdrawalExamine  员工股权提现申请审核
+export function passYgGqTx(data) {
+	return request({
+	    url: `work/withdrawalExamine`,
+	    method: 'post',
+	    data
+	});
+}
+
+export function getYgGqList(data) {
+	return request({
+	    url: `work/recordList`,
+	    method: 'get',
+	    params: data
+	});
+}

+ 245 - 0
src/pages/finance/guquan/index.vue

@@ -0,0 +1,245 @@
+<template>
+	<!-- 用户-会员管理-等级列表 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<!-- 相关操作 -->
+		
+			<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">
+					<viewer>
+						<div class="tabBox_img">
+							<img v-lazy="row.member.avatar">
+						</div>
+					</viewer>
+				</template>
+
+				<template slot-scope="{ row, index }" slot="name">
+					<div class="acea-row">
+						<Icon type="md-male" v-show="row.sex === '男'" color="#2db7f5" size="15" class="mr5" />
+						<Icon type="md-female" v-show="row.sex === '女'" color="#ed4014" size="15" class="mr5" />
+						<div v-if="row.delete_time != null" style="color:#ed4014;">{{row.member.name}} (已注销)</div>
+						<div v-else v-text="row.member.name"></div>
+					</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="status">
+					<Tag color="primary" v-if="row.status == 1">待审核</Tag>
+					    <Tag color="success" v-if="row.status == 2">已通过</Tag>
+					    <Tag color="error" v-if="row.status == 0">未通过</Tag>
+				</template>
+				<template slot-scope="{ row, index }" slot="action">
+					<template v-if="row.status == 1">
+						<a @click="pass(row,2)">通过</a>
+						<Divider type="vertical" />
+						<a @click="pass(row,0)">拒绝</a>
+					</template>
+				</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>
+	</div>
+</template>
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		userList
+	} from '@/api/user';
+	import {
+		updateShareholdingRecord,
+		deleteShareholder,
+		addShareholder
+	} from '@/api/shareholder';
+	import {
+		getYgGqTx,
+		passYgGqTx
+	} from '@/api/finance'
+	import user from "@/components/userList/index"
+	export default {
+		name: 'guquanIndex',
+		data() {
+			return {
+				// 股权发放弹窗
+				modalss: false,
+				// 用户列表弹窗
+				modals: false,
+				loading: false,
+				columns1: [{
+						title: 'ID',
+						key: 'id',
+						width: 80
+					},
+					{
+						title: '员工',
+						slot: 'name',
+						minWidth: 150
+					},
+					{
+						title: '提现股权',
+						key: 'shareholding',
+						minWidth: 100
+					},
+					{
+						title: '提现时间',
+						key: 'create_time',
+						minWidth: 100
+					},
+					{
+						title: '审核状态',
+						slot: 'status',
+						minWidth: 100
+					},
+					{
+						title: '操作',
+						slot: 'action',
+						fixed: 'right',
+						minWidth: 120
+					}
+				],
+				listFrom: {
+					is_shareholder: 1,
+					page: 1,
+					limit: 10
+				},
+				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();
+		},
+		methods: {
+			// 确认发放股权
+			comInput(res) {
+				updateShareholdingRecord(this.fromHolder).then((res) => {
+					this.getList();
+					this.$Message.success(res.msg);
+				}).catch(res => {
+					this.$Message.error(res.msg);
+				});
+			},
+			// 打开股权发放
+			changeholder(res) {
+				// 保存当前选中的对象
+				this.fromHolder.uid = res.uid;
+				this.modalss = true;
+			},
+			pass(row,type) {
+				console.log('row',row)
+				let that = this
+				this.$Modal.confirm({
+					title: '提示',
+					content: type == 2 ? `通过员工:${row.member.name} 的股权提现申请`: `拒绝员工:${row.member.name} 的股权提现申请`,
+					loading: true,
+					onOk: () => {
+						this.$Modal.remove();
+						// this.add(res.uid)
+						passYgGqTx({
+							id: row.id,
+							status: type
+						}).then(res=> {
+							that.$Message.success('审核完成');
+							that.getList();
+						})
+					},
+					onCancel: () => {
+						// this.$Message.info('取消成功');
+					}
+				});
+			},
+			getProductId(res) {
+				console.log(res);
+				this.modals = false;
+				this.$Modal.confirm({
+					title: '提示',
+					content: `是否将用户${res.name}(UID:${res.uid})添加为股东`,
+					loading: true,
+					onOk: () => {
+						this.$Modal.remove();
+						this.add(res.uid)
+						this.getList();
+					},
+					onCancel: () => {
+						// this.$Message.info('取消成功');
+					}
+				});
+			},
+			// 删除
+			del(row) {
+				let delfromData = {
+					title: "删除股东",
+					url: `stockRights/deleteShareholder`,
+					method: 'post',
+					ids: {
+						uid: row.uid
+					}
+				}
+				this.$modalSure(delfromData).then((res) => {
+					this.$Message.success(res.msg);
+					this.getList();
+				}).catch(res => {
+					this.$Message.error(res.msg);
+				});
+			},
+			// 等级列表
+			getList() {
+				this.loading = true;
+				getYgGqTx(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);
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="less">
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 266 - 0
src/pages/finance/guquan/list.vue

@@ -0,0 +1,266 @@
+<template>
+	<!-- 用户-会员管理-等级列表 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<!-- 相关操作 -->
+			<Select v-model="listFrom.member_id" style="width: 250px">
+				<Option v-for="item in ygList" :key="item.id" :value="item.id">{{ item.name }}</Option>
+			</Select>
+			<Button type="primary" @click="getList" style="margin-left: 20px;">查询</Button>
+			<Button type="primary" @click="reset" style="margin-left: 20px;">重置</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">
+					<viewer>
+						<div class="tabBox_img">
+							<img v-lazy="row.member.avatar">
+						</div>
+					</viewer>
+				</template>
+
+				<template slot-scope="{ row, index }" slot="name">
+					<div class="acea-row">
+						<Icon type="md-male" v-show="row.sex === '男'" color="#2db7f5" size="15" class="mr5" />
+						<Icon type="md-female" v-show="row.sex === '女'" color="#ed4014" size="15" class="mr5" />
+						<div v-if="row.delete_time != null" style="color:#ed4014;">{{row.member.name}} (已注销)</div>
+						<div v-else v-text="row.member.name"></div>
+					</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="status">
+					<Tag color="primary" v-if="row.status == 1">待审核</Tag>
+					    <Tag color="success" v-if="row.status == 2">已通过</Tag>
+					    <Tag color="error" v-if="row.status == 0">未通过</Tag>
+				</template>
+				<template slot-scope="{ row, index }" slot="action">
+					<template v-if="row.status == 1">
+						<a @click="pass(row,2)">通过</a>
+						<Divider type="vertical" />
+						<a @click="pass(row,0)">拒绝</a>
+					</template>
+				</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>
+	</div>
+</template>
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		userList
+	} from '@/api/user';
+	import {
+		updateShareholdingRecord,
+		deleteShareholder,
+		addShareholder
+	} from '@/api/shareholder';
+	import {
+		getYgList
+	} from "@/api/store"
+	import {
+		getYgGqList,
+		passYgGqTx
+	} from '@/api/finance'
+	import user from "@/components/userList/index"
+	export default {
+		name: 'guquanList',
+		data() {
+			return {
+				ygList: [],
+				// 股权发放弹窗
+				modalss: false,
+				// 用户列表弹窗
+				modals: false,
+				loading: false,
+				columns1: [{
+						title: 'ID',
+						key: 'id',
+						width: 80
+					},
+					{
+						title: '员工',
+						slot: 'name',
+						minWidth: 150
+					},
+					{
+						title: '详情',
+						key: 'content',
+						minWidth: 200
+					},
+					{
+						title: '数量',
+						key: 'shareholding',
+						minWidth: 100
+					},
+					{
+						title: '变动后',
+						key: 'balance',
+						minWidth: 100
+					},
+					{
+						title: '变更时间',
+						key: 'create_time',
+						minWidth: 200
+					}
+				],
+				listFrom: {
+					is_shareholder: 1,
+					page: 1,
+					limit: 10,
+					member_id: 0,
+				},
+				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.getYgList()
+		},
+		methods: {
+			reset() {
+				this.listFrom.member_id = 0,
+				this.getList()
+			},
+			getYgList() {
+				getYgList({
+					page: 1,
+					limit: 1000
+				}).then(res => {
+					this.ygList = res.data.list
+				})
+			},
+			// 确认发放股权
+			comInput(res) {
+				updateShareholdingRecord(this.fromHolder).then((res) => {
+					this.getList();
+					this.$Message.success(res.msg);
+				}).catch(res => {
+					this.$Message.error(res.msg);
+				});
+			},
+			// 打开股权发放
+			changeholder(res) {
+				// 保存当前选中的对象
+				this.fromHolder.uid = res.uid;
+				this.modalss = true;
+			},
+			pass(row,type) {
+				console.log('row',row)
+				let that = this
+				this.$Modal.confirm({
+					title: '提示',
+					content: type == 2 ? `通过员工:${row.member.name} 的股权提现申请`: `拒绝员工:${row.member.name} 的股权提现申请`,
+					loading: true,
+					onOk: () => {
+						this.$Modal.remove();
+						// this.add(res.uid)
+						passYgGqTx({
+							id: row.id,
+							status: type
+						}).then(res=> {
+							that.$Message.success('审核完成');
+							that.getList();
+						})
+					},
+					onCancel: () => {
+						// this.$Message.info('取消成功');
+					}
+				});
+			},
+			getProductId(res) {
+				console.log(res);
+				this.modals = false;
+				this.$Modal.confirm({
+					title: '提示',
+					content: `是否将用户${res.name}(UID:${res.uid})添加为股东`,
+					loading: true,
+					onOk: () => {
+						this.$Modal.remove();
+						this.add(res.uid)
+						this.getList();
+					},
+					onCancel: () => {
+						// this.$Message.info('取消成功');
+					}
+				});
+			},
+			// 删除
+			del(row) {
+				let delfromData = {
+					title: "删除股东",
+					url: `stockRights/deleteShareholder`,
+					method: 'post',
+					ids: {
+						uid: row.uid
+					}
+				}
+				this.$modalSure(delfromData).then((res) => {
+					this.$Message.success(res.msg);
+					this.getList();
+				}).catch(res => {
+					this.$Message.error(res.msg);
+				});
+			},
+			// 等级列表
+			getList() {
+				this.loading = true;
+				getYgGqList(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);
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="less">
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 19 - 1
src/router/modules/finance.js

@@ -58,6 +58,24 @@ export default {
                 title: '佣金记录'
             },
             component: () => import('@/pages/finance/commission/index')
-        }
+        },
+		{
+		    path: 'guquan/index',
+		    name: `${pre}guquanIndex`,
+		    meta: {
+		        auth: ['admin-finance-guquan-index'],
+		        title: '股权提现申请'
+		    },
+		    component: () => import('@/pages/finance/guquan/index')
+		},
+		{
+		    path: 'guquan/list',
+		    name: `${pre}guquanList`,
+		    meta: {
+		        auth: ['admin-finance-guquan-list'],
+		        title: '股权记录'
+		    },
+		    component: () => import('@/pages/finance/guquan/list')
+		}
     ]
 };