Browse Source

自备药

XMLWAN 4 years ago
parent
commit
9fc799cfb9

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

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

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

@@ -300,6 +300,8 @@
300 300
                 <el-button type="primary" @click="submitTableTemplate('form')">保 存</el-button>
301 301
               </div>
302 302
             </el-dialog>
303
+
304
+            <!-- 新增子药 -->
303 305
             <el-dialog :title="dialogTitle" :visible.sync="templateFormVisible" width="854px">
304 306
               <el-form
305 307
                 ref="templateForm"
@@ -514,23 +516,6 @@
514 516
                 <el-row>
515 517
                   <el-col :span="24">
516 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 519
                         <el-autocomplete
535 520
                           style="width:100%;"
536 521
                           class="inline-input"
@@ -545,34 +530,16 @@
545 530
                   <el-col :span="15">
546 531
 
547 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 543
                       </el-col>
577 544
                       <el-col class="line" :span="1">&nbsp;</el-col>
578 545
                       <el-col :span="14">
@@ -1817,9 +1784,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 1795
         if(this.src_type == ""){
1824 1796
             this.templateForm.way = 0
1825 1797
             this.templateForm.drug_id = 0
@@ -1829,7 +1801,8 @@
1829 1801
             var arr = this.templateForm.advice_name.split("(自备药)")
1830 1802
             this.templateForm.advice_name = arr[0]
1831 1803
         }
1832
-        
1804
+        console.log("2222",this.templateForm)
1805
+       
1833 1806
         this.$refs[formName].validate(valid => {
1834 1807
           this.templateForm.single_dose = parseFloat(this.templateForm.single_dose)
1835 1808
           this.templateForm.prescribing_number = parseFloat(this.templateForm.prescribing_number)
@@ -1840,7 +1813,7 @@
1840 1813
           if (isNaN(this.templateForm.prescribing_number)) {
1841 1814
             this.templateForm.prescribing_number = 0
1842 1815
           }
1843
-
1816
+          
1844 1817
           if (valid) {
1845 1818
             const templateFormTwo = {}
1846 1819
             templateFormTwo.template_id = this.current_template_id
@@ -2201,7 +2174,8 @@
2201 2174
          } 
2202 2175
         this.templateFormEdit.drug_id = drug_id
2203 2176
        
2204
-        console.log("2222",this.templateFormEdit)
2177
+        console.log("编辑子药",this.templateFormEdit)
2178
+       
2205 2179
         this.$refs[formName].validate(valid => {
2206 2180
 
2207 2181
           this.templateFormEdit.single_dose = parseFloat(this.templateFormEdit.single_dose)
@@ -2263,7 +2237,8 @@
2263 2237
             )
2264 2238
           }
2265 2239
         })
2266
-      }, drugDesc(row) {
2240
+      }, 
2241
+      drugDesc(row) {
2267 2242
         if (row.isNoSub == 2) {
2268 2243
           if (row.drug_spec.length <= 0) {
2269 2244
             return ''
@@ -2859,6 +2834,9 @@
2859 2834
             this.drug_id = this.drugSpec[i].id
2860 2835
             this.src_type = this.drugSpec[i].type
2861 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 2840
             this.templateForm.way = this.drugSpec[i].type
2863 2841
           }
2864 2842
         }
@@ -2884,6 +2862,9 @@
2884 2862
             this.templateFormEdit.single_dose = this.drugSpec[i].single_dose.toString()
2885 2863
             this.templateFormEdit.delivery_way = this.drugSpec[i].delivery_way.toString()
2886 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
       },

+ 58 - 81
src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue View File

@@ -239,7 +239,6 @@
239 239
         :cell-class-name="adviceNameShow"
240 240
         :modal-append-to-body="false"
241 241
         highlight-current-row
242
-        @current-change="handleCurrentChange"
243 242
       >
244 243
         <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
245 244
           <template slot-scope="scope">
@@ -249,9 +248,7 @@
249 248
         <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
250 249
           <template slot-scope="scope">
251 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 252
             </span>
256 253
           </template>
257 254
         </el-table-column>
@@ -259,8 +256,7 @@
259 256
           <template slot-scope="scope">
