lhl hai 1 ano
pai
achega
60ba85836d

+ 80 - 0
src/api/marketing.js

@@ -1281,4 +1281,84 @@ export function VipDeleteApi(id) {
         url: `/membership/deleteCard/${id}`,
         method: 'DELETE',
     });
+}
+
+//会员卡
+/**
+ * @param {*} data
+ * @returns
+ */
+export function ServeListApi(data) {
+    return request({
+        url: `/service/lst`,
+        method: 'post',
+		data
+    });
+}
+
+/**
+ * 修改服务卡
+ * @param {*} id
+ * @param {*} data
+ * @returns
+ */
+export function serveEditApi(id) {
+    return request({
+        url: `/service/edit/${id}`,
+        method: 'GET',
+    });
+}
+
+/**
+ * 添加服务卡
+ * @param {*} data
+ * @returns
+ */
+export function serveAddApi(data) {
+    return request({
+        url: `/service/addServiceCard`,
+        method: 'post',
+		data
+    });
+}
+
+//service/delete
+/**
+ * 删除服务卡
+ * @param {*} id
+ * @returns
+ */
+export function serveDelApi(id) {
+    return request({
+        url: `/service/delete/${id}`,
+        method: 'DELETE'
+    });
+}
+
+
+/**
+ * 服务卡绑定项目
+ * @param {*} id
+ * @param {*} data
+ * @returns
+ */
+export function bindServe(id,data) {
+    return request({
+        url: `/service/addServiceProject/${id}`,
+        method: 'post',
+		data
+    });
+}
+
+
+/**
+ * 服务卡项目信息
+ * @param {*} id
+ * @returns
+ */
+export function searchServe(id) {
+    return request({
+        url: `/service/getServiceProject/${id}`,
+        method: 'post'
+    });
 }

+ 461 - 0
src/pages/marketing/serve/bind.vue

@@ -0,0 +1,461 @@
+<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)" >删除</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>
+					        <div class="" v-else>
+								{{item.product_name}}
+					        </div>
+					    </div>
+					</FormItem>
+					<FormItem label="业绩值" required>
+						<Input v-model="item.performance_value" v-width="320" placeholder="请输入业绩值"></Input>
+					</FormItem>
+					<FormItem label="手工费" required>
+						<InputNumber  v-model="item.craft_price" v-width="320"></InputNumber>
+					</FormItem>
+					<FormItem label="销售提成" required>
+						<InputNumber  v-model="item.sales_commissions" v-width="320"></InputNumber>
+						</InputNumber>
+					</FormItem>
+					<FormItem label="库存量" required>
+						<InputNumber  v-model="item.repertory" v-width="320"></InputNumber>
+						</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"></goods-list>
+		</Modal>
+		<div style="width: 500px; display: flex;justify-content: center;">
+			<Button  type="primary" 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,
+		searchServe
+	} 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: [{
+					product_name: '',
+					product_id: 0,
+					performance_value: 0,
+					craft_price: 0,
+					sales_commissions: 0,
+					repertory: 0
+				}],
+				isMinPrice: 0,
+				isCouponTime: 1,
+				isReceiveTime: 0,
+				modals: false,
+				datetime1: [],
+				datetime2: [],
+				storeModals: false,
+				currentTab: '1',
+				current: {},
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+		},
+		created() {
+			console.log(this.$route.query);
+			if (this.$route.query.id) {
+				this.id = this.$route.query.id
+				console.log(this.id,'this.id');
+				this.getCouponDetail();
+			}
+		},
+		methods: {
+			getCouponDetail() {
+				// console.log();
+				searchServe(this.id).then(res => {
+					let arr = []
+					res.data.list.forEach(item => {
+						let data = {
+							product_name: item.store_name,
+							product_id: item.id,
+							performance_value: item.performance_value || 0,
+							craft_price: item.craft_price || 0,
+							sales_commissions: item.sales_commissions || 0,
+							repertory:item.repertory
+						}
+						arr.push(data)
+					})
+					this.formData = arr
+				})
+			},
+			// 选择商品
+			changeGoods(item) {
+			    this.modals = true;
+				this.current = item
+			},
+			addNewProject() {
+				console.log('dddddddddddddddddd');
+				try{
+					this.formData.push({
+					product_name: '',
+					product_id: 0,
+					performance_value: 0,
+					craft_price: 0,
+					sales_commissions: 0,
+					repertory: 0
+				})
+					// this.formData.concat(this.baseForm)
+					console.log(this.formData);
+				}catch(e){
+					console.log(e);
+					//TODO handle the exception
+				}
+			},
+			delNewProject(index) {
+				this.formData.splice(index,1)
+			},
+			// 商品id
+			getProductId(row) {
+				console.log(row,'这个');
+			    this.modal_loading = false;
+			    this.modals = false;
+			    setTimeout(() => {
+					this.current.product_id = row.id
+					this.current.product_name = row.store_name
+					// 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('这');
+				console.log(this.id);
+				bindServe(this.id,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)
+				);
+			},
+			// // 选择的商品
+			// 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; 
+		}
+	}
+</style>

