commonHouseSaleOrderUpdate.jsp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  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 commonHouseSaleOrder_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: "commonHouseSaleOrderAction_findById",//要访问的后台地址
  144. data: "commonHouseSaleOrder.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. $("#commonHouseSaleOrderId_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 commonHouseSaleOrder_update_submit(){
  228. $('#updateCommonHouseSaleOrderForm').form('submit',{
  229. url : whzl.basePath+'/commonHouseSaleOrderAction_updateCommonHouseSaleOrder',
  230. success : function(result){
  231. var parseResult = $.parseJSON(result);
  232. if(parseResult.success){
  233. $("#updatecommonHouseSaleOrderDialog").dialog("close");
  234. $('#commonHouseSaleOrderDataGrid').datagrid('reload');
  235. }
  236. }
  237. }
  238. );
  239. }
  240. </script>
  241. <form id="updateCommonHouseSaleOrderForm" 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" readonly="readonly" required="true" type="text" id="houseAddress_update" name="commonHouseSaleOrder.houseAddress">
  249. <input type="hidden" id="commonHouseSaleOrderId_update" name="commonHouseSaleOrder.cid">
  250. <input type="hidden" id="securityPersonId_update" name="commonHouseSaleOrder.securityPerson.id">
  251. </td>
  252. <th width="20%">是否现房</th>
  253. <td colspan="3">
  254. <select id="isExistHouse_update" name="commonHouseSaleOrder.isExistHouse" required="true" class="easyui-validatebox" >
  255. <option value="">请选择</option>
  256. </select>
  257. </td>
  258. </tr>
  259. <tr>
  260. <th width="20%">人均保障面积(m2)</th>
  261. <td width="30%">
  262. <input class="easyui-numberbox" value="24" precision="2" required="true" type="text" id="protectAvgArea_update" name="commonHouseSaleOrder.protectAvgArea" >
  263. </td>
  264. <th width="20%">保障人口数量</th>
  265. <td width="30%">
  266. <input class="easyui-numberbox" required="true" readonly="readonly" type="text" id="securityNum_update" name="commonHouseSaleOrder.securityNum" >
  267. </td>
  268. </tr>
  269. <tr>
  270. <th width="20%">住宅面积</th>
  271. <td width="30%">
  272. <input class="easyui-numberbox" readonly="readonly" precision="2" required="true" type="text" id="houseArea_update" name="commonHouseSaleOrder.houseArea" >
  273. </td>
  274. <th width="20%">车库面积</th>
  275. <td width="30%">
  276. <input class="easyui-numberbox" readonly="readonly" precision="2" required="true" type="text" id="garageArea_update" name="commonHouseSaleOrder.garageArea" >
  277. </td>
  278. </tr>
  279. <tr>
  280. <th width="20%">保障面积</th>
  281. <td width="30%">
  282. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="protectArea_update" name="commonHouseSaleOrder.protectArea" >
  283. </td>
  284. <th width="20%">保障外面积</th>
  285. <td width="30%">
  286. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="protectOutArea_update" name="commonHouseSaleOrder.protectOutArea" >
  287. </td>
  288. </tr>
  289. <tr>
  290. <th width="20%">住宅单价</th>
  291. <td width="30%">
  292. <input class="easyui-numberbox" precision="2" required="true" type="text" id="housePrice_update" name="commonHouseSaleOrder.housePrice" >
  293. </td>
  294. <th width="20%">车库单价</th>
  295. <td width="30%">
  296. <input class="easyui-numberbox" precision="2" required="true" type="text" id="garagePrice_update" name="commonHouseSaleOrder.garagePrice" >
  297. </td>
  298. </tr>
  299. <tr>
  300. <th width="20%">住宅总价</th>
  301. <td width="30%">
  302. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="houseMoney_update" name="commonHouseSaleOrder.houseMoney" >
  303. </td>
  304. <th width="20%">车库总价</th>
  305. <td width="30%">
  306. <input class="easyui-numberbox" precision="2" readonly="readonly" required="true" type="text" id="garageMoney_update" name="commonHouseSaleOrder.garageMoney" >
  307. </td>
  308. </tr>
  309. <tr>
  310. <th width="20%">房屋总价</th>
  311. <td colspan="3">
  312. <input class="easyui-numberbox" precision="2" required="true" type="text" id="totalMoney_update" name="commonHouseSaleOrder.totalMoney" >
  313. </td>
  314. </tr>
  315. <tr>
  316. <th width="20%">保障面积内政府产权比例</th>
  317. <td width="30%">
  318. <input class="easyui-numberbox" style="width:50px" precision="2" required="true" type="text" id="govPercent_update" name="commonHouseSaleOrder.govPercent" >%
  319. </td>
  320. <th width="20%">保障面积内个人产权比例</th>
  321. <td width="30%">
  322. <input class="easyui-numberbox" style="width:50px" precision="2" required="true" type="text" id="personPercent_update" name="commonHouseSaleOrder.personPercent" >%
  323. </td>
  324. </tr>
  325. <tr>
  326. <th width="20%">个人保障面积内金额</th>
  327. <td width="30%">
  328. <input class="easyui-numberbox" precision="2" required="true" type="text" id="personProtectMoney_update" name="commonHouseSaleOrder.personProtectMoney" >
  329. </td>
  330. <th width="20%">个人保障面积外金额</th>
  331. <td width="30%">
  332. <input class="easyui-numberbox" precision="2" required="true" type="text" id="personOutMoney_update" name="commonHouseSaleOrder.personOutMoney" >
  333. </td>
  334. </tr>
  335. <tr>
  336. <th width="20%">政府补贴金额</th>
  337. <td width="30%">
  338. <input class="easyui-numberbox" precision="2" required="true" type="text" id="govMoney_update" name="commonHouseSaleOrder.govMoney" >
  339. </td>
  340. <th width="20%">个人总金额</th>
  341. <td width="30%">
  342. <input class="easyui-numberbox" precision="2" required="true" type="text" id="personTotalMoney_update" name="commonHouseSaleOrder.personTotalMoney" >
  343. </td>
  344. </tr>
  345. </table>
  346. </div>
  347. <div title="购房人信息" id="grxx_update">
  348. <table class="mytable" style="width: 100%;">
  349. <tr>
  350. <th width="20%">申请人姓名</th>
  351. <td width="30%">
  352. <span id="name_update"></span>
  353. </td>
  354. <th width="20%">申请人身份证号</th>
  355. <td width="30%">
  356. <span id="idCard_update"></span>
  357. </td>
  358. </tr>
  359. <tr>
  360. <th>
  361. 人员类型
  362. </th>
  363. <td>
  364. <span id="personType_update"></span>
  365. </td>
  366. <th>
  367. 婚姻状况
  368. </th>
  369. <td>
  370. <span id="maritalStatus_update"></span>
  371. </td>
  372. </tr>
  373. <tr>
  374. <th>联系电话</th>
  375. <td >
  376. <span id="phone_update"></span>
  377. </td>
  378. <th>工作单位</th>
  379. <td >
  380. <span id="company_update"></span>
  381. </td>
  382. </tr>
  383. <tr>
  384. <th>
  385. 户口所在地
  386. </th>
  387. <td colspan = "3" >
  388. <span id="residence_update"></span>
  389. </td>
  390. </tr>
  391. <tr>
  392. <th>
  393. 户号
  394. </th>
  395. <td>
  396. <span id="residenceNo_update"></span>
  397. </td>
  398. <th>
  399. 取得市区户口年限
  400. </th>
  401. <td>
  402. <span id="residenceYear_update"></span>
  403. </td>
  404. </tr>
  405. <tr>
  406. <th>
  407. 家庭总人口数
  408. </th>
  409. <td>
  410. <span id="familyNum_update"></span>
  411. </td>
  412. <th>
  413. 享受低保人数
  414. </th>
  415. <td>
  416. <span id="securityNum_update_1"></span>
  417. </td>
  418. </tr>
  419. <tr>
  420. <th>
  421. 家庭人均收入
  422. </th>
  423. <td>
  424. <span id="avgIncome_update"></span>
  425. </td>
  426. <th>
  427. 保障类别
  428. </th>
  429. <td>
  430. <span id="applyType_update"></span>
  431. </td>
  432. </tr>
  433. </table>
  434. </div>
  435. <div title="同户籍家庭其他成员" id="qtcy_update">
  436. <table id="dg_update" title="同户籍家庭其他成员" >
  437. <thead frozen="true">
  438. <tr>
  439. <th data-options="field:'name',sortable:true,width:80,align:'center',editor:'textbox'">姓名</th>
  440. </tr>
  441. </thead>
  442. <thead>
  443. <tr>
  444. <th data-options="field:'relative',sortable:true,width:70,align:'center',formatter:relativeFormatter">与户主<br/>关系</th>
  445. <th data-options="field:'idCard',sortable:true,width:150,align:'center'">身份证号</th>
  446. <th data-options="field:'maritalStatus',sortable:true,width:70,align:'center',formatter:maritalStatusFormatter">婚姻状况</th>
  447. <th data-options="field:'residenceYear',sortable:true,width:70,align:'center'">获取市区<br/>户口年限</th>
  448. <th data-options="field:'company',sortable:true,width:150,align:'center'">工作单位</th>
  449. <th data-options="field:'income',sortable:true,width:80,align:'center'">年收入</th>
  450. <th data-options="field:'isInRange',sortable:true,width:70,align:'center',formatter:isInRangeFormatter">是否在<br/>保障范围</th>
  451. </tr>
  452. </thead>
  453. </table>
  454. </div>
  455. </div>
  456. </form>