Browse Source

11月14日 库存扣减更新

XMLWAN 3 years ago
parent
commit
fd41a8d610

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

16
           <i class="iconfont icon-computer_fill navIcon"></i>
16
           <i class="iconfont icon-computer_fill navIcon"></i>
17
           <p>透析管理</p>
17
           <p>透析管理</p>
18
         </div>
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
         <div v-if="kucunShow" :class="index == 3 ? 'navOne navActive' : 'navOne'" @click="clickActive(3,'库房管理')">
23
         <div v-if="kucunShow" :class="index == 3 ? 'navOne navActive' : 'navOne'" @click="clickActive(3,'库房管理')">
24
           <i class="iconfont icon-kccx navIcon"></i>
24
           <i class="iconfont icon-kccx navIcon"></i>
25
           <p>库房管理</p>
25
           <p>库房管理</p>

+ 8 - 5
src/xt_pages/supply/components/Popup.vue View File

16
           </p>
16
           </p>
17
           <div v-for="(item, index) in orderList" :key="index">
17
           <div v-for="(item, index) in orderList" :key="index">
18
             <li>
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
             </li>
22
             </li>
22
           </div>
23
           </div>
23
         </div>
24
         </div>
31
 
32
 
32
 <script>
33
 <script>
33
 export default {
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
   name: "Popup",
36
   name: "Popup",
36
   data() {
37
   data() {
37
     return {
38
     return {
46
   created() {},
47
   created() {},
47
   methods: {
48
   methods: {
48
     btnClick() {
49
     btnClick() {
49
-      this.show = false;
50
+      this.dialogVisible = false;
50
     },
51
     },
51
     toClick_1(id) {
52
     toClick_1(id) {
52
-
53
       this.$router.push({path:"/good/order/edit?id=" + id});
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
 </script>
60
 </script>

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

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

+ 22 - 25
src/xt_pages/supply/components/editGoodOrder.vue View File

429
       </div>
429
       </div>
430
       <!-- <Computed></Computed> -->
430
       <!-- <Computed></Computed> -->
431
     </div>
431
     </div>
432
+    <popup ref="Popup" :content="content" :content_1="content_1" :content_2="content_2" :number="number" :orderList ="orderList" :type="type"></popup>
432
   </div>
433
   </div>
433
 </template>
434
 </template>
434
 
435
 
435
 <script>
436
 <script>
437
+import popup from "./Popup"
436
 import Computed from "../../components/Computed/index_1.vue";
438
 import Computed from "../../components/Computed/index_1.vue";
437
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
439
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
438
 import { uParseTime } from "@/utils/tools";
440
 import { uParseTime } from "@/utils/tools";
447
   UpdateSupplyWahouseingInfo,
449
   UpdateSupplyWahouseingInfo,
448
   getSupplyWarehouseOutById,
450
   getSupplyWarehouseOutById,
449
 } from "@/api/supply";
451
 } from "@/api/supply";
452
+
450
 export default {
453
 export default {
451
   name: "addPurchaseOrder",
454
   name: "addPurchaseOrder",
452
   components: {
455
   components: {
453
     BreadCrumb,
456
     BreadCrumb,
454
     Computed,
457
     Computed,
458
+    popup,
455
   },
459
   },
456
   data() {
460
   data() {
457
     return {
461
     return {
459
         { path: false, name: "采购单" },
463
         { path: false, name: "采购单" },
460
         { path: "/supply/good/order/query", name: "编辑采购单" },
464
         { path: "/supply/good/order/query", name: "编辑采购单" },
461
       ],
465
       ],
466
+      content_2:"退库单",
467
+      content:"采购单",
468
+      content_1:"已有以下关联数据,不能反审核",
469
+      type:2,
470
+      orderList:[],
462
       showOne: true,
471
       showOne: true,
463
       showTwo: false,
472
       showTwo: false,
464
       showThree: false,
473
       showThree: false,
901
         this.recordInfo.tableList[i].supply_count = parseInt(
910
         this.recordInfo.tableList[i].supply_count = parseInt(
902
           this.recordInfo.tableList[i].supply_count
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
         for (let j = 0; j < this.manufactuerList.length; j++) {
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
       getGoodOrderCountList(id, warehousing_id).then((response) => {
958
       getGoodOrderCountList(id, warehousing_id).then((response) => {
961
         if (response.data.state == 1) {
959
         if (response.data.state == 1) {
962
           this.$message.success("审核成功!");
960
           this.$message.success("审核成功!");
961
+          this.is_check = 1
963
           this.showOne = false;
962
           this.showOne = false;
964
           this.showTwo = true;
963
           this.showTwo = true;
965
           this.showThree = true;
964
           this.showThree = true;
1185
           if (msg == 2) {
1184
           if (msg == 2) {
1186
             var cancelList = response.data.data.cancelList
1185
             var cancelList = response.data.data.cancelList
1187
             console.log("cancelLIST2332322332232323",cancelList)
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
           var purcaseOrder = response.data.data.purcaseOrder;
1192
           var purcaseOrder = response.data.data.purcaseOrder;
1198
           var ids = "";
1198
           var ids = "";
1199
           // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
1199
           // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
1200
           if (goodOrder.length == 0) {
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
           for (let i = 0; i < purcaseOrder.length; i++) {
1203
           for (let i = 0; i < purcaseOrder.length; i++) {
1206
             for (let j = 0; j < drugList.length; j++) {
1204
             for (let j = 0; j < drugList.length; j++) {
1216
             for (let j = 0; j < drugList.length; j++) {
1214
             for (let j = 0; j < drugList.length; j++) {
1217
               if (goodOrder[i].is_source == 1) {
1215
               if (goodOrder[i].is_source == 1) {
1218
                 if (goodOrder[i].supply_unit == drugList[j].max_unit) {
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 View File

60
         </div>
60
         </div>
61
         <div>
61
         <div>
62
           <el-button size="small" type="primary" @click="updateGoodReturn">保存</el-button>
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
         </div>
64
         </div>
67
       </div>
65
       </div>
68
 
66
 

+ 4 - 1
src/xt_pages/supply/components/editPurchaseOrder.vue View File

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