cmy 1 سال پیش
والد
کامیت
f663a93da5
3فایلهای تغییر یافته به همراه140 افزوده شده و 283 حذف شده
  1. 20 258
      src/components/staffList/index.vue
  2. 78 15
      src/pages/order/serveList/index.vue
  3. 42 10
      src/pages/user/list/handle/userDetails.vue

+ 20 - 258
src/components/staffList/index.vue

@@ -1,18 +1,18 @@
 <template>
 	<div class="goodList">
+		<Form ref="pagination" :model="formValidate" @submit.native.prevent>
+			<FormItem label="员工姓名:" label-for="title">
+				<Input v-model="formValidate.name" placeholder="请输入员工姓名" class="input-add mr14" />
+				<Button type="primary" @click="userSearchs()">查询</Button>
+			</FormItem>
+		</Form>
 		<Table ref="table" no-data-text="暂无数据" @on-select-all="selectAll" @on-select-all-cancel="cancelAll"
 			@on-select="TableSelectRow" @on-select-cancel="TableSelectCancelRow" no-filtered-data-text="暂无筛选结果"
 			:columns="columns4" :data="tableList" :loading="loading" class="mr-20" height="500">
-			<!-- <template slot-scope="{ row }" slot="store_name">
-				<Tooltip max-width="200" placement="bottom">
-					<span class="line2">{{ row.store_name }}{{row.suk}}</span>
-					<p slot="content">{{ row.store_name }}{{row.suk}}</p>
-				</Tooltip>
-			</template> -->
 			<template slot-scope="{ row }" slot="avatar">
 				<viewer>
 					<div class="tabBox_img">
-						<img v-lazy="row.avatar" />
+						<img v-lazy="row.avatar||row.user.avatar" />
 					</div>
 				</viewer>
 			</template>
@@ -30,100 +30,27 @@
 	import {
 		mapState
 	} from "vuex";
-	import {
-		cascaderListApi,
-		changeListApi,
-		allLabelApi
-	} from "@/api/product";
 	import {
 		getYgList
 	} from '@/api/store'
