Browse Source

Merge branch 'superman' of http://git.shengws.com/zhangbj/xt_vue into superman

csx 6 years ago
parent
commit
32eb54e74c

+ 2 - 2
config/index.js View File

@@ -17,9 +17,9 @@ module.exports = {
17 17
     // can be overwritten by process.env.HOST
18 18
     // if you want dev by ip, please set host: '0.0.0.0'
19 19
 
20
-    // host: 'xt.test.sgjyun.com',
20
+    host: 'xt.test.sgjyun.com',
21 21
     // host: 'xt.kuyicloud.com',
22
-    host: 'localhost',
22
+    // host: 'localhost',
23 23
     port:9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
24 24
     autoOpenBrowser: true,
25 25
     errorOverlay: true,

File diff suppressed because it is too large
+ 1495 - 248
src/xt_pages/dialysis/dialysisPrintOrder.vue


File diff suppressed because it is too large
+ 1573 - 0
src/xt_pages/dialysis/template/dialysisPrintOrderTwo.vue


+ 0 - 24
src/xt_pages/stock/Dialog/salesReturnDialog.vue View File

@@ -102,37 +102,13 @@
102 102
         this.currentGoodTypeId = currentRow.id
103 103
         this.goodInfoTableData = []
104 104
         this.goodInfo = []
105
-        console.log(this.propForm.manufacturer)
106
-        console.log(this.propForm.dealer)
107 105
         console.log(this.propForm.goodInfo)
108 106
 
109 107
 
110 108
         for (let i = 0; i < this.propForm.goodInfo.length; i++) {
111 109
           if (this.currentGoodTypeId == this.propForm.goodInfo[i].good_type_id) {
112
-            if(this.propForm.dealer == 0 && this.propForm.manufacturer == 0){
113 110
               this.goodInfo.push(this.propForm.goodInfo[i])
114 111
               this.goodInfoTableData.push(this.propForm.goodInfo[i])
115
-
116
-            }else{
117
-              if(this.propForm.manufacturer == 0 && this.propForm.dealer != 0){
118
-                if(this.propForm.goodInfo[i].dealers.id == this.propForm.dealer){
119
-                  this.goodInfo.push(this.propForm.goodInfo[i])
120
-                  this.goodInfoTableData.push(this.propForm.goodInfo[i])
121
-                }
122
-              }
123
-              if(this.propForm.manufacturer != 0 && this.propForm.dealer == 0){
124
-                if(this.propForm.goodInfo[i].manufacturers.id == this.propForm.manufacturer){
125
-                  this.goodInfo.push(this.propForm.goodInfo[i])
126
-                  this.goodInfoTableData.push(this.propForm.goodInfo[i])
127
-                }
128
-              }
129
-              if(this.propForm.manufacturer != 0 && this.propForm.dealer != 0){
130
-                if(this.propForm.goodInfo[i].manufacturers.id == this.propForm.manufacturer && this.propForm.goodInfo[i].dealers.id == this.propForm.dealer){
131
-                  this.goodInfo.push(this.propForm.goodInfo[i])
132
-                  this.goodInfoTableData.push(this.propForm.goodInfo[i])
133
-                }
134
-              }
135
-            }
136 112
           }
137 113
         }
138 114
       },

+ 126 - 40
src/xt_pages/stock/salesReturnEdit.vue View File

@@ -253,11 +253,6 @@
253 253
               }
254 254
             }
255 255
 
256
-            for (let i = 0; i < this.warehouseInfoList.length; i++) {
257
-              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
258
-            }
259
-
260
-
261 256
             for (let i = 0; i < this.warehouseInfoList.length; i++) {
262 257
               this.goodType.push(this.warehouseInfoList[i].info.type)
263 258
             }
@@ -267,7 +262,6 @@
267 262
             const obj2 = {}
268 263
             const obj3 = {}
269 264
 
270
-            const obj4 = {}
271 265
 
272 266
             // 去重复
273 267
             this.manufacturer = this.manufacturer.reduce((cur, next) => {
@@ -285,11 +279,8 @@
285 279
               return cur
286 280
             }, [])
287 281
 
288
-
289
-            this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
290
-              obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
291
-              return cur
292
-            }, [])
282
+            this.manufacturer.splice(0, 0, { id: -1, manufacturer_name: '其他' })
283
+            this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
293 284
             this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
294 285
             this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
295 286
 
@@ -353,52 +344,147 @@
353 344
         this.currentIndex = index
