Browse Source

用户信息管理>修改用户资料

XMTT 7 years ago
parent
commit
9a666b55b3

+ 105 - 0
css/model/sys/professornew.css

@ -31,3 +31,108 @@
31 31
    height: 250px;
32 32
    padding: 0 20px 10px;
33 33
}
34
35
.sys_professornew_details{
36
    width: 800px;
37
    height: 600px;
38
    padding: 0 20px 10px;
39
}
40
41
.sys_professornew_details .requiredSpan, .sys_professornew_honor .requiredSpan,
42
.sys_professornew_project .requiredSpan, .sys_professornew_job .requiredSpan,
43
.sys_professornew_edu .requiredSpan{
44
    color: #ff0000;
45
    position:relative;
46
    top:6px;
47
    left: -4px;
48
49
}
50
51
.sys_professornew_details .citybox .frmtype {
52
    border: 1px solid #B5B5B5;
53
}
54
55
.sys_professornew_details .citybox span {
56
    position: relative;
57
    width: 96%;
58
    display: inline-block;
59
    padding: 0 0 0 6px;
60
    cursor: pointer;
61
    margin: 0;
62
    background: #fff;
63
}
64
65
.sys_professornew_details .citybox span .mr_show.mr_select {
66
    color: #333;
67
}
68
69
.sys_professornew_details .citybox span .mr_show{
70
    font-style: normal;
71
    color: #AAAAAA;
72
    width: 100%;
73
    display: inline-block;
74
    height: 32px;
75
    line-height: 32px;
76
    position: relative;
77
}
78
79
.sys_professornew_details .citybox span .mr_show .mr_select {
80
    color: #333;
81
}
82
83
.sys_professornew_details .citybox span .mr_sj {
84
    position: absolute;
85
    right: 10px;
86
    top: 15px;
87
    display: inline-block;
88
    height: 0;
89
    width: 0;
90
    border: 6px solid #fff;
91
    border-color: #28b8fa transparent transparent;
92
}
93
94
.sys_professornew_details .citybox span ul {
95
    width: 98%;
96
    border-radius: 0 0 5px 5px;
97
    position: absolute;
98
    border: 1px solid #E8E8E8;
99
    background: #fff;
100
    left: -1px;
101
    top: 38px;
102
    margin-bottom: 10px;
103
    display: none;
104
    z-index: 10;
105
    max-height: 280px;
106
    overflow: auto;
107
}
108
109
.sys_professornew_details .citybox span ul li{
110
    width: 100%;
111
    float: left;
112
    overflow: hidden;
113
    border-top: 1px solid #E8E8E8;
114
}
115
116
.sys_professornew_details .citybox span ul li:first-child {
117
    border-top: 0;
118
}
119
120
.sys_professornew_details .citybox span ul li a {
121
    display: block;
122
    height: 30px;
123
    line-height: 30px;
124
    padding: 0 8px;
125
    color: #494949;
126
}
127
128
.sys_professornew_details .orgSize.dyn-mselect .icon-drop {
129
    display: none !important;
130
}
131
132
.sys_professornew_details .orgSize.dyn-mselect .dd-drop {
133
    display: none !important;
134
}
135
136
.sys_professornew_details .orgSize.dyn-mselect .placeholder {
137
    display: none !important;
138
}

+ 264 - 0
html/model/sys/professornew/details.html

@ -0,0 +1,264 @@
1
<div class="sys_professornew_details centerModal">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container newForm">
6
        <div class="row">
7
            <div class="col-2 item-caption">专家姓名</div>
8
            <div class="col-4">
9
                <div class="form-item text required readOnly" placeholder="姓名最长为10个字" name="name"></div>
10
            </div>
11
            <span class="requiredSpan">*</span>
12
        </div>
13
        <div class="row">
14
            <div class="col-2 item-caption">职称</div>
15
            <div class="col-4">
16
                <div class="form-item text" placeholder="职称不得超过20个字" name="title"></div>
17
            </div>
18
            <div class="col-2 item-caption">职位</div>
19
            <div class="col-4">
20
                <div class="form-item text" placeholder="职位不得超过20个字" name="office"></div>
21
            </div>
22
        </div>
23
        <div class="row">
24
            <div class="col-2 item-caption">所在机构</div>
25
            <div class="col-4">
26
                <div class="form-item text" placeholder="所在机构不得超过50个字" name="orgName"></div>
27
            </div>
28
            <div class="col-2 item-caption">所属部门</div>
29
            <div class="col-4">
30
                <div class="form-item text" placeholder="所在部门不得超过20个字" name="department"></div>
31
            </div>
32
        </div>
33
        <div class="row me">
34
            <div class="col-2 item-caption">联系电话</div>
35
            <div class="col-4">
36
                <div class="form-item text" placeholder="联系电话不得超过50个字" name="phone"></div>
37
            </div>
38
            <div class="col-2 item-caption">联系邮箱</div>
