Pārlūkot izejas kodu

Merge branch 'dev2.6.5' into release

lianbingjie 5 gadi atpakaļ
vecāks
revīzija
3aa6b980d1

+ 24 - 13
core/src/qfw/manage/loan.go

@@ -157,7 +157,6 @@ func (this *LoanAction)Telephone_interviews(){
 		query["visit_back"] = 0
 		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{
 			this.ServeJson(map[string]interface{}{
 				"currentPage": currentPage,
@@ -165,10 +164,10 @@ func (this *LoanAction)Telephone_interviews(){
 				"totalRows":   count,
 			})
 		}else{
-			data["status"] = 0
 			this.ServeJson(map[string]interface{}{
-				"error_code":"0",
-				"data":data,
+				"currentPage": currentPage,
+				"data":        []interface{}{},
+				"totalRows":   0,
 			})
 		}
 	}
@@ -237,11 +236,11 @@ func (this *LoanAction)Evaluation_list(){
 		currentPage, _ := this.GetInteger("currentPage")
 		perPage, _ := this.GetInteger("perPage")
 		query :=make(map[string]interface{})
+		query["visit_back"] = 1
 		query["opinion"] = 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{
+		if len(*ldata)!=0{
 			this.ServeJson(map[string]interface{}{
 				"currentPage": currentPage,
 				"data":        ldata,
@@ -249,10 +248,10 @@ func (this *LoanAction)Evaluation_list(){
 			})
 
 		}else{
-			data["status"] = 0
 			this.ServeJson(map[string]interface{}{
-				"error_code":"0",
-				"data":data,
+				"currentPage": currentPage,
+				"data":        []interface{}{},
+				"totalRows":   0,
 			})
 		}
 	}
@@ -267,16 +266,28 @@ func (this *LoanAction)Clue_manage(){
 			"error_code":"1004",
 		})
 	}else{
+		query := make(map[string]interface{})
+		query["opinion"] = 1
+		query["visit_back"] = 1
+		query["companyName"] = map[string]interface{}{
+			"$exists":true,
+		}
 		currentPage, _ := this.GetInteger("currentPage")
 		perPage, _ := this.GetInteger("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){
+		data :=mgo.Find("jy_loan",query,`{"application_time":1}`,`{"companyName":1,"registration":1,"visit_person":1,"visit_time":1,"account_manager":1,"opinion_time":1,"classify_type":1,"uid":1,"application_time":1}`,false,(currentPage-1)*perPage, perPage)
+		count := mgo.Count("jy_loan",query)
+		if len(*data)!=0{
 			this.ServeJson(map[string]interface{}{
 				"currentPage": currentPage,
 				"data":        data,
 				"totalRows":   count,
 			})
+		}else{
+			this.ServeJson(map[string]interface{}{
+				"currentPage": currentPage,
+				"data":        []interface{}{},
+				"totalRows":   0,
+			})
 		}
 	}
 }

+ 12 - 0
core/src/web/staticres/loan/js/common.js

@@ -0,0 +1,12 @@
+function timestampToTime(timestamp) {
+    if (typeof(timestamp) == "undefined"){
+        return ""
+    }else{
+        var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+        var Y = date.getFullYear() + '-';
+        var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
+        var D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + ' ';
+        return Y+M+D;
+    }
+
+}

+ 659 - 0
core/src/web/staticres/loan/js/qfwtable.js

@@ -0,0 +1,659 @@
+
+!function($){
+	var tipmsg="没有找到相关内容";
+	var _nilHtml='<div class="text-center" style="margin:-80px auto;"><img src="/images/findnull.png" class="b-findnull"><h4><span  class="glyphicon glyphicon-question-sign text-primary"></span >&nbsp;<strong class="text-muted">$tipmsg</strong></h4></div>';
+	var DataTable = function ( element, options ) {
+    this.$element = $(element);
+    this.options = options;
+	tipmsg=this.options.tipmsg||tipmsg
+	this.options.nilHtml=this.options.nilHtml||_nilHtml.replace("$tipmsg",tipmsg)
+    this.enabled = true;
+    this.columns = [];
+    this.rows = [];
+    // this needs to be handled better
+    //this.localStorageId = "datatable_" + (options.id || options.url.replace(/\W/ig, '_'));
+    this.$default = this.$element.children().length ?this.$element.children():$("<div/>")
+        .addClass("alert alert-error").html(this.options.nilHtml);
+    this.$element.addClass("clearfix");
+    // clear out the localStorage for this entry
+   // if(localStorage) {
+     // localStorage[this.localStorageId] = 'false';
+   // }
+	//在渲染之前事件
+    if(this.options.tablePreRender && typeof this.options.tablePreRender === 'function')
+      this.options.tablePreRender.call(this)
+    // initialize the toolbar	
+    this.render();
+	this.toolbar();
+  };
+DataTable.prototype = {
+     render: function () {
+        var o = this.options, $e = this.$element;
+        // show loading
+        this.loading( true );
+        // reset the columns and rows
+        this.columns = [];
+        this.rows    = [];
+        this.buttons = [];
+        this.$wrapper    = undefined;
+        this.$table      = undefined;
+        this.$header     = undefined;
+        this.$body       = undefined;
+        this.$pagination = undefined;
+		this.$pages = $("<div/>").css("background-color",this.options.pagebg);
+        //if(this.$toolbar) this.$toolbar.remove();
+		
+        // localize the object
+        var that = this;
+		
+        // pull in the data from the ajax call
+        if(o.url !== "") {		
+          $.ajax({
+              url: o.url
+            , type: "POST"
+            , dataType: "json"
+			, async: o.isAsync
+            , data: $.extend({}, o.post, {
+                  currentPage: o.currentPage
+                , perPage: o.perPage
+              })
+            , success: function( res ) {
+				if(o.ajaxSuccess && typeof o.ajaxSuccess === 'function')
+                  o.ajaxSuccess.call(that,res,o);
+				if(o.continueBody){
+					//var res={totalRows:20,data:[{"s_name":"张三","l_registedate":"555"},{"s_name":"gggggg","l_registedate":"555"},{"s_name":"ttttt","l_registedate":"555"}]}
+	                that.resultset = res;
+	                if(!res || res === undefined || !res.data || res.data.length == 0) {
+                      $("#audit").append(that.table());
+                        that.header();
+	                    showError.call(that);
+	                  return;
+	                }
+	                // clear out the current elements in the container
+	                $e.empty();
+	                // set the sort and filter configuration
+	                o.totalRows = res.totalRows;
+	                // set the current page if we're forcing it from the server
+	                if(res.currentPage) o.currentPage = parseInt(res.currentPage);
+	         
+	                // append the table
+	                $e.append(that.table());
+					//显示分页
+					if(o.showPagination){
+						$e.append(that.$pages.append(that.pagination()))
+					}
+	                // render the rest of the table
+	                if(o.showHeader) that.header();
+	
+	                // fill in the table body
+	                that.body();
+	                // render the pagination
+	                //if(o.showPagination && that.pagination())
+	                  
+	                // initialize the toolbar
+	                
+	                // nearly complete... let the user apply any final adjustments
+	                if(o.tableCallback && typeof o.tableCallback === 'function')
+	                  o.tableCallback.call(that);
+				}
+				that.loading( false );				
+              }
+            , error: function( e ) {
+                if(o.ajaxError && typeof o.ajaxError === 'function')
+                  o.ajaxError.call(that);
+                showError.call(that);
+                that.loading( false );
+              }
+          });
+        }
+      }
+    , loading: function ( show) {
+		if(this.options.showLoading){
+	        var $e = this.$element;
+			var loadp
+	        if(!this.$loading) {
+			  loadp=$("<div/>").addClass("progress-bar");
+	          this.$loading = $("<div/>")
+	            .css({
+	                position: 'absolute'
+	              , top: parseInt($e.position().top) + 5
+	              , left: parseInt($e.position().left) + parseInt($e.css("marginLeft")) + Math.floor($e.width() / 4)
+	              , width: Math.floor($e.width() / 2) + "px"
+	            })
+	            .append(
+	              $("<div/>")
+	                .addClass("progress progress-striped active")
+	                .append(
+	                  loadp
+	                )
+	            )
+	            .appendTo(document.body)
+	        }
+	        if(show) {
+	          $e.css({ opacity: 0.2 });
+			  window._n=100;
+			  var n=1;
+			  this.LL=setInterval(function(){
+				n++
+				if(n<4){
+					$(".progress-bar").css("width",window._n+"%")
+				}
+			  },100)
+			 
+	        }else {
+	          $e.css({ opacity: 1 });
+	          this.$loading.remove();
+	          this.$loading = undefined;
+			  clearInterval(this.LL)
+	        }
+	      }
+	}
+
+    , toolbar: function () {
+		if(this.$toolbar) return ;
+		this.buttons=[]
+		if(!this.options.buttons||!this.options.buttons.length) return;
+        var o = this.options
+          , $e = this.$element
+          , that = this;
+		
+		
+        this.$toolbar = $("<div/>").addClass("btn-group-fat");
+		if(o.toolbarCss){
+			this.$toolbar.css(o.toolbarCss)
+		}
+        this.$button_group = $("<div/>").addClass("btn-group").appendTo(this.$toolbar);
+
+        // add all the custom buttons
+		
+        for(var i = 0; i < o.buttons.length; i++) {
+          that.buttons.push(o.buttons[i]);
+        }
+
+        // attach all buttons to the toolbar
+        $.each(this.buttons, function() {
+          that.$button_group.append(this);
+        });
+
+        // attach the toolbar to the section header
+       $e.before(this.$toolbar);
+        return this.$toolbar;
+      }
+
+    , table: function () {
+        var $e = this.$element
+          , o = this.options;
+        if(!this.$table_wrapper) {
+          this.$wrapper = $("<div/>")
+            .addClass("dt-table-wrapper").css(o.css);
+        }
+        if (!this.$table) {
+          this.$table = $('<table/>')
+            .addClass(o.tableClass).addClass(o.classname);
+        }
+        this.$wrapper.append(this.$table);
+        return this.$wrapper;
+      },
+	checkAll:function(checked){
+		this.$body.find("input[name=_tableCheck]").prop('checked',(checked?true:false));
+		this.$body.find("tr").css("background-color",checked?"#EEF3F9":"")
+    },
+	getSelect:function(){
+		var val=this.$body.find("input[name=_tableCheck]:checked"),res=[];
+		if(val&&val.length>0){
+			val.each(function(i,ad){
+				res.push($(this).val());
+			})
+		}
+		return res;
+	}
+	, selectAll:function(){
+		var c=this.options.checkbox;
+		that=this;
+		if(c&&c=="check"){
+			this.$header.off('click', '[name="btSelectAll"]')
+            .on('click', '[name="btSelectAll"]', function () {
+                var checked = $(this).prop('checked');
+                that.checkAll(checked);
+            });
+		}	
+	}
+    , header: function () {
+        var o = this.options
+          , res = this.resultset;
+        if(!this.$header) {
+          this.$header = $('<thead/>');
+          var row = $('<tr/>').css("background","#f2f2f2").css("background-image",
+			  "-webkit-gradient(linear,left 0,left 100%,from(#f8f8f8),to(#ececec))");
+			
+          // loop through the columns
+		  if(o.checkbox){
+			if(o.checkbox=="check"&&o.checkboxHeader){
+				row.append($('<th><input name="btSelectAll" type="checkbox" /><small>全选</small></th>'))
+				this.selectAll();
+			}
+		  }
+          for(var column in o.columns) {
+            var $cell = this.column(column)
+              , colprop = $cell.data("column_properties");
+
+            // attach the sort click event
+            row.append($cell);
+            this.$header.append(row);
+            this.columns.push($cell);
+          }
+
+          // any final user adjustments to the header
+          if(o.headerCallback && typeof o.headerCallback === 'function')
+            o.headerCallback.call(this);
+          this.$table.append(this.$header);
+        }
+        return this.$header;
+      }
+    , body: function () {
+        var res = this.resultset
+          , o = this.options;
+        if(!this.$body) {
+          this.$body = $('<tbody></tbody>');
+
+          // loop through the results
+          for(var i = 0; i < res.data.length; i++) {
+            var row = this.row(res.data[i]);
+            this.$body.append(row);
+            this.rows.push(row);
+          }
+		  this.selectone();
+          if(o.showFilterRow) this.$body.prepend(this.filter());
+          this.$table.append(this.$body);
+        }
+        return this.$body;
+      },
+	  selectone:function(){
+		that=this;
+		if(that.$header){
+			var cb=that.$body.find('input[name="_tableCheck"]');
+			this.$body.off('click','input[name="_tableCheck"]').on("click",'input[name="_tableCheck"]',function(){
+				$(this).closest("tr").css("background-color",$(this).prop("checked")?"#EEF3F9":"")
+				var cb2=that.$body.find('input[name="_tableCheck"]:checked');
+				that.$header.find('[name="btSelectAll"]').prop("checked",cb.length==cb2.length)
+			})
+		}
+	  }
+    , row: function ( rowdata ) {
+        var $row = $("<tr/>")
+          , o = this.options;
+		 if(o.columns&&o.columns.length){
+			  if(o.checkbox){
+				if(o.checkbox=="check"&&o.idField){
+					$row.append($('<td><input value="'+rowdata[o.idField]+'" name="_tableCheck" type="checkbox" /></td>'))
+				}
+			  }
+			// loop through the columns
+			for(var column in o.columns) {
+			  var cell = this.cell( rowdata, column );
+			  $row.append(cell);
+			}
+		}
+        // callback for postprocessing on the row
+        if(o.rowCallback && typeof o.rowCallback === "function")
+          $row = o.rowCallback( $row, rowdata );
+        return $row;
+      }
+
+    , cell: function ( data, column ) {
+		
+        var celldata = data[this.options.columns[column].field] || this.options.columns[column].custom
+          , $cell = $('<td/>')
+          , o = this.options;
+        // preprocess on the cell data for a column
+        if(o.columns[column].callback && typeof o.columns[column].callback === "function")
+          celldata = o.columns[column].callback.call( $cell, data,celldata,o.columns[column],column )
+		  
+        $cell.data("cell_properties", o.columns[column])
+          .addClass(o.columns[column].classname)
+          .append(celldata || "&nbsp;")
+
+        if(o.columns[column].css) $cell.css(o.columns[column].css);
+        if(o.columns[column].hidden) $cell.hide();
+        return $cell;
+      }
+
+    , column: function ( column ) {
+        var $cell = $('<th></th>')
+          , o = this.options
+          , classname = "dt-column_" + column + Math.floor((Math.random()*1000)+1);
+		var tempClass=o.columns[column].classname;
+        o.columns[column].classname  = (tempClass?(tempClass+" "):"")+classname;
+
+        $cell
+          .data("column_properties", o.columns[column])
+          .addClass(classname)
+          .text(o.columns[column].title);
+        if(o.columns[column].css) $cell.css(o.columns[column].css);
+        if(o.columns[column].hidden) $cell.hide();
+        return $cell;
+      }
+    , pagination: function () {
+		//获取当前地址url 如果是订阅消息页面  执行方法 removeChecked() 
+		//该方法再orderlist.html页面 用于翻页取消全选状态
+		var orderMessage_list = window.location.pathname;
+		if(orderMessage_list=="/manage/orderMessage/list"){
+			removeChecked();
+		}
+        var $e = this.$element
+          , that = this
+          , o = this.options
+          , res = this.resultset;
+        // no paging needed
+        //if(o.perPage >= res.totalRows) return;
+        if(!this.$pagination) {
+          this.$pagination = $("<div/>").addClass("text-center").css("margin-top","-20px");
+          if(o.pageclass) this.$pagination.addClass(o.pageclass)
+		  // how many pages?
+          o.pageCount = Math.ceil(res.totalRows / o.perPage);
+
+          // setup the pager container and the quick page buttons
+          var $pager = $("<ul></ul>").addClass("pagination")
+            , $first = $("<li></li>").append(
+                $("<a></a>")
+                  .attr("href", "#")
+                  .data("page", 1)
+                  .html("&laquo;")
+                  .click(function() {
+					if ($(this).closest("li").attr("class")=="disabled"){
+						return false
+					}
+                    o.currentPage = 1
+                    that.render();
+                    return false;
+                  })
+              )
+            , $previous = $("<li></li>").append(
+                $("<a></a>")
+                  .attr("href", "#")
+                  .data("page", o.currentPage - 1)
+                  .html("&lt;")
+                  .click(function() {
+					if ($(this).closest("li").attr("class")=="disabled"){
+						return false
+					}
+                    o.currentPage -= 1
+                    o.currentPage = o.currentPage >= 1 ? o.currentPage : 1
+                    that.render();
+                    return false;
+                  })
+              )
+            , $next = $("<li></li>").append(
+                $("<a></a>")
+                  .attr("href", "#")
+                  .data("page", o.currentPage + 1)
+                  .html("&gt;")
+                  .click(function() {
+					if ($(this).closest("li").attr("class")=="disabled"){
+						return false
+					}
+                    o.currentPage += 1
+                    o.currentPage = o.currentPage <= o.pageCount? o.currentPage : o.pageCount
+                    that.render();
+                    return false;
+                  })
+              )
+            , $last = $("<li></li>").append(
+                $("<a></a>")
+                  .attr("href", "#")
+                  .data("page", o.pageCount)
+                  .html("&raquo;")
+                  .click(function() {
+					if ($(this).closest("li").attr("class")=="disabled"){
+						return false
+					}
+                    o.currentPage = o.pageCount
+                    that.render();
+                    return false;
+                  })
+              );
+          var totalPages = o.pagePadding * 2
+            , start
+            , end;
+          if(totalPages >= o.pageCount) {
+            start = 1;
+            end = o.pageCount;
+          }
+          else {
+            start = o.currentPage - o.pagePadding;
+            if(start <= 0) start = 1;
+
+            end = start + totalPages;
+            if(end > o.pageCount) {
+              end = o.pageCount;
+              start = end - totalPages;
+            }
+          }
+          // append the pagination links
+          for(var i = start; i <= end; i++) {
+            var $link = $("<li></li>")
+              .append(
+                $("<a></a>")
+                  .attr("href", "#")
+                  .data("page", i)
+                  .text(i)
+                  .click(function() {
+                    o.currentPage = $(this).data('page')
+                    that.render();
+                    return false;
+                  })
+              );
+              if(i == o.currentPage) $link.addClass("active");
+              $pager.append($link);
+          }
+
+          // append quick jump buttons
+          if(o.currentPage == 1) {
+            $first.addClass("disabled");
+            $previous.addClass("disabled");
+          }
+          if(o.currentPage == o.pageCount) {
+            $next.addClass("disabled");
+            $last.addClass("disabled");
+          }
+          $pager.prepend($first, $previous);
+          $pager.append($next, $last);
+
+          this.$pagination.append($pager);
+        }
+        return this.$pagination;
+      }
+    , remove: function() {
+        var $e = this.$element
+        if(this.$section_header) this.$section_header.remove();
+        $e.data("datatable", null);
+        $e.empty();
+      }
+  };
+
+  
+  function _updatePerPage(that) {
+    var o = that.options;
+    // update the perpage value
+    o.perPage = $(this).data("value");
+    // the offset
+    var offset = o.currentPage * o.perPage;
+    while(offset > o.totalRows) {
+      o.currentPage--;
+      offset = o.currentPage * o.perPage;
+    }
+    if(o.currentPage < 1) o.currentPage = 1;
+    if($(this).popover) $(this).popover('hide');
+    // update the table
+    that.render();
+    return false;
+  }
+
+  function _initPerPage() {
+    var o = this.options
+      , $e = this.$element
+      , that = this;
+
+    // per page options and current filter/sorting
+    var $perpage_select = $("<a></a>")
+      .addClass("btn dropdown-toggle")
+      .data("content", "Change the number of rows per page.")
+      .attr("data-toggle", "dropdown")
+      .html(o.perPage + "&nbsp;")
+      .css({ fontWeight: 'normal' })
+      .append(
+        $("<span></span>")
+          .addClass("caret")
+      )
+      .popover({
+        "trigger": 'hover',
+        "placement":'top'
+      });
+    this.buttons.push($perpage_select);
+
+    var $perpage_values = $("<ul></ul>")
+      .addClass("dropdown-menu")
+      .css({ fontSize: 'initial', fontWeight: 'normal' })
+      .append(
+          $('<li data-value="10"><a href="#">10</a></li>')
+            .click(function() { _updatePerPage.call(this, that); return false; })
+        , $('<li data-value="20"><a href="#">20</a></li>')
+            .click(function() { _updatePerPage.call(this, that); return false; })
+        , $('<li data-value="50"><a href="#">50</a></li>')
+            .click(function() { _updatePerPage.call(this, that); return false; })
+        , $('<li data-value="100"><a href="#">100</a></li>')
+            .click(function() { _updatePerPage.call(this, that); return false; })
+        , $('<li data-value="150"><a href="#">200</a></li>')
+            .click(function() { _updatePerPage.call(this, that); return false; })
+      );
+    this.buttons.push($perpage_values);
+  }
+
+  function _initTableInfo() {
+    var o = this.options
+      , $e = this.$element
+      , $info = $("<a></a>");
+
+    // render the display modal button
+    $info
+      .addClass("btn")
+      .attr("href", "#")
+      .append(
+        $("<span></span>")
+          .addClass("glyphicon glyphicon-info-sign")
+      )
+      .click(function() {
+        return false;
+      });
+
+    var $page_sort = []
+      , $page_filter = [];
+
+    // sort
+    $.each(o.sort, function(i, v){
+      if(!v.length) return;
+      var heading;
+      for(var column in o.columns) {
+        if(o.columns[column].field == v[0]) heading = o.columns[column].title;
+      }
+      $page_sort.push( heading + " " + v[1].toUpperCase() );
+    });
+
+    // filter
+    $.each(o.filter, function(k, v) {
+      var heading;
+      for(var column in o.columns) {
+        if(o.columns[column].field == k) heading = o.columns[column].title;
+      }
+      $page_filter.push( (heading || k) + " = '" + v + "'" );
+    });
+    $($info)
+      .data("content",
+        $('<dl></dl>').append(
+          $page_sort.length > 0 ? '<dt><i class="icon-th-list"></i> Sort:</dt><dd>' + $page_sort.join(", ") + '</dd>' : ''
+          ,
+          $page_filter.length > 0 ? '<dt><i class="icon-filter"></i> Filter:</dt><dd>' + $page_filter.join(", ") + '</dd>' : ''
+        ))
+      .popover({
+        placement: "bottom"
+      });
+
+    this.buttons.unshift($info);
+  }
+    function showError() {
+        var o = this.options
+            , $e = this.$element;
+        // $e.empty();
+        // initialize the toolbar
+        this.toolbar();
+        // nearly complete... let the user apply any final adjustments
+        if(o.tableCallback && typeof o.tableCallback === 'function')
+            o.tableCallback.call(this);
+        this.loading( false );
+        if(this.$default) $e.append(this.$default);
+    }
+
+  $.fn.datatable = function ( options,_relatedTarget,flag ) {
+	    var value;
+			var data = this.data("datatable");
+            if (typeof options === 'string') {
+                if (!data) {
+                    return;
+                }
+                value = data[options]&&data[options](_relatedTarget);
+                if (options === 'destroy') {
+                    this.removeData('bootstrap.table');
+                }
+            }
+            if (!data||flag) {
+               $.fn.datatable.init.call(this,options,"datatable",flag)
+            }
+        return typeof value === 'undefined' ? this : value;
+  };
+  $.fn.datatable.init = function (options,name,flag) {
+      options = $.extend({}, $.fn.datatable.defaults, options);
+      var datatable = $(this).data(name);
+      if (!datatable||flag) {
+        datatable = new DataTable(this, options);
+        $(this).data(name, datatable);
+      }
+      return datatable;
+  };
+
+  $.fn.datatable.defaults = {
+    debug: true,
+    id: undefined,
+    tableClass: 'table',
+	css:{},
+    perPage: 10,
+    pagePadding: 2,
+    post: {},
+    buttons: [],
+    pageclass:'',
+	classname:'table-hover',
+	showHeader:true
+   ,checkbox:"" //check radio
+   ,idField:""
+   ,checkboxHeader:true,
+    sectionHeader: undefined,
+    totalRows: 0,
+    currentPage: 1,
+    showPagination: true,
+    showTopPagination: false,
+    allowExport: false,
+    allowOverflow: true,
+    url: '',
+    columns: [],
+    rowCallback: undefined,
+    tableCallback: undefined,
+    headerCallback: undefined,
+    tablePreRender: undefined,
+	ajaxSuccess:undefined,
+	continueBody:true,//继续解析主体
+	ajaxError:undefined,
+	pagebg:"",//分页条背景色
+	showLoading:false, //显示进度条
+	isAsync: false
+	//,toolbarCss:{"background-color":""} //工具条颜色
+  };
+}(jQuery)

+ 12 - 4
core/src/web/templates/manage/loan/classSet.html

@@ -69,8 +69,8 @@
 </head>
 <body>
   <div class="set-content">
-    <div style="width: 100px;height: 40px;position: relative;float: right;">
-      <a id="return" href="/manage/jyloan/list"> 退出系统</a>
+    <div style="width: 120px;height: 40px;position: relative;float: right;">
+      <a id="return" href="/manage/jyloan/list"> 返回上一级</a>
     </div>
     <div class="title">线索分类设置:</div>
     <div class="table-content">
@@ -142,8 +142,8 @@
           dataType:"json",
           async:false,
           success:function (d) {
-            if (d.data.status==1){
-              for (var i =1;i<d.data.data.length;i++){
+            if (d.data.status==1&&d.error_code == 0){
+              for (var i =0;i<d.data.data.length;i++){
                 str = str +  '<tr><td class="del" onclick="del(this)" data-index="'+i+'">删除</td><td>'+d.data.data[i].classify_type+'</td><td>'+d.data.data[i].discribe+'</td><td class="id" hidden>'+d.data.data[i]._id+'</td></tr>'
               }
               str = str + addStr;
@@ -151,6 +151,14 @@
               var tbody = document.createElement('tbody');
               tbody.innerHTML = str;
               table.appendChild(tbody)
+              return
+            }else if (d.error_code == 0 &&d.data.status == 0){
+              var table = document.getElementById('table');
+              var tbody = document.createElement('tbody');
+              tbody.innerHTML = addStr;
+              table.appendChild(tbody);
+              return
+
             }
           }
         })

+ 37 - 31
core/src/web/templates/manage/loan/clue.html

@@ -4,10 +4,11 @@
     <meta charset="UTF-8">
     {{include "/common/inc.html"}}
     <title>分类线索</title>
-    <script src="/js/qfwtable.js"></script>
+    <script src="/loan/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>
+    <script src="/loan/js/common.js"></script>
     <style type="text/css">
         #jyloan{
             background-color: #f5f5f5;
@@ -19,10 +20,6 @@
             left: 220px;
             top: 120px;
         }