354 345
         this.propForm.goodType = []
355 346
 
347
+        if (this.form.manufacturer == -1 && this.form.dealer == -1) {
348
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
349
+            if (this.warehouseInfoList[i].info.dealers.id == 0 && this.warehouseInfoList[i].info.manufacturers.id == 0) {
350
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
351
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
352
+            }
353
+          }
354
+        }
355
+
356
+        if (this.form.manufacturer == -1 && this.form.dealer == 0) {
357
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
358
+            if (this.warehouseInfoList[i].info.manufacturers.id == 0) {
359
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
360
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
361
+            }
362
+          }
363
+        }
364
+
365
+        if (this.form.manufacturer == -1 && this.form.dealer != 0) {
366
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
367
+            if (this.warehouseInfoList[i].info.manufacturers.id == 0 && this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
368
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
369
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
370
+
371
+            }
372
+          }
373
+        }
356 374
 
357 375
         if (this.form.manufacturer == 0 && this.form.dealer == 0) {
358 376
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
359 377
             this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
360
-          }
361
-          const obj3 = {}
362
-          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
363
-            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
364
-            return cur
365
-          }, [])
366
-        } else {
378
+            this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
367 379
 
380
+          }
381
+        }
368 382
 
369
-          if(this.form.manufacturer == 0 && this.form.dealer != 0){
383
+        if (this.form.manufacturer == 0 && this.form.dealer == -1) {
384
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
385
+            if (this.warehouseInfoList[i].info.dealers.id == 0) {
386
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
387
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
370 388
 
371
-            for (let i = 0; i < this.warehouseInfoList.length; i++) {
372
-              if(this.warehouseInfoList[i].info.dealers.id == this.form.dealer){
373
-                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
374
-              }
375 389
             }
376 390
           }
377
-          if(this.form.manufacturer != 0 && this.form.dealer == 0){
378
-            console.log(this.warehouseInfoList)
391
+        }
379 392
 
380
-            for (let i = 0; i < this.warehouseInfoList.length; i++) {
381
-              if(this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer){
382
-                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
383
-              }
384
-            }
393
+        if (this.form.manufacturer != 0 && this.form.dealer == -1) {
394
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
395
+            if (this.warehouseInfoList[i].info.dealers.id == 0 && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
396
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
397
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
385 398
 
399
+            }
386 400
           }
387
-          if(this.form.manufacturer != 0 && this.form.dealer != 0){
401
+        }
402
+
403
+        if (this.form.manufacturer != 0 && this.form.dealer != 0) {
404
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
405
+            if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer && this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
406
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
407
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
388 408
 
389
-            for (let i = 0; i < this.warehouseInfoList.length; i++) {
390
-              if(this.warehouseInfoList[i].info.dealers.id == this.form.dealer && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer){
391
-                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
392
-              }
393 409
             }
410
+          }
411
+        }
412
+
413
+        if (this.form.manufacturer == 0 && this.form.dealer != 0) {
414
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
415
+            if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
416
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
417
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
394 418
 
419
+            }
395 420
           }
396
-          const obj3 = {}
397
-          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
398
-            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
399
-            return cur
400
-          }, [])
401 421
         }
422
+        if (this.form.manufacturer != 0 && this.form.dealer == 0) {
423
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
424
+            if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
425
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
426
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
427
+            }
428
+          }
429
+        }
430
+
431
+        const obj3 = {}
432
+        this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
433
+          obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
434
+          return cur
435
+        }, [])
436
+        const obj4 = {}
437
+        this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
438
+          obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
439
+          return cur
440
+        }, [])
441
+
442
+
443
+        // if (this.form.manufacturer == 0 && this.form.dealer == 0) {
444
+        //   for (let i = 0; i < this.warehouseInfoList.length; i++) {
445
+        //     this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
446
+        //   }
447
+        //   const obj3 = {}
448
+        //   this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
449
+        //     obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
450
+        //     return cur
451
+        //   }, [])
452
+        // } else {
453
+        //
454
+        //
455
+        //   if(this.form.manufacturer == 0 && this.form.dealer != 0){
456
+        //
457
+        //     for (let i = 0; i < this.warehouseInfoList.length; i++) {
458
+        //       if(this.warehouseInfoList[i].info.dealers.id == this.form.dealer){
459
+        //         this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
460
+        //       }
461
+        //     }
462
+        //   }
463
+        //   if(this.form.manufacturer != 0 && this.form.dealer == 0){
464
+        //     console.log(this.warehouseInfoList)
465
+        //
466
+        //     for (let i = 0; i < this.warehouseInfoList.length; i++) {
467
+        //       if(this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer){
468
+        //         this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
469
+        //       }
470
+        //     }
471
+        //
472
+        //   }
473
+        //   if(this.form.manufacturer != 0 && this.form.dealer != 0){
474
+        //
475
+        //     for (let i = 0; i < this.warehouseInfoList.length; i++) {
476
+        //       if(this.warehouseInfoList[i].info.dealers.id == this.form.dealer && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer){
477
+        //         this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
478
+        //       }
479
+        //     }
480
+        //
481
+        //   }
482
+        //   const obj3 = {}
483
+        //   this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
484
+        //     obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
485
+        //     return cur
486
+        //   }, [])
487
+        // }
402 488
         this.$refs.dialog.show()
