ソースを参照

二级库-仓库管理bug修改

mainqaq 3 年 前
コミット
ff7e0a8013
共有3 個のファイルを変更した55 個の追加75 個の削除を含む
  1. 42 65
      src/xt_pages/data/druguseTemplate.vue
  2. 7 6
      src/xt_pages/stock/warehouseManage/components/AddWareHouse.vue
  3. 6 4
      src/xt_pages/supply/components/addSupply.vue

+ 42 - 65
src/xt_pages/data/druguseTemplate.vue ファイルの表示

@@ -310,7 +310,7 @@
310 310
             </el-dialog>
311 311
 
312 312
             <!-- 新增子药 -->
313
-            <el-dialog :title="dialogTitle" :visible.sync="templateFormVisible" width="854px">
313
+            <el-dialog :title="dialogTitle" :before-close="closeform" :visible.sync="templateFormVisible" width="854px" >
314 314
               <el-form
315 315
                 ref="templateForm"
316 316
                 :rules="templateRules"
@@ -321,25 +321,6 @@
321 321
                 <el-row >
322 322
                   <el-col :span="24">
323 323
                     <el-form-item label="医嘱内容:" required prop="advice_name">
324
-                      <!-- <el-input v-model="templateForm.advice_name"></el-input> -->
325
-
326
-                      <!-- <el-select
327
-                        v-model="templateForm.advice_name"
328
-                        filterable
329
-                        clearable
330
-                        allow-create
331
-                        placeholder="请选择(输入可搜索)"
332
-                        style="width:100%"
333
-                        @change="changeDrugName"
334
-                    >
335
-                      <el-option
336
-                        v-for="(item,index) in all_drug"
337
-                        :key="index"
338
-                        :label="item.drug_name"
339
-                        :value="item.drug_name"
340
-                      ></el-option>
341
-                     </el-select> -->
342
-
343 324
                       <el-autocomplete
344 325
                           style="width:100%;"
345 326
                           class="inline-input"
@@ -357,23 +338,7 @@
357 338
                   <el-col :span="15">
358 339
                     <el-form-item label="药品规格 :" prop="advice_desc">
359 340
                       <el-col :span="8">
360
-                        <!-- <el-input v-model="templateForm.advice_desc"></el-input> -->
361
-                         <!-- <el-select
362
-                          v-model="templateForm.advice_desc"
363
-                          filterable
364
-                          clearable
365
-                          allow-create
366
-                          placeholder="请选择(输入可搜索)"
367
-                          style="width:150px"
368
-                          @change="changeDrugDesc"
369
-                        >
370
-                        <el-option
371
-                          v-for="item in drugSpec"
372
-                          :key="item.id"
373
-                          :label="item.drug_spec"
374
-                          :value="item.drug_spec"
375
-                        ></el-option>
376
-                        </el-select> -->
341
+
377 342
 
378 343
                        <el-autocomplete
379 344
                          style="width:100px;"
@@ -526,7 +491,7 @@
526 491
                 </el-row>
527 492
               </el-form>
528 493
               <div slot="footer" class="dialog-footer">
529
-                <el-button @click="cancelHandle('templateForm')">取消</el-button>
494
+                <el-button @click="cancelHandle('templateForm'),closeform()">取消</el-button>
530 495
                 <el-button type="primary" @click="submitTemplate('templateForm')">保 存</el-button>
531 496
               </div>
532 497
             </el-dialog>
@@ -1613,6 +1578,7 @@
1613 1578
         this.templateTableVisible = true
1614 1579
       },
1615 1580
       newRecordAction() {
1581
+        console.log("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
1616 1582
         this.dialogTitle = '新增医嘱内容'
1617 1583
         this.advice_content_name = '医嘱内容'
1618 1584
         this.isEdit = false
@@ -1621,7 +1587,8 @@
1621 1587
         this.templateTableVisible = false
1622 1588
         this.templateFormVisible = true
1623 1589
 
1624
-      }, deleteRecordAction: function() {
1590
+      },
1591
+      deleteRecordAction: function() {
1625 1592
         if (this.table_current_index == -1) {
1626 1593
           this.$message.error('请选择一条医嘱记录')
1627 1594
           return
@@ -1635,7 +1602,8 @@
1635 1602
           this.table_current_index = -1
1636 1603
         }).catch(() => {
1637 1604
         })
1638
-      }, tableRow({ row, rowIndex }) {
1605
+      },
1606
+      tableRow({ row, rowIndex }) {
1639 1607
         // 把每一行的索引放进row
1640 1608
         row.index = rowIndex
1641 1609
       },
