Przeglądaj źródła

Merge branch '20220812' of http://git.shengws.com/csx/Vue_New into 20220812

huangyw 2 lat temu
rodzic
commit
f9eb3facfe

+ 18 - 0
src/api/his/his.js Wyświetl plik

@@ -680,3 +680,21 @@ export function getHisDataTwo(params) {
680 680
 }
681 681
 
682 682
 
683
+export function getHisDataThree(params) {
684
+  return request({
685
+    url: '/handelsettledata',
686
+    method: 'get',
687
+    params: params
688
+  })
689
+}
690
+
691
+
692
+export function getExportChargeData(params) {
693
+  return request({
694
+    url: '/api/his/getexportdata',
695
+    method: 'get',
696
+    params: params
697
+  })
698
+}
699
+
700
+

+ 116 - 184
src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue Wyświetl plik

@@ -165,6 +165,7 @@
165 165
           :disabled="!is_has_exce"
166 166
           @click="execAdvice"
167 167
           :loading="deleLoading"
168
+
168 169
         >执行医嘱
169 170
         </el-button>
170 171
         <el-button v-else disabled round @click="execAdvice" :loading="deleLoading">执行医嘱</el-button>
@@ -208,7 +209,6 @@
208 209
       <!-- 医嘱列表 -->
209 210
       <!--   @row-click="cellMouseEnter" -->
210 211
       <!--&lt;!&ndash;:header-cell-style="{ backgroundColor: 'rgb(64, 158, 255)', color: 'white'}"&ndash;&gt;@current-change="selectRow"-->
211
-      <!-- :span-method="objectSpanMethod" -->
212 212
       <el-table
213 213
         v-if="his_is_open !=1 && is_advice_open!=1"
214 214
         :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
@@ -219,13 +219,14 @@
219 219
         ref="advices_list"
220 220
         @row-click="cellMouseEnter"
221 221
         :row-class-name="tableRowClassName"
222
-        
222
+        :span-method="objectSpanMethod"
223 223
         :cell-class-name="adviceNameShow"
224 224
         :modal-append-to-body="false"
225
-        @selection-change="handleSelectionChange"
226 225
         highlight-current-row
226
+
227 227
       >
228
-       <el-table-column type="selection"  width="55" ></el-table-column>
228
+      <!-- @selection-change="handleSelectionChange" -->
229
+        <!-- <el-table-column type="selection"  width="55"></el-table-column> -->
229 230
        <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
230 231
           <template slot-scope="scope">
231 232
             <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
@@ -299,6 +300,8 @@
299 300
             <span>
300 301
               {{getXuserName(scope.row.checker)}}
301 302
             </span>
303
+
304
+
302 305
           </template>
303 306
         </el-table-column>
304 307
       </el-table>
@@ -318,9 +321,8 @@
318 321
         :cell-class-name="adviceNameShow"
319 322
         :modal-append-to-body="false"
320 323
         highlight-current-row
321
-        @selection-change="handleSelectionChange"
322 324
       >
323
-        <el-table-column type="selection"  width="55"></el-table-column>
325
+        <!-- <el-table-column type="selection"  width="55"></el-table-column> -->
324 326
         <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
325 327
           <template slot-scope="scope">
326 328
             <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
@@ -328,6 +330,13 @@
328 330
         </el-table-column>
329 331
 
330 332
 
333
+        <!--===================================-->
334
+<!--        <el-table-column prop="date" label="调试" align="center" min-width="26px">-->
335
+<!--          <template slot-scope="scope">-->
336
+<!--            <span @click="lili(scope.$index,scope.row)">{{ scope.row.parent_id }}</span>-->
337
+<!--          </template>-->
338
+<!--        </el-table-column>-->
339
+
331 340
         <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
332 341
           <template slot-scope="scope">
333 342
             <span>
@@ -614,8 +623,7 @@
614 623
     EditDoctorAdvice,
615 624
     ExecDoctorAdvice,
616 625
     getAdviceConfig,
