add_detect.ftl 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="Cache-Control" content="no-siteapp" />
  9. <#include "/base/add_base.ftl">
  10. <title>添加检测记录 - H-ui.filter v2.4</title>
  11. <style>
  12. .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
  13. .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
  14. .tit-2{position: relative;font-size: 16px;padding-left: 10px;color: #50a2ea;display: inline-block;}
  15. .tit-2:after{content: '';position: absolute;left: 0;top: 50%;height: 6px;width: 6px;border-radius: 6px;margin-top: -3px; background-color: #32a3d8;}
  16. .my-title{font-weight: 500;padding-left: 15px;position: relative;}
  17. .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
  18. .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
  19. .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
  20. .input-box{margin: 18px 0;}
  21. .input-dic{float: left;margin:5px 10px 0 0;font-size: 14px;}
  22. .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
  23. .add-list>li{margin: 10px 0;}
  24. .my-textarea{padding: 5px 10px;width: 77%;border:1px solid rgba(0,0,0,.1);margin-left: 12.5%;}
  25. .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
  26. .my-btn-submit{padding: 10px 20px;width: 158px; background-color: #50a2ea;color: #fff;border: 1px solid #50a2ea;cursor:pointer;margin: 10px 10px 0 10px;}
  27. .my-select {
  28. border: 1px solid rgba(0,0,0,.1);
  29. padding: 6px 50px 6px 15px;
  30. height: 34px;
  31. -webkit-appearance: none;
  32. appearance: none;
  33. background: url(/common/images/pts/select-11.png) right center no-repeat;
  34. background-size: auto 100%;
  35. }
  36. .check-box, .radio-box{padding-left: 0;}
  37. input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
  38. input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
  39. .huanhang{ float:left}
  40. input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
  41. input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
  42. </style>
  43. <meta name="keywords" content="${path}">
  44. <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
  45. </head>
  46. <body>
  47. <article class="page-container">
  48. <form class="form form-horizontal" id="form-admin-add">
  49. <div class="row cl">
  50. <label class="form-label col-3">
  51. <div class="tit-2">检测信息</div>
  52. </label>
  53. <div class="formControls col-9">
  54. </div>
  55. </div>
  56. <div class="row cl">
  57. <label class="form-label col-3 col-sm-3" style="padding-right: 10px;"><span class="c-red">*</span>所属公司:</label>
  58. <div class="formControls col-9 col-sm-9" style="padding-left: 5px;">
  59. <#if companyInfoList?? && (companyInfoList?size > 0) >
  60. <#list companyInfoList as companyInfo>
  61. <div class="radio-box">
  62. <input type="radio" name="companyId" <#if companyInfo_index == 0>checked="checked"</#if>value="${companyInfo.companyId!''}" datatype="*" nullmsg="请选择所属公司!">
  63. <label for="tel-1">${companyInfo.companyName!''}</label>
  64. </div>
  65. </#list>
  66. </#if>
  67. </div>
  68. </div>
  69. <#--<div class="input-box">
  70. <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;">客诉编号:</label>
  71. <div class="formControls col-xs-9 col-sm-9 skin-minimal" style="margin: 10px 0px;padding-left: 0;">
  72. <input class="my-input" type="text" style="width:510px;" name="customerId" id="customerId" placeholder="请输入客诉编号,如没有请留空"/>
  73. </div>
  74. </div>-->
  75. <div class="input-box">
  76. <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>客户问题:</label>
  77. <div class="formControls col-xs-9 col-sm-9 skin-minimal" style="margin: 10px 0px;padding-left: 0;">
  78. <select id="questionId" name="questionId" class="chosen" style="width: 93%;">
  79. <option value="">请选择客户问题</option>
  80. <#if (listComplaintQuestionInfo?size > 0)>
  81. <#list listComplaintQuestionInfo as info>
  82. <option value="${info.questionId!""}">${info.questionName!""}</option>
  83. </#list>
  84. </#if>
  85. </select>
  86. </div>
  87. </div>
  88. <div class="input-box">
  89. <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;">业务员:</label>
  90. <div class="formControls col-xs-9 col-sm-9 skin-minimal" style="margin: 10px 0px;padding-left: 0;">
  91. <select id="salesmanAdminId" name="salesmanAdminId" class="chosen" style="width: 93%;">
  92. <option value="">请选择业务员</option>
  93. <#if (listAdmin?size > 0)>
  94. <#list listAdmin as info>
  95. <option value="${info.adminId!""}">${info.adminName!""}</option>
  96. </#list>
  97. </#if>
  98. </select>
  99. </div>
  100. </div>
  101. <div class="input-box">
  102. <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>客户信息:</label>
  103. <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
  104. <input class="my-input" type="text" name="detectName" id="detectName" placeholder="请输入客户姓名或昵称" style="width: 146px;"/>
  105. <input class="my-input" type="text" name="detectTel" id="detectTel" placeholder="请输入客户电话或手机号码" style="width: 146px;"/>
  106. </div>
  107. </div>
  108. <div class="input-box" id="updateDetect_3">
  109. <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>处理方式:</label>
  110. <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
  111. <select class="my-select" id="procTypeId" name="procTypeId" style="width: 158px;">
  112. </select>
  113. <select class="my-select" id="procMethodId" name="methodId" style="width: 158px;">
  114. </select>
  115. </div>
  116. </div>
  117. <div class="input-box">
  118. <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>检测产品:</label>
  119. <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
  120. <select id="productId" name="productId" class="my-select" style="width: 158px;">
  121. <#if (productList?size > 0)>
  122. <#list productList as product>
  123. <option value="${product.productId!""}">${product.productName!""}</option>
  124. </#list>
  125. </#if>
  126. </select>
  127. <select id="productColorId" name="productColorId" class="my-select" style="width: 158px;">
  128. <#if (productColorList?size > 0)>
  129. <#list productColorList as productColor>
  130. <option value="${productColor.colorId!""}">${productColor.colorName!""}</option>
  131. </#list>
  132. </#if>
  133. </select>
  134. </div>
  135. </div>
  136. <div class="input-box" >
  137. <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;">备注信息:</label>
  138. <div class="formControls col-xs-9 col-sm-9">
  139. <div class="radio-box">
  140. <textarea rows="3" style="width: 410px;margin-left: -15px;margin-top: 8px;" cols="20" name="detectItemDesc" id="detectItemDesc" class="my-textarea" placeholder="请输入备注!"></textarea>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="input-box" style="margin-left: 30%">
  145. <button type="button" class="my-btn-submit" onclick="add();" style="margin-top: 50px;">确认提交</button>
  146. </div>
  147. </form>
  148. </article>
  149. <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  150. <script type="text/javascript">
  151. /**
  152. * 客诉处理方式回显 state
  153. */
  154. procType();
  155. $("#procTypeId").change(function (){
  156. var procTypeId = parseInt($(this).val());
  157. procMethod(procTypeId);
  158. });
  159. function procType(){
  160. var procTypeId;
  161. $.ajax({
  162. cache: true,
  163. type: "POST",
  164. url: "${path}/admin/proc/type",
  165. async: false,
  166. success: function(data){
  167. if (data.returnCode == 200) {
  168. var html = '';
  169. if (data.returnCode == 200) {
  170. for(var i=0;i<data.returnMsg.list.length;i++){
  171. listInfo = data.returnMsg.list[i];
  172. if(i == 1 ){
  173. procTypeId = listInfo.procTypeId;
  174. }
  175. if(listInfo.procTypeId === 2 || listInfo.procTypeId === 3 || listInfo.procTypeId === 4 ){
  176. html += '<option value="'+ listInfo.procTypeId +'">'+ listInfo.procTypeName +'</option>';
  177. }
  178. }
  179. }else{
  180. html = '';
  181. }
  182. $("[name='procTypeId']").html(html);
  183. }
  184. },
  185. error: function(XmlHttpRequest, textStatus, errorThrown){
  186. }
  187. })
  188. procMethod(procTypeId);
  189. }
  190. function procMethod(procTypeId){
  191. $.ajax({
  192. cache: true,
  193. type: "POST",
  194. data: {"procTypeId":procTypeId},
  195. url: "${path}/admin/proc/method",
  196. async: false,
  197. success: function(data){
  198. if (data.returnCode == 200) {
  199. var html = '';
  200. if (data.returnCode == 200) {
  201. for(var i=0;i<data.returnMsg.list.length;i++){
  202. listInfo = data.returnMsg.list[i];
  203. html += '<option value="'+ listInfo.procMethodId +'">'+ listInfo.procMethodName +'</option>';
  204. }
  205. }else{
  206. html = '';
  207. }
  208. $("#procMethodId").html(html);
  209. }
  210. },
  211. error: function(XmlHttpRequest, textStatus, errorThrown){
  212. }
  213. })
  214. }
  215. /**
  216. * 客诉处理方式回显 end
  217. */
  218. function inputSelect(){
  219. var input_select=$("#content").val();
  220. var option_length=$("#contentlist option").length;
  221. var option_id='';
  222. for(var i=0;i<option_length;i++){
  223. var option_value=$("#contentlist option").eq(i).attr('data-value');
  224. if(input_select==option_value){
  225. option_id=$("#contentlist option").eq(i).attr('data-id')
  226. break;
  227. }
  228. }
  229. $.ajax({
  230. cache: true,
  231. type: "POST",
  232. url: "${path}/admin/detect/getDetectionBasis",
  233. data:{basisId:option_id},
  234. async: false,
  235. success: function(data){
  236. if (data.returnCode == 200) {
  237. if(data.returnMsg.detectionBasis != null){
  238. $("#detectItemPhenomenon").val(data.returnMsg.detectionBasis.basisPhenomenon);
  239. $("#detectItemClassification").val(data.returnMsg.detectionBasis.basisClassification);
  240. $("#detectItemFailureCause").val(data.returnMsg.detectionBasis.basisFailureCause);
  241. $("#detectItemResults").val(data.returnMsg.detectionBasis.basisResults);
  242. $("#detectItemPoint").val(data.returnMsg.detectionBasis.basisPoint);
  243. $("#detectItemNalysis").val(data.returnMsg.detectionBasis.basisNalysis);
  244. $("#detectItemContent").val(data.returnMsg.detectionBasis.basisContent);
  245. }
  246. }
  247. },
  248. error: function(XmlHttpRequest, textStatus, errorThrown){
  249. layer.msg('添加错误',{icon: 5,time:1000});
  250. }
  251. });
  252. };
  253. /*初始化单选框样式*/
  254. /*$(function(){
  255. $('.skin-minimal input').iCheck({
  256. checkboxClass: 'icheckbox-blue',
  257. radioClass: 'iradio-blue',
  258. increaseArea: '20%'
  259. });
  260. $('input[name="productId"]').on('ifChecked', function(event){
  261. $("input[name='productId']").each(function () {
  262. $("#maintenanceEquipmentNumber"+$(this).val()).val("");
  263. });
  264. });
  265. });*/
  266. //查询产品颜色信息
  267. $('#productId').change(function(){
  268. getProduct($(this).children('option:selected').val())
  269. })
  270. function getProduct(productId) {
  271. $.ajax({
  272. cache: true,
  273. type: "POST",
  274. url: "${path}/admin/product/get_product",
  275. data:{colorProductId:productId},// 你的formid
  276. async: false,
  277. success: function(data){
  278. if (data.returnCode == 200) {
  279. $("#productColorId").empty();
  280. if(data.returnMsg.productColorList.length > 0){
  281. for(var i=0;i<data.returnMsg.productColorList.length;i++){
  282. var productColor = data.returnMsg.productColorList[i];
  283. $("#productColorId").append('<option value='+productColor.colorId+'>'+productColor.colorName+'</option>');
  284. }
  285. }
  286. }
  287. },
  288. error: function(XmlHttpRequest, textStatus, errorThrown){
  289. layer.msg('添加错误',{icon: 5,time:1000});
  290. }
  291. });
  292. }
  293. function add() {
  294. var questionId = $("#questionId").val();
  295. if( questionId == null || questionId == "" ){
  296. layer.msg('请选择客户问题',{icon: 5,time:1000});
  297. return;
  298. }
  299. /*var salesmanAdminId = $("#salesmanAdminId").val();
  300. if( salesmanAdminId == null || salesmanAdminId == "" ){
  301. layer.msg('请选择业务员',{icon: 5,time:1000});
  302. return;
  303. }*/
  304. /*var itemDate = $("#itemDate").val();
  305. if( itemDate == null || itemDate == "" ){
  306. layer.msg('请选择检测日期',{icon: 5,time:1000});
  307. return;
  308. }
  309. var detectItemPhenomenon = $("#detectItemPhenomenon").val();
  310. if( detectItemPhenomenon == null || detectItemPhenomenon == "" ){
  311. layer.msg('请输入工厂检测现象',{icon: 5,time:1000});
  312. return;
  313. }
  314. if( detectItemPhenomenon.length > 300 ){
  315. layer.msg('工厂检测现象长度不得大于150个字符',{icon: 5,time:1000});
  316. return;
  317. }
  318. var detectItemClassification = $("#detectItemClassification").val();
  319. if( detectItemClassification == null || detectItemClassification == "" ){
  320. layer.msg('请输入故障分类',{icon: 5,time:1000});
  321. return;
  322. }
  323. if( detectItemClassification.length > 50 ){
  324. layer.msg('故障分类长度不得大于25个字符',{icon: 5,time:1000});
  325. return;
  326. }
  327. var detectItemFailureCause = $("#detectItemFailureCause").val();
  328. if( detectItemFailureCause == null || detectItemFailureCause == "" ){
  329. layer.msg('请输入故障原因',{icon: 5,time:1000});
  330. return;
  331. }
  332. if( detectItemFailureCause.length > 100 ){
  333. layer.msg('故障原因长度不得大于50个字符',{icon: 5,time:1000});
  334. return;
  335. }
  336. var detectItemResults = $("#detectItemResults").val();
  337. if( detectItemResults == null || detectItemResults == "" ){
  338. layer.msg('请输入判定结果',{icon: 5,time:1000});
  339. return;
  340. }
  341. if( detectItemResults.length > 100 ){
  342. layer.msg('判定结果长度不得大于50个字符',{icon: 5,time:1000});
  343. return;
  344. }
  345. var detectItemPoint = $("#detectItemPoint").val();
  346. if( detectItemPoint == null || detectItemPoint == "" ){
  347. layer.msg('请输入故障指向',{icon: 5,time:1000});
  348. return;
  349. }
  350. if( detectItemPoint.length > 100 ){
  351. layer.msg('故障指向长度不得大于50个字符',{icon: 5,time:1000});
  352. return;
  353. }
  354. var detectItemNalysis = $("#detectItemNalysis").val();
  355. if( detectItemNalysis == null || detectItemNalysis == "" ){
  356. layer.msg('请输入原因分析',{icon: 5,time:1000});
  357. return;
  358. }
  359. if( detectItemNalysis.length > 100 ){
  360. layer.msg('原因分析长度不得大于50个字符',{icon: 5,time:1000});
  361. return;
  362. }
  363. var detectItemContent = $("#detectItemContent").val();
  364. if( detectItemContent == null || detectItemContent == "" ){
  365. layer.msg('请输入维修内容',{icon: 5,time:1000});
  366. return;
  367. }
  368. if( detectItemContent.length > 300 ){
  369. layer.msg('维修内容长度不得大于300个字符',{icon: 5,time:1000});
  370. return;
  371. }*/
  372. $.ajax({
  373. cache: true,
  374. type: "POST",
  375. url: "${path}/admin/detect/add_detect",
  376. data:$('#form-admin-add').serialize(),// 你的formid
  377. async: false,
  378. success: function(data){
  379. if (data.returnCode == 200) {
  380. layer.msg('添加成功',{icon: 1,time:1000},function () {
  381. location.replace(location.href);
  382. window.location.href= "${path}/admin/detect/select_detect_list";
  383. });
  384. } else {
  385. layer.msg('添加失败',{icon: 5,time:1000});
  386. }
  387. },
  388. error: function(XmlHttpRequest, textStatus, errorThrown){
  389. layer.msg('添加错误',{icon: 5,time:1000});
  390. }
  391. });
  392. }
  393. $('.chosen').chosen({
  394. no_results_text: "没有找到结果!",//搜索无结果时显示的提示
  395. search_contains:true, //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  396. allow_single_deselect:true, //单选下拉框是否允许取消选择。如果允许,选中选项会有一个x号可以删除选项
  397. disable_search: false, //禁用搜索。设置为true,则无法搜索选项。
  398. disable_search_threshold: 0, //当选项少等于于指定个数时禁用搜索。
  399. inherit_select_classes: true, //是否继承原下拉框的样式类,此处设为继承
  400. placeholder_text_single: '选择国家', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
  401. width: '320px', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
  402. max_shown_results: 1000, //下拉框最大显示选项数量
  403. display_disabled_options: false,
  404. single_backstroke_delete: false, //false表示按两次删除键才能删除选项,true表示按一次删除键即可删除
  405. case_sensitive_search: false, //搜索大小写敏感。此处设为不敏感
  406. group_search: false, //选项组是否可搜。此处搜索不可搜
  407. include_group_label_in_selected: true //选中选项是否显示选项分组。false不显示,true显示。默认false。
  408. });
  409. $('.chosen2').chosen({
  410. search_contains:false,
  411. enable_split_word_search: true //分词搜索,选项词可通过空格或'[]'分隔。search_contains为false时才能看出效果
  412. });
  413. </script>
  414. </body>
  415. </html>