Ver código fonte

11月14日 库存扣减更新

XMLWAN 3 anos atrás
pai
commit
b21029d36f

+ 24 - 1
src/api/supply.js Ver arquivo

9
 }
9
 }
10
 
10
 
11
 export function savePurchaseOrder(data, supplier_name, start_time, end_time, rate_of_concession, discount_amount) {
11
 export function savePurchaseOrder(data, supplier_name, start_time, end_time, rate_of_concession, discount_amount) {
12
-  console.log('data32323323232', data)
13
   return request({
12
   return request({
14
     url: '/api/supply/savepurchaseorder?supplier_name=' + supplier_name + '&start_time=' + start_time + '&end_time=' + end_time + '&rate_of_concession=' + rate_of_concession + '&discount_amount=' + discount_amount,
13
     url: '/api/supply/savepurchaseorder?supplier_name=' + supplier_name + '&start_time=' + start_time + '&end_time=' + end_time + '&rate_of_concession=' + rate_of_concession + '&discount_amount=' + discount_amount,
15
     method: 'post',
14
     method: 'post',
16
     data: data
15
     data: data
17
   })
16
   })
18
 }
17
 }
18
+
19
+export function getAllSupply(params) {
20
+  return request({
21
+    url: '/api/supply/getallsupply',
22
+    method: 'get',
23
+    params: params
24
+  })
25
+}
26
+
27
+export function getAllPurchaseOrderList(params) {
28
+  return request({
29
+    url: '/api/supply/getallpurchaseorderlist',
30
+    method: 'get',
31
+    params: params
32
+  })
33
+}
34
+
35
+export function updatePurchaseOrder(data, supplier_name, start_time, end_time, rate_of_concession, discount_amount, id, number) {
36
+  return request({
37
+    url: '/api/supply/updatepurchaseorder?supplier_name=' + supplier_name + '&start_time=' + start_time + '&end_time=' + end_time + '&rate_of_concession=' + rate_of_concession + '&discount_amount=' + discount_amount + '&id=' + id + '&number=' + number,
38
+    method: 'post',
39
+    data: data
40
+  })
41
+}

+ 5 - 0
src/xt_pages/stock/drugs/drugBatchNumber.vue Ver arquivo

79
              {{scope.row.warehousing_count}}{{scope.row.max_unit}}
79
              {{scope.row.warehousing_count}}{{scope.row.max_unit}}
80
            </template>
80
            </template>
81
         </el-table-column>
81
         </el-table-column>
82
+        <el-table-column prop="drug_name" label="零售价" align="center">
83
+           <template slot-scope="scope">
84
+              {{scope.row.retail_price}}
85
+           </template>
86
+        </el-table-column>
82
         <el-table-column prop="drug_name" label="进货单价" align="center">
87
         <el-table-column prop="drug_name" label="进货单价" align="center">
83
            <template slot-scope="scope">
88
            <template slot-scope="scope">
84
               {{scope.row.price}}
89
               {{scope.row.price}}

+ 6 - 12
src/xt_pages/stock/stockBatchNumber.vue Ver arquivo

38
               value-format="yyyy-MM-dd"
38
               value-format="yyyy-MM-dd"
39
               @change="endTimeChange"
39
               @change="endTimeChange"
40
           ></el-date-picker>
40
           ></el-date-picker>
41
-
42
-        <!-- <span>出入库方式:</span>
43
-        <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
44
-            <el-option
45
-              v-for="(item,index) in stockType"
46
-              :key="index"
47
-              :label="item.name"
48
-              :value="item.id">
49
-            </el-option>
50
-        </el-select> -->
51
-        
52
-        
41
+  
53
       </div>
42
       </div>
54
       
43
       
55
        <el-table
44
        <el-table
93
              <span> {{scope.row.price}}</span>
82
              <span> {{scope.row.price}}</span>
94
            </template>
83
            </template>
95
         </el-table-column>
84
         </el-table-column>