617
-    GetLastOrNextDoctorAdvice,
618
-    GetOrderDoctorAdvice
626
+    GetLastOrNextDoctorAdvice
619 627
   } from '@/api/advice'
620 628
   import { getDataConfig } from '@/utils/data'
621 629
 
@@ -772,8 +780,6 @@
772 780
         drug_id: 0,
773 781
         src_type:"",
774 782
         org_id:0,
775
-        hisAdviceIds:"",
776
-        adviceIds:"",
777 783
       }
778 784
     },
779 785
     watch: {
@@ -790,50 +796,16 @@
790 796
 
791 797
     },
792 798
     methods: {
793
-      handleSelectionChange(row){
794
-        console.log("row3233223232332322323",row)
795
-       if(row.length >0){
796
-         this.currentRow = row[0]
797
-       }
798
-       var bloodIds= []
799
-       var hisIds=[]
800
-       console.log("this.his_is_open ",this.his_is_open )
801
-       console.log("is_advice_open",this.is_advice_open)
802
-       for(let i=0;i<row.length;i++){
803
-        //血透
804
-         if(this.his_is_open  != 1 && this.is_advice_open!=1){
805
-            bloodIds.push(row[i].id)
806
-         }
807
-         //his
808
-         if(this.his_is_open == 1 && this.is_advice_open!=1){
809
-             hisIds.push(row[i].id)
810
-         }
811
-         
812
-         if(this.his_is_open == 1 && this.is_advice_open == 1){
813
-            if(row[i].origin == 1){
814
-              bloodIds.push(row[i].id)
815
-            }
816
-            if(row[i].origin == 2){
817
-              hisIds.push(row[i].id)
818
-            }
819
-           this.currentRow.origin = 3
820
-         }
821
-       }
822
-      
823
-       if(this.his_is_open  == 1 || this.is_advice_open == 1){
824
-         this.is_has_exce = true
825
-         this.is_has_check = true
826
-       }
827
-     
828
-       if(this.his_is_open!=1 && this.is_advice_open!=1){
829
-        
830
-          this.is_has_exce = true
831
-          this.is_has_check = true
832
-       }
833
-        console.log("bloodIds",bloodIds,"hisIds",hisIds)
834
-       this.adviceIds = bloodIds.join(",")
835
-       this.hisAdviceIds = hisIds.join(",")
836
-      
799
+      handleSelectionChange(){
800
+
801
+      },
802
+
803
+      //调试
804
+      lili(index,row){
805
+        // console.log("==index==",index)
806
+        // console.log("==row==",row)
807
+        console.log("==doctor_advices==",this.doctor_advices)
808
+        console.log("==this.form==",this.form)
837 809
       },
838 810
       getContent: function() {
839 811
         if (this.sch != null) {
@@ -1270,7 +1242,7 @@
1270 1242
         let mode = '6'
1271 1243
 
1272 1244
 
1273
-        ExecDoctorAdvice(this.patient.id, this.currentRow.id, this.execTime, mode,this.currentRow.origin,this.hisAdviceIds,this.adviceIds).then(response => {
1245
+        ExecDoctorAdvice(this.patient.id, this.currentRow.id, this.execTime, mode,this.currentRow.origin).then(response => {
1274 1246
             if (response.data.state == 0) {
1275 1247
               this.$message.error(response.data.msg)
1276 1248
               this.exceLoading = false
@@ -1282,71 +1254,46 @@
1282 1254
                 type: 'success',
1283 1255
                 duration: 2000
1284 1256
               })
1285
-              
1286 1257
               var msg = response.data.data.msg
1287 1258
               if(msg == 1){
1288
-                  let params = {
1289
-                  patient_id: this.patientid,
1290
-                  record_time: this.request_record_date,
1291
-                  type: 1,
1292
-                  advice_date:this.$route.query.date,
1293
-                }
1294
-                this.GetOrderDoctorAdvice(params)
1295
-                this.execTimeDialogVisible = false
1259
+                var exid = response.data.data.advice.id
1260
+                  if (response.data.data.advice.parent_id > 0) {
1261
+                    exid = response.data.data.advice.parent_id
1262
+                  }
1263
+
1264
+                  this.currentRow.execution_state = 1
1265
+                  this.currentRow.execution_staff =
1266
+                    response.data.data.advice.execution_staff
1267
+                  this.currentRow.execution_time =
1268
+                    response.data.data.advice.execution_time
1269
+                  var alen = this.doctor_advices.length
1270
+
1271
+                  for (var index in this.doctor_advices) {
1272
+                    if (
1273
+                      this.doctor_advices[index].id == exid ||
1274
+                      this.doctor_advices[index].parent_id == exid
1275
+                    ) {
1276
+                      this.doctor_advices[index].execution_state = 1
1277
+                      this.doctor_advices[index].execution_staff =
1278
+                        response.data.data.advice.execution_staff
1279
+                      this.doctor_advices[index].execution_time =
1280
+                        response.data.data.advice.execution_time
1281
+                      // this.doctor_advices[index].checker = response.data.data.advice.checker;
1282
+                      break
1283
+                    }
1284
+                  }
1285
+                  this.execTimeDialogVisible = false
1286
+
1287
+                  return false
1296 1288
               }
1297
-            
1298
-              // if(msg == 1){
1299
-              //   var exid = response.data.data.advice.id
1300
-              //     if (response.data.data.advice.parent_id > 0) {
1301
-              //       exid = response.data.data.advice.parent_id
1302
-              //     }
1303
-
1304
-              //     this.currentRow.execution_state = 1
1305
-              //     this.currentRow.execution_staff =
1306
-              //       response.data.data.advice.execution_staff
1307
-              //     this.currentRow.execution_time =
1308
-              //       response.data.data.advice.execution_time
1309
-              //     var alen = this.doctor_advices.length
1310
-
1311
-              //     for (var index in this.doctor_advices) {
1312
-              //       if (
1313
-              //         this.doctor_advices[index].id == exid ||
1314
-              //         this.doctor_advices[index].parent_id == exid
1315
-              //       ) {
1316
-              //         this.doctor_advices[index].execution_state = 1
1317
-              //         this.doctor_advices[index].execution_staff =
1318
-              //           response.data.data.advice.execution_staff
1319
-              //         this.doctor_advices[index].execution_time =
1320
-              //           response.data.data.advice.execution_time
1321
-              //         break
1322
-              //       }
1323
-              //     }
1324
-              //     this.execTimeDialogVisible = false
1325
-
1326
-              //     return false
1327
-              // }
1328 1289
 
1329 1290
               if(msg == 2){
1330 1291
                 this.$message.error("库存不足,请入库")
1331
-               let params = {
1332
-                patient_id: this.patientid,
1333
-                record_time: this.request_record_date,
1334
-                type: 1,
1335
-                advice_date:this.$route.query.date,
1336
-              }
1337
-              this.GetOrderDoctorAdvice(params)
1338 1292
                 this.execTimeDialogVisible = false
1339 1293
                 return false
1340 1294
               }
1341 1295
               if(msg == 3){
1342 1296
                 this.$message.error("无库存,请入库")
1343
-               let params = {
1344
-                patient_id: this.patientid,
1345
-                record_time: this.request_record_date,
1346
-                type: 1,
1347
-                advice_date:this.$route.query.date,
1348
-              }
1349
-              this.GetOrderDoctorAdvice(params)
1350 1297
                 this.execTimeDialogVisible = false
1351 1298
                 return false
1352 1299
               }
@@ -1655,7 +1602,7 @@
1655 1602
             this.deleLoading = true
1656 1603
             let mode = '7'
1657 1604
 
1658
-            CheckDoctorAdvice(this.patient.id, this.currentRow.id, mode,this.currentRow.origin,this.hisAdviceIds,this.adviceIds).then(
1605
+            CheckDoctorAdvice(this.patient.id, this.currentRow.id, mode,this.currentRow.origin).then(
1659 1606
               response => {
1660 1607
                 if (response.data.state == 0) {
1661 1608
                   this.$message.error(response.data.msg)
@@ -1669,37 +1616,33 @@
1669 1616
                     type: 'success',
1670 1617
                     duration: 2000
1671 1618
                   })
1672
-                   let params = {
1673
-                    patient_id: this.patientid,
1674
-                    record_time: this.request_record_date,
1675
-                    type: 1,
1676
-                    advice_date:this.$route.query.date,
1619
+
1620
+                  var exid = response.data.data.advice.id
1621
+                  if (response.data.data.advice.parent_id > 0) {
1622
+                    exid = response.data.data.advice.parent_id
1677 1623
                   }
1678
-                console.log("param233223223233232",params)
1679
-                 this.GetOrderDoctorAdvice(params)
1680
-                  // var exid = response.data.data.advice.id
1681
-                  // if (response.data.data.advice.parent_id > 0) {
1682
-                  //   exid = response.data.data.advice.parent_id
1683
-                  // }
1684
-                  // this.currentRow.check_state = 1
1685
-                  // this.currentRow.check_time =
1686
-                  //   response.data.data.advice.check_time
1687
-                  // this.currentRow.checker = response.data.data.advice.checker
1688
-                  // var alen = this.doctor_advices.length
1689
-
1690
-                  // for (var index in this.doctor_advices) {
1691
-                  //   if (
1692
-                  //     this.doctor_advices[index].id == exid ||
1693
-                  //     this.doctor_advices[index].parent_id == exid
1694
-                  //   ) {
1695
-                  //     this.doctor_advices[index].check_state = 1
1696
-                  //     this.doctor_advices[index].check_time =
1697
-                  //       response.data.data.advice.check_time
1698
-                  //     this.doctor_advices[index].checker =
1699
-                  //       response.data.data.advice.checker
1700
-                  //     // break;
1701
-                  //   }
1624
+                  // if (this.currentRow.parent_id > 0) {
1625
+                  //     exid = this.currentRow.parent_id;
1702 1626
                   // }
1627
+                  this.currentRow.check_state = 1
1628
+                  this.currentRow.check_time =
1629
+                    response.data.data.advice.check_time
1630
+                  this.currentRow.checker = response.data.data.advice.checker
1631
+                  var alen = this.doctor_advices.length
1632
+
1633
+                  for (var index in this.doctor_advices) {
1634
+                    if (
1635
+                      this.doctor_advices[index].id == exid ||
1636
+                      this.doctor_advices[index].parent_id == exid
1637
+                    ) {
1638
+                      this.doctor_advices[index].check_state = 1
1639
+                      this.doctor_advices[index].check_time =
1640
+                        response.data.data.advice.check_time
1641
+                      this.doctor_advices[index].checker =
1642
+                        response.data.data.advice.checker
1643
+                      // break;
1644
+                    }
1645
+                  }
1703 1646
 
1704 1647
                   this.deleLoading = false
1705 1648
                 }
@@ -1793,6 +1736,29 @@
1793 1736
           this.nowExecTime = new Date(group_top_advice.start_time * 1000)
1794 1737
         }
1795 1738
         this.$refs.exec_time.open()
1739
+        // if (this.currentRow == null) {
1740
+        //   this.$message.error("请先选择要执行的医嘱!");
1741
+        //   return false;
1742
+        // }
1743
+        //
1744
+        // if (
1745
+        //   this.currentRow.stop_state == 1 ||
1746
+        //   this.currentRow.execution_state == 1
1747
+        // ) {
1748
+        //   this.$message.error("所选医嘱已停止或执行");
1749
+        //   return false;
1750
+        // }
1751
+        //
1752
+        // if (
1753
+        //   this.currentRow.checker > 0 &&
1754
+        //   this.currentRow.checker == this.$store.getters.xt_user.user.id
1755
+        // ) {
1756
+        //   this.$message.error("核对与执行不能是同一人");
1757
+        //   return false;
1758
+        // }
1759
+        //
1760
+        // this.execTimeDialogVisible = true;
1761
+        // this.deleLoading = true;
1796 1762
       }
1797 1763
       ,
1798 1764
 
@@ -2043,6 +2009,8 @@
2043 2009
       }
2044 2010
       ,
2045 2011
       show(his_is_open,is_advice_open) {
2012
+        console.log("his_is_open233232323232323322323",his_is_open)
2013
+        console.log("is_advice_open233232323232323322323",is_advice_open)
2046 2014
         this.his_is_open = his_is_open
2047 2015
         this.is_advice_open = is_advice_open
2048 2016
         this.isVisibility = true
@@ -2148,7 +2116,7 @@
2148 2116
         }
2149 2117
       },
2150 2118
       cellMouseEnter: function(row, column, event) {
2151
-       
2119
+        console.log("row323323322323233232",row)
2152 2120
         this.currentRow = row
2153 2121
         this.groupSelectRow = row
2154 2122
         // this.sameRowArr.forEach((arr, i) => {
@@ -2318,11 +2286,11 @@
2318 2286
       }
2319 2287
       ,
2320 2288
       GetLastOrNextDoctorAdvice(params) {
2321
-       
2322 2289
         GetLastOrNextDoctorAdvice(params).then(response => {
2323 2290
           if (response.data.state == 1) {
2324 2291
 
2325 2292
             var doctor_advices = response.data.data.advices
2293
+
2326 2294
             this.other_doctor_advices = doctor_advices
2327 2295
             this.request_record_date = uParseTime(this.other_doctor_advices[0].record_date, '{y}-{m}-{d}')
2328 2296
             this.sch = response.data.data.schedule
@@ -2333,40 +2301,6 @@
2333 2301
         })
2334 2302
 
2335 2303
       },
2336
-      GetOrderDoctorAdvice(params){
2337
-        GetOrderDoctorAdvice(params).then(response=>{
2338
-           if(response.data.state == 1){
2339
-            var doctorAdvice =  response.data.data.doctorAdvice
2340
-            for(let i=0;i<doctorAdvice.lenght;i++){
2341
-               doctorAdvice[i].origin = 1 
2342
-            }
2343
-            
2344
-            var hisDoctorAdvice = response.data.data.hisDoctorAdvice
2345
-            for(let i=0;i<hisDoctorAdvice.length;i++){
2346
-               hisDoctorAdvice[i].origin = 2
2347
-            }
2348
-            this.doctor_advices = []
2349
-            if(this.his_is_open!=1 && this.is_advice_open !=1){
2350
-              
2351
-               this.doctor_advices = doctorAdvice
2352
-            }
2353
-            if(this.his_is_open ==1 && this.is_advice_open!=1){
2354
-              this.doctor_advices = hisDoctorAdvice
2355
-            }
2356
-
2357
-            if(this.his_is_open == 1 &&  this.is_advice_open == 1){
2358
-               for(let i=0;i<doctorAdvice.length;i++){
2359
-                  this.doctor_advices.push(doctorAdvice[i])
2360
-               }
2361
-               for(let i=0;i<hisDoctorAdvice.length;i++){
2362
-                 this.doctor_advices.push(hisDoctorAdvice[i])
2363
-               }
2364
-            }
2365
-           
2366
-           
2367
-           }
2368
-        })
2369
-      },
2370 2304
       getDialysisScheduleDetail() {
2371 2305
         if(this.$route.query.showView && this.$route.query.showView == true){
2372 2306
           return
@@ -2407,8 +2341,7 @@
2407 2341
           let params = {
2408 2342
             patient_id: this.patientid,
2409 2343
             record_time: this.request_record_date,
2410
-            type: 1,
2411
-            advice_date:this.$route.query.date,
2344
+            type: 1
2412 2345
           }
2413 2346
 
2414 2347
           this.GetLastOrNextDoctorAdvice(params)
@@ -2417,8 +2350,7 @@
2417 2350
           let params = {
2418 2351
             patient_id: this.patientid,
2419 2352
             record_time: this.request_record_date,
2420
-            type: 1,
2421
-            advice_date:this.$route.query.date,
2353
+            type: 1
2422 2354
           }
2423 2355
 
2424 2356
           this.GetLastOrNextDoctorAdvice(params)
@@ -2434,8 +2366,7 @@
2434 2366
           let params = {
2435 2367
             patient_id: this.patientid,
2436 2368
             record_time: this.request_record_date,
2437
-            type: 2,
2438
-            advice_date:this.$route.query.date,
2369
+            type: 2
2439 2370
           }
2440 2371
 
2441 2372
           this.GetLastOrNextDoctorAdvice(params)
@@ -2443,8 +2374,7 @@
2443 2374
           let params = {
2444 2375
             patient_id: this.patientid,
2445 2376
             record_time: this.request_record_date,
2446
-            type: 2,
2447
-            advice_date:this.$route.query.date,
2377
+            type: 2
2448 2378
           }
2449 2379
           this.GetLastOrNextDoctorAdvice(params)
2450 2380
 
@@ -2632,7 +2562,6 @@
2632 2562
      }
2633 2563
     },
2634 2564
     created() {
2635
-      console.log("doctor_advices32323233323322332",this.doctor_advices)
2636 2565
       var date = this.$route.query && this.$route.query.date
2637 2566
       this.record_date = uParseTime(date, '{y}-{m}-{d}')
2638 2567
       this.form.advice_date = this.record_date
@@ -2642,6 +2571,9 @@
2642 2571
       this.org_id = this.$store.getters.xt_user.org.id
2643 2572
       this.patientid = this.$route.query.patient_id
2644 2573
       this.request_record_date = this.record_date
2574
+
2575
+
2576
+      // this.getDialysisScheduleDetail()
2645 2577
        //获取自备药
2646 2578
       this.getSelfMedicalList()
2647 2579
     },

+ 216 - 2
src/xt_pages/outpatientCharges/summary.vue Wyświetl plik

@@ -112,6 +112,8 @@
112 112
 <!--          >报表下载2-->
113 113
 <!--          </el-button-->
114 114
 <!--          >-->
115
+
116
+          <el-button size="small" type="primary" @click="export_detail_three">报表下载2</el-button>
115 117
         </div>
116 118
       </div>
117 119
       <el-table
@@ -343,6 +345,8 @@ import axios from "axios";
343 345
 import invoicePrint from "./invoicePrint";
344 346
 import settlementPrint from "./settlementPrint";
345 347
 import {getHisDataTwo} from "../../api/his/his";
348
+import {getHisDataThree} from "../../api/his/his";
349
+
346 350
 
347 351
 export default {
348 352
   name: "OutpatientChargesSummary",
@@ -669,7 +673,8 @@ export default {
669 673
         order_id: row.id,
670 674
       };
671 675
       this.settlementObj = obj;
672
-    }, export_detail_two() {
676
+    },
677
+    export_detail_two() {
673 678
       let params = {};
674 679
       getHisDataTwo(params).then((response) => {
675 680
         if (response.data.state == 0) {
@@ -807,7 +812,100 @@ export default {
807 812
           });
808 813
         }
809 814
       });
810
-    }, unique_two(array) {
815
+    },
816
+    export_detail_three() {
817
+      let params = {};
818
+      getHisDataThree(params).then((response) => {
819
+        if (response.data.state == 0) {
820
+          this.$message.error(response.data.msg);
821
+          return false;
822
+        } else {
823
+          let list = [];
824
+          for (let i = 0; i < response.data.data.order.length; i++) {
825
+            let order = response.data.data.order[i];
826
+            let data =  this.setMonthPrescription(order.info)
827
+            // console.log(data)
828
+            for(let b= 0; b < data.length; b++){
829
+              let obj = {
830
+                name: order.patient.name,
831
+                id_card_no: order.patient.id_card_no,
832
+                year: "2022",
833
+                month:"8",
834
+                code: data[b].code,
835
+                pric: data[b].count * data[b].price,
836
+                item_name:data[b].name,
837
+                unit:data[b].unit,
838
+                count:data[b].count,
839
+
840
+              }
841
+              if (order.insutype == "310") {
842
+                obj["insutype"] = "职工"
843
+              } else if (order.insutype == "390") {
844
+                obj["insutype"] = "城乡"
845
+              }
846
+              list.push(obj)
847
+            }
848
+
849
+          }
850
+
851
+          var  tarList = []
852
+          for (let i = 0; i < list.length; i++) {
853
+            if(list[i].pric > 0) {
854
+              let obj = {
855
+                "姓名": list[i].name,
856
+                "身份证号": list[i].id_card_no,
857
+                "医保类型": list[i].insutype,
858
+                "年": list[i].year,
859
+                "月": list[i].month,
860
+                "药品编码": list[i].code,
861
+                "名称": list[i].item_name,
862
+                "单位": list[i].unit,
863
+                "数量": list[i].count,
864
+                "金额": list[i].pric,
865
+              }
866
+              tarList.push(obj)
867
+            }
868
+          }
869
+
870
+          import("@/vendor/Export2Excel").then((excel) => {
871
+            const tHeader = [
872
+              "姓名",
873
+              "身份证号",
874
+              "医保类型",
875
+              "年",
876
+              "月",
877
+              "药品编码",
878
+              "名称",
879
+              "单位",
880
+              "数量",
881
+              "金额",
882
+
883
+            ];
884
+            const filterVal = [
885
+              "姓名",
886
+              "身份证号",
887
+              "医保类型",
888
+              "年",
889
+              "月",
890
+              "药品编码",
891
+              "名称",
892
+              "单位",
893
+              "数量",
894
+              "金额",
895
+
896
+            ];
897
+            const data = this.formatJson(filterVal, tarList);
898
+            excel.export_json_to_excel({
899
+              header: tHeader,
900
+              data,
901
+              filename: "消费明细",
902
+            });
903
+          });
904
+        }
905
+      });
906
+    },
907
+
908
+    unique_two(array) {
811 909
       // res用来存储结果
812 910
       var res = []
813 911
       for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
@@ -1079,6 +1177,106 @@ export default {
1079 1177
       this.keywords = "";
1080 1178
       this.getHisOrderList();
1081 1179
     },
1180
+    setMonthPrescription(month_prescriptions) {
1181
+      let tableData = []
1182
+      let drug_month_prescriptions = {
1183
+        advices: []
1184
+      }
1185
+      let drug_ids = []
1186
+      let project_month_prescriptions = {
1187
+        project: []
1188
+
1189
+      }
1190
+      let project_ids = []
1191
+
1192
+      // let addition_month_prescriptions = {
1193
+      //   addition: []
1194
+      //
1195
+      // }
1196
+      // let additions_ids = []
1197
+      for (let i = 0; i < month_prescriptions.length; i++) {
1198
+        if (month_prescriptions[i].type == 1) { //药品
1199
+          for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
1200
+            let obj = {
1201
+              id: month_prescriptions[i].advices[a].drug_id,
1202
+              price: month_prescriptions[i].advices[a].price
1203
+
1204
+            }
1205
+            drug_ids.push(obj)
1206
+            drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
1207
+          }
1208
+
1209
+        } else if (month_prescriptions[i].type == 2) { //项目
1210
+          for (let a = 0; a < month_prescriptions[i].project.length; a++) {
1211
+            let obj = {
1212
+              id: month_prescriptions[i].project[a].project_id,
1213
+              price: month_prescriptions[i].project[a].price
1214
+
1215
+            }
1216
+            project_ids.push(obj)
1217
+            project_month_prescriptions.project.push(month_prescriptions[i].project[a])
1218
+          }
1219
+        }
1220
+
1221
+      }
1222
+
1223
+      drug_ids = this.unique(drug_ids)
1224
+      project_ids= this.unique(project_ids)
1225
+
1226
+      // additions_ids= this.unique(additions_ids)
1227
+
1228
+
1229
+      for (let i = 0; i < drug_ids.length; i++) {
1230
+        let obj = {}
1231
+        let count = 0
1232
+        for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
1233
+          if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id ==  drug_month_prescriptions.advices[a].drug_id) {
1234
+            obj['name'] = drug_month_prescriptions.advices[a].advice_name
1235
+            obj['code'] =  drug_month_prescriptions.advices[a].id
1236
+            obj['unit'] = drug_month_prescriptions.advices[a].drug.min_unit
1237
+            obj['price'] = parseFloat(drug_month_prescriptions.advices[a].price)
1238
+            count = count + drug_month_prescriptions.advices[a].prescribing_number
1239
+          }
1240
+        }
1241
+        obj['count'] = count
1242
+        tableData.push(obj)
1243
+      }
1244
+
1245
+      for (let i = 0; i < project_ids.length; i++) {
1246
+        let obj = {}
1247
+        let count = 0
1248
+        for (let a = 0; a < project_month_prescriptions.project.length; a++) {
1249
+          if (project_ids[i].price == project_month_prescriptions.project[a].price &&project_ids[i].id == project_month_prescriptions.project[a].project_id ) {
1250
+
1251
+            if(project_month_prescriptions.project[a].type == 2){
1252
+              obj['name'] = project_month_prescriptions.project[a].project.project_name
1253
+              obj['code'] = project_month_prescriptions.project[a].id
1254
+              obj['unit'] = project_month_prescriptions.project[a].project.unit
1255
+              obj['type'] = 2
1256
+
1257
+
1258
+            }else if (project_month_prescriptions.project[a].type == 3){
1259
+              obj['name'] = project_month_prescriptions.project[a].good_info.good_name
1260
+              obj['code'] =  project_month_prescriptions.project[a].id
1261
+              obj['unit'] = project_month_prescriptions.project[a].good_info.packing_unit
1262
+              obj['type'] = 3
1263
+
1264
+
1265
+            }
1266
+            count = count + parseFloat(project_month_prescriptions.project[a].count)
1267
+            obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
1268
+            obj['type'] = 1
1269
+
1270
+
1271
+          }
1272
+        }
1273
+        obj['count'] = count
1274
+        tableData.push(obj)
1275
+
1276
+      }
1277
+      return tableData
1278
+    },
1279
+
1082 1280
     Action() {
1083 1281
       getAllOrders().then((response) => {
1084 1282
         if (response.data.state == 0) {
@@ -1225,7 +1423,23 @@ export default {
1225 1423
       } else if (index == 2) {
1226 1424
         this.allListVisible = true;
1227 1425
       }
1426
+    },    unique(array) {
1427
+      // res用来存储结果
1428
+      var res = []
1429
+      for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
1430
+        for (var j = 0, resLen = res.length; j < resLen; j++) {
1431
+          if (array[i].id === res[j].id && array[i].price === res[j].price) {
1432
+            break
1433
+          }
1434
+        }
1435
+        // 如果array[i]是唯一的,那么执行完循环,j等于resLen
1436
+        if (j === resLen) {
1437
+          res.push(array[i])
1438
+        }
1439
+      }
1440
+      return res
1228 1441
     },
1442
+
1229 1443
     invoicePrint(obj) {
1230 1444
       console.log(obj);
1231 1445
       let paramsObj = {

+ 2 - 1
src/xt_pages/outpatientCharges/summaryDetail.vue Wyświetl plik

@@ -295,7 +295,8 @@ export default {
295 295
       if (tab == 'more') {
296 296
         return false
297 297
       }
298
-    },  unique(array) {
298
+    },
299
+    unique(array) {
299 300
       // res用来存储结果
300 301
       var res = []
301 302
       for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {

Plik diff jest za duży
+ 614 - 451
src/xt_pages/outpatientTool/components/gather.vue