商丘12345 前端

askRecords1.html 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>索要记录</title>
  6. <script src="../Script/Common/huayi.load.js"></script>
  7. <link rel="stylesheet" href="../css/bootstrap-select.css">
  8. <script src="../Script/Common/huayi.config.js"></script>
  9. <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
  10. <link rel="stylesheet" href="../css/init.css" />
  11. <style>
  12. #sqzx th {
  13. padding: 5px 8px 5px 0;
  14. text-align: right;
  15. width: 50px;
  16. }
  17. .select {
  18. width: 150px;
  19. background-color: #FFF;
  20. background-image: none;
  21. border: 1px solid #ccc;
  22. border-radius: 1px;
  23. color: inherit;
  24. padding: 6px 12px;
  25. }
  26. #sex {
  27. background-color: #FFF;
  28. background-image: none;
  29. border: 1px solid #ccc;
  30. border-radius: 1px;
  31. color: inherit;
  32. padding: 6px 12px;
  33. }
  34. input {
  35. background-color: #FFF;
  36. background-image: none;
  37. border: 1px solid #ccc;
  38. border-radius: 1px;
  39. color: inherit;
  40. padding: 6px 12px;
  41. }
  42. #sqzx td {
  43. padding: 6px 0 5px 10px;
  44. width: 150px;
  45. }
  46. .lxr ul li {
  47. float: left;
  48. list-style: none;
  49. width: 30%;
  50. margin-bottom: 5px;
  51. padding-top: 10px;
  52. }
  53. .clearFix:after {
  54. content: "";
  55. display: block;
  56. clear: both;
  57. }
  58. .form-group {
  59. padding-left: 40px;
  60. margin-bottom: 0;
  61. }
  62. textarea {
  63. height: 70px;
  64. border: 1px solid #ccc;
  65. border-radius: 1px;
  66. width: 50%;
  67. resize: none;
  68. }
  69. .textarea_box {
  70. margin-top: 10px;
  71. }
  72. .box_content {
  73. border-bottom: 1px solid #ccc;
  74. }
  75. .tj_content {
  76. border: 1px solid #e6e6e6;
  77. border-radius: 5px;
  78. }
  79. .t-shade {
  80. position: fixed;
  81. top: 0;
  82. left: 0;
  83. width: 100%;
  84. background: rgba(0, 0, 0, 0.48);
  85. z-index: 10004;
  86. display: none;
  87. }
  88. .lyxz .shade_k {
  89. z-index: 10005;
  90. width: 40%;
  91. left: 30%;
  92. position: absolute;
  93. background-color: rgb(255, 255, 255);
  94. box-shadow: rgba(0, 0, 0, 0.298039) 1px 1px 50px;
  95. margin: 20% auto;
  96. border-radius: 5px;
  97. }
  98. .shade_title {
  99. padding: 0 80px 0 20px;
  100. height: 42px;
  101. line-height: 42px;
  102. border-bottom: 1px solid #eee;
  103. font-size: 16px;
  104. color: #FFFFFF;
  105. overflow: hidden;
  106. background-color: #00a1cb;
  107. border-radius: 2px 2px 0 0;
  108. position: relative;
  109. border-top-left-radius: 5px;
  110. border-top-right-radius: 5px;
  111. }
  112. .cx {
  113. display: block;
  114. }
  115. .setwin {
  116. position: absolute;
  117. right: 15px;
  118. top: 5px;
  119. font-size: 0;
  120. line-height: initial;
  121. }
  122. .setwin a {
  123. position: relative;
  124. width: 16px;
  125. height: 16px;
  126. font-size: 20px;
  127. color: #fff;
  128. }
  129. .xg i {
  130. font-size: 16px;
  131. }
  132. .hidens {
  133. display: none;
  134. }
  135. .inpBox {
  136. border: 1px solid #cccccc;
  137. height: 31px;
  138. width: 220px;
  139. display: inline-block;
  140. position: relative;
  141. vertical-align: middle;
  142. position: absolute;
  143. left: 0px;
  144. top: 8px;
  145. z-index: 111;
  146. }
  147. .selDpart1{
  148. position: absolute;
  149. left: 0px;
  150. top: 30px;
  151. z-index: 11111;
  152. width: 220px;
  153. line-height: 30px;
  154. background: #FFFFFF;
  155. display: none;
  156. }
  157. #sponsor{
  158. width: 218px;
  159. border: 1px solid #00a1cb;
  160. margin: 0;
  161. padding: 0;
  162. list-style: none;
  163. max-height: 212px;
  164. overflow-x: hidden;
  165. overflow-y: scroll;
  166. }
  167. #sponsor li{
  168. margin: 0;
  169. padding-left: 10px;
  170. width: 220px;
  171. height: 30px;
  172. line-height: 30px;
  173. list-style: none;
  174. }
  175. #sponsor li:hover{
  176. background: #00a1cb;
  177. }
  178. .addTree {
  179. background: #fff;
  180. position: absolute;
  181. width: 100%;
  182. border: 1px solid darkgrey;
  183. right: 0;
  184. top: 29px;
  185. display: none;
  186. z-index: 222;
  187. }
  188. .xl {
  189. display: inline-block;
  190. background: url(../../img/dropDown.png) no-repeat;
  191. height: 100%;
  192. background-position: center center;
  193. width: 20px;
  194. position: absolute;
  195. right: 0;
  196. top: 0px;
  197. /* background-color: #f7bc8b; */
  198. cursor: pointer;
  199. }
  200. .ztree li span {
  201. border: none;
  202. padding: 0;
  203. }
  204. .inps {
  205. width: 217px;
  206. height: 29px;
  207. outline: none;
  208. border: 0;
  209. border-image-width: 0;
  210. padding: 0;
  211. padding-left: 3px;
  212. }
  213. .xl {
  214. display: inline-block;
  215. background: url(../img/dropDown.png) no-repeat;
  216. height: 100%;
  217. background-position: center center;
  218. width: 20px;
  219. position: absolute;
  220. right: 0;
  221. top: 0px;
  222. /* background-color: #f7bc8b; */
  223. cursor: pointer;
  224. }
  225. .Cleans {
  226. display: inline-block;
  227. width: 20px;
  228. position: absolute;
  229. right: 21px;
  230. top: 8px;
  231. display: none;
  232. }
  233. .Min-width {
  234. width: 150px;
  235. }
  236. .btn-default{
  237. background: #FFFFFF;
  238. color: #000000;
  239. }
  240. .tool_downs{
  241. display: flex;
  242. justify-content: space-around;
  243. }
  244. .tool_downs li{
  245. list-style: none;
  246. float: left;
  247. }
  248. .operation_list{
  249. width: 270px;
  250. }
  251. ul{
  252. padding: 0;
  253. }
  254. </style>
  255. </head>
  256. <body class="gray-bg">
  257. <div class="wrapper wrapper-content animated fadeInRight">
  258. <div class="daoHang clearfix">
  259. <div class="dhLeft">
  260. <sapn>
  261. <i class="syIcon"></i>位置:
  262. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  263. <a href="javaScript:;">知识库</a>&gt;
  264. <a class="nowPosition">新版知识库索要记录</a>
  265. </sapn>
  266. </div>
  267. <div class="dhRight">
  268. <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
  269. </div>
  270. </div>
  271. <div style="padding: 10px;" class="tj_content clearFix">
  272. <div style="padding: 10px;" class="tj_content clearFix">
  273. <div>
  274. <div class="box_content">
  275. <table id="sqzx" style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
  276. <tr>
  277. <th>关键字:</th>
  278. <td>
  279. <input type="text" placeholder="输入关键字" id="key" class="Min-width" />
  280. </td>
  281. <th>时间:</th>
  282. <td >
  283. <input type="text" id="starttime" class="" placeholder="请选择时间" style="height: 32px;" />
  284. </td>
  285. <th>紧急程度:</th>
  286. <td>
  287. <select class="select_" id="dealtype">
  288. <option value="">请选择</option>
  289. <option value="0">普通</option>
  290. <option value="1">紧急</option>
  291. </select>
  292. </td>
  293. <th>承办单位:</th>
  294. <td style="position: relative;">
  295. <div class="inpBox">
  296. <input type="text" class="inps" onkeyup="darptSearch()"/>
  297. <i class="Cleans fa fa-close"></i>
  298. <i class="xl xl_one"></i>
  299. <div class="addTree xlAdd">
  300. <ul id="addTreeDemo" class="ztree"></ul>
  301. </div>
  302. </div>
  303. <div class="selDpart1">
  304. <ul id="sponsor">
  305. </ul>
  306. </div>
  307. </td>
  308. <td style="padding-left: 30px;">
  309. <botton class="btns Seach">搜索</botton>
  310. <!--<botton class="btns Export">导出</botton>-->
  311. <botton class="btns add_record">添加</botton>
  312. <botton class="btns Remove">删除</botton>
  313. </td>
  314. </tr>
  315. </table>
  316. </div>
  317. </div>
  318. <div>
  319. <div style="width: 100%;padding: 10px;">
  320. <table id="orderlist" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
  321. <thead>
  322. <tr>
  323. <th data-checkbox="true"></th>
  324. <th data-field="F_Descript" data-formatter="GetCont" data-align="center">文本描述</th>
  325. <th data-field="F_Level" data-align="center" data-formatter="States">级别</th>
  326. <th data-field="F_DeptName" data-align="center">承办单位</th>
  327. <th data-field="F_CreateTime" data-align="center">添加时间</th>
  328. <th data-field="F_CreateUserName" data-align="center">添加人</th>
  329. <th data-field="F_SubmitUserName" data-align="center">提交人</th>
  330. <th data-field="F_SubmitTime" data-align="center">提交时间</th>
  331. <th data-field="F_LimitTime" data-align="center">时限</th>
  332. <th data-field="F_WorkOrderId" data-formatter="Dispose" data-align="center" class="operation_list">操作</th>
  333. </tr>
  334. </thead>
  335. <tbody class="list"></tbody>
  336. </table>
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. <input type="hidden" id="PID" />
  342. <input type="hidden" id="Dpment" />
  343. </div>
  344. <script src="../js/bootstrap-select.js"></script>
  345. <script src="../js/laydate/laydate.js"></script>
  346. <script src="../My97DatePicker/WdatePicker.js"></script>
  347. <script src="../js/zTree/jquery.ztree.core.js"></script>
  348. <script src="../js/search/screen.js"></script>
  349. <script>
  350. $(document).ready(function () {
  351. load();
  352. var str = helper.request.queryString("str");
  353. var wid = helper.request.queryString("wid");
  354. if (wid) {
  355. $('#tel').val(wid);
  356. load();
  357. }
  358. laydate.render({
  359. elem: '#starttime' //指定元素
  360. ,range:'~'
  361. });
  362. load();
  363. });
  364. $("#orderlist").on("click-row.bs.table", function (e, row, ele) {
  365. $('.success').removeClass('success'); //去除之前选中的行的,选中样式
  366. $(ele).addClass('success'); //添加当前选中的 success样式用于区别
  367. });
  368. //获取查询信息
  369. function load() {
  370. //先销毁表格
  371. $('#orderlist').bootstrapTable('destroy');
  372. //初始化表格,动态从服务器加载数据
  373. $("#orderlist").bootstrapTable({
  374. method: "get", //使用get请求到服务器获取数据
  375. url: huayi.config.callcenter_url + "Repository/GetListDemands", //获取数据的Servlet地址
  376. contentType: "application/x-www-form-urlencoded",
  377. striped: true, //表格显示条纹
  378. pagination: true, //启动分页
  379. pageSize: 10, //每页显示的记录数
  380. pageNumber: 1, //当前第几页
  381. pageList: [10, 20, 50, 100], //记录数可选列表
  382. search: false, //是否启用查询
  383. showColumns: false, //显示下拉框勾选要显示的列
  384. showRefresh: false, //显示刷新按钮
  385. sidePagination: "server", //表示服务端请求
  386. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  387. //设置为limit可以获取limit, offset, search, sort, order
  388. queryParamsType: "undefined",
  389. queryParams: function queryParams(params) { //设置查询参数
  390. //alert(params.pageNumber)
  391. var param = {
  392. page: params.pageNumber,
  393. pagesize: params.pageSize,
  394. stime: $('#starttime').val() && $('#starttime').val().split(' ~ ')[0], //=开始时间
  395. etime: $('#starttime').val() && $('#starttime').val().split(' ~ ')[1], //=结束时间
  396. deptid: $("#PID").val(),//承办单位id
  397. level: $("#dealtype").val(),//级别
  398. key:$('#key').val(),
  399. token: $.cookie("token")
  400. };
  401. return param;
  402. },
  403. onLoadSuccess: function (data) { //加载成功时执行
  404. // layer.msg("加载成功");
  405. //console.log(data);
  406. },
  407. onLoadError: function () { //加载失败时执行
  408. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  409. }
  410. });
  411. }
  412. //状态
  413. function States(val, row) {
  414. var html = '';
  415. switch (val + '') {
  416. case '0':
  417. html = '普通';
  418. break;
  419. case '1':
  420. html = '紧急';
  421. break;
  422. }
  423. return html;
  424. }
  425. function GetCont(val) {
  426. if (val) {
  427. var str = '<div '
  428. if (val.length > 30) {
  429. str = str + ' title="' + val + '" ';
  430. val = val.substr(0, 30) + "...";
  431. }
  432. return str + '>' + val + '</div>';
  433. } else {
  434. return '';
  435. }
  436. }
  437. //格式化操作
  438. function Dispose(val, row) {
  439. if(row.F_RepositoryId&&row.F_RepositoryId!=0){
  440. return '<ul class="tool_downs">' +
  441. '<li><a href="javascript:;" class="aBtn" authorize="yes" id="HY_details_' + row.F_DemandsId + '" onclick="see_knowledge(' + row.F_RepositoryId +')" title="查看知识库">查看知识库</a></li>' +
  442. // '<li><a href="javascript:;" class="aBtn" authorize="yes" id="HY_details_' + row.F_DemandsId + '" onclick="add_knowledge(' + row.F_DemandsId +','+row.F_Deptid+')" title="添加知识库">添加知识库</a></li>' +
  443. '<li><a href="javascript:;" class="aBtn" style="margin-left:0px;" authorize="yes" id="HY_details_' + row.F_DemandsId + '" onclick="btn_details(\'' + row.F_DemandsId + '\')" title="详情">详情</a></li>' +
  444. '</ul>';
  445. }else{
  446. return '<ul class="tool_downs">' +
  447. // '<li><a href="javascript:;" class="aBtn" authorize="yes" id="HY_details_' + row.F_DemandsId + '" onclick="see_knowledge(' + row.F_RepositoryId +')" title="查看知识库">查看知识库</a></li>' +
  448. '<li><a href="javascript:;" class="aBtn" authorize="yes" id="HY_details_' + row.F_DemandsId + '" onclick="add_knowledge(' + row.F_DemandsId +','+row.F_Deptid+')" title="添加知识库">添加知识库</a></li>' +
  449. '<li><a href="javascript:;" class="aBtn" style="margin-left:0px;" authorize="yes" id="HY_details_' + row.F_DemandsId + '" onclick="btn_details(\'' + row.F_DemandsId + '\')" title="详情">详情</a></li>' +
  450. '</ul>';
  451. }
  452. }
  453. //查看知识库
  454. function see_knowledge(ids){
  455. //iframe窗
  456. layer.open({
  457. type: 2,
  458. title: '查看知识库详情',
  459. area: ['70%', '60%'],
  460. maxmin:true,
  461. content: 'newRepositoryDetail.html?ids='+ ids
  462. });
  463. }
  464. //添加到知识库
  465. function add_knowledge(str,deptid) {
  466. layer.open({
  467. type: 2,
  468. content: "newRepositoryAdd.html?wid=" + str +"&depId="+deptid, //iframe的url,no代表不显示滚动条
  469. title: '新增知识库',
  470. area: ['60%', '80%'], //宽高
  471. });
  472. }
  473. //查看详情
  474. function btn_details(str) {
  475. layer.open({
  476. type: 2,
  477. content: "../CommonHtml/recordDatil.html?wid=" + str, //iframe的url,no代表不显示滚动条
  478. title: '记录详情',
  479. area: ['60%', '80%'], //宽高
  480. });
  481. }
  482. //编辑
  483. function btn_edit(str) {
  484. layer.open({
  485. type: 2,
  486. content: ["../CommonHtml/recordEdit.html?wid=" + str,'no'], //iframe的url,no代表不显示滚动条
  487. title: '编辑记录',
  488. area: ['60%', '90%'], //宽高
  489. });
  490. }
  491. //删除
  492. function btn_delete(str) {
  493. layer.confirm('确定删除记录?', {
  494. btn: ['是', '否'] //按钮
  495. }, function () {
  496. $.post(huayi.config.callcenter_url + "Repository/DelDemands", {
  497. ids: str,
  498. token: $.cookie("token")
  499. }, function (result) {
  500. result = JSON.parse(result);
  501. if (result.state.toLowerCase() == "success") {
  502. layer.msg("删除成功");
  503. $("#orderlist").bootstrapTable('refresh');
  504. }
  505. })
  506. });
  507. }
  508. //添加记录
  509. $('.add_record').on('click',function(){
  510. layer.open({
  511. type: 2,
  512. content: "../CommonHtml/addRecord.html" , //iframe的url,no代表不显示滚动条
  513. title: '添加记录',
  514. area: ['60%', '80%'], //宽高
  515. });
  516. })
  517. //上传文件
  518. function upload() {
  519. if (document.getElementById("upFile").files.length > 0) {
  520. var formData = new FormData();
  521. formData.append("upFile", document.getElementById("upFile").files[0]);
  522. formData.append("token", $.cookie("token"));
  523. $.ajax({
  524. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  525. type: "POST",
  526. data: formData,
  527. /**
  528. *必须false才会自动加上正确的Content-Type
  529. */
  530. contentType: false,
  531. /**
  532. * 必须false才会避开jQuery对 formdata 的默认处理
  533. * XMLHttpRequest会对 formdata 进行正确的处理
  534. */
  535. processData: false,
  536. success: function (result) {
  537. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  538. $("#upFile").change(function () {
  539. upload();
  540. });
  541. var r = $.parseJSON(result);
  542. if (r.state.toLowerCase() == "success") {
  543. $(".fjnr").text(r.data);
  544. $("#scfj").show();
  545. }
  546. }
  547. });
  548. } else {
  549. layer.confirm('请上传文件!', {
  550. btn: ['确定']
  551. });
  552. }
  553. }
  554. //批量删除Remove
  555. $(".Remove").click(function() {
  556. var ids = $.map($('#orderlist').bootstrapTable('getSelections'),
  557. function(row) {
  558. return row.F_DemandsId;
  559. });
  560. /*判断长度*/
  561. if(ids.length <= 0) {
  562. layer.confirm('没有可删除的选项!', {
  563. btn: ['确定'] //按钮
  564. });
  565. return;
  566. }
  567. layer.confirm('确定要删除吗?',{
  568. btn:['确定','取消']
  569. },function(){
  570. $.post(huayi.config.callcenter_url + "Repository/DelDemands", {
  571. ids: ids,
  572. token: $.cookie("token")
  573. }, function(result) {
  574. result = JSON.parse(result);
  575. if(result.state.toLowerCase() == "success") {
  576. layer.msg("删除成功");
  577. $("#orderlist").bootstrapTable('refresh');
  578. }
  579. })
  580. })
  581. });
  582. //来源
  583. function LY(obj) {
  584. obj.empty();
  585. obj.append('<option selected="selected" value="">请选择</option>');
  586. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  587. "token": $.cookie("token"),
  588. id: 1
  589. }, function (data) {
  590. if (data.state.toLowerCase() == "success") {
  591. var content = data.data;
  592. $(content).each(function (i, n) {
  593. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  594. })
  595. }
  596. })
  597. }
  598. //类别
  599. function LB(obj) {
  600. obj.empty();
  601. obj.append('<option selected="selected" value="">请选择</option>');
  602. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  603. "token": $.cookie("token"),
  604. id: 2
  605. }, function (data) {
  606. if (data.state.toLowerCase() == "success") {
  607. var content = data.data;
  608. $(content).each(function (i, n) {
  609. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  610. })
  611. }
  612. })
  613. }
  614. // 主题
  615. function ZT(obj) {
  616. obj.empty();
  617. obj.append('<option selected="selected" value="">请选择</option>');
  618. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  619. "token": $.cookie("token"),
  620. id: 3
  621. }, function (data) {
  622. if (data.state.toLowerCase() == "success") {
  623. var content = data.data;
  624. $(content).each(function (i, n) {
  625. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  626. })
  627. }
  628. })
  629. }
  630. function tree() {
  631. $.get(huayi.config.callcenter_url + 'Department/GetDeptList', {
  632. "token": $.cookie("token"),
  633. // "pid": pid
  634. }, function (result) {
  635. result = $.parseJSON(result);
  636. $.fn.zTree.init($("#addTreeDemo"), setting1, result.data); //实例化树形图
  637. });
  638. }
  639. var setting1 = {
  640. data: {
  641. key: {
  642. name: "F_DeptName"
  643. },
  644. simpleData: {
  645. enable: true,
  646. idKey: "F_DeptId",
  647. pIdKey: "F_PartentId",
  648. rootPId: 0
  649. }
  650. },
  651. callback: {
  652. onClick: zTreeOnClick
  653. }
  654. };
  655. function zTreeOnClick(event, treeId, treeNode) {
  656. if (treeNode.level >= 2) {
  657. $('.inps').val(treeNode.F_DeptName);
  658. $("#PID").val(treeNode.F_DeptId);
  659. $("#Dpment").val(treeNode.F_DeptId);
  660. $(".Cleans").show();
  661. }
  662. };
  663. function Close() {
  664. $(".lyxz").removeClass("cx");
  665. if ($('audio').length > 0) {
  666. $('audio')[0].pause();
  667. }
  668. }
  669. </script>
  670. </body>
  671. </html>