| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539 |
- mui.init({})
- var UserCode = helper.cookies.get("usercode");
- var id = helper.request.queryString("id");
- var itype = helper.request.queryString("itype");
- var areaID = helper.request.queryString("areaID");
- var openid = helper.cookies.get("openid");
- //var openid = "oXF5e1mWpX5DajW5_yjNLPKb8ThE";
- //alert(id);
- $(function() {
- // 接收人员
- $('#order_recive').on('tap', function() {
- //alert("ddd");
- getReceiveUser();
- $("#order_recive option").remove();
- });
- //返回列表
- $('.return').on('tap', function() {
- // if (itype==0) {
- // window.location.href = "client_index.html"
- // }if (itype==1) {
- // window.location.href = "client_index.html"
- // } else if (itype==2){
- // window.location.href = "pend_index.html"
- // } else if (itype==3){
- // window.location.href = "finsh_index.html"
- // }
- window.location.href = "details.html?id=" + id + '&itype=' + itype;
- });
- $(".order_unit").on("click", function() {
- var ichk = $("input:checkbox:checked").map(function() {
- return $(this).val();
- }).get().join(",");
- $("#zerenSel").val(ichk);
- })
- //提交按钮
- $('#submit').on('tap', function() {
- var str_ary = '';
- $(".image-box").each(function(i, n) {
- var a = $(n).attr("indexs");
- if(a) {
- if(str_ary) {
- str_ary = str_ary + ',' + a;
- } else {
- str_ary = a;
- }
- }
- })
- if($('#recive_type').attr('data-index') == '') {
- mui.alert('请选择部门!') //请输入工单类型
- } else if($('#ower_recive').attr('data-index') == '') {
- mui.alert('请选择接收人!') //请输入工单类型
- } else if($('#order_reception').val() == '') {
- mui.alert('请输入转派理由!') //填写详细描述
- } else {
- $.ajax({
- type: "post",
- dataType: 'json',
- url: huayi.config.callcenter_url + 'WxLogin/AssignWorkOrder',
- async: true,
- data: {
- orderid: id, //否 strubg 工单编号
- OpenId: openid, //微信openid,
- isend: 0, //否 int 你看一下前端是什么参数
- clbm: $('#recive_type').attr('data-index'), //是 int 部门Id
- clid: $("#ower_recive").attr('data-index'), //否 int 接收人用户id
- cont: $("#order_reception").val(), //否 int 指派说明
- overtime: $('.overtime').find('input[type="radio"]:checked').val(), //超期时间
- sms: $('.order_type').find('input[type="radio"]:checked').val(), //是否短信提醒
- isApprovalp: $('.order_rise').find('input[type="radio"]:checked').val(), //高层审批
- hclid: $("#ower_highse").attr('data-index'),
- // 投诉类市场管理科
- // QualityMonth:$("#order_time").val(), //质保期限
- PreliminaryOpinion: $('#ower_relationship').attr('data-index'), //初审意见
- // 投诉类市场管理科
- isvisit: $('.order_pay').find('input[type="radio"]:checked').val(), //是否回访
- QualityEventLevel: $('#ower_event').attr('data-index'), //事件等级
- ClaimAmount: $('#order_money').attr('data-index'), //索赔金额
- ResponsibleUnit: $("#zerenSel").val(), //责任单位
- ApprovalOpinions: $('.order_opinion').find('input[type="radio"]:checked').val(), //审批意见
- ApprovalDisagree: $("#order_idea").val(), //不同意意见
- CompensationMethod: $('.order_coin').find('input[type="radio"]:checked').val(), //补偿方式
- CompensationMoney: $("#order_make").val(), //补偿钱款
- CResponsibleUnits: $('#ower_ponding').attr('data-index'), //对应责任单位
- Fquantity: $("#order_amount").val(), //实收数量
- ImprovementRequirements: $("#order_demand").val(), //改进要求
- CApprovalNo: $("#order_odd").val(), //审批工作流单号
- // 抽检类市场管理科
- SpotResult: $('#ower_result').attr('data-index'), //抽检结果
- SelfResult: $("#order_spection").val(), //自检结果
- ApprovalNo: $("#order_approve").val(), //对应审批工作流单号
- ReturnAccount: $("#order_sum").val(), //确认返账金额
- // 抽检类质量管理部
- isvisit: $('.order_return').find('input[type="radio"]:checked').val(), //是否否回访
- IsRecord: $('.order_records').find('input[type="radio"]:checked').val(), //是否备案
- ClaimAmount: $("#order_claim").val(), //索赔金额
- // 销售内勤
- ReturnAccount: $("#order_account").val(), //确认返账金额
- // 质量管理科
- Fquantity: $("#order_receipts").val(), //确认实收数量
- F_Files: str_ary
- // openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', //微信openid 测试用
- },
- success: function(data) {
- debugger
- if(data.state == "success") {
- debugger
- mui.toast('成功');
- if(itype == 2) {
- window.location.href = "haveorder_list.html";
- } else {
- window.location.href = "haveorder_list.html";
- }
- } else {
- mui.toast(data.message);
- }
- }
- });
- }
- })
- Ajax()
- //获取详情
- function Ajax() {
- $.ajax({
- url: huayi.config.callcenter_url + 'WxLogin/GetDetails',
- data: {
- id: id, //工单编号
- OpenId: openid, //微信openid,
- },
- async: true,
- dataType: 'json',
- type: 'get', //HTTP请求类型
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var result = data.rows[0];
- if(result.Source == 0) {
- $("#source").hide();
- } else {
- $("#source").show();
- }
- var itype = result.F_State;
- // alert(itype)
- if(itype == 0) {
- $(".dispose1").show();
- $(".dispose2").show();
- } else if(itype == 1) {
- $(".dispose1").hide();
- } else if(itype == 2) {
- $(".dispose2").show();
- } else if(itype == 3) {
- $(".dispose3").show();
- }
- if(result.GDLXName == "咨询") {
- $(".Work_lastDealDiv").hide(); //受理人
- $("#source").hide(); //投诉
- } else {
- $(".Work_lastDealDiv").show(); //受理人
- $("#source").show(); //投诉
- }
- var builName
- if(result.buildingname == null) {
- builName = ""
- } else {
- builName = result.buildingname
- }
- var proName
- if(result.proname == null) {
- proName = ""
- } else {
- proName = result.proname
- }
- var complain
- if(result.ComplaintDepartment == null) {
- complain = ""
- } else {
- complain = result.ComplaintDepartment
- }
- $(".WordID").text(result.ID);
- $("#Work_classname").text(result.F_TypeName); //工单类型
- $("#section").text(result.F_DeptName); //部门
- if($("#section").text() == "市场管理科") {
- $("#gcsp").show();
- }
- if($("#Work_classname").text() == "抽检") {
- $(".SamplTime").show();
- $(".noSamplTime").remove();
- $(".overtime input[type=radio][value='720']").prop("checked", true);
- if($("#section").text() == "市场管理科") {
- $("#cccc").show();
- }
- } else if($("#Work_classname").text() == "投诉") {
- $(".noSamplTime").show();
- $(".SamplTime").remove();
- if($("#section").text() == "市场管理科") {
- $("#aaaa").show();
- }
- } else if($("#Work_classname").text() == "咨询") {
- $(".noSamplTime").show();
- $(".SamplTime").remove();
- if($("#section").text() == "市场管理科") {
- $("#aaaa").show();
- }
- }else if($("#Work_classname").text() == "建议及其他") {
- $(".noSamplTime").show();
- $(".SamplTime").remove();
- if($("#section").text() == "市场管理科") {
- $("#aaaa").show();
- }
- }
- if($("#Work_classname").text() == "抽检") {
-
- if($("#section").text() == "质量管理部") {
- $("#dddd").show();
- }
- } else if($("#Work_classname").text() == "投诉") {
- if($("#section").text() == "质量管理部") {
- $("#bbbb").show();
- }
- } else if($("#Work_classname").text() == "咨询") {
- if($("#section").text() == "质量管理部") {
- $("#bbbbb").show();
- }
- }
- if($("#Work_classname").text() == "销售内勤") {
- if($("#section").text() == "质量管理部") {
- $("#eeee").show();
- }
- }
- }
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
- }
- // 接收部门
- function getDepts() {}
- var recive = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Department/GetAssignDeptList',
- async: false,
- data: {
- },
- dataType: 'json',
- success: function(data) {
- console.log(data)
- recive = data.data[0].children;
- //alert(JSON.stringify(data));
- }
- });
- //接收人员
- function getReceiveUser() {
- renyuan = []
- $.ajax({
- url: huayi.config.callcenter_url + 'UserAccount/GetDeptUserList',
- type: 'get',
- data: {
- deptid: $('#recive_type').attr('data-index'),
- proid: areaID,
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length > -1) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.F_UserId;
- obj.text = v.F_UserName + v.F_WorkNumber;
- renyuan.push(obj);
- //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
- });
- cityPicker5.setData(renyuan);
- }
- }
- },
- });
- }
- //初审意见
- var keyList = [];
- // console.log(keyList);
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
- async: false,
- data: {
- flag: 'SCCS'
- },
- dataType: 'json',
- success: function(data) {
- var key_data = data.data;
- // console.log(data.data);
- $(key_data).each(function(i, n) {
- var obj = {};
- obj.value = n.F_DictionaryValueId;
- obj.text = n.F_Name;
- keyList.push(obj)
- })
- }
- });
- //事件等级
- var grade = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
- async: false,
- data: {
- flag: 'ZLSJDJ'
- },
- dataType: 'json',
- success: function(data) {
- var key_data = data.data;
- // console.log(key_data);
- $(key_data).each(function(i, n) {
- var obj = {};
- obj.value = n.F_DictionaryValueId;
- obj.text = n.F_Name;
- grade.push(obj)
- })
- }
- });
- //对应责任单位
- var parallelism = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
- async: false,
- data: {
- flag: 'ZLZRDW'
- },
- dataType: 'json',
- success: function(data) {
- var key_data = data.data;
- // console.log(key_data);
- $(key_data).each(function(i, n) {
- var obj = {};
- obj.value = n.F_DictionaryValueId;
- obj.text = n.F_Name;
- parallelism.push(obj)
- })
- }
- });
- //抽检结果
- var spot = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
- async: false,
- data: {
- flag: 'SCCJJG'
- },
- dataType: 'json',
- success: function(data) {
- var key_data = data.data;
- // console.log(key_data);
- $(key_data).each(function(i, n) {
- var obj = {};
- obj.value = n.F_DictionaryValueId;
- obj.text = n.F_Name;
- spot.push(obj)
- })
- }
- });
- //高层部门
- var hirise = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'WxLogin/GetHighlevel',
- async: false,
- data: {
- },
- dataType: 'json',
- success: function(data) {
- var key_data = data.data.user;
- console.log(key_data);
- $(key_data).each(function(i, n) {
- var obj = {};
- obj.value = n.F_UserId;
- obj.text = n.F_UserName + n.F_WorkNumber;
- hirise.push(obj)
- })
- }
- });
- (function($, doc) {
- $.init();
- $.ready(function() {
- //接收部门
- var RCiPickers = new $.PopPicker({
- layer: 2
- });
- RCiPickers.setData(recive);
- var RCs = doc.getElementById('showUserPicker1');
- var RCResults = doc.getElementById('recive_type');
- var RCResults2 = doc.getElementById('recive_type1');
- var RCResults3 = doc.getElementById('recive_type2');
- RCs.addEventListener('tap', function(event) {
- RCiPickers.show(function(items) {
- console.log(items)
- if(items[1].text == undefined) {
- RCResults.value = items[0].text;
- RCResults.setAttribute("data-index", items[0].id);
- } else {
- RCResults.value = items[1].text
- RCResults.setAttribute("data-index", items[1].id);
- }
- //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
- //RCResults.setAttribute("data-index", items[0].id);
- //RCResults2.setAttribute("data-index", items[1].id);
- //RCResults3.setAttribute("data-index", items[2].id);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- // 接收人员
- cityPicker5 = new $.PopPicker();
- var showCityPickerButton5 = doc.getElementById('showCityPicker5');
- var cityResult5 = doc.getElementById('ower_recive');
- showCityPickerButton5.addEventListener('tap', function(event) {
- getReceiveUser();
- cityPicker5.show(function(items) {
- if(items[0].text != undefined) {
- cityResult5.value = items[0].text;
- cityResult5.setAttribute("data-index", items[0].value);
- }
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //初审意见
- var cityPicker3 = new $.PopPicker();
- cityPicker3.setData(keyList);
- var showCityPickerButton = doc.getElementById('showCityPicker3');
- var cityResult3 = doc.getElementById('ower_relationship');
- showCityPickerButton.addEventListener('tap', function(event) {
- cityPicker3.show(function(items) {
- cityResult3.value = items[0].text;
- cityResult3.setAttribute("data-index", items[0].text);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //事件等级
- var affair = new $.PopPicker();
- affair.setData(grade);
- var showCityPickerButton4 = doc.getElementById('eventle');
- var cityResultc4 = doc.getElementById('ower_event');
- showCityPickerButton4.addEventListener('tap', function(event) {
- affair.show(function(items) {
- cityResultc4.value = items[0].text;
- cityResultc4.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //对应责任单位
- // var para = new $.PopPicker();
- // para.setData(parallelism);
- // var showCityPickerButton = doc.getElementById('ponding');
- // var cityResultc2 = doc.getElementById('ower_ponding');
- // showCityPickerButton.addEventListener('tap', function(event) {
- // para.show(function(items) {
- // cityResultc2.value = items[0].text;
- // cityResultc2.setAttribute("data-index", items[0].text);
- // //返回 false 可以阻止选择框的关闭
- // //return false;
- // });
- // }, false);
- //事件等级
- var result = new $.PopPicker();
- result.setData(spot);
- var showCityPickerButton6 = doc.getElementById('result');
- var cityResultc6 = doc.getElementById('ower_result');
- showCityPickerButton6.addEventListener('tap', function(event) {
- result.show(function(items) {
- cityResultc6.value = items[0].text;
- cityResultc6.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //高层
- var hir = new $.PopPicker();
- hir.setData(hirise);
- var showCityPickerButton7 = doc.getElementById('showCi');
- var cityResultc7 = doc.getElementById('ower_highse');
- showCityPickerButton7.addEventListener('tap', function(event) {
- hir.show(function(items) {
- cityResultc7.value = items[0].text;
- cityResultc7.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- })
- })(mui, document);
- })
- $('.order_opinion').find('input[type="radio"]').on('change', function() {
- if($(this).val() == "不同意") { //业务办理
- $('.F_Address').show();
- } else {
- $('.F_Address').hide();
- }
- });
- $('.order_coin').find('input[type="radio"]').on('change', function() {
- if($(this).val() == "钱款") { //业务办理
- $('.make').show();
- } else {
- $('.make').hide();
- }
- });
- $('.order_rise').find('input[type="radio"]').on('change', function() {
- if($(this).val() == "1") { //业务办理
- $('#showCi').show();
- } else {
- $('#showCi').hide();
- }
- });
|