editWhhCl.htm 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>viewWhhSh.htm</title>
  5. <link rel="stylesheet" href="views/whh/whhPlus/editWhh.css?type=4">
  6. #include("template/whh-other.vm")
  7. <script type="text/javascript" src="views/whh/js/ajaxForm.js"></script>
  8. <style type="text/css">
  9. .textArea{
  10. color: #333;
  11. }
  12. </style>
  13. <script type="text/javascript">
  14. $(function() {
  15. /**
  16. * 时间事件
  17. * */
  18. shijian();
  19. //自动计算
  20. $(".m3").click(function() {
  21. saveCljg();
  22. })
  23. })
  24. /**
  25. * 时间事件
  26. * */
  27. function shijian() {
  28. mui.init();
  29. mui.ready(function() {
  30. var rqbtns = $('.showRq');
  31. rqbtns.each(function(i, showRq) {
  32. showRq.addEventListener('tap', function() {
  33. var that = this.value;
  34. dateP(showRq, that);
  35. }, false);
  36. });
  37. });
  38. }
  39. function dateP(inputClass, that) {
  40. var picker = new mui.DtPicker({
  41. type : "date",//设置日历初始视图模式
  42. value : that,
  43. endDate : new Date(),//设置结束日期
  44. beginDate : new Date($("#sqsj").val())
  45. });
  46. picker.show(function(rs) {
  47. inputClass.value = rs.text;
  48. picker.dispose();
  49. });
  50. }
  51. /**
  52. * 上传图片
  53. * @param e
  54. */
  55. function loadImage(e, type) {
  56. var picPath = "";
  57. if (e) {
  58. if (window.navigator.userAgent.indexOf("MSIE") >= 1) {
  59. //ie
  60. e.select();
  61. picPath = document.selection.createRange().text;
  62. } else if (window.navigator.userAgent.indexOf("Firefox") >= 1) {
  63. //firefox
  64. if (e.files) {
  65. picPath = e.files.item(0).getAsDataURL();
  66. } else {
  67. picPath = e.value;
  68. }
  69. } else {
  70. picPath = e.value;
  71. }
  72. }
  73. var patn = /\.jpg$|\.jpeg$|\.gif$|\.png$|\.bmp$/i;
  74. var patnSp = /\.avi$|\.dat$|\.mpg$|\.mpeg$|\.vob$|\.mkv$|\.mov$|\.wmv$|\.asf$|\.rm$|\.rmvb$|\.ram$|\.flv$|\.mp4$|\.3gp$|\.dv$|\.qt$|\.divx$|\.cpk$|\.fli$|\.flc$|\.m4v$/i;
  75. if (picPath == "") {
  76. return;
  77. }
  78. if (type == "pic") {
  79. if (!patn.test(picPath)) {
  80. alert("你上传的不是图片文件!");
  81. e.value = "";
  82. tof = true;
  83. return;
  84. } else {
  85. tof = false;
  86. }
  87. } else if (type == "vedio") {
  88. if (!patnSp.test(picPath)) {
  89. e.value = "";
  90. alert("你上传的视频文件不符合要求!");
  91. tof = true;
  92. return;
  93. } else {
  94. tof = false;
  95. }
  96. var fileSize = e.files[0].size;
  97. if (fileSize > 10 * 1024 * 1024) {
  98. e.value = "";
  99. alert("上传文件不能超过10M");
  100. }
  101. }
  102. if (type == "vedio") {
  103. jQuery('#vedioForm').ajaxSubmit({
  104. type : 'post',
  105. dataType : 'json',
  106. data : {
  107. "picPath" : picPath
  108. },
  109. success : function(data) {
  110. if (data.hdPic != null) {
  111. alert("上传成功");
  112. $("#VidewoText").val(picPath);
  113. $("#" + type + "Str").val(data.zwName);
  114. } else {
  115. e.value = "";
  116. alert("上传失败-0");
  117. }
  118. },
  119. error : function(data) {
  120. e.value = "";
  121. alert("上传失败-1");
  122. }
  123. });
  124. } else if (type == "pic") {
  125. jQuery('#picForm').ajaxSubmit({
  126. type : 'post',
  127. dataType : 'json',
  128. data : {
  129. "picPath" : picPath
  130. },
  131. success : function(data) {
  132. if (data.hdPic != null) {
  133. alert("上传成功");
  134. $("#picText").val(picPath);
  135. $("#" + type + "Str").val(data.zwName);
  136. } else {
  137. e.value = "";
  138. alert("上传失败-0");
  139. }
  140. },
  141. error : function(data) {
  142. e.value = "";
  143. alert("上传失败-1");
  144. }
  145. });
  146. }
  147. }
  148. function saveCljg() {
  149. var clsj = $("#clsj").val();
  150. var zp = $("#picStr").val();
  151. var sp = $("#vedioStr").val();
  152. var jdry = $("#jdry").val();
  153. var djid = $("#djid").val();
  154. var bz = $("#bz").val();
  155. if (clsj == "" || jdry == "" || bz == "") {
  156. alert("请完善信息");
  157. return;
  158. } else {
  159. jQuery
  160. .ajax({
  161. type : "get",
  162. contentType : "application/x-www-form-urlencoded; charset=utf-8", //编码格式
  163. url : "saveWhhCl.htm",
  164. data : {
  165. "djid" : djid,
  166. "clsj" : clsj,
  167. "clzp" : zp,
  168. "clsp" : sp,
  169. "jdry" : encodeURI(encodeURI(jdry)),
  170. "bz" : encodeURI(encodeURI(bz))
  171. },
  172. dataType : "json",
  173. async : true,
  174. success : function(data) {
  175. if (data.returnCode == "1") {
  176. alert("处理成功");
  177. backToIndex();
  178. } else {
  179. alert(data.returnBuffer);
  180. }
  181. }
  182. });
  183. }
  184. }
  185. /**
  186. * 显示遮罩层
  187. * */
  188. function showOverlay() {
  189. $("#overlay").height(pageHeight());
  190. $("#overlay").width(pageWidth());
  191. // fadeTo第一个参数为速度,第二个为透明度
  192. // 多重方式控制透明度,保证兼容性,但也带来修改麻烦的问题
  193. $("#overlay").fadeTo(200, 0.5);
  194. };
  195. /**
  196. * 隐藏覆盖层
  197. * */
  198. function hideOverlay() {
  199. $("#overlay").fadeOut(200);
  200. };
  201. /**
  202. * 当前页面高度
  203. */
  204. function pageHeight() {
  205. return document.body.scrollHeight;
  206. };
  207. /**
  208. * 当前页面宽度
  209. * */
  210. function pageWidth() {
  211. return document.body.scrollWidth;
  212. };
  213. </script>
  214. </head>
  215. <body>
  216. <input type="hidden" id="sqsj" value="$!sqsj">
  217. <section>
  218. <div class="headline"><div class="lsfk"></div>处理结果</div>
  219. <div class="cont-wrapper">
  220. <div class="line">
  221. <div class="divicon">
  222. <svg class="icon-whhxq icon-clsj" aria-hidden="true">
  223. <use xlink:href="#icon-naozhong"></use>
  224. </svg>
  225. </div>
  226. <div class="title">
  227. 处理时间<span></span>
  228. </div>
  229. <div>:</div>
  230. <div class="cont">
  231. <input type="text" id="clsj" class="showRq">
  232. </div>
  233. <div class="xing">&nbsp *</div>
  234. </div>
  235. <form name="uploadPicForm" id="picForm" method="post"
  236. action="uploadPic.htm?method=fileUpload"
  237. enctype="multipart/form-data">
  238. <div class="line">
  239. <div class="divicon">
  240. <svg class="icon-whhxq icon-zp" aria-hidden="true">
  241. <use xlink:href="#icon-chakantiezizhaopian"></use>
  242. </svg>
  243. </div>
  244. <div class="title" style="width: 100px;">
  245. 现场照片<span></span>
  246. </div>
  247. <div>:</div>
  248. <div class="zpsp">
  249. <input type="file" id="url" name="url" value="$!url"
  250. onchange="loadImage(this,'pic')" style="display: none;"
  251. accept="image/*" /> <input type="hidden" id="picStr" value="">
  252. <input type="text" id="picText" value="无害化处理照片"
  253. readonly="readonly">
  254. <div class="btn editClBtn "
  255. onclick="document.uploadPicForm.url.click()">上传</div>
  256. </div>
  257. </div>
  258. </form>
  259. <form name="uploadForm" id="vedioForm" method="post"
  260. action="uploadPic.htm?method=fileUpload"
  261. enctype="multipart/form-data">
  262. <div class="line">
  263. <div class="divicon">
  264. <svg class="icon-whhxq icon-sp" aria-hidden="true">
  265. <use xlink:href="#icon-shipin"></use>
  266. </svg>
  267. </div>
  268. <div class="title" style="width: 100px;">
  269. 现场视频<span></span>
  270. </div>
  271. <div>:</div>
  272. <div class="zpsp">
  273. <input type="file" name="url" value="$!url"
  274. onchange="loadImage(this,'vedio')" style="display:none;"
  275. multiple="multiple" accept="video/*" capture="camcorder"/> <input type="hidden"
  276. id="vedioStr" value=""> <input type="text" id="VideoText"
  277. value="无害化处理视频" readonly="readonly">
  278. <div class="btn editClBtn"
  279. onclick="document.uploadForm.url.click()">上传</div>
  280. </div>
  281. </div>
  282. </form>
  283. <div class="line">
  284. <div class="divicon">
  285. <svg class="icon-whhxq icon-jdry" aria-hidden="true">
  286. <use xlink:href="#icon-renyuanguanli"></use>
  287. </svg>
  288. </div>
  289. <div class="title">
  290. 监督人员<span></span>
  291. </div>
  292. <div>:</div>
  293. <div class="cont">
  294. <input type="text" id="jdry" name="cdxx.jdry">
  295. </div>
  296. <div class="xing">&nbsp *</div>
  297. </div>
  298. <div class="line">
  299. <div class="divicon">
  300. <svg class="icon-whhxq icon-clbz" aria-hidden="true">
  301. <use xlink:href="#icon-tianjiabeizhu"></use>
  302. </svg>
  303. </div>
  304. <div class="title">
  305. 备注<span></span>
  306. </div>
  307. <div>:</div>
  308. <div class="cont" style=" flex: 0 0 60%;">
  309. <textarea rows="5" cols="5" class="textArea" id="bz"></textarea>
  310. </div>
  311. <div class="xing">&nbsp *</div>
  312. </div>
  313. </div>
  314. </section>
  315. <div id="overlay"></div>
  316. </body>
  317. </html>