|
@@ -79,6 +79,9 @@ export default {
|
79
|
79
|
arrSix:[],
|
80
|
80
|
arrSeven:[],
|
81
|
81
|
typevalue:0,
|
|
82
|
+
|
|
83
|
+ doctorTableData:[],
|
|
84
|
+ nurseTableData:[]
|
82
|
85
|
}
|
83
|
86
|
},
|
84
|
87
|
methods:{
|
|
@@ -98,352 +101,400 @@ export default {
|
98
|
101
|
var list = response.data.data.list
|
99
|
102
|
this.doctorlist = list
|
100
|
103
|
this.getScheduleByDoctorId()
|
|
104
|
+
|
|
105
|
+ //
|
|
106
|
+ var doctorlist = response.data.data.doctorlist
|
|
107
|
+ let arr = []
|
|
108
|
+ for(let i=0;i<doctorlist.length;i++){
|
|
109
|
+ if(doctorlist[i].sort == 0){
|
|
110
|
+ doctorlist[i].sort = ""
|
|
111
|
+ }
|
|
112
|
+ }
|
|
113
|
+ console.log('doctorlist',doctorlist)
|
|
114
|
+ this.doctorTableData = doctorlist
|
|
115
|
+ var nurselist = response.data.data.nurselist
|
|
116
|
+ for(let i=0;i<nurselist.length;i++){
|
|
117
|
+ if(nurselist[i].sort == 0){
|
|
118
|
+ nurselist[i].sort = ""
|
|
119
|
+ }
|
|
120
|
+ }
|
|
121
|
+ this.nurseTableData = nurselist
|
101
|
122
|
})
|
102
|
123
|
},
|
103
|
124
|
//获取本周的所有排班列表
|
104
|
125
|
getScheduleByDoctorId(){
|
105
|
|
- const params = {
|
106
|
|
- start_time:this.start_time,
|
107
|
|
- end_time:this.end_time,
|
108
|
|
- doctor_id:this.typevalue,
|
109
|
|
- }
|
110
|
|
- console.log("parasm",params)
|
111
|
|
- getScheduleByDoctorId(params).then(response=>{
|
112
|
|
- if(response.data.state == 1){
|
|
126
|
+ const params = {
|
|
127
|
+ start_time:this.start_time,
|
|
128
|
+ end_time:this.end_time,
|
|
129
|
+ doctor_id:this.typevalue,
|
|
130
|
+ }
|
|
131
|
+ console.log("parasm",params)
|
|
132
|
+ getScheduleByDoctorId(params).then(response=>{
|
|
133
|
+ if(response.data.state == 1){
|
113
|
134
|
var staffList = response.data.data.staffList
|
114
|
|
- console.log("stafflist",staffList)
|
|
135
|
+ console.log("stafflist",staffList)
|
115
|
136
|
|
116
|
|
- var sevenStr = ""
|
117
|
|
- var oneStr = ""
|
118
|
|
- var twoStr = ""
|
119
|
|
- var threeStr = ""
|
120
|
|
- var fourStr = ""
|
121
|
|
- var fiveStr = ""
|
122
|
|
- var sixStr = ""
|
123
|
|
- for(let i=0;i<staffList.length;i++){
|
124
|
|
- if(staffList[i].schedule_week == 0){
|
125
|
|
- staffList[i].class_index = 0
|
126
|
|
- var arr = []
|
127
|
|
- this.arrZero.push(staffList[i].class_name)
|
128
|
|
- for(let i=0;i<this.arrZero.length;i++){
|
129
|
|
- if(this.arrZero[i]!=''){
|
130
|
|
- arr.push(this.arrZero[i])
|
131
|
|
- }
|
132
|
|
- }
|
133
|
|
- var countedNames = arr.reduce(function (allNames, name) {
|
134
|
|
- if (name in allNames) {
|
135
|
|
- allNames[name]++;
|
136
|
|
- }
|
137
|
|
- else {
|
138
|
|
- allNames[name] = 1;
|
139
|
|
- }
|
140
|
|
- return allNames;
|
141
|
|
- }, {});
|
142
|
|
- let objKey = Object.keys(countedNames)
|
143
|
|
- let objVal = Object.values(countedNames)
|
144
|
|
- var zeroStr = ''
|
145
|
|
- objKey.map((item,index) => {
|
146
|
|
- let objVal = Object.values(countedNames)
|
147
|
|
- zeroStr += item + objVal[index] + '\n'
|
148
|
|
- })
|
149
|
|
- sevenStr = zeroStr
|
150
|
|
- }
|
151
|
|
- if(staffList[i].schedule_week == 1){
|
152
|
|
- staffList[i].class_index = 1
|
153
|
|
- var arr = []
|
154
|
|
- this.arrOne.push(staffList[i].class_name)
|
155
|
|
- for(let i=0;i<this.arrOne.length;i++){
|
156
|
|
- if(this.arrOne[i]!=''){
|
157
|
|
- arr.push(this.arrOne[i])
|
158
|
|
- }
|
159
|
|
- }
|
160
|
|
- var countedNames = arr.reduce(function (allNames, name) {
|
161
|
|
- if (name in allNames) {
|
162
|
|
- allNames[name]++;
|
163
|
|
- }
|
164
|
|
- else {
|
165
|
|
- allNames[name] = 1;
|
166
|
|
- }
|
167
|
|
- return allNames;
|
168
|
|
- }, {});
|
169
|
|
- let objKey = Object.keys(countedNames)
|
170
|
|
- let objVal = Object.values(countedNames)
|
171
|
|
- let strOne = ''
|
172
|
|
- objKey.map((item,index) => {
|
173
|
|
- let objVal = Object.values(countedNames)
|
174
|
|
- strOne += item + objVal[index] + '\n'
|
175
|
|
- })
|
176
|
|
- oneStr = strOne
|
177
|
|
- }
|
178
|
|
- if(staffList[i].schedule_week == 2){
|
179
|
|
- staffList[i].class_index = 2
|
180
|
|
- var arr = []
|
181
|
|
- this.arrTwo.push(staffList[i].class_name)
|
182
|
|
- for(let i=0;i<this.arrTwo.length;i++){
|
183
|
|
- if(this.arrTwo[i]!=''){
|
184
|
|
- arr.push(this.arrTwo[i])
|
185
|
|
- }
|
186
|
|
- }
|
187
|
|
- var countedNames = arr.reduce(function (allNames, name) {
|
188
|
|
- if (name in allNames) {
|
189
|
|
- allNames[name]++;
|
190
|
|
- }
|
191
|
|
- else {
|
192
|
|
- allNames[name] = 1;
|
193
|
|
- }
|
194
|
|
- return allNames;
|
195
|
|
- }, {});
|
196
|
|
- let objKey = Object.keys(countedNames)
|
197
|
|
- let objVal = Object.values(countedNames)
|
198
|
|
- let strTwo = ''
|
199
|
|
- objKey.map((item,index) => {
|
200
|
|
- let objVal = Object.values(countedNames)
|
201
|
|
- strTwo += item + objVal[index] + '\n'
|
202
|
|
- })
|
203
|
|
- twoStr = strTwo
|
204
|
|
- }
|
205
|
|
- if(staffList[i].schedule_week == 3){
|
206
|
|
- staffList[i].class_index = 3
|
207
|
|
- var arr = []
|
208
|
|
- this.arrThree.push(staffList[i].class_name)
|
209
|
|
- for(let i=0;i<this.arrThree.length;i++){
|
210
|
|
- if(this.arrThree[i]!=''){
|
211
|
|
- arr.push(this.arrThree[i])
|
212
|
|
- }
|
213
|
|
- }
|
214
|
|
- var countedNames = arr.reduce(function (allNames, name) {
|
215
|
|
- if (name in allNames) {
|
216
|
|
- allNames[name]++;
|
217
|
|
- }
|
218
|
|
- else {
|
219
|
|
- allNames[name] = 1;
|
220
|
|
- }
|
221
|
|
- return allNames;
|
222
|
|
- }, {});
|
223
|
|
- let objKey = Object.keys(countedNames)
|
224
|
|
- let objVal = Object.values(countedNames)
|
225
|
|
- let strThree = ''
|
226
|
|
- objKey.map((item,index) => {
|
227
|
|
- let objVal = Object.values(countedNames)
|
228
|
|
- strThree += item + objVal[index] + '\n'
|
229
|
|
- })
|
230
|
|
- threeStr = strThree
|
231
|
|
- }
|
232
|
|
- if(staffList[i].schedule_week == 4){
|
233
|
|
- staffList[i].class_index = 4
|
234
|
|
- var arr = []
|
235
|
|
- this.arrFour.push(staffList[i].class_name)
|
236
|
|
- for(let i=0;i<this.arrFour.length;i++){
|
237
|
|
- if(this.arrFour[i]!=''){
|
238
|
|
- arr.push(this.arrFour[i])
|
239
|
|
- }
|
240
|
|
- }
|
241
|
|
- var countedNames = arr.reduce(function (allNames, name) {
|
242
|
|
- if (name in allNames) {
|
243
|
|
- allNames[name]++;
|
244
|
|
- }
|
245
|
|
- else {
|
246
|
|
- allNames[name] = 1;
|
247
|
|
- }
|
248
|
|
- return allNames;
|
249
|
|
- }, {});
|
250
|
|
- let objKey = Object.keys(countedNames)
|
251
|
|
- let objVal = Object.values(countedNames)
|
252
|
|
- let strFour = ''
|
253
|
|
- objKey.map((item,index) => {
|
254
|
|
- let objVal = Object.values(countedNames)
|
255
|
|
- strFour += item + objVal[index] + '\n'
|
256
|
|
- })
|
257
|
|
- fourStr = strFour
|
258
|
|
- }
|
259
|
|
- if(staffList[i].schedule_week == 5){
|
260
|
|
- staffList[i].class_index = 5
|
|
137
|
+ var sevenStr = ""
|
|
138
|
+ var oneStr = ""
|
|
139
|
+ var twoStr = ""
|
|
140
|
+ var threeStr = ""
|
|
141
|
+ var fourStr = ""
|
|
142
|
+ var fiveStr = ""
|
|
143
|
+ var sixStr = ""
|
|
144
|
+ for(let i=0;i<staffList.length;i++){
|
|
145
|
+ if(staffList[i].schedule_week == 0){
|
|
146
|
+ staffList[i].class_index = 0
|
|
147
|
+ var arr = []
|
|
148
|
+ this.arrZero.push(staffList[i].class_name)
|
|
149
|
+ for(let i=0;i<this.arrZero.length;i++){
|
|
150
|
+ if(this.arrZero[i]!=''){
|
|
151
|
+ arr.push(this.arrZero[i])
|
|
152
|
+ }
|
|
153
|
+ }
|
|
154
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
155
|
+ if (name in allNames) {
|
|
156
|
+ allNames[name]++;
|
|
157
|
+ }
|
|
158
|
+ else {
|
|
159
|
+ allNames[name] = 1;
|
|
160
|
+ }
|
|
161
|
+ return allNames;
|
|
162
|
+ }, {});
|
|
163
|
+ let objKey = Object.keys(countedNames)
|
|
164
|
+ let objVal = Object.values(countedNames)
|
|
165
|
+ var zeroStr = ''
|
|
166
|
+ objKey.map((item,index) => {
|
|
167
|
+ let objVal = Object.values(countedNames)
|
|
168
|
+ zeroStr += item + objVal[index] + '\n'
|
|
169
|
+ })
|
|
170
|
+ sevenStr = zeroStr
|
|
171
|
+ }
|
|
172
|
+ if(staffList[i].schedule_week == 1){
|
|
173
|
+ staffList[i].class_index = 1
|
|
174
|
+ var arr = []
|
|
175
|
+ this.arrOne.push(staffList[i].class_name)
|
|
176
|
+ for(let i=0;i<this.arrOne.length;i++){
|
|
177
|
+ if(this.arrOne[i]!=''){
|
|
178
|
+ arr.push(this.arrOne[i])
|
|
179
|
+ }
|
|
180
|
+ }
|
|
181
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
182
|
+ if (name in allNames) {
|
|
183
|
+ allNames[name]++;
|
|
184
|
+ }
|
|
185
|
+ else {
|
|
186
|
+ allNames[name] = 1;
|
|
187
|
+ }
|
|
188
|
+ return allNames;
|
|
189
|
+ }, {});
|
|
190
|
+ let objKey = Object.keys(countedNames)
|
|
191
|
+ let objVal = Object.values(countedNames)
|
|
192
|
+ let strOne = ''
|
|
193
|
+ objKey.map((item,index) => {
|
|
194
|
+ let objVal = Object.values(countedNames)
|
|
195
|
+ strOne += item + objVal[index] + '\n'
|
|
196
|
+ })
|
|
197
|
+ oneStr = strOne
|
|
198
|
+ }
|
|
199
|
+ if(staffList[i].schedule_week == 2){
|
|
200
|
+ staffList[i].class_index = 2
|
|
201
|
+ var arr = []
|
|
202
|
+ this.arrTwo.push(staffList[i].class_name)
|
|
203
|
+ for(let i=0;i<this.arrTwo.length;i++){
|
|
204
|
+ if(this.arrTwo[i]!=''){
|
|
205
|
+ arr.push(this.arrTwo[i])
|
|
206
|
+ }
|
|
207
|
+ }
|
|
208
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
209
|
+ if (name in allNames) {
|
|
210
|
+ allNames[name]++;
|
|
211
|
+ }
|
|
212
|
+ else {
|
|
213
|
+ allNames[name] = 1;
|
|
214
|
+ }
|
|
215
|
+ return allNames;
|
|
216
|
+ }, {});
|
|
217
|
+ let objKey = Object.keys(countedNames)
|
|
218
|
+ let objVal = Object.values(countedNames)
|
|
219
|
+ let strTwo = ''
|
|
220
|
+ objKey.map((item,index) => {
|
|
221
|
+ let objVal = Object.values(countedNames)
|
|
222
|
+ strTwo += item + objVal[index] + '\n'
|
|
223
|
+ })
|
|
224
|
+ twoStr = strTwo
|
|
225
|
+ }
|
|
226
|
+ if(staffList[i].schedule_week == 3){
|
|
227
|
+ staffList[i].class_index = 3
|
|
228
|
+ var arr = []
|
|
229
|
+ this.arrThree.push(staffList[i].class_name)
|
|
230
|
+ for(let i=0;i<this.arrThree.length;i++){
|
|
231
|
+ if(this.arrThree[i]!=''){
|
|
232
|
+ arr.push(this.arrThree[i])
|
|
233
|
+ }
|
|
234
|
+ }
|
|
235
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
236
|
+ if (name in allNames) {
|
|
237
|
+ allNames[name]++;
|
|
238
|
+ }
|
|
239
|
+ else {
|
|
240
|
+ allNames[name] = 1;
|
|
241
|
+ }
|
|
242
|
+ return allNames;
|
|
243
|
+ }, {});
|
|
244
|
+ let objKey = Object.keys(countedNames)
|
|
245
|
+ let objVal = Object.values(countedNames)
|
|
246
|
+ let strThree = ''
|
|
247
|
+ objKey.map((item,index) => {
|
|
248
|
+ let objVal = Object.values(countedNames)
|
|
249
|
+ strThree += item + objVal[index] + '\n'
|
|
250
|
+ })
|
|
251
|
+ threeStr = strThree
|
|
252
|
+ }
|
|
253
|
+ if(staffList[i].schedule_week == 4){
|
|
254
|
+ staffList[i].class_index = 4
|
|
255
|
+ var arr = []
|
|
256
|
+ this.arrFour.push(staffList[i].class_name)
|
|
257
|
+ for(let i=0;i<this.arrFour.length;i++){
|
|
258
|
+ if(this.arrFour[i]!=''){
|
|
259
|
+ arr.push(this.arrFour[i])
|
|
260
|
+ }
|
|
261
|
+ }
|
|
262
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
263
|
+ if (name in allNames) {
|
|
264
|
+ allNames[name]++;
|
|
265
|
+ }
|
|
266
|
+ else {
|
|
267
|
+ allNames[name] = 1;
|
|
268
|
+ }
|
|
269
|
+ return allNames;
|
|
270
|
+ }, {});
|
|
271
|
+ let objKey = Object.keys(countedNames)
|
|
272
|
+ let objVal = Object.values(countedNames)
|
|
273
|
+ let strFour = ''
|
|
274
|
+ objKey.map((item,index) => {
|
|
275
|
+ let objVal = Object.values(countedNames)
|
|
276
|
+ strFour += item + objVal[index] + '\n'
|
|
277
|
+ })
|
|
278
|
+ fourStr = strFour
|
|
279
|
+ }
|
|
280
|
+ if(staffList[i].schedule_week == 5){
|
|
281
|
+ staffList[i].class_index = 5
|
261
|
282
|
|
262
|
|
- var arr = []
|
263
|
|
- this.arrFive.push(staffList[i].class_name)
|
264
|
|
- for(let i=0;i<this.arrFive.length;i++){
|
265
|
|
- if(this.arrFive[i]!=''){
|
266
|
|
- arr.push(this.arrFive[i])
|
267
|
|
- }
|
268
|
|
- }
|
269
|
|
- var countedNames = arr.reduce(function (allNames, name) {
|
270
|
|
- if (name in allNames) {
|
271
|
|
- allNames[name]++;
|
272
|
|
- }
|
273
|
|
- else {
|
274
|
|
- allNames[name] = 1;
|
275
|
|
- }
|
276
|
|
- return allNames;
|
277
|
|
- }, {});
|
278
|
|
- let objKey = Object.keys(countedNames)
|
279
|
|
- let objVal = Object.values(countedNames)
|
280
|
|
- let strFive = ''
|
281
|
|
- objKey.map((item,index) => {
|
282
|
|
- let objVal = Object.values(countedNames)
|
283
|
|
- strFive += item + objVal[index] + '\n'
|
284
|
|
- })
|
285
|
|
- fiveStr = strFive
|
286
|
|
- }
|
287
|
|
- if(staffList[i].schedule_week == 6){
|
288
|
|
- staffList[i].class_index = 6
|
289
|
|
- var arr = []
|
290
|
|
- this.arrSix.push(staffList[i].class_name)
|
291
|
|
- for(let i=0;i<this.arrSix.length;i++){
|
292
|
|
- if(this.arrSix[i]!=''){
|
293
|
|
- arr.push(this.arrSix[i])
|
294
|
|
- }
|
295
|
|
- }
|
296
|
|
- var countedNames = arr.reduce(function (allNames, name) {
|
297
|
|
- if (name in allNames) {
|
298
|
|
- allNames[name]++;
|
299
|
|
- }
|
300
|
|
- else {
|
301
|
|
- allNames[name] = 1;
|
302
|
|
- }
|
303
|
|
- return allNames;
|
304
|
|
- }, {});
|
305
|
|
- let objKey = Object.keys(countedNames)
|
306
|
|
- let objVal = Object.values(countedNames)
|
307
|
|
- let strSix = ''
|
308
|
|
- objKey.map((item,index) => {
|
309
|
|
- let objVal = Object.values(countedNames)
|
310
|
|
- strSix += item + objVal[index] + '\n'
|
311
|
|
- })
|
312
|
|
- sixStr = strSix
|
313
|
|
- }
|
314
|
|
- }
|
|
283
|
+ var arr = []
|
|
284
|
+ this.arrFive.push(staffList[i].class_name)
|
|
285
|
+ for(let i=0;i<this.arrFive.length;i++){
|
|
286
|
+ if(this.arrFive[i]!=''){
|
|
287
|
+ arr.push(this.arrFive[i])
|
|
288
|
+ }
|
|
289
|
+ }
|
|
290
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
291
|
+ if (name in allNames) {
|
|
292
|
+ allNames[name]++;
|
|
293
|
+ }
|
|
294
|
+ else {
|
|
295
|
+ allNames[name] = 1;
|
|
296
|
+ }
|
|
297
|
+ return allNames;
|
|
298
|
+ }, {});
|
|
299
|
+ let objKey = Object.keys(countedNames)
|
|
300
|
+ let objVal = Object.values(countedNames)
|
|
301
|
+ let strFive = ''
|
|
302
|
+ objKey.map((item,index) => {
|
|
303
|
+ let objVal = Object.values(countedNames)
|
|
304
|
+ strFive += item + objVal[index] + '\n'
|
|
305
|
+ })
|
|
306
|
+ fiveStr = strFive
|
|
307
|
+ }
|
|
308
|
+ if(staffList[i].schedule_week == 6){
|
|
309
|
+ staffList[i].class_index = 6
|
|
310
|
+ var arr = []
|
|
311
|
+ this.arrSix.push(staffList[i].class_name)
|
|
312
|
+ for(let i=0;i<this.arrSix.length;i++){
|
|
313
|
+ if(this.arrSix[i]!=''){
|
|
314
|
+ arr.push(this.arrSix[i])
|
|
315
|
+ }
|
|
316
|
+ }
|
|
317
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
318
|
+ if (name in allNames) {
|
|
319
|
+ allNames[name]++;
|
|
320
|
+ }
|
|
321
|
+ else {
|
|
322
|
+ allNames[name] = 1;
|
|
323
|
+ }
|
|
324
|
+ return allNames;
|
|
325
|
+ }, {});
|
|
326
|
+ let objKey = Object.keys(countedNames)
|
|
327
|
+ let objVal = Object.values(countedNames)
|
|
328
|
+ let strSix = ''
|
|
329
|
+ objKey.map((item,index) => {
|
|
330
|
+ let objVal = Object.values(countedNames)
|
|
331
|
+ strSix += item + objVal[index] + '\n'
|
|
332
|
+ })
|
|
333
|
+ sixStr = strSix
|
|
334
|
+ }
|
|
335
|
+ }
|
315
|
336
|
let tempArr = [], newArr = []
|
316
|
337
|
for (let i = 0; i < staffList.length; i++) {
|
317
|
|
- if(tempArr.indexOf(staffList[i].user_name) === -1) {
|
|
338
|
+ if (tempArr.indexOf(staffList[i].user_name) === -1) {
|
318
|
339
|
newArr.push({
|
319
|
|
- user_type:staffList[i].doctor_type,
|
320
|
340
|
user_name: staffList[i].user_name,
|
321
|
341
|
admin_user_id:staffList[i].admin_user_id,
|
322
|
|
- list: [{class_name:staffList[i].class_name,schedule_week:staffList[i].schedule_week}]
|
|
342
|
+ user_type:staffList[i].doctor_type,
|
|
343
|
+ is_sort:staffList[i].is_sort,
|
|
344
|
+ sort:staffList[i].sort,
|
|
345
|
+ list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
|
323
|
346
|
})
|
324
|
347
|
tempArr.push(staffList[i].user_name);
|
325
|
348
|
} else {
|
326
|
349
|
for (let j = 0; j < newArr.length; j++) {
|
327
|
350
|
if (newArr[j].user_name == staffList[i].user_name) {
|
328
|
|
- newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type})
|
|
351
|
+ newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes})
|
329
|
352
|
}
|
330
|
353
|
}
|
331
|
354
|
}
|
332
|
355
|
}
|
333
|
|
- // let arr = [...newArr]
|
334
|
|
- // arr.sort(this.compare('admin_user_id'))
|
335
|
|
- // this.doctorlist.sort(this.compare('admin_user_id'))
|
336
|
|
- // this.doctorlist.forEach((item, index) => {
|
337
|
|
- // if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
|
338
|
|
-
|
339
|
|
- // }else{
|
340
|
|
- // arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
|
341
|
|
- // }
|
342
|
|
- // })
|
343
|
|
- // arr.sort(this.compare('user_type'))
|
344
|
|
- // console.log("arr======",arr)
|
345
|
356
|
|
346
|
|
- if(this.typevalue == 0){
|
347
|
|
- let arr = [...newArr]
|
348
|
|
- arr.sort(this.compare('admin_user_id'))
|
349
|
|
- this.doctorlist.sort(this.compare('admin_user_id'))
|
350
|
|
- this.doctorlist.forEach((item, index) => {
|
351
|
|
- if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
|
352
|
|
-
|
353
|
|
- }else{
|
354
|
|
- arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
|
355
|
|
- // console.log("arr",arr)
|
356
|
|
- }
|
357
|
|
- })
|
358
|
|
- arr.sort(this.compare('user_type'))
|
359
|
|
- let arr2 = []
|
360
|
|
- arr2.push({class_name:oneStr,schedule_week:1})
|
361
|
|
- arr2.push({class_name:twoStr,schedule_week:2})
|
362
|
|
- arr2.push({class_name:threeStr,schedule_week:3})
|
363
|
|
- arr2.push({class_name:fourStr,schedule_week:4})
|
364
|
|
- arr2.push({class_name:fiveStr,schedule_week:5})
|
365
|
|
- arr2.push({class_name:sixStr,schedule_week:6})
|
366
|
|
- arr2.push({class_name:zeroStr,schedule_week:0})
|
367
|
|
- var obj = {}
|
368
|
|
- obj.admin_user_id = "1000000"
|
369
|
|
- obj.user_name = "合计"
|
370
|
|
- obj.user_type = 10
|
371
|
|
- obj.list = arr2
|
372
|
|
- arr.push(obj)
|
373
|
|
- this.tableData = arr
|
|
357
|
+ let arr = [...newArr]
|
|
358
|
+ let newNurse = []
|
|
359
|
+ let newDoctor = []
|
|
360
|
+ arr.map(item => {
|
|
361
|
+ if(item.user_type == 2){
|
|
362
|
+ newDoctor.push(item)
|
|
363
|
+ }
|
|
364
|
+ if(item.user_type == 3){
|
|
365
|
+ newNurse.push(item)
|
|
366
|
+ }
|
|
367
|
+ })
|
|
368
|
+
|
|
369
|
+ if(this.typevalue == 0){
|
|
370
|
+ //护士
|
|
371
|
+ newNurse.sort(this.compare('admin_user_id'))
|
|
372
|
+ let newNurseTableData = []
|
|
373
|
+ this.nurseTableData.map(item => {
|
|
374
|
+ if(item.is_sort == 1){
|
|
375
|
+ newNurseTableData.push(item)
|
|
376
|
+ }
|
|
377
|
+ })
|
|
378
|
+ newNurseTableData.sort(this.compare('admin_user_id'))
|
|
379
|
+ newNurseTableData.map((item,index) => {
|
|
380
|
+ if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
|
|
381
|
+
|
|
382
|
+ }else{
|
|
383
|
+ newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
|
|
384
|
+ }
|
|
385
|
+ })
|
|
386
|
+ newNurse.sort(this.compare('sort'))
|
|
387
|
+
|
|
388
|
+ //医生
|
|
389
|
+ newDoctor.sort(this.compare('admin_user_id'))
|
|
390
|
+ let newDoctorTableData = []
|
|
391
|
+ this.doctorTableData.map(item => {
|
|
392
|
+ if(item.is_sort == 1){
|
|
393
|
+ newDoctorTableData.push(item)
|
374
|
394
|
}
|
375
|
|
- if(this.typevalue == 2){
|
376
|
|
- let arr = [...newArr]
|
377
|
|
- arr.sort(this.compare('admin_user_id'))
|
378
|
|
- this.doctorlist.sort(this.compare('admin_user_id'))
|
379
|
|
- let newDoctor = []
|
380
|
|
- this.doctorlist.map(item => {
|
381
|
|
- if (item.user_type == 2) {
|
382
|
|
- newDoctor.push(item)
|
383
|
|
- }
|
384
|
|
- })
|
385
|
|
- newDoctor.map((item, index) => {
|
386
|
|
- if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
|
387
|
|
-
|
388
|
|
- }else{
|
389
|
|
- arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
|
390
|
|
- // console.log("arr",arr)
|
391
|
|
- }
|
392
|
|
- })
|
393
|
|
- let arr2 = []
|
394
|
|
- arr2.push({class_name:oneStr,schedule_week:1})
|
395
|
|
- arr2.push({class_name:twoStr,schedule_week:2})
|
396
|
|
- arr2.push({class_name:threeStr,schedule_week:3})
|
397
|
|
- arr2.push({class_name:fourStr,schedule_week:4})
|
398
|
|
- arr2.push({class_name:fiveStr,schedule_week:5})
|
399
|
|
- arr2.push({class_name:sixStr,schedule_week:6})
|
400
|
|
- arr2.push({class_name:zeroStr,schedule_week:0})
|
401
|
|
- var obj = {}
|
402
|
|
- obj.admin_user_id = "1000000"
|
403
|
|
- obj.user_name = "合计"
|
404
|
|
- obj.user_type = 10
|
405
|
|
- obj.list = arr2
|
406
|
|
- arr.push(obj)
|
407
|
|
- this.tableData = arr
|
|
395
|
+ })
|
|
396
|
+ newDoctorTableData.sort(this.compare('admin_user_id'))
|
|
397
|
+ newDoctorTableData.map((item,index) => {
|
|
398
|
+ if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
|
|
399
|
+
|
|
400
|
+ }else{
|
|
401
|
+ newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
|
|
402
|
+ }
|
|
403
|
+ })
|
|
404
|
+ newDoctor.sort(this.compare('sort'))
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+ let arr2 = []
|
|
409
|
+ arr2.push({class_name:oneStr,schedule_week:1})
|
|
410
|
+ arr2.push({class_name:twoStr,schedule_week:2})
|
|
411
|
+ arr2.push({class_name:threeStr,schedule_week:3})
|
|
412
|
+ arr2.push({class_name:fourStr,schedule_week:4})
|
|
413
|
+ arr2.push({class_name:fiveStr,schedule_week:5})
|
|
414
|
+ arr2.push({class_name:sixStr,schedule_week:6})
|
|
415
|
+ arr2.push({class_name:zeroStr,schedule_week:0})
|
|
416
|
+ var obj = {}
|
|
417
|
+ obj.admin_user_id = "1000000"
|
|
418
|
+ obj.user_name = "合计"
|
|
419
|
+ obj.user_type = 10
|
|
420
|
+ obj.list = arr2
|
|
421
|
+ arr.push(obj)
|
|
422
|
+
|
|
423
|
+ let data = []
|
|
424
|
+ data.push(...newNurse)
|
|
425
|
+ data.push(...newDoctor)
|
|
426
|
+ data.push(obj)
|
|
427
|
+ this.tableData = data
|
|
428
|
+ }
|
|
429
|
+ if(this.typevalue == 2){
|
|
430
|
+ newDoctor.sort(this.compare('admin_user_id'))
|
|
431
|
+ let newDoctorTableData = []
|
|
432
|
+ this.doctorTableData.map(item => {
|
|
433
|
+ if(item.is_sort == 1){
|
|
434
|
+ newDoctorTableData.push(item)
|
408
|
435
|
}
|
409
|
|
- if(this.typevalue == 3){
|
410
|
|
- let arr = [...newArr]
|
411
|
|
- arr.sort(this.compare('admin_user_id'))
|
412
|
|
- this.doctorlist.sort(this.compare('admin_user_id'))
|
413
|
|
- let newDoctor = []
|
414
|
|
- this.doctorlist.map(item => {
|
415
|
|
- if (item.user_type == 3) {
|
416
|
|
- newDoctor.push(item)
|
417
|
|
- }
|
418
|
|
- })
|
419
|
|
- newDoctor.map((item, index) => {
|
420
|
|
- if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
|
421
|
|
-
|
422
|
|
- }else{
|
423
|
|
- arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
|
424
|
|
- // console.log("arr",arr)
|
425
|
|
- }
|
426
|
|
- })
|
427
|
|
- let arr2 = []
|
428
|
|
- arr2.push({class_name:oneStr,schedule_week:1})
|
429
|
|
- arr2.push({class_name:twoStr,schedule_week:2})
|
430
|
|
- arr2.push({class_name:threeStr,schedule_week:3})
|
431
|
|
- arr2.push({class_name:fourStr,schedule_week:4})
|
432
|
|
- arr2.push({class_name:fiveStr,schedule_week:5})
|
433
|
|
- arr2.push({class_name:sixStr,schedule_week:6})
|
434
|
|
- arr2.push({class_name:zeroStr,schedule_week:0})
|
435
|
|
- var obj = {}
|
436
|
|
- obj.admin_user_id = "1000000"
|
437
|
|
- obj.user_name = "合计"
|
438
|
|
- obj.user_type = 10
|
439
|
|
- obj.list = arr2
|
440
|
|
- arr.push(obj)
|
441
|
|
- this.tableData = arr
|
|
436
|
+ })
|
|
437
|
+ newDoctorTableData.sort(this.compare('admin_user_id'))
|
|
438
|
+ newDoctorTableData.map((item,index) => {
|
|
439
|
+ if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
|
|
440
|
+
|
|
441
|
+ }else{
|
|
442
|
+ newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
|
442
|
443
|
}
|
443
|
|
-
|
444
|
|
-
|
|
444
|
+ })
|
|
445
|
+ newDoctor.sort(this.compare('sort'))
|
|
446
|
+
|
|
447
|
+ let arr2 = []
|
|
448
|
+ arr2.push({class_name:oneStr,schedule_week:1})
|
|
449
|
+ arr2.push({class_name:twoStr,schedule_week:2})
|
|
450
|
+ arr2.push({class_name:threeStr,schedule_week:3})
|
|
451
|
+ arr2.push({class_name:fourStr,schedule_week:4})
|
|
452
|
+ arr2.push({class_name:fiveStr,schedule_week:5})
|
|
453
|
+ arr2.push({class_name:sixStr,schedule_week:6})
|
|
454
|
+ arr2.push({class_name:zeroStr,schedule_week:0})
|
|
455
|
+ var obj = {}
|
|
456
|
+ obj.admin_user_id = "1000000"
|
|
457
|
+ obj.user_name = "合计"
|
|
458
|
+ obj.user_type = 10
|
|
459
|
+ obj.list = arr2
|
|
460
|
+ newDoctor.push(obj)
|
|
461
|
+ this.tableData = newDoctor
|
|
462
|
+ }
|
|
463
|
+ if(this.typevalue == 3){
|
|
464
|
+ newNurse.sort(this.compare('admin_user_id'))
|
|
465
|
+ let newNurseTableData = []
|
|
466
|
+ this.nurseTableData.map(item => {
|
|
467
|
+ if(item.is_sort == 1){
|
|
468
|
+ newNurseTableData.push(item)
|
|
469
|
+ }
|
|
470
|
+ })
|
|
471
|
+ newNurseTableData.sort(this.compare('admin_user_id'))
|
|
472
|
+ newNurseTableData.map((item,index) => {
|
|
473
|
+ if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
|
|
474
|
+
|
|
475
|
+ }else{
|
|
476
|
+ newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
|
|
477
|
+ }
|
|
478
|
+ })
|
|
479
|
+ newNurse.sort(this.compare('sort'))
|
|
480
|
+ let arr2 = []
|
|
481
|
+ arr2.push({class_name:oneStr,schedule_week:1})
|
|
482
|
+ arr2.push({class_name:twoStr,schedule_week:2})
|
|
483
|
+ arr2.push({class_name:threeStr,schedule_week:3})
|
|
484
|
+ arr2.push({class_name:fourStr,schedule_week:4})
|
|
485
|
+ arr2.push({class_name:fiveStr,schedule_week:5})
|
|
486
|
+ arr2.push({class_name:sixStr,schedule_week:6})
|
|
487
|
+ arr2.push({class_name:zeroStr,schedule_week:0})
|
|
488
|
+ var obj = {}
|
|
489
|
+ obj.admin_user_id = "1000000"
|
|
490
|
+ obj.user_name = "合计"
|
|
491
|
+ obj.user_type = 10
|
|
492
|
+ obj.list = arr2
|
|
493
|
+ newNurse.push(obj)
|
|
494
|
+ this.tableData = newNurse
|
|
495
|
+ }
|
445
|
496
|
}
|
446
|
|
- })
|
|
497
|
+ })
|
447
|
498
|
},
|
448
|
499
|
getClass(name,index){
|
449
|
500
|
if(name != undefined){
|