hwq 2 лет назад
Родитель
Сommit
3d8f15b0f5

+ 158 - 0
src/api/newApi.js

@@ -0,0 +1,158 @@
+import request from '@/plugins/request';
+/**
+ * @description 团队等级-列表
+ * @param {Object} param data {Object} 传值参数
+ */
+export function levelListApi(data) {
+    return request({
+        url: 'user/group_level/vip_list',
+        method: 'get',
+        params: data
+    });
+}
+
+/**
+ * @description 团队等级-编辑表单
+ * @param {Number} param id {Number} 团队等级id
+ */
+export function levelEditApi(id) {
+    return request({
+        url: `user/group_level/set_value/${id}`,
+        method: 'PUT'
+    });
+}
+
+/**
+ * @description 团队等级-修改显示隐藏
+ * @param {Number} param id {Number} 团队等级id
+ */
+export function setShowApi(data) {
+    return request({
+        url: `user/group_level/set_show/${data.id}/${data.is_show}`,
+        method: 'PUT'
+    });
+}
+
+/**
+ * @description 团队等级-编辑表单
+ * @param {Number} param id {Number} 团队等级id
+ */
+// export function addApi (data) {
+//     return request({
+//         url: 'user/group_level',
+//         method: 'post',
+//         data
+//     });
+// }
+
+/**
+ * @description 团队等级任务-列表
+ * @param {Object} param data {Object} 传值参数
+ */
+export function taskListApi(id, data) {
+    return request({
+        url: `user/group_level/task/${id}`,
+        method: 'get',
+        params: data
+    });
+}
+
+/**
+ * @description 团队等级任务-修改显示隐藏
+ * @param {Number} param data.id {Number} 团队等级任务id
+ * @param {Number} param data.is_show {Number} 团队等级任务显示隐藏
+ */
+export function setTaskShowApi(data) {
+    return request({
+        url: `user/group_level/set_task_show/${data.id}/${data.is_show}`,
+        method: 'PUT'
+    });
+}
+
+/**
+ * @description 团队等级任务-任务是否达成
+ * @param {Number} param data.id {Number} 团队等级任务id
+ * @param {Number} param data.is_must {Number} 团队等级任务是否务必达成
+ */
+export function setTaskMustApi(data) {
+    return request({
+        url: `user/group_level/set_task_must/${data.id}/${data.is_must}`,
+        method: 'PUT'
+    });
+}
+
+/**
+ * @description 团队等级任务-新建表单 编辑表单
+ * @param {Object} param data {Object} 团队等级任务对象传值
+ */
+export function createTaskApi(data) {
+    return request({
+        url: `/user/group_level/create_task`,
+        method: 'get',
+        params: data
+    });
+}
+
+/**
+ * @description 团队等级-创建表单
+ * @param {Object} param data {Object} 团队等级任务对象传值
+ */
+export function createApi(id) {
+    return request({
+        url: `user/group_level/create`,
+        method: 'get',
+        params: id
+    });
+}
+
+/**
+ * @description 团队管理 --- 赠送团队等级
+ * @param {Number} param id {Number} 团队id
+ */
+export function giveLevelApi(id) {
+    return request({
+        url: `user/give_level/${id}`,
+        method: 'get'
+    });
+}
+
+/**
+ * @description 团队等级-删除
+ * @param {Number} param id {Number} 团队等级id
+ */
+export function delLevelApi(id) {
+    return request({
+        url: `user/group_level/delete/${id}`,
+        method: 'PUT'
+    });
+}
+/**
+ * @description 奖池类型 --- 获取所有奖池
+ */
+export function award_lake() {
+    return request({
+        url: `/user/award_lake`,
+        method: 'get'
+    });
+}
+/**
+ * @description 奖池记录--- 获取所有奖池
+ */
+export function award_lake_log(data) {
+    return request({
+        url: `/user/award_lake/log`,
+        method: 'get',
+		params: data
+    });
+}
+/**
+ * @description 发放奖励
+ */
+export function award_lake_post(data) {
+    return request({
+        url: `/user/award_lake/${data.type}`,
+        method: 'post',
+		data
+    });
+}
+

+ 353 - 0
src/pages/finance/bonus/list/index.vue

