Browse Source

Merge remote-tracking branch 'origin/master'

XMTT 7 years ago
parent
commit
3ef08aa633

+ 144 - 0
html/model/sys/org/details.html

@ -0,0 +1,144 @@
1
<div class="sys_org_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-6">
9
                <div class="form-item text readOnly" defVal="" name="name"></div>
10
            </div>
11
        </div>
12
        <div class="row">
13
            <div class="col-2 item-caption">企业简称</div>
14
            <div class="col-6">
15
                <div class="form-item text" defVal="" name="forShort"></div>
16
            </div>
17
            <span class="requiredSpan">*</span>
18
        </div>
19
        <div class="row">
20
            <div class="col-2 item-caption">企业网址</div>
21
            <div class="col-6">
22
                <div class="form-item text" defVal="" name="orgUrl"></div>
23
            </div>
24
        </div>
25
        <div class="row">
26
            <div class="col-2 item-caption">创建时间</div>
27
            <div class="col-4">
28
                <div class="form-item date" defVal="" name="foundTime"></div>
29
            </div>
30
        </div>
31
        <div class="row">
32
            <div class="col-2 item-caption">地址</div>
33
            <div class="col-8">
34
                <form action="" name="form1">
35
                    <div class=" col-6 citybox">
36
														<span class="frmtype frmtypeW" id="Province">
37
				                                        	<em class="mr_sj"></em>
38
				                                            <i class="mr_show" id="oprovince">请选择省份</i>
39
				                                            <ul>
40
				                                                <li><a href="javascript:void(0)" alt="请选择省份">请选择省份</a></li>
41
				                                            </ul>
42
				                                            <input type="hidden" name="cho_Province"
43
                                                                   value="请选择省份">
44
				                                        </span>
45
                    </div>
46
                    <div class="col-6 citybox">
47
														<span class="frmtype frmtypeW" id="City">
48
				                                       		<em class="mr_sj"></em>
49
				                                            <i class="mr_show" id="ocity"></i>
50
				                                            <ul>
51
				                                                <li><a href="javascript:void(0)" alt="请选择城市">请选择城市</a></li>
52
				                                            </ul>
53
				                                            <input type="hidden" name="cho_City" value="请选择城市 ">
54
				                                        </span>
55
                    </div>
56
                </form>
57
            </div>
58
        </div>
59
        <div class="row">
60
            <div class="col-2 item-caption">简介</div>
61
            <div class="col-4">
62
                <div class="form-item textarea" defVal="" name="descp"></div>
63
            </div>
64
        </div>
65
        <div class="row">
66
            <div class="col-2 item-caption">标签</div>
67
            <div class="col-4">
68
                <div class="form-item select" defVal="" dictCode="typeOrg" name="orgType"></div>
69
            </div>
70
        </div>
71
        <div class="row">
72
            <div class="col-2 item-caption">所属行业</div>
73
            <div class="col-4">
74
                <div class="form-item text" defVal="" name="newIndustry"></div>
75
            </div>
76
            <div class="col-2">
77
                <div class="btn pull-right opt-industry">
78
                    <i class="icon-check"></i> SAVE
79
                </div>
80
            </div>
81
        </div>
82
        <div class="row">
83
            <div class="col-2"></div>
84
            <div class="col-6">
85
                <div class="form-item dyn-mselect orgSize"  name="industryList"></div>
86
            </div>
87
        </div>
88
        <div class="row">
89
            <div class="col-2 item-caption">专注领域</div>
90
            <div class="col-4">
91
                <div class="form-item text" defVal="" name="newSubject"></div>
92
            </div>
93
            <div class="col-2">
94
                <div class="btn pull-right opt-subject">
95
                    <i class="icon-check"></i> SAVE
96
                </div>
97
            </div>
98
        </div>
99
        <div class="row">
100
            <div class="col-2"></div>
101
            <div class="col-6">
102
                <div class="form-item dyn-mselect orgSize"  name="subjectList"></div>
103
            </div>
104
        </div>
105
        <div class="row">
106
            <div class="col-2 item-caption">企业规模</div>
107
            <div class="col-4">
108
                <div class="form-item select" defVal="" dictCode="orgSize" name="orgSize"></div>
109
            </div>
