lhl 1 năm trước cách đây
mục cha
commit
9f8d8a90a7

BIN
public/favicon.ico


+ 1 - 1
src/api/store.js

@@ -683,7 +683,7 @@ export function getYgList(data) {
 	return request({
 	    url: `work/member`,
 	    method: 'get',
-		data
+		params:data
 	})
 }
 

+ 465 - 0
src/components/staffList/index.vue

@@ -0,0 +1,465 @@
+<template>
+	<div class="goodList">
+		<Table ref="table" no-data-text="暂无数据" @on-select-all="selectAll" @on-select-all-cancel="cancelAll"
+			@on-select="TableSelectRow" @on-select-cancel="TableSelectCancelRow" no-filtered-data-text="暂无筛选结果"
+			:columns="columns4" :data="tableList" :loading="loading" class="mr-20" height="500">
+			<!-- <template slot-scope="{ row }" slot="store_name">
+				<Tooltip max-width="200" placement="bottom">
+					<span class="line2">{{ row.store_name }}{{row.suk}}</span>
+					<p slot="content">{{ row.store_name }}{{row.suk}}</p>
+				</Tooltip>
+			</template> -->
+			<template slot-scope="{ row }" slot="avatar">
+				<viewer>
+					<div class="tabBox_img">
+						<img v-lazy="row.avatar" />
+					</div>
+				</viewer>
+			</template>
+		</Table>
+		<div class="acea-row row-right page">
+			<Page :total="total" show-elevator show-total @on-change="pageChange" :page-size="formValidate.limit" />
+		</div>
+		<div class="footer" slot="footer" >
+			<Button type="primary" size="large" :loading="modal_loading" long @click="ok">确定</Button>
+		</div>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from "vuex";
+	import {
+		cascaderListApi,
+		changeListApi,
+		allLabelApi
+	} from "@/api/product";
+	import {
+		getYgList
+	} from '@/api/store'
+	import {
+		liveGoods
+	} from "@/api/live";
+	export default {
+		name: "index",
+		props: {
+			serviceProject: {
+				type: Number,
+				default: 0,
+			},
+			serviceCard: {
+				type: Number,
+				default: 0,
+			},
+			goodsType: {
+				type: Number,
+				default: 0,
+			},
+			storeType: {
+				type: Number,
+				default: 0,
+			},
+			is_new: {
+				type: String,
+				default: "",
+			},
+			diy: {
+				type: Boolean,
+				default: false,
+			},
+			isdiy: {
+				type: Boolean,
+				default: false,
+			},
+			ischeckbox: {
+				type: Boolean,
+				default: false,
+			},
+			liveStatus: {
+				type: Boolean,
+				default: false,
+			},
+			isLive: {
+				type: Boolean,
+				default: false,
+			},
+			datas: {
+				type: Object,
+				default: function() {
+					return {};
+				},
+			},
+		},
+		data() {
+			return {
+				//选中商品集合
+				selectEquips: [],
+				// 选中的id集合
+				selectEquipsIds: [],
+				labelSelect: [],
+				cateIds: [],
+				modal_loading: false,
+				treeSelect: [],
+				formValidate: {
+					service_project: this.serviceProject,
+					service_card: this.serviceCard,
+					page: 1,
+					limit: 10,
+					cate_id: "",
+					store_name: "",
+					is_new: this.is_new,
+					store_label_id: ""
+				},
+				total: 0,
+				modals: false,
+				loading: false,
+				grid: {
+					xl: 10,
+					lg: 10,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				tableList: [],
+				currentid: 0,
+				productRow: {},
+				columns4: [{
+						type: 'selection',
+						width: 60,
+						align: 'center'
+					},
+					{
+						title: "员工ID",
+						key: "id",
+					},
+					{
+						title: "头像",
+						slot: "avatar",
+						width: 60,
+					},
+					{
+						title: "员工姓名",
+						key: "name",
+						minWidth: 200,
+					},
+					{
+						title: "创建时间",
+						key: "create_time",
+						minWidth: 100,
+					},
+				],
+				columns5: [{
+						title: "商品ID",
+						key: "id",
+					},
+					{
+						title: "图片",
+						slot: "image",
+					},
+					{
+						title: "商品名称",
+						key: "name",
+						minWidth: 250,
+					},
+				],
+				images: [],
+				many: "",
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 120;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			// let radio = {
+			// 	title: "选择",
+			// 	width: 70,
+			// 	align: "center",
+			// 	render: (h, params) => {
+			// 		let id = params.row.id;
+			// 		let flag = false;
+			// 		if (this.currentid === id) {
+			// 			flag = true;
+			// 		} else {
+			// 			flag = false;
+			// 		}
+			// 		let self = this;
+			// 		return h("div", [
+			// 			h("Radio", {
+			// 				props: {
+			// 					value: flag,
+			// 				},
+			// 				on: {
+			// 					"on-change": () => {
+			// 						self.currentid = id;
+			// 						this.productRow = params.row;
+			// 						console.log('zhe+++')
+			// 						this.$emit("getProductId", this.productRow);
+			// 						if (this.productRow.id) {
+			// 							if (this.$route.query.fodder === "image") {
+			// 								/* eslint-disable */
+			// 								let imageObject = {
+			// 									image: this.productRow.image,
+			// 									product_id: this.productRow.id,
+			// 									name: this.productRow.name,
+			// 								};
+			// 								form_create_helper.set("image", imageObject);
+			// 								form_create_helper.close("image");
+			// 							}
+			// 						} else {
+			// 							this.$Message.warning("请先选择商品");
+			// 						}
+			// 					},
+			// 				},
+			// 			}),
+			// 		]);
+			// 	},
+			// };
+
+			// let checkbox = {
+			// 	type: "selection",
+			// 	width: 60,
+			// 	align: "center",
+			// };
+			// let many = "";
+			// if (this.ischeckbox) {
+			// 	many = "many";
+			// } else {
+			// 	many = this.$route.query.type;
+			// }
+			// this.many = many;
+			// if (many === "many") {
+			// 	this.columns4.unshift(checkbox);
+			// 	this.columns5.unshift(checkbox);
+			// } else {
+			// 	this.columns4.unshift(radio);
+			// 	this.columns5.unshift(radio);
+			// }
+		},
+		mounted() {
+			this.goodsCategory();
+			this.getList();
+			this.getAllLabelApi();
+		},
+		methods: {
+			// 判断是否选中
+			sortData() {
+				if (this.selectEquipsIds.length) {
+					this.tableList.forEach(ele => {
+						if (this.selectEquipsIds.includes(ele.id)) ele._checked = true;
+					})
+				}
+			},
+			// 选中一行
+			TableSelectRow(selection, row) {
+				if (!this.selectEquipsIds.includes(row.id)) {
+					this.selectEquipsIds.push(row.id);
+					this.selectEquips.push(row);
+				}
+			},
+			// 取消选中一行
+			TableSelectCancelRow(selection, row) {
+				var _index = this.selectEquipsIds.indexOf(row.id);
+				if (_index != -1) {
+					this.selectEquipsIds.splice(_index, 1);
+					this.selectEquips.splice(_index, 1);
+				}
+			},
+			// 选中所有
+			selectAll() {
+				for (let i = this.tableList.length - 1; i >= 0; i--) {
+					this.TableSelectRow(null, this.tableList[i]);
+				}
+			},
+			// 取消选中所有
+			cancelAll() {
+				for (let i = this.tableList.length - 1; i >= 0; i--) {
+					this.TableSelectCancelRow(null, this.tableList[i]);
+				}
+			},
+			getAllLabelApi() {
+				allLabelApi().then(res => {
+					this.labelSelect = res.data
+				}).catch(err => {
+					this.$Message.error(err.msg);
+				})
+			},
+			handleSelectAll() {
+				this.$refs.table.selectAll(false);
+			},
+			// 商品分类;
+			goodsCategory() {
+				cascaderListApi(1)
+					.then((res) => {
+						this.treeSelect = res.data;
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			pageChange(index) {
+				this.formValidate.page = index;
+				this.getList();
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				if (!this.liveStatus) {
+					if (this.isLive) {
+						this.formValidate.is_live = 1;
+					}
+					if (this.goodsType) {
+						this.formValidate.is_presale_product = 0;
+						this.formValidate.is_vip_product = 0;
+					}
+					if (this.storeType) {
+						this.formValidate.is_supplier = 0;
+					}
+
+					this.formValidate.cate_id = this.cateIds[this.cateIds.length - 1]
+					getYgList(this.formValidate)
+						.then(async (res) => {
+							let data = res.data;
+							this.tableList = data.list;
+							this.total = res.data.count;
+							this.sortData();
+							this.loading = false;
+						})
+						.catch((res) => {
+							this.loading = false;
+							this.$Message.error(res.msg);
+						});
+				} else {
+					liveGoods({
+							is_show: "1",
+							status: "1",
+							live_id: this.datas.id,
+							kerword: this.formValidate.store_name,
+							page: this.formValidate.page,
+							limit: this.formValidate.limit,
+						})
+						.then(async (res) => {
+							let data = res.data;
+							data.list.forEach((el) => {
+								el.image = el.cover_img;
+							});
+							this.tableList = data.list;
+							this.total = res.data.count;
+							this.sortData();
+							this.loading = false;
+						})
+						.catch((res) => {
+							this.loading = false;
+							this.$Message.error(res.msg);
+						});
+				}
+			},
+			changeCheckbox(selection) {
+				let images = [];
+				selection.forEach(function(item) {
+					let imageObject = {
+						image: item.image,
+						product_id: item.id,
+						store_name: item.store_name,
+						temp_id: item.temp_id
+					};
+					images.push(imageObject);
+				});
+				this.images = images;
+				this.$emit("getProductDiy", selection);
+			},
+			ok() {
+				// console.log('selectEquips',this.selectEquips)
+				this.$emit("getProductId", this.selectEquips);
+				// let images = [];
+				// this.selectEquips.forEach(function(item) {
+				// 	let imageObject = {
+				// 		image: item.image,
+				// 		product_id: item.id,
+				// 		store_name: item.store_name,
+				// 		temp_id: item.temp_id
+				// 	};
+				// 	images.push(imageObject);
+				// });
+				// if (images.length > 0) {
+				// 	if (this.$route.query.fodder === "image") {
+				// 		let imageValue = form_create_helper.get("image");
+				// 		form_create_helper.set("image", imageValue.concat(images));
+				// 		form_create_helper.close("image");
+				// 	} else {
+				// 		if (this.isdiy) {
+				// 			this.$emit("getProductId", this.selectEquips);
+				// 		} else {
+				// 			this.$emit("getProductId", images);
+				// 		}
+				// 	}
+				// } else {
+				// 	this.$Message.warning("请先选择商品");
+				// }
+			},
+			treeSearchs(value) {
+				this.cateIds = value;
+				this.formValidate.page = 1;
+				this.getList();
+			},
+			// 表格搜索
+			userSearchs() {
+				this.formValidate.page = 1;
+				this.getList();
+			},
+			clear() {
+				this.productRow.id = "";
+				this.currentid = "";
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	/deep/.ivu-table-header thead tr th {
+		padding: 8px 5px;
+	}
+
+	/deep/.ivu-radio-wrapper {
+		margin-right: 0 !important;
+	}
+
+	.footer {
+		margin: 15px 0;
+	}
+
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+	.tabform {
+		>>>.ivu-form-item {
+			margin-bottom: 16px !important;
+		}
+	}
+
+	.btn {
+		margin-top: 20px;
+		float: right;
+	}
+
+	.goodList {}
+
+	.mr-20 {
+		margin-right: 10px;
+	}
+</style>

+ 2 - 2
src/pages/account/login/index.vue

@@ -96,10 +96,10 @@
             :imgSize="{ width: '330px', height: '155px' }"
             ref="verify"
         ></Verify>
-      <div class="footer">
+      <!-- <div class="footer">
         <div class="pull-right" v-if="copyright">{{copyright}}</div>
         <div class="pull-right" v-else>Copyright ©2014-2023 <a class="infoUrl" href="https://www.crmeb.com" target="_blank">{{version}}</a></div>
-      </div>
+      </div> -->
         <!--  :imgs="[Img1, Img2]" 支持自定义背景图片,详见 https://juejin.cn/post/6978777429447966757 -->
     </div>
 </template>

+ 201 - 187
src/pages/store/checkRule/create.vue

@@ -18,6 +18,13 @@
 				<FormItem label="规则名称" required>
 					<Input v-model="formData.groupname" v-width="320"></Input>
 				</FormItem>
+				<FormItem label="打卡员工" required>
+					<!-- <Input v-model="formData.groupname" v-width="320"></Input> -->
+					<template v-for="item in checkedStaff">
+						<Tag>{{item.name}}</Tag>
+					</template>
+					<Button type="primary" @click="chooseSatff">选择员工</Button>
+				</FormItem>
 				<FormItem label="打卡经度">
 					<Input v-model="formData.loc_infos[0].lng" v-width="320"></Input>
 					<span> (实际经度的1000000倍)</span>
@@ -42,44 +49,81 @@
 					<Input v-model="formData.wifimac_infos[0].wifimac" v-width="320"></Input>
 					<span> </span>
 				</FormItem>
-				<FormItem label="工作日" required>
-					<Button  type="primary" style="margin-left: 20px;" v-for="item in workList" >{{item.table}}</Button>
-				</FormItem>
-				<template v-for="item in checkintime">
-					<FormItem label="上班时间" required>
-						<TimePicker :steps="[1, 5]" placeholder=""  v-width="320" format="HH:mm" :model-value="value1"/>
-						<Button  type="primary" style="margin-left: 20px;" @click="addNewDk" >添加新上班时段</Button>
-					</FormItem>
-					<FormItem label="上班最早时间" required>
-						<TimePicker :steps="[1, 5]" placeholder=""  v-width="320" format="HH:mm" />
-					</FormItem>
-					<FormItem label="上班最晚时间" required>
-						<TimePicker :steps="[1, 5]" placeholder=""  v-width="320" format="HH:mm" />
-					</FormItem>
-					<FormItem label="上班提醒时间" required>
-						<TimePicker :steps="[1, 5]" placeholder=""  v-width="320" format="HH:mm" />
-					</FormItem>
-					<FormItem label="下班时间" required>
-						<TimePicker :steps="[1, 5]" placeholder=""  v-width="320" format="HH:mm" />
-					</FormItem>
-					<FormItem label="下班最早时间" required>
-						<TimePicker :steps="[1, 5]" placeholder=""  v-width="320" format="HH:mm" />
+				<card v-for="(itemx,indexx) in formData.checkindate" style="width:1000px;">
+					<div style="padding-bottom: 10px;">打卡时间
+						<Button type="primary" style="margin-left: 20px;" @click="addNewDkTime()"
+							v-if="indexx == 0">添加新打卡时间</Button>
+						<Button type="primary" style="margin-left: 20px;" @click="delNewDkTime(indexx)"
+							v-else>删除</Button>
+					</div>
+					<FormItem label="工作日" required>
+						<TagSelect v-model="itemx.workdays" hide-check-all>
+							<TagSelectOption :name="1">星期一</TagSelectOption>
+							<TagSelectOption :name="2">星期二</TagSelectOption>
+							<TagSelectOption :name="3">星期三</TagSelectOption>
+							<TagSelectOption :name="4">星期四</TagSelectOption>
+							<TagSelectOption :name="5">星期五</TagSelectOption>
+							<TagSelectOption :name="6">星期六</TagSelectOption>
+							<TagSelectOption :name="0">星期天</TagSelectOption>
+						</TagSelect>
 					</FormItem>
-					<FormItem label="下班最晚时间" required>
-						<TimePicker :steps="[1, 5]" placeholder=""  v-width="320" format="HH:mm" />
-					</FormItem>
-					<FormItem label="下班提醒时间" required>
-						<TimePicker :steps="[1, 5]" placeholder=""  v-width="320" format="HH:mm" />
-					</FormItem>
-				</template>
-				
+					<card v-for="(item,index) in itemx.checkintime" style="margin-bottom: 10px;">
+						<FormItem label="时段id" required>
+							<Input v-width="320" placeholder="大于0,小于99999,且唯一" v-model="item.time_id"></Input>
+							<Button type="primary" style="margin-left: 20px;" @click="addNewDk(itemx)"
+								v-if="index == 0">添加新上班时段</Button>
+							<Button type="primary" style="margin-left: 20px;" @click="delNewDk(itemx,index)"
+								v-else>删除</Button>
+						</FormItem>
+						<FormItem label="上班时间" required>
+							<TimePicker :steps="[1, 5]" placeholder="" v-width="320" format="HH:mm"
+								v-model="item.work_sec" />
+						</FormItem>
+						<FormItem label="上班最早时间" required>
+							<TimePicker :steps="[1, 5]" placeholder="" v-width="320" format="HH:mm"
+								v-model="item.earliest_work_sec" />
+						</FormItem>
+						<FormItem label="上班最晚时间" required>
+							<TimePicker :steps="[1, 5]" placeholder="" v-width="320" format="HH:mm"
+								v-model="item.latest_work_sec" />
+						</FormItem>
+						<FormItem label="上班提醒时间" required>
+							<TimePicker :steps="[1, 5]" placeholder="" v-width="320" format="HH:mm"
+								v-model="item.remind_work_sec" />
+						</FormItem>
+						<FormItem label="下班时间" required>
+							<TimePicker :steps="[1, 5]" placeholder="" v-width="320" format="HH:mm"
+								v-model="item.off_work_sec" />
+						</FormItem>
+						<FormItem label="下班最早时间" required>
+							<TimePicker :steps="[1, 5]" placeholder="" v-width="320" format="HH:mm"
+								v-model="item.earliest_off_work_sec" />
+						</FormItem>
+						<FormItem label="下班最晚时间" required>
+							<TimePicker :steps="[1, 5]" placeholder="" v-width="320" format="HH:mm"
+								v-model="item.latest_off_work_sec" />
+						</FormItem>
+						<FormItem label="下班提醒时间" required>
+							<TimePicker :steps="[1, 5]" placeholder="" v-width="320" format="HH:mm"
+								v-model="item.remind_off_work_sec" />
+						</FormItem>
+					</card>
+				</card>
+
+
 			</Form>
 			<div style="width: 500px; display: flex;justify-content: center;">
 				<Button type="primary" class="submission" @click="save" :disabled="disabled"
 					v-if="!formData.id">立即创建</Button>
 				<Button type="primary" class="submission" @click="save" :disabled="disabled" v-else>立即修改</Button>
+				<Button type="primary" @click="showDate()">测试数据</Button>
 			</div>
 		</Card>
+		<Modal v-model="modals" title="员工列表" footerHide class="paymentFooter" scrollable width="900"
+			@on-cancel="cancel">
+			<staff-list ref="stafflist" :goodsType="1" v-if="modals" @getProductId="getProductId"
+				:serviceCard="1"></staff-list>
+		</Modal>
 	</div>
 </template>
 
@@ -87,6 +131,7 @@
 	import {
 		mapState
 	} from "vuex";
+	import staffList from "@/components/staffList/index";
 	import storeList from "@/components/storeList";
 	import {
 		couponCategoryApi,
@@ -108,55 +153,13 @@
 	export default {
 		name: "storeCouponCreate",
 		components: {
-			storeList
+			storeList,
+			staffList
 		},
 		data() {
 			return {
-				value1: '09:41:00',
-				chooseWd: [],//选择的上班日期
-				workList: [
-					{
-						table: '星期一',
-						value: 1
-					},
-					{
-						table: '星期二',
-						value: 2
-					},
-					{
-						table: '星期三',
-						value: 3
-					},
-					{
-						table: '星期四',
-						value: 4
-					},
-					{
-						table: '星期五',
-						value: 5
-					},
-					{
-						table: '星期六',
-						value: 6
-					},
-					{
-						table: '星期日',
-						value: 0
-					}
-				],
-				checkintime: [
-					{
-						"time_id": 1,
-						"work_sec": 36000,//上班时间(距0点秒数,整分钟)
-						"off_work_sec": 43200,//下班时间
-						"remind_work_sec": 35400,//上班提醒时间
-						"remind_off_work_sec": 43200,//下班提醒时间
-						"earliest_work_sec": 35040,//上班最早时间
-						"latest_work_sec": 37020,//上班最晚时间
-						"earliest_off_work_sec": 43140,//下班最早时间
-						"latest_off_work_sec": 43800//	下班最晚时间
-					}
-				],
+				checkedStaff: [],
+				modals: false, //选择员工弹出
 				value: '',
 				id: '',
 				work_sec: '',
@@ -184,23 +187,17 @@
 						]
 					}, //打卡人员
 					checkindate: [{
-						workdays: [
-							1,
-							2,
-							3,
-							4,
-							5
-						],
+						'workdays': [],
 						"checkintime": [{
-							"time_id": 1,
-							"work_sec": 36000,//上班时间(距0点秒数,整分钟)
-							"off_work_sec": 43200,//下班时间
-							"remind_work_sec": 35400,//上班提醒时间
-							"remind_off_work_sec": 43200,//下班提醒时间
-							"earliest_work_sec": 35040,//上班最早时间
-							"latest_work_sec": 37020,//上班最晚时间
-							"earliest_off_work_sec": 43140,//下班最早时间
-							"latest_off_work_sec": 43800//	下班最晚时间
+							"time_id": '1',
+							"work_sec": '', //上班时间(距0点秒数,整分钟)
+							"off_work_sec": '', //下班时间
+							"remind_work_sec": '', //上班提醒时间
+							"remind_off_work_sec": '', //下班提醒时间
+							"earliest_work_sec": '', //上班最早时间
+							"latest_work_sec": '', //上班最晚时间
+							"earliest_off_work_sec": '', //下班最早时间
+							"latest_off_work_sec": '' //	下班最晚时间
 						}],
 						"flex_on_duty_time": 0,
 						"flex_off_duty_time": 0
@@ -223,58 +220,87 @@
 		computed: {
 			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
 		},
-		created() {
-			if (this.$route.query.id) {
-				let query = this.$route.query
-				this.formData.id = query.id;
-				this.formData.store_name = query.store_name;
-				this.formData.repertory = query.repertory;
-				this.formData.slider_image = query.slider_image;
-				this.formData.performance_value = query.performance_value;
-				this.formData.craft_price = query.craft_price;
-				this.formData.sales_commissions = query.sales_commissions
-			}
-			this.showTime(36000)
-		},
+		created() {},
 		methods: {
+			// 测试数据
+			showDate() {
+				console.log('shuju', this.formData)
+			},
+			// 打开员工选择弹窗
+			chooseSatff() {
+				this.modals = true;
+			},
+			changeT(e) {
+				// close()
+				console.log(e, 'dddddddddddddd')
+			},
 			showTime(time) {
-				
-					let hh = '',mm = '';
-					hh = Math.floor(time / 3600);
-					hh = hh > 9 ? hh: ('0' + hh)
-					mm = Math.floor((time % 3600) / 60);
-					mm = mm > 9 ? mm: ('0' + mm)
-					let str =  hh + ':' + mm + ':' + '00'
-					console.log('str:',str)
-					return str
-				
-				
+
+				let hh = '',
+					mm = '';
+				hh = Math.floor(time / 3600);
+				hh = hh > 9 ? hh : ('0' + hh)
+				mm = Math.floor((time % 3600) / 60);
+				mm = mm > 9 ? mm : ('0' + mm)
+				let str = hh + ':' + mm + ':' + '00'
+				console.log('str:', str)
+				return str
+
+
 			},
-			addNewDk() {
-				
+			addNewDk(item) {
+				item.checkintime.push({
+					"time_id": '',
+					"work_sec": '', //上班时间(距0点秒数,整分钟)
+					"off_work_sec": '', //下班时间
+					"remind_work_sec": '', //上班提醒时间
+					"remind_off_work_sec": '', //下班提醒时间
+					"earliest_work_sec": '', //上班最早时间
+					"latest_work_sec": '', //上班最晚时间
+					"earliest_off_work_sec": '', //下班最早时间
+					"latest_off_work_sec": '' //	下班最晚时间
+				})
+			},
+			addNewDkTime() {
+				this.formData.checkindate.push({
+					'workdays': [],
+					"checkintime": [{
+						"time_id": '',
+						"work_sec": '', //上班时间(距0点秒数,整分钟)
+						"off_work_sec": '', //下班时间
+						"remind_work_sec": '', //上班提醒时间
+						"remind_off_work_sec": '', //下班提醒时间
+						"earliest_work_sec": '', //上班最早时间
+						"latest_work_sec": '', //上班最晚时间
+						"earliest_off_work_sec": '', //下班最早时间
+						"latest_off_work_sec": '' //	下班最晚时间
+					}],
+					"flex_on_duty_time": 0,
+					"flex_off_duty_time": 0
+				})
+			},
+
+			delNewDkTime(index) {
+				this.formData.checkindate.splice(index, 1)
+			},
+			delNewDk(item,index) {
+				item.splice(index, 1)
 			},
 			// 
 			onchangeTime(e) {
-				console.log(e,'xuanz');
+				console.log(e, 'xuanz');
 			},
 			// 商品id
 			getProductId(row) {
-				console.log(row, '这个');
-				this.modal_loading = false;
 				this.modals = false;
-				setTimeout(() => {
-					this.formData.product_id = row.id
-					this.formData.store_name = row.store_name
-					this.formData.product_id = row.id
-					this.formData.card_price = row.price
-					this.formData.unit_name = row.unit_name
-					this.formData.slider_image = row.image
-					this.formData.price = row.price
-					// this.formData.slider_image = row.slider_image
-					// this.formData.is_show = 1
-					this.formData.repertory = row.stock
-					// this.formData.image = row.image
-				}, 500);
+				console.log(row, '这个');
+				this.checkedStaff = row
+				let arr = []
+				this.checkedStaff.forEach(item => {
+					arr.push(item.userid)
+				})
+				this.formData.range.userid = arr
+
 			},
 			// 选择商品
 			changeGoods() {
@@ -291,12 +317,52 @@
 				// 	return this.$Message.error("请输入库存");
 				// }
 			},
+			getTime(str) {
+				if(typeof(str) == 'string') {
+					let arr = str.split(':')
+					return arr[0]*60*60 + arr[1]*60
+				}else {
+					return str
+				}
+				
+			},
 			// 创建
 			save() {
+				let that = this
 				this.downTab();
 				console.log('这');
+				let qdata = {}
+				qdata = Object.assign(qdata,this.formData)
+				try{
+					// let qdata = JSON.parse(JSON.stringify(this.formData))
+					let checkindate = []
+					this.formData.checkindate.forEach(item => {
+						// checkindate.push(item.)
+						let mitem = []
+						item.checkintime.forEach(itemt => {
+							for(let key in itemt) {
+								// let val = ''
+								if(key != 'time_id') {
+									itemt[key] = that.getTime(itemt[key])
+								}else {
+									itemt[key] = itemt[key]*1
+								}
+							}
+							mitem.push(itemt)
+						})
+						item.checkintime = mitem
+						checkindate.push(item)
+					})
+					qdata.checkindate = checkindate
+					console.log(qdata,'this.formData')
+				}catch(e){
+					//TODO handle the exception
+					console.log(e,'cuow')
+				}
+				
+				
 				addCheckRule({
-						'group': this.formData
+						'group': qdata
 					})
 					.then((res) => {
 						this.disabled = true;
@@ -311,61 +377,9 @@
 						this.$Message.error(err.msg);
 					});
 			},
-			// 使用有效期--时间段
-			dateChange(time) {
-				this.formData.start_use_time = time[0];
-				this.formData.end_use_time = time[1];
-			},
-			// 限时
-			timeChange(time) {
-				this.formData.start_time = time[0];
-				this.formData.end_time = time[1];
-			},
-			//对象数组去重;
-			unique(arr) {
-				const res = new Map();
-				return arr.filter(
-					(arr) => !res.has(arr.product_id) && res.set(arr.product_id, 1)
-				);
-			},
 			cancel() {
 				this.modals = false;
 			},
-			// 删除商品
-			remove(productId) {
-				for (let index = 0; index < this.productList.length; index++) {
-					if (this.productList[index].product_id == productId) {
-						this.productList.splice(index, 1);
-					}
-				}
-				this.formData.product_id = "";
-				this.productList.forEach((value) => {
-					if (this.formData.product_id) {
-						this.formData.product_id += `,${value.product_id}`;
-					} else {
-						this.formData.product_id += `${value.product_id}`;
-					}
-				});
-			},
-			// 获取详情
-			getDetail() {
-				serveReadApi(this.id).then(res => {
-					console.log(res);
-					let row = res.data.info.storeInfo
-					this.formData = {
-						id: row.id,
-						product_id: row.id,
-						store_name: row.store_name,
-						card_price: row.card_price,
-						explain: row.explain,
-						unit_name: row.unit_name,
-						image: row.image,
-						images: row.slider_image,
-						repertory: row.repertory,
-						is_show: 1
-					}
-				})
-			}
 		},
 	};
 </script>

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

@@ -22,11 +22,6 @@
 				<template slot-scope="{ row, index }" slot="workdays">
 					<el-tag v-for="witem in row.checkin_option.checkindate[0].workdays">{{witem | showWd}}</el-tag>
 				</template>
-				<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" />
@@ -35,8 +30,8 @@
 					<span> {{row.add_time | formatDate}}</span>
 				</template>
 				<template slot-scope="{ row, index }" slot="action">
-					<a @click="couponSend(row)">编辑</a>
-					<Divider type="vertical" />
+					<!-- <a @click="couponSend(row)">编辑</a>
+					<Divider type="vertical" /> -->
 					<a @click="couponDel(row,'删除会员卡',index)">删除</a>
 				</template>
 			</Table>
@@ -201,7 +196,10 @@
 			},
 			// 发布
 			couponSend(row) {
-				this.$modalForm(VipEditApi(row.id)).then(() => this.getList());
+				// this.$modalForm(VipEditApi(row.id)).then(() => this.getList());
+				this.$router.push({
+					path: this.roterPre + "/store/checkRule/create"
+				});
 			},
 			// 删除
 			couponDel(row, tit, num) {

+ 6 - 39
src/pages/store/components/addStaff.vue

@@ -194,7 +194,8 @@
 					alias: '',
 					address: '',
 					main_department: '',
-					direct_leader: 'ZhouFengYu'
+					direct_leader: 'ZhouFengYu',
+					position: ''
 				},
 				spinShow: false,
 				addresData: [],
@@ -270,7 +271,8 @@
 					alias: '',
 					address: '',
 					main_department: '',
-					direct_leader: 'ZhouFengYu'
+					direct_leader: 'ZhouFengYu',
+					position: ''
 				}
 			}
 		},
@@ -434,42 +436,6 @@
 					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;
@@ -501,7 +467,8 @@
 								department: this.formItem.department,
 								uid: this.formItem.uid,
 								userid: this.formItem.userid,
-								direct_leader: 'ZhouFengYu'
+								direct_leader: 'ZhouFengYu',
+								position: this.formItem.position
 							}).then(async res => {
 								this.$Message.success(res.msg);
 								this.isTemplate = false;