enterprise.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. $(function () {
  2. $("#jqGrid").jqGrid({
  3. url: baseURL + 'qyh/enterprise/passPage',
  4. datatype: "json",
  5. colModel: [
  6. { label: 'id', name: 'id', index: 'id', width: 50, hidden:true, key: true },
  7. { label: '营业执照号', name: 'licenseNo', index: 'licenseNo', width: 80 },
  8. { label: '企业全称', name: 'enterpriseName', index: 'enterpriseName', width: 80 },
  9. { label: '联系人', name: 'contactPerson', index: 'contactPerson', width: 80 },
  10. { label: '联系电话', name: 'contactPhone', index: 'contactPhone', width: 80 },
  11. { label: '营业执照照片', name: 'licensePhoto', index: 'licensePhoto', width: 80,formatter: imageFormat },
  12. { label: '缴费时间', name: 'payLastTime', index: 'payLastTime', width: 80 },
  13. { label: '状态', name: 'status', index: 'status', width: 80, formatter:function (cellvalue, options, rowdata) {
  14. if(cellvalue == 1) {
  15. return '未缴费'
  16. }else if(cellvalue == 2) {
  17. return '已缴费'
  18. } else {
  19. return '已过期'
  20. }
  21. } },
  22. ],
  23. viewrecords: true,
  24. height: 385,
  25. rowNum: 10,
  26. rowList : [10,30,50],
  27. rownumbers: true,
  28. rownumWidth: 25,
  29. autowidth:true,
  30. multiselect: true,
  31. pager: "#jqGridPager",
  32. jsonReader : {
  33. root: "page.list",
  34. page: "page.currPage",
  35. total: "page.totalPage",
  36. records: "page.totalCount"
  37. },
  38. prmNames : {
  39. page:"page",
  40. rows:"limit",
  41. order: "order"
  42. },
  43. gridComplete:function(){
  44. //隐藏grid底部滚动条
  45. $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
  46. }
  47. });
  48. upload(1,'images','images/*');
  49. initdate()
  50. });
  51. /*日期框初始化*/
  52. function initdate(){
  53. layui.use('laydate', function() {
  54. var laydate = layui.laydate;
  55. laydate.render({
  56. elem: '#payLastTime'
  57. ,theme: '#34B9B4'
  58. ,trigger: 'click'
  59. ,type: 'datetime'
  60. ,format: 'yyyy-MM-dd HH:mm'
  61. ,done: function(value, date, endDate){
  62. vm.wjxyEnterprise.payLastTime = value;
  63. }
  64. });
  65. })
  66. }
  67. var vm = new Vue({
  68. el:'#rrapp',
  69. data:{
  70. showList: true,
  71. title: null,
  72. wjxyEnterprise: {
  73. state: ''
  74. },
  75. queryParam: {
  76. status:'',
  77. enterpriseName:'',
  78. contactPerson:'',
  79. contactPhone: ''
  80. },
  81. gender: [],
  82. state: '',
  83. isSee: false,
  84. },
  85. methods: {
  86. query: function () {
  87. vm.reload(1);
  88. },
  89. reset() {
  90. vm.queryParam.status = ''
  91. vm.queryParam.enterpriseName = ''
  92. vm.queryParam.contactPerson = ''
  93. vm.queryParam.contactPhone = ''
  94. vm.reload(1);
  95. },
  96. // 查看留言
  97. queryMessage() {
  98. },
  99. detail: function (event) {
  100. var id = getSelectedRow();
  101. if(id == null){
  102. return ;
  103. }
  104. vm.showList = false;
  105. vm.title = "企业展示信息";
  106. vm.isSee = true
  107. vm.getInfo(id)
  108. },
  109. getInfo: function(id){
  110. $.get(baseURL + "qyh/enterprise/info/"+id, function(r){
  111. vm.wjxyEnterprise = r.data;
  112. });
  113. },
  114. reload: function (event) {
  115. vm.showList = true;
  116. var page;
  117. if (event == 1){
  118. page = 1;
  119. } else {
  120. page = $("#jqGrid2").jqGrid('getGridParam','page');
  121. }
  122. $("#jqGrid").jqGrid('setGridParam',{
  123. postData:{'status': vm.queryParam.status,'enterpriseName':vm.queryParam.enterpriseName,'contactPerson':vm.queryParam.contactPerson
  124. ,'contactPhone':vm.queryParam.contactPhone},
  125. page:page
  126. }).trigger("reloadGrid");
  127. }
  128. }
  129. });