Преглед на файлове

Merge branch 'test' of git.oschina.net:yiguanjia/php into test

north преди 7 години
родител
ревизия
9adfaf03c8
променени са 28 файла, в които са добавени 1738 реда и са изтрити 1032 реда
  1. 0 0
      www/webapp/housekeeping/home/static/css/app.css
  2. 0 0
      www/webapp/housekeeping/home/static/js/app.js
  3. 0 0
      www/webapp/housekeeping/home/static/js/app.js.map
  4. 1 1
      www/webapp/housekeeping/home/static/js/manifest.js
  5. 0 0
      www/webapp/housekeeping/home/static/js/manifest.js.map
  6. 0 0
      www/webapp/housekeeping/home/static/js/vendor.js
  7. 0 0
      www/webapp/housekeeping/home/static/js/vendor.js.map
  8. 1 1
      www/webapp/housekeeping/package.json
  9. 8 8
      www/webapp/housekeeping/src/components/Home.vue
  10. 98 98
      www/webapp/housekeeping/src/components/houseKeeping/edit.vue
  11. 57 57
      www/webapp/housekeeping/src/components/houseKeeping/info.vue
  12. 4 4
      www/webapp/housekeeping/src/components/houseKeeping/isreg.vue
  13. 41 35
      www/webapp/housekeeping/src/components/houseKeeping/login.vue
  14. 162 131
      www/webapp/housekeeping/src/components/management/edit.vue
  15. 491 172
      www/webapp/housekeeping/src/components/management/employee.vue
  16. 291 0
      www/webapp/housekeeping/src/components/management/homeClerkDetails.vue
  17. 24 24
      www/webapp/housekeeping/src/components/management/list.vue
  18. 17 17
      www/webapp/housekeeping/src/components/order.vue
  19. 22 22
      www/webapp/housekeeping/src/components/orderInfo.vue
  20. 1 0
      www/webapp/housekeeping/src/components/public/navigation.vue
  21. 30 30
      www/webapp/housekeeping/src/components/public/selectTime.vue
  22. 45 42
      www/webapp/housekeeping/src/components/public/worksType.vue
  23. 74 71
      www/webapp/housekeeping/src/components/reservation.vue
  24. 23 20
      www/webapp/housekeeping/src/components/userInfo.vue
  25. 71 0
      www/webapp/housekeeping/src/config/globalVariables.js
  26. 17 299
      www/webapp/housekeeping/src/config/index.js
  27. 255 0
      www/webapp/housekeeping/src/config/method.js
  28. 5 0
      www/webapp/housekeeping/src/router/index.js

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
www/webapp/housekeeping/home/static/css/app.css


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
www/webapp/housekeeping/home/static/js/app.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
www/webapp/housekeeping/home/static/js/app.js.map


+ 1 - 1
www/webapp/housekeeping/home/static/js/manifest.js

@@ -1,2 +1,2 @@
-!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,i){for(var u,a,f,s=0,l=[];s<t.length;s++)a=t[s],o[a]&&l.push(o[a][0]),o[a]=0;for(u in c)Object.prototype.hasOwnProperty.call(c,u)&&(e[u]=c[u]);for(r&&r(t,c,i);l.length;)l.shift()();if(i)for(s=0;s<i.length;s++)f=n(n.s=i[s]);return f};var t={},o={2:0};n.e=function(e){function r(){u.onerror=u.onload=null,clearTimeout(a);var n=o[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}var t=o[e];if(0===t)return new Promise(function(e){e()});if(t)return t[2];var c=new Promise(function(n,r){t=o[e]=[n,r]});t[2]=c;var i=document.getElementsByTagName("head")[0],u=document.createElement("script");u.type="text/javascript",u.charset="utf-8",u.async=!0,u.timeout=12e4,n.nc&&u.setAttribute("nonce",n.nc),u.src=n.p+"static/js/"+e+".js";var a=setTimeout(r,12e4);return u.onerror=u.onload=r,i.appendChild(u),c},n.m=e,n.c=t,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="/",n.oe=function(e){throw console.error(e),e}}([]);
+!function(r){function n(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var e=window.webpackJsonp;window.webpackJsonp=function(o,u,c){for(var f,i,p,a=0,l=[];a<o.length;a++)i=o[a],t[i]&&l.push(t[i][0]),t[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(e&&e(o,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=n(n.s=c[a]);return p};var o={},t={2:0};n.m=r,n.c=o,n.d=function(r,e,o){n.o(r,e)||Object.defineProperty(r,e,{configurable:!1,enumerable:!0,get:o})},n.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(e,"a",e),e},n.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},n.p="/",n.oe=function(r){throw console.error(r),r}}([]);
 //# sourceMappingURL=manifest.js.map

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
www/webapp/housekeeping/home/static/js/manifest.js.map


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
www/webapp/housekeeping/home/static/js/vendor.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
www/webapp/housekeeping/home/static/js/vendor.js.map


+ 1 - 1
www/webapp/housekeeping/package.json

@@ -8,7 +8,7 @@
     "dev": "node build/dev-server.js",
     "start": "npm run dev",
     "build": "node build/build.js",
-    "push":"npm run build && git add . && git commit -m . && git push"
+    "push": "npm run build && git add . && git commit -m . && git push"
   },
   "dependencies": {
     "axios": "^0.16.2",

+ 8 - 8
www/webapp/housekeeping/src/components/Home.vue

@@ -54,14 +54,14 @@
     },
     methods: {
       demand(type) {
-        let that = this;
-        if (that.administrator) {
+        let self = this;
+        if (self.administrator) {
           weui.alert('门店管理员无法预约服务!');
           return;
         }
         if (this.registered) {
           weui.confirm('您还未绑定,是否前往绑定界面!', function () {
-            that.$router.push({path: '/userInfo'});
+            self.$router.push({path: '/userInfo'});
             return;
           }, function () {
           });
@@ -79,7 +79,7 @@
       }
     },
     created() {
-      let that = this;
+      let self = this;
       init();
       config.userInfo = []; // 初始化数据
       // 用户是否为管理员
@@ -87,19 +87,19 @@
         user_id: config.user_id
       }, res => {
         if (res.data.store_id == "" || res.data.user_id == "") {
-          // that.registered = true;
+          // self.registered = true;
           config.$http('/o2o/user/info', {
             user_id: config.user_id
           }, function (res) {
             config.userInfo = res.data.data.user_info;
             if (config.userInfo.length === 0) {
-              that.registered = true;
-              // that.$router.push({path: '/userInfo'})
+              self.registered = true;
+              // self.$router.push({path: '/userInfo'})
             }
           })
         } else {
           // 管理员信息
-          that.administrator = true;
+          self.administrator = true;
           // this.$router.push({path: '/managementList'});
         }
       });

+ 98 - 98
www/webapp/housekeeping/src/components/houseKeeping/edit.vue

@@ -200,56 +200,56 @@
         className: 'custom-classname'
       });
       // 初始化数据
