Keine Beschreibung

redeploy.js 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  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. // 投诉类市场管理科
  54. QualityMonth:$("#order_time").val(), //质保期限
  55. PreliminaryOpinion: $('#ower_relationship').attr('data-index'), //初审意见
  56. // 投诉类市场管理科
  57. isvisit:$('.order_pay').find('input[type="radio"]:checked').val(), //是否回访
  58. QualityEventLevel: $('#ower_event').attr('data-index'), //事件等级
  59. ClaimAmount: $('#order_money').attr('data-index'), //索赔金额
  60. ResponsibleUnit:$('.order_unit').find('input[type="checkbox"]:checked').val(), //责任单位
  61. ApprovalOpinions: $('.order_opinion').find('input[type="radio"]:checked').val(), //审批意见
  62. ApprovalDisagree:$("#order_idea").val(), //不同意意见
  63. CompensationMethod: $('.order_coin').find('input[type="radio"]:checked').val(), //补偿方式
  64. CompensationMoney:$("#order_make").val(), //补偿钱款
  65. CResponsibleUnits: $('#ower_ponding').attr('data-index'), //对应责任单位
  66. Fquantity:$("#order_amount").val(), //实收数量
  67. ImprovementRequirements:$("#order_demand").val(), //改进要求
  68. CApprovalNo:$("#order_odd").val(), //审批工作流单号
  69. // 抽检类市场管理科
  70. SpotResult: $('#ower_result').attr('data-index'), //抽检结果
  71. SelfResult:$("#order_spection").val(), //自检结果
  72. ApprovalNo:$("#order_approve").val(), //对应审批工作流单号
  73. ReturnAccount:$("#order_sum").val(), //确认返账金额
  74. // 抽检类质量管理部
  75. isvisit: $('.order_return').find('input[type="radio"]:checked').val(), //是否否回访
  76. IsRecord: $('.order_records').find('input[type="radio"]:checked').val(), //是否备案
  77. ClaimAmount:$("#order_claim").val(), //索赔金额
  78. // 销售内勤
  79. ReturnAccount:$("#order_account").val(), //确认返账金额
  80. // 质量管理科
  81. Fquantity:$("#order_receipts").val(), //确认实收数量
  82. // openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', //微信openid 测试用
  83. },
  84. success: function(data) {
  85. debugger
  86. if(data.state == "success") {
  87. debugger
  88. mui.toast('成功');
  89. if (itype==2) {
  90. window.location.href="haveorder_list.html";
  91. } else{
  92. window.location.href="haveorder_list.html";
  93. }
  94. } else {
  95. mui.toast(data.message);
  96. }
  97. }
  98. });
  99. }
  100. })
  101. Ajax()
  102. //获取详情
  103. function Ajax() {
  104. $.ajax({
  105. url: huayi.config.callcenter_url + 'WxLogin/GetDetails',
  106. data: {
  107. id: id, //工单编号
  108. OpenId: openid, //微信openid,
  109. },
  110. async: true,
  111. dataType: 'json',
  112. type: 'get', //HTTP请求类型
  113. success: function(data) {
  114. if(data.state.toLowerCase() == "success") {
  115. var result = data.rows[0];
  116. if(result.Source == 0) {
  117. $("#source").hide();
  118. } else {
  119. $("#source").show();
  120. }
  121. var itype=result.F_State;
  122. // alert(itype)
  123. if(itype == 0) {
  124. $(".dispose1").show();
  125. $(".dispose2").show();
  126. }else if(itype == 1) {
  127. $(".dispose1").hide();
  128. } else if(itype == 2) {
  129. $(".dispose2").show();
  130. } else if(itype == 3) {
  131. $(".dispose3").show();
  132. }
  133. if (result.GDLXName=="咨询") {
  134. $(".Work_lastDealDiv").hide(); //受理人
  135. $("#source").hide(); //投诉
  136. } else{
  137. $(".Work_lastDealDiv").show(); //受理人
  138. $("#source").show(); //投诉
  139. }
  140. var builName
  141. if (result.buildingname==null) {
  142. builName=""
  143. } else{
  144. builName=result.buildingname
  145. }
  146. var proName
  147. if (result.proname==null) {
  148. proName=""
  149. } else{
  150. proName=result.proname
  151. }
  152. var complain
  153. if (result.ComplaintDepartment==null) {
  154. complain=""
  155. } else{
  156. complain=result.ComplaintDepartment
  157. }
  158. $(".WordID").text(result.ID);
  159. $("#Work_classname").text(result.F_TypeName); //工单类型
  160. $("#section").text(result.F_DeptName); //部门
  161. if($("#Work_classname").text()=="抽检"){
  162. if($("#section").text()=="市场管理科"){
  163. $("#cccc").show();
  164. }
  165. }else if($("#Work_classname").text()=="投诉"){
  166. if($("#section").text()=="市场管理科"){
  167. $("#aaaa").show();
  168. }
  169. }else if($("#Work_classname").text()=="咨询"){
  170. if($("#section").text()=="市场管理科"){
  171. $("#aaaa").show();
  172. }
  173. }
  174. if($("#Work_classname").text()=="抽检"){
  175. if($("#section").text()=="质量管理部"){
  176. $("#dddd").show();
  177. }
  178. }else if($("#Work_classname").text()=="投诉"){
  179. if($("#section").text()=="质量管理部"){
  180. $("#bbbb").show();
  181. }
  182. }else if($("#Work_classname").text()=="咨询"){
  183. if($("#section").text()=="质量管理部"){
  184. $("#bbbbb").show();
  185. }
  186. }
  187. if($("#Work_classname").text()=="销售内勤"){
  188. if($("#section").text()=="质量管理部"){
  189. $("#eeee").show();
  190. }
  191. }
  192. }
  193. },
  194. error: function(xhr, type, errorThrown) {
  195. //异常处理;
  196. }
  197. })
  198. }
  199. // 接收部门
  200. function getDepts() {}
  201. var recive = [];
  202. $.ajax({
  203. type: "get",
  204. url: huayi.config.callcenter_url + 'Department/GetDeptList',
  205. async: false,
  206. data: {},
  207. dataType: 'json',
  208. success: function(data) {
  209. console.log(data)
  210. recive = data.data;
  211. //alert(JSON.stringify(data));
  212. }
  213. });
  214. //接收人员
  215. function getReceiveUser() {
  216. renyuan = []
  217. $.ajax({
  218. url: huayi.config.callcenter_url + 'UserAccount/GetDeptUserList',
  219. type: 'get',
  220. data: {
  221. deptid: $('#recive_type').attr('data-index'),
  222. proid: areaID,
  223. },
  224. dataType: "json",
  225. async: true,
  226. success: function(res) {
  227. if(res.state.toLowerCase() === "success") {
  228. res = res.data;
  229. if(res && res.length > -1) {
  230. res.forEach(function(v, i) {
  231. var obj = {};
  232. obj.value = v.F_UserId;
  233. obj.text = v.F_UserName;
  234. renyuan.push(obj);
  235. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  236. });
  237. cityPicker5.setData(renyuan);
  238. }
  239. }
  240. },
  241. });
  242. }
  243. //初审意见
  244. var keyList = [];
  245. // console.log(keyList);
  246. $.ajax({
  247. type: "get",
  248. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  249. async: false,
  250. data: {
  251. flag: 'SCCS'
  252. },
  253. dataType: 'json',
  254. success: function(data) {
  255. var key_data = data.data;
  256. // console.log(data.data);
  257. $(key_data).each(function(i, n) {
  258. var obj = {};
  259. obj.value = n.F_DictionaryValueId;
  260. obj.text = n.F_Name;
  261. keyList.push(obj)
  262. })
  263. }
  264. });
  265. //事件等级
  266. var keyl = [];
  267. // console.log(keyList);
  268. $.ajax({
  269. type: "get",
  270. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  271. async: false,
  272. data: {
  273. flag: 'ZLSJDJ'
  274. },
  275. dataType: 'json',
  276. success: function(data) {
  277. var key_data = data.data;
  278. // console.log(data.data);
  279. $(key_data).each(function(i, n) {
  280. var obj = {};
  281. obj.value = n.F_DictionaryValueId;
  282. obj.text = n.F_Name;
  283. keyl.push(obj)
  284. })
  285. }
  286. });
  287. //对应责任单位
  288. var pding = [];
  289. // console.log(keyList);
  290. $.ajax({
  291. type: "get",
  292. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  293. async: false,
  294. data: {
  295. flag: 'ZLZRDW'
  296. },
  297. dataType: 'json',
  298. success: function(data) {
  299. var key_data = data.data;
  300. // console.log(data.data);
  301. $(key_data).each(function(i, n) {
  302. var obj = {};
  303. obj.value = n.F_DictionaryValueId;
  304. obj.text = n.F_Name;
  305. pding.push(obj)
  306. })
  307. }
  308. });
  309. (function($, doc) {
  310. $.init();
  311. $.ready(function() {
  312. //接收部门
  313. var RCiPickers = new $.PopPicker({
  314. layer: 2
  315. });
  316. RCiPickers.setData(recive);
  317. var RCs = doc.getElementById('showUserPicker1');
  318. var RCResults = doc.getElementById('recive_type');
  319. var RCResults2 = doc.getElementById('recive_type1');
  320. var RCResults3 = doc.getElementById('recive_type2');
  321. RCs.addEventListener('tap', function(event) {
  322. RCiPickers.show(function(items) {
  323. console.log(items)
  324. if(items[1].text == undefined) {
  325. RCResults.value = items[0].text;
  326. RCResults.setAttribute("data-index", items[0].id);
  327. } else {
  328. RCResults.value = items[1].text
  329. RCResults.setAttribute("data-index", items[1].id);
  330. }
  331. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  332. //RCResults.setAttribute("data-index", items[0].id);
  333. //RCResults2.setAttribute("data-index", items[1].id);
  334. //RCResults3.setAttribute("data-index", items[2].id);
  335. //返回 false 可以阻止选择框的关闭
  336. //return false;
  337. });
  338. }, false);
  339. // 接收人员
  340. cityPicker5 = new $.PopPicker();
  341. var showCityPickerButton5 = doc.getElementById('showCityPicker5');
  342. var cityResult5 = doc.getElementById('ower_recive');
  343. showCityPickerButton5.addEventListener('tap', function(event) {
  344. getReceiveUser();
  345. cityPicker5.show(function(items) {
  346. if (items[0].text!=undefined) {
  347. cityResult5.value = items[0].text;
  348. cityResult5.setAttribute("data-index", items[0].value);
  349. }
  350. //返回 false 可以阻止选择框的关闭
  351. //return false;
  352. });
  353. }, false);
  354. //初审意见
  355. var cityPicker3 = new $.PopPicker();
  356. cityPicker3.setData(keyList);
  357. var showCityPickerButton = doc.getElementById('showCityPicker3');
  358. var cityResult3 = doc.getElementById('ower_relationship');
  359. showCityPickerButton.addEventListener('tap', function(event) {
  360. cityPicker3.show(function(items) {
  361. cityResult3.value = items[0].text;
  362. cityResult3.setAttribute("data-index", items[0].value);
  363. //返回 false 可以阻止选择框的关闭
  364. //return false;
  365. });
  366. }, false);
  367. //事件等级
  368. var eventle = new $.PopPicker();
  369. eventle.setData(keyl);
  370. var showCityPickerButton = doc.getElementById('eventle');
  371. var eventle = doc.getElementById('ower_event');
  372. showCityPickerButton.addEventListener('tap', function(event) {
  373. cityPicker3.show(function(items) {
  374. cityResult3.value = items[0].text;
  375. cityResult3.setAttribute("data-index", items[0].value);
  376. //返回 false 可以阻止选择框的关闭
  377. //return false;
  378. });
  379. }, false);
  380. //对应责任单位
  381. // var cityPicker3 = new $.PopPicker();
  382. // cityPicker3.setData(keyList);
  383. // var showCityPickerButton = doc.getElementById('ponding');
  384. // var cityResult3 = doc.getElementById('ower_ponding');
  385. // showCityPickerButton.addEventListener('tap', function(event) {
  386. // cityPicker3.show(function(items) {
  387. // cityResult3.value = items[0].text;
  388. // cityResult3.setAttribute("data-index", items[0].value);
  389. // //返回 false 可以阻止选择框的关闭
  390. // //return false;
  391. // });
  392. // }, false);
  393. })
  394. })(mui, document);
  395. })
  396. $('.order_opinion').find('input[type="radio"]').on('change', function() {
  397. if($(this).val() == "不同意") { //业务办理
  398. $('.F_Address').show();
  399. }else{
  400. $('.F_Address').hide();
  401. }
  402. });
  403. $('.order_coin').find('input[type="radio"]').on('change', function() {
  404. if($(this).val() == "钱款") { //业务办理
  405. $('.make').show();
  406. }else{
  407. $('.make').hide();
  408. }
  409. });