zzr99
2021-09-22 b111e7d9bcbf2b90bce70b100583e27b4b0f4584
Merge branch 'master' of http://101.37.171.70:10101/r/MESWMS-LayUI
1个文件已添加
14个文件已修改
1个文件已删除
3805 ■■■■ 已修改文件
WebTM/Properties/PublishProfiles/JFTM.pubxml.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/WebTM.csproj 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/layuiadmin/Scripts/webConfig.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/index.html 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/基础资料/公用基础资料/test.html 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具仓库管理/Sc_Add_MouldProdBackBillList.html 144 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具仓库管理/Sc_Add_MouldProdOutBillList.html 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具仓库管理/Sc_MouldMoveStockStepInBill.html 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具仓库管理/Sc_MouldMoveStockStepInBillList.html 739 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具仓库管理/Sc_MouldMoveStockStepOutBill.html 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具仓库管理/Sc_MouldProdBackBillList.html 95 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具仓库管理/Sc_MouldProdMoveBill.html 976 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具仓库管理/Sc_MouldProdMoveBillList.html 731 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具管理/Sc_MouldOtherInBill.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具管理/Sc_MouldOtherInBillList.html 729 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/工序流转卡/Sc_ProcessExchangeBillList.html 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -1701,7 +1701,7 @@
      <publishTime>09/16/2021 18:21:09</publishTime>
    </File>
    <File Include="views/模治具管理/模治具仓库管理/Sc_MouldProdMoveBillList.html">
      <publishTime>09/16/2021 16:04:24</publishTime>
      <publishTime>09/16/2021 14:06:07</publishTime>
    </File>
    <File Include="views/模治具管理/模治具仓库管理/Sc_MouldProdOutBillList.html">
      <publishTime>09/15/2021 11:18:56</publishTime>
WebTM/WebTM.csproj
@@ -527,7 +527,6 @@
    <Content Include="views\基础资料\生产基础资料\Add_Edit_Gy_Process.html" />
    <Content Include="views\基础资料\采购基础资料\Gy_Supplier_Edit.html" />
    <Content Include="views\基础资料\销售基础资料\Gy_Customer_Edit.html" />
    <Content Include="views\基础资料\公用基础资料\test.html" />
    <Content Include="views\基础资料\公用基础资料\Xt_ORGANIZATIONSList.html" />
    <Content Include="views\基础资料\公用基础资料\Gy_PropertyList.html" />
    <Content Include="views\基础资料\公用基础资料\Gy_Material.html" />
@@ -568,6 +567,7 @@
    <Content Include="views\模治具管理\模治具仓库管理\Sc_Add_MouldMoveStockStepOutBill.html" />
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldProdInBillEdit.html" />
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldProdInBillList.html" />
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldProdMoveBill.html" />
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldRepairInBillEdit.html" />
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldRepairOutBillList.html" />
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldRepairInBillList.html" />
WebTM/layuiadmin/Scripts/webConfig.js
@@ -2,14 +2,15 @@
function GetWEBURL() {
    //var WEBURL = "http://192.168.16.80:8011/";          //办公室服务器
    //var WEBURL = "http://localhost:8081/SWEAPI/";       //ch本地
    //var WEBURL = "http://localhost:8085/API/";   //zgq本地
    var WEBURL = "http://localhost:8085/API/";   //zgq本地
    //var WEBURL = "http://localhost:8080/API/";   //颜晓军本地配置
    //var WEBURL = "http://localhost:8082/lubao";   //颜晓军本地配置
    //var WEBURL = "http://localhost:8082/LuBaoAPI/";    //杨露本地配置
    var WEBURL = "http://localhost:8082/LuBaoAPI/";    //章紫柔本地配置
    //var WEBURL = "http://localhost:8082/LuBaoAPI/";    //章紫柔本地配置
    //var WEBURL = "http://10.1.4.155/API/";   //江丰客户NEW
    //var WEBURL = "http://47.96.97.237/API/";   //智云服务器
    //var WEBURL = "http://183.129.128.86:9090/API/";   //凯贝奈特客户服务器
    //var WEBURL = "http://183.129.128.86:9090/API/";   //凯贝奈特客户服务器外网
    //var WEBURL = "http://192.168.1.253:8080/API/";   //凯贝奈特客户服务器内网
    //var WEBURL = "http://localhost/API/";
    return WEBURL
}
WebTM/views/index.html
@@ -274,12 +274,12 @@
                                </dd>
                                <dd><a lay-href="计划管理/工艺路线/Gy_RoutingBillList.html">工艺路线维护</a></dd>
                                <!--<dd>
                                    <a>工艺路线</a>
                                    <dl class="layui-nav-child">
                                        <dd><a lay-href="计划管理/工艺路线/Gy_RoutingBill.html">工艺路线</a></dd>
                                        <dd><a lay-href="计划管理/工艺路线/Gy_RoutingBillList.html">工艺路线维护</a></dd>
                                    </dl>
                                </dd>-->
                <a>工艺路线</a>
                <dl class="layui-nav-child">
                    <dd><a lay-href="计划管理/工艺路线/Gy_RoutingBill.html">工艺路线</a></dd>
                    <dd><a lay-href="计划管理/工艺路线/Gy_RoutingBillList.html">工艺路线维护</a></dd>
                </dl>
            </dd>-->
                            </dl>
                        </li>
                        <!-- ç”Ÿäº§ç®¡ç† -->
WebTM/views/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/test.html
File was deleted
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_Add_MouldProdBackBillList.html
@@ -62,15 +62,15 @@
                                                </div>
                                            </div>
                                            <!--<div class="layui-inline">
                                                <label class="layui-form-label">仓库</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" readonly name="HWhName" id="HWhName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HWhID" id="HWhID" class="layui-input" value="" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HWhList" id="HWhList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>-->
        <label class="layui-form-label">仓库</label>
        <div class="layui-input-inline">
            <input type="text" readonly name="HWhName" id="HWhName" class="layui-input" value="" style="float:left;width:150px;">
            <input type="hidden" name="HWhID" id="HWhID" class="layui-input" value="" style="float:left;width:150px;">
            <button type="button" lay-submit="" class="layui-btn" lay-filter="HWhList" id="HWhList" style="width:40px;">
                <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
            </button>
        </div>
    </div>-->
                                            <div class="layui-inline">
                                                <label class="layui-form-label">仓库</label>
                                                <div class="layui-input-inline">
@@ -81,8 +81,6 @@
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">验收员</label>
                                                <div class="layui-input-inline">
@@ -103,6 +101,10 @@
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">部门</label>
                                                <div class="layui-input-inline">
@@ -122,15 +124,14 @@
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">选单号</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="XDH" id="XDH" class="layui-input" value="0" style="float:left;width:150px;">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">摘要</label>
                                                <div class="layui-input-inline">
@@ -189,6 +190,15 @@
        var params = getUrlVars();
        if (typeof (params[params[0]]) == "undefined") {
            var OperationType = 1;//操作类型
            var closeType = 2;  //关闭类型
        } else {
            var OperationType = params[params[0]];//操作类型
            var linterid = params[params[1]];//源单id
            var HSouceBillType = params[params[2]];//源单类型
            var closeType = params[params[3]];  //关闭类型
        }
        var hID = params[params[0]];//编辑查看