260 257
             <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
261 258
               <span class="el-dropdown-link">
262
-                {{ getAdviceContent(scope.row, 1)
263
-                }}
259
+                {{ getAdviceContent(scope.row, 1)}}
264 260
                 <i class="el-icon-arrow-down el-icon--right"></i>
265 261
               </span>
266 262
               <el-dropdown-menu slot="dropdown">
@@ -272,8 +268,7 @@
272 268
 
273 269
             <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
274 270
               <span class="el-dropdown-link">
275
-                &emsp;{{ getAdviceContent(scope.row, 2)
276
-                }}
271
+                &emsp;{{ getAdviceContent(scope.row, 2)}}
277 272
                 <i class="el-icon-arrow-down el-icon--right"></i>
278 273
               </span>
279 274
               <el-dropdown-menu slot="dropdown">
@@ -293,9 +288,7 @@
293 288
         >
294 289
           <template slot-scope="scope">
295 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 292
             </span>
300 293
             <span v-else></span>
301 294
           </template>
@@ -303,9 +296,7 @@
303 296
         <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
304 297
           <template slot-scope="scope">
305 298
             <span v-if="scope.row.parent_id == 0">
306
-              {{
307
-              getXuserName(scope.row.execution_staff)
308
-              }}
299
+              {{getXuserName(scope.row.execution_staff)}}
309 300
             </span>
310 301
             <span v-else></span>
311 302
           </template>
@@ -319,9 +310,7 @@
319 310
         >
320 311
           <template slot-scope="scope">
321 312
             <span v-if="scope.row.parent_id == 0">
322
-              {{
323
-              getXuserName(scope.row.checker)
324
-              }}
313
+              {{getXuserName(scope.row.checker)}}
325 314
             </span>
326 315
             <span v-else></span>
327 316
           </template>
@@ -408,20 +397,11 @@
408 397
       </div>-->
409 398
       <!-- 新医嘱列表 -->
410 399
 
400
+
401
+      <!-- 新增医嘱(子药)表单 -->
411 402
       <!-- 医嘱表单 -->
412 403
       <el-form ref="form" :model="form" label-width="100px" v-show="showAdviceForm">
413 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 405
           <el-col :span="8">
426 406
             <el-form-item label="开始时间:">
427 407
               <el-date-picker
@@ -438,23 +418,6 @@
438 418
 
439 419
           <el-col :span="8">
440 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 422
               <el-autocomplete
460 423
                 style="width:100%;"
@@ -469,25 +432,7 @@
469 432
           </el-col>
470 433
 
471 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 436
                 <el-autocomplete
492 437
                   style="width:100px;"
493 438
                   class="inline-input"
@@ -532,7 +477,6 @@
532 477
                   :value="item.name"
533 478
                 ></el-option>
534 479
               </el-select>
535
-              <!-- <el-input v-model="form.prescribing_number_unit" style="width: 40%;"></el-input> -->
536 480
             </el-form-item>
537 481
           </el-col>
538 482
 
@@ -552,8 +496,6 @@
552 496
                   :value="item.name"
553 497
                 ></el-option>
554 498
               </el-select>
555
-
556
-              <!-- <el-input v-model="form.single_dose_unit" style="width: 40%;"></el-input> -->
557 499
             </el-form-item>
558 500
           </el-col>
559 501
 
@@ -942,7 +884,6 @@
942 884
         }
943 885
       },
