农燊高科官方网站
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.

biddingList.js 11 KiB

4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "biddingApi", "itemsApi", "paging",'dateTime'], function ($, template, Tools ) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //标的物类型
  9. deptTypeList:[],
  10. //标的物所在地
  11. deptLocationList:[],
  12. //竞价大厅列表
  13. biddingInformationList:'',
  14. //页码
  15. pageNum: 1,
  16. //页码集合
  17. pageList: [],
  18. //每页数量
  19. pageSize: 50,
  20. //总页数
  21. pageCount:0,
  22. //标的物选中项id
  23. deptId:'',
  24. //标的所在地选中
  25. secondDeptId:'',
  26. //标的物类型ID
  27. projectNumber:'',
  28. //项目状态
  29. projectShowStatus:'',
  30. //报名开始时间
  31. signupStartTime:'',
  32. //报名结束时间
  33. signupStopTime:'',
  34. //竞价开始时间
  35. biddingStartTime:'',
  36. //竞价结束时间
  37. biddingStopTime:'',
  38. form:{
  39. deptId:'',
  40. projectNumber:'',
  41. projectShowStatus:'',
  42. signupStartTime:'',
  43. signupStopTime:'',
  44. biddingStartTime:'',
  45. biddingStopTime:'',
  46. pageNum:1,
  47. pageSize:1,
  48. }
  49. },
  50. };
  51. var tools = new Tools();
  52. module.init = function (page) {
  53. //底部友情链接
  54. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  55. //新闻资讯
  56. tools.doGet(biddingList, {deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.biddingList,true);
  57. //标的物类型
  58. tools.doGet(webDeptType+"/project_type", {}, module.deptType,true);
  59. //标的物所在地
  60. tools.doGet(webDept, {deptId:''}, module.deptLocation, true);
  61. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  62. tools.getWebConfig();
  63. $("#signStartTimeStr").datetime({
  64. type:"date",
  65. value:[2019,9,31],
  66. success:function(res){
  67. console.log(res)
  68. }
  69. })
  70. $("#signEndTimeStr").datetime({
  71. type:"date",
  72. value:[2019,9,31],
  73. success:function(res){
  74. console.log(res)
  75. }
  76. })
  77. $("#auctionStartTimeStr").datetime({
  78. type:"date",
  79. value:[2019,9,31],
  80. success:function(res){
  81. console.log(res)
  82. }
  83. })
  84. $("#endTimeStr").datetime({
  85. type:"date",
  86. value:[2019,9,31],
  87. success:function(res){
  88. console.log(res)
  89. }
  90. })
  91. };
  92. //挂牌项目列表
  93. module.biddingList = function (data) {
  94. if (data.code == 200) {
  95. console.log(data)
  96. var content = data.rows;
  97. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  98. if (pageCount < 1){
  99. pageCount = 1;
  100. }
  101. if(module.data.biddingInformationList == ''){
  102. // 初始化 分页器
  103. var page_s1=createPage('.page_s1');
  104. // 设置分页
  105. setPage(page_s1,{
  106. pageTotal: data.total, // 数据总条数
  107. pageSize: module.data.pageSize, // 每页显示条数
  108. pageCurrent: 1, // 当前页
  109. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  110. })
  111. $('#page_s1').html('共'+pageCount+'页')
  112. }
  113. module.data.pageCount = pageCount;
  114. module.data.biddingInformationList = content;
  115. for(var i = 0 ; i < content.length ; i++){
  116. if(content[i].biddingStopTime == null || content[i].biddingStartTime == null){continue;}
  117. var endTimes=content[i].biddingStopTime.substring(0,10).split('-');
  118. var biddingStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+content[i].biddingStopTime.substring(10,19);
  119. var startTimes=content[i].biddingStartTime.substring(0,10).split('-');
  120. var biddingStartTime=startTimes[1]+'/'+startTimes[2]+'/'+startTimes[0]+' '+content[i].biddingStartTime.substring(10,19);
  121. var nowTime = Date.parse(new Date());
  122. var leftTime = Date.parse(biddingStopTime)-nowTime;
  123. var rightTime = Date.parse(biddingStartTime)-nowTime;
  124. console.log(biddingStopTime)
  125. console.log(leftTime)
  126. if(leftTime>0){
  127. console.log('进行中')
  128. content[i].timeType = '进行中'
  129. }
  130. if(leftTime<0){
  131. console.log('已结束')
  132. content[i].timeType = '已结束'
  133. }
  134. if(rightTime>0){
  135. console.log('未开始')
  136. content[i].timeType = '未开始'
  137. }
  138. }
  139. var biddingInformationData = template('biddingInformationData', module.data);
  140. $("#biddingInformationContent").html(biddingInformationData);
  141. }
  142. }
  143. //标的物类型
  144. module.deptType = function (data) {
  145. console.log(data)
  146. if (data.code == 200) {
  147. var content = data.data ;
  148. module.data.deptTypeList = content;
  149. var deptTypeData = template('deptTypeData', module.data);
  150. $("#deptTypeContent").html(deptTypeData);
  151. }
  152. }
  153. //标的物所在地
  154. module.deptLocation = function (data) {
  155. if (data.code == 200) {
  156. var content = data.data ;
  157. module.data.deptLocationList = content;
  158. var deptLocationData = template('deptLocationData', module.data);
  159. $("#deptLocationContent").html(deptLocationData);
  160. }
  161. }
  162. //标的物所在地(二级)
  163. module.deptSecondLocation = function (data) {
  164. if ( data.data.length == 0){
  165. document.getElementById('secondDept').style.display = 'none';
  166. return;
  167. }else{
  168. document.getElementById('secondDept').style.display = 'block';
  169. }
  170. if (data.code == 200) {
  171. console.log(data)
  172. var content = data.data;
  173. module.data.deptSecondLocationList = content;
  174. var deptSecondLocationData = template('deptSecondLocationData', module.data);
  175. $("#secondDept").html(deptSecondLocationData);
  176. console.log(module.data.deptId)
  177. }
  178. }
  179. tabCheck = function (deptId) {
  180. module.data.deptId = deptId;
  181. $('#locInfoall').attr("class","auction_hall_table_tab auction_loc");
  182. $("#deptLocationContent div").attr("class","auction_hall_table_tab auction_loc");
  183. if(deptId == ''){
  184. $('#locInfoall').addClass('auction_hall_table_tab_select');
  185. document.getElementById('secondDept').style.display = 'none';
  186. }else{
  187. $('#locInfoall'+deptId).addClass('auction_hall_table_tab_select');
  188. tools.doGet(webDept, {deptId:deptId}, module.deptSecondLocation, true);
  189. }
  190. }
  191. secondCheck = function(id,secondDeptId){
  192. $('#locInfoSecondall').attr("class","auction_hall_table_tab auction_loc");
  193. $("#secondDept div").attr("class","auction_hall_table_tab auction_loc");
  194. if(id == '' && secondDeptId == ''){
  195. $('#locInfoSecondall').addClass('auction_hall_table_tab_select');
  196. }else{
  197. $('#locInfoall'+id).addClass('auction_hall_table_tab_select');
  198. module.data.deptId = secondDeptId;
  199. }
  200. }
  201. allDept = function (){
  202. module.data.deptSize = 30
  203. document.getElementById('allDept').innerHTML = "<i class='sanjiao-top'></i>";
  204. document.getElementById('allDept').onclick = upDept;
  205. tools.doGet(webDept + '/0', {}, module.deptLocation, true);
  206. }
  207. turnThePage = function (pageNum) {
  208. module.data.pageNum = pageNum ;
  209. tools.doGet(biddingList, {deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.itemList,true);
  210. }
  211. typeCheck = function(id,projectNumber){
  212. module.data.projectNumber = projectNumber;//标的物类型ID
  213. document.getElementById('standardTypeAll').className = 'auction_hall_table_tab';
  214. if(id == ''){
  215. id = 'All';
  216. }
  217. if(projectNumber == undefined){
  218. module.data.projectNumber = '';
  219. }
  220. for (var i = 0 ; i < module.data.deptTypeList.length ; i++){
  221. document.getElementById('standardType'+(i+1)).className = 'auction_hall_table_tab';
  222. }
  223. document.getElementById('standardType'+id).className = 'auction_hall_table_tab auction_hall_table_tab_select';
  224. }
  225. selectedStatus = function(id,projectShowStatus){
  226. module.data.projectShowStatus = projectShowStatus;
  227. document.getElementById('statusall').className = 'auction_hall_table_tab'
  228. for (var i = 0 ; i < 5 ; i++){
  229. document.getElementById('status'+(1+i)).className = 'auction_hall_table_tab'
  230. }
  231. document.getElementById('status'+id).className = 'auction_hall_table_tab auction_hall_table_tab_select'
  232. }
  233. //底部友情链接
  234. module.bottomFriendsLinks = function (data) {
  235. if (data.code == 200) {
  236. var content = data.data;
  237. console.log(content)
  238. module.data.friendsLinksList = content;
  239. var friendsLinksData = template('friendsLinksData', module.data);
  240. $("#friendsLinksContent").html(friendsLinksData);
  241. }
  242. }
  243. goSearch = function(){
  244. module.data.itemsInformationList = '';
  245. $('.page_s1').html('')
  246. $('#page_s1').html('')
  247. module.data.form.deptId = module.data.deptId;
  248. module.data.form.projectNumber = module.data.projectNumber;
  249. module.data.form.projectShowStatus= module.data.projectShowStatus;
  250. module.data.form.signupStartTime= $('#signStartTimeStr').val();
  251. module.data.form.signupStopTime= $('#signEndTimeStr').val();
  252. module.data.form.biddingStartTime= $('#auctionStartTimeStr').val();
  253. module.data.form.biddingStopTime= $('#endTimeStr').val();
  254. module.data.form.pageNum= module.data.pageNum;
  255. module.data.form.pageSize= module.data.pageSize;
  256. console.log(module.data.form)
  257. tools.doGet(biddingList, module.data.form, module.biddingList, true);
  258. }
  259. goDetail = function (id) {
  260. tools.skip('../listingItems/itemsDetail.html?id='+id);
  261. }
  262. return module;
  263. });