|
- /**
- * Created by Administrator on 2021/4/5.
- */
- define(['jquery', "template", "Tools"], function ($, template, Tools) {
- //数据存储
- var module = {
- data: {
- //服务器地址
- serverApi:'',
- //焦点图数据
- focusList: [],
- communicateList: [],
- },
- };
- var tools = new Tools();
-
- module.init = function (page) {
- //新闻详情
- tools.doGet(contractionList, {
- code:getQueryVariable('id'),
- bookId: JSON.parse(tools.getCookie('user')).bookId,
- deptId: JSON.parse(tools.getCookie('user')).deptId
- }, module.newsDetail , true);
- //新闻列表
- tools.doGet(contractionList, {
- pageNum:1,
- pageSize:10,
- orderByColumn: 'buildingTime',
- isAsc: 'desc',
- bookId: JSON.parse(tools.getCookie('user')).bookId,
- deptId: JSON.parse(tools.getCookie('user')).deptId
- }, module.newsList , true);
- tools.doGet(webList, {}, module.webList , true);
- };
-
- //获取地址栏参数
- function getQueryVariable(variable){
- var query = window.location.search.substring(1);
- var vars = query.split("&");
- for (var i=0;i<vars.length;i++) {
- var pair = vars[i].split("=");
- if(pair[0] == variable){return pair[1];}
- }
- return(false);
- }
-
- module.webList = function (data) {
- if (data.code == 200) {
- var content = data.data;
- module.data.webList = content;
- var webData = template('webData', module.data);
- $("#webContent").html(webData);
- $('#ewm').attr('src', 'static/images/'+content.top.bz);
- }
- }
-
- module.newsDetail = function (data) {
- if (data.code == 200) {
- var content = data.rows[0];
- $('#name').html(content.name);
- $('#code').html('合同编码:' + content.code);
- $('#biddingType').html('合同类型:'+content.biddingType);
- $('#secondParty').html('合同乙方:'+content.secondParty);
- $('#settleType').html('结款方式:'+content.settleType);
- $('#totalAmount').html('合同金额:'+content.totalAmount);
- $('#settledAmount').html('已结款:'+content.settledAmount);
- $('#receivedAmount').html('下次应结:'+content.receivedAmount);
- $('#num').html('数量:'+content.num);
- $('#unit').html('单位:'+content.unit);
- $('#buildingTime').html('签订日期:'+content.buildingTime);
- $('#startTime').html('开始日期:'+content.startTime);
- $('#endTime').html('结束日期:'+content.endTime);
- }
- }
-
- module.newsList = function (data) {
- if (data.code == 200) {
- var content = data.rows;
- module.data.newList = content;
- var newListData = template('newListData', module.data);
- $("#newListContent").html(newListData);
- }
- }
-
- return module;
- });
|