@@ -1683,11 +1651,11 @@
1683 1651
         const params = {
1684 1652
           'data': this.adviceTableData
1685 1653
         }
1686
-       
1654
+
1687 1655
         let name = encodeURIComponent(this.form.name)
1688 1656
         console.log("params",params)
1689 1657
         let sort = this.form.sort
1690
-        
1658
+
1691 1659
         postAdviceTemplate(params, name,sort, this.form.advice_type).then(response => {
1692 1660
 
1693 1661
           if (response.data.state == 0) {
@@ -1870,10 +1838,10 @@
1870 1838
               CreateSubAdvice(templateFormTwo).then(response => {
1871 1839
                 if (response.data.state == 0) {
1872 1840
                   this.$message.error(response.data.msg)
1841
+                  this.closeform()
1873 1842
                   return false
1874 1843
                 } else {
1875 1844
                   this.$message.success('添加成功')
1876
-
1877 1845
                   var spliceIndex = -1
1878 1846
                   for (let index = this.adviceTemplates.length - 1; ; index--) {
1879 1847
                     if (this.adviceTemplates[index].parent_id === templateFormTwo.parent_id) {
@@ -1884,7 +1852,6 @@
1884 1852
                       break
1885 1853
                     }
1886 1854
                   }
1887
-
1888 1855
                   if (spliceIndex > -1) {
1889 1856
                     spliceIndex += 1
1890 1857
                     if (spliceIndex === this.adviceTemplates.length) {
@@ -1902,6 +1869,7 @@
1902 1869
                   this.handleSpanTempArr()
1903 1870
                   this.templateFormVisible = false
1904 1871
                   this.resetForm(formName)
1872
+                  this.closeform()
1905 1873
                   return false
1906 1874
                 }
1907 1875
               })
@@ -2383,7 +2351,7 @@
2383 2351
         }
2384 2352
         this.templateForm.way = 1
2385 2353
         console.log("编辑模板",this.templateForm)
2386
-      
2354
+
2387 2355
         // 编辑创建医嘱模版
2388 2356
         CreateSingleAdviceTemplate(this.templateForm).then(response => {
2389 2357
           if (response.data.state == 0) {
@@ -2486,7 +2454,7 @@
2486 2454
             return 'success-row'
2487 2455
           }
2488 2456
         }
2489
-      }, 
2457
+      },
2490 2458
       cellMouseEnter: function(row, column, cell, event) {
2491 2459
         if (column.label == '模版名称') {
2492 2460
           this.sameRowArr.forEach((arr, i) => {
@@ -2653,21 +2621,8 @@
2653 2621
         this.templateFormVisible = true
2654 2622
         this.dialogTitle = '新增子药'
2655 2623
         this.advice_content_name = '子药名称'
2656
-      }, deleteRecordAction: function() {
2657
-        if (this.table_current_index == -1) {
2658
-          this.$message.error('请选择一条医嘱记录')
2659
-          return
2660
-        }
2661
-        this.$confirm('删除记录', '是否删除该医嘱记录', {
2662
-          confirmButtonText: '确 定',
2663
-          cancelButtonText: '取 消',
2664
-          type: 'warning'
2665
-        }).then(() => {
2666
-          this.adviceTableData.splice(this.table_current_index, 1)
2667
-          this.table_current_index = -1
2668
-        }).catch(() => {
2669
-        })
2670
-      }, handleSpanTempArr() {
2624
+      },
2625
+      handleSpanTempArr() {
2671 2626
         this.tempArr = []
2672 2627
 
2673 2628
         for (let i = 0; i < this.adviceTemplates.length; i++) {
@@ -2703,7 +2658,7 @@
2703 2658
         this.sameRowArr = sameRowArr
2704 2659
       },
2705 2660
        handleUpdateAdviceTemplate(row, index) {
2706
-       
2661
+
2707 2662
         this.current_template_id = row.template_id
2708 2663
         this.current_template_name = row.name
2709 2664
         this.form.name = row.name
@@ -2715,7 +2670,7 @@
2715 2670
         }
2716 2671
         this.templateTableTwoVisible = true
2717 2672
         this.adviceTableDataTwo = []
2718
-      
2673
+
2719 2674
         for (let i = 0; i < this.adviceTemplates.length; i++) {
2720 2675
           if (this.adviceTemplates[i].template_id == row.template_id) {
2721 2676
             this.adviceTableDataTwo.push(this.adviceTemplates[i])
@@ -2729,7 +2684,7 @@
2729 2684
           template_id: this.current_template_id,
2730 2685
           sort:this.form.sort,
2731 2686
         }
2732
-      
2687
+
2733 2688
         updateTemplateName(params).then(response => {
2734 2689
           if (response.data.state == 0) {
2735 2690
             this.$message.error(response.data.msg)
@@ -2962,9 +2917,31 @@
2962 2917
        return a.sort - b.sort
2963 2918
      },
2964 2919
      hangleSelectChange(val){
2920
+       this.templateForm.advice_desc=this.drugSpec[0].drug_spec
2921
+       this.templateForm.drug_spec_unit=this.drugSpec[0].min_unit
2922
+       this.templateForm.prescribing_number=this.drugSpec[0].prescribing_number
2923
+       this.templateForm.prescribing_number_unit=this.drugSpec[0].prescribing_number_unit
2924
+       this.templateForm.single_dose=this.drugSpec[0].single_dose
2925
+       this.templateForm.single_dose_unit=this.drugSpec[0].min_unit
2926
+       this.templateForm.delivery_way=this.drugSpec[0].delivery_way
2927
+       this.templateForm.execution_frequency=this.drugSpec[0].execution_frequency
2928
+       // console.log("templateForm2222222222",this.templateForm)
2929
+       // console.log("all_drug",this.all_drug)
2930
+       // console.log("drugSpec2222222",this.drugSpec)
2965 2931
       this.templateForm.way = 1
2966 2932
       this.templateForm.drug_id = val.id
2967
-    }
2933
+    },
2934
+      closeform(){//清除表单数据
2935
+        this.templateForm.advice_name=""
2936
+        this.templateForm.advice_desc=""
2937
+        this.templateForm.drug_spec_unit=""
2938
+        this.templateForm.prescribing_number=""
2939
+        this.templateForm.prescribing_number_unit=""
2940
+        this.templateForm.single_dose=""
2941
+        this.templateForm.single_dose_unit=""
2942
+        this.templateForm.delivery_way=""
2943
+        this.templateForm.execution_frequency=""
2944
+      }
2968 2945
     }
2969 2946
   }
2970 2947
 </script>

+ 7 - 6
src/xt_pages/stock/warehouseManage/components/AddWareHouse.vue ファイルの表示

@@ -71,7 +71,7 @@ export default {
71 71
         date2: "",
72 72
         delivery: false,
73 73
         type: [],
74
-        status: "",
74
+        status: 1,
75 75
         address: "",
76 76
       },
77 77
       //表单验证规则
@@ -171,7 +171,7 @@ export default {
171 171
       this.ruleForm.date1 = "";
172 172
       this.ruleForm.date2 = "";
173 173
       this.ruleForm.type = [];
174
-      this.ruleForm.status = "";
174
+      this.ruleForm.status = 1;
175 175
       this.ruleForm.address = "";
176 176
     },
177 177
 
@@ -194,13 +194,14 @@ export default {
194 194
                 this.$emit("init");
195 195
               } else {
196 196
                 this.$message.error("新增失败:" + res.data.msg);
197
-                setTimeout(() => {
198
-                  this.closePop();
199
-                }, 2000);
197
+                // setTimeout(() => {
198
+                //   this.closePop();
199
+                // }, 2000);
200
+                this.dialogVisible = true
200 201
               }
201 202
             });
202 203
           } else {
203
-            return false;
204
+            // return false;
204 205
           }
205 206
         });
206 207
       } else if (this.show_type == 2) {

+ 6 - 4
src/xt_pages/supply/components/addSupply.vue ファイルの表示

@@ -436,9 +436,10 @@ export default {
436 436
                     this.$emit("init");
437 437
                   } else {
438 438
                     this.$message.error("新增失败:" + res.data.msg);
439
-                    setTimeout(() => {
440
-                      this.closePop();
441
-                    }, 2000);
439
+                    // setTimeout(() => {
440
+                    //   this.closePop();
441
+                    // }, 2000);
442
+                    // return true;
442 443
                   }
443 444
                 });
444 445
               } else {
@@ -449,7 +450,8 @@ export default {
449 450
             return false;
450 451
           }
451 452
         });
452
-      } else if (this.show_type == 2) {
453
+      }
454
+      else if (this.show_type == 2) {
453 455
         this.$refs[supplier].validate((valid) => {
454 456
           if (valid) {
455 457
             this.$refs[formName].validate((valid) => {