85
+         <el-table-column prop="drug_name" label="零售价" align="center">
86
+           <template slot-scope="scope">
87
+             <span v-if="scope.row.packing_price > 0"> {{scope.row.packing_price}}</span>
88
+           </template>
89
+        </el-table-column>
96
        </el-table>
90
        </el-table>
97
        
91
        
98
       <el-pagination
92
       <el-pagination

+ 2 - 2
src/xt_pages/stock/stockInOrder.vue Ver arquivo

208
             {{ scope.row.warehousing_count}}{{scope.row.GoodInfo.packing_unit}}
208
             {{ scope.row.warehousing_count}}{{scope.row.GoodInfo.packing_unit}}
209
           </template>
209
           </template>
210
         </el-table-column>
210
         </el-table-column>
211
-         <el-table-column label="零售价" align="center">
211
+         <!-- <el-table-column label="零售价" align="center">
212
           <template slot-scope="scope">
212
           <template slot-scope="scope">
213
             {{ scope.row.packing_price}}
213
             {{ scope.row.packing_price}}
214
           </template>
214
           </template>
215
-        </el-table-column>
215
+        </el-table-column> -->
216
         <el-table-column label="进货价" align="center">
216
         <el-table-column label="进货价" align="center">
217
           <template slot-scope="scope">
217
           <template slot-scope="scope">
218
             {{ scope.row.price}}
218
             {{ scope.row.price}}

+ 1 - 0
src/xt_pages/stock/stockInOrderAdd.vue Ver arquivo

660
       }
660
       }
661
       ,
661
       ,
