Browse Source

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

see999 3 years ago
parent
commit
8064d2a418
1 changed files with 36 additions and 36 deletions
  1. 36 36
      src/xt_pages/supply/components/addPurchaseOrder.vue

+ 36 - 36
src/xt_pages/supply/components/addPurchaseOrder.vue View File

45
             @change="endTimeChange"
45
             @change="endTimeChange"
46
         ></el-date-picker>
46
         ></el-date-picker>
47
         <span>单据编码:</span>
47
         <span>单据编码:</span>
48
-   
48
+
49
     </div>
49
     </div>
50
     <div>
50
     <div>
51
         <el-button size="small" type="primary" @click="savePurchaseOrder" v-show="showTwo">保存</el-button>
51
         <el-button size="small" type="primary" @click="savePurchaseOrder" v-show="showTwo">保存</el-button>
71
             <span>商品<span style="color: red">*</span></span>
71
             <span>商品<span style="color: red">*</span></span>
72
         </template>
72
         </template>
73
         <template slot-scope="scope">
73
         <template slot-scope="scope">
74
-           <el-form-item required prop="name"> 
74
+           <el-form-item required prop="name">
75
             <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)">
75
             <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)">
76
                 <el-option
76
                 <el-option
77
                     v-for="(item,index) in tabList"
77
                     v-for="(item,index) in tabList"
80
                     :value="item">
80
                     :value="item">
81
                 </el-option>
81
                 </el-option>
82
              </el-select>
82
              </el-select>
83
-           </el-form-item> 
83
+           </el-form-item>
84
         </template>
84
         </template>
85
     </el-table-column>
85
     </el-table-column>
86
     <el-table-column  align="center" width="150px">
86
     <el-table-column  align="center" width="150px">
108
         <template slot-scope="scope">
108
         <template slot-scope="scope">
109
           <el-form-item :rules="tableRules.supply_count" required prop="supply_count">
109
           <el-form-item :rules="tableRules.supply_count" required prop="supply_count">
110
           <el-input v-model="scope.row.supply_count" style="width:80px"></el-input>
110
           <el-input v-model="scope.row.supply_count" style="width:80px"></el-input>
111
-          </el-form-item>  
111
+          </el-form-item>
112
         </template>
112
         </template>
113
     </el-table-column>
113
     </el-table-column>
114
 
114
 
123
           {{calculate(scope.row.supply_count * scope.row.supply_price)}}
123
           {{calculate(scope.row.supply_count * scope.row.supply_price)}}
124
         </template>
124
         </template>
125
     </el-table-column>
125
     </el-table-column>
126
-    
126
+
127
     <el-table-column label="生产厂商" align="center" width="200px">
127
     <el-table-column label="生产厂商" align="center" width="200px">
128
         <template slot-scope="scope">
128
         <template slot-scope="scope">
129
         <el-input v-model="scope.row.supply_manufacturer" style="width:160px" :disabled="true"></el-input>
129
         <el-input v-model="scope.row.supply_manufacturer" style="width:160px" :disabled="true"></el-input>
130
         </template>
130
         </template>
131
     </el-table-column>
131
     </el-table-column>
132
-    
132
+
133
 
133
 
134
     <el-table-column label="批准文号" align="center" width="200px">
134
     <el-table-column label="批准文号" align="center" width="200px">
135
         <template slot-scope="scope">
135
         <template slot-scope="scope">
168
 </el-form>
168
 </el-form>
169
    <div style="margin-top:10px">
169
    <div style="margin-top:10px">
170
         <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
170
         <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
171
-        
171
+
172
         <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
172
         <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
173
-        
174
-    </div>  
173
+
174
+    </div>
175
 </div>
175
 </div>
176
 </div>
176
 </div>
177
 </template>
177
 </template>
209
     showTwo:true,
209
     showTwo:true,
210
     showOne:false,
210
     showOne:false,
211
     recordInfo: {
211
     recordInfo: {
212
-      tableList:[],  
212
+      tableList:[],
213
     },
213
     },
214
     keywords: "",
214
     keywords: "",
215
     total: 0,
215
     total: 0,
