| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8" />
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <link rel="stylesheet" href="../css/bootstrap-select.css" />
- <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
- <link rel="stylesheet" href="../css/addappeal.css" />
- <link href="../css/layer/need/layer.css" />
- <link rel="stylesheet" href="../css/init.css" />
- <link rel="stylesheet" href="../js/layui/css/layui.css">
- <script src="../js/laydate/laydate.js"></script>
- <title>新增诉求工单</title>
- <style>
- .reflectCategory-wrapper {
- position: relative;
- }
-
- .reflectCategoryList-wrapper {
- display: none;
- position: absolute;
- top: 38px;
- z-index: 9999;
- line-height: 32px;
- background: #FFF;
- }
-
- #reflectCategoryList {
- height: 240px;
- background: #FFF;
- border: 1px solid #e5e6e7;
- overflow: auto;
- }
-
- #reflectCategoryList li {
- padding: 0 10px;
- width: 100%;
- line-height: 32px;
- }
-
- #reflectCategoryList li:hover {
- background: #00a1cb;
- }
-
- .bootstrap-select .dropdown-menu {
- height: 360px !important;
- }
-
- .bootstrap-select .dropdown-menu li a span.text {
- color: inherit
- }
- </style>
- </head>
- <body>
- <input type="hidden" id="PID" value="" />
- <div class="wrapper wrapper-content animated fadeInRight">
- <div style="padding: 10px" class="tj_content clearFix">
- <div class="Common">
- <table>
- <tr>
- <th class="Importent">反映类别:</th>
- <td class="reflectCategory-wrapper">
- <input type="text" id="reflectCategory" class="form-control" autocomplete="off" />
- <div class="reflectCategoryList-wrapper">
- <ul id="reflectCategoryList">
- </ul>
- </div>
- </td>
- </tr>
- </table>
- <div class="btn_box">
- <button class="btns BC">提交</button>
- </div>
- </div>
- </div>
- </div>
- <script src="../js/layui/layui.js"></script>
- <script src="../js/bootstrap-select.js"></script>
- <script src="../js/adjustHeight.js"></script>
- <script src="../js/zTree/jquery.ztree.core.js"></script>
- <script src="../js/ztreeSelect.js"></script>
- <script src="../Script/Common/huayi.common.js"></script>
- <script>
- var wid = helper.request.queryString("wid");
- console.log(wid)
- $(document).ready(function() {
- getReactionCategory();
- $("#reflectCategory").bind("input propertychange", function() {
- $(".layui-dropdown").hide();
- if($("#reflectCategory").val() == "") {
- $(".reflectCategoryList-wrapper").hide();
- return;
- }
- var debounceGetSearchReactionCategory = debounce(getSearchReactionCategory, 500)
- $(".reflectCategoryList-wrapper").show();
- debounceGetSearchReactionCategory($("#reflectCategory").val())
- })
- $("#reflectCategoryList").on("click", "li", function() {
- $(".reflectCategoryList-wrapper").hide();
- $("#reflectCategory").val($(this).attr("indexName"));
- $("#PID").val($(this).attr("index"));
- });
-
- $(".BC").click(function() {
- Add();
- });
- if(wid) {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "WorkOrder/GetWorkOrderNew",
- dataType: "json",
- async: false,
- data: {
- workorderid: wid,
- type: 0, // 工单信息
- token: $.cookie("token"),
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var Data = data.data.data;
- $("#reflectCategory").val(Data[0].KeyName)
- $("#PID").val(Data[0].F_Key)
- }
- },
- });
- }
- });
- ///修改工单
- function Add() {
- // if(!$("#PID").val()) {
- // layer.msg("请选择反应类别");
- // return
- // }
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "WorkOrder/EditCategory",
- dataType: "json",
- async: true,
- data: {
- workorderid: wid,
- keyid: $("#PID").val(), //=关键词id(多个用英文逗号,隔开) keys
- token: $.cookie("token"),
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.$("#orderlist").bootstrapTable("refresh");
- parent.layer.msg(data.message);
- }
- },
- });
- // }
- }
-
- function closePage() {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.$("#orderlist").bootstrapTable("refresh");
- parent.layer.msg("操作成功");
- }
- function getReactionCategory(pid = 38) {
- $.get(
- huayi.config.callcenter_url + "Dictionary/GetZTreeOld", {
- token: $.cookie("token"),
- pid: pid,
- },
- function(result) {
- result = $.parseJSON(result);
- var content = JSON.parse(result.data);
- layui.use("dropdown", function() {
- var dropdown = layui.dropdown;
- dropdown.render({
- elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
- data: content,
- id: "reflectCategory",
- //菜单被点击的事件
- click: function(obj) {
- $("#reflectCategory").val(obj.title);
- $("#PID").val(obj.id);
- },
- });
- });
- }
- );
- }
- function getSearchReactionCategory(key) {
- $("#reflectCategoryList").empty();
- $.get(
- huayi.config.callcenter_url + "Dictionary/GetKeyListNew", {
- token: $.cookie("token"),
- key: key,
- },
- function(result) {
- result = $.parseJSON(result);
- if(result.state.toLowerCase() === "success") {
- var content = result.data;
- if(content.length > 0) {
- content.forEach(function(e, i) {
- $(
- "<li index='" +
- e.id +
- "' indexName='" +
- e.name +
- "'>" +
- e.names +
- "</li>"
- ).appendTo("#reflectCategoryList");
- });
- } else {
- $("<li index='' indexName=''>没有相关数据</li>").appendTo(
- "#reflectCategoryList"
- );
- }
- }
- }
- );
- }
- function debounce(fun, delay) {
- return function(args) {
- var that = this;
- var _args = args;
- clearTimeout(fun.id);
- fun.id = setTimeout(function() {
- fun.call(that, _args);
- }, delay);
- };
- }
- </script>
- </body>
- </html>
|