-        .ke-container{
-            width: 425px;
-            margin-left: 100px;
-        }
 
         #content table {
             table-layout: fixed;
@@ -35,34 +32,38 @@
         }
 
         .table > thead > tr > th:nth-child(1) {
-            width: 7%;
+            width: 13%;
         }
 
         .table > thead > tr > th:nth-child(2) {
-            width: 10%;
+            width: 4%;
         }
 
         .table > thead > tr > th:nth-child(3) {
-            width: 10%;
+            width: 8%;
         }
 
         .table > thead > tr > th:nth-child(4) {
-            width: 10%;
+            width: 4%;
         }
 
         .table > thead > tr > th:nth-child(5) {
-            width: 10%;
+            width: 5%;
         }
 
         .table > thead > tr > th:nth-child(6) {
-            width: 10%;
+            width: 4%;
             /*text-align: center;*/
         }
         .table > thead > tr > th:nth-child(7) {
-            width: 10%;
+            width: 5%;
             /*text-align: center;*/
         }
         .table > thead > tr > th:nth-child(8) {
+            width: 5%;
+            /*text-align: center;*/
+        }
+        .table > thead > tr > th:nth-child(9) {
             width: 5%;
             display: none;
             /*text-align: center;*/
@@ -81,7 +82,7 @@
             border: 0px;
             border-bottom: 1px dashed #999999;
         }
