智云srmLayUi(安瑞和瑞琪)(通用版本)
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBill_Edit.html
@@ -27,6 +27,7 @@
                                <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">保存</button>
                                <button type="button" id="aduit-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Aduit">审核</button>
                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Print">打印</button>
                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="ChooseSource">选源单</button>
                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">退出</button>
                            </div>
                        </div>
@@ -92,7 +93,7 @@
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                <div class="layui-col-xs3" style="display:none;">
                                                    <label class="layui-form-label"> 部    门:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HDeptName" lay-verify="HDeptName" id="HDeptName" readonly="readonly" autocomplete="off">
@@ -127,9 +128,9 @@
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HInnerBillNo" id="HInnerBillNo" autocomplete="off">
                                                    </div>
                                                </div>
                                                </div>
                                            </div>
                                        </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-row">
                                                <div class="layui-col-xs3">
@@ -145,9 +146,31 @@
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> 联系方式:</label>
                                                    <label class="layui-form-label"> 联系方式(收):</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HReceiveGoodsLink" id="HReceiveGoodsLink" autocomplete="off">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-row">
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> 送货人:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HSendGoodsMan" id="HSendGoodsMan" autocomplete="off">
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> 送货地址:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HSendGoodsAddr" id="HSendGoodsAddr" autocomplete="off">
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> 联系方式(送):</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HSendGoodsLink" id="HSendGoodsLink" autocomplete="off">
                                                    </div>
                                                </div>
                                            </div>
@@ -222,6 +245,7 @@
    <script src="../../layuiadmin/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <!--<script src="../../../../Scripts/jquery-1.8.2.js"></script>-->
    <script src="../../../../Scripts/webConfig.js"></script>
    <script src="../../layuiadmin/Scripts/general.js"></script>
    <script>
        function getUrlVars() {
            var vars = [], hash;
@@ -274,6 +298,9 @@
                $("#HManagerName").val(d.data[0].HManagerName);
                $("#HPURCHASEORGID").val(d.data[0].FPURCHASEORGID);
                $("#HPURCHASEORGName").val(d.data[0].HOrgName);
                $("#HReceiveGoodsMan").val(d.data[0].HReceiveGoodsMan);
                $("#HAddress").val(d.data[0].HAddress);
                //$("#HSendGoodsAddr").val(d.data[0].HPROVIDERADDRESS);
            }
        });
@@ -289,6 +316,7 @@
                , layer = layui.layer
                , laydate = layui.laydate
                , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块
            window.table = layui.table
            //常规用法
            laydate.render({
                elem: '#HDHDate'
@@ -296,7 +324,10 @@
            RoadHBillSub();
            layer.load(3)
            var HIsAduit = false;
            var HModName = "SRM_POInStockBill_Edit";
            window.HSubData = "";//全局变量
            var option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
@@ -314,26 +345,27 @@
                    , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                    , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                    , { field: 'FPrintCount', title: '打印条码数量', width: 120, hide: true }
                    , { field: 'HQty', title: '送货数量', width: 100, edit: 'text', event: "inputHQty" }
                    , { field: 'HQty', title: '送货数量*', width: 100, edit: 'text', event: "inputHQty" }
                    , { field: 'HRQty', title: '剩余可发货数量', width: 100 }
                    , { field: 'HSQty', title: '源单数量', width: 100 }
                    , { field: 'HBatchNo', title: '生产日期D/C', width: 120, edit: 'text' }
                    , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate", hide: true }
                    , { field: 'HBatchNo', title: '批号', width: 120, edit: 'text' }
                    , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }
                    , { field: 'HKFPeriod', title: '保质期', width: 100, hide: true }
                    , { field: 'HDate', title: '预计到货日期', align: 'center', width: 150, data_field: 'HDate', event: "chooseHDate", hide: true }
                    , { field: 'HPrice', title: '单价', width: 100, hide: true }
                    , { field: 'HMoney', title: '金额', width: 100, hide: true }
                    , { field: 'HRemark', title: '备注', width: 200, edit: true }
                    , { field: 'HTAXPRICE_T', title: '含税重量单价/吨', width: 200, edit: true, hide: true}
                    //, { field: 'HRemark', title: '备注', width: 100 }
                    , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                    , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                    , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                    , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                    , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                    , { field: 'HWWOrderBillNo', title: '委外订单号', width: 200 }
                    , { field: 'HWWOrderBillNo', title: '委外订单号', width: 200, hide: true }
                    , { field: 'HBillType', title: '单据类型', width: 100, hide: true }
                    , { field: 'HSourceBillType', title: '源单类型', width: 100, hide: true }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 200, hide: true }
                    , { field: 'HSupMaterNumber', title: '供应商料号', width: 200, edit: 'text' }
                    , { field: 'HSupBatchNo', title: '供应商批次', width: 200, edit: 'text' }
                    , { field: 'HExpressNumberSub', title: '物流单号', width: 200, edit: true, hide: true }//瑞琪,凯贝
