XMLWAN vor 3 Jahren
Ursprung
Commit
685c79d176

+ 2 - 2
src/xt_pages/dialysis/dialysisDoctorAdvice.vue Datei anzeigen

513
             var config = resp.data.config
513
             var config = resp.data.config
514
             console.log("config222222",config.is_open)
514
             console.log("config222222",config.is_open)
515
             let project_config = resp.data.project_config
515
             let project_config = resp.data.project_config
516
-            console.log('project_config',resp.data.hisAdvices)
516
+            console.log('project_config',)
517
             if(project_config.is_open == 1){
517
             if(project_config.is_open == 1){
518
               this.project = resp.data.project
518
               this.project = resp.data.project
519
               resp.data.hisAdvices.map((item,index) => {
519
               resp.data.hisAdvices.map((item,index) => {
618
              this.show = false
618
              this.show = false
619
              this.showOne  = true
619
              this.showOne  = true
620
             var schedules =  resp.data.hisAdvices
620
             var schedules =  resp.data.hisAdvices
621
-          
621
+            console.log("hhhhhhhh22323232323232",schedules)
622
             let arr = []
622
             let arr = []
623
             let newArr = []
623
             let newArr = []
624
             let newSchedules = []
624
             let newSchedules = []

+ 3 - 0
src/xt_pages/stock/Dialog/goodInfoDailog.vue Datei anzeigen

371
           good_name: [
371
           good_name: [
372
             { required: true, message: '请输入耗材名称', trigger: 'blur' }
372
             { required: true, message: '请输入耗材名称', trigger: 'blur' }
373
           ],
373
           ],
374
+          packing_unit:[
375
+            {required:true,message:"请输入包装单位",trigger:'blur'}
376
+          ],
374
           good_kind: [
377
           good_kind: [
375
             { required: true, message: '请选择耗材种类', trigger: 'change' }
378
             { required: true, message: '请选择耗材种类', trigger: 'change' }
376
           ],
379
           ],

+ 3 - 2
src/xt_pages/stock/drugs/drugStockInOrder.vue Datei anzeigen

653
       const params = {
653
       const params = {
654
         id: order_id
654
         id: order_id
655
       };
655
       };
656
-   
656
+      console.log("parasm222222222",params)
657
+      this.WarehouseInfo.warehouseInfoDate = []
657
       getDrugWarehouseInfoList(params).then(response => {
658
       getDrugWarehouseInfoList(params).then(response => {
658
         if (response.data.state == 0) {
659
         if (response.data.state == 0) {
659
           this.$message.error(response.data.msg);
660
           this.$message.error(response.data.msg);
660
           return false;
661
           return false;
661
         } else {
662
         } else {
663
+          console.log("hhhhhhhhhh",response.data.data.info)
662
           for (let i = 0; i < response.data.data.info.length; i++) {
664
           for (let i = 0; i < response.data.data.info.length; i++) {
663
             this.showOne = true
665
             this.showOne = true
664
-            this.WarehouseInfo.warehouseInfoDate = []
665
             this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
666
             this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
666
             console.log("列表详情",this.WarehouseInfo.warehouseInfoDate)
667
             console.log("列表详情",this.WarehouseInfo.warehouseInfoDate)
667
           }
668
           }

+ 40 - 15
src/xt_pages/stock/stockBatchNumber.vue Datei anzeigen

5
     </div>
5
     </div>
6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div class="cell clearfix">
7
       <div class="cell clearfix">
8
-       耗材名称:{{this.$route.query.good_name}}
9
-       <!-- 库存:
10
-       厂家: -->
8
+        耗材名称:{{this.$route.query.good_name}} &nbsp;
9
+        库存:{{getInCount(this.$route.query.id)}} &nbsp;
10
+        规格:{{this.$route.query.specification_name}} &nbsp;
11
+        厂家:{{this.$route.query.manufacturer}} 
11
       </div>
12
       </div>
12
       <div class="cell clearfix">
13
       <div class="cell clearfix">
13
         <span>日期查询:</span>
14
         <span>日期查询:</span>
115
   import { uParseTime } from '@/utils/tools'
116
   import { uParseTime } from '@/utils/tools'
116
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
117
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
117
   import {getStockInList} from "@/api/drug/drug_stock";
118
   import {getStockInList} from "@/api/drug/drug_stock";
119
+  import {getStockDrugCount} from "@/api/stock"
118
   export default {
120
   export default {
119
     name: 'stockIn',
121
     name: 'stockIn',
120
     created() {
122
     created() {
121
       this.getlist()
123
       this.getlist()
122
-    //   this.getOutList()
124
+      this.getStockDrugCount()
123
     },
125
     },
124
     components: {
126
     components: {
125
       BreadCrumb
127
       BreadCrumb
162
           {id:2,name:"自动出库"},
164
           {id:2,name:"自动出库"},
163
           {id:3,name:"入库"},
165
           {id:3,name:"入库"},
164
         ],
166
         ],
165
-      
167
+        countList:[],
168
+        outCountList:[],
169
+        autoCountList:[],
170
+        keywords:"",
166
       }
171
       }
167
     },
172
     },
168
     methods:{
173
     methods:{
236
            console.log("入库数据",this.tableList)
241
            console.log("入库数据",this.tableList)
237
            var manufacturerList = response.data.data.manufacturerList
242
            var manufacturerList = response.data.data.manufacturerList
238
            this.manufacturerList = manufacturerList
243
            this.manufacturerList = manufacturerList
239
-
240
-          // var outlist =  response.data.data.outList
241
-          // console.log("outlist",outlist)
242
-          // for(let i=0;i<outlist.length;i++){
243
-          //     outlist[i].stock_way = 2
244
-          //     this.tableList.push(outlist[i])
245
-          // }
246
-          
247
-           
248
          }
244
          }
249
       })
245
       })
250
      },
246
      },
247
+    getInCount(id){
248
+      var count= ""
249
+      for(let i=0;i<this.countList.length;i++){
250
+          if(id == this.countList[i].good_id){
251
+              count = this.countList[i].count
252
+          }
253
+        }
254
+        return count
255
+     },
251
      getTimestamp(time) {
256
      getTimestamp(time) {
252
       // 把时间日期转成时间戳
257
       // 把时间日期转成时间戳
253
       return new Date(time).getTime() / 1000;
258
       return new Date(time).getTime() / 1000;
254
      },
259
      },
255
-     
260
+    getStockDrugCount(){
261
+        var params ={
262
+          keywords: this.keywords,
263
+          start_time:this.start_time,
264
+          end_time:this.end_time,
265
+        }
266
+      getStockDrugCount(params).then(response=>{
267
+         if(response.data.state == 1){
268
+           var count = response.data.data.count
269
+           console.log("详情入库统计",count)
270
+           this.countList = count
271
+           var outlist = response.data.data.outList
272
+           console.log("详情出库数量",outlist)
273
+          
274
+           this.outCountList = outlist
275
+           var autoCount = response.data.data.autoCount
276
+           console.log("详情自动出库",autoCount)
277
+           this.autoCountList = autoCount
278
+         }
279
+      })
280
+    },
256
 
281
 
257
     }
282
     }
258
   }
283
   }