39
            <div class="col-4">
40
                <div class="form-item text" defVal="" name="email"></div>
41
            </div>
42
        </div>
43
        <div class="row me">
44
            <div class="col-2 item-caption">注册电话</div>
45
            <div class="col-4">
46
                <div class="form-item text readOnly" placeholder="联系电话不得超过50个字" name="loginPhone"></div>
47
            </div>
48
            <div class="col-2 item-caption">注册邮箱</div>
49
            <div class="col-4">
50
                <div class="form-item text readOnly" defVal="" name="loginEmail"></div>
51
            </div>
52
        </div>
53
        <div class="row">
54
            <div class="col-2 item-caption cityText">所在城市</div>
55
            <div class="col-8 city">
56
                <form action="" name="form1">
57
                    <div class=" col-6 citybox">
58
														<span class="frmtype frmtypeW" id="Province">
59
				                                        	<em class="mr_sj"></em>
60
				                                            <i class="mr_show" id="oprovince">请选择省份</i>
61
				                                            <ul>
62
				                                                <li><a href="javascript:void(0)"
63
                                                                       alt="请选择省份">请选择省份</a></li>
64
				                                            </ul>
65
				                                            <input type="hidden" name="cho_Province"
66
                                                                   value="请选择省份">
67
				                                        </span>
68
                    </div>
69
                    <div class="col-6 citybox">
70
														<span class="frmtype frmtypeW" id="City">
71
				                                       		<em class="mr_sj"></em>
72
				                                            <i class="mr_show" id="ocity"></i>
73
				                                            <ul>
74
				                                                <li><a href="javascript:void(0)"
75
                                                                       alt="请选择城市">请选择城市</a></li>
76
				                                            </ul>
77
				                                            <input type="hidden" name="cho_City" value="请选择城市 ">
78
				                                        </span>
79
                    </div>
80
                </form>
81
            </div>
82
        </div>
83
        <div class="row">
84
            <div class="col-2 item-caption">个人简介</div>
85
            <div class="col-6">
86
                <div class="form-item textarea" placeholder="个人简介不得超过500个字" name="descp"></div>
87
            </div>
88
        </div>
89
        <div class="row">
90
            <div class="col-2 item-caption">学术领域</div>
91
            <div class="col-4">
92
                <div class="form-item text" placeholder="添加内容不能超过15个字" name="newSubject"></div>
93
            </div>
94
            <div class="col-2">
95
                <div class="btn pull-right opt-subject">
96
                    <i class="icon-check"></i> 添加
97
                </div>
98
            </div>
99
        </div>
100
        <div class="row">
101
            <div class="col-2"></div>
102
            <div class="col-6">
103
                <div class="form-item dyn-mselect orgSize" name="subjectList"></div>
104
            </div>
105
        </div>
106
        <div class="row">
107
            <div class="col-2 item-caption">研究方向</div>
108
            <div class="col-4">
109
                <div class="form-item text" placeholder="添加内容不能超过20个字" name="newResearchArea"></div>
110
            </div>
111
            <div class="col-2">
112
                <div class="btn pull-right opt-ra">
113
                    <i class="icon-check"></i> 添加
114
                </div>
115
            </div>
116
        </div>
117
        <div class="row">
118
            <div class="col-2"></div>
119
            <div class="col-6">
120
                <div class="form-item dyn-mselect orgSize" name="researchAreaList"></div>
121
            </div>
122
        </div>
123
        <div class="row">
124
            <div class="col-2 item-caption">行业领域</div>
125
            <div class="col-4">
126
                <div class="form-item text" placeholder="添加内容不能超过15个字" name="newIndustry"></div>
127
            </div>
128
            <div class="col-2">
129
                <div class="btn pull-right opt-industry">
130
                    <i class="icon-check"></i> 添加
131
                </div>
132
            </div>
133
        </div>
134
        <div class="row">
135
            <div class="col-2"></div>
136
            <div class="col-6">
137
                <div class="form-item dyn-mselect orgSize" name="industryList"></div>
138
            </div>
139
        </div>
140
        <div class="row">
141
            <div class="col-10"></div>
142
            <div class="col-4 pull-right">
143
                <div class="btn pull-right opt-save">
144
                    <i class="icon-check"></i> 保存
145
                </div>
146
            </div>
147
        </div>
148
    </div>
149
    <div class="container">
150
        <table class="table table-bordered">
151
            <thead>
152
            <tr>
153
                <th>项目经历</th>
154
                <th class="col-3">
155
                    <div class="btn pull-right opt-project-new">
156
                        <i class="icon-check"></i> 添加
157
                    </div>
158
                </th>
159
            </tr>
160
            </thead>
161
            <tbody class="dt-project">
162
            <tr ch-dir="list">
163
                <td>{{name}}&nbsp;&nbsp;{{startMonth}}-{{stopMonth}}<br>{{descp}}</td>
164
                <td class="table-opt edit" pNo="{{no}}">
