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
| --[[
| 编码: WMS-38-21
| 名称: 任务-PDA-人工搬运开始执行
| 作者:HAN
| 日期:2025-1-29
|
| 级别:固定 (说明本段代码在项目中不太会变化)
|
| 函数: TaskRun
|
| 功能:
| 设置人工搬运任务的状态为"执行"
|
| 更改记录:
|
|
| --]]
| wms_task = require( "wms_task" )
|
| function TaskRun ( strLuaDEID )
| local nRet, strRetInfo
| local task
|
| nRet, task = m3.GetSysCurEditDataObj( strLuaDEID, "Task" )
| if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..cg_detail ) end
|
| -- 任务的业务状态不等于0等待/1已推送 不能设置为执行
| -- 设置任务开始执行
| if ( task.bs_state ~= wms_base.Get_nConst(strLuaDEID,"任务状态-等待") and task.bs_state ~= wms_base.Get_nConst(strLuaDEID,"任务状态-已推送") ) then
| mobox.setInfo( strLuaDEID, "该任务的状态不是等待状态无法设置为执行")
| return
| end
|
| -- V2.0
| local strUserLogin, strUserName
| nRet, strUserLogin, strUserName = mobox.getCurUserInfo( strLuaDEID )
| if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前操作人员信息失败! "..strUserLogin ) end
|
| nRet, strRetInfo = wms_task.SetRunState( strLuaDEID, task, strUserLogin, strUserName )
| if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "wms_task.SetRunState失败: "..strRetInfo) end
|
| local strAction = '[{"action_type":"goback_to_pre_page","value":""}]'
| nRet, strRetInfo = mobox.setAction(strLuaDEID, strAction)
| if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction错误: "..strRetInfo) end
| end
|
|