| | |
| | | </button> |
| | | </div> |
| | | <div class="layui-col-xs4 layui-inline"> |
| | | <label class="layui-form-label">物料名称</label> |
| | | <label class="layui-form-label">物料简称</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" class="layui-input" name="HMaterName" id="HMaterName" onmouseover="this.title=this.value" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly> |
| | | <!--<input type="hidden" name="HSupID" id="HSupID" value="0">--> |
| | | <input type="hidden" name="HUserID" id="HUserID" value="0"> |
| | | |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-xs4 layui-inline"> |
| | | <label class="layui-form-label">物料名称</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" class="layui-input" name="HMaterName0" id="HMaterName0" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-xs4 layui-inline"> |
| | | <label class="layui-form-label">最小包装</label> |
| | | <div class="layui-input-inline"> |
| | |
| | | </div> |
| | | <div class="layui-col-xs4 layui-inline"> |
| | | <label class="layui-form-label">供应商代码</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" class="layui-input" name="HSupID" id="HSupID" readonly> |
| | | <div class="layui-input-inline" style="position: relative;"> |
| | | <input type="text" class="layui-input" name="HSupNumber" id="HSupNumber" readonly style="padding-right: 40px;"> |
| | | <input type="text" class="layui-input" name="HSupID" id="HSupID" style="display:none;"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchSupID" id="btnSearchSupID" style="position: absolute; right: 0; top: 0; bottom: 0; border-left: none; border-radius: 0 4px 4px 0; padding: 0 10px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-xs4 layui-inline"> |
| | |
| | | get_print(data); |
| | | }); |
| | | |
| | | //选择供应商弹窗 |
| | | form.on('submit(btnSearchSupID)', function () { |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['80%', '80%'] |
| | | , title: '供应商列表' |
| | | , shade: 0.6 //遮罩透明度 |
| | | //, maxmin: true //允许全屏最小化 |
| | | , anim: 0 //0-6的动画形式,-1不开启 |
| | | , content: ['../基础资料/Gy_Supplier_Material.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('请选择数据'); |
| | | } |
| | | $("#HSupNumber").val(checkStatus.data[0].供应商代码); |
| | | $("#HSupName").val(checkStatus.data[0].供应商名称); |
| | | $("#HSupID").val(checkStatus.data[0].HSupID); |
| | | layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的 |
| | | } |
| | | , btn2: function (index, layero) { |
| | | //按钮【按钮二】的回调 |
| | | //return false 开启该代码可禁止点击该按钮关闭 |
| | | }, |
| | | end: function () { |
| | | |
| | | }, |
| | | success: function (layero, index) { |
| | | |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | //物料校验 |
| | | form.on('submit(btnCheck)', function (data) { |
| | | get_MaterialCheck(0); |
| | |
| | | function set_ClearBill() { |
| | | $("#HMaker").val(sessionStorage["HUserName"]); |
| | | $("#HMakeTime").val(Format(new Date(), "yyyy-MM-dd")); |
| | | |
| | | //$("#HSupID").val(sessionStorage["HUserName"]); |
| | | $("#HUseFlag").val('true'); |
| | | $("#checkboxHUseFlag").prop("checked", true); |
| | | form.render('checkbox'); |
| | | FetchSupInfo(); |
| | | //$("#HCheckEmp").val(sessionStorage["HUserName"]); |
| | | //$("#HCheckTime").val(Format(new Date(), "yyyy-MM-dd")); |
| | |
| | | } |
| | | //非空验证 |
| | | function AllowLoadData(data) { |
| | | if ($("#HInBoxPackQty").val() < $("#HMinPackQty").val()) { |
| | | var checkValue = parseFloat($("#HInBoxPackQty").val()); |
| | | var checkValue_1 = parseFloat($("#HMinPackQty").val()); |
| | | |
| | | if (isNaN(checkValue) || isNaN(checkValue_1)) { |
| | | layer.alert("包装数必须为数字"); |
| | | return false; |
| | | } |
| | | |
| | | if (checkValue < checkValue_1) { |
| | | layer.alert("标准包装数不允许小于最小包装数"); |
| | | return false; |
| | | } |
| | | else |
| | | return true; |
| | | return true; |
| | | } |
| | | |
| | | //保存HMaker |
| | |
| | | return; |
| | | } |
| | | } |
| | | if ($("#HMaterID").val() == 0 || $("#HMaterID").val() == null || $("#HMaterID").val() == undefined) { |
| | | layer.msg("物料信息未校验成功,不允许保存!"); |
| | | return; |
| | | } |
| | | |
| | | var HMaterID = $('#HMaterNumber').val(); |
| | | var sMainStr = JSON.stringify(data.field); |
| | | var sMainStr = JSON.stringify(data.field) + ';' + sessionStorage["OrganizationID"]; |
| | | //var sMainSub = sMainStr + ";" + HMaterID; |
| | | var itID = $('#HitemID').val(); |
| | | var index = layer.load(); |
| | |
| | | $("#HMinPackQty").val(data[0]["最小包装数"]); |
| | | $("#HInBoxPackQty").val(data[0]["标准包装数"]); |
| | | $("#HOutBoxPackQty").val(data[0]["HOutBoxPackQty"]); |
| | | $("#HSupID").val(data[0]["供应商代码"]); |
| | | $("#HSupID").val(data[0]["HSupID"]); |
| | | $("#HSupNumber").val(data[0]["供应商代码"]); |
| | | $("#HSupName").val(data[0]["供应商名称"]); |
| | | $("#HMaker").val(data[0]["创建人"]); |
| | | $("#HCheckEmp").val(data[0]["审核人"]); |
| | |
| | | // 物料校验 |
| | | function get_MaterialCheck(param = 0) { |
| | | var HMaterNumber = $("#HMaterNumber").val(); |
| | | var HMaterID = $("#HMaterID").val(); |
| | | var user = sessionStorage["HUserName"]; |
| | | var OrganizationID = sessionStorage["OrganizationID"]; |
| | | var SupID = $("#HSupID").val(); |
| | | |
| | | $.ajax({ |
| | | type: "GET", |
| | |
| | | "HMaterID": HMaterNumber, |
| | | "user": user, |
| | | "param": param, |
| | | "OrganizationID": OrganizationID |
| | | "OrganizationID": OrganizationID, |
| | | "SupID": SupID |
| | | }, |
| | | success: function (data) { |
| | | var responseData = data; |
| | |
| | | return; |
| | | } |
| | | if (responseData === 1) { |
| | | layer.confirm('该物料已经被本供应商获取,是否继续?', { |
| | | layer.confirm('该物料已经被本供应商获取,是否确认启用并将历史的启用给取消?', { |
| | | icon: 3, |
| | | title: '提示' |
| | | }, function (index) { |
| | |
| | | }); |
| | | } else if (responseData.code === "1") { |
| | | |
| | | $("#HMaterName").val(responseData.data[0]["HName"]); |
| | | $("#HMaterName0").val(responseData.data[0]["HName"]); |
| | | $("#HMaterName").val(responseData.data[0]["HSubjoin"]); |
| | | $("#HModel").val(responseData.data[0]["HModel"]); |
| | | $("#HMaterID").val(responseData.data[0]["HItemID"]); |
| | | |
| | | |
| | | form.render('select'); |
| | | } else { |
| | | layer.msg(responseData.Message || "物料信息不存在", { time: 5000 }); |
| | |
| | | function FetchSupInfo() { |
| | | var sWhere = ""; |
| | | //var sWhere = " and 供应商名称 ='" + sessionStorage["HUserName"] + "'"; |
| | | if (sessionStorage["HSupIDs"].length < 1000) { |
| | | sWhere = " and HItemID in (" + sessionStorage["HSupIDs"] + ")"; |
| | | } |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Gy_Supplier/list", |
| | | type: "GET", |
| | |
| | | success: function (result) { |
| | | if (result.data.length > 0) { |
| | | $("#HSupName").val(result.data[0].供应商名称); |
| | | $("#HSupID").val(result.data[0].供应商代码); |
| | | $("#HSupNumber").val(result.data[0].供应商代码); |
| | | $("#HSupID").val(result.data[0].HItemID); |
| | | } else { |
| | | layer.msg("供应商信息未维护", { time: 5000 }); |
| | | } |