165
                    <div class="btn opt-project-edit">
166
                        <i class="icon-edit"></i>
167
                        编辑
168
                    </div>
169
                    <div class="btn pull-right opt-project-del">
170
                        <i class="icon-edit"></i>
171
                        删除
172
                    </div>
173
                </td>
174
            </tr>
175
        </table>
176
    </div>
177
    <div class="container">
178
        <table class="table table-bordered">
179
            <thead>
180
            <tr>
181
                <th>荣誉奖项</th>
182
                <th class="col-3">
183
                    <div class="btn pull-right opt-honor-new">
184
                        <i class="icon-check"></i> 添加
185
                    </div>
186
                </th>
187
            </tr>
188
            </thead>
189
            <tbody class="dt-honor">
190
            <tr ch-dir="list">
191
                <td>{{name}}&nbsp;&nbsp;{{year}}<br>{{descp}}</td>
192
                <td class="table-opt edit" hNo="{{no}}">
193
                    <div class="btn opt-honor-edit">
194
                        <i class="icon-edit"></i>
195
                        编辑
196
                    </div>
197
                    <div class="btn pull-right opt-honor-del">
198
                        <i class="icon-edit"></i>
199
                        删除
200
                    </div>
201
                </td>
202
            </tr>
203
            </tbody>
204
        </table>
205
    </div>
206
    <div class="container">
207
        <table class="table table-bordered">
208
            <thead>
209
            <tr>
210
                <th>工作经历</th>
211
                <th class="col-3">
212
                    <div class="btn pull-right opt-job-new">
213
                        <i class="icon-check"></i> 添加
214
                    </div>
215
                </th>
216
            </tr>
217
            </thead>
218
            <tbody class="dt-job">
219
            <tr ch-dir="list">
220
                <td>{{company}}-{{title}}-{{department}}&nbsp;&nbsp;{{startMonth}}-{{stopMonth}}</td>
221
                <td class="table-opt edit" jNo="{{no}}">
222
                    <div class="btn opt-job-edit">
223
                        <i class="icon-edit"></i>
224
                        编辑
225
                    </div>
226
                    <div class="btn pull-right opt-job-del">
227
                        <i class="icon-edit"></i>
228
                        删除
229
                    </div>
230
                </td>
231
            </tr>
232
            </tbody>
233
        </table>
234
    </div>
235
    <div class="container">
236
        <table class="table table-bordered">
237
            <thead>
238
            <tr>
239
                <th>教育背景</th>
240
                <th class="col-3">
241
                    <div class="btn pull-right opt-edu-new">
242
                        <i class="icon-check"></i> 添加
243
                    </div>
244
                </th>
245
            </tr>
246
            </thead>
247
            <tbody class="dt-edu">
248
            <tr ch-dir="list">
249
                <td>{{school}}-{{college}}-{{major}}-{{degree}}&nbsp;&nbsp;{{year}}<br>{{descp}}</td>
250
                <td class="table-opt edit" eNo="{{no}}">
251
                    <div class="btn opt-edu-edit">
252
                        <i class="icon-edit"></i>
253
                        编辑
254
                    </div>
255
                    <div class="btn pull-right opt-edu-del">
256
                        <i class="icon-edit"></i>
257
                        删除
258
                    </div>
259
                </td>
260
            </tr>
261
            </tbody>
262
        </table>
263
    </div>
264
</div>

+ 22 - 11
html/model/sys/professornew/index.html

@ -4,11 +4,23 @@
4 4
    </div>
5 5
    <div class="container dt-form">
6 6
        <div class="row">
7
            <div class="col-2 item-caption">用户名</div>
8
            <div class="col-3">
9
                <div class="form-item text trim" defVal="" name="name"></div>
7
            <div class="col-1"></div>
8
            <div class="col-1 item-caption ">用户名</div>
9
            <div class="col-2">
10
                <div class="form-item text" name="name"></div>
11
            </div>
12
            <div class="col-1 item-caption">激活状态</div>
13
            <div class="col-2">
14
                <div class="form-item select" dictCode="active_status" name="activeStatus"></div>
10 15
            </div>
11
            <div class="col-1 item-caption ">创建日期</div>
16
            <div class="col-1 item-caption">邀请状态</div>
17
            <div class="col-2">
18
                <div class="form-item select" dictCode="bool" name="sendMailStatus"></div>
19
            </div>
20
        </div>
21
        <div class="row">
22
            <div class="col-1"></div>
23
            <div class="col-1 item-caption ">发布时间</div>
12 24
            <div class="col-2">
13 25
                <div class="form-item date" defVal="" name="bt"></div>
14 26
            </div>
@ -16,7 +28,6 @@
16 28
            <div class="col-2">
17 29
                <div class="form-item date" defVal="" name="et"></div>
18 30
            </div>
19
            <div class="col-1"></div>
20 31
        </div>
21 32
        <div class="row">
