Bez popisu

AddWorkOrder.js 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  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. } else {
  393. $(".isOverWrapper").show();
  394. }
  395. })
  396. //立即办理
  397. $("#isOver").on('change', function() {
  398. if($('#isOver input[name="isOver"]:checked').val() === "0") {
  399. $(".isAssignWrapper").show();
  400. $("#isAssign input[name='isAssign'][value='1']").prop("checked","checked"); //是否指派
  401. } else if ($('#isOver input[name="isOver"]:checked').val() === "1") {
  402. $(".isAssignWrapper").hide();
  403. $("#isAssign input[name='isAssign'][value='0']").prop("checked","checked"); //是否指派
  404. }
  405. })
  406. // 指派事件
  407. $('#isAssign').on('change', function() {
  408. if($('#isAssign input[name="isAssign"]:checked').val() === '1'){
  409. $('.comaddressTitle').show();
  410. $('.comaddressSelect').show();
  411. $('.submitterTitle').show();
  412. $('.submitterSelect').show();
  413. } else if ($('#isAssign input[name="isAssign"]:checked').val() === '0'){
  414. $('.comaddressTitle').hide();
  415. $('.comaddressSelect').hide();
  416. $('.submitterTitle').hide();
  417. $('.submitterSelect').hide();
  418. }
  419. })
  420. // 地址(省+市+区/县)
  421. function detailedAddress() {
  422. if($('#source').val() === ""){
  423. var province = '';
  424. } else {
  425. var province = $('#source').find("option:selected").text()
  426. }
  427. if($('#type').val() === ""){
  428. var city = '';
  429. } else {
  430. var city = "-" + $('#type').find("option:selected").text()
  431. }
  432. // if($('#keyid').val() === ""){
  433. // var county = '';
  434. // } else {
  435. // var county = $('#keyid').find("option:selected").text()
  436. // }
  437. if($('#addressDescription').val() === ""){
  438. var addressDescription = '';
  439. } else {
  440. var addressDescription = "-" + $('#addressDescription').val();
  441. }
  442. var address = province + city + addressDescription;
  443. return address;
  444. }
  445. var setting = {
  446. data: {
  447. key: {
  448. name: "F_AreaName"
  449. },
  450. simpleData: {
  451. enable: true,
  452. idKey: "F_Id",
  453. pIdKey: "F_ParentId",
  454. rootPId: 0
  455. }
  456. },
  457. callback: {
  458. onClick: changeTreeClick
  459. }
  460. }
  461. function changeTreeClick(event, treeId, treeNode) {
  462. var areaParent = treeNode.getPath();
  463. if (areaParent[1]) {
  464. areaParent1=areaParent[0].F_AreaName
  465. areaParent2=areaParent[1].F_AreaName
  466. $('#typeclass').val(areaParent1+"/"+areaParent2);
  467. $('.inps2').val(areaParent1);
  468. $('.inps3').val(areaParent2);
  469. ComplaintVip();
  470. }else{
  471. layer.msg("请选择最下级菜单");
  472. }
  473. $('.addTree1').hide();
  474. };
  475. //工单来源
  476. function getOrderSource(obj) {
  477. $.ajax({
  478. type: "get",
  479. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  480. dataType: 'json',
  481. async: true,
  482. data: {
  483. token: $.cookie("token"),
  484. flag: "GDLY"
  485. },
  486. success: function(data) {
  487. var Count = data.data;
  488. $(Count).each(function(i, n) {
  489. $('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($("#DicValueList"));
  490. })
  491. }
  492. });
  493. }
  494. //客诉专员
  495. function ComplaintVip() {
  496. $.ajax({
  497. type: "get",
  498. url: huayi.config.callcenter_url + "Customer/GetAllList",
  499. dataType: 'json',
  500. async: true,
  501. data: {
  502. token: $.cookie("token"),
  503. type: 2,
  504. province: $('.inps2').val(), //省
  505. city: $('.inps3').val() //市
  506. },
  507. success: function(data) {
  508. $("#vipName").empty();
  509. var Count = data.data;
  510. $('<option value="">请选择专员</option>').appendTo($("#vipName"));
  511. $(Count).each(function (i, n) {
  512. $('<option value="' + n.F_Id
  513. + '" index="' + n.F_Phone
  514. + '" areaText="' + n.F_Area
  515. + '" province="' + n.F_Province
  516. + '" city="' + n.F_City + '">' + n.F_Name
  517. + '</option>').appendTo($("#vipName"));
  518. })
  519. }
  520. });
  521. }
  522. //保存
  523. function saveCustomer() {
  524. if(!$('#name').val()) {
  525. layer.confirm('请输入姓名!', {
  526. icon: 2,
  527. btn: ['确定']
  528. });
  529. return;
  530. }
  531. if(!$('#tel').val()) {
  532. layer.confirm('请输入电话!', {
  533. icon: 2,
  534. btn: ['确定']
  535. });
  536. return;
  537. }
  538. if(!$('#qualityProblem').val()) {
  539. layer.confirm('请输入质量问题!', {
  540. icon: 2,
  541. btn: ['确定']
  542. });
  543. return;
  544. }
  545. if ($('#order_isover input[name="type"]:checked').val() === "2") {
  546. if (detailedAddress() === "---") {
  547. layer.confirm('请选择地址!', {
  548. icon: 2,
  549. btn: ['确定']
  550. });
  551. return;
  552. } else if (!$('#productType').val()) {
  553. layer.confirm('请输入产品代码!', {
  554. icon: 2,
  555. btn: ['确定']
  556. });
  557. return;
  558. } else if (!$('#productName').val()) {
  559. layer.confirm('请输入产品名称!', {
  560. icon: 2,
  561. btn: ['确定']
  562. });
  563. return;
  564. } else if (!$('#specification').val()) {
  565. layer.confirm('请输入规格!', {
  566. icon: 2,
  567. btn: ['确定']
  568. });
  569. return;
  570. } else if (!$('#productDate').val()) {
  571. layer.confirm('请输入生产日期!', {
  572. icon: 2,
  573. btn: ['确定']
  574. });
  575. return;
  576. } else if (!$('#productFactory').val()) {
  577. layer.confirm('请输入生产厂家!', {
  578. icon: 2,
  579. btn: ['确定']
  580. });
  581. return;
  582. } else if (!$('#problemCode').val()) {
  583. layer.confirm('请输入问题代码!', {
  584. icon: 2,
  585. btn: ['确定']
  586. });
  587. return;
  588. }
  589. }
  590. $.ajax({
  591. type: "post",
  592. url: huayi.config.callcenter_url + "WorkOrder/AddWorkOrder",
  593. dataType: 'json',
  594. async: true,
  595. beforeSend: function() { //触发ajax请求开始时执行
  596. $('.customerSubmit').attr("disabled", true);
  597. $('.customerSubmit').text('保存中...');
  598. },
  599. data: {
  600. token: $.cookie("token"),
  601. isover: $('#isOver input[name="isOver"]:checked').val(), //立即办理
  602. IsAssign: $('#isAssign input[name="isAssign"]:checked').val(),//是否指派
  603. clbm: $('#customer_submitter').find("option:selected").attr("deptId"), //提交部门
  604. clid: $('#customer_submitter').val(), //提交人
  605. // cont: $('#cont').val(), //提交内容
  606. F_Type: $('#order_isover input[name="type"]:checked').val(), //工单类型
  607. // F_Area: $('#customer_area').val(), //大区
  608. F_Area: "",
  609. // F_Office: $('#customer_office').val(), //办事处
  610. F_Office: "",
  611. F_DealTimely: $('#dealTimely').val(), //重要级别
  612. F_Reason: $('#reason').val(), //原因
  613. F_CusName: $('#name').val(), //姓名
  614. F_CusPhone: $('#tel').val(), //号码
  615. F_AddRess: detailedAddress(),//地址
  616. F_ProductType: $('#productType').val(), //产品代码
  617. F_ProductName: $('#productName').val(), //产品名称
  618. F_Specifications: $('#specification').val(), //规格
  619. F_ProductDate: $('#productDate').val(), //生产日期
  620. F_BatchNumber: $('#productNumber').val(), //产品编码
  621. F_Manufacturer: $('#productFactory').val(), //生产厂家
  622. F_ProblemCode: $('#problemCode').val(), //问题代码
  623. F_QualityProblem: $('#qualityProblem').val(), //质量问题
  624. F_Content: $('#remark').val(), //备注
  625. F_CallId: CallId, //通话记录id
  626. },
  627. success: function(data) {
  628. if(data.state.toLowerCase() == 'success') {
  629. $('.customerSubmit').attr("disabled", false);
  630. $('.customerSubmit').text('保存');
  631. layer.msg("保存成功!");
  632. clear();
  633. setTimeout("window.location.reload()", 1000); //页面刷新
  634. } else {
  635. $('.customerSubmit').attr("disabled", false);
  636. $('.customerSubmit').text('保存');
  637. }
  638. }
  639. });
  640. }
  641. function clear() {
  642. $('#name').val('');
  643. $('#tel').val(''); //号码
  644. // $('#customer_area').val('');
  645. $('#source').val('');
  646. $('#type').val('');
  647. // $('#keyid').val('');
  648. $('#productType').val('');
  649. $('#productName').val('');
  650. $('#specification').val('');
  651. $('#productDate').val('');
  652. $('#productNumber').val('');
  653. $('#productFactory').val('');
  654. $('#problemCode').val('');
  655. $('#qualityProblem').val('');
  656. $('#dealTimely').val('');
  657. $('#reason').val('');
  658. $('#customer_comaddress').val('');
  659. $('#customer_submitter').val('');
  660. // $('#cont').val('');
  661. $('#remark').val('');
  662. $('#addressDescription').val('');
  663. }
  664. // 重复工单
  665. function radioRepeat(id){
  666. layer.open({
  667. type: 2,
  668. title: '重复工单',
  669. maxmin: true, //开启最大化最小化按钮
  670. area: ['80%', '90%'],
  671. content: "../WorkOrder/WorkOrderRepeat.html?id=" + id
  672. });
  673. }