Browse Source

11月14日 库存扣减更新

XMLWAN 3 years ago
parent
commit
124054f1b3

+ 1 - 0
src/api/dialysis.js View File

@@ -208,6 +208,7 @@ export function postAssessmentBeforeDislysis(params) {
208 208
 }
209 209
 
210 210
 export function postTreatmentsummary(params) {
211
+  console.log('param223322323', params)
211 212
   return request({
212 213
     url: '/api/dialysis/treatmentsummary',
213 214
     method: 'Post',

+ 54 - 91
src/xt_pages/data/components/drugs.vue View File

@@ -47,7 +47,7 @@
47 47
     <div style="display:flex; align-items:center;margin-bottom:10px;">
48 48
         <!--<el-button type="primary" size="small" @click="BatchDelete()" v-if="$store.getters.xt_user.org_id == 9504 ||  this.$store.getters.xt_user.org_id == 10138 || $store.getters.xt_user.org_id == 10028" >批量备案</el-button>-->
49 49
         <el-button type="primary" size="small"  @click="GDYBBatchPutOnRecord()">批量备案</el-button>
50
-        <el-link target="_blank" href="https://kuyi.shengws.com/drugTemplate.xlsx" :underline="false"
50
+        <el-link target="_blank" href="https://kuyi.shengws.com/drugsTemplate.xlsx" :underline="false"
51 51
                  style="margin-left:15px">
52 52
           <el-button
53 53
             class="filter-item"
@@ -89,16 +89,7 @@
89 89
           </div>
90 90
         </template>
91 91
       </el-table-column>
92
-      <!-- <el-table-column prop="date" label="最大单位" width="60" align="center">
93
-        <template slot-scope="scope">
94
-          <div>{{scope.row.max_unit}}</div>
95
-        </template>
96
-      </el-table-column>
97
-      <el-table-column label="最小单位" width="60" align="center">
98
-        <template slot-scope="scope">
99
-          <div>{{scope.row.min_unit}}</div>
100
-        </template>
101
-      </el-table-column> -->
92
+  
102 93
       <el-table-column prop="date" label="进货价" width="100" align="center">
103 94
         <template slot-scope="scope">
104 95
           <div>{{scope.row.last_price}}</div>
@@ -937,17 +928,17 @@
937 928
 
938 929
           var isHasDrugName = header.includes('*药品名称');
939 930
           console.log("isHasDrugName",isHasDrugName)
940
-          var isHasUnval = header.includes('*拆零');
941
-          console.log("isHasUnval",isHasUnval)
942
-          var isHasMinUnit= header.includes('*拆零单位');
943
-           console.log("isHasMinUnit",isHasMinUnit)
944 931
           var isHasDosage =  header.includes('*剂量')
945 932
           console.log("isHasDosage",isHasDosage)
946
-
947 933
           var isHasMaxUnit= header.includes('*剂量单位');
948 934
           console.log("isHasMaxUnit",isHasMaxUnit)
935
+            var isHasUnval = header.includes('*拆零');
936
+          console.log("isHasUnval",isHasUnval)
937
+          var isHasMinUnit= header.includes('*拆零单位');
938
+           console.log("isHasMinUnit",isHasMinUnit)
949 939
           var isHasPackingUnit = header.includes('*包装单位')
950 940
           console.log("isHasPackingUnit",isHasPackingUnit)
941
+        
951 942
           var isHasDrugType =  header.includes('*药品类型');
952 943
           console.log("isHasDrugType",isHasDrugType)
953 944
           var isHasDrugStockLimit =  header.includes('*库存警戒');
@@ -956,14 +947,14 @@
956 947
           console.log("isHasDrugOriginPlace",isHasDrugOriginPlace)
957 948
           var isHasDrugDosageForm = header.includes('*药品剂型');
958 949
           console.log("isHasDrugDosageForm",isHasDrugDosageForm)
959
-
960
-          var isHasUnitMatrixing= header.includes("*单位换算");
961
-          console.log("isHasUnitMatrixing",isHasUnitMatrixing)
950
+         
962 951
           var isHasRetailPrice = header.includes('*拆零零售价');
963 952
           console.log("isHasRetailPrice",isHasRetailPrice)
964
-          var isHasLastPrice = header.includes('*进货价');
965 953
           var isHasPackingPrice= header.includes('*包装零售价');
966
-         console.log("isHasLastPrice",isHasLastPrice)
954
+          console.log("isHasLastPrice",isHasPackingPrice)
955
+          var isHasLastPrice = header.includes('*进货价');
956
+          console.log("进货价",isHasLastPrice)
957
+          
967 958
           var isHasDrugClassifye = header.includes('*药物分类');
968 959
          console.log("isHasDrugClassifye",isHasDrugClassifye)
969 960
          var isHasManufacturer = header.includes('*生产厂商');
@@ -972,8 +963,9 @@
972 963
         console.log("isHasDrugDose",isHasDrugDose)
973 964
          var isDrugDoseUnit = header.includes('*默认单次用量单位');
974 965
          console.log("isDrugDoseUnit",isDrugDoseUnit)
975
-          if (!(isHasDrugName  && isHasUnval && isHasDrugType && isHasDrugStockLimit && isHasDrugOriginPlace && isHasDrugDosageForm && isHasMaxUnit &&  isHasMinUnit && isHasUnitMatrixing &&  isHasRetailPrice && isHasLastPrice && isHasPackingPrice && isHasDrugClassifye && isHasManufacturer && isHasDrugDose && isDrugDoseUnit && isHasDosage && isHasPackingUnit)) {
976
-            console.log("分区222222222222222222222222222222")
966
+          if (!(isHasDrugName  && isHasDosage && isHasMaxUnit && isHasUnval && isHasMinUnit && isHasPackingUnit && isHasDrugType &&  isHasDrugStockLimit && isHasDrugOriginPlace &&
967
+          isHasDrugDosageForm &&  isHasRetailPrice && isHasPackingPrice && isHasLastPrice && isHasDrugClassifye && isHasManufacturer && isHasDrugDose && isDrugDoseUnit)) {
968
+           
977 969
             this.dialogVisible = true;
978 970
             return
979 971
           }
@@ -996,74 +988,49 @@
996 988
            }
997 989
 
998 990
 
999
-          if (results[i]['*拆零'] === undefined) {
1000
-                obj['min_number'] = ''
1001
-              } else {
1002
-           if (key == '*拆零') {
1003
-               obj['min_number'] = results[i][key].replace(/\s/g,"")
1004
-              }
1005
-           }
1006
-
1007
-           if (results[i]['*拆零单位'] === undefined) {
1008
-                obj['min_unit'] = ''
1009
-              } else {
1010
-           if (key == '*拆零单位') {
1011
-               obj['min_unit'] = results[i][key].replace(/\s/g,"")
1012
-              }
1013
-           }
1014
-
1015
-
1016
-            if (results[i]['*剂量'] === undefined) {
1017
-                obj['dosage'] = ''
991
+          if (results[i]['*剂量'] === undefined) {
992
+                obj['dose'] = ''
1018 993
               } else {
1019 994
             if (key == '*剂量') {
1020
-                obj['dosage'] = results[i][key].replace(/\s/g,"")
995
+                obj['dose'] = results[i][key].replace(/\s/g,"")
1021 996
               }
1022 997
            }
1023 998
 
1024 999
            if (results[i]['*剂量单位'] === undefined) {
1025
-                obj['max_unit'] = ''
1000
+                obj['dose_unit'] = ''
1026 1001
               } else {
1027 1002
            if (key == '*剂量单位') {
1028
-               obj['max_unit'] = results[i][key].replace(/\s/g,"")
1029
-              }
1030
-           }
1031
-
1032
-            if (results[i]['*包装单位'] === undefined) {
1033
-                obj['packing_unit'] = ''
1034
-              } else {
1035
-           if (key == '*包装单位') {
1036
-               obj['packing_unit'] = results[i][key].replace(/\s/g,"")
1003
+               obj['dose_unit'] = results[i][key].replace(/\s/g,"")
1037 1004
               }
1038 1005
            }
1039 1006
 
1040 1007
 
1041
-          if (results[i]['默认给药途径'] === undefined) {
1042
-                obj['delivery_way'] = ''
1008
+  
1009
+          if (results[i]['*拆零'] === undefined) {
1010
+                obj['min_number'] = ''
1043 1011
               } else {
1044
-           if (key == '默认给药途径') {
1045
-               obj['delivery_way'] = results[i][key].replace(/\s/g,"")
1012
+           if (key == '*拆零') {
1013
+               obj['min_number'] = results[i][key].replace(/\s/g,"")
1046 1014
               }
1047 1015
            }
1048 1016
 
1049
-           if (results[i]['默认执行频率'] === undefined) {
1050
-                obj['execution_frequency'] = ''
1017
+           if (results[i]['*拆零单位'] === undefined) {
1018
+                obj['min_unit'] = ''
1051 1019
               } else {
1052
-           if (key == '默认执行频率') {
1053
-               obj['execution_frequency'] = results[i][key].replace(/\s/g,"")
1020
+           if (key == '*拆零单位') {
1021
+               obj['min_unit'] = results[i][key].replace(/\s/g,"")
1054 1022
               }
1055 1023
            }
1056 1024
 
1057
-          if (results[i]['默认开药天数'] === undefined) {
1058
-                obj['drug_day'] = ''
1025
+
1026
+            if (results[i]['*包装单位'] === undefined) {
1027
+                obj['max_unit'] = ''
1059 1028
               } else {
1060
-           if (key == '默认开药天数') {
1061
-               obj['drug_day'] = results[i][key].replace(/\s/g,"")
1029
+           if (key == '*包装单位') {
1030
+               obj['max_unit'] = results[i][key].replace(/\s/g,"")
1062 1031
               }
1063 1032
            }
1064 1033
 
1065
-
1066
-
1067 1034
             if (results[i]['*药品类型'] === undefined) {
1068 1035
                 obj['drug_type'] = ''
1069 1036
               } else {
@@ -1099,28 +1066,6 @@
1099 1066
            }
1100 1067
 
1101 1068
 
1102
-            if (results[i]['*医保等级'] === undefined) {
1103
-                obj['medical_insurance_level'] = ''
1104
-              } else {
1105
-           if (key == '*医保等级') {
1106
-               obj['medical_insurance_level'] = results[i][key].replace(/\s/g,"")
1107
-              }
1108
-           }
1109
-
1110
-
1111
-
1112
-
1113
-            if (results[i]['*单位换算'] === undefined) {
1114
-                obj['unit_matrixing'] = ''
1115
-              } else {
1116
-           if (key == '*单位换算') {
1117
-               obj['unit_matrixing'] = results[i][key].replace(/\s/g,"")
1118
-              }
1119
-           }
1120
-
1121
-
1122
-
1123
-
1124 1069
           if (results[i]['*拆零零售价'] === undefined) {
1125 1070
                 obj['retail_price'] = ''
1126 1071
               } else {
@@ -1195,6 +1140,22 @@
1195 1140
               }
1196 1141
            }
1197 1142
 
1143
+            if (results[i]['默认给药途径'] === undefined) {
1144
+                obj['delivery_way'] = ''
1145
+              } else {
1146
+            if (key == '经销商') {
1147
+                obj['delivery_way'] = results[i][key].replace(/\s/g,"")
1148
+              }
1149
+           }
1150
+
1151
+              if (results[i]['默认执行频率'] === undefined) {
1152
+                obj['execution_frequency'] = ''
1153
+              } else {
1154
+            if (key == '默认执行频率') {
1155
+                obj['execution_frequency'] = results[i][key].replace(/\s/g,"")
1156
+              }
1157
+           }
1158
+
1198 1159
            if (results[i]['限制性用药'] === undefined) {
1199 1160
                 obj['lmt_used_flag'] = ''
1200 1161
               } else {
@@ -1415,12 +1376,14 @@
1415 1376
 
1416 1377
         }
1417 1378
        }
1418
-
1379
+       for(let i=0;i<tableData.length;i++){
1380
+          tableData[i].dose = parseInt(tableData[i].dose)
1381
+       }
1419 1382
        let params = {
1420 1383
           'drugs':tableData
1421 1384
         };
1422 1385
         console.log("params222222222",params)
1423
-
1386
+        
1424 1387
         postDrugInformation(params).then(response=>{
1425 1388
            if(response.data.state == 1){
1426 1389
              var msg =  response.data.data.msg;

+ 4 - 6
src/xt_pages/dialysis/details/dialog/treatmentSummaryDialog.vue View File

@@ -184,11 +184,11 @@ export default {
184 184
     show(record,date) {
185 185
       this.isVisibility = true
186 186
       this.record = record
187
-      console.log(111111111111111,date)
187
+      
188 188
       if(date){
189 189
         this.date = date
190 190
         this.record_date = uParseTime(this.date, '{y}-{m}-{d}')
191
-        console.log(22222222222,this.record_date)
191
+       
192 192
       }
193 193
       
194 194
       console.log('治疗小结', record)
@@ -320,16 +320,14 @@ export default {
320 320
       })
321 321
     },
322 322
     getPermission() {
323
-      request
324
-        .get('/api/func_per/get', {
323
+      request.get('/api/func_per/get', {
325 324
           params: {
326 325
             create_url: '/api/dialysis/treatmentsummary?mode=1',
327 326
             modify_url: '/api/dialysis/treatmentsummary?mode=2',
328 327
             modify_other_url: '/api/dialysis/treatmentsummary?mode=3',
329 328
             module: 9
330 329
           }
331
-        })
332
-        .then(res => {
330
+        }).then(res => {
333 331
           if (res.data.state == 0) {
334 332
             this.hasPermission = false
335 333
           } else if (res.data.state == 1) {

+ 1 - 1
src/xt_pages/stock/detail/stockOutDetail.vue View File

@@ -751,7 +751,7 @@ export default {
751 751
 
752 752
        const data = this.formatJson(filterVal, this.tableOut)
753 753
        console.log("date2332323232",data)
754
-        return
754
+      
755 755
         excel.export_json_to_excel({
756 756
            header: tHeader,
757 757
            data,

+ 31 - 8
src/xt_pages/stock/drugs/components/drugOutDetail.vue View File

@@ -541,22 +541,20 @@ export default {
541 541
         }
542 542
         for(let i=0;i<this.tablePrint.length;i++){
543 543
            if(this.org_id == 9671 || this.org_id == 9919 ){
544
-             this.tablePrint[i].price = this.tablePrint[i].last_price
544
+           
545 545
              this.tablePrint[i].count = this.getCountSix(this.tablePrint[i].drug_id,this.tablePrint[i].child)
546
-             this.tablePrint[i].total_price = this.getCountSenven(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].last_price)
546
+             this.tablePrint[i].total_price = this.getCountSenven(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
547 547
              this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
548
-             this.tablePrint[i].total = this.getCountSenvenOne(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].last_price)
548
+             this.tablePrint[i].total = this.getCountSenvenOne(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
549 549
            }else{
550 550
               this.tablePrint[i].count = this.getCount(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_unit,this.tablePrint[i].min_number)
551 551
               this.tablePrint[i].total_price = this.getTotalPrice(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].price)
552 552
               this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
553 553
               this.tablePrint[i].total = this.getTotalPriceOne(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].price) 
554 554
            }
555
-         
556
-          
557 555
         }
558 556
        console.log("列表数据333333333",this.tablePrint)
559
-    
557
+      
560 558
        import('@/vendor/Export2Excel').then(excel => {
561 559
        const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
562 560
        const filterVal = ['index','drug_name', 'unit', 'min_unit','count','price','total_price','remark']
@@ -659,7 +657,30 @@ export default {
659 657
             var list = response.data.data.list
660 658
             console.log("药品出库详情",list)
661 659
             let objInfo = {}
662
-            list.forEach((item,index)=>{
660
+            if(this.org_id == 9671 || this.org_id == 9919){
661
+              list.forEach((item,index)=>{
662
+              let { drug_id } = item
663
+              if(!objInfo[drug_id]){
664
+                objInfo[drug_id] = {
665
+                  drug_id,
666
+                  child:[],
667
+                  drug_name:item.XtBaseDrug.drug_name,
668
+                  drug_spec:item.XtBaseDrug.drug_spec,
669
+                  min_unit:item.XtBaseDrug.min_unit,
670
+                  count:0,
671
+                  price:item.XtBaseDrug.last_price,
672
+                  remark:item.XtBaseDrug.remark,
673
+                  total_price:"",
674
+                  dose:item.XtBaseDrug.dose,
675
+                  dose_unit:item.XtBaseDrug.dose_unit,
676
+                  min_number:item.XtBaseDrug.min_number,
677
+                  max_unit:item.XtBaseDrug.max_unit,
678
+                  min_price:item.XtBaseDrug.min_price,
679
+                }
680
+              }
681
+            })
682
+            }else{
683
+               list.forEach((item,index)=>{
663 684
               let { drug_id } = item
664 685
               if(!objInfo[drug_id]){
665 686
                 objInfo[drug_id] = {
@@ -680,6 +701,8 @@ export default {
680 701
                 }
681 702
               }
682 703
             })
704
+            }
705
+           
683 706
             let newArr = Object.values(objInfo);
684 707
             for(let i=0;i<newArr.length;i++){
685 708
               for(let j=0;j<list.length;j++){
@@ -752,7 +775,7 @@ export default {
752 775
         return total*min_price
753 776
       },
754 777
       getCountSix(drug_id,val){
755
-        console.log("val233232",val)
778
+     
756 779
         var count = 0 
757 780
         for(let i=0;i<val.length;i++){
758 781
           count+= val[i].count

+ 3 - 0
src/xt_pages/stock/stockPrint.vue View File

@@ -14,6 +14,9 @@
14 14
                     <div class="order_title_panl">
15 15
                         <span class="main_title">耗材管理查询表</span>
16 16
                     </div>
17
+                    <div style="text-align:left;margin-bottom:20px;font-size: 18px;margin-bottom:-30px" v-if="org_id == 3907 || org_id == 9671">
18
+                      <span v-if="end_time!=''">查询日期:{{start_time}} ~</span>  {{end_time}}
19
+                    </div>
17 20
                     <div style="text-align:right;margin-bottom:20px;font-size: 18px;">
18 21
                       打印时间:{{time_now}}
19 22
                     </div>

+ 13 - 12
src/xt_pages/workforce/template.vue View File

@@ -103,7 +103,7 @@
103 103
 
104 104
 
105 105
         <el-button size="small" icon="el-icon-setting" type="primary" @click="setScheduleTemplateAction">设置模板</el-button>
106
-        <!-- <el-button size="small" icon="el-icon-setting" type="primary" @click="setData">同步数据</el-button> -->
106
+        <el-button size="small" icon="el-icon-setting" type="primary" @click="setData">同步数据</el-button>
107 107
       </div>
108 108
       <!-- </el-col> -->
109 109
     </div>
@@ -117,18 +117,19 @@
117 117
                           :patients="patients"></template-table>
118 118
         </el-tab-pane>
119 119
         <el-tab-pane name="first" :disabled="template_mode.mode == 0">
120
-          <span slot="label"> 第一周
121
-             <span v-if="schedule.execute_times%2==0">(本周)</span>
122
-             <span v-if="schedule.execute_times%2!=0">(下一周)</span>
120
+          <span slot="label"> 模板一
121
+            <span v-if="schedule.mode ==1">(本周)</span>
122
+             <span v-if="schedule.mode == 2 && schedule.execute_times%2==0">(下一周)</span>
123
+             <span v-if="schedule.mode == 2 && schedule.execute_times%2!=0">(本周)</span>
123 124
           </span>
124 125
           <template-table :editable="true" :device_numbers="device_numbers" :template="first_template"
125 126
                           :patients="patients" @cancel_sch="refresh"></template-table>
126 127
         </el-tab-pane>
127 128
 
128 129
         <el-tab-pane name="second" :disabled="template_mode.mode != 2">
129
-          <span slot="label"> 第二周
130
-             <span v-if="schedule.execute_times%2==0">(下一周)</span>
131
-             <span v-if="schedule.execute_times%2!=0">(本周)</span>
130
+          <span slot="label"> 模板二
131
+             <span v-if="schedule.mode == 2 && schedule.execute_times%2==0">(本周)</span>
132
+             <span v-if="schedule.mode == 2 && schedule.execute_times%2!=0">(下一周)</span>
132 133
            </span>
133 134
           <template-table :editable="true" :device_numbers="device_numbers" :template="second_template"
134 135
                           :patients="patients" @cancel_sch="refresh"></template-table>
@@ -141,9 +142,9 @@
141 142
 
142 143
      <el-dialog title="同步排班" width="600px" :visible.sync="newVisible">
143 144
             <el-form :model="form"  ref="form" label-width="90px" :rules="rules">
144
-                <el-form-item label="同步周次:">
145
-                   <el-radio v-model="form.firstWeek" label="1">第一周</el-radio>
146
-                   <el-radio v-model="form.firstWeek" label="2">第二周</el-radio>
145
+                <el-form-item label="同步模板:">
146
+                   <el-radio v-model="form.firstWeek" label="1">模板一</el-radio>
147
+                   <el-radio v-model="form.firstWeek" label="2">模板二</el-radio>
147 148
                 </el-form-item>
148 149
                 <el-form-item label="同步到 :">
149 150
                   <el-select v-model="form.copyWeek" placeholder="请选择" required  prop="copyWeek">
@@ -267,14 +268,14 @@
267 268
      for(let i = 0; i < this.weekList.length; i++){
268 269
          if(this.weekNum + i + 1 <= 53){
269 270
              let num = this.weekNum + i 
270
-            let str = this.weekList[i][0] + '~' + this.weekList[i][6] + '(' + num + ')'
271
+            let str = this.weekList[i][0] + '~' + this.weekList[i][6] 
271 272
              this.typeOptions.push({value:i,label:str})
272 273
             let stt = this.weekList[i][0] +"~"+this.weekList[i][6]
273 274
             this.timeOptions.push({value:i,label:stt})
274 275
         }else{
275 276
 
276 277
             newNum++
277
-            let str = this.weekList[i][0] + '~' + this.weekList[i][6] + '(' + newNum + ')'
278
+            let str = this.weekList[i][0] + '~' + this.weekList[i][6] 
278 279
             this.typeOptions.push({value:i,label:str})
279 280
             let stt = this.weekList[i][0] +"~"+this.weekList[i][6]
280 281
             this.timeOptions.push({value:i,label:stt})