lhl 1 éve
szülő
commit
28813be768

+ 3 - 3
.env.production

@@ -3,8 +3,8 @@ NODE_ENV=production
 VUE_APP_ENV='production'
 
 # 页面 title
-VUE_APP_TITLE=CRMEB
+VUE_APP_TITLE='君子堂'
 # socket 系统连接地址 (ws)或(wss)://www.crmeb.com(换成你的域名)/ws 非独立部署默认为空
-VUE_APP_WS_ADMIN_URL=''
+VUE_APP_WS_ADMIN_URL='ws://jzt.ns.liuniu946.com/ws'
 # 接口请求地址 (http)或 (https)://www.crmeb.com(换成你的域名)/adminapi 非独立部署默认为空
-VUE_APP_API_URL=''
+VUE_APP_API_URL='http://jzt.ns.liuniu946.com/adminapi'

+ 49 - 0
src/api/marketing.js

@@ -1232,4 +1232,53 @@ export function seckillSetStatus(row) {
 }
 
 
+/**
+ * 会员卡列表
+ * @param {*} params
+ * @returns
+ */
+export function vipListApi(data) {
+    return request({
+        url: `/membership/lstCard`,
+        method: 'post',
+		data
+    });
+}
+
+/**
+ * 添加会员卡
+ * @param {*} data
+ * @returns
+ */
+export function VipAddApi(data) {
+    return request({
+        url: `/membership/addCard`,
+        method: 'post',
+		data
+    });
+}
 
+/**
+ * 修改会员卡
+ * @param {*} id
+ * @param {*} data
+ * @returns
+ */
+export function VipEditApi(id) {
+    return request({
+        url: `/membership/editCard/${id}`,
+        method: 'GET',
+    });
+}
+
+/**
+ * 删除会员卡
+ * @param {*} id
+ * @returns
+ */
+export function VipDeleteApi(id) {
+    return request({
+        url: `/membership/deleteCard/${id}`,
+        method: 'DELETE',
+    });
+}

+ 2 - 2
src/components/copyright/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 底部企业logo -->
-  <GlobalFooter class="i-copyright" :links="links" :copyright="copyright" />
+  <!-- <GlobalFooter class="i-copyright" :links="links" :copyright="copyright" /> -->
 </template>
 <script>
 import { getCrmebCopyRight } from '@/api/system'
