123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@ taglib prefix="s" uri="/struts-tags" %>
- <form id="updateChooseHouseForm" method="post">
- <input type="hidden" name="chooseHouse.id" id="id_update">
- <input type="hidden" name="houseIds" id="houseIds_update">
- <table class="mytable" style="width: 100%;">
- <tr>
- <th>标题</th>
- <td colspan="3">
- <input class="easyui-validatebox" id="title_update" name="chooseHouse.title" style="width: 100%">
- </td>
- </tr>
- <tr>
- <th width="20%">业务时间</th>
- <td width="30%">
- <input class="easyui-datebox" id="businessDate_update" name="chooseHouse.businessDate" required="true" >
- </td>
- <th width="20%">业务人</th>
- <td width="30%">
- <input class="easyui-validatebox" id="businessUserName_update" name="chooseHouse.businessUserName" required="true" >
- </td>
- </tr>
- <tr>
- <th>装修清单<input type="button" value="选择" onclick="selectDecoration()"/></th>
- <td colspan="3">
- <input type="text" id="decorationName_update" style="width: 300px" class="easyui-validatebox" required="true" readonly="readonly"/>
- <input type="hidden" id="decorationId_update" name="chooseHouse.decoration.id">
- </td>
- </tr>
- </table>
- <table class="mytable" style="width: 100%;" >
- <tr>
- <th>
- <a href="javascript:addHouse();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增房源</a>
- </th>
- </tr>
- </table>
- <table id="chooseHouseInfoDataGrid">
- <thead>
- <tr>
- <th data-options="field:'communityName',width:150,formatter:communityNameFormatter">小区名称</th>
- <th data-options="field:'address',width:200,formatter:addressFormatter">居住地点</th>
- <th data-options="field:'houseNumber',width:40,formatter:houseNumberFormatter">房号</th>
- <th data-options="field:'area',width:60,formatter:areaFormatter">面积</th>
- <th data-options="field:'delete',align:'center',width:38,formatter:delChooseHouseInfoFormatter">删除</th>
- </tr>
- </thead>
- </table>
- </form>
- <script type="text/javascript">
- var chooseHouseId = null;
-
- //加载装修房源信息
- var chooseHouseInfo_load = function(id){
- chooseHouseId = id;
- $('#chooseHouseInfoDataGrid').datagrid({
- rownumbers:true,
- fitColumns:false,
- border:false,
- sortOrder:'desc',
- nowrap:true,
- url:whzl.basePath + '/chooseHouseAction_chooseHouseInfoList?chooseHouse.id=' + id,
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- return ;
- }
- }
- });
- }
-
- //添加房源
- var addHouse = function(){
- $('#addHouse').dialog(
- {
- buttons : [
- {
- text : '提交',
- iconCls : 'icon-ok',
- handler : function(){
- var houseIds = house_select_submit();
- if(houseIds != ""){
- houseIds = houseIds +",";
- }
- var rows = $("#chooseHouseInfoDataGrid").datagrid("getRows");
- if(typeof(rows) != "undefined"){
- for(var i=0;i<rows.length;i++){
- if (typeof(rows[i].house) != "undefined") {
- houseIds += rows[i].house.id+",";
- }else{
- houseIds += rows[i].id+",";
- }
- }
- }
- if(houseIds != ""){
- houseIds = houseIds.substring(0,houseIds.length - 1);
- }
- $('#chooseHouseInfoDataGrid').datagrid({
- rownumbers:true,
- fitColumns:false,
- border:false,
- sortOrder:'desc',
- nowrap:true,
- url:whzl.basePath + '/chooseHouseAction_houseList?houseIds='+ houseIds,
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- return ;
- }
- }
- });
- $("#addHouse").dialog("close");
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#addHouse").dialog("close");
- }
- }
- ],
- onLoad : function(){
- var houseIds = "";
- var rows = $("#chooseHouseInfoDataGrid").datagrid("getRows");
- if(typeof(rows) != "undefined"){
- for(var i=0;i<rows.length;i++){
- houseIds += rows[i].id+",";
- }
- if(houseIds != ""){
- houseIds = houseIds.substring(0,houseIds.length - 1);
- }
- }
- house_select_load('&house.decorationState=1&houseIds='+ houseIds);
- }
- }
- );
-
-
- }
-
- /**小区名称*/
- var communityNameFormatter = function(value , row , index){
- if (typeof(row.communityName) != "undefined") {
- return row.communityName;
- }else{
- return row.house.communityName;
- }
- };
-
- /**居住地点*/
- var addressFormatter = function(value , row , index){
- if (typeof(row.address) != "undefined") {
- return row.address;
- }else{
- return row.house.address;
- }
- };
-
- /**房号*/
- var houseNumberFormatter = function(value , row , index){
- if (typeof(row.houseNumber) != "undefined") {
- return row.houseNumber;
- }else{
- return row.house.houseNumber;
- }
- };
-
- /**面积*/
- var areaFormatter = function(value , row , index){
- if (typeof(row.area) != "undefined") {
- return row.area;
- }else{
- return row.house.area;
- }
- };
-
- /**删除*/
- var delChooseHouseInfoFormatter = function(value , row , index){
- var id;
- if (typeof(row.house) != "undefined") {
- id = row.house.id;
- }else{
- id = row.id;
- }
- return "<img src='" + whzl.basePath +"/js/easyui/themes/itemicon/delete.png' title='删除' onclick=deleteChooseHouseInfoRow(" + id + ") style='cursor:pointer' />";
- };
-
-
- var deleteChooseHouseInfoRow = function(id){
- var houseIds = "";
- var rows = $("#chooseHouseInfoDataGrid").datagrid("getRows");
- for(var i=0;i<rows.length;i++){
- if (typeof(rows[i].house) != "undefined") {
- if(rows[i].house.id != id){
- houseIds += rows[i].house.id+",";
- }
- }else{
- if(rows[i].id != id){
- houseIds += rows[i].id+",";
- }
- }
- }
- if(houseIds != ""){
- houseIds = houseIds.substring(0,houseIds.length - 1);
- }
- $('#chooseHouseInfoDataGrid').datagrid({
- rownumbers:true,
- fitColumns:false,
- border:false,
- sortOrder:'desc',
- nowrap:true,
- url:whzl.basePath + '/chooseHouseAction_houseList?houseIds='+ houseIds,
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- return ;
- }
- }
- });
- }
- </script>
|