Browse Source

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

huangyw 2 years ago
parent
commit
16bf6b0d45

+ 8 - 0
src/api/config.js View File

202
     params: params
202
     params: params
203
   })
203
   })
204
 }
204
 }
205
+
206
+export function changeDrugOpenConfig(params) {
207
+  return request({
208
+    url: '/api/changedrugopenconfig',
209
+    method: 'get',
210
+    params: params
211
+  })
212
+}

+ 30 - 1
src/xt_pages/data/basicConfig.vue View File

39
             <p style="margin-top:20px;">耗材先出库再执行:
39
             <p style="margin-top:20px;">耗材先出库再执行:
40
                 <el-switch v-model="is_open_is_type" @change="changeFuncType"></el-switch>
40
                 <el-switch v-model="is_open_is_type" @change="changeFuncType"></el-switch>
41
             </p>
41
             </p>
42
+            <!-- <p style="margin-top:20px;">药品在保存处方时出库:
43
+                <el-switch v-model="drug_out_open" @change="changeDrugOpen"></el-switch>
44
+            </p> -->
42
         </div>
45
         </div>
43
 
46
 
44
 
47
 
94
 
97
 
95
 <script>
98
 <script>
96
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
99
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
97
-import { getAllIsOpenInit,postXtHisIsOpen,postMonitorIsOpen,changeFuncPrint,getDataPrintList,postXtHisProjectIsOpen,changeStockSetting,changeAdviceConfig,changePrescriptionConfig} from '@/api/config'
100
+import { getAllIsOpenInit,postXtHisIsOpen,postMonitorIsOpen,changeFuncPrint,getDataPrintList,postXtHisProjectIsOpen,changeStockSetting,changeAdviceConfig,changePrescriptionConfig,changeDrugOpenConfig} from '@/api/config'
98
 
101
 
99
 export default {
102
 export default {
100
   name: "printTemplate",
103
   name: "printTemplate",
115
       is_open_is_type:false,
118
       is_open_is_type:false,
116
       is_open_advice_xt_his:false,
119
       is_open_advice_xt_his:false,
117
       is_open_prescription_xt_his:false,
120
       is_open_prescription_xt_his:false,
121
+      drug_out_open:false,
118
     };
122
     };
119
   },
123
   },
120
   methods: {
124
   methods: {
154
               this.is_open_prescription_xt_his = false
158
               this.is_open_prescription_xt_his = false
155
             }
159
             }
156
 
160
 
161
+            if(response.data.data.is_open == 1){
162
+              this.drug_out_open = true
163
+            }else{
164
+              this.drug_out_open = false
165
+            }
166
+
157
           } else {
167
           } else {
158
             this.$message.error(response.data.msg)
168
             this.$message.error(response.data.msg)
159
           }
169
           }
376
             this.$message.success("保存成功!")
386
             this.$message.success("保存成功!")
377
           }
387
           }
378
       })
388
       })
389
+    },
390
+    changeDrugOpen(){
391
+      var drug_out_open = 0
392
+      if(this.drug_out_open == false){
393
+        drug_out_open = 2
394
+      }
395
+      if(this.drug_out_open == false){
396
+        drug_out_open = 2
397
+      }
398
+      var params = {
399
+        drug_out_open:drug_out_open,
400
+      }
401
+      changeDrugOpenConfig(params).then(response=>{
402
+        if(response.data.state == 1){
403
+           var msg =  response.data.data.msg
404
+           this.$message.success("保存成功!")
405
+        }
406
+      })
407
+
379
     }
408
     }
380
 
409
 
381
   },
410
   },

+ 21 - 25
src/xt_pages/stock/drugs/components/drugOutDetail.vue View File

159
         </el-table-column>
159
         </el-table-column>
160
         <el-table-column label="总价" align="center">
160
         <el-table-column label="总价" align="center">
161
           <template slot-scope="scope">
161
           <template slot-scope="scope">
