Răsfoiți Sursa

优化
优化

zouyuxuan 5 ani în urmă
părinte
comite
fd950a68ca

+ 17 - 8
core/src/qfw/manage/loan.go

@@ -31,7 +31,8 @@ type Front struct {
 	*xweb.Action
 	login                xweb.Mapper    `xweb:"/manage/jyloan/list"`
 	visitList            xweb.Mapper    `xweb:"/manage/loan/visitlist"`
-	evaluationlist       xweb.Mapper    `xweb:"/manage/loan/evaluationlist"`
+	evaluationlist       xweb.Mapper    `xweb:"/manage/loan/evaluationlist"`          //评估列表页面
+	evaluationdetail    xweb.Mapper    `xweb:"/manage/jy_loan/evaluationdetail"`        //评估详情页面
 	clasifylist          xweb.Mapper    `xweb:"/manage/loan/clasifylist"`
 	setting              xweb.Mapper    `xweb:"/manage/loan/setting"`
 	classset             xweb.Mapper    `xweb:"/manage/loan/classSet.html"`
@@ -55,9 +56,14 @@ func (this *Front)VisitList()error{
 }
 
 func (this *Front)Evaluationlist()error{
-	return this.Render("/manage/loan/evaluation.html")
+	return this.Render("/manage/loan/evaluationlist.html")
 }
 
+func (this *Front)Evaluationdetail()error{
+	uid := this.GetString("uid")
+	this.T["uid"] = uid
+	return this.Render("/manage/loan/evaluationdetail.html",&this.T)
+}
 func (this *Front)Setting()error{
 	return this.Render("/manage/loan/classSet.html")
 }
@@ -98,9 +104,12 @@ func (this *LoanAction)Evaluation(){
 		uid := this.GetString("uid")
 		query := make(map[string]interface{})
 		query["uid"] = uid
-		data :=*mgo.Find("jy_loan",query,nil,`{"visit_msg":1,"visit_person":1,"visit_time":1}`,false,0,0)
-		this.ServeJson(map[string]interface{}{
-			"data":data,
+		data :=*mgo.FindOne("jy_loan",query)
+		this.ServeJson(map[string][]interface{}{
+			"data":[]interface{}{
+				data,
+			},
+
 		})
 	}
 }
@@ -146,7 +155,7 @@ func (this *LoanAction)Telephone_interviews(){
 		perPage, _ := this.GetInteger("perPage")
 		query := make(map[string]interface{})
 		query["visit_back"] = 0
-		ldata:=mgo.Find("jy_loan",query,`{"application_time":-1}`,nil,false,(currentPage-1)*perPage, perPage)
+		ldata:=mgo.Find("jy_loan",query,`{"application_time":1}`,nil,false,(currentPage-1)*perPage, perPage)
 		count := mgo.Count("jy_loan", query)
 		data := make(map[string]interface{})
 		if len(*ldata)!=0{
@@ -229,7 +238,7 @@ func (this *LoanAction)Evaluation_list(){
 		perPage, _ := this.GetInteger("perPage")
 		query :=make(map[string]interface{})
 		query["opinion"] = 0
-		ldata:=*mgo.Find("jy_loan",query,nil,nil,false,(currentPage-1)*perPage, perPage)
+		ldata:=*mgo.Find("jy_loan",query,`{"application_time":1}`,nil,false,(currentPage-1)*perPage, perPage)
 		count := mgo.Count("jy_loan", query)
 		data := make(map[string]interface{})
 		if len(ldata)!=0{
@@ -260,7 +269,7 @@ func (this *LoanAction)Clue_manage(){
 	}else{
 		currentPage, _ := this.GetInteger("currentPage")
 		perPage, _ := this.GetInteger("perPage")
-		data :=mgo.Find("jy_loan",nil,`{"application":1}`,`{"companyName":1,"registration":1,"visit_person":1,"visit_time":1,"account_manager":1,"opinion_time":1,"classify_type":1,"uid":1}`,false,(currentPage-1)*perPage, perPage)
+		data :=mgo.Find("jy_loan",nil,`{"application_time":1}`,`{"companyName":1,"registration":1,"visit_person":1,"visit_time":1,"account_manager":1,"opinion_time":1,"classify_type":1,"uid":1}`,false,(currentPage-1)*perPage, perPage)
 		count := mgo.Count("jy_loan",nil)
 		if (*data!=nil){
 			this.ServeJson(map[string]interface{}{

+ 0 - 12
core/src/web/templates/manage/loan/clue.html

@@ -301,18 +301,6 @@ overflow-y: auto;">
             ]
         });
 
-        $("select").change(function () {
-            var find = $("#audit").data("datatable");
-            if (!find.options.opost) find.options.opost = find.options.post || {};
-            find.options.post = $.extend(find.options.opost, {
-                strSel1: $("#select1").val(),
-                strSel2: $("#select2").val(),
-                strSel3: $("#select3").val()
-            });
-            find.options.currentPage = 1;
-            find.render();
-        });
-
     });
     $(function(){
         var kindEditInit=function(){

+ 337 - 0
core/src/web/templates/manage/loan/evaluationdetail.html

@@ -0,0 +1,337 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    {{include "/common/inc.html"}}
+    <title>评估详情</title>
+    <link href="/css/bootstrap.min.css" rel="stylesheet" />
+    <script src="/js/jquery.js"></script>
+    <script src="/js/bootstrap.min.js"></script>
+    <script src="/js/qfwtable.js"></script>
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/js/kindeditor/themes/default/default.css"/>
+    <script charset="utf-8" src="{{Msg "seo" "cdn"}}/js/kindeditor/kindeditor-all.js"></script>
+    <script charset="utf-8" src="{{Msg "seo" "cdn"}}/js/kindeditor/kinditem.js"></script>
+    <style type="text/css">
+        #jyloan{
+            background-color: #f5f5f5;
+        }
+        .table-bordered{
+            border: 1px solid #ddd;
+            width: auto;
+            position: absolute;
+            left: 220px;
+            top: 120px;
+        }
+        .ke-container{
+            width: 425px;
+            margin-left: 100px;
+        }
+
+        #content table {
+            table-layout: fixed;
+            border: 0px;
+            font-size: 14px;
+        }
+
+        #sidebar {
+            margin-left: 0px;
+        }
+
+        .table > thead > tr > th:nth-child(1) {
+            width: 7%;
+        }
+
+        .table > thead > tr > th:nth-child(2) {
+            width: 10%;
+        }
+
+        .table > thead > tr > th:nth-child(3) {
+            width: 10%;
+        }
+
+        .table > thead > tr > th:nth-child(4) {
+            width: 10%;
+        }
+
+        .table > thead > tr > th:nth-child(5) {
+            width: 10%;
+        }
+
+        .table > thead > tr > th:nth-child(6) {
+            width: 10%;
+            /*text-align: center;*/
+        }
+        .table > thead > tr > th:nth-child(7) {
+            width: 10%;
+            /*text-align: center;*/
+        }
+        .table > thead > tr > th:nth-child(8) {
+            width: 5%;
+            display: none;
+            /*text-align: center;*/
+        }
+
+
+        .table > thead > tr > th {
+            border: 0px;
+            font-size: 14px;
+        }
+
+        .table > tbody > tr > td {
+            white-space: nowrap;
+            text-overflow: ellipsis;
+            overflow: hidden;
+            border: 0px;
+            border-bottom: 1px dashed #999999;
+        }
+        .table > tbody > tr > td:nth-child(8) {
+            display: none;
+        }
+
+        .table > tbody > tr {
+            cursor: pointer;
+        }
+
+
+        .pagination > .active > a:hover, .pagination > .active > a:focus {
+            background-color: #18CC7D;
+        }
+
+        .editBtn {
+            display: flex;
+        }
+
+        .editBtn span {
+            padding: 3px 7px;
+            border: 1px solid;
+            border-radius: 4px;
+            margin: 0 3px;
+        }
+        .ke-container{
+            width: 582px;
+            margin-left: 0px;
+        }
+        #return{
+            float: right;
+            margin-right: 27px;
+            margin-top: 10px;
+            font-weight: 400;
+            font-size: 16px;
+            color: rgba(94, 126, 240, 1);
+            font-style: normal;
+            letter-spacing: 0px;
+            text-decoration: none;
+        }
+
+    </style>
+</head>
+{{include "/common/baiducc.html"}}
+<body>
+
+<div>
+    {{include "/manage/audithead.html"}}
+    <div style="width: 100px;height: 40px;position: relative;float: right;">
+        <a id="return" href="/manage/jyloan/list"> 退出系统</a>
+    </div>
+    <div class="row" style="width:96%; margin:0 auto;">
+        {{include "/manage/slider.html"}}
+
+        <div id="content">
+            <div id="audit" style="margin-top: 20px"></div>
+            <div class="record" style="
+    margin-top: 390px;
+    position: relative;
+    float: left;
+    margin-left: -207px;
+">
+                <div style="position: relative;float: left;margin-left: 206px;margin-top: -366px;width: 280px;height: 300px;">
+                    <span style="font-size: 24px;">回访记录:</span>
+                    <span id="visit-person"></span>
+                    <span id="visit-time"></span>
+                    <div id="visit-record" style="overflow-y: auto;">
+
+                    </div>
+                </div>
+                <div style="position: relative;float: right;margin-left: 580px;margin-top: -366px;">
+                    <span style="font-size: 24px" >贷款评估意见:</span>
+                    <textarea id="evaluation" name="evaluation" style="width: 400px;height: 200px;" placeholder="多行输入"></textarea>
+                    <div>
+                        <div style="width: 210px;height: 0px;position: relative;margin-top: 15px">
+                            <span style="font-size: 24px;">客户经理:</span>
+                            <input id="manage" type="text" style="width: 80px" placeholder="单行输入">
+                        </div>
+                        <div style="padding-bottom: 20px;width: 100px;padding-left: 359px;">
+                            <input  type="button" style="width: 90px; height: 33px; left: 1166px; top: 852px; z-index: 22; background-color: rgb(202, 198, 133); border-color: rgb(187, 187, 187); border-width: 1px; border-style: solid; border-radius: 4px; font-size: 14px; text-align: center; font-weight: normal; font-style: normal; opacity: 1;" value="提交" onclick="submit()">
+                        </div>
+                        <div style="width: 100px;padding-left: 359px">
+                            <input  type="button" style="width: 90px; height: 33px; left: 1166px; top: 852px; z-index: 22; background-color: rgb(202, 198, 133); border-color: rgb(187, 187, 187); border-width: 1px; border-style: solid; border-radius: 4px; font-size: 14px; text-align: center; font-weight: normal; font-style: normal; opacity: 1;" value="取消" onclick="cancle()">
+                        </div>
+                    </div>
+
+                </div>
+
+            </div>
+        </div>
+
+
+
+    </div>
+    {{include "/common/bottom.html"}}
+
+
+</div>
+
+
+
+</body>
+<script>
+    var uid = {{.T.uid}}
+        $(function () {
+            $("#audit").datatable({
+                perPage: 1
+                ,
+                showPagination: false
+                ,
+                checkbox: "" //check radio
+                ,
+                checkboxHeader: false
+                ,
+                idField: "_id"
+                ,
+                classname: "table-hover"
+                ,
+                css: {"height": "100px"}
+                ,
+                url: '/manage/jy_loan/evaluation?uid='+uid
+                ,
+                columns: [
+
+                    {
+                        title: "企业名称", field: "companyName",callback:function (d) {
+                            return d.companyName
+                        }
+                    },
+                    {
+                        title: "注册地", field: "registration", callback: function (d) {
+                            return d.registration
+                        }
+                    },
+                    {
+                        title: "联系人", field: "person",callback:function (d) {
+                            return d.username
+                        }
+                    },
+                    {
+                        title: "手机号", field: "phonenum", callback: function (d) {
+                            return d.phoneNum
+                        }
+                    },
+                    {
+                        title: "贷款金额", field: "price", callback: function (d) {
+                            return d.price
+                        }
+                    },
+                    {
+                        title:"贷款期限",field:"term",callback:function (d) {
+                            return d.term
+                        }
+                    },
+                    {
+                        title:"贷款用途",field:"remark",callback:function (d) {
+                            return d.remark
+
+                        }
+                    },
+                    {
+                        title:"uid",field:"remark",callback:function (d) {
+                            return d.uid
+
+                        }
+                    }
+                ]
+            });
+
+        });
+    $(function(){
+        var kindEditInit=function(){
+            editor = KindEditor.create('textarea[name="evaluation"]', {
+                id:"ke_editor",
+                allowFileManager : false,
+                filterMode:true,
+                width : '10px',
+                height:'20px',
+                items:items_simp,
+                allowImageRemoteImageRemote:false,
+                uploadJson : '/filemanage/upload',
+                afterCreate:function() {
+                    this.sync()
+                },
+                beforesubmit:function(){
+                    this.sync()
+                },
+                afterBlur: function(){
+                    this.sync()
+                }
+            });
+        }
+        kindEditInit()
+    });
+    $(function () {
+        $.ajax({
+            url:"/manage/jy_loan/evaluation",
+            datatype: "json",
+            data: {"uid":uid},
+            async: false,
+            method: "POST",
+            success:function (d) {
+                var visit_record="";
+                visit_record = format(d.data[0].visit_msg);
+                $("#visit-person").html(d.data[0].visit_person);
+                $("#visit-record").html(visit_record);
+                $("#visit-time").html(d.data[0].visit_time);
+                $(".record").show();
+                $("#manage").focus();
+            }
+        })
+    });
+    function submit() {
+        var content = $("#evaluation").val();
+        var person = $("#manage").val();
+        if (content!=""&&person!=""){
+            $.ajax({
+                url: "/manage/jy_loan/evaluationopinion",
+                type: "POST",
+                data: {
+                    "opinion_msg":content,
+                    "account_manager":person,
+                    "uid":uid
+                },
+                async:false,
+                datatype: "json",
+                success:function (r) {
+                    if (r.data.status==1&&r.error_code=="0"){
+                        window.location.href = "/manage/loan/evaluationlist"
+                    }
+                }
+            })
+
+        }else{
+            alert("评估意见和客户经理不能为空")
+        }
+
+    }
+    function cancle() {
+        window.location.href = "/manage/loan/evaluationlist"
+    }
+    function format(d) {
+        if (typeof(d)!== "undefined"){
+            var tt =d.replace(/&#60;/g,"<");
+            var t = tt.replace(/&#62;/g,">");
+            return t
+        }else{
+            return ""
+        }
+
+    }
+</script>
+</html>

+ 45 - 99
core/src/web/templates/manage/loan/evaluation.html → core/src/web/templates/manage/loan/evaluationlist.html

@@ -10,9 +10,6 @@
     <script src="/js/jquery.js"></script>
     <script src="/js/bootstrap.min.js"></script>
     <script src="/js/qfwtable.js"></script>
-    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/js/kindeditor/themes/default/default.css"/>
-    <script charset="utf-8" src="{{Msg "seo" "cdn"}}/js/kindeditor/kindeditor-all.js"></script>
-    <script charset="utf-8" src="{{Msg "seo" "cdn"}}/js/kindeditor/kinditem.js"></script>
     <style type="text/css">
 
 
@@ -126,34 +123,7 @@
         <div id="content">
             <div id="audit" style="margin-top: 20px"></div>
         </div>
-        <div class="record" style="display: none">
-            <div style="position: relative;float: left;margin-left: 206px;margin-top: -366px;width: 280px;height: 300px;">
-                <span style="font-size: 24px;">回访记录:</span>
-                <span id="visit-person"></span>
-                <span id="visit-time"></span>
-                <div id="visit-record" style="overflow-y: auto;">
-
-                </div>
-            </div>
-            <div style="position: relative;float: right;margin-left: 580px;margin-top: -366px;">
-                <span style="font-size: 24px" >贷款评估意见:</span>
-                <textarea id="evaluation" name="evaluation" style="width: 400px;height: 200px;" placeholder="多行输入"></textarea>
-                <div>
-                    <div style="width: 210px;height: 0px;position: relative;margin-top: 15px">
-                        <span style="font-size: 24px;">客户经理:</span>
-                        <input id="manage" type="text" style="width: 80px" placeholder="单行输入">
-                    </div>
-                    <div style="padding-bottom: 20px;width: 100px;padding-left: 359px;">
-                        <input  type="button" style="width: 90px; height: 33px; left: 1166px; top: 852px; z-index: 22; background-color: rgb(202, 198, 133); border-color: rgb(187, 187, 187); border-width: 1px; border-style: solid; border-radius: 4px; font-size: 14px; text-align: center; font-weight: normal; font-style: normal; opacity: 1;" value="提交" onclick="submit()">
-                    </div>
-                    <div style="width: 100px;padding-left: 359px">
-                        <input  type="button" style="width: 90px; height: 33px; left: 1166px; top: 852px; z-index: 22; background-color: rgb(202, 198, 133); border-color: rgb(187, 187, 187); border-width: 1px; border-style: solid; border-radius: 4px; font-size: 14px; text-align: center; font-weight: normal; font-style: normal; opacity: 1;" value="取消" onclick="cancle()">
-                    </div>
-                </div>
-
-            </div>
 
-        </div>
 
     </div>
     {{include "/common/bottom.html"}}
@@ -245,30 +215,6 @@
         });
 
     });
-    $(function(){
-        var kindEditInit=function(){
-            editor = KindEditor.create('textarea[name="evaluation"]', {
-                id:"ke_editor",
-                allowFileManager : false,
-                filterMode:true,
-                width : '10px',
-                height:'20px',
-                items:items_simp,
-                allowImageRemoteImageRemote:false,
-                uploadJson : '/filemanage/upload',
-                afterCreate:function() {
-                    this.sync()
-                },
-                beforesubmit:function(){
-                    this.sync()
-                },
-                afterBlur: function(){
-                    this.sync()
-                }
-            });
-        }
-        kindEditInit()
-    });
 
     //双击事件
     $("#content").on("dblclick","#audit>.dt-table-wrapper>.table>tbody>tr",function(){
@@ -294,57 +240,57 @@
     });
     //单击事件
     $("#content").on("click","#audit>.dt-table-wrapper>.table>tbody>tr",function(){
-        $(this).addClass("selected");
-        $(this).css("background","rgb(202, 198, 133)");
-        $(this).siblings().css("background","rgb(255,255,255)");
-        $(this).siblings().removeClass("selected");
-        $("#visit-person").text("");
-        $("#visit-record").text("");
-        $("#visit-time").text("");
-        $(".record").hide();
-        // if ($(this).hasClass("select")){
-        //     window.location.href = ""
-        // }
+        var t = $(this).find("td").eq(7).text();
+        if ($(this).hasClass("selected")){
+            window.location.href = "/manage/jy_loan/evaluationdetail?uid="+t
+        }else{
+            $(this).addClass("selected");
+            $(this).css("background","rgb(202, 198, 133)");
+            $(this).siblings().css("background","rgb(255,255,255)");
+            $(this).siblings().removeClass("selected");
+            $("#visit-person").text("");
+            $("#visit-record").text("");
+            $("#visit-time").text("");
+            $(".record").hide();
+        }
     });
-    function submit() {
-        var content = $("#evaluation").val();
-        var person = $("#manage").val();
-        if (content!=""&&person!=""){
-            $.ajax({
-                url: "/manage/jy_loan/evaluationopinion",
-                type: "POST",
-                data: {
-                    "opinion_msg":content,
-                    "account_manager":person,
-                    "uid":uid
-                },
-                async:false,
-                datatype: "json",
-                success:function (r) {
-                    if (r.data.status==1&&r.error_code=="0"){
-                        window.location.href = "/manage/loan/evaluationlist"
+
+        document.onkeydown = function (event) {
+            var e = event || window.event || arguments.callee.caller.arguments[0];
+            var t = $("#audit>.dt-table-wrapper>.table>tbody>tr")
+            if (e && e.keyCode == 40) { //下
+                for(var i=0;i<t.length;i++){
+                    if ($(t[i]).hasClass("selected")){
+                        if (i + 1 >=t.length){
+                            break
+                        }else{
+                            $(t[i]).removeClass("selected");
+                            $(t[i]).css("background","#fff");
+                            $(t[i+1]).addClass("selected");
+                            $(t[i+1]).css("background","rgb(202, 198, 133)");
+                            break
+                        }
                     }
                 }
-            })
+            }
 
-        }else{
-            alert("评估意见和客户经理不能为空")
-        }
+            if (e && e.keyCode == 38) { // 上
+                for(var i=0;i<t.length;i++){
+                    if ($(t[i]).hasClass("selected")){
+                        if (i <= 0){
+                            break
+                        }else{
+                            $(t[i]).removeClass("selected");
+                            $(t[i]).css("background","#fff");
+                            $(t[i-1]).addClass("selected");
+                            $(t[i-1]).css("background","rgb(202, 198, 133)");
+                            break
+                        }
+                    }
+                }
+            }
 
-    }
-    function cancle() {
-        window.location.href = "/manage/loan/evaluationlist"
-    }
-    function format(d) {
-        if (typeof(d)!== "undefined"){
-            console.log(d)
-            var tt =d.replace(/&#60;/g,"<");
-            var t = tt.replace(/&#62;/g,">");
-            return t
-        }else{
-            return ""
         }
 
-    }
 </script>
 </html>

+ 0 - 11
core/src/web/templates/manage/loan/show_clue.html

@@ -243,17 +243,6 @@
                 ]
             });
 
-            $("select").change(function () {
-                var find = $("#audit").data("datatable");
-                if (!find.options.opost) find.options.opost = find.options.post || {};
-                find.options.post = $.extend(find.options.opost, {
-                    strSel1: $("#select1").val(),
-                    strSel2: $("#select2").val(),
-                    strSel3: $("#select3").val()
-                });
-                find.options.currentPage = 1;
-                find.render();
-            });
 
         });
     $(function () {

+ 47 - 0
core/src/web/templates/manage/loan/visit.html

@@ -270,6 +270,10 @@
     });
     //单击事件
     $("#content").on("click","#audit>.dt-table-wrapper>.table>tbody>tr",function(){
+        $(this).addClass("selected");
+        $(this).css("background","rgb(202, 198, 133)");
+        $(this).siblings().css("background","rgb(255,255,255)");
+        $(this).siblings().removeClass("selected");
         $("#visit-record").val("");
         $("#person").val("");
         $(".record").hide()
@@ -307,5 +311,48 @@
         $(".record").hide()
 
     }
+    document.onkeydown = function (event) {
+        var e = event || window.event || arguments.callee.caller.arguments[0];
+        var t = $("#audit>.dt-table-wrapper>.table>tbody>tr")
+        if (e && e.keyCode == 40) { //下
+            $("#visit-record").val("");
+            $("#person").val("");
+            $(".record").hide()
+            for(var i=0;i<t.length;i++){
+                if ($(t[i]).hasClass("selected")){
+                    if (i + 1 >=t.length){
+                        break
+                    }else{
+                        $(t[i]).removeClass("selected");
+                        $(t[i]).css("background","#fff");
+                        $(t[i+1]).addClass("selected");
+                        $(t[i+1]).css("background","rgb(202, 198, 133)");
+                        break
+                    }
+                }
+            }
+        }
+
+        if (e && e.keyCode == 38) { // 上
+            $("#visit-record").val("");
+            $("#person").val("");
+            $(".record").hide()
+            for(var i=0;i<t.length;i++){
+                if ($(t[i]).hasClass("selected")){
+                    if (i <= 0){
+                        break
+                    }else{
+                        $(t[i]).removeClass("selected");
+                        $(t[i]).css("background","#fff");
+                        $(t[i-1]).addClass("selected");
+                        $(t[i-1]).css("background","rgb(202, 198, 133)");
+                        break
+                    }
+                }
+            }
+        }
+
+    }
+
 </script>
 </html>