Browse Source

2024-3-13

cmy 1 năm trước cách đây
mục cha
commit
da4dddca46

+ 58 - 27
src/pages/check/components/addStaff.vue

@@ -29,25 +29,36 @@
 							</Col>
 							</Col>
 							<Col span="24">
 							<Col span="24">
 							<FormItem label="手机号:" prop="mobile" label-for="mobile">
 							<FormItem label="手机号:" prop="mobile" label-for="mobile">
-								<Input v-model="formItem.mobile" placeholder="请输入手机号" :disabled="formItem.id"/>
+								<Input v-model="formItem.mobile" placeholder="请输入手机号" :disabled="formItem.id" />
 							</FormItem>
 							</FormItem>
 							</Col>
 							</Col>
+							<FormItem label="推荐员工:" label-for="spread_id" prop="spread_id">
+								<Select v-model="formItem.spread_id" style="width: 250px">
+									<Option value="">无</Option>
+									<Option v-for="item in ygList" :key="item.id" :value="item.id">
+										{{ item.name }}
+									</Option>
+								</Select>
+								<Button type="primary" class="ml10 search" @click="userSearchs">搜索</Button>
+							</FormItem>
 							<Col span="24">
 							<Col span="24">
-							<FormItem label="销售比例:" label-for="sale_ratio" prop="sale_ratio"  >
+							<FormItem label="销售比例:" label-for="sale_ratio" prop="sale_ratio">
 								<Input v-model="formItem.sale_ratio" placeholder="请输入销售比例" />
 								<Input v-model="formItem.sale_ratio" placeholder="请输入销售比例" />
 							</FormItem>
 							</FormItem>
 							</Col>
 							</Col>
 							<Col span="24">
 							<Col span="24">
-							<FormItem label="手工比例:" label-for="craft_ratio " prop="craft_ratio" >
+							<FormItem label="手工比例:" label-for="craft_ratio " prop="craft_ratio">
 								<Input v-model="formItem.craft_ratio" placeholder="请输入手工比例" />
 								<Input v-model="formItem.craft_ratio" placeholder="请输入手工比例" />
 							</FormItem>
 							</FormItem>
 							</Col>
 							</Col>
 							<Col span="24">
 							<Col span="24">
 							<FormItem label="绑定用户:" label-for="mobile" prop="mobile">
 							<FormItem label="绑定用户:" label-for="mobile" prop="mobile">
-								<Button v-if="checkUser.nickname || checkUser.phone" style="margin-right: 20rpx;">昵称:{{checkUser.nickname || '暂无'}} 手机号:{{checkUser.phone || '暂无'}}</Button>
-								<Button type="primary" @click="chooseUser" >选择用户</Button>
+								<Button v-if="checkUser.nickname || checkUser.phone"
+									style="margin-right: 20rpx;">昵称:{{checkUser.nickname || '暂无'}}
+									手机号:{{checkUser.phone || '暂无'}}</Button>
+								<Button type="primary" @click="chooseUser">选择用户</Button>
 							</FormItem>
 							</FormItem>
-							
+
 							</Col>
 							</Col>
 							<Col span="24" class="mt20">
 							<Col span="24" class="mt20">
 							<FormItem label="性别:">
 							<FormItem label="性别:">
@@ -145,6 +156,9 @@
 	import {
 	import {
 		mapState
 		mapState
 	} from 'vuex';
 	} from 'vuex';
+	import {
+		getYgList
+	} from "@/api/check";
 	export default {
 	export default {
 		name: 'systemSt',
 		name: 'systemSt',
 		components: {
 		components: {
@@ -192,7 +206,8 @@
 					direct_leader: 'ChenBin',
 					direct_leader: 'ChenBin',
 					position: '',
 					position: '',
 					sale_ratio: '',
 					sale_ratio: '',
-					craft_ratio: ''
+					craft_ratio: '',
+					spread_id:'',
 				},
 				},
 				spinShow: false,
 				spinShow: false,
 				addresData: [],
 				addresData: [],
@@ -249,7 +264,8 @@
 			}
 			}
 		},
 		},
 		created() {
 		created() {
-			this.getDepartmentList()
+			this.getDepartmentList();
+			this.getygList();
 			let data = {
 			let data = {
 				pid: 0
 				pid: 0
 			}
 			}
@@ -266,14 +282,15 @@
 					direct_leader: 'ChenBin',
 					direct_leader: 'ChenBin',
 					position: '',
 					position: '',
 					sale_ratio: '',
 					sale_ratio: '',
-					craft_ratio: ''
+					craft_ratio: '',
+					ygList:[],
+					spread_id:'',
 				}
 				}
 			}
 			}
 			// console.log(this.info,'infoinfoinfoinfo')
 			// console.log(this.info,'infoinfoinfoinfo')