+ 65 - 20
src/xt_pages/stock/stockFlow.vue Datei anzeigen

5
     </div>
5
     </div>
6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div class="cell clearfix">
7
       <div class="cell clearfix">
8
-       耗材名称:{{this.$route.query.good_name}}
9
-       库存:{{getInCount(this.$route.query.id)}}
10
-       <!-- 厂家:{{this.$route.query.manufacturer}}
11
-       规格: -->
8
+       耗材名称:{{this.$route.query.good_name}} &nbsp;
9
+       库存:{{getInCount(this.$route.query.id)}} &nbsp;
10
+       规格:{{this.$route.query.specification_name}} &nbsp;
11
+       厂家:{{this.$route.query.manufacturer}} 
12
       </div>
12
       </div>
13
       <div class="cell clearfix">
13
       <div class="cell clearfix">
14
         <span>日期查询:</span>
14
         <span>日期查询:</span>
39
               @change="endTimeChange"
39
               @change="endTimeChange"
40
           ></el-date-picker>
40
           ></el-date-picker>
41
 
41
 
42
-        <!-- <span>出入库方式:</span> -->
43
-        <!-- <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
42
+        <span>出入库方式:</span>
43
+         <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
44
             <el-option
44
             <el-option
45
               v-for="(item,index) in stockType"
45
               v-for="(item,index) in stockType"
46
               :key="index"
46
               :key="index"
47
               :label="item.name"
47
               :label="item.name"
48
               :value="item.id">
48
               :value="item.id">
49
             </el-option>
49
             </el-option>
50
-        </el-select> -->
50
+        </el-select>
51
         
51
         
52
         
52
         
53
       </div>
53
       </div>
63
         </el-table-column>
63
         </el-table-column>
64
         <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
64
         <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
65
            <template slot-scope="scope">
65
            <template slot-scope="scope">
66
-             <span v-if="scope.row.stock_way == 4">入库</span>
67
-             <span v-if="scope.row.stock_way == 2">出库</span>
66
+             <span v-if="scope.row.stock_way == 4">采购入库</span>
67
+             <span v-if="scope.row.stock_way == 3">手动出库</span>
68
+             <span v-if="scope.row.stock_way == 2">自动出库</span>
68
            </template>
69
            </template>
69
         </el-table-column>
70
         </el-table-column>
70
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
71
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
71
            <template slot-scope="scope">
72
            <template slot-scope="scope">
