formedit.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. let s4 = new SM4Util();
  2. let detailVue = new Vue({
  3. el: "#detailBox",
  4. data: {
  5. apiurl: apiurl,//基础的页面请求地址
  6. userId: "", //用户id
  7. userName: "", //用户中文名
  8. token: "",
  9. nowTab: "tab1",
  10. routeid: "",
  11. routeinfoid: "",
  12. directionid: "",
  13. formeditid: "",
  14. docmode: "",
  15. dotype: "",
  16. type: "",
  17. routerList: [],
  18. fileList: [],
  19. isEnd: false,
  20. startX: 0,
  21. endX: 0,
  22. deleteSlider: '',//滑动时的效果
  23. WJLX:[],
  24. SFYY:[],
  25. readonly: {
  26. WJBT: false,
  27. YFRQ: false,
  28. WJH: false,
  29. SXRQ: false,
  30. WJLX: false,
  31. FZRQ: false,
  32. SFYY: false,
  33. QLYJ: false,
  34. ZECS: false,
  35. XZBM: false
  36. },
  37. form: {
  38. ID: "", //多一个id
  39. WJBT: "",
  40. YFRQ: "",
  41. WJH: "",
  42. SXRQ: "",
  43. WJLX: "",
  44. WJLX_NAME: "",
  45. FZRQ: "",
  46. SFYY: "",
  47. SFYY_NAME: "",
  48. QLYJ: "",
  49. ZECS: "",
  50. XZBM: ""
  51. },
  52. QLYJ: [],
  53. QLYJEDIT: true,
  54. optionType: "",
  55. optionContent: "",
  56. showSave: false,
  57. buttonList: [],
  58. userList:[],
  59. departList:[]
  60. },
  61. methods: {
  62. dateFtt: (fmt, date) => {
  63. var o = {
  64. "M+": date.getMonth() + 1, //月份
  65. "d+": date.getDate(), //日
  66. "h+": date.getHours(), //小时
  67. "m+": date.getMinutes(), //分
  68. "s+": date.getSeconds(), //秒
  69. "q+": Math.floor((date.getMonth() + 3) / 3), //季度
  70. "S": date.getMilliseconds() //毫秒
  71. };
  72. if (/(y+)/.test(fmt))
  73. fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
  74. for (var k in o)
  75. if (new RegExp("(" + k + ")").test(fmt))
  76. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  77. return fmt;
  78. },
  79. changeTab: (tabCode) => {
  80. _this.nowTab = tabCode;
  81. if (_this.nowTab == "tab1") {
  82. } else if (_this.nowTab == "tab2") {
  83. _this.getFileList();
  84. } else if (_this.nowTab == "tab3") {
  85. _this.getRouterList();
  86. }
  87. },
  88. getRouterList: () => {
  89. _this.routerList = [];
  90. let postData = {
  91. directionid: _this.directionid,
  92. userid: _this.userId,
  93. routeid: _this.routeid,
  94. routeinfoid: _this.routeinfoid,
  95. }
  96. $http({
  97. method: 'post',
  98. baseURL: _this.apiurl,
  99. url: "g2app/abase/queryDataRouteList",
  100. data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
  101. headers: {
  102. 'Content-Type': 'application/json',
  103. 'Authorization': "Bearer " + _this.token
  104. }
  105. }).then(res => {
  106. let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
  107. response.data.forEach(function (item) {
  108. item.mainUser = [];
  109. item.copyUsers = [];
  110. item.isNow = false;
  111. item.USERS.forEach(function (item2) {
  112. if (item2.KIND == 0) {
  113. item.mainUser.push(item2.USERNAME);
  114. } else {
  115. item.copyUsers.push(item2.USERNAME);
  116. }
  117. })
  118. item.NAME = "【" + item.STARTNODENAME + "】转" + "【" + item.ENDNODENAME + "】"
  119. item.mainUser = item.mainUser.join(",");
  120. item.copyUsers = item.copyUsers.join(",");
  121. })
  122. _this.routerList = response.data;
  123. if (_this.routerList[_this.routerList.length - 1].ENDNODENAME == '结束') {
  124. _this.isEnd = true;
  125. _this.routerList[_this.routerList.length - 1].isNow = false;
  126. } else {
  127. _this.routerList[_this.routerList.length - 1].isNow = true;
  128. _this.isEnd = false;
  129. }
  130. })
  131. },
  132. getFileList: () => {
  133. _this.fileList = [];
  134. let postData = {
  135. tablename: "FILE_ATTACH",
  136. colums: "*",
  137. order: "ID desc",
  138. sqlwhere: {ROUTEINFOID: _this.routeinfoid},
  139. sqlinwhere: "",
  140. sqllikewhere: ""
  141. }
  142. $http({
  143. method: 'post',
  144. baseURL: _this.apiurl,
  145. url: "g2app/dataabase/queryDataByCol",
  146. data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
  147. headers: {
  148. 'Content-Type': 'application/json',
  149. 'Authorization': "Bearer " + _this.token
  150. }
  151. }).then(res => {
  152. let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
  153. response.data.forEach(function (item) {
  154. item.deleteSlider = "transform:translateX(0px)";
  155. })
  156. _this.fileList = response.data;
  157. })
  158. },
  159. touchStart(e) {
  160. _this.startX = e.touches[0].clientX;
  161. },
  162. touchEnd(e) {
  163. let index = e.currentTarget.dataset.index;
  164. // 当前滑动的父级元素
  165. _this.endX = e.changedTouches[0].clientX;
  166. // 左滑
  167. if (_this.startX - _this.endX > 30) {
  168. _this.fileList.forEach(function (item) {
  169. item.deleteSlider = "transform:translateX(0px)";
  170. })
  171. _this.fileList[index].deleteSlider = "transform:translateX(-120px)";
  172. }
  173. // 右滑
  174. if (_this.startX - _this.endX < -30) {
  175. _this.fileList.forEach(function (item) {
  176. item.deleteSlider = "transform:translateX(0px)";
  177. })
  178. }
  179. _this.startX = 0;
  180. _this.endX = 0;
  181. },
  182. downLoad: (item) => {
  183. window.open(_this.apiurl + "g2work/files/" + item.FILEURL.slice(7));
  184. },
  185. deleteFile: (item) => {
  186. if (_this.dotype != 0) {
  187. _this.$nextTick(() => {
  188. $.confirm("您确定要删除当前附件吗?", "确认删除?", function () {
  189. let postData = {
  190. tablename: "FILE_ATTACH",
  191. id: item.ID
  192. };
  193. $http({
  194. method: 'post',
  195. baseURL: _this.apiurl,
  196. url: "g2app/dataabase/delDataById",
  197. data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
  198. headers: {
  199. 'Content-Type': 'application/json',
  200. 'Authorization': "Bearer " + _this.token
  201. }
  202. }).then(res => {
  203. let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
  204. if (response.success) {
  205. _this.getFileList();
  206. } else {
  207. $.alert("删除失败,请联系管理员!", "温馨提示");
  208. }
  209. })
  210. }, function () {
  211. //取消操作
  212. });
  213. })
  214. } else {
  215. _this.$nextTick(() => {
  216. $.alert("当前模式下无法删除附件", "温馨提示");
  217. })
  218. }
  219. },
  220. sendBtn: () => {
  221. if (_this.dotype != 0) {
  222. let formData = {};
  223. for (let key in _this.form) {
  224. if (key.indexOf("_NAME") == -1) {
  225. formData[key] = _this.form[key]
  226. }
  227. }
  228. let arrayData = [];
  229. arrayData.push(formData)
  230. let postData = {
  231. ckey: "SX_GFXWJQLDB",
  232. id: _this.form.ID,
  233. routeid: _this.routeid,
  234. routeinfoid: _this.routeinfoid,
  235. routeinfotitle: _this.form.WJBT.replace(/\n/g, '').replace(/\s/g, ''),//self.data.BT,
  236. directionid: _this.directionid,
  237. formeditid: _this.formeditid,
  238. data: JSON.stringify(arrayData)
  239. };
  240. $http({
  241. method: 'post',
  242. baseURL: _this.apiurl,
  243. url: "g2app/abase/saveData",
  244. data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
  245. headers: {
  246. 'Content-Type': 'application/json',
  247. 'Authorization': "Bearer " + _this.token
  248. }
  249. }).then(res => {
  250. let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
  251. if (response.success) {
  252. location.href = "sendedit.html?routeid=" + _this.routeid + "&routeinfoid=" + _this.routeinfoid + "&directionid=" + _this.directionid + "&formeditid=" + _this.formeditid + "&docmode=" + _this.docmode + "&dotype=" + _this.dotype + "&type" + _this.type;
  253. } else {
  254. $.alert("保存表单失败,无法进行转发,请联系管理员!", "温馨提示");
  255. }
  256. })
  257. } else {
  258. _this.$nextTick(() => {
  259. $.alert("当前模式下无法进行转发", "温馨提示");
  260. })
  261. }
  262. },
  263. getItemCodeTable: (tablename) => {
  264. let postData = {
  265. ckey: tablename,
  266. routeinfoid: _this.routeinfoid
  267. }
  268. return $http({
  269. method: 'post',
  270. baseURL: _this.apiurl,
  271. url: "g2app/abase/queryDataCode",
  272. data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
  273. headers: {
  274. 'Content-Type': 'application/json',
  275. 'Authorization': "Bearer " + _this.token
  276. }
  277. })
  278. },
  279. getAllCodeTable: () => {
  280. $http.all([_this.getItemCodeTable('CODE_WJLX'),
  281. _this.getItemCodeTable('CODE_SF')]).then($http.spread((first, second) => {
  282. let response1 = _this.utils.strToJson(s4.decryptData_CBC(first.data.data));
  283. let response2 = _this.utils.strToJson(s4.decryptData_CBC(second.data.data));
  284. _this.WJLX = response1.data.CODE_WJLX;
  285. _this.SFYY = response2.data.CODE_SF;
  286. _this.getFormDetail();
  287. _this.getAllOption();
  288. }))
  289. },
  290. getFormDetail: () => {
  291. let postData = {
  292. ckey: "SX_GFXWJQLDB",
  293. id: 0,
  294. directionid: _this.directionid,
  295. formeditid: _this.formeditid,
  296. routeid: _this.routeid,
  297. routeinfoid: _this.routeinfoid
  298. }
  299. $http({
  300. method: 'post',
  301. baseURL: _this.apiurl,
  302. url: "g2app/abase/queryData",
  303. data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
  304. headers: {
  305. 'Content-Type': 'application/json',
  306. 'Authorization': "Bearer " + _this.token
  307. }
  308. }).then(res => {
  309. let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
  310. //0表单禁用
  311. if (_this.dotype == '0') {
  312. _this.readonly = {
  313. WJBT: true,
  314. YFRQ: true,
  315. WJH: true,
  316. SXRQ: true,
  317. WJLX: true,
  318. FZRQ: true,
  319. SFYY: true,
  320. QLYJ: true,
  321. ZECS: true,
  322. XZBM: true
  323. }
  324. } else {
  325. _this.readonly = {
  326. WJBT: response.data.SX_GFXWJQLDB["WJBT.EREADONLY"] == "true",
  327. YFRQ: response.data.SX_GFXWJQLDB["YFRQ.EREADONLY"] == "true",
  328. WJH: response.data.SX_GFXWJQLDB["WJH.EREADONLY"] == "true",
  329. SXRQ: response.data.SX_GFXWJQLDB["SXRQ.EREADONLY"] == "true",
  330. WJLX: response.data.SX_GFXWJQLDB["WJLX.EREADONLY"] == "true",
  331. FZRQ: response.data.SX_GFXWJQLDB["FZRQ.EREADONLY"] == "true",
  332. SFYY: response.data.SX_GFXWJQLDB["SFYY.EREADONLY"] == "true",
  333. QLYJ: response.data.SX_GFXWJQLDB["QLYJ.EREADONLY"] == "true",
  334. ZECS: response.data.SX_GFXWJQLDB["ZECS.EREADONLY"] == "true",
  335. XZBM: response.data.SX_GFXWJQLDB["XZBM.EREADONLY"] == "true",
  336. }
  337. }
  338. _this.form = {
  339. ID: response.data.SX_GFXWJQLDB.ID,
  340. WJLX: response.data.SX_GFXWJQLDB.WJLX == "" ? _this.WJLX[0].CODE : response.data.SX_GFXWJQLDB.WJLX,
  341. SFYY: response.data.SX_GFXWJQLDB.SFYY == "" ? _this.SFYY[0].CODE : response.data.SX_GFXWJQLDB.SFYY,
  342. YFRQ: (response.data.SX_GFXWJQLDB.YFRQ == "" || response.data.SX_GFXWJQLDB.YFRQ == null || response.data.SX_GFXWJQLDB.YFRQ == undefined) ? _this.utils.datefmt("yyyy-MM-dd", _this.utils.getLocalDate1()) : _this.utils.datefmt("yyyy-MM-dd", response.data.SX_GFXWJQLDB.YFRQ),
  343. SXRQ: (response.data.SX_GFXWJQLDB.SXRQ == "" || response.data.SX_GFXWJQLDB.SXRQ == null || response.data.SX_GFXWJQLDB.SXRQ == undefined) ? _this.utils.datefmt("yyyy-MM-dd", _this.utils.getLocalDate1()) : _this.utils.datefmt("yyyy-MM-dd", response.data.SX_GFXWJQLDB.SXRQ),
  344. FZRQ: (response.data.SX_GFXWJQLDB.FZRQ == "" || response.data.SX_GFXWJQLDB.FZRQ == null || response.data.SX_GFXWJQLDB.FZRQ == undefined) ? _this.utils.datefmt("yyyy-MM-dd", _this.utils.getLocalDate1()) : _this.utils.datefmt("yyyy-MM-dd", response.data.SX_GFXWJQLDB.FZRQ),
  345. WJBT: response.data.SX_GFXWJQLDB.WJBT,
  346. WJH: response.data.SX_GFXWJQLDB.WJH,
  347. QLYJ: response.data.SX_GFXWJQLDB.QLYJ,
  348. ZECS: response.data.SX_GFXWJQLDB.ZECS,
  349. XZBM: response.data.SX_GFXWJQLDB.XZBM
  350. }
  351. if (response.data.SX_GFXWJQLDB.WJLX == "") {
  352. _this.form.WJLX_NAME = _this.WJLX[0].CNAME;
  353. } else {
  354. _this.WJLX.forEach(function (item) {
  355. if (item.CODE == response.data.SX_GFXWJQLDB.WJLX) {
  356. _this.form.WJLX_NAME = item.CNAME;
  357. }
  358. })
  359. }
  360. if (response.data.SX_GFXWJQLDB.SFYY == "") {
  361. _this.form.SFYY_NAME = _this.SFYY[0].CNAME;
  362. } else {
  363. _this.SFYY.forEach(function (item) {
  364. if (item.CODE == response.data.SX_GFXWJQLDB.SFYY) {
  365. _this.form.SFYY_NAME = item.CNAME;
  366. }
  367. })
  368. }
  369. _this.$nextTick(() => {
  370. _this.initInputPlug();
  371. })
  372. })
  373. },
  374. initInputPlug: () => {
  375. $("#YFRQ").calendar({
  376. onChange: function (p, values, displayValues) {
  377. _this.form.YFRQ = values[0];
  378. }
  379. });
  380. $("#SXRQ").calendar({
  381. onChange: function (p, values, displayValues) {
  382. _this.form.SXRQ = values[0];
  383. }
  384. });
  385. $("#FZRQ").calendar({
  386. onChange: function (p, values, displayValues) {
  387. _this.form.FZRQ = values[0];
  388. }
  389. });
  390. let listWJLX = [];
  391. let listSFYY = [];
  392. _this.WJLX.forEach(function (item) {
  393. listWJLX.push(item.CNAME);
  394. })
  395. _this.SFYY.forEach(function (item) {
  396. listSFYY.push(item.CNAME);
  397. })
  398. $("#WJLX").picker({
  399. title: "请选择文件类型",
  400. cols: [
  401. {
  402. textAlign: 'center',
  403. values: listWJLX
  404. }
  405. ],
  406. onChange: function (p, v, dv) {
  407. _this.form.WJLX_NAME = v[0];
  408. _this.WJLX.forEach(function (item) {
  409. if (item.CNAME == v[0]) {
  410. _this.form.WJLX = item.CODE;
  411. }
  412. })
  413. },
  414. });
  415. $("#SFYY").picker({
  416. title: "请选择是否沿用",
  417. cols: [
  418. {
  419. textAlign: 'center',
  420. values: listSFYY
  421. }
  422. ],
  423. onChange: function (p, v, dv) {
  424. _this.form.SFYY_NAME = v[0];
  425. _this.SFYY.forEach(function (item) {
  426. if (item.CNAME == v[0]) {
  427. _this.form.SFYY = item.CODE;
  428. }
  429. })
  430. },
  431. });
  432. },
  433. saveBtn: () => {
  434. if (_this.dotype != 0) {
  435. let formData = {};
  436. for (let key in _this.form) {
  437. if (key.indexOf("_NAME") == -1) {
  438. formData[key] = _this.form[key]
  439. }
  440. }
  441. let arrayData = [];
  442. arrayData.push(formData)
  443. let postData = {
  444. ckey: "SX_GFXWJQLDB",
  445. id: _this.form.ID,
  446. routeid: _this.routeid,
  447. routeinfoid: _this.routeinfoid,
  448. routeinfotitle: _this.form.WJBT.replace(/\n/g, '').replace(/\s/g, ''),//self.data.BT,
  449. directionid: _this.directionid,
  450. formeditid: _this.formeditid,
  451. data: JSON.stringify(arrayData)
  452. };
  453. $http({
  454. method: 'post',
  455. baseURL: _this.apiurl,
  456. url: "g2app/abase/saveData",
  457. data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
  458. headers: {
  459. 'Content-Type': 'application/json',
  460. 'Authorization': "Bearer " + _this.token
  461. }
  462. }).then(res => {
  463. let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
  464. if (response.success) {
  465. $.alert("保存成功!", "温馨提示");
  466. _this.getFormDetail();
  467. } else {
  468. $.alert("保存失败,请联系管理员!", "温馨提示");
  469. }
  470. })
  471. } else {
  472. _this.$nextTick(() => {
  473. $.alert("当前模式下无法进行保存", "温馨提示");
  474. })
  475. }
  476. },
  477. getItemOption: (code) => {
  478. let postData = {
  479. cmanid: _this.userId,
  480. routeinfoid: _this.routeinfoid,
  481. routeid: _this.routeid,
  482. tableid: "SX_GFXWJQLDB",
  483. colid: code
  484. }
  485. return $http({
  486. method: 'post',
  487. baseURL: _this.apiurl,
  488. url: "g2app/abase/queryDataOpinion",
  489. data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
  490. headers: {
  491. 'Content-Type': 'application/json',
  492. 'Authorization': "Bearer " + _this.token
  493. }
  494. })
  495. },
  496. getAllOption: () => {
  497. _this.QLYJ = [];
  498. $http.all([_this.getItemOption('QLYJ')]).then($http.spread((first) => {
  499. let response1 = _this.utils.strToJson(s4.decryptData_CBC(first.data.data));
  500. _this.QLYJ = response1.data;
  501. _this.dealOption('QLYJ');
  502. }))
  503. },
  504. deleteOption: (code) => {
  505. $.confirm("您确定要删除当前意见吗?", "确认删除?", function () {
  506. let postData = {
  507. cmanid: _this.userId,
  508. routeid: _this.routeid,
  509. tableid: "SX_GFXWJQLDB",
  510. colid: code,
  511. };
  512. $http({
  513. method: 'post',
  514. baseURL: _this.apiurl,
  515. url: "g2app/abase/deleteDataOpinion",
  516. data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
  517. headers: {
  518. 'Content-Type': 'application/json',
  519. 'Authorization': "Bearer " + _this.token
  520. }
  521. }).then(res => {
  522. let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
  523. if (response.success) {
  524. _this.getAllOption();
  525. } else {
  526. $.alert("删除失败,请联系管理员!", "温馨提示");
  527. }
  528. })
  529. }, function () {
  530. //取消操作
  531. });
  532. },
  533. editOption: (type, index) => {
  534. _this.optionType = type;
  535. let nowEditObj = _this[type][index];
  536. if (_this.optionType == "") {
  537. $.alert("初始化失败,请联系管理员!", "温馨提示");
  538. } else {
  539. _this.optionContent = nowEditObj.OPINION;
  540. $(".open-popup").eq(0).click();
  541. }
  542. },
  543. addOption: (type) => {
  544. _this.optionType = type;
  545. _this.optionContent = "";
  546. if (_this.optionType == "") {
  547. $.alert("初始化失败,请联系管理员!", "温馨提示");
  548. } else {
  549. $(".open-popup").eq(0).click();
  550. }
  551. },
  552. saveOption: () => {
  553. $(".close-popup").eq(0).click();
  554. let postData = {
  555. cmanid: _this.userId,
  556. routeinfoid: _this.routeinfoid,
  557. routeid: _this.routeid,
  558. tableid: "SX_GFXWJQLDB",
  559. colid: _this.optionType,
  560. opiniontype: 0,
  561. cresult: "",
  562. opinion: _this.optionContent,
  563. opinionimage: ""
  564. };
  565. $http({
  566. method: 'post',
  567. baseURL: _this.apiurl,
  568. url: "g2app/abase/saveDataOpinion",
  569. data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
  570. headers: {
  571. 'Content-Type': 'application/json',
  572. 'Authorization': "Bearer " + _this.token
  573. }
  574. }).then(res => {
  575. let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
  576. if (response.success) {
  577. _this.getAllOption();
  578. } else {
  579. $.alert("删除失败,请联系管理员!", "温馨提示");
  580. }
  581. })
  582. },
  583. getBtnList: () => {
  584. let postData = {
  585. ckey: "SX_GFXWJQLDB",
  586. id: 0,
  587. directionid: _this.directionid,
  588. formeditid: _this.formeditid,
  589. routeid: _this.routeid,
  590. routeinfoid: _this.routeinfoid
  591. }
  592. $http({
  593. method: 'post',
  594. baseURL: _this.apiurl,
  595. url: "g2app/abase/queryData",
  596. data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
  597. headers: {
  598. 'Content-Type': 'application/json',
  599. 'Authorization': "Bearer " + _this.token
  600. }
  601. }).then(res => {
  602. let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
  603. _this.buttonList = _this.dotype == 0 ? [] : response.data["SX_GFXWJQLDB.FUNCLIST"];
  604. _this.buttonList.forEach(function (item) {
  605. if (item.CODE == "SAVEITEM") {
  606. _this.showSave = true;
  607. }
  608. })
  609. })
  610. },
  611. //增补一个函数
  612. dealOption: (key) => {
  613. let num = 0;
  614. let keyEdit = key + "EDIT";
  615. _this[key].forEach(function (item) {
  616. if (item.ROUTEID == _this.routeid) {
  617. num++
  618. }
  619. })
  620. if (num > 0) {
  621. _this[keyEdit] = true;
  622. } else {
  623. _this[keyEdit] = false;
  624. }
  625. },
  626. //拿回主动抄送的部门选项,和加载滚动选项一起执行
  627. getDepartOption: () => {
  628. return $http({
  629. method: 'post',
  630. baseURL: _this.apiurl,
  631. url: "g2app/dataabase/getDpList",
  632. data: {data: s4.encryptData_CBC(JSON.stringify(""))},
  633. headers: {
  634. 'Content-Type': 'application/json',
  635. 'Authorization': "Bearer " + _this.token
  636. }
  637. })
  638. },
  639. },
  640. created: function () {
  641. _this = this;
  642. let token = localStorage.getItem("mobile-token", _this.token);
  643. let userName = localStorage.getItem("mobile-userName", _this.userName);
  644. let userId = localStorage.getItem("mobile-userId", _this.userId);
  645. _this.userId = userId;
  646. _this.token = token;
  647. _this.userName = userName;
  648. _this.routeid = _this.utils.getUrlName("routeid");
  649. _this.routeinfoid = _this.utils.getUrlName("routeinfoid");
  650. _this.directionid = _this.utils.getUrlName("directionid");
  651. _this.formeditid = _this.utils.getUrlName("formeditid");
  652. _this.docmode = _this.utils.getUrlName("docmode");
  653. _this.dotype = _this.utils.getUrlName("dotype");
  654. _this.type = _this.utils.getUrlName("type");
  655. },
  656. mounted: function () {
  657. _this.getAllCodeTable();
  658. _this.getBtnList();
  659. }
  660. })