Browse Source

Merge branch '20200710_pc_vue_new_branch' into 20200916_pc_vue_new_branch

csx 4 years ago
parent
commit
9cf70afa3f

+ 2 - 0
src/api/advice.js View File

15
 }
15
 }
16
 
16
 
17
 export function CreateDoctorAdvice(id, advice, mode) {
17
 export function CreateDoctorAdvice(id, advice, mode) {
18
+  
18
   return request({
19
   return request({
19
     url: "/api/patients/advice/create?id=" + id + "&mode=" + mode,
20
     url: "/api/patients/advice/create?id=" + id + "&mode=" + mode,
20
     method: "post",
21
     method: "post",
50
     execution_time: time,
51
     execution_time: time,
51
     mode: mode
52
     mode: mode
52
   };
53
   };
54
+  console.log("paras------",params)
53
   return request({
55
   return request({
54
     url: "/api/patients/advice/exec",
56
     url: "/api/patients/advice/exec",
55
     method: "Post",
57
     method: "Post",

+ 1 - 1
src/lang/zh.js View File

90
     patient: '患者中心',
90
     patient: '患者中心',
91
     dialysisSolution: '透析处方',
91
     dialysisSolution: '透析处方',
92
     inspection: '检验检查',
92
     inspection: '检验检查',
93
-    home: '首页',
93
+    home: '透析首页',
94
     weight: '干体重',
94
     weight: '干体重',
95
     dialysisRecord: '透析记录',
95
     dialysisRecord: '透析记录',
96
     scheduling: '排班信息',
96
     scheduling: '排班信息',

+ 32 - 51
src/xt_pages/data/druguseTemplate.vue View File

300
                 <el-button type="primary" @click="submitTableTemplate('form')">保 存</el-button>
300
                 <el-button type="primary" @click="submitTableTemplate('form')">保 存</el-button>
301
               </div>
301
               </div>
302
             </el-dialog>
302
             </el-dialog>
303
+
304
+            <!-- 新增子药 -->
303
             <el-dialog :title="dialogTitle" :visible.sync="templateFormVisible" width="854px">
305
             <el-dialog :title="dialogTitle" :visible.sync="templateFormVisible" width="854px">
304
               <el-form
306
               <el-form
305
                 ref="templateForm"
307
                 ref="templateForm"
514
                 <el-row>
516
                 <el-row>
515
                   <el-col :span="24">
517
                   <el-col :span="24">
516
                     <el-form-item :label="edit_advice_name" required prop="advice_name">
518
                     <el-form-item :label="edit_advice_name" required prop="advice_name">
517
-                      <!-- <el-input v-model="templateFormEdit.advice_name"></el-input> -->
518
-                       <!-- <el-select
519
-                            v-model="templateFormEdit.advice_name"
520
-                            filterable
521
-                            clearable
522
-                            allow-create
523
-                            placeholder="请选择(输入可搜索)"
524
-                            style="width:200px"
525
-                            @change="changeDrugNameTwo"
526
-                          >
527
-                            <el-option
528
-                              v-for="(item,index) in all_drug"
529
-                              :key="index"
530
-                              :label="item.drug_name"
531
-                              :value="item.drug_name"
532
-                            ></el-option>
533
-                          </el-select> -->
534
                         <el-autocomplete
519
                         <el-autocomplete
535
                           style="width:100%;"
520
                           style="width:100%;"
536
                           class="inline-input"
521
                           class="inline-input"
545
                   <el-col :span="15">
530
                   <el-col :span="15">
546
 
531
 
547
                     <el-form-item label="药品规格 :" prop="advice_desc">
532
                     <el-form-item label="药品规格 :" prop="advice_desc">
548
-                      <el-col :span="8">
549
-                        <!-- <el-input v-model="templateFormEdit.advice_desc"></el-input> -->
550
-                           <!-- <el-select
551
-                              v-model="templateFormEdit.advice_desc"
552
-                              filterable
553
-                              clearable
554
-                              allow-create
555
-                              placeholder="请选择(输入可搜索)"
556
-                              style="width:150px"
557
-                              @change="changeDrugDescTwo"
558
-                            >
559
-                              <el-option
560
-                                v-for="item in drugSpec"
561
-                                :key="item.id"
562
-                                :label="item.drug_spec"
563
-                                :value="item.drug_spec"
564
-                              ></el-option>
565
-                           </el-select> -->
566
-
567
-                             <el-autocomplete
568
-                              style="width:100px;"
569
-                              class="inline-input"
570
-                              v-model="templateFormEdit.advice_desc"
571
-                              :fetch-suggestions="querySearch1"
572
-                              placeholder="请输入内容"
573
-                              @select="handleSelect1"
574
-                              @input="changeDrugDescTwo"
575
-                            ></el-autocomplete>
533
+                      <el-col :span="8">                     
534
+                         <el-autocomplete
535
+                         style="width:100px;"
536
+                         class="inline-input"
537
+                         v-model="templateFormEdit.advice_desc"
538
+                         :fetch-suggestions="querySearch1"
539
+                         placeholder="请输入内容"
540
+                         @select="handleSelect1"
541
+                         @input="changeDrugDescTwo"
542
+                       ></el-autocomplete>
576
                       </el-col>
543
                       </el-col>
577
                       <el-col class="line" :span="1">&nbsp;</el-col>
544
                       <el-col class="line" :span="1">&nbsp;</el-col>
578
                       <el-col :span="14">
545
                       <el-col :span="14">
1817
           }
1784
           }
1818
         })
1785
         })
1819
       },
1786
       },
1820
-      submitTemplate(formName) {
1787
+      handleSelect1(){
1821
 
1788
 
1822
-        
1789
+      },
1790
+      handleSelect(){
1791
+
1792
+      },
1793
+      submitTemplate(formName) {
1794
+ 
1823
         if(this.src_type == ""){
1795
         if(this.src_type == ""){
1824
             this.templateForm.way = 0
1796
             this.templateForm.way = 0
1825
             this.templateForm.drug_id = 0
1797
             this.templateForm.drug_id = 0
1829
             var arr = this.templateForm.advice_name.split("(自备药)")
1801
             var arr = this.templateForm.advice_name.split("(自备药)")
1830
             this.templateForm.advice_name = arr[0]
1802
             this.templateForm.advice_name = arr[0]
1831
         }
1803
         }
1832
-        
1804
+        console.log("2222",this.templateForm)
1805
+       
1833
         this.$refs[formName].validate(valid => {
1806
         this.$refs[formName].validate(valid => {
1834
           this.templateForm.single_dose = parseFloat(this.templateForm.single_dose)
1807
           this.templateForm.single_dose = parseFloat(this.templateForm.single_dose)
1835
           this.templateForm.prescribing_number = parseFloat(this.templateForm.prescribing_number)
1808
           this.templateForm.prescribing_number = parseFloat(this.templateForm.prescribing_number)
1840
           if (isNaN(this.templateForm.prescribing_number)) {
1813
           if (isNaN(this.templateForm.prescribing_number)) {
1841
             this.templateForm.prescribing_number = 0
1814
             this.templateForm.prescribing_number = 0
1842
           }
1815
           }
1843
-
1816
+          
1844
           if (valid) {
1817
           if (valid) {
1845
             const templateFormTwo = {}
1818
             const templateFormTwo = {}
1846
             templateFormTwo.template_id = this.current_template_id
1819
             templateFormTwo.template_id = this.current_template_id
2201
          } 
2174
          } 
2202
         this.templateFormEdit.drug_id = drug_id
2175
         this.templateFormEdit.drug_id = drug_id
2203
        
2176
        
2204
-        console.log("2222",this.templateFormEdit)
2177
+        console.log("编辑子药",this.templateFormEdit)
2178
+       
2205
         this.$refs[formName].validate(valid => {
2179
         this.$refs[formName].validate(valid => {
2206
 
2180
 
2207
           this.templateFormEdit.single_dose = parseFloat(this.templateFormEdit.single_dose)
2181
           this.templateFormEdit.single_dose = parseFloat(this.templateFormEdit.single_dose)
2263
             )
2237
             )
2264
           }
2238
           }
2265
         })
2239
         })
2266
-      }, drugDesc(row) {
2240
+      }, 
2241
+      drugDesc(row) {
2267
         if (row.isNoSub == 2) {
2242
         if (row.isNoSub == 2) {
2268
           if (row.drug_spec.length <= 0) {
2243
           if (row.drug_spec.length <= 0) {
2269
             return ''
2244
             return ''
2859
             this.drug_id = this.drugSpec[i].id
2834
             this.drug_id = this.drugSpec[i].id
2860
             this.src_type = this.drugSpec[i].type
2835
             this.src_type = this.drugSpec[i].type
2861
             this.templateForm.drug_id = this.drugSpec[i].id
2836
             this.templateForm.drug_id = this.drugSpec[i].id
2837
+            this.templateForm.single_dose_unit = this.drugSpec[i].min_unit
2838
+            this.templateForm.prescribing_number_unit = this.drugSpec[i].min_unit
2839
+            this.templateForm.drug_spec_unit = this.drugSpec[i].min_unit
2862
             this.templateForm.way = this.drugSpec[i].type
2840
             this.templateForm.way = this.drugSpec[i].type
2863
           }
2841
           }
2864
         }
2842
         }
2884
             this.templateFormEdit.single_dose = this.drugSpec[i].single_dose.toString()
2862
             this.templateFormEdit.single_dose = this.drugSpec[i].single_dose.toString()
2885
             this.templateFormEdit.delivery_way = this.drugSpec[i].delivery_way.toString()
2863
             this.templateFormEdit.delivery_way = this.drugSpec[i].delivery_way.toString()
2886
             this.templateFormEdit.execution_frequency = this.drugSpec[i].execution_frequency.toString()
2864
             this.templateFormEdit.execution_frequency = this.drugSpec[i].execution_frequency.toString()
2865
+            this.templateFormEdit.single_dose_unit = this.drugSpec[i].min_unit
2866
+            this.templateFormEdit.drug_spec_unit = this.drugSpec[i].drug_spec_unit
2867
+            this.templateFormEdit.prescribing_number_unit = this.drugSpec[i].prescribing_number_unit
2887
           }
2868
           }