110
        </div>
111
        <div class="row">
112
            <div class="col-2 item-caption">企业资质</div>
113
            <div class="col-4">
114
                <div class="form-item text" defVal="" name="newQualification"></div>
115
            </div>
116
            <div class="col-2">
117
                <div class="btn pull-right opt-qf">
118
                    <i class="icon-check"></i> SAVE
119
                </div>
120
            </div>
121
        </div>
122
        <div class="row">
123
            <div class="col-2"></div>
124
            <div class="col-6">
125
                <div class="form-item dyn-mselect orgSize"  name="qualificationList"></div>
126
            </div>
127
        </div>
128
        <div class="row">
129
            <div class="col-10"></div>
130
            <div class="col-2">
131
                <div class="btn pull-right opt-save">
132
                    <i class="icon-check"></i> SAVE
133
                </div>
134
            </div>
135
        </div>
136
        <div class="head-ctn">
137
            <div id="uploader-demo">
138
                <div id="fileList" class="uploader-list"></div>
139
                <div id="filePicker">选择图片</div>
140
            </div>
141
        </div>
142
143
    </div>
144
</div>

+ 1 - 7
html/model/sys/org/edit.html

@ -6,13 +6,7 @@
6 6
        <div class="row">
7 7
            <div class="col-2 item-caption">企业名称</div>
8 8
            <div class="col-6">
9
                <div class="form-item text" defVal="" name="name"></div>
10
            </div>
11
        </div>
12
        <div class="row">
13
            <div class="col-2 item-caption">邮箱账户</div>
14
            <div class="col-6">
15
                <div class="form-item text showOnly" defVal="" name="email"></div>
9
                <div class="form-item text readOnly" defVal="" name="name"></div>
16 10
            </div>
17 11
        </div>
18 12
        <div class="row">

+ 10 - 4
html/model/sys/org/index.html

@ -40,13 +40,19 @@
40 40
	<div class="container tpl-btns">
41 41
		<div class="row">
42 42
			<div class="btn opt-new">
43
				<i class="icon-plus"></i> 增加
43
				新增账户
44 44
			</div>
45 45
			<div class="btn opt-edit">
46
				<i class="icon-edit"></i>编缉
46
				修改账户信息
47 47
			</div>
48
			<div class="btn opt-del">
49
				<i class="icon-remove-sign"></i>删除
48
			<div class="btn opt-details">
49
				编辑企业资料
50
			</div>
51
			<div class="btn opt-view">
52
				查看企业信息
53
			</div>
54
			<div class="btn opt-data">
55
				设置业务数据
50 56
			</div>
51 57
		</div>
52 58
	</div>

+ 8 - 130
html/model/sys/org/new.html

@ -4,150 +4,28 @@
4 4
    </div>
5 5
    <div class="container newForm">
6 6
        <div class="row">
7
            <div class="col-2 item-caption">企业名称</div>
7
            <div class="col-2 item-caption">邮箱</div>
8 8
            <div class="col-6">
9
                <div class="form-item text" defVal="" name="name"></div>
9
                <div class="form-item text required" placeholder="请输入正确的邮箱地址" name="email"></div>
10 10
            </div>
11
            <span class="requiredSpan">*</span>
12 11
        </div>
12
        <span class="requiredSpan">*</span>
13 13
        <div class="row">
14
            <div class="col-2 item-caption">邮箱账户</div>
14
            <div class="col-2 item-caption">用户名</div>
15 15
            <div class="col-6">
16
                <div class="form-item text" defVal="" name="email"></div>
17
            </div>
18
            <span class="requiredSpan">*</span>
19
        </div>
20
        <div class="row">
21
            <div class="col-2 item-caption">企业简称</div>
22
            <div class="col-6">
23
                <div class="form-item text" defVal="" name="forShort"></div>
24
            </div>
25
            <span class="requiredSpan">*</span>
26
        </div>
27
        <div class="row">
28
            <div class="col-2 item-caption">企业网址</div>
29
            <div class="col-6">
30
                <div class="form-item text" defVal="" name="orgUrl"></div>
31
            </div>
32
        </div>
33
        <div class="row">
34
            <div class="col-2 item-caption">创建时间</div>
35
            <div class="col-4">
