| | |
| | | <div class="layui-btn-group"> |
| | | |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="HBarcodeSaverBox" id="HBarcodeSaverBox">生成条码</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="Exit">退出</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Print" id="Print">条码打印</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit" id="Exit">退出</button> |
| | | |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-xs3"> |
| | | <label class="layui-form-label">日期:</label> |
| | | <label class="layui-form-label" id="bt_HDate">日期:</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HDate" id="HDate" readonly="readonly" autocomplete="off" disabled> |
| | | </div> |
| | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-xs3"> |
| | | <label class="layui-form-label"> 供应商代码:</label> |
| | | <label class="layui-form-label" id="bt_HSupNumber"> 供应商代码:</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HSupNumber" lay-verify="HSupNumber" id="HSupNumber" readonly="readonly" autocomplete="off"> |
| | | <input id="HSupID" name="HSupID" type="hidden" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-xs3"> |
| | | <label class="layui-form-label"> 供 应 商:</label> |
| | | <label class="layui-form-label" id="bt_HSupName"> 供 应 商:</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HSupName" lay-verify="HSupName" id="HSupName" readonly="readonly" autocomplete="off"> |
| | | </div> |
| | |
| | | <script src="../../layuiadmin/Scripts/jquery-1.4.1.js" type="text/javascript"></script> |
| | | <script src="../../../../Scripts/webConfig.js"></script> |
| | | <script src="../../layuiadmin/Scripts/general.js"></script> |
| | | <script src="../../layuiadmin/MESLanguage.js"></script> |
| | | <!--<script src="../../../../Scripts/jquery-1.8.2.js"></script>--> |
| | | <script> |
| | | var HModName = "Gy_BarCodeBill"; |
| | | var HModName = "SRM_MaterialBarCodeBill"; |
| | | function f_alert(sMsg) { |
| | | layer.alert(sMsg, { icon: 5 }); |
| | | } |
| | |
| | | //}; |
| | | ////#endregion |
| | | |
| | | //#region 参数获取function |
| | | //#region 参数获取function |
| | | function getUrlVars() { |
| | | var vars = [], hash; |
| | | var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); |
| | |
| | | , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块 |
| | | |
| | | var option; |
| | | //FetchSupInfo(); |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | |
| | | , cols: [[ |
| | | { type: 'checkbox', fixed: 'left' } |
| | | , { field: 'HMaterID', title: '物料ID', width: 100, hide: true } |
| | | , { field: 'HItemID', title: 'ID', width: 100, hide: true } |
| | | , { field: 'HMaterNumber', title: '物料编码', width: 120 } |
| | | /* , { field: 'HOldMaterNumber', title: '旧物料编码', width: 120, hide: true }*/ |
| | | /* , { field: 'HOldMaterNumber', title: '旧物料编码', width: 120, hide: true }*/ |
| | | , { field: 'HMaterShortNumber', title: '物料代码', width: 120, hide: true } |
| | | /* , { field: 'HSubjoin', title: '物料代码', width: 120, hide: true }*/ |
| | | , { field: 'HSubjoin', title: '物料简称', width: 120, } |
| | | , { field: 'HMaterName', title: '物料名称', width: 120 } |
| | | , { field: 'HMaterModel', title: '规格型号', width: 120 } |
| | | , { field: 'HStatusMan', title: '工号', width: 120, edit: 'text' } |
| | | , { field: 'HQty', title: '本次生成条码数量', width: 135, edit: 'text', event: "inputHQty" } |
| | | , { field: 'HMinQty', title: '标准包装数(内箱装箱数)', width: 100, edit: 'text', event: "inputHMinQty" } |
| | | , { field: 'HBQty', title: '最小包装数(内箱数)', width: 100 } |
| | | , { field: 'HMinQty', title: '标准包装数(内箱装箱数)', width: 100, event: "inputHMinQty" } |
| | | , { field: 'HBQty', title: '最小包装数(内箱数)', width: 100 } |
| | | , { field: 'biaoqianzhangshu', title: '标签张数', width: 100 } |
| | | , { field: 'HBatchNo', title: '批号', width: 100, edit: 'text' } |
| | | , { field: 'HBatchNo', title: '批号', width: 100, edit: 'text', hide: true } |
| | | , { field: 'HBatchManager', title: '启用批号', width: 100, hide: true } |
| | | , { field: 'HISKFPERIOD', title: '是否启用保质期', width: 100, edit: 'text', hide: true } |
| | | , { field: 'HEXPUNIT', title: '保质期单位', width: 100, edit: 'text', hide: true } |
| | | , { field: 'HSourceBillType', title: '条码类型', width: 100, templet: '#barCodeTypeTpl' } |
| | | , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }//, event: "chooseHKFDate" |
| | | , { field: 'HKFPeriod', title: '保质期', width: 100,event:"inputHKFPeriod" }// |
| | | , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate' }//, event: "chooseHKFDQDate" |
| | | , { field: 'HSourceBillType', title: '条码类型', width: 100, templet: '#barCodeTypeTpl', hide: true } |
| | | , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate", hide: true }//, event: "chooseHKFDate" |
| | | , { field: 'HBarCodeDate', title: '条码日期', align: 'center', width: 150, data_field: 'HBarCodeDate', event: "chooseHBarCodeDate" } |
| | | , { field: 'HKFPeriod', title: '保质期', width: 100, event: "inputHKFPeriod", hide: true }// |
| | | , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', hide: true }//, event: "chooseHKFDQDate" |
| | | , { field: 'HSupID', title: '供应商ID', width: 150, hide: true } |
| | | , { field: 'HSupName', title: '供应商名称', width: 150, hide: true } |
| | | ]] |
| | |
| | | } |
| | | }); |
| | | //#endregion |
| | | |
| | | |
| | | //#region 初次赋值 |
| | | //进入页面查询表体物料信息 |
| | | if (mergeTags != 1) { |
| | |
| | | , { field: 'HSubjoin', title: '物料代码', width: 120, hide: true } |
| | | , { field: 'HMaterName', title: '物料名称', width: 120 } |
| | | , { field: 'HMaterModel', title: '规格型号', width: 120 } |
| | | , { field: 'HStatusMan', title: '工号', width: 120, edit: 'text' } |
| | | , { field: 'HQty', title: '本次生成条码数量', width: 135, edit: 'text', event: "inputHQty" } |
| | | , { field: 'HMinQty', title: '标准包装数(内箱装箱数)', width: 100, edit: 'text', event: "inputHMinQty" } |
| | | , { field: 'HMinQty', title: '标准包装数(内箱装箱数)', width: 100, event: "inputHMinQty" } |
| | | , { field: 'HBQty', title: '最小包装数(内箱数)', width: 100 } |
| | | , { field: 'biaoqianzhangshu', title: '标签张数', width: 100 } |
| | | , { field: 'HBatchNo', title: '批号', width: 100, edit: 'text' } |
| | | , { field: 'HBatchNo', title: '批号', width: 100, edit: 'text', hide: true } |
| | | , { field: 'HBatchManager', title: '启用批号', width: 100, hide: true } |
| | | , { field: 'HISKFPERIOD', title: '是否启用保质期', width: 100, edit: 'text', hide: true } |
| | | , { field: 'HEXPUNIT', title: '保质期单位', width: 100, edit: 'text', hide: true } |
| | | , { field: 'HSourceBillType', title: '条码类型', width: 100 } |
| | | , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }//, event: "chooseHKFDate" |
| | | , { field: 'HKFPeriod', title: '保质期', width: 100 }// |
| | | , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate' }//, event: "chooseHKFDQDate" |
| | | , { field: 'HBarCodeDate', title: '条码日期', align: 'center', width: 150, data_field: 'HBarCodeDate', event: "chooseHBarCodeDate" } |
| | | , { field: 'HSourceBillType', title: '条码类型', width: 100, hide: true } |
| | | , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate", hide: true }//, event: "chooseHKFDate" |
| | | , { field: 'HKFPeriod', title: '保质期', width: 100, hide: true }// |
| | | , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', hide: true }//, event: "chooseHKFDQDate" |
| | | , { field: 'HSupID', title: '供应商ID', width: 150, hide: true } |
| | | , { field: 'HSupName', title: '供应商名称', width: 150, hide: true } |
| | | |
| | |
| | | else { |
| | | //合并数量生成条码 |
| | | layer.load(3); |
| | | FetchSupInfo(); |
| | | $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | | $.ajax({ |
| | | type: "GET", |
| | |
| | | var data = data.data; |
| | | var rowdata = []; |
| | | |
| | | $("#HSupID").val(data[0].HSupID); |
| | | $("#HSupNumber").val(data[0].供应商代码); |
| | | $("#HSupName").val(data[0].供应商名称); |
| | | |
| | | for (var i = 0; i < data.length; i++) { |
| | | rowdata.push({ |
| | | "HMaterID": data[i].HItemID, |
| | | "HMaterID": data[i].MaterID, |
| | | "HItemID": data[i].HItemID, |
| | | "HMaterNumber": data[i].物料代码, |
| | | /* "HOldMaterNumber": "",*/ |
| | | /* "HOldMaterNumber": "",*/ |
| | | "HMaterShortNumber": "", |
| | | /*"HSubjoin": "",*/ |
| | | "HSubjoin": data[i].物料简称, |
| | | "HMaterName": data[i].物料名称, |
| | | "HMaterModel": data[i].规格型号, |
| | | "HMinQty": data[i].标准包装数, |
| | |
| | | "HSupID": data[i].HSupID, |
| | | "HSupName": data[i].供应商名称, |
| | | "HEXPUNIT": data[i].保质期单位, |
| | | "HQty": 1, // 默认生成条码数量 |
| | | "HQty": 0, // 默认生成条码数量 |
| | | "HBarCodeDate": data[i].条码日期, |
| | | "biaoqianzhangshu": 1 // 标签张数 |
| | | }); |
| | | } |
| | |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | //#endregion |
| | | |
| | | //调用页面标题翻译方法 |
| | | initFunction(1, HModName, sessionStorage["HTranSlate"]); |
| | | |
| | | form.on('submit(Exit)', function (data) {//退出 |
| | | var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引 |
| | | parent.layer.close(index); //再执行关闭 |
| | |
| | | } |
| | | }); |
| | | } |
| | | else if (obj.event == 'chooseHBarCodeDate') { |
| | | var field = $(this).data('field'); |
| | | laydate.render({ |
| | | elem: this.firstChild |
| | | , show: true //直接显示 |
| | | , closeStop: this |
| | | , done: function (value, date) { |
| | | data[field] = value; |
| | | obj.update(data); |
| | | } |
| | | }); |
| | | } |
| | | else if (obj.event == 'inputHKFPeriod') { |
| | | $(obj.tr).find(".layui-table-edit").keyup(function () { |
| | | var $input = $(this), val = $input.val(); |
| | |
| | | if (!val) val = "0"; |
| | | $input.val(val.replace(/[^\d*\.?\d*]/g, '')); |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | else if (obj.event == 'inputHMinQty') { |
| | | var $input = $(this), val = $input.val(); |
| | |
| | | var $input = $(this), val = $input.val(); |
| | | if (!val) val = "0"; |
| | | $input.val(val.replace(/[^\d*\.?\d*]/g, '')); |
| | | }); |
| | | }); |
| | | } |
| | | //外箱包装数事件,本页面暂时用不到 |
| | | //else if (obj.event == 'inputHWXQty') { |
| | |
| | | |
| | | |
| | | |
| | | table.on('edit(mainTable)', function (obj) { //注:edit是固定事件名,test是table原始容器的属性 lay-filter="对应的值" |
| | | var value = obj.value //得到修改后的值 |
| | | , data = obj.data //得到所在行所有键值 |
| | | , field = obj.field; //得到字段 |
| | | table.on('edit(mainTable)', function (obj) { //注:edit是固定事件名,test是table原始容器的属性 lay-filter="对应的值" |
| | | var value = obj.value //得到修改后的值 |
| | | , data = obj.data //得到所在行所有键值 |
| | | , field = obj.field; //得到字段 |
| | | |
| | | var HMinQty = 0; |
| | | var HWXQty = 0; |
| | | var HKFPeriod = 0; |
| | | var HWBQty = 0; |
| | | var HBQty = 0; |
| | | var biaoqianzhangshu = 0; |
| | | if (obj.data.HMinQty != undefined) { |
| | | HMinQty = parseFloat(obj.data.HMinQty); |
| | | } |
| | | if (obj.data.biaoqianzhangshu != undefined) { |
| | | biaoqianzhangshu = parseFloat(obj.data.biaoqianzhangshu); |
| | | } |
| | | if (obj.data.HWXQty != undefined) { |
| | | HWXQty = parseFloat(obj.data.HWXQty); |
| | | } |
| | | if (obj.data.HKFPeriod != undefined) { |
| | | HKFPeriod = parseFloat(obj.data.HKFPeriod); |
| | | } |
| | | if (obj.data.HWBQty != undefined) { |
| | | HWBQty = parseFloat(obj.data.HWBQty); |
| | | } |
| | | if (obj.data.HBQty != undefined) { |
| | | HBQty = parseFloat(obj.data.HBQty); |
| | | } |
| | | if (obj.data.HQty != undefined) { |
| | | HBQty = parseFloat(obj.data.HBQty); |
| | | } |
| | | //HMinQty 内箱包装数(标准包装数) |
| | | //HBQty 内箱数(最小包装数) |
| | | //HWXQty 外箱包装数 |
| | | //HWBQty 外箱数 HWBQty |
| | | //biaoqianzhangshu 标签shu |
| | | //HQty 本次生成条码数 |
| | | switch (field) { |
| | | case "HQty": |
| | | if (HMinQty == 0) |
| | | f_alert("注意:包装数为0!"); |
| | | else { |
| | | obj.update({ |
| | | biaoqianzhangshu: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.data.HMinQty)), |
| | | }); |
| | | } |
| | | |
| | | break; |
| | | case "HMinQty": //包装数 |
| | | if (HMinQty < 0) { |
| | | f_alert("包装数不能为负数!"); |
| | | } |
| | | if (HMinQty < HBQty) { |
| | | f_alert("标准包装数量不能小于最小包装数量!请重新输入!") |
| | | return; |
| | | } |
| | | else { |
| | | obj.update({ |
| | | biaoqianzhangshu: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)), |
| | | }); |
| | | var HMinQty = 0; |
| | | var HWXQty = 0; |
| | | var HKFPeriod = 0; |
| | | var HWBQty = 0; |
| | | var HBQty = 0; |
| | | var biaoqianzhangshu = 0; |
| | | if (obj.data.HMinQty != undefined) { |
| | | HMinQty = parseFloat(obj.data.HMinQty); |
| | | } |
| | | if (obj.data.biaoqianzhangshu != undefined) { |
| | | biaoqianzhangshu = parseFloat(obj.data.biaoqianzhangshu); |
| | | } |
| | | if (obj.data.HWXQty != undefined) { |
| | | HWXQty = parseFloat(obj.data.HWXQty); |
| | | } |
| | | if (obj.data.HKFPeriod != undefined) { |
| | | HKFPeriod = parseFloat(obj.data.HKFPeriod); |
| | | } |
| | | if (obj.data.HWBQty != undefined) { |
| | | HWBQty = parseFloat(obj.data.HWBQty); |
| | | } |
| | | if (obj.data.HBQty != undefined) { |
| | | HBQty = parseFloat(obj.data.HBQty); |
| | | } |
| | | if (obj.data.HQty != undefined) { |
| | | HBQty = parseFloat(obj.data.HBQty); |
| | | } |
| | | //HMinQty 内箱包装数(标准包装数) |
| | | //HBQty 内箱数(最小包装数) |
| | | //HWXQty 外箱包装数 |
| | | //HWBQty 外箱数 HWBQty |
| | | //biaoqianzhangshu 标签shu |
| | | //HQty 本次生成条码数 |
| | | switch (field) { |
| | | case "HQty": |
| | | if (HMinQty == 0) |
| | | f_alert("注意:包装数为0!"); |
| | | else { |
| | | obj.update({ |
| | | biaoqianzhangshu: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.data.HMinQty)), |
| | | }); |
| | | } |
| | | |
| | | } |
| | | break; |
| | | } |
| | | break; |
| | | case "HMinQty": //包装数 |
| | | if (HMinQty < 0) { |
| | | f_alert("包装数不能为负数!"); |
| | | } |
| | | if (HMinQty < HBQty) { |
| | | f_alert("标准包装数量不能小于最小包装数量!请重新输入!") |
| | | return; |
| | | } |
| | | else { |
| | | obj.update({ |
| | | biaoqianzhangshu: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)), |
| | | }); |
| | | |
| | | } |
| | | break; |
| | | } |
| | | |
| | | |
| | | }); |
| | | //#endregion |
| | | }); |
| | | //#endregion |
| | | |
| | | //#region 保存 |
| | | //#region 保存 |
| | | form.on('submit(HBarcodeSaverBox)', function (data) {//保存 |
| | | var a = 0; |
| | | var newArray = []; |
| | |
| | | |
| | | var sMainStr = JSON.stringify(data.field); |
| | | var sSubStr = JSON.stringify(table.cache['mainTable']); |
| | | var sMainSub = sMainStr + ';' + sSubStr; |
| | | var sMainSub = sMainStr + ';' + sSubStr + ';' + sessionStorage["HUserName"] + ';' + sessionStorage["OrganizationID"]; |
| | | var _sSubStr = JSON.parse(sSubStr); |
| | | for (var i = 0; i < _sSubStr.length; i++) { |
| | | if (_sSubStr[i].HQty > 0 && (_sSubStr[i].HMinQty == 0 || _sSubStr[i].HWXQty == 0)) { |
| | |
| | | // layer.msg("明细记录第" + (i + 1) + "行,本次生成条码数量不能超出未生成条码数量!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" }); |
| | | // return Result = false; |
| | | //} |
| | | |
| | | if (_sSubStr[i].HQty == 0) { |
| | | layer.msg("明细记录第" + (i + 1) + "行,生成条码数量不能为0!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" }); |
| | | return Result = false; |
| | | } |
| | | |
| | | if (_sSubStr[i].HQty > 0 && _sSubStr[i].HISKFPERIOD == 1 && (/*_sSubStr[i].HBatchNo == "" ||*/ _sSubStr[i].HKFDate == "")) { |
| | | layer.msg("明细记录第" + (i + 1) + "行,生产日期不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" }); |
| | | return Result = false; |
| | |
| | | |
| | | for (let i = 0; i < newArray.length; i++) { |
| | | //if (newArray[i].HQty > newArray[i].HNotBarcodeCount) { |
| | | if (newArray[i].HQty ) { |
| | | if (newArray[i].HQty) { |
| | | //layer.msg("编码:" + newArray[i].HMaterNumber + " 规格型号:" + newArray[i].HMaterModel + "<br>" + " 本次生成条码总数量超出剩余可生成条码数!" + "<br>" + " 本次生成总数量:" + newArray[i].HQty + " 可生成条码数量:" + newArray[i].HNotBarcodeCount, { icon: 5, btn: ['确认'], time: 10000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" }); |
| | | layer.msg("编码:" + newArray[i].HMaterNumber + " 规格型号:" + newArray[i].HMaterModel + "<br>" + " 本次生成条码总数量超出剩余可生成条码数!" + "<br>" + " 本次生成总数量:" + newArray[i].HQty , { icon: 5, btn: ['确认'], time: 10000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" }); |
| | | layer.msg("编码:" + newArray[i].HMaterNumber + " 规格型号:" + newArray[i].HMaterModel + "<br>" + " 本次生成条码总数量超出剩余可生成条码数!" + "<br>" + " 本次生成总数量:" + newArray[i].HQty, { icon: 5, btn: ['确认'], time: 10000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" }); |
| | | return Result = false; |
| | | } |
| | | } |
| | |
| | | , defaultToolbar: ['filter', 'exports'] |
| | | , limit: 500 |
| | | , cols: [[ |
| | | { field: 'HBarCode', title: '条码', width: 230, ellipsis: true } |
| | | { field: 'HLSH', title: '流水号', align: 'center', width: 150, data_field: 'HBarCodeDate' } |
| | | , { field: 'HBarCode', title: '条码', width: 230, ellipsis: true } |
| | | , { field: 'HMaterID', title: '物料ID', width: 100, hide: true } |
| | | , { field: 'HBarItemID', title: '条码ID', width: 100, hide: true } |
| | | , { field: 'HMaterNumber', title: '物料编码', width: 120 } |
| | | /* , { field: 'LSH', title: '流水号', width: 120 }*/ |
| | | /* , { field: 'HOldMaterNumber', title: '旧物料编码', width: 120, hide: true }*/ |
| | | , { field: 'HMaterShortNumber', title: '物料代码', width: 120, hide: true } |
| | | /* , { field: 'HSubjoin', title: '物料代码', width: 120, hide: true }*/ |
| | | , { field: 'HMaterName', title: '物料名称', width: 120 } |
| | | , { field: 'HSubjoin', title: '物料简称', width: 120 } |
| | | , { field: 'HMaterName', title: '物料名称', width: 120, hide: true } |
| | | , { field: 'HMaterModel', title: '规格型号', width: 120 } |
| | | , { field: 'HStatusMan', title: '工号', width: 120 } |
| | | , { field: 'HQty', title: '本次生成条码数量', width: 135 } |
| | | , { field: 'HMinQty', title: '标准包装数(内箱装箱数)', width: 100 } |
| | | , { field: 'HBQty', title: '最小包装数(内箱数)', width: 100 } |
| | | , { field: 'biaoqianzhangshu', title: '标签张数', width: 100 } |
| | | , { field: 'HBatchNo', title: '批号', width: 100 } |
| | | , { field: 'HBarCodeDate', title: '条码日期', align: 'center', width: 150, data_field: 'HBarCodeDate' } |
| | | , { field: 'HBatchNo', title: '批号', width: 100, hide: true } |
| | | , { field: 'HBatchManager', title: '启用批号', width: 100, hide: true } |
| | | , { field: 'HISKFPERIOD', title: '是否启用保质期', width: 100, hide: true } |
| | | , { field: 'HEXPUNIT', title: '保质期单位', width: 100, hide: true } |
| | | , { field: 'HSourceBillType', title: '条码类型', width: 100 } |
| | | , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150 }//, event: "chooseHKFDate" |
| | | , { field: 'HKFPeriod', title: '保质期', width: 100 }// |
| | | , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150 }//, event: "chooseHKFDQDate" |
| | | , { field: 'HSourceBillType', title: '条码类型', width: 100, hide: true } |
| | | , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, hide: true }//, event: "chooseHKFDate" |
| | | , { field: 'HKFPeriod', title: '保质期', width: 100, hide: true }// |
| | | , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, hide: true }//, event: "chooseHKFDQDate" |
| | | , { field: 'HSupID', title: '供应商ID', width: 150, hide: true } |
| | | , { field: 'HSupName', title: '供应商名称', width: 150, hide: true } |
| | | |
| | |
| | | var rowdata_1 = []; |
| | | |
| | | for (var i = 0; i < data.length; i++) { |
| | | |
| | | rowdata_1.push({ |
| | | "HMaterID": data[i].HItemID, |
| | | "HBarItemID": data[i].HBarItemID, |
| | | "HBarCode": data[i].HBarCode, |
| | | "HMaterNumber": data[i].物料代码, |
| | | "HMaterShortNumber": "", |
| | | "HMaterName": data[i].物料名称, |
| | | "HMaterModel": data[i].规格型号, |
| | | "HMinQty": data[i].标准包装数, |
| | | "HBQty": data[i].最小包装数, |
| | | "HSourceBillType": data[i].条码类型, |
| | | "HBatchNo": data[i].批号, |
| | | "HISKFPERIOD": data[i].是否启用保质期 == null ? 0 : data[i].是否启用保质期, |
| | | "HKFPeriod": data[i].保质期 == null ? 0 : data[i].保质期, |
| | | "HKFDQDate": data[i].有效期, |
| | | "HKFDate": data[i].生产日期, |
| | | "HBatchManager": data[i].是否启用批号, |
| | | "HSupID": data[i].HSupID, |
| | | "HSupName": data[i].供应商名称, |
| | | "HEXPUNIT": data[i].保质期单位, |
| | | "HQty":data[i].生成条码数量 , // 本次生成条码数量 |
| | | "biaoqianzhangshu": 1 |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | rowdata_1.push({ |
| | | "HMaterID": data[i].HMaterID, |
| | | "HBarItemID": data[i].HBarItemID, |
| | | /* "LSH": data[i].HBarItemID,*/ |
| | | "HBarCode": data[i].HBarCode, |
| | | "HMaterNumber": data[i].物料代码, |
| | | "HMaterShortNumber": "", |
| | | "HSubjoin": data[i].物料简称, |
| | | "HMaterName": data[i].物料名称, |
| | | "HMaterModel": data[i].规格型号, |
| | | "HMinQty": data[i].标准包装数, |
| | | "HBQty": data[i].最小包装数, |
| | | "HSourceBillType": data[i].条码类型, |
| | | "HBatchNo": data[i].批号, |
| | | "HISKFPERIOD": data[i].是否启用保质期 == null ? 0 : data[i].是否启用保质期, |
| | | "HKFPeriod": data[i].保质期 == null ? 0 : data[i].保质期, |
| | | "HKFDQDate": data[i].有效期, |
| | | "HKFDate": data[i].生产日期, |
| | | "HBatchManager": data[i].是否启用批号, |
| | | "HSupID": data[i].HSupID, |
| | | "HSupName": data[i].供应商名称, |
| | | "HEXPUNIT": data[i].保质期单位, |
| | | "HQty": data[i].生成条码数量, // 本次生成条码数量 |
| | | "biaoqianzhangshu": 1, |
| | | "HStatusMan": data[i].工号, |
| | | "HBarCodeDate": data[i].条码日期, |
| | | "HLSH": data[i].流水号, |
| | | }); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | // 更新表格数据 |
| | |
| | | } |
| | | }); |
| | | //#endregion |
| | | |
| | | // #region 成功条码展示 |
| | | //$.ajax({ |
| | | // type: "GET", |
| | | // url: GetWEBURL() + "/showHBarCodeBillDetail", |
| | | // async: true, |
| | | // data: { sMsg: lentryid, user: sessionStorage["Organization"] }, |
| | | // dataType: "json", |
| | | // success: function (data_1) { |
| | | // if (data_1.count != 0) { |
| | | // var data = data_1.data; |
| | | // var rowdata_1 = []; |
| | | // var IDdif = data[0].HItemID; |
| | | // for (var i = 0,k=1; i < data.length; i++,k++) { |
| | | // var totalQty = data[i].生成条码数量; // 总条码数 |
| | | // var standardQty = data[i].标准包装数; // 标准包装数 |
| | | // var labelCount = Math.ceil(totalQty / standardQty); // 计算标签数 |
| | | // var lastQty_sign = (totalQty % standardQty == 0) ? 0 : 1;//判断是否有余数 |
| | | |
| | | // if (k == labelCount && lastQty_sign==1) { |
| | | // rowdata_1.push({ |
| | | // "HMaterID": data[i].HItemID, |
| | | // "HBarCode": data[i].HBarCode, |
| | | // "HMaterNumber": data[i].物料代码, |
| | | // "HMaterShortNumber": "", |
| | | // "HMaterName": data[i].物料名称, |
| | | // "HMaterModel": data[i].规格型号, |
| | | // "HMinQty": standardQty , |
| | | // "HBQty": data[i].最小包装数, |
| | | // "HSourceBillType": data[i].条码类型, |
| | | // "HBatchNo": data[i].批号, |
| | | // "HISKFPERIOD": data[i].是否启用保质期 == null ? 0 : data[i].是否启用保质期, |
| | | // "HKFPeriod": data[i].保质期 == null ? 0 : data[i].保质期, |
| | | // "HKFDQDate": data[i].有效期, |
| | | // "HKFDate": data[i].生产日期, |
| | | // "HBatchManager": data[i].是否启用批号, |
| | | // "HSupID": data[i].供应商代码, |
| | | // "HSupName": data[i].供应商名称, |
| | | // "HEXPUNIT": data[i].保质期单位, |
| | | // "HQty": (totalQty % standardQty), // 本次生成条码数量 |
| | | // "biaoqianzhangshu": 1 |
| | | // }); |
| | | // k = 1; |
| | | // } |
| | | // else { |
| | | // rowdata_1.push({ |
| | | // "HMaterID": data[i].HItemID, |
| | | // "HBarCode": data[i].HBarCode, |
| | | // "HMaterNumber": data[i].物料代码, |
| | | // "HMaterShortNumber": "", |
| | | // "HMaterName": data[i].物料名称, |
| | | // "HMaterModel": data[i].规格型号, |
| | | // "HMinQty": standardQty, |
| | | // "HBQty": data[i].最小包装数, |
| | | // "HSourceBillType": data[i].条码类型, |
| | | // "HBatchNo": data[i].批号, |
| | | // "HISKFPERIOD": data[i].是否启用保质期 == null ? 0 : data[i].是否启用保质期, |
| | | // "HKFPeriod": data[i].保质期 == null ? 0 : data[i].保质期, |
| | | // "HKFDQDate": data[i].有效期, |
| | | // "HKFDate": data[i].生产日期, |
| | | // "HBatchManager": data[i].是否启用批号, |
| | | // "HSupID": data[i].供应商代码, |
| | | // "HSupName": data[i].供应商名称, |
| | | // "HEXPUNIT": data[i].保质期单位, |
| | | // "HQty": standardQty, // 本次生成条码数量 |
| | | // "biaoqianzhangshu": 1 |
| | | // }); |
| | | // } |
| | | |
| | | |
| | | } else { |
| | | layer.msg(data.Message); |
| | | } |
| | | |
| | | // } |
| | | |
| | | // option_Success.data = rowdata_1; |
| | | // table.render(option_Success); |
| | | |
| | | // } |
| | | // else { |
| | | // // $("#verifycode").click(); |
| | | // f_alert(data.Message); |
| | | // } |
| | | // layer.closeAll("loading"); |
| | | // }, |
| | | // error: function (err) { |
| | | // f_alert("错误:" + err); |
| | | // layer.closeAll("loading"); |
| | | // } |
| | | //}); |
| | | // #endregion |
| | | } |
| | | |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | f_alert("错误:" + err); |
| | | } |
| | | }); |
| | | return false; |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | f_alert("错误:" + err); |
| | | } |
| | | }); |
| | | return false; |
| | | }); |
| | | //#endregion |
| | | //#endregion |
| | | |
| | | //#region 打印 |
| | | //内箱打印 |
| | |
| | | //获取供应商ID |
| | | function FetchSupInfo() { |
| | | var sWhere = ""; |
| | | //var sWhere = " and 供应商名称 ='" + sessionStorage["HUserName"] + "'"; |
| | | var sWhere = " and 供应商名称 ='" + sessionStorage["HUserName"] + "'"; |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Gy_Supplier/list", |
| | | type: "GET", |