662
       submit() {
662
       submit() {
663
+        console.log("res23322332",this.$refs)
663
         this.$refs['tableForm'].validate((valid) => {
664
         this.$refs['tableForm'].validate((valid) => {
664
           if (valid) {
665
           if (valid) {
665
             const array = this.recordInfo.recordData
666
             const array = this.recordInfo.recordData

+ 114 - 26
src/xt_pages/supply/components/addPurchaseOrder.vue Ver arquivo

3
 <div class="position">
3
 <div class="position">
4
     <bread-crumb :crumbs="crumbs"></bread-crumb>
4
     <bread-crumb :crumbs="crumbs"></bread-crumb>
5
 </div>
5
 </div>
6
-<div class="app-container ">
6
+<div class="app-container"  v-loading="loading">
7
     <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
7
     <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
     <div>
8
     <div>
9
         <span style="color:red">*</span><span>供应商:</span>
9
         <span style="color:red">*</span><span>供应商:</span>
44
             value-format="yyyy-MM-dd"
44
             value-format="yyyy-MM-dd"
45
             @change="endTimeChange"
45
             @change="endTimeChange"
46
         ></el-date-picker>
46
         ></el-date-picker>
47
-        <span>单据编码:</span>
47
+        <span>单据编码:{{number}}</span>
48
 
48
 
49
     </div>
49
     </div>
50
     <div>
50
     <div>
51
         <el-button size="small" type="primary" @click="savePurchaseOrder" v-show="showTwo">保存</el-button>
51
         <el-button size="small" type="primary" @click="savePurchaseOrder" v-show="showTwo">保存</el-button>
52
+        <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">打印</el-button>
53
+        <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">审核</el-button>
52
         <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">修改</el-button>
54
         <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">修改</el-button>
53
     </div>
55
     </div>
54
     </div>
56
     </div>
71
             <span>商品<span style="color: red">*</span></span>
73
             <span>商品<span style="color: red">*</span></span>
72
         </template>
74
         </template>
73
         <template slot-scope="scope">
75
         <template slot-scope="scope">
74
-           <el-form-item required prop="name">
76
+           <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
75
             <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)">
77
             <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)">
76
                 <el-option
78
                 <el-option
77
                     v-for="(item,index) in tabList"
79
                     v-for="(item,index) in tabList"
106
             <span>数量<span style="color: red">*</span></span>
108
             <span>数量<span style="color: red">*</span></span>
107
         </template>
109
         </template>
108
         <template slot-scope="scope">
110
         <template slot-scope="scope">
109
-          <el-form-item :rules="tableRules.supply_count" required prop="supply_count">
110
-          <el-input v-model="scope.row.supply_count" style="width:80px"></el-input>
111
+          <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
112
+             <el-input v-model="scope.row.supply_count" style="width:80px"></el-input>
111
           </el-form-item>
113
           </el-form-item>
112
         </template>
114
         </template>
113
     </el-table-column>
115
     </el-table-column>
166
     </el-table-column>
168
     </el-table-column>
167
   </el-table>
169
   </el-table>
168
 </el-form>
170
 </el-form>
171
+   <div style="margin-top:10px">
172
+      合计:{{getAllPrice()}} 元
173
+   </div>
169
    <div style="margin-top:10px">
174
    <div style="margin-top:10px">
170
         <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
175
         <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
171
 
176
 
178
 
183
 
179
 <script>
184
 <script>
180
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
185
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
181
-
182
-import {getInitOrder,savePurchaseOrder} from "@/api/supply"
186
+import {uParseTime } from '@/utils/tools'
187
+import {getInitOrder,savePurchaseOrder,updatePurchaseOrder} from "@/api/supply"
183
 export default {
188
 export default {
184
 name: "addPurchaseOrder",
189
 name: "addPurchaseOrder",
185
 created() {
190
 created() {
241
     tableRules: {
246
     tableRules: {
242
      name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
247
      name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
243
      supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
248
      supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
244
- },
245
-};
249
+   },
250
+   warehousing_id:0,
251
+   number:"",
252
+   loading:false,
253
+   drugList:[],
254
+   goodList:[],
255
+   id:0,
256
+  };
246
 },
257
 },
247
 methods:{
258
 methods:{
248
 
259
 
283
 
294
 
284
         this.tabList.push(drugList[i])
295
         this.tabList.push(drugList[i])
285
         }
296
         }
286
-
297
+        this.drugList = drugList
287
         var goodList =  response.data.data.goodList
298
         var goodList =  response.data.data.goodList
288
         for(let i=0;i<goodList.length;i++){
299
         for(let i=0;i<goodList.length;i++){
289
         for(let j=0;j<this.manufactuerList.length;j++){
300
         for(let j=0;j<this.manufactuerList.length;j++){
311
 
322
 
312
         this.tabList.push(goodList[i])
323
         this.tabList.push(goodList[i])
313
         }
324
         }
314
-    }
325
+        this.goodList = goodList
326
+    } 
315
     })
327
     })
316
 },
328
 },
317
 changeGoodName(val){
329
 changeGoodName(val){
318
   this.currentIndex = val
330
   this.currentIndex = val
319
 },
331
 },
320
 changeName(val){
332
 changeName(val){
321
-
333
+    //var obj = {"id":0,"name":"合计","supply_name":"","supply_type":"","supply_specification_name":"","supply_total":"","supply_count":"","supply_price":"","supply_total_price":"","supply_manufacturer":"","supply_license_number":"","supply_remake":"","is_total":2}
322
    for(let i=0;i<this.recordInfo.tableList.length;i++){
334
    for(let i=0;i<this.recordInfo.tableList.length;i++){
323
     if(this.currentIndex == i){
335
     if(this.currentIndex == i){
324
         this.recordInfo.tableList[i].id = val.id
336
         this.recordInfo.tableList[i].id = val.id
339
         this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
351
         this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
340
         this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
352
         this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
341
         this.recordInfo.tableList[i].supply_remake = val.supply_remake
353
         this.recordInfo.tableList[i].supply_remake = val.supply_remake
354
+        this.recordInfo.tableList[i].is_total = val.is_total
342
      }
355
      }
343
     }
356
     }
357
+   
344
 
358
 
345
 },
359
 },
