Procházet zdrojové kódy

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

XMLWAN před 3 roky
rodič
revize
c20c974dd1

+ 9 - 0
src/xt_pages/supply/components/addGoodReturn.vue Zobrazit soubor

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

+ 46 - 51
src/xt_pages/supply/components/addSupply.vue Zobrazit soubor

26
           <el-col span="6">
26
           <el-col span="6">
27
             <el-form-item label="供应商类别" prop="supplierType">
27
             <el-form-item label="供应商类别" prop="supplierType">
28
               <!-- <el-input v-model="supplier.type"></el-input> -->
28
               <!-- <el-input v-model="supplier.type"></el-input> -->
29
-              <el-autocomplete
29
+              <!-- <el-autocomplete
30
                 v-model="supplier.supplierType"
30
                 v-model="supplier.supplierType"
31
                 :fetch-suggestions="querySearchAsync"
31
                 :fetch-suggestions="querySearchAsync"
32
                 @select="handleSelect"
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
             </el-form-item>
44
             </el-form-item>
35
           </el-col>
45
           </el-col>
36
           <el-col span="6">
46
           <el-col span="6">
91
                         {
101
                         {
92
                           required: 'true',
102
                           required: 'true',
93
                           message: '请输入主要联系人',
103
                           message: '请输入主要联系人',
94
-                          trigger: ['blur', 'change'],
104
+                          trigger: ['blur'],
95
                         },
105
                         },
96
                       ]
106
                       ]
97
                     : null
107
                     : null
227
       supplier_ids: "",
237
       supplier_ids: "",
228
       title: "",
238
       title: "",
229
       Template,
239
       Template,
240
+      supplierType: [],
230
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
241
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
231
       list: ["001", "002"],
242
       list: ["001", "002"],
232
       // 表单验证规则
243
       // 表单验证规则
297
         this.initSupplierData();
308
         this.initSupplierData();
298
         this.show_type = 1;
309
         this.show_type = 1;
299
         this.title = "新增供应商";
310
         this.title = "新增供应商";
311
+        this.getsupplytype();
300
         this.dialogVisible = true;
312
         this.dialogVisible = true;
301
       } else if (type == 2) {
313
       } else if (type == 2) {
314
+        this.getsupplytype();
302
         // console.log(data,'oop')
315
         // console.log(data,'oop')
303
         this.show_type = 2;
316
         this.show_type = 2;
304
         this.supplier_ids = data.ID;
317
         this.supplier_ids = data.ID;
306
         this.supplier.supplierCode = data.SupplierCode;
319
         this.supplier.supplierCode = data.SupplierCode;
307
         this.supplier.supplierName = data.SupplierName;
320
         this.supplier.supplierName = data.SupplierName;
308
         this.supplier.supplierType = data.SupplierType;
321
         this.supplier.supplierType = data.SupplierType;
322
+
309
         this.supplier.vatRate = data.VatRate;
323
         this.supplier.vatRate = data.VatRate;
310
         this.supplier.number = data.Number;
324
         this.supplier.number = data.Number;
311
         this.supplier.bank = data.Bank;
325
         this.supplier.bank = data.Bank;
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
     handleSelect(item) {
394
     handleSelect(item) {
429
                 };
426
                 };
430
                 savesupply(params).then((res) => {
427
                 savesupply(params).then((res) => {
431
                   if (res.data.state == 1) {
428
                   if (res.data.state == 1) {
432
-                    this.$message.success("修改成功");
429
+                    this.$message.success("新增成功");
433
                     this.closePop();
430
                     this.closePop();
434
                     this.$emit("init");
431
                     this.$emit("init");
435
                   } else {
432
                   } else {
436
-                    this.$message.error("修改失败");
433
+                    this.$message.error("新增失败");
437
                     setTimeout(() => {
434
                     setTimeout(() => {
438
                       this.closePop();
435
                       this.closePop();
439
                     }, 2000);
436
                     }, 2000);
466
                 let params = {
463
                 let params = {
467
                   suppliercode: this.supplier.supplierCode || "",
464
                   suppliercode: this.supplier.supplierCode || "",
468
                   suppliername: this.supplier.supplierName || "",
465
                   suppliername: this.supplier.supplierName || "",
469
-                  id: this.supplier.id|| 0,
466
+                  id: this.supplier_ids || 0,
470
                   suppliertype: this.supplier.supplierType || "",
467
                   suppliertype: this.supplier.supplierType || "",
471
                   vatrate: this.supplier.vatRate || 0,
468
                   vatrate: this.supplier.vatRate || 0,
472
                   number: this.supplier.number || "",
469
                   number: this.supplier.number || "",
511
           if (this.recordInfo.contacts.length == 0) {
508
           if (this.recordInfo.contacts.length == 0) {
512
             this.recordInfo.contacts = [{}];
509
             this.recordInfo.contacts = [{}];
513
             this.recordInfo.contacts[0].is_first = data.value;
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
     .el-autocomplete {
631
     .el-autocomplete {
640
       width: 75% !important;
632
       width: 75% !important;
641
     }
633
     }
634
+    .el-select.el-select--medium {
635
+      width: 70% !important;
636
+    }
642
   }
637
   }
643
 }
638
 }
644
 
639