2888
         }
2869
         }
2889
       },
2870
       },

+ 5 - 0
src/xt_pages/dialysis/details/assessmentBefore.vue View File

303
           <span class="unit"></span>
303
           <span class="unit"></span>
304
         </li>
304
         </li>
305
 
305
 
306
+         <li v-if="isShow('特殊处理情况')">
307
+          <label>特殊处理情况: </label>
308
+          <span class="content">{{ this.record.special_treatment}}</span>
309
+          <span class="unit"></span>
310
+        </li>
306
       </ul>
311
       </ul>
307
     </div>
312
     </div>
308
     <div class="note">
313
     <div class="note">

+ 61 - 87
src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue View File

239
         :cell-class-name="adviceNameShow"
239
         :cell-class-name="adviceNameShow"
240
         :modal-append-to-body="false"
240
         :modal-append-to-body="false"
241
         highlight-current-row
241
         highlight-current-row
242
-        @current-change="handleCurrentChange"
243
       >
242
       >
244
         <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
243
         <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
245
           <template slot-scope="scope">
244
           <template slot-scope="scope">
249
         <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
248
         <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
250
           <template slot-scope="scope">
249
           <template slot-scope="scope">
251
             <span>
250
             <span>
252
-              {{
253
-              scope.row.start_time | parseTime('{y}-{m}-{d} {h}:{i}')
254
-              }}
251
+              {{scope.row.start_time | parseTime('{y}-{m}-{d} {h}:{i}')}}
255
             </span>
252
             </span>
256
           </template>
253
           </template>
257
         </el-table-column>
254
         </el-table-column>
259
           <template slot-scope="scope">
256
           <template slot-scope="scope">
260
             <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
257
             <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
261
               <span class="el-dropdown-link">
258
               <span class="el-dropdown-link">
262
-                {{ getAdviceContent(scope.row, 1)
263
-                }}
259
+                {{ getAdviceContent(scope.row, 1)}}
264
                 <i class="el-icon-arrow-down el-icon--right"></i>
260
                 <i class="el-icon-arrow-down el-icon--right"></i>
265
               </span>
261
               </span>
266
               <el-dropdown-menu slot="dropdown">
262
               <el-dropdown-menu slot="dropdown">
272
 
268
 
273
             <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
269
             <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
274
               <span class="el-dropdown-link">
270
               <span class="el-dropdown-link">
275
-                &emsp;{{ getAdviceContent(scope.row, 2)
276
-                }}
271
+                &emsp;{{ getAdviceContent(scope.row, 2)}}
277
                 <i class="el-icon-arrow-down el-icon--right"></i>
272
                 <i class="el-icon-arrow-down el-icon--right"></i>
278
               </span>
273
               </span>
279
               <el-dropdown-menu slot="dropdown">
274
               <el-dropdown-menu slot="dropdown">
293
         >
288
         >
294
           <template slot-scope="scope">
289
           <template slot-scope="scope">
295
             <span v-if="scope.row.execution_time != 0">
290
             <span v-if="scope.row.execution_time != 0">
296
-              {{
297
-              scope.row.start_time | parseTime('{m}-{d} {h}:{i}')
298
-              }}
291
+              {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
299
             </span>
292
             </span>
300
             <span v-else></span>
293
             <span v-else></span>
301
           </template>
294
           </template>
303
         <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
296
         <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
304
           <template slot-scope="scope">
297
           <template slot-scope="scope">
305
             <span v-if="scope.row.parent_id == 0">
298
             <span v-if="scope.row.parent_id == 0">
306
-              {{
307
-              getXuserName(scope.row.execution_staff)
308
-              }}
299
+              {{getXuserName(scope.row.execution_staff)}}
309
             </span>
300
             </span>
310
             <span v-else></span>
301
             <span v-else></span>
311
           </template>
302
           </template>
319
         >
310
         >
320
           <template slot-scope="scope">
311
           <template slot-scope="scope">
321
             <span v-if="scope.row.parent_id == 0">
312
             <span v-if="scope.row.parent_id == 0">
322
-              {{
323
-              getXuserName(scope.row.checker)
324
-              }}
313
+              {{getXuserName(scope.row.checker)}}
325
             </span>
314
             </span>
326
             <span v-else></span>
315
             <span v-else></span>
327
           </template>
316
           </template>
408
       </div>-->
397
       </div>-->
409
       <!-- 新医嘱列表 -->
398
       <!-- 新医嘱列表 -->
410
 
399
 
400
+
401
+      <!-- 新增医嘱(子药)表单 -->
411
       <!-- 医嘱表单 -->
402
       <!-- 医嘱表单 -->
412
       <el-form ref="form" :model="form" label-width="100px" v-show="showAdviceForm">
403
       <el-form ref="form" :model="form" label-width="100px" v-show="showAdviceForm">
413
         <el-row :gutter="20">
404
         <el-row :gutter="20">
414
-          <!--<el-col :span="8">-->
415
-          <!--<el-form-item label="医嘱类型:">-->
416
-          <!--<el-input value="临时" disabled></el-input>-->
417
-          <!--</el-form-item>-->
418
-          <!--</el-col>-->
419
-          <!--<el-col :span="8">-->
420
-          <!--<el-form-item label="医嘱时间:">-->
421
-          <!--<el-input v-model="form.advice_date" readonly></el-input>-->
422
-          <!--&lt;!&ndash; <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker> &ndash;&gt;-->
423
-          <!--</el-form-item>-->
424
-          <!--</el-col>-->
425
           <el-col :span="8">
405
           <el-col :span="8">
426
             <el-form-item label="开始时间:">
406
             <el-form-item label="开始时间:">
427
               <el-date-picker
407
               <el-date-picker
438
 
418
 
439
           <el-col :span="8">
419
           <el-col :span="8">
440
             <el-form-item label="医嘱名称:">
420
             <el-form-item label="医嘱名称:">
441
-              <!-- <el-input v-model="form.advice_name"></el-input> -->
442
-              <!-- <el-select
443
-                v-model="form.advice_name"
444
-                filterable
445
-                clearable
446
-                allow-create
447
-                placeholder="请选择(输入可搜索)"
448
-                style="width:200px"
449
-                @change="changeDrugName"
450
-              >
451
-                <el-option
452
-                  v-for="(item,index) in all_drug"
453
-                  :key="index"
454
-                  :label="item.drug_name"
455
-                  :value="item.drug_name"
456
-                ></el-option>
457
-              </el-select> -->
458
 
421
 
459
               <el-autocomplete
422
               <el-autocomplete
460
                 style="width:100%;"
423
                 style="width:100%;"
469
           </el-col>
432
           </el-col>
470
 
433
 
471
           <el-col :span="8">
434
           <el-col :span="8">
472
-            <el-form-item label="药品规格:">
473
-              <!-- <el-input v-model="form.advice_desc" style="width: 40%;"></el-input> -->
474
-
475
-               <!-- <el-select
476
-                  v-model="form.advice_desc"
477
-                  filterable
478
-                  clearable
479
-                  allow-create
480
-                  placeholder="请选择(输入可搜索)"
481
-                  style="width:150px"
482
-                  @change="changeDrugDesc"
483
-                >
484
-                  <el-option
485
-                    v-for="item in drugSpec"
486
-                    :key="item.id"
487
-                    :label="item.drug_spec"
488
-                    :value="item.drug_spec"
489
-                  ></el-option>
490
-                 </el-select> -->
435
+            <el-form-item label="药品规格:">        
491
                 <el-autocomplete
436
                 <el-autocomplete
492
                   style="width:100px;"
437
                   style="width:100px;"
493
                   class="inline-input"
438
                   class="inline-input"
494
                   v-model="form.advice_desc"
439
                   v-model="form.advice_desc"
495
                   :fetch-suggestions="querySearch1"
440
                   :fetch-suggestions="querySearch1"
496
                   placeholder="请输入内容"
441
                   placeholder="请输入内容"
497
-                  @select="handleSelect1"
498
                   @input="changeDrugDesc"
442
                   @input="changeDrugDesc"
499
                 ></el-autocomplete>
443
                 ></el-autocomplete>
500
                  
444
                  
501
                 <el-select
445
                 <el-select
502
                   v-model="form.drug_spec_unit"
446
                   v-model="form.drug_spec_unit"
503
-                  style="width: 56%;"
447
+                  style="width: 100px;"
504
                   filterable
448
                   filterable
505
                   placeholder="选择"
449
                   placeholder="选择"
506
                 >
450
                 >
532
                   :value="item.name"
476
                   :value="item.name"
533
                 ></el-option>
477
                 ></el-option>
534
               </el-select>
478
               </el-select>
535
-              <!-- <el-input v-model="form.prescribing_number_unit" style="width: 40%;"></el-input> -->
536
             </el-form-item>
479
             </el-form-item>
537
           </el-col>
480
           </el-col>
538
 
481
 
552
                   :value="item.name"
495
                   :value="item.name"
553
                 ></el-option>
496
                 ></el-option>
554
               </el-select>
497
               </el-select>
555
-
556
-              <!-- <el-input v-model="form.single_dose_unit" style="width: 40%;"></el-input> -->
557
             </el-form-item>
498
             </el-form-item>
558
           </el-col>
499
           </el-col>
559
 
500
 
776
           advice_doctor: '',
717
           advice_doctor: '',
777
           remark: '',
718
           remark: '',
778
           parent_id: 0,
719
           parent_id: 0,
779
-          drug_name_id:"",
720
+          drug_id:0,
721
+          drug_name_id:0,
722
+          way:0,
780
         },
