| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <!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>
- </head>
- <body>
- <div class="Common">
- <table>
- <tr>
- <th class="Importent">延时类型:</th>
- <td>
- <select id="delayType" disabled="disabled" class="" style="width: 192px; height: 32px;">
- <option value="1" selected="selected">办理时限</option>
- <option value="2">扫描件时效</option>
- </select>
- </td>
- </tr>
- <tr>
- <th class="Importent">申请延时时间:</th>
- <td> <input type="text" id="startTime" class="laydate-icon" style="height: 32px;" autocomplete="off">
- </td>
- </tr>
- <tr>
- <th class="Importent">申请延时原因:</th>
- <td colspan="2">
- <textarea data-adaptheight id="reason" name="" rows="" cols=""></textarea>
- </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 limitTime = "";
- $(document).ready(function () {
- getDetail()
- $(".btns").click(function () {
- if ($("#reason").val() == '') {
- layer.msg("申请原因不为空");
- } else {
- if ($("#delayType").val() == '1') {
- JA();
- } else if ($("#delayType").val() == '2') {
- scanningDelay()
- }
- }
- })
- })
- //批示
- function JA() {
- // $("#startTime").val()
- $.post(huayi.config.callcenter_url + 'WorkOrder/DelayWorkOrder', {
- workorderid: wid,
- reason: $("#reason").val(),
- newlimittime: $("#startTime").val(),
- "token": $.cookie("token")
- }, function (result) {
- result = JSON.parse(result);
- if (result.state.toLowerCase() == "success") {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.$('#orderlist').bootstrapTable('refresh');
- parent.layer.msg("申请延时成功");
- }
- })
- }
- // 扫描件延时
- function scanningDelay() {
- $.post(huayi.config.callcenter_url + 'WorkOrder/DelayScanning', {
- workorderid: wid,
- reason: $("#reason").val(),
- newlimittime: $("#startTime").val(),
- "token": $.cookie("token")
- }, function (result) {
- result = JSON.parse(result);
- if (result.state.toLowerCase() == "success") {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.$('#orderlist').bootstrapTable('refresh');
- parent.layer.msg("申请延时成功");
- }
- })
- }
- // 时间组件
- function timeComponent(limitTime) {
- var oneDate = (new Date(limitTime)).getTime();
- oneDate = oneDate + (1 * 3600 * 24 * 1000);
- oneDate = new Date(oneDate)
- var oneYear = oneDate.getFullYear();
- var oneMonth = oneDate.getMonth();
- var oneDay = oneDate.getDate();
- var oneHour = oneDate.getHours();
- var oneMinutes = oneDate.getMinutes();
- var oneSeconds = oneDate.getSeconds();
- oneMonth = oneMonth + 1;
-
- if (oneMonth >= 1 && oneMonth <= 9) {
- oneMonth = "0" + oneMonth
- }
- if (oneDay >= 1 && oneDay <= 9) {
- oneDay = "0" + oneDay
- }
- if (oneHour >= 1 && oneHour <= 9) {
- oneHour = "0" + oneHour
- }
- if (oneMinutes >= 0 && oneMinutes <= 9) {
- oneMinutes = "0" + oneMinutes
- }
- if (oneSeconds >= 0 && oneSeconds <= 9) {
- oneSeconds = "0" + oneSeconds
- }
- var oneDaysTime = oneYear + "-" + oneMonth + "-" + oneDay + " " + oneHour + ":" + oneMinutes + ":" + oneSeconds
- console.log(oneDaysTime)
- var date = (new Date(limitTime)).getTime();
- date = date + (3 * 3600 * 24 * 1000);
- date = new Date(date)
- var year = date.getFullYear();
- var month = date.getMonth();
- var day = date.getDate();
- var hour = date.getHours();
- var minutes = date.getMinutes();
- var seconds = date.getSeconds();
- month = month + 1;
- if (month >= 1 && month <= 9) {
- month = "0" + month
- }
- if (day >= 1 && day <= 9) {
- day = "0" + day
- }
- if (hour >= 1 && hour <= 9) {
- hour = "0" + hour
- }
- if (minutes >= 0 && minutes <= 9) {
- minutes = "0" + minutes
- }
- if (seconds >= 0 && seconds <= 9) {
- seconds = "0" + seconds
- }
- var threeDaysTime = year + "-" + month + "-" + day + " " + hour + ":" + minutes + ":" + seconds
- console.log("threeDaysTime", threeDaysTime)
- laydate.skin('blue');
- laydate({
- elem: '#startTime',
- event: 'focus',
- min: oneDaysTime,
- max: threeDaysTime,
- });
- }
- // 获取详情
- function getDetail() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "WorkOrder/GetWorkOrder",
- async: true,
- dataType: 'json',
- data: {
- token: $.cookie("token"),
- workorderid: wid,
- },
- success: function (data) {
- if (data.state.toLowerCase() == "success") {
- var data = data.data.data[0]
- var limitTime = data.F_LimitTime
- console.log("limitTime", limitTime)
- timeComponent(limitTime)
- }
- }
- });
- }
- </script>
- </body>
- </html>
|