list2.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. 'use strict';
  2. var app = angular.module('app', [
  3. 'angularUtils.directives.dirPagination'
  4. ]);
  5. app.controller("listCtrl", ["$scope", "$http", "$timeout", function ($scope, $http, $timeout) {
  6. var self = this;
  7. var s4 = new SM4Util();
  8. self.userId = $.cookie("GlWorkPlatform-userid");
  9. self.userName = $.cookie("GlWorkPlatform-chineseName");
  10. self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
  11. self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno");
  12. var postCfg = {
  13. headers: {
  14. 'Content-Type': 'application/json',
  15. 'Authorization': "Bearer " + self.get_AccessToken
  16. }
  17. }
  18. self.type = sp.getUrlName("type") == "" ? 1 : sp.getUrlName("type");
  19. self.changeType = function (n) {
  20. if (self.type == n) {
  21. return;
  22. } else {
  23. self.type = n;
  24. self.getData(1, self.type)
  25. }
  26. }
  27. self.CrossPage = window.parent.CrossPage;
  28. self.loading = false;
  29. self.noDataTip = 1;//没有数据时赋变量为0,先默认为1
  30. self.listTotal1 = [];
  31. self.listTotal2 = [];
  32. self.list = [];
  33. self.pageno = 1;
  34. self.total_count = 0;
  35. //self.itemsPerPage = 10;
  36. self.pageOptions = [10, 20, 30, 40];
  37. self.search = JSON.parse($.cookie("danganList2-search"));
  38. //1为已提交、2为退回、3为合并提交、4为合并草稿、5为封装、6为已整理提交
  39. self.getData = function (pageno, type) {
  40. if (self.search == null) {
  41. self.search = {
  42. starttime: "",
  43. endtime: "",
  44. title: "",
  45. archyear: sp.currentYear(),
  46. mijiqixian: "10年",
  47. itemsPerPage: 10
  48. }
  49. }
  50. $.cookie("danganList2-search", JSON.stringify(self.search), { path: '/', expires: 1 });
  51. self.loading = true;
  52. self.pageno = pageno;
  53. $scope.__default__currentPage = self.pageno; //设置页面样式在第几页
  54. self.list = [];
  55. var functionName = type == 1 ? "queryDataByColumnsWithPage" : "queryZLDataWithPage";
  56. var data = {
  57. tablename: "DOCELEMENT_ZL",
  58. sqlwhere: type == 1 ? {
  59. DPCODE: self.userDpCode,
  60. MIJIQIXIAN: self.search.mijiqixian,
  61. ARCHYEAR: self.search.archyear
  62. } : {
  63. MODELMARK: "1",
  64. DPCODE: self.userDpCode,
  65. MIJIQIXIAN: self.search.mijiqixian,
  66. ARCHYEAR: self.search.archyear
  67. },
  68. sqlinwhere: type == 1 ? {
  69. LOCKSTATUS: "'0','" + self.userId + "'",
  70. sendstatus: "1"
  71. } : {
  72. LOCKSTATUS: "'0','" + self.userId + "'",
  73. sendstatus: "3,4"
  74. },
  75. title: self.search.title,
  76. order: type == 1 ? "JIANHAO" : "SENDDATE desc",
  77. pageno: self.pageno,
  78. pagesize: self.search.itemsPerPage
  79. }
  80. if (type == 1) {
  81. data.columns = "ID,WENHAO,ROUTEINFOID,DOCUMENTTYPE,DOCTITLE,FLOWID,TO_CHAR(FINISHEDDATE,'YYYY-mm-dd hh24:mi:ss') AS FINISHEDDATE,SENDSTATUS,DOCISSUEDNUM,ARCHYEAR,JIANHAO,ARCHCODE,MIJIQIXIAN,ORGANIZATIONMA"
  82. }
  83. $http.post(apiurljs.login + "g2app/DangAn/" + functionName, { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  84. .success(function (obj) {
  85. var res = strToJson(s4.decryptData_CBC(obj.data));
  86. self.loading = false;
  87. if (res.data == null || res.data == undefined || res.data == "") {
  88. self.noDataTip = 0;
  89. } else {
  90. self.noDataTip = 1;
  91. self.list = res.data;
  92. self.listChecked = false;
  93. self.total_count = res.totalCount;
  94. if (QCHB(self.list, self["listTotal" + self.type], "ID").length > 0) {
  95. self["listTotal" + self.type] = self["listTotal" + self.type].concat(QCHB(self.list, self["listTotal" + self.type], "ID"))
  96. }
  97. var checkedNum = 0;
  98. $.each(self.list, function (index, item) {
  99. item.checked = false;
  100. item.STATUS = item.SENDSTATUS == 1 ? "未整理" : item.SENDSTATUS == 3 ? "已合并" : "未合并";
  101. $.each(self["listTotal" + self.type], function (index1, item1) {
  102. if (item.ID == item1.ID) {
  103. item.checked = item1.checked;
  104. }
  105. })
  106. if (item.checked == true) {
  107. checkedNum++
  108. }
  109. })
  110. if (checkedNum == self.list.length) {
  111. self.listChecked = true;
  112. }
  113. }
  114. })
  115. }
  116. self.changeListCheck = function () {
  117. $.each(self.list, function (index, item) {
  118. item.checked = self.listChecked;
  119. $.each(self["listTotal" + self.type], function (index1, item1) {
  120. if (item1.ID == item.ID) {
  121. item1.checked = item.checked;
  122. }
  123. })
  124. })
  125. }
  126. self.changeCheck = function (item, n) {
  127. item.checked = n == 1 ? item.checked : !item.checked;
  128. $.each(self["listTotal" + self.type], function (index1, item1) {
  129. if (item1.ID == item.ID) {
  130. item1.checked = item.checked;
  131. }
  132. })
  133. event.stopPropagation()
  134. }
  135. self.load = function () {
  136. if (self.get_lastReturnPageno == undefined || self.get_lastReturnPageno == null || self.get_lastReturnPageno == "") {
  137. self.getData(self.pageno, self.type);
  138. } else {
  139. $timeout(function () {
  140. self.getData(parseInt(self.get_lastReturnPageno), self.type);
  141. }, 1)
  142. }
  143. }
  144. self.getDP = function () {
  145. var data = {
  146. userid: self.userId
  147. }
  148. $http.post(apiurljs.login + "g2app/richang/queryDpInfo", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  149. .success(function (obj) {
  150. var res = strToJson(s4.decryptData_CBC(obj.data));
  151. self.userDpName = res.data.length == 0 ? "" : res.data[0].SECTION;
  152. self.userDpCode = res.data.length == 0 ? "" : res.data[0].CODE;
  153. self.getORGANIZATIONMA();
  154. })
  155. }
  156. self.getORGANIZATIONMA = function () {
  157. self.ORGANIZATIONMA = []
  158. var data = {
  159. tablename: "SYS_SECT",
  160. colums: "*",
  161. order: "SORTID",
  162. sqlwhere: "",
  163. sqlorwhere: "",
  164. sqlinwhere: "",
  165. sqllikewhere: ""
  166. }
  167. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  168. .success(function (obj) {
  169. var res = strToJson(s4.decryptData_CBC(obj.data));
  170. self.ORGANIZATIONMA = res.data;
  171. self.load();
  172. })
  173. }
  174. self.getDP();
  175. self.refresh = function () {
  176. self.CrossPage.type = null;
  177. self.getData(self.pageno, self.type);
  178. }
  179. ///查询-打开弹出层
  180. self.openSearchLayer = function () {
  181. if (self.search == null) {
  182. self.search = {
  183. starttime: "",
  184. endtime: "",
  185. title: "",
  186. archyear: sp.currentYear(),
  187. mijiqixian: "10年",
  188. itemsPerPage: 10
  189. }
  190. }
  191. sp.layer("#search");
  192. }
  193. self.btnSubmit = function () {
  194. var itemlist = [], flag = true;
  195. self["listTotal" + self.type].forEach(function (item) {
  196. if (item.checked == true) {
  197. if (item.SENDSTATUS != 3) {
  198. flag = false;
  199. sp.dialog("请勾选状态为已合并的案件!");
  200. return;
  201. } else {
  202. if (item.ARCHCODE == "" || item.ARCHCODE == null) {
  203. flag = false;
  204. sp.dialog("档号不能为空,请先进行档号整理!")
  205. return;
  206. } else {
  207. itemlist.push(item.ROUTEINFOID);
  208. }
  209. }
  210. }
  211. })
  212. if (!flag) {
  213. return
  214. }
  215. if (itemlist.length == 0) {
  216. sp.dialog("请勾选需要提交的案件!");
  217. return;
  218. }
  219. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  220. var dialogBody = "<div class=\"sp-dialog-body\">您确认要提交所勾选的案件吗?</div>";
  221. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='upDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  222. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  223. sp.openCenter(".sp-dialog");
  224. $('.sp-closeDialog').click(function (event) {
  225. sp.dialoghide();
  226. event.preventDefault();
  227. event.stopPropagation();
  228. });
  229. $("#upDataTrue").click(function () {
  230. sp.dialoghide();
  231. var data = {
  232. routeinfoid: itemlist.join(","),
  233. tablename: "DOCELEMENT_ZL",
  234. sqlwhere: {
  235. SENDSTATUS: "6",
  236. LOCKSTATUS: "0",
  237. SENDDATE: sp.getLocalDate()
  238. }
  239. }
  240. $http.post(apiurljs.login + "g2app/DangAn/setColumns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  241. .success(function (obj) {
  242. var res = strToJson(s4.decryptData_CBC(obj.data));
  243. if (res.success) {
  244. sp.dialog("提交成功!");
  245. self.getData(1, self.type);
  246. self["listTotal" + self.type] = self["listTotal" + self.type].filter(function (item) {
  247. return itemlist.every(function (item1) {
  248. return item.ROUTEINFOID != item1;
  249. })
  250. })
  251. $timeout(function () {
  252. sp.dialoghide();
  253. }, 1000)
  254. } else {
  255. sp.dialog(res.message)
  256. }
  257. })
  258. })
  259. }
  260. self.list1 = [];
  261. self.pailie = function (n) {
  262. var data = {
  263. tablename: "DOCELEMENT_ZL",
  264. colums: "*",
  265. sqlwhere: {
  266. MIJIQIXIAN: self.search.mijiqixian//n == 3 ? "永久" : n == 2 ? "30年" : "10年"
  267. },
  268. sqlinwhere: {
  269. LOCKSTATUS: "'0','" + self.userId + "'",
  270. sendstatus: "1"
  271. } ,
  272. sqllikewhere: "",
  273. order: "JIANHAO"
  274. }
  275. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  276. .success(function (obj) {
  277. var res = strToJson(s4.decryptData_CBC(obj.data));
  278. if (res.data == null || res.data == undefined || res.data == "") {
  279. if (n == 0) {
  280. sp.dialog("暂无数据!")
  281. return
  282. } else {
  283. self.list1 = [];
  284. }
  285. }
  286. self.list1 = res.data;
  287. self.jianhaoList = res.data.map(function (item) { return item.JIANHAO });
  288. $("#table_tbody").sortable({
  289. cursor: "move",
  290. stop: function (event, ui) {
  291. var index = 1;
  292. $("#table_tbody").children().each(function (x) {
  293. $(this).attr("index", index)
  294. $(this).children().eq(0).html(index)
  295. index++
  296. })
  297. }
  298. }).disableSelection();
  299. if (n == 0) {
  300. $(".Item").removeClass("Choose").eq(0).addClass("Choose")
  301. sp.layer("#pailie", 1)
  302. } else {
  303. $(".Item").removeClass("Choose").eq(n - 1).addClass("Choose")
  304. }
  305. })
  306. }
  307. self.closePai = function () {
  308. var IDS = [], JIANHAOS = [];
  309. self.list1.forEach(function (item) {
  310. $("#table_tbody").children().each(function (index) {
  311. if ($(this).attr("data-col") == item.ID) {
  312. IDS.push({ ID: item.ID })
  313. var MIJIQIXIAN = item.MIJIQIXIAN == "10年" ? "D10" : item.MIJIQIXIAN == "30年" ? "D30" : "Y";
  314. var ORGANIZATIONMA = self.ORGANIZATIONMA.filter(function (item1) {
  315. if (item1.CODE == item.ORGANIZATIONMA) {
  316. return item1
  317. }
  318. })[0].INSTCODE
  319. JIANHAOS.push({ JIANHAO: index + 1, ARCHCODE: "X154-WS・" + item.ARCHYEAR + "-" + MIJIQIXIAN + "-" + ORGANIZATIONMA + "-" + JIANHAO(index + 1) })
  320. }
  321. })
  322. })
  323. var data = {
  324. entity: "DOCELEMENT_ZL",
  325. data: JIANHAOS,
  326. setwhere: IDS
  327. }
  328. $http.post(apiurljs.login + "g2app/Data/UpdataByWhereList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  329. .success(function (obj) {
  330. var res = strToJson(s4.decryptData_CBC(obj.data));
  331. if (res.success == true) {
  332. self.getData(1, 1);
  333. sp.closeCenter("#pailie")
  334. }
  335. })
  336. }
  337. self.Top = function (obj, n) {
  338. for (var i = 0; i < n; i++) {
  339. self.list1[i].JIANHAO = self.list1[i].JIANHAO * 1 + 1;
  340. }
  341. obj.JIANHAO = 1;
  342. self.list1.sort(function (a, b) {
  343. return a.JIANHAO - b.JIANHAO;
  344. })
  345. }
  346. self.Up = function (obj, n) {
  347. obj.JIANHAO--
  348. self.list1[n - 1].JIANHAO++
  349. self.list1.sort(function (a, b) {
  350. return a.JIANHAO - b.JIANHAO;
  351. })
  352. }
  353. self.Down = function (obj, n) {
  354. obj.JIANHAO++
  355. self.list1[n + 1].JIANHAO--
  356. self.list1.sort(function (a, b) {
  357. return a.JIANHAO - b.JIANHAO;
  358. })
  359. }
  360. self.Bottom = function (obj, n) {
  361. for (var i = n; i < self.list.length; i++) {
  362. self.list1[i].JIANHAO = self.list1[i].JIANHAO * 1 - 1;
  363. }
  364. obj.JIANHAO = self.list1.length;
  365. self.list1.sort(function (a, b) {
  366. return a.JIANHAO - b.JIANHAO;
  367. })
  368. }
  369. self.danghao = function () {
  370. var list = [];
  371. self["listTotal" + self.type].forEach(function (item) {
  372. if (item.checked == true) {
  373. list.push(item)
  374. }
  375. })
  376. if (list.length == 0) {
  377. sp.dialog("请选择要生成档号的案件!");
  378. return;
  379. } else {
  380. var ids = [], title = [], archcode = [];
  381. list.forEach(function (item) {
  382. if (item.ARCHCODE != "" && item.ARCHCODE != null) {
  383. title.push(item.DOCTITLE)
  384. } else {
  385. ids.push({ ID: item.ID })
  386. var MIJIQIXIAN = item.MIJIQIXIAN == "10年" ? "D10" : item.MIJIQIXIAN == "30年" ? "D30" : "Y";
  387. var ORGANIZATIONMA = self.ORGANIZATIONMA.filter(function (item1) {
  388. if (item1.CODE == item.ORGANIZATIONMA) {
  389. return item1
  390. }
  391. })[0].INSTCODE
  392. archcode.push({ id: item.ID, data: { ARCHCODE: "X154-WS・" + (item.ARCHYEAR == null ? sp.currentYear() : item.ARCHYEAR) + "-" + MIJIQIXIAN + "-" + ORGANIZATIONMA + "-" + JIANHAO(item.JIANHAO) } })
  393. }
  394. })
  395. //if (title.length == list.length) {
  396. // sp.dialog(title.join(",") + "已有档号!")
  397. // $timeout(function () {
  398. // sp.dialoghide()
  399. // }, 1500)
  400. // return
  401. //}
  402. var data = {
  403. entity: "DOCELEMENT_ZL",
  404. data: archcode,
  405. columns: "ID,ARCHCODE",
  406. order: "ID"
  407. //setwhere: ids
  408. }
  409. $http.post(apiurljs.login + "g2app/DangAn/UpdataDangHaoBackData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  410. .success(function (obj) {
  411. var res = strToJson(s4.decryptData_CBC(obj.data));
  412. console.log(res)
  413. if (res.success) {
  414. self.list.forEach(function (item) {
  415. res.data.forEach(function (item1) {
  416. if (item.ID == item1.ID) {
  417. item.ARCHCODE = item1.ARCHCODE;
  418. }
  419. })
  420. })
  421. if (title.length == 0) {
  422. sp.dialog("档号生成成功")
  423. $timeout(function () {
  424. sp.dialoghide()
  425. }, 1500)
  426. } else {
  427. sp.dialog(title.join(",") + "已有档号,其他档号生成成功!")
  428. $timeout(function () {
  429. sp.dialoghide()
  430. }, 1500)
  431. }
  432. } else {
  433. sp.dialog(res.message)
  434. }
  435. })
  436. }
  437. }
  438. self.gdz = function () {
  439. var list = [];
  440. self["listTotal" + self.type].forEach(function (item) {
  441. if (item.checked == true) {
  442. list.push(item)
  443. }
  444. })
  445. if (list.length == 0) {
  446. sp.dialog("请选择要生成归档章的案件!");
  447. return;
  448. } else {
  449. }
  450. }
  451. self.hebing = function () {
  452. var itemlist = [];
  453. self["listTotal" + self.type].forEach(function (item) {
  454. if (item.checked == true) {
  455. itemlist.push({ ID: item.ID, NAME: item.DOCTITLE, ROUTEINFOID: item.ROUTEINFOID })
  456. }
  457. })
  458. if (itemlist.length == 0) {
  459. sp.dialog("请选择要合并的案件!");
  460. return;
  461. }
  462. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  463. var dialogBody = "<div class=\"sp-dialog-body\">您确认要合并这些内容吗?</div>";
  464. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='upDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  465. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  466. sp.openCenter(".sp-dialog");
  467. $('.sp-closeDialog').click(function (event) {
  468. sp.dialoghide();
  469. event.preventDefault();
  470. event.stopPropagation();
  471. });
  472. $("#upDataTrue").click(function () {
  473. sp.dialoghide();
  474. var data = {
  475. routeinfoid: itemlist.map(function (item) { return item.ROUTEINFOID }).join(","),
  476. status: self.userId//"1"
  477. }
  478. $http.post(apiurljs.login + "g2app/DangAn/setLockStatus", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  479. .success(function (obj) {
  480. var res = strToJson(s4.decryptData_CBC(obj.data));
  481. if (res.success) {
  482. $.cookie("hebing-itemlist", JSON.stringify(itemlist), { path: '/', expires: 1 });
  483. window.location.href = "hebing.html?lastReturn=list2&lastReturnPageno=" + self.pageno
  484. } else {
  485. sp.dialog(res.message)
  486. }
  487. })
  488. })
  489. }
  490. //编辑已合并的草稿件
  491. self.hbEdti = function (item) {
  492. var data = {
  493. routeinfoid: item.MERGEID,
  494. status: self.userId//"1"
  495. }
  496. $http.post(apiurljs.login + "g2app/DangAn/setLockStatus", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  497. .success(function (obj) {
  498. var res = strToJson(s4.decryptData_CBC(obj.data));
  499. sp.dialoghide();
  500. if (res.success) {
  501. $.cookie("hebingedt-itemlist", JSON.stringify({ MERGEID: item.MERGEID, ROUTEINFOID: item.ROUTEINFOID }), { path: '/', expires: 1 });
  502. window.location.href = "hebingedt.html?lastReturn=list2&lastReturnPageno=" + self.pageno
  503. } else {
  504. sp.dialog(res.message)
  505. }
  506. })
  507. event.stopPropagation()
  508. }
  509. self.toHref = function (html, item, type) {
  510. window.location.href = html + ".html?id=" + item.ID + "&routeinfoid=" + item.ROUTEINFOID + "&lastReturn=list2&lastReturnPageno=" + self.pageno + "&type=" + type;
  511. event.stopPropagation()
  512. }
  513. self.btnSearch = function () {
  514. self.getData(1, self.type)
  515. sp.layerhide()
  516. }
  517. self.closeSeach = function () {
  518. self.search.title = "";
  519. self.search.archyear = sp.currentYear();
  520. self.search.mijiqixian = "10年";
  521. sp.layerhide();
  522. $.cookie("danganList2-search", null, { path: '/', expires: -1 });
  523. self.getData(1, self.type)
  524. };
  525. self.btnReturn = function (n, ID) {
  526. if (n == 1) {
  527. self.back = {
  528. ID: ID,
  529. opinion: "",
  530. }
  531. sp.layer("#backopinion");
  532. } else {
  533. if (self.back.opinion == "") {
  534. sp.dialog("退回意见不能为空!");
  535. return;
  536. }
  537. sp.layerhide();
  538. var data = {
  539. routeinfoid: self.back.ID,
  540. userid: self.userId,
  541. username: self.userName,
  542. backopinion: self.back.opinion
  543. }
  544. $http.post(apiurljs.login + "g2app/DangAn/BackData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  545. .success(function (obj) {
  546. var res = strToJson(s4.decryptData_CBC(obj.data));
  547. if (res.success == true) {
  548. self.getData(1, self.type)
  549. }
  550. })
  551. }
  552. event.stopPropagation()
  553. }
  554. self.Delete = function (routeinfoid) {
  555. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  556. var dialogBody = "<div class=\"sp-dialog-body\">您确认要删除此记录吗?</div>";
  557. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='upDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  558. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  559. sp.openCenter(".sp-dialog");
  560. $('.sp-closeDialog').click(function (event) {
  561. sp.dialoghide();
  562. event.preventDefault();
  563. event.stopPropagation();
  564. });
  565. $("#upDataTrue").click(function () {
  566. sp.dialoghide();
  567. var data = {
  568. routeinfoid: routeinfoid
  569. }
  570. $http.post(apiurljs.login + "g2app/DangAn/deleteBuHuoData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  571. .success(function (obj) {
  572. var res = strToJson(s4.decryptData_CBC(obj.data));
  573. if (res.success) {
  574. self.getData(self.pageno, self.type);
  575. }
  576. })
  577. })
  578. }
  579. //头部下滚冻结
  580. $(function () {
  581. //页面高度撑满
  582. setTimeout(function () {
  583. if ($(".ibox-content").height() < $(window).height() - 31) {
  584. $(".ibox-content").css("height", $(window).height() - 31)
  585. }
  586. }, 1)
  587. })
  588. }])
  589. function QCHB(arr1, arr2, filed) {
  590. return arr1.filter(function (item) {
  591. return arr2.every(function (item1) {
  592. return item[filed] != item1[filed];
  593. })
  594. })
  595. }
  596. function JIANHAO(n) {
  597. if (n < 10) {
  598. return "000" + n;
  599. } else if (n > 10 && n < 100) {
  600. return "00" + n;
  601. } else if (n > 100 && n < 1000) {
  602. return "0" + n;
  603. } else {
  604. return n
  605. }
  606. }