Browse Source

需求管理

XMTT 7 years ago
parent
commit
d8f601d475

+ 13 - 0
css/model/sys/demand.css

@ -0,0 +1,13 @@
1
@charset "utf-8";
2
.sys_demand_index .tpl-btns .row{
3
    padding-left: 10px;
4
}
5
.sys_demand_index th.opt-check,.sys_demand_index td.opt-check{
6
    width: 30px;
7
}
8
.sys_demand_index .table-opt .name{
9
    cursor:pointer;
10
}
11
.sys_demand_edit{
12
    width:800px;
13
}

+ 47 - 0
html/model/sys/demand/edit.html

@ -0,0 +1,47 @@
1
<div class="sys_demand_edit centerModal">
2
	<div class="modal-ctrl">
3
		<i class="icon icon-times"></i>
4
	</div>
5
	<div class="container opt-form">
6
		<div class="row">
7
			<div class="col-2 item-caption ">主题</div>
8
			<div class="col-4">
9
				<div class="form-item text showOnly" defVal="" name="demandTitle"></div>
10
			</div>
11
		</div>
12
		<div class="row">
13
			<div class="col-2 item-caption ">发布者</div>
14
			<div class="col-4">
15
				<div class="form-item text showOnly" defVal="" name="professorName"></div>
16
			</div>
17
		</div>
18
		<div class="row">
19
			<div class="col-2 item-caption ">发布时间</div>
20
			<div class="col-4">
21
				<div class="form-item text showOnly" dictCode="showDay" defVal="" name="day"></div>
22
			</div>
23
		</div>
24
		<div class="row">
25
			<div class="col-2 item-caption ">内容</div>
26
			<div class="col-4">
27
				<div class="form-item text showOnly" defVal="" name="demandContent"></div>
28
			</div>
29
		</div>
30
	</div>
31
	<div class="container dt-tpl">
32
		<table class="table table-bordered">
33
			<thead>
34
				<tr>				
35
					<th>反馈列表</th>
36
				</tr>
37
			</thead>
38
			<tbody>
39
				<tr ch-dir="list">			
40
					<td class="table-opt id" consultId="{{consultId}}">{{professorName}}&nbsp;&nbsp;{{createTime-showDay}}&nbsp;&nbsp;【{{consultStruts-struts}}】</td>
41
				</tr>
42
			</tbody>
43
			
44
		</table>
45
	</div>
46
47
</div>

+ 80 - 0
html/model/sys/demand/index.html

@ -0,0 +1,80 @@
1
<div class="sys_demand_index" loadUri="../ajax/demand/pq" pageSize="10" pageNo="1" pageIndex="pi">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container dt-form">
6
        <div class="row">
7
            <div class="col-1 item-caption">主题</div>
8
            <div class="col-5">
9
                <div class="form-item text" defVal="" name="demandTitle"></div>
10
            </div>
11
            <div class="col-1 item-caption ">发布者</div>
12
            <div class="col-2">
13
                <div class="form-item text" defVal="" name="professorName"></div>
14
            </div>
15
            <div class="col-1 item-caption">需求目的</div>
16
            <div class="col-2">
17
                <div class="form-item select" dictCode="demandAim" defVal="" name="demandAim"></div>
18
            </div>
19
        </div>
20
        <div class="row">
21
            <div class="col-1 item-caption ">创建日期</div>
22
            <div class="col-5">
23
                <div class="form-item date" defVal="" name="bt"></div>
24
            </div>
25
            <div class="col-1 item-caption center">至</div>
26
            <div class="col-5">
27
                <div class="form-item date" defVal="" name="et"></div>
28
            </div>
29
        </div>
30
        <div class="row">
31
            <div class="col-10">
32
33
            </div>
34
            <div class="col-2">
35
                <div class="btn opt-query pull-right">
36
                    <i class="icon-search"></i> 查询
37
                </div>
38
            </div>
39
40
        </div>
41
    </div>
42
43
    <div class="container page-split"></div>
44
    <style type="text/css">
45
        .table.table-bordered tr th{text-align: center;}
46
    </style>
47
    <div class="container dt-tpl">
48
        <table class="table table-bordered">
49
            <thead>
50
            <tr>
51
                <th>操作</th>
52
                <th>序号</th>
53
                <th>主题</th>
54
                <th>需求目的</th>
55
                <th>发布者</th>
56
                <th>发布时间</th>
57
                <th>需求类型</th>