+ 345 - 0
src/pages/marketing/serve/create.vue

@@ -0,0 +1,345 @@
+<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>
+					<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>
+					<span class="ml10">%</span>
+				</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 { 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: {
+					card_name: '',
+					repertory: '',
+					card_price: ''
+				},
+				isMinPrice: 0,
+				isCouponTime: 1,
+				isReceiveTime: 0,
+				modals: false,
+				datetime1: [],
+				datetime2: [],
+				storeModals: false,
+				currentTab: '1',
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+		},
+		created() {
+			if (this.$route.params.id) {
+				this.id = this.$route.params.id
+				// this.getCouponDetail();
+			}
+		},
+		methods: {
+			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)
+				);
+			},
+			// 选择的商品
+			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>

+ 284 - 0
src/pages/marketing/serve/index.vue

@@ -0,0 +1,284 @@
+<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_show" placeholder="请选择" clearable @on-change="userSearchs"
+							class="input-add">
+							<Option :value="1">显示</Option>
+							<Option :value="0">隐藏</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="服务卡名称:" label-for="coupon_title">
+						<Input v-model="tableFrom.field_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 | formatDate}}</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,
+		ServeListApi,
+		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_name',
+						minWidth: 80
+					},
+					{
+						title: '库存',
+						key: 'repertory',
+						minWidth: 100
+					},
+					{
+						title: '销售量',
+						key: 'sales_volume',
+						minWidth: 100
+					},
+					{
+						title: '是否显示',
+						slot: 'is_show',
+						minWidth: 100
+					},
+					{
+						title: '备注',
+						key: 'mark',
+						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
+				},
+				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());
+			},
+			// 删除
+			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;
+
+				ServeListApi(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>

+ 1 - 1
src/pages/marketing/vip/create.vue

@@ -92,7 +92,7 @@
 		created() {
 			if (this.$route.params.id) {
 				this.id = this.$route.params.id
-				this.getCouponDetail();
+				// this.getCouponDetail();
 			}
 		},
 		methods: {

+ 345 - 0
src/pages/product/serve/create.vue

@@ -0,0 +1,345 @@
+<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/vip/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>
+					<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>
+					<span class="ml10">%</span>
+				</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 { 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: {
+					card_name: '',
+					repertory: '',
+					card_price: ''
+				},
+				isMinPrice: 0,
+				isCouponTime: 1,
+				isReceiveTime: 0,
+				modals: false,
+				datetime1: [],
+				datetime2: [],
+				storeModals: false,
+				currentTab: '1',
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+		},
+		created() {
+			if (this.$route.params.id) {
+				this.id = this.$route.params.id
+				this.getCouponDetail();
+			}
+		},
+		methods: {
+			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)
+				);
+			},
+			// 选择的商品
+			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>

+ 276 - 0
src/pages/product/serve/index.vue