723
         },
781
         nameForm: {
724
         nameForm: {
782
           advice_name: '',
725
           advice_name: '',
942
         }
885
         }
943
       },
886
       },
944
       submitEditAdvice() {
887
       submitEditAdvice() {
945
-        console.log("this.form",this.form)
946
         if (this.form.advice_name.length == 0) {
888
         if (this.form.advice_name.length == 0) {
947
           this.$message.error('请填写医嘱名称')
889
           this.$message.error('请填写医嘱名称')
948
           return
890
           return
1231
       }
1173
       }
1232
       ,
1174
       ,
1233
       submitExce() {
1175
       submitExce() {
1176
+        
1234
         if (this.currentRow == null) {
1177
         if (this.currentRow == null) {
1235
           this.$message.error('请先选择要执行的医嘱!')
1178
           this.$message.error('请先选择要执行的医嘱!')
1236
           return false
1179
           return false
1247
         }
1190
         }
1248
         this.exceLoading = true
1191
         this.exceLoading = true
1249
         let mode = '6'
1192
         let mode = '6'
1193
+        
1194
+         console.log("222222",this.currentRow.id)
1195
+        
1250
         ExecDoctorAdvice(this.patient.id, this.currentRow.id, this.execTime, mode).then(response => {
1196
         ExecDoctorAdvice(this.patient.id, this.currentRow.id, this.execTime, mode).then(response => {
1251
             if (response.data.state == 0) {
1197
             if (response.data.state == 0) {
1252
               this.$message.error(response.data.msg)
1198
               this.$message.error(response.data.msg)
1311
           return false
1257
           return false
1312
         }
1258
         }
1313
         let mode = '1'
1259
         let mode = '1'
1260
+        
1261
+       if(this.src_type == ""){
1262
+          this.form.way = 0
1263
+          this.form.drug_id = 0
1264
+          this.form.drug_name_id = 0
1265
+       }
1266
+
1267
+       if(this.src_type == 2){ //自备药
1268
+          var arr = this.form.advice_name.split("(自备药)")
1269
+          this.form.advice_name = arr[0]
1270
+       }
1271
+
1272
+        console.log("新增医嘱子药",this.form)
1314
        
1273
        
1315
         CreateDoctorAdvice(this.patient.id, this.form, mode)
1274
         CreateDoctorAdvice(this.patient.id, this.form, mode)
1316
           .then(response => {
1275
           .then(response => {
1407
           execution_frequency: this.currentRow.execution_frequency,
1366
           execution_frequency: this.currentRow.execution_frequency,
1408
           advice_doctor: '',
1367
           advice_doctor: '',
1409
           remark: '',
1368
           remark: '',
1410
-          parent_id: this.currentRow.id
1369
+          parent_id: this.currentRow.id,
1370
+          drug_id:0,
1371
+          drug_name_id:0,
1372
+          way:0,
1411
         }
1373
         }
1412
       }
1374
       }
1413
       ,
1375
       ,
1483
           advice_doctor: row.advice_doctor,
1445
           advice_doctor: row.advice_doctor,
1484
           remark: row.remark,
1446
           remark: row.remark,
1485
           parent_id: row.parent_id,
1447
           parent_id: row.parent_id,
1486
-          drug_id:"",
1487
-          way:"",
1488
-          drug_name_id:"",
1448
+          drug_id:0,
1449
+          way:0,
1450
+          drug_name_id:0,
1489
         }
1451
         }
1490
       }
1452
       }
1491
       ,
1453
       ,
1616
       }
1578
       }
1617
       ,
1579
       ,
1618
       execAdvice() {
1580
       execAdvice() {
1581
+        
1619
         if (this.is_has_exce == false) {
1582
         if (this.is_has_exce == false) {
1620
           this.$message.error('你没有执行医嘱的权限')
1583
           this.$message.error('你没有执行医嘱的权限')
1621
           return false
1584
           return false
2071
       }
2034
       }
2072
       ,
2035
       ,
2073
       cellMouseEnter: function(row, column, event) {
2036
       cellMouseEnter: function(row, column, event) {
2037
+        console.log("数据是",row)
2074
         this.currentRow = row
2038
         this.currentRow = row
2075
-        this.groupSelectRow = row
2076
-        this.sameRowArr.forEach((arr, i) => {
2077
-          if (arr.indexOf(row.index) != -1) {
2078
-            this.hoverOrderArr = arr
2079
-          }
2080
-        })
2039
+        // this.groupSelectRow = row
2040
+        // this.sameRowArr.forEach((arr, i) => {
2041
+        //   if (arr.indexOf(row.index) != -1) {
2042
+        //     this.hoverOrderArr = arr
2043
+        //   }
2044
+        // })
2081
       }
2045
       }
2082
       ,
2046
       ,
2083
       cellMouseLeave: function(row, column, cell, event) {
2047
       cellMouseLeave: function(row, column, cell, event) {
2196
       }
2160
       }
2197
       ,
2161
       ,
2198
       handleCurrentChange(row) {
2162
       handleCurrentChange(row) {
2199
-        // this.currentRow = row;
2163
+
2164
+        this.currentRow = row;
2200
         // this.groupSelectRow = row;
2165
         // this.groupSelectRow = row;
2201
         // this.sameRowArr.forEach((arr, i) => {
2166
         // this.sameRowArr.forEach((arr, i) => {
2202
         //   if (arr.indexOf(row.index) != -1) {
2167
         //   if (arr.indexOf(row.index) != -1) {
2203
         //     this.hoverOrderArr = arr;
2168
         //     this.hoverOrderArr = arr;
2204
         //   }
2169
         //   }
2205
         // });
2170
         // });
2206
-      }
2207
-      ,
2171
+      },
2208
       objectSpanMethod({ row, column, rowIndex, columnIndex }) {
2172
       objectSpanMethod({ row, column, rowIndex, columnIndex }) {
2209
-        // console.log('columnIndex', columnIndex)
2173
+     
2210
         if (columnIndex === 0) {
2174
         if (columnIndex === 0) {
2211
           if (rowIndex % 2 === 0) {
2175
           if (rowIndex % 2 === 0) {
2212
             return {
2176
             return {
2355
                 obj.type = 2
2319
                 obj.type = 2
2356
                 obj.custom_id = this.rand(10000000, 99999999)
2320
                 obj.custom_id = this.rand(10000000, 99999999)
2357
                 obj.drug_specs = medicalList[i].drug_specs
2321
                 obj.drug_specs = medicalList[i].drug_specs
2322
+                console.log("222",this.all_drug)
2358
                 this.all_drug.push(obj)
2323
                 this.all_drug.push(obj)
2359
               }
2324
               }
2360
             }
2325
             }
2391
                 obj.custom_id = this.rand(10000000, 99999999)
2356
                 obj.custom_id = this.rand(10000000, 99999999)
2392
                 obj.drug_specs = base_drug_list[i].drug_specs
2357
                 obj.drug_specs = base_drug_list[i].drug_specs
2393
                 this.all_drug.push(obj)
2358
                 this.all_drug.push(obj)
2359
+                console.log("2222",this.all_drug)
2394
               }
2360
               }
2395
             }
2361
             }
2396
         })
2362
         })
2397
      },
2363
      },
