Browse Source

供应商

mainqaq 3 years ago
parent
commit
a6e2919b5f
1 changed files with 15 additions and 17 deletions
  1. 15 17
      controllers/supply_order_api_contorller.go

+ 15 - 17
controllers/supply_order_api_contorller.go View File

@@ -307,21 +307,19 @@ func (this *SupplyOrderApiController) GetSupplyAndContactOne() {
307 307
 		tmpmap[k] = v
308 308
 	}
309 309
 	type SpSupplierNameList struct { //基于SpSupplierName结构体修改的,为了方便前端取数据整合了一下,删除了几个用不到的字段,添加了联系人名字和供应商类别两个字段
310
-		id           int64
311
-		suppliercode string
312
-		suppliername string
313
-		suppliertype int64
314
-		vatrate      float64
315
-		number       string
316
-		bank         string
317
-		bankaccount  string
318
-		userorgid    int64
319
-		status       int64
320
-		contactsid   int64
321
-		typename     string //供应商类别
322
-	}
323
-	//初始化该结构体
324
-	tmplist := []*SpSupplierNameList{}
310
+		Id           int64   `json:"id"`
311
+		Suppliercode string  `json:"suppliercode"`
312
+		Suppliername string  `json:"suppliername"`
313
+		Suppliertype int64   `json:"suppliertype"`
314
+		Vatrate      float64 `json:"vatrate"`
315
+		Number       string  `json:"number"`
316
+		Bank         string  `json:"bank"`
317
+		Bankaccount  string  `json:"bankaccount"`
318
+		Userorgid    int64   `json:"userorgid"`
319
+		Status       int64   `json:"status"`
320
+		Contactsid   int64   `json:"contactsid"`
321
+		Typename     string  `json:"typename"` //供应商类别
322
+	}
325 323
 
326 324
 	var typename string //类别名称
327 325
 	if supply.SupplierType == 0 {
@@ -343,14 +341,14 @@ func (this *SupplyOrderApiController) GetSupplyAndContactOne() {
343 341
 		supply.ContactsId,
344 342
 		typename,
345 343
 	}
346
-	tmplist = append(tmplist, tlist)
347 344
 	if err != nil {
348 345
 		utils.ErrorLog(err.Error())
349 346
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
350 347
 		return
351 348
 	}
349
+	fmt.Println(tlist)
352 350
 	this.ServeSuccessJSON(map[string]interface{}{
353
-		"supply":  tmplist,
351
+		"supply":  tlist,
354 352
 		"contact": contact,
355 353
 	})
356 354
 	return