123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041 |
- <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
- <jsp:include page="../../common/include.jsp" />
- <% String basePath = request.getScheme()+ "://" + request.getServerName() + ":" +request.getServerPort() + request.getContextPath(); %>
- <script type="text/javascript">
- //区
- var areaObj = null;
-
- var area_array = null;
-
- //户型
- var roomTypeObj = null;
-
- var roomType_array = null;
-
- //保障性住房类型
- var typeObj = null;
-
- var type_array = null;
-
- //装修状态
- var decorationStateObj = null;
-
- var decorationState_array = null;
-
- //房源状态
- var houseStateObj = null;
-
- var houseState_array = null;
-
- //是否现房
- var isExistHouseObj = null;
-
- var isExistHouse_array = null;
- var brandobj = null;
-
- //户型
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "aa10Action_listAa10All",//要访问的后台地址
- data:{"aa10.letter":"roomType" ,"aa10.name":"户型" },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- roomTypeObj = msg.obj.rows;
- var select_arr = [];
- var data = roomTypeObj;
- for(var nItem = 0; nItem < data.length; nItem++ ){
- select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
- }
- roomType_array = select_arr.join("");
- $("#roomType").append(roomType_array);
- }
- }
- });
-
- //保障性住房类型
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "aa10Action_listAa10All",//要访问的后台地址
- data:{"aa10.letter":"indemnificatoryType" ,"aa10.name":"保障性住房类型" },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- typeObj = msg.obj.rows;
- var select_arr = [];
- var data = typeObj;
- for(var nItem = 0; nItem < data.length; nItem++ ){
- select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
- }
- type_array = select_arr.join("");
- $("#type").append(type_array);
- }
- }
- });
-
- //装修状态
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "aa10Action_listAa10All",//要访问的后台地址
- data:{"aa10.letter":"decorationState" ,"aa10.name":"装修状态" },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- decorationStateObj = msg.obj.rows;
- var select_arr = [];
- var data = decorationStateObj;
- for(var nItem = 0; nItem < data.length; nItem++ ){
- select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
- }
- decorationState_array = select_arr.join("");
- $("#decorationState").append(decorationState_array);
- }
- }
- });
-
- //房源状态
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "aa10Action_listAa10All",//要访问的后台地址
- data:{"aa10.letter":"houseState" ,"aa10.name":"房屋状态"},
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- houseStateObj = msg.obj.rows;
- var select_arr = [];
- var data = houseStateObj;
- for(var nItem = 0; nItem < data.length; nItem++ ){
- select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
- }
- houseState_array = select_arr.join("");
- }
- }
- });
-
- //是否现房
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "aa10Action_listAa10All",//要访问的后台地址
- data:{"aa10.letter":"isExistHouse" ,"aa10.name":"是否现房"},
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- isExistHouseObj = msg.obj.rows;
- var select_arr = [];
- var data = isExistHouseObj;
- for(var nItem = 0; nItem < data.length; nItem++ ){
- select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
- }
- isExistHouse_array = select_arr.join("");
- }
- }
- });
-
- //获取区
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "houseRegisterAction_listChildren",//要访问的后台地址
- //data:{"id":id},
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- areaObj = msg.obj.rows;
- var select_arr = [];
- var data = areaObj;
- for(var nItem = 0; nItem < data.length; nItem++ ){
- select_arr.push("<option value="+data[nItem].id+">"+data[nItem].name+"</option>");
- }
- area_array = select_arr.join("");
- }
- }
- });
-
-
- /**小区显示区*/
- $(function() {
- $('#houseDataGrid').datagrid({
- rownumbers:true,
- fit:true,
- pageSize:20,
- pageList : [ 10, 20, 30, 40, 50 ],
- fitColumns:false,
- border:false,
- sortOrder:'desc',
- pagination:true,
- idField:'id',
- url:whzl.basePath + '/houseAction_listHouse',
- toolbar:'#searchtool',
- checkOnSelect:true,
- selectOnCheck:true,
- singleSelect:true,
- loadFilter:function(result){
- if(result.success){
- console.log(result.obj)
- return result.obj;
- }else{
- $.messager.alert("提示",result.message);
- return ;
- }
- }
- });
- });
-
- /**查询*/
- function searchFun(){
- var params = encodeURI("house.community.id="+trim($('#communityId').combobox("getValue"))+
- "&house.no="+trim($('#no').combobox("getValue"))+
- "&house.houseNumber="+trim($('#houseNumber').combobox("getValue"))+
- "&house.roomType="+trim($('#roomType').val())+
- "&house.deliveryDate="+$('#deliveryDate').datebox('getValue')+
- "&house.houseState="+$('#houseState').val()
- );
- $('#houseDataGrid').datagrid({url:whzl.basePath + '/houseAction_listHouse?'+params,pageNumber:1});
- }
-
- /*清除查询条件**/
- function ClearQuery() {
- $('#communityId').combobox("setValue","");
- $('#no').combobox("setValue","");
- $('#houseNumber').combobox("setValue","");
- $("#tblQuery").find("input").val("");
- $("#tblQuery").find("select").val("-1");
- }
-
- /**详细*/
- var detailsFormatter = function(value , row , index){
- return "<img src='<%=basePath%>/js/easyui/themes/itemicon/detail.png' title='查看详情' onclick=houseDetails(" + row.id + ") style='cursor:pointer' />";
- };
-
- /**详细页面对话框*/
- var houseDetails = function(id){
- $("#detailHouseDialog").dialog(
- {
- buttons : [
- {
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- $("#detailHouseDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- house_detail_load(id);
- }
- }
- );
- };
-
- /**更新*/
- var updateFormatter = function(value , row , index){
- return "<img src='<%=basePath%>/images/pencil.png' title='修改' onclick=updateRow(" + row.id + ",'update') style='cursor:pointer' />";
- };
-
- /**更新事件*/
- function updateRow(id,param){
- var selectedItems = $('#houseDataGrid').datagrid('getSelections');
- if(selectedItems.length==1){
- var id=selectedItems[0].id;
-
- //var updateIndex = $('#houseDataGrid').datagrid('getRowIndex', id);
- $('#updateHouseDialog').dialog(
- {
- buttons : [
- {
- text : '提交',
- iconCls : 'icon-ok',
- handler : function(){
- if($("#communityId_update").combobox("getValue") == ''){
- $.messager.alert("提示","请选择小区信息!");
- }else{
- if($("#communityId_update").combobox("getValue")==$("#communityId_update").combobox("getText")){
- $.messager.alert("提示","小区不存在!请先维护小区信息!");
- }else{
- $("#communityName_update").val($("#communityId_update").combobox("getText"));
- $('#updateHouseForm').form('submit',
- {
- url : whzl.basePath+'/houseAction_updateHouse',
- success : function(result){
- var parseResult = $.parseJSON(result);
- if(parseResult.success){
- $('#houseDataGrid').datagrid('reload');
- $("#updateHouseDialog").dialog("close");
- }else{
- $.messager.alert("提示",parseResult.message);
- }
- }
- }
- );
- }
- }
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#updateHouseDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- if(param == 'add'){
- $('#tabs_update').tabs('select', $('#tabs_update').tabs('getTabIndex', $('#tabs_update').tabs('getSelected')) + 1);
- }
- $("#type_update").append(type_array);
- $("#roomType_update").append(roomType_array);
- $("#isExistHouse_update").append(isExistHouse_array);
- $("#decorationState_update").append(decorationState_array);
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "houseAction_findById",//要访问的后台地址
- data: "house.id="+id,//要发送的数据
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- $("#id_update").val(msg.obj.id);
- $("#qx_update").combobox("setValue",msg.obj.community.area);
- $("#communityId_update").combobox("setValue",msg.obj.community.id);
- $("#communityId_update").combobox("setText",msg.obj.communityName);
- $("#communityName_update").val(msg.obj.communityName);
- $("#area_update").val(msg.obj.area);
- $("#no_update").val(msg.obj.no);
- $("#unit_update").val(msg.obj.unit);
- $("#houseNumber_update").val(msg.obj.houseNumber);
- $("#guaranteeYear_update").numberbox('setValue', msg.obj.guaranteeYear);
- $("#deliveryDate_update").datebox("setValue", msg.obj.deliveryDate);
- $("#roomType_update").val(msg.obj.roomType);
- $("#type_update").val(msg.obj.type);
- $("#garageArea_update").val(msg.obj.garageArea);
- $("#developerDeadline_update").datebox('setValue', msg.obj.developerDeadline);
- //备注
- $("#remark_update").val(msg.obj.remark);
- $("#isExistHouse_update").val(msg.obj.isExistHouse);
-
- $("#waterCardNum_update").val(msg.obj.waterCardNum);
- $("#waterBase_update").val(msg.obj.waterBase);
- $("#electricCardNum_update").val(msg.obj.electricCardNum);
- $("#electricBase_update").val(msg.obj.electricBase);
- $("#gasCardNum_update").val(msg.obj.gasCardNum);
- $("#gasBase_update").val(msg.obj.gasBase);
- $("#initialPlacementTime_update").datebox('setValue', msg.obj.initialPlacementTime);
- $("#status_update").val(msg.obj.status);
- $("#houseState_update").val(msg.obj.houseState);
- $("#marketRent_update").val(msg.obj.marketRent);
- $("#price_update").val(msg.obj.price);
- $("#priceTotal_update").val(msg.obj.priceTotal);
- $("#housePrice_update").val(msg.obj.housePrice);
- $("#garagePrice_update").val(msg.obj.garagePrice);
- $("#certificateNumber1_update").val(msg.obj.certificateNumber1);
- $("#certificateNumber2_update").val(msg.obj.certificateNumber2);
- $("#decorationState_update").val(msg.obj.decorationState);
- for(var i=0;i< msg.obj.deliveryFile.length;i++){
- var $file = $("<div style='display: inline-block;'><a style='padding-right:10px;' href=<%=basePath %>/"+msg.obj.deliveryFile[i].filePath+" download="+msg.obj.deliveryFile[i].fileName+">"+msg.obj.deliveryFile[i].fileName+"</a><img src='images/de.png' id='img" + msg.obj.deliveryFile[i].id + "' onclick='removeImg(" + msg.obj.deliveryFile[i].id + ")' width='15' height='15' style='position: relative;right: 2px; cursor:pointer;'><div>");
- $("#deliveryFile_update_file").append ($file);
- }
-
- for(var i=0;i< msg.obj.recordFile.length;i++){
- var $file = $("<div style='display: inline-block;'><a style='padding-right:10px;' href=<%=basePath %>/"+msg.obj.recordFile[i].filePath+" download="+msg.obj.recordFile[i].fileName+">"+msg.obj.recordFile[i].fileName+"</a><img src='images/de.png' id='img" + msg.obj.recordFile[i].id + "' onclick='removeImg(" + msg.obj.recordFile[i].id + ")' width='15' height='15' style='position: relative;right: 2px; cursor:pointer;'><div>");
- $("#recordFile_update_file").append ($file);
- }
-
- for(var i=0;i< msg.obj.purchaseFile.length;i++){
- var $file = $("<div style='display: inline-block;'><a style='padding-right:10px;' href=<%=basePath %>/"+msg.obj.purchaseFile[i].filePath+" download="+msg.obj.purchaseFile[i].fileName+">"+msg.obj.purchaseFile[i].fileName+"</a><img src='images/de.png' id='img" + msg.obj.purchaseFile[i].id + "' onclick='removeImg(" + msg.obj.purchaseFile[i].id + ")' width='15' height='15' style='position: relative;right: 2px; cursor:pointer;'><div>");
- $("#purchaseFile_update_file").append ($file);
- }
-
- $("#deliveryFile_update").change(
- function(){
- $('#updateHouseForm').form('submit',{
- url : whzl.basePath+'/houseAction_addUploadFile',
- success: function(result){
- $("#deliveryFile_update").attr("value","");
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "houseAction_findById",//要访问的后台地址
- data: "house.id="+id,//要发送的数据
- success: function(msg){
- $("#deliveryFile_update_file").children('div').remove();
- for(var i=0;i< msg.obj.deliveryFile.length;i++){
- var $file = $("<div style='display: inline-block;'><a style='padding-right:10px;' href=<%=basePath %>/"+msg.obj.deliveryFile[i].filePath+" download="+msg.obj.deliveryFile[i].fileName+">"+msg.obj.deliveryFile[i].fileName+"</a><img src='images/de.png' id='img" + msg.obj.deliveryFile[i].id + "' onclick='removeImg(" + msg.obj.deliveryFile[i].id + ")' width='15' height='15' style='position: relative;right: 2px; cursor:pointer;'><div>");
- $("#deliveryFile_update_file").append ($file);
- }
- }
- });
- }
- }
- );
- });
-
- $("#recordFile_update").change(
- function(){
- $('#updateHouseForm').form('submit',{
- url : whzl.basePath+'/houseAction_addUploadFile',
- success: function(result){
- $("#recordFile_update").attr("value","");
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "houseAction_findById",//要访问的后台地址
- data: "house.id="+id,//要发送的数据
- success: function(msg){
- $("#recordFile_update_file").children('div').remove();
- for(var i=0;i< msg.obj.recordFile.length;i++){
- var $file = $("<div style='display: inline-block;'><a style='padding-right:10px;' href=<%=basePath %>/"+msg.obj.recordFile[i].filePath+" download="+msg.obj.recordFile[i].fileName+">"+msg.obj.recordFile[i].fileName+"</a><img src='images/de.png' id='img" + msg.obj.recordFile[i].id + "' onclick='removeImg(" + msg.obj.recordFile[i].id + ")' width='15' height='15' style='position: relative;right: 2px; cursor:pointer;'><div>");
- $("#recordFile_update_file").append ($file);
- }
- }
- });
- }
- }
- );
- });
-
- $("#purchaseFile_update").change(
- function(){
- $('#updateHouseForm').form('submit',{
- url : whzl.basePath+'/houseAction_addUploadFile',
- success: function(result){
- $("#recordFile_update").attr("value","");
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "houseAction_findById",//要访问的后台地址
- data: "house.id="+id,//要发送的数据
- success: function(msg){
- $("#purchaseFile_update_file").children('div').remove();
- for(var i=0;i< msg.obj.purchaseFile.length;i++){
- var $file = $("<div style='display: inline-block;'><a style='padding-right:10px;' href=<%=basePath %>/"+msg.obj.purchaseFile[i].filePath+" download="+msg.obj.purchaseFile[i].fileName+">"+msg.obj.purchaseFile[i].fileName+"</a><img src='images/de.png' id='img" + msg.obj.purchaseFile[i].id + "' onclick='removeImg(" + msg.obj.purchaseFile[i].id + ")' width='15' height='15' style='position: relative;right: 2px; cursor:pointer;'><div>");
- $("#purchaseFile_update_file").append ($file);
- }
- }
- });
- }
- }
- );
- });
- }
- });
- }
- }
- );
- }else{
- $.messager.alert('提示','请选择一条房源信息');
- }
- }
-
- /**删除*/
- var delFormatter = function(value , row , index){
- if(row.houseState == 1 && row.decorationState == 1){
- return "<img src='<%=basePath%>/images/edit_remove.png' title='删除' onclick=deleteRow(" + row.id + ") style='cursor:pointer' />";
- }
- };
-
- /**删除功能*/
- function deleteRow(id){
- var selectedItems = $('#houseDataGrid').datagrid('getSelections');
- if(selectedItems.length==1){
- var id=selectedItems[0].id;
- var houseState=selectedItems[0].houseState
- var decorationState=selectedItems[0].decorationState
- if(houseState == 1 && decorationState == 1){
- $.messager.confirm('删除提示', '确定删除这条记录吗?', function(r){
- if (r){
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "houseAction_deleteHouse",//要访问的后台地址
- data: "house.id="+id,//要发送的数据
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $.messager.alert('提示','删除成功!');
- //$('#houseDataGrid').datagrid('reload');
- searchFun();
- }else{
- $.messager.alert('提示','删除失败!');
- }
- }
- });
- }
- });
- }else{
- $.messager.alert('提示','当前房源不可删除');
- }
- }else{
- $.messager.alert('提示','请选择一条房源信息');
- }
- }
-
- /**增加小区*/
- function houseAdd(){
- $('#addHouseDialog').dialog(
- {
- buttons : [
- {
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- if($("#communityId_add").combobox("getValue") == ''){
- $.messager.alert("提示","请选择小区信息!");
- }else{
- if($("#communityId_add").combobox("getValue")==$("#communityId_add").combobox("getText")){
- $.messager.alert("提示","小区不存在!请先维护小区信息!");
- }else{
- $("#communityName_add").val($("#communityId_add").combobox("getText"));
- parent.$.messager.progress({
- title : '提示',
- text : '保存中,请稍后....'
- });
-
- $('#addHouseForm').form('submit',
- {
- url : whzl.basePath+'/houseAction_addHouse',
- onSubmit: function(){
- var isValid =$('#addHouseForm').form('validate');
- if(isValid == false){
- parent.$.messager.progress('close');
- }
- return isValid;
- },
- success : function(result){
- parent.$.messager.progress('close');
- var parseResult = $.parseJSON(result);
- if(parseResult.success){
- $("#addHouseDialog").dialog("close");
- searchFun();
- var id = parseResult.obj.id;
- //updateRow(id,'add');
- }else{
- $.messager.alert("提示",parseResult.message);
- }
- }
- }
- );
- }
- }
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#addHouseDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- $("#roomType_add").append(roomType_array);
- $("#type_add").append(type_array);
- $("#isExistHouse_add").append(isExistHouse_array);
- }
- }
- );
- }
-
- /**增加小区*/
- function houseImport(){
- $('#importHouseDialog').dialog(
- {
- buttons : [
- {
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- $("#importHouseDialog").dialog("close");
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#importHouseDialog").dialog("close");
- }
- }
- ]
- }
- );
- }
-
- /**上传文件*/
- function formSubmit(){
- var upload = $("#upload").val();
- if(upload == null || upload == ''){
- $.messager.alert("系统提示","请选择文件上传!","error");
- }else{
- parent.$.messager.progress({
- title : '提示',
- text : '上传数据中,请稍候....'
- });
- $('#importHouseForm').form('submit',
- {
- url : whzl.basePath+"/houseAction_uploadExcel",//要访问的后台地址
- success : function(result){
- parent.$.messager.progress('close');
- result = $.parseJSON(result);
- if(result.success){
- $("#message").text(result.message);
- $("#errorShowList").hide();
- $("#exportBtn").hide();
- }else{
- $("#message").text(result.message + "一共存在" + result.obj.length + "错误。");
- $("#errorShowList").show();
- $("#exportBtn").show();
-
- var error = "";//全部错误信息
- var errorShow = "";//只显示前6条错误信息
- for(var i = 0; i < result.obj.length; i++){
- error += (i+1) + "、" + result.obj[i] + "\r\n";
- if(i < 6){
- errorShow += "<p>" + (i+1) + "、" + result.obj[i] + "</p>";
- }
- }
- $("#errorShowList").html(errorShow);
- $("#errorList").html(error);
- $("#errorText").val(error);
- parent.$.messager.progress('close');
- }
- }
- }
- );
- }
- }
-
- function exportErrorMsg(){
- //var error = $("#errorList").html();
- //window.location.href = whzl.basePath+"/houseAction_exportTXT.do?error=" + error;
- $('#errorForm').form('submit',
- {
- url : whzl.basePath+"/houseAction_exportTXT"//要访问的后台地址
- }
- );
- }
-
- /**查询小区*/
- function communityQuery(){
- $('#communityDialog').dialog(
- {
- buttons : [
- {
- text : '提交',
- iconCls : 'icon-ok',
- handler : function(){
- var checkedItems = $('#communityDataGrid').datagrid('getChecked');
- if(checkedItems.length==0){
- $.messager.alert("提示","至少选择一条 的数据");
- }else{
- $.each(checkedItems, function(index, item){
- $("#add_communityName").val(item.name);
- });
- $("#communityDialog").dialog("close");
- }
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#communityDialog").dialog("close");
- }
- }
- ]
- }
- );
- }
-
- function houseExport(){
- var params = encodeURI("house.communityName="+trim($('#communityId').combobox("getText"))+
- "&house.community.id="+trim($('#communityId').combobox("getValue"))+
- "&house.no="+trim($('#no').combobox("getValue")) +
- "&house.houseNumber="+trim($('#houseNumber').combobox("getValue"))+
- "&house.roomType="+trim($('#roomType').val())+
- "&house.deliveryDate="+$('#deliveryDate').datebox('getValue')
-
- );
- window.location.href = whzl.basePath+"/houseAction_export?"+params;
- }
-
- /**汇总导出*/
- function houseSummaryExport(){
- window.location.href = whzl.basePath+"/houseAction_houseSummaryExport";
- }
-
- //删除图片
- var removeImg = function(id){
- $.messager.confirm('提示', '确定删除么?删除后将无法恢复', function(r){
- if (r){
- $("#img" + id).parent().remove();
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url:whzl.basePath + "/uploadFileAction_deleteUploadFile",
- data:{
- "uploadFile.id":id
- },
- error: function(msg){//msg为返回的数据,在这里做数据绑定
- $.messager.alert("提示","删除失败!");
- }
- });
- }
- });
- }
-
- /**户型*/
- var roomTypeFormatter = function(value , row , index){
- var roomType = "";
- for(var nItem = 0; nItem < roomTypeObj.length; nItem++ ){
- if(roomTypeObj[nItem].code == value){
- roomType = roomTypeObj[nItem].value;
- break;
- }
- }
- return roomType;
- };
-
- /**装修状态*/
- var decorationStateFormatter = function(value , row , index){
- var decorationState = "";
- for(var nItem = 0; nItem < decorationStateObj.length; nItem++ ){
- if(decorationStateObj[nItem].code == value){
- decorationState = decorationStateObj[nItem].value;
- break;
- }
- }
- return decorationState;
- };
-
- /**房源状态*/
- var houseStateFormatter = function(value , row , index){
- var houseState = "";
- for(var nItem = 0; nItem < houseStateObj.length; nItem++ ){
- if(houseStateObj[nItem].code == value){
- houseState = houseStateObj[nItem].value;
- break;
- }
- }
- return houseState;
- };
-
- function onSelect(date){
- $("#developerDeadline_add").datebox('setValue', date.getFullYear() + 2 + "-" +(date.getMonth()+1)+"-"+date.getDate());
- }
-
- function onSelectUpdate(date){
- $("#developerDeadline_update").datebox('setValue', date.getFullYear() + 2 + "-" +(date.getMonth()+1)+"-"+date.getDate());
- }
-
- /**批量上传*/
- function uploadFile(){
- var selectedItems = $('#houseDataGrid').datagrid('getSelections');
- var ids = [];
- $.each(selectedItems,function(index,item){
- ids.push(item.id);
- })
- if(ids.length==0){
- $.messager.alert("警告","请选择至少一条记录!");
- return;
- }
- var idsStr = ids.join(",");
- $('#uploadHouseDialog').dialog(
- {
- buttons : [
- {
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- $("#uploadHouseDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- $("#house_upload").val(idsStr);
- $("#deliveryFile_upload").change(
- function(){
- var obj = document.getElementById('deliveryFile_upload');
- if(imageFormat(obj)){
- $('#uploadHouseForm').form('submit',{
- url : whzl.basePath+'/houseAction_uploadFiles',
- success: function(result){
- $("#deliveryFile_upload").attr("value","");
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "houseAction_findById",//要访问的后台地址
- data: "house.id="+ids[0],//要发送的数据
- success: function(msg){
- $("#deliveryFile_upload_file").children('div').remove();
- for(var i=0;i< msg.obj.deliveryFile.length;i++){
- var $file = $("<div style='display: inline-block;'><a style='padding-right:10px;' href=<%=basePath %>/"+msg.obj.deliveryFile[i].filePath+" download="+msg.obj.deliveryFile[i].fileName+">"+msg.obj.deliveryFile[i].fileName+"</a><div>");
- $("#deliveryFile_upload_file").append ($file);
- }
- }
- });
- }
- });
- };
- });
-
- $("#recordFile_upload").change(
- function(){
- var obj = document.getElementById('recordFile_upload');
- if(imageFormat(obj)){
- $('#uploadHouseForm').form('submit',{
- url : whzl.basePath+'/houseAction_uploadFiles',
- success: function(result){
- $("#recordFile_upload").attr("value","");
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "houseAction_findById",//要访问的后台地址
- data: "house.id="+ids[0],//要发送的数据
- success: function(msg){
- $("#recordFile_upload_file").children('div').remove();
- for(var i=0;i< msg.obj.recordFile.length;i++){
- var $file = $("<div style='display: inline-block;'><a style='padding-right:10px;' href=<%=basePath %>/"+msg.obj.recordFile[i].filePath+" download="+msg.obj.recordFile[i].fileName+">"+msg.obj.recordFile[i].fileName+"</a><div>");
- $("#recordFile_upload_file").append ($file);
- }
- }
- });
- }
- });
- }
- });
-
- $("#purchaseFile_upload").change(
- function(){
- var obj = document.getElementById('purchaseFile_upload');
- if(imageFormat(obj)){
- $('#uploadHouseForm').form('submit',{
- url : whzl.basePath+'/houseAction_uploadFiles',
- success: function(result){
- $("#recordFile_upload").attr("value","");
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "houseAction_findById",//要访问的后台地址
- data: "house.id="+ids[0],//要发送的数据
- success: function(msg){
- $("#purchaseFile_upload_file").children('div').remove();
- for(var i=0;i< msg.obj.purchaseFile.length;i++){
- var $file = $("<div style='display: inline-block;'><a style='padding-right:10px;' href=<%=basePath %>/"+msg.obj.purchaseFile[i].filePath+" download="+msg.obj.purchaseFile[i].fileName+">"+msg.obj.purchaseFile[i].fileName+"</a><div>");
- $("#purchaseFile_upload_file").append ($file);
- }
- }
- });
- }
- });
- }
- });
- }
- }
- );
- }
-
-
- function imageFormat(obj){
- var files = obj.files;
- for(var i=0;i<files.length;i++){
- /**判断图片格式*/
- if(!/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(files[i].name)){
- $.messager.alert('提示','图片类型必须是.gif,jpeg,jpg,png中的一种');
- return false;
- }
- /**判断图片大小*/
- if(files[i].size>1000*1024){
- $.messager.alert('提示','单张图片不得大于10M。');
- return false;
- }
- }
- return true;
- }
- var initialPlacementTimeFormatter = function(value , row , index){
- return dealDate(value);
- }
- var checkOutFormatter = function(value , row , index){
- if(row.houseState == "5"){
- return "<img src='<%=basePath%>/images/update.png' title='退房' onclick=checkOutRow(" + row.id+",'"+row.address + "') style='cursor:pointer' />";
- }else{
- return "";
- }
- }
- function checkOutRow(id,address){
- $.messager.prompt('退房', '确定将'+address+'房源退房吗?请填写原因', function(r){
- if (r){
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "houseAction_checkOutHouse",//要访问的后台地址
- data: "house.id="+id+"&house.checkOutRemark="+r,//要发送的数据
- success: function(msg){
- $('#houseDataGrid').datagrid('reload');
- }
- });
- }
- })
- };
- </script>
- <div class="easyui-layout" data-options="fit:true,border:false">
- <div data-options="region:'center',border:false">
- <div id="searchtool" data-options="region:'north',border:false">
- <div class="clear"></div>
- <table id="tblQuery" style="width:100%;font-size:12px;">
- <tr>
- <td align="right" width="100px"><span>小区名称</span></td>
- <td colspan="5" width="500px">
- <select id="area" style="width:100px;">
- <option value="">全部</option>
- </select>
- <input id="communityId">
- <input id="no" style="width: 60px;">幢
- <input id="houseNumber" style="width: 80px;">室
- </td>
- <td align="left">
- <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
- <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
- <a href="javascript:houseImport();" class="easyui-linkbutton" data-options="iconCls:'icon-import',plain:true">导入</a>
- <a href="javascript:houseExport();" class="easyui-linkbutton" data-options="iconCls:'icon-export',plain:true">导出</a>
- <a href="javascript:houseSummaryExport();" class="easyui-linkbutton" data-options="iconCls:'icon-export',plain:true">汇总</a>
-
- </td>
- </tr>
- <tr>
- <td align="right"><span>户型</span></td>
- <td width="100px">
- <select id="roomType">
- <option value="">全部</option>
- </select>
- </td>
- <td align="right" width="50px"><span>交房日期</span></td>
- <td width="100px">
- <input class="easyui-datebox" id="deliveryDate" name="house.deliveryDate">
- </td>
- <td>房源状态</td>
- <td>
- <select id="houseState" name="house.houseState">
- <option value="">全部</option>
- <option value="5">已交付</option>
- <option value="6">未交付</option>
- <option value="11">人才公寓</option>
- </select>
- </td>
- <td>
- <a href="javascript:houseAdd();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">增加</a>
- <a href="javascript:updateRow();" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a>
- <a href="javascript:deleteRow();" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</a>
- <a href="javascript:uploadFile();" class="easyui-linkbutton" data-options="iconCls:'icon-batch',plain:true">批量上传附件</a>
- </td>
- </tr>
- </table>
- <div class="clear"></div>
- </div>
-
- <table id="houseDataGrid">
-
- <thead frozen="true">
- <tr>
- <th data-options="field:'id',checkbox:true,width:30">ID</th>
- <th data-options="field:'communityName',sortable:true,width:100">小区名称</th>
- </tr>
- </thead>
- <thead>
- <tr>
- <th data-options="field:'address',width:200">居住地点</th>
- <th data-options="field:'houseNumber',width:60">房号</th>
- <th data-options="field:'area',width:60">面积</th>
- <th data-options="field:'garageArea',width:60">车库面积</th>
- <th data-options="field:'roomType',width:60,formatter:roomTypeFormatter">户型</th>
- <th data-options="field:'initialPlacementTime',width:80,formatter:initialPlacementTimeFormatter">初始安置时间</th>
- <th data-options="field:'decorationState',width:60,formatter:decorationStateFormatter">装修状态</th>
- <th data-options="field:'houseState',width:80,formatter:houseStateFormatter">房源状态</th>
- <th data-options="field:'details',align:'center',width:60,formatter:detailsFormatter">查看详情</th>
- <!-- <th data-options="field:'update',align:'center',width:38,formatter:updateFormatter">修改</th>
- <th data-options="field:'delete',align:'center',width:38,formatter:delFormatter">删除</th>-->
- <th data-options="field:'checkOut',align:'center',width:38,formatter:checkOutFormatter">退房</th>
- </tr>
- </thead>
-
- </table>
- </div>
- </div>
- <div id="detailHouseDialog" data-options="title:' 户型详细信息',iconCls:'icon-details',width:700,height:400,modal:true,href:'<%=basePath %>/houseAction_toDetail'">
- </div>
- <div id="updateHouseDialog" data-options="title:' 修改户型信息',iconCls:'icon-edit',width:700,height:400,modal:true,href:'<%=basePath %>/houseAction_toUpdate'">
- </div>
- <div id="addHouseDialog" data-options="title:' 增加户型信息',iconCls:'icon-add',width:700,height:400,modal:true,href:'<%=basePath %>/houseAction_toAdd'">
- </div>
- <div id="communityDialog" data-options="title:' 选择户型信息',iconCls:'icon-query',width:700,height:400,modal:true,href:'<%=basePath%>/houseAction_toListQuery.do'">
- </div>
- <div id="importHouseDialog" data-options="title:' 导入户型信息',iconCls:'icon-add',width:700,height:350,modal:true,href:'<%=basePath %>/houseAction_toImport'">
- </div>
- <div id="uploadHouseDialog" data-options="title:' 房源附件批量上传',iconCls:'icon-add',width:700,height:350,modal:true,href:'<%=basePath %>/houseAction_toUpload'">
- </div>
- <div id="detailDialog"></div>
- <div id="setHouseDialog" data-options="title:' 个性化设置',iconCls:'icon-cog',width:500,height:370,modal:true,href:'<%=basePath %>/columnSetAction_toSet?tname=house'">
- </div>
- <script type="text/javascript">
- <!--
- $(function(){
- parent.$.messager.progress('close');
- $('#area').combobox({
- url: whzl.basePath + '/houseRegisterAction_listChildrenCombobox',
- valueField:'value',
- textField:'text',
- onChange:function (newValue,oldValue) {
- $('#communityId').combobox("setValue","");
- $('#no').combobox("setValue","");
- $('#houseNumber').combobox("setValue","");
- $('#communityId').combobox('reload',whzl.basePath + '/communityAction_findAll?community.area='+newValue);
- }
- });
- $('#communityId').combobox({
- url: whzl.basePath + '/communityAction_findAll',
- valueField:'value',
- textField:'text',
- filter:function(q,row){
- var opts=$(this).combobox("options");
- //return row[opts.textField].indexOf(q)==0;//
- return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
- },
- onChange:function (newValue,oldValue) {
- $('#no').combobox("setValue","");
- $('#houseNumber').combobox("setValue","");
- $('#no').combobox('reload',whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"));
- }
- });
- $('#no').combobox({
- //editable:false,
- url: whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"),
- valueField:'value',
- textField:'text',
- filter:function(q,row){
- var opts=$(this).combobox("options");
- //return row[opts.textField].indexOf(q)==0;//
- return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
- },
- onChange:function (newValue,oldValue) {
- $('#houseNumber').combobox("setValue","");
- $('#houseNumber').combobox('reload',whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+newValue);
- }
- });
- $('#houseNumber').combobox({
- //editable:false,
- url: whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+$('#no').combobox("getValue"),
- valueField:'value',
- textField:'text',
- filter:function(q,row){
- var opts=$(this).combobox("options");
- //return row[opts.textField].indexOf(q)==0;//
- return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
- }
- });
- });
- //-->
- </script>
|