懒羊羊
2023-11-14 abb175b29054b9708af27136c035b1b7351dcd20
guns-vip-main/src/main/webapp/assets/modular/pm/salesOrder/salesOrder.js
@@ -99,10 +99,25 @@
    $('#split').click(function (){
        var checkRows = table.checkStatus(SalesOrder.tableId);
        console.log(checkRows.data);
        console.log(checkRows);
        console.log(checkRows.data.state);
        if (checkRows.data.length !== 1) {
            Feng.error("请选择一条要拆分的订单");
            return;
        }
        window.location.href = Feng.ctxPath + '/salesOrder/split?id=' + checkRows.data[0].id
        if (checkRows.data[0].state === "1") {
            window.location.href = Feng.ctxPath + '/salesOrder/split?id=' + checkRows.data[0].id
        }else {
            Feng.error("已拆分下发订单禁止重复拆分");
            return;
        }
        // if (checkRows.data.state !== "1") {
        //     Feng.error("已拆分下发订单禁止重复拆分");
        //     return;
        // }
        // window.location.href = Feng.ctxPath + '/salesOrder/split?id=' + checkRows.data[0].id
    });
@@ -193,9 +208,13 @@
    // 绑定下发
    $('#distribute').click(function () {
        var checkRows = table.checkStatus(SalesOrder.tableId);
        if(checkRows.data[0].state === "3"){
            Feng.error("该工单已下发完毕!");
            return;
        console.log(checkRows);
        console.log("checkRows.length=========="+checkRows.data.length)
        if(checkRows.data.length === 1){
            if(checkRows.data[0].state === "3"){
                Feng.error("该工单已下发完毕!");
                return;
            }
        }
        if (checkRows.data.length !== 1) {
            Feng.error("请选择一条要下发的订单");
@@ -204,25 +223,6 @@
        var checkRows = table.checkStatus(SalesOrder.tableId);
        console.log(checkRows.data);
        window.location.href = Feng.ctxPath + '/salesOrder/bindParam?id=' + checkRows.data[0].id
        // layer.open({
        //     type: 2,
        //     area: ['1000px', '600px'],
        //     title: '下发订单',
        //     content:  Feng.ctxPath + '/salesOrder/bindParam',
        //     success: function (layero, index) {
        //         // let body = layer.getChildFrame('body', index);
        //         // body.find('form').find('#salesOrderList').val(checkRows.data);
        //         // 获取子页面的iframe
        //         var iframe = window['layui-layer-iframe'+index];
        //         // 向子页面的全局函数child传参
        //         iframe.child(checkRows.data);
        //     },
        //     end: function () {
        //         table.reload(SalesOrder.tableId, {
        //             where: null, page: {curr: 1}
        //         });
        //     }
        // });
    });
    // 工具条点击事件