暫無描述

xgWork.js 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  1. var typeSmall;
  2. var id = helper.request.queryString("id");
  3. $(document).ready(function () {
  4. $.ajax({
  5. type: "get",
  6. url: huayi.config.callcenter_url + "CallInScreen/GetCurrUserDep",
  7. dataType: 'json',
  8. async: false,
  9. data: {
  10. token: $.cookie("token")
  11. },
  12. success: function(data) {
  13. if(data.state.toLowerCase() == 'success') {
  14. if(data.data.groname == '思念组') {
  15. $(".snRmove").remove();
  16. $(".dkRmove").show();
  17. } else {
  18. $(".snRmove").show();
  19. $(".complainDiv2").hide();
  20. $(".dkRmove").remove();
  21. $(".ns-2").remove();
  22. }
  23. }
  24. }
  25. });
  26. var groupcode = $('#groupcode', top.document).val();
  27. if (groupcode == 'SCZ') {
  28. $("#usedate").text("饮用日期:");
  29. $("#vipid").text("对接人:");
  30. $("#vipphone").text("对接人电话:");
  31. }
  32. // laydate.render({
  33. // elem: '.userDate',
  34. // theme: '#1ab394',
  35. // calendar: 'true'
  36. // });
  37. // laydate.render({
  38. // elem: '.buyDate',
  39. // theme: '#1ab394',
  40. // calendar: 'true'
  41. // });
  42. // laydate.render({
  43. // elem: '#productDate',
  44. // theme: '#1ab394',
  45. // calendar: 'true'
  46. // });
  47. $.ajaxSettings.async = false;
  48. // 产品代码
  49. getProductType();
  50. // 问题代码
  51. getProblemCode();
  52. // 重要级别
  53. getDealTimely();
  54. // 重要级别原因
  55. getReason();
  56. //大区
  57. getArea($("#customer_area"));
  58. // 省 办事处
  59. LAISHENG($("#source"));//省
  60. CHOUDQ($("#customer_comaddress")); //办事处
  61. //客诉专员
  62. ComplaintVip();
  63. //保存
  64. $('.customerSubmit').click(function() {
  65. saveCustomer();
  66. });
  67. $.ajaxSettings.async = true;
  68. var id = helper.request.queryString("id");
  69. $.ajax({
  70. type: "get",
  71. url: huayi.config.callcenter_url + "WorkOrder/GetDetails",
  72. dataType: 'json',
  73. async: true,
  74. cache: false,
  75. data: {
  76. id: id,
  77. token: $.cookie("token")
  78. },
  79. success: function(result) {
  80. if (result.rows.length > 0) {
  81. var data = result.rows[0];
  82. $("#workOrderId").val(data.F_WorkOrderId); //工单编号
  83. // $("#order_isover").val(data.F_Type); // 工单类别
  84. $("#customer_area option:selected").text(data.F_AreaName); // 大区名称
  85. $("#customer_area option:selected").val(data.F_Area); // 大区
  86. $("#customer_office option:selected").text(data.F_OfficName); //办事处名称
  87. $("#customer_office option:selected").val(data.F_Office); //办事处
  88. // $("#detailCreateTime").text(data.F_CreateTime); // 投诉时间
  89. $("#name").val(data.F_CusName); // 姓名
  90. $("#tel").val(data.F_CusPhone); // 电话
  91. $("#productName").val(data.F_ProductName); // 产品名称
  92. $('#specification').val(data.F_Specifications); // 规格
  93. $("#productDate").val(data.F_ProductDate); // 生产日期
  94. $("#productNumber").val(data.F_BatchNumber); // 产品编码
  95. $("#productFactory").val(data.F_Manufacturer); // 产品厂家
  96. $("#problemCode").find("option:selected").text(data.F_ProblemCode); // 问题代码
  97. $("#productType").find("option:selected").text(data.F_ProductType); // 产品代码
  98. $("#qualityProblem").val(data.F_QualityProblem); // 质量问题
  99. $("#duplicate").val(data.F_Duplicate); // 重复工单
  100. $("#remark").val(data.F_Content); // 备注
  101. //工单类型
  102. $("#order_isover input[type=radio][name=type][value="+data.F_Type+"]").attr("checked",'checked');
  103. //重复工单
  104. $("#duplicate input[type=radio][name=duplicate][value="+data.duplicate+"]").attr("checked",'checked');
  105. // 工单来源
  106. workOrderSourceDisplay(data);
  107. // 重要级别
  108. dealTimelyDisplay(data);
  109. // 重要级别原因
  110. dealTimelyReasonDisplay(data);
  111. // 省市县
  112. provinceCity(data)
  113. }
  114. }
  115. });
  116. $(".complaintType2").change(function () {
  117. typeSmall=$(".complaintType2").val();
  118. });
  119. $(".complaintType1").change(function () {
  120. typeSmall=$(".complaintType1").val();
  121. });
  122. $('.areaDown').click(function() {
  123. if ($('.treeList1').css('display') == 'block') {
  124. $('.treeList1').css('display', 'none')
  125. } else {
  126. $('.treeList1').css('display', 'block')
  127. }
  128. })
  129. $('#typeclass').click(function() {
  130. $('.treeList1').css('display', 'block')
  131. })
  132. $('.treeList1').mouseleave(function() {
  133. $(this).css('display', 'none')
  134. })
  135. //获取专员手机号
  136. $("#vipName").change(function() {
  137. $("#vipTel").val($("#vipName option:selected").attr("index"));
  138. //$("#areaInps").val($("#vipName option:selected").attr("areaText"));
  139. $("#typeclass").val($("#vipName option:selected").attr("province") + "/" + $("#vipName option:selected").attr("city"));
  140. $(".inps2").val($("#vipName option:selected").attr("province"));
  141. $(".inps3").val($("#vipName option:selected").attr("city"));
  142. });
  143. })
  144. // 工单来源显示
  145. function workOrderSourceDisplay(data) {
  146. if (data.F_Source === 1) {
  147. $("#workOrderSource").val("PC")
  148. } else if (data.F_Source === 2){
  149. $("#workOrderSource").val("APP")
  150. } else if (data.F_Source === 3) {
  151. $("#workOrderSource").val("微信")
  152. } else {
  153. $("#workOrderSource").val("")
  154. }
  155. }
  156. // 重要级别显示
  157. function dealTimelyDisplay(data) {
  158. if (data.F_DealTimely === 506) {
  159. $("#dealTimely option:selected").text("Ⅰ级");
  160. $("#dealTimely option:selected").val(506);
  161. } else if (data.F_DealTimely === 507) {
  162. $("#dealTimely option:selected").text("Ⅱ级");
  163. $("#dealTimely option:selected").val(507);
  164. } else if (data.F_DealTimely === 508) {
  165. $("#dealTimely option:selected").text("普通工单");
  166. $("#dealTimely option:selected").val(508);
  167. }
  168. }
  169. // 重要级别原因显示
  170. function dealTimelyReasonDisplay(data) {
  171. if (data.F_DealTimely === 506) {
  172. if (data.F_Reason === "509") {
  173. $("#reason option:selected").text("涉媒");
  174. $("#reason option:selected").val(509);
  175. } else if (data.F_Reason === "510") {
  176. $('#reason').attr("disabled", "disabled");
  177. $("#reason option:selected").text("政府");
  178. $("#reason option:selected").val(510);
  179. } else if (data.F_Reason === "511") {
  180. $('#reason').attr("disabled", "disabled");
  181. $("#reason option:selected").text("恶性杂志");
  182. $("#reason option:selected").val(511);
  183. }
  184. } else {
  185. $('#reason').attr("disabled", "disabled");
  186. $("#reason option:selected").text("请选择");
  187. $("#reason option:selected").val("");
  188. }
  189. }
  190. //省市县回显
  191. function provinceCity(data){
  192. var provinceCityArr = data.F_AddRess.split("-");
  193. $("#source option:selected").text(provinceCityArr[0]);
  194. $("#type option:selected").text(provinceCityArr[1]);
  195. $("#keyid option:selected").text(provinceCityArr[2]);
  196. }
  197. // 大区
  198. function getArea(obj) {
  199. obj.empty();
  200. obj.append('<option selected="selected" value="">请选择</option>');
  201. $.getJSON(huayi.config.callcenter_url + "Department/GetCusAreaList", {
  202. "token": $.cookie("token"),
  203. pid: 1,
  204. F_Layer: 1,
  205. }, function (data) {
  206. if (data.state.toLowerCase() == "success") {
  207. var content = data.data;
  208. $(content).each(function (i, n) {
  209. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
  210. })
  211. }
  212. })
  213. }
  214. //办事处
  215. function getOffice(obj) {
  216. obj.empty();
  217. obj.append('<option selected="selected" value="">请选择</option>');
  218. $.getJSON(huayi.config.callcenter_url + "Department/GetCusAreaList", {
  219. "token": $.cookie("token"),
  220. F_Layer:2,
  221. pid:$("#customer_area").val(),
  222. }, function (data) {
  223. if (data.state.toLowerCase() == "success") {
  224. var content = data.data;
  225. $(content).each(function (i, n) {
  226. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
  227. })
  228. }
  229. })
  230. }
  231. // 获取所在大区办事处
  232. $("#customer_area").on("change", function() {
  233. getOffice($("#customer_office"))
  234. })
  235. //省 市 区/县
  236. //省
  237. function LAISHENG(obj) {
  238. obj.empty();
  239. obj.append('<option selected="selected" value="">请选择</option>');
  240. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetCountyList", {
  241. "token": $.cookie("token"),
  242. pid: 0,
  243. }, function (data) {
  244. if (data.state.toLowerCase() == "success") {
  245. var content = data.data;
  246. $(content).each(function (i, n) {
  247. $("<option value='" + n.F_RegionId + "'>" + n.F_RegionName + "</option>").appendTo(obj);
  248. })
  249. }
  250. })
  251. }
  252. //市
  253. function LAISHI(obj) {
  254. obj.empty();
  255. obj.append('<option selected="selected" value="">请选择</option>');
  256. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetCountyList", {
  257. "token": $.cookie("token"),
  258. pid:$('#source').val(),
  259. }, function (data) {
  260. if (data.state.toLowerCase() == "success") {
  261. var content = data.data;
  262. $(content).each(function (i, n) {
  263. $("<option value='" + n.F_RegionId + "'>" + n.F_RegionName + "</option>").appendTo(obj);
  264. })
  265. }
  266. })
  267. }
  268. // 区/县
  269. function LAIQU(obj) {
  270. obj.empty();
  271. obj.append('<option selected="selected" value="">请选择</option>');
  272. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetCountyList", {
  273. "token": $.cookie("token"),
  274. pid:$('#type').val(),
  275. }, function (data) {
  276. if (data.state.toLowerCase() == "success") {
  277. var content = data.data;
  278. $(content).each(function (i, n) {
  279. $("<option value='" + n.F_RegionId + "'>" + n.F_RegionName + "</option>").appendTo(obj);
  280. })
  281. }
  282. })
  283. }
  284. $('#source').on('change',function(){
  285. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetCountyList", {
  286. "token": $.cookie("token"),
  287. F_Layer: 2,
  288. F_RegionName:$('#source').val(),
  289. }, function (data) {
  290. if (data.state.toLowerCase() == "success") {
  291. var content = data.data;
  292. $(content).each(function (i, n) {
  293. $("<option value='" + n.F_RegionId + "'>" + n.F_RegionName + "</option>").appendTo("#type");
  294. })
  295. LAISHI($("#type"));
  296. }
  297. })
  298. });
  299. $('#type').on('change',function(){
  300. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetCountyList", {
  301. "token": $.cookie("token"),
  302. F_Layer: 3,
  303. F_RegionName:$('#type').val()
  304. }, function (data) {
  305. if (data.state.toLowerCase() == "success") {
  306. var content = data.data;
  307. $(content).each(function (i, n) {
  308. $("<option value='" + n.F_RegionId + "'>" + n.F_RegionName + "</option>").appendTo("#keyid");
  309. })
  310. LAIQU($("#keyid"));
  311. }
  312. })
  313. });
  314. $('#keyid').on('change',function(){
  315. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetCountyList", {
  316. "token": $.cookie("token"),
  317. F_Layer: 4,
  318. F_RegionName:$('#keyid').val()
  319. }, function (data) {
  320. if (data.state.toLowerCase() == "success") {
  321. var content = data.data;
  322. $(content).each(function (i, n) {
  323. $("<option value='" + n.F_RegionId + "'>" + n.F_RegionName + "</option>").appendTo("#input_area");
  324. })
  325. LAIXIANG($('#input_area'));
  326. }
  327. })
  328. });
  329. //办事处 提交人
  330. function CHOUDQ(obj) {
  331. obj.empty();
  332. obj.append('<option selected="selected" value="">请选择</option>');
  333. $.getJSON(huayi.config.callcenter_url + "Department/GetCusAreaList", {
  334. "token": $.cookie("token"),
  335. pid: 1,
  336. F_Layer: 1,
  337. }, function (data) {
  338. if (data.state.toLowerCase() == "success") {
  339. var content = data.data;
  340. $(content).each(function (i, n) {
  341. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
  342. })
  343. }
  344. })
  345. }
  346. //办事处
  347. function CHOUFEN(obj) {
  348. obj.empty();
  349. obj.append('<option selected="selected" value="">请选择</option>');
  350. $.getJSON(huayi.config.callcenter_url + "Department/GetCusAreaList", {
  351. "token": $.cookie("token"),
  352. F_Layer:2,
  353. pid:$("#customer_comaddress").val(),
  354. }, function (data) {
  355. if (data.state.toLowerCase() == "success") {
  356. var content = data.data;
  357. $(content).each(function (i, n) {
  358. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
  359. })
  360. }
  361. })
  362. }
  363. // 提交人
  364. function getSubmitter(obj) {
  365. obj.empty();
  366. obj.append('<option selected="selected" value="" deptId="">请选择</option>');
  367. $.getJSON(huayi.config.callcenter_url + "UserAccount/GetList", {
  368. "token": $.cookie("token"),
  369. type: 1,
  370. dptid: $("#customer_comaddress").val(),
  371. }, function (data) {
  372. console.log('123123123')
  373. var content = data.rows;
  374. $(content).each(function (i, n) {
  375. $("<option value='" + n.F_UserId + "'deptId='" + n.F_DeptId + "'>" + n.F_UserName + "</option>").appendTo(obj);
  376. })
  377. })
  378. }
  379. // 获取提交人
  380. $('#customer_comaddress').on('change',function(){
  381. getSubmitter($('#customer_submitter'));
  382. });
  383. //产品代码
  384. function getProductType() {
  385. $.ajax({
  386. type: "get",
  387. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  388. dataType: 'json',
  389. async: true,
  390. data: {
  391. token: $.cookie("token"),
  392. flag: "CPDM"
  393. },
  394. success: function(data) {
  395. var Count = data.data;
  396. $(Count).each(function(i, n) {
  397. $('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($("#productType"));
  398. })
  399. }
  400. });
  401. }
  402. // 问题代码
  403. function getProblemCode() {
  404. $.ajax({
  405. type: "get",
  406. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  407. dataType: 'json',
  408. async: true,
  409. data: {
  410. token: $.cookie("token"),
  411. flag: "WTDM"
  412. },
  413. success: function(data) {
  414. var Count = data.data;
  415. $(Count).each(function(i, n) {
  416. $('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($("#problemCode"));
  417. })
  418. }
  419. });
  420. }
  421. // 重要级别
  422. function getDealTimely() {
  423. $.ajax({
  424. type: "get",
  425. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  426. dataType: 'json',
  427. async: true,
  428. data: {
  429. token: $.cookie("token"),
  430. flag: "GDDJ"
  431. },
  432. success: function(data) {
  433. var Count = data.data;
  434. $(Count).each(function(i, n) {
  435. $('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($("#dealTimely"));
  436. })
  437. }
  438. });
  439. }
  440. // 重要级别原因
  441. function getReason() {
  442. $.ajax({
  443. type: "get",
  444. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  445. dataType: 'json',
  446. async: true,
  447. data: {
  448. token: $.cookie("token"),
  449. flag: "YJYY"
  450. },
  451. success: function(data) {
  452. var Count = data.data;
  453. $(Count).each(function(i, n) {
  454. $('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($("#reason"));
  455. })
  456. }
  457. });
  458. }
  459. // 重要级别为一级时显示原因
  460. $('#dealTimely').on('change',function(){
  461. console.log('1111',$('#dealTimely').val());
  462. if ($('#dealTimely').val() !== '506'){
  463. $('#reason').val('');
  464. $('#reason').attr("disabled", "disabled");
  465. } else {
  466. $('#reason').removeAttr("disabled");
  467. }
  468. })
  469. // 指派事件
  470. $('#isAssign').on('change', function(){
  471. if($('#isAssign input[name="isAssign"]:checked').val() === '1'){
  472. $('.comaddressTitle').show();
  473. $('.comaddressSelect').show();
  474. $('.submitterTitle').show();
  475. $('.submitterSelect').show();
  476. } else if ($('#isAssign input[name="isAssign"]:checked').val() === '2'){
  477. $('.comaddressTitle').hide();
  478. $('.comaddressSelect').hide();
  479. $('.submitterTitle').hide();
  480. $('.submitterSelect').hide();
  481. }
  482. })
  483. // 地址(省+市+区/县)
  484. function detailedAddress() {
  485. if($('#source').val() === ""){
  486. var province = '';
  487. } else {
  488. var province = $('#source').find("option:selected").text()
  489. }
  490. if($('#type').val() === ""){
  491. var city = '';
  492. } else {
  493. var city = $('#type').find("option:selected").text()
  494. }
  495. if($('#keyid').val() === ""){
  496. var county = '';
  497. } else {
  498. var county = $('#keyid').find("option:selected").text()
  499. }
  500. var address = province + '-' + city + '-' + county;
  501. return address;
  502. }
  503. //处理状态
  504. dealState();
  505. function dealState() {
  506. $.get(huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlag', {
  507. "token": $.cookie("token"),
  508. flag: "CLZT"
  509. }, function(result) {
  510. result = $.parseJSON(result);
  511. var Count = result.data;
  512. $(Count).each(function(i, n) {
  513. $('<label style="font-weight: normal; margin-right: 15px;">'+
  514. '<input type="radio" value="' + n.F_DictionaryValueId
  515. + '" name="ltype"/>' + n.F_Name
  516. + '</label>').appendTo($(".disposeST"));
  517. })
  518. $('.disposeST input:radio:first').attr('checked', 'checked');
  519. });
  520. }
  521. //响应状态
  522. responseState();
  523. function responseState() {
  524. $.get(huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlag', {
  525. "token": $.cookie("token"),
  526. flag: "XYZT"
  527. }, function(result) {
  528. result = $.parseJSON(result);
  529. var Count = result.data;
  530. $(Count).each(function(i, n) {
  531. $('<label style="font-weight: normal; margin-right: 15px;">'+
  532. '<input type="radio" value="' + n.F_DictionaryValueId
  533. + '" name="response"/>' + n.F_Name
  534. + '</label>').appendTo($(".responseST"));
  535. })
  536. $('.responseST input:radio:first').attr('checked', 'checked');
  537. });
  538. }
  539. var setting = {
  540. data: {
  541. key: {
  542. name: "F_AreaName"
  543. },
  544. simpleData: {
  545. enable: true,
  546. idKey: "F_Id",
  547. pIdKey: "F_ParentId",
  548. rootPId: 0
  549. }
  550. },
  551. callback: {
  552. onClick: changeTreeClick
  553. }
  554. }
  555. function changeTreeClick(event, treeId, treeNode) {
  556. var areaParent = treeNode.getPath();
  557. if (areaParent[1]) {
  558. areaParent1 = areaParent[0].F_AreaName
  559. areaParent2 = areaParent[1].F_AreaName
  560. $('#typeclass').val(areaParent1 + "/" + areaParent2);
  561. $('.inps2').val(areaParent1);
  562. $('.inps3').val(areaParent2);
  563. ComplaintVip();
  564. } else {
  565. layer.msg("请选择最下级菜单");
  566. }
  567. $('.addTree1').hide();
  568. };
  569. //客诉专员
  570. function ComplaintVip() {
  571. $.ajax({
  572. type: "get",
  573. url: huayi.config.callcenter_url + "Customer/GetAllList",
  574. dataType: 'json',
  575. async: true,
  576. data: {
  577. token: $.cookie("token"),
  578. type: 2,
  579. province: $('.inps2').val(), //省
  580. city: $('.inps3').val() //市
  581. },
  582. success: function(data) {
  583. $("#vipName").empty();
  584. var Count = data.data;
  585. $('<option value="">请选择专员</option>').appendTo($("#vipName"));
  586. $(Count).each(function(i, n) {
  587. $('<option value="' + n.F_Id
  588. + '" index="' + n.F_Phone
  589. + '" areaText="' + n.F_Area
  590. + '" province="' + n.F_Province
  591. + '" city="' + n.F_City + '">' + n.F_Name
  592. + '</option>').appendTo($("#vipName"));
  593. })
  594. }
  595. });
  596. }
  597. //保存
  598. function saveCustomer() {
  599. var val = $("input[name='ltype']:checked").val();
  600. var valRes = $("input[name='response']:checked").val();
  601. var dealCost;
  602. if (isNaN($("#dealCost").val())) {
  603. dealCost="";
  604. }else{
  605. dealCost=$("#dealCost").val();
  606. }
  607. if (!$('#name').val()) {
  608. layer.confirm('请输入姓名!', {
  609. icon: 2,
  610. btn: ['确定']
  611. });
  612. return;
  613. }
  614. if (!$('#tel').val()) {
  615. layer.confirm('请输入电话!', {
  616. icon: 2,
  617. btn: ['确定']
  618. });
  619. return;
  620. }
  621. if(!$('#qualityProblem').val()) {
  622. layer.confirm('请输入质量问题!', {
  623. icon: 2,
  624. btn: ['确定']
  625. });
  626. return;
  627. }
  628. $.ajax({
  629. type: "post",
  630. url: huayi.config.callcenter_url + "WorkOrder/UpdateWorkOrder",
  631. dataType: 'json',
  632. async: true,
  633. beforeSend: function() { //触发ajax请求开始时执行
  634. $('.customerSubmit').attr("disabled", true);
  635. $('.customerSubmit').text('保存中...');
  636. },
  637. data: {
  638. token: $.cookie("token"),
  639. F_Id: id,
  640. F_Type: $('#order_isover input[name="type"]:checked').val(), //工单类型
  641. F_Area: $('#customer_area').val(), //大区
  642. F_Office: $('#customer_office').val(), //办事处
  643. F_DealTimely: $('#dealTimely').val(), //重要级别
  644. F_Reason: $('#reason').val(), //原因
  645. F_CusName: $('#name').val(), //姓名
  646. F_CusPhone: $('#tel').val(), //号码
  647. F_AddRess: detailedAddress(),//地址
  648. F_ProductType: $('#productType').find("option:selected").text() === '请选择' ? '' : $('#productType').find("option:selected").text(), //产品代码
  649. F_ProductName: $('#productName').val(), //产品名称
  650. F_Specifications: $('#specification').val(), //规格
  651. F_ProductDate: $('#productDate').val(), //生产日期
  652. F_BatchNumber: $('#productNumber').val(), //产品编码
  653. F_Manufacturer: $('#productFactory').val(), //产品厂家
  654. F_ProblemCode: $('#problemCode').find("option:selected").text() === '请选择' ? '' : $('#problemCode').find("option:selected").text(), //问题代码
  655. F_QualityProblem: $('#qualityProblem').val(), //质量问题
  656. F_Content: $('#remark').val(), //备注
  657. F_Duplicate: $('#duplicate input[name="duplicate"]:checked').val(), //重复工单
  658. },
  659. success: function(data) {
  660. if (data.state.toLowerCase() == 'success') {
  661. $('.customerSubmit').attr("disabled", false);
  662. $('.customerSubmit').text('保存');
  663. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  664. parent.layer.close(index); //再执行关闭
  665. parent.layer.msg("保存成功!");
  666. parent.$('#workorderlist').bootstrapTable('refresh');
  667. parent.$('#orderlist').bootstrapTable('refresh');
  668. } else {
  669. $('.customerSubmit').attr("disabled", false);
  670. $('.customerSubmit').text('保存');
  671. }
  672. }
  673. });
  674. }