Browse Source

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

XMLWAN 3 years ago
parent
commit
c20c974dd1

+ 9 - 0
src/xt_pages/supply/components/addGoodReturn.vue View File

@@ -133,6 +133,7 @@
133 133
                 :disabled="true"
134 134
                 placeholder="商品类别"
135 135
               ></el-input>
136
+               <div style="visibility: hidden">/</div>
136 137
             </template>
137 138
           </el-table-column>
138 139
           <el-table-column label="规格&单位" align="center" width="200px">
@@ -143,6 +144,7 @@
143 144
                 :disabled="true"
144 145
                 placeholder="规格&单位"
145 146
               ></el-input>
147
+               <div style="visibility: hidden">/</div>
146 148
             </template>
147 149
           </el-table-column>
148 150
 
@@ -179,6 +181,7 @@
179 181
                 style="width: 100px"
180 182
                 :disabled="true"
181 183
               ></el-input>
184
+               <div style="visibility: hidden">/</div>
182 185
             </template>
183 186
           </el-table-column>
184 187
           <el-table-column label="可退数量" align="center" width="200px">
@@ -189,6 +192,7 @@
189 192
                 :disabled="true"
190 193
                 placeholder="可退数量"
191 194
               ></el-input>
195
+               <div style="visibility: hidden">/</div>
192 196
             </template>
193 197
           </el-table-column>
194 198
           <el-table-column label="数量" align="center" width="120px">
@@ -217,6 +221,7 @@
217 221
                 :disabled="disabled"
218 222
                 placeholder="请输入采购单价"
219 223
               ></el-input>
224
+               <div style="visibility: hidden">/</div>
220 225
             </template>
221 226
           </el-table-column>
222 227
 
@@ -244,6 +249,7 @@
244 249
                 style="width: 160px"
245 250
                 :disabled="true"
246 251
               ></el-input>
252
+               <div style="visibility: hidden">/</div>
247 253
             </template>
248 254
           </el-table-column>
249 255
 
@@ -254,6 +260,7 @@
254 260
                 style="width: 160px"
255 261
                 :disabled="true"
256 262
               ></el-input>
263
+               <div style="visibility: hidden">/</div>
257 264
             </template>
258 265
           </el-table-column>
259 266
 
@@ -264,6 +271,7 @@
264 271
                 style="width: 160px"
265 272
                 :disabled="true"
266 273
               ></el-input>
274
+               <div style="visibility: hidden">/</div>
267 275
             </template>
268 276
           </el-table-column>
269 277
 
@@ -275,6 +283,7 @@
275 283
                 :disabled="disabled"
276 284
                 placeholder="请输入备注"
277 285
               ></el-input>
286
+               <div style="visibility: hidden">/</div>
278 287
             </template>
279 288
           </el-table-column>
280 289
 

+ 46 - 51
src/xt_pages/supply/components/addSupply.vue View File

@@ -26,11 +26,21 @@
26 26
           <el-col span="6">
27 27
             <el-form-item label="供应商类别" prop="supplierType">
28 28
               <!-- <el-input v-model="supplier.type"></el-input> -->
29
-              <el-autocomplete
29
+              <!-- <el-autocomplete
30 30
                 v-model="supplier.supplierType"
31 31
                 :fetch-suggestions="querySearchAsync"
32 32
                 @select="handleSelect"
33
-              ></el-autocomplete>
33
+              ></el-autocomplete> -->
34
+
35
+              <el-select v-model="supplier.supplierType" @select="handleSelect">
36
+                <el-option
37
+                  v-for="item in supplierType"
38
+                  :key="item.value"
39
+                  :label="item.label"
40
+                  :value="item.value"
41
+                >
42
+                </el-option>
43
+              </el-select>
34 44
             </el-form-item>
35 45
           </el-col>
36 46
           <el-col span="6">
@@ -91,7 +101,7 @@
91 101
                         {
92 102
                           required: 'true',
93 103
                           message: '请输入主要联系人',
94
-                          trigger: ['blur', 'change'],
104
+                          trigger: ['blur'],
95 105
                         },
96 106
                       ]
97 107
                     : null