346
 handleEdit(){
360
 handleEdit(){
358
     tempObj['supply_license_number'] = ''
372
     tempObj['supply_license_number'] = ''
359
     tempObj['supply_remake'] = ''
373
     tempObj['supply_remake'] = ''
360
     tempObj['type'] = 0
374
     tempObj['type'] = 0
375
+    tempObj['is_total'] = 1
361
     this.recordInfo.tableList.push(tempObj)
376
     this.recordInfo.tableList.push(tempObj)
362
 },
377
 },
363
 handleDelete: function(index, row) {
378
 handleDelete: function(index, row) {
371
 
386
 
372
 
387
 
373
 savePurchaseOrder(){
388
 savePurchaseOrder(){
374
-   // console.log("tablelsit323232",this.recordInfo.tableList)
375
-   console.log("hhh232323",this.$refs)
389
+    this.loading = true
390
+    if(this.supplier_name == 0 || this.supplier_name == ""){
391
+       this.$message.error("供应商不能为空!")
392
+       return false
393
+    }
376
     this.$refs["tableForm"].validate((valid)=>{
394
     this.$refs["tableForm"].validate((valid)=>{
377
       if(valid){
395
       if(valid){
378
-        var params = {
379
-        supplier_name:this.supplier_name,
380
-        start_time:this.start_time,
381
-        end_time:this.end_time,
382
-        rate_of_concession:this.rate_of_concession,
383
-        discount_amount:this.discount_amount,
384
-        }
385
-        console.log("partam2332232332",params)
386
-        console.log("tablelsit323232",this.recordInfo.tableList)
387
         for(let i=0;i<this.recordInfo.tableList.length;i++){
396
         for(let i=0;i<this.recordInfo.tableList.length;i++){
388
             this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
397
             this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
398
+            this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
399
+            this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
389
             for(let j=0;j<this.manufactuerList.length;j++){
400
             for(let j=0;j<this.manufactuerList.length;j++){
390
                 if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
401
                 if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
391
                 this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
402
                 this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
393
 
404
 
394
             }
405
             }
395
         }
406
         }
396
-        return
397
-        savePurchaseOrder(this.recordInfo.tableList,this.supplier_name,this.start_time,this.end_time,this.rate_of_concession,this.discount_amount).then(response=>{
407
+        var start = this.getTimes(this.start_time)
408
+        var end = this.getTimes(this.end_time)
409
+         const params = {
410
+            'stockIn': this.recordInfo.tableList
411
+         }
412
+       
413
+        savePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount).then(response=>{
398
             if(response.data.state == 1){
414
             if(response.data.state == 1){
399
                 var order =  response.data.data.order
415
                 var order =  response.data.data.order
416
+                this.loading = false
400
                 this.$message.success("保存成功!")
417
                 this.$message.success("保存成功!")
418
+                var warehouseInfo = response.data.data.warehouseInfo
419
+                this.number  = warehouseInfo.number
420
+                this.id = warehouseInfo.id
421
+                this.recordInfo.tableList = []
422
+                var orderInfo = response.data.data.orderInfo
423
+                for(let i=0;i<orderInfo.length;i++){
424
+                  orderInfo[i].supply_count = orderInfo[i].count
425
+                  orderInfo[i].supply_price = orderInfo[i].price
426
+                  orderInfo[i].supply_remake = orderInfo[i].remark
427
+                }
428
+                console.log("orderINFO23323232",orderInfo)
429
+                this.recordInfo.tableList = orderInfo
430
+                // for(let i=0;i<orderInfo.length;i++){
431
+                //    orderInfo[i].name = "" 
432
+                //    orderInfo[i].supply_name = ""
433
+                //    orderInfo[i].supply_specification_name = ""
434
+                //   if(orderInfo[i].is_source == 1){
435
+                //     for(let j=0;j<this.drugList.length;j++){
436
+                //        if(orderInfo[i].project_id == this.drugList[j].id){
437
+                //           orderInfo[i].name = this.drugList[j].drug_name
438
+                //        }
439
+                //     }
440
+                //   }
441
+                //   if(orderInfo[i].is_source == 2){
442
+                //     for(let y=0;y<this.goodList.length;y++){
443
+                //        if(orderInfo[i].project_id = this.goodList[y].id){
444
+                //           orderInfo[i].name = this.goodList[y].good_name
445
+                //        }
446
+                //     }
447
+                //   }
448
+                // }
401
                 this.showTwo = false
449
                 this.showTwo = false
402
                 this.showOne = true
450
                 this.showOne = true
403
             }
451
             }
408
 
456
 
409
 },
457
 },
410
 
458
 
459
+
411
 changeTypeName(){
460
 changeTypeName(){
412
 
461
 
413
 },
462
 },
463
     }
512
     }
464
     return Math.round(parseFloat(val) * 100) / 100;
513
     return Math.round(parseFloat(val) * 100) / 100;
465
   },
514
   },
515
+getTimes(time) {
516
+    if (time === '') {
517
+    return ''
518
+    }
519
+    return uParseTime(time, '{y}-{m}-{d}')
520
+},
466
  updatePurchaseOrder(){
521
  updatePurchaseOrder(){
467
-
522
+   this.$refs.validate((valid)=>{
523
+      if(valid){
524
+        for(let i=0;i<this.recordInfo.tableList.length;i++){
525
+           this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
526
+           this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
527
+           this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
528
+           for(let j=0;j<this.manufactuerList.length;j++){
529
+              if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
530
+                this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
531
+              }
532
+           }
533
+        }
534
+        var start = this.getTimes(this.start_time)
535
+        var end = this.getTimes(this.end_time)
536
+         const params = {
537
+            'stockIn': this.recordInfo.tableList
538
+         }
539
+        updatePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount,this.id,this.number).then(response=>{
540
+           if(response.data.state == 1){
541
+             var warehousingInfo =  response.data.data.warehousingInfo
542
+             this.$message.success("修改成功!")
543
+           }
544
+        })
545
+      } 
546
+   })
547
+ },
548
+ getAllPrice(){
549
+   console.log("表哥2332323223323223",this.recordInfo.tableList)  
550
+   var total_price = 0
551
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
552
+      total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
553
+   }  
554
+   return total_price.toFixed(2)
468
  }
555
  }
469
 },
556
 },
470
 created(){
557
 created(){
482
     tempObj['supply_license_number'] = ''
569
     tempObj['supply_license_number'] = ''
483
     tempObj['supply_remake'] = ''
570
     tempObj['supply_remake'] = ''
484
     tempObj['type'] = 0
571
     tempObj['type'] = 0
572
+    tempObj['is_total'] = 1
485
     this.recordInfo.tableList.push(tempObj)
573
     this.recordInfo.tableList.push(tempObj)
486
     this.getInitOrder()
574
     this.getInitOrder()
487
 }
575
 }

+ 126 - 41
src/xt_pages/supply/purchaseOrderQuery.vue Ver arquivo

6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
7
       <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
         <div>
8
         <div>
9
-          <el-select v-model="type_name" style="width:140px;margin-right:10px;" placeholder="请选择"
10
-          @change="changeTypeName">
11
-            <el-option
12
-              v-for="item in types"
13
-              :key="item.id"
14
-              :label="item.type_name"
15
-              :value="item.id">
16
-            </el-option>
17
-          </el-select>
9
+        
18
           <el-date-picker
10
           <el-date-picker
19
             size="small"
11
             size="small"
20
             v-model="start_time"
12
             v-model="start_time"
41
               value-format="yyyy-MM-dd"
33
               value-format="yyyy-MM-dd"
42
               @change="endTimeChange"
34
               @change="endTimeChange"
43
           ></el-date-picker>
35
           ></el-date-picker>
36
+          <span>审核状态:</span>
37
+           <el-select v-model="check_id" style="width:140px;margin-right:10px;" placeholder="请选择"
38
+            @change="changeTypeName">
39
+            <el-option
40
+                v-for="item in checkList"
41
+                :key="item.id"
42
+                :label="item.name"
43
+                :value="item.id">
44
+            </el-option>
45
+          </el-select>
44
           <el-input
46
           <el-input
45
             size="small"
47
             size="small"
46
             style="width: 200px;margin-left:10px;"
48
             style="width: 200px;margin-left:10px;"
47
             class="filter-item"
49
             class="filter-item"
48
             v-model.trim="keywords"
50
             v-model.trim="keywords"
49
-            placeholder="耗材名称"
51
+            placeholder="订单编号或供应商名称"
50
           />
52
           />
51
           <el-button
53
           <el-button
52
             size="small"
54
             size="small"
75
       >
77
       >
76
         <el-table-column label="订单日期" align="center">
78
         <el-table-column label="订单日期" align="center">
77
           <template slot-scope="scope">
79
           <template slot-scope="scope">
78
-            <span></span>
80
+            <span>{{getTimes(scope.row.document_date)}}</span>
79
          </template>
81
          </template>
80
         </el-table-column>
82
         </el-table-column>
81
         <el-table-column label="订单编号" align="center">
83
         <el-table-column label="订单编号" align="center">
82
           <template slot-scope="scope">
84
           <template slot-scope="scope">
83
-          
85
+            <span>{{scope.row.number}}</span>
84
           </template>
86
           </template>
85
         </el-table-column>
87
         </el-table-column>
86
         <el-table-column label="供应商" align="center">
88
         <el-table-column label="供应商" align="center">
87
             <template slot-scope="scope">
89
             <template slot-scope="scope">
88
-              <span></span>
90
+              <span>{{getName(scope.row.supplier_id)}}</span>
89
             </template>
91
             </template>
90
          </el-table-column>
92
          </el-table-column>
91
         <el-table-column label="关联购货订单" align="center">
93
         <el-table-column label="关联购货订单" align="center">
95
         </el-table-column>
97
         </el-table-column>
96
         <el-table-column label="购物金额" align="center">
98
         <el-table-column label="购物金额" align="center">
97
           <template slot-scope="scope">
99
           <template slot-scope="scope">
98
-           
100
+             <span v-if="getAllBuyPrice(scope.row.orderInfo)>0">{{getAllBuyPrice(scope.row.orderInfo)}}</span> 
99
           </template>
101
           </template>
100
         </el-table-column>
102
         </el-table-column>
101
 
103
 
102
        <el-table-column label="数量" align="center">
104
        <el-table-column label="数量" align="center">
103
          <template slot-scope="scope">
105
          <template slot-scope="scope">
104
-           
106
+           {{getAllCount(scope.row.orderInfo)}}
105
          </template>
107
          </template>
106
        </el-table-column>
108
        </el-table-column>
107
 
109
 
108
        <el-table-column label="订单状态" align="center">
110
        <el-table-column label="订单状态" align="center">
109
          <template slot-scope="scope">
111
          <template slot-scope="scope">
110
-         
111
-        
112
+           <span v-if="scope.row.is_check == 2">未审核</span>
113
+           <span v-if="scope.row.is_check == 1">已审核</span>
112
          </template>
114
          </template>
113
        </el-table-column>
115
        </el-table-column>
114
       
116
       
115
         <el-table-column label="交货日期" align="center">
117
         <el-table-column label="交货日期" align="center">
116
          <template slot-scope="scope">
118
          <template slot-scope="scope">
117
-         
119
+           {{getTimes(scope.row.delivery_date)}}
118
          </template>
120
          </template>
119
        </el-table-column>
121
        </el-table-column>
120
         
122
         
121
     
123
     
122
       <el-table-column label="制单人" align="center">
124
       <el-table-column label="制单人" align="center">
123
          <template slot-scope="scope">
125
          <template slot-scope="scope">
124
-       
126
+          {{getDocName(scope.row.creater)}}
125
          </template>
127
          </template>
126
        </el-table-column>
128
        </el-table-column>
127
 
129
 
128
       <el-table-column label="审核人" align="center">
130
       <el-table-column label="审核人" align="center">
129
          <template slot-scope="scope">
131
          <template slot-scope="scope">
130
-       
132
+          {{getDocName(scope.row.checker)}}
131
          </template>
133
          </template>
132
        </el-table-column>
134
        </el-table-column>
133
 
135
 
168
 <script>
170
 <script>
169
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
171
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
170
 
172
 
171
-
173
+import {getAllSupply,getAllPurchaseOrderList} from "@/api/supply"
174
+import {uParseTime } from '@/utils/tools'
172
 export default {
175
 export default {
173
   name: "stockIn",
176
   name: "stockIn",
174
    components: {
177
    components: {
175
      
178
      
176
    },
179
    },
177
-  created() {
178
-    this.org_id =  this.$store.getters.xt_user.org_id
179
-
180
-    var start_time =  window.sessionStorage.getItem('start_time')
181
-    var end_time =  window.sessionStorage.getItem('end_time')
182
-
183
-    if(start_time !=null){
184
-      this.start_time = start_time
185
-    }
186
-    if(end_time!=null){
187
-      this.end_time = end_time
188
-    }
189
-    window.sessionStorage.removeItem('start_time')
190
-    window.sessionStorage.removeItem('end_time')
191
-  },
192
   components: {
180
   components: {
193
     BreadCrumb
181
     BreadCrumb
194
   },
182
   },
203
       multipleSelection: [],
191
       multipleSelection: [],
204
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
192
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
205
       start_time: "",
193
       start_time: "",
206
-      end_time: "",
194
+      end_time:new Date(),
207
       page: 1,
195
       page: 1,
208
       limit: 10,
196
       limit: 10,
209
       goodType: [],
197
       goodType: [],
212
       types:[],
200
       types:[],
213
       tableList:[],
201
       tableList:[],
214
       type_name:"",
202
       type_name:"",
203
+      checkList:[
204
+        {id:0,name:"请选择"},
205
+        {id:1,name:"已审核"},
206
+        {id:2,name:"未审核"},
207
+      ],
208
+      supplyList:[],
209
+      check_id:0,
210
+      doctorList:[],
215
     };
211
     };
216
   },
212
   },
