소스 검색

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

csx 3 년 전
부모
커밋
8ef0982339

+ 3 - 7
src/views/layout/Layout.vue 파일 보기

17
           <p>透析管理</p>
17
           <p>透析管理</p>
18
         </div>
18
         </div>
19
 
19
 
20
-
21
-
22
-        <!-- <div v-if="caigouShow" :class="index == 5 ? 'navOne navActive' : 'navOne'" @click="clickActive(5,'采购管理')">
20
+        <div v-if="caigouShow" :class="index == 5 ? 'navOne navActive' : 'navOne'" @click="clickActive(5,'采购管理')">
23
           <i class="iconfont icon-kccx navIcon"></i>
21
           <i class="iconfont icon-kccx navIcon"></i>
24
           <p>采购管理</p>
22
           <p>采购管理</p>
25
-        </div> -->
26
-
27
-
28
-
23
+        </div>
24
+        
29
         <div v-if="kucunShow" :class="index == 3 ? 'navOne navActive' : 'navOne'" @click="clickActive(3,'库房管理')">
25
         <div v-if="kucunShow" :class="index == 3 ? 'navOne navActive' : 'navOne'" @click="clickActive(3,'库房管理')">
30
           <i class="iconfont icon-kccx navIcon"></i>
26
           <i class="iconfont icon-kccx navIcon"></i>
31
           <p>库房管理</p>
27
           <p>库房管理</p>

+ 38 - 19
src/xt_pages/data/printTemplate/prescriptionPrint.vue 파일 보기

10
     </p>
10
     </p>
11
     <el-row :gutter="20" type="flex" justify="center">
11
     <el-row :gutter="20" type="flex" justify="center">
12
         <el-col :span="6" style="text-align: center">
12
         <el-col :span="6" style="text-align: center">
13
-        <div
14
-            @click="imgClick('https://images.shengws.com/2020/12/3/admin_avatar_1606984919688.png')"
15
-        >
16
-            <el-tooltip
17
-            class="item"
18
-            effect="dark"
19
-            :hide-after="2000"
20
-            content="点击查看大图"
21
-            placement="top-start"
22
-            >
23
-            <el-image
24
-                style="width: 200px; height: 200px"
25
-                :src="require('@/assets/home/88.png')"
26
-            ></el-image>
13
+        <div v-if="org_id == 10243">
14
+          <div @click="imgClick('https://kuyi.shengws.com/dali.jpeg')">
15
+              <el-tooltip
16
+              class="item"
17
+              effect="dark"
18
+              :hide-after="2000"
19
+              content="点击查看大图"
20
+              placement="top-start"
21
+              >
22
+              <el-image
23
+                  style="width: 200px; height: 200px"
24
+                  :src="require('@/assets/home/88.png')"
25
+              ></el-image>
27
 
26
 
28
-            </el-tooltip>
27
+              </el-tooltip>
28
+          </div>
29
         </div>
29
         </div>
30
-        <el-radio v-model="radio" label="1" @change="change"
31
-            >模版一</el-radio
32
-        >
30
+        <div v-else>
31
+          <div @click="imgClick('https://images.shengws.com/2020/12/3/admin_avatar_1606984919688.png')">
32
+              <el-tooltip
33
+              class="item"
34
+              effect="dark"
35
+              :hide-after="2000"
36
+              content="点击查看大图"
37
+              placement="top-start"
38
+              >
39
+              <el-image
40
+                  style="width: 200px; height: 200px"
41
+                  :src="require('@/assets/home/88.png')"
42
+              ></el-image>
43
+
44
+              </el-tooltip>
45
+          </div>
46
+        </div>
47
+       
48
+        <el-radio v-model="radio" label="1" @change="change">模版一</el-radio>
33
         </el-col>
49
         </el-col>
34
     </el-row>
50
     </el-row>
35
  
51
  
80
       delay: 500,
96
       delay: 500,
81
       radio: 0,
97
       radio: 0,
82
       tempRadio: 0,
98
       tempRadio: 0,
83
-      loading: false
99
+      loading: false,
100
+      org_id:0,
84
     };
101
     };
85
   },
102
   },
86
   methods: {
103
   methods: {
138
     }
155
     }
139
   },
156
   },
140
   created() {
157
   created() {
158
+    this.org_id = this.$store.getters.xt_user.org.id
159
+    console.log("orgid23322332232323",this.org_id)
141
     this.getlist()
160
     this.getlist()
142
   }
161
   }
143
 };
162
 };

+ 1 - 1
src/xt_pages/dialysis/batch_print/batch_print_order_six.vue 파일 보기

734
                               : "/"
734
                               : "/"
735
                           }}
735
                           }}
736
                         </div>
736
                         </div>
737
-                        ml
737
+                        L
738
                       </div>
738
                       </div>
739
                       <div class="inline_block" style="flex:1;">
739
                       <div class="inline_block" style="flex:1;">
740
                         干体重:
740
                         干体重:

+ 10 - 3
src/xt_pages/dialysis/details/DialysisPrescription.vue 파일 보기

107
       </ul>
107
       </ul>
108
 
108
 
109
       <ul>
109
       <ul>
110
-        <li v-if="isShow('目标超滤量')">
110
+        <li v-if="isShow('目标超滤量') && this.$store.getters.xt_user.template_info.org_id != 10290">
111
           <label>目标超滤量 : </label>
111
           <label>目标超滤量 : </label>
112
           <span class="content">{{ target_ultrafiltration != "0" ? target_ultrafiltration : ""}}</span>
112
           <span class="content">{{ target_ultrafiltration != "0" ? target_ultrafiltration : ""}}</span>
113
-          <span v-if="this.$store.getters.xt_user.template_info.template_id != 17 && this.$store.getters.xt_user.template_info.template_id != 9 && this.$store.getters.xt_user.template_info.template_id != 20 && this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 22 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 24 && this.$store.getters.xt_user.template_info.template_id != 26 && this.$store.getters.xt_user.template_info.template_id != 28 && this.$store.getters.xt_user.template_info.template_id != 27 && this.$store.getters.xt_user.template_info.template_id != 29 && this.$store.getters.xt_user.template_info.template_id != 30 && this.$store.getters.xt_user.template_info.template_id != 31 && this.$store.getters.xt_user.template_info.template_id != 32 && this.$store.getters.xt_user.template_info.template_id != 34 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.template_id != 40 && this.$store.getters.xt_user.template_info.template_id != 43 && this.$store.getters.xt_user.template_info.template_id != 45 && this.$store.getters.xt_user.template_info.org_id != 9555 && this.$store.getters.xt_user.template_info.org_id != 9671"  class="unit">{{ target_ultrafiltration != "0" ? "L" : "" }}</span>
114
-          <span v-if="this.$store.getters.xt_user.template_info.template_id == 17 || this.$store.getters.xt_user.template_info.template_id == 9 || this.$store.getters.xt_user.template_info.template_id == 20 || this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 22 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 24 || this.$store.getters.xt_user.template_info.template_id == 26 || this.$store.getters.xt_user.template_info.template_id == 28 || this.$store.getters.xt_user.template_info.template_id == 27 || this.$store.getters.xt_user.template_info.template_id == 29 || this.$store.getters.xt_user.template_info.template_id == 30 || this.$store.getters.xt_user.template_info.template_id == 31 || this.$store.getters.xt_user.template_info.template_id == 32 || this.$store.getters.xt_user.template_info.template_id == 34 || this.$store.getters.xt_user.template_info.template_id == 38 || this.$store.getters.xt_user.template_info.template_id != 40 || this.$store.getters.xt_user.template_info.template_id != 43 || this.$store.getters.xt_user.template_info.template_id != 45 || this.$store.getters.xt_user.template_info.org_id == 9555 || this.$store.getters.xt_user.template_info.org_id == 9671" class="unit">{{ target_ultrafiltration != "0" ? "ml" : "" }}</span>
113
+          
114
+          <span v-if="this.$store.getters.xt_user.template_info.template_id != 17 && this.$store.getters.xt_user.template_info.template_id != 9 && this.$store.getters.xt_user.template_info.template_id != 20 && this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 22 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 24 && this.$store.getters.xt_user.template_info.template_id != 26 && this.$store.getters.xt_user.template_info.template_id != 28 && this.$store.getters.xt_user.template_info.template_id != 27 && this.$store.getters.xt_user.template_info.template_id != 29 && this.$store.getters.xt_user.template_info.template_id != 30 && this.$store.getters.xt_user.template_info.template_id != 31 && this.$store.getters.xt_user.template_info.template_id != 32 && this.$store.getters.xt_user.template_info.template_id != 34 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.template_id != 40 && this.$store.getters.xt_user.template_info.template_id != 43 && this.$store.getters.xt_user.template_info.template_id != 45 && this.$store.getters.xt_user.template_info.org_id != 9555"  class="unit">{{ target_ultrafiltration != "0" ? "L" : "" }}</span>
115
+          <span v-if="this.$store.getters.xt_user.template_info.template_id == 17 || this.$store.getters.xt_user.template_info.template_id == 9 || this.$store.getters.xt_user.template_info.template_id == 20 || this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 22 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 24 || this.$store.getters.xt_user.template_info.template_id == 26 || this.$store.getters.xt_user.template_info.template_id == 28 || this.$store.getters.xt_user.template_info.template_id == 27 || this.$store.getters.xt_user.template_info.template_id == 29 || this.$store.getters.xt_user.template_info.template_id == 30 || this.$store.getters.xt_user.template_info.template_id == 31 || this.$store.getters.xt_user.template_info.template_id == 32 || this.$store.getters.xt_user.template_info.template_id == 34 || this.$store.getters.xt_user.template_info.template_id == 38 || this.$store.getters.xt_user.template_info.template_id != 40 || this.$store.getters.xt_user.template_info.template_id != 43 || this.$store.getters.xt_user.template_info.template_id != 45 || this.$store.getters.xt_user.template_info.org_id == 9555" class="unit">{{ target_ultrafiltration != "0" ? "ml" : "" }}</span>
116
+        </li>
117
+
118
+         <li v-if="isShow('目标超滤量') && this.$store.getters.xt_user.template_info.org_id == 10290">
119
+          <label>目标超滤量 : </label>
120
+          <span class="content">{{ target_ultrafiltration != "0" ? target_ultrafiltration : ""}}</span>
121
+          <span class="unit">{{ target_ultrafiltration != "0" ? "L" : "" }}</span>
115
         </li>
122
         </li>
116
         <!-- <li v-if="isShow('葡萄糖')">
123
         <!-- <li v-if="isShow('葡萄糖')">
117
           <label>葡萄糖 : </label>
124
           <label>葡萄糖 : </label>

+ 10 - 0
src/xt_pages/dialysis/dialysisPrintOrder.vue 파일 보기

65
           >打印</el-button
65
           >打印</el-button
66
         >
66
         >
67
       </template>
67
       </template>
68
+      <template v-if="org_template_info.template_id == 46">
69
+        <el-button
70
+          :loading="loading"
71
+          size="small"
72
+          icon="el-icon-printer"
73
+          @click="printThisPage"
74
+          type="primary"
75
+          >打印</el-button
76
+        >
77
+      </template>
68
       <template v-if="org_template_info.template_id == 5">
78
       <template v-if="org_template_info.template_id == 5">
69
         <div>
79
         <div>
70
           <el-button
80
           <el-button

+ 263 - 22
src/xt_pages/dialysis/template/DialysisPrintOrderFortySix.vue 파일 보기

59
           <div class="inline_block">
59
           <div class="inline_block">
60
             病区:
60
             病区:
61
             <div class="under_line" style="width: 50px; text-align: center">
61
             <div class="under_line" style="width: 50px; text-align: center">
62
-              <span v-if="org_id == 10121">{{
62
+              <span>{{
63
                 patientInfo.DialysisSchedule.device_zone.name
63
                 patientInfo.DialysisSchedule.device_zone.name
64
                   ? patientInfo.DialysisSchedule.device_zone.name
64
                   ? patientInfo.DialysisSchedule.device_zone.name
65
-                  : ""
65
+                  : "/"
66
               }}</span>
66
               }}</span>
67
-              <span v-else>{{ "/" }}</span>
67
+              
68
             </div>
68
             </div>
69
           </div>
69
           </div>
70
           <div class="inline_block">
70
           <div class="inline_block">
91
             </div>
91
             </div>
92
           </div>
92
           </div>
93
         </div>
93
         </div>
94
-  
95
 
94
 
96
         <div
95
         <div
97
           class="row"
96
           class="row"
695
                     class="row"
694
                     class="row"
696
                     style="padding: 2px 0; line-height: 23px; display: flex"
695
                     style="padding: 2px 0; line-height: 23px; display: flex"
697
                   >
696
                   >
698
-                    <div
699
-                      class="inline_block"
700
-                      style="flex: 1"
701
-                    >
702
-                      <span>透析(滤)器/灌流器:</span>
697
+                    <div class="inline_block" style="flex: 1">
698
+                      <span>透析器/灌流器:</span>
703
                       <div
699
                       <div
704
                         class="under_line"
700
                         class="under_line"
705
                         style="width: 100px; text-align: center"
701
                         style="width: 100px; text-align: center"
707
                         {{
703
                         {{
708
                           prescription.dialyzer_perfusion_apparatus
704
                           prescription.dialyzer_perfusion_apparatus
709
                             ? prescription.dialyzer_perfusion_apparatus
705
                             ? prescription.dialyzer_perfusion_apparatus
710
-                            : ""
711
-                        }}
712
-                        {{
713
-                          prescription.dialysis_dialyszers
714
-                            ? prescription.dialysis_dialyszers
715
-                            : ""
716
-                        }}
717
-                        {{
718
-                          prescription.dialysis_irrigation
719
-                            ? prescription.dialysis_irrigation
720
                             : "/"
706
                             : "/"
721
                         }}
707
                         }}
722
                       </div>
708
                       </div>
1586
               </div>
1572
               </div>
1587
             </div>
1573
             </div>
1588
           </div>
1574
           </div>
1589
-
1590
         </template>
1575
         </template>
1591
         <div class="row" style="margin-top: -11px; position: relative">
1576
         <div class="row" style="margin-top: -11px; position: relative">
1592
           <table class="proj_table">
1577
           <table class="proj_table">
1704
                   </td>
1689
                   </td>
1705
                 </tr>
1690
                 </tr>
1706
               </template>
1691
               </template>
1707
-
1692
+              <tr>
1693
+                <td colspan="7">
1694
+                  <div
1695
+                    class="row"
1696
+                    style="padding: 2px 0; line-height: 23px; display: flex"
1697
+                  >
1698
+                    <div class="inline_block" style="flex: 1">
1699
+                      穿刺护士:
1700
+                      <div
1701
+                        class="under_line"
1702
+                        style="width: 80px; text-align: center"
1703
+                      >
1704
+                        <span
1705
+                          style="height: 30px; display: inline-block"
1706
+                          v-if="
1707
+                            setAdminUserES(
1708
+                              dialysisOrder == null
1709
+                                ? 0
1710
+                                : dialysisOrder.puncture_nurse
1711
+                            ) == ''
1712
+                          "
1713
+                        >
1714
+                          {{
1715
+                            getAdminUser(
1716
+                              dialysisOrder == null
1717
+                                ? 0
1718
+                                : dialysisOrder.puncture_nurse
1719
+                            )
1720
+                          }}</span
1721
+                        >
1722
+                        <img
1723
+                          style="height: 30px"
1724
+                          :src="
1725
+                            setAdminUserES(
1726
+                              dialysisOrder == null
1727
+                                ? 0
1728
+                                : dialysisOrder.puncture_nurse
1729
+                            )
1730
+                          "
1731
+                          alt=""
1732
+                          srcset=""
1733
+                          v-else
1734
+                        />
1735
+                      </div>
1736
+                    </div>
1737
+                    <div class="inline_block" style="flex: 1">
1738
+                      治疗护士:
1739
+                      <div
1740
+                        class="under_line"
1741
+                        style="width: 80px; text-align: center"
1742
+                      >
1743
+                        <span
1744
+                          style="height: 30px; display: inline-block"
1745
+                          v-if="
1746
+                            setAdminUserES(
1747
+                              dialysisOrder == null
1748
+                                ? 0
1749
+                                : dialysisOrder.start_nurse
1750
+                            ) == ''
1751
+                          "
1752
+                        >
1753
+                          {{
1754
+                            getAdminUser(
1755
+                              dialysisOrder == null
1756
+                                ? 0
1757
+                                : dialysisOrder.start_nurse
1758
+                            )
1759
+                          }}</span
1760
+                        >
1761
+                        <img
1762
+                          style="height: 30px"
1763
+                          :src="
1764
+                            setAdminUserES(
1765
+                              dialysisOrder == null
1766
+                                ? 0
1767
+                                : dialysisOrder.start_nurse
1768
+                            )
1769
+                          "
1770
+                          alt=""
1771
+                          srcset=""
1772
+                          v-else
1773
+                        />
1774
+                      </div>
1775
+                    </div>
1776
+                    <div class="inline_block" style="flex: 1">
1777
+                      核对人员:
1778
+                      <div
1779
+                        class="under_line"
1780
+                        style="width: 80px; text-align: center"
1781
+                        v-if="dialysisOrder == null"
1782
+                      >
1783
+                        <span
1784
+                          style="height: 30px; display: inline-block"
1785
+                          v-if="
1786
+                            setAdminUserES(check == null ? 0 : check.creater) ==
1787
+                            ''
1788
+                          "
1789
+                        >
1790
+                          {{ getAdminUser(check == null ? 0 : check.creater) }}
1791
+                        </span>
1792
+                        <img
1793
+                          style="height: 30px"
1794
+                          :src="
1795
+                            setAdminUserES(check == null ? 0 : check.creater)
1796
+                          "
1797
+                          alt=""
1798
+                          srcset=""
1799
+                          v-else
1800
+                        />
1801
+                      </div>
1802
+                      <div
1803
+                        class="under_line"
1804
+                        style="width: 80px; text-align: center"
1805
+                        v-if="
1806
+                          dialysisOrder != null &&
1807
+                          dialysisOrder.start_nurse == check.modifier
1808
+                        "
1809
+                      >
1810
+                        <span
1811
+                          style="height: 30px; display: inline-block"
1812
+                          v-if="
1813
+                            setAdminUserES(check == null ? 0 : check.creater) ==
1814
+                            ''
1815
+                          "
1816
+                        >
1817
+                          {{ getAdminUser(check == null ? 0 : check.creater) }}
1818
+                        </span>
1819
+                        <img
1820
+                          style="height: 30px"
1821
+                          :src="
1822
+                            setAdminUserES(check == null ? 0 : check.creater)
1823
+                          "
1824
+                          alt=""
1825
+                          srcset=""
1826
+                          v-else
1827
+                        />
1828
+                      </div>
1829
+                      <div
1830
+                        class="under_line"
1831
+                        style="width: 80px; text-align: center"
1832
+                        v-if="
1833
+                          dialysisOrder != null &&
1834
+                          dialysisOrder.start_nurse == check.creater
1835
+                        "
1836
+                      >
1837
+                        <span
1838
+                          style="height: 30px; display: inline-block"
1839
+                          v-if="
1840
+                            setAdminUserES(
1841
+                              check == null ? 0 : check.modifier
1842
+                            ) == ''
1843
+                          "
1844
+                        >
1845
+                          {{ getAdminUser(check == null ? 0 : check.modifier) }}
1846
+                        </span>
1847
+                        <img
1848
+                          style="height: 30px"
1849
+                          :src="
1850
+                            setAdminUserES(check == null ? 0 : check.modifier)
1851
+                          "
1852
+                          alt=""
1853
+                          srcset=""
1854
+                          v-else
1855
+                        />
1856
+                      </div>
1857
+                      <div
1858
+                        class="under_line"
1859
+                        style="width: 80px; text-align: center"
1860
+                        v-if="
1861
+                          dialysisOrder != null &&
1862
+                          dialysisOrder.start_nurse != check.creater &&
1863
+                          dialysisOrder.start_nurse != check.modifier
1864
+                        "
1865
+                      >
1866
+                        <span
1867
+                          style="height: 30px; display: inline-block"
1868
+                          v-if="
1869
+                            setAdminUserES(check == null ? 0 : check.creater) ==
1870
+                            ''
1871
+                          "
1872
+                        >
1873
+                          {{ getAdminUser(check == null ? 0 : check.creater) }}
1874
+                        </span>
1875
+                        <img
1876
+                          style="height: 30px"
1877
+                          :src="
1878
+                            setAdminUserES(check == null ? 0 : check.creater)
1879
+                          "
1880
+                          alt=""
1881
+                          srcset=""
1882
+                          v-else
1883
+                        />
1884
+                      </div>
1885
+                    </div>
1886
+                    <div class="inline_block" style="flex: 1">
1887
+                      下机护士:
1888
+                      <div
1889
+                        class="under_line"
1890
+                        style="width: 80px; text-align: center"
1891
+                      >
1892
+                        <span
1893
+                          style="height: 30px; display: inline-block"
1894
+                          v-if="
1895
+                            setAdminUserES(
1896
+                              dialysisOrder == null
1897
+                                ? 0
1898
+                                : dialysisOrder.finish_nurse
1899
+                            ) == ''
1900
+                          "
1901
+                        >
1902
+                          {{
1903
+                            getAdminUser(
1904
+                              dialysisOrder == null
1905
+                                ? 0
1906
+                                : dialysisOrder.finish_nurse
1907
+                            )
1908
+                          }}
1909
+                        </span>
1910
+                        <img
1911
+                          style="height: 30px"
1912
+                          :src="
1913
+                            setAdminUserES(
1914
+                              dialysisOrder == null
1915
+                                ? 0
1916
+                                : dialysisOrder.finish_nurse
1917
+                            )
1918
+                          "
1919
+                          alt=""
1920
+                          srcset=""
1921
+                          v-else
1922
+                        />
1923
+                      </div>
1924
+                    </div>
1925
+                    <div class="inline_block" style="flex: 1">
1926
+                      治疗医生:
1927
+                      <div
1928
+                        class="under_line"
1929
+                        style="width: 80px; text-align: center"
1930
+                      >
1931
+                        <span
1932
+                          style="height: 30px; display: inline-block"
1933
+                          v-if="setAdminUserES(prescription.creater) == ''"
1934
+                        >
1935
+                          {{ getAdminUser(prescription.creater) }}
1936
+                        </span>
1937
+                        <img
1938
+                          style="height: 30px"
1939
+                          :src="setAdminUserES(prescription.creater)"
1940
+                          alt=""
1941
+                          srcset=""
1942
+                          v-else
1943
+                        />
1944
+                      </div>
1945
+                    </div>
1946
+                  </div>
1947
+                </td>
1948
+              </tr>
1708
             </tbody>
1949
             </tbody>
1709
           </table>
1950
           </table>
1710
           <!-- <div  class="print-yema">1</div> -->