22 33
            <div class="col-9">
@ -39,9 +50,9 @@
39 50
            <div class="btn opt-edit">
40 51
                修改账户信息
41 52
            </div>
42
            <!--<div class="btn opt-details">-->
43
                <!--编辑用户资料-->
44
            <!--</div>-->
53
            <div class="btn opt-details">
54
                编辑用户资料
55
            </div>
45 56
            <div class="btn opt-view">
46 57
                查看用户信息
47 58
            </div>
@ -86,15 +97,15 @@
86 97
                <td class="hand-dict" dict="solveStatus" code="{{authStatus}}"></td>
87 98
                <td class="hand-dict" dict="solveStatus" code="{{authStatusExpert}}"></td>
88 99
                <td>{{sortFirst}}</td>
89
                <td>{{activeStatus}}</td>
100
                <td class="hand-dict" dict="active_status" code="{{activeStatus}}"></td>
90 101
                <td>{{pageViews}}</td>
91 102
                <td class="hand-fans" id="{{id}}"></td>
92
                <td>{{sendMailStatus}}</td>
103
                <td>{{sendMailStatus-bool}}</td>
93 104
            </tr>
94 105
            </tbody>
95 106
            <tbody ch-dir="array.empty">
96 107
            <tr>
97
                <td class="empty-desc" colspan="11">表格暂无数据</td>
108
                <td class="empty-desc" colspan="16">表格暂无数据</td>
98 109
            </tr>
99 110
            </tbody>
100 111
        </table>

+ 504 - 0
js/model/sys/professornew/details.js