217
   methods:{
213
   methods:{
230
      search(){
226
      search(){
231
 
227
 
232
      },
228
      },
233
-     handleSizeChange(){
234
-
229
+     handleSizeChange(val){
230
+       this.limit = val
231
+       this.getlist()
232
+     },
233
+     handleCurrentChange(val){
234
+       this.page = val
235
+       this.getlist()
235
      },
236
      },
236
-     handleCurrentChange(){
237
+     getAllSupply(){
238
+       getAllSupply().then(response=>{
239
+         if(response.data.state == 1){
240
+            var supplyList = response.data.data.supplyList
241
+            this.doctorList = response.data.data.doctorList
242
+            for(let i=0;i<supplyList.length;i++){
243
+              this.supplyList.push(supplyList[i])
244
+            }
245
+         }
246
+       })
247
+     },
248
+     changeTypeName(){
237
 
249
 
250
+     },
251
+     getTimes(time) {
252
+      if (time === '') {
253
+      return ''
254
+      }
255
+      return uParseTime(time, '{y}-{m}-{d}')
256
+     },
257
+     getlist(){
258
+        var params = {
259
+          check_id:this.check_id,
260
+          start_time:this.getTimes(this.start_time),
261
+          end_time:this.getTimes(this.end_time),
262
+          keyword:this.keywords,
263
+          page:this.page,
264
+          limit:this.limit,
265
+        }
266
+       getAllPurchaseOrderList(params).then(response=>{
267
+          if(response.data.state == 1){
268
+            var list = response.data.data.list 
269
+            console.log("list2332232323232",list)
270
+            this.tableList = list
271
+            var total = response.data.data.total
272
+            this.total = total
273
+          }
274
+       })
275
+     },
276
+     getName(id){
277
+       var name = ""
278
+       for(let i=0;i<this.supplyList.length;i++){
279
+         if(id == this.supplyList[i].id){
280
+           name = this.supplyList[i].supplier_name
281
+         }
282
+       }
283
+       return name
284
+     },
285
+     getDocName(id){
286
+      var user_name = ""
287
+      for(let i=0;i<this.doctorList.length;i++){
288
+        if(id == this.doctorList[i].admin_user_id){
289
+          user_name = this.doctorList[i].user_name
290
+        }
291
+      }
292
+      return user_name
293
+     },
294
+     getAllBuyPrice(arr){
295
+       var buy_price = 0
296
+       if(arr!=undefined && arr.length > 0){
297
+          for(let i=0;i<arr.length;i++){
298
+            buy_price += (arr[i].count * arr[i].price)
299
+          }
300
+       }
301
+       return buy_price.toFixed(2)
302
+     },
303
+     getAllCount(arr){
304
+       var count = ""
305
+        if(arr!=undefined && arr.length > 0){
306
+          for(let i=0;i<arr.length;i++){
307
+            count += arr[i].count
308
+          }
309
+       }
310
+       return count
238
      } 
311
      } 
239
-  }
312
+  },
313
+  created() {
314
+    var now = new Date(); //当前日期 
315
+    var nowMonth = now.getMonth(); //当前月 
316
+    var nowYear = now.getFullYear(); //当前年 
317
+    //本月的开始时间
318
+    var monthStartDate = new Date(nowYear, nowMonth, 1); 
319
+    this.start_time = monthStartDate
320
+    this.org_id =  this.$store.getters.xt_user.org_id
321
+    this.getAllSupply()
322
+    this.getlist()
323
+  },
324
+ 
240
 };
