yusijie
2023-04-10 a36b843188c937617ce3dbdd5fd1dfd49de4cbe9
WebTM/views/²Ö´æ¹ÜÀí/ÌõÂëÉú³É/Gy_BarCodeBill.html
@@ -253,6 +253,10 @@
            //加载条码类型数据
            set_HBarCodeType();                      
            var rowdata = [{
                "HMaterID": 0, "HMaterCode": "", "HMaterNumber": "", "HMaterName": "", "HMaterModel": "", "HMaterSpec": "", "HBatchNo": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HBQty": 0, "HMinQty": 0, "HPackQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "", "HCoilNO": "", "HFurnaceNO": "", "HFactory": "",
                "HAuxQty": 0, "HheatNO": "", "HProduceDate": Format(new Date(), "yyyy-MM-dd"), "HExpiryDate": Format(new Date(), "yyyy-MM-dd"), "HExpirationDateFlag": 0
            }];
            //初始化表格
            set_InitGrid();
            set_CountGrid();
@@ -272,12 +276,7 @@
            else {
                layer.alert("未知操作类型!", { icon: 5 });
            }
            //#endregion
            var rowdata = [{
                "HMaterID": 0, "HMaterCode": "", "HMaterNumber": "", "HMaterName": "", "HMaterModel": "", "HMaterSpec": "", "HBatchNo": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "", "HCoilNO": "", "HFurnaceNO": "", "HFactory": "",
                "HAuxQty": 0, "HheatNO": "", "HProduceDate": Format(new Date(), "yyyy-MM-dd"), "HExpiryDate": Format(new Date(), "yyyy-MM-dd"), "HExpirationDateFlag": 0
            }];
            //#endregion
            //#region ç‚¹å‡»äº‹ä»¶ï¼ŒåŒ…括on和form事件
            //头工具栏
@@ -287,7 +286,7 @@
                var AddRow = table.cache['mainTable'];       
                var NewRow = {
                    "HMaterID": 0, "HMaterCode": "", "HMaterNumber": "", "HMaterName": "", "HMaterModel": "", "HMaterSpec": "", "HBatchNo": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "", "HCoilNO": "", "HFurnaceNO": "", "HFactory": "",
                    "HMaterID": 0, "HMaterCode": "", "HMaterNumber": "", "HMaterName": "", "HMaterModel": "", "HMaterSpec": "", "HBatchNo": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HBQty": 0, "HMinQty": 0, "HPackQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "", "HCoilNO": "", "HFurnaceNO": "", "HFactory": "",
                    "HAuxQty": 0, "HheatNO": "", "HProduceDate": Format(new Date(), "yyyy-MM-dd"), "HExpiryDate": Format(new Date(), "yyyy-MM-dd"), "HExpirationDateFlag": 0
                };                   
                //console.log(NewRow);
@@ -506,12 +505,14 @@
                                    HMaterID = result.list[0].HMaterID;
                                    HBatchNo = result.list[0].HBatchNo;
                                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                        BatchNoArray = result.list;  //获取批号,用来给批次按钮功能中的批号赋值
                                        for (let i = 0; i < result.list.length; i++) {
                                            result.list[i].HMinQty = '';//点击单元格的时候默认值0不会清除,客户看了会觉得很怪,所以先用空字符串取代;
                                            result.list[i].HQty = result.list[i].HQty.toString().match(/^\d+(?:\.\d{0,2})?/)[0]  //保留小数点后两位小数
                                        }
                                        BatchNoArray = result.list;  //获取批号,用来给批次按钮功能中的批号赋值
                                        //for (let i = 0; i < result.list.length; i++) {
                                        //    result.list[i].HMinQty = '';//点击单元格的时候默认值0不会清除,客户看了会觉得很怪,所以先用空字符串取代;
                                        //}
                                        table.reload('mainTable', {
                                            data: result.list // è°ƒç”¨table.reload é‡æ–°æ¸²æŸ“显示加载追加了数据的表格
                                        });
