Browse Source

上下班记录,统计,事件

seimin 3 years ago
parent
commit
7fd13db405
10 changed files with 931 additions and 258 deletions
  1. 3 2
      index.html
  2. 4 2
      src/filters/index.js
  3. 167 157
      src/router/index.js
  4. 2 2
      src/views/Main.vue
  5. 19 8
      src/views/incidentList.vue
  6. 55 13
      src/views/indes.vue
  7. 23 14
      src/views/my.vue
  8. 159 58
      src/views/processing.vue
  9. 497 0
      src/views/workList.vue
  10. 2 2
      static/jssdk/jssdk.js

+ 3 - 2
index.html

@@ -30,8 +30,9 @@
30 30
       text-decoration: none
31 31
     }
32 32
   </style>
33
-  <!-- <script src="./static/jssdk/jweixin-1.2.0.js"></script> -->
34
-  <!-- <script src="./static/jssdk/jssdk.js"></script> -->
33
+  <!-- <script src="https://wx2.zuel.edu.cn/thirdparty/nifty/js/jquery-2.2.4.min.js"></script> -->
34
+  <script src="./static/jssdk/jweixin-1.2.0.js"></script>
35
+  <script src="./static/jssdk/jssdk.js"></script>
35 36
 </head>
36 37
 
37 38
 <body>

+ 4 - 2
src/filters/index.js

