XMLWAN 4 years ago
parent
commit
f80da7138c

+ 149 - 4
src/xt_pages/stock/drugs/drugStockInOrder.vue View File

@@ -124,8 +124,24 @@
124 124
           </template>
125 125
         </el-table-column>
126 126
 
127
-        <el-table-column label="操作" align="center">
127
+        <el-table-column label="操作" align="center" width="240">
128 128
           <template slot-scope="scope">
129
+
130
+             <el-tooltip
131
+              class="item"
132
+              effect="dark"
133
+              content="详情"
134
+              placement="top"
135
+            >
136
+              <el-button
137
+                size="small"
138
+                type="warning"
139
+                icon="el-icon-document"
140
+                @click="handleSearch(scope.row.id)"
141
+              >
142
+              </el-button>
143
+            </el-tooltip>
144
+            
129 145
             <el-tooltip
130 146
               class="item"
131 147
               effect="dark"
@@ -170,6 +186,102 @@
170 186
       >
171 187
       </el-pagination>
172 188
     </div>
189
+
190
+
191
+    <el-dialog
192
+      title="药品详细"
193
+      :visible.sync="dialogVisible"
194
+      width="60%">
195
+      <span>
196
+          <el-table
197
+          :data="WarehouseInfo.warehouseInfoDate"
198
+          :class="signAndWeighBoxPatients"
199
+          style="width: 100%"
200
+          border
201
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
202
+        >
203
+          <el-table-column min-width="35" align="center">
204
+            <template slot="header" slot-scope="scope">
205
+              <span>药品名称</span>
206
+            </template>
207
+
208
+            <template slot-scope="scope">
209
+              <span v-if="scope.row.drug_id != 0">{{
210
+                scope.row.drug.drug_name
211
+              }}</span>
212
+            </template>
213
+          </el-table-column>
214
+          <el-table-column min-width="35" align="center">
215
+            <template slot="header" slot-scope="scope">
216
+              <span>规格名称</span>
217
+            </template>
218
+            <template slot-scope="scope">
219
+              <span v-if="scope.row.drug_id != 0">{{
220
+                scope.row.drug?scope.row.drug.drug_spec:''
221
+              }}</span>
222
+            </template>
223
+          </el-table-column>
224
+
225
+          <el-table-column min-width="23" align="center">
226
+            <template slot="header" slot-scope="scope">
227
+              <span>单价</span>
228
+            </template>
229
+            <template slot-scope="scope">
230
+              <span>{{ scope.row.price }}</span>
231
+            </template>
232
+          </el-table-column>
233
+
234
+          <el-table-column min-width="23" align="center">
235
+            <template slot="header" slot-scope="scope">
236
+              <span>入库数量</span>
237
+            </template>
238
+            <template slot-scope="scope">
239
+              <span>{{ scope.row.warehousing_count }}</span>
240
+            </template>
241
+          </el-table-column>
242
+
243
+          <el-table-column label="总价" min-width="20" align="center">
244
+            <template slot-scope="scope">
245
+              {{ calculate(scope.row.price * scope.row.warehousing_count) }}
246
+            </template>
247
+          </el-table-column>
248
+
249
+          <el-table-column align="center" min-width="25">
250
+            <template slot="header" slot-scope="scope">
251
+              <span>批号</span>
252
+            </template>
253
+            <template slot-scope="scope">
254
+              <span>{{ scope.row.number }}</span>
255
+            </template>
256
+          </el-table-column>
257
+          <el-table-column label="生产日期" min-width="40" align="center">
258
+            <template v-if="scope.row.product_date != 0" slot-scope="scope">
259
+              {{ scope.row.product_date | parseTime("{y}-{m}-{d}") }}
260
+            </template>
261
+          </el-table-column>
262
+          <el-table-column label="有效日期" min-width="40" align="center">
263
+            <template v-if="scope.row.expiry_date != 0" slot-scope="scope">
264
+              {{ scope.row.expiry_date | parseTime("{y}-{m}-{d}") }}
265
+            </template>
266
+          </el-table-column>
267
+          <el-table-column label="备注" min-width="20" align="center">
268
+            <template slot-scope="scope">
269
+              <el-popover placement="top-start" width="250" trigger="hover">
270
+                <div>{{ scope.row.remark }}</div>
271
+                <span slot="reference" v-if="scope.row.remark.length > 20">{{
272
+                  scope.row.remark.substr(0, 20) + "..."
273
+                }}</span>
274
+                <span slot="reference" v-else>{{ scope.row.remark }}</span>
275
+              </el-popover>
276
+            </template>
277
+          </el-table-column>
278
+        </el-table>
279
+      </span>
280
+      <span slot="footer" class="dialog-footer">
281
+        <el-button @click="dialogVisible = false">取 消</el-button>
282
+        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
283
+      </span>
284
+    </el-dialog>
173 285
   </div>
