This commit is contained in:
2020-08-08 07:52:19 +08:00
parent 41747a05a1
commit f4958906c5
18 changed files with 83 additions and 71 deletions

View File

@@ -135,25 +135,35 @@ end
---public 显示扩展字段
function TRPNewCust:showExtentFiles(taskId)
---@type _ParamCellExtendFiledRoot
local param = {}
param.data = self.mdata and self.mdata.jsonStr or {}
param.onFinish = self:wrapFunc(self.setExtendFieldsMode)
param.fields = {}
local fields = DBCust.getFieldsByTask(taskId) or {}
---@type _ParamCellExtendFiled
local filedInfor
for i, v in ipairs(fields) do
filedInfor = {}
filedInfor.attr = v
filedInfor.showMode = self.isNewCust and _FieldMode.inputOnly or _FieldMode.modifyOnly
if not self.isNewCust then
filedInfor.onClick = self:wrapFunc(self.onClickInputField4Extend)
filedInfor.onSelect = self:wrapFunc(self.onPopupFieldValChg4Extend)
if #fields > 0 then
---@type _ParamCellExtendFiledRoot
local param = {}
param.data = self.mdata and self.mdata.jsonStr or {}
param.onFinish = self:wrapFunc(self.setExtendFieldsMode)
param.fields = {}
---@type _ParamCellExtendFiled
local filedInfor
for i, v in ipairs(fields) do
filedInfor = {}
filedInfor.attr = v
filedInfor.showMode = self.isNewCust and _FieldMode.inputOnly or _FieldMode.modifyOnly
if not self.isNewCust then
filedInfor.onClick = self:wrapFunc(self.onClickInputField4Extend)
filedInfor.onSelect = self:wrapFunc(self.onPopupFieldValChg4Extend)
end
table.insert(param.fields, filedInfor)
end
table.insert(param.fields, filedInfor)
SetActive(uiobjs.ExtendRoot.gameObject, true)
uiobjs.ExtendRoot:init(param, nil)
else
if uiobjs.ExtendRoot.luaTable then
uiobjs.ExtendRoot.luaTable.release()
end
SetActive(uiobjs.ExtendRoot.gameObject, false)
end
uiobjs.ExtendRoot:init(param, nil)
end
function TRPNewCust:reposition()
@@ -389,8 +399,10 @@ function TRPNewCust:setEventDelegate()
local cust = uiobjs.DetailRoot:getValue(true)
cust.phoneNo = cust._phoneNo
cust.customerLabel = self.mdata.customerLabel
local jsonStr = uiobjs.ExtendFormRoot:getValue(true)
cust.jsonStr = jsonStr
if uiobjs.ExtendFormRoot.gameObject.activeInHierarchy then
local jsonStr = uiobjs.ExtendFormRoot:getValue(true)
cust.jsonStr = jsonStr
end
showHotWheel()
NetProto.send.save_customer(
cust,