edit.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  4. layout:decorate="~{admin/common/common}">
  5. <head>
  6. <title>添加</title>
  7. <style>
  8. .ke-container-default {
  9. width: 100% !important
  10. }
  11. .ke-swfupload-body {
  12. height: 265px
  13. }
  14. .ke-dialog-body {
  15. height: 340px !important;
  16. }
  17. .ke-dialog-default {
  18. height: 410px !important;
  19. }
  20. .error {
  21. color: red;
  22. }
  23. multiple:hover .dropdown-clear-all, .dropdown-single:hover .dropdown-clear-all {
  24. display: none;
  25. }
  26. </style>
  27. </head>
  28. <body layout:fragment="content">
  29. <article class="page-container">
  30. <form class="form form-horizontal" id="form-add">
  31. <!--<div class="row cl">
  32. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>项目大类:</label>
  33. <div class="formControls col-xs-8 col-sm-9">
  34. <span class="select-box">
  35. <select class="select" th:name="project_type" id="project_type" required>
  36. <option value="">&#45;&#45; 请选择项目大类 &#45;&#45;</option>
  37. <option th:each="item : ${projectTypeList}" th:value="${item.value}" th:text="${item.name}"
  38. th:selected="${item.value==project.project_type}">
  39. </select>
  40. </span>
  41. </div>
  42. </div>-->
  43. <div class="row cl">
  44. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>填报项:</label>
  45. <div class="formControls col-xs-8 col-sm-9">
  46. <div class="select-box autocomplete">
  47. <select style="display:none" class="select" th:name="project_service_type"
  48. th:id="project_service_type" required th:placeholder="请输入填报项关键词">
  49. <option value="" th:if="${#arrays.length(projectServiceTypeList)<=0}"></option>
  50. <!--<option th:each="item : ${projectServiceTypeList}" th:value="${item.id}"
  51. th:text="${item.service_type_name}"
  52. th:selected="${#strings.append(item.id,'')==project.project_service_type}">-->
  53. </select>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="row cl">
  58. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>项目来源:</label>
  59. <div class="formControls col-xs-8 col-sm-9">
  60. <span class="select-box">
  61. <select class="select" th:name="project_source" id="project_source" required>
  62. <option value="">-- 请选择项目来源 --</option>
  63. <option th:value="1" th:text="国家" th:selected="${'1'==project.project_source}"></option>
  64. <option th:value="2" th:text="江苏省" th:selected="${'2'==project.project_source}"></option>
  65. <option th:value="3" th:text="苏州市" th:selected="${'3'==project.project_source}"></option>
  66. <option th:value="4" th:text="高新区" th:selected="${'4'==project.project_source}"></option>
  67. </select>
  68. </span>
  69. </div>
  70. </div>
  71. <!--<div class="row cl">
  72. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>项目责任单位:</label>
  73. <div class="formControls col-xs-8 col-sm-3">
  74. <span class="select-box">
  75. <select class="select" th:name="department_id" id="department_id" required>
  76. <option value="">&#45;&#45; 请选择项目责任单位 &#45;&#45;</option>
  77. <option th:each="item : ${departmentList}" th:value="${item.id}"
  78. th:text="${item.name}" th:selected="${item.id==project.department_id}">
  79. </option>
  80. </select>
  81. </span>
  82. </div>
  83. </div>-->
  84. <div class="row cl">
  85. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>对应年份:</label>
  86. <div class="formControls col-xs-8 col-sm-3">
  87. <span class="select-box">
  88. <select class="select" th:name="year" id="year" required>
  89. <option value="">-- 请选年份 --</option>
  90. <option th:value="2028" th:text="2028" th:selected="${'2028'==project.year}"></option>
  91. <option th:value="2027" th:text="2027" th:selected="${'2027'==project.year}"></option>
  92. <option th:value="2026" th:text="2026" th:selected="${'2026'==project.year}"></option>
  93. <option th:value="2025" th:text="2025" th:selected="${'2025'==project.year}"></option>
  94. <option th:value="2024" th:text="2024" th:selected="${'2024'==project.year}"></option>
  95. <option th:value="2023" th:text="2023" th:selected="${'2023'==project.year}"></option>
  96. <option th:value="2022" th:text="2022" th:selected="${'2022'==project.year}"></option>
  97. <option th:value="2021" th:text="2021" th:selected="${'2021'==project.year}"></option>
  98. <option th:value="2020" th:text="2020" th:selected="${'2020'==project.year}"></option>
  99. <option th:value="2019" th:text="2019" th:selected="${'2019'==project.year}"></option>
  100. <option th:value="2018" th:text="2018" th:selected="${'2018'==project.year}"></option>
  101. </select>
  102. </span>
  103. </div>
  104. </div>
  105. <div class="row cl">
  106. <label class="form-label col-xs-4 col-sm-2">对应季月:</label>
  107. <div class="formControls col-xs-8 col-sm-3">
  108. <span class="select-box">
  109. <select class="select" th:name="season_or_month" th:id="season_or_month">
  110. <option value="">-- 请选择季度或月度 --</option>
  111. <option th:value="J" th:text="季度" th:selected="${'J'==project.season_or_month}"></option>
  112. <option th:value="Y" th:text="月度" th:selected="${'Y'==project.season_or_month}"></option>
  113. </select>
  114. </span>
  115. </div>
  116. <div class="formControls col-xs-8 col-sm-3 season" th:hidden="${'J'!=project.season_or_month}">
  117. <span class="select-box season" th:hidden="${''==project.season}">
  118. <select class="select" th:name="season" id="season">
  119. <option value="">-- 请选择季度 --</option>
  120. <option th:value="1" th:text="第一季度" th:selected="${'1'==project.season}"></option>
  121. <option th:value="2" th:text="第二季度" th:selected="${'2'==project.season}"></option>
  122. <option th:value="3" th:text="第三季度" th:selected="${'3'==project.season}"></option>
  123. <option th:value="4" th:text="第四季度" th:selected="${'4'==project.season}"></option>
  124. </select>
  125. </span>
  126. </div>
  127. <div class="formControls col-xs-8 col-sm-3 month" th:hidden="${'Y'!=project.season_or_month}">
  128. <span class="select-box month" th:hidden="${''==project.month}">
  129. <select class="select" th:name="month" id="month">
  130. <option value="">-- 请选择月份 --</option>
  131. <option th:value="1" th:text="一月" th:selected="${'1'==project.month}"></option>
  132. <option th:value="2" th:text="二月" th:selected="${'2'==project.month}"></option>
  133. <option th:value="3" th:text="三月" th:selected="${'3'==project.month}"></option>
  134. <option th:value="4" th:text="四月" th:selected="${'4'==project.month}"></option>
  135. <option th:value="5" th:text="五月" th:selected="${'5'==project.month}"></option>
  136. <option th:value="6" th:text="六月" th:selected="${'6'==project.month}"></option>
  137. <option th:value="7" th:text="七月" th:selected="${'7'==project.month}"></option>
  138. <option th:value="8" th:text="八月" th:selected="${'8'==project.month}"></option>
  139. <option th:value="9" th:text="九月" th:selected="${'9'==project.month}"></option>
  140. <option th:value="10" th:text="十月" th:selected="${'10'==project.month}"></option>
  141. <option th:value="11" th:text="十一月" th:selected="${'11'==project.month}"></option>
  142. <option th:value="12" th:text="十二月" th:selected="${'12'==project.month}"></option>
  143. </select>
  144. </span>
  145. </div>
  146. </div>
  147. <div class="row cl">
  148. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>项目内容:</label>
  149. <div class="formControls col-xs-8 col-sm-9">
  150. <textarea id="project_content" name="project_content" th:utext="*{project.project_content}"></textarea>
  151. </div>
  152. </div>
  153. <div class="row cl">
  154. <label class="form-label col-xs-4 col-sm-2"><span>上传附件:</span></label>
  155. <div class="formControls col-xs-8 col-sm-9">
  156. <div class="uploader-thum-container">
  157. <div id="fileListPre" class="uploader-list">
  158. <th:block th:unless="${project.fileDown.file_url} == null">
  159. <a th:href=" ${fileUrl} + ${project.fileDown.file_url}" id="fileName" target="_blank">[[${project.fileDown.file_name}]]</a>
  160. </th:block>
  161. </div>
  162. <div id="filePicker">上传</div>
  163. <input type="hidden" name="fileDown.file_id" id="files" th:value="${project.fileDown.file_id}">
  164. </div>
  165. </div>
  166. </div>
  167. <div class="row cl">
  168. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>填报开始时间:</label>
  169. <div class="formControls col-xs-4 col-sm-1">
  170. <input class="Wdate input-text" type="text" th:id="apply_startdateIE" th:name="apply_startdate"
  171. style="float:left; width: 150px;"
  172. onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'apply_enddateIE\')}',isShowClear:true,readOnly:true})"/>
  173. <input type="text" class="input-text" th:id="apply_startdate" th:name="apply_startdate" th:value="${project.apply_startdate}"
  174. style="float:left; width: 150px;"/>
  175. </div>
  176. </div>
  177. <div class="row cl">
  178. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>填报结束时间:</label>
  179. <div class="formControls col-xs-4 col-sm-1">
  180. <input class="Wdate input-text" type="text" th:id="apply_enddateIE" th:name="apply_enddate"
  181. style="float:left; width: 150px;"
  182. onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'apply_startdateIE\')}',isShowClear:true,readOnly:true})"/>
  183. <input type="text" class="input-text pull-left" th:id="apply_enddate" th:name="apply_enddate" th:value="${project.apply_enddate}"
  184. style="float:left; width: 150px;"/>
  185. </div>
  186. </div>
  187. <div class="row cl">
  188. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>显示在门户:</label>
  189. <div class="formControls col-xs-8 col-sm-9">
  190. <input type="radio" id="is_public1" name="is_public" th:value="1" checked>是
  191. <input type="radio" id="is_public2" name="is_public" th:value="0">否
  192. </div>
  193. </div>
  194. <div class="row cl push">
  195. <label class="form-label col-xs-4 col-sm-2"><span>推送对象:</span></label>
  196. <div class="formControls col-xs-8 col-sm-9">
  197. <a class="btn btn-primary radius"
  198. th:onclick="'javascript:notify_addPush(\'推送\',\'/projectFilling/addPush\',\'800\',\'500\');'"><i
  199. class="Hui-iconfont">&#xe6df;</i>选择</a>
  200. <input id="pushCompanyIds" name="push_company_ids" type="hidden" th:value="${project.push_company_ids}"/>
  201. <input id="id" name="id" type="hidden" th:value="${project.id}"/>
  202. </div>
  203. <label class="form-label col-xs-4 col-sm-2"><span>已添加单位:</span></label>
  204. <div class="formControls col-xs-8 col-sm-9">
  205. <span id="pushNames" th:text="${project.push_company_names}">
  206. </span>
  207. </div>
  208. </div>
  209. <div class="row cl">
  210. <label class="form-label col-xs-4 col-sm-2"><span>摘要:</span></label>
  211. <div class="formControls col-xs-8 col-sm-9">
  212. <textarea id="summary" class="input-text" name="summary">[[${project?.summary}]]</textarea>
  213. </div>
  214. </div>
  215. <!--<div class="row cl push" hidden th:hidden="${project.project_type == '1'}">
  216. <label class="form-label col-xs-4 col-sm-2"><span>推送对象:</span></label>
  217. <div class="formControls col-xs-8 col-sm-9">
  218. <a class="btn btn-primary radius"
  219. th:onclick="'javascript:notify_addPush(\'推送\',\'/government/projectProvinces/addPush\',\'800\',\'500\');'"><i
  220. class="Hui-iconfont">&#xe6df;</i>添加</a>
  221. <input id="pushStreetIds" name="push_street_ids" type="hidden" th:value="${project.push_street_ids}"/>
  222. <input id="pushBuildIds" name="push_build_ids" type="hidden" th:value="${project.push_build_ids}"/>
  223. <input id="pushCompanyIds" name="push_company_ids" type="hidden"
  224. th:value="${project.push_company_ids}"/>
  225. <input id="pushStreetNames" name="push_street_names" type="hidden"
  226. th:value="${project.push_street_names}"/>
  227. <input id="pushBuildNames" name="push_build_names" type="hidden"
  228. th:value="${project.push_build_names}"/>
  229. <input id="pushCompanyNames" name="push_company_names" type="hidden"
  230. th:value="${project.push_company_names}"/>
  231. <input id="id" name="id" type="hidden" th:value="${project.id}"/>
  232. <input type="hidden" id="isPush">
  233. </div>
  234. <label class="form-label col-xs-4 col-sm-2"><span>已添加单位:</span></label>
  235. <div class="formControls col-xs-8 col-sm-9">
  236. <span id="pushNames" th:text="${project.push_company_names}">
  237. </span>
  238. </div>
  239. </div>-->
  240. <div class="row cl">
  241. <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
  242. <a th:if="${project.status=='0'}" type="submit" onclick="save()" class="btn btn-secondary radius"><i
  243. class="Hui-iconfont">&#xe632;</i>保存草稿
  244. </a>
  245. <a th:onclick="'javascript:preview(\'项目申报预览\',\'/projectDeclaration/preview\',\'800\',\'600\');'"
  246. class="btn btn-secondary radius"><i class="Hui-iconfont">&#xe632;</i>预览
  247. </a>
  248. <a class="btn btn-primary radius" onclick="release()"><i class="Hui-iconfont">&#xe632;</i>发布
  249. </a>
  250. <a onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</a>
  251. </div>
  252. </div>
  253. </form>
  254. </article>
  255. <script type="text/javascript" th:src="@{/h-ui/lib/webuploader/0.1.5/webuploader.min.js}"></script>
  256. <script th:inline="javascript">
  257. //富文本kindeditor初始化
  258. var editor;
  259. KindEditor.ready(function (K) {
  260. editor = K.create('#project_content', {
  261. uploadJson: pagePath + '/upload/kindEditorUpload',
  262. allowFileManager: false,
  263. allowUpload: true,
  264. width: "100%",
  265. height: "350px",
  266. items: array,
  267. syncType: "auto",
  268. filterMode: false,
  269. afterBlur: function () {
  270. this.sync();
  271. }
  272. });
  273. });
  274. $(function () {
  275. // 初始化上传
  276. var options = {
  277. uploadBtnId: '#filePicker',
  278. picturePreId: 'fileListPre',
  279. hiddenPictureUrl: 'img',
  280. hiddenPictureName: 'imgName',
  281. width: 81,
  282. height: 81,
  283. fileSizeLimit: 100 * 1024 * 1024,
  284. fileSingleSizeLimit: 100 * 1024 * 1024
  285. };
  286. var webUploadDoc = new $WebUploadDoc(options);
  287. webUploadDoc.init();
  288. var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
  289. var isOpera = userAgent.indexOf("Opera") > -1;
  290. //判断是否IE浏览器
  291. if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
  292. $("#apply_startdate").remove();
  293. $("#apply_enddate").remove();
  294. } else {
  295. $("#apply_startdateIE").remove();
  296. $("#apply_enddateIE").remove();
  297. var startDate = laydate.render({
  298. elem: '#apply_startdate',
  299. type: 'datetime',
  300. done: function (value, date) {
  301. setTimeout(function () {
  302. $("#form-add").validate().element($("#apply_startdate"));
  303. }, 100)
  304. if (value !== '') {
  305. endDate.config.min.year = date.year;
  306. endDate.config.min.month = date.month - 1;
  307. endDate.config.min.date = date.date;
  308. endDate.config.min.hours = date.hours;
  309. endDate.config.min.minutes = date.minutes;
  310. endDate.config.min.seconds = date.seconds;
  311. } else {
  312. endDate.config.min.year = '1900';
  313. endDate.config.min.month = '0';
  314. endDate.config.min.date = '1';
  315. endDate.config.min.hours = '0';
  316. endDate.config.min.minutes = '0';
  317. endDate.config.min.seconds = '0';
  318. }
  319. }
  320. });
  321. var endDate = laydate.render({
  322. elem: '#apply_enddate',
  323. type: 'datetime',
  324. done: function (value, date) {
  325. setTimeout(function () {
  326. $("#form-add").validate().element($("#apply_enddate"));
  327. }, 100)
  328. if (value !== '') {
  329. startDate.config.max.year = date.year;
  330. startDate.config.max.month = date.month - 1;
  331. startDate.config.max.date = date.date;
  332. startDate.config.max.hours = date.hours;
  333. startDate.config.max.minutes = date.minutes;
  334. startDate.config.max.seconds = date.seconds;
  335. } else {
  336. startDate.config.max.year = '2100';
  337. startDate.config.max.month = '0';
  338. startDate.config.max.date = '1';
  339. startDate.config.max.hours = '0';
  340. startDate.config.max.minutes = '0';
  341. startDate.config.max.seconds = '0';
  342. }
  343. }
  344. });
  345. }
  346. });
  347. var project = [[${project}]];
  348. var list = [[${projectServiceTypeList}]];
  349. var typeArrs = new Array();
  350. for (var i = 0; i < list.length; i++) {
  351. if (project.project_service_type == list[i].id) {
  352. var type = {
  353. "name": list[i].service_type_name,
  354. "id": list[i].id,
  355. "selected": true
  356. }
  357. } else {
  358. var type = {
  359. "name": list[i].service_type_name,
  360. "id": list[i].id,
  361. "selected": false
  362. }
  363. }
  364. typeArrs.push(type)
  365. }
  366. //自动联想
  367. $('.autocomplete').dropdown({
  368. readOnly: true,
  369. data: typeArrs,
  370. input: '<input type="text" maxLength="20" placeholder="请输入搜索">',
  371. choice: function () {
  372. //$("span.placeholder").html($(".dropdown-chose")[0].innerText);
  373. $("#project_service_type").val($(".dropdown-chose").attr("data-value"));
  374. }
  375. });
  376. function getProjectServicetype(id) {
  377. $.ajax({
  378. url: pagePath + "/projectFilling/getProjectServicetype/" + id,
  379. type: "get",
  380. dataType: "json",
  381. data: {
  382. timeStamp: new Date()
  383. },
  384. success: function (result) {
  385. if (result.success) {
  386. var obj = result.obj;
  387. var typeArr = new Array();
  388. if (obj) {
  389. for (var i = 0; i < obj.length; i++) {
  390. var type = {
  391. "name": obj[i].service_type_name,
  392. "id": obj[i].id,
  393. "disabled": false,
  394. //"groupName": '分组名',
  395. //"groupId": 1,
  396. "selected": false
  397. }
  398. typeArr.push(type);
  399. }
  400. }
  401. //autoComplete(typeArr);
  402. $('.autocomplete').data('dropdown').update(typeArr, true);
  403. } else {
  404. errorMessage(result.message);
  405. }
  406. },
  407. error: function () {
  408. errorMessage('系统错误!');
  409. }
  410. });
  411. }
  412. $("#project_type").change(function () {
  413. getProjectServicetype($("#project_type").val())
  414. })
  415. /**
  416. * 取消
  417. */
  418. function removeIframe() {
  419. var index = parent.layer.getFrameIndex(window.name);
  420. parent.layer.close(index);
  421. }
  422. var state = '0';
  423. $("#form-add").validate({
  424. rules: {
  425. project_type: {
  426. required: true
  427. },
  428. project_service_type: {
  429. required: true
  430. },
  431. project_source: {
  432. required: true
  433. },
  434. department_id: {
  435. required: true
  436. },
  437. year: {
  438. required: true
  439. },
  440. project_content: {
  441. required: true
  442. //maxlength: 2000
  443. },
  444. apply_startdate: {
  445. required: true
  446. },
  447. apply_enddate: {
  448. required: true
  449. }
  450. },
  451. onkeyup: false,
  452. focusCleanup: true,
  453. focusInvalid: false,
  454. success: "valid",
  455. submitHandler: function (form) {
  456. if (editor.isEmpty()) {
  457. errorMessage('请输入项目内容');
  458. return false;
  459. } else if (editor.text().length > 2000) {
  460. //errorMessage('项目内容最多2000字');
  461. // return false;
  462. }
  463. if (state == '1') {
  464. if ($('input[name="is_open"]:checked').val() == 0) {
  465. if ($("#pushNames").text().length <= 0) {
  466. errorMessage('请选择推送对象');
  467. return false;
  468. }
  469. }
  470. }
  471. $(form).ajaxSubmit({
  472. type: 'post',
  473. url: pagePath + "/projectFilling/update",
  474. dataType: "json",
  475. data: {
  476. state: state
  477. },
  478. success: function (result) {
  479. if (result.success) {
  480. succeedMessage(result.message);
  481. setTimeClose();
  482. } else {
  483. // $(form).find(":submit").attr("disabled", false);
  484. errorMessage(result.message);
  485. }
  486. },
  487. error: function () {
  488. errorMessage('系统错误!');
  489. }
  490. });
  491. return false; // 非常重要,如果是false,则表明是不跳转,在本页上处理,也就是ajax,如果是非false,则传统的form跳转。
  492. }
  493. });
  494. function release() {
  495. state = "1";
  496. $("#form-add").submit();
  497. }
  498. function save() {
  499. state = "0";
  500. $("#form-add").ajaxSubmit({
  501. type: 'post',
  502. url: pagePath + "/projectFilling/update",
  503. dataType: "json",
  504. data: {
  505. state: state
  506. },
  507. success: function (data) {
  508. if (data.success) {
  509. succeedMessage(data.message);
  510. setTimeClose();
  511. } else {
  512. // $(form).find(":submit").attr("disabled", false);
  513. errorMessage(data.message);
  514. }
  515. },
  516. error: function () {
  517. errorMessage('系统错误!');
  518. }
  519. });
  520. }
  521. $(function () {
  522. $("#allBuilds").click(function () {
  523. if (this.checked) {
  524. $("#pushBuildsList :checkbox").prop("checked", true);
  525. } else {
  526. $("#pushBuildsList :checkbox").prop("checked", false);
  527. }
  528. });
  529. });
  530. function sendNotify() {
  531. $("#isPush").val(true);
  532. if ($("#pushStreetIds").val() == "" && $("#pushBuildIds").val() == "" && $("#pushCompanyIds").val() == "") {
  533. sadMessage("请选择推送单位!");
  534. return false;
  535. }
  536. }
  537. function clearPush() {
  538. $("#isPush").val(false);
  539. }
  540. function getPushBuildsIds() {
  541. var chlength = $('#pushBuildsList').find('input[type="checkbox"]:checked').length;
  542. var build_ids = '';
  543. $('#pushBuildsList').find('input[type="checkbox"]:checked').each(function (i, item) {
  544. build_ids = build_ids + $(this).attr("value") + ",";
  545. });
  546. build_ids = build_ids.substring(0, build_ids.length - 1);
  547. return build_ids;
  548. }
  549. /*
  550. 参数解释:
  551. title 标题
  552. url 请求的url
  553. id 需要操作的数据id
  554. w 弹出层宽度(缺省调默认值)
  555. h 弹出层高度(缺省调默认值)
  556. */
  557. /*管理员-*/
  558. function notify_addPush(title, url, w, h) {
  559. var targetUrl = pagePath + url+"?pushCompanyIds="+$("#pushCompanyIds").val();
  560. var index = layer_show(title, targetUrl, w, h);
  561. layer.full(index);
  562. }
  563. function preview(title, url, w, h) {
  564. layer_show(title, pagePath + url, w, h);
  565. }
  566. $("#season_or_month").change(function () {
  567. if ($('#season_or_month option:selected').val() == "J") {
  568. $(".season").show();
  569. $(".month").hide();
  570. } else if ($('#season_or_month option:selected').val() == "Y") {
  571. $(".month").show()
  572. $(".season").hide();
  573. } else {
  574. $(".month").hide()
  575. $(".season").hide();
  576. }
  577. });
  578. $("#project_type").change(function () {
  579. if ($('#project_type option:selected').val() == "1") {
  580. $(".push").hide();
  581. } else if ($('#project_type option:selected').val() == "2") {
  582. $(".push").show()
  583. }
  584. });
  585. </script>
  586. </body>
  587. </html>