|
@@ -5,7 +5,6 @@
|
|
|
<div class="navigation-bar">
|
|
|
<div>姓名</div>
|
|
|
<div>手机</div>
|
|
|
- <div>工种</div>
|
|
|
<div>状态</div>
|
|
|
<div @click="filter.show = true">
|
|
|
<div>筛选</div>
|
|
@@ -13,111 +12,125 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!--筛选组件-->
|
|
|
- <transition name="filter">
|
|
|
- <div v-if="filter.show" class="filter">
|
|
|
- <div @click="filter.show = false"></div>
|
|
|
- <div @click="filter.show = true">
|
|
|
- <div class="content">
|
|
|
- <title>筛选</title>
|
|
|
- <label>
|
|
|
- <group>
|
|
|
- <div>
|
|
|
- <div style="padding: 15px;font-size: 1.1rem;color: #9e9e9e" v-if="virtualShow2"
|
|
|
- @click="virtualShow2 = false">
|
|
|
- {{ type.search == ''?'请输入姓名或手机' : type.search}}
|
|
|
- </div>
|
|
|
- <input style="min-height: 2.5rem;font-size: 1.1rem;padding-left: 15px;width: 100%;" maxlength="11"
|
|
|
- v-show="virtualShow2 === false"
|
|
|
- autofocus="autofocus"
|
|
|
- type="text" class="weui-input" placeholder="请输入姓名或手机"
|
|
|
- v-model="type.search" v-focus="{virtualShowF}">
|
|
|
- <!--<input type="text" style="min-height: 1rem;padding: 5px;" @blur="focusState = false" @click="focusState = true" v-focus="focusState">-->
|
|
|
- <!--<div @click="focusState = true">按钮</div>-->
|
|
|
- </div>
|
|
|
- </group>
|
|
|
- <group>
|
|
|
- <div class="weui-cell weui-cell_select weui-cell_select-after">
|
|
|
- <div class="weui-cell__bd">
|
|
|
- <div class="weui-select" v-model="typeStatus" @click="typeStatusF">{{typeStatus}}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </group>
|
|
|
-
|
|
|
- <group>
|
|
|
- <div class="time">
|
|
|
- <span v-if="hourlyTime" style="padding: 15px;display: block;font-size: .7rem;">钟点工时间选择</span>
|
|
|
- <div class="hourlyTime" v-if="hourlyTime">
|
|
|
- <!--钟点工-->
|
|
|
- <div @click="timeAMF" style="font-size: .8rem">{{partTimeWorkers.timeAmStr}}</div>
|
|
|
- <div>~</div>
|
|
|
- <div @click="timePMF" style="font-size: .8rem">{{partTimeWorkers.timePmStr}}</div>
|
|
|
- </div>
|
|
|
- <div v-if="home.editShow">
|
|
|
- <!--住家-->
|
|
|
- <div class="title">
|
|
|
- <div v-if="home.editShow" style="padding: 5px;display: block;font-size: .7rem;">住家日期选择</div>
|
|
|
- </div>
|
|
|
- <div v-if="home.editShow" class="contents" @click="getTime"
|
|
|
- style="padding: 15px;text-align: center;font-size: .8rem;">
|
|
|
- {{home.timeStr}}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </group>
|
|
|
+ <!-- <scroller height='75%' :on-refresh="refresh" :on-infinite="infinite" class="search"> -->
|
|
|
+ <scroller :noDataText="'没有更多数据'" ref="scroller" height='75%' :on-refresh="refresh" :on-infinite="infinite"
|
|
|
+ class="search" style="height: 80vh;padding-top:6rem;">
|
|
|
+ <div class="search-item" v-if="item" v-for="(item,index) in searchList" :key="index" @click="toInfo(item)">
|
|
|
+ <div>{{item.name}}</div>
|
|
|
+ <div>{{item.phone}}</div>
|
|
|
+ <div>{{item.status_str}}</div>
|
|
|
+ </div>
|
|
|
+ <div v-if="searchList.length == 0"
|
|
|
+ style="border:0;padding:2rem;box-sizing: border-box;text-align:center;display:block;font-size:.7rem;color:rgba(0,0,0,0.4);">
|
|
|
+ 没有更多数据
|
|
|
+ </div>
|
|
|
+ </scroller>
|
|
|
|
|
|
- <group>
|
|
|
- <div class="weui-cell weui-cell_select weui-cell_select-after">
|
|
|
- <div class="weui-cell__bd">
|
|
|
- <div class="weui-select" v-model="status" @click="statusF">{{status}}</div>
|
|
|
- </div>
|
|
|
+ <!--筛选组件-->
|
|
|
+ <transition name="filter">
|
|
|
+ <div v-if="filter.show" class="filter">
|
|
|
+ <div @click="filter.show = false"></div>
|
|
|
+ <div @click="filter.show = true">
|
|
|
+ <div class="content">
|
|
|
+ <title>筛选</title>
|
|
|
+ <label>
|
|
|
+ <group>
|
|
|
+ <div>
|
|
|
+ <div style="padding: 16px;font-size: 1.1rem;color: #9e9e9e"
|
|
|
+ v-bind:style="{color:type.search == ''? '#9e9e9e':'#000'}" v-if="virtualShow2"
|
|
|
+ @click="virtualShow2 = false">
|
|
|
+ {{ type.search == ''?'请输入姓名或手机' : type.search}}
|
|
|
+ </div>
|
|
|
+ <input
|
|
|
+ style="min-height: 2.5rem;font-size: 1.1rem;padding-left: 15px;width: 100%;padding-top: 6px;padding-bottom: 6px;"
|
|
|
+ maxlength="11"
|
|
|
+ v-show="virtualShow2 === false"
|
|
|
+ autofocus="autofocus"
|
|
|
+ type="text" class="weui-input" placeholder="请输入姓名或手机"
|
|
|
+ v-model="type.search" v-focus="{virtualShowF}">
|
|
|
+ </div>
|
|
|
+ </group>
|
|
|
+ <group>
|
|
|
+ <div class="weui-cell weui-cell_select weui-cell_select-after">
|
|
|
+ <div class="weui-cell__bd">
|
|
|
+ <div class="weui-select" v-model="typeStatus" @click="typeStatusF">{{typeStatus}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </group>
|
|
|
+
|
|
|
+ <group>
|
|
|
+ <div class="time">
|
|
|
+ <span v-if="hourlyTime" style="padding: 15px;display: block;font-size: .7rem;">钟点工时间选择</span>
|
|
|
+ <div class="hourlyTime" v-if="hourlyTime">
|
|
|
+ <!--钟点工-->
|
|
|
+ <div @click="timeAMF" style="font-size: .8rem">{{partTimeWorkers.timeAmStr}}</div>
|
|
|
+ <div>~</div>
|
|
|
+ <div @click="timePMF" style="font-size: .8rem">{{partTimeWorkers.timePmStr}}</div>
|
|
|
+ </div>
|
|
|
+ <div v-if="home.editShow">
|
|
|
+ <!--住家-->
|
|
|
+ <div class="title">
|
|
|
+ <div v-if="home.editShow" style="padding: 5px;display: block;font-size: .7rem;">日期选择</div>
|
|
|
</div>
|
|
|
- </group>
|
|
|
- </label>
|
|
|
- <div class="btnBox" v-if="virtualShow">
|
|
|
- <div @click="Reset">重置</div>
|
|
|
- <div @click="submit">筛选</div>
|
|
|
+ <div v-if="home.editShow" class="contents" @click="getTime"
|
|
|
+ style="padding: 15px;text-align: center;font-size: .8rem;">
|
|
|
+ {{home.timeStr}}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </group>
|
|
|
|
|
|
+ <group>
|
|
|
+ <div class="weui-cell weui-cell_select weui-cell_select-after">
|
|
|
+ <div class="weui-cell__bd">
|
|
|
+ <div class="weui-select" v-model="status" @click="statusF">{{status}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </group>
|
|
|
+ </label>
|
|
|
+ <div class="btnBox" v-if="virtualShow">
|
|
|
+ <div @click="Reset">重置</div>
|
|
|
+ <div @click="submit(1)">筛选</div>
|
|
|
</div>
|
|
|
- </transition>
|
|
|
- <Navigation v-if="virtualShow"></Navigation>
|
|
|
-
|
|
|
- <div v-transfer-dom>
|
|
|
- <!--钟点工-->
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
+</div>
|
|
|
+</transition>
|
|
|
+<Navigation v-if="virtualShow"></Navigation>
|
|
|
+
|
|
|
+</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import _ from '@/config'
|
|
|
- import {XInput, Group, Popup, Picker, TransferDom} from 'vux'
|
|
|
+import _ from '@/config'
|
|
|
+import {XInput, Group, Popup, Picker, TransferDom} from 'vux'
|
|
|
|
|
|
- export default {
|
|
|
- name: "employee",
|
|
|
- data() {
|
|
|
- return {
|
|
|
+export default {
|
|
|
+ name: "employee",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
//测试
|
|
|
- focusState: false,
|
|
|
+ storeId: '',
|
|
|
search: '',
|
|
|
+ // 刷新
|
|
|
+ page: 1,
|
|
|
+ pageNext: true,
|
|
|
// 筛选
|
|
|
filter: {
|
|
|
- show: true,
|
|
|
+ show: false,
|
|
|
},
|
|
|
// 工作类型
|
|
|
type: {
|
|
|
list: [
|
|
|
- {label: '钟点工', value: 1},
|
|
|
- {label: '月嫂', value: 2},
|
|
|
- {label: '育婴师', value: 3},
|
|
|
- {label: '护理老人', value: 4,},
|
|
|
- {label: '全套家务', value: 5}
|
|
|
+ {label: '钟点工', value: 1},
|
|
|
+ {label: '月嫂', value: 2},
|
|
|
+ {label: '育婴师', value: 3},
|
|
|
+ {label: '护理老人', value: 4,},
|
|
|
+ {label: '全套家务', value: 5}
|
|
|
],
|
|
|
str: '',
|
|
|
- search: ''
|
|
|
+ search: '',
|
|
|
+ value: ''
|
|
|
},
|
|
|
// 工种选择
|
|
|
typeStatus: '工种选择',
|
|
@@ -130,36 +143,300 @@
|
|
|
popup: false,
|
|
|
arr: [],
|
|
|
timeAM: [],
|
|
|
+ timeAMlist: [],
|
|
|
timeAmStr: '开始时间',
|
|
|
timePM: [],
|
|
|
+ timePMlist: [],
|
|
|
timePmStr: '结束时间',
|
|
|
arrStr: "设置钟点工时间"
|
|
|
},
|
|
|
// 住家日期选择
|
|
|
home: {
|
|
|
- timeStr: '住家日期选择',
|
|
|
+ timeStr: '日期选择',
|
|
|
time: '',
|
|
|
editShow: false
|
|
|
},
|
|
|
// 处理虚拟键盘
|
|
|
virtualShow: true,
|
|
|
virtualShow2: true,
|
|
|
+ // 搜索结果
|
|
|
+ searchList: []
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.top = 1;
|
|
|
+ this.bottom = 10;
|
|
|
+ },
|
|
|
created() {
|
|
|
- this.partTimeWorkers.timeAM = this.timeArr(6, 19);
|
|
|
- this.partTimeWorkers.timePM = this.timeArr(7, 20);
|
|
|
+ let loading = weui.loading('加载中...', {
|
|
|
+ className: 'custom-classname'
|
|
|
+ });
|
|
|
+ let self = this;
|
|
|
+ self.partTimeWorkers.timeAMlist = self.timeArr(6, 19);
|
|
|
+ self.partTimeWorkers.timePMlist = self.timeArr(7, 20);
|
|
|
+ _.$http('/j/HouseKeeping/GetUser', {
|
|
|
+ user_id: _.user_id
|
|
|
+ }, res => {
|
|
|
+ self.storeId = res.data.store_id;
|
|
|
+ // 传值绑定
|
|
|
+ // console.log(946724400);
|
|
|
+ /*this.time.start = _.timetrans(this.order.server_start_time);
|
|
|
+ this.time.start = this.time.start.substring(11, 16);*/
|
|
|
+
|
|
|
+
|
|
|
+ // console.log(self.ycTime(bookingTime));
|
|
|
+
|
|
|
+
|
|
|
+ // this.time.start = _.timetrans(this.oldOrderInfo.server_start_time);
|
|
|
+ if (_.oldOrderInfo != undefined) {
|
|
|
+
|
|
|
+ // 工种
|
|
|
+
|
|
|
+ self.type.value = _.oldOrderInfo.type;
|
|
|
+ for (let i in self.type.list) {
|
|
|
+ if (self.type.list[i].value == self.type.value) {
|
|
|
+ self.typeStatus = self.type.list[i].label
|
|
|
+ }
|
|
|
+ }
|
|
|
+ self.hourlyTime = self.type.value == 1 ? true : false;
|
|
|
+ self.home.editShow = self.type.value != 1 ? true : false;
|
|
|
+
|
|
|
+
|
|
|
+ // 时间
|
|
|
+ if (_.oldOrderInfo.server_end_time != undefined) {
|
|
|
+ let timeAmString = _.timetrans(_.oldOrderInfo.server_start_time).substring(11, 16);
|
|
|
+ let timePmString = _.timetrans(_.oldOrderInfo.server_end_time).substring(11, 16);
|
|
|
+ timeAmString = self.timeStrF(timeAmString)
|
|
|
+ timePmString = self.timeStrF(timePmString)
|
|
|
+ self.partTimeWorkers.timeAM = {
|
|
|
+ label: `${timeAmString}:00`,
|
|
|
+ value: timeAmString
|
|
|
+ };
|
|
|
+ self.partTimeWorkers.timeAmStr = self.partTimeWorkers.timeAM.label;
|
|
|
+
|
|
|
+ self.partTimeWorkers.timePM = {
|
|
|
+ label: `${timePmString}:00`,
|
|
|
+ value: timePmString
|
|
|
+ };
|
|
|
+ self.partTimeWorkers.timePmStr = self.partTimeWorkers.timePM.label;
|
|
|
+ }
|
|
|
+ // 日期
|
|
|
+
|
|
|
+ let $bookingTime = _.oldOrderInfo.bookingTime.split(' ')[0];
|
|
|
+ self.home.time = self.ycTime($bookingTime+' 00:00');
|
|
|
+ self.home.timeStr = $bookingTime
|
|
|
+
|
|
|
+ /*if (_.oldOrderInfo.yc_time != '1970-01-01') {
|
|
|
+ self.home.time = self.ycTime(_.oldOrderInfo.yc_time + ' 00:00');
|
|
|
+
|
|
|
+ self.home.timeStr = _.oldOrderInfo.yc_time
|
|
|
+ } else {
|
|
|
+ let $bookingTime = _.oldOrderInfo.bookingTime.split(' ')[0];
|
|
|
+ self.home.time = self.ycTime($bookingTime+' 00:00');
|
|
|
+ self.home.timeStr = $bookingTime
|
|
|
+ }*/
|
|
|
+ // 状态
|
|
|
+ self.statusValue = 2;
|
|
|
+ self.status = '已激活';
|
|
|
+ self.submit(1);
|
|
|
+ }
|
|
|
+ // self.submit(self.page)
|
|
|
+ loading.hide(function () {
|
|
|
+ });
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
- // 显示筛选
|
|
|
+ // 辅助函数
|
|
|
+ timeStrF(t) {
|
|
|
+ let time = '';
|
|
|
+ t = t.toString();
|
|
|
+ if (t.indexOf('30') > -1) {
|
|
|
+ time = Number.parseInt(t.split(':')[0]) + 0.5
|
|
|
+ } else {
|
|
|
+ time = Number.parseInt(t.split(':')[0])
|
|
|
+ }
|
|
|
+ return time
|
|
|
+ }
|
|
|
+ ,
|
|
|
+ // 阻断无限刷新
|
|
|
+ btnSearch() {
|
|
|
+ let that = this;
|
|
|
+ let $height = document.documentElement.clientHeight;
|
|
|
+ let $navigation = document.getElementsByClassName('navigation');
|
|
|
+ let $nav = document.getElementsByClassName('nav');
|
|
|
+ // let $search = document.getElementsByClassName('search');
|
|
|
+ let $searchItem = document.getElementsByClassName('search-item');
|
|
|
+ let $searchItemHeight, $thisHeight;
|
|
|
+ if ($searchItem.length > 0) {
|
|
|
+ $searchItemHeight = $searchItem[0].clientHeight * that.searchList.length;
|
|
|
+ } else {
|
|
|
+ $searchItemHeight = 0;
|
|
|
+ }
|
|
|
+ // console.log($height);
|
|
|
+ // 设置中间空白的高度
|
|
|
+ // 总高度 - 顶部导航条高度 - 底部导航高度 - 中间组件列表的高度
|
|
|
+ $thisHeight = $height - $nav[0].clientHeight - $navigation[0].clientHeight - $searchItemHeight;
|
|
|
+ // console.log($thisHeight);
|
|
|
+ that.$refs.scroller.finishInfinite($thisHeight - 100 > 0);
|
|
|
+ // return $thisHeight - 100 > 0;
|
|
|
+ /*if ($searchItemHeight != undefined) {
|
|
|
+ $thisHeight = $height - $nav[0].clientHeight - $navigation[0].clientHeight - $searchItemHeight;
|
|
|
+ console.log($thisHeight);
|
|
|
+ }*/
|
|
|
+ }
|
|
|
+ ,
|
|
|
// 提交
|
|
|
- submit() {
|
|
|
- console.log(this.type.str)
|
|
|
- },
|
|
|
+ submit(page) {
|
|
|
+ let self = this,
|
|
|
+ timeAM = self.partTimeWorkers.timeAM,
|
|
|
+ workTime,
|
|
|
+ timePM = self.partTimeWorkers.timePM;
|
|
|
+ let loading = weui.loading('筛选中', {
|
|
|
+ className: 'custom-classname'
|
|
|
+ });
|
|
|
+ // 首次筛选,初始化数据
|
|
|
+ if (page == 1) {
|
|
|
+ self.page = page;
|
|
|
+ self.pageNext = true;
|
|
|
+ self.searchList = [];
|
|
|
+
|
|
|
+ } else {
|
|
|
+ loading.hide(function () {
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (page == '筛选') {
|
|
|
+ page = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 姓名或者手机 self.type.search
|
|
|
+ /*if (self.type.search == '') {
|
|
|
+ self.$vux.alert.show({content: '请输入姓名或手机!'});
|
|
|
+ return
|
|
|
+ }*/
|
|
|
+ // 工种 self.type.value
|
|
|
+ // 钟点工时间
|
|
|
+ /*if (self.type.value === 1 && ((timeAM.length > 1 || timePM.length > 1) || timePM - timeAM <= 0)) {
|
|
|
+ self.$vux.alert.show({content: '钟点工的时间选择错误!'});
|
|
|
+ return
|
|
|
+ }*/
|
|
|
+
|
|
|
+ // console.log(workTime.length);
|
|
|
+ if (self.type.value !== 1) {
|
|
|
+ workTime = ''
|
|
|
+ } else {
|
|
|
+ workTime = JSON.stringify({start: timeAM.value, end: timePM.value});
|
|
|
+ }
|
|
|
+ // 日期
|
|
|
+ /*if (self.home.time === '') {
|
|
|
+ self.$vux.alert.show({content: '钟点工的时间选择错误!'});
|
|
|
+ return
|
|
|
+ }*/
|
|
|
+ // 状态
|
|
|
+ // console.log(self.statusValue);
|
|
|
+ // console.log(self.pageNext);
|
|
|
+
|
|
|
+ // 阻止无限加载
|
|
|
+ if (self.pageNext) {
|
|
|
+ _.$http('/j/JGEmpolyer/List/', {
|
|
|
+ storeId: self.storeId,
|
|
|
+ userId: _.user_id,
|
|
|
+ search: self.type.search,
|
|
|
+ work_time: self.home.time,
|
|
|
+ work_type: self.type.value,
|
|
|
+ status: self.statusValue != '' ? self.statusValue - 1 : 100,
|
|
|
+ work_time_part: workTime,
|
|
|
+ page: page,
|
|
|
+ rows: 10
|
|
|
+ }, res => {
|
|
|
+ // 如果结果为空,将不再刷新
|
|
|
+ if (res.data.rows.length == 0) {
|
|
|
+ self.pageNext = false
|
|
|
+ }
|
|
|
+ // 如果搜索结果为空,分页设置=>第二页
|
|
|
+ if (self.searchList.length == 0) {
|
|
|
+ self.page = 2;
|
|
|
+ }
|
|
|
+ // 将搜索结果存入页面缓存中
|
|
|
+ for (let i in res.data.rows) {
|
|
|
+ self.searchList.push(res.data.rows[i])
|
|
|
+ }
|
|
|
+ /* for (let i = 0; i < 16; i++) {
|
|
|
+ self.searchList.push(res.data.rows[0]);
|
|
|
+ }*/
|
|
|
+ self.filter.show = false;
|
|
|
+
|
|
|
+ loading.hide(function () {
|
|
|
+ });
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ loading.hide(function () {
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ,
|
|
|
+ // 下拉刷新
|
|
|
+ refresh(done) {
|
|
|
+ let self = this;
|
|
|
+ self.$refs.scroller.finishPullToRefresh();
|
|
|
+ /*setTimeout(function () {
|
|
|
+ let start = self.top - 1;
|
|
|
+ /!* for (let i = start; i > start - 10; i--) {
|
|
|
+ self.items.splice(0, 0, i + ' - keep walking, be 2 with you.');
|
|
|
+ }*!/
|
|
|
+
|
|
|
+ // for(let j = 0;j < 5;j++){
|
|
|
+ // self.searchList.push(self.searchList[j])
|
|
|
+ // }
|
|
|
+ self.top = self.top - 10;
|
|
|
+ done();
|
|
|
+ }, 500)*/
|
|
|
+ }
|
|
|
+ ,
|
|
|
+ // 上拉刷新
|
|
|
+ infinite(done) {
|
|
|
+ let self = this;
|
|
|
+ self.btnSearch();
|
|
|
+ // 搜索结果为空时,阻止刷新
|
|
|
+ if (self.pageNext == false || self.page == 1) {
|
|
|
+ self.$refs.scroller.finishInfinite(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*setTimeout(function () {
|
|
|
+ if (self.btnSearch()) {
|
|
|
+ self.pageNext = false;
|
|
|
+ self.$refs.scroller.finishInfinite(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }, 100);*/
|
|
|
+ // 没有搜索结果,阻止刷新
|
|
|
+ if (self.searchList.length < 1) {
|
|
|
+ self.$refs.scroller.finishInfinite(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // push数据,调用调用筛选函数
|
|
|
+ // 刷新操作,是在筛选成功之后执行
|
|
|
+ if (self.page > 1 && self.searchList.length > 14) {
|
|
|
+ // 首次调用无限刷新时,修改组件高度
|
|
|
+ setTimeout(function () {
|
|
|
+ ++self.page;
|
|
|
+ self.submit(self.page);
|
|
|
+ done();
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ,
|
|
|
+ //
|
|
|
+ toInfo(item) {
|
|
|
+ _.editHouseInfo = {};
|
|
|
+ _.editHouseInfo = item;
|
|
|
+ this.$router.push({path: '/managementHomeClerkDetails'})
|
|
|
+ }
|
|
|
+ ,
|
|
|
// 工种选择
|
|
|
typeStatusF() {
|
|
|
- let that = this;
|
|
|
- weui.picker(that.type.list, {
|
|
|
+ let self = this;
|
|
|
+ weui.picker(self.type.list, {
|
|
|
className: 'custom-classname',
|
|
|
container: 'body',
|
|
|
defaultValue: [1],
|
|
@@ -167,53 +444,56 @@
|
|
|
},
|
|
|
onConfirm: function (result) {
|
|
|
let val = result[0].value;
|
|
|
- that.typeStatus = result[0].label;
|
|
|
- that.hourlyTime = val == 1 ? true : false;
|
|
|
- that.home.editShow = val == 5 ? true : false;
|
|
|
- if (that.home.editShow) {
|
|
|
- that.home.timeStr = '选择住家日期';
|
|
|
- that.home.time = '';
|
|
|
+ self.type.value = val;
|
|
|
+ self.typeStatus = result[0].label;
|
|
|
+ self.hourlyTime = val == 1 ? true : false;
|
|
|
+ self.home.editShow = val !== 1 ? true : false;
|
|
|
+ // 重置
|
|
|
+ if (self.home.editShow) {
|
|
|
+ self.home.timeStr = '选择日期';
|
|
|
+ self.home.time = '';
|
|
|
}
|
|
|
},
|
|
|
id: 'singleLinePickerAM'
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
// 钟点工时间选择
|
|
|
timeAMF() {
|
|
|
- let that = this;
|
|
|
- weui.picker(that.partTimeWorkers.timeAM, {
|
|
|
+ let self = this;
|
|
|
+ weui.picker(self.partTimeWorkers.timeAMlist, {
|
|
|
className: 'custom-classname',
|
|
|
container: 'body',
|
|
|
defaultValue: [1],
|
|
|
onChange: function (result) {
|
|
|
},
|
|
|
onConfirm: function (result) {
|
|
|
- console.log(result[0])
|
|
|
- that.partTimeWorkers.timeAmStr = result[0].label;
|
|
|
- // that.serviceTimeAM = result[0].label;
|
|
|
+ self.partTimeWorkers.timeAmStr = result[0].label;
|
|
|
+ self.partTimeWorkers.timeAM = result[0];
|
|
|
},
|
|
|
id: 'singleLinePickerAM'
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
timePMF() {
|
|
|
- let that = this;
|
|
|
- weui.picker(that.partTimeWorkers.timePM, {
|
|
|
+ let self = this;
|
|
|
+ weui.picker(self.partTimeWorkers.timePMlist, {
|
|
|
className: 'custom-classname',
|
|
|
container: 'body',
|
|
|
defaultValue: [1],
|
|
|
onChange: function (result) {
|
|
|
},
|
|
|
onConfirm: function (result) {
|
|
|
- console.log(result[0])
|
|
|
- that.partTimeWorkers.timePmStr = result[0].label;
|
|
|
- // that.serviceTimeAM = result[0].label;
|
|
|
+ self.partTimeWorkers.timePmStr = result[0].label;
|
|
|
+ self.partTimeWorkers.timePM = result[0];
|
|
|
},
|
|
|
id: 'singleLinePickerAM'
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
// 住家日期
|
|
|
getTime() {
|
|
|
- let that = this;
|
|
|
+ let self = this;
|
|
|
let currentDate = new Date(); // Sat Jun 24 2017 10:09:18 GMT+0800 (中国标准时间)
|
|
|
let currentYear = currentDate.getFullYear(); // 当前年 2017
|
|
|
let currentMonth = currentDate.getMonth() + 1; // 当前月 6
|
|
@@ -225,34 +505,37 @@
|
|
|
onChange: function (result) {
|
|
|
},
|
|
|
onConfirm: function (result) {
|
|
|
- that.home.timeStr = result[0].label + result[1].label + result[2].label
|
|
|
- that.home.time = ycTime(`${result[0].value}-${result[1].value}-${result[2].value}`);
|
|
|
+ self.home.timeStr = result[0].label + result[1].label + result[2].label
|
|
|
+ self.home.time = ycTime(`${result[0].value}-${result[1].value}-${result[2].value}`);
|
|
|
},
|
|
|
id: 'datePicker'
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
// 激活状态
|
|
|
statusF() {
|
|
|
- let that = this;
|
|
|
+ let self = this;
|
|
|
weui.picker([
|
|
|
{label: '未激活', value: 1},
|
|
|
{label: '已激活', value: 2}
|
|
|
- ], {
|
|
|
- className: 'custom-classname',
|
|
|
- container: 'body',
|
|
|
- defaultValue: [1],
|
|
|
- onChange: function (result) {
|
|
|
- },
|
|
|
- onConfirm: function (result) {
|
|
|
- that.statusValue = result[0].value;
|
|
|
- that.status = result[0].label;
|
|
|
- },
|
|
|
- id: 'singleLinePickerAM'
|
|
|
- });
|
|
|
- },
|
|
|
+ ], {
|
|
|
+ className: 'custom-classname',
|
|
|
+ container: 'body',
|
|
|
+ defaultValue: [1],
|
|
|
+ onChange: function (result) {
|
|
|
+ },
|
|
|
+ onConfirm: function (result) {
|
|
|
+ self.statusValue = result[0].value;
|
|
|
+ self.status = result[0].label;
|
|
|
+ },
|
|
|
+ id: 'singleLinePickerAM'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ ,
|
|
|
// 重置
|
|
|
Reset(index) {
|
|
|
this.type.search = '';
|
|
|
+ this.type.value = ''
|
|
|
this.typeStatus = '工种选择';
|
|
|
this.status = '状态选择';
|
|
|
this.partTimeWorkers.timeAM = [];
|
|
@@ -261,26 +544,28 @@
|
|
|
this.partTimeWorkers.timePmStr = '结束时间';
|
|
|
this.hourlyTime = false;
|
|
|
this.home.editShow = false;
|
|
|
- this.home.timeStr = '住家日期选择';
|
|
|
- this.home.time = false;
|
|
|
+ this.home.timeStr = '选择日期';
|
|
|
+ this.home.time = '';
|
|
|
this.status = '状态选择'; // 激活状态
|
|
|
this.statusValue = '';
|
|
|
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
// 解决设置过fixed属性的元素被虚拟键盘顶起的问题
|
|
|
virtualShowF(index) {
|
|
|
switch (index) {
|
|
|
case 0:
|
|
|
- this.virtualShow = false;
|
|
|
- this.virtualShow2 = false;
|
|
|
+ this.virtualShow = false;
|
|
|
+ this.virtualShow2 = false;
|
|
|
|
|
|
- break;
|
|
|
+ break;
|
|
|
case 1:
|
|
|
- this.virtualShow = true;
|
|
|
- this.virtualShow2 = true;
|
|
|
- break;
|
|
|
+ this.virtualShow = true;
|
|
|
+ this.virtualShow2 = true;
|
|
|
+ break;
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
workTypePartF(w) {
|
|
|
if (w.length > 0) {
|
|
|
this.partTimeWorkers.arrStr = '';
|
|
@@ -290,7 +575,8 @@
|
|
|
this.partTimeWorkers.arrStr += `[${this.timeStr(w[i].start)}-${this.timeStr(w[i].end)}] `
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
// 辅助函数
|
|
|
timeStr(t) {
|
|
|
let time = '';
|
|
@@ -301,7 +587,8 @@
|
|
|
time = t += ':00'
|
|
|
}
|
|
|
return time
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
timeArr(start, end) {
|
|
|
let arr = [], index = true;
|
|
|
for (start; start < end; start++) {
|
|
@@ -317,7 +604,16 @@
|
|
|
}
|
|
|
return arr
|
|
|
}
|
|
|
- },
|
|
|
+ ,
|
|
|
+ // 日期转时间戳 2014-07-10
|
|
|
+ ycTime(t) {
|
|
|
+ let stringTime = t;
|
|
|
+ let timestamp = Date.parse(new Date(stringTime));
|
|
|
+ timestamp = timestamp / 1000;
|
|
|
+ return timestamp;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ,
|
|
|
watch: {
|
|
|
// 控制时间展示
|
|
|
/*typeStatus: function (val, oldVal) {
|
|
@@ -327,38 +623,41 @@
|
|
|
},*/
|
|
|
/*status: function (val, oldVal) {
|
|
|
}*/
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
components: {
|
|
|
XInput, Group, Popup, Picker
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
// 自定义指令
|
|
|
directives: {
|
|
|
TransferDom,
|
|
|
- 'focus': {
|
|
|
- /*update: function (el,{value}) {
|
|
|
- if(value){
|
|
|
- el.focus()
|
|
|
+ 'focus':
|
|
|
+ {
|
|
|
+ /*update: function (el,{value}) {
|
|
|
+ if(value){
|
|
|
+ el.focus()
|
|
|
+ }
|
|
|
+ },*/
|
|
|
+ bind: function (el, binding) {
|
|
|
+ el.onfocus = function () {
|
|
|
+ // 创建focus的事件
|
|
|
+ // console.log('创建focus的事件');
|
|
|
+ setTimeout(() => {
|
|
|
+ binding.value.virtualShowF(0)
|
|
|
+ }, 100)
|
|
|
+ };
|
|
|
+ el.onblur = function () {
|
|
|
+ // 创建blur事件
|
|
|
+ // console.log('创建blur事件');
|
|
|
+ setTimeout(() => {
|
|
|
+ binding.value.virtualShowF(1)
|
|
|
+ }, 250)
|
|
|
+ };
|
|
|
}
|
|
|
- },*/
|
|
|
- bind: function (el, binding) {
|
|
|
- el.onfocus = function () {
|
|
|
- // 创建focus的事件
|
|
|
- console.log('创建focus的事件');
|
|
|
- setTimeout(() => {
|
|
|
- binding.value.virtualShowF(0)
|
|
|
- }, 100)
|
|
|
- };
|
|
|
- el.onblur = function () {
|
|
|
- // 创建blur事件
|
|
|
- console.log('创建blur事件');
|
|
|
- setTimeout(() => {
|
|
|
- binding.value.virtualShowF(1)
|
|
|
- }, 250)
|
|
|
- };
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
// 日期转时间戳 2014-07-10
|
|
|
function ycTime(t) {
|
|
@@ -369,19 +668,20 @@
|
|
|
timestamp = timestamp / 1000;
|
|
|
return timestamp;
|
|
|
}
|
|
|
-</script>
|
|
|
+ </script>
|
|
|
|
|
|
-<style scoped lang="less">
|
|
|
+ <style scoped lang="less">
|
|
|
@borderColor: rgba(0, 0, 0, 0.2);
|
|
|
|
|
|
.employee {
|
|
|
|
|
|
.nav {
|
|
|
position: fixed;
|
|
|
- z-index: 1;
|
|
|
+ z-index: 2;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
+ background-color: white;
|
|
|
.title {
|
|
|
font-size: 1.2rem;
|
|
|
font-weight: bold;
|
|
@@ -412,6 +712,25 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .search {
|
|
|
+ & > div > div:nth-child(1) {
|
|
|
+ margin-top: 6rem;
|
|
|
+ }
|
|
|
+ & > div > div:last-child {
|
|
|
+ margin-bottom: 3rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ & > div > div {
|
|
|
+ display: flex;
|
|
|
+ border-bottom: 1px solid @borderColor;
|
|
|
+ margin-bottom: .5rem;
|
|
|
+ div {
|
|
|
+ text-align: center;
|
|
|
+ flex: 1;
|
|
|
+ padding: 10px 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.container {
|
|
|
|
|
|
}
|
|
@@ -501,7 +820,7 @@
|
|
|
transition: transform .3s;
|
|
|
}
|
|
|
.filter-enter, .filter-leave-to
|
|
|
- /* .fade-leave-active below version 2.1.8 */ {
|
|
|
+ /* .fade-leave-active below version 2.1.8 */ {
|
|
|
transform: translateX(105vw);
|
|
|
}
|
|
|
|
|
@@ -513,7 +832,7 @@
|
|
|
transition: all 1s;
|
|
|
}
|
|
|
.list-enter, .list-leave-to
|
|
|
- /* .list-leave-active for below version 2.1.8 */ {
|
|
|
+ /* .list-leave-active for below version 2.1.8 */ {
|
|
|
opacity: 0;
|
|
|
transform: translateY(30px);
|
|
|
}
|
|
@@ -527,4 +846,4 @@
|
|
|
.fade-enter, .fade-leave-to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
-</style>
|
|
|
+ </style>
|