Parcourir la source

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

see999 il y a 3 ans
Parent
révision
ddd2cd579a

+ 2 - 2
config/dev.env.js Voir le fichier

@@ -7,8 +7,8 @@ module.exports = {
7 7
   NODE_ENV: '"development"',
8 8
   ENV_CONFIG: '"dev"',
9 9
   //BASE_API: '"http://new_mobile.xt.api.sgjyun.com"', // //http://api.xt.test.sgjyun.com http://112.74.16.180:9527,////'"http://localhost:9529"',
10
-  // BASE_API: '"http://api.xt.test.sgjyun.com"',
11
-  BASE_API: '"http://localhost:9529"',
10
+  BASE_API: '"http://api.xt.test.sgjyun.com"',
11
+  // BASE_API: '"http://localhost:9529"',
12 12
   SSO_HOST: '"http://testsso.sgjyun.com"',
13 13
   SRCM_HOST: '"http://test1.sgjyun.com"',
14 14
   XT_HOST: '"http://xt.test.sgjyun.com"',

+ 87 - 50
src/api/supply.js Voir le fichier

@@ -157,56 +157,58 @@ export function getAllGoodReturnOrderList(params) {
157 157
     url: '/api/supply/getallgoodreturnorderlist',
158 158
     method: 'get',
159 159
     params: params
160
-  })}
161
-
162
-
163
-  export function getSupplierId(params) {
164
-    return request({
165
-      url: '/api/supply/getsupplycode',
166
-      method: 'get',
167
-      params: params
168
-    })
169
-  }
170
-
171
-  export function getsupplytype(params) {
172
-    return request({
173
-      url: '/api/supply/getsupplytype',
174
-      method: 'get',
175
-      params: params
176
-    })
177
-  }
178
-
179
-  export function getGoodReturnDetail(id, params) {
180
-    return request({
181
-      url: '/api/supply/getgoodreturndetail?id=' + id,
182
-      method: 'get',
183
-      params: params
184
-    })}
185
-
186
-
187
-    export function getexporthistory(params) {
188
-      return request({
189
-        url: '/api/supply/getsupplylist',
190
-        method: 'get',
191
-        params: params
192
-      })
193
-    }
194
-
195
-    export function delsupplys(id, data) {
196
-      return request({
197
-        url: '/api/supply/delsupply?id=' + id,
198
-        method: 'post',
199
-        data: data
200
-      })
201
-    }
202
-
203
-    export function getsupplyandcontactone(params) {
204
-      return request({
205
-        url: '/api/supply/getsupplyandcontactone',
206
-        method: 'get',
207
-        params: params
208
-      })
209
-    }
160
+  })
161
+}
162
+
163
+
164
+export function getSupplierId(params) {
165
+  return request({
166
+    url: '/api/supply/getsupplycode',
167
+    method: 'get',
168
+    params: params
169
+  })
170
+}
171
+
172
+export function getsupplytype(params) {
173
+  return request({
174
+    url: '/api/supply/getsupplytype',
175
+    method: 'get',
176
+    params: params
177
+  })
178
+}
179
+
180
+export function getGoodReturnDetail(id, params) {
181
+  return request({
182
+    url: '/api/supply/getgoodreturndetail?id=' + id,
183
+    method: 'get',
184
+    params: params
185
+  })
186
+}
187
+
188
+
189
+export function getexporthistory(params) {
190
+  return request({
191
+    url: '/api/supply/getsupplylist',
192
+    method: 'get',
193
+    params: params
194
+  })
195
+}
196
+
197
+export function delsupplys(id, data) {
198
+  return request({
199
+    url: '/api/supply/delsupply?id=' + id,
200
+    method: 'post',
201
+    data: data
202
+  })
203
+}
204
+
205
+export function getsupplyandcontactone(params) {
206
+  return request({
207
+    url: '/api/supply/getsupplyandcontactone',
208
+    method: 'get',
209
+    params: params
210
+  })
211
+}
210 212
 
211 213
 export function updateGoodReturn(data, warehouse_out_id, start_time, rate_of_concession, discount_amount, arrearage, payment, supplier_id, return_number) {
212 214
   return request({
@@ -239,3 +241,38 @@ export function deleteGoodOrder(id, params) {
239 241
     params: params
240 242
   })
241 243
 }
244
+
245
+export function getSupplyWarehouseOutById(id, params) {
246
+  return request({
247
+    url: '/api/supply/getsupplywarehouseoutbyid?id=' + id,
248
+    method: 'get',
249
+    params: params
250
+  })
251
+}
252
+
253
+export function delcontactone(params) {
254
+  return request({
255
+    url: '/api/supply/delcontactone',
256
+    method: 'get',
257
+    params: params
258
+  })
259
+}
260
+
261
+export function savesupply(data) {
262
+  return request({
263
+    url: '/api/supply/savesupply',
264
+    method: 'post',
265
+    data: data
266
+  })
267
+}
268
+
269
+export function updatesupply(data) {
270
+  return request({
271
+    url: '/api/supply/updatesupply',
272
+    method: 'post',
273
+    data: data
274
+  })
275
+}
276
+
277
+
278
+

+ 3 - 3
src/views/layout/Layout.vue Voir le fichier

@@ -16,10 +16,10 @@
16 16
           <i class="iconfont icon-computer_fill navIcon"></i>
17 17
           <p>透析管理</p>
18 18
         </div>
19
-        <div v-if="caigouShow" :class="index == 5 ? 'navOne navActive' : 'navOne'" @click="clickActive(5,'采购管理')">
20
-          <i class="iconfont icon-kccx navIcon"></i>
19
+        <!-- <div v-if="caigouShow" :class="index == 5 ? 'navOne navActive' : 'navOne'" @click="clickActive(5,'采购管理')">
20
+         <i class="iconfont icon-kccx navIcon"></i>
21 21
           <p>采购管理</p>
22
-        </div>
22
+        </div> -->
23 23
         <div v-if="kucunShow" :class="index == 3 ? 'navOne navActive' : 'navOne'" @click="clickActive(3,'库房管理')">
24 24
           <i class="iconfont icon-kccx navIcon"></i>
25 25
           <p>库房管理</p>

+ 8 - 7
src/xt_pages/data/components/addDrugs.vue Voir le fichier

@@ -354,7 +354,7 @@
354 354
                             </el-date-picker>
355 355
                         </el-form-item>
356 356
                       
357
-                        <!-- <el-form-item label="是否零用:">
357
+                        <el-form-item label="是否零用:">
358 358
 
359 359
                             <el-select v-model="form.is_user" style="width:160px" filterable placeholder="请选择">
360 360
                                 <el-option
@@ -364,7 +364,7 @@
364 364
                                         :value="item.id">
365 365
                                 </el-option>
366 366
                             </el-select>
367
-                        </el-form-item> -->
367
+                        </el-form-item>
368 368
                       
369 369
 
370 370
                         <el-form-item label="药品备注:">
@@ -595,7 +595,7 @@
595 595
           prescribing_number_unit:"",
596 596
           total:"",
597 597
           specification_name:"",
598
-          is_user:2,
598
+          is_user:"2",
599 599
         },
600 600
 
601 601
         rules: {
@@ -648,11 +648,11 @@
648 648
         minNumberShow:false,
649 649
         packingUnit:[],
650 650
         userList: [{
651
-          id: '1',
652
-          name: '是'
651
+          id: "1",
652
+          name: "是"
653 653
         }, {
654
-          id: '2',
655
-          name: '否'
654
+          id: "2",
655
+          name: "否"
656 656
         }],
657 657
       }
658 658
     },
@@ -781,6 +781,7 @@
781 781
           }
782 782
 
783 783
           this.form['lmt_used_flag'] = 0
784
+          this.form['is_user'] = "2"
784 785
 