2398
     changeDrugName(name){
2364
     changeDrugName(name){
2399
       this.current_drug_name = name
2365
       this.current_drug_name = name
2400
-      this.form.advice_desc = ''
2366
+      this.form.advice_desc = ""
2367
+      this.$forceUpdate()
2401
       this.drugSpec = []
2368
       this.drugSpec = []
2402
       for (let i = 0; i < this.all_drug.length; i++) {
2369
       for (let i = 0; i < this.all_drug.length; i++) {
2403
         if (this.all_drug[i].drug_name == name) {
2370
         if (this.all_drug[i].drug_name == name) {
2406
        }
2373
        }
2407
     },
2374
     },
2408
     changeDrugDesc(name) {
2375
     changeDrugDesc(name) {
2376
+      this.$forceUpdate()
2409
         this.current_drug_spec = name
2377
         this.current_drug_spec = name
2410
         for (let i = 0; i < this.drugSpec.length; i++) {
2378
         for (let i = 0; i < this.drugSpec.length; i++) {
2411
           if (this.drugSpec[i].drug_spec == name) {
2379
           if (this.drugSpec[i].drug_spec == name) {
2418
             this.src_type = this.drugSpec[i].type
2386
             this.src_type = this.drugSpec[i].type
2419
             this.form.drug_id = this.drugSpec[i].id
2387
             this.form.drug_id = this.drugSpec[i].id
2420
             this.form.way = this.drugSpec[i].type
2388
             this.form.way = this.drugSpec[i].type
2389
+
2390
+            this.form.drug_spec_unit = this.drugSpec[i].min_unit
2391
+            this.form.prescribing_number_unit = this.drugSpec[i].min_unit
2392
+            this.form.single_dose_unit = this.drugSpec[i].min_unit
2421
             if(this.drugSpec[i].drug_name_id){
2393
             if(this.drugSpec[i].drug_name_id){
2422
-              console.log("22222",this.drugSpec[i].drug_name_id)
2423
                this.form.drug_name_id = this.drugSpec[i].drug_name_id
2394
                this.form.drug_name_id = this.drugSpec[i].drug_name_id
2424
             }else{
2395
             }else{
2425
               this.form.drug_name_id = 0
2396
               this.form.drug_name_id = 0
2462
         console.log('results',results)
2433
         console.log('results',results)
2463
         cb(results);
2434
         cb(results);
2464
       },
2435
       },
2436
+     handleSelect(){
2437
+
2438
+     }
2465
     },
2439
     },
2466
     created() {
2440
     created() {
2467
       var date = this.$route.query && this.$route.query.date
2441
       var date = this.$route.query && this.$route.query.date

+ 32 - 54
src/xt_pages/dialysis/details/dialog/adviceDialog/AddGroupAdvice.vue View File

370
         <el-row>
370
         <el-row>
371
           <el-col :span="24">
371
           <el-col :span="24">
372
             <el-form-item label="医嘱内容 :" required prop="advice_name">
372
             <el-form-item label="医嘱内容 :" required prop="advice_name">
373
-               <!-- <el-select
374
-                v-model="nameForm.advice_name"
375
-                filterable
376
-                clearable
377
-                allow-create
378
-                :disabled="isChild"
379
-                placeholder="请选择(输入可搜索)"
380
-                style="width:100%"
381
-                @change="changeDrugName"
382
-              >
383
-                <el-option
384
-                  v-for="(item,index) in all_drug"
385
-                  :key="index"
386
-                  :label="item.drug_name"
387
-                  :value="item.drug_name"
388
-                ></el-option>
389
-              </el-select> -->
390
-
391
              <el-autocomplete
373
              <el-autocomplete
392
                 style="width:100%;"
374
                 style="width:100%;"
393
                 class="inline-input"
375
                 class="inline-input"
407
         </el-row>
389
         </el-row>
408
         <el-row>
390
         <el-row>
409
           <el-col :span="12">
391
           <el-col :span="12">
410
-            <!--<el-form-item label="规格 :" prop="advice_desc">-->
411
-            <!--<el-input v-model="nameForm.advice_desc"></el-input>-->
412
-            <!--</el-form-item>-->
392
+       
413
             <el-form-item label="药品规格 :" prop="advice_desc">
393
             <el-form-item label="药品规格 :" prop="advice_desc">
414
               <el-col :span="8">
394
               <el-col :span="8">
415
-                <!-- <el-input v-model="nameForm.advice_desc"></el-input> -->
416
-                 <!-- <el-select
417
-                  v-model="nameForm.advice_desc"
418
-                  filterable
419
-                  clearable
420
-                  allow-create
421
-                  :disabled="isChild"
422
-                  placeholder="请选择(输入可搜索)"
423
-                  @change="changeDrugDesc"
424
-                >
425
-                  <el-option
426
-                    v-for="item in drugSpec"
427
-                    :key="item.id"
428
-                    :label="item.drug_spec"
429
-                    :value="item.drug_spec"
430
-                  ></el-option>
431
-                 </el-select> -->
432
-
433
-
395
+               
434
                 <el-autocomplete
396
                 <el-autocomplete
435
                   style="width:100px;"
397
                   style="width:100px;"
436
                   class="inline-input"
398
                   class="inline-input"
743
           
705
           
744
           console.log("88888888",submitForm)
706
           console.log("88888888",submitForm)
745
           console.log("99999",this.medicals)
707
           console.log("99999",this.medicals)
746
-          
747
-          if(this.private_drug_config.drug_start == 1){
748
-           
708
+          if(this.private_drug_config != null&& this.private_drug_config.drug_start == 1){
709
+               
749
              for(let index=0;index<submitForm.adviceNames.length;index++){
710
              for(let index=0;index<submitForm.adviceNames.length;index++){
750
                 for(let i=0;i<this.medicals.length;i++){
711
                 for(let i=0;i<this.medicals.length;i++){
712
+                   if(submitForm.adviceNames[index].children.length >0){
713
+                      for(let y=0;y<submitForm.adviceNames[index].children.length;y++){
714
+                          if(submitForm.adviceNames[index].children[y].drug_id == this.medicals[i].drug_name_id){
715
+                             submitForm.adviceNames[index].children[y].drug_name_id = this.medicals[i].drug_name_id
716
+                             submitForm.adviceNames[index].children[y].way = 2  
717
+                          }
718
+                      }
719
+                   }
751
                    if(submitForm.adviceNames[index].drug_id == this.medicals[i].drug_name_id){
720
                    if(submitForm.adviceNames[index].drug_id == this.medicals[i].drug_name_id){
752
                       submitForm.adviceNames[index].way = 2
721
                       submitForm.adviceNames[index].way = 2
753
                       submitForm.adviceNames[index].drug_name_id = this.medicals[i].drug_name_id
722
                       submitForm.adviceNames[index].drug_name_id = this.medicals[i].drug_name_id
756
              }
725
              }
757
           }
726
           }
758
           console.log("2222",submitForm)
727
           console.log("2222",submitForm)
759
-         
728
+        
760
           CreateGroupAdvice(this.patientID, 0, submitForm, mode).then(
729
           CreateGroupAdvice(this.patientID, 0, submitForm, mode).then(
761
             response => {
730
             response => {
762
               if (response.data.state == 0) {
731
               if (response.data.state == 0) {
1312
                   parent_row: parentRow,
1281
                   parent_row: parentRow,
1313
                   row_key: thisRowKey
1282
                   row_key: thisRowKey
1314
                 };
1283
                 };
1315
-                conosle.log("item======",child)
1284
+                
1316
                 item.children.push(child);
1285
                 item.children.push(child);
1317
                 this.allSelectedTemplate.unshift(child);
1286
                 this.allSelectedTemplate.unshift(child);
1318
               }
1287
               }
1475
       this.templateFormVisible = true;
1444
       this.templateFormVisible = true;
1476
     },
1445
     },
1477
     selectGroupAdvice(row) {
1446
     selectGroupAdvice(row) {
1478
-      console.log("row-----",row)
1479
       this.groupSelectRow = row;
1447
       this.groupSelectRow = row;
1480
     },
1448
     },
1481
     groupClassName({ row, rowIndex }) {
1449
     groupClassName({ row, rowIndex }) {
1620
                 this.all_drug.push(obj)
1588
                 this.all_drug.push(obj)
1621
 
1589
 
1622
               }
1590
               }
1591
+
1623
               this.private_drug_config = response.data.data.private_drug_config
1592
               this.private_drug_config = response.data.data.private_drug_config
1624
               this.medicals = medicalList
1593
               this.medicals = medicalList
1625
             }   
1594
             }   
1626
-            console.log("-======",this.all_drug)
1595
+           
1627
         })
1596
         })
1628
        
1597
        
1629
     },
1598
     },
1630
     changeDrugName(name){
1599
     changeDrugName(name){
1631
-       this.current_drug_name = name
1632
-       this.nameForm.advice_desc = ''
1600
+      this.current_drug_name = name
1601
+      this.nameForm.advice_desc = ''
1633
       this.drugSpec = []
1602
       this.drugSpec = []
1634
       for (let i = 0; i < this.all_drug.length; i++) {
1603
       for (let i = 0; i < this.all_drug.length; i++) {
1635
         if (this.all_drug[i].drug_name == name) {
1604
         if (this.all_drug[i].drug_name == name) {
1638
        }
1607
        }
1639
     },
1608
     },
1640
     changeDrugDesc(name) {
1609
     changeDrugDesc(name) {
1641
-      console.log("-----",this.drugSpec)
1642
         this.current_drug_spec = name
1610
         this.current_drug_spec = name
1643
         for (let i = 0; i < this.drugSpec.length; i++) {
1611
         for (let i = 0; i < this.drugSpec.length; i++) {
1644
           if (this.drugSpec[i].drug_spec == name) {
1612
           if (this.drugSpec[i].drug_spec == name) {
1645
             this.nameForm.advice_desc = this.drugSpec[i].drug_spec
1613
             this.nameForm.advice_desc = this.drugSpec[i].drug_spec
1646
             this.nameForm.prescribing_number = this.drugSpec[i].prescribing_number.toString()
1614
             this.nameForm.prescribing_number = this.drugSpec[i].prescribing_number.toString()
1647
             this.nameForm.single_dose = this.drugSpec[i].single_dose.toString()
1615
             this.nameForm.single_dose = this.drugSpec[i].single_dose.toString()
1616
+
1648
             this.nameForm.delivery_way = this.drugSpec[i].delivery_way.toString()
1617
             this.nameForm.delivery_way = this.drugSpec[i].delivery_way.toString()
1649
             this.nameForm.execution_frequency = this.drugSpec[i].execution_frequency.toString()
1618
             this.nameForm.execution_frequency = this.drugSpec[i].execution_frequency.toString()
1650
             this.drug_id = this.drugSpec[i].id
1619
             this.drug_id = this.drugSpec[i].id
1651
             this.src_type = this.drugSpec[i].type
1620
             this.src_type = this.drugSpec[i].type
1652
             this.nameForm.drug_id = this.drugSpec[i].id
1621
             this.nameForm.drug_id = this.drugSpec[i].id
1653
             this.nameForm.way = this.drugSpec[i].type
1622
             this.nameForm.way = this.drugSpec[i].type
1654
-            this.drug_name_id = this.drugSpec[i].drug_name_id
1623
+            this.nameForm.single_dose_unit = this.drugSpec[i].min_unit
1624
+            this.nameForm.drug_spec_unit = this.drugSpec[i].min_unit
1625
+            this.nameForm.prescribing_number_unit = this.drugSpec[i].min_unit
1655
             if(this.drugSpec[i].drug_name_id){
1626
             if(this.drugSpec[i].drug_name_id){
1656
                this.nameForm.drug_name_id = this.drugSpec[i].drug_name_id
1627
                this.nameForm.drug_name_id = this.drugSpec[i].drug_name_id
1657
             }else{
1628
             }else{
1670
         })
1641
         })
1671
         var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
1642
         var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
1672
         // 调用 callback 返回建议列表的数据
1643
         // 调用 callback 返回建议列表的数据
1673
-        console.log('results',results)
1644
+       
1674
         cb(results);
1645
         cb(results);
1675
      },
1646
      },
1676
 
1647
 
1681
      },
1652
      },
1682
 
1653
 
1683
      querySearch1(queryString, cb) {
1654
      querySearch1(queryString, cb) {
1684
-        console.log('queryString',queryString)
1655
+      
1685
         var restaurants = this.drugSpec;
1656
         var restaurants = this.drugSpec;
1686
          console.log(restaurants)
1657
          console.log(restaurants)
1687
         restaurants.map(item => {
1658
         restaurants.map(item => {
1689
         })
1660
         })
1690
         var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
1661
         var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
1691
         // 调用 callback 返回建议列表的数据
1662
         // 调用 callback 返回建议列表的数据
1692
-        console.log('results',results)
1663
+       
1693
         cb(results);
1664
         cb(results);
1694
       },
1665
       },
1666
+
1667
+      handleSelect(){
1668
+
1669
+      },
1670
+      handleSelect1(){
1671
+
1672
+      }
1695
   },
1673
   },
1696
   watch: {
1674
   watch: {
1697
     "selectedTemp.list": function() {
1675
     "selectedTemp.list": function() {

+ 8 - 1
src/xt_pages/dialysis/details/dialog/assessmentBeforeDislysisDialog.vue View File

358
               <el-input v-model="assessmentBeforeDislysis.emergency_treatment_other"></el-input>
358
               <el-input v-model="assessmentBeforeDislysis.emergency_treatment_other"></el-input>
359
             </el-form-item>
359
             </el-form-item>
360
           </el-col>
360
           </el-col>
361
+            
362
+          <el-col :span="8" v-if="isShow('特殊处理情况')">
363
+            <el-form-item label="特殊处理情况:">
364
+              <el-input v-model="assessmentBeforeDislysis.special_treatment"></el-input>
365
+            </el-form-item>
366
+          </el-col>
367
+          
361
 
368
 
362
           <el-col :span="24">
369
           <el-col :span="24">
363
             <el-form-item label="备注: ">
370
             <el-form-item label="备注: ">
689
           catheter_suture_other:'',
696
           catheter_suture_other:'',
690
           urine_volume:'',
697
           urine_volume:'',
691
           edema:'',
698
           edema:'',
692
-
699
+          special_treatment:'',
693
         },
700
         },
694
 
701
 
695
         InnerDialogProps: {
702
         InnerDialogProps: {

+ 2 - 4
src/xt_pages/stock/drugs/drugsStockDialog/index.vue View File

210
         }
210
         }
211
       }, changeGoodInfoTableData: function(val) {
211
       }, changeGoodInfoTableData: function(val) {
212
         console.log(val)
212
         console.log(val)
213
-      }, changeAllGoodInfoTableData: function(selection) {
213
+      },
214
+       changeAllGoodInfoTableData: function(selection) {
214
         var goodInfos = this.propForm.goods[this.table_current_index].drug_specs
215
         var goodInfos = this.propForm.goods[this.table_current_index].drug_specs
215
         if (selection.length > 0) {
216
         if (selection.length > 0) {
216
           for (let y = 0; y < goodInfos.length; y++) {
217
           for (let y = 0; y < goodInfos.length; y++) {
245
             }
246
             }
246
           }
247
           }
247
         }
248
         }
248
-
249
-
250
-
251
       }
249
       }
252
     }
250
     }
