XMLWAN 3 лет назад
Родитель
Сommit
e197ab5595

+ 26 - 3
src/xt_pages/supply/components/addGoodOrder.vue Просмотреть файл

@@ -487,7 +487,8 @@ import {
487 487
   ModefySupplyWarehousing,
488 488
   MofyGoodOrder,
489 489
   getSupplyWarehouseOutById,
490
-  UpdateSupplyWahouseingInfo
490
+  UpdateSupplyWahouseingInfo,
491
+  deleteGoodOrderById,
491 492
 } from "@/api/supply";
492 493
 export default {
493 494
   name: "addPurchaseOrder",
@@ -779,9 +780,30 @@ export default {
779 780
       if (this.recordInfo.tableList.length <= 1) {
780 781
         this.$message.error("只有一条记录的时候无法删除");
781 782
         return;
782
-      } else {
783
-        this.recordInfo.tableList.splice(index, 1);
783
+      }else {
784
+        const params = {
785
+          id: row.id,
786
+        };
787
+        this.$confirm("确认删除吗?", {
788
+          confirmButtonText: "确定",
789
+          cancelButtonText: "取消",
790
+          type: "warning",
791
+        })
792
+          .then(() => {
793
+            deleteGoodOrderById(params).then((response) => {
794
+              if (response.data.state == 0) {
795
+                this.$message.error(response.data.msg);
796
+                return false;
797
+              } else {
798
+                this.$message.success("删除成功");
799
+
800
+                this.recordInfo.tableList.splice(index, 1);
801
+              }
802
+            });
803
+          })
804
+          .catch(() => {});
784 805
       }
806
+    
785 807
     },
786 808
     getWarehoseInfo(arr, max_unit, min_unit, min_number) {
787 809
       var total = 0;
@@ -1049,6 +1071,7 @@ export default {
1049 1071
               this.id = warehouseOut.id
1050 1072
               this.start_time = this.getTimes(warehouseOut.document_date);
1051 1073
               for (let i = 0; i < orderInfo.length; i++) {
1074
+                orderInfo[i].id = orderInfo[i].id
1052 1075
                 orderInfo[i].supply_count = orderInfo[i].count;
1053 1076
                 orderInfo[i].supply_price = orderInfo[i].price;
1054 1077
                 orderInfo[i].supply_remake = orderInfo[i].remark;

+ 29 - 16
src/xt_pages/supply/components/addGoodReturn.vue Просмотреть файл

@@ -230,12 +230,7 @@
230 230
             </template>
231 231
           </el-table-column>
232 232
 
233
-          <el-table-column label="采购金额" align="center" width="120px">
234
-            <template slot-scope="scope">
235
-              {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
236
-              <div style="visibility: hidden">/</div>
237
-            </template>
238
-          </el-table-column>
233
+         
239 234
           <el-table-column label="折扣率(%)" align="center" width="120px">
240 235
             <template slot-scope="scope">
241 236
                <el-input
@@ -254,6 +249,13 @@
254 249
             </template>
255 250
           </el-table-column>
256 251
 
252
+          <el-table-column label="采购金额" align="center" width="120px">
253
+            <template slot-scope="scope">
254
+              {{ calculate(scope.row.supply_count * scope.row.supply_price - (scope.row.supply_count * scope.row.supply_price * (scope.row.deposit_rate/100)))}}
255
+              <div style="visibility: hidden">/</div>
256
+            </template>
257
+          </el-table-column>
258
+
257 259
           <el-table-column label="生产厂家" align="center" width="200px">
258 260
             <template slot-scope="scope">
259 261
               <el-input
@@ -746,7 +748,7 @@ export default {
746 748
           min_str = (total % min_number) + min_unit;
747 749
         }
748 750
       }
749
-      console.log("hh2332232332",max_str + min_str)
751
+      // console.log("hh2332232332",max_str + min_str)
750 752
       return max_str + min_str;
751 753
     },
752 754
     getWarehoseInfoTwo(arr, max_unit, min_unit, min_number){
@@ -796,11 +798,17 @@ export default {
796 798
   getAllPrice() {
797 799
       var total_price = 0;
798 800
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
799
-        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));
801
+        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));
800 802
       }
801 803
       this.total_price = total_price;
802 804
       // this.discount_amount = (this.total_price * this.rate_of_concession * 0.01).toFixed(2);
803
-      return total_price.toFixed(2);
805
+      if(total_price > 0){
806
+        return total_price.toFixed(2);
807
+      }else{
808
+        return  ""
809
+      }
810
+     
811
+    
804 812
     },