162
-           <span v-if="org_id == 9919">{{(scope.row.last_price * scope.row.count).toFixed(2)}} </span> 
163
-           <span v-if="org_id == 10210 ">{{(scope.row.price * scope.row.count).toFixed(2)}} </span> 
164
-           <span v-if="org_id == 9671 ">{{(scope.row.price * scope.row.count).toFixed(2)}} </span> 
165
-           <span v-if ="org_id!=9919 && org_id!=10210 && org_id!=9671">
166
-             <!-- <span v-if="scope.row.price >0">
167
-                <span v-if="scope.row.count_unit == scope.row.min_unit">
168
-                  {{(scope.row.price * scope.row.count).toFixed(2)}}
169
-                </span>  
170
-                <span v-if="scope.row.count_unit == scope.row.max_unit">{{(scope.row.price * scope.row.count * scope.row.min_number).toFixed(2)}}</span>
171
-              </span>
172
-             <span v-if="scope.row.price  == 0">
173
-               <span v-if="scope.row.count_unit  == scope.row.min_unit">
174
-                 {{((getPrice(scope.row.drug_id)* scope.row.count)).toFixed(2)}}
175
-               </span> 
176
-               <span v-if="scope.row.count_unit == scope.row.max_unit">
177
-                 {{(getPrice(scope.row.drug_id)* scope.row.count * scope.row.min_number).toFixed(2)}}
178
-              </span>
179
-             </span> -->
180
-             {{scope.row.total_price}}
181
-           </span>
162
+            <span v-if="scope.row.is_total !=1">
163
+              <span v-if="org_id == 9919">{{(scope.row.last_price * scope.row.count).toFixed(2)}} </span> 
164
+              <span v-if="org_id == 10210 ">{{(scope.row.price * scope.row.count).toFixed(2)}} </span> 
165
+              <span v-if="org_id == 9671 ">{{(scope.row.price * scope.row.count).toFixed(2)}} </span> 
166
+              <span v-if ="org_id!=9919 && org_id!=10210 && org_id!=9671">
167
+                 {{scope.row.total_price}}
168
+               </span>
169
+            </span>
170
+            <span v-if="scope.row.is_total == 1">
171
+              {{scope.row.total_price}}
172
+            </span>
182
           </template>
173
           </template>
183
         </el-table-column>
174
         </el-table-column>
184
       </el-table>
175
       </el-table>
437
                order[i].total_price = order[i].count * order[i].last_price
428
                order[i].total_price = order[i].count * order[i].last_price
438
                total_price += order[i].count * order[i].last_price
429
                total_price += order[i].count * order[i].last_price
439
              }else{
430
              }else{
431
+               console.log("555555555555",order[i])
440
                if(order[i].price > 0){
432
                if(order[i].price > 0){
433
+                console.log("近来33232323322323")
441
                  if(order[i].count_unit == order[i].min_unit && order[i].max_unit!=order[i].min_unit){
434
                  if(order[i].count_unit == order[i].min_unit && order[i].max_unit!=order[i].min_unit){
442
                    order[i].total_price = order[i].count * order[i].price
435
                    order[i].total_price = order[i].count * order[i].price
443
-                  total_price += order[i].total_price
444
                  }
436
                  }
445
                  if(order[i].count_unit == order[i].max_unit){
437
                  if(order[i].count_unit == order[i].max_unit){
446
                    if(order[i].is_sys == 0){
438
                    if(order[i].is_sys == 0){
449
                      order[i].total_price += order[i].count * order[i].price * order[i].min_number
441
                      order[i].total_price += order[i].count * order[i].price * order[i].min_number
450
                    }
442
                    }
451
                  }
443
                  }
444
+
445
+                total_price += order[i].total_price
452
                 
446
                 
453
                }
447
                }
448
+
454
                if(order[i].price ==0 ){
449
                if(order[i].price ==0 ){
455
                  if(order[i].count_unit == order[i].min_unit && order[i].max_unit!=order[i].min_unit){
450
                  if(order[i].count_unit == order[i].min_unit && order[i].max_unit!=order[i].min_unit){
456
                     order[i].total_price = order[i].count * this.getPrice(order[i].drug_id)
451
                     order[i].total_price = order[i].count * this.getPrice(order[i].drug_id)
457
-                   total_price +=order[i].total_price
452
+                  
458
                     order[i].price = this.getPrice(order[i].drug_id)
453
                     order[i].price = this.getPrice(order[i].drug_id)
459
                  }
454
                  }
460
                 
455
                 
466
                    }
461
                    }
467
                    order[i].price = this.getPrice(order[i].drug_id)
462
                    order[i].price = this.getPrice(order[i].drug_id)
468
                 }
