Browse Source

11月14日 库存扣减更新

XMLWAN 3 years ago
parent
commit
b70beae7fe

+ 2 - 2
src/api/supply.js View File

@@ -322,9 +322,9 @@ export function deleteReturnOrder(id, params) {
322 322
   })
323 323
 }
324 324
 
325
-export function deleteReturnOrderById(id, params) {
325
+export function deleteReturnOrderById(params) {
326 326
   return request({
327
-    url: '/api/supply/deletereturnorderbyid?id=' + id,
327
+    url: '/api/supply/deletereturnorderbyid',
328 328
     method: 'get',
329 329
     params: params
330 330
   })

+ 2 - 2
src/views/layout/Layout.vue View File

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

+ 7 - 7
src/xt_pages/dialysis/details/DialysisPrescription.vue View File

@@ -56,7 +56,7 @@
56 56
         <li v-if=" isShow('总量') && getValueStr('anticoagulant', 'anticoagulant') != 5 " >
57 57
           <label>总量: </label>
58 58
           <span class="content" v-if="getValueStr('anticoagulant', 'anticoagulant') != 1">{{anticoagulant_zongliang != "0" ? anticoagulant_zongliang : ""}}</span>
59
-          <span v-if="this.$store.getters.xt_user.template_info.org_id != 10101">
59
+          <span v-if="this.$store.getters.xt_user.template_info.org_id != 10101 && this.$store.getters.xt_user.template_info.template_id !=45">
60 60
             <span class="content" v-if="getValueStr('anticoagulant', 'anticoagulant') == 1" ></span>
61 61
             <span class="unit" v-if="getValueStr('anticoagulant', 'anticoagulant') == 2 && this.$store.getters.xt_user.template_info.template_id != 13 &&  this.$store.getters.xt_user.template_info.template_id != 23 &&  this.$store.getters.xt_user.template_info.template_id != 40 &&  this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.org_id != 10234">{{ anticoagulant_zongliang != "0" ? "iu" : "" }}</span>
62 62
             <span class="unit" v-if="getValueStr('anticoagulant', 'anticoagulant') == 2 && (this.$store.getters.xt_user.template_info.template_id == 13 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 40 || this.$store.getters.xt_user.template_info.template_id == 38 || this.$store.getters.xt_user.template_info.org_id == 10234 )">{{ anticoagulant_zongliang != "0" ? "mg" : "" }}</span>
@@ -145,10 +145,10 @@
145 145
         <li v-if=" isShow('首剂') && getValueStr('anticoagulant', 'anticoagulant') != 5 " >
146 146
           <label>首剂 : </label>
147 147
           <span class="content" v-if="getValueStr('anticoagulant', 'anticoagulant') != 1">{{ anticoagulant_shouji != "0" ? anticoagulant_shouji : "" }}</span>
148
-          <span v-if="this.$store.getters.xt_user.template_info.org_id != 10101">
148
+          <span v-if="this.$store.getters.xt_user.template_info.org_id != 10101 && this.$store.getters.xt_user.template_info.template_id != 45">
149 149
             <span class="content" v-if="getValueStr('anticoagulant', 'anticoagulant') == 1" ></span>
150
-            <span class="unit"  v-if="getValueStr('anticoagulant', 'anticoagulant') == 2  && this.$store.getters.xt_user.template_info.template_id != 13  && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 40 && this.$store.getters.xt_user.template_info.template_id != 38  && this.$store.getters.xt_user.template_info.template_id != 45">{{ anticoagulant_shouji != "0" ? "iu" : "" }}</span>
151
-            <span class="unit"  v-if="getValueStr('anticoagulant', 'anticoagulant') == 2  && (this.$store.getters.xt_user.template_info.template_id == 13 ||  this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 40 || this.$store.getters.xt_user.template_info.template_id == 38  || this.$store.getters.xt_user.template_info.template_id == 45)" >{{ anticoagulant_shouji != "0" ? "mg" : "" }}</span>
150
+            <span class="unit"  v-if="getValueStr('anticoagulant', 'anticoagulant') == 2  && this.$store.getters.xt_user.template_info.template_id != 13  && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 40 && this.$store.getters.xt_user.template_info.template_id != 38 ">{{ anticoagulant_shouji != "0" ? "iu" : "" }}</span>
151
+            <span class="unit"  v-if="getValueStr('anticoagulant', 'anticoagulant') == 2  && (this.$store.getters.xt_user.template_info.template_id == 13 ||  this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 40 || this.$store.getters.xt_user.template_info.template_id == 38)" >{{ anticoagulant_shouji != "0" ? "mg" : "" }}</span>
152 152
             <span class="unit" v-if="getValueStr('anticoagulant', 'anticoagulant') == 3">{{ anticoagulant_shouji != "0" ? "iu" : "" }}</span>
153 153
             <span class="unit" v-if="getValueStr('anticoagulant', 'anticoagulant') == 1" >{{ anticoagulant_shouji != "0" ? "mg" : "" }}</span>
154 154
             <span class="unit" v-if="getValueStr('anticoagulant', 'anticoagulant') == 4" >{{ anticoagulant_shouji != "0" ? "mg" : "" }}</span >
@@ -241,10 +241,10 @@
241 241
         <li v-if="isShow('维持') && getValueStr('anticoagulant', 'anticoagulant') != 5">
242 242
           <label>维持 : </label>
243 243
           <span class="content" v-if="getValueStr('anticoagulant', 'anticoagulant') != 1">{{ anticoagulant_weichi != "0" ? anticoagulant_weichi : "" }}</span>
244
-          <span v-if="this.$store.getters.xt_user.template_info.org_id != 10101">
244
+          <span v-if="this.$store.getters.xt_user.template_info.org_id != 10101 && this.$store.getters.xt_user.template_info.template_id != 45">
245 245
             <span class="content" v-if="getValueStr('anticoagulant', 'anticoagulant') == 1"></span>
246
-            <span class="unit" v-if="getValueStr('anticoagulant', 'anticoagulant') == 2 && this.$store.getters.xt_user.template_info.template_id != 13 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 40 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.template_id != 45">{{ anticoagulant_weichi != "0" ? "iu/h" : "" }}</span>
247
-            <span class="unit" v-if="getValueStr('anticoagulant', 'anticoagulant') == 2 && (this.$store.getters.xt_user.template_info.template_id == 13 ||  this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 40 || this.$store.getters.xt_user.template_info.template_id == 38 ||  this.$store.getters.xt_user.template_info.template_id == 45)">{{ anticoagulant_weichi != "0" ? "mg/h" : "" }}</span>
246
+            <span class="unit" v-if="getValueStr('anticoagulant', 'anticoagulant') == 2 && this.$store.getters.xt_user.template_info.template_id != 13 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 40 && this.$store.getters.xt_user.template_info.template_id != 38 ">{{ anticoagulant_weichi != "0" ? "iu/h" : "" }}</span>
247
+            <span class="unit" v-if="getValueStr('anticoagulant', 'anticoagulant') == 2 && (this.$store.getters.xt_user.template_info.template_id == 13 ||  this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 40 || this.$store.getters.xt_user.template_info.template_id == 38)">{{ anticoagulant_weichi != "0" ? "mg/h" : "" }}</span>
248 248
             <span class="unit" v-if="getValueStr('anticoagulant', 'anticoagulant') == 3">{{ anticoagulant_weichi != "0" ? "iu/h" : "" }}</span>
249 249
             <span class="unit" v-if="getValueStr('anticoagulant', 'anticoagulant') == 1">{{ anticoagulant_weichi != "0" ? "mg/h" : "" }}</span>
250 250
             <span class="unit" v-if="getValueStr('anticoagulant', 'anticoagulant') == 4">{{ anticoagulant_weichi != "0" ? "mg/h" : "" }}</span>

+ 17 - 10
src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue View File

@@ -201,9 +201,9 @@
201 201
 
202 202
                     <el-col :span="8" v-if="anticoagulant.shouji != -1 && isShows('首剂')">
203 203
                         <div v-if="this.$store.getters.xt_user.template_info.org_id != 10157">
204
-                          <div v-if="this.$store.getters.xt_user.template_info.org_id != 10101">
204
+                          <div v-if="this.$store.getters.xt_user.template_info.org_id != 10101 && this.$store.getters.xt_user.template_info.template_id != 45">
205 205
                             <el-form-item
206
-                                    v-if='this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.org_id != 9987  && this.$store.getters.xt_user.template_info.template_id != 45'
206
+                                    v-if='this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.org_id != 9987'
207 207
                                     :label="'首剂(' + anticoagulant.shouji_unit + ') : '">
208 208
                                 <el-input type="number" v-if="dialysisPrescription.anticoagulant != 1"
209 209
                                           v-model="dialysisPrescription.anticoagulant_shouji"></el-input>
@@ -212,14 +212,18 @@
212 212
                             </el-form-item>
213 213
 
214 214
                             <el-form-item
215
-                                    v-if='this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 38 || this.$store.getters.xt_user.template_info.template_id == 45 || this.$store.getters.xt_user.template_info.org_id == 9987'
215
+                                    v-if='dialysisPrescription.anticoagulant == 2 && this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 38 || this.$store.getters.xt_user.template_info.org_id == 9987 && dialysisPrescription.anticoagulant == 2'
216 216
                                     :label="'首剂(mg) : '">
217 217
                                 <el-input type="number" v-if="dialysisPrescription.anticoagulant != 1"
218 218
                                           v-model="dialysisPrescription.anticoagulant_shouji"></el-input>
219 219
                                 <el-input type="number" disabled v-if="dialysisPrescription.anticoagulant == 1"
220 220
                                           v-model="dialysisPrescription.no_anticoagulant_shouji"></el-input>
221 221
                             </el-form-item>
222
+
223
+                           
224
+
222 225
                           </div>
226
+
223 227
                           <div v-else>
224 228
                             <el-form-item v-if="dialysisPrescription.anticoagulant == 2" :label="'首剂(mg) : '">
225 229
                                 <el-input type="number" v-if="dialysisPrescription.anticoagulant != 1"
@@ -242,12 +246,14 @@
242 246
                                 <el-input type="number" disabled v-if="dialysisPrescription.anticoagulant == 1"
243 247
                                           v-model="dialysisPrescription.no_anticoagulant_shouji"></el-input>
244 248
                             </el-form-item>
249
+                          
245 250
                             <el-form-item v-else :label="'首剂(' + anticoagulant.shouji_unit + ') : '">
246 251
                                 <el-input type="number" v-if="dialysisPrescription.anticoagulant != 1"
247 252
                                           v-model="dialysisPrescription.anticoagulant_shouji"></el-input>
248 253
                                 <el-input type="number" disabled v-if="dialysisPrescription.anticoagulant == 1"
249 254
                                           v-model="dialysisPrescription.no_anticoagulant_shouji"></el-input>
250 255
                             </el-form-item>
256
+                            
251 257
                         </div>
252 258
 
253 259
                     </el-col>
@@ -255,16 +261,16 @@
255 261
 
256 262
                     <el-col :span="8" v-if="anticoagulant.weichi != -1 && isShows('维持')">
257 263
                         <div v-if="this.$store.getters.xt_user.template_info.org_id != 10157">
258
-                          <div v-if="this.$store.getters.xt_user.template_info.org_id != 10101">
264
+                          <div v-if="this.$store.getters.xt_user.template_info.org_id != 10101 && this.$store.getters.xt_user.template_info.template_id != 45">
259 265
                             <el-form-item :label="'维持(' + anticoagulant.weichi_unit + ') : '"
260
-                                          v-if="anticoagulant.weichi != -1 && this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.org_id != 9987 && this.$store.getters.xt_user.template_info.template_id != 45">
266
+                                          v-if="anticoagulant.weichi != -1 && this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.org_id != 9987">
261 267
                                 <el-input type="number" v-if="dialysisPrescription.anticoagulant != 1"
262 268
                                           v-model="dialysisPrescription.anticoagulant_weichi"></el-input>
263 269
                                 <el-input type="number" disabled v-if="dialysisPrescription.anticoagulant == 1"
264 270
                                           v-model="dialysisPrescription.no_anticoagulant_weichi"></el-input>
265 271
                             </el-form-item>
266 272
                             <el-form-item :label="'维持(mg/h) : '"
267
-                                          v-if="anticoagulant.weichi != -1 && this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 38 || this.$store.getters.xt_user.template_info.org_id == 9987 ||  this.$store.getters.xt_user.template_info.template_id == 45">
273
+                                          v-if="anticoagulant.weichi != -1 && this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 38 || this.$store.getters.xt_user.template_info.org_id == 9987  ">
268 274
                                 <el-input type="number" v-if="dialysisPrescription.anticoagulant != 1"
269 275
                                           v-model="dialysisPrescription.anticoagulant_weichi"></el-input>
270 276
                                 <el-input type="number" disabled v-if="dialysisPrescription.anticoagulant == 1"
@@ -307,9 +313,9 @@
307 313
 
308 314
                     <el-col :span="8" v-if="anticoagulant.zongliang != -1 && isShows('总量')">
309 315
                         <div v-if="this.$store.getters.xt_user.template_info.org_id != 10157">
310
-                          <div v-if="this.$store.getters.xt_user.template_info.org_id != 10101">
316
+                          <div v-if="this.$store.getters.xt_user.template_info.org_id != 10101 && this.$store.getters.xt_user.template_info.template_id != 45">
311 317
                             <el-form-item
312
-                                    v-if='this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.org_id != 9987'
318
+                                    v-if='this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 38  && this.$store.getters.xt_user.template_info.org_id != 9987'
313 319
                                     :label="'总量(' + anticoagulant.zongliang_unit + ') : '">
314 320
                                 <el-input type="number" v-if="dialysisPrescription.anticoagulant != 1"
315 321
                                           v-model="dialysisPrescription.anticoagulant_zongliang"></el-input>
@@ -317,7 +323,7 @@
317 323
                                           v-model="dialysisPrescription.no_anticoagulant_zongliang"></el-input>
318 324
                             </el-form-item>
319 325
                             <el-form-item
320
-                                    v-if='this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 38 || this.$store.getters.xt_user.template_info.org_id == 9987'
326
+                                    v-if='this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 38||  this.$store.getters.xt_user.template_info.org_id == 9987'
321 327
                                     :label="'总量(mg) : '">
322 328
                                 <el-input type="number" v-if="dialysisPrescription.anticoagulant != 1"
323 329
                                           v-model="dialysisPrescription.anticoagulant_zongliang"></el-input>
@@ -2160,9 +2166,10 @@
2160 2166
           this.dialysisPrescription.anticoagulant_zongliang = ""
2161 2167
           this.dialysisPrescription.anticoagulant_zongliang = parseInt(this.dialysisPrescription.anticoagulant_shouji) +  parseInt(this.dialysisPrescription.anticoagulant_weichi)
2162 2168
         }
2163
-
2169
+     
2164 2170
 
2165 2171
       },
