commonHouseSaleOrderAdd.jsp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib prefix="s" uri="/struts-tags" %>
  3. <script type="text/javascript">
  4. //婚姻状况
  5. var maritalStatusObj_add = null;
  6. var maritalStatus_array_add = null;
  7. //申请保障类型
  8. var applyTypeObj_add = null;
  9. var applyType_array_add = null;
  10. //是否现房
  11. var isExistHouseObj_add = null;
  12. var isExistHouse_array_add = null;
  13. var dealNull = function(value)
  14. {
  15. if(value == null || value == ""){
  16. return 0;
  17. }
  18. else{
  19. return value;
  20. }
  21. }
  22. var countHouseMoney =function(){
  23. var securityNum = dealNull($("#securityNum_add").numberbox('getValue'));
  24. var houseArea = parseFloat(dealNull($("#houseArea_add").numberbox('getValue')));
  25. var garageArea = parseFloat(dealNull($("#garageArea_add").numberbox('getValue')));
  26. var protectArea = parseFloat(dealNull($("#protectArea_add").numberbox('getValue')));
  27. var protectRealArea = protectArea;
  28. if(houseArea < protectArea){
  29. protectRealArea = houseArea;
  30. }
  31. var protectOutArea = 0;
  32. if(houseArea > protectArea){
  33. protectOutArea = houseArea - protectArea;
  34. }
  35. $("#protectOutArea_add").numberbox('setValue', protectOutArea);
  36. var housePrice = dealNull($("#housePrice_add").numberbox('getValue'));
  37. var garagePrice = dealNull($("#garagePrice_add").numberbox('getValue'));
  38. var houseMoney = houseArea * housePrice ;
  39. var garageMoney = garageArea * garagePrice;
  40. $("#houseMoney_add").numberbox('setValue', houseMoney );
  41. $("#garageMoney_add").numberbox('setValue', garageMoney );
  42. var totalMoney = houseMoney + garageMoney;
  43. $("#totalMoney_add").numberbox('setValue', totalMoney );
  44. var govPercent = dealNull($("#govPercent_add").numberbox('getValue'));
  45. var personPercent = 100 - govPercent;
  46. $("#personPercent_add").numberbox('setValue', personPercent );
  47. var govMoney = housePrice*protectRealArea*govPercent/100;
  48. $("#govMoney_add").numberbox('setValue', govMoney );
  49. var personTotalMoney = totalMoney - govMoney;
  50. $("#personTotalMoney_add").numberbox('setValue', personTotalMoney );
  51. var personProtectMoney = housePrice*protectRealArea*personPercent/100 ;
  52. $("#personProtectMoney_add").numberbox('setValue', personProtectMoney );
  53. $("#personOutMoney_add").numberbox('setValue', personTotalMoney - personProtectMoney );
  54. }
  55. function commonHouseSaleOrder_add_load(id){
  56. $('#houseArea_add').numberbox({
  57. onChange: function () {
  58. countHouseMoney();
  59. }
  60. });
  61. $('#garageArea_add').numberbox({
  62. onChange: function () {
  63. countHouseMoney();
  64. }
  65. });
  66. $('#housePrice_add').numberbox({
  67. onChange: function () {
  68. countHouseMoney();
  69. }
  70. });
  71. $('#garagePrice_add').numberbox({
  72. onChange: function () {
  73. countHouseMoney();
  74. }
  75. });
  76. $('#govPercent_add').numberbox({
  77. onChange: function () {
  78. countHouseMoney();
  79. }
  80. });
  81. //保障类别
  82. $.ajax({
  83. type: "post",//使用post方法访问后台
  84. dataType: "json",//返回json格式的数据
  85. url: "aa10Action_listAa10All",//要访问的后台地址
  86. data:{"aa10.letter":"applyType" ,"aa10.name":"保障业务类别" },
  87. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  88. success: function(msg){//msg为返回的数据,在这里做数据绑定
  89. if(msg.success){
  90. applyTypeObj_add = msg.obj.rows;
  91. var select_arr = [];
  92. var data = applyTypeObj_add;
  93. for(var nItem = 0; nItem < data.length; nItem++ ){
  94. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  95. }
  96. applyType_array_add = select_arr.join("");
  97. }
  98. }
  99. });
  100. //婚姻情况
  101. $.ajax({
  102. type: "post",//使用post方法访问后台
  103. dataType: "json",//返回json格式的数据
  104. url: "aa10Action_listAa10All",//要访问的后台地址
  105. data:{"aa10.letter":"maritalStatus" ,"aa10.name":"婚姻情况" },
  106. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  107. success: function(msg){//msg为返回的数据,在这里做数据绑定
  108. if(msg.success){
  109. maritalStatusObj_add = msg.obj.rows;
  110. var select_arr = [];
  111. var data = maritalStatusObj_add;
  112. for(var nItem = 0; nItem < data.length; nItem++ ){
  113. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  114. }
  115. maritalStatus_array_add = select_arr.join("");
  116. }
  117. }
  118. });
  119. //是否现房
  120. $.ajax({
  121. type: "post",//使用post方法访问后台
  122. dataType: "json",//返回json格式的数据
  123. url: "aa10Action_listAa10All",//要访问的后台地址
  124. data:{"aa10.letter":"isExistHouse" ,"aa10.name":"是否现房" },
  125. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  126. success: function(msg){//msg为返回的数据,在这里做数据绑定
  127. if(msg.success){
  128. isExistHouseObj_add = msg.obj.rows;
  129. var select_arr = [];
  130. var data = isExistHouseObj_add;
  131. for(var nItem = 0; nItem < data.length; nItem++ ){
  132. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  133. }
  134. isExistHouse_array_add = select_arr.join("");
  135. $("#isExistHouse_add").append(isExistHouse_array_add);
  136. }
  137. }
  138. });
  139. $.ajax({
  140. type: "post",//使用get方法访问后台
  141. dataType: "json",//返回json格式的数据
  142. url: "securityPersonAction_findById",//要访问的后台地址
  143. data: "securityPerson.id="+id,//要发送的数据
  144. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  145. success: function(msg){//msg为返回的数据,在这里做数据绑定
  146. $("#securityPersonId_add").val(msg.obj.id);
  147. $("#name_add").text(msg.obj.name);
  148. $("#idCard_add").text(msg.obj.idCard);
  149. $("#securityPersonName_add").val(msg.obj.name);
  150. $("#securityPersonIdCard_add").val(msg.obj.idCard);
  151. var personType = "";
  152. for(var nItem = 0; nItem < personTypeObj.length; nItem++ ){
  153. if(personTypeObj[nItem].code == msg.obj.personType){
  154. personType = personTypeObj[nItem].value;
  155. }
  156. }
  157. $("#personType_add").text(personType);
  158. var maritalStatus = "";
  159. for(var nItem = 0; nItem < maritalStatusObj_add.length; nItem++ ){
  160. if(maritalStatusObj_add[nItem].code == msg.obj.maritalStatus){
  161. maritalStatus = maritalStatusObj_add[nItem].value;
  162. }
  163. }
  164. $("#maritalStatus_add").text(maritalStatus);
  165. $("#phone_add").text(msg.obj.phone);
  166. $("#company_add").text(msg.obj.company);
  167. if(msg.obj.houseRegister != undefined){
  168. $("#residence_add").text(msg.obj.houseRegister.parent.parent.name + "-" + msg.obj.houseRegister.parent.name + "-" + msg.obj.houseRegister.name);
  169. }else{
  170. $("#residence_add").text(msg.obj.accountLocation)
  171. }
  172. $("#residenceNo_add").text(msg.obj.residenceNo);
  173. $("#residenceYear_add").text(msg.obj.residenceYear);
  174. $("#securityNum_add_1").text(msg.obj.securityNum);
  175. $("#familyNum_add").text(msg.obj.familyNum);
  176. $("#avgIncome_add").text(msg.obj.avgIncome);
  177. $("#securityNum_add").numberbox('setValue', msg.obj.securityNum);
  178. $("#protectArea_add").numberbox('setValue', msg.obj.securityNum * $("#protectAvgArea_add").numberbox('getValue'));
  179. var applyType = "";
  180. for(var nItem = 0; nItem < applyTypeObj_add.length; nItem++ ){
  181. if(applyTypeObj_add[nItem].code == msg.obj.applyType){
  182. applyType = applyTypeObj_add[nItem].value;
  183. }
  184. }
  185. $("#applyType_add").text(applyType);
  186. }
  187. });
  188. $('#dg_add').datagrid({
  189. rownumbers:true,
  190. border:false,
  191. sortOrder:'desc',
  192. url:whzl.basePath + '/securityPersonAction_listSecurityPersonRelative?securityPersonId='+id,
  193. checkOnSelect:true,
  194. selectOnCheck:false,
  195. loadFilter:function(result){
  196. if(result.success){
  197. return result.obj;
  198. }else{
  199. $.messager.alert("提示",result.message);
  200. return ;
  201. }
  202. }
  203. });
  204. }
  205. function commonHouseSaleOrder_add_submit(){
  206. $('#addCommonHouseSaleOrderForm').form('submit',{
  207. url : whzl.basePath+'/commonHouseSaleOrderAction_addCommonHouseSaleOrder',
  208. onSubmit: function(){
  209. var isValid = $('#addCommonHouseSaleOrderForm').form('validate');
  210. if(isValid == false){
  211. parent.$.messager.progress('close');
  212. }
  213. return isValid;
  214. },
  215. success : function(result){
  216. parent.$.messager.progress('close');
  217. var parseResult = $.parseJSON(result);
  218. if(parseResult.success){
  219. $("#addcommonHouseSaleOrderDialog").dialog("close");
  220. $('#commonHouseSaleOrderDataGrid').datagrid('reload');
  221. }
  222. }
  223. }
  224. );
  225. }
  226. //添加房源
  227. var addHouse = function(){
  228. $('#addHouse').dialog(
  229. {
  230. buttons : [
  231. {
  232. text : '提交',
  233. iconCls : 'icon-ok',
  234. handler : function(){
  235. var houseId = house_select_submit();
  236. $.ajax({
  237. type: "post",//使用post方法访问后台
  238. dataType: "json",//返回json格式的数据
  239. url: "houseAction_findById",//要访问的后台地址
  240. data:{"house.id":houseId },
  241. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  242. success: function(msg){//msg为返回的数据,在这里做数据绑定
  243. if(msg.success){
  244. $("#houseId_add").val(msg.obj.id);
  245. $("#houseAddress_add").val(msg.obj.address);
  246. $("#houseArea_add").numberbox('setValue',dealNull(msg.obj.area));
  247. $("#garageArea_add").numberbox('setValue',dealNull(msg.obj.garageArea));
  248. }
  249. }
  250. });
  251. $("#addHouse").dialog("close");
  252. }
  253. },
  254. {
  255. text : '取消',
  256. iconCls : 'icon-cancel',
  257. handler : function(){
  258. $("#addHouse").dialog("close");
  259. }
  260. }
  261. ],
  262. onLoad : function(){
  263. house_select_load('&house.houseState=1');
  264. }
  265. }
  266. );
  267. }
  268. </script>
  269. <form id="addCommonHouseSaleOrderForm" method="post" enctype="multipart/form-data">
  270. <div class="easyui-tabs" id="tabs_add">
  271. <div title="购房信息" id="gfxx_add">
  272. <table class="mytable" style="width: 100%;" >
  273. <tr>
  274. <th colspan="4" >添加共有产权房房源
  275. <a href="javascript:addHouse();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">选择房源</a>
  276. </th>
  277. </tr>
  278. </table>
  279. <table class="mytable" style="width: 100%;">
  280. <tr>
  281. <th width="20%">房屋地址</th>
  282. <td width="30%">
  283. <input class="easyui-validatebox" readonly="readonly" required="true" type="text" id="houseAddress_add" name="commonHouseSaleOrder.houseAddress">
  284. <input type="hidden" id="securityPersonId_add" name="commonHouseSaleOrder.securityPersonId">
  285. <input type="hidden" id="securityPersonName_add" name="commonHouseSaleOrder.securityPersonName">
  286. <input type="hidden" id="securityPersonIdCard_add" name="commonHouseSaleOrder.securityPersonIdCard">
  287. <input type="hidden" id="houseId_add" name="commonHouseSaleOrder.house.id">
  288. </td>
  289. <th width="20%">是否现房</th>
  290. <td colspan="3">
  291. <select id="isExistHouse_add" name="commonHouseSaleOrder.isExistHouse" required="true" class="easyui-validatebox" >
  292. <option value="">请选择</option>
  293. </select>
  294. </td>
  295. </tr>
  296. <tr>
  297. <th width="20%">人均保障面积(㎡)</th>
  298. <td width="30%">
  299. <input class="easyui-numberbox" value="24" precision="2" required="true" type="text" id="protectAvgArea_add" name="commonHouseSaleOrder.protectAvgArea" >
  300. </td>
  301. <th width="20%">保障人口数量</th>
  302. <td width="30%">
  303. <input class="easyui-numberbox" required="true" readonly="readonly" type="text" id="securityNum_add" name="commonHouseSaleOrder.securityNum" >
  304. </td>
  305. </tr>
  306. <tr>
  307. <th width="20%">住宅面积(㎡)</th>
  308. <td width="30%">
  309. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="houseArea_add" name="commonHouseSaleOrder.houseArea" >
  310. </td>
  311. <th width="20%">车库面积(㎡)</th>
  312. <td width="30%">
  313. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="garageArea_add" name="commonHouseSaleOrder.garageArea" >
  314. </td>
  315. </tr>
  316. <tr>
  317. <th width="20%">保障面积(㎡)</th>
  318. <td width="30%">
  319. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="protectArea_add" name="commonHouseSaleOrder.protectArea" >
  320. </td>
  321. <th width="20%">保障外面积(㎡)</th>
  322. <td width="30%">
  323. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="protectOutArea_add" name="commonHouseSaleOrder.protectOutArea" >
  324. </td>
  325. </tr>
  326. <tr>
  327. <th width="20%">住宅单价(元/㎡)</th>
  328. <td width="30%">
  329. <input class="easyui-numberbox" precision="2" required="true" type="text" id="housePrice_add" name="commonHouseSaleOrder.housePrice" >
  330. </td>
  331. <th width="20%">车库单价(元/㎡)</th>
  332. <td width="30%">
  333. <input class="easyui-numberbox" precision="2" required="true" type="text" id="garagePrice_add" name="commonHouseSaleOrder.garagePrice" >
  334. </td>
  335. </tr>
  336. <tr>
  337. <th width="20%">住宅总价(元)</th>
  338. <td width="30%">
  339. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="houseMoney_add" name="commonHouseSaleOrder.houseMoney" >
  340. </td>
  341. <th width="20%">车库总价(元)</th>
  342. <td width="30%">
  343. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="garageMoney_add" name="commonHouseSaleOrder.garageMoney" >
  344. </td>
  345. </tr>
  346. <tr>
  347. <th width="20%">房屋总价(元)</th>
  348. <td colspan="3">
  349. <input class="easyui-numberbox" precision="2" required="true" type="text" id="totalMoney_add" name="commonHouseSaleOrder.totalMoney" >
  350. </td>
  351. </tr>
  352. <tr>
  353. <th width="20%">保障面积内政府产权比例</th>
  354. <td width="30%">
  355. <input class="easyui-numberbox" style="width:50px" precision="2" required="true" type="text" id="govPercent_add" name="commonHouseSaleOrder.govPercent" >%
  356. </td>
  357. <th width="20%">保障面积内个人产权比例</th>
  358. <td width="30%">
  359. <input class="easyui-numberbox" style="width:50px" precision="2" required="true" type="text" id="personPercent_add" name="commonHouseSaleOrder.personPercent" >%
  360. </td>
  361. </tr>
  362. <tr>
  363. <th width="20%">个人保障面积内金额(元)</th>
  364. <td width="30%">
  365. <input class="easyui-numberbox" precision="2" required="true" type="text" id="personProtectMoney_add" name="commonHouseSaleOrder.personProtectMoney" >
  366. </td>
  367. <th width="20%">个人保障面积外金额(元)</th>
  368. <td width="30%">
  369. <input class="easyui-numberbox" precision="2" required="true" type="text" id="personOutMoney_add" name="commonHouseSaleOrder.personOutMoney" >
  370. </td>
  371. </tr>
  372. <tr>
  373. <th width="20%">政府补贴金额(元)</th>
  374. <td width="30%">
  375. <input class="easyui-numberbox" precision="2" required="true" type="text" id="govMoney_add" name="commonHouseSaleOrder.govMoney" >
  376. </td>
  377. <th width="20%">个人总金额(元)</th>
  378. <td width="30%">
  379. <input class="easyui-numberbox" precision="2" required="true" type="text" id="personTotalMoney_add" name="commonHouseSaleOrder.personTotalMoney" >
  380. </td>
  381. </tr>
  382. </table>
  383. </div>
  384. <div title="购房人信息" id="grxx_add">
  385. <table class="mytable" style="width: 100%;">
  386. <tr>
  387. <th width="20%">申请人姓名</th>
  388. <td width="30%">
  389. <span id="name_add"></span>
  390. </td>
  391. <th width="20%">申请人身份证号</th>
  392. <td width="30%">
  393. <span id="idCard_add"></span>
  394. </td>
  395. </tr>
  396. <tr>
  397. <th>
  398. 人员类型
  399. </th>
  400. <td>
  401. <span id="personType_add"></span>
  402. </td>
  403. <th>
  404. 婚姻状况
  405. </th>
  406. <td>
  407. <span id="maritalStatus_add"></span>
  408. </td>
  409. </tr>
  410. <tr>
  411. <th>联系电话</th>
  412. <td >
  413. <span id="phone_add"></span>
  414. </td>
  415. <th>工作单位</th>
  416. <td >
  417. <span id="company_add"></span>
  418. </td>
  419. </tr>
  420. <tr>
  421. <th>
  422. 户口所在地
  423. </th>
  424. <td colspan = "3" >
  425. <span id="residence_add"></span>
  426. </td>
  427. </tr>
  428. <tr>
  429. <th>
  430. 户号
  431. </th>
  432. <td>
  433. <span id="residenceNo_add"></span>
  434. </td>
  435. <th>
  436. 取得市区户口年限
  437. </th>
  438. <td>
  439. <span id="residenceYear_add"></span>
  440. </td>
  441. </tr>
  442. <tr>
  443. <th>
  444. 家庭总人口数
  445. </th>
  446. <td>
  447. <span id="familyNum_add"></span>
  448. </td>
  449. <th>
  450. 享受低保人数
  451. </th>
  452. <td>
  453. <span id="securityNum_add_1"></span>
  454. </td>
  455. </tr>
  456. <tr>
  457. <th>
  458. 家庭人均收入
  459. </th>
  460. <td>
  461. <span id="avgIncome_add"></span>
  462. </td>
  463. <th>
  464. 保障类别
  465. </th>
  466. <td>
  467. <span id="applyType_add"></span>
  468. </td>
  469. </tr>
  470. </table>
  471. </div>
  472. <div title="同户籍家庭其他成员" id="qtcy_add">
  473. <table id="dg_add" title="同户籍家庭其他成员" >
  474. <thead frozen="true">
  475. <tr>
  476. <th data-options="field:'name',sortable:true,width:80,align:'center',editor:'textbox'">姓名</th>
  477. </tr>
  478. </thead>
  479. <thead>
  480. <tr>
  481. <th data-options="field:'relative',sortable:true,width:70,align:'center',formatter:relativeFormatter">与户主<br/>关系</th>
  482. <th data-options="field:'idCard',sortable:true,width:150,align:'center'">身份证号</th>
  483. <th data-options="field:'maritalStatus',sortable:true,width:70,align:'center',formatter:maritalStatusFormatter">婚姻状况</th>
  484. <th data-options="field:'residenceYear',sortable:true,width:70,align:'center'">获取市区<br/>户口年限</th>
  485. <th data-options="field:'company',sortable:true,width:150,align:'center'">工作单位</th>
  486. <th data-options="field:'income',sortable:true,width:80,align:'center'">年收入</th>
  487. <th data-options="field:'isInRange',sortable:true,width:70,align:'center',formatter:isInRangeFormatter">是否在<br/>保障范围</th>
  488. </tr>
  489. </thead>
  490. </table>
  491. </div>
  492. </div>
  493. </form>