253
 
251
 

+ 94 - 27
src/xt_pages/stock/selfPreparedMedicine/components/addMedicine.vue View File

9
             <div style="width:200px;">
9
             <div style="width:200px;">
10
               <el-table :data="tableData" border style="width: 100%;" height="300" :row-style="{ color: '#303133' }" 
10
               <el-table :data="tableData" border style="width: 100%;" height="300" :row-style="{ color: '#303133' }" 
11
                  :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row
11
                  :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row
12
-                 ref="monthlyPlanTable" @current-change="handleCurrentChange" >
12
+                 ref="monthlyPlanTable" @current-change="handleCurrentChange">
13
                     <el-table-column align="center" prop="name" label="药品名称">
13
                     <el-table-column align="center" prop="name" label="药品名称">
14
                         <template slot-scope="scope">
14
                         <template slot-scope="scope">
15
                            {{scope.row.drug_name}}
15
                            {{scope.row.drug_name}}
17
                     </el-table-column>
17
                     </el-table-column>
18
                 </el-table>
18
                 </el-table>
19
             </div>
19
             </div>
20
+
21
+
20
             <div style="flex:1;padding-left:10px;">
22
             <div style="flex:1;padding-left:10px;">
21
-                <el-table :data="tableDatatwo" border style="width: 100%;" height="300" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" 
22
-                 highlight-current-row  @selection-change="handleSelectionChange">
23
-                    <el-table-column type="selection" align="center" width="55"></el-table-column>
24
-                    <el-table-column align="center" prop="name" label="规格名称">
23
+                <el-table :data="tableDatatwo" border style="width: 100%;" height="300"
24
+                 ref="multipleTable"
25
+                 :row-style="{ color: '#303133' }"
26
+                 :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" 
27
+                  highlight-current-row
28
+                  @select="selectGoodInfo"
29
+                  @select-all="changeAllGoodInfoTableData">
30
+                 <el-table-column type="selection" align="center" width="55"></el-table-column>
31
+                 <el-table-column align="center" prop="name" label="规格名称">
25
                         <template slot-scope="scope">{{scope.row.drug_spec}}</template>
32
                         <template slot-scope="scope">{{scope.row.drug_spec}}</template>
26
                     </el-table-column>
33
                     </el-table-column>
27
                 </el-table>
34
                 </el-table>
47
             currentRow:"",
54
             currentRow:"",
48
             tableDatatwo:[],
55
             tableDatatwo:[],
49
             patient_id:0,
56
             patient_id:0,
50
-            medicineData:[]
57
+            medicineData:[],
58
+            standList:[],
59
+            table_current_index:-1,
51
         }
60
         }
52
     },
61
     },
53
     methods:{
62
     methods:{
79
              if(response.data.state == 1){
88
              if(response.data.state == 1){
80
                var rullername =  response.data.data.rullerName
89
                var rullername =  response.data.data.rullerName
81
                console.log("rullerName",rullername)
90
                console.log("rullerName",rullername)
82
-               this.tableData = rullername
91
+               var list =   response.data.data.list
92
+               console.log("list999999",list)
93
+               this.standList = list
94
+               this.tableData = list
83
              }
95
              }
84
            }) 
96
            }) 
85
         },
97
         },
86
         handleCurrentChange(val){
98
         handleCurrentChange(val){
87
-           this.currentRow = val
88
-           this.getRullListByDrugName(val.id)
89
-        },
90
-        getRullListByDrugName(id){
91
-            const params = {
92
-              id:id,
99
+          for(let i=0;i<this.tableData.length;i++){
100
+             if(val.id == this.tableData[i].id){
101
+                this.tableDatatwo = this.tableData[i].XtStandName
102
+             }
103
+          }
104
+
105
+         for (let i = 0; i < this.tableDatatwo.length; i++) {
106
+             console.log("222",this.tableDatatwo[i].isSelected)
107
+            if (this.tableDatatwo[i].isSelected) {
108
+                this.$nextTick(function() {
109
+                this.$refs.multipleTable.toggleRowSelection(this.tableDatatwo[i])
110
+                })
93
             }
111
             }
94
-           getRullListByDrugName(params).then(response=>{
95
-              if(response.data.state ==  1){
96
-                var drugName =  response.data.data.drugName
97
-                this.tableDatatwo = drugName
112
+         }
113
+        //  this.currentRow = val
114
+           
115
+        //    this.getRullListByDrugName(val.id)
116
+        },
117
+        // getRullListByDrugName(id){
118
+        //     const params = {
119
+        //       id:id,
120
+        //     }
121
+        //    getRullListByDrugName(params).then(response=>{
122
+        //       if(response.data.state ==  1){
123
+        //         var drugName =  response.data.data.drugName
124
+        //         this.tableDatatwo = drugName
125
+        //       }
126
+        //    })
127
+        // },
128
+        // handleSelectionChange(val){
129
+        //    console.log("val22222",val)
130
+        //    this.medicineData = val
131
+        // },
132
+        changeAllGoodInfoTableData(selection){  
133
+        let selected = selection.length && selection.indexOf(selection) !== -1
134
+
135
+        if (selection.length > 0) {
136
+          for (let y = 0; y < this.tableDatatwo.length; y++) {
137
+                for (let i = 0; i < selection.length; i++) {
138
+                if (this.tableDatatwo[y].id == selection[i].id) {
139
+                    this.tableDatatwo[y].isSelected = true
140
+                }
141
+               }
142
+             }
143
+           }else{
144
+             for (let y = 0; y < this.tableDatatwo.length; y++) {
145
+                    this.tableDatatwo[y].isSelected = false 
98
               }
146
               }
99
-           })
147
+           }
100
         },
148
         },