174 286
 </template>
175 287
 
@@ -180,7 +292,8 @@ import {
180 292
   deleteDrugWarehouseInfo,
181 293
   GetAllConfig,
182 294
   getDrugWarehouseInfoList,
183
-  getDrugWarehouseList
295
+  getDrugWarehouseList,
296
+  
184 297
 } from "@/api/drug/drug_stock";
185 298
 import BreadCrumb from "../../components/bread-crumb";
186 299
 
@@ -208,7 +321,8 @@ export default {
208 321
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
209 322
       "-" +
210 323
       (nowDay < 10 ? "0" + nowDay : nowDay);
211
-
324
+    
325
+   
212 326
     this.GetWarehouse();
213 327
     this.GetConfigInfo();
214 328
     this.fetchAllAdminUsers();
@@ -243,7 +357,9 @@ export default {
243 357
         loading: false,
244 358
         warehouseInfoDate: []
245 359
       },
246
-      startTime: ""
360
+      
361
+      startTime: "",
362
+      dialogVisible:false
247 363
     };
248 364
   },
249 365
   methods: {
@@ -279,6 +395,7 @@ export default {
279 395
         end_time: this.end_time,
280 396
         type: this.type
281 397
       };
398
+      console.log("params",Params)
282 399
       this.Warehouse.warehouseDate = [];
283 400
       getDrugWarehouseList(Params).then(response => {
284 401
         if (response.data.state == 0) {
@@ -382,12 +499,14 @@ export default {
382 499
       this.GetWarehouse();
383 500
     },
384 501
     startTimeChange(val) {
502
+    
385 503
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
386 504
       if (time > 0) {
387 505
         this.$message.error("结束时间不能小于开始时间");
388 506
         this.start_time = "";
389 507
       } else {
390 508
         this.startTime = this.getTimestamp(val);
509
+        this.start_time = val
391 510
         this.GetWarehouse();
392 511
       }
393 512
     },
@@ -397,6 +516,7 @@ export default {
397 516
         this.$message.error("结束时间不能小于开始时间");
398 517
         this.end_time = "";
399 518
       } else {
519
+        this.end_time = val
400 520
         this.GetWarehouse();
401 521
       }
402 522
     },
@@ -413,6 +533,31 @@ export default {
413 533
         name: "drugStockInDetail",
414 534
         query: { id: row.id, type: this.type }
415 535
       });
536
+    
537
+    },
538
+    handleSearch(id){
539
+       this.WarehouseInfo.warehouseInfoDate=[]
540
+       this.GetOrderDetail(id);
541
+      this.dialogVisible = true
542
+    },
543
+    GetOrderDetail(order_id) {
544
+      const params = {
545
+        id: order_id
546
+      };
547
+      getDrugWarehouseInfoList(params).then(response => {
548
+        if (response.data.state == 0) {
549
+          this.$message.error(response.data.msg);
550
+          return false;
551
+        } else {
552
+          for (let i = 0; i < response.data.data.info.length; i++) {
553
+            this.WarehouseInfo.warehouseInfoDate = []
554
+            this.WarehouseInfo.warehouseInfoDate.push(
555
+              response.data.data.info[i]
556
+            );
557
+          }
558
+          this.WarehouseInfo.warehouse = response.data.data.warehousing;
559
+        }
560
+      });
416 561
     },
417 562
     handleDelete: function(index, row) {
418 563
       const ids = [];

+ 2 - 2
src/xt_pages/stock/drugs/drugStockInOrderDetail.vue View File

@@ -154,8 +154,8 @@ export default {
154 154
     return {
155 155
       crumbs: [
156 156
         { path: false, name: "库存管理" },
157
-        { path: false, name: "耗材入库单" },
158
-        { path: false, name: "入库单详情" }
157
+        { path: false, name: "药品入库单"},
158
+        { path: false, name: "入库单详情"}
159 159
       ],
160 160
       crumbs2: [
161 161
         { path: false, name: "库存管理" },

+ 285 - 4
src/xt_pages/stock/drugs/drugStockOutOrder.vue View File

@@ -132,8 +132,24 @@
132 132
         </el-table-column>
133 133
 
134 134
 
135
-        <el-table-column label="操作" align="center">
135
+        <el-table-column label="操作" align="center" width="240">
136 136
           <template slot-scope="scope">
137
+           
138
+            <el-tooltip
139
+              class="item"
140
+              effect="dark"
141
+              content="详情"
142
+              placement="top"
143
+            >
144
+              <el-button
145
+                size="small"
146
+                type="warning"
147
+                icon="el-icon-document"
148
+                @click="handleSearch(scope.row.id)"
149
+              >
150
+              </el-button>
151
+            </el-tooltip>
152
+
137 153
             <el-tooltip
138 154
               class="item"
139 155
               effect="dark"
@@ -178,6 +194,157 @@
178 194
       >
179 195
       </el-pagination>
180 196
     </div>
197
+
198
+
199
+    <el-dialog
200
+      title="出库详细"
201
+      :visible.sync="dialogVisible"
202
+      width="60%"
203
+     >
204
+      <span>
205
+        <el-table :data="warehousingOutInfo.warehousingOutData" :class="signAndWeighBoxPatients" style="width: 100%"
206
+                  border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
207
+                  :span-method="merge"
208
+        >
209
+          <el-table-column min-width="35" align="center">
210
+            <template slot="header" slot-scope="scope">
211
+              <span>药品名称</span>
212
+            </template>
213
+
214
+            <template slot-scope="scope">
215
+              <span v-if="scope.row.drug_id != 0">{{
216
+                scope.row.drug.drug_name
217
+              }}</span>
218
+            </template>
219
+          </el-table-column>
220
+          <el-table-column min-width="35" align="center">
221
+            <template slot="header" slot-scope="scope">
222
+              <span>规格名称</span>
223
+            </template>
224
+            <template slot-scope="scope">
225
+              <span v-if="scope.row.drug_id != 0">{{
226
+                scope.row.drug?scope.row.drug.drug_spec:''
227
+              }}</span>
228
+            </template>
229
+          </el-table-column>
230
+
231
+          <el-table-column min-width="23" align="center">
232
+            <template slot="header" slot-scope="scope">
233
+              <span>单价</span>
234
+            </template>
235
+            <template slot-scope="scope">
236
+              <span>{{scope.row.price}}</span>
237
+            </template>
238
+          </el-table-column>
239
+
240
+          <el-table-column min-width="23" align="center">
241
+            <template slot="header" slot-scope="scope">
242
+              <span>出库数量</span>
243
+            </template>
244
+            <template slot-scope="scope">
245
+              <span>{{scope.row.count}}</span>
246
+
247
+            </template>
248
+          </el-table-column>
249
+          <el-table-column label="总价" min-width="20" align="center">
250
+            <template slot-scope="scope">
251
+              {{calculate(scope.row.price*scope.row.count)}}
252
+            </template>
253
+          </el-table-column>
254
+
255
+          <el-table-column label="备注" min-width="20" align="center">
256
+            <template slot-scope="scope">
257
+              <el-popover placement="top-start" width="250" trigger="hover">
258
+                <div>{{scope.row.remark}}</div>
259
+                <span slot="reference"
260
+                      v-if="scope.row.remark.length > 20">{{ scope.row.remark.substr(0,20)+'...' }}</span>
261
+                <span slot="reference" v-else>{{ scope.row.remark}}</span>
262
+              </el-popover>
263
+
264
+            </template>
265
+          </el-table-column>
266
+
267
+          <el-table-column label="" align="center"  >
268
+            <template slot-scope="scope" v-if="scope.row.is_sys == 1">
269
+             <div style="color: #589ff8" @click="jump(scope.row.id)">使用明细</div>
270
+            </template>
271
+          </el-table-column>
272
+        </el-table>
273
+      </span>
274
+      <span slot="footer" class="dialog-footer">
275
+        <el-button @click="dialogVisible = false">取 消</el-button>
276
+        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
277
+      </span>
278
+    </el-dialog>
279
+
280
+
281
+    <el-dialog
282
+      title="出库明细"
283
+      :visible.sync="dialogVisibleTwo"
284
+      width="60%">
285
+      <span>
286
+         <div class="app-container">
287
+
288
+      <div class="filter-container">
289
+        <span style="font-size: 18px;color: #606266">商品使用明细</span>
290
+      </div>
291
+
292
+      <div class="cell clearfix">
293
+        <span style="width: 300px;color: #606266" v-if="userList.length>0">商品类型: {{userList[0].drug.drug_name}} </span>
294
+        <span style="width: 300px;color: #606266" v-if="userList.length>0">规格名称: {{userList[0].drug.drug_spec}}</span>
295
+      </div>
296
+
297
+      <el-row :gutter="12" style="margin-top: 10px">
298
+        <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 50%"
299
+                  border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
300
+        >
301
+          <el-table-column min-width="35" align="center">
302
+            <template slot="header" slot-scope="scope">
303
+              <span>序号</span>
304
+            </template>
305
+            <template slot-scope="scope">
306
+              <span v-if="scope.row.is_total == 0">{{scope.$index+1}}</span>
307
+              <span v-if="scope.row.is_total == 1">{{'合计'}}</span>
308
+            </template>
309
+          </el-table-column>
310
+
311
+          <el-table-column min-width="35" align="center">
312
+            <template slot="header" slot-scope="scope">
313
+              <span>使用人</span>
314
+            </template>
315
+            <template slot-scope="scope">
316
+              <span v-if="scope.row.is_total == 0">{{scope.row.user.name}}</span>
317
+              <span v-if="scope.row.is_total == 1"></span>
318
+            </template>
319
+          </el-table-column>
320
+          <el-table-column min-width="35" align="center">
321
+            <template slot="header" slot-scope="scope">
322
+              <span>使用数量</span>
323
+            </template>
324
+            <template slot-scope="scope">
325
+              <span >{{scope.row.count}}</span>
326
+            </template>
327
+          </el-table-column>
328
+
329
+          <el-table-column min-width="35" align="center">
330
+            <template slot="header" slot-scope="scope">
331
+              <span>使用时间</span>
332
+            </template>
333
+            <template slot-scope="scope">
334
+              <span  v-if="scope.row.is_total == 0">{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
335
+              <span  v-if="scope.row.is_total == 1">{{scope.row.total}} </span>
336
+            </template>
337
+          </el-table-column>
338
+
339
+        </el-table>
340
+      </el-row>
341
+    </div>
342
+      </span>
343
+      <span slot="footer" class="dialog-footer">
344
+        <el-button @click="dialogVisibleTwo = false">取 消</el-button>
345
+        <el-button type="primary" @click="dialogVisibleTwo = false">确 定</el-button>
346
+      </span>
347
+    </el-dialog>
181 348
   </div>
182 349
 </template>
183 350
 
@@ -188,7 +355,9 @@ import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
188 355
 import {
189 356
   deleteDrugWarehouseOut,
190 357
   GetAllConfig,
191
-  getDrugWarehouseOutList
358
+  getDrugWarehouseOutList,
359
+  getDrugWarehouseOutInfo,
360
+  getDrugWarehouseOutUser
192 361
 } from "@/api/drug/drug_stock";
193 362
 import BreadCrumb from "../../components/bread-crumb";
194 363
 
@@ -244,7 +413,16 @@ export default {
244 413
       manufacturer: [],
245 414
       selectedTableData: [],
246 415
       dealer: [],
247
-      type: 1
416
+      type: 1,
417
+      dialogVisible:false,
418
+      dialogVisibleTwo:false,
419
+      warehousingOutInfo: {
420
+      loading: false,
421
+       warehousingOutData: [],
422
+       info: {}
423
+      },
424
+      userList:[],
425
+     
248 426
     };
249 427
   },
250 428
   methods: {
@@ -389,6 +567,32 @@ export default {
389 567
         query: { id: row.id, type: this.type }
390 568
       });
391 569
     },
570
+    handleSearch(id){
571
+      this.warehousingOutInfo.warehousingOutData = []
572
+      this.GetOrderDetail(id)
573
+      this.dialogVisible = true
574
+      
575
+    },
576
+    GetOrderDetail(order_id) {
577
+        const params = {
578
+          'id': order_id
579
+        }
580
+        getDrugWarehouseOutInfo(params).then(response => {
581
+          if (response.data.state == 0) {
582
+
583
+            this.$message.error(response.data.msg)
584
+            return false
585
+          } else {
586
+            this.warehousingOutInfo.warehousingOutData=[]
587
+            for (let i = 0; i < response.data.data.list.length; i++) {
588
+
589
+              this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
590
+            }
591
+            this.warehousingOutInfo.info = response.data.data.info
592
+            this.handleSpanTempArr()
593
+          }
594
+        })
595
+      },
392 596
     handleDelete: function(index, row) {
393 597
       const ids = [];
394 598
       ids.push(row.id);
@@ -479,7 +683,84 @@ export default {
479 683
           });
480 684
         })
481 685
         .catch(() => {});
482
-    }
686
+    },
687
+
688
+    jump(id){
689
+      this.GetOrderDetailTwo(id)
690
+      this.userList=[]
691
+    },
692
+
693
+     GetOrderDetailTwo(order_id) {
694
+        const params = {
695
+          'id': order_id
696
+        }
697
+        getDrugWarehouseOutUser(params).then(response => {
698
+          if (response.data.state == 0) {
699
+            this.$message.error(response.data.msg)
700
+            return false
701
+          } else {
702
+            var total = 0
703
+            for (let i = 0; i < response.data.data.list.length; i++) {
704
+              var obj = response.data.data.list[i]
705
+              obj['is_total'] = 0
706
+              this.userList.push(obj)
707
+              total = total + response.data.data.list[i].count
708
+            }
709
+            this.userList=[]
710
+            this.userList.push({
711
+              is_total: 1,
712
+              total: total,
713
+            })
714
+
715
+            console.log(this.userList)
716
+          }
717
+        })
718
+      },
719
+       merge({ row, column, rowIndex, columnIndex }) {
720
+        if (columnIndex === 0) {
721
+          const _row = this.tempArr[rowIndex]
722
+          const _col = _row > 0 ? 1 : 0
723
+          return {
724
+            rowspan: _row,
725
+            colspan: _col
726
+          }
727
+        }
728
+      },
729
+      handleSpanTempArr(){
730
+        this.tempArr = []
731
+
732
+        for (let i = 0; i < this.warehousingOutInfo.warehousingOutData.length; i++) {
733
+          if (i === 0) {
734
+            this.tempArr.push(1)
735
+            this.pos = 0
736
+          } else {
737
+            // 判断当前元素与上一个元素是否相同
738
+            if (this.warehousingOutInfo.warehousingOutData[i].drug_id === this.warehousingOutInfo.warehousingOutData[i - 1].drug_id) {
739
+              this.tempArr[this.pos] += 1
740
+              this.tempArr.push(0)
741
+            } else {
742
+              this.tempArr.push(1)
743
+              this.pos = i
744
+            }
745
+          }
746
+        }
747
+
748
+        let sameRowArr = [], sIdx = 0
749
+        this.warehousingOutInfo.warehousingOutData.forEach((item, index) => {
750
+          item.index = index
751
+          if (index === 0) {
752
+            sameRowArr.push([index])
753
+          } else {
754
+            if (item.drug_id === this.warehousingOutInfo.warehousingOutData[index - 1].drug_id) {
755
+              sameRowArr[sIdx].push(index)
756
+            } else {
757
+              sIdx = sIdx + 1
758
+              sameRowArr.push([index])
759
+            }
760
+          }
761
+        })
762
+        this.sameRowArr = sameRowArr
763
+      }
483 764
   }