@@ -0,0 +1,353 @@
+<template>
+	<!-- 财务-充值记录 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
+			<div class="new_card_pd">
+				<!-- 查询条件 -->
+				<Form ref="formValidate" :model="formValidate" :label-width="labelWidth" inline
+					:label-position="labelPosition" class="tabform" @submit.native.prevent>
+					<FormItem label="时间选择:">
+						<DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal"
+							format="yyyy/MM/dd HH:mm" type="datetimerange" placement="bottom-start" placeholder="自定义时间"
+							class="input-width" :options="options"></DatePicker>
+					</FormItem>
+
+					<FormItem label="奖励类型:">
+						<Select v-model="formValidate.type" class="input-add">
+							<Option value="">全部</Option>
+							<Option v-for="(item,ind) in typeList" :value="item.id">{{item.name}}</Option>
+						</Select>
+						<Button type="primary" @click="orderSearch()" class="mr">查询</Button>
+						<Button type="primary" @click="dialogVisible= true" class="mr">发放奖励</Button>
+					</FormItem>
+				</Form>
+			</div>
+		</Card>
+		<!-- 中间数据卡片 -->
+		<cards-data :cardLists="cardLists" v-if="cardLists.length >= 0"></cards-data>
+		<Card :bordered="false" dis-hover>
+			<!--      <div>充值记录列表</div>-->
+			<!-- 表格 -->
+			<Table ref="table" :columns="columns" :data="tabList" class="ivu-mt" :loading="loading" no-data-text="暂无数据"
+				no-filtered-data-text="暂无筛选结果">
+				<template slot-scope="{ row }" slot="add_time">
+					<span>{{ row.add_time|formatDate }} </span>
+				</template>
+				<template slot-scope="{ row }" slot="type">
+					<span v-for="item in typeList" v-if="item.id==row.type">{{item.name}}</span>
+				</template>
+			</Table>
+			<div class="acea-row row-right page">
+				<Page :total="total" :current="formValidate.page" show-elevator show-total @on-change="pageChange"
+					:page-size="formValidate.limit" />
+			</div>
+		</Card>
+		<Drawer title="发放奖励" :closable="false" width="500" class-name="order_box" v-model="dialogVisible" :styles="{ padding: 20 }">
+			<Form ref="formValidate" :label-width="labelWidth" inline
+				:label-position="labelPosition" class="tabform" @submit.native.prevent>
+				<FormItem label="奖励类型:">
+					<Select v-model="sendType" class="input-add">
+						<Option value="">全部</Option>
+						<Option v-for="(item,ind) in typeList" :value="item.id">{{item.name}}</Option>
+					</Select>
+				</FormItem>
+				<FormItem label="发放金额:">
+				  <Input
+					placeholder="请输入发放金额"
+					class="input-add"
+					type="number"
+					v-model="sendMoney"
+					clearable
+				  />
+				</FormItem>
+				<FormItem >
+					<Button type="primary" @click="sendBonus()" class="mr">确定</Button>
+					<Button @click="dialogVisible=false" class="mr">取消</Button>
+				</FormItem>
+			</Form>
+		</Drawer>
+	</div>
+</template>
+<script>
+	import cardsData from "@/components/cards/cards";
+	import {
+		mapState
+	} from "vuex";
+	import exportExcel from "@/utils/newToExcel.js";
+	import {
+		award_lake,
+		award_lake_log,
+		award_lake_post
+		// userRechargeApi,
+		// refundEditApi,
+		// exportUserRechargeApi,
+	} from "@/api/newApi";
+	// import {
+	// 	userRechargeApi,
+	// } from "@/api/finance";
+	import timeOptions from "@/utils/timeOptions";
+	import { formatDate } from "@/utils/validate";
+	export default {
+		name: "rechargeBonus",
+		components: {
+			cardsData,
+		},
+		filters: {
+		  formatDate(time) {
+		    if (time !== 0) {
+		      let date = new Date(time * 1000);
+		      return formatDate(date, "yyyy-MM-dd hh:mm");
+		    }
+		  },
+		},
+		data() {
+			return {
+				sendType:'',//发放奖励的奖池类型
+				sendMoney:'',//发放奖励金额
+				typeList:[],//奖池类型
+				formValidate: {
+					data: "",
+					type: "",
+					change_type:'',
+					excel: 0,
+					page: 1,
+					limit: 20,
+				},
+				total: 0,
+				cardLists: [],
+				loading: false,
+				columns: [{
+						title: "ID",
+						key: "id",
+						sortable: true,
+						width: 80,
+					},
+					{
+						title: "创建时间",
+						slot: "add_time",
+						minWidth: 160,
+					},
+					{
+						title: "备注",
+						key: "mark",
+						minWidth: 150,
+					},
+					{
+						title: "金额",
+						key: "num",
+						minWidth: 110,
+					},
+					{
+						title: "类型",
+						slot: "type",
+						minWidth: 100,
+					},
+					// {
+					// 	title: "操作",
+					// 	slot: "right",
+					// 	minWidth: 100,
+					// },
+				],
+				tabList: [],
+				options: timeOptions,
+				timeVal: [],
+				dialogVisible:false,//显示弹窗
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 80;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		mounted() {
+			this.getList();
+			this.get_award_lake()
+		},
+		methods: {
+			// 发放奖励
+			sendBonus(){
+				award_lake_post({
+					type:this.sendType,
+					num:this.sendMoney
+				})
+					.then(async (res) => {
+						this.$Message.success(res.msg);
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 奖励类型
+			get_award_lake(){
+				award_lake()
+					.then(async (res) => {
+						this.typeList = res.data;
+						this.getUserRecharge(this.typeList);
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 编辑提交成功
+			submitFail() {
+				this.getList();
+				// this.get_award_lake();
+			},
+			// 具体日期
+			onchangeTime(e) {
+				this.timeVal = e;
+				this.formValidate.data = this.timeVal[0] ? this.timeVal.join("-") : "";
+				this.formValidate.page = 1;
+				this.getList();
+				// this.get_award_lake();
+			},
+			// 选择时间
+			selectChange(tab) {
+				this.formValidate.data = tab;
+				this.timeVal = [];
+				this.formValidate.page = 1;
+				this.getList();
+				// this.get_award_lake();
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				award_lake_log(this.formValidate)
+					.then(async (res) => {
+						let data = res.data;
+						this.tabList = data.list;
+						this.total = data.count;
+						this.loading = false;
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			// 搜索
+			orderSearch() {
+				this.formValidate.page = 1;
+				this.getList();
+			},
+			pageChange(index) {
+				this.formValidate.page = index;
+				this.getList();
+			},
+			// 小方块
+			getUserRecharge(item) {
+				 this.cardLists = item.map((res)=>{
+					return {
+				    col: 6,
+				    count: res.award,
+				    name: res.name,
+				    // className: "md-basket",
+				  }
+				})
+				
+				  // {
+				  //   col: 6,
+				  //   count: this.extractStatistics.price,
+				  //   name: "待提现金额",
+				  //   className: "md-basket",
+				  // },
+				  // {
+				  //   col: 6,
+				  //   count: this.extractStatistics.brokerage_count,
+				  //   name: "佣金总金额",
+				  //   className: "md-pricetags",
+				  // },
+				  // {
+				  //   col: 6,
+				  //   count: this.extractStatistics.priced,
+				  //   name: "已提现金额",
+				  //   className: "md-cash",
+				  // },
+				  // {
+				  //   col: 6,
+				  //   count: this.extractStatistics.brokerage_not,
+				  //   name: "未提现金额",
+				  //   className: "ios-cash",
+				  // },
+				
+				// userRechargeApi({
+				// 		data: this.formValidate.data,
+				// 		paid: this.formValidate.paid,
+				// 		nickname: this.formValidate.nickname,
+				// 	})
+				// 	.then(async (res) => {
+				// 		let data = res.data;
+				// 		this.cardLists = data;
+				// 	})
+				// 	.catch((res) => {
+				// 		this.$Message.error(res.msg);
+				// 	});
+			},
+			// 数据导出;
+			async exports() {
+				let [th, filekey, data, fileName] = [
+					[],
+					[],
+					[], ""
+				];
+				//   let fileName = "";
+				let excelData = JSON.parse(JSON.stringify(this.formValidate));
+				excelData.page = 1;
+				for (let i = 0; i < excelData.page + 1; i++) {
+					let lebData = await this.getExcelData(excelData);
+					if (!fileName) fileName = lebData.filename;
+					if (!filekey.length) {
+						filekey = lebData.filekey;
+					}
+					if (!th.length) th = lebData.header;
+					if (lebData.export.length) {
+						data = data.concat(lebData.export);
+						excelData.page++;
+					} else {
+						exportExcel(th, filekey, fileName, data);
+						return;
+					}
+				}
+			},
+		},
+	};
+</script>
+<style scoped lang="stylus">
+	.input-add {
+		width: 250px;
+		margin-right: 14px;
+		display: inline-table;
+	}
+
+	.ivu-mt .type .item {
+		margin: 3px 0;
+	}
+
+	.tabform {
+		margin-bottom: 10px;
+	}
+
+	.Refresh {
+		font-size: 12px;
+		color: #1890FF;
+		cursor: pointer;
+	}
+
+	.ivu-form-item {
+		margin-bottom: 10px;
+	}
+
+	.status>>>.item~.item {
+		margin-left: 6px;
+	}
+
+	.status>>>.statusVal {
+		margin-bottom: 7px;
+	}
+
+	/* .ivu-mt >>> .ivu-table-header */
+	/* border-top:1px dashed #ddd!important */
+</style>

+ 11 - 0
src/pages/product/productAdd/index.vue

@@ -1477,6 +1477,16 @@
               <div class="tips">通过命中关键字搜索对应商品,方便用户查找</div>
             </FormItem>
           </Col>
+		  <Col span="24">
+		    <FormItem label="VP:" prop="">
+		      <Input
+				  type="number"
+		          v-model="formValidate.vp"
+		          placeholder="请输入VP"
+		          v-width="'50%'"
+		      />
+		    </FormItem>
+		  </Col>
           <Col span="24">
             <FormItem label="商品简介:" prop="">
               <Input
@@ -2217,6 +2227,7 @@ export default {
         xs: 8,
       },
       formValidate: {
+		vp:'',
         applicable_store_id:[],
         system_form_id:0,//自定义表单id
         // supplier_id:0,//供应商

+ 460 - 392
src/pages/user/list/handle/userForm.vue

@@ -1,416 +1,484 @@
 <template>
-    <div>
-        <Form :model="formData" :label-width="76">
-            <div class="section">
-                <div class="section-hd">基本信息</div>
-                <div class="section-bd">
-                    <FormItem label="用户编号:">
-                        <Input v-model="formData.uid" disabled></Input>
-                    </FormItem>
-                    <FormItem label="真实姓名:">
-                        <Input v-model="formData.real_name" placeholder="请输入"></Input>
-                    </FormItem>
-                    <FormItem label="手机号码:">
-                        <Input v-model="formData.phone" placeholder="请输入"></Input>
-                    </FormItem>
-                    <FormItem label="生日:">
-                        <DatePicker :value="formData.birthday" @on-change="dateChange"></DatePicker>
-                    </FormItem>
-                    <FormItem label="性别:">
-                        <Select v-model="formData.sex">
-                            <Option :value="0">保密</Option>
-                            <Option :value="1">男</Option>
-                            <Option :value="2">女</Option>
-                        </Select>
-                    </FormItem>
-                    <FormItem label="省市区:">
-                        <Cascader v-model="addressSelect" :data="addresData" :load-data="loadData" @on-change="addchack"></Cascader>
-                    </FormItem>
-                    <FormItem label="身份证号:">
-                        <Input v-model="formData.card_id" placeholder="请输入"></Input>
-                    </FormItem>
-                    <FormItem label="详细地址:">
-                        <Input v-model="formData.addres" placeholder="请输入"></Input>
-                    </FormItem>
-                </div>
-            </div>
-            <div class="section">
-                <div class="section-hd">密码设置</div>
-                <div class="section-bd">
-                    <FormItem label="登录密码:">
-                        <Input v-model="formData.pwd" type="password" password placeholder="请输入"></Input>
-                    </FormItem>
-                    <FormItem label="确认密码:">
-                        <Input v-model="formData.true_pwd" type="password" password placeholder="请输入"></Input>
-                    </FormItem>
-                </div>
-            </div>
-            <div class="section">
-                <div class="section-hd">用户设置</div>
-                <div class="section-bd">
-                    <FormItem label="推广资格:">
-                        <i-switch v-model="formData.spread_open" :true-value="1" :false-value="0" size="large">
-                            <span slot="open">启用</span>
-                            <span slot="close">禁用</span>
-                        </i-switch>
-                    </FormItem>
-                    <FormItem label="用户状态:">
-                        <i-switch v-model="formData.status" :true-value="1" :false-value="0" size="large">
-                            <span slot="open">开启</span>
-                            <span slot="close">锁定</span>
-                        </i-switch>
-                    </FormItem>
-                    <FormItem label="用户标签:">
-                        <div class="flex-add">
-		                        <div class="labelInput acea-row row-between-wrapper" @click="openLabel">
-		                        	<div class="width-add">
-		                        		<div v-if="dataLabel.length">
-		                        			<Tag closable v-for="(item,index) in dataLabel" @on-close="closeLabel(item)">{{item.label_name}}</Tag>
-		                        		</div>
-		                        		<span class="span" v-else>选择用户关联标签</span>
-		                        	</div>
-		                        	<div class="iconfont iconxiayi"></div>
-		                        </div>
-                            <Button type="text" @click="add(1)">添加标签</Button>
-                        </div>
-                    </FormItem>
-                    <FormItem label="用户分组:">
-                        <div class="flex-add">
-                            <Select v-model="formData.group_id" placeholder="请选择" :transfer="true">
-                                <Option v-for="item in groupList" :key="item.id" :value="item.id">{{ item.group_name }}</Option>
-                            </Select>
-														<Button type="text" @click="add(2)">添加分组</Button>
-                        </div>
-                    </FormItem>
-                    <FormItem label="用户等级:">
-                        <Select v-model="formData.level">
-                            <Option v-for="item in levelOptions" :key="item.id" :value="item.id">{{ item.name }}</Option>
-                        </Select>
-                    </FormItem>
-                    <FormItem label="推广人:">
-                        <Input v-model="formData.spread_uid_nickname" @on-clear="clearSpread" clearable placeholder="请选择" icon="ios-arrow-down" @on-focus="editSpread"></Input>
-                    </FormItem>
-                </div>
-            </div>
-        </Form>
-				<Modal
-				  v-model="customerShow"
-				  scrollable
-				  title="请选择商城用户"
-				  :closable="false"
-				  width="900"
-				>
-				  <customerInfo v-if="customerShow" @imageObject="imageObject"></customerInfo>
-				</Modal>
-				<!-- 用户标签 -->
-				<Modal
-				  v-model="labelShow"
-				  scrollable
-				  title="选择用户标签"
-				  :closable="true"
-				  width="540"
-				  :footer-hide="true"
-					:mask-closable="false"
-				>
-				  <userLabel ref="userLabel" @activeData="activeData" @close="labelClose"></userLabel>
-				</Modal>
-    </div>
+	<div>
+		<Form :model="formData" :label-width="76">
+			<div class="section">
+				<div class="section-hd">基本信息</div>
+				<div class="section-bd">
+					<FormItem label="用户编号:">
+						<Input v-model="formData.uid" disabled></Input>
+					</FormItem>
+					<FormItem label="真实姓名:">
+						<Input v-model="formData.real_name" placeholder="请输入"></Input>
+					</FormItem>
+					<FormItem label="手机号码:">
+						<Input v-model="formData.phone" placeholder="请输入"></Input>
+					</FormItem>
+					<FormItem label="生日:">
+						<DatePicker :value="formData.birthday" @on-change="dateChange"></DatePicker>
+					</FormItem>
+					<FormItem label="性别:">
+						<Select v-model="formData.sex">
+							<Option :value="0">保密</Option>
+							<Option :value="1">男</Option>
+							<Option :value="2">女</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="省市区:">
+						<Cascader v-model="addressSelect" :data="addresData" :load-data="loadData"
+							@on-change="addchack"></Cascader>
+					</FormItem>
+					<FormItem label="身份证号:">
+						<Input v-model="formData.card_id" placeholder="请输入"></Input>
+					</FormItem>
+					<FormItem label="详细地址:">
+						<Input v-model="formData.addres" placeholder="请输入"></Input>
+					</FormItem>
+				</div>
+			</div>
+			<div class="section">
+				<div class="section-hd">密码设置</div>
+				<div class="section-bd">
+					<FormItem label="登录密码:">
+						<Input v-model="formData.pwd" type="password" password placeholder="请输入"></Input>
+					</FormItem>
+					<FormItem label="确认密码:">
+						<Input v-model="formData.true_pwd" type="password" password placeholder="请输入"></Input>
+					</FormItem>
+				</div>
+			</div>
+			<div class="section">
+				<div class="section-hd">用户设置</div>
+				<div class="section-bd">
+					<FormItem label="省市区:">
+						<Cascader v-model="addressAgency" :data="addresData" :load-data="loadAgencyData"
+							@on-change="addAgency"></Cascader>
+					</FormItem>
+					<FormItem label="代理级别:">
+						<Select v-model="formData.area_admin">
+							<Option :value="0">无</Option>
+							<Option :value="3">省</Option>
+							<Option :value="2">市</Option>
+							<Option :value="1">区</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="推广资格:">
+						<i-switch v-model="formData.spread_open" :true-value="1" :false-value="0" size="large">
+							<span slot="open">启用</span>
+							<span slot="close">禁用</span>
+						</i-switch>
+					</FormItem>
+					<FormItem label="用户状态:">
+						<i-switch v-model="formData.status" :true-value="1" :false-value="0" size="large">
+							<span slot="open">开启</span>
+							<span slot="close">锁定</span>
+						</i-switch>
+					</FormItem>
+					<FormItem label="用户标签:">
+						<div class="flex-add">
+							<div class="labelInput acea-row row-between-wrapper" @click="openLabel">
+								<div class="width-add">
+									<div v-if="dataLabel.length">
+										<Tag closable v-for="(item,index) in dataLabel" @on-close="closeLabel(item)">
+											{{item.label_name}}</Tag>
+									</div>
+									<span class="span" v-else>选择用户关联标签</span>
+								</div>
+								<div class="iconfont iconxiayi"></div>
+							</div>
+							<Button type="text" @click="add(1)">添加标签</Button>
+						</div>
+					</FormItem>
+					<FormItem label="用户分组:">
+						<div class="flex-add">
+							<Select v-model="formData.group_id" placeholder="请选择" :transfer="true">
+								<Option v-for="item in groupList" :key="item.id" :value="item.id">{{ item.group_name }}
+								</Option>
+							</Select>
+							<Button type="text" @click="add(2)">添加分组</Button>
+						</div>
+					</FormItem>
+					<FormItem label="用户等级:">
+						<Select v-model="formData.level">
+							<Option v-for="item in levelOptions" :key="item.id" :value="item.id">{{ item.name }}
+							</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="推广人:">
+						<Input v-model="formData.spread_uid_nickname" @on-clear="clearSpread" clearable
+							placeholder="请选择" icon="ios-arrow-down" @on-focus="editSpread"></Input>
+					</FormItem>
+				</div>
+			</div>
+		</Form>
+		<Modal v-model="customerShow" scrollable title="请选择商城用户" :closable="false" width="900">
+			<customerInfo v-if="customerShow" @imageObject="imageObject"></customerInfo>
+		</Modal>
+		<!-- 用户标签 -->
+		<Modal v-model="labelShow" scrollable title="选择用户标签" :closable="true" width="540" :footer-hide="true"
+			:mask-closable="false">
+			<userLabel ref="userLabel" @activeData="activeData" @close="labelClose"></userLabel>
+		</Modal>
+	</div>
 </template>
 
 <script>
-import { userLabelAddApi, groupAddApi, levelListApi, userGroupApi, userLabelApi, putUserApi } from '@/api/user';
-import { cityApi } from '@/api/store';
-import customerInfo from "@/components/customerInfo";
-import userLabel from "@/components/labelList";
+	import {
+		userLabelAddApi,
+		groupAddApi,
+		levelListApi,
+		userGroupApi,
+		userLabelApi,
+		putUserApi
+	} from '@/api/user';
+	import {
+		cityApi
+	} from '@/api/store';
+	import customerInfo from "@/components/customerInfo";
+	import userLabel from "@/components/labelList";
 
-export default {
-    name: 'userForm',
+	export default {
+		name: 'userForm',
 		components: {
-		  customerInfo,
+			customerInfo,
 			userLabel
 		},
-    props: {
-        psInfo: Object
-    },
-    data() {
-        return {
-					  labelShow:false,
-					  customerShow: false,
-            formData: {
-                uid: this.psInfo.uid,
-                real_name: this.psInfo.real_name,
-                phone: this.psInfo.phone,
-                birthday: this.psInfo.birthday,
-                sex: this.psInfo.sex,
-                card_id: this.psInfo.card_id,
-                addres: this.psInfo.addres,
-                pwd: '',
-                true_pwd: '',
-                spread_open: this.psInfo.spread_open,
-                status: this.psInfo.status,
-                group_id: 0,
-                label_id: [],
-                level: this.psInfo.level,
-                provincials: '',
-                province: 0,
-                city: 0,
-                area: 0,
-                street: 0,
-								spread_uid: 0,
-								spread_uid_nickname:''
-            },
-						dataLabel: [],
-            addressSelect: [],
-            levelOptions: [],
-            labelOptions: [],
-            addresData: [],
-						groupList: []
-        };
-    },
-    watch: {
-        psInfo: {
-          handler(value) {
-            this.formData.uid = value.uid;
-            this.formData.real_name = value.real_name;
-            this.formData.phone = value.phone;
-            this.formData.birthday = value.birthday;
-            this.formData.sex = value.sex;
-            this.formData.card_id = value.card_id;
-            this.formData.addres = value.addres;
-            this.formData.spread_open = value.spread_open;
-            this.formData.status = value.status;
-            this.dataLabel = value.label_id;
-            this.formData.level = value.level;
-            this.formData.provincials = value.provincials;
-            this.formData.province = value.province;
-            this.formData.city = value.city;
-            this.formData.area = value.area;
-            this.formData.street = value.street;
-						this.formData.spread_uid_nickname = value.spread_uid_nickname;
-						this.formData.spread_uid = value.spread_uid;
-            this.formData.group_id = value.group_id;
-          },
-          immediate: true
-        }
-    },
-    created () {
-        this.levelList();
-        this.groupLists();
-        this.labelList();
-        this.cityInfo({ pid: 0 });
-        if (this.psInfo.province) {
-            this.addressSelect.push(this.psInfo.province);
-        }
-        if (this.psInfo.city) {
-            this.addressSelect.push(this.psInfo.city);
-        }
-        if (this.psInfo.area) {
-            this.addressSelect.push(this.psInfo.area);
-        }
-        if (this.psInfo.street) {
-            this.addressSelect.push(this.psInfo.street);
-        }
-    },
-    methods: {
-			  clearSpread(){
-					this.formData.spread_uid = 0;
-					this.formData.spread_uid_nickname = '';
-				},
-				closeLabel(label){
-					let index = this.dataLabel.indexOf(this.dataLabel.filter(d=>d.id == label.id)[0]);
-					this.dataLabel.splice(index,1);
-				},
-				activeData(dataLabel){
-					this.labelShow = false;
-					this.dataLabel = dataLabel;
-				},
-				openLabel() {
-					this.labelShow = true;
-					this.$refs.userLabel.userLabel(JSON.parse(JSON.stringify(this.dataLabel)));
-				},
-				// 标签弹窗关闭
-				labelClose() {
-				  this.labelShow = false;
-				},
-				editSpread(){
-					this.customerShow = true;
+		props: {
+			psInfo: Object,
+		},
+		data() {
+			return {
+				labelShow: false,
+				customerShow: false,
+				formData: {
+					uid: this.psInfo.uid,
+					real_name: this.psInfo.real_name,
+					phone: this.psInfo.phone,
+					birthday: this.psInfo.birthday,
+					sex: this.psInfo.sex,
+					card_id: this.psInfo.card_id,
+					addres: this.psInfo.addres,
+					pwd: '',
+					true_pwd: '',
+					spread_open: this.psInfo.spread_open,
+					status: this.psInfo.status,
+					group_id: 0,
+					label_id: [],
+					level: this.psInfo.level,
+					provincials: '',
+					province: 0,
+					city: 0,
+					area: 0,
+					street: 0,
+					spread_uid: 0,
+					spread_uid_nickname: '',
+					area_province: 0,
+					area_city: 0,
+					area_district: 0,
+					agency_provincials:'',
+					area_admin:0,//省市区级别
 				},
-				imageObject(e) {
-				  this.customerShow = false;
-				  this.formData.spread_uid = e.uid;
-					this.formData.spread_uid_nickname = e.name
+				dataLabel: [],
+				addressSelect: [],
+				addressAgency: [],//选中的省市区代理
+				levelOptions: [],
+				labelOptions: [],
+				addresData: [],
+				groupList: []
+			};
+		},
+		watch: {
+			psInfo: {
+				handler(value) {
+					this.formData.uid = value.uid;
+					this.formData.real_name = value.real_name;
+					this.formData.phone = value.phone;
+					this.formData.birthday = value.birthday;
+					this.formData.sex = value.sex;
+					this.formData.card_id = value.card_id;
+					this.formData.addres = value.addres;
+					this.formData.spread_open = value.spread_open;
+					this.formData.status = value.status;
+					this.dataLabel = value.label_id;
+					this.formData.level = value.level;
+					this.formData.provincials = value.provincials;
+					this.formData.province = value.province;
+					this.formData.city = value.city;
+					this.formData.area = value.area;
+					this.formData.street = value.street;
+					this.formData.spread_uid_nickname = value.spread_uid_nickname;
+					this.formData.spread_uid = value.spread_uid;
+					this.formData.group_id = value.group_id;
+					// 代理省市区
+					this.formData.area_province=value.area_province;
+					this.formData.area_city=value.area_city;
+					this.formData.area_district=value.area_district;
+					this.formData.agency_provincials=value.agency_provincials;
+					this.formData.area_admin=value.area_admin;
 				},
-        changeMenu (value) {
-            this.$emit('change-menu', value);
-        },
-        // 添加标签、分组
-        add (value) {
-            switch (value) {
-                case 1:
-                    this.$modalForm(userLabelAddApi(0)).then(() => {});
-                    break;
-                case 2:
-                    this.$modalForm(groupAddApi(0)).then(() => {
-											this.groupLists();
-										});
-                    break;
-            }
-        },
-        // 会员等级列表
-        levelList() {
-        let data = {
-            page: 1,
-            limit: "",
-            title: "",
-            is_show: 1,
-        };
-        levelListApi(data).then((res) => {
-            this.levelOptions = res.data.list;
-        });
-        },
-        groupLists() {
-            let data = {
-                page: 1,
-                limit: "",
-            };
-            userGroupApi(data).then((res) => {
-                this.groupList = res.data.list;
-            });
-            },
-        labelList() {
-            let data = {
-                page: 1,
-                limit: "",
-            };
-            userLabelApi(data)
-                .then(async (res) => {
-                let data = res.data;
-                this.labelOptions = data.list;
-                })
-                .catch((res) => {
-                this.loading = false;
-                this.$Message.error(res.msg);
-                });
-            },
-        // 省市区数据
-        cityInfo(data){
-            cityApi(data).then(res=>{
-                this.addresData = res.data
-            })
-        },
-        loadData(item, callback) {
-            item.loading = true;
-            cityApi({pid:item.value}).then(res=>{
-                item.children = res.data;
-                item.loading = false;
-                callback();
-            });
-        },
-        addchack(e,selectedData){
-            e.forEach((i,index)=>{
-                if(index==0){
-                    this.formData.province = i
-                }else if(index==1){
-                    this.formData.city = i
-                }else if(index==2){
-                    this.formData.area = i
-                }else {
-                    this.formData.street = i
-                }
-            })
-            this.formData.provincials = (selectedData.map(o => o.label)).join("/");
-        },
-        dateChange (value) {
-            this.formData.birthday = value;
-        },
-        // 保存用户信息
-        detailsPut () {
-					  let activeIds = [];
-					  this.dataLabel.forEach((item)=>{
-					  	activeIds.push(item.id)
-					  });
-						this.formData.label_id = activeIds
-						if (this.formData.phone && !/^1(3|4|5|7|8|9|6)\d{9}$/.test(this.formData.phone)) {
-							return this.$Message.error('请填写正确的手机号');
-						}
-            putUserApi(this.formData).then(res => {
-							  this.$Message.success('修改成功');
-                this.$emit('change-menu', '99');
-            }).catch(res => {
-                this.$Message.error(res.msg);
-            });
-        }
-    }
-}
+				immediate: true
+			}
+		},
+		created() {
+			this.levelList();
+			this.groupLists();
+			this.labelList();
+			this.cityInfo({
+				pid: 0
+			});
+			if (this.psInfo.province) {
+				this.addressSelect.push(this.psInfo.province);
+			}
+			if (this.psInfo.city) {
+				this.addressSelect.push(this.psInfo.city);
+			}
+			if (this.psInfo.area) {
+				this.addressSelect.push(this.psInfo.area);
+			}
+			if (this.psInfo.street) {
+				this.addressSelect.push(this.psInfo.street);
+			}
+			// 省市区代理
+			if (this.psInfo.area_province) {
+				this.addressAgency.push(this.psInfo.area_province);
+			}
+			if (this.psInfo.area_city) {
+				this.addressAgency.push(this.psInfo.area_city);
+			}
+			if (this.psInfo.area_district) {
+				this.addressAgency.push(this.psInfo.area_district);
+			}
+		},
+		methods: {
+			clearSpread() {
+				this.formData.spread_uid = 0;
+				this.formData.spread_uid_nickname = '';
+			},
+			closeLabel(label) {
+				let index = this.dataLabel.indexOf(this.dataLabel.filter(d => d.id == label.id)[0]);
+				this.dataLabel.splice(index, 1);
+			},
+			activeData(dataLabel) {
+				this.labelShow = false;
+				this.dataLabel = dataLabel;
+			},
+			openLabel() {
+				this.labelShow = true;
+				this.$refs.userLabel.userLabel(JSON.parse(JSON.stringify(this.dataLabel)));
+			},
+			// 标签弹窗关闭
+			labelClose() {
+				this.labelShow = false;
+			},
+			editSpread() {
+				this.customerShow = true;
+			},
+			imageObject(e) {
+				this.customerShow = false;
+				this.formData.spread_uid = e.uid;
+				this.formData.spread_uid_nickname = e.name
+			},
+			changeMenu(value) {
+				this.$emit('change-menu', value);
+			},
+			// 添加标签、分组
+			add(value) {
+				switch (value) {
+					case 1:
+						this.$modalForm(userLabelAddApi(0)).then(() => {});
+						break;
+					case 2:
+						this.$modalForm(groupAddApi(0)).then(() => {
+							this.groupLists();
+						});
+						break;
+				}
+			},
+			// 会员等级列表
+			levelList() {
+				let data = {
+					page: 1,
+					limit: "",
+					title: "",
+					is_show: 1,
+				};
+				levelListApi(data).then((res) => {
+					this.levelOptions = res.data.list;
+				});
+			},
+			groupLists() {
+				let data = {
+					page: 1,
+					limit: "",
+				};
+				userGroupApi(data).then((res) => {
+					this.groupList = res.data.list;
+				});
+			},
+			labelList() {
+				let data = {
+					page: 1,
+					limit: "",
+				};
+				userLabelApi(data)
+					.then(async (res) => {
+						let data = res.data;
+						this.labelOptions = data.list;
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			// 省市区数据
+			cityInfo(data) {
+				cityApi(data).then(res => {
+					this.addresData = res.data
+				})
+			},
+			loadData(item, callback) {
+				item.loading = true;
+				console.log(item,'cs')
+				cityApi({
+					pid: item.value
+				}).then(res => {
+					item.children = res.data;
+					item.loading = false;
+					callback();
+				});
+			},
+			loadAgencyData(item, callback) {
+				item.loading = true;
+				cityApi({
+					pid: item.value,
+					type:2
+				}).then(res => {
+					item.children = res.data;
+					item.loading = false;
+					callback();
+				});
+			},
+			addchack(e, selectedData) {
+				e.forEach((i, index) => {
+					if (index == 0) {
+						this.formData.province = i
+					} else if (index == 1) {
+						this.formData.city = i
+					} else if (index == 2) {
+						this.formData.area = i
+					} else {
+						this.formData.street = i
+					}
+				})
+				this.formData.provincials = (selectedData.map(o => o.label)).join("/");
+			},
+			addAgency(e, selectedData) {
+				e.forEach((i, index) => {
+					if (index == 0) {
+						this.formData.area_province = i
+					} else if (index == 1) {
+						this.formData.area_city = i
+					} else if (index == 2) {
+						this.formData.area_district = i
+					}
+				})
+				this.formData.agency_provincials = (selectedData.map(o => o.label)).join("/");
+			},
+			dateChange(value) {
+				this.formData.birthday = value;
+			},
+			// 保存用户信息
+			detailsPut() {
+				let activeIds = [];
+				this.dataLabel.forEach((item) => {
+					activeIds.push(item.id)
+				});
+				this.formData.label_id = activeIds
+				if (this.formData.phone && !/^1(3|4|5|7|8|9|6)\d{9}$/.test(this.formData.phone)) {
+					return this.$Message.error('请填写正确的手机号');
+				}
+				putUserApi(this.formData).then(res => {
+					this.$Message.success('修改成功');
+					this.$emit('change-menu', '99');
+				}).catch(res => {
+					this.$Message.error(res.msg);
+				});
+			}
+		}
+	}
 </script>
 
 <style lang="less" scoped>
-.flex-add {
- display: flex;
-}
-.width-add {
- width: 90%;
-}
-.section {
-    padding: 25px 0 5px;
-    border-top: 1px dashed #EEEEEE;
+	.flex-add {
+		display: flex;
+	}
+
+	.width-add {
+		width: 90%;
+	}
 
-    &:first-child {
-        border-top: 0;
-    }
+	.section {
+		padding: 25px 0 5px;
+		border-top: 1px dashed #EEEEEE;
 
-    &-hd {
-        padding-left: 10px;
-        border-left: 3px solid #1890FF;
-        font-weight: 500;
-        font-size: 14px;
-        line-height: 16px;
-        color: #303133;
-    }
+		&:first-child {
+			border-top: 0;
+		}
 
-    &-bd {
-        display: flex;
-        flex-wrap: wrap;
-        margin-top: 20px;
-    }
+		&-hd {
+			padding-left: 10px;
+			border-left: 3px solid #1890FF;
+			font-weight: 500;
+			font-size: 14px;
+			line-height: 16px;
+			color: #303133;
+		}
 
-    .ivu-form-item {
-        flex: 0 0 50%;
-        margin-bottom: 20px;
+		&-bd {
+			display: flex;
+			flex-wrap: wrap;
+			margin-top: 20px;
+		}
 
-        &:nth-child(odd) {
-            padding-right: 48px;
-        }
+		.ivu-form-item {
+			flex: 0 0 50%;
+			margin-bottom: 20px;
 
-        &:nth-child(even) {
-            padding-left: 48px;
-        }
-    }
+			&:nth-child(odd) {
+				padding-right: 48px;
+			}
 
-    .ivu-date-picker {
-        width: 100%;
-    }
+			&:nth-child(even) {
+				padding-left: 48px;
+			}
+		}
 
-    .ivu-btn-text {
-        color: #1890FF;
+		.ivu-date-picker {
+			width: 100%;
+		}
 
-        &:focus {
-            box-shadow: none;
-        }
-    }
-}
-.labelInput{
-	border: 1px solid #dcdee2;
-	width: 100%;
-	padding: 0 5px;
-	border-radius: 5px;
-	min-height: 30px;
-	cursor: pointer;
-	.span{
-		 color: #c5c8ce;
+		.ivu-btn-text {
+			color: #1890FF;
+
+			&:focus {
+				box-shadow: none;
+			}
+		}
 	}
-	.iconxiayi{
-		font-size: 12px
+
+	.labelInput {
+		border: 1px solid #dcdee2;
+		width: 100%;
+		padding: 0 5px;
+		border-radius: 5px;
+		min-height: 30px;
+		cursor: pointer;
+
+		.span {
+			color: #c5c8ce;
+		}
+
+		.iconxiayi {
+			font-size: 12px
+		}
 	}
-}
-</style>
+</style>

+ 11 - 0
src/pages/user/list/handle/userInfo.vue

@@ -46,6 +46,17 @@
         <div class="section">
             <div class="section-hd">用户概况</div>
             <div class="section-bd">
+				<div class="item">
+				    <div>代理区域:</div>
+				    <div class="value">{{ psInfo.agency_provincials}}</div>
+				</div>
+				<div class="item">
+				    <div>代理级别:</div>
+				    <div class="value" v-if="psInfo.area_admin==0">未代理</div>
+				    <div class="value" v-else-if="psInfo.area_admin==1">区</div>
+				    <div class="value" v-else-if="psInfo.area_admin==2">市</div>
+				    <div class="value" v-else-if="psInfo.area_admin==3">省</div>
+				</div>
                 <div class="item">
                     <div>推广资格:</div>
                     <div class="value">{{ psInfo.spread_open ? '启用' : '禁用' }}</div>

+ 3 - 0
src/pages/user/list/index.vue

@@ -454,6 +454,9 @@
           </template>
         </vxe-column>
         <vxe-column field="level" title="用户等级" min-width="90"></vxe-column>
+        <vxe-column field="group_vip_name" title="团队等级" min-width="90"></vxe-column>
+        <vxe-column field="award_range" title="分红额度" min-width="90"></vxe-column>
+        <vxe-column field="award_piece" title="分红值" min-width="90"></vxe-column>
         <vxe-column field="group_id" title="分组" min-width="100"></vxe-column>
         <vxe-column field="phone" title="手机号" min-width="110"></vxe-column>
         <vxe-column field="user_type" title="用户类型" min-width="100"></vxe-column>

+ 253 - 0
src/pages/user/team/handle/task.vue

@@ -0,0 +1,253 @@
+<template>
+    <Modal v-model="modals" :z-index="1"  scrollable  footer-hide closable title="等级任务" :mask-closable="false" width="950" @on-cancel="handleReset">
+        <Form ref="levelFrom" :model="levelFrom"  :label-width="labelWidth" :label-position="labelPosition" @submit.native.prevent>
+            <Row type="flex" :gutter="24">
+                <Col v-bind="grid">
+                    <FormItem label="状态:">
+                        <Select v-model="levelFrom.is_show" placeholder="是否显示" clearable @on-change="userSearchs">
+                            <Option value="1">显示</Option>
+                            <Option value="0">不显示</Option>
+                        </Select>
+                    </FormItem>
+                </Col>
+                <Col v-bind="grid">
+                    <FormItem label="任务名称:" prop="status2" label-for="status2">
+                        <Input search enter-button  v-model="levelFrom.name" placeholder="请输入任务名称" @on-search="userSearchs" style="width: 100%"/>
+                    </FormItem>
+                </Col>
+            </Row>
+        </Form>
+        <Divider dashed />
+        <Row type="flex">
+            <Col v-bind="grid" class="mb15">
+                <Button type="primary"  icon="md-add" @click="add">添加等级任务</Button>
+            </Col>
+            <Col span="24" class="userAlert">
+                <Alert show-icon closable>添加等级任务,任务类型中的{$num}会自动替换成限定数量+系统预设的单位生成任务名</Alert>
+            </Col>
+        </Row>
+        <Divider dashed />
+        <Table :columns="columns1" :data="levelLists" ref="table"
+               :loading="loading"
+               no-userFrom-text="暂无数据"
+               no-filtered-userFrom-text="暂无筛选结果">
+            <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"  size="large" @on-change="onchangeIsShow(row)">
+                    <span slot="open">显示</span>
+                    <span slot="close">隐藏</span>
+                </i-switch>
+            </template>
+            <template slot-scope="{ row, index }" slot="is_musts">
+                <i-switch v-model="row.is_must" :value="row.is_must" :true-value="1" :false-value="0"  size="large" @on-change="onchangeIsMust(row)">
+                    <span slot="open">全部完成</span>
+                    <span slot="close">达成其一</span>
+                </i-switch>
+            </template>
+            <template slot-scope="{ row, index }" slot="action">
+                <a @click="edit(row)">编辑  | </a>
+                <a @click="del(row,'删除等级任务',index)">  删除</a>
+            </template>
+        </Table>
+        <div class="acea-row row-right page">
+            <Page :total="total" show-elevator show-total @on-change="pageChange"
+                  :page-size="levelFrom.limit"/>
+        </div>
+        <!-- 新建 编辑表单-->
+        <edit-from ref="edits" :FromData="FromData" @submitFail="submitFail" :titleType="titleType"></edit-from>
+    </Modal>
+</template>
+
+<script>
+    import { mapState, mapMutations } from 'vuex';
+    import { taskListApi, setTaskShowApi, setTaskMustApi, createTaskApi } from '@/api/newApi';
+    import editFrom from '@/components/from/from';
+    export default {
+        name: 'task',
+        components: { editFrom },
+        data () {
+            return {
+                // levelIds: this.levelId,
+                grid: {
+                    xl: 10,
+                    lg: 10,
+                    md: 12,
+                    sm: 24,
+                    xs: 24
+                },
+                modals: false,
+                levelFrom: {
+                    is_show: '',
+                    name: '',
+                    page: 1,
+                    limit: 20
+                },
+                total: 0,
+                levelLists: [],
+                loading: false,
+                columns1: [
+                    {
+                        title: 'ID',
+                        key: 'id',
+                        sortable: true,
+                        width: 80
+                    },
+                    {
+                        title: '等级名称',
+                        key: 'level_name',
+                        minWidth: 100
+                    },
+                    {
+                        title: '任务名称',
+                        key: 'name',
+                        minWidth: 120
+                    },
+                    {
+                        title: '排序',
+                        sort: 'grade',
+                        sortable: true,
+                        minWidth: 100
+                    },
+                    {
+                        title: '是否显示',
+                        slot: 'is_shows',
+                        minWidth: 110
+                    },
+                    {
+                        title: '务必达成',
+                        slot: 'is_musts',
+                        minWidth: 135
+                    },
+                    {
+                        title: '任务说明',
+                        key: 'illustrate',
+                        minWidth: 120
+                    },
+                    {
+                        title: '操作',
+                        slot: 'action',
+                        fixed: 'right',
+                        minWidth: 120
+                    }
+                ],
+                FromData: null,
+                ids: 0,
+                modalTitleSs: '',
+                titleType: 'task'
+            }
+        },
+        computed: {
+            ...mapState('admin/layout', [
+                'isMobile'
+            ]),
+            ...mapState('admin/userLevel', [
+                'levelId'
+            ]),
+            labelWidth () {
+                return this.isMobile ? undefined : 75;
+            },
+            labelPosition () {
+                return this.isMobile ? 'top' : 'right';
+            }
+        },
+        methods: {
+            ...mapMutations('admin/userLevel', [
+                'getTaskId',
+                'getlevelId'
+            ]),
+            // 添加
+            add () {
+                this.ids = '';
+                this.getFrom();
+            },
+            // 新建 编辑表单
+            getFrom () {
+                let data = {
+                    id: this.ids,
+                    level_id: this.levelId
+                };
+                this.$modalForm(createTaskApi(data)).then(
+                    () => this.getList()
+                );
+            },
+            // 编辑
+            edit (row) {
+                this.ids = row.id;
+                this.getFrom()
+            },
+            // 关闭模态框
+            handleReset () {
+                this.modals = false;
+            },
+            // 表格搜索
+            userSearchs () {
+                this.getList();
+            },
+            // 任务列表
+            getList () {
+                this.loading = true;
+                this.levelFrom.is_show = this.levelFrom.is_show || '';
+                taskListApi(this.levelId, 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();
+            },
+            // 修改显示隐藏
+            onchangeIsShow (row) {
+                let data = {
+                    id: row.id,
+                    is_show: row.is_show
+                }
+                setTaskShowApi(data).then(async res => {
+                    this.$Message.success(res.msg);
+                }).catch(res => {
+                    this.$Message.error(res.msg);
+                })
+            },
+            // 设置任务是否达成
+            onchangeIsMust (row) {
+                let data = {
+                    id: row.id,
+                    is_must: row.is_must
+                }
+                setTaskMustApi(data).then(async res => {
+                    this.$Message.success(res.msg);
+                }).catch(res => {
+                    this.$Message.error(res.msg);
+                })
+            },
+            // 新建编辑提交成功
+            submitFail () {
+                this.getList();
+            },
+            // 删除任务
+            del (row, tit, num) {
+                let delfromData = {
+                    title: tit,
+                    num: num,
+                    url: `user/user_level/delete_task/${row.id}`,
+                    method: 'DELETE',
+                    ids: ''
+                };
+                this.$modalSure(delfromData).then((res) => {
+                    this.$Message.success(res.msg);
+                    this.levelLists.splice(num, 1);
+                }).catch(res => {
+                    this.$Message.error(res.msg);
+                });
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 275 - 0
src/pages/user/team/index.vue

@@ -0,0 +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>
+</template>
+<script>
+    import { mapState, mapMutations } from 'vuex';
+    import { levelListApi, setShowApi, createApi } from '@/api/newApi';
+    import taskList from './handle/task';
+    import editFrom from '@/components/from/from';
+    export default {
+        name: 'user_team',
+        components: { editFrom, taskList },
+        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: '是否显示',
+                        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/group_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 || '';
+				console.log('开始请求');
+                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();
+            }
+        }
+    }
+</script>
+
+<style scoped lang="stylus">
+    .tabBox_img
+        width 36px
+        height 36px
+        border-radius:4px
+        cursor pointer
+        img
+            width 100%
+            height 100%
+</style>

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

@@ -41,6 +41,15 @@ export default {
             },
             component: () => import('@/pages/finance/financialRecords/recharge')
         },
+		{
+		    path: 'bonus_list/index',
+		    name: `${pre}bonuslist`,
+		    meta: {
+		        auth: ['finance-bonus-list'],
+		        title: '奖池记录'
+		    },
+		    component: () => import('@/pages/finance/bonus/list/index')
+		},
         {
             path: 'finance/bill',
             name: `${pre}bill`,

+ 10 - 0
src/router/modules/user.js

@@ -82,6 +82,16 @@ export default {
             },
             component: () => import('@/components/fromSubmit/commonForm.vue')
         },
+		{
+		    path: `${Setting.roterPre}/team/level/list`,
+		    name: `${pre}team`,
+		    meta: {
+		        auth: ['user-user-team'],
+		        footer: true,
+		        title: '团队等级'
+		    },
+		    component: () => import('@/pages/user/team/index')
+		},
         {
             path: `${Setting.roterPre}/user/group`,
             name: `${pre}group`,

+ 15 - 1
vue.config.js

@@ -28,7 +28,21 @@ module.exports = {
   productionSourceMap: false, //关闭生产环境下的SourceMap映射文件
   devServer: {
     publicPath: Setting.publicPath,
-    
+	  port: 1617, //端口号
+	  proxy: {
+	    // "/adminapi": {
+	    '/adminapi': {
+	      // "target" : "https://www.psgjsc.com" ,//目标接口域名
+	      target: 'https://mall.tzyqkj.com', //目标接口域名
+	      ws: true,
+	      changeOrigin: true,
+	      // "changeOrigin" : true, //是否跨域
+	      // "secure" : true ,// 设置支持https协议的代理
+	      // "pathRewrite" : {
+	      //     "/adminapi" : "" // rewrite path
+	      // }
+	    },
+	  },
   },
 
   // 打包优化