cmy 2 年 前
コミット
f5c7c1219f

+ 0 - 0
.gitigonore → .gitignore


+ 121 - 10
src/api/rent.js

@@ -6,7 +6,7 @@ import request from '@/libs/request';
  */
 export function rentAdd(data) {
   return request({
-    url: `marketing/rent/${data.id}`,
+    url: `rent/rent/${data.id}`,
     method: 'post',
     data,
   });
@@ -18,9 +18,8 @@ export function rentAdd(data) {
  */
 export function rentDetail(id) {
   return request({
-    url: `marketing/rent/${id}`,
+    url: `rent/rent/${id}`,
     method: 'get',
-    data,
   });
 }
 
@@ -30,18 +29,17 @@ export function rentDetail(id) {
  */
 export function rentDel(id) {
   return request({
-    url: `marketing/rent/${id}`,
+    url: `rent/rent/${id}`,
     method: 'delete',
-    data,
   });
 }
 /**
  * @description  获取商品列表
-  @param {string} param id {string} 传值参数
+  @param {string} param data {string} 传值参数
  */
 export function rentList(data) {
   return request({
-    url: `marketing/rent`,
+    url: `rent/rent`,
     method: 'get',
     data,
   });
@@ -49,7 +47,7 @@ export function rentList(data) {
 
 /**
  * @description  出资人列表
-  @param {Object} param id {Object} 传值参数
+  @param {Object} param data {Object} 传值参数
  */
 export function sponsorList(data) {
   return request({
@@ -65,12 +63,125 @@ export function sponsorList(data) {
  */
 export function sponsorDetail(id) {
   return request({
-    url: `sponsor/${id}`,
+    url: `sponsor/sponsor/${id}`,
     method: 'get',
-    data,
   });
 }
 
 
 
+/**
+ * @description 出资人名单
+  @param {Object} param data {Object} 传值参数
+ */
+export function sponsorMemberList(data) {
+  return request({
+    url: `sponsor/member`,
+    method: 'get',
+	data,
+  });
+}
+
+
+/**
+ * @description  库存列表
+  @param {Object} param data {Object} 传值参数
+ */
+export function carstockList(data) {
+  return request({
+    url: `car/stock`,
+    method: 'get',
+	data,
+  });
+}
+/**
+ * @description  车辆库存删除
+  @param {Object} param data {Object} 传值参数
+ */
+export function delCartStock(data) {
+  return request({
+    url: `car/stock/${data.id}`,
+    method: 'delete',
+	data,
+  });
+}
+
+/**
+ * @description  车辆库存编辑
+  @param {Object} param data {Object} 传值参数
+ */
+export function editCartStock(data) {
+  return request({
+    url: `car/stock/${data.id}`,
+    method: 'post',
+	data,
+  });
+}
+
+/**
+ * @description  批量车辆库存保存
+  @param {Object} param data {Object} 传值参数
+ */
+export function addCartStockMore(data) {
+  return request({
+    url: `car/stock/batchsave`,
+    method: 'post',
+	data,
+  });
+}
+/**
+ * @description  车辆库存信息
+  @param {Object} param data {Object} 传值参数
+ */
+export function carStockDetail(data) {
+  return request({
+    url: `car/stock/${data.id}`,
+    method: 'get',
+	data,
+  });
+}
+/**
+ * @description  设备列表
+  @param {Object} param data {Object} 传值参数
+ */
+export function carList(data) {
+  return request({
+    url: `car/list`,
+    method: 'get',
+	data,
+  });
+}
+/**
+ * @description  设备详情
+  @param {Object} param data {Object} 传值参数
+ */
+export function getCarDetail(data) {
+  return request({
+    url: `car/car/${data.id}`,
+    method: 'get',
+	data,
+  });
+}
+/**
+ * @description  保存设备信息
+  @param {Object} param data {Object} 传值参数
+ */
+export function setCarDetail(data) {
+  return request({
+    url: `car/car/${data.id}`,
+    method: 'post',
+	data,
+  });
+}
 
+/**
+ * @description  删除设备信息
+  @param {Object} param data {Object} 传值参数
+ */
+export function delCarDetail(data) {
+  return request({
+    url: `car/car/${data.id}`,
+    method: 'delete',
+	data,
+  });
+}

+ 39 - 246
src/pages/rent/cart/add.vue

@@ -13,7 +13,7 @@
 			<Row type="flex" class="mt30 acea-row row-middle row-center">
 				<Col span="20">
 				<Steps :current="current">
-					<Step title="选择租车商品"></Step>
+					<!-- <Step title="选择租车商品"></Step> -->
 					<Step title="填写基础信息"></Step>
 					<Step title="修改商品详情"></Step>
 				</Steps>
@@ -22,29 +22,7 @@
 				<Form class="form mt30" ref="formValidate" :model="formValidate" :rules="ruleValidate"
 					@on-validate="validate" :label-width="labelWidth" :label-position="labelPosition"
 					@submit.native.prevent>
-					<FormItem label="选择商品:" prop="image_input" v-if="current === 0">
-						<div class="picBox" @click="changeGoods">
-							<div class="pictrue" v-if="formValidate.image">
-								<img v-lazy="formValidate.image" />
-							</div>
-							<div class="upLoad acea-row row-center-wrapper" v-else>
-								<Icon type="ios-camera-outline" size="26" class="iconfonts" />
-							</div>
-						</div>
-					</FormItem>
-					<Col v-show="current === 1" type="flex">
-					<!-- <Col span="24">
-					<FormItem label="商品主图:" prop="image">
-						<div class="picBox" @click="modalPicTap('dan', 'danFrom')">
-							<div class="pictrue" v-if="formValidate.image">
-								<img v-lazy="formValidate.image" />
-							</div>
-							<div class="upLoad acea-row row-center-wrapper" v-else>
-								<Icon type="ios-camera-outline" size="26" class="iconfont" />
-							</div>
-						</div>
-					</FormItem>
-					</Col> -->
+					<Col v-show="current === 0" type="flex">
 					<Col span="24">
 					<FormItem label="商品轮播图:" prop="images">
 						<div class="acea-row">
@@ -79,19 +57,21 @@
 					</Col>
 					</Col>
 					<Col span="24">
-					<FormItem label="单位:" prop="unit_name" label-for="unit_name">
-						<Input placeholder="请输入单位" element-id="unit_name" v-model="formValidate.unit_name"
-							class="perW20" />
-					</FormItem>
 					</Col>
 					<Col span="24">
-					<FormItem label="排序:">
+					<FormItem label="排序:" prop="sort">
 						<InputNumber placeholder="请输入排序" element-id="sort" :precision="0" :max="10000" :min="0"
 							v-model="formValidate.sort" class="perW10" />
 					</FormItem>
 					</Col>
 					<Col span="24">
-					<FormItem label="以租代购:" props="car_lease" label-for="car_lease">
+					<FormItem label="租车价:"  prop="price">
+						<InputNumber placeholder="请输入每月租车价格" element-id="price" :precision="0" :max="10000" :min="0"
+							v-model="formValidate.price" class="perW10" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="以租代购:" prop="car_lease" label-for="car_lease">
 						<RadioGroup element-id="car_lease" v-model="formValidate.car_lease">
 							<Radio :label="1" class="radio">是</Radio>
 							<Radio :label="0">否</Radio>
@@ -99,37 +79,13 @@
 					</FormItem>
 					</Col>
 					<Col span="24">
-					<FormItem v-if="formValidate.car_lease==1" label="还款月份:" props="several_months">
-						<InputNumber placeholder="请输入还款月份" element-id="several_months" :precision="0" :max="100" :min="0"
-							v-model="formValidate.several_months" class="perW10" />
-					</FormItem>
-					</Col>
-					<Col span="24">
-					<FormItem label="规格选择:">
-						<Table :data="specsData" :columns="columns" border @on-selection-change="changeCheckbox">
-							<template slot-scope="{ row, index }" slot="price">
-								<InputNumber v-model="row.price" :min="0.01" :precision="2" class="priceBox" @on-change="
-                          (e) => {
-                            changePrice(e, index);
-                          }
-                        " :active-change="false"></InputNumber>
-							</template>
-							<template slot-scope="{ row, index }" slot="pic">
-								<div class="acea-row row-middle row-center-wrapper"
-									@click="modalPicTap('dan', 'danTable', index)">
-									<div class="pictrue pictrueTab" v-if="row.pic">
-										<img v-lazy="row.pic" />
-									</div>
-									<div class="upLoad pictrueTab acea-row row-center-wrapper" v-else>
-										<Icon type="ios-camera-outline" size="21" />
-									</div>
-								</div>
-							</template>
-						</Table>
+					<FormItem v-if="formValidate.car_lease==1" label="还款月份:" prop="several_months">
+						<InputNumber placeholder="请输入还款月份" element-id="several_months" :precision="0" :max="100"
+							:min="0" v-model="formValidate.several_months" class="perW10" />
 					</FormItem>
 					</Col>
 					</Col>
-					<Row v-show="current === 2">
+					<Row v-show="current === 1">
 						<Col span="24">
 						<FormItem label="内容:">
 							<WangEditor style="width: 90%" :content="formValidate.description"
@@ -140,10 +96,10 @@
 					<Col span="24">
 					<FormItem>
 						<Button class="submission mr15" @click="step" v-show="current !== 0"
-							:disabled="$route.params.id && current === 1">上一步
+							:disabled="$route.params.id && current === 0">上一步
 						</Button>
-						<Button :disabled="submitOpen && current === 2" type="primary" class="submission"
-							@click="next('formValidate')" v-text="current === 2 ? '提交' : '下一步'"></Button>
+						<Button :disabled="submitOpen && current === 1" type="primary" class="submission"
+							@click="next('formValidate')" v-text="current === 1 ? '提交' : '下一步'"></Button>
 					</FormItem>
 					</Col>
 				</Form>
@@ -151,11 +107,6 @@
 				</Col>
 			</Row>
 		</Card>
-		<!-- 选择商品-->
-		<Modal v-model="modals" title="商品列表" class="paymentFooter" footerHide scrollable width="900"
-			@on-cancel="cancel">
-			<goods-list ref="goodslist" @getProductId="getProductId"></goods-list>
-		</Modal>
 		<!-- 上传图片-->
 		<Modal v-model="modalPic" width="950px" scrollable footer-hide closable title="上传商品图" :mask-closable="false"
 			:z-index="888">
@@ -169,19 +120,15 @@
 	import {
 		mapState
 	} from 'vuex';
-	import goodsList from '@/components/goodsList/index';
 	import WangEditor from '@/components/wangEditor/index.vue';
 	import uploadPictures from '@/components/uploadPictures';
-	import {
-		productAttrsApi
-	} from '@/api/marketing';
 	import {
 		rentAdd,
+		rentDetail
 	} from '@/api/rent';
 	export default {
 		name: 'storeSeckillCreate',
 		components: {
-			goodsList,
 			uploadPictures,
 			WangEditor,
 		},
@@ -213,7 +160,6 @@
 					sm: 8,
 					xs: 8,
 				},
-				modals: false,
 				modal_loading: false,
 				images: [],
 				formValidate: {
@@ -228,15 +174,10 @@
 					status: 0,
 					description: '',
 					id: 0,
-					product_id: 0,
-					several_months:12,//还款月份
-					car_lease:0,//默认关闭以租代购
-					attrs: [],
-					items: [],
+					several_months: 12, //还款月份
+					car_lease: 0, //默认关闭以租代购
 				},
 				description: '',
-				columns: [],
-				specsData: [],
 				picTit: '',
 				tableIndex: 0,
 				ruleValidate: {
@@ -268,17 +209,18 @@
 						message: '请输入简介',
 						trigger: 'blur'
 					}],
-					unit_name: [{
-						required: true,
-						message: '请输入单位',
-						trigger: 'blur'
-					}],
 					price: [{
 						required: true,
 						type: 'number',
 						message: '请输入租车价',
 						trigger: 'blur',
 					}, ],
+					several_months: [{
+						required: true,
+						type: 'number',
+						message: '请输入月份',
+						trigger: 'blur',
+					}, ]
 				},
 				copy: 0,
 			};
@@ -293,9 +235,11 @@
 			},
 		},
 		mounted() {
+
+			console.log(this.$route.params, 'pr');
 			if (this.$route.params.id) {
 				this.copy = this.$route.params.copy;
-				this.current = 1;
+				this.current = 0;
 				this.getInfo();
 			}
 		},
@@ -304,150 +248,23 @@
 			getEditorContent(data) {
 				this.description = data;
 			},
-			// 租车商品规格;
-			productAttrs(rows) {
-				let that = this;
-				productAttrsApi(rows.id, 7)
-					.then((res) => {
-						let data = res.data.info;
-						let selection = {
-							type: 'selection',
-							width: 60,
-							align: 'center',
-						};
-						that.specsData = data.attrs;
-						that.specsData.forEach(function(item, index) {
-							that.$set(that.specsData[index], 'id', index);
-						});
-						that.formValidate.items = data.items;
-						that.columns = data.header;
-						that.columns.unshift(selection);
-						that.inputChange(data);
-					})
-					.catch((res) => {
-						that.$Message.error(res.msg);
-					});
-			},
-			inputChange(data) {
-				let that = this;
-				let $index = [];
-				data.header.forEach(function(item, index) {
-					if (item.type === 1) {
-						$index.push({
-							index: index,
-							key: item.key,
-							title: item.title
-						});
-					}
-				});
-				$index.forEach(function(item, index) {
-					let title = item.title;
-					let key = item.key;
-					let row = {
-						title: title,
-						key: key,
-						align: 'center',
-						minWidth: 100,
-						render: (h, params) => {
-							return h('div', [
-								h('InputNumber', {
-									props: {
-										min: 1,
-										precision: 0,
-										value: params.row.quota,
-									},
-									on: {
-										'on-change': (e) => {
-											params.row.quota = e;
-											that.specsData[params.index] = params.row;
-											if (!!that.formValidate.attrs && that
-												.formValidate.attrs.length) {
-												that.formValidate.attrs.forEach((v,
-													index) => {
-													if (v.id === params.row.id) {
-														that.formValidate.attrs
-															.splice(index, 1,
-																params.row);
-													}
-												});
-											}
-										},
-									},
-								}),
-							]);
-						},
-					};
-					that.columns.splice(item.index, 1, row);
-				});
-			},
-			// 多选
-			changeCheckbox(selection) {
-				this.formValidate.attrs = selection;
-			},
 			// 表单验证
 			validate(prop, status, error) {
 				if (status === false) {
 					this.$Message.error(error);
 				}
 			},
-			// 商品id
-			getProductId(row) {
-				this.modal_loading = false;
-				this.modals = false;
-				setTimeout(() => {
-					this.formValidate = {
-						images: row.slider_image,
-						info: row.store_info,
-						title: row.store_name,
-						image: row.image,
-						unit_name: row.unit_name,
-						price: 0, // 不取商品中的原价
-						sales: row.sales,
-						sort: row.sort,
-						status: 0,
-						description: row.description,
-						id: 0,
-						product_id: row.id,
-						custom_form: row.custom_form, //自定义表单数据
-						car_lease:0,//默认关闭以租代购
-						several_months:12,//需要几个月
-					};
-					this.productAttrs(row);
-					this.$refs.goodslist.productRow = null;
-				}, 500);
-			},
-			cancel() {
-				this.modals = false;
-			},
 			// 详情
 			getInfo() {
 				this.spinShow = true;
+				console.log(this.$route.params.id, 'id');
 				rentDetail(this.$route.params.id)
 					.then(async (res) => {
 						let that = this;
 						let info = res.data.info;
-						let selection = {
-							type: 'selection',
-							width: 60,
-							align: 'center',
-						};
 						this.formValidate = info;
-						this.$set(this.formValidate, 'items', info.attrs.items);
-						this.columns = info.attrs.header;
-						this.columns.unshift(selection);
-						that.specsData = info.attrs.value;
-						that.specsData.forEach(function(item, index) {
-							that.$set(that.specsData[index], 'id', index);
-						});
-						let data = info.attrs;
-						let attr = [];
-						for (let index in info.attrs.value) {
-							if (info.attrs.value[index]._checked) {
-								attr.push(info.attrs.value[index]);
-							}
-						}
-						that.formValidate.attrs = attr;
-						this.inputChange(data);
+						this.formValidate.price = +info.price;
+						this.$set(this.formValidate);
 						this.spinShow = false;
 					})
 					.catch((res) => {
@@ -455,19 +272,19 @@
 						this.$Message.error(res.msg);
 					});
 			},
-			changePrice(e, index) {
-				this.$set(this.specsData[index], 'price', e);
-			},
 			// 下一步
 			next(name) {
 				let that = this;
-				if (this.current === 2) {
+				if (this.current === 1) {
 					this.formValidate.description = this.description;
 					this.$refs[name].validate((valid) => {
 						if (valid) {
-							if (this.copy == 1) this.formValidate.copy = 1;
+							if (this.copy == 1) {
+								this.formValidate.copy = 1;
+							}
 							this.formValidate.id = Number(this.$route.params.id) || 0;
 							this.submitOpen = true;
+							console.log(this.formValidate,'up');
 							rentAdd(this.formValidate)
 								.then(async (res) => {
 									this.submitOpen = false;
@@ -486,21 +303,8 @@
 							return false;
 						}
 					});
-				} else if (this.current === 1) {
-					this.$refs[name].validate((valid) => {
-						if (valid) {
-							if (!that.formValidate.attrs) {
-								return that.$Message.error('请选择属性规格');
-							}
-							this.current += 1;
-						}
-					});
-				} else {
-					if (this.formValidate.images) {
-						this.current += 1;
-					} else {
-						this.$Message.warning('请选择商品');
-					}
+				} else if (this.current === 0) {
+					this.current += 1;
 				}
 			},
 			// 上一步
@@ -528,10 +332,6 @@
 						//     this.specsData[this.tableIndex].pic = pc.att_dir;
 						//     break;
 					default:
-						if (!!this.formValidate.attrs && this.formValidate.attrs.length) {
-							this.$set(this.specsData[this.tableIndex], '_checked', true);
-						}
-						this.specsData[this.tableIndex].pic = pc.att_dir;
 				}
 				this.modalPic = false;
 			},
@@ -548,13 +348,6 @@
 				this.images.splice(i, 1);
 				this.formValidate.images.splice(i, 1);
 			},
-			// 选择商品
-			changeGoods() {
-				this.modals = true;
-				this.$refs.goodslist.formValidate.is_presale = 0;
-				this.$refs.goodslist.getList();
-				this.$refs.goodslist.goodsCategory();
-			}, // 移动
 			handleDragStart(e, item) {
 				this.dragging = item;
 			},

+ 114 - 0
src/pages/rent/cart/addCartManage.vue

@@ -0,0 +1,114 @@
+<template>
+	<div>
+		<Form ref="formItem" :model="formItem" :label-width="100" @submit.native.prevent>
+			<FormItem label="车辆名称:">
+				<Input class="form-sty" v-model="formItem.machine_name" placeholder="请输入购车价格"
+					style="width: 80%"></Input>
+			</FormItem>
+			<FormItem label="设备编号:">
+				<Input class="form-sty" v-model.trim="formItem.machine_no" placeholder="车辆编号只可输入数字"
+					style="width: 80%"></Input>
+			</FormItem>
+			<FormItem label="类型:">
+				<Select v-model="formItem.car_type" class="form-sty">
+					<Option :value="0">商城</Option>
+					<Option :value="1">产家</Option>
+					<Option :value="2">租车</Option>
+					<Option :value="3">代理</Option>
+					<Option :value="4">运营</Option>
+					<Option :value="5">共享</Option>
+					<Option :value="6">测试</Option>
+				</Select>
+			</FormItem>
+			<FormItem label="用户姓名:">
+				<Input class="form-sty" v-model="formItem.real_name" placeholder="请输入购车价格" style="width: 80%"></Input>
+			</FormItem>
+			<FormItem label="用户id:">
+				<Input class="form-sty" type="number" v-model="formItem.uid" placeholder="请输入购车价格"
+					style="width: 80%"></Input>
+			</FormItem>
+			<FormItem label="手机号:">
+				<Input class="form-sty" type="number" v-model="formItem.phone" placeholder="请输入车辆分红"
+					style="width: 80%"></Input>
+			</FormItem>
+		</Form>
+	</div>
+</template>
+
+<script>
+	export default {
+		name: 'userEdit',
+		props: {
+			cartData: {
+				type: Object,
+				default: () => {},
+			},
+		},
+		data() {
+			return {
+				formItem: {
+					id: 0, //修改的id
+					machine_no: '', //设备编号
+					car_type: '',
+					machine_name: '',
+					real_name: '',
+					phone: '',
+					uid: '',
+				},
+			};
+		},
+		mounted() {
+			let arr = Object.keys(this.formItem);
+			if (this.cartData.id) {
+				arr.map((i) => {
+					this.formItem[i] = this.cartData[i];
+				});
+			}
+		},
+	};
+</script>
+
+<style lang="stylus" scoped>
+	.labelInput {
+		border: 1px solid #dcdee2;
+		width: 400px;
+		padding: 0 8px;
+		border-radius: 5px;
+		min-height: 30px;
+		cursor: pointer;
+
+		.span {
+			color: #c5c8ce;
+		}
+
+		.iconxiayi {
+			font-size: 12px;
+		}
+	}
+
+	.ivu-form-item {
+		margin-bottom: 10px;
+	}
+
+	.form-sty {
+		width: 400px !important;
+	}
+
+	.addfont {
+		display: inline-block;
+		font-size: 13px;
+		font-weight: 400;
+		color: #1890FF;
+		margin-left: 14px;
+		cursor: pointer;
+		margin-left: 10px;
+	}
+
+	.ivu-icon-ios-arrow-down {
+		font-size: 14px;
+	}
+
+	.tip {
+		color: #bbb;
+	}
+</style>

+ 171 - 0
src/pages/rent/cart/addCartStock.vue

@@ -0,0 +1,171 @@
+<template>
+	<div>
+		<Form ref="formItem" :model="formItem" :label-width="100" @submit.native.prevent inline>
+			<FormItem label="编号:" v-if="formItem.id">
+				<div class="form-sty">
+					{{formItem.id}}
+				</div>
+			</FormItem>
+			<FormItem label="设备编号:">
+				<Input class="form-sty" v-model.trim="formItem.machine_no" placeholder="车辆编号只可输入数字"
+					style="width: 80%"></Input>
+			</FormItem>
+			<FormItem label="购车价格:">
+				<Input class="form-sty" type="number" v-if="!formItem.id" v-model="formItem.price" placeholder="请输入购车价格"
+					style="width: 80%"></Input>
+				<div class="form-sty" v-else>
+					{{formItem.price}}
+				</div>
+			</FormItem>
+			<FormItem label="车辆分红:">
+				<Input class="form-sty" type="number" v-if="!formItem.id" v-model="formItem.dividend_price"
+					placeholder="请输入车辆分红" style="width: 80%"></Input>
+				<div class="form-sty" v-else>
+					{{formItem.dividend_price}}
+				</div>
+			</FormItem>
+			<FormItem label="出资人:" v-if="!formItem.id">
+				<Select v-model="actionMember" class="form-sty" filterable clearable>
+					<Option v-for="(item, index) in infoData.memberList" :key="index" :value="index">
+						{{ item.user.real_name+item.user.uid }}
+					</Option>
+				</Select>
+			</FormItem>
+			<template v-if="formItem.id">
+				<FormItem label="出资人:">
+					<div class="form-sty">
+						{{formItem.user.real_name}},
+					</div>
+				</FormItem>
+				<FormItem label="UID:">
+					<div class="form-sty">
+						{{formItem.user.uid}}
+					</div>
+				</FormItem>
+				<FormItem label="昵称:">
+					<div class="form-sty">
+						{{formItem.user.nickname}},
+					</div>
+				</FormItem>
+				<FormItem label="电话:">
+					<div class="form-sty">
+						{{formItem.user.phone}},
+					</div>
+				</FormItem>
+			</template>
+		</Form>
+	</div>
+</template>
+
+<script>
+	import {
+		sponsorMemberList,
+	} from '@/api/rent';
+	export default {
+		name: 'userEdit',
+		props: {
+			cartData: {
+				type: Object,
+				default: () => {},
+			},
+		},
+		watch: {
+			// 监听选中的对象
+			'actionMember'(newValue) {
+				const that = this;
+				const da = that.infoData.memberList[newValue];
+				that.formItem.sponsor_id = da.id;
+				that.formItem.sponsor_uid = da.uid;
+				that.formItem.recommend_uid = da.user.spread_uid;
+			}
+		},
+		data() {
+			return {
+				formItem: {
+					id: 0, //修改的id
+					machine_no: '', //车架号
+					sponsor_id: 0, //车辆id
+					sponsor_uid: 0, //出资人
+					recommend_uid: 0, //出资人的邀请人
+					real_name: '',
+					price: '', //购车价格
+					dividend_price: '', //分红金额
+					is_system: 0, //默认平台
+					user: {}
+				},
+				actionMember: '',
+				infoData: {
+					memberList: [],
+				},
+			};
+		},
+		mounted() {
+			let arr = Object.keys(this.formItem);
+			if (this.cartData.info.id) {
+				arr.map((i) => {
+					this.formItem[i] = this.cartData.info[i];
+				});
+			}
+		},
+		created() {
+			this.getMemberList();
+		},
+		methods: {
+			// 获取投资人列表
+			getMemberList() {
+				const that = this;
+				sponsorMemberList().then((res) => {
+					that.infoData.memberList = res.data;
+					console.log(res, 'res');
+				}).catch((res) => {
+					console.log(res);
+				})
+			}
+		},
+	};
+</script>
+
+<style lang="stylus" scoped>
+	.labelInput {
+		border: 1px solid #dcdee2;
+		width: 400px;
+		padding: 0 8px;
+		border-radius: 5px;
+		min-height: 30px;
+		cursor: pointer;
+
+		.span {
+			color: #c5c8ce;
+		}
+
+		.iconxiayi {
+			font-size: 12px;
+		}
+	}
+
+	.ivu-form-item {
+		margin-bottom: 10px;
+	}
+
+	.form-sty {
+		width: 200px !important;
+	}
+
+	.addfont {
+		display: inline-block;
+		font-size: 13px;
+		font-weight: 400;
+		color: #1890FF;
+		margin-left: 14px;
+		cursor: pointer;
+		margin-left: 10px;
+	}
+
+	.ivu-icon-ios-arrow-down {
+		font-size: 14px;
+	}
+
+	.tip {
+		color: #bbb;
+	}
+</style>

+ 402 - 0
src/pages/rent/cart/carstock.vue

@@ -0,0 +1,402 @@
+<template>
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt listbox">
+			<Form ref="userFrom" :model="cartFrom" :label-width="labelWidth" :label-position="labelPosition"
+				@submit.native.prevent>
+				<Row :gutter="16">
+					<Col span="18">
+					<Col span="24">
+					<Col v-bind="grid">
+					<FormItem label="搜索:" label-for="nickname">
+						<Input v-model="cartFrom.nickname" placeholder="请输入搜索内容" element-id="nickname" clearable>
+						<Select v-model="field_key" slot="prepend" style="width: 80px">
+							<Option value="all">全部</Option>
+							<Option value="uid">ID</Option>
+							<Option value="phone">手机号</Option>
+							<Option value="nickname">用户昵称</Option>
+						</Select>
+						</Input>
+					</FormItem>
+					
+					</Col>
+					</Col>
+					</Col>
+					<Col span="6" class="ivu-text-right userFrom">
+					<FormItem>
+						<Button type="primary" icon="ios-search" label="default" class="mr15"
+							@click="searchs">搜索</Button>
+						<Button class="ResetSearch" @click="reset()">重置</Button>
+					</FormItem>
+					</Col>
+				</Row>
+				<Row type="flex" class="mb20">
+					<Col v-bind="grid">
+					<Button v-auth="['admin-car_stock-add']" type="primary" icon="md-add" @click="add"
+						class="mr10">添加租车商品</Button>
+					</Col>
+				</Row>
+			</Form>
+			<Row type="flex" justify="space-between" class="mt20">
+				<Col span="24" class="userAlert" v-if="selectionList.length">
+				<Alert show-icon>
+					已选择<i class="userI"> {{ selectionList.length }} </i>项</Alert>
+				</Col>
+			</Row>
+			<Table :columns="columns" :data="userLists" class="mt25" ref="table" highlight-row :loading="loading"
+				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果" @on-select="handleSelectRow"
+				@on-select-cancel="handleCancelRow" @on-select-all="handleSelectAll"
+				@on-select-all-cancel="handleSelectAll">
+				<template slot-scope="{ row, index }" slot="avatars">
+					<div class="tabBox_img" v-viewer>
+						<img v-lazy="row.user.avatar" />
+					</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="recommentuid">
+					{{row.recommend_uid?`姓名:${row.recommend.real_name||row.recommend.nickname} ID:${row.recommend.uid}`:'无推荐人'}}
+				</template>
+				<template slot-scope="{ row, index }" slot="status">
+					<div style="color:#ff9900;" v-if="row.status==0">待租</div>
+					<div style="color: #2db7f5;" v-if="row.status==1">进行中</div>
+					<div style="color: #19be6b;" v-if="row.status==2">完成</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="system">
+					<div style="color:#ff9900;" v-if="row.is_system==0">否</div>
+					<div style="color: #19be6b;" v-if="row.is_system==1">是</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="nickname">
+					<div class="acea-row">
+						<div v-text="row.user.nickname+' UID:'+row.user.uid"></div>
+					</div>
+					<div v-if="row.is_del == 1" style="color: red">用户已注销</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="action">
+					<a @click="edit(row)">编辑</a>
+				</template>
+			</Table>
+		</Card>
+		<Drawer :closable="false" width="700" v-model="modals" title="车辆信息填写">
+			<addCartStock ref="addCartStock" v-if="modals" :cartData="cartData"></addCartStock>
+			<div class="demo-drawer-footer">
+				<Button style="margin-right: 8px" @click="modals = false">取消</Button>
+				<Button type="primary" @click="setCart">提交</Button>
+			</div>
+		</Drawer>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from 'vuex';
+	import {
+		carstockList,
+		addCartStockMore,
+		carStockDetail,
+		editCartStock
+	} from '@/api/rent';
+	import addCartStock from './addCartStock.vue';
+	export default {
+		name: 'user_list',
+		components: {
+			addCartStock
+		},
+		data() {
+			return {
+				selectDataLabel: [],
+				// 是否显示新增编辑
+				modals:false,
+				// 保存选中编辑的用户
+				cartData:{},
+				grid: {
+					xl: 10,
+					lg: 10,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				loading: false,
+				total: 0,
+				cartFrom: {
+					nickname: '',
+					page: 1,
+					limit: 15,
+					field_key: '',
+				},
+				field_key: '',
+				columns: [{
+						type: 'selection',
+						width: 60,
+						align: 'center',
+					},
+					{
+						title: 'ID',
+						key: 'id',
+						width: 80,
+					},
+					{
+						title: '头像',
+						slot: 'avatars',
+						minWidth: 60,
+					},
+					{
+						title: '姓名',
+						slot: 'nickname',
+						minWidth: 150,
+					},
+					{
+						title: '推荐人',
+						key: 'recommend_uid',
+						slot: 'recommentuid',
+						minWidth: 150,
+					},
+					{
+						title: '购车价',
+						key: 'price',
+						minWidth: 90,
+					},
+					{
+						title: '车辆分红',
+						key: 'dividend_price',
+						minWidth: 100,
+					},
+					{
+						title: '已分红',
+						key: 'paid_dividend',
+						minWidth: 100,
+					},
+					{
+						title: '状态',
+						key: 'status',
+						slot: 'status',
+						minWidth: 50,
+					},
+					{
+						title: '平台',
+						key: 'is_system',
+						slot: 'system',
+						minWidth: 50,
+					},
+					{
+						title: '创建时间',
+						key: 'add_time',
+						minWidth: 150,
+					},
+					{
+						title: '操作',
+						slot: 'action',
+						fixed: 'right',
+						minWidth: 120,
+					},
+				],
+				userLists: [],
+				selectionList: [],
+				selectedIds: new Set(), //选中合并项的id
+				ids: [],
+			};
+		},
+		computed: {
+			...mapState('media', ['isMobile']),
+			labelWidth() {
+				return this.isMobile ? undefined : 100;
+			},
+			labelPosition() {
+				return this.isMobile ? 'top' : 'right';
+			},
+		},
+		created() {
+			this.getList();
+		},
+		methods: {
+			// 保存购物车
+			setCart() {
+			  let data = this.$refs.addCartStock.formItem;
+			  if(!/^[0-9,]*$/.test(data.machine_no)){
+				  this.$Message.error('设备编号只可填入数字和,号');
+				  return 
+			  }
+			  if (data.id) {
+			    editCartStock(data)
+			      .then((res) => {
+			        this.modals = false;
+			        this.$Message.success(res.msg);
+			        this.getList();
+			      })
+			      .catch((err) => {
+			        this.$Message.error(err.msg);
+			      });
+			  } else {
+			    addCartStockMore(data)
+			      .then((res) => {
+			        this.modals = false;
+			        this.$Message.success(res.msg);
+			        this.getList();
+			      })
+			      .catch((err) => {
+			        this.$Message.error(err.msg);
+			      });
+			  }
+			},
+			// 添加新车辆库存
+			add(){
+				this.cartData={}
+				this.modals = true;
+			},
+			// 获取编辑表单数据
+			getCartFrom(id) {
+			  carStockDetail({id})
+			    .then(async (res) => {
+			      this.cartData = res.data;
+			      this.modals = true;
+			    })
+			    .catch((res) => {
+			      this.$Message.error(res.msg);
+			    });
+			},
+			// 车辆库存列表
+			getList() {
+				if (this.selectDataLabel.length) {
+					let activeIds = [];
+					this.selectDataLabel.forEach((item) => {
+						activeIds.push(item.id);
+					});
+				}
+				this.cartFrom.field_key = this.field_key === 'all' ? '' : this.field_key;
+				this.loading = true;
+				console.log(this.cartFrom);
+				carstockList(this.cartFrom)
+					.then(async (res) => {
+						let data = res.data;
+						this.userLists = data.list;
+						this.total = data.count;
+						this.loading = false;
+						this.$nextTick(() => {
+							this.setChecked();
+						});
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			pageChange(index) {
+				this.selectionList = [];
+				this.cartFrom.page = index;
+				this.getList();
+			},
+			// 搜索
+			searchs() {
+				this.cartFrom.page = 1;
+				this.getList();
+			},
+			// 重置
+			reset() {
+				this.cartFrom = {
+					nickname: '',
+					field_key: '',
+					page: 1, // 当前页
+					limit: 20, // 每页显示条数
+				};
+				this.field_key = '';
+				this.selectDataLabel = [];
+				this.selectedIds = new Set();
+				this.getList();
+			},
+			// 编辑
+			edit(row) {
+				this.getCartFrom(row.id);
+			},
+			//全选和取消全选时触发
+			handleSelectAll(selection) {
+				if (selection.length === 0) {
+					//获取table的数据;
+					let data = this.$refs.table.data;
+					data.forEach((item) => {
+						if (this.selectedIds.has(item.id)) {
+							this.selectedIds.delete(item.id);
+						}
+					});
+				} else {
+					selection.forEach((item) => {
+						this.selectedIds.add(item.id);
+					});
+				}
+				this.$nextTick(() => {
+					//确保dom加载完毕
+					this.setChecked();
+				});
+			},
+			//  选中某一行
+			handleSelectRow(selection, row) {
+				this.selectedIds.add(row.id);
+				this.$nextTick(() => {
+					//确保dom加载完毕
+					this.setChecked();
+				});
+			},
+			//  取消某一行
+			handleCancelRow(selection, row) {
+				this.selectedIds.delete(row.id);
+				this.$nextTick(() => {
+					//确保dom加载完毕
+					this.setChecked();
+				});
+			},
+			setChecked() {
+				//将new Set()转化为数组
+				this.ids = [...this.selectedIds];
+				// 找到绑定的table的ref对应的dom,找到table的objData对象,objData保存的是当前页的数据
+				let objData = this.$refs.table.objData;
+				for (let index in objData) {
+					if (this.selectedIds.has(objData[index].id)) {
+						objData[index]._isChecked = true;
+					}
+				}
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.userFrom {
+		>>>.ivu-form-item-content {
+			margin-left: 0px !important;
+		}
+	}
+
+	.userAlert {
+		margin-top: 20px;
+	}
+
+	.userI {
+		color: #1890FF;
+		font-style: normal;
+	}
+
+	img {
+		height: 36px;
+		display: block;
+	}
+
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+	.demo-drawer-footer {
+		position: absolute;
+		bottom: 0;
+		right: 0;
+		width: 100%;
+		border-top: 1px solid #e8e8e8;
+		padding: 10px 16px;
+		text-align: right;
+		background: #fff;
+	}
+</style>

+ 476 - 0
src/pages/rent/cart/cartManage.vue

@@ -0,0 +1,476 @@
+<template>
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt listbox">
+			<Form ref="userFrom" :model="cartFrom" :label-width="labelWidth" :label-position="labelPosition"
+				@submit.native.prevent>
+				<Row :gutter="16">
+					<Col span="18">
+					<Col span="24">
+					<Col v-bind="grid">
+					<FormItem label="搜索:" label-for="nickname">
+						<Input v-model="cartFrom.nickname" placeholder="请输入搜索内容" element-id="nickname" clearable>
+						<Select v-model="field_key" slot="prepend" style="width: 80px">
+							<Option value="all">全部</Option>
+							<Option value="plate_number">车牌号</Option>
+							<Option value="frame_no">车架号</Option>
+							<Option value="real_name">姓名</Option>
+							<Option value="phone">手机号</Option>
+							<Option value="machine_name">设备名称</Option>
+							<Option value="machine_no">设备编号</Option>
+							<Option value="sponsor_id">出资人编号</Option>
+							<Option value="store_id">门店编号</Option>
+							<Option value="agent_id">代理编号</Option>
+							<Option value="cooperate_id">运营编号</Option>
+							<Option value="company_id">企业编号</Option>
+							<Option value="uid">用户编号</Option>
+						</Select>
+						</Input>
+					</FormItem>
+
+					</Col>
+					<Col v-bind="grid">
+					<FormItem label="是否可用:" label-for="nickname">
+						<Select v-model="cartFrom.is_available">
+							<Option value="1">是</Option>
+							<Option value="0">否</Option>
+						</Select>
+					</FormItem>
+					</Col>
+					<Col v-bind="grid">
+					<FormItem label="是否在线:" label-for="nickname">
+						<Select v-model="cartFrom.is_online">
+							<Option value="1">是</Option>
+							<Option value="0">否</Option>
+						</Select>
+					</FormItem>
+					</Col>
+					<Col v-bind="grid">
+					<FormItem label="订单类型:" label-for="nickname">
+						<Select v-model="cartFrom.car_type">
+							<Option value="0">商城</Option>
+							<Option value="1">产家</Option>
+							<Option value="2">租车</Option>
+							<Option value="3">代理</Option>
+							<Option value="4">运营</Option>
+							<Option value="5">共享</Option>
+							<Option value="6">测试</Option>
+						</Select>
+					</FormItem>
+					</Col>
+					<Col v-bind="grid">
+					<FormItem label="状态:" label-for="nickname">
+						<Select v-model="cartFrom.status">
+							<Option value="0">关锁</Option>
+							<Option value="1">开锁</Option>
+							<Option value="2">解锁</Option>
+						</Select>
+					</FormItem>
+					</Col>
+					</Col>
+					</Col>
+					<Col span="6" class="ivu-text-right userFrom">
+					<FormItem>
+						<Button type="primary" icon="ios-search" label="default" class="mr15"
+							@click="searchs">搜索</Button>
+						<Button class="ResetSearch" @click="reset()">重置</Button>
+					</FormItem>
+					</Col>
+				</Row>
+				<Row type="flex" class="mb20">
+					<Col v-bind="grid">
+					<Button v-auth="['admin-car-add']" type="primary" icon="md-add" @click="add"
+						class="mr10">新增设备</Button>
+					</Col>
+				</Row>
+			</Form>
+			<Row type="flex" justify="space-between" class="mt20">
+				<Col span="24" class="userAlert" v-if="selectionList.length">
+				<Alert show-icon>
+					已选择<i class="userI"> {{ selectionList.length }} </i>项</Alert>
+				</Col>
+			</Row>
+			<Table :columns="columns" :data="userLists" class="mt25" ref="table" highlight-row :loading="loading"
+				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果" @on-select="handleSelectRow"
+				@on-select-cancel="handleCancelRow" @on-select-all="handleSelectAll"
+				@on-select-all-cancel="handleSelectAll">
+				<template slot-scope="{ row, index }" slot="status">
+					<div style="color:#ff9900;" v-if="row.status==0">关锁</div>
+					<div style="color: #2db7f5;" v-if="row.status==1">开锁</div>
+					<div style="color: #19be6b;" v-if="row.status==2">解锁</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="is_available">
+					<div style="color:#ff9900;" v-if="row.is_available==0">否</div>
+					<div style="color: #19be6b;" v-if="row.is_available==1">是</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="is_online">
+					<div style="color:#ff9900;" v-if="row.is_online==0">否</div>
+					<div style="color: #19be6b;" v-if="row.is_online==1">是</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="car_type">
+					<div v-if="row.car_type==0">商城</div>
+					<div v-if="row.car_type==1">产家</div>
+					<div v-if="row.car_type==2">租车</div>
+					<div v-if="row.car_type==3">代理</div>
+					<div v-if="row.car_type==4">运营</div>
+					<div v-if="row.car_type==5">共享</div>
+					<div v-if="row.car_type==6">测试</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="action">
+					<a @click="edit(row)" v-auth="['admin-car-add']">编辑</a>
+					<Divider type="vertical" />
+					<a @click="detail(row)">详情</a>
+					<!-- <Divider type="vertical" />
+					<a @click="del(row.id)">删除</a> -->
+				</template>
+			</Table>
+		</Card>
+		<!-- 添加设备 -->
+		<Drawer :closable="false" width="700" v-model="modals" title="设备信息">
+			<addCartManage ref="addCartManage" v-if="modals" :cartData="cartData"></addCartManage>
+			<div class="demo-drawer-footer">
+				<Button style="margin-right: 8px" @click="modals = false">取消</Button>
+				<Button type="primary" @click="setCart">提交</Button>
+			</div>
+		</Drawer>
+		<!-- 设备详情 -->
+		<detailCart ref="detailCart"></detailCart>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from 'vuex';
+	import {
+		carList,
+		setCarDetail,
+		getCarDetail,
+		delCarDetail
+	} from '@/api/rent';
+	import addCartManage from './addCartManage.vue';
+	import detailCart from './detailCart.vue';
+	export default {
+		name: 'user_list',
+		components: {
+			addCartManage,
+			detailCart
+		},
+		data() {
+			return {
+				selectDataLabel: [],
+				// 是否显示新增编辑
+				modals: false,
+				// 保存选中编辑的用户
+				cartData: {},
+				grid: {
+					xl: 8,
+					lg: 8,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				loading: false,
+				total: 0,
+				cartFrom: {
+					nickname: '',
+					page: 1,
+					limit: 15,
+					field_key: '',
+					car_type: '',
+					is_online: '',
+					is_available: '',
+					status: '',
+				},
+				field_key: '',
+				columns: [{
+						type: 'selection',
+						width: 60,
+						align: 'center',
+					},
+					{
+						title: 'ID',
+						key: 'id',
+						width: 80,
+					},
+					{
+						title: '设备名称',
+						key: 'machine_name',
+						minWidth: 150,
+					},
+					{
+						title: '设备编号',
+						key: 'machine_no',
+						minWidth: 150,
+					},
+					
+					{
+						title: '车牌号',
+						key: 'plate_number',
+						minWidth: 150,
+					},
+					{
+						title: '车架号',
+						key: 'frame_no',
+						minWidth: 150,
+					},
+					
+					{
+						title: '状态',
+						key: 'status',
+						slot: 'status',
+						minWidth: 50,
+					},
+					{
+						title: '类型',
+						slot: 'car_type',
+						minWidth: 50,
+					},
+					{
+						title: '可用',
+						key: 'is_available',
+						slot: 'is_available',
+						minWidth: 50,
+					},
+					{
+						title: '在线',
+						key: 'is_online',
+						slot: 'is_online',
+						minWidth: 50,
+					},
+					{
+						title: '电量',
+						key: 'residue',
+						minWidth: 50,
+					},
+					{
+						title: '操作',
+						slot: 'action',
+						fixed: 'right',
+						minWidth: 120,
+					},
+				],
+				userLists: [],
+				selectionList: [],
+				selectedIds: new Set(), //选中合并项的id
+				ids: [],
+			};
+		},
+		computed: {
+			...mapState('media', ['isMobile']),
+			labelWidth() {
+				return this.isMobile ? undefined : 100;
+			},
+			labelPosition() {
+				return this.isMobile ? 'top' : 'right';
+			},
+		},
+		created() {
+			this.getList();
+		},
+		methods: {
+			// 删除
+			// del(id) {
+			// 	delCarDetail({
+			// 			id
+			// 		})
+			// 		.then((res) => {
+			// 			this.$Message.success(res.msg);
+			// 			this.getList();
+			// 		})
+			// 		.catch((err) => {
+			// 			this.$Message.error(err.msg);
+			// 		});
+			// },
+			// 查看详情
+			detail(id) {
+				this.$refs.detailCart.modals = true;
+				this.$refs.detailCart.getDetails(id);
+			},
+			// 保存设备信息
+			setCart() {
+				let data = this.$refs.addCartManage.formItem;
+				if (!/^[0-9]*$/.test(data.machine_no)) {
+					this.$Message.error('设备编号只可填入数字和,号');
+					return
+				}
+				setCarDetail(data)
+					.then((res) => {
+						this.modals = false;
+						this.$Message.success(res.msg);
+						this.getList();
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			// 添加新车辆库存
+			add() {
+				this.cartData = {}
+				this.modals = true;
+			},
+			// 获取编辑表单数据
+			getCartFrom(row) {
+				this.cartData = row;
+				this.modals = true;
+				// getCarDetail({id:row.id})
+				//   .then(async (res) => {
+				//     this.cartData = res.data;
+				//     this.modals = true;
+				//   })
+				//   .catch((res) => {
+				//     this.$Message.error(res.msg);
+				//   });
+			},
+			// 车辆库存列表
+			getList() {
+				// if (this.selectDataLabel.length) {
+				// 	let activeIds = [];
+				// 	this.selectDataLabel.forEach((item) => {
+				// 		activeIds.push(item.id);
+				// 	});
+				// 	this.cartFrom.label_id = activeIds.join(',');
+				// }
+				this.cartFrom.field_key = this.field_key === 'all' ? '' : this.field_key;
+				this.loading = true;
+				console.log(this.cartFrom);
+				carList(this.cartFrom)
+					.then(async (res) => {
+						let data = res.data;
+						this.userLists = data.list;
+						this.total = data.count;
+						this.loading = false;
+						this.$nextTick(() => {
+							this.setChecked();
+						});
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			pageChange(index) {
+				this.selectionList = [];
+				this.cartFrom.page = index;
+				this.getList();
+			},
+			// 搜索
+			searchs() {
+				this.cartFrom.page = 1;
+				this.getList();
+			},
+			// 重置
+			reset() {
+				this.cartFrom = {
+					nickname: '',
+					page: 1,
+					limit: 15,
+					field_key: '',
+					car_type: '',
+					is_online: '',
+					is_available: '',
+					status: '',
+				};
+				this.field_key = '';
+				this.selectDataLabel = [];
+				this.selectedIds = new Set();
+				this.getList();
+			},
+			// 编辑
+			edit(row) {
+				this.getCartFrom(row);
+			},
+			//全选和取消全选时触发
+			handleSelectAll(selection) {
+				if (selection.length === 0) {
+					//获取table的数据;
+					let data = this.$refs.table.data;
+					data.forEach((item) => {
+						if (this.selectedIds.has(item.id)) {
+							this.selectedIds.delete(item.id);
+						}
+					});
+				} else {
+					selection.forEach((item) => {
+						this.selectedIds.add(item.id);
+					});
+				}
+				this.$nextTick(() => {
+					//确保dom加载完毕
+					this.setChecked();
+				});
+			},
+			//  选中某一行
+			handleSelectRow(selection, row) {
+				this.selectedIds.add(row.id);
+				this.$nextTick(() => {
+					//确保dom加载完毕
+					this.setChecked();
+				});
+			},
+			//  取消某一行
+			handleCancelRow(selection, row) {
+				this.selectedIds.delete(row.id);
+				this.$nextTick(() => {
+					//确保dom加载完毕
+					this.setChecked();
+				});
+			},
+			setChecked() {
+				//将new Set()转化为数组
+				this.ids = [...this.selectedIds];
+				// 找到绑定的table的ref对应的dom,找到table的objData对象,objData保存的是当前页的数据
+				let objData = this.$refs.table.objData;
+				for (let index in objData) {
+					if (this.selectedIds.has(objData[index].id)) {
+						objData[index]._isChecked = true;
+					}
+				}
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.userFrom {
+		>>>.ivu-form-item-content {
+			margin-left: 0px !important;
+		}
+	}
+
+	.userAlert {
+		margin-top: 20px;
+	}
+
+	.userI {
+		color: #1890FF;
+		font-style: normal;
+	}
+
+	img {
+		height: 36px;
+		display: block;
+	}
+
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+	.demo-drawer-footer {
+		position: absolute;
+		bottom: 0;
+		right: 0;
+		width: 100%;
+		border-top: 1px solid #e8e8e8;
+		padding: 10px 16px;
+		text-align: right;
+		background: #fff;
+	}
+</style>

+ 388 - 0
src/pages/rent/cart/detailCart.vue

@@ -0,0 +1,388 @@
+<template>
+  <div style="width: 100%">
+    <Drawer title="用户详情" :closable="false" width="900" scrollable v-model="modals">
+      <Spin size="large" fix v-if="spinShow"></Spin>
+      <div class="acea-row">
+        <div class="avatar mr15"><img :src="psInfo.avatar" /></div>
+        <div class="dashboard-workplace-header-tip">
+          <p class="dashboard-workplace-header-tip-title" v-text="psInfo.nickname || '-'"></p>
+          <div class="dashboard-workplace-header-tip-desc">
+            <span class="dashboard-workplace-header-tip-desc-sp" v-for="(item, index) in detailsData" :key="index">{{
+              item.title + ':' + item.value
+            }}</span>
+          </div>
+        </div>
+      </div>
+
+      <Row type="flex" justify="space-between" class="mt25">
+        <!-- <Col span="4" class="user_menu">
+          <Menu :theme="theme2" :active-name="activeName" @on-select="changeType">
+            <MenuItem :name="item.val" v-for="(item, index) in list" :key="index">
+              
+            </MenuItem>
+          </Menu>
+        </Col> -->
+        <Col span="24">
+          <Tabs class="mb20" :value="activeName" @on-click="changeType">
+            <TabPane :name="item.val" v-for="(item, index) in list" :key="index" :label="item.label"></TabPane>
+          </Tabs>
+        </Col>
+
+        <Col span="24">
+          <Table
+            :columns="columns"
+            :data="userLists"
+            max-height="400"
+            ref="table"
+            :loading="loading"
+            no-userFrom-text="暂无数据"
+            no-filtered-userFrom-text="暂无筛选结果"
+          >
+            <template slot-scope="{ row }" slot="number">
+              <div :class="row.pm ? 'plusColor' : 'reduceColor'">
+                {{ row.pm ? '+' + row.number : '-' + row.number }}
+              </div>
+            </template>
+          </Table>
+          <div class="acea-row row-right page">
+            <Page
+              :total="total"
+              :current="userFrom.page"
+              show-elevator
+              show-total
+              @on-change="pageChange"
+              :page-size="userFrom.limit"
+            />
+          </div>
+        </Col>
+      </Row>
+    </Drawer>
+  </div>
+</template>
+
+<script>
+import { getCarDetail, infoApi } from '@/api/rent';
+
+export default {
+  name: 'CarDetail',
+  data() {
+    return {
+      theme2: 'light',
+      list: [
+        { val: 'order', label: '消费记录' },
+        { val: 'integral', label: '积分明细' },
+        { val: 'sign', label: '签到记录' },
+        { val: 'coupon', label: '持有优惠券' },
+        { val: 'balance_change', label: '余额变动' },
+        { val: 'spread', label: '好友关系' },
+      ],
+      modals: false,
+      spinShow: false,
+      detailsData: [],
+      userId: 0,
+      loading: false,
+      userFrom: {
+        type: 'order',
+        page: 1, // 当前页
+        limit: 20, // 每页显示条数
+      },
+      total: 0,
+      columns: [],
+      userLists: [],
+      psInfo: {},
+      activeName: 'order',
+    };
+  },
+  created() {},
+  methods: {
+    // 获取详情
+    getDetails(id) {
+      this.activeName = 'order';
+      this.userId = id;
+      this.spinShow = true;
+      getCarDetail(id)
+        .then(async (res) => {
+          if (res.status === 200) {
+            let data = res.data;
+            this.detailsData = data.headerList;
+            this.psInfo = data.ps_info;
+            // this.changeType('order');
+            this.spinShow = false;
+          } else {
+            this.spinShow = false;
+            this.$Message.error(res.msg);
+          }
+        })
+        .catch((res) => {
+          this.spinShow = false;
+          this.$Message.error(res.msg);
+        });
+    },
+    pageChange(index) {
+      this.userFrom.page = index;
+      this.changeType(this.userFrom.type);
+    },
+    // tab选项
+    // changeType(name) {
+    //   this.loading = true;
+    //   this.userFrom.type = name;
+    //   this.activeName = name;
+    //   if (this.userFrom.type === '') {
+    //     this.userFrom.type = 'order';
+    //   }
+    //   let data = {
+    //     id: this.userId,
+    //     datas: this.userFrom,
+    //   };
+    //   infoApi(data)
+    //     .then(async (res) => {
+    //       if (res.status === 200) {
+    //         let data = res.data;
+    //         this.userLists = data.list;
+    //         this.total = data.count;
+    //         switch (this.userFrom.type) {
+    //           case 'order':
+    //             this.columns = [
+    //               {
+    //                 title: '订单ID',
+    //                 key: 'order_id',
+    //                 minWidth: 160,
+    //               },
+    //               {
+    //                 title: '收货人',
+    //                 key: 'real_name',
+    //                 minWidth: 100,
+    //               },
+    //               {
+    //                 title: '商品数量',
+    //                 key: 'total_num',
+    //                 minWidth: 90,
+    //               },
+    //               {
+    //                 title: '实付金额',
+    //                 key: 'pay_price',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '交易完成时间',
+    //                 key: 'pay_time',
+    //                 minWidth: 120,
+    //               },
+    //             ];
+    //             break;
+    //           case 'integral':
+    //             this.columns = [
+    //               {
+    //                 title: '来源/用途',
+    //                 key: 'title',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '积分变化',
+    //                 key: 'number',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '变化前积分',
+    //                 key: 'balance',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '日期',
+    //                 key: 'add_time',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '备注',
+    //                 key: 'mark',
+    //                 minWidth: 120,
+    //               },
+    //             ];
+    //             break;
+    //           case 'sign':
+    //             this.columns = [
+    //               {
+    //                 title: '动作',
+    //                 key: 'title',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '获得积分',
+    //                 key: 'number',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '签到时间',
+    //                 key: 'add_time',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '备注',
+    //                 key: 'mark',
+    //                 minWidth: 120,
+    //               },
+    //             ];
+    //             break;
+    //           case 'coupon':
+    //             this.columns = [
+    //               {
+    //                 title: '优惠券名称',
+    //                 key: 'coupon_title',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '面值',
+    //                 key: 'coupon_price',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '有效期(天)',
+    //                 key: 'coupon_time',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '兑换时间',
+    //                 key: '_add_time',
+    //                 minWidth: 120,
+    //               },
+    //             ];
+    //             break;
+    //           case 'balance_change':
+    //             this.columns = [
+    //               {
+    //                 title: '动作',
+    //                 key: 'title',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '余额变动',
+    //                 slot: 'number',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '当前余额',
+    //                 key: 'balance',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '创建时间',
+    //                 key: 'add_time',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '备注',
+    //                 key: 'mark',
+    //                 minWidth: 120,
+    //               },
+    //             ];
+    //             break;
+    //           default:
+    //             this.columns = [
+    //               {
+    //                 title: 'ID',
+    //                 key: 'uid',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '昵称',
+    //                 key: 'nickname',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '等级',
+    //                 key: 'type',
+    //                 minWidth: 120,
+    //               },
+    //               {
+    //                 title: '加入时间',
+    //                 key: 'add_time',
+    //                 minWidth: 120,
+    //               },
+    //             ];
+    //         }
+    //         this.loading = false;
+    //       } else {
+    //         this.loading = false;
+    //         this.$Message.error(res.msg);
+    //       }
+    //     })
+    //     .catch((res) => {
+    //       this.loading = false;
+    //       this.$Message.error(res.msg);
+    //     });
+    // },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.avatar {
+  width: 60px;
+  height: 60px;
+  border-radius: 50%;
+  overflow: hidden;
+  img {
+    width: 100%;
+    height: 100%;
+  }
+}
+.dashboard-workplace {
+  &-header {
+    &-avatar {
+      width: 64px;
+      height: 64px;
+      border-radius: 50%;
+      margin-right: 16px;
+      font-weight: 600;
+    }
+
+    &-tip {
+      width: 82%;
+      display: inline-block;
+      vertical-align: middle;
+
+      &-title {
+        font-size: 13px;
+        color: #000000;
+        margin-bottom: 12px;
+      }
+
+      &-desc {
+        &-sp {
+          width: 33.33%;
+          color: #17233d;
+          font-size: 13px;
+          display: inline-block;
+        }
+      }
+    }
+
+    &-extra {
+      .ivu-col {
+        p {
+          text-align: right;
+        }
+
+        p:first-child {
+          span:first-child {
+            margin-right: 4px;
+          }
+
+          span:last-child {
+            color: #808695;
+          }
+        }
+
+        p:last-child {
+          font-size: 22px;
+        }
+      }
+    }
+  }
+}
+</style>
+<style scoped lang="stylus">
+.user_menu >>> .ivu-menu {
+  width: 100% !important;
+}
+</style>

+ 29 - 104
src/pages/rent/cart/index.vue

@@ -5,10 +5,10 @@
 				@submit.native.prevent>
 				<Row type="flex" :gutter="24">
 					<Col v-bind="grid">
-					<FormItem label="秒杀状态:">
-						<Select placeholder="请选择" clearable v-model="tableFrom.status" @on-change="userSearchs">
-							<Option value="1">开启</Option>
-							<Option value="0">关闭</Option>
+					<FormItem label="以租代购:">
+						<Select placeholder="请选择" clearable v-model="tableFrom.car_lease" @on-change="userSearchs">
+							<Option value="1"></Option>
+							<Option value="0"></Option>
 						</Select>
 					</FormItem>
 					</Col>
@@ -23,8 +23,6 @@
 					<Col v-bind="grid">
 					<Button v-auth="['admin-marketing-rent-add']" type="primary" icon="md-add" @click="add"
 						class="mr10">添加租车商品</Button>
-					<Button v-auth="['export-storeSeckill']" class="export" icon="ios-share-outline"
-						@click="exports">导出</Button>
 					</Col>
 				</Row>
 			</Form>
@@ -35,24 +33,21 @@
 						<img v-lazy="row.image" />
 					</div>
 				</template>
-				<template slot-scope="{ row, index }" slot="stop_time">
-					<span> {{ row.stop_time | formatDate }}</span>
+				<template slot-scope="{ row, index }" slot="add_time">
+					<span> {{ row.add_time }}</span>
 				</template>
-				<template slot-scope="{ row, index }" slot="status">
-					<i-switch v-model="row.status" :value="row.status" :true-value="1" :false-value="0"
-						@on-change="onchangeIsShow(row)" size="large">
-						<span slot="open">开启</span>
-						<span slot="close">关闭</span>
-					</i-switch>
+				<template slot-scope="{ row, index }" slot="several_months">
+					<span v-if="row.car_lease==1"> {{ row.several_months }}</span>
+					<span v-else>循环</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="car_lease">
+					<span v-if="row.car_lease==0">否</span>
+					<span v-if="row.car_lease==1">是</span>
 				</template>
 				<template slot-scope="{ row, index }" slot="action">
-					<a v-if="row.stop_status === 0" @click="edit(row)">编辑</a>
-					<Divider v-if="row.stop_status === 0" type="vertical" />
-					<a @click="copy(row)">复制</a>
-					<Divider type="vertical" />
-					<a @click="del(row, '删除秒杀商品', index)">删除</a>
+					<a @click="edit(row)">编辑</a>
 					<Divider type="vertical" />
-					<a @click="viewInfo(row)">统计</a>
+					<a @click="del(row, '删除商品', index)">删除</a>
 				</template>
 			</Table>
 			<div class="acea-row row-right page">
@@ -69,28 +64,13 @@
 	} from 'vuex';
 	import {
 		seckillStatusApi,
-		storeSeckillApi
 	} from '@/api/marketing';
 	import {
-		rentList
+		rentList,
+		
 	} from '@/api/rent';
-	import {
-		formatDate
-	} from '@/utils/validate';
-	import {
-		exportSeckillList
-	} from '@/api/export.js';
-
 	export default {
 		name: 'storeSeckill',
-		filters: {
-			formatDate(time) {
-				if (time !== 0) {
-					let date = new Date(time * 1000);
-					return formatDate(date, 'yyyy-MM-dd');
-				}
-			},
-		},
 		data() {
 			return {
 				loading: false,
@@ -105,50 +85,36 @@
 						minWidth: 90,
 					},
 					{
-						title: '活动标题',
+						title: '标题',
 						key: 'title',
 						minWidth: 130,
 					},
 					{
-						title: '活动简介',
+						title: '简介',
 						key: 'info',
 						minWidth: 100,
 					},
 					{
-						title: '原价',
-						key: 'ot_price',
-						minWidth: 100,
-					},
-					{
-						title: '秒杀价',
+						title: '租车价',
 						key: 'price',
 						minWidth: 100,
 					},
 					{
-						title: '限量',
-						key: 'quota_show',
+						title: '以租代购',
+						slot: 'car_lease',
 						minWidth: 130,
 					},
 					{
-						title: '限量剩余',
-						key: 'quota',
+						title: '租赁月份',
+						slot: 'several_months',
 						minWidth: 130,
 					},
 					{
-						title: '秒杀状态',
-						key: 'start_name',
-						minWidth: 100,
-					},
-					{
-						title: '结束时间',
-						slot: 'stop_time',
-						minWidth: 100,
-					},
-					{
-						title: '状态',
-						slot: 'status',
-						minWidth: 100,
+						title: '添加时间',
+						slot: 'add_time',
+						minWidth: 130,
 					},
+					
 					{
 						title: '操作',
 						slot: 'action',
@@ -183,11 +149,9 @@
 			},
 		},
 		activated() {
-			console.log("getList")
 			this.getList();
 		},
 		created() {
-			console.log("createdList")
 			this.getList();
 		},
 		methods: {
@@ -197,40 +161,6 @@
 					path: '/admin/rent/cart/add'
 				});
 			},
-			// 导出
-			async exports() {
-				let [th, filekey, data, fileName] = [
-					[],
-					[],
-					[], ''
-				];
-				let excelData = JSON.parse(JSON.stringify(this.tableFrom));
-				excelData.page = 1;
-				excelData.limit = 200;
-				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 {
-						this.$exportExcel(th, filekey, fileName, data);
-						return;
-					}
-				}
-			},
-			getExcelData(excelData) {
-				return new Promise((resolve, reject) => {
-					exportSeckillList(excelData).then((res) => {
-						resolve(res.data);
-					});
-				});
-			},
-
 			// 编辑
 			edit(row) {
 				this.$router.push({
@@ -248,7 +178,7 @@
 				let delfromData = {
 					title: tit,
 					num: num,
-					url: `marketing/seckill/${row.id}`,
+					url: `rent/rent/${row.id}`,
 					method: 'DELETE',
 					ids: '',
 				};
@@ -261,11 +191,6 @@
 						this.$Message.error(res.msg);
 					});
 			},
-			viewInfo(row) {
-				this.$router.push({
-					path: '/admin/marketing/store_seckill/statistics/' + row.id,
-				});
-			},
 			// 列表
 			getList() {
 				this.loading = true;

+ 34 - 236
src/pages/rent/user/index.vue

@@ -11,7 +11,7 @@
 						<Input v-model="userFrom.nickname" placeholder="请输入用户" element-id="nickname" clearable>
 						<Select v-model="field_key" slot="prepend" style="width: 80px">
 							<Option value="all">全部</Option>
-							<Option value="uid">UID</Option>
+							<Option value="uid">ID</Option>
 							<Option value="phone">手机号</Option>
 							<Option value="nickname">用户昵称</Option>
 						</Select>
@@ -37,41 +37,29 @@
 				</Col>
 			</Row>
 			<Table :columns="columns" :data="userLists" class="mt25" ref="table" highlight-row :loading="loading"
-				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果" @on-sort-change="sortChanged"
+				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果"
 				@on-select="handleSelectRow" @on-select-cancel="handleCancelRow" @on-select-all="handleSelectAll"
 				@on-select-all-cancel="handleSelectAll">
 				<template slot-scope="{ row, index }" slot="avatars">
 					<div class="tabBox_img" v-viewer>
-						<img v-lazy="row.avatar" />
+						<img v-lazy="row.user.avatar" />
 					</div>
 				</template>
+				<template slot-scope="{ row, index }" slot="spread_uid">
+					{{row.spread_uid?`昵称:${row.spread.nickname} ID:${row.spread.uid}`:'无推荐人'}}
+				</template>
 				<template slot-scope="{ row, index }" slot="nickname">
 					<div class="acea-row">
-						<Icon type="md-male" v-show="row.sex === '男'" color="#2db7f5" size="15" class="mr5" />
-						<Icon type="md-female" v-show="row.sex === '女'" color="#ed4014" size="15" class="mr5" />
-						<div v-text="row.nickname"></div>
+						<div v-text="row.user.nickname"></div>
 					</div>
 					<div v-if="row.is_del == 1" style="color: red">用户已注销</div>
-					<!-- <div v-show="row.vip_name" class="vipName">{{row.vip_name}}</div> -->
-				</template>
-				<template slot-scope="{ row, index }" slot="isMember">
-					<div>{{ row.isMember ? '是' : '否' }}</div>
 				</template>
 				<template slot-scope="{ row, index }" slot="action">
-						<a @click="edit(row)">编辑</a>
-						<Divider type="vertical" />
-						<Dropdown @on-click="changeMenu(row, $event, index)" :transfer="true">
-							<a href="javascript:void(0)">
-								更多
-								<Icon type="ios-arrow-down"></Icon>
-							</a>
-							<DropdownMenu slot="list">
-								<DropdownItem name="1">账户详情</DropdownItem>
-								<DropdownItem name="2">积分余额</DropdownItem>
-							</DropdownMenu>
-						</Dropdown>
+					<a @click="edit(row)">详情</a>
 				</template>
 			</Table>
+		</Card>
+		<user-details ref="userDetails"></user-details>
 	</div>
 </template>
 
@@ -80,26 +68,20 @@
 		mapState
 	} from 'vuex';
 	import {
-		userList,
-		getUserSaveForm,
-		getUserInfo,
-		editUser,
-	} from '@/api/user';
-	import {
-		agentSpreadApi
-	} from '@/api/agent';
-	import {
-		exportUserList
-	} from '@/api/export';
+		sponsorList,
+	} from '@/api/rent';
+	import userDetails from './userDetails.vue';
 	export default {
 		name: 'user_list',
+		components: {
+		  userDetails,
+		},
 		data() {
 			return {
-				dataLabel: [],
 				selectDataLabel: [],
 				grid: {
-					xl: 8,
-					lg: 8,
+					xl: 10,
+					lg: 10,
 					md: 12,
 					sm: 24,
 					xs: 24,
@@ -108,30 +90,13 @@
 				total: 0,
 				userFrom: {
 					label_id: '',
-					user_type: '',
-					status: '',
-					sex: '',
-					is_promoter: '',
-					country: '',
-					isMember: '',
-					pay_count: '',
-					user_time_type: '',
-					user_time: '',
 					nickname: '',
-					province: '',
-					city: '',
 					page: 1,
 					limit: 15,
-					level: '',
-					group_id: '',
 					field_key: '',
 				},
 				field_key: '',
-				level: '',
-				group_id: '',
 				label_id: '',
-				user_time_type: '',
-				pay_count: '',
 				columns: [{
 						type: 'selection',
 						width: 60,
@@ -139,7 +104,7 @@
 					},
 					{
 						title: 'ID',
-						key: 'uid',
+						key: 'id',
 						width: 80,
 					},
 					{
@@ -153,34 +118,29 @@
 						minWidth: 150,
 					},
 					{
-						title: '付费会员',
-						slot: 'isMember',
-						minWidth: 90,
-					},
-					{
-						title: '用户等级',
-						key: 'level',
+						title: '总投资',
+						key: 'total_investment',
 						minWidth: 90,
 					},
 					{
-						title: '分组',
-						key: 'group_id',
+						title: '总收入',
+						key: 'total_revenue',
 						minWidth: 100,
 					},
 					{
-						title: '手机号',
-						key: 'phone',
+						title: '分红股',
+						key: 'bonus_share',
 						minWidth: 100,
 					},
 					{
-						title: '用户类型',
-						key: 'user_type',
+						title: '已收入',
+						key: 'received',
 						minWidth: 100,
 					},
 					{
-						title: '余额',
-						key: 'now_money',
-						sortable: 'custom',
+						title: '推介人',
+						key: 'spread_uid',
+						slot: 'spread_uid',
 						minWidth: 100,
 					},
 					{
@@ -191,7 +151,6 @@
 					},
 				],
 				userLists: [],
-				FromData: null,
 				selectionList: [],
 				selectedIds: new Set(), //选中合并项的id
 				ids: [],
@@ -210,58 +169,7 @@
 			this.getList();
 		},
 		methods: {
-			// 操作
-			changeMenu(row, name, index) {
-				let uid = [];
-				uid.push(row.uid);
-				let uids = {
-					uids: uid
-				};
-				switch (name) {
-					case '1':
-						break;
-					case '2':
-						this.getOtherFrom(row.uid);
-						break;
-					case '3':
-						break;
-					case '4':
-						this.del(row, '清除 【 ' + row.nickname + ' 】的会员等级', index, 'user');
-						break;
-					case '5':
-						break;
-					case '6':
-						break;
-					case '7':
-						this.editS(row);
-						break;
-					default:
-						this.del(row, '解除【 ' + row.nickname + ' 】的上级推广人', index, 'tuiguang');
-				}
-			},
-			// 删除
-			del(row, tit, num, name) {
-				let delfromData = {
-					title: tit,
-					num: num,
-					url: name === 'user' ? `user/del_level/${row.uid}` : `agent/stair/delete_spread/${row.uid}`,
-					method: name === 'user' ? 'DELETE' : 'PUT',
-					ids: '',
-				};
-				this.$modalSure(delfromData)
-					.then((res) => {
-						this.$Message.success(res.msg);
-						this.getList();
-					})
-					.catch((res) => {
-						this.$Message.error(res.msg);
-					});
-			},
-			// 清除会员删除成功
-			submitModel() {
-				this.getList();
-			},
-			// 会员列表
+			// 出资人列表
 			getList() {
 				if (this.selectDataLabel.length) {
 					let activeIds = [];
@@ -270,18 +178,9 @@
 					});
 					this.userFrom.label_id = activeIds.join(',');
 				}
-				this.userFrom.user_type = this.userFrom.user_type || '';
-				this.userFrom.status = this.userFrom.status || '';
-				this.userFrom.sex = this.userFrom.sex || '';
-				this.userFrom.is_promoter = this.userFrom.is_promoter || '';
-				this.userFrom.country = this.userFrom.country || '';
-				this.userFrom.pay_count = this.pay_count === 'all' ? '' : this.pay_count;
-				this.userFrom.user_time_type = this.user_time_type === 'all' ? '' : this.user_time_type;
 				this.userFrom.field_key = this.field_key === 'all' ? '' : this.field_key;
-				this.userFrom.level = this.level === 'all' ? '' : this.level;
-				this.userFrom.group_id = this.group_id === 'all' ? '' : this.group_id;
 				this.loading = true;
-				userList(this.userFrom)
+				sponsorList(this.userFrom)
 					.then(async (res) => {
 						let data = res.data;
 						this.userLists = data.list;
@@ -309,44 +208,21 @@
 			// 重置
 			reset(name) {
 				this.userFrom = {
-					user_type: this.userFrom.user_type,
-					status: '',
-					sex: '',
-					is_promoter: '',
-					country: '',
-					pay_count: '',
-					user_time_type: '',
-					user_time: '',
 					nickname: '',
 					field_key: '',
-					level: '',
-					group_id: '',
 					label_id: '',
 					page: 1, // 当前页
 					limit: 20, // 每页显示条数
 				};
 				this.field_key = '';
-				this.level = '';
-				this.group_id = '';
-				this.dataLabel = [];
 				this.selectDataLabel = [];
-				this.user_time_type = '';
-				this.pay_count = '';
 				this.selectedIds = new Set();
 				this.getList();
 			},
 			// 编辑
 			edit(row) {
-				this.getUserFrom(row.uid);
-			},
-			// 修改成功
-			submitFail() {
-				// this.getList();
-			},
-			// 排序
-			sortChanged(e) {
-				this.userFrom[e.key] = e.order;
-				this.getList();
+				this.$refs.userDetails.modals = true;
+				this.$refs.userDetails.getDetails(row.id);
 			},
 			//全选和取消全选时触发
 			handleSelectAll(selection) {
@@ -400,31 +276,6 @@
 </script>
 
 <style scoped lang="stylus">
-	.picBox {
-		display: inline-block;
-		cursor: pointer;
-
-		.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);
-		}
-
-		.pictrue {
-			width: 60px;
-			height: 60px;
-			border: 1px dotted rgba(0, 0, 0, 0.1);
-			margin-right: 10px;
-
-			img {
-				width: 100%;
-				height: 100%;
-			}
-		}
-	}
 
 	.userFrom {
 		>>>.ivu-form-item-content {
@@ -457,57 +308,4 @@
 			height: 100%;
 		}
 	}
-
-	.tabBox_tit {
-		width: 60%;
-		font-size: 12px !important;
-		margin: 0 2px 0 10px;
-		letter-spacing: 1px;
-		padding: 5px 0;
-		box-sizing: border-box;
-	}
-
-	.modelBox {
-		>>>.ivu-modal-body {
-			padding: 0 16px 16px 16px !important;
-		}
-	}
-
-	.vipName {
-		color: #dab176;
-	}
-
-	.listbox {
-		>>>.ivu-divider-horizontal {
-			margin: 0 !important;
-		}
-	}
-
-	.labelInput {
-		border: 1px solid #dcdee2;
-		padding: 0 6px;
-		border-radius: 5px;
-		min-height: 30px;
-		cursor: pointer;
-
-		.span {
-			color: #c5c8ce;
-		}
-
-		.ivu-icon-ios-arrow-down {
-			font-size: 14px;
-			color: #808695;
-		}
-	}
-
-	.demo-drawer-footer {
-		width: 100%;
-		position: absolute;
-		bottom: 0;
-		left: 0;
-		border-top: 1px solid #e8e8e8;
-		padding: 10px 16px;
-		text-align: right;
-		background: #fff;
-	}
 </style>

+ 387 - 0
src/pages/rent/user/userDetails.vue

@@ -0,0 +1,387 @@
+<template>
+  <div style="width: 100%">
+    <Drawer title="用户详情" :closable="false" width="900" scrollable v-model="modals">
+      <Spin size="large" fix v-if="spinShow"></Spin>
+      <div class="acea-row">
+        <div class="avatar mr15"><img :src="psInfo.avatar" /></div>
+        <div class="dashboard-workplace-header-tip">
+          <p class="dashboard-workplace-header-tip-title" v-text="(psInfo.real_name||psInfo.nickname || '-')+' '+psInfo.phone"></p>
+          <div class="dashboard-workplace-header-tip-desc">
+            <span class="dashboard-workplace-header-tip-desc-sp" v-for="(item, index) in detailsData" :key="index">{{
+              item.name + ':' + item.value+(item.unit?item.unit:'')
+            }}</span>
+          </div>
+        </div>
+      </div>
+
+      <Row type="flex" justify="space-between" class="mt25">
+        <!-- <Col span="4" class="user_menu">
+          <Menu :theme="theme2" :active-name="activeName" @on-select="changeType">
+            <MenuItem :name="item.val" v-for="(item, index) in list" :key="index">
+              
+            </MenuItem>
+          </Menu>
+        </Col> -->
+        <Col span="24">
+          <Tabs class="mb20" :value="activeName" @on-click="changeType">
+            <TabPane :name="item.val" v-for="(item, index) in list" :key="index" :label="item.label"></TabPane>
+          </Tabs>
+        </Col>
+
+        <Col span="24">
+          <Table
+            :columns="columns"
+            :data="userLists"
+            max-height="400"
+            ref="table"
+            :loading="loading"
+            no-userFrom-text="暂无数据"
+            no-filtered-userFrom-text="暂无筛选结果"
+          >
+            <template slot-scope="{ row }" slot="number">
+              <div :class="row.pm ? 'plusColor' : 'reduceColor'">
+                {{ row.pm ? '+' + row.number : '-' + row.number }}
+              </div>
+            </template>
+          </Table>
+          <div class="acea-row row-right page">
+            <Page
+              :total="total"
+              :current="userFrom.page"
+              show-elevator
+              show-total
+              @on-change="pageChange"
+              :page-size="userFrom.limit"
+            />
+          </div>
+        </Col>
+      </Row>
+    </Drawer>
+  </div>
+</template>
+
+<script>
+import { sponsorDetail } from '@/api/rent';
+export default {
+  name: 'userDetails',
+  data() {
+    return {
+      theme2: 'light',
+      list: [
+        { val: 'order', label: '车辆列表' },
+        { val: 'sign', label: '购车记录' },
+        { val: 'integral', label: '分红记录' },
+        { val: 'coupon', label: '股权记录' }
+      ],
+      modals: false,
+      spinShow: false,
+      detailsData: [],
+      userId: 0,
+      loading: false,
+      userFrom: {
+        type: 'order',
+        page: 1, // 当前页
+        limit: 20, // 每页显示条数
+      },
+      total: 0,
+      columns: [],
+      userLists: [],
+      psInfo: {},
+      activeName: 'order',
+    };
+  },
+  created() {},
+  methods: {
+    // 出资人详情
+    getDetails(id) {
+      this.activeName = 'order';
+      this.userId = id;
+      this.spinShow = true;
+	  console.log('jr');
+      sponsorDetail(id)
+        .then(async (res) => {
+          if (res.status === 200) {
+            let data = res.data;
+            this.detailsData = data.headerList;
+            this.psInfo = data.ps_info;
+            // this.changeType('order');
+            this.spinShow = false;
+          } else {
+            this.spinShow = false;
+            this.$Message.error(res.msg);
+          }
+        })
+        .catch((res) => {
+			console.log(err,'cuowu');
+          this.spinShow = false;
+          this.$Message.error(res.msg);
+        });
+    },
+    pageChange(index) {
+      this.userFrom.page = index;
+      this.changeType(this.userFrom.type);
+    },
+    // tab选项
+    changeType(name) {
+      this.loading = true;
+      this.userFrom.type = name;
+      this.activeName = name;
+      if (this.userFrom.type === '') {
+        this.userFrom.type = 'order';
+      }
+      let data = {
+        id: this.userId,
+        datas: this.userFrom,
+      };
+      infoApi(data)
+        .then(async (res) => {
+          if (res.status === 200) {
+            let data = res.data;
+            this.userLists = data.list;
+            this.total = data.count;
+            switch (this.userFrom.type) {
+              case 'order':
+                this.columns = [
+                  {
+                    title: '订单ID',
+                    key: 'order_id',
+                    minWidth: 160,
+                  },
+                  {
+                    title: '收货人',
+                    key: 'real_name',
+                    minWidth: 100,
+                  },
+                  {
+                    title: '商品数量',
+                    key: 'total_num',
+                    minWidth: 90,
+                  },
+                  {
+                    title: '实付金额',
+                    key: 'pay_price',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '交易完成时间',
+                    key: 'pay_time',
+                    minWidth: 120,
+                  },
+                ];
+                break;
+              case 'integral':
+                this.columns = [
+                  {
+                    title: '来源/用途',
+                    key: 'title',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '积分变化',
+                    key: 'number',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '变化前积分',
+                    key: 'balance',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '日期',
+                    key: 'add_time',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '备注',
+                    key: 'mark',
+                    minWidth: 120,
+                  },
+                ];
+                break;
+              case 'sign':
+                this.columns = [
+                  {
+                    title: '动作',
+                    key: 'title',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '获得积分',
+                    key: 'number',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '签到时间',
+                    key: 'add_time',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '备注',
+                    key: 'mark',
+                    minWidth: 120,
+                  },
+                ];
+                break;
+              case 'coupon':
+                this.columns = [
+                  {
+                    title: '优惠券名称',
+                    key: 'coupon_title',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '面值',
+                    key: 'coupon_price',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '有效期(天)',
+                    key: 'coupon_time',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '兑换时间',
+                    key: '_add_time',
+                    minWidth: 120,
+                  },
+                ];
+                break;
+              case 'balance_change':
+                this.columns = [
+                  {
+                    title: '动作',
+                    key: 'title',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '余额变动',
+                    slot: 'number',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '当前余额',
+                    key: 'balance',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '创建时间',
+                    key: 'add_time',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '备注',
+                    key: 'mark',
+                    minWidth: 120,
+                  },
+                ];
+                break;
+              default:
+                this.columns = [
+                  {
+                    title: 'ID',
+                    key: 'uid',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '昵称',
+                    key: 'nickname',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '等级',
+                    key: 'type',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '加入时间',
+                    key: 'add_time',
+                    minWidth: 120,
+                  },
+                ];
+            }
+            this.loading = false;
+          } else {
+            this.loading = false;
+            this.$Message.error(res.msg);
+          }
+        })
+        .catch((res) => {
+          this.loading = false;
+          this.$Message.error(res.msg);
+        });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.avatar {
+  width: 60px;
+  height: 60px;
+  border-radius: 50%;
+  overflow: hidden;
+  img {
+    width: 100%;
+    height: 100%;
+  }
+}
+.dashboard-workplace {
+  &-header {
+    &-avatar {
+      width: 64px;
+      height: 64px;
+      border-radius: 50%;
+      margin-right: 16px;
+      font-weight: 600;
+    }
+
+    &-tip {
+      width: 82%;
+      display: inline-block;
+      vertical-align: middle;
+
+      &-title {
+        font-size: 13px;
+        color: #000000;
+        margin-bottom: 12px;
+      }
+
+      &-desc {
+        &-sp {
+          width: 33.33%;
+          color: #17233d;
+          font-size: 13px;
+          display: inline-block;
+        }
+      }
+    }
+
+    &-extra {
+      .ivu-col {
+        p {
+          text-align: right;
+        }
+
+        p:first-child {
+          span:first-child {
+            margin-right: 4px;
+          }
+
+          span:last-child {
+            color: #808695;
+          }
+        }
+
+        p:last-child {
+          font-size: 22px;
+        }
+      }
+    }
+  }
+}
+</style>
+<style scoped lang="stylus">
+.user_menu >>> .ivu-menu {
+  width: 100% !important;
+}
+</style>

+ 0 - 4
src/pages/user/list/handle/userEdit.vue

@@ -139,10 +139,6 @@ export default {
   name: 'userEdit',
   components: { userLabel },
   props: {
-    // modals: {
-    //   default: false,
-    //   type: Boolean,
-    // },
     userData: {
       type: Object,
       default: () => {},

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

@@ -1343,9 +1343,6 @@ img {
 }
 .demo-drawer-footer{
         width: 100%;
-        position: absolute;
-        bottom: 0;
-        left: 0;
         border-top: 1px solid #e8e8e8;
         padding: 10px 16px;
         text-align: right;

+ 55 - 38
src/router/modules/rent.js

@@ -11,47 +11,64 @@
 import BasicLayout from '@/components/main';
 
 const meta = {
-  auth: true,
+	auth: true,
 };
 
 const pre = 'rent_';
 
 export default {
-  path: '/admin/rent',
-  name: 'rent',
-  header: 'rent',
-  redirect: {
-    name: `${pre}index`,
-  },
-  meta,
-  component: BasicLayout,
-  children: [
-	  {
-	    path: 'cart',
-	    name: `${pre}cart`,
-	    meta: {
-	      auth: ['admin-rent'],
-	      title: '租车管理',
-	    },
-	    component: () => import('@/pages/rent/cart/index'),
-	  },
-	  {
-	    path: 'cart/add',
-	    name: `${pre}cartadd`,
-	    meta: {
-	      auth: ['admin-marketing-rent-add'],
-	      title: '添加租车商品',
-	    },
-	    component: () => import('@/pages/rent/cart/add'),
-	  },
-	  {
-	    path: 'sponsor/user',
-	    name: `${pre}sponsoruser`,
-	    meta: {
-	      auth: ['admin-sponsor-user'],
-	      title: '账号管理',
-	    },
-	    component: () => import('@/pages/rent/user/index'),
-	  },
-  ],
+	path: '/admin/rent',
+	name: 'rent',
+	header: 'rent',
+	redirect: {
+		name: `${pre}index`,
+	},
+	meta,
+	component: BasicLayout,
+	children: [{
+			path: 'cart',
+			name: `${pre}cart`,
+			meta: {
+				auth: ['admin-rent-goods'],
+				title: '租车管理',
+			},
+			component: () => import('@/pages/rent/cart/index'),
+		},
+		{
+			path: 'cart/add/:id?/:copy?',
+			name: `${pre}cartadd`,
+			meta: {
+				auth: ['admin-rent-goods-add'],
+				title: '添加租车商品',
+			},
+			component: () => import('@/pages/rent/cart/add'),
+		},
+		{
+			path: 'sponsor/user',
+			name: `${pre}sponsoruser`,
+			meta: {
+				auth: ['admin-sponsor-user'],
+				title: '账号管理',
+			},
+			component: () => import('@/pages/rent/user/index'),
+		},
+		{
+			path: 'cart/stock',
+			name: `${pre}carstock`,
+			meta: {
+				auth: ['admin-car-stock'],
+				title: '租车库存',
+			},
+			component: () => import('@/pages/rent/cart/carstock'),
+		},
+		{
+			path: 'cart/manage',
+			name: `${pre}carmanage`,
+			meta: {
+				auth: ['admin-equipment-car'],
+				title: '车辆管理',
+			},
+			component: () => import('@/pages/rent/cart/cartManage'),
+		},
+	],
 };