-        .table > tbody > tr > td:nth-child(8) {
+        .table > tbody > tr > td:nth-child(9) {
             display: none;
         }
 
@@ -108,10 +109,6 @@
             background-color: rgb(202, 198, 133);
             border-color: #EAB62F;
         }
-        .ke-container{
-            width: 582px;
-            margin-left: 0px;
-        }
         #return{
             float: right;
             margin-right: 27px;
@@ -123,6 +120,9 @@
             letter-spacing: 0px;
             text-decoration: none;
         }
+        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{
+            vertical-align:middle;
+        }
 
     </style>
 </head>
@@ -131,8 +131,8 @@
 
 <div>
     {{include "/manage/audithead.html"}}
-    <div style="width: 100px;height: 40px;position: relative;float: right;">
-        <a id="return" href="/manage/jyloan/list"> 退出系统</a>
+    <div style="width: 120px;height: 40px;position: relative;float: right;">
+        <a id="return" href="/manage/loan/cluelist"> 返回上一级</a>
     </div>
     <div class="row" style="width:96%; margin:0 auto;">
         {{include "/manage/slider.html"}}
@@ -143,7 +143,7 @@
         <div class="record" style="display: none">
             <div style="float: left;
     position: relative;
-    margin-left: 202px;
+    margin-left: 214px;
     margin-top: -600px;
     width: 200px;
     height: 200px;