101
-        handleSelectionChange(val){
102
-           this.medicineData = val
149
+        selectGoodInfo(rows, row){
150
+          let selected = rows.length && rows.indexOf(row) !== -1
151
+           if(selected == true){
152
+            for (let y = 0; y < this.tableDatatwo.length; y++) {
153
+                for (let i = 0; i < rows.length; i++) {
154
+                if (this.tableDatatwo[y].id == rows[i].id) {
155
+                    this.tableDatatwo[y].isSelected = true
156
+                 }
157
+                }
158
+            }
159
+           }
160
+           if(selected == 0){
161
+            for (let y = 0; y < this.tableDatatwo.length; y++) {
162
+                this.tableDatatwo[y].isSelected = false 
163
+            }
164
+           }
103
         },
165
         },
104
-
105
-        SaveSelfMedicines(){
106
-          if(this.medicineData.length == 0){
166
+      SaveSelfMedicines(){
167
+        this.multipleSelection = []
168
+          for (let i = 0; i < this.tableData.length; i++) {
169
+            for (let a = 0; a < this.tableData[i].XtStandName.length; a++) {
170
+                if (this.tableData[i].XtStandName[a].isSelected) {
171
+                    this.multipleSelection.push(this.tableData[i].XtStandName[a])
172
+                }
173
+            }
174
+         }
175
+          if(this.multipleSelection.length == 0){
107
              this.$message.error("请添加药品规格")
176
              this.$message.error("请添加药品规格")
108
              return
177
              return
109
           }
178
           }
110
           const params = {
179
           const params = {
111
              patient_id:this.patient_id,
180
              patient_id:this.patient_id,
112
-             medicineData:this.medicineData
181
+             medicineData:this.multipleSelection
113
           }
182
           }
114
-         console.log("params----",params)
115
-       
116
          SaveSelfMedicines(params).then(response=>{
183
          SaveSelfMedicines(params).then(response=>{
117
              if(response.data.state == 1){
184
              if(response.data.state == 1){
118
                 var msg = response.data.data.msg
185
                 var msg = response.data.data.msg
123
                 this.$message.error("药品名称规格已存在")
190
                 this.$message.error("药品名称规格已存在")
124
              }
191
              }
125
            })   
192
            })   
126
-        }
193
+        },
127
     },
194
     },
128
   created(){
195
   created(){
129
        //获取所有药品名称
196
        //获取所有药品名称

+ 2 - 1
src/xt_pages/stock/selfPreparedMedicine/index.vue View File

46
                 <div style="width:160px;">
46
                 <div style="width:160px;">
47
                     <div class="tablesTitle">患者列表</div>
47
                     <div class="tablesTitle">患者列表</div>
48
                     <el-table :data="tablePatient" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row
48
                     <el-table :data="tablePatient" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row
49
-                    @current-change="handleCurrentChange"  ref="monthlyPlanTable">
49
+                    @current-change="handleCurrentChange"  ref="monthlyPlanTable"
50
+                    >
50
                         <el-table-column align="center" prop="dialysis_no" label="透析号" width="70">
51
                         <el-table-column align="center" prop="dialysis_no" label="透析号" width="70">
51
                             <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
52
                             <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
52
                         </el-table-column>
53
                         </el-table-column>

+ 63 - 51
src/xt_pages/user/components/EditGroupAdvice.vue View File

382
         <el-row>
382
         <el-row>
383
           <el-col :span="10">
383
           <el-col :span="10">
384
             <el-form-item label="医嘱内容 :" required prop="advice_name">
384
             <el-form-item label="医嘱内容 :" required prop="advice_name">
385
-              <el-select
386
-                v-model="nameForm.advice_name"
387
-                filterable
388
-                clearable
389
-                allow-create
390
-                :disabled="isChild"
391
-                placeholder="请选择(输入可搜索)"
392
-                style="width:200px"
393
-                @change="changeDrugName"
394
-              >
395
-                <el-option
396
-                  v-for="(item,index) in all_drug"
397
-                  :key="index"
398
-                  :label="item.drug_name"
399
-                  :value="item.drug_name"
400
-                ></el-option>
401
-              </el-select>
402
 
385
 
386
+               <el-autocomplete
387
+                style="width:100%;"
388
+                class="inline-input"
389
+                v-model="nameForm.advice_name"
390
+                :fetch-suggestions="querySearch"
391
+                placeholder="请输入内容"
392
+                @select="handleSelect"
393
+                @input="changeDrugName"
394
+              ></el-autocomplete>
395
+              
403
             </el-form-item>
396
             </el-form-item>
404
           </el-col>
397
           </el-col>
405
           <el-col :span="14">
398
           <el-col :span="14">
408
             <!--</el-form-item>-->
401
             <!--</el-form-item>-->
409
             <el-form-item label="药品规格 :" prop="advice_desc">
402
             <el-form-item label="药品规格 :" prop="advice_desc">
410
               <el-col :span="10">
403
               <el-col :span="10">
411
-                 <el-select
404
+                <el-autocomplete
405
+                  style="width:100px;"
406
+                  class="inline-input"
412
                   v-model="nameForm.advice_desc"
407
                   v-model="nameForm.advice_desc"
413
-                  filterable
414
-                  clearable
415
-                  allow-create
416
-                  :disabled="isChild"
417
-                  placeholder="请选择(输入可搜索)"
418
-                  style="width:150px"
419
-                  @change="changeDrugDesc"
420
-                >
421
-                  <el-option
422
-                    v-for="item in drugSpec"
423
-                    :key="item.id"
424
-                    :label="item.drug_spec"
425
-                    :value="item.drug_spec"
426
-                  ></el-option>
427
-                 </el-select>
408
+                  :fetch-suggestions="querySearch1"
409
+                  placeholder="请输入内容"
410
+                  @select="handleSelect1"
411
+                  @input="changeDrugDesc"
412
+                ></el-autocomplete>
428
               </el-col>
413
               </el-col>
429
               <el-col class="line" :span="2">&nbsp;</el-col>
414
               <el-col class="line" :span="2">&nbsp;</el-col>
430
               <el-col :span="10">
415
               <el-col :span="10">
647
       },
632
       },
648
 
633
 
649
       drugOptions: [],
634
       drugOptions: [],
635
+      deliveryWayOptions: [],
636
+      executionFrequencyOptions: [],
650
       adviceTemplates: [],
637
       adviceTemplates: [],
651
       submitGroupForm: {
638
       submitGroupForm: {
652
         advice_type: "",
639
         advice_type: "",
706
         return [];
693
         return [];
707
       }
694
       }
708
     },
695
     },
709
-    executionFrequencyOptions: {
710
-      type: Array,
711
-      default: function() {
712
-        return [];
713
-      }
714
-    }, deliveryWayOptions: {
715
-      type: Array,
716
-      default: function() {
717
-        return [];
718
-      }
719
-    }, unitsOption: {
696
+
697
+    unitsOption: {
720
       type: Array,
698
       type: Array,
721
       default: function() {
699
       default: function() {
722
         return [];
700
         return [];
863
         .catch(() => {});
841
         .catch(() => {});
864
     },
842
     },
865
     submitNameForm(formName) {
843
     submitNameForm(formName) {
866
-
844
+     
867
       if(this.src_type == ""){
845
       if(this.src_type == ""){
868
           this.nameForm.way = 0
846
           this.nameForm.way = 0
869
           this.nameForm.drug_id = 0
847
           this.nameForm.drug_id = 0
875
        }
853
        }
876
 
854
 
877
       //  if(typeof(this.nameForm.advice_name) == "string"){
855
       //  if(typeof(this.nameForm.advice_name) == "string"){
878
-
856
+         
879
       //     this.nameForm.advice_name == this.nameForm.advice_name
857
       //     this.nameForm.advice_name == this.nameForm.advice_name
880
       // }
858
       // }
881
 
859
 
897
       //       var arr = name.split("(自备药)")
875
       //       var arr = name.split("(自备药)")
898
       //       drug_name = arr[0]
876
       //       drug_name = arr[0]
899
       //     }
877
       //     }
900
-
878
+          
901
       //     this.nameForm.advice_name = drug_name
879
       //     this.nameForm.advice_name = drug_name
902
       //     this.nameForm.way = way
880
       //     this.nameForm.way = way
903
       // }
881
       // }
2496
                 obj.custom_id = this.rand(10000000, 99999999)
2474
                 obj.custom_id = this.rand(10000000, 99999999)
2497
                 obj.drug_specs = base_drug_list[i].drug_specs
2475
                 obj.drug_specs = base_drug_list[i].drug_specs
2498
                 this.all_drug.push(obj)
2476
                 this.all_drug.push(obj)
2499
-                console.log("中2222222222222222222",this.all_drug)
2477
+                
2500
               }
2478
               }
2501
-            }
2479
+            }   
2502
         })
2480
         })
2503
-
2481
+       
2504
     },
2482
     },
2505
     changeDrugName(name){
2483
     changeDrugName(name){
2506
        this.current_drug_name = name
2484
        this.current_drug_name = name
2527
             this.nameForm.way = this.drugSpec[i].type
2505
             this.nameForm.way = this.drugSpec[i].type
2528
           }
2506
           }
2529
         }
2507
         }
