|
@@ -18,7 +18,8 @@
|
18
|
18
|
v-on:dialog-cancle="cancle"></sales-return-dialog>
|
19
|
19
|
<div class="cell clearfix">
|
20
|
20
|
<label class="title"><span class="name">退货时间</span> : </label>
|
21
|
|
- <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
|
|
21
|
+ <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false"
|
|
22
|
+ style="width: 196px;"
|
22
|
23
|
type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
|
23
|
24
|
value-format="yyyy-MM-dd"></el-date-picker>
|
24
|
25
|
</div>
|
|
@@ -49,10 +50,9 @@
|
49
|
50
|
</div>
|
50
|
51
|
|
51
|
52
|
|
52
|
|
-
|
53
|
53
|
<el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
|
54
|
54
|
<el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
|
55
|
|
- max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
|
|
55
|
+ max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
|
56
|
56
|
>
|
57
|
57
|
|
58
|
58
|
|
|
@@ -97,7 +97,7 @@
|
97
|
97
|
<template slot-scope="scope">
|
98
|
98
|
<el-form-item :prop="'recordData.' + scope.$index + '.return_count'" :rules='tableRules.return_count'
|
99
|
99
|
style="padding-top: 17px">
|
100
|
|
- <el-input placeholder="请输入退货数量" type="number" v-model="scope.row.return_count"></el-input>
|
|
100
|
+ <el-input placeholder="请输入退货数量" type="number" v-model="scope.row.return_count"></el-input>
|
101
|
101
|
</el-form-item>
|
102
|
102
|
</template>
|
103
|
103
|
</el-table-column>
|
|
@@ -130,7 +130,7 @@
|
130
|
130
|
</el-table>
|
131
|
131
|
</el-form>
|
132
|
132
|
|
133
|
|
- </div>
|
|
133
|
+ </div>
|
134
|
134
|
</div>
|
135
|
135
|
|
136
|
136
|
</template>
|
|
@@ -158,7 +158,6 @@
|
158
|
158
|
{ path: false, name: '新增退货单' }
|
159
|
159
|
],
|
160
|
160
|
|
161
|
|
-
|
162
|
161
|
type: this.$route.query.type,
|
163
|
162
|
signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
|
164
|
163
|
return_time: '',
|
|
@@ -175,22 +174,20 @@
|
175
|
174
|
]
|
176
|
175
|
},
|
177
|
176
|
|
178
|
|
-
|
179
|
|
-
|
180
|
177
|
// prop
|
181
|
178
|
isVisibility: false,
|
182
|
179
|
propForm: {
|
183
|
180
|
goodType: [],
|
184
|
181
|
goodInfo: [],
|
185
|
182
|
goodUnit: [],
|
186
|
|
- manufacturer:0,
|
187
|
|
- dealer:0,
|
|
183
|
+ manufacturer: 0,
|
|
184
|
+ dealer: 0
|
188
|
185
|
},
|
189
|
186
|
form: {
|
190
|
187
|
manufacturer: 0,
|
191
|
|
- dealer: 0,
|
|
188
|
+ dealer: 0
|
192
|
189
|
},
|
193
|
|
- warehouseInfoList:[],
|
|
190
|
+ warehouseInfoList: [],
|
194
|
191
|
manufacturer: [],
|
195
|
192
|
dealer: [],
|
196
|
193
|
goodType: []
|
|
@@ -250,16 +247,12 @@
|
250
|
247
|
}
|
251
|
248
|
}
|
252
|
249
|
|
253
|
|
- for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
254
|
|
- this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
|
255
|
|
- }
|
256
|
250
|
for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
257
|
251
|
this.goodType.push(this.warehouseInfoList[i].info.type)
|
258
|
252
|
}
|
259
|
253
|
const obj = {}
|
260
|
254
|
const obj2 = {}
|
261
|
255
|
const obj3 = {}
|
262
|
|
- const obj4 = {}
|
263
|
256
|
// 去重复
|
264
|
257
|
this.manufacturer = this.manufacturer.reduce((cur, next) => {
|
265
|
258
|
obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
|
|
@@ -275,11 +268,8 @@
|
275
|
268
|
obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
|
276
|
269
|
return cur
|
277
|
270
|
}, [])
|
278
|
|
-
|
279
|
|
- this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
|
280
|
|
- obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
|
281
|
|
- return cur
|
282
|
|
- }, [])
|
|
271
|
+ this.manufacturer.splice(0, 0, { id: -1, manufacturer_name: '其他' })
|
|
272
|
+ this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
|
283
|
273
|
this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
|
284
|
274
|
this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
|
285
|
275
|
|
|
@@ -331,52 +321,103 @@
|
331
|
321
|
}, showDialog(index, row) {
|
332
|
322
|
this.currentIndex = index
|
333
|
323
|
this.propForm.goodType = []
|
|
324
|
+ //根据选择经销商和厂商过滤商品类型
|
334
|
325
|
|
335
|
|
- if (this.form.manufacturer == 0 && this.form.dealer == 0) {
|
|
326
|
+ if (this.form.manufacturer == -1 && this.form.dealer == -1) {
|
336
|
327
|
for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
|
328
|
+ if (this.warehouseInfoList[i].info.dealers.id == 0 && this.warehouseInfoList[i].info.manufacturers.id == 0) {
|
337
|
329
|
this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
|
|
330
|
+ this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
|
|
331
|
+ }
|
338
|
332
|
}
|
339
|
|
- const obj3 = {}
|
340
|
|
- this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
|
341
|
|
- obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
|
342
|
|
- return cur
|
343
|
|
- }, [])
|
344
|
|
- } else {
|
|
333
|
+ }
|
345
|
334
|
|
|
335
|
+ if (this.form.manufacturer == -1 && this.form.dealer == 0) {
|
|
336
|
+ for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
|
337
|
+ if (this.warehouseInfoList[i].info.manufacturers.id == 0) {
|
|
338
|
+ this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
|
|
339
|
+ this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
|
|
340
|
+ }
|
|
341
|
+ }
|
|
342
|
+ }
|
346
|
343
|
|
347
|
|
- if(this.form.manufacturer == 0 && this.form.dealer != 0){
|
|
344
|
+ if (this.form.manufacturer == -1 && this.form.dealer != 0) {
|
|
345
|
+ for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
|
346
|
+ if (this.warehouseInfoList[i].info.manufacturers.id == 0 && this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
|
|
347
|
+ this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
|
|
348
|
+ this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
|
348
|
349
|
|
349
|
|
- for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
350
|
|
- if(this.warehouseInfoList[i].info.dealers.id == this.form.dealer){
|
351
|
|
- this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
|
352
|
|
- }
|
353
|
350
|
}
|
354
|
351
|
}
|
355
|
|
- if(this.form.manufacturer != 0 && this.form.dealer == 0){
|
356
|
|
- console.log(this.warehouseInfoList)
|
|
352
|
+ }
|
|
353
|
+
|
|
354
|
+ if (this.form.manufacturer == 0 && this.form.dealer == 0) {
|
|
355
|
+ for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
|
356
|
+ this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
|
|
357
|
+ this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
|
|
358
|
+
|
|
359
|
+ }
|
|
360
|
+ }
|
|
361
|
+
|
|
362
|
+ if (this.form.manufacturer == 0 && this.form.dealer == -1) {
|
|
363
|
+ for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
|
364
|
+ if (this.warehouseInfoList[i].info.dealers.id == 0) {
|
|
365
|
+ this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
|
|
366
|
+ this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
|
357
|
367
|
|
358
|
|
- for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
359
|
|
- if(this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer){
|
360
|
|
- this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
|
361
|
|
- }
|
362
|
368
|
}
|
|
369
|
+ }
|
|
370
|
+ }
|
|
371
|
+
|
|
372
|
+ if (this.form.manufacturer != 0 && this.form.dealer == -1) {
|
|
373
|
+ for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
|
374
|
+ if (this.warehouseInfoList[i].info.dealers.id == 0 && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
|
|
375
|
+ this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
|
|
376
|
+ this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
|
363
|
377
|
|
|
378
|
+ }
|
364
|
379
|
}
|
365
|
|
- if(this.form.manufacturer != 0 && this.form.dealer != 0){
|
|
380
|
+ }
|
|
381
|
+
|
|
382
|
+ if (this.form.manufacturer != 0 && this.form.dealer != 0) {
|
|
383
|
+ for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
|
384
|
+ if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer && this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
|
|
385
|
+ this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
|
|
386
|
+ this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
|
366
|
387
|
|
367
|
|
- for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
368
|
|
- if(this.warehouseInfoList[i].info.dealers.id == this.form.dealer && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer){
|
369
|
|
- this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
|
370
|
|
- }
|
371
|
388
|
}
|
|
389
|
+ }
|
|
390
|
+ }
|
372
|
391
|
|
|
392
|
+ if (this.form.manufacturer == 0 && this.form.dealer != 0) {
|
|
393
|
+ for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
|
394
|
+ if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
|
|
395
|
+ this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
|
|
396
|
+ this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
|
|
397
|
+
|
|
398
|
+ }
|
373
|
399
|
}
|
374
|
|
- const obj3 = {}
|
375
|
|
- this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
|
376
|
|
- obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
|
377
|
|
- return cur
|
378
|
|
- }, [])
|
379
|
400
|
}
|
|
401
|
+ if (this.form.manufacturer != 0 && this.form.dealer == 0) {
|
|
402
|
+ for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
|
403
|
+ if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
|
|
404
|
+ this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
|
|
405
|
+ this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
|
|
406
|
+ }
|
|
407
|
+ }
|
|
408
|
+ }
|
|
409
|
+
|
|
410
|
+ const obj3 = {}
|
|
411
|
+ this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
|
|
412
|
+ obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
|
|
413
|
+ return cur
|
|
414
|
+ }, [])
|
|
415
|
+ const obj4 = {}
|
|
416
|
+ this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
|
|
417
|
+ obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
|
|
418
|
+ return cur
|
|
419
|
+ }, [])
|
|
420
|
+
|
380
|
421
|
this.$refs.dialog.show()
|
381
|
422
|
}, back() {
|
382
|
423
|
this.$router.go(-1)
|
|
@@ -417,7 +458,7 @@
|
417
|
458
|
}, changeManufacturer(val) {
|
418
|
459
|
this.propForm.manufacturer = val
|
419
|
460
|
console.log(val)
|
420
|
|
- },changeDealer(val){
|
|
461
|
+ }, changeDealer(val) {
|
421
|
462
|
this.propForm.dealer = val
|
422
|
463
|
console.log(val)
|
423
|
464
|
}
|