@@ -166,21 +166,21 @@ overflow-y: auto;">
             </div>
             <div style="
     position: relative;
-    float: left;
-    margin-left: 638px;
+    float: right;
+    margin-right: 10px;
     margin-top: -600px;
-    width: 200px;
+    width: 580px;
     height: 200px;
     font-size: 24px;
 ">
                 <span >3 分类意见:</span>
                 <textarea id="classify_msg" name="classify_msg" style="margin-left: 100px;"></textarea>
-                <div style="padding-left: 118px;
-    margin-top: 37px;">
+                <div style="padding-left: 97px;
+    margin-top: 30px;">
                     <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="padding-left: 415px;
-    margin-top: -33px;">
+                <div style="padding-left: 357px;
+    margin-top: -37px;">
                     <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>
@@ -220,7 +220,8 @@ overflow-y: auto;">
 
                 {
                     title: "企业名称", field: "companyName",callback:function (d) {
-                        return d.companyName
+                        var html = '<div style="width: 145px;height: auto;overflow-x: auto;text-align: left;line-height: 37px">'+ d.companyName+'</div>'
+                        return html
                     }
                 },
                 {
@@ -228,6 +229,12 @@ overflow-y: auto;">
                         return d.registration
                     }
                 },
+                {
+                    title: "贷款时间", field: "price", callback: function (d) {
+                        return timestampToTime(d.application_time)
+
+                    }
+                },
                 {
                     title: "回访人", field: "person",callback:function (d) {
                         if (typeof(d.visit_person) != "undefined"){
@@ -277,7 +284,7 @@ overflow-y: auto;">
                             success:function (r) {
                                 if (r.data.length>0){
                                     var html = "";
-                                    for (var i =1;i<r.data.length;i++){
+                                    for (var i =0;i<r.data.length;i++){
                                         html += '<option>'+r.data[i].classify_type+'</option>';
                                     }
                                     select += html
@@ -305,7 +312,7 @@ overflow-y: auto;">
                 id:"ke_editor",
                 allowFileManager : false,
                 filterMode:true,
-                width : '10px',
+                width : '100%',
                 height:'20px',
                 items:items_simp,
                 allowImageRemoteImageRemote:false,
@@ -356,7 +363,6 @@ overflow-y: auto;">
     }
     function format(d) {
         if (typeof(d)!== "undefined"){
-            console.log(d)
             var tt =d.replace(/&#60;/g,"<");
             var t = tt.replace(/&#62;/g,">");
             return t

+ 28 - 14
core/src/web/templates/manage/loan/cluelist.html

@@ -4,7 +4,8 @@
     <meta charset="UTF-8">
     {{include "/common/inc.html"}}
     <title>分类线索</title>
-    <script src="/js/qfwtable.js"></script>
+    <script src="/loan/js/qfwtable.js"></script>
+    <script src="/loan/js/common.js"></script>
     <style type="text/css">
         #jyloan{
             background-color: #f5f5f5;
@@ -32,34 +33,38 @@
         }
 
         .table > thead > tr > th:nth-child(1) {
-            width: 7%;
+            width: 13%;
         }
 
         .table > thead > tr > th:nth-child(2) {
-            width: 10%;
+            width: 5%;
         }
 
         .table > thead > tr > th:nth-child(3) {
-            width: 10%;
+            width: 7%;
         }
 
         .table > thead > tr > th:nth-child(4) {
-            width: 10%;
+            width: 5%;
         }
 
         .table > thead > tr > th:nth-child(5) {
-            width: 10%;
+            width: 7%;
         }
 
         .table > thead > tr > th:nth-child(6) {
-            width: 10%;
+            width: 5%;
             /*text-align: center;*/
         }
         .table > thead > tr > th:nth-child(7) {
-            width: 10%;
+            width: 5%;
             /*text-align: center;*/
         }
         .table > thead > tr > th:nth-child(8) {
+            width: 5%;
+            /*text-align: center;*/
+        }
+        .table > thead > tr > th:nth-child(9) {
             width: 5%;
             display: none;
             /*text-align: center;*/
@@ -78,7 +83,7 @@
             border: 0px;
             border-bottom: 1px dashed #999999;
         }
-        .table > tbody > tr > td:nth-child(8) {
+        .table > tbody > tr > td:nth-child(9) {
             display: none;
         }
 
@@ -120,7 +125,9 @@
             letter-spacing: 0px;
             text-decoration: none;
         }
-
+        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{
+            vertical-align:middle;
+        }
     </style>
 </head>
 {{include "/common/baiducc.html"}}
@@ -128,8 +135,8 @@
 
 <div>
     {{include "/manage/audithead.html"}}
-    <div style="width: 100px;height: 40px;position: relative;float: right;">
-        <a id="return" href="/manage/jyloan/list"> 退出系统</a>
+    <div style="width: 120px;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"}}
@@ -166,7 +173,7 @@
             ,
             classname: "table-hover"
             ,
-            css: {"height": "300px"}
+            css: {"height": "450px"}
             //,post:{"name":"ee"}
             ,
             url: '/manage/jy_loan/cluelist'
@@ -175,7 +182,8 @@
 
                 {
                     title: "企业名称", field: "companyName",callback:function (d) {
-                        return d.companyName
+                        var html = '<div style="width: 145px;height: auto;overflow-x: auto;text-align: left;line-height: 37px">'+ d.companyName+'</div>'
+                        return html
                     }
                 },
                 {
@@ -183,6 +191,12 @@
                         return d.registration
                     }
                 },
+                {
+                    title: "贷款时间", field: "price", callback: function (d) {
+                        return timestampToTime(d.application_time)
+
+                    }
+                },
                 {
                     title: "回访人", field: "person",callback:function (d) {
                         if (typeof(d.visit_person) != "undefined"){

+ 34 - 19
core/src/web/templates/manage/loan/evaluationdetail.html

@@ -4,10 +4,11 @@
     <meta charset="UTF-8">
     {{include "/common/inc.html"}}
     <title>评估详情</title>
-    <script src="/js/qfwtable.js"></script>
+    <script src="/loan/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>
+    <script src="/loan/js/common.js"></script>
     <style type="text/css">
         #jyloan{
             background-color: #f5f5f5;
@@ -35,34 +36,38 @@
         }
 
         .table > thead > tr > th:nth-child(1) {
-            width: 7%;
+            width: 13%;
         }
 
         .table > thead > tr > th:nth-child(2) {
-            width: 10%;
+            width: 5%;
         }
 
         .table > thead > tr > th:nth-child(3) {
-            width: 10%;
+            width: 5%;
         }
 
         .table > thead > tr > th:nth-child(4) {
-            width: 10%;
+            width: 7%;
         }
 
         .table > thead > tr > th:nth-child(5) {
-            width: 10%;
+            width: 7%;
         }
 
         .table > thead > tr > th:nth-child(6) {
-            width: 10%;
+            width: 6%;
             /*text-align: center;*/
         }
         .table > thead > tr > th:nth-child(7) {
-            width: 10%;
+            width: 8%;
             /*text-align: center;*/
         }
         .table > thead > tr > th:nth-child(8) {
+            width: 15%;
+            /*text-align: center;*/
+        }
+        .table > thead > tr > th:nth-child(9) {
             width: 5%;
             display: none;
             /*text-align: center;*/
@@ -81,7 +86,7 @@
             border: 0px;
             border-bottom: 1px dashed #999999;
         }
-        .table > tbody > tr > td:nth-child(8) {
+        .table > tbody > tr > td:nth-child(9) {
             display: none;
         }
 
@@ -119,7 +124,9 @@
             letter-spacing: 0px;
             text-decoration: none;
         }
-
+        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{
+            vertical-align:middle;
+        }
     </style>
 </head>
 {{include "/common/baiducc.html"}}
@@ -127,8 +134,8 @@
 
 <div>
     {{include "/manage/audithead.html"}}
-    <div style="width: 100px;height: 40px;position: relative;float: right;">
-        <a id="return" href="/manage/jyloan/list"> 退出系统</a>
+    <div style="width: 120px;height: 40px;position: relative;float: right;">
+        <a id="return" href="/manage/loan/evaluationlist"> 返回上一级</a>
     </div>
     <div class="row" style="width:96%; margin:0 auto;">
         {{include "/manage/slider.html"}}
@@ -141,15 +148,15 @@
     float: left;
     margin-left: -207px;
 ">
-                <div style="position: relative;float: left;margin-left: 206px;margin-top: -366px;width: 280px;height: 300px;">
+                <div style="position: relative;float: left;margin-left: 220px;margin-top: -366px;width: 350px;height: 300px;overflow-y: auto;overflow-x: hidden">
                     <span style="font-size: 24px;">回访记录:</span>
-                    <span id="visit-person"></span>
-                    <span id="visit-time"></span>
+                    <span id="visit-person" style=" font-weight:400; font-size:22px; color:rgba(94, 126, 240, 1); font-style:normal; letter-spacing:0px; line-height:42px; text-decoration:none;"></span>
+                    <span id="visit-time" style=" font-weight:400; font-size:22px; color:rgba(94, 126, 240, 1); font-style:normal; letter-spacing:0px; line-height:42px; text-decoration:none;"></span>
                     <div id="visit-record" style="overflow-y: auto;">
 
                     </div>
                 </div>
-                <div style="position: relative;float: right;margin-left: 580px;margin-top: -366px;">
+                <div style="position: relative;float: right;margin-left: 605px;margin-top: -366px;">
                     <span style="font-size: 24px" >贷款评估意见:</span>
                     <textarea id="evaluation" name="evaluation" style="width: 400px;height: 200px;" placeholder="多行输入"></textarea>
                     <div>
@@ -205,7 +212,8 @@
 
                     {
                         title: "企业名称", field: "companyName",callback:function (d) {
-                            return d.companyName
+                            var html = '<div style="width: 145px;height: auto;overflow-x: auto;text-align: left;line-height: 37px">'+ d.companyName+'</div>'
+                            return html
                         }
                     },
                     {
@@ -228,6 +236,12 @@
                             return d.price
                         }
                     },
+                    {
+                        title: "贷款时间", field: "price", callback: function (d) {
+                            return timestampToTime(d.application_time)
+
+                        }
+                    },
                     {
                         title:"贷款期限",field:"term",callback:function (d) {
                             return d.term
@@ -235,7 +249,8 @@
                     },
                     {
                         title:"贷款用途",field:"remark",callback:function (d) {
-                            return d.remark
+                            var html = '<div style="width: 145px;height: auto;overflow-x: auto;text-align: left;line-height: 37px">'+ d.remark+'</div>'
+                            return html
 
                         }
                     },
@@ -255,7 +270,7 @@
                 id:"ke_editor",
                 allowFileManager : false,
                 filterMode:true,
-                width : '10px',
+                width : '87%',
                 height:'20px',
                 items:items_simp,
                 allowImageRemoteImageRemote:false,

+ 39 - 29
core/src/web/templates/manage/loan/evaluationlist.html

@@ -5,8 +5,8 @@
     <meta charset="UTF-8">
     {{include "/common/inc.html"}}
     <title>企业评估</title>
-
-    <script src="/js/qfwtable.js"></script>
+    <script src="/loan/js/qfwtable.js"></script>
+    <script src="/loan/js/common.js"></script>
     <style type="text/css">
 
 
@@ -21,34 +21,38 @@
         }
 
         .table > thead > tr > th:nth-child(1) {
-            width: 7%;
+            width: 13%;
         }
 
         .table > thead > tr > th:nth-child(2) {
-            width: 10%;
+            width: 5%;
         }
 
         .table > thead > tr > th:nth-child(3) {
-            width: 10%;
+            width: 5%;
         }
 
         .table > thead > tr > th:nth-child(4) {
-            width: 10%;
+            width: 7%;
         }
 
         .table > thead > tr > th:nth-child(5) {
-            width: 10%;
+            width: 7%;
         }
 
         .table > thead > tr > th:nth-child(6) {
-            width: 10%;
+            width: 6%;
             /*text-align: center;*/
         }
         .table > thead > tr > th:nth-child(7) {
-            width: 10%;
+            width: 8%;
             /*text-align: center;*/
         }
         .table > thead > tr > th:nth-child(8) {
+            width: 15%;
+            /*text-align: center;*/
+        }
+        .table > thead > tr > th:nth-child(9) {
             width: 5%;
             display: none;
             /*text-align: center;*/
@@ -67,7 +71,7 @@
             border: 0px;
             border-bottom: 1px dashed #999999;
         }
-        .table > tbody > tr > td:nth-child(8) {
+        .table > tbody > tr > td:nth-child(9) {
             display: none;
         }
 
@@ -104,6 +108,9 @@
             letter-spacing: 0px;
             text-decoration: none;
         }
+        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{
+            vertical-align:middle;
+        }
     </style>
 </head>
 {{include "/common/baiducc.html"}}
@@ -111,8 +118,8 @@
 
 <div>
     {{include "/manage/audithead.html"}}
-    <div style="width: 100px;height: 40px;position: relative;float: right;">
-        <a id="return" href="/manage/jyloan/list"> 退出系统</a>
+    <div style="width: 120px;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"}}
@@ -147,7 +154,7 @@
             ,
             classname: "table-hover"
             ,
-            css: {"height": "300px"}
+            css: {"height": "450px"}
             //,post:{"name":"ee"}
             ,
             url: '/manage/jy_loan/evaluationlist'
@@ -156,7 +163,8 @@
 
                 {
                     title: "企业名称", field: "companyName",callback:function (d) {
-                        return d.companyName
+                        var html = '<div style="width: 145px;height: auto;overflow-x: auto;text-align: left;line-height: 37px">'+ d.companyName+'</div>'
+                        return html
                     }
                 },
                 {
@@ -179,6 +187,12 @@
                         return d.price
                     }
                 },
+                {
+                    title: "贷款时间", field: "price", callback: function (d) {
+                        return timestampToTime(d.application_time)
+
+                    }
+                },
                 {
                     title:"贷款期限",field:"term",callback:function (d) {
                         return d.term
@@ -186,12 +200,18 @@
                 },
                 {
                     title:"贷款用途",field:"remark",callback:function (d) {
-                        return d.remark
+                        if (typeof (d.remark)!=="undefined"){
+                            var html = '<div style="width: 145px;height: auto;overflow-x: auto;text-align: left;line-height: 37px">'+ d.remark+'</div>'
+                            return html
+                        }else{
+                            return ""
+                        }
+
 
                     }
                 },
                 {
-                    title:"uid",field:"remark",callback:function (d) {
+                    title:"uid",field:"uid",callback:function (d) {
                         return d.uid
 
                     }
@@ -199,23 +219,13 @@
             ]
         });
 
-        $("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();
-        });
+
 
     });
 
     //双击事件
     $("#content").on("dblclick","#audit>.dt-table-wrapper>.table>tbody>tr",function(){
-        uid = $(this).find("td").eq(7).text();
+        uid = $(this).find("td").eq(8).text();
         $(this).css("background","rgb(202, 198, 133)");
         $(this).siblings().css("background","rgb(255,255,255)");
         $.ajax({
@@ -237,7 +247,7 @@
     });
     //单击事件
     $("#content").on("click","#audit>.dt-table-wrapper>.table>tbody>tr",function(){
-        var t = $(this).find("td").eq(7).text();
+        var t = $(this).find("td").eq(8).text();
         if ($(this).hasClass("selected")){
             window.location.href = "/manage/jy_loan/evaluationdetail?uid="+t
         }else{

+ 31 - 16
core/src/web/templates/manage/loan/show_clue.html

@@ -3,8 +3,10 @@
 <head>
     <meta charset="UTF-8">
     {{include "/common/inc.html"}}
+    <script src="/loan/js/qfwtable.js"></script>
     <title>分类线索</title>
     <link href="/css/bootstrap.min.css" rel="stylesheet" />
+    <script src="/loan/js/common.js"></script>
     <style type="text/css">
         #jyloan{
             background-color: #f5f5f5;
@@ -32,34 +34,38 @@
         }
 
         .table > thead > tr > th:nth-child(1) {
-            width: 7%;
+            width: 13%;
         }
 
         .table > thead > tr > th:nth-child(2) {
-            width: 10%;
+            width: 4%;
         }
 
         .table > thead > tr > th:nth-child(3) {
-            width: 10%;
+            width: 8%;
         }
 
         .table > thead > tr > th:nth-child(4) {
-            width: 10%;
+            width: 4%;
         }
 
         .table > thead > tr > th:nth-child(5) {
-            width: 10%;
+            width: 5%;
         }
 
         .table > thead > tr > th:nth-child(6) {
-            width: 10%;
+            width: 4%;
             /*text-align: center;*/
         }
         .table > thead > tr > th:nth-child(7) {
-            width: 10%;
+            width: 5%;
             /*text-align: center;*/
         }
         .table > thead > tr > th:nth-child(8) {
+            width: 5%;
+            /*text-align: center;*/
+        }
+        .table > thead > tr > th:nth-child(9) {
             width: 5%;
             display: none;
             /*text-align: center;*/
@@ -78,7 +84,7 @@
             border: 0px;
             border-bottom: 1px dashed #999999;
         }
-        .table > tbody > tr > td:nth-child(8) {
+        .table > tbody > tr > td:nth-child(9) {
             display: none;
         }
 
@@ -116,6 +122,9 @@
             letter-spacing: 0px;
             text-decoration: none;
         }
+        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{
+            vertical-align:middle;
+        }
 
     </style>
 </head>
@@ -124,8 +133,8 @@
 
 <div>
     {{include "/manage/audithead.html"}}
-    <div style="width: 100px;height: 40px;position: relative;float: right;">
-        <a id="return" href="/manage/jyloan/list"> 退出系统</a>
+    <div style="width: 120px;height: 40px;position: relative;float: right;">
+        <a id="return" href="/manage/loan/cluelist"> 返回上一级</a>
     </div>
     <div class="row" style="width:96%; margin:0 auto;">
         {{include "/manage/slider.html"}}
@@ -133,21 +142,21 @@
         <div id="content">
             <div id="audit" style="margin-top: 20px"></div>
             <div class="record" style="display: none">
-                <div style="height: 300px;width: 200px;overflow-y: auto;float: left;overflow-x: hidden">
+                <div style="height: 300px;width: 200px;overflow-y: auto;float: left;overflow-x: hidden;margin-top: 10px">
                <span style="font-size: 24px;">1 回访记录:</span>
                     <div id="visit_record"></div>
                 </div>
-                <div style="float: left;margin-left: 100px;width: 200px;height: 300px;overflow-y: auto;overflow-x: hidden">
+                <div style="float: left;margin-left: 100px;width: 200px;height: 300px;overflow-y: auto;overflow-x: hidden;margin-top: 10px">
                     <span style="font-size: 24px;">2 评估意见:</span>
                     <div id="evaluation"></div>
                 </div>
-                <div style="width:200px;height: 300px;overflow-y: auto;float: left;margin-left: 100px;overflow-x: hidden">
+                <div style="width:200px;height: 300px;overflow-y: auto;float: left;margin-left: 100px;overflow-x: hidden;margin-top: 10px">
                     <span style="font-size: 24px;">3 分类意见:</span>
                     <div id="classify"></div>
                 </div>
             </div>
             <div id="back">
-                <input  type="button" style="width: 90px; height: 33px; 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; float: right;margin-right: 315px;margin-top: 10px" value="返回" onclick="backup()">
+                <input  type="button" style="width: 90px; height: 33px; 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; float: right;margin-right: 200px;margin-top: 10px" value="返回" onclick="backup()">
             </div>
         </div>
 
@@ -185,7 +194,8 @@
 
                     {
                         title: "企业名称", field: "companyName",callback:function (d) {
-                            return d.companyName
+                            var html = '<div style="width: 145px;height: auto;overflow-x: auto;text-align: left;line-height: 37px">'+ d.companyName+'</div>'
+                            return html
                         }
                     },
                     {
@@ -193,6 +203,12 @@
                             return d.registration
                         }
                     },
+                    {
+                        title: "贷款时间", field: "price", callback: function (d) {
+                            return timestampToTime(d.application_time)
+
+                        }
+                    },
                     {
                         title: "回访人", field: "person",callback:function (d) {
                             if (typeof(d.visit_person) != "undefined"){
@@ -266,7 +282,6 @@
     }
     function format(d) {
         if (typeof(d)!== "undefined"){
-            console.log(d)
             var tt =d.replace(/&#60;/g,"<");
             var t = tt.replace(/&#62;/g,">");
             return t

+ 70 - 52
core/src/web/templates/manage/loan/visit.html

@@ -9,7 +9,8 @@
     <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>
-    <script src="/js/qfwtable.js"></script>
+    <script src="/loan/js/qfwtable.js"></script>
+    <script src="/loan/js/common.js"></script>
     <style type="text/css">
         #jyloan{
             background-color: #f5f5f5;
@@ -30,35 +31,38 @@
         }
 
         .table > thead > tr > th:nth-child(1) {
-            width: 7%;
+            width: 13%;
         }
 
         .table > thead > tr > th:nth-child(2) {
-            width: 10%;
+            width: 5%;
         }
 
         .table > thead > tr > th:nth-child(3) {
-            width: 10%;
+            width: 5%;
         }
 
         .table > thead > tr > th:nth-child(4) {
-            width: 10%;
+            width: 7%;
         }
 
         .table > thead > tr > th:nth-child(5) {
-            width: 10%;
+            width: 7%;
         }
 
         .table > thead > tr > th:nth-child(6) {
-            width: 10%;
+            width: 6%;
             /*text-align: center;*/
         }
         .table > thead > tr > th:nth-child(7) {
-            width: 10%;
+            width: 8%;
             /*text-align: center;*/
         }
         .table > thead > tr > th:nth-child(8) {
-            width: 5%;
+            width: 15%;
+            /*text-align: center;*/
+        }
+        .table > thead > tr > th:nth-child(9) {
             display: none;
             /*text-align: center;*/
         }
@@ -76,7 +80,7 @@
             border: 0px;
             border-bottom: 1px dashed #999999;
         }
-        .table > tbody > tr > td:nth-child(8) {
+        .table > tbody > tr > td:nth-child(9) {
             display: none;
         }
 
@@ -114,6 +118,9 @@
             letter-spacing: 0px;
             text-decoration: none;
         }
+        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{
+            vertical-align:middle;
+        }
 
 
     </style>
@@ -122,20 +129,20 @@
 
 <div>
     {{include "/manage/audithead.html"}}
-    <div style="width: 100px;height: 40px;position: relative;float: right;">
-        <a id="return" href="/manage/jyloan/list"> 退出系统</a>
+    <div style="width: 120px;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>
-        <div class="record" style="display: none;position: relative;margin-left: 206px;top: -467px;">
-            <div style="position: relative;float: left;margin-top: 160px;margin-left: -90px;;">
+        <div class="record" style="display: none;position: relative;margin-left: 206px;top: -340px;">
+            <div style="float: left;margin-top: 100px;margin-left: -90px;width: 600px">
                 <span  style="font-size:24px;padding-left: 100px;">回访记录:</span>
                 <textarea id="visit-record" name="visit-record" style="width: 400px;height: 200px;margin-left: 100px;"></textarea>
             </div>
-            <div style="position: relative;float: left;padding-top: 200px;padding-left: 50px;width: 200px">
+            <div style="position: relative;float: left;margin-top: 127px;padding-left: 50px;width: 200px;">
                 <span style="font-size: 24px" >回访人:</span>
                 <input  id="person" type="text" style="width: 130px" placeholder="单行输入">
                 <div>
@@ -162,6 +169,30 @@
 <script type="text/javascript" src="/js/bootbox.js"></script>
 <script>
     var uid = "";
+    $(function(){
+        var kindEditInit=function(){
+            editor = KindEditor.create('textarea[name="visit-record"]', {
+                id:"ke_editor",
+                allowFileManager : false,
+                filterMode:true,
+                width : '75%',
+                height:'20px',
+                items:items_simp,
+                allowImageRemoteImageRemote:false,
+                uploadJson : '/filemanage/upload',
+                afterCreate:function() {
+                    this.sync()
+                },
+                beforesubmit:function(){
+                    this.sync()
+                },
+                afterBlur: function(){
+                    this.sync()
+                }
+            });
+        };
+        kindEditInit()
+    });
     $(function () {
         $("#audit").datatable({
             perPage: 5
@@ -176,7 +207,7 @@
             ,
             classname: "table-hover"
             ,
-            css: {"height": "300px"}
+            css: {"height": "450px"}
             //,post:{"name":"ee"}
             ,
             url: '/manage/jyloan/telephoneinterviews'
@@ -185,7 +216,11 @@
 
                 {
                     title: "企业名称", field: "companyName", callback: function (d) {
-                        return d.companyName
+                        editor.html("");
+                        $("#person").val("");
+                        $(".record").hide();
+                        var html = '<div style="width: 145px;height: auto;overflow-x: auto;text-align: left;line-height: 37px">'+ d.companyName+'</div>'
+                        return html
                     }
                 },
                 {
@@ -208,6 +243,12 @@
                         return d.price
                     }
                 },
+                {
+                    title: "贷款时间", field: "price", callback: function (d) {
+                        return timestampToTime(d.application_time)
+
+                    }
+                },
                 {
                     title: "贷款期限", field: "term", callback: function (d) {
                         return d.term
@@ -215,12 +256,13 @@
                 },
                 {
                     title: "贷款用途", field: "remark", callback: function (d) {
-                        return d.remark
+                        var html = '<div style="width: 145px;height: auto;overflow-x: auto;text-align: left;line-height: 37px">'+ d.remark+'</div>'
+                        return html
 
                     }
                 },
                 {
-                    title: "uid", field: "remark", callback: function (d) {
+                    title: "uid", field: "uid", callback: function (d) {
                         return d.uid
 
                     }
@@ -229,39 +271,16 @@
         });
     });
 
-    $(function(){
-    var kindEditInit=function(){
-        editor = KindEditor.create('textarea[name="visit-record"]', {
-            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()
-});
     var uid = "";
     //双击事件
     $("#content").on("dblclick","#audit>.dt-table-wrapper>.table>tbody>tr",function(){
-        uid = $(this).find("td").eq(7).text();
-        $("#visit-record").val("");
+        uid = $(this).find("td").eq(8).text();
+
+        editor.html("");
         $("#person").val("");
         $(".record").show();
         $("#person").focus();
-        $(this).css("background","rgb(202, 198, 133)")
+        $(this).css("background","rgb(202, 198, 133)");
         $(this).siblings().css("background","rgb(255,255,255)");
 
     });
@@ -271,7 +290,7 @@
         $(this).css("background","rgb(202, 198, 133)");
         $(this).siblings().css("background","rgb(255,255,255)");
         $(this).siblings().removeClass("selected");
-        $("#visit-record").val("");
+        editor.html("");
         $("#person").val("");
         $(".record").hide()
     });
@@ -303,7 +322,7 @@
     }
     //取消
     function cancle(){
-        $("#visit-record").val("");
+        editor.html("");
         $("#person").val("");
         $(".record").hide()
 
@@ -312,7 +331,7 @@
         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("");
+            editor.html("");
             $("#person").val("");
             $(".record").hide()
             for(var i=0;i<t.length;i++){
@@ -331,9 +350,9 @@
         }
 
         if (e && e.keyCode == 38) { // 上
-            $("#visit-record").val("");
+            editor.html("");
             $("#person").val("");
-            $(".record").hide()
+            $(".record").hide();
             for(var i=0;i<t.length;i++){
                 if ($(t[i]).hasClass("selected")){
                     if (i <= 0){
@@ -350,6 +369,5 @@
         }
 
     }
-
 </script>
 </html>