DealWithProblem.js 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026
  1. var resouceindex = 0;
  2. function ProcessProblem(id, uprop, workid) {
  3. //问题id
  4. this.id = id;
  5. //渠道
  6. this.companyid = null;
  7. //是否显示附加信息0:不显示,1:显示
  8. this.isShowAttInfo = null;
  9. //人员性质
  10. this.userProp = uprop;
  11. //环节id
  12. this.workflowid = workid;
  13. //初始化
  14. this.inits = function (showAtt, IsSupport, Deatil) {
  15. resouceindex = top.ZLPMS.Loading("请稍等,正在加载数据....",0);
  16. var that = this;
  17. this.isShowAttInfo = showAtt; //是否显示附加信息0:不显示,1:显示
  18. this.IsSupport = IsSupport; //1-技术支持 2-项目处理 0-研发处理
  19. this.Deatil = Deatil || {};
  20. if ((that.IsSupport == '1' && $('#rdSubmit').radiobutton('options').checked) || (that.IsSupport == '1' && $('#rdSolve').radiobutton('options').checked)) {
  21. $('#ProblemType').combotreegrid({
  22. required: true
  23. });
  24. }
  25. GetProblemType();
  26. //关闭窗口
  27. $('#btnClose').bind('click', function () {
  28. ZLPMS.CloseTopWindow();
  29. });
  30. //取消受理
  31. $('#btnCancel').bind('click', function () {
  32. ZLPMS.Confirm('您确定要取消受理该问题吗?', 3, function () {
  33. $.ajax({ //取消当前受理
  34. url: '/Problem/CancelReceiveProblem',
  35. data: {
  36. id: that.id
  37. },
  38. method: 'post',
  39. success: function (data) {
  40. if (data.code == 200) { //成功取消关闭当前窗口
  41. ZLPMS.CloseTopWindow(true);
  42. } else { //失败显示原因
  43. ZLPMS.Msg(data.msg);
  44. }
  45. }
  46. });
  47. });
  48. });
  49. $('#cbUser').combobox({
  50. disabled: true
  51. });
  52. //选择指派人员
  53. $('#rdPerson').radiobutton({
  54. onChange: function (checked) {
  55. if (checked) {
  56. $('#cbUser').combobox({
  57. disabled: false,
  58. required: true
  59. });
  60. $('#test').combobox({
  61. required: false
  62. });
  63. $('#BB').combobox({
  64. required: false
  65. });
  66. $('#BBZT').combobox({
  67. required: false
  68. });
  69. } else {
  70. $('#cbUser').combobox({
  71. disabled: true
  72. });
  73. }
  74. }
  75. });
  76. //回退问题
  77. $('#rdBack').radiobutton({
  78. onChange: function (checked) {
  79. $('#test').combobox({
  80. required: false
  81. });
  82. $('#BB').combobox({
  83. required: false
  84. });
  85. $('#BBZT').combobox({
  86. required: false
  87. });
  88. }
  89. });
  90. //红黑榜
  91. $('#rdNo').radiobutton({
  92. onChange: function (checked) {
  93. $('#tbContent').textbox('setValue', "");
  94. $('#tbContent').textbox('textbox').attr('readonly', true);
  95. }
  96. });
  97. //红黑榜
  98. $('#rdRed').radiobutton({
  99. onChange: function (checked) {
  100. $('#tbContent').textbox('textbox').attr('readonly', false);
  101. }
  102. });
  103. //红黑榜
  104. $('#rdBlack').radiobutton({
  105. onChange: function (checked) {
  106. $('#tbContent').textbox('textbox').attr('readonly', false);
  107. }
  108. });
  109. //加载以前的处理描述
  110. $('#rdDeal').radiobutton({
  111. onChange: function (checked) {
  112. var t = $('#rdSolve').radiobutton('options').checked;
  113. var content = UM.getEditor('tbRemark').getContent();
  114. if (!content) {
  115. if (checked) {
  116. UM.getEditor('tbRemark').setContent(that.Deatil.DealDetail, false);
  117. } else if (!checked && !t) {
  118. UM.getEditor('tbRemark').setContent('');
  119. }
  120. }
  121. $('#test').combobox({
  122. required: false
  123. });
  124. $('#BB').combobox({
  125. required: false
  126. });
  127. $('#BBZT').combobox({
  128. required: false
  129. });
  130. }
  131. });
  132. //加载指派人员
  133. $('#cbUser').combobox({
  134. url: '/MobileProblem/GetDistribuPerson',
  135. queryParams: {
  136. search: "",
  137. problemId: this.id
  138. },
  139. valueField: 'ID',
  140. textField: '姓名',
  141. groupField: '公司名称',
  142. limitToList: true,
  143. formatter: function (row) {
  144. return row.姓名 + '【' + (row.职务 == null ? '无' : row.职务) + '】';
  145. },
  146. filter: function (q, row) {
  147. var opts = $(this).combobox('options');
  148. return row[opts.textField].indexOf(q) > -1 || row.简码.indexOf(q.toUpperCase()) > -1;
  149. }
  150. });
  151. //选择向上提交的人员
  152. if (this.IsSupport == '1') {
  153. $("#isSupport").css('display', 'inline-block');
  154. $('#rdSubmit').radiobutton({
  155. onChange: function (checked) {
  156. if (checked) {
  157. $('#cbSubUser').combobox({
  158. disabled: false,
  159. required: true
  160. });
  161. $('#test').combobox({
  162. required: false
  163. });
  164. $('#BB').combobox({
  165. required: false
  166. });
  167. $('#BBZT').combobox({
  168. required: false
  169. });
  170. } else {
  171. $('#cbSubUser').combobox({
  172. disabled: true
  173. });
  174. }
  175. }
  176. });
  177. //加载提交人员
  178. $('#cbSubUser').combobox({
  179. url: "/PersonManager/GetPersonByJob?Nature=1&job=10,11",
  180. valueField: 'ID',
  181. textField: '姓名',
  182. limitToList: true,
  183. formatter: function (row) {
  184. return row.姓名 + '【' + (row.职务 == null ? '无' : row.职务) + '】';
  185. }
  186. });
  187. }
  188. //确定按钮事件
  189. $('#btnFinish').bind('click', function () {
  190. index = ZLPMS.Loading3(1);
  191. debugger
  192. var r = $("#form1").form('validate');
  193. if (!r) {
  194. top.ZLPMS.Msg("请注意必填选项!", 2)
  195. //验证不通过
  196. ZLPMS.UnLoading(index);
  197. } else {
  198. //验证通过
  199. var obj = that.GetPara();
  200. ZLPMS.UnLoading(index);
  201. var index = null;
  202. var obj = that.GetPara();
  203. $.post('/Problem/ExecuteProcessData', obj, function (data) {
  204. if (data.code == 200) { //关闭当前页面
  205. top.ZLPMS.Msg('完成处理');
  206. document.getElementById("btn_upload").click();
  207. var obj = that.GetPara();
  208. //若选择了多处理版本
  209. if (obj.NewVersion != undefined && obj.NewVersion.length > 0 && obj.NewVersion[0].length > 0) {
  210. for (var i = 0; i < obj.NewVersion.length;) {
  211. $.ajax({ //取消当前受理
  212. url: '/Problem/SaveVersion',
  213. data: { pid: obj.ProblemID, version: obj.NewVersion[i] },
  214. method: 'post',
  215. async: false,
  216. success: function (data) {
  217. if (data == 1) {
  218. i++
  219. top.ZLPMS.Msg("保存成功!", 1)
  220. } else {
  221. top.ZLPMS.Msg("生成多版本处理失败!", 2)
  222. }
  223. }
  224. });
  225. }
  226. }
  227. } else {
  228. top.ZLPMS.Msg(data.msg);
  229. }
  230. ZLPMS.CloseTopWindow(true);
  231. })
  232. }
  233. });
  234. //绑定一键回退按钮
  235. $('#rdBackStart').radiobutton({
  236. onChange: function (checked) {
  237. if (checked) {
  238. $('#cbBackHj').combobox({
  239. disabled: false
  240. });
  241. $('#cbBackUser').combobox({
  242. disabled: false
  243. });
  244. $('#test').combobox({
  245. required: false
  246. });
  247. $('#BB').combobox({
  248. required: false
  249. });
  250. $('#BBZT').combobox({
  251. required: false
  252. });
  253. }
  254. else {
  255. $('#cbBackHj').combobox({
  256. disabled: true
  257. });
  258. $('#cbBackUser').combobox({
  259. disabled: true
  260. });
  261. }
  262. }
  263. });
  264. //一键回退加载项目流程
  265. $('#cbBackHj').combobox({
  266. data: [{
  267. "ID": "3",
  268. "名称": "项目处理"
  269. }, {
  270. "ID": "4",
  271. "名称": "技术支持处理"
  272. }],
  273. valueField: 'ID',
  274. textField: '名称',
  275. onChange: function (cur, old) {
  276. var Nature = 2;//性质1本部、2渠道人员,
  277. var job = "3,4";//3项目经理、4实施人员,12技术支持
  278. if (cur == 4) {
  279. Nature = 1;
  280. job = "12";
  281. }
  282. $.ajax({
  283. url: '/PersonManager/GetPersonByJob?Nature=' + Nature + '&job=' + job,
  284. data: {
  285. id: that.id
  286. },
  287. method: 'post',
  288. success: function (data) {
  289. $("#cbBackUser").combobox('clear')
  290. $("#cbBackUser").combobox('loadData', data)
  291. }
  292. });
  293. }
  294. });
  295. if (that.workflowid == 5) { //如果是研发环节则不再向上提交
  296. $('#rdSubmit').radiobutton('disable');
  297. $("#isSupport").css('display', 'none');
  298. }
  299. if (that.workflowid > 3 && that.userProp != 1) { //如果环节ID>3表示,技术支持或研发,而人员性质不为1则表示非中联本部人员,则不允许再次提交
  300. $('#btnSubmit').remove();
  301. $('#lbsubmit').remove(); //隐藏相关文本
  302. }
  303. if (showAtt == '0') { //隐藏附加信息的面板
  304. $('#tabMyprocess').tabs('close', 2);
  305. }
  306. //版本
  307. $("#BB").combobox({
  308. url: '/Problem/GetVersionById?id=' + id + "&type=1",
  309. valueField: 'ID',
  310. textField: '版本号',
  311. required: true,
  312. onChange: function (cur, old) {
  313. if (cur.length == 0) {
  314. $("#BBZT").combobox("setValue", '')
  315. }
  316. var list = $("#BB").combobox('getData')
  317. list = list.filter(x => x.ID != cur)
  318. //多版本处理
  319. $("#Version").combobox('loadData', list)
  320. //$('#BBZT').combobox({
  321. // required: true
  322. //});
  323. }
  324. });
  325. $("#BBZT").combobox({
  326. url: "/Problem/GetBaseCode?type=35DB8B88-36B5-49FE-A879-D49DB88BC03B",
  327. valueField: '代码',
  328. textField: '显示名',
  329. required: true,
  330. onChange: function (cur, old) {
  331. }
  332. });
  333. //加载测试处理人
  334. $('#test').combobox({
  335. url: '/MobileProblem/GetDistribuPerson',
  336. queryParams: {
  337. search: "",
  338. problemId: this.id
  339. },
  340. valueField: 'ID',
  341. textField: '姓名',
  342. groupField: '公司名称',
  343. limitToList: true,
  344. required: true,
  345. formatter: function (row) {
  346. return row.姓名 + '【' + (row.职务 == null ? '无' : row.职务) + '】';
  347. },
  348. filter: function (q, row) {
  349. var opts = $(this).combobox('options');
  350. return row[opts.textField].indexOf(q) > -1 || row.简码.indexOf(q.toUpperCase()) > -1;
  351. }
  352. });
  353. ///产品问题
  354. $('#rdProc').radiobutton({
  355. onChange: function (checked) {
  356. if (checked) {
  357. //解决版本
  358. $('#BB').combobox({
  359. required: true,
  360. readonly: false,
  361. });
  362. $('#test').combobox({
  363. required: true,
  364. readonly: false,
  365. });
  366. $('#BBZT').combobox({
  367. required: true,
  368. readonly: false,
  369. });
  370. }
  371. }
  372. });
  373. ///项目问题
  374. $('#rdItem').radiobutton({
  375. onChange: function (checked) {
  376. if (checked) {
  377. //解决版本
  378. $('#BB').combobox({
  379. required: false,
  380. readonly: true,
  381. setValue: ""
  382. });
  383. $('#test').combobox({
  384. required: false,
  385. readonly: true,
  386. setValue: ""
  387. });
  388. $('#BBZT').combobox({
  389. required: false,
  390. readonly: true,
  391. setValue: ""
  392. });
  393. }
  394. }
  395. });
  396. //加载问题信息
  397. $.ajax({
  398. url: '/Problem/CheckProblem',
  399. data: {
  400. id: this.id
  401. },
  402. method: 'post',
  403. success: function (data) {
  404. sessionStorage.setItem("WTID", data[0].ID);
  405. //首次加载时问题归类是否显示
  406. if (that.IsSupport == '1' || that.IsSupport == '2') {
  407. GetProblemType();
  408. }
  409. //附件记录(附件id|文件类型,1:图像,2:其它)
  410. var attach_ids = data[0].附件
  411. if (attach_ids != null) { //包括了附件
  412. var ids = attach_ids.split(',');
  413. var imghtml = '';
  414. for (var i = 0; i < ids.length; i++) {
  415. var imgid = ids[i].split('|');
  416. var id = imgid[0];
  417. var ft = imgid[1];
  418. if (ft == '1') { //图像类型,显示缩略图 o原图,s缩略图,m大图
  419. imghtml += '<a href="#" onclick="OpenImage(' + id + ')"><img src="/Problem/ViewProblemImage?id=' + id + '&type=s" class="img"/></a>&nbsp;';
  420. } else { //非图像类型,显示下载附件
  421. imghtml += '<a href="#" onclick="downloadfile(' + id + ')">下载附件' + (i + 1) + '</a>';
  422. }
  423. }
  424. //添加附件html
  425. $('#attach').html(imghtml);
  426. }
  427. //放大图片
  428. var img = $('#content').find("img");
  429. if (img) {
  430. img.bind("click", function () {
  431. var src = $(this).attr("src")
  432. top.ZLPMS.OpenNewWindow("查看图片", "/Problem/ViewImg?src=" + src, "850px", "620px")
  433. })
  434. }
  435. //绑定解决问题按钮
  436. $('#rdSolve').radiobutton({
  437. onChange: function (checked) {
  438. var t = $('#rdDeal').radiobutton('options').checked;
  439. var content = UM.getEditor('tbRemark').getContent();
  440. if (!content) {
  441. if (checked) {
  442. UM.getEditor('tbRemark').setContent(that.Deatil.SolveDetail, false);
  443. } else if (!checked && !t) {
  444. UM.getEditor('tbRemark').setContent('');
  445. }
  446. }
  447. if (that.IsSupport == '1' || that.IsSupport == '2') {
  448. //绑定是否选择问题归类
  449. if (checked) {
  450. $("#PROBLEMTYEP").show();//技术支持和项目默认显示问题归类
  451. if (that.IsSupport == '1') {
  452. $('#ProblemType').combotreegrid({
  453. required: true
  454. });
  455. }
  456. GetProblemType();
  457. } else {
  458. $("#PROBLEMTYEP").hide();
  459. $('#ProblemType').combotreegrid({
  460. required: false,
  461. });
  462. }
  463. }
  464. $('#test').combobox({
  465. required: true
  466. });
  467. $('#BB').combobox({
  468. required: true
  469. });
  470. $('#BBZT').combobox({
  471. required: true
  472. });
  473. }
  474. });
  475. //绑定终止按钮
  476. $('#rdStop').radiobutton({
  477. onChange: function (checked) {
  478. //绑定是否选择问题归类
  479. if (checked) {
  480. $("#PROBLEMTYEP").show();//技术支持和项目默认显示问题归类
  481. if (that.IsSupport == '1') {
  482. $('#ProblemType').combotreegrid({
  483. required: true
  484. });
  485. }
  486. GetProblemType();
  487. } else {
  488. $("#PROBLEMTYEP").hide();
  489. $('#ProblemType').combotreegrid({
  490. required: false,
  491. });
  492. }
  493. $('#test').combobox({
  494. required: false
  495. });
  496. $('#BB').combobox({
  497. required: false
  498. });
  499. $('#BBZT').combobox({
  500. required: false
  501. });
  502. }
  503. });
  504. //向上提交
  505. $('#rdSubmit').radiobutton({
  506. onChange: function (checked) {
  507. if (that.IsSupport == '1' || that.IsSupport == '2') {
  508. //绑定是否选择问题归类
  509. if (checked) {
  510. if (that.IsSupport == '1') {
  511. $('#cbSubUser').combobox({
  512. disabled: false,
  513. required: true
  514. });
  515. $("#PROBLEMTYEP").show();//技术支持和项目默认显示问题归类
  516. $('#ProblemType').combotreegrid({
  517. required: true,
  518. });
  519. GetProblemType();
  520. }
  521. } else {
  522. $("#PROBLEMTYEP").hide();
  523. $('#ProblemType').combotreegrid({
  524. required: false,
  525. });
  526. if (that.IsSupport == '1') {
  527. $('#cbSubUser').combobox({
  528. disabled: true
  529. });
  530. }
  531. }
  532. }
  533. $('#test').combobox({
  534. required: false
  535. });
  536. $('#BB').combobox({
  537. required: false
  538. });
  539. }
  540. });
  541. //加载资源信息
  542. $('#resource').datagrid({
  543. toolbar: '#btn_func',
  544. singleSelect: true,
  545. url: '/Problem/ResourceData?proid=' + data[0].ID,
  546. fit: true,
  547. columns: [
  548. [{
  549. field: 'DECODE类型',
  550. title: '类型',
  551. width: 100
  552. },
  553. {
  554. field: '内容',
  555. width: 516,
  556. title: '内容',
  557. minWdith: 516
  558. },
  559. {
  560. field: '资源ID',
  561. title: '资源ID',
  562. width: 220,
  563. minWdith: 220
  564. },
  565. {
  566. field: '添加时间',
  567. title: '添加时间',
  568. width: 142,
  569. }
  570. ]
  571. ],
  572. onClickRow: function (index, data) {
  573. sessionStorage.setItem("WTID", data.问题ID);
  574. sessionStorage.setItem("ID", data.ID);
  575. sessionStorage.setItem("资源ID", data.资源ID);
  576. sessionStorage.setItem("类型", data.类型);
  577. sessionStorage.setItem("内容", data.内容);
  578. sessionStorage.setItem("序号", data.序号);
  579. sessionStorage.setItem("实例类型", data.实例类型);
  580. }
  581. })
  582. $('#code').text(data[0].编号);
  583. $('#property').text(data[0].问题性质);
  584. $('#company').text(data[0].渠道);
  585. $('#project').text(data[0].项目);
  586. $('#org').text(data[0].机构);
  587. $('#productAndVersion').text(data[0].产品 + '/' + data[0].版本号);
  588. $('#module').text(data[0].模块);
  589. $('#prior').text(data[0].紧急代码);
  590. var priordate = data[0].要求时间 == null ? '无' : data[0].要求时间;
  591. $('#priordate').text(priordate);
  592. var priordesc = data[0].紧急描述 == null ? '无' : data[0].紧急描述;
  593. $('#priorDesc').text(priordesc);
  594. var feedback = data[0].反馈人 == null ? '无' : data[0].反馈人;
  595. $('#feedbackAndRegisterPerson').text(feedback + '/' + data[0].登记人);
  596. $('#registertime').text(data[0].登记日期);
  597. $('#title').text(data[0].问题标题);
  598. $('#content').html(data[0].问题描述);
  599. data[0].问题类型 == 2 ? $('#rdProc').radiobutton({ checked: true }) : 1
  600. //其他信息
  601. if (data[0].红黑榜 == 1) {
  602. $('#rdRed').radiobutton({ checked: true })
  603. $('#tbContent').textbox('textbox').attr('readonly', false);
  604. }
  605. else if (data[0].红黑榜 == 2) {
  606. $('#rdBlack').radiobutton({ checked: true })
  607. $('#tbContent').textbox('textbox').attr('readonly', false);
  608. }
  609. $('#tbContent').textbox('setValue', data[0].红黑榜理由)
  610. $('#BB').combobox('setValue', data[0].解决版本ID)
  611. $('#BBZT').combobox('setValue', data[0].解决版本状态)
  612. data[0].是否发布 == 1 ? $('#ckIsRelease').checkbox({ checked: true }) : 1
  613. data[0].需要培训 == 1 ? $('#ckIsTrain').checkbox({ checked: true }) : 1
  614. data[0].常见问题 == 1 ? $('#ckIsOften').checkbox({ checked: true }) : 1
  615. data[0].项目个性化 == 1 ? $('#identify').checkbox({ checked: true }) : 1
  616. $('#tbBHNumber').textbox('setValue', data[0].bh编号)
  617. data[0].修改说明 == null ? null : UM.getEditor('tbAlterRemark').setContent(data[0].修改说明);
  618. $('#tbUpgrateRemark').textbox('setValue', data[0].升级说明)
  619. $('#tbBHNumber').textbox('setValue', data[0].BH编号)
  620. $('#tbBHVersion').textbox('setValue', data[0].BH版本)
  621. }
  622. });
  623. //获取用户录入内容(正常处理)
  624. this.GetPara = function () {
  625. var para = {};
  626. //问题ID
  627. para.ProblemID = this.id;
  628. //是否指派人员
  629. var IsAssign = $('#rdPerson').radiobutton('options').checked;
  630. //指派人员名称
  631. var AssignName = $('#cbUser').combobox('getText');
  632. var AssignID = $('#cbUser').combobox('getValue');
  633. //处理问题
  634. var IsDeal = $('#rdDeal').radiobutton('options').checked;
  635. //是否解决
  636. var IsSolve = $('#rdSolve').radiobutton('options').checked;
  637. //是否终止问题
  638. var IsStop = $('#rdStop').radiobutton('options').checked;
  639. //是否回退
  640. var IsBack = $('#rdBack').radiobutton('options').checked;
  641. //一键回退
  642. var IsBackStart = $('#rdBackStart').radiobutton('options').checked;
  643. //如果一键回退流程选择的是技术支持处理,直接走回退问题流程。如果走项目处理。就多级回退
  644. var BackHj = $('#cbBackHj').combobox('getValue');
  645. if (BackHj == 4) {
  646. IsBackStart = false;
  647. IsBack = true;
  648. }
  649. //向上提交
  650. var IsCommit = $('#rdSubmit').radiobutton('options').checked;
  651. //提交人员名称
  652. var SubName = $('#cbSubUser').combobox('getText');
  653. var SubID = $('#cbSubUser').combobox('getValue');
  654. //处理说明
  655. var ProcessRemark = escape(UM.getEditor('tbRemark').getContent());
  656. //红黑榜
  657. para.RedBlack = 0;
  658. para.RedBlackContent = $('#tbContent').combobox('getText');
  659. var rdRed = $('#rdRed').radiobutton('options').checked;
  660. if (rdRed) {
  661. para.RedBlack = 1;
  662. }
  663. var rdBlack = $('#rdBlack').radiobutton('options').checked;
  664. if (rdBlack) {
  665. para.RedBlack = 2;
  666. }
  667. //添加到对象中
  668. para.IsAssign = IsAssign;
  669. para.AssignName = AssignName;
  670. para.AssignID = AssignID;
  671. para.SubName = SubName;
  672. para.SubID = SubID;
  673. para.IsDeal = IsDeal;
  674. para.IsSolve = IsSolve;
  675. para.ProblemTypeID = $('#ProblemType').combotreegrid('getValue');
  676. para.IsStop = IsStop;
  677. para.IsBack = IsBack;
  678. para.IsBackStart = IsBackStart;
  679. para.IsCommit = IsCommit;
  680. para.ProcessRemark = ProcessRemark; //处理说明
  681. para.IsAttInfo = (this.isShowAttInfo != '0') ? true : false;
  682. // 1:产品 2:项目
  683. if (this.isShowAttInfo != '0') {
  684. //显示了附加信息(技术支持或研发处理)
  685. var IsItem = $('#rdItem').radiobutton('options').checked;
  686. var SolveVersion = $('#BB').combobox('getText'); //解决版本
  687. var VersionID = $('#BB').combobox('getValue'); //解决版本id
  688. var SolveVersionstate = $('#BBZT').combobox('getValue'); //解决版本状态
  689. var NewVersion = $('#Version').combobox('getValues'); //多解决版本
  690. var IsRelease = $('#ckIsRelease').checkbox('options').checked; //是否发布
  691. var BHNumber = $('#tbBHNumber').textbox('getValue'); //BH版本号
  692. var IsOften = $('#ckIsOften').checkbox('options').checked; //是否常见问题
  693. var Identify = $('#identify').checkbox('options').checked; //项目个性化
  694. var BHVersion = $('#tbBHVersion').textbox('getValue'); //BH版本号
  695. var IsTrain = $('#ckIsTrain').checkbox('options').checked; //是否需要培训
  696. var AlterRemark = escape(UM.getEditor('tbAlterRemark').getContent());//修改说明
  697. var UpgrateRemark = $('#tbUpgrateRemark').textbox('getValue'); //升级说明
  698. //测试人员id
  699. var TestPeronId = $('#test').combobox('getValue');
  700. //添加扩展的json
  701. para.IsItem = IsItem;
  702. para.SolveVersion = SolveVersion;
  703. para.SolveVersionstate = SolveVersionstate;
  704. para.NewVersion = NewVersion;
  705. para.IsRelease = IsRelease;
  706. para.BHNumber = BHNumber;
  707. para.IsOften = IsOften;
  708. para.BHVersion = BHVersion;
  709. para.IsTrain = IsTrain;
  710. para.AlterRemark = AlterRemark;
  711. para.UpgrateRemark = UpgrateRemark;
  712. para.Identify = Identify
  713. para.TestPeronId = TestPeronId;
  714. para.VersionID = VersionID;
  715. }
  716. return para;
  717. }
  718. }
  719. }
  720. //查看附件大图
  721. function OpenImage(id) {
  722. top.ZLPMS.OpenNewWindow(null, '/SysCom/ImageView?id=' + id + '&type=m', '70%', '80%');
  723. }
  724. //下载附件文件
  725. function downloadfile(id) {
  726. window.open('/Problem/ViewProblemImage?id=' + id);
  727. }
  728. function addfiles() {
  729. var guid = new GUID();
  730. var id = guid.newGUID();
  731. var fileIn = '<input type="file" id="f_' + id + '" name="f_' + id + '" />';
  732. var html = '<div id=' + id + '>' + fileIn + ' <a href="#" onclick="fileRemove(\'' + id + '\')" style="color:red">移除</a></br></div>';
  733. $('#files').append(html);
  734. //$('#f_' + id).trigger('click');
  735. }
  736. //移除选择的附加文件
  737. function fileRemove(val) {
  738. $('#' + val).remove();
  739. }
  740. function GUID() {
  741. this.date = new Date(); /* 判断是否初始化过,如果初始化过以下代码,则以下代码将不再执行,实际中只执行一次 */
  742. if (typeof this.newGUID != 'function') {
  743. /* 生成GUID码 */
  744. GUID.prototype.newGUID = function () {
  745. this.date = new Date();
  746. var guidStr = '';
  747. sexadecimalDate = this.hexadecimal(this.getGUIDDate(), 16);
  748. sexadecimalTime = this.hexadecimal(this.getGUIDTime(), 16);
  749. for (var i = 0; i < 9; i++) {
  750. guidStr += Math.floor(Math.random() * 16).toString(16);
  751. }
  752. guidStr += sexadecimalDate;
  753. guidStr += sexadecimalTime;
  754. while (guidStr.length < 32) {
  755. guidStr += Math.floor(Math.random() * 16).toString(16);
  756. }
  757. return this.formatGUID(guidStr);
  758. }
  759. /* * 功能:获取当前日期的GUID格式,即8位数的日期:19700101 * 返回值:返回GUID日期格式的字条串 */
  760. GUID.prototype.getGUIDDate = function () {
  761. return this.date.getFullYear() + this.addZero(this.date.getMonth() + 1) + this.addZero(this.date.getDay());
  762. }
  763. /* * 功能:获取当前时间的GUID格式,即8位数的时间,包括毫秒,毫秒为2位数:12300933 * 返回值:返回GUID日期格式的字条串 */
  764. GUID.prototype.getGUIDTime = function () {
  765. return this.addZero(this.date.getHours()) + this.addZero(this.date.getMinutes()) + this.addZero(this.date.getSeconds()) + this.addZero(parseInt(this.date.getMilliseconds() / 10));
  766. }
  767. /* * 功能: 为一位数的正整数前面添加0,如果是可以转成非NaN数字的字符串也可以实现 * 参数: 参数表示准备再前面添加0的数字或可以转换成数字的字符串 * 返回值: 如果符合条件,返回添加0后的字条串类型,否则返回自身的字符串 */
  768. GUID.prototype.addZero = function (num) {
  769. if (Number(num).toString() != 'NaN' && num >= 0 && num < 10) {
  770. return '0' + Math.floor(num);
  771. } else {
  772. return num.toString();
  773. }
  774. }
  775. /* * 功能:将y进制的数值,转换为x进制的数值 * 参数:第1个参数表示欲转换的数值;第2个参数表示欲转换的进制;第3个参数可选,表示当前的进制数,如不写则为10 * 返回值:返回转换后的字符串 */
  776. GUID.prototype.hexadecimal = function (num, x, y) {
  777. if (y != undefined) {
  778. return parseInt(num.toString(), y).toString(x);
  779. } else {
  780. return parseInt(num.toString()).toString(x);
  781. }
  782. }
  783. /* * 功能:格式化32位的字符串为GUID模式的字符串 * 参数:第1个参数表示32位的字符串 * 返回值:标准GUID格式的字符串 */
  784. GUID.prototype.formatGUID = function (guidStr) {
  785. var str1 = guidStr.slice(0, 8) + '-',
  786. str2 = guidStr.slice(8, 12) + '-',
  787. str3 = guidStr.slice(12, 16) + '-',
  788. str4 = guidStr.slice(16, 20) + '-',
  789. str5 = guidStr.slice(20);
  790. return str1 + str2 + str3 + str4 + str5;
  791. }
  792. }
  793. }
  794. //加载问题分类
  795. function GetProblemType() {
  796. $('#ProblemType').combotreegrid({
  797. width: '200px',
  798. panelWidth: 680,
  799. panelHeight: 200,
  800. prompt: '选择问题分类',
  801. url: '/ClassifyManage/GetTreeGrid',
  802. method: 'GET',
  803. idField: 'ID',
  804. treeField: '名称',
  805. editable: true,
  806. columns: [
  807. [{
  808. field: '编码',
  809. title: '编码',
  810. width: 55,
  811. align: 'center'
  812. },
  813. {
  814. field: '名称',
  815. title: '名称',
  816. width: 170,
  817. align: 'center'
  818. },
  819. {
  820. field: '说明',
  821. title: '说明',
  822. width: 380,
  823. align: 'center',
  824. halign: 'center',
  825. formatter: function (value, row, index) {
  826. var content = '';
  827. var abValue = value + '';
  828. if (value != undefined) {
  829. if (value.length >= 22) {
  830. abValue = value.substring(0, 19) + "...";
  831. content = '<a href="javascript:;" title="' + value + '" class="easyui-tooltip">' + abValue + '</a>';
  832. } else {
  833. content = '<a href="javascript:;" title="' + abValue + '" class="easyui-tooltip">' + abValue + '</a>';
  834. }
  835. }
  836. return content;
  837. }
  838. },
  839. //{
  840. // field: '分值',
  841. // title: '分值',
  842. // width: 70,
  843. // align: 'center',
  844. // halign: 'center',
  845. // formatter: function (val, row, index) {
  846. // return (val || 0) + "分";
  847. // }
  848. //}
  849. ]
  850. ],
  851. onLoadSuccess: function (row, data) {
  852. top.ZLPMS.UnLoading(resouceindex);
  853. $("#PROBLEMTYEP").show();
  854. }
  855. });
  856. }
  857. function remarkFormater(value, row, index) {
  858. alert("value=" + value + " index=" + index);
  859. var content = '';
  860. var abValue = value + '';
  861. if (value != undefined) {
  862. if (value.length >= 22) {
  863. abValue = value.substring(0, 19) + "...";
  864. content = '<a href="javascript:;" title="' + value + '" class="easyui-tooltip">' + abValue + '</a>';
  865. } else {
  866. content = '<a href="javascript:;" title="' + abValue + '" class="easyui-tooltip">' + abValue + '</a>';
  867. }
  868. }
  869. return content;
  870. }
  871. //新增资源
  872. function Add_Resource() {
  873. top.ZLPMS.OpenWindow({
  874. title: '资源编辑',
  875. url: "/Problem/ResourceWindow?type=0" + "&version=1",
  876. area: ['600px', '650px'],
  877. yes: function (index, layero) {
  878. var iframeWin = top.window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:
  879. iframeWin.Forms.PostData(index, layero, $("#resource")); //调用子页面的方法,得到子页面返回的ids
  880. },
  881. });
  882. }
  883. //删除资源
  884. function Delete_Resource() {
  885. var data = $("#resource").datagrid("getSelected");
  886. if (data == null) {
  887. top.ZLPMS.Msg("请选择一条记录", 3);
  888. return false
  889. }
  890. top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
  891. //执行删除
  892. $.post("/Problem/DelResource?id=" + data.ID, function (data) {
  893. if (data == 1) {
  894. $('#resource').datagrid('reload');
  895. top.ZLPMS.Msg("删除成功");
  896. } else {
  897. top.ZLPMS.Msg("删除失败");
  898. }
  899. })
  900. });
  901. }
  902. //修改资源
  903. function Update_Resource() {
  904. var data = $("#resource").datagrid("getSelected");
  905. if (data == null) {
  906. top.ZLPMS.Msg("请选择一条记录", 3);
  907. return false
  908. }
  909. top.ZLPMS.OpenWindow({
  910. title: '资源编辑',
  911. url: "/Problem/ResourceWindow?type=1" + "&version=1",
  912. area: ['600px', '650px'],
  913. yes: function (index, layero) {
  914. var iframeWin = top.window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:
  915. iframeWin.Forms.PostData(index, layero, $("#resource")); //调用子页面的方法,得到子页面返回的ids
  916. }
  917. });
  918. }
  919. //提交请求
  920. var Forms = {
  921. PostData: function (index, layero, obj) {
  922. //执行提交验证
  923. var r = $('#edit_resource').form('validate');
  924. if (r) { //post到后台
  925. var param = ZLPMS.FormToObject('edit_resource');
  926. if (param.LX == null) { top.ZLPMS.Msg("请选择资源类型", 4); return false }
  927. if (param.SL == null) { top.ZLPMS.Msg("请选择实例类型", 4); return false }
  928. $.post('/Problem/SaveResource', param, function (data) {
  929. if (data == 1) {
  930. obj.datagrid("reload");
  931. top.ZLPMS.Msg("保存成功", 1);
  932. } else {
  933. top.ZLPMS.Msg("保存失败,请联系管理员", 2);
  934. }
  935. if (param.continue != "on") {
  936. top.ZLPMS.CloseWindow(index);
  937. } else {
  938. //不关闭 值刷新当前页面
  939. window.location.reload()
  940. }
  941. });
  942. }
  943. }
  944. };