58
            </tr>
59
            </thead>
60
            <tbody>
61
            <tr ch-dir="list">
62
                <td class="table-opt" demandId="{{demandId}}"><i class="icon icon-edit"></i></td>
63
                <td>{{pi}}</td>
64
                <td>{{demandTitle}}</td>
65
                <td class="hand-dict" dict="demandAim" code="{{demandAim}}"></td>
66
                <td>{{professorName}}</td>
67
                <td>{{createTime-showDay}}</td>
68
                <td class="hand-dict" dict="demandType" code="{{demandType}}"></td>
69
70
            </tr>
71
            </tbody>
72
            <tbody ch-dir="array.empty">
73
            <tr>
74
                <td class="empty-desc" colspan="7">表格暂无数据</td>
75
            </tr>
76
            </tbody>
77
        </table>
78
    </div>
79
    <ul class="dt-pager"></ul>
80
</div>

+ 49 - 0
js/model/sys/demand/edit.js

@ -0,0 +1,49 @@
1
;
2
spa_define(function () {
3
    return $.use(["spa", "code", "util", "form"], function (spa, code, util, form) {
4
        return {
5
            modal: function (data) {
6
                var root = spa.findInModal(".sys_demand_edit");
7
                root.find(".modal-ctrl .icon-times").on("click", function () {
8
                    spa.closeModal();
9
                });
10
                var ef = form.build(root.find(".opt-form"));
11
12
                var day = data.data.createTime;
13
                data.data.day = day.substring(0, 4) + "年" + day.substring(4, 6) + "月" + day.substring(6, 8) + "日";
14
                ef.val(data.data);
15
                var cr = code.parseCode(root.find(".dt-tpl"));
16
                cr.shell("showDay", function (env) {
17
                    if (env.cd && env.cd[this.k]) {
18
                        var day = env.cd[this.k];
19
                        return day.substring(0, 4) + "-" + day.substring(4, 6) + "-" + day.substring(6, 8);
20
                    }
21
                    return "";
22
                });
23
                cr.shell("struts", function (env) {
24
                    var v = env.cd[this.k];
25
                    if (v === 1) {
26
                        return "已完成";
27
                    }
28
                    if (v === 2) {
29
                        return "待回复";
30
                    }
31
                    if (v === 3) {
32
                        return "已谢绝";
33
                    }
34
                    return "进行中";
35
                });
36
                var allData;
37
                util.get("../ajax/demand/demandId/" + data.data.demandId, null, function (data) {
38
                    allData = data || [];
39
                    cr.val(data);
40
                }, {});
41
                root.on("click", ".table-opt", function () {
42
                    var id = $(".id").attr("consultId");
43
                    window.open('http://www.ekexiu.com/diloags.html?attrParams=consultId&consultId=' + id);
44
                });
45
46
            }
47
        };
48
    });
49
});

+ 44 - 0
js/model/sys/demand/index.js

@ -0,0 +1,44 @@
1
/**
2
 * Created by TT on 2017/5/8.
3
 */
4
;
5
spa_define(function(){
6
    return $.use(["spa","pagedatagrid","util"],function(spa,pdgf,util){
7
        return{
8
            main: function() {
9
                var root = spa.findInMain(".sys_demand_index");
10
                var pdg = pdgf.build(root);
11
                pdg.code.shell("showDay", function(env) {
12
                    if(env.cd && env.cd[this.k]) {
13
                        var day = env.cd[this.k];
14
                        return day.substring(0, 4) + "-" + day.substring(4, 6) + "-" + day.substring(6, 8);
15
                    }
16
                    return "";
17
                });
18
                pdg.code.listen($.dict.doTransfer);
19
                root.find(".opt-query").on("click", function() {
20
                    pdg.load();
21
                });
22
                pdg.load();
23
                root.on("click", ".icon-edit", function() {
24
                    var $this = $(this);
25
                    var demandId = $this.parent().attr("demandId");
26
                    util.get("../ajax/demand/id/" + demandId, null, function(rd) {
27
                        if (rd) {
28
                            spa.showModal("sys_demand_edit", {
29
                                data: rd,
30
                                hand: function() {
31
                                    pdg.load()
32
                                }
33
                            })
34
                        } else {
35
                            util.alert("客户选择有误", function() {
36
                                pdg.load();
37
                            });
38
                        }
39
                    }, {});
40
                });
41
            }
42
        };
43
    });
44
});