463
                 }
469
-                 
464
+                total_price +=order[i].total_price
470
                } 
465
                } 
471
                
466
                
472
              }
467
              }
473
             
468
             
474
           }
469
           }
475
-         
470
+           console.log("toal_p3232332332233232",total_price)
476
            order.push({
471
            order.push({
477
             warehouse_out_order_number: "合计",
472
             warehouse_out_order_number: "合计",
478
             is_total: 1,
473
             is_total: 1,
487
        
482
        
488
           console.log("233223322323322332232323",order)
483
           console.log("233223322323322332232323",order)
489
           this.tableData = order
484
           this.tableData = order
485
+
490
            let objInfo = {}
486
            let objInfo = {}
491
           order.forEach((item,index)=>{
487
           order.forEach((item,index)=>{
492
              let { drug_id } = item
488
              let { drug_id } = item
579
           this.tablePrint[i].index = i+1
575
           this.tablePrint[i].index = i+1
580
         }
576
         }
581
         for(let i=0;i<this.tablePrint.length;i++){
577
         for(let i=0;i<this.tablePrint.length;i++){
582
-           if(this.org_id == 9919 ){
578
+           if(this.org_id == 9919){
583
            
579
            
584
              this.tablePrint[i].count = this.getCountSix(this.tablePrint[i].drug_id,this.tablePrint[i].child)
580
              this.tablePrint[i].count = this.getCountSix(this.tablePrint[i].drug_id,this.tablePrint[i].child)
585
              this.tablePrint[i].total_price = this.getCountSenven(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
581
              this.tablePrint[i].total_price = this.getCountSenven(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)

+ 102 - 25
src/xt_pages/stock/drugs/drugStockOutOrderDetailPrint.vue View File

7
     </div>
7
     </div>
8
     <div class="app-container ">
8
     <div class="app-container ">
9
       <div id="dialysis-print-box">
9
       <div id="dialysis-print-box">
10
+        <div v-if="org_id!=9671">
10
         <div class="dialysis-print-order" v-for="(it,index) in tableList" :key="index">
11
         <div class="dialysis-print-order" v-for="(it,index) in tableList" :key="index">
11
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;margin-top:40px">{{orgName}}</div>
12
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;margin-top:40px">{{orgName}}</div>
12
           <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
13
           <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
58
              </tr>
59
              </tr>
59
             </tbody>
60
             </tbody>
60
           </table>
61
           </table>
62
+          <div v-if="orgId != 10024" style="display:flex;margin-top:1px;float:right;">
63
+            <div style="width:50px;">审批:</div><div style="width:100px;"></div>
64
+            <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
65
+            <div style="width:50px;">会计:</div><div style="width:100px;"></div>
66
+            <div style="width:50px;">审核:</div><div style="width:100px;"></div>
67
+            <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
68
+          </div>
69
+          <div v-if="orgId == 10024" style="display:flex;margin-top:1px;float:right;">
70
+            <div style="width:50px;">科室:</div><div style="width:60px;"></div>
71
+            <div style="width:70px;">领料人:</div><div style="width:60px;"></div>
72
+            <div style="width:80px;">审批:</div><div style="width:100px;">肖庆娥</div>
73
+            <div style="width:50px;">会计:</div><div style="width:100px;">徐立琼</div>
74
+            <div style="width:50px;">审核:</div><div style="width:100px;">徐立琼</div>
75
+            <div style="width:70px;">制单人:</div><div style="width:100px;">徐立琼</div>
76
+          </div>
77
+        </div>
78
+      </div> 
79
+
61
 
80
 
81
+      <div v-if="org_id == 9671">
82
+       <div class="dialysis-print-order" v-for="(it,index) in tableData" :key="index" >
83
+         <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;margin-top:40px">{{orgName}}</div>
84
+          <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
62
 
85
 
86
+          <div style="float: left;margin-bottom: 1px;">单据编号:{{it.warehouse_out_order_number}}</div>
87
+          <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
88
+
89
+          <table class="print-table" border="1">
90
+            <tbody>
91
+            <tr>
92
+              <td style="line-height: 50px" width="230">药品名称</td>
93
+              <td style="line-height: 50px" width="230">规格型号</td>
94
+              <td style="line-height: 50px" width="80">出货数量</td>
95
+              <td style="line-height: 50px" width="50">单位</td>
96
+              <td style="line-height:50px" width="80">出库价格</td>
97
+              <td style="line-height: 50px" width="80">总价</td>
98
+              <td style="line-height: 50px" width="80">批号</td>
99
+              <td style="line-height: 50px" width="80">生产日期</td>
100
+              <td style="line-height: 50px" width="80">有效日期</td>
101
+            </tr>
102
+
103
+            <tr v-for="(item,i) in it.xt_drug_warehouse_out_info" :key="i">
104
+              <td style="line-height: 50px">
105
+                <span>{{item.drug.drug_name}}</span>
106
+              </td>
107
+              <td style="line-height: 50px">
108
+                  <span>{{item.drug.dose}}{{item.dose_unit}}*{{item.drug.min_number}}{{item.drug.min_unit}}/{{item.drug.max_unit}}</span>
109
+              </td>
110
+              <td style="line-height: 50px">
111
+                  {{item.count}}
112
+              </td>
113
+              <td style="line-height: 50px">
114
+                <span>{{item.count_unit}}</span>
115
+              </td>
116
+              <td style="line-height:50px">
117
+                  {{item.price}}
118
+              </td>
119
+             <td  style="line-height:50px">
120
+                {{(item.count * item.price).toFixed(2)}}
121
+             </td>
122
+             <td>{{item.batch_number}}</td>
123
+             <td>{{(getTime(item.product_date))}}</td>
124
+             <td>{{(getTime(item.expire_date))}}</td>
125
+            </tr>
126
+             <tr>
127
+               <td style="line-height:50px">合计</td>
128
+               <td colspan="7"></td>
129
+               <td>{{getTotalPrince(it.xt_drug_warehouse_out_info).toFixed(2)}}</td>
130
+             </tr>
131
+            </tbody>
132
+          </table>
63
           <div v-if="orgId != 10024" style="display:flex;margin-top:1px;float:right;">
133
           <div v-if="orgId != 10024" style="display:flex;margin-top:1px;float:right;">
64
             <div style="width:50px;">审批:</div><div style="width:100px;"></div>
134
             <div style="width:50px;">审批:</div><div style="width:100px;"></div>
65
             <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
135
             <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
77
           </div>
147
           </div>
78
         </div>
148
         </div>
79
 
149
 
150
+       </div>
80
       </div>
151
       </div>
81
 
152
 
82
     </div>
153
     </div>
133
         manufactureList:[],
204
         manufactureList:[],
134
         tableList:[],
205
         tableList:[],
135
         loading:false,
206
         loading:false,
136
-        warehouseList:[]
207
+        warehouseList:[],
208
+        tableData:[],
137
       }
209
       }
138
     },
210
     },
139
     methods: {
211
     methods: {
175
             const params = {
247
             const params = {
176
             'id': order_id
248
             'id': order_id
177
             };
249
             };
178
-            getDrugWarehouseOutInfo(params).then(response => {
179
-            if (response.data.state == 0) {
250
+     getDrugWarehouseOutInfo(params).then(response => {
251
+        if (response.data.state == 0) {
180
 
252
 
181
-                this.$message.error(response.data.msg);
182
-                return false
183
-            } else {
184
-              for (let i = 0; i < response.data.data.list.length; i++) {
185
-                this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
186
-               }
187
-               var total_price = 0;
188
-               for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
189
-                 total_price += this.warehousingOutInfo.warehousingOutData[i].count * this.warehousingOutInfo.warehousingOutData[i].price
190
-               }
191
-               this.allPrice = total_price;
192
-               this.warehousingOutInfo.info = response.data.data.info;
193
-               this.handleSpanTempArr()
253
+            this.$message.error(response.data.msg);
254
+            return false
255
+        } else {
256
+          for (let i = 0; i < response.data.data.list.length; i++) {
257
+            this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
194
             }
258
             }
195
-            })
196
-        },
259
+            var total_price = 0;
260
+            for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
261
+              total_price += this.warehousingOutInfo.warehousingOutData[i].count * this.warehousingOutInfo.warehousingOutData[i].price
262
+            }
263
+            this.allPrice = total_price;
264
+            this.warehousingOutInfo.info = response.data.data.info;
265
+            this.handleSpanTempArr()
266
+        }
267
+      })
268
+     },
197
         getList() {
269
         getList() {
198
         let params = {
270
         let params = {
199
           page: this.page,
271
           page: this.page,
213
             for (let i = 0; i < response.data.data.list.length; i++) {
285
             for (let i = 0; i < response.data.data.list.length; i++) {
214
               this.list.push(response.data.data.list[i])
286
               this.list.push(response.data.data.list[i])
215
             }
287
             }
216
-            console.log("list222222",this.list)
288
+           
217
           }
289
           }
218
         })
290
         })
219
       },
291
       },
265
         getDrugWarehouseOrderInfo().then(response=>{
337
         getDrugWarehouseOrderInfo().then(response=>{
266
            if(response.data.state == 1){
338
            if(response.data.state == 1){
267
              var list =  response.data.data.list
339
              var list =  response.data.data.list
268
-             console.log("入库单详情",list)
269
              this.drugOrderList = list
340
              this.drugOrderList = list
270
            }
341
            }
271
         })
342
         })
315
         getDrugOutOrderDetailPrint(params).then(response=>{
386
         getDrugOutOrderDetailPrint(params).then(response=>{
316
           if(response.data.state ==1){
387
           if(response.data.state ==1){
317
              var info = response.data.data.info
388
              var info = response.data.data.info
318
-             console.log("info",info)
319
             var warehousing = response.data.data.warehousing
389
             var warehousing = response.data.data.warehousing
320
-            console.log("ware2232",warehousing)
321
             this.warehouseList = warehousing
390
             this.warehouseList = warehousing
322
           
391
           
323
             for(let i=0;i<info.length;i++){
392
             for(let i=0;i<info.length;i++){
330
             }
399
             }
331
             
400
             
332
             var manufacturerList = response.data.data.manufacturerList
401
             var manufacturerList = response.data.data.manufacturerList
333
-            console.log("manufacturelist",manufacturerList)
402
+           
334
             this.manufactureList = manufacturerList
403
             this.manufactureList = manufacturerList
335
-            console.log("列表",info)
404
+
336
             this.tableList = info
405
             this.tableList = info
406
+            this.tableData = response.data.data.drug_warhouse_out
337
             this.loading = false
407
             this.loading = false
338
           }
408
           }
339
         })
409
         })
346
           }
416
           }
347
         }
417
         }
348
         return count
418
         return count
349
-      }
419
+      },
420
+      getTotalPrice(val){
421
+        var count = 0
422
+        for(let i=0;i<val.length;i++){
423
+           count +=val[i].count * val[i].price
424
+          }
425
+         return count.toFixed(2)
426
+        }
350
     },
427
     },
351
     created() {
428
     created() {
352
       this.orgName = this.$store.getters.xt_user.org.org_name;
429
       this.orgName = this.$store.getters.xt_user.org.org_name;