yusijie
2024-03-08 19e7ea150ffa02c3dd453f77932b04ae99010330
WebTM/views/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillList.html
@@ -580,6 +580,7 @@
                        , { field: 'HEntryID', title: 'HEntryID', sort: true, hide: true }
                        , { field: '日期', title: '日期', sort: true }
                        , { field: '单据号', title: '单据号', sort: true }
                        , { field: '单据状态', title: '单据状态', sort: true }
                        , { field: '产品代码', title: '产品代码', sort: true }
                        , { field: '产品名称', title: '产品名称', sort: true }
                        , { field: '客户', title: '客户', sort: true }
@@ -924,6 +925,25 @@
                if (checkStatus.data.length === 1) {
                    var hID = data[0].hmainid.toString();
                    var HEntryID = data[0].hsubid.toString();
                    //#region åˆ¤æ–­æºå•状态
                    var HSourceBillData = "";
                    var HSourceBillData = getSourceBillStatus_ICMOBill(hID);            //获取源单数据
                    if (HSourceBillData != "none") {
                        if (HSourceBillData.length == 0) {
                            layer.alert("保存失败!未查询到生产订单单据!", { icon: 5 });
                            return;
                        } else if (HSourceBillData[0]["单据状态"] != "已审核") {
                            var err = "保存失败!原因:生产订单单据状态为“" + HSourceBillData[0]["单据状态"] + "”,不允许下推生产订单变更单!";
                            layer.alert(err, { icon: 5 });
                            return;
                        }
                    } else {
                        return;
                    }
                    //#endregion
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
@@ -1931,6 +1951,28 @@
            
            //#endregion
            //#region èŽ·å–æºå•-生产订单单据状态
            function getSourceBillStatus_ICMOBill(ParamsInterID) {
                var HSourceBillData = "none";
                var sWhere = " and hmainid = " + ParamsInterID;
                $.ajax({
                    url: GetWEBURL() + '/LEMS/MES_IF_ICMOBillList_Json',
                    async: false,
                    type: "GET",
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            HSourceBillData = data1.data;
                        } else {
                            layer.alert(data1.code + "单据状态判断失败!", { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                return HSourceBillData;
            }
            //#endregion
            //以上是layui模块