No Description

dispose.js 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  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 monad = [];
  192. $.ajax({
  193. type: "get",
  194. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  195. async: false,
  196. data: {
  197. flag: 'WCLYY'
  198. },
  199. dataType: 'json',
  200. success: function(data) {
  201. var key_data = data.data;
  202. // console.log(key_data);
  203. $(key_data).each(function(i, n) {
  204. var obj = {};
  205. obj.value = n.F_DictionaryValueId;
  206. obj.text = n.F_Name;
  207. monad.push(obj)
  208. })
  209. }
  210. });
  211. //生产基地
  212. var base = [];
  213. $.ajax({
  214. type: "get",
  215. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  216. async: false,
  217. data: {
  218. flag: 'SCSCJD'
  219. },
  220. dataType: 'json',
  221. success: function(data) {
  222. var key_data = data.data;
  223. // console.log(key_data);
  224. $(key_data).each(function(i, n) {
  225. var obj = {};
  226. obj.value = n.F_DictionaryValueId;
  227. obj.text = n.F_Name;
  228. base.push(obj)
  229. })
  230. }
  231. });
  232. //事件等级
  233. var grade = [];
  234. $.ajax({
  235. type: "get",
  236. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  237. async: false,
  238. data: {
  239. flag: 'ZLSJDJ'
  240. },
  241. dataType: 'json',
  242. success: function(data) {
  243. var key_data = data.data;
  244. // console.log(key_data);
  245. $(key_data).each(function(i, n) {
  246. var obj = {};
  247. obj.value = n.F_DictionaryValueId;
  248. obj.text = n.F_Name;
  249. grade.push(obj)
  250. })
  251. }
  252. });
  253. //对应责任单位
  254. var parallelism = [];
  255. $.ajax({
  256. type: "get",
  257. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  258. async: false,
  259. data: {
  260. flag: 'ZLZRDW'
  261. },
  262. dataType: 'json',
  263. success: function(data) {
  264. var key_data = data.data;
  265. // console.log(key_data);
  266. $(key_data).each(function(i, n) {
  267. var obj = {};
  268. obj.value = n.F_DictionaryValueId;
  269. obj.text = n.F_Name;
  270. parallelism.push(obj)
  271. })
  272. }
  273. });
  274. //生产基地
  275. var base = [];
  276. $.ajax({
  277. type: "get",
  278. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  279. async: false,
  280. data: {
  281. flag: 'SCSCJD'
  282. },
  283. dataType: 'json',
  284. success: function(data) {
  285. var key_data = data.data;
  286. // console.log(key_data);
  287. $(key_data).each(function(i, n) {
  288. var obj = {};
  289. obj.value = n.F_DictionaryValueId;
  290. obj.text = n.F_Name;
  291. base.push(obj)
  292. })
  293. }
  294. });
  295. (function($, doc) {
  296. $.init();
  297. $.ready(function() {
  298. //未处理原因
  299. var cityc = new $.PopPicker();
  300. cityc.setData(monad);
  301. var showCityPickerButton1 = doc.getElementById('showCityPicker5');
  302. var cityResultc1 = doc.getElementById('ower_recive');
  303. showCityPickerButton1.addEventListener('tap', function(event) {
  304. cityc.show(function(items) {
  305. cityResultc1.value = items[0].text;
  306. cityResultc1.setAttribute("data-index", items[0].value);
  307. //返回 false 可以阻止选择框的关闭
  308. //return false;
  309. });
  310. }, false);
  311. //生产基地
  312. var matrix = new $.PopPicker();
  313. matrix.setData(base);
  314. var showCityPickerButton2 = doc.getElementById('production');
  315. var cityResultc2 = doc.getElementById('ower_production');
  316. showCityPickerButton2.addEventListener('tap', function(event) {
  317. matrix.show(function(items) {
  318. cityResultc2.value = items[0].text;
  319. cityResultc2.setAttribute("data-index", items[0].value);
  320. //返回 false 可以阻止选择框的关闭
  321. //return false;
  322. });
  323. }, false);
  324. //事件等级
  325. var affair = new $.PopPicker();
  326. affair.setData(grade);
  327. var showCityPickerButton4 = doc.getElementById('eventle');
  328. var cityResultc4 = doc.getElementById('ower_event');
  329. showCityPickerButton4.addEventListener('tap', function(event) {
  330. affair.show(function(items) {
  331. cityResultc4.value = items[0].text;
  332. cityResultc4.setAttribute("data-index", items[0].value);
  333. //返回 false 可以阻止选择框的关闭
  334. //return false;
  335. });
  336. }, false);
  337. // //对应责任单位
  338. // var para = new $.PopPicker();
  339. // para.setData(parallelism);
  340. // var showCityPickerButton5 = doc.getElementById('ponding');
  341. // var cityResultc5 = doc.getElementById('ower_ponding');
  342. // showCityPickerButton5.addEventListener('tap', function(event) {
  343. // para.show(function(items) {
  344. // cityResultc5.value = items[0].text;
  345. // cityResultc5.setAttribute("data-index", items[0].text);
  346. // //返回 false 可以阻止选择框的关闭
  347. // //return false;
  348. // });
  349. // }, false);
  350. //生产基地
  351. var produ = new $.PopPicker();
  352. produ.setData(base);
  353. var showCityPickerButton6 = doc.getElementById('result');
  354. var cityResultc6 = doc.getElementById('ower_result');
  355. showCityPickerButton6.addEventListener('tap', function(event) {
  356. produ.show(function(items) {
  357. cityResultc6.value = items[0].text;
  358. cityResultc6.setAttribute("data-index", items[0].text);
  359. //返回 false 可以阻止选择框的关闭
  360. //return false;
  361. });
  362. }, false);
  363. })
  364. })(mui, document);
  365. })
  366. $('.order_type').find('input[type="radio"]').on('change', function() {
  367. if($(this).val() == "0") { //业务办理
  368. $('#showCityPicker5').show();
  369. }else{
  370. $('#showCityPicker5').hide();
  371. }
  372. });
  373. $('.order_coin').find('input[type="radio"]').on('change', function() {
  374. if($(this).val() == "钱款") { //业务办理
  375. $('.make').show();
  376. }else{
  377. $('.make').hide();
  378. }
  379. });
  380. $('.order_opinion').find('input[type="radio"]').on('change', function() {
  381. if($(this).val() == "不同意") { //业务办理
  382. $('.F_Address').show();
  383. }else{
  384. $('.F_Address').hide();
  385. }
  386. });