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
| --[[
| 编码: GT-122-30
| 名称:
| 作者:
| 日期:2025-04-22
|
| 函数: AfterChangeType
| 功能:
|
| 更改记录:
|
| --]]
|
| json = require("json")
| mobox = require("OILua_JavelinExt")
| m3 = require( "oi_base_mobox" )
| function AfterChangeType( strLuaDEID )
| local nRet, strRetInfo
| -- 获取参数
| nRet, strRetInfo = mobox.getCurEditDataObjAttr(strLuaDEID, "S_TYPE")
| if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! " .. strRetInfo) end
| lua.Debug(strLuaDEID, debug.getinfo(1), 'strRetInfo', strRetInfo)
| local obj_attrs = json.decode(strRetInfo)
| local type = obj_attrs[1].value
|
| local setAttr = ''
| local action = {}
| if(type == '指定巷道移库')then
| setAttr = '[{"attr":"S_START_LOC","show":false},{"attr":"S_END_LOC","show":false},{"attr":"S_ITEM_CODE","show":true},{"attr":"S_BATCH_NO","show":true},{"attr":"S_START_ROADWAY","show":true},{"attr":"S_END_ROADWAY","show":true},{"attr":"N_QTY","show":true}]'
| else
| setAttr = '[{"attr":"S_START_LOC","show":true},{"attr":"S_END_LOC","show":true},{"attr":"S_ITEM_CODE","show":false},{"attr":"S_BATCH_NO","show":false},{"attr":"S_START_ROADWAY","show":false},{"attr":"S_END_ROADWAY","show":false},{"attr":"N_QTY","show":false}]'
| end
|
| action.action_type = "set_dlg_attr_show"
| action.value = json.decode(setAttr)
| nRet, strRetInfo = mobox.setAction(strLuaDEID, '[' .. lua.table2str(action) .. ']')
| if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "setAction失败! " .. strRetInfo) end
| end
|
|