-	import {
-		liveGoods
-	} from "@/api/live";
 	export default {
 		name: "index",
-		props: {
-			serviceProject: {
-				type: Number,
-				default: 0,
-			},
-			serviceCard: {
-				type: Number,
-				default: 0,
-			},
-			goodsType: {
-				type: Number,
-				default: 0,
-			},
-			storeType: {
-				type: Number,
-				default: 0,
-			},
-			is_new: {
-				type: String,
-				default: "",
-			},
-			diy: {
-				type: Boolean,
-				default: false,
-			},
-			isdiy: {
-				type: Boolean,
-				default: false,
-			},
-			ischeckbox: {
-				type: Boolean,
-				default: false,
-			},
-			liveStatus: {
-				type: Boolean,
-				default: false,
-			},
-			isLive: {
-				type: Boolean,
-				default: false,
-			},
-			datas: {
-				type: Object,
-				default: function() {
-					return {};
-				},
-			},
-		},
 		data() {
 			return {
 				//选中商品集合
 				selectEquips: [],
 				// 选中的id集合
 				selectEquipsIds: [],
-				labelSelect: [],
 				cateIds: [],
 				modal_loading: false,
-				treeSelect: [],
 				formValidate: {
-					service_project: this.serviceProject,
-					service_card: this.serviceCard,
 					page: 1,
 					limit: 10,
-					cate_id: "",
-					store_name: "",
-					is_new: this.is_new,
-					store_label_id: ""
+					is_reservation:1
 				},
 				total: 0,
-				modals: false,
 				loading: false,
-				grid: {
-					xl: 10,
-					lg: 10,
-					md: 12,
-					sm: 24,
-					xs: 24,
-				},
 				tableList: [],
-				currentid: 0,
-				productRow: {},
 				columns4: [{
 						type: 'selection',
 						width: 60,
@@ -141,111 +68,31 @@
 					{
 						title: "员工姓名",
 						key: "name",
-						minWidth: 200,
+						minWidth: 80,
 					},
 					{
-						title: "创建时间",
-						key: "create_time",
-						minWidth: 100,
-					},
-				],
-				columns5: [{
-						title: "商品ID",
-						key: "id",
+						title: "别称",
+						key: "alias",
+						minWidth: 80,
 					},
 					{
-						title: "图片",
-						slot: "image",
+						title: "手机号",
+						key: "mobile",
+						width: 130,
 					},
 					{
-						title: "商品名称",
-						key: "name",
-						minWidth: 250,
+						title: "创建时间",
+						key: "create_time",
+						minWidth: 100,
 					},
 				],
 				images: [],
-				many: "",
 			};
 		},
-		computed: {
-			...mapState("admin/layout", ["isMobile"]),
-			labelWidth() {
-				return this.isMobile ? undefined : 120;
-			},
-			labelPosition() {
-				return this.isMobile ? "top" : "right";
-			},
-		},
 		created() {
-			// let radio = {
-			// 	title: "选择",
-			// 	width: 70,
-			// 	align: "center",
-			// 	render: (h, params) => {
-			// 		let id = params.row.id;
-			// 		let flag = false;
-			// 		if (this.currentid === id) {
-			// 			flag = true;
-			// 		} else {
-			// 			flag = false;
-			// 		}
-			// 		let self = this;
-			// 		return h("div", [
-			// 			h("Radio", {
-			// 				props: {
-			// 					value: flag,
-			// 				},
-			// 				on: {
-			// 					"on-change": () => {
-			// 						self.currentid = id;
-			// 						this.productRow = params.row;
-			// 						console.log('zhe+++')
-			// 						this.$emit("getProductId", this.productRow);
-			// 						if (this.productRow.id) {
-			// 							if (this.$route.query.fodder === "image") {
-			// 								/* eslint-disable */
-			// 								let imageObject = {
-			// 									image: this.productRow.image,
-			// 									product_id: this.productRow.id,
-			// 									name: this.productRow.name,
-			// 								};
-			// 								form_create_helper.set("image", imageObject);
-			// 								form_create_helper.close("image");
-			// 							}
-			// 						} else {
-			// 							this.$Message.warning("请先选择商品");
-			// 						}
-			// 					},
-			// 				},
-			// 			}),
-			// 		]);
-			// 	},
-			// };
-
-			// let checkbox = {
-			// 	type: "selection",
-			// 	width: 60,
-			// 	align: "center",
-			// };
-			// let many = "";
-			// if (this.ischeckbox) {
-			// 	many = "many";
-			// } else {
-			// 	many = this.$route.query.type;
-			// }
-			// this.many = many;
-			// if (many === "many") {
-			// 	this.columns4.unshift(checkbox);
-			// 	this.columns5.unshift(checkbox);
-			// } else {
-			// 	this.columns4.unshift(radio);
-			// 	this.columns5.unshift(radio);
-			// }
 		},
 		mounted() {
-			this.goodsCategory();
 			this.getList();
-			this.getAllLabelApi();
 		},
 		methods: {
 			// 判断是否选中
@@ -283,26 +130,6 @@
 					this.TableSelectCancelRow(null, this.tableList[i]);
 				}
 			},
-			getAllLabelApi() {
-				allLabelApi().then(res => {
-					this.labelSelect = res.data
-				}).catch(err => {
-					this.$Message.error(err.msg);
-				})
-			},
-			handleSelectAll() {
-				this.$refs.table.selectAll(false);
-			},
-			// 商品分类;
-			goodsCategory() {
-				cascaderListApi(1)
-					.then((res) => {
-						this.treeSelect = res.data;
-					})
-					.catch((res) => {
-						this.$Message.error(res.msg);
-					});
-			},
 			pageChange(index) {
 				this.formValidate.page = index;
 				this.getList();
@@ -310,19 +137,6 @@
 			// 列表
 			getList() {
 				this.loading = true;
-				if (!this.liveStatus) {
-					if (this.isLive) {
-						this.formValidate.is_live = 1;
-					}
-					if (this.goodsType) {
-						this.formValidate.is_presale_product = 0;
-						this.formValidate.is_vip_product = 0;
-					}
-					if (this.storeType) {
-						this.formValidate.is_supplier = 0;
-					}
-
-					this.formValidate.cate_id = this.cateIds[this.cateIds.length - 1]
 					getYgList(this.formValidate)
 						.then(async (res) => {
 							let data = res.data;
@@ -335,30 +149,6 @@
 							this.loading = false;
 							this.$Message.error(res.msg);
 						});
-				} else {
-					liveGoods({
-							is_show: "1",
-							status: "1",
-							live_id: this.datas.id,
-							kerword: this.formValidate.store_name,
-							page: this.formValidate.page,
-							limit: this.formValidate.limit,
-						})
-						.then(async (res) => {
-							let data = res.data;
-							data.list.forEach((el) => {
-								el.image = el.cover_img;
-							});
-							this.tableList = data.list;
-							this.total = res.data.count;
-							this.sortData();
-							this.loading = false;
-						})
-						.catch((res) => {
-							this.loading = false;
-							this.$Message.error(res.msg);
-						});
-				}
 			},
 			changeCheckbox(selection) {
 				let images = [];
@@ -375,36 +165,9 @@
 				this.$emit("getProductDiy", selection);
 			},
 			ok() {
-				// console.log('selectEquips',this.selectEquips)
 				this.$emit("getProductId", this.selectEquips);
-				// let images = [];
-				// this.selectEquips.forEach(function(item) {
-				// 	let imageObject = {
-				// 		image: item.image,
-				// 		product_id: item.id,
-				// 		store_name: item.store_name,
-				// 		temp_id: item.temp_id
-				// 	};
-				// 	images.push(imageObject);
-				// });
-				// if (images.length > 0) {
-				// 	if (this.$route.query.fodder === "image") {
-				// 		let imageValue = form_create_helper.get("image");
-				// 		form_create_helper.set("image", imageValue.concat(images));
-				// 		form_create_helper.close("image");
-				// 	} else {
-				// 		if (this.isdiy) {
-				// 			this.$emit("getProductId", this.selectEquips);
-				// 		} else {
-				// 			this.$emit("getProductId", images);
-				// 		}
-				// 	}
-				// } else {
-				// 	this.$Message.warning("请先选择商品");
-				// }
 			},
 			treeSearchs(value) {
-				this.cateIds = value;
 				this.formValidate.page = 1;
 				this.getList();
 			},
@@ -414,8 +177,6 @@
 				this.getList();
 			},
 			clear() {
-				this.productRow.id = "";
-				this.currentid = "";
 			},
 		},
 	};