944 886
       submitEditAdvice() {
945
-        console.log("this.form",this.form)
946 887
         if (this.form.advice_name.length == 0) {
947 888
           this.$message.error('请填写医嘱名称')
948 889
           return
@@ -1231,6 +1172,7 @@
1231 1172
       }
1232 1173
       ,
1233 1174
       submitExce() {
1175
+        
1234 1176
         if (this.currentRow == null) {
1235 1177
           this.$message.error('请先选择要执行的医嘱!')
1236 1178
           return false
@@ -1247,6 +1189,9 @@
1247 1189
         }
1248 1190
         this.exceLoading = true
1249 1191
         let mode = '6'
1192
+        
1193
+         console.log("222222",this.currentRow.id)
1194
+        
1250 1195
         ExecDoctorAdvice(this.patient.id, this.currentRow.id, this.execTime, mode).then(response => {
1251 1196
             if (response.data.state == 0) {
1252 1197
               this.$message.error(response.data.msg)
@@ -1311,6 +1256,19 @@
1311 1256
           return false
1312 1257
         }
1313 1258
         let mode = '1'
1259
+        
1260
+       if(this.src_type == ""){
1261
+          this.form.way = 0
1262
+          this.form.drug_id = 0
1263
+          this.form.drug_name_id = 0
1264
+       }
1265
+
1266
+       if(this.src_type == 2){ //自备药
1267
+          var arr = this.form.advice_name.split("(自备药)")
1268
+          this.form.advice_name = arr[0]
1269
+       }
1270
+
1271
+        console.log("新增医嘱子药",this.form)
1314 1272
        
1315 1273
         CreateDoctorAdvice(this.patient.id, this.form, mode)
1316 1274
           .then(response => {
@@ -1407,7 +1365,10 @@
1407 1365
           execution_frequency: this.currentRow.execution_frequency,
1408 1366
           advice_doctor: '',
1409 1367
           remark: '',
1410
-          parent_id: this.currentRow.id
1368
+          parent_id: this.currentRow.id,
1369
+          drug_id:0,
1370
+          drug_name_id:0,
1371
+          way:0,
1411 1372
         }
1412 1373
       }
1413 1374
       ,
@@ -1483,9 +1444,9 @@
1483 1444
           advice_doctor: row.advice_doctor,
1484 1445
           remark: row.remark,
1485 1446
           parent_id: row.parent_id,
1486
-          drug_id:"",
1487
-          way:"",
1488
-          drug_name_id:"",
1447
+          drug_id:0,
1448
+          way:0,
1449
+          drug_name_id:0,
1489 1450
         }
1490 1451
       }
1491 1452
       ,
@@ -1616,6 +1577,7 @@
1616 1577
       }
1617 1578
       ,
1618 1579
       execAdvice() {
1580
+        
1619 1581
         if (this.is_has_exce == false) {
1620 1582
           this.$message.error('你没有执行医嘱的权限')
1621 1583
           return false
@@ -2071,13 +2033,14 @@
2071 2033
       }
2072 2034
       ,
2073 2035
       cellMouseEnter: function(row, column, event) {
2036
+        console.log("数据是",row)
2074 2037
         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
-        })
2038
+        // this.groupSelectRow = row
2039
+        // this.sameRowArr.forEach((arr, i) => {
2040
+        //   if (arr.indexOf(row.index) != -1) {
2041
+        //     this.hoverOrderArr = arr
2042
+        //   }
2043
+        // })
2081 2044
       }
2082 2045
       ,
2083 2046
       cellMouseLeave: function(row, column, cell, event) {
@@ -2196,17 +2159,22 @@
2196 2159
       }
2197 2160
       ,
2198 2161
       handleCurrentChange(row) {
2199
-        // this.currentRow = row;
2162
+
2163
+        this.currentRow = row;
2200 2164
         // this.groupSelectRow = row;
2201 2165
         // this.sameRowArr.forEach((arr, i) => {
2202 2166
         //   if (arr.indexOf(row.index) != -1) {
2203 2167
         //     this.hoverOrderArr = arr;
2204 2168
         //   }
2205 2169
         // });
2170
+      },
2171
+
2172
+      handleSelect1(){
2173
+
2206 2174
       }
2207 2175
       ,
2208 2176
       objectSpanMethod({ row, column, rowIndex, columnIndex }) {
2209
-        // console.log('columnIndex', columnIndex)
2177
+     
2210 2178
         if (columnIndex === 0) {
2211 2179
           if (rowIndex % 2 === 0) {
2212 2180
             return {
@@ -2355,6 +2323,7 @@
2355 2323
                 obj.type = 2
2356 2324
                 obj.custom_id = this.rand(10000000, 99999999)
2357 2325
                 obj.drug_specs = medicalList[i].drug_specs
2326
+                console.log("222",this.all_drug)
2358 2327
                 this.all_drug.push(obj)
2359 2328
               }
2360 2329
             }
@@ -2391,6 +2360,7 @@
2391 2360
                 obj.custom_id = this.rand(10000000, 99999999)
2392 2361
                 obj.drug_specs = base_drug_list[i].drug_specs
2393 2362
                 this.all_drug.push(obj)
2363
+                console.log("2222",this.all_drug)
2394 2364
               }
2395 2365
             }