@@ -227,6 +237,7 @@ export default {
227 237
       supplier_ids: "",
228 238
       title: "",
229 239
       Template,
240
+      supplierType: [],
230 241
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
231 242
       list: ["001", "002"],
232 243
       // 表单验证规则
@@ -297,8 +308,10 @@ export default {
297 308
         this.initSupplierData();
298 309
         this.show_type = 1;
299 310
         this.title = "新增供应商";
311
+        this.getsupplytype();
300 312
         this.dialogVisible = true;
301 313
       } else if (type == 2) {
314
+        this.getsupplytype();
302 315
         // console.log(data,'oop')
303 316
         this.show_type = 2;
304 317
         this.supplier_ids = data.ID;
@@ -306,6 +319,7 @@ export default {
306 319
         this.supplier.supplierCode = data.SupplierCode;
307 320
         this.supplier.supplierName = data.SupplierName;
308 321
         this.supplier.supplierType = data.SupplierType;
322
+
309 323
         this.supplier.vatRate = data.VatRate;
310 324
         this.supplier.number = data.Number;
311 325
         this.supplier.bank = data.Bank;
@@ -363,35 +377,18 @@ export default {
363 377
       });
364 378
     },
365 379
 
366
-    querySearchAsync(queryString, cb) {
367
-      clearTimeout(this.timeout);
368
-      var results = [];
369
-      if (queryString == "") {
370
-        cb(results);
371
-      } else {
372
-        // 获取供应商类别接口
373
-        getsupplytype()
374
-          .then((res) => {
375
-            if (res.status == 200) {
376
-              var result = res.data.data.list;
377
-              //远程搜索需要的数组
378
-              for (let i = 0; i < result.length; i++) {
379
-                const element = result[i];
380
-                results.push({
381
-                  value: element.name,
382
-                  name: element.value,
383
-                });
384
-              }
385
-              cb(results);
386
-            } else {
387
-              results = [];
388
-              cb(results);
389
-            }
390
-          })
391
-          .catch((err) => {
392
-            console.log(err);
393
-          });
394
-      }
380
+    getsupplytype() {
381
+      // 获取供应商类别接口
382
+      getsupplytype()
383
+        .then((res) => {
384
+          if (res.status == 200) {
385
+            this.supplierType = res.data.data.list;
386
+            console.log(this.supplierType, "this.supplierType");
387
+          }
388
+        })
389
+        .catch((err) => {
390
+          console.log(err);
391
+        });
395 392
     },
396 393
 
397 394
     handleSelect(item) {
@@ -429,11 +426,11 @@ export default {
429 426
                 };
430 427
                 savesupply(params).then((res) => {
431 428
                   if (res.data.state == 1) {
432
-                    this.$message.success("修改成功");
429
+                    this.$message.success("新增成功");
433 430
                     this.closePop();
434 431
                     this.$emit("init");
435 432
                   } else {
436
-                    this.$message.error("修改失败");
433
+                    this.$message.error("新增失败");
437 434
                     setTimeout(() => {
438 435
                       this.closePop();
439 436
                     }, 2000);
@@ -466,7 +463,7 @@ export default {
466 463
                 let params = {
467 464
                   suppliercode: this.supplier.supplierCode || "",
468 465
                   suppliername: this.supplier.supplierName || "",
469
-                  id: this.supplier.id|| 0,
466
+                  id: this.supplier_ids || 0,
470 467
                   suppliertype: this.supplier.supplierType || "",
471 468
                   vatrate: this.supplier.vatRate || 0,
472 469
                   number: this.supplier.number || "",
@@ -511,23 +508,18 @@ export default {
511 508
           if (this.recordInfo.contacts.length == 0) {
512 509
             this.recordInfo.contacts = [{}];
513 510
             this.recordInfo.contacts[0].is_first = data.value;
514
-          } else if (this.recordInfo.contacts.length == 1) {
515
-            let val = res.data.data.contact[0];
516
-            this.recordInfo.contacts[0].is_first = data.value;
517
-            this.recordInfo.contacts[0] = {
518
-              id: val.id,
519
-              name: val.name,
520
-              address: val.address,
521
-              phone: val.phone,
522
-            };
523
-            this.$forceUpdate();
524
-          } else {
525
-            this.recordInfo.contacts.forEach((o) => {
526
-              if (o.isfirst == 0) {
527
-              } else if (o.isfirst == 1) {
528
-              }
529
-            });
530 511
           }
512
+          // else if (this.recordInfo.contacts.length == 1) {
513
+          //     let val = res.data.data.contact[0];
514
+          //     this.recordInfo.contacts[0].is_first = data.value;
515
+          //     this.recordInfo.contacts[0] = {
516
+          //       id: parseFloat(val.id),
517
+          //       name: val.name,
518
+          //       address: val.address,
519
+          //       phone: val.phone,
520
+          //     };
521
+          //     this.$forceUpdate();
522
+          //   }
531 523
         }
532 524
       });
533 525
     },
@@ -639,6 +631,9 @@ export default {
639 631
     .el-autocomplete {
640 632
       width: 75% !important;
641 633
     }
634
+    .el-select.el-select--medium {
635
+      width: 70% !important;
636
+    }
642 637
   }
643 638
 }
644 639