Browse Source

11月14日 库存扣减更新

XMLWAN 3 years ago
parent
commit
b21029d36f

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

@@ -9,10 +9,33 @@ export function getInitOrder(params) {
9 9
 }
10 10
 
11 11
 export function savePurchaseOrder(data, supplier_name, start_time, end_time, rate_of_concession, discount_amount) {
12
-  console.log('data32323323232', data)
13 12
   return request({
14 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 14
     method: 'post',
16 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 View File

@@ -79,6 +79,11 @@
79 79
              {{scope.row.warehousing_count}}{{scope.row.max_unit}}
80 80
            </template>
81 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 87
         <el-table-column prop="drug_name" label="进货单价" align="center">
83 88
            <template slot-scope="scope">
84 89
               {{scope.row.price}}

+ 6 - 12
src/xt_pages/stock/stockBatchNumber.vue View File

@@ -38,18 +38,7 @@
38 38
               value-format="yyyy-MM-dd"
39 39
               @change="endTimeChange"
40 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 42
       </div>
54 43
       
55 44
        <el-table
@@ -93,6 +82,11 @@
93 82
              <span> {{scope.row.price}}</span>
94 83
            </template>
95 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 90
        </el-table>
97 91
        
98 92
       <el-pagination

+ 2 - 2
src/xt_pages/stock/stockInOrder.vue View File

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

+ 1 - 0
src/xt_pages/stock/stockInOrderAdd.vue View File

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

+ 114 - 26
src/xt_pages/supply/components/addPurchaseOrder.vue View File

@@ -3,7 +3,7 @@
3 3
 <div class="position">
4 4
     <bread-crumb :crumbs="crumbs"></bread-crumb>
5 5
 </div>
6
-<div class="app-container ">
6
+<div class="app-container"  v-loading="loading">
7 7
     <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8 8
     <div>
9 9
         <span style="color:red">*</span><span>供应商:</span>
@@ -44,11 +44,13 @@
44 44
             value-format="yyyy-MM-dd"
45 45
             @change="endTimeChange"
46 46
         ></el-date-picker>
47
-        <span>单据编码:</span>
47
+        <span>单据编码:{{number}}</span>
48 48
 
49 49
     </div>
50 50
     <div>
51 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 54
         <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">修改</el-button>
53 55
     </div>
54 56
     </div>
@@ -71,7 +73,7 @@
71 73
             <span>商品<span style="color: red">*</span></span>
72 74
         </template>
73 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 77
             <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)">
76 78
                 <el-option
77 79
                     v-for="(item,index) in tabList"
@@ -106,8 +108,8 @@
106 108
             <span>数量<span style="color: red">*</span></span>
107 109
         </template>
108 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 113
           </el-form-item>
112 114
         </template>
113 115
     </el-table-column>
@@ -166,6 +168,9 @@
166 168
     </el-table-column>
167 169
   </el-table>
168 170
 </el-form>
171
+   <div style="margin-top:10px">
172
+      合计:{{getAllPrice()}} 元
173
+   </div>
169 174
    <div style="margin-top:10px">
170 175
         <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
171 176
 
@@ -178,8 +183,8 @@
178 183
 
179 184
 <script>
180 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 188
 export default {
184 189
 name: "addPurchaseOrder",
185 190
 created() {
@@ -241,8 +246,14 @@ return {
241 246
     tableRules: {
242 247
      name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
243 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 258
 methods:{
248 259
 
@@ -283,7 +294,7 @@ getInitOrder(){
283 294
 
284 295
         this.tabList.push(drugList[i])
285 296
         }
286
-
297
+        this.drugList = drugList
287 298
         var goodList =  response.data.data.goodList
288 299
         for(let i=0;i<goodList.length;i++){
289 300
         for(let j=0;j<this.manufactuerList.length;j++){
@@ -311,14 +322,15 @@ getInitOrder(){
311 322
 
312 323
         this.tabList.push(goodList[i])
313 324
         }
314
-    }
325
+        this.goodList = goodList
326
+    } 
315 327
     })
316 328
 },
317 329
 changeGoodName(val){
318 330
   this.currentIndex = val
319 331
 },
320 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 334
    for(let i=0;i<this.recordInfo.tableList.length;i++){
323 335
     if(this.currentIndex == i){
324 336
         this.recordInfo.tableList[i].id = val.id
@@ -339,8 +351,10 @@ changeName(val){
339 351
         this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
340 352
         this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
341 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 360
 handleEdit(){
@@ -358,6 +372,7 @@ handleEdit(){
358 372
     tempObj['supply_license_number'] = ''
359 373
     tempObj['supply_remake'] = ''
360 374
     tempObj['type'] = 0
375
+    tempObj['is_total'] = 1
361 376
     this.recordInfo.tableList.push(tempObj)
362 377
 },
363 378
 handleDelete: function(index, row) {
@@ -371,21 +386,17 @@ handleDelete: function(index, row) {
371 386
 
372 387
 
373 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 394
     this.$refs["tableForm"].validate((valid)=>{
377 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 396
         for(let i=0;i<this.recordInfo.tableList.length;i++){
388 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 400
             for(let j=0;j<this.manufactuerList.length;j++){
390 401
                 if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
391 402
                 this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
@@ -393,11 +404,48 @@ savePurchaseOrder(){
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 414
             if(response.data.state == 1){
399 415
                 var order =  response.data.data.order
416
+                this.loading = false
400 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 449
                 this.showTwo = false
402 450
                 this.showOne = true
403 451
             }
@@ -408,6 +456,7 @@ savePurchaseOrder(){
408 456
 
409 457
 },
410 458
 
459
+
411 460
 changeTypeName(){
412 461
 
413 462
 },
@@ -463,8 +512,46 @@ calculate: function(val) {
463 512
     }
464 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 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 557
 created(){
@@ -482,6 +569,7 @@ created(){
482 569
     tempObj['supply_license_number'] = ''
483 570
     tempObj['supply_remake'] = ''
484 571
     tempObj['type'] = 0
572
+    tempObj['is_total'] = 1
485 573
     this.recordInfo.tableList.push(tempObj)
486 574
     this.getInitOrder()
487 575
 }

+ 126 - 41
src/xt_pages/supply/purchaseOrderQuery.vue View File

@@ -6,15 +6,7 @@
6 6
     <div class="app-container ">
7 7
       <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8 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 10
           <el-date-picker
19 11
             size="small"
20 12
             v-model="start_time"
@@ -41,12 +33,22 @@
41 33
               value-format="yyyy-MM-dd"
42 34
               @change="endTimeChange"
43 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 46
           <el-input
45 47
             size="small"
46 48
             style="width: 200px;margin-left:10px;"
47 49
             class="filter-item"
48 50
             v-model.trim="keywords"
49
-            placeholder="耗材名称"
51
+            placeholder="订单编号或供应商名称"
50 52
           />
51 53
           <el-button
52 54
             size="small"
@@ -75,17 +77,17 @@
75 77
       >
76 78
         <el-table-column label="订单日期" align="center">
77 79
           <template slot-scope="scope">
78
-            <span></span>
80
+            <span>{{getTimes(scope.row.document_date)}}</span>
79 81
          </template>
80 82
         </el-table-column>
81 83
         <el-table-column label="订单编号" align="center">
82 84
           <template slot-scope="scope">
83
-          
85
+            <span>{{scope.row.number}}</span>
84 86
           </template>
85 87
         </el-table-column>
86 88
         <el-table-column label="供应商" align="center">
87 89
             <template slot-scope="scope">
88
-              <span></span>
90
+              <span>{{getName(scope.row.supplier_id)}}</span>
89 91
             </template>
90 92
          </el-table-column>
91 93
         <el-table-column label="关联购货订单" align="center">
@@ -95,39 +97,39 @@
95 97
         </el-table-column>
96 98
         <el-table-column label="购物金额" align="center">
97 99
           <template slot-scope="scope">
98
-           
100
+             <span v-if="getAllBuyPrice(scope.row.orderInfo)>0">{{getAllBuyPrice(scope.row.orderInfo)}}</span> 
99 101
           </template>
100 102
         </el-table-column>
101 103
 
102 104
        <el-table-column label="数量" align="center">
103 105
          <template slot-scope="scope">
104
-           
106
+           {{getAllCount(scope.row.orderInfo)}}
105 107
          </template>
106 108
        </el-table-column>
107 109
 
108 110
        <el-table-column label="订单状态" align="center">
109 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 114
          </template>
113 115
        </el-table-column>
114 116
       
115 117
         <el-table-column label="交货日期" align="center">
116 118
          <template slot-scope="scope">
117
-         
119
+           {{getTimes(scope.row.delivery_date)}}
118 120
          </template>
119 121
        </el-table-column>
120 122
         
121 123
     
122 124
       <el-table-column label="制单人" align="center">
123 125
          <template slot-scope="scope">
124
-       
126
+          {{getDocName(scope.row.creater)}}
125 127
          </template>
126 128
        </el-table-column>
127 129
 
128 130
       <el-table-column label="审核人" align="center">
129 131
          <template slot-scope="scope">
130
-       
132
+          {{getDocName(scope.row.checker)}}
131 133
          </template>
132 134
        </el-table-column>
133 135
 
@@ -168,27 +170,13 @@
168 170
 <script>
169 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 175
 export default {
173 176
   name: "stockIn",
174 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 180
   components: {
193 181
     BreadCrumb
194 182
   },
@@ -203,7 +191,7 @@ export default {
203 191
       multipleSelection: [],
204 192
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
205 193
       start_time: "",
206
-      end_time: "",
194
+      end_time:new Date(),
207 195
       page: 1,
208 196
       limit: 10,
209 197
       goodType: [],
@@ -212,6 +200,14 @@ export default {
212 200
       types:[],
213 201
       tableList:[],
214 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 213
   methods:{
@@ -230,13 +226,102 @@ export default {
230 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 326
 </script>
242 327
 

+ 22 - 4
src/xt_pages/supply/supplyQuery.vue View File

@@ -103,7 +103,7 @@
103 103
            
104 104
          </template>
105 105
        </el-table-column>
106
-       <el-table-column label="开户银行" align="center" v-if="showOne">
106
+       <el-table-column label="开户银行" align="center">
107 107
          <template slot-scope="scope">
108 108
          
109 109
           </span>
@@ -111,14 +111,14 @@
111 111
          </template>
112 112
        </el-table-column>
113 113
       
114
-        <el-table-column label="纳税人识别号" align="center" v-if="showThree">
114
+        <el-table-column label="纳税人识别号" align="center" >
115 115
          <template slot-scope="scope">
116 116
          
117 117
          </template>
118 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 122
          <template slot-scope="scope">
123 123
        
124 124
          </template>
@@ -214,7 +214,25 @@ export default {
214 214
      toAdd(){
215 215
        console.log("res32323232323223",this.$refs)  
216 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 238
 </script>