网站
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

discussionsDetail_02.js 3.0 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools"], function ($, template, Tools) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //服务器地址
  9. serverApi:'',
  10. //焦点图数据
  11. focusList: [],
  12. communicateList: [],
  13. },
  14. };
  15. var tools = new Tools();
  16. module.init = function (page) {
  17. //新闻详情
  18. tools.doGet(contractionList, {
  19. code:getQueryVariable('id'),
  20. bookId: JSON.parse(tools.getCookie('user')).bookId,
  21. deptId: JSON.parse(tools.getCookie('user')).deptId
  22. }, module.newsDetail , true);
  23. //新闻列表
  24. tools.doGet(contractionList, {
  25. pageNum:1,
  26. pageSize:10,
  27. orderByColumn: 'buildingTime',
  28. isAsc: 'desc',
  29. bookId: JSON.parse(tools.getCookie('user')).bookId,
  30. deptId: JSON.parse(tools.getCookie('user')).deptId
  31. }, module.newsList , true);
  32. tools.doGet(webList, {}, module.webList , true);
  33. };
  34. //获取地址栏参数
  35. function getQueryVariable(variable){
  36. var query = window.location.search.substring(1);
  37. var vars = query.split("&");
  38. for (var i=0;i<vars.length;i++) {
  39. var pair = vars[i].split("=");
  40. if(pair[0] == variable){return pair[1];}
  41. }
  42. return(false);
  43. }
  44. module.webList = function (data) {
  45. if (data.code == 200) {
  46. var content = data.data;
  47. module.data.webList = content;
  48. var webData = template('webData', module.data);
  49. $("#webContent").html(webData);
  50. }
  51. }
  52. module.newsDetail = function (data) {
  53. if (data.code == 200) {
  54. var content = data.rows[0];
  55. $('#name').html(content.name);
  56. $('#code').html('合同编码:' + content.code);
  57. $('#biddingType').html('合同类型:'+content.biddingType);
  58. $('#secondParty').html('合同乙方:'+content.secondParty);
  59. $('#settleType').html('结款方式:'+content.settleType);
  60. $('#totalAmount').html('合同金额:'+content.totalAmount);
  61. $('#settledAmount').html('已结款:'+content.settledAmount);
  62. $('#receivedAmount').html('下次应结:'+content.receivedAmount);
  63. $('#num').html('数量:'+content.num);
  64. $('#unit').html('单位:'+content.unit);
  65. $('#buildingTime').html('签订日期:'+content.buildingTime);
  66. $('#startTime').html('开始日期:'+content.startTime);
  67. $('#endTime').html('结束日期:'+content.endTime);
  68. }
  69. }
  70. module.newsList = function (data) {
  71. if (data.code == 200) {
  72. var content = data.rows;
  73. module.data.newList = content;
  74. var newListData = template('newListData', module.data);
  75. $("#newListContent").html(newListData);
  76. }
  77. }
  78. return module;
  79. });