805 813
      addressChange() {
806 814
       var discount_amount = 0;
@@ -943,9 +951,10 @@ export default {
943 951
                 if (orderInfo[i].project_id == goodList[j].id) {
944 952
                   orderInfo[i].unitList = [{ id: 1, name: "" }];
945 953
                   orderInfo[i].unitList[0].name = goodList[j].packing_unit;
954
+                  orderInfo[i].count =  this.getTotalStockCountSix(orderInfo[i].good_warehouse_info,orderInfo[i].warehouse_out_id)
946 955
                 }
947 956
 
948
-                orderInfo[i].count =  this.getTotalStockCountSix(orderInfo[i].good_warehouse_info,orderInfo[i].warehouse_out_id)
957
+               
949 958
               }
950 959
               orderInfo[i].sum_count = orderInfo[i].count
951 960
               orderInfo[i].min_number = 0
@@ -1173,7 +1182,7 @@ export default {
1173 1182
  
1174 1183
      checkReturnOrder(params).then(response=>{
1175 1184
        if(response.data.state == 1){
1176
-
1185
+        this.loading = false
1177 1186
         var msg = response.data.data.msg
1178 1187
         if(msg == 1){
1179 1188
           this.loading = false
@@ -1185,10 +1194,12 @@ export default {
1185 1194
         }
1186 1195
 
1187 1196
          if(msg == 2){
1197
+
1188 1198
             var good_name = response.data.data.good_name
1189 1199
             var specification_name = response.data.data.specification_name
1190 1200
             var str = good_name +"*" + specification_name +"库存不足,审核失败!"
1191 1201
             this.$message.error(str)
1202
+            this.loading = false
1192 1203
 
1193 1204
           }
1194 1205
           if(msg == 3){
@@ -1200,6 +1211,7 @@ export default {
1200 1211
               var max_unit =  response.data.data.max_unit
1201 1212
               var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
1202 1213
               this.$message.error(str + "库存不足,审核失败!")
1214
+              this.loading = false
1203 1215
           }
1204 1216
 
1205 1217
        }
@@ -1292,7 +1304,7 @@ export default {
1292 1304
            total += parseInt(newArr[i].stock_max_number+ newArr[i].stock_min_number);
1293 1305
          }
1294 1306
       }
1295
-     console.log("total232323232",total)
1307
+    //  console.log("total232323232",total)
1296 1308
       if (total < min_number) {
1297 1309
         min_str = total + min_unit;
1298 1310
       }
@@ -1308,7 +1320,7 @@ export default {
1308 1320
           min_str = (total % min_number) + min_unit;
1309 1321
         }
1310 1322
       }
1311
-      console.log("hh2332232332",max_str + min_str)
1323
+      // console.log("hh2332232332",max_str + min_str)
1312 1324
       return max_str + min_str;
1313 1325
     },
1314 1326
     getTotalStockCountSix(arr,warehouse_out_id) {
@@ -1319,18 +1331,19 @@ export default {
1319 1331
            newArr.push(arr[i])
1320 1332
         }
1321 1333
       }
1334
+      console.log("232323232332",newArr)
1322 1335
       if(newArr.length > 0){
1323 1336
         for(let i=0;i<newArr.length;i++){
1324
-          total_count += arr[i].stock_count;
1337
+          total_count += newArr[i].stock_count;
1325 1338
         }
1326 1339
       }
1327
-     
1340
+      console.log("total_count2323223",total_count)
1328 1341
       if(total_count > 0){
1329 1342
        return total_count;
1330 1343
       }else{
1331 1344
         return ""
1332 1345
       }
1333
-
1346
+    
1334 1347
     },
1335 1348
   },
1336 1349
   created() {

+ 4 - 1
src/xt_pages/supply/components/addPurchaseOrder.vue Просмотреть файл

@@ -67,7 +67,7 @@
67 67
             size="small"
68 68
             type="primary"
69 69
             @click="toPrint()"
70
-            v-show="showOne"
70
+            v-show="showSix"
71 71
             >打印</el-button
72 72
           >
73 73
           <el-button
@@ -447,6 +447,7 @@ export default {
447 447
       total_price: 0,
448 448
       return_remark: "",
449 449
       is_check: 2,
450
+      showSix:false,
450 451
     };
451 452
   },
452 453
 
@@ -702,6 +703,7 @@ export default {
702 703
             if (response.data.state == 1) {
703 704
               var order = response.data.data.order;
704 705
               this.loading = false;
706
+              this.showSix = true
705 707
               this.$message.success("保存成功!");
706 708
               var warehouseInfo = response.data.data.warehouseInfo;
707 709
               this.is_check = warehouseInfo.is_check;
@@ -919,6 +921,7 @@ export default {
919 921
               this.showTwo = false
920 922
               this.showThree = true
921 923
               this.disabled = true;
924
+              this.showSix = true
922 925
               this.$message.success("审核成功!");
923 926
               this.Reviewed = true;
924 927
             }

+ 2 - 2
src/xt_pages/supply/components/editGoodOrder.vue Просмотреть файл

@@ -880,8 +880,7 @@ export default {
880 880
       }
881 881
       return uParseTime(time, "{y}-{m}-{d}");
882 882
     },
883
-
884
- getAllPrice() {
883
+    getAllPrice() {
885 884
       var total_price = 0;
886 885
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
887 886
         total_price +=
@@ -1389,6 +1388,7 @@ export default {
1389 1388
       MofyGoodOrder(params).then((response) => {
1390 1389
         if (response.data.state == 1) {
1391 1390
           var msg = response.data.data.msg;
1391
+          this.is_check = 2
1392 1392
           if (msg == 1) {
1393 1393
             this.$message.success("反审核成功!");
1394 1394
             this.disabled = false

+ 21 - 10
src/xt_pages/supply/components/editGoodReturn.vue Просмотреть файл

@@ -242,12 +242,7 @@
242 242
             </template>
243 243
           </el-table-column>
244 244
 
245
-          <el-table-column label="采购金额" align="center" width="120px">
246
-            <template slot-scope="scope">
247
-              {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
248
-              <div style="visibility: hidden">/</div>
249
-            </template>
250
-          </el-table-column>
245
+         
251 246
           <el-table-column label="折扣率(%)" align="center" width="120px">
252 247
             <template slot-scope="scope">
253 248
                <el-input
@@ -265,8 +260,14 @@
265 260
               <div style="visibility: hidden">/</div>
266 261
             </template>
267 262
           </el-table-column>
268
-
269
-
263
+         
264
+          <el-table-column label="采购金额" align="center" width="120px">
265
+            <template slot-scope="scope">
266
+             {{ calculate(scope.row.supply_count * scope.row.supply_price - (scope.row.supply_count * scope.row.supply_price * (scope.row.deposit_rate/100)))}}
267
+              <div style="visibility: hidden">/</div>
268
+            </template>
269
+          </el-table-column>
270
+           
270 271
           <el-table-column label="生产厂家" align="center" width="200px">
271 272
             <template slot-scope="scope">
272 273
               <el-input
@@ -744,6 +745,7 @@ export default {
744 745
       tempObj["min_number"] = 0
745 746
       tempObj["max_unit"] = ""
746 747
       tempObj["min_unit"] = ""
748
+      tempObj["order_type"] = 0
747 749
       this.recordInfo.tableList.push(tempObj);
748 750
     },
749 751
     handleDelete: function (index, row) {
@@ -953,11 +955,16 @@ export default {
953 955
   getAllPrice() {
954 956
       var total_price = 0;
955 957
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
956
-        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));
958
+        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));
957 959
       }
958 960
       this.total_price = total_price;
959 961
       // this.discount_amount = (this.total_price * this.rate_of_concession * 0.01).toFixed(2);
960
-      return total_price.toFixed(2);
962
+      if(total_price > 0){
963
+        return total_price.toFixed(2);
964
+      }else{
965
+        return ""
966
+      }
967
+     
961 968
     },
962 969
 
963 970
      addressChange() {
@@ -1051,6 +1058,7 @@ export default {
1051 1058
         if (response.data.state == 1) {
1052 1059
           var out = response.data.data.cancelDetail;
1053 1060
           console.log("out23322323232323", out);
1061
+        
1054 1062
           this.warehouse_out_id = out.warehouse_out_id;
1055 1063
           this.number = out.number;
1056 1064
           this.is_check = out.is_check;
@@ -1098,6 +1106,7 @@ export default {
1098 1106
             orderInfo[i].supply_price = orderInfo[i].price;
1099 1107
             orderInfo[i].supply_remake = orderInfo[i].remark;
1100 1108
             orderInfo[i].type = orderInfo[i].is_source;
1109
+            orderInfo[i].order_type = orderInfo[i].type
1101 1110
             orderInfo[i].project_id = orderInfo[i].project_id;
1102 1111
             orderInfo[i].supply_unit = orderInfo[i].supply_unit;
1103 1112
             orderInfo[i].order_number = orderInfo[i].order_number;
@@ -1253,6 +1262,7 @@ export default {
1253 1262
            this.is_check = 1
1254 1263
            this.Reviewed = true
1255 1264
            this.disabled = true
1265
+          
1256 1266
           }
1257 1267
           if(msg == 2){
1258 1268
             var good_name = response.data.data.good_name
@@ -1325,6 +1335,7 @@ export default {
1325 1335
     tempObj["min_number"] = 0
1326 1336
     tempObj["max_unit"] = ""
1327 1337
     tempObj["min_unit"] = ""
1338
+    tempObj["order_type"] = 0
1328 1339
     this.recordInfo.tableList.push(tempObj);
1329 1340
     this.getInitOrder();
1330 1341
 

+ 2 - 2
src/xt_pages/supply/components/editPurchaseOrder.vue Просмотреть файл

@@ -1073,12 +1073,12 @@ export default {
1073 1073
                   }
1074 1074
                 }
1075 1075
                 //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
1076
-
1076
+                console.log("Ar23322323",arr)
1077 1077
                 if (arr.length == 0) {
1078 1078
                   this.$message.error("该订单已全部生成采购单,请知悉!");
1079 1079
                   return;
1080 1080
                 }
1081
-
1081
+               
1082 1082
                 if (arr.length > 0) {
1083 1083
                   str = arr.join(",");
1084 1084
                   this.$router.push({

+ 24 - 0
src/xt_pages/supply/components/goodOrderPrint.vue Просмотреть файл

@@ -110,6 +110,16 @@
110 110
             >
111 111
               优惠金额:<span v-if="discount_amount>0">{{discount_amount}}</span>
112 112
             </div>
113
+            <div
114
+              style="
115
+                width: 25%;
116
+                text-align: left;
117
+                margin-bottom: 1px;
118
+                font-size: 18px;
119
+              "
120
+            >
121
+              优惠后金额:<span v-if="getAllPriceSix()>0">{{getAllPriceSix()}}</span>
122
+            </div>
113 123
             <div
114 124
               style="
115 125
                 width: 25%;
@@ -405,6 +415,20 @@ export default {
405 415
         console.log("ztr",ztr)
406 416
         return ztr
407 417
       },
418
+      getAllPriceSix(){
419
+        console.log("优惠金额",this.discount_amount)
420
+        var total_price = 0
421
+        for (let i = 0; i < this.tableList.length; i++) {
422
+          total_price +=(this.tableList[i].price *this.tableList[i].count)
423
+        }
424
+
425
+        total_price = total_price - this.discount_amount;
426
+        if(total_price > 0){
427
+          return total_price.toFixed(2);
428
+        }else{
429
+          return ""
430
+        }
431
+      }
408 432
   },
409 433
   created() {
410 434
     this.orgName = this.$store.getters.xt_user.org.org_name;

+ 20 - 7
src/xt_pages/supply/components/goodReturnPrint.vue Просмотреть файл

@@ -75,7 +75,7 @@
75 75
                     <span v-if="(item.supply_count * item.price*item.deposit_rate) >0">{{(item.supply_count * item.price *item.deposit_rate/100).toFixed(2)}}</span>
76 76
                   </td>
77 77
                   <td style="line-height: 18px">
78
-                    <span v-if="(item.supply_count * item.price) >0">{{(item.supply_count * item.price).toFixed(2)}}</span>
78
+                    <span v-if="(item.supply_count * item.price) >0">{{(item.supply_count * item.price -(item.supply_count*item.price*item.deposit_rate/100)).toFixed(2)}}</span>
79 79
                   </td>
80 80
                  
81 81
                 
@@ -84,7 +84,7 @@
84 84
                   <td colspan="3" style="line-height: 18px">合计</td>
85 85
                   <td colspan="1" style="line-height: 18px">{{getAllCount()}}</td>
86 86
                   <td colspan="3" style="line-height: 18px"></td>
87
-                  <td style="line-height: 18px">{{getAllPriceTwo()}}</td>
87
+                  <td style="line-height: 18px">{{getAllPriceThree()}}</td>
88 88
                 </tr>
89 89
                  <tr>
90 90
                   <td colspan="9" style="line-height: 18px;text-align: left;">合计  金额大写 {{getAllPrice()}}</td>
@@ -111,7 +111,7 @@
111 111
             >
112 112
               优惠金额:<span v-if="discount_amount>0">{{discount_amount}}</span>
113 113
             </div>
114
-            <!-- <div
114
+            <div
115 115
               style="
116 116
                 width: 25%;
117 117
                 text-align: left;
@@ -119,8 +119,8 @@
119 119
                 font-size: 18px;
120 120
               "
121 121
             >
122
-            优惠后金额:<span v-if="getAllPriceTwo()>0">{{getAllPriceTwo()}}</span>
123
-            </div> -->
122
+            优惠后金额:<span>{{getAllPriceSix()}}</span>
123
+            </div>
124 124
             <div
125 125
               style="
126 126
                 width: 25%;
@@ -392,10 +392,10 @@ export default {
392 392
       }
393 393
      
394 394
     },
395
-   getAllPriceTwo() {
395
+   getAllPriceThree() {
396 396
       var total_price = 0;
397 397
       for (let i = 0; i < this.tableList.length; i++) {
398
-        total_price +=(this.tableList[i].price *this.tableList[i].supply_count)
398
+       total_price +=(this.tableList[i].price *this.tableList[i].supply_count - (this.tableList[i].price * this.tableList[i].supply_count*this.tableList[i].deposit_rate/100))
399 399
       }
400 400
       this.total_price = total_price;
401 401
       if(total_price > 0){
@@ -434,6 +434,19 @@ export default {
434 434
         console.log("ztr",ztr)
435 435
         return ztr
436 436
       },
437
+      getAllPriceSix(){
438
+        var total_price = 0;
439
+        for (let i = 0; i < this.tableList.length; i++) {
440
+        total_price +=(this.tableList[i].price *this.tableList[i].supply_count - (this.tableList[i].price * this.tableList[i].supply_count*this.tableList[i].deposit_rate/100))
441
+        }
442
+        console.log("total-price2332323232",this.discount_amount)
443
+        total_price = total_price - this.discount_amount;
444
+        if(total_price > 0){
445
+          return total_price.toFixed(2);
446
+        }else{
447
+          return ""
448
+        }
449
+      }
437 450
   },
438 451
   created() {
439 452
     this.orgName = this.$store.getters.xt_user.org.org_name;