|
@@ -40,7 +40,7 @@
|
40
|
40
|
<td>{{ getClass(item.user_name,4) }}</td>
|
41
|
41
|
<td>{{ getClass(item.user_name,5) }}</td>
|
42
|
42
|
<td>{{ getClass(item.user_name,6) }}</td>
|
43
|
|
- <td>{{ getClass(item.user_name,7) }}</td>
|
|
43
|
+ <td>{{ getClass(item.user_name,0) }}</td>
|
44
|
44
|
</tr>
|
45
|
45
|
</tbody>
|
46
|
46
|
</table>
|
|
@@ -69,7 +69,15 @@ export default {
|
69
|
69
|
end_time:"",
|
70
|
70
|
|
71
|
71
|
doctorlist:[],
|
72
|
|
- tableData:[]
|
|
72
|
+ tableData:[],
|
|
73
|
+ arrZero:[],
|
|
74
|
+ arrOne:[],
|
|
75
|
+ arrTwo:[],
|
|
76
|
+ arrThree:[],
|
|
77
|
+ arrFour:[],
|
|
78
|
+ arrFive:[],
|
|
79
|
+ arrSix:[],
|
|
80
|
+ arrSeven:[],
|
73
|
81
|
}
|
74
|
82
|
},
|
75
|
83
|
methods:{
|
|
@@ -101,6 +109,206 @@ export default {
|
101
|
109
|
if(response.data.state == 1){
|
102
|
110
|
var staffList = response.data.data.staffList
|
103
|
111
|
console.log("stafflist",staffList)
|
|
112
|
+
|
|
113
|
+ var sevenStr = ""
|
|
114
|
+ var oneStr = ""
|
|
115
|
+ var twoStr = ""
|
|
116
|
+ var threeStr = ""
|
|
117
|
+ var fourStr = ""
|
|
118
|
+ var fiveStr = ""
|
|
119
|
+ var sixStr = ""
|
|
120
|
+ for(let i=0;i<staffList.length;i++){
|
|
121
|
+ if(staffList[i].schedule_week == 0){
|
|
122
|
+ staffList[i].class_index = 0
|
|
123
|
+ var arr = []
|
|
124
|
+ this.arrZero.push(staffList[i].class_name)
|
|
125
|
+ for(let i=0;i<this.arrZero.length;i++){
|
|
126
|
+ if(this.arrZero[i]!=''){
|
|
127
|
+ arr.push(this.arrZero[i])
|
|
128
|
+ }
|
|
129
|
+ }
|
|
130
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
131
|
+ if (name in allNames) {
|
|
132
|
+ allNames[name]++;
|
|
133
|
+ }
|
|
134
|
+ else {
|
|
135
|
+ allNames[name] = 1;
|
|
136
|
+ }
|
|
137
|
+ return allNames;
|
|
138
|
+ }, {});
|
|
139
|
+ let objKey = Object.keys(countedNames)
|
|
140
|
+ let objVal = Object.values(countedNames)
|
|
141
|
+ var zeroStr = ''
|
|
142
|
+ objKey.map((item,index) => {
|
|
143
|
+ let objVal = Object.values(countedNames)
|
|
144
|
+ zeroStr += item + objVal[index] + '\n'
|
|
145
|
+ })
|
|
146
|
+ sevenStr = zeroStr
|
|
147
|
+ }
|
|
148
|
+ if(staffList[i].schedule_week == 1){
|
|
149
|
+ staffList[i].class_index = 1
|
|
150
|
+ var arr = []
|
|
151
|
+ this.arrOne.push(staffList[i].class_name)
|
|
152
|
+ for(let i=0;i<this.arrOne.length;i++){
|
|
153
|
+ if(this.arrOne[i]!=''){
|
|
154
|
+ arr.push(this.arrOne[i])
|
|
155
|
+ }
|
|
156
|
+ }
|
|
157
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
158
|
+ if (name in allNames) {
|
|
159
|
+ allNames[name]++;
|
|
160
|
+ }
|
|
161
|
+ else {
|
|
162
|
+ allNames[name] = 1;
|
|
163
|
+ }
|
|
164
|
+ return allNames;
|
|
165
|
+ }, {});
|
|
166
|
+ let objKey = Object.keys(countedNames)
|
|
167
|
+ let objVal = Object.values(countedNames)
|
|
168
|
+ let strOne = ''
|
|
169
|
+ objKey.map((item,index) => {
|
|
170
|
+ let objVal = Object.values(countedNames)
|
|
171
|
+ strOne += item + objVal[index] + '\n'
|
|
172
|
+ })
|
|
173
|
+ oneStr = strOne
|
|
174
|
+ }
|
|
175
|
+ if(staffList[i].schedule_week == 2){
|
|
176
|
+ staffList[i].class_index = 2
|
|
177
|
+ var arr = []
|
|
178
|
+ this.arrTwo.push(staffList[i].class_name)
|
|
179
|
+ for(let i=0;i<this.arrTwo.length;i++){
|
|
180
|
+ if(this.arrTwo[i]!=''){
|
|
181
|
+ arr.push(this.arrTwo[i])
|
|
182
|
+ }
|
|
183
|
+ }
|
|
184
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
185
|
+ if (name in allNames) {
|
|
186
|
+ allNames[name]++;
|
|
187
|
+ }
|
|
188
|
+ else {
|
|
189
|
+ allNames[name] = 1;
|
|
190
|
+ }
|
|
191
|
+ return allNames;
|
|
192
|
+ }, {});
|
|
193
|
+ let objKey = Object.keys(countedNames)
|
|
194
|
+ let objVal = Object.values(countedNames)
|
|
195
|
+ let strTwo = ''
|
|
196
|
+ objKey.map((item,index) => {
|
|
197
|
+ let objVal = Object.values(countedNames)
|
|
198
|
+ strTwo += item + objVal[index] + '\n'
|
|
199
|
+ })
|
|
200
|
+ twoStr = strTwo
|
|
201
|
+ }
|
|
202
|
+ if(staffList[i].schedule_week == 3){
|
|
203
|
+ staffList[i].class_index = 3
|
|
204
|
+ var arr = []
|
|
205
|
+ this.arrThree.push(staffList[i].class_name)
|
|
206
|
+ for(let i=0;i<this.arrThree.length;i++){
|
|
207
|
+ if(this.arrThree[i]!=''){
|
|
208
|
+ arr.push(this.arrThree[i])
|
|
209
|
+ }
|
|
210
|
+ }
|
|
211
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
212
|
+ if (name in allNames) {
|
|
213
|
+ allNames[name]++;
|
|
214
|
+ }
|
|
215
|
+ else {
|
|
216
|
+ allNames[name] = 1;
|
|
217
|
+ }
|
|
218
|
+ return allNames;
|
|
219
|
+ }, {});
|
|
220
|
+ let objKey = Object.keys(countedNames)
|
|
221
|
+ let objVal = Object.values(countedNames)
|
|
222
|
+ let strThree = ''
|
|
223
|
+ objKey.map((item,index) => {
|
|
224
|
+ let objVal = Object.values(countedNames)
|
|
225
|
+ strThree += item + objVal[index] + '\n'
|
|
226
|
+ })
|
|
227
|
+ threeStr = strThree
|
|
228
|
+ }
|
|
229
|
+ if(staffList[i].schedule_week == 4){
|
|
230
|
+ staffList[i].class_index = 4
|
|
231
|
+ var arr = []
|
|
232
|
+ this.arrFour.push(staffList[i].class_name)
|
|
233
|
+ for(let i=0;i<this.arrFour.length;i++){
|
|
234
|
+ if(this.arrFour[i]!=''){
|
|
235
|
+ arr.push(this.arrFour[i])
|
|
236
|
+ }
|
|
237
|
+ }
|
|
238
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
239
|
+ if (name in allNames) {
|
|
240
|
+ allNames[name]++;
|
|
241
|
+ }
|
|
242
|
+ else {
|
|
243
|
+ allNames[name] = 1;
|
|
244
|
+ }
|
|
245
|
+ return allNames;
|
|
246
|
+ }, {});
|
|
247
|
+ let objKey = Object.keys(countedNames)
|
|
248
|
+ let objVal = Object.values(countedNames)
|
|
249
|
+ let strFour = ''
|
|
250
|
+ objKey.map((item,index) => {
|
|
251
|
+ let objVal = Object.values(countedNames)
|
|
252
|
+ strFour += item + objVal[index] + '\n'
|
|
253
|
+ })
|
|
254
|
+ fourStr = strFour
|
|
255
|
+ }
|
|
256
|
+ if(staffList[i].schedule_week == 5){
|
|
257
|
+ staffList[i].class_index = 5
|
|
258
|
+
|
|
259
|
+ var arr = []
|
|
260
|
+ this.arrFive.push(staffList[i].class_name)
|
|
261
|
+ for(let i=0;i<this.arrFive.length;i++){
|
|
262
|
+ if(this.arrFive[i]!=''){
|
|
263
|
+ arr.push(this.arrFive[i])
|
|
264
|
+ }
|
|
265
|
+ }
|
|
266
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
267
|
+ if (name in allNames) {
|
|
268
|
+ allNames[name]++;
|
|
269
|
+ }
|
|
270
|
+ else {
|
|
271
|
+ allNames[name] = 1;
|
|
272
|
+ }
|
|
273
|
+ return allNames;
|
|
274
|
+ }, {});
|
|
275
|
+ let objKey = Object.keys(countedNames)
|
|
276
|
+ let objVal = Object.values(countedNames)
|
|
277
|
+ let strFive = ''
|
|
278
|
+ objKey.map((item,index) => {
|
|
279
|
+ let objVal = Object.values(countedNames)
|
|
280
|
+ strFive += item + objVal[index] + '\n'
|
|
281
|
+ })
|
|
282
|
+ fiveStr = strFive
|
|
283
|
+ }
|
|
284
|
+ if(staffList[i].schedule_week == 6){
|
|
285
|
+ staffList[i].class_index = 6
|
|
286
|
+ var arr = []
|
|
287
|
+ this.arrSix.push(staffList[i].class_name)
|
|
288
|
+ for(let i=0;i<this.arrSix.length;i++){
|
|
289
|
+ if(this.arrSix[i]!=''){
|
|
290
|
+ arr.push(this.arrSix[i])
|
|
291
|
+ }
|
|
292
|
+ }
|
|
293
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
294
|
+ if (name in allNames) {
|
|
295
|
+ allNames[name]++;
|
|
296
|
+ }
|
|
297
|
+ else {
|
|
298
|
+ allNames[name] = 1;
|
|
299
|
+ }
|
|
300
|
+ return allNames;
|
|
301
|
+ }, {});
|
|
302
|
+ let objKey = Object.keys(countedNames)
|
|
303
|
+ let objVal = Object.values(countedNames)
|
|
304
|
+ let strSix = ''
|
|
305
|
+ objKey.map((item,index) => {
|
|
306
|
+ let objVal = Object.values(countedNames)
|
|
307
|
+ strSix += item + objVal[index] + '\n'
|
|
308
|
+ })
|
|
309
|
+ sixStr = strSix
|
|
310
|
+ }
|
|
311
|
+ }
|
104
|
312
|
let tempArr = [], newArr = []
|
105
|
313
|
for (let i = 0; i < staffList.length; i++) {
|
106
|
314
|
if(tempArr.indexOf(staffList[i].user_name) === -1) {
|
|
@@ -130,7 +338,20 @@ export default {
|
130
|
338
|
}
|
131
|
339
|
})
|
132
|
340
|
arr.sort(this.compare('user_type'))
|
133
|
|
- console.log("表哥数据----------",arr)
|
|
341
|
+ let arr2 = []
|
|
342
|
+ arr2.push({class_name:oneStr,schedule_week:1})
|
|
343
|
+ arr2.push({class_name:twoStr,schedule_week:2})
|
|
344
|
+ arr2.push({class_name:threeStr,schedule_week:3})
|
|
345
|
+ arr2.push({class_name:fourStr,schedule_week:4})
|
|
346
|
+ arr2.push({class_name:fiveStr,schedule_week:5})
|
|
347
|
+ arr2.push({class_name:sixStr,schedule_week:6})
|
|
348
|
+ arr2.push({class_name:zeroStr,schedule_week:0})
|
|
349
|
+ var obj = {}
|
|
350
|
+ obj.admin_user_id = "1000000"
|
|
351
|
+ obj.user_name = "合计"
|
|
352
|
+ obj.user_type = 10
|
|
353
|
+ obj.list = arr2
|
|
354
|
+ arr.push(obj)
|
134
|
355
|
this.tableData = arr
|
135
|
356
|
|
136
|
357
|
}
|