Nessuna descrizione

dispose.js 12KB

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