Jianw
2025-05-14 29f8b36ebb718d2051bf0e7e701973ec4419ee80
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
--[[
   编码: JX-31-13
   名称: 盘点差异-复盘
   作者:HAN
   日期:2025-03-01
 
   函数: RepeatCount_ClickOK
   功能:
        盘点差异点击复盘后弹出复盘站台,选中站台后点击“确定”按钮后执行的脚本
 
   更改记录:
 
--]]
wms_count = require( "wms_count" )
 
function ClickOK( strLuaDEID )
    local nRet, strRetInfo
    local objs, obj, n
 
    -- step1  获取输入的站点信息
    -- 改进测试
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "Station" ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo ) end 
    local obj_attrs = json.decode( strRetInfo ) 
    local station = lua.Get_StrAttrValue( obj_attrs[1].value )
 
    -- step2  获取当前[盘点差异]表中选中的盘点差异
    nRet, objs = m3.GetSysDataJson( strLuaDEID )
    if ( nRet ~=0 ) then lua.Error( strLuaDEID, debug.getinfo(1), objs ) end  
    -- [{"id":"","attrs":[{"attr":"","value":""},..]},..]
    local nCount = #objs
    if ( nCount == 0 ) then  return end
 
    local count_diff_ids = {}
    for n = 1, nCount do
        table.insert( count_diff_ids, objs[n].id )
    end
 
    nRet, strRetInfo = wms_count.Count_Diff_RepeatCount( strLuaDEID, station, count_diff_ids )
    if ( nRet ~= 0 ) then
        mobox.stopProgram( strLuaDEID, strRetInfo )
        return
    end
end