72
-             <span v-if="scope.row.stock_way == 2"> {{scope.row.warehouse_out_order_number}}</span>
73
+             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3"> {{scope.row.warehouse_out_order_number}}</span>
73
              <span v-if="scope.row.stock_way == 4">{{scope.row.warehousing_order}}</span>
74
              <span v-if="scope.row.stock_way == 4">{{scope.row.warehousing_order}}</span>
74
             
75
             
75
            </template>
76
            </template>
82
          <el-table-column prop="drug_name" label="入库数量"  align="center">
83
          <el-table-column prop="drug_name" label="入库数量"  align="center">
83
            <template slot-scope="scope">
84
            <template slot-scope="scope">
84
              <span v-if="scope.row.stock_way == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}</span>
85
              <span v-if="scope.row.stock_way == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}</span>
85
-             <span v-if="scope.row.stock_way == 2 && scope.row.count!=0">{{scope.row.count}}</span>
86
+             <span v-if="(scope.row.stock_way == 2 || scope.row.stock_way == 3) && scope.row.count!=0">{{scope.row.count}}</span>
86
            </template>
87
            </template>
87
         </el-table-column>
88
         </el-table-column>
88
          <el-table-column prop="drug_name" label="剩余库存量"  align="center">
89
          <el-table-column prop="drug_name" label="剩余库存量"  align="center">
94
         <el-table-column prop="drug_name" label="进/出货单价"  align="center">
95
         <el-table-column prop="drug_name" label="进/出货单价"  align="center">
95
            <template slot-scope="scope">
96
            <template slot-scope="scope">
96
              <span v-if="scope.row.stock_way == 4"> {{scope.row.price}}</span>
97
              <span v-if="scope.row.stock_way == 4"> {{scope.row.price}}</span>
97
-             <span v-if="scope.row.stock_way == 2">{{scope.row.price}}</span>
98
+             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{scope.row.price}}</span>
98
            </template>
99
            </template>
99
         </el-table-column>
100
         </el-table-column>
100
          <el-table-column prop="drug_name" label="有效期" align="center">
101
          <el-table-column prop="drug_name" label="有效期" align="center">
101
            <template slot-scope="scope" >
102
            <template slot-scope="scope" >
102
              <span v-if="scope.row.stock_way == 4"> {{getTime(scope.row.expiry_date)}}</span>
103
              <span v-if="scope.row.stock_way == 4"> {{getTime(scope.row.expiry_date)}}</span>
103
-             <span v-if="scope.row.stock_way == 2">{{getTime(scope.row.expiry_date)}}</span>
104
+             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{getTime(scope.row.expiry_date)}}</span>
104
            </template>
105
            </template>
105
         </el-table-column>
106
         </el-table-column>
106
         <el-table-column prop="drug_name" label="批号" align="center">
107
         <el-table-column prop="drug_name" label="批号" align="center">
107
            <template slot-scope="scope" >
108
            <template slot-scope="scope" >
108
              <span v-if="scope.row.stock_way == 2"> {{scope.row.number}}</span>
109
              <span v-if="scope.row.stock_way == 2"> {{scope.row.number}}</span>
109
-             <span v-if="scope.row.stock_way == 4">{{scope.row.number}}</span>
110
+             <span v-if="scope.row.stock_way == 4 || scope.row.stock_way == 3">{{scope.row.number}}</span>
110
            </template>
111
            </template>
111
         </el-table-column>
112
         </el-table-column>
112
         <el-table-column prop="drug_name" label="生产商" align="center">
113
         <el-table-column prop="drug_name" label="生产商" align="center">
113
            <template slot-scope="scope">
114
            <template slot-scope="scope">
114
              <span v-if="scope.row.stock_way == 4"> {{getManufacturer(scope.row.manufacturer)}}</span>
115
              <span v-if="scope.row.stock_way == 4"> {{getManufacturer(scope.row.manufacturer)}}</span>
115
-             <span v-if="scope.row.stock_way == 2">{{getManufacturer(scope.row.manufacturer)}}</span>
116
+             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{getManufacturer(scope.row.manufacturer)}}</span>
116
            </template>
117
            </template>
117
         </el-table-column>
118
         </el-table-column>
118
        </el-table>
119
        </el-table>
135
 <script>
136
 <script>
136
   import { uParseTime } from '@/utils/tools'
137
   import { uParseTime } from '@/utils/tools'
137
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
138
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
138
-  import {getStockInList} from "@/api/drug/drug_stock";
139
+  import {getStockInList,getStockOutList} from "@/api/drug/drug_stock";
139
   import {getStockDrugCount} from "@/api/stock"
140
   import {getStockDrugCount} from "@/api/stock"
140
   export default {
141
   export default {
141
     name: 'stockIn',
142
     name: 'stockIn',
143
      
144
      
144
       this.getlist()
145
       this.getlist()
145
       this.getStockDrugCount()
146
       this.getStockDrugCount()
146
-
147
+      this.getStockOutList()
147
     },
148
     },
