Nessuna descrizione

xgWork.js 21KB

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