1951
           <!-- <div  class="print-yema">1</div> -->
1726
 import print from "print-js";
1967
 import print from "print-js";
1727
 
1968
 
1728
 export default {
1969
 export default {
1729
-  name: 'DialysisPrintOrderFortySix',
1970
+  name: "DialysisPrintOrderFortySix",
1730
   props: ["childResponse"],
1971
   props: ["childResponse"],
1731
   components: {
1972
   components: {
1732
     // DialysisPrintOrderOne,
1973
     // DialysisPrintOrderOne,

+ 2 - 0
src/xt_pages/dialysis/template/DialysisPrintOrderFortyTwo.vue 파일 보기

65
                   showValue='临时股静脉导管'></label-box>
65
                   showValue='临时股静脉导管'></label-box>
66
               &nbsp;
66
               &nbsp;
67
               <label-box :isChecked="prescription.blood_access_part_opera_name ? prescription.blood_access_part_opera_name.indexOf('长期插管')>-1?true:false : false"
67
               <label-box :isChecked="prescription.blood_access_part_opera_name ? prescription.blood_access_part_opera_name.indexOf('长期插管')>-1?true:false : false"
68
+                  showValue='长期插管'></label-box>
69
+              <label-box :isChecked="prescription.blood_access_part_opera_name ? prescription.blood_access_part_opera_name.indexOf('长期静脉导管')>-1?true:false : false"
68
                   showValue='长期静脉导管'></label-box>
70
                   showValue='长期静脉导管'></label-box>
69
               &nbsp;
71
               &nbsp;
70
             </td>
72
             </td>

+ 1 - 1
src/xt_pages/dialysis/template/DialysisPrintOrderSix.vue 파일 보기

407
                       <div class="under_line" style="width: 100px;text-align: center">
407
                       <div class="under_line" style="width: 100px;text-align: center">
408
                         {{ prescription.target_ultrafiltration ? prescription.target_ultrafiltration : "/" }}
408
                         {{ prescription.target_ultrafiltration ? prescription.target_ultrafiltration : "/" }}
409
                       </div>
409
                       </div>
410
-                      L
410
+                     L
411
                     </div>
411
                     </div>
412
                     <div class="inline_block" style="flex:1;">
412
                     <div class="inline_block" style="flex:1;">
413
                       干体重:
413
                       干体重:

+ 15 - 1
src/xt_pages/stock/drugs/drugStockInOrder.vue 파일 보기

618
     handleEdit:function(index,row){
618
     handleEdit:function(index,row){
619
        this.$router.push({
619
        this.$router.push({
620
          name:"drugStockInOrderEdit",
620
          name:"drugStockInOrderEdit",
621
-         query:{id:row.id,type:this.type}
621
+         query:{id:row.id,type:this.type,supply_warehouse_id:row.supply_warehouse_id}
622
        })
622
        })
623
     },
623
     },
624
     handleSearch(id){
624
     handleSearch(id){
649
       });
649
       });
650
     },
650
     },
651
     handleDelete: function(index, row) {
651
     handleDelete: function(index, row) {
652
+      console.log("rowe23323223",row)
653
+      if(row.supply_warehouse_id >0 ){
654
+        this.$message.error("自动入库数据不能删除!")
655
+        return false
656
+      }
652
       const ids = [];
657
       const ids = [];
653
       ids.push(row.id);
658
       ids.push(row.id);
654
       const idStr = ids.join(",");
659
       const idStr = ids.join(",");
709
         return;
714
         return;
710
       }
715
       }
711
       const ids = [];
716
       const ids = [];
717
+      const idOne = []
712
       for (let i = 0; i < this.selectedTableData.length; i++) {
718
       for (let i = 0; i < this.selectedTableData.length; i++) {
713
         ids.push(this.selectedTableData[i].id);
719
         ids.push(this.selectedTableData[i].id);
720
+        idOne.push(this.selectedTableData[i].supply_warehouse_id)
721
+      }
722
+      console.log("idson233223233223",idOne)
723
+      for(let i=0;i<idOne.length;i++){
724
+        if(idOne[i] >0 ){
725
+           this.$message.error("自动入库数据不能删除!")
726
+           return false
727
+        }
714
       }
728
       }
715
       const idStr = ids.join(",");
729
       const idStr = ids.join(",");
716
       const params = {
730
       const params = {

+ 34 - 10
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue 파일 보기

48
           align="right"
48
           align="right"
49
           format="yyyy-MM-dd"
49
           format="yyyy-MM-dd"
50
           value-format="yyyy-MM-dd"
50
           value-format="yyyy-MM-dd"
51
+          :disabled="disabled"
51
         >
52
         >
52
         </el-date-picker>
53
         </el-date-picker>
53
       </div>
54
       </div>
83
                     @select="handleSelect"
84
                     @select="handleSelect"
84
                     @input="changeDrugName(scope.$index)"
85
                     @input="changeDrugName(scope.$index)"
85
                     style="width:160px;"
86
                     style="width:160px;"
86
-                    :disabled="drug_show"
87
+                    :disabled="disabled"
88
+                   
87
                   >
89
                   >
88
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
90
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
89
                   <template slot-scope="{ item }">
91
                   <template slot-scope="{ item }">
99
               <span>药品类型</span>
101
               <span>药品类型</span>
100
             </template>
102
             </template>
101
              <template slot-scope="scope">
103
              <template slot-scope="scope">
102
-               <el-select v-model="scope.row.drug_type" filterable placeholder="请选择厂商">
104
+               <el-select v-model="scope.row.drug_type" filterable placeholder="请选择厂商" :disabled="disabled">
103
                 <el-option
105
                 <el-option
104
                   v-for="(option, index) in drugTypeList"
106
                   v-for="(option, index) in drugTypeList"
105
                   :key="index"
107
                   :key="index"
106
                   :label="option.name"
108
                   :label="option.name"
107
-                  :value="option.id">
109
+                  :value="option.id"
110
+                  
111
+                  >
108
                 </el-option>
112
                 </el-option>
109
                </el-select>
113
                </el-select>
110
             </template>
114
             </template>
130
               <template slot-scope="scope">
134
               <template slot-scope="scope">
131
                 <el-form-item style="padding-top: 20px" :rules="tableRules.batch_number"  :prop="'recordData.' + scope.$index + '.batch_number'">
135
                 <el-form-item style="padding-top: 20px" :rules="tableRules.batch_number"  :prop="'recordData.' + scope.$index + '.batch_number'">
132
                   <el-input
136
                   <el-input
137
+                   :disabled="disabled"
133
                     placeholder="请输入批号"
138
                     placeholder="请输入批号"
134
                     v-model="scope.row.batch_number"
139
                     v-model="scope.row.batch_number"
135
                   ></el-input>
140
                   ></el-input>
150
               >
155
               >
151
                 <div style="display:flex;">
156
                 <div style="display:flex;">
152
                   <el-input
157
                   <el-input
158
+                   :disabled="disabled"
153
                     oninput="value=value.replace(/\D|^0/g,'')"
159
                     oninput="value=value.replace(/\D|^0/g,'')"
154
                     placeholder="请输入入库数量"
160
                     placeholder="请输入入库数量"
155
                     type="number"
161
                     type="number"
157
                     style="width:80px"
163
                     style="width:80px"
158
                   ></el-input>
164
                   ></el-input>
159
                    <!-- {{scope.row.max_unit}} -->
165
                    <!-- {{scope.row.max_unit}} -->
160
-                   <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px">
166
+                   <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px"  :disabled="disabled">
161
                     <el-option
167
                     <el-option
162
                       v-for="(option, index) in unitList"
168
                       v-for="(option, index) in unitList"
163
                       :key="index"
169
                       :key="index"
164
                       :label="option.name"
170
                       :label="option.name"
165
-                      :value="option.name">
171
+                      :value="option.name"
172
+                     >
166
                     </el-option>
173
                     </el-option>
167
                   </el-select>
174
                   </el-select>
168
                 </div>
175
                 </div>
226
                 :rules="tableRules.expiry_date"
233
                 :rules="tableRules.expiry_date"
227
                 style="padding-top: 20px">
234
                 style="padding-top: 20px">
228
                 <el-date-picker
235
                 <el-date-picker
236
+                 :disabled="disabled"
229
                   prefix-icon="el-icon-date"
237
                   prefix-icon="el-icon-date"
230
                   style="width: 145px"
238
                   style="width: 145px"
231
                   v-model="scope.row.expiry_date"
239
                   v-model="scope.row.expiry_date"
241
           <el-table-column label="生产日期" width="180" align="center">
249
           <el-table-column label="生产日期" width="180" align="center">
242
             <template slot-scope="scope">
250
             <template slot-scope="scope">
243
               <el-date-picker
251
               <el-date-picker
252
+              :disabled="disabled"
244
                 prefix-icon="el-icon-date"
253
                 prefix-icon="el-icon-date"
245
                 style="width: 145px"
254
                 style="width: 145px"
246
                 v-model="scope.row.product_date"
255
                 v-model="scope.row.product_date"
255
              
264
              
256
           <el-table-column label="生产厂家" width="140" align="center">
265
           <el-table-column label="生产厂家" width="140" align="center">
257
             <template slot-scope="scope">
266
             <template slot-scope="scope">
258
-               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
267
+               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商"  :disabled="disabled">
259
                 <el-option
268
                 <el-option
260
                   v-for="(option, index) in manufacturerList"
269
                   v-for="(option, index) in manufacturerList"
261
                   :key="index"
270
                   :key="index"
262
                   :label="option.manufacturer_name"
271
                   :label="option.manufacturer_name"
263
-                  :value="option.id">
272
+                  :value="option.id"
273
+                 >
264
                 </el-option>
274
                 </el-option>
265
                </el-select>
275
                </el-select>
266
             </template>
276
             </template>
274
                   v-for="(option, index) in dealerList"
284
                   v-for="(option, index) in dealerList"
275
                   :key="index"
285
                   :key="index"
276
                   :label="option.dealer_name"
286
                   :label="option.dealer_name"
277
-                  :value="option.id">
287
+                  :value="option.id"
288
+                  :disabled="disabled">
278
                 </el-option>
289
                 </el-option>
279
                 </el-select>
290
                 </el-select>
280
             </template>
291
             </template>
285
             <template slot-scope="scope">
296
             <template slot-scope="scope">
286
               <el-form-item style="padding-top: 20px">
297
               <el-form-item style="padding-top: 20px">
287
                 <el-input
298
                 <el-input
299
+                 :disabled="disabled"
288
                   placeholder="请输入批准文号"
300
                   placeholder="请输入批准文号"
289
                   v-model="scope.row.number"
301
                   v-model="scope.row.number"
290
                 ></el-input>
302
                 ></el-input>
294
  
306
  
295
           <el-table-column label="备注" width="150" align="center">
307
           <el-table-column label="备注" width="150" align="center">
296
             <template slot-scope="scope">
308
             <template slot-scope="scope">
297
-              <el-input v-model="scope.row.remark"></el-input>
309
+              <el-input v-model="scope.row.remark" :disabled="disabled"></el-input>
298
             </template>
310
             </template>
299
           </el-table-column>
311
           </el-table-column>
300
 
312
 
439
       unitList:[],
451
       unitList:[],
440
       drug_show:false,
452
       drug_show:false,
441
       loading:false,
453
       loading:false,
454
+      disabled:false,
442
     };
455
     };
443
   },
456
   },
444
   methods: {
457
   methods: {
538
       return name;
551
       return name;
539
     },
552
     },
540
     handleEdit: function(index, row) {
553
     handleEdit: function(index, row) {
554
+      console.log("row23323223",row)
555
+      if(row.supply_warehouse_id > 0){
556
+        this.$message.error("自动入库数据不能新增!")
557
+        return false
558
+      }
541
       const tempObj = {};
559
       const tempObj = {};
542
       tempObj["id"] = 0;
560
       tempObj["id"] = 0;
543
       tempObj["drug_id"] = 0;
561
       tempObj["drug_id"] = 0;
555
       this.recordInfo.recordData.push(tempObj);
573
       this.recordInfo.recordData.push(tempObj);
556
     },
574
     },
557
     handleDelete: function(index, row) {
575
     handleDelete: function(index, row) {
576
+      if(row.supply_warehouse_id > 0){
577
+        this.$message.error("自动入库数据不能删除!")
578
+        return false
579
+      }
558
       if (row.id == 0) {
580
       if (row.id == 0) {
559
         this.recordInfo.recordData.splice(index, 1);
581
         this.recordInfo.recordData.splice(index, 1);
560
       } else {
582
       } else {
883
   created() {
905
   created() {
884
    
906
    
885
     this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
907
     this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
886
-    //this.GetConfigInfo();
887
     this.propForm.goodUnit = this.$store.getters.good_unit;
908
     this.propForm.goodUnit = this.$store.getters.good_unit;
888
     const order_id = this.$route.query.id;
909
     const order_id = this.$route.query.id;
889
     this.GetOrderDetail(order_id);
910
     this.GetOrderDetail(order_id);
890
     this.unitList =  getDataConfig('hemodialysis','units')
911
     this.unitList =  getDataConfig('hemodialysis','units')
912
+    if( parseInt(this.$route.query.supply_warehouse_id)>0){
913
+      this.disabled = true
914
+    }
891
   }
915
   }
892
 };
916
 };
893
 </script>
917
 </script>

+ 18 - 5
src/xt_pages/stock/stockInOrder.vue 파일 보기

1059
       }
1059
       }
1060
     },
1060
     },
1061
     handleEdit: function(index, row) {
1061
     handleEdit: function(index, row) {
1062
-      // this.$router.push({
1063
-      //   name: "stockInDetail",
1064
-      //   query: { id: row.id, type: this.type }
1065
-      // });
1066
-      this.$router.push({path:"/stock/in/order/edit?id="+row.id})
1062
+      console.log("rowe232323232332",row)
1063
+      this.$router.push({path:"/stock/in/order/edit?id="+row.id+"&supply_warehouse_id="+row.supply_warehouse_id})
1067
     },
1064
     },
1068
     handleDelete: function(index, row) {
1065
     handleDelete: function(index, row) {
1066
+     
1067
+      if(row.supply_warehouse_id > 0){
1068
+        this.$message.error("自动生成入库单不能删除!")
1069
+        return false
1070
+      }
1069
       const ids = [];
1071
       const ids = [];
1070
       ids.push(row.id);
1072
       ids.push(row.id);
1071
       const idStr = ids.join(",");
1073
       const idStr = ids.join(",");
1122
         return;
1124
         return;
1123
       }
1125
       }
1124
       const ids = [];
1126
       const ids = [];
1127
+      const idOne = []
1125
       for (let i = 0; i < this.selectedTableData.length; i++) {
1128
       for (let i = 0; i < this.selectedTableData.length; i++) {
1126
         ids.push(this.selectedTableData[i].id);
1129
         ids.push(this.selectedTableData[i].id);
1130
+        idOne.push(this.selectedTableData[i].supply_warehouse_id)
1131
+      }
1132
+      console.log("idson23322323",idOne)
1133
+      for(let i=0;i<idOne.length;i++){
1134
+        if(idOne[i] >0){
1135
+          this.$message.error("自动入库数据不能删除!")
1136
+          return false
1137
+        }
1127
       }
1138
       }
1139
+    
1128
       const idStr = ids.join(",");
1140
       const idStr = ids.join(",");
1129
       const params = {
1141
       const params = {
1130
         ids: idStr
1142
         ids: idStr
1371
       },
1383
       },
1372
 
1384
 
1373
      DeleteWarehouseInfoItem: function(index, row) {
1385
      DeleteWarehouseInfoItem: function(index, row) {
1386
+       
1374
       if (row.id == 0) {
1387
       if (row.id == 0) {
1375
         this.recordInfo.recordData.splice(index, 1);
1388
         this.recordInfo.recordData.splice(index, 1);
1376
       } else {
1389
       } else {

+ 28 - 7
src/xt_pages/stock/stockInOrderEdit.vue 파일 보기

46
           align="right"
46
           align="right"
47
           format="yyyy-MM-dd"
47
           format="yyyy-MM-dd"
48
           value-format="yyyy-MM-dd"
48
           value-format="yyyy-MM-dd"
49
+          :disabled="disabled"
49
         >
50
         >
50
         </el-date-picker>
51
         </el-date-picker>
51
       </div>
52
       </div>
74
                     @select="handleSelect"
75
                     @select="handleSelect"
75
                     @input="changeGoodName(scope.$index)"
76
                     @input="changeGoodName(scope.$index)"
76
                     style="width:150px;"
77
                     style="width:150px;"
78
+                    :disabled ="disabled"
77
                   >
79
                   >
78
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
80
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
79
                   <template slot-scope="{ item }">
81
                   <template slot-scope="{ item }">
93
                   placeholder="请输入耗材类型"
95
                   placeholder="请输入耗材类型"
94
                   v-model="scope.row.good_type_id"
96
                   v-model="scope.row.good_type_id"
95
                   :value="typeName(scope.row.good_type_id)"
97
                   :value="typeName(scope.row.good_type_id)"
98
+                   :disabled ="disabled"
96
                 ></el-input>
99
                 ></el-input>
97
               </el-form-item>
100
               </el-form-item>
98
             </template>
101
             </template>
105
             <template slot-scope="scope">
108
             <template slot-scope="scope">
106
 
109
 
107
               <el-form-item style="padding-top: 20px">
110
               <el-form-item style="padding-top: 20px">
108
-                <el-input placeholder="请输入规格名称" v-model="scope.row.name"></el-input>
111
+                <el-input placeholder="请输入规格名称" v-model="scope.row.name"  :disabled ="disabled"></el-input>
109
               </el-form-item>
112
               </el-form-item>
110
 
113
 
111
             </template>
114
             </template>
118
             <template slot-scope="scope">
121
             <template slot-scope="scope">
119
               <el-form-item style="padding-top: 20px" :prop="'recordData.' + scope.$index + '.number'"
122
               <el-form-item style="padding-top: 20px" :prop="'recordData.' + scope.$index + '.number'"
120
                             :rules='tableRules.number' >
123
                             :rules='tableRules.number' >
121
-                <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
124
+                <el-input placeholder="请输入批号" v-model="scope.row.number"  :disabled ="disabled"></el-input>
122
               </el-form-item>
125
               </el-form-item>
123
             </template>
126
             </template>
124
           </el-table-column>
127
           </el-table-column>
172
                   placeholder="请输入入库数量"
175
                   placeholder="请输入入库数量"
173
                   type="number"
176
                   type="number"
174
                   v-model="scope.row.warehousing_count"
177
                   v-model="scope.row.warehousing_count"
178
+                   :disabled ="disabled"
175
                 ></el-input>
179
                 ></el-input>
176
                 {{scope.row.min_unit}}
180
                 {{scope.row.min_unit}}
177
               </el-form-item>
181
               </el-form-item>
192
                 :rules="tableRules.expiry_date">
196
                 :rules="tableRules.expiry_date">
193
                 <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.expiry_date"
197
                 <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.expiry_date"
194
                                 type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
198
                                 type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
195
-                                value-format="yyyy-MM-dd">
199
+                                value-format="yyyy-MM-dd"  :disabled ="disabled">
196
                 </el-date-picker>
200
                 </el-date-picker>
197
              </el-form-item>
201
              </el-form-item>
198
             </template>
202
             </template>
209
                 placeholder="选择日期时间"
213
                 placeholder="选择日期时间"
210
                 format="yyyy-MM-dd"
214
                 format="yyyy-MM-dd"
211
                 value-format="yyyy-MM-dd"
215
                 value-format="yyyy-MM-dd"
216
+                :disabled ="disabled"
212
               ></el-date-picker>
217
               ></el-date-picker>
213
             </template>
218
             </template>
214
           </el-table-column>
219
           </el-table-column>
215
 
220
 
216
            <el-table-column label="生产厂家" align="center" width="150">
221
            <el-table-column label="生产厂家" align="center" width="150">
217
              <template slot-scope="scope">
222
              <template slot-scope="scope">
218
-               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
223
+               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商"  :disabled ="disabled">
219
                 <el-option
224
                 <el-option
220
                   v-for="(option, index) in manufacturerList"
225
                   v-for="(option, index) in manufacturerList"
221
                   :key="index"
226
                   :key="index"
237
                 <el-input
242
                 <el-input
238
                   placeholder="请输入批准文号"
243
                   placeholder="请输入批准文号"
239
                   v-model="scope.row.license_number"
244
                   v-model="scope.row.license_number"
240
-                  
245
+                  :disabled ="disabled"
241
                 ></el-input>
246
                 ></el-input>
242
               </el-form-item>
247
               </el-form-item>
243
             </template>
248
             </template>
249
                   v-for="(option, index) in dealerList"
254
                   v-for="(option, index) in dealerList"
250
                   :key="index"
255
                   :key="index"
251
                   :label="option.dealer_name"
256
                   :label="option.dealer_name"
252
-                  :value="option.id">
257
+                  :value="option.id"
258
+                   :disabled ="disabled">
253
                 </el-option>
259
                 </el-option>
254
                </el-select>
260
                </el-select>
255
             </template>
261
             </template>
256
           </el-table-column>
262
           </el-table-column>
257
           <el-table-column label="备注" width="150" align="center">
263
           <el-table-column label="备注" width="150" align="center">
258
             <template slot-scope="scope">
264
             <template slot-scope="scope">
259
-              <el-input v-model="scope.row.remark"></el-input>
265
+              <el-input v-model="scope.row.remark"  :disabled ="disabled"></el-input>
260
             </template>
266
             </template>
261
           </el-table-column>
267
           </el-table-column>
262
 
268
 
395
       manufacturerList:[],
401
       manufacturerList:[],
396
       numberList:[],
402
       numberList:[],
397
       loading:false,
403
       loading:false,
404
+      disabled:false,
398
     };
405
     };
399
   },
406
   },
400
   methods: {
407
   methods: {
486
       return name;
493
       return name;
487
     },
494
     },
488
     handleEdit: function(index, row) {
495
     handleEdit: function(index, row) {
496
+      if(row.supply_warehouse_id > 0){
497
+        this.$message.error("自动入库数据不能新增!")
498
+        return false
499
+      }
489
       const tempObj = {};
500
       const tempObj = {};
490
       tempObj["id"] = 0;
501
       tempObj["id"] = 0;
491
       tempObj["good_type_id"] = 0;
502
       tempObj["good_type_id"] = 0;
503
       this.recordInfo.recordData.push(tempObj);
514
       this.recordInfo.recordData.push(tempObj);
504
     },
515
     },
