Browse Source

二级库-仓库管理bug修改

mainqaq 3 years ago
parent
commit
ff7e0a8013

+ 42 - 65
src/xt_pages/data/druguseTemplate.vue View File

310
             </el-dialog>
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
               <el-form
314
               <el-form
315
                 ref="templateForm"
315
                 ref="templateForm"
316
                 :rules="templateRules"
316
                 :rules="templateRules"
321
                 <el-row >
321
                 <el-row >
322
                   <el-col :span="24">
322
                   <el-col :span="24">
323
                     <el-form-item label="医嘱内容:" required prop="advice_name">
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
                       <el-autocomplete
324
                       <el-autocomplete
344
                           style="width:100%;"
325
                           style="width:100%;"
345
                           class="inline-input"
326
                           class="inline-input"
357
                   <el-col :span="15">
338
                   <el-col :span="15">
358
                     <el-form-item label="药品规格 :" prop="advice_desc">
339
                     <el-form-item label="药品规格 :" prop="advice_desc">
359
                       <el-col :span="8">
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
                        <el-autocomplete
343
                        <el-autocomplete
379
                          style="width:100px;"
344
                          style="width:100px;"
526
                 </el-row>
491
                 </el-row>
527
               </el-form>
492
               </el-form>
528
               <div slot="footer" class="dialog-footer">
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
                 <el-button type="primary" @click="submitTemplate('templateForm')">保 存</el-button>
495
                 <el-button type="primary" @click="submitTemplate('templateForm')">保 存</el-button>
531
               </div>
496
               </div>
532
             </el-dialog>
497
             </el-dialog>
1613
         this.templateTableVisible = true
1578
         this.templateTableVisible = true
1614
       },
1579
       },
1615
       newRecordAction() {
1580
       newRecordAction() {
1581
+        console.log("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
1616
         this.dialogTitle = '新增医嘱内容'
1582
         this.dialogTitle = '新增医嘱内容'
1617
         this.advice_content_name = '医嘱内容'
1583
         this.advice_content_name = '医嘱内容'
1618
         this.isEdit = false
1584
         this.isEdit = false
1621
         this.templateTableVisible = false
1587
         this.templateTableVisible = false
1622
         this.templateFormVisible = true
1588
         this.templateFormVisible = true
1623
 
1589
 
1624
-      }, deleteRecordAction: function() {
1590
+      },
1591
+      deleteRecordAction: function() {
1625
         if (this.table_current_index == -1) {
1592
         if (this.table_current_index == -1) {
1626
           this.$message.error('请选择一条医嘱记录')
1593
           this.$message.error('请选择一条医嘱记录')
1627
           return
1594
           return
1635
           this.table_current_index = -1
1602
           this.table_current_index = -1
1636
         }).catch(() => {
1603
         }).catch(() => {
1637
         })
1604
         })
1638
-      }, tableRow({ row, rowIndex }) {
1605
+      },
1606
+      tableRow({ row, rowIndex }) {
1639
         // 把每一行的索引放进row
1607
         // 把每一行的索引放进row
1640
         row.index = rowIndex
1608
         row.index = rowIndex
1641
       },
1609
       },
1683
         const params = {
1651
         const params = {
1684
           'data': this.adviceTableData
1652
           'data': this.adviceTableData
1685
         }
1653
         }
1686
-       
1654
+
1687
         let name = encodeURIComponent(this.form.name)
1655
         let name = encodeURIComponent(this.form.name)
1688
         console.log("params",params)
1656
         console.log("params",params)
1689
         let sort = this.form.sort
1657
         let sort = this.form.sort