403 489
 
404 490
 

+ 91 - 50
src/xt_pages/stock/salesReturnOrderAdd.vue View File

@@ -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
       }

+ 12 - 11
src/xt_pages/stock/stockInOrderAdd.vue View File

@@ -26,32 +26,31 @@
26 26
       </div>
27 27
 
28 28
       <div class="cell clearfix">
29
-        <label class="title"><span class="name">厂商</span> : </label>
30
-
31
-        <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商"
32
-                   @change="changeManufacturer">
29
+        <label class="title"><span class="name">经销商</span> : </label>
30
+        <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
33 31
           <el-option
34
-            v-for="(option, index) in manufacturer"
32
+            v-for="(option, index) in dealer"
35 33
             :key="index"
36
-            :label="option.manufacturer_name"
34
+            :label="option.dealer_name"
37 35
             :value="option.id">
38 36
           </el-option>
39 37
         </el-select>
40 38
       </div>
41 39
 
42 40
       <div class="cell clearfix">
43
-        <label class="title"><span class="name">经销商</span> : </label>
44
-        <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
41
+        <label class="title"><span class="name">厂商</span> : </label>
42
+
43
+        <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商"
44
+                   @change="changeManufacturer">
45 45
           <el-option
46
-            v-for="(option, index) in dealer"
46
+            v-for="(option, index) in manufacturer"
47 47
             :key="index"
48
-            :label="option.dealer_name"
48
+            :label="option.manufacturer_name"
49 49
             :value="option.id">
50 50
           </el-option>
51 51
         </el-select>
52 52
       </div>
53 53
 
54
-
55 54
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
56 55
         <el-table id="oictable" :data="recordInfo.recordData" :class="signAndWeighBoxPatients" border
57 56
                   style="width: 100%"
@@ -414,6 +413,8 @@
414 413
             this.goodInfo = response.data.data.goodInfo
415 414
             this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
416 415
             this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
416
+            this.manufacturer.splice(0, 0, { id: -1, manufacturer_name: '其他' })
417
+            this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
417 418
             this.form.manufacturer = 0
418 419
             this.form.dealer = 0
419 420
           }

+ 123 - 35
src/xt_pages/stock/stockOutOrderAdd.vue View File

@@ -282,14 +282,10 @@
282 282
               this.goodType.push(this.warehouseInfoList[i].info.type)
283 283
             }
284 284
 
285
-            for (let i = 0; i < this.warehouseInfoList.length; i++) {
286
-              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
287
-            }
285
+
288 286
             const obj = {}
289 287
             const obj2 = {}
290 288
             const obj3 = {}
291
-
292
-            const obj4 = {}
293 289
             // 去重复
294 290
             this.manufacturer = this.manufacturer.reduce((cur, next) => {
295 291
               obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
@@ -300,10 +296,6 @@
300 296
               obj2[next.id] ? '' : obj2[next.id] = true && cur.push(next)
301 297
               return cur
302 298
             }, [])
303
-            this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
304
-              obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
305
-              return cur
306
-            }, [])
307 299
 
308 300
             this.goodType = this.goodType.reduce((cur, next) => {
309 301
               obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
@@ -364,43 +356,139 @@
364 356
       }, showDialog(index, row) {
365 357
         this.currentIndex = index
366 358
         this.propForm.goodType = []
359
+        if (this.form.manufacturer == -1 && this.form.dealer == -1) {
360
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
361
+            if (this.warehouseInfoList[i].info.dealers.id == 0 && this.warehouseInfoList[i].info.manufacturers.id == 0) {
362
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
363
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
364
+            }
365
+          }
366
+        }
367
+
368
+        if (this.form.manufacturer == -1 && this.form.dealer == 0) {
369
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
370
+            if (this.warehouseInfoList[i].info.manufacturers.id == 0) {
371
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
372
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
373
+            }
374
+          }
375
+        }
376
+
377
+        if (this.form.manufacturer == -1 && this.form.dealer != 0) {
378
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
379
+            if (this.warehouseInfoList[i].info.manufacturers.id == 0 && this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
380
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
381
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
382
+
383
+            }
384
+          }
385
+        }
386
+
367 387
         if (this.form.manufacturer == 0 && this.form.dealer == 0) {
368 388
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
369 389
             this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
390
+            this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
391
+
370 392
           }
371
-          const obj3 = {}
372
-          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
373
-            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
374
-            return cur
375
-          }, [])
376
-        } else {
377
-          if (this.form.manufacturer == 0 && this.form.dealer != 0) {
378
-            for (let i = 0; i < this.warehouseInfoList.length; i++) {
379
-              if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
380
-                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
381
-              }
393
+        }
394
+
395
+        if (this.form.manufacturer == 0 && this.form.dealer == -1) {
396
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
397
+            if (this.warehouseInfoList[i].info.dealers.id == 0) {
398
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
399
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
400
+
382 401
             }
383 402
           }
384
-          if (this.form.manufacturer != 0 && this.form.dealer == 0) {
385
-            for (let i = 0; i < this.warehouseInfoList.length; i++) {
386
-              if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
387
-                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
388
-              }
403
+        }
404
+
405
+        if (this.form.manufacturer != 0 && this.form.dealer == -1) {
406
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
407
+            if (this.warehouseInfoList[i].info.dealers.id == 0 && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
408
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
409
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
410
+
389 411
             }
390 412
           }
391
-          if (this.form.manufacturer != 0 && this.form.dealer != 0) {
392
-            for (let i = 0; i < this.warehouseInfoList.length; i++) {
393
-              if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
394
-                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
395
-              }
413
+        }
414
+
415
+        if (this.form.manufacturer != 0 && this.form.dealer != 0) {
416
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
417
+            if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer && this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
418
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
419
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
420
+
396 421
             }
397 422
           }
398
-          const obj3 = {}
399
-          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
400
-            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
401
-            return cur
402
-          }, [])
403 423
         }
424
+
425
+        if (this.form.manufacturer == 0 && this.form.dealer != 0) {
426
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
427
+            if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
428
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
429
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
430
+
431
+            }
432
+          }
433
+        }
434
+        if (this.form.manufacturer != 0 && this.form.dealer == 0) {
435
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
436
+            if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
437
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
438
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
439
+            }
440
+          }
441
+        }
442
+
443
+        const obj3 = {}
444
+        this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
445
+          obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
446
+          return cur
447
+        }, [])
448
+        const obj4 = {}
449
+        this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
450
+          obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
451
+          return cur
452
+        }, [])
453
+
454
+
455
+        // if (this.form.manufacturer == 0 && this.form.dealer == 0) {
456
+        //   for (let i = 0; i < this.warehouseInfoList.length; i++) {
457
+        //     this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
458
+        //   }
459
+        //   const obj3 = {}
460
+        //   this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
461
+        //     obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
462
+        //     return cur
463
+        //   }, [])
464
+        // } else {
465
+        //   if (this.form.manufacturer == 0 && this.form.dealer != 0) {
466
+        //     for (let i = 0; i < this.warehouseInfoList.length; i++) {
467
+        //       if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
468
+        //         this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
469
+        //       }
470
+        //     }
471
+        //   }
472
+        //   if (this.form.manufacturer != 0 && this.form.dealer == 0) {
473
+        //     for (let i = 0; i < this.warehouseInfoList.length; i++) {
474
+        //       if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
475
+        //         this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
476
+        //       }
477
+        //     }
478
+        //   }
479
+        //   if (this.form.manufacturer != 0 && this.form.dealer != 0) {
480
+        //     for (let i = 0; i < this.warehouseInfoList.length; i++) {
481
+        //       if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
482
+        //         this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
483
+        //       }
484
+        //     }
485
+        //   }
486
+        //   const obj3 = {}
487
+        //   this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
488
+        //     obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
489
+        //     return cur
490
+        //   }, [])
491
+        // }
404 492
         this.$refs.dialog.show()
405 493
 
406 494
       }, back() {