网站
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.

complaintAdd.js 2.2 KiB

3 年之前
3 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "echarts", 'swiper'], function ($, template, Tools, echarts, swiper) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //服务器地址
  9. serverApi:'',
  10. //焦点图数据
  11. focusList: [],
  12. communicateList: [],
  13. deptId:''
  14. },
  15. };
  16. var tools = new Tools();
  17. module.init = function (page) {
  18. tools.doGet(getTopDeptId, {}, module.getInformation , true);
  19. if (document.body.scrollHeight <= document.body.offsetHeight){
  20. document.getElementById('bottomInformation').style.position = 'fixed';
  21. document.getElementById('bottomInformation').style.bottom = '0';
  22. }
  23. };
  24. module.getInformation = function (data) {
  25. console.log(data)
  26. module.data.deptId = data.data;
  27. }
  28. goAdd = function () {
  29. if($('#title').val()=="" || $('#title').val()==undefined){
  30. tools.initError('标题不能为空!');
  31. } else if($('#content').val()=="" || $('#content').val()==undefined){
  32. tools.initError('内容不能为空!');
  33. } else if($('#phone').val()=="" || $('#phone').val()==undefined){
  34. tools.initError('联系方式不能为空!');
  35. } else{
  36. var form = {
  37. title:$('#title').val(),
  38. communicateType:$('input:radio:checked').val(),
  39. content:$('#content').val(),
  40. name:$('#name').val(),
  41. phone:$('#phone').val(),
  42. }
  43. tools.doPost(communicateAdd, {
  44. title:$('#title').val(),
  45. communicateType:$('input:radio:checked').val(),
  46. content:$('#content').val(),
  47. name:$('#name').val(),
  48. phone:$('#phone').val(),
  49. deptId:module.data.deptId
  50. }, module.addEnd , true);
  51. }
  52. }
  53. module.addEnd = function(data){
  54. tools.initError('发布成功');
  55. setTimeout(function(){
  56. tools.skip('complaintList.html')
  57. },2000)
  58. }
  59. goDetail = function(id){
  60. tools.skip('/agriculturalLawEnforcement/view/complaint/complaintDetail.html?id='+id);
  61. }
  62. return module;
  63. });