|
@@ -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>
|