Browse Source

Merge branch '20200710_pc_vue_new_branch' into 20200916_pc_vue_new_branch

csx 4 years ago
parent
commit
2482b0ac3b

+ 32 - 3
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue View File

@@ -61,7 +61,7 @@
61 61
             <el-tab-pane name="more" closable><span slot="label"><i class="el-icon-plus" @click="addTab"></i></span>
62 62
             </el-tab-pane>
63 63
             <div class="RP">Rp</div>
64
-            <prescription-table ref="prescription_tables" :prescription="curPrescriptions" :preDrugs="preDrugs" :activeType="activeName"></prescription-table>
64
+            <prescription-table ref="prescription_tables" :prescription="curPrescriptions" :preDrugs="preDrugs" :activeType="customTabIndex"></prescription-table>
65 65
           </el-tabs>
66 66
 
67 67
         </div>
@@ -226,7 +226,7 @@
226 226
         showOne:true,
227 227
         showTwo:false,
228 228
         state1:"",
229
-        value:"",
229
+        customTabIndex:1,
230 230
         options:[],
231 231
         tabProject:[],
232 232
         strids:""
@@ -264,12 +264,26 @@
264 264
 
265 265
       },
266 266
       tabclickEvent(val){
267
-        console.log(val)
268 267
         for (let i= 0; i<this.prescriptions.length; i++){
269 268
           console.log(this.prescriptions[i].name)
270 269
             if(this.prescriptions[i].name == val.name){
271 270
               this.curPrescriptions = this.prescriptions[i]
271
+
272
+              //用来区分处方属于项目还是药品
273
+              if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.projects.length == 0){
274
+                this.customTabIndex = 1
275
+              }
276
+              if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.projects.length > 0){
277
+                this.customTabIndex = 2
278
+              }
279
+
280
+              if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.projects.length == 0){
281
+                this.customTabIndex = this.rightTab
282
+              }
283
+
272 284
             }
285
+
286
+
273 287
         }
274 288
       },
275 289
       setData(data){
@@ -343,6 +357,21 @@
343 357
         this.rightTab = index
344 358
 
345 359
 
360
+        //用来区分处方属于项目还是药品
361
+        if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.projects.length == 0){
362
+          this.customTabIndex = 1
363
+        }
364
+        if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.projects.length > 0){
365
+          this.customTabIndex = 2
366
+        }
367
+        if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.projects.length == 0){
368
+          // this.customTabIndex = this.rightTab
369
+          this.customTabIndex = index
370
+        }
371
+
372
+
373
+
374
+
346 375
       },
347 376
       addCharges() {
348 377
         this.$refs.additionalCharges.show()

+ 2 - 2
src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue View File

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="prescriptionTable">
3 3
     <div>{{prescription.name}}</div>
4
-    <el-table v-if="activeType  == '1'" :data="prescription.advices" border style="width: 98%;" :row-style="{ color: '#303133' }"
4
+    <el-table v-if="activeType  == 1" :data="prescription.advices" border style="width: 98%;" :row-style="{ color: '#303133' }"
5 5
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
6 6
       <el-table-column align="center" type="selection" width="40"></el-table-column>
7 7
       <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
@@ -80,7 +80,7 @@
80 80
         </template>
81 81
       </el-table-column>
82 82
     </el-table>
83
-    <el-table v-if="activeType  == '2'" :data="prescription.project" border style="width: 98%;" :row-style="{ color: '#303133' }"
83
+    <el-table v-if="activeType  == 2" :data="prescription.project" border style="width: 98%;" :row-style="{ color: '#303133' }"
84 84
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
85 85
       <el-table-column align="center" type="selection" width="40"></el-table-column>
86 86
       <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>