257
        for(let i=0;i<drugList.length;i++){
257
        for(let i=0;i<drugList.length;i++){
258
           for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
258
           for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
259
             drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
259
             drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
260
-          }   
260
+          }
261
         for(let j=0;j<this.manufactuerList.length;j++){
261
         for(let j=0;j<this.manufactuerList.length;j++){
262
             if(drugList[i].manufacturer == this.manufactuerList[j].id){
262
             if(drugList[i].manufacturer == this.manufactuerList[j].id){
263
                 drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
263
                 drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
264
             }
264
             }
265
-        }  
265
+        }
266
         for(let y=0;y<this.drugTypeList.length;y++){
266
         for(let y=0;y<this.drugTypeList.length;y++){
267
             if(drugList[i].drug_type == this.drugTypeList[y].value){
267
             if(drugList[i].drug_type == this.drugTypeList[y].value){
268
             drugList[i].drug_type = this.drugTypeList[y].name
268
             drugList[i].drug_type = this.drugTypeList[y].name
283
 
283
 
284
         this.tabList.push(drugList[i])
284
         this.tabList.push(drugList[i])
285
         }
285
         }
286
-        
286
+
287
         var goodList =  response.data.data.goodList
287
         var goodList =  response.data.data.goodList
288
         for(let i=0;i<goodList.length;i++){
288
         for(let i=0;i<goodList.length;i++){
289
         for(let j=0;j<this.manufactuerList.length;j++){
289
         for(let j=0;j<this.manufactuerList.length;j++){
290
             if(goodList[i].manufacturer == this.manufactuerList[j].id){
290
             if(goodList[i].manufacturer == this.manufactuerList[j].id){
291
                 goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
291
                 goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
292
             }
292
             }
293
-        }   
293
+        }
294
         for(let y=0;y<this.goodTypeList.length;y++){
294
         for(let y=0;y<this.goodTypeList.length;y++){
295
             if(goodList[i].good_type_id == this.goodTypeList[y].id){
295
             if(goodList[i].good_type_id == this.goodTypeList[y].id){
296
                 goodList[i].good_type_id = this.goodTypeList[y].type_name
296
                 goodList[i].good_type_id = this.goodTypeList[y].type_name
297
             }
297
             }
298
-        } 
298
+        }
299
         goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
299
         goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
300
         goodList[i].supply_type = goodList[i].good_type_id
300
         goodList[i].supply_type = goodList[i].good_type_id
301
         goodList[i].supply_specification_name =goodList[i].specification_name
301
         goodList[i].supply_specification_name =goodList[i].specification_name
306
         goodList[i].supply_manufacturer = goodList[i].manufacturer
306
         goodList[i].supply_manufacturer = goodList[i].manufacturer
307
         goodList[i].supply_license_number = ""
307
         goodList[i].supply_license_number = ""
308
         goodList[i].supply_remake = ""
308
         goodList[i].supply_remake = ""
309
-        goodList[i].type = 2   
309
+        goodList[i].type = 2
310
         goodList[i].name = goodList[i].good_name
310
         goodList[i].name = goodList[i].good_name
311
 
311
 
312
-        this.tabList.push(goodList[i]) 
312
+        this.tabList.push(goodList[i])
313
         }
313
         }
314
     }
314
     }
315
-    })  
315
+    })
316
 },
316
 },
317
 changeGoodName(val){
317
 changeGoodName(val){
318
   this.currentIndex = val
318
   this.currentIndex = val
319
 },
319
 },
320
 changeName(val){
320
 changeName(val){
321
-    
321
+
322
    for(let i=0;i<this.recordInfo.tableList.length;i++){
322
    for(let i=0;i<this.recordInfo.tableList.length;i++){
323
     if(this.currentIndex == i){
323
     if(this.currentIndex == i){
324
         this.recordInfo.tableList[i].id = val.id
324
         this.recordInfo.tableList[i].id = val.id
333
         }else{
333
         }else{
334
           this.recordInfo.tableList[i].supply_count = val.supply_count?val.supply_count:""
334
           this.recordInfo.tableList[i].supply_count = val.supply_count?val.supply_count:""
335
         }
335
         }
336
-       
336
+
337
         this.recordInfo.tableList[i].supply_price = val.supply_price?val.supply_price:""
337
         this.recordInfo.tableList[i].supply_price = val.supply_price?val.supply_price:""
338
         this.recordInfo.tableList[i].supply_total_price = val.supply_total_price?val.supply_total_price:""
338
         this.recordInfo.tableList[i].supply_total_price = val.supply_total_price?val.supply_total_price:""
339
         this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
339
         this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
341
         this.recordInfo.tableList[i].supply_remake = val.supply_remake
341
         this.recordInfo.tableList[i].supply_remake = val.supply_remake
342
      }
342
      }
343
     }
343
     }