@@ -225,45 +235,34 @@
                , page: true //开启分页
                , cols: [[ //表头
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe" ,width: 100}
                    , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true}
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 100 }
                    , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true }
                    , { field: 'HMaterCode', title: '模具代码', edit: 'text', event: 'HMaterCode', width: 100 }
                    , { field: 'HMaterName', title: '模具名称', edit: 'text', width: 100}
                    , { field: 'HMaterSpec', title: '规格型号', edit: 'text', width: 100}
                    , { field: 'HSecUnitID', title: 'HSecUnitID', edit: 'text', width: 100, hide: true}
                    , { field: 'HSecUnitCode', title: '辅助计量单位代码', edit: 'text', event: 'HSecUnitCode', width: 100 }
                    , { field: 'HSecUnitName', title: '辅助计量单位名称', edit: 'text', width: 100}
                    , { field: 'HUnitID', title: 'HUnitID', edit: 'text', width: 100, hide: true}
                    , { field: 'HUnitCode', title: '计量单位代码', edit: 'text', event: 'HUnitCode', width: 100 }
                    , { field: 'HUnitName', title: '计量单位名称', edit: 'text', width: 100}
                    , { field: 'HBatchNo', title: '批次', edit: 'text', width: 100}
                    , { field: 'HDesignLife', title: '设计寿命', edit: 'text', width: 100}
                    , { field: 'HLeaveLife', title: '剩余寿命', edit: 'text', width: 100}
                    , { field: 'HMaterName', title: '模具名称', edit: 'text', width: 100 }
                    , { field: 'HMaterSpec', title: '规格型号', edit: 'text', width: 100 }
                    , { field: 'HBatchNo', title: '批次', edit: 'text', width: 100 }
                    , { field: 'HDesignLife', title: '设计寿命', edit: 'text', width: 100 }
                    , { field: 'HLeaveLife', title: '剩余寿命', edit: 'text', width: 100 }
                    , { field: 'HUseLife', title: '累积使用寿命', edit: 'text', width: 100 }
                    , { field: 'HQtyMust', title: '应收数量', edit: 'text', width: 100 }
                    , { field: 'HQty', title: '实收数量', edit: 'text', width: 100}
                    , { field: 'HPrice', title: '单价', edit: 'text', width: 100}
                    , { field: 'HMoney', title: '金额', edit: 'text', width: 100}
                    , { field: 'hwhid', title: 'hwhid', edit: 'text', width: 100, hide: true}
                    , { field: 'HWHCode', title: '收料仓库代码', edit: 'text', event: 'HWHCode', width: 100 }
                    , { field: 'HWHName', title: '收料仓库名称', edit: 'text', width: 100 }
                    , { field: 'HSPID', title: 'HSPID', edit: 'text', width: 100, hide: true}
                    , { field: 'HQtyMust', title: '应发数量', edit: 'text', width: 100 }
                    , { field: 'HQty', title: '实发数量', edit: 'text', width: 100 }
                    , { field: 'HPrice', title: '单价', edit: 'text', width: 100 }
                    , { field: 'HMoney', title: '金额', edit: 'text', width: 100 }
                    , { field: 'HWHID', title: 'HWHID', edit: 'text', width: 100, hide: true }
                    , { field: 'HWHCode', title: '发料仓库代码', edit: 'text', event: 'HWHCode', width: 100 }
                    , { field: 'HWHName', title: '发料仓库', edit: 'text', width: 100 }
                    , { field: 'HSPID', title: 'HSPID', edit: 'text', width: 100, hide: true }
                    , { field: 'HSPCode', title: '仓位代码', edit: 'text', event: 'HSPCode', width: 100 }
                    , { field: 'HSPName', title: '仓位名称', edit: 'text', width: 100 }
                    , { field: 'HNewModel', title: '模具新规格', edit: 'text', width: 100 }
                    , { field: 'HWallThickness', title: '壁厚', edit: 'text', width: 100 }
                    , { field: 'HHardness', title: '硬度', edit: 'text', width: 100 }
                    , { field: 'HLastProdModel', title: '最后生产产品', edit: 'text', width: 100 }
                    , { field: 'HDiameter', title: '直径', edit: 'text', width: 100 }
                    , { field: 'HBackFlag', title: '退库类型', edit: 'text', width: 100 }
                    , { field: 'HRemark', title: '表体备注', edit: 'text', width: 100}
                    , { field: 'HSPName', title: '仓位', edit: 'text', width: 100 }
                    , { field: 'HRemark', title: '表体备注', edit: 'text', width: 100 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ]]
                , limit: 500 //每页默认显示的数量
            };
            //判断是否新增
            if (hID == null || hID == 0) {
                //初始加载表格{ "ID": 0, "HWasterReasonName": " ","HBadReasonID":0,"HEmpName": "  ", "HSQProcName": "   ","HProcID":0, "HZRProcName": "  ", "HMRBChecker": "  ", "HRemark": "  ", "HPSProcName": "  ", "HCloseMan": "   " }
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HSecUnitID": 0, "HSecUnitCode": "", "HSecUnitName": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "hwhid": 0, "HWHCode": "", "HWHName": "", "HSPID": 0,"HSPCode":"", "HSPName": "", "HNewModel": "", "HWallThickness": "", "HHardness": "", "HLastProdModel": "", "HDiameter": "","HBackFlag":"", "HRemark": "" }];
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HRemark": "" }];
                table.render(option);
            }
            else {
@@ -299,7 +298,7 @@
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;;
                var AddRow = table.cache['mainTable'];
                var NewRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HSecUnitID": 0, "HSecUnitCode": "", "HSecUnitName": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "hwhid": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HNewModel": "", "HWallThickness": "", "HHardness": "", "HLastProdModel": "", "HDiameter": "", "HBackFlag": "", "HRemark": "" };
                var NewRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HRemark": "" };
                switch (obj.event) {
                    case 'btn-AddLine':
                        //table.cache["mainTable"].push(AddRow[rows]);
@@ -307,7 +306,7 @@
                        option.data = table.cache["mainTable"];
                        table.render(option);
                        rows++;
                        layer.msg('增加一行按钮!')
                        //layer.msg('增加一行按钮!')
                        break;
                    case 'btn-CopyLine':
                        var copydata = JSON.stringify(data);
@@ -488,13 +487,13 @@
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../PublicPage/WareHouseInformation.html', 'yes'],
                                content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                    var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//获取table的elem:"#test"
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
@@ -654,9 +653,9 @@
                                , "hwhid": data.hwhid                    //仓库ID
                                , "HWHName": data.仓库名称               //仓库名称
                                , "HSecManagerID": data.hsecmanagerid    //验收员ID
                                , "HSecManagerName": data.验收员         //验收员名称
                                , "HSecManagerName": data.领料人         //验收员名称
                                , "HKeeperID": data.hkeeperid            //保管员ID
                                , "HKeeperName": data.保管员            //保管员名称
                                , "HKeeperName": data.发料人            //保管员名称
                                , "HDeptID": data.HDeptID                 //部门ID
                                , "HDeptName": data.部门                //部门名称
                                , "HSourceBillType":""                   //源单类型
@@ -871,21 +870,23 @@
                });
            });
            form.on('submit(Exit)', function (data) {//
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
            //退出
            form.on('submit(Exit)', function (data) {
                if (closeType == 0) {
                    //关闭页签
                    parent.layui.admin.events.closeThisTabs();
                }
                if (closeType == 1) {
                    //关闭弹窗
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                } else if (closeType == 2) {
                    //关闭页签
                    parent.layui.admin.events.closeThisTabs();
                }
            });
            form.on('submit(Cancel)', function () {
                //sessionStorage["SourceFlag"] = false;
                parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
            })
            function formatDate(date) {
                var d = new Date(date),
@@ -1014,16 +1015,21 @@
            //    layer.msg("请先扫源单!", { icon: 5 });
            //    return false;
            //}
            if ($("#HDeptName").val() == '') {
                layer.msg("部门没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            if ($("#hwhid").val() == '') {
                layer.msg("请选择仓库", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HSecManager").val() == '') {
                layer.msg("验收人没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            if ($("#HSecManagerID").val() == '') {
                layer.msg("请选择验收员", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HKeeper").val() == '') {
                layer.msg("保管人没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            if ($("#HKeeperID").val() == '') {
                layer.msg("请选择保管员", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HDeptID").val() == '') {
                layer.msg("请选择部门", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            //if ($("#HWHNAME").val() == '') {
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_Add_MouldProdOutBillList.html
@@ -71,8 +71,6 @@
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">验收员</label>
                                                <div class="layui-input-inline">
@@ -93,6 +91,10 @@
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">部门</label>
                                                <div class="layui-input-inline">
@@ -112,15 +114,14 @@
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">选单号</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="XDH" id="XDH" class="layui-input" value="" style="float:left;width:150px;">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">摘要</label>
                                                <div class="layui-input-inline">
@@ -179,6 +180,15 @@
        var params = getUrlVars();
        if (typeof (params[params[0]]) == "undefined") {
            var OperationType = 1;//操作类型
            var closeType = 2;  //关闭类型
        } else {
            var OperationType = params[params[0]];//操作类型
            var linterid = params[params[1]];//源单id
            var HSouceBillType = params[params[2]];//源单类型
            var closeType = params[params[3]];  //关闭类型
        }
        var hID = params[params[0]];//编辑查看
@@ -234,7 +244,8 @@
                    , { field: 'HSPID', title: 'HSPID', edit: 'text', width: 100, hide: true}
                    , { field: 'HSPCode', title: '仓位代码', edit: 'text', event: 'HSPCode', width: 100 }
                    , { field: 'HSPName', title: '仓位', edit: 'text', width: 100 }
                    , { field: 'HRemark', title: '表体备注', edit: 'text', width: 100}
                    , { field: 'HRemark', title: '表体备注', edit: 'text', width: 100 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ]]
                , limit: 500 //每页默认显示的数量
            };
@@ -285,7 +296,7 @@
                        option.data = table.cache["mainTable"];
                        table.render(option);
                        rows++;
                        layer.msg('增加一行按钮!')
                        //layer.msg('增加一行按钮!')
                        break;
                    case 'btn-CopyLine':
                        var copydata = JSON.stringify(data);
@@ -311,16 +322,14 @@
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行么', function (index) {
                    layer.confirm('真的删除行吗?', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            //obj.del();
                            //layer.close(index);
                            var oldData = table.cache["mainTable"];
                            oldData.splice(obj.tr.data('index'), 1);
                            table.reload('mainTable', { data: oldData });
                            obj.del();
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.reload(option);
                            layer.close(index);
                        }
                    });
@@ -386,13 +395,13 @@
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../PublicPage/WareHouseInformation.html', 'yes'],
                                content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HWHID', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                    var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//获取table的elem:"#test"
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
@@ -610,13 +619,13 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/WareHouseInformation.html', 'yes'],
                    content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HWHID', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
@@ -752,21 +761,32 @@
                });
            });
            form.on('submit(Exit)', function (data) {//
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
            //退出
            form.on('submit(Exit)', function (data) {
                if (closeType == 0) {
                    //关闭页签
                    parent.layui.admin.events.closeThisTabs();
                }
                if (closeType == 1) {
                    //关闭弹窗
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                } else if (closeType == 2) {
                    //关闭页签
                    parent.layui.admin.events.closeThisTabs();
                }
            });
            form.on('submit(Cancel)', function () {
                //sessionStorage["SourceFlag"] = false;
                parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
            })
            //form.on('submit(Cancel)', function () {
            //    //sessionStorage["SourceFlag"] = false;
            //    parent.location.href = "../../../views/index.html"
            //    //window.close();//关闭当前页
            //})
            function formatDate(date) {
                var d = new Date(date),
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldMoveStockStepInBill.html
@@ -37,7 +37,7 @@
                                <li class="layui-this">基本信息</li>-->
                                <!--<li>其他信息</li>-->
                                <!--</ul>-->
                                <h1 style="text-align:center;"><b>器具分布式调入单</b></h1>
                                <h1 style="text-align:center;"><b>模具分布式调入单</b></h1>
                                <div class="layui-tab-content">
                                    <div class="layui-tab-item layui-show">
                                        <div class="layui-form-item">
@@ -71,10 +71,8 @@
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">验收员</label>
                                                <label class="layui-form-label">领料人</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HSecManagerName" id="HSecManagerName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HSecManagerID" id="HSecManagerID" class="layui-input" value="" style="float:left;width:150px;">
@@ -84,7 +82,7 @@
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">保管员</label>
                                                <label class="layui-form-label">发料人</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HKeeperName" id="HKeeperName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HKeeperID" id="HKeeperID" class="layui-input" value="" style="float:left;width:150px;">
@@ -93,6 +91,10 @@
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">部门</label>
                                                <div class="layui-input-inline">
@@ -112,15 +114,14 @@
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">选单号</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="XDH" id="XDH" class="layui-input" value="" style="float:left;width:150px;">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">摘要</label>
                                                <div class="layui-input-inline">
@@ -164,7 +165,8 @@
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script>//获取参数
    <script>
        //获取参数
        function getUrlVars() {
            var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
@@ -174,11 +176,22 @@
                vars[hash[0]] = hash[1];
            }
            return vars;
        }
        var params = getUrlVars();
        if (typeof (params[params[0]]) == "undefined") {
            var OperationType = 1;//操作类型
            var closeType = 2;  //关闭类型
        } else {
            var OperationType = params[params[0]];//操作类型
            var linterid = params[params[1]];//源单id
            var HSouceBillType = params[params[2]];//源单类型
            var closeType = params[params[3]];  //关闭类型
        }
        var hID = params[params[0]];//编辑查看
@@ -215,40 +228,41 @@
                , page: true //开启分页
                , cols: [[ //表头
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe" ,width: 100}
                    , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true}
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 100 }
                    , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true }
                    , { field: 'HMaterCode', title: '模具代码', edit: 'text', event: 'HMaterCode', width: 100 }
                    , { field: 'HMaterName', title: '模具名称', edit: 'text', width: 100}
                    , { field: 'HMaterName', title: '模具名称', edit: 'text', width: 100 }
                    , { field: 'HMaterSpec', title: '规格型号', edit: 'text', width: 100 }
                    , { field: 'HBatchNo', title: '批次', edit: 'text', width: 100 }
                    , { field: 'HDesignLife', title: '设计寿命', edit: 'text', width: 100}
                    , { field: 'HLeaveLife', title: '剩余寿命', edit: 'text', width: 100}
                    , { field: 'HBatchNo', title: '批次', edit: 'text', width: 100 }
                    , { field: 'HDesignLife', title: '设计寿命', edit: 'text', width: 100 }
                    , { field: 'HLeaveLife', title: '剩余寿命', edit: 'text', width: 100 }
                    , { field: 'HUseLife', title: '累积使用寿命', edit: 'text', width: 100 }
                    , { field: 'HQtyMust', title: '应发数量', edit: 'text', width: 100 }
                    , { field: 'HQty', title: '实发数量', edit: 'text', width: 100}
                    , { field: 'HPrice', title: '单价', edit: 'text', width: 100}
                    , { field: 'HMoney', title: '金额', edit: 'text', width: 100}
                    , { field: 'HWHID', title: 'HWHID', edit: 'text', width: 100, hide: true}
                    , { field: 'HQty', title: '实发数量', edit: 'text', width: 100 }
                    , { field: 'HPrice', title: '单价', edit: 'text', width: 100 }
                    , { field: 'HMoney', title: '金额', edit: 'text', width: 100 }
                    , { field: 'HWHID', title: 'HWHID', edit: 'text', width: 100, hide: true }
                    , { field: 'HWHCode', title: '发料仓库代码', edit: 'text', event: 'HWHCode', width: 100 }
                    , { field: 'HWHName', title: '发料仓库', edit: 'text', width: 100 }
                    , { field: 'HSPID', title: 'HSPID', edit: 'text', width: 100, hide: true}
                    , { field: 'HSPID', title: 'HSPID', edit: 'text', width: 100, hide: true }
                    , { field: 'HSPCode', title: '仓位代码', edit: 'text', event: 'HSPCode', width: 100 }
                    , { field: 'HSPName', title: '仓位', edit: 'text', width: 100 }
                    , { field: 'HRemark', title: '表体备注', edit: 'text', width: 100}
                    , { field: 'HRemark', title: '表体备注', edit: 'text', width: 100 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ]]
                , limit: 500 //每页默认显示的数量
            };
            //判断是否新增
            if (hID == null || hID == 0) {
                //初始加载表格{ "ID": 0, "HWasterReasonName": " ","HBadReasonID":0,"HEmpName": "  ", "HSQProcName": "   ","HProcID":0, "HZRProcName": "  ", "HMRBChecker": "  ", "HRemark": "  ", "HPSProcName": "  ", "HCloseMan": "   " }
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0,"HSPCode":"", "HSPName": "", "HRemark": "" }];
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HRemark": "" }];
                table.render(option);
            }
            else {
                $("#HInterID").val(hID);//修改时主表ID
                //编辑加载数据
                $.ajax({
                    url: GetWEBURL() + 'Sc_MouldProdMoveBillList/GetMouldProdMoveBillList',
                    url: GetWEBURL() + '/Sc_MouldMoveStockStepInBill/Sc_MouldMoveStockStepInBillListProjectDetai',
                    type: "GET",
                    data: { "sqlWhere": "and hmainid=" + hID },
                    success: function (result) {
@@ -285,7 +299,7 @@
                        option.data = table.cache["mainTable"];
                        table.render(option);
                        rows++;
                        layer.msg('增加一行按钮!')
                        //layer.msg('增加一行按钮!')
                        break;
                    case 'btn-CopyLine':
                        var copydata = JSON.stringify(data);
@@ -311,21 +325,19 @@
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行么', function (index) {
                    layer.confirm('真的删除行吗?', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            //obj.del();
                            //layer.close(index);
                            var oldData = table.cache["mainTable"];
                            oldData.splice(obj.tr.data('index'), 1);
                            table.reload('mainTable', { data: oldData });
                            obj.del();
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.reload(option);
                            layer.close(index);
                        }
                    });
                }
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    if (event.key == "F7") {
                        if (obj.event === 'HMaterCode')  //模具信息
@@ -374,7 +386,7 @@
                                }
                            });
                        }
                        if (obj.event === 'HWHCode')  //仓库代码
                        {
                            //页面层-自定义
@@ -386,13 +398,13 @@
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../PublicPage/WareHouseInformation.html', 'yes'],
                                content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HWHID', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                    var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//获取table的elem:"#test"
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
@@ -460,7 +472,7 @@
                        return false;
                    }
                })
                })
            });
            //监听单元格编辑