36
                <div class="form-item date" defVal="" name="foundTime"></div>
37
            </div>
38
        </div>
39
        <div class="row">
40
            <div class="col-2 item-caption">地址</div>
41
            <div class="col-8">
42
                <form action="" name="form1">
43
                    <div class=" col-6 citybox">
44
														<span class="frmtype frmtypeW" id="Province">
45
				                                        	<em class="mr_sj"></em>
46
				                                            <i class="mr_show" id="oprovince">请选择省份</i>
47
				                                            <ul>
48
				                                                <li><a href="javascript:void(0)" alt="请选择省份">请选择省份</a></li>
49
				                                            </ul>
50
				                                            <input type="hidden" name="cho_Province"
51
                                                                   value="请选择省份">
52
				                                        </span>
53
                    </div>
54
                    <div class="col-6 citybox">
55
														<span class="frmtype frmtypeW" id="City">
56
				                                       		<em class="mr_sj"></em>
57
				                                            <i class="mr_show" id="ocity"></i>
58
				                                            <ul>
59
				                                                <li><a href="javascript:void(0)" alt="请选择城市">请选择城市</a></li>
60
				                                            </ul>
61
				                                            <input type="hidden" name="cho_City" value="请选择城市 ">
62
				                                        </span>
63
                    </div>
64
                </form>
65
            </div>
66
            <span class="requiredSpan">*</span>
67
        </div>
68
        <div class="row">
69
            <div class="col-2 item-caption">简介</div>
70
            <div class="col-4">
71
                <div class="form-item textarea" defVal="" name="descp"></div>
72
            </div>
73
        </div>
74
        <div class="row">
75
            <div class="col-2 item-caption">标签</div>
76
            <div class="col-4">
77
                <div class="form-item select" defVal="" dictCode="typeOrg" name="orgType"></div>
78
            </div>
79
        </div>
80
        <div class="row">
81
            <div class="col-2 item-caption">所属行业</div>
82
            <div class="col-4">
83
                <div class="form-item text" defVal="" name="newIndustry"></div>
84
            </div>
85
            <div class="col-2">
86
                <div class="btn pull-right opt-industry">
87
                    <i class="icon-check"></i> SAVE
88
                </div>
89
            </div>
90
        </div>
91
        <div class="row">
92
            <div class="col-2"></div>
93
            <div class="col-6">
94
                <div class="form-item dyn-mselect orgSize"  name="industryList"></div>
95
            </div>
96
        </div>
97
        <div class="row">
98
            <div class="col-2 item-caption">专注领域</div>
99
            <div class="col-4">
100
                <div class="form-item text" defVal="" name="newSubject"></div>
101
            </div>
102
            <div class="col-2">
103
                <div class="btn pull-right opt-subject">
104
                    <i class="icon-check"></i> SAVE
105
                </div>
106
            </div>
107
        </div>
108
        <div class="row">
109
            <div class="col-2"></div>
110
            <div class="col-6">
111
                <div class="form-item dyn-mselect orgSize"  name="subjectList"></div>
112
            </div>
113
        </div>
114
        <div class="row">
115
            <div class="col-2 item-caption">企业规模</div>
116
            <div class="col-4">
117
                <div class="form-item select" defVal="" dictCode="orgSize" name="orgSize"></div>
118
            </div>
119
        </div>
120
        <div class="row">
121
            <div class="col-2 item-caption">企业资质</div>
122
            <div class="col-4">
123
                <div class="form-item text" defVal="" name="newQualification"></div>
124
            </div>
125
            <div class="col-2">
126
                <div class="btn pull-right opt-qf">
127
                    <i class="icon-check"></i> SAVE
128
                </div>
129
            </div>
130
        </div>
131
        <div class="row">
132
            <div class="col-2"></div>
133
            <div class="col-6">
134
                <div class="form-item dyn-mselect orgSize"  name="qualificationList"></div>
16
                <div class="form-item text required" placeholder="姓名最长为10个字" name="name"></div>
135 17
            </div>
136 18
        </div>
19
        <span class="requiredSpan">*</span>
137 20
        <div class="row">
138 21
            <div class="col-10"></div>
139 22
            <div class="col-2">
140 23
                <div class="btn pull-right opt-save">