325
 };
241
 </script>
326
 </script>
242
 
327
 

+ 22 - 4
src/xt_pages/supply/supplyQuery.vue Ver arquivo

103
            
103
            
104
          </template>
104
          </template>
105
        </el-table-column>
105
        </el-table-column>
106
-       <el-table-column label="开户银行" align="center" v-if="showOne">
106
+       <el-table-column label="开户银行" align="center">
107
          <template slot-scope="scope">
107
          <template slot-scope="scope">
108
          
108
          
109
           </span>
109
           </span>
111
          </template>
111
          </template>
112
        </el-table-column>
112
        </el-table-column>
113
       
113
       
114
-        <el-table-column label="纳税人识别号" align="center" v-if="showThree">
114
+        <el-table-column label="纳税人识别号" align="center" >
115
          <template slot-scope="scope">
115
          <template slot-scope="scope">
116
          
116
          
117
          </template>
117
          </template>
118
        </el-table-column>
118
        </el-table-column>
119
         
119
         
120
     
120
     
121
-      <el-table-column label="手机" align="center" v-if="showFour">
121
+      <el-table-column label="手机" align="center">
122
          <template slot-scope="scope">
122
          <template slot-scope="scope">
123
        
123
        
124
          </template>
124
          </template>
214
      toAdd(){
214
      toAdd(){
215
        console.log("res32323232323223",this.$refs)  
215
        console.log("res32323232323223",this.$refs)  
216
        this.$refs.addSupply.show()  
216
        this.$refs.addSupply.show()  
217
-     } 
217
+     },
218
+      changeTypeName(){
219
+
220
+     }, 
221
+     startTimeChange(){
222
+
223
+     },
224
+     endTimeChange(){
225
+
226
+     },
227
+     search(){
228
+
229
+     },
230
+     handleSizeChange(){
231
+
232
+     },
233
+     handleCurrentChange(){
234
+       
235
+     }
218
   }
236
   }
219
 };
237
 };
220
 </script>
238
 </script>