lhl %!s(int64=2) %!d(string=hai) anos
pai
achega
c20b24aea2

+ 8 - 0
src/api/check.js

@@ -88,4 +88,12 @@ export function getDepartmentList () {
         url: `work/department`,
         method: 'get'
     });
+}
+
+//获取打卡记录
+export function getCheckList(data) {
+	return request({
+	    url: `work/getCheckin`,
+	    method: 'post'
+	});
 }

+ 4 - 60
src/pages/check/classes/index.vue

@@ -1,15 +1,7 @@
 <template>
 	<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="['store-check-classes-add']" type="primary" icon="md-add"
-						@click="add">添加班次</Button>
-					</Col>
-				</Row>
-			</Form>
+			<button></button>
 			<Table :columns="columns1" :data="tableList" ref="table" class="mt25" :loading="loading" highlight-row
 				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
 				<template slot-scope="{ row, index }" slot="groupname">
@@ -32,11 +24,6 @@
 				<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"
@@ -51,7 +38,8 @@
 		mapState
 	} from 'vuex';
 	import {
-		getClasses
+		getClasses,
+		getCheckList
 	} from '@/api/check';
 	import {
 		formatDate
@@ -178,42 +166,11 @@
 			}
 		},
 		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);
-				});
-			},
-			// 删除
-			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;
 