141 24
                    <i class="icon-check"></i> SAVE
142 25
                </div>
26
143 27
            </div>
144 28
        </div>
145
        <div class="head-ctn">
146
            <div id="uploader-demo">
147
                <div id="fileList" class="uploader-list"></div>
148
                <div id="filePicker">选择图片</div>
149
            </div>
150
        </div>
151
152 29
    </div>
30
153 31
</div>

+ 203 - 0
js/model/sys/org/details.js

@ -0,0 +1,203 @@
1
/**
2
 * Created by TT on 2017/7/19.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form", "upload"], function (spa, util, fb, upload) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_org_new");
10
                var ca = {ready: true, items: []};
11
                var form = fb.build(root.find(".newForm"), {
12
                    industryList: ca,
13
                    subjectList: ca,
14
                    qualificationList: ca
15
                });
16
                var id = util.data("loginUser").id;
17
                var cacheImageKey = null;
18
                var oValue;
19
                var oJudge;
20
                var saveBtn = root.find(".opt-save"),
21
                    headArea = root.find(".head-ctn"),
22
                    save = function () {
23
                        form.val({inviterId: id});
24
                        form.val({
25
                            industry: oString(form.val().industryList),
26
                            subject: oString(form.val().subjectList),
27
                            qualification: oString(form.val().qualificationList)
28
                        });
29
                        if (form.val().orgType == null) {
30
                            form.val({orgType: 1});
31
                        }
32
                        if (form.val().forShort == null) {
33
                            util.alert("请输入企业简称");
34
                        } else form.doPost("../ajax/sys/org/create", function () {
35
                            spa.closeModal();
36
                            if (data) {
37
                                data();
38
                            }
39
                        },function (data) {
40
                            util.alert(data.msg);
41
                        });
42
                    };
43
                root.find(".modal-ctrl .icon-times").on("click", function () {
44
                    spa.closeModal();
45
                });
46
47
                var part = function (one, list) {
48
                    oValue = one;
49
                    oJudge = list || [];
50
                    var repeat,
51
                        b;
52
                    if (!oValue) {
53
                        util.alert('提示', '请先填写内容');
54
                        return;
55
                    }
56
                    if (oValue.length > 10) {
57
                        util.alert('提示', '添加内容不能超过10个字');
58
                        return;
59
                    } else {
60
                        var oValueList = oValue.split(","),
61
                            length = oValueList.length;
62
                        for (var j = 0; j < length; j++) {
63
                            for (var n = j + 1; n < oValueList.length + 1;) {
64
                                if (oValueList[j] == oValueList[n]) {
65
                                    oValueList.remove(n);
66
                                    repeat = false;
67
                                } else {
68
                                    n++;
69
                                }
70
                            }
71
                        }
72
                        for (var j = 0; j < oValueList.length;) {
73
                            for (var i = 0; i < oJudge.length; i++) {
74
                                if (oValueList[j] == oJudge[i]) {
75
                                    oValueList.remove(j);
76
                                    repeat = false;
77
                                    b = true;
78
                                }
79
                            }
80
                            if (b) {
81
                                b = false
82
                            } else j++;
83
                        }
84
                        if (repeat == false) {
85
                            util.alert('提示', '添加内容不能重复');
86
                        }
87
                        for (var m = 0; m < oValueList.length; m++) {
88
                            ca.items.push({code: oValueList[m], caption: oValueList[m]});
89
                            oJudge.push(oValueList[m]);
90
                        }
91
                    }
92
                };
93
94
                Array.prototype.remove = function (obj) {
95
                    for (var i = 0; i < this.length; i++) {
96
                        var temp = this[i];
97
                        if (!isNaN(obj)) {
98
                            temp = i;
99
                        }
100
                        if (temp == obj) {
101
                            for (var j = i; j < this.length; j++) {
102
                                this[j] = this[j + 1];
103
                            }
104
                            this.length = this.length - 1;
105
                        }
106
                    }
107
                };
108
109
                function oString(data) {
110
                    var arry = new Array();
111
                    if (data) {
112
                        for (var i = 0; i < data.length; i++) {
113
                            arry.push(data[i]);
114
                        }
115
                    }
116
                    return arry.join(",");
117
                }
118
119
                root.find(".opt-industry").on("click", function () {
120
                    part(form.val().newIndustry, form.val().industryList);
121
                    form.val({newIndustry: "", industryList: oJudge});
122
                });
123
                root.find(".opt-subject").on("click", function () {
124
                    part(form.val().newSubject, form.val().subjectList);
125
                    form.val({newSubject: "", subjectList: oJudge});
126
                });
127
                root.find(".opt-qf").on("click", function () {
128
                    part(form.val().newQualification, form.val().qualificationList);
129
                    form.val({newQualification: "", qualificationList: oJudge});
130
                });
131
132
                var $list = $('#fileList'),
133
                    ratio = window.devicePixelRatio || 1,
134
                    thumbnailWidth = 100 * ratio,
135
                    thumbnailHeight = 100 * ratio,
136
                    uploader;
137
                uploader = WebUploader.create({
138
                    auto: true,
139
                    server: '../ajax/cachedFileUpload',
140
141
                    pick: '#filePicker',
142
143
                    accept: {
144
                        title: 'Images',
145
                        extensions: 'gif,jpg,jpeg,bmp,png',
146
                        mimeTypes: 'image/jpg,image/jpeg,image/png'
147
                    }
148
                });
149
                uploader.on('fileQueued', function (file) {
150
                    var $li = $(
151
                            '<div id="' + file.id + '" class="file-item thumbnail">' +
152
                            '<img>' +
153
                            '</div>'
154
                        ),
155
                        $btns = $('<div class="file-panel">' +
156
                            '<span class="cancel icon-remove-sign">删除</span>' +
157
                            '</div>').appendTo($li),
158
                        $img = $li.find('img');
159
160
                    $list.html($li);
161
162
                    uploader.makeThumb(file, function (error, src) {
163
                        if (error) {
164
                            $img.replaceWith('<span>不能预览</span>');
165
                            return;
166
                        }
167
168
                        $img.attr('src', src);
169
                    }, thumbnailWidth, thumbnailHeight);
170
171
                });
172
                uploader.on('uploadSuccess', function (file, data) {
173
                    $('#' + file.id).addClass('upload-state-done');
174
                    cacheImageKey = data.data[0].cacheKey;
175
                    form.val({fn: cacheImageKey});
176
                });
177
                uploader.on('uploadComplete', function (file) {
178
                    $('#' + file.id).find('.progress').remove();
179
                });
180
                $list.on("click", ".cancel", function () {
181
                    $(this).parent().parent().remove();
182
                });
183
                uploader.on('beforeFileQueued', function (file) {
184
                    uploader.reset();
185
                });
186
                $.fn.citySelect();
187
                $(document).on("click", "#City li a", function () {
188
                    var aVal = $(this).text();
189
                    $(this).parent().parent().parent().find('.mr_show').text(aVal);
190
                    $(this).parent().parent().parent().find('input[name=cho_City]').val(aVal);
191
                    if ($("#ocity").text() == "请选择城市") {
192
                        $("#ocity").removeClass("mr_select");
193
                    } else {
194
                        $("#ocity").addClass("mr_select");
195
                    }
196
                    // console.log($("#ocity").text(),$("#oprovince").text())
197
                    form.val({province: $("#oprovince").text(), city: $("#ocity").text()});
198
                });
199
                saveBtn.on("click", save);
200
            }
201
        }
202
    });
203
});

+ 45 - 188
js/model/sys/org/new.js

@ -3,206 +3,63 @@
3 3
 */
