Brak opisu

redeploy.js 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. mui.init({})
  2. var UserCode = helper.cookies.get("usercode");
  3. var id = helper.request.queryString("id");
  4. var itype = helper.request.queryString("itype");
  5. var areaID = helper.request.queryString("areaID");
  6. var openid = helper.cookies.get("openid");
  7. //var openid = "oXF5e1mWpX5DajW5_yjNLPKb8ThE";
  8. //alert(id);
  9. $(function() {
  10. // 接收人员
  11. $('#order_recive').on('tap', function() {
  12. //alert("ddd");
  13. getReceiveUser();
  14. $("#order_recive option").remove();
  15. });
  16. //返回列表
  17. $('.return').on('tap', function() {
  18. // if (itype==0) {
  19. // window.location.href = "client_index.html"
  20. // }if (itype==1) {
  21. // window.location.href = "client_index.html"
  22. // } else if (itype==2){
  23. // window.location.href = "pend_index.html"
  24. // } else if (itype==3){
  25. // window.location.href = "finsh_index.html"
  26. // }
  27. window.location.href = "details.html?id=" + id + '&itype=' + itype;
  28. });
  29. $(".order_unit").on("click", function() {
  30. var ichk = $("input:checkbox:checked").map(function() {
  31. return $(this).val();
  32. }).get().join(",");
  33. $("#zerenSel").val(ichk);
  34. })
  35. //提交按钮
  36. $('#submit').on('tap', function() {
  37. debugger
  38. var str_ary = '';
  39. $(".image-box").each(function(i, n) {
  40. var a = $(n).attr("indexs");
  41. if(a) {
  42. if(str_ary) {
  43. str_ary = str_ary + ',' + a;
  44. } else {
  45. str_ary = a;
  46. }
  47. }
  48. })
  49. if($('#ower_recive').val() && !$("#ower_recive").attr('data-index')){
  50. mui.alert('请输入正确的姓名')
  51. return
  52. }
  53. if($('#recive_type').attr('data-index') == '') {
  54. mui.alert('请选择部门!') //请输入工单类型
  55. } else if($('#order_reception').val() == '') {
  56. mui.alert('请输入转派理由!') //填写详细描述
  57. } else {
  58. $.ajax({
  59. type: "post",
  60. dataType: 'json',
  61. url: huayi.config.callcenter_url + 'WxLogin/AssignWorkOrder',
  62. async: true,
  63. data: {
  64. orderid: id, //否 strubg 工单编号
  65. OpenId: openid, //微信openid,
  66. isend: 0, //否 int 你看一下前端是什么参数
  67. clbm: $('#recive_type').attr('data-index'), //是 int 部门Id
  68. clid: $("#ower_recive").attr('data-index'), //否 int 接收人用户id
  69. cont: $("#order_reception").val(), //否 int 指派说明
  70. overtime: $('.overtime').find('input[type="radio"]:checked').val(), //超期时间
  71. sms: $('.order_type').find('input[type="radio"]:checked').val(), //是否短信提醒
  72. isApprovalp: $('.order_rise').find('input[type="radio"]:checked').val(), //高层审批
  73. hclid: $("#ower_highse").attr('data-index'),
  74. // 投诉类市场管理科
  75. // QualityMonth:$("#order_time").val(), //质保期限
  76. PreliminaryOpinion: $('#ower_relationship').attr('data-index'), //初审意见
  77. // 投诉类市场管理科
  78. isvisit: $('.order_pay').find('input[type="radio"]:checked').val(), //是否回访
  79. QualityEventLevel: $('#ower_event').attr('data-index'), //事件等级
  80. ClaimAmount: $('#order_money').attr('data-index'), //索赔金额
  81. ResponsibleUnit: $("#zerenSel").val(), //责任单位
  82. ApprovalOpinions: $('.order_opinion').find('input[type="radio"]:checked').val(), //审批意见
  83. ApprovalDisagree: $("#order_idea").val(), //不同意意见
  84. CompensationMethod: $('.order_coin').find('input[type="radio"]:checked').val(), //补偿方式
  85. CompensationMoney: $("#order_make").val(), //补偿钱款
  86. CResponsibleUnits: $('#ower_ponding').attr('data-index'), //对应责任单位
  87. Fquantity: $("#order_amount").val(), //实收数量
  88. ImprovementRequirements: $("#order_demand").val(), //改进要求
  89. CApprovalNo: $("#order_odd").val(), //审批工作流单号
  90. // 抽检类市场管理科
  91. SpotResult: $('#ower_result').attr('data-index'), //抽检结果
  92. SelfResult: $("#order_spection").val(), //自检结果
  93. ApprovalNo: $("#order_approve").val(), //对应审批工作流单号
  94. ReturnAccount: $("#order_sum").val(), //确认返账金额
  95. // 抽检类质量管理部
  96. isvisit: $('.order_return').find('input[type="radio"]:checked').val(), //是否否回访
  97. IsRecord: $('.order_records').find('input[type="radio"]:checked').val(), //是否备案
  98. ClaimAmount: $("#order_claim").val(), //索赔金额
  99. // 销售内勤
  100. ReturnAccount: $("#order_account").val(), //确认返账金额
  101. // 质量管理科
  102. Fquantity: $("#order_receipts").val(), //确认实收数量
  103. F_Files: str_ary
  104. // openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', //微信openid 测试用
  105. },
  106. success: function(data) {
  107. debugger
  108. if(data.state == "success") {
  109. debugger
  110. mui.toast('成功');
  111. if(itype == 2) {
  112. window.location.href = "haveorder_list.html";
  113. } else {
  114. window.location.href = "haveorder_list.html";
  115. }
  116. } else {
  117. mui.toast(data.message);
  118. }
  119. }
  120. });
  121. }
  122. })
  123. Ajax()
  124. //获取详情
  125. function Ajax() {
  126. $.ajax({
  127. url: huayi.config.callcenter_url + 'WxLogin/GetDetails',
  128. data: {
  129. id: id, //工单编号
  130. OpenId: openid, //微信openid,
  131. },
  132. async: true,
  133. dataType: 'json',
  134. type: 'get', //HTTP请求类型
  135. success: function(data) {
  136. if(data.state.toLowerCase() == "success") {
  137. var result = data.rows[0];
  138. if(result.Source == 0) {
  139. $("#source").hide();
  140. } else {
  141. $("#source").show();
  142. }
  143. var itype = result.F_State;
  144. // alert(itype)
  145. if(itype == 0) {
  146. $(".dispose1").show();
  147. $(".dispose2").show();
  148. } else if(itype == 1) {
  149. $(".dispose1").hide();
  150. } else if(itype == 2) {
  151. $(".dispose2").show();
  152. } else if(itype == 3) {
  153. $(".dispose3").show();
  154. }
  155. if(result.GDLXName == "咨询") {
  156. $(".Work_lastDealDiv").hide(); //受理人
  157. $("#source").hide(); //投诉
  158. } else {
  159. $(".Work_lastDealDiv").show(); //受理人
  160. $("#source").show(); //投诉
  161. }
  162. var builName
  163. if(result.buildingname == null) {
  164. builName = ""
  165. } else {
  166. builName = result.buildingname
  167. }
  168. var proName
  169. if(result.proname == null) {
  170. proName = ""
  171. } else {
  172. proName = result.proname
  173. }
  174. var complain
  175. if(result.ComplaintDepartment == null) {
  176. complain = ""
  177. } else {
  178. complain = result.ComplaintDepartment
  179. }
  180. $(".WordID").text(result.ID);
  181. $("#Work_classname").text(result.F_TypeName); //工单类型
  182. $("#section").text(result.F_DeptName); //部门
  183. if($("#section").text() == "市场管理科") {
  184. $("#gcsp").show();
  185. }
  186. if($("#Work_classname").text() == "抽检") {
  187. $(".SamplTime").show();
  188. $(".noSamplTime").remove();
  189. $(".overtime input[type=radio][value='720']").prop("checked", true);
  190. if($("#section").text() == "市场管理科") {
  191. $("#cccc").show();
  192. }
  193. } else if($("#Work_classname").text() == "投诉") {
  194. $(".noSamplTime").show();
  195. $(".SamplTime").remove();
  196. if($("#section").text() == "市场管理科") {
  197. $("#aaaa").show();
  198. }
  199. } else if($("#Work_classname").text() == "咨询") {
  200. $(".noSamplTime").show();
  201. $(".SamplTime").remove();
  202. if($("#section").text() == "市场管理科") {
  203. $("#aaaa").show();
  204. }
  205. }else if($("#Work_classname").text() == "建议及其他") {
  206. $(".noSamplTime").show();
  207. $(".SamplTime").remove();
  208. if($("#section").text() == "市场管理科") {
  209. $("#aaaa").show();
  210. }
  211. }
  212. if($("#Work_classname").text() == "抽检") {
  213. if($("#section").text() == "质量管理部") {
  214. $("#dddd").show();
  215. }
  216. } else if($("#Work_classname").text() == "投诉") {
  217. if($("#section").text() == "质量管理部") {
  218. $("#bbbb").show();
  219. }
  220. } else if($("#Work_classname").text() == "咨询") {
  221. if($("#section").text() == "质量管理部") {
  222. $("#bbbbb").show();
  223. }
  224. }
  225. if($("#Work_classname").text() == "销售内勤") {
  226. if($("#section").text() == "质量管理部") {
  227. $("#eeee").show();
  228. }
  229. }
  230. if (result.F_limit>0) {
  231. $(".overtime input[type=radio][value="+result.F_limit+"]").prop("checked", true);
  232. $(".overtime input").attr("disabled", "disabled");
  233. $(".residue").show();
  234. $(".residueTime").text(result.RemainingTime);
  235. }
  236. }
  237. },
  238. error: function(xhr, type, errorThrown) {
  239. //异常处理;
  240. }
  241. })
  242. }
  243. // 接收部门
  244. function getDepts() {}
  245. var recive = [];
  246. $.ajax({
  247. type: "get",
  248. url: huayi.config.callcenter_url + 'Department/GetAssignDeptList',
  249. async: false,
  250. data: {
  251. },
  252. dataType: 'json',
  253. success: function(data) {
  254. console.log(data)
  255. recive = data.data[0].children;
  256. //alert(JSON.stringify(data));
  257. }
  258. });
  259. //接收人员
  260. function getReceiveUser() {
  261. renyuan = []
  262. $.ajax({
  263. url: huayi.config.callcenter_url + 'UserAccount/GetDeptUserList',
  264. type: 'get',
  265. data: {
  266. deptid: $('#recive_type').attr('data-index'),
  267. proid: areaID,
  268. },
  269. dataType: "json",
  270. async: true,
  271. success: function(res) {
  272. if(res.state.toLowerCase() === "success") {
  273. res = res.data;
  274. if(res && res.length > -1) {
  275. res.forEach(function(v, i) {
  276. var obj = {};
  277. obj.value = v.F_UserId;
  278. obj.text = v.F_UserName + v.F_WorkNumber;
  279. renyuan.push(obj);
  280. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  281. });
  282. cityPicker5.setData(renyuan);
  283. }
  284. }
  285. },
  286. });
  287. }
  288. //初审意见
  289. var keyList = [];
  290. // console.log(keyList);
  291. $.ajax({
  292. type: "get",
  293. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  294. async: false,
  295. data: {
  296. flag: 'SCCS'
  297. },
  298. dataType: 'json',
  299. success: function(data) {
  300. var key_data = data.data;
  301. // console.log(data.data);
  302. $(key_data).each(function(i, n) {
  303. var obj = {};
  304. obj.value = n.F_DictionaryValueId;
  305. obj.text = n.F_Name;
  306. keyList.push(obj)
  307. })
  308. }
  309. });
  310. //事件等级
  311. var grade = [];
  312. $.ajax({
  313. type: "get",
  314. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  315. async: false,
  316. data: {
  317. flag: 'ZLSJDJ'
  318. },
  319. dataType: 'json',
  320. success: function(data) {
  321. var key_data = data.data;
  322. // console.log(key_data);
  323. $(key_data).each(function(i, n) {
  324. var obj = {};
  325. obj.value = n.F_DictionaryValueId;
  326. obj.text = n.F_Name;
  327. grade.push(obj)
  328. })
  329. }
  330. });
  331. //对应责任单位
  332. var parallelism = [];
  333. $.ajax({
  334. type: "get",
  335. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  336. async: false,
  337. data: {
  338. flag: 'ZLZRDW'
  339. },
  340. dataType: 'json',
  341. success: function(data) {
  342. var key_data = data.data;
  343. // console.log(key_data);
  344. $(key_data).each(function(i, n) {
  345. var obj = {};
  346. obj.value = n.F_DictionaryValueId;
  347. obj.text = n.F_Name;
  348. parallelism.push(obj)
  349. })
  350. }
  351. });
  352. //抽检结果
  353. var spot = [];
  354. $.ajax({
  355. type: "get",
  356. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  357. async: false,
  358. data: {
  359. flag: 'SCCJJG'
  360. },
  361. dataType: 'json',
  362. success: function(data) {
  363. var key_data = data.data;
  364. // console.log(key_data);
  365. $(key_data).each(function(i, n) {
  366. var obj = {};
  367. obj.value = n.F_DictionaryValueId;
  368. obj.text = n.F_Name;
  369. spot.push(obj)
  370. })
  371. }
  372. });
  373. //高层部门
  374. var hirise = [];
  375. $.ajax({
  376. type: "get",
  377. url: huayi.config.callcenter_url + 'WxLogin/GetHighlevel',
  378. async: false,
  379. data: {
  380. },
  381. dataType: 'json',
  382. success: function(data) {
  383. var key_data = data.data.user;
  384. console.log(key_data);
  385. $(key_data).each(function(i, n) {
  386. var obj = {};
  387. obj.value = n.F_UserId;
  388. obj.text = n.F_UserName + n.F_WorkNumber;
  389. hirise.push(obj)
  390. })
  391. }
  392. });
  393. //指派人员
  394. $('#ower_recive').blur(function () {
  395. //根据姓名获取信息
  396. $.ajax({
  397. url: huayi.config.callcenter_url + 'Department/GetWXDept',
  398. data: {
  399. name:$('#ower_recive').val(),
  400. OpenId: openid, //微信openid,
  401. },
  402. async: true,
  403. dataType: 'json',
  404. type: 'get', //HTTP请求类型
  405. success: function(data) {
  406. if(data.state.toLowerCase() == "success") {
  407. var result = data.data;
  408. $('#recive_type').val(result.depname);
  409. $('#recive_type').attr('data-index',result.deptid);
  410. $('#ower_recive').attr('data-index',result.userid);
  411. }
  412. },
  413. error: function(xhr, type, errorThrown) {
  414. //异常处理;
  415. }
  416. })
  417. });
  418. (function($, doc) {
  419. $.init();
  420. $.ready(function() {
  421. //接收部门
  422. var RCiPickers = new $.PopPicker({
  423. layer: 3
  424. });
  425. RCiPickers.setData(recive);
  426. var RCs = doc.getElementById('showUserPicker1');
  427. var RCResults = doc.getElementById('recive_type');
  428. var RCResults2 = doc.getElementById('recive_type1');
  429. var RCResults3 = doc.getElementById('recive_type2');
  430. RCs.addEventListener('tap', function(event) {
  431. RCiPickers.show(function(items) {
  432. console.log(items)
  433. if(items[2].text){
  434. RCResults.value = items[2].text
  435. RCResults.setAttribute("data-index", items[2].id);
  436. }else if(items[1].text){
  437. RCResults.value = items[1].text
  438. RCResults.setAttribute("data-index", items[1].id);
  439. }else{
  440. RCResults.value = items[0].text;
  441. RCResults.setAttribute("data-index", items[0].id);
  442. }
  443. // if(items[1].text == undefined) {
  444. // RCResults.value = items[0].text;
  445. // RCResults.setAttribute("data-index", items[0].id);
  446. // } else {
  447. // RCResults.value = items[1].text
  448. // RCResults.setAttribute("data-index", items[1].id);
  449. // }
  450. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  451. //RCResults.setAttribute("data-index", items[0].id);
  452. //RCResults2.setAttribute("data-index", items[1].id);
  453. //RCResults3.setAttribute("data-index", items[2].id);
  454. //返回 false 可以阻止选择框的关闭
  455. //return false;
  456. });
  457. }, false);
  458. // // 接收人员
  459. // cityPicker5 = new $.PopPicker();
  460. // var showCityPickerButton5 = doc.getElementById('showCityPicker5');
  461. // var cityResult5 = doc.getElementById('ower_recive');
  462. // showCityPickerButton5.addEventListener('tap', function(event) {
  463. // getReceiveUser();
  464. // cityPicker5.show(function(items) {
  465. // if(items[0].text != undefined) {
  466. // cityResult5.value = items[0].text;
  467. // cityResult5.setAttribute("data-index", items[0].value);
  468. // }
  469. //
  470. // //返回 false 可以阻止选择框的关闭
  471. // //return false;
  472. // });
  473. // }, false);
  474. //初审意见
  475. var cityPicker3 = new $.PopPicker();
  476. cityPicker3.setData(keyList);
  477. var showCityPickerButton = doc.getElementById('showCityPicker3');
  478. var cityResult3 = doc.getElementById('ower_relationship');
  479. showCityPickerButton.addEventListener('tap', function(event) {
  480. cityPicker3.show(function(items) {
  481. cityResult3.value = items[0].text;
  482. cityResult3.setAttribute("data-index", items[0].text);
  483. //返回 false 可以阻止选择框的关闭
  484. //return false;
  485. });
  486. }, false);
  487. //事件等级
  488. var affair = new $.PopPicker();
  489. affair.setData(grade);
  490. var showCityPickerButton4 = doc.getElementById('eventle');
  491. var cityResultc4 = doc.getElementById('ower_event');
  492. showCityPickerButton4.addEventListener('tap', function(event) {
  493. affair.show(function(items) {
  494. cityResultc4.value = items[0].text;
  495. cityResultc4.setAttribute("data-index", items[0].value);
  496. //返回 false 可以阻止选择框的关闭
  497. //return false;
  498. });
  499. }, false);
  500. //对应责任单位
  501. // var para = new $.PopPicker();
  502. // para.setData(parallelism);
  503. // var showCityPickerButton = doc.getElementById('ponding');
  504. // var cityResultc2 = doc.getElementById('ower_ponding');
  505. // showCityPickerButton.addEventListener('tap', function(event) {
  506. // para.show(function(items) {
  507. // cityResultc2.value = items[0].text;
  508. // cityResultc2.setAttribute("data-index", items[0].text);
  509. // //返回 false 可以阻止选择框的关闭
  510. // //return false;
  511. // });
  512. // }, false);
  513. //事件等级
  514. var result = new $.PopPicker();
  515. result.setData(spot);
  516. var showCityPickerButton6 = doc.getElementById('result');
  517. var cityResultc6 = doc.getElementById('ower_result');
  518. showCityPickerButton6.addEventListener('tap', function(event) {
  519. result.show(function(items) {
  520. cityResultc6.value = items[0].text;
  521. cityResultc6.setAttribute("data-index", items[0].value);
  522. //返回 false 可以阻止选择框的关闭
  523. //return false;
  524. });
  525. }, false);
  526. //高层
  527. var hir = new $.PopPicker();
  528. hir.setData(hirise);
  529. var showCityPickerButton7 = doc.getElementById('showCi');
  530. var cityResultc7 = doc.getElementById('ower_highse');
  531. showCityPickerButton7.addEventListener('tap', function(event) {
  532. hir.show(function(items) {
  533. cityResultc7.value = items[0].text;
  534. cityResultc7.setAttribute("data-index", items[0].value);
  535. //返回 false 可以阻止选择框的关闭
  536. //return false;
  537. });
  538. }, false);
  539. })
  540. })(mui, document);
  541. })
  542. $('.order_opinion').find('input[type="radio"]').on('change', function() {
  543. if($(this).val() == "不同意") { //业务办理
  544. $('.F_Address').show();
  545. } else {
  546. $('.F_Address').hide();
  547. }
  548. });
  549. $('.order_coin').find('input[type="radio"]').on('change', function() {
  550. if($(this).val() == "钱款") { //业务办理
  551. $('.make').show();
  552. } else {
  553. $('.make').hide();
  554. }
  555. });
  556. $('.order_rise').find('input[type="radio"]').on('change', function() {
  557. if($(this).val() == "1") { //业务办理
  558. $('#showCi').show();
  559. } else {
  560. $('#showCi').hide();
  561. }
  562. });