Browse Source

yong hu jiang li gu quan

lhl 9 months ago
parent
commit
44d1b90046

File diff suppressed because it is too large
+ 616 - 774
package-lock.json


+ 1 - 1
package.json

@@ -6,7 +6,7 @@
     "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --open  --mode=dev ",
     "dev": "vue-cli-service serve --open  --mode=dev",
     "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode=production",
-	"builds": "vue-cli-service build --mode=production"
+    "builds": "vue-cli-service build --mode=production"
   },
   "dependencies": {
     "@babel/polyfill": "^7.12.1",

+ 19 - 0
src/api/finance.js

@@ -208,4 +208,23 @@ export function getYgGqList(data) {
 	    method: 'get',
 	    params: data
 	});
+}
+
+
+//用户奖励股权提现申请
+export function getYhJlTx(data) {
+	return request({
+	    url: `user/withdrawalList`,
+	    method: 'get',
+	    params: data
+	});
+}
+
+//work/withdrawalExamine  用户股权提现申请审核
+export function passYhJlTx(data) {
+	return request({
+	    url: `user/withdrawalExamine`,
+	    method: 'post',
+	    data
+	});
 }

+ 8 - 0
src/api/user.js

@@ -736,4 +736,12 @@ export function batchProcess(data) {
         method: 'post',
         data
     });
+}
+
+export function getUserJlList (data) {
+    return request({
+        url: `user/recordList`,
+        method: 'get',
+        params: data
+    });
 }

+ 243 - 0
src/components/userLists/index.vue

