郑州第一人民医院UI

HandleEquipmentRepair.html 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <link href="../../css/plugins/cropper/cropper.min.css" rel="stylesheet">
  7. <script src="../../Script/Common/huayi.load.js"></script>
  8. <script src="../../Script/Common/huayi.config.js"></script>
  9. <script src="../../js/bootstrap-select/js/bootstrap-select.js"></script>
  10. <script src="../../js/bootstrap-select/js/i18n/defaults-zh_CN.js"></script>
  11. <script src="../../js/laydate/laydate.js"></script>
  12. <link href="../../css/init.css" rel="stylesheet" />
  13. <link rel="stylesheet" type="text/css" href="../../css/Table/table1.css" />
  14. <link href="../../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
  15. <link rel="stylesheet" href="../../css/webuploader.css" />
  16. <title>设备维修处理</title>
  17. <style>
  18. .btnn {
  19. background: #2f4050;
  20. color: #fff;
  21. padding: 3px 10px;
  22. border: 0;
  23. border-radius: 3px;
  24. cursor: pointer;
  25. }
  26. .crop_left {
  27. width: 40%;
  28. float: left;
  29. }
  30. .crop_right {
  31. width: 30%;
  32. float: right;
  33. margin-right: 25px;
  34. }
  35. .time-box .dates {
  36. width: 100% !important;
  37. }
  38. i.tub {
  39. right: 25px !important;
  40. }
  41. b.text_require {
  42. color: red;
  43. }
  44. .loader_icon {
  45. display: block;
  46. height: 36px;
  47. width: 36px;
  48. background: url(../../img/upLod.png) no-repeat;
  49. }
  50. .table_extension tr td:last-child {
  51. text-align: right !important;
  52. }
  53. .isusematerial,
  54. .islosematerial {
  55. display: none;
  56. }
  57. .togetherbox {
  58. display: none;
  59. }
  60. .gqbecausewrap {
  61. display: none;
  62. }
  63. select.bs-select-hidden,
  64. select.selectpicker {
  65. display: block !important;
  66. }
  67. </style>
  68. </head>
  69. <body class="gray-bg">
  70. <div class="container wrapper-content animated fadeInRight">
  71. <div class="form-horizontal">
  72. <!--<div class="form-group">
  73. <label for="serviceteam" class="col-sm-3 control-label text-right"><b class="text_require">*</b>维修班组</label>
  74. <div class="col-sm-9">
  75. <input id="serviceteam" class="form-control" type="text" autocomplete="off" />
  76. </div>
  77. </div>-->
  78. <!--<div class="form-group">
  79. <label for="serviceman" class="col-sm-3 control-label text-right"><b class="text_require">*</b>维修人</label>
  80. <div class="col-sm-9">
  81. <select class="form-control selectpicker" id="serviceman" data-live-search="true">
  82. <option value="">请选择维修人</option>
  83. </select>
  84. </div>
  85. </div>-->
  86. <div class="form-group">
  87. <label for="woCode" class="col-sm-3 control-label text-right"><b
  88. class="text_require">*</b>工单编号</label>
  89. <div class="col-sm-9">
  90. <input id="woCode" class="form-control" type="text" autocomplete="off" readonly="readonly" />
  91. </div>
  92. </div>
  93. <div class="form-group hidden">
  94. <label for="sysname" class="col-sm-3 control-label text-right"><b
  95. class="text_require">*</b>系统名称</label>
  96. <div class="col-sm-9">
  97. <select class="form-control selectpicker" id="sysname" data-live-search="true">
  98. </select>
  99. </div>
  100. </div>
  101. <div class="form-group hidden">
  102. <label for="equipname" class="col-sm-3 control-label text-right"><b
  103. class="text_require">*</b>设备名称</label>
  104. <div class="col-sm-9">
  105. <select class="form-control selectpicker" id="equipname" data-live-search="true">
  106. </select>
  107. </div>
  108. </div>
  109. <div class="form-group">
  110. <label for="faulttype" class="col-sm-3 control-label text-right"><b
  111. class="text_require">*</b>维修类型</label>
  112. <div class="col-sm-9">
  113. <select class="form-control selectpicker" id="faulttype" data-live-search="true">
  114. </select>
  115. </div>
  116. </div>
  117. <div class="form-group">
  118. <label for="finishtime" class="col-sm-3 control-label text-right"><b
  119. class="text_require">*</b>是否使用耗材</label>
  120. <div class="col-sm-9">
  121. <select class="form-control selectpicker" id="isusematerial">
  122. <option value="0">否</option>
  123. <option value="1">是</option>
  124. </select>
  125. </div>
  126. </div>
  127. <div class="form-group isusematerial">
  128. <label for="quality_date" class="col-sm-3 control-label text-right">使用耗材信息</label>
  129. <div class="col-sm-9">
  130. <table class="table table-hidden table_extension" id="table_extension1">
  131. <thead>
  132. <tr>
  133. <td>配件名称</td>
  134. <td>价格</td>
  135. <td><button class="btn btn-info addBtn" onclick="addExtension(1)">添加耗材信息</button>
  136. </td>
  137. </tr>
  138. </thead>
  139. <tbody>
  140. <!--<tr>
  141. <td>
  142. <input type="text" class="form-control extenName" placeholder="请输入字段名" autocomplete="off"/>
  143. </td>
  144. <td>
  145. <input type="text" class="form-control extenValue" placeholder="请输入字段值" autocomplete="off"/>
  146. </td>
  147. <td>
  148. <button class="btn btn-danger" onclick="delExtension(this)">删除</button>
  149. </td>
  150. </tr>-->
  151. </tbody>
  152. </table>
  153. </div>
  154. </div>
  155. <div class="form-group hidden">
  156. <label for="islosematerial" class="col-sm-3 control-label text-right"><b
  157. class="text_require">*</b>是否缺少耗材</label>
  158. <div class="col-sm-9">
  159. <select class="form-control selectpicker" id="islosematerial">
  160. <option value="0">否</option>
  161. <option value="1">是</option>
  162. </select>
  163. </div>
  164. </div>
  165. <div class="form-group islosematerial">
  166. <label for="quality_date" class="col-sm-3 control-label text-right">缺少耗材信息</label>
  167. <div class="col-sm-9">
  168. <table class="table table-hidden table_extension" id="table_extension2">
  169. <thead>
  170. <tr>
  171. <td>配件名称</td>
  172. <td>价格</td>
  173. <td><button class="btn btn-info addBtn" onclick="addExtension(2)">添加耗材信息</button>
  174. </td>
  175. </tr>
  176. </thead>
  177. <tbody>
  178. <!--<tr>
  179. <td>
  180. <input type="text" class="form-control extenName" placeholder="请输入字段名" autocomplete="off"/>
  181. </td>
  182. <td>
  183. <input type="text" class="form-control extenValue" placeholder="请输入字段值" autocomplete="off"/>
  184. </td>
  185. <td>
  186. <button class="btn btn-danger" onclick="delExtension(this)">删除</button>
  187. </td>
  188. </tr>-->
  189. </tbody>
  190. </table>
  191. </div>
  192. </div>
  193. <div class="form-group ">
  194. <label for="istogether" class="col-sm-3 control-label text-right">是否添加协同人</label>
  195. <div class="col-sm-9">
  196. <select class="form-control selectpicker" id="istogether">
  197. <option value="0">否</option>
  198. <option value="1">是</option>
  199. </select>
  200. </div>
  201. </div>
  202. <div class="form-group togetherbox">
  203. <div class="col-sm-9" style="background-color: #fff;float: right;height: 35px;">
  204. <div id="xtContent" style="float: left;line-height: 35px;">
  205. </div>
  206. <div style="float: right;line-height: 35px;" onclick="btn_together()">修改&lt;</div>
  207. </div>
  208. </div>
  209. <div class="form-group">
  210. <label for="" class="col-sm-3 control-label text-right">处理完成前的照片</label>
  211. <div class="col-sm-9 uploadTP">
  212. <div id="filePicker0" class="imgUpload" data-index="0">
  213. <i class="loader_icon"></i>
  214. </div>
  215. <div id='image_list0' class="row image-list"></div>
  216. </div>
  217. </div>
  218. <div class="form-group">
  219. <label for="" class="col-sm-3 control-label text-right">处理完成后的照片</label>
  220. <div class="col-sm-9 uploadTP">
  221. <div id="filePicker1" class="imgUpload" data-index="1">
  222. <i class="loader_icon"></i>
  223. </div>
  224. <div id='image_list1' class="row image-list"></div>
  225. </div>
  226. </div>
  227. <div class="form-group">
  228. <label for="exceptiondes" class="col-sm-3 control-label text-right"><b
  229. class="text_require">*</b>异常说明</label>
  230. <div class="col-sm-9">
  231. <!--<input id="exceptiondes" class="form-control" type="text" autocomplete="off" />-->
  232. <textarea id="exceptiondes" class="form-control" name="" rows="" autocomplete="off" cols=""
  233. style="resize: none;"></textarea>
  234. </div>
  235. </div>
  236. <div class="form-group">
  237. <label for="origins" class="col-sm-3 control-label text-right"><b
  238. class="text_require">*</b>来源</label>
  239. <div class="col-sm-9">
  240. <select class="form-control selectpicker" id="origins">
  241. <option value=""></option>
  242. <option value="本院">本院</option>
  243. <option value="第三方">第三方</option>
  244. </select>
  245. </div>
  246. </div>
  247. <div class="form-group">
  248. <label for="states" class="col-sm-3 control-label text-right"><b
  249. class="text_require">*</b>工单状态</label>
  250. <div class="col-sm-9">
  251. <select class="form-control selectpicker" id="states">
  252. <option value="2">已处理</option>
  253. <option value="7">挂起</option>
  254. </select>
  255. </div>
  256. </div>
  257. <div class="form-group gqbecausewrap">
  258. <label for="gqbecause" class="col-sm-3 control-label text-right"><b
  259. class="text_require">*</b>挂起原因</label>
  260. <div class="col-sm-9">
  261. <select class="form-control selectpicker" id="gqbecause">
  262. <option value=""></option>
  263. <option value="维修金额过大需要上会讨论">维修金额过大需要上会讨论</option>
  264. <option value="需重新招标">需重新招标</option>
  265. </select>
  266. </div>
  267. </div>
  268. <div class="form-group">
  269. <label for="bzid" class="col-sm-3 control-label text-right"><b
  270. class="text_require">*</b>维修项目内容</label>
  271. <div class="col-sm-9">
  272. <select class="form-control selectpicker" id="bzid" data-live-search="true">
  273. <option value="">请选择维修项目内容</option>
  274. </select>
  275. </div>
  276. </div>
  277. <div class="form-group">
  278. <div class="col-sm-12" style="text-align: center;">
  279. <input type="button" id="HY_save" class="btn_gray btn" onclick="btn_save()" value="处理" />
  280. </div>
  281. </div>
  282. </div>
  283. </div>
  284. <script src="../js/equipmentCommon.js"></script>
  285. <script src="../../js/webuploader.min.js"></script>
  286. <script>
  287. var clicknum = -1
  288. var code = helper.request.queryString("code");
  289. var floorId = helper.request.queryString("floorId");
  290. var serveMan = window.localStorage.getItem('userCode');
  291. $(document).ready(function() {
  292. var usercodes = []
  293. togetherCodes(usercodes)
  294. $('#woCode').val(code);
  295. //系统名称
  296. helper.getDropList.getlistDropByDic($('#sysname'), 'XTMC').then(function() {
  297. $('#sysname').trigger('change');
  298. });
  299. //故障类型
  300. helper.getDropList.getlistDropByDic($('#faulttype'), 'GZLX');
  301. //日期
  302. lay('.dates').each(function() {
  303. laydate.render({
  304. elem: this,
  305. trigger: 'click',
  306. type: 'datetime'
  307. });
  308. });
  309. $('#isusematerial').change(function() {
  310. if ($(this).val() == 0) {
  311. $('.isusematerial').hide();
  312. } else {
  313. $('.isusematerial').show();
  314. }
  315. })
  316. $('#islosematerial').change(function() {
  317. if ($(this).val() == 1) {
  318. $('.islosematerial').show();
  319. $('#states').empty();
  320. $('<option value="7">挂起</option>').appendTo('#states');
  321. $('#states').selectpicker('refresh');
  322. } else {
  323. $('.islosematerial').hide();
  324. $('#states').empty();
  325. $('<option value="2">已处理</option><option value="7">挂起</option>').appendTo('#states');
  326. $('#states').selectpicker('refresh');
  327. }
  328. })
  329. $('#sysname').change(function() {
  330. forFloorGetEquipName($('#equipname'), floorId, $(this).val());
  331. })
  332. $('#istogether').change(function() {
  333. if ($(this).val() == 1) {
  334. $('.togetherbox').show();
  335. btn_together()
  336. } else {
  337. $('.togetherbox').hide();
  338. }
  339. })
  340. $('#states').change(function() {
  341. if ($(this).val() == 7) {
  342. $('.gqbecausewrap').show();
  343. } else {
  344. $('.gqbecausewrap').hide();
  345. }
  346. })
  347. })
  348. uploaderImg(0)
  349. var imageArr0 = '';
  350. uploaderImg(1)
  351. var imageArr1 = '';
  352. //添加图片
  353. function uploaderImg(cindex) {
  354. var imgList = $('#image_list' + cindex),
  355. eleId = $('#filePicker' + cindex),
  356. uploader;
  357. uploader = WebUploader.create({
  358. // 自动上传。
  359. auto: true,
  360. // swf文件路径
  361. swf: '../../js/Uploader.swf',
  362. // 文件接收服务端。
  363. server: huayi.config.callcenter_url + 'fileserverapi/Api/Upload',
  364. // 选择文件的按钮。可选。
  365. // 内部根据当前运行是创建,可能是input元素,也可能是flash.
  366. pick: eleId,
  367. // 图片数量限制
  368. // fileNumLimit: 4,
  369. //可以重复上传
  370. duplicate: true,
  371. formData: {
  372. uploadtype: 'equipment' //自定义文件夹用于存放图片
  373. },
  374. // 只允许选择文件,可选。
  375. accept: {
  376. title: 'Images',
  377. extensions: 'gif,jpg,jpeg,bmp,png',
  378. mimeTypes: 'image/*'
  379. },
  380. fileSizeLimit: 30 * 1024 * 1024, // 30 M
  381. fileSingleSizeLimit: 5 * 1024 * 1024, // 5 M
  382. resize: false
  383. });
  384. //上传图片提示
  385. uploader.on('error', function(handler) {
  386. switch (code) {
  387. case "Q_EXCEED_NUM_LIMIT":
  388. layer.msg('只能上传六个文件。');
  389. break;
  390. case "Q_TYPE_DENIED":
  391. layer.msg('图片类型不正确。');
  392. break;
  393. case "F_DUPLICATE":
  394. layer.msg('该文件已上传,请选择其它文件。');
  395. break;
  396. case "F_EXCEED_SIZE":
  397. layer.msg('单文件大小不能超过5M。');
  398. break;
  399. case "Q_EXCEED_SIZE_LIMIT":
  400. layer.msg('总文件大小不能超过30M。');
  401. break;
  402. default:
  403. break;
  404. }
  405. });
  406. // 当有文件添加进来的时候
  407. uploader.on('fileQueued', function(file) {
  408. // console.log(file);
  409. var $li = $(
  410. '<div id="' + cindex + '' + file.id + '" class="file-item thumbnail">' +
  411. '<div class="image-close">X</div>' +
  412. '<img>' +
  413. '<div class="info">' + file.name + '</div>' +
  414. '</div>'
  415. ),
  416. $img = $li.find('img');
  417. imgList.prepend($li);
  418. $(".image-close").on('click', function() {
  419. event.stopPropagation();
  420. $(this).parent().remove();
  421. uploader.removeFile(file);
  422. helper.methods.delImgs($(this).parent().attr("data-filesmallurl"), $(this).parent().attr(
  423. "data-fileurl"));
  424. file_num(cindex)
  425. });
  426. });
  427. // 文件上传成功,给item添加成功class, 用样式标记上传成功。
  428. uploader.on('uploadSuccess', function(file, response) {
  429. // console.log(file)
  430. $.each(response.data, function(i, j) {
  431. // obj=
  432. var $img = $('#' + cindex + file.id).find('img');
  433. $('#' + cindex + file.id).attr({
  434. 'data-filename': j.filename,
  435. 'data-fileext': j.fileext,
  436. 'data-filemd5': j.filemd5,
  437. 'data-filesize': j.filesize,
  438. 'data-fileurl': j.fileurl,
  439. 'data-filesmallurl': j.filesmallurl
  440. });
  441. uploader.makeThumb(file, function(error, src) {
  442. $img.attr('src', j.filesmallurl);
  443. $img.addClass('image-item');
  444. // $img.attr('data-preview-group', "1");
  445. }, 50, 50);
  446. });
  447. $('#' + cindex + file.id).addClass('upload-state-done');
  448. file_num(cindex)
  449. });
  450. // 文件上传失败,现实上传出错。
  451. uploader.on('uploadError', function(file) {
  452. var $li = $('#' + cindex + file.id),
  453. $error = $li.find('div.error');
  454. // 避免重复创建
  455. if (!$error.length) {
  456. $error = $('<div class="error"></div>').appendTo($li);
  457. }
  458. $error.text('上传失败');
  459. });
  460. // 完成上传完了,成功或者失败,先删除进度条。
  461. // uploader.on('uploadComplete', function(file) {
  462. // });
  463. }
  464. //隐藏域值
  465. function file_num(num) {
  466. var arr = [];
  467. $('#image_list' + num).find('.thumbnail').each(function(j, m) {
  468. var obj = {
  469. 'filename': $(m).attr("data-filename"),
  470. 'fileext': $(m).attr("data-fileext"),
  471. 'filemd5': $(m).attr("data-filemd5"),
  472. 'filesize': $(m).attr("data-filesize"),
  473. 'fileurl': $(m).attr("data-fileurl"),
  474. 'filesmallurl': $(m).attr("data-filesmallurl")
  475. }
  476. arr.push(obj)
  477. })
  478. window['imageArr' + num] = arr;
  479. // console.log(imageArr0)
  480. }
  481. //添加自定义字段
  482. function addExtension(num) {
  483. clicknum++
  484. var str = '<tr>' +
  485. '<td>' +
  486. '<select class="form-control selectpicker" id="inv_name' + clicknum +
  487. '" data-live-search="true"><option value="">请选择配件名称</option></select>' +
  488. '</td>' +
  489. '<td>' +
  490. '<input type="text" class="form-control extenValue" placeholder="请输入配件价格" autocomplete="off"/>' +
  491. '</td>' +
  492. '<td>' +
  493. '<input type="text" class="form-control priceValue" placeholder="请输入配件数量" autocomplete="off"/>' +
  494. '</td>' +
  495. '<td>' +
  496. '<button class="btn btn-danger" onclick="delExtension(this,' + num + ')">删除</button>' +
  497. // '<button class="btn btn-info addBtn" onclick="addExtension(this)">添加</button>'+
  498. '</td>' +
  499. '</tr>'
  500. $('#table_extension' + num + ' tbody').append(str);
  501. $.getScript("../../js/bootstrap-select/js/bootstrap-select.js")
  502. // 耗材
  503. getequipment(clicknum)
  504. // $(ele).remove();
  505. $("#inv_name"+clicknum).change(function() {
  506. $("#inv_name"+clicknum).empty();
  507. $.ajax({
  508. type: "get",
  509. url: huayi.config.callcenter_url +
  510. "equipmentapi/api/worepairbase/gethcinfo", //获取数据的Servlet地址
  511. async: true,
  512. dataType: 'json',
  513. data: {
  514. inv_name: $("#inv_name"+clicknum).val()
  515. },
  516. success: function(data) {
  517. if (data.state.toLowerCase() == 'success') {
  518. $('#table_extension' + clicknum + '').find('tbody tr').each(function(g, h) {
  519. $(h).find('.extenValue').val(data.data[0].price);
  520. })
  521. }
  522. }
  523. });
  524. $("#inv_name").trigger('change');
  525. })
  526. }
  527. //自定义字段 删除一行
  528. function delExtension(ele, num) {
  529. $(ele).parent().parent().remove();
  530. getExtenArr(num);
  531. }
  532. //自定义字段 数组
  533. function getExtenArr(num) {
  534. var extenArr = [];
  535. $('#table_extension' + num + '').find('tbody tr').each(function(g, h) {
  536. console.log(g, h)
  537. if ($.trim($(h).find('.extenValue').val()) !== '' && $.trim($(h).find('.extenValue').val()) !== '') {
  538. var objs = {
  539. 'name': $(h).find('#inv_name' + g).val(),
  540. 'describe': $(h).find('.extenValue').val(),
  541. 'inv_num': $(h).find('.priceValue').val()
  542. };
  543. extenArr.push(objs);
  544. }
  545. })
  546. //console.log(extenArr);
  547. return extenArr;
  548. }
  549. //保存
  550. function btn_save() {
  551. addValue();
  552. }
  553. //处理
  554. function addValue() {
  555. var usematerialLists = getExtenArr(1);
  556. var lackmaterialLists = getExtenArr(2);
  557. if ($('#isusematerial').val() === '1') { //是否使用耗材:1是,0否
  558. if (usematerialLists.length === 0) {
  559. layer.confirm('请输入使用耗材信息!', {
  560. icon: 2,
  561. btn: ['确定'] //按钮
  562. });
  563. return;
  564. }
  565. } else {
  566. usematerialLists = [];
  567. }
  568. if ($('#islosematerial').val() === '1') { //是否缺少耗材:1是,0否
  569. if (lackmaterialLists.length === 0) {
  570. layer.confirm('请输入缺少耗材信息!', {
  571. icon: 2,
  572. btn: ['确定'] //按钮
  573. });
  574. return;
  575. }
  576. } else {
  577. lackmaterialLists = [];
  578. }
  579. // if(!imageArr0) {
  580. // layer.confirm('请上传处理完成前的照片!', {
  581. // icon: 2,
  582. // btn: ['确定'] //按钮
  583. // });
  584. // return;
  585. // }
  586. // if(!imageArr1) {
  587. // layer.confirm('请上传处理完成后的照片!', {
  588. // icon: 2,
  589. // btn: ['确定'] //按钮
  590. // });
  591. // return;
  592. // }
  593. if ($("#exceptiondes").val() == '') {
  594. layer.confirm('请输入异常说明!', {
  595. icon: 2,
  596. btn: ['确定'] //按钮
  597. });
  598. return;
  599. }
  600. if ($("#origins").val() == '') {
  601. layer.confirm('请选择来源!', {
  602. icon: 2,
  603. btn: ['确定'] //按钮
  604. });
  605. return;
  606. }
  607. if ($("#gqbecause").val() == '' && $('.gqbecausewrap').css('display') == 'block') {
  608. layer.confirm('请选择挂起原因!', {
  609. icon: 2,
  610. btn: ['确定'] //按钮
  611. });
  612. return;
  613. }
  614. if ($("#bzid").val() == '') {
  615. layer.confirm('请选择维修项目内容!', {
  616. icon: 2,
  617. btn: ['确定'] //按钮
  618. });
  619. return;
  620. }
  621. // 提交
  622. $.ajax({
  623. type: "post",
  624. url: huayi.config.callcenter_url + "equipmentapi/api/worepairbase/deal",
  625. async: true,
  626. dataType: 'json',
  627. data: {
  628. wocode: code, //工单编号
  629. channel: 1, //渠道
  630. systemid: $('#sysname').val(), //系统名称
  631. equipmentid: $('#equipname').val(), //设备名称
  632. faulttypeid: $('#faulttype').val(), //是 string 故障类型id
  633. isusematerial: $('#isusematerial').val(), //是否使用耗材:1是,0否
  634. materialinfo: usematerialLists, //使用耗材信息
  635. islosematerial: $('#islosematerial').val(), //是否缺少耗材:1是,0否
  636. losematerialinfo: lackmaterialLists, //缺少耗材信息
  637. exfiles: imageArr0, // 处理完成前的照片
  638. files: imageArr1, // 处理完成后的照片
  639. detail: $('#exceptiondes').val(), // 异常说明
  640. CLpeoplefrom: $('#origins').val(), //来源
  641. state: $('#states').val(), // 工单状态:3已完成,6挂起
  642. wxtimeid: $('#bzid').val(), //维修内容
  643. gqbecause: $('#gqbecause').val(),
  644. dealusers: userCodes //协同人
  645. },
  646. success: function(data) {
  647. if (data.state.toLowerCase() == 'success') {
  648. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  649. parent.layer.close(index); //再执行关闭
  650. layer.msg(data.message);
  651. parent.$('#table1').bootstrapTable('refresh');
  652. }
  653. }
  654. });
  655. }
  656. // 获取设备
  657. function getequipment(num) {
  658. // $("#equipname").html('');
  659. equipmentdata = []
  660. // $("#equipname").append('<option selected="selected" value="">请选择设备</option>');
  661. $.ajax({
  662. type: "get",
  663. url: huayi.config.callcenter_url + "equipmentapi/api/worepairbase/gethcinfo", //获取数据的Servlet地址
  664. async: true,
  665. dataType: 'json',
  666. data: {},
  667. success: function(data) {
  668. var equipmentdata = []
  669. if (data.state.toLowerCase() == 'success') {
  670. equipmentdata = data.data
  671. if (equipmentdata.length > 0) {
  672. for (var k = 0; k < equipmentdata.length; k++) {
  673. $(equipmentdata[k]).each(function(q, p) {
  674. $("<option value='" + p.inv_name + "'>" + p.inv_name + "</option>")
  675. .appendTo("#inv_name" + num);
  676. $("#inv_name").selectpicker('refresh');
  677. $('#inv_name').selectpicker('render');
  678. // console.log(p.equipment_name)
  679. });
  680. }
  681. } else {
  682. // $("#inv_name").empty();
  683. $("#inv_name" + num).selectpicker('refresh');
  684. $('#inv_name' + num).selectpicker('render');
  685. }
  686. }
  687. }
  688. });
  689. }
  690. function forFloorGetEquipName(obj, fids, sysid) {
  691. $.getJSON(huayi.config.callcenter_url + "equipmentapi/api/Equipment/getrepairlistdrop", {
  692. floorid: fids,
  693. systemid: sysid
  694. }, function(data) {
  695. if (data.state.toLowerCase() == "success") {
  696. obj.empty();
  697. var content = data.data;
  698. if (content && content.length > 0) {
  699. $(content).each(function(i, n) {
  700. $("<option value='" + n.id + "'>" + n.name + "</option>").appendTo(obj);
  701. });
  702. } else {
  703. $("<option value=''>暂无数据</option>").appendTo(obj);
  704. }
  705. obj.selectpicker('refresh');
  706. }
  707. })
  708. }
  709. $(function() {
  710. getwxcontent()
  711. })
  712. // 获取维修内容
  713. function getwxcontent() {
  714. $("#bzid").html('');
  715. $("#bzid").append('<option selected="selected" value="">请选择维修项目内容</option>');
  716. $.getJSON(huayi.config.callcenter_url + "equipmentapi/api/WoRepairBase/getwxwptimesbybz", function(data) {
  717. if (data.state.toLowerCase() == "success") {
  718. var province = data.data;
  719. console.log(province)
  720. for (var i = 0; i < province.length; i++) {
  721. console.log(province[i].wxcenter)
  722. $("<option value='" + province[i].id + "'>" + province[i].wxcenter + "</option>").appendTo(
  723. "#bzid");
  724. $('#bzid').selectpicker('refresh');
  725. $('#bzid').selectpicker('render');
  726. }
  727. } else {
  728. $("#bzid").empty();
  729. $("#bzid").selectpicker('refresh');
  730. }
  731. })
  732. }
  733. // 协同人
  734. function judgetoge() {
  735. }
  736. function btn_together() {
  737. layer.open({
  738. type: 2,
  739. content: "../addtogether.html?code=" + code,
  740. title: '添加协同人',
  741. area: ['35%', '90%'], //宽高
  742. });
  743. }
  744. function togetherVal(name) {
  745. $('#xtContent').text(name)
  746. }
  747. function togetherCodes(codes) {
  748. userCodes = codes
  749. }
  750. </script>
  751. </body>
  752. </html>