@@ -3,8 +3,10 @@ Vue.filter('timeFormat', function (date, fmt) {
3 3
   if (!date) {
4 4
     return '';
5 5
   }
6
-  var dateArr = date.split(/[- : \/]/);
7
-  date = new Date(dateArr[0], dateArr[1] - 1, dateArr[2], dateArr[3], dateArr[4], dateArr[5]);
6
+  if (typeof date === 'string') {
7
+    var dateArr = date.split(/[- : \/]/);
8
+    date = new Date(dateArr[0], dateArr[1] - 1, dateArr[2], dateArr[3], dateArr[4], dateArr[5]);
9
+  }
8 10
   if (/(y+)/.test(fmt)) {
9 11
     fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
10 12
   }

+ 167 - 157
src/router/index.js

@@ -5,6 +5,7 @@ import Main from './../views/Main.vue'
5 5
 import Indes from './../views/indes.vue'//首页
6 6
 import My from './../views/my.vue'//我的
7 7
 import IncidentList from './../views/incidentList.vue'//事件列表
8
+import WorkList from './../views/workList.vue'//上下班记录查看
8 9
 import NewIncident from './../views/newIncident.vue'//新建事件
9 10
 import Inspection from './../views/inspection.vue'//巡检列表
10 11
 import InspectionDetail from './../views/inspectionDetail.vue'//巡检详情
@@ -28,197 +29,206 @@ Vue.use(Router)
28 29
 
29 30
 export default new Router({
30 31
   routes: [{
31
-      path: '/login',
32
-      component: Login,
33
-      name: '',
34
-      hidden: true
35
-    },
36
-    {
37
-      path: '/main',
38
-      component: Main,
39
-      name: '',
40
-      hidden: true,
41
-      children: [{
42
-          path: '/',
43
-          redirect: '/main/indes'
44
-        },
45
-        {
46
-          path: '/main/indes',
47
-          component: Indes,
48
-          meta: {
49
-            allowBack: false
50
-          },
51
-        },
52
-        {
53
-          path: '/main/incidentList',
54
-          name: 'IncidentList',
55
-          component: IncidentList,
56
-          meta: {
57
-            allowBack: false
58
-          },
59
-          children: []
60
-        },
61
-        {
62
-          path: '/main/inspection',
63
-          name: 'Inspection',
64
-          component: Inspection,
65
-          meta: {
66
-            allowBack: false
67
-          },
68
-        },
69
-        {
70
-          path: '/main/inspectionDoneDetail',
71
-          name: 'InspectionDoneDetail',
72
-          component: InspectionDoneDetail,
73
-          meta: {
74
-            allowBack: false
75
-          },
76
-        },
77
-        {
78
-          path: '/main/inspectionDetail',
79
-          name: 'InspectionDetail',
80
-          component: InspectionDetail,
81
-          meta: {
82
-            allowBack: false
83
-          },
84
-        },
85
-        {
86
-          path: '/main/my',
87
-          component: My,
88
-          meta: {
89
-            allowBack: false
90
-          },
91
-        },
92
-      ]
93
-    },
94
-    {
95
-      path: '/order',
96
-      name: 'Order',
97
-      component: Order,
98
-      meta: {
99
-        allowBack: false
100
-      },
101
-    }, {
102
-      path: '/grabSheet',
103
-      name: 'GrabSheet',
104
-      component: GrabSheet,
105
-      meta: {
106
-        allowBack: false
107
-      },
108
-    },
109
-    {
110
-      path: '/againAssign',
111
-      name: 'AgainAssign',
112
-      component: AgainAssign,
113
-      meta: {
114
-        allowBack: false
115
-      },
116
-    },
117
-    {
118
-      path: '/processing',
119
-      name: 'Processing',
120
-      component: Processing,
121
-      meta: {
122
-        allowBack: false
123
-      },
124
-    },
125
-    {
126
-      path: '/solved',
127
-      name: 'Solved',
128
-      component: Solved,
32
+    path: '/login',
33
+    component: Login,
34
+    name: '',
35
+    hidden: true
36
+  },
37
+  {
38
+    path: '/main',
39
+    component: Main,
40
+    name: '',
41
+    hidden: true,
42
+    children: [{
43
+      path: '/',
44
+      redirect: '/main/indes'
45
+    },
46
+    {
47
+      path: '/main/indes',
48
+      component: Indes,
129 49
       meta: {
130 50
         allowBack: false
131 51
       },
132 52
     },
133 53
     {
134
-      path: '/closed',
135
-      name: 'Closed',
136
-      component: Closed,
54
+      path: '/main/incidentList/:type',
55
+      name: 'IncidentList',
56
+      component: IncidentList,
137 57
       meta: {
138 58
         allowBack: false
139 59
       },
60
+      children: []
140 61
     },
141 62
     {
142
-      path: '/waitConfirm',
143
-      name: 'WaitConfirm',
144
-      component: WaitConfirm,
63
+      path: '/main/workList',
64
+      name: 'WorkList',
65
+      component: WorkList,
145 66
       meta: {
146 67
         allowBack: false
147 68
       },
69
+      children: []
148 70
     },
149 71
     {
150
-      path: '/newIncident',
151
-      name: 'NewIncident',
152
-      component: NewIncident,
72
+      path: '/main/inspection',
73
+      name: 'Inspection',
74
+      component: Inspection,
153 75
       meta: {
154 76
         allowBack: false
155 77
       },
156 78
     },
157 79
     {
158
-      path: '/noticeDetails/:data',
159
-      name: 'NoticeDetails',
160
-      component: NoticeDetails,
80
+      path: '/main/inspectionDoneDetail',
81
+      name: 'InspectionDoneDetail',
82
+      component: InspectionDoneDetail,
161 83
       meta: {
162 84
         allowBack: false
163 85
       },
164 86
     },
165 87
     {
166
-      path: '/noticeList',
167
-      component: NoticeList,
88
+      path: '/main/inspectionDetail',
89
+      name: 'InspectionDetail',
90
+      component: InspectionDetail,
168 91
       meta: {
169 92
         allowBack: false
170 93
       },
171 94
     },
172 95
     {
173
-      path: '/knowList',
174
-      name: 'KnowList',
175
-      component: KnowList,
96
+      path: '/main/my',
97
+      component: My,
176 98
       meta: {
177 99
         allowBack: false
178 100
       },
179 101
     },
180
-    {
181
-      path: '/knowDetails/:data',
182
-      name: 'KnowDetails',
183
-      component: KnowDetails,
184
-      meta: {
185
-        allowBack: false
186
-      },
187
-    },
188
-    {
189
-      path: '/referenceList',
190
-      name: 'ReferenceList',
191
-      component: ReferenceList,
192
-      meta: { allowBack: false },
193
-    },
194
-    {
195
-      path: '/referenceDetail/:data',
196
-      name: 'ReferenceDetail',
197
-      component: ReferenceDetail,
198
-      meta: { allowBack: false },
199
-    },
200
-    
201
-    {
202
-      path: '/guide',
203
-      component: Guide,
204
-      meta: {
205
-        allowBack: false
206
-      },
207
-    },
208
-    {
209
-      path: '/guideDetail',
210
-      name:'GuideDetail',
211
-      component: GuideDetail,
212
-      meta: {
213
-        allowBack: false
214
-      },
215
-    },
216
-    {
217
-      path: '*',
218
-      hidden: true,
219
-      redirect: {
220
-        path: '/login'
221
-      }
102
+    ]
103
+  },
104
+  {
105
+    path: '/order',
106
+    name: 'Order',
107
+    component: Order,
108
+    meta: {
109
+      allowBack: false
110
+    },
111
+  }, {
112
+    path: '/grabSheet',
113
+    name: 'GrabSheet',
114
+    component: GrabSheet,
115
+    meta: {
116
+      allowBack: false
117
+    },
118
+  },
119
+  {
120
+    path: '/againAssign',
121
+    name: 'AgainAssign',
122
+    component: AgainAssign,
123
+    meta: {
124
+      allowBack: false
125
+    },
126
+  },
127
+  {
128
+    path: '/processing',
129
+    name: 'Processing',
130
+    component: Processing,
131
+    meta: {
132
+      allowBack: false
133
+    },
134
+  },
135
+  {
136
+    path: '/solved',
137
+    name: 'Solved',
138
+    component: Solved,
139
+    meta: {
140
+      allowBack: false
141
+    },
142
+  },
143
+  {
144
+    path: '/closed',
145
+    name: 'Closed',
146
+    component: Closed,
147
+    meta: {
148
+      allowBack: false
149
+    },
150
+  },
151
+  {
152
+    path: '/waitConfirm',
153
+    name: 'WaitConfirm',
154
+    component: WaitConfirm,
155
+    meta: {
156
+      allowBack: false
157
+    },
158
+  },
159
+  {
160
+    path: '/newIncident',
161
+    name: 'NewIncident',
162
+    component: NewIncident,
163
+    meta: {
164
+      allowBack: false
165
+    },
166
+  },
167
+  {
168
+    path: '/noticeDetails/:data',
169
+    name: 'NoticeDetails',
170
+    component: NoticeDetails,
171
+    meta: {
172
+      allowBack: false
173
+    },
174
+  },
175
+  {
176
+    path: '/noticeList',
177
+    component: NoticeList,
178
+    meta: {
179
+      allowBack: false
180
+    },
181
+  },
182
+  {
183
+    path: '/knowList',
184
+    name: 'KnowList',
185
+    component: KnowList,
186
+    meta: {
187
+      allowBack: false
188
+    },
189
+  },
190
+  {
191
+    path: '/knowDetails/:data',
192
+    name: 'KnowDetails',
193
+    component: KnowDetails,
194
+    meta: {
195
+      allowBack: false
196
+    },
197
+  },
198
+  {
199
+    path: '/referenceList',
200
+    name: 'ReferenceList',
201
+    component: ReferenceList,
202
+    meta: { allowBack: false },
203
+  },
204
+  {
205
+    path: '/referenceDetail/:data',
206
+    name: 'ReferenceDetail',
207
+    component: ReferenceDetail,
208
+    meta: { allowBack: false },
209
+  },
210
+
211
+  {
212
+    path: '/guide',
213
+    component: Guide,
214
+    meta: {
215
+      allowBack: false
216
+    },
217
+  },
218
+  {
219
+    path: '/guideDetail',
220
+    name: 'GuideDetail',
221
+    component: GuideDetail,
222
+    meta: {
223
+      allowBack: false
224
+    },
225
+  },
226
+  {
227
+    path: '*',
228
+    hidden: true,
229
+    redirect: {
230
+      path: '/login'
222 231
     }
232
+  }
223 233
   ]
224 234
 })

+ 2 - 2
src/views/Main.vue

@@ -8,7 +8,7 @@
8 8
                 <i class="iconfont icon-shouyexian"></i>
9 9
                 <span>首页</span>
10 10
             </router-link>
11
-            <router-link to="/main/incidentList" class="link" active-class="active">
11
+            <router-link to="/main/incidentList/all" class="link" active-class="active">
12 12
                 <i class="iconfont icon-baoxiuxian"></i>
13 13
                 <span>事件</span>
14 14
             </router-link>
@@ -84,4 +84,4 @@ export default {
84 84
 .fade-leave-active{
85 85
     opacity: 0;
86 86
 }
87
-</style>
87
+</style>

+ 19 - 8
src/views/incidentList.vue

@@ -170,6 +170,7 @@ export default {
170 170
         }
171 171
       ],
172 172
       searchType: "userAll",
173
+      type: "all",
173 174
       sum: 10,
174 175
       idx: 0,
175 176
       stateClass: "",
@@ -216,6 +217,9 @@ export default {
216 217
       if (this.$route.params.searchType) {
217 218
         this.searchType = this.$route.params.searchType;
218 219
       }
220
+      if (this.$route.params.type) {
221
+        this.type = this.$route.params.type;
222
+      }
219 223
     },
220 224
     stateChange() {
221 225
       var that = this;
@@ -256,16 +260,23 @@ export default {
256 260
 
257 261
     getData() {
258 262
       var that = this;
263
+      let postData = {
264
+        assignee: that.loginUser.id,
265
+        candidateGroups: that.candidateGroups,
266
+        searchType: that.searchType,
267
+        idx: that.idx,
268
+        sum: that.sum,
269
+        incident: { temporary: true }
270
+      };
271
+      if (this.type === "today") {
272
+        postData.incident.acceptDate =
273
+          formatDate(new Date(), "yyyy-MM-dd") + " 00:00:00";
274
+        postData.incident.acceptDateEnd =
275
+          formatDate(new Date(), "yyyy-MM-dd") + " 23:59:59";
276
+      }
259 277
 
260 278
       that.$http
261
-        .post("service/bpm/bpm/fetchTask/bpm_incident", {
262
-          assignee: that.loginUser.id,
263
-          candidateGroups: that.candidateGroups,
264
-          searchType: that.searchType,
265
-          idx: that.idx,
266
-          sum: that.sum,
267
-          incident: { temporary: true }
268
-        })
279
+        .post("service/bpm/bpm/fetchTask/bpm_incident", postData)
269 280
         .then(function(res) {
270 281
           if (res.data.data.length > 0) {
271 282
             that.wushuju = false;

+ 55 - 13
src/views/indes.vue

@@ -29,31 +29,45 @@
29 29
     </div>
30 30
     <div class="bigBody">
31 31
       <!-- 统计信息 -->
32
-      <div class="newStatistics">
32
+      <div
33
+        class="newStatistics"
34
+        v-if="!newStatisticsLoading && isShowNewStatistics"
35
+      >
33 36
         <div class="buildOrder">
34
-          <div class="buildOrderItem">
35
-            <div class="s_num">123</div>
37
+          <router-link class="buildOrderItem" :to="{ path: '/main/incidentList/today' }" tag="div">
38
+            <div class="s_num">{{ newStatistics.createOrders }}</div>
36 39
             <div>今日建单</div>
37
-          </div>
38
-          <div class="buildOrderItem">
39
-            <div class="s_num">123</div>
40
+          </router-link>
41
+          <router-link class="buildOrderItem" :to="{ path: '/main/incidentList/all' }" tag="div">
42
+            <div class="s_num">{{ newStatistics.todoOrders }}</div>
40 43
             <div>处理中</div>
41
-          </div>
44
+          </router-link>
42 45
         </div>
43
-        <div class="attendance">
46
+        <router-link
47
+          class="attendance"
48
+          :to="{ path: '/main/workList' }"
49
+          tag="div"
50
+        >
44 51
           <div class="attendanceItem">
45
-            <div class="s_num">123</div>
52
+            <div class="s_num">{{ newStatistics.usersCount }}</div>
46 53
             <div>今日上班应到</div>
47 54
           </div>
48 55
           <div class="attendanceItem">
49
-            <div class="s_num">123</div>
56
+            <div class="s_num">{{ newStatistics.onlineCount }}</div>
50 57
             <div>今日上班实到</div>
51 58
           </div>
52 59
           <div class="attendanceItem">
53
-            <div class="s_num">123</div>
60
+            <div class="s_num">{{ newStatistics.errorCount }}</div>
54 61
             <div>今日迟到</div>
55 62
           </div>
56
-        </div>
63
+        </router-link>
64
+      </div>
65
+      <!-- loading -->
66
+      <div
67
+        class="newStatistics loading"
68
+        v-if="newStatisticsLoading && isShowNewStatistics"
69
+      >
70
+        <cube-loading :size="30"></cube-loading>
57 71
       </div>
58 72
       <!-- 最新报修 -->
59 73
       <div class="newRepair">
@@ -70,6 +84,7 @@
70 84
         <div
71 85
           class="conentBox"
72 86
           v-for="item in dataList"
87
+          :key="item.id"
73 88
           @click="toIncidentDetails(item)"
74 89
           v-if="!!dataList.length"
75 90
         >
@@ -202,7 +217,16 @@ export default {
202 217
       newRapirLoading: true, //最新报修loading
203 218
       newNoticeLoading: true, //最新公告loading
204 219
       candidateGroups: "",
205
-      valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0 //报修主体
220
+      valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
221
+      newStatistics: {
222
+        createOrders: 0, //今日建单
223
+        todoOrders: 0, //处理中
224
+        usersCount: 0, //今日上班应到
225
+        onlineCount: 0, //今日上班实到
226
+        errorCount: 0 //今日迟到
227
+      }, //统计数据
228
+      newStatisticsLoading: false, //统计数据Loading
229
+      isShowNewStatistics: false
206 230
     };
207 231
   },
208 232
   methods: {
@@ -228,6 +252,16 @@ export default {
228 252
           }
229 253
         });
230 254
     },
255
+    // 获取统计信息
256
+    getManagerIndexInfo() {
257
+      this.newStatisticsLoading = true;
258
+      this.$http.post("service/bpm/data/getManagerIndexInfo", {}).then(res => {
259
+        this.newStatisticsLoading = false;
260
+        if (res.status == 200) {
261
+          this.newStatistics = res.data.data;
262
+        }
263
+      });
264
+    },
231 265
     // 获取最新报修
232 266
     getNewRapir() {
233 267
       var that = this;
@@ -313,6 +347,11 @@ export default {
313 347
     }
314 348
   },
315 349
   created() {
350
+    this.isShowNewStatistics = this.loginUser.role.some(
351
+      v =>
352
+        v.rolecode == "incident-category-manager" ||
353
+        v.rolecode == "incident manager"
354
+    );
316 355
     var that = this;
317 356
     that.valConfig = JSON.parse(localStorage.getItem("valConfig")) - 0;
318 357
     that.loginUser.group.forEach(element => {
@@ -333,6 +372,9 @@ export default {
333 372
     localStorage.removeItem("order");
334 373
     this.getNoticData();
335 374
     this.getNewRapir();
375
+    if (this.isShowNewStatistics) {
376
+      this.getManagerIndexInfo();
377
+    }
336 378
   },
337 379
   mounted() {}
338 380
 };

+ 23 - 14
src/views/my.vue

@@ -115,8 +115,8 @@
115 115
   </div>
116 116
 </template>
117 117
 <script>
118
-// let sdk = new jssdk(3, "https://wx2.zuel.edu.cn"); // 域名更换为对应环境域名, 204 更换为对应环境wid
119
-// sdk.config(1); //1表示调试模式,生产环境传0
118
+let sdk = new jssdk(3, "https://wx2.zuel.edu.cn"); // 域名更换为对应环境域名, 204 更换为对应环境wid
119
+sdk.config(0); //1表示调试模式,生产环境传0
120 120
 import "./../../static/css/iconfont.js";
121 121
 export default {
122 122
   data() {
@@ -132,24 +132,33 @@ export default {
132 132
   },
133 133
   methods: {
134 134
     //获取位置,经纬度
135
-    // getLocation() {
136
-    //   //第二个参数 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
137
-    //   sdk.getLocation(function(res) {
138
-    //     alert(res);
139
-    //   }, "wgs84");
140
-    // },
135
+    getLocation() {
136
+      //第二个参数 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
137
+      sdk.getLocation(function(res) {
138
+        // alert(JSON.stringify(res));
139
+        // latitude
140
+        // longitude
141
+        return this.$http.get(
142
+          `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=TADBZ-IRBWU-QAXVE-2IWED-UW2F5-YVF66`
143
+        );
144
+      });
145
+    },
141 146
     // 上下班
142
-    goToWork(online) {
143
-      // this.getLocation();
144
-      online = online == 1 ? 0 : 1;
147
+    async goToWork(online) {
145 148
       const toast = this.$createToast({
146 149
         time: 0,
147 150
         mask: true,
148 151
         txt: "正在加载中"
149 152
       });
150 153
       toast.show();
154
+      let address = "";
155
+      let addressResult = await this.getLocation();
156
+      if (addressResult.status === 0) {
157
+        address = addressResult.result.formatted_addresses.recommend;
158
+      }
159
+      online = online == 1 ? 0 : 1;
151 160
       this.$http
152
-        .post("service/auth/online", { onlion: online, address: "" })
161
+        .post("service/auth/online", { onlion: online, address })
153 162
         .then(res => {
154 163
           toast.hide();
155 164
           if (res.status == 200) {
@@ -261,8 +270,8 @@ export default {
261 270
   border-radius: 50%;
262 271
   margin: 0 auto;
263 272
   overflow: hidden;
264
-  /* background: url(./../../static/images/pig.jpg); */
265
-  /* background-size: contain; */
273
+  /* background: url(./../../static/images/pig.jpg);
274
+  background-size: contain; */
266 275
   background-color: #fff;
267 276
   display: flex;
268 277
   justify-content: center;

+ 159 - 58
src/views/processing.vue

@@ -323,6 +323,10 @@
323 323
                     v-if="order == 2"
324 324
                   ></cube-form-item>
325 325
                   <cube-form-item
326
+                    :field="fields[15]"
327
+                    v-if="order == 5"
328
+                  ></cube-form-item>
329
+                  <cube-form-item
326 330
                     :field="fields[7]"
327 331
                     v-if="order == 2"
328 332
                   ></cube-form-item>
@@ -539,6 +543,10 @@ export default {
539 543
         {
540 544
           label: "转派",
541 545
           value: 3
546
+        },
547
+        {
548
+          label: "指派",
549
+          value: 5
542 550
         }
543 551
         // {
544 552
         //   label: "协同",
@@ -758,6 +766,18 @@ export default {
758 766
           rules: {
759 767
             required: false
760 768
           }
769
+        },
770
+        {
771
+          type: "select",
772
+          modelKey: "handlerUser",
773
+          label: "指派对象:",
774
+          props: {
775
+            options: [],
776
+            placeholder: "请选择指派对象"
777
+          },
778
+          rules: {
779
+            required: true
780
+          }
761 781
         }
762 782
       ]
763 783
     };
@@ -1024,6 +1044,31 @@ export default {
1024 1044
           that.fields[2].props.options = that.closecodeArr;
1025 1045
         });
1026 1046
     },
1047
+    // 获取指派对象baba
1048
+    getZpUser() {
1049
+      var that = this;
1050
+      var postData = {
1051
+        idx: 0,
1052
+        sum: 1000,
1053
+        user: {
1054
+          roledata: { rolecode: "first-line support" },
1055
+          roledata2: { rolecode: "second-line support" },
1056
+          selectType: "1"
1057
+        }
1058
+      };
1059
+      this.$http
1060
+        .post("service/user/data/fetchDataList/user", postData)
1061
+        .then(function(res) {
1062
+          var handlerUserArr = [];
1063
+          res.data.list.forEach(function(v, i) {
1064
+            handlerUserArr.push({
1065
+              text: v.name,
1066
+              value: v.id
1067
+            });
1068
+          });
1069
+          that.fields[15].props.options = handlerUserArr;
1070
+        });
1071
+    },
1027 1072
     // 获取升级对象
1028 1073
     getUpUser() {
1029 1074
       var that = this;
@@ -1380,67 +1425,121 @@ export default {
1380 1425
       //   id:this.selectedPlaceId,
1381 1426
       //   place:this.selectedPlaceName
1382 1427
       // };//增加区域地点
1383
-      // console.log(that.modelData,11111);
1428
+      console.log(that.model, 11111);
1384 1429
       // console.log(this.selectedPlaceId,this.selectedAreaId,8888);//2020年4月25日16:12:55
1385 1430
       that.model.fileUrl = "url";
1386 1431
       that.loadShow = true;
1387
-      that.$http
1388
-        .post(
1389
-          "service/bpm/bpm/completeTask/" +
1390
-            that.modelData.incident.taskId +
1391
-            "/" +
1392
-            that.loginUser.id,
1393
-          that.modelData
1394
-        )
1395
-        .then(function(res) {
1396
-          if (res.data) {
1397
-            setTimeout(function() {
1398
-              that.$refs.upload.start();
1399
-            }, 100);
1400
-            $("#fade").fadeIn();
1401
-            that.promptingConent = "恭喜您,提交成功!";
1402
-            that.promptingStatus = true;
1403
-            that.dialog = that
1404
-              .$createDialog({
1405
-                type: "alert",
1406
-                title: "提交成功",
1407
-                content: "点击返回首页",
1408
-                icon: "cubeic-right",
1409
-                onConfirm: (e, promptValue) => {
1410
-                  that.$router.push({ path: "/main" });
1411
-                }
1412
-              })
1413
-              .show();
1414
-            localStorage.removeItem("category");
1415
-            localStorage.removeItem("model");
1416
-            localStorage.removeItem("modelData");
1417
-            localStorage.removeItem("referenceInfo");
1418
-            localStorage.removeItem("solution");
1419
-            localStorage.removeItem("order");
1420
-            setTimeout(function() {
1421
-              $("#fade").fadeOut();
1422
-            }, 2000);
1423
-          } else {
1424
-            $("#fade").fadeIn();
1425
-            that.promptingConent = "系统错误,请稍后再试!";
1426
-            that.promptingStatus = false;
1427
-            that.loadShow = false;
1428
-            that.dialog = that
1429
-              .$createDialog({
1430
-                type: "alert",
1431
-                title: "系统错误,请稍后再试!",
1432
-                content: "点击返回首页",
1433
-                icon: "cubeic-wrong",
1434
-                onConfirm: (e, promptValue) => {
1435
-                  that.$router.push({ path: "/main" });
1436
-                }
1437
-              })
1438
-              .show();
1439
-            setTimeout(function() {
1440
-              $("#fade").fadeOut();
1441
-            }, 2000);
1442
-          }
1443
-        });
1432
+      if (this.order == 5) {
1433
+        that.$http
1434
+          .post(
1435
+            "service/bpm/bpm/delegateTask/" + that.modelData.incident.taskId,
1436
+            { assginee: that.model.handlerUser }
1437
+          )
1438
+          .then(function(res) {
1439
+            if (res.data) {
1440
+              $("#fade").fadeIn();
1441
+              that.promptingConent = "恭喜您,提交成功!";
1442
+              that.promptingStatus = true;
1443
+              that.dialog = that
1444
+                .$createDialog({
1445
+                  type: "alert",
1446
+                  title: "提交成功",
1447
+                  content: "点击返回首页",
1448
+                  icon: "cubeic-right",
1449
+                  onConfirm: (e, promptValue) => {
1450
+                    that.$router.push({ path: "/main" });
1451
+                  }
1452
+                })
1453
+                .show();
1454
+              localStorage.removeItem("category");
1455
+              localStorage.removeItem("model");
1456
+              localStorage.removeItem("modelData");
1457
+              localStorage.removeItem("referenceInfo");
1458
+              localStorage.removeItem("solution");
1459
+              localStorage.removeItem("order");
1460
+              setTimeout(function() {
1461
+                $("#fade").fadeOut();
1462
+              }, 2000);
1463
+            } else {
1464
+              $("#fade").fadeIn();
1465
+              that.promptingConent = "系统错误,请稍后再试!";
1466
+              that.promptingStatus = false;
1467
+              that.loadShow = false;
1468
+              that.dialog = that
1469
+                .$createDialog({
1470
+                  type: "alert",
1471
+                  title: "系统错误,请稍后再试!",
1472
+                  content: "点击返回首页",
1473
+                  icon: "cubeic-wrong",
1474
+                  onConfirm: (e, promptValue) => {
1475
+                    that.$router.push({ path: "/main" });
1476
+                  }
1477
+                })
1478
+                .show();
1479
+              setTimeout(function() {
1480
+                $("#fade").fadeOut();
1481
+              }, 2000);
1482
+            }
1483
+          });
1484
+      } else {
1485
+        that.$http
1486
+          .post(
1487
+            "service/bpm/bpm/completeTask/" +
1488
+              that.modelData.incident.taskId +
1489
+              "/" +
1490
+              that.loginUser.id,
1491
+            that.modelData
1492
+          )
1493
+          .then(function(res) {
1494
+            if (res.data) {
1495
+              setTimeout(function() {
1496
+                that.$refs.upload.start();
1497
+              }, 100);
1498
+              $("#fade").fadeIn();
1499
+              that.promptingConent = "恭喜您,提交成功!";
1500
+              that.promptingStatus = true;
1501
+              that.dialog = that
1502
+                .$createDialog({
1503
+                  type: "alert",
1504
+                  title: "提交成功",
1505
+                  content: "点击返回首页",
1506
+                  icon: "cubeic-right",
1507
+                  onConfirm: (e, promptValue) => {
1508
+                    that.$router.push({ path: "/main" });
1509
+                  }
1510
+                })
1511
+                .show();
1512
+              localStorage.removeItem("category");
1513
+              localStorage.removeItem("model");
1514
+              localStorage.removeItem("modelData");
1515
+              localStorage.removeItem("referenceInfo");
1516
+              localStorage.removeItem("solution");
1517
+              localStorage.removeItem("order");
1518
+              setTimeout(function() {
1519
+                $("#fade").fadeOut();
1520
+              }, 2000);
1521
+            } else {
1522
+              $("#fade").fadeIn();
1523
+              that.promptingConent = "系统错误,请稍后再试!";
1524
+              that.promptingStatus = false;
1525
+              that.loadShow = false;
1526
+              that.dialog = that
1527
+                .$createDialog({
1528
+                  type: "alert",
1529
+                  title: "系统错误,请稍后再试!",
1530
+                  content: "点击返回首页",
1531
+                  icon: "cubeic-wrong",
1532
+                  onConfirm: (e, promptValue) => {
1533
+                    that.$router.push({ path: "/main" });
1534
+                  }
1535
+                })
1536
+                .show();
1537
+              setTimeout(function() {
1538
+                $("#fade").fadeOut();
1539
+              }, 2000);
1540
+            }
1541
+          });
1542
+      }
1444 1543
       event.preventDefault();
1445 1544
     },
1446 1545
     validateHandler(result) {
@@ -1507,6 +1606,8 @@ export default {
1507 1606
     this.getClosecode();
1508 1607
     // 升级对象
1509 1608
     this.getUpUser();
1609
+    // 指派对象
1610
+    this.getZpUser();
1510 1611
     // 转派对象
1511 1612
     this.getRotateUser();
1512 1613
     // 协同对象

+ 497 - 0
src/views/workList.vue

@@ -0,0 +1,497 @@
1
+<template>
2
+  <div class="bgColor">
3
+    <div slot="content" class="scroll-wrapper" style="height:100%;">
4
+      <div class="demo" style="height:100%;">
5
+        <div class="header">上下班记录查看</div>
6
+        <div class="stateSearch">
7
+          <cube-button
8
+            light
9
+            class="stateSearch_item btn"
10
+            @click="showDatePicker"
11
+            >{{ nowDate | timeFormat("MM-dd") }}<i class="cube-select-icon"></i
12
+          ></cube-button>
13
+          <cube-select
14
+            class="stateSearch_item"
15
+            v-model="searchType1"
16
+            :options="searchsType1"
17
+            @change="stateChange1()"
18
+          ></cube-select>
19
+          <cube-select
20
+            class="stateSearch_item"
21
+            v-model="searchType2"
22
+            :options="searchsType2"
23
+            @change="stateChange2()"
24
+          ></cube-select>
25
+        </div>
26
+        <div class="scroll-list-wrap" v-show="!loadShow && !wushuju">
27
+          <cube-scroll ref="scroll" :data="items" :options="options">
28
+            <div class="conentBox">
29
+              <div class="conent" v-for="item in items" :key="item.id">
30
+                <div class="head">
31
+                  <div class="head_d">
32
+                    <span>{{ item.userName }}</span>
33
+                    <span>{{ item.extra2 }}</span>
34
+                    <span>{{ item.opTime }}</span>
35
+                  </div>
36
+                </div>
37
+                <div class="center">
38
+                  <span>{{ item.opValue == 1 ? "上班" : "下班" }}打卡</span>
39
+                  <span>打卡地址:{{ item.adderss || "无" }}</span>
40
+                </div>
41
+              </div>
42
+            </div>
43
+          </cube-scroll>
44
+        </div>
45
+        <div class="wushuju scroll-list-wrap" v-show="wushuju">
46
+          <img src="./../../static/images/wushuju.svg" alt />
47
+          <p>暂无数据</p>
48
+        </div>
49
+      </div>
50
+    </div>
51
+    <load-ing v-show="loadShow"></load-ing>
52
+  </div>
53
+</template>
54
+<script>
55
+import { formatDate } from "./../components/js/date.js";
56
+import LoadIng from "./../views/loading.vue";
57
+export default {
58
+  data() {
59
+    return {
60
+      items: [],
61
+      itemsSave: [],
62
+      wushuju: false,
63
+      searchsType1: [
64
+        {
65
+          text: "全部",
66
+          value: "0"
67
+        },
68
+        {
69
+          text: "上班",
70
+          value: "1"
71
+        },
72
+        {
73
+          text: "下班",
74
+          value: "2"
75
+        }
76
+      ],
77
+      searchsType2: [
78
+        {
79
+          text: "全部",
80
+          value: "0"
81
+        },
82
+        {
83
+          text: "迟到",
84
+          value: "1"
85
+        },
86
+        {
87
+          text: "早退",
88
+          value: "2"
89
+        }
90
+      ],
91
+      searchType1: "0",
92
+      searchType2: "0",
93
+      stateClass: "",
94
+      loadShow: false,
95
+      datePicker: null,
96
+      nowDate: new Date()
97
+    };
98
+  },
99
+  components: {
100
+    LoadIng
101
+  },
102
+  computed: {
103
+    options() {
104
+      return {};
105
+    }
106
+  },
107
+  methods: {
108
+    showDatePicker() {
109
+      if (!this.datePicker) {
110
+        this.datePicker = this.$createDatePicker({
111
+          title: "日期选择",
112
+          max: new Date(),
113
+          value: this.nowDate,
114
+          onSelect: this.selectHandle
115
+        });
116
+      }
117
+      this.datePicker.show();
118
+    },
119
+    selectHandle(date, selectedVal, selectedText) {
120
+      this.nowDate = date;
121
+      this.getData();
122
+    },
123
+    stateChange() {
124
+      var arr = [];
125
+      if (this.searchType2 === "1") {
126
+        //迟到
127
+        arr = this.itemsSave.filter(v => v.extra2 == "迟到");
128
+      } else if (this.searchType2 === "2") {
129
+        //早退
130
+        arr = this.itemsSave.filter(v => v.extra2 == "早退");
131
+      } else if (this.searchType2 === "0") {
132
+        //全部
133
+        arr = JSON.parse(JSON.stringify(this.itemsSave));
134
+      }
135
+      if (this.searchType1 === "1") {
136
+        //上班
137
+        this.items = arr.filter(v => v.opValue === "1");
138
+        this.wushuju = this.items.length === 0;
139
+      } else if (this.searchType1 === "2") {
140
+        //下班
141
+        this.items = arr.filter(v => v.opValue === "0");
142
+        this.wushuju = this.items.length === 0;
143
+      } else if (this.searchType1 === "0") {
144
+        //全部
145
+        this.items = arr;
146
+        this.wushuju = this.items.length === 0;
147
+      }
148
+    },
149
+    stateChange1() {
150
+      this.stateChange();
151
+    },
152
+    stateChange2() {
153
+      this.stateChange();
154
+    },
155
+    getData() {
156
+      this.loadShow = true;
157
+      let postData = formatDate(this.nowDate, "yyyy-MM-dd");
158
+      this.$http.post("service/auth/onlineInfo/" + postData, {}).then(res => {
159
+        if (res.data.data.length > 0) {
160
+          this.wushuju = false;
161
+          for (var i = 0; i < res.data.data.length; i++) {
162
+            res.data.data[i].opTime = formatDate(
163
+              new Date(res.data.data[i].opTime),
164
+              "hh:mm"
165
+            );
166
+          }
167
+          // this.items = res.data.data;
168
+          this.itemsSave = JSON.parse(JSON.stringify(res.data.data));
169
+          this.stateChange();
170
+        } else if (res.data.data.length === 0) {
171
+          this.items = [];
172
+          this.itemsSave = [];
173
+          this.wushuju = true;
174
+        }
175
+        this.loadShow = false;
176
+      });
177
+    }
178
+  },
179
+  created() {
180
+    this.getData();
181
+  }
182
+};
183
+</script>
184
+<style lang="stylus" rel="stylesheet/stylus" scoped>
185
+.scroll-list-wrap {
186
+  height: calc(100% - 1.76rem);
187
+  border-radius: 5px;
188
+  transform: rotate(0deg); // fix 子元素超出边框圆角部分不隐藏的问题
189
+  overflow: hidden;
190
+  padding-top: 1.76rem;
191
+}
192
+
193
+.foods-wrapper {
194
+  .food-item {
195
+    display: flex;
196
+
197
+    /* padding: 18px */
198
+    /* border-bottom: 1px solid rgba(7, 17, 27, 0.1) */
199
+    /* border-top: 1px solid rgba(7, 17, 27, 0.1)!important */
200
+    &:last-child {
201
+      border-none();
202
+      margin-bottom: 0;
203
+    }
204
+
205
+    .icon {
206
+      flex: 0 0 57px;
207
+      margin-right: 10px;
208
+    }
209
+
210
+    .food-content {
211
+      flex: 1;
212
+
213
+      .name {
214
+        margin: 2px 0 8px 0;
215
+        height: 14px;
216
+        line-height: 14px;
217
+        font-size: 14px;
218
+        color: rgb(7, 17, 27);
219
+      }
220
+
221
+      .description, .extra {
222
+        line-height: 10px;
223
+        font-size: 10px;
224
+        color: rgb(147, 153, 159);
225
+      }
226
+
227
+      .description {
228
+        line-height: 12px;
229
+        margin-bottom: 8px;
230
+      }
231
+
232
+      .extra {
233
+        .count {
234
+          margin-right: 12px;
235
+        }
236
+      }
237
+
238
+      .price {
239
+        font-weight: 700;
240
+        line-height: 24px;
241
+
242
+        .now {
243
+          margin-right: 8px;
244
+          font-size: 14px;
245
+          color: rgb(240, 20, 20);
246
+        }
247
+
248
+        .old {
249
+          text-decoration: line-through;
250
+          font-size: 10px;
251
+          color: rgb(147, 153, 159);
252
+        }
253
+      }
254
+
255
+      .cartcontrol-wrapper {
256
+        position: absolute;
257
+        right: 0;
258
+        bottom: 12px;
259
+
260
+        .scroll-wrapper {
261
+          .cube-pulldown-wrapper {
262
+            .before-trigger {
263
+              font-size: 30px;
264
+              line-height: 30px;
265
+              align-self: flex-end;
266
+
267
+              span {
268
+                display: inline-block;
269
+                transition: all 0.3s;
270
+                color: #666;
271
+
272
+                &.rotate {
273
+                  transform: rotate(180deg);
274
+                }
275
+              }
276
+            }
277
+
278
+            .after-trigger {
279
+              .refresh-text {
280
+                color: grey;
281
+              }
282
+            }
283
+          }
284
+        }
285
+      }
286
+    }
287
+  }
288
+}
289
+</style>
290
+<style lang="less" scoped>
291
+.cont {
292
+  margin-top: 1.86rem;
293
+}
294
+.scroll-list-wrap {
295
+  padding-top: 1.76rem;
296
+}
297
+.header {
298
+  width: 100%;
299
+  height: 0.88rem;
300
+  line-height: 0.88rem;
301
+  text-align: center;
302
+  color: #fff;
303
+  font-size: 0.37rem;
304
+  background: linear-gradient(#2e2f32, #414246);
305
+  position: fixed;
306
+  top: 0;
307
+  z-index: 6;
308
+}
309
+.stateSearch {
310
+  width: 100%;
311
+  position: fixed;
312
+  top: 0.88rem;
313
+  z-index: 6;
314
+  display: flex;
315
+  justify-content: center;
316
+  align-items: center;
317
+  .stateSearch_item {
318
+    flex: 1;
319
+    &.btn {
320
+      position: relative;
321
+      text-align: left;
322
+    }
323
+    .cube-select-icon {
324
+      position: absolute;
325
+      right: 8px;
326
+      top: 50%;
327
+      -webkit-transform: translate(0, -50%);
328
+      transform: translate(0, -50%);
329
+      border-style: solid;
330
+      border-color: #999 transparent transparent transparent;
331
+      border-width: 4px 4px 0 4px;
332
+      -webkit-transition: -webkit-transform 0.3s ease-in-out;
333
+      transition: -webkit-transform 0.3s ease-in-out;
334
+      transition: transform 0.3s ease-in-out;
335
+      transition: transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;
336
+    }
337
+  }
338
+}
339
+.bgColor {
340
+  background-color: white;
341
+}
342
+.food-item {
343
+  border-top: 0.16rem rgb(238, 238, 238) solid;
344
+}
345
+.food-content {
346
+  border-top: 0.01rem rgb(223, 222, 222) solid;
347
+  border-bottom: 0.01rem rgb(223, 222, 222) solid;
348
+}
349
+.cube-btn-light {
350
+  box-shadow: none;
351
+  border-bottom: 0.02rem solid #e5e5e5;
352
+}
353
+.cube-select,
354
+.cube-btn {
355
+  height: 0.88rem;
356
+  line-height: 0.88rem;
357
+  padding: 0 0.24rem;
358
+  font-size: 0.36rem;
359
+  color: #333333;
360
+  background-color: #fff;
361
+}
362
+.title {
363
+  display: flex;
364
+  justify-content: space-between;
365
+  height: 0.7rem;
366
+  line-height: 0.7rem;
367
+  border-top: 0.01rem rgb(223, 222, 222) solid;
368
+  padding: 0 0.24rem;
369
+  border-bottom: 0.01rem rgb(223, 222, 222) solid;
370
+}
371
+.title i {
372
+  font-size: 0.32rem;
373
+  color: #005395;
374
+}
375
+.title div:nth-child(1) {
376
+  font-size: 0.32rem;
377
+}
378
+.title div:nth-child(1) span {
379
+  display: inline-block;
380
+  margin-left: 0.08rem;
381
+}
382
+.title div:nth-child(2) {
383
+  padding: 0.05rem 0.3rem;
384
+  /* border: 0.01rem rgb(0,0,255) solid; */
385
+  border-radius: 16px;
386
+  /* color: rgb(0,0,255); */
387
+  height: 0.25rem;
388
+  line-height: 0.25rem;
389
+  margin-top: 0.15rem;
390
+  font-size: 0.24rem;
391
+}
392
+.weishouli {
393
+  color: #991f00;
394
+  border: 0.01rem #991f00 solid;
395
+  background-color: #f4e8e5;
396
+}
397
+.bushouli {
398
+  color: #666666;
399
+  background-color: #eeeeee;
400
+  border: 0.01rem #666666 solid;
401
+}
402
+.chulizhong {
403
+  color: #003057;
404
+  background-color: #e5eaee;
405
+  border: 0.01rem #003057 solid;
406
+}
407
+.daipingjia {
408
+  color: #825b00;
409
+  background-color: #f2eee5;
410
+  border: 0.01rem #825b00 solid;
411
+}
412
+.yijiejue {
413
+  color: #40a19c;
414
+  background-color: #ebf5f5;
415
+  border: 0.01rem #40a19c solid;
416
+}
417
+.yichehui {
418
+  color: #48a843;
419
+  background-color: #ecf6ec;
420
+  border: 0.01rem #48a843 solid;
421
+}
422
+// .conent {
423
+//   font-size: 0.28rem;
424
+//   line-height: 0.39rem;
425
+//   overflow: hidden;
426
+//   display: -webkit-box;
427
+//   -webkit-line-clamp: 2;
428
+//   -webkit-box-orient: vertical;
429
+//   word-break: break-all;
430
+//   padding: 0 0.64rem;
431
+//   margin: 0.24rem 0;
432
+// }
433
+.timeBox {
434
+  display: flex;
435
+  justify-content: space-between;
436
+  font-size: 0.24rem;
437
+  color: #999999;
438
+  border-top: 0.01rem rgb(223, 222, 222) solid;
439
+  height: 0.7rem;
440
+  line-height: 0.7rem;
441
+  padding: 0 0.24rem 0 0.64rem;
442
+}
443
+.wushuju {
444
+  text-align: center;
445
+  color: #999;
446
+  display: flex;
447
+  justify-content: center;
448
+  align-items: center;
449
+  flex-direction: column;
450
+}
451
+.wushuju img {
452
+  width: 5.12rem;
453
+  height: 2.84rem;
454
+}
455
+.conentBox {
456
+  width: 100%;
457
+  height: 100%;
458
+  .conent {
459
+    font-size: 0.32rem;
460
+    font-weight: 400;
461
+    line-height: 0.45rem;
462
+    border-bottom: 0.16rem solid #e5e5e5;
463
+    .head {
464
+      // border-bottom: 0.01rem solid #e6e6e6;
465
+      .head_d {
466
+        padding: 0.24rem 0.48rem;
467
+        display: flex;
468
+        span {
469
+          flex: 1;
470
+          text-align: right;
471
+          &:first-of-type {
472
+            text-align: left;
473
+          }
474
+        }
475
+      }
476
+    }
477
+    .center {
478
+      color: #333333;
479
+      border-bottom: 0.01rem solid #e6e6e6;
480
+      padding: 0.24rem 0.48rem;
481
+      display: flex;
482
+      justify-content: space-between;
483
+    }
484
+    .bottom {
485
+      display: flex;
486
+      justify-content: space-between;
487
+      align-items: center;
488
+      overflow: hidden;
489
+      height: 0.86rem;
490
+      border-bottom: 0.01rem solid #e6e6e6;
491
+      font-size: 0.24rem;
492
+      color: #999;
493
+      padding: 0 0.24rem 0 0.48rem;
494
+    }
495
+  }
496
+}
497
+</style>

+ 2 - 2
static/jssdk/jssdk.js

@@ -32,7 +32,7 @@ jssdk.prototype.share = function (title, desc, imgUrl, timetitle, success) {
32 32
         success = function () {
33 33
         };
34 34
     }
35
-    var link=arguments[5] ? arguments[5] : _sdk_config.getUrl(true); 
35
+    var link=arguments[5] ? arguments[5] : _sdk_config.getUrl(true);
36 36
     _sdk_config.config(this.wid, this.domain);
37 37
     var that = this;
38 38
     wx.ready(function () {
@@ -63,7 +63,7 @@ jssdk.prototype.qrcode = function (callback) {
63 63
 jssdk.prototype.getLocation = function (callback) {
64 64
     wx.ready(function(){
65 65
         wx.getLocation({
66
-            type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
66
+            type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
67 67
             success: function (res) {
68 68
                 callback(res);
69 69
             }