2172
+
2166 2173
       handleCommit: function() {
2167 2174
         console.log("触发了么2323323233223")
2168 2175
         if(!this.isLoading){

+ 6 - 8
src/xt_pages/supply/components/addGoodOrder.vue View File

@@ -575,13 +575,8 @@ export default {
575 575
           this.supplyList = response.data.data.supplyList;
576 576
           for (let i = 0; i < drugList.length; i++) {
577 577
             for (let z = 0; z < drugList[i].drug_warehouse_info.length; z++) {
578
-              if (
579
-                drugList[i].max_unit ==
580
-                drugList[i].drug_warehouse_info[z].max_unit
581
-              ) {
582
-                drugList[i].drug_warehouse_info[z].stock_max_number =
583
-                  drugList[i].drug_warehouse_info[z].stock_max_number *
584
-                  drugList[i].min_number;
578
+              if (drugList[i].max_unit == drugList[i].drug_warehouse_info[z].max_unit) {
579
+                drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number *drugList[i].min_number;
585 580
               }
586 581
             }
587 582
             for (let j = 0; j < this.manufactuerList.length; j++) {
@@ -794,7 +789,9 @@ export default {
794 789
           min_str = (total % min_number) + min_unit;
795 790
         }
796 791
       }
792
+     
797 793
       return max_str + min_str;
794
+    
798 795
     },
799 796
     getTotalStockCount(arr) {
800 797
       var total_count = 0;
@@ -1145,7 +1142,7 @@ export default {
1145 1142
       var warehousing_id = this.id;
1146 1143
       console.log("采购单ID",id)
1147 1144
       console.log("采购订单ID",warehousing_id)
1148
-    
1145
+      this.loading = true
1149 1146
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1150 1147
         if (response.data.state == 1) {
1151 1148
           this.$message.success("审核成功!");
@@ -1154,6 +1151,7 @@ export default {
1154 1151
           this.showOne = false;
1155 1152
           this.showTwo = true;
1156 1153
           this.showThree = true;
1154
+          this.loading = false
1157 1155
           var purcaseOrder = response.data.data.purcaseOrder;
1158 1156
           var goodOrder = response.data.data.goodOrder;
1159 1157
           var drugList = response.data.data.drugList;

+ 20 - 12
src/xt_pages/supply/components/addGoodReturn.vue View File

@@ -488,9 +488,10 @@ export default {
488 488
           this.supplyList = response.data.data.supplyList;
489 489
           for (let i = 0; i < drugList.length; i++) {
490 490
             for (let z = 0; z < drugList[i].drug_warehouse_info.length; z++) {
491
-              drugList[i].drug_warehouse_info[z].stock_max_number =
492
-                drugList[i].drug_warehouse_info[z].stock_max_number *
493
-                drugList[i].min_number;
491
+
492
+              if (drugList[i].max_unit == drugList[i].drug_warehouse_info[z].max_unit) {
493
+                drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number *drugList[i].min_number;
494
+              }
494 495
             }
495 496
             for (let j = 0; j < this.manufactuerList.length; j++) {
496 497
               if (drugList[i].manufacturer == this.manufactuerList[j].id) {
@@ -692,6 +693,7 @@ export default {
692 693
           total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
693 694
         }
694 695
       }
696
+    
695 697
       if (total < min_number) {
696 698
         min_str = total + min_unit;
697 699
       }
@@ -707,6 +709,7 @@ export default {
707 709
           min_str = (total % min_number) + min_unit;
708 710
         }
709 711
       }
712
+      console.log("hh2332232332",max_str + min_str)
710 713
       return max_str + min_str;
711 714
     },
712 715
     getTotalStockCount(arr) {
@@ -736,17 +739,20 @@ export default {
736 739
       }
737 740
       return uParseTime(time, "{y}-{m}-{d}");
738 741
     },
739
-   
740
-    getAllPrice() {
742
+
743
+     getAllPrice() {
741 744
       var total_price = 0;
742 745
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
743
-        total_price += this.recordInfo.tableList[i].supply_price *this.recordInfo.tableList[i].supply_count;
746
+        total_price +=(this.recordInfo.tableList[i].supply_price *this.recordInfo.tableList[i].supply_count - (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count*this.recordInfo.tableList[i].deposit_rate/100))
744 747
       }
745 748
       this.total_price = total_price;
746
-      // this.discount_amount = (this.total_price * this.rate_of_concession * 0.01).toFixed(2);
747
-      return total_price.toFixed(2);
749
+      if(total_price > 0){
750
+         return total_price.toFixed(2);
751
+      }else{
752
+        return ""
753
+      }
754
+     
748 755
     },
749
-
750 756
     addressChange() {
751 757
       var discount_amount = 0;
752 758
       if (this.rate_of_concession > 0) {
@@ -804,8 +810,7 @@ export default {
804 810
           this.supplier_name = out.supplier_id;
805 811
           this.rate_of_concession = out.rate_of_concession;
806 812
           this.discount_amount = out.discount_amount;
807
-          this.payment = out.payment;
808
-          this.arrearage = out.arrearage;
813
+      
809 814
           this.start_time = this.getTimes(out.document_date);
810 815
           var orderInfo = response.data.data.list;
811 816
           console.log("orderINFO233232232332", orderInfo);
@@ -819,13 +824,15 @@ export default {
819 824
                  }
820 825
               }
821 826
               orderInfo[i].supply_total = this.getWarehoseInfo(orderInfo[i].drug_warehouse_info,orderInfo[i].drug.max_unit,orderInfo[i].drug.min_unit,orderInfo[i].drug.min_number)
827
+              orderInfo[i].count =this.getWarehoseInfo(orderInfo[i].drug_warehouse_info,orderInfo[i].drug.max_unit,orderInfo[i].drug.min_unit,orderInfo[i].drug.min_number)
822 828
             }
823 829
             if(orderInfo[i].is_source == 2){
824 830
                orderInfo[i].supply_total = this.getTotalStockCount(orderInfo[i].good_warehouse_info)
831
+               orderInfo[i].count = this.getTotalStockCount(orderInfo[i].good_warehouse_info)
825 832
             }
826 833
             orderInfo[i].id = orderInfo[i].id;
827 834
             orderInfo[i].supply_count = orderInfo[i].supply_count;
828
-            orderInfo[i].count = orderInfo[i].count
835
+           
829 836
             orderInfo[i].supply_price = orderInfo[i].price;
830 837
             orderInfo[i].supply_remake = orderInfo[i].remark;
831 838
             orderInfo[i].type = orderInfo[i].is_source;
@@ -1041,6 +1048,7 @@ export default {
1041 1048
        warehouse_out_id:this.warehouse_out_id,
1042 1049
        id:this.id,
1043 1050
      }
1051
+     console.log("审核2322323232323",params)
1044 1052
      checkReturnOrder(params).then(response=>{
1045 1053
        if(response.data.state == 1){
1046 1054
       

+ 41 - 15
src/xt_pages/supply/components/addPurchaseOrder.vue View File

@@ -1031,31 +1031,57 @@ export default {
1031 1031
             var arr = [];
1032 1032
             var total = 0;
1033 1033
             var str = "";
1034
+            console.log("长度111",purcaseOrder.length)
1035
+            console.log("长度222",goodOrder.length)
1036
+            if(purcaseOrder.length <=goodOrder.length){
1037
+              //如果采购单有数据,则需要比较数量
1038
+              if (newArr.length > 0) {
1039
+                for (let i = 0; i < purcaseOrder.length; i++) {
1040
+                  for (let j = 0; j < newArr.length; j++) {
1041
+                    if (purcaseOrder[i].project_id == newArr[j].project_id) {
1042
+                      //根据商品ID比较数量大小,把数量不足的商品ID储存,表示采购单的数量未满足采购订单的数据,可以继续生成采购单
1043
+                      if (purcaseOrder[i].count > newArr[j].count) {
1044
+                        arr.push(purcaseOrder[i].project_id);
1045
+                      }
1046
+                    }
1047
+                  }
1048
+                }
1049
+                //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
1050
+
1051
+                if (arr.length == 0) {
1052
+                  this.$message.error("该订单已全部生成采购单,请知悉!");
1053
+                  return;
1054
+                }
1055
+
1056
+                if (arr.length >0) {
1057
+                  str = arr.join(",");
1058
+                  this.$router.push({path: "/good/order/add?id=" + this.id + "&ids=" + str});
1059
+                }
1060
+              }
1061
+            }
1034 1062
 
1035
-            //如果采购单有数据,则需要比较数量
1063
+             //如果采购订单的商品个数不等与 采购单里面的商品个数
1064
+          if(purcaseOrder.length>goodOrder.length){
1065
+           var arrList = []
1066
+           var str = "";
1036 1067
             if (newArr.length > 0) {
1037 1068
               for (let i = 0; i < purcaseOrder.length; i++) {
1038 1069
                 for (let j = 0; j < newArr.length; j++) {
1039
-                  if (purcaseOrder[i].project_id == newArr[j].project_id) {
1040
-                    //根据商品ID比较数量大小,把数量不足的商品ID储存,表示采购单的数量未满足采购订单的数据,可以继续生成采购单
1041
-                    if (purcaseOrder[i].count > newArr[j].count) {
1042
-                      arr.push(purcaseOrder[i].project_id);
1043
-                    }
1070
+                  //如果采购订单的商品个数不等与 采购单里面的商品个数
1071
+                  if(purcaseOrder[i].project_id != newArr[j].project_id){
1072
+                     arrList.push(purcaseOrder[i].project_id)
1044 1073
                   }
1045 1074
                 }
1046 1075
               }
1047 1076
               //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
1048
-
1049
-              if (arr.length == 0) {
1050
-                this.$message.error("该订单已全部生成采购单,请知悉!");
1051
-                return;
1052
-              }
1053
-
1054
-              if (arr.length >0) {
1055
-                str = arr.join(",");
1056
-                this.$router.push({path: "/good/order/add?id=" + this.id + "&ids=" + str});
1077
+              console.log("are232323323223322323",arrList)
1078
+              if(arrList.length > 0){
1079
+                str = arrList.join(",");
1080
+                this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + str});
1057 1081
               }
1058 1082
             }
1083
+           }
1084
+     
1059 1085
           }
1060 1086
         }
1061 1087
       });

+ 2 - 0
src/xt_pages/supply/components/editGoodOrder.vue View File

@@ -1124,6 +1124,7 @@ export default {
1124 1124
       var warehousing_id = this.$route.query.warehousing_id;
1125 1125
       console.log("采购单ID",id)
1126 1126
       console.log("采购订单ID",warehousing_id)
1127
+      this.loading = true
1127 1128
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1128 1129
         if (response.data.state == 1) {
1129 1130
           this.$message.success("审核成功!");
@@ -1132,6 +1133,7 @@ export default {
1132 1133
           this.showTwo = true;
1133 1134
           this.showThree = true;
1134 1135
           this.disabled = true
1136
+          this.loading = false
1135 1137
           var purcaseOrder = response.data.data.purcaseOrder;
1136 1138
           this.Reviewed = true;
1137 1139
           console.log("采购订单", purcaseOrder);

+ 35 - 27
src/xt_pages/supply/components/editGoodReturn.vue View File

@@ -241,7 +241,7 @@
241 241
               <div style="visibility: hidden">/</div>
242 242
             </template>
243 243
           </el-table-column>
244
-          <el-table-column label="折扣率" align="center" width="120px">
244
+          <el-table-column label="折扣率(%)" align="center" width="120px">
245 245
             <template slot-scope="scope">
246 246
                <el-input
247 247
                   v-model="scope.row.deposit_rate"
@@ -506,9 +506,9 @@ export default {
506 506
           this.supplyList = response.data.data.supplyList;
507 507
           for (let i = 0; i < drugList.length; i++) {
508 508
             for (let z = 0; z < drugList[i].drug_warehouse_info.length; z++) {
509
-              drugList[i].drug_warehouse_info[z].stock_max_number =
510
-                drugList[i].drug_warehouse_info[z].stock_max_number *
511
-                drugList[i].min_number;
509
+              if (drugList[i].max_unit == drugList[i].drug_warehouse_info[z].max_unit) {
510
+                drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number *drugList[i].min_number;
511
+              }
512 512
             }
513 513
             for (let j = 0; j < this.manufactuerList.length; j++) {
514 514
               if (drugList[i].manufacturer == this.manufactuerList[j].id) {
@@ -697,6 +697,11 @@ export default {
697 697
       this.recordInfo.tableList.push(tempObj);
698 698
     },
699 699
     handleDelete: function (index, row) {
700
+      console.log("3232323223",row,this.is_check)
701
+      if (this.is_check == 1) {
702
+          this.$message.error("已审核单据,不能删除!");
703
+          return false;
704
+      }
700 705
       if (row.id == 0) {
701 706
         if (this.recordInfo.tableList.length <= 1) {
702 707
           this.$message.error("只有一条记录的时候无法删除");
@@ -706,27 +711,27 @@ export default {
706 711
         }
707 712
       }
708 713
       if (row.id > 0) {
709
-        if (this.is_check == 1) {
710
-          this.$message.error("已审核单据,不能删除!");
711
-          return false;
712
-        }
713
-        this.$confirm("确认删除吗?", "删除", {
714
-          confirmButtonText: "确 定",
715
-          cancelButtonText: "取 消",
716
-          type: "warning",
717
-        })
718
-          .then(() => {
719
-            deleteReturnOrderById(val.id).then((response) => {
720
-              if (response.data.state == 1) {
721
-                var msg = response.data.data.msg;
722
-                this.recordInfo.tableList.splice(index, 1);
723
-                this.$message.success("删除成功");
714
+        const params = {
715
+            id: row.id
716
+          }
717
+          this.$confirm('确认删除吗?', {
718
+            confirmButtonText: '确定',
719
+            cancelButtonText: '取消',
720
+            type: 'warning'
721
+          }).then(() => {
722
+            deleteReturnOrderById(params).then(response => {
723
+              if (response.data.state == 0) {
724
+                this.$message.error(response.data.msg)
725
+                return false
724 726
               } else {
725
-                this.$message.error("删除失败");
727
+                 var msg = response.data.data.msg;
728
+                 this.recordInfo.tableList.splice(index, 1);
729
+                this.$message.success('删除成功')
726 730
               }
727
-            });
728
-          })
729
-          .catch(() => {});
731
+            })
732
+          }).catch(() => {
733
+        })
734
+   
730 735
       }
731 736
     },
732 737
     getWarehoseInfo(arr, max_unit, min_unit, min_number) {
@@ -844,12 +849,15 @@ export default {
844 849
     getAllPrice() {
845 850
       var total_price = 0;
846 851
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
847
-        total_price +=
848
-          this.recordInfo.tableList[i].supply_price *
849
-          this.recordInfo.tableList[i].supply_count;
852
+        total_price +=(this.recordInfo.tableList[i].supply_price *this.recordInfo.tableList[i].supply_count - (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count*this.recordInfo.tableList[i].deposit_rate/100))
850 853
       }
851 854
       this.total_price = total_price;
852
-      return total_price.toFixed(2);
855
+      if(total_price > 0){
856
+         return total_price.toFixed(2);
857
+      }else{
858
+        return ""
859
+      }
860
+     
853 861
     },
854 862
 
855 863
     addressChange() {

+ 35 - 2
src/xt_pages/supply/components/editPurchaseOrder.vue View File

@@ -953,6 +953,8 @@ export default {
953 953
           if (goodOrder.length == 0) {
954 954
             this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + ids});
955 955
           }
956
+       
957
+          
956 958
           for (let i = 0; i < purcaseOrder.length; i++) {
957 959
             for (let j = 0; j < drugList.length; j++) {
958 960
               if (purcaseOrder[i].is_source == 1) {
@@ -1002,10 +1004,17 @@ export default {
1002 1004
               }
1003 1005
             }
1004 1006
 
1005
-            var arr = [];
1007
+            var arr = []; 
1006 1008
             var total = 0;
1007 1009
             var str = "";
1010
+            console.log("newArr2323223323223",newArr)
1011
+            console.log("newArr2323223323223",purcaseOrder)
1012
+            
1013
+
1014
+           console.log("长度1",goodOrder.length)
1015
+           console.log("长度2",purcaseOrder.length)
1008 1016
 
1017
+          if(purcaseOrder.length <=goodOrder.length){
1009 1018
             //如果采购单有数据,则需要比较数量
1010 1019
             if (newArr.length > 0) {
1011 1020
               for (let i = 0; i < purcaseOrder.length; i++) {
@@ -1019,7 +1028,7 @@ export default {
1019 1028
                 }
1020 1029
               }
1021 1030
               //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
1022
-
1031
+             
1023 1032
               if (arr.length == 0) {
1024 1033
                 this.$message.error("该订单已全部生成采购单,请知悉!");
1025 1034
                 return;
@@ -1029,7 +1038,31 @@ export default {
1029 1038
                 str = arr.join(",");
1030 1039
                 this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + str});
1031 1040
               }
1041
+
1042
+            }
1043
+
1044
+          }
1045
+          //如果采购订单的商品个数不等与 采购单里面的商品个数
1046
+          if(purcaseOrder.length>goodOrder.length){
1047
+           var arrList = []
1048
+           var str = "";
1049
+            if (newArr.length > 0) {
1050
+              for (let i = 0; i < purcaseOrder.length; i++) {
1051
+                for (let j = 0; j < newArr.length; j++) {
1052
+                  //如果采购订单的商品个数不等与 采购单里面的商品个数
1053
+                  if(purcaseOrder[i].project_id != newArr[j].project_id){
1054
+                     arrList.push(purcaseOrder[i].project_id)
1055
+                  }
1056
+                }
1057
+              }
1058
+              //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
1059
+              console.log("are232323323223322323",arrList)
1060
+              if(arrList.length > 0){
1061
+                str = arrList.join(",");
1062
+                this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + str});
1063
+              }
1032 1064
             }
1065
+           }
1033 1066
           }
1034 1067
         }
1035 1068
       });