1
duhe
2023-12-27 647a874bed1dc715370dc0edc59c3a6c4a0b0d9d
WebTM/views/ÑéÊÕÈë¿â/ίÍâÈë¿â/Kf_EntrustInBill_FastList.html
@@ -120,7 +120,8 @@
        , layer = layui.layer
        , table = layui.table
        , form = layui.form
        , element = layui.element;
            , element = layui.element;
        var option = {};
        //清空界面  new
        var sBillType = '1210'
        //动态加载源单类型列表 new
@@ -132,8 +133,10 @@
        //退出
        form.on('submit(Cancel)', function () {
            parent.location.href = "../../../views/index.html"
        form.on('submit(cmdCancel)', function () {
            layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                parent.location.href = "../../../views/index_Mobile.html"
            });
            //window.close();//关闭当前页
        })
        //编辑
@@ -158,27 +161,7 @@
        });
         //刷新
        form.on('submit(cmdRefresh)', function () {//
            table.render({
                elem: '#dj-table'
                , url: GetWEBURL() + '/Web/chanpinruk'
                , toolbar: '#toolbarDemo'
                , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HInterID', title: '单据内码', width: 120 }
                    , { field: 'HBillNo', title: '单据号', width: 150 }
                    , { field: 'HMaker', title: '制单人', width: 120 }
                    , { field: 'HMakeDate', title: '制单日期', width: 150 }
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    , { field: 'HRedBlueFlag', title: '红蓝字', width: 120 }
                    , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            }),
            table.render(option);
                table.render({
                    elem: '#yd-table'
                    , url: GetWEBURL() + '/Web/DisBillUpdateLoad_Json'
@@ -320,29 +303,109 @@
        
        table.render({
            elem: '#dj-table'
            , url: GetWEBURL() + '/Web/chanpinruk'
            , toolbar: '#toolbarDemo'
            , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
            , cols: [[
                { type: 'radio' }
                , { field: 'HInterID', title: '单据内码', width: 120 }
                , { field: 'HBillNo', title: '单据号', width: 150 }
                , { field: 'HMaker', title: '制单人', width: 120 }
                , { field: 'HMakeDate', title: '制单日期', width: 150 }
                , { field: 'HQty', title: '数量', width: 100 }
                , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                , { field: 'HRedBlueFlag', title: '红蓝字', width: 120 }
                , { field: 'HSourceBillType', title: '源单类型', width: 100 }
            ]]
            , height: 500
            , done: function () {
                layer.closeAll("loading");
        //table.render({
        //    elem: '#dj-table'
        //    , url: GetWEBURL() + '/Web/chanpinruk'
        //    , toolbar: '#toolbarDemo'
        //    , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
        //    , cols: [[
        //        { type: 'radio' }
        //        , { field: 'HInterID', title: '单据内码', width: 120 }
        //        , { field: 'HBillNo', title: '单据号', width: 150 }
        //        , { field: 'HMaker', title: '制单人', width: 120 }
        //        , { field: 'HMakeDate', title: '制单日期', width: 150 }
        //        , { field: 'HQty', title: '数量', width: 100 }
        //        , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
        //        , { field: 'HRedBlueFlag', title: '红蓝字', width: 120 }
        //        , { field: 'HSourceBillType', title: '源单类型', width: 100 }
        //    ]]
        //    , height: 500
        //    , done: function () {
        //        layer.closeAll("loading");
        //    }
        //})
        //动态列
        $.ajax({
            url: GetWEBURL() + "/Web/chanpinruk1",
            type: "GET",
            async: false,
            data: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] },
            //async: false,
            success: function (data1) {
                if (data1.count == 1) {
                    var data = [];
                    var col = [];
                    //给空的数组赋值
                    for (var key in data1.list) {
                        data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                    }
                    //在列表左边添加勾选框
                    col.push({ type: 'radio', fixed: 'left' });
                    for (var i = 0; i < data.length; i++) {
                        if ($.inArray(data[i].name, "") > -1) {
                            col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                        }
                        else {
                            switch (data[i].Type) {
                                //int
                                case 'DateTime':
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 200 });
                                    break;
                                default:
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                            }
                        }
                    }
                    option = {
                        elem: '#dj-table'
                        , toolbar: '#toolbarDemo'
                        , height: 500
                        , page: true //开启分页
                        , limit: 50
                        , limits: [50, 500, 5000, 20000]
                        , cols: [col]
                        , data: data1.data
                    };
                    table.render(option);
                } else {
                    option = {
                        elem: '#dj-table'
                        , toolbar: '#toolbarDemo'
                        , height: 500
                        , page: true //开启分页
                        , limit: 50
                        , limits: [50, 500, 5000, 20000]
                        , cols: [[
                            { type: 'radio' }
                            , { field: 'HMakeDate', title: '制单日期', width: 150 }
                            , { field: 'HBillNo', title: '单据号', width: 150 }
                            , { field: 'HMaterName', title: '物料名称', width: 150 }
                            , { field: 'HQty', title: '数量', width: 100 }
                        ]]
                        , data: []
                    };
                    table.render(option);
                }
            },
            error: function (err) {
                layer.msg('错误' + err, {
                    icon: 5,
                    time: 20000
                }, function () {
                    //do something
                });
            }
        })
        //已上传列表
        table.render({
            elem: '#yd-table'