2396 2366
         })
@@ -2407,6 +2377,7 @@
2407 2377
     },
2408 2378
     changeDrugDesc(name) {
2409 2379
         this.current_drug_spec = name
2380
+         console.log("999",this.drugSpec)
2410 2381
         for (let i = 0; i < this.drugSpec.length; i++) {
2411 2382
           if (this.drugSpec[i].drug_spec == name) {
2412 2383
             this.form.advice_desc = this.drugSpec[i].drug_spec
@@ -2418,8 +2389,11 @@
2418 2389
             this.src_type = this.drugSpec[i].type
2419 2390
             this.form.drug_id = this.drugSpec[i].id
2420 2391
             this.form.way = this.drugSpec[i].type
2392
+
2393
+            this.form.drug_spec_unit = this.drugSpec[i].min_unit
2394
+            this.form.prescribing_number_unit = this.drugSpec[i].min_unit
2395
+            this.form.single_dose_unit = this.drugSpec[i].min_unit
2421 2396
             if(this.drugSpec[i].drug_name_id){
2422
-              console.log("22222",this.drugSpec[i].drug_name_id)
2423 2397
                this.form.drug_name_id = this.drugSpec[i].drug_name_id
2424 2398
             }else{
2425 2399
               this.form.drug_name_id = 0
@@ -2462,6 +2436,9 @@
2462 2436
         console.log('results',results)
2463 2437
         cb(results);
2464 2438
       },
2439
+     handleSelect(){
2440
+
2441
+     }
2465 2442
     },
2466 2443
     created() {
2467 2444
       var date = this.$route.query && this.$route.query.date

+ 30 - 52
src/xt_pages/dialysis/details/dialog/adviceDialog/AddGroupAdvice.vue View File

@@ -370,24 +370,6 @@
370 370
         <el-row>
371 371
           <el-col :span="24">
372 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 373
              <el-autocomplete
392 374
                 style="width:100%;"
393 375
                 class="inline-input"
@@ -407,30 +389,10 @@
407 389
         </el-row>
408 390
         <el-row>
409 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 393
             <el-form-item label="药品规格 :" prop="advice_desc">
414 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 396
                 <el-autocomplete
435 397
                   style="width:100px;"
436 398
                   class="inline-input"
@@ -743,11 +705,18 @@ export default {
743 705
           
744 706
           console.log("88888888",submitForm)
745 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 710
              for(let index=0;index<submitForm.adviceNames.length;index++){
750 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 720
                    if(submitForm.adviceNames[index].drug_id == this.medicals[i].drug_name_id){
752 721
                       submitForm.adviceNames[index].way = 2
753 722
                       submitForm.adviceNames[index].drug_name_id = this.medicals[i].drug_name_id
@@ -756,7 +725,7 @@ export default {
756 725
              }
757 726
           }
758 727
           console.log("2222",submitForm)
759
-         
728
+        
760 729
           CreateGroupAdvice(this.patientID, 0, submitForm, mode).then(
761 730
             response => {
762 731
               if (response.data.state == 0) {
@@ -1312,7 +1281,7 @@ export default {
1312 1281
                   parent_row: parentRow,
1313 1282
                   row_key: thisRowKey
1314 1283
                 };
1315
-                conosle.log("item======",child)
1284
+                
1316 1285
                 item.children.push(child);
1317 1286
                 this.allSelectedTemplate.unshift(child);
1318 1287
               }
@@ -1475,7 +1444,6 @@ export default {
1475 1444
       this.templateFormVisible = true;
1476 1445
     },
1477 1446
     selectGroupAdvice(row) {
1478
-      console.log("row-----",row)
1479 1447
       this.groupSelectRow = row;
1480 1448
     },
1481 1449
     groupClassName({ row, rowIndex }) {
@@ -1620,10 +1588,11 @@ export default {
1620 1588
                 this.all_drug.push(obj)
1621 1589
 
1622 1590
               }
1591
+
1623 1592
               this.private_drug_config = response.data.data.private_drug_config
1624 1593
               this.medicals = medicalList
1625 1594
             }   
1626
-            console.log("-======",this.all_drug)
1595
+           
1627 1596
         })
1628 1597
        
1629 1598
     },
@@ -1638,20 +1607,22 @@ export default {
1638 1607
        }
1639 1608
     },
1640 1609
     changeDrugDesc(name) {
1641
-      console.log("-----",this.drugSpec)
1642 1610
         this.current_drug_spec = name
1643 1611
         for (let i = 0; i < this.drugSpec.length; i++) {
1644 1612
           if (this.drugSpec[i].drug_spec == name) {
1645 1613
             this.nameForm.advice_desc = this.drugSpec[i].drug_spec
1646 1614
             this.nameForm.prescribing_number = this.drugSpec[i].prescribing_number.toString()
1647 1615
             this.nameForm.single_dose = this.drugSpec[i].single_dose.toString()
1616
+
1648 1617
             this.nameForm.delivery_way = this.drugSpec[i].delivery_way.toString()
1649 1618
             this.nameForm.execution_frequency = this.drugSpec[i].execution_frequency.toString()
1650 1619
             this.drug_id = this.drugSpec[i].id
1651 1620
             this.src_type = this.drugSpec[i].type
1652 1621
             this.nameForm.drug_id = this.drugSpec[i].id
1653 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 1626
             if(this.drugSpec[i].drug_name_id){
1656 1627
                this.nameForm.drug_name_id = this.drugSpec[i].drug_name_id
1657 1628
             }else{
@@ -1670,7 +1641,7 @@ export default {
1670 1641
         })
1671 1642
         var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
1672 1643
         // 调用 callback 返回建议列表的数据
1673
-        console.log('results',results)
1644
+       
1674 1645
         cb(results);
1675 1646
      },
1676 1647
 
@@ -1681,7 +1652,7 @@ export default {
1681 1652
      },
1682 1653
 
1683 1654
      querySearch1(queryString, cb) {
1684
-        console.log('queryString',queryString)
1655
+      
1685 1656
         var restaurants = this.drugSpec;
1686 1657
          console.log(restaurants)
1687 1658
         restaurants.map(item => {
@@ -1689,9 +1660,16 @@ export default {
1689 1660
         })
1690 1661
         var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
1691 1662
         // 调用 callback 返回建议列表的数据
1692
-        console.log('results',results)
1663
+       
1693 1664
         cb(results);
1694 1665
       },
1666
+
1667
+      handleSelect(){
1668
+
1669
+      },
1670
+      handleSelect1(){
1671
+
1672
+      }
1695 1673
   },
1696 1674
   watch: {
1697 1675
     "selectedTemp.list": function() {

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

@@ -210,7 +210,8 @@
210 210
         }
211 211
       }, changeGoodInfoTableData: function(val) {
212 212
         console.log(val)
213
-      }, changeAllGoodInfoTableData: function(selection) {
213
+      },
214
+       changeAllGoodInfoTableData: function(selection) {
214 215
         var goodInfos = this.propForm.goods[this.table_current_index].drug_specs
215 216
         if (selection.length > 0) {
216 217
           for (let y = 0; y < goodInfos.length; y++) {
@@ -245,9 +246,6 @@
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,7 +9,7 @@
9 9
             <div style="width:200px;">
10 10
               <el-table :data="tableData" border style="width: 100%;" height="300" :row-style="{ color: '#303133' }" 
11 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 13
                     <el-table-column align="center" prop="name" label="药品名称">
14 14
                         <template slot-scope="scope">
15 15
                            {{scope.row.drug_name}}
@@ -17,11 +17,18 @@
17 17
                     </el-table-column>
18 18
                 </el-table>
19 19
             </div>
20
+
21
+
20 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 32
                         <template slot-scope="scope">{{scope.row.drug_spec}}</template>
26 33
                     </el-table-column>
27 34
                 </el-table>
@@ -47,7 +54,9 @@ export default {
47 54
             currentRow:"",
48 55
             tableDatatwo:[],
49 56
             patient_id:0,
50
-            medicineData:[]
57
+            medicineData:[],
58
+            standList:[],
59
+            table_current_index:-1,
51 60
         }
52 61
     },
53 62
     methods:{
@@ -79,40 +88,98 @@ export default {
79 88
              if(response.data.state == 1){
80 89
                var rullername =  response.data.data.rullerName
81 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 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 176
              this.$message.error("请添加药品规格")
108 177
              return
109 178
           }
110 179
           const params = {
111 180
              patient_id:this.patient_id,
112
-             medicineData:this.medicineData
181
+             medicineData:this.multipleSelection
113 182
           }
114
-         console.log("params----",params)
115
-       
116 183
          SaveSelfMedicines(params).then(response=>{
117 184
              if(response.data.state == 1){
118 185
                 var msg = response.data.data.msg
@@ -123,7 +190,7 @@ export default {
123 190
                 this.$message.error("药品名称规格已存在")
124 191
              }
125 192
            })   
126
-        }
193
+        },
127 194
     },
128 195
   created(){
129 196
        //获取所有药品名称

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

@@ -46,7 +46,8 @@
46 46
                 <div style="width:160px;">
47 47
                     <div class="tablesTitle">患者列表</div>
48 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 51
                         <el-table-column align="center" prop="dialysis_no" label="透析号" width="70">
51 52
                             <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
52 53
                         </el-table-column>

+ 4 - 1
src/xt_pages/user/components/EditGroupAdvice.vue View File

@@ -2489,7 +2489,7 @@ export default {
2489 2489
                 obj.custom_id = this.rand(10000000, 99999999)
2490 2490
                 obj.drug_specs = base_drug_list[i].drug_specs
2491 2491
                 this.all_drug.push(obj)
2492
-                console.log("中2222222222222222222",this.all_drug)
2492
+                // console.log("中2222222222222222222",this.all_drug)
2493 2493
               }
2494 2494
             }   
2495 2495
         })
@@ -2520,6 +2520,9 @@ export default {
2520 2520
             this.nameForm.way = this.drugSpec[i].type
2521 2521
           }
2522 2522
         }
2523
+      },
2524
+      handleSelect1(){
2525
+        
2523 2526
       }
2524 2527
   },
2525 2528
   watch: {

+ 155 - 67
src/xt_pages/user/doctorAdvice.vue View File

@@ -945,25 +945,15 @@
945 945
           <el-row>
946 946
             <el-col :span="10">
947 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 957
               <!-- <div style="color:red;font-size:12px;">
968 958
                 库存不足50
969 959
               </div> -->
@@ -972,25 +962,17 @@
972 962
 
973 963
             <el-col :span="14">
974 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 977
                 </el-col>
996 978
                 <el-col class="line" :span="2">&nbsp;</el-col>
@@ -1176,6 +1158,8 @@
1176 1158
         ref="editGroupForm"
1177 1159
       ></edit-group-advice>
1178 1160
 
1161
+
1162
+    <!-- 新增子药 -->
1179 1163
       <el-dialog
1180 1164
         :title="dialogTitle"
1181 1165
         :visible.sync="dialogFormVisible"
@@ -1236,25 +1220,32 @@
1236 1220
             </el-col>
1237 1221
             <el-col :span="12">
1238 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 1232
               </el-form-item>
1252 1233
             </el-col>
1253 1234
 
1254 1235
             <el-col :span="12">
1255 1236
               <el-form-item label="药品规格 :" prop="advice_desc">
1256 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 1249
                 </el-col>
1259 1250
                 <el-col class="line" :span="1">&nbsp;</el-col>
1260 1251
                 <el-col :span="14">
@@ -2090,7 +2081,10 @@ export default {
2090 2081
         execution_frequency: "",
2091 2082
         advice_doctor: "",
2092 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 2089
       nameForm: {
2096 2090
         advice_name: "",
@@ -2234,7 +2228,18 @@ export default {
2234 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
+          }
2237 2241
 
2242
+       
2238 2243
           EditNewDoctorAdvice(
2239 2244
             this.patientID,
2240 2245
             this.adviceForm.id,
@@ -2301,9 +2306,7 @@ export default {
2301 2306
             remark: this.groupForm.remark,
2302 2307
             parent_id: this.groupForm.parent_id,
2303 2308
           };
2304
-          console.log("22222",submitForm)
2305
-          console.log("33333",this.private_drug_config.drug_start)
2306
-          console.log("44444",this.medicals)
2309
+        
2307 2310
          
2308 2311
           var adviceNames = [];
2309 2312
           for (const index in this.groupForm.adviceNames) {
@@ -2316,19 +2319,16 @@ export default {
2316 2319
           }
2317 2320
           submitForm.adviceNames = adviceNames;
2318 2321
 
2319
-
2320
-         
2321
-
2322 2322
           let mode = "";
2323 2323
           if (this.groupForm.advice_type == 1) {
2324 2324
             mode = "1-2";
2325 2325
           } else if (this.groupForm.advice_type == 3) {
2326 2326
             mode = "1-1";
2327 2327
           }
2328
-        console.log("22222222",this.medicals)
2329
-        console.log("3333333",submitForm)
2330
-      
2331
-        if(this.private_drug_config.drug_start == 1){
2328
+        console.log("长期医嘱2222",this.medicals)
2329
+        console.log("长期医嘱3333",submitForm)
2330
+       
2331
+        if(this.private_drug_config != null&&this.private_drug_config.drug_start == 1){
2332 2332
               for(let index=0;index<submitForm.adviceNames.length;index++){
2333 2333
                   for(let i=0;i<this.medicals.length;i++){
2334 2334
                     if(submitForm.adviceNames[index].drug_id == this.medicals[i].drug_name_id){
@@ -2421,7 +2421,18 @@ export default {
2421 2421
             //临时
2422 2422
             mode = "1-1";
2423 2423
           }
2424
+          if(this.src_type == ""){
2425
+              this.adviceForm.way = 0
2426
+              this.adviceForm.drug_id = 0
2427
+              this.adviceForm.drug_name_id = 0
2428
+          }
2424 2429
 
2430
+          if(this.src_type == 2){ //自备药
2431
+              var arr = this.adviceForm.advice_name.split("(自备药)")
2432
+              this.adviceForm.advice_name = arr[0]
2433
+          }
2434
+          console.log("222222",this.adviceForm)
2435
+         
2425 2436
           CreateNewDoctorAdvice(this.patientID, this.adviceForm, mode).then(
2426 2437
             response => {
2427 2438
               if (response.data.state == 0) {
@@ -2688,8 +2699,8 @@ export default {
2688 2699
           id: 0,
2689 2700
           children: [],
2690 2701
           parent_row: 0,
2691
-          way:"",
2692
-          drug_id:'',
2702
+          way:0,
2703
+          drug_id:0,
2693 2704
           drug_name_id:0,
2694 2705
         };
2695 2706
         this.nameFormTitle = "新增医嘱内容";
@@ -3023,7 +3034,7 @@ export default {
3023 3034
           row_key: this.rowKey,
3024 3035
           table: []
3025 3036
         };
3026
-        console.log("itme-----------",item)
3037
+      
3027 3038
         if (item.id in childMap) {
3028 3039
           for (const key in childMap[item.id]) {
3029 3040
             this.rowKey++;
@@ -4040,7 +4051,7 @@ export default {
4040 4051
           var arr = this.nameForm.advice_name.split("(自备药)")
4041 4052
           this.nameForm.advice_name = arr[0]
4042 4053
        }
4043
-      
4054
+      console.log("医嘱2222",this.nameForm)
4044 4055
       var _this = this;
4045 4056
       this.$refs[formName].validate(valid => {
4046 4057
         if (valid) {
@@ -4492,6 +4503,40 @@ export default {
4492 4503
           
4493 4504
       })
4494 4505
     },
4506
+    changeDrugNameTwo(name){
4507
+       this.current_drug_name = name
4508
+       this.adviceForm.advice_desc = ''
4509
+      this.drugSpec = []
4510
+      for (let i = 0; i < this.all_drug.length; i++) {
4511
+        if (this.all_drug[i].drug_name == name) {
4512
+            this.drugSpec = this.all_drug[i].drug_specs
4513
+          }
4514
+       }   
4515
+    },
4516
+   changeDrugDescTwo(name){
4517
+      this.current_drug_spec = name
4518
+        for (let i = 0; i < this.drugSpec.length; i++) {
4519
+          if (this.drugSpec[i].drug_spec == name) {
4520
+            this.adviceForm.advice_desc = this.drugSpec[i].drug_spec
4521
+            this.adviceForm.prescribing_number = this.drugSpec[i].prescribing_number.toString()
4522
+            this.adviceForm.single_dose = this.drugSpec[i].single_dose.toString()
4523
+            this.adviceForm.delivery_way = this.drugSpec[i].delivery_way.toString()
4524
+            this.adviceForm.execution_frequency = this.drugSpec[i].execution_frequency.toString()
4525
+            this.drug_id = this.drugSpec[i].id
4526
+            this.src_type = this.drugSpec[i].type
4527
+            this.adviceForm.drug_id = this.drugSpec[i].id
4528
+            this.adviceForm.way = this.drugSpec[i].type
4529
+            this.adviceForm.single_dose_unit = this.drugSpec[i].min_unit
4530
+            this.adviceForm.drug_spec_unit = this.drugSpec[i].min_unit
4531
+            this.adviceForm.prescribing_number_unit = this.drugSpec[i].min_unit
4532
+            if(this.drugSpec[i].drug_name_id){
4533
+               this.adviceForm.drug_name_id = this.drugSpec[i].drug_name_id
4534
+            }else{
4535
+              this.adviceForm.drug_name_id = 0
4536
+            }
4537
+          }
4538
+        }
4539
+   },
4495 4540
    changeDrugName(name){
4496 4541
        this.current_drug_name = name
4497 4542
        this.nameForm.advice_desc = ''
@@ -4515,8 +4560,13 @@ export default {
4515 4560
             this.src_type = this.drugSpec[i].type
4516 4561
             this.nameForm.drug_id = this.drugSpec[i].id
4517 4562
             this.nameForm.way = this.drugSpec[i].type
4563
+            this.nameForm.single_dose_unit = this.drugSpec[i].min_unit
4564
+            this.nameForm.drug_spec_unit = this.drugSpec[i].min_unit
4565
+            this.nameForm.prescribing_number_unit = this.drugSpec[i].min_unit
4518 4566
             if(this.drugSpec[i].drug_name_id){
4519
-               this.nameForm.drug_name_id = 0
4567
+               this.nameForm.drug_name_id = this.drugSpec[i].drug_name_id
4568
+            }else{
4569
+              this.nameForm.drug_name_id = 0
4520 4570
             }
4521 4571
           }
4522 4572
         }
@@ -4524,6 +4574,44 @@ export default {
4524 4574
     rand(min, max) {
4525 4575
         return Math.floor(Math.random() * (max - min)) + min;
4526 4576
     },
4577
+
4578
+     querySearch(queryString, cb) {
4579
+        console.log('queryString',queryString)
4580
+        var restaurants = this.all_drug;
4581
+        restaurants.map(item => {
4582
+          item.value = item.drug_name
4583
+        })
4584
+        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
4585
+        // 调用 callback 返回建议列表的数据
4586
+        console.log('results',results)
4587
+        cb(results);
4588
+     },
4589
+
4590
+     createFilter(queryString) {
4591
+        return (restaurant) => {
4592
+          return (restaurant.drug_name.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
4593
+        };
4594
+     },
4595
+
4596
+     querySearch1(queryString, cb) {
4597
+        console.log('queryString',queryString)
4598
+        var restaurants = this.drugSpec;
4599
+         console.log(restaurants)
4600
+        restaurants.map(item => {
4601
+          item.value = item.drug_spec
4602
+        })
4603
+        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
4604
+        // 调用 callback 返回建议列表的数据
4605
+        console.log('results',results)
4606
+        cb(results);
4607
+      },
4608
+
4609
+      handleSelect1(){
4610
+
4611
+      },
4612
+      handleSelect(){
4613
+
4614
+      }
4527 4615
   },
4528 4616
   watch: {
4529 4617
     adviceTableData: function() {