Bläddra i källkod

11月14日 库存扣减更新

XMLWAN 3 år sedan
förälder
incheckning
fd41a8d610

+ 4 - 4
src/views/layout/Layout.vue Visa fil

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

+ 8 - 5
src/xt_pages/supply/components/Popup.vue Visa fil

@@ -16,8 +16,9 @@
16 16
           </p>
17 17
           <div v-for="(item, index) in orderList" :key="index">
18 18
             <li>
19
-              {{content_2}} {{ item.good_number }}
20
-              <a style="color: blue" @click="toClick_1(item.id)">点击查看</a>
19
+              {{content_2}} {{ item.good_number }}  
20
+             <span v-if="type == 1"><a style="color: blue" @click="toClick_1(item.id)">点击查看</a> </span> 
21
+             <span v-if="type == 2"><a style="color: blue" @click="toClick_2(item.id)">点击查看</a> </span> 
21 22
             </li>
22 23
           </div>
23 24
         </div>
@@ -31,7 +32,7 @@
31 32
 
32 33
 <script>
33 34
 export default {
34
-  props: ["content_2", "content_1","content","number", "orderList"], //props接收
35
+  props: ["content_2", "content_1","content","number", "orderList","type"], //props接收
35 36
   name: "Popup",
36 37
   data() {
37 38
     return {
@@ -46,12 +47,14 @@ export default {
46 47
   created() {},
47 48
   methods: {
48 49
     btnClick() {
49
-      this.show = false;
50
+      this.dialogVisible = false;
50 51
     },
51 52
     toClick_1(id) {
52
-
53 53
       this.$router.push({path:"/good/order/edit?id=" + id});
54 54
     },
55
+    toClick_2(id){
56
+      this.$router.push({path:"/good/return/edit?id="+id})
57
+    }
55 58
   },
56 59
 };
57 60
 </script>

+ 6 - 6
src/xt_pages/supply/components/addGoodReturn.vue Visa fil

@@ -64,18 +64,16 @@
64 64
             type="primary"
65 65
             @click="saveGoodReturn"
66 66
             v-show="showOne"
67
-            >存</el-button
67
+            >存</el-button
68 68
           >
69 69
           <el-button
70 70
             size="small"
71 71
             type="primary"
72
-            @click="saveGoodReturn"
72
+            @click=""
73 73
             v-show="showTwo"
74 74
             >保存</el-button
75 75
           >
76
-          <el-button size="small" type="primary" @click="updatePurchaseOrder"
77
-            >审核</el-button
78
-          >
76
+          <el-button size="small" type="primary" @click="updatePurchaseOrder">审核</el-button>
79 77
           <!-- <el-button size="small" type="primary" @click="toPrint">打印</el-button>
80 78
         <el-button size="small" type="primary" v-if="is_check == 2" @click="checkPurchaseOrder">审核</el-button>
81 79
         <el-button size="small" type="primary" v-if="is_check == 1" @click="checkPurchaseOrder">反审核</el-button> -->
@@ -850,7 +848,7 @@ export default {
850 848
       var id = this.$route.query.id;
851 849
       this.$router.push({ path: "/purchase/order/print?&id=" + id });
852 850
     },
853
-    saveGoodReturnOrder(){
851
+    saveGoodReturn(){
854 852
       var warehouse_out_id = this.$route.query.id
855 853
       this.$refs["tableForm"].validate((valid)=>{
856 854
         if(valid){
@@ -871,6 +869,8 @@ export default {
871 869
             stockIn:this.recordInfo.tableList,
872 870
             return_marke:this.return_remark,
873 871
            }
872
+           console.log("2323323232",this.start_time)
873
+         
874 874
            saveGoodReturnOrder(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name).then(response=>{
875 875
              if(response.data.state == 1){
876 876
                 this.loading = false

+ 22 - 25
src/xt_pages/supply/components/editGoodOrder.vue Visa fil

@@ -429,10 +429,12 @@
429 429
       </div>
430 430
       <!-- <Computed></Computed> -->
431 431
     </div>
432
+    <popup ref="Popup" :content="content" :content_1="content_1" :content_2="content_2" :number="number" :orderList ="orderList" :type="type"></popup>
432 433
   </div>
433 434
 </template>
434 435
 
435 436
 <script>
437
+import popup from "./Popup"
436 438
 import Computed from "../../components/Computed/index_1.vue";
437 439
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
438 440
 import { uParseTime } from "@/utils/tools";
@@ -447,11 +449,13 @@ import {
447 449
   UpdateSupplyWahouseingInfo,
448 450
   getSupplyWarehouseOutById,
449 451
 } from "@/api/supply";
452
+
450 453
 export default {
451 454
   name: "addPurchaseOrder",
452 455
   components: {
453 456
     BreadCrumb,
454 457
     Computed,
458
+    popup,
455 459
   },
456 460
   data() {
457 461
     return {
@@ -459,6 +463,11 @@ export default {
459 463
         { path: false, name: "采购单" },
460 464
         { path: "/supply/good/order/query", name: "编辑采购单" },
461 465
       ],
466
+      content_2:"退库单",
467
+      content:"采购单",
468
+      content_1:"已有以下关联数据,不能反审核",
469
+      type:2,
470
+      orderList:[],
462 471
       showOne: true,
463 472
       showTwo: false,
464 473
       showThree: false,
@@ -901,27 +910,16 @@ export default {
901 910
         this.recordInfo.tableList[i].supply_count = parseInt(
902 911
           this.recordInfo.tableList[i].supply_count
903 912
         );
904
-        this.recordInfo.tableList[i].supply_price =
905
-          this.recordInfo.tableList[i].supply_price.toString();
906
-        this.recordInfo.tableList[i].supply_total_price =
907
-          this.recordInfo.tableList[i].supply_total_price.toString();
908
-        this.recordInfo.tableList[i].supply_total =
909
-          this.recordInfo.tableList[i].supply_total.toString();
913
+        this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString();
914
+        this.recordInfo.tableList[i].supply_total_price =  this.recordInfo.tableList[i].supply_total_price.toString();
915
+        this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString();
910 916
 
911 917
         for (let j = 0; j < this.manufactuerList.length; j++) {
912
-          if (
913
-            this.recordInfo.tableList[i].supply_manufacturer ==
914
-            this.manufactuerList[j].manufacturer_name
915
-          ) {
916
-            this.recordInfo.tableList[i].manufacturer_id =
917
-              this.manufactuerList[j].id;
918
+          if ( this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name) {
919
+            this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id;
918 920
           }
919
-          if (
920
-            this.recordInfo.tableList[i].supply_manufacturer ==
921
-            this.manufactuerList[j].id
922
-          ) {
923
-            this.recordInfo.tableList[i].supply_manufacturer =
924
-              this.manufactuerList[j].manufacturer_name;
921
+          if ( this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].id) {
922
+            this.recordInfo.tableList[i].supply_manufacturer =this.manufactuerList[j].manufacturer_name;
925 923
           }
926 924
         }
927 925
       }
@@ -960,6 +958,7 @@ export default {
960 958
       getGoodOrderCountList(id, warehousing_id).then((response) => {
961 959
         if (response.data.state == 1) {
962 960
           this.$message.success("审核成功!");
961
+          this.is_check = 1
963 962
           this.showOne = false;
964 963
           this.showTwo = true;
965 964
           this.showThree = true;
@@ -1185,8 +1184,9 @@ export default {
1185 1184
           if (msg == 2) {
1186 1185
             var cancelList = response.data.data.cancelList
1187 1186
             console.log("cancelLIST2332322332232323",cancelList)
1188
-            this.$message.error("该单有自动出库或生成了退货单,反审核失败!");
1189
-            return 
1187
+            this.orderList = cancelList
1188
+            this.$refs.Popup.dialogVisible = true
1189
+            return
1190 1190
           }
1191 1191
 
1192 1192
           var purcaseOrder = response.data.data.purcaseOrder;
@@ -1198,9 +1198,7 @@ export default {
1198 1198
           var ids = "";
1199 1199
           // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
1200 1200
           if (goodOrder.length == 0) {
1201
-            this.$router.push({
1202
-              path: "/good/order/add?id=" + id + "&ids=" + ids,
1203
-            });
1201
+            this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + ids});
1204 1202
           }
1205 1203
           for (let i = 0; i < purcaseOrder.length; i++) {
1206 1204
             for (let j = 0; j < drugList.length; j++) {
@@ -1216,8 +1214,7 @@ export default {
1216 1214
             for (let j = 0; j < drugList.length; j++) {
1217 1215
               if (goodOrder[i].is_source == 1) {
1218 1216
                 if (goodOrder[i].supply_unit == drugList[j].max_unit) {
1219
-                  goodOrder[i].count =
1220
-                    goodOrder[i].count * drugList[j].min_number;
1217
+                  goodOrder[i].count = goodOrder[i].count * drugList[j].min_number;
1221 1218
                 }
1222 1219
               }
1223 1220
             }

+ 1 - 3
src/xt_pages/supply/components/editGoodReturn.vue Visa fil

@@ -60,9 +60,7 @@
60 60
         </div>
61 61
         <div>
62 62
           <el-button size="small" type="primary" @click="updateGoodReturn">保存</el-button>
63
-          <el-button size="small" type="primary" @click="updatePurchaseOrder"
64
-            >审核</el-button
65
-          >
63
+          <el-button size="small" type="primary" @click="updatePurchaseOrder">审核</el-button>
66 64
         </div>
67 65
       </div>
68 66
 

+ 4 - 1
src/xt_pages/supply/components/editPurchaseOrder.vue Visa fil

@@ -358,7 +358,7 @@
358 358
     <el-button @click="dialogVisible = false">取 消</el-button>
359 359
   </span>
360 360
   </el-dialog> -->
361
-  <popup ref="Popup" :content="content" :content_1="content_1" :content_2="content_2" :number="number" :orderList ="orderList"></popup>
361
+  <popup ref="Popup" :content="content" :content_1="content_1" :content_2="content_2" :number="number" :orderList ="orderList" :type="type"></popup>
362 362
   </div>
363 363
 </template>
364 364
 
@@ -386,6 +386,7 @@ export default {
386 386
       content_2:"购货单",
387 387
       content:"购货订单",
388 388
       content_1:"已有以下关联数据,不能反审核",
389
+      type:1,
389 390
       Reviewed: false,
390 391
       crumbs: [
391 392
         { path: false, name: "采购订单" },
@@ -442,6 +443,7 @@ export default {
442 443
       showThree: false,
443 444
       orderList: [],
444 445
       return_remark: "",
446
+      
445 447
     };
446 448
   },
447 449
   methods: {
@@ -984,6 +986,7 @@ export default {
984 986
           //如果长度大于0,有购货单不能反审核
985 987
           if (list.length > 0) {
986 988
             this.$refs.Popup.dialogVisible = true
989
+            return 
987 990
           }
988 991
           if (list.length == 0) {
989 992
             this.getReturnOrder()