505
     handleDelete: function(index, row) {
516
     handleDelete: function(index, row) {
517
+      console.log("Row2332233232",row)
518
+      if(row.supply_warehouse_id >0){
519
+        this.$message.error("自动入库数据不能删除!")
520
+        return false
521
+      }
506
       if (row.id == 0) {
522
       if (row.id == 0) {
507
         this.recordInfo.recordData.splice(index, 1);
523
         this.recordInfo.recordData.splice(index, 1);
508
       } else {
524
       } else {
819
     this.GetConfigInfo();
835
     this.GetConfigInfo();
820
     this.propForm.goodUnit = this.$store.getters.good_unit;
836
     this.propForm.goodUnit = this.$store.getters.good_unit;
821
     const order_id = this.$route.query.id;
837
     const order_id = this.$route.query.id;
838
+    var supply_warehouse_id =  parseInt(this.$route.query.supply_warehouse_id)  
839
+    if(supply_warehouse_id > 0){
840
+      this.disabled = true
841
+    }
822
     this.GetOrderDetail(order_id);
842
     this.GetOrderDetail(order_id);
843
+
823
   }
844
   }
824
 };
845
 };
825
 </script>
846
 </script>

+ 302 - 31
src/xt_pages/supply/components/addGoodOrder.vue 파일 보기

12
           align-items: center;
12
           align-items: center;
13
         "
13
         "
14
       >
14
       >
15
-        <div>
15
+        <div style="display:flex;align-items: center;">
16
           <span style="color: red">*</span><span>供应商:</span>
16
           <span style="color: red">*</span><span>供应商:</span>
17
           <el-select
17
           <el-select
18
             v-model="supplier_name"
18
             v-model="supplier_name"
19
             style="width: 140px; margin-right: 10px"
19
             style="width: 140px; margin-right: 10px"
20
             placeholder="请选择"
20
             placeholder="请选择"
21
+            :disabled="disabled"
21
           >
22
           >
22
             <el-option
23
             <el-option
23
               v-for="item in supplyList"
24
               v-for="item in supplyList"
29
           </el-select>
30
           </el-select>
30
           <span>单据日期:</span>
31
           <span>单据日期:</span>
31
           <el-date-picker
32
           <el-date-picker
33
+            :disabled="disabled"
32
             size="small"
34
             size="small"
33
             v-model="start_time"
35
             v-model="start_time"
34
             prefix-icon="el-icon-date"
36
             prefix-icon="el-icon-date"
56
         ></el-date-picker> -->
58
         ></el-date-picker> -->
57
           <span>单据编码:{{ good_number }}</span>
59
           <span>单据编码:{{ good_number }}</span>
58
         </div>
60
         </div>
59
-        <div>
61
+        <div style="display:flex">
60
           <el-button
62
           <el-button
61
             size="small"
63
             size="small"
62
             type="primary"
64
             type="primary"
71
             v-show="showTwo"
73
             v-show="showTwo"
72
             >保存</el-button
74
             >保存</el-button
73
           >
75
           >
74
-          <el-button size="small" type="primary" @click="checkGoodOrder" >审核</el-button>
76
+          <el-button size="small" type="primary" @click="checkGoodOrder" v-if="is_check == 2" >审核</el-button>
77
+          <el-button size="small" type="primary" @click="MofyGoodOrder" v-if="is_check == 1">反审核</el-button>
78
+          <el-button size="small" type="primary" @click="toClick" v-if="is_check == 1" >生成采购退货单</el-button>
75
         </div>
79
         </div>
76
       </div>
80
       </div>
77
 
81
 
238
             </template>
242
             </template>
239
           </el-table-column>
243
           </el-table-column>
240
 
244
 
245
+           <el-table-column label="拆零零售价" align="center" width="180px">
246
+            <template slot-scope="scope">
247
+              <el-input
248
+                v-model="scope.row.min_price"
249
+                style="width: 140px"
250
+                :disabled="disabled"
251
+                placeholder="请输入拆零零售价"
252
+              ></el-input>
253
+              <div style="visibility: hidden">/</div>
254
+            </template>
255
+          </el-table-column>
256
+
241
           <el-table-column label="采购单价" align="center" width="180px">
257
           <el-table-column label="采购单价" align="center" width="180px">
242
             <template slot-scope="scope">
258
             <template slot-scope="scope">
243
               <el-input
259
               <el-input
253
           <el-table-column label="采购金额" align="center" width="120px">
269
           <el-table-column label="采购金额" align="center" width="120px">
254
             <template slot-scope="scope">
270
             <template slot-scope="scope">
255
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
271
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
272
+              <div style="visibility: hidden">/</div>
256
             </template>
273
             </template>
257
           </el-table-column>
274
           </el-table-column>
258
           <el-table-column label="生产日期" align="center" width="200px">
275
           <el-table-column label="生产日期" align="center" width="200px">
388
               v-model="rate_of_concession"
405
               v-model="rate_of_concession"
389
               @input="addressChange"
406
               @input="addressChange"
390
               placeholder="请输入优惠率"
407
               placeholder="请输入优惠率"
408
+              :disabled="disabled"
391
             ></el-input
409
             ></el-input
392
             >%</span
410
             >%</span
393
           >
411
           >
398
               v-model="discount_amount"
416
               v-model="discount_amount"
399
               @input="count_discount"
417
               @input="count_discount"
400
               placeholder="请输入优惠金额"
418
               placeholder="请输入优惠金额"
419
+              :disabled="disabled"
401
             ></el-input
420
             ></el-input
402
           ></span>
421
           ></span>
403
 
422
 
407
               v-model="payment"
426
               v-model="payment"
408
               @input="count_payment"
427
               @input="count_payment"
409
               placeholder="请输入本次付款"
428
               placeholder="请输入本次付款"
429
+              :disabled="disabled"
410
             ></el-input
430
             ></el-input
411
           ></span>
431
           ></span>
412
 
432
 
449
   updateGoodOrder,
469
   updateGoodOrder,
450
   checkGoodOrderById,
470
   checkGoodOrderById,
451
   getGoodOrderCountList,
471
   getGoodOrderCountList,
452
-  ModefySupplyWarehousing
472
+  ModefySupplyWarehousing,
473
+  MofyGoodOrder,
474
+  getSupplyWarehouseOutById
453
 } from "@/api/supply";
475
 } from "@/api/supply";
454
 export default {
476
 export default {
455
   name: "addPurchaseOrder",
477
   name: "addPurchaseOrder",
597
             drugList[i].supply_remake = "";
619
             drugList[i].supply_remake = "";
598
             drugList[i].type = 1;
620
             drugList[i].type = 1;
599
             drugList[i].supply_price = drugList[i].last_price;
621
             drugList[i].supply_price = drugList[i].last_price;
622
+            drugList[i].min_price = drugList[i].min_price
600
             drugList[i].name = drugList[i].drug_name;
623
             drugList[i].name = drugList[i].drug_name;
601
             if (drugList[i].max_unit != drugList[i].min_unit) {
624
             if (drugList[i].max_unit != drugList[i].min_unit) {
602
               drugList[i].unitList = [
625
               drugList[i].unitList = [
652
             goodList[i].name = goodList[i].good_name;
675
             goodList[i].name = goodList[i].good_name;
653
             goodList[i].unitList = [{ id: 1, name: "" }];
676
             goodList[i].unitList = [{ id: 1, name: "" }];
654
             goodList[i].supply_unit = goodList[i].packing_unit;
677
             goodList[i].supply_unit = goodList[i].packing_unit;
678
+            goodList[i].min_price = goodList[i].retail_price
655
             for (let j = 0; j < goodList[i].unitList.length; j++) {
679
             for (let j = 0; j < goodList[i].unitList.length; j++) {
656
               goodList[i].unitList[0].name = goodList[i].packing_unit;
680
               goodList[i].unitList[0].name = goodList[i].packing_unit;
657
             }
681
             }
672
           this.recordInfo.tableList[i].name = val.name;
696
           this.recordInfo.tableList[i].name = val.name;
673
           this.recordInfo.tableList[i].supply_name = val.supply_name;
697
           this.recordInfo.tableList[i].supply_name = val.supply_name;
674
           this.recordInfo.tableList[i].supply_type = val.supply_type;
698
           this.recordInfo.tableList[i].supply_type = val.supply_type;
675
-          this.recordInfo.tableList[i].supply_specification_name =
676
-            val.supply_specification_name;
699
+          this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name;
677
           this.recordInfo.tableList[i].supply_total = val.supply_total;
700
           this.recordInfo.tableList[i].supply_total = val.supply_total;
701
+          this.recordInfo.tableList[i].min_price = val.min_price  
678
           if (val.supply_count == NaN) {
702
           if (val.supply_count == NaN) {
679
             this.recordInfo.tableList[i].supply_count = "";
703
             this.recordInfo.tableList[i].supply_count = "";
680
           } else {
704
           } else {
723
       tempObj["order_number"] = "";
747
       tempObj["order_number"] = "";
724
       tempObj["supply_expiry_date"] = "";
748
       tempObj["supply_expiry_date"] = "";
725
       tempObj["manufacturer_id"] = "";
749
       tempObj["manufacturer_id"] = "";
750
+      tempObj["min_price"] = ""
726
       this.recordInfo.tableList.push(tempObj);
751
       this.recordInfo.tableList.push(tempObj);
727
     },
752
     },
728
     handleDelete: function (index, row) {
753
     handleDelete: function (index, row) {
791
           this.recordInfo.tableList[i].supply_count;
816
           this.recordInfo.tableList[i].supply_count;
792
       }
817
       }
793
       this.total_price = total_price;
818
       this.total_price = total_price;
819
+      this.discount_amount = (this.total_price * this.rate_of_concession * 0.01).toFixed(2);
794
       return total_price.toFixed(2);
820
       return total_price.toFixed(2);
795
     },
821
     },
796
     addressChange() {
822
     addressChange() {
802
         ).toFixed(2);
828
         ).toFixed(2);
803
       }
829
       }
804
       this.discount_amount = discount_amount;
830
       this.discount_amount = discount_amount;
831
+     
805
     },
832
     },
806
     count_discount() {
833
     count_discount() {
807
       this.rate_of_concession = (
834
       this.rate_of_concession = (
810
       ).toFixed(2);
837
       ).toFixed(2);
811
     },
838
     },
812
     count_payment() {
839
     count_payment() {
813
-      this.arrearage = this.total_price - this.payment;
840
+      let arrearage_1 = (this.total_price - this.discount_amount - this.payment).toFixed(2);
841
+       if(arrearage_1 > 0){
842
+          this.arrearage = arrearage_1
843
+       }else{
844
+         this.arrearage = 0
845
+       }
814
     },
846
     },
815
 
847
 
