GolbalInte.cshtml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. 
  2. @{
  3. ViewBag.Title = "GolbalInte";
  4. Layout = "~/Views/Shared/_MainLayoutPage.cshtml";
  5. }
  6. <div id="toolbar">
  7. <a href="#" id="btn-add" class="easyui-linkbutton" onclick="add_interface" data-options="iconCls:'fa fa-plus color_blue',plain:true">新建</a>
  8. <a href="#" id="btn-edit" class="easyui-linkbutton" data-options="iconCls:'fa fa-edit color_blue',plain:true">修改</a>
  9. <a href="#" id="btn-del" class="easyui-linkbutton" data-options="iconCls:'fa fa-remove color_blue',plain:true">删除</a>
  10. <a href="#" id="btn-ref" class="easyui-linkbutton" data-options="iconCls:'fa fa-refresh color_blue',plain:true">变更</a>
  11. <a href="#" id="btn-excel" class="easyui-linkbutton" data-options="iconCls:'fa fa-cogs color_blue',plain:true">导出Excel</a>
  12. <input id="mc" class="easyui-searchbox" style="width:200px;margin-left:20px"
  13. data-options="searcher:search,prompt:'请输入关键字'" />
  14. <button type="button" id="btn-more" class="layui-btn layui-btn-normal layui-btn-sm">更多条件</button>
  15. <button type="button" id="btn-refresh" class="layui-btn layui-btn-normal layui-btn-sm" style="background-color:#5FB878">刷新</button>
  16. @*<button type="button" id="btn-reset" class="layui-btn layui-btn-normal layui-btn-sm" style="background-color:#009688">重置</button>*@
  17. </div>
  18. <hr>
  19. <div id="cc" class="easyui-layout" fit="true" border="false">
  20. @*时间轴*@
  21. <div data-options="region:'east',split:true" title="过程" style="width:400px;">
  22. <ul class="layui-timeline" id="timeline">
  23. </ul>
  24. </div>
  25. @*Table表格*@
  26. <div data-options="region:'center'">
  27. <table class="easyui-datagrid" id="globalinte" data-options="fitColumns:true,singleSelect:true"></table>
  28. </div>
  29. </div>
  30. @*更多条件*@
  31. <form id="inteform" method="post" class="layui-form" style="margin-top:20px">
  32. <input type="hidden" id="TYPE" value="1" />
  33. <div class="layui-form-item">
  34. <div class="layui-inline">
  35. <label class="layui-form-label">类型</label>
  36. <div class="layui-input-block" lay-filter="LX">
  37. <input type="checkbox" name="LX" value="1" title="医保接口" lay-skin="primary">
  38. <input type="checkbox" name="LX" value="2" title="农合接口" lay-skin="primary">
  39. <input type="checkbox" name="LX" value="3" title="LIS接口" lay-skin="primary">
  40. <input type="checkbox" name="LX" value="4" title="三方接口接口" lay-skin="primary">
  41. <input type="checkbox" name="LX" value="5" title="其它接口接口" lay-skin="primary">
  42. </div>
  43. </div>
  44. </div>
  45. <div class="layui-form-item">
  46. <div class="layui-inline">
  47. <label class="layui-form-label">渠道</label>
  48. <div class="layui-input-inline">
  49. <input id="QDID" name="QDID" panelheight="200px" class="easyui-combobox xmid" data-options="labelAlign:'right',prompt:'请选择渠道',limitToList:true,tipPosition:'top'" style="height:38px;border-radius:4px;width:200px" />
  50. </div>
  51. </div>
  52. <div class="layui-inline">
  53. <label class="layui-form-label">项目</label>
  54. <div class="layui-input-inline">
  55. <input id="XMID" name="XMID" panelheight="200px" class="easyui-combobox xmid" data-options="labelAlign:'right',prompt:'请选择项目',limitToList:true,tipPosition:'top'" style="height:38px;border-radius:4px;width:200px" />
  56. </div>
  57. </div>
  58. </div>
  59. <div class="layui-form-item">
  60. <div class="layui-inline">
  61. <label class="layui-form-label">创建人</label>
  62. <div class="layui-input-inline">
  63. <input type="text" id="CJR" name="CJR" class="easyui-combobox" autocomplete="off" style="height:38px;border-radius:4px;width:200px" />
  64. </div>
  65. </div>
  66. </div>
  67. <div class="layui-form-item">
  68. <div class="layui-inline">
  69. <label class="layui-form-label">用户名称</label>
  70. <div class="layui-input-inline">
  71. <input type="text" id="JKDFMC" name="JKDFMC" class="easyui-combobox" autocomplete="off" style="height:38px;border-radius:4px;width:200px" />
  72. </div>
  73. </div>
  74. <div class="layui-inline">
  75. <label class="layui-form-label">维护人</label>
  76. <div class="layui-input-inline">
  77. <input type="text" id="ZRR" name="ZRR" class="easyui-combobox" autocomplete="off" style="height:38px;border-radius:4px;width:200px" />
  78. </div>
  79. </div>
  80. </div>
  81. <div class="layui-form-item">
  82. <label class="layui-form-label">状态</label>
  83. <div class="layui-input-block" id="condition_zt">
  84. </div>
  85. </div>
  86. </form>
  87. <script src="~/ViewModels/ProjectManager.js?r=12.221"></script>
  88. <script type="text/javascript">
  89. var id = "";
  90. var index = 0;
  91. $(function () {
  92. //document.getElementsByClassName("easyui-linkbutton").hide("disabled", ? false :"disabled")
  93. "@ViewBag.userInfo" != "1"?$(".easyui-linkbutton").hide():$(".easyui-linkbutton").show()
  94. init()
  95. layui.use(['form'], function () {
  96. var form = layui.form
  97. //类型
  98. $.post('/Problem/GetBaseCode?type=' + '9FECB49A-397D-4C1B-9BE9-B8A4B73B9CD7', function (data) {
  99. var html = ""
  100. var eventlist = new viewModel();
  101. //1-新增 2-修改
  102. for (var i = 0; i < data.length; i++) {
  103. html += "<input type='checkbox' name='ZT' class='ZT' value='" + data[i].代码 + "' title='" + data[i].显示名 + "' lay-skin='primary'>"
  104. }
  105. document.getElementById("condition_zt").innerHTML = html
  106. form.render()
  107. })
  108. })
  109. })
  110. function init(type) {
  111. var params = ZLPMS.FormToObject('inteform');
  112. params.MC = document.getElementById("mc").value
  113. params.TYPE = type
  114. $('#globalinte').datagrid({
  115. url: '/ProManager/BingInterface',
  116. method: 'post',
  117. singleSelect: true,
  118. rownumbers: true,
  119. fit: true,
  120. queryParams: params,
  121. onLoadSuccess: function (dd) {
  122. if (dd.rows.length > 0) {
  123. $.post("/ProManager/GetInteProcess", { id: dd.rows[0].ID }, function (data) {
  124. var html = ""
  125. for (var i = 0; i < data.length; i++) {
  126. html += "<li class='layui-timeline-item timelineDetail'><i class='layui-icon layui-timeline-axis'>&#xe617;</i><div class='layui-timeline-content layui-text'><h3 class='layui-timeline-title'> <span style='margin-right:15px'>" + data[i].操作人 + "</span><span style='margin-right:15px;color:#00b8ff'>" + data[i].状态 + "</span><span style='margin-right:15px;color:#a2a2a2'>" + data[i].操作时间 + "</span></h3><p style='font-size:15px;width:350px;word-break: break-word;color:#a2a2a2'><br>" + data[i].备注 + "</p></div></li>"
  127. }
  128. $("#timeline").html(html)
  129. })
  130. id = dd.rows[0].ID
  131. }
  132. $(".datagrid-body").height($(".datagrid-body").height() - 20)
  133. //导出excel
  134. if (type == 2) {
  135. var jsonData = dd.rows;
  136. //获取标题
  137. var name = '<tr>';
  138. for (let Title in jsonData[0]) {
  139. //增加\t为了不让表格显示科学计数法或者其他格式
  140. name += `<td>${Title}</td>`;
  141. }
  142. name += '</tr>';
  143. let str = '';
  144. //循环遍历,每行加入tr标签,每个单元格加td标签
  145. for (let i = 0; i < jsonData.length; i++) {
  146. str += '<tr>';
  147. for (let item in jsonData[i]) {
  148. //增加\t为了不让表格显示科学计数法或者其他格式
  149. str += `<td>${jsonData[i][item] + '\t'}</td>`;
  150. }
  151. str += '</tr>';
  152. }
  153. str = name + str;
  154. let worksheet = '接口信息'
  155. let uri = 'data:application/vnd.ms-excel;base64,';
  156. //下载的表格模板数据
  157. 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>`;
  158. //下载模板
  159. window.location.href = uri + base64(template)
  160. }
  161. },
  162. columns: [[
  163. { field: '名称', title: '接口名称', align: 'left' },
  164. {
  165. field: '类型', title: '类型', align: 'center', formatter: function (row) {
  166. switch (row) {
  167. case 1: return "医保接口"; break;
  168. case 2: return "农合接口"; break;
  169. case 3: return "LIS接口"; break;
  170. case 4: return "三方接口"; break;
  171. default: return "其它接口"; break;
  172. }
  173. }
  174. },
  175. { field: '项目名称', title: '项目名称' },
  176. {
  177. field: '状态', title: '状态', align: 'center'
  178. },
  179. {
  180. field: '申请时间', title: '申请时间', align: 'center'
  181. },
  182. { field: '完成时间', title: '完成时间', align: 'center' },
  183. { field: '验收时间', title: '验收时间', align: 'center' },
  184. { field: '创建人', title: '创建人', align: 'center' },
  185. { field: '责任人', title: '维护人', align: 'center' },
  186. { field: '接口对方名称', title: '项目对接人', align: 'center' },
  187. ]],
  188. onSelect: function (index, row) {
  189. $.post("/ProManager/GetInteProcess", { id: row.ID }, function (data) {
  190. var html = ""
  191. for (var i = 0; i < data.length; i++) {
  192. html += "<li class='layui-timeline-item timelineDetail'><i class='layui-icon layui-timeline-axis'>&#xe617;</i><div class='layui-timeline-content layui-text'><h3 class='layui-timeline-title'> <span style='margin-right:15px'>" + data[i].操作人 + "</span><span style='margin-right:15px;color:#00b8ff'>" + data[i].状态 + "</span><span style='margin-right:15px;color:#a2a2a2'>" + data[i].操作时间 + "</span></h3><p style='font-size:15px;width:350px;word-break: break-word;color:#a2a2a2'><br>" + data[i].备注 + "</p></div></li>"
  193. }
  194. $("#timeline").html(html)
  195. })
  196. id = row.ID
  197. },
  198. onDblClickRow: function (rowIndex, rowData) {
  199. top.ZLPMS.OpenWindow({
  200. title: '编辑接口信息',
  201. url: '/ProManager/GlobalInteWindow?&type=2&id=' + id + "&state=" + $("#globalinte").datagrid("getSelected").STATE,
  202. area: ['750px', '700px'],
  203. btn: ['关闭'],
  204. yes: function (index, layero) {
  205. top.ZLPMS.CloseWindow(index);
  206. }
  207. });
  208. }
  209. });
  210. }
  211. //excel转base64
  212. function base64(s) { return window.btoa(unescape(encodeURIComponent(s))) }
  213. function search(a, b) {
  214. init(1)
  215. }
  216. //刷新
  217. $("#btn-refresh").bind("click", function () {
  218. init()
  219. })
  220. //新增接口信息
  221. $("#btn-add").bind("click", function () {
  222. top.ZLPMS.OpenWindow({
  223. title: '新建接口信息',
  224. url: '/ProManager/GlobalInteWindow?&type=1',
  225. area: ['750px', '700px'],
  226. yes: function (index, layero) {
  227. //表单提交
  228. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  229. iframeWin.Forms.Interface_PostData(index, 1, 1, $("#globalinte"));//调用子页面的方法,得到子页面返回的ids
  230. }
  231. });
  232. })
  233. //编辑接口信息
  234. $("#btn-edit").bind("click", function () {
  235. var row = $("#globalinte").datagrid("getSelected")
  236. if (!row) {
  237. top.ZLPMS.Msg("请选择一条记录");
  238. } else {
  239. top.ZLPMS.OpenWindow({
  240. title: '编辑接口信息',
  241. url: '/ProManager/GlobalInteWindow?&type=2&id=' + id + "&state=" + $("#globalinte").datagrid("getSelected").STATE,
  242. area: ['750px', '700px'],
  243. yes: function (index, layero) {
  244. //表单提交
  245. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  246. iframeWin.Forms.Interface_PostData(index, 2, 1, $("#globalinte"));//调用子页面的方法,得到子页面返回的ids
  247. }
  248. });
  249. }
  250. })
  251. // 删除接口信息
  252. $("#btn-del").bind("click", function () {
  253. var id = $("#globalinte").datagrid("getSelected");
  254. if (id == null) {
  255. top.ZLPMS.Msg("请选择一条记录");
  256. return
  257. }
  258. top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
  259. //执行删除
  260. $.post("/ProManager/Del_Interface?id=" + id["ID"], function (data) {
  261. if (data) {
  262. $('#globalinte').datagrid('reload');
  263. top.ZLPMS.Msg("删除成功");
  264. }
  265. else {
  266. top.ZLPMS.Msg("删除失败");
  267. }
  268. })
  269. });
  270. })
  271. // 变更接口状态
  272. $("#btn-ref").bind("click", function () {
  273. var obj = $("#globalinte").datagrid("getSelected");
  274. if (obj == null) {
  275. top.ZLPMS.Msg("请选择一条记录");
  276. return
  277. }
  278. top.ZLPMS.OpenWindow({
  279. title: '变更状态',
  280. url: '/ProManager/DealWindow?&id=' + obj["ID"],
  281. area: ['800px', '600px'],
  282. yes: function (index, layero) {
  283. //表单提交
  284. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  285. iframeWin.Forms.DealInte_PostData(index, $("#globalinte"));//调用子页面的方法,得到子页面返回的ids
  286. }
  287. });
  288. })
  289. //更多条件
  290. $("#btn-more").bind("click", function () {
  291. var that = this;
  292. //多窗口模式,层叠置顶
  293. index = layer.open({
  294. type: 1
  295. , id: "one"
  296. , title: '条件'
  297. , area: ['800px', '360px']
  298. , shade: 0
  299. , anim: 1
  300. , shadeClose: true
  301. , maxmin: true
  302. , shade: 0.3
  303. , offset: '50px'
  304. , content: $("#inteform")
  305. , btn: ['确认', '关闭']
  306. , yes: function () {
  307. init(1)
  308. layer.close(index);
  309. }
  310. , btn2: function () {
  311. layer.close(index);
  312. }
  313. , zIndex: 1 //重点1
  314. });
  315. })
  316. //导出excel
  317. $("#btn-excel").bind("click", function () {
  318. init(2)
  319. })
  320. //渠道
  321. $("#QDID").combobox({
  322. url: '/Problem/GetChannelByAuth',
  323. valueField: 'ID',
  324. textField: '名称',
  325. limitToList: true,
  326. })
  327. //项目
  328. $("#XMID").combobox({
  329. url: '/Problem/GetProjectByInfo',
  330. valueField: 'ID',
  331. textField: '名称',
  332. limitToList: true,
  333. })
  334. //创建人
  335. $("#CJR").combobox({
  336. url: '/ProManager/GetinfoBynature?type=0',
  337. valueField: 'ID',
  338. textField: '名称',
  339. limitToList: true
  340. })
  341. //负责人
  342. $("#ZRR").combobox({
  343. url: '/ProManager/GetinfoBynature?type=0',
  344. valueField: 'ID',
  345. textField: '名称',
  346. limitToList: true
  347. })
  348. //用户名称
  349. $("#JKDFMC").combobox({
  350. url: '/ProManager/GetinfoBynature?type=1',
  351. valueField: 'ID',
  352. textField: '名称',
  353. limitToList: true
  354. })
  355. </script>
  356. <style type="text/css">
  357. .datagrid-header-row {
  358. text-align: center;
  359. }
  360. .layui-timeline-title {
  361. margin: 0px
  362. }
  363. .timelineDetail:hover {
  364. background-color: #c5e5ff;
  365. cursor: pointer;
  366. }
  367. .layui-form-item {
  368. margin: 5px
  369. }
  370. p {
  371. margin-top: -15px
  372. }
  373. /*.datagrid-body{height:500px!important;}*/
  374. .datagrid-body {
  375. overflow-y: scroll
  376. }
  377. </style>