Jianw
2025-05-13 3b39fe3810c3ee2ec9ec97236c1769c5c85e062c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--[[
    编码: JX-83-12
    名称: 容器料格-加货品-确定后
    作者:HAN  
    日期:2025-1-29
 
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: ClickOK
 
    功能:
        在货品查询面板中选中一个货品后
 
    更改记录:
 
--]]
 
jx_base= require( "jx_base" )
 
function ClickOK ( strLuaDEID )
    local nRet, strRetInfo, input_attrs
    local input_attrs
 
    nRet, input_attrs = m3.GetSysCurEditDataAttrs( strLuaDEID )
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..input_attrs ) end 
    lua.Debug( strLuaDEID, debug.getinfo(1), "input_attrs", input_attrs)
 
    local cg_detail = m3.AllocObject(strLuaDEID,"CG_Detail")
 
    cg_detail.cntr_code = input_attrs.S_CNTR_CODE
    cg_detail.cell_no = input_attrs.S_CELL_NO
    cg_detail.item_code = input_attrs.S_ITEM_CODE
    cg_detail.item_name = input_attrs.S_ITEM_NAME
    cg_detail.qty = lua.StrToNumber( input_attrs.Qty )
 
    nRet, batch_no = jx_base.Generate_Batch_No( cg_detail.item_code )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "生成批次号失败! "..batch_no ) end 
 
    cg_detail.batch_no = batch_no
    cg_detail.volume = lua.StrToNumber( input_attrs.Volume )
    cg_detail.weight = lua.StrToNumber( input_attrs.Weight )
 
    nRet, cg_detail = m3.CreateDataObj( strLuaDEID, cg_detail )
    if ( nRet ~= 0 ) then 
        lua.Error( strLuaDEID, debug.getinfo(1), 'mobox 创建【分拣单】对象失败!'..cg_detail ) 
    end    
 
end