网站
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

homestead.js 6.7 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function ($, template, Tools) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. propertyList:'',
  9. treeselect:[{
  10. value:100,
  11. label:'全部'
  12. }],
  13. treeselectSecond:[{
  14. value:100,
  15. label:'全部'
  16. }],
  17. useType:[{
  18. dictValue:'',
  19. dictLabel:'全部'
  20. }],
  21. },
  22. };
  23. var tools = new Tools();
  24. module.init = function (page) {
  25. //资产列表
  26. tools.doGet(zjdzdxxList, {
  27. deptId: 100,
  28. translate_dict: 1,
  29. houseOwnership:1,
  30. pageNum: 1,
  31. pageSize: 10,
  32. }, module.assetList , true);
  33. tools.doGet(treeselect, {}, module.treeselect , true);
  34. tools.doGet(webList, {}, module.webList , true);
  35. tools.doGet(webDeptType+'land_status', {}, module.webDeptType , true);
  36. };
  37. module.webDeptType = function (data) {
  38. if (data.code == 200) {
  39. var content = data.data;
  40. content.map(res=>{
  41. module.data.useType.push(res)
  42. })
  43. // module.data.useType = content;
  44. var useTypeData = template('useTypeData', module.data);
  45. $("#useTypeContent").html(useTypeData);
  46. }
  47. }
  48. module.webList = function (data) {
  49. if (data.code == 200) {
  50. var content = data.rows;
  51. module.data.webList = content;
  52. var webData = template('webData', module.data);
  53. $("#webContent").html(webData);
  54. var titData = template('titData', module.data);
  55. $("#titContent").html(titData);
  56. }
  57. }
  58. module.assetList = function (data) {
  59. if (data.code == 200) {
  60. var content = data.rows;
  61. if (module.data.propertyList == '') {
  62. var page_s1 = createPage('.page_s1');
  63. //设置分页
  64. setPage(page_s1, {
  65. pageTotal: data.total, // 数据总条数
  66. pageSize: 10, // 每页显示条数
  67. pageCurrent: 1, // 当前页
  68. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  69. })
  70. }
  71. module.data.propertyList = content;
  72. // $('#page_s1').html('共' + 10 + '页')
  73. var propertyData = template('propertyData', module.data);
  74. $("#propertyContent").html(propertyData);
  75. }
  76. }
  77. openDialog = function(id){
  78. tools.doGet(zjdzdxxGet+id, {translate_dict: 1}, module.assetDetail , true);
  79. }
  80. closeDialog = function(id){
  81. $('#dialog').css('display','none');
  82. }
  83. module.assetDetail = function(data){
  84. if (data.code == 200) {
  85. var content = data.data;
  86. module.data.propertyDetail = content;
  87. tools.doGet(attachmentList, {
  88. tableId:content.id,
  89. tableName: 't_homestead_zjdzdxx',
  90. bizPath: 'home'
  91. }, module.attachmentDetail , true);
  92. // var propertyDetailData = template('propertyDetailData', module.data);
  93. // $("#propertyDetailContent").html(propertyDetailData);
  94. // $('#dialog').css('display','block');
  95. }
  96. }
  97. module.attachmentDetail = function(data){
  98. if (data.code == 200) {
  99. var content = data.rows;
  100. var attachmentList = [];
  101. content.map(res=>{
  102. if (res.fileName.indexOf('png')>-1||res.fileName.indexOf('jpg')>-1){
  103. attachmentList.push(res);
  104. }
  105. })
  106. module.data.attachment = attachmentList;
  107. var propertyDetailData = template('propertyDetailData', module.data);
  108. $("#propertyDetailContent").html(propertyDetailData);
  109. $('#dialog').css('display','block');
  110. }
  111. }
  112. module.treeselect = function(data){
  113. if (data.code == 200) {
  114. var content = data.data[0].children;
  115. content.map(res=>{
  116. module.data.treeselect.push(res)
  117. })
  118. // module.data.treeselect = content[0].children;
  119. var treeselectData = template('treeselectData', module.data);
  120. $("#treeselectContent").html(treeselectData);
  121. var treeselectSecondData = template('treeselectSecondData', module.data);
  122. $("#treeselectSecondContent").html(treeselectSecondData);
  123. }
  124. }
  125. selectChange = function(){
  126. // tools.doGet(treeselectSecond+$('#treeselectContent').val(), {}, module.selectSecondChange , true);
  127. if ($('#treeselectContent').val() == 100){
  128. module.data.treeselectSecond = [{
  129. value:100,
  130. label:'全部'
  131. }]
  132. }else{
  133. module.data.treeselectSecond = module.data.treeselect.filter(function (e) { return e.value == $('#treeselectContent').val(); })[0].children;
  134. }
  135. var treeselectSecondData = template('treeselectSecondData', module.data);
  136. $("#treeselectSecondContent").html(treeselectSecondData);
  137. selectSecondChange();
  138. }
  139. selectSecondChange = function(){
  140. $('.page_s1').html('');
  141. module.data.propertyList = "";
  142. tools.doGet(zjdzdxxList, {
  143. deptId: $('#treeselectSecondContent').val(),
  144. translate_dict: 1,
  145. houseOwnership:1,
  146. pageNum: 1,
  147. pageSize: 10,
  148. }, module.assetList , true);
  149. //资产列表
  150. // tools.doGet(assetList, {
  151. // deptId: $('#treeselectSecondContent').val(),
  152. // useType: $('#useTypeContent').val() == null ? 1 : $('#useTypeContent').val(),
  153. // operationType: 1,
  154. // translate_dict: 1,
  155. // pageNum: 1,
  156. // pageSize: 10,
  157. // orderByColumn: 'code',
  158. // isAsc: 'asc',
  159. // }, module.assetList , true);
  160. }
  161. useTypeChange = function () {
  162. $('.page_s1').html('');
  163. module.data.propertyList = "";
  164. tools.doGet(zjdzdxxList, {
  165. deptId: $('#treeselectSecondContent').val() == null ? 100 : $('#treeselectSecondContent').val(),
  166. translate_dict: 1,
  167. houseOwnership:1,
  168. landStatus:$('#useTypeContent').val(),
  169. pageNum: 1,
  170. pageSize: 10,
  171. }, module.assetList , true);
  172. // $('#useTypeContent').val(),
  173. }
  174. turnThePage = function (pageNum) {
  175. tools.doGet(zjdzdxxList, {
  176. deptId: 187,
  177. translate_dict: 1,
  178. pageNum: pageNum,
  179. pageSize: 10,
  180. }, module.assetList , true);
  181. }
  182. return module;
  183. });