148
     components: {
149
     components: {
149
       BreadCrumb
150
       BreadCrumb
182
         manufacturerList:[],
183
         manufacturerList:[],
183
         stockType:[
184
         stockType:[
184
           {id:0,name:"全部"},
185
           {id:0,name:"全部"},
185
-          {id:1,name:"手动出库"},
186
+          {id:3,name:"手动出库"},
186
           {id:2,name:"自动出库"},
187
           {id:2,name:"自动出库"},
187
-          {id:3,name:"入库"},
188
+          {id:4,name:"采购入库"},
188
         ],
189
         ],
189
         countList:[],
190
         countList:[],
190
         outCountList:[],
191
         outCountList:[],
199
        handleSizeChange(val) {
200
        handleSizeChange(val) {
200
         this.limit = val
201
         this.limit = val
201
         this.getlist()
202
         this.getlist()
203
+        this.getStockOutList()
202
       },
204
       },
203
       handleCurrentChange(val) {
205
       handleCurrentChange(val) {
204
         this.page = val
206
         this.page = val
205
         this.getlist()
207
         this.getlist()
208
+        this.getStockOutList()
206
       },
209
       },
207
         
210
         
208
     startTimeChange: function(val) {
211
     startTimeChange: function(val) {
213
         this.start_time = "";
216
         this.start_time = "";
214
       } else {
217
       } else {
215
         this.getlist()
218
         this.getlist()
219
+        this.getStockOutList()
216
       }
220
       }
217
     },
221
     },
218
     endTimeChange: function(val) {
222
     endTimeChange: function(val) {
222
         this.end_time = "";
226
         this.end_time = "";
223
       } else {
227
       } else {
224
        this.getlist()
228
        this.getlist()
229
+       this.getStockOutList()
225
       }
230
       }
226
      },
231
      },
227
      getManufacturer(id){
232
      getManufacturer(id){
250
           page:this.page,
255
           page:this.page,
251
           id:this.$route.query.id,
256
           id:this.$route.query.id,
252
           start_time:this.start_time,
257
           start_time:this.start_time,
253
-          end_time:this.end_time, 
258
+          end_time:this.end_time,
259
+          is_sys:this.stockType 
254
         } 
260
         } 
255
       getStockInList(params).then(response=>{
261
       getStockInList(params).then(response=>{
256
          if(response.data.state == 1){
262
          if(response.data.state == 1){
267
          }
273
          }
268
       })
274
       })
269
      },
275
      },
276
+    getStockOutList(){
277
+       var params= {
278
+          limit:this.limit,
279
+          page:this.page,
280
+          id:this.$route.query.id,
281
+          start_time:this.start_time,
282
+          end_time:this.end_time, 
283
+          is_sys:this.stockType 
284
+        } 
285
+      getStockOutList(params).then(response=>{
286
+        if(response.data.state == 1){
287
+          var outList = response.data.data.outList
288
+          console.log("outList990-0000990",outList)
289
+           for(let i=0;i<outList.length;i++){
290
+             if(outList[i].is_sys == 0){
291
+                outList[i].stock_way = 2
292
+             }
293
+             if(outList[i].is_sys == 1){
294
+                outList[i].stock_way = 3
295
+             }
296
+             this.tableList.push(outList[i])
297
+           }
298
+          var total = response.data.data.total
299
+          this.total = total
300
+        }  
301
+      })
302
+    },
270
     getStockDrugCount(){
303
     getStockDrugCount(){
271
         var params ={
304
         var params ={
272
           keywords: this.keywords,
305
           keywords: this.keywords,
280
            this.countList = count
313
            this.countList = count
281
            var outlist = response.data.data.outList
314
            var outlist = response.data.data.outList
282
            console.log("详情出库数量",outlist)
315
            console.log("详情出库数量",outlist)
316
+          
283
            this.outCountList = outlist
317
            this.outCountList = outlist
284
            var autoCount = response.data.data.autoCount
318
            var autoCount = response.data.data.autoCount
285
            console.log("详情自动出库",autoCount)
319
            console.log("详情自动出库",autoCount)
319
       // 把时间日期转成时间戳
353
       // 把时间日期转成时间戳
320
       return new Date(time).getTime() / 1000;
354
       return new Date(time).getTime() / 1000;
321
      },
355
      },
356
+     changeDrug(val){
357
+       this.tableList= []
358
+       if(val == 4 || val == 0){
359
+        this.getlist()
360
+       }
361
+       if(val == 2 || val == 3 || val == 0){
362
+        this.getStockOutList()
363
+       }
364
+      
365
+      
366
+     }
322
     }
367
     }
323
   }
368
   }
324
 </script>
369
 </script>

+ 20 - 4
src/xt_pages/stock/stockInOrder.vue Datei anzeigen

21
           style="width: 400px;"
21
           style="width: 400px;"
22
           v-model.trim="searchKey"
22
           v-model.trim="searchKey"
23
           class="filter-item"