@@ -0,0 +1,243 @@
+<template>
+	<div class="goodList">
+		<Form ref="pagination" :model="formValidate" @submit.native.prevent>
+			<FormItem label="用户昵称:" label-for="title">
+				<Input v-model="formValidate.nickname" placeholder="请输入用户昵称" class="input-add mr14" />
+				<Button type="primary" @click="userSearchs()">查询</Button>
+			</FormItem>
+		</Form>
+		<Table ref="table" no-data-text="暂无数据" @on-select-all="selectAll" @on-select-all-cancel="cancelAll"
+			@on-select="TableSelectRow" @on-select-cancel="TableSelectCancelRow" no-filtered-data-text="暂无筛选结果"
+			:columns="columns4" :data="tableList" :loading="loading" class="mr-20" height="500">
+			<template slot-scope="{ row }" slot="avatar">
+				<viewer>
+					<div class="tabBox_img">
+						<img v-lazy="row.headimgurl||row.user.headimgurl" />
+					</div>
+				</viewer>
+			</template>
+			<template slot-scope="{ row, index }" slot="user_type">
+			  <span v-if="row.user_type === 'wechat'">公众号</span>
+			  <span v-if="row.user_type === 'routine'">小程序</span>
+			  <span v-if="row.user_type === 'h5'">H5</span>
+			  <span v-if="row.user_type === 'pc'">PC</span>
+			</template>
+		</Table>
+		<div class="acea-row row-right page">
+			<Page :total="total" show-elevator show-total @on-change="pageChange" :page-size="formValidate.limit" />
+		</div>
+		<div class="footer" slot="footer" >
+			<Button type="primary" size="large" :loading="modal_loading" long @click="ok">确定</Button>
+		</div>
+	</div>
+</template>
+
+<script>
+	import { kefucreateApi } from "@/api/setting";
+	import {
+		mapState
+	} from "vuex";
+	import {
+		getYgList
+	} from '@/api/store'
+	export default {
+		name: "index",
+		props: {
+			is_reservation: {
+				type: Number,
+				default: 1
+			},
+		},
+		data() {
+			return {
+				//选中商品集合
+				selectEquips: [],
+				// 选中的id集合
+				selectEquipsIds: [],
+				cateIds: [],
+				modal_loading: false,
+				formValidate: {
+					page: 1,
+					limit: 10,
+					nickname: ''
+				},
+				total: 0,
+				loading: false,
+				tableList: [],
+				columns4: [{
+						type: 'selection',
+						width: 60,
+						align: 'center'
+					},
+					{
+						title: "用户UID",
+						key: "uid",
+						width: 60,
+					},
+					{
+						title: "头像",
+						slot: "avatar",
+						width: 60,
+					},
+					{
+						title: "昵称",
+						key: "nickname",
+						minWidth: 80,
+					},
+					// {
+					// 	title: "别称",
+					// 	key: "alias",
+					// 	minWidth: 80,
+					// },
+					{
+					  title: "用户类型",
+					  slot: "user_type",
+					  minWidth: 100,
+					},
+					// {
+					// 	title: "创建时间",
+					// 	key: "create_time",
+					// 	minWidth: 100,
+					// },
+				],
+				images: [],
+			};
+		},
+		created() {
+		},
+		mounted() {
+			this.getList();
+		},
+		methods: {
+			// 判断是否选中
+			sortData() {
+				if (this.selectEquipsIds.length) {
+					this.tableList.forEach(ele => {
+						if (this.selectEquipsIds.includes(ele.id)) ele._checked = true;
+					})
+				}
+			},
+			// 选中一行
+			TableSelectRow(selection, row) {
+				console.log(selection, row,'selection, row')
+				if (!this.selectEquipsIds.includes(row.uid)) {
+					this.selectEquipsIds.push(row.uid);
+					this.selectEquips.push(row);
+				}
+			},
+			// 取消选中一行
+			TableSelectCancelRow(selection, row) {
+				var _index = this.selectEquipsIds.indexOf(row.uid);
+				if (_index != -1) {
+					this.selectEquipsIds.splice(_index, 1);
+					this.selectEquips.splice(_index, 1);
+				}
+			},
+			// 选中所有
+			selectAll() {
+				for (let i = this.tableList.length - 1; i >= 0; i--) {
+					this.TableSelectRow(null, this.tableList[i]);
+				}
+			},
+			// 取消选中所有
+			cancelAll() {
+				for (let i = this.tableList.length - 1; i >= 0; i--) {
+					this.TableSelectCancelRow(null, this.tableList[i]);
+				}
+			},
+			pageChange(index) {
+				this.formValidate.page = index;
+				this.getList();
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+					kefucreateApi(this.formValidate)
+						.then(async (res) => {
+							let data = res.data;
+							this.tableList = data.list;
+							this.total = res.data.count;
+							this.sortData();
+							this.loading = false;
+						})
+						.catch((res) => {
+							this.loading = false;
+							this.$Message.error(res.msg);
+						});
+			},
+			changeCheckbox(selection) {
+				let images = [];
+				selection.forEach(function(item) {
+					let imageObject = {
+						image: item.image,
+						product_id: item.id,
+						store_name: item.store_name,
+						temp_id: item.temp_id
+					};
+					images.push(imageObject);
+				});
+				this.images = images;
+				this.$emit("getProductDiy", selection);
+			},
+			ok() {
+				console.log("getProductId", this.selectEquips)
+				this.$emit("getProductId", this.selectEquips);
+			},
+			treeSearchs(value) {
+				this.formValidate.page = 1;
+				this.getList();
+			},
+			// 表格搜索
+			userSearchs() {
+				this.formValidate.page = 1;
+				this.getList();
+			},
+			clear() {
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	/deep/.ivu-table-header thead tr th {
+		padding: 8px 5px;
+	}
+
+	/deep/.ivu-radio-wrapper {
+		margin-right: 0 !important;
+	}
+
+	.footer {
+		margin: 15px 0;
+	}
+
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 100px;
+		overflow: hidden;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+	.tabform {
+		>>>.ivu-form-item {
+			margin-bottom: 16px !important;
+		}
+	}
+
+	.btn {
+		margin-top: 20px;
+		float: right;
+	}
+
+	.goodList {}
+
+	.mr-20 {
+		margin-right: 10px;
+	}
+</style>

+ 249 - 0
src/pages/finance/jl/index.vue

@@ -0,0 +1,249 @@
+<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">
+						<div v-if="row.user.delete_time != null" style="color:#ed4014;">{{row.member.nickname}} (已注销)</div>
+						<div v-else v-text="row.user.nickname"></div>
+					</div>
+					<div>uid:{{row.user.uid}}</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 {
+		getYhJlTx,
+		passYhJlTx
+	} 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: 'reward_share',
+						minWidth: 100
+					},
+					{
+						title: '预计金额',
+						key: 'money',
+						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.user.nickname} 的股权提现申请`: `拒绝用户:${row.user.nickname} 的股权提现申请`,
+					loading: true,
+					onOk: () => {
+						this.$Modal.remove();
+						// this.add(res.uid)
+						passYhJlTx({
+							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;
+				getYhJlTx(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>

+ 189 - 0
src/pages/finance/jl/list.vue

@@ -0,0 +1,189 @@
+<template>
+	<!-- 用户-会员管理-等级列表 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<!-- 相关操作 -->
+			<Input v-model="listFrom.uid" icon="ios-search" @on-click='openmid' placeholder="请输入用户ID" class="input-add mr14" />
+			<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">
+						<div v-if="row.user.delete_time != null" style="color:#ed4014;">{{row.user.nickname}} (已注销)</div>
+						<div v-else v-text="row.user.nickname"></div>
+					</div>
+					<div >uid:{{row.user.uid}}</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>
+		<Modal v-model="modals" width='80' mask title="员工选择">
+			<userLists :is_reservation='0' @getProductId='checkmember'></userLists>
+			<template #footer>
+				<Button @click="memberListShow=false">取消</Button>
+			</template>
+		</Modal>
+	</div>
+</template>
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		getYhJlList,
+		passYgGqTx
+	} from '@/api/finance'
+	import { getUserJlList} from '@/api/user'
+	import userLists from "@/components/userLists/index";
+	export default {
+		name: 'guquanList',
+		components: {
+			userLists
+		},
+		data() {
+			return {
+				modals: false,
+				loading: false,
+				columns1: [{
+						title: 'ID',
+						key: 'id',
+						width: 80
+					},
+					{
+						title: '用户',
+						slot: 'name',
+						minWidth: 150
+					},
+					{
+						title: '详情',
+						key: 'content',
+						minWidth: 200
+					},
+					{
+						title: '数量',
+						key: 'reward_share',
+						minWidth: 100
+					},
+					{
+						title: '变动后',
+						key: 'balance',
+						minWidth: 100
+					},
+					{
+						title: '变更时间',
+						key: 'create_time',
+						minWidth: 200
+					}
+				],
+				listFrom: {
+					page: 1,
+					limit: 10,
+					uid: '',
+				},
+				list: [],
+				total: 0,
+			}
+		},
+		created() {
+			console.log('zs');
+			this.getList();
+		},
+		methods: {
+			// 打开弹窗
+			openmid(e) {
+				this.modals = true;
+			},
+			// 选中员工
+			checkmember(res) {
+				console.log(res,'res')
+				let data = res[0];
+				this.modals = false;
+				this.listFrom.uid = data.uid;
+				console.log(this.listFrom.uid,'this.listFrom.uid')
+			},
+			reset() {
+				this.listFrom.member_id = 0,
+				this.getList()
+			},
+			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('取消成功');
+					}
+				});
+			},
+			getList() {
+				this.loading = true;
+				getUserJlList(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();
+			},
+		}
+	}
+</script>
+
+<style lang="less">
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 117 - 0
src/pages/user/list/handle/userJl.vue

@@ -0,0 +1,117 @@
+<template>
+    <div>
+        <Modal v-model="modals"  scrollable  footer-hide closable title="用户奖励股权明细" :mask-closable="false"  width="900" @on-cancel="onCancel">
+            <Table ref="selection" :columns="columns4" :data="tabList" :loading="loading"
+                   no-data-text="暂无数据" highlight-row max-height="400"
+                   no-filtered-data-text="暂无筛选结果">
+            </Table>
+            <div class="acea-row row-right page">
+                <Page :total="total" show-elevator show-total @on-change="pageChange"
+                      :page-size="formValidate.limit"/>
+            </div>
+        </Modal>
+    </div>
+</template>
+
+<script>
+    import { mapState } from 'vuex';
+    // import { stairListApi } from '@/api/agent';
+	import { getUserJlList } from '@/api/user';
+    import timeOptions from "@/utils/timeOptions";
+    export default {
+        name: 'userJl',
+        data () {
+            return {
+                modals: false,
+                options: timeOptions,
+                formValidate: {
+                    limit: 15,
+                    page: 1,
+                    uid: 0
+                },
+                loading: false,
+                tabList: [],
+                total: 0,
+                timeVal: [],
+                columns4: [],
+                listTitle: ''
+            }
+        },
+        computed: {
+            ...mapState('admin/layout', [
+                'isMobile'
+            ]),
+            labelWidth () {
+                return this.isMobile ? undefined : 100;
+            },
+            labelPosition () {
+                return this.isMobile ? 'top' : 'right';
+            }
+        },
+        methods: {
+            onCancel () {
+                this.formValidate = {
+                    limit: 15,
+                    page: 1,
+                    uid: 0
+                };
+				this.timeVal = [];
+            },
+            // 具体日期
+            onchangeTime (e) {
+                this.timeVal = e;
+                this.formValidate.data = this.timeVal[0] ? this.timeVal.join('-') : "";
+            },
+            // 列表
+            getList (row) {
+                this.formValidate.uid = row.uid
+                getUserJlList(this.formValidate).then(async res => {
+                    let data = res.data
+                    this.tabList = data.list;
+                    this.total = data.count;
+                    this.columns4 = [
+                        {
+                            title: 'ID',
+                            key: 'id'
+                        },
+                        {
+                            title: '数量',
+                            key: 'reward_share',
+							render: (h, params) => {
+							    return h('viewer', [
+							        h('span', (params.row.pm == 1? '+ ': '- ') + params.row.reward_share)
+							    ]);
+							}
+                        },
+                        {
+                            title: '备注',
+                            key: 'content'
+                        },
+						{
+						    title: '充值订单id / 提现申请id',
+						    key: 'link_id'
+						},
+						{
+						    title: '变更后剩余',
+						    key: 'balance'
+						}
+                    ];
+                    this.loading = false;
+                }).catch(res => {
+                    this.loading = false;
+                    this.tabList = [];
+                    this.$Message.error(res.msg);
+                })
+            },
+            pageChange (item) {
+				console.log(item)
+                this.formValidate.page = item;
+                this.getList(this.formValidate);
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 18 - 0
src/router/modules/finance.js

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

Some files were not shown because too many files changed in this diff