commonHouseHelpOrderUpdate.jsp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  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_update = null;
  6. var maritalStatus_array_update = null;
  7. //申请保障类型
  8. var applyTypeObj_update = null;
  9. var applyType_array_update = null;
  10. //是否现房
  11. var isExistHouseObj_update = null;
  12. var isExistHouse_array_update = null;
  13. var securityPersonId = null;
  14. var dealNull = function(value)
  15. {
  16. if(value == ""){
  17. return 0;
  18. }
  19. else{
  20. return value;
  21. }
  22. }
  23. var countHouseMoney =function(){
  24. var securityNum = dealNull($("#securityNum_update").numberbox('getValue'));
  25. var houseArea = dealNull($("#houseArea_update").numberbox('getValue'));
  26. var garageArea = dealNull($("#garageArea_update").numberbox('getValue'));
  27. var protectArea = dealNull($("#protectArea_update").numberbox('getValue'));
  28. var protectRealArea = protectArea;
  29. if(houseArea < protectArea){
  30. protectRealArea = houseArea;
  31. }
  32. var protectOutArea = 0;
  33. if(houseArea > protectArea){
  34. protectOutArea = houseArea - protectArea;
  35. }
  36. $("#protectOutArea_update").numberbox('setValue', protectOutArea);
  37. var housePrice = dealNull($("#housePrice_update").numberbox('getValue'));
  38. var garagePrice = dealNull($("#garagePrice_update").numberbox('getValue'));
  39. var houseMoney = houseArea * housePrice ;
  40. var garageMoney = garageArea * garagePrice;
  41. $("#houseMoney_update").numberbox('setValue', houseMoney );
  42. $("#garageMoney_update").numberbox('setValue', garageMoney );
  43. var totalMoney = houseMoney + garageMoney;
  44. $("#totalMoney_update").numberbox('setValue', totalMoney );
  45. var govPercent = dealNull($("#govPercent_update").numberbox('getValue'));
  46. var personPercent = 100 - govPercent;
  47. $("#personPercent_update").numberbox('setValue', personPercent );
  48. var govMoney = housePrice*protectRealArea*govPercent/100;
  49. $("#govMoney_update").numberbox('setValue', govMoney );
  50. var personTotalMoney = totalMoney - govMoney;
  51. $("#personTotalMoney_update").numberbox('setValue', personTotalMoney );
  52. var personProtectMoney = housePrice*protectRealArea*personPercent/100 ;
  53. $("#personProtectMoney_update").numberbox('setValue', personProtectMoney );
  54. $("#personOutMoney_update").numberbox('setValue', personTotalMoney - personProtectMoney );
  55. }
  56. function commonHouseHelpOrder_update_load(id){
  57. $('#houseArea_update').numberbox({
  58. onChange: function () {
  59. countHouseMoney();
  60. }
  61. });
  62. $('#garageArea_update').numberbox({
  63. onChange: function () {
  64. countHouseMoney();
  65. }
  66. });
  67. $('#housePrice_update').numberbox({
  68. onChange: function () {
  69. countHouseMoney();
  70. }
  71. });
  72. $('#garagePrice_update').numberbox({
  73. onChange: function () {
  74. countHouseMoney();
  75. }
  76. });
  77. $('#govPercent_update').numberbox({
  78. onChange: function () {
  79. countHouseMoney();
  80. }
  81. });
  82. //保障类别
  83. $.ajax({
  84. type: "post",//使用post方法访问后台
  85. dataType: "json",//返回json格式的数据
  86. url: "aa10Action_listAa10All",//要访问的后台地址
  87. data:{"aa10.letter":"applyType" ,"aa10.name":"保障业务类别" },
  88. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  89. success: function(msg){//msg为返回的数据,在这里做数据绑定
  90. if(msg.success){
  91. applyTypeObj_update = msg.obj.rows;
  92. var select_arr = [];
  93. var data = applyTypeObj_update;
  94. for(var nItem = 0; nItem < data.length; nItem++ ){
  95. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  96. }
  97. applyType_array_update = select_arr.join("");
  98. }
  99. }
  100. });
  101. //婚姻情况
  102. $.ajax({
  103. type: "post",//使用post方法访问后台
  104. dataType: "json",//返回json格式的数据
  105. url: "aa10Action_listAa10All",//要访问的后台地址
  106. data:{"aa10.letter":"maritalStatus" ,"aa10.name":"婚姻情况" },
  107. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  108. success: function(msg){//msg为返回的数据,在这里做数据绑定
  109. if(msg.success){
  110. maritalStatusObj_update = msg.obj.rows;
  111. var select_arr = [];
  112. var data = maritalStatusObj_update;
  113. for(var nItem = 0; nItem < data.length; nItem++ ){
  114. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  115. }
  116. maritalStatus_array_update = select_arr.join("");
  117. }
  118. }
  119. });
  120. //是否现房
  121. $.ajax({
  122. type: "post",//使用post方法访问后台
  123. dataType: "json",//返回json格式的数据
  124. url: "aa10Action_listAa10All",//要访问的后台地址
  125. data:{"aa10.letter":"isExistHouse" ,"aa10.name":"是否现房" },
  126. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  127. success: function(msg){//msg为返回的数据,在这里做数据绑定
  128. if(msg.success){
  129. isExistHouseObj_update = msg.obj.rows;
  130. var select_arr = [];
  131. var data = isExistHouseObj_update;
  132. for(var nItem = 0; nItem < data.length; nItem++ ){
  133. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  134. }
  135. isExistHouse_array_update = select_arr.join("");
  136. $("#isExistHouse_update").append(isExistHouse_array_update);
  137. }
  138. }
  139. });
  140. $.ajax({
  141. type: "post",//使用get方法访问后台
  142. dataType: "json",//返回json格式的数据
  143. url: "commonHouseHelpOrderAction_findById",//要访问的后台地址
  144. data: "commonHouseHelpOrder.cid="+id,//要发送的数据
  145. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  146. success: function(msg){//msg为返回的数据,在这里做数据绑定
  147. //个人信息
  148. securityPersonId = msg.obj.securityPersonId;
  149. $("#name_update").text(msg.obj.securityPersonName);
  150. $("#idCard_update").text(msg.obj.securityPersonIdCard);
  151. var personType = "";
  152. for(var nItem = 0; nItem < personTypeObj.length; nItem++ ){
  153. if(personTypeObj[nItem].code == msg.obj.securityPerson.personType){
  154. personType = personTypeObj[nItem].value;
  155. }
  156. }
  157. $("#personType_update").text(personType);
  158. var maritalStatus = "";
  159. for(var nItem = 0; nItem < maritalStatusObj_update.length; nItem++ ){
  160. if(maritalStatusObj_update[nItem].code == msg.obj.securityPerson.maritalStatus){
  161. maritalStatus = maritalStatusObj_update[nItem].value;
  162. }
  163. }
  164. $("#maritalStatus_update").text(maritalStatus);
  165. $("#phone_update").text(msg.obj.securityPerson.phone);
  166. $("#company_update").text(msg.obj.company);
  167. //$("#residence_update").text(msg.obj.securityPerson.houseRegister.parent.parent.name + "-" + msg.obj.securityPerson.houseRegister.parent.name + "-" + msg.obj.securityPerson.houseRegister.name);
  168. if(msg.obj.securityPerson.houseRegister != undefined){
  169. $("#residence_update").text(msg.obj.securityPerson.houseRegister.parent.parent.name + "-" + msg.obj.securityPerson.houseRegister.parent.name + "-" + msg.obj.securityPerson.houseRegister.name);
  170. }else{
  171. $("#residence_update").text(msg.obj.securityPerson.accountLocation)
  172. }
  173. $("#residenceNo_update").text(msg.obj.securityPerson.residenceNo);
  174. $("#residenceYear_update").text(msg.obj.securityPerson.residenceYear);
  175. $("#securityNum_update_1").text(msg.obj.securityPerson.securityNum);
  176. $("#familyNum_update").text(msg.obj.securityPerson.familyNum);
  177. $("#avgIncome_update").text(msg.obj.securityPerson.avgIncome);
  178. var applyType = "";
  179. for(var nItem = 0; nItem < applyTypeObj_update.length; nItem++ ){
  180. if(applyTypeObj_update[nItem].code == msg.obj.securityPerson.applyType){
  181. applyType = applyTypeObj_update[nItem].value;
  182. }
  183. }
  184. $("#applyType_update").text(applyType);
  185. //购房信息
  186. $("#commonHouseHelpOrderId_update").val(msg.obj.cid);
  187. $("#securityPersonId_update").val(msg.obj.securityPerson.id);
  188. $("#securityNum_update").numberbox('setValue', msg.obj.securityNum);
  189. $("#protectArea_update").numberbox('setValue', msg.obj.protectArea );
  190. $("#houseAddress_update").val(msg.obj.houseAddress);
  191. $("#developer_update").val(msg.obj.developer);
  192. $("#isExistHouse_update").val(msg.obj.isExistHouse);
  193. $("#protectAvgArea_update").numberbox('setValue',msg.obj.protectAvgArea);
  194. $("#houseArea_update").numberbox('setValue',msg.obj.houseArea);
  195. $("#garageArea_update").numberbox('setValue',msg.obj.garageArea);
  196. $("#protectOutArea_update").numberbox('setValue',msg.obj.protectOutArea);
  197. $("#housePrice_update").numberbox('setValue',msg.obj.housePrice);
  198. $("#garagePrice_update").numberbox('setValue',msg.obj.garagePrice);
  199. $("#houseMoney_update").numberbox('setValue',msg.obj.houseMoney);
  200. $("#garageMoney_update").numberbox('setValue',msg.obj.garageMoney);
  201. $("#totalMoney_update").numberbox('setValue',msg.obj.totalMoney);
  202. $("#govPercent_update").numberbox('setValue',msg.obj.govPercent);
  203. $("#personPercent_update").numberbox('setValue',msg.obj.personPercent);
  204. $("#govMoney_update").text(msg.obj.govMoney);
  205. $("#personTotalMoney_update").text(msg.obj.personTotalMoney);
  206. $("#personProtectMoney_update").text(msg.obj.personProtectMoney);
  207. $("#personOutMoney_update").text(msg.obj.personOutMoney);
  208. $('#dg_update').datagrid({
  209. rownumbers:true,
  210. border:false,
  211. sortOrder:'desc',
  212. url:whzl.basePath + '/securityPersonAction_listSecurityPersonRelative?securityPersonId='+securityPersonId,
  213. checkOnSelect:true,
  214. selectOnCheck:false,
  215. loadFilter:function(result){
  216. if(result.success){
  217. return result.obj;
  218. }else{
  219. $.messager.alert("提示",result.message);
  220. return ;
  221. }
  222. }
  223. });
  224. }
  225. });
  226. }
  227. function commonHouseHelpOrder_update_submit(){
  228. $('#updateCommonHouseHelpOrderForm').form('submit',{
  229. url : whzl.basePath+'/commonHouseHelpOrderAction_updateCommonHouseHelpOrder',
  230. success : function(result){
  231. var parseResult = $.parseJSON(result);
  232. if(parseResult.success){
  233. $("#updatecommonHouseHelpOrderDialog").dialog("close");
  234. $('#commonHouseHelpOrderDataGrid').datagrid('reload');
  235. }
  236. }
  237. }
  238. );
  239. }
  240. </script>
  241. <form id="updateCommonHouseHelpOrderForm" method="post" enctype="multipart/form-data">
  242. <div class="easyui-tabs" id="tabs_update">
  243. <div title="购房信息" id="gfxx_update">
  244. <table class="mytable" style="width: 100%;">
  245. <tr>
  246. <th width="20%">房屋地址</th>
  247. <td width="30%">
  248. <input class="easyui-validatebox" required="true" type="text" id="houseAddress_update" name="commonHouseHelpOrder.houseAddress">
  249. <input type="hidden" id="commonHouseHelpOrderId_update" name="commonHouseHelpOrder.cid">
  250. <input type="hidden" id="securityPersonId_update" name="commonHouseHelpOrder.securityPerson.id">
  251. </td>
  252. <th width="20%">开发商</th>
  253. <td width="30%">
  254. <input class="easyui-validatebox" required="true" type="text" id="developer_update" name="commonHouseHelpOrder.developer">
  255. </td>
  256. </tr>
  257. <tr>
  258. <th width="20%">是否现房</th>
  259. <td colspan="3">
  260. <select id="isExistHouse_update" name="commonHouseHelpOrder.isExistHouse" required="true" class="easyui-validatebox" >
  261. <option value="">请选择</option>
  262. </select>
  263. </td>
  264. </tr>
  265. <tr>
  266. <th width="20%">人均保障面积(m2)</th>
  267. <td width="30%">
  268. <input class="easyui-numberbox" value="24" precision="2" required="true" type="text" id="protectAvgArea_update" name="commonHouseHelpOrder.protectAvgArea" >
  269. </td>
  270. <th width="20%">保障人口数量</th>
  271. <td width="30%">
  272. <input class="easyui-numberbox" required="true" readonly="readonly" type="text" id="securityNum_update" name="commonHouseHelpOrder.securityNum" >
  273. </td>
  274. </tr>
  275. <tr>
  276. <th width="20%">住宅面积</th>
  277. <td width="30%">
  278. <input class="easyui-numberbox" precision="2" required="true" type="text" id="houseArea_update" name="commonHouseHelpOrder.houseArea" >
  279. </td>
  280. <th width="20%">车库面积</th>
  281. <td width="30%">
  282. <input class="easyui-numberbox" precision="2" required="true" type="text" id="garageArea_update" name="commonHouseHelpOrder.garageArea" >
  283. </td>
  284. </tr>
  285. <tr>
  286. <th width="20%">保障面积</th>
  287. <td width="30%">
  288. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="protectArea_update" name="commonHouseHelpOrder.protectArea" >
  289. </td>
  290. <th width="20%">保障外面积</th>
  291. <td width="30%">
  292. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="protectOutArea_update" name="commonHouseHelpOrder.protectOutArea" >
  293. </td>
  294. </tr>
  295. <tr>
  296. <th width="20%">住宅单价</th>
  297. <td width="30%">
  298. <input class="easyui-numberbox" precision="2" required="true" type="text" id="housePrice_update" name="commonHouseHelpOrder.housePrice" >
  299. </td>
  300. <th width="20%">车库单价</th>
  301. <td width="30%">
  302. <input class="easyui-numberbox" precision="2" required="true" type="text" id="garagePrice_update" name="commonHouseHelpOrder.garagePrice" >
  303. </td>
  304. </tr>
  305. <tr>
  306. <th width="20%">住宅总价</th>
  307. <td width="30%">
  308. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="houseMoney_update" name="commonHouseHelpOrder.houseMoney" >
  309. </td>
  310. <th width="20%">车库总价</th>
  311. <td width="30%">
  312. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="garageMoney_update" name="commonHouseHelpOrder.garageMoney" >
  313. </td>
  314. </tr>
  315. <tr>
  316. <th width="20%">房屋总价</th>
  317. <td colspan="3">
  318. <input class="easyui-numberbox" precision="2" required="true" type="text" id="totalMoney_update" name="commonHouseHelpOrder.totalMoney" >
  319. </td>
  320. </tr>
  321. <tr>
  322. <th width="20%">保障面积内政府产权比例</th>
  323. <td width="30%">
  324. <input class="easyui-numberbox" style="width:50px" precision="2" required="true" type="text" id="govPercent_update" name="commonHouseHelpOrder.govPercent" >%
  325. </td>
  326. <th width="20%">保障面积内个人产权比例</th>
  327. <td width="30%">
  328. <input class="easyui-numberbox" style="width:50px" precision="2" required="true" type="text" id="personPercent_update" name="commonHouseHelpOrder.personPercent" >%
  329. </td>
  330. </tr>
  331. <tr>
  332. <th width="20%">个人保障面积内金额</th>
  333. <td width="30%">
  334. <input class="easyui-numberbox" precision="2" required="true" type="text" id="personProtectMoney_update" name="commonHouseHelpOrder.personProtectMoney" >
  335. </td>
  336. <th width="20%">个人保障面积外金额</th>
  337. <td width="30%">
  338. <input class="easyui-numberbox" precision="2" required="true" type="text" id="personOutMoney_update" name="commonHouseHelpOrder.personOutMoney" >
  339. </td>
  340. </tr>
  341. <tr>
  342. <th width="20%">政府补贴金额</th>
  343. <td width="30%">
  344. <input class="easyui-numberbox" precision="2" required="true" type="text" id="govMoney_update" name="commonHouseHelpOrder.govMoney" >
  345. </td>
  346. <th width="20%">个人总金额</th>
  347. <td width="30%">
  348. <input class="easyui-numberbox" precision="2" required="true" type="text" id="personTotalMoney_update" name="commonHouseHelpOrder.personTotalMoney" >
  349. </td>
  350. </tr>
  351. </table>
  352. </div>
  353. <div title="购房人信息" id="grxx_update">
  354. <table class="mytable" style="width: 100%;">
  355. <tr>
  356. <th width="20%">申请人姓名</th>
  357. <td width="30%">
  358. <span id="name_update"></span>
  359. </td>
  360. <th width="20%">申请人身份证号</th>
  361. <td width="30%">
  362. <span id="idCard_update"></span>
  363. </td>
  364. </tr>
  365. <tr>
  366. <th>
  367. 人员类型
  368. </th>
  369. <td>
  370. <span id="personType_update"></span>
  371. </td>
  372. <th>
  373. 婚姻状况
  374. </th>
  375. <td>
  376. <span id="maritalStatus_update"></span>
  377. </td>
  378. </tr>
  379. <tr>
  380. <th>联系电话</th>
  381. <td >
  382. <span id="phone_update"></span>
  383. </td>
  384. <th>工作单位</th>
  385. <td >
  386. <span id="company_update"></span>
  387. </td>
  388. </tr>
  389. <tr>
  390. <th>
  391. 户口所在地
  392. </th>
  393. <td colspan = "3" >
  394. <span id="residence_update"></span>
  395. </td>
  396. </tr>
  397. <tr>
  398. <th>
  399. 户号
  400. </th>
  401. <td>
  402. <span id="residenceNo_update"></span>
  403. </td>
  404. <th>
  405. 取得市区户口年限
  406. </th>
  407. <td>
  408. <span id="residenceYear_update"></span>
  409. </td>
  410. </tr>
  411. <tr>
  412. <th>
  413. 家庭总人口数
  414. </th>
  415. <td>
  416. <span id="familyNum_update"></span>
  417. </td>
  418. <th>
  419. 享受低保人数
  420. </th>
  421. <td>
  422. <span id="securityNum_update_1"></span>
  423. </td>
  424. </tr>
  425. <tr>
  426. <th>
  427. 家庭人均收入
  428. </th>
  429. <td>
  430. <span id="avgIncome_update"></span>
  431. </td>
  432. <th>
  433. 保障类别
  434. </th>
  435. <td>
  436. <span id="applyType_update"></span>
  437. </td>
  438. </tr>
  439. </table>
  440. </div>
  441. <div title="同户籍家庭其他成员" id="qtcy_update">
  442. <table id="dg_update" title="同户籍家庭其他成员" >
  443. <thead frozen="true">
  444. <tr>
  445. <th data-options="field:'name',sortable:true,width:80,align:'center',editor:'textbox'">姓名</th>
  446. </tr>
  447. </thead>
  448. <thead>
  449. <tr>
  450. <th data-options="field:'relative',sortable:true,width:70,align:'center',formatter:relativeFormatter">与户主<br/>关系</th>
  451. <th data-options="field:'idCard',sortable:true,width:150,align:'center'">身份证号</th>
  452. <th data-options="field:'maritalStatus',sortable:true,width:70,align:'center',formatter:maritalStatusFormatter">婚姻状况</th>
  453. <th data-options="field:'residenceYear',sortable:true,width:70,align:'center'">获取市区<br/>户口年限</th>
  454. <th data-options="field:'company',sortable:true,width:150,align:'center'">工作单位</th>
  455. <th data-options="field:'income',sortable:true,width:80,align:'center'">年收入</th>
  456. <th data-options="field:'isInRange',sortable:true,width:70,align:'center',formatter:isInRangeFormatter">是否在<br/>保障范围</th>
  457. </tr>
  458. </thead>
  459. </table>
  460. </div>
  461. </div>
  462. </form>