fy36
2025-05-14 a37aca60ff9914b0abb710f04118b22420f4f398
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
--[[
    编码: WMS-29-18
    名称: 盘点容器货品明细-3055 TOP-VIEW 初始化
    作者:HAN  
    日期:2025-1-29
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: InitialTopViewDlg
 
    应用:
        -- 用在【盘点】功能的页面中的顶部输入界面初始化时调用    
    功能:
        -- 获取当前登录人的账号和姓名
        -- 获取本机登录的 MAC 地址,这个在网页版是实现不了的,需要在MBC运行
 
    更改记录:
 
--]]
 
wms_base = require( "wms_base" )
 
function InitialTopViewDlg ( strLuaDEID ) 
    local nRet, strRetInfo
 
    -- 获取当前登录人员账号名称及PC绑定的站台
    local login_info
    nRet, login_info = wms_base.Get_CurLoginUserInfo( strLuaDEID )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), login_info ) end
    
    local strCondition = ""
    local nCount = 0            -- 未执行任务数量
 
    if ( login_info.station ~= '') then
        -- 获取可以进行盘点的 【盘点容器货品明细】
        -- 0 已经指派到站点还没到 N_B_STATE = 1 已经到站台 可盘点
        strCondition = "S_STATION_NO = '"..login_info.station.."' AND ( N_B_STATE = 0 OR N_B_STATE = 1)"        
        nRet, strRetInfo = mobox.getDataObjCount( strLuaDEID, "Count_CG_Detail", strCondition )
        if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1),  strRetInfo ) end 
        nCount = lua.StrToNumber( strRetInfo )             
    end
    local action =  {
        {
            action_type = "set_dlg_attr",
            value = {
                { attr = "Operator", value = login_info.user_name },
                { attr = "S_STATION_NO", value = login_info.station },
                { attr = "TaskCount", value = nCount },
            }
        }
    }
 
    if ( login_info.station ~= '') then
        strCondition = "S_STATION_NO = '"..login_info.station.."' AND N_B_STATE = 0" 
        action[2] = {
            action_type = "set_query_condition",
            value = {
                condition = strCondition,
                order = "S_CNTR_CODE",
                page_name = "未执行任务"
            }            
        }
    end
 
    lua.Debug( strLuaDEID, debug.getinfo(1), "action", action )
    nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action)  )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo ) end 
 
end