484 765
 };
485 766
 </script>

+ 6 - 3
src/xt_pages/stock/drugs/drugStockOutOrderDetail.vue View File

@@ -152,7 +152,8 @@
152 152
           return ''
153 153
         }
154 154
         return Math.round(parseFloat(val) * 100) / 100
155
-      }, GetOrderDetail: function(order_id) {
155
+      },
156
+       GetOrderDetail: function(order_id) {
156 157
         const params = {
157 158
           'id': order_id
158 159
         }
@@ -202,12 +203,14 @@
202 203
         })
203 204
       }, editRecord: function() {
204 205
         this.$emit('edit-record')
205
-      },jump(row){
206
+      },
207
+      jump(row){
206 208
         this.$router.push({
207 209
           name: 'drugStockUserDetail',
208 210
           query: { id: row.id }
209 211
         })
210
-      },merge({ row, column, rowIndex, columnIndex }) {
212
+      },
213
+      merge({ row, column, rowIndex, columnIndex }) {
211 214
         if (columnIndex === 0) {
212 215
           const _row = this.tempArr[rowIndex]
213 216
           const _col = _row > 0 ? 1 : 0

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

@@ -1092,7 +1092,7 @@ export default {
1092 1092
           this.$message.error(response.data.msg);
1093 1093
           return false;
1094 1094
         } else {
1095
-          console.log("2223333-------",response.data.data.info)
1095
+          
1096 1096
           for (let i = 0; i < response.data.data.info.length; i++) {
1097 1097
             this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
1098 1098
             response.data.data.info[i].product_date = this.getTime(

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

@@ -37,6 +37,7 @@
37 37
       </div>
38 38
 
39 39
       <div class="cell clearfix" style="margin-top: 10px">
40
+     
40 41
         <el-button size="small" icon="el-icon-edit" @click="editRecord"
41 42
           >编辑</el-button
42 43
         >