344
-    
344
+
345
 },
345
 },
346
 handleEdit(){
346
 handleEdit(){
347
     const tempObj = {}
347
     const tempObj = {}
358
     tempObj['supply_license_number'] = ''
358
     tempObj['supply_license_number'] = ''
359
     tempObj['supply_remake'] = ''
359
     tempObj['supply_remake'] = ''
360
     tempObj['type'] = 0
360
     tempObj['type'] = 0
361
-    this.recordInfo.tableList.push(tempObj)  
361
+    this.recordInfo.tableList.push(tempObj)
362
 },
362
 },
363
 handleDelete: function(index, row) {
363
 handleDelete: function(index, row) {
364
   if (this.recordInfo.tableList.length <= 1) {
364
   if (this.recordInfo.tableList.length <= 1) {
371
 
371
 
372
 
372
 
373
 savePurchaseOrder(){
373
 savePurchaseOrder(){
374
-   console.log("tablelsit323232",this.recordInfo.tableList)
374
+   // console.log("tablelsit323232",this.recordInfo.tableList)
375
    console.log("hhh232323",this.$refs)
375
    console.log("hhh232323",this.$refs)
376
     this.$refs["tableForm"].validate((valid)=>{
376
     this.$refs["tableForm"].validate((valid)=>{
377
       if(valid){
377
       if(valid){
385
         console.log("partam2332232332",params)
385
         console.log("partam2332232332",params)
386
         console.log("tablelsit323232",this.recordInfo.tableList)
386
         console.log("tablelsit323232",this.recordInfo.tableList)
387
         for(let i=0;i<this.recordInfo.tableList.length;i++){
387
         for(let i=0;i<this.recordInfo.tableList.length;i++){
388
-            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count) 
388
+            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
389
             for(let j=0;j<this.manufactuerList.length;j++){
389
             for(let j=0;j<this.manufactuerList.length;j++){
390
                 if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
390
                 if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
391
-                this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id 
391
+                this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
392
                 }
392
                 }
393
 
393
 
394
-            } 
394
+            }
395
         }
395
         }
396
         return
396
         return
397
         savePurchaseOrder(this.recordInfo.tableList,this.supplier_name,this.start_time,this.end_time,this.rate_of_concession,this.discount_amount).then(response=>{
397
         savePurchaseOrder(this.recordInfo.tableList,this.supplier_name,this.start_time,this.end_time,this.rate_of_concession,this.discount_amount).then(response=>{
401
                 this.showTwo = false
401
                 this.showTwo = false
402
                 this.showOne = true
402
                 this.showOne = true
403
             }
403
             }
404
-        }) 
405
-      }  
404
+        })
405
+      }
406
+
407
+   })
406
 
408
 
407
-   })  
408
-   
409
 },
409
 },
410
 
410
 
411
 changeTypeName(){
411
 changeTypeName(){
418
 
418
 
419
 },
419
 },
420
 search(){
420
 search(){
421
-    
421
+
422
 },
422
 },
423
 
423
 
424
 getWarehoseInfo(arr,max_unit,min_unit,min_number){
424
 getWarehoseInfo(arr,max_unit,min_unit,min_number){
446
     }
446
     }
447
   }
447
   }
448
  return max_str + min_str
448
  return max_str + min_str
449
- }, 
449
+ },
450
 getTotalStockCount(arr){
450
 getTotalStockCount(arr){
451
   var total_count = 0
451
   var total_count = 0
452
   for(let i=0;i<arr.length;i++){
452
   for(let i=0;i<arr.length;i++){
482
     tempObj['supply_license_number'] = ''
482
     tempObj['supply_license_number'] = ''
483
     tempObj['supply_remake'] = ''
483
     tempObj['supply_remake'] = ''
484
     tempObj['type'] = 0
484
     tempObj['type'] = 0
485
-    this.recordInfo.tableList.push(tempObj)  
486
-    this.getInitOrder()  
485
+    this.recordInfo.tableList.push(tempObj)
486
+    this.getInitOrder()
487
 }
487
 }
488
 };
488
 };
489
 </script>
489
 </script>
540
 }
540
 }
541
 .el-table__fixed-right{
541
 .el-table__fixed-right{
542
   width:150px;
542
   width:150px;
543
-  bottom: 20px; 
544
-  height: 200px; 
543
+  bottom: 20px;
544
+  height: 200px;
545
 }
545
 }
546
 </style>
546
 </style>