王 垚
2021-10-13 a2cd6bd886c3cfc45e8e60972e838f99f0762425
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldScrapOutBill.html
@@ -63,16 +63,6 @@
                                                    <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="HSupName" id="HSupName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HSupID" id="HSupID" class="layui-input" value="" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="Customer" 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">
@@ -118,6 +108,26 @@
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">往来类型</label>
                                                <div class="layui-input-inline">
                                                    <select name="HSupTypeID" id="HSupTypeID" class="layui-input" value="" style="float:left;width:150px">
                                                        <option value="1">供应商</option>
                                                        <option value="2">客户</option>
                                                        <option value="3">车间部门</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">往来单位</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HSupName" id="HSupName" readonly class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HSupID" id="HSupID" class="layui-input" value="0" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HSupList" 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="HSourceBillType" id="HSourceBillType" class="layui-input" value="" style="float:left;width:150px;">
@@ -129,6 +139,9 @@
                                                    <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">
@@ -231,9 +244,30 @@
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            function getSupType() {
                var type = $("#HSupTypeID").val();
                console.log(type)
                switch (type) {
                    case '1':
                        return "SupplierInformation";
                        break;
                    case '2':
                        return "CustomerInformation";
                        break;
                    case '3':
                        return "DeptInformation";
                        break;
                }
            }
            //表头信息往来单位弹窗
            form.on('submit(Customer)', function () {
            form.on('submit(HSupList)', function () {
                debugger;
                if ($("#HSupTypeID").val() == 0 || $("#HSupTypeID").val() == null) {
                    return layer.msg('请选择往来类型');
                }
                //页面层-自定义
                var url = '../../PublicPage/' + getSupType() + '.html';
                //alert(url);
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
@@ -242,7 +276,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/CustomerInformation.html', 'yes'],
                    content: [url, 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -254,7 +288,6 @@
                        }
                        $("#HSupName").val(checkStatus.data[0].HName);
                        $("#HSupID").val(checkStatus.data[0].HItemID);
                        //console.log("aa" + checkStatus.data[0].HName);//选中的值
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
@@ -269,7 +302,6 @@
                    }
                });
            });
            //表头信息负责人弹窗
            form.on('submit(ZRPerson)', function () {
                //页面层-自定义
@@ -516,7 +548,10 @@
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sMainSub = sMainStr + ';' + sSubStr + ';' + sessionStorage["HUserName"];
                if (!AllowLoadData(sSubStr))//数据验证
                {
                    return false;
                }
                $.ajax(
                    {
                        type: "POST",
@@ -576,8 +611,10 @@
                }
            });
            function f_alert(sMsg) {
                layer.alert(sMsg, { icon: 5 });
            }
            //#endregion
            //#region  æœ¬é¡µé¢æ‰€æœ‰è¢«è°ƒç”¨çš„æ–¹æ³•
@@ -602,15 +639,15 @@
                    , { field: 'HMaterName', title: '器具名称', edit: 'text', width: 100 }
                    , { field: 'HMaterSpec', title: '规格型号', edit: 'text', width: 100 }
                    , { field: 'HPropertyID', title: 'HPropertyID', edit: 'text', width: 100, hide: true }
                    , { field: 'HPropertyCode', title: '辅助属性代码', edit: 'text', event: 'HPropertyCode', width: 100 }
                    , { field: 'HPropertyName', title: '辅助属性名称', edit: 'text', width: 100 }
                    , { field: 'HPropertyCode', title: '辅助属性代码', edit: 'text', event: 'HPropertyCode', width: 120 }
                    , { field: 'HPropertyName', title: '辅助属性名称', edit: 'text', width: 120 }
                    , { 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: 'HSecUnitCode', title: '辅助计量单位代码', edit: 'text', event: 'HSecUnitCode', width: 120 }
                    , { field: 'HSecUnitName', title: '辅助计量单位名称', edit: 'text', width: 120 }
                    , { field: 'HSecUnitRate', 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: 'HUnitCode', title: '计量单位代码', edit: 'text', event: 'HUnitCode', width: 120 }
                    , { field: 'HUnitName', title: '计量单位名称', edit: 'text', width: 120 }
                    , { field: 'HBatchNo', title: '批次', edit: 'text', width: 100 }
                    , { field: 'HDesignLife', title: '设计寿命', edit: 'text', width: 100 }
                    , { field: 'HLeaveLife', title: '剩余寿命', edit: 'text', width: 100 }
@@ -619,8 +656,8 @@
                    , { 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: 'HWHCode', title: '发货仓库代码', edit: 'text', event: 'HWHCode', width: 120 }
                    , { field: 'HWHName', title: '发货仓库名称', edit: 'text', width: 120 }
                    , { 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 }
@@ -707,6 +744,9 @@
                                , "XDH": "0"                              //选单号
                                , "HExplanation": data.摘要              //摘要
                                , "HRemark": data.备注                    //备注
                                , "HSupTypeID": data.往来类型
                                , "HSupName": data.往来单位
                                , "HSupID": data.HSupID
                            });
                        } else {
@@ -1043,35 +1083,20 @@
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }
                            });
                        }
                        obj.event = "";
                        return false;
                    }
                })
            }
            // éžç©ºéªŒè¯
            function AllowLoadData(sSubStr) {  //非空验证
                var Result = true;
                return Result;
            }
            //#endregion
        });
        //非空验证
        function AllowLoadData(sSubStr) {  //非空验证
            var Result = true;
            if ($("#HSupID").val() == '' || $("#HSupID").val() == null) {
                layer.msg("往来单位不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return Result = false;
            }
            if ($("#HManagerID").val() == '' || $("#HManagerID").val() == null) {
                layer.msg("负责人不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return Result = false;
@@ -1086,6 +1111,10 @@
            }
            if ($("#HDeptID").val() == '' || $("#HDeptID").val() == null) {
                layer.msg("部门不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return Result = false;
            }
            if ($("#HSupID").val() == '' || $("#HSupID").val() == null) {
                layer.msg("往来单位不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return Result = false;
            }
            if (typeof (sSubStr) == "undefined" || sSubStr == "" || sSubStr == "[]") {
@@ -1115,7 +1144,6 @@
                        layer.msg("明细记录第" + (i + 1) + "行,发货仓库信息为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return Result = false;
                    }
                }
            }
            else {