@@ -484,7 +516,7 @@
                    //列设置
                    case 'set_HideColumn':
                        get_HideColumn();
                        break;
                        break;
                };
            });
            //监听行工具事件
@@ -588,9 +620,11 @@
                    success: function (result) {
                        if (result.count == 10000) {
                            for (let i = 0; i < result.data.length; i++) {
                                result.data[i].HBatchNo = result.data[i].HBatchNo.substring(0,6);
                                result.data[i].HBatchNo = result.data[i].HBatchNo.substring(0, 6);
                            }
                            ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
                            HSubData = ajaxReturnData;
                            console.log(ajaxReturnData);
                            table.reload('mainTable', {
                                data: ajaxReturnData
                                , height: 'full-10'
@@ -654,6 +688,7 @@
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // 说明验证成功了,
                                HIsAduit = true;
                                $('#aduit-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                layer.msg(data.Message, { icon: 1 });
                            }
@@ -667,7 +702,11 @@
                        }
                    });
            });
            form.on('submit(Print)', function (data) {//审核
            form.on('submit(Print)', function (data) {//打印
                if (HIsAduit == false) {
                    layer.msg("请审核送货单后在进行打印( ´◔︎ ‸◔︎`)", { icon: 5 });
                    return;
                }
                $.ajax(
                    {
                        type: "GET",
@@ -701,7 +740,24 @@
                        }
                    });
            });
            form.on('submit(Exit)', function (data) {//保存
            form.on('submit(ChooseSource)', function (data) {
                layer.open({
                    type: 2
                    , area: ['95%', '95%']
                    , title: '采购订单列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: false //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../views/SRM/SRM_POOrderBillList.html?Type=AddRow', 'yes']
                    , resize: false
                    //, cancel: function () {
                    //    $(".layui-btn").removeClass("layui-btn-disabled");
                    //}
                })
            });
            form.on('submit(Exit)', function (data) {//退出
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
            });
@@ -773,9 +829,14 @@
                        //    layer.msg("明细记录第" + (i + 1) + "行,批次为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        //    return Result = false;
                        //}
                        if (sSubStr[i].HBatchNo == "") {
                        if (sSubStr[i].HKFDate == "") {
                            //凯贝
                            layer.msg("明细记录第" + (i + 1) + "行,生产日期D/C为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            layer.msg("明细记录第" + (i + 1) + "行,生产日期为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return Result = false;
                        }
                        if (sSubStr[i].HKFDate > Format(new Date(), "yyyy-MM-dd")) {
                            //凯贝
                            layer.msg("明细记录第" + (i + 1) + "行,生产日期大于当前日期,请重新选择!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return Result = false;
                        }
                    }
@@ -907,6 +968,49 @@
            //}
        });
        function GetPoorderValue(obj) {
            var Batchno = Format(new Date(), "yyyy-MM-dd").replaceAll('-', '').substr(2,6);//6位数当前日期
            var HSubLen = HSubData.length + 1;
            var a = [];
            for (let i = 0; i < obj.length; i++) {
                var row_options = {
                    //"sorderid": HSubLen, "HPOOrderInterID": obj[i].hmainid, "HPOOrderEntryID": obj[i].hentryid, "HPOOrderBillNo": obj[i].单据号, "HWWOrderInterID": 0,
                    //"HWWOrderEntryID": 0, "HWWOrderDetaiLID": 0., "HWWOrderBillNo": '', "HBillType": "1102", "HBatchNo": obj[i].HBatchNo, "HMaterID": obj[i].hmaterid,
                    //"HMaterNumber": obj[i].物料代码, "HOldMaterNumber": obj[i].旧物料编码, "HMaterShortNumber": obj[i].物料编码, "HMaterName": obj[i].物料名称,
                    //"HMaterModel": obj[i].规格型号, "HUnitID": obj[i].hunitid, "HUnitNumber": obj[i].计量单位代码, "HUnitName": obj[i].计量单位, "HQty": obj[i].可发货数量,
                    //"HRQty": obj[i].可发货数量, "HSQty": obj[i].订单数量, "HPrice": obj[i].单价, "HMoney": obj[i].金额, "HDate": new Date(), "HKFDate": new Date(),
                    //"HKFPeriod": 0, "HSourceInterID": obj[i].hmainid, "HSourceEntryID": obj[i].hentryid, "HSourceBillType": "1102", "HSourceBillNo": obj[i].单据号,
                    //"HMTONO": obj[i].HBatchNo, "F_xbkf_Combo": '', "FSHDD": '', "FPrintCount": obj[i].打印条码数量, "HPlanArrivalDate": new Date()
                    "sorderid": HSubLen, "HPOOrderInterID": obj[i].hmainid, "HPOOrderEntryID": obj[i].hsubid, "HPOOrderBillNo": obj[i].订单单号, "HWWOrderInterID": 0,
                    "HWWOrderEntryID": 0, "HWWOrderDetaiLID": 0., "HWWOrderBillNo": '', "HBillType": "1102", "HBatchNo": Batchno, "HMaterID": obj[i].hmaterid,
                    "HMaterNumber": obj[i].物料代码, "HOldMaterNumber": obj[i].旧物料编码, "HMaterShortNumber": obj[i].物料编码, "HMaterName": obj[i].物料名称,
                    "HMaterModel": obj[i].规格型号, "HUnitID": obj[i].hunitid, "HUnitNumber": obj[i].计量单位代码, "HUnitName": obj[i].采购单位, "HQty": obj[i].未关联数量,
                    "HRQty": obj[i].未关联数量, "HSQty": obj[i].采购数量, "HPrice": obj[i].单价, "HMoney": obj[i].金额, "HDate": Format(new Date(), "yyyy-MM-dd"), "HKFDate": '',
                    "HKFPeriod": 0, "HSourceInterID": obj[i].hmainid, "HSourceEntryID": obj[i].hsubid, "HSourceBillType": "1102", "HSourceBillNo": obj[i].订单单号,
                    "HMTONO": obj[i].HBatchNo, "F_xbkf_Combo": '', "FSHDD": '', "FPrintCount": obj[i].打印条码数量, "HPlanArrivalDate": new Date(),
                    "HTAXPRICE_T": obj[i].含税重量单价吨
                };
                HSubData.push(row_options);
                HSubLen++;
                //var NewRow = {
                //    "HMTONO": "", "HMaterID": 0, "HMaterNumber": "", "HOldMaterNumber": "", "HMaterShortNumber": "", "HMaterName": 0, "HMaterModel": "", "HUnitName": "0", "HUnitNumber": "",
                //    "HUnitID": "0", "FPrintCount": "0", "HRQty": "0", "HSQty": "", "HBatchNo": "", "HKFDate": "", "HKFPeriod": "", "HDate": "", "HPrice": "", "HMoney": "", "HRemark": "", "HPOOrderInterID": "", "HPOOrderEntryID": "", "HPOOrderBillNo": "", "HWWOrderInterID": "", "HWWOrderEntryID": "", "HWWOrderBillNo": "", "HBillType": "", "HSourceBillType": "", "HSourceBillNo": "", "HSupMaterNumber": "", "HSupBatchNo": "", "HExpressNumberSub": "", "HExpressSupplierSub": "", "HPlanArrivalDate": "", "HBoxNumber": "", "HSourceInterID": "", "HSourceEntryID": ""
                //};
            };
            table.reload('mainTable', {
                data: HSubData
                , height: 'full-10'
                , loading: false
                , done: function (index, res) {
                    layer.closeAll("loading");
                }
            });
        }
    </script>
</body>
</html>