816
     count_arrearage() {
848
     count_arrearage() {
839
       getPurchaseOrderInfo(id, ids).then((response) => {
871
       getPurchaseOrderInfo(id, ids).then((response) => {
840
         if (response.data.state == 1) {
872
         if (response.data.state == 1) {
841
           var info = response.data.data.info;
873
           var info = response.data.data.info;
842
-          this.is_check = info.is_check;
874
+          
875
+         
876
+
843
           this.id = info.id;
877
           this.id = info.id;
844
           this.supplier_name = info.supplier_id;
878
           this.supplier_name = info.supplier_id;
845
           this.rate_of_concession = info.rate_of_concession;
879
           this.rate_of_concession = info.rate_of_concession;
862
             orderInfo[i].project_id = orderInfo[i].project_id;
896
             orderInfo[i].project_id = orderInfo[i].project_id;
863
             orderInfo[i].supply_unit = orderInfo[i].supply_unit;
897
             orderInfo[i].supply_unit = orderInfo[i].supply_unit;
864
             orderInfo[i].order_number = orderInfo[i].order_number;
898
             orderInfo[i].order_number = orderInfo[i].order_number;
899
+            orderInfo[i].min_price = ""
865
             orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2);
900
             orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2);
866
             if (orderInfo[i].is_source == 1) {
901
             if (orderInfo[i].is_source == 1) {
867
               for (let j = 0; j < drugList.length; j++) {
902
               for (let j = 0; j < drugList.length; j++) {
919
           this.recordInfo.tableList[i].supply_total_price.toString();
954
           this.recordInfo.tableList[i].supply_total_price.toString();
920
         this.recordInfo.tableList[i].supply_total =
955
         this.recordInfo.tableList[i].supply_total =
921
           this.recordInfo.tableList[i].supply_total.toString();
956
           this.recordInfo.tableList[i].supply_total.toString();
957
+          this.recordInfo.tableList[i].min_price = this.recordInfo.tableList[i].min_price.toString()
922
 
958
 
923
         for (let j = 0; j < this.manufactuerList.length; j++) {
959
         for (let j = 0; j < this.manufactuerList.length; j++) {
924
           if (
960
           if (
943
           this.loading = true;
979
           this.loading = true;
944
           var warehousing_id = this.$route.query.id;
980
           var warehousing_id = this.$route.query.id;
945
           //判断是否在采购订单数据中做了删除,如果长度相等则代表没有删除,如果不等则代表做了删除或者新增
981
           //判断是否在采购订单数据中做了删除,如果长度相等则代表没有删除,如果不等则代表做了删除或者新增
946
-        
947
-          if(this.tableDataList.length != this.recordInfo.tableList){
982
+          console.log("长度2332233232",this.tableDataList.length)
983
+          console.log("产股2333223232323",this.recordInfo.tableList.length)
984
+          if(this.tableDataList.length != this.recordInfo.tableList.length){
948
              warehousing_id = 0
985
              warehousing_id = 0
949
              for(let i=0;i<this.recordInfo.tableList.length;i++){
986
              for(let i=0;i<this.recordInfo.tableList.length;i++){
950
               this.recordInfo.tableList[i].id = 0
987
               this.recordInfo.tableList[i].id = 0
963
               this.showTwo = true;
1000
               this.showTwo = true;
964
               var orderInfo = response.data.data.list;
1001
               var orderInfo = response.data.data.list;
965
               var warehouseOut = response.data.data.warehouseOut;
1002
               var warehouseOut = response.data.data.warehouseOut;
1003
+              this.is_check = 2
966
               this.warese_out_id = warehouseOut.id;
1004
               this.warese_out_id = warehouseOut.id;
1005
+              console.log("采购单id2322332",this.warese_out_id)
967
               this.good_number = warehouseOut.good_number;
1006
               this.good_number = warehouseOut.good_number;
968
               this.rate_of_concession = warehouseOut.rate_of_concession;
1007
               this.rate_of_concession = warehouseOut.rate_of_concession;
969
               this.discount_amount = warehouseOut.discount_amount;
1008
               this.discount_amount = warehouseOut.discount_amount;
993
                 if (orderInfo[i].is_source == 1) {
1032
                 if (orderInfo[i].is_source == 1) {
994
                   for (let j = 0; j < this.drugList.length; j++) {
1033
                   for (let j = 0; j < this.drugList.length; j++) {
995
                     if (orderInfo[i].project_id == this.drugList[j].id) {
1034
                     if (orderInfo[i].project_id == this.drugList[j].id) {
996
-                      if (
997
-                        this.drugList[j].max_unit != this.drugList[j].min_unit
998
-                      ) {
999
-                        orderInfo[i].unitList = [
1000
-                          { id: 1, name: "" },
1001
-                          { id: 2, name: "" },
1002
-                        ];
1003
-                        orderInfo[i].unitList[0].name =
1004
-                          this.drugList[j].max_unit;
1005
-                        orderInfo[i].unitList[1].name =
1006
-                          this.drugList[j].min_unit;
1035
+                      if (this.drugList[j].max_unit != this.drugList[j].min_unit) {
1036
+                        orderInfo[i].unitList = [{ id: 1, name: "" },{ id: 2, name: "" }];
1037
+                        orderInfo[i].unitList[0].name = this.drugList[j].max_unit;
1038
+                        orderInfo[i].unitList[1].name = this.drugList[j].min_unit;
1007
                       }
1039
                       }
1008
-                      if (
1009
-                        this.drugList[j].max_unit == this.drugList[j].min_unit
1010
-                      ) {
1011
-                        orderInfo[i].unitList[0].name =
1012
-                          this.drugList[j].max_unit;
1040
+                      if (this.drugList[j].max_unit == this.drugList[j].min_unit) {
1041
+                        orderInfo[i].unitList[0].name = this.drugList[j].max_unit;
1013
                       }
1042
                       }
1014
                     }
1043
                     }
1015
                   }
1044
                   }
1018
                   for (let j = 0; j < this.goodList.length; j++) {
1047
                   for (let j = 0; j < this.goodList.length; j++) {
1019
                     if (orderInfo[i].project_id == this.goodList[j].id) {
1048
                     if (orderInfo[i].project_id == this.goodList[j].id) {
1020
                       orderInfo[i].unitList = [{ id: 1, name: "" }];
1049
                       orderInfo[i].unitList = [{ id: 1, name: "" }];
1021
-                      orderInfo[i].unitList[0].name =
1022
-                        this.goodList[j].packing_unit;
1050
+                      orderInfo[i].unitList[0].name = this.goodList[j].packing_unit;
1023
                     }
1051
                     }
1024
                   }
1052
                   }
1025
                 }
1053
                 }
1047
           this.recordInfo.tableList[i].supply_total_price.toString();
1075
           this.recordInfo.tableList[i].supply_total_price.toString();
1048
         this.recordInfo.tableList[i].supply_total =
1076
         this.recordInfo.tableList[i].supply_total =
1049
           this.recordInfo.tableList[i].supply_total.toString();
1077
           this.recordInfo.tableList[i].supply_total.toString();
1050
-
1078
+        this.recordInfo.tableList[i].min_price = this.recordInfo.tableList[i].min_price.toString()
1051
         for (let j = 0; j < this.manufactuerList.length; j++) {
1079
         for (let j = 0; j < this.manufactuerList.length; j++) {
1052
           if (
1080
           if (
1053
             this.recordInfo.tableList[i].supply_manufacturer ==
1081
             this.recordInfo.tableList[i].supply_manufacturer ==
1097
     },
1125
     },
1098
     checkGoodOrder() {
1126
     checkGoodOrder() {
1099
       var id = this.warese_out_id;
1127
       var id = this.warese_out_id;
1100
-      var warehousing_id = this.warehousing_id;
1101
-      
1128
+      var warehousing_id = this.id;
1129
+      console.log("采购单ID",id)
1130
+      console.log("采购订单ID",warehousing_id)
1131
+    
1102
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1132
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1103
         if (response.data.state == 1) {
1133
         if (response.data.state == 1) {
1104
           this.$message.success("审核成功!");
1134
           this.$message.success("审核成功!");
1135
+          this.disabled = true
1105
           this.is_check = 1
1136
           this.is_check = 1
1106
           this.showOne = false;
1137
           this.showOne = false;
1107
           this.showTwo = true;
1138
           this.showTwo = true;
1207
         }
1238
         }
1208
       });
1239
       });
1209
     },
1240
     },
1241
+    MofyGoodOrder() {
1242
+      var id = this.warese_out_id;
1243
+      console.log("采购单ID",id)
1244
+      var params = {
1245
+        id: id,
1246
+      };
1247
+      MofyGoodOrder(params).then((response) => {
1248
+        if (response.data.state == 1) {
1249
+          var msg = response.data.data.msg;
1250
+          if (msg == 1) {
1251
+            this.$message.success("反审核成功!");
1252
+            this.is_check = 2
1253
+            this.disabled = false
1254
+            this.Reviewed = false
1255
+            return
1256
+          }
1257
+          if (msg == 2) {
1258
+            var cancelList = response.data.data.cancelList
1259
+            console.log("cancelLIST2332322332232323",cancelList)
1260
+            this.orderList = cancelList
1261
+            this.$refs.Popup.dialogVisible = true
1262
+            return
1263
+          }
1264
+
1265
+          var purcaseOrder = response.data.data.purcaseOrder;
1266
+          console.log("采购订单", purcaseOrder);
1267
+          var goodOrder = response.data.data.goodOrder;
1268
+          console.log("采购单", goodOrder);
1269
+          var drugList = response.data.data.drugList;
1270
+          console.log("druglist23323223", drugList);
1271
+          var ids = "";
1272
+          // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
1273
+          if (goodOrder.length == 0) {
1274
+            this.$router.push({path: "/good/order/add?id=" + this.id + "&ids=" + ids});
1275
+          }
1276
+          for (let i = 0; i < purcaseOrder.length; i++) {
1277
+            for (let j = 0; j < drugList.length; j++) {
1278
+              if (purcaseOrder[i].is_source == 1) {
1279
+                if (purcaseOrder[i].supply_unit == drugList[j].max_unit) {
1280
+                  purcaseOrder[i].count = purcaseOrder[i].count * drugList[j].min_number;
1281
+                }
1282
+              }
1283
+            }
1284
+          }
1285
+
1286
+          for (let i = 0; i < goodOrder.length; i++) {
1287
+            for (let j = 0; j < drugList.length; j++) {
1288
+              if (goodOrder[i].is_source == 1) {
1289
+                if (goodOrder[i].supply_unit == drugList[j].max_unit) {
1290
+                  goodOrder[i].count = goodOrder[i].count * drugList[j].min_number;
1291
+                }
1292
+              }
1293
+            }
1294
+          }
1295
+
1296
+          let objInfo = {};
1297
+          if (goodOrder.length > 0) {
1298
+            goodOrder.forEach((item, index) => {
1299
+              let { project_id } = item;
1300
+              if (!objInfo[project_id]) {
1301
+                objInfo[project_id] = {
1302
+                  project_id,
1303
+                  child: [],
1304
+                  count: 0,
1305
+                };
1306
+              }
1307
+            });
1308
+            let newArr = Object.values(objInfo);
1309
+
1310
+            for (let i = 0; i < goodOrder.length; i++) {
1311
+              for (let j = 0; j < newArr.length; j++) {
1312
+                if (goodOrder[i].project_id == newArr[j].project_id) {
1313
+                  newArr[j].child.push(goodOrder[i]);
1314
+                }
1315
+              }
1316
+            }
1317
+            console.log("newAr2332232323", newArr);
1318
+
1319
+            for (let i = 0; i < newArr.length; i++) {
1320
+              for (let j = 0; j < newArr[i].child.length; j++) {
1321
+                newArr[i].count += newArr[i].child[j].count;
1322
+              }
1323
+            }
1324
+
1325
+            var arr = [];
1326
+            var total = 0;
1327
+            var str = "";
1328
+
1329
+            //如果采购单有数据,则需要比较数量
1330
+            if (newArr.length > 0) {
1331
+              for (let i = 0; i < purcaseOrder.length; i++) {
1332
+                for (let j = 0; j < newArr.length; j++) {
1333
+                  if (purcaseOrder[i].project_id == newArr[j].project_id) {
1334
+                    //根据商品ID比较数量大小,如果采购单的数量大于采购订单的数据
1335
+                    if (purcaseOrder[i].count < newArr[j].count) {
1336
+                      arr.push(purcaseOrder[i].project_id);
1337
+                    }
1338
+                  }
1339
+                }
1340
+              }
1341
+              //如果total的长度等于0,怎修改该订单的状态为全部入库
1342
+
1343
+              if (arr.length > 0) {
1344
+                //修改采购订单的状态为全部入库
1345
+                this.UpdateSupplyWahouseingInfo();
1346
+              }
1347
+            }
1348
+          }
1349
+        }
1350
+      });
1351
+    },
1352
+    UpdateSupplyWahouseingInfo() {
1353
+      var params = {
1354
+        warehousing_id: this.$route.query.warehousing_id,
1355
+      };
1356
+      console.log("采购单ID",params)
1357
+      UpdateSupplyWahouseingInfo(params).then((response) => {
1358
+        if (response.data.state == 1) {
1359
+          var msg = response.data.data.msg;
1360
+        }
1361
+      });
1362
+    },
1363
+    toClick() {
1364
+      //先判断采购单号有没有关联的采购退货单号,如果没有,则为首次生成采购退货单
1365
+      if (this.is_check == 2) {
1366
+        this.$message.error("该采购单未审核,不能生成退货单数据!");
1367
+        return false;
1368
+      }
1369
+      var id = this.warese_out_id;
1370
+      console.log("生成采购单ID22323",id)
1371
+      getSupplyWarehouseOutById(id).then((response) => {
1372
+        if (response.data.state == 1) {
1373
+          var cancelList = response.data.data.cancelList;
1374
+          console.log("退库单", cancelList);
1375
+           var drugList = response.data.data.drugList;
1376
+          console.log("药品列表", drugList);
1377
+          var cancelOrderList = response.data.data.cancelOrderList;
1378
+          console.log("退库单详情", cancelOrderList);
1379
+          var ids =""
1380
+          if(cancelList.length == 0){
1381
+            this.$router.push({ path: "/good/return/add?id=" +id+"&ids="+ids });
1382
+          }
1383
+          if (cancelList.length > 0) {
1384
+            var outList = response.data.data.outList;
1385
+            console.log("购货单2322323",outList)
1386
+            for(let i=0;i<outList.length;i++){
1387
+              if(outList[i].is_source == 1){
1388
+                for(let j=0;j<drugList.length;j++){
1389
+                  if(outList[i].project_id == drugList[j].id){
1390
+                    if(outList[i].supply_unit == drugList[j].max_unit){
1391
+                      outList[i].count = outList[i].count * drugList[j].min_number
1392
+                    }
1393
+
1394
+                  }
1395
+                }
1396
+              }
1397
+            }
1398
+
1399
+            for(let i=0;i<cancelOrderList.length;i++){
1400
+             if(cancelOrderList[i].is_source == 1){
1401
+                for(let j=0;j<drugList.length;j++){
1402
+                  if(cancelOrderList[i].project_id == drugList[j].id){
1403
+                    if(cancelOrderList[i].supply_unit == drugList[j].max_unit){
1404
+                      cancelOrderList[i].count = cancelOrderList[i].count * drugList[j].min_number
1405
+                    }
1406
+                  }
1407
+                 }
1408
+               }
1409
+            }
1410
+
1411
+          
1412
+
1413
+            let objInfo = {};
1414
+            if(cancelOrderList.length >0){
1415
+              cancelOrderList.forEach((item, index) => {
1416
+                let { project_id } = item;
1417
+                if (!objInfo[project_id]) {
1418
+                  objInfo[project_id] = {
1419
+                    project_id,
1420
+                    child: [],
1421
+                    count: 0,
1422
+                  };
1423
+                }
1424
+              });
1425
+              let newArr = Object.values(objInfo)
1426
+            
1427
+              for (let i = 0; i < cancelOrderList.length; i++) {
1428
+                for (let j = 0; j < newArr.length; j++) {
1429
+                  if (cancelOrderList[i].project_id == newArr[j].project_id) {
1430
+                    newArr[j].child.push(cancelOrderList[i])
1431
+                }
1432
+              }
1433
+
1434
+             }
1435
+
1436
+            for (let i = 0; i < newArr.length; i++) {
1437
+              for (let j = 0; j < newArr[i].child.length; j++) {
1438
+                newArr[i].count += newArr[i].child[j].count;
1439
+              }
1440
+            }
1441
+
1442
+            var arr = []
1443
+            var total = 0;
1444
+            var str = "";
1445
+                //如果采购单有数据,则需要比较数量
1446
+            if (newArr.length > 0) {
1447
+              for (let i = 0; i < outList.length; i++) {
1448
+                for (let j = 0; j < newArr.length; j++) {
1449
+                  if (outList[i].project_id == newArr[j].project_id) {
1450
+                    //根据商品ID比较数量大小,把数量不足的商品ID储存,表示退货单的数量未满足采购单的数据,可以继续生成退货单
1451
+                    if (outList[i].count > newArr[j].count) {
1452
+                       arr.push(outList[i].project_id);
1453
+                    }
1454
+                  }
1455
+                }
1456
+              }
1457
+              //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
1458
+
1459
+              if (arr.length == 0) {
1460
+                this.$message.error("该订单已全部生成退库单,请知悉!");
1461
+                return
1462
+              }
1463
+              console.log("arr23323232232323",arr)
1464
+              if (arr.length > 0) {
1465
+                str = arr.join(",");
1466
+                this.$router.push({ path: "/good/return/edit?id=" + id + "&ids=" + str});
1467
+              }
1468
+             }
1469
+
1470
+          }
1471
+         }
1472
+        }
1473
+      });
1474
+    },
1210
   },
1475
   },
1211
   created() {
1476
   created() {
1212
     const tempObj = {};
1477
     const tempObj = {};
1231
     tempObj["order_number"] = "";
1496
     tempObj["order_number"] = "";
1232
     tempObj["supply_expiry_date"] = "";
1497
     tempObj["supply_expiry_date"] = "";
1233
     tempObj["manufacturer_id"] = "";
1498
     tempObj["manufacturer_id"] = "";
1499
+    tempObj["min_price"] = ""
1234
     this.recordInfo.tableList.push(tempObj);
1500
     this.recordInfo.tableList.push(tempObj);
1235
     this.getInitOrder();
1501
     this.getInitOrder();
1236
     if (parseInt(this.$route.query.id) > 0) {
1502
     if (parseInt(this.$route.query.id) > 0) {
1243
 </script>
1509
 </script>
1244
 
1510
 
1245
 <style rel="stylesheet/css" lang="scss" scoped>
1511
 <style rel="stylesheet/css" lang="scss" scoped>
1512
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
1513
+  width: 10px;
1514
+  height: 10px;
1515
+}
1246
 .information {
1516
 .information {
1247
   border: 1px #dcdfe6 solid;
1517
   border: 1px #dcdfe6 solid;
1248
   padding: 30px 20px 30px 20px;
1518
   padding: 30px 20px 30px 20px;
1297
   bottom: 20px;
1567
   bottom: 20px;
1298
   height: 100%;
1568
   height: 100%;
1299
 }
1569
 }
1570
+
1300
 </style>
1571
 </style>

+ 16 - 2
src/xt_pages/supply/components/addGoodReturn.vue 파일 보기

214
           <el-table-column label="采购金额" align="center" width="120px">
214
           <el-table-column label="采购金额" align="center" width="120px">
215
             <template slot-scope="scope">
215
             <template slot-scope="scope">
216
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
216
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
217
+              <div style="visibility: hidden">/</div>
217
             </template>
218
             </template>
218
           </el-table-column>
219
           </el-table-column>
219
           <el-table-column label="折扣率" align="center" width="120px">
220
           <el-table-column label="折扣率" align="center" width="120px">
220
             <template slot-scope="scope">
221
             <template slot-scope="scope">
221
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
222
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
223
+              <div style="visibility: hidden">/</div>
222
             </template>
224
             </template>
223
           </el-table-column>
225
           </el-table-column>
224
 
226
 
225
           <el-table-column label="折扣金额" align="center" width="120px">
227
           <el-table-column label="折扣金额" align="center" width="120px">
226
             <template slot-scope="scope">
228
             <template slot-scope="scope">
227
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
229
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
230
+              <div style="visibility: hidden">/</div>
228
             </template>
231
             </template>
229
           </el-table-column>
232
           </el-table-column>
230
 
233
 
683
         total_price += this.recordInfo.tableList[i].supply_price *this.recordInfo.tableList[i].supply_count;
686
         total_price += this.recordInfo.tableList[i].supply_price *this.recordInfo.tableList[i].supply_count;
684
       }
687
       }
685
       this.total_price = total_price;
688
       this.total_price = total_price;
689
+      this.discount_amount = (this.total_price * this.rate_of_concession * 0.01).toFixed(2);
686
       return total_price.toFixed(2);
690
       return total_price.toFixed(2);
687
     },
691
     },
688
 
692
 
702
         (this.total_price * 0.01)
706
         (this.total_price * 0.01)
703
       ).toFixed(2);
707
       ).toFixed(2);
704
     },
708
     },
705
-    count_payment() {
706
-      this.arrearage = this.total_price - this.payment;
709
+      count_payment() {
710
+      let arrearage_1 = (this.total_price - this.discount_amount - this.payment).toFixed(2);
711
+       if(arrearage_1 > 0){
712
+          this.arrearage = arrearage_1
713
+       }else{
714
+         this.arrearage = 0
715
+       }
707
     },
716
     },
708
 
717
 
709
     count_arrearage() {
718
     count_arrearage() {
1001
   margin-top: 15px;
1010
   margin-top: 15px;
1002
   margin-bottom: 15px;
1011
   margin-bottom: 15px;
1003
 }
1012
 }
1013
+
1014
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
1015
+  width: 10px;
1016
+  height: 10px;
1017
+}
1004
 </style>
1018
 </style>
1005
 
1019
 
1006
 <style>
1020
 <style>

+ 296 - 145
src/xt_pages/supply/components/addPurchaseOrder.vue 파일 보기

76
             @click="checkPurchaseOrder"
76
             @click="checkPurchaseOrder"
77
             v-show="showOne">审核
77
             v-show="showOne">审核
78
          </el-button>
78
          </el-button>
79
-
80
-         <!-- <el-button
79
+        
80
+        <el-button
81
+            size="small"
82
+            type="primary"
83
+            @click="toAdd"
84
+            v-if="is_check == 1">生成采购单
85
+         </el-button>
86
+         <el-button
81
             size="small"
87
             size="small"
82
             type="primary"
88
             type="primary"
83
             @click="checkReturnOrder"
89
             @click="checkReturnOrder"
84
             v-if="is_check == 1">反审核
90
             v-if="is_check == 1">反审核
85
-         </el-button> -->
91
+         </el-button>
86
          
92
          
87
           <el-button
93
           <el-button
88
             size="small"
94
             size="small"
89
             type="primary"
95
             type="primary"
90
             @click="updatePurchaseOrder"
96
             @click="updatePurchaseOrder"
91
-            v-show="showOne"
92
-            >保存</el-button
93
-          >
97
+            v-show="showThree">保存
98
+          </el-button>
94
         </div>
99
         </div>
95
       </div>
100
       </div>
96
 
101
 
104
           :data="recordInfo.tableList"
109
           :data="recordInfo.tableList"
105
           :class="signAndWeighBoxPatients"
110
           :class="signAndWeighBoxPatients"
106
           border
111
           border
107
-          style="width:100%"
112
+          style="width: 100%"
108
           max-height="450"
113
           max-height="450"
109
         >
114
         >
110
           <el-table-column align="center" width="200">
115
           <el-table-column align="center" width="200">
145
                 v-model="scope.row.supply_type"
150
                 v-model="scope.row.supply_type"
146
                 style="width: 120px"
151
                 style="width: 120px"
147
                 :disabled="true"
152
                 :disabled="true"
148
-                 placeholder="商品类别"
153
+                placeholder="商品类别"
149
               ></el-input>
154
               ></el-input>
150
               <div style="visibility: hidden">/</div>
155
               <div style="visibility: hidden">/</div>
151
             </template>
156
             </template>
206
               <el-form-item
211
               <el-form-item
207
                 :prop="'tableList.' + scope.$index + '.supply_count'"
212
                 :prop="'tableList.' + scope.$index + '.supply_count'"
208
                 :rules="tableRules.supply_count"
213
                 :rules="tableRules.supply_count"
209
-                 placeholder="请输入数量"
214
+                placeholder="请输入数量"
210
               >
215
               >
211
                 <el-input
216
                 <el-input
212
                   v-model="scope.row.supply_count"
217
                   v-model="scope.row.supply_count"
224
                 v-model="scope.row.supply_price"
229
                 v-model="scope.row.supply_price"
225
                 style="width: 80px"
230
                 style="width: 80px"
226
                 :disabled="disabled"
231
                 :disabled="disabled"
227
-                 placeholder="请输入采购单价"
232
+                placeholder="请输入采购单价"
228
               ></el-input>
233
               ></el-input>
229
               <div style="visibility: hidden">/</div>
234
               <div style="visibility: hidden">/</div>
230
             </template>
235
             </template>
233
           <el-table-column label="采购金额" align="center" width="120px">
238
           <el-table-column label="采购金额" align="center" width="120px">
234
             <template slot-scope="scope">
239
             <template slot-scope="scope">
235
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
240
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
241
+              <div style="visibility: hidden">/</div>
236
             </template>
242
             </template>
237
           </el-table-column>
243
           </el-table-column>
238
 
244
 
317
             </template>
323
             </template>
318
           </el-table-column>
324
           </el-table-column>
319
         </el-table>
325
         </el-table>
320
-         <div style="margin-top: 10px">
321
-        <el-input
322
-          type="textarea"
323
-          :rows="2"
324
-          placeholder="备注信息"
325
-          v-model="return_remark"
326
-        >
327
-        </el-input>
328
-       </div>
326
+        <div style="margin-top: 10px">
327
+          <el-input
328
+            type="textarea"
329
+            :rows="2"
330
+            placeholder="备注信息"
331
+            v-model="return_remark"
332
+          >
333
+          </el-input>
334
+        </div>
329
         <!-- 审核水印 -->
335
         <!-- 审核水印 -->
330
-        <img src="@/assets/purchase/Reviewed.png" alt="正在加载..." class="reviewImg" v-show="Reviewed == true" />
331
-
336
+        <img
337
+          src="@/assets/purchase/Reviewed.png"
338
+          alt="正在加载..."
339
+          class="reviewImg"
340
+          v-show="Reviewed == true"
341
+        />
332
       </el-form>
342
       </el-form>
333
       <div style="margin-top: 10px">合计:{{ getAllPrice() }} 元</div>
343
       <div style="margin-top: 10px">合计:{{ getAllPrice() }} 元</div>
334
       <div style="margin-top: 10px">
344
       <div style="margin-top: 10px">
351
           ></el-input
361
           ></el-input
352
         ></span>
362
         ></span>
353
       </div>
363
       </div>
354
-      
355
     </div>
364
     </div>
356
-    
357
   </div>
365
   </div>
358
 </template>
366
 </template>
359
 
367
 
365
   savePurchaseOrder,
373
   savePurchaseOrder,
366
   updatePurchaseOrder,
374
   updatePurchaseOrder,
367
   checkPurchaseOrder,
375
   checkPurchaseOrder,
368
-  getReturnOrder
376
+  getReturnOrder,
377
+  getAllOrderCountList
369
 } from "@/api/supply";
378
 } from "@/api/supply";
370
 import { getDataConfig } from "@/utils/data";
379
 import { getDataConfig } from "@/utils/data";
371
 export default {
380
 export default {
376
   },
385
   },
377
   data() {
386
   data() {
378
     return {
387
     return {
379
-      Reviewed:false,
388
+      Reviewed: false,
380
       crumbs: [
389
       crumbs: [
381
         { path: false, name: "采购订单" },
390
         { path: false, name: "采购订单" },
382
         { path: "/spply/query", name: "新增采购订单" },
391
         { path: "/spply/query", name: "新增采购订单" },
383
       ],
392
       ],
384
       showTwo: true,
393
       showTwo: true,
385
       showOne: false,
394
       showOne: false,
395
+      showThree:false,
386
       recordInfo: {
396
       recordInfo: {
387
         tableList: [],
397
         tableList: [],
388
       },
398
       },
435
       ],
445
       ],
436
       goodList: [{ id: 1, name: "" }],
446
       goodList: [{ id: 1, name: "" }],
437
       total_price: 0,
447
       total_price: 0,
438
-      return_remark:"",
439
-      is_check:2,
448
+      return_remark: "",
449
+      is_check: 2,
440
     };
450
     };
441
   },
451
   },
442
   methods: {
452
   methods: {
443
-   getInitOrder(){
444
-    getInitOrder().then(response=>{
445
-    if(response.data.state == 1){
446
-        var drugList = response.data.data.drugList
447
-        this.manufactuerList = response.data.data.manufactuerList
448
-        this.goodTypeList = response.data.data.goodTypeList
449
-        this.drugTypeList = response.data.data.drugTypeList
450
-        this.supplyList = response.data.data.supplyList
451
-       for(let i=0;i<drugList.length;i++){
452
-          for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
453
-            if(drugList[i].max_unit == drugList[i].drug_warehouse_info[z].max_unit){
454
-              drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
453
+    getInitOrder() {
454
+      getInitOrder().then((response) => {
455
+        if (response.data.state == 1) {
456
+          var drugList = response.data.data.drugList;
457
+          this.manufactuerList = response.data.data.manufactuerList;
458
+          this.goodTypeList = response.data.data.goodTypeList;
459
+          this.drugTypeList = response.data.data.drugTypeList;
460
+          this.supplyList = response.data.data.supplyList;
461
+          for (let i = 0; i < drugList.length; i++) {
462
+            for (let z = 0; z < drugList[i].drug_warehouse_info.length; z++) {
463
+              if (
464
+                drugList[i].max_unit ==
465
+                drugList[i].drug_warehouse_info[z].max_unit
466
+              ) {
467
+                drugList[i].drug_warehouse_info[z].stock_max_number =
468
+                  drugList[i].drug_warehouse_info[z].stock_max_number *
469
+                  drugList[i].min_number;
470
+              }
455
             }
471
             }
456
-          }
457
-        for(let j=0;j<this.manufactuerList.length;j++){
458
-            if(drugList[i].manufacturer == this.manufactuerList[j].id){
459
-                drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
472
+            for (let j = 0; j < this.manufactuerList.length; j++) {
473
+              if (drugList[i].manufacturer == this.manufactuerList[j].id) {
474
+                drugList[i].manufacturer =
475
+                  this.manufactuerList[j].manufacturer_name;
476
+              }
460
             }
477
             }
461
-        }
462
-        for(let y=0;y<this.drugTypeList.length;y++){
463
-            if(drugList[i].drug_type == this.drugTypeList[y].value){
464
-            drugList[i].drug_type = this.drugTypeList[y].name
478
+            for (let y = 0; y < this.drugTypeList.length; y++) {
479
+              if (drugList[i].drug_type == this.drugTypeList[y].value) {
480
+                drugList[i].drug_type = this.drugTypeList[y].name;
481
+              }
465
             }
482
             }
466
-        }
467
-        drugList[i].supply_name =  drugList[i].drug_name + " " + drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit + " " + drugList[i].manufacturer
468
-        drugList[i].supply_type = drugList[i].drug_type
469
-        drugList[i].supply_specification_name = drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit
470
-        drugList[i].supply_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number)
471
-        drugList[i].supply_count = ""
472
-        drugList[i].supply_total_price = ""
473
-        drugList[i].supply_manufacturer=  drugList[i].manufacturer
474
-        drugList[i].supply_license_number= drugList[i].number
475
-        drugList[i].supply_remake = ""
476
-        drugList[i].type = 1
477
-        drugList[i].supply_price = drugList[i].last_price
478
-        drugList[i].name = drugList[i].drug_name
479
-        if(drugList[i].max_unit!=drugList[i].min_unit){
480
-          drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
481
-        }
482
-        if(drugList[i].max_unit == drugList[i].min_unit){
483
-          drugList[i].unitList = [{id:1,name:""}]
484
-        }
485
-      
486
-        drugList[i].supply_unit = drugList[i].max_unit 
487
-        for(let j=0;j<drugList[i].unitList.length;j++){
488
-          if(drugList[i].max_unit!=drugList[i].min_unit){
489
-            drugList[i].unitList[0].name = drugList[i].max_unit
490
-            drugList[i].unitList[1].name = drugList[i].min_unit
491
-          }
492
-          if(drugList[i].max_unit ==drugList[i].min_unit){
493
-            drugList[i].unitList[0].name = drugList[i].max_unit
483
+            drugList[i].supply_name =
484
+              drugList[i].drug_name +
485
+              " " +
486
+              drugList[i].dose +
487
+              drugList[i].dose_unit +
488
+              "*" +
489
+              drugList[i].min_number +
490
+              drugList[i].min_unit +
491
+              "/" +
492
+              drugList[i].max_unit +
493
+              " " +
494
+              drugList[i].manufacturer;
495
+            drugList[i].supply_type = drugList[i].drug_type;
496
+            drugList[i].supply_specification_name =
497
+              drugList[i].dose +
498
+              drugList[i].dose_unit +
499
+              "*" +
500
+              drugList[i].min_number +
501
+              drugList[i].min_unit +
502
+              "/" +
503
+              drugList[i].max_unit;
504
+            drugList[i].supply_total = this.getWarehoseInfo(
505
+              drugList[i].drug_warehouse_info,
506
+              drugList[i].max_unit,
507
+              drugList[i].min_unit,
508
+              drugList[i].min_number
509
+            );
510
+            drugList[i].supply_count = "";
511
+            drugList[i].supply_total_price = "";
512
+            drugList[i].supply_manufacturer = drugList[i].manufacturer;
513
+            drugList[i].supply_license_number = drugList[i].number;
514
+            drugList[i].supply_remake = "";
515
+            drugList[i].type = 1;
516
+            drugList[i].supply_price = drugList[i].last_price;
517
+            drugList[i].name = drugList[i].drug_name;
518
+            if (drugList[i].max_unit != drugList[i].min_unit) {
519
+              drugList[i].unitList = [
520
+                { id: 1, name: "" },
521
+                { id: 2, name: "" },
522
+              ];
523
+            }
524
+            if (drugList[i].max_unit == drugList[i].min_unit) {
525
+              drugList[i].unitList = [{ id: 1, name: "" }];
526
+            }
527
+
528
+            drugList[i].supply_unit = drugList[i].max_unit;
529
+            for (let j = 0; j < drugList[i].unitList.length; j++) {
530
+              if (drugList[i].max_unit != drugList[i].min_unit) {
531
+                drugList[i].unitList[0].name = drugList[i].max_unit;
532
+                drugList[i].unitList[1].name = drugList[i].min_unit;
533
+              }
534
+              if (drugList[i].max_unit == drugList[i].min_unit) {
535
+                drugList[i].unitList[0].name = drugList[i].max_unit;
536
+              }
537
+            }
538
+            this.tabList.push(drugList[i]);
494
           }
539
           }
495
-         
496
-        }
497
-        this.tabList.push(drugList[i])
498
-        }
499
-        this.drugList = drugList
500
-        var goodList =  response.data.data.goodList
501
-        for(let i=0;i<goodList.length;i++){
502
-        for(let j=0;j<this.manufactuerList.length;j++){
503
-            if(goodList[i].manufacturer == this.manufactuerList[j].id){
504
-                goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
540
+          this.drugList = drugList;
541
+          var goodList = response.data.data.goodList;
542
+          for (let i = 0; i < goodList.length; i++) {
543
+            for (let j = 0; j < this.manufactuerList.length; j++) {
544
+              if (goodList[i].manufacturer == this.manufactuerList[j].id) {
545
+                goodList[i].manufacturer =
546
+                  this.manufactuerList[j].manufacturer_name;
547
+              }
505
             }
548
             }
506
-        }
507
-        for(let y=0;y<this.goodTypeList.length;y++){
508
-            if(goodList[i].good_type_id == this.goodTypeList[y].id){
509
-                goodList[i].good_type_id = this.goodTypeList[y].type_name
549
+            for (let y = 0; y < this.goodTypeList.length; y++) {
550
+              if (goodList[i].good_type_id == this.goodTypeList[y].id) {
551
+                goodList[i].good_type_id = this.goodTypeList[y].type_name;
552
+              }
510
             }
553
             }
554
+            goodList[i].supply_name =
555
+              goodList[i].good_name +
556
+              " " +
557
+              goodList[i].specification_name +
558
+              " " +
559
+              goodList[i].manufacturer;
560
+            goodList[i].supply_type = goodList[i].good_type_id;
561
+            goodList[i].supply_specification_name =
562
+              goodList[i].specification_name;
563
+            goodList[i].supply_price = goodList[i].buy_price;
564
+            goodList[i].supply_total = this.getTotalStockCount(
565
+              goodList[i].good_warehouse_info
566
+            );
567
+            goodList[i].supply_count = "";
568
+            goodList[i].supply_total_price = "";
569
+            goodList[i].supply_manufacturer = goodList[i].manufacturer;
570
+            goodList[i].supply_license_number = goodList[i].number;
571
+            goodList[i].supply_remake = "";
572
+            goodList[i].type = 2;
573
+            goodList[i].name = goodList[i].good_name;
574
+            goodList[i].unitList = [{ id: 1, name: "" }];
575
+            goodList[i].supply_unit = goodList[i].packing_unit;
576
+            for (let j = 0; j < goodList[i].unitList.length; j++) {
577
+              goodList[i].unitList[0].name = goodList[i].packing_unit;
578
+            }
579
+            this.tabList.push(goodList[i]);
580
+          }
581
+          this.goodList = goodList;
511
         }
582
         }
512
-        goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
513
-        goodList[i].supply_type = goodList[i].good_type_id
514
-        goodList[i].supply_specification_name =goodList[i].specification_name
515
-        goodList[i].supply_price = goodList[i].buy_price
516
-        goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
517
-        goodList[i].supply_count = ""
518
-        goodList[i].supply_total_price = ""
519
-        goodList[i].supply_manufacturer = goodList[i].manufacturer
520
-        goodList[i].supply_license_number = goodList[i].number
521
-        goodList[i].supply_remake = ""
522
-        goodList[i].type = 2
523
-        goodList[i].name = goodList[i].good_name
524
-        goodList[i].unitList =  [{id:1,name:""}]
525
-        goodList[i].supply_unit = goodList[i].packing_unit
526
-        for(let j=0;j<goodList[i].unitList.length;j++){
527
-           goodList[i].unitList[0].name = goodList[i].packing_unit 
528
-        }
529
-        this.tabList.push(goodList[i])
530
-        }
531
-        this.goodList = goodList
532
-        
533
-    } 
534
-    })
535
-},
583
+      });
584
+    },
536
     changeGoodName(val) {
585
     changeGoodName(val) {
537
       this.currentIndex = val;
586
       this.currentIndex = val;
538
     },
587
     },
638
           var end = this.getTimes(this.end_time);
687
           var end = this.getTimes(this.end_time);
639
           const params = {
688
           const params = {
640
             stockIn: this.recordInfo.tableList,
689
             stockIn: this.recordInfo.tableList,
641
-            return_remake:this.return_remark,
690
+            return_remake: this.return_remark,
642
           };
691
           };
643
 
692
 
644
-         
645
           savePurchaseOrder(
693
           savePurchaseOrder(
646
             params,
694
             params,
647
             this.supplier_name,
695
             this.supplier_name,
655
               this.loading = false;
703
               this.loading = false;
656
               this.$message.success("保存成功!");
704
               this.$message.success("保存成功!");
657
               var warehouseInfo = response.data.data.warehouseInfo;
705
               var warehouseInfo = response.data.data.warehouseInfo;
658
-              this.is_check = warehouseInfo.is_check
659
-              if(warehouseInfo.is_check == 1){
660
-                this.Reviewed = true
661
-               
706
+              this.is_check = warehouseInfo.is_check;
707
+              if (warehouseInfo.is_check == 1) {
708
+                this.Reviewed = true;
662
               }
709
               }
663
               this.number = warehouseInfo.number;
710
               this.number = warehouseInfo.number;
664
               this.id = warehouseInfo.id;
711
               this.id = warehouseInfo.id;
665
               this.recordInfo.tableList = [];
712
               this.recordInfo.tableList = [];
666
-              this.return_remark = warehouseInfo.return_remake
713
+              this.return_remark = warehouseInfo.return_remake;
667
               var orderInfo = response.data.data.orderInfo;
714
               var orderInfo = response.data.data.orderInfo;
668
               for (let i = 0; i < orderInfo.length; i++) {
715
               for (let i = 0; i < orderInfo.length; i++) {
669
                 if (orderInfo[i].is_source == 1) {
716
                 if (orderInfo[i].is_source == 1) {
694
                 orderInfo[i].project_id = orderInfo[i].project_id;
741
                 orderInfo[i].project_id = orderInfo[i].project_id;
695
                 orderInfo[i].supply_unit = orderInfo[i].supply_unit;
742
                 orderInfo[i].supply_unit = orderInfo[i].supply_unit;
696
               }
743
               }
697
-            
744
+
698
               this.recordInfo.tableList = orderInfo;
745
               this.recordInfo.tableList = orderInfo;
699
-              for(let i=0;i<orderInfo.length;i++){
700
-                 orderInfo[i].name = ""
701
-                 orderInfo[i].supply_name = ""
702
-                 orderInfo[i].supply_specification_name = ""
703
-                if(orderInfo[i].is_source == 1){
704
-                  for(let j=0;j<this.drugList.length;j++){
705
-                     if(orderInfo[i].project_id == this.drugList[j].id){
706
-                        orderInfo[i].name = this.drugList[j].drug_name
707
-                     }
746
+              for (let i = 0; i < orderInfo.length; i++) {
747
+                orderInfo[i].name = "";
748
+                orderInfo[i].supply_name = "";
749
+                orderInfo[i].supply_specification_name = "";
750
+                if (orderInfo[i].is_source == 1) {
751
+                  for (let j = 0; j < this.drugList.length; j++) {
752
+                    if (orderInfo[i].project_id == this.drugList[j].id) {
753
+                      orderInfo[i].name = this.drugList[j].drug_name;
754
+                    }
708
                   }
755
                   }
709
                 }
756
                 }
710
-                if(orderInfo[i].is_source == 2){
711
-                  for(let y=0;y<this.goodList.length;y++){
712
-                     if(orderInfo[i].project_id = this.goodList[y].id){
713
-                        orderInfo[i].name = this.goodList[y].good_name
714
-                     }
757
+                if (orderInfo[i].is_source == 2) {
758
+                  for (let y = 0; y < this.goodList.length; y++) {
759
+                    if ((orderInfo[i].project_id = this.goodList[y].id)) {
760
+                      orderInfo[i].name = this.goodList[y].good_name;
761
+                    }
715
                   }
762
                   }
716
                 }
763
                 }
717
               }
764
               }
718
               this.showTwo = false;
765
               this.showTwo = false;
719
               this.showOne = true;
766
               this.showOne = true;
767
+              this.showThree = true
720
             }
768
             }
721
           });
769
           });
722
         }
770
         }
