Нет описания

AddWorkOrder.js 21KB

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