123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>viewWhhSh.htm</title>
- <link rel="stylesheet" href="views/whh/whhPlus/editWhh.css?type=4">
- #include("template/whh-other.vm")
- <script type="text/javascript" src="views/whh/js/ajaxForm.js"></script>
- <style type="text/css">
- .textArea{
- color: #333;
- }
- </style>
- <script type="text/javascript">
- $(function() {
- /**
- * 时间事件
- * */
- shijian();
- //自动计算
- $(".m3").click(function() {
- saveCljg();
- })
- })
- /**
- * 时间事件
- * */
- function shijian() {
- mui.init();
- mui.ready(function() {
- var rqbtns = $('.showRq');
- rqbtns.each(function(i, showRq) {
- showRq.addEventListener('tap', function() {
- var that = this.value;
- dateP(showRq, that);
- }, false);
- });
- });
- }
- function dateP(inputClass, that) {
- var picker = new mui.DtPicker({
- type : "date",//设置日历初始视图模式
- value : that,
- endDate : new Date(),//设置结束日期
- beginDate : new Date($("#sqsj").val())
- });
- picker.show(function(rs) {
- inputClass.value = rs.text;
- picker.dispose();
- });
- }
- /**
- * 上传图片
- * @param e
- */
- function loadImage(e, type) {
- var picPath = "";
- if (e) {
- if (window.navigator.userAgent.indexOf("MSIE") >= 1) {
- //ie
- e.select();
- picPath = document.selection.createRange().text;
- } else if (window.navigator.userAgent.indexOf("Firefox") >= 1) {
- //firefox
- if (e.files) {
- picPath = e.files.item(0).getAsDataURL();
- } else {
- picPath = e.value;
- }
- } else {
- picPath = e.value;
- }
- }
- var patn = /\.jpg$|\.jpeg$|\.gif$|\.png$|\.bmp$/i;
- 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;
- if (picPath == "") {
- return;
- }
- if (type == "pic") {
- if (!patn.test(picPath)) {
- alert("你上传的不是图片文件!");
- e.value = "";
- tof = true;
- return;
- } else {
- tof = false;
- }
- } else if (type == "vedio") {
- if (!patnSp.test(picPath)) {
- e.value = "";
- alert("你上传的视频文件不符合要求!");
- tof = true;
- return;
- } else {
- tof = false;
- }
- var fileSize = e.files[0].size;
- if (fileSize > 10 * 1024 * 1024) {
- e.value = "";
- alert("上传文件不能超过10M");
- }
- }
- if (type == "vedio") {
- jQuery('#vedioForm').ajaxSubmit({
- type : 'post',
- dataType : 'json',
- data : {
- "picPath" : picPath
- },
- success : function(data) {
- if (data.hdPic != null) {
- alert("上传成功");
- $("#VidewoText").val(picPath);
- $("#" + type + "Str").val(data.zwName);
- } else {
- e.value = "";
- alert("上传失败-0");
- }
- },
- error : function(data) {
- e.value = "";
- alert("上传失败-1");
- }
- });
- } else if (type == "pic") {
- jQuery('#picForm').ajaxSubmit({
- type : 'post',
- dataType : 'json',
- data : {
- "picPath" : picPath
- },
- success : function(data) {
- if (data.hdPic != null) {
- alert("上传成功");
- $("#picText").val(picPath);
- $("#" + type + "Str").val(data.zwName);
- } else {
- e.value = "";
- alert("上传失败-0");
- }
- },
- error : function(data) {
- e.value = "";
- alert("上传失败-1");
- }
- });
- }
- }
- function saveCljg() {
- var clsj = $("#clsj").val();
- var zp = $("#picStr").val();
- var sp = $("#vedioStr").val();
- var jdry = $("#jdry").val();
- var djid = $("#djid").val();
- var bz = $("#bz").val();
- if (clsj == "" || jdry == "" || bz == "") {
- alert("请完善信息");
- return;
- } else {
- jQuery
- .ajax({
- type : "get",
- contentType : "application/x-www-form-urlencoded; charset=utf-8", //编码格式
- url : "saveWhhCl.htm",
- data : {
- "djid" : djid,
- "clsj" : clsj,
- "clzp" : zp,
- "clsp" : sp,
- "jdry" : encodeURI(encodeURI(jdry)),
- "bz" : encodeURI(encodeURI(bz))
- },
- dataType : "json",
- async : true,
- success : function(data) {
- if (data.returnCode == "1") {
- alert("处理成功");
- backToIndex();
- } else {
- alert(data.returnBuffer);
- }
- }
- });
- }
- }
- /**
- * 显示遮罩层
- * */
- function showOverlay() {
- $("#overlay").height(pageHeight());
- $("#overlay").width(pageWidth());
- // fadeTo第一个参数为速度,第二个为透明度
- // 多重方式控制透明度,保证兼容性,但也带来修改麻烦的问题
- $("#overlay").fadeTo(200, 0.5);
- };
- /**
- * 隐藏覆盖层
- * */
- function hideOverlay() {
- $("#overlay").fadeOut(200);
- };
- /**
- * 当前页面高度
- */
- function pageHeight() {
- return document.body.scrollHeight;
- };
- /**
- * 当前页面宽度
- * */
- function pageWidth() {
- return document.body.scrollWidth;
- };
- </script>
- </head>
- <body>
- <input type="hidden" id="sqsj" value="$!sqsj">
- <section>
- <div class="headline"><div class="lsfk"></div>处理结果</div>
- <div class="cont-wrapper">
- <div class="line">
- <div class="divicon">
- <svg class="icon-whhxq icon-clsj" aria-hidden="true">
- <use xlink:href="#icon-naozhong"></use>
- </svg>
- </div>
- <div class="title">
- 处理时间<span></span>
- </div>
- <div>:</div>
- <div class="cont">
- <input type="text" id="clsj" class="showRq">
- </div>
- <div class="xing">  *</div>
- </div>
- <form name="uploadPicForm" id="picForm" method="post"
- action="uploadPic.htm?method=fileUpload"
- enctype="multipart/form-data">
- <div class="line">
- <div class="divicon">
- <svg class="icon-whhxq icon-zp" aria-hidden="true">
- <use xlink:href="#icon-chakantiezizhaopian"></use>
- </svg>
- </div>
- <div class="title" style="width: 100px;">
- 现场照片<span></span>
- </div>
- <div>:</div>
- <div class="zpsp">
- <input type="file" id="url" name="url" value="$!url"
- onchange="loadImage(this,'pic')" style="display: none;"
- accept="image/*" /> <input type="hidden" id="picStr" value="">
- <input type="text" id="picText" value="无害化处理照片"
- readonly="readonly">
- <div class="btn editClBtn "
- onclick="document.uploadPicForm.url.click()">上传</div>
- </div>
- </div>
- </form>
- <form name="uploadForm" id="vedioForm" method="post"
- action="uploadPic.htm?method=fileUpload"
- enctype="multipart/form-data">
- <div class="line">
- <div class="divicon">
- <svg class="icon-whhxq icon-sp" aria-hidden="true">
- <use xlink:href="#icon-shipin"></use>
- </svg>
- </div>
- <div class="title" style="width: 100px;">
- 现场视频<span></span>
- </div>
- <div>:</div>
- <div class="zpsp">
- <input type="file" name="url" value="$!url"
- onchange="loadImage(this,'vedio')" style="display:none;"
- multiple="multiple" accept="video/*" capture="camcorder"/> <input type="hidden"
- id="vedioStr" value=""> <input type="text" id="VideoText"
- value="无害化处理视频" readonly="readonly">
- <div class="btn editClBtn"
- onclick="document.uploadForm.url.click()">上传</div>
- </div>
- </div>
- </form>
- <div class="line">
- <div class="divicon">
- <svg class="icon-whhxq icon-jdry" aria-hidden="true">
- <use xlink:href="#icon-renyuanguanli"></use>
- </svg>
- </div>
- <div class="title">
- 监督人员<span></span>
- </div>
- <div>:</div>
- <div class="cont">
- <input type="text" id="jdry" name="cdxx.jdry">
- </div>
- <div class="xing">  *</div>
- </div>
- <div class="line">
- <div class="divicon">
- <svg class="icon-whhxq icon-clbz" aria-hidden="true">
- <use xlink:href="#icon-tianjiabeizhu"></use>
- </svg>
- </div>
- <div class="title">
- 备注<span></span>
- </div>
- <div>:</div>
- <div class="cont" style=" flex: 0 0 60%;">
- <textarea rows="5" cols="5" class="textArea" id="bz"></textarea>
- </div>
- <div class="xing">  *</div>
- </div>
- </div>
- </section>
- <div id="overlay"></div>
- </body>
- </html>
|