fy36
2025-05-30 d63516d67a13061977c1c7851f069f8c5a438466
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
49
50
--[[
    编码: WMS-28-12
    名称: 盘点单-新增窗口-选盘点计划后
    作者:HAN  
    日期:2025-1-29
 
    级别:固定
    
    函数: AfterSelectCountPlan
 
    功能:
        在货品查询面板中选中一个货品后
 
    更改记录:
 
--]]
 
wms_base = require ("wms_base")
 
function AfterSelectCountPlan ( strLuaDEID )
    local nRet, strRetInfo, select_dataobj
 
    nRet, select_dataobj = m3.GetSysInputParameter( strLuaDEID ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "获取选中数据对象属性失败! "..select_dataobj ) end 
    local cp_no = lua.Get_StrAttrValue( select_dataobj.S_CP_NO )
    local total_cntr_num = lua.Get_NumAttrValue( select_dataobj.N_PLAN_TOTAL )
    local acc_count_num = lua.Get_NumAttrValue( select_dataobj.N_ACC_COUNT )
 
    if ( cp_no == "") then 
        lua.Error( strLuaDEID, debug.getinfo(1), "计划盘点号不能为空! " ) 
    end
 
    -- 未盘点数量
    local num = total_cntr_num - acc_count_num
 
    local action = {
        {
            action_type = "set_dlg_attr",
            value = {
                    { attr = "PC_CNTR_Num", value = num },
                    { attr = "S_CP_NO", value = cp_no },
                    { attr = "CNTR_Num", value = num }
            }
        }
    }
 
    nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action)  )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end     
 
end