Commit f93022d6 by felix

每日一更

parent ac609451
......@@ -92,6 +92,23 @@ class Contract_List extends WP_List_Table{
left join tospur_house th on th.id = t.houseId
left join tospur_status ts on ts.status_type = 4 and t.status = ts.status_id
where 1=1 ";
//根据房源编号搜索
$search_type = $_REQUEST['search_type'];
if(isset($_REQUEST[$search_type]) && $search_type == 'search_contractId'){
$sql .= " and t.contractId = '".$_REQUEST["search_contractId"]."'";
}
if(isset($_REQUEST["beginDate"]) &&isset($_REQUEST["endDate"]) &&$search_type == 'search_signedDate') {
$sql .= " and t.signedDate between '".$_REQUEST["beginDate"]."' and '".$_REQUEST["endDate"]."'";
}
if(isset($_REQUEST[$search_type]) && $search_type == 'search_OCname'){
$sql .= " and oName like '%".$_REQUEST["search_OCname"]."%' or cName like '%".$_REQUEST["search_OCname"]."%'";
}
if(isset($_REQUEST[$search_type]) && $search_type == 'search_OCbroker'){
$sql .= " and oBroker like '%".$_REQUEST["search_OCbroker"]."%' or cBroker like '%".$_REQUEST["search_OCbroker"]."%'";
}
//置业顾问显示自己的合同
if(current_user_can("zygw")){
$sql .= " and t.consultantId = ".get_current_user_id();
......
......@@ -35,12 +35,15 @@ class House extends Tospur_House{
'room_id' => $_POST['baseRoom'],
"location" => $_POST["location"],
"property_money" => $_POST["property_money"],
'community_name' => $_POST["community_name"]
'community_name' => $_POST["community_name"],
'publicize' => $_POST["publicize"],
'threeD' => $_POST["threeD"],
'roundLook' => $_POST["roundLook"]
);
$wpdb->query("START TRANSACTION");
if(isset($_POST['houseId'])){
//修改list中当前状态的方法
$insert_tospur_house_array = House::list_status_upate($_POST["userType"],$_POST["status"],$insert_tospur_house_array);
$insert_tospur_house_array = House::list_status_upate($_POST["houseId"],$_POST["status"],$insert_tospur_house_array);
$result = House::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){
$wpdb->query("ROLLBACK");
......@@ -73,6 +76,7 @@ class House extends Tospur_House{
$context["status"] = searchDao::searchStatusType(1);
}
$context['canApproval'] = House::canApproval();
$context['canEdit'] = House::canEdit();
$context["city"] = SearchDao::searchCity();
$context["buildProperty"] = SearchDao::searchBuildProperty();
$context["room"] = SearchDao::searchRoom();
......
......@@ -251,6 +251,7 @@ class Statistics {
}
foreach($consultant as $key => $item){
if($key>0){
$where = array(
"consultantId" => $key,
"date" => $today
......@@ -258,6 +259,7 @@ class Statistics {
Statistics::updateBusiness($item,$where);
}
}
}
public static function updateBusiness($params,$where){
global $wpdb;
......
......@@ -5,6 +5,10 @@ class Tospur_House{
return current_user_can("houseApproval");
}
public static function canEdit(){
return current_user_can("canEdit");
}
public static function getCurrentRole(){
$current_user = wp_get_current_user();
if ( !($current_user instanceof WP_User) )
......@@ -13,9 +17,10 @@ class Tospur_House{
return $roles[0];
}
public static function list_status_upate($userType,$postStatus,$arrayParams){
//首先判断是经理修改还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态
if($userType == 0){
public static function list_status_upate($houseId,$postStatus,$arrayParams){
//首先使用role判断是经理还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态
$role = Tospur_House::getCurrentRole();
if($role == "jl"|| $role == "xzzl"){
//经理
//通过
if($postStatus != -2){
......@@ -25,19 +30,22 @@ class Tospur_House{
//退回
$arrayParams["approval"] = $postStatus;
}
}else{
}else if ($role == "zygw"){
//置业顾问
//修改了状态
$currentStatus = SearchDao::getDetailInfo($_POST["userType"]);
$currentStatus = SearchDao::getDetailInfo($houseId);
if($currentStatus["result"]->status != $postStatus){
$arrayParams["status"] = 0;
$arrayParams["approval"] = $postStatus;
}else {
//没有修改状态
//没有申请审批
if($currentStatus["result"]->approval == -2){
$arrayParams["status"] = 0;
$arrayParams["approval"] = $currentStatus["result"]->status;
}else{
//申请了审批,没有修改状态,approval保持原来的
$arrayParams["status"] = 0;
$arrayParams["approval"] = $currentStatus["result"]->approval;
}
}
......@@ -45,6 +53,7 @@ class Tospur_House{
return $arrayParams;
}
//获得当前登录置业顾问所在门店的所有置业顾问id
public static function get_oganization_consultant(){
global $wpdb;
$string = null;
......
......@@ -57,7 +57,7 @@ class introduction
$context['user_id'] = $user_id;
if($type == 1){
$wpdb->query("START TRANSACTION");
if(!$_POST['oldImg']){
if(!$_POST['oldImg']&&$result->QRcodeImg){
$url = substr_replace(__DIR__,$result->QRcodeImg,strpos(__DIR__,"wp",0)-1);
unlink($url);
}
......
......@@ -153,7 +153,7 @@ sum(p.stockSellH) as sum_stockSellH,sum(p.stockLeaseH) as sum_stockLeaseH,sum(p.
$statistical_time = $_REQUEST['statistical_time'];
if (isset($_REQUEST[$statistical_time]) && $statistical_time == 'day') {
$sql .= " and sb.date = " . $_REQUEST[$statistical_time];
$sql .= " and sb.date = '" . $_REQUEST[$statistical_time] . "'";
}
if (isset($_REQUEST[$statistical_time]) && $statistical_time == 'week') {
$sql .= " and sb.date >= '" . $_REQUEST[$statistical_time] . "' and sb.date < DATE_SUB('" . $_REQUEST[$statistical_time] . "', INTERVAL -1 WEEK)";
......
......@@ -90,6 +90,7 @@ class RentHouse extends Tospur_House{
$context["status"] = searchDao::searchStatusType(2);
}
$context['canApproval'] = House::canApproval();
$context['canEdit'] = House::canEdit();
$context["city"] = SearchDao::searchCity();
$context["buildProperty"] = SearchDao::searchBuildProperty();
$context["room"] = SearchDao::searchRoom();
......
......@@ -89,6 +89,7 @@ class SecHandHouse extends Tospur_House{
}
$context['canApproval'] = House::canApproval();
$context['canEdit'] = House::canEdit();
$context["city"] = SearchDao::searchCity();
$context["buildProperty"] = SearchDao::searchBuildProperty();
$context["room"] = SearchDao::searchRoom();
......
......@@ -23,11 +23,35 @@ class upload
echo '<script>alert("解压文件失败");</script>';
}
@unlink($file);
upload::delDir($to);
}
Timber::render('upload.html');
}
public static function delDir($dir)
{
//先删除目录下的文件
$dh = opendir($dir);
while ($file = readdir($dh)) {
if ($file != "." && $file != "..") {
$fullpath = $dir . "/" . $file;
if (!is_dir($fullpath)) {
unlink($fullpath);
} else {
upload::delDir($fullpath);
}
}
}
closedir($dh);
//删除当前文件夹
if (rmdir($dir)) {
return true;
} else {
return false;
}
}
public static $houseType;
public static function searchDir($path, &$data)
{
......@@ -178,7 +202,7 @@ class upload
$district_id = upload::search_district_id($sheet->getCell('B9')->getValue());
$plate_id = upload::search_plate_id($sheet->getCell('B10')->getValue());
$room_id = upload::search_room_id($sheet->getCell('B23')->getValue());
$consultant_id = upload::search_consultant_id($sheet->getCell('B7')->getValue());
$organization_id = upload::search_organization_id($sheet->getCell('B7')->getValue());
$data = array(
'name' => $sheet->getCell('B1')->getValue(),
......@@ -207,7 +231,7 @@ class upload
'district_id' => $district_id,
'plate_id' => $plate_id,
'room_id' => $room_id,
'user_id' => $consultant_id,
'organizationId' => $organization_id,
'community_name' => $sheet->getCell('B11')->getValue(),
'suite' => $sheet->getCell('B12')->getValue(),
'buildproperty_id' => $sheet->getCell('B17')->getValue(),
......@@ -258,7 +282,7 @@ class upload
if ($city_id) {
return $city_id;
} else {
return 0;
return -1;
}
}
......@@ -268,7 +292,7 @@ class upload
if ($district_id) {
return $district_id;
} else {
return 0;
return -1;
}
}
......@@ -278,7 +302,7 @@ class upload
if ($plate_id) {
return $plate_id;
} else {
return 0;
return -1;
}
}
......@@ -292,11 +316,11 @@ class upload
}
}
public static function search_consultant_id($consultant_name)
public static function search_organization_id($consultant_name)
{
$consultant_id = DBManager::get_var('select id from tospur_consultant where name = "' . $consultant_name . '"');
if ($consultant_id) {
return $consultant_id;
$organization_id = DBManager::get_var('select subsidiaryId from tospur_consultant where name = "' . $consultant_name . '"');
if ($organization_id) {
return $organization_id;
} else {
return 0;
}
......
......@@ -23,10 +23,14 @@
{% endif %}
$(document).ready(function(){
//添加置业顾问
init_modal_myConsultantList(addConsultant);
$("#consultantImg").on("click",".consultantCancel",function(){
$(this).parents("p").remove();
if( $("#consultantImg > p").length == 0){
$("#subsidiaryId").remove();
}
});
});
......@@ -45,8 +49,13 @@
var recommendConsultant = $("<input>").attr({"type":"hidden","name":"data[recConsultant][]","value":data.id});
row.append(left).append(mid).append(right);
var p = $("<p>").append(row).append(recommendConsultant);
var subsidiaryId = $("<input>").attr({"type":"hidden","value":data.subsidiaryId,"id":"subsidiaryId"});
if($("#consultantImg > p").length == 0){
$("#consultantImg").append(p).append(subsidiaryId);
}else{
$("#consultantImg").append(p);
{% if (house_type == 1 or house_type == 2 or page == 'customer' or page == 'view') %}
}
{% if (house_type == 1 or house_type == 2 or page == 'customer') %}
controlCommand("consultantImg",1,1);
{% endif %}
}
......
......@@ -3,7 +3,7 @@
<form method="get">
<input type="hidden" name="page" value="commissionList">
{% import "selectOrganization.html" as macro %}
{{ macro.selectOrganization("") }}
{{ macro.selectOrganization("commission") }}
<div id="search_form">
<label for="year" class="hidden"></label>
<select name="year" id="year">
......@@ -37,8 +37,8 @@
<script>
$(document).ready(function () {
$('form').submit(function () {
var organization = getOrganization();
var select = $('select[data-depth]:not(.hidden)');
var organization = getOrganization('commission');
var select = $('#commission_organization').find('select[data-depth]:not(.hidden)');
if (select.length > 1 && organization == -1) {
alert('请选择门店');
return false;
......
......@@ -156,7 +156,7 @@
</p>
<p>
<label for="oBroker">经纪人:</label>
<input name="oBroker" id="oBroker" type="text" value="{{result.oBroker}}" class="form-control">
<input name="oBroker" id="oBroker" type="text" value="{{result.oBroker}}" placeholder="佣金管理设置后自动填充" readonly class="form-control">
</p>
<p>
<label for="oCommission">佣金:</label>
......@@ -192,7 +192,7 @@
</p>
<p>
<label for="cBroker">经纪人:</label>
<input name="cBroker" id="cBroker" type="text" value="{{result.oBroker}}" class="form-control">
<input name="cBroker" id="cBroker" type="text" value="{{result.oBroker}}" placeholder="佣金管理设置后自动填充" readonly class="form-control">
</p>
<p>
<label for="cCommission">佣金:</label>
......@@ -258,7 +258,7 @@
<div class="row">
<div class="col-md-8">
<label for="buy[mtime]">应收时间:</label>
<input name="buy[mtime]" type="text" class="form-control" {% if commission[0] %}value = "{{commission[0].mtime}}" readonly {% endif %}>
<input name="buy[mtime]" type="date" class="form-control" {% if commission[0] %}value = "{{commission[0].mtime}}" readonly {% endif %}>
</div>
</div>
<br/>
......@@ -355,7 +355,7 @@
<div class="row">
<div class="col-md-8">
<label for="sell[mtime]">应收时间:</label>
<input name="sell[mtime]" type="text" class="form-control" {% if commission[1] %}value = "{{commission[1].mtime}}" readonly {% endif %}>
<input name="sell[mtime]" type="date" class="form-control" {% if commission[1] %}value = "{{commission[1].mtime}}" readonly {% endif %}>
</div>
</div>
<br/>
......@@ -631,7 +631,11 @@
var clickButtonId = $("#myConsultant").data("id");
var type = clickButtonId.split("_")[1];
var clickButton = $("#"+clickButtonId);
if(type == "buy"){
$("#cBroker").val(data.name);
}else{
$("#oBroker").val(data.name);
}
if($("#staffImg_"+type+" > div").length >0 ){
$("#staffImg_"+type+" > div").remove();
}
......
<style>
div.col-md-4 {
margin-bottom: 10px;
height: 28px;
}
input[type=radio] {
margin: 0 4px 0 0;
}
</style>
<div class="wrap">
<h2>合同列表</h2>
<form method="GET" class="form-inline" id="scores-filter">
<div class="row" style="margin-top: 10px">
<div class="col-md-8">
<label>查询类型:</label>
<input type="radio" name="search_type" value="0" checked>不限
<input type="radio" name="search_type" value="search_contractId">合同编号
<input type="radio" name="search_type" value="search_signedDate">签约日期
<input type="radio" name="search_type" value="search_OCname">业主/客户姓名
<input type="radio" name="search_type" value="search_OCbroker">买/卖方经纪人
</div>
</div>
<div class="row" style="margin-top: 10px">
<div id="search_type_0" style="display: none;" class="col-md-8">
<label for="contractId">合同编号:</label>
<input type="text" name="search_contractId" class="form-control">
</div>
<div id="search_type_1" style="display: none;" class="col-md-8">
<label for="signedDate">签约日期:</label>
<input type="date" name="beginDate" class="form-control"> -
<input type="date" name="endDate" class="form-control">
</div>
<div id="search_type_2" style="display: none;" class="col-md-8">
<label for="signedDate">业主/客户姓名:</label>
<input type="text" name="search_OCname" class="form-control">
</div>
<div id="search_type_3" style="display: none;" class="col-md-8">
<label for="signedDate">买/卖方经纪人:</label>
<input type="text" name="search_OCbroker" class="form-control">
</div>
</div>
<div class="row" style="margin-top: 10px;margin-left: 0px">
<input type="submit" id="submit" class="button action" value="搜索">
<input type="button" id="reset"class="button action" value="重置">
</div>
<input type="hidden" name="page" value="contractList"/>
</form>
{{function("Contract_List::displayTable")}}
</div>
<script>
$(document).ready(function(){
var search_type_0 = $('#search_type_0');
var search_type_1 = $('#search_type_1');
var search_type_2 = $('#search_type_2');
var search_type_3 = $('#search_type_3');
$('input[name=search_type]').change(function () {
var value = $(this).val();
switch (value) {
case 'search_contractId':
search_type_0.show();
search_type_1.hide();
search_type_2.hide();
search_type_3.hide();
break;
case 'search_signedDate':
search_type_0.hide();
search_type_1.show();
search_type_2.hide();
search_type_3.hide();
break;
case 'search_OCname':
search_type_0.hide();
search_type_1.hide();
search_type_2.show();
search_type_3.hide();
break;
case 'search_OCbroker':
search_type_0.hide();
search_type_1.hide();
search_type_2.hide();
search_type_3.show();
break;
default:
search_type_0.hide();
search_type_1.hide();
search_type_2.hide();
search_type_3.hide();
break;
}
});
$("#reset").click(function(){
window.location.href="?page=contractList";
});
});
</script>
\ No newline at end of file
......@@ -169,7 +169,7 @@
allot_consultant('customerlist');
$('form').submit(function () {
var organization = getOrganization();
var organization = getOrganization('customer');
var select = $('#customer_organization').find('select[data-depth]:not(.hidden)');
if (select.length > 1 && organization == -1) {
alert('请选择门店');
......
......@@ -6,7 +6,7 @@
<div>
{% import "selectOrganization.html" as macro %}
{{ macro.selectOrganization("") }}
{{ macro.selectOrganization("customerTracking") }}
<label for="status_type" class="hidden"></label>
<select name="status_type" id="status_type">
<option value="-1">跟进类型</option>
......@@ -36,8 +36,8 @@
search_form_set_page();
$('form').submit(function () {
var organization = getOrganization();
var select = $('select[data-depth]:not(.hidden)');
var organization = getOrganization('customerTracking');
var select = $('#customerTracking_organization').find('select[data-depth]:not(.hidden)');
if (select.length > 1 && organization == -1) {
alert('请选择门店');
return false;
......
......@@ -14,23 +14,24 @@
<label for="introduction" style="vertical-align: top;">诚信宣言:</label>
<textarea name="introduction" placeholder="请输入诚信宣言" rows="10" cols="50" style="resize: none;">{{ result.introduction }}</textarea>
</p>
<table class="form-table">
<tbody id="QRcodeTable" >
<div class="row" id="QRcodeDiv">
<div class="col-md-2">
<label for="QRcode" style="vertical-align: top;">微信二维码:</label>
</div>
{% if result.QRcodeImg %}
<tr>
<td>
<img src=" {{siteUrl}}{{result.QRcodeImg}}" height="90" width="140" >
<p class="col-md-4">
<img src=" {{siteUrl}}{{result.QRcodeImg}}" height="300px" width="350px">
<input type="hidden" name="oldImg" value="1">
</td>
</tr>
{% endif %}
</tbody>
</table>
<p>
<button type="button" id="QRcode" class="button action" data-toggle="modal" style="margin-top: 10px">
微信二维码
</button>
</p>
{% endif %}
<div class="col-md-2" id="addQRcode">
<input type="file" name="files" id="file" style="display: none;">
<a class="file-input-wrapper btn btn-default" onclick="$('#file').click();" style="margin-bottom: 10px;">
<span id="name">修改二维码</span>
</a>
</div>
</div>
<p>
<input type="hidden" name="user_id" value="{{ user_id }}">
<input type="hidden" name="type" value="1">
......@@ -40,42 +41,16 @@
<script>
(function ($) {
$(document).ready(function () {
// $('#submit').click(function () {
// var introduction = $('#introduction').val();
// var time = $('#time').val();
// var user_id = $('#user_id').val();
// $.ajax({
// type: 'POST',
// url: '{{ url }}/wp-admin/admin-ajax.php/',
// data: 'action=submit_introduction&time=' + time + '&introduction=' + introduction + '&user_id=' + user_id,
// success: function (data) {
// if (data) {
// alert('提交成功');
// }
// }
// });
// });
$("#QRcode").click(function(){
if($("#QRcodeTable > tr").length > 0){
$("#QRcodeTable").find("tr").remove();
}
var tr = $("<tr>");
var td = $("<td>");
var file = $("<input>").attr({"type":"file","name":"files"}).addClass("picFiles form-control").css("width","20%");
var td2 = td.clone().css("width","30%").append(file);
tr.append(td2);
$("#QRcodeTable").append(tr);
});
$("#QRcodeTable").on("change",".picFiles",function(){
var that = this;
$("#file").bind("change",function(){
if (this.files && this.files[0]){
var reader = new FileReader();
reader.onload = function (e){
var img = $("<img>").attr({"src":e.target.result,"heghit":90,"width":140});
$(that).before(img);
$(that).hide();
if($("#QRcodeDiv > p").length > 0){
$("#QRcodeDiv").find("p").remove();
}
var img = $("<img>").attr({"src":e.target.result,"height":"300px",width:"350px"});
var p = $("<p>").addClass("col-md-4").append(img);
$("#addQRcode").before(p);
}
reader.readAsDataURL(this.files[0]);
}
......
......@@ -72,24 +72,6 @@
}
//搜索置业顾问的方法
//function searchConsultant(consulCityId,consultantName){
// $.ajax({
// type: "GET",
// url: "/tospur/wp-admin/admin-ajax.php",
// data: "action=searchConsultant&consulCityId="+consulCityId+"&consultantName="+consultantName,
// success:function(json){
// for(var i = 0; i <=json.length-1; i++){
// var name = json[i]["consultantName"];
// var imgUrl = json[i]["imageUrl"];
// var img = $("<img>").attr({"src":imgUrl,"height":100,"width":100,"style":"margin-right:50px"});
// var li = $("<li>").attr("id",json[i]["id"]).append(img).append(name).addClass("consultantImg");
// $("#consultantList").append(li);
// }
// }
// });
//}
//往给定id的select中添加option
function addOption(json,select){
......@@ -98,6 +80,9 @@
for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"];
var value = json[i]["value"];
if(value == ""){
value = "不限";
}
if(selectId.indexOf("creage") > -1|| selectId.indexOf("rice") > -1){
id = value;
}
......@@ -264,7 +249,23 @@
}
});
}
Date.prototype.Format = function (fmt) {
var o = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
"S": this.getMilliseconds()
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
};
......@@ -28,7 +28,7 @@
<option value="-1">板块</option>
{% if plate %}
{% for item in plate %}
<option {{ item.id == plateId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
<option {{ item.id == plateId ?"selected":"" }} value="{{ item.id }}">{% if not item.value %}不限{% else %}{{ item.value }}{% endif %}</option>
{% endfor %}
{% endif %}
</select>
......@@ -150,8 +150,8 @@
{% endif %}
$('#scores-filter').submit(function () {
var organization = getOrganization();
var select = $('select[data-depth]:not(.hidden)');
var organization = getOrganization('list');
var select = $('#list_organization').find('select[data-depth]:not(.hidden)');
if (select.length > 1 && organization == -1) {
alert('请选择门店');
return false;
......
......@@ -29,7 +29,7 @@
</div>
</div>
{% endfor %}
<input type="file" name="files[0]" property="0" class = "files form-control"multiple style="width: 30%;margin-top: 5px">
<input type="file" name="files[0]" property="0" class = "files form-control"multiple style="width: 30%;margin-top: 10px;margin-bottom: 10px">
<div id="mainHouseDiv"></div>
<input type="hidden" name="exists_ids" value="{{exists_ids}}" >
</div>
......@@ -67,12 +67,10 @@
div4.append(button);
var type = $("<input>").attr({"type":"hidden","name":"data["+i+"][type]","value":4,"property":+i});
var mainHousePic = $("<input>").attr({"type":"hidden","name":"data["+i+"][mainHouse]","value":0,"property":+i});
var file = $("<input>").attr({"type":"file","name":"files["+(i+1)+"]","property":+(i+1)}).addClass("files form-control").css({"width":"30%","margin-top":"10px"});
var file = $("<input>").attr({"type":"file","name":"files["+(i+1)+"]","property":+(i+1)}).addClass("files form-control").css({"width":"30%","margin-top":"10px","margin-bottom":"10px"});
{% for item in buildProperty %}
select.append($("<option>").attr("value",{{item.id}}).append('{{item.value}}'));
{% endfor%}
var div = $("<div>").attr({"property":+i,"style":"margin-top:5px"}).addClass("row").append(div1).append(div2).append(div3).append(div4).append(type).append(mainHousePic);
$("form").find("#mainHouseDiv").after(file);
$("#mainHouseDiv").append(div);
......
......@@ -58,7 +58,7 @@
<div class="col-xs-4 ">
<label for="check_in_time" class="col-xs-5 control-label">入住时间:</label>
<p class="col-xs-7">
<input name="check_in_time" id="checkin" type="date" value="{{result.check_in_time}}" class="form-control" >
<input name="check_in_time" id="checkin" type="text" value="{{result.check_in_time}}" class="form-control" >
</p>
</div>
<div class="col-xs-4 ">
......@@ -186,3 +186,31 @@
</p>
</div>
</div>
<div class="row form-group">
<div class="col-xs-8">
<label for="publicize" class="col-xs-2 control-label" >项目宣传:</label>
<p class="col-xs-10">
<input name="publicize" type="text" value="{{result.publicize}}" class="form-control" >
</p>
</div>
</div>
<div class="row form-group">
<div class="col-xs-8">
<label for="threeD" class="col-xs-2 control-label" >3D户型:</label>
<p class="col-xs-10">
<input name="threeD" type="text" value="{{result.threeD}}" class="form-control">
</p>
</div>
</div>
<div class="row form-group">
<div class="col-xs-8">
<label for="roundLook" class="col-xs-2 control-label" >360°看房:</label>
<p class="col-xs-10">
<input name="roundLook" type="text" value="{{result.roundLook}}" class="form-control">
</p>
</div>
</div>
......@@ -61,7 +61,8 @@
{% endif %}
</div>
<div class="col-xs-2">
<div class="row" style="position: fixed;top:200px;">
<div class="row" style="position: fixed;">
{% if canEdit %}
{% if houseId %}
{% if canApproval %}
{% if result.approval != -2 %}
......@@ -69,7 +70,8 @@
<option value="{{result.approval}}">通过</option>
<option value="-2">退回</option>
</select>
<input type="hidden" name="userType" value="0">
{% else %}
<input type="hidden" name="status" value="{{result.status}}">
{% endif %}
{% else %}
<select name="status" class="form-control">
......@@ -77,10 +79,10 @@
<option {{ item.id == result.status?"selected":"" }} value={{item.id}}>{{item.value}}</option>
{% endfor %}
</select>
<input type="hidden" name="userType" value="{{houseId}}">
{% endif %}
{% endif %}
<input type="submit" id="submit" class="button action" style="float:left">
{% endif %}
</div>
</div>
......
......@@ -42,7 +42,7 @@
</tbody>
</table>
</div>
<button type="button" id="housePicture" class="button action" data-toggle="modal" style="margin-top: 10px;margin-left: 225px">
<button type="button" id="housePicture" class="button action" data-toggle="modal" style="margin-top: 10px;margin-left: 225px;margin-bottom: 10px">
新增
</button>
<input type="hidden" name="exists_photo_ids" value="{{exists_photo_ids}}" >
......
......@@ -14,7 +14,7 @@
<div class="row" style="margin-top: 10px;">
<div class="col-md-4">
<label>查询类型:</label>
<input type="radio" name="search_type" value="0" checked>不限
<input type="radio" name="search_type" value="0">不限
<input type="radio" name="search_type" value="search_consultant_name">置业顾问
<input type="radio" name="search_type" value="organization">部门
</div>
......@@ -25,13 +25,13 @@
</div>
<div id="search_type_1" style="display: none;" class="col-md-8">
{% import "selectOrganization.html" as macro %}
{{ macro.selectOrganization("") }}
{{ macro.selectOrganization("progress") }}
</div>
</div>
<div class="row">
<div class="col-md-4">
<label>统计时间:</label>
<input type="radio" name="statistical_time" value="0" checked>不限
<input type="radio" name="statistical_time" value="0">不限
<input type="radio" name="statistical_time" value="day">
<input type="radio" name="statistical_time" value="week">
<input type="radio" name="statistical_time" value="month">
......@@ -139,8 +139,8 @@
$('form').submit(function () {
var search_type = $('input[name=search_type]:checked').val();
if (search_type == 'organization') {
var organization = getOrganization();
var select = $('select[data-depth]:not(.hidden)');
var organization = getOrganization('progress');
var select = $('#progress_organization').find('select[data-depth]:not(.hidden)');
if (select.length > 1 && organization == -1) {
alert('请选择门店');
return false;
......@@ -160,6 +160,7 @@
var req_search_type = '{{ req.search_type }}';
if (req_statistical_time == 'week') {
week.val('{{ req.select_week }}');
$('#week').val('{{ req.week }}');
week.show();
} else if (req_statistical_time == 'month') {
year.show();
......
......@@ -3,7 +3,7 @@
<form method="get">
<input type="hidden" name="page" value="quotaList">
{% import "selectOrganization.html" as macro %}
{{ macro.selectOrganization("") }}
{{ macro.selectOrganization("quota") }}
<div id="search_form">
<select name="year" id="year">
<option value="2015">2015</option>
......@@ -37,8 +37,8 @@
{% endif %}
$('form').submit(function () {
var organization = getOrganization();
var select = $('select[data-depth]:not(.hidden)');
var organization = getOrganization('quota');
var select = $('#quota_organization').find('select[data-depth]:not(.hidden)');
if (select.length > 1 && organization == -1) {
alert('请选择门店');
return false;
......
......@@ -2,11 +2,19 @@
<div class="modal fade" id="myConsultant" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body" style="height: 300px;overflow: auto;">
<div class="modal-header">
{% import "selectOrganization.html" as macro %}
{{ macro.selectOrganization("consultant") }}
<div class="row">
<div class="col-md-6">
<input type="text" placeholder="请出入置业顾问姓名搜索" id="consultantName" class="form-control">
</div>
<div class="col-md-2">
<button type="button" class="button action" id="searchConsult">搜索</button>
</div>
</div>
</div>
<div class="modal-body" style="height: 300px;overflow: auto;">
<ul id="consultantList">
</ul>
</div>
......@@ -23,15 +31,33 @@
$("#searchConsult").click(function(){
$("#consultantList").find("li").remove();
var consultantName = $("#consultantName").val();
var organizationId = getOrganization();
if(organizationId == -1 && consultantName == ""){
var organizationId = getOrganization('consultant');
var select = $('#consultant_organization').find('select[data-depth]:not(.hidden)');
if(select.length > 1 && organizationId == -1 && consultantName == ""){
alert("请选择部门")
}
searchConsultant(organizationId,consultantName);
});
$("#consultantList").on("click",".consultantImg",function(){
var firstId = $("#subsidiaryId").val();
if(firstId){
if($(this).data().subsidiaryId != firstId){
alert("请选择相同部门的置业顾问");
return false;
}
}
var consultantArray = [];
$('input[name="data[recConsultant][]"]').each(function (index, item) {
consultantArray.push(Number($(item).val()));
});
if($.inArray(Number($(this).data().id),consultantArray) == -1){
callback($(this).data());
}else{
alert('不能重复置业顾问');
}
});
}
......
......@@ -51,6 +51,7 @@
</div>
<div class="col-xs-2">
<div class="row" style="position: fixed;">
{% if canEdit %}
{% if (result.status != 2 and result.status != 3) %}
{% if houseId %}
{% if canApproval %}
......@@ -59,7 +60,8 @@
<option value="{{result.approval}}">通过</option>
<option value="-2">退回</option>
</select>
<input type="hidden" name="userType" value="0">
{% else %}
<input type="hidden" name="status" value="{{result.status}}">
{% endif %}
{% else %}
<select name="status" class="form-control">
......@@ -67,11 +69,11 @@
<option {{ item.id == result.status?"selected":"" }} value={{item.id}}>{{item.value}}</option>
{% endfor %}
</select>
<input type="hidden" name="userType" value="{{houseId}}">
{% endif %}
{% endif %}
<input type="submit" id="submit" class="button action" style="float:left">
{% endif %}
{% endif %}
</div>
</div>
</div>
......
......@@ -54,7 +54,8 @@
{% endif %}
</div>
<div class="col-xs-2">
<div class="row" style="position: fixed;top:200px;">
<div class="row" style="position: fixed;">
{% if canEdit %}
{% if (result.status != 2 and result.status != 3) %}
{% if houseId %}
{% if canApproval %}
......@@ -63,7 +64,8 @@
<option value="{{result.approval}}">通过</option>
<option value="-2">退回</option>
</select>
<input type="hidden" name="userType" value="0">
{% else %}
<input type="hidden" name="status" value="{{result.status}}">
{% endif %}
{% else %}
<select name="status" class="form-control">
......@@ -76,6 +78,7 @@
{% endif %}
<input type="submit" id="submit" class="button action" style="float:left">
{% endif %}
{% endif %}
</div>
</div>
</div>
......
......@@ -65,8 +65,8 @@
}
});
function getOrganization() {
return Number($('#{{prefix}}_organization select[data-depth]:not(.hidden):last').val());
function getOrganization(prefix) {
return Number($('#' + prefix + '_organization').find('select[data-depth]:not(.hidden):last').val());
}
</script>
{% endmacro %}
\ No newline at end of file
......@@ -41,7 +41,7 @@ class CommissionDao{
public static function search_tospur_commission($contractId){
global $wpdb;
$sql = "select id,accounts,type from ".Config::TOSPUR_COMMISSION."
$sql = "select id,accounts,type,mtime from ".Config::TOSPUR_COMMISSION."
where contractId = %d";
$result = $wpdb->get_results($wpdb->prepare($sql,$contractId));
return $result;
......
......@@ -34,6 +34,8 @@ class CustomerTrackingDao
} else {
return '新增客户跟踪失败';
}
}else{
return 0;
}
}
......
......@@ -205,7 +205,7 @@ class SearchDao
" where 1=1 and th.status = 1 ";
if ($array['cityId'] > -1) {
$params[] = $array['cityId'];
$sql = $sql . " and city_id=%d";
$sql = $sql . " and cityId=%d";
}
if ($array['districtId'] > -1) {
$params[] = $array['districtId'];
......
......@@ -51,7 +51,6 @@ function tospur_init()
//Statistics::business();
tospur_register_script_style();
tospur_ajax_set();
custom_role();
tospur_theme_format();
}
add_action('statistics', 'Statistics::business');
......@@ -224,7 +223,8 @@ function custom_role() {
"fdfw_cs" => true,
"fdfw_cz" => true,
"yyList"=>true,
"plsc"=>true
"plsc"=>true,
"canEdit"=>true
);
add_role("zygw","置业顾问",array(
......@@ -241,11 +241,18 @@ function custom_role() {
"fdfw_cs" => true,
"fdfw_cz" => true,
"mySet" => true,
"yyList"=>true
"yyList"=>true,
"canEdit"=>true
));
add_role("qzzy","权证专员",array(
"ht"=>true,
"htEdit"=>true
"htEdit"=>true,
"xf"=>true,
"xfList"=>true,
"esf"=>true,
"esfList"=>true,
"zf"=>true,
"zfList"=>true
));
add_role("xzzl","行政助理",array(
......@@ -274,7 +281,8 @@ function custom_role() {
"fdfw_cs" => true,
"fdfw_cz" => true,
"yyList"=>true,
"plsc"=>true
"plsc"=>true,
"canEdit"=>true
));
add_role("jl","经理",array(
......@@ -303,7 +311,8 @@ function custom_role() {
"fdfw_cs" => true,
"fdfw_cz" => true,
"yyList"=>true,
"plsc"=>true
"plsc"=>true,
"canEdit"=>true
));
}
register_activation_hook( __FILE__, 'custom_role' );
......
......@@ -373,7 +373,7 @@ a:hover {
padding: 20px 0;
border-bottom: 1px solid #7d7d7d;
position: relative;
height: 94px;
height: auto;
}
#wrapper #scroller ul li p {
padding-left: 15px;
......@@ -383,18 +383,18 @@ a:hover {
color: #000000;
font-size: 22px;
font-weight: bold;
margin-bottom: 2px;
margin-bottom: 5px;
}
#wrapper #scroller ul li p.accept {
position: absolute;
top: 28px;
bottom: 15px;
right: 10px;
}
#wrapper #scroller ul li p.accept .btn {
color: #ffffff;
font-weight: bold;
margin: 0;
padding: 6px 12px;
padding: 4px 12px;
background-color: #008cd7;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
......
......@@ -399,13 +399,13 @@ body {
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
}
.iconList li:nth-child(1) {
.iconList li.eye {
background-image: url("../img/white_3d_icon.png");
}
.iconList li:nth-child(2) {
.iconList li.video {
background-image: url("../img/white_videocamera_icon.png");
}
.iconList li:nth-child(3) {
.iconList li.panorama {
background-image: url("../img/white_panorama_icon.png");
}
.addWrap {
......
......@@ -500,6 +500,7 @@ a:hover {
}
.container-fluid form a {
display: block;
text-align: center;
color: #ffffff;
font-size: 16px;
}
......
......@@ -356,17 +356,56 @@ body {
a:hover {
text-decoration: none;
}
#navWrapper {
width: 100%;
height: 50px;
overflow: hidden;
border-bottom: 1px solid #008cd7;
}
#navWrapper #navScroller {
height: 100%;
float: left;
padding: 0;
}
#navWrapper #navScroller ul {
float: left;
width: 100%;
height: 100%;
margin: 0;
font-size: 0;
}
#navWrapper #navScroller ul li .btn {
color: #000000;
font-weight: bold;
border-width: 1px 0 4px 0;
padding: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
}
#navWrapper #navScroller ul li .btn:active {
box-shadow: none;
-webkit-box-shadow: none;
}
#navWrapper #navScroller ul li.active a {
border-bottom-color: #008cd7;
}
#tabWrapper {
position: absolute;
z-index: 1;
top: 40px;
top: 50px;
bottom: 0;
left: 0;
width: 100%;
overflow: hidden;
}
#tabWrapper #tabScroller {
padding-bottom: 15px;
padding-bottom: 10px;
}
.tab-content .tab-pane ul li {
width: 100%;
......@@ -459,6 +498,6 @@ a:hover {
.tab-content .tab-pane .btn:focus {
outline: 0;
}
.tab-content .tab-pane:last-child .btn {
margin-top: 5%;
.tab-content .tab-pane#combined_loan .btn {
margin-top: 4%;
}
<?php
require_once('const.php');
require_once(dirname(__FILE__) . '/../../plugins/tospur/Dao/DBManager.php');
require_once(dirname(__FILE__) . '/../../plugins/tospur/Dao/TospurDao.php');
require_once(dirname(__FILE__) . '/../../plugins/tospur/Dao/SearchDao.php');
require_once(dirname(__FILE__) . '/../../plugins/tospur/Tools/Image.php');
......@@ -51,12 +52,6 @@ function page_template($template)
case 'loan_calculator':
$page = $theme . '/loan_calculator.php';
break;
case 'tax_calculator':
$page = $theme . '/tax_calculator.php';
break;
case 'ability_calculator':
$page = $theme . '/ability_calculator.php';
break;
case 'manager':
$page = $theme . '/manager.php';
break;
......@@ -160,7 +155,7 @@ function add_consultant_score()
$type = TospurDao::search_score_type($_POST['user_id'], $_POST['consultant_id']);
$result = null;
if ($type) {
$result = TospurDao::insert_consultant_score($_POST['consultant_id'], $_POST['user_id'], $_POST['score']);
$result = TospurDao::insert_consultant_score($_POST['consultant_id'], $_POST['user_id'], $_POST['score'], $type);
}
$array = array();
if ($type && $result) {
......@@ -225,8 +220,7 @@ function add_collect($house_id)
'house_id' => $_POST["hid"],
'user_type' => 0
);
global $wpdb;
$result = $wpdb->insert('a_house_user', $insert_a_house_user_array);
$result = DBManager::insert('a_house_user', $insert_a_house_user_array);
$array = array();
if ($result) {
......
......@@ -131,12 +131,12 @@ function ajax_get_house(url, loading, ajax_data, context) {
div.find('[data-attr=price]').html('<em>' + price + '</em>/m<em>2</em>');
} else if (houseType == 1) {
div.find('[data-attr=community]').text(value.community_name);
div.find('[data-attr=apartment]').text(value.bp_literal);
div.find('[data-attr=apartment]').text(value.bp_literal||'未知');
div.find('[data-attr=covered_area]').text(value.covered_area + '平米');
div.find('[data-attr=price]').html('<em>' + value.total_price + '万</em>');
} else if (houseType == 2) {
div.find('[data-attr=community]').text(value.community_name);
div.find('[data-attr=apartment]').text(value.bp_literal);
div.find('[data-attr=apartment]').text(value.bp_literal||'未知');
div.find('[data-attr=covered_area]').text(value.covered_area + '平米');
div.find('[data-attr=decoration]').text(value.decoration);
var rent = value.rent;
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=360, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<title>购房能力评估计算器</title>
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/component.css"/>
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/animations.css"/>
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/loan_calculator.css">
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/loan_detail.css">
<script type="text/javascript" src="{{ theme }}/js/iscroll.js"></script>
<script type="text/javascript" src="{{ theme }}/js/jquery.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/modernizr.custom.js"></script>
<script type="text/javascript" src="{{ theme }}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/jquery.mobile.custom.min.js"></script>
</head>
<body>
<div id="pt-main" class="pt-perspective">
<div class="pt-page pt-page-1">
<ul id="tab" class="list-unstyled btn-group-justified tab">
<li class="btn-group active">
<a href="#ability" data-toggle="tab" class="btn">购房能力评估</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade in active" id="ability">
<ul class="list-unstyled">
<li>
<label class="col-xs-5">现持有资金:</label>
<p class="col-xs-5">
<input type="number" class="form-control" id="hold">
</p>
<p class="col-xs-2"></p>
</li>
<li>
<label class="col-xs-5">现家庭月收入:</label>
<p class="col-xs-5">
<input type="number" class="form-control" id="income">
</p>
<p class="col-xs-2"></p>
</li>
<li>
<label class="col-xs-5">家庭月固定支出:</label>
<p class="col-xs-5">
<input type="number" class="form-control" id="expense">
</p>
<p class="col-xs-2"></p>
</li>
<li class="arrow">
<label class="col-xs-5">还款年限:</label>
<p class="col-xs-7">
<select class="form-control" id="month">
<option value="12">1年(12期)</option>
<option value="24">2年(24期)</option>
<option value="36">3年(36期)</option>
<option value="48">4年(48期)</option>
<option value="60">5年(60期)</option>
<option value="72">6年(72期)</option>
<option value="84">7年(84期)</option>
<option value="96">8年(96期)</option>
<option value="108">9年(108期)</option>
<option value="120">10年(120期)</option>
<option value="132">11年(132期)</option>
<option value="144">12年(144期)</option>
<option value="156">13年(156期)</option>
<option value="168">14年(168期)</option>
<option value="180">15年(180期)</option>
<option value="192">16年(192期)</option>
<option value="204">17年(204期)</option>
<option value="216">18年(216期)</option>
<option value="228">19年(228期)</option>
<option value="240" selected="selected">20年(240期)</option>
<option value="300">25年(300期)</option>
<option value="360">30年(360期)</option>
</select>
</p>
</li>
<li>
<label class="col-xs-4">房屋面积:</label>
<p class="col-xs-5">
<input type="number" class="form-control" id="area">
</p>
<p class="col-xs-3">平方米</p>
</li>
</ul>
<input type="submit" value="开始计算" class="btn btn-lg">
</div>
</div>
</div>
<div class="pt-page pt-page-2">
<div id="wrapper" style="top: 0;">
<div id="scroller">
<ul class="list-unstyled" id="result">
</ul>
</div>
</div>
</div>
</div>
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content text-center">
<h4>提示</h4>
<p id="notice"></p>
<button type="button" class="btn btn-lg btn-block" data-dismiss="modal">确认</button>
</div>
</div>
</div>
<script type="text/javascript" src="{{ theme }}/js/pagetransitions.js"></script>
<script>
var page = 0;
var resultList;
$(document).ready(function () {
var notice = $('#notice');
var myModal = $('#myModal');
$('input[type=submit]').tap(function () {
var hold = Number($('#hold').val().trim());
var income = Number($('#income').val().trim());
var expense = Number($('#expense').val().trim());
var month = Number($('#month').val());
var area = Number($('#area').val().trim());
console.log(hold);
console.log(income);
console.log(expense);
console.log(month);
console.log(area);
if (hold == '') {
notice.html('请输入现持有资金');
myModal.modal('show');
} else if (income == '') {
notice.html('请输入现家庭月收入');
myModal.modal('show');
} else if (expense == '') {
notice.html('请输入家庭月固定支出');
myModal.modal('show');
} else if (month == '') {
notice.html('请输入还款年限');
myModal.modal('show');
} else if (area == '') {
notice.html('请输入房屋面积');
myModal.modal('show');
} else {
resultList = $('#result');
var abilityResult = abilityCalculator(month, hold, income, expense, area);
resultList.html('<li><span class="col-xs-4">房屋总价:</span><span>' + abilityResult.total + '元</span></li>' +
'<li><span class="col-xs-4">房屋单价:</span><span>' + abilityResult.avgPrice + '元/平方</span></li>');
page = 1;
window.location.href = '#result';
PageTransitions.nextPage({
animation: 1,
showPage: page
});
}
return false;
});
if (window.location.hash == '#result') {
window.history.back();
}
window.addEventListener("popstate", function (e) {
if (window.location.hash == '' && page == 1) {
page = 0;
PageTransitions.nextPage({
animation: 2,
showPage: page
});
resultList.html('');
}
});
});
function abilityCalculator(month, holdMoney, income, outcome, area) {
var year = parseInt(month / 12);
var lilu = 0.00576;
if (year > 5)
lilu = 0.00594;
var d1 = income - outcome;
var d2 = Math.pow(1 + lilu, month) - 1;
var d3 = lilu * Math.pow(1 + lilu, month);
//房屋总价
var total = Math.round(((d1 * d2) / d3) + holdMoney);
//房屋单价
var avgPrice = total / area;
var result = {
total: total,
avgPrice: avgPrice
};
return result;
}
</script>
</body>
</html>
\ No newline at end of file
......@@ -115,6 +115,10 @@
$("#photoModal").modal("show");
return false;
});
$(".iconList > li").click(function(){
location.href = $(this).attr("data-url");
});
});
</script>
</head>
......@@ -122,9 +126,15 @@
<p class="collect"></p>
<ul class="list-unstyled iconList">
<li></li>
<li></li>
<li></li>
{% if result.publicize %}
<li class="video" data-url="{{result.publicize}}"></li>
{% endif %}
{% if result.threeD %}
<li class="eye" data-url="{{result.threeD}}"></li>
{% endif %}
{% if result.roundLook %}
<li class="panorama" data-url="{{result.roundLook}}"></li>
{% endif %}
</ul>
<!-- 图片滚动 -->
<div class="addWrap">
......
......@@ -26,7 +26,7 @@
{% if item.user_id %}
{% if item.handle==0 %}
<p class="accept">
<button type="button" class="btn btn-lg" data-name="handle" data-id="{{ item.id }}">接受</button>
<button type="button" class="btn" data-name="handle" data-id="{{ item.id }}">接受</button>
</p>
{% endif %}
{% endif %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment