| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- <!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>
- .inpBox {
- border: 1px solid #a9a9a9;
- height: 27px;
- width: 220px;
- display: inline-block;
- position: relative;
- vertical-align: middle;
- }
- .addTree {
- background: #fff;
- position: absolute;
- width: 100%;
- border: 1px solid darkgrey;
- right: 0;
- top: 26px;
- display: none;
- }
- .xl {
- display: inline-block;
- background: url(../../img/dropDown.png) no-repeat;
- height: 100%;
- background-position: center center;
- width: 20px;
- position: absolute;
- right: 0;
- top: 0px;
- /* background-color: #f7bc8b; */
- cursor: pointer;
- }
- .ztree li span {
- border: none;
- padding: 0;
- }
- .inps {
- width: 217px;
- height: 24px;
- outline: none;
- border: 0;
- border-image-width: 0;
- padding: 0;
- padding-left: 3px;
- }
- .xl {
- display: inline-block;
- background: url(../img/dropDown.png) no-repeat;
- height: 100%;
- background-position: center center;
- width: 20px;
- position: absolute;
- right: 0;
- top: 0px;
- /* background-color: #f7bc8b; */
- cursor: pointer;
- }
- </style>
- </head>
- <body>
- <div class="Common" style="height: 100%;">
- <table>
- <tr>
- <th class="Importent">办理结果:</th>
- <td><textarea data-adaptheight id="assignedopinion" name="" rows="4" cols=""></textarea></td>
- </tr>
- <tr>
- <th class="">附件:</th>
- <td>
- <div class="fileBox"></div>
- <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
- <input class="input" type="button" value="上传" id="scwj">
- <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 BC">保存</button>
- </div>
- </div>
- <script src="../css/laydate/laydate.js"></script>
- <script src="../js/zTree/jquery.ztree.core.js"></script>
- <script src="../js/adjustHeight.js"></script>
- <script>
- var wid = helper.request.queryString("wid");
- $(document).ready(function () {
- XQ()
- $('.BC').click(function () {
- JA();
- })
- //交办
- function JA() {
- $.post(huayi.config.callcenter_url + 'WorkOrder/EditDealWorkOrder', {
- workorderid: wid,
- result: $('#assignedopinion').val(), //交办意见
- flies: $("#file").val(),
- 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 XQ() {
- $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetNewSecondDealInfo', {
- workorderid: wid,
- token: $.cookie("token")
- }, function (result) {
- if (result.state.toLowerCase() == "success") {
- $('#assignedopinion').val(result.data[0].F_Result);
- $("#file").val(result.data[0].F_File);
- }
- })
- }
- });
- $("#scwj").click(function () {
- $("#upFile").trigger("click");
- });
- $("#upFile").change(function () {
- upload();
- });
- //上传文件
- 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;
- $(a).each(function (i, n) {
- var strs =
- '<span class="files" fiel-num="' +
- n.F_FileId +
- '">' +
- n.F_FileName.substring(19) +
- '<i class="fa fa-remove del_file"></i></span>';
- $(strs)
- .appendTo($(".fileBox"))
- .find(".del_file")
- .click(function (event) {
- event.stopPropagation();
- $(this).parent().remove();
- file_num();
- });
- });
- file_num();
- }
- },
- });
- } else {
- layer.msg("格式不正确");
- }
- } else {
- layer.confirm("请上传文件!", {
- btn: ["确定"],
- });
- }
- }
- //上传文件隐藏域值
- function file_num() {
- var str = "";
- var Str;
- $(".fileBox .files").each(function (j, m) {
- var aa = $(m).attr("fiel-num");
- console.log(aa);
- str += aa + ",";
- Str =
- str.substring(str.length - 1) == "," ?
- str.substring(0, str.length - 1) :
- str;
- });
- $("#file").val(Str);
- }
- </script>
- </body>
- </html>
|