暫無描述

redeploy.js 16KB

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