@@ -533,7 +545,7 @@
                //alert(hID);
                //查询检验方案单是否存在
                $.ajax({
                    url: GetWEBURL() + "Sc_MouldProdMoveBillList/GetMouldProdMoveBillList",
                    url: GetWEBURL() + "/Sc_MouldMoveStockStepInBill/Sc_MouldMoveStockStepInBillListCheckDetai",
                    type: "GET",
                    data: {
                        "HID": hID
@@ -541,7 +553,7 @@
                    success: function (result) {
                        if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data.h_v_Sc_MouldProdOutHouseBillList[0];
                            var data = result.data.h_v_Sc_MouldMoveStockStepInBillListDetail[0];
                            console.info(data);
                            form.val("component-form-group", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HBillNo": data.单据号
@@ -555,7 +567,7 @@
                                , "HKeeperName": data.发料人            //保管员名称
                                , "HDeptID": data.HDeptID                 //部门ID
                                , "HDeptName": data.部门                //部门名称
                                , "HSourceBillType":""                   //源单类型
                                , "HSourceBillType": ""                   //源单类型
                                , "XDH": ""                               //选单号
                                , "HExplanation": data.摘要              //摘要
                                , "HRemark": data.表头备注                    //备注
@@ -585,7 +597,7 @@
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '3802' },
                    data: { "HBillType": '3841' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HBillNo").val(d.data[0].HBillNo);
@@ -610,13 +622,13 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/WareHouseInformation.html', 'yes'],
                    content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HWHID', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
@@ -644,7 +656,7 @@
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '仓库列表',
                    title: '领料人列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
@@ -682,7 +694,7 @@
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '仓库列表',
                    title: '发料人列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
@@ -753,20 +765,33 @@
            });
            form.on('submit(Exit)', function (data) {//
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
            //退出
            form.on('submit(Exit)', function (data) {
                if (closeType == 0) {
                    //关闭页签
                    parent.layui.admin.events.closeThisTabs();
                }
                if (closeType == 1) {
                    //关闭弹窗
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                } else if (closeType == 2) {
                    //关闭页签
                    parent.layui.admin.events.closeThisTabs();
                }
            });
            form.on('submit(Cancel)', function () {
                //sessionStorage["SourceFlag"] = false;
                parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
            })
            //form.on('submit(Cancel)', function () {
            //    //sessionStorage["SourceFlag"] = false;
            //    parent.location.href = "../../../views/index.html"
            //    //window.close();//关闭当前页
            //})
            function formatDate(date) {
                var d = new Date(date),
@@ -791,7 +816,7 @@
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "/Sc_MouldProdOutBill/SaveGetMouldProdOutBillList", //方法所在页面和方法名
                        url: GetWEBURL() + "/Sc_MouldMoveStockStepInBill/SaveGetMouldMoveStockStepInBillList", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldMoveStockStepInBillList.html
@@ -2,12 +2,13 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>器具分布式调入单据维护列表</title>
    <title>器具分布式调入单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <!--<script src="../../../layuiadmin/layui/layui.js"></script>-->
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
@@ -15,10 +16,10 @@
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <style >
        .layui-form-select .layui-input {
            padding-right: 15px;
            cursor: pointer;
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
        }
    </style>
</head>
@@ -30,20 +31,15 @@
                    <form class="layui-form" action="" lay-filter="component-form-group">
                        <div class="layui-collapse">
                            <div class="layui-colla-item">
                                <div class="layui-colla-title layui-inline">
                                <!--<div class="layui-colla-title layui-inline">
                                    <div class="layui-inline">
                                        <span>更多</span>
                                    </div>
                                </div>
                                </div>-->
                                <div class="layui-inline">
                                    <label class="layui-form-label">状态</label>
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
                                        <select name="HStatus" lay-filter="HStatus" style="width:190px;">
                                            <option value="-1" selected="selected">全部</option>
                                            <option value="0">未审核</option>
                                            <option value="1">已审核</option>
                                            <option value="2">已关闭</option>
                                        </select>
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                    </div>
                                </div>
                                <div class="layui-inline">
@@ -62,19 +58,14 @@
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                </button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <div class="layui-colla-content">
                                <!--<div class="layui-colla-content">
                                    <div class="layui-inline">
                                        <div class="layui-inline">
                                            <span>其他条件></span>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">单据号</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                        </div>
                                    </div>
                                </div>
                                </div>-->
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
@@ -92,7 +83,10 @@
            </div>
        </div>
    </div>
    <!--<script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>-->
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
@@ -110,47 +104,17 @@
                , util = layui.util
            //查询条件
            var sWhere = "";
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            var option = [];
            //初始化界面
            set_ClearBill();
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //#region å¤´å·¥å…·æ äº‹ä»¶
            table.on('toolbar(mainTable)', function (obj) {
                switch (obj.event) {
                    //新增按钮
                    case 'btn-Add': set_AddNew();
                        break;
                    //编辑按钮
                    case 'btn-Edit': set_ShowBill();
                        break;
                    //删除按钮
                    case 'btn-Delete': set_DeleteBill();
                        break;
                    //审核按钮
                    case 'btn-Audit': set_CheckBill();
                        break;
                    //反审核按钮
                    case 'btn-DeAudit': set_AbandonCheck();
                        break;
                    //预览按钮
                    case 'btn-Print': get_PrintReport();
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            //#region é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                //清空过滤条件
                set_ClearQuery();
            });
            //#endregion
@@ -160,12 +124,7 @@
            });
            //#endregion
            //#region é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                //清空过滤条件
                set_ClearQuery();
            });
            //#endregion
            //#region åˆå§‹åŒ–界面
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
@@ -173,179 +132,226 @@
                get_Display(sWhere);
            }
            //#endregion
            //#region åˆ·æ–°
            function get_Refresh() {
                sWhere = "";
                get_Display(sWhere);
            }
             //#endregion
            //#region åˆå§‹åŒ–表格方法
            $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
            function set_InitGrid() {
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                 columns = [
                     { type: 'checkbox', fixed: 'left' }
                    , { field: 'hmainid', title: '单据ID', hide: true }
                    , { field: '日期', title: '日期', width: 180 }
                     , { field: '单据号', title: '单据号', width: 190 }
                     , { field: 'HDeptID', title: 'HDeptID', width: 160, hide: false }
                    , { field: '部门代码', title: '部门代码', width: 200 }
                    , { field: '部门', title: '部门', width: 200 }
                     , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 200, hide: true }
                    , { field: '验收员代码', title: '验收员代码', width: 200 }
                    , { field: '验收员', title: '验收员', width: 200 }
                     , { field: 'hkeeperid', title: 'hkeeperid', width: 200, hide: true }
                    , { field: '保管员代码', title: '保管员代码', width: 200 }
                    , { field: '保管员', title: '保管员', width: 200 }
                     , { field: 'hwhid', title: 'hwhid', width: 200, hide: true }
                    , { field: '仓库代码', title: '仓库代码', width: 200 }
                    , { field: '仓库', title: '仓库', width: 200 }
                    , { field: '摘要', title: '摘要', width: 115, hide: true }
                    , { field: '表头备注', title: '表头备注', width: 200 }
                    , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                     , { field: 'hmaterid', title: 'hmaterid', width: 200, hide: true }
                    , { field: '模具代码', title: '模具代码', width: 115 }
                    , { field: '模具名称', title: '模具名称', width: 200 }
                    , { field: '条码编号', title: '条码编号', width: 200 }
                    //, { field: '模具品类', title: '模具品类', width: 200 }
                    //, { field: '收料仓库代码', title: '收料仓库代码', width: 200 }
                    //, { field: '收料仓库', title: '收料仓库', width: 200 }
                     , { field: 'HSPID', title: '仓位代码', width: 200, hide: false }
                    //, { field: '仓位代码', title: '仓位代码', width: 200 }
                    //, { field: '仓位', title: '仓位', width: 200 }
                    , { field: '设计寿命', title: '设计寿命', width: 200 }
                    , { field: '累计使用寿命', title: '累计使用寿命', width: 200 }
                    , { field: '本次使用寿命', title: '本次使用寿命', width: 200 }
                    , { field: '剩余寿命', title: '剩余寿命', width: 200 }
                    //, { field: '最后生产产品', title: '最后生产产品', width: 200 }
                    //, { field: '退库类型', title: '退库类型', width: 200 }
                    , { field: '模具新规格', title: '模具新规格', width: 200 }
                    , { field: '表体备注', title: '表体备注', width: 200 }
                    , { field: '关联数量', title: '关联数量', width: 200 }
                    , { field: 'HBillType', title: 'HBillType', width: 200, hide: true }
                    , { field: '红蓝单标记', title: '红蓝单标记', width: 200 }
                    , { field: '制单人', title: '制单人', width: 200 }
                     , { field: '制单日期', title: '制单日期', width: 180, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>"  }
                    , { field: '审核人', title: '审核人', width: 200 }
                     , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '修改人', title: '修改人', width: 200 }
                     , { field: '修改日期', title: '修改日期', width: 180, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '关闭人', title: '关闭人', width: 200 }
                     , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '作废人', title: '作废人', width: 200 }
                     , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '源单主内码', title: '源单主内码', width: 200, hide: true }
                    , { field: '源单子内码', title: '源单子内码', width: 200, hide: true }
                    , { field: '源单单号', title: '源单单号', width: 200 }
                    , { field: '源单类型', title: '源单类型', width: 200 }
                ];
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , page: true
                    //, cellMinWidth: 120
                    , totalRow: true
                    , limit: 10
                    , height: 'full-50'
                    , cols: [columns]
                    , limits: [50, 500, 1000, 5000]
                    , done: function (res, curr, count) {
                    }
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: '单据ID', hide: true }
                        , { field: '日期', title: '日期', width: 125, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号', width: 195 }
                        , { field: '单据类型', title: '单据类型', width: 110 }
                        , { field: 'HWHID', title: 'HWHID', width: 200, hide: true }
                        , { field: '仓库代码', title: '仓库代码', width: 125 }
                        , { field: '仓库', title: '仓库', width: 125 }
                        , { field: 'HSecManagerID', title: 'HSecManagerID', width: 200, hide: true }
                        , { field: '领料人代码', title: '领料人代码', width: 180 }
                        , { field: '领料人', title: '领料人', width: 125 }
                        , { field: 'HKeeperID', title: 'HKeeperID', width: 200, hide: true }
                        , { field: '发料人代码', title: '发料人代码', width: 180 }
                        , { field: '发料人', title: '发料人', width: 125 }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '部门代码', title: '部门代码', width: 115 }
                        , { field: '部门', title: '部门', width: 125 }
                        , { field: '摘要', title: '摘要', width: 125 }
                        , { field: '表头备注', title: '表头备注', width: 125 }
                        , { field: '内部单据号', title: '内部单据号', width: 115 }
                        , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                        , { field: 'HMaterID', title: 'HMaterID', width: 200, hide: true }
                        , { field: '模具代码', title: '模具代码', width: 125 }
                        , { field: '模具名称', title: '模具名称', width: 125 }
                        , { field: '规格型号', title: '规格型号', width: 125 }
                        , { field: 'Hunitid', title: 'Hunitid', width: 200, hide: true }
                        , { field: '计量单位代码', title: '计量单位代码', width: 125 }
                        , { field: '计量单位', title: '计量单位', width: 125 }
                        , { field: 'HWHSonID', title: 'HWHSonID', width: 200, hide: true }
                        , { field: '发料仓库代码', title: '发料仓库代码', width: 125 }
                        , { field: '发料仓库', title: '发料仓库', width: 125 }
                        , { field: 'HSPID', title: 'HSPID', width: 200, hide: true }
                        , { field: '仓位代码', title: '仓位代码', width: 125 }
                        , { field: '仓位', title: '仓位', width: 125 }
                        , { field: '应发数量', title: '应发数量', width: 125 }
                        , { field: '实发数量', title: '实发数量', width: 125 }
                        , { field: '单价', title: '单价', width: 125 }
                        , { field: '金额', title: '金额', width: 125 }
                        , { field: '设计寿命', title: '设计寿命', width: 125 }
                        , { field: '累积使用寿命', title: '累积使用寿命', width: 125 }
                        , { field: '剩余寿命', title: '剩余寿命', width: 125 }
                        , { field: '关联数量', title: '关联数量', width: 125 }
                        , { field: '表体备注', title: '表体备注', width: 125 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 125 }
                        , { field: '制单人', title: '制单人', width: 125 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 125 }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 125 }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 125 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 125 }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '行关闭人', title: '行关闭人', width: 125 }
                        , { field: '关闭类型', title: '关闭类型', width: 125 }
                        , { field: '源单主内码', title: '源单主内码', width: 200, hide: true }
                        , { field: '源单子内码', title: '源单子内码', width: 200, hide: true }
                        , { field: '源单单号', title: '源单单号', width: 125 }
                        , { field: '源单类型', title: '源单类型', width: 125 }
                    ]]
                };
                ////设置列宽
                //var colWidth = getColumnsWidth();
                //if (colWidth == "" || colWidth == []) {
                //}
                //else {
                //    $.each(columns, function (x, m) {
                //        m["width"] = colWidth[x];
                //    });
                //}
            }
            ////#region èŽ·å–åˆ—å®½
            //function getColumnsWidth() {
            //    var result = [];
            //    var colNum = $(".layui-table-header").find("tr").eq(0).find("th").length;
            //    //获取列宽
            //    $.ajax({
            //        url: GetWEBURL() + '/tb_CellWidth/GetMouldScrapInHouseCellWidthList',
            //        async: false,
            //        type: "Get",
            //        dataType: "json",
            //        data: { "colNum": colNum, "Name": Name },
            //        success: function (data1) {
            //            if (data1.code == 1) {
            //                result = data1.data;
            //            }
            //            else if (data1.code == -1) {
            //            }
            //            else {
            //                layer.alert(data1.Message, { icon: 5 });
            //            }
            //        }, error: function (e) {
            //            layer.alert(e.Message, { icon: 5 });
            //        }
            //    });
            //    return result;
            //}
            ////#endregion
            //#region åŠ è½½ç½‘æ ¼
            function get_Display(sWhere) {
                //加载网格
                var index = layer.load(0);//遮罩
            //进入页面显示的缓存列表
            $.ajax({
                url: GetWEBURL() + '/Sc_MouldMoveStockStepInBillList/GetMouldMoveStockStepInBillList',
                type: "GET",
                data: { "sWhere": sWhere},
                success: function (data1) {
                    if (data1.count == 1) {
                        option.data = data1.data;
                        table.render(option);
                        layer.close(index);
                    } else {
                        layer.close(index);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Sc_MouldMoveStockStepInBill/GetMouldMoveStockStepInBill',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                }, error: function () {
                    layer.close(index);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
                });
            }
            //#endregion
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'btn-Add':
                        //页面层-自定义
                        layer.open({
                            type: 2,
                            skin: 'layui-layer-rim', //加上边框
                            title: '新增器具分布式调入单',
                            closeBtn: 1,
                            shift: 2,
                            area: ['100%', '100%'],
                            maxmin: true,
                            content: '../模治具仓库管理/Sc_MouldMoveStockStepInBill.html',
                            end: function () {
                                //刷新页面,
                                location.reload();
                            },
                            success: function (layero, index) {
                            }
                        });
                        break;
                    case 'btn-Edit':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
                            var hID = data[0].hmainid.toString();
                            //if (AllowLoadData(sSubStr) != false) {//非空验证
                            layer.open({
                                type: 2
                                , area: ['100%', '100%']
                                , title: '编辑器具分布式调入单'
                                , closeBtn: 1
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: '../模治具仓库管理/Sc_MouldMoveStockStepInBill.html?hID=' + hID
                                , resize: false,
                                end: function () {
                                    //刷新页面,
                                    location.reload();
                                }
                                , cancel: function () {
                                    //$(".layui-btn").removeClass("layui-btn-disabled");
                                }
                            })
                        } else {
                            layer.msg('请选择一行数据编辑!');
                        }
                        break;
                    case 'btn-Delete':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
                            var InterID = data[0].hmainid.toString();
                            //逻辑删除方法
                            layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                                $.ajax({
                                    type: "GET",
                                    url: GetWEBURL() + "Sc_MouldMoveStockStepInBill/DeltetMouldMoveStockStepInBill", //方法所在页面和方法名
                                    data: { "HInterID": InterID },
                                    success: function (result) {
                                        if (result.count == 1) {
                                            layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                                // å¾—到frame索引
                                                var index = layer.getFrameIndex(window.name);
                                                //关闭当前frame
                                                layer.close(index);
                                                //修改为功后刷新界面
                                                window.location.reload();
                                            });
                                        } else {
                                            layer.alert(result.code + result.Message, { icon: 5 });
                                        }
                                    }, error: function () {
                                        layer.alert("接口请求失败!", { icon: 5 });
                                    }
                                });
                            })
                        }
                        else {
                            layer.msg('请选择一行数据删除!');
                        }
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            });
            ////进入页面显示的缓存列表
            //$.ajax({
            //    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
            //    url: GetWEBURL() + '/Sc_MouldProdOutBill/GetMouldProdOutBill',
            //    type: "GET",
            //    data: { "sWhere": sWhere},
            //    success: function (data1) {
            //        if (data1.count == 1) {
            //            option.data = data1.data;
            //            table.render(option);
            //            layer.close(index);
            //        } else {
            //            layer.close(index);
            //            layer.alert(data1.code + data1.Message, { icon: 5 });
            //        }
            //    }, error: function () {
            //        layer.close(index);
            //        layer.alert("接口请求失败!", { icon: 5 });
            //    }
            //});
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery(table, option) {
                var Status = $("select[name='Status']").val();//状态
                var HDate = $("#HBeginDate").val();//开始日期
                var HDate1 = $("#HEndDate").val();//结束日期
                var HBillNo = $("#HBillNo").val(); //单据号
                if (Status) {
                    switch (Status) {
                        case '-1':   //全部
                            sWhere += "";
                            break;
                        case '0':    //未审核
                            sWhere += " and å®¡æ ¸äºº=''";
                            break;
                        case '1':    //已审核
                            sWhere += " and å®¡æ ¸äºº<>''";
                            break;
                        case '2':    //已关闭
                            sWhere += " and å…³é—­äºº<>''";
                        default:
                    }
                }
                var HBillNo = $("#HBillNo").val();//单据号
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HDate + "'";
                }
@@ -355,286 +361,49 @@
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                var index = layer.load(0);
                get_Display(sWhere);
                //调用接口后清空sWhere缓存
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶
            function set_ClearQuery() {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#HBillNo").val("");//单据号
                sWhere = "";
            }
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶
            function set_ClearQuery() {
                $('#Status').find("option[value='-1']").attr("selected", true);
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HBillNo").val("");
            }
            //#endregion
            //#region æ–°å¢ž
            function set_AddNew() {
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    area: ['100%', '100%'],
                    title: '器具分布式调出单据列表-新增',
                    shift: 0,
                    content: '../模治具仓库管理/Sc_Add_MouldMoveStockStepOutBill.html',
                    end: function () {
                        //刷新页面,
                        location.reload();
                    }
                });
            //#region åˆ·æ–°
            function get_Refresh() {
                set_ClearQuery();
                get_Display(sWhere);
            }
            //#endregion
            //修改按钮
            function set_ShowBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var hID = data[0].hmainid.toString();
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '器具分布式调出单据列表'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['Sc_Add_MouldMoveStockStepOutBill.html?HInterID=' + data[0].hinterid + '&HType=Modify', 'yes']
                        , resize: false,
                        end: function () {
                            //刷新页面
                            location.reload();
                        }
                        , cancel: function () {
                        }
                    })
                }
                else {
                    layer.msg('请选择一行数据编辑!');
                }
            }
            ////监听行双击事件
            //table.on('rowDouble(mainTable)', function (obj) {
            //    layer.alert("双击事件", { icon: 1 });
            //});
            //删除
            function set_DeleteBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                var ModRightNameDelete = 'Sc_MouldOtherInBill_Delete'
                var data = obj.data //获得当前行数据
                    , layEvent = obj.event; //获得 lay-event å¯¹åº”的值
                layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "Sc_ICMOReportBill/DeltetICMOReportBill", //方法所在页面和方法名
                        data: { "HItemID": checkStatus.data[0].HItemID, "User": sessionStorage["HUserName"], "ModRightNameDelete": ModRightNameDelete },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    window.location.reload();
                                });
                            }
                            else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                })
            }
            //#endregion
            //laydate.render({
            //    elem: '#HDate'
            //    , type: 'datetime'
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
            //#region å®¡æ ¸
            function set_CheckBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Sc_ICMOReportBill/AuditProcessReportList", //方法所在页面和方法名
                        data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    $("#btnSearch").trigger('click');
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据审核!');
                }
            }
            //#endregion
            //#region åå®¡æ ¸
            function set_AbandonCheck() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Sc_ICMOReportBill/AuditProcessReportList", //方法所在页面和方法名
                        data: { "HInterID": InterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    $("#btnSearch").trigger('click');
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据反审核!');
                }
            }
            //#endregion
            //#region é¢„览
            function get_PrintReport() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    layer.alert("我是打印按钮!单据主ID是:" + InterID);
                    //window.open("../生产工序管理/工序汇报单/HBarPlanPrint.html?linterid=" + linterid + "&Type=HDepartMent" + "&OpenTmp=b");
                    window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + InterID + "&Type=HDepartMent" + "&OpenTmp=b");
                }
                else {
                    layer.msg('请选择一行数据打印!');
                }
            }
            //#endregion
            //#region ä¿å­˜åˆ—宽
            function set_SaveGridColWidth() {
                var arr = [];
                // åˆ—æ•°
                var colNum = $(".layui-table-header").find("tr").eq(0).find("th").length;
                for (var i = 0; i <= colNum; i++) {
                    var colName = $(".layui-table-header").find("tr").eq(0).find("th").eq(i).text();
                    var colWidth = $(".layui-table-header").find("tr").eq(0).find("th").eq(i).width();
                    if (colName != "" && colName != null) {
                        arr.push(colWidth == -1 ? 200 : colWidth);
                    }
                }
                arr.unshift(40); //首位追加
                $.ajax({
                    url: GetWEBURL() + '/tb_CellWidth/GetMouldScrapInHouseCellWidth',
                    async: false,
                    type: "POST",
                    dataType: "json",
                    data: { "myMap": JSON.stringify(arr), "Name": Name },
                    success: function (data1) {
                        if (data1.count == 1) {
                            layer.alert(data1.Message, { icon: 1 });
                        } else {
                            layer.alert(data1.Message, { icon: 5 });
                        }
                    }, error: function (e) {
                        layer.alert(e.Message, { icon: 5 });
                    }
                });
                //设置赋值列宽
                var colWidth = getColumnsWidth();
                if (colWidth == "" || colWidth == []) {
                }
                else {
                    $.each(columns, function (x, m) {
                        m["width"] = colWidth[x];
                    });
                }
                location.reload();
            }
            //#endregion
            //#region é»˜è®¤åˆ—宽
            function set_DefaultGridColWidth() {
                var arr = [];
                // åˆ—æ•°
                var colNum = $(".layui-table-header").find("tr").eq(0).find("th").length;
                for (var i = 0; i <= colNum; i++) {
                    var colName = $(".layui-table-header").find("tr").eq(0).find("th").eq(i).text();
                    if (colName != "" && colName != null) {
                        arr.push(200);   //默认宽度200
                    }
                }
                arr.unshift(40); //首位追加
                $.ajax({
                    url: GetWEBURL() + '/tb_CellWidth/GetMouldScrapInHouseCellWidth',
                    async: false,
                    type: "POST",
                    dataType: "json",
                    data: { "myMap": JSON.stringify(arr), "Name": Name },
                    success: function (data1) {
                        if (data1.count == 1) {
                        } else {
                            layer.alert(data1.Message, { icon: 5 });
                        }
                    }, error: function (e) {
                        layer.alert(e.Message, { icon: 5 });
                    }
                });
                //设置赋值列宽
                var colWidth = getColumnsWidth();
                if (colWidth == "" || colWidth == []) {
                }
                else {
                    $.each(columns, function (x, m) {
                        m["width"] = colWidth[x];
                    });
                }
                //get_FastQuery(table, option);
                location.reload();
            }
            //#endregion
            //以上是layui模块
        });
    </script>