23
           class="filter-item"
24
-          placeholder="单据编码/制单人/厂商"
24
+          placeholder="单据编码/制单人/耗材名称"
25
         />
25
         />
26
         <el-button
26
         <el-button
27
           size="small"
27
           size="small"
74
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
74
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
75
 
75
 
76
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
76
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
77
+
78
+        <!-- <el-button size="small" type="primary" @click="exportList">导出</el-button> -->
77
       </div>
79
       </div>
78
 
80
 
79
       <el-table
81
       <el-table
638
   name: "stockIn",
640
   name: "stockIn",
639
   components: { BreadCrumb, stockInDialog },
641
   components: { BreadCrumb, stockInDialog },
640
   created() {
642
   created() {
641
-
642
     var nowDate = new Date();
643
     var nowDate = new Date();
643
     var nowYear = nowDate.getFullYear();
644
     var nowYear = nowDate.getFullYear();
644
     var nowMonth = nowDate.getMonth() + 1;
645
     var nowMonth = nowDate.getMonth() + 1;
665
     this.fetchAllAdminUsers();
666
     this.fetchAllAdminUsers();
666
     this.GetAllGoodType()
667
     this.GetAllGoodType()
667
     this.GetAllGoodInfo()
668
     this.GetAllGoodInfo()
669
+    // this.getlist()
670
+    
668
   },
671
   },
669
   data() {
672
   data() {
670
 
673
 
1164
           this.tableShow = true
1167
           this.tableShow = true
1165
           for (let i = 0; i < response.data.data.info.length; i++) {
1168
           for (let i = 0; i < response.data.data.info.length; i++) {
1166
             this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
1169
             this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
1167
-            // response.data.data.info[i].product_date = this.getTime(response.data.data.info[i].product_date,"{y}-{m}-{d}");
1168
-            // response.data.data.info[i].expiry_date = this.getTime(response.data.data.info[i].expiry_date,"{y}-{m}-{d}");
1169
             response.data.data.info[i].price = response.data.data.info[i].price.toString();
1170
             response.data.data.info[i].price = response.data.data.info[i].price.toString();
1170
             response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
1171
             response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
1171
 
1172
 
1444
       }else{
1445
       }else{
1445
         this.$router.push("/stock/in/detail/print?id="+this.order_id)
1446
         this.$router.push("/stock/in/detail/print?id="+this.order_id)
1446
       }
1447
       }
1448
+    },
1449
+    getlist(){
1450
+      var params = {
1451
+        id:this.order_id,
1452
+        start_time:this.start_time,
1453
+        end_time:this.end_time,
1454
+      }
1455
+      getExportStockList().then(response=>{
1456
+
1457
+      })
1458
+    },
1459
+    exportList(){
1460
+      exportList().then(response=>{
1461
+
1462
+      })
1447
     }
1463
     }
1448
   }
1464
   }
1449
 };
1465
 };

+ 1 - 1
src/xt_pages/stock/stockInOrderDetailPrint.vue Datei anzeigen

43
                                     <td style="line-height:18px;">{{ item.remark }}</td>
43
                                     <td style="line-height:18px;">{{ item.remark }}</td>
44
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
44
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
45
                                     <td style="line-height:18px;">{{ getManufacturer(item.good_id) }}</td>
45
                                     <td style="line-height:18px;">{{ getManufacturer(item.good_id) }}</td>
46
-                                    <td style="line-height:18px;"><span v-if="item.good_id!=0">{{getUnit(item.good_id)}}</span></td>
46
+                                    <td style="line-height:18px;"><span v-if="item.good_id!=0">{{item.GoodInfo.packing_unit}}</span></td>
47
                                     <td style="line-height:18px;">{{item.price}}</td>
47
                                     <td style="line-height:18px;">{{item.price}}</td>
48
                                     <td style="line-height:18px;">{{item.warehousing_count}}</td> 
48
                                     <td style="line-height:18px;">{{item.warehousing_count}}</td> 
49
                                     <td style="line-height:18px;">{{(item.warehousing_count*item.price).toFixed(2)}}</td>
49
                                     <td style="line-height:18px;">{{(item.warehousing_count*item.price).toFixed(2)}}</td>

+ 116 - 50
src/xt_pages/stock/stockPrint.vue Datei anzeigen

21
                         <table class="table">
21
                         <table class="table">
22
                             <thead>
22
                             <thead>
23
                                 <tr>
23
                                 <tr>
24
-                                    <td width="60">商品编码</td>
25
-                                    <td width="80">耗材名称</td>
26
                                     <td width="80">耗材类型</td>
24
                                     <td width="80">耗材类型</td>
27
-                                    <td width="80">规格型号</td>
25
+                                    <td width="80">耗材名称</td>
26
+                                    <td width="80">规格&单位</td>
27
+                                    <td width="80">进货单价</td>
28
+                                    <td width="80">生产商</td>
28
                                     <td width="80">入库数量</td>
