projectproblem.index.js 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504
  1. var problemlObj = {
  2. ProblemID: undefined,
  3. CPID: undefined,
  4. XMID: undefined,
  5. PersonProperty: undefined,
  6. Choose: undefined,
  7. Count: 0,
  8. Data: undefined
  9. }
  10. function viewModel(View) {
  11. var that = this;
  12. this.View = View || 'project';
  13. //当前默认的环节点
  14. var currentWorkFlowId = "";
  15. if (RYXZ == 1) { //中联本部人员(默认技术支持处理)
  16. currentWorkFlowId = 4;
  17. } else if (RYXZ == 2) { //中联渠道人员(默认查询项目处理问题)
  18. currentWorkFlowId = 3;
  19. } else if (RYXZ == 3) { //中联产品操作人员(默认显示机构处理)
  20. currentWorkFlowId = 1;
  21. } else if (RYXZ == 4) { //医院管理员(显示卫计委处理)
  22. currentWorkFlowId = 2;
  23. } else { //默认显示项目处理
  24. currentWorkFlowId = 3;
  25. }
  26. //初始化所有组件
  27. this.inits = function (val) {
  28. if (val != undefined) {
  29. currentWorkFlowId = val;
  30. } else {
  31. //currentWorkFlowId = 3;//加载项目人员问题
  32. currentWorkFlowId = false;
  33. }
  34. //获取相关的下拉列表控件值
  35. com.GetCom(currentWorkFlowId);
  36. var that = this;
  37. //绑定查询事件
  38. $('#btnSelect').bind('click', function () {
  39. var dg = $('#dgProblems');
  40. var params = com.GetQueryParams();
  41. params.insideProblem = that.View == 'product' ? true : false
  42. //重新加载数据
  43. dg.datagrid('load', params);
  44. });
  45. //清空查询条件
  46. $("#btnClear").bind('click', function () {
  47. $('#XMID').combobox("setValue", "");
  48. $('#CPID').combobox("setValues", []);
  49. $('#WTXZ').combobox("setValue", "");
  50. $('#JJDM').combobox("setValue", "");
  51. $('#BBID').combobox("setValue", "");
  52. $('#JJBB').combobox("setValue", "");
  53. $('#DDID').combobox("setValue", "");
  54. $('#JJBBZT').combobox("setValue", "");
  55. $('#JGID').combobox("setValue", "");
  56. $('#YFCLRID').combobox("setValue", "");
  57. $('#SLRID').combobox("setValue", "");
  58. $('#CSCLRID').combobox("setValue", "");
  59. $('#HJID').combobox("setValues", []);
  60. $('#DJR').textbox("setValue", "");
  61. $('#KsCx').textbox("setValue", "");
  62. $('#dbStartDate').datebox("setValue", "");
  63. $('#dbEndDate').datebox("setValue", "");
  64. $('#zzStartDate').datebox("setValue", "");
  65. $('#zzEndDate').datebox("setValue", "");
  66. $('#CPMKID').combobox("setValue", "");
  67. $('#ckclose').checkbox('uncheck');
  68. $('#terminissues').checkbox('uncheck');
  69. //重置是否选择解决版本radio
  70. var radio = document.getElementsByName("LX");
  71. for (var i = 0; i < radio.length; i++) {
  72. if (2 == radio[i].value) {
  73. $(radio[i]).next().click();
  74. }
  75. }
  76. //$('#myprob').checkbox('uncheck');
  77. //$('#myregist').checkbox('uncheck');
  78. //$('#myassign').checkbox('uncheck');
  79. //$('#myapply').checkbox('uncheck');
  80. });
  81. //刷新
  82. $('#btnRefresh').bind('click', function () {
  83. that.Refresh();
  84. });
  85. //监听查询文本的回车键,如果有回车就查询
  86. $('#KsCx').textbox('textbox').keydown(function (e) {
  87. if (e.keyCode == 13) {
  88. that.Refresh();
  89. }
  90. });
  91. }
  92. //初始化datagrid
  93. this.initdatagrid = function (val, ModuleType) {
  94. if (val) {
  95. currentflowId = [val];
  96. } else {
  97. currentflowId = [];
  98. }
  99. var showReceiveProblem = false;
  100. //仅已受理的问题
  101. if ($('#ckRecevie').length > 0) {
  102. showReceiveProblem = $('#ckRecevie').checkbox('options').checked;
  103. }
  104. //仅显示我的问题(我处理的)
  105. var myProblem = $('#myprob').checkbox('options').checked;
  106. //与我相关选项
  107. var myProblemCombox = "";
  108. if ($('#myregist').checkbox('options').checked) {
  109. myProblemCombox += '1,'
  110. }
  111. if ($('#myassign').checkbox('options').checked) {
  112. myProblemCombox += '4,'
  113. }
  114. if ($('#myapply').checkbox('options').checked) {
  115. myProblemCombox += '5,'
  116. }
  117. //先读取的默认关注产品和模块
  118. $.post("/Problem/GetMyConfigAll", function (data) {
  119. var priductid = ""
  120. var productModuleId = ""
  121. if (data != null) {
  122. priductid = data.ProductID
  123. productModuleId = data.ModuleID
  124. }
  125. var dg = $('#dgProblems');
  126. var dgColoum = [{
  127. field: '问题性质',
  128. title: '性质',
  129. width: 60,
  130. align: 'center',
  131. formatter: function (val, row, index) {
  132. switch (val) {
  133. case 1:
  134. return "<i class='fa fa-bug' title='Bug' style='color:red'>Bug</i>"; break;
  135. case 2:
  136. return "<i class='fa fa-commenting-o' title='咨询'>咨询</i>"; break;
  137. case 3:
  138. return "<i class='fa fa-dropbox' title='需求' style='color:#3279b6'>需求</i>"; break;
  139. case 4:
  140. return "<i class='fa fa-history' title='优化'>优化</i>"; break;
  141. case 5:
  142. return "<i class='fa fa-history' title='环境'>环境</i>"; break;
  143. case 6:
  144. return "<i class='fa fa-history' title='接口'>接口</i>"; break;
  145. }
  146. }
  147. },
  148. {
  149. field: '产品',
  150. title: '产品类型',
  151. width: 100,
  152. align: 'center'
  153. },
  154. {
  155. field: '问题标题',
  156. title: '【问题标题】',
  157. width: 300,
  158. halign: 'center',
  159. formatter: function (val, row, index) {
  160. val = "<lable class='easyui-tooltip' title='" + val + "'>" + val + "</lable>";
  161. if (row.附件数量 > 0) {
  162. return "<i class='fa fa-paperclip' title='包含有:" + row.附件数量 + "个附件' style='color:Blue'></i>&nbsp;" + val;
  163. } else {
  164. return "&nbsp;&nbsp;&nbsp;&nbsp;" + val;
  165. }
  166. }
  167. },
  168. {
  169. field: '模块',
  170. title: '模块',
  171. width: 100,
  172. align: 'center'
  173. },
  174. {
  175. field: '登记人',
  176. title: '登记人',
  177. width: 60,
  178. align: 'center'
  179. },
  180. {
  181. field: '受理人',
  182. title: '受理人',
  183. sortable: true,
  184. width: 60,
  185. align: 'center'
  186. },
  187. {
  188. field: '联系电话',
  189. title: '联系电话',
  190. width: 90,
  191. align: 'center'
  192. },
  193. {
  194. field: '登记日期',
  195. title: '登记日期',
  196. sortable: true,
  197. width: 140,
  198. align: 'center'
  199. },
  200. {
  201. field: '滞留时间',
  202. title: '滞留时间',
  203. sortable: true,
  204. width: 80,
  205. formatter: function (val, row, index) {
  206. var rd = val % 24;
  207. if (val >= 24) {
  208. return parseInt(val / 24) + '天' + rd.toFixed(1) + '时';
  209. } else {
  210. return rd + '小时';
  211. }
  212. }
  213. },
  214. {
  215. field: '版本号',
  216. title: '版本号',
  217. width: 120,
  218. align: 'center'
  219. },
  220. {
  221. field: '解决版本',
  222. title: '解决版本',
  223. width: 120,
  224. align: 'center'
  225. },
  226. {
  227. field: '解决版本状态',
  228. title: '解决版本状态',
  229. sortable: true,
  230. width: 100,
  231. align: 'center',
  232. formatter: function (val, row, index) {
  233. if (row.解决版本状态 == 1) {
  234. return '登记';
  235. }
  236. if (row.解决版本状态 == 2) {
  237. return '修改'
  238. }
  239. if (row.解决版本状态 == 3) {
  240. return '测试';
  241. }
  242. if (row.解决版本状态 == 4) {
  243. return '待发布';
  244. }
  245. if (row.解决版本状态 == 5) {
  246. return '终止';
  247. }
  248. if (row.解决版本状态 == 6) {
  249. return '已发布';
  250. }
  251. }
  252. },
  253. {
  254. field: '研发处理人',
  255. title: '研发处理人',
  256. sortable: true,
  257. width: 100,
  258. align: 'center'
  259. }, {
  260. field: '测试处理人',
  261. title: '测试处理人',
  262. sortable: true,
  263. width: 100,
  264. align: 'center'
  265. },
  266. {
  267. field: '当前环节',
  268. title: '当前环节',
  269. sortable: true,
  270. width: 90,
  271. halign: 'center'
  272. },
  273. {
  274. field: '项目',
  275. title: '项目',
  276. width: 100,
  277. align: 'center'
  278. },
  279. {
  280. field: '机构',
  281. title: '医疗机构',
  282. width: 100,
  283. align: 'center'
  284. },
  285. {
  286. field: '反馈人',
  287. title: '反馈人',
  288. width: 60,
  289. align: 'center'
  290. },
  291. {
  292. field: '受理时间',
  293. title: '受理时间',
  294. sortable: true,
  295. width: 150,
  296. align: 'center'
  297. },
  298. {
  299. field: '指派人',
  300. title: '被指派人',
  301. sortable: true,
  302. width: 60,
  303. align: 'center'
  304. },
  305. {
  306. field: '指派时间',
  307. title: '指派时间',
  308. sortable: true,
  309. width: 150,
  310. align: 'center'
  311. },
  312. {
  313. field: '渠道',
  314. title: '分公司(渠道)',
  315. width: 100,
  316. align: 'center'
  317. },
  318. {
  319. field: '总耗时',
  320. title: '已耗小时',
  321. sortable: true,
  322. width: 80,
  323. formatter: function (val, row, index) {
  324. var rd = val % 24;
  325. if (val >= 24) {
  326. return parseInt(val / 24) + '天' + rd.toFixed(1) + '时';
  327. } else {
  328. return rd + '小时';
  329. }
  330. }
  331. },
  332. {
  333. field: '技术支持分类',
  334. title: '技术支持分类',
  335. sortable: true,
  336. width: 120,
  337. align: 'center'
  338. },
  339. { field: '紧急补丁时间', title: '紧急补丁时间', sortable: true, width: 90, align: 'center' },
  340. ];
  341. //如果为项目模块
  342. if (ModuleType == 1) {
  343. var addcoloum1 = {
  344. field: '是否验证',
  345. title: '是否验收',
  346. width: 70,
  347. halign: 'center',
  348. sortable: true,
  349. align: 'center',
  350. formatter: function (val, row, index) {
  351. if (val == 1) {
  352. return "是(" + row.验证人姓名 + ")";
  353. } else {
  354. return "否";
  355. }
  356. }
  357. };
  358. var addcoloum2 = {
  359. field: '问题分类',
  360. title: '问题分类',
  361. width: 70,
  362. halign: 'center',
  363. align: 'center'
  364. }
  365. dgColoum.splice(4, 0, addcoloum1)
  366. dgColoum.splice(5, 0, addcoloum2)
  367. }
  368. //如果为当前流程环节为技术支持
  369. else if (ModuleType == 4) {
  370. var addcoloum1 = {
  371. field: '最后提交人',
  372. title: '最后提交人',
  373. width: 90,
  374. halign: 'center',
  375. sortable: true,
  376. align: 'center',
  377. };
  378. dgColoum.splice(7, 0, addcoloum1)
  379. }
  380. dg.datagrid({
  381. fit: true,
  382. width: '100%',
  383. toolbar: '#toolbar',
  384. pageSize: 20,
  385. pageList: [10, 20, 30, 40, 50, 1000],
  386. rownumbers: true,
  387. pagination: true,
  388. border: false,
  389. checkbox: true,
  390. checkOnSelect: false,
  391. remoteSort: true,
  392. singleSelect: true, //单行选择
  393. loadMsg: "正在查询数据,请稍候...",
  394. url: '/Problem/QueryProblems',
  395. method: 'post',
  396. queryParams:
  397. {
  398. workflowNode: currentflowId,
  399. showReceiveProblem: showReceiveProblem,
  400. myProblem: myProblem,
  401. myProblemCombox: myProblemCombox,
  402. productId: priductid,
  403. productModuleId: productModuleId,
  404. insideProblem: that.View == 'product' ? true : false
  405. },
  406. frozenColumns: [
  407. [{
  408. field: '状态',
  409. title: '状态',
  410. width: 50,
  411. align: 'center',
  412. formatter: function (val, row, index) {
  413. var imgtext = "";
  414. //if (row.是否终止 == 1 || row.是否解决 == 1) {
  415. // imgtext += "<a href='#' onclick=\"UndoProblem('" + row.ID + "')\"><i class='fa fa-undo' title='回退' style='color:red'></i></a>&nbsp;";
  416. //}
  417. if (row.重复次数 != 0) {
  418. imgtext += "<a href='#' style='color:green' title='重复" + row.重复次数 + "次'><i class='fa fa-window-restore' aria-hidden='true'></i></a>&nbsp";
  419. }
  420. if (row.关联编号 != null) {
  421. // imgtext += "<i class='fa fa-cube' aria-hidden='true'></i>&nbsp";
  422. imgtext += "<a href='#' style='color:green' title='源版本问题编号:" + row.关联编号 + "'>子版</a>&nbsp";
  423. } else if (row.关联数量 != null && row.关联数量 > 0) {
  424. // imgtext += "<a href='#' style='color:green' title='共有'" + row.关联数量 + "个子版本'>源版</a>&nbsp";
  425. imgtext += "<a href='#' style='color:green' title='共有" + row.关联数量 + "个子版本' onclick='ShowConnect(&quot;" + row.ID + "&quot;)'>源版</a>&nbsp";
  426. }
  427. if (row.是否回退 == 1) {
  428. imgtext += "<i class='fa fa-rotate-left' title='回退'></i>&nbsp;";
  429. }
  430. if (row.紧急代码 == 2) {
  431. imgtext += "<i class='fa fa-warning' title='优先级:中' style='color:green'></i>&nbsp;";
  432. } else if (row.紧急代码 == 3) {
  433. imgtext += "<i class='fa fa-warning' title='优先级:高' style='color:blue'></i>&nbsp;";
  434. } else if (row.紧急代码 == 4) {
  435. imgtext += "<i class='fa fa-warning' title='优先级:非常紧急' style='color:red'></i>&nbsp;";
  436. }
  437. //显示问题类型(1:项目问题,2:产品问题)
  438. if (row.问题类型 == 2) {
  439. imgtext += "<i class='fa fa-star' title='产品问题' style='color:Red'></i>&nbsp;";
  440. }
  441. //显示完成/终止的问题
  442. if (row.是否终止 == 1) {
  443. imgtext += "<i class='fa fa-ban' style='color:red' title='终止的问题'></i>&nbsp;";
  444. } else if (row.是否解决 == 1) {
  445. imgtext += "<i class='fa fa-check' style='color:green' title='已完成的问题'></i>&nbsp;";
  446. }
  447. //记录维保过期问题
  448. if (row.应用状态 != 1) {
  449. imgtext += "<i class='fa fa-hourglass-o' title='维保过期' style='color:Red'></i>&nbsp;";
  450. }
  451. return imgtext;
  452. }
  453. }, //状态包括:是否解决,紧急,终止
  454. {
  455. field: '编号',
  456. title: '编号',
  457. sortable: true,
  458. width: 60,
  459. align: 'center'
  460. }
  461. ]
  462. ],
  463. columns: [dgColoum],
  464. onSelect: function (rowIndex, rowData) {
  465. if (rowData.应用状态 != 1) {
  466. $('#btnDeal').linkbutton({ disabled: true });
  467. var tips="未维护"
  468. if (rowData.服务结束时间 != null) {
  469. tips = rowData.服务结束时间;
  470. }
  471. $('#btnDeal').tooltip({
  472. position: 'top',
  473. content: "当前客户已脱保,脱保日期:" + tips
  474. });
  475. }
  476. else {
  477. $('#btnDeal').linkbutton({ disabled: false });
  478. $('#btnDeal').tooltip({
  479. position: 'top',
  480. content:""
  481. });
  482. }
  483. //选择一行记录,加载对应的处理过程与沟通信息
  484. com.GetMainProcess(rowData["ID"]);
  485. com.DealProcess(rowData["ID"]);
  486. com.getResourceData(rowData["ID"]);
  487. var item1 = $('#MoreItem').menu('getItem', $('#btn_acceptance')[0]);
  488. var item2 = $('#MoreItem').menu('getItem', $('#btn_repeal')[0]);
  489. if (rowData.是否解决 == 0 && rowData.是否终止 == 0) {
  490. $('#MoreItem').menu('disableItem', item1.target);
  491. $('#MoreItem').menu('disableItem', item2.target);
  492. } else {
  493. $('#MoreItem').menu('enableItem', item1.target);
  494. $('#MoreItem').menu('enableItem', item2.target);
  495. }
  496. if (rowData.是否验证 == 1) {
  497. $('#MoreItem').menu('disableItem', item1.target);
  498. }
  499. },
  500. rowStyler: function (index, row) {
  501. if (row.是否终止 == 1) {
  502. return 'background-color:#ff9292;'; // rowStyle是一个已经定义了的ClassName(类名)
  503. } else if (row.是否解决 == 1) {
  504. return 'background-color:#a3ffa3;'; // rowStyle是一个已经定义了的ClassName(类名)
  505. } else if (row.是否回退 == 1) {
  506. return 'background-color:rgba(0, 150, 136, 0.73)'; // rowStyle是一个已经定义了的ClassName(类名)
  507. }
  508. },
  509. onDblClickRow: function (rowIndex, rowData) {
  510. sessionStorage.setItem("WTID", rowData.ID);
  511. checkproblem();
  512. },
  513. onClickRow: function (index, rowData) {
  514. sessionStorage.setItem("WTID", rowData.ID);
  515. $(".dot .menu-icon").removeClass("fa fa-dot-circle-o color_blue")
  516. $(".dot .menu-icon").addClass("fa fa-circle-o color_blue")
  517. $(".dot" + rowData.解决版本状态 + " .menu-icon").addClass("fa fa-dot-circle-o color_blue")
  518. }
  519. });
  520. })
  521. }
  522. //刷新(技术支持)
  523. this.Refresh = function () {
  524. var dg = $('#dgProblems');
  525. //获取查询参数
  526. var params = com.GetQueryParams();
  527. params.insideProblem = that.View == 'product' ? true : false
  528. //重新加载
  529. dg.datagrid('reload', params);
  530. }
  531. }
  532. //技术支持列表页面
  533. function superViewModel() {
  534. this.type = '';
  535. //初始化没有支持的问题列表
  536. this.initNotSuperGrid = function (type) {
  537. this.type = type;
  538. var dg = $('#dgnoSuperList');
  539. dg.datagrid({
  540. singleSelect: true,
  541. fit: true,
  542. border: false,
  543. striped: true,
  544. remoteSort: false,
  545. toolbar: '#noSuperToolbar',
  546. rownumbers: true,
  547. pagination: true,
  548. pageSize: 20,
  549. loadMsg: "正在查询数据,请稍候...",
  550. method: 'post',
  551. url: '/Support/GetNeedProcessList?type=' + type,
  552. columns: [
  553. [{
  554. field: '紧急代码',
  555. title: '状态',
  556. width: 50,
  557. align: 'center',
  558. formatter: function (val, row, index) {
  559. var prop = row.问题性质;
  560. var imgtext = "";
  561. switch (prop) {
  562. case 1:
  563. imgtext = "<i class='fa fa-bug' title='Bug' style='color:red'></i>";
  564. break;
  565. case 2:
  566. imgtext = "<i class='fa fa-commenting-o' title='咨询'></i>";
  567. break;
  568. case 3:
  569. imgtext = "<i class='fa fa-dropbox' title='需求' style='color:#3279b6'></i>";
  570. break;
  571. case 4:
  572. imgtext = "<i class='fa fa-history' title='任务'></i>";
  573. break;
  574. }
  575. //显示优先级
  576. if (row.紧急代码 == 2) {
  577. imgtext += "<i class='fa fa-warning' title='中' style='color:green'></i>&nbsp;";
  578. } else if (row.紧急代码 == 3) {
  579. imgtext += "<i class='fa fa-warning' title='高' style='color:blue'></i>&nbsp;";
  580. } else if (row.紧急代码 == 4) {
  581. imgtext += "<i class='fa fa-warning' title='非常紧急' style='color:red'></i>&nbsp;";
  582. }
  583. //显示处理操作按钮
  584. imgtext += "<a href='#' onclick=\"ReceiveProblem('" + row.ID + "\',true)\"> <i class='fa fa-flash' title='点击开始受理问题' style='color:#4325bc;font-size:16px'></i></a>";
  585. return imgtext;
  586. }
  587. },
  588. {
  589. field: '问题标题',
  590. title: '问题标题',
  591. sortable: true,
  592. width: 250,
  593. formatter: function (val, row, index) {
  594. val = "<a href='#' onclick=\"viewProblem('" + row.ID + "')\" class='node' title='" + val + "'>" + val + "</a>";
  595. if (row.附件数量 > 0) {
  596. return "<i class='fa fa-paperclip' title='包含有:" + row.附件数量 + "个附件' style='color:Blue'></i>&nbsp;" + val;
  597. } else {
  598. return "&nbsp;&nbsp;&nbsp;&nbsp;" + val;
  599. }
  600. }
  601. },
  602. {
  603. field: '编号',
  604. title: '编号',
  605. sortable: true,
  606. width: 60,
  607. align: 'center'
  608. },
  609. {
  610. field: '渠道',
  611. title: '来源渠道',
  612. sortable: true,
  613. width: 100,
  614. align: 'center'
  615. },
  616. {
  617. field: '产品',
  618. title: '来源产品',
  619. sortable: true,
  620. width: 80,
  621. align: 'center'
  622. },
  623. {
  624. field: '反馈人',
  625. title: '反馈人',
  626. sortable: true,
  627. width: 60,
  628. align: 'center'
  629. },
  630. {
  631. field: '登记人',
  632. title: '登记人',
  633. sortable: true,
  634. width: 60,
  635. align: 'center'
  636. },
  637. {
  638. field: '登记日期',
  639. title: '登记日期',
  640. sortable: true,
  641. width: 160,
  642. align: 'center'
  643. }
  644. ]
  645. ],
  646. onSelect: function (rowIndex, rowData) {
  647. //选择一行记录,加载对应的处理过程与沟通信息
  648. com.GetMainProcess(rowData["ID"]);
  649. com.DealProcess(rowData["ID"]);
  650. }
  651. });
  652. //设置分页信息总分近钮不可见
  653. var pager = dg.datagrid().datagrid('getPager');
  654. pager.pagination({
  655. layout: ['sep', 'first', 'prev', 'next', 'last', 'info'],
  656. displayMsg: '共:{total}项'
  657. });
  658. }
  659. //初始化绑定按钮事件
  660. this.inits = function (pid, mid) {
  661. var that = this;
  662. //绑定受理问题按钮
  663. $('#btnProcess').bind('click', function () {
  664. FastReceiveProblem(null);
  665. });
  666. //刷新未处理的问题
  667. $('#btnRefreshProcess').bind('click', function () {
  668. com.RefreshNoProcessList();
  669. });
  670. //根据产品过滤问题
  671. var productid = "";
  672. $('#ccProduct').combobox({
  673. onChange(newValue, oldValue) {
  674. var dg = $('#dgnoSuperList');
  675. productid = newValue.join(",");
  676. dg.datagrid('load', {
  677. productid: newValue.join(","),
  678. productModuleId: productModuleId,
  679. type: that.type
  680. });
  681. $('#CPID').combobox('setValues', newValue);
  682. $('#btnRefresh').trigger('click');
  683. },
  684. onLoadSuccess: function (row, data) {
  685. if (pid != '') { //设置为我的关注模块
  686. $('#ccProduct').combobox('setValues', [pid]);
  687. }
  688. }
  689. });
  690. //根据产品模块过滤问题
  691. var productModuleId = "";
  692. $('#ccProductModule').combobox({
  693. onChange(newValue, oldValue) {
  694. productModuleId = newValue.join(",");
  695. var dg = $('#dgnoSuperList');
  696. dg.datagrid('load', {
  697. productid: productid,
  698. productModuleId: newValue.join(","),
  699. type: that.type
  700. });
  701. $('#CPMKID').combobox('setValues', newValue);
  702. $('#btnRefresh').trigger('click');
  703. },
  704. onLoadSuccess: function (row, data) {
  705. if (mid != '') { //设置为我的关注模块
  706. $('#ccProductModule').combobox('setValues', [mid]);
  707. }
  708. }
  709. });
  710. }
  711. }
  712. //共公处理方法
  713. var com = {
  714. //加载问题处理过程
  715. DealProcess: function (ID) {
  716. var url = "/Problem/GetClc?ID=" + ID;
  717. $.post(url, {}, function (data) {
  718. $("#timeLine").empty();
  719. $.each(data, function (idx, json) {
  720. if (json != undefined) {
  721. var attfile = "";
  722. if (json.附件 != undefined) {
  723. attfile = "<i class='fa fa-paperclip' style='color:blue' title='包含过程附件'></i>";
  724. }
  725. json.描述 = json.描述 != undefined ? json.描述 : "无";
  726. if (json.描述 != "无") {
  727. var arrEntities = {
  728. 'lt': '<',
  729. 'gt': '>',
  730. 'nbsp': ' ',
  731. 'amp': '&',
  732. 'quot': '"'
  733. };
  734. json.描述 = json.描述.replace(/<[^>]+>/g, "").replace(/&(lt|gt|nbsp|amp|quot);/ig, function (all, t) {
  735. return arrEntities[t]
  736. });
  737. if (json.描述.length == 0) {
  738. json.描述 = "内有图片,点击该过程即可查看";
  739. }
  740. }
  741. if (json.描述.length > 25) {
  742. json.描述 = json.描述.substring(0, 25) + "...";
  743. }
  744. var html = "<li onclick='viewProcess(\"" + json.ID + "\")' class='layui-timeline-item timelineDetail'><i class='layui-icon layui-timeline-axis'></i><div class='layui-timeline-content layui-text'><h3 class='layui-timeline-title'><a href='#' >" + json.处理状态 + "</a> " + attfile + "</h3><p>" + json.处理人员 + "(" + json.职务 + ")<br>" + json.记录时间 + (json.耗时 != undefined ? "(" + json.耗时 + ")小时" : "") + "<br>" + "描述:" + (json.描述) + "</p></div></li>";
  745. $("#timeLine").append(html);
  746. }
  747. });
  748. });
  749. },
  750. //获取问题过程主流程
  751. GetMainProcess: function (ID) {
  752. var url = "/Problem/GetMainProcess/" + ID;
  753. $.post(url, {}, function (data) {
  754. $("#timeLineMain").empty();
  755. data = data.reverse();
  756. $.each(data, function (idx, json) {
  757. if (json) {
  758. var attfile = "";
  759. json.LinkDeatil = json.LinkDeatil ? "描述:" + json.LinkDeatil : "";
  760. if (json.LinkDeatil) {
  761. var arrEntities = {
  762. 'lt': '<',
  763. 'gt': '>',
  764. 'nbsp': ' ',
  765. 'amp': '&',
  766. 'quot': '"'
  767. };
  768. json.LinkDeatil = json.LinkDeatil.replace(/<[^>]+>/g, "").replace(/&(lt|gt|nbsp|amp|quot);/ig, function (all, t) {
  769. return arrEntities[t]
  770. });
  771. if (json.LinkDeatil.length == 0) {
  772. json.LinkDeatil = "内有图片,点击该过程即可查看";
  773. }
  774. if (json.LinkDeatil.length > 25) {
  775. json.LinkDeatil = json.LinkDeatil.substring(0, 25) + "...";
  776. }
  777. }
  778. var detail = "";
  779. if (json.LinkUserName) {
  780. detail = "<p>" + (json.LinkUserName ? json.LinkUserName + '(' + json.job + ')' : '') + "<br>" + (json.LinkTime ? json.LinkTime : '') + "<br>" + (json.LinkDeatil) + "</p>";
  781. }
  782. //图标转换
  783. var Icon = "";
  784. switch (json.StatusID) {
  785. case 1:
  786. Icon = "&#xe756;";
  787. break;
  788. case 3:
  789. Icon = "&#x1007;";
  790. break;
  791. case 7:
  792. Icon = "&#x1005;";
  793. break;
  794. case 11:
  795. Icon = "&#xe679;";
  796. break;
  797. default:
  798. Icon = "&#xe617;";
  799. break;
  800. }
  801. var html = "<li onclick='viewProcess(\"" + (json.ProcessId ? json.ProcessId : '') + "\")' class='layui-timeline-item timelineDetail'><i class='layui-icon layui-timeline-axis'>" + Icon + "</i><div class='layui-timeline-content layui-text'><h3 class='layui-timeline-title'><a href='#' >" + json.LinkName + "</a></h3>" + detail + "</div></li>";
  802. $("#timeLineMain").append(html);
  803. }
  804. });
  805. });
  806. },
  807. ///获取流程图标 0 登记新问题 1 机构处理 2 卫计委处理 3 项目处理 4 技术支持处理 5 研发处理 6 测试处理
  808. FindIcon: function (title) {
  809. if (title == "登记新问题") {
  810. return "<i class='layui-icon layui-icon-fire' style='font-size: 20px; color: #1E9FFF;margin-right:5px'></i>";
  811. } else if (title == "机构处理") {
  812. return "<i class='layui-icon layui-icon-release' style='font-size: 20px; color: #1E9FFF;margin-right:5px'></i>";
  813. } else if (title == "卫计委处理") {
  814. return "<i class='layui-icon layui-icon-loading' style='font-size: 20px; color: #1E9FFF;margin-right:5px'></i>";
  815. } else if (title == "项目处理") {
  816. return "<i class='layui-icon layui-icon-ok-circle' style='font-size: 20px; color: #cc9910;margin-right:5px'></i>";
  817. } else if (title == "技术支持处理") {
  818. return "<i class='layui-icon layui-icon-loading' style='font-size: 20px; color: #1E9FFF;margin-right:5px'></i>";
  819. } else if (title == "研发处理") {
  820. return "<i class='layui-icon layui-icon-ok-circle' style='font-size: 20px; color: #cc9910;margin-right:5px'></i>";
  821. } else if (title == "测试处理") {
  822. return "<i class='layui-icon layui-icon-ok-circle' style='font-size: 20px; color: #cc9910;margin-right:5px'></i>";
  823. } else if (title == "完成") {
  824. return "<i class='layui-icon layui-icon-top' style='font-size: 20px; color: #cc9910;margin-right:5px'></i>";
  825. } else {
  826. return '';
  827. }
  828. },
  829. //给查询条件赋值
  830. GetCom: function (currentWorkFlowId) {
  831. //从Cookie中获取默认选择项
  832. var Mycheck_PC = JSON.parse(getCookie("Mycheck_PC")) || {};
  833. //项目
  834. $("#XMID").combobox({
  835. url: '/Problem/GetProjectByInfo',
  836. valueField: 'ID',
  837. textField: '名称',
  838. onChange: function (newValue, oldValue) {
  839. if (newValue.length == 36) {
  840. //项目所属的机构
  841. $("#JGID").combobox({
  842. url: '/Problem/GetStationByID/' + newValue,
  843. valueField: 'ID',
  844. textField: '名称',
  845. onLoadSuccess: function (data) {
  846. }
  847. })
  848. }
  849. }
  850. })
  851. $("#CPID").combobox({
  852. url: '/Product/GetAllProducts',
  853. valueField: "ID",
  854. textField: "名称",
  855. multiple: true,
  856. onChange: function (cur, old) {
  857. //只选择一个产品触发
  858. if (cur.length == 1) {
  859. //登记版本
  860. $("#BBID").combobox({
  861. url: '/Problem/GetVersionById?id=' + cur[0] + "&type=0",
  862. valueField: '版本号',
  863. textField: '版本号'
  864. });
  865. //解决版本
  866. $("#JJBB").combobox({
  867. url: '/Problem/GetVersionById?id=' + cur[0] + "&type=0",
  868. valueField: '版本号',
  869. textField: '版本号'
  870. });
  871. }
  872. }
  873. });
  874. $("#CPMKID").combobox({
  875. url: '/Problem/GetAllModual',
  876. valueField: "ID",
  877. textField: "名称",
  878. multiple: true,
  879. });
  880. $("#WTXZ").combobox({
  881. url: '/Problem/XZinfo',
  882. valueField: "ID",
  883. textField: "问题性质"
  884. });
  885. $("#JJBBZT").combobox({
  886. url: "/Problem/GetBaseCode?type=35DB8B88-36B5-49FE-A879-D49DB88BC03B",
  887. valueField: "代码",
  888. textField: "显示名"
  889. });
  890. //研发处理人
  891. $("#YFCLRID").combobox({
  892. url: "/Problem/GetUserInfoByChannelId",
  893. valueField: 'ID',
  894. textField: '姓名'
  895. })
  896. $("#SLRID").combobox({
  897. url: "/Problem/GetFKR",
  898. valueField: 'ID',
  899. textField: '姓名'
  900. })
  901. //测试处理人
  902. $("#CSCLRID").combobox({
  903. url: "/Problem/GetUserInfoByChannelId",
  904. valueField: 'ID',
  905. textField: '姓名'
  906. })
  907. $("#JJDM").combobox({
  908. url: '/Problem/JJCDinfo',
  909. valueField: "ID",
  910. textField: "紧急程度"
  911. });
  912. $("#HJID").combobox({
  913. url: '/Problem/LCHJ',
  914. valueField: "ID",
  915. textField: "流程环节",
  916. multiple: true,
  917. onBeforeLoad: function () {
  918. if (currentWorkFlowId)
  919. $(this).combobox('setValues', [currentWorkFlowId]);
  920. }
  921. });
  922. $("#FaCx").combobox({
  923. url: '/Problem/FanSelect',
  924. valueField: "ID",
  925. textField: "方案名"
  926. })
  927. //迭代
  928. $('#DDID').combobox({
  929. url: '/Problem/GetLterationList',
  930. valueField: 'ID',
  931. textField: '名称',
  932. });
  933. $('#myprob').checkbox({
  934. checked: Mycheck_PC.myprob || false,
  935. onChange(checked) {
  936. Mycheck_PC.myprob = checked;
  937. setCookie("Mycheck_PC", JSON.stringify(Mycheck_PC), 2)
  938. $('#btnSelect').click();
  939. }
  940. });
  941. $('#myregist').checkbox({
  942. checked: Mycheck_PC.myregist || false,
  943. onChange(checked) {
  944. Mycheck_PC.myregist = checked;
  945. setCookie("Mycheck_PC", JSON.stringify(Mycheck_PC), 2)
  946. $('#btnSelect').click();
  947. }
  948. });
  949. $('#myassign').checkbox({
  950. checked: Mycheck_PC.myassign || false,
  951. onChange(checked) {
  952. Mycheck_PC.myassign = checked;
  953. setCookie("Mycheck_PC", JSON.stringify(Mycheck_PC), 2)
  954. $('#btnSelect').click();
  955. }
  956. });
  957. $('#myapply').checkbox({
  958. checked: Mycheck_PC.myapply || false,
  959. onChange(checked) {
  960. Mycheck_PC.myapply = checked;
  961. setCookie("Mycheck_PC", JSON.stringify(Mycheck_PC), 2)
  962. $('#btnSelect').click();
  963. }
  964. });
  965. },
  966. //获取当前界面的查询条件
  967. GetQueryParams: function () {
  968. var data = {};
  969. //项目ID
  970. var projectid = $('#XMID').combobox('getValue');
  971. data.projectId = projectid;
  972. //机构id
  973. var orgId = $('#JGID').combobox('getValue');
  974. data.orgId = orgId;
  975. //产品id
  976. var pid = $('#CPID').combobox('getValues').join(",");
  977. data.productId = pid;
  978. //产品模块id
  979. var pmid = $('#CPMKID').combobox('getValues').join(",");
  980. data.productModuleId = pmid;
  981. //问题性质
  982. var property = $('#WTXZ').combobox('getValue');
  983. data.property = property;
  984. //紧急程度
  985. var priority = $('#JJDM').combobox('getValue');
  986. data.priority = priority;
  987. //流程环节
  988. var workflowNode = $('#HJID').combobox('getValues').join(",");
  989. data.workflowNode = workflowNode;
  990. //解决版本状态
  991. data.JJBBZT = $('#JJBBZT').combobox('getValues').join(",");
  992. //研发处理人id
  993. data.YFCLRID = $('#YFCLRID').combobox('getValues').join(",");
  994. //受理人id
  995. data.SLRID = $('#SLRID').combobox('getValues').join(",");
  996. //测试处理人id
  997. data.CSCLRID = $('#CSCLRID').combobox('getValues').join(",");
  998. //登记人
  999. var RegistPerson = $('#DJR').textbox('getValue');
  1000. data.RegistPerson = RegistPerson;
  1001. //查询信息(根据问题编号与标题查询)
  1002. var queryText = $('#KsCx').textbox('getValue');
  1003. data.queryText = queryText;
  1004. //快速检索是否包含查询条件
  1005. var IncludeSearchContent = $('#IncludeSearchContent').checkbox('options').checked;
  1006. data.IncludeSearchContent = IncludeSearchContent;
  1007. //仅显示我的问题(我处理的)
  1008. var myProblem = $('#myprob').checkbox('options').checked;
  1009. data.myProblem = myProblem;
  1010. //与我相关选项
  1011. var mySelect = "";
  1012. if ($('#myregist').checkbox('options').checked) {
  1013. mySelect += '1,'
  1014. }
  1015. if ($('#myassign').checkbox('options').checked) {
  1016. mySelect += '4,'
  1017. }
  1018. if ($('#myapply').checkbox('options').checked) {
  1019. mySelect += '5,'
  1020. }
  1021. data.myProblemCombox = mySelect;
  1022. //仅已受理的问题
  1023. if ($('#ckRecevie').length > 0) {
  1024. var showReceiveProblem = $('#ckRecevie').checkbox('options').checked;
  1025. data.showReceiveProblem = showReceiveProblem;
  1026. }
  1027. //是否显示已关闭的问题
  1028. var showCloseProblem = $('#ckclose').checkbox('options').checked;
  1029. data.showCloseProblem = showCloseProblem;
  1030. //只显示终止的问题
  1031. if ($('#terminissues').length > 0) {
  1032. var showTerminIssues = $('#terminissues').checkbox('options').checked;
  1033. data.showTerminIssues = showTerminIssues;
  1034. }
  1035. //获取查询日期
  1036. var startDate = $('#dbStartDate').datebox('getValue');
  1037. data.startDate = startDate;
  1038. //获取查询结束日期
  1039. var endDate = $('#dbEndDate').datebox('getValue');
  1040. data.endDate = endDate;
  1041. //获取终止/解决查询日期
  1042. var zzstartDate = $('#zzStartDate').datebox('getValue');
  1043. data.zzstartDate = zzstartDate;
  1044. //获取终止/解决查询结束日期
  1045. var zzendDate = $('#zzEndDate').datebox('getValue');
  1046. data.zzendDate = zzendDate;
  1047. //迭代任务
  1048. data.lteration = $('#DDID').combobox('getValue');
  1049. //产品登记版本
  1050. data.version = $('#BBID').combobox('getValue');
  1051. //产品解决版本
  1052. data.solutionversion = $('#JJBB').combobox('getValue');
  1053. //是否指定解决版本
  1054. data.whether = $('input[name="LX"]:checked').val();
  1055. return data;
  1056. },
  1057. //刷新未处理的问题
  1058. RefreshNoProcessList: function () {
  1059. //刷新待处理列表
  1060. $('#dgnoSuperList').datagrid('reload');
  1061. //刷新已处理列表
  1062. $('#dgProblems').datagrid('reload');
  1063. },
  1064. //刷新已处理列表
  1065. RefreshOnDeal: function () {
  1066. //刷新已处理列表
  1067. $('#dgProblems').datagrid('reload');
  1068. },
  1069. ///刷新待处理列表
  1070. RefreshNoDeal: function () {
  1071. $('#dgnoSuperList').datagrid('reload');
  1072. },
  1073. //加载资源信息
  1074. getResourceData: function (ID) {
  1075. $('#resource').datagrid({
  1076. toolbar: '#btn_func',
  1077. singleSelect: true,
  1078. url: '/Problem/ResourceData?proid=' +ID,
  1079. fit: true,
  1080. columns: [
  1081. [{
  1082. field: 'DECODE类型',
  1083. title: '类型',
  1084. width: 70
  1085. },
  1086. {
  1087. field: '内容',
  1088. width: 116,
  1089. title: '内容',
  1090. minWdith: 116
  1091. },
  1092. {
  1093. field: '资源ID',
  1094. title: '资源ID',
  1095. width: 120,
  1096. minWdith: 120
  1097. },
  1098. {
  1099. field: '添加时间',
  1100. title: '添加时间',
  1101. width: 142,
  1102. }
  1103. ]
  1104. ]
  1105. })
  1106. }
  1107. }
  1108. //关闭窗体
  1109. function Close() {
  1110. ZLPMS.CloseTopWindow(true)
  1111. }
  1112. //导出Excel
  1113. function GetExcel(type) {
  1114. //var data = $('#dgProblems').datagrid('getData');
  1115. var params = com.GetQueryParams();
  1116. params.type = type == 3 ? type : 0;
  1117. params.page = 0;
  1118. params.rows = 0;
  1119. var location = top.ZLPMS.Loading("导出中,请稍等...");
  1120. $.post("/Problem/QueryProblems", params, function (data) {
  1121. top.ZLPMS.UnLoading(location);
  1122. var jsonData = data.rows;
  1123. //删除ID
  1124. if (type == 1) {
  1125. for (var t in jsonData) {
  1126. delete jsonData[t].ID;
  1127. delete jsonData[t].ROWNO;
  1128. delete jsonData[t].受理人ID;
  1129. delete jsonData[t].环节ID;
  1130. delete jsonData[t].受理人ID;
  1131. delete jsonData[t].问题类型;
  1132. /* delete jsonData[t].问题性质;*/
  1133. switch (jsonData[t].问题性质) {
  1134. case 1:
  1135. jsonData[t].问题性质 = "缺陷"
  1136. break
  1137. case 2:
  1138. jsonData[t].问题性质 = "咨询"
  1139. break
  1140. case 3:
  1141. jsonData[t].问题性质 = "需求"
  1142. break
  1143. case 4:
  1144. jsonData[t].问题性质 = "优化"
  1145. break
  1146. case 5:
  1147. jsonData[t].问题性质 = "环境"
  1148. break
  1149. case 6:
  1150. jsonData[t].问题性质 = "接口"
  1151. break
  1152. }
  1153. }
  1154. } else {
  1155. for (var t in jsonData) {
  1156. delete jsonData[t].ID;
  1157. delete jsonData[t].ROWNO;
  1158. delete jsonData[t].受理人ID;
  1159. delete jsonData[t].环节ID;
  1160. delete jsonData[t].受理人ID;
  1161. delete jsonData[t].问题类型;
  1162. /* delete jsonData[t].问题性质;*/
  1163. switch (jsonData[t].问题性质) {
  1164. case 1:
  1165. jsonData[t].问题性质 = "缺陷"
  1166. break
  1167. case 2:
  1168. jsonData[t].问题性质 = "咨询"
  1169. break
  1170. case 3:
  1171. jsonData[t].问题性质 = "需求"
  1172. break
  1173. case 4:
  1174. jsonData[t].问题性质 = "优化"
  1175. break
  1176. case 5:
  1177. jsonData[t].问题性质 = "环境"
  1178. break
  1179. case 6:
  1180. jsonData[t].问题性质 ="接口"
  1181. break
  1182. }
  1183. switch (jsonData[t].解决版本状态) {
  1184. case 1:
  1185. jsonData[t].解决版本状态 = "登记"
  1186. break
  1187. case 2:
  1188. jsonData[t].解决版本状态 = "修改"
  1189. break
  1190. case 3:
  1191. jsonData[t].解决版本状态 = "测试"
  1192. break
  1193. case 4:
  1194. jsonData[t].解决版本状态 = "待发布"
  1195. break
  1196. case 5:
  1197. jsonData[t].解决版本状态 = "终止"
  1198. break
  1199. case 6:
  1200. jsonData[t].解决版本状态 = "已发布"
  1201. break
  1202. }
  1203. jsonData[t].是否终止 = jsonData[t].是否终止 == 1 ? '是' : '否';
  1204. jsonData[t].是否验证 = jsonData[t].是否验证 == 1 ? '是' : '否';
  1205. jsonData[t].是否解决 = jsonData[t].是否解决 == 1 ? '是' : '否';
  1206. jsonData[t].是否受理 = jsonData[t].是否受理 == 1 ? '是' : '否';
  1207. jsonData[t].是否回退 = jsonData[t].是否回退 == 1 ? '是' : '否';
  1208. jsonData[t].是否回退 = jsonData[t].是否回退 == 1 ? '是' : '否';
  1209. }
  1210. }
  1211. //获取标题
  1212. var name = '<tr>';
  1213. for (let Title in jsonData[0]) {
  1214. //增加\t为了不让表格显示科学计数法或者其他格式
  1215. name += `<td>${Title}</td>`;
  1216. }
  1217. name += '</tr>';
  1218. let str = '';
  1219. //循环遍历,每行加入tr标签,每个单元格加td标签
  1220. for (let i = 0; i < jsonData.length; i++) {
  1221. str += '<tr>';
  1222. for (let item in jsonData[i]) {
  1223. //增加\t为了不让表格显示科学计数法或者其他格式
  1224. str += `<td>${jsonData[i][item] + '\t'}</td>`;
  1225. }
  1226. str += '</tr>';
  1227. }
  1228. str = name + str;
  1229. let worksheet = '问题记录'
  1230. let uri = 'data:application/vnd.ms-excel;base64,';
  1231. //下载的表格模板数据
  1232. let template = `<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"> <head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet> <x:Name>${worksheet}</x:Name> <x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet> </x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--> </head><body><table>${str}</table></body></html>`;
  1233. //下载模板
  1234. window.location.href = uri + base64(template)
  1235. })
  1236. }
  1237. //自定义导出设置
  1238. function ExcelSet() {
  1239. top.ZLPMS.OpenNewWindow("导出Excel设置", "/Problem/ExcelSet_Window/", '500px', '520px', function () {
  1240. GetExcel(1)
  1241. });
  1242. }
  1243. function base64(s) {
  1244. return window.btoa(unescape(encodeURIComponent(s)))
  1245. }
  1246. function ShowConnect(id) {
  1247. $.post("/Problem/ShowConnect/" + id, function (data) {
  1248. var html = ""
  1249. for (var i = 0; i < data.length; i++) {
  1250. html += data[i].编号版本 + "<br/>"
  1251. }
  1252. //配置一个透明的询问框
  1253. layer.msg(html, {
  1254. time: 200000, //20s后自动关闭
  1255. btnAlign: 'c',
  1256. btn: ['关闭']
  1257. });
  1258. })
  1259. }
  1260. //导出Excel
  1261. function ExportExcelV2(type) {
  1262. //var data = $('#dgProblems').datagrid('getData');
  1263. var params = com.GetQueryParams();
  1264. params.type = type == 3 ? type : 0;
  1265. params.page = 0;
  1266. params.rows = 0;
  1267. var location = top.ZLPMS.Loading("导出中,请稍等...");
  1268. $.post("/Problem/QueryProblemsV2", params, function (data) {
  1269. top.ZLPMS.UnLoading(location);
  1270. var jsonData = data.rows;
  1271. //删除ID
  1272. if (type == 1) {
  1273. for (var t in jsonData) {
  1274. /* delete jsonData[t].问题性质;*/
  1275. switch (jsonData[t].问题性质) {
  1276. case 1:
  1277. jsonData[t].问题性质 = "缺陷"
  1278. break
  1279. case 2:
  1280. jsonData[t].问题性质 = "咨询"
  1281. break
  1282. case 3:
  1283. jsonData[t].问题性质 = "需求"
  1284. break
  1285. case 4:
  1286. jsonData[t].问题性质 = "优化"
  1287. break
  1288. case 5:
  1289. jsonData[t].问题性质 = "环境"
  1290. break
  1291. case 6:
  1292. jsonData[t].问题性质 = "接口"
  1293. break
  1294. }
  1295. }
  1296. } else {
  1297. for (var t in jsonData) {
  1298. delete jsonData[t].ID;
  1299. delete jsonData[t].ROWNO;
  1300. delete jsonData[t].受理人ID;
  1301. delete jsonData[t].环节ID;
  1302. delete jsonData[t].受理人ID;
  1303. delete jsonData[t].问题类型;
  1304. /* delete jsonData[t].问题性质;*/
  1305. switch (jsonData[t].问题性质) {
  1306. case 1:
  1307. jsonData[t].问题性质 = "缺陷"
  1308. break
  1309. case 2:
  1310. jsonData[t].问题性质 = "咨询"
  1311. break
  1312. case 3:
  1313. jsonData[t].问题性质 = "需求"
  1314. break
  1315. case 4:
  1316. jsonData[t].问题性质 = "优化"
  1317. break
  1318. case 5:
  1319. jsonData[t].问题性质 = "环境"
  1320. break
  1321. case 6:
  1322. jsonData[t].问题性质 = "接口"
  1323. break
  1324. }
  1325. switch (jsonData[t].解决版本状态) {
  1326. case 1:
  1327. jsonData[t].解决版本状态 = "登记"
  1328. break
  1329. case 2:
  1330. jsonData[t].解决版本状态 = "修改"
  1331. break
  1332. case 3:
  1333. jsonData[t].解决版本状态 = "测试"
  1334. break
  1335. case 4:
  1336. jsonData[t].解决版本状态 = "待发布"
  1337. break
  1338. case 5:
  1339. jsonData[t].解决版本状态 = "终止"
  1340. break
  1341. case 6:
  1342. jsonData[t].解决版本状态 = "已发布"
  1343. break
  1344. }
  1345. jsonData[t].是否终止 = jsonData[t].是否终止 == 1 ? '是' : '否';
  1346. jsonData[t].是否验证 = jsonData[t].是否验证 == 1 ? '是' : '否';
  1347. jsonData[t].是否解决 = jsonData[t].是否解决 == 1 ? '是' : '否';
  1348. jsonData[t].是否受理 = jsonData[t].是否受理 == 1 ? '是' : '否';
  1349. jsonData[t].是否回退 = jsonData[t].是否回退 == 1 ? '是' : '否';
  1350. jsonData[t].是否回退 = jsonData[t].是否回退 == 1 ? '是' : '否';
  1351. }
  1352. }
  1353. //获取标题
  1354. var name = '<tr>';
  1355. for (let Title in jsonData[0]) {
  1356. //增加\t为了不让表格显示科学计数法或者其他格式
  1357. name += `<td>${Title}</td>`;
  1358. }
  1359. name += '</tr>';
  1360. let str = '';
  1361. //循环遍历,每行加入tr标签,每个单元格加td标签
  1362. for (let i = 0; i < jsonData.length; i++) {
  1363. str += '<tr>';
  1364. for (let item in jsonData[i]) {
  1365. //增加\t为了不让表格显示科学计数法或者其他格式
  1366. str += `<td>${jsonData[i][item] + '\t'}</td>`;
  1367. }
  1368. str += '</tr>';
  1369. }
  1370. str = name + str;
  1371. let worksheet = '问题记录'
  1372. let uri = 'data:application/vnd.ms-excel;base64,';
  1373. //下载的表格模板数据
  1374. let template = `<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"> <head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet> <x:Name>${worksheet}</x:Name> <x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet> </x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--> </head><body><table>${str}</table></body></html>`;
  1375. //下载模板
  1376. window.location.href = uri + base64(template)
  1377. })
  1378. }
  1379. //自定义导出设置V2版本
  1380. function ExportExcel(source) {
  1381. top.ZLPMS.OpenNewWindow("导出Excel设置", "/Problem/ExcelSet_Window/", '500px', '520px', function () {
  1382. if (source==3) {//产品问题导出
  1383. ExportExcelV2(1)
  1384. }
  1385. });
  1386. }