Browse Source

添加机构联系人字段

庄逸洲 5 years ago
parent
commit
f41e33c9c3

+ 6 - 3
controllers/org_controller.go View File

66
 
66
 
67
 // /org/create/submit [post]
67
 // /org/create/submit [post]
68
 // @param name:string
68
 // @param name:string
69
-// @param short_name:string
69
+// @param short_name:string 已和 name 同步,不需要传了
70
 // @param intro?:string
70
 // @param intro?:string
71
 // @param logo?:string
71
 // @param logo?:string
72
 // @param province:int
72
 // @param province:int
75
 // @param address:string
75
 // @param address:string
76
 // @param ill?:string ("病种1,病种2")
76
 // @param ill?:string ("病种1,病种2")
77
 // @param category:int
77
 // @param category:int
78
+// @param contact_name:string
78
 // @param org_phone?:string
79
 // @param org_phone?:string
79
 // @param business_week?:string
80
 // @param business_week?:string
80
 // @param business_time?:string
81
 // @param business_time?:string
105
 	}
106
 	}
106
 
107
 
107
 	name := this.GetString("name")
108
 	name := this.GetString("name")
108
-	shortName := this.GetString("short_name")
109
+	shortName := name // this.GetString("short_name")
109
 	intro := this.GetString("intro")
110
 	intro := this.GetString("intro")
110
 	logo := this.GetString("logo")
111
 	logo := this.GetString("logo")
111
 	province, _ := this.GetInt("province", 0)
112
 	province, _ := this.GetInt("province", 0)
114
 	address := this.GetString("address")
115
 	address := this.GetString("address")
115
 	ill := this.GetString("ill")
116
 	ill := this.GetString("ill")
116
 	category, _ := this.GetInt64("category")
117
 	category, _ := this.GetInt64("category")
117
-	if len(name) == 0 || len(shortName) == 0 || len(address) == 0 || province <= 0 || city <= 0 || district <= 0 || category <= 0 {
118
+	contactName := this.GetString("contact_name")
119
+	if len(name) == 0 || len(shortName) == 0 || len(contactName) == 0 || len(address) == 0 || province <= 0 || city <= 0 || district <= 0 || category <= 0 {
118
 		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
120
 		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
119
 		this.ServeJSON()
121
 		this.ServeJSON()
120
 		return
122
 		return
151
 		OrgType:         category,
153
 		OrgType:         category,
152
 		OperatingState:  businessState,
154
 		OperatingState:  businessState,
153
 		Telephone:       orgPhone,
155
 		Telephone:       orgPhone,
156
+		ContactName:     contactName,
154
 		BusinessWeek:    businessWeek,
157
 		BusinessWeek:    businessWeek,
155
 		BusinessTime:    businessTime,
158
 		BusinessTime:    businessTime,
156
 		Gallery:         orgPics,
159
 		Gallery:         orgPics,

+ 1 - 0
models/org_models.go View File

16
 	CreateTime      int64  `gorm:"column:ctime" json:"ctime"` // 创建时间
16
 	CreateTime      int64  `gorm:"column:ctime" json:"ctime"` // 创建时间
17
 	ModifyTime      int64  `gorm:"column:mtime" json:"mtime"` // 修改时间
17
 	ModifyTime      int64  `gorm:"column:mtime" json:"mtime"` // 修改时间
18
 
18
 
19
+	ContactName    string        `gorm:"column:contact_name" json:"contact_name"`
19
 	OrgType        int64         `gorm:"column:org_type" json:"org_type"`
20
 	OrgType        int64         `gorm:"column:org_type" json:"org_type"`
20
 	Evaluate       float64       `gorm:"column:evaluate" json:"evaluate"`
21
 	Evaluate       float64       `gorm:"column:evaluate" json:"evaluate"`
21
 	Comments       int64         `gorm:"column:comments" json:"comments"`
22
 	Comments       int64         `gorm:"column:comments" json:"comments"`

+ 7 - 3
static/js/create_org.js View File

119
 
119
 
120
         var postData = {
120
         var postData = {
121
             name: $("#org_name").val(),
121
             name: $("#org_name").val(),
122
-            short_name: $("#org_short_name").val(),
122
+            // short_name: $("#org_short_name").val(),
123
+            contact_name: $("#contact_name").val(),
123
             province: $("#province_select option:selected").val(),
124
             province: $("#province_select option:selected").val(),
124
             city: $("#city_select option:selected").val(),
125
             city: $("#city_select option:selected").val(),
125
             district: $("#district_select option:selected").val(),
126
             district: $("#district_select option:selected").val(),
144
     if ($("#org_name").val().length == 0) {
145
     if ($("#org_name").val().length == 0) {
145
         return "请填写机构名称";
146
         return "请填写机构名称";
146
     }
147
     }
147
-    if ($("#org_short_name").val().length == 0) {
148
-        return "请填写机构简称";
148
+    // if ($("#org_short_name").val().length == 0) {
149
+    //     return "请填写机构简称";
150
+    // }
151
+    if ($("#contact_name").val().length == 0) {
152
+        return "请填写联系人姓名";
149
     }
153
     }
150
     if ($("#province_select option:selected").val() == "0") {
154
     if ($("#province_select option:selected").val() == "0") {
151
         return "请选择省份";
155
         return "请选择省份";

+ 7 - 3
views/new_main/create_org.html View File

43
                     <label class="cell_tit fl">机构名称</label>
43
                     <label class="cell_tit fl">机构名称</label>
44
                     <input id="org_name" type="text" class="cell_input" maxlength="50" />
44
                     <input id="org_name" type="text" class="cell_input" maxlength="50" />
45
                 </div>
45
                 </div>
46
-                <div class="cell clearfix">
46
+                <!-- <div class="cell clearfix">
47
                     <label class="cell_tit fl">机构简称</label>
47
                     <label class="cell_tit fl">机构简称</label>
48
-                    <input id="org_short_name" type="text" class="cell_input" maxlength="20" />
48
+                    <input id="org_short_name" type="text" class="cell_input" maxlength="50" />
49
+                </div> -->
50
+                <div class="cell clearfix">
51
+                    <label class="cell_tit fl">联系人姓名</label>
52
+                    <input id="contact_name" type="text" class="cell_input" maxlength="20" />
49
                 </div>
53
                 </div>
50
                 <div class="cell clearfix">
54
                 <div class="cell clearfix">
51
                     <label class="cell_tit fl">机构类型</label>
55
                     <label class="cell_tit fl">机构类型</label>
115
     <script src="/static/js/layer.js"></script>
119
     <script src="/static/js/layer.js"></script>
116
     <script src="/static/js/md5.js"></script>
120
     <script src="/static/js/md5.js"></script>
117
     <script src="/static/js/common.js"></script>
121
     <script src="/static/js/common.js"></script>
118
-    <script src="/static/js/create_org.js?v=0.2.4"></script>
122
+    <script src="/static/js/create_org.js?v=0.2.5"></script>
119
 </body>
123
 </body>
120
 
124
 
121
 </html>
125
 </html>