-				getClasses(this.tableFrom).then(async res => {
+				getCheckList(this.tableFrom).then(async res => {
 					let data = res.data
 					this.tableList = data.list;
 					this.total = res.data.count;
@@ -227,15 +184,6 @@
 				this.tableFrom.page = index;
 				this.getList();
 			},
-			changeType(data) {
-				this.type = data;
-			},
-			// 添加
-			add() {
-				this.$router.push({
-					path:  "/store/check/classes/add"
-				});
-			},
 			addType(type) {
 				couponCreateApi(type).then(async res => {
 					if (res.data.status === false) {
@@ -249,10 +197,6 @@
 					this.$Message.error(res.msg);
 				})
 			},
-			// 编辑
-			edit(row) {
-				this.$modalForm(couponEditeApi(row.id)).then(() => this.getList());
-			},
 			// 表格搜索
 			userSearchs() {
 				this.tableFrom.page = 1;

+ 29 - 101
src/pages/check/components/addStaff.vue

@@ -8,7 +8,6 @@
 						:rules="ruleValidate" @submit.native.prevent>
 						<Row type="flex" :gutter="24">
 							<Col span="24">
-							<Col v-bind="grid">
 							<FormItem label="头像:" prop="image">
 								<div class="picBox" @click="modalPicTap('image')">
 									<div class="pictrue" v-if="formItem.avatar"><img v-lazy="formItem.avatar"></div>
@@ -18,30 +17,28 @@
 								</div>
 							</FormItem>
 							</Col>
-							</Col>
 							<Col span="24">
-							<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="别名:" prop="name" label-for="alias">
 								<Input v-model="formItem.alias" placeholder="请输入别名" />
 							</FormItem>
 							</Col>
-							</Col>
 							<Col span="24">
-							<Col v-bind="grid">
 							<FormItem label="手机号:" label-for="mobile" prop="mobile">
 								<Input v-model="formItem.mobile" placeholder="请输入手机号" />
 							</FormItem>
 							</Col>
+							<Col span="24">
+							<FormItem label="绑定用户:" label-for="mobile" prop="mobile">
+								<Button v-if="checkUser.nickname || checkUser.phone" style="margin-right: 20rpx;">昵称:{{checkUser.nickname || '暂无'}} 手机号:{{checkUser.phone || '暂无'}}</Button>
+								<Button type="primary" @click="chooseUser" >选择员工</Button>
+							</FormItem>
 							</Col>
 							<Col span="24" class="mt20">
-							<Col v-bind="grid">
 							<FormItem label="性别:">
 								<RadioGroup v-model="formItem.gender">
 									<Radio :label="0">
@@ -55,23 +52,17 @@
 								</RadioGroup>
 							</FormItem>
 							</Col>
-							</Col>
 							<Col span="24">
-							<Col v-bind="grid">
 							<FormItem label="职务:" label-for="position" prop="position">
 								<Input v-model="formItem.position" placeholder="请输入职务" />
 							</FormItem>
 							</Col>
-							</Col>
 							<Col span="24">
-							<Col v-bind="grid">
 							<FormItem label="住址:" label-for="address" prop="address">
 								<Input v-model="formItem.address" placeholder="请输入住址" />
 							</FormItem>
 							</Col>
-							</Col>
 							<Col span="24">
-							<Col v-bind="grid">
 							<FormItem label="部门:" label-for="main_department" prop="main_department">
 								<el-cascader placeholder="请选择部门" :options="departmentList"
 									:value="formItem.main_department" v-width="320"
@@ -79,7 +70,6 @@
 									@change="changeBm"></el-cascader>
 							</FormItem>
 							</Col>
-							</Col>
 						</Row>
 						<Row style="justify-content: space-around;">
 							<Col>
@@ -91,38 +81,21 @@
 				</Card>
 			</div>
 		</Modal>
-		<Modal
-		        v-model="modalPic"
-		        width="960px"
-		        scrollable
-		        footer-hide
-		        closable
-		        title="上传头像"
-		        :mask-closable="false"
-		        :z-index="1"
-		>
-		    <uploadPictures
-		            :isChoice="isChoice"
-		            @getPic="getPic"
-		            :gridBtn="gridBtn"
-		            :gridPic="gridPic"
-		            v-if="modalPic"
-		    ></uploadPictures>
+		<Modal v-model="modalPic" width="960px" scrollable footer-hide closable title="上传头像" :mask-closable="false"
+			:z-index="1">
+			<uploadPictures :isChoice="isChoice" @getPic="getPic" :gridBtn="gridBtn" :gridPic="gridPic" v-if="modalPic">
+			</uploadPictures>
+		</Modal>
+		<Modal v-model="modals" title="用户列表" footerHide class="paymentFooter" scrollable width="900">
+			<user-list ref="userList" :goodsType="1" v-if="modals" @getUserId="getUserId" :serviceCard="1"></user-list>
 		</Modal>
 	</div>
 </template>
 
 <script>
-	// import { keyApi} from '@/api/setting';
 	import uploadPictures from "@/components/uploadPictures";
-	import goodsList from '@/components/goodsList'
+	import userList from "@/components/userList"
 	import {
-		keyApi,
-		storeGetInfoApi,
-		cityApi,
-		storeUpdateApi,
-		cascaderList,
-		staffListInfo,
 		getDepartmentList,
 		addYg,
 		editYg
@@ -136,8 +109,8 @@
 	export default {
 		name: 'systemSt',
 		components: {
-			goodsList,
-			uploadPictures
+			uploadPictures,
+			userList
 		},
 		props: {},
 		data() {
@@ -158,16 +131,17 @@
 				}
 			};
 			return {
+				checkUser: {}, //选择的用户
+				modals: false, //用户弹窗
 				isEdit: 0, //0->添加 1->编辑
-				staffData: [],
 				goodsList: [],
-				modals: false,
 				treeSelect: [],
 				modalErp: false,
 				openErp: false,
 				isTemplate: false,
 				title: '',
 				formItem: {
+					uid: '',
 					name: '',
 					avatar: '',
 					mobile: '',
@@ -228,7 +202,8 @@
 				pid: 0,
 				isApi: 0,
 				add: 0,
-				departmentList: []
+				departmentList: [],
+				isMobile: false,
 			}
 		},
 		created() {
@@ -250,9 +225,6 @@
 			}
 		},
 		computed: {
-			...mapState('admin/layout', [
-				'isMobile'
-			]),
 			labelWidth() {
 				return this.isMobile ? undefined : 120;
 			},
@@ -262,9 +234,15 @@
 		},
 		mounted: function() {},
 		methods: {
-			handleRemove() {
-			    this.formValidate.avatar = '';
-			    // this.$refs.formValidate.validateField('image');
+			//获取用户id
+			getUserId(row) {
+				this.modals = false
+				this.formItem.uid = row.uid
+				this.checkUser = row
+				console.log(row, '用户id')
+			},
+			chooseUser() {
+				this.modals = true
 			},
 			changeBm(res) {
 				console.log(res);
@@ -277,54 +255,6 @@
 					this.departmentList = res.data
 				})
 			},
-			userSearchs() {
-				// this.orderData.page = 1;
-				// this.searchList();
-			},
-			
-			//对象数组去重;
-			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 = {
@@ -340,7 +270,6 @@
 				this.isApi = 0;
 			},
 			cancel() {
-				console.log('关闭');
 				this.isTemplate = false;
 				this.clearFrom();
 			},
@@ -353,7 +282,6 @@
 			getPic(pc) {
 				this.formItem.avatar = pc.att_dir;
 				this.modalPic = false;
-				// this.$refs.formItem.validateField("avatar")
 			},
 			// 提交
 			handleSubmit(name) {

+ 5 - 40
src/pages/check/staff/index.vue

@@ -38,24 +38,12 @@
 	export default {
 		name: "storeList",
 		components: {
-			addStaff,
+			addStaff
 		},
 		data() {
 			return {
-				
+				isMobile: false,
 				staffInfo: {},
-				staffData: [],
-				queryData:{
-				  page: 1,
-				  limit: 10,
-				  type: '',
-				  status: "",
-				  time: "",
-				  real_name: "",
-				  store_id: "",
-				  order_type: 6,
-				},
-				BaseURL: '',
 				total: 0,
 				loading: false,
 				formValidate: {
@@ -117,27 +105,16 @@
 					},
 				],
 				orderList: [{
-					id: "1",
-					order_id: "12",
-					pay_price: "12",
-					status: 1,
-					phone: "13000000000",
-					address: "陕西省西安市莲湖区大兴西路啊餐厨",
+					avatar: ''
 				}, ],
 			};
 		},
-		computed: {
-			labelWidth() {
-				return this.isMobile ? undefined : 96;
-			},
-			labelPosition() {
-				return this.isMobile ? "top" : "right";
-			},
-		},
+		
 		mounted() {
 			this.getList();
 		},
 		methods: {
+			
 			addsuccess() {
 				this.getList()
 			},
@@ -167,12 +144,6 @@
 				console.log(row);
 				this.$refs.template.formItem = row
 			},
-			getExpiresTime(expiresTime) {
-				let nowTimeNum = Math.round(new Date() / 1000);
-				let expiresTimeNum = expiresTime - nowTimeNum;
-				return parseFloat(parseFloat(parseFloat(expiresTimeNum / 60) / 60) / 24);
-			},
-			
 			delte(row, tit, num) {
 				let delfromData = {
 					title: tit,
@@ -195,12 +166,6 @@
 						this.$Message.error(res.msg);
 					});
 			},
-			searchs() {},
-			onClickTab(e) {
-				this.formValidate.page = 1;
-				this.formValidate.type = e;
-				this.getList();
-			},
 			//分页
 			pageChange(status) {
 				this.formValidate.page = status;