@@ -638,7 +639,7 @@
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        var arr = [{ HBillNo: '', HMaterNumber: checkStatus.data[0].物料代码, HMaterName: checkStatus.data[0].物料名称, HMaterModel: '', HAuxPropNumber: '', HAuxPropName: '', HUnitNumber: checkStatus.data[0].计量单位代码, HUnitName: checkStatus.data[0].计量单位, HBatchNo: '', HGiveAwayFlag: '0', HQty: checkStatus.data[0].数量, HMinQty: '0', HPackQty: '0', HBQty: '0', HDate: '', HCusNumber: '', HCusName: '', HSeOrderBillNo: '', HRemark: '' }]
                        var arr = [{ HBillNo: '', HMaterNumber: checkStatus.data[0].物料代码, HMaterName: checkStatus.data[0].物料名称, HMaterModel: '', HAuxPropNumber: '', HAuxPropName: '', HUnitNumber: checkStatus.data[0].计量单位代码, HUnitName: checkStatus.data[0].计量单位, HBatchNo: '', HGiveAwayFlag: '0', HQty: checkStatus.data[0].数量.toString("#0.00"), HMinQty: checkStatus.data[0].最小包装数, HPackQty: '0', HBQty: '0', HDate: '', HCusNumber: '', HCusName: '', HSeOrderBillNo: '', HRemark: '' }]
                        //同步更新表格和缓存对应的值
                        table.reload('mainTable', {
                            data: arr // è°ƒç”¨table.reload é‡æ–°æ¸²æŸ“显示加载追加了数据的表格
@@ -793,7 +794,7 @@
            function set_InitGrid() {
                columns = [
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 100 }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 75 }
                    , { field: 'HMainID', title: '源单主内码',  width: 100, hide: true }
                    , { field: 'HSubID', title: '源单子内码',  width: 100, hide: true }
                    , { field: 'HBillNo', title: '源单单号', width: 200 }
@@ -801,34 +802,32 @@
                    , { field: 'HMaterNumber', title: '物料代码', edit: 'text', event: 'HMaterNumber', width: 200 }
                    , { field: 'HMaterName', title: '物料名称',  width: 200 }
                    , { field: 'HMaterModel', title: '规格型号', width: 200 }
                    , { field: 'HBatchNo', title: '批号', edit: 'text', width: 100 }
                    , { field: 'HQty', title: '数量', edit: 'text', width: 100 }
                    , { field: 'HMinQty', title: '最小包装数', edit: 'text', width: 100 }
                    , { field: 'HBQty', title: '箱数', width: 100 }
                    , { field: 'HPackQty', title: '外箱数', edit: 'text', width: 100 }
                    , { field: 'HCoilNO', title: '钢卷捆包号', edit: 'text', width: 100 }
                    , { field: 'HFurnaceNO', title: '炉号', edit: 'text', width: 100 }
                    , { field: 'HFactory', title: '厂商', edit: 'text', width: 100 }
                    , { field: 'HCusID', title: '客户ID',  width: 100, hide: true }
                    , { field: 'HCusNumber', title: '客户代码', edit: 'text', event: 'HCusNumber', width: 120 }
                    , { field: 'HCusName', title: '客户名称', width: 120 }
                    , { field: 'HSeOrderBillNo', title: '销售订单号', width: 200 }
                    , { field: 'HRemark', title: '备注', edit: 'text', width: 100 }
                    , { field: 'HProduceDate', title: '生产日期', event: 'HProduceDate', width: 100 }
                    , { field: 'HExpiryDate', title: '保质期至', event: 'HExpiryDate', width: 100 }
                    , { field: 'HheatNO', title: '热处理', edit: 'text', width: 100 }
                    , { field: 'HAuxPropID', title: '辅助属性ID',  width: 100, hide: true }
                    , { field: 'HAuxPropNumber', title: '辅助属性代码', edit: 'text', event: 'HAuxPropNumber', width: 100 }
                    , { field: 'HAuxPropName', title: '辅助属性名称',  width: 100 }
                    , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                    , { field: 'HUnitNumber', title: '计量单位代码', edit: 'text', event: 'HUnitNumber', width: 100 }
                    , { field: 'HUnitName', title: '计量单位',width: 100 }
                    , { field: 'HBatchNo', title: '批号', edit: 'text', width: 100 }
                    , { field: 'HCoilNO', title: '钢卷捆包号', edit: 'text', width: 100 }
                    , { field: 'HFurnaceNO', title: '炉号', edit: 'text', width: 100 }
                    , { field: 'HFactory', title: '厂商', edit: 'text', width: 100 }
                    , { field: 'HAuxQty', title: '辅单位数量', edit: 'text', width: 100 }
                    , { field: 'HheatNO', title: '热处理', edit: 'text', width: 100 }
                    , { field: 'HProduceDate', title: '生产日期', event: 'HProduceDate', width: 100 }
                    , { field: 'HExpiryDate', title: '保质期至', event: 'HExpiryDate', width: 100 }
                    , { field: 'HExpirationDateFlag', title: '是否启用保质期', width: 100, templet: '#switchTp3', unresize: false }
                    , { field: 'HGiveAwayFlag', title: '是否赠品', width: 100, templet: '#switchTpl', unresize: false }
                    , { field: 'HQty', title: '数量', edit: 'text', width: 100 }
                    , { field: 'HMinQty', title: '最小包装数', edit: 'text', width: 100 }
                    , { field: 'HBQty', title: '箱数', width: 100 }
                    , { field: 'HPackQty', title: '外箱数', edit: 'text', width: 100 }
                    , { field: 'HDate', title: '进料日期',  width: 100 }
                    , { field: 'HCusID', title: '客户ID',  width: 100, hide: true }
                    , { field: 'HCusNumber', title: '客户代码', edit: 'text', event: 'HCusNumber', width: 120 }
                    , { field: 'HCusName', title: '客户名称', width: 120 }
                    , { field: 'HSeOrderBillNo', title: '销售订单号', width: 200 }
                    , { field: 'HRemark', title: '备注', edit: 'text', width: 100 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ];
                option = {
@@ -836,7 +835,7 @@
                    , elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , page: false
                    , cellMinWidth: 120
                    , cellMinWidth: 75
                    , height: 'full-325'
                    , cols: [columns]
                    , limit: 500 //每页默认显示的数量