@@ -0,0 +1,276 @@
+<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_show" placeholder="请选择" clearable @on-change="userSearchs"
+							class="input-add">
+							<Option :value="1">显示</Option>
+							<Option :value="0">隐藏</Option>
+						</Select>
+					</FormItem> -->
+					<FormItem label="项目名称:" label-for="coupon_title">
+						<Input v-model="tableFrom.field_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 | 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 {
+		couponEditeApi,
+		couponSendApi,
+		ServeListApi,
+		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_name',
+						minWidth: 80
+					},
+					{
+						title: '库存',
+						key: 'repertory',
+						minWidth: 100
+					},
+					{
+						title: '销售量',
+						key: 'sales_volume',
+						minWidth: 100
+					},
+					// {
+					// 	title: '是否显示',
+					// 	slot: 'is_show',
+					// 	minWidth: 100
+					// },
+					// {
+					// 	title: '备注',
+					// 	key: 'mark',
+					// 	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
+				},
+				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(serveEditApi(row.id)).then(() => this.getList());
+			},
+			// 删除
+			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;
+
+				ServeListApi(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>

+ 0 - 1
src/router/index.js

@@ -57,7 +57,6 @@ router.beforeEach(async (to, from, next) => {
     const token = util.cookies.get("token");
     if (token && token !== "undefined") {
       const access = db.get("unique_auth").value();
-	  console.log(access,'to.meta.auth,to.meta.auth');
       const isPermission = includeArray(to.meta.auth, access);
       if (isPermission) {
         next();

+ 28 - 1
src/router/modules/marketing.js

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

+ 128 - 111
src/router/modules/product.js

@@ -13,118 +13,135 @@ import Setting from "@/setting";
 const pre = 'product_';
 
 export default {
-    path: `${Setting.roterPre}/product`,
-    name: 'product',
-    header: 'product',
-    meta: {
-        // 授权标识
-        auth: ['admin-store-index']
-    },
-    // redirect: {
-    //     name: `${pre}productList`
-    // },
-    component: BasicLayout,
-    children: [
-        {
-            path: 'product_list',
-            name: `${pre}productList`,
-            meta: {
-                title: '商品管理',
-                keepAlive:true,
-                scollTopPosition: 0,
-                auth: ['admin-store-storeProuduct-index']
-            },
-            component: () => import('@/pages/product/productList')
-        },
-        {
-            path: 'product_classify',
-            name: `${pre}productClassify`,
-            meta: {
-                title: '商品分类',
-                auth: ['admin-store-storeCategory-index']
-            },
-            component: () => import('@/pages/product/productClassify')
-        },
-        {
-            path: 'add_product/:id?',
-            name: `${pre}productAdd`,
-            meta: {
-                auth: ['admin-store-storeProuduct-index'],
-                title: '商品添加'
-            },
-            component: () => import('@/pages/product/productAdd')
-        },
-        {
-            path: 'product_reply/:id?',
-            name: `${pre}productEvaluate`,
-            meta: {
-                auth: ['admin-store-storeProuduct-index'],
-                title: '商品评论'
-            },
-            component: () => import('@/pages/product/productReply')
-        },
-        {
-            path: 'product_attr',
-            name: `${pre}productAttr`,
-            meta: {
-                auth: ['admin-store-storeProuduct-index'],
-                title: '商品规格'
-            },
-            component: () => import('@/pages/product/productAttr')
-        },
-        {
-            path: 'product_brand',
-            name: `${pre}productBrand`,
-            meta: {
-                auth: ['admin-store-storeBrand-index'],
-                title: '品牌管理'
-            },
-            component: () => import('@/pages/product/productBrand')
-        },
+	path: `${Setting.roterPre}/product`,
+	name: 'product',
+	header: 'product',
+	meta: {
+		// 授权标识
+		auth: ['admin-store-index']
+	},
+	// redirect: {
+	//     name: `${pre}productList`
+	// },
+	component: BasicLayout,
+	children: [{
+			path: 'product_list',
+			name: `${pre}productList`,
+			meta: {
+				title: '商品管理',
+				keepAlive: true,
+				scollTopPosition: 0,
+				auth: ['admin-store-storeProuduct-index']
+			},
+			component: () => import('@/pages/product/productList')
+		},
+		{
+			path: 'product_classify',
+			name: `${pre}productClassify`,
+			meta: {
+				title: '商品分类',
+				auth: ['admin-store-storeCategory-index']
+			},
+			component: () => import('@/pages/product/productClassify')
+		},
+		{
+			path: 'add_product/:id?',
+			name: `${pre}productAdd`,
+			meta: {
+				auth: ['admin-store-storeProuduct-index'],
+				title: '商品添加'
+			},
+			component: () => import('@/pages/product/productAdd')
+		},
+		{
+			path: 'product_reply/:id?',
+			name: `${pre}productEvaluate`,
+			meta: {
+				auth: ['admin-store-storeProuduct-index'],
+				title: '商品评论'
+			},
+			component: () => import('@/pages/product/productReply')
+		},
+		{
+			path: 'product_attr',
+			name: `${pre}productAttr`,
+			meta: {
+				auth: ['admin-store-storeProuduct-index'],
+				title: '商品规格'
+			},
+			component: () => import('@/pages/product/productAttr')
+		},
+		{
+			path: 'product_brand',
+			name: `${pre}productBrand`,
+			meta: {
+				auth: ['admin-store-storeBrand-index'],
+				title: '品牌管理'
+			},
+			component: () => import('@/pages/product/productBrand')
+		},
+		{
+			path: 'unitList',
+			name: `${pre}unitList`,
+			meta: {
+				auth: ['admin-storeProduct-unit'],
+				title: '商品单位'
+			},
+			component: () => import('@/pages/product/unitList')
+		},
+		{
+			path: 'label',
+			name: `${pre}label`,
+			meta: {
+				auth: ['admin-storeProduct-label'],
+				title: '商品标签'
+			},
+			component: () => import('@/pages/product/label')
+		},
+		{
+			path: 'specs',
+			name: `${pre}specs`,
+			meta: {
+				auth: ['admin-storeProduct-specs'],
+				title: '商品参数'
+			},
+			component: () => import('@/pages/product/specs')
+		},
+		{
+			path: 'ensure',
+			name: `${pre}ensure`,
+			meta: {
+				auth: ['admin-storeProduct-ensure'],
+				title: '保障服务'
+			},
+			component: () => import('@/pages/product/ensure')
+		},
+		{
+			path: 'ensure/create/:id?',
+			name: `${pre}ensureCreate`,
+			meta: {
+				auth: ['admin-storeProduct-ensure-create'],
+				title: '添加商品参数模板'
+			},
+			component: () => import('@/pages/product/specsAdd')
+		},
+		{
+		    path: 'serve/index',
+		    name: `${pre}ServeIndex`,
+		    meta: {
+		        auth: ['admin-product-serve-index'],
+		        title: '服务项目列表'
+		    },
+		    component: () => import('@/pages/product/serve/index')
+		},
 		{
-		    path: 'unitList',
-		    name: `${pre}unitList`,
+		    path: 'serve/create',
+		    name: `${pre}ServeCreate`,
 		    meta: {
-		        auth: ['admin-storeProduct-unit'],
-		        title: '商品单位'
+		        auth: ['admin-product-serve-add'],
+		        title: '添加服务项目'
 		    },
-		    component: () => import('@/pages/product/unitList')
+		    component: () => import('@/pages/product/serve/create')
 		},
-        {
-            path: 'label',
-            name: `${pre}label`,
-            meta: {
-                auth: ['admin-storeProduct-label'],
-                title: '商品标签'
-            },
-            component: () => import('@/pages/product/label')
-        },
-        {
-            path: 'specs',
-            name: `${pre}specs`,
-            meta: {
-                auth: ['admin-storeProduct-specs'],
-                title: '商品参数'
-            },
-            component: () => import('@/pages/product/specs')
-        },
-        {
-            path: 'ensure',
-            name: `${pre}ensure`,
-            meta: {
-                auth: ['admin-storeProduct-ensure'],
-                title: '保障服务'
-            },
-            component: () => import('@/pages/product/ensure')
-        },
-				{
-				    path: 'ensure/create/:id?',
-				    name: `${pre}ensureCreate`,
-				    meta: {
-				        auth: ['admin-storeProduct-ensure-create'],
-				        title: '添加商品参数模板'
-				    },
-				    component: () => import('@/pages/product/specsAdd')
-				},
-    ]
-};
+	]
+};

+ 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 = 'http://192.168.2.89/adminapi'
+const VUE_APP_API_URL = 'http://wx.junhailan.com/adminapi'
 // 管理端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:192.168.2.89/ws'
+const VUE_APP_WS_ADMIN_URL = 'ws:wx.junhailan.com/ws'
 // 路由前缀
 const roterPre = '/admin'
 // 客服路由前缀