728
       var min_str = "";
776
       var min_str = "";
729
       if (arr.length > 0) {
777
       if (arr.length > 0) {
730
         for (let i = 0; i < arr.length; i++) {
778
         for (let i = 0; i < arr.length; i++) {
731
-          total += parseInt(arr[i].stock_max_number+arr[i].stock_min_number);
779
+          total += parseInt(arr[i].stock_max_number + arr[i].stock_min_number);
732
         }
780
         }
733
       }
781
       }
734
       if (total < min_number) {
782
       if (total < min_number) {
807
           var end = this.getTimes(this.end_time);
855
           var end = this.getTimes(this.end_time);
808
           const params = {
856
           const params = {
809
             stockIn: this.recordInfo.tableList,
857
             stockIn: this.recordInfo.tableList,
810
-            return_remake:this.return_remark,
858
+            return_remake: this.return_remark,
811
           };
859
           };
812
-         
813
 
860
 
814
           updatePurchaseOrder(
861
           updatePurchaseOrder(
815
             params,
862
             params,
838
           this.recordInfo.tableList[i].supply_count;
885
           this.recordInfo.tableList[i].supply_count;
839
       }
886
       }
840
       this.total_price = total_price;
887
       this.total_price = total_price;
888
+      this.discount_amount = (this.total_price * this.rate_of_concession * 0.01).toFixed(2);
841
       return total_price.toFixed(2);
889
       return total_price.toFixed(2);
842
     },
890
     },
843
-     count_discount() {
891
+    count_discount() {
844
       this.rate_of_concession = (
892
       this.rate_of_concession = (
845
         this.discount_amount /
893
         this.discount_amount /
846
         (this.total_price * 0.01)
894
         (this.total_price * 0.01)
857
             if (response.data.state == 1) {
905
             if (response.data.state == 1) {
858
               var info = response.data.data.info;
906
               var info = response.data.data.info;
859
               this.is_check = info.is_check
907
               this.is_check = info.is_check
908
+              this.showOne = false
909
+              this.showTwo = false
910
+              this.showThree = true
860
               this.disabled = true;
911
               this.disabled = true;
861
               this.$message.success("审核成功!");
912
               this.$message.success("审核成功!");
862
-              this.Reviewed = true
913
+              this.Reviewed = true;
863
             }
914
             }
864
           });
915
           });
865
         })
916
         })
888
         if (response.data.state == 1) {
939
         if (response.data.state == 1) {
889
           var msg = response.data.data.msg;
940
           var msg = response.data.data.msg;
890
           this.disabled = false;
941
           this.disabled = false;
891
-          this.showOne = true
892
-          this.is_check =2 
942
+          this.showOne = true;
943
+          this.is_check = 2;
893
           this.$message.success("反审核成功!");
944
           this.$message.success("反审核成功!");
894
         }
945
         }
895
       });
946
       });
896
     },
947
     },
948
+     toAdd() {
949
+      if (this.is_check == 2) {
950
+        this.$message.error("该采购订单未审核,不能生成采购数据!");
951
+        return false;
952
+      }
953
+      //获取商品购货订单 和 购货单的总数量
954
+      getAllOrderCountList(this.id).then((response) => {
955
+        if (response.data.state == 1) {
956
+          var purcaseOrder = response.data.data.purcaseOrder;
957
+
958
+          var goodOrder = response.data.data.goodOrder;
959
+         
960
+          var drugList = response.data.data.drugList;
961
+      
962
+          var ids = "";
963
+          // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
964
+          if (goodOrder.length == 0) {
965
+            this.$router.push({path: "/good/order/add?id=" + this.id + "&ids=" + ids});
966
+          }
967
+          for (let i = 0; i < purcaseOrder.length; i++) {
968
+            for (let j = 0; j < drugList.length; j++) {
969
+              if (purcaseOrder[i].is_source == 1) {
970
+                if (purcaseOrder[i].supply_unit == drugList[j].max_unit) {
971
+                  purcaseOrder[i].count = purcaseOrder[i].count * drugList[j].min_number;
972
+                }
973
+              }
974
+            }
975
+          }
976
+
977
+          for (let i = 0; i < goodOrder.length; i++) {
978
+            for (let j = 0; j < drugList.length; j++) {
979
+              if (goodOrder[i].is_source == 1) {
980
+                if (goodOrder[i].supply_unit == drugList[j].max_unit) {
981
+                    goodOrder[i].count = goodOrder[i].count * drugList[j].min_number;
982
+                }
983
+              }
984
+            }
985
+          }
986
+
987
+          let objInfo = {};
988
+          if (goodOrder.length > 0) {
989
+            goodOrder.forEach((item, index) => {
990
+              let { project_id } = item;
991
+              if (!objInfo[project_id]) {
992
+                objInfo[project_id] = {
993
+                  project_id,
994
+                  child: [],
995
+                  count: 0,
996
+                };
997
+              }
998
+            });
999
+            let newArr = Object.values(objInfo);
1000
+
1001
+            for (let i = 0; i < goodOrder.length; i++) {
1002
+              for (let j = 0; j < newArr.length; j++) {
1003
+                if (goodOrder[i].project_id == newArr[j].project_id) {
1004
+                  newArr[j].child.push(goodOrder[i]);
1005
+                }
1006
+              }
1007
+            }
1008
+     
1009
+
1010
+            for (let i = 0; i < newArr.length; i++) {
1011
+              for (let j = 0; j < newArr[i].child.length; j++) {
1012
+                newArr[i].count += newArr[i].child[j].count;
1013
+              }
1014
+            }
1015
+
1016
+            var arr = [];
1017
+            var total = 0;
1018
+            var str = "";
1019
+
1020
+            //如果采购单有数据,则需要比较数量
1021
+            if (newArr.length > 0) {
1022
+              for (let i = 0; i < purcaseOrder.length; i++) {
1023
+                for (let j = 0; j < newArr.length; j++) {
1024
+                  if (purcaseOrder[i].project_id == newArr[j].project_id) {
1025
+                    //根据商品ID比较数量大小,把数量不足的商品ID储存,表示采购单的数量未满足采购订单的数据,可以继续生成采购单
1026
+                    if (purcaseOrder[i].count > newArr[j].count) {
1027
+                      arr.push(purcaseOrder[i].project_id);
1028
+                    }
1029
+                  }
1030
+                }
1031
+              }
1032
+              //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
1033
+
1034
+              if (arr.length == 0) {
1035
+                this.$message.error("该订单已全部生成采购单,请知悉!");
1036
+                return;
1037
+              }
1038
+
1039
+              if (arr.length >0) {
1040
+                str = arr.join(",");
1041
+                this.$router.push({path: "/good/order/add?id=" + this.id + "&ids=" + str});
1042
+              }
1043
+            }
1044
+          }
1045
+        }
1046
+      });
1047
+    },
897
   },
1048
   },
898
 
1049
 
899
   created() {
1050
   created() {
945
   margin-top: 15px;
1096
   margin-top: 15px;
946
   margin-bottom: 15px;
1097
   margin-bottom: 15px;
947
 }
1098
 }
948
-.reviewImg{
1099
+.reviewImg {
949
   position: fixed;
1100
   position: fixed;
950
   left: 50%;
1101
   left: 50%;
951
   transform: translateX(-50%);
1102
   transform: translateX(-50%);
953
 }
1104
 }
954
 
1105
 
955
 /deep/ .el-table__body-wrapper::-webkit-scrollbar {
1106
 /deep/ .el-table__body-wrapper::-webkit-scrollbar {
956
-width:10px;
957
-height:10px;
1107
+  width: 10px;
1108
+  height: 10px;
958
 }
1109
 }
959
 </style>
1110
 </style>
960
 
1111
 

+ 7 - 4
src/xt_pages/supply/components/addSupply.vue 파일 보기

92
           <!-- 联系人填写 -->
92
           <!-- 联系人填写 -->
93
           <el-table-column label="联系人" align="center" width="130">
93
           <el-table-column label="联系人" align="center" width="130">
94
             <template slot="header" slot-scope="scope">
94
             <template slot="header" slot-scope="scope">
95
-              <span>联系人<span style="color: red">*</span></span>
95
+              <span>联系人</span>
96
             </template>
96
             </template>
97
             <!-- tableRules.name -->
97
             <!-- tableRules.name -->
98
             <template slot-scope="scope">
98
             <template slot-scope="scope">
99
               <el-form-item
99
               <el-form-item
100
                 :prop="'contacts.' + scope.$index + '.name'"
100
                 :prop="'contacts.' + scope.$index + '.name'"
101
                 :rules="
101
                 :rules="
102
-                  scope.row.name != ''
102
+                  scope.row.name == ''
103
                     ? [
103
                     ? [
104
                         {
104
                         {
105
                           required: 'true',
105
                           required: 'true',
318
         this.title = "编辑供应商";
318
         this.title = "编辑供应商";
319
         this.supplier.supplierCode = data.SupplierCode;
319
         this.supplier.supplierCode = data.SupplierCode;
320
         this.supplier.supplierName = data.SupplierName;
320
         this.supplier.supplierName = data.SupplierName;
321
-        this.supplier.supplierType = data.SupplierType;
322
-
321
+        if (data.SupplierType == 0){
322
+          this.supplier.supplierType = ""
323
+        }else {
324
+          this.supplier.supplierType = data.SupplierType;
325
+        }
323
         this.supplier.vatRate = data.VatRate;
326
         this.supplier.vatRate = data.VatRate;
324
         this.supplier.number = data.Number;
327
         this.supplier.number = data.Number;
325
         this.supplier.bank = data.Bank;
328
         this.supplier.bank = data.Bank;

+ 287 - 160
src/xt_pages/supply/components/editGoodOrder.vue 파일 보기

12
           align-items: center;
12
           align-items: center;
13
         "
13
         "
14
       >
14
       >
15
-        <div style="display: flex;">
16
-          <span style="color: red">*</span><span>供应商:</span>
15
+        <div style="display: flex; align-items: center">
16
+          <div><span style="color: red">*</span><span>供应商:</span></div>
17
+          <!-- <div>供应商:</div> -->
17
           <el-select
18
           <el-select
18
             v-model="supplier_name"
19
             v-model="supplier_name"
19
             style="width: 140px; margin-right: 10px"
20
             style="width: 140px; margin-right: 10px"
42
             value-format="yyyy-MM-dd"
43
             value-format="yyyy-MM-dd"
43
             :disabled="disabled"
44
             :disabled="disabled"
44
           ></el-date-picker>
45
           ></el-date-picker>
45
-    
46
+
46
           <span>单据编码:{{ good_number }}</span>
47
           <span>单据编码:{{ good_number }}</span>
47
         </div>
48
         </div>
48
       
49
       
49
-          <el-button size="small" type="primary" @click="updateGoodOrder">保存</el-button>
50
-        <div style="display: flex;" >
51
-          <el-button size="small" type="primary" @click="updateGoodOrder"
52
-            >保存</el-button
53
-          >
50
+         <div style="display: flex;" >
51
+           <el-button size="small" type="primary" @click="updateGoodOrder">保存</el-button>
54
           <el-button
52
           <el-button
55
             size="small"
53
             size="small"
56
             type="primary"
54
             type="primary"
239
             </template>
237
             </template>
240
           </el-table-column>
238
           </el-table-column>
241
 
239
 
240
+          <el-table-column label="拆零零售价" align="center" width="180px">
241
+            <template slot-scope="scope">
242
+              <el-input
243
+                v-model="scope.row.min_price"
244
+                style="width: 140px"
245
+                :disabled="disabled"
246
+                placeholder="请输入拆零零售价"
247
+              ></el-input>
248
+              <div style="visibility: hidden">/</div>
249
+            </template>
250
+          </el-table-column>
251
+
242
           <el-table-column label="采购单价" align="center" width="180px">
252
           <el-table-column label="采购单价" align="center" width="180px">
243
             <template slot-scope="scope">
253
             <template slot-scope="scope">
244
               <el-input
254
               <el-input
251
             </template>
261
             </template>
252
           </el-table-column>
262
           </el-table-column>
253
 
263
 
264
+      
265
+
254
           <el-table-column label="采购金额" align="center" width="120px">
266
           <el-table-column label="采购金额" align="center" width="120px">
255
             <template slot-scope="scope">
267
             <template slot-scope="scope">
256
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
268
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
265
               <el-form-item
277
               <el-form-item
266
                 :prop="'tableList.' + scope.$index + '.supply_product_date'"
278
                 :prop="'tableList.' + scope.$index + '.supply_product_date'"
267
                 :rules="tableRules.supply_product_date"
279
                 :rules="tableRules.supply_product_date"
268
-
269
               >
280
               >
270
                 <el-date-picker
281
                 <el-date-picker
271
                   prefix-icon="el-icon-date"
282
                   prefix-icon="el-icon-date"
379
             :rows="2"
390
             :rows="2"
380
             placeholder="备注信息"
391
             placeholder="备注信息"
381
             v-model="return_remark"
392
             v-model="return_remark"
382
-           :disabled="disabled"
393
+            :disabled="disabled"
383
           >
394
           >
384
           </el-input>
395
           </el-input>
385
         </div>
396
         </div>
435
         ></span>
446
         ></span>
436
       </div>
447
       </div>
437
     </div>
448
     </div>
438
-    <popup ref="Popup" :content="content" :content_1="content_1" :content_2="content_2" :number="number" :orderList ="orderList" :type="type"></popup>
449
+    <popup
450
+      ref="Popup"
451
+      :content="content"
452
+      :content_1="content_1"
453
+      :content_2="content_2"
454
+      :number="number"
455
+      :orderList="orderList"
456
+      :type="type"
457
+    ></popup>
439
   </div>
458
   </div>
440
 </template>
459
 </template>
441
 
460
 
442
 <script>
461
 <script>
443
-import popup from "./Popup"
462
+import popup from "./Popup";
444
 import Computed from "../../components/Computed/index_1.vue";
463
 import Computed from "../../components/Computed/index_1.vue";
445
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
464
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
446
 import { uParseTime } from "@/utils/tools";
465
 import { uParseTime } from "@/utils/tools";
454
   MofyGoodOrder,
473
   MofyGoodOrder,
455
   UpdateSupplyWahouseingInfo,
474
   UpdateSupplyWahouseingInfo,
456
   getSupplyWarehouseOutById,
475
   getSupplyWarehouseOutById,
457
-  deleteGoodOrderById
476
+  deleteGoodOrderById,
458
 } from "@/api/supply";
477
 } from "@/api/supply";
459
 
478
 
460
 export default {
479
 export default {
470
         { path: false, name: "采购单" },
489
         { path: false, name: "采购单" },
471
         { path: "/supply/good/order/query", name: "编辑采购单" },
490
         { path: "/supply/good/order/query", name: "编辑采购单" },
472
       ],
491
       ],
473
-      content_2:"退库单",
474
-      content:"采购单",
475
-      content_1:"已有以下关联数据,不能反审核",
476
-      type:2,
477
-      orderList:[],
492
+      content_2: "退库单",
493
+      content: "采购单",
494
+      content_1: "已有以下关联数据,不能反审核",
495
+      type: 2,
496
+      orderList: [],
478
       showOne: true,
497
       showOne: true,
479
       showTwo: false,
498
       showTwo: false,
480
       showThree: false,
499
       showThree: false,
481
-      recordInfo: {
482
-        tableList: [],
483
-      },
500
+      recordInfo: {tableList: []},
484
       keywords: "",
501
       keywords: "",
485
       total: 0,
502
       total: 0,
486
       multipleSelection: [],
503
       multipleSelection: [],
490
       page: 1,
507
       page: 1,
491
       limit: 10,
508
       limit: 10,
492
       goodType: [],
509
       goodType: [],
493
-       Reviewed: false,
510
+      Reviewed: false,
494
       goodInfo: [],
511
       goodInfo: [],
495
       org_id: 0,
512
       org_id: 0,
496
       types: [],
513
       types: [],
539
       orderInfo: [],
556
       orderInfo: [],
540
       warese_out_id: 0,
557
       warese_out_id: 0,
541
       return_remark: "",
558
       return_remark: "",
542
-      tableDataList:[],
559
+      tableDataList: [],
543
     };
560
     };
