Browse Source

新分支

28169 1 year ago
parent
commit
4e410fe6f9
1 changed files with 360 additions and 0 deletions
  1. 360 0
      src/xt_pages/stock/historyInventory.vue

+ 360 - 0
src/xt_pages/stock/historyInventory.vue View File

@@ -0,0 +1,360 @@
1
+<template>
2
+    <!--患者发药-->
3
+    <div class="main-contain new-main-contain">
4
+      <div class="position">
5
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
6
+      </div>
7
+      <div
8
+        class="app-container"
9
+        style="display: flex; flex: 1; padding: 10px 20px 0px 20px"
10
+      >
11
+        <div class="mainLeft">
12
+          <div>
13
+            <div
14
+              class="list"
15
+              style="display: flex; justify-content: space-between"
16
+            >
17
+              <el-input
18
+                size="small"
19
+                style="width: 200px"
20
+                v-model="keywords"
21
+                class="filter-item"
22
+                placeholder="请输入耗材名称"
23
+                clearable
24
+              />
25
+              <el-button
26
+               
27
+                size="small"
28
+                class="filter-item"
29
+                type="primary"
30
+                @click="searchAction"
31
+                >搜索
32
+              </el-button>
33
+            </div>
34
+  
35
+            <el-table
36
+              height="80vh"
37
+              ref="table01"
38
+              :data="goodList"
39
+              highlight-current-row
40
+              @current-change="handleCurrentChange"
41
+              border
42
+              style="width: 100%"
43
+              v-if="state == 1"
44
+              :row-style="{ color: '#303133' }"
45
+              :header-cell-style="{
46
+                backgroundColor: 'rgb(245, 247, 250)',
47
+                color: '#606266',
48
+              }"
49
+            >
50
+              <el-table-column prop="date" label="耗材名称" align="center">
51
+                <template slot-scope="scope">
52
+                   {{scope.row.good_name}}
53
+                </template>
54
+              </el-table-column>
55
+              <el-table-column prop="name" label="规格" align="center">
56
+                <template slot-scope="scope">
57
+                    {{scope.row.specification_name}}
58
+                </template>
59
+              </el-table-column>
60
+
61
+              <el-table-column prop="name" label="厂家" align="center">
62
+                <template slot-scope="scope">
63
+                  {{getManufacturerName(scope.row.manufacturer)}}
64
+                </template>
65
+              </el-table-column>
66
+            </el-table>
67
+            
68
+          </div>
69
+        </div>
70
+
71
+        <div class="mainRight">
72
+          <div class="titlelist">
73
+          <div>
74
+            <div>日期:{{nowTime}}   盘点人:{{user_name}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
75
+           </div>
76
+          </div>
77
+
78
+        </div>
79
+        <el-divider style="margin-top: 10px"></el-divider>
80
+        <div>
81
+          <el-table
82
+            :height="tableHeight"
83
+            :data="infoList"
84
+            border
85
+            style="width: 100%"
86
+            :row-style="{ color: '#303133' }"
87
+            :header-cell-style="{
88
+              backgroundColor: 'rgb(245, 247, 250)',
89
+              color: '#606266',
90
+            }"
91
+          >
92
+            <el-table-column label="入库单号"  align="center">
93
+              <template slot-scope="scope">
94
+                {{scope.row.warehousing_order}}
95
+              </template>
96
+            </el-table-column>
97
+            <el-table-column label="入库数量"  align="center">
98
+              <template slot-scope="scope">
99
+                {{scope.row.warehousing_count}}
100
+              </template>
101
+            </el-table-column>
102
+            <el-table-column label="有效期"  align="center">
103
+              <template slot-scope="scope">
104
+                {{getTime(scope.row.expiry_date)}}
105
+              </template>
106
+            </el-table-column>
107
+            <el-table-column label="批号"  align="center">
108
+              <template slot-scope="scope">
109
+                 {{scope.row.number}}
110
+              </template>
111
+            </el-table-column>
112
+            <el-table-column label="进货价"  align="center">
113
+              <template slot-scope="scope">
114
+                  {{scope.row.price}}
115
+              </template>
116
+            </el-table-column>
117
+            <el-table-column label="剩余库存"  align="center">
118
+              <template slot-scope="scope">
119
+                 {{scope.row.stock_count}}
120
+              </template>
121
+            </el-table-column>
122
+            <el-table-column label="盘点后数量"  align="center">
123
+              <template slot-scope="scope">
124
+                <el-input style="width:80px" v-model="scope.row.last_stock_count" type="number"></el-input>
125
+              </template>
126
+            </el-table-column>
127
+            <el-table-column label="操作"  align="center">
128
+              <template slot-scope="scope">
129
+                <span><el-button type="danger" @click="UpdateWarehouseInfo(scope.row)">保存</el-button></span>
130
+              </template>
131
+            </el-table-column>
132
+           
133
+          </el-table>
134
+        </div>
135
+       
136
+      </div>
137
+    
138
+      </div>
139
+    </div>
140
+  </template>
141
+  
142
+  <script>
143
+  
144
+  import BreadCrumb from "@/xt_pages/components/bread-crumb";
145
+  import {
146
+    getGoodInventoryList,
147
+    getGoodInventoryByGoodId,
148
+    updateInventoryWarehouseInfo
149
+  } from "@/api/pharmacy";
150
+  const moment = require("moment");
151
+  import { uParseTime } from '@/utils/tools'
152
+  export default {
153
+    components: {
154
+      BreadCrumb,
155
+    },
156
+    data() {
157
+      return {
158
+        nowTime: moment(new Date()).format("YYYY-MM-DD HH:MM:SS"),
159
+        patient_id: 0,
160
+        crumbs: [
161
+          { path: false, name: "耗材管理" },
162
+          { path: "/Pharmacy/patiantDispensing", name: "耗材盘点" },
163
+        ],
164
+        tableHeight: 400,
165
+        start_time: moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
166
+        start_time2: moment(new Date()).add("year", 0).format("YYYY-MM-DD HH:mm"),
167
+        state: 1, //1待发药,2已发药
168
+        waitmount: 0, //待发药人数
169
+        waitmount_data: [],
170
+        alreadmount: 0, //已发药人数
171
+        alreadmount_data: [],
172
+        keywords: "",
173
+        tableData: [],
174
+        propsTable: [],
175
+        tableData_list: [],
176
+        isVisibility: false,
177
+        isVisibilityTwo:false,
178
+        currentRow: null,
179
+        dialogVisible: false,
180
+        is_open: "2",
181
+        banshift: [
182
+          { value: 0, text: "全部班" },
183
+          { value: 1, text: "上午" },
184
+          { value: 2, text: "下午" },
185
+          { value: 3, text: "晚上" },
186
+        ],
187
+        shift: 0, //班次
188
+        fen: [],
189
+        partition: 0, //分区
190
+        drugList:[],
191
+        baseList:[],
192
+        org_id:'',
193
+        patients:{},
194
+        doctors:[],
195
+        diagnosearr:[],
196
+        diagnosis:'',
197
+        goodList:[],
198
+        manufacturerList:[],
199
+        user_name:this.$store.getters.xt_user.user.user_name,
200
+        infoList:[]
201
+      };
202
+    },
203
+    watch: {},
204
+    created() {
205
+      this.org_id = this.$store.getters.xt_user.org.id
206
+
207
+      this.getGoodInventoryList()
208
+    },
209
+   methods:{
210
+    getTime(val) {
211
+        if(val < 0){
212
+        return ""
213
+        }
214
+        if(val == ""){
215
+        return ""
216
+        }else {
217
+        return uParseTime(val, '{y}-{m}-{d}')
218
+        }
219
+     },
220
+    searchAction(){
221
+        this.getGoodInventoryList()
222
+    },
223
+    getGoodInventoryList(){
224
+        var params = {
225
+            keywords:this.keywords
226
+        }
227
+       getGoodInventoryList(params).then(response=>{
228
+            if(response.data.state ==1){
229
+                var list = response.data.data.list
230
+                this.goodList = list
231
+                this.$refs.table01.setCurrentRow(this.goodList[0])
232
+                this.manufacturerList = response.data.data.manufacturerList
233
+            }
234
+        })
235
+     },
236
+     getManufacturerName(id){
237
+       var manufacturer_name = ""
238
+       for(let i=0;i<this.manufacturerList.length;i++){
239
+          if(id == this.manufacturerList[i].id){
240
+            manufacturer_name = this.manufacturerList[i].manufacturer_name
241
+          }
242
+       }
243
+       return manufacturer_name
244
+     },
245
+     handleCurrentChange(val){
246
+       getGoodInventoryByGoodId(val.id).then(response=>{
247
+          if(response.data.state ==1){
248
+             var obj = {}
249
+             this.infoList = response.data.data.infoList
250
+          }
251
+       })
252
+     },
253
+     UpdateWarehouseInfo(row){
254
+       if(parseInt(row.last_stock_count) >=parseInt(row.stock_count)){
255
+         this.$message.error("该批次盘点后数量不能大于或等于入库数量!")
256
+         return false
257
+       }
258
+        var params = {
259
+            id:row.id,
260
+            stock_count:parseInt(row.stock_count),
261
+            last_stock_count:parseInt(row.last_stock_count),
262
+            good_id:row.good_id,
263
+            storehouse_id:parseInt(val.storehouse_id), 
264
+        }
265
+       updateInventoryWarehouseInfo(params).then(response=>{
266
+          if(response.data.state ==1){
267
+            var msg = response.data.data.msg
268
+            this.$message.success("保存成功!")
269
+          }
270
+       })
271
+     }
272
+    }
273
+  };
274
+  </script>
275
+  
276
+  <style rel="stylesheet/css" lang="scss" scoped>
277
+  .new-main-contain {
278
+    height: 100%;
279
+    display: flex;
280
+    flex-direction: column;
281
+  }
282
+  
283
+  .app-container {
284
+    height: 100%;
285
+  }
286
+  .mainLeft {
287
+    width: 400px;
288
+    height: 100%;
289
+    display: flex;
290
+    flex-direction: column;
291
+  
292
+    .el-radio {
293
+      margin-right: 5px;
294
+    }
295
+  
296
+    .list {
297
+      margin: 10px 0;
298
+    }
299
+  }
300
+  .mainRight {
301
+    margin-left: 10px;
302
+    flex: 1;
303
+    height: 100%;
304
+    display: flex;
305
+    flex-direction: column;
306
+    overflow-y: auto;
307
+    .titlelist {
308
+      display: flex;
309
+      justify-content: space-between;
310
+      white-space: nowrap;
311
+      color: #909399;
312
+      font-size: 14px;
313
+      /deep/ .el-input__inner {
314
+        font-size: 13px !important;
315
+      }
316
+    }
317
+    .el-table {
318
+      margin-top: -13px;
319
+    }
320
+    .el-button {
321
+      height: 34px;
322
+      width: 65px;
323
+    }
324
+    /deep/ .el-divider {
325
+      height: 2px;
326
+      margin-top: 10px;
327
+    }
328
+  
329
+    /deep/ .el-table__body-wrapper {
330
+      overflow-x: scroll !important;
331
+    }
332
+  }
333
+  
334
+  /deep/ .el-input__inner {
335
+    padding-right: 15px;
336
+  }
337
+  
338
+  /deep/ .el-table--scrollable-x .el-table__body-wrapper {
339
+    overflow: auto;
340
+    overflow-x: hidden;
341
+  }
342
+  /deep/ .gutter {
343
+    width: 15px !important;
344
+    display: inline-block !important;
345
+  }
346
+  /deep/ .el-table__fixed-right-patch {
347
+    width: 15px !important;
348
+  }
349
+  
350
+  /deep/ .el-table__fixed-right {
351
+    bottom: 0 !important;
352
+    left: auto;
353
+    right: 0;
354
+  }
355
+  /deep/ .el-table__body-wrapper::-webkit-scrollbar {
356
+    width: 15px !important;
357
+    height: 15px !important;
358
+  }
359
+  </style>
360
+