</body>
</html>
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldMoveStockStepOutBill.html
@@ -241,14 +241,14 @@
            //判断是否新增
            if (hID == null || hID == 0) {
                //初始加载表格{ "ID": 0, "HWasterReasonName": " ","HBadReasonID":0,"HEmpName": "  ", "HSQProcName": "   ","HProcID":0, "HZRProcName": "  ", "HMRBChecker": "  ", "HRemark": "  ", "HPSProcName": "  ", "HCloseMan": "   " }
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0,"HSPCode":"", "HSPName": "", "HRemark": "" }];
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HRemark": "" }];
                table.render(option);
            }
            else {
                $("#HInterID").val(hID);//修改时主表ID
                //编辑加载数据
                $.ajax({
                    url: GetWEBURL() + 'Sc_MouldMoveStockStepOutBill/GetMouldMoveStockStepOutBillList',
                    url: GetWEBURL() + 'Sc_MouldMoveStockStepOutBill/Sc_MouldMoveStockStepOutBillListCheckDetai',
                    type: "GET",
                    data: { "sqlWhere": "and hmainid=" + hID },
                    success: function (result) {
@@ -268,8 +268,6 @@
                });
            }
            //头工具栏事件
            var rowid = 0;
            var rows = 0;
@@ -533,14 +531,14 @@
                //alert(hID);
                //查询检验方案单是否存在
                $.ajax({
                    url: GetWEBURL() + "Sc_MouldMoveStockStepOutBill/GetMouldMoveStockStepOutBillList",
                    url: GetWEBURL() + "Sc_MouldMoveStockStepOutBill/Sc_MouldMoveStockStepOutBillListCheckDetai",
                    data: {
                        "HID": hID
                    },
                    success: function (result) {
                        if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data.h_v_Sc_MouldProdOutHouseBillList[0];
                            var data = result.data.h_v_Sc_MouldMoveStockStepOutBill[0];
                            console.info(data);
                            form.val("component-form-group", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HBillNo": data.单据号
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldProdBackBillList.html
@@ -142,61 +142,66 @@
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                         { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: '单据ID', hide: true }
                        , { field: '日期', title: '日期', width: 160, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号', width: 160 }
                        //, { field: '单据类型', title: '单据类型', width: 160 }
                        , { field: 'HDeptID', title: '部门代码', width: 200, hide: false }
                        //, { field: '部门代码', title: '部门代码', width: 115 }
                        , { field: '部门', title: '部门', width: 200 }
                        , { field: 'HSecManagerID', title: '验收员代码', width: 200, hide: false }
                        //, { field: '验收员代码', title: '验收员代码', width: 200 }
                        , { field: '验收员', title: '验收员', width: 200 }
                        , { field: 'HKeeperID', title: '保管员代码', width: 200, hide: false }
                        //, { field: '保管员代码', title: '保管员代码', width: 200 }
                        , { field: '保管员', title: '保管员', width: 200 }
                        , { field: '摘要', title: '摘要', width: 200 }
                        , { field: '表头备注', title: '表头备注', width: 200 }
                        , { field: '日期', title: '日期', width: 125, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号', width: 195 }
                        , { field: '单据类型', title: '单据类型', width: 110 }
                        , { field: 'HWHID', title: 'HWHID', width: 200, hide: true }
                        , { field: '仓库代码', title: '仓库代码', width: 125 }
                        , { field: '仓库', title: '仓库', width: 125 }
                        , { field: 'HSecManagerID', title: 'HSecManagerID', width: 200, hide: true }
                        , { field: '领料人代码', title: '领料人代码', width: 180 }
                        , { field: '领料人', title: '领料人', width: 125 }
                        , { field: 'HKeeperID', title: 'HKeeperID', width: 200, hide: true }
                        , { field: '发料人代码', title: '发料人代码', width: 180 }
                        , { field: '发料人', title: '发料人', width: 125 }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '部门代码', title: '部门代码', width: 115 }
                        , { field: '部门', title: '部门', width: 125 }
                        , { field: '摘要', title: '摘要', width: 125 }
                        , { field: '表头备注', title: '表头备注', width: 125 }
                        //, { field: '内部单据号', title: '内部单据号', width: 115 }
                        , { field: 'HWHID', title: '仓库代码', width: 200, hide: false }
                        //, { field: '仓库代码', title: '仓库代码', width: 200 }
                        , { field: '仓库名称', title: '仓库名称', width: 200 }
                        , { field: 'HSPID', title: '仓位代码', width: 200, hide: false }
                        //, { field: '仓位代码', title: '仓位代码', width: 200 }
                        , { field: '仓位名称', title: '仓位名称', width: 200 }
                        , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                        , { field: 'HMaterID', title: '模具代码', width: 200, hide: false }
                        //, { field: '模具代码', title: '模具代码', width: 200 }
                        , { field: '模具名称', title: '模具名称', width: 200 }
                        , { field: '条码编号', title: '条码编号', width: 200 }
                        //, { field: '模具品类', title: '模具品类', width: 200 }
                        , { field: '设计寿命', title: '设计寿命', width: 200 }
                        , { field: '累计使用寿命', title: '累计使用寿命', width: 200 }
                        , { field: '本次使用寿命', title: '本次使用寿命', width: 200 }
                        , { field: '剩余寿命', title: '剩余寿命', width: 200 }
                        , { field: '最后生产产品', title: '最后生产产品', width: 200 }
                        , { field: '退库类型', title: '退库类型', width: 200 }
                        , { field: '模具新规格', title: '模具新规格', width: 200 }
                        , { field: '表体备注', title: '表体备注', width: 200 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 200 }
                        , { field: '制单人', title: '制单人', width: 200 }
                        , { field: 'HMaterID', title: 'HMaterID', width: 200, hide: true }
                        , { field: '模具代码', title: '模具代码', width: 125 }
                        , { field: '模具名称', title: '模具名称', width: 125 }
                        , { field: '规格型号', title: '规格型号', width: 125 }
                        , { field: 'Hunitid', title: 'Hunitid', width: 200, hide: true }
                        //, { field: '计量单位代码', title: '计量单位代码', width: 125 }
                        //, { field: '计量单位', title: '计量单位', width: 125 }
                        , { field: 'HWHSonID', title: 'HWHSonID', width: 200, hide: true }
                        //, { field: '发料仓库代码', title: '发料仓库代码', width: 125 }
                        //, { field: '发料仓库', title: '发料仓库', width: 125 }
                        , { field: 'HSPID', title: 'HSPID', width: 200, hide: true }
                        , { field: '仓位代码', title: '仓位代码', width: 125 }
                        , { field: '仓位', title: '仓位', width: 125 }
                        , { field: '应发数量', title: '应发数量', width: 125 }
                        , { field: '实发数量', title: '实发数量', width: 125 }
                        , { field: '单价', title: '单价', width: 125 }
                        , { field: '金额', title: '金额', width: 125 }
                        , { field: '设计寿命', title: '设计寿命', width: 125 }
                        , { field: '累积使用寿命', title: '累积使用寿命', width: 125 }
                        , { field: '剩余寿命', title: '剩余寿命', width: 125 }
                        , { field: '关联数量', title: '关联数量', width: 125 }
                        , { field: '表体备注', title: '表体备注', width: 125 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 125 }
                        , { field: '制单人', title: '制单人', width: 125 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 200 }
                        , { field: '审核人', title: '审核人', width: 125 }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 200 }
                        , { field: '修改人', title: '修改人', width: 125 }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 200 }
                        , { field: '关闭人', title: '关闭人', width: 125 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 200 }
                        , { field: '作废人', title: '作废人', width: 125 }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '行关闭人', title: '行关闭人', width: 200 }
                        , { field: '关闭类型', title: '关闭类型', width: 200 }
                        , { field: '行关闭人', title: '行关闭人', width: 125 }
                        , { field: '关闭类型', title: '关闭类型', width: 125 }
                        , { field: '源单主内码', title: '源单主内码', width: 200, hide: true }
                        , { field: '源单子内码', title: '源单子内码', width: 200, hide: true }
                        , { field: '源单单号', title: '源单单号', width: 200 }
                        , { field: '源单类型', title: '源单类型', width: 200 }
                        , { field: '关联数量', title: '关联数量', width: 200 }
                        , { field: '源单单号', title: '源单单号', width: 125, hide: true  }
                        , { field: '源单类型', title: '源单类型', width: 125, hide: true }
                    ]]
                };
            }
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldProdMoveBill.html
New file
@@ -0,0 +1,976 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>新增/编辑器具直接调拨单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <style type="text/css">
        .layui-form-label {
            width: 85px;
        }
    </style>
