陈少旭 hace 4 meses
padre
commit
6f55d43ff8

+ 13 - 5
src/api/pharmacy.js Ver fichero

@@ -122,7 +122,7 @@ export function routeofadministration(params) {
122 122
 }
123 123
 
124 124
 export function getGoodInventoryList(params){
125
-  
125
+
126 126
   return request({
127 127
     url:"/api/pharmacy/getgoodinventorylist",
128 128
     method:"Get",
@@ -131,7 +131,7 @@ export function getGoodInventoryList(params){
131 131
 }
132 132
 
133 133
 export function getGoodInventoryByGoodId(id,params){
134
-  
134
+
135 135
   return request({
136 136
     url:"/api/pharmacy/getgoodinventorybygoodid?id="+id,
137 137
     method:"get",
@@ -140,13 +140,13 @@ export function getGoodInventoryByGoodId(id,params){
140 140
 }
141 141
 
142 142
 export function updateInventoryWarehouseInfo(params){
143
-  
143
+
144 144
   return request({
145 145
     url:"/api/pharmacy/updateInventoryWarehouseInfo",
146 146
     method:"get",
147 147
     params:params,
148 148
   })
149
-} 
149
+}
150 150
 
151 151
 export function getDrugInventoryList(params){
152 152
 
@@ -175,6 +175,14 @@ export function updateDrugInventoryWarehouseInfo(params){
175 175
   })
176 176
 }
177 177
 
178
+export function changeZeroFlag(params){
179
+  return request({
180
+    url:"/api/pharmacy/changeZeroFlag",
181
+    method:"get",
182
+    params:params,
183
+  })
184
+}
185
+
178 186
 export function changeDrugCode(params){
179 187
 
180 188
   return request({
@@ -182,4 +190,4 @@ export function changeDrugCode(params){
182 190
     method:"get",
183 191
     params:params,
184 192
   })
185
-}
193
+}

+ 26 - 1
src/xt_pages/Pharmacy/PatientDispensing.vue Ver fichero

@@ -250,6 +250,18 @@
250 250
             </el-table-column>
251 251
 
252 252
 
253
+
254
+            <el-table-column align="center"  width="100" label="拆零标志">
255
+              <template slot-scope="scope">
256
+                <el-select  v-model="scope.row.ZeroFlag" placeholder="请选择" @change="changevalue(scope.row)">
257
+                  <el-option label="未知" value="0"></el-option>
258
+                  <el-option label="是" value="1"></el-option>
259
+                  <el-option label="否" value="2"></el-option>
260
+                </el-select>
261
+              </template>
262
+            </el-table-column>
263
+
264
+
253 265
             <el-table-column label="备注" width="170" align="center">
254 266
               <template slot-scope="scope">
255 267
                 <span>{{ scope.row.Remarks ? scope.row.Remarks : "" }}</span>
@@ -338,7 +350,9 @@ import {
338 350
   dispensingmedicine,
339 351
   drugwithdrawal,
340 352
   getpartitionlist,
341
-  changeDrugCode
353
+  changeDrugCode,
354
+  changeZeroFlag
355
+
342 356
 } from "@/api/pharmacy";
343 357
 import dataDruguse from "../../router/modules/dataDruguse";
344 358
 import axios from 'axios'
@@ -413,6 +427,17 @@ export default {
413 427
     // this.selectedbydefault();
414 428
   },
415 429
   methods: {
430
+    changevalue(row){
431
+      var params = {
432
+        id:row.ID,
433
+        zero_flag:row.zero_flag,
434
+      }
435
+      changeZeroFlag(params).then(response=>{
436
+        if(response.data.state == 1){
437
+          this.$message.success("切换成功")
438
+        }
439
+      })
440
+    },
416 441
     getgetpartitionlist() {
417 442
       var params = {};
418 443
       getpartitionlist(params).then((res) => {

+ 5 - 16
src/xt_pages/drugSourceCode/drugChange.vue Ver fichero

@@ -113,11 +113,7 @@
113 113
           </template>
114 114
         </el-table-column>
115 115
 
116
-        <el-table-column align="center" prop="total" label="盘存日期">
117
-          <template slot-scope="scope">
118
-            <div>{{scope.row.pc_date}}</div>
119
-          </template>
120
-        </el-table-column>
116
+
121 117
 
122 118
         <el-table-column label="操作" width="200">
123 119
           <template slot-scope="scope">
@@ -183,17 +179,7 @@
183 179
         </el-table-column>
184 180
 
185 181
 
186
-        <el-table-column align="center" prop="total" label="盘存状态">
187
-          <template slot-scope="scope">
188
-            <div>{{scope.row.is_pc?'已盘存':'未盘存'}}</div>
189
-          </template>
190
-        </el-table-column>
191 182
 
192
-        <el-table-column align="center" prop="total" label="盘存日期">
193
-          <template slot-scope="scope">
194
-            <div>{{scope.row.pc_date}}</div>
195
-          </template>
196
-        </el-table-column>
197 183
 
198 184
       </el-table>
199 185
     </div>
@@ -356,6 +342,10 @@ export default {
356 342
 
357 343
     },
358 344
     sigle_stock(row){
345
+       if(row.drug_code.length == 0){
346
+         this.$message.error("追溯码不能为空");
347
+         return
348
+       }
359 349
       var that = this;
360 350
       let params = {
361 351
         ids:row.id,
@@ -464,7 +454,6 @@ export default {
464 454
       return jsonData.map(v => filterVal.map(j => v[j]))
465 455
     },
466 456
     change_stock(){
467
-
468 457
       let ids  = ""
469 458
       for (var i = 0; i < this.selection.length; i++){
470 459
         if (ids.length == 0){

+ 114 - 17
src/xt_pages/drugSourceCode/drugCodeQuery.vue Ver fichero

@@ -94,9 +94,9 @@
94 94
         <el-table-column align="center" prop="name" label="操作" width="200">
95 95
           <template slot-scope="scope">
96 96
             <div>
97
-             <el-button v-if="scope.row.is_upload == 1" type="primary" @click="sigle_stock(scope.row)">撤销</el-button>
98
-            <el-button type="primary" v-if="scope.row.is_upload == 0 || scope.row.is_upload == 2" @click="toUpload(scope.row)">上传</el-button>
99
-            <el-button v-if="faShow == true" type="primary" @click="toFaYao(scope.row)">发药</el-button>
97
+             <el-button v-if="scope.row.is_upload == 1" type="primary" @click="revokeDrugCode(scope.row)">撤销</el-button>
98
+            <el-button type="primary" v-if="scope.row.is_upload == 0" @click="toUpload(scope.row)">上传</el-button>
99
+<!--            <el-button v-if="faShow == true" type="primary" @click="toFaYao(scope.row)">发药</el-button>-->
100 100
             </div>
101 101
           </template>
102 102
         </el-table-column>
@@ -189,7 +189,61 @@
189 189
       }
190 190
     },
191 191
     methods: {
192
-        changeText(event){
192
+      revokeDrugCode(row){
193
+        let ids  = row.id
194
+        var that = this;
195
+        let params = {
196
+          id:ids,
197
+          admin_user_id:this.$store.getters.xt_user.user.id
198
+        };
199
+        axios.get('http://127.0.0.1:9532/test/net',{}).then(function(response) {
200
+          if (response.data.state == 0) {
201
+            // that.$message.error(response.data.data.msg);
202
+            that.$confirm("请检查医保程序是否有打开", "提示", {
203
+              confirmButtonText: "确 定",
204
+              cancelButtonText: "取 消",
205
+              type: "warning",
206
+            }).then(() => {
207
+
208
+            })
209
+              .catch(() => {});
210
+            return false
211
+          } else {
212
+            axios.get('http://127.0.0.1:9532/api/delete_xs_bg_three',{params:params}).then(function(response) {
213
+              if (response.data.state == 0) {
214
+
215
+                that.$message.error(response.data.data.msg);
216
+                return false
217
+              } else {
218
+                if(response.data.data.failed_code == -10){
219
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
220
+                    confirmButtonText: '确 定',
221
+                    type: 'warning'
222
+                  }).then(() => {
223
+
224
+                  }).catch(() => {
225
+                  })
226
+                }else{
227
+                  that.getlist()
228
+                }
229
+              }
230
+            }).catch(function(error) {
231
+            })
232
+          }
233
+        }).catch(function(error) {
234
+          that.$confirm("请检查医保程序是否有打开", "提示", {
235
+            confirmButtonText: "确 定",
236
+            cancelButtonText: "取 消",
237
+            type: "warning",
238
+          }).then(() => {
239
+          })
240
+            .catch(() => {});
241
+        })
242
+
243
+
244
+
245
+      },
246
+      changeText(event){
193 247
         // 检查是否为特定的按键,例如回车键,来确认扫码枪输入完成
194 248
         if (event.key === 'Enter') {
195 249
             var textarea = ""
@@ -197,7 +251,7 @@
197 251
             this.textarea = textarea
198 252
         }
199 253
        },
200
-       getDrugCode(id,DataSources,DrugCode,index){
254
+      getDrugCode(id,DataSources,DrugCode,index){
201 255
             this.id = id
202 256
             this.textarea = DrugCode
203 257
             this.currentIndex = index
@@ -222,7 +276,7 @@
222 276
          }
223 277
       })
224 278
     },
225
-    getPatientName(id){
279
+      getPatientName(id){
226 280
        var name = ""
227 281
        for(let i=0;i<this.patientList.length;i++){
228 282
           if(id == this.patientList[i].id){
@@ -372,21 +426,64 @@
372 426
         this.end_time = val
373 427
       },
374 428
       toUpload(row){
375
-        if(row.is_medicine == 0 || row.is_is_medicine == 2){
376
-          this.$message.error("该药品未发药,请先发药")
377
-          this.faShow = true
429
+        if(row.drug_code.length == 0){
430
+          this.$message.error("追溯码不能为空");
378 431
           return
379 432
         }
380
-        var params = {
381
-          drug_id:row.drug_id,
382
-          patient_id:row.patient_id,
383
-         advice_date:row.advice_date,
384
-        }
385
-        createUploadDrugCode(params).then(response=>{
386
-          if(response.data.state == 1){
387
-            this.$message.success("上传成功!")
433
+        let ids  = row.id
434
+        var that = this;
435
+        let params = {
436
+          id:ids,
437
+          admin_user_id:this.$store.getters.xt_user.user.id
438
+        };
439
+
440
+        axios.get('http://127.0.0.1:9532/test/net',{}).then(function(response) {
441
+          if (response.data.state == 0) {
442
+            // that.$message.error(response.data.data.msg);
443
+            that.$confirm("请检查医保程序是否有打开", "提示", {
444
+              confirmButtonText: "确 定",
445
+              cancelButtonText: "取 消",
446
+              type: "warning",
447
+            }).then(() => {
448
+
449
+
450
+            })
451
+              .catch(() => {});
452
+            return false
453
+          } else {
454
+
455
+            //有打开则调用接口
456
+            axios.get('http://127.0.0.1:9532/api/delete_xs_bg_three',{params:params}).then(function(response) {
457
+              if (response.data.state == 0) {
458
+                that.$message.error(response.data.data.msg);
459
+                return false
460
+              } else {
461
+                if(response.data.data.failed_code == -10){
462
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
463
+                    confirmButtonText: '确 定',
464
+                    type: 'warning'
465
+                  }).then(() => {
466
+
467
+                  }).catch(() => {
468
+                  })
469
+                }else{
470
+                  that.getlist()
471
+                }
472
+              }
473
+            }).catch(function(error) {
474
+            })
388 475
           }
476
+        }).catch(function(error) {
477
+          that.$confirm("请检查医保程序是否有打开", "提示", {
478
+            confirmButtonText: "确 定",
479
+            cancelButtonText: "取 消",
480
+            type: "warning",
481
+          }).then(() => {
482
+          })
483
+            .catch(() => {});
389 484
         })
485
+
486
+
390 487
       },
391 488
       toFaYao(row){
392 489
 

+ 155 - 156
src/xt_pages/drugSourceCode/drugQuery.vue Ver fichero

@@ -633,169 +633,168 @@ export default {
633 633
             type: "warning",
634 634
           }).then(() => {
635 635
 
636
-            this.tableData = []
637
-            if(that.stock_type == 1){
638
-
639
-              axios.get('http://127.0.0.1:9532/api/3508',{params:params}).then(function(response) {
640
-                if (response.data.state == 0) {
641
-                  that.$message.error(response.data.data.msg);
642
-                  return false
643
-                } else {
644
-                  if(response.data.data.failed_code == -10){
645
-                    that.$confirm(response.data.data.msg, '医保错误信息', {
646
-                      confirmButtonText: '确 定',
647
-                      type: 'warning'
648
-                    }).then(() => {
649
-
650
-                    }).catch(() => {
651
-                    })
652
-                  }else{
653
-                    that.tableData = that.tableData.concat(response.data.data.info)
654
-
655
-                  }
656
-                }
657
-              }).catch(function(error) {
658
-              })
659
-
660
-            }else if(that.stock_type == 2){
661
-              axios.get('http://127.0.0.1:9532/api/3509',{params:params}).then(function(response) {
662
-                if (response.data.state == 0) {
663
-                  that.$message.error(response.data.data.msg);
664
-                  return false
665
-                } else {
666
-                  if(response.data.data.failed_code == -10){
667
-                    that.$confirm(response.data.data.msg, '医保错误信息', {
668
-                      confirmButtonText: '确 定',
669
-                      type: 'warning'
670
-                    }).then(() => {
671
-
672
-                    }).catch(() => {
673
-                    })
674
-                  }else{
675
-                    that.tableData = that.tableData.concat(response.data.data.info)
676
-
677
-                  }
678
-                }
679
-              }).catch(function(error) {
680
-              })
681
-
682
-            }else if(that.stock_type == 3){
683
-              axios.get('http://127.0.0.1:9532/api/3511',{params:params}).then(function(response) {
684
-                if (response.data.state == 0) {
685
-                  that.$message.error(response.data.data.msg);
686
-                  return false
687
-                } else {
688
-                  if(response.data.data.failed_code == -10){
689
-                    that.$confirm(response.data.data.msg, '医保错误信息', {
690
-                      confirmButtonText: '确 定',
691
-                      type: 'warning'
692
-                    }).then(() => {
693
-
694
-                    }).catch(() => {
695
-                    })
696
-                  }else{
697
-                    that.tableData = that.tableData.concat(response.data.data.info)
698
-
699
-                  }
700
-                }
701
-              }).catch(function(error) {
702
-              })
703
-
704
-            }else if(that.stock_type == 4){
705
-              axios.get('http://127.0.0.1:9532/api/3512',{params:params}).then(function(response) {
706
-                if (response.data.state == 0) {
707
-                  that.$message.error(response.data.data.msg);
708
-                  return false
709
-                } else {
710
-                  if(response.data.data.failed_code == -10){
711
-                    that.$confirm(response.data.data.msg, '医保错误信息', {
712
-                      confirmButtonText: '确 定',
713
-                      type: 'warning'
714
-                    }).then(() => {
715
-
716
-                    }).catch(() => {
717
-                    })
718
-                  }else{
719
-                    that.tableData = that.tableData.concat(response.data.data.info)
720
-
721
-                  }
636
+
637
+          })
638
+            .catch(() => {});
639
+          return false
640
+        } else {
641
+
642
+          this.tableData = []
643
+          if(that.stock_type == 1){
644
+
645
+            axios.get('http://127.0.0.1:9532/api/3508',{params:params}).then(function(response) {
646
+              if (response.data.state == 0) {
647
+                that.$message.error(response.data.data.msg);
648
+                return false
649
+              } else {
650
+                if(response.data.data.failed_code == -10){
651
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
652
+                    confirmButtonText: '确 定',
653
+                    type: 'warning'
654
+                  }).then(() => {
655
+
656
+                  }).catch(() => {
657
+                  })
658
+                }else{
659
+                  that.tableData = that.tableData.concat(response.data.data.info)
660
+
722 661
                 }
723
-              }).catch(function(error) {
724
-              })
725
-
726
-            }else if(that.stock_type == 5){
727
-              axios.get('http://127.0.0.1:9532/api/3513',{params:params}).then(function(response) {
728
-                if (response.data.state == 0) {
729
-                  that.$message.error(response.data.data.msg);
730
-                  return false
731
-                } else {
732
-                  if(response.data.data.failed_code == -10){
733
-                    that.$confirm(response.data.data.msg, '医保错误信息', {
734
-                      confirmButtonText: '确 定',
735
-                      type: 'warning'
736
-                    }).then(() => {
737
-
738
-                    }).catch(() => {
739
-                    })
740
-                  }else{
741
-                    that.tableData = that.tableData.concat(response.data.data.info)
742
-
743
-                  }
662
+              }
663
+            }).catch(function(error) {
664
+            })
665
+
666
+          }else if(that.stock_type == 2){
667
+            axios.get('http://127.0.0.1:9532/api/3509',{params:params}).then(function(response) {
668
+              if (response.data.state == 0) {
669
+                that.$message.error(response.data.data.msg);
670
+                return false
671
+              } else {
672
+                if(response.data.data.failed_code == -10){
673
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
674
+                    confirmButtonText: '确 定',
675
+                    type: 'warning'
676
+                  }).then(() => {
677
+
678
+                  }).catch(() => {
679
+                  })
680
+                }else{
681
+                  that.tableData = that.tableData.concat(response.data.data.info)
682
+
744 683
                 }
745
-              }).catch(function(error) {
746
-              })
747
-
748
-            }else if(this.stock_type == 6){
749
-              axios.get('http://127.0.0.1:9532/api/35081',{params:params}).then(function(response) {
750
-                if (response.data.state == 0) {
751
-                  that.$message.error(response.data.data.msg);
752
-                  return false
753
-                } else {
754
-                  if(response.data.data.failed_code == -10){
755
-                    that.$confirm(response.data.data.msg, '医保错误信息', {
756
-                      confirmButtonText: '确 定',
757
-                      type: 'warning'
758
-                    }).then(() => {
759
-
760
-                    }).catch(() => {
761
-                    })
762
-                  }else{
763
-                    that.tableData = that.tableData.concat(response.data.data.info)
764
-
765
-                  }
684
+              }
685
+            }).catch(function(error) {
686
+            })
687
+
688
+          }else if(that.stock_type == 3){
689
+            axios.get('http://127.0.0.1:9532/api/3511',{params:params}).then(function(response) {
690
+              if (response.data.state == 0) {
691
+                that.$message.error(response.data.data.msg);
692
+                return false
693
+              } else {
694
+                if(response.data.data.failed_code == -10){
695
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
696
+                    confirmButtonText: '确 定',
697
+                    type: 'warning'
698
+                  }).then(() => {
699
+
700
+                  }).catch(() => {
701
+                  })
702
+                }else{
703
+                  that.tableData = that.tableData.concat(response.data.data.info)
704
+
766 705
                 }
767
-              }).catch(function(error) {
768
-              })
769
-
770
-            }else if(that.stock_type == 7){
771
-              axios.get('http://127.0.0.1:9532/api/35082',{params:params}).then(function(response) {
772
-                if (response.data.state == 0) {
773
-                  that.$message.error(response.data.data.msg);
774
-                  return false
775
-                } else {
776
-                  if(response.data.data.failed_code == -10){
777
-                    that.$confirm(response.data.data.msg, '医保错误信息', {
778
-                      confirmButtonText: '确 定',
779
-                      type: 'warning'
780
-                    }).then(() => {
781
-
782
-                    }).catch(() => {
783
-                    })
784
-                  }else{
785
-                    that.tableData = that.tableData.concat(response.data.data.info)
786
-
787
-                  }
706
+              }
707
+            }).catch(function(error) {
708
+            })
709
+
710
+          }else if(that.stock_type == 4){
711
+            axios.get('http://127.0.0.1:9532/api/3512',{params:params}).then(function(response) {
712
+              if (response.data.state == 0) {
713
+                that.$message.error(response.data.data.msg);
714
+                return false
715
+              } else {
716
+                if(response.data.data.failed_code == -10){
717
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
718
+                    confirmButtonText: '确 定',
719
+                    type: 'warning'
720
+                  }).then(() => {
721
+
722
+                  }).catch(() => {
723
+                  })
724
+                }else{
725
+                  that.tableData = that.tableData.concat(response.data.data.info)
726
+
788 727
                 }
789
-              }).catch(function(error) {
790
-              })
791
-            }
728
+              }
729
+            }).catch(function(error) {
730
+            })
731
+
732
+          }else if(that.stock_type == 5){
733
+            axios.get('http://127.0.0.1:9532/api/3513',{params:params}).then(function(response) {
734
+              if (response.data.state == 0) {
735
+                that.$message.error(response.data.data.msg);
736
+                return false
737
+              } else {
738
+                if(response.data.data.failed_code == -10){
739
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
740
+                    confirmButtonText: '确 定',
741
+                    type: 'warning'
742
+                  }).then(() => {
743
+
744
+                  }).catch(() => {
745
+                  })
746
+                }else{
747
+                  that.tableData = that.tableData.concat(response.data.data.info)
792 748
 
749
+                }
750
+              }
751
+            }).catch(function(error) {
752
+            })
753
+
754
+          }else if(this.stock_type == 6){
755
+            axios.get('http://127.0.0.1:9532/api/35081',{params:params}).then(function(response) {
756
+              if (response.data.state == 0) {
757
+                that.$message.error(response.data.data.msg);
758
+                return false
759
+              } else {
760
+                if(response.data.data.failed_code == -10){
761
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
762
+                    confirmButtonText: '确 定',
763
+                    type: 'warning'
764
+                  }).then(() => {
765
+
766
+                  }).catch(() => {
767
+                  })
768
+                }else{
769
+                  that.tableData = that.tableData.concat(response.data.data.info)
793 770
 
794
-          })
795
-            .catch(() => {});
796
-          return false
797
-        } else {
771
+                }
772
+              }
773
+            }).catch(function(error) {
774
+            })
775
+
776
+          }else if(that.stock_type == 7){
777
+            axios.get('http://127.0.0.1:9532/api/35082',{params:params}).then(function(response) {
778
+              if (response.data.state == 0) {
779
+                that.$message.error(response.data.data.msg);
780
+                return false
781
+              } else {
782
+                if(response.data.data.failed_code == -10){
783
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
784
+                    confirmButtonText: '确 定',
785
+                    type: 'warning'
786
+                  }).then(() => {
787
+
788
+                  }).catch(() => {
789
+                  })
790
+                }else{
791
+                  that.tableData = that.tableData.concat(response.data.data.info)
798 792
 
793
+                }
794
+              }
795
+            }).catch(function(error) {
796
+            })
797
+          }
799 798
         }
800 799
       }).catch(function(error) {
801 800
         that.$confirm("请检查医保程序是否有打开", "提示", {

+ 22 - 3
src/xt_pages/drugSourceCode/drugStock.vue Ver fichero

@@ -85,6 +85,10 @@
85 85
           <template slot-scope="scope">{{scope.row.drug_code}}</template>
86 86
         </el-table-column>
87 87
 
88
+        <el-table-column  width="100px"   align="center" prop="name" label="追溯码数量">
89
+          <template slot-scope="scope">{{getCount(scope.row.drug_code)}}</template>
90
+        </el-table-column>
91
+
88 92
         <el-table-column align="center" prop="name" label="批号">
89 93
           <template slot-scope="scope">{{scope.row.batch_number}}</template>
90 94
         </el-table-column>
@@ -238,11 +242,29 @@ export default {
238 242
     }
239 243
   },
240 244
   methods: {
245
+    getCount(code){
246
+
247
+      let noNewLineStr = code.replace(/\n/g, "");
248
+      // 按逗号分割成数组
249
+      let resultArray = noNewLineStr.split(",");
250
+      var arr = []
251
+      for(let i = 0;i < resultArray.length;i++){
252
+        if(resultArray[i] != ""){
253
+
254
+          arr.push(resultArray[i])
255
+        }
256
+      }
257
+      return arr.length
258
+    },
241 259
     searchAction(){
242 260
 
243 261
 
244 262
     },
245 263
     sigle_stock(row){
264
+      if(row.drug_code.length == 0){
265
+        this.$message.error("追溯码不能为空");
266
+        return
267
+      }
246 268
       let ids  = row.id
247 269
       var that = this;
248 270
 
@@ -314,9 +336,6 @@ export default {
314 336
         admin_user_id:this.$store.getters.xt_user.user.id
315 337
       };
316 338
 
317
-
318
-
319
-
320 339
       axios.get('http://127.0.0.1:9532/test/net',{}).then(function(response) {
321 340
         if (response.data.state == 0) {
322 341
           // that.$message.error(response.data.data.msg);

+ 60 - 6
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue Ver fichero

@@ -226,6 +226,28 @@
226 226
             </template>
227 227
           </el-table-column>
228 228
 
229
+
230
+          <el-table-column align="center" width="200">
231
+            <template slot="header" slot-scope="scope">
232
+              <span>当前溯源码数量</span>
233
+            </template>
234
+            <template slot-scope="scope">
235
+              <el-form-item
236
+                :prop="'recordData.' + scope.$index + '.drug_code_cnt'"
237
+                style="padding-top: 10px"
238
+              >
239
+                <div style="display: flex">
240
+                  <el-input
241
+                    placeholder="请输入入库数量"
242
+                    v-model="scope.row.drug_code_cnt"
243
+                    style="width: 120px"
244
+                    disabled
245
+                  ></el-input>
246
+                </div>
247
+              </el-form-item>
248
+            </template>
249
+          </el-table-column>
250
+
229 251
           <el-table-column align="center" width="140">
230 252
             <template slot="header" slot-scope="scope">
231 253
               <span>拆零零售价(元)<span style="color: red">*</span></span>
@@ -582,10 +604,21 @@ export default {
582 604
       this.dialogVisible = true
583 605
     },
584 606
     saveTextArea(){
585
-
586 607
       for(let i=0;i<this.recordInfo.recordData.length;i++){
587 608
          if(this.currentIndex == i){
588
-           this.recordInfo.recordData[i].drug_code = this.textarea 
609
+           this.recordInfo.recordData[i].drug_code = this.textarea
610
+           // 去除换行符
611
+           let noNewLineStr = this.textarea.replace(/\n/g, "");
612
+          // 按逗号分割成数组
613
+           let resultArray = noNewLineStr.split(",");
614
+           let arr = []
615
+           for(let c = 0; c < resultArray.length; c++){
616
+             if(resultArray[c] != ""){
617
+               arr.push(resultArray[c])
618
+             }
619
+           }
620
+           this.recordInfo.recordData[i].drug_code_cnt = arr.length
621
+
589 622
          }
590 623
       }
591 624
       this.dialogVisible = false
@@ -754,7 +787,9 @@ export default {
754 787
       tempObj["last_price"] = "";
755 788
       tempObj["count_unit"] = "";
756 789
       tempObj["min_number"] = "";
757
-      tempObj["drug_code"] = ""
790
+      tempObj["drug_code"] = "";
791
+      tempObj["drug_code_cnt"] = "";
792
+
758 793
       this.recordInfo.recordData.push(tempObj);
759 794
     },
760 795
     handleDelete: function (index, row) {
@@ -881,6 +916,24 @@ export default {
881 916
             }
882 917
           }
883 918
 
919
+          if(this.$store.getters.xt_user.org_id == 0 || this.this.$store.getters.xt_user.org_id == 10138 || this.this.$store.getters.xt_user.org_id == 10278 || this.this.$store.getters.xt_user.org_id == 10610 ||  this.this.$store.getters.xt_user.org_id == 10537 ) {
920
+            for (let i = 0; i < array.length; i++) {
921
+              if (array[i].drug_code.length == 0) {
922
+                this.$message.error(array[i].drug_name + " 药品溯源码不能为空");
923
+                this.loading = false;
924
+                return;
925
+              }
926
+              var aaa =  array[i].drug_code.split(",")
927
+              if(new Set(aaa).size !== aaa.length){
928
+                this.$message.error( array[i].drug_name + " 溯源码不能重复");
929
+                this.loading = false;
930
+                return;
931
+
932
+              }
933
+            }
934
+          }
935
+          return
936
+
884 937
           if (this.recordInfo.recordData.length <= 0) {
885 938
             this.$message.success("请添加入库商品");
886 939
             this.loading = false;
@@ -1170,10 +1223,10 @@ export default {
1170 1223
     //  }
1171 1224
     },
1172 1225
     getTotalPirce(){
1173
-      
1226
+
1174 1227
       var total_price = 0
1175 1228
       if(this.recordInfo.recordData!=null && this.recordInfo.recordData.length>0){
1176
-        
1229
+
1177 1230
         for(let i=0;i<this.recordInfo.recordData.length;i++){
1178 1231
            total_price += this.recordInfo.recordData[i].last_price * parseInt(this.recordInfo.recordData[i].warehousing_count)
1179 1232
         }
@@ -1195,7 +1248,7 @@ export default {
1195 1248
       }
1196 1249
    },
1197 1250
   },
1198
- 
1251
+
1199 1252
   created() {
1200 1253
     if (this.$route.path == "/Pharmacy/in/add") {
1201 1254
       this.crumbs = [
@@ -1239,6 +1292,7 @@ export default {
1239 1292
     tempObj["count_unit"] = "";
1240 1293
     tempObj["min_number"] = "";
1241 1294
     tempObj["drug_code"] = ""
1295
+    tempObj["drug_code_cnt"] = ""
1242 1296
     this.recordInfo.recordData.push(tempObj);
1243 1297
 
1244 1298
     this.GetConfigInfo();

+ 67 - 8
src/xt_pages/stock/stockInOrderAdd.vue Ver fichero

@@ -121,6 +121,27 @@
121 121
             </template>
122 122
           </el-table-column>
123 123
 
124
+          <el-table-column align="center" width="200">
125
+            <template slot="header" slot-scope="scope">
126
+              <span>当前溯源码数量</span>
127
+            </template>
128
+            <template slot-scope="scope">
129
+              <el-form-item
130
+                :prop="'recordData.' + scope.$index + '.good_code_cnt'"
131
+                style="padding-top: 10px"
132
+              >
133
+                <div style="display: flex">
134
+                  <el-input
135
+                    placeholder="请输入入库数量"
136
+                    v-model="scope.row.good_code_cnt"
137
+                    style="width: 120px"
138
+                    disabled
139
+                  ></el-input>
140
+                </div>
141
+              </el-form-item>
142
+            </template>
143
+          </el-table-column>
144
+
124 145
           <el-table-column align="center" width="120">
125 146
             <template slot="header" slot-scope="scope">
126 147
               <span>零售价<span style="color: red">*</span></span>
@@ -225,7 +246,7 @@
225 246
             </template>
226 247
           </el-table-column>
227 248
 
228
-          
249
+
229 250
            <el-table-column label="经销商" align="center" width="150">
230 251
              <template slot-scope="scope">
231 252
                <el-select size="small" v-model="scope.row.dealer" filterable placeholder="请选择厂商">
@@ -240,13 +261,13 @@
240 261
           </el-table-column>
241 262
 
242 263
           <el-table-column label="耗材追溯码" align="center" width="150">
243
-           
264
+
244 265
               <template slot-scope="scope">
245 266
                <div  @click="changeGoodCode(scope.row,scope.$index)">
246 267
                 <el-input v-model="scope.row.good_code"  placeholder="请输入耗材追溯码"></el-input>
247 268
               </div>
248 269
             </template>
249
-          
270
+
250 271
           </el-table-column>
251 272
 
252 273
           <el-table-column label="备注" align="center" width="150">
@@ -284,7 +305,7 @@
284 305
         <div style="margin-top: 20px;">合计金额: {{getTotalPirce() }} </div>
285 306
       </el-form>
286 307
 
287
- 
308
+
288 309
     </div>
289 310
 
290 311
     <el-dialog
@@ -615,6 +636,8 @@
615 636
         tempObj["id"] = 0
616 637
         tempObj['register_number'] = ''
617 638
         tempObj['good_code'] = ""
639
+        tempObj['good_code_cnt'] = ''
640
+
618 641
         this.recordInfo.recordData.push(tempObj)
619 642
       }, handleDelete: function(index, row) {
620 643
         if (this.recordInfo.recordData.length <= 1) {
@@ -764,6 +787,26 @@
764 787
               array[i].packing_price = array[i].packing_price.toString()
765 788
             }
766 789
 
790
+            if(this.$store.getters.xt_user.org_id == 0 || this.this.$store.getters.xt_user.org_id == 10138 || this.this.$store.getters.xt_user.org_id == 10278 || this.this.$store.getters.xt_user.org_id == 10610 ||  this.this.$store.getters.xt_user.org_id == 10537 ) {
791
+              for (let i = 0; i < array.length; i++) {
792
+                if (array[i].good_code.length == 0) {
793
+                  this.$message.error(array[i].good_name  + " 溯源码不能为空");
794
+                  this.loading = false;
795
+                  return;
796
+                }
797
+
798
+
799
+                var aaa =  array[i].good_code.split(",")
800
+                if(new Set(aaa).size !== aaa.length){
801
+                  this.$message.error( array[i].good_name + " 溯源码不能重复");
802
+                  this.loading = false;
803
+                  return;
804
+
805
+                }
806
+              }
807
+            }
808
+
809
+
767 810
             if(this.recordInfo.recordData.length <= 0){
768 811
               this.$message.success('请添加入库商品')
769 812
               return
@@ -799,7 +842,7 @@
799 842
               'stockIn': this.recordInfo.recordData
800 843
             }
801 844
             console.log("param232232323232323w",params)
802
-   
845
+
803 846
             postWarehouse(params, this.warehousing_time, this.type,this.storehouse_id,this.warehousing_info_id).then(response => {
804 847
               if (response.data.state == 0) {
805 848
                 this.loading = false
@@ -992,10 +1035,10 @@
992 1035
        })
993 1036
      },
994 1037
      getTotalPirce(){
995
-      
1038
+
996 1039
        var total_price = 0
997 1040
        if(this.recordInfo.recordData!=null && this.recordInfo.recordData.length>0){
998
-         
1041
+
999 1042
          for(let i=0;i<this.recordInfo.recordData.length;i++){
1000 1043
             total_price += this.recordInfo.recordData[i].price * parseInt(this.recordInfo.recordData[i].warehousing_count)
1001 1044
          }
@@ -1026,7 +1069,20 @@
1026 1069
      saveTextArea(){
1027 1070
         for(let i=0;i<this.recordInfo.recordData.length;i++){
1028 1071
           if(this.currentIndex == i){
1029
-            this.recordInfo.recordData[i].good_code = this.textarea 
1072
+            this.recordInfo.recordData[i].good_code = this.textarea
1073
+
1074
+            // 去除换行符
1075
+            let noNewLineStr = this.textarea.replace(/\n/g, "");
1076
+            // 按逗号分割成数组
1077
+            let resultArray = noNewLineStr.split(",");
1078
+            let arr = []
1079
+            for(let c = 0; c < resultArray.length; c++){
1080
+              if(resultArray[c] != ""){
1081
+                arr.push(resultArray[c])
1082
+              }
1083
+            }
1084
+            this.recordInfo.recordData[i].good_code_cnt = arr.length
1085
+
1030 1086
           }
1031 1087
         }
1032 1088
         this.dialogVisible = false
@@ -1065,6 +1121,9 @@
1065 1121
       tempObj['id']= 0
1066 1122
       tempObj['register_number'] = ''
1067 1123
       tempObj['good_code'] = ''
1124
+        tempObj['good_code_cnt'] = ''
1125
+
1126
+
1068 1127
       this.recordInfo.recordData.push(tempObj)
1069 1128
       this.GetConfigInfo()
1070 1129
       this.propForm.goodUnit = this.$store.getters.good_unit