785 786
         } else {
786 787
           for (let key in obj) {

+ 75 - 76
src/xt_pages/supply/components/addGoodOrder.vue Voir le fichier

@@ -7,8 +7,7 @@
7 7
     <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8 8
     <div>
9 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">
10
+        <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择">
12 11
         <el-option
13 12
             v-for="item in supplyList"
14 13
             :key="item.id"
@@ -28,7 +27,6 @@
28 27
         align="right"
29 28
         format="yyyy-MM-dd"
30 29
         value-format="yyyy-MM-dd"
31
-        @change="startTimeChange"
32 30
         ></el-date-picker>
33 31
         <!-- <span>交货日期:</span> -->
34 32
         <!-- <el-date-picker
@@ -52,7 +50,7 @@
52 50
          <el-button size="small" type="primary" @click="updateGoodOrder" v-show="showTwo">保存</el-button>
53 51
         <el-button size="small" type="primary"  @click="checkPurchaseOrder">审核</el-button>
54 52
 
55
-       
53
+
56 54
     </div>
57 55
     </div>
58 56
 
@@ -75,7 +73,7 @@
75 73
         </template>
76 74
         <template slot-scope="scope">
77 75
            <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
78
-            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)" :disabled="disabled">
76
+            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择商品" @change="changeName"   @input="changeGoodName(scope.$index)" :disabled="disabled">
79 77
                 <el-option
80 78
                     v-for="(item,index) in tabList"
81 79
                     :key="index"
@@ -91,13 +89,13 @@
91 89
             <span>商品类别</span>
92 90
         </template>
93 91
         <template slot-scope="scope">
94
-            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
92
+            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"  placeholder="商品类别"></el-input>
95 93
             <div style="visibility: hidden">/</div>
96 94
         </template>
97 95
     </el-table-column>
98
-    <el-table-column label="规格&单位" align="center" width="120px">
96
+    <el-table-column label="规格&单位" align="center" width="150px">
99 97
         <template slot-scope="scope">
100
-            <el-input v-model="scope.row.supply_specification_name" style="width:100px" :disabled="true"></el-input>
98
+            <el-input v-model="scope.row.supply_specification_name" style="width:120px" :disabled="true" placeholder="规格&单位"></el-input>
101 99
             <div style="visibility: hidden">/</div>
102 100
         </template>
103 101
     </el-table-column>
@@ -115,16 +113,16 @@
115 113
                         :value="item.name">
116 114
                     </el-option>
117 115
              </el-select>
118
-          </el-form-item>  
116
+          </el-form-item>
119 117
         </template>
120 118
     </el-table-column>
121
-    <el-table-column label="批号" align="center" width="130px">
119
+    <el-table-column label="批号" align="center" width="200px">
122 120
          <template slot="header" slot-scope="scope">
123 121
             <span>批号<span style="color: red">*</span></span>
124 122
         </template>
125 123
         <template slot-scope="scope">
126 124
            <el-form-item  :prop="'tableList.' + scope.$index + '.supply_batch_number'" :rules='tableRules.supply_batch_number'>
127
-             <el-input v-model="scope.row.supply_batch_number" style="width:80px" :disabled="disabled"></el-input>
125
+             <el-input v-model="scope.row.supply_batch_number" style="width:180px" :disabled="disabled" placeholder="请输入批号"></el-input>
128 126
           </el-form-item>
129 127
         </template>
130 128
     </el-table-column>
@@ -142,26 +140,26 @@
142 140
              </el-form-item>
143 141
        </template>
144 142
     </el-table-column>
145
-    <el-table-column label="可用库存" align="center" width="100px">
143
+    <el-table-column label="可用库存" align="center" width="150px">
146 144
         <template slot-scope="scope">
147
-            <el-input v-model="scope.row.supply_total" style="width:80px" :disabled="true"></el-input>
145
+            <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
148 146
             <div style="visibility: hidden">/</div>
149 147
         </template>
150 148
     </el-table-column>
151
-    <el-table-column label="数量" align="center" width="120px">
149
+    <el-table-column label="数量" align="center" width="140px">
152 150
         <template slot="header" slot-scope="scope">
153 151
             <span>数量<span style="color: red">*</span></span>
154 152
         </template>
155 153
         <template slot-scope="scope">
156 154
           <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
157
-             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
155
+             <el-input v-model="scope.row.supply_count" style="width:100px" :disabled="disabled" placeholder="请输入数量"></el-input>
158 156
           </el-form-item>
159 157
         </template>
160 158
     </el-table-column>
161 159
 
162
-    <el-table-column label="采购单价" align="center" width="120px">
160
+    <el-table-column label="采购单价" align="center" width="180px">
163 161
         <template slot-scope="scope">
164
-        <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
162
+        <el-input v-model="scope.row.supply_price" style="width:140px" :disabled="disabled"  placeholder="请输入采购单价"></el-input>
165 163
         <div style="visibility: hidden">/</div>
166 164
         </template>
167 165
     </el-table-column>
@@ -216,7 +214,7 @@
216 214
 
217 215
     <el-table-column label="备注" align="center" width="200px">
218 216
         <template slot-scope="scope">
219
-        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
217
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled" placeholder="请输入备注"></el-input>
220 218
         <div style="visibility: hidden">/</div>
221 219
         </template>
222 220
     </el-table-column>
@@ -243,17 +241,28 @@
243 241
         </template>
244 242
     </el-table-column>
245 243
   </el-table>
244
+   <div style="margin-top: 10px">
245
+        <el-input
246
+          type="textarea"
247
+          :rows="2"
248
+          placeholder="备注信息"
249
+          v-model="return_remark"
250
+        >
251
+        </el-input>
252
+   </div>
246 253
 </el-form>
247 254
    <!-- <div style="margin-top:10px">
248 255
       合计:{{getAllPrice()}} 元
249 256
    </div>
250 257
    <div style="margin-top:10px">
251
-        <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
258
+        <span>优惠率:<el-input style="width:150px" v-model="rate_of_concession" placeholder="请输入优惠率"></el-input>%</span>
252 259
 
253
-        <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
254
-      
255
-        <span>本次付款:<el-input style="width:100px" v-model="payment"></el-input></span>
260
+        <span>优惠金额:<el-input style="width:150px" v-model="discount_amount" placeholder="请输入优惠金额"></el-input></span>
256 261
 
262
+        <span>本次付款:<el-input style="width:150px" v-model="payment" placeholder="请输入本次付款"></el-input></span>
263
+
264
+        <span>本次欠款:<el-input style="width:150px" v-model="arrearage" placeholder="请输入本次欠款"></el-input></span>
265
+    </div>
257 266
         <span>本次欠款:<el-input style="width:100px" v-model="arrearage"></el-input></span>
258 267
     </div> -->
259 268
     <Computed :total="total_price" :rate_of_concession="rate_of_concession" :discount_amount="discount_amount"></Computed>
@@ -346,6 +355,7 @@ return {
346 355
    showOne:true,
347 356
    showTwo:false,
348 357
    warese_out_id:0,
358
+   return_remark:"",
349 359
   };
350 360
 },
351 361
 methods:{
@@ -392,8 +402,8 @@ getInitOrder(){
392 402
         if(drugList[i].max_unit == drugList[i].min_unit){
393 403
           drugList[i].unitList = [{id:1,name:""}]
394 404
         }
395
-       
396
-        drugList[i].supply_unit = drugList[i].max_unit 
405
+
406
+        drugList[i].supply_unit = drugList[i].max_unit
397 407
         for(let j=0;j<drugList[i].unitList.length;j++){
398 408
           if(drugList[i].max_unit != drugList[i].min_unit){
399 409
             drugList[i].unitList[0].name = drugList[i].max_unit
@@ -433,19 +443,19 @@ getInitOrder(){
433 443
         goodList[i].unitList =  [{id:1,name:""}]
434 444
         goodList[i].supply_unit = goodList[i].packing_unit
435 445
         for(let j=0;j<goodList[i].unitList.length;j++){
436
-           goodList[i].unitList[0].name = goodList[i].packing_unit 
446
+           goodList[i].unitList[0].name = goodList[i].packing_unit
437 447
         }
438 448
         this.tabList.push(goodList[i])
439 449
         }
440 450
         this.goodList = goodList
441
-    } 
451
+    }
442 452
     })
443 453
 },
444 454
 changeGoodName(val){
445 455
   this.currentIndex = val
446 456
 },