29
                                     <td width="80">入库数量</td>
29
-                                    <td width="80">进货价</td>
30
-                                    <td width="80">入库退货</td>
31
-                                    <td width="80">实际入库</td>
32
                                     <td width="80">出库数量</td>
30
                                     <td width="80">出库数量</td>
33
-                                    <td width="80">出库退库</td>
34
-                                    <td width="80">实际出库</td>
35
                                     <td width="80">剩余库存</td>
31
                                     <td width="80">剩余库存</td>
36
                                 </tr>
32
                                 </tr>
37
                             </thead>
33
                             </thead>
38
                             <tbody>
34
                             <tbody>
39
-                                <tr v-for='(item,index) in WarehouseInfo.warehouseInfoDate' :key="index">
40
-                                    <td>{{item.good_code}}</td>
41
-                                    <td>{{item.good_name}}</td>
42
-                                    <td>{{item.type.type_name}}</td>
43
-                                    <td>{{item.specification_name}}</td>
44
-                                    <td>{{stockInCount(item)}}</td>
45
-                                    <td>{{item.price}}</td>
46
-                                    <td>{{salesReturnCount(item)}}</td>
47
-                                    <td> {{ stockInCount(item) - salesReturnCount(item) }}</td>
48
-                                    <td>{{ stockOutCount(item) }}</td>
49
-                                    <td>{{cancelStockCount(item) }}</td>
50
-                                    <td>{{ stockOutCount(item) - cancelStockCount(item)}}</td>
51
-                                    <td>{{stockInCount(item) -salesReturnCount(item) -stockOutCount(item) +cancelStockCount(item)}}</td>
35
+                                <tr v-for='(item,index) in tableList' :key="index">
36
+                                   <td>{{getGoodType(item.good_type_id)}}</td>
37
+                                   <td>{{item.good_name }}</td>
38
+                                   <td><span>{{item.specification_name }} / {{item.packing_unit}}</span></td>
39
+                                   <td>{{item.price}}</td>
40
+                                   <td>{{getManufacture(item.manufacturer)}}</td>
41
+                                   <td>{{getInCount(item.good_id)}}</td>
42
+                                   <td><span>{{getOutCount(item.good_id) + getAutoCount(item.good_id)}}</span></td> 
43
+                                   <td>{{getInCount(item.good_id)- getOutCount(item.good_id) - getAutoCount(item.good_id)}}</td>
52
                                 </tr>
44
                                 </tr>
53
                             </tbody>
45
                             </tbody>
54
                         </table>
46
                         </table>
61
 
53
 
62
 <script>
54
 <script>
63
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
55
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
64
-import { getAllStockQueryList } from "@/api/stock";
56
+import { getAllStockList,GetAllGoodType,getStockDrugCount } from "@/api/stock";
65
 import print from 'print-js'
57
 import print from 'print-js'
66
 const moment = require('moment')
58
 const moment = require('moment')
67
 export default {
59
 export default {
87
           page:"",
79
           page:"",
88
           WarehouseInfo: {
80
           WarehouseInfo: {
89
           loading: false,
81
           loading: false,
90
-          warehouseInfoDate: []
82
+          warehouseInfoDate: [],
91
          },
83
          },
84
+          tableList:[],
85
+          goodType:[],
86
+          manufacturerList:[],
87
+          countList:[],
88
+          outCountList:[],
89
+          autoCountList:[],
92
         }
90
         }
93
     },
91
     },
94
     methods:{
92
     methods:{
103
           })
101
           })
104
       },
102
       },
105
       getlist(){
103
       getlist(){
106
-         const Params = {
107
-            page: this.page,
108
-            limit: this.limit,
109
-            keyword: this.keywords,
110
-            start_time:this.start_time,
111
-            end_time:this.end_time,
112
-            type_name:this.type_name,
113
-        };
114
-         this.WarehouseInfo.loading = true;
115
-         this.WarehouseInfo.warehouseInfoDate = [];
116
-         getAllStockQueryList(Params).then(response => {
117
-           if (response.data.state == 0) {
118
-            this.WarehouseInfo.loading = false;
104
+        const params = {
105
+          page: this.page,
106
+          limit: this.limit,
107
+          keywords: this.keywords,
108
+          start_time:this.start_time,
109
+          end_time:this.end_time,
110
+          type:this.type_name,
111
+        }
112
+        getAllStockList(params).then(response=>{
113
+         if(response.data.state == 1){
114
+           var list = response.data.data.list
115
+           console.log("list22222",list)
116
+           this.tableList = list
117
+           var total = response.data.data.total
118
+           console.log("total",total)
119
+           this.total = total
120
+           var manufacturerList = response.data.data.manufacturerList
121
+           this.manufacturerList = manufacturerList
122
+         }
123
+       })
124
+      },
125
+      GetAllGoodType() {
126
+        GetAllGoodType().then(response => {
127
+          if (response.data.state == 0) {
119
             this.$message.error(response.data.msg);
128
             this.$message.error(response.data.msg);
120
             return false;
129
             return false;
121
           } else {
130
           } else {
122
-            this.WarehouseInfo.loading = false;
123
-            this.total = response.data.data.total;
124
-          for (let i = 0; i < response.data.data.list.length; i++) {
125
-            this.WarehouseInfo.warehouseInfoDate.push( response.data.data.list[i]);
126
-          }
127
-          for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
128
-            if(this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info.length>0){
129
-              this.WarehouseInfo.warehouseInfoDate[i].price = this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info[0].price
130
-            }else{
131
-              this.WarehouseInfo.warehouseInfoDate[i].price = ""
131
+            for (let i = 0; i < response.data.data.goodType.length; i++) {
132
+              this.goodType.push(response.data.data.goodType[i]);
132
             }
133
             }
133
           }
134
           }
134
-         }
135
-            console.log("打印数据源头",this.WarehouseInfo.warehouseInfoDate)
136
-          });
135
+        });
137
       },
