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