| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- $(document).ready(function () {
- getReactionCategory();
-
- // 反映类别搜索
- $("#reflectCategory").bind("input propertychange", function () {
- $(".layui-dropdown").hide();
- $(".CleansReactionCategory").show();
- if ($("#reflectCategory").val() == "") {
- $(".reflectCategoryList-wrapper").hide();
- return;
- }
- $(".reflectCategoryList-wrapper").show();
- var debounceGetSearchReactionCategory = debounce(getSearchReactionCategory, 500);
- debounceGetSearchReactionCategory($("#reflectCategory").val());
- });
- // 承办单位搜索
- $(".inps").bind("input propertychange", function () {
- $(".xlAdd").css("display", "none");
- $(".selDpart1").css("display", "block");
- if ($(".inps").val() == "") {
- $(".selDpart1").css("display", "none");
- return;
- }
- var debounceDepart = debounce(depart, 500);
- debounceDepart($(".inps").val())
- });
- $("#reflectCategoryList").on("click", "li", function () {
- $(".reflectCategoryList-wrapper").hide();
- $("#reflectCategory").val($(this).attr("indexName"));
- $("#keyid").val($(this).attr("index"));
- });
- });
- // 查看工单详情
- function View(val, row) {
- var workId = val;
- var workIdCode = workId.slice(0, 4);
- var workIdAddress = workId.slice(4, 10);
- var workIdDate = workId.slice(10, 16);
- var workIdSerialNumber = workId.slice(16);
- return (
- '<div class="imgs" ><a class="" style="font-weight: 700;" index="' +
- row.CreateUser +
- '" onclick= ckxq("' +
- row.F_WorkOrderId +
- '") >' +
- '<span style="color: #000000">' +
- workIdCode +
- "</span>" +
- '<span style="color: #FF0000">' +
- workIdAddress +
- "</span>" +
- '<span style="color: #008000">' +
- workIdDate +
- "</span>" +
- '<span style="color: #800080">' +
- workIdSerialNumber +
- "</span>" +
- "</a></div>"
- );
- }
- // 查看详情
- function ckxq(str) {
- layer.open({
- type: 2,
- content: "../CommonHtml/WorkDatil.html?wid=" + str, //iframe的url,no代表不显示滚动条
- title: "工单详情",
- area: ["100%", "100%"], //宽高
- maxmin: true,
- shade: 0,
- });
- }
- // 省平台签收
- function provincialPlatformSignup(str) {
- layer.confirm("确定签收吗?", {
- btn: ["是", "否"], //按钮
- },
- function () {
- $.post(
- huayi.config.callcenter_url + "Affairs/SubmitWorkOrder", {
- ids: str,
- token: $.cookie("token"),
- },
- function (result) {
- result = JSON.parse(result);
- if (result.state.toLowerCase() == "success") {
- layer.msg("操作成功");
- load();
- }
- }
- );
- }
- );
- }
- // 省平台退回
- function provincialPlatformReturn(str) {
- layer.open({
- type: 2,
- content: "../CommonHtml/provincialPlatformReturn.html?wid=" + str, //iframe的url,no代表不显示滚动条
- title: "省平台退回",
- area: ["70%", "70%"], //宽高
- shade: 0,
- });
- }
- // 省平台申请延时
- function provincialPlatformApplicationDelay(str) {
- layer.open({
- type: 2,
- content: "../CommonHtml/provincialPlatformApplicationDelay.html?wid=" + str, //iframe的url,no代表不显示滚动条
- title: "省平台申请延时",
- area: ["70%", "70%"], //宽高
- shade: 0,
- });
- }
- // 省平台反馈
- function provincialPlatformFeedback(str) {
- layer.open({
- type: 2,
- content: "../CommonHtml/provincialPlatformFeedback.html?wid=" + str, //iframe的url,no代表不显示滚动条
- title: "省平台反馈",
- area: ["70%", "70%"], //宽高
- shade: 0,
- });
- }
- // 服务工单上报
- function reportServiceWorkOrder(str) {
- layer.open({
- type: 2,
- content: "../CommonHtml/provincialPlatformReport.html?wid=" + str, //iframe的url,no代表不显示滚动条
- title: "省平台上报",
- area: ["70%", "70%"], //宽高
- shade: 0,
- });
- }
- function getReactionCategory(pid = 38) {
- $.get(
- huayi.config.callcenter_url + "Dictionary/GetZTreeNew",
- {
- 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",
- isclickparent: true,
- //菜单被点击的事件
- click: function (obj) {
- $("#reflectCategory").val(obj.title);
- $("#keyid").val(obj.id);
- $(".CleansReactionCategory").show();
- },
- });
- });
- }
- );
- }
- 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);
- };
- }
- $(".CleansReactionCategory").click(function () {
- $("#reflectCategory").val("");
- $("#keyid").val("");
- $(".CleansReactionCategory").hide();
- });
- $("#sponsor").on("click", "li", function () {
- $(".selDpart1").css("display", "none");
- $(".inps").val($(this).html());
- $("#PID").val($(this).attr("index"));
- $("#Dpment").val($(this).attr("index"));
- $(".Cleans").show();
- });
- ///部门
- function depart(dept) {
- $("#sponsor").empty();
- $.getJSON(
- huayi.config.callcenter_url + "Department/GetDeptListByDept",
- {
- token: $.cookie("token"),
- dept: dept,
- },
- function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $(
- "<li index='" +
- n.F_DeptId +
- "'>" +
- n.F_DeptName +
- "</li>"
- ).appendTo("#sponsor");
- });
- }
- }
- );
- }
|