</head>
<body>
    <div id="layout1" class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <form id="form0" class="layui-form" lay-filter="component-form-group" action="">
                        <div class="layui-card-header">
                            <div class="layui-btn-group">
                                <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">保存</button>
                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">退出</button>
                            </div>
                        </div>
                        <div class="layui-card-body">
                            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                                <!--<ul class="layui-tab-title">
                                <li class="layui-this">基本信息</li>-->
                                <!--<li>其他信息</li>-->
                                <!--</ul>-->
                                <h1 style="text-align:center;"><b>模具直接调拨单</b></h1>
                                <div class="layui-tab-content">
                                    <div class="layui-tab-item layui-show">
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">单据号</label>
                                                <div class="layui-input-inline">
                                                    <input class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" readonly="readonly" autocomplete="off">
                                                    <input id="HInterID" name="HInterID" type="hidden" />
                                                    <input id="HMaker" name="HMaker" type="hidden" /><!--制单人-->
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">日期</label>
                                                <div class="layui-input-inline">
                                                    <input class="layui-input" name="HDate" id="HDate" autocomplete="off" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">内部单据号</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HInnerBillNo" id="HInnerBillNo" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">模具仓库</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HWHName" id="HWHName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HWHID" id="HWHID" class="layui-input" value="" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="WareHouse" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">验收员</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HSecManagerName" id="HSecManagerName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HSecManagerID" id="HSecManagerID" class="layui-input" value="" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HSecManagerList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">保管员</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HKeeperName" id="HKeeperName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HKeeperID" id="HKeeperID" class="layui-input" value="" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HKeeperList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">部门</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HDeptName" id="HDeptName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value="" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="Department" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">源单类型</label>
                                                <div class="layui-input-inline">
                                                    <select name="HSourceBillType" lay-filter="aihao" id="HSourceBillType">
                                                        <option value="生产任务单">生产任务单</option>
                                                        <option value="手工录入">手工录入</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">选单号</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="XDH" id="XDH" class="layui-input" value="" style="float:left;width:150px;">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">摘要</label>
                                                <div class="layui-input-inline">
                                                    <textarea placeholder="请输入摘要" class="layui-textarea" name="HExplanation" id="HExplanation"></textarea>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">备注</label>
                                                <div class="layui-input-inline">
                                                    <textarea placeholder="请输入维备注" class="layui-textarea" name="HRemark" id="HRemark"></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
                            </div>
                        </script>
                        <script type="text/html" id="xuhao">
                            {{d.LAY_TABLE_INDEX+1}}
                        </script>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script type="text/html" id="barDemo">
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script>
        //获取参数
        function getUrlVars(){
            var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = hash[1];
            }
            return vars;
        }
        var params = getUrlVars();
        if (typeof (params[params[0]]) == "undefined") {
            var OperationType = 1;//操作类型
            var closeType = 2;  //关闭类型
        } else {
            var OperationType = params[params[0]];//操作类型
            var linterid = params[params[1]];//源单id
            var HSouceBillType = params[params[2]];//源单类型
            var closeType = params[params[3]];  //关闭类型
        }
        var hID = params[params[0]];//编辑查看
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            //常规用法
            laydate.render({
                elem: '#HDate'
            });
            //判断是否登录 æœªç™»å½•则跳到登录页
            //if (sessionStorage.login != "login") {
            //    layer.confirm("登录失效,请重新登录!", {
            //        icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
            //    }, function () { window.location.href = "../../user/login.html"; });
            //}
            var tableReload = table.reload;
            var option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , height: 500
                //,url: '/demo/table/user/' //数据接口
                , page: true //开启分页
                , cols: [[ //表头
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 100 }
                    , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true }
                    , { field: 'HMaterCode', title: '模具代码', edit: 'text', event: 'HMaterCode', width: 100 }
                    , { field: 'HMaterName', title: '模具名称', edit: 'text', width: 100 }
                    , { field: 'HMaterSpec', title: '规格型号', edit: 'text', width: 100 }
                    , { field: 'HBatchNo', title: '批次', edit: 'text', width: 100 }
                    , { field: 'HDesignLife', title: '设计寿命', edit: 'text', width: 100 }
                    , { field: 'HLeaveLife', title: '剩余寿命', edit: 'text', width: 100 }
                    , { field: 'HUseLife', title: '累积使用寿命', edit: 'text', width: 100 }
                    , { field: 'HQtyMust', title: '应发数量', edit: 'text', width: 100 }
                    , { field: 'HQty', title: '实发数量', edit: 'text', width: 100 }
                    , { field: 'HPrice', title: '单价', edit: 'text', width: 100 }
                    , { field: 'HMoney', title: '金额', edit: 'text', width: 100 }
                    , { field: 'HWHID', title: 'HWHID', edit: 'text', width: 100, hide: true }
                    , { field: 'HWHCode', title: '发料仓库代码', edit: 'text', event: 'HWHCode', width: 100 }
                    , { field: 'HWHName', title: '发料仓库', edit: 'text', width: 100 }
                    , { field: 'HSPID', title: 'HSPID', edit: 'text', width: 100, hide: true }
                    , { field: 'HSPCode', title: '仓位代码', edit: 'text', event: 'HSPCode', width: 100 }
                    , { field: 'HSPName', title: '仓位', edit: 'text', width: 100 }
                    , { field: 'HRemark', title: '表体备注', edit: 'text', width: 100 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ]]
                , limit: 500 //每页默认显示的数量
            };
            //判断是否新增
            if (hID == null || hID == 0) {
                //初始加载表格{ "ID": 0, "HWasterReasonName": " ","HBadReasonID":0,"HEmpName": "  ", "HSQProcName": "   ","HProcID":0, "HZRProcName": "  ", "HMRBChecker": "  ", "HRemark": "  ", "HPSProcName": "  ", "HCloseMan": "   " }
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HRemark": "" }];
                table.render(option);
            }
            else {
                $("#HInterID").val(hID);//修改时主表ID
                //编辑加载数据
                $.ajax({
                    url: GetWEBURL() + 'Sc_MouldProdMoveBill/Sc_MouldProdMoveBillListProjectDetai',
                    type: "GET",
                    data: { "sqlWhere": "and hmainid=" + hID },
                    success: function (result) {
                        //console.log(result);
                        //console.log('gouba' + result);
                        if (result.count == 1) {
                            option.data = result.data;
                            table.render(option);
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index0);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //头工具栏事件
            var rowid = 0;
            var rows = 0;
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;;
                var AddRow = table.cache['mainTable'];
                var NewRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HRemark": "" };
                switch (obj.event) {
                    case 'btn-AddLine':
                        //table.cache["mainTable"].push(AddRow[rows]);
                        table.cache["mainTable"].push(NewRow);
                        option.data = table.cache["mainTable"];
                        table.render(option);
                        rows++;
                        //layer.msg('增加一行按钮!')
                        break;
                    case 'btn-CopyLine':
                        var copydata = JSON.stringify(data);
                        if (data.length <= 0) {
                            layer.alert("请选择需要复制的一行!");
                        }
                        else if (data.length > 1) {
                            layer.alert("只能选择复制一行!");
                        }
                        else {
                            var copydata2 = copydata.substring(1, copydata.length);//去除首行字符'['
                            var copyrow = copydata2.substring(0, copydata2.length - 1);//去除末尾字符']'
                            table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.render(option);//将数据渲染到表格上
                            //layer.alert(copyrow);
                        }
                        break;
                }
            });
            //行内事件
            table.on('tool(mainTable)', function (obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行吗?', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            obj.del();
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.reload(option);
                            layer.close(index);
                        }
                    });
                }
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    if (event.key == "F7") {
                        if (obj.event === 'HMaterCode')  //模具信息
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '模具列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../PublicPage/MouldInformation.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HMaterID: checkStatus.data[0].HItemID,
                                        HMaterCode: checkStatus.data[0].HNumber,
                                        HMaterName: checkStatus.data[0].HName,
                                        HMaterSpec: checkStatus.data[0].HModel,
                                        HDesignLife: 0,  //设计寿命
                                        HLeaveLife: 0,   //剩余寿命
                                        HQty: 1,         //实收数量
                                        HMoney: 0,       //金额
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }
                            });
                        }
                        if (obj.event === 'HWHCode')  //仓库代码
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '仓库列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HWHID', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//获取table的elem:"#test"
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HWHID: checkStatus.data[0].HItemID,
                                        HWHCode: checkStatus.data[0].HNumber,
                                        HWHName: checkStatus.data[0].HName,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }
                            });
                        }
                        if (obj.event === 'HSPCode')  //仓位代码
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '仓位列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../PublicPage/WareLocationInformation.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HSPID: checkStatus.data[0].HItemID,
                                        HSPCode: checkStatus.data[0].HNumber,
                                        HSPName: checkStatus.data[0].HName,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }
                            });
                        }
                        obj.event = "";
                        return false;
                    }
                })
            });
            //监听单元格编辑
            table.on('edit(mainTable)', function (obj) {
                // å•元格编辑之前的值
                var oldText = $(this).prev().text();
                var value = obj.value //得到修改后的值
                    , data = obj.data //得到所在行所有键值
                    , field = obj.field; //得到字段
                //layer.msg('[ID: ' + data.id + '] ' + field + ' å­—段更改为:' + value);
                switch (field) {
                    case "HDesignLife":  //设计寿命
                        value = isNaN(value) ? 0 : value;
                        var HUseLife = isNaN(data.HUseLife) ? 0 : data.HUseLife;
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HDesignLife: value,                          //设计寿命
                            HLeaveLife: value - HUseLife,           //剩余寿命=设计寿命-使用寿命
                        });
                        break;
                    case "HLeaveLife":  //剩余寿命
                        var HDesignLife = isNaN(data.HDesignLife) ? 0 : data.HDesignLife;
                        var HUseLife = isNaN(data.HUseLife) ? 0 : data.HUseLife;
                        //同步更新表格和缓存对应的值
                        obj.tr.find('td[data-field=HLeaveLife] input').val(HDesignLife - HUseLife);
                        obj.update({
                            HLeaveLife: HDesignLife - HUseLife,   //剩余寿命=设计寿命-使用寿命
                        });
                        break;
                    case "HUseLife":    //使用寿命
                        var HDesignLife = isNaN(data.HDesignLife) ? 0 : data.HDesignLife;
                        value = isNaN(value) ? 0 : value;
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HLeaveLife: HDesignLife - value, //剩余寿命=设计寿命-使用寿命
                        });
                        break;
                    case "HQty":        //实发数量
                        value = isNaN(value) ? 0 : value;
                        var HPrice = isNaN(data.HPrice) ? 0 : data.HPrice;
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HMoney: value * HPrice, //金额=实收数量*单价
                        });
                        break;
                    case "HPrice":      //单价
                        value = isNaN(value) ? 0 : value;
                        var HQty = isNaN(data.HQty) ? 0 : data.HQty;
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HMoney: value * HQty, //金额=实收数量*单价
                        });
                        break;
                    case "HMoney":     //金额
                        var HPrice = isNaN(data.HPrice) ? 0 : data.HPrice;
                        var HQty = isNaN(data.HQty) ? 0 : data.HQty;
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HMoney: HPrice * HQty, //金额=实收数量*单价
                        });
                        break;
                    default:
                }
            });
            function RoadBillMain(hID)//加载表头
            {
                //alert(hID);
                //查询检验方案单是否存在
                $.ajax({
                    url: GetWEBURL() + "Sc_MouldProdMoveBill/Sc_MouldProdMoveBillListCheckDetai",
                    type: "GET",
                    data: {
                        "HID": hID
                    },
                    success: function (result) {
                        if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data.h_v_Sc_MouldProdMoveBillList[0];
                            console.info(data);
                            form.val("component-form-group", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HBillNo": data.单据号
                                , "HDate": formatDate(data.日期)
                                , "HInnerBillNo": data.内部单据号
                                , "HWHID": data.HWHID                    //仓库ID
                                , "HWHName": data.仓库                   //仓库名称
                                , "HSecManagerID": data.hsecmanagerid    //验收员ID
                                , "HSecManagerName": data.领料人         //验收员名称
                                , "HKeeperID": data.hkeeperid            //保管员ID
                                , "HKeeperName": data.发料人            //保管员名称
                                , "HDeptID": data.HDeptID                 //部门ID
                                , "HDeptName": data.部门                //部门名称
                                , "HSourceBillType": ""                   //源单类型
                                , "XDH": ""                               //选单号
                                , "HExplanation": data.摘要              //摘要
                                , "HRemark": data.表头备注                    //备注
                            });
                        } else {
                            layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                    }, error: function () {
                        layer.alert("发生错误!", { icon: 5 });
                    }
                });
            }
            var date = new Date();
            var day = date.getDate();
            var month = date.getMonth() + 1;
            var year = date.getFullYear();
            var shijian = year + "-" + month + "-" + day;
            //判断是否新增
            if (hID == null || hID == 0) {
                //获取最大单据号 new
                $("#HInterID").val("0");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '3814' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(shijian);
                        $("#HInterID").val(0);
                    }
                });
            }
            else {//如果修改则走下面 new
                RoadBillMain(hID);
                /* RoadBillSub(linterid);*/
            }
            //表头信息仓库弹窗
            form.on('submit(WareHouse)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '仓库列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HWHID', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HWHName").val(checkStatus.data[0].HName);
                        $("#HWHID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头信息验收员弹窗
            form.on('submit(HSecManagerList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '验收员列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/UserInformation.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HSecManagerName").val(checkStatus.data[0].HName);
                        $("#HSecManagerID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头信息保管员弹窗
            form.on('submit(HKeeperList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '保管员列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/UserInformation.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HKeeperName").val(checkStatus.data[0].HName);
                        $("#HKeeperID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头信息部门弹窗
            form.on('submit(Department)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '部门列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/DeptInformation.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HDeptName").val(checkStatus.data[0].HName);
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //退出
            form.on('submit(Exit)', function (data) {
                if (closeType == 0) {
                    //关闭页签
                    parent.layui.admin.events.closeThisTabs();
                }
                if (closeType == 1) {
                    //关闭弹窗
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                } else if (closeType == 2) {
                    //关闭页签
                    parent.layui.admin.events.closeThisTabs();
                }
            });
            //form.on('submit(Cancel)', function () {
            //    //sessionStorage["SourceFlag"] = false;
            //    parent.location.href = "../../../views/index.html"
            //    //window.close();//关闭当前页
            //})
            function formatDate(date) {
                var d = new Date(date),
                    month = '' + (d.getMonth() + 1),
                    day = '' + d.getDate(),
                    year = d.getFullYear();
                if (month.length < 2) month = '0' + month;
                if (day.length < 2) day = '0' + day;
                return [year, month, day].join('-');
            }
            form.on('submit(Saver)', function (data) {//保存
                //debugger;
                data.field.HMaker = sessionStorage["HUserName"];//制单人
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sMainSub = sMainStr + ';' + sSubStr;
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "/Sc_MouldProdMoveBill/SaveGetMouldProdMoveBillList", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                    parent.layer.close(index); //再执行关闭 Â  Â  Â  Â  Â Â  Â Â Â  Â 
                                });
                            }
                            else {
                                f_alert(data.Message);
                                console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                            console.log("Reason" + sMainStr);
                        }
                    });
            });
            function f_alert(sMsg) {
                layer.alert(sMsg, { icon: 5 });
            }
            //监听提交
            form.verify({
                numberOrEmpty: function (value, item) {
                    // if (value != '') {
                    if (!/^\d+$/.test(value)) {
                        return '不能为空或数字或者0';
                    }
                    //}
                }
            });
        });
        //定义全局变量
        var HReasonName, ReasonID, EmpName, SQProcName,
            ProcID, ZRProcName, QRName
            ;
        function GetHReasonValue(obj)  //返回不良原因
        {
            HReasonName = obj[0].HName;
            ReasonID = obj[0].HItemID;
        }
        //返回物料
        function GetHMaterNameValue(obj) {  //返回物料
            $("#HMater").val(obj[0].HName);
            $("#HMaterID").val(obj[0].HItemID);
            $("#HMaterNumber").val(obj[0].HNumber);
        }
        //返回工序
        function GetHProcValue(obj) {  //返回工序
            $("#HProcName").val(obj[0].工序);
            $("#HProcID").val(obj[0].HItemID);
            $("#HProcNumber").val(obj[0].工序代码);
        }
        function GetHDeptNameValue(obj) {  //返回部门
            $("#HDepName").val(obj[0].HName);
            $("#HDeptID").val(obj[0].HItemID);
            $("#HDeptNumber").val(obj[0].HNumber);
        }
        //返回单位
        function GetHUnitNameValue(obj) {
            $("#HUName").val(obj[0].HName);
            $("#HUnitID").val(obj[0].HItemID);
            $("#HUnitNumber").val(obj[0].HNumber);
        }
        function GetHKeeperValue(obj) {  //返回责任人
            EmpName = obj[0].HName;
            // $("#HEmpName").val(obj[0].HName);
            //$("#HItemID").val(obj[0].HItemID);
        }
        //function GetHProcValue(obj) {  //返回申请工序
        //    SQProcName = obj[0].工序;
        //    ProcID = obj[0].HItemID;
        //    //$("#HSQProcName").val(obj[0].工序);
        //    //$("#HProcID").val(obj[0].HItemID);
        //}
        function GetHZRValue(obj) {   //返回责任工序
            ZRProcName = obj[0].工序;
            //$("#HZRProcName").val(obj[0].工序);
            //$("#HItemID").val(obj[0].HItemID);
        }
        //HWorker
        function GetHWorkerValue(obj) {  //返回不良确认人
            QRName = obj[0].HName;
            //$("#HQRName").val(obj[0].HName);
            //$("#HItemID").val(obj[0].HItemID);
        }
        function AllowLoadData(sSubStr) {  //非空验证
            //if ($("#HSourceBillNo").val() == '') {
            //    layer.msg("请先扫源单!", { icon: 5 });
            //    return false;
            //}
            if ($("#HDeptName").val() == '') {
                layer.msg("部门没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HSecManager").val() == '') {
                layer.msg("验收人没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HKeeper").val() == '') {
                layer.msg("保管人没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            //if ($("#HWHNAME").val() == '') {
            //    layer.msg("仓库没有选择!", { icon: 5 });
            //    return false;
            //}
            if ($("#HBillNo").val() == '') {
                layer.msg("错误的单据号", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HInterID").val() == '') {
                layer.msg("错误的内码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if (typeof (sSubStr) == "undefined") {
                layer.msg("没有物料明细记录", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if (!typeof (sSubStr) == "undefined") {
                //for (var i = 0; i <= sSubStr.length - 1; i++) {  //判断扫码数量不能大于应收数量
                //    if (parseFloat(sSubStr[i].HQtyMust) > 0) {
                //        if (parseFloat(sSubStr[i].HQty) > parseFloat(sSubStr[i].HQtyMust))
                //        {
                //            layer.msg("数量不能大于应收数量", { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
                //            return false;
                //        }
                //    }
                //}
                for (var i = 0; i <= sSubStr.length - 1; i++) {   //判断扫码数量不能为0
                    if (parseFloat(sSubStr[i].HQty) > 0) {
                        s = 1;
                    }
                }
                if (s == 0) {
                    layer.msg("产品入库记录未扫码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
            }
            else {
                return true;
            }
        }</script>
</body>
</html>
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldProdMoveBillList.html
@@ -2,12 +2,13 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>器具直接调拨单据列表</title>
    <title>器具直接调拨单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <!--<script src="../../../layuiadmin/layui/layui.js"></script>-->
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
@@ -15,10 +16,10 @@
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <style >
        .layui-form-select .layui-input {
            padding-right: 15px;
            cursor: pointer;
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
        }
    </style>
</head>
@@ -30,16 +31,15 @@
                    <form class="layui-form" action="" lay-filter="component-form-group">
                        <div class="layui-collapse">
                            <div class="layui-colla-item">
                                <!--<div class="layui-colla-title layui-inline">
                                    <div class="layui-inline">
                                        <span>更多</span>
                                    </div>
                                </div>-->
                                <div class="layui-inline">
                                    <label class="layui-form-label">状态</label>
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
                                        <select name="HStatus" lay-filter="HStatus" style="width:190px;">
                                            <option value="-1" selected="selected">全部</option>
                                            <option value="0">未审核</option>
                                            <option value="1">已审核</option>
                                            <option value="2">已关闭</option>
                                        </select>
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                    </div>
                                </div>
                                <div class="layui-inline">
@@ -58,19 +58,14 @@
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                </button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <div class="layui-colla-content">
                                <!--<div class="layui-colla-content">
                                    <div class="layui-inline">
                                        <div class="layui-inline">
                                            <span>其他条件></span>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">单据号</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                        </div>
                                    </div>
                                </div>
                                </div>-->
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
@@ -88,7 +83,10 @@
            </div>
        </div>
    </div>
    <!--<script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>-->
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
@@ -106,37 +104,17 @@
                , util = layui.util
            //查询条件
            var sWhere = "";
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            var option = [];
            //初始化界面
            set_ClearBill();
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //#region å¤´å·¥å…·æ äº‹ä»¶
            table.on('toolbar(mainTable)', function (obj) {
                switch (obj.event) {
                    //新增按钮
                    case 'btn-Add': set_AddNew();
                        break;
                    //编辑按钮
                    case 'btn-Edit': set_ShowBill();
                        break;
                    //删除按钮
                    case 'btn-Delete': set_DeleteBill();
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            //#region é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                //清空过滤条件
                set_ClearQuery();
            });
            //#endregion
@@ -146,12 +124,7 @@
            });
            //#endregion
            //#region é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                //清空过滤条件
                set_ClearQuery();
            });
            //#endregion
            //#region åˆå§‹åŒ–界面
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
@@ -159,179 +132,226 @@
                get_Display(sWhere);
            }
            //#endregion
            //#region åˆ·æ–°
            function get_Refresh() {
                sWhere = "";
                get_Display(sWhere);
            }
             //#endregion
            //#region åˆå§‹åŒ–表格方法
            $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
            function set_InitGrid() {
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                 columns = [
                     { type: 'checkbox', fixed: 'left' }
                    , { field: 'hmainid', title: '单据ID', hide: true }
                    , { field: '日期', title: '日期', width: 180 }
                     , { field: '单据号', title: '单据号', width: 190 }
                     , { field: 'HDeptID', title: 'HDeptID', width: 160, hide: false }
                    , { field: '部门代码', title: '部门代码', width: 200 }
                    , { field: '部门', title: '部门', width: 200 }
                     , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 200, hide: true }
                    , { field: '验收员代码', title: '验收员代码', width: 200 }
                    , { field: '验收员', title: '验收员', width: 200 }
                     , { field: 'hkeeperid', title: 'hkeeperid', width: 200, hide: true }
                    , { field: '保管员代码', title: '保管员代码', width: 200 }
                    , { field: '保管员', title: '保管员', width: 200 }
                     , { field: 'hwhid', title: 'hwhid', width: 200, hide: true }
                    , { field: '仓库代码', title: '仓库代码', width: 200 }
                    , { field: '仓库', title: '仓库', width: 200 }
                    , { field: '摘要', title: '摘要', width: 115, hide: true }
                    , { field: '表头备注', title: '表头备注', width: 200 }
                    , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                     , { field: 'hmaterid', title: 'hmaterid', width: 200, hide: true }
                    , { field: '模具代码', title: '模具代码', width: 115 }
                    , { field: '模具名称', title: '模具名称', width: 200 }
                    , { field: '条码编号', title: '条码编号', width: 200 }
                    //, { field: '模具品类', title: '模具品类', width: 200 }
                    //, { field: '收料仓库代码', title: '收料仓库代码', width: 200 }
                    //, { field: '收料仓库', title: '收料仓库', width: 200 }
                     , { field: 'HSPID', title: '仓位代码', width: 200, hide: false }
                    //, { field: '仓位代码', title: '仓位代码', width: 200 }
                    //, { field: '仓位', title: '仓位', width: 200 }
                    , { field: '设计寿命', title: '设计寿命', width: 200 }
                    , { field: '累计使用寿命', title: '累计使用寿命', width: 200 }
                    , { field: '本次使用寿命', title: '本次使用寿命', width: 200 }
                    , { field: '剩余寿命', title: '剩余寿命', width: 200 }
                    //, { field: '最后生产产品', title: '最后生产产品', width: 200 }
                    //, { field: '退库类型', title: '退库类型', width: 200 }
                    , { field: '模具新规格', title: '模具新规格', width: 200 }
                    , { field: '表体备注', title: '表体备注', width: 200 }
                    , { field: '关联数量', title: '关联数量', width: 200 }
                    , { field: 'HBillType', title: 'HBillType', width: 200, hide: true }
                    , { field: '红蓝单标记', title: '红蓝单标记', width: 200 }
                    , { field: '制单人', title: '制单人', width: 200 }
                     , { field: '制单日期', title: '制单日期', width: 180, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>"  }
                    , { field: '审核人', title: '审核人', width: 200 }
                     , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '修改人', title: '修改人', width: 200 }
                     , { field: '修改日期', title: '修改日期', width: 180, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '关闭人', title: '关闭人', width: 200 }
                     , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '作废人', title: '作废人', width: 200 }
                     , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '源单主内码', title: '源单主内码', width: 200, hide: true }
                    , { field: '源单子内码', title: '源单子内码', width: 200, hide: true }
                    , { field: '源单单号', title: '源单单号', width: 200 }
                    , { field: '源单类型', title: '源单类型', width: 200 }
                ];
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , page: true
                    //, cellMinWidth: 120
                    , totalRow: true
                    , limit: 10
                    , height: 'full-50'
                    , cols: [columns]
                    , limits: [50, 500, 1000, 5000]
                    , done: function (res, curr, count) {
                    }
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: '单据ID', hide: true }
                        , { field: '日期', title: '日期', width: 125, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号', width: 195 }
                        , { field: '单据类型', title: '单据类型', width: 110 }
                        , { field: 'HWHID', title: 'HWHID', width: 200, hide: true }
                        , { field: '仓库代码', title: '仓库代码', width: 125 }
                        , { field: '仓库', title: '仓库', width: 125 }
                        , { field: 'HSecManagerID', title: 'HSecManagerID', width: 200, hide: true }
                        , { field: '验收员代码', title: '验收员代码', width: 180 }
                        , { field: '验收员', title: '验收员', width: 125 }
                        , { field: 'HKeeperID', title: 'HKeeperID', width: 200, hide: true }
                        , { field: '保管员代码', title: '保管员代码', width: 180 }
                        , { field: '保管员', title: '保管员', width: 125 }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '部门代码', title: '部门代码', width: 115 }
                        , { field: '部门', title: '部门', width: 125 }
                        , { field: '摘要', title: '摘要', width: 125 }
                        , { field: '表头备注', title: '表头备注', width: 125 }
                        , { field: '内部单据号', title: '内部单据号', width: 115 }
                        , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                        , { field: 'HMaterID', title: 'HMaterID', width: 200, hide: true }
                        , { field: '模具代码', title: '模具代码', width: 125 }
                        , { field: '模具名称', title: '模具名称', width: 125 }
                        , { field: '规格型号', title: '规格型号', width: 125 }
                        , { field: 'Hunitid', title: 'Hunitid', width: 200, hide: true }
                        , { field: '计量单位代码', title: '计量单位代码', width: 125 }
                        , { field: '计量单位', title: '计量单位', width: 125 }
                        , { field: 'HWHSonID', title: 'HWHSonID', width: 200, hide: true }
                        , { field: '发料仓库代码', title: '发料仓库代码', width: 125 }
                        , { field: '发料仓库', title: '发料仓库', width: 125 }
                        , { field: 'HSPID', title: 'HSPID', width: 200, hide: true }
                        , { field: '仓位代码', title: '仓位代码', width: 125 }
                        , { field: '仓位', title: '仓位', width: 125 }
                        , { field: '应发数量', title: '应发数量', width: 125 }
                        , { field: '实发数量', title: '实发数量', width: 125 }
                        , { field: '单价', title: '单价', width: 125 }
                        , { field: '金额', title: '金额', width: 125 }
                        , { field: '设计寿命', title: '设计寿命', width: 125 }
                        , { field: '累积使用寿命', title: '累积使用寿命', width: 125 }
                        , { field: '剩余寿命', title: '剩余寿命', width: 125 }
                        , { field: '关联数量', title: '关联数量', width: 125 }
                        , { field: '表体备注', title: '表体备注', width: 125 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 125 }
                        , { field: '制单人', title: '制单人', width: 125 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 125 }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 125 }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 125 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 125 }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '行关闭人', title: '行关闭人', width: 125 }
                        , { field: '关闭类型', title: '关闭类型', width: 125 }
                        , { field: '源单主内码', title: '源单主内码', width: 200, hide: true }
                        , { field: '源单子内码', title: '源单子内码', width: 200, hide: true }
                        , { field: '源单单号', title: '源单单号', width: 125 }
                        , { field: '源单类型', title: '源单类型', width: 125 }
                    ]]
                };
                ////设置列宽
                //var colWidth = getColumnsWidth();
                //if (colWidth == "" || colWidth == []) {
                //}
                //else {
                //    $.each(columns, function (x, m) {
                //        m["width"] = colWidth[x];
                //    });
                //}
            }
            ////#region èŽ·å–åˆ—å®½
            //function getColumnsWidth() {
            //    var result = [];
            //    var colNum = $(".layui-table-header").find("tr").eq(0).find("th").length;
            //    //获取列宽
            //    $.ajax({
            //        url: GetWEBURL() + '/tb_CellWidth/GetMouldScrapInHouseCellWidthList',
            //        async: false,
            //        type: "Get",
            //        dataType: "json",
            //        data: { "colNum": colNum, "Name": Name },
            //        success: function (data1) {
            //            if (data1.code == 1) {
            //                result = data1.data;
            //            }
            //            else if (data1.code == -1) {
            //            }
            //            else {
            //                layer.alert(data1.Message, { icon: 5 });
            //            }
            //        }, error: function (e) {
            //            layer.alert(e.Message, { icon: 5 });
            //        }
            //    });
            //    return result;
            //}
            ////#endregion
            //#region åŠ è½½ç½‘æ ¼
            function get_Display(sWhere) {
                //加载网格
                var index = layer.load(0);//遮罩
            //进入页面显示的缓存列表
            $.ajax({
                url: GetWEBURL() + '/Sc_MouldProdMoveBillList/GetMouldProdMoveBillList',
                type: "GET",
                data: { "sWhere": sWhere},
                success: function (data1) {
                    if (data1.count == 1) {
                        option.data = data1.data;
                        table.render(option);
                        layer.close(index);
                    } else {
                        layer.close(index);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Sc_MouldProdMoveBill/GetMouldProdMoveBill',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                }, error: function () {
                    layer.close(index);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
                });
            }
            //#endregion
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'btn-Add':
                        //页面层-自定义
                        layer.open({
                            type: 2,
                            skin: 'layui-layer-rim', //加上边框
                            title: '新增器具直接调拨单',
                            closeBtn: 1,
                            shift: 2,
                            area: ['100%', '100%'],
                            maxmin: true,
                            content: '../模治具仓库管理/Sc_MouldProdMoveBill.html',
                            end: function () {
                                //刷新页面,
                                location.reload();
                            },
                            success: function (layero, index) {
                            }
                        });
                        break;
                    case 'btn-Edit':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
                            var hID = data[0].hmainid.toString();
                            //if (AllowLoadData(sSubStr) != false) {//非空验证
                            layer.open({
                                type: 2
                                , area: ['100%', '100%']
                                , title: '编辑器具直接调拨单'
                                , closeBtn: 1
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: '../模治具仓库管理/Sc_MouldProdMoveBill.html?hID=' + hID
                                , resize: false,
                                end: function () {
                                    //刷新页面,
                                    location.reload();
                                }
                                , cancel: function () {
                                    //$(".layui-btn").removeClass("layui-btn-disabled");
                                }
                            })
                        } else {
                            layer.msg('请选择一行数据编辑!');
                        }
                        break;
                    case 'btn-Delete':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
                            var InterID = data[0].hmainid.toString();
                            //逻辑删除方法
                            layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                                $.ajax({
                                    type: "GET",
                                    url: GetWEBURL() + "Sc_MouldProdMoveBill/DeltetMouldProdMoveBill", //方法所在页面和方法名
                                    data: { "HInterID": InterID },
                                    success: function (result) {
                                        if (result.count == 1) {
                                            layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                                // å¾—到frame索引
                                                var index = layer.getFrameIndex(window.name);
                                                //关闭当前frame
                                                layer.close(index);
                                                //修改为功后刷新界面
                                                window.location.reload();
                                            });
                                        } else {
                                            layer.alert(result.code + result.Message, { icon: 5 });
                                        }
                                    }, error: function () {
                                        layer.alert("接口请求失败!", { icon: 5 });
                                    }
                                });
                            })
                        }
                        else {
                            layer.msg('请选择一行数据删除!');
                        }
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            });
            ////进入页面显示的缓存列表
            //$.ajax({
            //    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
            //    url: GetWEBURL() + '/Sc_MouldProdOutBill/GetMouldProdOutBill',
            //    type: "GET",
            //    data: { "sWhere": sWhere},
            //    success: function (data1) {
            //        if (data1.count == 1) {
            //            option.data = data1.data;
            //            table.render(option);
            //            layer.close(index);
            //        } else {
            //            layer.close(index);
            //            layer.alert(data1.code + data1.Message, { icon: 5 });
            //        }
            //    }, error: function () {
            //        layer.close(index);
            //        layer.alert("接口请求失败!", { icon: 5 });
            //    }
            //});
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery(table, option) {
                var Status = $("select[name='Status']").val();//状态
                var HDate = $("#HBeginDate").val();//开始日期
                var HDate1 = $("#HEndDate").val();//结束日期
                var HBillNo = $("#HBillNo").val(); //单据号
                if (Status) {
                    switch (Status) {
                        case '-1':   //全部
                            sWhere += "";
                            break;
                        case '0':    //未审核
                            sWhere += " and å®¡æ ¸äºº=''";
                            break;
                        case '1':    //已审核
                            sWhere += " and å®¡æ ¸äºº<>''";
                            break;
                        case '2':    //已关闭
                            sWhere += " and å…³é—­äºº<>''";
                        default:
                    }
                }
                var HBillNo = $("#HBillNo").val();//单据号
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HDate + "'";
                }