@ -0,0 +1,504 @@
1
/**
2
 * Created by TT on 2017/7/7.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form", "code"], function (spa, util, fb, code) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_professornew_details");
10
                var ca = {ready: true, items: []};
11
                var dp = code.parseCode(root.find(".dt-project"));
12
                var dh = code.parseCode(root.find(".dt-honor"));
13
                var dj = code.parseCode(root.find(".dt-job"));
14
                var de = code.parseCode(root.find(".dt-edu"));
15
                var form = fb.build(root.find(".newForm"), {
16
                    industryList: ca,
17
                    subjectList: ca,
18
                    researchAreaList: ca
19
                });
20
                var oValue;
21
                var oJudge;
22
                var trim = function (str) { //删除左右两端的空格			  
23
                    return str.replace(/(^\s*)|(\s*$)/g, "");
24
                };
25
                var saveBtn = root.find(".opt-save"),
26
                    save = function () {
27
                        form.val({
28
                            industry: oString(form.val().industryList),
29
                            subject: oString(form.val().subjectList),
30
                            researchArea: form.val().researchAreaList,
31
                            subjectList: "", industryList: "", researchAreaList: ""
32
                        });
33
                        if (form.val().title) {
34
                            var title = trim(form.val().title);
35
                            if (title.length > 20) {
36
                                util.alert("职称不得超过20个字");
37
                                return;
38
                            }
39
                        }
40
                        if (form.val().office) {
41
                            var office = trim(form.val().office);
42
                            if (office.length > 20) {
43
                                util.alert("职位不得超过20个字");
44
                                return;
45
                            }
46
                        }
47
                        if (form.val().orgName) {
48
                            var orgName = trim(form.val().orgName);
49
                            if (orgName.length > 50) {
50
                                util.alert("所在机构不得超过50个字");
51
                                return;
52
                            }
53
                        }
54
                        if (form.val().department) {
55
                            var department = trim(form.val().department);
56
                            if (department.length > 20) {
57
                                util.alert("所在部门不得超过20个字");
58
                                return;
59
                            }
60
                        }
61
                        if (form.val().descp) {
62
                            var descp = trim(form.val().descp);
63
                            if (descp.length > 500) {
64
                                util.alert("个人简介不得超过500个字");
65
                            }
66
                        }
67
                        if (form.val().phone) {
68
                            var phone = trim(form.val().phone);
69
                            if (trim(phone)) {
70
                                if (phone.length > 50) {
71
                                    util.alert('提示', '联系电话不得超过50个字');
72
                                    return;
73
                                }
74
                            }
75
                        }
76
                        if (form.val().email) {
77
                            var email = trim(form.val().email);
78
                            var gunf = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
79
                            if (!gunf.test(email)) {
80
                                util.alert("联系邮箱格式有误,请检查后重新填写");
81
                                return;
82
                            }
83
                        }
84
                        if (form.val().name) {
85
                            var name = trim(form.val().name);
86
                            if (name.length > 10) {
87
                                util.alert("姓名最长为10个字");
88
                                return;
89
                            }
90
                        }
91
                        if (form.val().name == null) {
92
                            util.alert("请输入专家姓名");
93
                        } else if (form.val().loginPhone || form.val().loginEmail) {
94
                            form.doPut("../ajax/sys/professor", function () {
95
                                spa.closeModal();
96
                                if (data.hand) {
97
                                    data.hand();
98
                                }
99
                            }, function (data) {
100
                                util.alert(data.msg);
101
                            });
102
                        } else {
103
                            util.alert("手机或邮箱至少输入一项");
104
                        }
105
                    };
106
                var part = function (one, list) {
107
                    oValue = one;
108
                    oJudge = list || [];
109
                    var repeat,
110
                        b;
111
                    if (!oValue) {
112
                        util.alert('提示', '请先填写内容');
113
                        return;
114
                    }
115
                    if (oValue.length > 15) {
116
                        util.alert('提示', '添加内容不能超过15个字');
117
                        return;
118
                    } else {
119
                        var oValueList = oValue.split(","),
120
                            length = oValueList.length;
121
                        for (var j = 0; j < length; j++) {
122
                            for (var n = j + 1; n < oValueList.length + 1;) {
123
                                if (oValueList[j] == oValueList[n]) {
124
                                    oValueList.remove(n);
125
                                    repeat = false;
126
                                } else {
127
                                    n++;
128
                                }
129
                            }
130
                        }
131
                        for (var j = 0; j < oValueList.length;) {
132
                            for (var i = 0; i < oJudge.length; i++) {
133
                                if (oValueList[j] == oJudge[i]) {
134
                                    oValueList.remove(j);
135
                                    repeat = false;
136
                                    b = true;
137
                                }
138
                            }
139
                            if (b) {
140
                                b = false
141
                            } else j++;
142
                        }
143
                        if (repeat == false) {
144
                            util.alert('提示', '添加内容不能重复');
145
                        }
146
                        for (var m = 0; m < oValueList.length; m++) {
147
                            ca.items.push({code: oValueList[m], caption: oValueList[m]});
148
                            oJudge.push(oValueList[m]);
149
                        }
150
                    }
151
                };
152
153
                var part2 = function (one, list) {
154
                    oValue = one;
155
                    oJudge = list || [];
156
                    var repeat,
157
                        b;
158
                    if (!oValue) {
159
                        util.alert('提示', '请先填写内容');
160
                        return;
161
                    }
162
                    if (oValue.length > 20) {
163
                        util.alert('提示', '添加内容不能超过20个字');
164
                        return;
165
                    } else {
166
                        var oValueList = oValue.split(","),
167
                            length = oValueList.length;
168
                        for (var j = 0; j < length; j++) {
169
                            for (var n = j + 1; n < oValueList.length + 1;) {
170
                                if (oValueList[j] == oValueList[n]) {
171
                                    oValueList.remove(n);
172
                                    repeat = false;
173
                                } else {
174
                                    n++;
175
                                }
176
                            }
177
                        }
178
                        for (var j = 0; j < oValueList.length;) {
179
                            for (var i = 0; i < oJudge.length; i++) {
180
                                if (oValueList[j] == oJudge[i]) {
181
                                    oValueList.remove(j);
182
                                    repeat = false;
183
                                    b = true;
184
                                }
185
                            }
186
                            if (b) {
187
                                b = false
188
                            } else j++;
189
                        }
190
                        if (repeat == false) {
191
                            util.alert('提示', '添加内容不能重复');
192
                        }
193
                        for (var m = 0; m < oValueList.length; m++) {
194
                            ca.items.push({code: oValueList[m], caption: oValueList[m]});
195
196
                            oJudge.push(oValueList[m]);
197
                        }
198
                    }
199
                };
200
201
                var split = function (data) {
202
                    var index = data.split(",");
203
                    var arr = [];
204
                    for (var m = 0; m < index.length; m++) {
205
                        ca.items.push({code: index[m], caption: index[m]});
206
                        arr.push(index[m]);
207
                    }
208
                    return arr;
209
                };
210
211
                var split2 = function (data) {
212
                    var arr = [];
213
                    for (var m = 0; m < data.length; m++) {
214
                        ca.items.push({code: data[m], caption: data[m]});
215
                        arr.push(data[m]);
216
                    }
217
                    return arr;
218
                };
219
220
                if (data.data.industry) {
221
                    form.val({industryList: split(data.data.industry)});
222
                }
223
                if (data.data.subject) {
224
                    form.val({subjectList: split(data.data.subject)});
225
                }
226
                if (data.data.researchArea) {
227
                    form.val({researchAreaList: split2(data.data.researchArea)});
228
                }
229
230
231
                Array.prototype.remove = function (obj) {
232
                    for (var i = 0; i < this.length; i++) {
233
                        var temp = this[i];
234
                        if (!isNaN(obj)) {
235
                            temp = i;
236
                        }
237
                        if (temp == obj) {
238
                            for (var j = i; j < this.length; j++) {
239
                                this[j] = this[j + 1];
240
                            }
241
                            this.length = this.length - 1;
242
                        }
243
                    }
244
                };
245
                function oString(data) {
246
                    var arry = new Array();
247
                    if (data) {
248
                        for (var i = 0; i < data.length; i++) {
249
                            arry.push(data[i]);
250
                        }
251
                    }
252
                    return arry.join(",");
253
                }
254
255
                root.find(".opt-industry").on("click", function () {
256
                    part(form.val().newIndustry, form.val().industryList);
257
                    form.val({newIndustry: "", industryList: oJudge});
258
                });
259
                root.find(".opt-subject").on("click", function () {
260
                    part(form.val().newSubject, form.val().subjectList);
261
                    form.val({newSubject: "", subjectList: oJudge});
262
                });
263
                root.find(".opt-ra").on("click", function () {
264
                    part2(form.val().newResearchArea, form.val().researchAreaList);
265
                    form.val({newResearchArea: "", researchAreaList: oJudge});
266
                });
267
                root.find(".modal-ctrl .icon-times").on("click", function () {
268
                    spa.closeModal();
269
                });
270
271
                root.find(".opt-project-new").on("click", function () {
272
                    spa.showModal("sys_userinfo_project_new", {
273
                        data: data.data.projects, hand: function () {
274
                            dp.val(data.data.projects);
275
                        }
276
                    });
277
                });
278
                root.on("click", ".opt-project-edit", function () {
279
                    var pNo = $(this).parent().attr("pNo");
280
                    spa.showModal("sys_userinfo_project_edit", {
281
                        data: data.data.projects[pNo], hand: function () {
282
                            dp.val(data.data.projects);
283
                        }
284
                    })
285
                });
286
                root.on("click", ".opt-project-del", function () {
287
                    var pNo = $(this).parent().attr("pNo");
288
                    if (pNo) {
289
                        util.boxMsg({
290
                            title: "确认删除",
291
                            content: "确认删除该项目经历?",
292
                            btns: [{
293
                                caption: "删除",
294
                                hand: function () {
295
                                    data.data.projects.remove(pNo);
296
                                    data.data.projects = data.data.projects || [];
297
                                    for (var i = 0; i < data.data.projects.length; ++i) {
298
                                        data.data.projects[i].no = i;
299
                                    }
300
                                    dp.val(data.data.projects);
301
                                    console.log(data.data.projects);
302
                                }
303
                            },
304
                                {caption: "取消"}
305
                            ]
306
                        });
307
                    } else {
308
                        util.alert("该项目经历不存在");
309
                    }
310
                });
311
                root.find(".opt-honor-new").on("click", function () {
312
                    spa.showModal("sys_userinfo_honor_new", {
313
                        data: data.data.honors, hand: function () {
314
                            dh.val(data.data.honors);
315
                        }
316
                    })
317
                });
318
                root.on("click", ".opt-honor-edit", function () {
319
                    var hNo = $(this).parent().attr("hNo");
320
                    spa.showModal("sys_userinfo_honor_edit", {
321
                        data: data.data.honors[hNo], hand: function () {
322
                            dh.val(data.data.honors);
323
                        }
324
                    })
325
                });
326
                root.on("click", ".opt-honor-del", function () {
327
                    var hNo = $(this).parent().attr("hNo");
328
                    if (hNo) {
329
                        util.boxMsg({
330
                            title: "确认删除",
331
                            content: "确认删除该荣誉奖项?",
332
                            btns: [{
333
                                caption: "删除",
334
                                hand: function () {
335
                                    data.data.honors.remove(hNo);
336
                                    data.data.honors = data.data.honors || [];
337
                                    for (var i = 0; i < data.data.honors.length; ++i) {
338
                                        data.data.honors[i].no = i;
339
                                    }
340
                                    dh.val(data.data.honors);
341
                                    console.log(data.data.honors);
342
                                }
343
                            },
344
                                {caption: "取消"}
345
                            ]
346
                        });
347
                    } else {
348
                        util.alert("该荣誉奖项不存在");
349
                    }
350
                });
351
                root.find(".opt-job-new").on("click", function () {
352
                    spa.showModal("sys_userinfo_job_new", {
353
                        data: data.data.jobs, hand: function () {
354
                            dj.val(data.data.jobs);
355
                        }
356
                    });
357
                });
358
                root.on("click", ".opt-job-edit", function () {
359
                    var jNo = $(this).parent().attr("jNo");
360
                    spa.showModal("sys_userinfo_job_edit", {
361
                        data: data.data.jobs[jNo], hand: function () {
362
                            dj.val(data.data.jobs);
363
                        }
364
                    })
365
                });
366
                root.on("click", ".opt-job-del", function () {
367
                    var jNo = $(this).parent().attr("jNo");
368
                    if (jNo) {
369
                        util.boxMsg({
370
                            title: "确认删除",
371
                            content: "确认删除该工作经历?",
372
                            btns: [{
373
                                caption: "删除",
374
                                hand: function () {
375
                                    data.data.jobs.remove(jNo);
376
                                    data.data.jobs = data.data.jobs || [];
377
                                    for (var i = 0; i < data.data.jobs.length; ++i) {
378
                                        data.data.jobs[i].no = i;
379
                                    }
380
                                    dj.val(data.data.jobs);
381
                                    console.log(data.data.jobs);
382
                                }
383
                            },
384
                                {caption: "取消"}
385
                            ]
386
                        });
387
                    } else {
388
                        util.alert("该工作经历不存在");
389
                    }
390
                });
391
                root.find(".opt-edu-new").on("click", function () {
392
                    spa.showModal("sys_userinfo_edu_new", {
393
                        data: data.data.edus, hand: function () {
394
                            de.val(data.data.edus);
395
                        }
396
                    });
397
                });
398
                root.on("click", ".opt-edu-edit", function () {
399
                    var eNo = $(this).parent().attr("eNo");
400
                    spa.showModal("sys_userinfo_edu_edit", {
401
                        data: data.data.edus[eNo], hand: function () {
402
                            de.val(data.data.edus);
403
                        }
404
                    })
405
                });
406
                root.on("click", ".opt-edu-del", function () {
407
                    var eNo = $(this).parent().attr("eNo");
408
                    if (eNo) {
409
                        util.boxMsg({
410
                            title: "确认删除",
411
                            content: "确认删除该工作经历?",
412
                            btns: [{
413
                                caption: "删除",
414
                                hand: function () {
415
                                    data.data.edus.remove(eNo);
416
                                    data.data.edus = data.data.edus || [];
417
                                    for (var i = 0; i < data.data.edus.length; ++i) {
418
                                        data.data.edus[i].no = i;
419
                                    }
420
                                    de.val(data.data.edus);
421
                                    console.log(data.data.edus);
422
                                }
423
                            },
424
                                {caption: "取消"}
425
                            ]
426
                        });
427
                    } else {
428
                        util.alert("该工作经历不存在");
429
                    }
430
                });
431
                $.fn.citySelect();
432
                $(document).on("click", "#City li a", function () {
433
                    var aVal = $(this).text();
434
                    $(this).parent().parent().parent().find('.mr_show').text(aVal);
435
                    $(this).parent().parent().parent().find('input[name=cho_City]').val(aVal);
436
                    if ($("#ocity").text() == "请选择城市") {
437
                        $("#ocity").removeClass("mr_select");
438
                    } else {
439
                        $("#ocity").addClass("mr_select");
440
                    }
441
                    if ($("#oprovince").text() != "请选择省份") {
442
                        form.val({province: $("#oprovince").text()});
443
                    }
444
                    if ($("#ocity").text() != "请选择城市") {
445
                        form.val({address: $("#ocity").text()});
446
                    }
447
448
                });
449
450
                if (data.data.province) {
451
                    $("#oprovince").text(data.data.province);
452
                }
453
                if (data.data.address) {
454
                    $("#ocity").text(data.data.address);
455
                }
456
                saveBtn.on("click", function () {
457
                    save();
458
                });
459
460
                // data.data.projects = data.data.projects || [];
461
                // for (var i = 0; i < data.data.projects.length; ++i) {
462
                //     data.data.projects[i].no = i;
463
                // }
464
                // dp.val(data.data.projects);
465
                //
466
                // data.data.honors = data.data.honors || [];
467
                // for (var i = 0; i < data.data.honors.length; ++i) {
468
                //     data.data.honors[i].no = i;
469
                // }
470
                // dh.val(data.data.honors);
471
                //
472
                // data.data.jobs = data.data.jobs || [];
473
                // for (var i = 0; i < data.data.jobs.length; ++i) {
474
                //     data.data.jobs[i].no = i;
475
                // }
476
                // dj.val(data.data.jobs);
477
                //
478
                // data.data.edus = data.data.edus || [];
479
                // for (var i = 0; i < data.data.edus.length; ++i) {
480
                //     data.data.edus[i].no = i;
481
                // }
482
                // de.val(data.data.edus);
483
484
                /*
485
                加载项目经历、荣誉奖项、工作经历、教育背景
486
                 */
