Browse Source

7月15日,检验检查表头

yq1 8 months ago
parent
commit
cf41e39a7c
1 changed files with 14 additions and 19 deletions
  1. 14 19
      src/pages/doctorAdvice/components/new_Inspectiondetails.vue

+ 14 - 19
src/pages/doctorAdvice/components/new_Inspectiondetails.vue View File

40
         <el-table-column
40
         <el-table-column
41
           v-for="(item,index) in columns" :key="index"
41
           v-for="(item,index) in columns" :key="index"
42
           :prop="item.prop"
42
           :prop="item.prop"
43
-          :label="item.label" 
43
+          :label="item.label"
44
           width="150">
44
           width="150">
45
          <!-- <template slot-scope="scope" >
45
          <!-- <template slot-scope="scope" >
46
           {{ scope.row.prop }}
46
           {{ scope.row.prop }}
55
               {{ getname(scope.row.prop) }}
55
               {{ getname(scope.row.prop) }}
56
               {{ scope.row.prop }}
56
               {{ scope.row.prop }}
57
             </div>
57
             </div>
58
-            
58
+
59
           </template>
59
           </template>
60
         </el-table-column> -->
60
         </el-table-column> -->
61
 
61
 
176
       // return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
176
       // return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
177
       return uParseTime(time, '{y}-{m}-{d}  {h}:{i}')
177
       return uParseTime(time, '{y}-{m}-{d}  {h}:{i}')
178
     },
178
     },
179
+    // 数据源
179
     getinspectiondetails(patient_id,project_id){
180
     getinspectiondetails(patient_id,project_id){
180
-      console.log("patient_id2333333333333",patient_id)
181
       const params={
181
       const params={
182
         patient_id:patient_id,
182
         patient_id:patient_id,
183
         project_id:project_id,
183
         project_id:project_id,
184
       }
184
       }
185
       getinspectiongroupdetails(params).then(response =>{
185
       getinspectiongroupdetails(params).then(response =>{
186
-       
186
+
187
         const list = response.data.data.inspection
187
         const list = response.data.data.inspection
188
+        const tablehed = response.data.data.referenceList
188
         console.log('response11111',list);
189
         console.log('response11111',list);
189
 
190
 
190
         // this.tableData = list
191
         // this.tableData = list
194
         let table = [{inspect_date:''}]
195
         let table = [{inspect_date:''}]
195
         const datable =[]
196
         const datable =[]
196
         // const arr ={}
197
         // const arr ={}
197
-        if(list[0].Child.length >0){
198
-          const child = list[0].Child
199
-          for(let i=0;i<child.length;i++){
198
+        if(tablehed.length >0){
199
+          for(let i=0;i<tablehed.length;i++){
200
             const obj ={
200
             const obj ={
201
-              label:child[i].item_name,
201
+              label:tablehed[i].item_name,
202
               // prop:child[i].item_name
202
               // prop:child[i].item_name
203
               prop:'value'+(i+1)
203
               prop:'value'+(i+1)
204
             }
204
             }
205
             columns.push(obj)
205
             columns.push(obj)
206
           }
206
           }
207
         }
207
         }
208
-        
208
+
209
         // console.log('list[0].Child121',columns);
209
         // console.log('list[0].Child121',columns);
210
-        
210
+
211
         list.forEach(item =>{
211
         list.forEach(item =>{
212
           const datable1 ={
212
           const datable1 ={
213
             inspect_date:item.inspect_date,
213
             inspect_date:item.inspect_date,
218
             for(let i in datable){
218
             for(let i in datable){
219
               for(let j in columns){
219
               for(let j in columns){
220
                 if(item1.inspect_date == datable[i].inspect_date && columns[j].label == item1.item_name){
220
                 if(item1.inspect_date == datable[i].inspect_date && columns[j].label == item1.item_name){
221
-                  // if(item1.inspect_value !=''){
222
                     datable[i][columns[j].prop] = item1.inspect_value
221
                     datable[i][columns[j].prop] = item1.inspect_value
223
-                  // }else{
224
-                  //   datable[i][columns[j].prop] = 0
225
-                  // }
226
-                  
227
                 }
222
                 }
228
               }
223
               }
229
             }
224
             }
232
         table =datable
227
         table =datable
233
         this.datable = datable
228
         this.datable = datable
234
         // console.log('ppppp',columns);
229
         // console.log('ppppp',columns);
235
-        
230
+
236
         this.tableData = table
231
         this.tableData = table
237
-        this.columns = columns    
238
-        console.log('11111',this.tableData);  
232
+        this.columns = columns
233
+        console.log('11111',this.tableData);
239
       })
234
       })
240
-      
235
+
241
     },
236
     },
242
     getname(row,label){
237
     getname(row,label){
243
       for(let key in row){
238
       for(let key in row){