@@ -341,286 +361,49 @@
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                var index = layer.load(0);
                get_Display(sWhere);
                //调用接口后清空sWhere缓存
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶
            function set_ClearQuery() {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#HBillNo").val("");//单据号
                sWhere = "";
            }
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶
            function set_ClearQuery() {
                $('#Status').find("option[value='-1']").attr("selected", true);
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HBillNo").val("");
            }
            //#endregion
            //#region æ–°å¢ž
            function set_AddNew() {
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    area: ['100%', '100%'],
                    title: '器具分布式调出单据列表-新增',
                    shift: 0,
                    content: '../模治具仓库管理/Sc_Add_MouldMoveStockStepOutBill.html',
                    end: function () {
                        //刷新页面,
                        location.reload();
                    }
                });
            //#region åˆ·æ–°
            function get_Refresh() {
                set_ClearQuery();
                get_Display(sWhere);
            }
            //#endregion
            //修改按钮
            function set_ShowBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var hID = data[0].hmainid.toString();
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '器具分布式调出单据列表'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['Sc_Add_MouldMoveStockStepOutBill.html?HInterID=' + data[0].hinterid + '&HType=Modify', 'yes']
                        , resize: false,
                        end: function () {
                            //刷新页面
                            location.reload();
                        }
                        , cancel: function () {
                        }
                    })
                }
                else {
                    layer.msg('请选择一行数据编辑!');
                }
            }
            ////监听行双击事件
            //table.on('rowDouble(mainTable)', function (obj) {
            //    layer.alert("双击事件", { icon: 1 });
            //});
            //删除
            function set_DeleteBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                var ModRightNameDelete = 'Sc_MouldOtherInBill_Delete'
                var data = obj.data //获得当前行数据
                    , layEvent = obj.event; //获得 lay-event å¯¹åº”的值
                layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "Sc_ICMOReportBill/DeltetICMOReportBill", //方法所在页面和方法名
                        data: { "HItemID": checkStatus.data[0].HItemID, "User": sessionStorage["HUserName"], "ModRightNameDelete": ModRightNameDelete },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    window.location.reload();
                                });
                            }
                            else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                })
            }
            //#endregion
            //laydate.render({
            //    elem: '#HDate'
            //    , type: 'datetime'
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
            ////#region å®¡æ ¸
            //function set_CheckBill() {
            //    var checkStatus = table.checkStatus('mainTable')
            //        , data = checkStatus.data;
            //    if (checkStatus.data.length === 1) {
            //        var InterID = data[0].hmainid.toString();
            //        //逻辑审核方法
            //        $.ajax({
            //            type: "GET",
            //            url: GetWEBURL() + "/Sc_ICMOReportBill/AuditProcessReportList", //方法所在页面和方法名
            //            data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
            //            success: function (result) {
            //                if (result.count == 1) {
            //                    layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
            //                        // å¾—到frame索引
            //                        var index = layer.getFrameIndex(window.name);
            //                        //关闭当前frame
            //                        layer.close(index);
            //                        //修改为功后刷新界面
            //                        $("#btnSearch").trigger('click');
            //                    });
            //                } else {
            //                    layer.alert(result.code + result.Message, { icon: 5 });
            //                }
            //            }, error: function () {
            //                layer.alert("接口请求失败!", { icon: 5 });
            //            }
            //        });
            //    }
            //    else {
            //        layer.msg('请选择一行数据审核!');
            //    }
            //}
            ////#endregion
            ////#region åå®¡æ ¸
            //function set_AbandonCheck() {
            //    var checkStatus = table.checkStatus('mainTable')
            //        , data = checkStatus.data;
            //    if (checkStatus.data.length === 1) {
            //        var InterID = data[0].hmainid.toString();
            //        //逻辑审核方法
            //        $.ajax({
            //            type: "GET",
            //            url: GetWEBURL() + "/Sc_ICMOReportBill/AuditProcessReportList", //方法所在页面和方法名
            //            data: { "HInterID": InterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
            //            success: function (result) {
            //                if (result.count == 1) {
            //                    layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
            //                        // å¾—到frame索引
            //                        var index = layer.getFrameIndex(window.name);
            //                        //关闭当前frame
            //                        layer.close(index);
            //                        //修改为功后刷新界面
            //                        $("#btnSearch").trigger('click');
            //                    });
            //                } else {
            //                    layer.alert(result.code + result.Message, { icon: 5 });
            //                }
            //            }, error: function () {
            //                layer.alert("接口请求失败!", { icon: 5 });
            //            }
            //        });
            //    }
            //    else {
            //        layer.msg('请选择一行数据反审核!');
            //    }
            //}
            ////#endregion
            ////#region é¢„览
            //function get_PrintReport() {
            //    var checkStatus = table.checkStatus('mainTable')
            //        , data = checkStatus.data;
            //    if (checkStatus.data.length === 1) {
            //        var InterID = data[0].hmainid.toString();
            //        layer.alert("我是打印按钮!单据主ID是:" + InterID);
            //        //window.open("../生产工序管理/工序汇报单/HBarPlanPrint.html?linterid=" + linterid + "&Type=HDepartMent" + "&OpenTmp=b");
            //        window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + InterID + "&Type=HDepartMent" + "&OpenTmp=b");
            //    }
            //    else {
            //        layer.msg('请选择一行数据打印!');
            //    }
            //}
            ////#endregion
            ////#region ä¿å­˜åˆ—宽
            //function set_SaveGridColWidth() {
            //    var arr = [];
            //    // åˆ—æ•°
            //    var colNum = $(".layui-table-header").find("tr").eq(0).find("th").length;
            //    for (var i = 0; i <= colNum; i++) {
            //        var colName = $(".layui-table-header").find("tr").eq(0).find("th").eq(i).text();
            //        var colWidth = $(".layui-table-header").find("tr").eq(0).find("th").eq(i).width();
            //        if (colName != "" && colName != null) {
            //            arr.push(colWidth == -1 ? 200 : colWidth);
            //        }
            //    }
            //    arr.unshift(40); //首位追加
            //    $.ajax({
            //        url: GetWEBURL() + '/tb_CellWidth/GetMouldScrapInHouseCellWidth',
            //        async: false,
            //        type: "POST",
            //        dataType: "json",
            //        data: { "myMap": JSON.stringify(arr), "Name": Name },
            //        success: function (data1) {
            //            if (data1.count == 1) {
            //                layer.alert(data1.Message, { icon: 1 });
            //            } else {
            //                layer.alert(data1.Message, { icon: 5 });
            //            }
            //        }, error: function (e) {
            //            layer.alert(e.Message, { icon: 5 });
            //        }
            //    });
            //    //设置赋值列宽
            //    var colWidth = getColumnsWidth();
            //    if (colWidth == "" || colWidth == []) {
            //    }
            //    else {
            //        $.each(columns, function (x, m) {
            //            m["width"] = colWidth[x];
            //        });
            //    }
            //    location.reload();
            //}
            ////#endregion
            ////#region é»˜è®¤åˆ—宽
            //function set_DefaultGridColWidth() {
            //    var arr = [];
            //    // åˆ—æ•°
            //    var colNum = $(".layui-table-header").find("tr").eq(0).find("th").length;
            //    for (var i = 0; i <= colNum; i++) {
            //        var colName = $(".layui-table-header").find("tr").eq(0).find("th").eq(i).text();
            //        if (colName != "" && colName != null) {
            //            arr.push(200);   //默认宽度200
            //        }
            //    }
            //    arr.unshift(40); //首位追加
            //    $.ajax({
            //        url: GetWEBURL() + '/tb_CellWidth/GetMouldScrapInHouseCellWidth',
            //        async: false,
            //        type: "POST",
            //        dataType: "json",
            //        data: { "myMap": JSON.stringify(arr), "Name": Name },
            //        success: function (data1) {
            //            if (data1.count == 1) {
            //            } else {
            //                layer.alert(data1.Message, { icon: 5 });
            //            }
            //        }, error: function (e) {
            //            layer.alert(e.Message, { icon: 5 });
            //        }
            //    });
            //    //设置赋值列宽
            //    var colWidth = getColumnsWidth();
            //    if (colWidth == "" || colWidth == []) {
            //    }
            //    else {
            //        $.each(columns, function (x, m) {
            //            m["width"] = colWidth[x];
            //        });
            //    }
            //    //get_FastQuery(table, option);
            //    location.reload();
            //}
            //#endregion
            //以上是layui模块
        });
    </script>
