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

89 lines
3.1 KiB

  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. translate_dict: '1',
  21. bookId: JSON.parse(tools.getCookie('user')).bookId,
  22. deptId: JSON.parse(tools.getCookie('user')).deptId
  23. }, module.newsDetail , true);
  24. //新闻列表
  25. tools.doGet(contractionList, {
  26. pageNum:1,
  27. pageSize:10,
  28. orderByColumn: 'buildingTime',
  29. isAsc: 'desc',
  30. translate_dict: '1',
  31. bookId: JSON.parse(tools.getCookie('user')).bookId,
  32. deptId: JSON.parse(tools.getCookie('user')).deptId
  33. }, module.newsList , true);
  34. tools.doGet(webList, {}, module.webList , true);
  35. };
  36. //获取地址栏参数
  37. function getQueryVariable(variable){
  38. var query = window.location.search.substring(1);
  39. var vars = query.split("&");
  40. for (var i=0;i<vars.length;i++) {
  41. var pair = vars[i].split("=");
  42. if(pair[0] == variable){return pair[1];}
  43. }
  44. return(false);
  45. }
  46. module.webList = function (data) {
  47. if (data.code == 200) {
  48. var content = data.data;
  49. module.data.webList = content;
  50. var webData = template('webData', module.data);
  51. $("#webContent").html(webData);
  52. $('#ewm').attr('src', 'static/images/'+content.top.bz);
  53. }
  54. }
  55. module.newsDetail = function (data) {
  56. if (data.code == 200) {
  57. var content = data.rows[0];
  58. $('#name').html(content.name);
  59. $('#code').html('合同编码:' + content.code);
  60. $('#biddingType').html('合同类型:'+content.assetType);
  61. $('#secondParty').html('合同乙方:'+content.secondParty);
  62. $('#settleType').html('结款方式:'+content.settleType);
  63. $('#totalAmount').html('合同金额:'+content.totalAmount + '元');
  64. $('#settledAmount').html('已结款:'+content.settledAmount + '元');
  65. $('#receivedAmount').html('下次应结:'+content.receivedAmount + '元');
  66. $('#num').html('数量:'+content.num);
  67. $('#unit').html('单位:'+content.unit);
  68. $('#buildingTime').html('签订日期:'+content.buildingTime);
  69. $('#startTime').html('开始日期:'+content.startTime);
  70. $('#endTime').html('结束日期:'+content.endTime);
  71. }
  72. }
  73. module.newsList = function (data) {
  74. if (data.code == 200) {
  75. var content = data.rows;
  76. module.data.newList = content;
  77. var newListData = template('newListData', module.data);
  78. $("#newListContent").html(newListData);
  79. }
  80. }
  81. return module;
  82. });