Browse Source

客户跟踪管理界面新增发送邀请邮件功能

XMTT 7 years ago
parent
commit
3bc9f3f9f5

+ 1 - 1
css/model/sys/customer.css

@ -8,7 +8,7 @@
8 8
.sys_customer_myindex th.opt-check,.sys_customer_myindex td.opt-check{
9 9
    width: 30px;
10 10
}
11
.sys_customer_myedit{
11
.sys_customer_myedit,.sys_customer_myindex_mail{
12 12
    width:800px;
13 13
}
14 14
.sys_customer_index .tpl-btns .row{

+ 33 - 0
html/model/sys/customer/mail.html

@ -0,0 +1,33 @@
1
<div class="sys_customer_myindex_mail 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-10">
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-10">
15
                <div class="form-item text" defVal="您好:" name="appellation"></div>
16
            </div>
17
        </div>
18
        <div class="row">
19
            <div class="col-2 item-caption">邮件内容</div>
20
            <div class="col-10">
21
                <div class="form-item textarea" defVal="科袖网是一个为科研工作者服务的平台。我们将为您免费提供一个专属主页,您可以对外展示您的科研经历、成果以及资源,我们的平台将面向全国的企业与科研机构进行推广,您将得到更多与企业的合作、与同行交流的机会。" name="content"></div>
22
            </div>
23
        </div>
24
        <div class="row">
25
            <div class="col-10"></div>
26
            <div class="col-2">
27
                <div class="btn pull-right opt-send">
28
                    <i class="icon-check"></i> 发送
29
                </div>
30
            </div>
31
        </div>
32
    </div>
33
</div>

+ 9 - 0
html/model/sys/customer/myindex.html

@ -41,10 +41,18 @@
41 41
	<style type="text/css">
42 42
		.table.table-bordered tr th{text-align: center;}
43 43
	</style>
44
	<div class="container tpl-btns">
45
		<div class="row">
46
			<div class="btn opt-mail">
47
				<i class="icon-envelope"></i> 发送邀请邮件
48
			</div>
49
		</div>
50
	</div>
44 51
	<div class="container dt-tpl">
45 52
		<table class="table table-bordered">
46 53
			<thead>
47 54
				<tr>
55
					<th class="opt-check"><i class="icon icon-st-check"></i> </th>
48 56
					<th>操作</th>
49 57
					<th>序号</th>
50 58
					<th>客户</th>
@ -60,6 +68,7 @@
60 68
			</thead>
61 69
			<tbody>
62 70
				<tr ch-dir="list">
71
					<td class="opt-check"><i class="icon icon-st-check" name="{{name}}" email="{{email}}" phone="{{phone}}" inviteCode="{{inviteCode}}"></i></td>
63 72
					<td class="table-opt" powerId="{{powerId}}" style="cursor: hand;"><i class="icon icon-edit"></i></td>
64 73
					<td>{{pi}}</td>
65 74
					<td class="table-opt" professorId="{{id}}"><a class="name">{{name}}</a></td>

+ 5 - 1
js/common.js

@ -48,6 +48,9 @@ if(typeof jQuery === 'undefined') {
48 48
			warnDiv = $("#g_warn"),
49 49
			msgDiv = $("#g_msg"),
50 50
			err_msg = {},
51
			layer_css=function(){
52
				this.shade.css("display", "block");
53
			},
51 54
			layer_curr = {
52 55
				index: 5000000,
53 56
				remove: noop,
@ -82,7 +85,8 @@ if(typeof jQuery === 'undefined') {
82 85
					ly = {
83 86
						index: inx,
84 87
						remove: layer_remove,
85
						prev: layer_curr
88
						prev: layer_curr,
89
						css:layer_css
86 90
					};
87 91
				ly.shade = $(
88 92
					"<div class='layer-shade layer-" + inx + "' style='z-index:" +

+ 36 - 0
js/model/sys/customer/mail.js

@ -0,0 +1,36 @@
1
/**
2
 * Created by TT on 2017/5/12.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_customer_myindex_mail");
10
                var form = fb.build(root.find(".newForm"));
11
                form.val({emails: data.emails, mobilePhones: data.phones, inviteCodes: data.inviteCodes,name:data.names});
12
                var send = root.find(".opt-send"),
13
                    save = function () {
14
                        var boolean = false;
15
                        for (var i = 0; i < form.val().emails.length; i++) {
16
                            var item = form.val().emails[i];
17
                            if (item != "") {
18
                                boolean = true
19
                            }
20
                        }
21
                        if (boolean) {
22
                            form.doPost("../ajax/sendmail", function (data) {
23
                                util.alert("您成功发送" + data + "封邮件!");
24
                            }, {});
25
                        } else {
26
                            util.alert("请选择收件人(收件人邮箱和邀请码不能为空)!");
27
                        }
28
                    };
29
                root.find(".modal-ctrl .icon-times").on("click", function () {
30
                    spa.closeModal();
31
                });
32
                send.on("click", save);
33
            }
34
        };
35
    })
36
});

+ 34 - 0
js/model/sys/customer/myindex.js

@ -17,6 +17,40 @@ spa_define(function() {
17 17
					pdg.load();
18 18
				});
19 19
				pdg.load();
20
                root.find(".dt-tpl").on("click", "th.opt-check>i.icon-st-check", function() {
21
                    var $this = $(this);
22
                    $this.toggleClass("checked");
23
                    if($this.hasClass("checked")) {
24
                        root.find(".dt-tpl td.opt-check>i.icon-st-check").addClass("checked");
25
                    } else {
26
                        root.find(".dt-tpl td.opt-check>i.icon-st-check").removeClass("checked");
27
                    }
28
                });
29
                root.find(".dt-tpl").on("click", "td.opt-check>i.icon-st-check", function() {
30
                    var $this = $(this);
31
                    $this.toggleClass("checked");
32
                });
33
                root.find(".opt-mail").on("click", function() {
34
                    var $org = root.find("td.opt-check>i.checked");
35
                    if($org.length) {
36
                        var emails = [];
37
                        var phones = [];
38
                        var inviteCodes = [];
39
                        var names = [];
40
                        $org.each(function() {
41
                            emails.push($(this).attr("email"));
42
                            phones.push($(this).attr("phone"));
43
                            inviteCodes.push($(this).attr("inviteCode"));
44
                            names.push($(this).attr("name"));
45
                        });
46
                        var rd = {emails: emails, phones: phones,inviteCodes:inviteCodes,names:names};
47
                        spa.showModal("sys_customer_myindex_mail", rd);
48
                        // util.boxMsg({
49
                        // });
50
                    } else {
51
                        util.alert("请选择一个用户");
52
                    }
53
                });
20 54
				root.on("click", ".icon-edit", function() {
21 55
					var $this = $(this);
22 56
					var powerId = $this.parent().attr("powerId");