544
   },
561
   },
545
 
562
 
546
-  watch(){
547
-      // total_price:function(newval,oldval){
548
-      //   console.log(newval,'op')
549
-      // }
550
-
563
+  watch() {
564
+    // total_price:function(newval,oldval){
565
+    //   console.log(newval,'op')
566
+    // }
551
   },
567
   },
552
 
568
 
553
   methods: {
569
   methods: {
581
                 drugList[i].drug_type = this.drugTypeList[y].name;
597
                 drugList[i].drug_type = this.drugTypeList[y].name;
582
               }
598
               }
583
             }
599
             }
584
-            drugList[i].supply_name =drugList[i].drug_name +" " +drugList[i].dose +drugList[i].dose_unit +"*" +drugList[i].min_number +drugList[i].min_unit +"/" +drugList[i].max_unit +" " +drugList[i].manufacturer;
600
+            drugList[i].supply_name =
601
+              drugList[i].drug_name +
602
+              " " +
603
+              drugList[i].dose +
604
+              drugList[i].dose_unit +
605
+              "*" +
606
+              drugList[i].min_number +
607
+              drugList[i].min_unit +
608
+              "/" +
609
+              drugList[i].max_unit +
610
+              " " +
611
+              drugList[i].manufacturer;
585
             drugList[i].supply_type = drugList[i].drug_type;
612
             drugList[i].supply_type = drugList[i].drug_type;
586
-            drugList[i].supply_specification_name =drugList[i].dose + drugList[i].dose_unit +"*" +drugList[i].min_number +drugList[i].min_unit +"/" +drugList[i].max_unit;
587
-            drugList[i].supply_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number);
613
+            drugList[i].supply_specification_name =
614
+              drugList[i].dose +
615
+              drugList[i].dose_unit +
616
+              "*" +
617
+              drugList[i].min_number +
618
+              drugList[i].min_unit +
619
+              "/" +
620
+              drugList[i].max_unit;
621
+            drugList[i].supply_total = this.getWarehoseInfo(
622
+              drugList[i].drug_warehouse_info,
623
+              drugList[i].max_unit,
624
+              drugList[i].min_unit,
625
+              drugList[i].min_number
626
+            );
588
             drugList[i].supply_count = "";
627
             drugList[i].supply_count = "";
589
             drugList[i].supply_total_price = "";
628
             drugList[i].supply_total_price = "";
590
             drugList[i].supply_manufacturer = drugList[i].manufacturer;
629
             drugList[i].supply_manufacturer = drugList[i].manufacturer;
593
             drugList[i].type = 1;
632
             drugList[i].type = 1;
594
             drugList[i].supply_price = drugList[i].last_price;
633
             drugList[i].supply_price = drugList[i].last_price;
595
             drugList[i].name = drugList[i].drug_name;
634
             drugList[i].name = drugList[i].drug_name;
635
+            drugList[i].min_price = drugList[i].min_price
596
             if (drugList[i].max_unit != drugList[i].min_unit) {
636
             if (drugList[i].max_unit != drugList[i].min_unit) {
597
               drugList[i].unitList = [
637
               drugList[i].unitList = [
598
                 { id: 1, name: "" },
638
                 { id: 1, name: "" },
631
                 goodList[i].good_type_id = this.goodTypeList[y].type_name;
671
                 goodList[i].good_type_id = this.goodTypeList[y].type_name;
632
               }
672
               }
633
             }
673
             }
634
-            goodList[i].supply_name =goodList[i].good_name +" " +goodList[i].specification_name +" " +goodList[i].manufacturer;
674
+            goodList[i].supply_name =
675
+              goodList[i].good_name +
676
+              " " +
677
+              goodList[i].specification_name +
678
+              " " +
679
+              goodList[i].manufacturer;
635
             goodList[i].supply_type = goodList[i].good_type_id;
680
             goodList[i].supply_type = goodList[i].good_type_id;
636
-            goodList[i].supply_specification_name =goodList[i].specification_name;
681
+            goodList[i].supply_specification_name =
682
+              goodList[i].specification_name;
637
             goodList[i].supply_price = goodList[i].buy_price;
683
             goodList[i].supply_price = goodList[i].buy_price;
638
-            goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info);
684
+            goodList[i].supply_total = this.getTotalStockCount(
685
+              goodList[i].good_warehouse_info
686
+            );
639
             goodList[i].supply_count = "";
687
             goodList[i].supply_count = "";
640
             goodList[i].supply_total_price = "";
688
             goodList[i].supply_total_price = "";
641
             goodList[i].supply_manufacturer = goodList[i].manufacturer;
689
             goodList[i].supply_manufacturer = goodList[i].manufacturer;
647
             goodList[i].supply_unit = goodList[i].packing_unit;
695
             goodList[i].supply_unit = goodList[i].packing_unit;
648
             goodList[i].warehouse_info_id = 0;
696
             goodList[i].warehouse_info_id = 0;
649
             goodList[i].warehousing_id = 0;
697
             goodList[i].warehousing_id = 0;
698
+            goodList[i].min_price = goodList[i].retail_price
650
             for (let j = 0; j < goodList[i].unitList.length; j++) {
699
             for (let j = 0; j < goodList[i].unitList.length; j++) {
651
               goodList[i].unitList[0].name = goodList[i].packing_unit;
700
               goodList[i].unitList[0].name = goodList[i].packing_unit;
652
             }
701
             }
667
           this.recordInfo.tableList[i].name = val.name;
716
           this.recordInfo.tableList[i].name = val.name;
668
           this.recordInfo.tableList[i].supply_name = val.supply_name;
717
           this.recordInfo.tableList[i].supply_name = val.supply_name;
669
           this.recordInfo.tableList[i].supply_type = val.supply_type;
718
           this.recordInfo.tableList[i].supply_type = val.supply_type;
670
-          this.recordInfo.tableList[i].supply_specification_name =
671
-            val.supply_specification_name;
719
+          this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name;
672
           this.recordInfo.tableList[i].supply_total = val.supply_total;
720
           this.recordInfo.tableList[i].supply_total = val.supply_total;
673
-
721
+          this.recordInfo.tableList[i].min_price = val.min_price  
674
           if (val.supply_count == NaN) {
722
           if (val.supply_count == NaN) {
675
             this.recordInfo.tableList[i].supply_count = "";
723
             this.recordInfo.tableList[i].supply_count = "";
676
           } else {
724
           } else {
700
       }
748
       }
701
     },
749
     },
702
     handleEdit() {
750
     handleEdit() {
751
+      if (this.is_check == 1) {
752
+        this.$message.error("已审核的不能新增!");
753
+        return false;
754
+      }
703
       const tempObj = {};
755
       const tempObj = {};
704
       tempObj["id"] = 0;
756
       tempObj["id"] = 0;
705
       tempObj["name"] = "";
757
       tempObj["name"] = "";
726
       tempObj["warehousing_id"] = "";
778
       tempObj["warehousing_id"] = "";
727
       tempObj["number"] = "";
779
       tempObj["number"] = "";
728
       tempObj["good_number"] = "";
780
       tempObj["good_number"] = "";
781
+      tempObj["min_price"] = ""
729
       this.recordInfo.tableList.push(tempObj);
782
       this.recordInfo.tableList.push(tempObj);
730
     },
783
     },
731
     handleDelete: function (index, row) {
784
     handleDelete: function (index, row) {
732
-      if(this.is_check == 1){
733
-        this.$message.error("已审核单据,不能删除!")
734
-        return false
785
+      if (this.is_check == 1) {
786
+        this.$message.error("已审核单据,不能删除!");
787
+        return false;
735
       }
788
       }
736
-      if(row.id == 0){
789
+      if (row.id == 0) {
737
         if (this.recordInfo.tableList.length <= 1) {
790
         if (this.recordInfo.tableList.length <= 1) {
738
-        this.$message.error("只有一条记录的时候无法删除");
739
-        return;
791
+          this.$message.error("只有一条记录的时候无法删除");
792
+          return;
793
+        } else {
794
+          this.recordInfo.tableList.splice(index, 1);
795
+        }
740
       } else {
796
       } else {
741
-        this.recordInfo.tableList.splice(index, 1);
742
-       }
743
-      }else{
744
-         const params = {
745
-            id: row.id
746
-          }
747
-          this.$confirm('确认删除吗?', {
748
-            confirmButtonText: '确定',
749
-            cancelButtonText: '取消',
750
-            type: 'warning'
751
-          }).then(() => {
752
-            deleteGoodOrderById(params).then(response => {
797
+        const params = {
798
+          id: row.id,
799
+        };
800
+        this.$confirm("确认删除吗?", {
801
+          confirmButtonText: "确定",
802
+          cancelButtonText: "取消",
803
+          type: "warning",
804
+        })
805
+          .then(() => {
806
+            deleteGoodOrderById(params).then((response) => {
753
               if (response.data.state == 0) {
807
               if (response.data.state == 0) {
754
-                this.$message.error(response.data.msg)
755
-                return false
808
+                this.$message.error(response.data.msg);
809
+                return false;
756
               } else {
810
               } else {
757
-                this.$message.success('删除成功')
811
+                this.$message.success("删除成功");
758
 
812
 
759
-                this.recordInfo.tableList.splice(index, 1)
813
+                this.recordInfo.tableList.splice(index, 1);
760
               }
814
               }
761
-            })
762
-          }).catch(() => {
763
-        })
815
+            });
816
+          })
817
+          .catch(() => {});
764
       }
818
       }
765
     },
819
     },
766
 
820
 
821
           this.recordInfo.tableList[i].supply_count;
875
           this.recordInfo.tableList[i].supply_count;
822
       }
876
       }
823
       this.total_price = total_price;
877
       this.total_price = total_price;
824
-      this.addressChange()
878
+      this.addressChange();
825
       return total_price.toFixed(2);
879
       return total_price.toFixed(2);
826
     },
880
     },
827
-       addressChange() {
881
+    addressChange() {
828
       var discount_amount = 0;
882
       var discount_amount = 0;
829
       if (this.rate_of_concession > 0) {
883
       if (this.rate_of_concession > 0) {
830
         discount_amount = (
884
         discount_amount = (
841
       ).toFixed(2);
895
       ).toFixed(2);
842
     },
896
     },
843
     count_payment() {
897
     count_payment() {
844
-      this.arrearage = this.total_price - this.payment;
898
+      let arrearage_1 = (
899
+        this.total_price -
900
+        this.discount_amount -
901
+        this.payment
902
+      ).toFixed(2);
903
+      if (arrearage_1 > 0) {
904
+        this.arrearage = arrearage_1;
905
+      } else {
906
+        this.arrearage = 0;
907
+      }
845
     },
908
     },
846
 
909
 
847
     count_arrearage() {
910
     count_arrearage() {
848
-      this.payment = this.total_price - this.arrearage;
911
+      this.payment = (this.total_price - this.arrearage).toFixed(2);
849
     },
912
     },
850
     checkPurchaseOrder(id, index) {
913
     checkPurchaseOrder(id, index) {
851
       this.$confirm("是否审核?", {
914
       this.$confirm("是否审核?", {
852
         confirmButtonText: "确 定",
915
         confirmButtonText: "确 定",
853
         cancelButtonText: "取 消",
916
         cancelButtonText: "取 消",
854
         type: "warning",
917
         type: "warning",
855
-      }).then(() => {
918
+      })
919
+        .then(() => {
856
           checkPurchaseOrder(this.id).then((response) => {
920
           checkPurchaseOrder(this.id).then((response) => {
857
             if (response.data.state == 1) {
921
             if (response.data.state == 1) {
858
               var info = response.data.data.info;
922
               var info = response.data.data.info;
859
               this.disabled = true;
923
               this.disabled = true;
860
               this.$message.success("审核成功!");
924
               this.$message.success("审核成功!");
861
-              this.getPurchaseOrderDetail();
925
+              // this.getPurchaseOrderDetail();
862
             }
926
             }
863
           });
927
           });
864
         })
928
         })
874
             this.showOne = false;
938
             this.showOne = false;
875
             this.showTwo = true;
939
             this.showTwo = true;
876
             this.showThree = true;
940
             this.showThree = true;
877
-            this.disabled = true
941
+            this.disabled = true;
878
             this.Reviewed = true;
942
             this.Reviewed = true;
879
           }
943
           }
880
 
944
 
893
           var drugList = response.data.data.drugList;
957
           var drugList = response.data.data.drugList;
894
           var goodList = response.data.data.goodList;
958
           var goodList = response.data.data.goodList;
895
           for (let i = 0; i < orderInfo.length; i++) {
959
           for (let i = 0; i < orderInfo.length; i++) {
960
+            orderInfo[i].id = orderInfo[i].id
896
             orderInfo[i].supply_count = orderInfo[i].count;
961
             orderInfo[i].supply_count = orderInfo[i].count;
897
             orderInfo[i].supply_price = orderInfo[i].price;
962
             orderInfo[i].supply_price = orderInfo[i].price;
898
             orderInfo[i].supply_remake = orderInfo[i].remark;
963
             orderInfo[i].supply_remake = orderInfo[i].remark;
900
             orderInfo[i].project_id = orderInfo[i].project_id;
965
             orderInfo[i].project_id = orderInfo[i].project_id;
901
             orderInfo[i].supply_unit = orderInfo[i].supply_unit;
966
             orderInfo[i].supply_unit = orderInfo[i].supply_unit;
902
             orderInfo[i].order_number = orderInfo[i].order_number;
967
             orderInfo[i].order_number = orderInfo[i].order_number;
903
-            orderInfo[i].supply_total_price = (
904
-              orderInfo[i].count * orderInfo[i].price
905
-            ).toFixed(2);
968
+            orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2);
906
             orderInfo[i].supply_expiry_date = this.getTimes(
969
             orderInfo[i].supply_expiry_date = this.getTimes(
907
               orderInfo[i].supply_expiry_date
970
               orderInfo[i].supply_expiry_date
908
             );
971
             );
936
               }
999
               }
937
             }
1000
             }
938
           }
1001
           }
1002
+          if(orderInfo.length == 0){
1003
+            const tempObj = {};
1004
+            tempObj["id"] = 0;
1005
+            tempObj["name"] = "";
1006
+            tempObj["supply_name"] = "";
1007
+            tempObj["supply_type"] = "";
1008
+            tempObj["supply_specification_name"] = "";
1009
+            tempObj["supply_total"] = "";
1010
+            tempObj["supply_count"] = "";
1011
+            tempObj["supply_price"] = "";
1012
+            tempObj["supply_total_price"] = "";
1013
+            tempObj["supply_manufacturer"] = "";
1014
+            tempObj["supply_license_number"] = "";
1015
+            tempObj["supply_remake"] = "";
1016
+            tempObj["type"] = 0;
1017
+            tempObj["is_total"] = 1;
1018
+            tempObj["project_id"] = 0;
1019
+            tempObj["supply_unit"] = "";
1020
+            tempObj["supply_batch_number"] = "";
1021
+            tempObj["supply_product_date"] = "";
1022
+            tempObj["order_number"] = "";
1023
+            tempObj["supply_expiry_date"] = "";
1024
+            tempObj["manufacturer_id"] = "";
1025
+            tempObj["warehouse_info_id"] = "";
1026
+            tempObj["warehousing_id"] = "";
1027
+            tempObj["number"] = "";
1028
+            tempObj["good_number"] = "";
1029
+            tempObj["min_price"] = ""
1030
+            this.recordInfo.tableList = [];
1031
+            this.recordInfo.tableList.push(tempObj);
1032
+          }else{
1033
+            this.recordInfo.tableList = [];
1034
+            this.recordInfo.tableList = orderInfo;
1035
+            this.tableDataList = []
939
 
1036
 
940
           this.recordInfo.tableList = [];
1037
           this.recordInfo.tableList = [];
941
           this.recordInfo.tableList = orderInfo;
1038
           this.recordInfo.tableList = orderInfo;
942
-          this.tableDataList = []
943
-          this.tableDataList = orderInfo
944
-
945
-        }
1039
+          this.tableDataList = [];
1040
+          this.tableDataList = orderInfo;
1041
+        }}
946
       });
1042
       });
947
     },
1043
     },
948
     toPrint() {
1044
     toPrint() {
959
         this.recordInfo.tableList[i].supply_count = parseInt(
1055
         this.recordInfo.tableList[i].supply_count = parseInt(
960
           this.recordInfo.tableList[i].supply_count
1056
           this.recordInfo.tableList[i].supply_count
961
         );
1057
         );
962
-        this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString();
963
-        this.recordInfo.tableList[i].supply_total_price =  this.recordInfo.tableList[i].supply_total_price.toString();
964
-        this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString();
1058
+        this.recordInfo.tableList[i].supply_price =
1059
+          this.recordInfo.tableList[i].supply_price.toString();
1060
+        this.recordInfo.tableList[i].supply_total_price =
1061
+          this.recordInfo.tableList[i].supply_total_price.toString();
1062
+        this.recordInfo.tableList[i].supply_total =
1063
+          this.recordInfo.tableList[i].supply_total.toString();
965
 
1064
 
966
         for (let j = 0; j < this.manufactuerList.length; j++) {
1065
         for (let j = 0; j < this.manufactuerList.length; j++) {
967
-          if ( this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name) {
968
-            this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id;
1066
+          if (
1067
+            this.recordInfo.tableList[i].supply_manufacturer ==
1068
+            this.manufactuerList[j].manufacturer_name
1069
+          ) {
1070
+            this.recordInfo.tableList[i].manufacturer_id =
1071
+              this.manufactuerList[j].id;
969
           }
1072
           }
970
-          if ( this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].id) {
971
-            this.recordInfo.tableList[i].supply_manufacturer =this.manufactuerList[j].manufacturer_name;
1073
+          if (
1074
+            this.recordInfo.tableList[i].supply_manufacturer ==
1075
+            this.manufactuerList[j].id
1076
+          ) {
1077
+            this.recordInfo.tableList[i].supply_manufacturer =
1078
+              this.manufactuerList[j].manufacturer_name;
972
           }
1079
           }
973
         }
1080
         }
974
       }
1081
       }
980
           var params = {
1087
           var params = {
981
             stockIn: this.recordInfo.tableList,
1088
             stockIn: this.recordInfo.tableList,
982
             return_remake: this.return_remark,
1089
             return_remake: this.return_remark,
983
-          }
1090
+          };
984
           //判断是否在采购订单数据中做了删除,如果长度相等则代表没有删除,如果不等则代表做了删除或者新增
1091
           //判断是否在采购订单数据中做了删除,如果长度相等则代表没有删除,如果不等则代表做了删除或者新增
985
 
1092
 
986
-          if(this.tableDataList.length != this.recordInfo.tableList){
987
-             warehousing_id = 0
1093
+          if(this.tableDataList.length != this.recordInfo.tableList.length){
1094
+            
988
              for(let i=0;i<this.recordInfo.tableList.length;i++){
1095
              for(let i=0;i<this.recordInfo.tableList.length;i++){
989
-              this.recordInfo.tableList[i].id = 0
990
-              this.recordInfo.tableDataList[i].order_number = ""
1096
+              this.recordInfo.tableList[i].warehousing_id = 0
1097
+              this.recordInfo.tableList[i].warehouse_info_id = 0
1098
+              this.recordInfo.tableList[i].order_number = ""
991
               this.number = ""
1099
               this.number = ""
992
              }
1100
              }
993
           }
1101
           }
994
           console.log("param23322332323",params)
1102
           console.log("param23322332323",params)
