| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <link href="../css/layer/need/layer.css" />
- <link rel="stylesheet" href="../css/init.css" />
- <title>领导批示</title>
- <style>
- .input {
- background-color: #FFF;
- background-image: none;
- border: 1px solid #ccc;
- border-radius: 1px;
- color: inherit;
- padding: 6px 12px
- }
-
- .fjnr {
- padding: 0!important;
- border: none!important;
- }
- .HT{
- display: none;
- }
- </style>
- </head>
- <body>
- <div class="Common">
- <table>
- <tr class="HT">
- <th class="Importent">批示人:</th>
- <td> <input type="text" id="superuser"/></td>
- </tr>
- <tr>
- <th >批示类型:</th>
- <td>
- <input type="text" id="Type" readonly="readonly"/>
- <input type="hidden" id="Types"/>
- </td>
- </tr>
- <tr>
- <th class="Importent">批示内容:</th>
- <td colspan="2"><textarea data-adaptheight id="superopinion" name="" rows="6" cols=""></textarea></td>
- </tr>
- <tr>
- <th>附件上传:</th>
- <td colspan="7">
- <span class="fjnr"></span>
- <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
- <input class="input" type="button" value="上传" id="scwj" />
- <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
- <input type="hidden" id="file" />
- <span style="color:#FF0000; border: none;">
- (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
- </span>
- </td>
- </tr>
- </table>
- <div class="btn_box">
- <button class="btns">保存</button>
- </div>
- </div>
- <script src="../css/laydate/laydate.js"></script>
- <script src="../js/adjustHeight.js"></script>
- <script>
- var wid = helper.request.queryString("wid");
- var type = helper.request.queryString("type");
- console.log(type)
- $(document).ready(function() {
- if(type==1||type==2){
- $(".HT").show();
- }
- XQ();
- //上传附件
- $("#scwj").click(function() {
- $("#upFile").trigger("click");
- })
- $("#upFile").change(function() {
- upload();
- })
- $("#scfj").click(function() {
- $(".fjnr").text("");
- $("#scfj").hide();
- })
- $(".btns").click(function(){
- JA();
- })
- })
- //批示
- function JA() {
- $.post(huayi.config.callcenter_url + 'WorkOrder/EditSuperInfoByAdmin', {
- id: wid,
- type:$("#Types").val(),//(1领导批示 2市长指示)
- superuser:$("#superuser").val(),//批示人&
- superopinion:$('#superopinion').val(),//批示内容&
- files:$("#file").val(),//附件id(多个用英文逗号,隔开
- "token": $.cookie("token")
- }, function(result) {
- result = JSON.parse(result);
- if(result.state.toLowerCase() == "success") {
- parent.parent.layer.closeAll();
- parent.parent.$('#orderlist').bootstrapTable('refresh');
- parent.parent.layer.msg("操作成功!");
- }
- })
- }
- function upload() {
- var Files = document.getElementById("upFile").files;
- if(Files.length > 0) {
- var formData = new FormData();
- for(var i = 0; i < Files.length; i++) {
- formData.append('file' + i, Files[i]);
- }
- formData.append("token", $.cookie("token"));
- var typeName=Files[0].name.split('.')[1];
- if (typeName=="png"||typeName=='jpg'||typeName=='mp4'||typeName=='mp3'||typeName=='pdf'||typeName=='doc'||typeName=='docx'||typeName=='xls'||typeName=='xlsx') {
- $.ajax({
- url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
- type: "POST",
- data: formData,
- /**
- *必须false才会自动加上正确的Content-Type
- */
- contentType: false,
- /**
- * 必须false才会避开jQuery对 formdata 的默认处理
- * XMLHttpRequest会对 formdata 进行正确的处理
- */
- processData: false,
- success: function(result) {
- document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
- $("#upFile").change(function() {
- upload();
- });
- var r = $.parseJSON(result);
- if(r.state.toLowerCase() == "success") {
- $(".fjnr").text(r.data[0].F_FileName);
- var a = r.data;
- var str = '';
- var Str;
-
- $(a).each(function(i, n) {
- console.log(n.F_FileId);
- str += n.F_FileId + ",";
- Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
- console.log(Str);
- })
- $("#file").val(Str);
- $("#scfj").show();
- }
- }
- });
- }else{
- layer.msg("格式不正确");
- }
- } else {
- layer.confirm('请上传文件!', {
- btn: ['确定']
- });
- }
- }
- function XQ(){
- $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetInfoByAdmin', {
- id: wid,
- type:5,
- token: $.cookie("token")
- }, function(result) {
- if(result.state.toLowerCase() == "success") {
- var type=result.data[0].F_Type;
- var Ltype="";
- if(type==1){
- Ltype="领导批示";
- }else if(type==2){
- Ltype="市长指示";
- } else if(type==3){
- Ltype="回退";
- }
- $("#Type").val(Ltype);
- $("#Types").val(type);
- $("#superuser").val(result.data[0].F_BatchReason);
- $('#superopinion').val(result.data[0].F_SuperOpinion);
- // $("#reason").val(result.data[0].F_RefuseReason)
- console.log(result);
-
- }
- })
- }
- </script>
- </body>
- </html>
|