4 4
;
5 5
spa_define(function () {
6
    return $.use(["spa", "util", "form", "upload"], function (spa, util, fb, upload) {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7 7
        return {
8 8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_org_new");
10
                var ca = {ready: true, items: []};
11
                var form = fb.build(root.find(".newForm"), {
12
                    industryList: ca,
13
                    subjectList: ca,
14
                    qualificationList: ca
15
                });
16
                var id = util.data("loginUser").id;
17
                var cacheImageKey = null;
18
                var oValue;
19
                var oJudge;
9
                var root = spa.findInModal(".sys_userinfo_new");
10
                var form = fb.build(root.find(".newForm"));
11
                var trim = function (str) { //删除左右两端的空格			  
12
                    return str.replace(/(^\s*)|(\s*$)/g, "");
13
                };
20 14
                var saveBtn = root.find(".opt-save"),
21
                    headArea = root.find(".head-ctn"),
22 15
                    save = function () {
23
                        form.val({inviterId: id});
24
                        form.val({
25
                            industry: oString(form.val().industryList),
26
                            subject: oString(form.val().subjectList),
27
                            qualification: oString(form.val().qualificationList)
28
                        });
29
                        if (form.val().orgType == null) {
30
                            form.val({orgType: 1});
16
                        if (form.val().email) {
17
                            var email = trim(form.val().email);
18
                            var gunf = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
19
                            if (!gunf.test(email)) {
20
                                util.alert("注册邮箱格式有误,请检查后重新填写");
21
                                return;
22
                            }
23
                        }else{
24
                            util.alert("请输入邮箱")
25
                            return;
31 26
                        }
32
                        if (form.val().name == null) {
33
                            util.alert("请输入企业名称");
34
                        } else if (form.val().email == null) {
35
                            util.alert("请输入邮箱账户")
36
                        } else if (form.val().forShort == null) {
37
                            util.alert("请输入企业简称")
38
                        } else if (form.val().city == null || form.val().city === "请选择城市") {
39
                            util.alert("请选择企业所在城市")
27
                        if (form.val().name) {
28
                            var name = trim(form.val().name);
29
                            if (name.length > 50) {
30
                                util.alert("企业名称最长为50个字");
31
                                return;
32
                            }
33
                        }else {
34
                            util.alert("请填写企业名称");
35
                            return;
40 36
                        }
41
                        else form.doPost("../ajax/sys/org/create", function () {
42
                                spa.closeModal();
43
                                if (data) {
44
                                    data();
37
                        if (form.val().name && form.val().email) {
38
                            util.get("../ajax/sys/org/entryCheck", {
39
                                name: form.val().name,
40
                                email: form.val().email
41
                            },function (success) {
42
                                if (success){
43
                                    form.val({pMobile: form.val().mobile});
44
                                    form.val({pEmail: form.val().email});
45
                                    form.doPost("../ajax/sys/org/createAccount", function () {
46
                                        spa.closeModal();
47
                                        if (data) {
48
                                            data();
49
                                        }
50
                                    }, {});
51
                                }else {
52
                                    util.alert("该账号已存在");
45 53
                                }
46
                            },function (data) {
47
                                util.alert(data.msg);
48 54
                            });
55
                        } else {
56
                            util.alert("邮箱和企业名称都必须输入");
57
                        }
49 58
                    };
59
50 60
                root.find(".modal-ctrl .icon-times").on("click", function () {
51 61
                    spa.closeModal();
52 62
                });
53
54
                var part = function (one, list) {
55
                    oValue = one;
56
                    oJudge = list || [];
57
                    var repeat,
58
                        b;
59
                    if (!oValue) {
60
                        util.alert('提示', '请先填写内容');
61
                        return;
62
                    }
63
                    if (oValue.length > 10) {
64
                        util.alert('提示', '添加内容不能超过10个字');
65
                        return;
66
                    } else {
67
                        var oValueList = oValue.split(","),
68
                            length = oValueList.length;
69
                        for (var j = 0; j < length; j++) {
70
                            for (var n = j + 1; n < oValueList.length + 1;) {
71
                                if (oValueList[j] == oValueList[n]) {
72
                                    oValueList.remove(n);
73
                                    repeat = false;
74
                                } else {
75
                                    n++;
76
                                }
77
                            }
78
                        }
79
                        for (var j = 0; j < oValueList.length;) {
80
                            for (var i = 0; i < oJudge.length; i++) {
81
                                if (oValueList[j] == oJudge[i]) {
82
                                    oValueList.remove(j);
83
                                    repeat = false;
84
                                    b = true;
85
                                }
86
                            }
87
                            if (b) {
88
                                b = false
89
                            } else j++;
90
                        }
91
                        if (repeat == false) {
92
                            util.alert('提示', '添加内容不能重复');
93
                        }
94
                        for (var m = 0; m < oValueList.length; m++) {
95
                            ca.items.push({code: oValueList[m], caption: oValueList[m]});
96
                            oJudge.push(oValueList[m]);
97
                        }
98
                    }
99
                };
100
101
                Array.prototype.remove = function (obj) {
102
                    for (var i = 0; i < this.length; i++) {
103
                        var temp = this[i];
104
                        if (!isNaN(obj)) {
105
                            temp = i;
106
                        }
107
                        if (temp == obj) {
108
                            for (var j = i; j < this.length; j++) {
109
                                this[j] = this[j + 1];
110
                            }
111
                            this.length = this.length - 1;
112
                        }
113
                    }
114
                };
115
116
                function oString(data) {
117
                    var arry = new Array();
118
                    if (data) {
119
                        for (var i = 0; i < data.length; i++) {
120
                            arry.push(data[i]);
121
                        }
122
                    }
123
                    return arry.join(",");
124
                }
125
126
                root.find(".opt-industry").on("click", function () {
127
                    part(form.val().newIndustry, form.val().industryList);
128
                    form.val({newIndustry: "", industryList: oJudge});
129
                });
130
                root.find(".opt-subject").on("click", function () {
131
                    part(form.val().newSubject, form.val().subjectList);
132
                    form.val({newSubject: "", subjectList: oJudge});
133
                });
134
                root.find(".opt-qf").on("click", function () {
135
                    part(form.val().newQualification, form.val().qualificationList);
136
                    form.val({newQualification: "", qualificationList: oJudge});
137
                });
138
139
                var $list = $('#fileList'),
140
                    ratio = window.devicePixelRatio || 1,
141
                    thumbnailWidth = 100 * ratio,
142
                    thumbnailHeight = 100 * ratio,
143
                    uploader;
144
                uploader = WebUploader.create({
145
                    auto: true,
146
                    server: '../ajax/cachedFileUpload',
147
148
                    pick: '#filePicker',
149
150
                    accept: {
151
                        title: 'Images',
152
                        extensions: 'gif,jpg,jpeg,bmp,png',
153
                        mimeTypes: 'image/jpg,image/jpeg,image/png'
154
                    }
155
                });
156
                uploader.on('fileQueued', function (file) {
157
                    var $li = $(
158
                            '<div id="' + file.id + '" class="file-item thumbnail">' +
159
                            '<img>' +
160
                            '</div>'
161
                        ),
162
                        $btns = $('<div class="file-panel">' +
163
                            '<span class="cancel icon-remove-sign">删除</span>' +
164
                            '</div>').appendTo($li),
165
                        $img = $li.find('img');
166
167
                    $list.html($li);
168
169
                    uploader.makeThumb(file, function (error, src) {
170
                        if (error) {
171
                            $img.replaceWith('<span>不能预览</span>');
172
                            return;
173
                        }
174
175
                        $img.attr('src', src);
176
                    }, thumbnailWidth, thumbnailHeight);
177
178
                });
179
                uploader.on('uploadSuccess', function (file, data) {
180
                    $('#' + file.id).addClass('upload-state-done');
181
                    cacheImageKey = data.data[0].cacheKey;
182
                    form.val({fn: cacheImageKey});
183
                });
184
                uploader.on('uploadComplete', function (file) {
185
                    $('#' + file.id).find('.progress').remove();
186
                });
187
                $list.on("click", ".cancel", function () {
188
                    $(this).parent().parent().remove();
189
                });
190
                uploader.on('beforeFileQueued', function (file) {
191
                    uploader.reset();
192
                });
193
                $.fn.citySelect();
194
                $(document).on("click", "#City li a", function () {
195
                    var aVal = $(this).text();
196
                    $(this).parent().parent().parent().find('.mr_show').text(aVal);
197
                    $(this).parent().parent().parent().find('input[name=cho_City]').val(aVal);
198
                    if ($("#ocity").text() == "请选择城市") {
199
                        $("#ocity").removeClass("mr_select");
200
                    } else {
201
                        $("#ocity").addClass("mr_select");
202
                    }
203
                    // console.log($("#ocity").text(),$("#oprovince").text())
204
                    form.val({province: $("#oprovince").text(), city: $("#ocity").text()});
205
                });
206 63
                saveBtn.on("click", save);
207 64
            }
208 65
        }