Pārlūkot izejas kodu

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

csx 3 gadus atpakaļ
vecāks
revīzija
8ef0982339

+ 3 - 7
src/views/layout/Layout.vue Parādīt failu

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

+ 38 - 19
src/xt_pages/data/printTemplate/prescriptionPrint.vue Parādīt failu

@@ -10,26 +10,42 @@
10 10
     </p>
11 11
     <el-row :gutter="20" type="flex" justify="center">
12 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 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 49
         </el-col>
34 50
     </el-row>
35 51
  
@@ -80,7 +96,8 @@ export default {
80 96
       delay: 500,
81 97
       radio: 0,
82 98
       tempRadio: 0,
83
-      loading: false
99
+      loading: false,
100
+      org_id:0,
84 101
     };
85 102
   },
86 103
   methods: {
@@ -138,6 +155,8 @@ export default {
138 155
     }
139 156
   },
140 157
   created() {
158
+    this.org_id = this.$store.getters.xt_user.org.id
159
+    console.log("orgid23322332232323",this.org_id)
141 160
     this.getlist()
142 161
   }
143 162
 };

+ 1 - 1
src/xt_pages/dialysis/batch_print/batch_print_order_six.vue Parādīt failu

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

+ 10 - 3
src/xt_pages/dialysis/details/DialysisPrescription.vue Parādīt failu

@@ -107,11 +107,18 @@
107 107
       </ul>
108 108
 
109 109
       <ul>
110
-        <li v-if="isShow('目标超滤量')">
110
+        <li v-if="isShow('目标超滤量') && this.$store.getters.xt_user.template_info.org_id != 10290">
111 111
           <label>目标超滤量 : </label>
112 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 122
         </li>
116 123
         <!-- <li v-if="isShow('葡萄糖')">
117 124
           <label>葡萄糖 : </label>

+ 10 - 0
src/xt_pages/dialysis/dialysisPrintOrder.vue Parādīt failu

@@ -65,6 +65,16 @@
65 65
           >打印</el-button
66 66
         >
67 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 78
       <template v-if="org_template_info.template_id == 5">
69 79
         <div>
70 80
           <el-button

+ 263 - 22
src/xt_pages/dialysis/template/DialysisPrintOrderFortySix.vue Parādīt failu

@@ -59,12 +59,12 @@
59 59
           <div class="inline_block">
60 60
             病区:
61 61
             <div class="under_line" style="width: 50px; text-align: center">