</body>
</html>
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Sc_MouldOtherInBill.html
@@ -2,7 +2,7 @@
<html>
<head>
    <meta charset="utf-8" />
    <title>模具其他入库单</title>
    <title>新建/编辑模具其他入库单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Sc_MouldOtherInBillList.html
@@ -2,12 +2,13 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>模具其他入库单列表</title>
    <title>模治具模具其他入库单列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <!--<script src="../../../layuiadmin/layui/layui.js"></script>-->
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
@@ -15,10 +16,10 @@
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <style >
        .layui-form-select .layui-input {
            padding-right: 15px;
            cursor: pointer;
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
        }
    </style>
</head>
@@ -30,20 +31,15 @@
                    <form class="layui-form" action="" lay-filter="component-form-group">
                        <div class="layui-collapse">
                            <div class="layui-colla-item">
                                <div class="layui-colla-title layui-inline">
                                <!--<div class="layui-colla-title layui-inline">
                                    <div class="layui-inline">
                                        <span>更多</span>
                                    </div>
                                </div>
                                </div>-->
                                <div class="layui-inline">
                                    <label class="layui-form-label">状态</label>
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
                                        <select name="HStatus" lay-filter="HStatus" style="width:190px;">
                                            <option value="-1" selected="selected">全部</option>
                                            <option value="0">未审核</option>
                                            <option value="1">已审核</option>
                                            <option value="2">已关闭</option>
                                        </select>
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                    </div>
                                </div>
                                <div class="layui-inline">
@@ -62,19 +58,14 @@
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                </button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <div class="layui-colla-content">
                                <!--<div class="layui-colla-content">
                                    <div class="layui-inline">
                                        <div class="layui-inline">
                                            <span>其他条件></span>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">单据号</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                        </div>
                                    </div>
                                </div>
                                </div>-->
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
@@ -92,7 +83,10 @@
            </div>
        </div>
    </div>
    <!--<script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>-->
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
@@ -110,37 +104,17 @@
                , util = layui.util
            //查询条件
            var sWhere = "";
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            var option = [];
            //初始化界面
            set_ClearBill();
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //#region å¤´å·¥å…·æ äº‹ä»¶
            table.on('toolbar(mainTable)', function (obj) {
                switch (obj.event) {
                    //新增按钮
                    case 'btn-Add': set_AddNew();
                        break;
                    //编辑按钮
                    case 'btn-Edit': set_ShowBill();
                        break;
                    //删除按钮
                    case 'btn-Delete': set_DeleteBill();
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            //#region é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                //清空过滤条件
                set_ClearQuery();
            });
            //#endregion
@@ -150,12 +124,7 @@
            });
            //#endregion
            //#region é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                //清空过滤条件
                set_ClearQuery();
            });
            //#endregion
            //#region åˆå§‹åŒ–界面
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
@@ -163,179 +132,226 @@
                get_Display(sWhere);
            }
            //#endregion
            //#region åˆ·æ–°
            function get_Refresh() {
                sWhere = "";
                get_Display(sWhere);
            }
             //#endregion
            //#region åˆå§‹åŒ–表格方法
            $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
            function set_InitGrid() {
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                 columns = [
                     { type: 'checkbox', fixed: 'left' }
                    , { field: 'hmainid', title: '单据ID', hide: true }
                    , { field: '日期', title: '日期', width: 180 }
                     , { field: '单据号', title: '单据号', width: 180 }
                     , { field: 'HDeptID', title: '部门代码', width: 160, hide: false }
                    //, { field: '部门代码', title: '部门代码', width: 200 }
                    //, { field: '部门', title: '部门', width: 200 }
                     , { field: 'hsecmanagerid', title: '验收员代码', width: 200, hide: false }
                    //, { field: '验收员代码', title: '验收员代码', width: 200 }
                    //, { field: '验收员', title: '验收员', width: 200 }
                     , { field: 'hkeeperid', title: '保管员代码', width: 200, hide: false }
                    //, { field: '保管员代码', title: '保管员代码', width: 200 }
                    //, { field: '保管员', title: '保管员', width: 200 }
                     , { field: 'hwhid', title: '仓库代码', width: 200, hide: false }
                    //, { field: '仓库代码', title: '仓库代码', width: 200 }
                    //, { field: '仓库', title: '仓库', width: 200 }
                    , { field: '摘要', title: '摘要', width: 115, hide: true }
                    , { field: '表头备注', title: '表头备注', width: 200 }
                    , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                     , { field: 'hmaterid', title: '模具代码', width: 200, hide: false }
                    //, { field: '模具代码', title: '模具代码', width: 115 }
                    //, { field: '模具名称', title: '模具名称', width: 200 }
                    , { field: '条码编号', title: '条码编号', width: 200 }
                    //, { field: '模具品类', title: '模具品类', width: 200 }
                    //, { field: '收料仓库代码', title: '收料仓库代码', width: 200 }
                    //, { field: '收料仓库', title: '收料仓库', width: 200 }
                     , { field: 'HSPID', title: '仓位代码', width: 200, hide: false }
                    //, { field: '仓位代码', title: '仓位代码', width: 200 }
                    //, { field: '仓位', title: '仓位', width: 200 }
                    , { field: '设计寿命', title: '设计寿命', width: 200 }
                    , { field: '累计使用寿命', title: '累计使用寿命', width: 200 }
                    , { field: '本次使用寿命', title: '本次使用寿命', width: 200 }
                    , { field: '剩余寿命', title: '剩余寿命', width: 200 }
                    //, { field: '最后生产产品', title: '最后生产产品', width: 200 }
                    //, { field: '退库类型', title: '退库类型', width: 200 }
                    , { field: '模具新规格', title: '模具新规格', width: 200 }
                    , { field: '表体备注', title: '表体备注', width: 200 }
                    , { field: '关联数量', title: '关联数量', width: 200 }
                    , { field: 'HBillType', title: 'HBillType', width: 200, hide: true }
                    , { field: '红蓝单标记', title: '红蓝单标记', width: 200 }
                    , { field: '制单人', title: '制单人', width: 200 }
                     , { field: '制单日期', title: '制单日期', width: 180, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>"  }
                    , { field: '审核人', title: '审核人', width: 200 }
                     , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '修改人', title: '修改人', width: 200 }
                     , { field: '修改日期', title: '修改日期', width: 180, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '关闭人', title: '关闭人', width: 200 }
                     , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '作废人', title: '作废人', width: 200 }
                     , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '源单主内码', title: '源单主内码', width: 200, hide: true }
                    , { field: '源单子内码', title: '源单子内码', width: 200, hide: true }
                    , { field: '源单单号', title: '源单单号', width: 200 }
                    , { field: '源单类型', title: '源单类型', width: 200 }
                ];
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , page: true
                    //, cellMinWidth: 120
                    , totalRow: true
                    , limit: 10
                    , height: 'full-50'
                    , cols: [columns]
                    , limits: [50, 500, 1000, 5000]
                    , done: function (res, curr, count) {
                    }
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: '单据ID', hide: true }
                        , { field: '日期', title: '日期', width: 125, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号', width: 195 }
                        , { field: '单据类型', title: '单据类型', width: 110 }
                        , { field: 'HWHID', title: 'HWHID', width: 200, hide: true }
                        , { field: '仓库代码', title: '仓库代码', width: 125 }
                        , { field: '仓库', title: '仓库', width: 125 }
                        , { field: 'HSecManagerID', title: 'HSecManagerID', width: 200, hide: true }
                        , { field: '领料人代码', title: '领料人代码', width: 180 }
                        , { field: '领料人', title: '领料人', width: 125 }
                        , { field: 'HKeeperID', title: 'HKeeperID', width: 200, hide: true }
                        , { field: '发料人代码', title: '发料人代码', width: 180 }
                        , { field: '发料人', title: '发料人', width: 125 }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '部门代码', title: '部门代码', width: 115 }
                        , { field: '部门', title: '部门', width: 125 }
                        , { field: '摘要', title: '摘要', width: 125 }
                        , { field: '表头备注', title: '表头备注', width: 125 }
                        , { field: '内部单据号', title: '内部单据号', width: 115 }
                        , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                        , { field: 'HMaterID', title: 'HMaterID', width: 200, hide: true }
                        , { field: '模具代码', title: '模具代码', width: 125 }
                        , { field: '模具名称', title: '模具名称', width: 125 }
                        , { field: '规格型号', title: '规格型号', width: 125 }
                        , { field: 'Hunitid', title: 'Hunitid', width: 200, hide: true }
                        , { field: '计量单位代码', title: '计量单位代码', width: 125 }
                        , { field: '计量单位', title: '计量单位', width: 125 }
                        , { field: 'HWHSonID', title: 'HWHSonID', width: 200, hide: true }
                        , { field: '发料仓库代码', title: '发料仓库代码', width: 125 }
                        , { field: '发料仓库', title: '发料仓库', width: 125 }
                        , { field: 'HSPID', title: 'HSPID', width: 200, hide: true }
                        , { field: '仓位代码', title: '仓位代码', width: 125 }
                        , { field: '仓位', title: '仓位', width: 125 }
                        , { field: '应发数量', title: '应发数量', width: 125 }
                        , { field: '实发数量', title: '实发数量', width: 125 }
                        , { field: '单价', title: '单价', width: 125 }
                        , { field: '金额', title: '金额', width: 125 }
                        , { field: '设计寿命', title: '设计寿命', width: 125 }
                        , { field: '累积使用寿命', title: '累积使用寿命', width: 125 }
                        , { field: '剩余寿命', title: '剩余寿命', width: 125 }
                        , { field: '关联数量', title: '关联数量', width: 125 }
                        , { field: '表体备注', title: '表体备注', width: 125 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 125 }
                        , { field: '制单人', title: '制单人', width: 125 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 125 }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 125 }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 125 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 125 }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '行关闭人', title: '行关闭人', width: 125 }
                        , { field: '关闭类型', title: '关闭类型', width: 125 }
                        , { field: '源单主内码', title: '源单主内码', width: 200, hide: true }
                        , { field: '源单子内码', title: '源单子内码', width: 200, hide: true }
                        , { field: '源单单号', title: '源单单号', width: 125 }
                        , { field: '源单类型', title: '源单类型', width: 125 }
                    ]]
                };
                ////设置列宽
                //var colWidth = getColumnsWidth();
                //if (colWidth == "" || colWidth == []) {
                //}
                //else {
                //    $.each(columns, function (x, m) {
                //        m["width"] = colWidth[x];
                //    });
                //}
            }
            ////#region èŽ·å–åˆ—å®½
            //function getColumnsWidth() {
            //    var result = [];
            //    var colNum = $(".layui-table-header").find("tr").eq(0).find("th").length;
            //    //获取列宽
            //    $.ajax({
            //        url: GetWEBURL() + '/tb_CellWidth/GetMouldScrapInHouseCellWidthList',
            //        async: false,
            //        type: "Get",
            //        dataType: "json",
            //        data: { "colNum": colNum, "Name": Name },
            //        success: function (data1) {
            //            if (data1.code == 1) {
            //                result = data1.data;
            //            }
            //            else if (data1.code == -1) {
            //            }
            //            else {
            //                layer.alert(data1.Message, { icon: 5 });
            //            }
            //        }, error: function (e) {
            //            layer.alert(e.Message, { icon: 5 });
            //        }
            //    });
            //    return result;
            //}
            ////#endregion
            //#region åŠ è½½ç½‘æ ¼
            function get_Display(sWhere) {
                //加载网格
                var index = layer.load(0);//遮罩
            //进入页面显示的缓存列表
            $.ajax({
                url: GetWEBURL() + '/Sc_MouldOtherInBill/GetMouldOtherInBillList',
                type: "GET",
                data: { "sWhere": sWhere},
                success: function (data1) {
                    if (data1.count == 1) {
                        option.data = data1.data;
                        table.render(option);
                        layer.close(index);
                    } else {
                        layer.close(index);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Sc_MouldOtherInBill/GetMouldOtherInBillList',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                }, error: function () {
                    layer.close(index);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
                });
            }
            //#endregion
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'btn-Add':
                        //页面层-自定义
                        layer.open({
                            type: 2,
                            skin: 'layui-layer-rim', //加上边框
                            title: '新增模具领用单',
                            closeBtn: 1,
                            shift: 2,
                            area: ['100%', '100%'],
                            maxmin: true,
                            content: '../模治具管理/Sc_MouldOtherInBill.html',
                            end: function () {
                                //刷新页面,
                                location.reload();
                            },
                            success: function (layero, index) {
                            }
                        });
                        break;
                    case 'btn-Edit':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
                            var hID = data[0].hmainid.toString();
                            //if (AllowLoadData(sSubStr) != false) {//非空验证
                            layer.open({
                                type: 2
                                , area: ['100%', '100%']
                                , title: '编辑模具领用单'
                                , closeBtn: 1
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: '../模治具管理/Sc_MouldOtherInBill.html?hID=' + hID
                                , resize: false,
                                end: function () {
                                    //刷新页面,
                                    location.reload();
                                }
                                , cancel: function () {
                                    //$(".layui-btn").removeClass("layui-btn-disabled");
                                }
                            })
                        } else {
                            layer.msg('请选择一行数据编辑!');
                        }
                        break;
                    case 'btn-Delete':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
                            var HItemID = data[0].HItemID.toString();
                            //逻辑删除方法
                            layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                                $.ajax({
                                    type: "GET",
                                    url: GetWEBURL() + "Sc_ICMOReportBill/DeltetICMOReportBill", //方法所在页面和方法名
                                    data: { "HItemID": HItemID },
                                    success: function (result) {
                                        if (result.count == 1) {
                                            layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                                // å¾—到frame索引
                                                var index = layer.getFrameIndex(window.name);
                                                //关闭当前frame
                                                layer.close(index);
                                                //修改为功后刷新界面
                                                window.location.reload();
                                            });
                                        } else {
                                            layer.alert(result.code + result.Message, { icon: 5 });
                                        }
                                    }, error: function () {
                                        layer.alert("接口请求失败!", { icon: 5 });
                                    }
                                });
                            })
                        }
                        else {
                            layer.msg('请选择一行数据删除!');
                        }
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            });
            ////进入页面显示的缓存列表
            //$.ajax({
            //    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
            //    url: GetWEBURL() + '/Sc_MouldProdOutBill/GetMouldProdOutBill',
            //    type: "GET",
            //    data: { "sWhere": sWhere},
            //    success: function (data1) {
            //        if (data1.count == 1) {
            //            option.data = data1.data;
            //            table.render(option);
            //            layer.close(index);
            //        } else {
            //            layer.close(index);
            //            layer.alert(data1.code + data1.Message, { icon: 5 });
            //        }
            //    }, error: function () {
            //        layer.close(index);
            //        layer.alert("接口请求失败!", { icon: 5 });
            //    }
            //});
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery(table, option) {
                var Status = $("select[name='Status']").val();//状态
                var HDate = $("#HBeginDate").val();//开始日期
                var HDate1 = $("#HEndDate").val();//结束日期
                var HBillNo = $("#HBillNo").val(); //单据号
                if (Status) {
                    switch (Status) {
                        case '-1':   //全部
                            sWhere += "";
                            break;
                        case '0':    //未审核
                            sWhere += " and å®¡æ ¸äºº=''";
                            break;
                        case '1':    //已审核
                            sWhere += " and å®¡æ ¸äºº<>''";
                            break;
                        case '2':    //已关闭
                            sWhere += " and å…³é—­äºº<>''";
                        default:
                    }
                }
                var HBillNo = $("#HBillNo").val();//单据号
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HDate + "'";
                }