@@ -437,7 +198,8 @@
 	.tabBox_img {
 		width: 36px;
 		height: 36px;
-		border-radius: 4px;
+		border-radius: 100px;
+		overflow: hidden;
 		cursor: pointer;
 
 		img {

+ 78 - 15
src/pages/order/serveList/index.vue

@@ -12,6 +12,18 @@
 							</Option>
 						</Select>
 					</FormItem>
+					<FormItem label="用户ID:" label-for="title">
+						<div class='flex-search'>
+							<Input v-model="pagination.uid" icon="ios-search" @on-click='openuid' placeholder="请输入用户ID"
+								class="input-add mr14" />
+						</div>
+					</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="订单搜索:" label-for="title">
 						<Input v-model="pagination.order_id" placeholder="请输入订单号" class="input-add mr14" />
 						<Button type="primary" @click="orderSearch()">查询</Button>
@@ -119,6 +131,18 @@
 				<Button @click="cancal">取消</Button>
 			</div>
 		</Modal>
+		<Modal v-model="userListShow" width='80' mask title="用户选择">
+			<userlist @imageObject='checkUser'></userlist>
+			<template #footer>
+				<Button @click="userListShow=false">取消</Button>
+			</template>
+		</Modal>
+		<Modal v-model="memberListShow" width='80' mask title="员工选择">
+			<staffList @getProductId='checkmember'></staffList>
+			<template #footer>
+				<Button @click="memberListShow=false">取消</Button>
+			</template>
+		</Modal>
 	</div>
 </template>
 
@@ -152,15 +176,24 @@
 	import orderRemark from "../orderList/handle/orderRemark";
 	import orderRecord from "../orderList/handle/orderRecord";
 	import timeOptions from "@/utils/timeOptions";
+	import userlist from "@/components/customerInfo/index";
+	import staffList from "@/components/staffList/index";
+
+
 	export default {
 		components: {
 			editFrom,
 			detailsFrom,
 			orderRemark,
-			orderRecord
+			orderRecord,
+			userlist,
+			staffList
 		},
 		data() {
 			return {
+				memberListShow: false,
+				// 显示用户列表
+				userListShow: false,
 				modals: false,
 				order_id: '',
 				ygList: [],
@@ -170,22 +203,22 @@
 						title: "订单号",
 						align: "center",
 						slot: "order_id",
-						minWidth: 150,
+						minWidth: 160,
 					},
 					{
 						title: "用户信息",
 						slot: "nickname",
-						minWidth: 130,
+						minWidth: 140,
 					},
 					{
 						title: "预约员工",
 						slot: "kf",
-						minWidth: 130,
+						minWidth: 80,
 					},
 					{
 						title: "商品信息",
 						slot: "info",
-						minWidth: 300,
+						minWidth: 250,
 					},
 					{
 						title: "实际支付",
@@ -195,17 +228,17 @@
 					{
 						title: "预约时间",
 						slot: "reservation_time",
-						minWidth: 110,
+						minWidth: 130,
 					},
 					{
 						title: "订单状态",
 						slot: "status",
-						minWidth: 110,
+						minWidth: 80,
 					},
 					{
 						title: "退款状态",
 						slot: "refund_status",
-						minWidth: 110,
+						minWidth: 80,
 					},
 					{
 						title: "预约门店",
@@ -215,7 +248,7 @@
 					{
 						title: "下单时间",
 						slot: "add_time",
-						minWidth: 110,
+						minWidth: 130,
 					},
 					{
 						title: "操作",
@@ -249,7 +282,9 @@
 					limit: 15,
 					order_id: "",
 					time: "",
-					status: 0
+					status: 0,
+					uid: '',
+					work_member_id: ''
 				},
 				options: timeOptions,
 				timeVal: [],
@@ -276,12 +311,32 @@
 			this.getOrderList();
 		},
 		methods: {
-			showName( id) {
+			// 打开弹窗
+			openmid(e) {
+				this.memberListShow = true;
+			},
+			// 选中员工
+			checkmember(res) {
+				let data = res[0];
+				console.log(res,'res')
+				this.memberListShow = false;
+				this.pagination.work_member_id = data.id;
+			},
+			// 选中用户
+			checkUser(res) {
+				this.userListShow = false;
+				this.pagination.uid = res.uid;
+			},
+			// 打开弹窗
+			openuid(e) {
+				this.userListShow = true;
+			},
+			showName(id) {
 				let yg = this.ygList.find(item => {
 					return item.id == id
 				})
-				console.log(yg,'ygygygyg')
-				return yg? yg.name: ''
+				// console.log(yg,'ygygygyg')
+				return yg ? yg.name : ''
 			},
 			getYgList() {
 				getYgList({
@@ -539,9 +594,14 @@
 		display: flex;
 		align-items: center;
 
+		.tabBox_pice {
+			flex-shrink: 0;
+		}
+
 		.tabBox_img {
 			width: 30px;
 			height: 30px;
+			flex-shrink: 0;
 
 			img {
 				width: 100%;
@@ -550,9 +610,8 @@
 		}
 
 		.tabBox_tit {
-			width: 245px;
+			flex-grow: 1;
 			height: 30px;
-			line-height: 30px;
 			font-size: 12px !important;
 			margin: 0 2px 0 10px;
 			letter-spacing: 1px;
@@ -573,4 +632,8 @@
 		width: 25px;
 		height: 25px;
 	}
+
+	.flex-search {
+		display: flex;
+	}
 </style>

+ 42 - 10
src/pages/user/list/handle/userDetails.vue

@@ -58,6 +58,19 @@
 								<div class="title">{{ row.store_name }}</div>
 							</div>
 						</template>
+						<template slot-scope="{ row }" slot="card_name">
+							<div>
+								<div class="title">{{ row.card_name }}</div>
+								<div class="title">价格:{{ row.order.pay_price }}</div>
+							</div>
+						</template>
+						<template slot-scope="{ row }" slot="add_time">
+							<div>
+								<div class="title" v-if="row.order">
+									{{row.add_time}}</div>
+								<div class="title" v-else>已失效</div>
+							</div>
+						</template>
 						<template slot-scope="{ row }" slot="item">
 							<div class="product" v-for="item in row.card">
 								<div class="image" v-viewer>
@@ -96,6 +109,9 @@
 	} from '@/api/user';
 	import userForm from './userForm';
 	import userInfo from './userInfo';
+	import {
+		formatDate
+	} from '@/utils/validate';
 
 	export default {
 		name: 'userDetails',
@@ -192,6 +208,7 @@
 		},
 		created() {},
 		methods: {
+			formatDate,
 			changeMenu(value) {
 				if (value === '99') {
 					this.getDetails(this.userId);
@@ -375,7 +392,17 @@
 				infoApi(data).then(async res => {
 					if (res.status === 200) {
 						let data = res.data
-						this.userLists = data.list;
+						if (this.userFrom.type == 'service_card') {
+							this.userLists = data.list.map((res) => {
+								if (res.order) {
+									const date = new Date(res.order.add_time * 1000);
+									res.add_time = this.formatDate(date ,'yyyy-MM-dd hh:mm:ss');
+								}
+								return res
+							});
+						} else {
+							this.userLists = data.list;
+						}
 						this.total = data.count;
 						switch (this.userFrom.type) {
 							case 'order':
@@ -471,25 +498,30 @@
 									//     minWidth: 120
 									// },
 									{
-										title: '服务卡名称',
-										key: 'card_name',
+										title: '服务卡',
+										slot: 'card_name',
 										minWidth: 120
 									},
-									// {
-									// 	title: '购买时间',
-									// 	key: 'add_time',
-									// 	minWidth: 120
-									// },
 									{
 										title: '绑定项目',
 										slot: 'item',
-										minWidth: 240
+										minWidth: 200
+									},
+									{
+										title: '购买时间',
+										slot: 'add_time',
+										minWidth: 120
 									},
 									{
 										title: '最近使用',
 										key: 'update_time',
 										minWidth: 120
-									}
+									},
+									// {
+									// 	title: '操作',
+									// 	slot: 'pos',
+									// 	minWidth: 50
+									// }
 								]
 								break;
 							case 'coupon':