TotalLINK学习
程序员文章站
2022-07-03 17:21:16
学习FormBuilder1.菜单创建1.查询父菜单2.3.创建菜单2.将菜单挂出来1.进入角色维护1.双击该角色将勾勾勾选1.查看该子菜单3.需求4.实现1.新建付款信息基础模型SELECT [DOCNUM] -- 自动获取 FUKUAN#LINK_THISMONTH4##LINKNUM# ,[FORMTYP] --LINKFORM.FUKUAN ,[STR01] AS CONTRACTNO...
学习FormBuilder
1.菜单创建
1.查询父菜单
2.
3.创建菜单
2.将菜单挂出来
1.进入角色维护
1.双击该角色
将勾勾勾选
1.查看该子菜单
3.需求
4.实现
1.新建付款信息
- 基础模型
SELECT
[DOCNUM] -- 自动获取 FUKUAN#LINK_THISMONTH4##LINKNUM#
,[FORMTYP] --LINKFORM.FUKUAN
,[STR01] AS CONTRACTNO --合同号
,[STR02] AS PAYMENTNO -- 付款单号
,[STR03] AS PROPOSER --申请人
,[NUM01] AS PRICE --金额
,[DAT01] -- 付款日期
,[CREUSER] --创建人
,[CREDATE] --创建时间
FROM [LINKFORMH]
WHERE FORMTYP = 'FUKUAN'
AND DOCNUM LIKE '%{0}%';
- 新建附加模型500
{
"title":"#MENUTITLE#",
"path":"/#PARENTNO#/#DMCODE##DMNUM#",
"code":"#DMCODE#",
"num":"#DMNUM#",
"num2":"10",
"icon":"user",
"column":[
{
"text":"文档编号",
"value":"DOCNUM"
},
{
"text":"合同号",
"value":"CONTRACTNO"
},
{
"text":"付款金额",
"value":"PRICE"
},
{
"text":"付款日期",
"value":"DAT01"
},
{
"text":"付款单号",
"value":"PAYMENTNO"
},
{
"text":"申请人",
"value":"PROPOSER"
}
],
"href":"DOCNUM",
"addBtn":true,
"hidden":false,
"tip":"输入单据号模糊搜索",
"redirect":"",
"para":"",
"attach":""
}
- 网页效果
2.新建付款详情
- 基础模型
SELECT [LINKROWID]
,[DOCNUM]
,[FORMTYP]
,[STR01] AS CONTRACTNO --合同号
,[STR02] AS PAYMENTNO -- 付款单号
,[STR03] AS PROPOSER --申请人
,[NUM01] AS PRICE --金额
,[DAT01] -- 付款日期
,[CREUSER] --创建人
,[CREDATE] --创建时间
FROM [LINKFORMH]
WHERE FORMTYP = 'FUKUAN' AND DOCNUM = '{0}'
UNION ALL
SELECT
newID() [LINKROWID]
,'#LINKDOCNUM(,FUKUAN)#' [DOCNUM]
,'FUKUAN' [FORMTYP]
,'' CONTRACTNO --合同号
,'' PAYMENTNO -- 付款单号
,'' PROPOSER --申请人
,0 PRICE --金额
,CONVERT(VARCHAR(10),GETDATE(),23) [DAT01] -- 付款日期
,'#LOGIN_USER#' [CREUSER] --创建人
,GETDATE() [CREDATE] --创建时间
WHERE '{0}' = '';
- 记录编辑
--LINKADDNEWROWS
MERGE
INTO
LINKFORMH T
USING (
SELECT N'@DOCNUM@' DOCNUM, --文档编号
N'FUKUAN' FORMTYP, --类型
N'#LOGIN_USER#' CREUSER, --创建人
N'付款信息' MANAGER, --付款信息
N'@CONTRACTNO@' STR01, --合同号
N'@PAYMENTNO@' STR02, --付款单号
N'@PROPOSER@' STR03, --申请人
N'@DAT01@' DAT01, -- 付款日期
0@PRICE@ NUM01, --付款金额
GETDATE() CREDATE) S
ON (S.DOCNUM = T.DOCNUM)
WHEN MATCHED THEN
UPDATE SET
T.FORMTYP = S.FORMTYP,
T.MANAGER=S.MANAGER,
T.STR01=S.STR01,
T.STR02=S.STR02,
T.STR03=S.STR03,
T.DAT01=S.DAT01,
T.NUM01=S.NUM01
WHEN NOT MATCHED THEN
INSERT(DOCNUM,
FORMTYP,
CREUSER,
CREDATE,
MANAGER,
STR01,
STR02,
STR03,
DAT01,
NUM01)
VALUES(S.DOCNUM,
S.FORMTYP,
S.CREUSER,
S.CREDATE,
S.MANAGER,
S.STR01,
S.STR02,
S.STR03,
S.DAT01,
S.NUM01);
- 添加记录
--LINKADDNEWROWS
MERGE
INTO
LINKFORMH T
USING (
SELECT N'@DOCNUM@' DOCNUM, --文档编号
N'FUKUAN' FORMTYP, --类型
N'#LOGIN_USER#' CREUSER, --创建人
N'付款信息' MANAGER, --付款信息
N'@CONTRACTNO@' STR01, --合同号
N'@PAYMENTNO@' STR02, --付款单号
N'@PROPOSER@' STR03, --申请人
N'@DAT01@' DAT01, -- 付款日期
0@PRICE@ NUM01, --付款金额
GETDATE() CREDATE) S
ON (S.DOCNUM = T.DOCNUM)
WHEN MATCHED THEN
UPDATE SET
T.FORMTYP = S.FORMTYP,
T.MANAGER=S.MANAGER,
T.STR01=S.STR01,
T.STR02=S.STR02,
T.STR03=S.STR03,
T.DAT01=S.DAT01,
T.NUM01=S.NUM01
WHEN NOT MATCHED THEN
INSERT(DOCNUM,
FORMTYP,
CREUSER,
CREDATE,
MANAGER,
STR01,
STR02,
STR03,
DAT01,
NUM01)
VALUES(S.DOCNUM,
S.FORMTYP,
S.CREUSER,
S.CREDATE,
S.MANAGER,
S.STR01,
S.STR02,
S.STR03,
S.DAT01,
S.NUM01);
- 删除记录
DELETE FROM LINKFORMH WHERE DOCNUM = '#DOCNUM#';
DELETE FROM LINKWFDOC WHERE SRCKEY = '#DOCNUM#';
- 新建附加模型500
{
"DOCNUM":"#DOCNUM#",
"FORMTYP":"#FORMTYP#",
"CONTRACTNO":"#CONTRACTNO#",
"PAYMENTNO":"#PAYMENTNO#",
"PROPOSER":"#PROPOSER#",
"PRICE":"#PRICE#",
"DAT01":"#DAT01#",
"CREUSER":"#CREUSER#",
"CREDATE":"#CREDATE#"
}
- 附加模型500参数
{
"formtemplate":"MOD201200001",
"formData":"#FORMDATA#",
"selectData":{},
"tableData":{
"TABLE_1": {
"dmCode": "LINKFORM.FUKUAN",
"dmNum": "20",
"Para": [
"#DOCNUM#"
]
}
},
"formbtns": [
{
"id":1588234409788,
"text":"保存",
"type":"btn",
"action":[
{
"code":"LINKFORM.FUKUAN",
"num":"10",
"api":"1",
"para":"formData",
"script":"2"
},
{
"code":"LINKFORM.FUKUAN",
"num":"10",
"api":"5",
"para":"{DOCNUM}"
}
],
"size":false,
"select":false,
"multiple":false,
"column":[],
"fileList":[],
"disabled":false,
"hidden":false,
"before":{
"form":true,
"table":[]
},
"after":{
"mode":false,
"btnHide":[],
"btnNotEdit":[],
"status":"SAVED"
},
"icon":"save",
"async": false
},
{
"id":1588234408968,
"text":"删除",
"type":"btn",
"action":[
{
"code":"LINKFORM.FUKUAN",
"num":"10",
"api":"1",
"script":"3",
"para":"formData"
}
],
"size": false,
"select": false,
"multiple": false,
"column": [],
"fileList": [],
"disabled": false,
"hidden": false,
"before": {
"form": false,
"table": [],
"confirm": "此操作将删除该记录, 是否继续?"
},
"after": {
"mode": false,
"btnHide": [],
"btnNotEdit": [],
"close": true
},
"icon": "delete"
},
{
"id":1588841863094,
"text":"上传文件",
"type":"upload",
"action":[],
"size":false,
"select":false,
"multiple":false,
"column":[],
"fileList":[],
"disabled":false,
"hidden":false,
"before":{
"form":false,
"table":[]
},
"after":{
"mode":false,
"btnHide":[],
"btnNotEdit":[]
},
"code":"LINKFORM.FUKUAN",
"num":"20",
"script":"1",
"para":"formData"
}
]
}
- 网页样式
2.新建上传单据附件
- 基础模型
SELECT
L.SRCKEY DOCNUM, --主表来源
L.DOCKEY, --文档编号
L.DOCTYP, --文档类型
L.DOCNAM text, --文档名称
L.DOCDES, --文档描述
CASE WHEN L.DOCDIR!='' THEN '#LINKSERVER#/Files/Upload/'+L.DOCDIR ELSE '' END name , --路径
L.CREDAT, --创建时间
L.CREUSR--创建人
FROM LINKWFDOC L
WHERE L.SRCTYP= 'FUKUAN' AND L.SRCKEY = '{0}'
ORDER BY CREDAT;
- 记录编辑
--LINKADDNEWROWS
--LINKAUTOREPLACEEMPTYCOLUMNS
MERGE
INTO
LINKWFDOC T
USING (
SELECT
N'FUKUAN' SRCTYP,
'#DOCNUM#' SRCKEY,
'#LINKUPLOADFILEKEY#' DOCKEY,
'#LINKUPLOADFILETYPE#' DOCTYP,
'#LINKUPLOADFILENAME#' DOCNAM,
N'@DOCDES@' DOCDES,
'#LINKUPLOADFILEPATH#' DOCDIR,
'#LOGIN_USER#' CREUSR,
GETDATE() CREDAT) S ON
( S.DOCKEY = T.DOCKEY AND S.SRCTYP=T.SRCTYP AND S.SRCKEY = T.SRCKEY)
WHEN MATCHED THEN
UPDATE
SET
DOCNAM = S.DOCNAM,
DOCDES = S.DOCDES
WHEN NOT MATCHED THEN
INSERT
(SRCTYP,
SRCKEY,
DOCKEY,
DOCTYP,
DOCNAM,
DOCDES,
DOCDIR,
CREDAT,
CREUSR,
UPDDAT,
UPDUSR)
VALUES (
S.SRCTYP,
S.SRCKEY,
S.DOCKEY,
S.DOCTYP,
S.DOCNAM,
S.DOCDES,
S.DOCDIR,
S.CREDAT,
S.CREUSR,
NULL,
NULL) ;
- 删除记录
DELETE FROM LINKWFDOC where DOCKEY = '#DOCKEY#'
- 新建附加模型500模型
{
"DOCNUM":"#DOCNUM#",
"text":"#text#",
"DOCDES":"#DOCDES#",
"name":"#name#",
"CREUSR":"#CREUSR#",
"CREDAT":"#CREDAT#",
"DOCKEY":"#DOCKEY#"
}
- 网页样式
本文地址:https://blog.csdn.net/m0_50972281/article/details/110632337