@@ -345,286 +361,49 @@
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                var index = layer.load(0);
                get_Display(sWhere);
                //调用接口后清空sWhere缓存
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶
            function set_ClearQuery() {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#HBillNo").val("");//单据号
                sWhere = "";
            }
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶
            function set_ClearQuery() {
                $('#Status').find("option[value='-1']").attr("selected", true);
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HBillNo").val("");
            }
            //#endregion
            //#region æ–°å¢ž
            function set_AddNew() {
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    area: ['100%', '100%'],
                    title: '模具其他入库单-新增',
                    shift: 0,
                    content:'../模治具管理/Sc_MouldOtherInBill.html',
                    end: function () {
                        //刷新页面,
                        location.reload();
                    }
                });
            //#region åˆ·æ–°
            function get_Refresh() {
                set_ClearQuery();
                get_Display(sWhere);
            }
            //#endregion
            //修改按钮
            function set_ShowBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var hID = data[0].hmainid.toString();
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '模具其他入库单'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['Sc_MouldOtherInBill.html?HInterID=' + data[0].hinterid + '&HType=Modify', 'yes']
                        , resize: false,
                        end: function () {
                            //刷新页面
                            location.reload();
                        }
                        , cancel: function () {
                        }
                    })
                }
                else {
                    layer.msg('请选择一行数据编辑!');
                }
            }
            ////监听行双击事件
            //table.on('rowDouble(mainTable)', function (obj) {
            //    layer.alert("双击事件", { icon: 1 });
            //});
            //删除
            function set_DeleteBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                var ModRightNameDelete = 'Sc_MouldOtherInBill_Delete'
                var data = obj.data //获得当前行数据
                    , layEvent = obj.event; //获得 lay-event å¯¹åº”的值
                layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "Sc_ICMOReportBill/DeltetICMOReportBill", //方法所在页面和方法名
                        data: { "HItemID": checkStatus.data[0].HItemID, "User": sessionStorage["HUserName"], "ModRightNameDelete": ModRightNameDelete },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    window.location.reload();
                                });
                            }
                            else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                })
            }
            //#endregion
            //laydate.render({
            //    elem: '#HDate'
            //    , type: 'datetime'
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
            //#region å®¡æ ¸
            function set_CheckBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Sc_ICMOReportBill/AuditProcessReportList", //方法所在页面和方法名
                        data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    $("#btnSearch").trigger('click');
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据审核!');
                }
            }
            //#endregion
            //#region åå®¡æ ¸
            function set_AbandonCheck() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Sc_ICMOReportBill/AuditProcessReportList", //方法所在页面和方法名
                        data: { "HInterID": InterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    $("#btnSearch").trigger('click');
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据反审核!');
                }
            }
            //#endregion
            //#region é¢„览
            function get_PrintReport() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    layer.alert("我是打印按钮!单据主ID是:" + InterID);
                    //window.open("../生产工序管理/工序汇报单/HBarPlanPrint.html?linterid=" + linterid + "&Type=HDepartMent" + "&OpenTmp=b");
                    window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + InterID + "&Type=HDepartMent" + "&OpenTmp=b");
                }
                else {
                    layer.msg('请选择一行数据打印!');
                }
            }
            //#endregion
            //#region ä¿å­˜åˆ—宽
            function set_SaveGridColWidth() {
                var arr = [];
                // åˆ—æ•°
                var colNum = $(".layui-table-header").find("tr").eq(0).find("th").length;
                for (var i = 0; i <= colNum; i++) {
                    var colName = $(".layui-table-header").find("tr").eq(0).find("th").eq(i).text();
                    var colWidth = $(".layui-table-header").find("tr").eq(0).find("th").eq(i).width();
                    if (colName != "" && colName != null) {
                        arr.push(colWidth == -1 ? 200 : colWidth);
                    }
                }
                arr.unshift(40); //首位追加
                $.ajax({
                    url: GetWEBURL() + '/tb_CellWidth/GetMouldScrapInHouseCellWidth',
                    async: false,
                    type: "POST",
                    dataType: "json",
                    data: { "myMap": JSON.stringify(arr), "Name": Name },
                    success: function (data1) {
                        if (data1.count == 1) {
                            layer.alert(data1.Message, { icon: 1 });
                        } else {
                            layer.alert(data1.Message, { icon: 5 });
                        }
                    }, error: function (e) {
                        layer.alert(e.Message, { icon: 5 });
                    }
                });
                //设置赋值列宽
                var colWidth = getColumnsWidth();
                if (colWidth == "" || colWidth == []) {
                }
                else {
                    $.each(columns, function (x, m) {
                        m["width"] = colWidth[x];
                    });
                }
                location.reload();
            }
            //#endregion
            //#region é»˜è®¤åˆ—宽
            function set_DefaultGridColWidth() {
                var arr = [];
                // åˆ—æ•°
                var colNum = $(".layui-table-header").find("tr").eq(0).find("th").length;
                for (var i = 0; i <= colNum; i++) {
                    var colName = $(".layui-table-header").find("tr").eq(0).find("th").eq(i).text();
                    if (colName != "" && colName != null) {
                        arr.push(200);   //默认宽度200
                    }
                }
                arr.unshift(40); //首位追加
                $.ajax({
                    url: GetWEBURL() + '/tb_CellWidth/GetMouldScrapInHouseCellWidth',
                    async: false,
                    type: "POST",
                    dataType: "json",
                    data: { "myMap": JSON.stringify(arr), "Name": Name },
                    success: function (data1) {
                        if (data1.count == 1) {
                        } else {
                            layer.alert(data1.Message, { icon: 5 });
                        }
                    }, error: function (e) {
                        layer.alert(e.Message, { icon: 5 });
                    }
                });
                //设置赋值列宽
                var colWidth = getColumnsWidth();
                if (colWidth == "" || colWidth == []) {
                }
                else {
                    $.each(columns, function (x, m) {
                        m["width"] = colWidth[x];
                    });
                }
                //get_FastQuery(table, option);
                location.reload();
            }
            //#endregion
            //以上是layui模块
        });
    </script>
</body>
</html>
WebTM/views/³µ¼ä¹ÜÀí/¹¤ÐòÁ÷ת¿¨/Sc_ProcessExchangeBillList.html
@@ -85,15 +85,6 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>预览</button>-->
                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-confirm" id="btn_confirm"><i class="layui-icon layui-icon-ok-circle"></i>确认</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back" id="btn_back"><i class="layui-icon layui-icon-close-fill"></i>驳回</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>详情</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></i>生成送货单</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button>-->
                            </div>
                        </script>
                    </form>
@@ -122,6 +113,7 @@
                , element = layui.element
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util
            //var sWhere = " äº§å“ä»£ç  = 'BX0002'";
            var sWhere = "";
            var option = "";
@@ -148,7 +140,6 @@
                    //删除
                    case 'set_DeleteBill': set_DeleteBill();
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
@@ -171,6 +162,7 @@
                get_FastQuery();
            });
            //#endregion
            //#region æœ¬é¡µé¢æ‰€æœ‰è¢«è°ƒç”¨çš„æ–¹æ³•
            function set_ClearBill() {
                //初始化主表列表
@@ -190,7 +182,7 @@
                $("#HDate1").val("");//结束日期
                $("#HOrderProcNO").val("");//订单跟踪号
                $("#SHname").val("");//物料|子件名称|子件规格
                $("#btnSearch").click();
                //$("#btnSearch").click();
                sWhere = "";
            }
            //#endregion
@@ -307,6 +299,7 @@
            table.on('row(mainTable)', function (obj) { //注:tool æ˜¯å·¥å…·æ¡äº‹ä»¶åï¼Œtest æ˜¯ table åŽŸå§‹å®¹å™¨çš„å±žæ€§ lay-filter="对应的值"
                var datas = obj.data; //获得当前行数据
                var HMainID = datas.hmainid;
                var wait = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/LEMS/MES_Sc_ProcessExchangeBillQuerySub_Json',
                    type: "GET",
@@ -315,10 +308,13 @@
                        if (data1.count == 1) {
                            option2.data = data1.data;
                            table.render(option2);
                            layer.close(wait);
                        } else {
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                            layer.close(wait);
                        }
                    }, error: function () {
                        layer.close(wait);
                        layer.alert("接口失效!", { icon: 5 });
                    }
                });
@@ -333,14 +329,21 @@
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , page: true
                    , height: 256
                    , height: 300
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        //{ field: 'hmainid', title: 'hmainid', width: 90 }
                        , { field: '打印次数', title: '打印次数' }
                        , { field: '类型', title: '类型' }
                        , { field: '日期', title: '日期', width: 120, sort: true }
                        , {
                            field: '日期', title: '日期', width: 120, sort: true, templet: function (d) {
                                if (d.日期 == null) {
                                    return "";
                                }
                                return util.toDateString(d.日期, "yyyy-MM-dd");
                            }
                        }
                        , { field: '订单跟踪号', title: '订单跟踪号', width: 120 }
                        , { field: '单据号', title: '单据号', width: 190 }
                        //, { field: 'hicmointerid', title: 'hicmointerid', width: 80 }
@@ -397,7 +400,7 @@
                    elem: '#mainTable2'
                    //, toolbar: '#toolbarDemo'
                    , page: true
                    , height: 226
                    , height: 300
                    , cellMinWidth: 90
                    , cols: [[