-      let that = this;
+      let self = this;
       _.$http('/j/JGEmpolyer/Info', {
         userId: _.user_id
       }, res => {
         if (res.data.success) {
-          that.uInfo = res.data.data;
-          console.log(that.uInfo);
+          self.uInfo = res.data.data;
+          console.log(self.uInfo);
           // 工种判断
-          that.worksType.numberArr = that.uInfo.work_type;
-          that.filter();
+          self.worksType.numberArr = self.uInfo.work_type;
+          self.filter();
           // 钟点工时间
           // 初始化钟点工时间
           // 设置默认钟点工时间.
           // console.log()
-          let worksArrayTime = that.uInfo.work_type.find((element, index, array) => {
+          let worksArrayTime = self.uInfo.work_type.find((element, index, array) => {
             return element === 1 ? true : false
           });
-          if (worksArrayTime !== undefined && that.uInfo.work_time_part === null) {
+          if (worksArrayTime !== undefined && self.uInfo.work_time_part === null) {
             _.$http('/j/JGEmpolyer/Edit', {
-              id: that.uInfo._id.$id,
-              work_types: that.uInfo.work_type,
-              store_id: that.uInfo.store_id,
-              skill: that.uInfo.skill,
+              id: self.uInfo._id.$id,
+              work_types: self.uInfo.work_type,
+              store_id: self.uInfo.store_id,
+              skill: self.uInfo.skill,
               work_time_part: '[{"start":6,"end":19}]', // 钟点工时间段
             }, res => {
               if (res.data.success) {
-                that.partTimeWorkers.arr = [{start: 6, end: 19}]
+                self.partTimeWorkers.arr = [{start: 6, end: 19}]
               }
             })
           }
-          that.partTimeWorkers.arr = that.uInfo.work_time_part;
-          that.partTimeWorkers.arrStr = that.str(that.partTimeWorkers.arr);
+          self.partTimeWorkers.arr = self.uInfo.work_time_part;
+          self.partTimeWorkers.arrStr = self.str(self.partTimeWorkers.arr);
           // 工种
           this.worksType.arr = this.uSort(this.worksType.numberArr, 0);
-          if (that.worksType.arr.length != 0) {
-            that.worksType.arrStr = ''
-            for (let i in that.worksType.arr) {
-              that.worksType.arrStr += `${that.worksType.arr[i].label} `
+          if (self.worksType.arr.length != 0) {
+            self.worksType.arrStr = ''
+            for (let i in self.worksType.arr) {
+              self.worksType.arrStr += `${self.worksType.arr[i].label} `
             }
           }
           // 住家日期
-          if (that.uInfo.work_time === null) {
-            that.home.timeStr = '请选择住家日期'
+          if (self.uInfo.work_time === null) {
+            self.home.timeStr = '请选择住家日期'
           } else {
-            that.home.timeStr = _.timetrans(that.uInfo.work_time);
-            that.home.timeStr = that.home.timeStr.split(' ')[0];
+            self.home.timeStr = _.timetrans(self.uInfo.work_time);
+            self.home.timeStr = self.home.timeStr.split(' ')[0];
           }
 
 
-          that.show(0);
+          self.show(0);
           loading.hide(function () {
             // console.log('`loading` has been hidden');
           });
@@ -262,17 +262,17 @@
         this.partTimeWorkers.popup = popup
       },
       workTypePartF(list) {
-        let that = this;
-        that.partTimeWorkersShow();
-        that.partTimeWorkers.arr = list;
-        that.partTimeWorkers.arrStr = that.str(that.partTimeWorkers.arr);
+        let self = this;
+        self.partTimeWorkersShow();
+        self.partTimeWorkers.arr = list;
+        self.partTimeWorkers.arrStr = self.str(self.partTimeWorkers.arr);
       },
       // 提交
       partTimeWorkersTrue() {
-        let that = this;
+        let self = this;
         // 阻断相同内容重复提交
-        if (JSON.stringify(that.partTimeWorkers.arr) == JSON.stringify(that.uInfo.work_time_part)) {
-          that.$vux.alert.show({
+        if (JSON.stringify(self.partTimeWorkers.arr) == JSON.stringify(self.uInfo.work_time_part)) {
+          self.$vux.alert.show({
             // title: '提示',
             content: '请勿重复提交!',
             onShow() {
@@ -284,22 +284,22 @@
         }
 
         _.$http('/j/JGEmpolyer/Edit', {
-          id: that.uInfo._id.$id,
-          work_types: that.uInfo.work_type,
-          store_id: that.uInfo.store_id,
-          skill: that.uInfo.skill,
-          work_time_part: JSON.stringify(that.partTimeWorkers.arr), // 钟点工时间段
+          id: self.uInfo._id.$id,
+          work_types: self.uInfo.work_type,
+          store_id: self.uInfo.store_id,
+          skill: self.uInfo.skill,
+          work_time_part: JSON.stringify(self.partTimeWorkers.arr), // 钟点工时间段
         }, res => {
           if (res.data.success) {
-            that.$vux.alert.show({
+            self.$vux.alert.show({
               // title: '提示',
               content: '提交成功!',
               onShow() {
               },
               onHide() {
-                // that.partTimeWorkers.show = false;
-                that.uInfo.work_time_part = that.partTimeWorkers.arr;
-                that.$router.push({path: '/houseKeeping/edit'});
+                // self.partTimeWorkers.show = false;
+                self.uInfo.work_time_part = self.partTimeWorkers.arr;
+                self.$router.push({path: '/houseKeeping/edit'});
               }
             })
           }
@@ -307,10 +307,10 @@
       },
       // 取消
       partTimeWorkersFalse() {
-        let that = this;
-        // that.partTimeWorkers.show = false;
-        that.partTimeWorkers.arr = that.uInfo.work_time_part;
-        that.partTimeWorkers.arrStr = that.str(that.partTimeWorkers.arr);
+        let self = this;
+        // self.partTimeWorkers.show = false;
+        self.partTimeWorkers.arr = self.uInfo.work_time_part;
+        self.partTimeWorkers.arrStr = self.str(self.partTimeWorkers.arr);
       },
       /*住家日期*/
       homeShow(popup) {
@@ -318,7 +318,7 @@
       },
       // 住家日期
       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
@@ -331,18 +331,18 @@
 
           },
           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'
         });
       },
       // 提交
       homeTrue() {
-        let that = this;
+        let self = this;
         // 阻断相同内容重复提交
-        if (that.home.timeStr === '请选择住家日期') {
-          that.$vux.alert.show({
+        if (self.home.timeStr === '请选择住家日期') {
+          self.$vux.alert.show({
             // title: '提示',
             content: '请选择住家日期!',
             onShow() {
@@ -353,8 +353,8 @@
           return
         }
         // return
-        if (that.home.time == '' || that.home.time == that.uInfo.work_time) {
-          that.$vux.alert.show({
+        if (self.home.time == '' || self.home.time == self.uInfo.work_time) {
+          self.$vux.alert.show({
             // title: '提示',
             content: '请勿重复提交!',
             onShow() {
@@ -366,25 +366,25 @@
         }
 
         _.$http('/j/JGEmpolyer/Edit', {
-          id: that.uInfo._id.$id,
-          work_types: that.uInfo.work_type,
-          store_id: that.uInfo.store_id,
-          skill: that.uInfo.skill,
-          // work_time_part: JSON.stringify(that.partTimeWorkers.arr), // 钟点工时间段
-          work_time: that.home.time
+          id: self.uInfo._id.$id,
+          work_types: self.uInfo.work_type,
+          store_id: self.uInfo.store_id,
+          skill: self.uInfo.skill,
+          // work_time_part: JSON.stringify(self.partTimeWorkers.arr), // 钟点工时间段
+          work_time: self.home.time
         }, res => {
           if (res.data.success) {
-            that.$vux.alert.show({
+            self.$vux.alert.show({
               // title: '提示',
               content: '提交成功!',
               onShow() {
               },
               onHide() {
-                that.home.show = false;
-                that.uInfo.work_time = that.home.time;
+                self.home.show = false;
+                self.uInfo.work_time = self.home.time;
                 // history.go(0)
                 // return;
-                that.$router.push({path: '/houseKeeping/edit'});
+                self.$router.push({path: '/houseKeeping/edit'});
               }
             })
           }
@@ -392,18 +392,18 @@
       },
       // 取消
       homeFalse() {
-        let that = this;
-        that.home.show = false;
+        let self = this;
+        self.home.show = false;
 
       },
       // 字符串拼接
       str(list) {
         if (list == null) return '请选择时间';
-        let that = this,
+        let self = this,
           arrStr = '';
         if (list.length > 0) {
           for (let i = 0; i < list.length; i++) {
-            arrStr += `[${that.timeStr(list[i].start)}-${that.timeStr(list[i].end)}]`;
+            arrStr += `[${self.timeStr(list[i].start)}-${self.timeStr(list[i].end)}]`;
           }
         } else {
           arrStr = '请选择时间';
@@ -460,14 +460,14 @@
       /*个人信息编辑*/
       // 提交
       userInfoTrue() {
-        let that = this;
-        /*console.log(that.userInfo)
-        console.log(that.skills.numberArr)
-        console.log(that.worksType.numberArr)*/
+        let self = this;
+        /*console.log(self.userInfo)
+        console.log(self.skills.numberArr)
+        console.log(self.worksType.numberArr)*/
 
         // 工种不为空
-        if (that.worksType.numberArr.length === 0) {
-          that.$vux.alert.show({
+        if (self.worksType.numberArr.length === 0) {
+          self.$vux.alert.show({
             // title: '提示',
             content: '请选择工种!',
             onShow() {
@@ -479,8 +479,8 @@
         }
 
         // 技能不为空
-        if (that.skills.numberArr.length === 0) {
-          that.$vux.alert.show({
+        if (self.skills.numberArr.length === 0) {
+          self.$vux.alert.show({
             // title: '提示',
             content: '请选择技能!',
             onShow() {
@@ -492,8 +492,8 @@
         }
 
         // 本地地址
-        if (that.userInfo.address1 === '') {
-          that.$vux.alert.show({
+        if (self.userInfo.address1 === '') {
+          self.$vux.alert.show({
             // title: '提示',
             content: '请输入您的地址!',
             onShow() {
@@ -504,8 +504,8 @@
           return
         }
         // 户籍地址
-        /*if (that.userInfo.address2 === '') {
-          that.$vux.alert.show({
+        /*if (self.userInfo.address2 === '') {
+          self.$vux.alert.show({
             // title: '提示',
             content: '请输入您的户籍地址!',
             onShow() {
@@ -516,38 +516,38 @@
           return
         }*/
         _.$http('/j/JGEmpolyer/Edit', {
-          id: that.uInfo._id.$id,
-          store_id: that.uInfo.store_id,
-          skill: that.skills.numberArr,
-          work_types: that.worksType.numberArr,
-          address1: that.userInfo.address1,
-          // address2: that.userInfo.address2,
-          // work_time_part: JSON.stringify(that.partTimeWorkers.arr), // 钟点工时间段
-          // work_time: that.home.time
+          id: self.uInfo._id.$id,
+          store_id: self.uInfo.store_id,
+          skill: self.skills.numberArr,
+          work_types: self.worksType.numberArr,
+          address1: self.userInfo.address1,
+          // address2: self.userInfo.address2,
+          // work_time_part: JSON.stringify(self.partTimeWorkers.arr), // 钟点工时间段
+          // work_time: self.home.time
         }, res => {
           if (res.data.success) {
-            that.$vux.alert.show({
+            self.$vux.alert.show({
               // title: '提示',
               content: '提交成功!',
               onShow() {
               },
               onHide() {
-                that.userInfo.show = false;
-                that.uInfo.work_time = that.home.time;
+                self.userInfo.show = false;
+                self.uInfo.work_time = self.home.time;
 
-                that.uInfo.work_type = that.worksType.numberArr;
-                that.uInfo.skill = that.skills.numberArr;
+                self.uInfo.work_type = self.worksType.numberArr;
+                self.uInfo.skill = self.skills.numberArr;
 
                 // 本地住址
-                that.uInfo.address[0] = that.userInfo.address1;
+                self.uInfo.address[0] = self.userInfo.address1;
                 // 户籍地址
-                // that.uInfo.address[1] = that.userInfo.address2;
+                // self.uInfo.address[1] = self.userInfo.address2;
                 // 自述
-                that.uInfo.readme = that.userInfo.readme;
+                self.uInfo.readme = self.userInfo.readme;
                 // history.go(0)
                 // return;
-                that.$router.push({path: '/houseKeeping/info'});
-                // that.$router.push({path: '/houseKeeping/edit'});
+                self.$router.push({path: '/houseKeeping/info'});
+                // self.$router.push({path: '/houseKeeping/edit'});
               }
             })
           }
@@ -595,14 +595,14 @@
       },
       // 排序
       uSort(a, b) {
-        let that = this;
+        let self = this;
         let arr = a.sort(),
           uArr = [],
           nArr = [];
         if (b === 0) {
-          uArr = that.worksType.list
+          uArr = self.worksType.list
         } else {
-          uArr = that.skills.list
+          uArr = self.skills.list
         }
         for (let i = 0; i < arr.length; i++) {
           nArr.push(uArr[arr[i] - 1])

+ 57 - 57
www/webapp/housekeeping/src/components/houseKeeping/info.vue

@@ -130,40 +130,40 @@
         className: 'custom-classname'
       });
       // 初始化数据
-      let that = this;
+      let self = this;
       _.$http('/j/JGEmpolyer/Info', {
         userId: _.user_id
       }, res => {
         if (res.data.success) {
-          that.uInfo = res;
-          that.uInfo = that.uInfo.data.data;
-          that.uInfo.reg_time = _.timetrans(that.uInfo.reg_time);
-          that.worksType.numberArr = that.uInfo.work_type;
-          that.skills.numberArr = that.uInfo.skill;
-          that.worksType.arr = that.uSort(that.worksType.numberArr, 0);
-          that.skills.arr = that.uSort(that.skills.numberArr, 1);
-          /* for (let i in that.worksType.numberArr) {
-             if (that.worksType.numberArr[i] === 1) {
-               that.partTimeWorkers = true;
+          self.uInfo = res;
+          self.uInfo = self.uInfo.data.data;
+          self.uInfo.reg_time = _.timetrans(self.uInfo.reg_time);
+          self.worksType.numberArr = self.uInfo.work_type;
+          self.skills.numberArr = self.uInfo.skill;
+          self.worksType.arr = self.uSort(self.worksType.numberArr, 0);
+          self.skills.arr = self.uSort(self.skills.numberArr, 1);
+          /* for (let i in self.worksType.numberArr) {
+             if (self.worksType.numberArr[i] === 1) {
+               self.partTimeWorkers = true;
              }
-             if (that.worksType.numberArr[i] === 5) {
-               that.fullHousework = true;
+             if (self.worksType.numberArr[i] === 5) {
+               self.fullHousework = true;
              }
            }*/
 
           // 工种
-          if (that.worksType.arr.length != 0) {
-            that.worksType.arrStr = ''
-            for (let i in that.worksType.arr) {
-              that.worksType.arrStr += `${that.worksType.arr[i].label} `
+          if (self.worksType.arr.length != 0) {
+            self.worksType.arrStr = ''
+            for (let i in self.worksType.arr) {
+              self.worksType.arrStr += `${self.worksType.arr[i].label} `
             }
           }
 
           // 技能
-          if (that.skills.arr.length != 0) {
-            that.skills.arrStr = ''
-            for (let i in that.skills.arr) {
-              that.skills.arrStr += `${that.skills.arr[i].label} `
+          if (self.skills.arr.length != 0) {
+            self.skills.arrStr = ''
+            for (let i in self.skills.arr) {
+              self.skills.arrStr += `${self.skills.arr[i].label} `
             }
           }
 
@@ -177,40 +177,40 @@
     methods: {
       // 取消
       noSubmit() {
-        let that = this;
-        that.isEdit = false;
-        that.editStr = '编辑';
+        let self = this;
+        self.isEdit = false;
+        self.editStr = '编辑';
       },
       submit() {
-        let that = this;
-        if (that.uInfo.status === 0) {
+        let self = this;
+        if (self.uInfo.status === 0) {
           weui.alert('请激活后再试');
           return
         } else {
-          that.$router.push({path: '/houseKeeping/edit'});
+          self.$router.push({path: '/houseKeeping/edit'});
         }
         return
-        if (that.isEdit === false) {
-          that.editStr = '保存';
-          that.isEdit = true
+        if (self.isEdit === false) {
+          self.editStr = '保存';
+          self.isEdit = true
         } else {
 
           // 工种不为空
-          if (that.worksType.numberArr.length === 0) {
+          if (self.worksType.numberArr.length === 0) {
             weui.alert('请选择工种');
             return
           }
 
           // 技能不为空
-          if (that.skills.numberArr.length === 0) {
+          if (self.skills.numberArr.length === 0) {
             weui.alert('请选择技能');
             return
           }
 
           // 时间为空,提示用户
-          /* if (that.partTimeWorkers && that.workTypePart.length === 0) {
+          /* if (self.partTimeWorkers && self.workTypePart.length === 0) {
              weui.alert('由于您未设置钟点工时间,系统默认您全天有空', function () {
-               that.workTypePart.push({
+               self.workTypePart.push({
                  start: 6,
                  end: 19
                });
@@ -218,41 +218,41 @@
            }*/
 
           // 驻家时间为空
-          /*  if (that.partTimeWorkers && that.fullHouseworkResTime === '') {
+          /*  if (self.partTimeWorkers && self.fullHouseworkResTime === '') {
               weui.alert('请选择上门的时间');
               return
             } else {
-              that.fullHouseworkResTime = ''
+              self.fullHouseworkResTime = ''
             }*/
 
           // 本地地址
-          if (that.address1 === '') {
+          if (self.address1 === '') {
             weui.alert('请输入您的本地地址');
             return
           }
           // 户籍地址
-          if (that.address2 === '') {
+          if (self.address2 === '') {
             weui.alert('请输入您的本地地址');
             return
           }
 
           _.$http('/j/JGEmpolyer/Edit', {
-            id: that.uInfo._id.$id,
+            id: self.uInfo._id.$id,
             // status: '',
             // name:'',//姓名
             // phone:'',
             // cart_num:'', //身份证
             // star:'',
             // readme:'',
-            store_id: that.uInfo.store_id,
+            store_id: self.uInfo.store_id,
             // desc:'',
-            work_time_part: JSON.stringify(that.workTypePart), // 钟点工时间段
+            work_time_part: JSON.stringify(self.workTypePart), // 钟点工时间段
             // birth_time:'',
-            work_time: that.fullHouseworkResTime, //其他时间
+            work_time: self.fullHouseworkResTime, //其他时间
             // address1:'',
             // address2:'',
-            skill: that.skills.numberArr,
-            work_types: that.worksType.numberArr
+            skill: self.skills.numberArr,
+            work_types: self.worksType.numberArr
           }, res => {
             weui.alert('编辑成功!');
           })
@@ -260,14 +260,14 @@
       },
       // 排序
       uSort(a, b) {
-        let that = this;
+        let self = this;
         let arr = a.sort(),
           uArr = [],
           nArr = [];
         if (b === 0) {
-          uArr = that.worksType.list
+          uArr = self.worksType.list
         } else {
-          uArr = that.skills.list
+          uArr = self.skills.list
         }
         for (let i = 0; i < arr.length; i++) {
           nArr.push(uArr[arr[i] - 1])
@@ -284,12 +284,12 @@
         this.partTimeWorkersPopup = false;
       },
       workTypePartF(workTypePart) {
-        let that = this;
-        that.partTimeWorkersShow();
-        that.workTypePart = workTypePart;
-        that.workTypePartStr = '';
-        for (let i = 0; i < that.workTypePart.length; i++) {
-          that.workTypePartStr += `[${that.timeStr(that.workTypePart[i].start)}-${that.timeStr(that.workTypePart[i].end)}];`;
+        let self = this;
+        self.partTimeWorkersShow();
+        self.workTypePart = workTypePart;
+        self.workTypePartStr = '';
+        for (let i = 0; i < self.workTypePart.length; i++) {
+          self.workTypePartStr += `[${self.timeStr(self.workTypePart[i].start)}-${self.timeStr(self.workTypePart[i].end)}];`;
         }
       },
       // 工种
@@ -338,8 +338,8 @@
       },
       // 获取时间
       getTime() {
-        let that = this;
-        if (that.isEdit) {
+        let self = this;
+        if (self.isEdit) {
           let currentDate = new Date() // Sat Jun 24 2017 10:09:18 GMT+0800 (中国标准时间)
           let currentYear = currentDate.getFullYear()  // 当前年 2017
           let currentMonth = currentDate.getMonth() + 1 // 当前月 6
@@ -352,8 +352,8 @@
 
             },
             onConfirm: function (result) {
-              that.fullHouseworkTime = result[0].label + result[1].label + result[2].label
-              that.fullHouseworkResTime = ycTime(`${result[0].value}-${result[1].value}-${result[2].value}`);
+              self.fullHouseworkTime = result[0].label + result[1].label + result[2].label
+              self.fullHouseworkResTime = ycTime(`${result[0].value}-${result[1].value}-${result[2].value}`);
             },
             id: 'datePicker'
           });

+ 4 - 4
www/webapp/housekeeping/src/components/houseKeeping/isreg.vue

@@ -12,23 +12,23 @@
   export default {
     name: "isreg",
     created() {
-      let that = this;
+      let self = this;
       let storeId = '';
       let href = location.href;
       if (href.indexOf('storeId') > -1) {
-        storeId = href.split('=')[2];
+        storeId = 1;
         _.$http('/j/JGEmpolyer/Register', {
           userId: _.user_id,
           storeId: storeId,
           isReg: true
         }, res => {
           if (res.data.message === '未注册') {
-            that.$router.push({path: '/houseKeeping/login/', query: {storeId: storeId}});
+            self.$router.push({path: '/houseKeeping/login/', query: {storeId: storeId}});
           }
         })
       } else {
         weui.alert('请重新扫二维码,进入本页面', function () {
-          // that.$router.push({path: '/managementList'});
+          // self.$router.push({path: '/managementList'});
           // wx.closeWindow();
         });
         return

+ 41 - 35
www/webapp/housekeeping/src/components/houseKeeping/login.vue

@@ -243,51 +243,51 @@
     },
     methods: {
       submit() {
-        let that = this,
+        let self = this,
           skillsArray = [],
           worksArray = []; // 技能
         // 用户名判断
-        if (!that.userName) {
+        if (!self.userName) {
           weui.alert('请输入您的姓名');
           return
         }
         // 检验手机号码
-        if (Number.parseInt(that.iCode) !== that.code) {
+        if (Number.parseInt(self.iCode) !== self.code) {
           weui.alert('您手机号码未通过验证,请重新操作!');
           return
         }
 
         // 家政员 地址
-        /*if (!that.userAddress1) {
+        /*if (!self.userAddress1) {
           weui.alert('请输入您的本地地址');
           return
         }
-        if (!that.userAddress2) {
+        if (!self.userAddress2) {
           weui.alert('请输入您的户籍地址');
           return
         }*/
         // 工种
-        if (that.worksStr == '') {
+        if (self.worksStr == '') {
           weui.alert('请选择工种');
           return
         } else {
-          for (let i in that.worksStr) {
-            for (let j in that.uSkillArr) {
-              if (that.userTypeOfWorkArr[j].label == that.worksStr[i]) {
-                worksArray.push(that.userTypeOfWorkArr[j].value);
+          for (let i in self.worksStr) {
+            for (let j in self.uSkillArr) {
+              if (self.userTypeOfWorkArr[j].label == self.worksStr[i]) {
+                worksArray.push(self.userTypeOfWorkArr[j].value);
               }
             }
           }
         }
         // 技能
-        if (that.skillStr == '') {
+        if (self.skillStr == '') {
           weui.alert('请选择服务技能');
           return
         } else {
-          for (let i in that.skillStr) {
-            for (let j in that.uSkillArr) {
-              if (that.uSkillArr[j].label == that.skillStr[i]) {
-                skillsArray.push(that.uSkillArr[j].value);
+          for (let i in self.skillStr) {
+            for (let j in self.uSkillArr) {
+              if (self.uSkillArr[j].label == self.skillStr[i]) {
+                skillsArray.push(self.uSkillArr[j].value);
               }
             }
           }
@@ -295,18 +295,18 @@
         // 提交数据
         _.$http('/j/JGEmpolyer/Register/', {
           userId: _.user_id,
-          storeId: that.store,
-          phone: that.mobile,
-          userName: that.userName,
-          address1: that.userAddress1,
-          address2: that.userAddress2,
+          storeId: self.store,
+          phone: self.mobile,
+          userName: self.userName,
+          address1: self.userAddress1,
+          address2: self.userAddress2,
           work_type: worksArray,
           skill: skillsArray,
-          readme: that.readme
+          readme: self.readme
         }, res => {
           if (res.data.success) {
             weui.alert('注册成功', function () {
-              that.$router.push({path: '/houseKeeping/info'});
+              self.$router.push({path: '/houseKeeping/info'});
               return
             });
           }
@@ -316,19 +316,19 @@
         /*axios.get(_.apiPath + 'j/JGEmpolyer/Register/', {
           params: {
             userId: _.user_id,
-            storeId: that.store,
-            phone: that.mobile,
-            userName: that.userName,
-            address1: that.userAddress1,
-            address2: that.userAddress2,
+            storeId: self.store,
+            phone: self.mobile,
+            userName: self.userName,
+            address1: self.userAddress1,
+            address2: self.userAddress2,
             work_type: JSON.stringify(worksArray),
             skill: JSON.stringify(skillsArray),
-            readme: that.readme
+            readme: self.readme
           }
         }).then(res => {
           if (res.data.success) {
             weui.alert('注册成功', function () {
-              that.$router.push({path: '/houseKeeping/info/'});
+              self.$router.push({path: '/houseKeeping/info/'});
               return
             });
           }
@@ -355,14 +355,17 @@
       },
       // 获取短信验证码
       getCode() {
-        let that = this;
+        let self = this;
         _.SMS({
-          mobile: that.mobile,
-          iCreateCode: that.iCreateCode,
-          createCode: that.createCode
+          mobile: self.mobile,
+          iCreateCode: self.iCreateCode,
+          createCode: self.createCode
         }, res => {
-          that.code = res;
-          this.iCode = this.code // 系统调试时开启
+          self.code = res;
+          if (_.apiPath.indexOf('commontest') > -1) {
+            this.iCode = this.code // 系统调试时开启
+          }
+          // this.iCode = this.code // 系统调试时开启
           // this.iCreateCode = '';// 清空已输入验证码
           // this.createCode = createCode(); // 重置验证码
         });
@@ -482,6 +485,9 @@
     margin-right: 10px;
     line-height: 18px;
     border-radius: 15px;
+    &:last-child{
+      margin-top: 15px;
+    }
   }
 
   .skillsStr-item-selected {

+ 162 - 131
www/webapp/housekeeping/src/components/management/edit.vue

@@ -8,13 +8,14 @@
         <div><span class="title">用户手机:</span><a id='tel' v-bind:href='`tel:${order.mobile}`'>{{order.mobile}}</a></div>
         <div><span class="title">服务地址:</span>{{order.address}}</div>
         <div class="stroe"><span class="title">门店:</span><span>
-          {{storeName}}({{storeAddress}})<br>门店电话:<a id='tel' v-bind:href='`tel:${storeMobile}`'>{{storeMobile}}</a>
+          {{store.name }}({{store.address}})<br>门店电话:<a id='tel'
+                                                        v-bind:href='`tel:${store.mobile}`'>{{store.mobile}}</a>
         </span></div>
         <div><span class="title">服务类型:</span>{{order.type_str}}</div>
 
 
         <div v-if='order.type -1 == 0'><span
-          class="title">服务时间:</span>{{order.server_start_time}} ~ {{order.server_end_time}}
+          class="title">服务时间:</span>{{time.start}} ~ {{time.end}}
         </div>
         <div v-if='order.type -1  == 0'><span class="title">服务形式:</span>{{order.cart_str}}</div>
 
@@ -36,7 +37,21 @@
                     :end-date='endDate' :min-hour=9 :max-hour=18></datetime>
         </div>
         <div v-if="!showStatus && order.status != 4"><span class="title">预约日期:</span>{{order.status_time}}</div>
+
+
+
         <!--家政员-->
+        <div v-if="showTech && order.status != 4 && tech == ''">
+          <span class="title">家政员:</span><span class="edit" style="display:inline-block;" @click="selectF">请选择家政员</span>
+        </div>
+        <div v-if="showTech && order.status != 4 && tech != ''">
+          <span class="title">家政员:</span><span class="edit"  @click="selectF">{{tech}}</span>
+        </div>
+        <div v-if="order.status !== 3 && order.contract !== 2  && order.status != 4  && techMobile != ''">
+          <span class="title">家政员电话:</span><span class="edit"  @click="selectF">{{techMobile}}</span>
+        </div>
+        <!--
+        家政员
         <div v-if="showTech && order.status != 4">
           <span class="title">家政员:</span><span><input v-model="tech" class="tech edit" type="text"
                                                       placeholder='请输入家政员'></span>
@@ -45,6 +60,8 @@
           <span class="title">家政员电话:</span><span><input v-model="techMobile" class="tech edit" type="text"
                                                         placeholder='请输入家政员电话'></span>
         </div>
+
+        -->
         <!--预约状态-->
         <div v-if="order.status === 1 && order.contract !== 2">
           <span class="title">状态选取:</span><span class="edit" @click='btnAppointmentStatus'>{{appointmentStatusStr.label}}</span>
@@ -55,9 +72,8 @@
                                                        type="text"
                                                        placeholder='请输入取消原因'></span>
         </div>
-        <div v-if='!showTech  && order.status != 4 '><span class="title">家政员:</span>{{order.tech}}</div>
-        <div v-if="order.status === 3 && order.status != 4 "><span class="title">家政员电话:</span><span>{{order.tech_mobile}}</span>
-        </div>
+        <!--<div v-if='!showTech  && order.status != 4 '><span class="title">家政员:</span>{{order.tech}}</div>
+        <div v-if="order.status === 3 && order.status != 4 "><span class="title">家政员电话:</span><span>{{order.tech_mobile}}</span></div>-->
         <!--面试状态-->
         <!--<div class="weui-cell" v-if="order.status == 2">-->
         <!--<div class="weui-cell__hd"><label class="weui-label">面试状态</label></div>-->
@@ -112,83 +128,110 @@
         monthArr: {},
         skillStr: '', // 服务技能
         bookingTime: '', // 服务时间
+        time: {
+          start: '',
+          end: ''
+        },
         value: ['2017-06-24', '03', '05'], // 设定日期格式
         startDate: selectTime.startDate, // 限定最小日期
         endDate: '', // 限定最大日期
         tech: '',
         techMobile: '',
-        storeStr: '',
-        storeName: '',
-        storeAddress: '',
-        storeMobile: '',
+        store: {
+          name: '',
+          address: '',
+          mobile: ''
+        },
         showTech: false, // 家政员
         showContract: false, // 签约状态
         contractStr: '未签约',
         contractStrArr: [],
-        btnSubmintStr: '已预约',
+        // btnSubmintStr: '已预约',
+        btnSubmintStr: '提交',
         btnSubmintStrShow: true,
-        showStatus: false // 预约状态
+        showStatus: false, // 预约状态
+        homeClerkDetails: {}, // 家政员信息
       }
     },
     created() {
-      let that = this;
-      that.appointmentStatusStr = that.appointmentStatus[0];
-      _.$http('/j/HouseKeeping/GetStore', {}, res => {
-        for (let i in res.data) {
-          if (res.data[i].store_id == _.oldOrderInfo.store_id) {
-            that.storeName = res.data[i].store_name;
-            that.storeAddress = res.data[i].address;
-            that.storeMobile = res.data[i].mobile
-          }
-        }
-      });
-      /*axios.post(_.apiPath + 'j/HouseKeeping/GetStore').then(res => {
-        for (let i in res.data) {
-          if (res.data[i].store_id == _.oldOrderInfo.store_id) {
-            that.storeName = res.data[i].store_name;
-            that.storeAddress = res.data[i].address;
-            that.storeMobile = res.data[i].mobile
+      let self = this;
+      // 家政员信息赋值
+      if (_.oldOrderInfo != undefined && _.oldOrderInfo.homeClerkDetails != undefined) {
+        self.homeClerkDetails = _.oldOrderInfo.homeClerkDetails;
+        _.oldOrderInfo.tech = self.homeClerkDetails.name;
+        self.tech = self.homeClerkDetails.name;
+        _.oldOrderInfo.tech_mobile = self.homeClerkDetails.phone;
+        self.techMobile = self.homeClerkDetails.phone;
+      }
+      // 初始化订单状态 => 已预约
+      self.appointmentStatusStr = self.appointmentStatus[0];
+      // 设置订单中门店信息
+      if (_.orderInfo.store.name == undefined) {
+        _.$http('/j/HouseKeeping/GetStore', {
+          user_id: _.user_id
+        }, res => {
+          for (let i in res.data) {
+            // 筛选出订单中的门店信息
+            if (res.data[i].store_id == _.oldOrderInfo.store_id) {
+              self.store.name = res.data[i].store_name;
+              self.store.address = res.data[i].address;
+              self.store.mobile = res.data[i].mobile;
+              // 初始化门店信息
+              _.orderInfo.store.name = self.store.name;
+              _.orderInfo.store.address = self.store.address;
+              _.orderInfo.store.mobile = self.store.mobile;
+              return;
+            }
           }
-        }
-      })*/
+        });
+      } else {
+        // 首次进入该界面前
+        self.store.name = _.orderInfo.store.name;
+        self.store.address = _.orderInfo.store.address;
+        self.store.mobile = _.orderInfo.store.mobile;
+      }
 
       if (_.oldOrderInfo === undefined) {
-        this.$router.push({path: '/managementList'})
+        self.$router.push({path: '/managementList'})
+        return;
       }
-      this.order = _.oldOrderInfo;
+      self.order = _.oldOrderInfo;
       // 状态编辑
       // 已面试
-      if (that.order.contract === 1 && that.order.status === 2) {
-        that.btnSubmintStr = '提交'
+      if (self.order.contract === 1 && self.order.status === 2) {
+        self.btnSubmintStr = '提交'
       }
       // 已签约
-      if (that.order.contract === 1 && that.order.status === 3) {
-        that.btnSubmintStr = '已签约'
-      }
+      /*if (self.order.contract === 1 && self.order.status === 3) {
+        self.btnSubmintStr = '已签约'
+      }*/
       // 已完成
-      if (that.order.contract === 2 && that.order.status === 3) {
-        that.btnSubmintStrShow = false
+      if (self.order.contract === 2 && self.order.status === 3) {
+        self.btnSubmintStrShow = false
       }
       // 预约时间
-      console.log(that.order);
-      if (that.order.status_time !== 0) {
-        that.bookingTime = that.order.status_time
+      if (self.order.status_time !== 0) {
+        self.bookingTime = self.order.status_time;
+        _.oldOrderInfo.bookingTime = self.bookingTime
+      }
+      if(_.oldOrderInfo.bookingTime != undefined){
+       self.bookingTime  = _.oldOrderInfo.bookingTime;
       }
       // 家政员
-      if (that.order.tech.length > 0) {
-        that.tech = that.order.tech;
+      if (self.order.tech.length > 0) {
+        self.tech = self.order.tech;
       }
       // 家政员电话
-      if (that.order.tech_mobile !== '') {
-        that.techMobile = that.order.tech_mobile;
+      if (self.order.tech_mobile !== '') {
+        self.techMobile = self.order.tech_mobile;
       }
       // 转化时间格式
       // this.order.yc_time = _.timetrans(this.order.yc_time); // 预产期
       this.order.yc_time = this.order.yc_time.substring(0, 10); // 预产期
-      this.order.server_start_time = _.timetrans(this.order.server_start_time);
-      this.order.server_start_time = this.order.server_start_time.substring(11, 16);
-      this.order.server_end_time = _.timetrans(this.order.server_end_time);
-      this.order.server_end_time = this.order.server_end_time.substring(11, 16);
+      this.time.start = _.timetrans(this.order.server_start_time);
+      this.time.start = this.time.start.substring(11, 16);
+      this.time.end = _.timetrans(this.order.server_end_time);
+      this.time.end = this.time.end.substring(11, 16);
 
       if (this.order.status - 1 == 0) {
         this.eAppointmentDate = true
@@ -210,10 +253,18 @@
       XButton
     },
     methods: {
+      // 选择家政员
+      selectF() {
+        if(this.bookingTime === ''){
+          weui.alert('请先选择预约日期,再选择家政员');
+          return
+        }
+        this.$router.push({path: '/managementEmployee'})
+      },
       // 预约状态
       btnAppointmentStatus() {
-        let that = this;
-        weui.picker(that.appointmentStatus, {
+        let self = this;
+        weui.picker(self.appointmentStatus, {
           className: 'custom-classname',
           container: 'body',
           defaultValue: [0],
@@ -221,53 +272,53 @@
             // console.log(result)
           },
           onConfirm: function (result) {
-            console.log(result)
-            that.appointmentStatusStr = result[0];
-            if (that.appointmentStatusStr.value === 1) {
-              that.btnSubmintStr = '已取消';
-              that.showTechAppointmentStatus = true
-              console.log('123')
+            // console.log(result)
+            self.appointmentStatusStr = result[0];
+            if (self.appointmentStatusStr.value === 1) {
+              // self.btnSubmintStr = '已取消';
+              self.btnSubmintStr = '提交';
+              self.showTechAppointmentStatus = true
             } else {
-              that.btnSubmintStr = '已预约';
-              that.showTechAppointmentStatus = false
+              // self.btnSubmintStr = '已预约';
+              self.btnSubmintStr = '提交';
+              self.showTechAppointmentStatus = false
             }
           },
           id: 'singleLinePicker'
         })
       },
       btnSubmint() {
-        let that = this;
-
+        let self = this;
 
         //  预约日期判断
-        if (that.bookingTime == '' && !that.appointmentStatusStr.value) {
+        if (self.bookingTime == '' && !self.appointmentStatusStr.value) {
           weui.alert('请选择预约日期');
           return
         }
         // 家政员不为空判断
-        if (that.tech.length == '' && !that.appointmentStatusStr.value) {
+        if (self.tech.length == '' && !self.appointmentStatusStr.value) {
           weui.alert('请输入家政员');
           return
         }
         // 家政员电话不为空判断
-        // if (that.techMobile.length == '') {
+        // if (self.techMobile.length == '') {
         //   weui.alert('请输入家政员电话');
         //   return
         // }
         // 预约中
-        if (that.order.contract == 1 && that.order.status == 1) {
+        if (self.order.contract == 1 && self.order.status == 1) {
           // 已预约
-          if (!that.appointmentStatusStr.value) {
+          if (!self.appointmentStatusStr.value) {
             _.$http('/j/HouseKeeping/Edit', {
               id: _.oldOrderInfo.id,
               status: 2,
-              status_time: ycTime(that.bookingTime),
-              tech: that.tech,
-              tech_mobile: that.techMobile
+              status_time: ycTime(self.bookingTime),
+              tech: self.tech,
+              tech_mobile: self.techMobile
             }, res => {
               if (res.data.success) {
                 weui.alert('提交成功', function () {
-                  that.$router.push({path: '/managementList'});
+                  self.$router.push({path: '/managementList'});
                 });
                 return
               } else {
@@ -276,27 +327,15 @@
               }
             });
 
-            /*let stitching = `&id=${_.oldOrderInfo.id}&status=2&status_time=${ycTime(that.bookingTime)}&tech=${that.tech}&tech_mobile=${that.techMobile}`;
-            axios.post(_.apiPath + 'j/HouseKeeping/Edit' + stitching).then(res => {
-              if (res.data.success) {
-                weui.alert('提交成功', function () {
-                  that.$router.push({path: '/managementList'});
-                });
-                return
-              } else {
-                weui.alert('提交失败');
-                return
-              }
-            })*/
             return;
           } else { // 已取消
             // 取消原因不为空
-            if (that.showTechAppointmentStatusStr == '') {
+            if (self.showTechAppointmentStatusStr == '') {
               weui.alert('请输入取消原因!');
               return
             }
 
-            that.$vux.confirm.show({
+            self.$vux.confirm.show({
               title: '提示',
               content: '请确定,是否取消该订单?',
               // 组件除show外的属性
@@ -306,11 +345,11 @@
                 _.$http('/j/HouseKeeping/Edit', {
                   id: _.oldOrderInfo.id,
                   status: 4,
-                  cancel_cause: that.showTechAppointmentStatusStr
+                  cancel_cause: self.showTechAppointmentStatusStr
                 }, res => {
                   if (res.data.success) {
                     weui.alert('提交成功', function () {
-                      that.$router.push({path: '/managementList'});
+                      self.$router.push({path: '/managementList'});
                     });
                     return
                   } else {
@@ -318,11 +357,11 @@
                     return
                   }
                 });
-                /*let stitching = `&id=${_.oldOrderInfo.id}&status=4&cancel_cause=${that.showTechAppointmentStatusStr}`;
+                /*let stitching = `&id=${_.oldOrderInfo.id}&status=4&cancel_cause=${self.showTechAppointmentStatusStr}`;
                 axios.post(_.apiPath + 'j/HouseKeeping/Edit' + stitching).then(res => {
                   if (res.data.success) {
                     weui.alert('提交成功', function () {
-                      that.$router.push({path: '/managementList'});
+                      self.$router.push({path: '/managementList'});
                     });
                     return
                   } else {
@@ -336,67 +375,57 @@
           }
         }
         // 已面试
-        if (that.order.contract == 1 && that.order.status == 2) {
+        if (self.order.contract == 1 && self.order.status == 2) {
           // 用户不想进入已面试阶段
-          if (that.resServiceArr === 1) {
-            _.$http('/j/HouseKeeping/Edit',{
-              id:_.oldOrderInfo.id,
-              contract:1,
-              status:2,
-              status_time:ycTime(that.bookingTime),
-              tech:that.tech,
-              tech_mobile:that.techMobile
-            },res=>{
+          if (self.resServiceArr === 1) {
+            _.$http('/j/HouseKeeping/Edit', {
+              id: _.oldOrderInfo.id,
+              contract: 1,
+              status: 2,
+              status_time: ycTime(self.bookingTime),
+              tech: self.tech,
+              tech_mobile: self.techMobile
+            }, res => {
               statusF(res.data.success);
               return;
             })
-            /*let stitching = `&id=${_.oldOrderInfo.id}&contract=1&status=2&status_time=${ycTime(that.bookingTime)}&tech=${that.tech}&tech_mobile=${that.techMobile}`;
-            axios.post(_.apiPath + 'j/HouseKeeping/Edit' + stitching).then(res => {
-              statusF(res.data.success);
-              return;
-            })*/
             // 用户想进入已面试阶段
           } else {
-            that.$vux.confirm.show({
+            self.$vux.confirm.show({
               title: '提示',
               content: '请确定,家政员是否已面试',
               // 组件除show外的属性
               onCancel() {
               },
               onConfirm() {
-                _.$http('/j/HouseKeeping/Edit',{
-                  id:_.oldOrderInfo.id,
-                  contract:1,
-                  status:3,
-                  status_time:ycTime(that.bookingTime),
-                  tech:that.tech
-                },res=>{
+                _.$http('/j/HouseKeeping/Edit', {
+                  id: _.oldOrderInfo.id,
+                  contract: 1,
+                  status: 3,
+                  status_time: ycTime(self.bookingTime),
+                  tech: self.tech
+                }, res => {
                   statusF(res.data.success);
                   return;
                 });
-                /*let stitching = `&id=${_.oldOrderInfo.id}&contract=1&status=3&status_time=${ycTime(that.bookingTime)}&tech=${that.tech}`;
-                axios.post(_.apiPath + 'j/HouseKeeping/Edit' + stitching).then(res => {
-                  statusF(res.data.success);
-                  return;
-                })*/
               }
             })
           }
         }
 
         // 已签约
-        if (that.order.contract == 1 && that.order.status == 3) {
-          that.$vux.confirm.show({
+        if (self.order.contract == 1 && self.order.status == 3) {
+          self.$vux.confirm.show({
             title: '提示',
             content: '请确定,家政员是否已签约',
             // 组件除show外的属性
             onCancel() {
             },
             onConfirm() {
-              _.$http('/j/HouseKeeping/Edit',{
-                id:_.oldOrderInfo.id,
-                contract:2
-              },res=>{
+              _.$http('/j/HouseKeeping/Edit', {
+                id: _.oldOrderInfo.id,
+                contract: 2
+              }, res => {
                 statusF(res.data.success);
                 return;
               });
@@ -412,25 +441,25 @@
         // 提交返回状态
         function statusF(s) {
           if (s) {
-            that.$vux.alert.show({
+            self.$vux.alert.show({
               title: '提示',
               content: '提交成功!',
               onShow() {
                 // console.log('Plugin: I\'m showing')
               },
               onHide() {
-                that.$router.push({path: '/managementList'});
+                self.$router.push({path: '/managementList'});
                 return;
               }
             })
           } else {
-            that.$vux.alert.show({
+            self.$vux.alert.show({
               title: '提示',
               content: '提交失败!请稍后再试。',
               onShow() {
               },
               onHide() {
-                that.$router.push({path: '/managementList'});
+                self.$router.push({path: '/managementList'});
               }
             })
           }
@@ -438,19 +467,21 @@
       },
       change(val) {
         this.bookingTime = val;
+        _.oldOrderInfo.bookingTime = this.bookingTime;
+
       },
 
       btnServiceForm() {
-        let that = this;
-        weui.picker(that.serviceArr, {
+        let self = this;
+        weui.picker(self.serviceArr, {
           className: 'custom-classname',
           container: 'body',
           defaultValue: [1],
           onChange: function (result) {
           },
           onConfirm: function (result) {
-            that.serviceForm = result[0].label;
-            that.resServiceArr = result[0].value;
+            self.serviceForm = result[0].label;
+            self.resServiceArr = result[0].value;
           },
           id: 'singleLinePicker'
         });

+ 491 - 172
www/webapp/housekeeping/src/components/management/employee.vue

@@ -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>

+ 291 - 0
www/webapp/housekeeping/src/components/management/homeClerkDetails.vue

@@ -0,0 +1,291 @@
+<template>
+  <scroller>
+    <div style="font-size:1.5rem;padding:15px;text-align:center;font-weight:bold;">
+      家政员详情
+    </div>
+    <div class="home-clerk-details">
+
+      <div class="info">
+        <div>
+          <span>姓名:</span>
+        </div>
+        <div>{{info.name}}</div>
+      </div>
+
+      <div class="info">
+        <div>
+          <span>手机:</span>
+        </div>
+        <div>{{info.phone}}</div>
+      </div>
+
+      <div class="info">
+        <div>
+          <span>工种:</span>
+        </div>
+        <div>{{workType.str}}</div>
+      </div>
+
+      <div class="info">
+        <div>
+          <span>技能:</span>
+        </div>
+        <div>{{skills.str}}</div>
+      </div>
+
+      <div class="info">
+        <div>
+          <span>注册时间:</span>
+        </div>
+        <div>{{info.reg_time_str}}</div>
+      </div>
+
+      <div class="info" v-if="info.work_type.length != 1 || info.work_type[0] != 1">
+        <div>
+          <span>服务日期:</span>
+        </div>
+        <div>{{info.work_time == ''?'暂无服务日期':info.work_time}}</div>
+      </div>
+
+      <div class="info">
+        <div>
+          <span>钟点工时间:</span>
+        </div>
+        <div>
+          <span>{{timeStr}}</span>
+        </div>
+      </div>
+
+      <div class="info">
+        <div>
+          <span>状态:</span>
+        </div>
+        <div>{{info.status_str}}</div>
+      </div>
+
+      <div class="info">
+        <div>自述:</div>
+        <div>{{info.readme}}</div>
+      </div>
+
+    </div>
+
+
+    <div class="submit" v-if="oldOrderInfo.user_name != undefined">
+      <div @click="goManagementEdit" class="weui-btn weui-btn_primary">
+        选择
+      </div>
+    </div>
+
+
+    <div class="submit" v-if="info.status == 0">
+      <div @click="setStatus" class="weui-btn weui-btn_primary" v-bind:class="{'weui-btn_loading':statusShow}">
+        <i v-if="statusShow" class="weui-loading"></i>激活
+      </div>
+    </div>
+
+
+    </div>
+  </scroller>
+</template>
+<script>
+  import $ from '@/config'
+
+  export default {
+    name: 'home-clerk-details',
+    data() {
+      return {
+        info: $.editHouseInfo,
+        statusShow: false,
+        oldOrderInfo: {},
+        // 工种
+        workType: {
+          list: [
+            {label: '钟点工', value: 1},
+            {label: '月嫂', value: 2},
+            {label: '育婴师', value: 3},
+            {label: '护理老人', value: 4},
+            {label: '全套家务', value: 5}
+          ],
+          str: ''
+        },
+        skills: {
+          list: [
+            {label: '烧饭', value: 1},
+            {label: '保洁', value: 2},
+            {label: '育婴', value: 3},
+            {label: '护理', value: 4},
+            {label: '全套家务', value: 5}
+          ],
+          str: ''
+        },
+        timeStr: ''
+      }
+    },
+    created() {
+      let self = this;
+      console.log($.oldOrderInfo);
+      if ($.oldOrderInfo != undefined && $.oldOrderInfo.user_name != undefined) {
+        self.oldOrderInfo = $.oldOrderInfo
+      }
+      // work_type
+      if (self.info.work_type.length > 0) {
+        for (let i in self.info.work_type) {
+          for (let j in self.workType.list) {
+            if (self.info.work_type[i] == self.workType.list[j].value) {
+              self.workType.str += `${self.workType.list[i].label}  `
+            }
+          }
+        }
+      }
+      // skill
+      if (self.info.skill.length > 0) {
+        for (let i in self.info.skill) {
+          for (let j in self.skills.list) {
+            if (self.info.skill[i] == self.skills.list[j].value) {
+              self.skills.str += `${self.skills.list[i].label}  `
+            }
+          }
+        }
+      }
+      // 钟点工  work_time_part
+      // console.log(self.info.work_time_part)
+      self.timeStr = self.str(self.info.work_time_part);
+
+    },
+    methods: {
+      // 返回家政员编辑界面
+      goManagementEdit() {
+        let self = this;
+        $.oldOrderInfo.homeClerkDetails = self.info;
+        self.$router.push({path: '/managementEdit'})
+      },
+      setStatus() {
+        let self = this;
+        self.statusShow = true;
+        self.$vux.confirm.show({
+          title: '提示',
+          content: '是否激活该家政人员?',
+          // 组件除show外的属性
+          onCancel() {
+            self.statusShow = false;
+          },
+          onConfirm() {
+            let loading = weui.loading('提交中...', {
+              className: 'custom-classname'
+            });
+            $.$http('/j/JGEmpolyer/Edit', {
+              id: self.info.id,
+              work_types: self.info.work_type,
+              store_id: self.info.store_id,
+              skill: self.info.skill,
+              status: 1
+            }, res => {
+              if (res.data.success) {
+                loading.hide(function () {
+                  weui.toast('激活成功!', {
+                    duration: 1500,
+                    className: 'custom-classname',
+                    callback: function () {
+                      self.$router.push({path: '/managementEmployee'})
+                    }
+                  });
+                })
+                self.statusShow = false;
+                /*setTimeout(()=>{
+
+                },450)		*/
+              } else {
+                weui.topTips('激活失败', 3000);
+              }
+              console.log(res.data);
+            })
+            return;
+          }
+        })
+      },
+      // 字符串拼接
+      str(list) {
+        if (list == null) return '暂无钟点工时间';
+        let self = this,
+          arrStr = '';
+        if (list.length > 0) {
+          for (let i = 0; i < list.length; i++) {
+            arrStr += `[${self.timeStrF(list[i].start)}-${self.timeStrF(list[i].end)}];`;
+          }
+        } else {
+          arrStr = '暂无钟点工时间';
+        }
+        return arrStr
+      },
+      timeStrF(t) {
+        let time = '';
+        t = t.toString();
+        if (t.indexOf('.') > -1) {
+          time = t.split('.')[0] + ':30'
+        } else {
+          time = t += ':00'
+        }
+        return time
+      },
+      // 排序
+      uSort(a, b) {
+        let self = this;
+        let arr = a.sort(),
+          uArr = [],
+          nArr = [];
+        if (b === 0) {
+          uArr = self.worksType.list
+        } else {
+          uArr = self.skills.list
+        }
+        for (let i = 0; i < arr.length; i++) {
+          nArr.push(uArr[arr[i] - 1])
+        }
+        return nArr
+      }
+
+    }
+  }
+</script>
+
+<style scoped lang="less">
+  @borderColor: rgba(0, 0, 0, 0.2);
+  .home-clerk-details {
+    padding-left: 1rem;
+    margin: 0 0 15px;
+    border-bottom: 1px solid @borderColor;
+    border-top: 1px solid @borderColor;
+    .info {
+      display: flex;
+      border-bottom: 1px solid @borderColor;
+      &:last-child {
+        border-bottom: 0;
+      }
+      div {
+        flex: 1;
+        // padding-top: 0.5rem;
+        padding: .8rem;
+        text-align: left;
+        font-size: .9rem;
+        & > div {
+          display: flex;
+          align-items: center;
+        }
+        &:nth-child(2) {
+          font-size: .9rem;
+          flex: 2;
+        }
+      }
+
+    }
+  }
+
+  .submit {
+    display: flex;
+    padding: 0 15px;
+    div {
+      flex: 1
+    }
+  }
+</style>

+ 24 - 24
www/webapp/housekeeping/src/components/management/list.vue

@@ -66,26 +66,26 @@
       });
       // 清理数据
       _.oldOrderInfo = null;
-      let that = this;
+      let self = this;
       _.auth = null;
       _.$http('/j/HouseKeeping/GetUser', {
         user_id: _.user_id
       }, res => {
-        that.storeId = res.data.store_id;
-        if (that.storeId) {
+        self.storeId = res.data.store_id;
+        if (self.storeId) {
           _.$http('/j/HouseKeeping/list', {
-            store_id: that.storeId
+            store_id: self.storeId
           }, result => {
             if (result.status === 200) {
-              that.oldOrderList = result.data.rows;
-              for (let i = 0; i < that.oldOrderList.length; i++) {
-                that.oldOrderList[i].time = _.timetrans(that.oldOrderList[i].time);
-                that.oldOrderList[i].yc_time = _.timetrans(that.oldOrderList[i].yc_time);
-                if (that.oldOrderList[i].status !== 1) {
-                  that.oldOrderList[i].status_time = _.timetrans(that.oldOrderList[i].status_time);
+              self.oldOrderList = result.data.rows;
+              for (let i = 0; i < self.oldOrderList.length; i++) {
+                self.oldOrderList[i].time = _.timetrans(self.oldOrderList[i].time);
+                self.oldOrderList[i].yc_time = _.timetrans(self.oldOrderList[i].yc_time);
+                if (self.oldOrderList[i].status !== 1) {
+                  self.oldOrderList[i].status_time = _.timetrans(self.oldOrderList[i].status_time);
                 }
               }
-              that.tabF(0)
+              self.tabF(0)
               loading.hide(function () {
                 // console.log('`loading` has been hidden');
               });
@@ -96,21 +96,21 @@
 
 
       /*axios.post(_.apiPath + '/j/HouseKeeping/GetUser&user_id=' + _.user_id).then(res => {
-        that.storeId = res.data.store_id;
+        self.storeId = res.data.store_id;
         setTimeout(function () {
-          if (that.storeId) {
-            axios.post(_.apiPath + '/j/HouseKeeping/list&store_id=' + that.storeId).then(res => {
+          if (self.storeId) {
+            axios.post(_.apiPath + '/j/HouseKeeping/list&store_id=' + self.storeId).then(res => {
               if (res.status === 200) {
-                that.oldOrderList = res.data.rows;
-                // console.log(that.oldOrderList)
-                for (let i = 0; i < that.oldOrderList.length; i++) {
-                  that.oldOrderList[i].time = _.timetrans(that.oldOrderList[i].time)
-                  that.oldOrderList[i].yc_time = _.timetrans(that.oldOrderList[i].yc_time)
-                  if (that.oldOrderList[i].status !== 1) {
-                    that.oldOrderList[i].status_time = _.timetrans(that.oldOrderList[i].status_time);
+                self.oldOrderList = res.data.rows;
+                // console.log(self.oldOrderList)
+                for (let i = 0; i < self.oldOrderList.length; i++) {
+                  self.oldOrderList[i].time = _.timetrans(self.oldOrderList[i].time)
+                  self.oldOrderList[i].yc_time = _.timetrans(self.oldOrderList[i].yc_time)
+                  if (self.oldOrderList[i].status !== 1) {
+                    self.oldOrderList[i].status_time = _.timetrans(self.oldOrderList[i].status_time);
                   }
                 }
-                that.tabF(0)
+                self.tabF(0)
               }
             })
           }
@@ -158,7 +158,7 @@
         }, 300);
       },
       btnEditOrder(item) {
-        let that = this;
+        let self = this;
         /*console.log(item);
         console.log(item.id);
         console.log(item.flag);*/
@@ -188,7 +188,7 @@
         function edit() {
           setTimeout(function () {
             _.oldOrderInfo = item;
-            that.$router.push({path: '/managementEdit'})
+            self.$router.push({path: '/managementEdit'})
           }, 100);
         }
       }

+ 17 - 17
www/webapp/housekeeping/src/components/order.vue

@@ -60,7 +60,7 @@
     created() {
       // 清理数据
       _.oldOrderInfo = null;
-      let that = this;
+      let self = this;
       _.auth = null;
       // 用户身份识别
       _.$http('/j/HouseKeeping/GetUser',{
@@ -68,18 +68,18 @@
       },res=>{
         // console.log(res.data)
         if (res.data.store_id == "" || res.data.user_id == "") {
-          // that.registered = true;
+          // self.registered = true;
           // 用户是否已注册
           /*          axios.get(_.apiPath + 'o2o/user/info&user_id=' + _.user_id).then(function (res) {
                       _.userInfo = res.data.data.user_info;
                       // 为空判断
                       if (_.userInfo.length === 0) {
-                        that.registered = true;
-                        // that.$router.push({path: '/userInfo'})
+                        self.registered = true;
+                        // self.$router.push({path: '/userInfo'})
                       }
                     })*/
         } else {
-          that.$router.push({path: '/managementList'});
+          self.$router.push({path: '/managementList'});
         }
       });
 
@@ -87,29 +87,29 @@
         id:_.user_id
       },res=>{
         if (res.status === 200) {
-          that.oldOrderList = res.data.rows;
-          that.oldOrderList.sort(function (item1, item2) {
+          self.oldOrderList = res.data.rows;
+          self.oldOrderList.sort(function (item1, item2) {
             return item1.time < item2.time
           })
-          // console.log(that.oldOrderList)
-          for (let i = 0; i < that.oldOrderList.length; i++) {
-            that.oldOrderList[i].time = _.timetrans(that.oldOrderList[i].time)
+          // console.log(self.oldOrderList)
+          for (let i = 0; i < self.oldOrderList.length; i++) {
+            self.oldOrderList[i].time = _.timetrans(self.oldOrderList[i].time)
           }
-          that.tabF(0);
+          self.tabF(0);
         }
       })
 /*
       axios.post(_.apiPath + '/j/HouseKeeping/GetUser&user_id=' + _.user_id).then(res => {
         console.log(res.data)
         if (res.data.store_id == "" || res.data.user_id == "") {
-          // that.registered = true;
+          // self.registered = true;
           // 用户是否已注册
 /!*          axios.get(_.apiPath + 'o2o/user/info&user_id=' + _.user_id).then(function (res) {
             _.userInfo = res.data.data.user_info;
             // 为空判断
             if (_.userInfo.length === 0) {
-              that.registered = true;
-              // that.$router.push({path: '/userInfo'})
+              self.registered = true;
+              // self.$router.push({path: '/userInfo'})
             }
           })*!/
         } else {
@@ -118,13 +118,13 @@
       });
       axios.post(_.apiPath + '/j/HouseKeeping/list&id=' + _.user_id).then(res => {
         if (res.status === 200) {
-          that.oldOrderList = res.data.rows;
+          self.oldOrderList = res.data.rows;
           this.oldOrderList.sort(function (item1, item2) {
             return item1.time < item2.time
           })
           console.log(this.oldOrderList)
-          for (let i = 0; i < that.oldOrderList.length; i++) {
-            that.oldOrderList[i].time = _.timetrans(that.oldOrderList[i].time)
+          for (let i = 0; i < self.oldOrderList.length; i++) {
+            self.oldOrderList[i].time = _.timetrans(self.oldOrderList[i].time)
           }
           this.tabF(0);
         }

+ 22 - 22
www/webapp/housekeeping/src/components/orderInfo.vue

@@ -46,13 +46,13 @@
       }
     },
     created() {
-      let that =this;
+      let self =this;
       _.$http('/j/HouseKeeping/GetStore',{},res=>{
         for (let i in res.data){
           if(res.data[i].store_id == _.oldOrderInfo.store_id){
-            that.storeName = res.data[i].store_name;
-            that.storeAddress = res.data[i].address;
-            that.storeMobile = res.data[i].mobile
+            self.storeName = res.data[i].store_name;
+            self.storeAddress = res.data[i].address;
+            self.storeMobile = res.data[i].mobile
           }
         }
       })
@@ -61,32 +61,32 @@
         // console.log(res.data)
         for (let i in res.data){
           if(res.data[i].store_id == _.oldOrderInfo.store_id){
-            that.storeName = res.data[i].store_name;
-            that.storeAddress = res.data[i].address;
-            that.storeMobile = res.data[i].mobile
+            self.storeName = res.data[i].store_name;
+            self.storeAddress = res.data[i].address;
+            self.storeMobile = res.data[i].mobile
           }
         }
-//        that.storeStr
+//        self.storeStr
       })*/
       if (_.oldOrderInfo === undefined) {
-        that.$router.push({path: '/order'})
+        self.$router.push({path: '/order'})
       }
-      that.order = _.oldOrderInfo;
-      // console.log(that.order)
+      self.order = _.oldOrderInfo;
+      // console.log(self.order)
       // 转化时间格式
-      that.order.yc_time = _.timetrans(that.order.yc_time); // 预产期
-      that.order.yc_time = that.order.yc_time.substring(0, 10); // 预产期
-      that.order.server_start_time = _.timetrans(that.order.server_start_time);
-      that.order.server_start_time = that.order.server_start_time.substring(11, 16);
-      that.order.server_end_time = _.timetrans(that.order.server_end_time);
-      that.order.server_end_time = that.order.server_end_time.substring(11, 16);
-      if (that.order.status_time !== 0) {
-        that.order.status_time = _.timetrans(that.order.status_time);
+      self.order.yc_time = _.timetrans(self.order.yc_time); // 预产期
+      self.order.yc_time = self.order.yc_time.substring(0, 10); // 预产期
+      self.order.server_start_time = _.timetrans(self.order.server_start_time);
+      self.order.server_start_time = self.order.server_start_time.substring(11, 16);
+      self.order.server_end_time = _.timetrans(self.order.server_end_time);
+      self.order.server_end_time = self.order.server_end_time.substring(11, 16);
+      if (self.order.status_time !== 0) {
+        self.order.status_time = _.timetrans(self.order.status_time);
       } else {
-        that.order.status_time = '暂无预约日期'
+        self.order.status_time = '暂无预约日期'
       }
-      for (let i in that.order.skill_str) {
-        that.skillStr = `${that.skillStr} ${that.order.skill_str[i]}`
+      for (let i in self.order.skill_str) {
+        self.skillStr = `${self.skillStr} ${self.order.skill_str[i]}`
       }
     },
     watch: {

+ 1 - 0
www/webapp/housekeeping/src/components/public/navigation.vue

@@ -30,6 +30,7 @@
     bottom: 0;
     right: 0;
     left: 0;
+    z-index: 1;
     display: flex;
     background-color: #09bb07;
     color: white;

+ 30 - 30
www/webapp/housekeeping/src/components/public/selectTime.vue

@@ -43,7 +43,7 @@
       }
     },
     created() {
-      let that = this;
+      let self = this;
       let y = 0, z = 0, label = '', start = '', end = '';
       for (let i = 6; i < 19; i++) {
         for (let j = 0; j < 2; j++) {
@@ -58,17 +58,17 @@
             end = i + 1;
             y = 0;
           }
-          that.times.push({value: i, label: label, color: false, position: z, start: start, end: end});
+          self.times.push({value: i, label: label, color: false, position: z, start: start, end: end});
           z++;
           label = '';
         }
       }
       // 数据筛选
-      if (that.show.arr && that.show.arr.length > 0) {
-        for (let i in that.times) {
-          for (let j in that.show.arr) {
-            if (that.times[i].start >= that.show.arr[j].start && that.times[i].end <= that.show.arr[j].end) {
-              that.times[i].color = true
+      if (self.show.arr && self.show.arr.length > 0) {
+        for (let i in self.times) {
+          for (let j in self.show.arr) {
+            if (self.times[i].start >= self.show.arr[j].start && self.times[i].end <= self.show.arr[j].end) {
+              self.times[i].color = true
             }
           }
         }
@@ -76,50 +76,50 @@
     },
     methods: {
       timesF(item) {
-        let that = this;
+        let self = this;
         item.color = !item.color;
         if (item.color) {
-          that.btnTimes.push(item);
+          self.btnTimes.push(item);
         } else {
-          let indexOf = that.btnTimes.indexOf(item);
-          that.btnTimes.splice(indexOf, 1);
+          let indexOf = self.btnTimes.indexOf(item);
+          self.btnTimes.splice(indexOf, 1);
         }
       },
       btnTrue() {
-        let that = this;
+        let self = this;
         let newTime = [], oldTime = [];
-        let length = that.btnTimes.length;
+        let length = self.btnTimes.length;
         // 判断数组 去重,添加未点
 
-        for (let i in that.times) {
-          if (that.times[i].color) {
-            let item = that.btnTimes.find(function (element, index, array) {
-              return (element.position == that.times[i].position) ? true : false;
+        for (let i in self.times) {
+          if (self.times[i].color) {
+            let item = self.btnTimes.find(function (element, index, array) {
+              return (element.position == self.times[i].position) ? true : false;
             })
             if (item == undefined) {
-              that.btnTimes.push(that.times[i])
+              self.btnTimes.push(self.times[i])
             }
           }
         }
         for (let i = 0; i < length; i++) {
           for (let j = 0; j < length - 1; j++) {
-            if (that.btnTimes[j].position >= that.btnTimes[j + 1].position) {
-              let aux = that.btnTimes[j];
-              that.btnTimes[j] = that.btnTimes[j + 1];
-              that.btnTimes[j + 1] = aux;
+            if (self.btnTimes[j].position >= self.btnTimes[j + 1].position) {
+              let aux = self.btnTimes[j];
+              self.btnTimes[j] = self.btnTimes[j + 1];
+              self.btnTimes[j + 1] = aux;
             }
           }
         }
 
         let work_type_part = [];
-        let extra = that.btnTimes;
+        let extra = self.btnTimes;
         let i = 1;
         let j = 0;
         if (extra.length != 0) {
-          if (that.btnTimes.length == that.times.length) {
+          if (self.btnTimes.length == self.times.length) {
             work_type_part.push({
-              start: that.times[0].start,
-              end: that.times[that.times.length - 1].end
+              start: self.times[0].start,
+              end: self.times[self.times.length - 1].end
             })
           } else {
             work_type_part[0] = {};
@@ -143,10 +143,10 @@
             }
           }
         }
-        that.workTypePart = work_type_part;
-        console.log(that.workTypePart)
-        that.$emit('workTypePart', that.workTypePart);
-        that.$emit('popup', false);
+        self.workTypePart = work_type_part;
+        console.log(self.workTypePart)
+        self.$emit('workTypePart', self.workTypePart);
+        self.$emit('popup', false);
 
       },
       btnFalse() {

+ 45 - 42
www/webapp/housekeeping/src/components/public/worksType.vue

@@ -8,49 +8,49 @@
         </div>
       </div>
       <checker
-        type="checkbox"
-        v-model="worksStr"
-        default-item-class="skillsStr-item"
-        selected-item-class="skillsStr-item-selected"
-        disabled-item-class="skillsStr-item-disabled">
-        <checker-item v-for="(item,index) in typeArr" :key="index"
-                      :value="(item.label)">
-          {{item.label}}
-        </checker-item>
-      </checker>
-    </div>
-  </div>
+      type="checkbox"
+      v-model="worksStr"
+      default-item-class="skillsStr-item"
+      selected-item-class="skillsStr-item-selected"
+      disabled-item-class="skillsStr-item-disabled">
+      <checker-item v-for="(item,index) in typeArr" :key="index"
+      :value="(item.label)">
+      {{item.label}}
+    </checker-item>
+  </checker>
+</div>
+</div>
 </template>
 
 <script>
   /*
   传入的值:
     workType:
-   */
-  import {Checker, CheckerItem, Popup} from 'vux'
+    */
+    import {Checker, CheckerItem, Popup} from 'vux'
 
-  export default {
-    name: "works-type",
-    props: {
-      workType: {
-        type: Array
+    export default {
+      name: "works-type",
+      props: {
+        workType: {
+          type: Array
+        },
+        typeArr:{
+          type:Array
+        }
       },
-      typeArr:{
-        type:Array
-      }
-    },
-    created() {
-    },
-    methods: {
-      btnNewWorks() {
-        let that = this,
+      created() {
+      },
+      methods: {
+        btnNewWorks() {
+          let self = this,
           worksArray = [];
         // return;
-        if (that.worksStr.length > 0) {
-          for (let i in that.worksStr) {
-            for (let j in that.typeArr) {
-              if (that.typeArr[j].label == that.worksStr[i]) {
-                worksArray.push(that.typeArr[j].value);
+        if (self.worksStr.length > 0) {
+          for (let i in self.worksStr) {
+            for (let j in self.typeArr) {
+              if (self.typeArr[j].label == self.worksStr[i]) {
+                worksArray.push(self.typeArr[j].value);
               }
             }
           }
@@ -68,17 +68,17 @@
 
       // 排序
       uSort(a, b) {
-        let that = this,
-          arr = JSON.parse(a),
-          uArr = [],
-          nArr = [];
+        let self = this,
+        arr = JSON.parse(a),
+        uArr = [],
+        nArr = [];
         arr = arr.sort(function NumAscSort(a, b) {
           return a - b;
         });
         if (b === 0) {
-          uArr = that.userTypeOfWorkArr
+          uArr = self.userTypeOfWorkArr
         } else {
-          uArr = that.uSkillArr
+          uArr = self.uSkillArr
         }
         for (let i = 0; i < arr.length; i++) {
           nArr.push(uArr[arr[i]])
@@ -109,9 +109,9 @@
       }
     }
   }
-</script>
+  </script>
 
-<style scoped lang="less">
+  <style scoped lang="less">
   .works-type {
 
   }
@@ -125,6 +125,9 @@
     line-height: .8rem;
     border-radius: 5px;
     margin-bottom: 10px;
+    &:last-child{
+      margin-top: 15px;
+    }
   }
 
   .skillsStr-item-selected {
@@ -135,4 +138,4 @@
   .skillsStr-item-disabled {
     color: #999;
   }
-</style>
+  </style>

+ 74 - 71
www/webapp/housekeeping/src/components/reservation.vue

@@ -248,23 +248,23 @@
       },
       // 孩子年龄  onkeyup="value=value.replace(/[^\d]/g,'')"
       userAge: function (val, oldVal) {
-        let that = this;
+        let self = this;
         let nVal = val.replace(/[^\d]/g);
         if (nVal === 'undefined') {
           weui.alert('请重新孩子的年龄;<br/>例如:1', function () {
-            that.userAge = ''
+            self.userAge = ''
           });
         }
       }
     },
     created() {
-      let that = this;
+      let self = this;
       config.$http('/o2o/user/info', {
         user_id: config.user_id
       }, function (res) {
         if (res.data.success) {
-          that.userName = res.data.data.user_info.name;
-          that.mobile = res.data.data.user_info.mobile;
+          self.userName = res.data.data.user_info.name;
+          self.mobile = res.data.data.user_info.mobile;
         }
       });
 
@@ -299,28 +299,28 @@
       },
       // 服务技能
       btnServiceSkills() {
-        let that = this;
-        weui.picker(that.serviceSkillsArr, {
+        let self = this;
+        weui.picker(self.serviceSkillsArr, {
           className: 'custom-classname',
           container: 'body',
           defaultValue: [1],
           onChange: function (result) {
           },
           onConfirm: function (result) {
-            that.serviceSkills = result[0].label;
+            self.serviceSkills = result[0].label;
           },
           id: 'serviceSkillsArr'
         });
       },
       // 门店选择
       btnStore() {
-        let that = this;
+        let self = this;
 
         let newStoreArr = [];
-        for (let i = 0; i < that.storeArr.length; i++) {
+        for (let i = 0; i < self.storeArr.length; i++) {
           newStoreArr.push({
-            label: that.storeArr[i].store_name + '(' + that.storeArr[i].address + ')',
-            value: that.storeArr[i].store_id
+            label: self.storeArr[i].store_name + '(' + self.storeArr[i].address + ')',
+            value: self.storeArr[i].store_id
           })
         }
         // store
@@ -331,59 +331,59 @@
           onChange: function (result) {
           },
           onConfirm: function (result) {
-            that.store = result[0].label;
-            that.storeId = result[0].value;
+            self.store = result[0].label;
+            self.storeId = result[0].value;
           },
           id: 'singleLinePickerStore'
         });
       },
       // 时间选择
       btnServiceAM() {
-        let that = this;
-        weui.picker(that.serviceTimeArrAM, {
+        let self = this;
+        weui.picker(self.serviceTimeArrAM, {
           className: 'custom-classname',
           container: 'body',
           defaultValue: [1],
           onChange: function (result) {
           },
           onConfirm: function (result) {
-            that.serviceTimeAM = result[0].label;
+            self.serviceTimeAM = result[0].label;
           },
           id: 'singleLinePickerAM'
         });
       },
       btnServicePM() {
-        let that = this;
-        weui.picker(that.serviceTimeArrPM, {
+        let self = this;
+        weui.picker(self.serviceTimeArrPM, {
           className: 'custom-classname',
           container: 'body',
           defaultValue: [1],
           onChange: function (result) {
           },
           onConfirm: function (result) {
-            that.serviceTimePM = result[0].label;
+            self.serviceTimePM = result[0].label;
           },
           id: 'singleLinePickerPM'
         });
       },
       btnServiceForm() {
-        let that = this;
-        weui.picker(that.serviceArr, {
+        let self = this;
+        weui.picker(self.serviceArr, {
           className: 'custom-classname',
           container: 'body',
           defaultValue: [1],
           onChange: function (result) {
           },
           onConfirm: function (result) {
-            that.serviceForm = result[0].label;
-            that.resServiceArr = result[0].value;
+            self.serviceForm = result[0].label;
+            self.resServiceArr = result[0].value;
           },
           id: 'singleLinePicker'
         });
       },
       // 预产期
       btn() {
-        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
@@ -396,8 +396,8 @@
 
           },
           onConfirm: function (result) {
-            that.time = result[0].label + result[1].label + result[2].label
-            that.resTime = ycTime(`${result[0].value}-${result[1].value}-${result[2].value}`);
+            self.time = result[0].label + result[1].label + result[2].label
+            self.resTime = ycTime(`${result[0].value}-${result[1].value}-${result[2].value}`);
           },
           id: 'datePicker'
         });
@@ -407,13 +407,13 @@
       },
       // 获取短信验证码
       getCode() {
-        let that = this;
+        let self = this;
         config.SMS({
-          mobile: that.mobile,
-          iCreateCode: that.iCreateCode,
-          createCode: that.createCode
+          mobile: self.mobile,
+          iCreateCode: self.iCreateCode,
+          createCode: self.createCode
         }, res => {
-          that.code = res;
+          self.code = res;
           // this.iCode = this.code // 系统调试时开启
           // this.iCreateCode = '';// 清空已输入验证码
           // this.createCode = createCode(); // 重置验证码
@@ -448,13 +448,13 @@
       }*/,
       // 表单提交
       submit() {
-        let that = this,
+        let self = this,
           skillsArray = [],
-          uAge = that.userAge;
+          uAge = self.userAge;
 
 
         // 用户名判断
-        /*        if (!that.userName) {
+        /*        if (!self.userName) {
                   weui.alert('请输入您的姓名');
                   return
                 }*/
@@ -466,34 +466,34 @@
 //        return;
 
         // 短信验证码判断
-//        if (mobile.parseInt(that.iCode) !== that.code) {
+//        if (mobile.parseInt(self.iCode) !== self.code) {
 //          weui.alert('输入的短信验证码有误,请重新输入');
 //          return
 //        }
 
         // 服务地址
-        if (!that.userAddress) {
+        if (!self.userAddress) {
           weui.alert('请输入您的服务地址');
           return
         }
         // 门店验证
-        if (that.store == '请选择门店') {
+        if (self.store == '请选择门店') {
           weui.alert('请选择您的小区附近的门店');
           return
         }
         // 服务形式
-        if (that.serviceType === 0) {
-          if (that.serviceForm === '请选择') {
+        if (self.serviceType === 0) {
+          if (self.serviceForm === '请选择') {
             weui.alert('请选择服务类型');
             return
           }
           // 服务时间
-          if (that.serviceTimeAM === '开始时间' || that.serviceTimePM === '结束时间') {
+          if (self.serviceTimeAM === '开始时间' || self.serviceTimePM === '结束时间') {
             weui.alert('请选择服务时间');
             return
           }
           // 服务时间判断
-          if (Ssubstring(that.serviceTimePM) - Ssubstring(that.serviceTimeAM) < 1) {
+          if (Ssubstring(self.serviceTimePM) - Ssubstring(self.serviceTimeAM) < 1) {
             weui.alert('您选择的服务时间错误,请重新选择!');
             return
           }
@@ -507,53 +507,53 @@
           }
 
         } else {
-          that.resServiceArr = 1;
-          that.serviceTimeAM = '00:00';
-          that.serviceTimePM = '00:00';
+          self.resServiceArr = 1;
+          self.serviceTimeAM = '00:00';
+          self.serviceTimePM = '00:00';
         }
 
         // 服务技能
-        if (that.serviceType == 0 && that.skillsStr == '') {
+        if (self.serviceType == 0 && self.skillsStr == '') {
           weui.alert('请选择服务技能');
           return
         } else {
-          for (let i in that.skillsStr) {
-            for (let j in that.serviceSkillsArr) {
-              if (that.serviceSkillsArr[j].label == that.skillsStr[i]) {
-                skillsArray.push(that.serviceSkillsArr[j].value);
+          for (let i in self.skillsStr) {
+            for (let j in self.serviceSkillsArr) {
+              if (self.serviceSkillsArr[j].label == self.skillsStr[i]) {
+                skillsArray.push(self.serviceSkillsArr[j].value);
               }
             }
           }
         }
         // 预产期
-        if (that.serviceType === 1 && that.time === '选择您的预产期') {
+        if (self.serviceType === 1 && self.time === '选择您的预产期') {
           weui.alert('选择您的预产期');
           return
         }
         // 年龄 userAge
 
-        if (that.serviceType === 2 && !uAge) {
+        if (self.serviceType === 2 && !uAge) {
           weui.alert('请输入您孩子的年龄!');
           return
-        } else if (that.serviceType !== 2) {
+        } else if (self.serviceType !== 2) {
           uAge = 0
         }
-        let AM = time(that.serviceTimeAM);
-        let PM = time(that.serviceTimePM);
-        if (that) {
+        let AM = time(self.serviceTimeAM);
+        let PM = time(self.serviceTimePM);
+        if (self) {
           config.$http('/j/HouseKeeping/Add', {
             user_id: config.user_id,
             status_time: 0,
-            mobile: that.mobile,
-            user_name: that.userName,
-            type: that.serviceType + 1,
+            mobile: self.mobile,
+            user_name: self.userName,
+            type: self.serviceType + 1,
             skill: JSON.stringify(skillsArray),
-            cart: that.resServiceArr,
+            cart: self.resServiceArr,
             age: uAge,
-            address: that.userAddress,
-            store_id: that.storeId,
-            desc: that.dec,
-            yc_time: that.resTime,
+            address: self.userAddress,
+            store_id: self.storeId,
+            desc: self.dec,
+            yc_time: self.resTime,
             server_start_time: AM,
             server_end_time: PM
           }, res => {
@@ -564,16 +564,16 @@
               */
               if (res.data.message === '您已经提交过信息') {
                 weui.alert(res.data.message, function () {
-                  that.$router.push({path: '/order'})
+                  self.$router.push({path: '/order'})
                 });
               } else {
                 weui.alert('提交成功', function () {
-                  that.$router.push({path: '/'})
+                  self.$router.push({path: '/'})
                 })
               }
             } else {
               weui.alert('提交失败,请稍后再试!', function () {
-                that.$router.push({path: '/userInfo'})
+                self.$router.push({path: '/userInfo'})
               })
             }
           })
@@ -581,7 +581,7 @@
         /*
 
                 // 字符串拼接
-        let stitching = `&user_id=${config.user_id}&status_time=0&mobile=${that.mobile}&user_name=${that.userName}&type=${that.serviceType + 1}&skill=${JSON.stringify(skillsArray)}&cart=${that.resServiceArr}&age=${that.userAge}&address=${that.userAddress}&store_id=${that.storeId}&desc=${that.dec}&yc_time=${that.resTime}&server_start_time=${AM}&server_end_time=${PM}`;
+        let stitching = `&user_id=${config.user_id}&status_time=0&mobile=${self.mobile}&user_name=${self.userName}&type=${self.serviceType + 1}&skill=${JSON.stringify(skillsArray)}&cart=${self.resServiceArr}&age=${self.userAge}&address=${self.userAddress}&store_id=${self.storeId}&desc=${self.dec}&yc_time=${self.resTime}&server_start_time=${AM}&server_end_time=${PM}`;
 
 
 
@@ -594,16 +594,16 @@
             *!/
             if (res.data.message === '您已经提交过信息') {
               weui.alert(res.data.message, function () {
-                that.$router.push({path: '/order'})
+                self.$router.push({path: '/order'})
               });
             } else {
               weui.alert('提交成功', function () {
-                that.$router.push({path: '/'})
+                self.$router.push({path: '/'})
               })
             }
           } else {
             weui.alert('提交失败,请稍后再试!', function () {
-              that.$router.push({path: '/userInfo'})
+              self.$router.push({path: '/userInfo'})
             })
           }
         })*/
@@ -723,6 +723,9 @@
     margin-right: 10px;
     line-height: 18px;
     border-radius: 15px;
+     &:last-child{
+      margin-top: 15px;
+    }
   }
 
   .skillsStr-item-selected {

+ 23 - 20
www/webapp/housekeeping/src/components/userInfo.vue

@@ -69,11 +69,11 @@
     },
     created() {
       this.createCode = createCode();
-/*      _.$http('/o2o/user/info',{
-        user_id: _.user_id
-      },res=>{
-        console.log(res.data);
-      })*/
+      /*      _.$http('/o2o/user/info',{
+              user_id: _.user_id
+            },res=>{
+              console.log(res.data);
+            })*/
     },
     watch: {
       // 短信验证码
@@ -95,41 +95,41 @@
     },
     methods: {
       submit() {
-        let that = this;
+        let self = this;
 //        console.log(this.iCode)
 ////        console.log(this.userName)
 //        console.log(this.code)
         // 用户名判断
-        if (!that.userName) {
+        if (!self.userName) {
           weui.alert('请输入您的姓名');
           return
         }
         // 检验手机号码
-        // console.log(that.iCode);
-        // console.log(that.code);
-        if (Number.parseInt(that.iCode) !== that.code) {
+        // console.log(self.iCode);
+        // console.log(self.code);
+        if (Number.parseInt(self.iCode) !== self.code) {
           weui.alert('您手机号码未通过验证,请重新操作!');
           return
         }
         // 提交数据
         _.$http('/j/HouseKeeping/AddUserInfo', {
           user_id: _.user_id,
-          mobile: that.mobile,
-          name: that.userName
+          mobile: self.mobile,
+          name: self.userName
         }, res => {
           if (res.data.success) {
             weui.alert('注册成功', function () {
-              that.$router.push({path: '/'});
+              self.$router.push({path: '/'});
               return
             });
           }
           // console.log(res);
         })
 
-        /*axios.post(_.apiPath + 'j/HouseKeeping/AddUserInfo&user_id=' + _.user_id + '&mobile=' + that.mobile + '&name=' + that.userName).then(res => {
+        /*axios.post(_.apiPath + 'j/HouseKeeping/AddUserInfo&user_id=' + _.user_id + '&mobile=' + self.mobile + '&name=' + self.userName).then(res => {
           if (res.data.success) {
             weui.alert('注册成功', function () {
-              that.$router.push({path: '/'});
+              self.$router.push({path: '/'});
               return
             });
           }
@@ -138,13 +138,16 @@
       },
       // 获取短信验证码
       getCode() {
-        let that = this;
+        let self = this;
         _.SMS({
-          mobile: that.mobile,
-          iCreateCode: that.iCreateCode,
-          createCode: that.createCode
+          mobile: self.mobile,
+          iCreateCode: self.iCreateCode,
+          createCode: self.createCode
         }, res => {
-          that.code = res;
+          self.code = res;
+          if (_.apiPath.indexOf('commontest') > -1) {
+            this.iCode = this.code // 系统调试时开启
+          }
           // this.iCode = this.code // 系统调试时开启
           // this.iCreateCode = '';// 清空已输入验证码
           // this.createCode = createCode(); // 重置验证码

+ 71 - 0
www/webapp/housekeeping/src/config/globalVariables.js

@@ -0,0 +1,71 @@
+// test|master
+
+let locationHref = location.href;
+let test = true;
+let apiPath = '';
+let userId = '';
+let userInfo = [];
+let orderInfo = {
+	store:{}
+};
+let storeList = [];
+let serviceType = null; // 服务类型
+let houseInfo = {}; // 家政员信息
+let editHouseInfo = {}; // 门店老师的家政员信息
+
+if (locationHref.indexOf('common.yiguanjia.me') > -1) {
+	test = false
+}
+// 正式开发判断test还是pro
+if (test) {
+	apiPath = 'http://commontest.yiguanjia.me/index.php?r=';
+  // userId = '57e38f1b9f5160ac048b457d'
+
+  if (localStorage.getItem('wxUserID') === null) {
+    // userId = '57e238929f5160d6048b456d' // 管理员
+    // userId = '57fa51649f5160c4048b4948'
+  } else {
+  	userId = localStorage.getItem('wxUserID')
+  }
+
+  // userId = localStorage.getItem('wxUserID')
+} else {
+	apiPath = 'http://common.yiguanjia.me/index.php?r=';
+	userId = localStorage.getItem('wxUserID')
+}
+// 判断是否为dev开发
+if (locationHref.indexOf('http://localhost:80') > -1) {
+	apiPath = 'http://commontest.yiguanjia.me/index.php?r=';
+  // userId = '57fe2dc59f5160a1048b4591' // 享月会
+  // userId = '582405cea84ea02e3e8b4611' // 养老院
+  userId = '59e41443fb48a7552f8b459e'; // 管理员
+  // 张工
+  // userId = '582849af9f5160c2048b55dc';
+
+  // 前端
+  // 戴老师
+  // userId = '57e38f1b9f5160ac048b457d' // 顾客
+  // 刘星
+  // userId = '5860c5ce9f5160ad048b650f'
+  // 邓涛
+  // userId = '5a5eeaf3fb48a770708b456b'
+  // 家政人员
+  // userId = '57fa51649f5160c4048b4948'; // 我喂自己袋盐
+  // userId = '5823fe35a84ea0c13e8b461c'; // 我喂自己袋盐2
+} else if (locationHref.indexOf('admin.yiguanjiadev.me') > -1) {
+	apiPath = 'http://admin.yiguanjiadev.me/index.php?r=';
+  // userId = '57fe2dc59f5160a1048b4591'; // 享月会
+
+  userId = '59e41443fb48a7552f8b459e'; // 管理员
+}
+
+export default{
+	userId:userId,
+  orderInfo:orderInfo,
+	storeList:storeList,
+	apiPath:apiPath,
+  houseInfo:houseInfo,
+	editHouseInfo:editHouseInfo,
+	serviceType:serviceType,
+	locationHref:locationHref
+}

+ 17 - 299
www/webapp/housekeeping/src/config/index.js

@@ -1,304 +1,22 @@
 // JGEmpolyerController.php
-import axios from 'axios'
-import qs from 'qs'
+import globalVariables from './globalVariables'
+import method from './method'
 
-let locationHref = location.href;
-let test = true;
-let apiPath = '';
-let userId = '';
-let userInfo = [];
-let storeList = [];
-let serviceType = null; // 服务类型
-let houseInfo = {}; // 家政员信息
-if (locationHref.indexOf('common.yiguanjia.me') > -1) {
-  test = false
-}
-// 正式开发判断test还是pro
-if (test) {
-  apiPath = 'http://commontest.yiguanjia.me/index.php?r=';
-  // userId = '57e38f1b9f5160ac048b457d'
-
-  if (localStorage.getItem('wxUserID') === null) {
-    // userId = '57e238929f5160d6048b456d' // 管理员
-    userId = '57fa51649f5160c4048b4948'
-  } else {
-    userId = localStorage.getItem('wxUserID')
-  }
-
-  // userId = localStorage.getItem('wxUserID')
-} else {
-  apiPath = 'http://common.yiguanjia.me/index.php?r=';
-  userId = localStorage.getItem('wxUserID')
-}
-// 判断是否为dev开发
-if (locationHref.indexOf('http://localhost:8081/') > -1) {
-  apiPath = 'http://commontest.yiguanjia.me/index.php?r=';
-  // userId = '57fe2dc59f5160a1048b4591' // 享月会
-  // userId = '582405cea84ea02e3e8b4611' // 养老院
-  userId = '59e41443fb48a7552f8b459e'; // 管理员
-  // 张工
-  // userId = '582849af9f5160c2048b55dc';
-
-  // 前端
-  // 戴老师
-  // userId = '57e38f1b9f5160ac048b457d' // 顾客
-  // 刘星
-  // userId = '5860c5ce9f5160ad048b650f'
-  // 邓涛
-  // userId = '5a5eeaf3fb48a770708b456b'
-  // 家政人员
-  // userId = '57fa51649f5160c4048b4948'; // 我喂自己袋盐
-  // userId = '5823fe35a84ea0c13e8b461c'; // 我喂自己袋盐2
-} else if (locationHref.indexOf('admin.yiguanjiadev.me') > -1) {
-  apiPath = 'http://admin.yiguanjiadev.me/index.php?r=';
-  // userId = '57fe2dc59f5160a1048b4591'; // 享月会
-
-  userId = '59e41443fb48a7552f8b459e'; // 管理员
-}
-// 时间戳 => 正常日期
-let timetrans = function (d) {
-  var date = new Date(d * 1000);//如果date为13位不需要乘1000
-  var Y = date.getFullYear() + '-';
-  var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
-  var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
-  var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
-  var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
-  var s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
-  return Y + M + D + h + m + s;
-}
-// 身份证检验
-let checkID = function (ID) {
-  if (typeof ID !== 'string') return '您输入的身份证包含其他文字';
-  if (ID === '') return '身份证号不为空';
-  let city = {
-    11: "北京",
-    12: "天津",
-    13: "河北",
-    14: "山西",
-    15: "内蒙古",
-    21: "辽宁",
-    22: "吉林",
-    23: "黑龙江 ",
-    31: "上海",
-    32: "江苏",
-    33: "浙江",
-    34: "安徽",
-    35: "福建",
-    36: "江西",
-    37: "山东",
-    41: "河南",
-    42: "湖北 ",
-    43: "湖南",
-    44: "广东",
-    45: "广西",
-    46: "海南",
-    50: "重庆",
-    51: "四川",
-    52: "贵州",
-    53: "云南",
-    54: "西藏 ",
-    61: "陕西",
-    62: "甘肃",
-    63: "青海",
-    64: "宁夏",
-    65: "新疆",
-    71: "台湾",
-    81: "香港",
-    82: "澳门",
-    91: "国外"
-  };
-  let birthday = ID.substr(6, 4) + '/' + Number(ID.substr(10, 2)) + '/' + Number(ID.substr(12, 2));
-  let d = new Date(birthday);
-  let newBirthday = d.getFullYear() + '/' + Number(d.getMonth() + 1) + '/' + Number(d.getDate());
-  let currentTime = new Date().getTime();
-  let time = d.getTime();
-  let arrInt = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
-  let arrCh = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
-  let sum = 0, i, residue;
-
-  if (!/^\d{17}(\d|x)$/i.test(ID)) return '身份证格式有误';
-  if (city[ID.substr(0, 2)] === undefined) return "身份证所在地区不属于中国!";
-  if (time >= currentTime || birthday !== newBirthday) return '身份证中的出生日期,不属于当代!';
-  for (i = 0; i < 17; i++) {
-    sum += ID.substr(i, 1) * arrInt[i];
-  }
-  residue = arrCh[sum % 11];
-  if (residue !== ID.substr(17, 1)) return '身份证格式有误';
-
-  // return city[ID.substr(0, 2)] + "," + birthday + "," + (ID.substr(16, 1) % 2 ? " 男" : "女") //浙江,1994/7/26, 男
-  return true
-}
-
-// 检测是否为微信客户端
-function isWeixinBrowser() {
-  return /micromessenger/.test(navigator.userAgent.toLowerCase())
-}
-
-// 引入WX.SDK
-function WX() {
-  var wxSignObject = document.getElementById('wxMain');
-  var wxConfig = JSON.parse(wxSignObject.getAttribute('data-sign'));
-  alert(wxConfig)
-  return;
-  if (wxSignObject) {
-    var wxConfig = JSON.parse(wxSignObject.getAttribute('data-sign'));
-    wx.config({
-      debug: false,
-      appId: wxConfig.appId,
-      timestamp: wxConfig.timestamp,
-      nonceStr: wxConfig.nonceStr,
-      signature: wxConfig.signature,
-      jsApiList: [
-        'checkJsApi',
-        'onMenuShareTimeline',
-        'onMenuShareAppMessage',
-        'onMenuShareQQ',
-        'onMenuShareWeibo',
-        'hideMenuItems',
-        'showMenuItems',
-        'hideAllNonBaseMenuItem',
-        'showAllNonBaseMenuItem',
-        'translateVoice',
-        'startRecord',
-        'stopRecord',
-        'onRecordEnd',
-        'playVoice',
-        'pauseVoice',
-        'stopVoice',
-        'uploadVoice',
-        'downloadVoice',
-        'chooseImage',
-        'previewImage',
-        'uploadImage',
-        'downloadImage',
-        'getNetworkType',
-        'openLocation',
-        'getLocation',
-        'hideOptionMenu',
-        'showOptionMenu',
-        'closeWindow',
-        'scanQRCode',
-        'chooseWXPay',
-        'openProductSpecificView',
-        'addCard',
-        'chooseCard',
-        'openCard'
-      ]
-    });
-    // 获取用户坐标
-    wx.ready(function () {
-      wx.getLocation({
-        success: function (res) {
-          var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
-          var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
-          alert(latitude);
-          alert(longitude);
-          //var speed = res.speed; // 速度,以米/每秒计
-          //var accuracy = res.accuracy; // 位置精度
-          userLocation = latitude + ',' + longitude;
-          localStorage.setItem('userLocation', userLocation);
-        },
-        cancel: function (res) {
-          alert('用户拒绝授权获取地理位置');
-        }
-      });
-      wx.onMenuShareTimeline({
-        title: '家政服务,首选壹管家APP',
-        link: 'http://common.yiguanjia.me/o2o/web/index',
-        imgUrl: 'http://odulvej8l.bkt.clouddn.com/4-1-01.png'
-      });
-      wx.onMenuShareAppMessage({
-        title: '家政服务,首选壹管家APP',
-        desc: '足不出户,就能享受专业保洁师为您提供的贴心服务!',
-        link: 'http://common.yiguanjia.me/o2o/web/index',
-        imgUrl: 'http://odulvej8l.bkt.clouddn.com/4-1-01.png'
-      });
-    });
-  }
-}
-
-// loading
-/*let loading = weui.loading('加载中...', {
-  className: 'custom-classname'
-});
-setTimeout(function () {
-  loading.hide(function () {
-    // console.log('`loading` has been hidden');
-  });
-}, 700);*/
-// ios & android 判断
-let u = navigator.userAgent, app = navigator.appVersion;
-let isAndroid = (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) && (app.indexOf('Android') > -1 || app.indexOf('Linux') > -1); //android终端或者uc浏览器
-let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) && !!app.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
-
-// axios 全局设置
-/*axios.defaults.baseURL = 'https://api.example.com';
-axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
-axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';*/
-function $http(url, params, callback) {
-  if (locationHref.indexOf('commontest.yiguanjia.me') > -1 || locationHref.indexOf('common.yiguanjia.me') > -1) {
-  } else {
-    apiPath = ''
-  }
-  axios.post(apiPath + url, qs.stringify(params))
-    .then(response => {
-      if (response.status === 200) {
-        callback(response)
-      }
-    })
-    .catch(err => {
-      callback(err)
-    });
-}
-
-// 短信 params
-function SMS(params, callback) {
-  /*
-  params参数说明:
-    mobile: 手机
-    iCreateCode:用户输入的验证码
-    createCode:系统生成验证码
-
-  callback:回调短信验证码(code)
-   */
-  // 检验手机号码
-  if (!(/^1[34578]\d{9}$/.test(params.mobile)) || params.mobile === 0) {
-    weui.alert('输入的手机号码有误,请重新输入');
-    return
-  }
-  if (params.iCreateCode === params.createCode) {
-    $http('/moonclub/reserve/code', {
-      type: 2,
-      mobile: params.mobile
-    }, res => {
-      if (res.data.success) {
-        weui.alert('短信已发送,请留意查收!');
-        // 绑定短信验证码
-        callback(res.data.data.code)
-        // this.code = res.data.data.code;
-        // this.iCode = this.code // 系统调试时开启
-        // this.iCreateCode = '';// 清空已输入验证码
-        // this.createCode = createCode(); // 重置验证码
-      } else {
-        weui.alert('短信发送发送失败,请稍后再试!');
-      }
-    });
-  } else {
-    weui.alert('您输入验证码有误,请重新输入');
-  }
-}
 
 export default {
-  user_id: userId,
-  storeList: storeList,
-  apiPath: apiPath,
-  timetrans: timetrans,
-  checkID: checkID,
-  isAndroid: isAndroid,
-  isiOS: isiOS,
-  serviceType: serviceType,
-  WX: WX,
-  $http: $http,
-  SMS: SMS,
-  houseInfo: houseInfo
+  globalVariables:globalVariables,
+  user_id: globalVariables.userId,
+  storeList: globalVariables.storeList,
+  apiPath: globalVariables.apiPath,
+  houseInfo: globalVariables.houseInfo,
+  editHouseInfo: globalVariables.editHouseInfo,
+  serviceType: globalVariables.serviceType,
+  orderInfo: globalVariables.orderInfo,
+
+  checkID: method.checkID,
+  WX: method.WX,
+  timetrans: method.timetrans,
+  SMS: method.SMS,
+  $http: method.$http,
+  systemDetection:method.systemDetection,
 }

+ 255 - 0
www/webapp/housekeeping/src/config/method.js

@@ -0,0 +1,255 @@
+import axios from 'axios'
+import qs from 'qs'
+import globalVariables from './globalVariables'
+
+let locationHref = location.href;
+let apiPath = '';
+
+
+// 时间戳 => 正常日期
+let timetrans = function (d) {
+  var date = new Date(d * 1000);//如果date为13位不需要乘1000
+  var Y = date.getFullYear() + '-';
+  var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
+  var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
+  var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+  var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
+  var s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
+  return Y + M + D + h + m + s;
+}
+
+// 系统检测
+function systemDetection(factor) {
+  // ios & android 判断
+  let u = navigator.userAgent, app = navigator.appVersion;
+  //android终端或者uc浏览器
+  let isAndroid = (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) && (app.indexOf('Android') > -1 || app.indexOf('Linux') > -1);
+  //ios终端
+  let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) && !!app.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
+  if (isAndroid) {
+    return "Android"
+  } else if (isiOS) {
+    return "iOS"
+  } else {
+    return "other"
+  }
+
+}
+
+
+// axios 全局设置
+/*axios.defaults.baseURL = 'https://api.example.com';
+axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
+axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';*/
+function $http(url, params, callback) {
+  if (locationHref.indexOf('commontest.yiguanjia.me') > -1 || locationHref.indexOf('common.yiguanjia.me') > -1) {
+  } else {
+    globalVariables.apiPath = ''
+  }
+  axios.post(globalVariables.apiPath + url, qs.stringify(params))
+    .then(response => {
+      if (response.status === 200) {
+        callback(response)
+      }
+    })
+    .catch(err => {
+      callback(err)
+    });
+}
+
+// 短信 params
+function SMS(params, callback) {
+  /*
+  params参数说明:
+    mobile: 手机
+    iCreateCode:用户输入的验证码
+    createCode:系统生成验证码
+
+  callback:回调短信验证码(code)
+  */
+  // 检验手机号码
+  if (!(/^1[34578]\d{9}$/.test(params.mobile)) || params.mobile === 0) {
+    weui.alert('输入的手机号码有误,请重新输入');
+    return
+  }
+  if (params.iCreateCode === params.createCode) {
+    $http('/moonclub/reserve/code', {
+      type: 2,
+      mobile: params.mobile
+    }, res => {
+      if (res.data.success) {
+        weui.alert('短信已发送,请留意查收!');
+        // 绑定短信验证码
+        callback(res.data.data.code)
+        // this.code = res.data.data.code;
+        // this.iCode = this.code // 系统调试时开启
+        // this.iCreateCode = '';// 清空已输入验证码
+        // this.createCode = createCode(); // 重置验证码
+      } else {
+        weui.alert('短信发送发送失败,请稍后再试!');
+      }
+    });
+  } else {
+    weui.alert('您输入验证码有误,请重新输入');
+  }
+}
+
+// 身份证检验
+let checkID = function (ID) {
+  if (typeof ID !== 'string') return '您输入的身份证包含其他文字';
+  if (ID === '') return '身份证号不为空';
+  let city = {
+    11: "北京",
+    12: "天津",
+    13: "河北",
+    14: "山西",
+    15: "内蒙古",
+    21: "辽宁",
+    22: "吉林",
+    23: "黑龙江 ",
+    31: "上海",
+    32: "江苏",
+    33: "浙江",
+    34: "安徽",
+    35: "福建",
+    36: "江西",
+    37: "山东",
+    41: "河南",
+    42: "湖北 ",
+    43: "湖南",
+    44: "广东",
+    45: "广西",
+    46: "海南",
+    50: "重庆",
+    51: "四川",
+    52: "贵州",
+    53: "云南",
+    54: "西藏 ",
+    61: "陕西",
+    62: "甘肃",
+    63: "青海",
+    64: "宁夏",
+    65: "新疆",
+    71: "台湾",
+    81: "香港",
+    82: "澳门",
+    91: "国外"
+  };
+  let birthday = ID.substr(6, 4) + '/' + Number(ID.substr(10, 2)) + '/' + Number(ID.substr(12, 2));
+  let d = new Date(birthday);
+  let newBirthday = d.getFullYear() + '/' + Number(d.getMonth() + 1) + '/' + Number(d.getDate());
+  let currentTime = new Date().getTime();
+  let time = d.getTime();
+  let arrInt = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
+  let arrCh = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
+  let sum = 0, i, residue;
+
+  if (!/^\d{17}(\d|x)$/i.test(ID)) return '身份证格式有误';
+  if (city[ID.substr(0, 2)] === undefined) return "身份证所在地区不属于中国!";
+  if (time >= currentTime || birthday !== newBirthday) return '身份证中的出生日期,不属于当代!';
+  for (i = 0; i < 17; i++) {
+    sum += ID.substr(i, 1) * arrInt[i];
+  }
+  residue = arrCh[sum % 11];
+  if (residue !== ID.substr(17, 1)) return '身份证格式有误';
+
+  // return city[ID.substr(0, 2)] + "," + birthday + "," + (ID.substr(16, 1) % 2 ? " 男" : "女") //浙江,1994/7/26, 男
+  return true
+}
+
+// 检测是否为微信客户端
+function isWeixinBrowser() {
+  return /micromessenger/.test(navigator.userAgent.toLowerCase())
+}
+
+// 引入WX.SDK
+function WX() {
+  var wxSignObject = document.getElementById('wxMain');
+  var wxConfig = JSON.parse(wxSignObject.getAttribute('data-sign'));
+  alert(wxConfig)
+  return;
+  if (wxSignObject) {
+    var wxConfig = JSON.parse(wxSignObject.getAttribute('data-sign'));
+    wx.config({
+      debug: false,
+      appId: wxConfig.appId,
+      timestamp: wxConfig.timestamp,
+      nonceStr: wxConfig.nonceStr,
+      signature: wxConfig.signature,
+      jsApiList: [
+        'checkJsApi',
+        'onMenuShareTimeline',
+        'onMenuShareAppMessage',
+        'onMenuShareQQ',
+        'onMenuShareWeibo',
+        'hideMenuItems',
+        'showMenuItems',
+        'hideAllNonBaseMenuItem',
+        'showAllNonBaseMenuItem',
+        'translateVoice',
+        'startRecord',
+        'stopRecord',
+        'onRecordEnd',
+        'playVoice',
+        'pauseVoice',
+        'stopVoice',
+        'uploadVoice',
+        'downloadVoice',
+        'chooseImage',
+        'previewImage',
+        'uploadImage',
+        'downloadImage',
+        'getNetworkType',
+        'openLocation',
+        'getLocation',
+        'hideOptionMenu',
+        'showOptionMenu',
+        'closeWindow',
+        'scanQRCode',
+        'chooseWXPay',
+        'openProductSpecificView',
+        'addCard',
+        'chooseCard',
+        'openCard'
+      ]
+    });
+    // 获取用户坐标
+    wx.ready(function () {
+      wx.getLocation({
+        success: function (res) {
+          var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
+          var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
+          alert(latitude);
+          alert(longitude);
+          //var speed = res.speed; // 速度,以米/每秒计
+          //var accuracy = res.accuracy; // 位置精度
+          userLocation = latitude + ',' + longitude;
+          localStorage.setItem('userLocation', userLocation);
+        },
+        cancel: function (res) {
+          alert('用户拒绝授权获取地理位置');
+        }
+      });
+      wx.onMenuShareTimeline({
+        title: '家政服务,首选壹管家APP',
+        link: 'http://common.yiguanjia.me/o2o/web/index',
+        imgUrl: 'http://odulvej8l.bkt.clouddn.com/4-1-01.png'
+      });
+      wx.onMenuShareAppMessage({
+        title: '家政服务,首选壹管家APP',
+        desc: '足不出户,就能享受专业保洁师为您提供的贴心服务!',
+        link: 'http://common.yiguanjia.me/o2o/web/index',
+        imgUrl: 'http://odulvej8l.bkt.clouddn.com/4-1-01.png'
+      });
+    });
+  }
+}
+
+export default {
+  isWeixinBrowser: isWeixinBrowser,
+  checkID: checkID,
+  SMS: SMS,
+  $http: $http,
+  timetrans: timetrans,
+  systemDetection: systemDetection
+}

+ 5 - 0
www/webapp/housekeeping/src/router/index.js

@@ -10,6 +10,7 @@ import userInfo from '@/components/userInfo'
 import managementList from '@/components/management/list'
 import managementEdit from '@/components/management/edit'
 import managementEmployee from '@/components/management/employee'
+import managementHomeClerkDetails from '@/components/management/homeClerkDetails'
 // 家政
 import houseKeepingLogin from '@/components/houseKeeping/login'
 import houseKeepingInfo from '@/components/houseKeeping/info'
@@ -56,6 +57,10 @@ export default new Router({
       path: '/managementEmployee',
       name: 'managementEmployee',
       component: managementEmployee
+    }, {
+      path: '/managementHomeClerkDetails',
+      name: 'managementHomeClerkDetails',
+      component: managementHomeClerkDetails
     }, {
       path: '/houseKeeping/login',
       name: 'houseKeeping/login',

Някои файлове не бяха показани, защото твърде много файлове са промени