|
@@ -3,9 +3,10 @@
|
3
|
3
|
<div class="position">
|
4
|
4
|
<bread-crumb :crumbs="crumbs"></bread-crumb>
|
5
|
5
|
</div>
|
6
|
|
-<div class="app-container ">
|
|
6
|
+<div class="app-container" v-loading="loading">
|
7
|
7
|
<div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
|
8
|
8
|
<div>
|
|
9
|
+ <span style="color:red">*</span><span>供应商:</span>
|
9
|
10
|
<el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
|
10
|
11
|
@change="changeTypeName">
|
11
|
12
|
<el-option
|
|
@@ -15,6 +16,7 @@
|
15
|
16
|
:value="item.id">
|
16
|
17
|
</el-option>
|
17
|
18
|
</el-select>
|
|
19
|
+ <span>单据日期:</span>
|
18
|
20
|
<el-date-picker
|
19
|
21
|
size="small"
|
20
|
22
|
v-model="start_time"
|
|
@@ -27,7 +29,8 @@
|
27
|
29
|
format="yyyy-MM-dd"
|
28
|
30
|
value-format="yyyy-MM-dd"
|
29
|
31
|
@change="startTimeChange"
|
30
|
|
- ></el-date-picker>-
|
|
32
|
+ ></el-date-picker>
|
|
33
|
+ <span>交货日期:</span>
|
31
|
34
|
<el-date-picker
|
32
|
35
|
size="small"
|
33
|
36
|
v-model="end_time"
|
|
@@ -41,53 +44,51 @@
|
41
|
44
|
value-format="yyyy-MM-dd"
|
42
|
45
|
@change="endTimeChange"
|
43
|
46
|
></el-date-picker>
|
44
|
|
- <el-input
|
45
|
|
- size="small"
|
46
|
|
- style="width: 200px;margin-left:10px;"
|
47
|
|
- class="filter-item"
|
48
|
|
- v-model.trim="keywords"
|
49
|
|
- placeholder="耗材名称"
|
50
|
|
- />
|
51
|
|
- <el-button
|
52
|
|
- size="small"
|
53
|
|
- class="filter-item"
|
54
|
|
- type="primary"
|
55
|
|
- icon="el-icon-search"
|
56
|
|
- @click="search"
|
57
|
|
- >搜索</el-button
|
58
|
|
- >
|
|
47
|
+ <span>单据编码:{{number}}</span>
|
|
48
|
+
|
59
|
49
|
</div>
|
60
|
50
|
<div>
|
61
|
|
- <el-button size="small" type="primary" @click="savePurchaseOrder">保存</el-button>
|
|
51
|
+ <el-button size="small" type="primary" @click="savePurchaseOrder" v-show="showTwo">保存</el-button>
|
|
52
|
+ <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">打印</el-button>
|
|
53
|
+ <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">审核</el-button>
|
|
54
|
+ <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">修改</el-button>
|
62
|
55
|
</div>
|
63
|
56
|
</div>
|
64
|
57
|
|
65
|
|
-
|
|
58
|
+ <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
|
66
|
59
|
<el-table
|
67
|
60
|
:row-style="{ color: '#303133' }"
|
68
|
61
|
:header-cell-style="{
|
69
|
62
|
backgroundColor: 'rgb(245, 247, 250)',
|
70
|
63
|
color: '#606266'
|
71
|
64
|
}"
|
72
|
|
- :data="tableList"
|
|
65
|
+ :data="recordInfo.tableList"
|
73
|
66
|
:class="signAndWeighBoxPatients"
|
74
|
67
|
border
|
75
|
68
|
style="width: 100%"
|
76
|
69
|
max-height="450"
|
77
|
70
|
>
|
78
|
|
- <el-table-column label="商品" align="center" width="200px">
|
|
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>
|
79
|
75
|
<template slot-scope="scope">
|
|
76
|
+ <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
|
80
|
77
|
<el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName" @input="changeGoodName(scope.$index)">
|
81
|
|
- <el-option
|
82
|
|
- v-for="(item,index) in tabList"
|
83
|
|
- :key="index"
|
84
|
|
- :label="item.supply_name"
|
85
|
|
- :value="item">
|
86
|
|
- </el-option>
|
87
|
|
- </el-select>
|
|
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>
|
88
|
86
|
</template>
|
89
|
87
|
</el-table-column>
|
90
|
|
- <el-table-column label="商品类别" align="center" width="150px">
|
|
88
|
+ <el-table-column align="center" width="150px">
|
|
89
|
+ <template slot="header" slot-scope="scope">
|
|
90
|
+ <span>商品类别</span>
|
|
91
|
+ </template>
|
91
|
92
|
<template slot-scope="scope">
|
92
|
93
|
<el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
|
93
|
94
|
</template>
|
|
@@ -103,8 +104,13 @@
|
103
|
104
|
</template>
|
104
|
105
|
</el-table-column>
|
105
|
106
|
<el-table-column label="数量" align="center" width="120px">
|
|
107
|
+ <template slot="header" slot-scope="scope">
|
|
108
|
+ <span>数量<span style="color: red">*</span></span>
|
|
109
|
+ </template>
|
106
|
110
|
<template slot-scope="scope">
|
107
|
|
- <el-input v-model="scope.row.supply_count" style="width:80px"></el-input>
|
|
111
|
+ <el-form-item :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
|
|
112
|
+ <el-input v-model="scope.row.supply_count" style="width:80px"></el-input>
|
|
113
|
+ </el-form-item>
|
108
|
114
|
</template>
|
109
|
115
|
</el-table-column>
|
110
|
116
|
|
|
@@ -119,13 +125,13 @@
|
119
|
125
|
{{calculate(scope.row.supply_count * scope.row.supply_price)}}
|
120
|
126
|
</template>
|
121
|
127
|
</el-table-column>
|
122
|
|
-
|
|
128
|
+
|
123
|
129
|
<el-table-column label="生产厂商" align="center" width="200px">
|
124
|
130
|
<template slot-scope="scope">
|
125
|
131
|
<el-input v-model="scope.row.supply_manufacturer" style="width:160px" :disabled="true"></el-input>
|
126
|
132
|
</template>
|
127
|
133
|
</el-table-column>
|
128
|
|
-
|
|
134
|
+
|
129
|
135
|
|
130
|
136
|
<el-table-column label="批准文号" align="center" width="200px">
|
131
|
137
|
<template slot-scope="scope">
|
|
@@ -161,15 +167,24 @@
|
161
|
167
|
</template>
|
162
|
168
|
</el-table-column>
|
163
|
169
|
</el-table>
|
164
|
|
-
|
|
170
|
+</el-form>
|
|
171
|
+ <div style="margin-top:10px">
|
|
172
|
+ 合计:{{getAllPrice()}} 元
|
|
173
|
+ </div>
|
|
174
|
+ <div style="margin-top:10px">
|
|
175
|
+ <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
|
|
176
|
+
|
|
177
|
+ <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
|
|
178
|
+
|
|
179
|
+ </div>
|
165
|
180
|
</div>
|
166
|
181
|
</div>
|
167
|
182
|
</template>
|
168
|
183
|
|
169
|
184
|
<script>
|
170
|
185
|
import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
171
|
|
-
|
172
|
|
-import {getInitOrder} from "@/api/supply"
|
|
186
|
+import {uParseTime } from '@/utils/tools'
|
|
187
|
+import {getInitOrder,savePurchaseOrder,updatePurchaseOrder} from "@/api/supply"
|
173
|
188
|
export default {
|
174
|
189
|
name: "addPurchaseOrder",
|
175
|
190
|
created() {
|
|
@@ -193,9 +208,14 @@ BreadCrumb
|
193
|
208
|
data() {
|
194
|
209
|
return {
|
195
|
210
|
crumbs: [
|
196
|
|
- { path: false, name: "购货订单" },
|
197
|
|
- { path: "/spply/query", name: "新增购货订单" }
|
|
211
|
+ { path: false, name: "购货订单" },
|
|
212
|
+ { path: "/spply/query", name: "新增购货订单" }
|
198
|
213
|
],
|
|
214
|
+ showTwo:true,
|
|
215
|
+ showOne:false,
|
|
216
|
+ recordInfo: {
|
|
217
|
+ tableList:[],
|
|
218
|
+ },
|
199
|
219
|
keywords: "",
|
200
|
220
|
total: 0,
|
201
|
221
|
multipleSelection: [],
|
|
@@ -208,7 +228,6 @@ return {
|
208
|
228
|
goodInfo: [],
|
209
|
229
|
org_id:0,
|
210
|
230
|
types:[],
|
211
|
|
- tableList:[],
|
212
|
231
|
tyep_name:"",
|
213
|
232
|
form:{
|
214
|
233
|
manufacturer_id:"",
|
|
@@ -220,9 +239,24 @@ return {
|
220
|
239
|
drugTypeList:[],
|
221
|
240
|
supplier_name:"",
|
222
|
241
|
supplyList:[],
|
223
|
|
-};
|
|
242
|
+ rate_of_concession:"",
|
|
243
|
+ discount_amount:"",
|
|
244
|
+ start_time:new Date(),
|
|
245
|
+ end_time:new Date(),
|
|
246
|
+ tableRules: {
|
|
247
|
+ name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
|
|
248
|
+ supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
|
|
249
|
+ },
|
|
250
|
+ warehousing_id:0,
|
|
251
|
+ number:"",
|
|
252
|
+ loading:false,
|
|
253
|
+ drugList:[],
|
|
254
|
+ goodList:[],
|
|
255
|
+ id:0,
|
|
256
|
+ };
|
224
|
257
|
},
|
225
|
258
|
methods:{
|
|
259
|
+
|
226
|
260
|
getInitOrder(){
|
227
|
261
|
getInitOrder().then(response=>{
|
228
|
262
|
if(response.data.state == 1){
|
|
@@ -234,12 +268,12 @@ getInitOrder(){
|
234
|
268
|
for(let i=0;i<drugList.length;i++){
|
235
|
269
|
for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
|
236
|
270
|
drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
|
237
|
|
- }
|
|
271
|
+ }
|
238
|
272
|
for(let j=0;j<this.manufactuerList.length;j++){
|
239
|
273
|
if(drugList[i].manufacturer == this.manufactuerList[j].id){
|
240
|
274
|
drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
|
241
|
275
|
}
|
242
|
|
- }
|
|
276
|
+ }
|
243
|
277
|
for(let y=0;y<this.drugTypeList.length;y++){
|
244
|
278
|
if(drugList[i].drug_type == this.drugTypeList[y].value){
|
245
|
279
|
drugList[i].drug_type = this.drugTypeList[y].name
|
|
@@ -260,19 +294,19 @@ getInitOrder(){
|
260
|
294
|
|
261
|
295
|
this.tabList.push(drugList[i])
|
262
|
296
|
}
|
263
|
|
-
|
|
297
|
+ this.drugList = drugList
|
264
|
298
|
var goodList = response.data.data.goodList
|
265
|
299
|
for(let i=0;i<goodList.length;i++){
|
266
|
300
|
for(let j=0;j<this.manufactuerList.length;j++){
|
267
|
301
|
if(goodList[i].manufacturer == this.manufactuerList[j].id){
|
268
|
302
|
goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
|
269
|
303
|
}
|
270
|
|
- }
|
|
304
|
+ }
|
271
|
305
|
for(let y=0;y<this.goodTypeList.length;y++){
|
272
|
306
|
if(goodList[i].good_type_id == this.goodTypeList[y].id){
|
273
|
307
|
goodList[i].good_type_id = this.goodTypeList[y].type_name
|
274
|
308
|
}
|
275
|
|
- }
|
|
309
|
+ }
|
276
|
310
|
goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
|
277
|
311
|
goodList[i].supply_type = goodList[i].good_type_id
|
278
|
312
|
goodList[i].supply_specification_name =goodList[i].specification_name
|
|
@@ -283,39 +317,45 @@ getInitOrder(){
|
283
|
317
|
goodList[i].supply_manufacturer = goodList[i].manufacturer
|
284
|
318
|
goodList[i].supply_license_number = ""
|
285
|
319
|
goodList[i].supply_remake = ""
|
286
|
|
- goodList[i].type = 2
|
|
320
|
+ goodList[i].type = 2
|
287
|
321
|
goodList[i].name = goodList[i].good_name
|
288
|
322
|
|
289
|
|
- this.tabList.push(goodList[i])
|
|
323
|
+ this.tabList.push(goodList[i])
|
290
|
324
|
}
|
291
|
|
- }
|
292
|
|
- })
|
|
325
|
+ this.goodList = goodList
|
|
326
|
+ }
|
|
327
|
+ })
|
293
|
328
|
},
|
294
|
329
|
changeGoodName(val){
|
295
|
|
- console.log("9媚23323232",val)
|
296
|
|
- this.currentIndex = val
|
|
330
|
+ this.currentIndex = val
|
297
|
331
|
},
|
298
|
332
|
changeName(val){
|
299
|
|
- console.log("val23322323",val)
|
300
|
|
-
|
301
|
|
- for(let i=0;i<this.tableList.length;i++){
|
|
333
|
+ //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}
|
|
334
|
+ for(let i=0;i<this.recordInfo.tableList.length;i++){
|
302
|
335
|
if(this.currentIndex == i){
|
303
|
|
- this.tableList[i].id = val.id
|
304
|
|
- this.tableList[i].type = val.type
|
305
|
|
- this.tableList[i].name = val.name
|
306
|
|
- this.tableList[i].supply_name = val.supply_name
|
307
|
|
- this.tableList[i].supply_type = val.supply_type
|
308
|
|
- this.tableList[i].supply_specification_name = val.supply_specification_name
|
309
|
|
- this.tableList[i].supply_total = val.supply_total
|
310
|
|
- this.tableList[i].supply_count = val.supply_count
|
311
|
|
- this.tableList[i].supply_price = val.supply_price
|
312
|
|
- this.tableList[i].supply_total_price = val.supply_total_price
|
313
|
|
- this.tableList[i].supply_manufacturer = val.supply_manufacturer
|
314
|
|
- this.tableList[i].supply_license_number = val.supply_license_number
|
315
|
|
- this.tableList[i].supply_remake = val.supply_remake
|
316
|
|
- }
|
|
336
|
+ this.recordInfo.tableList[i].id = val.id
|
|
337
|
+ this.recordInfo.tableList[i].type = val.type
|
|
338
|
+ this.recordInfo.tableList[i].name = val.name
|
|
339
|
+ this.recordInfo.tableList[i].supply_name = val.supply_name
|
|
340
|
+ this.recordInfo.tableList[i].supply_type = val.supply_type
|
|
341
|
+ this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name
|
|
342
|
+ this.recordInfo.tableList[i].supply_total = val.supply_total
|
|
343
|
+ if(val.supply_count == NaN){
|
|
344
|
+ this.recordInfo.tableList[i].supply_count = ""
|
|
345
|
+ }else{
|
|
346
|
+ this.recordInfo.tableList[i].supply_count = val.supply_count?val.supply_count:""
|
|
347
|
+ }
|
|
348
|
+
|
|
349
|
+ this.recordInfo.tableList[i].supply_price = val.supply_price?val.supply_price:""
|
|
350
|
+ this.recordInfo.tableList[i].supply_total_price = val.supply_total_price?val.supply_total_price:""
|
|
351
|
+ this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
|
|
352
|
+ this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
|
|
353
|
+ this.recordInfo.tableList[i].supply_remake = val.supply_remake
|
|
354
|
+ this.recordInfo.tableList[i].is_total = val.is_total
|
|
355
|
+ }
|
317
|
356
|
}
|
318
|
|
- console.log("表哥332322332232323",this.tableList)
|
|
357
|
+
|
|
358
|
+
|
319
|
359
|
},
|
320
|
360
|
handleEdit(){
|
321
|
361
|
const tempObj = {}
|
|
@@ -324,31 +364,99 @@ handleEdit(){
|
324
|
364
|
tempObj['supply_name'] = ""
|
325
|
365
|
tempObj['supply_type'] = ""
|
326
|
366
|
tempObj['supply_specification_name'] = ''
|
327
|
|
- tempObj['supply_total'] = ''
|
328
|
|
- tempObj['supply_count'] = ''
|
329
|
|
- tempObj['supply_price'] = ''
|
330
|
|
- tempObj['supply_total_price'] = ''
|
|
367
|
+ tempObj['supply_total'] = ""
|
|
368
|
+ tempObj['supply_count'] = ""
|
|
369
|
+ tempObj['supply_price'] = ""
|
|
370
|
+ tempObj['supply_total_price'] = ""
|
331
|
371
|
tempObj['supply_manufacturer'] = ''
|
332
|
372
|
tempObj['supply_license_number'] = ''
|
333
|
373
|
tempObj['supply_remake'] = ''
|
334
|
374
|
tempObj['type'] = 0
|
335
|
|
- this.tableList.push(tempObj)
|
|
375
|
+ tempObj['is_total'] = 1
|
|
376
|
+ this.recordInfo.tableList.push(tempObj)
|
336
|
377
|
},
|
337
|
378
|
handleDelete: function(index, row) {
|
338
|
|
- if (this.tableList.length <= 1) {
|
|
379
|
+ if (this.recordInfo.tableList.length <= 1) {
|
339
|
380
|
this.$message.error('只有一条记录的时候无法删除')
|
340
|
381
|
return
|
341
|
382
|
} else {
|
342
|
|
- this.tableList.splice(index, 1)
|
|
383
|
+ this.recordInfo.tableList.splice(index, 1)
|
343
|
384
|
}
|
344
|
385
|
},
|
|
386
|
+
|
|
387
|
+
|
345
|
388
|
savePurchaseOrder(){
|
346
|
|
- console.log("param323322332",this.tableList)
|
347
|
|
- savePurchaseOrder().then(response=>{
|
|
389
|
+ this.loading = true
|
|
390
|
+ if(this.supplier_name == 0 || this.supplier_name == ""){
|
|
391
|
+ this.$message.error("供应商不能为空!")
|
|
392
|
+ return false
|
|
393
|
+ }
|
|
394
|
+ this.$refs["tableForm"].validate((valid)=>{
|
|
395
|
+ if(valid){
|
|
396
|
+ for(let i=0;i<this.recordInfo.tableList.length;i++){
|
|
397
|
+ this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
|
|
398
|
+ this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
|
|
399
|
+ this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
|
|
400
|
+ for(let j=0;j<this.manufactuerList.length;j++){
|
|
401
|
+ if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
|
|
402
|
+ this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
|
|
403
|
+ }
|
|
404
|
+
|
|
405
|
+ }
|
|
406
|
+ }
|
|
407
|
+ var start = this.getTimes(this.start_time)
|
|
408
|
+ var end = this.getTimes(this.end_time)
|
|
409
|
+ const params = {
|
|
410
|
+ 'stockIn': this.recordInfo.tableList
|
|
411
|
+ }
|
|
412
|
+
|
|
413
|
+ savePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount).then(response=>{
|
|
414
|
+ if(response.data.state == 1){
|
|
415
|
+ var order = response.data.data.order
|
|
416
|
+ this.loading = false
|
|
417
|
+ this.$message.success("保存成功!")
|
|
418
|
+ var warehouseInfo = response.data.data.warehouseInfo
|
|
419
|
+ this.number = warehouseInfo.number
|
|
420
|
+ this.id = warehouseInfo.id
|
|
421
|
+ this.recordInfo.tableList = []
|
|
422
|
+ var orderInfo = response.data.data.orderInfo
|
|
423
|
+ for(let i=0;i<orderInfo.length;i++){
|
|
424
|
+ orderInfo[i].supply_count = orderInfo[i].count
|
|
425
|
+ orderInfo[i].supply_price = orderInfo[i].price
|
|
426
|
+ orderInfo[i].supply_remake = orderInfo[i].remark
|
|
427
|
+ }
|
|
428
|
+ console.log("orderINFO23323232",orderInfo)
|
|
429
|
+ this.recordInfo.tableList = orderInfo
|
|
430
|
+ // for(let i=0;i<orderInfo.length;i++){
|
|
431
|
+ // orderInfo[i].name = ""
|
|
432
|
+ // orderInfo[i].supply_name = ""
|
|
433
|
+ // orderInfo[i].supply_specification_name = ""
|
|
434
|
+ // if(orderInfo[i].is_source == 1){
|
|
435
|
+ // for(let j=0;j<this.drugList.length;j++){
|
|
436
|
+ // if(orderInfo[i].project_id == this.drugList[j].id){
|
|
437
|
+ // orderInfo[i].name = this.drugList[j].drug_name
|
|
438
|
+ // }
|
|
439
|
+ // }
|
|
440
|
+ // }
|
|
441
|
+ // if(orderInfo[i].is_source == 2){
|
|
442
|
+ // for(let y=0;y<this.goodList.length;y++){
|
|
443
|
+ // if(orderInfo[i].project_id = this.goodList[y].id){
|
|
444
|
+ // orderInfo[i].name = this.goodList[y].good_name
|
|
445
|
+ // }
|
|
446
|
+ // }
|
|
447
|
+ // }
|
|
448
|
+ // }
|
|
449
|
+ this.showTwo = false
|
|
450
|
+ this.showOne = true
|
|
451
|
+ }
|
|
452
|
+ })
|
|
453
|
+ }
|
|
454
|
+
|
|
455
|
+ })
|
348
|
456
|
|
349
|
|
- })
|
350
|
457
|
},
|
351
|
458
|
|
|
459
|
+
|
352
|
460
|
changeTypeName(){
|
353
|
461
|
|
354
|
462
|
},
|
|
@@ -359,7 +467,7 @@ endTimeChange(){
|
359
|
467
|
|
360
|
468
|
},
|
361
|
469
|
search(){
|
362
|
|
-
|
|
470
|
+
|
363
|
471
|
},
|
364
|
472
|
|
365
|
473
|
getWarehoseInfo(arr,max_unit,min_unit,min_number){
|
|
@@ -387,7 +495,7 @@ getWarehoseInfo(arr,max_unit,min_unit,min_number){
|
387
|
495
|
}
|
388
|
496
|
}
|
389
|
497
|
return max_str + min_str
|
390
|
|
- },
|
|
498
|
+ },
|
391
|
499
|
getTotalStockCount(arr){
|
392
|
500
|
var total_count = 0
|
393
|
501
|
for(let i=0;i<arr.length;i++){
|
|
@@ -404,6 +512,47 @@ calculate: function(val) {
|
404
|
512
|
}
|
405
|
513
|
return Math.round(parseFloat(val) * 100) / 100;
|
406
|
514
|
},
|
|
515
|
+getTimes(time) {
|
|
516
|
+ if (time === '') {
|
|
517
|
+ return ''
|
|
518
|
+ }
|
|
519
|
+ return uParseTime(time, '{y}-{m}-{d}')
|
|
520
|
+},
|
|
521
|
+ updatePurchaseOrder(){
|
|
522
|
+ this.$refs.validate((valid)=>{
|
|
523
|
+ if(valid){
|
|
524
|
+ for(let i=0;i<this.recordInfo.tableList.length;i++){
|
|
525
|
+ this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
|
|
526
|
+ this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
|
|
527
|
+ this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
|
|
528
|
+ for(let j=0;j<this.manufactuerList.length;j++){
|
|
529
|
+ if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
|
|
530
|
+ this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
|
|
531
|
+ }
|
|
532
|
+ }
|
|
533
|
+ }
|
|
534
|
+ var start = this.getTimes(this.start_time)
|
|
535
|
+ var end = this.getTimes(this.end_time)
|
|
536
|
+ const params = {
|
|
537
|
+ 'stockIn': this.recordInfo.tableList
|
|
538
|
+ }
|
|
539
|
+ updatePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount,this.id,this.number).then(response=>{
|
|
540
|
+ if(response.data.state == 1){
|
|
541
|
+ var warehousingInfo = response.data.data.warehousingInfo
|
|
542
|
+ this.$message.success("修改成功!")
|
|
543
|
+ }
|
|
544
|
+ })
|
|
545
|
+ }
|
|
546
|
+ })
|
|
547
|
+ },
|
|
548
|
+ getAllPrice(){
|
|
549
|
+ console.log("表哥2332323223323223",this.recordInfo.tableList)
|
|
550
|
+ var total_price = 0
|
|
551
|
+ for(let i=0;i<this.recordInfo.tableList.length;i++){
|
|
552
|
+ total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
|
|
553
|
+ }
|
|
554
|
+ return total_price.toFixed(2)
|
|
555
|
+ }
|
407
|
556
|
},
|
408
|
557
|
created(){
|
409
|
558
|
const tempObj = {}
|
|
@@ -412,16 +561,17 @@ created(){
|
412
|
561
|
tempObj['supply_name'] = ""
|
413
|
562
|
tempObj['supply_type'] = ""
|
414
|
563
|
tempObj['supply_specification_name'] = ''
|
415
|
|
- tempObj['supply_total'] = ''
|
416
|
|
- tempObj['supply_count'] = ''
|
417
|
|
- tempObj['supply_price'] = ''
|
418
|
|
- tempObj['supply_total_price'] = ''
|
|
564
|
+ tempObj['supply_total'] = ""
|
|
565
|
+ tempObj['supply_count'] = ""
|
|
566
|
+ tempObj['supply_price'] = ""
|
|
567
|
+ tempObj['supply_total_price'] = ""
|
419
|
568
|
tempObj['supply_manufacturer'] = ''
|
420
|
569
|
tempObj['supply_license_number'] = ''
|
421
|
570
|
tempObj['supply_remake'] = ''
|
422
|
571
|
tempObj['type'] = 0
|
423
|
|
- this.tableList.push(tempObj)
|
424
|
|
- this.getInitOrder()
|
|
572
|
+ tempObj['is_total'] = 1
|
|
573
|
+ this.recordInfo.tableList.push(tempObj)
|
|
574
|
+ this.getInitOrder()
|
425
|
575
|
}
|
426
|
576
|
};
|
427
|
577
|
</script>
|
|
@@ -478,7 +628,7 @@ background-color: #d0d3da;
|
478
|
628
|
}
|
479
|
629
|
.el-table__fixed-right{
|
480
|
630
|
width:150px;
|
481
|
|
- bottom: 20px;
|
482
|
|
- height: 200px;
|
|
631
|
+ bottom: 20px;
|
|
632
|
+ height: 200px;
|
483
|
633
|
}
|
484
|
634
|
</style>
|