Bez popisu

redeploy.js 15KB

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