447 457
 changeName(val){
448
-  
458
+
449 459
    for(let i=0;i<this.recordInfo.tableList.length;i++){
450 460
     if(this.currentIndex == i){
451 461
         this.recordInfo.tableList[i].project_id = val.id
@@ -471,7 +481,7 @@ changeName(val){
471 481
         this.recordInfo.tableList[i].unitList = val.unitList
472 482
      }
473 483
     }
474
-   
484
+
475 485
 
476 486
 },
477 487
 handleEdit(){
@@ -507,20 +517,6 @@ handleDelete: function(index, row) {
507 517
         this.recordInfo.tableList.splice(index, 1)
508 518
    }
509 519
 },
510
-
511
-changeTypeName(){
512
-
513
-},
514
-startTimeChange(){
515
-
516
-},
517
-endTimeChange(){
518
-
519
-},
520
-search(){
521
-
522
-},
523
-
524 520
 getWarehoseInfo(arr,max_unit,min_unit,min_number){
525 521
     var total = 0
526 522
     var max_str=  ""
@@ -574,7 +570,7 @@ getTimes(time) {
574 570
    var total_price = 0
575 571
    for(let i=0;i<this.recordInfo.tableList.length;i++){
576 572
       total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
577
-   }  
573
+   }
578 574
    return total_price.toFixed(2)
579 575
  },
580 576
  checkPurchaseOrder(id,index){
@@ -582,21 +578,21 @@ getTimes(time) {
582 578
     confirmButtonText: '确 定',
583 579
     cancelButtonText: '取 消',
584 580
     type: 'warning'
585
-    }).then(() => { 
581
+    }).then(() => {
586 582
     checkPurchaseOrder(this.id).then(response => {
587 583
         if (response.data.state == 1) {
588 584
           var info = response.data.data.info
589 585
           this.disabled = true
590 586
           this.$message.success("审核成功!")
591 587
           this.getPurchaseOrderDetail()
592
-        } 
588
+        }
593 589
      })
594 590
     })
595 591
     .catch(() => {
596
-    }) 
592
+    })
597 593
   },
598 594
   getPurchaseOrderDetail(){
599
-     
595
+
600 596
       var id = this.$route.query.id
601 597
       var ids = this.$route.query.ids
602 598
     getPurchaseOrderInfo(id,ids).then(response=>{
@@ -609,7 +605,7 @@ getTimes(time) {
609 605
         this.discount_amount = info.discount_amount
610 606
         this.number = info.number
611 607
         var orderInfo = response.data.data.orderInfo
612
-        
608
+
613 609
         for(let i=0;i<orderInfo.length;i++){
614 610
           orderInfo[i].supply_batch_number = ""
615 611
           orderInfo[i].supply_product_date = ""
@@ -640,36 +636,36 @@ getTimes(time) {
640 636
                     orderInfo[i].unitList[0].name = drugList[j].max_unit
641 637
                   }
642 638
                 }
643
-             }  
644
-            } 
639
+             }
640
+            }
645 641
           if(orderInfo[i].is_source == 2){
646 642
             for(let j=0;j<goodList.length;j++){
647 643
                 if(orderInfo[i].project_id == goodList[j].id){
648 644
                     orderInfo[i].unitList = [{id:1,name:""}]
649 645
                     orderInfo[i].unitList[0].name = goodList[j].packing_unit
650 646
                 }
651
-            }  
652
-          } 
647
+            }
648
+          }
653 649
         }
654
-      
650
+
655 651
         this.recordInfo.tableList= []
656 652
         this.recordInfo.tableList = orderInfo
657
-       
653
+
658 654
           console.log("orderINFO23323232",this.recordInfo.tableList)
659 655
       }
660
-    })  
656
+    })
661 657
   },
662 658
   toPrint(){
663 659
      var id = this.$route.query.id
664
-     this.$router.push({path:"/purchase/order/print?&id="+id})  
660
+     this.$router.push({path:"/purchase/order/print?&id="+id})
665 661
   },
666
-  saveGoodOrder(){ 
667
-   
662
+  saveGoodOrder(){
663
+
668 664
     if(this.supplier_name == 0 || this.supplier_name == ""){
669 665
        this.$message.error("供应商不能为空!")
670 666
        this.loading = false
671 667
        return false
672
-    } 
668
+    }
673 669
 
674 670
     for(let i=0;i<this.recordInfo.tableList.length;i++){
675 671
 
@@ -677,7 +673,7 @@ getTimes(time) {
677 673
         this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
678 674
         this.recordInfo.tableList[i].supply_total_price= this.recordInfo.tableList[i].supply_total_price.toString()
679 675
         this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
680
-       
676
+
681 677
         for(let j=0;j<this.manufactuerList.length;j++){
682 678
             if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
683 679
               this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
@@ -694,10 +690,11 @@ getTimes(time) {
694 690
            this.loading = true
695 691
            var warehousing_id = this.$route.query.id
696 692
            var params = {
697
-             "stockIn":this.recordInfo.tableList,
693
+             stockIn:this.recordInfo.tableList,
694
+             return_remake:this.return_remark,
698 695
            }
699
-        console.log("stockIN2323322332322323",params)  
700
-       
696
+        console.log("stockIN2323322332322323",params)
697
+
701 698
         addGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehousing_id,this.number,this.rate_of_concession,this.discount_amount).then(response=>{
702 699
           if(response.data.state == 1){
703 700
              this.loading = false
@@ -713,6 +710,7 @@ getTimes(time) {
713 710
              this.payment =warehouseOut.payment
714 711
              this.arrearage =warehouseOut.arrearage
715 712
              this.supplier_name = warehouseOut.supplier_id
713
+             this.return_remake = warehouseOut.return_remake
716 714
              this.start_time = this.getTimes(warehouseOut.document_date)
717 715
             for(let i=0;i< orderInfo.length;i++){
718 716
               orderInfo[i].supply_count =  orderInfo[i].count
@@ -737,32 +735,32 @@ getTimes(time) {
737 735
                       orderInfo[i].unitList[0].name = this.drugList[j].max_unit
738 736
                     }
739 737
                   }
740
-              }  
741
-              } 
738
+              }
739
+              }
742 740
             if(orderInfo[i].is_source == 2){
743 741
               for(let j=0;j<this.goodList.length;j++){
744 742
                   if(orderInfo[i].project_id == this.goodList[j].id){
745 743
                       orderInfo[i].unitList = [{id:1,name:""}]
746 744
                       orderInfo[i].unitList[0].name = this.goodList[j].packing_unit
747 745
                   }
748
-              }  
749
-            } 
746
+              }
747
+            }
750 748
           }
751 749
           this.recordInfo.tableList= []
752 750
           this.recordInfo.tableList = orderInfo
753
-            
751
+
754 752
            }
755 753
          })
756 754
         }
757 755
     })
758 756
   },