-			
 		},
 		},
 		computed: {
 		computed: {
-			...mapState('store/user',['info']),
+			...mapState('store/user', ['info']),
 			labelWidth() {
 			labelWidth() {
 				return this.isMobile ? undefined : 120;
 				return this.isMobile ? undefined : 120;
 			},
 			},
@@ -281,8 +298,20 @@
 				return this.isMobile ? 'top' : 'right';
 				return this.isMobile ? 'top' : 'right';
 			}
 			}
 		},
 		},
-		mounted: function() {},
+		mounted: function() {
+			
+		},
 		methods: {
 		methods: {
+			// 获取员工列表
+			getygList() {
+				getYgList({
+					page: 1,
+					limit: 1000
+				}).then(res => {
+					console.log(res)
+					this.ygList = res.data.list
+				})
+			},
 			//获取用户id
 			//获取用户id
 			getUserId(row) {
 			getUserId(row) {
 				this.modals = false
 				this.modals = false
@@ -317,7 +346,8 @@
 					direct_leader: 'ChenBin',
 					direct_leader: 'ChenBin',
 					sale_ratio: 0,
 					sale_ratio: 0,
 					is_reservation: 0,
 					is_reservation: 0,
-					craft_ratio: 0
+					craft_ratio: 0,
+					spread_id:''
 				}
 				}
 				this.add = 0;
 				this.add = 0;
 				this.isApi = 0;
 				this.isApi = 0;
@@ -341,21 +371,21 @@
 				console.log(this.formItem)
 				console.log(this.formItem)
 				this.$refs[name].validate((valid) => {
 				this.$refs[name].validate((valid) => {
 					if (valid) {
 					if (valid) {
-						if(!this.formItem.sale_ratio) {
-							return this.$Message.error('请输入销售比例');
-						}
-						if(!this.formItem.craft_ratio) {
+						// if(!this.formItem.sale_ratio) {
+						// 	return this.$Message.error('请输入销售比例');
+						// }
+						if (!this.formItem.craft_ratio) {
 							return this.$Message.error('请输入手工比例');
 							return this.$Message.error('请输入手工比例');
 						}
 						}
-						if(this.formItem.id) {
+						if (this.formItem.id) {
 							editYg({
 							editYg({
 								id: this.formItem.id,
 								id: this.formItem.id,
-								name:  this.formItem.name,
-								avatar:  this.formItem.avatar,
-								mobile:  this.formItem.mobile,
-								alias:  this.formItem.alias,
-								address:  this.formItem.address,
-								main_department:  this.formItem.main_department,
+								name: this.formItem.name,
+								avatar: this.formItem.avatar,
+								mobile: this.formItem.mobile,
+								alias: this.formItem.alias,
+								address: this.formItem.address,
+								main_department: this.formItem.main_department,
 								department: this.formItem.department || [this.formItem.main_department],
 								department: this.formItem.department || [this.formItem.main_department],
 								uid: this.formItem.uid,
 								uid: this.formItem.uid,
 								userid: this.formItem.userid,
 								userid: this.formItem.userid,
@@ -365,7 +395,8 @@
 								craft_ratio: this.formItem.craft_ratio,
 								craft_ratio: this.formItem.craft_ratio,
 								is_reservation: this.formItem.is_reservation,
 								is_reservation: this.formItem.is_reservation,
 								enable: this.formItem.enable,
 								enable: this.formItem.enable,
-								
+								spread_id:this.formItem.spread_id
+
 							}).then(async res => {
 							}).then(async res => {
 								this.$Message.success(res.msg);
 								this.$Message.success(res.msg);
 								this.isTemplate = false;
 								this.isTemplate = false;
@@ -374,7 +405,7 @@
 							}).catch(res => {
 							}).catch(res => {
 								this.$Message.error(res.msg);
 								this.$Message.error(res.msg);
 							})
 							})
-						}else {
+						} else {
 							addYg(this.formItem).then(async res => {
 							addYg(this.formItem).then(async res => {
 								this.$Message.success(res.msg);
 								this.$Message.success(res.msg);
 								this.isTemplate = false;
 								this.isTemplate = false;
@@ -384,7 +415,7 @@
 								this.$Message.error(res.msg);
 								this.$Message.error(res.msg);
 							})
 							})
 						}
 						}
-						
+
 					} else {
 					} else {
 						return false;
 						return false;
 					}
 					}

+ 71 - 2
src/pages/user/components/userDetails2.vue

@@ -108,6 +108,28 @@
 .discount }}%</div>
 .discount }}%</div>
 				</div>
 				</div>
 			</template>
 			</template>
+			<template slot-scope="{ row }" slot="serviceCard">
+				<div class="product">
+					<div class="image" v-viewer>
+						<img v-lazy="row.serviceCard.image">
+					</div>
+					<div class="title">
+						<div>
+							{{ row.serviceCard.card_name }}
+						</div>
+						<div>
+							服务卡ID:{{row.serviceCard.id}}
+						</div>
+					</div>
+				</div>
+			</template>
+			<template slot-scope="{ row }" slot="number">
+				<div>
+					<span v-if="row.pm==1">+</span>
+					<span v-else>-</span>
+					<span>{{row.number}}</span>
+				</div>
+			</template>
 			<template slot-scope="{ row }" slot="add_time">
 			<template slot-scope="{ row }" slot="add_time">
 				<div>
 				<div>
 					<div class="title" v-if="row.order">
 					<div class="title" v-if="row.order">
@@ -178,6 +200,10 @@ export default {
 			val: 'service_card',
 			val: 'service_card',
 			label: '服务卡'
 			label: '服务卡'
 		},
 		},
+		{
+			val: 'service_card_record',
+			label: '服务卡变动'
+		},
         { val: 'balance_change', label: '余额变动' },
         { val: 'balance_change', label: '余额变动' },
         { val: 'spread', label: '好友关系' },
         { val: 'spread', label: '好友关系' },
         { val: 'visit', label: '浏览足迹' },
         { val: 'visit', label: '浏览足迹' },
@@ -302,7 +328,7 @@ export default {
       infoApi(data)
       infoApi(data)
         .then(async (res) => {
         .then(async (res) => {
           if (res.status === 200) {
           if (res.status === 200) {
-            let data = res.data
+            let data = res.data;
             this.total = data.count
             this.total = data.count
 			if (this.userFrom.type == 'service_card') {
 			if (this.userFrom.type == 'service_card') {
 				this.userLists = data.list.map((res) => {
 				this.userLists = data.list.map((res) => {
@@ -312,7 +338,15 @@ export default {
 					}
 					}
 					return res
 					return res
 				});
 				});
-			} else {
+			}else if (this.userFrom.type == 'service_card_record') {
+							console.log(data,'data');
+							this.userLists = data.list.map((res) => {
+								const date = new Date(res.add_time * 1000);
+								res.add_time = this.formatDate(date, 'yyyy-MM-dd hh:mm:ss');
+								return res
+							});
+							console.log(this.userLists, 'this.userLists ')
+						} else {
 				this.userLists = data.list;
 				this.userLists = data.list;
 			}
 			}
             switch (this.userFrom.type) {
             switch (this.userFrom.type) {
@@ -437,6 +471,41 @@ export default {
 									// }
 									// }
 								]
 								]
 				break;
 				break;
+				case 'service_card_record':
+					this.columns = [
+						{
+							title: '服务订单号',
+							key: 'link_id',
+							minWidth: 200
+						},
+						{
+							title: '服务卡',
+							slot: 'serviceCard',
+							minWidth: 250
+						},
+						{
+							title: '变化数量',
+							slot: 'number',
+							minWidth: 80
+						},
+						{
+							title: '变化后数量',
+							key: 'banlance',
+							minWidth: 80
+						},
+				
+						{
+							title: '说明',
+							key: 'mark',
+							minWidth: 100
+						},
+						{
+							title: '变动时间',
+							key: 'add_time',
+							minWidth: 120
+						},
+					]
+					break;
               case 'coupon':
               case 'coupon':
                 this.columns = [
                 this.columns = [
                   {
                   {