2530
-      }
2508
+      },
2509
+      handleSelect1(){
2510
+        
2511
+      },
2512
+
2513
+       querySearch(queryString, cb) {
2514
+        console.log('queryString',queryString)
2515
+        var restaurants = this.all_drug;
2516
+        restaurants.map(item => {
2517
+          item.value = item.drug_name
2518
+        })
2519
+        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
2520
+        // 调用 callback 返回建议列表的数据
2521
+       
2522
+        cb(results);
2523
+     },
2524
+
2525
+     createFilter(queryString) {
2526
+        return (restaurant) => {
2527
+          return (restaurant.drug_name.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
2528
+        };
2529
+     },
2530
+
2531
+     querySearch1(queryString, cb) {
2532
+      
2533
+        var restaurants = this.drugSpec;
2534
+         console.log(restaurants)
2535
+        restaurants.map(item => {
2536
+          item.value = item.drug_spec
2537
+        })
2538
+        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
2539
+        // 调用 callback 返回建议列表的数据
2540
+       
2541
+        cb(results);
2542
+      },
2531
   },
2543
   },
2532
   watch: {
2544
   watch: {
2533
     rowKey: function() {
2545
     rowKey: function() {

+ 163 - 64
src/xt_pages/user/doctorAdvice.vue View File

945
           <el-row>
945
           <el-row>
946
             <el-col :span="10">
946
             <el-col :span="10">
947
               <el-form-item label="医嘱内容:" required prop="advice_name">
947
               <el-form-item label="医嘱内容:" required prop="advice_name">
948
-                <!-- <el-input v-model="nameForm.advice_name"></el-input> -->
949
-
950
-                <el-select
951
-                  v-model="nameForm.advice_name"
952
-                  filterable
953
-                  clearable
954
-                  allow-create
955
-                  :disabled="isChild"
956
-                  placeholder="请选择(输入可搜索)"
957
-                  style="width:200px"
958
-                  @change="changeDrugName"
959
-                >
960
-                  <el-option
961
-                    v-for="(item,index) in all_drug"
962
-                    :key="index"
963
-                    :label="item.drug_name"
964
-                    :value="item.drug_name"
965
-                  ></el-option>
966
-                </el-select>
948
+               <el-autocomplete
949
+                style="width:100%;"
950
+                class="inline-input"
951
+                v-model="nameForm.advice_name"
952
+                :fetch-suggestions="querySearch"
953
+                placeholder="请输入内容"
954
+                @select="handleSelect"
955
+                @input="changeDrugName"
956
+              ></el-autocomplete>
967
               <!-- <div style="color:red;font-size:12px;">
957
               <!-- <div style="color:red;font-size:12px;">
968
                 库存不足50
958
                 库存不足50
969
               </div> -->
959
               </div> -->
972
 
962
 
973
             <el-col :span="14">
963
             <el-col :span="14">
974
               <el-form-item label="药品规格 :" prop="advice_desc">
964
               <el-form-item label="药品规格 :" prop="advice_desc">
975
-                <el-col :span="12">
976
-                  <!-- <el-input v-model="nameForm.advice_desc"></el-input> -->
977
-                    <el-select
978
-                    v-model="nameForm.advice_desc"
979
-                    filterable
980
-                    clearable
981
-                    allow-create
982
-                    :disabled="isChild"
983
-                    placeholder="请选择(输入可搜索)"
984
-                    style="width:150px"
985
-                    @change="changeDrugDesc"
986
-                >
987
-                  <el-option
988
-                    v-for="item in drugSpec"
989
-                    :key="item.id"
990
-                    :label="item.drug_spec"
991
-                    :value="item.drug_spec"
992
-                  ></el-option>
993
-                 </el-select>
965
+                <el-col :span="6">
966
+
967
+                <el-autocomplete
968
+                  style="width:100px;"
969
+                  class="inline-input"
970
+                  v-model="nameForm.advice_desc"
971
+                  :fetch-suggestions="querySearch1"
972
+                  placeholder="请输入内容"
973
+                  @select="handleSelect1"
974
+                  @input="changeDrugDesc"
975
+                ></el-autocomplete>
994
 
976
 
995
                 </el-col>
977
                 </el-col>
996
                 <el-col class="line" :span="2">&nbsp;</el-col>
978
                 <el-col class="line" :span="2">&nbsp;</el-col>
1176
         ref="editGroupForm"
1158
         ref="editGroupForm"
1177
       ></edit-group-advice>
1159
       ></edit-group-advice>
1178
 
1160
 
1161
+
1162
+    <!-- 新增子药 -->
1179
       <el-dialog
1163
       <el-dialog
1180
         :title="dialogTitle"
1164
         :title="dialogTitle"
1181
         :visible.sync="dialogFormVisible"
1165
         :visible.sync="dialogFormVisible"
1236
             </el-col>
1220
             </el-col>
1237
             <el-col :span="12">
1221
             <el-col :span="12">
1238
               <el-form-item label="医嘱内容 :" required prop="advice_name">
1222
               <el-form-item label="医嘱内容 :" required prop="advice_name">
1239
-                <el-input v-model="adviceForm.advice_name"></el-input>
1240
-                <!--<el-select v-model="adviceForm.advice_name" @change="changeAdviceName" filterable clearable allow-create placeholder="请选择(输入可搜索)" style="width:50%" >-->
1241
-                <!--<el-option-->
1242
-                <!--v-for="item in adviceTemplates"-->
1243
-                <!--:key="item.id"-->
1244
-                <!--:label="item.advice_name"-->
1245
-                <!--:value="item.id"-->
1246
-                <!--&gt;-->
1247
-                <!--<span >{{ item.advice_name }}</span>-->
1248
-                <!--<span >{{ item.advice_spec }}</span>-->
1249
-                <!--</el-option>-->
1250
-                <!--</el-select>-->
1223
+                <el-autocomplete
1224
+                  style="width:100%;"
1225
+                  class="inline-input"
1226
+                  v-model="adviceForm.advice_name"
1227
+                  :fetch-suggestions="querySearch"
1228
+                  placeholder="请输入内容"
1229
+                  @select="handleSelect"
1230
+                  @input="changeDrugNameTwo"
1231
+                ></el-autocomplete>
1251
               </el-form-item>
1232
               </el-form-item>
1252
             </el-col>
1233
             </el-col>
1253
 
1234
 
1254
             <el-col :span="12">
1235
             <el-col :span="12">
1255
               <el-form-item label="药品规格 :" prop="advice_desc">
1236
               <el-form-item label="药品规格 :" prop="advice_desc">
1256
                 <el-col :span="9">
1237
                 <el-col :span="9">
1257
-                  <el-input v-model="adviceForm.advice_desc"></el-input>
1238
+                  <!-- <el-input v-model="adviceForm.advice_desc"></el-input> -->
1239
+                  <el-autocomplete
1240
+                    style="width:100px;"
1241
+                    class="inline-input"
1242
+                    v-model="adviceForm.advice_desc"
1243
+                    :fetch-suggestions="querySearch1"
1244
+                    placeholder="请输入内容"
1245
+                    @select="handleSelect1"
1246
+                    @input="changeDrugDescTwo"
1247
+                  ></el-autocomplete>
1248
+
1258
                 </el-col>
1249
                 </el-col>
1259
                 <el-col class="line" :span="1">&nbsp;</el-col>
1250
                 <el-col class="line" :span="1">&nbsp;</el-col>
1260
                 <el-col :span="14">
1251
                 <el-col :span="14">
2090
         execution_frequency: "",
2081
         execution_frequency: "",
2091
         advice_doctor: "",
2082
         advice_doctor: "",
2092
         remark: "",
2083
         remark: "",
2093
-        parent_id: 0
2084
+        parent_id: 0,
2085
+        drug_id:0,
2086
+        way:0,
2087
+        drug_name_id:0,
2094
       },
2088
       },
2095
       nameForm: {
2089
       nameForm: {
2096
         advice_name: "",
2090
         advice_name: "",
2234
               mode = "3-1";
2228
               mode = "3-1";
2235
             }
2229
             }
2236
           }
2230
           }
2231
+          if(this.src_type == ""){
2232
+              this.adviceForm.way = 0
2233
+              this.adviceForm.drug_id = 0
2234
+              this.adviceForm.drug_name_id = 0
2235
+          }
2236
+
2237
+          if(this.src_type == 2){ //自备药
2238
+              var arr = this.adviceForm.advice_name.split("(自备药)")
2239
+              this.adviceForm.advice_name = arr[0]
2240
+          }
2241
+
2237
 
2242
 
