Browse Source

添加条件全部显示客户信息

wangxingcheng 3 years ago
parent
commit
d8120cfa3e

+ 20 - 10
opms_parent/app/model/cust/cust_customer.go

@@ -22,6 +22,7 @@ type CustCustomerSearchReq struct {
 	CustName     string `json:"custName"`
 	CustIndustry string `json:"custIndustry"`
 	CustLevel    string `json:"custLevel"`
+	TargetType   string `json:"targetType,omitempty"`
 	request.PageReq
 }
 
@@ -33,17 +34,15 @@ type AddCustCustomerReq struct {
 
 // 单表添加客户信息表
 type Customer struct {
-	CustName string `p:"custName"        json:"custName"   v:"required#客户名称不能为空"`
-	AbbrName string `p:"abbrName"        json:"abbrName"   ` // 助计名
-	//IndusTry     string      `p:"indusTry"        json:"indusTry"  v:"required#客户行业不能为空" ` //客户行业
-	//Level        string      `p:"level"        json:"level"  v:"required#客户级别不能为空" `
+	CustName     string      `p:"custName"        json:"custName"   v:"required#客户名称不能为空"`
+	AbbrName     string      `p:"abbrName"        json:"abbrName"   `                         // 助计名
 	CustLocation string      `p:"custLocation"    json:"custLocation"    `                    // 所在地区
 	CustAddress  string      `p:"custAddress"     json:"custAddress"   `                      // 详细地址
 	FollowUpDate *gtime.Time `p:"followUpDate"     json:"followUpDate"   `                    //跟进时间
 	CustIndustry string      `p:"custIndustry"     json:"custIndustry" v:"required#客户行业不能为空"` //客户行业
 	CustLevel    string      `p:"custLevel"     json:"custLevel"       v:"required#客户级别不能为空"` //客户级别
-	CustDistCode int         `p:"custDistCode" json custDistCode`                             // 省份Id
-	Remark       string      `p:"remark" json remark`                                         //备注
+	CustDistCode int         `p:"custDistCode" json:"custDistCode"  v:"required#省份不能为空" `     // 省份Id
+	Remark       string      `p:"remark" json:"remark""`                                      //备注
 	SalesName    string      `p:"salesName"       json:"salesName"   `                        //
 	SalesId      string      `p:"salesId"         json:"salesId"   `                          //
 }
@@ -96,15 +95,26 @@ type DelCustomer struct {
 	Id int `json:"id"` //客户id
 }
 
+type DelCustomerContact struct {
+	Id     int `json:"id"`   //联系人id
+	CustId int `json:custId` //客户Id
+}
+
 //合并客户参数
 type MergecustomerRep struct {
-	Id       int       `    json:"id"` //目标Id
-	Customer *Customer `json:"customer,omitempty"`
-	ChooseId []int64   `json:"chooseId,omitempty"` //被合并的客户id
+	Id int `json:"id"` //目标Id
+	*Customer
+	ChooseId []int64 `json:"chooseId,omitempty"` //被合并的客户id
 }
 
 //修改客户
 type UpdateCustomer struct {
-	Id int `json:"ids,omitempty"` //客户id
+	Id int `json:"id,omitempty"` //客户id
 	*Customer
 }
+
+//移入公海
+type MoveToPubicRep struct {
+	Ids    []int64 `json:"ids,omitempty"`
+	Remark string  `json:"remark,omitempty"`
+}

+ 7 - 5
opms_parent/app/service/cust/cust_customer.go

@@ -123,11 +123,13 @@ func (c *CustomerService) GetList(req *model.CustCustomerSearchReq) (total int,
 	g.Log().Info("serverS", req)
 	Model := c.Dao.M
 	Model = Model.Where(c.Dao.Columns.DeletedTime + " is null")
-	if !req.IsPublic {
-		Model = Model.Where(c.Dao.Columns.SalesId, c.CxtUser.Id).Where(c.Dao.Columns.IsPublic, noPublic)
-	} else {
-		g.Log().Info("serverS", req)
-		Model = Model.Where(c.Dao.Columns.IsPublic, isPublic)
+	if req.TargetType != "" {
+		if !req.IsPublic {
+			Model = Model.Where(c.Dao.Columns.SalesId, c.CxtUser.Id).Where(c.Dao.Columns.IsPublic, noPublic)
+		} else {
+			g.Log().Info("serverS", req)
+			Model = Model.Where(c.Dao.Columns.IsPublic, isPublic)
+		}
 	}
 	//客户名称
 	if req.CustName != "" {