@@ -32,7 +32,7 @@ export default {
     }
   },
   mounted() {
-    this.getCopyRight()
+    // this.getCopyRight()
   },
   methods: {
     //获取版权信息

+ 8 - 1
src/pages/marketing/home/index.vue

@@ -113,7 +113,14 @@ export default {
           info:'引导开卡粘性更强',
           path:'/user/setup_user',
           type:'level'
-        }
+        },
+		{
+		  icon:'iconhuiyuanjihuo',
+		  name:'会员卡',
+		  info:'引导开卡粘性更强',
+		  path:'/user/setup_user',
+		  type:'level'
+		}
       ],
       markeInteract:[
         {

+ 353 - 0
src/pages/marketing/vip/create.vue

@@ -0,0 +1,353 @@
+<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.member_name" v-width="320" placeholder="请输入会员卡名称"></Input>
+				</FormItem>
+				<FormItem label="会员卡等级" required>
+					<InputNumber :min="1" :max="100000000" v-model="formData.grade" v-width="320"></InputNumber>
+				</FormItem>
+				<FormItem label="会员卡手工费折扣" required>
+					<InputNumber :min="0" :max="100" :precision="0" v-model="formData.craft_ratio" v-width="320">
+					</InputNumber>
+					<span class="ml10">%</span>
+				</FormItem>
+				<FormItem label="折扣" required>
+					<InputNumber :min="0" :max="100" :precision="0" v-model="formData.discount_ratio" v-width="320">
+					</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,
+		VipAddApi
+	} 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: {
+					grade: 1,
+					member_name: '',
+					discount_ratio: 0,
+					craft_ratio: 0,
+				},
+				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.member_name) {
+					return this.$Message.error("请输入优惠券名称");
+				}
+				if (!this.formData.discount_ratio) {
+					return this.$Message.error("请输入折扣");
+				}
+				if (!this.formData.grade) {
+					return this.$Message.error("请输入会员卡等级");
+				}
+				if (!this.formData.craft_ratio) {
+					return this.$Message.error("请输入会员卡等级");
+				}
+			},
+			// 创建
+			save() {
+				this.downTab();
+				VipAddApi(this.formData)
+					.then((res) => {
+						this.disabled = true;
+						this.$Message.success(res.msg);
+						setTimeout(() => {
+							this.$router.push({
+								path: this.roterPre + "/marketing/vip/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>

+ 229 - 0
src/pages/marketing/vip/index.vue

@@ -0,0 +1,229 @@
+<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 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: 'member_name',
+                        minWidth: 150
+                    },
+                    {
+                        title: '等级',
+                        key: 'grade',
+                        minWidth: 80
+                    },
+                    {
+                        title: '手工费折扣',
+                        key: 'craft_ratio',
+                        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;
+                
+                vipListApi(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>

+ 781 - 0
src/pages/store/components/addStaff.vue

@@ -0,0 +1,781 @@
+<template>
+	<div>
+		<Modal v-model="isTemplate" scrollable footer-hide closable :title="title" :z-index="1" width="700"
+			@on-cancel="cancel">
+			<div class="article-manager">
+				<Card :bordered="false" dis-hover>
+					<Form ref="formItem" :model="formItem" :label-width="labelWidth" :label-position="labelPosition"
+						:rules="ruleValidate" @submit.native.prevent>
+						<Row type="flex" :gutter="24">
+							<Col span="24" v-if="openErp">
+							<Col v-bind="grid">
+							<FormItem label="erp门店:" prop="erp_shop_id">
+								<Button
+									@click="tapErp">{{formItem.erp_shop_id?formItem.erp_shop_id:"请选择erp门店"}}</Button>
+							</FormItem>
+							</Col>
+							</Col>
+							<Col span="24">
+							<Col v-bind="grid">
+							<FormItem label="所属门店:" prop="store_id">
+								<Select v-model="formItem.store_id" clearable filterable @on-change="userSearchs"
+									class="input-add">
+									<Option v-for="item in staffData" :value="item.id" :key="item.id">{{ item.name }}
+									</Option>
+								</Select>
+							</FormItem>
+							</Col>
+							</Col>
+							<Col span="24">
+							<Col v-bind="grid">
+							<FormItem label="头像:" prop="image">
+								<div class="picBox" @click="modalPicTap('单选')">
+									<div class="pictrue" v-if="formItem.image"><img v-lazy="formItem.image"></div>
+									<div class="upLoad" v-else>
+										<div class="iconfont">+</div>
+									</div>
+								</div>
+							</FormItem>
+							</Col>
+							</Col>
+							<Col span="24" v-if="formItem.id == 0">
+							<Col v-bind="grid">
+							<FormItem label="姓名:" prop="name" label-for="name">
+								<Input v-model="formItem.name" placeholder="请输入姓名" />
+							</FormItem>
+							</Col>
+							</Col>
+							<Col span="24">
+							<Col v-bind="grid">
+							<FormItem label="手机号:" label-for="phone" prop="phone">
+								<Input v-model="formItem.phone" placeholder="请输入门店手机号" />
+							</FormItem>
+							</Col>
+							</Col>
+							<Col span="24" class="mt20">
+							  <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">
+							<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>
+							</Col>
+							</Col>
+	<!-- 						<Col span="24" v-if="formItem.id == 0">
+							<Col v-bind="grid">
+							<FormItem label="账号:" prop="store_account" label-for="store_account">
+								<Input v-model="formItem.store_account" placeholder="请输入管理员账号" />
+							</FormItem>
+							</Col>
+							</Col> -->
+<!-- 							<Col span="24" v-if="formItem.id == 0">
+							<Col v-bind="grid">
+							<FormItem label="密码:" prop="store_password" label-for="store_password">
+								<Input type="password" v-model="formItem.store_password" placeholder="请输入管理员密码" />
+							</FormItem>
+							</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 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 style="justify-content: space-around;">
+							<Col>
+							<Button type="primary" class="btn"
+								@click="handleSubmit('formItem')">{{formItem.id!=0?'修改':'提交'}}</Button>
+							</Col>
+						</Row>
+						<Spin size="large" fix v-if="spinShow"></Spin>
+					</Form>
+				</Card>
+
+				<Modal v-model="modalPic" width="960px" scrollable footer-hide closable title='上传提货点logo'
+					:mask-closable="false" :z-index="1">
+					<uploadPictures :isChoice="isChoice" @getPic="getPic" :gridBtn="gridBtn" :gridPic="gridPic"
+						v-if="modalPic"></uploadPictures>
+				</Modal>
+				<Modal v-model="modalErp" width="700px" scrollable footer-hide closable title='erp门店'
+					:mask-closable="false" :z-index="1">
+					<erpList ref="refErp" @getProductId="getProductId"></erpList>
+				</Modal>
+			</div>
+		</Modal>
+		<Modal v-model="modals" title="商品列表" class="paymentFooter" scrollable width="900" :footer-hide="true">
+			<goods-list ref="goodslist" @getProductId="getGoodsId" v-if="modals" :ischeckbox="true" :isLive="true"
+				:storeType="1"></goods-list>
+		</Modal>
+	</div>
+</template>
+
+<script>
+	// import { keyApi} from '@/api/setting';
+	import goodsList from '@/components/goodsList'
+	import {
+		keyApi,
+		storeGetInfoApi,
+		cityApi,
+		storeUpdateApi,
+		cascaderList,
+		staffListInfo
+	} from '@/api/store';
+	import {
+		erpConfig
+	} from "@/api/erp";
+	// import { keyApi, storeUpdateApi, storeGetInfoApi, cityApi } from '@/api/setting';
+	import {
+		mapState
+	} from 'vuex';
+	import uploadPictures from '@/components/uploadPictures';
+	import erpList from './erpList.vue';
+	import Maps from '@/components/map/map.vue'
+	export default {
+		name: 'systemSt',
+		components: {
+			uploadPictures,
+			Maps,
+			erpList,
+			goodsList
+		},
+		props: {},
+		data() {
+			let validatePhone = (rule, value, callback) => {
+				if (!value) {
+					return callback(new Error('请填写手机号'));
+				} else if (!/^1[3456789]\d{9}$/.test(value)) {
+					callback(new Error('手机号格式不正确!'));
+				} else {
+					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门店'))
+				} else {
+					callback()
+				}
+			};
+			return {
+				staffData: [],
+				goodsList: [],
+				modals: false,
+				treeSelect: [],
+				modalErp: false,
+				openErp: false,
+				isTemplate: false,
+				title: '',
+				formItem: {
+					product_id: [],
+					cate_id: [],
+					id: 0,
+					erp_shop_id: 0,
+					store_account: '',
+					store_password: '',
+					image: '',
+					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
+				},
+				spinShow: false,
+				addresData: [],
+				ruleValidate: {
+					name: [{
+						required: true,
+						message: '请输入姓名',
+						trigger: 'blur'
+					}],
+					store_account: [{
+						required: true,
+						message: '请输入管理员账号',
+						trigger: 'blur'
+					}],
+					store_password: [{
+						required: true,
+						message: '请输入管理员密码',
+						trigger: 'blur'
+					}],
+					address: [{
+						required: true,
+						message: '请选择门店地址',
+						trigger: 'change'
+					}],
+					day_time: [{
+							required: true,
+							type: "array",
+							message: "请选择营业时间",
+							trigger: "change"
+						},
+						{
+							validator(rule, value, callback, source, options) {
+								if (value[0] === "") {
+									callback("时间不能为空");
+								}
+								callback(); //这个一定要有。不然无法验证通过
+							}
+						}
+					], //TimePicker-timerange,自定义的
+
+					phone: [{
+						required: true,
+						validator: validatePhone,
+						trigger: 'blur'
+					}],
+					detailed_address: [{
+						required: true,
+						message: '请输入详细地址',
+						trigger: 'blur'
+					}],
+					image: [{
+						required: true,
+						validator: validateUpload,
+						trigger: 'change'
+					}]
+				},
+				mapKey: '',
+				grid: {
+					xl: 20,
+					lg: 20,
+					md: 20,
+					sm: 24,
+					xs: 24
+				},
+				gridPic: {
+					xl: 6,
+					lg: 8,
+					md: 12,
+					sm: 12,
+					xs: 12
+				},
+				gridBtn: {
+					xl: 4,
+					lg: 8,
+					md: 8,
+					sm: 8,
+					xs: 8
+				},
+				modalPic: false,
+				isChoice: '单选',
+				pid: 0,
+				isApi: 0,
+				add: 0
+			}
+		},
+		created() {
+			this.goodsCategory();
+			this.getErpConfig();
+			this.getKey();
+			// this.getInfo();
+			let data = {
+				pid: 0
+			}
+			this.cityInfo(data);
+			this.staffList()
+		},
+		computed: {
+			...mapState('admin/layout', [
+				'isMobile'
+			]),
+			labelWidth() {
+				return this.isMobile ? undefined : 120;
+			},
+			labelPosition() {
+				return this.isMobile ? 'top' : 'right';
+			}
+		},
+		mounted: function() {},
+		methods: {
+			userSearchs() {
+				// this.orderData.page = 1;
+				// this.searchList();
+			},
+			// 门店列表
+			staffList() {
+				let data = {
+					page: 0,
+					limit: 0,
+				};
+				staffListInfo()
+					.then((res) => {
+						this.staffData = res.data;
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			//对象数组去重;
+			unique(arr) {
+				const res = new Map();
+				return arr.filter((arr) => !res.has(arr.product_id) && res.set(arr.product_id, 1))
+			},
+			getGoodsId(data) {
+				let list = this.goodsList.concat(data);
+				let uni = this.unique(list);
+				this.goodsList = uni;
+				this.$nextTick(res => {
+					setTimeout(() => {
+						this.modals = false
+					}, 300)
+				})
+			},
+			bindDelete(index) {
+				this.goodsList.splice(index, 1)
+			},
+			// 门店分类;
+			goodsCategory() {
+				cascaderList(1).then(res => {
+					this.treeSelect = res.data;
+				}).catch(res => {
+					this.$Message.error(res.msg);
+				})
+			},
+			getProductId(id) {
+				this.formItem.erp_shop_id = id;
+				this.modalErp = false;
+				this.$refs.formItem.validateField("erp_shop_id");
+			},
+			tapErp() {
+				this.$refs.refErp.currentid = this.formItem.erp_shop_id;
+				this.modalErp = true;
+				this.$refs.formItem.validateField("erp_shop_id");
+			},
+			getErpConfig() {
+				erpConfig().then(res => {
+					this.openErp = res.data.open_erp;
+				}).catch(err => {
+					this.$Message.error(err.msg);
+				})
+			},
+			clearFrom() {
+				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.add = 0;
+				this.isApi = 0;
+			},
+			cancel() {
+				this.isTemplate = false;
+				// this.$refs['formItem'].resetFields();
+				this.clearFrom();
+			},
+			addchack(e, selectedData) {
+				e.forEach((i, index) => {
+					if (index == 0) {
+						this.formItem.province = i
+					} else if (index == 1) {
+						this.formItem.city = i
+					} else if (index == 2) {
+						this.formItem.area = i
+					} else {
+						this.formItem.street = i
+					}
+				})
+				this.formItem.address = (selectedData.map(o => o.label)).join("/");
+			},
+			cityInfo(data) {
+				cityApi(data).then(res => {
+					this.addresData = res.data
+				})
+			},
+			loadData(item, callback) {
+				item.loading = true;
+				cityApi({
+					pid: item.value
+				}).then(res => {
+					item.children = res.data;
+					item.loading = false;
+					callback();
+				});
+			},
+			// 地图信息获取
+			getCoordinates(data) {
+				this.formItem.latitude = data.location.lat || 34.34127
+				this.formItem.longitude = data.location.lng || 108.93984
+				if (this.isApi) {
+					// // this.formItem.detailed_address = data.address
+					let components = data.addressComponents;
+					if (this.formItem.detailed_address.indexOf(components.street) == -1) {
+						this.formItem.detailed_address = data.address + (components.town ? components.town : '');
+					}
+				}
+			},
+			// 查找位置
+			onSearch() {
+				if (this.$refs.mapChild) {
+					this.$refs.mapChild.searchKeyword(this.formItem.detailed_address)
+				}
+			},
+			// key值
+			getKey() {
+				keyApi().then(res => {
+					this.mapKey = res.data.key
+				}).catch(res => {
+					this.$Message.error(res.msg)
+				})
+			},
+			// 详情
+			getInfo(id) {
+				let that = this;
+				that.$refs['formItem'].resetFields();
+				that.formItem.id = id;
+				that.spinShow = true;
+				storeGetInfoApi(id).then(res => {
+					this.isApi = 1;
+					let addressSelect = [];
+					this.formItem = res.data.info;
+					this.formItem.erp_shop_id = res.data.info.erp_shop_id || 0;
+					let a = []
+					a.push(res.data.info.day_start)
+					a.push(res.data.info.day_end)
+					this.formItem.day_time = a
+					if (res.data.info.province) {
+						addressSelect.push(res.data.info.province)
+					}
+					if (res.data.info.city) {
+						addressSelect.push(res.data.info.city)
+					}
+					if (res.data.info.area) {
+						addressSelect.push(res.data.info.area)
+					}
+					if (res.data.info.street) {
+						addressSelect.push(res.data.info.street)
+					}
+					this.$set(this.formItem, 'valid_range', (this.formItem.valid_range) / 1000)
+					this.formItem.addressSelect = addressSelect;
+					this.onSearch();
+					that.spinShow = false;
+				}).catch(function(res) {
+					that.spinShow = false;
+					that.$Message.error(res.msg);
+				})
+			},
+			// 选择图片
+			modalPicTap() {
+				this.modalPic = true;
+				this.$refs.formItem.validateField("image")
+			},
+			// 选中图片
+			getPic(pc) {
+				this.formItem.image = pc.att_dir;
+				this.modalPic = false;
+				this.$refs.formItem.validateField("image")
+			},
+			// 营业时间
+			onchangeTime(e) {
+				this.formItem.day_time = e;
+			},
+			// 提交
+			handleSubmit(name) {
+				this.$refs[name].validate((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 => {
+							this.$Message.success(res.msg);
+							this.isTemplate = false;
+							this.$parent.getList();
+							// this.$refs[name].resetFields();
+							this.clearFrom();
+						}).catch(res => {
+							this.$Message.error(res.msg);
+						})
+					} else {
+						return false;
+					}
+				})
+
+			}
+		}
+	}
+</script>
+
+<style scoped lang="stylus">
+	.tips {
+		display: inline-bolck;
+		font-size: 12px;
+		font-weight: 400;
+		color: #999;
+	}
+
+	.box {
+		display flex flex-wrap wrap .box-item {
+			position relative margin-right 20px width 60px height 60px margin-bottom 10px img {
+				width 100% height 100%
+			}
+
+			.icon {
+				position absolute;
+				top: -10px;
+				right -10px;
+			}
+		}
+
+		.upload-box {
+			width 60px height 60px margin-bottom 10px display flex align-items center justify-content center background #ccc
+		}
+	}
+
+	.map-sty {
+		width: 90%;
+		text-align: right;
+		margin: 0 0 0 10%;
+	}
+
+	/deep/.ivu-card-body {
+		padding 16px 0 0 0 !important;
+	}
+	.footer {
+		width 100%;
+		height 50px;
+		box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.05);
+		margin-top 50px;
+	}
+	.btn /deep/.ivu-btn-primary {
+		width 86px;
+	}
+	.btn {
+		margin-top: 20px;
+	}
+	.inputW {
+		width 400px;
+	}
+	.ivu-mt {
+		min-width 580px;
+	}
+	.picBox {
+		display: inline-block;
+		cursor: pointer;
+		.upLoad {
+			width: 58px;
+			height: 58px;
+			line-height: 58px;
+			border: 1px dotted rgba(0, 0, 0, 0.1);
+			border-radius: 4px;
+			background: rgba(0, 0, 0, 0.02);
+		}
+		.pictrue {
+			width: 60px;
+			height: 60px;
+			border: 1px dotted rgba(0, 0, 0, 0.1);
+			margin-right: 10px;
+			img{
+				width: 100%;
+				height: 100%;
+			} 
+		}
+		.iconfont {
+			color: #CCCCCC;
+			font-size 26px;
+			text-align center;
+		}
+	}
+</style>

+ 914 - 992
src/pages/store/order/index.vue

@@ -1,211 +1,152 @@
 <template>
-<!-- 门店-门店订单 -->
-  <div>
-    <Card :bordered="false" dis-hover class="mt15 ivu-mt" :padding="0">
-      <div class="new_card_pd">
-        <!-- 查询条件 -->
-        <Form
-          ref="orderData"
-          :model="orderData"
-          :label-width="labelWidth"
-          :label-position="labelPosition"
-          class="tabform"
-          inline
-          @submit.native.prevent
-        >
-         <FormItem label="选择门店:">
-            <Select
-              v-model="orderData.store_id"
-              clearable
-              filterable
-              @on-change="userSearchs"
-             class="input-add"
-            >
-              <Option v-for="item in staffData" :value="item.id" :key="item.id"
-                >{{ item.name }}
-              </Option>
-            </Select>
-          </FormItem>
-          <FormItem label="创建时间:">
-            <DatePicker
-              :editable="false"
-              @on-change="onchangeTime"
-              :value="timeVal"
-              format="yyyy/MM/dd"
-              type="datetimerange"
-              placement="bottom-start"
-              placeholder="自定义时间"
-              class="input-add"
-              :options="options"
-            ></DatePicker>
-          </FormItem>
-          <FormItem v-if="currentTab == 4" label="会员类型:">
-            <Select
-              v-model="vipData.member_type"
-              clearable
-              @on-change="userSearchs"
-             class="input-add"
-            >
-              <Option
-                v-for="item in treeSelect"
-                :value="item.id"
-                :key="item.id"
-                >{{ item.label }}</Option
-              >
-            </Select>
-          </FormItem>
-          <FormItem v-if="currentTab != 4" label="活动类型:">
-            <Select
-              v-model="orderData.type"
-             class="input-add"
-              clearable
-              placeholder="全部"
-            >
-              <Option value="0">普通订单</Option>
-              <Option value="1">秒杀订单</Option>
-              <Option value="2">砍价订单</Option>
-              <Option value="3">拼团订单</Option>
-              <Option value="4">套餐订单</Option>
-              <Option value="8">预售订单</Option>
-              <Option value="9">新人订单</Option>
-              <Option value="10">抽奖订单</Option>
-              <Option value="11">拼单订单</Option>
-              <Option value="12">桌码订单</Option>
-            </Select>
-          </FormItem>
-          
-           <FormItem label="订单状态:">
-            <Select v-model="orderData.status"  class="input-add">
-              <Option value="">全部</Option>
-              <Option value="0">未支付</Option>
-              <Option value="1">待配送</Option>
-              <Option value="2">配送中</Option>
-              <Option value="3">待评价</Option>
-              <Option value="5">待核销</Option>
-              <Option value="6">已核销</Option>
-              <Option value="4">已完成</Option>
-              <Option value="-4">已删除</Option>
-            </Select>
-          </FormItem>
-          <FormItem
-            label="订单搜索:"
-            label-for="real_name"
-            v-if="currentTab == 6 || currentTab == 7 || currentTab == 5"
-          >
-            <Input
-              placeholder="订单号/商品名称"
-              v-model="orderData.real_name"
-               class="input-add"
-            />
-          </FormItem>
-          <FormItem
-            label="用户搜索:"
-            label-for="nickname"
-            v-if="currentTab == 3 || currentTab == 4"
-          >
-            <Input
-              placeholder="请输入用户名"
-              v-model="rechargeData.nickname"
-               class="input-add"
-            />
-          </FormItem>
-          <FormItem>
-            <Button type="primary" @click="orderSearch()" class="ml75">查询</Button>
-          </FormItem>
-        </Form>
-      </div>
-    </Card>
-    <Card :bordered="false" dis-hover class="mt15 ivu-mt">
-      <!-- Tab栏切换 -->
-      <div class="new_tab">
-         <Tabs v-model="currentTab" @on-click="onClickTab">
-          <TabPane label="收银台订单" name="6" />
-          <TabPane label="配送订单" name="7" />
-          <TabPane label="核销订单" name="5" />
-          <TabPane label="充值订单" name="3" />
-          <TabPane label="付费会员订单" name="4" />
-        </Tabs>
-      </div>
-      <!-- 表格 -->
-      <Table
-        :columns="
+	<!-- 门店-门店订单 -->
+	<div>
+		<Card :bordered="false" dis-hover class="mt15 ivu-mt" :padding="0">
+			<div class="new_card_pd">
+				<!-- 查询条件 -->
+				<Form ref="orderData" :model="orderData" :label-width="labelWidth" :label-position="labelPosition"
+					class="tabform" inline @submit.native.prevent>
+					<FormItem label="选择门店:">
+						<Select v-model="orderData.store_id" clearable filterable @on-change="userSearchs"
+							class="input-add">
+							<Option v-for="item in staffData" :value="item.id" :key="item.id">{{ item.name }}
+							</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="创建时间:">
+						<DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal" format="yyyy/MM/dd"
+							type="datetimerange" placement="bottom-start" placeholder="自定义时间" class="input-add"
+							:options="options"></DatePicker>
+					</FormItem>
+					<FormItem v-if="currentTab == 4" label="会员类型:">
+						<Select v-model="vipData.member_type" clearable @on-change="userSearchs" class="input-add">
+							<Option v-for="item in treeSelect" :value="item.id" :key="item.id">{{ item.label }}</Option>
+						</Select>
+					</FormItem>
+					<FormItem v-if="currentTab != 4" label="活动类型:">
+						<Select v-model="orderData.type" class="input-add" clearable placeholder="全部">
+							<Option value="0">普通订单</Option>
+							<Option value="1">秒杀订单</Option>
+							<Option value="2">砍价订单</Option>
+							<Option value="3">拼团订单</Option>
+							<Option value="4">套餐订单</Option>
+							<Option value="8">预售订单</Option>
+							<Option value="9">新人订单</Option>
+							<Option value="10">抽奖订单</Option>
+							<Option value="11">拼单订单</Option>
+							<Option value="12">桌码订单</Option>
+						</Select>
+					</FormItem>
+
+					<FormItem label="订单状态:">
+						<Select v-model="orderData.status" class="input-add">
+							<Option value="">全部</Option>
+							<Option value="0">未支付</Option>
+							<Option value="1">待配送</Option>
+							<Option value="2">配送中</Option>
+							<Option value="3">待评价</Option>
+							<Option value="5">待核销</Option>
+							<Option value="6">已核销</Option>
+							<Option value="4">已完成</Option>
+							<Option value="-4">已删除</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="订单搜索:" label-for="real_name"
+						v-if="currentTab == 6 || currentTab == 7 || currentTab == 5">
+						<Input placeholder="订单号/商品名称" v-model="orderData.real_name" class="input-add" />
+					</FormItem>
+					<FormItem label="用户搜索:" label-for="nickname" v-if="currentTab == 3 || currentTab == 4">
+						<Input placeholder="请输入用户名" v-model="rechargeData.nickname" class="input-add" />
+					</FormItem>
+					<FormItem>
+						<Button type="primary" @click="orderSearch()" class="ml75">查询</Button>
+					</FormItem>
+				</Form>
+			</div>
+		</Card>
+		<Card :bordered="false" dis-hover class="mt15 ivu-mt">
+			<!-- Tab栏切换 -->
+			<div class="new_tab">
+				<Tabs v-model="currentTab" @on-click="onClickTab">
+					<TabPane label="收银台订单" name="6" />
+					<TabPane label="配送订单" name="7" />
+					<TabPane label="核销订单" name="5" />
+					<TabPane label="充值订单" name="3" />
+					<TabPane label="付费会员订单" name="4" />
+				</Tabs>
+			</div>
+			<!-- 表格 -->
+			<Table :columns="
           currentTab == 6 || currentTab == 7 || currentTab == 5
             ? columns
             : currentTab == 3
             ? rechargeColumns
             : vipColumns
-        "
-        :data="tableList"
-        ref="table"
-        :loading="loading"
-        highlight-row
-        no-userFrom-text="暂无数据"
-        no-filtered-userFrom-text="暂无筛选结果"
-      >
-        <template slot-scope="{ row }" slot="order_id">
-          <span v-text="row.order_id" style="display: block"></span>
-          <span v-show="row.is_del === 1" class="span-del"
-            >用户已删除</span
-          >
-        </template>
-        <template slot-scope="{ row }" slot="userInfo">
-          <div v-if="currentTab == 6 || currentTab == 7 || currentTab == 5">
-            <a @click="showUserInfo(row)" v-if="row.uid">
-              {{ row.nickname }}
-              <span class="ml5">/{{ row.uid }}</span>
-            </a>
-            <span v-else
-              >游客<span class="ml5">/{{ row.uid }}</span></span
-            >
-          </div>
-          <div class="tabBox" v-if="currentTab == 3">
-            <div class="tabBox_img" v-viewer>
-              <img v-lazy="row.avatar" />
-            </div>
-            <span class="tabBox_tit">{{ row.nickname }}</span>
-          </div>
-          <div class="tabBox" v-if="currentTab == 4 && row.user">
-            <div class="tabBox_img" v-viewer>
-              <img v-lazy="row.user.avatar" />
-            </div>
-            <span class="tabBox_tit">{{ row.user.nickname }}</span>
-          </div>
-        </template>
-        <template slot-scope="{ row }" slot="info">
-          <Tooltip theme="dark" max-width="300" :delay="600">
-            <div class="tabBox" v-for="(val, i) in row._info" :key="i">
-              <div class="tabBox_img" v-viewer>
-                <img
-                  v-lazy="
+        " :data="tableList" ref="table" :loading="loading" highlight-row no-userFrom-text="暂无数据"
+				no-filtered-userFrom-text="暂无筛选结果">
+				<template slot-scope="{ row }" slot="order_id">
+					<span v-text="row.order_id" style="display: block"></span>
+					<span v-show="row.is_del === 1" class="span-del">用户已删除</span>
+				</template>
+				<template slot-scope="{ row }" slot="userInfo">
+					<div v-if="currentTab == 6 || currentTab == 7 || currentTab == 5">
+						<a @click="showUserInfo(row)" v-if="row.uid">
+							{{ row.nickname }}
+							<span class="ml5">/{{ row.uid }}</span>
+						</a>
+						<span v-else>游客<span class="ml5">/{{ row.uid }}</span></span>
+					</div>
+					<div class="tabBox" v-if="currentTab == 3">
+						<div class="tabBox_img" v-viewer>
+							<img v-lazy="row.avatar" />
+						</div>
+						<span class="tabBox_tit">{{ row.nickname }}</span>
+					</div>
+					<div class="tabBox" v-if="currentTab == 4 && row.user">
+						<div class="tabBox_img" v-viewer>
+							<img v-lazy="row.user.avatar" />
+						</div>
+						<span class="tabBox_tit">{{ row.user.nickname }}</span>
+					</div>
+				</template>
+				<template slot-scope="{ row }" slot="info">
+					<Tooltip theme="dark" max-width="300" :delay="600">
+						<div class="tabBox" v-for="(val, i) in row._info" :key="i">
+							<div class="tabBox_img" v-viewer>
+								<img v-lazy="
                     val.cart_info.productInfo.attrInfo
                       ? val.cart_info.productInfo.attrInfo.image
                       : val.cart_info.productInfo.image
-                  "
-                />
-              </div>
-              <span class="info_title line1">
-                <span class="font-color-red" v-if="val.cart_info.is_gift" >赠品</span>
-                {{ val.cart_info.productInfo.store_name + " | " }}
-                {{val.cart_info.productInfo.attrInfo ? val.cart_info.productInfo.attrInfo.suk : ""}}
-              </span>
-              <!-- <span class="tabBox_pice"> {{ "¥" + val.cart_info.truePrice + " x " + val.cart_info.cart_num}}</span> -->
-            </div>
-            <div slot="content">
-              <div v-for="(val, i) in row._info" :key="i">
-                <p class="font-color-red" v-if="val.cart_info.is_gift">赠品</p>
-                <p>{{ val.cart_info.productInfo.store_name }}</p>
-                <p> {{val.cart_info.productInfo.attrInfo ? val.cart_info.productInfo.attrInfo.suk: ""}}</p>
-                <p class="tabBox_pice">{{ "¥" + val.cart_info.truePrice + " x " + val.cart_info.cart_num }}</p>
-              </div>
-            </div>
-          </Tooltip>
-        </template>
-        <template slot-scope="{ row }" slot="statusName">
-          <Tag color="red" size="medium" v-if="row.status_name && row.status == 0">{{row.status_name.status_name}}</Tag>
-          <Tag color="green" size="medium" v-if="row.status_name && row.status !== 0">{{row.status_name.status_name}}</Tag><br/>
-          <Tag color="orange" size="medium" v-if="!row.is_all_refund && row.refund.length">部分退款中</Tag>
-          <Tag color="orange" size="medium" v-if="row.is_all_refund && row.refund.length && row.refund_type != 6">退款中</Tag>
-          <!-- <div class="pictrue-box" v-if="row.status_name">
+                  " />
+							</div>
+							<span class="info_title line1">
+								<span class="font-color-red" v-if="val.cart_info.is_gift">赠品</span>
+								{{ val.cart_info.productInfo.store_name + " | " }}
+								{{val.cart_info.productInfo.attrInfo ? val.cart_info.productInfo.attrInfo.suk : ""}}
+							</span>
+							<!-- <span class="tabBox_pice"> {{ "¥" + val.cart_info.truePrice + " x " + val.cart_info.cart_num}}</span> -->
+						</div>
+						<div slot="content">
+							<div v-for="(val, i) in row._info" :key="i">
+								<p class="font-color-red" v-if="val.cart_info.is_gift">赠品</p>
+								<p>{{ val.cart_info.productInfo.store_name }}</p>
+								<p> {{val.cart_info.productInfo.attrInfo ? val.cart_info.productInfo.attrInfo.suk: ""}}
+								</p>
+								<p class="tabBox_pice">
+									{{ "¥" + val.cart_info.truePrice + " x " + val.cart_info.cart_num }}</p>
+							</div>
+						</div>
+					</Tooltip>
+				</template>
+				<template slot-scope="{ row }" slot="statusName">
+					<Tag color="red" size="medium" v-if="row.status_name && row.status == 0">
+						{{row.status_name.status_name}}</Tag>
+					<Tag color="green" size="medium" v-if="row.status_name && row.status !== 0">
+						{{row.status_name.status_name}}</Tag><br />
+					<Tag color="orange" size="medium" v-if="!row.is_all_refund && row.refund.length">部分退款中</Tag>
+					<Tag color="orange" size="medium"
+						v-if="row.is_all_refund && row.refund.length && row.refund_type != 6">退款中</Tag>
+					<!-- <div class="pictrue-box" v-if="row.status_name">
             <div
               v-viewer
               v-for="(item, index) in row.status_name.pics || []"
@@ -214,810 +155,791 @@
               <img class="pictrue mr10" v-lazy="item" :src="item" />
             </div>
           </div> -->
-        </template>
-        <template slot-scope="{ row }" slot="pay_price">
-          {{ row.paid > 0 ? row.pay_price : 0 }}
-        </template>
-        <template slot-scope="{ row }" slot="action">
-          <span v-if="currentTab == 6">
-            <a @click="detail(row)">订单详情</a>
-          </span>
-          <span v-if="currentTab == 7">
-            <a :disabled="openErp" v-if="row._status == 2" @click="distribution(row)">分配</a>
-            <Divider v-if="row._status == 2" type="vertical" />
-            <a @click="detail(row)">详情</a>
-            <!-- <Divider type="vertical" /> -->
-          </span>
-          <span v-if="currentTab == 5">
-            <a :disabled="openErp" v-if="row._status == 11" @click="distribution(row)">分配</a>
-            <Divider v-if="row._status == 11" type="vertical" />
-            <a @click="detail(row)">详情</a>
-          </span>
-          <a @click="remark(row)" v-if="currentTab == 3 || currentTab == 4"
-            >备注</a
-          >
-        </template>
-      </Table>
-      <div class="acea-row row-right page">
-        <Page
-          :total="total"
-          :current="orderData.page"
-          show-elevator
-          show-total
-          @on-change="pageChange"
-          :page-size="orderData.limit"
-        />
-      </div>
-    </Card>
-    <Distribution ref="distshow"></Distribution>
-    <!-- 用户详情-->
-    <user-details ref="userDetails" fromType="order"></user-details>
-    <!-- 编辑 配送信息表单数据 退款 退积分 不退款-->
-    <edit-from
-      ref="edits"
-      :FromData="FromData"
-      @submitFail="submitFail"
-    ></edit-from>
-    <!-- 详情 -->
-    <details-from
-      ref="detailss"
-      :orderDatalist="orderDatalist"
-      :orderId="orderId"
-      :row-active="rowActive"
-      :currentTab="currentTab"
-	  :openErp="openErp"
-    ></details-from>
-    <!-- 备注 -->
-    <order-remark
-      ref="remarks"
-      :orderId="orderId"
-      @submitFail="submitFail"
-    ></order-remark>
-    <!-- 记录 -->
-    <order-record ref="record"></order-record>
-    <!-- 发送货 -->
-    <order-send
-      ref="send"
-      :orderId="orderId"
-      :status="status"
-      :pay_type="pay_type"
-      @submitFail="submitFail"
-    >
-    </order-send>
-  </div>
+				</template>
+				<template slot-scope="{ row }" slot="pay_price">
+					{{ row.paid > 0 ? row.pay_price : 0 }}
+				</template>
+				<template slot-scope="{ row }" slot="action">
+					<span v-if="currentTab == 6">
+						<a @click="detail(row)">订单详情</a>
+					</span>
+					<span v-if="currentTab == 7">
+						<a :disabled="openErp" v-if="row._status == 2" @click="distribution(row)">分配</a>
+						<Divider v-if="row._status == 2" type="vertical" />
+						<a @click="detail(row)">详情</a>
+						<!-- <Divider type="vertical" /> -->
+					</span>
+					<span v-if="currentTab == 5">
+						<a :disabled="openErp" v-if="row._status == 11" @click="distribution(row)">分配</a>
+						<Divider v-if="row._status == 11" type="vertical" />
+						<a @click="detail(row)">详情</a>
+					</span>
+					<a @click="remark(row)" v-if="currentTab == 3 || currentTab == 4">备注</a>
+				</template>
+			</Table>
+			<div class="acea-row row-right page">
+				<Page :total="total" :current="orderData.page" show-elevator show-total @on-change="pageChange"
+					:page-size="orderData.limit" />
+			</div>
+		</Card>
+		<Distribution ref="distshow"></Distribution>
+		<!-- 用户详情-->
+		<user-details ref="userDetails" fromType="order"></user-details>
+		<!-- 编辑 配送信息表单数据 退款 退积分 不退款-->
+		<edit-from ref="edits" :FromData="FromData" @submitFail="submitFail"></edit-from>
+		<!-- 详情 -->
+		<details-from ref="detailss" :orderDatalist="orderDatalist" :orderId="orderId" :row-active="rowActive"
+			:currentTab="currentTab" :openErp="openErp"></details-from>
+		<!-- 备注 -->
+		<order-remark ref="remarks" :orderId="orderId" @submitFail="submitFail"></order-remark>
+		<!-- 记录 -->
+		<order-record ref="record"></order-record>
+		<!-- 发送货 -->
+		<order-send ref="send" :orderId="orderId" :status="status" :pay_type="pay_type" @submitFail="submitFail">
+		</order-send>
+	</div>
 </template>
 
 <script>
-import { mapState } from "vuex";
-import Distribution from "./components/distribution.vue";
-import expandRow from "./components/tableExpand.vue";
-import userDetails from "@/pages/user/list/handle/userDetails";
-import editFrom from "@/components/from/from";
-import orderSend from "./components/orderSend";
-import detailsFrom from "./components/orderDetails";
-import orderRecord from "./components/orderRecord";
-import orderRemark from "./components/orderRemark";
-import {
-  orderList,
-  orderChart,
-  orderHeader,
-  orderRecharge,
-  orderVip,
-  getOrdeDatas, //编辑表单数据
-  getDistribution,
-  writeUpdate,
-  getDataInfo,
-  orderExport,
-  staffListInfo,
-} from "@/api/store";
-import { erpConfig } from "@/api/erp";
-import timeOptions from "@/utils/timeOptions";
-import Setting from '@/setting'
-// import {
-// 	staffListInfo
-// } from '@/api/staff';
-export default {
-  name: "index",
-  components: {
-    userDetails,
-    editFrom,
-    detailsFrom,
-    orderRecord,
-    orderRemark,
-    orderSend,
-    expandRow,
-    Distribution,
-  },
-  data() {
-    return {
-      roterPre: Setting.roterPre,
-	  openErp:false,
-      distshow: false, //分配的弹窗
-      delfromData: {},
-      pay_type: "",
-      status: 0, //发货状态判断
-      FromData: null,
-      orderDatalist: null,
-      orderId: 0,
-      treeSelect: [
-        {
-          id: "free",
-          label: "试用",
-        },
-        {
-          id: "month",
-          label: "月卡",
-        },
-        {
-          id: "quarter",
-          label: "季卡",
-        },
-        {
-          id: "year",
-          label: "年卡",
-        },
-        {
-          id: "ever",
-          label: "永久",
-        },
-        {
-          id: "card",
-          label: "卡密激活",
-        },
-      ],
-      staffData: [],
-      tablists: {},
-      orderChartType: {},
-      options: timeOptions,
-      timeVal: [],
-      // 订单列表
-      orderData: {
-        page: 1,
-        limit: 10,
-        type: '',
-        status: "",
-        time: "",
-        real_name: "",
-        store_id: "",
-        order_type: 6,
-      },
-      // 充值订单搜索
-      rechargeData: {
-        nickname: "",
-        limit: 15,
-      },
-      // 会员订单搜索
-      vipData: {
-        member_type: "",
-        limit: 15,
-      },
-      currentTab: "6",
-      tableList: [],
-      total: 0,
-      loading: false,
-      rechargeColumns: [
-        {
-          title: "ID",
-          key: "id",
-          width: 60,
-        },
-        {
-          title: "订单号",
-          key: "order_id",
-          minWidth: 180,
-        },
-        {
-          title: "用户信息",
-          slot: "userInfo",
-          minWidth: 160,
-        },
-        {
-          title: "支付金额",
-          key: "price",
-          minWidth: 110,
-        },
-        {
-          title: "充值类型",
-          key: "_recharge_type",
-          minWidth: 100,
-        },
-        {
-          title: "支付时间",
-          key: "_pay_time",
-          minWidth: 130,
-        },
-        {
-          title: "关联店员",
-          key: "_recharge_type",
-          minWidth: 100,
-        },
-        {
-          title: "操作",
-          slot: "action",
-          fixed: "right",
-          minWidth: 200,
-          align: "center",
-        },
-      ],
-      vipColumns: [
-        {
-          title: "订单号",
-          key: "order_id",
-          minWidth: 180,
-        },
-        {
-          title: "用户信息",
-          slot: "userInfo",
-          minWidth: 180,
-        },
-        {
-          title: "会员类型",
-          key: "member_type",
-          minWidth: 100,
-        },
-        {
-          title: "有效期限(天)",
-          minWidth: 100,
-          render: (h, params) => {
-            return h(
-              "span",
-              params.row.vip_day === -1 ? "永久" : params.row.vip_day
-            );
-          },
-        },
-        {
-          title: "支付金额",
-          key: "pay_price",
-          minWidth: 100,
-        },
-        {
-          title: "支付方式",
-          key: "pay_type",
-          minWidth: 100,
-        },
-        {
-          title: "购买时间",
-          key: "pay_time",
-          minWidth: 130,
-        },
-        {
-          title: "关联店员",
-          key: "pay_time",
-          minWidth: 130,
-        },
-        {
-          title: "操作",
-          slot: "action",
-          fixed: "right",
-          minWidth: 200,
-          align: "center",
-        },
-      ],
-      columns: [
-        {
-          type: "expand",
-          width: 30,
-          render: (h, params) => {
-            return h(expandRow, {
-              props: {
-                row: params.row,
-              },
-            });
-          },
-        },
-        {
-          title: "订单号",
-          slot: "order_id",
-          minWidth: 160,
-        },
-        {
-          title: "用户信息",
-          slot: "userInfo",
-          minWidth: 120,
-        },
-        {
-          title: "商品信息",
-          slot: "info",
-          minWidth: 350,
-        },
-        {
-          title: "实际支付",
-          slot: "pay_price",
-          minWidth: 120,
-        },
-        {
-          title: "支付方式",
-          key: "pay_type_name",
-          minWidth: 120,
-        },
-        {
-          title: "收银店员",
-          key: "clerk_name",
-          minWidth: 120,
-        },
-        {
-          title: "下单时间",
-          key: "add_time",
-          minWidth: 150,
-        },
-        {
-          title: "订单状态",
-          slot: "statusName",
-          minWidth: 120,
-        },
-        {
-          title: "操作",
-          slot: "action",
-          fixed: "right",
-          minWidth: 200,
-          align: "center",
-        },
-      ],
-      rowActive: {},
-    };
-  },
-  computed: {
-    ...mapState("admin/layout", ["isMobile"]),
-    labelWidth() {
-      return this.isMobile ? undefined : 96;
-    },
-    labelPosition() {
-      return this.isMobile ? "top" : "right";
-    },
-  },
-  created() {
-	this.getErpConfig();
-    this.getTabs();
-    this.getChart();
-    this.staffList();
-    this.getList();
-  },
-  mounted() {},
-  methods: {
-	getErpConfig(){
-		erpConfig().then(res=>{
-			this.openErp = res.data.open_erp;
-		}).catch(err=>{
-			this.$Message.error(err.msg);
-		})
-	},  
-    remark(row) {
-      this.orderId = row.id;
-      this.$refs.remarks.modals = true;
-      switch (this.currentTab) {
-        case "3":
-        case "4":
-          this.$refs.remarks.currentTab(this.currentTab, row.remarks);
-          break;
-        default:
-          this.$refs.remarks.currentTab(this.currentTab, row.remark);
-      }
-    },
-    detail(row) {
-      this.orderId = row.id;
-      this.getData(row.id);
-      this.rowActive = row;
-    },
-    distribution(row) {
-      this.$refs.distshow.modals = true;
-      this.$refs.distshow.getList(row.id);
-    },
-    record(row) {
-      this.orderId = row.id;
-      this.$refs.record.modals = true;
-      this.$refs.record.getList(row.id);
-    },
-    // 查看子订单
-    splitOrderDetail(row) {
-      this.$router.push({
-        path: this.roterPre + "split_list",
-        query: {
-          id: row.id,
-        },
-      });
-    },
-    // 删除单条订单
-    delOrder(row, data) {
-      if (row.is_del === 1) {
-        this.$modalSure(data)
-          .then((res) => {
-            this.$Message.success(res.msg);
-            this.getList();
-          })
-          .catch((res) => {
-            this.$Message.error(res.msg);
-          });
-      } else {
-        const title = "错误!";
-        const content =
-          "<p>您选择的的订单存在用户未删除的订单,无法删除用户未删除的订单!</p>";
-        this.$Modal.error({
-          title: title,
-          content: content,
-        });
-      }
-    },
-    // 获取详情表单数据
-    getData(id, type) {
-      getDataInfo(id)
-        .then(async (res) => {
-          if (!type) {
-            this.$refs.detailss.modals = true;
-          }
-          this.$refs.detailss.activeName = "detail";
-          this.orderDatalist = res.data;
-          if (this.orderDatalist.orderInfo.refund_reason_wap_img) {
-            try {
-              this.orderDatalist.orderInfo.refund_reason_wap_img = JSON.parse(
-                this.orderDatalist.orderInfo.refund_reason_wap_img
-              );
-            } catch (e) {
-              this.orderDatalist.orderInfo.refund_reason_wap_img = [];
-            }
-          }
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg);
-        });
-    },
-    // 立即核销
-    bindWrite(row) {
-      let self = this;
-      this.$Modal.confirm({
-        title: "提示",
-        content: "确定要核销该订单吗?",
-        cancelText: "取消",
-        closable: true,
-        maskClosable: true,
-        onOk: function () {
-          writeUpdate(row.order_id).then((res) => {
-            self.$Message.success(res.msg);
-            self.getList();
-          });
-        },
-        onCancel: () => {},
-      });
-    },
-    // 配送信息表单数据
-    delivery(row) {
-      getDistribution(row.id)
-        .then(async (res) => {
-          this.FromData = res.data;
-          this.$refs.edits.modals = true;
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg);
-        });
-    },
-    // 编辑
-    edit(row) {
-      this.getOrderData(row.id);
-    },
-    // 获取编辑表单数据
-    getOrderData(id) {
-      getOrdeDatas(id)
-        .then(async (res) => {
-          if (res.data.status === false) {
-            return this.$authLapse(res.data);
-          }
-          this.$authLapse(res.data);
-          this.FromData = res.data;
-          this.$refs.edits.modals = true;
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg);
-        });
-    },
-    // 修改成功(编辑只有未支付时出现)
-    submitFail() {
-      this.status = 0;
-      if (this.currentTab == 3) {
-        this.getRecharge();
-      } else if (this.currentTab == 4) {
-        this.getVipOrder();
-      } else {
-        this.getList();
-        this.getData(this.orderId, 1);
-      }
-    },
-    // 发送货
-    sendOrder(row) {
-      this.$store.commit("admin/order/setSplitOrder", row.total_num);
-      this.$refs.send.modals = true;
-      this.orderId = row.id;
-      this.status = row._status;
-      this.pay_type = row.pay_type;
-      this.$refs.send.getList();
-      this.$refs.send.getDeliveryList();
-      this.$nextTick((e) => {
-        this.$refs.send.getCartInfo(row._status, row.id);
-      });
-    },
-    // 详情
-    showUserInfo(row) {
-      this.$refs.userDetails.modals = true;
-      this.$refs.userDetails.activeName = "info";
-      this.$refs.userDetails.getDetails(row.uid);
-    },
-    // 初始化数据
-    clearData() {
-      this.orderData = {
-        page: 1,
-        limit: 15,
-        type: '',
-        status: "",
-        time: "",
-        real_name: "",
-        store_id: "",
-        order_type: 6,
-      };
-      this.rechargeData = {
-        nickname: "",
-        limit: 15,
-      };
-      this.vipData = {
-        member_type: "",
-        limit: 15,
-      };
-    },
-    // 店员列表
-    staffList() {
-      let data = {
-        page: 0,
-        limit: 0,
-      };
-      staffListInfo()
-        .then((res) => {
-          this.staffData = res.data;
-        })
-        .catch((err) => {
-          this.$Message.error(err.msg);
-        });
-    },
-    // 获取门店订单头部统计
-    getTabs() {
-      orderHeader()
-        .then((res) => {
-          this.tablists = res.data;
-        })
-        .catch((err) => {
-          this.$Message.error(err.msg);
-        });
-    },
-    // 订单头部数据
-    getChart() {
-      orderChart({ type: this.currentTab })
-        .then((res) => {
-          this.orderChartType = res.data;
-        })
-        .catch((err) => {
-          this.$Message.error(err.msg);
-        });
-    },
-    // 编辑
-    edit(row) {
-      this.getOrderData(row.id);
-    },
-    //点击切换头部
-    onClickTab() {
-      this.clearData();
-      this.orderData.order_type = this.currentTab;
-      this.orderData.page = 1;
-      this.timeVal = [];
-      this.getChart();
-      this.searchList();
-    },
-    // 不同类型订单调用列表;
-    searchList() {
-      if (this.currentTab == 3) {
-        this.getRecharge();
-      } else if (this.currentTab == 4) {
-        this.getVipOrder();
-      } else {
-        this.getList();
-      }
-    },
-    // 搜索店员或店员选择
-    userSearchs() {
-      this.orderData.page = 1;
-      this.searchList();
-    },
-    // 切换订单状态
-    selectStatus() {
-      this.orderData.page = 1;
-      this.getList();
-    },
-    // 付费会员订单列表
-    getVipOrder() {
-      this.loading = true;
-      this.tableList = [];
-      this.vipData.name = this.rechargeData.nickname;
-      this.vipData.add_time = this.orderData.time;
-      this.vipData.store_id = this.orderData.store_id;
-      this.vipData.page = this.orderData.page;
-      orderVip(this.vipData)
-        .then((res) => {
-          let data = res.data;
-          this.tableList = data.list;
-          this.total = data.count;
-          this.loading = false;
-        })
-        .catch((err) => {
-          this.loading = false;
-          this.$Message.error(err.msg);
-        });
-    },
-    // 充值订单
-    getRecharge() {
-      this.loading = true;
-      this.tableList = [];
-      this.rechargeData.data = this.orderData.time;
-      this.rechargeData.store_id = this.orderData.store_id;
-      this.rechargeData.page = this.orderData.page;
-      orderRecharge(this.rechargeData)
-        .then((res) => {
-          let data = res.data;
-          this.tableList = data.list;
-          this.total = data.count;
-          this.loading = false;
-        })
-        .catch((err) => {
-          this.loading = false;
-          this.$Message.error(err.msg);
-        });
-    },
-    // 一般订单
-    getList() {
-      this.loading = true;
-      this.tableList = [];
-      orderList(this.orderData)
-        .then((res) => {
-          let data = res.data;
-          data.data.forEach((item) => {
-            if (item.id == this.orderId) {
-              this.rowActive = item;
-            }
-          });
-          this.tableList = data.data;
-          this.total = data.count;
-          this.loading = false;
-        })
-        .catch((err) => {
-          this.loading = false;
-          this.$Message.error(err.msg);
-        });
-    },
-    pageChange(index) {
-      this.orderData.page = index;
-      this.searchList();
-    },
-    // 搜索
-    orderSearch() {
-      this.orderData.page = 1;
-      this.searchList();
-    },
-    // 具体日期
-    onchangeTime(e) {
-      this.timeVal = e;
-      this.orderData.time = this.timeVal[0] ? this.timeVal.join("-") : "";
-      this.orderData.page = 1;
-      if (!e[0]) {
-        this.orderData.time = "";
-      }
-      this.searchList();
-    },
-    // 选择时间
-    selectChange() {
-      this.orderData.page = 1;
-      this.timeVal = [];
-      this.searchList();
-    },
-    getExcelData(excelData) {
-      return new Promise((resolve, reject) => {
-        let type = 1;
-        if (
-          this.currentTab == 6 ||
-          this.currentTab == 7 ||
-          this.currentTab == 5
-        ) {
-          type = 1;
-        } else if (this.currentTab == 3) {
-          type = 2;
-        } else {
-          type = 3;
-        }
-        orderExport(excelData, type).then((res) => {
-          return resolve(res.data);
-        });
-      });
-    },
-  },
-};
+	import {
+		mapState
+	} from "vuex";
+	import Distribution from "./components/distribution.vue";
+	import expandRow from "./components/tableExpand.vue";
+	import userDetails from "@/pages/user/list/handle/userDetails";
+	import editFrom from "@/components/from/from";
+	import orderSend from "./components/orderSend";
+	import detailsFrom from "./components/orderDetails";
+	import orderRecord from "./components/orderRecord";
+	import orderRemark from "./components/orderRemark";
+	import {
+		orderList,
+		orderChart,
+		orderHeader,
+		orderRecharge,
+		orderVip,
+		getOrdeDatas, //编辑表单数据
+		getDistribution,
+		writeUpdate,
+		getDataInfo,
+		orderExport,
+		staffListInfo,
+	} from "@/api/store";
+	import {
+		erpConfig
+	} from "@/api/erp";
+	import timeOptions from "@/utils/timeOptions";
+	import Setting from '@/setting'
+	// import {
+	// 	staffListInfo
+	// } from '@/api/staff';
+	export default {
+		name: "index",
+		components: {
+			userDetails,
+			editFrom,
+			detailsFrom,
+			orderRecord,
+			orderRemark,
+			orderSend,
+			expandRow,
+			Distribution,
+		},
+		data() {
+			return {
+				roterPre: Setting.roterPre,
+				openErp: false,
+				distshow: false, //分配的弹窗
+				delfromData: {},
+				pay_type: "",
+				status: 0, //发货状态判断
+				FromData: null,
+				orderDatalist: null,
+				orderId: 0,
+				treeSelect: [{
+						id: "free",
+						label: "试用",
+					},
+					{
+						id: "month",
+						label: "月卡",
+					},
+					{
+						id: "quarter",
+						label: "季卡",
+					},
+					{
+						id: "year",
+						label: "年卡",
+					},
+					{
+						id: "ever",
+						label: "永久",
+					},
+					{
+						id: "card",
+						label: "卡密激活",
+					},
+				],
+				staffData: [],
+				tablists: {},
+				orderChartType: {},
+				options: timeOptions,
+				timeVal: [],
+				// 订单列表
+				orderData: {
+					page: 1,
+					limit: 10,
+					type: '',
+					status: "",
+					time: "",
+					real_name: "",
+					store_id: "",
+					order_type: 6,
+				},
+				// 充值订单搜索
+				rechargeData: {
+					nickname: "",
+					limit: 15,
+				},
+				// 会员订单搜索
+				vipData: {
+					member_type: "",
+					limit: 15,
+				},
+				currentTab: "6",
+				tableList: [],
+				total: 0,
+				loading: false,
+				rechargeColumns: [{
+						title: "ID",
+						key: "id",
+						width: 60,
+					},
+					{
+						title: "订单号",
+						key: "order_id",
+						minWidth: 180,
+					},
+					{
+						title: "用户信息",
+						slot: "userInfo",
+						minWidth: 160,
+					},
+					{
+						title: "支付金额",
+						key: "price",
+						minWidth: 110,
+					},
+					{
+						title: "充值类型",
+						key: "_recharge_type",
+						minWidth: 100,
+					},
+					{
+						title: "支付时间",
+						key: "_pay_time",
+						minWidth: 130,
+					},
+					{
+						title: "关联店员",
+						key: "_recharge_type",
+						minWidth: 100,
+					},
+					{
+						title: "操作",
+						slot: "action",
+						fixed: "right",
+						minWidth: 200,
+						align: "center",
+					},
+				],
+				vipColumns: [{
+						title: "订单号",
+						key: "order_id",
+						minWidth: 180,
+					},
+					{
+						title: "用户信息",
+						slot: "userInfo",
+						minWidth: 180,
+					},
+					{
+						title: "会员类型",
+						key: "member_type",
+						minWidth: 100,
+					},
+					{
+						title: "有效期限(天)",
+						minWidth: 100,
+						render: (h, params) => {
+							return h(
+								"span",
+								params.row.vip_day === -1 ? "永久" : params.row.vip_day
+							);
+						},
+					},
+					{
+						title: "支付金额",
+						key: "pay_price",
+						minWidth: 100,
+					},
+					{
+						title: "支付方式",
+						key: "pay_type",
+						minWidth: 100,
+					},
+					{
+						title: "购买时间",
+						key: "pay_time",
+						minWidth: 130,
+					},
+					{
+						title: "关联店员",
+						key: "pay_time",
+						minWidth: 130,
+					},
+					{
+						title: "操作",
+						slot: "action",
+						fixed: "right",
+						minWidth: 200,
+						align: "center",
+					},
+				],
+				columns: [{
+						type: "expand",
+						width: 30,
+						render: (h, params) => {
+							return h(expandRow, {
+								props: {
+									row: params.row,
+								},
+							});
+						},
+					},
+					{
+						title: "订单号",
+						slot: "order_id",
+						minWidth: 160,
+					},
+					{
+						title: "用户信息",
+						slot: "userInfo",
+						minWidth: 120,
+					},
+					{
+						title: "商品信息",
+						slot: "info",
+						minWidth: 350,
+					},
+					{
+						title: "实际支付",
+						slot: "pay_price",
+						minWidth: 120,
+					},
+					{
+						title: "支付方式",
+						key: "pay_type_name",
+						minWidth: 120,
+					},
+					{
+						title: "收银店员",
+						key: "clerk_name",
+						minWidth: 120,
+					},
+					{
+						title: "下单时间",
+						key: "add_time",
+						minWidth: 150,
+					},
+					{
+						title: "订单状态",
+						slot: "statusName",
+						minWidth: 120,
+					},
+					{
+						title: "操作",
+						slot: "action",
+						fixed: "right",
+						minWidth: 200,
+						align: "center",
+					},
+				],
+				rowActive: {},
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			this.getErpConfig();
+			this.getTabs();
+			this.getChart();
+			this.staffList();
+			this.getList();
+		},
+		mounted() {},
+		methods: {
+			getErpConfig() {
+				erpConfig().then(res => {
+					this.openErp = res.data.open_erp;
+				}).catch(err => {
+					this.$Message.error(err.msg);
+				})
+			},
+			remark(row) {
+				this.orderId = row.id;
+				this.$refs.remarks.modals = true;
+				switch (this.currentTab) {
+					case "3":
+					case "4":
+						this.$refs.remarks.currentTab(this.currentTab, row.remarks);
+						break;
+					default:
+						this.$refs.remarks.currentTab(this.currentTab, row.remark);
+				}
+			},
+			detail(row) {
+				this.orderId = row.id;
+				this.getData(row.id);
+				this.rowActive = row;
+			},
+			distribution(row) {
+				this.$refs.distshow.modals = true;
+				this.$refs.distshow.getList(row.id);
+			},
+			record(row) {
+				this.orderId = row.id;
+				this.$refs.record.modals = true;
+				this.$refs.record.getList(row.id);
+			},
+			// 查看子订单
+			splitOrderDetail(row) {
+				this.$router.push({
+					path: this.roterPre + "split_list",
+					query: {
+						id: row.id,
+					},
+				});
+			},
+			// 删除单条订单
+			delOrder(row, data) {
+				if (row.is_del === 1) {
+					this.$modalSure(data)
+						.then((res) => {
+							this.$Message.success(res.msg);
+							this.getList();
+						})
+						.catch((res) => {
+							this.$Message.error(res.msg);
+						});
+				} else {
+					const title = "错误!";
+					const content =
+						"<p>您选择的的订单存在用户未删除的订单,无法删除用户未删除的订单!</p>";
+					this.$Modal.error({
+						title: title,
+						content: content,
+					});
+				}
+			},
+			// 获取详情表单数据
+			getData(id, type) {
+				getDataInfo(id)
+					.then(async (res) => {
+						if (!type) {
+							this.$refs.detailss.modals = true;
+						}
+						this.$refs.detailss.activeName = "detail";
+						this.orderDatalist = res.data;
+						if (this.orderDatalist.orderInfo.refund_reason_wap_img) {
+							try {
+								this.orderDatalist.orderInfo.refund_reason_wap_img = JSON.parse(
+									this.orderDatalist.orderInfo.refund_reason_wap_img
+								);
+							} catch (e) {
+								this.orderDatalist.orderInfo.refund_reason_wap_img = [];
+							}
+						}
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 立即核销
+			bindWrite(row) {
+				let self = this;
+				this.$Modal.confirm({
+					title: "提示",
+					content: "确定要核销该订单吗?",
+					cancelText: "取消",
+					closable: true,
+					maskClosable: true,
+					onOk: function() {
+						writeUpdate(row.order_id).then((res) => {
+							self.$Message.success(res.msg);
+							self.getList();
+						});
+					},
+					onCancel: () => {},
+				});
+			},
+			// 配送信息表单数据
+			delivery(row) {
+				getDistribution(row.id)
+					.then(async (res) => {
+						this.FromData = res.data;
+						this.$refs.edits.modals = true;
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 编辑
+			edit(row) {
+				this.getOrderData(row.id);
+			},
+			// 获取编辑表单数据
+			getOrderData(id) {
+				getOrdeDatas(id)
+					.then(async (res) => {
+						if (res.data.status === false) {
+							return this.$authLapse(res.data);
+						}
+						this.$authLapse(res.data);
+						this.FromData = res.data;
+						this.$refs.edits.modals = true;
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 修改成功(编辑只有未支付时出现)
+			submitFail() {
+				this.status = 0;
+				if (this.currentTab == 3) {
+					this.getRecharge();
+				} else if (this.currentTab == 4) {
+					this.getVipOrder();
+				} else {
+					this.getList();
+					this.getData(this.orderId, 1);
+				}
+			},
+			// 发送货
+			sendOrder(row) {
+				this.$store.commit("admin/order/setSplitOrder", row.total_num);
+				this.$refs.send.modals = true;
+				this.orderId = row.id;
+				this.status = row._status;
+				this.pay_type = row.pay_type;
+				this.$refs.send.getList();
+				this.$refs.send.getDeliveryList();
+				this.$nextTick((e) => {
+					this.$refs.send.getCartInfo(row._status, row.id);
+				});
+			},
+			// 详情
+			showUserInfo(row) {
+				this.$refs.userDetails.modals = true;
+				this.$refs.userDetails.activeName = "info";
+				this.$refs.userDetails.getDetails(row.uid);
+			},
+			// 初始化数据
+			clearData() {
+				this.orderData = {
+					page: 1,
+					limit: 15,
+					type: '',
+					status: "",
+					time: "",
+					real_name: "",
+					store_id: "",
+					order_type: 6,
+				};
+				this.rechargeData = {
+					nickname: "",
+					limit: 15,
+				};
+				this.vipData = {
+					member_type: "",
+					limit: 15,
+				};
+			},
+			// 店员列表
+			staffList() {
+				let data = {
+					page: 0,
+					limit: 0,
+				};
+				staffListInfo()
+					.then((res) => {
+						this.staffData = res.data;
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			// 获取门店订单头部统计
+			getTabs() {
+				orderHeader()
+					.then((res) => {
+						this.tablists = res.data;
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			// 订单头部数据
+			getChart() {
+				orderChart({
+						type: this.currentTab
+					})
+					.then((res) => {
+						this.orderChartType = res.data;
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			// 编辑
+			edit(row) {
+				this.getOrderData(row.id);
+			},
+			//点击切换头部
+			onClickTab() {
+				this.clearData();
+				this.orderData.order_type = this.currentTab;
+				this.orderData.page = 1;
+				this.timeVal = [];
+				this.getChart();
+				this.searchList();
+			},
+			// 不同类型订单调用列表;
+			searchList() {
+				if (this.currentTab == 3) {
+					this.getRecharge();
+				} else if (this.currentTab == 4) {
+					this.getVipOrder();
+				} else {
+					this.getList();
+				}
+			},
+			// 搜索店员或店员选择
+			userSearchs() {
+				this.orderData.page = 1;
+				this.searchList();
+			},
+			// 切换订单状态
+			selectStatus() {
+				this.orderData.page = 1;
+				this.getList();
+			},
+			// 付费会员订单列表
+			getVipOrder() {
+				this.loading = true;
+				this.tableList = [];
+				this.vipData.name = this.rechargeData.nickname;
+				this.vipData.add_time = this.orderData.time;
+				this.vipData.store_id = this.orderData.store_id;
+				this.vipData.page = this.orderData.page;
+				orderVip(this.vipData)
+					.then((res) => {
+						let data = res.data;
+						this.tableList = data.list;
+						this.total = data.count;
+						this.loading = false;
+					})
+					.catch((err) => {
+						this.loading = false;
+						this.$Message.error(err.msg);
+					});
+			},
+			// 充值订单
+			getRecharge() {
+				this.loading = true;
+				this.tableList = [];
+				this.rechargeData.data = this.orderData.time;
+				this.rechargeData.store_id = this.orderData.store_id;
+				this.rechargeData.page = this.orderData.page;
+				orderRecharge(this.rechargeData)
+					.then((res) => {
+						let data = res.data;
+						this.tableList = data.list;
+						this.total = data.count;
+						this.loading = false;
+					})
+					.catch((err) => {
+						this.loading = false;
+						this.$Message.error(err.msg);
+					});
+			},
+			// 一般订单
+			getList() {
+				this.loading = true;
+				this.tableList = [];
+				orderList(this.orderData)
+					.then((res) => {
+						let data = res.data;
+						data.data.forEach((item) => {
+							if (item.id == this.orderId) {
+								this.rowActive = item;
+							}
+						});
+						this.tableList = data.data;
+						this.total = data.count;
+						this.loading = false;
+					})
+					.catch((err) => {
+						this.loading = false;
+						this.$Message.error(err.msg);
+					});
+			},
+			pageChange(index) {
+				this.orderData.page = index;
+				this.searchList();
+			},
+			// 搜索
+			orderSearch() {
+				this.orderData.page = 1;
+				this.searchList();
+			},
+			// 具体日期
+			onchangeTime(e) {
+				this.timeVal = e;
+				this.orderData.time = this.timeVal[0] ? this.timeVal.join("-") : "";
+				this.orderData.page = 1;
+				if (!e[0]) {
+					this.orderData.time = "";
+				}
+				this.searchList();
+			},
+			// 选择时间
+			selectChange() {
+				this.orderData.page = 1;
+				this.timeVal = [];
+				this.searchList();
+			},
+			getExcelData(excelData) {
+				return new Promise((resolve, reject) => {
+					let type = 1;
+					if (
+						this.currentTab == 6 ||
+						this.currentTab == 7 ||
+						this.currentTab == 5
+					) {
+						type = 1;
+					} else if (this.currentTab == 3) {
+						type = 2;
+					} else {
+						type = 3;
+					}
+					orderExport(excelData, type).then((res) => {
+						return resolve(res.data);
+					});
+				});
+			},
+		},
+	};
 </script>
 
 <style lang="stylus" scoped>
-.input-add {
-  width: 250px;
-}
-.span-del {
- color: #ed4014;
-  display: block
-}
-.ml75 {
-margin-left:-75px;
-}
-.cardCon {
-  /deep/.ivu-card-body {
-    padding: 14px 20px 0 0px !important;
-  }
+	.input-add {
+		width: 250px;
+	}
+
+	.span-del {
+		color: #ed4014;
+		display: block
+	}
+
+	.ml75 {
+		margin-left: -75px;
+	}
+
+	.cardCon {
+		/deep/.ivu-card-body {
+			padding: 14px 20px 0 0px !important;
+		}
+
+		/deep/.ivu-tabs-bar {
+			margin-bottom: 0 !important;
+			border-bottom: 1px solid #E9E9E9 !important;
+		}
+	}
+
+	.pictrue-box {
+		display: flex;
+		align-item: center;
+	}
+
+	.pictrue {
+		width: 25px;
+		height: 25px;
+	}
+
+	img {
+		height: 36px;
+		display: block;
+	}
 
-  /deep/.ivu-tabs-bar {
-    margin-bottom: 0 !important;
-    border-bottom: 1px solid #E9E9E9 !important;
-  }
-}
+	.tabBox {
+		width: 100%;
+		height: 100%;
+		display: flex;
+		align-items: center;
 
-.pictrue-box {
-  display: flex;
-  align-item: center;
-}
+		.tabBox_img {
+			width: 30px;
+			height: 30px;
 
-.pictrue {
-  width: 25px;
-  height: 25px;
-}
+			img {
+				width: 100%;
+				height: 100%;
+			}
+		}
 
-img {
-  height: 36px;
-  display: block;
-}
+		.tabBox_tit {
+			width: 60%;
+			height: 46px;
+			line-height: 23px;
+			font-size: 12px !important;
+			margin: 0 2px 0 10px;
+			letter-spacing: 1px;
+			padding: 5px 0;
+			box-sizing: border-box;
+		}
 
-.tabBox {
-  width: 100%;
-  height: 100%;
-  display: flex;
-  align-items: center;
+		.info_title {
+			width: 290px;
+			height: 30px;
+			line-height: 30px;
+			font-size: 12px !important;
+			margin: 0 2px 0 10px;
+			letter-spacing: 1px;
+			box-sizing: border-box;
+		}
+	}
 
-  .tabBox_img {
-    width: 30px;
-    height: 30px;
+	.tabBox+.tabBox {
+		margin-top: 5px;
+	}
 
-    img {
-      width: 100%;
-      height: 100%;
-    }
-  }
+	.trip {
+		color: orange;
+	}
 
-  .tabBox_tit {
-    width: 60%;
-    height: 46px;
-    line-height: 23px;
-    font-size: 12px !important;
-    margin: 0 2px 0 10px;
-    letter-spacing: 1px;
-    padding: 5px 0;
-    box-sizing: border-box;
-  }
-  .info_title{
-    width:290px;
-    height:30px;
-    line-height:30px;
-    font-size: 12px !important;
-    margin: 0 2px 0 10px;
-    letter-spacing: 1px;
-    box-sizing: border-box;
-  }
-}
-.tabBox +.tabBox{
-  margin-top:5px;
-}
-.trip {
-  color: orange;
-}
-.new_tab {
-  >>>.ivu-tabs-nav .ivu-tabs-tab{
-      padding:4px 16px 20px !important;
-      font-weight: 500;
-  }
-}
-</style>
+	.new_tab {
+		>>>.ivu-tabs-nav .ivu-tabs-tab {
+			padding: 4px 16px 20px !important;
+			font-weight: 500;
+		}
+	}
+</style>

+ 368 - 0
src/pages/store/staff/index.vue

@@ -0,0 +1,368 @@
+<template>
+	<!-- 门店-门店列表 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt tablebox" :padding="16">
+			<Form ref="queryData" :model="queryData" :label-width="labelWidth" :label-position="labelPosition"
+				class="tabform" inline @submit.native.prevent>
+				<FormItem label="选择门店:">
+					<Select v-model="queryData.store_id" clearable filterable @on-change="userSearchs"
+						class="input-add">
+						<Option v-for="item in staffData" :value="item.id" :key="item.id">{{ item.name }}
+						</Option>
+					</Select>
+				</FormItem>
+			</Form>
+			<div class="new_tab">
+				<!-- Tab栏切换 -->
+				<!-- <Tabs @on-click="onClickTab">
+					<TabPane label="全部" name="all" />
+					<TabPane label="营业中" name="1" />
+					<TabPane label="休息中" name="0"/>
+					<TabPane label="已停业" name="-1" />
+				</Tabs> -->
+			</div>
+			<Button type="primary" @click="add">添加店员</Button>
+			<div class="table">
+				<Table :columns="columns" :data="orderList" ref="table" class="ivu-mt" :loading="loading" highlight-row
+					no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+					<template slot-scope="{ row }" slot="image">
+						<img :src="row.image" />
+					</template>
+					<template slot-scope="{ row, index }" slot="action">
+						<!-- <a @click="gostore(row)">进入门店</a>
+						<Divider type="vertical" />
+						<a @click="reset(row)">重置</a>
+						<Divider type="vertical" />
+						<a @click="operation(row)">{{row.is_show == 0 ? "开业" : "停业"}}</a>
+						<Divider type="vertical" /> -->
+						<a @click="edit(row)">编辑</a>
+						<Divider type="vertical" />
+						<a @click="delte(row, '删除门店(同步删除商品)', index)">删除</a>
+					</template>
+				</Table>
+				<div class="acea-row row-right page">
+					<Page :total="total" :current="formValidate.page" show-elevator show-total @on-change="pageChange"
+						:page-size="formValidate.limit" />
+				</div>
+			</div>
+		</Card>
+		<add-staff ref="template"></add-staff>
+	</div>
+</template>
+
+<script>
+	import { mapState } from "vuex";
+	import util from "@/libs/util";
+	import Setting from "@/setting";
+	import addStaff from "../components/addStaff";
+	import {
+		storeListApi,
+		storeLogin,
+		storeSetShowApi,
+		resetApi,
+		staffListInfo
+	} from "@/api/store";
+	export default {
+		name: "storeList",
+		components: {
+			addStaff,
+		},
+		data() {
+			return {
+				staffData: [],
+				queryData:{
+				  page: 1,
+				  limit: 10,
+				  type: '',
+				  status: "",
+				  time: "",
+				  real_name: "",
+				  store_id: "",
+				  order_type: 6,
+				},
+				BaseURL: '',
+				total: 0,
+				loading: false,
+				formValidate: {
+					type: "all",
+					page: 1,
+					limit: 15,
+				},
+				columns: [{
+						title: "ID",
+						key: "id",
+						width: 60,
+					},
+					{
+						title: "门店图片",
+						slot: "image",
+						minWidth: 80,
+					},
+					{
+						title: "门店名称",
+						key: "name",
+						minWidth: 80,
+					},
+					{
+						title: "门店分类",
+						key: "cate_name",
+						minWidth: 80,
+					},
+					{
+						title: "联系电话",
+						key: "phone",
+						minWidth: 90,
+					},
+					{
+						title: "门店地址",
+						key: "address",
+						ellipsis: true,
+						minWidth: 150,
+					},
+					{
+						title: "营业时间",
+						key: "day_time",
+						minWidth: 120,
+					},
+					{
+						title: "营业状态",
+						key: "status_name",
+						minWidth: 80,
+					},
+					{
+						title: "操作",
+						slot: "action",
+						fixed: "right",
+						minWidth: 240,
+						align: "center",
+					},
+				],
+				orderList: [{
+					id: "1",
+					order_id: "12",
+					pay_price: "12",
+					status: 1,
+					phone: "13000000000",
+					address: "陕西省西安市莲湖区大兴西路啊餐厨",
+				}, ],
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		mounted() {
+			this.getList();
+			this.staffList()
+		},
+		methods: {
+			// 门店列表
+			staffList() {
+				let data = {
+					page: 0,
+					limit: 0,
+				};
+				staffListInfo()
+					.then((res) => {
+						this.staffData = res.data;
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			// 选择门店
+			userSearchs() {
+			  this.queryData.page = 1;
+			  // this.searchList();
+			},
+			getList() {
+				this.loading = true;
+				storeListApi(this.formValidate).then((res) => {
+					this.orderList = res.data.list;
+					this.total = res.data.count;
+					this.loading = false;
+				});
+			},
+			reset(row) {
+				this.$modalForm(resetApi(row.id)).then(() => this.getList());
+			},
+			add() {
+				this.$refs.template.title = "添加店员";
+				this.$refs.template.add = 1;
+				this.$refs.template.isTemplate = true;
+				this.$refs.template.cityInfo({
+					pid: 0
+				});
+			},
+			edit(row) {
+				this.$refs.template.title = "编辑店员";
+				this.$refs.template.isTemplate = true;
+				this.$refs.template.getInfo(row.id);
+			},
+			getExpiresTime(expiresTime) {
+				let nowTimeNum = Math.round(new Date() / 1000);
+				let expiresTimeNum = expiresTime - nowTimeNum;
+				return parseFloat(parseFloat(parseFloat(expiresTimeNum / 60) / 60) / 24);
+			},
+			// 进入门店
+			gostore(item) {
+				storeLogin(item.id)
+					.then((res) => {
+						let data = res.data;
+						let expires = data.expires_time;
+						util.cookies.setStore("token", data.token, {
+							expires: expires,
+						});
+						util.cookies.setStore("uuid", data.user_info.id, {
+							expires: expires,
+						});
+						util.cookies.setStore("expires_time", expires, {
+							expires: expires,
+						});
+						util.makeMenu(`/${data.prefix}`, data.menus);
+						let storage = window.localStorage;
+						storage.setItem("menuListStore", JSON.stringify(data.menus));
+						storage.setItem("uniqueAuthStore", JSON.stringify(data.unique_auth));
+						let userInfoStore = {
+							account: data.user_info.account,
+							head_pic: data.user_info.avatar,
+							logo: data.logo,
+							logoSmall: data.logo_square,
+							version: data.version,
+						};
+						storage.setItem("userInfoStore", JSON.stringify(userInfoStore));
+						// menuListStore
+						this.BaseURL = Setting.apiBaseURL.replace(/adminapi/, `${item.prefix}/home/`);
+						window.open(this.BaseURL);
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			delte(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					num: num,
+					url: `store/store/del/${row.id}`,
+					method: "DELETE",
+					ids: "",
+				};
+				this.$modalSure(delfromData)
+					.then((res) => {
+						this.$Message.success(res.msg);
+						this.orderList.splice(num, 1);
+						if (!this.orderList.length) {
+							this.formValidate.page =
+								this.formValidate.page == 1 ? 1 : this.formValidate.page - 1;
+						}
+						this.getList();
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			operation(row) {
+				let a = 0; //修改营业状态的反值
+				if (row.is_show == 0) {
+					a = 1;
+				}
+				if (row.is_show == 1) {
+					a = 0;
+				}
+				storeSetShowApi(row.id, a)
+					.then((res) => {
+						this.getList();
+						this.$Message.success(res.msg);
+					})
+					.catch((err) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			searchs() {},
+			onClickTab(e) {
+				this.formValidate.page = 1;
+				this.formValidate.type = e;
+				this.getList();
+			},
+			//分页
+			pageChange(status) {
+				this.formValidate.page = status;
+				this.getList();
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	/deep/.ivu-tabs-nav {
+		height: 45px;
+	}
+
+	.tablebox {
+		margin-top: 15px;
+	}
+
+	.btnbox {
+		padding: 20px 0px 0px 30px;
+
+		.btns {
+			width: 99px;
+			height: 32px;
+			background: #1890ff;
+			border-radius: 4px;
+			text-align: center;
+			line-height: 32px;
+			color: #ffffff;
+			cursor: pointer;
+		}
+	}
+
+	.table {
+		padding: 0;
+
+		img {
+			width: 40px;
+			height: 40px;
+		}
+	}
+
+	.search {
+		width: 86px;
+		height: 32px;
+		background: #1890ff;
+		border-radius: 4px;
+		text-align: center;
+		line-height: 32px;
+		font-size: 13px;
+		font-family: PingFangSC-Regular, PingFang SC;
+		font-weight: 400;
+		color: #ffffff;
+		cursor: pointer;
+	}
+
+	.reset {
+		width: 86px;
+		height: 32px;
+		border-radius: 4px;
+		border: 1px solid rgba(151, 151, 151, 0.36);
+		text-align: center;
+		line-height: 32px;
+		font-size: 13px;
+		font-family: PingFangSC-Regular, PingFang SC;
+		font-weight: 400;
+		color: rgba(0, 0, 0, 0.85);
+		cursor: pointer;
+	}
+
+	.new_tab {
+		>>>.ivu-tabs-nav .ivu-tabs-tab {
+			padding: 4px 16px 20px !important;
+			font-weight: 500;
+		}
+	}
+</style>

+ 1 - 0
src/router/index.js

@@ -57,6 +57,7 @@ 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();

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

@@ -549,6 +549,24 @@ export default {
                 title: '二维码统计'
             },
             component: () => import('@/pages/marketing/channelCode/statistic')
-        }
+        },
+		{
+		    path: 'vip/index',
+		    name: `${pre}vipIndex`,
+		    meta: {
+		        auth: ['admin-marketing-vip-index'],
+		        title: '会员卡列表'
+		    },
+		    component: () => import('@/pages/marketing/vip/index')
+		},
+		{
+		    path: 'vip/create',
+		    name: `${pre}vipCreate`,
+		    meta: {
+		        auth: ['admin-marketing-vip-create'],
+		        title: '添加会员卡'
+		    },
+		    component: () => import('@/pages/marketing/vip/create')
+		}
     ]
 };

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

@@ -74,6 +74,15 @@ export default {
 			},
 			component: () => import('@/pages/store/storeList/index')
 		},
+		{
+			path: 'staff/index',
+			name: `${pre}staffList`,
+			meta: {
+				auth: ['admin-store-staff_list'],
+				title: '门店店员'
+			},
+			component: () => import('@/pages/store/staff/index')
+		},
 		{
 			path: 'order/index',
 			name: `${pre}order`,

+ 1 - 1
src/router/routes.js

@@ -36,7 +36,7 @@ const frameIn = [
     {
         path: '/',
         meta: {
-            title: 'CRMEB'
+            title: '君子堂'
         },
         redirect: {
             name: 'home_index'

+ 5 - 3
src/setting.js

@@ -11,9 +11,11 @@
  * iView Admin Pro 业务配置
  * */
 // 请求接口地址 如果没有配置自动获取当前网址路径
-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://192.168.2.89/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 = process.env.VUE_APP_WS_ADMIN_URL || `ws:${location.hostname}/ws`
+const VUE_APP_WS_ADMIN_URL = 'ws:192.168.2.89/ws'
 // 路由前缀
 const roterPre = '/admin'
 // 客服路由前缀
@@ -28,7 +30,7 @@ const Setting = {
     roterPre,
     routePreKF,
     // 网页标题的后缀
-    titleSuffix: util.cookies.get('pageTitle') || 'CRMEB',
+    titleSuffix: util.cookies.get('pageTitle') || '君子堂',
     // 路由模式,可选值为 history 或 hash
     routerMode: 'history',
     // 页面切换时,是否显示模拟的进度条