1690
-        
1658
+
1691
         postAdviceTemplate(params, name,sort, this.form.advice_type).then(response => {
1659
         postAdviceTemplate(params, name,sort, this.form.advice_type).then(response => {
1692
 
1660
 
1693
           if (response.data.state == 0) {
1661
           if (response.data.state == 0) {
1870
               CreateSubAdvice(templateFormTwo).then(response => {
1838
               CreateSubAdvice(templateFormTwo).then(response => {
1871
                 if (response.data.state == 0) {
1839
                 if (response.data.state == 0) {
1872
                   this.$message.error(response.data.msg)
1840
                   this.$message.error(response.data.msg)
1841
+                  this.closeform()
1873
                   return false
1842
                   return false
1874
                 } else {
1843
                 } else {
1875
                   this.$message.success('添加成功')
1844
                   this.$message.success('添加成功')
1876
-
1877
                   var spliceIndex = -1
1845
                   var spliceIndex = -1
1878
                   for (let index = this.adviceTemplates.length - 1; ; index--) {
1846
                   for (let index = this.adviceTemplates.length - 1; ; index--) {
1879
                     if (this.adviceTemplates[index].parent_id === templateFormTwo.parent_id) {
1847
                     if (this.adviceTemplates[index].parent_id === templateFormTwo.parent_id) {
1884
                       break
1852
                       break
1885
                     }
1853
                     }
1886
                   }
1854
                   }
1887
-
1888
                   if (spliceIndex > -1) {
1855
                   if (spliceIndex > -1) {
1889
                     spliceIndex += 1
1856
                     spliceIndex += 1
1890
                     if (spliceIndex === this.adviceTemplates.length) {
1857
                     if (spliceIndex === this.adviceTemplates.length) {
1902
                   this.handleSpanTempArr()
1869
                   this.handleSpanTempArr()
1903
                   this.templateFormVisible = false
1870
                   this.templateFormVisible = false
1904
                   this.resetForm(formName)
1871
                   this.resetForm(formName)
1872
+                  this.closeform()
1905
                   return false
1873
                   return false
1906
                 }
1874
                 }
1907
               })
1875
               })
2383
         }
2351
         }
2384
         this.templateForm.way = 1
2352
         this.templateForm.way = 1
2385
         console.log("编辑模板",this.templateForm)
2353
         console.log("编辑模板",this.templateForm)
2386
-      
2354
+
2387
         // 编辑创建医嘱模版
2355
         // 编辑创建医嘱模版
2388
         CreateSingleAdviceTemplate(this.templateForm).then(response => {
2356
         CreateSingleAdviceTemplate(this.templateForm).then(response => {
2389
           if (response.data.state == 0) {
2357
           if (response.data.state == 0) {
2486
             return 'success-row'
2454
             return 'success-row'
2487
           }
2455
           }
2488
         }
2456
         }
2489
-      }, 
2457
+      },
2490
       cellMouseEnter: function(row, column, cell, event) {
2458
       cellMouseEnter: function(row, column, cell, event) {
2491
         if (column.label == '模版名称') {
2459
         if (column.label == '模版名称') {
2492
           this.sameRowArr.forEach((arr, i) => {
2460
           this.sameRowArr.forEach((arr, i) => {
2653
         this.templateFormVisible = true
2621
         this.templateFormVisible = true
2654
         this.dialogTitle = '新增子药'
2622
         this.dialogTitle = '新增子药'
2655
         this.advice_content_name = '子药名称'
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
         this.tempArr = []
2626
         this.tempArr = []
2672
 
2627
 
2673
         for (let i = 0; i < this.adviceTemplates.length; i++) {
2628
         for (let i = 0; i < this.adviceTemplates.length; i++) {
2703
         this.sameRowArr = sameRowArr
2658
         this.sameRowArr = sameRowArr
2704
       },
2659
       },
2705
        handleUpdateAdviceTemplate(row, index) {
2660
        handleUpdateAdviceTemplate(row, index) {
2706
-       
2661
+
2707
         this.current_template_id = row.template_id
2662
         this.current_template_id = row.template_id
2708
         this.current_template_name = row.name
2663
         this.current_template_name = row.name
2709
         this.form.name = row.name
2664
         this.form.name = row.name
2715
         }
2670
         }
2716
         this.templateTableTwoVisible = true
2671
         this.templateTableTwoVisible = true
2717
         this.adviceTableDataTwo = []
2672
         this.adviceTableDataTwo = []
2718
-      
2673
+
2719
         for (let i = 0; i < this.adviceTemplates.length; i++) {
2674
         for (let i = 0; i < this.adviceTemplates.length; i++) {
2720
           if (this.adviceTemplates[i].template_id == row.template_id) {
2675
           if (this.adviceTemplates[i].template_id == row.template_id) {
2721
             this.adviceTableDataTwo.push(this.adviceTemplates[i])
2676
             this.adviceTableDataTwo.push(this.adviceTemplates[i])
2729
           template_id: this.current_template_id,
2684
           template_id: this.current_template_id,
2730
           sort:this.form.sort,
2685
           sort:this.form.sort,
2731
         }
2686
         }
2732
-      
2687
+
2733
         updateTemplateName(params).then(response => {
2688
         updateTemplateName(params).then(response => {
2734
           if (response.data.state == 0) {
2689
           if (response.data.state == 0) {
2735
             this.$message.error(response.data.msg)
2690
             this.$message.error(response.data.msg)
2962
        return a.sort - b.sort
2917
        return a.sort - b.sort
2963
      },
2918
      },
2964
      hangleSelectChange(val){
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
       this.templateForm.way = 1
2931
       this.templateForm.way = 1
2966
       this.templateForm.drug_id = val.id
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
 </script>
2947
 </script>

+ 7 - 6
src/xt_pages/stock/warehouseManage/components/AddWareHouse.vue View File

71
         date2: "",
71
         date2: "",
72
         delivery: false,
72
         delivery: false,
73
         type: [],
73
         type: [],
74
-        status: "",
74
+        status: 1,
75
         address: "",
75
         address: "",
76
       },
76
       },
77
       //表单验证规则
77
       //表单验证规则
171
       this.ruleForm.date1 = "";
171
       this.ruleForm.date1 = "";
172
       this.ruleForm.date2 = "";
172
       this.ruleForm.date2 = "";
173
       this.ruleForm.type = [];
173
       this.ruleForm.type = [];
174
-      this.ruleForm.status = "";
174
+      this.ruleForm.status = 1;
175
       this.ruleForm.address = "";
175
       this.ruleForm.address = "";
176
     },
176
     },
177
 
177
 
194
                 this.$emit("init");
194
                 this.$emit("init");
195
               } else {
195
               } else {
196
                 this.$message.error("新增失败:" + res.data.msg);
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
           } else {
203
           } else {
203
-            return false;
204
+            // return false;
204
           }
205
           }
205
         });
206
         });
206
       } else if (this.show_type == 2) {
207
       } else if (this.show_type == 2) {

+ 6 - 4
src/xt_pages/supply/components/addSupply.vue View File

436
                     this.$emit("init");
436
                     this.$emit("init");
437
                   } else {
437
                   } else {
438
                     this.$message.error("新增失败:" + res.data.msg);
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
               } else {
445
               } else {
449
             return false;
450
             return false;
450
           }
451
           }
451
         });
452
         });
452
-      } else if (this.show_type == 2) {
453
+      }
454
+      else if (this.show_type == 2) {
453
         this.$refs[supplier].validate((valid) => {
455
         this.$refs[supplier].validate((valid) => {
454
           if (valid) {
456
           if (valid) {
455
             this.$refs[formName].validate((valid) => {
457
             this.$refs[formName].validate((valid) => {