|
@@ -0,0 +1,896 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="main-contain">
|
|
3
|
+ <div class="position">
|
|
4
|
+ <bread-crumb :crumbs="crumbs"></bread-crumb>
|
|
5
|
+ </div>
|
|
6
|
+ <div class="app-container" v-loading="loading">
|
|
7
|
+ <div
|
|
8
|
+ style="
|
|
9
|
+ justify-content: space-between;
|
|
10
|
+ margin: 0px 0 12px 0;
|
|
11
|
+ display: flex;
|
|
12
|
+ align-items: center;
|
|
13
|
+ "
|
|
14
|
+ >
|
|
15
|
+ <div>
|
|
16
|
+ <span style="color: red">*</span><span>供应商:</span>
|
|
17
|
+ <el-select
|
|
18
|
+ v-model="supplier_name"
|
|
19
|
+ style="width: 140px; margin-right: 10px"
|
|
20
|
+ placeholder="请选择"
|
|
21
|
+ @change="changeTypeName"
|
|
22
|
+ >
|
|
23
|
+ <el-option
|
|
24
|
+ v-for="item in supplyList"
|
|
25
|
+ :key="item.id"
|
|
26
|
+ :label="item.supplier_name"
|
|
27
|
+ :value="item.id"
|
|
28
|
+ >
|
|
29
|
+ </el-option>
|
|
30
|
+ </el-select>
|
|
31
|
+ <span>单据日期:</span>
|
|
32
|
+ <el-date-picker
|
|
33
|
+ size="small"
|
|
34
|
+ v-model="start_time"
|
|
35
|
+ prefix-icon="el-icon-date"
|
|
36
|
+ :editable="false"
|
|
37
|
+ style="width: 196px"
|
|
38
|
+ type="date"
|
|
39
|
+ placeholder="选择日期时间"
|
|
40
|
+ align="right"
|
|
41
|
+ format="yyyy-MM-dd"
|
|
42
|
+ value-format="yyyy-MM-dd"
|
|
43
|
+ @change="startTimeChange"
|
|
44
|
+ ></el-date-picker>
|
|
45
|
+ <!-- <span>交货日期:</span>
|
|
46
|
+ <el-date-picker
|
|
47
|
+ size="small"
|
|
48
|
+ v-model="end_time"
|
|
49
|
+ prefix-icon="el-icon-date"
|
|
50
|
+ :editable="false"
|
|
51
|
+ style="width: 196px;"
|
|
52
|
+ type="date"
|
|
53
|
+ placeholder="选择日期时间"
|
|
54
|
+ align="right"
|
|
55
|
+ format="yyyy-MM-dd"
|
|
56
|
+ value-format="yyyy-MM-dd"
|
|
57
|
+ @change="endTimeChange"
|
|
58
|
+ ></el-date-picker> -->
|
|
59
|
+ <span>单据编码:{{ number }}</span>
|
|
60
|
+ </div>
|
|
61
|
+ <div>
|
|
62
|
+ <el-button size="small" type="primary" @click="toAdd">保存</el-button>
|
|
63
|
+ <el-button size="small" type="primary" @click="updatePurchaseOrder"
|
|
64
|
+ >审核</el-button
|
|
65
|
+ >
|
|
66
|
+ <!-- <el-button size="small" type="primary" @click="toPrint">打印</el-button>
|
|
67
|
+ <el-button size="small" type="primary" v-if="is_check == 2" @click="checkPurchaseOrder">审核</el-button>
|
|
68
|
+ <el-button size="small" type="primary" v-if="is_check == 1" @click="checkPurchaseOrder">反审核</el-button> -->
|
|
69
|
+ </div>
|
|
70
|
+ </div>
|
|
71
|
+
|
|
72
|
+ <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
|
|
73
|
+ <el-table
|
|
74
|
+ :row-style="{ color: '#303133' }"
|
|
75
|
+ :header-cell-style="{
|
|
76
|
+ backgroundColor: 'rgb(245, 247, 250)',
|
|
77
|
+ color: '#606266',
|
|
78
|
+ }"
|
|
79
|
+ :data="recordInfo.tableList"
|
|
80
|
+ :class="signAndWeighBoxPatients"
|
|
81
|
+ border
|
|
82
|
+ style="width: 100%"
|
|
83
|
+ max-height="450"
|
|
84
|
+ >
|
|
85
|
+ <el-table-column align="center" width="200px">
|
|
86
|
+ <template slot="header" slot-scope="scope">
|
|
87
|
+ <span>商品<span style="color: red">*</span></span>
|
|
88
|
+ </template>
|
|
89
|
+ <template slot-scope="scope">
|
|
90
|
+ <el-form-item
|
|
91
|
+ :prop="'tableList.' + scope.$index + '.name'"
|
|
92
|
+ :rules="tableRules.name"
|
|
93
|
+ >
|
|
94
|
+ <el-select
|
|
95
|
+ v-model="scope.row.name"
|
|
96
|
+ style="width: 160px"
|
|
97
|
+ filterable
|
|
98
|
+ placeholder="请选择"
|
|
99
|
+ @change="changeName"
|
|
100
|
+ @input="changeGoodName(scope.$index)"
|
|
101
|
+ :disabled="disabled"
|
|
102
|
+ >
|
|
103
|
+ <el-option
|
|
104
|
+ v-for="(item, index) in tabList"
|
|
105
|
+ :key="index"
|
|
106
|
+ :label="item.supply_name"
|
|
107
|
+ :value="item"
|
|
108
|
+ >
|
|
109
|
+ </el-option>
|
|
110
|
+ </el-select>
|
|
111
|
+ </el-form-item>
|
|
112
|
+ </template>
|
|
113
|
+ </el-table-column>
|
|
114
|
+ <el-table-column align="center" width="150px">
|
|
115
|
+ <template slot="header" slot-scope="scope">
|
|
116
|
+ <span>商品类别</span>
|
|
117
|
+ </template>
|
|
118
|
+ <template slot-scope="scope">
|
|
119
|
+ <el-input
|
|
120
|
+ v-model="scope.row.supply_type"
|
|
121
|
+ style="width: 120px"
|
|
122
|
+ :disabled="true"
|
|
123
|
+ ></el-input>
|
|
124
|
+ </template>
|
|
125
|
+ </el-table-column>
|
|
126
|
+ <el-table-column label="规格&单位" align="center" width="200px">
|
|
127
|
+ <template slot-scope="scope">
|
|
128
|
+ <el-input
|
|
129
|
+ v-model="scope.row.supply_specification_name"
|
|
130
|
+ style="width: 150px"
|
|
131
|
+ :disabled="true"
|
|
132
|
+ ></el-input>
|
|
133
|
+ </template>
|
|
134
|
+ </el-table-column>
|
|
135
|
+
|
|
136
|
+ <!-- <el-table-column label="单位" align="center" width="120px">
|
|
137
|
+ <template slot="header" slot-scope="scope">
|
|
138
|
+ <span>单位<span style="color: red">*</span></span>
|
|
139
|
+ </template>
|
|
140
|
+ <template slot-scope="scope">
|
|
141
|
+ <el-form-item :prop="'tableList.' + scope.$index + '.supply_unit'" :rules='tableRules.supply_unit'>
|
|
142
|
+ <el-select v-model="scope.row.supply_unit" style="width:100px;" filterable placeholder="请选择" :disabled="disabled">
|
|
143
|
+ <el-option
|
|
144
|
+ v-for="(item,index) in scope.row.unitList"
|
|
145
|
+ :key="index"
|
|
146
|
+ :label="item.name"
|
|
147
|
+ :value="item.name">
|
|
148
|
+ </el-option>
|
|
149
|
+ </el-select>
|
|
150
|
+ </el-form-item>
|
|
151
|
+ </template>
|
|
152
|
+ </el-table-column> -->
|
|
153
|
+ <el-table-column label="可用库存" align="center" width="130px">
|
|
154
|
+ <template slot-scope="scope">
|
|
155
|
+ <el-input
|
|
156
|
+ v-model="scope.row.supply_total"
|
|
157
|
+ style="width: 100px"
|
|
158
|
+ :disabled="true"
|
|
159
|
+ ></el-input>
|
|
160
|
+ </template>
|
|
161
|
+ </el-table-column>
|
|
162
|
+ <el-table-column label="可退数量" align="center" width="200px">
|
|
163
|
+ <template slot-scope="scope">
|
|
164
|
+ <el-input
|
|
165
|
+ v-model="scope.row.supply_specification_name"
|
|
166
|
+ style="width: 150px"
|
|
167
|
+ :disabled="true"
|
|
168
|
+ ></el-input>
|
|
169
|
+ </template>
|
|
170
|
+ </el-table-column>
|
|
171
|
+ <el-table-column label="数量" align="center" width="120px">
|
|
172
|
+ <template slot="header" slot-scope="scope">
|
|
173
|
+ <span>数量<span style="color: red">*</span></span>
|
|
174
|
+ </template>
|
|
175
|
+ <template slot-scope="scope">
|
|
176
|
+ <el-form-item
|
|
177
|
+ :prop="'tableList.' + scope.$index + '.supply_count'"
|
|
178
|
+ :rules="tableRules.supply_count"
|
|
179
|
+ >
|
|
180
|
+ <el-input
|
|
181
|
+ v-model="scope.row.supply_count"
|
|
182
|
+ style="width: 80px"
|
|
183
|
+ :disabled="disabled"
|
|
184
|
+ ></el-input>
|
|
185
|
+ </el-form-item>
|
|
186
|
+ </template>
|
|
187
|
+ </el-table-column>
|
|
188
|
+
|
|
189
|
+ <el-table-column label="购货单价" align="center" width="120px">
|
|
190
|
+ <template slot-scope="scope">
|
|
191
|
+ <el-input
|
|
192
|
+ v-model="scope.row.supply_price"
|
|
193
|
+ style="width: 80px"
|
|
194
|
+ :disabled="disabled"
|
|
195
|
+ ></el-input>
|
|
196
|
+ </template>
|
|
197
|
+ </el-table-column>
|
|
198
|
+
|
|
199
|
+ <el-table-column label="购货金额" align="center" width="120px">
|
|
200
|
+ <template slot-scope="scope">
|
|
201
|
+ {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
|
|
202
|
+ </template>
|
|
203
|
+ </el-table-column>
|
|
204
|
+ <el-table-column label="折扣率" align="center" width="120px">
|
|
205
|
+ <template slot-scope="scope">
|
|
206
|
+ {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
|
|
207
|
+ </template>
|
|
208
|
+ </el-table-column>
|
|
209
|
+
|
|
210
|
+ <el-table-column label="折扣金额" align="center" width="120px">
|
|
211
|
+ <template slot-scope="scope">
|
|
212
|
+ {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
|
|
213
|
+ </template>
|
|
214
|
+ </el-table-column>
|
|
215
|
+
|
|
216
|
+ <el-table-column label="生产厂家" align="center" width="200px">
|
|
217
|
+ <template slot-scope="scope">
|
|
218
|
+ <el-input
|
|
219
|
+ v-model="scope.row.supply_manufacturer"
|
|
220
|
+ style="width: 160px"
|
|
221
|
+ :disabled="true"
|
|
222
|
+ ></el-input>
|
|
223
|
+ </template>
|
|
224
|
+ </el-table-column>
|
|
225
|
+
|
|
226
|
+ <el-table-column label="关联采购订单号" align="center" width="200px">
|
|
227
|
+ <template slot-scope="scope">
|
|
228
|
+ <el-input
|
|
229
|
+ v-model="scope.row.supply_license_number"
|
|
230
|
+ style="width: 160px"
|
|
231
|
+ :disabled="disabled"
|
|
232
|
+ ></el-input>
|
|
233
|
+ </template>
|
|
234
|
+ </el-table-column>
|
|
235
|
+
|
|
236
|
+ <el-table-column label="源购货订单号" align="center" width="200px">
|
|
237
|
+ <template slot-scope="scope">
|
|
238
|
+ <el-input
|
|
239
|
+ v-model="scope.row.supply_license_number"
|
|
240
|
+ style="width: 160px"
|
|
241
|
+ :disabled="disabled"
|
|
242
|
+ ></el-input>
|
|
243
|
+ </template>
|
|
244
|
+ </el-table-column>
|
|
245
|
+
|
|
246
|
+ <el-table-column label="备注" align="center" width="200px">
|
|
247
|
+ <template slot-scope="scope">
|
|
248
|
+ <el-input
|
|
249
|
+ v-model="scope.row.supply_remake"
|
|
250
|
+ style="width: 160px"
|
|
251
|
+ :disabled="disabled"
|
|
252
|
+ ></el-input>
|
|
253
|
+ </template>
|
|
254
|
+ </el-table-column>
|
|
255
|
+
|
|
256
|
+ <el-table-column
|
|
257
|
+ label="操作"
|
|
258
|
+ align="center"
|
|
259
|
+ width="150px"
|
|
260
|
+ fixed="right"
|
|
261
|
+ >
|
|
262
|
+ <template slot-scope="scope">
|
|
263
|
+ <el-tooltip
|
|
264
|
+ class="item"
|
|
265
|
+ effect="dark"
|
|
266
|
+ content="新增"
|
|
267
|
+ placement="top"
|
|
268
|
+ >
|
|
269
|
+ <el-button
|
|
270
|
+ size="mini"
|
|
271
|
+ type="primary"
|
|
272
|
+ icon="el-icon-circle-plus-outline"
|
|
273
|
+ @click="handleEdit(scope.$index, scope.row)"
|
|
274
|
+ >
|
|
275
|
+ </el-button>
|
|
276
|
+ </el-tooltip>
|
|
277
|
+ <el-tooltip
|
|
278
|
+ class="item"
|
|
279
|
+ effect="dark"
|
|
280
|
+ content="删除"
|
|
281
|
+ placement="top"
|
|
282
|
+ >
|
|
283
|
+ <el-button
|
|
284
|
+ size="mini"
|
|
285
|
+ type="danger"
|
|
286
|
+ icon="el-icon-delete"
|
|
287
|
+ @click="handleDelete(scope.$index, scope.row)"
|
|
288
|
+ >
|
|
289
|
+ </el-button>
|
|
290
|
+ </el-tooltip>
|
|
291
|
+ </template>
|
|
292
|
+ </el-table-column>
|
|
293
|
+ </el-table>
|
|
294
|
+ </el-form>
|
|
295
|
+ <div style="margin-top: 10px">
|
|
296
|
+ <!-- 合计:{{getAllPrice()}} 元 -->
|
|
297
|
+ <el-input
|
|
298
|
+ type="textarea"
|
|
299
|
+ :rows="2"
|
|
300
|
+ placeholder="无备注信息"
|
|
301
|
+ v-model="tipsInfo"
|
|
302
|
+ >
|
|
303
|
+ </el-input>
|
|
304
|
+ </div>
|
|
305
|
+ <div style="margin-top: 10px">
|
|
306
|
+ <span
|
|
307
|
+ >优惠率:<el-input
|
|
308
|
+ style="width: 100px"
|
|
309
|
+ v-model="rate_of_concession"
|
|
310
|
+ ></el-input
|
|
311
|
+ >%</span
|
|
312
|
+ >
|
|
313
|
+
|
|
314
|
+ <span
|
|
315
|
+ >优惠金额:<el-input
|
|
316
|
+ style="width: 100px"
|
|
317
|
+ v-model="discount_amount"
|
|
318
|
+ ></el-input
|
|
319
|
+ ></span>
|
|
320
|
+
|
|
321
|
+ <span
|
|
322
|
+ >本次付款:<el-input
|
|
323
|
+ style="width: 100px"
|
|
324
|
+ v-model="discount_amount"
|
|
325
|
+ ></el-input
|
|
326
|
+ ></span>
|
|
327
|
+
|
|
328
|
+ <span
|
|
329
|
+ >本次欠款:<el-input
|
|
330
|
+ style="width: 100px"
|
|
331
|
+ v-model="discount_amount"
|
|
332
|
+ ></el-input
|
|
333
|
+ ></span>
|
|
334
|
+ </div>
|
|
335
|
+ </div>
|
|
336
|
+
|
|
337
|
+ <!-- <el-dialog
|
|
338
|
+ title="提示"
|
|
339
|
+ :visible.sync="dialogVisible"
|
|
340
|
+ width="30%"
|
|
341
|
+ :before-close="handleClose">
|
|
342
|
+ <span>这是一段信息</span>
|
|
343
|
+ <span slot="footer" class="dialog-footer">
|
|
344
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
345
|
+ <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
|
346
|
+ </span>
|
|
347
|
+ </el-dialog> -->
|
|
348
|
+ </div>
|
|
349
|
+</template>
|
|
350
|
+
|
|
351
|
+<script>
|
|
352
|
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
|
353
|
+import { uParseTime } from "@/utils/tools";
|
|
354
|
+import {
|
|
355
|
+ getInitOrder,
|
|
356
|
+ updatePurchaseOrder,
|
|
357
|
+ checkPurchaseOrder,
|
|
358
|
+ getPurchaseOrderDetail,
|
|
359
|
+} from "@/api/supply";
|
|
360
|
+export default {
|
|
361
|
+ name: "addPurchaseOrder",
|
|
362
|
+ components: {
|
|
363
|
+ BreadCrumb,
|
|
364
|
+ },
|
|
365
|
+ data() {
|
|
366
|
+ return {
|
|
367
|
+ tipsInfo:"",
|
|
368
|
+ crumbs: [
|
|
369
|
+ { path: false, name: "购货单" },
|
|
370
|
+ { path: "/good/return/add", name: "新增退货单" },
|
|
371
|
+ ],
|
|
372
|
+ showTwo: true,
|
|
373
|
+ showOne: false,
|
|
374
|
+ recordInfo: {
|
|
375
|
+ tableList: [1],
|
|
376
|
+ },
|
|
377
|
+ keywords: "",
|
|
378
|
+ total: 0,
|
|
379
|
+ multipleSelection: [],
|
|
380
|
+ signAndWeighBoxPatients: "sign-and-weigh-box-patients",
|
|
381
|
+ start_time: "",
|
|
382
|
+ end_time: "",
|
|
383
|
+ page: 1,
|
|
384
|
+ limit: 10,
|
|
385
|
+ goodType: [],
|
|
386
|
+ goodInfo: [],
|
|
387
|
+ org_id: 0,
|
|
388
|
+ types: [],
|
|
389
|
+ tyep_name: "",
|
|
390
|
+ form: {
|
|
391
|
+ manufacturer_id: "",
|
|
392
|
+ },
|
|
393
|
+ tabList: [],
|
|
394
|
+ manufactuerList: [],
|
|
395
|
+ currentIndex: 0,
|
|
396
|
+ goodTypeList: [],
|
|
397
|
+ drugTypeList: [],
|
|
398
|
+ supplier_name: "",
|
|
399
|
+ supplyList: [],
|
|
400
|
+ rate_of_concession: "",
|
|
401
|
+ discount_amount: "",
|
|
402
|
+ start_time: new Date(),
|
|
403
|
+ end_time: new Date(),
|
|
404
|
+ tableRules: {
|
|
405
|
+ name: [{ required: true, message: "商品不能为空", trigger: "blur" }],
|
|
406
|
+ supply_count: [
|
|
407
|
+ { required: true, message: "数量不能为空", trigger: "blur" },
|
|
408
|
+ ],
|
|
409
|
+ },
|
|
410
|
+ warehousing_id: 0,
|
|
411
|
+ number: "",
|
|
412
|
+ loading: false,
|
|
413
|
+ drugList: [],
|
|
414
|
+ goodList: [],
|
|
415
|
+ id: 0,
|
|
416
|
+ disabled: false,
|
|
417
|
+ is_check: 0,
|
|
418
|
+ dialogVisible: false,
|
|
419
|
+ };
|
|
420
|
+ },
|
|
421
|
+ methods: {
|
|
422
|
+ getInitOrder() {
|
|
423
|
+ getInitOrder().then((response) => {
|
|
424
|
+ if (response.data.state == 1) {
|
|
425
|
+ var drugList = response.data.data.drugList;
|
|
426
|
+ this.manufactuerList = response.data.data.manufactuerList;
|
|
427
|
+ this.goodTypeList = response.data.data.goodTypeList;
|
|
428
|
+ this.drugTypeList = response.data.data.drugTypeList;
|
|
429
|
+ this.supplyList = response.data.data.supplyList;
|
|
430
|
+ for (let i = 0; i < drugList.length; i++) {
|
|
431
|
+ for (let z = 0; z < drugList[i].drug_warehouse_info.length; z++) {
|
|
432
|
+ drugList[i].drug_warehouse_info[z].stock_max_number =
|
|
433
|
+ drugList[i].drug_warehouse_info[z].stock_max_number *
|
|
434
|
+ drugList[i].min_number;
|
|
435
|
+ }
|
|
436
|
+ for (let j = 0; j < this.manufactuerList.length; j++) {
|
|
437
|
+ if (drugList[i].manufacturer == this.manufactuerList[j].id) {
|
|
438
|
+ drugList[i].manufacturer =
|
|
439
|
+ this.manufactuerList[j].manufacturer_name;
|
|
440
|
+ }
|
|
441
|
+ }
|
|
442
|
+ for (let y = 0; y < this.drugTypeList.length; y++) {
|
|
443
|
+ if (drugList[i].drug_type == this.drugTypeList[y].value) {
|
|
444
|
+ drugList[i].drug_type = this.drugTypeList[y].name;
|
|
445
|
+ }
|
|
446
|
+ }
|
|
447
|
+ drugList[i].supply_name =
|
|
448
|
+ drugList[i].drug_name +
|
|
449
|
+ " " +
|
|
450
|
+ drugList[i].dose +
|
|
451
|
+ drugList[i].dose_unit +
|
|
452
|
+ "*" +
|
|
453
|
+ drugList[i].min_number +
|
|
454
|
+ drugList[i].min_unit +
|
|
455
|
+ "/" +
|
|
456
|
+ drugList[i].max_unit +
|
|
457
|
+ " " +
|
|
458
|
+ drugList[i].manufacturer;
|
|
459
|
+ drugList[i].supply_type = drugList[i].drug_type;
|
|
460
|
+ drugList[i].supply_specification_name =
|
|
461
|
+ drugList[i].dose +
|
|
462
|
+ drugList[i].dose_unit +
|
|
463
|
+ "*" +
|
|
464
|
+ drugList[i].min_number +
|
|
465
|
+ drugList[i].min_unit +
|
|
466
|
+ "/" +
|
|
467
|
+ drugList[i].max_unit;
|
|
468
|
+ drugList[i].supply_total = this.getWarehoseInfo(
|
|
469
|
+ drugList[i].drug_warehouse_info,
|
|
470
|
+ drugList[i].max_unit,
|
|
471
|
+ drugList[i].min_unit,
|
|
472
|
+ drugList[i].min_number
|
|
473
|
+ );
|
|
474
|
+ drugList[i].supply_count = "";
|
|
475
|
+ drugList[i].supply_total_price = "";
|
|
476
|
+ drugList[i].supply_manufacturer = drugList[i].manufacturer;
|
|
477
|
+ drugList[i].supply_license_number = drugList[i].number;
|
|
478
|
+ drugList[i].supply_remake = "";
|
|
479
|
+ drugList[i].type = 1;
|
|
480
|
+ drugList[i].supply_price = drugList[i].last_price;
|
|
481
|
+ drugList[i].name = drugList[i].drug_name;
|
|
482
|
+ drugList[i].unitList = [
|
|
483
|
+ { id: 1, name: "" },
|
|
484
|
+ { id: 2, name: "" },
|
|
485
|
+ ];
|
|
486
|
+ drugList[i].supply_unit = drugList[i].max_unit;
|
|
487
|
+ for (let j = 0; j < drugList[i].unitList.length; j++) {
|
|
488
|
+ drugList[i].unitList[0].name = drugList[i].max_unit;
|
|
489
|
+ drugList[i].unitList[1].name = drugList[i].min_unit;
|
|
490
|
+ }
|
|
491
|
+ this.tabList.push(drugList[i]);
|
|
492
|
+ }
|
|
493
|
+ this.drugList = drugList;
|
|
494
|
+ var goodList = response.data.data.goodList;
|
|
495
|
+ for (let i = 0; i < goodList.length; i++) {
|
|
496
|
+ for (let j = 0; j < this.manufactuerList.length; j++) {
|
|
497
|
+ if (goodList[i].manufacturer == this.manufactuerList[j].id) {
|
|
498
|
+ goodList[i].manufacturer =
|
|
499
|
+ this.manufactuerList[j].manufacturer_name;
|
|
500
|
+ }
|
|
501
|
+ }
|
|
502
|
+ for (let y = 0; y < this.goodTypeList.length; y++) {
|
|
503
|
+ if (goodList[i].good_type_id == this.goodTypeList[y].id) {
|
|
504
|
+ goodList[i].good_type_id = this.goodTypeList[y].type_name;
|
|
505
|
+ }
|
|
506
|
+ }
|
|
507
|
+ goodList[i].supply_name =
|
|
508
|
+ goodList[i].good_name +
|
|
509
|
+ " " +
|
|
510
|
+ goodList[i].specification_name +
|
|
511
|
+ " " +
|
|
512
|
+ goodList[i].manufacturer;
|
|
513
|
+ goodList[i].supply_type = goodList[i].good_type_id;
|
|
514
|
+ goodList[i].supply_specification_name =
|
|
515
|
+ goodList[i].specification_name;
|
|
516
|
+ goodList[i].supply_price = goodList[i].buy_price;
|
|
517
|
+ goodList[i].supply_total = this.getTotalStockCount(
|
|
518
|
+ goodList[i].good_warehouse_info
|
|
519
|
+ );
|
|
520
|
+ goodList[i].supply_count = "";
|
|
521
|
+ goodList[i].supply_total_price = "";
|
|
522
|
+ goodList[i].supply_manufacturer = goodList[i].manufacturer;
|
|
523
|
+ goodList[i].supply_license_number = "";
|
|
524
|
+ goodList[i].supply_remake = "";
|
|
525
|
+ goodList[i].type = 2;
|
|
526
|
+ goodList[i].name = goodList[i].good_name;
|
|
527
|
+ goodList[i].unitList = [
|
|
528
|
+ { id: 1, name: "" },
|
|
529
|
+ { id: 2, name: "" },
|
|
530
|
+ ];
|
|
531
|
+ goodList[i].supply_unit = goodList[i].packing_unit;
|
|
532
|
+ for (let j = 0; j < goodList[i].unitList.length; j++) {
|
|
533
|
+ goodList[i].unitList[0].name = goodList[i].packing_unit;
|
|
534
|
+ }
|
|
535
|
+ this.tabList.push(goodList[i]);
|
|
536
|
+ }
|
|
537
|
+ this.goodList = goodList;
|
|
538
|
+ }
|
|
539
|
+ });
|
|
540
|
+ },
|
|
541
|
+ changeGoodName(val) {
|
|
542
|
+ this.currentIndex = val;
|
|
543
|
+ },
|
|
544
|
+ changeName(val) {
|
|
545
|
+ //var obj = {"id":0,"name":"合计","supply_name":"","supply_type":"","supply_specification_name":"","supply_total":"","supply_count":"","supply_price":"","supply_total_price":"","supply_manufacturer":"","supply_license_number":"","supply_remake":"","is_total":2}
|
|
546
|
+ for (let i = 0; i < this.recordInfo.tableList.length; i++) {
|
|
547
|
+ if (this.currentIndex == i) {
|
|
548
|
+ this.recordInfo.tableList[i].project_id = val.id;
|
|
549
|
+ this.recordInfo.tableList[i].type = val.type;
|
|
550
|
+ this.recordInfo.tableList[i].name = val.name;
|
|
551
|
+ this.recordInfo.tableList[i].supply_name = val.supply_name;
|
|
552
|
+ this.recordInfo.tableList[i].supply_type = val.supply_type;
|
|
553
|
+ this.recordInfo.tableList[i].supply_specification_name =
|
|
554
|
+ val.supply_specification_name;
|
|
555
|
+ this.recordInfo.tableList[i].supply_total = val.supply_total;
|
|
556
|
+ if (val.supply_count == NaN) {
|
|
557
|
+ this.recordInfo.tableList[i].supply_count = "";
|
|
558
|
+ } else {
|
|
559
|
+ this.recordInfo.tableList[i].supply_count = val.supply_count
|
|
560
|
+ ? val.supply_count
|
|
561
|
+ : "";
|
|
562
|
+ }
|
|
563
|
+
|
|
564
|
+ this.recordInfo.tableList[i].supply_price = val.supply_price
|
|
565
|
+ ? val.supply_price
|
|
566
|
+ : "";
|
|
567
|
+ this.recordInfo.tableList[i].supply_total_price =
|
|
568
|
+ val.supply_total_price ? val.supply_total_price : "";
|
|
569
|
+ this.recordInfo.tableList[i].supply_manufacturer =
|
|
570
|
+ val.supply_manufacturer;
|
|
571
|
+ this.recordInfo.tableList[i].supply_license_number =
|
|
572
|
+ val.supply_license_number;
|
|
573
|
+ this.recordInfo.tableList[i].supply_remake = val.supply_remake;
|
|
574
|
+ this.recordInfo.tableList[i].is_total = val.is_total;
|
|
575
|
+ this.recordInfo.tableList[i].supply_unit = val.supply_unit;
|
|
576
|
+ this.recordInfo.tableList[i].unitList = val.unitList;
|
|
577
|
+ }
|
|
578
|
+ }
|
|
579
|
+ },
|
|
580
|
+ handleEdit() {
|
|
581
|
+ const tempObj = {};
|
|
582
|
+ tempObj["id"] = 0;
|
|
583
|
+ tempObj["name"] = "";
|
|
584
|
+ tempObj["supply_name"] = "";
|
|
585
|
+ tempObj["supply_type"] = "";
|
|
586
|
+ tempObj["supply_specification_name"] = "";
|
|
587
|
+ tempObj["supply_total"] = "";
|
|
588
|
+ tempObj["supply_count"] = "";
|
|
589
|
+ tempObj["supply_price"] = "";
|
|
590
|
+ tempObj["supply_total_price"] = "";
|
|
591
|
+ tempObj["supply_manufacturer"] = "";
|
|
592
|
+ tempObj["supply_license_number"] = "";
|
|
593
|
+ tempObj["supply_remake"] = "";
|
|
594
|
+ tempObj["type"] = 0;
|
|
595
|
+ tempObj["is_total"] = 1;
|
|
596
|
+ tempObj["project_id"] = 0;
|
|
597
|
+ tempObj["supply_unit"] = "";
|
|
598
|
+ this.recordInfo.tableList.push(tempObj);
|
|
599
|
+ },
|
|
600
|
+ handleDelete: function (index, row) {
|
|
601
|
+ if (this.recordInfo.tableList.length <= 1) {
|
|
602
|
+ this.$message.error("只有一条记录的时候无法删除");
|
|
603
|
+ return;
|
|
604
|
+ } else {
|
|
605
|
+ this.recordInfo.tableList.splice(index, 1);
|
|
606
|
+ }
|
|
607
|
+ },
|
|
608
|
+
|
|
609
|
+ changeTypeName() {},
|
|
610
|
+ startTimeChange() {},
|
|
611
|
+ endTimeChange() {},
|
|
612
|
+ search() {},
|
|
613
|
+
|
|
614
|
+ getWarehoseInfo(arr, max_unit, min_unit, min_number) {
|
|
615
|
+ var total = 0;
|
|
616
|
+ var max_str = "";
|
|
617
|
+ var min_str = "";
|
|
618
|
+ if (arr.length > 0) {
|
|
619
|
+ for (let i = 0; i < arr.length; i++) {
|
|
620
|
+ total += parseInt(arr[i].stock_max_number);
|
|
621
|
+ }
|
|
622
|
+ }
|
|
623
|
+ if (total < min_number) {
|
|
624
|
+ min_str = total + min_unit;
|
|
625
|
+ }
|
|
626
|
+ if (total == 0) {
|
|
627
|
+ min_str = "";
|
|
628
|
+ max_str = "";
|
|
629
|
+ }
|
|
630
|
+ if (total >= min_number) {
|
|
631
|
+ if (parseInt(total / min_number) != 0) {
|
|
632
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
633
|
+ }
|
|
634
|
+ if (total % min_number != 0) {
|
|
635
|
+ min_str = (total % min_number) + min_unit;
|
|
636
|
+ }
|
|
637
|
+ }
|
|
638
|
+ return max_str + min_str;
|
|
639
|
+ },
|
|
640
|
+ getTotalStockCount(arr) {
|
|
641
|
+ var total_count = 0;
|
|
642
|
+ for (let i = 0; i < arr.length; i++) {
|
|
643
|
+ total_count += arr[i].stock_count;
|
|
644
|
+ }
|
|
645
|
+ return total_count;
|
|
646
|
+ },
|
|
647
|
+ calculate: function (val) {
|
|
648
|
+ if (isNaN(val)) {
|
|
649
|
+ return "";
|
|
650
|
+ }
|
|
651
|
+ if (val == 0) {
|
|
652
|
+ return "";
|
|
653
|
+ }
|
|
654
|
+ return Math.round(parseFloat(val) * 100) / 100;
|
|
655
|
+ },
|
|
656
|
+ getTimes(time) {
|
|
657
|
+ if (time === "") {
|
|
658
|
+ return "";
|
|
659
|
+ }
|
|
660
|
+ return uParseTime(time, "{y}-{m}-{d}");
|
|
661
|
+ },
|
|
662
|
+ updatePurchaseOrder() {
|
|
663
|
+ this.loading = true;
|
|
664
|
+ if (this.supplier_name == 0 || this.supplier_name == "") {
|
|
665
|
+ this.$message.error("供应商不能为空!");
|
|
666
|
+ this.loading = false;
|
|
667
|
+ return false;
|
|
668
|
+ }
|
|
669
|
+ this.$refs["tableForm"].validate((valid) => {
|
|
670
|
+ if (valid) {
|
|
671
|
+ for (let i = 0; i < this.recordInfo.tableList.length; i++) {
|
|
672
|
+ this.recordInfo.tableList[i].supply_count = parseInt(
|
|
673
|
+ this.recordInfo.tableList[i].supply_count
|
|
674
|
+ );
|
|
675
|
+ this.recordInfo.tableList[i].supply_license_number =
|
|
676
|
+ this.recordInfo.tableList[i].supply_license_number.toString();
|
|
677
|
+ this.recordInfo.tableList[i].supply_total_price = (
|
|
678
|
+ this.recordInfo.tableList[i].supply_count *
|
|
679
|
+ this.recordInfo.tableList[i].supply_price
|
|
680
|
+ ).toString();
|
|
681
|
+ this.recordInfo.tableList[i].supply_total =
|
|
682
|
+ this.recordInfo.tableList[i].supply_total.toString();
|
|
683
|
+ this.recordInfo.tableList[i].supply_price =
|
|
684
|
+ this.recordInfo.tableList[i].supply_price.toString();
|
|
685
|
+ for (let j = 0; j < this.manufactuerList.length; j++) {
|
|
686
|
+ if (
|
|
687
|
+ this.recordInfo.tableList[i].supply_manufacturer ==
|
|
688
|
+ this.manufactuerList[j].manufacturer_name
|
|
689
|
+ ) {
|
|
690
|
+ this.recordInfo.tableList[i].manufacturer_id =
|
|
691
|
+ this.manufactuerList[j].id;
|
|
692
|
+ }
|
|
693
|
+ }
|
|
694
|
+ }
|
|
695
|
+ var start = this.getTimes(this.start_time);
|
|
696
|
+ var end = this.getTimes(this.end_time);
|
|
697
|
+ const params = {
|
|
698
|
+ stockIn: this.recordInfo.tableList,
|
|
699
|
+ };
|
|
700
|
+ console.log("param23232332", params);
|
|
701
|
+
|
|
702
|
+ updatePurchaseOrder(
|
|
703
|
+ params,
|
|
704
|
+ this.supplier_name,
|
|
705
|
+ start,
|
|
706
|
+ end,
|
|
707
|
+ this.rate_of_concession,
|
|
708
|
+ this.discount_amount,
|
|
709
|
+ this.id,
|
|
710
|
+ this.number
|
|
711
|
+ ).then((response) => {
|
|
712
|
+ if (response.data.state == 1) {
|
|
713
|
+ this.loading = false;
|
|
714
|
+ var warehousingInfo = response.data.data.warehousingInfo;
|
|
715
|
+ this.$message.success("修改成功!");
|
|
716
|
+ }
|
|
717
|
+ });
|
|
718
|
+ }
|
|
719
|
+ });
|
|
720
|
+ },
|
|
721
|
+ getAllPrice() {
|
|
722
|
+ var total_price = 0;
|
|
723
|
+ for (let i = 0; i < this.recordInfo.tableList.length; i++) {
|
|
724
|
+ total_price +=
|
|
725
|
+ this.recordInfo.tableList[i].supply_price *
|
|
726
|
+ this.recordInfo.tableList[i].supply_count;
|
|
727
|
+ }
|
|
728
|
+ return total_price.toFixed(2);
|
|
729
|
+ },
|
|
730
|
+ checkPurchaseOrder(id, index) {
|
|
731
|
+ this.$confirm("是否审核?", {
|
|
732
|
+ confirmButtonText: "确 定",
|
|
733
|
+ cancelButtonText: "取 消",
|
|
734
|
+ type: "warning",
|
|
735
|
+ })
|
|
736
|
+ .then(() => {
|
|
737
|
+ checkPurchaseOrder(this.id).then((response) => {
|
|
738
|
+ if (response.data.state == 1) {
|
|
739
|
+ var info = response.data.data.info;
|
|
740
|
+ this.disabled = true;
|
|
741
|
+ this.$message.success("审核成功!");
|
|
742
|
+ this.getPurchaseOrderDetail();
|
|
743
|
+ }
|
|
744
|
+ });
|
|
745
|
+ })
|
|
746
|
+ .catch(() => {});
|
|
747
|
+ },
|
|
748
|
+ getPurchaseOrderDetail() {
|
|
749
|
+ console.log("处方233223232323322323232323");
|
|
750
|
+ var id = this.$route.query.id;
|
|
751
|
+ getPurchaseOrderDetail(id).then((response) => {
|
|
752
|
+ if (response.data.state == 1) {
|
|
753
|
+ var info = response.data.data.info;
|
|
754
|
+ this.is_check = info.is_check;
|
|
755
|
+ this.number = info.number;
|
|
756
|
+ this.id = info.id;
|
|
757
|
+ this.supplier_name = info.supplier_id;
|
|
758
|
+ this.rate_of_concession = info.rate_of_concession;
|
|
759
|
+ this.discount_amount = info.discount_amount;
|
|
760
|
+ var orderInfo = response.data.data.orderInfo;
|
|
761
|
+ if (info.is_check == 2) {
|
|
762
|
+ this.disabled = false;
|
|
763
|
+ }
|
|
764
|
+ if (info.is_check == 1) {
|
|
765
|
+ this.disabled = true;
|
|
766
|
+ }
|
|
767
|
+ console.log("drugli323322332", this.drugList);
|
|
768
|
+ var drugList = response.data.data.baseList;
|
|
769
|
+ var goodList = response.data.data.goodList;
|
|
770
|
+ for (let i = 0; i < orderInfo.length; i++) {
|
|
771
|
+ orderInfo[i].supply_count = orderInfo[i].count;
|
|
772
|
+ orderInfo[i].supply_price = orderInfo[i].price;
|
|
773
|
+ orderInfo[i].supply_remake = orderInfo[i].remark;
|
|
774
|
+ orderInfo[i].type = orderInfo[i].is_source;
|
|
775
|
+ orderInfo[i].project_id = orderInfo[i].project_id;
|
|
776
|
+ orderInfo[i].supply_unit = orderInfo[i].supply_unit;
|
|
777
|
+ if (orderInfo[i].is_source == 1) {
|
|
778
|
+ for (let j = 0; j < drugList.length; j++) {
|
|
779
|
+ if (orderInfo[i].project_id == drugList[j].id) {
|
|
780
|
+ orderInfo[i].unitList = [
|
|
781
|
+ { id: 1, name: "" },
|
|
782
|
+ { id: 2, name: "" },
|
|
783
|
+ ];
|
|
784
|
+ orderInfo[i].unitList[0].name = drugList[j].max_unit;
|
|
785
|
+ orderInfo[i].unitList[1].name = drugList[j].min_unit;
|
|
786
|
+ }
|
|
787
|
+ }
|
|
788
|
+ }
|
|
789
|
+ if (orderInfo[i].is_source == 2) {
|
|
790
|
+ for (let j = 0; j < goodList.length; j++) {
|
|
791
|
+ if (orderInfo[i].project_id == goodList[j].id) {
|
|
792
|
+ orderInfo[i].unitList = [{ id: 1, name: "" }];
|
|
793
|
+ orderInfo[i].unitList[0].name = goodList[j].packing_unit;
|
|
794
|
+ }
|
|
795
|
+ }
|
|
796
|
+ }
|
|
797
|
+ }
|
|
798
|
+ console.log("orderINFO23323232", orderInfo);
|
|
799
|
+ this.recordInfo.tableList = orderInfo;
|
|
800
|
+ }
|
|
801
|
+ });
|
|
802
|
+ },
|
|
803
|
+ toPrint() {
|
|
804
|
+ var id = this.$route.query.id;
|
|
805
|
+ this.$router.push({ path: "/purchase/order/print?&id=" + id });
|
|
806
|
+ },
|
|
807
|
+ toAdd() {
|
|
808
|
+ var id = this.$route.query.id;
|
|
809
|
+ if (this.is_check == 2) {
|
|
810
|
+ this.$message.error("该采购订单未审核,不能生成采购数据!");
|
|
811
|
+ return false;
|
|
812
|
+ }
|
|
813
|
+ this.$router.push({ path: "/purchase/order/add?id=" + id });
|
|
814
|
+ },
|
|
815
|
+ },
|
|
816
|
+ created() {
|
|
817
|
+ const tempObj = {};
|
|
818
|
+ tempObj["id"] = 0;
|
|
819
|
+ tempObj["name"] = "";
|
|
820
|
+ tempObj["supply_name"] = "";
|
|
821
|
+ tempObj["supply_type"] = "";
|
|
822
|
+ tempObj["supply_specification_name"] = "";
|
|
823
|
+ tempObj["supply_total"] = "";
|
|
824
|
+ tempObj["supply_count"] = "";
|
|
825
|
+ tempObj["supply_price"] = "";
|
|
826
|
+ tempObj["supply_total_price"] = "";
|
|
827
|
+ tempObj["supply_manufacturer"] = "";
|
|
828
|
+ tempObj["supply_license_number"] = "";
|
|
829
|
+ tempObj["supply_remake"] = "";
|
|
830
|
+ tempObj["type"] = 0;
|
|
831
|
+ tempObj["is_total"] = 1;
|
|
832
|
+ tempObj["project_id"] = 0;
|
|
833
|
+ tempObj["supply_unit"] = "";
|
|
834
|
+ this.recordInfo.tableList.push(tempObj);
|
|
835
|
+ this.getInitOrder();
|
|
836
|
+ this.getPurchaseOrderDetail();
|
|
837
|
+ },
|
|
838
|
+};
|
|
839
|
+</script>
|
|
840
|
+
|
|
841
|
+<style rel="stylesheet/css" lang="scss" scoped>
|
|
842
|
+.information {
|
|
843
|
+ border: 1px #dcdfe6 solid;
|
|
844
|
+ padding: 30px 20px 30px 20px;
|
|
845
|
+
|
|
846
|
+ .border {
|
|
847
|
+ border-bottom: 1px #dcdfe6 solid;
|
|
848
|
+ margin: 0px 0 20px 0;
|
|
849
|
+ }
|
|
850
|
+}
|
|
851
|
+
|
|
852
|
+.title {
|
|
853
|
+ background: #409eff;
|
|
854
|
+ height: 44px;
|
|
855
|
+ line-height: 44px;
|
|
856
|
+ padding: 0 0 0 10px;
|
|
857
|
+ color: #fff;
|
|
858
|
+ margin: 0 0 10px 0;
|
|
859
|
+}
|
|
860
|
+
|
|
861
|
+.edit_separater {
|
|
862
|
+ border-top: 1px solid rgb(233, 233, 233);
|
|
863
|
+ margin-top: 15px;
|
|
864
|
+ margin-bottom: 15px;
|
|
865
|
+}
|
|
866
|
+</style>
|
|
867
|
+
|
|
868
|
+<style>
|
|
869
|
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
|
|
870
|
+ font-size: 12px;
|
|
871
|
+}
|
|
872
|
+
|
|
873
|
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
|
|
874
|
+ background: #6fb5fa;
|
|
875
|
+}
|
|
876
|
+
|
|
877
|
+.count {
|
|
878
|
+ color: #bd2c00;
|
|
879
|
+}
|
|
880
|
+.el-table td,
|
|
881
|
+.el-table th.is-leaf,
|
|
882
|
+.el-table--border,
|
|
883
|
+.el-table--group {
|
|
884
|
+ border-color: #d0d3da;
|
|
885
|
+}
|
|
886
|
+.el-table--border::after,
|
|
887
|
+.el-table--group::after,
|
|
888
|
+.el-table::before {
|
|
889
|
+ background-color: #d0d3da;
|
|
890
|
+}
|
|
891
|
+.el-table__fixed-right {
|
|
892
|
+ width: 150px;
|
|
893
|
+ bottom: 20px;
|
|
894
|
+ height: 100%;
|
|
895
|
+}
|
|
896
|
+</style>
|