995
-          return
1103
+         
996
           updateGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehose_out_id,this.number,this.rate_of_concession,this.discount_amount,this.good_number).then((response) => {
1104
           updateGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehose_out_id,this.number,this.rate_of_concession,this.discount_amount,this.good_number).then((response) => {
997
             if (response.data.state == 1) {
1105
             if (response.data.state == 1) {
998
               this.loading = false;
1106
               this.loading = false;
1005
     checkGoodOrder() {
1113
     checkGoodOrder() {
1006
       var id = this.$route.query.id;
1114
       var id = this.$route.query.id;
1007
       var warehousing_id = this.$route.query.warehousing_id;
1115
       var warehousing_id = this.$route.query.warehousing_id;
1116
+      console.log("采购单ID",id)
1117
+      console.log("采购订单ID",warehousing_id)
1008
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1118
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1009
         if (response.data.state == 1) {
1119
         if (response.data.state == 1) {
1010
           this.$message.success("审核成功!");
1120
           this.$message.success("审核成功!");
1011
-          this.is_check = 1
1121
+          this.is_check = 1;
1012
           this.showOne = false;
1122
           this.showOne = false;
1013
           this.showTwo = true;
1123
           this.showTwo = true;
1014
           this.showThree = true;
1124
           this.showThree = true;
1015
           var purcaseOrder = response.data.data.purcaseOrder;
1125
           var purcaseOrder = response.data.data.purcaseOrder;
1126
+          this.Reviewed = true;
1016
           console.log("采购订单", purcaseOrder);
1127
           console.log("采购订单", purcaseOrder);
1017
 
1128
 
1018
           var goodOrder = response.data.data.goodOrder;
1129
           var goodOrder = response.data.data.goodOrder;
1035
             for (let j = 0; j < drugList.length; j++) {
1146
             for (let j = 0; j < drugList.length; j++) {
1036
               if (goodOrder[i].is_source == 1) {
1147
               if (goodOrder[i].is_source == 1) {
1037
                 if (goodOrder[i].supply_unit == drugList[j].max_unit) {
1148
                 if (goodOrder[i].supply_unit == drugList[j].max_unit) {
1038
-                  goodOrder[i].count = goodOrder[i].count * drugList[j].min_number;
1149
+                  goodOrder[i].count =
1150
+                    goodOrder[i].count * drugList[j].min_number;
1039
                 }
1151
                 }
1040
               }
1152
               }
1041
             }
1153
             }
1081
                   if (purcaseOrder[i].project_id == newArr[j].project_id) {
1193
                   if (purcaseOrder[i].project_id == newArr[j].project_id) {
1082
                     //根据商品ID比较数量大小,把数量不足的商品ID储存,表示采购单的数量未满足采购订单的数据,部分入库
1194
                     //根据商品ID比较数量大小,把数量不足的商品ID储存,表示采购单的数量未满足采购订单的数据,部分入库
1083
                     if (purcaseOrder[i].count > newArr[j].count) {
1195
                     if (purcaseOrder[i].count > newArr[j].count) {
1084
-                       arr.push(purcaseOrder[i].project_id);
1196
+                      arr.push(purcaseOrder[i].project_id);
1085
                     }
1197
                     }
1086
                   }
1198
                   }
1087
                 }
1199
                 }
1088
               }
1200
               }
1089
               //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成,全部入库
1201
               //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成,全部入库
1090
-              console.log("审核23232323323",arr)
1202
+              console.log("审核23232323323", arr);
1091
               if (arr.length == 0) {
1203
               if (arr.length == 0) {
1092
-                 is_warehouse = 1;
1204
+                is_warehouse = 1;
1093
                 this.ModefySupplyWarehousing(is_warehouse, warehousing_id);
1205
                 this.ModefySupplyWarehousing(is_warehouse, warehousing_id);
1094
               }
1206
               }
1095
 
1207
 
1096
               //部分入库
1208
               //部分入库
1097
-              if (arr.length >0) {
1209
+              if (arr.length > 0) {
1098
                 //修改订购单
1210
                 //修改订购单
1099
                 is_warehouse = 3;
1211
                 is_warehouse = 3;
1100
                 this.ModefySupplyWarehousing(is_warehouse, warehousing_id);
1212
                 this.ModefySupplyWarehousing(is_warehouse, warehousing_id);
1126
         if (response.data.state == 1) {
1238
         if (response.data.state == 1) {
1127
           var cancelList = response.data.data.cancelList;
1239
           var cancelList = response.data.data.cancelList;
1128
           console.log("退库单", cancelList);
1240
           console.log("退库单", cancelList);
1129
-           var drugList = response.data.data.drugList;
1241
+          var drugList = response.data.data.drugList;
1130
           console.log("药品列表", drugList);
1242
           console.log("药品列表", drugList);
1131
           var cancelOrderList = response.data.data.cancelOrderList;
1243
           var cancelOrderList = response.data.data.cancelOrderList;
1132
           console.log("退库单详情", cancelOrderList);
1244
           console.log("退库单详情", cancelOrderList);
1133
-          var ids =""
1134
-          if(cancelList.length == 0){
1135
-            this.$router.push({ path: "/good/return/add?id=" + this.id+"&ids="+ids });
1245
+          var ids = "";
1246
+          if (cancelList.length == 0) {
1247
+            this.$router.push({
1248
+              path: "/good/return/add?id=" + this.id + "&ids=" + ids,
1249
+            });
1136
           }
1250
           }
1137
           if (cancelList.length > 0) {
1251
           if (cancelList.length > 0) {
1138
             var outList = response.data.data.outList;
1252
             var outList = response.data.data.outList;
1139
-            console.log("购货单2322323",outList)
1140
-            for(let i=0;i<outList.length;i++){
1141
-              if(outList[i].is_source == 1){
1142
-                for(let j=0;j<drugList.length;j++){
1143
-                  if(outList[i].project_id == drugList[j].id){
1144
-                    if(outList[i].supply_unit == drugList[j].max_unit){
1145
-                      outList[i].count = outList[i].count * drugList[j].min_number
1253
+            console.log("购货单2322323", outList);
1254
+            for (let i = 0; i < outList.length; i++) {
1255
+              if (outList[i].is_source == 1) {
1256
+                for (let j = 0; j < drugList.length; j++) {
1257
+                  if (outList[i].project_id == drugList[j].id) {
1258
+                    if (outList[i].supply_unit == drugList[j].max_unit) {
1259
+                      outList[i].count =
1260
+                        outList[i].count * drugList[j].min_number;
1146
                     }
1261
                     }
1147
-
1148
                   }
1262
                   }
1149
                 }
1263
                 }
1150
               }
1264
               }
1151
             }
1265
             }
1152
 
1266
 
1153
-            for(let i=0;i<cancelOrderList.length;i++){
1154
-             if(cancelOrderList[i].is_source == 1){
1155
-                for(let j=0;j<drugList.length;j++){
1156
-                  if(cancelOrderList[i].project_id == drugList[j].id){
1157
-                    if(cancelOrderList[i].supply_unit == drugList[j].max_unit){
1158
-                      cancelOrderList[i].count = cancelOrderList[i].count * drugList[j].min_number
1267
+            for (let i = 0; i < cancelOrderList.length; i++) {
1268
+              if (cancelOrderList[i].is_source == 1) {
1269
+                for (let j = 0; j < drugList.length; j++) {
1270
+                  if (cancelOrderList[i].project_id == drugList[j].id) {
1271
+                    if (
1272
+                      cancelOrderList[i].supply_unit == drugList[j].max_unit
1273
+                    ) {
1274
+                      cancelOrderList[i].count =
1275
+                        cancelOrderList[i].count * drugList[j].min_number;
1159
                     }
1276
                     }
1160
                   }
1277
                   }
1161
-                 }
1162
-               }
1278
+                }
1279
+              }
1163
             }
1280
             }
1164
 
1281
 
1165
-            console.log("数据变了后23323233",outList)
1282
+            console.log("数据变了后23323233", outList);
1166
 
1283
 
1167
             let objInfo = {};
1284
             let objInfo = {};
1168
-            if(cancelOrderList.length >0){
1285
+            if (cancelOrderList.length > 0) {
1169
               cancelOrderList.forEach((item, index) => {
1286
               cancelOrderList.forEach((item, index) => {
1170
                 let { project_id } = item;
1287
                 let { project_id } = item;
1171
                 if (!objInfo[project_id]) {
1288
                 if (!objInfo[project_id]) {
1176
                   };
1293
                   };
1177
                 }
1294
                 }
1178
               });
1295
               });
1179
-              let newArr = Object.values(objInfo)
1180
-              console.log("最好的输3233232323323223", newArr)
1181
-              console.log("数据变了后23323233",cancelOrderList)
1296
+              let newArr = Object.values(objInfo);
1297
+              console.log("最好的输3233232323323223", newArr);
1298
+              console.log("数据变了后23323233", cancelOrderList);
1182
               for (let i = 0; i < cancelOrderList.length; i++) {
1299
               for (let i = 0; i < cancelOrderList.length; i++) {
1183
                 for (let j = 0; j < newArr.length; j++) {
1300
                 for (let j = 0; j < newArr.length; j++) {
1184
                   if (cancelOrderList[i].project_id == newArr[j].project_id) {
1301
                   if (cancelOrderList[i].project_id == newArr[j].project_id) {
1185
-                    newArr[j].child.push(cancelOrderList[i])
1302
+                    newArr[j].child.push(cancelOrderList[i]);
1303
+                  }
1186
                 }
1304
                 }
1187
               }
1305
               }
1188
 
1306
 
1189
-             }
1190
-
1191
-            for (let i = 0; i < newArr.length; i++) {
1192
-              for (let j = 0; j < newArr[i].child.length; j++) {
1193
-                newArr[i].count += newArr[i].child[j].count;
1307
+              for (let i = 0; i < newArr.length; i++) {
1308
+                for (let j = 0; j < newArr[i].child.length; j++) {
1309
+                  newArr[i].count += newArr[i].child[j].count;
1310
+                }
1194
               }
1311
               }
1195
-            }
1196
 
1312
 
1197
-            var arr = []
1198
-            var total = 0;
1199
-            var str = "";
1200
-                //如果采购单有数据,则需要比较数量
1201
-            if (newArr.length > 0) {
1202
-              for (let i = 0; i < outList.length; i++) {
1203
-                for (let j = 0; j < newArr.length; j++) {
1204
-                  if (outList[i].project_id == newArr[j].project_id) {
1205
-                    //根据商品ID比较数量大小,把数量不足的商品ID储存,表示退货单的数量未满足采购单的数据,可以继续生成退货单
1206
-                    if (outList[i].count > newArr[j].count) {
1207
-                       arr.push(outList[i].project_id);
1313
+              var arr = [];
1314
+              var total = 0;
1315
+              var str = "";
1316
+              //如果采购单有数据,则需要比较数量
1317
+              if (newArr.length > 0) {
1318
+                for (let i = 0; i < outList.length; i++) {
1319
+                  for (let j = 0; j < newArr.length; j++) {
1320
+                    if (outList[i].project_id == newArr[j].project_id) {
1321
+                      //根据商品ID比较数量大小,把数量不足的商品ID储存,表示退货单的数量未满足采购单的数据,可以继续生成退货单
1322
+                      if (outList[i].count > newArr[j].count) {
1323
+                        arr.push(outList[i].project_id);
1324
+                      }
1208
                     }
1325
                     }
1209
                   }
1326
                   }
1210
                 }
1327
                 }
1211
-              }
1212
-              //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
1328
+                //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
1213
 
1329
 
1214
-              if (arr.length == 0) {
1215
-                this.$message.error("该订单已全部生成退库单,请知悉!");
1216
-                return
1217
-              }
1218
-              console.log("arr23323232232323",arr)
1219
-              if (arr.length > 0) {
1220
-                str = arr.join(",");
1221
-                this.$router.push({ path: "/good/return/edit?id=" + id + "&ids=" + str});
1330
+                if (arr.length == 0) {
1331
+                  this.$message.error("该订单已全部生成退库单,请知悉!");
1332
+                  return;
1333
+                }
1334
+                console.log("arr23323232232323", arr);
1335
+                if (arr.length > 0) {
1336
+                  str = arr.join(",");
1337
+                  this.$router.push({
1338
+                    path: "/good/return/edit?id=" + id + "&ids=" + str,
1339
+                  });
1340
+                }
1222
               }
1341
               }
1223
-             }
1224
-
1342
+            }
1225
           }
1343
           }
1226
-         }
1227
         }
1344
         }
1228
       });
1345
       });
1229
-
1230
     },
1346
     },
1231
     //反审核
1347
     //反审核
1232
     MofyGoodOrder() {
1348
     MofyGoodOrder() {
1241
           var msg = response.data.data.msg;
1357
           var msg = response.data.data.msg;
1242
           if (msg == 1) {
1358
           if (msg == 1) {
1243
             this.$message.success("反审核成功!");
1359
             this.$message.success("反审核成功!");
1360
+            this.disabled = false
1361
+            this.Reviewed = false
1244
             return
1362
             return
1245
           }
1363
           }
1246
           if (msg == 2) {
1364
           if (msg == 2) {
1247
-            var cancelList = response.data.data.cancelList
1248
-            console.log("cancelLIST2332322332232323",cancelList)
1249
-            this.orderList = cancelList
1250
-            this.$refs.Popup.dialogVisible = true
1251
-            return
1365
+            var cancelList = response.data.data.cancelList;
1366
+            console.log("cancelLIST2332322332232323", cancelList);
1367
+            this.orderList = cancelList;
1368
+            this.$refs.Popup.dialogVisible = true;
1369
+            return;
1252
           }
1370
           }
1253
 
1371
 
1254
           var purcaseOrder = response.data.data.purcaseOrder;
1372
           var purcaseOrder = response.data.data.purcaseOrder;
1260
           var ids = "";
1378
           var ids = "";
1261
           // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
1379
           // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
1262
           if (goodOrder.length == 0) {
1380
           if (goodOrder.length == 0) {
1263
-            this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + ids});
1381
+            this.$router.push({
1382
+              path: "/good/order/add?id=" + id + "&ids=" + ids,
1383
+            });
1264
           }
1384
           }
1265
           for (let i = 0; i < purcaseOrder.length; i++) {
1385
           for (let i = 0; i < purcaseOrder.length; i++) {
1266
             for (let j = 0; j < drugList.length; j++) {
1386
             for (let j = 0; j < drugList.length; j++) {
1267
               if (purcaseOrder[i].is_source == 1) {
1387
               if (purcaseOrder[i].is_source == 1) {
1268
                 if (purcaseOrder[i].supply_unit == drugList[j].max_unit) {
1388
                 if (purcaseOrder[i].supply_unit == drugList[j].max_unit) {
1269
-                  purcaseOrder[i].count = purcaseOrder[i].count * drugList[j].min_number;
1389
+                  purcaseOrder[i].count =
1390
+                    purcaseOrder[i].count * drugList[j].min_number;
1270
                 }
1391
                 }
1271
               }
1392
               }
1272
             }
1393
             }
1276
             for (let j = 0; j < drugList.length; j++) {
1397
             for (let j = 0; j < drugList.length; j++) {
1277
               if (goodOrder[i].is_source == 1) {
1398
               if (goodOrder[i].is_source == 1) {
1278
                 if (goodOrder[i].supply_unit == drugList[j].max_unit) {
1399
                 if (goodOrder[i].supply_unit == drugList[j].max_unit) {
1279
-                  goodOrder[i].count = goodOrder[i].count * drugList[j].min_number;
1400
+                  goodOrder[i].count =
1401
+                    goodOrder[i].count * drugList[j].min_number;
1280
                 }
1402
                 }
1281
               }
1403
               }
1282
             }
1404
             }
1376
     tempObj["warehousing_id"] = "";
1498
     tempObj["warehousing_id"] = "";
1377
     tempObj["number"] = "";
1499
     tempObj["number"] = "";
1378
     tempObj["good_number"] = "";
1500
     tempObj["good_number"] = "";
1501
+    tempObj["min_price"] = ""
1379
     this.recordInfo.tableList.push(tempObj);
1502
     this.recordInfo.tableList.push(tempObj);
1380
     this.getInitOrder();
1503
     this.getInitOrder();
1381
     if (parseInt(this.$route.query.id) > 0) {
1504
     if (parseInt(this.$route.query.id) > 0) {
1412
   margin-top: 15px;
1535
   margin-top: 15px;
1413
   margin-bottom: 15px;
1536
   margin-bottom: 15px;
1414
 }
1537
 }
1538
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
1539
+  width: 10px;
1540
+  height: 10px;
1541
+}
1415
 </style>
1542
 </style>
1416
 
1543
 
1417
 <style>
1544
 <style>

+ 229 - 150
src/xt_pages/supply/components/editGoodReturn.vue 파일 보기

59
           <span>单据编码:{{ number }}</span>
59
           <span>单据编码:{{ number }}</span>
60
         </div>
60
         </div>
61
         <div>
61
         <div>
62
-          <el-button size="small" type="primary" @click="updateGoodReturn">保存</el-button>
63
-          <el-button size="small" type="primary" @click="checkReturnOrder" v-if="is_check == 2">审核</el-button>
64
-          <el-button size="small" type="primary" @click="modefyReturnOrder" v-if="is_check == 1">反审核</el-button>
62
+          <el-button size="small" type="primary" @click="updateGoodReturn"
63
+            >保存</el-button
64
+          >
65
+          <el-button
66
+            size="small"
67
+            type="primary"
68
+            @click="checkReturnOrder"
69
+            v-if="is_check == 2"
70
+            >审核</el-button
71
+          >
72
+          <el-button
73
+            size="small"
74
+            type="primary"
75
+            @click="modefyReturnOrder"
76
+            v-if="is_check == 1"
77
+            >反审核</el-button
78
+          >
65
         </div>
79
         </div>
66
       </div>
80
       </div>
67
 
81
 
118
                 :disabled="true"
132
                 :disabled="true"
119
                 placeholder="商品类别"
133
                 placeholder="商品类别"
120
               ></el-input>
134
               ></el-input>
135
+              <div style="visibility: hidden">/</div>
121
             </template>
136
             </template>
122
           </el-table-column>
137
           </el-table-column>
123
           <el-table-column label="规格&单位" align="center" width="200px">
138
           <el-table-column label="规格&单位" align="center" width="200px">
128
                 :disabled="true"
143
                 :disabled="true"
129
                 placeholder="规格&单位"
144
                 placeholder="规格&单位"
130
               ></el-input>
145
               ></el-input>
146
+              <div style="visibility: hidden">/</div>
131
             </template>
147
             </template>
132
           </el-table-column>
148
           </el-table-column>
133
 
149
 
164
                 style="width: 100px"
180
                 style="width: 100px"
165
                 :disabled="true"
181
                 :disabled="true"
166
               ></el-input>
182
               ></el-input>
183
+              <div style="visibility: hidden">/</div>
167
             </template>
184
             </template>
168
           </el-table-column>
185
           </el-table-column>
169
           <el-table-column label="可退数量" align="center" width="200px">
186
           <el-table-column label="可退数量" align="center" width="200px">
173
                 style="width: 150px"
190
                 style="width: 150px"
174
                 :disabled="true"
191
                 :disabled="true"
175
               ></el-input>
192
               ></el-input>
193
+              <div style="visibility: hidden">/</div>
176
             </template>
194
             </template>
177
           </el-table-column>
195
           </el-table-column>
178
           <el-table-column label="数量" align="center" width="120px">
196
           <el-table-column label="数量" align="center" width="120px">
202
                 :disabled="disabled"
220
                 :disabled="disabled"
203
                 placeholder="请输入采购单价"
221
                 placeholder="请输入采购单价"
204
               ></el-input>
222
               ></el-input>
223
+              <div style="visibility: hidden">/</div>
205
             </template>
224
             </template>
206
           </el-table-column>
225
           </el-table-column>
207
 
226
 
208
           <el-table-column label="采购金额" align="center" width="120px">
227
           <el-table-column label="采购金额" align="center" width="120px">
209
             <template slot-scope="scope">
228
             <template slot-scope="scope">
210
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
229
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
230
+              <div style="visibility: hidden">/</div>
211
             </template>
231
             </template>
212
           </el-table-column>
232
           </el-table-column>
213
           <el-table-column label="折扣率" align="center" width="120px">
233
           <el-table-column label="折扣率" align="center" width="120px">
214
             <template slot-scope="scope">
234
             <template slot-scope="scope">
215
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
235
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
236
+              <div style="visibility: hidden">/</div>
216
             </template>
237
             </template>
217
           </el-table-column>
238
           </el-table-column>
218
 
239
 
219
           <el-table-column label="折扣金额" align="center" width="120px">
240
           <el-table-column label="折扣金额" align="center" width="120px">
220
             <template slot-scope="scope">
241
             <template slot-scope="scope">
221
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
242
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
243
+              <div style="visibility: hidden">/</div>
222
             </template>
244
             </template>
223
           </el-table-column>
245
           </el-table-column>
224
 
246
 
229
                 style="width: 160px"
251
                 style="width: 160px"
230
                 :disabled="true"
252
                 :disabled="true"
231
               ></el-input>
253
               ></el-input>
254
+              <div style="visibility: hidden">/</div>
232
             </template>
255
             </template>
233
           </el-table-column>
256
           </el-table-column>
234
 
257
 
239
                 style="width: 160px"
262
                 style="width: 160px"
240
                 :disabled="true"
263
                 :disabled="true"
241
               ></el-input>
264
               ></el-input>
265
+              <div style="visibility: hidden">/</div>
242
             </template>
266
             </template>
243
           </el-table-column>
267
           </el-table-column>
244
 
268
 
249
                 style="width: 160px"
273
                 style="width: 160px"
250
                 :disabled="true"
274
                 :disabled="true"
251
               ></el-input>
275
               ></el-input>
276
+              <div style="visibility: hidden">/</div>
252
             </template>
277
             </template>
253
           </el-table-column>
278
           </el-table-column>
254
 
279
 
260
                 :disabled="disabled"
285
                 :disabled="disabled"
261
                 placeholder="请输入备注"
286
                 placeholder="请输入备注"
262
               ></el-input>
287
               ></el-input>
288
+              <div style="visibility: hidden">/</div>
263
             </template>
289
             </template>
264
           </el-table-column>
290
           </el-table-column>
265
 
291
 
311
         >
337
         >
312
         </el-input>
338
         </el-input>
313
       </div>
339
       </div>
340
+        <!-- 审核水印 -->
341
+        <img
342
+          src="@/assets/purchase/Reviewed.png"
343
+          alt="正在加载..."
344
+          class="reviewImg"
345
+          v-show="Reviewed == true"
346
+        />
314
       <div style="margin-top: 10px">合计:{{ getAllPrice() }} 元</div>
347
       <div style="margin-top: 10px">合计:{{ getAllPrice() }} 元</div>
315
       <div style="margin-top: 10px">
348
       <div style="margin-top: 10px">
316
         <span
349
         <span
375
   updateGoodReturn,
408
   updateGoodReturn,
376
   checkReturnOrder,
409
   checkReturnOrder,
377
   deleteReturnOrderById,
410
   deleteReturnOrderById,
378
-  modefyReturnOrder
411
+  modefyReturnOrder,
379
 } from "@/api/supply";
412
 } from "@/api/supply";
380
 export default {
413
 export default {
381
   name: "addPurchaseOrder",
414
   name: "addPurchaseOrder",
387
       tipsInfo: "",
420
       tipsInfo: "",
388
       crumbs: [
421
       crumbs: [
389
         { path: false, name: "退货单" },
422
         { path: false, name: "退货单" },
390
-        { path: "/good/return/add", name: "新增退货单" },
423
+        { path: "/good/return/add", name: "编辑退货单" },
391
       ],
424
       ],
392
       showTwo: true,
425
       showTwo: true,
393
       showOne: false,
426
       showOne: false,
410
       form: {
443
       form: {
411
         manufacturer_id: "",
444
         manufacturer_id: "",
412
       },
445
       },
446
+      Reviewed:false,
413
       tabList: [],
447
       tabList: [],
414
       manufactuerList: [],
448
       manufactuerList: [],
415
       currentIndex: 0,
449
       currentIndex: 0,
599
       }
633
       }
600
     },
634
     },
601
     handleEdit() {
635
     handleEdit() {
636
+      if (this.is_check == 1) {
637
+        this.$message.error("已审核的不能新增!");
638
+        return false;
639
+      }
602
       const tempObj = {};
640
       const tempObj = {};
603
       tempObj["id"] = 0;
641
       tempObj["id"] = 0;
604
       tempObj["name"] = "";
642
       tempObj["name"] = "";
616
       tempObj["is_total"] = 1;
654
       tempObj["is_total"] = 1;
617
       tempObj["project_id"] = 0;
655
       tempObj["project_id"] = 0;
618
       tempObj["supply_unit"] = "";
656
       tempObj["supply_unit"] = "";
619
-      tempObj["supply_batch_number"] = ""
620
-      tempObj["supply_product_date"] = ""
621
-      tempObj["supply_expiry_date"] = ""
622
-      tempObj["warehousing_id"] =0
623
-      tempObj["warehouse_info_id"] =0
624
-      tempObj["count"] = ""
657
+      tempObj["supply_batch_number"] = "";
658
+      tempObj["supply_product_date"] = "";
659
+      tempObj["supply_expiry_date"] = "";
660
+      tempObj["warehousing_id"] = 0;
661
+      tempObj["warehouse_info_id"] = 0;
662
+      tempObj["count"] = "";
625
 
663
 
626
       this.recordInfo.tableList.push(tempObj);
664
       this.recordInfo.tableList.push(tempObj);
627
     },
665
     },
