lhl 1 tháng trước cách đây
mục cha
commit
400b2b0592

+ 43 - 0
src/api/agent.js

@@ -155,3 +155,46 @@ export function recordList(params) {
 	    params
 	})
 }
+
+//store/agent/save
+// 添加区域代理
+export function addStoreAgent(data) {
+	return request({
+	    url: 'store/agent/save',
+	    method: 'post',
+	    data
+	})
+}
+//getStoreAgentList
+// 区域代理列表
+export function getStoreAgentList(params) {
+	return request({
+	    url: 'store/agent/lst',
+	    method: 'get',
+	    params
+	})
+}
+
+export function getStoreAgentGdList(params) {
+	return request({
+	    url: 'store/agent/qd_lst',
+	    method: 'get',
+	    params
+	})
+}
+
+export function getQzList(params) {
+	return request({
+	    url: 'stockRights/user_bonus_lst',
+	    method: 'get',
+	    params
+	})
+}
+
+export function getQzBhList(params) {
+	return request({
+	    url: 'stockRights/bonus_num_lst',
+	    method: 'get',
+	    params
+	})
+}

+ 8 - 0
src/api/statistic.js

@@ -353,3 +353,11 @@ export function SubscribeGetExcel(params) {
     params
   });
 }
+
+export function getPhList(params) {
+	return request({
+	  url: '/work/rankingList',
+	  method: 'get',
+	  params
+	});
+}

+ 9 - 0
src/api/user.js

@@ -10,6 +10,15 @@
 
 import request from '@/plugins/request';
 
