123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@ taglib prefix="s" uri="/struts-tags" %>
- <form id="addChooseHouseForm" method="post">
- <input type="hidden" name="houseIds" id="houseIds_add">
- <table class="mytable" style="width: 100%;">
- <tr>
- <th>标题</th>
- <td colspan="3">
- <input class="easyui-validatebox" id="title_add" name="chooseHouse.title" required="true" style="width: 100%">
- </td>
- </tr>
- <tr>
- <th width="20%">业务时间</th>
- <td width="30%">
- <input class="easyui-datebox" id="businessDate_add" name="chooseHouse.businessDate" required="true" >
- </td>
- <th width="20%">业务人</th>
- <td width="30%">
- <input class="easyui-validatebox" id="businessUserName_add" value="${user.fullName}" name="chooseHouse.businessUserName" required="true" >
- </td>
- </tr>
- <tr>
- <th>装修清单<input type="button" value="选择" onclick="selectDecoration()"/></th>
- <td colspan="3">
- <input type="text" id="decorationName_add" style="width: 300px" class="easyui-validatebox" required="true" readonly="readonly"/>
- <input type="hidden" id="decorationId_add" name="chooseHouse.decoration.id">
- </td>
- </tr>
- </table>
- <table class="mytable" style="width: 100%;" >
- <tr>
- <th>
- <a href="javascript:addHouse1();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增房源</a>
- </th>
- </tr>
- </table>
- <table id="chooseHouseInfoDataGrid1">
- <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:delChooseHouseFormatter">删除</th>
- </tr>
- </thead>
- </table>
- </form>
- <script type="text/javascript">
- //添加房源
- var addHouse1 = function(){
- $('#addHouse').dialog(
- {
- buttons : [
- {
- text : '提交',
- iconCls : 'icon-ok',
- handler : function(){
- var houseIds = house_select_submit();
- if(houseIds != ""){
- houseIds = houseIds +",";
- }
- var rows = $("#chooseHouseInfoDataGrid1").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);
- }
- $('#chooseHouseInfoDataGrid1').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 ;
- }
- }
- });
- $('#addChooseHouseForm').form('submit',
- {
- url : whzl.basePath+'/chooseHouseAction_addHouseChoose',
- success : function(result){
- var parseResult = $.parseJSON(result);
- if(parseResult.success){
- $.messager.alert('提示','接收成功!');
- if( $('#chooseHouseDataGrid') != null){
- $('#chooseHouseDataGrid').datagrid('reload');
- }
- if( $('#taskDataGrid') != null){
- $('#taskDataGrid').datagrid('reload');
- }
- }else{
- $.messager.alert("提示",parseResult.message);
- }
- }
- }
- );
-
- $("#addHouse").dialog("close");
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#addHouse").dialog("close");
- }
- }
- ],
- onLoad : function(){
- var houseIds = "";
- var rows = $("#chooseHouseInfoDataGrid1").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('&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 delChooseHouseFormatter = function(value , row , index){
- return "<img src='" + whzl.basePath +"/js/easyui/themes/itemicon/delete.png' title='删除' onclick=deleteChooseHouseInfo(" + row.id + ") style='cursor:pointer' />";
- };
- var deleteChooseHouseInfo = function(id){
- var houseIds = "";
- var rows = $("#chooseHouseInfoDataGrid1").datagrid("getRows");
- if(typeof(rows) != "undefined"){
- for(var i=0;i<rows.length;i++){
- if(rows[i].id != id){
- houseIds += rows[i].id+",";
- }
- }
- }
- if(houseIds != ""){
- houseIds = houseIds.substring(0,houseIds.length - 1);
- }
- $('#chooseHouseInfoDataGrid1').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 ;
- }
- }
- });
- }
- /*function selectDecoration(){
- $("#decorationList2Dialog").dialog({
- buttons:[{
- text : '确认',
- iconCls : 'icon-ok',
- handler : function(){
- var row = $('#decoration2DataGrid').datagrid('getSelected');
- $("#decorationId_add").val(row.id);
- $("#decorationName_add").val(row.name);
- $("#decorationList2Dialog").dialog("close");
- }
- }]
- })
- }
- var createUserFormatter = function(value, row, index){
- return row.createUser.fullName;
- }
-
- var dateFormatter = function(value, row, index){
- return dealDate(value);
- }*/
- </script>
|