628
     handleDelete: function (index, row) {
666
     handleDelete: function (index, row) {
629
-      if(row.id == 0){
667
+      if (row.id == 0) {
630
         if (this.recordInfo.tableList.length <= 1) {
668
         if (this.recordInfo.tableList.length <= 1) {
631
           this.$message.error("只有一条记录的时候无法删除");
669
           this.$message.error("只有一条记录的时候无法删除");
632
           return;
670
           return;
634
           this.recordInfo.tableList.splice(index, 1);
672
           this.recordInfo.tableList.splice(index, 1);
635
         }
673
         }
636
       }
674
       }
637
-      if(row.id >0){
638
-       if(this.is_check == 1){
639
-         this.$message.error("已审核单据,不能删除!")
640
-         return false
641
-       }
642
-       this.$confirm('确认删除吗?', '删除', {
643
-          confirmButtonText: '确 定',
644
-          cancelButtonText: '取 消',
645
-          type: 'warning'
646
-        }).then(() => {
647
-          deleteReturnOrderById(val.id).then(response => {
648
-            if (response.data.state == 1) {
649
-                var msg = response.data.data.msg
675
+      if (row.id > 0) {
676
+        if (this.is_check == 1) {
677
+          this.$message.error("已审核单据,不能删除!");
678
+          return false;
679
+        }
680
+        this.$confirm("确认删除吗?", "删除", {
681
+          confirmButtonText: "确 定",
682
+          cancelButtonText: "取 消",
683
+          type: "warning",
684
+        })
685
+          .then(() => {
686
+            deleteReturnOrderById(val.id).then((response) => {
687
+              if (response.data.state == 1) {
688
+                var msg = response.data.data.msg;
650
                 this.recordInfo.tableList.splice(index, 1);
689
                 this.recordInfo.tableList.splice(index, 1);
651
-                this.$message.success("删除成功")
652
-            } else {
653
-                this.$message.error("删除失败")
654
-            }
690
+                this.$message.success("删除成功");
691
+              } else {
692
+                this.$message.error("删除失败");
693
+              }
694
+            });
655
           })
695
           })
656
-        }).catch(() => {
657
-       })
696
+          .catch(() => {});
658
       }
697
       }
659
-
660
     },
698
     },
661
     getWarehoseInfo(arr, max_unit, min_unit, min_number) {
699
     getWarehoseInfo(arr, max_unit, min_unit, min_number) {
662
       var total = 0;
700
       var total = 0;
791
         this.discount_amount /
829
         this.discount_amount /
792
         (this.total_price * 0.01)
830
         (this.total_price * 0.01)
793
       ).toFixed(2);
831
       ).toFixed(2);
832
+
794
     },
833
     },
795
     count_payment() {
834
     count_payment() {
796
-      this.arrearage = this.total_price - this.payment;
835
+      let arrearage_1 = (this.total_price - this.discount_amount - this.payment).toFixed(2);
836
+      if (arrearage_1 > 0) {
837
+        this.arrearage = arrearage_1;
838
+      } else {
839
+        this.arrearage = 0;
840
+      }
797
     },
841
     },
798
 
842
 
799
     count_arrearage() {
843
     count_arrearage() {
818
         })
862
         })
819
         .catch(() => {});
863
         .catch(() => {});
820
     },
864
     },
821
-   getGoodReturnDetail(){
822
-
823
-      var id = this.$route.query.id
824
-      getGoodReturnDetail(id).then(response=>{
825
-        if(response.data.state == 1){
826
-          var out = response.data.data.cancelDetail
827
-          console.log("out23322323232323",out)
828
-          this.warehouse_out_id = out.warehouse_out_id
829
-          this.number = out.number
830
-          this.is_check = out.is_check
831
-          this.id = out.id
832
-          this.supplier_name = out.supplier_id
833
-          this.rate_of_concession = out.rate_of_concession
834
-          this.discount_amount = out.discount_amount
835
-          this.payment = out.payment
836
-          this.arrearage = out.arrearage
837
-          this.start_time = this.getTimes(out.document_date)
838
-          var orderInfo = response.data.data.orderCancelDetail
839
-          if(out.is_check == 1){
840
-            this.disabled = true
865
+    getGoodReturnDetail() {
866
+      var id = this.$route.query.id;
867
+      getGoodReturnDetail(id).then((response) => {
868
+        if (response.data.state == 1) {
869
+          var out = response.data.data.cancelDetail;
870
+          console.log("out23322323232323", out);
871
+          this.warehouse_out_id = out.warehouse_out_id;
872
+          this.number = out.number;
873
+          this.is_check = out.is_check;
874
+          this.id = out.id;
875
+          this.supplier_name = out.supplier_id;
876
+          this.rate_of_concession = out.rate_of_concession;
877
+          this.discount_amount = out.discount_amount;
878
+          this.payment = out.payment;
879
+          this.arrearage = out.arrearage;
880
+          this.start_time = this.getTimes(out.document_date);
881
+          var orderInfo = response.data.data.orderCancelDetail;
882
+          if (out.is_check == 1) {
883
+            this.disabled = true;
841
           }
884
           }
842
-          console.log("退库单详情",orderInfo)
843
-          var drugList = response.data.data.drugList
844
-          var goodList = response.data.data.goodList
845
-          for(let i=0;i< orderInfo.length;i++){
846
-              orderInfo[i].id = orderInfo[i].id
847
-              orderInfo[i].supply_count =  orderInfo[i].count
848
-              orderInfo[i].count = orderInfo[i].source_count
849
-              orderInfo[i].supply_price =  orderInfo[i].price
850
-              orderInfo[i].supply_remake =  orderInfo[i].remark
851
-              orderInfo[i].type =  orderInfo[i].is_source
852
-              orderInfo[i].project_id =  orderInfo[i].project_id
853
-              orderInfo[i].supply_unit =  orderInfo[i].supply_unit
854
-              orderInfo[i].order_number =  orderInfo[i].order_number
855
-              orderInfo[i].good_number = orderInfo[i].good_number
856
-              orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2)
857
-              orderInfo[i].supply_expiry_date =  orderInfo[i].supply_expiry_date
858
-              orderInfo[i].supply_product_date = orderInfo[i].supply_product_date
859
-            if(orderInfo[i].is_source == 1){
860
-              for(let j=0;j<drugList.length;j++){
861
-                  if( orderInfo[i].project_id == drugList[j].id){
862
-                    if(drugList[j].max_unit!=drugList[j].min_unit){
863
-                      orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
864
-                      orderInfo[i].unitList[0].name = drugList[j].max_unit
865
-                      orderInfo[i].unitList[1].name = drugList[j].min_unit
866
-                    }
867
-                    if(drugList[j].max_unit ==drugList[j].min_unit){
868
-                      orderInfo[i].unitList = [{id:1,name:""}]
869
-                      orderInfo[i].unitList[0].name = drugList[j].max_unit
870
-                    }
871
-
885
+          console.log("退库单详情", orderInfo);
886
+          var drugList = response.data.data.drugList;
887
+          var goodList = response.data.data.goodList;
888
+          for (let i = 0; i < orderInfo.length; i++) {
889
+            orderInfo[i].id = orderInfo[i].id;
890
+            orderInfo[i].supply_count = orderInfo[i].count;
891
+            orderInfo[i].count = orderInfo[i].source_count;
892
+            orderInfo[i].supply_price = orderInfo[i].price;
893
+            orderInfo[i].supply_remake = orderInfo[i].remark;
894
+            orderInfo[i].type = orderInfo[i].is_source;
895
+            orderInfo[i].project_id = orderInfo[i].project_id;
896
+            orderInfo[i].supply_unit = orderInfo[i].supply_unit;
897
+            orderInfo[i].order_number = orderInfo[i].order_number;
898
+            orderInfo[i].good_number = orderInfo[i].good_number;
899
+            orderInfo[i].supply_total_price = (
900
+              orderInfo[i].count * orderInfo[i].price
901
+            ).toFixed(2);
902
+            orderInfo[i].supply_expiry_date = orderInfo[i].supply_expiry_date;
903
+            orderInfo[i].supply_product_date = orderInfo[i].supply_product_date;
904
+            if (orderInfo[i].is_source == 1) {
905
+              for (let j = 0; j < drugList.length; j++) {
906
+                if (orderInfo[i].project_id == drugList[j].id) {
907
+                  if (drugList[j].max_unit != drugList[j].min_unit) {
908
+                    orderInfo[i].unitList = [
909
+                      { id: 1, name: "" },
910
+                      { id: 2, name: "" },
911
+                    ];
912
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit;
913
+                    orderInfo[i].unitList[1].name = drugList[j].min_unit;
872
                   }
914
                   }
873
-              }
874
-              }
875
-            if(orderInfo[i].is_source == 2){
876
-              for(let j=0;j<goodList.length;j++){
877
-                  if(orderInfo[i].project_id == goodList[j].id){
878
-                      orderInfo[i].unitList = [{id:1,name:""}]
879
-                      orderInfo[i].unitList[0].name = goodList[j].packing_unit
915
+                  if (drugList[j].max_unit == drugList[j].min_unit) {
916
+                    orderInfo[i].unitList = [{ id: 1, name: "" }];
917
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit;
880
                   }
918
                   }
919
+                }
920
+              }
921
+            }
922
+            if (orderInfo[i].is_source == 2) {
923
+              for (let j = 0; j < goodList.length; j++) {
924
+                if (orderInfo[i].project_id == goodList[j].id) {
925
+                  orderInfo[i].unitList = [{ id: 1, name: "" }];
926
+                  orderInfo[i].unitList[0].name = goodList[j].packing_unit;
927
+                }
881
               }
928
               }
882
             }
929
             }
883
           }
930
           }
891
       var id = this.$route.query.id;
938
       var id = this.$route.query.id;
892
       this.$router.push({ path: "/purchase/order/print?&id=" + id });
939
       this.$router.push({ path: "/purchase/order/print?&id=" + id });
893
     },
940
     },
894
-    updateGoodReturn(){
941
+    updateGoodReturn() {
895
       var warehouse_out_id = this.$route.query.id;
942
       var warehouse_out_id = this.$route.query.id;
896
-      this.$refs["tableForm"].validate((valid)=>{
897
-        if(valid){
898
-          this.loading = true
899
-          for(let i=0;i<this.recordInfo.tableList.length;i++){
900
-            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
901
-            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
902
-            this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
903
-            for(let j=0;j<this.manufactuerList.length;j++){
904
-                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
905
-                  this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
906
-                }
907
-                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].id){
908
-                  this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name
909
-                }
910
-             }
943
+      this.$refs["tableForm"].validate((valid) => {
944
+        if (valid) {
945
+          this.loading = true;
946
+          for (let i = 0; i < this.recordInfo.tableList.length; i++) {
947
+            this.recordInfo.tableList[i].supply_count = parseInt(
948
+              this.recordInfo.tableList[i].supply_count
949
+            );
950
+            this.recordInfo.tableList[i].supply_price =
951
+              this.recordInfo.tableList[i].supply_price.toString();
952
+            this.recordInfo.tableList[i].supply_total =
953
+              this.recordInfo.tableList[i].supply_total.toString();
954
+            for (let j = 0; j < this.manufactuerList.length; j++) {
955
+              if (
956
+                this.recordInfo.tableList[i].supply_manufacturer ==
957
+                this.manufactuerList[j].manufacturer_name
958
+              ) {
959
+                this.recordInfo.tableList[i].manufacturer_id =
960
+                  this.manufactuerList[j].id;
961
+              }
962
+              if (
963
+                this.recordInfo.tableList[i].supply_manufacturer ==
964
+                this.manufactuerList[j].id
965
+              ) {
966
+                this.recordInfo.tableList[i].supply_manufacturer =
967
+                  this.manufactuerList[j].manufacturer_name;
968
+              }
969
+            }
911
           }
970
           }
912
           var params = {
971
           var params = {
913
-            stockIn:this.recordInfo.tableList,
914
-            return_marke:this.return_remark,
915
-          }
916
-          updateGoodReturn(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name,this.number).then(response=>{
917
-             if(response.data.state == 1){
918
-                var msg = response.data.msg;
919
-                this.loading = false;
920
-                this.$message.success("保存成功!");
921
-             }
922
-          })
923
-
972
+            stockIn: this.recordInfo.tableList,
973
+            return_marke: this.return_remark,
974
+          };
975
+          updateGoodReturn(
976
+            params,
977
+            warehouse_out_id,
978
+            this.start_time,
979
+            this.rate_of_concession,
980
+            this.discount_amount,
981
+            this.arrearage,
982
+            this.payment,
983
+            this.supplier_name,
984
+            this.number
985
+          ).then((response) => {
986
+            if (response.data.state == 1) {
987
+              var msg = response.data.msg;
988
+              this.loading = false;
989
+              this.$message.success("保存成功!");
990
+            }
991
+          });
924
         }
992
         }
925
-      })
993
+      });
926
     },
994
     },
927
-    checkReturnOrder(){
928
-      this.loading = true
929
-     var params = {
930
-       warehouse_out_id:this.warehouse_out_id,
931
-       id:this.id,
932
-     }
933
-     checkReturnOrder(params).then(response=>{
934
-       if(response.data.state == 1){
935
-        this.loading = false
936
-        var msg = response.data.data.msg
937
-        this.$message.success("审核成功!")
938
-       }
939
-     })
995
+    checkReturnOrder() {
996
+      this.loading = true;
997
+      var params = {
998
+        warehouse_out_id: this.warehouse_out_id,
999
+        id: this.id,
1000
+      };
1001
+      checkReturnOrder(params).then((response) => {
1002
+        if (response.data.state == 1) {
1003
+          this.loading = false;
1004
+          var msg = response.data.data.msg;
1005
+          this.$message.success("审核成功!");
1006
+        }
1007
+      });
940
     },
1008
     },
941
-    modefyReturnOrder(){
942
-      this.loading = true
943
-     var params = {
944
-       warehouse_out_id:this.warehouse_out_id,
945
-       id:this.id,
946
-     }
947
-     modefyReturnOrder(params).then(response=>{
948
-       if(response.data.state == 1){
949
-         this.loading = false
950
-         var msg = response.data.data.msg
951
-         this.$message.success("反审核成功!")
952
-       }
953
-     })
1009
+    modefyReturnOrder() {
1010
+      this.loading = true;
1011
+      var params = {
1012
+        warehouse_out_id: this.warehouse_out_id,
1013
+        id: this.id,
1014
+      };
1015
+      modefyReturnOrder(params).then((response) => {
1016
+        if (response.data.state == 1) {
1017
+          this.loading = false;
1018
+          var msg = response.data.data.msg;
1019
+          this.$message.success("反审核成功!");
1020
+        }
1021
+      });
954
     },
1022
     },
955
   },
1023
   },
956
   created() {
1024
   created() {
971
     tempObj["is_total"] = 1;
1039
     tempObj["is_total"] = 1;
972
     tempObj["project_id"] = 0;
1040
     tempObj["project_id"] = 0;
973
     tempObj["supply_unit"] = "";
1041
     tempObj["supply_unit"] = "";
974
-    tempObj["supply_batch_number"] = ""
975
-    tempObj["supply_product_date"] = ""
976
-    tempObj["supply_expiry_date"] = ""
977
-    tempObj["warehousing_id"] =0
978
-    tempObj["warehouse_info_id"] =0
979
-    tempObj["count"] = ""
1042
+    tempObj["supply_batch_number"] = "";
1043
+    tempObj["supply_product_date"] = "";
1044
+    tempObj["supply_expiry_date"] = "";
1045
+    tempObj["warehousing_id"] = 0;
1046
+    tempObj["warehouse_info_id"] = 0;
1047
+    tempObj["count"] = "";
980
     this.recordInfo.tableList.push(tempObj);
1048
     this.recordInfo.tableList.push(tempObj);
981
     this.getInitOrder();
1049
     this.getInitOrder();
982
     //获取购货单列表
1050
     //获取购货单列表
1010
   margin-top: 15px;
1078
   margin-top: 15px;
1011
   margin-bottom: 15px;
1079
   margin-bottom: 15px;
1012
 }
1080
 }
1081
+
1082
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
1083
+  width: 10px;
1084
+  height: 10px;
1085
+}
1013
 </style>
1086
 </style>
1014
 
1087
 
1015
 <style>
1088
 <style>
1040
   bottom: 20px;
1113
   bottom: 20px;
1041
   height: 100%;
1114
   height: 100%;
1042
 }
1115
 }
1116
+.reviewImg {
1117
+  position: fixed;
1118
+  left: 50%;
1119
+  transform: translateX(-50%);
1120
+  top: 30%;
1121
+}
1043
 </style>
1122
 </style>

+ 32 - 2
src/xt_pages/supply/components/editPurchaseOrder.vue 파일 보기

12
           align-items: center;
12
           align-items: center;
13
         "
13
         "
14
       >
14
       >
15
-        <div>
15
+        <div style="display:flex;align-items: center;">
16
           <span style="color: red">*</span><span>供应商:</span>
16
           <span style="color: red">*</span><span>供应商:</span>
17
           <el-select
17
           <el-select
18
             v-model="supplier_name"
18
             v-model="supplier_name"
317
             :rows="2"
317
             :rows="2"
318
             placeholder="备注信息"
318
             placeholder="备注信息"
319
             v-model="return_remark"
319
             v-model="return_remark"
320
+            :disabled="disabled"
320
           >
321
           >
321
           </el-input>
322
           </el-input>
322
         </div>
323
         </div>
894
           }
895
           }
895
          
896
          
896
           this.recordInfo.tableList = [];
897
           this.recordInfo.tableList = [];
897
-          this.recordInfo.tableList = orderInfo;
898
+          if(orderInfo.length == 0){
899
+              const tempObj = {};
900
+              tempObj["id"] = 0;
901
+              tempObj["name"] = "";
902
+              tempObj["supply_name"] = "";
903
+              tempObj["supply_type"] = "";
904
+              tempObj["supply_specification_name"] = "";
905
+              tempObj["supply_total"] = "";
906
+              tempObj["supply_count"] = "";
907
+              tempObj["supply_price"] = "";
908
+              tempObj["supply_total_price"] = "";
909
+              tempObj["supply_manufacturer"] = "";
910
+              tempObj["supply_license_number"] = "";
911
+              tempObj["supply_remake"] = "";
912
+              tempObj["type"] = 0;
913
+              tempObj["is_total"] = 1;
914
+              tempObj["project_id"] = 0;
915
+              tempObj["supply_unit"] = "";
916
+              tempObj["manufacturer_id"] = "";
917
+              this.recordInfo.tableList.push(tempObj);
918
+          }else{
919
+            this.recordInfo.tableList = orderInfo;
920
+          }
921
+         
898
         }
922
         }
899
       });
923
       });
900
     },
924
     },
1100
   margin-top: 15px;
1124
   margin-top: 15px;
1101
   margin-bottom: 15px;
1125
   margin-bottom: 15px;
1102
 }
1126
 }
1127
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
1128
+  width: 10px;
1129
+  height: 10px;
1130
+}
1103
 </style>
1131
 </style>
1104
 
1132
 
1105
 <style>
1133
 <style>
1136
   transform: translateX(-50%);
1164
   transform: translateX(-50%);
1137
   top: 30%;
1165
   top: 30%;
1138
 }
1166
 }
1167
+
1168
+
1139
 </style>
1169
 </style>

+ 4 - 0
src/xt_pages/supply/goodOrderQuery.vue 파일 보기

407
   margin-top: 15px;
407
   margin-top: 15px;
408
   margin-bottom: 15px;
408
   margin-bottom: 15px;
409
 }
409
 }
410
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
411
+  width: 10px;
412
+  height: 10px;
413
+}
410
 </style>
414
 </style>
411
 
415
 
412
 <style>
416
 <style>

+ 5 - 0
src/xt_pages/supply/goodreturn.vue 파일 보기

326
        this.$router.push({path:"/good/return/edit?id="+id})
326
        this.$router.push({path:"/good/return/edit?id="+id})
327
      },
327
      },
328
      toClickOne(val,index){
328
      toClickOne(val,index){
329
+       console.log("val323232323232",val)
329
        if(val.is_check == 1){
330
        if(val.is_check == 1){
330
          this.$message.error("已审核单据,不能删除!")
331
          this.$message.error("已审核单据,不能删除!")
331
          return false
332
          return false
392
   margin-top: 15px;
393
   margin-top: 15px;
393
   margin-bottom: 15px;
394
   margin-bottom: 15px;
394
 }
395
 }
396
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
397
+  width: 10px;
398
+  height: 10px;
399
+}
395
 </style>
400
 </style>
396
 
401
 
397
 <style>
402
 <style>

+ 5 - 1
src/xt_pages/supply/purchaseOrderQuery.vue 파일 보기

105
           <template slot-scope="scope">
105
           <template slot-scope="scope">
106
             <div style="width: 100%; height: 100%">
106
             <div style="width: 100%; height: 100%">
107
               <tr class="color" v-for="(item,index) in scope.row.orderOut" :key="index">
107
               <tr class="color" v-for="(item,index) in scope.row.orderOut" :key="index">
108
-                 <td>{{item.good_number}}</td>
108
+                 <td style="border:none;">{{item.good_number}}</td>
109
               </tr>
109
               </tr>
110
 
110
 
111
             </div>
111
             </div>
438
   margin-top: 15px;
438
   margin-top: 15px;
439
   margin-bottom: 15px;
439
   margin-bottom: 15px;
440
 }
440
 }
441
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
442
+  width: 10px;
443
+  height: 10px;
444
+}
441
 </style>
445
 </style>
442
 
446
 
443
 <style>
447
 <style>

+ 4 - 0
src/xt_pages/supply/supplyQuery.vue 파일 보기

278
 </script>
278
 </script>
279
 
279
 
280
 <style rel="stylesheet/css" lang="scss" scoped>
280
 <style rel="stylesheet/css" lang="scss" scoped>
281
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
282
+  width: 10px;
283
+  height: 10px;
284
+}
281
 .information {
285
 .information {
282
   border: 1px #dcdfe6 solid;
286
   border: 1px #dcdfe6 solid;
283
   padding: 30px 20px 30px 20px;
287
   padding: 30px 20px 30px 20px;