|
@@ -124,8 +124,22 @@
|
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="260px">
|
128
|
128
|
<template slot-scope="scope">
|
|
129
|
+ <el-tooltip
|
|
130
|
+ class="item"
|
|
131
|
+ effect="dark"
|
|
132
|
+ content="详情"
|
|
133
|
+ placement="top"
|
|
134
|
+ >
|
|
135
|
+ <el-button
|
|
136
|
+ size="small"
|
|
137
|
+ type="primary"
|
|
138
|
+ icon="el-icon-search"
|
|
139
|
+ @click="handleSearch(scope.row.id)"
|
|
140
|
+ >
|
|
141
|
+ </el-button>
|
|
142
|
+ </el-tooltip>
|
129
|
143
|
<el-tooltip
|
130
|
144
|
class="item"
|
131
|
145
|
effect="dark"
|
|
@@ -140,6 +154,7 @@
|
140
|
154
|
>
|
141
|
155
|
</el-button>
|
142
|
156
|
</el-tooltip>
|
|
157
|
+
|
143
|
158
|
<el-tooltip
|
144
|
159
|
class="item"
|
145
|
160
|
effect="dark"
|
|
@@ -170,10 +185,370 @@
|
170
|
185
|
>
|
171
|
186
|
</el-pagination>
|
172
|
187
|
</div>
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+ <el-dialog
|
|
192
|
+ title="详情"
|
|
193
|
+ :visible.sync="dialogVisible"
|
|
194
|
+ width="80%"
|
|
195
|
+ >
|
|
196
|
+ <span>
|
|
197
|
+ <div>
|
|
198
|
+ <el-row>
|
|
199
|
+ <span style="font-size: 18px;color: #606266">入库单详情</span>
|
|
200
|
+ </el-row>
|
|
201
|
+ <el-row style="float:left;">
|
|
202
|
+ <span style="color: #606266"
|
|
203
|
+ >入库单号: {{ WarehouseInfo.warehouse.warehousing_order }}</span
|
|
204
|
+ >
|
|
205
|
+ </el-row>
|
|
206
|
+ </div>
|
|
207
|
+ <div class="cell clearfix">
|
|
208
|
+ <span style="width: 300px;color: #606266;float:right">单据日期:{{ WarehouseInfo.warehouse.warehousing_time | parseTime("{y}-{m}-{d}")}} </span>
|
|
209
|
+ <span style="width: 300px;color: #606266;float:right">厂商:{{ getManufactuerName(WarehouseInfo.warehouse.manufacturer) }}</span>
|
|
210
|
+ <span style="width: 300px;color: #606266"
|
|
211
|
+ >经销商:{{ getDealerName(WarehouseInfo.warehouse.dealer) }} </span>
|
|
212
|
+ </div>
|
|
213
|
+ <div class="cell clearfix" style="margin-top: 10px">
|
|
214
|
+ <el-button size="small" icon="el-icon-edit" @click="editRecord"
|
|
215
|
+ >编辑</el-button
|
|
216
|
+ >
|
|
217
|
+ <el-button size="small" icon="el-icon-delete" @click="deleteRecord"
|
|
218
|
+ >删除</el-button
|
|
219
|
+ >
|
|
220
|
+
|
|
221
|
+ <el-row :gutter="12" style="margin-top: 10px">
|
|
222
|
+ <el-table
|
|
223
|
+ :data="WarehouseInfo.warehouseInfoDate"
|
|
224
|
+ :class="signAndWeighBoxPatients"
|
|
225
|
+ style="width: 100%"
|
|
226
|
+ border
|
|
227
|
+ :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
|
|
228
|
+ >
|
|
229
|
+ <el-table-column min-width="35" align="center">
|
|
230
|
+ <template slot="header" slot-scope="scope">
|
|
231
|
+ <span>商品类型</span>
|
|
232
|
+ </template>
|
|
233
|
+
|
|
234
|
+ <template slot-scope="scope">
|
|
235
|
+ <span v-if="scope.row.good_type_id != 0">{{
|
|
236
|
+ getTypeName(scope.row.good_type_id)
|
|
237
|
+ }}</span>
|
|
238
|
+ </template>
|
|
239
|
+ </el-table-column>
|
|
240
|
+ <el-table-column min-width="35" align="center">
|
|
241
|
+ <template slot="header" slot-scope="scope">
|
|
242
|
+ <span>规格名称</span>
|
|
243
|
+ </template>
|
|
244
|
+ <template slot-scope="scope">
|
|
245
|
+ <span v-if="scope.row.good_id != 0">{{
|
|
246
|
+ getSpecificationName(scope.row.good_id)
|
|
247
|
+ }}</span>
|
|
248
|
+ </template>
|
|
249
|
+ </el-table-column>
|
|
250
|
+
|
|
251
|
+ <el-table-column min-width="23" align="center">
|
|
252
|
+ <template slot="header" slot-scope="scope">
|
|
253
|
+ <span>单价</span>
|
|
254
|
+ </template>
|
|
255
|
+ <template slot-scope="scope">
|
|
256
|
+ <span>{{ scope.row.price }}</span>
|
|
257
|
+ </template>
|
|
258
|
+ </el-table-column>
|
|
259
|
+
|
|
260
|
+ <el-table-column min-width="23" align="center">
|
|
261
|
+ <template slot="header" slot-scope="scope">
|
|
262
|
+ <span>入库数量</span>
|
|
263
|
+ </template>
|
|
264
|
+ <template slot-scope="scope">
|
|
265
|
+ <span>{{ scope.row.warehousing_count }}</span>
|
|
266
|
+ </template>
|
|
267
|
+ </el-table-column>
|
|
268
|
+
|
|
269
|
+ <el-table-column label="总价" min-width="20" align="center">
|
|
270
|
+ <template slot-scope="scope">
|
|
271
|
+ {{ calculate(scope.row.price * scope.row.warehousing_count) }}
|
|
272
|
+ </template>
|
|
273
|
+ </el-table-column>
|
|
274
|
+
|
|
275
|
+ <el-table-column align="center" min-width="25">
|
|
276
|
+ <template slot="header" slot-scope="scope">
|
|
277
|
+ <span>批号</span>
|
|
278
|
+ </template>
|
|
279
|
+ <template slot-scope="scope">
|
|
280
|
+ <span>{{ scope.row.number }}</span>
|
|
281
|
+ </template>
|
|
282
|
+ </el-table-column>
|
|
283
|
+ <el-table-column label="生产日期" min-width="40" align="center">
|
|
284
|
+ <template v-if="scope.row.product_date != 0" slot-scope="scope">
|
|
285
|
+ {{ scope.row.product_date }}
|
|
286
|
+ </template>
|
|
287
|
+ </el-table-column>
|
|
288
|
+ <el-table-column label="有效日期" min-width="40" align="center">
|
|
289
|
+ <template v-if="scope.row.expiry_date != 0" slot-scope="scope">
|
|
290
|
+ {{ scope.row.expiry_date }}
|
|
291
|
+ </template>
|
|
292
|
+ </el-table-column>
|
|
293
|
+ <el-table-column label="备注" min-width="20" align="center">
|
|
294
|
+ <template slot-scope="scope">
|
|
295
|
+ <el-popover placement="top-start" width="250" trigger="hover">
|
|
296
|
+ <div>{{ scope.row.remark }}</div>
|
|
297
|
+ <span slot="reference" v-if="scope.row.remark.length > 20">{{
|
|
298
|
+ scope.row.remark.substr(0, 20) + "..."
|
|
299
|
+ }}</span>
|
|
300
|
+ <span slot="reference" v-else>{{ scope.row.remark }}</span>
|
|
301
|
+ </el-popover>
|
|
302
|
+ </template>
|
|
303
|
+ </el-table-column>
|
|
304
|
+ </el-table>
|
|
305
|
+ </el-row>
|
|
306
|
+ </div>
|
|
307
|
+
|
|
308
|
+ </span>
|
|
309
|
+ <span slot="footer" class="dialog-footer">
|
|
310
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
311
|
+ <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
|
312
|
+ </span>
|
|
313
|
+ </el-dialog>
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+ <el-dialog
|
|
317
|
+ title="新增"
|
|
318
|
+ :visible.sync="editDialogVisible"
|
|
319
|
+ width="80%"
|
|
320
|
+ >
|
|
321
|
+ <span>
|
|
322
|
+
|
|
323
|
+ <div style="margin-bottom:10px">
|
|
324
|
+ <label class="title"><span class="name">入库时间</span> : </label>
|
|
325
|
+ <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
|
|
326
|
+ style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
|
|
327
|
+ value-format="yyyy-MM-dd"></el-date-picker>
|
|
328
|
+ </div>
|
|
329
|
+
|
|
330
|
+ <div style="margin-bottom:10px">
|
|
331
|
+ <label class="title"><span class="name">经 销 商</span> : </label>
|
|
332
|
+ <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
|
|
333
|
+ <el-option
|
|
334
|
+ v-for="(option, index) in dealer"
|
|
335
|
+ :key="index"
|
|
336
|
+ :label="option.dealer_name"
|
|
337
|
+ :value="option.id">
|
|
338
|
+ </el-option>
|
|
339
|
+ </el-select>
|
|
340
|
+ </div>
|
|
341
|
+
|
|
342
|
+ <div style="margin-bottom:10px">
|
|
343
|
+ <label class="title"><span class="name">厂商</span> : </label>
|
|
344
|
+
|
|
345
|
+ <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商"
|
|
346
|
+ @change="changeManufacturer">
|
|
347
|
+ <el-option
|
|
348
|
+ v-for="(option, index) in manufacturer"
|
|
349
|
+ :key="index"
|
|
350
|
+ :label="option.manufacturer_name"
|
|
351
|
+ :value="option.id">
|
|
352
|
+ </el-option>
|
|
353
|
+ </el-select>
|
|
354
|
+ </div>
|
|
355
|
+
|
|
356
|
+ <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
|
|
357
|
+ <el-table
|
|
358
|
+ id="oictable"
|
|
359
|
+ :data="recordInfo.recordData"
|
|
360
|
+ :class="signAndWeighBoxPatients"
|
|
361
|
+ style="width: 100%"
|
|
362
|
+ border
|
|
363
|
+ max-height="450"
|
|
364
|
+ :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
|
|
365
|
+ >
|
|
366
|
+ <el-table-column align="center" width="200">
|
|
367
|
+ <template slot="header" slot-scope="scope">
|
|
368
|
+ <span>商品类型<span style="color: red">*</span></span>
|
|
369
|
+ </template>
|
|
370
|
+
|
|
371
|
+ <template slot-scope="scope">
|
|
372
|
+ <el-form-item style="padding-top: 15px">
|
|
373
|
+ <el-input
|
|
374
|
+ placeholder="请输入商品类型"
|
|
375
|
+ v-model="scope.row.good_type_id"
|
|
376
|
+ :value="typeName(scope.row.good_type_id)"
|
|
377
|
+ @focus="showDialog(scope.$index, scope.row)"
|
|
378
|
+ ></el-input>
|
|
379
|
+ </el-form-item>
|
|
380
|
+ </template>
|
|
381
|
+ </el-table-column>
|
|
382
|
+ <el-table-column align="center" width="200">
|
|
383
|
+ <template slot="header" slot-scope="scope">
|
|
384
|
+ <span>规格名称<span style="color: red">*</span></span>
|
|
385
|
+ </template>
|
|
386
|
+ <template slot-scope="scope">
|
|
387
|
+ <el-form-item style="padding-top: 15px">
|
|
388
|
+ <el-input
|
|
389
|
+ placeholder="请输入规格名称"
|
|
390
|
+ v-model="scope.row.good_id"
|
|
391
|
+ :value="specificationName(scope.row.good_id)"
|
|
392
|
+ @focus="showDialog(scope.$index, scope.row)"
|
|
393
|
+ ></el-input>
|
|
394
|
+ </el-form-item>
|
|
395
|
+ </template>
|
|
396
|
+ </el-table-column>
|
|
397
|
+
|
|
398
|
+ <el-table-column align="center" width="150">
|
|
399
|
+ <template slot="header" slot-scope="scope">
|
|
400
|
+ <span>单价<span style="color: red">*</span></span>
|
|
401
|
+ </template>
|
|
402
|
+ <template slot-scope="scope">
|
|
403
|
+ <!--<el-input type="number" v-model="scope.row.price" @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
|
|
404
|
+ <el-form-item
|
|
405
|
+ :prop="'recordData.' + scope.$index + '.price'"
|
|
406
|
+ :rules="tableRules.price"
|
|
407
|
+ style="padding-top: 17px"
|
|
408
|
+ >
|
|
409
|
+ <el-input
|
|
410
|
+ placeholder="请输入单价"
|
|
411
|
+ type="number"
|
|
412
|
+ v-model="scope.row.price"
|
|
413
|
+ ></el-input>
|
|
414
|
+ </el-form-item>
|
|
415
|
+ </template>
|
|
416
|
+ </el-table-column>
|
|
417
|
+
|
|
418
|
+ <el-table-column align="center" width="180">
|
|
419
|
+ <template slot="header" slot-scope="scope">
|
|
420
|
+ <span>入库数量<span style="color: red">*</span></span>
|
|
421
|
+ </template>
|
|
422
|
+ <template slot-scope="scope">
|
|
423
|
+ <!--{{scope.row.warehousing_count}}-->
|
|
424
|
+ <!--<el-input type="number" v-model="scope.row.warehousing_count" @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
|
|
425
|
+
|
|
426
|
+ <el-form-item
|
|
427
|
+ :prop="'recordData.' + scope.$index + '.warehousing_count'"
|
|
428
|
+ :rules="tableRules.warehousing_count"
|
|
429
|
+ style="padding-top: 17px"
|
|
430
|
+ >
|
|
431
|
+ <el-input
|
|
432
|
+ placeholder="请输入入库数量"
|
|
433
|
+ type="number"
|
|
434
|
+ v-model="scope.row.warehousing_count"
|
|
435
|
+ ></el-input>
|
|
436
|
+ </el-form-item>
|
|
437
|
+ </template>
|
|
438
|
+ </el-table-column>
|
|
439
|
+ <el-table-column label="总价" align="center" width="150">
|
|
440
|
+ <template slot-scope="scope">
|
|
441
|
+ {{ calculate(scope.row.price * scope.row.warehousing_count) }}
|
|
442
|
+ </template>
|
|
443
|
+ </el-table-column>
|
|
444
|
+
|
|
445
|
+ <el-table-column align="center" width="150">
|
|
446
|
+ <template slot="header" slot-scope="scope">
|
|
447
|
+ <span>批号</span>
|
|
448
|
+ </template>
|
|
449
|
+ <template slot-scope="scope">
|
|
450
|
+ <el-form-item>
|
|
451
|
+ <el-input
|
|
452
|
+ placeholder="请输入批号"
|
|
453
|
+ v-model="scope.row.number"
|
|
454
|
+ ></el-input>
|
|
455
|
+ </el-form-item>
|
|
456
|
+ </template>
|
|
457
|
+ </el-table-column>
|
|
458
|
+
|
|
459
|
+ <el-table-column label="生产日期" width="250" align="center">
|
|
460
|
+ <template slot-scope="scope">
|
|
461
|
+
|
|
462
|
+ <el-date-picker
|
|
463
|
+ prefix-icon="el-icon-date"
|
|
464
|
+ style="width: 145px"
|
|
465
|
+ v-model="scope.row.product_date"
|
|
466
|
+ type="date"
|
|
467
|
+ placeholder="选择日期时间"
|
|
468
|
+ format="yyyy-MM-dd"
|
|
469
|
+ value-format="yyyy-MM-dd"
|
|
470
|
+ ></el-date-picker>
|
|
471
|
+ </template>
|
|
472
|
+ </el-table-column>
|
|
473
|
+ <el-table-column label="有效日期" width="250" align="center">
|
|
474
|
+ <template slot-scope="scope">
|
|
475
|
+
|
|
476
|
+ <el-date-picker
|
|
477
|
+ prefix-icon="el-icon-date"
|
|
478
|
+ style="width: 145px"
|
|
479
|
+ v-model="scope.row.expiry_date"
|
|
480
|
+ type="date"
|
|
481
|
+ placeholder="选择日期时间"
|
|
482
|
+ format="yyyy-MM-dd"
|
|
483
|
+ value-format="yyyy-MM-dd"
|
|
484
|
+ ></el-date-picker>
|
|
485
|
+ </template>
|
|
486
|
+ </el-table-column>
|
|
487
|
+ <el-table-column label="备注" width="150" align="center">
|
|
488
|
+ <template slot-scope="scope">
|
|
489
|
+ <el-input v-model="scope.row.remark"></el-input>
|
|
490
|
+ </template>
|
|
491
|
+ </el-table-column>
|
|
492
|
+
|
|
493
|
+ <el-table-column
|
|
494
|
+ label="操作"
|
|
495
|
+ fixed="right"
|
|
496
|
+ align="center"
|
|
497
|
+ width="150"
|
|
498
|
+ >
|
|
499
|
+ <template slot-scope="scope">
|
|
500
|
+ <el-tooltip
|
|
501
|
+ class="item"
|
|
502
|
+ effect="dark"
|
|
503
|
+ content="新增"
|
|
504
|
+ placement="top"
|
|
505
|
+ >
|
|
506
|
+ <el-button
|
|
507
|
+ size="mini"
|
|
508
|
+ type="primary"
|
|
509
|
+ icon="el-icon-circle-plus-outline"
|
|
510
|
+ @click="handleEditTwo(scope.$index, scope.row)"
|
|
511
|
+ >
|
|
512
|
+ </el-button>
|
|
513
|
+ </el-tooltip>
|
|
514
|
+ <el-tooltip
|
|
515
|
+ class="item"
|
|
516
|
+ effect="dark"
|
|
517
|
+ content="删除"
|
|
518
|
+ placement="top"
|
|
519
|
+ >
|
|
520
|
+ <el-button
|
|
521
|
+ size="mini"
|
|
522
|
+ type="danger"
|
|
523
|
+ icon="el-icon-delete"
|
|
524
|
+ @click="DeleteWarehouseInfoItem(scope.$index, scope.row)"
|
|
525
|
+ >
|
|
526
|
+ </el-button>
|
|
527
|
+ </el-tooltip>
|
|
528
|
+ </template>
|
|
529
|
+ </el-table-column>
|
|
530
|
+ </el-table>
|
|
531
|
+ </el-form>
|
|
532
|
+ </span>
|
|
533
|
+ <span slot="footer" class="dialog-footer">
|
|
534
|
+ <el-button @click="editDialogVisible = false">取 消</el-button>
|
|
535
|
+ <el-button type="primary" @click="submit()">保 存</el-button>
|
|
536
|
+ </span>
|
|
537
|
+ </el-dialog>
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+ <stock-in-dialog
|
|
541
|
+ ref="dialog"
|
|
542
|
+ :propForm="propForm"
|
|
543
|
+ :visibility="isVisibility"
|
|
544
|
+ v-on:dialog-comfirm="comfirm"
|
|
545
|
+ v-on:dialog-cancle="cancle">
|
|
546
|
+ </stock-in-dialog>
|
173
|
547
|
</div>
|
174
|
548
|
</template>
|
175
|
549
|
|
176
|
550
|
<script>
|
|
551
|
+import stockInDialog from "./Dialog/stockInDialog";
|
177
|
552
|
import { uParseTime } from "@/utils/tools";
|
178
|
553
|
import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
|
179
|
554
|
import {
|
|
@@ -182,43 +557,19 @@ import {
|
182
|
557
|
GetAllGoodInfo,
|
183
|
558
|
GetAllGoodType,
|
184
|
559
|
getWarehouseInfoList,
|
185
|
|
- getWarehouseList
|
|
560
|
+ getWarehouseList,
|
|
561
|
+ DeleteWarehouseInfoItem,
|
|
562
|
+ GetAllGoodInfoByID,
|
|
563
|
+ EditWarehouse
|
186
|
564
|
} from "@/api/stock";
|
|
565
|
+
|
|
566
|
+import { GetAllDrugInfoByID,postDrugWarehouse} from "@/api/drug/drug_stock";
|
187
|
567
|
import BreadCrumb from "../components/bread-crumb";
|
188
|
568
|
|
189
|
569
|
export default {
|
190
|
570
|
name: "stockIn",
|
191
|
|
- components: { BreadCrumb },
|
|
571
|
+ components: { BreadCrumb, stockInDialog },
|
192
|
572
|
created() {
|
193
|
|
- // var nowDate = new Date();
|
194
|
|
- //
|
195
|
|
- // var year = new Date().getFullYear()
|
196
|
|
- // var month = new Date().getMonth() + 1
|
197
|
|
- // var day = nowDate.getDate()
|
198
|
|
- // if (parseInt(month) < 10) {
|
199
|
|
- // month = '0' + month
|
200
|
|
- // }
|
201
|
|
- // if (parseInt(day) < 10) {
|
202
|
|
- // day = '0' + day
|
203
|
|
- // }
|
204
|
|
- // const endTime = year + '-' + month + '-' + day
|
205
|
|
- // this.end_time = endTime
|
206
|
|
- //
|
207
|
|
- //
|
208
|
|
- // var year = new Date().getFullYear()
|
209
|
|
- // var month = new Date().getMonth()
|
210
|
|
- // var day = new Date().getDate()
|
211
|
|
- //
|
212
|
|
- // day.setMonth(day.getMonth() - 3);
|
213
|
|
- //
|
214
|
|
- // if (parseInt(month) < 10) {
|
215
|
|
- // month = '0' + month
|
216
|
|
- // }
|
217
|
|
- // if (parseInt(day) < 10) {
|
218
|
|
- // day = '0' + day
|
219
|
|
- // }
|
220
|
|
- // const startTime = year + '-' + month + '-' + day
|
221
|
|
- // this.start_time = startTime
|
222
|
573
|
|
223
|
574
|
var nowDate = new Date();
|
224
|
575
|
var nowYear = nowDate.getFullYear();
|
|
@@ -231,21 +582,38 @@ export default {
|
231
|
582
|
"-" +
|
232
|
583
|
(nowDay < 10 ? "0" + nowDay : nowDay);
|
233
|
584
|
nowDate.setMonth(nowDate.getMonth() - 1);
|
234
|
|
- nowYear = nowDate.getFullYear();
|
235
|
|
- nowMonth = nowDate.getMonth() + 1;
|
236
|
|
- nowDay = nowDate.getDate();
|
|
585
|
+
|
237
|
586
|
this.start_time =
|
238
|
587
|
nowYear +
|
239
|
588
|
"-" +
|
240
|
589
|
(nowMonth < 10 ? "0" + nowMonth : nowMonth) +
|
241
|
590
|
"-" +
|
242
|
591
|
(nowDay < 10 ? "0" + nowDay : nowDay);
|
|
592
|
+
|
243
|
593
|
|
|
594
|
+ this.warehousing_time =
|
|
595
|
+ nowYear +
|
|
596
|
+ '-' +
|
|
597
|
+ (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
|
|
598
|
+ '-' +
|
|
599
|
+ (nowDay < 10 ? '0' + nowDay : nowDay)
|
|
600
|
+
|
|
601
|
+
|
244
|
602
|
this.GetWarehouse();
|
245
|
603
|
this.GetConfigInfo();
|
246
|
604
|
this.fetchAllAdminUsers();
|
|
605
|
+ this.GetAllGoodType()
|
|
606
|
+ this.GetAllGoodInfo()
|
247
|
607
|
},
|
248
|
608
|
data() {
|
|
609
|
+
|
|
610
|
+ var checkGoodId = (rule, value, callback) => {
|
|
611
|
+ setTimeout(() => {
|
|
612
|
+ if (value == "" || value == 0) {
|
|
613
|
+ return callback(new Error("规格名称不能为空"));
|
|
614
|
+ }
|
|
615
|
+ }, 2000);
|
|
616
|
+ };
|
249
|
617
|
return {
|
250
|
618
|
crumbs: [
|
251
|
619
|
{ path: false, name: "库存管理" },
|
|
@@ -277,10 +645,62 @@ export default {
|
277
|
645
|
|
278
|
646
|
WarehouseInfo: {
|
279
|
647
|
loading: false,
|
280
|
|
- warehouseInfoDate: []
|
|
648
|
+ warehouseInfoDate: [],
|
|
649
|
+ warehouse: {}
|
|
650
|
+ },
|
|
651
|
+ startTime: "",
|
|
652
|
+ dialogVisible:false,
|
|
653
|
+ editDialogVisible:false,
|
|
654
|
+
|
|
655
|
+ recordInfo: {
|
|
656
|
+ recordData: [],
|
|
657
|
+ stock_in_code: "",
|
|
658
|
+ current_index: ""
|
|
659
|
+ },
|
|
660
|
+
|
|
661
|
+ tableRules: {
|
|
662
|
+ price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
|
|
663
|
+ warehousing_count: [
|
|
664
|
+ { required: true, message: "数量不能为空", trigge: "blur" }
|
|
665
|
+ ],
|
|
666
|
+
|
|
667
|
+ good_id: [{ validator: checkGoodId, trigger: "blur" }]
|
|
668
|
+ },
|
|
669
|
+
|
|
670
|
+ form: {
|
|
671
|
+ manufacturer: '',
|
|
672
|
+ dealer: ''
|
|
673
|
+ },
|
|
674
|
+ dealer: [],
|
|
675
|
+ goodType: [],
|
|
676
|
+ goodInfo:[],
|
|
677
|
+ warehousing_time: '',
|
|
678
|
+
|
|
679
|
+ propForm: {
|
|
680
|
+ goods: [],
|
|
681
|
+ goodType: [],
|
|
682
|
+ goodInfo: [],
|
|
683
|
+ goodUnit: [],
|
|
684
|
+ title: '入库',
|
|
685
|
+ formValue: {
|
|
686
|
+ good_type_id: '',
|
|
687
|
+ good_id: '',
|
|
688
|
+ number: '',
|
|
689
|
+ product_date: '',
|
|
690
|
+ expiry_date: '',
|
|
691
|
+ warehousing_count: '',
|
|
692
|
+ price: '',
|
|
693
|
+ remark: '',
|
|
694
|
+ dealer: '',
|
|
695
|
+ manufacturer: ''
|
|
696
|
+ },
|
|
697
|
+ isCreated: 1,
|
|
698
|
+ isVisibility: false,
|
|
699
|
+ drug_id:1
|
281
|
700
|
},
|
282
|
|
- startTime: ""
|
283
|
701
|
};
|
|
702
|
+
|
|
703
|
+
|
284
|
704
|
},
|
285
|
705
|
methods: {
|
286
|
706
|
search: function() {
|
|
@@ -349,9 +769,7 @@ export default {
|
349
|
769
|
} else {
|
350
|
770
|
this.WarehouseInfo.loading = false;
|
351
|
771
|
for (let i = 0; i < response.data.data.info.length; i++) {
|
352
|
|
- this.WarehouseInfo.warehouseInfoDate.push(
|
353
|
|
- response.data.data.info[i]
|
354
|
|
- );
|
|
772
|
+ this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
|
355
|
773
|
}
|
356
|
774
|
}
|
357
|
775
|
});
|
|
@@ -425,6 +843,7 @@ export default {
|
425
|
843
|
this.$message.error(response.data.msg);
|
426
|
844
|
return false;
|
427
|
845
|
} else {
|
|
846
|
+
|
428
|
847
|
for (let i = 0; i < response.data.data.goodType.length; i++) {
|
429
|
848
|
this.goodType.push(response.data.data.goodType[i]);
|
430
|
849
|
}
|
|
@@ -437,7 +856,9 @@ export default {
|
437
|
856
|
this.$message.error(response.data.msg);
|
438
|
857
|
return false;
|
439
|
858
|
} else {
|
|
859
|
+
|
440
|
860
|
for (let i = 0; i < response.data.data.goodInfo.length; i++) {
|
|
861
|
+
|
441
|
862
|
this.goodInfo.push(response.data.data.goodInfo[i]);
|
442
|
863
|
}
|
443
|
864
|
}
|
|
@@ -502,6 +923,13 @@ export default {
|
502
|
923
|
// 把时间日期转成时间戳
|
503
|
924
|
return new Date(time).getTime() / 1000;
|
504
|
925
|
},
|
|
926
|
+ getTime(val, temp) {
|
|
927
|
+ if (val != 0) {
|
|
928
|
+ return uParseTime(val, temp);
|
|
929
|
+ } else {
|
|
930
|
+ return "";
|
|
931
|
+ }
|
|
932
|
+ },
|
505
|
933
|
calculate: function(val) {
|
506
|
934
|
return Math.round(parseFloat(val) * 100) / 100;
|
507
|
935
|
},
|
|
@@ -513,6 +941,9 @@ export default {
|
513
|
941
|
} else {
|
514
|
942
|
this.manufacturer = response.data.data.manufacturer;
|
515
|
943
|
this.dealer = response.data.data.dealer;
|
|
944
|
+ this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
|
|
945
|
+ this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
|
|
946
|
+
|
516
|
947
|
}
|
517
|
948
|
});
|
518
|
949
|
},
|
|
@@ -544,7 +975,7 @@ export default {
|
544
|
975
|
const params = {
|
545
|
976
|
ids: idStr
|
546
|
977
|
};
|
547
|
|
-
|
|
978
|
+
|
548
|
979
|
this.$confirm("确认删除入库单记录?", "删除入库单记录", {
|
549
|
980
|
confirmButtonText: "确定",
|
550
|
981
|
cancelButtonText: "取消",
|
|
@@ -626,7 +1057,302 @@ export default {
|
626
|
1057
|
});
|
627
|
1058
|
})
|
628
|
1059
|
.catch(() => {});
|
629
|
|
- }
|
|
1060
|
+ },
|
|
1061
|
+
|
|
1062
|
+ handleSearch(id){
|
|
1063
|
+ this.GetOrderDetail(id)
|
|
1064
|
+ this.drug_id = id
|
|
1065
|
+ this.dialogVisible = true
|
|
1066
|
+ },
|
|
1067
|
+
|
|
1068
|
+ GetOrderDetail: function(id) {
|
|
1069
|
+ const params = {
|
|
1070
|
+ id: id
|
|
1071
|
+ };
|
|
1072
|
+ getWarehouseInfoList(params).then(response => {
|
|
1073
|
+ if (response.data.state == 0) {
|
|
1074
|
+ this.$message.error(response.data.msg);
|
|
1075
|
+ return false;
|
|
1076
|
+ } else {
|
|
1077
|
+
|
|
1078
|
+ for (let i = 0; i < response.data.data.info.length; i++) {
|
|
1079
|
+ this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
|
|
1080
|
+ response.data.data.info[i].product_date = this.getTime(
|
|
1081
|
+ response.data.data.info[i].product_date,
|
|
1082
|
+ "{y}-{m}-{d}"
|
|
1083
|
+ );
|
|
1084
|
+ response.data.data.info[i].expiry_date = this.getTime(
|
|
1085
|
+ response.data.data.info[i].expiry_date,
|
|
1086
|
+ "{y}-{m}-{d}"
|
|
1087
|
+ );
|
|
1088
|
+ response.data.data.info[i].price = response.data.data.info[i].price.toString();
|
|
1089
|
+ response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
|
|
1090
|
+
|
|
1091
|
+ this.recordInfo.recordData.push(response.data.data.info[i]);
|
|
1092
|
+ }
|
|
1093
|
+ this.WarehouseInfo.warehouse = response.data.data.warehousing;
|
|
1094
|
+
|
|
1095
|
+ }
|
|
1096
|
+ });
|
|
1097
|
+ },
|
|
1098
|
+
|
|
1099
|
+ editRecord: function() {
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+ this.editDialogVisible = true
|
|
1103
|
+ },
|
|
1104
|
+
|
|
1105
|
+ deleteRecord: function() {
|
|
1106
|
+ const ids = [];
|
|
1107
|
+ ids.push(this.WarehouseInfo.warehouse.id);
|
|
1108
|
+ const idStr = ids.join(",");
|
|
1109
|
+
|
|
1110
|
+ const params = {
|
|
1111
|
+ ids: idStr
|
|
1112
|
+ };
|
|
1113
|
+
|
|
1114
|
+ this.$confirm("确认删除入库单记录?", "删除入库单记录", {
|
|
1115
|
+ confirmButtonText: "确定",
|
|
1116
|
+ cancelButtonText: "取消",
|
|
1117
|
+ type: "warning"
|
|
1118
|
+ })
|
|
1119
|
+ .then(() => {
|
|
1120
|
+ deleteWarehouseInfo(params).then(response => {
|
|
1121
|
+ if (response.data.state == 0) {
|
|
1122
|
+ this.$message.error(response.data.msg);
|
|
1123
|
+ return false;
|
|
1124
|
+ } else {
|
|
1125
|
+ this.$notify({
|
|
1126
|
+ title: "成功",
|
|
1127
|
+ message: "删除成功",
|
|
1128
|
+ type: "success",
|
|
1129
|
+ duration: 2000
|
|
1130
|
+ });
|
|
1131
|
+
|
|
1132
|
+ this.$router.back(-1);
|
|
1133
|
+ }
|
|
1134
|
+ });
|
|
1135
|
+ })
|
|
1136
|
+ .catch(() => {});
|
|
1137
|
+ },
|
|
1138
|
+
|
|
1139
|
+ typeName: function(good_type_id) {
|
|
1140
|
+
|
|
1141
|
+ let name = "";
|
|
1142
|
+ for (let i = 0; i < this.goodType.length; i++) {
|
|
1143
|
+ if (this.goodType[i].id == good_type_id) {
|
|
1144
|
+ name = this.goodType[i].type_name;
|
|
1145
|
+ }
|
|
1146
|
+ }
|
|
1147
|
+ return name;
|
|
1148
|
+ },
|
|
1149
|
+
|
|
1150
|
+ showDialog(index, row) {
|
|
1151
|
+ this.currentIndex = index;
|
|
1152
|
+ const params = {
|
|
1153
|
+ manufacturer_id: this.form.manufacturer,
|
|
1154
|
+ dealer_id: this.form.dealer
|
|
1155
|
+ };
|
|
1156
|
+ this.propForm.goods = []
|
|
1157
|
+
|
|
1158
|
+ GetAllGoodInfoByID(params).then(response => {
|
|
1159
|
+ if (response.data.state == 0) {
|
|
1160
|
+ this.$message.error(response.data.msg);
|
|
1161
|
+ return false;
|
|
1162
|
+ } else {
|
|
1163
|
+ if (response.data.data.goodInfo.length <= 0) {
|
|
1164
|
+ this.$message.error("该厂商或经销商没有物品信息");
|
|
1165
|
+ return;
|
|
1166
|
+ }
|
|
1167
|
+ this.$refs.dialog.show();
|
|
1168
|
+ for (let i = 0; i < response.data.data.goodInfo.length; i++) {
|
|
1169
|
+ this.propForm.goodType.push(
|
|
1170
|
+ response.data.data.goodInfo[i].type
|
|
1171
|
+ );
|
|
1172
|
+ }
|
|
1173
|
+ const obj = {};
|
|
1174
|
+ this.propForm.goodType = this.propForm.goodType.reduce(
|
|
1175
|
+ (cur, next) => {
|
|
1176
|
+ obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
|
|
1177
|
+ return cur;
|
|
1178
|
+ },
|
|
1179
|
+ []
|
|
1180
|
+ ); // 设置cur默认类型为数组,并且初始值为空的数组
|
|
1181
|
+ }
|
|
1182
|
+
|
|
1183
|
+ for (let i = 0; i < this.propForm.goodType.length; i++) {
|
|
1184
|
+ let goodInfo = [];
|
|
1185
|
+ let goodObj = {};
|
|
1186
|
+
|
|
1187
|
+ for (let a = 0; a < response.data.data.goodInfo.length; a++) {
|
|
1188
|
+ var respObj = response.data.data.goodInfo[a];
|
|
1189
|
+ respObj["isSelected"] = false;
|
|
1190
|
+ if (respObj.type.id == this.propForm.goodType[i].id) {
|
|
1191
|
+ goodInfo.push(respObj);
|
|
1192
|
+ }
|
|
1193
|
+ }
|
|
1194
|
+ const obj = {};
|
|
1195
|
+ goodInfo = goodInfo.reduce((cur, next) => {
|
|
1196
|
+ obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
|
|
1197
|
+ return cur;
|
|
1198
|
+ }, []); // 设置cur默认类型为数组,并且初始值为空的数组
|
|
1199
|
+
|
|
1200
|
+ this.$set(goodObj, this.propForm.goodType[i].id, goodInfo);
|
|
1201
|
+ this.propForm.goods.push(goodObj);
|
|
1202
|
+ }
|
|
1203
|
+ });
|
|
1204
|
+ },
|
|
1205
|
+
|
|
1206
|
+ specificationName: function(drug_id) {
|
|
1207
|
+
|
|
1208
|
+ let name = "";
|
|
1209
|
+ for (let i = 0; i < this.goodInfo.length; i++) {
|
|
1210
|
+ if (this.goodInfo[i].id == drug_id) {
|
|
1211
|
+ name = this.goodInfo[i].specification_name;
|
|
1212
|
+ }
|
|
1213
|
+ }
|
|
1214
|
+ return name;
|
|
1215
|
+ },
|
|
1216
|
+
|
|
1217
|
+ submit() {
|
|
1218
|
+
|
|
1219
|
+ this.$refs["tableForm"].validate(valid => {
|
|
1220
|
+ if (valid) {
|
|
1221
|
+ const array = this.recordInfo.recordData;
|
|
1222
|
+ console.log('array',array)
|
|
1223
|
+ for (let i = 0; i < array.length; i++) {
|
|
1224
|
+ if (array[i].good_type_id == 0) {
|
|
1225
|
+ this.$message.error("商品类型不能为空");
|
|
1226
|
+ return;
|
|
1227
|
+ }
|
|
1228
|
+ if (array[i].good_id == 0) {
|
|
1229
|
+ this.$message.error("规格名称不能为空");
|
|
1230
|
+ return;
|
|
1231
|
+ }
|
|
1232
|
+ }
|
|
1233
|
+
|
|
1234
|
+ const params = {
|
|
1235
|
+ stockIn: this.recordInfo.recordData
|
|
1236
|
+ };
|
|
1237
|
+ EditWarehouse(
|
|
1238
|
+ params,
|
|
1239
|
+ this.warehousing_time,
|
|
1240
|
+ this.drug_id,
|
|
1241
|
+ this.type,
|
|
1242
|
+ this.form.manufacturer,
|
|
1243
|
+ this.form.dealer
|
|
1244
|
+ ).then(response => {
|
|
1245
|
+ if (response.data.state == 0) {
|
|
1246
|
+ this.$message.error(response.data.msg);
|
|
1247
|
+ return false;
|
|
1248
|
+ } else {
|
|
1249
|
+ this.$message.success("入库成功");
|
|
1250
|
+ this.dialogVisible = false
|
|
1251
|
+ this.editDialogVisible = false
|
|
1252
|
+
|
|
1253
|
+ }
|
|
1254
|
+ });
|
|
1255
|
+ } else {
|
|
1256
|
+ return false;
|
|
1257
|
+ }
|
|
1258
|
+ });
|
|
1259
|
+ },
|
|
1260
|
+
|
|
1261
|
+ changeManufacturer(val) {
|
|
1262
|
+
|
|
1263
|
+ },
|
|
1264
|
+ changeDealer(val) {
|
|
1265
|
+
|
|
1266
|
+ },
|
|
1267
|
+
|
|
1268
|
+ DeleteWarehouseInfoItem: function(index, row) {
|
|
1269
|
+ if (row.id == 0) {
|
|
1270
|
+ this.recordInfo.recordData.splice(index, 1);
|
|
1271
|
+ } else {
|
|
1272
|
+ const params = {
|
|
1273
|
+ id: row.id
|
|
1274
|
+ };
|
|
1275
|
+ this.$confirm("确认删除该入库商品信息记录?", "删除入库商品信息记录", {
|
|
1276
|
+ confirmButtonText: "确定",
|
|
1277
|
+ cancelButtonText: "取消",
|
|
1278
|
+ type: "warning"
|
|
1279
|
+ })
|
|
1280
|
+ .then(() => {
|
|
1281
|
+ DeleteWarehouseInfoItem(params).then(response => {
|
|
1282
|
+ if (response.data.state == 0) {
|
|
1283
|
+ this.$message.error(response.data.msg);
|
|
1284
|
+ return false;
|
|
1285
|
+ } else {
|
|
1286
|
+ this.$message.success("删除成功");
|
|
1287
|
+
|
|
1288
|
+ this.recordInfo.recordData.splice(index, 1);
|
|
1289
|
+ }
|
|
1290
|
+ });
|
|
1291
|
+ })
|
|
1292
|
+ .catch(() => {});
|
|
1293
|
+ }
|
|
1294
|
+ },
|
|
1295
|
+ handleEditTwo: function(index, row) {
|
|
1296
|
+ const tempObj = {};
|
|
1297
|
+ tempObj["id"] = 0;
|
|
1298
|
+ tempObj["good_type_id"] = 0;
|
|
1299
|
+ tempObj["good_id"] = 0;
|
|
1300
|
+ tempObj["number"] = "";
|
|
1301
|
+ tempObj["product_date"] = "";
|
|
1302
|
+ tempObj["expiry_date"] = "";
|
|
1303
|
+ tempObj["warehousing_count"] = "";
|
|
1304
|
+ tempObj["price"] = "";
|
|
1305
|
+ tempObj["remark"] = "";
|
|
1306
|
+ tempObj["dealer"] = "";
|
|
1307
|
+ tempObj["manufacturer"] = "";
|
|
1308
|
+ this.recordInfo.recordData.push(tempObj);
|
|
1309
|
+ },
|
|
1310
|
+
|
|
1311
|
+ comfirm: function(val) {
|
|
1312
|
+ this.$refs.dialog.hide();
|
|
1313
|
+ this.propForm.goodType = [];
|
|
1314
|
+ this.propForm.goods = [];
|
|
1315
|
+
|
|
1316
|
+ if (val.selectedGoodInfo.length > 0) {
|
|
1317
|
+ for (let i = val.selectedGoodInfo.length - 1; ; i--) {
|
|
1318
|
+ if (i == 0) {
|
|
1319
|
+ this.recordInfo.recordData[this.currentIndex].good_type_id =
|
|
1320
|
+ val.selectedGoodInfo[i].good_type_id;
|
|
1321
|
+ this.recordInfo.recordData[this.currentIndex].good_id =
|
|
1322
|
+ val.selectedGoodInfo[i].id;
|
|
1323
|
+ this.recordInfo.recordData[
|
|
1324
|
+ this.currentIndex
|
|
1325
|
+ ].price = val.selectedGoodInfo[i].buy_price.toString();
|
|
1326
|
+ } else {
|
|
1327
|
+ const tempForm = {};
|
|
1328
|
+ tempForm["id"] = 0;
|
|
1329
|
+ tempForm["good_type_id"] = val.selectedGoodInfo[i].good_type_id;
|
|
1330
|
+ tempForm["good_id"] = val.selectedGoodInfo[i].id;
|
|
1331
|
+ tempForm["number"] = "";
|
|
1332
|
+ tempForm["product_date"] = "";
|
|
1333
|
+ tempForm["expiry_date"] = "";
|
|
1334
|
+ tempForm["warehousing_count"] = "";
|
|
1335
|
+ tempForm["price"] = val.selectedGoodInfo[i].buy_price.toString();
|
|
1336
|
+ tempForm["remark"] = "";
|
|
1337
|
+ tempForm["dealer"] = "";
|
|
1338
|
+ tempForm["manufacturer"] = "";
|
|
1339
|
+ this.recordInfo.recordData.splice(
|
|
1340
|
+ this.currentIndex + 1,
|
|
1341
|
+ 0,
|
|
1342
|
+ tempForm
|
|
1343
|
+ );
|
|
1344
|
+ }
|
|
1345
|
+ }
|
|
1346
|
+ }
|
|
1347
|
+
|
|
1348
|
+ this.currentIndex = -1;
|
|
1349
|
+ },
|
|
1350
|
+ cancle: function() {
|
|
1351
|
+ this.$refs.dialog.hide();
|
|
1352
|
+ this.propForm.goods = [];
|
|
1353
|
+
|
|
1354
|
+ this.propForm.goodType = [];
|
|
1355
|
+ },
|
630
|
1356
|
}
|
631
|
1357
|
};
|
632
|
1358
|
</script>
|