2238
           EditNewDoctorAdvice(
2243
           EditNewDoctorAdvice(
2239
             this.patientID,
2244
             this.patientID,
2305
           console.log("33333",this.private_drug_config.drug_start)
2310
           console.log("33333",this.private_drug_config.drug_start)
2306
           console.log("44444",this.medicals)
2311
           console.log("44444",this.medicals)
2307
 
2312
 
2313
+
2314
+
2308
           var adviceNames = [];
2315
           var adviceNames = [];
2309
           for (const index in this.groupForm.adviceNames) {
2316
           for (const index in this.groupForm.adviceNames) {
2310
             this.groupForm.adviceNames[
2317
             this.groupForm.adviceNames[
2325
           } else if (this.groupForm.advice_type == 3) {
2332
           } else if (this.groupForm.advice_type == 3) {
2326
             mode = "1-1";
2333
             mode = "1-1";
2327
           }
2334
           }
2328
-        console.log("22222222",this.medicals)
2329
-        console.log("3333333",submitForm)
2335
+        console.log("长期医嘱2222",this.medicals)
2336
+        console.log("长期医嘱3333",submitForm)
2330
 
2337
 
2331
-        if(this.private_drug_config.drug_start == 1){
2338
+        if(this.private_drug_config != null&&this.private_drug_config.drug_start == 1){
2332
               for(let index=0;index<submitForm.adviceNames.length;index++){
2339
               for(let index=0;index<submitForm.adviceNames.length;index++){
2333
                   for(let i=0;i<this.medicals.length;i++){
2340
                   for(let i=0;i<this.medicals.length;i++){
2334
                     if(submitForm.adviceNames[index].drug_id == this.medicals[i].drug_name_id){
2341
                     if(submitForm.adviceNames[index].drug_id == this.medicals[i].drug_name_id){
2421
             //临时
2428
             //临时
2422
             mode = "1-1";
2429
             mode = "1-1";
2423
           }
2430
           }
2431
+          if(this.src_type == ""){
2432
+              this.adviceForm.way = 0
2433
+              this.adviceForm.drug_id = 0
2434
+              this.adviceForm.drug_name_id = 0
2435
+          }
2436
+
2437
+          if(this.src_type == 2){ //自备药
2438
+              var arr = this.adviceForm.advice_name.split("(自备药)")
2439
+              this.adviceForm.advice_name = arr[0]
2440
+          }
2441
+          console.log("222222",this.adviceForm)
2424
 
2442
 
2425
           CreateNewDoctorAdvice(this.patientID, this.adviceForm, mode).then(
2443
           CreateNewDoctorAdvice(this.patientID, this.adviceForm, mode).then(
2426
             response => {
2444
             response => {
2688
           id: 0,
2706
           id: 0,
2689
           children: [],
2707
           children: [],
2690
           parent_row: 0,
2708
           parent_row: 0,
2691
-          way:"",
2692
-          drug_id:'',
2709
+          way:0,
2710
+          drug_id:0,
2693
           drug_name_id:0,
2711
           drug_name_id:0,
2694
         };
2712
         };
2695
         this.nameFormTitle = "新增医嘱内容";
2713
         this.nameFormTitle = "新增医嘱内容";
2958
     },
2976
     },
2959
     openConfig() {},
2977
     openConfig() {},
2960
     openEditGroupAdvice(groupno) {
2978
     openEditGroupAdvice(groupno) {
2979
+
2961
       var groups = [];
2980
       var groups = [];
2962
       this.rowKey = 0;
2981
       this.rowKey = 0;
2982
+      for(let i=0;i<this.adviceTableData.length;i++){
2983
+        if(this.adviceTableData[i].advice_type == 2){
2984
+           this.adviceTableData[i].advice_type = "临时"
2985
+        }
2986
+      }
2987
+
2963
       for (const index in this.adviceTableData) {
2988
       for (const index in this.adviceTableData) {
2964
         if (groupno == this.adviceTableData[index].groupno) {
2989
         if (groupno == this.adviceTableData[index].groupno) {
2965
           groups.push(this.adviceTableData[index]);
2990
           groups.push(this.adviceTableData[index]);
2979
         remark: groups[0].remark,
3004
         remark: groups[0].remark,
2980
         groupno: groupno
3005
         groupno: groupno
2981
       };
3006
       };
2982
-      // console.log(groups[0]);
3007
+      console.log("2222",groups[0]);
2983
 
3008
 
2984
       var childMap = {};
3009
       var childMap = {};
2985
       for (const index in groups) {
3010
       for (const index in groups) {
3023
           row_key: this.rowKey,
3048
           row_key: this.rowKey,
3024
           table: []
3049
           table: []
3025
         };
3050
         };
3026
-        console.log("itme-----------",item)
3051
+
3027
         if (item.id in childMap) {
3052
         if (item.id in childMap) {
3028
           for (const key in childMap[item.id]) {
3053
           for (const key in childMap[item.id]) {
3029
             this.rowKey++;
3054
             this.rowKey++;
4040
           var arr = this.nameForm.advice_name.split("(自备药)")
4065
           var arr = this.nameForm.advice_name.split("(自备药)")
4041
           this.nameForm.advice_name = arr[0]
4066
           this.nameForm.advice_name = arr[0]
4042
        }
4067
        }
4043
-
4068
+      console.log("医嘱2222",this.nameForm)
4044
       var _this = this;
4069
       var _this = this;
4045
       this.$refs[formName].validate(valid => {
4070
       this.$refs[formName].validate(valid => {
4046
         if (valid) {
4071
         if (valid) {
4343
               : response.data.data.drugways;
4368
               : response.data.data.drugways;
4344
           this.executionFrequencyOptions =
4369
           this.executionFrequencyOptions =
4345
             response.data.data.efs === null ? [] : response.data.data.efs;
4370
             response.data.data.efs === null ? [] : response.data.data.efs;
4346
-          console.log(this.deliveryWayOptions)
4347
-          console.log(this.executionFrequencyOptions)
4348
-
4349
         }
4371
         }
4350
       });
4372
       });
4351
     },
4373
     },
4495
 
4517
 
4496
       })
4518
       })
4497
     },
4519
     },
4520
+    changeDrugNameTwo(name){
4521
+       this.current_drug_name = name
4522
+       this.adviceForm.advice_desc = ''
4523
+      this.drugSpec = []
4524
+      for (let i = 0; i < this.all_drug.length; i++) {
4525
+        if (this.all_drug[i].drug_name == name) {
4526
+            this.drugSpec = this.all_drug[i].drug_specs
4527
+          }
4528
+       }
4529
+    },
4530
+   changeDrugDescTwo(name){
4531
+      this.current_drug_spec = name
4532
+        for (let i = 0; i < this.drugSpec.length; i++) {
4533
+          if (this.drugSpec[i].drug_spec == name) {
4534
+            this.adviceForm.advice_desc = this.drugSpec[i].drug_spec
4535
+            this.adviceForm.prescribing_number = this.drugSpec[i].prescribing_number.toString()
4536
+            this.adviceForm.single_dose = this.drugSpec[i].single_dose.toString()
4537
+            this.adviceForm.delivery_way = this.drugSpec[i].delivery_way.toString()
4538
+            this.adviceForm.execution_frequency = this.drugSpec[i].execution_frequency.toString()
4539
+            this.drug_id = this.drugSpec[i].id
4540
+            this.src_type = this.drugSpec[i].type
4541
+            this.adviceForm.drug_id = this.drugSpec[i].id
4542
+            this.adviceForm.way = this.drugSpec[i].type
4543
+            this.adviceForm.single_dose_unit = this.drugSpec[i].min_unit
4544
+            this.adviceForm.drug_spec_unit = this.drugSpec[i].min_unit
4545
+            this.adviceForm.prescribing_number_unit = this.drugSpec[i].min_unit
4546
+            if(this.drugSpec[i].drug_name_id){
4547
+               this.adviceForm.drug_name_id = this.drugSpec[i].drug_name_id
4548
+            }else{
4549
+              this.adviceForm.drug_name_id = 0
4550
+            }
4551
+          }
4552
+        }
4553
+   },
4498
    changeDrugName(name){
4554
    changeDrugName(name){
4499
        this.current_drug_name = name
4555
        this.current_drug_name = name
4500
        this.nameForm.advice_desc = ''
4556
        this.nameForm.advice_desc = ''
4518
             this.src_type = this.drugSpec[i].type
4574
             this.src_type = this.drugSpec[i].type
4519
             this.nameForm.drug_id = this.drugSpec[i].id
4575
             this.nameForm.drug_id = this.drugSpec[i].id
4520
             this.nameForm.way = this.drugSpec[i].type
4576
             this.nameForm.way = this.drugSpec[i].type
4577
+            this.nameForm.single_dose_unit = this.drugSpec[i].min_unit
4578
+            this.nameForm.drug_spec_unit = this.drugSpec[i].min_unit
4579
+            this.nameForm.prescribing_number_unit = this.drugSpec[i].min_unit
4521
             if(this.drugSpec[i].drug_name_id){
4580
             if(this.drugSpec[i].drug_name_id){
4522
-               this.nameForm.drug_name_id = 0
4581
+               this.nameForm.drug_name_id = this.drugSpec[i].drug_name_id
4582
+            }else{
4583
+              this.nameForm.drug_name_id = 0
4523
             }
4584
             }
4524
           }
4585
           }
4525
         }
4586
         }
4527
     rand(min, max) {
4588
     rand(min, max) {
4528
         return Math.floor(Math.random() * (max - min)) + min;
4589
         return Math.floor(Math.random() * (max - min)) + min;
4529
     },
4590
     },
4591
+
4592
+     querySearch(queryString, cb) {
4593
+        console.log('queryString',queryString)
4594
+        var restaurants = this.all_drug;
4595
+        restaurants.map(item => {
4596
+          item.value = item.drug_name
4597
+        })
4598
+        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
4599
+        // 调用 callback 返回建议列表的数据
4600
+        console.log('results',results)
4601
+        cb(results);
4602
+     },
4603
+
4604
+     createFilter(queryString) {
4605
+        return (restaurant) => {
4606
+          return (restaurant.drug_name.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
4607
+        };
4608
+     },
4609
+
4610
+     querySearch1(queryString, cb) {
4611
+        console.log('queryString',queryString)
4612
+        var restaurants = this.drugSpec;
4613
+         console.log(restaurants)
4614
+        restaurants.map(item => {
4615
+          item.value = item.drug_spec
4616
+        })
4617
+        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
4618
+        // 调用 callback 返回建议列表的数据
4619
+        console.log('results',results)
4620
+        cb(results);
4621
+      },
4622
+
4623
+      handleSelect1(){
4624
+
4625
+      },
4626
+      handleSelect(){
4627
+
4628
+      }
4530
   },
4629
   },
4531
   watch: {
4630
   watch: {
4532
     adviceTableData: function() {
4631
     adviceTableData: function() {