lhl 2 years ago
parent
commit
09a1775546

+ 8 - 0
src/api/marketing.js

@@ -1381,4 +1381,12 @@ export function serveProductDeleteApi(id) {
 	    url: `/service/productDelete/${id}`,
 	    url: `/service/productDelete/${id}`,
 	    method: 'DELETE'
 	    method: 'DELETE'
 	});
 	});
+}
+
+//服务项目列表
+export function ServeItemListApi(data) {
+	return request({
+	    url: `/productLst/lst`,
+	    method: 'get'
+	});
 }
 }

+ 70 - 0
src/api/store.js

@@ -634,4 +634,74 @@ export function cascaderList (type) {
     });
     });
 }
 }
 
 
+//获取部门列表
+export function getDepartmentList () {
+    return request({
+        url: `work/department`,
+        method: 'get'
+    });
+}
+
+//编辑部门
+export function editDepartment(data) {
+	return request({
+	    url: `work/editDepartment`,
+	    method: 'post',
+		data
+	});
+}
+
+//添加部门
+export function addDepartment(data) {
+	return request({
+	    url: `work/addDepartment`,
+	    method: 'post',
+		data
+	});
+}
+
+//删除部门
+export function delDepartment(data) {
+	return request({
+	    url: `work/deleteDepartment`,
+	    method: 'post',
+		data
+	});
+}
+
+//考勤组列表
+export function checkGroupList(data) {
+	return request({
+	    url: `work/checkGroup`,
+	    method: 'post',
+		data
+	});
+}
+
+//员工列表
+export function getYgList(data) {
+	return request({
+	    url: `work/member`,
+	    method: 'get',
+		data
+	})
+}
+
+//添加员工
+export function addYg(data) {
+	return request({
+	    url: `work/add`,
+	    method: 'post',
+		data
+	})
+}
+
+//删除员工
+export function delYg(data) {
+	return request({
+	    url: `work/delete`,
+	    method: 'post',
+		data
+	})
+}
 
 

+ 13 - 0
src/components/goodsList/index.vue

@@ -71,6 +71,8 @@
 	  	<span v-if="row.product_type==1">卡密商品</span>
 	  	<span v-if="row.product_type==1">卡密商品</span>
 	  	<span v-if="row.product_type==3">虚拟商品</span>
 	  	<span v-if="row.product_type==3">虚拟商品</span>
       <span v-if="row.product_type==4">次卡商品</span>
       <span v-if="row.product_type==4">次卡商品</span>
+	  <span v-if="row.product_type == 5">服务卡</span>
+	  <span v-if="row.product_type == 6">服务项目</span>
 	  </template>
 	  </template>
     </Table>
     </Table>
     <div class="acea-row row-right page">
     <div class="acea-row row-right page">
