upgrade
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPNewFollowTask:TRBasePanel
|
||||
---@class TRPNewFollowTask:TRBasePanel
|
||||
local TRPNewFollowTask = class("TRPNewFollowTask", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
@@ -14,6 +14,7 @@ function TRPNewFollowTask:init(csObj)
|
||||
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132, 0)
|
||||
---@type UIScrollView
|
||||
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
|
||||
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength
|
||||
---@type UITable
|
||||
uiobjs.Table = getCC(uiobjs.scrollView.transform, "Table", "UITable")
|
||||
---@type CLUIFormRoot
|
||||
@@ -39,7 +40,7 @@ function TRPNewFollowTask:initFiledsAttr()
|
||||
|
||||
attr = {}
|
||||
attr.attrName = "预约时间"
|
||||
attr.id = "FollowUpTime"
|
||||
attr.id = "bookingTime"
|
||||
attr.attrType = DBCust.FieldType.dateTime
|
||||
attr.ifTime = 1
|
||||
attr.ifMust = 1
|
||||
@@ -61,12 +62,19 @@ end
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPNewFollowTask
|
||||
function TRPNewFollowTask:setData(paras)
|
||||
self.mdata = {}
|
||||
self.mdata.custId = paras.custId
|
||||
self.mdata.taskId = paras.taskId
|
||||
self.mdata.loginNo = NetProto.loginNo
|
||||
if paras and paras.taskId then
|
||||
self.mdata = paras
|
||||
self.isNewFollow = false
|
||||
else
|
||||
self.mdata = {}
|
||||
self.mdata.custId = paras.custId
|
||||
self.mdata.taskId = paras.taskId
|
||||
self.mdata.loginNo = NetProto.loginNo
|
||||
|
||||
self.isNewFollow = true
|
||||
self.mdata.bookingTime = DateEx.nowString()
|
||||
|
||||
self.isNewFollow = true
|
||||
end
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
@@ -95,7 +103,11 @@ function TRPNewFollowTask:showBaseFields()
|
||||
-- 工单模板
|
||||
filedInfor = {}
|
||||
filedInfor.attr = v
|
||||
filedInfor.isEditMode = true
|
||||
if self.isNewFollow then
|
||||
filedInfor.showMode = _FieldMode.inputOnly
|
||||
else
|
||||
filedInfor.showMode = _FieldMode.showOnly
|
||||
end
|
||||
if filedInfor.attr.attrType == DBCust.FieldType.multext then
|
||||
filedInfor.onMultTextInputChg = self:wrapFunc(self.reposition)
|
||||
end
|
||||
@@ -125,7 +137,7 @@ end
|
||||
function TRPNewFollowTask:setExtendFieldsMode(root)
|
||||
local elements = root:GetComponentsInChildren(typeof(CLUIElement), true)
|
||||
for i = 0, elements.Length - 1 do
|
||||
self:setElementMode(elements[i])
|
||||
-- self:setElementMode(elements[i])
|
||||
if elements[i].jsonKey == "followUpContent" then
|
||||
---@type CLUIElement
|
||||
uiobjs.followUpContent = elements[i]
|
||||
@@ -204,13 +216,16 @@ function TRPNewFollowTask:setEventDelegate()
|
||||
end
|
||||
self.mdata = uiobjs.DetailFromRoot:getValue(self.mdata, true)
|
||||
showHotWheel()
|
||||
NetProto.send.create_followUp_task(self.mdata, function(content)
|
||||
hideHotWheel()
|
||||
if content.success then
|
||||
MyUtl.toastS("创建成功")
|
||||
hideTopPanel(self.csSelf)
|
||||
NetProto.send.create_followUp_task(
|
||||
self.mdata,
|
||||
function(content)
|
||||
hideHotWheel()
|
||||
if content.success then
|
||||
MyUtl.toastS("创建成功")
|
||||
hideTopPanel(self.csSelf)
|
||||
end
|
||||
end
|
||||
end)
|
||||
)
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user