This commit is contained in:
2020-07-19 12:52:05 +08:00
parent 30d5701d96
commit d92ad2ecca
33 changed files with 1689 additions and 769 deletions

View File

@@ -13,7 +13,7 @@ function CSPTasks.init(csObj)
csSelf = csObj
transform = csObj.transform
CSPTasks.setEventDelegate()
CSPTasks.contentRect = MyUtl.getUIContent(csSelf, 360+220+60)
CSPTasks.contentRect = MyUtl.getUIContent(csSelf, 360+220)
uiobjs.Content = getCC(transform, "PanelContent", "UIPanel")
uiobjs.Content.transform.localPosition = Vector3.zero

View File

@@ -244,6 +244,7 @@ function TRPCustDetail:setEventDelegate()
self:showRecords()
end,
ButtonNewFollow = function()
getPanelAsy("PanelNewFollow", onLoadedPanelTT, self.mdata)
end,
ButtonNewTask = function()
getPanelAsy("PanelNewFollowTask", onLoadedPanelTT, self.mdata)

View File

@@ -0,0 +1,223 @@
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPNewFollow:TRBasePanel 邮件列表
local TRPNewFollow = class("TRPNewFollow", TRBasePanel)
local uiobjs = {}
local stars = {}
-- 初始化,只会调用一次
function TRPNewFollow:init(csObj)
TRPNewFollow.super.init(self, csObj)
self:initFiledsAttr()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
---@type UITable
uiobjs.Table = getCC(uiobjs.scrollView.transform, "Table", "UITable")
---@type CLUIFormRoot
uiobjs.DetailFromRoot = getCC(uiobjs.Table.transform, "DetailRoot", "CLUIFormRoot")
uiobjs.DetailRoot = getCC(uiobjs.Table.transform, "DetailRoot", "CLCellLua")
---@type UITable
uiobjs.DetailRootTabel = uiobjs.DetailRoot:GetComponent("UITable")
uiobjs.ButtonSave = getChild(self.transform, "Top/ButtonSave")
end
function TRPNewFollow:initFiledsAttr()
---@type _ParamFieldAttr
local attr
self.baseFiledsAttr = {}
attr = {}
attr.attrName = "商机"
attr.id = ""
attr.attrType = DBCust.FieldType.popuplist
attr.ifMust = 1
attr.donotJoinKey = true
-- local popInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.followUpTypeList)
-- attr.popOptions = popInfor.options
-- attr.popValues = popInfor.values
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "跟进类型"
attr.id = "followUpType"
attr.attrType = DBCust.FieldType.popuplist
attr.ifMust = 1
attr.donotJoinKey = true
local popInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.followUpTypeList)
attr.popOptions = popInfor.options
attr.popValues = popInfor.values
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "跟时时间"
attr.id = ""
attr.attrType = DBCust.FieldType.dateTime
attr.ifMust = 1
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "客户名称"
attr.id = "custName"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 1
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "客户状态"
attr.id = "dealFlag"
attr.attrType = DBCust.FieldType.popuplist
attr.ifMust = 1
attr.donotJoinKey = true
local popInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.dealFlagList)
attr.popOptions = popInfor.options
attr.popValues = popInfor.values
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "跟进内容"
attr.id = "followUpContent"
attr.attrType = DBCust.FieldType.multext
attr.ifMust = 1
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
end
-- 设置数据
---@param paras _ParamTRPNewFollow
function TRPNewFollow:setData(paras)
self.mdata = {}
self.mdata.custId = paras.custId
self.mdata.taskId = paras.taskId
self.mdata.custName = paras.custName
self.isNewFollow = true
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPNewFollow:show()
self:refreshContent()
SetActive(uiobjs.ButtonSave.gameObject, self.isNewFollow)
uiobjs.scrollView:ResetPosition()
end
function TRPNewFollow:refreshContent()
self:showBaseFields()
self.csSelf:invoke4Lua(self:wrapFunc(self.reposition), 0.1)
end
function TRPNewFollow:showBaseFields()
---@type _ParamCellExtendFiledRoot
local param = {}
param.data = self.mdata or {}
param.onFinish = self:wrapFunc(self.reposition)
param.onLoadOneField = self:wrapFunc(self.onLoadOneField)
param.fields = {}
---@type _ParamCellExtendFiled
local filedInfor
for i, v in ipairs(self.baseFiledsAttr) do
-- 工单模板
filedInfor = {}
filedInfor.attr = v
filedInfor.isEditMode = true
if filedInfor.attr.attrType == DBCust.FieldType.multext then
filedInfor.onMultTextInputChg = self:wrapFunc(self.reposition)
end
filedInfor.onClick = nil
filedInfor.onSelect = self:wrapFunc(self.onPopupFieldValChg)
table.insert(param.fields, filedInfor)
end
uiobjs.DetailRoot:init(param, nil)
end
function TRPNewFollow:onLoadOneField(cell)
local el = cell:GetComponent("CLUIElement")
if el and el.jsonKey == "followUpContent" then
uiobjs.followUpContent = el
end
end
function TRPNewFollow:onPopupFieldValChg(go)
---@type CLUIElement
local el = go:GetComponent("CLUIElement")
if el.jsonKey == "dealFlag" then
if uiobjs.followUpContent and isNilOrEmpty(uiobjs.followUpContent.value) then
local popList = go:GetComponent("UIPopupList")
uiobjs.followUpContent.value = popList.selectedItem
end
end
end
function TRPNewFollow:reposition()
uiobjs.DetailRootTabel.repositionNow = true
uiobjs.Table.repositionNow = true
end
-- 刷新
function TRPNewFollow:refresh()
end
-- 关闭页面
function TRPNewFollow:hide()
if uiobjs.DetailRoot.luaTable then
uiobjs.DetailRoot.luaTable.release()
end
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPNewFollow:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
if cmd == NetProto.cmds.update_customer then
self:refreshContent()
end
end
end
function TRPNewFollow:setEventDelegate()
self.EventDelegate = {
ButtonSave = function()
local err = uiobjs.DetailFromRoot:checkValid()
if not isNilOrEmpty(err) then
MyUtl.toastW(err)
return
end
self.mdata = uiobjs.DetailFromRoot:getValue(self.mdata, true)
showHotWheel()
NetProto.send.create_followUp_record(
self.mdata,
function(content)
hideHotWheel()
if content.success then
MyUtl.toastS("保存成功")
hideTopPanel(self.csSelf)
end
end
)
end,
InputTask = function()
self:showExtentFiles(uiobjs.InputTask.value)
end
}
end
-- 处理ui上的事件例如点击等
function TRPNewFollow:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
end
end
-- 当顶层页面发生变化时回调
function TRPNewFollow:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPNewFollow

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c98e9d776c5a846e6af1289bdad59626
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -46,6 +46,9 @@ end
function TRPSetting:setEventDelegate()
self.EventDelegate = {
ButtonPersonInfor=function()
getPanelAsy("PanelMyInfor", onLoadedPanelTT)
end,
ButtonPassword = function()
getPanelAsy("PanelResetPasswordStep1", onLoadedPanelTT, {phone = Prefs.getUserName(), isModify = true})
end,