Browse Source

11月14日 库存扣减更新

XMLWAN 3 years ago
parent
commit
866e8b44d0

+ 8 - 0
src/api/supply.js View File

@@ -135,3 +135,11 @@ export function getGoodOrderCountList(id, warehousing_id, params) {
135 135
     params: params
136 136
   })
137 137
 }
138
+
139
+export function ModefySupplyWarehousing(params) {
140
+  return request({
141
+    url: '/api/supply/modefysupplywarehousing',
142
+    method: 'get',
143
+    params: params
144
+  })
145
+}

+ 4 - 4
src/lang/zh.js View File

@@ -137,10 +137,10 @@ export default {
137 137
     addStockIn: '入库',
138 138
     stockQuery: '库存查询',
139 139
     supplyQuery: '供应商管理',
140
-    purchaseOrderQuery: '购订单',
141
-    goodOrderQuery: '购单',
142
-    goodReturnQuery:'退货单',
143
-    addPurchaseOrder: '新增购订单',
140
+    purchaseOrderQuery: '购订单',
141
+    goodOrderQuery: '购单',
142
+    goodReturnQuery: '退货单',
143
+    addPurchaseOrder: '新增购订单',
144 144
     workforce_template: '排班模板设置',
145 145
     statistics: '统计分析',
146 146
     statisticalConfig: '统计配置',

+ 42 - 19
src/xt_pages/supply/components/addGoodOrder.vue View File

@@ -156,13 +156,13 @@
156 156
         </template>
157 157
     </el-table-column>
158 158
 
159
-    <el-table-column label="购单价" align="center" width="120px">
159
+    <el-table-column label="购单价" align="center" width="120px">
160 160
         <template slot-scope="scope">
161 161
         <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
162 162
         </template>
163 163
     </el-table-column>
164 164
 
165
-    <el-table-column label="购金额" align="center" width="120px">
165
+    <el-table-column label="购金额" align="center" width="120px">
166 166
         <template slot-scope="scope">
167 167
           {{calculate(scope.row.supply_count * scope.row.supply_price)}}
168 168
         </template>
@@ -276,8 +276,8 @@ BreadCrumb
276 276
 data() {
277 277
 return {
278 278
     crumbs: [
279
-       { path: false, name: "购单" },
280
-       { path: "/spply/query", name: "新增购单" }
279
+       { path: false, name: "购单" },
280
+       { path: "/supply/good/order/query", name: "新增购单" }
281 281
     ],
282 282
     showTwo:true,
283 283
     showOne:false,
@@ -309,8 +309,8 @@ return {
309 309
     supplyList:[],
310 310
     rate_of_concession:"",
311 311
     discount_amount:"",
312
-    start_time:new Date(),
313
-    end_time:new Date(),
312
+    start_time:"",
313
+    end_time:"",
314 314
     tableRules: {
315 315
      name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
316 316
      supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
@@ -372,11 +372,22 @@ getInitOrder(){
372 372
         drugList[i].type = 1
373 373
         drugList[i].supply_price = drugList[i].last_price
374 374
         drugList[i].name = drugList[i].drug_name
375
-        drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
375
+        if(drugList[i].max_unit != drugList[i].min_unit){
376
+          drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
377
+        }
378
+        if(drugList[i].max_unit == drugList[i].min_unit){
379
+          drugList[i].unitList = [{id:1,name:""}]
380
+        }
381
+       
376 382
         drugList[i].supply_unit = drugList[i].max_unit 
377 383
         for(let j=0;j<drugList[i].unitList.length;j++){
378
-           drugList[i].unitList[0].name = drugList[i].max_unit
379
-           drugList[i].unitList[1].name = drugList[i].min_unit
384
+          if(drugList[i].max_unit != drugList[i].min_unit){
385
+            drugList[i].unitList[0].name = drugList[i].max_unit
386
+            drugList[i].unitList[1].name = drugList[i].min_unit
387
+          }
388
+           if(drugList[i].max_unit == drugList[i].min_unit){
389
+             drugList[i].unitList[0].name = drugList[i].max_unit
390
+           }
380 391
         }
381 392
         this.tabList.push(drugList[i])
382 393
         }
@@ -405,7 +416,7 @@ getInitOrder(){
405 416
         goodList[i].supply_remake = ""
406 417
         goodList[i].type = 2
407 418
         goodList[i].name = goodList[i].good_name
408
-        goodList[i].unitList =  [{id:1,name:""},{id:2,name:""}]
419
+        goodList[i].unitList =  [{id:1,name:""}]
409 420
         goodList[i].supply_unit = goodList[i].packing_unit
410 421
         for(let j=0;j<goodList[i].unitList.length;j++){
411 422
            goodList[i].unitList[0].name = goodList[i].packing_unit 
@@ -605,9 +616,15 @@ getTimes(time) {
605 616
            if(orderInfo[i].is_source == 1){
606 617
             for(let j=0;j<drugList.length;j++){
607 618
                 if( orderInfo[i].project_id == drugList[j].id){
608
-                  orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
609
-                  orderInfo[i].unitList[0].name = drugList[j].max_unit
610
-                  orderInfo[i].unitList[1].name = drugList[j].min_unit
619
+                  if(drugList[j].max_unit!=drugList[j].min_unit){
620
+                    orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
621
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit
622
+                    orderInfo[i].unitList[1].name = drugList[j].min_unit
623
+                  }
624
+                  if(drugList[j].max_unit == drugList[j].min_unit){
625
+                    orderInfo[i].unitList = [{id:1,name:""}]
626
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit
627
+                  }
611 628
                 }
612 629
              }  
613 630
             } 
@@ -685,7 +702,7 @@ getTimes(time) {
685 702
              this.payment =warehouseOut.payment
686 703
              this.arrearage =warehouseOut.arrearage
687 704
              this.supplier_name = warehouseOut.supplier_id
688
-            
705
+             this.start_time = this.getTimes(warehouseOut.document_date)
689 706
             for(let i=0;i< orderInfo.length;i++){
690 707
               orderInfo[i].supply_count =  orderInfo[i].count
691 708
               orderInfo[i].supply_price =  orderInfo[i].price
@@ -700,9 +717,14 @@ getTimes(time) {
700 717
             if(orderInfo[i].is_source == 1){
701 718
               for(let j=0;j<this.drugList.length;j++){
702 719
                   if( orderInfo[i].project_id == this.drugList[j].id){
703
-                    orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
704
-                    orderInfo[i].unitList[0].name = this.drugList[j].max_unit
705
-                    orderInfo[i].unitList[1].name = this.drugList[j].min_unit
720
+                    if(this.drugList[j].max_unit !=this.drugList[j].min_unit){
721
+                      orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
722
+                      orderInfo[i].unitList[0].name = this.drugList[j].max_unit
723
+                      orderInfo[i].unitList[1].name = this.drugList[j].min_unit
724
+                    }
725
+                    if(this.drugList[j].max_unit ==this.drugList[j].min_unit){
726
+                      orderInfo[i].unitList[0].name = this.drugList[j].max_unit
727
+                    }
706 728
                   }
707 729
               }  
708 730
               } 
@@ -753,7 +775,7 @@ getTimes(time) {
753 775
 
754 776
         }
755 777
     }
756
-    var start = this.getTimes(this.start_time)
778
+    var start = this.start_time
757 779
     this.$refs["tableForm"].validate((valid)=>{
758 780
         if(valid){
759 781
            this.loading = true
@@ -802,7 +824,8 @@ created(){
802 824
     if(parseInt(this.$route.query.id) > 0){
803 825
       this.getPurchaseOrderDetail()
804 826
     }
805
-  
827
+    this.start_time = this.getTimes(new Date())
828
+    this.end_time = this.getTimes(new Date())
806 829
 }
807 830
 };
808 831
 </script>

+ 43 - 50
src/xt_pages/supply/components/addPurchaseOrder.vue View File

@@ -130,13 +130,13 @@
130 130
 
131 131
    
132 132
 
133
-    <el-table-column label="购单价" align="center" width="120px">
133
+    <el-table-column label="购单价" align="center" width="120px">
134 134
         <template slot-scope="scope">
135 135
         <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
136 136
         </template>
137 137
     </el-table-column>
138 138
 
139
-    <el-table-column label="购金额" align="center" width="120px">
139
+    <el-table-column label="购金额" align="center" width="120px">
140 140
         <template slot-scope="scope">
141 141
           {{calculate(scope.row.supply_count * scope.row.supply_price)}}
142 142
         </template>
@@ -212,29 +212,15 @@ import {getInitOrder,savePurchaseOrder,updatePurchaseOrder,checkPurchaseOrder} f
212 212
 import {getDataConfig } from '@/utils/data'
213 213
 export default {
214 214
 name: "addPurchaseOrder",
215
-created() {
216
-this.org_id =  this.$store.getters.xt_user.org_id
217 215
 
218
-var start_time =  window.sessionStorage.getItem('start_time')
219
-var end_time =  window.sessionStorage.getItem('end_time')
220
-
221
-if(start_time !=null){
222
-    this.start_time = start_time
223
-}
224
-if(end_time!=null){
225
-    this.end_time = end_time
226
-}
227
-window.sessionStorage.removeItem('start_time')
228
-window.sessionStorage.removeItem('end_time')
229
-},
230 216
 components: {
231 217
 BreadCrumb
232 218
 },
233 219
 data() {
234 220
 return {
235 221
     crumbs: [
236
-       { path: false, name: "购订单" },
237
-       { path: "/spply/query", name: "新增购订单" }
222
+       { path: false, name: "采购订单" },
223
+       { path: "/supply/query", name: "新增采购订单" }
238 224
     ],
239 225
     showTwo:true,
240 226
     showOne:false,
@@ -266,8 +252,8 @@ return {
266 252
     supplyList:[],
267 253
     rate_of_concession:"",
268 254
     discount_amount:"",
269
-    start_time:new Date(),
270
-    end_time:new Date(),
255
+    start_time:"",
256
+    end_time:"",
271 257
     tableRules: {
272 258
      name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
273 259
      supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
@@ -329,10 +315,22 @@ getInitOrder(){
329 315
         drugList[i].supply_price = drugList[i].last_price
330 316
         drugList[i].name = drugList[i].drug_name
331 317
         drugList[i].supply_unit = drugList[i].max_unit
332
-        drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
318
+        if(drugList[i].max_unit!=drugList[i].min_unit){
319
+          drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
320
+        }
321
+        if(drugList[i].max_unit ==drugList[i].min_unit){
322
+          drugList[i].unitList = [{id:1,name:""}]
323
+        }
324
+       
333 325
         for(let j=0;j<drugList[i].unitList.length;j++){
334
-           drugList[i].unitList[0].name = drugList[i].max_unit
335
-           drugList[i].unitList[1].name = drugList[i].min_unit
326
+           if(drugList[i].max_unit!=drugList[i].min_unit){
327
+             drugList[i].unitList[0].name = drugList[i].max_unit
328
+             drugList[i].unitList[1].name = drugList[i].min_unit
329
+           }
330
+           if(drugList[i].max_unit ==drugList[i].min_unit){
331
+             drugList[i].unitList[0].name = drugList[i].max_unit
332
+           }
333
+          
336 334
         }
337 335
         this.tabList.push(drugList[i])
338 336
         }
@@ -364,7 +362,7 @@ getInitOrder(){
364 362
         goodList[i].type = 2
365 363
         goodList[i].name = goodList[i].good_name
366 364
         goodList[i].supply_unit = goodList[i].packing_unit
367
-        goodList[i].unitList =  [{id:1,name:""},{id:2,name:""}]
365
+        goodList[i].unitList =  [{id:1,name:""}]
368 366
         for(let j=0;j<goodList[i].unitList.length;j++){
369 367
            goodList[i].unitList[0].name = goodList[i].packing_unit 
370 368
         }
@@ -461,8 +459,8 @@ savePurchaseOrder(){
461 459
 
462 460
             }
463 461
         }
464
-        var start = this.getTimes(this.start_time)
465
-        var end = this.getTimes(this.end_time)
462
+        var start = this.start_time
463
+        var end = this.end_time
466 464
         const params = {
467 465
             'stockIn': this.recordInfo.tableList
468 466
         }
@@ -476,15 +474,26 @@ savePurchaseOrder(){
476 474
                 var warehouseInfo = response.data.data.warehouseInfo
477 475
                 this.number  = warehouseInfo.number
478 476
                 this.id = warehouseInfo.id
477
+                this.supplier_name = warehouseInfo.supplier_id
478
+                this.rate_of_concession = warehouseInfo.rate_of_concession
479
+                this.discount_amount = warehouseInfo.discount_amount
480
+                this.start_time = this.getTimes(warehouseInfo.document_date)
481
+                this.end_time = this.getTimes(warehouseInfo.delivery_date)
479 482
                 this.recordInfo.tableList = []
480 483
                 var orderInfo = response.data.data.orderInfo
481 484
                 for(let i=0;i<orderInfo.length;i++){
482 485
                    if(orderInfo[i].is_source == 1){
483 486
                     for(let j=0;j<this.drugList.length;j++){
484 487
                        if(orderInfo[i].project_id == this.drugList[j].id){
485
-                          orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
486
-                          orderInfo[i].unitList[0].name = this.drugList[j].max_unit
487
-                          orderInfo[i].unitList[1].name = this.drugList[j].min_unit
488
+                         if(this.drugList[j].max_unit !=this.drugList[j].min_unit){
489
+                            orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
490
+                            orderInfo[i].unitList[0].name = this.drugList[j].max_unit
491
+                            orderInfo[i].unitList[1].name = this.drugList[j].min_unit
492
+                         }
493
+                         if(this.drugList[j].max_unit ==this.drugList[j].min_unit){
494
+                            orderInfo[i].unitList = [{id:1,name:""}]
495
+                            orderInfo[i].unitList[0].name = this.drugList[j].max_unit
496
+                         }
488 497
                        }
489 498
                     }  
490 499
                    } 
@@ -505,25 +514,7 @@ savePurchaseOrder(){
505 514
                 }
506 515
                 console.log("orderINFO23323232",orderInfo)
507 516
                 this.recordInfo.tableList = orderInfo
508
-                // for(let i=0;i<orderInfo.length;i++){
509
-                //    orderInfo[i].name = "" 
510
-                //    orderInfo[i].supply_name = ""
511
-                //    orderInfo[i].supply_specification_name = ""
512
-                //   if(orderInfo[i].is_source == 1){
513
-                //     for(let j=0;j<this.drugList.length;j++){
514
-                //        if(orderInfo[i].project_id == this.drugList[j].id){
515
-                //           orderInfo[i].name = this.drugList[j].drug_name
516
-                //        }
517
-                //     }
518
-                //   }
519
-                //   if(orderInfo[i].is_source == 2){
520
-                //     for(let y=0;y<this.goodList.length;y++){
521
-                //        if(orderInfo[i].project_id = this.goodList[y].id){
522
-                //           orderInfo[i].name = this.goodList[y].good_name
523
-                //        }
524
-                //     }
525
-                //   }
526
-                // }
517
+                
527 518
                 this.showTwo = false
528 519
                 this.showOne = true
529 520
             }
@@ -603,8 +594,8 @@ getTimes(time) {
603 594
               }
604 595
            }
605 596
         }
606
-        var start = this.getTimes(this.start_time)
607
-        var end = this.getTimes(this.end_time)
597
+        var start = this.start_time
598
+        var end =   this.end_time
608 599
         const params = {
609 600
         'stockIn': this.recordInfo.tableList
610 601
         }
@@ -686,6 +677,8 @@ created(){
686 677
     tempObj["supply_unit"] = ""
687 678
     this.recordInfo.tableList.push(tempObj)
688 679
     this.getInitOrder()
680
+    this.start_time = this.getTimes(new Date())
681
+    this.end_time = this.getTimes(new Date())
689 682
 }
690 683
 };
691 684
 </script>

+ 47 - 16
src/xt_pages/supply/components/editGoodOrder.vue View File

@@ -155,13 +155,13 @@
155 155
         </template>
156 156
     </el-table-column>
157 157
 
158
-    <el-table-column label="购单价" align="center" width="120px">
158
+    <el-table-column label="购单价" align="center" width="120px">
159 159
         <template slot-scope="scope">
160 160
         <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
161 161
         </template>
162 162
     </el-table-column>
163 163
 
164
-    <el-table-column label="购金额" align="center" width="120px">
164
+    <el-table-column label="购金额" align="center" width="120px">
165 165
         <template slot-scope="scope">
166 166
           {{calculate(scope.row.supply_count * scope.row.supply_price)}}
167 167
         </template>
@@ -266,7 +266,7 @@
266 266
 <script>
267 267
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
268 268
 import {uParseTime } from '@/utils/tools'
269
-import {getInitOrder,checkPurchaseOrder,getGoodOrderDetail,updateGoodOrder,getGoodOrderCountList} from "@/api/supply"
269
+import {getInitOrder,checkPurchaseOrder,getGoodOrderDetail,updateGoodOrder,getGoodOrderCountList,ModefySupplyWarehousing} from "@/api/supply"
270 270
 export default {
271 271
 name: "addPurchaseOrder",
272 272
 components: {
@@ -275,8 +275,8 @@ BreadCrumb
275 275
 data() {
276 276
 return {
277 277
     crumbs: [
278
-       { path: false, name: "购单" },
279
-       { path: "/spply/query", name: "编辑购单" }
278
+       { path: false, name: "购单" },
279
+       { path: "/supply/good/order/query", name: "编辑购单" }
280 280
     ],
281 281
     showTwo:true,
282 282
     showOne:false,
@@ -308,8 +308,8 @@ return {
308 308
     supplyList:[],
309 309
     rate_of_concession:"",
310 310
     discount_amount:"",
311
-    start_time:new Date(),
312
-    end_time:new Date(),
311
+    start_time:"",
312
+    end_time:"",
313 313
     tableRules: {
314 314
      name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
315 315
      supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
@@ -371,13 +371,24 @@ getInitOrder(){
371 371
         drugList[i].type = 1
372 372
         drugList[i].supply_price = drugList[i].last_price
373 373
         drugList[i].name = drugList[i].drug_name
374
-        drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
374
+        if(drugList[i].max_unit != drugList[i].min_unit){
375
+          drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
376
+        }
377
+        if(drugList[i].max_unit == drugList[i].min_unit){
378
+          drugList[i].unitList = [{id:1,name:""}]
379
+        }
380
+       
375 381
         drugList[i].warehouse_info_id = 0
376 382
         drugList[i].warehousing_id= 0
377 383
         drugList[i].supply_unit = drugList[i].max_unit 
378 384
         for(let j=0;j<drugList[i].unitList.length;j++){
379
-           drugList[i].unitList[0].name = drugList[i].max_unit
380
-           drugList[i].unitList[1].name = drugList[i].min_unit
385
+          if(drugList[i].max_unit != drugList[i].min_unit){
386
+            drugList[i].unitList[0].name = drugList[i].max_unit
387
+            drugList[i].unitList[1].name = drugList[i].min_unit
388
+          }
389
+          if(drugList[i].max_unit  == drugList[i].min_unit){
390
+            drugList[i].unitList[0].name = drugList[i].max_unit
391
+          }
381 392
         }
382 393
         this.tabList.push(drugList[i])
383 394
         }
@@ -406,7 +417,7 @@ getInitOrder(){
406 417
         goodList[i].supply_remake = ""
407 418
         goodList[i].type = 2
408 419
         goodList[i].name = goodList[i].good_name
409
-        goodList[i].unitList =  [{id:1,name:""},{id:2,name:""}]
420
+        goodList[i].unitList =  [{id:1,name:""}]
410 421
         goodList[i].supply_unit = goodList[i].packing_unit
411 422
         goodList[i].warehouse_info_id = 0
412 423
         goodList[i].warehousing_id= 0
@@ -593,6 +604,7 @@ getTimes(time) {
593 604
         this.arrearage = out.arrearage
594 605
         this.number = out.number
595 606
         this.good_number = out.good_number
607
+        this.start_time = this.getTimes(out.document_date)
596 608
         var orderInfo = response.data.data.list
597 609
         
598 610
         var drugList = response.data.data.drugList
@@ -612,9 +624,16 @@ getTimes(time) {
612 624
            if(orderInfo[i].is_source == 1){
613 625
             for(let j=0;j<drugList.length;j++){
614 626
                 if( orderInfo[i].project_id == drugList[j].id){
615
-                  orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
616
-                  orderInfo[i].unitList[0].name = drugList[j].max_unit
617
-                  orderInfo[i].unitList[1].name = drugList[j].min_unit
627
+                  if(drugList[j].max_unit!=drugList[j].min_unit){
628
+                    orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
629
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit
630
+                    orderInfo[i].unitList[1].name = drugList[j].min_unit
631
+                  }
632
+                  if(drugList[j].max_unit ==drugList[j].min_unit){
633
+                    orderInfo[i].unitList = [{id:1,name:""}]
634
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit
635
+                  }
636
+                
618 637
                 }
619 638
              }  
620 639
             } 
@@ -669,7 +688,7 @@ getTimes(time) {
669 688
 
670 689
         }
671 690
     }
672
-    var start = this.getTimes(this.start_time)
691
+    var start = this.start_time
673 692
     this.$refs["tableForm"].validate((valid)=>{
674 693
         if(valid){
675 694
            this.loading = true
@@ -785,6 +804,17 @@ getTimes(time) {
785 804
         }
786 805
       }
787 806
     })
807
+  },
808
+  ModefySupplyWarehousing(is_warehouse,warehousing_id){
809
+     var params = {
810
+       is_warehouse:is_warehouse,
811
+       warehousing_id:warehousing_id,
812
+     }
813
+    ModefySupplyWarehousing(params).then(response=>{
814
+      if(response.data.state == 1){
815
+        var msg = response.data.data.msg
816
+      }
817
+    })
788 818
   }
789 819
 },
790 820
 created(){
@@ -817,7 +847,8 @@ created(){
817 847
     if(parseInt(this.$route.query.id) > 0){
818 848
       this.getGoodOrderDetail()
819 849
     }
820
-  
850
+    this.start_time = this.getTimes(new Date())
851
+    this.end_time = this.getTimes(new Date())
821 852
 }
822 853
 };
823 854
 </script>

+ 45 - 23
src/xt_pages/supply/components/editPurchaseOrder.vue View File

@@ -8,7 +8,7 @@
8 8
     <div>
9 9
         <span style="color:red">*</span><span>供应商:</span>
10 10
         <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
11
-        @change="changeTypeName">
11
+        @change="changeTypeName" :disabled="disabled">
12 12
         <el-option
13 13
             v-for="item in supplyList"
14 14
             :key="item.id"
@@ -29,6 +29,7 @@
29 29
         format="yyyy-MM-dd"
30 30
         value-format="yyyy-MM-dd"
31 31
         @change="startTimeChange"
32
+        :disabled="disabled"
32 33
         ></el-date-picker>
33 34
         <span>交货日期:</span>
34 35
         <el-date-picker
@@ -43,12 +44,13 @@
43 44
             format="yyyy-MM-dd"
44 45
             value-format="yyyy-MM-dd"
45 46
             @change="endTimeChange"
47
+            :disabled="disabled"
46 48
         ></el-date-picker>
47 49
         <span>单据编码:{{number}}</span>
48 50
 
49 51
     </div>
50 52
     <div>
51
-        <el-button size="small" type="primary" @click="toAdd" v-show="showOne">生成购单</el-button>
53
+        <el-button size="small" type="primary" @click="toAdd" v-show="showOne">生成购单</el-button>
52 54
         <el-button size="small" type="primary" @click="updatePurchaseOrder">修改</el-button>
53 55
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
54 56
         <el-button size="small" type="primary" v-if="is_check == 2" @click="checkPurchaseOrder" v-show="showTwo">审核</el-button>
@@ -135,13 +137,13 @@
135 137
         </template>
136 138
     </el-table-column>
137 139
 
138
-    <el-table-column label="购单价" align="center" width="120px">
140
+    <el-table-column label="购单价" align="center" width="120px">
139 141
         <template slot-scope="scope">
140 142
         <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
141 143
         </template>
142 144
     </el-table-column>
143 145
 
144
-    <el-table-column label="购金额" align="center" width="120px">
146
+    <el-table-column label="购金额" align="center" width="120px">
145 147
         <template slot-scope="scope">
146 148
           {{calculate(scope.row.supply_count * scope.row.supply_price)}}
147 149
         </template>
@@ -149,7 +151,7 @@
149 151
 
150 152
     <el-table-column label="生产厂家" align="center" width="200px">
151 153
         <template slot-scope="scope">
152
-           <el-select size="small" v-model="scope.row.supply_manufacturer" filterable placeholder="请选择厂商" :disabled="disabled">
154
+           <el-select size="small" v-model="scope.row.supply_manufacturer" filterable placeholder="请选择厂家" :disabled="true">
153 155
                 <el-option
154 156
                   v-for="(option, index) in manufactuerList"
155 157
                   :key="index"
@@ -163,7 +165,7 @@
163 165
 
164 166
     <el-table-column label="批准文号" align="center" width="200px">
165 167
         <template slot-scope="scope">
166
-        <el-input v-model="scope.row.supply_license_number" style="width:160px" :disabled="disabled"></el-input>
168
+        <el-input v-model="scope.row.supply_license_number" style="width:160px" :disabled="true"></el-input>
167 169
         </template>
168 170
     </el-table-column>
169 171
  
@@ -200,9 +202,9 @@
200 202
       合计:{{getAllPrice()}} 元
201 203
    </div>
202 204
    <div style="margin-top:10px">
203
-        <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession" @input='addressChange'></el-input>%</span>
205
+        <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession" @input='addressChange' :disabled="disabled"></el-input>%</span>
204 206
 
205
-        <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
207
+        <span>优惠金额:<el-input style="width:100px" v-model="discount_amount" :disabled="disabled"></el-input></span>
206 208
 
207 209
     </div>
208 210
 </div>
@@ -212,9 +214,9 @@
212 214
   :visible.sync="dialogVisible"
213 215
   width="30%">
214 216
   <span>
215
-    购订单{{number}}已有以下关联数据,不能反审核
217
+    购订单{{number}}已有以下关联数据,不能反审核
216 218
     <div v-for="(item,index) in orderList" :key="index">
217
-        <li>购单{{item.good_number}}</li> <a @click="toClick(item.id)">点击查看</a>
219
+        <li>购单{{item.good_number}}</li> <a @click="toClick(item.id)">点击查看</a>
218 220
     </div>
219 221
   </span>
220 222
   <span slot="footer" class="dialog-footer">
@@ -236,8 +238,8 @@ BreadCrumb
236 238
 data() {
237 239
 return {
238 240
     crumbs: [
239
-       { path: false, name: "购订单" },
240
-       { path: "/spply/query", name: "编辑购订单" }
241
+       { path: false, name: "购订单" },
242
+       { path: "/supply/query", name: "编辑购订单" }
241 243
     ],
242 244
     showTwo:true,
243 245
     showOne:false,
@@ -269,8 +271,6 @@ return {
269 271
     supplyList:[],
270 272
     rate_of_concession:"",
271 273
     discount_amount:"",
272
-    start_time:new Date(),
273
-    end_time:new Date(),
274 274
     tableRules: {
275 275
      name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
276 276
      supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
@@ -327,11 +327,23 @@ getInitOrder(){
327 327
         drugList[i].type = 1
328 328
         drugList[i].supply_price = drugList[i].last_price
329 329
         drugList[i].name = drugList[i].drug_name
330
-        drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
330
+        if(drugList[i].max_unit!=drugList[i].min_unit){
331
+          drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
332
+        }
333
+        if(drugList[i].max_unit == drugList[i].min_unit){
334
+          drugList[i].unitList = [{id:1,name:""}]
335
+        }
336
+      
331 337
         drugList[i].supply_unit = drugList[i].max_unit 
332 338
         for(let j=0;j<drugList[i].unitList.length;j++){
333
-           drugList[i].unitList[0].name = drugList[i].max_unit
334
-           drugList[i].unitList[1].name = drugList[i].min_unit
339
+          if(drugList[i].max_unit!=drugList[i].min_unit){
340
+            drugList[i].unitList[0].name = drugList[i].max_unit
341
+            drugList[i].unitList[1].name = drugList[i].min_unit
342
+          }
343
+          if(drugList[i].max_unit ==drugList[i].min_unit){
344
+            drugList[i].unitList[0].name = drugList[i].max_unit
345
+          }
346
+         
335 347
         }
336 348
         this.tabList.push(drugList[i])
337 349
         }
@@ -360,7 +372,7 @@ getInitOrder(){
360 372
         goodList[i].supply_remake = ""
361 373
         goodList[i].type = 2
362 374
         goodList[i].name = goodList[i].good_name
363
-        goodList[i].unitList =  [{id:1,name:""},{id:2,name:""}]
375
+        goodList[i].unitList =  [{id:1,name:""}]
364 376
         goodList[i].supply_unit = goodList[i].packing_unit
365 377
         for(let j=0;j<goodList[i].unitList.length;j++){
366 378
            goodList[i].unitList[0].name = goodList[i].packing_unit 
@@ -523,8 +535,8 @@ getTimes(time) {
523 535
               }
524 536
            }
525 537
         }
526
-        var start = this.getTimes(this.start_time)
527
-        var end = this.getTimes(this.end_time)
538
+        var start = this.start_time
539
+        var end = this.end_time
528 540
         const params = {
529 541
         'stockIn': this.recordInfo.tableList
530 542
         }
@@ -580,7 +592,10 @@ getTimes(time) {
580 592
         this.supplier_name = info.supplier_id
581 593
         this.rate_of_concession = info.rate_of_concession
582 594
         this.discount_amount = info.discount_amount
595
+        this.start_time = this.getTimes(info.document_date)
596
+        this.end_time = this.getTimes(info.delivery_date)
583 597
         var orderInfo = response.data.data.orderInfo
598
+
584 599
         if(info.is_check == 2){
585 600
            this.disabled = false
586 601
            this.showOne = false
@@ -606,9 +621,16 @@ getTimes(time) {
606 621
            if(orderInfo[i].is_source == 1){
607 622
             for(let j=0;j<drugList.length;j++){
608 623
                 if(orderInfo[i].project_id == drugList[j].id){
609
-                  orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
610
-                  orderInfo[i].unitList[0].name = drugList[j].max_unit
611
-                  orderInfo[i].unitList[1].name = drugList[j].min_unit
624
+                  if(drugList[j].max_unit != drugList[j].min_unit){
625
+                    orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
626
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit
627
+                    orderInfo[i].unitList[1].name = drugList[j].min_unit
628
+                  }
629
+                  if(drugList[j].max_unit  == drugList[j].min_unit){
630
+                    orderInfo[i].unitList = [{id:1,name:""}]
631
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit
632
+                  }
633
+                 
612 634
                 }
613 635
              }  
614 636
             } 

+ 6 - 5
src/xt_pages/supply/goodOrderQuery.vue View File

@@ -90,12 +90,12 @@
90 90
               <span>{{getName(scope.row.supplier_id)}}</span>
91 91
             </template>
92 92
          </el-table-column>
93
-        <el-table-column label="关联购订单号" align="center" width="200">
93
+        <el-table-column label="关联购订单号" align="center" width="200">
94 94
           <template slot-scope="scope">
95 95
             <span>{{scope.row.number}}</span>
96 96
           </template>
97 97
         </el-table-column>
98
-        <el-table-column label="购金额" align="center">
98
+        <el-table-column label="购金额" align="center">
99 99
           <template slot-scope="scope">
100 100
              <span v-if="getAllBuyPrice(scope.row.orderOut)>0">{{getAllBuyPrice(scope.row.orderOut)}}</span> 
101 101
           </template>
@@ -189,14 +189,14 @@ export default {
189 189
     return {
190 190
       crumbs: [
191 191
         { path: false, name: "采购管理" },
192
-        { path: "/spply/query", name: "购单" }
192
+        { path: "/supply/good/order/query", name: "购单" }
193 193
       ],
194 194
       keywords: "",
195 195
       total: 0,
196 196
       multipleSelection: [],
197 197
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
198 198
       start_time: "",
199
-      end_time:new Date(),
199
+      end_time:"",
200 200
       page: 1,
201 201
       limit: 10,
202 202
       goodType: [],
@@ -326,7 +326,8 @@ export default {
326 326
     var nowYear = now.getFullYear(); //当前年 
327 327
     //本月的开始时间
328 328
     var monthStartDate = new Date(nowYear, nowMonth, 1); 
329
-    this.start_time = monthStartDate
329
+    this.start_time =  this.getTimes(monthStartDate)
330
+    this.end_time = this.getTimes(new Date())
330 331
     this.org_id =  this.$store.getters.xt_user.org_id
331 332
     this.getAllSupply()
332 333
     this.getlist()

+ 10 - 7
src/xt_pages/supply/purchaseOrderQuery.vue View File

@@ -90,7 +90,7 @@
90 90
               <span>{{getName(scope.row.supplier_id)}}</span>
91 91
             </template>
92 92
          </el-table-column>
93
-        <el-table-column label="关联购单号" align="center">
93
+        <el-table-column label="关联购单号" align="center">
94 94
           <template slot-scope="scope">
95 95
             <div style="width:100%;height:100%">
96 96
               <tr class="annotation-rs cluster-rs" v-for="(item,index) in scope.row.orderOut" :key="index">
@@ -99,7 +99,7 @@
99 99
             </div>
100 100
           </template>
101 101
         </el-table-column>
102
-        <el-table-column label="购金额" align="center">
102
+        <el-table-column label="购金额" align="center">
103 103
           <template slot-scope="scope">
104 104
              <span v-if="getAllBuyPrice(scope.row.orderInfo)>0">{{getAllBuyPrice(scope.row.orderInfo)}}</span> 
105 105
           </template>
@@ -190,14 +190,14 @@ export default {
190 190
     return {
191 191
       crumbs: [
192 192
         { path: false, name: "采购管理" },
193
-        { path: "/spply/query", name: "购订单" }
193
+        { path: "/supply/query", name: "购订单" }
194 194
       ],
195 195
       keywords: "",
196 196
       total: 0,
197 197
       multipleSelection: [],
198 198
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
199 199
       start_time: "",
200
-      end_time:new Date(),
200
+      end_time:"",
201 201
       page: 1,
202 202
       limit: 10,
203 203
       goodType: [],
@@ -258,14 +258,16 @@ export default {
258 258
       return uParseTime(time, '{y}-{m}-{d}')
259 259
      },
260 260
      getlist(){
261
+        console.log("hhhhhh",this.end_time)
261 262
         var params = {
262 263
           check_id:this.check_id,
263
-          start_time:this.getTimes(this.start_time),
264
-          end_time:this.getTimes(this.end_time),
264
+          start_time:this.start_time,
265
+          end_time:this.end_time,
265 266
           keyword:this.keywords,
266 267
           page:this.page,
267 268
           limit:this.limit,
268 269
         }
270
+       console.log("params2332232332",params)
269 271
        getAllPurchaseOrderList(params).then(response=>{
270 272
           if(response.data.state == 1){
271 273
             var list = response.data.data.list 
@@ -355,7 +357,8 @@ export default {
355 357
     var nowYear = now.getFullYear(); //当前年 
356 358
     //本月的开始时间
357 359
     var monthStartDate = new Date(nowYear, nowMonth, 1); 
358
-    this.start_time = monthStartDate
360
+    this.start_time = this.getTimes(monthStartDate) 
361
+    this.end_time = this.getTimes(new Date())
359 362
     this.org_id =  this.$store.getters.xt_user.org_id
360 363
     this.getAllSupply()
361 364
     this.getlist()

+ 1 - 1
src/xt_pages/supply/supplyQuery.vue View File

@@ -191,7 +191,7 @@ export default {
191 191
       type_name:"",
192 192
       crumbs: [
193 193
         { path: false, name: "采购管理" },
194
-        { path: "/spply/query", name: "供应商管理" }
194
+        { path: "/supply/good/order/query", name: "供应商管理" }
195 195
       ],
196 196
       keywords: "",
197 197
       total: 0,