62
-              <span v-if="org_id == 10121">{{
62
+              <span>{{
63 63
                 patientInfo.DialysisSchedule.device_zone.name
64 64
                   ? patientInfo.DialysisSchedule.device_zone.name
65
-                  : ""
65
+                  : "/"
66 66
               }}</span>
67
-              <span v-else>{{ "/" }}</span>
67
+              
68 68
             </div>
69 69
           </div>
70 70
           <div class="inline_block">
@@ -91,7 +91,6 @@
91 91
             </div>
92 92
           </div>
93 93
         </div>
94
-  
95 94
 
96 95
         <div
97 96
           class="row"
@@ -695,11 +694,8 @@
695 694
                     class="row"
696 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 699
                       <div
704 700
                         class="under_line"
705 701
                         style="width: 100px; text-align: center"
@@ -707,16 +703,6 @@
707 703
                         {{
708 704
                           prescription.dialyzer_perfusion_apparatus
709 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 708
                       </div>
@@ -1586,7 +1572,6 @@
1586 1572
               </div>
1587 1573
             </div>
1588 1574
           </div>
1589
-
1590 1575
         </template>
1591 1576
         <div class="row" style="margin-top: -11px; position: relative">
1592 1577
           <table class="proj_table">
@@ -1704,7 +1689,263 @@
1704 1689
                   </td>
1705 1690
                 </tr>
1706 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 1949
             </tbody>
1709 1950
           </table>
1710 1951
           <!-- <div  class="print-yema">1</div> -->
@@ -1726,7 +1967,7 @@ import BreadCrumb from "@/xt_pages/components/bread-crumb";
1726 1967
 import print from "print-js";
1727 1968
 
1728 1969
 export default {
1729
-  name: 'DialysisPrintOrderFortySix',
1970
+  name: "DialysisPrintOrderFortySix",
1730 1971
   props: ["childResponse"],
1731 1972
   components: {
1732 1973
     // DialysisPrintOrderOne,

+ 2 - 0
src/xt_pages/dialysis/template/DialysisPrintOrderFortyTwo.vue Parādīt failu

@@ -65,6 +65,8 @@
65 65
                   showValue='临时股静脉导管'></label-box>
66 66
               &nbsp;
67 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 70
                   showValue='长期静脉导管'></label-box>
69 71
               &nbsp;
70 72
             </td>

+ 1 - 1
src/xt_pages/dialysis/template/DialysisPrintOrderSix.vue Parādīt failu

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

+ 15 - 1
src/xt_pages/stock/drugs/drugStockInOrder.vue Parādīt failu

@@ -618,7 +618,7 @@ export default {
618 618
     handleEdit:function(index,row){
619 619
        this.$router.push({
620 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 624
     handleSearch(id){
@@ -649,6 +649,11 @@ export default {
649 649
       });
650 650
     },
651 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 657
       const ids = [];
653 658
       ids.push(row.id);
654 659
       const idStr = ids.join(",");
@@ -709,8 +714,17 @@ export default {
709 714
         return;
710 715
       }
711 716
       const ids = [];
717
+      const idOne = []
712 718
       for (let i = 0; i < this.selectedTableData.length; i++) {
713 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 729
       const idStr = ids.join(",");
716 730
       const params = {

+ 34 - 10
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue Parādīt failu

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

+ 18 - 5
src/xt_pages/stock/stockInOrder.vue Parādīt failu

@@ -1059,13 +1059,15 @@ export default {
1059 1059
       }
1060 1060
     },
1061 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 1065
     handleDelete: function(index, row) {
1066
+     
1067
+      if(row.supply_warehouse_id > 0){
1068
+        this.$message.error("自动生成入库单不能删除!")
1069
+        return false
1070
+      }
1069 1071
       const ids = [];
1070 1072
       ids.push(row.id);
1071 1073
       const idStr = ids.join(",");
@@ -1122,9 +1124,19 @@ export default {
1122 1124
         return;
1123 1125
       }
1124 1126
       const ids = [];
1127
+      const idOne = []
1125 1128
       for (let i = 0; i < this.selectedTableData.length; i++) {
1126 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 1140
       const idStr = ids.join(",");
1129 1141
       const params = {
1130 1142
         ids: idStr
@@ -1371,6 +1383,7 @@ export default {
1371 1383
       },
1372 1384
 
1373 1385
      DeleteWarehouseInfoItem: function(index, row) {
1386
+       
1374 1387
       if (row.id == 0) {
1375 1388
         this.recordInfo.recordData.splice(index, 1);
1376 1389
       } else {

+ 28 - 7
src/xt_pages/stock/stockInOrderEdit.vue Parādīt failu

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

+ 302 - 31
src/xt_pages/supply/components/addGoodOrder.vue Parādīt failu

@@ -12,12 +12,13 @@
12 12
           align-items: center;
13 13
         "
14 14
       >
15
-        <div>
15
+        <div style="display:flex;align-items: center;">
16 16
           <span style="color: red">*</span><span>供应商:</span>
17 17
           <el-select
18 18
             v-model="supplier_name"
19 19
             style="width: 140px; margin-right: 10px"
20 20
             placeholder="请选择"
21
+            :disabled="disabled"
21 22
           >
22 23
             <el-option
23 24
               v-for="item in supplyList"
@@ -29,6 +30,7 @@
29 30
           </el-select>
30 31
           <span>单据日期:</span>
31 32
           <el-date-picker
33
+            :disabled="disabled"
32 34
             size="small"
33 35
             v-model="start_time"
34 36
             prefix-icon="el-icon-date"
@@ -56,7 +58,7 @@
56 58
         ></el-date-picker> -->
57 59
           <span>单据编码:{{ good_number }}</span>
58 60
         </div>
59
-        <div>
61
+        <div style="display:flex">
60 62
           <el-button
61 63
             size="small"
62 64
             type="primary"
@@ -71,7 +73,9 @@
71 73
             v-show="showTwo"
72 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 79
         </div>
76 80
       </div>
77 81
 
@@ -238,6 +242,18 @@
238 242
             </template>
239 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 257
           <el-table-column label="采购单价" align="center" width="180px">
242 258
             <template slot-scope="scope">
243 259
               <el-input
@@ -253,6 +269,7 @@
253 269
           <el-table-column label="采购金额" align="center" width="120px">
254 270
             <template slot-scope="scope">
255 271
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
272
+              <div style="visibility: hidden">/</div>
256 273
             </template>
257 274
           </el-table-column>
258 275
           <el-table-column label="生产日期" align="center" width="200px">
@@ -388,6 +405,7 @@
388 405
               v-model="rate_of_concession"
389 406
               @input="addressChange"
390 407
               placeholder="请输入优惠率"
408
+              :disabled="disabled"
391 409
             ></el-input
392 410
             >%</span
393 411
           >
@@ -398,6 +416,7 @@
398 416
               v-model="discount_amount"
399 417
               @input="count_discount"
400 418
               placeholder="请输入优惠金额"
419
+              :disabled="disabled"
401 420
             ></el-input
402 421
           ></span>
403 422
 
@@ -407,6 +426,7 @@
407 426
               v-model="payment"
408 427
               @input="count_payment"
409 428
               placeholder="请输入本次付款"
429
+              :disabled="disabled"
410 430
             ></el-input
411 431
           ></span>
412 432
 
@@ -449,7 +469,9 @@ import {
449 469
   updateGoodOrder,
450 470
   checkGoodOrderById,
451 471
   getGoodOrderCountList,
452
-  ModefySupplyWarehousing
472
+  ModefySupplyWarehousing,
473
+  MofyGoodOrder,
474
+  getSupplyWarehouseOutById
453 475
 } from "@/api/supply";
454 476
 export default {
455 477
   name: "addPurchaseOrder",
@@ -597,6 +619,7 @@ export default {
597 619
             drugList[i].supply_remake = "";
598 620
             drugList[i].type = 1;
599 621
             drugList[i].supply_price = drugList[i].last_price;
622
+            drugList[i].min_price = drugList[i].min_price
600 623
             drugList[i].name = drugList[i].drug_name;
601 624
             if (drugList[i].max_unit != drugList[i].min_unit) {
602 625
               drugList[i].unitList = [
@@ -652,6 +675,7 @@ export default {
652 675
             goodList[i].name = goodList[i].good_name;
653 676
             goodList[i].unitList = [{ id: 1, name: "" }];
654 677
             goodList[i].supply_unit = goodList[i].packing_unit;
678
+            goodList[i].min_price = goodList[i].retail_price
655 679
             for (let j = 0; j < goodList[i].unitList.length; j++) {
656 680
               goodList[i].unitList[0].name = goodList[i].packing_unit;
657 681
             }
@@ -672,9 +696,9 @@ export default {
672 696
           this.recordInfo.tableList[i].name = val.name;
673 697
           this.recordInfo.tableList[i].supply_name = val.supply_name;
674 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 700
           this.recordInfo.tableList[i].supply_total = val.supply_total;
701
+          this.recordInfo.tableList[i].min_price = val.min_price  
678 702
           if (val.supply_count == NaN) {
679 703
             this.recordInfo.tableList[i].supply_count = "";
680 704
           } else {
@@ -723,6 +747,7 @@ export default {
723 747
       tempObj["order_number"] = "";
724 748
       tempObj["supply_expiry_date"] = "";
725 749
       tempObj["manufacturer_id"] = "";
750
+      tempObj["min_price"] = ""
726 751
       this.recordInfo.tableList.push(tempObj);
727 752
     },
728 753
     handleDelete: function (index, row) {
@@ -791,6 +816,7 @@ export default {
791 816
           this.recordInfo.tableList[i].supply_count;
792 817
       }
793 818
       this.total_price = total_price;
819
+      this.discount_amount = (this.total_price * this.rate_of_concession * 0.01).toFixed(2);
794 820
       return total_price.toFixed(2);
795 821
     },
796 822
     addressChange() {
@@ -802,6 +828,7 @@ export default {
802 828
         ).toFixed(2);
803 829
       }
804 830
       this.discount_amount = discount_amount;
831
+     
805 832
     },
806 833
     count_discount() {
807 834
       this.rate_of_concession = (
@@ -810,7 +837,12 @@ export default {
810 837
       ).toFixed(2);
811 838
     },
812 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 848
     count_arrearage() {
@@ -839,7 +871,9 @@ export default {
839 871
       getPurchaseOrderInfo(id, ids).then((response) => {
840 872
         if (response.data.state == 1) {
841 873
           var info = response.data.data.info;
842
-          this.is_check = info.is_check;
874
+          
875
+         
876
+
843 877
           this.id = info.id;
844 878
           this.supplier_name = info.supplier_id;
845 879
           this.rate_of_concession = info.rate_of_concession;
@@ -862,6 +896,7 @@ export default {
862 896
             orderInfo[i].project_id = orderInfo[i].project_id;
863 897
             orderInfo[i].supply_unit = orderInfo[i].supply_unit;
864 898
             orderInfo[i].order_number = orderInfo[i].order_number;
899
+            orderInfo[i].min_price = ""
865 900
             orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2);
866 901
             if (orderInfo[i].is_source == 1) {
867 902
               for (let j = 0; j < drugList.length; j++) {
@@ -919,6 +954,7 @@ export default {
919 954
           this.recordInfo.tableList[i].supply_total_price.toString();
920 955
         this.recordInfo.tableList[i].supply_total =
921 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 959
         for (let j = 0; j < this.manufactuerList.length; j++) {
924 960
           if (
@@ -943,8 +979,9 @@ export default {
943 979
           this.loading = true;
944 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 985
              warehousing_id = 0
949 986
              for(let i=0;i<this.recordInfo.tableList.length;i++){
950 987
               this.recordInfo.tableList[i].id = 0
@@ -963,7 +1000,9 @@ export default {
963 1000
               this.showTwo = true;
964 1001
               var orderInfo = response.data.data.list;
965 1002
               var warehouseOut = response.data.data.warehouseOut;
1003
+              this.is_check = 2
966 1004
               this.warese_out_id = warehouseOut.id;
1005
+              console.log("采购单id2322332",this.warese_out_id)
967 1006
               this.good_number = warehouseOut.good_number;
968 1007
               this.rate_of_concession = warehouseOut.rate_of_concession;
969 1008
               this.discount_amount = warehouseOut.discount_amount;
@@ -993,23 +1032,13 @@ export default {
993 1032
                 if (orderInfo[i].is_source == 1) {
994 1033
                   for (let j = 0; j < this.drugList.length; j++) {
995 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,8 +1047,7 @@ export default {
1018 1047
                   for (let j = 0; j < this.goodList.length; j++) {
1019 1048
                     if (orderInfo[i].project_id == this.goodList[j].id) {
1020 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,7 +1075,7 @@ export default {
1047 1075
           this.recordInfo.tableList[i].supply_total_price.toString();
1048 1076
         this.recordInfo.tableList[i].supply_total =
1049 1077
           this.recordInfo.tableList[i].supply_total.toString();
1050
-
1078
+        this.recordInfo.tableList[i].min_price = this.recordInfo.tableList[i].min_price.toString()
1051 1079
         for (let j = 0; j < this.manufactuerList.length; j++) {
1052 1080
           if (
1053 1081
             this.recordInfo.tableList[i].supply_manufacturer ==
@@ -1097,11 +1125,14 @@ export default {
1097 1125
     },
1098 1126
     checkGoodOrder() {
1099 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 1132
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1103 1133
         if (response.data.state == 1) {
1104 1134
           this.$message.success("审核成功!");
1135
+          this.disabled = true
1105 1136
           this.is_check = 1
1106 1137
           this.showOne = false;
1107 1138
           this.showTwo = true;
@@ -1207,6 +1238,240 @@ export default {
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 1476
   created() {
1212 1477
     const tempObj = {};
@@ -1231,6 +1496,7 @@ export default {
1231 1496
     tempObj["order_number"] = "";
1232 1497
     tempObj["supply_expiry_date"] = "";
1233 1498
     tempObj["manufacturer_id"] = "";
1499
+    tempObj["min_price"] = ""
1234 1500
     this.recordInfo.tableList.push(tempObj);
1235 1501
     this.getInitOrder();
1236 1502
     if (parseInt(this.$route.query.id) > 0) {
@@ -1243,6 +1509,10 @@ export default {
1243 1509
 </script>
1244 1510
 
1245 1511
 <style rel="stylesheet/css" lang="scss" scoped>
1512
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
1513
+  width: 10px;
1514
+  height: 10px;
1515
+}
1246 1516
 .information {
1247 1517
   border: 1px #dcdfe6 solid;
1248 1518
   padding: 30px 20px 30px 20px;
@@ -1297,4 +1567,5 @@ export default {
1297 1567
   bottom: 20px;
1298 1568
   height: 100%;
1299 1569
 }
1570
+
1300 1571
 </style>

+ 16 - 2
src/xt_pages/supply/components/addGoodReturn.vue Parādīt failu

@@ -214,17 +214,20 @@
214 214
           <el-table-column label="采购金额" align="center" width="120px">
215 215
             <template slot-scope="scope">
216 216
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
217
+              <div style="visibility: hidden">/</div>
217 218
             </template>
218 219
           </el-table-column>
219 220
           <el-table-column label="折扣率" align="center" width="120px">
220 221
             <template slot-scope="scope">
221 222
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
223
+              <div style="visibility: hidden">/</div>
222 224
             </template>
223 225
           </el-table-column>
224 226
 
225 227
           <el-table-column label="折扣金额" align="center" width="120px">
226 228
             <template slot-scope="scope">
227 229
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
230
+              <div style="visibility: hidden">/</div>
228 231
             </template>
229 232
           </el-table-column>
230 233
 
@@ -683,6 +686,7 @@ export default {
683 686
         total_price += this.recordInfo.tableList[i].supply_price *this.recordInfo.tableList[i].supply_count;
684 687
       }
685 688
       this.total_price = total_price;
689
+      this.discount_amount = (this.total_price * this.rate_of_concession * 0.01).toFixed(2);
686 690
       return total_price.toFixed(2);
687 691
     },
688 692
 
@@ -702,8 +706,13 @@ export default {
702 706
         (this.total_price * 0.01)
703 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 718
     count_arrearage() {
@@ -1001,6 +1010,11 @@ export default {
1001 1010
   margin-top: 15px;
1002 1011
   margin-bottom: 15px;
1003 1012
 }
1013
+
1014
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
1015
+  width: 10px;
1016
+  height: 10px;
1017
+}
1004 1018
 </style>
1005 1019
 
1006 1020
 <style>

+ 296 - 145
src/xt_pages/supply/components/addPurchaseOrder.vue Parādīt failu

@@ -76,21 +76,26 @@
76 76
             @click="checkPurchaseOrder"
77 77
             v-show="showOne">审核
78 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 87
             size="small"
82 88
             type="primary"
83 89
             @click="checkReturnOrder"
84 90
             v-if="is_check == 1">反审核
85
-         </el-button> -->
91
+         </el-button>
86 92
          
87 93
           <el-button
88 94
             size="small"
89 95
             type="primary"
90 96
             @click="updatePurchaseOrder"
91
-            v-show="showOne"
92
-            >保存</el-button
93
-          >
97
+            v-show="showThree">保存
98
+          </el-button>
94 99
         </div>
95 100
       </div>
96 101
 
@@ -104,7 +109,7 @@
104 109
           :data="recordInfo.tableList"
105 110
           :class="signAndWeighBoxPatients"
106 111
           border
107
-          style="width:100%"
112
+          style="width: 100%"
108 113
           max-height="450"
109 114
         >
110 115
           <el-table-column align="center" width="200">
@@ -145,7 +150,7 @@
145 150
                 v-model="scope.row.supply_type"
146 151
                 style="width: 120px"
147 152
                 :disabled="true"
148
-                 placeholder="商品类别"
153
+                placeholder="商品类别"
149 154
               ></el-input>
150 155
               <div style="visibility: hidden">/</div>
151 156
             </template>
@@ -206,7 +211,7 @@
206 211
               <el-form-item
207 212
                 :prop="'tableList.' + scope.$index + '.supply_count'"
208 213
                 :rules="tableRules.supply_count"
209
-                 placeholder="请输入数量"
214
+                placeholder="请输入数量"
210 215
               >
211 216
                 <el-input
212 217
                   v-model="scope.row.supply_count"
@@ -224,7 +229,7 @@
224 229
                 v-model="scope.row.supply_price"
225 230
                 style="width: 80px"
226 231
                 :disabled="disabled"
227
-                 placeholder="请输入采购单价"
232
+                placeholder="请输入采购单价"
228 233
               ></el-input>
229 234
               <div style="visibility: hidden">/</div>
230 235
             </template>
@@ -233,6 +238,7 @@
233 238
           <el-table-column label="采购金额" align="center" width="120px">
234 239
             <template slot-scope="scope">
235 240
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
241
+              <div style="visibility: hidden">/</div>
236 242
             </template>
237 243
           </el-table-column>
238 244
 
@@ -317,18 +323,22 @@
317 323
             </template>
318 324
           </el-table-column>
319 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 342
       </el-form>
333 343
       <div style="margin-top: 10px">合计:{{ getAllPrice() }} 元</div>
334 344
       <div style="margin-top: 10px">
@@ -351,9 +361,7 @@
351 361
           ></el-input
352 362
         ></span>
353 363
       </div>
354
-      
355 364
     </div>
356
-    
357 365
   </div>
358 366
 </template>
359 367
 
@@ -365,7 +373,8 @@ import {
365 373
   savePurchaseOrder,
366 374
   updatePurchaseOrder,
367 375
   checkPurchaseOrder,
368
-  getReturnOrder
376
+  getReturnOrder,
377
+  getAllOrderCountList
369 378
 } from "@/api/supply";
370 379
 import { getDataConfig } from "@/utils/data";
371 380
 export default {
@@ -376,13 +385,14 @@ export default {
376 385
   },
377 386
   data() {
378 387
     return {
379
-      Reviewed:false,
388
+      Reviewed: false,
380 389
       crumbs: [
381 390
         { path: false, name: "采购订单" },
382 391
         { path: "/spply/query", name: "新增采购订单" },
383 392
       ],
384 393
       showTwo: true,
385 394
       showOne: false,
395
+      showThree:false,
386 396
       recordInfo: {
387 397
         tableList: [],
388 398
       },
@@ -435,104 +445,143 @@ export default {
435 445
       ],
436 446
       goodList: [{ id: 1, name: "" }],
437 447
       total_price: 0,
438
-      return_remark:"",
439
-      is_check:2,
448
+      return_remark: "",
449
+      is_check: 2,
440 450
     };
441 451
   },
442 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 585
     changeGoodName(val) {
537 586
       this.currentIndex = val;
538 587
     },
@@ -638,10 +687,9 @@ export default {
638 687
           var end = this.getTimes(this.end_time);
639 688
           const params = {
640 689
             stockIn: this.recordInfo.tableList,
641
-            return_remake:this.return_remark,
690
+            return_remake: this.return_remark,
642 691
           };
643 692
 
644
-         
645 693
           savePurchaseOrder(
646 694
             params,
647 695
             this.supplier_name,
@@ -655,15 +703,14 @@ export default {
655 703
               this.loading = false;
656 704
               this.$message.success("保存成功!");
657 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 710
               this.number = warehouseInfo.number;
664 711
               this.id = warehouseInfo.id;
665 712
               this.recordInfo.tableList = [];
666
-              this.return_remark = warehouseInfo.return_remake
713
+              this.return_remark = warehouseInfo.return_remake;
667 714
               var orderInfo = response.data.data.orderInfo;
668 715
               for (let i = 0; i < orderInfo.length; i++) {
669 716
                 if (orderInfo[i].is_source == 1) {
@@ -694,29 +741,30 @@ export default {
694 741
                 orderInfo[i].project_id = orderInfo[i].project_id;
695 742
                 orderInfo[i].supply_unit = orderInfo[i].supply_unit;
696 743
               }
697
-            
744
+
698 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 765
               this.showTwo = false;
719 766
               this.showOne = true;
767
+              this.showThree = true
720 768
             }
721 769
           });
722 770
         }
@@ -728,7 +776,7 @@ export default {
728 776
       var min_str = "";
729 777
       if (arr.length > 0) {
730 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 782
       if (total < min_number) {
@@ -807,9 +855,8 @@ export default {
807 855
           var end = this.getTimes(this.end_time);
808 856
           const params = {
809 857
             stockIn: this.recordInfo.tableList,
810
-            return_remake:this.return_remark,
858
+            return_remake: this.return_remark,
811 859
           };
812
-         
813 860
 
814 861
           updatePurchaseOrder(
815 862
             params,
@@ -838,9 +885,10 @@ export default {
838 885
           this.recordInfo.tableList[i].supply_count;
839 886
       }
840 887
       this.total_price = total_price;
888
+      this.discount_amount = (this.total_price * this.rate_of_concession * 0.01).toFixed(2);
841 889
       return total_price.toFixed(2);
842 890
     },
843
-     count_discount() {
891
+    count_discount() {
844 892
       this.rate_of_concession = (
845 893
         this.discount_amount /
846 894
         (this.total_price * 0.01)
@@ -857,9 +905,12 @@ export default {
857 905
             if (response.data.state == 1) {
858 906
               var info = response.data.data.info;
859 907
               this.is_check = info.is_check
908
+              this.showOne = false
909
+              this.showTwo = false
910
+              this.showThree = true
860 911
               this.disabled = true;
861 912
               this.$message.success("审核成功!");
862
-              this.Reviewed = true
913
+              this.Reviewed = true;
863 914
             }
864 915
           });
865 916
         })
@@ -888,12 +939,112 @@ export default {
888 939
         if (response.data.state == 1) {
889 940
           var msg = response.data.data.msg;
890 941
           this.disabled = false;
891
-          this.showOne = true
892
-          this.is_check =2 
942
+          this.showOne = true;
943
+          this.is_check = 2;
893 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 1050
   created() {
@@ -945,7 +1096,7 @@ export default {
945 1096
   margin-top: 15px;
946 1097
   margin-bottom: 15px;
947 1098
 }
948
-.reviewImg{
1099
+.reviewImg {
949 1100
   position: fixed;
950 1101
   left: 50%;
951 1102
   transform: translateX(-50%);
@@ -953,8 +1104,8 @@ export default {
953 1104
 }
954 1105
 
955 1106
 /deep/ .el-table__body-wrapper::-webkit-scrollbar {
956
-width:10px;
957
-height:10px;
1107
+  width: 10px;
1108
+  height: 10px;
958 1109
 }
959 1110
 </style>
960 1111
 

+ 7 - 4
src/xt_pages/supply/components/addSupply.vue Parādīt failu

@@ -92,14 +92,14 @@
92 92
           <!-- 联系人填写 -->
93 93
           <el-table-column label="联系人" align="center" width="130">
94 94
             <template slot="header" slot-scope="scope">
95
-              <span>联系人<span style="color: red">*</span></span>
95
+              <span>联系人</span>
96 96
             </template>
97 97
             <!-- tableRules.name -->
98 98
             <template slot-scope="scope">
99 99
               <el-form-item
100 100
                 :prop="'contacts.' + scope.$index + '.name'"
101 101
                 :rules="
102
-                  scope.row.name != ''
102
+                  scope.row.name == ''
103 103
                     ? [
104 104
                         {
105 105
                           required: 'true',
@@ -318,8 +318,11 @@ export default {
318 318
         this.title = "编辑供应商";
319 319
         this.supplier.supplierCode = data.SupplierCode;
320 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 326
         this.supplier.vatRate = data.VatRate;
324 327
         this.supplier.number = data.Number;
325 328
         this.supplier.bank = data.Bank;

+ 287 - 160
src/xt_pages/supply/components/editGoodOrder.vue Parādīt failu

@@ -12,8 +12,9 @@
12 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 18
           <el-select
18 19
             v-model="supplier_name"
19 20
             style="width: 140px; margin-right: 10px"
@@ -42,15 +43,12 @@
42 43
             value-format="yyyy-MM-dd"
43 44
             :disabled="disabled"
44 45
           ></el-date-picker>
45
-    
46
+
46 47
           <span>单据编码:{{ good_number }}</span>
47 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 52
           <el-button
55 53
             size="small"
56 54
             type="primary"
@@ -239,6 +237,18 @@
239 237
             </template>
240 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 252
           <el-table-column label="采购单价" align="center" width="180px">
243 253
             <template slot-scope="scope">
244 254
               <el-input
@@ -251,6 +261,8 @@
251 261
             </template>
252 262
           </el-table-column>
253 263
 
264
+      
265
+
254 266
           <el-table-column label="采购金额" align="center" width="120px">
255 267
             <template slot-scope="scope">
256 268
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
@@ -265,7 +277,6 @@
265 277
               <el-form-item
266 278
                 :prop="'tableList.' + scope.$index + '.supply_product_date'"
267 279
                 :rules="tableRules.supply_product_date"
268
-
269 280
               >
270 281
                 <el-date-picker
271 282
                   prefix-icon="el-icon-date"
@@ -379,7 +390,7 @@
379 390
             :rows="2"
380 391
             placeholder="备注信息"
381 392
             v-model="return_remark"
382
-           :disabled="disabled"
393
+            :disabled="disabled"
383 394
           >
384 395
           </el-input>
385 396
         </div>
@@ -435,12 +446,20 @@
435 446
         ></span>
436 447
       </div>
437 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 458
   </div>
440 459
 </template>
441 460
 
442 461
 <script>
443
-import popup from "./Popup"
462
+import popup from "./Popup";
444 463
 import Computed from "../../components/Computed/index_1.vue";
445 464
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
446 465
 import { uParseTime } from "@/utils/tools";
@@ -454,7 +473,7 @@ import {
454 473
   MofyGoodOrder,
455 474
   UpdateSupplyWahouseingInfo,
456 475
   getSupplyWarehouseOutById,
457
-  deleteGoodOrderById
476
+  deleteGoodOrderById,
458 477
 } from "@/api/supply";
459 478
 
460 479
 export default {
@@ -470,17 +489,15 @@ export default {
470 489
         { path: false, name: "采购单" },
471 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 497
       showOne: true,
479 498
       showTwo: false,
480 499
       showThree: false,
481
-      recordInfo: {
482
-        tableList: [],
483
-      },
500
+      recordInfo: {tableList: []},
484 501
       keywords: "",
485 502
       total: 0,
486 503
       multipleSelection: [],
@@ -490,7 +507,7 @@ export default {
490 507
       page: 1,
491 508
       limit: 10,
492 509
       goodType: [],
493
-       Reviewed: false,
510
+      Reviewed: false,
494 511
       goodInfo: [],
495 512
       org_id: 0,
496 513
       types: [],
@@ -539,15 +556,14 @@ export default {
539 556
       orderInfo: [],
540 557
       warese_out_id: 0,
541 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 569
   methods: {
@@ -581,10 +597,33 @@ export default {
581 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 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 627
             drugList[i].supply_count = "";
589 628
             drugList[i].supply_total_price = "";
590 629
             drugList[i].supply_manufacturer = drugList[i].manufacturer;
@@ -593,6 +632,7 @@ export default {
593 632
             drugList[i].type = 1;
594 633
             drugList[i].supply_price = drugList[i].last_price;
595 634
             drugList[i].name = drugList[i].drug_name;
635
+            drugList[i].min_price = drugList[i].min_price
596 636
             if (drugList[i].max_unit != drugList[i].min_unit) {
597 637
               drugList[i].unitList = [
598 638
                 { id: 1, name: "" },
@@ -631,11 +671,19 @@ export default {
631 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 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 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 687
             goodList[i].supply_count = "";
640 688
             goodList[i].supply_total_price = "";
641 689
             goodList[i].supply_manufacturer = goodList[i].manufacturer;
@@ -647,6 +695,7 @@ export default {
647 695
             goodList[i].supply_unit = goodList[i].packing_unit;
648 696
             goodList[i].warehouse_info_id = 0;
649 697
             goodList[i].warehousing_id = 0;
698
+            goodList[i].min_price = goodList[i].retail_price
650 699
             for (let j = 0; j < goodList[i].unitList.length; j++) {
651 700
               goodList[i].unitList[0].name = goodList[i].packing_unit;
652 701
             }
@@ -667,10 +716,9 @@ export default {
667 716
           this.recordInfo.tableList[i].name = val.name;
668 717
           this.recordInfo.tableList[i].supply_name = val.supply_name;
669 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 720
           this.recordInfo.tableList[i].supply_total = val.supply_total;
673
-
721
+          this.recordInfo.tableList[i].min_price = val.min_price  
674 722
           if (val.supply_count == NaN) {
675 723
             this.recordInfo.tableList[i].supply_count = "";
676 724
           } else {
@@ -700,6 +748,10 @@ export default {
700 748
       }
701 749
     },
702 750
     handleEdit() {
751
+      if (this.is_check == 1) {
752
+        this.$message.error("已审核的不能新增!");
753
+        return false;
754
+      }
703 755
       const tempObj = {};
704 756
       tempObj["id"] = 0;
705 757
       tempObj["name"] = "";
@@ -726,41 +778,43 @@ export default {
726 778
       tempObj["warehousing_id"] = "";
727 779
       tempObj["number"] = "";
728 780
       tempObj["good_number"] = "";
781
+      tempObj["min_price"] = ""
729 782
       this.recordInfo.tableList.push(tempObj);
730 783
     },
731 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 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 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 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 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,10 +875,10 @@ export default {
821 875
           this.recordInfo.tableList[i].supply_count;
822 876
       }
823 877
       this.total_price = total_price;
824
-      this.addressChange()
878
+      this.addressChange();
825 879
       return total_price.toFixed(2);
826 880
     },
827
-       addressChange() {
881
+    addressChange() {
828 882
       var discount_amount = 0;
829 883
       if (this.rate_of_concession > 0) {
830 884
         discount_amount = (
@@ -841,24 +895,34 @@ export default {
841 895
       ).toFixed(2);
842 896
     },
843 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 910
     count_arrearage() {
848
-      this.payment = this.total_price - this.arrearage;
911
+      this.payment = (this.total_price - this.arrearage).toFixed(2);
849 912
     },
850 913
     checkPurchaseOrder(id, index) {
851 914
       this.$confirm("是否审核?", {
852 915
         confirmButtonText: "确 定",
853 916
         cancelButtonText: "取 消",
854 917
         type: "warning",
855
-      }).then(() => {
918
+      })
919
+        .then(() => {
856 920
           checkPurchaseOrder(this.id).then((response) => {
857 921
             if (response.data.state == 1) {
858 922
               var info = response.data.data.info;
859 923
               this.disabled = true;
860 924
               this.$message.success("审核成功!");
861
-              this.getPurchaseOrderDetail();
925
+              // this.getPurchaseOrderDetail();
862 926
             }
863 927
           });
864 928
         })
@@ -874,7 +938,7 @@ export default {
874 938
             this.showOne = false;
875 939
             this.showTwo = true;
876 940
             this.showThree = true;
877
-            this.disabled = true
941
+            this.disabled = true;
878 942
             this.Reviewed = true;
879 943
           }
880 944
 
@@ -893,6 +957,7 @@ export default {
893 957
           var drugList = response.data.data.drugList;
894 958
           var goodList = response.data.data.goodList;
895 959
           for (let i = 0; i < orderInfo.length; i++) {
960
+            orderInfo[i].id = orderInfo[i].id
896 961
             orderInfo[i].supply_count = orderInfo[i].count;
897 962
             orderInfo[i].supply_price = orderInfo[i].price;
898 963
             orderInfo[i].supply_remake = orderInfo[i].remark;
@@ -900,9 +965,7 @@ export default {
900 965
             orderInfo[i].project_id = orderInfo[i].project_id;
901 966
             orderInfo[i].supply_unit = orderInfo[i].supply_unit;
902 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 969
             orderInfo[i].supply_expiry_date = this.getTimes(
907 970
               orderInfo[i].supply_expiry_date
908 971
             );
@@ -936,13 +999,46 @@ export default {
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 1037
           this.recordInfo.tableList = [];
941 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 1044
     toPrint() {
@@ -959,16 +1055,27 @@ export default {
959 1055
         this.recordInfo.tableList[i].supply_count = parseInt(
960 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 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,19 +1087,20 @@ export default {
980 1087
           var params = {
981 1088
             stockIn: this.recordInfo.tableList,
982 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 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 1099
               this.number = ""
992 1100
              }
993 1101
           }
994 1102
           console.log("param23322332323",params)
995
-          return
1103
+         
996 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 1105
             if (response.data.state == 1) {
998 1106
               this.loading = false;
@@ -1005,14 +1113,17 @@ export default {
1005 1113
     checkGoodOrder() {
1006 1114
       var id = this.$route.query.id;
1007 1115
       var warehousing_id = this.$route.query.warehousing_id;
1116
+      console.log("采购单ID",id)
1117
+      console.log("采购订单ID",warehousing_id)
1008 1118
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1009 1119
         if (response.data.state == 1) {
1010 1120
           this.$message.success("审核成功!");
1011
-          this.is_check = 1
1121
+          this.is_check = 1;
1012 1122
           this.showOne = false;
1013 1123
           this.showTwo = true;
1014 1124
           this.showThree = true;
1015 1125
           var purcaseOrder = response.data.data.purcaseOrder;
1126
+          this.Reviewed = true;
1016 1127
           console.log("采购订单", purcaseOrder);
1017 1128
 
1018 1129
           var goodOrder = response.data.data.goodOrder;
@@ -1035,7 +1146,8 @@ export default {
1035 1146
             for (let j = 0; j < drugList.length; j++) {
1036 1147
               if (goodOrder[i].is_source == 1) {
1037 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,20 +1193,20 @@ export default {
1081 1193
                   if (purcaseOrder[i].project_id == newArr[j].project_id) {
1082 1194
                     //根据商品ID比较数量大小,把数量不足的商品ID储存,表示采购单的数量未满足采购订单的数据,部分入库
1083 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 1201
               //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成,全部入库
1090
-              console.log("审核23232323323",arr)
1202
+              console.log("审核23232323323", arr);
1091 1203
               if (arr.length == 0) {
1092
-                 is_warehouse = 1;
1204
+                is_warehouse = 1;
1093 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 1211
                 is_warehouse = 3;
1100 1212
                 this.ModefySupplyWarehousing(is_warehouse, warehousing_id);
@@ -1126,46 +1238,51 @@ export default {
1126 1238
         if (response.data.state == 1) {
1127 1239
           var cancelList = response.data.data.cancelList;
1128 1240
           console.log("退库单", cancelList);
1129
-           var drugList = response.data.data.drugList;
1241
+          var drugList = response.data.data.drugList;
1130 1242
           console.log("药品列表", drugList);
1131 1243
           var cancelOrderList = response.data.data.cancelOrderList;
1132 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 1251
           if (cancelList.length > 0) {
1138 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 1284
             let objInfo = {};
1168
-            if(cancelOrderList.length >0){
1285
+            if (cancelOrderList.length > 0) {
1169 1286
               cancelOrderList.forEach((item, index) => {
1170 1287
                 let { project_id } = item;
1171 1288
                 if (!objInfo[project_id]) {
@@ -1176,57 +1293,56 @@ export default {
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 1299
               for (let i = 0; i < cancelOrderList.length; i++) {
1183 1300
                 for (let j = 0; j < newArr.length; j++) {
1184 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 1348
     MofyGoodOrder() {
@@ -1241,14 +1357,16 @@ export default {
1241 1357
           var msg = response.data.data.msg;
1242 1358
           if (msg == 1) {
1243 1359
             this.$message.success("反审核成功!");
1360
+            this.disabled = false
1361
+            this.Reviewed = false
1244 1362
             return
1245 1363
           }
1246 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 1372
           var purcaseOrder = response.data.data.purcaseOrder;
@@ -1260,13 +1378,16 @@ export default {
1260 1378
           var ids = "";
1261 1379
           // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
1262 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 1385
           for (let i = 0; i < purcaseOrder.length; i++) {
1266 1386
             for (let j = 0; j < drugList.length; j++) {
1267 1387
               if (purcaseOrder[i].is_source == 1) {
1268 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,7 +1397,8 @@ export default {
1276 1397
             for (let j = 0; j < drugList.length; j++) {
1277 1398
               if (goodOrder[i].is_source == 1) {
1278 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,6 +1498,7 @@ export default {
1376 1498
     tempObj["warehousing_id"] = "";
1377 1499
     tempObj["number"] = "";
1378 1500
     tempObj["good_number"] = "";
1501
+    tempObj["min_price"] = ""
1379 1502
     this.recordInfo.tableList.push(tempObj);
1380 1503
     this.getInitOrder();
1381 1504
     if (parseInt(this.$route.query.id) > 0) {
@@ -1412,6 +1535,10 @@ export default {
1412 1535
   margin-top: 15px;
1413 1536
   margin-bottom: 15px;
1414 1537
 }
1538
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
1539
+  width: 10px;
1540
+  height: 10px;
1541
+}
1415 1542
 </style>
1416 1543
 
1417 1544
 <style>

+ 229 - 150
src/xt_pages/supply/components/editGoodReturn.vue Parādīt failu

@@ -59,9 +59,23 @@
59 59
           <span>单据编码:{{ number }}</span>
60 60
         </div>
61 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 79
         </div>
66 80
       </div>
67 81
 
@@ -118,6 +132,7 @@
118 132
                 :disabled="true"
119 133
                 placeholder="商品类别"
120 134
               ></el-input>
135
+              <div style="visibility: hidden">/</div>
121 136
             </template>
122 137
           </el-table-column>
123 138
           <el-table-column label="规格&单位" align="center" width="200px">
@@ -128,6 +143,7 @@
128 143
                 :disabled="true"
129 144
                 placeholder="规格&单位"
130 145
               ></el-input>
146
+              <div style="visibility: hidden">/</div>
131 147
             </template>
132 148
           </el-table-column>
133 149
 
@@ -164,6 +180,7 @@
164 180
                 style="width: 100px"
165 181
                 :disabled="true"
166 182
               ></el-input>
183
+              <div style="visibility: hidden">/</div>
167 184
             </template>
168 185
           </el-table-column>
169 186
           <el-table-column label="可退数量" align="center" width="200px">
@@ -173,6 +190,7 @@
173 190
                 style="width: 150px"
174 191
                 :disabled="true"
175 192
               ></el-input>
193
+              <div style="visibility: hidden">/</div>
176 194
             </template>
177 195
           </el-table-column>
178 196
           <el-table-column label="数量" align="center" width="120px">
@@ -202,23 +220,27 @@
202 220
                 :disabled="disabled"
203 221
                 placeholder="请输入采购单价"
204 222
               ></el-input>
223
+              <div style="visibility: hidden">/</div>
205 224
             </template>
206 225
           </el-table-column>
207 226
 
208 227
           <el-table-column label="采购金额" align="center" width="120px">
209 228
             <template slot-scope="scope">
210 229
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
230
+              <div style="visibility: hidden">/</div>
211 231
             </template>
212 232
           </el-table-column>
213 233
           <el-table-column label="折扣率" align="center" width="120px">
214 234
             <template slot-scope="scope">
215 235
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
236
+              <div style="visibility: hidden">/</div>
216 237
             </template>
217 238
           </el-table-column>
218 239
 
219 240
           <el-table-column label="折扣金额" align="center" width="120px">
220 241
             <template slot-scope="scope">
221 242
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
243
+              <div style="visibility: hidden">/</div>
222 244
             </template>
223 245
           </el-table-column>
224 246
 
@@ -229,6 +251,7 @@
229 251
                 style="width: 160px"
230 252
                 :disabled="true"
231 253
               ></el-input>
254
+              <div style="visibility: hidden">/</div>
232 255
             </template>
233 256
           </el-table-column>
234 257
 
@@ -239,6 +262,7 @@
239 262
                 style="width: 160px"
240 263
                 :disabled="true"
241 264
               ></el-input>
265
+              <div style="visibility: hidden">/</div>
242 266
             </template>
243 267
           </el-table-column>
244 268
 
@@ -249,6 +273,7 @@
249 273
                 style="width: 160px"
250 274
                 :disabled="true"
251 275
               ></el-input>
276
+              <div style="visibility: hidden">/</div>
252 277
             </template>
253 278
           </el-table-column>
254 279
 
@@ -260,6 +285,7 @@
260 285
                 :disabled="disabled"
261 286
                 placeholder="请输入备注"
262 287
               ></el-input>
288
+              <div style="visibility: hidden">/</div>
263 289
             </template>
264 290
           </el-table-column>
265 291
 
@@ -311,6 +337,13 @@
311 337
         >
312 338
         </el-input>
313 339
       </div>
340
+        <!-- 审核水印 -->
341
+        <img
342
+          src="@/assets/purchase/Reviewed.png"
343
+          alt="正在加载..."
344
+          class="reviewImg"
345
+          v-show="Reviewed == true"
346
+        />
314 347
       <div style="margin-top: 10px">合计:{{ getAllPrice() }} 元</div>
315 348
       <div style="margin-top: 10px">
316 349
         <span
@@ -375,7 +408,7 @@ import {
375 408
   updateGoodReturn,
376 409
   checkReturnOrder,
377 410
   deleteReturnOrderById,
378
-  modefyReturnOrder
411
+  modefyReturnOrder,
379 412
 } from "@/api/supply";
380 413
 export default {
381 414
   name: "addPurchaseOrder",
@@ -387,7 +420,7 @@ export default {
387 420
       tipsInfo: "",
388 421
       crumbs: [
389 422
         { path: false, name: "退货单" },
390
-        { path: "/good/return/add", name: "新增退货单" },
423
+        { path: "/good/return/add", name: "编辑退货单" },
391 424
       ],
392 425
       showTwo: true,
393 426
       showOne: false,
@@ -410,6 +443,7 @@ export default {
410 443
       form: {
411 444
         manufacturer_id: "",
412 445
       },
446
+      Reviewed:false,
413 447
       tabList: [],
414 448
       manufactuerList: [],
415 449
       currentIndex: 0,
@@ -599,6 +633,10 @@ export default {
599 633
       }
600 634
     },
601 635
     handleEdit() {
636
+      if (this.is_check == 1) {
637
+        this.$message.error("已审核的不能新增!");
638
+        return false;
639
+      }
602 640
       const tempObj = {};
603 641
       tempObj["id"] = 0;
604 642
       tempObj["name"] = "";
@@ -616,17 +654,17 @@ export default {
616 654
       tempObj["is_total"] = 1;
617 655
       tempObj["project_id"] = 0;
618 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 664
       this.recordInfo.tableList.push(tempObj);
627 665
     },
628 666
     handleDelete: function (index, row) {
629
-      if(row.id == 0){
667
+      if (row.id == 0) {
630 668
         if (this.recordInfo.tableList.length <= 1) {
631 669
           this.$message.error("只有一条记录的时候无法删除");
632 670
           return;
@@ -634,29 +672,29 @@ export default {
634 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 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 699
     getWarehoseInfo(arr, max_unit, min_unit, min_number) {
662 700
       var total = 0;
@@ -791,9 +829,15 @@ export default {
791 829
         this.discount_amount /
792 830
         (this.total_price * 0.01)
793 831
       ).toFixed(2);
832
+
794 833
     },
795 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 843
     count_arrearage() {
@@ -818,66 +862,69 @@ export default {
818 862
         })
819 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,66 +938,87 @@ export default {
891 938
       var id = this.$route.query.id;
892 939
       this.$router.push({ path: "/purchase/order/print?&id=" + id });
893 940
     },
894
-    updateGoodReturn(){
941
+    updateGoodReturn() {
895 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 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 1024
   created() {
@@ -971,12 +1039,12 @@ export default {
971 1039
     tempObj["is_total"] = 1;
972 1040
     tempObj["project_id"] = 0;
973 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 1048
     this.recordInfo.tableList.push(tempObj);
981 1049
     this.getInitOrder();
982 1050
     //获取购货单列表
@@ -1010,6 +1078,11 @@ export default {
1010 1078
   margin-top: 15px;
1011 1079
   margin-bottom: 15px;
1012 1080
 }
1081
+
1082
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
1083
+  width: 10px;
1084
+  height: 10px;
1085
+}
1013 1086
 </style>
1014 1087
 
1015 1088
 <style>
@@ -1040,4 +1113,10 @@ export default {
1040 1113
   bottom: 20px;
1041 1114
   height: 100%;
1042 1115
 }
1116
+.reviewImg {
1117
+  position: fixed;
1118
+  left: 50%;
1119
+  transform: translateX(-50%);
1120
+  top: 30%;
1121
+}
1043 1122
 </style>

+ 32 - 2
src/xt_pages/supply/components/editPurchaseOrder.vue Parādīt failu

@@ -12,7 +12,7 @@
12 12
           align-items: center;
13 13
         "
14 14
       >
15
-        <div>
15
+        <div style="display:flex;align-items: center;">
16 16
           <span style="color: red">*</span><span>供应商:</span>
17 17
           <el-select
18 18
             v-model="supplier_name"
@@ -317,6 +317,7 @@
317 317
             :rows="2"
318 318
             placeholder="备注信息"
319 319
             v-model="return_remark"
320
+            :disabled="disabled"
320 321
           >
321 322
           </el-input>
322 323
         </div>
@@ -894,7 +895,30 @@ export default {
894 895
           }
895 896
          
896 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,6 +1124,10 @@ export default {
1100 1124
   margin-top: 15px;
1101 1125
   margin-bottom: 15px;
1102 1126
 }
1127
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
1128
+  width: 10px;
1129
+  height: 10px;
1130
+}
1103 1131
 </style>
1104 1132
 
1105 1133
 <style>
@@ -1136,4 +1164,6 @@ export default {
1136 1164
   transform: translateX(-50%);
1137 1165
   top: 30%;
1138 1166
 }
1167
+
1168
+
1139 1169
 </style>

+ 4 - 0
src/xt_pages/supply/goodOrderQuery.vue Parādīt failu

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

+ 5 - 0
src/xt_pages/supply/goodreturn.vue Parādīt failu

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

+ 5 - 1
src/xt_pages/supply/purchaseOrderQuery.vue Parādīt failu

@@ -105,7 +105,7 @@
105 105
           <template slot-scope="scope">
106 106
             <div style="width: 100%; height: 100%">
107 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 109
               </tr>
110 110
 
111 111
             </div>
@@ -438,6 +438,10 @@ tr:last-child {
438 438
   margin-top: 15px;
439 439
   margin-bottom: 15px;
440 440
 }
441
+/deep/ .el-table__body-wrapper::-webkit-scrollbar {
442
+  width: 10px;
443
+  height: 10px;
444
+}
441 445
 </style>
442 446
 
443 447
 <style>

+ 4 - 0
src/xt_pages/supply/supplyQuery.vue Parādīt failu

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