487
                util.get("../ajax/project/professor", {professorId: data.data.id}, function (projects) {
488
                    dp.val(projects);
489
                });
490
                util.get("../ajax/honor/professor", {professorId: data.data.id}, function (honors) {
491
                    dh.val(honors);
492
                });
493
                util.get("../ajax/job/professor", {professorId: data.data.id}, function (jobs) {
494
                    dj.val(jobs);
495
                });
496
                util.get("../ajax/edu/professor", {professorId: data.data.id}, function (edus) {
497
                    de.val(edus);
498
                });
499
500
                form.val(data.data);
501
            }
502
        }
503
    });
504
});

+ 43 - 35
js/model/sys/professornew/index.js

@ -15,14 +15,18 @@ spa_define(function () {
15 15
                    }
16 16
                    return "";
17 17
                });
18
                pdg.code.shell("bool", function (env) {
19
                    var v = env.cd[this.k];
20
                    return v === 1 ? "是" : (v === 0 ? "否" : "");
21
                });
18 22
                pdg.code.listen($.dict.doTransfer);
19
                pdg.code.listen(function(){
20
                    root.find(".hand-fans").each(function() {
23
                pdg.code.listen(function () {
24
                    root.find(".hand-fans").each(function () {
21 25
                        var $e = $(this);
22 26
                        var collectionid = $e.attr("id");
23
                        util.get("/ajax/content/countProfessor",{id:collectionid,type:1},function(data){
27
                        util.get("/ajax/content/countProfessor", {id: collectionid, type: 1}, function (data) {
24 28
                            $e.text(data);
25
                        },{});
29
                        }, {});
26 30
                        $e.removeClass("hand-fans");
27 31
                    });
28 32
                });
@ -56,11 +60,39 @@ spa_define(function () {
56 60
                        } else {
57 61
                            util.get("../ajax/sys/professor/luserId/" + $org.attr("professorId"), null, function (data) {
58 62
                                if (data) {
59
                                        spa.showModal("sys_professornew_edit", {
60
                                            data: data,name:$org.attr("na"), hand: function () {
61
                                                pdg.load()
63
                                    spa.showModal("sys_professornew_edit", {
64
                                        data: data, name: $org.attr("na"), hand: function () {
65
                                            pdg.load()
66
                                        }
67
                                    })
68
                                } else {
69
                                    util.alert("用户不存在了", function () {
70
                                        pdg.load();
71
                                    });
72
                                }
73
                            }, {});
74
                        }
75
                    } else {
76
                        util.alert("请选择一个用户");
77
                    }
78
                });
79
                root.find(".opt-details").on("click", function () {
80
                    var $professor = root.find("td.opt-check>i.checked");
81
                    if ($professor.length) {
82
                        if ($professor.length > 1) {
83
                            util.alert("只能选择一个用户");
84
                        } else {
85
                            util.get("../ajax/sys/professor/detail/" + $professor.attr("professorId"), null, function (data) {
86
                                if (data) {
87
                                    if (data.activeStatus != "1") {
88
                                        spa.showModal("sys_professornew_details", {
89
                                            data: data, hand: function () {
90
                                                pdg.reload()
62 91
                                            }
63 92
                                        })
93
                                    }else {
94
                                        util.alert("只能修改未激活的用户");
95
                                    }
64 96
                                } else {
65 97
                                    util.alert("用户不存在了", function () {
66 98
                                        pdg.load();
@ -72,30 +104,6 @@ spa_define(function () {
72 104
                        util.alert("请选择一个用户");
73 105
                    }
74 106
                });
75
                // root.find(".opt-details").on("click", function () {
76
                //     var $org = root.find("td.opt-check>i.checked");
77
                //     if ($org.length) {
78
                //         if ($org.length > 1) {
79
                //             util.alert("只能选择一个用户");
80
                //         } else {
81
                //             util.get("../ajax/sys/org/id/" + $org.attr("orgId"), null, function (data) {
82
                //                 if (data) {
83
                //                     spa.showModal("sys_org_details", {
84
                //                         data: data, hand: function () {
85
                //                             pdg.load()
86
                //                         }
87
                //                     })
88
                //                 } else {
89
                //                     util.alert("用户不存在了", function () {
90
                //                         pdg.load();
91
                //                     });
92
                //                 }
93
                //             }, {});
94
                //         }
95
                //     } else {
96
                //         util.alert("请选择一个用户");
97
                //     }
98
                // });
99 107
                root.find(".opt-data").on("click", function () {
100 108
                    var $professor = root.find("td.opt-check>i.checked");
101 109
                    if ($professor.length) {
@ -121,12 +129,12 @@ spa_define(function () {
121 129
                    }
122 130
                });
123 131
                root.find(".opt-view").on("click", function () {
124
                    var $org = root.find("td.opt-check>i.checked");
125
                    if ($org.length) {
126
                        if ($org.length > 1) {
132
                    var $professor = root.find("td.opt-check>i.checked");
133
                    if ($professor.length) {
134
                        if ($professor.length > 1) {
127 135
                            util.alert("只能选择一个用户");
128 136
                        } else {
129
                            window.open('http://www.ekexiu.com/userInforShow.html?professorId=' + $org.attr("professorid"));
137
                            window.open('http://www.ekexiu.com/userInforShow.html?professorId=' + $professor.attr("professorid"));
130 138
                        }
131 139
                    } else {
132 140
                        util.alert("请选择一个用户");

+ 5 - 0
js/static.js

@ -187,6 +187,11 @@
187 187
            code:"5",caption:"论文",enabled:true
188 188
        }]);
189 189
190
        dict.set("active_status", [{
191
            code: "0", caption: "未激活", enabled: true
192
        }, {
193
            code: "1", caption: "已激活", enabled: true
194
        }]);
190 195
    });
191 196
192 197
})();