XMLWAN пре 4 година
родитељ
комит
7cec3a2e8c

+ 4 - 2
src/api/advice.js Прегледај датотеку

@@ -187,9 +187,10 @@ export function CreateAdviceTemplate(data) {
187 187
   });
188 188
 }
189 189
 
190
-export function UpdateAdviceTemplate(id, data) {
190
+export function UpdateAdviceTemplate(id, data,drug_id) {
191
+  
191 192
   return request({
192
-    url: "/api/advicetemplate/update?id=" + id,
193
+    url: "/api/advicetemplate/update?id=" + id+"&drug_id="+drug_id,
193 194
     method: "put",
194 195
     data: data
195 196
   });
@@ -285,6 +286,7 @@ export function DeleteParentAdviceTemplate(id) {
285 286
 }
286 287
 
287 288
 export function CreateSubAdvice(params) {
289
+  
288 290
   return request({
289 291
     url: "/api/subadvice/create",
290 292
     method: "post",

+ 351 - 36
src/xt_pages/data/druguseTemplate.vue Прегледај датотеку

@@ -45,6 +45,9 @@
45 45
               >{{$t('table.add')}}
46 46
               </el-button>
47 47
             </div>
48
+
49
+
50
+
48 51
             <el-table
49 52
               :data="adviceTemplates"
50 53
               border
@@ -297,7 +300,7 @@
297 300
                 <el-button type="primary" @click="submitTableTemplate('form')">保 存</el-button>
298 301
               </div>
299 302
             </el-dialog>
300
-            <el-dialog :title="dialogTitle" :visible.sync="templateFormVisible" width="700px">
303
+            <el-dialog :title="dialogTitle" :visible.sync="templateFormVisible" width="854px">
301 304
               <el-form
302 305
                 ref="templateForm"
303 306
                 :rules="templateRules"
@@ -305,19 +308,52 @@
305 308
                 label-width="90px"
306 309
               >
307 310
 
308
-                <el-row>
309
-                  <el-col :span="12">
310
-                    <el-form-item label="医嘱内容 :" required prop="advice_name">
311
-                      <el-input v-model="templateForm.advice_name"></el-input>
311
+                <el-row >
312
+                  <el-col :span="24">
313
+                    <el-form-item label="医嘱内容:" required prop="advice_name">
314
+                      <!-- <el-input v-model="templateForm.advice_name"></el-input> -->
315
+
316
+                      <el-select
317
+                        v-model="templateForm.advice_name"
318
+                        filterable
319
+                        clearable
320
+                        allow-create
321
+                        placeholder="请选择(输入可搜索)"
322
+                        style="width:200px"
323
+                        @change="changeDrugName"
324
+                    >
325
+                      <el-option
326
+                        v-for="(item,index) in all_drug"
327
+                        :key="index"
328
+                        :label="item.drug_name"
329
+                        :value="item.drug_name"
330
+                      ></el-option>
331
+                     </el-select>
312 332
                     </el-form-item>
313 333
                   </el-col>
314 334
 
315 335
 
316 336
 
317
-                  <el-col :span="12">
337
+                  <el-col :span="15">
318 338
                     <el-form-item label="药品规格 :" prop="advice_desc">
319 339
                       <el-col :span="8">
320
-                        <el-input v-model="templateForm.advice_desc"></el-input>
340
+                        <!-- <el-input v-model="templateForm.advice_desc"></el-input> -->
341
+                         <el-select
342
+                          v-model="templateForm.advice_desc"
343
+                          filterable
344
+                          clearable
345
+                          allow-create
346
+                          placeholder="请选择(输入可搜索)"
347
+                          style="width:150px"
348
+                          @change="changeDrugDesc"
349
+                        >
350
+                        <el-option
351
+                          v-for="item in drugSpec"
352
+                          :key="item.id"
353
+                          :label="item.drug_spec"
354
+                          :value="item.drug_spec"
355
+                        ></el-option>
356
+                        </el-select>
321 357
                       </el-col>
322 358
                       <el-col class="line" :span="2">&nbsp;</el-col>
323 359
                       <el-col :span="14">
@@ -468,7 +504,7 @@
468 504
             <!--TODO-->
469 505
 
470 506
 
471
-            <el-dialog :title="editDialogTitle" :visible.sync="templateEditFormVisible" width="700px">
507
+            <el-dialog :title="editDialogTitle" :visible.sync="templateEditFormVisible" width="854px">
472 508
               <el-form
473 509
                 ref="templateFormEdit"
474 510
                 :rules="templateEditRules"
@@ -476,16 +512,48 @@
476 512
                 label-width="90px"
477 513
               >
478 514
                 <el-row>
479
-                  <el-col :span="12">
515
+                  <el-col :span="24">
480 516
                     <el-form-item :label="edit_advice_name" required prop="advice_name">
481
-                      <el-input v-model="templateFormEdit.advice_name"></el-input>
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>
482 534
                     </el-form-item>
483 535
                   </el-col>
484
-                  <el-col :span="12">
536
+                  <el-col :span="15">
485 537
 
486 538
                     <el-form-item label="药品规格 :" prop="advice_desc">
487 539
                       <el-col :span="8">
488
-                        <el-input v-model="templateFormEdit.advice_desc"></el-input>
540
+                        <!-- <el-input v-model="templateFormEdit.advice_desc"></el-input> -->
541
+                           <el-select
542
+                              v-model="templateFormEdit.advice_desc"
543
+                              filterable
544
+                              clearable
545
+                              allow-create
546
+                              placeholder="请选择(输入可搜索)"
547
+                              style="width:150px"
548
+                              @change="changeDrugDescTwo"
549
+                            >
550
+                              <el-option
551
+                                v-for="item in drugSpec"
552
+                                :key="item.id"
553
+                                :label="item.drug_spec"
554
+                                :value="item.drug_spec"
555
+                              ></el-option>
556
+                           </el-select>
489 557
                       </el-col>
490 558
                       <el-col class="line" :span="1">&nbsp;</el-col>
491 559
                       <el-col :span="14">
@@ -708,7 +776,7 @@
708 776
             </el-dialog>
709 777
 
710 778
 
711
-            <el-dialog title="新增医嘱" :visible.sync="templateFormTwoVisible" width="700px">
779
+            <el-dialog title="新增医嘱" :visible.sync="templateFormTwoVisible" width="854px">
712 780
               <el-form
713 781
                 ref="templateForm"
714 782
                 :rules="templateEditRules"
@@ -716,16 +784,48 @@
716 784
                 label-width="90px"
717 785
               >
718 786
                 <el-row>
719
-                  <el-col :span="12">
787
+                  <el-col :span="24">
720 788
                     <el-form-item label="医嘱内容 :" required prop="advice_name">
721
-                      <el-input v-model="templateForm.advice_name"></el-input>
789
+                      <!-- <el-input v-model="templateForm.advice_name"></el-input> -->
790
+                    <el-select
791
+                        v-model="templateForm.advice_name"
792
+                        filterable
793
+                        clearable
794
+                        allow-create
795
+                        placeholder="请选择(输入可搜索)"
796
+                        style="width:200px"
797
+                        @change="changeDrugName"
798
+                    >
799
+                      <el-option
800
+                        v-for="(item,index) in all_drug"
801
+                        :key="index"
802
+                        :label="item.drug_name"
803
+                        :value="item.drug_name"
804
+                      ></el-option>
805
+                     </el-select>
722 806
                     </el-form-item>
723 807
                   </el-col>
724
-                  <el-col :span="12">
808
+                  <el-col :span="15">
725 809
 
726 810
                     <el-form-item label="药品规格 :" prop="advice_desc">
727 811
                       <el-col :span="9">
728
-                        <el-input v-model="templateForm.advice_desc"></el-input>
812
+                        <!-- <el-input v-model="templateForm.advice_desc"></el-input> -->
813
+                      <el-select
814
+                          v-model="templateForm.advice_desc"
815
+                          filterable
816
+                          clearable
817
+                          allow-create
818
+                          placeholder="请选择(输入可搜索)"
819
+                          style="width:150px"
820
+                          @change="changeDrugDesc"
821
+                        >
822
+                        <el-option
823
+                          v-for="item in drugSpec"
824
+                          :key="item.id"
825
+                          :label="item.drug_spec"
826
+                          :value="item.drug_spec"
827
+                        ></el-option>
828
+                        </el-select>
729 829
                       </el-col>
730 830
                       <el-col class="line" :span="1">&nbsp;</el-col>
731 831
                       <el-col :span="14">
@@ -1202,7 +1302,7 @@
1202 1302
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
1203 1303
 
1204 1304
   import { getDataConfig } from '@/utils/data'
1205
-
1305
+  import { getSelfMedicalList } from "@/api/drug/drug"
1206 1306
   export default {
1207 1307
     name: 'tab',
1208 1308
     components: { BreadCrumb },
@@ -1295,7 +1395,9 @@
1295 1395
           prescribing_number_unit: '',
1296 1396
           delivery_way: '',
1297 1397
           execution_frequency: '',
1298
-          id: 0
1398
+          id: 0,
1399
+          drug_id:"",
1400
+          way:""
1299 1401
         },
1300 1402
         dialogConfigVisible:false,
1301 1403
         templateFormEdit: {
@@ -1354,7 +1456,15 @@
1354 1456
           { lable: 14, name: '外用溶液' },
1355 1457
           { lable: 15, name: '软膏剂' },
1356 1458
           { lable: 16, name: '胶剂' }
1357
-        ]
1459
+        ],
1460
+         medicals:[],
1461
+         drugSpec:[],
1462
+         all_drug:[],
1463
+         current_drug_name:"",
1464
+         current_drug_spec: "",
1465
+         drug_id: 0,
1466
+         src_type:"",
1467
+         way:""
1358 1468
       }
1359 1469
     },
1360 1470
     created() {
@@ -1362,6 +1472,9 @@
1362 1472
       this.unitsOption = getDataConfig('hemodialysis', 'units')
1363 1473
       this.getDoctorAdviceConfig()
1364 1474
       this.getDoctorInitConfig()
1475
+
1476
+       //获取自备药
1477
+      this.getSelfMedicalList()
1365 1478
     },
1366 1479
     methods: {
1367 1480
       initAdvice(){
@@ -1493,7 +1606,8 @@
1493 1606
       },
1494 1607
       onRowClick(row, event, column) {
1495 1608
         this.table_current_index = row.index
1496
-      }, modifyRecordAction: function() {
1609
+      }, 
1610
+      modifyRecordAction: function() {
1497 1611
         if (this.table_current_index == -1) {
1498 1612
           this.$message.error('请选择一条医嘱记录')
1499 1613
           return
@@ -1522,7 +1636,10 @@
1522 1636
           this.templateTableVisible = false
1523 1637
         }).catch(() => {
1524 1638
         })
1525
-      }, submitTableTemplate(formName) {
1639
+      }, 
1640
+
1641
+      //添加医嘱模版
1642
+      submitTableTemplate(formName) {
1526 1643
         if (this.adviceTableData.length <= 0) {
1527 1644
           this.$message.error('至少添加一条医嘱信息')
1528 1645
           return
@@ -1531,9 +1648,12 @@
1531 1648
         const params = {
1532 1649
           'data': this.adviceTableData
1533 1650
         }
1534
-        // this.form.name =  encodeURIComponent(this.form.name)
1651
+      
1535 1652
         let name = encodeURIComponent(this.form.name)
1653
+        console.log("params",params)
1654
+     
1536 1655
         postAdviceTemplate(params, name, this.form.advice_type).then(response => {
1656
+
1537 1657
           if (response.data.state == 0) {
1538 1658
             this.$message.error(response.data.msg)
1539 1659
             return false
@@ -1660,6 +1780,18 @@
1660 1780
         })
1661 1781
       },
1662 1782
       submitTemplate(formName) {
1783
+
1784
+        
1785
+        if(this.src_type == ""){
1786
+            this.templateForm.way = 0
1787
+            this.templateForm.drug_id = 0
1788
+        }
1789
+
1790
+        if(this.src_type == 2){ //自备药
1791
+            var arr = this.templateForm.advice_name.split("(自备药)")
1792
+            this.templateForm.advice_name = arr[0]
1793
+        }
1794
+        
1663 1795
         this.$refs[formName].validate(valid => {
1664 1796
           this.templateForm.single_dose = parseFloat(this.templateForm.single_dose)
1665 1797
           this.templateForm.prescribing_number = parseFloat(this.templateForm.prescribing_number)
@@ -1685,6 +1817,8 @@
1685 1817
             templateFormTwo.delivery_way = this.templateForm.delivery_way
1686 1818
             templateFormTwo.execution_frequency = this.templateForm.execution_frequency
1687 1819
             templateFormTwo.parent_id = this.parent_id
1820
+            templateFormTwo.drug_id = this.templateForm.drug_id
1821
+            templateFormTwo.way   = this.templateForm.way
1688 1822
 
1689 1823
             if (this.isAddChild) {
1690 1824
               CreateSubAdvice(templateFormTwo).then(response => {
@@ -1739,6 +1873,8 @@
1739 1873
               templateFormTwo.delivery_way = this.templateForm.delivery_way
1740 1874
               templateFormTwo.execution_frequency = this.templateForm.execution_frequency
1741 1875
               templateFormTwo.parent_id = this.parent_id
1876
+              templateFormTwo.drug_id = this.templateForm.drug_id
1877
+              templateFormTwo.way  = this.templateForm.way
1742 1878
 
1743 1879
               if (this.templateForm.frequency_type == 1) {
1744 1880
                 templateFormTwo.frequency_type = this.templateForm.frequency_type
@@ -1783,6 +1919,9 @@
1783 1919
                     this.adviceTableData[i].frequency_type = templateFormTwo.frequency_type
1784 1920
                     this.adviceTableData[i].day_count = templateFormTwo.day_count
1785 1921
                     this.adviceTableData[i].weekdays = templateFormTwo.weekdays
1922
+                    this.adviceTableData[i].drug_id =  templateFormTwo.drug_id
1923
+                    this.adviceTableData[i].way   = templateFormTwo.way
1924
+                    
1786 1925
                   }
1787 1926
                 }
1788 1927
               } else {
@@ -1981,7 +2120,7 @@
1981 2120
                 object['template_id'] = response.data.data.advice_templates[i].id
1982 2121
                 this.adviceTemplates.push(object)
1983 2122
               }
1984
-
2123
+              
1985 2124
               // 非空模版的处理
1986 2125
               for (let y = 0; y < response.data.data.advice_templates[i].DoctorAdviceTemplate.length; y++) {
1987 2126
                 if (response.data.data.advice_templates[i].id == response.data.data.advice_templates[i].DoctorAdviceTemplate[y].template_id) {
@@ -2011,7 +2150,20 @@
2011 2150
       }, cancelEditHandle() {
2012 2151
         // this.templateTableVisible = true
2013 2152
         this.templateEditFormVisible = false
2014
-      }, submitEditTemplate(formName) {
2153
+      }, 
2154
+      
2155
+      //编辑医嘱
2156
+      submitEditTemplate(formName) {
2157
+         
2158
+         var drug_id = ""
2159
+         for(let i=0;i<this.all_drug.length;i++){
2160
+           if(this.templateFormEdit.advice_name == this.all_drug[i].drug_name){
2161
+              drug_id = this.all_drug[i].id
2162
+           }
2163
+         } 
2164
+        this.templateFormEdit.drug_id = drug_id
2165
+       
2166
+        
2015 2167
         this.$refs[formName].validate(valid => {
2016 2168
           this.templateFormEdit.single_dose = parseFloat(this.templateFormEdit.single_dose)
2017 2169
           this.templateFormEdit.prescribing_number = parseFloat(this.templateFormEdit.prescribing_number)
@@ -2040,8 +2192,8 @@
2040 2192
                 return s && s.trim()
2041 2193
               }).join(',')
2042 2194
             }
2043
-
2044
-            UpdateAdviceTemplate(this.templateFormEdit.id, this.templateFormEdit).then(
2195
+           
2196
+            UpdateAdviceTemplate(this.templateFormEdit.id, this.templateFormEdit,this.templateFormEdit.drug_id).then(
2045 2197
               response => {
2046 2198
                 if (response.data.state == 0) {
2047 2199
                   this.$message.error(response.data.msg)
@@ -2064,6 +2216,7 @@
2064 2216
                   this.adviceTemplates[this.currentIndex].day_count = template.day_count
2065 2217
                   this.adviceTemplates[this.currentIndex].week_days = template.week_days
2066 2218
                   this.adviceTemplates[this.currentIndex].frequency_type = template.frequency_type
2219
+                  // this.adviceTemplates[this.currentIndex].drug_id = template.drug_id
2067 2220
                   this.currentIndex = -1
2068 2221
                   return false
2069 2222
                 }
@@ -2156,10 +2309,13 @@
2156 2309
         this.table_current_index_two = row.index
2157 2310
       }, cancelHandleTwo() {
2158 2311
         this.templateFormTwoVisible = false
2159
-      }, submitTemplateTwo(formName) {
2312
+      }, 
2313
+      submitTemplateTwo(formName) {
2314
+       
2160 2315
         this.templateForm['template_id'] = this.current_template_id
2161 2316
         this.templateForm['advice_type'] = this.form.advice_type
2162
-
2317
+       
2318
+      
2163 2319
         if (this.templateForm.frequency_type == 1) {
2164 2320
           this.templateForm.day_count = 0
2165 2321
           this.templateForm.week_days = ''
@@ -2172,6 +2328,8 @@
2172 2328
             return s && s.trim()
2173 2329
           }).join(',')
2174 2330
         }
2331
+
2332
+        // 编辑创建医嘱模版
2175 2333
         CreateSingleAdviceTemplate(this.templateForm).then(response => {
2176 2334
           if (response.data.state == 0) {
2177 2335
             this.$message.error(response.data.msg)
@@ -2202,7 +2360,8 @@
2202 2360
         this.adviceTableDataTwo = []
2203 2361
       }, cancelEditHandleTwo() {
2204 2362
         this.templateEditFormTwoVisible = false
2205
-      }, submitEditTemplateTwo(formName) {
2363
+      }, 
2364
+      submitEditTemplateTwo(formName) {
2206 2365
         this.$refs[formName].validate(valid => {
2207 2366
           this.templateFormEdit.single_dose = parseFloat(this.templateFormEdit.single_dose)
2208 2367
           this.templateFormEdit.prescribing_number = parseFloat(this.templateFormEdit.prescribing_number)
@@ -2290,8 +2449,11 @@
2290 2449
         }
2291 2450
       }, cellMouseLeave: function(row, column, cell, event) {
2292 2451
         this.hoverOrderArr = []
2293
-      }, openEdit(index, row) {
2294
-        console.log(row)
2452
+      },
2453
+
2454
+      // 修改医嘱模版
2455
+       openEdit(index, row) {
2456
+        console.log("row22222",row)
2295 2457
         this.hoverOrderArr = []
2296 2458
         this.currentIndex = index
2297 2459
         this.templateFormEdit.drug_spec_unit = row.drug_spec_unit
@@ -2309,7 +2471,8 @@
2309 2471
         this.templateFormEdit.day_count = row.day_count
2310 2472
         this.templateFormEdit.frequency_type = row.frequency_type
2311 2473
         this.templateFormEdit.weekday = row.week_days.split(',')
2312
-
2474
+        this.templateFormEdit.drug_id = row.drug_id
2475
+        this.templateFormEdit.way  = row.way
2313 2476
         this.templateEditFormVisible = true
2314 2477
         if (row.parent_id > 0) {
2315 2478
           this.editDialogTitle = '编辑子药'
@@ -2318,7 +2481,8 @@
2318 2481
           this.editDialogTitle = '编辑医嘱'
2319 2482
           this.edit_advice_name = '医嘱内容'
2320 2483
         }
2321
-      }, openDelete(index, row) {
2484
+      }, 
2485
+      openDelete(index, row) {
2322 2486
         this.hoverOrderArr = []
2323 2487
 
2324 2488
         this.$confirm('删除记录', '是否删除该医嘱', {
@@ -2481,7 +2645,8 @@
2481 2645
           }
2482 2646
         })
2483 2647
         this.sameRowArr = sameRowArr
2484
-      }, handleUpdateAdviceTemplate(row, index) {
2648
+      },
2649
+       handleUpdateAdviceTemplate(row, index) {
2485 2650
         this.current_template_id = row.template_id
2486 2651
         this.current_template_name = row.name
2487 2652
         this.form.name = row.name
@@ -2493,11 +2658,14 @@
2493 2658
             this.adviceTableDataTwo.push(this.adviceTemplates[i])
2494 2659
           }
2495 2660
         }
2496
-      }, modifyTemplateName() {
2661
+      }, 
2662
+      modifyTemplateName() {
2497 2663
         const params = {
2498 2664
           template_name: this.form.name,
2499 2665
           template_id: this.current_template_id
2500 2666
         }
2667
+        console.log("params---",params)
2668
+        return 
2501 2669
         updateTemplateName(params).then(response => {
2502 2670
           if (response.data.state == 0) {
2503 2671
             this.$message.error(response.data.msg)
@@ -2534,6 +2702,153 @@
2534 2702
         })
2535 2703
 
2536 2704
       },
2705
+
2706
+      rand(min, max) {
2707
+        return Math.floor(Math.random() * (max - min)) + min;
2708
+     },
2709
+    //
2710
+    getSelfMedicalList(){
2711
+        const params = {
2712
+          patient_id:this.$route.query.patient_id
2713
+        }
2714
+      getSelfMedicalList(params).then(response=>{
2715
+         if (response.data.state == 1) {
2716
+            this.arr_drug = []
2717
+            var medicalList = response.data.data.private_drug_list
2718
+            var base_drug_list = response.data.data.base_drug_list
2719
+            var base_drug_cofig = response.data.data.base_drug_config
2720
+            var private_drug_cofig = response.data.data.private_drug_config
2721
+
2722
+
2723
+            if(private_drug_cofig != null&&private_drug_cofig.drug_start == 1) {
2724
+
2725
+              for (let i = 0; i < medicalList.length; i++) {
2726
+                if(medicalList[i].drug_specs != null) {
2727
+                  for (let a = 0; a < medicalList[i].drug_specs.length; a++) {
2728
+                    medicalList[i].drug_specs[a]['type'] = 2
2729
+                  }
2730
+                }
2731
+                let obj = {
2732
+                  drug_name: "",
2733
+                  drug_desc: "",
2734
+                  delivery_way: "",
2735
+                  execution_frequency: "",
2736
+                  single_dose: "",
2737
+                  single_dose_unit: "",
2738
+                  prescribing_number: "",
2739
+                  prescribing_number_unit: "",
2740
+                  type_id: "",
2741
+                  type: "",
2742
+                  custom_id: "",
2743
+                  drug_specs: [],
2744
+                  id:"",
2745
+                }
2746
+
2747
+                medicalList[i].drug_name = medicalList[i].drug_name + "(自备药)"
2748
+                obj.drug_name = medicalList[i].drug_name
2749
+                obj.delivery_way = medicalList[i].delivery_way
2750
+                obj.execution_frequency = medicalList[i].execution_frequency
2751
+                obj.single_dose = medicalList[i].single_dose
2752
+                obj.prescribing_number = medicalList[i].prescribing_number
2753
+                obj.type_id = medicalList[i].id
2754
+                obj.type = 2
2755
+                obj.custom_id = this.rand(10000000, 99999999)
2756
+                obj.drug_specs = medicalList[i].drug_specs
2757
+                obj.id = medicalList[i].id
2758
+                this.all_drug.push(obj)
2759
+              }
2760
+            }
2761
+
2762
+
2763
+            for (let i = 0; i < base_drug_list.length; i++) {
2764
+              if(base_drug_list[i].drug_specs != null) {
2765
+                for (let a = 0; a < base_drug_list[i].drug_specs.length; a++) {
2766
+                  base_drug_list[i].drug_specs[a]['type'] = 1
2767
+                }
2768
+              }
2769
+                let obj = {
2770
+                  drug_name: "",
2771
+                  drug_desc: "",
2772
+                  delivery_way: "",
2773
+                  execution_frequency: "",
2774
+                  single_dose: "",
2775
+                  single_dose_unit: "",
2776
+                  prescribing_number: "",
2777
+                  prescribing_number_unit: "",
2778
+                  type_id: "",
2779
+                  type: "",
2780
+                  custom_id: "",
2781
+                  drug_specs: [],
2782
+                  id:""
2783
+                }
2784
+
2785
+                obj.drug_name = base_drug_list[i].drug_name
2786
+                obj.delivery_way = base_drug_list[i].delivery_way
2787
+                obj.execution_frequency = base_drug_list[i].execution_frequency
2788
+                obj.single_dose = base_drug_list[i].single_dose
2789
+                obj.prescribing_number = base_drug_list[i].prescribing_number
2790
+                obj.type_id = base_drug_list[i].id
2791
+                obj.type = 1
2792
+                obj.custom_id = this.rand(10000000, 99999999)
2793
+                obj.drug_specs = base_drug_list[i].drug_specs
2794
+                obj.id = base_drug_list[i].id
2795
+                this.all_drug.push(obj)
2796
+              }
2797
+            }   
2798
+        })
2799
+       
2800
+    },
2801
+    changeDrugName(name){
2802
+       this.current_drug_name = name
2803
+       this.templateForm.advice_desc = ''
2804
+      this.drugSpec = []
2805
+      for (let i = 0; i < this.all_drug.length; i++) {
2806
+        if (this.all_drug[i].drug_name == name) {
2807
+            this.drugSpec = this.all_drug[i].drug_specs
2808
+          }
2809
+       }
2810
+    },
2811
+    changeDrugDesc(name) {
2812
+        this.current_drug_spec = name
2813
+        for (let i = 0; i < this.drugSpec.length; i++) {
2814
+          if (this.drugSpec[i].drug_spec == name) {
2815
+            this.templateForm.advice_desc = this.drugSpec[i].drug_spec
2816
+            this.templateForm.prescribing_number = this.drugSpec[i].prescribing_number.toString()
2817
+            this.templateForm.single_dose = this.drugSpec[i].single_dose.toString()
2818
+            this.templateForm.delivery_way = this.drugSpec[i].delivery_way.toString()
2819
+            this.templateForm.execution_frequency = this.drugSpec[i].execution_frequency.toString()
2820
+            this.drug_id = this.drugSpec[i].id
2821
+            this.src_type = this.drugSpec[i].type
2822
+            this.templateForm.drug_id = this.drugSpec[i].id
2823
+            this.templateForm.way = this.drugSpec[i].type
2824
+          }
2825
+        }
2826
+      },
2827
+
2828
+      changeDrugNameTwo(name){
2829
+        this.current_drug_name = name
2830
+        this.templateFormEdit.advice_desc = ''
2831
+        this.drugSpec = []
2832
+        for (let i = 0; i < this.all_drug.length; i++) {
2833
+          if (this.all_drug[i].drug_name == name) {
2834
+              this.drugSpec = this.all_drug[i].drug_specs
2835
+            }
2836
+        }
2837
+      },
2838
+
2839
+      changeDrugDescTwo(name) {
2840
+        this.current_drug_spec = name
2841
+        for (let i = 0; i < this.drugSpec.length; i++) {
2842
+          if (this.drugSpec[i].drug_spec == name) {
2843
+            this.templateFormEdit.advice_desc = this.drugSpec[i].drug_spec
2844
+            this.templateFormEdit.prescribing_number = this.drugSpec[i].prescribing_number.toString()
2845
+            this.templateFormEdit.single_dose = this.drugSpec[i].single_dose.toString()
2846
+            this.templateFormEdit.delivery_way = this.drugSpec[i].delivery_way.toString()
2847
+            this.templateFormEdit.execution_frequency = this.drugSpec[i].execution_frequency.toString()
2848
+          }
2849
+        }
2850
+      },
2851
+
2537 2852
     }
2538 2853
   }
2539 2854
 </script>

+ 2 - 28
src/xt_pages/dialysis/details/dialog/adviceDialog/AddGroupAdvice.vue Прегледај датотеку

@@ -844,7 +844,7 @@ export default {
844 844
         .catch(() => {});
845 845
     },
846 846
     submitNameForm(formName) {
847
-      console.log("=====",this.src_type)
847
+      
848 848
        if(this.src_type == ""){
849 849
           this.nameForm.way = 0
850 850
           this.nameForm.drug_id = 0
@@ -854,33 +854,7 @@ export default {
854 854
           var arr = this.nameForm.advice_name.split("(自备药)")
855 855
           this.nameForm.advice_name = arr[0]
856 856
        }
857
-      // if(typeof(this.nameForm.advice_name) == "string"){
858
-         
859
-      //     this.nameForm.advice_name == this.nameForm.advice_name
860
-      // }
861
-
862
-      // if(typeof(this.nameForm.advice_name) == "number"){
863
-      //     var drug_name = ""
864
-      //     var name = ""
865
-      //     var way = 0
866
-      //     this.nameForm.drug_id = this.nameForm.advice_name
867
-      //     for(let i=0;i<this.medicals.length;i++){
868
-      //       if(this.nameForm.advice_name == this.medicals[i].id){
869
-      //         name = this.medicals[i].drug_name
870
-      //         way  = this.medicals[i].way
871
-      //       }
872
-      //     }
873
-      //     if(way == 1){
874
-      //       drug_name = name
875
-      //     }
876
-      //     if(way == 2){
877
-      //       var arr = name.split("(自备药)")
878
-      //       drug_name = arr[0]
879
-      //     }
880
-          
881
-      //     this.nameForm.advice_name = drug_name
882
-      //     this.nameForm.way = way
883
-      // }
857
+   
884 858
       
885 859
       var _this = this;
886 860
       this.$refs[formName].validate(valid => {

+ 5 - 1
src/xt_pages/stock/selfPreparedMedicine/components/medicineDetail.vue Прегледај датотеку

@@ -104,7 +104,8 @@ export default {
104 104
             drug_spec:"",
105 105
             patient_id:"",
106 106
             type:1,
107
-            start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
107
+            // start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
108
+            start_time: moment(new Date()).subtract(30,'days').format('YYYY-MM-DD'),
108 109
             end_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
109 110
             staffList:[]
110 111
         }
@@ -200,7 +201,10 @@ export default {
200 201
     },
201 202
 
202 203
     created(){
204
+    
203 205
       this.getCurrentOrgAllStaff() 
206
+
207
+
204 208
     }
205 209
 }
206 210
 </script>

+ 20 - 11
src/xt_pages/stock/selfPreparedMedicine/query.vue Прегледај датотеку

@@ -125,7 +125,7 @@ export default {
125 125
             // end_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
126 126
             start_time:"",
127 127
             end_time:"",
128
-            drug_name:"全部",
128
+            drug_name:0,
129 129
             drug_spec:"",
130 130
             drugName:[],
131 131
             rulleName:[]
@@ -203,14 +203,19 @@ export default {
203 203
         this.getlist()
204 204
       },
205 205
       changeDrugName(id){
206
-        var drug_name = ""
207
-        for(let i=0;i<this.drugName.length;i++){
208
-          if(id == this.drugName[i].id){
209
-             drug_name = this.drugName[i].drug_name
206
+        if(id == 0){
207
+          this.drug_name = 0
208
+        }
209
+        if(id != 0 ){
210
+          var drug_name = ""
211
+          for(let i=0;i<this.drugName.length;i++){
212
+            if(id == this.drugName[i].id){
213
+              drug_name = this.drugName[i].drug_name
214
+            }
210 215
           }
216
+          this.drug_name = drug_name
217
+          this.getRulleName(id)  
211 218
         }
212
-        this.drug_name = drug_name
213
-        this.getRulleName(id)
214 219
         this.getlist()
215 220
       },
216 221
       changeRullName(id){
@@ -225,8 +230,12 @@ export default {
225 230
         this.getlist()
226 231
       },
227 232
       getlist(){
228
-          if(this.drug_name == "全部"){
229
-            this.drug_name = ""
233
+         var name = ""
234
+          if(this.drug_name == 0){
235
+             name = ""
236
+          }
237
+          if(this.drug_name != 0){
238
+             name = this.drug_name
230 239
           }
231 240
           if(this.drug_spec == "全部"){
232 241
             this.drug_spec = ""
@@ -234,11 +243,11 @@ export default {
234 243
           const params = {
235 244
             start_time:this.start_time,
236 245
             end_time:this.end_time,
237
-            drug_name:this.drug_name,
246
+            drug_name:name,
238 247
             drug_spec:this.drug_spec,
239 248
             search_input:this.search_input
240 249
           }
241
-         
250
+         console.log("params9999999",params)
242 251
         getAllPatientStockList(params).then(response=>{
243 252
             if(response.data.state == 1){
244 253
               var stocklist = response.data.data.stocklist