136
       },
138
-       stockInCount: function(row) {
137
+      stockInCount: function(row) {
139
       let total = 0;
138
       let total = 0;
140
       for (let i = 0; i < row.query_warehousing_info.length; i++) {
139
       for (let i = 0; i < row.query_warehousing_info.length; i++) {
141
         total = total + row.query_warehousing_info[i].warehousing_count;
140
         total = total + row.query_warehousing_info[i].warehousing_count;
163
       }
162
       }
164
       return total;
163
       return total;
165
     },
164
     },
165
+    getGoodType(id){
166
+      var name = ""
167
+      for(let i=0;i<this.goodType.length;i++){
168
+        if(id == this.goodType[i].id){
169
+           name = this.goodType[i].type_name
170
+        }
171
+      }
172
+      return name
173
+     },
174
+    getManufacture(id){
175
+       var name = ""
176
+       for(let i=0;i<this.manufacturerList.length;i++){
177
+         if(id == this.manufacturerList[i].id){
178
+           name = this.manufacturerList[i].manufacturer_name
179
+         }
180
+       }
181
+       return name
182
+     },
183
+     getStockDrugCount(){
184
+        var params ={
185
+          keywords: this.keywords,
186
+          start_time:this.start_time,
187
+          end_time:this.end_time,
188
+        }
189
+      getStockDrugCount(params).then(response=>{
190
+         if(response.data.state == 1){
191
+           var count = response.data.data.count
192
+           console.log("入库统计",count)
193
+           this.countList = count
194
+           var outlist = response.data.data.outList
195
+           console.log("出库数量",outlist)
196
+           this.outCountList = outlist
197
+           var autoCount = response.data.data.autoCount
198
+           console.log("autoCount",autoCount)
199
+           this.autoCountList = autoCount
200
+         }
201
+      })
202
+    },
203
+      getInCount(id){
204
+        var count= ""
205
+      for(let i=0;i<this.countList.length;i++){
206
+        if(id == this.countList[i].good_id){
207
+            count = this.countList[i].count
208
+        }
209
+      }
210
+      return count
211
+      },
212
+      getOutCount(id){
213
+        var count = ""
214
+        for(let i=0;i<this.outCountList.length;i++){
215
+          if(id == this.outCountList[i].good_id){
216
+            count = this.outCountList[i].count
217
+          }
218
+        }
219
+        return count
220
+      },
221
+      getAutoCount(id){
222
+        var count= ""
223
+        for(let i=0;i<this.autoCountList.length;i++){
224
+          if(id == this.autoCountList[i].good_id){
225
+            count = this.autoCountList[i].count
226
+          }
227
+        }
228
+        return count
229
+      }
166
     },
230
     },
167
     created(){
231
     created(){
168
       var starttime =  this.$route.query.start_time
232
       var starttime =  this.$route.query.start_time
176
       this.page = this.$route.query.page
240
       this.page = this.$route.query.page
177
       this.limit = this.$route.query.limit
241
       this.limit = this.$route.query.limit
178
       this.getlist()
242
       this.getlist()
243
+      this.GetAllGoodType()
244
+      this.getStockDrugCount()
179
     }
245
     }
180
 }
246
 }
181
 </script>
247
 </script>

+ 28 - 11
src/xt_pages/stock/stockQuery.vue Datei anzeigen