@@ -102,6 +104,14 @@ import { liveGoods } from "@/api/live";
 export default {
 export default {
   name: "index",
   name: "index",
   props: {
   props: {
+	serviceProject: {
+		type: Number,
+		default: 0,
+	},
+	serviceCard: {
+		type: Number,
+		default: 0,
+	},
 	goodsType: {
 	goodsType: {
 	  type: Number,
 	  type: Number,
 	  default: 0,
 	  default: 0,
@@ -152,6 +162,8 @@ export default {
       modal_loading: false,
       modal_loading: false,
       treeSelect: [],
       treeSelect: [],
       formValidate: {
       formValidate: {
+		  service_project: this.serviceProject,
+		service_card: this.serviceCard,
         page: 1,
         page: 1,
         limit: 10,
         limit: 10,
         cate_id: "",
         cate_id: "",
@@ -370,6 +382,7 @@ export default {
     if(this.storeType){
     if(this.storeType){
       this.formValidate.is_supplier = 0;
       this.formValidate.is_supplier = 0;
     }
     }
+	
 		this.formValidate.cate_id = this.cateIds[this.cateIds.length-1]
 		this.formValidate.cate_id = this.cateIds[this.cateIds.length-1]
         changeListApi(this.formValidate)
         changeListApi(this.formValidate)
           .then(async (res) => {
           .then(async (res) => {

+ 11 - 7
src/pages/marketing/serve/bind.vue

@@ -17,12 +17,16 @@
 			<div v-for="(item,index) in formData" class="product-item">
 			<div v-for="(item,index) in formData" class="product-item">
 				<Button type="primary" class="submission" @click="delNewProject(index,item)" >删除</Button>
 				<Button type="primary" class="submission" @click="delNewProject(index,item)" >删除</Button>
 				<Form   :model="item" :label-width="150" >
 				<Form   :model="item" :label-width="150" >
-					<FormItem label="选择商品:" prop="product_id" required>
+					<FormItem label="选择服务项目:" prop="product_id" required>
 					    <div class="picBox" @click="changeGoods(item)">
 					    <div class="picBox" @click="changeGoods(item)">
-							<Button type="primary" v-if="!item.product_id">选择商品</Button>
-					        <div class="" v-else>
-								{{item.store_name}}
-					        </div>
+							<Button type="primary" v-if="!item.product_id">选择服务项目</Button>
+							<template v-else>
+								<div class="">
+									{{item.store_name}}
+								</div>
+								<Button type="primary" >切换服务项目</Button>
+							</template>
+					       
 					    </div>
 					    </div>
 					</FormItem>
 					</FormItem>
 					<FormItem label="业绩值" required>
 					<FormItem label="业绩值" required>
@@ -34,7 +38,7 @@
 					<FormItem label="销售提成" required>
 					<FormItem label="销售提成" required>
 						<Input  v-model="item.sales_commissions" v-width="320"></Input>
 						<Input  v-model="item.sales_commissions" v-width="320"></Input>
 					</FormItem>
 					</FormItem>
-					<FormItem label="库存量" required>
+					<FormItem label="次数" required>
 						<InputNumber  v-model="item.repertory" v-width="320"></InputNumber>
 						<InputNumber  v-model="item.repertory" v-width="320"></InputNumber>
 					</FormItem>
 					</FormItem>
 				</Form>
 				</Form>
@@ -44,7 +48,7 @@
 		<!-- 选择商品-->
 		<!-- 选择商品-->
 		<Modal v-model="modals" title="商品列表" footerHide class="paymentFooter" scrollable width="900"
 		<Modal v-model="modals" title="商品列表" footerHide class="paymentFooter" scrollable width="900"
 		    @on-cancel="cancel">
 		    @on-cancel="cancel">
-		    <goods-list ref="goodslist" :goodsType="1" v-if="modals" @getProductId="getProductId"></goods-list>
+		    <goods-list ref="goodslist" :goodsType="1" v-if="modals" @getProductId="getProductId" :serviceProject="1"></goods-list>
 		</Modal>
 		</Modal>
 		<div style="width: 500px; display: flex;justify-content: center;">
 		<div style="width: 500px; display: flex;justify-content: center;">
 			<Button  type="primary bom" class="submission" @click="addNewProject" >添加新项目</Button>
 			<Button  type="primary bom" class="submission" @click="addNewProject" >添加新项目</Button>

+ 18 - 23
src/pages/marketing/serve/create.vue

@@ -15,27 +15,27 @@
 		</div>
 		</div>
 		<Card :bordered="false" dis-hover class="ivu-mt">
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<Form :model="formData" :label-width="150">
 			<Form :model="formData" :label-width="150">
-				<FormItem label="选择商品:" required>
+				<FormItem label="选择对应服务卡:" required>
 				    <div class="picBox" @click="changeGoods()">
 				    <div class="picBox" @click="changeGoods()">
-						<Button type="primary" v-if="!formData.product_id">选择商品</Button>
-				        <div class="" v-if="formData.product_id && !formData.id">
-							{{formData.product_name}}
+						<Button type="primary" v-if="!formData.card_name">选择商品</Button>
+				        <div class="" v-if="formData.card_name">
+							{{formData.card_name}}
 				        </div>
 				        </div>
-						<Button type="primary" v-if="formData.product_id && formData.id">
+						<Button type="primary" v-if="formData.card_name">
 							切换商品
 							切换商品
 						</Button>
 						</Button>
 				    </div>
 				    </div>
 				</FormItem>
 				</FormItem>
-				<FormItem label="服务卡名称" required>
+				<!-- <FormItem label="服务卡名称" required>
 					<Input v-model="formData.card_name" v-width="320" placeholder="请输入服务卡名称"></Input>
 					<Input v-model="formData.card_name" v-width="320" placeholder="请输入服务卡名称"></Input>
-				</FormItem>
-				<FormItem label="售价" required>
+				</FormItem> -->
+				<!-- <FormItem label="售价" required>
 					<InputNumber :min="1" :max="100000000" v-model="formData.card_price" v-width="320"></InputNumber>
 					<InputNumber :min="1" :max="100000000" v-model="formData.card_price" v-width="320"></InputNumber>
 				</FormItem>
 				</FormItem>
 				<FormItem label="库存" required>
 				<FormItem label="库存" required>
 					<InputNumber :min="1" :max="100000000" v-model="formData.repertory" v-width="320"></InputNumber>
 					<InputNumber :min="1" :max="100000000" v-model="formData.repertory" v-width="320"></InputNumber>
 					</InputNumber>
 					</InputNumber>
-				</FormItem>
+				</FormItem> -->
 				<!-- explain -->
 				<!-- explain -->
 				<FormItem label="备注">
 				<FormItem label="备注">
 					<Input v-model="formData.explain" v-width="320" placeholder=""></Input>
 					<Input v-model="formData.explain" v-width="320" placeholder=""></Input>
@@ -49,7 +49,7 @@
 		<!-- 选择商品-->
 		<!-- 选择商品-->
 		<Modal v-model="modals" title="商品列表" footerHide class="paymentFooter" scrollable width="900"
 		<Modal v-model="modals" title="商品列表" footerHide class="paymentFooter" scrollable width="900"
 		    @on-cancel="cancel">
 		    @on-cancel="cancel">
-		    <goods-list ref="goodslist" :goodsType="1" v-if="modals" @getProductId="getProductId"></goods-list>
+		    <goods-list ref="goodslist" :goodsType="1" v-if="modals" @getProductId="getProductId" :serviceCard="1"></goods-list>
 		</Modal>
 		</Modal>
 	</div>
 	</div>
 </template>
 </template>
@@ -124,19 +124,14 @@
 			    this.modals = false;
 			    this.modals = false;
 			    setTimeout(() => {
 			    setTimeout(() => {
 					this.formData.product_id = row.id
 					this.formData.product_id = row.id
-					this.formData.product_name = row.store_name
-					this.formData.card_price = row.price
-					this.formData = {
-						product_name: row.store_name,
-						product_id: row.id,
-						card_name: row.store_name,
-						card_price: row.price,
-						explain: '',
-						unit_name: row.unit_name,
-						image: row.image,
-						images: row.slider_image,
-						is_show: 1
-					}
+						this.formData.card_name = row.store_name
+						this.formData.product_id = row.id
+						this.formData.card_price = row.price
+						this.formData.unit_name = row.unit_name
+						this.formData.image = row.image
+						this.formData.images = row.slider_image
+						this.formData.is_show = 1
+						this.formData.repertory = row.stock
 					// this.formData.image = row.image
 					// this.formData.image = row.image
 			    }, 500);
 			    }, 500);
 			},
 			},

+ 516 - 0
src/pages/marketing/serveItem/bind.vue

@@ -0,0 +1,516 @@
+<template>
+	<div class="form-submit">
+		<div class="i-layout-page-header">
+			<PageHeader class="product_tabs" hidden-breadcrumb>
+				<div slot="title">
+					<router-link :to="{ path: `${roterPre}/marketing/serve/index` }">
+						<div class="font-sm after-line">
+							<span class="iconfont iconfanhui"></span>
+							<span class="pl10">返回</span>
+						</div>
+					</router-link>
+					<span v-text="$route.params.id ? '编辑服务卡' : '添加服务卡'" class="mr20 ml16"></span>
+				</div>
+			</PageHeader>
+		</div>
+		<Card :bordered="false" dis-hover class="ivu-mt"  >
+			<div v-for="(item,index) in formData" class="product-item">
+				<Button type="primary" class="submission" @click="delNewProject(index,item)" >删除</Button>
+				<Form   :model="item" :label-width="150" >
+					<FormItem label="选择服务项目:" prop="product_id" required>
+					    <div class="picBox" @click="changeGoods(item)">
+							<Button type="primary" v-if="!item.product_id">选择服务项目</Button>
+							<template v-else>
+								<div class="">
+									{{item.store_name}}
+								</div>
+								<Button type="primary" >切换服务项目</Button>
+							</template>
+					       
+					    </div>
+					</FormItem>
+					<FormItem label="业绩值" required>
+						<Input  v-model="item.performance_value" v-width="320"></Input>
+					</FormItem>
+					<FormItem label="手工费" required>
+						<Input  v-model="item.craft_price" v-width="320"></Input>
+					</FormItem>
+					<FormItem label="销售提成" required>
+						<Input  v-model="item.sales_commissions" v-width="320"></Input>
+					</FormItem>
+					<FormItem label="次数" required>
+						<InputNumber  v-model="item.repertory" v-width="320"></InputNumber>
+					</FormItem>
+				</Form>
+			</div>
+			
+		</Card>
+		<!-- 选择商品-->
+		<Modal v-model="modals" title="商品列表" footerHide class="paymentFooter" scrollable width="900"
+		    @on-cancel="cancel">
+		    <goods-list ref="goodslist" :goodsType="1" v-if="modals" @getProductId="getProductId" :serviceProject="1"></goods-list>
+		</Modal>
+		<div style="width: 500px; display: flex;justify-content: center;">
+			<Button  type="primary bom" class="submission" @click="addNewProject" >添加新项目</Button>
+			<Button  type="primary" class="submission" @click="save" :disabled="disabled">保存</Button>
+		</div>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from "vuex";
+	import storeList from "@/components/storeList";
+	import goodsList from "@/components/goodsList/index";
+	import {
+		couponCategoryApi,
+		couponSaveApi,
+		couponDetailApi,
+		VipEditApi,
+		serveAddApi,
+		bindServe,
+		addServiceProject,
+		serveReadApi,
+		serveProductDeleteApi
+	} from "@/api/marketing";
+	import {
+		brandList
+	} from "@/api/product";
+	// import { formatDate } from '@/utils/validate';
+	import Setting from "@/setting";
+	export default {
+		name: "storeCouponCreate",
+		components: {
+			goodsList,
+			storeList
+		},
+		data() {
+			return {
+				baseForm: {
+					product_name: '',
+					product_id: 0,
+					performance_value: 0,
+					craft_price: 0,
+					sales_commissions: 0,
+					repertory: 0
+				},//基础数据
+				modal_loading: false,
+				 modals: false,
+				id: '',
+				roterPre: Setting.roterPre,
+				disabled: false,
+				storesList: [],
+				formData: [{
+					id: 0,
+					service_card_id: 0,
+					product_id: 0,
+					store_name: '',
+					slider_image: '',
+					performance_value: '',
+					craft_price: '',
+					sales_commissions: '',
+					repertory: 0,
+				}],
+				isMinPrice: 0,
+				isCouponTime: 1,
+				isReceiveTime: 0,
+				modals: false,
+				datetime1: [],
+				datetime2: [],
+				storeModals: false,
+				currentTab: '1',
+				current: {},
+				service_card_id: '',
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+		},
+		created() {
+			console.log(this.$route.query);
+			if (this.$route.query.id) {
+				this.service_card_id = this.$route.query.id
+				this.formData[0].service_card_id = this.$route.query.id
+				this.getCouponDetail();
+			}
+		},
+		methods: {
+			getCouponDetail() {
+				let that = this
+				serveReadApi(that.service_card_id).then(res => {
+					that.formData = res.data.info.storeInfo.project
+					if(that.formData.length == 0) {
+						that.formData = [{
+							id: 0,
+							service_card_id: that.service_card_id,
+							product_id: 0,
+							store_name: '',
+							slider_image: '',
+							performance_value: '',
+							craft_price: '',
+							sales_commissions: '',
+							repertory: 0,
+						}]
+					}
+				})
+			},
+			// 选择商品
+			changeGoods(item) {
+			    this.modals = true;
+				this.current = item
+			},
+			addNewProject() {
+				console.log('dddddddddddddddddd');
+				let that = this
+				try{
+					this.formData.push({
+					service_card_id: that.service_card_id,
+					id: 0,
+					product_id: 0,
+					store_name: '',
+					slider_image: '',
+					performance_value: '',
+					craft_price: '',
+					sales_commissions: '',
+					repertory: 0,
+				})
+					// this.formData.concat(this.baseForm)
+					console.log(this.formData);
+				}catch(e){
+					console.log(e);
+					//TODO handle the exception
+				}
+			},
+			delNewProject(index,item) {
+				let that = this
+				if(item.id) {
+					try{
+						let delfromData = {
+						    title: '删除服务项目',
+						    url: `service/productDelete/${item.id}`,
+						    method: 'DELETE',
+						    ids: ''
+						};
+						this.$modalSure(delfromData).then((res) => {
+						    that.$Message.success(res.msg);
+						   that.formData.splice(index,1)
+						}).catch(res => {
+						    that.$Message.error(res.msg);
+						});
+					}catch(e){
+						//TODO handle the exception
+						console.log(e,'错误');
+					}
+					
+					// serveProductDeleteApi(item.id).then(res => {
+					// 	this.formData.splice(index,1)
+					// })
+				}else {
+					this.formData.splice(index,1)
+				}
+				if(that.formData.length == 0) {
+					that.formData = [{
+						id: 0,
+						service_card_id: that.service_card_id,
+						product_id: 0,
+						store_name: '',
+						slider_image: '',
+						performance_value: '',
+						craft_price: '',
+						sales_commissions: '',
+						repertory: 0,
+					}]
+				}
+			},
+			// 商品id
+			getProductId(row) {
+				console.log(row,'这个');
+			    this.modal_loading = false;
+			    this.modals = false;
+			    setTimeout(() => {
+					this.current.product_id = row.id
+					this.current.store_name = row.store_name
+					this.current.slider_image = row.image
+					// this.formData.image = row.image
+			    }, 500);
+			},
+			downTab() {
+				if (!this.formData.card_name) {
+					return this.$Message.error("请输入服务卡名称");
+				}
+				if (!this.formData.card_price) {
+					return this.$Message.error("请输入售价");
+				}
+				if (!this.formData.repertory) {
+					return this.$Message.error("请输入库存");
+				}
+			},
+			// 创建
+			save() {
+				// this.downTab();
+				// console.log('这');
+				bindServe(this.service_card_id,{item: this.formData})
+					.then((res) => {
+						this.disabled = true;
+						this.$Message.success(res.msg);
+						setTimeout(() => {
+							this.$router.push({
+								path: this.roterPre + "/marketing/serve/index",
+							});
+						}, 1000);
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+						this.disabled = false;
+					});
+			},
+			// 使用有效期--时间段
+			dateChange(time) {
+				this.formData.start_use_time = time[0];
+				this.formData.end_use_time = time[1];
+			},
+			// 限时
+			timeChange(time) {
+				this.formData.start_time = time[0];
+				this.formData.end_time = time[1];
+			},
+			//对象数组去重;
+			unique(arr) {
+				const res = new Map();
+				return arr.filter(
+					(arr) => !res.has(arr.product_id) && res.set(arr.product_id, 1)
+				);
+			},
+			// // 选择的商品
+			// getProductId(productList) {
+			// 	this.modals = false;
+			// 	this.productList = this.unique(this.productList.concat(productList));
+			// 	this.formData.product_id = "";
+			// 	this.productList.forEach((value) => {
+			// 		if (this.formData.product_id) {
+			// 			this.formData.product_id += `,${value.product_id}`;
+			// 		} else {
+			// 			this.formData.product_id += `${value.product_id}`;
+			// 		}
+			// 	});
+			// },
+			cancel() {
+				this.modals = false;
+			},
+			// 删除商品
+			remove(productId) {
+				for (let index = 0; index < this.productList.length; index++) {
+					if (this.productList[index].product_id == productId) {
+						this.productList.splice(index, 1);
+					}
+				}
+				this.formData.product_id = "";
+				this.productList.forEach((value) => {
+					if (this.formData.product_id) {
+						this.formData.product_id += `,${value.product_id}`;
+					} else {
+						this.formData.product_id += `${value.product_id}`;
+					}
+				});
+			},
+			cancel() {
+			    this.modals = false;
+			},
+			
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.tips {
+		display: inline-bolck;
+		font-size: 12px;
+		font-weight: 400;
+		color: #999999;
+		margin-top: 10px;
+	}
+
+	.imgPic {
+		.info {
+			width: 60%;
+			margin-left: 10px;
+		}
+
+		.pictrue {
+			height: 36px;
+			margin: 7px 3px 0 3px;
+
+			img {
+				height: 100%;
+				display: block;
+			}
+		}
+	}
+
+	.productType {
+		width: 120px;
+		height: 60px;
+		background: #FFFFFF;
+		border-radius: 3px;
+		border: 1px solid #E7E7E7;
+		float: left;
+		text-align: center;
+		padding-top: 8px;
+		position: relative;
+		cursor: pointer;
+		line-height: 23px;
+		margin-right: 12px;
+
+		&.on {
+			border-color: #1890FF;
+		}
+
+		.name {
+			font-size: 14px;
+			font-weight: 600;
+			color: rgba(0, 0, 0, 0.85);
+
+			&.on {
+				color: #1890FF;
+			}
+		}
+
+		.title {
+			font-size: 12px;
+			font-weight: 400;
+			color: #999999;
+		}
+
+		.jiao {
+			position: absolute;
+			bottom: 0;
+			right: 0;
+			width: 0;
+			height: 0;
+			border-bottom: 26px solid #1890FF;
+			border-left: 26px solid transparent;
+		}
+
+		.iconfont {
+			position: absolute;
+			bottom: -3px;
+			right: 1px;
+			color: #FFFFFF;
+			font-size: 12px;
+		}
+	}
+
+	.info {
+		color: #888;
+		font-size: 12px;
+	}
+
+	.ivu-input-wrapper {
+		width: 320px;
+	}
+
+	.ivu-input-number {
+		width: 160px;
+	}
+
+	.ivu-date-picker {
+		width: 320px;
+	}
+
+	.ivu-icon-ios-camera-outline {
+		width: 58px;
+		height: 58px;
+		border: 1px dotted rgba(0, 0, 0, 0.1);
+		border-radius: 4px;
+		background-color: rgba(0, 0, 0, 0.02);
+		line-height: 58px;
+		cursor: pointer;
+		vertical-align: middle;
+	}
+
+	.upload-list {
+		width: 58px;
+		height: 58px;
+		border: 1px dotted rgba(0, 0, 0, 0.1);
+		border-radius: 4px;
+		margin-right: 15px;
+		display: inline-block;
+		position: relative;
+		cursor: pointer;
+		vertical-align: middle;
+	}
+
+	.upload-list img {
+		display: block;
+		width: 100%;
+		height: 100%;
+	}
+
+	.ivu-icon-ios-close-circle {
+		position: absolute;
+		top: 0;
+		right: 0;
+		transform: translate(50%, -50%);
+	}
+
+	.form-submit {
+		/deep/.ivu-card {
+			border-radius: 0;
+		}
+
+		margin-bottom: 79px;
+
+		.fixed-card {
+			position: fixed;
+			right: 0;
+			bottom: 0;
+			left: 200px;
+			z-index: 99;
+			box-shadow: 0 -1px 2px rgb(240, 240, 240);
+
+			/deep/ .ivu-card-body {
+				padding: 15px 16px 14px;
+			}
+
+			.ivu-form-item {
+				margin-bottom: 0;
+			}
+
+			/deep/ .ivu-form-item-content {
+				margin-right: 124px;
+				text-align: center;
+			}
+
+			.ivu-btn {
+				height: 36px;
+				padding: 0 20px;
+			}
+		}
+	}
+
+	/deep/.vxe-tree-cell {
+		padding-left: 0 !important;
+	}
+	.upLoad {
+	    width: 58px;
+	    height: 58px;
+	    line-height: 58px;
+	    border: 1px dotted rgba(0, 0, 0, 0.1);
+	    border-radius: 4px;
+	    background: rgba(0, 0, 0, 0.02);
+	    cursor: pointer;
+	}
+	.product-item {
+		border: 1px solid #eee;
+		min-width: 300px;
+		padding: 20px
+		.submission {
+			// display: block;
+			margin-left: 500px;
+		}
+	}
+	.bom {
+		margin-right: 20px
+	}
+</style>

+ 400 - 0
src/pages/marketing/serveItem/create.vue

@@ -0,0 +1,400 @@
+<template>
+	<div class="form-submit">
+		<div class="i-layout-page-header">
+			<PageHeader class="product_tabs" hidden-breadcrumb>
+				<div slot="title">
+					<router-link :to="{ path: `${roterPre}/marketing/serve/index` }">
+						<div class="font-sm after-line">
+							<span class="iconfont iconfanhui"></span>
+							<span class="pl10">返回</span>
+						</div>
+					</router-link>
+					<span v-text="$route.params.id ? '编辑服务卡' : '添加服务卡'" class="mr20 ml16"></span>
+				</div>
+			</PageHeader>
+		</div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Form :model="formData" :label-width="150">
+				<FormItem label="选择对应服务卡:" required>
+				    <div class="picBox" @click="changeGoods()">
+						<Button type="primary" v-if="!formData.card_name">选择商品</Button>
+				        <div class="" v-if="formData.card_name">
+							{{formData.card_name}}
+				        </div>
+						<Button type="primary" v-if="formData.card_name">
+							切换商品
+						</Button>
+				    </div>
+				</FormItem>
+				<!-- <FormItem label="服务卡名称" required>
+					<Input v-model="formData.card_name" v-width="320" placeholder="请输入服务卡名称"></Input>
+				</FormItem> -->
+				<!-- <FormItem label="售价" required>
+					<InputNumber :min="1" :max="100000000" v-model="formData.card_price" v-width="320"></InputNumber>
+				</FormItem>
+				<FormItem label="库存" required>
+					<InputNumber :min="1" :max="100000000" v-model="formData.repertory" v-width="320"></InputNumber>
+					</InputNumber>
+				</FormItem> -->
+				<!-- explain -->
+				<FormItem label="备注">
+					<Input v-model="formData.explain" v-width="320" placeholder=""></Input>
+				</FormItem>
+			</Form>
+			<div style="width: 500px; display: flex;justify-content: center;">
+				<Button  type="primary" class="submission" @click="save" :disabled="disabled" v-if="!formData.id">立即创建</Button>
+				<Button  type="primary" class="submission" @click="save" :disabled="disabled" v-else>立即修改</Button>
+			</div>
+		</Card>
+		<!-- 选择商品-->
+		<Modal v-model="modals" title="商品列表" footerHide class="paymentFooter" scrollable width="900"
+		    @on-cancel="cancel">
+		    <goods-list ref="goodslist" :goodsType="1" v-if="modals" @getProductId="getProductId" :serviceCard="1"></goods-list>
+		</Modal>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from "vuex";
+	import storeList from "@/components/storeList";
+	import goodsList from "@/components/goodsList/index";
+	import {
+		couponCategoryApi,
+		couponSaveApi,
+		couponDetailApi,
+		VipEditApi,
+		serveAddApi,
+		serveReadApi
+	} from "@/api/marketing";
+	import {
+		brandList
+	} from "@/api/product";
+	// import { formatDate } from '@/utils/validate';
+	import Setting from "@/setting";
+	export default {
+		name: "storeCouponCreate",
+		components: {
+			goodsList,
+			storeList
+		},
+		data() {
+			return {
+				id: '',
+				roterPre: Setting.roterPre,
+				disabled: false,
+				storesList: [],
+				formData: {
+					id: '',
+					product_name: '',
+					product_id: 0,
+					card_name: '',
+					repertory: '',
+					card_price: '',
+					explain: '',
+					unit_name: '',
+					image: '',
+					images: ''
+				},
+				isMinPrice: 0,
+				isCouponTime: 1,
+				isReceiveTime: 0,
+				modals: false,
+				datetime1: [],
+				datetime2: [],
+				storeModals: false,
+				currentTab: '1',
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+		},
+		created() {
+			if (this.$route.query.id) {
+				this.id = this.$route.query.id
+				this.getDetail();
+			}
+		},
+		methods: {
+			// 商品id
+			getProductId(row) {
+				console.log(row,'这个');
+			    this.modal_loading = false;
+			    this.modals = false;
+			    setTimeout(() => {
+					this.formData.product_id = row.id
+						this.formData.card_name = row.store_name
+						this.formData.product_id = row.id
+						this.formData.card_price = row.price
+						this.formData.unit_name = row.unit_name
+						this.formData.image = row.image
+						this.formData.images = row.slider_image
+						this.formData.is_show = 1
+						this.formData.repertory = row.stock
+					// this.formData.image = row.image
+			    }, 500);
+			},
+			// 选择商品
+			changeGoods() {
+			    this.modals = true;
+			},
+			downTab() {
+				if (!this.formData.card_name) {
+					return this.$Message.error("请输入服务卡名称");
+				}
+				if (!this.formData.card_price) {
+					return this.$Message.error("请输入售价");
+				}
+				if (!this.formData.repertory) {
+					return this.$Message.error("请输入库存");
+				}
+			},
+			// 创建
+			save() {
+				this.downTab();
+				console.log('这');
+				serveAddApi(this.formData)
+					.then((res) => {
+						this.disabled = true;
+						this.$Message.success(res.msg);
+						setTimeout(() => {
+							this.$router.push({
+								path: this.roterPre + "/marketing/serve/index",
+							});
+						}, 1000);
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			// 使用有效期--时间段
+			dateChange(time) {
+				this.formData.start_use_time = time[0];
+				this.formData.end_use_time = time[1];
+			},
+			// 限时
+			timeChange(time) {
+				this.formData.start_time = time[0];
+				this.formData.end_time = time[1];
+			},
+			//对象数组去重;
+			unique(arr) {
+				const res = new Map();
+				return arr.filter(
+					(arr) => !res.has(arr.product_id) && res.set(arr.product_id, 1)
+				);
+			},
+			cancel() {
+				this.modals = false;
+			},
+			// 删除商品
+			remove(productId) {
+				for (let index = 0; index < this.productList.length; index++) {
+					if (this.productList[index].product_id == productId) {
+						this.productList.splice(index, 1);
+					}
+				}
+				this.formData.product_id = "";
+				this.productList.forEach((value) => {
+					if (this.formData.product_id) {
+						this.formData.product_id += `,${value.product_id}`;
+					} else {
+						this.formData.product_id += `${value.product_id}`;
+					}
+				});
+			},
+			// 获取详情
+			getDetail() {
+				serveReadApi(this.id).then(res => {
+					console.log(res);
+					let row = res.data.info.storeInfo
+					this.formData = {
+						id: row.id,
+						product_id: row.id,
+						card_name: row.card_name,
+						card_price: row.card_price,
+						explain: row.explain,
+						unit_name: row.unit_name,
+						image: row.image,
+						images: row.slider_image,
+						repertory: row.repertory,
+						is_show: 1
+					}
+				})
+			}
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.tips {
+		display: inline-bolck;
+		font-size: 12px;
+		font-weight: 400;
+		color: #999999;
+		margin-top: 10px;
+	}
+
+	.imgPic {
+		.info {
+			width: 60%;
+			margin-left: 10px;
+		}
+
+		.pictrue {
+			height: 36px;
+			margin: 7px 3px 0 3px;
+
+			img {
+				height: 100%;
+				display: block;
+			}
+		}
+	}
+
+	.productType {
+		width: 120px;
+		height: 60px;
+		background: #FFFFFF;
+		border-radius: 3px;
+		border: 1px solid #E7E7E7;
+		float: left;
+		text-align: center;
+		padding-top: 8px;
+		position: relative;
+		cursor: pointer;
+		line-height: 23px;
+		margin-right: 12px;
+
+		&.on {
+			border-color: #1890FF;
+		}
+
+		.name {
+			font-size: 14px;
+			font-weight: 600;
+			color: rgba(0, 0, 0, 0.85);
+
+			&.on {
+				color: #1890FF;
+			}
+		}
+
+		.title {
+			font-size: 12px;
+			font-weight: 400;
+			color: #999999;
+		}
+
+		.jiao {
+			position: absolute;
+			bottom: 0;
+			right: 0;
+			width: 0;
+			height: 0;
+			border-bottom: 26px solid #1890FF;
+			border-left: 26px solid transparent;
+		}
+
+		.iconfont {
+			position: absolute;
+			bottom: -3px;
+			right: 1px;
+			color: #FFFFFF;
+			font-size: 12px;
+		}
+	}
+
+	.info {
+		color: #888;
+		font-size: 12px;
+	}
+
+	.ivu-input-wrapper {
+		width: 320px;
+	}
+
+	.ivu-input-number {
+		width: 160px;
+	}
+
+	.ivu-date-picker {
+		width: 320px;
+	}
+
+	.ivu-icon-ios-camera-outline {
+		width: 58px;
+		height: 58px;
+		border: 1px dotted rgba(0, 0, 0, 0.1);
+		border-radius: 4px;
+		background-color: rgba(0, 0, 0, 0.02);
+		line-height: 58px;
+		cursor: pointer;
+		vertical-align: middle;
+	}
+
+	.upload-list {
+		width: 58px;
+		height: 58px;
+		border: 1px dotted rgba(0, 0, 0, 0.1);
+		border-radius: 4px;
+		margin-right: 15px;
+		display: inline-block;
+		position: relative;
+		cursor: pointer;
+		vertical-align: middle;
+	}
+
+	.upload-list img {
+		display: block;
+		width: 100%;
+		height: 100%;
+	}
+
+	.ivu-icon-ios-close-circle {
+		position: absolute;
+		top: 0;
+		right: 0;
+		transform: translate(50%, -50%);
+	}
+
+	.form-submit {
+		/deep/.ivu-card {
+			border-radius: 0;
+		}
+
+		margin-bottom: 79px;
+
+		.fixed-card {
+			position: fixed;
+			right: 0;
+			bottom: 0;
+			left: 200px;
+			z-index: 99;
+			box-shadow: 0 -1px 2px rgb(240, 240, 240);
+
+			/deep/ .ivu-card-body {
+				padding: 15px 16px 14px;
+			}
+
+			.ivu-form-item {
+				margin-bottom: 0;
+			}
+
+			/deep/ .ivu-form-item-content {
+				margin-right: 124px;
+				text-align: center;
+			}
+
+			.ivu-btn {
+				height: 36px;
+				padding: 0 20px;
+			}
+		}
+	}
+
+	/deep/.vxe-tree-cell {
+		padding-left: 0 !important;
+	}
+</style>

+ 287 - 0
src/pages/marketing/serveItem/index.vue

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

+ 4 - 2
src/pages/product/productAdd/index.vue

@@ -469,8 +469,8 @@
                     </Col> -->
                     </Col> -->
         </Row>
         </Row>
         <Row :gutter="24" type="flex" v-show="currentTab === '2'">
         <Row :gutter="24" type="flex" v-show="currentTab === '2'">
-          <Col span="24" v-if="formValidate.product_type != 4">
-            <FormItem label="商品规格:" props="spec_type">
+          <Col span="24" v-if="formValidate.product_type != 4 && formValidate.product_type != 5 && formValidate.product_type != 6">
+            <FormItem label="商品规格:" props="spec_type" >
               <RadioGroup
               <RadioGroup
                   v-model="formValidate.spec_type"
                   v-model="formValidate.spec_type"
                   @on-change="changeSpec"
                   @on-change="changeSpec"
@@ -2066,6 +2066,8 @@ export default {
         { name: "卡密/网盘", title: "自动发货", id: 1 },
         { name: "卡密/网盘", title: "自动发货", id: 1 },
         { name: "虚拟商品", title: "虚拟发货", id: 3 },
         { name: "虚拟商品", title: "虚拟发货", id: 3 },
         { name: "次卡商品", title: "到店核销", id: 4 },
         { name: "次卡商品", title: "到店核销", id: 4 },
+		{ name: "服务卡", title: "服务卡", id: 5 },
+		{ name: "服务项目", title: "服务项目", id: 6 },
       ],
       ],
       virtualList:[],
       virtualList:[],
       carMyShow: false,//是否开启卡密弹窗
       carMyShow: false,//是否开启卡密弹窗

+ 39 - 0
src/pages/product/productList/index.vue

@@ -93,6 +93,30 @@
               </div>
               </div>
             </div>
             </div>
           </FormItem>
           </FormItem>
+		  <FormItem label="是否服务卡:" label-for="service_card">
+		     <Select
+		         v-model="artFrom.service_card"
+		         filterable
+		         @on-change="userSearchs"
+		         class="input-add"
+		     >
+		       <Option v-for="item in options" :value="item.value"
+		       >{{ item.label }}
+		       </Option>
+		     </Select>
+		  </FormItem>
+		  <FormItem label="是否服务项目:" label-for="service_project">
+		     <Select
+		         v-model="artFrom.service_project"
+		         filterable
+		         @on-change="userSearchs"
+		         class="input-add"
+		     >
+		       <Option v-for="item in options" :value="item.value"
+		       >{{ item.label }}
+		       </Option>
+		     </Select>
+		  </FormItem>
           <FormItem label="商品搜索:" label-for="store_name">
           <FormItem label="商品搜索:" label-for="store_name">
             <Input
             <Input
                 placeholder="请输入商品名称,关键字,ID"
                 placeholder="请输入商品名称,关键字,ID"
@@ -101,6 +125,7 @@
             />
             />
             <Button type="primary" @click="userSearchs">查询</Button>
             <Button type="primary" @click="userSearchs">查询</Button>
           </FormItem>
           </FormItem>
+		  
         </Form>
         </Form>
       </div>
       </div>
     </Card>
     </Card>
@@ -312,6 +337,8 @@
             <span v-if="row.product_type == 1">卡密商品</span>
             <span v-if="row.product_type == 1">卡密商品</span>
             <span v-if="row.product_type == 3">虚拟商品</span>
             <span v-if="row.product_type == 3">虚拟商品</span>
             <span v-if="row.product_type == 4">次卡商品</span>
             <span v-if="row.product_type == 4">次卡商品</span>
+			<span v-if="row.product_type == 5">服务卡</span>
+			<span v-if="row.product_type == 6">服务项目</span>
           </template>
           </template>
         </vxe-column>
         </vxe-column>
         <vxe-column field="price" title="商品售价" min-width="90"></vxe-column>
         <vxe-column field="price" title="商品售价" min-width="90"></vxe-column>
@@ -688,6 +715,16 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
+		options: [
+			{
+				label: '是',
+				value: 1
+			},
+			{
+				label: '否',
+				value: 0
+			}
+		],
       formTypeList: [],
       formTypeList: [],
       formColumns: [
       formColumns: [
         {
         {
@@ -735,6 +772,8 @@ export default {
         store_id: "",
         store_id: "",
       },
       },
       artFrom: {
       artFrom: {
+		service_card: 0,
+		service_project: 0,
         page: 1,
         page: 1,
         limit: 15,
         limit: 15,
         cate_id: "",
         cate_id: "",

+ 230 - 0
src/pages/store/checkGroup/index.vue

@@ -0,0 +1,230 @@
+<template>
+    <div>
+        <div class="i-layout-page-header">
+            <PageHeader class="product_tabs" title="会员卡" hidden-breadcrumb></PageHeader>
+        </div>
+        <Card :bordered="false" dis-hover class="ivu-mt">
+			<Form ref="tableFrom" :model="tableFrom"  :label-width="labelWidth" :label-position="labelPosition" @submit.native.prevent>
+			    <Row type="flex">
+			        <Col v-bind="grid">
+			            <Button v-auth="['admin-marketing-store_coupon-add']" type="primary"  icon="md-add" @click="add">添加会员卡</Button>
+			        </Col>
+			    </Row>
+			</Form>
+            <Table :columns="columns1" :data="tableList" ref="table" class="mt25"
+                   :loading="loading" highlight-row
+                   no-userFrom-text="暂无数据"
+                   no-filtered-userFrom-text="暂无筛选结果">
+								<template slot-scope="{ row }" slot="coupon_price">
+								   <span v-if="row.coupon_type==1">{{row.coupon_price}}元</span>
+									 <span v-if="row.coupon_type==2">{{parseFloat(row.coupon_price)/10}}折({{row.coupon_price.toString().split(".")[0]}}%)</span>
+								</template>	 
+                <template slot-scope="{ row, index }" slot="status">
+                    <Icon type="md-checkmark" v-if="row.status === 1" color="#0092DC" size="14"/>
+                    <Icon type="md-close" v-else color="#ed5565" size="14"/>
+                </template>
+                <template slot-scope="{ row, index }" slot="add_time">
+                    <span> {{row.add_time | formatDate}}</span>
+                </template>
+                <template slot-scope="{ row, index }" slot="action">
+                    <a @click="couponSend(row)" >编辑</a>
+                    <Divider type="vertical" />
+                    <a @click="couponDel(row,'删除会员卡',index)">删除</a>
+                </template>
+            </Table>
+            <div class="acea-row row-right page">
+                <Page :total="total" :current="tableFrom.page" show-elevator show-total @on-change="pageChange"
+                      :page-size="tableFrom.limit"/>
+            </div>
+        </Card>
+        <!--表单编辑-->
+        <edit-from :FromData="FromData" @changeType="changeType" ref="edits"></edit-from>
+    </div>
+</template>
+
+<script>
+    import { mapState } from 'vuex';
+    import { couponListApi, couponCreateApi, couponEditeApi, couponSendApi,vipListApi,VipDeleteApi ,VipEditApi} from '@/api/marketing';
+	import { checkGroupList } from '@/api/store';
+    import editFrom from '@/components/from/from';
+    import { formatDate } from '@/utils/validate';
+	import Setting from "@/setting";
+    export default {
+        name: 'storeCoupon',
+        filters: {
+            formatDate (time) {
+                if (time !== 0) {
+                    let date = new Date(time * 1000);
+                    return formatDate(date, 'yyyy-MM-dd hh:mm');
+                }
+            }
+        },
+        components: { editFrom },
+        data () {
+            return {
+				roterPre: Setting.roterPre,
+                grid: {
+                    xl: 7,
+                    lg: 7,
+                    md: 12,
+                    sm: 24,
+                    xs: 24
+                },
+                loading: false,
+                columns1: [
+                    {
+                        title: 'ID',
+                        key: 'id',
+                        width: 80
+                    },
+                    {
+                        title: '考勤组名称',
+                        key: 'name',
+                        minWidth: 150
+                    },
+                    {
+                        title: 'price',
+                        key: 'price',
+                        minWidth: 80
+                    },
+                    {
+                        title: 'classes_id',
+                        key: 'classes_id',
+                        minWidth: 100
+                    },
+                    // {
+                    //     title: '折扣',
+                    //     key: 'discount_ratio',
+                    //     minWidth: 100
+                    // },
+                    {
+                        title: '操作',
+                        slot: 'action',
+                        fixed: 'right',
+                        minWidth: 170
+                    }
+                ],
+                tableFrom: {
+                    page: 1,
+                    limit: 15
+                },
+                tableList: [],
+                total: 0,
+                FromData: null
+            }
+        },
+        created () {
+            this.getList();
+        },
+        computed: {
+            ...mapState('admin/layout', [
+                'isMobile'
+            ]),
+            labelWidth () {
+                return this.isMobile ? undefined : 90;
+            },
+            labelPosition () {
+                return this.isMobile ? 'top' : 'left';
+            }
+        },
+        methods: {
+            // 失效
+            couponInvalid (row, tit, num) {
+                let delfromData = {
+                    title: tit,
+                    num: num,
+                    url: `marketing/coupon/status/${row.id}`,
+                    method: 'PUT',
+                    ids: ''
+                };
+                this.$modalSure(delfromData).then((res) => {
+                    this.$Message.success(res.msg);
+                    this.getList();
+                }).catch(res => {
+                    this.$Message.error(res.msg);
+                });
+            },
+            // 发布
+            couponSend (row) {
+                this.$modalForm(VipEditApi(row.id)).then(() => this.getList());
+            },
+            // 删除
+            couponDel (row, tit, num) {
+                let delfromData = {
+                    title: tit,
+                    url: `membership/deleteCard/${row.id}`,
+                    method: 'DELETE',
+                    ids: ''
+                };
+                this.$modalSure(delfromData).then((res) => {
+                    this.$Message.success(res.msg);
+                    this.tableList.splice(num, 1)
+                }).catch(res => {
+                    this.$Message.error(res.msg);
+                });
+            },
+            // 列表
+            getList () {
+                this.loading = true;
+                
+                checkGroupList(this.tableFrom).then(async res => {
+                    let data = res.data
+                    this.tableList = data.list;
+                    this.total = res.data.count;
+                    this.loading = false;
+                }).catch(res => {
+                    this.loading = false;
+                    this.$Message.error(res.msg);
+                });
+            },
+            pageChange (index) {
+                this.tableFrom.page = index;
+                this.getList();
+            },
+            changeType (data) {
+                this.type = data;
+            },
+            // 添加
+            add () {
+                // this.$modalForm(couponCreateApi()).then(() => this.getList());
+				this.$router.push({ path: this.roterPre + "/marketing/vip/create" });
+                // this.addType(0);
+            },
+            addType (type) {
+                couponCreateApi(type).then(async res => {
+                    if (res.data.status === false) {
+                        return this.$authLapse(res.data);
+                    }
+					// console.log()
+					console.log(res.data,'res.data');
+                    this.FromData = res.data;
+                    this.$refs.edits.modals = true;
+                }).catch(res => {
+                    this.$Message.error(res.msg);
+                })
+            },
+            // 编辑
+            edit (row) {
+                this.$modalForm(couponEditeApi(row.id)).then(() => this.getList());
+            },
+            // 表格搜索
+            userSearchs () {
+                this.tableFrom.page = 1;
+                this.getList();
+            },
+            // 修改成功
+            submitFail () {
+                this.getList();
+            }
+        }
+    }
+</script>
+
+<style scoped>
+    .ivu-col:nth-of-type(1) .ivu-form-item .ivu-form-item-label{
+        width: 80px !important;
+    }
+    .ivu-col:nth-of-type(1) .ivu-form-item .ivu-form-item-content{
+        margin-left: 80px !important;
+    }
+</style>

+ 8 - 0
src/pages/store/checkRule/index.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 94 - 279
src/pages/store/components/addStaff.vue

@@ -15,7 +15,7 @@
 							</FormItem>
 							</FormItem>
 							</Col>
 							</Col>
 							</Col>
 							</Col>
-							<Col span="24">
+							<!-- <Col span="24">
 							<Col v-bind="grid">
 							<Col v-bind="grid">
 							<FormItem label="所属门店:" prop="store_id">
 							<FormItem label="所属门店:" prop="store_id">
 								<Select v-model="formItem.store_id" clearable filterable @on-change="userSearchs"
 								<Select v-model="formItem.store_id" clearable filterable @on-change="userSearchs"
@@ -25,12 +25,12 @@
 								</Select>
 								</Select>
 							</FormItem>
 							</FormItem>
 							</Col>
 							</Col>
-							</Col>
+							</Col> -->
 							<Col span="24">
 							<Col span="24">
 							<Col v-bind="grid">
 							<Col v-bind="grid">
 							<FormItem label="头像:" prop="image">
 							<FormItem label="头像:" prop="image">
 								<div class="picBox" @click="modalPicTap('单选')">
 								<div class="picBox" @click="modalPicTap('单选')">
-									<div class="pictrue" v-if="formItem.image"><img v-lazy="formItem.image"></div>
+									<div class="pictrue" v-if="formItem.avatar"><img v-lazy="formItem.avatar"></div>
 									<div class="upLoad" v-else>
 									<div class="upLoad" v-else>
 										<div class="iconfont">+</div>
 										<div class="iconfont">+</div>
 									</div>
 									</div>
@@ -38,7 +38,7 @@
 							</FormItem>
 							</FormItem>
 							</Col>
 							</Col>
 							</Col>
 							</Col>
-							<Col span="24" v-if="formItem.id == 0">
+							<Col span="24" >
 							<Col v-bind="grid">
 							<Col v-bind="grid">
 							<FormItem label="姓名:" prop="name" label-for="name">
 							<FormItem label="姓名:" prop="name" label-for="name">
 								<Input v-model="formItem.name" placeholder="请输入姓名" />
 								<Input v-model="formItem.name" placeholder="请输入姓名" />
@@ -47,22 +47,29 @@
 							</Col>
 							</Col>
 							<Col span="24">
 							<Col span="24">
 							<Col v-bind="grid">
 							<Col v-bind="grid">
-							<FormItem label="手机号:" label-for="phone" prop="phone">
-								<Input v-model="formItem.phone" placeholder="请输入门店手机号" />
+							<FormItem label="别名:" prop="name" label-for="alias">
+								<Input v-model="formItem.alias" placeholder="请输入别名" />
+							</FormItem>
+							</Col>
+							</Col>
+							<Col span="24">
+							<Col v-bind="grid">
+							<FormItem label="手机号:" label-for="mobile" prop="mobile">
+								<Input v-model="formItem.mobile" placeholder="请输入手机号" />
 							</FormItem>
 							</FormItem>
 							</Col>
 							</Col>
 							</Col>
 							</Col>
 							<Col span="24" class="mt20">
 							<Col span="24" class="mt20">
 							  <Col v-bind="grid">
 							  <Col v-bind="grid">
-							    <FormItem label="是否服务:">
-							      <RadioGroup v-model="formItem.applicable_type">
-							        <Radio :label="1">
+							    <FormItem label="性别:">
+							      <RadioGroup v-model="formItem.gender">
+							        <Radio :label="0">
 							          <Icon type="social-apple"></Icon>
 							          <Icon type="social-apple"></Icon>
-							          <span>普通员工</span>
+							          <span></span>
 							        </Radio>
 							        </Radio>
 							        <Radio :label="2">
 							        <Radio :label="2">
 							          <Icon type="social-android"></Icon>
 							          <Icon type="social-android"></Icon>
-							          <span>服务员工(技师)</span>
+							          <span></span>
 							        </Radio>
 							        </Radio>
 							      </RadioGroup>
 							      </RadioGroup>
 							    </FormItem>
 							    </FormItem>
@@ -70,170 +77,32 @@
 							</Col>
 							</Col>
 							<Col span="24">
 							<Col span="24">
 							<Col v-bind="grid">
 							<Col v-bind="grid">
-								<!-- <Input v-model="formItem.phone"  placeholder="请输入门店手机号"/> -->
-								<FormItem label="是否打卡:">
-								  <RadioGroup v-model="formItem.applicable_type">
-								    <Radio :label="1">
-								      <Icon type="social-apple"></Icon>
-								      <span>需要打开</span>
-								    </Radio>
-								    <Radio :label="2">
-								      <Icon type="social-android"></Icon>
-								      <span>无需打卡</span>
-								    </Radio>
-								  </RadioGroup>
-								</FormItem>
+							<FormItem label="职务:" label-for="position" prop="position">
+								<Input v-model="formItem.position" placeholder="请输入职务" />
+							</FormItem>
 							</Col>
 							</Col>
 							</Col>
 							</Col>
-	<!-- 						<Col span="24" v-if="formItem.id == 0">
+							<Col span="24">
 							<Col v-bind="grid">
 							<Col v-bind="grid">
-							<FormItem label="账号:" prop="store_account" label-for="store_account">
-								<Input v-model="formItem.store_account" placeholder="请输入管理员账号" />
+							<FormItem label="住址:" label-for="address" prop="address">
+								<Input v-model="formItem.address" placeholder="请输入住址" />
 							</FormItem>
 							</FormItem>
 							</Col>
 							</Col>
-							</Col> -->
-<!-- 							<Col span="24" v-if="formItem.id == 0">
+							</Col>
+							<Col span="24">
 							<Col v-bind="grid">
 							<Col v-bind="grid">
-							<FormItem label="密码:" prop="store_password" label-for="store_password">
-								<Input type="password" v-model="formItem.store_password" placeholder="请输入管理员密码" />
+							<FormItem label="部门:" label-for="main_department" prop="main_department">
+								<el-cascader placeholder="请选择部门" :options="departmentList" :value="formItem.main_department"
+									v-width="320" :props="{ checkStrictly: true,value: 'id',label: 'name' }"
+									clearable @change="changeBm"></el-cascader>
 							</FormItem>
 							</FormItem>
 							</Col>
 							</Col>
-							</Col> -->
-							<!-- <Col span="24">
-                                <Col v-bind="grid">
-                                    <FormItem label="门店名称:" prop="name" label-for="name">
-                                        <Input v-model="formItem.name"  maxlength="20" show-word-limit  placeholder="请输入门店名称"/>
-                                    </FormItem>
-                                </Col>
-                            </Col> -->
-							<!-- <Col span="24">
-                            	<Col v-bind="grid">
-                            		<FormItem label="门店简介:" label-for="introduction">
-                            			<Input v-model="formItem.introduction"  maxlength="100" show-word-limit :rows="4" :autosize="{maxRows:4,minRows: 4}" type="textarea"   placeholder="请输入门店简介"s/>
-                            		</FormItem>
-                            	</Col>
-                            </Col> -->
-
-							<!-- <Col span="24">
-								<Col v-bind="grid">
-									<FormItem label="营业状态:" label-for="is_show" prop="is_show">
-										<Switch size="large" v-model="formItem.is_show" :false-value="0" :true-value="1">
-											<span slot="open" :true-value="1">开启</span>
-											<span slot="close" :false-value="0">关闭</span>
-										</Switch>
-									</FormItem>
-								</Col>
-							</Col> -->
-							<!-- <Col span="24">
-								<Col v-bind="grid" v-if="formItem.is_show == 1">
-									<FormItem label="营业时间:" label-for="day_time"  prop="day_time">
-										<TimePicker type="timerange" @on-change="onchangeTime" v-model="formItem.day_time"  format="HH:mm:ss" :value="formItem.day_time" placement="bottom-end" placeholder="请选择营业时间" class="inputW" ></TimePicker>
-									</FormItem>
-								</Col>
-							</Col> -->
-							<!-- <Col span="24">
-                <Col v-bind="grid">
-                  <FormItem label="门店类型:">
-                    <RadioGroup v-model="formItem.type">
-                      <Radio :label="1">
-                        <Icon type="social-apple"></Icon>
-                        <span>自营</span>
-                      </Radio>
-                      <Radio :label="2">
-                        <Icon type="social-android"></Icon>
-                        <span>加盟</span>
-                      </Radio>
-                    </RadioGroup>
-                    <div class="tips">自营店不支持自主上传商品,加盟店有自主上传商品的权限</div>
-                  </FormItem>
-                </Col>
-              </Col> -->
-							<!-- <Col span="24" v-if="formItem.type==2">
-								<Col v-bind="grid">
-									<FormItem label="商品免审:" label-for="product_verify_status" prop="product_verify_status">
-										<Switch size="large" v-model="formItem.product_verify_status" :false-value="0" :true-value="1">
-											<span slot="open" :true-value="1">开启</span>
-											<span slot="close" :false-value="0">关闭</span>
-										</Switch>
-									</FormItem>
-								</Col>
-							</Col> -->
-							<!-- <Col span="24" v-if="formItem.type==2">
-                <Col v-bind="grid">
-                  <FormItem label="自主添加商品:" label-for="product_status" prop="product_status">
-                    <Switch size="large" v-model="formItem.product_status" :false-value="0" :true-value="1">
-                      <span slot="open" :true-value="1">开启</span>
-                      <span slot="close" :false-value="0">关闭</span>
-                    </Switch>
-                  </FormItem>
-                </Col>
-              </Col> -->
-							<!-- <Col span="24">
-								<Col v-bind="grid">
-									<FormItem label="到店自提:" label-for="mention" prop="mention">
-										<Switch size="large" v-model="formItem.is_store" :false-value="0" :true-value="1">
-											<span slot="open" :true-value="1">开启</span>
-											<span slot="close" :false-value="0">关闭</span>
-										</Switch>
-									</FormItem>
-								</Col>
 							</Col>
 							</Col>
-                            <Col span="24">
-                            	<Col v-bind="grid">
-                            		<FormItem label="门店地址:" label-for="address" prop="address">
-                            			<Cascader :data="addresData" :load-data="loadData" v-model="formItem.addressSelect" @on-change="addchack" class="inputW"></Cascader>
-                            		</FormItem>
-                            	</Col>
-                            </Col>
-							<Col span="24">
-								<Col v-bind="grid">
-									<FormItem required label="配送范围(半径):" label-for="valid_range" prop="valid_range">
-										<InputNumber :min="0.01" :max="100000" v-model="formItem.valid_range" :formatter="value => `${formItem.valid_range}`" :parser="value => value.replace('%', '')" style="width: 90px;"></InputNumber><span class="ml10">km</span>
-									</FormItem>
-								</Col>
-							</Col> -->
-							<!-- <Col span="24">
-                            	<Col v-bind="grid">
-                            		<FormItem label="门店详细地址:" label-for="detailed_address" prop="detailed_address">
-                            			<Input search enter-button="查找位置" v-model="formItem.detailed_address"  placeholder="输入地址(包含城市名称,否则会影响搜索精度)" class="inputW" @on-search="onSearch" />
-									</FormItem>
-                            	</Col>
-                            </Col> -->
-							<!-- <Col span="24" v-if="isApi || add">
-								<Maps v-if="mapKey" ref="mapChild" class="map-sty" :mapKey="mapKey" :lat="Number(formItem.latitude || 34.34127)" :lon="Number(formItem.longitude || 108.93984)" :address="formItem.detailed_address" @getCoordinates="getCoordinates" />
-							</Col> -->
-							<!-- <Col span="24" class="mt20" v-if="!formItem.id">
-                            <Col v-bind="grid">
-                              <FormItem label="同步商品:">
-                                <RadioGroup v-model="formItem.applicable_type">
-                                  <Radio :label="1">
-                                    <Icon type="social-apple"></Icon>
-                                    <span>全部商品</span>
-                                  </Radio>
-                                  <Radio :label="2">
-                                    <Icon type="social-android"></Icon>
-                                    <span>部分商品</span>
-                                  </Radio>
-                                </RadioGroup>
-                              </FormItem>
-                            </Col>
-                          </Col> -->
-							<!-- <Col span="24" v-if="!formItem.id && formItem.applicable_type == 2" >
-                          <FormItem label="选择商品:" label-for="product_id" prop="">
-                            <div class="box">
-                              <div class="box-item" v-for="(item,index) in goodsList" :key="index">
-                                <img :src="item.image" alt="">
-                                <Icon class="icon" type="ios-close-circle" size="20" @click="bindDelete(index)" />
-                              </div>
-                              <div class="upload-box" @click="modals = true"><Icon type="ios-camera-outline" size="36" /></div>
-                            </div>
-                          </FormItem>
-                        </Col> -->
 						</Row>
 						</Row>
 						<Row style="justify-content: space-around;">
 						<Row style="justify-content: space-around;">
 							<Col>
 							<Col>
 							<Button type="primary" class="btn"
 							<Button type="primary" class="btn"
-								@click="handleSubmit('formItem')">{{formItem.id!=0?'修改':'提交'}}</Button>
+								@click="handleSubmit('formItem')">提交</Button>
 							</Col>
 							</Col>
 						</Row>
 						</Row>
 						<Spin size="large" fix v-if="spinShow"></Spin>
 						<Spin size="large" fix v-if="spinShow"></Spin>
@@ -267,7 +136,9 @@
 		cityApi,
 		cityApi,
 		storeUpdateApi,
 		storeUpdateApi,
 		cascaderList,
 		cascaderList,
-		staffListInfo
+		staffListInfo,
+		getDepartmentList,
+		addYg
 	} from '@/api/store';
 	} from '@/api/store';
 	import {
 	import {
 		erpConfig
 		erpConfig
@@ -299,15 +170,8 @@
 				}
 				}
 			};
 			};
 			let validateUpload = (rule, value, callback) => {
 			let validateUpload = (rule, value, callback) => {
-				if (!this.formItem.image) {
-					callback(new Error('请上传门店照片'))
-				} else {
-					callback()
-				}
-			};
-			let validateErp = (rule, value, callback) => {
-				if (this.formItem.erp_shop_id == 0) {
-					callback(new Error('请选择erp门店'))
+				if (!this.formItem.avatar) {
+					callback(new Error('请上传头像'))
 				} else {
 				} else {
 					callback()
 					callback()
 				}
 				}
@@ -322,33 +186,13 @@
 				isTemplate: false,
 				isTemplate: false,
 				title: '',
 				title: '',
 				formItem: {
 				formItem: {
-					product_id: [],
-					cate_id: [],
-					id: 0,
-					erp_shop_id: 0,
-					store_account: '',
-					store_password: '',
-					image: '',
 					name: '',
 					name: '',
-					introduction: '',
-					phone: '',
-					is_show: 1,
-					day_time: [],
-					is_store: 0,
+					avatar: '',
+					mobile: '',
+					alias: '',
 					address: '',
 					address: '',
-					detailed_address: '',
-					latitude: '',
-					longitude: '',
-					province: 0,
-					city: 0,
-					area: 0,
-					street: 0,
-					addressSelect: [],
-					valid_range: 0,
-					product_verify_status: 0,
-					product_status: 1,
-					type: 1,
-					applicable_type: 1
+					main_department: '',
+					direct_leader: 'ZhouFengYu'
 				},
 				},
 				spinShow: false,
 				spinShow: false,
 				addresData: [],
 				addresData: [],
@@ -358,48 +202,18 @@
 						message: '请输入姓名',
 						message: '请输入姓名',
 						trigger: 'blur'
 						trigger: 'blur'
 					}],
 					}],
-					store_account: [{
-						required: true,
-						message: '请输入管理员账号',
-						trigger: 'blur'
-					}],
-					store_password: [{
-						required: true,
-						message: '请输入管理员密码',
-						trigger: 'blur'
-					}],
 					address: [{
 					address: [{
 						required: true,
 						required: true,
-						message: '请选择门店地址',
-						trigger: 'change'
+						message: '请输入地址地址',
+						trigger: 'blur'
 					}],
 					}],
-					day_time: [{
-							required: true,
-							type: "array",
-							message: "请选择营业时间",
-							trigger: "change"
-						},
-						{
-							validator(rule, value, callback, source, options) {
-								if (value[0] === "") {
-									callback("时间不能为空");
-								}
-								callback(); //这个一定要有。不然无法验证通过
-							}
-						}
-					], //TimePicker-timerange,自定义的
 
 
-					phone: [{
+					mobile: [{
 						required: true,
 						required: true,
 						validator: validatePhone,
 						validator: validatePhone,
 						trigger: 'blur'
 						trigger: 'blur'
 					}],
 					}],
-					detailed_address: [{
-						required: true,
-						message: '请输入详细地址',
-						trigger: 'blur'
-					}],
-					image: [{
+					avatar: [{
 						required: true,
 						required: true,
 						validator: validateUpload,
 						validator: validateUpload,
 						trigger: 'change'
 						trigger: 'change'
@@ -431,10 +245,12 @@
 				isChoice: '单选',
 				isChoice: '单选',
 				pid: 0,
 				pid: 0,
 				isApi: 0,
 				isApi: 0,
-				add: 0
+				add: 0,
+				departmentList: []
 			}
 			}
 		},
 		},
 		created() {
 		created() {
+			this.getDepartmentList()
 			this.goodsCategory();
 			this.goodsCategory();
 			this.getErpConfig();
 			this.getErpConfig();
 			this.getKey();
 			this.getKey();
@@ -458,6 +274,17 @@
 		},
 		},
 		mounted: function() {},
 		mounted: function() {},
 		methods: {
 		methods: {
+			changeBm(res) {
+				console.log(res);
+				this.formItem.main_department = res[res.length -1 ]
+				this.formItem.department = [this.formItem.main_department]
+			},
+			getDepartmentList() {
+				getDepartmentList().then(res => {
+					console.log(res);
+					this.departmentList = res.data
+				})
+			},
 			userSearchs() {
 			userSearchs() {
 				// this.orderData.page = 1;
 				// this.orderData.page = 1;
 				// this.searchList();
 				// this.searchList();
@@ -521,34 +348,34 @@
 			},
 			},
 			clearFrom() {
 			clearFrom() {
 				this.goodsList = [];
 				this.goodsList = [];
-				this.formItem = {
-					cate_id: [],
-					id: 0,
-					store_account: '',
-					store_password: "",
-					image: '',
-					erp_shop_id: 0,
-					name: '',
-					introduction: '',
-					phone: '',
-					is_show: 1,
-					day_time: [],
-					is_store: 0,
-					address: '',
-					detailed_address: '',
-					latitude: '',
-					longitude: '',
-					province: 0,
-					city: 0,
-					area: 0,
-					street: 0,
-					addressSelect: [],
-					valid_range: 0,
-					product_verify_status: 0,
-					product_status: 1,
-					type: 1,
-					applicable_type: 1
-				}
+				// this.formItem = {
+				// 	cate_id: [],
+				// 	id: 0,
+				// 	store_account: '',
+				// 	store_password: "",
+				// 	image: '',
+				// 	erp_shop_id: 0,
+				// 	name: '',
+				// 	introduction: '',
+				// 	phone: '',
+				// 	is_show: 1,
+				// 	day_time: [],
+				// 	is_store: 0,
+				// 	address: '',
+				// 	detailed_address: '',
+				// 	latitude: '',
+				// 	longitude: '',
+				// 	province: 0,
+				// 	city: 0,
+				// 	area: 0,
+				// 	street: 0,
+				// 	addressSelect: [],
+				// 	valid_range: 0,
+				// 	product_verify_status: 0,
+				// 	product_status: 1,
+				// 	type: 1,
+				// 	applicable_type: 1
+				// }
 				this.add = 0;
 				this.add = 0;
 				this.isApi = 0;
 				this.isApi = 0;
 			},
 			},
@@ -651,13 +478,13 @@
 			// 选择图片
 			// 选择图片
 			modalPicTap() {
 			modalPicTap() {
 				this.modalPic = true;
 				this.modalPic = true;
-				this.$refs.formItem.validateField("image")
+				this.$refs.formItem.validateField("avatar")
 			},
 			},
 			// 选中图片
 			// 选中图片
 			getPic(pc) {
 			getPic(pc) {
-				this.formItem.image = pc.att_dir;
+				this.formItem.avatar = pc.att_dir;
 				this.modalPic = false;
 				this.modalPic = false;
-				this.$refs.formItem.validateField("image")
+				this.$refs.formItem.validateField("avatar")
 			},
 			},
 			// 营业时间
 			// 营业时间
 			onchangeTime(e) {
 			onchangeTime(e) {
@@ -667,24 +494,12 @@
 			handleSubmit(name) {
 			handleSubmit(name) {
 				this.$refs[name].validate((valid) => {
 				this.$refs[name].validate((valid) => {
 					if (valid) {
 					if (valid) {
-						if (this.formItem.day_time[0] == '') {
-							this.formItem.day_time = ['00:00:00', '23:59:59']
-						}
-						if (this.formItem.valid_range == '' || this.formItem.valid_range < 0) {
-							return this.$Message.error('请输入有效的门店范围');
-						}
-						let product_id = []
-						this.goodsList.forEach(item => {
-							product_id.push(item.product_id)
-						})
-						this.formItem.product_id = product_id;
-						// this.formItem.valid_range = this.formItem.valid_range/1000
-						storeUpdateApi(this.formItem.id, 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;
-							this.$parent.getList();
-							// this.$refs[name].resetFields();
-							this.clearFrom();
+							this.$emit('success')
+							// this.clearFrom();
 						}).catch(res => {
 						}).catch(res => {
 							this.$Message.error(res.msg);
 							this.$Message.error(res.msg);
 						})
 						})

+ 396 - 0
src/pages/store/department/create.vue

@@ -0,0 +1,396 @@
+<template>
+	<div class="form-submit">
+		<div class="i-layout-page-header">
+			<PageHeader class="product_tabs" hidden-breadcrumb>
+				<div slot="title">
+					<router-link :to="{ path: `${roterPre}/store/department/index` }">
+						<div class="font-sm after-line">
+							<span class="iconfont iconfanhui"></span>
+							<span class="pl10">返回</span>
+						</div>
+					</router-link>
+					<span v-text="$route.query.id ? '编辑部门' : '添加部门'" class="mr20 ml16"></span>
+				</div>
+			</PageHeader>
+		</div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Form :model="formData" :label-width="150">
+				<FormItem label="部门名称" required>
+					<Input v-model="formData.name" v-width="320" placeholder="请输入部门名称"></Input>
+				</FormItem>
+				<FormItem label="部门名称(英文)" required>
+					<Input v-model="formData.name_en" v-width="320" placeholder="请输入部门名称"></Input>
+				</FormItem>
+				<FormItem label="上级部门">
+					<el-cascader placeholder="请选择上级部门" :options="departmentList" :value="formData.parentid"
+						v-width="320" :props="{ checkStrictly: true,value: 'department_id',label: 'name' }"
+						clearable @change="changeBm"></el-cascader>
+				</FormItem>
+				<FormItem label="部门领导">
+					<Input v-model="formData.department_leader" v-width="320" placeholder="请输入部门名称"></Input>
+				</FormItem>
+				<FormItem label="排序">
+					<InputNumber v-model="formData.srot" v-width="320"></InputNumber>
+					</InputNumber>
+				</FormItem>
+
+			</Form>
+			<div style="width: 500px; display: flex;justify-content: center;">
+				<Button type="primary" class="submission" @click="save" :disabled="disabled">保存</Button>
+			</div>
+		</Card>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from "vuex";
+	import storeList from "@/components/storeList";
+	import goodsList from "@/components/goodsList/index";
+	import {
+		couponCategoryApi,
+		couponSaveApi,
+		couponDetailApi,
+		VipEditApi,
+		serveAddApi
+	} from "@/api/marketing";
+	import {
+		brandList
+	} from "@/api/product";
+	import {
+		getDepartmentList,
+		addDepartment,
+		editDepartment
+	} from '@/api/store'
+	// import { formatDate } from '@/utils/validate';
+	import Setting from "@/setting";
+	export default {
+		name: "storeCouponCreate",
+		components: {
+			goodsList,
+			storeList
+		},
+		data() {
+			return {
+				id: '',
+				roterPre: Setting.roterPre,
+				disabled: false,
+				storesList: [],
+				formData: {
+					name: '',
+					name_en: '',
+					department_leader: '',
+					srot: 0,
+					parentid: 1
+				},
+				isMinPrice: 0,
+				isCouponTime: 1,
+				isReceiveTime: 0,
+				modals: false,
+				datetime1: [],
+				datetime2: [],
+				storeModals: false,
+				currentTab: '1',
+				departmentList: [],
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+		},
+		created() {
+			// 获取部门列表
+			this.getDepartmentList()
+			if (this.$route.query.id) {
+				let data = this.$route.query
+				this.formData = {
+					id: data.id*1,
+					name: data.name,
+					name_en: data.name_en,
+					department_leader: data.department_leader,
+					srot: data.srot,
+					parentid: data.parentid*1,
+					department_id: data.department_id*1
+				}
+
+				// this.getCouponDetail();
+			}
+		},
+		methods: {
+			changeBm(res) {
+				console.log(res);
+				this.formData.parentid = res[res.length -1 ]
+			},
+			getDepartmentList() {
+				getDepartmentList().then(res => {
+					console.log(res);
+					this.departmentList = res.data
+				})
+			},
+			downTab() {
+				if (!this.formData.name) {
+					return this.$Message.error("请输入部门名称");
+				}
+				if (!this.formData.name_en) {
+					return this.$Message.error("请输入部门名称(英文)");
+				}
+			},
+			// 创建
+			save() {
+				this.downTab();
+				console.log('这');
+				if(this.formData.id) {
+					editDepartment(this.formData).then(res => {
+						this.disabled = true;
+						this.$Message.success(res.msg);
+						setTimeout(() => {
+							this.$router.push({
+								path: this.roterPre + "/store/department/index",
+							});
+						}, 1000);
+					}).catch((err) => {
+							this.$Message.error(err.msg);
+							this.disabled = false;
+						});
+				}else {
+					addDepartment(this.formData)
+						.then((res) => {
+							this.disabled = true;
+							this.$Message.success(res.msg);
+							setTimeout(() => {
+								this.$router.push({
+									path: this.roterPre + "/store/department/index",
+								});
+							}, 1000);
+						})
+						.catch((err) => {
+							this.$Message.error(err.msg);
+							this.disabled = false;
+						});
+				}
+				
+			},
+			// 使用有效期--时间段
+			dateChange(time) {
+				this.formData.start_use_time = time[0];
+				this.formData.end_use_time = time[1];
+			},
+			// 限时
+			timeChange(time) {
+				this.formData.start_time = time[0];
+				this.formData.end_time = time[1];
+			},
+			//对象数组去重;
+			unique(arr) {
+				const res = new Map();
+				return arr.filter(
+					(arr) => !res.has(arr.product_id) && res.set(arr.product_id, 1)
+				);
+			},
+			// 选择的商品
+			getProductId(productList) {
+				this.modals = false;
+				this.productList = this.unique(this.productList.concat(productList));
+				this.formData.product_id = "";
+				this.productList.forEach((value) => {
+					if (this.formData.product_id) {
+						this.formData.product_id += `,${value.product_id}`;
+					} else {
+						this.formData.product_id += `${value.product_id}`;
+					}
+				});
+			},
+			cancel() {
+				this.modals = false;
+			},
+			// 删除商品
+			remove(productId) {
+				for (let index = 0; index < this.productList.length; index++) {
+					if (this.productList[index].product_id == productId) {
+						this.productList.splice(index, 1);
+					}
+				}
+				this.formData.product_id = "";
+				this.productList.forEach((value) => {
+					if (this.formData.product_id) {
+						this.formData.product_id += `,${value.product_id}`;
+					} else {
+						this.formData.product_id += `${value.product_id}`;
+					}
+				});
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.tips {
+		display: inline-bolck;
+		font-size: 12px;
+		font-weight: 400;
+		color: #999999;
+		margin-top: 10px;
+	}
+
+	.imgPic {
+		.info {
+			width: 60%;
+			margin-left: 10px;
+		}
+
+		.pictrue {
+			height: 36px;
+			margin: 7px 3px 0 3px;
+
+			img {
+				height: 100%;
+				display: block;
+			}
+		}
+	}
+
+	.productType {
+		width: 120px;
+		height: 60px;
+		background: #FFFFFF;
+		border-radius: 3px;
+		border: 1px solid #E7E7E7;
+		float: left;
+		text-align: center;
+		padding-top: 8px;
+		position: relative;
+		cursor: pointer;
+		line-height: 23px;
+		margin-right: 12px;
+
+		&.on {
+			border-color: #1890FF;
+		}
+
+		.name {
+			font-size: 14px;
+			font-weight: 600;
+			color: rgba(0, 0, 0, 0.85);
+
+			&.on {
+				color: #1890FF;
+			}
+		}
+
+		.title {
+			font-size: 12px;
+			font-weight: 400;
+			color: #999999;
+		}
+
+		.jiao {
+			position: absolute;
+			bottom: 0;
+			right: 0;
+			width: 0;
+			height: 0;
+			border-bottom: 26px solid #1890FF;
+			border-left: 26px solid transparent;
+		}
+
+		.iconfont {
+			position: absolute;
+			bottom: -3px;
+			right: 1px;
+			color: #FFFFFF;
+			font-size: 12px;
+		}
+	}
+
+	.info {
+		color: #888;
+		font-size: 12px;
+	}
+
+	.ivu-input-wrapper {
+		width: 320px;
+	}
+
+	.ivu-input-number {
+		width: 160px;
+	}
+
+	.ivu-date-picker {
+		width: 320px;
+	}
+
+	.ivu-icon-ios-camera-outline {
+		width: 58px;
+		height: 58px;
+		border: 1px dotted rgba(0, 0, 0, 0.1);
+		border-radius: 4px;
+		background-color: rgba(0, 0, 0, 0.02);
+		line-height: 58px;
+		cursor: pointer;
+		vertical-align: middle;
+	}
+
+	.upload-list {
+		width: 58px;
+		height: 58px;
+		border: 1px dotted rgba(0, 0, 0, 0.1);
+		border-radius: 4px;
+		margin-right: 15px;
+		display: inline-block;
+		position: relative;
+		cursor: pointer;
+		vertical-align: middle;
+	}
+
+	.upload-list img {
+		display: block;
+		width: 100%;
+		height: 100%;
+	}
+
+	.ivu-icon-ios-close-circle {
+		position: absolute;
+		top: 0;
+		right: 0;
+		transform: translate(50%, -50%);
+	}
+
+	.form-submit {
+		/deep/.ivu-card {
+			border-radius: 0;
+		}
+
+		margin-bottom: 79px;
+
+		.fixed-card {
+			position: fixed;
+			right: 0;
+			bottom: 0;
+			left: 200px;
+			z-index: 99;
+			box-shadow: 0 -1px 2px rgb(240, 240, 240);
+
+			/deep/ .ivu-card-body {
+				padding: 15px 16px 14px;
+			}
+
+			.ivu-form-item {
+				margin-bottom: 0;
+			}
+
+			/deep/ .ivu-form-item-content {
+				margin-right: 124px;
+				text-align: center;
+			}
+
+			.ivu-btn {
+				height: 36px;
+				padding: 0 20px;
+			}
+		}
+	}
+
+	/deep/.vxe-tree-cell {
+		padding-left: 0 !important;
+	}
+</style>

+ 248 - 0
src/pages/store/department/index.vue

@@ -0,0 +1,248 @@
+<template>
+	<!-- 权限规则 -->
+	<div>
+		<!-- <Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
+			<div class="new_card_pd">
+          <Form
+          ref="roleData"
+          inline
+          :model="roleData"
+          :label-width="labelWidth"
+          :label-position="labelPosition"
+          @submit.native.prevent
+         >
+          <FormItem label="规则状态:">
+              <Select
+                v-model="roleData.is_show"
+                placeholder="请选择"
+                clearable
+                class="input-add"
+              >
+                <Option value="1">显示</Option>
+                <Option value="0">不显示</Option>
+              </Select>
+            </FormItem>
+         <FormItem label="按钮名称:" prop="status2" label-for="status2">
+            <Input
+              v-model="roleData.keyword"
+              placeholder="请输入按钮名称"
+              class="input-add mr14"
+            />
+            <Button @click="getData()" type="primary">查询</Button>
+          </FormItem>
+      </Form>
+			</div>
+		</Card> -->
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Button v-auth="['setting-system_menus-add']" type="primary" @click="menusAdd('添加部门')">添加部门</Button>
+			<vxe-table :border="false" class="ivu-mt" highlight-hover-row highlight-current-row :loading="loading"
+				ref="xTable" row-id="id" header-row-class-name="false"
+				:tree-config="{ children: 'children',reserve:true }" :data="tableData">
+				<vxe-table-column field="department_id" title="ID" tooltip max-width="70"></vxe-table-column>
+				<vxe-table-column field="name" tree-node title="部门名称" min-width="200"></vxe-table-column>
+				<vxe-table-column
+		  field="srot"
+		  tree-node
+		  title="排序"
+		  min-width="200"
+		></vxe-table-column>
+				<!-- <vxe-table-column field="api_url" title="接口路径" min-width="150">
+          <template v-slot="{ row }">
+            <span>{{
+              row.methods
+                ? "[" + row.methods + "]  " + row.api_url
+                : row.api_url
+            }}</span>
+          </template>
+        </vxe-table-column>
+        <vxe-table-column
+          field="unique_auth"
+          title="前端权限"
+          min-width="300"
+        ></vxe-table-column>
+        <vxe-table-column
+          field="menu_path"
+          title="页面路由"
+          min-width="240"
+          tooltip="true"
+        ></vxe-table-column>
+        <vxe-table-column field="flag" title="规则状态" min-width="120">
+          <template v-slot="{ row }">
+           <i-switch
+						  v-if="row.auth_type==1"
+              v-model="row.is_show"
+              :value="row.is_show"
+              :true-value="1"
+              :false-value="0"
+              @on-change="onchangeIsShow(row)"
+              size="large"
+            >
+              <span slot="open">显示</span>
+              <span slot="close">隐藏</span>
+            </i-switch>
+          </template>
+        </vxe-table-column> -->
+				<vxe-table-column field="date" title="操作" align="center" width="200" fixed="right">
+					<template v-slot="{ row }">
+						<a @click="edit(row, '编辑')">编辑</a>
+						<Divider type="vertical" />
+						<a @click="del(row, '删除部门')">删除</a>
+					</template>
+				</vxe-table-column>
+			</vxe-table>
+		</Card>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from "vuex";
+	import {
+		getTable,
+		menusDetailsApi,
+		isShowApi,
+		editMenus
+	} from "@/api/systemMenus";
+	import {
+		getDepartmentList,
+		delDepartment
+	} from "@/api/store"
+	import formCreate from "@form-create/iview";
+		import Setting from "@/setting";
+	export default {
+		name: "systemMenus",
+		data() {
+			return {
+				roterPre: Setting.roterPre,
+				spinShow: false,
+				grid: {
+					xl: 7,
+					lg: 7,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				roleData: {
+					is_show: "",
+					keyword: "",
+				},
+				loading: false,
+				tableData: [],
+				FromData: null,
+				icons: "",
+				formValidate: {},
+				titleFrom: "",
+				modalTitleSs: "",
+			};
+		},
+		components: {
+			formCreate: formCreate.$form()
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		mounted() {
+			// this.formValidate.auth_type = '1';
+			this.getData();
+		},
+		methods: {
+			// 修改规则状态
+			onchangeIsShow(row) {
+				let data = {
+					id: row.id,
+					is_show: row.is_show,
+				};
+				isShowApi(data)
+					.then(async (res) => {
+						this.$Message.success(res.msg);
+						this.$store.dispatch("admin/menus/getMenusNavList");
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 请求列表
+			getList() {
+				this.formValidate = Object.assign({}, this.$options.data().formValidate);
+				this.getData();
+			},
+			selectRule(data) {
+				this.formValidate.menu_name = data.real_name;
+				this.formValidate.methods = data.method;
+				this.formValidate.api_url = data.rule;
+			},
+			// 清除表单数据
+			clearFrom() {
+				this.formValidate = Object.assign({}, this.$options.data().formValidate);
+			},
+			// 删除
+			del(row, tit) {
+				let delfromData = {
+					title: tit,
+					url: `/work/deleteDepartment?id=` + row.id + '&department_id=' + row.department_id,
+					method: "post"
+				};
+				this.$modalSure(delfromData)
+					.then((res) => {
+						this.$Message.success(res.msg);
+						this.getData();
+						this.$store.dispatch("admin/menus/getMenusNavList");
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 规则详情
+			menusDetails(id) {
+				menusDetailsApi(id)
+					.then(async (res) => {
+						this.formValidate = res.data;
+						this.$refs.menusFrom.modals = true;
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 编辑
+			edit(row, title, index) {
+				this.$router.push({
+					path: this.roterPre + "/store/department/create?id=" + row.id + '&name=' + row.name + '&name_en=' + row.name_en + '&srot=' + row.srot + '&department_leader=' + row.department_leader + '&parentid=' + row.parentid + '&department_id=' + row.department_id
+				});
+			},
+			// 添加
+			menusAdd(title) {
+				this.$router.push({
+					path: this.roterPre + "/store/department/create"
+				});
+			},
+			// 列表
+			getData() {
+				this.loading = true;
+				this.roleData.is_show = this.roleData.is_show || "";
+				getDepartmentList(this.roleData)
+					.then(async (res) => {
+						this.tableData = res.data;
+						this.loading = false;
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			// 关闭按钮
+			cancel() {
+				this.$emit("onCancel");
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+</style>

+ 29 - 24
src/pages/store/staff/index.vue

@@ -25,8 +25,8 @@
 			<div class="table">
 			<div class="table">
 				<Table :columns="columns" :data="orderList" ref="table" class="ivu-mt" :loading="loading" highlight-row
 				<Table :columns="columns" :data="orderList" ref="table" class="ivu-mt" :loading="loading" highlight-row
 					no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
 					no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
-					<template slot-scope="{ row }" slot="image">
-						<img :src="row.image" />
+					<template slot-scope="{ row }" slot="avatar">
+						<img :src="row.avatar" />
 					</template>
 					</template>
 					<template slot-scope="{ row, index }" slot="action">
 					<template slot-scope="{ row, index }" slot="action">
 						<!-- <a @click="gostore(row)">进入门店</a>
 						<!-- <a @click="gostore(row)">进入门店</a>
@@ -37,7 +37,7 @@
 						<Divider type="vertical" /> -->
 						<Divider type="vertical" /> -->
 						<a @click="edit(row)">编辑</a>
 						<a @click="edit(row)">编辑</a>
 						<Divider type="vertical" />
 						<Divider type="vertical" />
-						<a @click="delte(row, '删除门店(同步删除商品)', index)">删除</a>
+						<a @click="delte(row, '删除店员', index)">删除</a>
 					</template>
 					</template>
 				</Table>
 				</Table>
 				<div class="acea-row row-right page">
 				<div class="acea-row row-right page">
@@ -46,7 +46,7 @@
 				</div>
 				</div>
 			</div>
 			</div>
 		</Card>
 		</Card>
-		<add-staff ref="template"></add-staff>
+		<add-staff ref="template" @success="addsuccess" :staffInfo="staffInfo"></add-staff>
 	</div>
 	</div>
 </template>
 </template>
 
 
@@ -60,7 +60,8 @@
 		storeLogin,
 		storeLogin,
 		storeSetShowApi,
 		storeSetShowApi,
 		resetApi,
 		resetApi,
-		staffListInfo
+		staffListInfo,
+		getYgList
 	} from "@/api/store";
 	} from "@/api/store";
 	export default {
 	export default {
 		name: "storeList",
 		name: "storeList",
@@ -69,6 +70,7 @@
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
+				staffInfo: {},
 				staffData: [],
 				staffData: [],
 				queryData:{
 				queryData:{
 				  page: 1,
 				  page: 1,
@@ -94,41 +96,40 @@
 						width: 60,
 						width: 60,
 					},
 					},
 					{
 					{
-						title: "门店图片",
-						slot: "image",
+						title: "头像",
+						slot: "avatar",
 						minWidth: 80,
 						minWidth: 80,
 					},
 					},
 					{
 					{
-						title: "门店名称",
+						title: "姓名",
+						key: "alias",
+						minWidth: 80,
+					},
+					{
+						title: "别名",
 						key: "name",
 						key: "name",
 						minWidth: 80,
 						minWidth: 80,
 					},
 					},
 					{
 					{
-						title: "门店分类",
-						key: "cate_name",
+						title: "职务",
+						key: "position",
 						minWidth: 80,
 						minWidth: 80,
 					},
 					},
 					{
 					{
 						title: "联系电话",
 						title: "联系电话",
-						key: "phone",
+						key: "mobile",
 						minWidth: 90,
 						minWidth: 90,
 					},
 					},
 					{
 					{
-						title: "门店地址",
+						title: "址",
 						key: "address",
 						key: "address",
-						ellipsis: true,
 						minWidth: 150,
 						minWidth: 150,
 					},
 					},
 					{
 					{
-						title: "营业时间",
-						key: "day_time",
+						title: "添加时间",
+						key: "create_time",
 						minWidth: 120,
 						minWidth: 120,
 					},
 					},
-					{
-						title: "营业状态",
-						key: "status_name",
-						minWidth: 80,
-					},
 					{
 					{
 						title: "操作",
 						title: "操作",
 						slot: "action",
 						slot: "action",
@@ -161,6 +162,9 @@
 			this.staffList()
 			this.staffList()
 		},
 		},
 		methods: {
 		methods: {
+			addsuccess() {
+				this.getList()
+			},
 			// 门店列表
 			// 门店列表
 			staffList() {
 			staffList() {
 				let data = {
 				let data = {
@@ -182,7 +186,7 @@
 			},
 			},
 			getList() {
 			getList() {
 				this.loading = true;
 				this.loading = true;
-				storeListApi(this.formValidate).then((res) => {
+				getYgList(this.formValidate).then((res) => {
 					this.orderList = res.data.list;
 					this.orderList = res.data.list;
 					this.total = res.data.count;
 					this.total = res.data.count;
 					this.loading = false;
 					this.loading = false;
@@ -202,7 +206,8 @@
 			edit(row) {
 			edit(row) {
 				this.$refs.template.title = "编辑店员";
 				this.$refs.template.title = "编辑店员";
 				this.$refs.template.isTemplate = true;
 				this.$refs.template.isTemplate = true;
-				this.$refs.template.getInfo(row.id);
+				// this.$refs.template.getInfo(row.id);
+				this.$refs.template.formItem = row
 			},
 			},
 			getExpiresTime(expiresTime) {
 			getExpiresTime(expiresTime) {
 				let nowTimeNum = Math.round(new Date() / 1000);
 				let nowTimeNum = Math.round(new Date() / 1000);
@@ -248,8 +253,8 @@
 				let delfromData = {
 				let delfromData = {
 					title: tit,
 					title: tit,
 					num: num,
 					num: num,
-					url: `store/store/del/${row.id}`,
-					method: "DELETE",
+					url: `work/delete?id=${row.id}&user_id=${row.uid}`,
+					method: "post",
 					ids: "",
 					ids: "",
 				};
 				};
 				this.$modalSure(delfromData)
 				this.$modalSure(delfromData)

+ 27 - 0
src/router/modules/marketing.js

@@ -595,5 +595,32 @@ export default {
 		    },
 		    },
 		    component: () => import('@/pages/marketing/serve/bind')
 		    component: () => import('@/pages/marketing/serve/bind')
 		},
 		},
+		{
+		    path: 'serve_item/index',
+		    name: `${pre}ServeIndex`,
+		    meta: {
+		        auth: ['admin-marketing-serve_item-index'],
+		        title: '服务项目列表'
+		    },
+		    component: () => import('@/pages/marketing/serveItem/index')
+		},
+		{
+		    path: 'serve_item/create',
+		    name: `${pre}ServeCreate`,
+		    meta: {
+		        auth: ['admin-marketing-serve_item-add'],
+		        title: '添加服务项目'
+		    },
+		    component: () => import('@/pages/marketing/serveItem/create')
+		},
+		{
+		    path: 'serve_item/bind',
+		    name: `${pre}ServeBind`,
+		    meta: {
+		        auth: ['admin-marketing-serve_item-bind'],
+		        title: '绑定项目'
+		    },
+		    component: () => import('@/pages/marketing/serveItem/bind')
+		},
     ]
     ]
 };
 };

+ 27 - 0
src/router/modules/store.js

@@ -131,5 +131,32 @@ export default {
 			},
 			},
 			component: () => import('@/components/fromSubmit/commonForm.vue')
 			component: () => import('@/components/fromSubmit/commonForm.vue')
 		},
 		},
+		{
+			path: 'department/index',
+			name: `${pre}department`,
+			meta: {
+				auth: ['admin-store-department'],
+				title: '部门列表'
+			},
+			component: () => import('@/pages/store/department/index')
+		},
+		{
+			path: 'department/create',
+			name: `${pre}departmentCreate`,
+			meta: {
+				auth: ['admin-store-department-create'],
+				title: '新增/修改部门'
+			},
+			component: () => import('@/pages/store/department/create')
+		},
+		{
+			path: 'checkGroup/index',
+			name: `${pre}checkGroupList`,
+			meta: {
+				auth: ['admin-store-checkGroup-index'],
+				title: '新增/修改部门'
+			},
+			component: () => import('@/pages/store/checkGroup/index')
+		},
 	]
 	]
 };
 };

+ 2 - 2
src/setting.js

@@ -12,10 +12,10 @@
  * */
  * */
 // 请求接口地址 如果没有配置自动获取当前网址路径
 // 请求接口地址 如果没有配置自动获取当前网址路径
 // const VUE_APP_API_URL = process.env.VUE_APP_API_URL || `${location.origin}/adminapi`;
 // const VUE_APP_API_URL = process.env.VUE_APP_API_URL || `${location.origin}/adminapi`;
-const VUE_APP_API_URL = 'http://wx.junhailan.com/adminapi'
+const VUE_APP_API_URL = 'https://wx.junhailan.com/adminapi'
 // 管理端ws
 // 管理端ws
 // const VUE_APP_WS_ADMIN_URL = process.env.VUE_APP_WS_ADMIN_URL || `ws:${location.hostname}/ws`
 // const VUE_APP_WS_ADMIN_URL = process.env.VUE_APP_WS_ADMIN_URL || `ws:${location.hostname}/ws`
-const VUE_APP_WS_ADMIN_URL = 'ws:wx.junhailan.com/ws'
+const VUE_APP_WS_ADMIN_URL = 'wss:wx.junhailan.com/ws'
 // 路由前缀
 // 路由前缀
 const roterPre = '/admin'
 const roterPre = '/admin'
 // 客服路由前缀
 // 客服路由前缀