Browse Source

11月14日 库存扣减更新

XMLWAN 3 years ago
parent
commit
dd24a427c0

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

@@ -89,7 +89,7 @@ export function updateGoodOrder(data, supplier_name, start, arrearage, payment,
89 89
 }
90 90
 
91 91
 export function deletePurchaseOrder(id, params) {
92
-  console.log("id232323223",id)
92
+  console.log('id232323223', id)
93 93
   return request({
94 94
     url: '/api/supply/deletepurchorder?id=' + id,
95 95
     method: 'Get',
@@ -337,3 +337,4 @@ export function modefyReturnOrder(params) {
337 337
     params: params
338 338
   })
339 339
 }
340
+

+ 13 - 11
src/xt_pages/dialysis/dialysisPrintOrder.vue View File

@@ -65,16 +65,7 @@
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 69
       <template v-if="org_template_info.template_id == 5">
79 70
         <div>
80 71
           <el-button
@@ -623,6 +614,16 @@
623 614
           >打印</el-button
624 615
         >
625 616
       </template>
617
+      <template v-if="org_template_info.template_id == 46">
618
+        <el-button
619
+          :loading="loading"
620
+          size="small"
621
+          icon="el-icon-printer"
622
+          @click="printThisPage"
623
+          type="primary"
624
+          >打印</el-button
625
+        >
626
+      </template>
626 627
     </div>
627 628
     <div class="app-container" style="min-height:0;">
628 629
       <!--<div class="order-print-btn"-->
@@ -1271,7 +1272,8 @@ export default {
1271 1272
       } else if (
1272 1273
         this.org_template_info.template_id == 6 ||
1273 1274
         this.org_template_info.template_id == 10 ||
1274
-        this.org_template_info.template_id == 11
1275
+        this.org_template_info.template_id == 11 ||
1276
+        this.org_template_info.template_id == 46
1275 1277
       ) {
1276 1278
         printJS({
1277 1279
           printable: "dialysis-print-box-1",

+ 1 - 0
src/xt_pages/supply/components/addGoodOrder.vue View File

@@ -436,6 +436,7 @@
436 436
               v-model="arrearage"
437 437
               @input="count_arrearage"
438 438
               placeholder="请输入本次欠款"
439
+              :disabled="disabled"
439 440
             ></el-input
440 441
           ></span>
441 442
         </div>

+ 17 - 6
src/xt_pages/supply/components/addGoodReturn.vue View File

@@ -18,7 +18,6 @@
18 18
             v-model="supplier_name"
19 19
             style="width: 140px; margin-right: 10px"
20 20
             placeholder="请选择"
21
-            @change="changeTypeName"
22 21
           >
23 22
             <el-option
24 23
               v-for="item in supplyList"
@@ -253,7 +252,7 @@
253 252
             </template>
254 253
           </el-table-column>
255 254
 
256
-          <el-table-column label="源采购单号" align="center" width="200px">
255
+          <el-table-column label="源采购单号" align="center" width="200px">
257 256
             <template slot-scope="scope">
258 257
               <el-input
259 258
                 v-model="scope.row.good_number"
@@ -604,7 +603,7 @@ export default {
604 603
       tempObj["supply_type"] = "";
605 604
       tempObj["supply_specification_name"] = "";
606 605
       tempObj["supply_total"] = "";
607
-      tempObj["count"] = "";
606
+      tempObj["count"] = 0;
608 607
       tempObj["supply_count"] = "";
609 608
       tempObj["supply_price"] = "";
610 609
       tempObj["supply_total_price"] = "";
@@ -621,6 +620,8 @@ export default {
621 620
       tempObj["supply_expiry_date"] = ""
622 621
       tempObj["warehousing_id"] =0
623 622
       tempObj["warehouse_info_id"] =0
623
+      tempObj["good_number"] = ""
624
+      tempObj["min_price"] = "";
624 625
       this.recordInfo.tableList.push(tempObj);
625 626
     },
626 627
     handleDelete: function (index, row) {
@@ -817,6 +818,13 @@ export default {
817 818
              this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count);
818 819
             this.recordInfo.tableList[i].supply_price =this.recordInfo.tableList[i].supply_price.toString();
819 820
             this.recordInfo.tableList[i].supply_total =this.recordInfo.tableList[i].supply_total.toString();
821
+            if(this.recordInfo.tableList[i].supply_product_date == ""){
822
+              console.log("进来3323232")
823
+              this.recordInfo.tableList[i].supply_product_date = 0
824
+            }
825
+            if(this.recordInfo.tableList[i].supply_expiry_date == ""){
826
+              this.recordInfo.tableList[i].supply_expiry_date = 0
827
+            }
820 828
             for (let j = 0; j < this.manufactuerList.length; j++) {
821 829
               if (this.recordInfo.tableList[i].supply_manufacturer ==this.manufactuerList[j].manufacturer_name) {
822 830
                 this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id;
@@ -824,13 +832,14 @@ export default {
824 832
               if (this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].id) {
825 833
                 this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name;
826 834
               }
835
+
827 836
             }
828 837
           } 
829 838
            var params = {
830 839
             stockIn:this.recordInfo.tableList,
831 840
             return_marke:this.return_remark,
832 841
            }
833
-           console.log("2323323232",this.start_time)
842
+           console.log("2323323232",params)
834 843
          
835 844
            saveGoodReturnOrder(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name).then(response=>{
836 845
              if(response.data.state == 1){
@@ -971,7 +980,9 @@ export default {
971 980
     tempObj["supply_expiry_date"] = ""
972 981
     tempObj["warehousing_id"] =0
973 982
     tempObj["warehouse_info_id"] =0
974
-    tempObj["count"] = "";
983
+    tempObj["count"] = 0;
984
+    tempObj["good_number"] = ""
985
+    tempObj["min_price"] = "";
975 986
     this.recordInfo.tableList.push(tempObj);
976 987
     console.log("即哪里地方2",this.recordInfo.tableList)
977 988
     this.getInitOrder();
@@ -980,7 +991,7 @@ export default {
980 991
      //获取购货单列表
981 992
       this.getGoodOrderDetail();
982 993
     }
983
-
994
+    this.start_time = this.getTimes(new Date());
984 995
   },
985 996
 };
986 997
 </script>

+ 11 - 16
src/xt_pages/supply/components/addPurchaseOrder.vue View File

@@ -660,19 +660,11 @@ export default {
660 660
         if (valid) {
661 661
           this.loading = true;
662 662
           for (let i = 0; i < this.recordInfo.tableList.length; i++) {
663
-            this.recordInfo.tableList[i].supply_count = parseInt(
664
-              this.recordInfo.tableList[i].supply_count
665
-            );
666
-            this.recordInfo.tableList[i].supply_license_number =
667
-              this.recordInfo.tableList[i].supply_license_number.toString();
668
-            this.recordInfo.tableList[i].supply_total_price = (
669
-              this.recordInfo.tableList[i].supply_count *
670
-              this.recordInfo.tableList[i].supply_price
671
-            ).toString();
672
-            this.recordInfo.tableList[i].supply_total =
673
-              this.recordInfo.tableList[i].supply_total.toString();
674
-            this.recordInfo.tableList[i].supply_price =
675
-              this.recordInfo.tableList[i].supply_price.toString();
663
+            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count);
664
+            this.recordInfo.tableList[i].supply_license_number =this.recordInfo.tableList[i].supply_license_number.toString();
665
+            this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count *this.recordInfo.tableList[i].supply_price ).toString();
666
+            this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString();
667
+            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString();
676 668
             for (let j = 0; j < this.manufactuerList.length; j++) {
677 669
               if (
678 670
                 this.recordInfo.tableList[i].supply_manufacturer ==
@@ -712,6 +704,7 @@ export default {
712 704
               this.recordInfo.tableList = [];
713 705
               this.return_remark = warehouseInfo.return_remake;
714 706
               var orderInfo = response.data.data.orderInfo;
707
+              console.log("orderINO23323332232323",orderInfo)
715 708
               for (let i = 0; i < orderInfo.length; i++) {
716 709
                 if (orderInfo[i].is_source == 1) {
717 710
                   for (let j = 0; j < this.drugList.length; j++) {
@@ -740,13 +733,15 @@ export default {
740 733
                 orderInfo[i].type = orderInfo[i].is_source;
741 734
                 orderInfo[i].project_id = orderInfo[i].project_id;
742 735
                 orderInfo[i].supply_unit = orderInfo[i].supply_unit;
736
+                orderInfo[i].supply_specification_name = orderInfo[i].supply_specification_name
743 737
               }
744 738
 
745 739
               this.recordInfo.tableList = orderInfo;
740
+              console.log("orderInfo2332322323232332",orderInfo)
746 741
               for (let i = 0; i < orderInfo.length; i++) {
747
-                orderInfo[i].name = "";
748
-                orderInfo[i].supply_name = "";
749
-                orderInfo[i].supply_specification_name = "";
742
+                // orderInfo[i].name = "";
743
+                // orderInfo[i].supply_name = "";
744
+                // orderInfo[i].supply_specification_name = "";
750 745
                 if (orderInfo[i].is_source == 1) {
751 746
                   for (let j = 0; j < this.drugList.length; j++) {
752 747
                     if (orderInfo[i].project_id == this.drugList[j].id) {

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

@@ -1060,8 +1060,9 @@ export default {
1060 1060
         this.recordInfo.tableList[i].supply_total_price =
1061 1061
           this.recordInfo.tableList[i].supply_total_price.toString();
1062 1062
         this.recordInfo.tableList[i].supply_total =
1063
-          this.recordInfo.tableList[i].supply_total.toString();
1064
-
1063
+        this.recordInfo.tableList[i].supply_total.toString();
1064
+        this.recordInfo.tableList[i].min_price =
1065
+        this.recordInfo.tableList[i].min_price.toString();
1065 1066
         for (let j = 0; j < this.manufactuerList.length; j++) {
1066 1067
           if (
1067 1068
             this.recordInfo.tableList[i].supply_manufacturer ==
@@ -1122,6 +1123,7 @@ export default {
1122 1123
           this.showOne = false;
1123 1124
           this.showTwo = true;
1124 1125
           this.showThree = true;
1126
+          this.disabled = true
1125 1127
           var purcaseOrder = response.data.data.purcaseOrder;
1126 1128
           this.Reviewed = true;
1127 1129
           console.log("采购订单", purcaseOrder);
@@ -1359,6 +1361,8 @@ export default {
1359 1361
             this.$message.success("反审核成功!");
1360 1362
             this.disabled = false
1361 1363
             this.Reviewed = false
1364
+            this.showOne = true
1365
+            this.showTwo = false
1362 1366
             return
1363 1367
           }
1364 1368
           if (msg == 2) {

+ 8 - 2
src/xt_pages/supply/components/editGoodReturn.vue View File

@@ -266,7 +266,7 @@
266 266
             </template>
267 267
           </el-table-column>
268 268
 
269
-          <el-table-column label="源采购单号" align="center" width="200px">
269
+          <el-table-column label="源采购单号" align="center" width="200px">
270 270
             <template slot-scope="scope">
271 271
               <el-input
272 272
                 v-model="scope.row.good_number"
@@ -660,7 +660,8 @@ export default {
660 660
       tempObj["warehousing_id"] = 0;
661 661
       tempObj["warehouse_info_id"] = 0;
662 662
       tempObj["count"] = "";
663
-
663
+      tempObj["min_price"] = "";
664
+      tempObj["good_number"] = ""
664 665
       this.recordInfo.tableList.push(tempObj);
665 666
     },
666 667
     handleDelete: function (index, row) {
@@ -972,6 +973,8 @@ export default {
972 973
             stockIn: this.recordInfo.tableList,
973 974
             return_marke: this.return_remark,
974 975
           };
976
+          console.log("parms32322332",params)
977
+         
975 978
           updateGoodReturn(
976 979
             params,
977 980
             warehouse_out_id,
@@ -1045,10 +1048,13 @@ export default {
1045 1048
     tempObj["warehousing_id"] = 0;
1046 1049
     tempObj["warehouse_info_id"] = 0;
1047 1050
     tempObj["count"] = "";
1051
+    tempObj["min_price"] = "";
1052
+    tempObj["good_number"] = ""
1048 1053
     this.recordInfo.tableList.push(tempObj);
1049 1054
     this.getInitOrder();
1050 1055
     //获取购货单列表
1051 1056
     this.getGoodReturnDetail();
1057
+    this.start_time = this.getTimes(new Date());
1052 1058
   },
1053 1059
 };
1054 1060
 </script>

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

@@ -771,8 +771,8 @@ export default {
771 771
             stockIn: this.recordInfo.tableList,
772 772
             return_remake: this.return_remark,
773 773
           };
774
-         
775
-
774
+          console.log("哈哈哈哈哈哈",params)
775
+          
776 776
           updatePurchaseOrder(
777 777
             params,
778 778
             this.supplier_name,
@@ -860,6 +860,7 @@ export default {
860 860
           var drugList = response.data.data.baseList;
861 861
           var goodList = response.data.data.goodList;
862 862
           for (let i = 0; i < orderInfo.length; i++) {
863
+            orderInfo[i].id = orderInfo[i].id
863 864
             orderInfo[i].supply_count = orderInfo[i].count;
864 865
             orderInfo[i].supply_price = orderInfo[i].price;
865 866
             orderInfo[i].supply_remake = orderInfo[i].remark;

+ 5 - 5
src/xt_pages/supply/goodreturn.vue View File

@@ -157,7 +157,7 @@
157 157
                 icon="el-icon-delete"
158 158
                 size="small"
159 159
                 type="danger"
160
-                @click="toClickOne(scope.row)"
160
+                @click="toClickOne(scope.row,scope.$index)"
161 161
               >删除
162 162
               </el-button>
163 163
           </template>
@@ -331,10 +331,10 @@ export default {
331 331
          this.$message.error("已审核单据,不能删除!")
332 332
          return false
333 333
        }
334
-       if(val.cancelOut.length >0 ){
335
-         this.$message.error("已关联单据,不能删除!")
336
-         return false
337
-       }
334
+      //  if(val.cancelOrder.length >0 ){
335
+      //    this.$message.error("已关联单据,不能删除!")
336
+      //    return false
337
+      //  }
338 338
        this.$confirm('确认删除吗?', '删除', {
339 339
           confirmButtonText: '确 定',
340 340
           cancelButtonText: '取 消',