165
 export default {
165
 export default {
166
   name: "stockIn",
166
   name: "stockIn",
167
   created() {
167
   created() {
168
-    // this.GetAllStockQuery();
169
     this.GetAllGoodInfo();
168
     this.GetAllGoodInfo();
170
     this.GetAllGoodType();
169
     this.GetAllGoodType();
171
     this.getlist()
170
     this.getlist()
372
     },
371
     },
373
 
372
 
374
     exportList(){
373
     exportList(){
375
-
376
          import('@/vendor/Export2Excel').then(excel => {
374
          import('@/vendor/Export2Excel').then(excel => {
377
-         const tHeader = ['商品编码', '耗材名称', '耗材类型','规格型号','入库数量','进货价','入库退货','实际入库','出库数量','出库退库','实际出库','剩余库存']
378
-         const filterVal = ['good_code', 'good_name', 'type_name','specification_name','stockInCount','price','salesReturnCount','realCount','stockOutCount','cancelStockCount','realOutCount','overplus']
379
-         const data = this.formatJson(filterVal, this.WarehouseInfo.warehouseInfoDate)
380
-         console.log("data",data)
381
 
375
 
376
+         const tHeader = ['耗材类型', '耗材名称', '规格&单位','规格型号','进货单价','生产商','入库数量','出库数量','库存剩余量']
377
+         const filterVal = ['type_name', 'good_name', 'unit','specification_name','price','prodect_name','inCount','outCount','overplus']
378
+
379
+       
380
+         for(let i=0;i<this.tableList.length;i++){
381
+           this.tableList[i].type_name = this.getGoodType(this.tableList[i].good_type_id)
382
+           this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
383
+           this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
384
+           this.tableList[i].inCount =  this.getOutCount(this.tableList[i].good_id) + this.getAutoCount(this.tableList[i].good_id)
385
+           this.tableList[i].outCount = this.getOutCount(this.tableList[i].good_id) + this.getAutoCount(this.tableList[i].good_id)
386
+           this.tableList[i].overplus =this.getInCount(this.tableList[i].good_id)- this.getOutCount(this.tableList[i].good_id) - this.getAutoCount(this.tableList[i].good_id)
387
+         }
388
+         console.log("table",this.tableList)
389
+         const data = this.formatJson(filterVal, this.tableList)
382
          excel.export_json_to_excel({
390
          excel.export_json_to_excel({
383
            header: tHeader,
391
            header: tHeader,
384
            data,
392
            data,
391
         return jsonData.map(v => filterVal.map(j => v[j]));
399
         return jsonData.map(v => filterVal.map(j => v[j]));
392
       },
400
       },
393
       changeTypeName(){
401
       changeTypeName(){
394
-       this.GetAllStockQuery()
402
+       this.getlist()
395
       },
403
       },
396
       toPrint(){
404
       toPrint(){
397
         this.$router.push("/stock/stockprint?start_time="+this.start_time+"&end_time="+this.end_time+"&keyword="+this.keywords+"&type_name="+this.type_name+"&page="+this.page+"&limit="+this.limit)
405
         this.$router.push("/stock/stockprint?start_time="+this.start_time+"&end_time="+this.end_time+"&keyword="+this.keywords+"&type_name="+this.type_name+"&page="+this.page+"&limit="+this.limit)
429
         keywords: this.keywords,
437
         keywords: this.keywords,
430
         start_time:this.start_time,
438
         start_time:this.start_time,
431
         end_time:this.end_time,
439
         end_time:this.end_time,
432
-        type_name:this.type_name,
440
+        type:this.type_name,
433
       };
441
       };
434
      console.log("params",params)
442
      console.log("params",params)
435
       getAllStockList(params).then(response=>{
443
       getAllStockList(params).then(response=>{
456
     },
464
     },
457
     toClick(val){
465
     toClick(val){
458
        var manufacturer_name = ""
466
        var manufacturer_name = ""
467
+       var specification_name = ""
459
        for(let i=0;i<this.manufacturerList.length;i++){
468
        for(let i=0;i<this.manufacturerList.length;i++){
460
           if(val.manufacturer == this.manufacturerList[i].id){
469
           if(val.manufacturer == this.manufacturerList[i].id){
461
             manufacturer_name = this.manufacturerList[i].manufacturer_name  
470
             manufacturer_name = this.manufacturerList[i].manufacturer_name  
462
           }
471
           }
463
        }
472
        }
464
-      console.log("厂家22222",manufacturer_name)
465
-      this.$router.push({path:"/stock/in/stockflow?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name})
473
+      specification_name = val.specification_name + "/" + val.packing_unit
474
+      this.$router.push({path:"/stock/in/stockflow?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name})
466
     },
475
     },
467
     toClickOne(val){
476
     toClickOne(val){
468
-      this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.good_id+"&good_name="+val.good_name})
477
+       var manufacturer_name = ""
478
+       var specification_name = ""
479
+       for(let i=0;i<this.manufacturerList.length;i++){
480
+          if(val.manufacturer == this.manufacturerList[i].id){
481
+            manufacturer_name = this.manufacturerList[i].manufacturer_name  
482
+          }
483
+       }
484
+      specification_name = val.specification_name + "/" + val.packing_unit
485
+      this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name})
469
     },
486
     },
470
     getStockDrugCount(){
487
     getStockDrugCount(){
471
         var params ={
488
         var params ={