+
+//
+export function sendMsgs(data) {
+    return request({
+        url: 'user/user_sms',
+        method: 'post',
+        data
+    });
+}
 /**
  * @description 用户管理--列表
  * @param {Object} param data {Object} 传值参数

+ 715 - 0
src/pages/agent/dl/add.vue

@@ -0,0 +1,715 @@
+<template>
+	<div class="form-submit">
+		<div class="i-layout-page-header">
+			<PageHeader class="product_tabs" hidden-breadcrumb>
+				<div slot="title">
+					<router-link :to="{ path: `${roterPre}/agent/dl/index` }">
+						<div class="font-sm after-line">
+							<span class="iconfont iconfanhui"></span>
+							<span class="pl10">返回</span>
+						</div>
+					</router-link>
+					<span v-text="$route.params.id ? '编辑' : '添加'" class="mr20 ml16"></span>
+				</div>
+			</PageHeader>
+		</div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Form :model="formData" :label-width="150">
+				<FormItem label="选择用户:" prop="product_id" required>
+					<div class="picBox">
+						<Button type="primary" v-if="!formData.uid" @click="changeGoods()">选择用户</Button>
+						<template v-else>
+							<div class="">
+								昵称:{{formData.name}}(UID:{{formData.uid}})
+							</div>
+							<Button type="primary"  @click="changeGoods()">切换用户</Button>
+						</template>
+					</div>
+					<div></div>
+				</FormItem>
+				<FormItem label="代理区域:" label-for="address" prop="address" required>
+					<el-tag v-for="tag in addressList" :key="tag.value" closable style="margin-right: 20px;" @close="handleClose(tag)">
+						{{tag.label}}
+					</el-tag>
+					<Button type="primary" @click="addAddress()">添加代理区域</Button>
+					<!-- checkStrictly -->
+					<!-- <Cascader :data="addresData" :load-data="loadData" v-model="formData.address" @on-change="addchack"
+						class="inputW" :props="{ multiple: true, checkStrictly: true }"></Cascader> -->
+
+				</FormItem>
+				<FormItem label="代理商品:" >
+					<div >
+					  <Row :gutter="24" type="flex" class="mb20">
+					    <Col span="24" class="">
+					      <Button type="primary" @click="addGoods">添加商品</Button>
+					    </Col>
+					  </Row>
+					  <div class="vxeTable" >
+					    <vxe-table
+					        border="inner"
+					        ref="xTree"
+					        :column-config="{resizable: true}"
+					        row-id="id"
+					        :data="tableData">
+					      <vxe-column field="info" title="商品信息" tree-node min-width="300">
+					        <template v-slot="{ row }">
+					          <div class="imgPic acea-row row-middle">
+					            <viewer>
+					            </viewer>
+					            <div class="info">
+					              <Tooltip max-width="200" placement="bottom" transfer>
+					                <span class="line2">{{ row.store_name }}</span>
+					                <p slot="content">{{ row.store_name }}</p>
+					              </Tooltip>
+					            </div>
+					          </div>
+					        </template>
+					      </vxe-column>
+					      <vxe-column field="price" title="售价" min-width="80"></vxe-column>
+					      <vxe-column field="cost" title="成本价" min-width="80"></vxe-column>
+					      <vxe-column field="discount" title="区域代理特价" min-width="80">
+					        <template v-slot="{ row }">
+								<InputNumber v-model="row.v_price" v-width="80"></InputNumber>
+					        </template>
+					      </vxe-column>
+					      <vxe-column field="date" title="操作" min-width="150" fixed="right" align="center">
+					        <template v-slot="{ row }">
+					          <a @click="del(row)">删除</a>
+					        </template>
+					      </vxe-column>
+					    </vxe-table>
+					  </div>
+					</div>
+				</FormItem>
+				<FormItem>
+					<Button type="primary" class="submission" @click="save" :disabled="disabled">保存</Button>
+				</FormItem>
+			</Form>
+		</Card>
+		<Modal v-model="modals" title="用户列表" footerHide class="paymentFooter" scrollable width="900"
+			@on-cancel="cancel">
+			<user-list ref="goodslist" :goodsType="1" v-if="modals" @imageObject="getProductId"
+				:serviceProject="1"></user-list>
+		</Modal>
+		<Modal v-model="pModals" title="商品列表" footerHide class="paymentFooter" scrollable width="900"
+			@on-cancel="cancels">
+			<goods-list ref="goodslist" :ischeckbox="true" :isdiy="true" @getProductId="getProductIds"
+				v-if="pModals"></goods-list>
+		</Modal>
+		<Modal v-model="aModals" title="选择代理地址" footerHide class="paymentFooter" scrollable width="400"
+			@on-cancel="cancelss">
+			<el-cascader :props="props" clearable @change="addressChange" ref="getAdd"></el-cascader>
+			<br />
+			<br />
+			<Button type="primary" class="submission" @click="sAddAddress" :disabled="disabled">确认</Button>
+		</Modal>
+		<div style="width: 500px; display: flex;justify-content: center;">
+			<!-- <Button type="primary" class="submission" @click="save" :disabled="disabled">保存</Button> -->
+		</div>
+	</div>
+</template>
+
+<script>
+	import {
+	 detailsApi
+	} from "@/api/user";
+	import {
+		cityApi
+	} from '@/api/store';
+	import goodsList from '@/components/goodsList'
+	import city from '@/utils/city';
+	import {
+		mapState
+	} from "vuex";
+	import userList from "@/components/userList/index"
+	import {
+		couponCategoryApi,
+		couponSaveApi,
+		couponDetailApi,
+		VipEditApi,
+		serveAddApi,
+		bindServe,
+		addServiceProject,
+		serveReadApi,
+		serveProductDeleteApi
+	} from "@/api/marketing";
+	import {
+		brandList,
+		changeListApi
+	} from "@/api/product";
+	import {
+		addGlobal,
+		editGlobal,
+		addStoreAgent
+	} from '@/api/agent'
+	// import { formatDate } from '@/utils/validate';
+	import Setting from "@/setting";
+	export default {
+		name: "storeCouponCreate",
+		components: {
+			userList,
+			goodsList
+		},
+		data() {
+			return {
+				props: {
+					multiple: true,
+					lazy: true,
+					checkStrictly: true,
+					lazyLoad: this.lazyLoad
+				},
+				tableData: [],
+				addresData: city,
+				baseForm: {
+					product_name: '',
+					product_id: 0,
+					performance_value: 0,
+					craft_price: 0,
+					sales_commissions: 0,
+					repertory: 0
+				}, //基础数据
+				modal_loading: false,
+				modals: false,
+				id: '',
+				roterPre: Setting.roterPre,
+				disabled: false,
+				storesList: [],
+				formData: {
+					address: '',
+					id: '',
+					name: '',
+					uid: '',
+					global_commission: 0,
+					province: 0,
+					city: 0,
+					area: 0,
+					street: 0,
+
+				},
+				isMinPrice: 0,
+				isCouponTime: 1,
+				isReceiveTime: 0,
+				modals: false,
+				datetime1: [],
+				datetime2: [],
+				storeModals: false,
+				currentTab: '1',
+				current: {},
+				service_card_id: '',
+				productList: [],
+				pModals: false,
+				aModals: false,
+				addList: [], //选择的节点
+				addressList: [], //去重节点
+
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+		},
+		created() {
+			let data = {
+				pid: 0
+			}
+			this.cityInfo(data);
+			console.log(this.$route.query);
+			if (this.$route.query.id) {
+				this.formData.id = this.$route.query.id
+				this.formData.uid = this.$route.query.uid
+				this.getUserInfo()
+				this.addressList = JSON.parse(this.$route.query.address)
+				this.tableData = JSON.parse(window.sessionStorage.getItem('agent_product')).map(item => {
+					item.v_price = item.v_price*1
+					return item
+				})
+				console.log(this.tableData,'this.tableData')
+				// this.formData.uid = this.$route.query.uid
+				// this.formData.global_commission = this.$route.query.global_commission
+			}
+
+		},
+		methods: {
+			getUserInfo() {
+				detailsApi(this.formData.uid).then(res => {
+					this.formData.name = res.data.ps_info.nickname
+				})
+			},
+			handleClose(tag) {
+				this.addressList.splice(this.addressList.indexOf(tag), 1);
+			},
+			addressChange(val) {
+				this.addList = this.$refs["getAdd"].getCheckedNodes();
+				console.log(this.addList, 'this.addList')
+			},
+			addAddress() {
+				this.aModals = true
+			},
+			sAddAddress() {
+				this.aModals = false
+				let arr = this.addList.map(item => {
+					return {
+						value: item.value,
+						label: item.label
+					}
+				})
+				// arr = 
+				this.addressList = this.unique(arr.concat(this.addressList), 'value')
+			},
+			lazyLoad(node, resolve) {
+				console.log(node, 'node');
+				let {
+					level
+				} = node;
+				let params = ''
+				if (level == 0) {
+					params = 0 //默认江苏省
+				} else {
+					params = node.value
+				}
+				cityApi({
+					pid: params
+				}).then(res => { //接口
+					if (res && res.status == 200) {
+						let data = res.data
+						// if (level > 0) {
+						// 	data = res.data
+						// }
+						if (level == 2) {
+							data.forEach(item => {
+								item.leaf = level >= 2
+							});
+						}
+						resolve(data);
+					} else {
+						this.$message.error('获取地区数据失败')
+					}
+				})
+			},
+			loadData(item, callback) {
+				item.loading = true;
+				cityApi({
+					pid: item.value
+				}).then(res => {
+					item.children = res.data;
+					item.loading = false;
+					callback();
+				});
+			},
+			cityInfo(data) {
+				console.log(data, 'data')
+				cityApi(data).then(res => {
+					this.addresData = res.data
+				})
+			},
+			addchack(e, selectedData) {
+				e.forEach((i, index) => {
+					if (index == 0) {
+						this.formItem.province = i
+					} else if (index == 1) {
+						this.formItem.city = i
+					} else if (index == 2) {
+						this.formItem.area = i
+					} else {
+						this.formItem.street = i
+					}
+				})
+				this.formItem.address = (selectedData.map(o => o.label)).join("/");
+			},
+			del(row) {
+				try {
+					this.tableData.forEach((i, index) => {
+						if (row.id == i.id) {
+							return this.tableData.splice(index, 1)
+						}
+					})
+				} catch (error) {
+					console.log(error)
+					//TODO handle the exception
+				}
+				
+			},
+			addGoods() {
+				this.pModals = true;
+			},
+			handleChange(value, selectedData) {
+				console.log(value, 'value')
+				console.log(selectedData, 'selectedData')
+				// this.formData.address = selectedData.map(o => o.label);
+			},
+			showPrice(id) {
+				let item = this.productList.find(i => {
+					return i.id == id
+				})
+				if (item) {
+					return item.price
+				} else {
+					return ''
+				}
+			},
+			// 选择商品
+			changeGoods() {
+				this.modals = true;
+			},
+			addNewProject() {
+				console.log('dddddddddddddddddd');
+				let that = this
+				try {
+					this.formData.push({
+						service_card_id: that.service_card_id,
+						id: 0,
+						product_id: 0,
+						store_name: '',
+						slider_image: '',
+						performance_value: '',
+						craft_price: '',
+						sales_commissions: '',
+						repertory: 0,
+					})
+					console.log(this.formData);
+				} catch (e) {
+					console.log(e);
+				}
+			},
+			delNewProject(index, item) {
+				let that = this
+				if (item.id) {
+					try {
+						let delfromData = {
+							title: '删除服务项目',
+							url: `service/productDelete/${item.id}`,
+							method: 'DELETE',
+							ids: ''
+						};
+						this.$modalSure(delfromData).then((res) => {
+							that.$Message.success(res.msg);
+							that.formData.splice(index, 1)
+						}).catch(res => {
+							that.$Message.error(res.msg);
+						});
+					} catch (e) {
+						//TODO handle the exception
+						console.log(e, '错误');
+					}
+
+					// serveProductDeleteApi(item.id).then(res => {
+					// 	this.formData.splice(index,1)
+					// })
+				} else {
+					this.formData.splice(index, 1)
+				}
+				if (that.formData.length == 0) {
+					that.formData = [{
+						id: 0,
+						service_card_id: that.service_card_id,
+						product_id: 0,
+						store_name: '',
+						slider_image: '',
+						performance_value: '',
+						craft_price: '',
+						sales_commissions: '',
+						repertory: 0,
+					}]
+				}
+			},
+			// 商品id
+			getProductId(row) {
+				console.log(row, '这个');
+				this.modals = false;
+				this.formData.name = row.name
+				this.formData.uid = row.uid
+			},
+			getProductIds(row) {
+				console.log(row, '这个');
+				this.pModals = false;
+				try {
+					row.forEach(item => item.v_price = item.v_price || 0)
+					let list = this.tableData.concat(row);
+					let uni = this.unique(list, 'id');
+					// uni.forEach((i)=>{
+					//   i.attrValue.forEach(j=>{
+					//     j.cate_name = i.cate_name;
+					//     j.store_label = i.store_label;
+					//   })
+					// })
+					this.tableData = uni;
+				} catch (err) {
+					console.log(err, '这个');
+				}
+
+			},
+			// 创建
+			save() {
+				let product = [];
+				let address = this.addressList.map(item => item.value).join(',')
+				// if (this.formData.address.length > 3) {
+				// 	let arr = this.formData.address.slice(0, 3)
+				// 	address = arr.join(',')
+				// } else [
+				// 	address = this.formData.address.join(',')
+				// ]
+				if (!address) {
+					this.$Message.error('请选择代理区域');
+				}
+				this.tableData.forEach(item => {
+					product.push({
+						product_id: item.id,
+						price: item.v_price
+					})
+				})
+				console.log(address)
+				// if (this.formData.id) {
+				addStoreAgent({
+					id: this.formData.id * 1,
+					uid: this.formData.uid,
+					product: product,
+					area_id: address,
+				}).then(res => {
+					this.$Message.success(res.msg);
+					setTimeout(() => {
+						this.$router.push({
+							path: "/admin/agent/dl/index",
+						});
+					}, 1000);
+				}).catch(err => {
+					this.$Message.error(err.msg);
+				})
+				// } else {
+				// 	addStoreAgent({
+				// 		uid: this.formData.uid,
+				// 		product: product,
+				// 		area_id: address,
+				// 	}).then(res => {
+				// 		this.$Message.success(res.msg);
+				// 		setTimeout(() => {
+				// 			this.$router.push({
+				// 				path: "/admin/agent/dl/index",
+				// 			});
+				// 		}, 1000);
+				// 	}).catch(err => {
+				// 		this.$Message.error(err.msg);
+				// 	})
+				// }
+
+			},
+			//对象数组去重;
+			unique(arr, name = 'product_id') {
+				const res = new Map();
+				return arr.filter(
+					(arr) => !res.has(arr[name]) && res.set(arr[name], 1)
+				);
+			},
+			cancel() {
+				this.modals = false;
+			},
+			cancels() {
+				this.pModals = false;
+			},
+			cancelss() {
+				this.aModals = false;
+			},
+
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.tips {
+		display: inline-bolck;
+		font-size: 12px;
+		font-weight: 400;
+		color: #999999;
+		margin-top: 10px;
+	}
+
+	.imgPic {
+		.info {
+			width: 60%;
+			margin-left: 10px;
+		}
+
+		.pictrue {
+			height: 36px;
+			margin: 7px 3px 0 3px;
+
+			img {
+				height: 100%;
+				display: block;
+			}
+		}
+	}
+
+	.productType {
+		width: 120px;
+		height: 60px;
+		background: #FFFFFF;
+		border-radius: 3px;
+		border: 1px solid #E7E7E7;
+		float: left;
+		text-align: center;
+		padding-top: 8px;
+		position: relative;
+		cursor: pointer;
+		line-height: 23px;
+		margin-right: 12px;
+
+		&.on {
+			border-color: #1890FF;
+		}
+
+		.name {
+			font-size: 14px;
+			font-weight: 600;
+			color: rgba(0, 0, 0, 0.85);
+
+			&.on {
+				color: #1890FF;
+			}
+		}
+
+		.title {
+			font-size: 12px;
+			font-weight: 400;
+			color: #999999;
+		}
+
+		.jiao {
+			position: absolute;
+			bottom: 0;
+			right: 0;
+			width: 0;
+			height: 0;
+			border-bottom: 26px solid #1890FF;
+			border-left: 26px solid transparent;
+		}
+
+		.iconfont {
+			position: absolute;
+			bottom: -3px;
+			right: 1px;
+			color: #FFFFFF;
+			font-size: 12px;
+		}
+	}
+
+	.info {
+		color: #888;
+		font-size: 12px;
+	}
+
+	.ivu-input-wrapper {
+		width: 320px;
+	}
+
+	.ivu-input-number {
+		width: 160px;
+	}
+
+	.ivu-date-picker {
+		width: 320px;
+	}
+
+	.ivu-icon-ios-camera-outline {
+		width: 58px;
+		height: 58px;
+		border: 1px dotted rgba(0, 0, 0, 0.1);
+		border-radius: 4px;
+		background-color: rgba(0, 0, 0, 0.02);
+		line-height: 58px;
+		cursor: pointer;
+		vertical-align: middle;
+	}
+
+	.upload-list {
+		width: 58px;
+		height: 58px;
+		border: 1px dotted rgba(0, 0, 0, 0.1);
+		border-radius: 4px;
+		margin-right: 15px;
+		display: inline-block;
+		position: relative;
+		cursor: pointer;
+		vertical-align: middle;
+	}
+
+	.upload-list img {
+		display: block;
+		width: 100%;
+		height: 100%;
+	}
+
+	.ivu-icon-ios-close-circle {
+		position: absolute;
+		top: 0;
+		right: 0;
+		transform: translate(50%, -50%);
+	}
+
+	.form-submit {
+		/deep/.ivu-card {
+			border-radius: 0;
+		}
+
+		margin-bottom: 79px;
+
+		.fixed-card {
+			position: fixed;
+			right: 0;
+			bottom: 0;
+			left: 200px;
+			z-index: 99;
+			box-shadow: 0 -1px 2px rgb(240, 240, 240);
+
+			/deep/ .ivu-card-body {
+				padding: 15px 16px 14px;
+			}
+
+			.ivu-form-item {
+				margin-bottom: 0;
+			}
+
+			/deep/ .ivu-form-item-content {
+				margin-right: 124px;
+				text-align: center;
+			}
+
+			.ivu-btn {
+				height: 36px;
+				padding: 0 20px;
+			}
+		}
+	}
+
+	/deep/.vxe-tree-cell {
+		padding-left: 0 !important;
+	}
+
+	.upLoad {
+		width: 58px;
+		height: 58px;
+		line-height: 58px;
+		border: 1px dotted rgba(0, 0, 0, 0.1);
+		border-radius: 4px;
+		background: rgba(0, 0, 0, 0.02);
+		cursor: pointer;
+	}
+
+	.product-item {
+		border: 1px solid #eee;
+		min-width: 300px;
+
+		padding: 20px;
+
+		.submission {
+			// display: block;
+			margin-left: 500px;
+		}
+	}
+
+	.bom {
+		margin-right: 20px
+	}
+
+	.heji {
+		padding: 10px
+	}
+</style>

+ 380 - 0
src/pages/agent/dl/index.vue

@@ -0,0 +1,380 @@
+<template>
+	<!-- 用户-客服管理-客服列表 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<!-- 添加客服 -->
+			<Row type="flex" class="mb20">
+				<Col span="24">
+				<Button v-auth="['admin-agent-dl_add']" type="primary" @click="add" class="mr10">添加区域代理</Button>
+				</Col>
+			</Row>
+			<!-- 客服列表表格 -->
+			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
+				no-filtered-userFrom-text="暂无筛选结果">
+				<template slot-scope="{ row }" slot="avatar">
+					<viewer>
+						<div class="tabBox_img">
+							<img v-lazy="row.user[0].avatar" />
+						</div>
+					</viewer>
+				</template>
+				<template slot-scope="{ row }" slot="area_list">
+					<viewer>
+						<div v-for="item in row.area_list">{{row.area_name[item*1]}}</div>
+					</viewer>
+				</template>
+				<template slot-scope="{ row }" slot="nickname">
+					<viewer>
+						<div>{{row.user[0].nickname}}</div>
+					</viewer>
+				</template>
+				<template slot-scope="{ row }" slot="add_time">
+					<viewer>
+						<div>{{row.add_time | timeFormat}}</div>
+					</viewer>
+				</template>
+				<template slot-scope="{ row, index }" slot="action">
+					<a @click="edit(row)">编辑</a>
+					<Divider type="vertical" />
+					<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="tableFrom.limit" />
+			</div>
+		</Card>
+	</div>
+</template>
+
+<script>
+	import dayjs from "dayjs";
+	import {
+		mapState
+	} from "vuex";
+	import util from "@/libs/util";
+	import Setting from "@/setting";
+	import {
+		kefuListApi,
+		kefucreateApi,
+		kefuaddApi,
+		kefuAddApi,
+		kefusetStatusApi,
+		kefuEditApi,
+		kefuRecordApi,
+		kefuChatlistApi,
+		kefuLogin,
+	} from "@/api/setting";
+	import { globalList ,getStoreAgentList} from '@/api/agent'
+	export default {
+		name: "index",
+		filters: {
+			typeFilter(status) {
+				const statusMap = {
+					wechat: "微信用户",
+					routine: "小程序用户",
+				};
+				return statusMap[status];
+			},
+			timeFormat (value) {
+			    if (!value) {
+			        return '-';
+			    }
+			    return dayjs(value * 1000).format('YYYY-MM-DD HH:mm:ss');
+			},
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			...mapState("admin/userLevel", ["categoryId"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 80;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "left";
+			},
+		},
+		data() {
+			return {
+				isChat: true,
+				formValidate3: {
+					page: 1,
+					limit: 15,
+				},
+				total3: 0,
+				loading3: false,
+				modals3: false,
+				tableList3: [],
+				columns3: [{
+						title: "用户名称",
+						key: "nickname",
+						width: 200,
+					},
+					{
+						title: "客服头像",
+						slot: "headimgurl",
+					},
+					{
+						title: "操作",
+						slot: "action",
+					},
+				],
+				formValidate5: {
+					page: 1,
+					limit: 15,
+					uid: 0,
+					to_uid: 0,
+					id: 0,
+				},
+				total5: 0,
+				loading5: false,
+				tableList5: [],
+				columns5: [{
+						title: "用户名称",
+						key: "nickname",
+						width: 200,
+					},
+					{
+						title: "用户头像",
+						slot: "avatar",
+					},
+					{
+						title: "发送消息",
+						key: "msn",
+						width: 250,
+					},
+					{
+						title: "发送时间",
+						key: "add_time",
+					},
+				],
+				FromData: null,
+				formValidate: {
+					page: 1,
+					limit: 15,
+					data: "",
+					type: "",
+					nickname: "",
+				},
+				tableList2: [],
+				modals: false,
+				total: 0,
+				tableFrom: {
+					page: 1,
+					limit: 15,
+				},
+				timeVal: [],
+				
+				loading: false,
+				tableList: [],
+				columns1: [{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "代理用户UID",
+						key: "uid",
+						minWidth: 60,
+					},
+					{
+						title: "区域",
+						slot: "area_list",
+						minWidth: 120,
+					},
+					{
+						title: "质押金",
+						key: "quality_deposit",
+						minWidth: 120,
+					},
+					{
+						title: "添加时间",
+						slot: "add_time",
+						minWidth: 130,
+					},
+					{
+						title: "操作",
+						slot: "action",
+						fixed: "right",
+						width: 200,
+					},
+				],
+				columns4: [{
+						type: "selection",
+						width: 60,
+						align: "center",
+					},
+					{
+						title: "ID",
+						key: "uid",
+						width: 80,
+					},
+					{
+						title: "微信用户名称",
+						key: "nickname",
+						minWidth: 160,
+					},
+					{
+						title: "客服头像",
+						slot: "headimgurl",
+						minWidth: 60,
+					},
+					{
+						title: "用户类型",
+						slot: "user_type",
+						width: 100,
+					},
+					{
+						title: "性别",
+						slot: "sex",
+						minWidth: 60,
+					},
+					{
+						title: "地区",
+						slot: "country",
+						minWidth: 120,
+					},
+					{
+						title: "是否关注公众号",
+						slot: "subscribe",
+						minWidth: 120,
+					},
+				],
+				loading2: false,
+				total2: 0,
+				addFrom: {
+					uids: [],
+				},
+				selections: [],
+				rows: {},
+				rowRecord: {},
+			};
+		},
+		created() {
+			this.getList();
+		},
+		methods: {
+			// 修改成功
+			submitFail() {
+				this.getList();
+			},
+			// 编辑
+			edit(row) {
+				// this.$modalForm(kefuEditApi(row.id)).then(() => this.getList());
+				let ads = [],pro = [];
+				if(row.area_list.length > 0) {
+					row.area_list.forEach(item => {
+						ads.push({
+							label: row.area_name[item],
+							value: item
+						})
+					})
+				}
+				if(row.agent_product.length > 0) {
+					row.agent_product.forEach(item=> {
+						pro.push({
+							store_name: item.product.store_name,
+							price: item.product.price,
+							cost: item.product.cost,
+							v_price: item.price,
+							id: item.product_id
+						})
+					});
+				}
+				console.log(ads,'ads')
+				window.sessionStorage.setItem('agent_product', JSON.stringify(pro))
+				console.log(pro,'pro')
+				this.$router.push({
+					path: "/admin/agent/dl/add?id=" + row.id + '&uid=' + row.uid + '&address=' + JSON.stringify(ads)
+				});
+			},
+			// 添加
+			add() {
+				this.$router.push({
+					path: "/admin/agent/dl/add"
+				});
+			},
+			// 删除
+			del(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					num: num,
+					url: `store/agent/del/${row.id}`,
+					method: "get",
+					// ids: {
+					// 	id: row.id
+					// },
+				};
+				this.$modalSure(delfromData)
+					.then((res) => {
+						this.$Message.success(res.msg);
+						this.tableList.splice(num, 1);
+						if (!this.tableList.length) {
+							this.tableFrom.page =
+								this.tableFrom.page == 1 ? 1 : this.tableFrom.page - 1;
+						}
+						this.getList();
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				getStoreAgentList(this.tableFrom)
+					.then(async (res) => {
+						let data = res.data;
+						this.tableList = data.data;
+						this.total = data.count;
+						this.loading = false;
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			pageChange(index) {
+				this.tableFrom.page = index;
+				this.getList();
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+	.modelBox {
+
+		>>>,
+		.ivu-table-header {
+			width: 100% !important;
+		}
+	}
+
+	.trees-coadd {
+		width: 100%;
+		height: 385px;
+
+		.scollhide {
+			width: 100%;
+			height: 100%;
+			overflow-x: hidden;
+			overflow-y: scroll;
+		}
+	}
+
+	// margin-left: 18px;
+	.scollhide::-webkit-scrollbar {
+		display: none;
+	}
+</style>

+ 434 - 0
src/pages/agent/dl/qz.vue

@@ -0,0 +1,434 @@
+<template>
+	<!-- 用户-客服管理-客服列表 -->
+	<div>
+<!-- 		<Card :bordered="false" dis-hover class="ivu-mt">
+			<div class="">
+				<Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
+					:label-position="labelPosition" @submit.native.prevent>
+					<FormItem label="用户ID:" label-for="title">
+						<div class='flex-search'>
+							<Input v-model="tableFrom.uid" icon="ios-search" @on-click='openuid' placeholder="请输入用户ID"
+								class="input-add mr14" />
+						</div>
+					</FormItem>
+										<FormItem label="创建时间:">
+					    <DatePicker
+					      :editable="false"
+					      :clearable="true"
+					      @on-change="onchangeTime"
+					      :value="timeVal"
+					      format="yyyy/MM/dd"
+					      type="datetimerange"
+					      placement="bottom-start"
+					      placeholder="自定义时间"
+					      class="input-add mr20"
+					      :options="options"
+					    ></DatePicker>
+					  </FormItem>
+					<Button type="primary" @click="getList()">查询</Button>
+				</Form>
+			</div>
+		</Card> -->
+		<!-- <cards-data :cardLists="cardLists" v-if="cardLists.length >= 0"></cards-data> -->
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
+				no-filtered-userFrom-text="暂无筛选结果">
+				<template slot-scope="{ row }" slot="avatar">
+					<viewer>
+						<div class="tabBox_img">
+							<img v-lazy="row.user[0].avatar" />
+						</div>
+					</viewer>
+				</template>
+				<template slot-scope="{ row }" slot="area_list">
+					<viewer>
+						<div v-for="item in row.area_list">{{row.area_name[item*1]}}</div>
+					</viewer>
+				</template>
+				<template slot-scope="{ row }" slot="nickname">
+					<viewer>
+						<div>{{row.user.nickname}}</div>
+					</viewer>
+				</template>
+				<!-- number -->
+				<template slot-scope="{ row }" slot="number">
+					<viewer>
+						<div>{{row.pm == 1? '+': '-'}}{{row.number}}</div>
+					</viewer>
+				</template>
+				<template slot-scope="{ row }" slot="add_time">
+					<viewer>
+						<div>{{row.add_time | timeFormat}}</div>
+					</viewer>
+				</template>
+				<template slot-scope="{ row, index }" slot="action">
+					<a @click="edit(row)">编辑</a>
+					<Divider type="vertical" />
+					<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="tableFrom.limit" />
+			</div>
+
+		</Card>
+
+		<!-- 客服列表表格 -->
+
+		<Modal v-model="userListShow" width='80' mask title="用户选择">
+			<userlist @imageObject='checkUser'></userlist>
+			<template #footer>
+				<Button @click="userListShow=false">取消</Button>
+			</template>
+		</Modal>
+	</div>
+</template>
+
+<script>
+	import timeOptions from "@/utils/timeOptions";
+	import cardsData from "@/components/cards/cards";
+	import userlist from "@/components/customerInfo/index";
+	import dayjs from "dayjs";
+	import {
+		mapState
+	} from "vuex";
+	import util from "@/libs/util";
+	import Setting from "@/setting";
+	import {
+		kefuListApi,
+		kefucreateApi,
+		kefuaddApi,
+		kefuAddApi,
+		kefusetStatusApi,
+		kefuEditApi,
+		kefuRecordApi,
+		kefuChatlistApi,
+		kefuLogin,
+	} from "@/api/setting";
+	import {
+		globalList,
+		getStoreAgentList,
+		getStoreAgentGdList,
+		getQzList
+	} from '@/api/agent'
+	export default {
+		components: {
+			userlist,
+			cardsData
+		},
+		name: "index",
+		filters: {
+			typeFilter(status) {
+				const statusMap = {
+					wechat: "微信用户",
+					routine: "小程序用户",
+				};
+				return statusMap[status];
+			},
+			timeFormat(value) {
+				if (!value) {
+					return '-';
+				}
+				return dayjs(value * 1000).format('YYYY-MM-DD HH:mm:ss');
+			},
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			...mapState("admin/userLevel", ["categoryId"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 80;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "left";
+			},
+		},
+		data() {
+			return {
+				options: timeOptions,
+				cardLists: [],
+				userListShow: false,
+				isChat: true,
+				formValidate3: {
+					page: 1,
+					limit: 15,
+				},
+				total3: 0,
+				loading3: false,
+				modals3: false,
+				tableList3: [],
+				columns3: [{
+						title: "用户名称",
+						key: "nickname",
+						width: 200,
+					},
+					{
+						title: "客服头像",
+						slot: "headimgurl",
+					},
+					{
+						title: "操作",
+						slot: "action",
+					},
+				],
+				formValidate5: {
+					page: 1,
+					limit: 15,
+					uid: 0,
+					to_uid: 0,
+					id: 0,
+				},
+				total5: 0,
+				loading5: false,
+				tableList5: [],
+				columns5: [{
+						title: "用户名称",
+						key: "nickname",
+						width: 200,
+					},
+					{
+						title: "用户头像",
+						slot: "avatar",
+					},
+					{
+						title: "发送消息",
+						key: "msn",
+						width: 250,
+					},
+					{
+						title: "发送时间",
+						key: "add_time",
+					},
+				],
+				FromData: null,
+				formValidate: {
+					page: 1,
+					limit: 15,
+					data: "",
+					type: "",
+					nickname: "",
+					add_time: '',
+				},
+				tableList2: [],
+				modals: false,
+				total: 0,
+				tableFrom: {
+					add_time: 0,
+					uid: '',
+					page: 1,
+					limit: 15,
+				},
+				timeVal: [],
+
+				loading: false,
+				tableList: [],
+				columns1: [{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "代理用户UID",
+						key: "uid",
+						minWidth: 60,
+					},
+					{
+						title: "代理用户昵称",
+						slot: "nickname",
+						minWidth: 60,
+					},
+					{
+						title: "分红权重",
+						key: "num",
+						minWidth: 120,
+					},
+					{
+						title: "已获得分红",
+						key: "money",
+						minWidth: 120,
+					},
+					{
+						title: "冻结金额",
+						key: "freeze",
+						minWidth: 120,
+					},
+					{
+						title: "获取的分红金额上限",
+						key: "top",
+						minWidth: 120,
+					},
+					{
+						title: "添加时间",
+						key: "create_time",
+						minWidth: 130,
+					},
+					// {
+					// 	title: "操作",
+					// 	slot: "action",
+					// 	fixed: "right",
+					// 	width: 200,
+					// },
+				],
+				loading2: false,
+				total2: 0,
+				addFrom: {
+					uids: [],
+				},
+				selections: [],
+				rows: {},
+				rowRecord: {},
+			};
+		},
+		created() {
+			this.getList();
+		},
+		methods: {
+			// 选中用户
+			checkUser(res) {
+				this.userListShow = false;
+				this.tableFrom.uid = res.uid;
+			},
+			// 打开弹窗
+			openuid(e) {
+				this.userListShow = true;
+			},
+			orderSearch() {
+
+			},
+			// 修改成功
+			submitFail() {
+				this.getList();
+			},
+			// 编辑
+			edit(row) {
+				// this.$modalForm(kefuEditApi(row.id)).then(() => this.getList());
+				let ads = [],
+					pro = [];
+				if (row.area_list.length > 0) {
+					row.area_list.forEach(item => {
+						ads.push({
+							label: row.area_name[item],
+							value: item
+						})
+					})
+				}
+				if (row.agent_product.length > 0) {
+					row.agent_product.forEach(item => {
+						pro.push({
+							store_name: item.product.store_name,
+							price: item.product.price,
+							cost: item.product.cost,
+							v_price: item.price,
+							id: item.product_id
+						})
+					});
+				}
+				console.log(ads, 'ads')
+				window.sessionStorage.setItem('agent_product', JSON.stringify(pro))
+				console.log(pro, 'pro')
+				this.$router.push({
+					path: "/admin/agent/dl/add?id=" + row.id + '&uid=' + row.uid + '&address=' + JSON.stringify(
+						ads)
+				});
+			},
+			// 添加
+			add() {
+				this.$router.push({
+					path: "/admin/agent/dl/add"
+				});
+			},
+			// 删除
+			del(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					num: num,
+					url: `store/agent/del/${row.id}`,
+					method: "get",
+					// ids: {
+					// 	id: row.id
+					// },
+				};
+				this.$modalSure(delfromData)
+					.then((res) => {
+						this.$Message.success(res.msg);
+						this.tableList.splice(num, 1);
+						if (!this.tableList.length) {
+							this.tableFrom.page =
+								this.tableFrom.page == 1 ? 1 : this.tableFrom.page - 1;
+						}
+						this.getList();
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				getQzList(this.tableFrom)
+					.then(async (res) => {
+						let data = res.data;
+						this.tableList = data.list;
+						this.total = data.count;
+						this.loading = false;
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			pageChange(index) {
+				this.tableFrom.page = index;
+				this.getList();
+			},
+			onchangeTime(e) {
+				this.timeVal = e;
+				this.tableFrom.add_time = this.timeVal[0] ? this.timeVal.join("-") : "";
+				this.tableFrom.page = 1;
+				if (!e[0]) {
+					this.tableFrom.data = "";
+				}
+				this.getList();
+				// this.getStatistics();
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+	.modelBox {
+
+		>>>,
+		.ivu-table-header {
+			width: 100% !important;
+		}
+	}
+
+	.trees-coadd {
+		width: 100%;
+		height: 385px;
+
+		.scollhide {
+			width: 100%;
+			height: 100%;
+			overflow-x: hidden;
+			overflow-y: scroll;
+		}
+	}
+
+	// margin-left: 18px;
+	.scollhide::-webkit-scrollbar {
+		display: none;
+	}
+</style>

+ 429 - 0
src/pages/agent/dl/qzbh.vue

@@ -0,0 +1,429 @@
+<template>
+	<!-- 用户-客服管理-客服列表 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<div class="">
+				<Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
+					:label-position="labelPosition" @submit.native.prevent>
+					<FormItem label="用户ID:" label-for="title">
+						<div class='flex-search'>
+							<Input v-model="tableFrom.uid" icon="ios-search" @on-click='openuid'
+								placeholder="请输入用户ID" class="input-add mr14" />
+						</div>
+					</FormItem>
+					<!-- <FormItem label="创建时间:">
+					    <DatePicker
+					      :editable="false"
+					      :clearable="true"
+					      @on-change="onchangeTime"
+					      :value="timeVal"
+					      format="yyyy/MM/dd"
+					      type="datetimerange"
+					      placement="bottom-start"
+					      placeholder="自定义时间"
+					      class="input-add mr20"
+					      :options="options"
+					    ></DatePicker>
+					  </FormItem> -->
+					<Button type="primary" @click="getList()">查询</Button>
+				</Form>
+			</div>
+			</Card>
+			<Card :bordered="false" dis-hover class="ivu-mt">
+				<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
+					no-filtered-userFrom-text="暂无筛选结果">
+					<template slot-scope="{ row }" slot="avatar">
+						<viewer>
+							<div class="tabBox_img">
+								<img v-lazy="row.user[0].avatar" />
+							</div>
+						</viewer>
+					</template>
+					<template slot-scope="{ row }" slot="area_list">
+						<viewer>
+							<div v-for="item in row.area_list">{{row.area_name[item*1]}}</div>
+						</viewer>
+					</template>
+					<template slot-scope="{ row }" slot="nickname">
+						<viewer>
+							<div>{{row.user.nickname}}</div>
+						</viewer>
+					</template>
+					<!-- number -->
+					<template slot-scope="{ row }" slot="number">
+						<viewer>
+							<div>{{row.pm == 1? '+': '-'}}{{row.number}}</div>
+						</viewer>
+					</template>
+					<template slot-scope="{ row }" slot="add_time">
+						<viewer>
+							<div>{{row.add_time | timeFormat}}</div>
+						</viewer>
+					</template>
+					<template slot-scope="{ row, index }" slot="action">
+						<a @click="edit(row)">编辑</a>
+						<Divider type="vertical" />
+						<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="tableFrom.limit" />
+				</div>
+				
+			</Card>
+
+			<!-- 客服列表表格 -->
+			
+		<Modal v-model="userListShow" width='80' mask title="用户选择">
+			<userlist @imageObject='checkUser'></userlist>
+			<template #footer>
+				<Button @click="userListShow=false">取消</Button>
+			</template>
+		</Modal>
+	</div>
+</template>
+
+<script>
+	import timeOptions from "@/utils/timeOptions";
+	import cardsData from "@/components/cards/cards";
+	import userlist from "@/components/customerInfo/index";
+	import dayjs from "dayjs";
+	import {
+		mapState
+	} from "vuex";
+	import util from "@/libs/util";
+	import Setting from "@/setting";
+	import {
+		kefuListApi,
+		kefucreateApi,
+		kefuaddApi,
+		kefuAddApi,
+		kefusetStatusApi,
+		kefuEditApi,
+		kefuRecordApi,
+		kefuChatlistApi,
+		kefuLogin,
+	} from "@/api/setting";
+	import {
+		globalList,
+		getStoreAgentList,
+		getQzBhList
+	} from '@/api/agent'
+	export default {
+		components: {
+			userlist,
+			cardsData
+		},
+		name: "index",
+		filters: {
+			typeFilter(status) {
+				const statusMap = {
+					wechat: "微信用户",
+					routine: "小程序用户",
+				};
+				return statusMap[status];
+			},
+			timeFormat(value) {
+				if (!value) {
+					return '-';
+				}
+				return dayjs(value * 1000).format('YYYY-MM-DD HH:mm:ss');
+			},
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			...mapState("admin/userLevel", ["categoryId"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 80;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "left";
+			},
+		},
+		data() {
+			return {
+				options: timeOptions,
+				cardLists:[],
+				userListShow: false,
+				isChat: true,
+				formValidate3: {
+					page: 1,
+					limit: 15,
+				},
+				total3: 0,
+				loading3: false,
+				modals3: false,
+				tableList3: [],
+				columns3: [{
+						title: "用户名称",
+						key: "nickname",
+						width: 200,
+					},
+					{
+						title: "客服头像",
+						slot: "headimgurl",
+					},
+					{
+						title: "操作",
+						slot: "action",
+					},
+				],
+				formValidate5: {
+					page: 1,
+					limit: 15,
+					uid: 0,
+					to_uid: 0,
+					id: 0,
+				},
+				total5: 0,
+				loading5: false,
+				tableList5: [],
+				columns5: [{
+						title: "用户名称",
+						key: "nickname",
+						width: 200,
+					},
+					{
+						title: "用户头像",
+						slot: "avatar",
+					},
+					{
+						title: "发送消息",
+						key: "msn",
+						width: 250,
+					},
+					{
+						title: "发送时间",
+						key: "add_time",
+					},
+				],
+				FromData: null,
+				formValidate: {
+					page: 1,
+					limit: 15,
+					data: "",
+					type: "",
+					nickname: "",
+					add_time: '',
+				},
+				tableList2: [],
+				modals: false,
+				total: 0,
+				tableFrom: {
+					add_time: 0,
+					uid: '',
+					page: 1,
+					limit: 15,
+				},
+				timeVal: [],
+
+				loading: false,
+				tableList: [],
+				columns1: [{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "代理用户UID",
+						key: "uid",
+						minWidth: 60,
+					},
+					{
+						title: "代理用户昵称",
+						slot: "nickname",
+						minWidth: 60,
+					},
+					{
+						title: "权重变化",
+						slot: "number",
+						minWidth: 120,
+					},
+					{
+						title: "备注",
+						key: "mark",
+						minWidth: 200,
+					},
+					{
+						title: "剩余权重",
+						key: "balance",
+						minWidth: 120,
+					},
+					{
+						title: "添加时间",
+						slot: "add_time",
+						minWidth: 130,
+					},
+					// {
+					// 	title: "操作",
+					// 	slot: "action",
+					// 	fixed: "right",
+					// 	width: 200,
+					// },
+				],
+				loading2: false,
+				total2: 0,
+				addFrom: {
+					uids: [],
+				},
+				selections: [],
+				rows: {},
+				rowRecord: {},
+			};
+		},
+		created() {
+			this.getList();
+		},
+		methods: {
+			// 选中用户
+			checkUser(res) {
+				this.userListShow = false;
+				this.tableFrom.uid = res.uid;
+			},
+			// 打开弹窗
+			openuid(e) {
+				this.userListShow = true;
+			},
+			orderSearch() {
+
+			},
+			// 修改成功
+			submitFail() {
+				this.getList();
+			},
+			// 编辑
+			edit(row) {
+				// this.$modalForm(kefuEditApi(row.id)).then(() => this.getList());
+				let ads = [],
+					pro = [];
+				if (row.area_list.length > 0) {
+					row.area_list.forEach(item => {
+						ads.push({
+							label: row.area_name[item],
+							value: item
+						})
+					})
+				}
+				if (row.agent_product.length > 0) {
+					row.agent_product.forEach(item => {
+						pro.push({
+							store_name: item.product.store_name,
+							price: item.product.price,
+							cost: item.product.cost,
+							v_price: item.price,
+							id: item.product_id
+						})
+					});
+				}
+				console.log(ads, 'ads')
+				window.sessionStorage.setItem('agent_product', JSON.stringify(pro))
+				console.log(pro, 'pro')
+				this.$router.push({
+					path: "/admin/agent/dl/add?id=" + row.id + '&uid=' + row.uid + '&address=' + JSON.stringify(
+						ads)
+				});
+			},
+			// 添加
+			add() {
+				this.$router.push({
+					path: "/admin/agent/dl/add"
+				});
+			},
+			// 删除
+			del(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					num: num,
+					url: `store/agent/del/${row.id}`,
+					method: "get",
+					// ids: {
+					// 	id: row.id
+					// },
+				};
+				this.$modalSure(delfromData)
+					.then((res) => {
+						this.$Message.success(res.msg);
+						this.tableList.splice(num, 1);
+						if (!this.tableList.length) {
+							this.tableFrom.page =
+								this.tableFrom.page == 1 ? 1 : this.tableFrom.page - 1;
+						}
+						this.getList();
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				getQzBhList(this.tableFrom)
+					.then(async (res) => {
+						let data = res.data;
+						this.tableList = data.list;
+						this.total = data.count;
+						this.loading = false;
+					
+
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			pageChange(index) {
+				this.tableFrom.page = index;
+				this.getList();
+			},
+			onchangeTime(e) {
+			  this.timeVal = e;
+			  this.tableFrom.add_time = this.timeVal[0] ? this.timeVal.join("-") : "";
+			  this.tableFrom.page = 1;
+			  if (!e[0]) {
+			    this.tableFrom.data = "";
+			  }
+			  this.getList();
+			  // this.getStatistics();
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+	.modelBox {
+
+		>>>,
+		.ivu-table-header {
+			width: 100% !important;
+		}
+	}
+
+	.trees-coadd {
+		width: 100%;
+		height: 385px;
+
+		.scollhide {
+			width: 100%;
+			height: 100%;
+			overflow-x: hidden;
+			overflow-y: scroll;
+		}
+	}
+
+	// margin-left: 18px;
+	.scollhide::-webkit-scrollbar {
+		display: none;
+	}
+</style>

+ 487 - 0
src/pages/agent/dl/zyj.vue

@@ -0,0 +1,487 @@
+<template>
+	<!-- 用户-客服管理-客服列表 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<div class="">
+				<!-- 筛选条件 -->
+				<Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
+					:label-position="labelPosition" @submit.native.prevent>
+					<!-- 						<FormItem label="订单状态:">
+						<Select  v-model="pagination.status" class="input-add">
+							<Option v-for="(item, index) in num" :value="item.value" :key="index">{{ item.name }}
+							</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="员工ID:" label-for="title">
+						<div class='flex-search'>
+							<Input v-model="pagination.work_member_id" icon="ios-search" @on-click='openmid'
+								placeholder="请输入员工ID" class="input-add mr14" />
+						</div>
+					</FormItem> -->
+					<FormItem label="用户ID:" label-for="title">
+						<div class='flex-search'>
+							<Input v-model="tableFrom.uid" icon="ios-search" @on-click='openuid'
+								placeholder="请输入用户ID" class="input-add mr14" />
+						</div>
+					</FormItem>
+					<FormItem label="创建时间:">
+					    <DatePicker
+					      :editable="false"
+					      :clearable="true"
+					      @on-change="onchangeTime"
+					      :value="timeVal"
+					      format="yyyy/MM/dd"
+					      type="datetimerange"
+					      placement="bottom-start"
+					      placeholder="自定义时间"
+					      class="input-add mr20"
+					      :options="options"
+					    ></DatePicker>
+					  </FormItem>
+					<!-- 						<FormItem label="订单搜索:" label-for="title">
+						<Input v-model="pagination.order_id" placeholder="请输入订单号" class="input-add mr14" />
+						
+						<Button type="primary" style="margin-left: 10px;" @click="exportExcel()">导出</Button>
+					</FormItem> -->
+					<Button type="primary" @click="getList()">查询</Button>
+				</Form>
+			</div>
+			</Card>
+			<cards-data
+			  :cardLists="cardLists"
+			  v-if="cardLists.length >= 0"
+			></cards-data>
+			<Card :bordered="false" dis-hover class="ivu-mt">
+				<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
+					no-filtered-userFrom-text="暂无筛选结果">
+					<template slot-scope="{ row }" slot="avatar">
+						<viewer>
+							<div class="tabBox_img">
+								<img v-lazy="row.user[0].avatar" />
+							</div>
+						</viewer>
+					</template>
+					<template slot-scope="{ row }" slot="area_list">
+						<viewer>
+							<div v-for="item in row.area_list">{{row.area_name[item*1]}}</div>
+						</viewer>
+					</template>
+					<template slot-scope="{ row }" slot="nickname">
+						<viewer>
+							<div>{{row.user.nickname}}</div>
+						</viewer>
+					</template>
+					<!-- number -->
+					<template slot-scope="{ row }" slot="number">
+						<viewer>
+							<div>{{row.pm == 1? '+': '-'}}{{row.number}}</div>
+						</viewer>
+					</template>
+					<template slot-scope="{ row }" slot="add_time">
+						<viewer>
+							<div>{{row.add_time | timeFormat}}</div>
+						</viewer>
+					</template>
+					<template slot-scope="{ row, index }" slot="action">
+						<a @click="edit(row)">编辑</a>
+						<Divider type="vertical" />
+						<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="tableFrom.limit" />
+				</div>
+				
+			</Card>
+
+			<!-- 客服列表表格 -->
+			
+		<Modal v-model="userListShow" width='80' mask title="用户选择">
+			<userlist @imageObject='checkUser'></userlist>
+			<template #footer>
+				<Button @click="userListShow=false">取消</Button>
+			</template>
+		</Modal>
+	</div>
+</template>
+
+<script>
+	import timeOptions from "@/utils/timeOptions";
+	import cardsData from "@/components/cards/cards";
+	import userlist from "@/components/customerInfo/index";
+	import dayjs from "dayjs";
+	import {
+		mapState
+	} from "vuex";
+	import util from "@/libs/util";
+	import Setting from "@/setting";
+	import {
+		kefuListApi,
+		kefucreateApi,
+		kefuaddApi,
+		kefuAddApi,
+		kefusetStatusApi,
+		kefuEditApi,
+		kefuRecordApi,
+		kefuChatlistApi,
+		kefuLogin,
+	} from "@/api/setting";
+	import {
+		globalList,
+		getStoreAgentList,
+		getStoreAgentGdList
+	} from '@/api/agent'
+	export default {
+		components: {
+			userlist,
+			cardsData
+		},
+		name: "index",
+		filters: {
+			typeFilter(status) {
+				const statusMap = {
+					wechat: "微信用户",
+					routine: "小程序用户",
+				};
+				return statusMap[status];
+			},
+			timeFormat(value) {
+				if (!value) {
+					return '-';
+				}
+				return dayjs(value * 1000).format('YYYY-MM-DD HH:mm:ss');
+			},
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			...mapState("admin/userLevel", ["categoryId"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 80;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "left";
+			},
+		},
+		data() {
+			return {
+				options: timeOptions,
+				cardLists:[],
+				userListShow: false,
+				isChat: true,
+				formValidate3: {
+					page: 1,
+					limit: 15,
+				},
+				total3: 0,
+				loading3: false,
+				modals3: false,
+				tableList3: [],
+				columns3: [{
+						title: "用户名称",
+						key: "nickname",
+						width: 200,
+					},
+					{
+						title: "客服头像",
+						slot: "headimgurl",
+					},
+					{
+						title: "操作",
+						slot: "action",
+					},
+				],
+				formValidate5: {
+					page: 1,
+					limit: 15,
+					uid: 0,
+					to_uid: 0,
+					id: 0,
+				},
+				total5: 0,
+				loading5: false,
+				tableList5: [],
+				columns5: [{
+						title: "用户名称",
+						key: "nickname",
+						width: 200,
+					},
+					{
+						title: "用户头像",
+						slot: "avatar",
+					},
+					{
+						title: "发送消息",
+						key: "msn",
+						width: 250,
+					},
+					{
+						title: "发送时间",
+						key: "add_time",
+					},
+				],
+				FromData: null,
+				formValidate: {
+					page: 1,
+					limit: 15,
+					data: "",
+					type: "",
+					nickname: "",
+					add_time: '',
+				},
+				tableList2: [],
+				modals: false,
+				total: 0,
+				tableFrom: {
+					add_time: 0,
+					uid: '',
+					page: 1,
+					limit: 15,
+				},
+				timeVal: [],
+
+				loading: false,
+				tableList: [],
+				columns1: [{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "代理用户UID",
+						key: "uid",
+						minWidth: 60,
+					},
+					{
+						title: "代理用户昵称",
+						slot: "nickname",
+						minWidth: 60,
+					},
+					{
+						title: "变化金额",
+						slot: "number",
+						minWidth: 120,
+					},
+					{
+						title: "余额",
+						key: "balance",
+						minWidth: 120,
+					},
+
+					{
+						title: "备注",
+						key: "mark",
+						minWidth: 120,
+					},
+					{
+						title: "添加时间",
+						slot: "add_time",
+						minWidth: 130,
+					},
+					// {
+					// 	title: "操作",
+					// 	slot: "action",
+					// 	fixed: "right",
+					// 	width: 200,
+					// },
+				],
+				loading2: false,
+				total2: 0,
+				addFrom: {
+					uids: [],
+				},
+				selections: [],
+				rows: {},
+				rowRecord: {},
+			};
+		},
+		created() {
+			this.getList();
+		},
+		methods: {
+			// 选中用户
+			checkUser(res) {
+				this.userListShow = false;
+				this.tableFrom.uid = res.uid;
+			},
+			// 打开弹窗
+			openuid(e) {
+				this.userListShow = true;
+			},
+			orderSearch() {
+
+			},
+			// 修改成功
+			submitFail() {
+				this.getList();
+			},
+			// 编辑
+			edit(row) {
+				// this.$modalForm(kefuEditApi(row.id)).then(() => this.getList());
+				let ads = [],
+					pro = [];
+				if (row.area_list.length > 0) {
+					row.area_list.forEach(item => {
+						ads.push({
+							label: row.area_name[item],
+							value: item
+						})
+					})
+				}
+				if (row.agent_product.length > 0) {
+					row.agent_product.forEach(item => {
+						pro.push({
+							store_name: item.product.store_name,
+							price: item.product.price,
+							cost: item.product.cost,
+							v_price: item.price,
+							id: item.product_id
+						})
+					});
+				}
+				console.log(ads, 'ads')
+				window.sessionStorage.setItem('agent_product', JSON.stringify(pro))
+				console.log(pro, 'pro')
+				this.$router.push({
+					path: "/admin/agent/dl/add?id=" + row.id + '&uid=' + row.uid + '&address=' + JSON.stringify(
+						ads)
+				});
+			},
+			// 添加
+			add() {
+				this.$router.push({
+					path: "/admin/agent/dl/add"
+				});
+			},
+			// 删除
+			del(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					num: num,
+					url: `store/agent/del/${row.id}`,
+					method: "get",
+					// ids: {
+					// 	id: row.id
+					// },
+				};
+				this.$modalSure(delfromData)
+					.then((res) => {
+						this.$Message.success(res.msg);
+						this.tableList.splice(num, 1);
+						if (!this.tableList.length) {
+							this.tableFrom.page =
+								this.tableFrom.page == 1 ? 1 : this.tableFrom.page - 1;
+						}
+						this.getList();
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				getStoreAgentGdList(this.tableFrom)
+					.then(async (res) => {
+						let data = res.data;
+						this.tableList = data.data;
+						this.total = data.count;
+						this.loading = false;
+						// {
+						// 	title: "供货商成本",
+						// 	key: "supplier_cost",
+						// 	minWidth: 120,
+						// },
+						// {
+						// 	title: "商品成本",
+						// 	key: "product_cost ",
+						// 	minWidth: 120,
+						// },
+						//total_sales
+						this.cardLists = [{
+								"name": "供货商成本",
+								"count": data.supplier_cost,
+								"className": "md-contacts",
+								"col": 4
+							},
+							{
+								"name": "商品成本",
+								"count": data.product_cost,
+								"className": "md-contact",
+								"col": 4
+							},
+							{
+								"name": "总销售额",
+								"count": data.total_sales,
+								"className": "md-contact",
+								"col": 4
+							},
+							{
+								"name": "总利润",
+								"count": data.total_profit,
+								"className": "md-contact",
+								"col": 4
+							}
+						]
+
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			pageChange(index) {
+				this.tableFrom.page = index;
+				this.getList();
+			},
+			onchangeTime(e) {
+			  this.timeVal = e;
+			  this.tableFrom.add_time = this.timeVal[0] ? this.timeVal.join("-") : "";
+			  this.tableFrom.page = 1;
+			  if (!e[0]) {
+			    this.tableFrom.data = "";
+			  }
+			  this.getList();
+			  // this.getStatistics();
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+	.modelBox {
+
+		>>>,
+		.ivu-table-header {
+			width: 100% !important;
+		}
+	}
+
+	.trees-coadd {
+		width: 100%;
+		height: 385px;
+
+		.scollhide {
+			width: 100%;
+			height: 100%;
+			overflow-x: hidden;
+			overflow-y: scroll;
+		}
+	}
+
+	// margin-left: 18px;
+	.scollhide::-webkit-scrollbar {
+		display: none;
+	}
+</style>

+ 13 - 34
src/pages/agent/global/index.vue

@@ -28,6 +28,11 @@
 						<div>{{row.user[0].phone}}</div>
 					</viewer>
 				</template>
+				<template slot-scope="{ row }" slot="add_time">
+					<viewer>
+						<div>{{row.add_time | timeFormat}}</div>
+					</viewer>
+				</template>
 				<template slot-scope="{ row, index }" slot="action">
 					<a @click="edit(row)">编辑</a>
 					<Divider type="vertical" />
@@ -42,6 +47,7 @@
 </template>
 
 <script>
+	import dayjs from "dayjs";
 	import {
 		mapState
 	} from "vuex";
@@ -69,6 +75,12 @@
 				};
 				return statusMap[status];
 			},
+			timeFormat (value) {
+			    if (!value) {
+			        return '-';
+			    }
+			    return dayjs(value * 1000).format('YYYY-MM-DD HH:mm:ss');
+			},
 		},
 		computed: {
 			...mapState("admin/layout", ["isMobile"]),
@@ -91,20 +103,6 @@
 				loading3: false,
 				modals3: false,
 				tableList3: [],
-				columns3: [{
-						title: "用户名称",
-						key: "nickname",
-						width: 200,
-					},
-					{
-						title: "客服头像",
-						slot: "headimgurl",
-					},
-					{
-						title: "操作",
-						slot: "action",
-					},
-				],
 				formValidate5: {
 					page: 1,
 					limit: 15,
@@ -115,25 +113,6 @@
 				total5: 0,
 				loading5: false,
 				tableList5: [],
-				columns5: [{
-						title: "用户名称",
-						key: "nickname",
-						width: 200,
-					},
-					{
-						title: "用户头像",
-						slot: "avatar",
-					},
-					{
-						title: "发送消息",
-						key: "msn",
-						width: 250,
-					},
-					{
-						title: "发送时间",
-						key: "add_time",
-					},
-				],
 				FromData: null,
 				formValidate: {
 					page: 1,
@@ -212,7 +191,7 @@
 					},
 					{
 						title: "添加时间",
-						key: "add_time",
+						slot: "add_time",
 						minWidth: 130,
 					},
 					{

+ 4 - 3
src/pages/finance/dj/list.vue

@@ -3,9 +3,9 @@
 	<div>
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 相关操作 -->
-<!-- 			<Input v-model="listFrom.work_member_id" icon="ios-search" @on-click='openmid' placeholder="请输入员工ID" class="input-add mr14" />
+			<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> -->
+			<Button type="primary" @click="reset" style="margin-left: 20px;">重置</Button>
 			<!-- <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> -->
@@ -124,6 +124,7 @@
 					page: 1,
 					limit: 10,
 					work_member_id: '',
+					uid: ''
 				},
 				list: [],
 				total: 0,
@@ -146,7 +147,7 @@
 			checkmember(res) {
 				let data = res[0];
 				this.modals = false;
-				this.listFrom.work_member_id = data.id;
+				this.listFrom.uid = data.uid;
 			},
 			// // 选中员工
 			// checkmember(res) {

+ 316 - 0
src/pages/statistic/ph/index.vue

@@ -0,0 +1,316 @@
+<template>
+	<div>
+		<Card :bordered="false" dis-hover class="mt15 ivu-mt" :padding="0">
+			<div class="new_card_pd">
+				<!-- 查询条件 -->
+				<Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
+					:label-position="labelPosition" @submit.native.prevent>
+					<FormItem label="类型:" label-for="is_show">
+						<Select v-model="tableFrom.type" placeholder="类型" clearable @on-change="userSearchs"
+							class="input-add">
+							<!-- <Option :value="0">全部</Option> -->
+							<Option :value="1">销售</Option>
+							<Option :value="2">手工</Option>
+						</Select>
+					</FormItem>
+					<!-- <FormItem label="是否删除:" label-for="is_show">
+						<Select v-model="tableFrom.is_del" placeholder="请选择" clearable @on-change="userSearchs"
+							class="input-add">
+							<Option :value="-1">全部</Option>
+							<Option :value="0">正常</Option>
+							<Option :value="1">已删除</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="服务卡:" label-for="coupon_title">
+						<Input v-model="tableFrom.key" placeholder="请输入服务卡名称/ID" @on-search="userSearchs"
+							class="input-add mr14" />
+						<Button type="primary" @click="orderSearch()" class="mr14">查询</Button>
+					</FormItem> -->
+				</Form>
+			</div>
+		</Card>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<!-- <Form ref="tableFrom" :model="tableFrom" :label-width="labelWidth" :label-position="labelPosition"
+				@submit.native.prevent>
+				<Row type="flex">
+					<Col v-bind="grid">
+					<Button v-auth="['admin-marketing-serve-add']" type="primary" icon="md-add"
+						@click="add">添加服务卡</Button>
+					</Col>
+				</Row>
+			</Form> -->
+			<Table :columns="columns1" :data="tableList" ref="table" class="mt25" :loading="loading" highlight-row
+				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+				<template slot-scope="{ row }" slot="coupon_price">
+					<span v-if="row.coupon_type==1">{{row.coupon_price}}元</span>
+					<span
+						v-if="row.coupon_type==2">{{parseFloat(row.coupon_price)/10}}折({{row.coupon_price.toString().split(".")[0]}}%)</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="status">
+					<Icon type="md-checkmark" v-if="row.status === 1" color="#0092DC" size="14" />
+					<Icon type="md-close" v-else color="#ed5565" size="14" />
+				</template>
+				<!-- <template slot-scope="{ row, index }" slot="is_show">
+					<span> {{row.is_show == 1 ?'显示': '隐藏'}}</span>
+				</template> -->
+				<template slot-scope="{ row, index }" slot="add_time">
+					<span> {{row.add_time }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="type">
+					<span style="color: #19be6b;" v-if="row.is_del==0"> 正常</span>
+					<span style="color: #ff9900;" v-if="row.is_del==1"> 删除</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="action">
+					<block v-if="tableFrom.is_del==0">
+						<a @click="bind(row)">绑定项目</a>
+						<Divider type="vertical" />
+						<a @click="couponSend(row)">编辑</a>
+						<Divider type="vertical" />
+						<a @click="couponDel(row,'删除服务卡',index)">删除</a>
+					</block>
+					<block v-else>
+						<a @click="bind(row)">绑定项目</a>
+						<Divider type="vertical" />
+						<a @click="couponSend(row)">编辑</a>
+					</block>
+				</template>
+			</Table>
+			<!-- <div class="acea-row row-right page">
+				<Page :total="total" :current="tableFrom.page" show-elevator show-total @on-change="pageChange"
+					:page-size="tableFrom.limit" />
+			</div> -->
+		</Card>
+		<!--表单编辑-->
+		<edit-from :FromData="FromData" @changeType="changeType" ref="edits"></edit-from>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from 'vuex';
+	import {
+		getPhList
+	} from '@/api/statistic.js';
+	import editFrom from '@/components/from/from';
+	import {
+		formatDate
+	} from '@/utils/validate';
+	import Setting from "@/setting";
+	export default {
+		name: 'storeCoupon',
+		filters: {
+			formatDate(time) {
+				if (time !== 0) {
+					let date = new Date(time * 1000);
+					return formatDate(date, 'yyyy-MM-dd hh:mm');
+				}
+			}
+		},
+		components: {
+			editFrom
+		},
+		data() {
+			return {
+				roterPre: Setting.roterPre,
+				grid: {
+					xl: 7,
+					lg: 7,
+					md: 12,
+					sm: 24,
+					xs: 24
+				},
+				loading: false,
+				columns1: [
+					// {
+					// 	title: 'ID',
+					// 	key: 'id',
+					// 	width: 80
+					// },
+					{
+						title: '员工',
+						key: 'name',
+						minWidth: 200
+					},
+					{
+						title: '员工ID',
+						key: 'member_id',
+						minWidth: 200
+					},
+					{
+						title: '业绩',
+						key: 'performance',
+						minWidth: 80
+					},
+					{
+						title: '部门',
+						key: 'position',
+						minWidth: 80
+					},
+					{
+						title: '联系方式',
+						key: 'mobile',
+						minWidth: 80
+					},
+					// {
+					// 	title: '服务卡折扣(%)',
+					// 	key: 'discount',
+					// 	minWidth: 100
+					// },
+					// {
+					// 	title: '状态',
+					// 	slot: 'type',
+					// 	minWidth: 80
+					// },
+					// {
+					// 	title: '添加时间',
+					// 	slot: 'add_time',
+					// 	minWidth: 130
+					// },
+					// {
+					// 	title: '操作',
+					// 	slot: 'action',
+					// 	fixed: 'right',
+					// 	minWidth: 170
+					// }
+				],
+				tableFrom: {
+					
+					page: 1,
+					limit: 15,
+					type: 1
+				},
+				tableList: [],
+				total: 0,
+				FromData: null
+			}
+		},
+		created() {
+			console.log('zhe')
+			this.getList();
+		},
+		computed: {
+			...mapState('admin/layout', [
+				'isMobile'
+			]),
+			labelWidth() {
+				return this.isMobile ? undefined : 90;
+			},
+			labelPosition() {
+				return this.isMobile ? 'top' : 'left';
+			}
+		},
+		methods: {
+			//绑定项目
+			bind(row) {
+				this.$router.push({
+					path: this.roterPre + "/marketing/serve/bind?id=" + row.id
+				});
+			},
+			// 失效
+			couponInvalid(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					num: num,
+					url: `marketing/coupon/status/${row.id}`,
+					method: 'PUT',
+					ids: ''
+				};
+				this.$modalSure(delfromData).then((res) => {
+					this.$Message.success(res.msg);
+					this.getList();
+				}).catch(res => {
+					this.$Message.error(res.msg);
+				});
+			},
+			// 发布
+			couponSend(row) {
+				// this.$modalForm(serveEditApi(row.id)).then(() => this.getList());
+				this.$router.push({path: this.roterPre + "/marketing/serve/create?id=" + row.id});
+				console.log(row);
+			},
+			// 删除
+			couponDel(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					url: `service/delete/${row.id}`,
+					method: 'DELETE',
+					ids: ''
+				};
+				this.$modalSure(delfromData).then((res) => {
+					this.$Message.success(res.msg);
+					this.tableList.splice(num, 1)
+				}).catch(res => {
+					this.$Message.error(res.msg);
+				});
+			},
+			// 列表
+			getList() {
+				try {
+				this.loading = true;
+				getPhList(this.tableFrom).then(async res => {
+					let data = res.data
+					this.tableList = Object.keys(data).map(key =>{
+						
+						let obj = data[key].member
+						obj.performance = data[key].performance
+						obj.member_id = data[key].member_id
+						return obj
+					});
+					console.log(this.tableList,'console.log(data[key])')
+					// this.total = res.data.count;
+					this.loading = false;
+				}).catch(res => {
+					this.loading = false;
+					this.$Message.error(res.msg);
+				});
+					
+				} catch (error) {
+					console.log('zhe',error)
+					//TODO handle the exception
+				}
+			},
+			pageChange(index) {
+				this.tableFrom.page = index;
+				this.getList();
+			},
+			changeType(data) {
+				this.type = data;
+			},
+			// 添加
+			add() {
+				this.$router.push({
+					path: this.roterPre + "/marketing/serve/create"
+				});
+				// this.addType(0);
+			},
+			// 编辑
+			edit(row) {
+				this.$modalForm(couponEditeApi(row.id)).then(() => this.getList());
+			},
+			// 表格搜索
+			userSearchs() {
+				this.tableFrom.page = 1;
+				this.getList();
+			},
+			// 修改成功
+			submitFail() {
+				this.getList();
+			},
+			orderSearch() {
+				this.tableFrom.page = 1;
+				this.getList();
+			}
+		}
+	}
+</script>
+
+<style scoped>
+	.ivu-col:nth-of-type(1) .ivu-form-item .ivu-form-item-label {
+		width: 80px !important;
+	}
+
+	.ivu-col:nth-of-type(1) .ivu-form-item .ivu-form-item-content {
+		margin-left: 80px !important;
+	}
+</style>

+ 50 - 14
src/pages/user/list/index.vue

@@ -303,6 +303,14 @@
                 @click="onSend"
             >发送优惠券</Button
             >
+			<Button
+			    v-auth="['admin-user-coupon']"
+			    type="primary"
+			    class="mr20"
+			    :disabled="!checkUidList.length && isAll==0"
+			    @click="sendMsg"
+			>发送短信</Button
+			>
           </Tooltip>
           <Tooltip
               content="本页至少选中一项"
@@ -508,25 +516,26 @@
     <user-details ref="userDetails" :group-list="groupList"></user-details>
     <!--发送图文消息 -->
     <Modal
-        v-model="modal13"
+        v-model="modal14"
         scrollable
         title="发送消息"
-        width="1200"
+        width="600"
         height="800"
         footer-hide
         class="modelBox"
     >
-      <news-category
-          v-if="modal13"
-          :isShowSend="isShowSend"
-          :is-all="isAll"
-          :where="userFrom"
-          :userIds="checkUidList.join(',')"
-          :scrollerHeight="scrollerHeight"
-          :contentTop="contentTop"
-          :contentWidth="contentWidth"
-          :maxCols="maxCols"
-      ></news-category>
+      <el-input
+        type="textarea"
+        placeholder="请输入短信内容"
+        v-model="textarea"
+        maxlength="50"
+        show-word-limit
+      >
+      </el-input>
+	  <div style="padding-top: 20px;display: flex;justify-content: flex-end;">
+	    <Button type="primary" @click="msgSend()" style="margin-right: 20px;">发送</Button>
+	    <Button @click="msgCancel()">取消</Button>
+	  </div>
     </Modal>
     <!--修改推广人-->
     <Modal
@@ -677,7 +686,8 @@ import {
   getUserSaveForm,
   giveLevelTimeApi,
   extendInfo,
-  batchProcess
+  batchProcess,
+  sendMsgs
 } from "@/api/user";
 import { agentSpreadApi } from "@/api/agent";
 import editFrom from "../../../components/from/from";
@@ -708,6 +718,8 @@ export default {
   },
   data() {
     return {
+		textarea: '',
+		modal14: false,
       dataLabel: [],
       labelListShow: false,
       labelShow: false,
@@ -985,6 +997,20 @@ export default {
     this.groupLists();
   },
   methods: {
+	  msgCancel() {
+		 this.modal14 = false
+		  this.textarea = ''
+	  },
+	msgSend() {
+		sendMsgs({
+			uid_list: this.checkUidList,
+			content: this.textarea,
+			all: this.isAll,
+		}).then(res => {
+			console.log(res)
+			this.msgCancel()
+		})
+	},
     checkboxItem(e){
       let uid = parseInt(e.rowid);
       let index = this.checkUidList.indexOf(uid);
@@ -1531,6 +1557,16 @@ export default {
       this.$refs.sends.modals = true;
       this.$refs.sends.getList();
     },
+	sendMsg() {
+		if (this.checkUidList.length === 0 && this.isAll==0) {
+		   return this.$Message.warning("请选择要发送优惠券的用户");
+		}
+		console.log(this.checkUidList,'this.checkUidList',this.isAll)
+		this.modal14 = true
+		// this.$refs.sends.modals = true;
+		// this.$refs.sends.modals = true;
+		// this.$refs.sends.getList();
+	},
     // 发送图文消息
     onSendPic() {
       if (this.checkUidList.length === 0 && this.isAll==0) {

+ 45 - 0
src/router/modules/agent.js

@@ -68,6 +68,51 @@ export default {
 		        title: '添加全局奖励'
 		    },
 		    component: () => import('@/pages/agent/global/create')
+		},
+		{
+		    path: 'dl/add',
+		    name: `${pre}dlAdd`,
+		    meta: {
+		        auth: ['admin-agent-dl_add'],
+		        title: '添加区域代理'
+		    },
+		    component: () => import('@/pages/agent/dl/add')
+		},
+		{
+		    path: 'dl/index',
+		    name: `${pre}dlIndex`,
+		    meta: {
+		        auth: ['admin-agent-dl'],
+		        title: '区域代理'
+		    },
+		    component: () => import('@/pages/agent/dl/index')
+		},
+		{
+		    path: 'dl/zyj',
+		    name: `${pre}dlZyj`,
+		    meta: {
+		        auth: ['admin-agent-zyj'],
+		        title: '质押金变化'
+		    },
+		    component: () => import('@/pages/agent/dl/zyj')
+		},
+		{
+		    path: 'dl/qz',
+		    name: `${pre}dlZq`,
+		    meta: {
+		        auth: ['admin-agent-qz'],
+		        title: '权重'
+		    },
+		    component: () => import('@/pages/agent/dl/qz')
+		},
+		{
+		    path: 'dl/qzbh',
+		    name: `${pre}dlQzbh`,
+		    meta: {
+		        auth: ['admin-agent-qzbh'],
+		        title: '权重'
+		    },
+		    component: () => import('@/pages/agent/dl/qzbh')
 		}
     ]
 };

+ 9 - 1
src/router/modules/statistic.js

@@ -72,6 +72,14 @@ export default {
                 title: '余额统计'
             },
             component: () => import('@/pages/statistic/balance/index')
-        }
+        },
+		{
+		    path: 'ph',
+		    name: `${pre}ph`,
+		    meta: {
+		        title: '业绩排行榜'
+		    },
+		    component: () => import('@/pages/statistic/ph/index')
+		}
     ]
 };