PalletInOut.js 27.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676
layui.config({
    base: "/js/"
}).use(['form', 'element', 'vue', 'layer', 'laydate', 'jquery','hhweb', 'table', 'utils', 'Universal'], function () {
    var form = layui.form,
        layer = layui.layer,
        element = layui.element,
        laydate = layui.laydate,
        $ = layui.jquery,
        table = layui.table,
        Universal = layui.Universal;

    var AreaName = 'task';
    var TableName = 'TaskDetail';

    var vm = new Vue({
        el: '#PalletForm'
    });

    var taskDel = new Vue({
        data: {}
    });

    var vmq = new Vue({
        data: {
            ContainerCode: 'ContainerCode',
            TaskNo: 'TaskNo'
        }
    });

    var mainList = {
        //NoData: function () {
        //    return "<div id='background' style='width:100%;height:100%;background-image:url(../../images/NoData.png);background-repeat:no-repeat;background-size:cover;'>.</div>"
        //},
        mainList: function (vm) {
            table.reload('mainList', {
                url: "/" + AreaName + "/" + TableName + "/FindTaskDel"
                , where: vm.$data
                , method: "post"
                , text: { none: "暂无数据,请扫码容器编号!" }
               // , text: { none: this.NoData() }
            });
        }
    };

    var selector = {
        'TaskType': {
            SelType: "FromDict",
            SelFrom: "taskType",
            SelModel: "TaskType",
            SelLabel: "DictLabel",
            SelValue: "DictValue",
            Dom: [$("[name='TaskType']")]
        },
        'Code': {
            SelType: "FromUrl",
            SelFrom: "/receipt/ReceiptHeader/LoadStationOne",
            SelModel: "Code",
            SelLabel: "Name",
            SelValue: "Code",
            Dom: [$("[name='Code']")]
        },
        'Type': {
            SelType: "FromDict",
            SelFrom: "containerType",
            SelModel: "Type",
            SelLabel: "DictLabel",
            SelValue: "DictValue",
            Dom: [$("[name='Type']")]
        }
    };

    var vml = new Array({
        vm: vm,
        vmq: vmq
    });

    Universal.BindSelector($, form, vml, selector);
    mainList.mainList(vmq);

    //出库查看完成
    $(document).on("click", "#btnFinishCheck", function () {
        var type = $('[name = "OperationType"]')[0].value;
            if (type == "出库") {
                $.ajax({
                    async: false,
                    url: "/task/Task/FinishCheck",
                    type: "post",
                    data: { taskDel: taskDel.$data },
                    dataType: "json",
                    success: function (result) {
                        if (result.code == 200) {
                            FindFirstTask();
                            layer.msg("查看完成!", { icon: 6, shade: 0.4, time: 1000 });
                        }
                        else {
                            layer.alert("失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
                        }
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        layer.alert(errorThrown, { icon: 2, title: '提示' });
                    }
                });
            } else {
                layer.alert("失败:" + type + "类型无效", { icon: 5, shadeClose: true, title: "错误信息" });
            }
            FindFirstTask();
    });

    //收(取)料完成
    $(document).on("click", "#btnFinish", function () {
        var oderQty = eval(vm.OderQty) - eval(vm.HadQty);
        var num = eval($('[name = "Num"]')[0].value);
        if (num == 0) {
            layer.alert("失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
            return null;
        }
        taskDel.$data.HadQty = num;
        console.log(taskDel.$data);
        var type = $('[name = "OperationType"]')[0].value;
        if (oderQty >= num || type == "盘点") {
            if (type == "入库") {
                $.ajax({
                    async: false,
                    url: "/receipt/ReceiptHeader/FinishMaterial",
                    type: "post",
                    data: { taskDel: taskDel.$data},
                    dataType: "json",
                    success: function (result) {
                        if (result.code == 200) {
                            layer.msg("放料成功", { icon: 6, shade: 0.4, time: 1000 });
                        }
                        else {
                            layer.alert("失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
                        }
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        layer.alert(errorThrown, { icon: 2, title: '提示' });
                    }
                });
            } else if (type == "出库") {
                $.ajax({
                    async: false,
                    url: "/task/Task/FinishPick",
                    type: "post",
                    data: { taskDel: taskDel.$data },
                    dataType: "json",
                    success: function (result) {
                        if (result.code == 200) {
                            FindFirstTask();
                            layer.msg("拣货成功!", { icon: 6, shade: 0.4, time: 1000 });
                        }
                        else {
                            layer.alert("失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
                        }
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        layer.alert(errorThrown, { icon: 2, title: '提示' });
                    }
                });
            } else if (type == "盘点") {
                $.ajax({
                    async: false,
                    url: "/inventory/CyclecountDetail/FinshCyclecount",
                    type: "post",
                    data: { del: taskDel.$data },
                    dataType: "json",
                    success: function (result) {
                        if (result.code == 200) {
                            FindFirstTask();
                            layer.alert("盘点成功!数量:" + num, { icon: 6, shade: 0.4});
                        }
                        else {
                            layer.alert("失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
                        }
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        layer.alert(errorThrown, { icon: 2, title: '提示' });
                    }
                });
            }else {
                layer.alert("失败:" + type + "类型无效", { icon: 5, shadeClose: true, title: "错误信息" });
            }
            FindFirstTask();
        } else {
            layer.alert("失败:完成数量不能大于库存数量", { icon: 5, shadeClose: true, title: "错误信息" });
        }
    });

    //托盘回库
    $(document).on("click", "#btnBack", function () {
        if ($('[name = "ContainerId"]')[0].value != "") {
            $.ajax({
                async: false,
                url: "/" + "task" + "/" + "Task" + "/BulidContainerBack",
                type: "post",
                data: { containerCode: $('[name = "ContainerId"]')[0].value, IsFull: $('[name = "IsFull"]:checked')[0].value },
                dataType: "json",
                success: function (result) {
                    if (result.code == 200) {
                        layer.msg("回库成功", { icon: 6, shade: 0.4, time: 1000 });
                        $('[name = "ContainerId"]').val("");
                        $('[name = "ContainerId"]').focus();
                        $('#radioSome').prop("checked", "checked");
                        form.render();
                    }
                    else {
                        layer.alert("失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    layer.alert(errorThrown, { icon: 2, title: '提示' });
                }
            });
            FindFirstTask();
        } else {
            layer.alert("请填写托盘号", { icon: 5, shadeClose: true, title: "错误信息" });
        }
    });

    //手动回库
    $(document).on("click", "#btnHandTaskIn", function () {
        if ($('[name = "ContainerId"]')[0].value == "") {
            layer.alert("请填写容器编号", { icon: 5, shadeClose: true, title: "错误信息" });
            return;
        }
        if ($('[name = "Code"]')[0].value == "") {
            layer.alert("请选择站台", { icon: 5, shadeClose: true, title: "错误信息" });
            return;
        }
            $.ajax({
                async: false,
                url: "/" + "task" + "/" + "Task" + "/HandTaskIn",
                type: "post",
                data: {containerCode: $('[name = "ContainerId"]')[0].value, station: $('[name = "Code"]')[0].value},
                dataType: "json",
                success: function (result) {
                    if (result.code == 200) {
                        layer.msg("入库成功", { icon: 6, shade: 0.4, time: 1000 });
                        $('[name = "ContainerId"]').val("");
                        $('[name = "ContainerId"]').focus();
                        form.render();
                    }
                    else {
                        layer.alert("失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    layer.alert(errorThrown, { icon: 2, title: '提示' });
                }
            });
            FindFirstTask();
        
    });

    //手动添加物料
    $(document).on("click", "#btnAddInventory", function () {
        if ($('[name = "ContainerId"]')[0].value == "") {
            layer.alert("请填写容器编号", { icon: 5, shadeClose: true, title: "错误信息" });
            return;
        }
        if ($('[name = "Code"]')[0].value == "") {
            layer.alert("请选择站台", { icon: 5, shadeClose: true, title: "错误信息" });
            return;
        }
        if ($('[name = "MaterialCode"]')[0].value == "") {
            layer.alert("请填写物料编码", { icon: 5, shadeClose: true, title: "错误信息" });
            return;
        }
        if ($('[name = "Num"]')[0].value == "") {
            layer.alert("请填写数量", { icon: 5, shadeClose: true, title: "错误信息" });
            return;
        }
            $.ajax({
                async: false,
                url: "/" + "task" + "/" + "Task" + "/AddInventory",
                type: "post",
                data: {
                    station: $('[name = "Code"]')[0].value, containerCode: $('[name = "ContainerId"]')[0].value, material: $('[name = "MaterialCode"]')[0].value,
                    num: $('[name = "Num"]')[0].value, sourceCode: $('[name = "SourceCode"]')[0].value, batch: $('[name = "Batch"]')[0].value
                },
                dataType: "json",
                success: function (result) {
                    if (result.code == 200) {
                        layer.msg("入库成功", { icon: 6, shade: 0.4, time: 1000 });
                        $('[name = "Batch"]').val("");
                        $('[name = "Num"]').val("");
                        $('[name = "MaterialCode"]').val("");
                        $('[name = "SourceCode"]').val("");
                        $('[name = "ContainerId"]').val("");
                        $('[name = "ContainerId"]').focus();
                    }
                    else {
                        layer.alert("失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    layer.alert(errorThrown, { icon: 2, title: '提示' });
                }
            });
            FindFirstTask();
        
    });

    //站台到站台
    $(document).on("click", "#btnStation", function () {
        if ($('[name = "ContainerId"]')[0].value == "") {
            layer.alert("请填写容器编号", { icon: 5, shadeClose: true, title: "错误信息" });
            return;
        }
        var list;
        $.ajax({
            async: true,
            type: "post",
            url: "/receipt/ReceiptHeader/LoadStation",
            dataType: "json",
            success: function (data) {
                list = data.data;
                CreateSelect(1,list)
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.alert(errorThrown, { icon: 2, title: '提示' });
            }
        });
        layer.open({
            type: 1,
            //  skin: 'layui-layer-molv',
            btnAlign: 'c',
            moveType: 1, //拖拽模式,0或者1
            title: "选择起点和终点站台", //不显示标题
            area: ['700px', '400px'], //宽高
            content: $('#tanchuang'), //捕获的元素
            scrollbar: true,
            btn: ['下发', '关闭'],
            yes: function (index, layero) {
                if ($("#OriginStation").val() == "") {
                    layer.alert("请选择起始站台", { icon: 5, shadeClose: true, title: "错误信息" });
                    return;
                }
                if ($("#EndStation").val() == "") {
                    layer.alert("请选择终点站台", { icon: 5, shadeClose: true, title: "错误信息" });
                    return;
                }
                $.ajax({
                    async: false,
                    url: "/" + "task" + "/" + "Task" + "/StationToStation",
                    type: "post",
                    data: {
                        containerCode: $('[name = "ContainerId"]').val(),
                        startStation: $("#OriginStation").val(),
                        endStation: $("#EndStation").val(),
                    },
                    dataType: "json",
                    success: function (result) {
                        if (result.Code == 200) {
                            layer.msg("入库成功", { icon: 6, shade: 0.4, time: 1000 });
                            layer.close(index);
                        }
                        else {
                            layer.alert("失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
                        }
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        layer.alert(errorThrown, { icon: 2, title: '提示' });
                    }
                });
            },
            cancel: function (index) {
                layer.close(index);
            }
        });
            FindFirstTask();
      
    });

    //空板回库
    $(document).on("click", "#btnEmptyBack", function () {
        if ($('[name = "ContainerId"]')[0].value == "") {
            layer.alert("请填写容器编号", { icon: 5, shadeClose: true, title: "错误信息" });
            return;
        }
        if ($('[name = "Code"]')[0].value == "") {
            layer.alert("站台", { icon: 5, shadeClose: true, title: "错误信息" });
            return;
        }
            layer.open({
                title: '空板回库',
                area: ["400px", "350px"],
                type: 1,
                content: $('#PalletEmptyIn'),
                btn: ['提交', '关闭'],
                yes: function (index) {
                    if ($('[name = "Type"]').val() != '') {
                        layer.close(index);
                        $.ajax({
                            async: false,
                            url: "/" + "task" + "/" + "Task" + "/BulidEmptyContainerBack",
                            type: "post",
                            data: { station: $('[name = "Code"]')[0].value, containerCode: $('[name = "ContainerId"]')[0].value, type: $('[name = "Type"]').val() },
                            dataType: "json",
                            success: function (result) {
                                if (result.Code == 200) {
                                    layer.msg("空托回库成功", { icon: 6, shade: 0.4, time: 1000 });
                                    $('[name = "ContainerId"]').val("");
                                    $('[name = "ContainerId"]').focus();
                                }
                                else {
                                    layer.alert("失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
                                }
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                                layer.alert(errorThrown, { icon: 2, title: '提示' });
                            }
                        })
                    } else {
                        layer.alert("请选择托盘类型", { icon: 5, shadeClose: true, title: "错误信息" });
                    }
                    
                    mainList.mainList();
                },
                btn2: function (index) {
                    layer.close(index);
                    mainList.mainList();
                }
            });

            
            vmq.$set('ContainerCode', 'ContainerCode');
            vmq.$set('TaskNo', 'TaskNo');
            mainList.mainList(vmq);
            vm.$set('$data','');
            taskDel.$set('$data', '');
            $('[name = "Num"]').val("");
            $('[name = "OperationType"]').val("");
      
    });

    //打开页面聚焦“容器管理”
    $(document).ready(function () {
        $('[name = "ContainerId"]').focus();
    });

    //单击行监听
    table.on('row(mainList)', function (obj) {
        //行变为点击状态
        $(obj.tr[0]).siblings().removeClass('layui-table-click');
        $(obj.tr[0]).addClass('layui-table-click');
        //赋值
        vm.$set('$data', obj.data);
        taskDel.$set('$data', obj.data);
        FindTaskType(obj.data);
        //改变焦点
        $('[name = "Num"]').focus();
    });

    //“容器编号”回车监听
    $('[name = "ContainerId"]').bind("keydown", function (e) {
        if (e.which == 13) {
            e.preventDefault(); //Skip default behavior of the enter key
            if ($(this).val() != "") {
                FindFirstTask();
                var str = $(this).val();
                var strs = str.split('%');
                //改变焦点
                $('[name = "Num"]').val(strs[3]);
                $('[name = "MaterialCode"]').val(strs[0]);
                $('[name = "SourceCode"]').val(strs[1]);
                $('[name = "Batch"]').val(strs[2]);
            }
            else {
                $(this).focus();
            }
        }
    });

    //“数量”回车监听
    $('[name = "Num"]').bind("keydown", function (e) {
        if (e.which == 13 && $('[name = "Num"]')[0].value != "") {
            e.preventDefault(); //Skip default behavior of the enter key
            if ($('[name = "TaskType"]').val() == "出库查看") {
                $('#btnFinishCheck').click();
            } else {
                $('#btnFinish').click();
            }
            //改变焦点
            $('[name = "Num"]').focus();
        }
    });

    //出入库翻译
    function FindTaskType(data) {
        $.ajax({
            async: false,
            type: "post",
            data: { DictType:'taskType'},
            url: '/base/SysDictData/FindSysDictData',
            dataType: "json",
            success: function (result) {
                for (var i = 0; i < result.data.length;i++) {
                    if (result.data[i].DictValue == data.TaskType) {
                        vm.$set('TaskType', result.data[i].DictLabel);
                        $('[name = "TaskType"]').val(result.data[i].DictLabel);

                        //填写业务类型
                        if (result.data[i].DictLabel.split("入库").length > 1) {
                            $('[name = "OperationType"]').css('color', 'forestgreen');
                            $('[name = "TaskType"]').css('color', 'forestgreen');
                            $('[name = "OperationType"]').val("入库");
                        } else if (result.data[i].DictLabel.split("出库").length > 1) {
                            $('[name = "OperationType"]').css('color', 'blue');
                            $('[name = "TaskType"]').css('color', 'blue');
                            $('[name = "OperationType"]').val("出库");
                        } else {
                            $('[name = "OperationType"]').val(result.data[i].DictLabel);
                        }
                        

                        if ($('[name = "TaskType"]').val() == "出库查看") {
                            $('[name = "Num"]').val(eval(data.OderQty));

                        } else {
                            if (result.data[i].DictLabel.split("入库").length > 1) {
                                //导入数量
                                $('[name = "Num"]').val(eval(data.OderQty) - eval(data.HadQty));
                            } else if (result.data[i].DictLabel.split("出库").length > 1) {
                                //导入数量
                                $('[name = "Num"]').val(eval(data.ContainerQty) - eval(data.HadQty));
                            } else {
                                $('[name = "Num"]').val(data.ContainerQty);
                            }
                        }

                        break;
                    }
                }
                if ($('[name = "TaskType"]').val() == "出库查看") {
                    $('.btn2').hide();
                    $('#btn1').show();
                    $('[name = "Num"]').attr({ readonly: "readonly" });
                    $('#btnFinishCheck').focus();

                } else if ($('[name = "TaskType"]').val() == "盘点") {
                    $('#btn1').hide();
                    $('.btn2').show();
                    $('#btnFinish').text("盘点完成");
                }
                else {
                    $('#btnFinish').text("取(收)料完成");
                        $('#btn1').hide();
                        $('.btn2').show();
                }
                //    if ($('[name = "TaskType"]').val() == "整盘出库" || $('[name = "TaskType"]').val() == "分拣出库") {
                //    $('#btn1').hide();
                //    $('#btn2').show();
                //}
            }
        });
    }
    //顶部单选按钮监听
    $(".c1").change(function () {
        var b = $('[name = "IsShou"]:checked').val();
        if (b == "SD") {
            $(".btn3").show();
            $(".btn2").hide();
            $(".YEWU").hide();
            $('input[name="MaterialCode"]').css("background-color", "white")
            $('input[name="SourceCode"]').css("background-color", "white")
            $('input[name="MaterialName"]').css("background-color", "white")
            $('input[name="Batch"]').css("background-color", "white")
            $('input[name="Num"]').css("background-color", "white")
        }
        if (b == "ZC") {
            $(".btn2").show();
            $(".btn3").hide();
            $(".YEWU").show();
            $('input[name="MaterialCode"]').css("background-color", "#eee")
            $('input[name="SourceCode"]').css("background-color", "#eee")
            $('input[name="MaterialName"]').css("background-color", "#eee")
            $('input[name="Batch"]').css("background-color", "#eee")
            $('input[name="Num"]').css("background-color", "#eee")
        }
    })

    //起始站台下拉列表监听
    $("#OriginStation").change(function () {
        var a = $("#OriginStation").val();
        $.ajax({
            async: false,
            url: "/receipt/ReceiptHeader/StartStationEnd",
            type: "post",
            data: { StartStation:a},
            dataType: "json",
            success: function (result) {
                if (result.code == 200) {
                    var a = result.data;
                    if (a == "") {
                        $("#EndStation").empty();
                        var html;
                        html += "<option class='select_Station' value=''>没有对应站台</option>";
                        $("#EndStation").append(html);
                    } else {
                        CreateSelect(2, a);
                    }
                }
                else {
                    layer.alert("终点站台请求失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.alert(errorThrown, { icon: 2, title: '提示' });
            }
        });
    });

    //查询容器的第一个任务
    function FindFirstTask() {
        $.ajax({
            async:false,
            url: "/" + "task" + "/" + "Task" + "/FindSourceCode",
            type: "post",
            data: { Code: $('[name = "ContainerId"]')[0].value },
            dataType: "json",
            success: function (result) {
                if (result.code == 200) {
                    vmq.$set('ContainerCode', result.data.ContainerCode);
                    vmq.$set('TaskNo', result.data.TaskNo);
                    mainList.mainList(vmq);
                    vm.$set('$data', result.data);
                    taskDel.$set('$data', result.data);
                    FindTaskType(result.data);
                    
                }
                else if (result.code == 0) {
                    vmq.$set('ContainerCode', 'ContainerCode');
                    vmq.$set('TaskNo', 'TaskNo');
                    mainList.mainList(vmq);
                    vm.$set('$data', result.data);
                    taskDel.$set('$data', result.data);
                    $('[name = "Num"]').val("");
                    $('[name = "OperationType"]').val("");
                }
                else {
                    layer.alert("失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.alert(errorThrown, { icon: 2, title: '提示' });
            }
        });
    }

    //请求站台数据动态创建下拉框
    function CreateSelect(type, data) {
        
        
        var a = data
        var html ;
        if (type == 1) {
            html = "<option value=''>请选择</option>";
            $("#OriginStation").empty();
            for (var i = 0; i < a.length; i++) {
                html += "<option class='select_Station' value='" + a[i].Code + "'>" + a[i].Name + "</option>";
            }
            $("#OriginStation").append(html);
        }
        if (type == 2) {
            $("#EndStation").empty();
            for (var i = 0; i < a.length; i++) {
                    html += "<option class='select_Station' value='" + a[i].Code + "'>" + a[i].Name + "</option>";
               
            }
           $("#EndStation").append(html);
        }
        
                
    }
});