759
-  updateGoodOrder(){ 
760
-   
757
+  updateGoodOrder(){
758
+
761 759
     if(this.supplier_name == 0 || this.supplier_name == ""){
762 760
        this.$message.error("供应商不能为空!")
763 761
        this.loading = false
764 762
        return false
765
-    } 
763
+    }
766 764
     console.log("表哥2323233232",this.recordInfo.tableList)
767 765
     for(let i=0;i<this.recordInfo.tableList.length;i++){
768 766
 
@@ -770,7 +768,7 @@ getTimes(time) {
770 768
         this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
771 769
         this.recordInfo.tableList[i].supply_total_price= this.recordInfo.tableList[i].supply_total_price.toString()
772 770
         this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
773
-        
771
+
774 772
         for(let j=0;j<this.manufactuerList.length;j++){
775 773
             if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
776 774
               this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
@@ -787,15 +785,16 @@ getTimes(time) {
787 785
            this.loading = true
788 786
            var warehose_out_id = this.$route.query.id
789 787
            var params = {
790
-             "stockIn":this.recordInfo.tableList,
791
-           } 
788
+             stockIn:this.recordInfo.tableList,
789
+             return_remake:this.return_remake,
790
+           }
792 791
            console.log("sotckind23232232323232323232",params)
793
-           
792
+
794 793
            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=>{
795 794
            if(response.data.state == 1){
796 795
              this.loading = false
797 796
              this.$message.success("保存成功!")
798
-             
797
+
799 798
            }
800 799
          })
801 800
         }

+ 9 - 4
src/xt_pages/supply/components/addGoodReturn.vue Voir le fichier

@@ -96,7 +96,7 @@
96 96
                   v-model="scope.row.name"
97 97
                   style="width: 160px"
98 98
                   filterable
99
-                  placeholder="请选择"
99
+                  placeholder="请选择商品"
100 100
                   @change="changeName"
101 101
                   @input="changeGoodName(scope.$index)"
102 102
                   :disabled="disabled"
@@ -121,6 +121,7 @@
121 121
                 v-model="scope.row.supply_type"
122 122
                 style="width: 120px"
123 123
                 :disabled="true"
124
+                placeholder="商品类别"
124 125
               ></el-input>
125 126
             </template>
126 127
           </el-table-column>
@@ -130,6 +131,7 @@
130 131
                 v-model="scope.row.supply_specification_name"
131 132
                 style="width: 150px"
132 133
                 :disabled="true"
134
+                 placeholder="规格&单位"
133 135
               ></el-input>
134 136
             </template>
135 137
           </el-table-column>
@@ -166,6 +168,7 @@
166 168
                 v-model="scope.row.supply_specification_name"
167 169
                 style="width: 150px"
168 170
                 :disabled="true"
171
+                placeholder="可退数量"
169 172
               ></el-input>
170 173
             </template>
171 174
           </el-table-column>
@@ -187,17 +190,18 @@
187 190
             </template>
188 191
           </el-table-column>
189 192
 
190
-          <el-table-column label="购货单价" align="center" width="120px">
193
+          <el-table-column label="采购单价" align="center" width="180px">
191 194
             <template slot-scope="scope">
192 195
               <el-input
193 196
                 v-model="scope.row.supply_price"
194
-                style="width: 80px"
197
+                style="width: 140px"
195 198
                 :disabled="disabled"
199
+                 placeholder="请输入采购单价"
196 200
               ></el-input>
197 201
             </template>
198 202
           </el-table-column>
199 203
 
200
-          <el-table-column label="购金额" align="center" width="120px">
204
+          <el-table-column label="购金额" align="center" width="120px">
201 205
             <template slot-scope="scope">
202 206
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
203 207
             </template>
@@ -250,6 +254,7 @@
250 254
                 v-model="scope.row.supply_remake"
251 255
                 style="width: 160px"
252 256
                 :disabled="disabled"
257
+                placeholder="请输入备注"
253 258
               ></el-input>
254 259
             </template>
255 260
           </el-table-column>

+ 108 - 136
src/xt_pages/supply/components/addPurchaseOrder.vue Voir le fichier

@@ -14,7 +14,7 @@
14 14
       >
15 15
         <div>
16 16
           <span style="color: red">*</span><span>供应商:</span>
17
-          <el-select cxpib`*+9.`
17
+          <el-select
18 18
             v-model="supplier_name"
19 19
             style="width: 140px; margin-right: 10px"
20 20
             placeholder="请选择"
@@ -191,7 +191,7 @@
191 191
               <div style="visibility: hidden">/</div>
192 192
             </template>
193 193
           </el-table-column>
194
-          <el-table-column label="数量" align="center" width="120px">
194
+          <el-table-column label="数量" align="center" width="180px">
195 195
             <template slot="header" slot-scope="scope">
196 196
               <span>数量<span style="color: red">*</span></span>
197 197
             </template>
@@ -203,8 +203,9 @@
203 203
               >
204 204
                 <el-input
205 205
                   v-model="scope.row.supply_count"
206
-                  style="width: 80px"
206
+                  style="width: 140px"
207 207
                   :disabled="disabled"
208
+                  placeholder="请输入数量"
208 209
                 ></el-input>
209 210
               </el-form-item>
210 211
             </template>
@@ -309,6 +310,15 @@
309 310
             </template>
310 311
           </el-table-column>
311 312
         </el-table>
313
+         <div style="margin-top: 10px">
314
+        <el-input
315
+          type="textarea"
316
+          :rows="2"
317
+          placeholder="备注信息"
318
+          v-model="return_remark"
319
+        >
320
+        </el-input>
321
+       </div>
312 322
         <!-- 审核水印 -->
313 323
         <img src="@/assets/purchase/Reviewed.png" alt="正在加载..." class="reviewImg" v-show="Reviewed == true" />
314 324
 
@@ -317,19 +327,19 @@
317 327
       <div style="margin-top: 10px">
318 328
         <span
319 329
           >优惠率:<el-input
320
-            style="width: 100px"
330
+            style="width: 150px"
321 331
             v-model="rate_of_concession"
322 332
             @input="addressChange"
323
-            @placeholder="请输入优惠率"
333
+            placeholder="请输入优惠率"
324 334
           ></el-input
325 335
           >%</span
326 336
         >
327 337
 
328 338
         <span
329 339
           >优惠金额:<el-input
330
-            style="width: 100px"
340
+            style="width: 150px"
331 341
             v-model="discount_amount"
332
-            @placeholder="请输入优惠金额"
342
+            placeholder="请输入优惠金额"
333 343
           ></el-input
334 344
         ></span>
335 345
       </div>
@@ -351,21 +361,7 @@ import {
351 361
 import { getDataConfig } from "@/utils/data";
352 362
 export default {
353 363
   name: "addPurchaseOrder",
354
-  created() {
355
-    this.org_id = this.$store.getters.xt_user.org_id;
356
-
357
-    var start_time = window.sessionStorage.getItem("start_time");
358
-    var end_time = window.sessionStorage.getItem("end_time");
359 364
 
360
-    if (start_time != null) {
361
-      this.start_time = start_time;
362
-    }
363
-    if (end_time != null) {
364
-      this.end_time = end_time;
365
-    }
366
-    window.sessionStorage.removeItem("start_time");
367
-    window.sessionStorage.removeItem("end_time");
368
-  },
369 365
   components: {
370 366
     BreadCrumb,
371 367
   },
@@ -430,130 +426,103 @@ export default {
430 426
       ],
431 427
       goodList: [{ id: 1, name: "" }],
432 428
       total_price: 0,
429
+      return_remark:"",
433 430
     };
434 431
   },
435 432
   methods: {
436
-    getInitOrder() {
437
-      getInitOrder().then((response) => {
438
-        if (response.data.state == 1) {
439
-          var drugList = response.data.data.drugList;
440
-
441
-          this.manufactuerList = response.data.data.manufactuerList;
442
-          this.goodTypeList = response.data.data.goodTypeList;
443
-          this.drugTypeList = response.data.data.drugTypeList;
444
-          this.supplyList = response.data.data.supplyList;
445
-          for (let i = 0; i < drugList.length; i++) {
446
-            for (let z = 0; z < drugList[i].drug_warehouse_info.length; z++) {
447
-              drugList[i].drug_warehouse_info[z].stock_max_number =
448
-                drugList[i].drug_warehouse_info[z].stock_max_number *
449
-                drugList[i].min_number;
450
-            }
451
-            for (let j = 0; j < this.manufactuerList.length; j++) {
452
-              if (drugList[i].manufacturer == this.manufactuerList[j].id) {
453
-                drugList[i].manufacturer =
454
-                  this.manufactuerList[j].manufacturer_name;
455
-              }
433
+   getInitOrder(){
434
+    getInitOrder().then(response=>{
435
+    if(response.data.state == 1){
436
+        var drugList = response.data.data.drugList
437
+        this.manufactuerList = response.data.data.manufactuerList
438
+        this.goodTypeList = response.data.data.goodTypeList
439
+        this.drugTypeList = response.data.data.drugTypeList
440
+        this.supplyList = response.data.data.supplyList
441
+       for(let i=0;i<drugList.length;i++){
442
+          for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
443
+            if(drugList[i].max_unit == drugList[i].drug_warehouse_info[z].max_unit){
444
+              drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
456 445
             }
457
-            for (let y = 0; y < this.drugTypeList.length; y++) {
458
-              if (drugList[i].drug_type == this.drugTypeList[y].value) {
459
-                drugList[i].drug_type = this.drugTypeList[y].name;
460
-              }
446
+          }
447
+        for(let j=0;j<this.manufactuerList.length;j++){
448
+            if(drugList[i].manufacturer == this.manufactuerList[j].id){
449
+                drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
461 450
             }
462
-            drugList[i].supply_name =
463
-              drugList[i].drug_name +
464
-              " " +
465
-              drugList[i].dose +
466
-              drugList[i].dose_unit +
467
-              "*" +
468
-              drugList[i].min_number +
469
-              drugList[i].min_unit +
470
-              "/" +
471
-              drugList[i].max_unit +
472
-              " " +
473
-              drugList[i].manufacturer;
474
-            drugList[i].supply_type = drugList[i].drug_type;
475
-            drugList[i].supply_specification_name =
476
-              drugList[i].dose +
477
-              drugList[i].dose_unit +
478
-              "*" +
479
-              drugList[i].min_number +
480
-              drugList[i].min_unit +
481
-              "/" +
482
-              drugList[i].max_unit;
483
-            drugList[i].supply_total = this.getWarehoseInfo(
484
-              drugList[i].drug_warehouse_info,
485
-              drugList[i].max_unit,
486
-              drugList[i].min_unit,
487
-              drugList[i].min_number
488
-            );
489
-            drugList[i].supply_count = "";
490
-            drugList[i].supply_total_price = "";
491
-            drugList[i].supply_manufacturer = drugList[i].manufacturer;
492
-            drugList[i].supply_license_number = drugList[i].number;
493
-            drugList[i].supply_remake = "";
494
-            drugList[i].type = 1;
495
-            drugList[i].supply_price = drugList[i].last_price;
496
-            drugList[i].name = drugList[i].drug_name;
497
-            drugList[i].supply_unit = drugList[i].max_unit;
498
-            drugList[i].unitList = [
499
-              { id: 1, name: "" },
500
-              { id: 2, name: "" },
501
-            ];
502
-            for (let j = 0; j < drugList[i].unitList.length; j++) {
503
-              drugList[i].unitList[0].name = drugList[i].max_unit;
504
-              drugList[i].unitList[1].name = drugList[i].min_unit;
451
+        }
452
+        for(let y=0;y<this.drugTypeList.length;y++){
453
+            if(drugList[i].drug_type == this.drugTypeList[y].value){
454
+            drugList[i].drug_type = this.drugTypeList[y].name
505 455
             }
506
-            this.tabList.push(drugList[i]);
456
+        }
457
+        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
458
+        drugList[i].supply_type = drugList[i].drug_type
459
+        drugList[i].supply_specification_name = drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit
460
+        drugList[i].supply_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number)
461
+        drugList[i].supply_count = ""
462
+        drugList[i].supply_total_price = ""
463
+        drugList[i].supply_manufacturer=  drugList[i].manufacturer
464
+        drugList[i].supply_license_number= drugList[i].number
465
+        drugList[i].supply_remake = ""
466
+        drugList[i].type = 1
467
+        drugList[i].supply_price = drugList[i].last_price
468
+        drugList[i].name = drugList[i].drug_name
469
+        if(drugList[i].max_unit!=drugList[i].min_unit){
470
+          drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
471
+        }
472
+        if(drugList[i].max_unit == drugList[i].min_unit){
473
+          drugList[i].unitList = [{id:1,name:""}]
474
+        }
475
+      
476
+        drugList[i].supply_unit = drugList[i].max_unit 
477
+        for(let j=0;j<drugList[i].unitList.length;j++){
478
+          if(drugList[i].max_unit!=drugList[i].min_unit){
479
+            drugList[i].unitList[0].name = drugList[i].max_unit
480
+            drugList[i].unitList[1].name = drugList[i].min_unit
507 481
           }
508
-          this.drugList = drugList;
509
-          var goodList = response.data.data.goodList;
510
-
511
-          for (let i = 0; i < goodList.length; i++) {
512
-            for (let j = 0; j < this.manufactuerList.length; j++) {
513
-              if (goodList[i].manufacturer == this.manufactuerList[j].id) {
514
-                goodList[i].manufacturer =
515
-                  this.manufactuerList[j].manufacturer_name;
516
-              }
517
-            }
518
-            for (let y = 0; y < this.goodTypeList.length; y++) {
519
-              if (goodList[i].good_type_id == this.goodTypeList[y].id) {
520
-                goodList[i].good_type_id = this.goodTypeList[y].type_name;
521
-              }
482
+          if(drugList[i].max_unit ==drugList[i].min_unit){
483
+            drugList[i].unitList[0].name = drugList[i].max_unit
484
+          }
485
+         
486
+        }
487
+        this.tabList.push(drugList[i])
488
+        }
489
+        this.drugList = drugList
490
+        var goodList =  response.data.data.goodList
491
+        for(let i=0;i<goodList.length;i++){
492
+        for(let j=0;j<this.manufactuerList.length;j++){
493
+            if(goodList[i].manufacturer == this.manufactuerList[j].id){
494
+                goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
522 495
             }
523
-            goodList[i].supply_name =
524
-              goodList[i].good_name +
525
-              " " +
526
-              goodList[i].specification_name +
527
-              " " +
528
-              goodList[i].manufacturer;
529
-            goodList[i].supply_type = goodList[i].good_type_id;
530
-            goodList[i].supply_specification_name =
531
-              goodList[i].specification_name;
532
-            goodList[i].supply_price = goodList[i].buy_price;
533
-            goodList[i].supply_total = this.getTotalStockCount(
534
-              goodList[i].good_warehouse_info
535
-            );
536
-            goodList[i].supply_count = "";
537
-            goodList[i].supply_total_price = "";
538
-            goodList[i].supply_manufacturer = goodList[i].manufacturer;
539
-            goodList[i].supply_license_number = "";
540
-            goodList[i].supply_remake = "";
541
-            goodList[i].type = 2;
542
-            goodList[i].name = goodList[i].good_name;
543
-            goodList[i].supply_unit = goodList[i].packing_unit;
544
-            goodList[i].unitList = [
545
-              { id: 1, name: "" },
546
-              { id: 2, name: "" },
547
-            ];
548
-            for (let j = 0; j < goodList[i].unitList.length; j++) {
549
-              goodList[i].unitList[0].name = goodList[i].packing_unit;
496
+        }
497
+        for(let y=0;y<this.goodTypeList.length;y++){
498
+            if(goodList[i].good_type_id == this.goodTypeList[y].id){
499
+                goodList[i].good_type_id = this.goodTypeList[y].type_name
550 500
             }
551
-            this.tabList.push(goodList[i]);
552
-          }
553
-          this.goodList = goodList;
554 501
         }
555
-      });
556
-    },
502
+        goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
503
+        goodList[i].supply_type = goodList[i].good_type_id
504
+        goodList[i].supply_specification_name =goodList[i].specification_name
505
+        goodList[i].supply_price = goodList[i].buy_price
506
+        goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
507
+        goodList[i].supply_count = ""
508
+        goodList[i].supply_total_price = ""
509
+        goodList[i].supply_manufacturer = goodList[i].manufacturer
510
+        goodList[i].supply_license_number = ""
511
+        goodList[i].supply_remake = ""
512
+        goodList[i].type = 2
513
+        goodList[i].name = goodList[i].good_name
514
+        goodList[i].unitList =  [{id:1,name:""}]
515
+        goodList[i].supply_unit = goodList[i].packing_unit
516
+        for(let j=0;j<goodList[i].unitList.length;j++){
517
+           goodList[i].unitList[0].name = goodList[i].packing_unit 
518
+        }
519
+        this.tabList.push(goodList[i])
520
+        }
521
+        this.goodList = goodList
522
+        console.log(this.goodList,'oo')
523
+    } 
524
+    })
525
+},
557 526
     changeGoodName(val) {
558 527
       this.currentIndex = val;
559 528
     },
@@ -659,6 +628,7 @@ export default {
659 628
           var end = this.getTimes(this.end_time);
660 629
           const params = {
661 630
             stockIn: this.recordInfo.tableList,
631
+            return_remake:this.return_remark,
662 632
           };
663 633
 
664 634
           console.log("params23322323", params);
@@ -681,6 +651,7 @@ export default {
681 651
               this.number = warehouseInfo.number;
682 652
               this.id = warehouseInfo.id;
683 653
               this.recordInfo.tableList = [];
654
+              this.return_remark = warehouseInfo.return_remake
684 655
               var orderInfo = response.data.data.orderInfo;
685 656
               for (let i = 0; i < orderInfo.length; i++) {
686 657
                 if (orderInfo[i].is_source == 1) {
@@ -824,6 +795,7 @@ export default {
824 795
           var end = this.getTimes(this.end_time);
825 796
           const params = {
826 797
             stockIn: this.recordInfo.tableList,
798
+            return_remake:this.return_remark,
827 799
           };
828 800
           console.log("params23232233223", params);
829 801
 
@@ -978,4 +950,4 @@ export default {
978 950
   bottom: 20px;
979 951
   height: 100%;
980 952
 }
981
-</style>
953
+</style>

+ 132 - 104
src/xt_pages/supply/components/addSupply.vue Voir le fichier

@@ -72,7 +72,7 @@
72 72
             backgroundColor: 'rgb(245, 247, 250)',
73 73
             color: '#606266',
74 74
           }"
75
-          :data="recordInfo.tableList"
75
+          :data="recordInfo.contacts"
76 76
           :class="signAndWeighBoxPatients"
77 77
           border
78 78
           style="width: 100%"
@@ -85,8 +85,8 @@
85 85
             </template>
86 86
             <template slot-scope="scope">
87 87
               <el-form-item
88
-                :prop="'tableList.' + scope.$index + '.supply_count'"
89
-                :rules="tableRules.contacts"
88
+                :prop="'contacts.' + scope.$index + '.name'"
89
+                :rules="tableRules.name"
90 90
               >
91 91
                 <el-input
92 92
                   v-model="scope.row.name"
@@ -121,10 +121,10 @@
121 121
               <span>首要联系人<span style="color: red">*</span></span>
122 122
             </template>
123 123
             <template slot-scope="scope">
124
-              <el-form-item :prop="'tableList.' + scope.$index + '.name'">
125
-                <!-- :prop="'tableList.' + scope.$index + '.name'"  如需添加可在上方标签加入 -->
124
+              <el-form-item :prop="'contacts.' + scope.$index + '.name'">
125
+                <!-- :prop="'contacts.' + scope.$index + '.name'"  如需添加可在上方标签加入 -->
126 126
                 <el-select
127
-                  v-model="scope.row.is_first"
127
+                  v-model="scope.row.isfirst"
128 128
                   style="width: 90px"
129 129
                   placeholder="请选择"
130 130
                   @change="changeName($event, scope)"
@@ -133,7 +133,7 @@
133 133
                     v-for="(item, index) in tabList"
134 134
                     :key="index"
135 135
                     :label="item.label"
136
-                    :value="item"
136
+                    :value="item.value"
137 137
                   >
138 138
                   </el-option>
139 139
                 </el-select>
@@ -186,7 +186,7 @@
186 186
 
187 187
     <span slot="footer" class="dialog-footer">
188 188
       <el-button @click="closePop">取 消</el-button>
189
-      <el-button type="primary" @click="submitForm('supplier')"
189
+      <el-button type="primary" @click="submitForm('supplier', 'recordInfo')"
190 190
         >确 定</el-button
191 191
       >
192 192
     </span>
@@ -198,25 +198,30 @@ import {
198 198
   getSupplierId,
199 199
   getsupplytype,
200 200
   getsupplyandcontactone,
201
+  delcontactone,
202
+  savesupply,
203
+  updatesupply,
201 204
 } from "@/api/supply";
202 205
 import Template from "../../data/template.vue";
203 206
 export default {
204 207
   data() {
205 208
     return {
209
+      show_type: 1,
210
+      supplier_ids: "",
206 211
       title: "",
207 212
       Template,
208 213
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
209 214
       list: ["001", "002"],
210 215
       // 表单验证规则
211 216
       rules: {
212
-        id: [
217
+        supplierCode: [
213 218
           {
214 219
             required: true,
215 220
             message: "请填写供应商编号",
216 221
             trigger: "blur",
217 222
           },
218 223
         ],
219
-        name: [
224
+        supplierName: [
220 225
           {
221 226
             required: true,
222 227
             message: "请填写供应商名称",
@@ -226,21 +231,19 @@ export default {
226 231
       },
227 232
       tabList: [
228 233
         {
229
-          value: 0,
234
+          value: 1,
230 235
           label: "是",
231 236
         },
232 237
         {
233
-          value: 1,
238
+          value: 0,
234 239
           label: "否",
235 240
         },
236 241
       ],
237 242
       tableRules: {
238
-        contacts: [
239
-          { required: true, message: "联系人不能为空", trigger: "blur" },
240
-        ],
243
+        name: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
241 244
       },
242 245
       recordInfo: {
243
-        tableList: [{}],
246
+        contacts: [{}],
244 247
       },
245 248
       tableData: [
246 249
         {
@@ -251,23 +254,12 @@ export default {
251 254
           operate: "",
252 255
         },
253 256
       ],
254
-      options: [
255
-        {
256
-          value: "1",
257
-          label: "是",
258
-        },
259
-        {
260
-          value: "2",
261
-          label: "否",
262
-        },
263
-      ],
264
-      value: "",
265 257
       dialogVisible: false,
266 258
       supplier: {
267
-        supplierName: "a",
259
+        supplierName: "",
268 260
         supplierCode: "gsy001",
269 261
         supplierType: "",
270
-        vatRate: 10,
262
+        vatRate: "",
271 263
         number: "",
272 264
         bank: "",
273 265
         bankAccount: "",
@@ -285,9 +277,12 @@ export default {
285 277
     show(data, type) {
286 278
       if (type == 1) {
287 279
         this.initSupplierData();
280
+        this.show_type = 1;
288 281
         this.title = "新增供应商";
289 282
         this.dialogVisible = true;
290 283
       } else if (type == 2) {
284
+        this.show_type = 2;
285
+        this.supplier_ids = data.ID;
291 286
         this.title = "编辑供应商";
292 287
         this.supplier.supplierCode = data.SupplierCode;
293 288
         this.supplier.supplierName = data.SupplierName;
@@ -310,36 +305,15 @@ export default {
310 305
       this.supplier.number = "";
311 306
       this.supplier.bank = "";
312 307
       this.supplier.bankAccount = "";
313
-      this.recordInfo.tableList = [{}];
308
+      this.recordInfo.contacts = [{}];
314 309
     },
315 310
 
316 311
     // 获取供应商编码接口
317 312
     initSupplierData() {
318
-      let Arr = [];
319 313
       getSupplierId().then((res) => {
320
-        Arr = res.data.data;
321
-        Arr.supplycode.forEach((o) => {
322
-          this.supply_code.push(o.supplier_code);
323
-        });
324
-      });
325
-      this.orderIdAdd();
326
-    },
327
-
328
-    // 供应商编码动态递增
329
-    orderIdAdd() {
330
-      let data = this.supply_code;
331
-      let len = 3;
332
-      data.forEach((o, index) => {
333
-        o = o.split("gsy");
334
-        index = index + 1;
335
-        let index1 = index;
336
-        index1 = parseInt(index1, 10);
337
-        index1 = index1.toString();
338
-        while (index1.length < len) index1 = "0" + index1;
339
-        if (o[1] != index1) {
340
-          data.splice(index - 1, 0, `gsy${index1}`);
341
-          // console.log(`gsy${index1}`);
342
-          this.supplier.id = `gsy${index1}`;
314
+        if (res.data.state == 1) {
315
+          this.supplier.supplierCode =
316
+            res.data.data.supplycode[0].supplier_code;
343 317
         }
344 318
       });
345 319
     },
@@ -376,21 +350,57 @@ export default {
376 350
     },
377 351
 
378 352
     handleSelect(item) {
379
-      console.log(item, "l");
380 353
       this.supplier.name = item.value;
381 354
       this.supplier.value = item.name;
382 355
     },
383 356
 
384 357
     //  验证表单内容
385
-    submitForm(formName) {
386
-      this.$refs[formName].validate((valid) => {
387
-        if (valid) {
388
-          alert("submit!");
389
-          this.dialogVisible = false;
390
-        } else {
391
-          return false;
392
-        }
393
-      });
358
+    submitForm(supplier, formName) {
359
+      if (this.show_type == 1) {
360
+        this.$refs[supplier].validate((valid) => {
361
+          if (valid) {
362
+            this.$refs[formName].validate((valid) => {
363
+              if (valid) {
364
+                let params = {
365
+                  ...this.supplier,
366
+                  ...this.recordInfo,
367
+                };
368
+                console.log(params, "dhas");
369
+                savesupply(params).then((res) => {});
370
+              } else {
371
+                return false;
372
+              }
373
+            });
374
+
375
+            this.dialogVisible = false;
376
+          } else {
377
+            return false;
378
+          }
379
+        });
380
+      } else if (this.show_type == 2) {
381
+        this.$refs[supplier].validate((valid) => {
382
+          if (valid) {
383
+            this.$refs[formName].validate((valid) => {
384
+              if (valid) {
385
+                let params = {
386
+                  ...this.supplier,
387
+                  ...this.recordInfo,
388
+                };
389
+                console.log(params, "dhas");
390
+                updatesupply(params).then((res) => {
391
+                  console.log(res, "oo");
392
+                });
393
+              } else {
394
+                return false;
395
+              }
396
+            });
397
+
398
+            this.dialogVisible = false;
399
+          } else {
400
+            return false;
401
+          }
402
+        });
403
+      }
394 404
 
395 405
       this.contactsinfo();
396 406
     },
@@ -402,74 +412,92 @@ export default {
402 412
         label: "是",
403 413
       };
404 414
       getsupplyandcontactone({ id: val }).then((res) => {
405
-        console.log(res, "oo");
406 415
         if (res.data.code == 0) {
407
-          this.recordInfo.tableList = res.data.data.contact;
408
-          if (this.recordInfo.tableList.length == 0) {
409
-            this.recordInfo.tableList = [{}];
410
-            this.recordInfo.tableList[0].is_first = data;
411
-            this.$forceUpdate();
416
+          this.recordInfo.contacts = res.data.data.contact;
417
+          if (this.recordInfo.contacts.length == 0) {
418
+            this.recordInfo.contacts = [{}];
419
+            this.recordInfo.contacts[0].isfirst = data;
420
+          } else if (this.recordInfo.contacts.length == 1) {
421
+            let val = res.data.data.contact[0];
422
+            this.recordInfo.contacts[0].isfirst = data;
423
+            this.recordInfo.contacts[0] = {
424
+              name: val.name,
425
+              address: val.address,
426
+              phone: val.phone,
427
+              isfirst: val.is_first,
428
+            };
412 429
           } else {
413
-            this.recordInfo.tableList.forEach((o) => {
414
-              if (o.is_first == 0) {
415
-                o.is_first = "否";
416
-              } else if (o.is_first == 1) {
417
-                o.is_first = "是";
430
+            this.recordInfo.contacts.forEach((o) => {
431
+              if (o.isfirst == 0) {
432
+                this.tabList.label = "否";
433
+              } else if (o.isfirst == 1) {
434
+                this.tabList.label = "是";
418 435
               }
419 436
             });
420 437
           }
421
-
422
-          console.log(this.recordInfo.tableList, "this.recordInfo.tableList");
423 438
         }
424 439
       });
425
-
426
-      if (this.recordInfo.tableList.length == 1) {
427
-        this.recordInfo.tableList[0].is_first = data;
428
-        this.$forceUpdate();
429
-      }
430 440
     },
431 441
 
432 442
     // 首要联系人选择变更动态展示
433 443
     changeName(data, scope) {
434 444
       let data1 = {
435
-        value: 1,
445
+        value: 0,
436 446
         label: "否",
437 447
       };
438
-
439 448
       let data2 = {
440
-        value: 0,
449
+        value: 1,
441 450
         label: "是",
442 451
       };
443 452
       let arr = [];
444
-      if (this.recordInfo.tableList.length == 1) {
445
-        this.recordInfo.tableList[0] = data2;
446
-        this.$forceUpdate();
447
-      }
448
-      this.recordInfo.tableList.forEach((el, index) => {
449
-        if (scope.$index == index) {
450
-          el.is_first = data;
451
-          // console.log(scope);
452
-          this.$forceUpdate();
453
+      if (this.recordInfo.contacts.length <= 1) {
454
+        this.recordInfo.contacts[0].isfirst = data2.value;
455
+      } else {
456
+        this.recordInfo.contacts.forEach((el, index) => {
457
+          console.log(scope.$index, index, "oo");
458
+          if (scope.$index == index) {
459
+            el.isfirst = data;
460
+          } else {
461
+            el.isfirst = data1.value;
462
+          }
463
+          arr.push(el.isfirst);
464
+        });
465
+        if (arr.includes(1)) {
466
+          return;
453 467
         } else {
454
-          el.is_first = data1;
455
-          this.$forceUpdate();
468
+          this.recordInfo.contacts[0].isfirst = data2.value;
456 469
         }
457
-        arr.push(el.is_first.value);
458
-      });
459
-      if (arr.includes(0)) {
460
-        return;
461
-      } else {
462
-        this.recordInfo.tableList[0].is_first = data2;
463 470
       }
464 471
     },
465 472
 
466 473
     // 添加表单行
467 474
     handleAdd() {
468 475
       let data = {};
469
-      this.recordInfo.tableList.push(data);
476
+      this.recordInfo.contacts.push(data);
470 477
     },
471 478
     // 删除表单行
472
-    handleDelete() {},
479
+    handleDelete(index, data) {
480
+      let params = {
481
+        id: data.id,
482
+      };
483
+
484
+      if (this.show_type == 1) {
485
+        if (this.recordInfo.contacts.length <= 1) {
486
+          return;
487
+        } else {
488
+          this.recordInfo.contacts.splice(index, 1);
489
+        }
490
+      } else if (this.show_type == 2) {
491
+        delcontactone(params).then((res) => {
492
+          if (res.data.data.list == "删除成功") {
493
+            this.$message.success(res.data.data.list);
494
+            this.getcontacts(this.supplier_ids);
495
+          } else {
496
+            this.$message.error(res.data.data.list);
497
+          }
498
+        });
499
+      }
500
+    },
473 501
 
474 502
     //表格判断是否填入信息
475 503
     contactsinfo() {

+ 50 - 29
src/xt_pages/supply/components/editGoodOrder.vue Voir le fichier

@@ -91,13 +91,13 @@
91 91
             <span>商品类别</span>
92 92
         </template>
93 93
         <template slot-scope="scope">
94
-            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
94
+            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true" placeholder="商品类别"></el-input>
95 95
             <div style="visibility: hidden">/</div>
96 96
         </template>
97 97
     </el-table-column>
98
-    <el-table-column label="规格&单位" align="center" width="120px">
98
+    <el-table-column label="规格&单位" align="center" width="150px">
99 99
         <template slot-scope="scope">
100
-            <el-input v-model="scope.row.supply_specification_name" style="width:100px" :disabled="true"></el-input>
100
+            <el-input v-model="scope.row.supply_specification_name" style="width:120px" :disabled="true" placeholder="规格&单位"></el-input>
101 101
             <div style="visibility: hidden">/</div>
102 102
         </template>
103 103
     </el-table-column>
@@ -118,13 +118,13 @@
118 118
           </el-form-item>  
119 119
         </template>
120 120
     </el-table-column>
121
-    <el-table-column label="批号" align="center" width="130px">
121
+    <el-table-column label="批号" align="center" width="200px">
122 122
          <template slot="header" slot-scope="scope">
123 123
             <span>批号<span style="color: red">*</span></span>
124 124
         </template>
125 125
         <template slot-scope="scope">
126 126
            <el-form-item  :prop="'tableList.' + scope.$index + '.supply_batch_number'" :rules='tableRules.supply_batch_number'>
127
-             <el-input v-model="scope.row.supply_batch_number" style="width:80px" :disabled="disabled"></el-input>
127
+             <el-input v-model="scope.row.supply_batch_number" style="width:180px" :disabled="disabled" placeholder="请输入批号"></el-input>
128 128
           </el-form-item>
129 129
         </template>
130 130
     </el-table-column>
@@ -142,9 +142,9 @@
142 142
              </el-form-item>
143 143
        </template>
144 144
     </el-table-column>
145
-    <el-table-column label="可用库存" align="center" width="100px">
145
+    <el-table-column label="可用库存" align="center" width="150px">
146 146
         <template slot-scope="scope">
147
-            <el-input v-model="scope.row.supply_total" style="width:80px" :disabled="true"></el-input>
147
+            <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
148 148
             <div style="visibility: hidden">/</div>
149 149
         </template>
150 150
     </el-table-column>
@@ -154,14 +154,14 @@
154 154
         </template>
155 155
         <template slot-scope="scope">
156 156
           <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
157
-             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
157
+             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled" placeholder="请输入数量"></el-input>
158 158
           </el-form-item>
159 159
         </template>
160 160
     </el-table-column>
161 161
 
162
-    <el-table-column label="采购单价" align="center" width="120px">
162
+    <el-table-column label="采购单价" align="center" width="180px">
163 163
         <template slot-scope="scope">
164
-        <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
164
+        <el-input v-model="scope.row.supply_price" style="width:140px" :disabled="disabled" placeholder="请输入采购单价"></el-input>
165 165
         <div style="visibility: hidden">/</div>
166 166
         </template>
167 167
     </el-table-column>
@@ -216,7 +216,7 @@
216 216
 
217 217
     <el-table-column label="备注" align="center" width="200px">
218 218
         <template slot-scope="scope">
219
-        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
219
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled" placeholder="请输入备注"></el-input>
220 220
         <div style="visibility: hidden">/</div>
221 221
         </template>
222 222
     </el-table-column>
@@ -243,33 +243,31 @@
243 243
         </template>
244 244
     </el-table-column>
245 245
   </el-table>
246
+   <div style="margin-top: 10px">
247
+      <el-input
248
+        type="textarea"
249
+        :rows="2"
250
+        placeholder="备注信息"
251
+        v-model="return_remark"
252
+      >
253
+      </el-input>
254
+  </div>
246 255
 </el-form>
247 256
    <div style="margin-top:10px">
248 257
       合计:{{getAllPrice()}} 元
249 258
    </div>
250 259
    <div style="margin-top:10px">
251
-        <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
260
+        <span>优惠率:<el-input style="width:150px" v-model="rate_of_concession" placeholder="请输入优惠率"></el-input>%</span>
252 261
 
253
-        <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
262
+        <span>优惠金额:<el-input style="width:150px" v-model="discount_amount" placeholder="请输入优惠金额"></el-input></span>
254 263
       
255
-        <span>本次付款:<el-input style="width:100px" v-model="payment"></el-input></span>
264
+        <span>本次付款:<el-input style="width:150px" v-model="payment" placeholder="请输入本次付款"></el-input></span>
256 265
 
257
-        <span>本次欠款:<el-input style="width:100px" v-model="arrearage"></el-input></span>
266
+        <span>本次欠款:<el-input style="width:150px" v-model="arrearage" placeholder="请输入本次欠款"></el-input></span>
258 267
     </div>
259 268
     <!-- <Computed></Computed> -->
260 269
 </div>
261 270
 
262
-  <!-- <el-dialog
263
-  title="提示"
264
-  :visible.sync="dialogVisible"
265
-  width="30%"
266
-  :before-close="handleClose">
267
-  <span>这是一段信息</span>
268
-  <span slot="footer" class="dialog-footer">
269
-    <el-button @click="dialogVisible = false">取 消</el-button>
270
-    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
271
-  </span>
272
-  </el-dialog> -->
273 271
 </div>
274 272
 </template>
275 273
 
@@ -277,7 +275,7 @@
277 275
 import Computed from "../../components/Computed/index_1.vue"
278 276
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
279 277
 import {uParseTime } from '@/utils/tools'
280
-import {getInitOrder,checkPurchaseOrder,getGoodOrderDetail,updateGoodOrder,getGoodOrderCountList,ModefySupplyWarehousing,MofyGoodOrder,UpdateSupplyWahouseingInfo} from "@/api/supply"
278
+import {getInitOrder,checkPurchaseOrder,getGoodOrderDetail,updateGoodOrder,getGoodOrderCountList,ModefySupplyWarehousing,MofyGoodOrder,UpdateSupplyWahouseingInfo,getSupplyWarehouseOutById} from "@/api/supply"
281 279
 export default {
282 280
 name: "addPurchaseOrder",
283 281
 components: {
@@ -344,7 +342,7 @@ return {
344 342
    good_number:"",
345 343
    orderInfo:[],
346 344
    warese_out_id:0,
347
-   
345
+   return_remark:"",
348 346
   };
349 347
 },
350 348
 methods:{
@@ -613,6 +611,7 @@ getTimes(time) {
613 611
         this.arrearage = out.arrearage
614 612
         this.number = out.number
615 613
         this.good_number = out.good_number
614
+        this.return_remark = out.return_remake
616 615
         this.start_time = this.getTimes(out.document_date)
617 616
         var orderInfo = response.data.data.list
618 617
         
@@ -696,7 +695,8 @@ getTimes(time) {
696 695
            this.loading = true
697 696
            var warehose_out_id = this.$route.query.id
698 697
            var params = {
699
-             "stockIn":this.recordInfo.tableList,
698
+             stockIn:this.recordInfo.tableList,
699
+             return_remake:this.return_remark,
700 700
            } 
701 701
            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=>{
702 702
            if(response.data.state == 1){
@@ -820,6 +820,27 @@ getTimes(time) {
820 820
     })
821 821
   },
822 822
   toClick(){
823
+    //先判断采购单号有没有关联的采购退货单号,如果没有,则为首次生成采购退货单
824
+     if(this.is_check == 2){
825
+      this.$message.error("该采购单未审核,不能生成退货单数据!")
826
+      return false
827
+     }
828
+     var id = this.$route.query.id
829
+    getSupplyWarehouseOutById(id).then(response=>{
830
+      if(response.data.state == 1){
831
+        var cancelList = response.data.data.cancelList
832
+        console.log("cancelList23232232323323223",cancelList)
833
+        if(cancelList.length >0){
834
+
835
+        }
836
+        var outList = response.data.data.outList
837
+        console.log("outList2332232332",outList)
838
+        var cancelOrderList = response.data.data.cancelOrderList
839
+        console.log("cancelOrderList2323322322332",cancelOrderList)
840
+        var drugList = response.data.data.drugList
841
+        console.log("drugList233223232323232",drugList)
842
+      }
843
+    })
823 844
     this.$router.push({path:"/good/return/add?id="+this.id})
824 845
   },
825 846
   //反审核

+ 10 - 4
src/xt_pages/supply/components/editGoodReturn.vue Voir le fichier

@@ -92,7 +92,7 @@
92 92
                   v-model="scope.row.name"
93 93
                   style="width: 160px"
94 94
                   filterable
95
-                  placeholder="请选择"
95
+                  placeholder="请选择商品"
96 96
                   @change="changeName"
97 97
                   @input="changeGoodName(scope.$index)"
98 98
                   :disabled="disabled"
@@ -117,6 +117,7 @@
117 117
                 v-model="scope.row.supply_type"
118 118
                 style="width: 120px"
119 119
                 :disabled="true"
120
+                placeholder="商品类别"
120 121
               ></el-input>
121 122
             </template>
122 123
           </el-table-column>
@@ -126,6 +127,7 @@
126 127
                 v-model="scope.row.supply_specification_name"
127 128
                 style="width: 150px"
128 129
                 :disabled="true"
130
+                placeholder="规格&单位"
129 131
               ></el-input>
130 132
             </template>
131 133
           </el-table-column>
@@ -168,6 +170,7 @@
168 170
           <el-table-column label="数量" align="center" width="120px">
169 171
             <template slot="header" slot-scope="scope">
170 172
               <span>数量<span style="color: red">*</span></span>
173
+
171 174
             </template>
172 175
             <template slot-scope="scope">
173 176
               <el-form-item
@@ -178,22 +181,24 @@
178 181
                   v-model="scope.row.supply_count"
179 182
                   style="width: 80px"
180 183
                   :disabled="disabled"
184
+                  placeholder="请输入数量"
181 185
                 ></el-input>
182 186
               </el-form-item>
183 187
             </template>
184 188
           </el-table-column>
185 189
 
186
-          <el-table-column label="购货单价" align="center" width="120px">
190
+          <el-table-column label="采购单价" align="center" width="180px">
187 191
             <template slot-scope="scope">
188 192
               <el-input
189 193
                 v-model="scope.row.supply_price"
190
-                style="width: 80px"
194
+                style="width: 140px"
191 195
                 :disabled="disabled"
196
+                placeholder="请输入采购单价"
192 197
               ></el-input>
193 198
             </template>
194 199
           </el-table-column>
195 200
 
196
-          <el-table-column label="购金额" align="center" width="120px">
201
+          <el-table-column label="购金额" align="center" width="120px">
197 202
             <template slot-scope="scope">
198 203
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
199 204
             </template>
@@ -246,6 +251,7 @@
246 251
                 v-model="scope.row.supply_remake"
247 252
                 style="width: 160px"
248 253
                 :disabled="disabled"
254
+                placeholder="请输入备注"
249 255
               ></el-input>
250 256
             </template>
251 257
           </el-table-column>

Fichier diff supprimé car celui-ci est trop grand
+ 757 - 1080
src/xt_pages/supply/components/editPurchaseOrder.vue


+ 1 - 1
src/xt_pages/supply/goodOrderQuery.vue Voir le fichier

@@ -107,7 +107,7 @@
107 107
        </el-table-column>
108 108
         <el-table-column label="已付款" align="center">
109 109
          <template slot-scope="scope">
110
-           {{scope.row.payment}}
110
+           <span v-if="scope.row.payment >0">{{scope.row.payment}}</span> 
111 111
          </template>
112 112
        </el-table-column>
113 113
        <el-table-column label="数量" align="center">