提交 63429034 编写于 作者: ibizdev's avatar ibizdev

xignzi006 发布系统代码

上级 3c640382
......@@ -54,6 +54,23 @@
}
]
},
{
"srfkey": "Contact__ShippingMethodCode",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "1",
"label": "Default Value",
"text": "Default Value",
"data":"",
"codename":"Item_1",
"value": "1",
"disabled": false
}
]
},
{
"srfkey": "YesNo",
"emptytext": "未定义",
......@@ -81,6 +98,53 @@
}
]
},
{
"srfkey": "Contact__FamilyStatusCode",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "3",
"label": "Divorced",
"text": "Divorced",
"data":"",
"codename":"Item_3",
"value": "3",
"disabled": false
}
, {
"id": "2",
"label": "Married",
"text": "Married",
"data":"",
"codename":"Item_2",
"value": "2",
"disabled": false
}
, {
"id": "1",
"label": "Single",
"text": "Single",
"data":"",
"codename":"Item_1",
"value": "1",
"disabled": false
}
, {
"id": "4",
"label": "Widowed",
"text": "Widowed",
"data":"",
"codename":"Item_4",
"value": "4",
"disabled": false
}
]
},
{
"srfkey": "Account__CustomerTypeCode",
"emptytext": "未定义",
......@@ -255,6 +319,53 @@
}
]
},
{
"srfkey": "Contact__PaymentTermsCode",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "2",
"label": "2% 10, Net 30",
"text": "2% 10, Net 30",
"data":"",
"codename":"Item_2",
"value": "2",
"disabled": false
}
, {
"id": "1",
"label": "Net 30",
"text": "Net 30",
"data":"",
"codename":"Item_1",
"value": "1",
"disabled": false
}
, {
"id": "3",
"label": "Net 45",
"text": "Net 45",
"data":"",
"codename":"Item_3",
"value": "3",
"disabled": false
}
, {
"id": "4",
"label": "Net 60",
"text": "Net 60",
"data":"",
"codename":"Item_4",
"value": "4",
"disabled": false
}
]
},
{
"srfkey": "Account__Address1_ShippingMethodCode",
"emptytext": "未定义",
......@@ -419,6 +530,33 @@
}
]
},
{
"srfkey": "Contact__GenderCode",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "2",
"label": "Female",
"text": "Female",
"data":"",
"codename":"Item_2",
"value": "2",
"disabled": false
}
, {
"id": "1",
"label": "Male",
"text": "Male",
"data":"",
"codename":"Item_1",
"value": "1",
"disabled": false
}
]
},
{
"srfkey": "FQG_ActivityPointer",
"emptytext": "未定义",
......
......@@ -69,6 +69,16 @@
"viewtag": "15d12c1173fcb6e742b6a6d92cbc53ed",
"memo": ""
},
"leadpickupview": {
"title": "lead数据选择视图",
"caption": "潜在顾客",
"viewtype": "DEPICKUPVIEW",
"viewmodule": "Sales",
"viewname": "LeadPickupView",
"viewfilename": "lead-pickup-view",
"viewtag": "1bc48b15dbe69c5f30dafe489f58aacb",
"memo": "系统自动添加"
},
"accountaccountinfo": {
"title": "account编辑视图",
"caption": "客户",
......@@ -219,6 +229,16 @@
"viewtag": "5f8f689d5dccc3db6d2b74a24a8b24ef",
"memo": ""
},
"contactdetailinfoeditview9": {
"title": "联系人编辑视图",
"caption": "联系人",
"viewtype": "DEEDITVIEW9",
"viewmodule": "Base",
"viewname": "ContactDetailInfoEditView9",
"viewfilename": "contact-detail-info-edit-view9",
"viewtag": "60093dd36f07238d7a7e72e9ed372942",
"memo": ""
},
"goalgridview": {
"title": "goal表格视图",
"caption": "目标",
......@@ -229,6 +249,16 @@
"viewtag": "631a4276161c551802f3aaf4bd7e607c",
"memo": ""
},
"transactioncurrencypickupgridview": {
"title": "transactioncurrency选择表格视图",
"caption": "货币",
"viewtype": "DEPICKUPGRIDVIEW",
"viewmodule": "Base",
"viewname": "TransactionCurrencyPickupGridView",
"viewfilename": "transaction-currency-pickup-grid-view",
"viewtag": "6d8a2615030eed5779caea69f7f001aa",
"memo": "系统自动添加"
},
"accounteditview": {
"title": "account编辑视图",
"caption": "客户",
......@@ -279,6 +309,16 @@
"viewtag": "7bf35293fd1d9db7816755a74c4d575e",
"memo": "系统自动添加"
},
"leadpickupgridview": {
"title": "lead选择表格视图",
"caption": "潜在顾客",
"viewtype": "DEPICKUPGRIDVIEW",
"viewmodule": "Sales",
"viewname": "LeadPickupGridView",
"viewfilename": "lead-pickup-grid-view",
"viewtag": "7d00f63c306adf3537efeabb3326095d",
"memo": "系统自动添加"
},
"centeralportal": {
"title": "仪表盘",
"caption": "仪表盘",
......@@ -509,6 +549,16 @@
"viewtag": "d1c35f3c52010e1428d7dc1a6bc82f63",
"memo": ""
},
"transactioncurrencypickupview": {
"title": "transactioncurrency数据选择视图",
"caption": "货币",
"viewtype": "DEPICKUPVIEW",
"viewmodule": "Base",
"viewname": "TransactionCurrencyPickupView",
"viewfilename": "transaction-currency-pickup-view",
"viewtag": "da3f8c1f20f440f3df54d6c13a8de586",
"memo": "系统自动添加"
},
"pricelevelpickupgridview": {
"title": "pricelevel选择表格视图",
"caption": "价目表",
......@@ -598,5 +648,15 @@
"viewfilename": "competitor-edit-view",
"viewtag": "fc2117de593df9cc982bd802cbdb2154",
"memo": "系统自动添加"
},
"contacttabexpview": {
"title": "联系人分页导航视图",
"caption": "联系人",
"viewtype": "DETABEXPVIEW",
"viewmodule": "Base",
"viewname": "ContactTabExpView",
"viewfilename": "contact-tab-exp-view",
"viewtag": "fcdb236b65d78c4a8ae64e74f9483a63",
"memo": ""
}
}
\ No newline at end of file
/**
* 货币
*
* @export
* @interface TransactionCurrency
*/
export interface TransactionCurrency {
/**
* 更新时间
*
* @returns {*}
* @memberof TransactionCurrency
*/
updatedate?: any;
/**
* 实体图像 ID
*
* @returns {*}
* @memberof TransactionCurrency
*/
entityimageid?: any;
/**
* 交易币种
*
* @returns {*}
* @memberof TransactionCurrency
*/
transactioncurrencyid?: any;
/**
* 版本号
*
* @returns {*}
* @memberof TransactionCurrency
*/
versionnumber?: any;
/**
* EntityImage_URL
*
* @returns {*}
* @memberof TransactionCurrency
*/
entityimage_url?: any;
/**
* 汇率
*
* @returns {*}
* @memberof TransactionCurrency
*/
exchangerate?: any;
/**
* 创建记录的时间
*
* @returns {*}
* @memberof TransactionCurrency
*/
overriddencreatedon?: any;
/**
* 建立时间
*
* @returns {*}
* @memberof TransactionCurrency
*/
createdate?: any;
/**
* UniqueDscId
*
* @returns {*}
* @memberof TransactionCurrency
*/
uniquedscid?: any;
/**
* 状态
*
* @returns {*}
* @memberof TransactionCurrency
*/
statecode?: any;
/**
* 状态描述
*
* @returns {*}
* @memberof TransactionCurrency
*/
statuscode?: any;
/**
* 更新人
*
* @returns {*}
* @memberof TransactionCurrency
*/
updateman?: any;
/**
* 货币精度
*
* @returns {*}
* @memberof TransactionCurrency
*/
currencyprecision?: any;
/**
* 货币名称
*
* @returns {*}
* @memberof TransactionCurrency
*/
currencyname?: any;
/**
* 建立人
*
* @returns {*}
* @memberof TransactionCurrency
*/
createman?: any;
/**
* 实体图像
*
* @returns {*}
* @memberof TransactionCurrency
*/
entityimage?: any;
/**
* 货币代码
*
* @returns {*}
* @memberof TransactionCurrency
*/
isocurrencycode?: any;
/**
* EntityImage_Timestamp
*
* @returns {*}
* @memberof TransactionCurrency
*/
entityimage_timestamp?: any;
/**
* 货币符号
*
* @returns {*}
* @memberof TransactionCurrency
*/
currencysymbol?: any;
/**
* 导入序列号
*
* @returns {*}
* @memberof TransactionCurrency
*/
importsequencenumber?: any;
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ import letter_en_US from '@locale/lanres/entities/letter/letter_en_US';
import pricelevel_en_US from '@locale/lanres/entities/price-level/price-level_en_US';
import email_en_US from '@locale/lanres/entities/email/email_en_US';
import serviceappointment_en_US from '@locale/lanres/entities/service-appointment/service-appointment_en_US';
import transactioncurrency_en_US from '@locale/lanres/entities/transaction-currency/transaction-currency_en_US';
import opportunity_en_US from '@locale/lanres/entities/opportunity/opportunity_en_US';
import goal_en_US from '@locale/lanres/entities/goal/goal_en_US';
import invoice_en_US from '@locale/lanres/entities/invoice/invoice_en_US';
......@@ -130,6 +131,7 @@ export default {
pricelevel: pricelevel_en_US,
email: email_en_US,
serviceappointment: serviceappointment_en_US,
transactioncurrency: transactioncurrency_en_US,
opportunity: opportunity_en_US,
goal: goal_en_US,
invoice: invoice_en_US,
......
......@@ -3,6 +3,7 @@ import letter_zh_CN from '@locale/lanres/entities/letter/letter_zh_CN';
import pricelevel_zh_CN from '@locale/lanres/entities/price-level/price-level_zh_CN';
import email_zh_CN from '@locale/lanres/entities/email/email_zh_CN';
import serviceappointment_zh_CN from '@locale/lanres/entities/service-appointment/service-appointment_zh_CN';
import transactioncurrency_zh_CN from '@locale/lanres/entities/transaction-currency/transaction-currency_zh_CN';
import opportunity_zh_CN from '@locale/lanres/entities/opportunity/opportunity_zh_CN';
import goal_zh_CN from '@locale/lanres/entities/goal/goal_zh_CN';
import invoice_zh_CN from '@locale/lanres/entities/invoice/invoice_zh_CN';
......@@ -130,6 +131,7 @@ export default {
pricelevel: pricelevel_zh_CN,
email: email_zh_CN,
serviceappointment: serviceappointment_zh_CN,
transactioncurrency: transactioncurrency_zh_CN,
opportunity: opportunity_zh_CN,
goal: goal_zh_CN,
invoice: invoice_zh_CN,
......
......@@ -9,11 +9,22 @@ export default {
'3': 'Subsidiary',
empty: '',
},
Contact__ShippingMethodCode: {
'1': 'Default Value',
empty: '',
},
YesNo: {
'1': '是',
'0': '否',
empty: '',
},
Contact__FamilyStatusCode: {
'3': 'Divorced',
'2': 'Married',
'1': 'Single',
'4': 'Widowed',
empty: '',
},
Account__CustomerTypeCode: {
'1': 'Competitor',
'2': 'Consultant',
......@@ -36,6 +47,13 @@ export default {
'2': 'Ship To',
empty: '',
},
Contact__PaymentTermsCode: {
'2': '2% 10, Net 30',
'1': 'Net 30',
'3': 'Net 45',
'4': 'Net 60',
empty: '',
},
Account__Address1_ShippingMethodCode: {
'1': 'Airborne',
'2': 'DHL',
......@@ -57,6 +75,11 @@ export default {
'CAMPAIGNRESPONSE': '市场活动响应',
empty: '',
},
Contact__GenderCode: {
'2': 'Female',
'1': 'Male',
empty: '',
},
FQG_ActivityPointer: {
'ALL': '全部活动',
'TASK': '任务',
......
......@@ -9,11 +9,22 @@ export default {
'3': 'Subsidiary',
empty: '',
},
Contact__ShippingMethodCode: {
'1': 'Default Value',
empty: '',
},
YesNo: {
'1': '是',
'0': '否',
empty: '',
},
Contact__FamilyStatusCode: {
'3': 'Divorced',
'2': 'Married',
'1': 'Single',
'4': 'Widowed',
empty: '',
},
Account__CustomerTypeCode: {
'1': 'Competitor',
'2': 'Consultant',
......@@ -36,6 +47,13 @@ export default {
'2': 'Ship To',
empty: '',
},
Contact__PaymentTermsCode: {
'2': '2% 10, Net 30',
'1': 'Net 30',
'3': 'Net 45',
'4': 'Net 60',
empty: '',
},
Account__Address1_ShippingMethodCode: {
'1': 'Airborne',
'2': 'DHL',
......@@ -57,6 +75,11 @@ export default {
'CAMPAIGNRESPONSE': '市场活动响应',
empty: '',
},
Contact__GenderCode: {
'2': 'Female',
'1': 'Male',
empty: '',
},
FQG_ActivityPointer: {
'ALL': '全部活动',
'TASK': '任务',
......
......@@ -206,6 +206,10 @@ export default {
gridview: {
caption: "联系人",
title: 'contact表格视图',
},
detailinfoeditview9: {
caption: "联系人",
title: '联系人编辑视图',
},
pickupgridview: {
caption: "联系人",
......@@ -227,6 +231,10 @@ export default {
caption: "联系人",
title: '联系人选项操作视图',
},
tabexpview: {
caption: "联系人",
title: '联系人分页导航视图',
},
},
quickcreate_form: {
details: {
......@@ -257,6 +265,41 @@ export default {
uiactions: {
},
},
detailinfo_form: {
details: {
group1: "个人信息",
grouppanel1: "市场营销",
grouppanel2: "记账",
grouppanel3: "送货",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "联系人",
srfmajortext: "全名",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
gendercode: "性别",
familystatuscode: "婚姻状况",
spousesname: "配偶/伴侣姓名",
birthdate: "生日",
anniversary: "纪念日",
originatingleadname: "原始潜在顾客",
lastusedincampaign: "上次参与市场活动的日期",
donotsendmm: "发送市场营销资料",
transactioncurrencyname: "货币",
creditlimit: "信用额度",
creditonhold: "信用冻结",
paymenttermscode: "付款方式",
shippingmethodcode: "送货方式",
originatingleadid: "原始潜在顾客",
transactioncurrencyid: "货币",
contactid: "联系人",
},
uiactions: {
},
},
main_form: {
details: {
group1: "contact基本信息",
......@@ -340,6 +383,12 @@ export default {
tip: "Filter",
},
},
abstracteditview9toolbar_toolbar: {
deuiaction2: {
caption: "编辑",
tip: "编辑",
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: "Save",
......@@ -378,10 +427,4 @@ export default {
tip: "Copy {0}",
},
},
abstracteditview9toolbar_toolbar: {
deuiaction2: {
caption: "编辑",
tip: "编辑",
},
},
};
\ No newline at end of file
......@@ -205,6 +205,10 @@ export default {
gridview: {
caption: '联系人',
title: 'contact表格视图',
},
detailinfoeditview9: {
caption: '联系人',
title: '联系人编辑视图',
},
pickupgridview: {
caption: '联系人',
......@@ -226,6 +230,10 @@ export default {
caption: '联系人',
title: '联系人选项操作视图',
},
tabexpview: {
caption: '联系人',
title: '联系人分页导航视图',
},
},
quickcreate_form: {
details: {
......@@ -256,6 +264,41 @@ export default {
uiactions: {
},
},
detailinfo_form: {
details: {
group1: '个人信息',
grouppanel1: '市场营销',
grouppanel2: '记账',
grouppanel3: '送货',
formpage1: '基本信息',
srfupdatedate: '更新时间',
srforikey: '',
srfkey: '联系人',
srfmajortext: '全名',
srftempmode: '',
srfuf: '',
srfdeid: '',
srfsourcekey: '',
gendercode: '性别',
familystatuscode: '婚姻状况',
spousesname: '配偶/伴侣姓名',
birthdate: '生日',
anniversary: '纪念日',
originatingleadname: '原始潜在顾客',
lastusedincampaign: '上次参与市场活动的日期',
donotsendmm: '发送市场营销资料',
transactioncurrencyname: '货币',
creditlimit: '信用额度',
creditonhold: '信用冻结',
paymenttermscode: '付款方式',
shippingmethodcode: '送货方式',
originatingleadid: '原始潜在顾客',
transactioncurrencyid: '货币',
contactid: '联系人',
},
uiactions: {
},
},
main_form: {
details: {
group1: 'contact基本信息',
......@@ -339,6 +382,12 @@ export default {
tip: '过滤',
},
},
abstracteditview9toolbar_toolbar: {
deuiaction2: {
caption: '编辑',
tip: '编辑',
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: '保存',
......@@ -377,10 +426,4 @@ export default {
tip: '拷贝',
},
},
abstracteditview9toolbar_toolbar: {
deuiaction2: {
caption: '编辑',
tip: '编辑',
},
},
};
\ No newline at end of file
......@@ -161,11 +161,19 @@ export default {
gridview: {
caption: "潜在顾客",
title: 'lead表格视图',
},
pickupview: {
caption: "潜在顾客",
title: 'lead数据选择视图',
},
editview: {
caption: "潜在顾客",
title: 'lead编辑视图',
},
pickupgridview: {
caption: "潜在顾客",
title: 'lead选择表格视图',
},
},
main_form: {
details: {
......
......@@ -160,11 +160,19 @@ export default {
gridview: {
caption: '潜在顾客',
title: 'lead表格视图',
},
pickupview: {
caption: '潜在顾客',
title: 'lead数据选择视图',
},
editview: {
caption: '潜在顾客',
title: 'lead编辑视图',
},
pickupgridview: {
caption: '潜在顾客',
title: 'lead选择表格视图',
},
},
main_form: {
details: {
......
export default {
fields: {
updatedate: '更新时间',
entityimageid: '实体图像 ID',
transactioncurrencyid: '交易币种',
versionnumber: '版本号',
entityimage_url: 'EntityImage_URL',
exchangerate: '汇率',
overriddencreatedon: '创建记录的时间',
createdate: '建立时间',
uniquedscid: 'UniqueDscId',
statecode: '状态',
statuscode: '状态描述',
updateman: '更新人',
currencyprecision: '货币精度',
currencyname: '货币名称',
createman: '建立人',
entityimage: '实体图像',
isocurrencycode: '货币代码',
entityimage_timestamp: 'EntityImage_Timestamp',
currencysymbol: '货币符号',
importsequencenumber: '导入序列号',
},
views: {
pickupgridview: {
caption: "货币",
title: 'transactioncurrency选择表格视图',
},
pickupview: {
caption: "货币",
title: 'transactioncurrency数据选择视图',
},
},
main_grid: {
columns: {
currencyname: "货币名称",
updateman: "更新人",
updatedate: "更新时间",
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: "常规条件",
},
uiactions: {
},
},
};
\ No newline at end of file
export default {
fields: {
updatedate: '更新时间',
entityimageid: '实体图像 ID',
transactioncurrencyid: '交易币种',
versionnumber: '版本号',
entityimage_url: 'EntityImage_URL',
exchangerate: '汇率',
overriddencreatedon: '创建记录的时间',
createdate: '建立时间',
uniquedscid: 'UniqueDscId',
statecode: '状态',
statuscode: '状态描述',
updateman: '更新人',
currencyprecision: '货币精度',
currencyname: '货币名称',
createman: '建立人',
entityimage: '实体图像',
isocurrencycode: '货币代码',
entityimage_timestamp: 'EntityImage_Timestamp',
currencysymbol: '货币符号',
importsequencenumber: '导入序列号',
},
views: {
pickupgridview: {
caption: '货币',
title: 'transactioncurrency选择表格视图',
},
pickupview: {
caption: '货币',
title: 'transactioncurrency数据选择视图',
},
},
main_grid: {
columns: {
currencyname: '货币名称',
updateman: '更新人',
updatedate: '更新时间',
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: '常规条件',
},
uiactions: {
},
},
};
\ No newline at end of file
......@@ -62,6 +62,23 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
},
]
},
{
srfkey: 'Contact__ShippingMethodCode',
emptytext: '未定义',
"codelisttype":"static",
items: [
{
id: '1',
label: 'Default Value',
text: 'Default Value',
"data":"",
"codename":"Item_1",
value: '1',
disabled: false,
},
]
},
{
srfkey: 'YesNo',
emptytext: '未定义',
......@@ -89,6 +106,53 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
},
]
},
{
srfkey: 'Contact__FamilyStatusCode',
emptytext: '未定义',
"codelisttype":"static",
items: [
{
id: '3',
label: 'Divorced',
text: 'Divorced',
"data":"",
"codename":"Item_3",
value: '3',
disabled: false,
},
{
id: '2',
label: 'Married',
text: 'Married',
"data":"",
"codename":"Item_2",
value: '2',
disabled: false,
},
{
id: '1',
label: 'Single',
text: 'Single',
"data":"",
"codename":"Item_1",
value: '1',
disabled: false,
},
{
id: '4',
label: 'Widowed',
text: 'Widowed',
"data":"",
"codename":"Item_4",
value: '4',
disabled: false,
},
]
},
{
srfkey: 'Account__CustomerTypeCode',
emptytext: '未定义',
......@@ -263,6 +327,53 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
},
]
},
{
srfkey: 'Contact__PaymentTermsCode',
emptytext: '未定义',
"codelisttype":"static",
items: [
{
id: '2',
label: '2% 10, Net 30',
text: '2% 10, Net 30',
"data":"",
"codename":"Item_2",
value: '2',
disabled: false,
},
{
id: '1',
label: 'Net 30',
text: 'Net 30',
"data":"",
"codename":"Item_1",
value: '1',
disabled: false,
},
{
id: '3',
label: 'Net 45',
text: 'Net 45',
"data":"",
"codename":"Item_3",
value: '3',
disabled: false,
},
{
id: '4',
label: 'Net 60',
text: 'Net 60',
"data":"",
"codename":"Item_4",
value: '4',
disabled: false,
},
]
},
{
srfkey: 'Account__Address1_ShippingMethodCode',
emptytext: '未定义',
......@@ -427,6 +538,33 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
},
]
},
{
srfkey: 'Contact__GenderCode',
emptytext: '未定义',
"codelisttype":"static",
items: [
{
id: '2',
label: 'Female',
text: 'Female',
"data":"",
"codename":"Item_2",
value: '2',
disabled: false,
},
{
id: '1',
label: 'Male',
text: 'Male',
"data":"",
"codename":"Item_1",
value: '1',
disabled: false,
},
]
},
{
srfkey: 'FQG_ActivityPointer',
emptytext: '未定义',
......
import qs from 'qs';
import { MockAdapter } from '@/mock/mock-adapter';
const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/ibizbusinesscentral-app-businesscentral\/transactioncurrencies\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/ibizbusinesscentral-app-businesscentral\/transactioncurrencies\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/transactioncurrencies\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/transactioncurrencies\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/transactioncurrencies\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/transactioncurrencies\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: Select");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['transactioncurrencyid'];
const matchArray:any = new RegExp(/^\/transactioncurrencies\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.transactioncurrencyid, tempValue.transactioncurrencyid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/transactioncurrencies\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['transactioncurrencyid'];
const matchArray:any = new RegExp(/^\/transactioncurrencies\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.transactioncurrencyid, tempValue.transactioncurrencyid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['transactioncurrencyid'] == tempValue['transactioncurrencyid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Update
mock.onPut(new RegExp(/^\/transactioncurrencies\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['transactioncurrencyid'];
const matchArray:any = new RegExp(/^\/transactioncurrencies\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.transactioncurrencyid, tempValue.transactioncurrencyid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['transactioncurrencyid'] == tempValue['transactioncurrencyid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/transactioncurrencies\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['transactioncurrencyid'];
const matchArray:any = new RegExp(/^\/transactioncurrencies\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// GetDraft
mock.onGet(new RegExp(/^\/transactioncurrencies\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/transactioncurrencies\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['transactioncurrencyid'];
const matchArray:any = new RegExp(/^\/transactioncurrencies\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.transactioncurrencyid, tempValue.transactioncurrencyid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['transactioncurrencyid'] == tempValue['transactioncurrencyid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// FetchDefault
mock.onGet(new RegExp(/^\/transactioncurrencies\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/transactioncurrencies\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock.onDelete(new RegExp(/^\/transactioncurrencies\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['transactioncurrencyid'];
const matchArray:any = new RegExp(/^\/transactioncurrencies\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.transactioncurrencyid, tempValue.transactioncurrencyid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/transactioncurrencies\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:transactioncurrency 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['transactioncurrencyid'];
const matchArray:any = new RegExp(/^\/transactioncurrencies\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.transactioncurrencyid, tempValue.transactioncurrencyid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
......@@ -12,6 +12,7 @@ import './entity/letters/letters';
import './entity/price-levels/price-levels';
import './entity/emails/emails';
import './entity/service-appointments/service-appointments';
import './entity/transaction-currencys/transaction-currencys';
import './entity/opportunitys/opportunitys';
import './entity/goals/goals';
import './entity/invoices/invoices';
......
......@@ -63,6 +63,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "LeadGridView",
"viewtag": "15d12c1173fcb6e742b6a6d92cbc53ed"
},
"leadpickupview": {
"title": "lead数据选择视图",
"caption": "潜在顾客",
"viewtype": "DEPICKUPVIEW",
"viewmodule": "Sales",
"viewname": "LeadPickupView",
"viewtag": "1bc48b15dbe69c5f30dafe489f58aacb"
},
"accountaccountinfo": {
"title": "account编辑视图",
"caption": "客户",
......@@ -183,6 +191,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "OpportunityGridView",
"viewtag": "5f8f689d5dccc3db6d2b74a24a8b24ef"
},
"contactdetailinfoeditview9": {
"title": "联系人编辑视图",
"caption": "联系人",
"viewtype": "DEEDITVIEW9",
"viewmodule": "Base",
"viewname": "ContactDetailInfoEditView9",
"viewtag": "60093dd36f07238d7a7e72e9ed372942"
},
"goalgridview": {
"title": "goal表格视图",
"caption": "目标",
......@@ -191,6 +207,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "GoalGridView",
"viewtag": "631a4276161c551802f3aaf4bd7e607c"
},
"transactioncurrencypickupgridview": {
"title": "transactioncurrency选择表格视图",
"caption": "货币",
"viewtype": "DEPICKUPGRIDVIEW",
"viewmodule": "Base",
"viewname": "TransactionCurrencyPickupGridView",
"viewtag": "6d8a2615030eed5779caea69f7f001aa"
},
"accounteditview": {
"title": "account编辑视图",
"caption": "客户",
......@@ -231,6 +255,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "OpportunityEditView",
"viewtag": "7bf35293fd1d9db7816755a74c4d575e"
},
"leadpickupgridview": {
"title": "lead选择表格视图",
"caption": "潜在顾客",
"viewtype": "DEPICKUPGRIDVIEW",
"viewmodule": "Sales",
"viewname": "LeadPickupGridView",
"viewtag": "7d00f63c306adf3537efeabb3326095d"
},
"centeralportal": {
"title": "仪表盘",
"caption": "仪表盘",
......@@ -415,6 +447,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "CompetitorGridView",
"viewtag": "d1c35f3c52010e1428d7dc1a6bc82f63"
},
"transactioncurrencypickupview": {
"title": "transactioncurrency数据选择视图",
"caption": "货币",
"viewtype": "DEPICKUPVIEW",
"viewmodule": "Base",
"viewname": "TransactionCurrencyPickupView",
"viewtag": "da3f8c1f20f440f3df54d6c13a8de586"
},
"pricelevelpickupgridview": {
"title": "pricelevel选择表格视图",
"caption": "价目表",
......@@ -486,6 +526,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewmodule": "Sales",
"viewname": "CompetitorEditView",
"viewtag": "fc2117de593df9cc982bd802cbdb2154"
},
"contacttabexpview": {
"title": "联系人分页导航视图",
"caption": "联系人",
"viewtype": "DETABEXPVIEW",
"viewmodule": "Base",
"viewname": "ContactTabExpView",
"viewtag": "fcdb236b65d78c4a8ae64e74f9483a63"
}
}];
});
\ No newline at end of file
<template>
<studio-view viewName="accountedit_accountinfo" viewTitle="地址信息" class='deeditview account-edit-account-info'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<template slot="toolbar">
<div class='toolbar-container'>
<i-button :title="$t('entities.account.edit_accountinfotoolbar_toolbar.tbitem3.tip')" v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<i class='fa fa-save'></i>
<span class='caption'>{{$t('entities.account.edit_accountinfotoolbar_toolbar.tbitem3.caption')}}</span>
</i-button>
<i-button :title="$t('entities.account.edit_accountinfotoolbar_toolbar.tbitem4.tip')" v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' @click="toolbar_click({ tag: 'tbitem4' }, $event)">
<i class='sx-tb-saveandnew'></i>
<span class='caption'>{{$t('entities.account.edit_accountinfotoolbar_toolbar.tbitem4.caption')}}</span>
</i-button>
<i-button :title="$t('entities.account.edit_accountinfotoolbar_toolbar.tbitem5.tip')" v-show="toolBarModels.tbitem5.visabled" :disabled="toolBarModels.tbitem5.disabled" class='' @click="toolbar_click({ tag: 'tbitem5' }, $event)">
<i class='sx-tb-saveandclose'></i>
<span class='caption'>{{$t('entities.account.edit_accountinfotoolbar_toolbar.tbitem5.caption')}}</span>
</i-button>
<span class='seperator'>|</span> <i-button :title="$t('entities.account.edit_accountinfotoolbar_toolbar.tbitem7.tip')" v-show="toolBarModels.tbitem7.visabled" :disabled="toolBarModels.tbitem7.disabled" class='' @click="toolbar_click({ tag: 'tbitem7' }, $event)">
<i class='fa fa-remove'></i>
<span class='caption'>{{$t('entities.account.edit_accountinfotoolbar_toolbar.tbitem7.caption')}}</span>
</i-button>
<span class='seperator'>|</span> <i-button :title="$t('entities.account.edit_accountinfotoolbar_toolbar.tbitem12.tip')" v-show="toolBarModels.tbitem12.visabled" :disabled="toolBarModels.tbitem12.disabled" class='' @click="toolbar_click({ tag: 'tbitem12' }, $event)">
<i class='fa fa-file-text-o'></i>
<span class='caption'>{{$t('entities.account.edit_accountinfotoolbar_toolbar.tbitem12.caption')}}</span>
</i-button>
<span class='seperator'>|</span> <i-button :title="$t('entities.account.edit_accountinfotoolbar_toolbar.tbitem14.tip')" v-show="toolBarModels.tbitem14.visabled" :disabled="toolBarModels.tbitem14.disabled" class='' @click="toolbar_click({ tag: 'tbitem14' }, $event)">
<i class='fa fa-copy'></i>
<span class='caption'>{{$t('entities.account.edit_accountinfotoolbar_toolbar.tbitem14.caption')}}</span>
</i-button>
</div>
</template>
<view_form
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:autosave="false"
:viewtag="viewtag"
:showBusyIndicator="true"
updateAction="Update"
removeAction="Remove"
loaddraftAction="GetDraft"
loadAction="Get"
createAction="Create"
WFSubmitAction=""
WFStartAction=""
style=''
name="form"
ref='form'
@save="form_save($event)"
@remove="form_remove($event)"
@load="form_load($event)"
@closeview="closeView($event)">
</view_form>
</studio-view>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs';
import AccountService from '@/service/account/account-service';
import EditViewEngine from '@engine/view/edit-view-engine';
@Component({
components: {
},
})
export default class AccountEdit_AccountInfoBase extends Vue {
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof AccountEdit_AccountInfoBase
*/
public appEntityService: AccountService = new AccountService;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof AccountEdit_AccountInfoBase
*/
public counterServiceArray:Array<any> = [];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof AccountEdit_AccountInfoBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof AccountEdit_AccountInfoBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof AccountEdit_AccountInfoBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof AccountEdit_AccountInfoBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof AccountEdit_AccountInfoBase
*/
public viewtag: string = '0d25ba75b06acd9c995642d0a45fcd2c';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof AccountEdit_AccountInfoBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof AccountEdit_AccountInfoBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof AccountEdit_AccountInfoBase
*/
public model: any = {
srfCaption: 'entities.account.views.edit_accountinfo.caption',
srfTitle: 'entities.account.views.edit_accountinfo.title',
srfSubTitle: 'entities.account.views.edit_accountinfo.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AccountEdit_AccountInfoBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
for(let key in this.viewparams){
delete this.viewparams[key];
}
Object.assign(this.viewparams, JSON.parse(this.viewparam));
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AccountEdit_AccountInfoBase
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
this.$nextTick(()=>{
_this.parseViewParam();
_this.engine.load();
});
}
}
/**
* 容器模型
*
* @type {*}
* @memberof AccountEdit_AccountInfoBase
*/
public containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_form: { name: 'form', type: 'FORM' },
};
/**
* 计数器刷新
*
* @memberof AccountEdit_AccountInfoBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof AccountEdit_AccountInfoBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 工具栏模型
*
* @type {*}
* @memberof AccountEdit_AccountInfo
*/
public toolBarModels: any = {
tbitem3: { name: 'tbitem3', caption: '保存', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Save', target: '' } },
tbitem4: { name: 'tbitem4', caption: '保存并新建', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'SaveAndNew', target: '' } },
tbitem5: { name: 'tbitem5', caption: '保存并关闭', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'SaveAndExit', target: '' } },
tbitem6: { name: 'tbitem6', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem7: { name: 'tbitem7', caption: '删除并关闭', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'RemoveAndExit', target: 'SINGLEKEY' } },
tbitem8: { name: 'tbitem8', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem12: { name: 'tbitem12', caption: '新建', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'New', target: '' } },
tbitem13: { name: 'tbitem13', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem14: { name: 'tbitem14', caption: '拷贝', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Copy', target: 'SINGLEKEY' } },
};
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof AccountEdit_AccountInfoBase
*/
public engine: EditViewEngine = new EditViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof AccountEdit_AccountInfoBase
*/
public engineInit(): void {
this.engine.init({
view: this,
form: this.$refs.form,
p2k: '0',
keyPSDEField: 'account',
majorPSDEField: 'accountname',
isLoadDefault: true,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof AccountEdit_AccountInfoBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof AccountEdit_AccountInfoBase
*/
public viewparams:any = {};
/**
* 解析视图参数
*
* @public
* @memberof AccountEdit_AccountInfoBase
*/
public parseViewParam(): void {
for(let key in this.context){
delete this.context[key];
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
this.handleCustomViewData();
return;
}
const path = (this.$route.matched[this.$route.matched.length - 1]).path;
const keys: Array<any> = [];
const curReg = this.$pathToRegExp.pathToRegexp(path, keys);
const matchArray = curReg.exec(this.$route.path);
let tempValue: Object = {};
keys.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item.name, {
enumerable: true,
value: matchArray[index + 1]
});
});
this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams);
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
}
/**
* 处理自定义视图数据
*
* @memberof AccountEdit_AccountInfoBase
*/
public handleCustomViewData(){
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof AccountEdit_AccountInfoBase
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
/**
* Vue声明周期
*
* @memberof AccountEdit_AccountInfoBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof AccountEdit_AccountInfoBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof AccountEdit_AccountInfoBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof AccountEdit_AccountInfoBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof AccountEdit_AccountInfoBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
}
/**
* toolbar 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountEdit_AccountInfoBase
*/
public toolbar_click($event: any, $event2?: any) {
if (Object.is($event.tag, 'tbitem3')) {
this.toolbar_tbitem3_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem4')) {
this.toolbar_tbitem4_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem5')) {
this.toolbar_tbitem5_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem7')) {
this.toolbar_tbitem7_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem9')) {
this.toolbar_tbitem9_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem10')) {
this.toolbar_tbitem10_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem12')) {
this.toolbar_tbitem12_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem14')) {
this.toolbar_tbitem14_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem15')) {
this.toolbar_tbitem15_click(null, '', $event2);
}
}
/**
* form 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountEdit_AccountInfoBase
*/
public form_save($event: any, $event2?: any) {
this.engine.onCtrlEvent('form', 'save', $event);
}
/**
* form 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountEdit_AccountInfoBase
*/
public form_remove($event: any, $event2?: any) {
this.engine.onCtrlEvent('form', 'remove', $event);
}
/**
* form 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountEdit_AccountInfoBase
*/
public form_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('form', 'load', $event);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem3_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Save(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem4_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.SaveAndNew(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem5_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.SaveAndExit(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem7_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.RemoveAndExit(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem9_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.SaveAndStart(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem10_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ViewWFStep(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem12_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.New(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem14_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Copy(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem15_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Print(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 保存
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AccountInfoBase
*/
public Save(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
// 界面行为容器对象 _this
const _this: any = this;
if (xData && xData.save instanceof Function) {
xData.save().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
_this.$emit('viewdataschange', [{ ...response.data }]);
});
} else if (_this.save && _this.save instanceof Function) {
_this.save();
}
}
/**
* 保存并新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AccountInfoBase
*/
public SaveAndNew(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.saveAndNew instanceof Function)) {
return;
}
xData.saveAndNew().then((response: any) => {
if (!response || response.status !== 200) {
_this.$emit('viewdataschange', JSON.stringify({status:'error',action:'saveAndNew'}));
return;
}
_this.$emit('viewdataschange', JSON.stringify({status:'success',action:'saveAndNew',data:response.data}));
if (xData.autoLoad instanceof Function) {
xData.autoLoad();
}
});
}
/**
* 保存并关闭
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AccountInfoBase
*/
public SaveAndExit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (xData && xData.saveAndExit instanceof Function) {
xData.saveAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
} else if (_this.saveAndExit && _this.saveAndExit instanceof Function) {
_this.saveAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
}
}
/**
* 删除并关闭
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AccountInfoBase
*/
public RemoveAndExit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (xData && xData.removeAndExit instanceof Function) {
xData.removeAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
} else if (_this.removeAndExit && _this.removeAndExit instanceof Function) {
_this.removeAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
}
}
/**
* 开始流程
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AccountInfoBase
*/
public SaveAndStart(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.wfstart instanceof Function)) {
return;
}
xData.wfstart(args).then((response: any) => {
if (!response || response.status !== 200) {
return;
}
const { data: _data } = response;
if(window.parent){
window.parent.postMessage({ ..._data },'*');
}
if (_this.viewdata) {
_this.$emit('viewdataschange', [{ ..._data }]);
_this.$emit('close');
}else if (this.$tabPageExp) {
this.$tabPageExp.onClose(this.$route.fullPath);
}
});
}
/**
* 当前流程步骤
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AccountInfoBase
*/
public ViewWFStep(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let _this:any = this;
if (!xData || !(xData.wfsubmit instanceof Function)) {
return;
}
xData.wfsubmit(args).then((response: any) => {
if (!response || response.status !== 200) {
return;
}
const { data: _data } = response;
if (_this.viewdata) {
_this.$emit('viewdataschange', [{ ..._data }]);
_this.$emit('close');
} else if (_this.$tabPageExp) {
_this.$tabPageExp.onClose(_this.$route.fullPath);
}
});
}
/**
* 新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AccountInfoBase
*/
public New(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 拷贝
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AccountInfoBase
*/
public Copy(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
if (args.length > 0) {
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 打印
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AccountInfoBase
*/
public Print(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let _this:any = this;
if (!xData || !(xData.print instanceof Function) || !$event) {
return ;
}
xData.print();
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof AccountEdit_AccountInfoBase
*/
public closeView(args: any[]): void {
let _view: any = this;
if (_view.viewdata) {
_view.$emit('viewdataschange', [args]);
_view.$emit('close', [args]);
} else if (_view.$tabPageExp) {
_view.$tabPageExp.onClose(_view.$route.fullPath);
}
}
/**
* 销毁视图回调
*
* @memberof AccountEdit_AccountInfoBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof AccountEdit_AccountInfoBase
*/
public afterDestroyed(){
if(this.viewDefaultUsage){
let localStoreLength = Object.keys(localStorage);
if(localStoreLength.length > 0){
localStoreLength.forEach((item:string) =>{
if(item.startsWith(this.context.srfsessionid)){
localStorage.removeItem(item);
}
})
}
}
}
}
</script>
<style lang='less'>
@import './account-edit-account-info.less';
</style>
\ No newline at end of file
// 避免空文件,后台不让空文件过
.account-edit-account-info {
--account-edit-account-info: 0;
}
// 视图样式
// this is less
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import AccountEdit_AccountInfoBase from './account-edit-account-info-base.vue';
import view_form from '@widgets/account/edit-account-info-form/edit-account-info-form.vue';
@Component({
components: {
view_form,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
},
})
export default class AccountEdit_AccountInfo extends AccountEdit_AccountInfoBase {
}
</script>
\ No newline at end of file
<template>
<studio-view viewName="accountedit_address" viewTitle="地址信息" class='deeditview account-edit-address'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<template slot="toolbar">
<div class='toolbar-container'>
<i-button :title="$t('entities.account.edit_addresstoolbar_toolbar.tbitem3.tip')" v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<i class='fa fa-save'></i>
<span class='caption'>{{$t('entities.account.edit_addresstoolbar_toolbar.tbitem3.caption')}}</span>
</i-button>
<i-button :title="$t('entities.account.edit_addresstoolbar_toolbar.tbitem4.tip')" v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' @click="toolbar_click({ tag: 'tbitem4' }, $event)">
<i class='sx-tb-saveandnew'></i>
<span class='caption'>{{$t('entities.account.edit_addresstoolbar_toolbar.tbitem4.caption')}}</span>
</i-button>
<i-button :title="$t('entities.account.edit_addresstoolbar_toolbar.tbitem5.tip')" v-show="toolBarModels.tbitem5.visabled" :disabled="toolBarModels.tbitem5.disabled" class='' @click="toolbar_click({ tag: 'tbitem5' }, $event)">
<i class='sx-tb-saveandclose'></i>
<span class='caption'>{{$t('entities.account.edit_addresstoolbar_toolbar.tbitem5.caption')}}</span>
</i-button>
<span class='seperator'>|</span> <i-button :title="$t('entities.account.edit_addresstoolbar_toolbar.tbitem7.tip')" v-show="toolBarModels.tbitem7.visabled" :disabled="toolBarModels.tbitem7.disabled" class='' @click="toolbar_click({ tag: 'tbitem7' }, $event)">
<i class='fa fa-remove'></i>
<span class='caption'>{{$t('entities.account.edit_addresstoolbar_toolbar.tbitem7.caption')}}</span>
</i-button>
<span class='seperator'>|</span> <i-button :title="$t('entities.account.edit_addresstoolbar_toolbar.tbitem12.tip')" v-show="toolBarModels.tbitem12.visabled" :disabled="toolBarModels.tbitem12.disabled" class='' @click="toolbar_click({ tag: 'tbitem12' }, $event)">
<i class='fa fa-file-text-o'></i>
<span class='caption'>{{$t('entities.account.edit_addresstoolbar_toolbar.tbitem12.caption')}}</span>
</i-button>
<span class='seperator'>|</span> <i-button :title="$t('entities.account.edit_addresstoolbar_toolbar.tbitem14.tip')" v-show="toolBarModels.tbitem14.visabled" :disabled="toolBarModels.tbitem14.disabled" class='' @click="toolbar_click({ tag: 'tbitem14' }, $event)">
<i class='fa fa-copy'></i>
<span class='caption'>{{$t('entities.account.edit_addresstoolbar_toolbar.tbitem14.caption')}}</span>
</i-button>
</div>
</template>
<view_form
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:autosave="false"
:viewtag="viewtag"
:showBusyIndicator="true"
updateAction="Update"
removeAction="Remove"
loaddraftAction="GetDraft"
loadAction="Get"
createAction="Create"
WFSubmitAction=""
WFStartAction=""
style=''
name="form"
ref='form'
@save="form_save($event)"
@remove="form_remove($event)"
@load="form_load($event)"
@closeview="closeView($event)">
</view_form>
</studio-view>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs';
import AccountService from '@/service/account/account-service';
import EditViewEngine from '@engine/view/edit-view-engine';
@Component({
components: {
},
})
export default class AccountEdit_AddressBase extends Vue {
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof AccountEdit_AddressBase
*/
public appEntityService: AccountService = new AccountService;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof AccountEdit_AddressBase
*/
public counterServiceArray:Array<any> = [];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof AccountEdit_AddressBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof AccountEdit_AddressBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof AccountEdit_AddressBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof AccountEdit_AddressBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof AccountEdit_AddressBase
*/
public viewtag: string = '728b69e2de09e7920b86712bc17ea963';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof AccountEdit_AddressBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof AccountEdit_AddressBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof AccountEdit_AddressBase
*/
public model: any = {
srfCaption: 'entities.account.views.edit_address.caption',
srfTitle: 'entities.account.views.edit_address.title',
srfSubTitle: 'entities.account.views.edit_address.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AccountEdit_AddressBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
for(let key in this.viewparams){
delete this.viewparams[key];
}
Object.assign(this.viewparams, JSON.parse(this.viewparam));
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AccountEdit_AddressBase
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
this.$nextTick(()=>{
_this.parseViewParam();
_this.engine.load();
});
}
}
/**
* 容器模型
*
* @type {*}
* @memberof AccountEdit_AddressBase
*/
public containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_form: { name: 'form', type: 'FORM' },
};
/**
* 计数器刷新
*
* @memberof AccountEdit_AddressBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof AccountEdit_AddressBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 工具栏模型
*
* @type {*}
* @memberof AccountEdit_Address
*/
public toolBarModels: any = {
tbitem3: { name: 'tbitem3', caption: '保存', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Save', target: '' } },
tbitem4: { name: 'tbitem4', caption: '保存并新建', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'SaveAndNew', target: '' } },
tbitem5: { name: 'tbitem5', caption: '保存并关闭', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'SaveAndExit', target: '' } },
tbitem6: { name: 'tbitem6', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem7: { name: 'tbitem7', caption: '删除并关闭', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'RemoveAndExit', target: 'SINGLEKEY' } },
tbitem8: { name: 'tbitem8', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem12: { name: 'tbitem12', caption: '新建', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'New', target: '' } },
tbitem13: { name: 'tbitem13', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem14: { name: 'tbitem14', caption: '拷贝', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Copy', target: 'SINGLEKEY' } },
};
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof AccountEdit_AddressBase
*/
public engine: EditViewEngine = new EditViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof AccountEdit_AddressBase
*/
public engineInit(): void {
this.engine.init({
view: this,
form: this.$refs.form,
p2k: '0',
keyPSDEField: 'account',
majorPSDEField: 'accountname',
isLoadDefault: true,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof AccountEdit_AddressBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof AccountEdit_AddressBase
*/
public viewparams:any = {};
/**
* 解析视图参数
*
* @public
* @memberof AccountEdit_AddressBase
*/
public parseViewParam(): void {
for(let key in this.context){
delete this.context[key];
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
this.handleCustomViewData();
return;
}
const path = (this.$route.matched[this.$route.matched.length - 1]).path;
const keys: Array<any> = [];
const curReg = this.$pathToRegExp.pathToRegexp(path, keys);
const matchArray = curReg.exec(this.$route.path);
let tempValue: Object = {};
keys.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item.name, {
enumerable: true,
value: matchArray[index + 1]
});
});
this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams);
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
}
/**
* 处理自定义视图数据
*
* @memberof AccountEdit_AddressBase
*/
public handleCustomViewData(){
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof AccountEdit_AddressBase
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
/**
* Vue声明周期
*
* @memberof AccountEdit_AddressBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof AccountEdit_AddressBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof AccountEdit_AddressBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof AccountEdit_AddressBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof AccountEdit_AddressBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
}
/**
* toolbar 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountEdit_AddressBase
*/
public toolbar_click($event: any, $event2?: any) {
if (Object.is($event.tag, 'tbitem3')) {
this.toolbar_tbitem3_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem4')) {
this.toolbar_tbitem4_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem5')) {
this.toolbar_tbitem5_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem7')) {
this.toolbar_tbitem7_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem9')) {
this.toolbar_tbitem9_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem10')) {
this.toolbar_tbitem10_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem12')) {
this.toolbar_tbitem12_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem14')) {
this.toolbar_tbitem14_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem15')) {
this.toolbar_tbitem15_click(null, '', $event2);
}
}
/**
* form 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountEdit_AddressBase
*/
public form_save($event: any, $event2?: any) {
this.engine.onCtrlEvent('form', 'save', $event);
}
/**
* form 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountEdit_AddressBase
*/
public form_remove($event: any, $event2?: any) {
this.engine.onCtrlEvent('form', 'remove', $event);
}
/**
* form 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountEdit_AddressBase
*/
public form_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('form', 'load', $event);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem3_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Save(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem4_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.SaveAndNew(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem5_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.SaveAndExit(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem7_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.RemoveAndExit(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem9_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.SaveAndStart(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem10_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ViewWFStep(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem12_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.New(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem14_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Copy(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem15_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Print(datas, contextJO,paramJO, $event, xData,this,"Account");
}
/**
* 保存
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AddressBase
*/
public Save(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
// 界面行为容器对象 _this
const _this: any = this;
if (xData && xData.save instanceof Function) {
xData.save().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
_this.$emit('viewdataschange', [{ ...response.data }]);
});
} else if (_this.save && _this.save instanceof Function) {
_this.save();
}
}
/**
* 保存并新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AddressBase
*/
public SaveAndNew(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.saveAndNew instanceof Function)) {
return;
}
xData.saveAndNew().then((response: any) => {
if (!response || response.status !== 200) {
_this.$emit('viewdataschange', JSON.stringify({status:'error',action:'saveAndNew'}));
return;
}
_this.$emit('viewdataschange', JSON.stringify({status:'success',action:'saveAndNew',data:response.data}));
if (xData.autoLoad instanceof Function) {
xData.autoLoad();
}
});
}
/**
* 保存并关闭
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AddressBase
*/
public SaveAndExit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (xData && xData.saveAndExit instanceof Function) {
xData.saveAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
} else if (_this.saveAndExit && _this.saveAndExit instanceof Function) {
_this.saveAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
}
}
/**
* 删除并关闭
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AddressBase
*/
public RemoveAndExit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (xData && xData.removeAndExit instanceof Function) {
xData.removeAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
} else if (_this.removeAndExit && _this.removeAndExit instanceof Function) {
_this.removeAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
}
}
/**
* 开始流程
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AddressBase
*/
public SaveAndStart(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.wfstart instanceof Function)) {
return;
}
xData.wfstart(args).then((response: any) => {
if (!response || response.status !== 200) {
return;
}
const { data: _data } = response;
if(window.parent){
window.parent.postMessage({ ..._data },'*');
}
if (_this.viewdata) {
_this.$emit('viewdataschange', [{ ..._data }]);
_this.$emit('close');
}else if (this.$tabPageExp) {
this.$tabPageExp.onClose(this.$route.fullPath);
}
});
}
/**
* 当前流程步骤
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AddressBase
*/
public ViewWFStep(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let _this:any = this;
if (!xData || !(xData.wfsubmit instanceof Function)) {
return;
}
xData.wfsubmit(args).then((response: any) => {
if (!response || response.status !== 200) {
return;
}
const { data: _data } = response;
if (_this.viewdata) {
_this.$emit('viewdataschange', [{ ..._data }]);
_this.$emit('close');
} else if (_this.$tabPageExp) {
_this.$tabPageExp.onClose(_this.$route.fullPath);
}
});
}
/**
* 新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AddressBase
*/
public New(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 拷贝
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AddressBase
*/
public Copy(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
if (args.length > 0) {
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 打印
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof AccountEdit_AddressBase
*/
public Print(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let _this:any = this;
if (!xData || !(xData.print instanceof Function) || !$event) {
return ;
}
xData.print();
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof AccountEdit_AddressBase
*/
public closeView(args: any[]): void {
let _view: any = this;
if (_view.viewdata) {
_view.$emit('viewdataschange', [args]);
_view.$emit('close', [args]);
} else if (_view.$tabPageExp) {
_view.$tabPageExp.onClose(_view.$route.fullPath);
}
}
/**
* 销毁视图回调
*
* @memberof AccountEdit_AddressBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof AccountEdit_AddressBase
*/
public afterDestroyed(){
if(this.viewDefaultUsage){
let localStoreLength = Object.keys(localStorage);
if(localStoreLength.length > 0){
localStoreLength.forEach((item:string) =>{
if(item.startsWith(this.context.srfsessionid)){
localStorage.removeItem(item);
}
})
}
}
}
}
</script>
<style lang='less'>
@import './account-edit-address.less';
</style>
\ No newline at end of file
// 避免空文件,后台不让空文件过
.account-edit-address {
--account-edit-address: 0;
}
// 视图样式
// this is less
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import AccountEdit_AddressBase from './account-edit-address-base.vue';
import view_form from '@widgets/account/edit-address-form/edit-address-form.vue';
@Component({
components: {
view_form,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
},
})
export default class AccountEdit_Address extends AccountEdit_AddressBase {
}
</script>
\ No newline at end of file
......@@ -920,7 +920,7 @@ export default class ContactGridViewBase extends Vue {
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'editview', parameterName: 'editview' },
{ pathName: 'tabexpview', parameterName: 'tabexpview' },
];
const _this: any = this;
const openIndexViewTab = (data: any) => {
......
......@@ -7,6 +7,8 @@ export const PageComponents = {
Vue.component('sales-order-edit-view', () => import('@pages/sales/sales-order-edit-view/sales-order-edit-view.vue'));
Vue.component('account-edit-view', () => import('@pages/base/account-edit-view/account-edit-view.vue'));
Vue.component('fax-edit-view', () => import('@pages/base/fax-edit-view/fax-edit-view.vue'));
Vue.component('contact-abstract-edit-view9', () => import('@pages/base/contact-abstract-edit-view9/contact-abstract-edit-view9.vue'));
Vue.component('lead-pickup-view', () => import('@pages/sales/lead-pickup-view/lead-pickup-view.vue'));
Vue.component('incident-edit-view', () => import('@pages/service/incident-edit-view/incident-edit-view.vue'));
Vue.component('activity-pointer-edit-view', () => import('@pages/base/activity-pointer-edit-view/activity-pointer-edit-view.vue'));
Vue.component('lead-grid-view', () => import('@pages/sales/lead-grid-view/lead-grid-view.vue'));
......@@ -23,13 +25,15 @@ export const PageComponents = {
Vue.component('opportunity-grid-view', () => import('@pages/sales/opportunity-grid-view/opportunity-grid-view.vue'));
Vue.component('letter-edit-view', () => import('@pages/base/letter-edit-view/letter-edit-view.vue'));
Vue.component('goal-edit-view', () => import('@pages/sales/goal-edit-view/goal-edit-view.vue'));
Vue.component('contact-edit-view', () => import('@pages/base/contact-edit-view/contact-edit-view.vue'));
Vue.component('transaction-currency-pickup-view', () => import('@pages/base/transaction-currency-pickup-view/transaction-currency-pickup-view.vue'));
Vue.component('account-address', () => import('@pages/base/account-address/account-address.vue'));
Vue.component('contact-detail-info-edit-view9', () => import('@pages/base/contact-detail-info-edit-view9/contact-detail-info-edit-view9.vue'));
Vue.component('appointment-edit-view', () => import('@pages/base/appointment-edit-view/appointment-edit-view.vue'));
Vue.component('account-edit-address', () => import('@pages/base/account-edit-address/account-edit-address.vue'));
Vue.component('contact-tab-exp-view', () => import('@pages/base/contact-tab-exp-view/contact-tab-exp-view.vue'));
Vue.component('email-edit-view', () => import('@pages/base/email-edit-view/email-edit-view.vue'));
Vue.component('contact-pickup-grid-view', () => import('@pages/base/contact-pickup-grid-view/contact-pickup-grid-view.vue'));
Vue.component('goal-grid-view', () => import('@pages/sales/goal-grid-view/goal-grid-view.vue'));
Vue.component('transaction-currency-pickup-grid-view', () => import('@pages/base/transaction-currency-pickup-grid-view/transaction-currency-pickup-grid-view.vue'));
Vue.component('contact-grid-view', () => import('@pages/base/contact-grid-view/contact-grid-view.vue'));
Vue.component('service-appointment-edit-view', () => import('@pages/service/service-appointment-edit-view/service-appointment-edit-view.vue'));
Vue.component('account-grid-view', () => import('@pages/base/account-grid-view/account-grid-view.vue'));
......@@ -39,9 +43,9 @@ export const PageComponents = {
Vue.component('account-pickup-view', () => import('@pages/base/account-pickup-view/account-pickup-view.vue'));
Vue.component('price-level-pickup-grid-view', () => import('@pages/product/price-level-pickup-grid-view/price-level-pickup-grid-view.vue'));
Vue.component('ibiz-list-grid-view', () => import('@pages/marketing/ibiz-list-grid-view/ibiz-list-grid-view.vue'));
Vue.component('account-edit-account-info', () => import('@pages/base/account-edit-account-info/account-edit-account-info.vue'));
Vue.component('product-grid-view', () => import('@pages/product/product-grid-view/product-grid-view.vue'));
Vue.component('sales-literature-edit-view', () => import('@pages/sales/sales-literature-edit-view/sales-literature-edit-view.vue'));
Vue.component('lead-pickup-grid-view', () => import('@pages/sales/lead-pickup-grid-view/lead-pickup-grid-view.vue'));
Vue.component('account-pickup-grid-view', () => import('@pages/base/account-pickup-grid-view/account-pickup-grid-view.vue'));
Vue.component('account-info', () => import('@pages/base/account-info/account-info.vue'));
Vue.component('account-major-contact', () => import('@pages/base/account-major-contact/account-major-contact.vue'));
......@@ -57,6 +61,8 @@ export const PageComponents = {
Vue.component('ibiz-list-edit-view', () => import('@pages/marketing/ibiz-list-edit-view/ibiz-list-edit-view.vue'));
Vue.component('quote-edit-view', () => import('@pages/sales/quote-edit-view/quote-edit-view.vue'));
Vue.component('incident-grid-view', () => import('@pages/service/incident-grid-view/incident-grid-view.vue'));
Vue.component('account-edit-account-info', () => import('@pages/base/account-edit-account-info/account-edit-account-info.vue'));
Vue.component('account-edit-address', () => import('@pages/base/account-edit-address/account-edit-address.vue'));
Vue.component('contact-pickup-view', () => import('@pages/base/contact-pickup-view/contact-pickup-view.vue'));
}
};
\ No newline at end of file
......@@ -133,6 +133,34 @@ const router = new Router({
},
component: () => import('@pages/base/fax-edit-view/fax-edit-view.vue'),
},
{
path: 'contacts/:contact?/abstracteditview9/:abstracteditview9?',
meta: {
caption: 'entities.contact.views.abstracteditview9.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'abstracteditview9', parameterName: 'abstracteditview9' },
],
requireAuth: true,
},
component: () => import('@pages/base/contact-abstract-edit-view9/contact-abstract-edit-view9.vue'),
},
{
path: 'leads/:lead?/pickupview/:pickupview?',
meta: {
caption: 'entities.lead.views.pickupview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'leads', parameterName: 'lead' },
{ pathName: 'pickupview', parameterName: 'pickupview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/lead-pickup-view/lead-pickup-view.vue'),
},
{
path: 'incidents/:incident?/editview/:editview?',
meta: {
......@@ -371,18 +399,18 @@ const router = new Router({
component: () => import('@pages/sales/goal-edit-view/goal-edit-view.vue'),
},
{
path: 'contacts/:contact?/editview/:editview?',
path: 'transactioncurrencies/:transactioncurrency?/pickupview/:pickupview?',
meta: {
caption: 'entities.contact.views.editview.title',
caption: 'entities.transactioncurrency.views.pickupview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'editview', parameterName: 'editview' },
{ pathName: 'transactioncurrencies', parameterName: 'transactioncurrency' },
{ pathName: 'pickupview', parameterName: 'pickupview' },
],
requireAuth: true,
},
component: () => import('@pages/base/contact-edit-view/contact-edit-view.vue'),
component: () => import('@pages/base/transaction-currency-pickup-view/transaction-currency-pickup-view.vue'),
},
{
path: 'accounts/:account?/address/:address?',
......@@ -398,6 +426,20 @@ const router = new Router({
},
component: () => import('@pages/base/account-address/account-address.vue'),
},
{
path: 'contacts/:contact?/detailinfoeditview9/:detailinfoeditview9?',
meta: {
caption: 'entities.contact.views.detailinfoeditview9.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'detailinfoeditview9', parameterName: 'detailinfoeditview9' },
],
requireAuth: true,
},
component: () => import('@pages/base/contact-detail-info-edit-view9/contact-detail-info-edit-view9.vue'),
},
{
path: 'appointments/:appointment?/editview/:editview?',
meta: {
......@@ -426,6 +468,20 @@ const router = new Router({
},
component: () => import('@pages/base/account-edit-address/account-edit-address.vue'),
},
{
path: 'contacts/:contact?/tabexpview/:tabexpview?',
meta: {
caption: 'entities.contact.views.tabexpview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'tabexpview', parameterName: 'tabexpview' },
],
requireAuth: true,
},
component: () => import('@pages/base/contact-tab-exp-view/contact-tab-exp-view.vue'),
},
{
path: 'emails/:email?/editview/:editview?',
meta: {
......@@ -468,6 +524,20 @@ const router = new Router({
},
component: () => import('@pages/sales/goal-grid-view/goal-grid-view.vue'),
},
{
path: 'transactioncurrencies/:transactioncurrency?/pickupgridview/:pickupgridview?',
meta: {
caption: 'entities.transactioncurrency.views.pickupgridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'transactioncurrencies', parameterName: 'transactioncurrency' },
{ pathName: 'pickupgridview', parameterName: 'pickupgridview' },
],
requireAuth: true,
},
component: () => import('@pages/base/transaction-currency-pickup-grid-view/transaction-currency-pickup-grid-view.vue'),
},
{
path: 'contacts/:contact?/gridview/:gridview?',
meta: {
......@@ -636,6 +706,20 @@ const router = new Router({
},
component: () => import('@pages/sales/sales-literature-edit-view/sales-literature-edit-view.vue'),
},
{
path: 'leads/:lead?/pickupgridview/:pickupgridview?',
meta: {
caption: 'entities.lead.views.pickupgridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'leads', parameterName: 'lead' },
{ pathName: 'pickupgridview', parameterName: 'pickupgridview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/lead-pickup-grid-view/lead-pickup-grid-view.vue'),
},
{
path: 'accounts/:account?/pickupgridview/:pickupgridview?',
meta: {
......@@ -888,6 +972,19 @@ const router = new Router({
},
component: () => import('@pages/service/incident-edit-view/incident-edit-view.vue'),
},
{
path: '/accounts/:account?/edit_accountinfo/:edit_accountinfo?',
meta: {
caption: 'entities.account.views.edit_accountinfo.title',
info:'',
parameters: [
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'edit_accountinfo', parameterName: 'edit_accountinfo' },
],
requireAuth: true,
},
component: () => import('@pages/base/account-edit-account-info/account-edit-account-info.vue'),
},
{
path: '/salesorders/:salesorder?/editview/:editview?',
meta: {
......@@ -1148,6 +1245,19 @@ const router = new Router({
},
component: () => import('@pages/base/account-edit-view/account-edit-view.vue'),
},
{
path: '/accounts/:account?/edit_address/:edit_address?',
meta: {
caption: 'entities.account.views.edit_address.title',
info:'',
parameters: [
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'edit_address', parameterName: 'edit_address' },
],
requireAuth: true,
},
component: () => import('@pages/base/account-edit-address/account-edit-address.vue'),
},
{
path: '/accounts/:account?/introduction/:introduction?',
meta: {
......
......@@ -44,6 +44,7 @@ export class EntityServiceRegister {
this.allEntityService.set('pricelevel', () => import('@/service/price-level/price-level-service'));
this.allEntityService.set('email', () => import('@/service/email/email-service'));
this.allEntityService.set('serviceappointment', () => import('@/service/service-appointment/service-appointment-service'));
this.allEntityService.set('transactioncurrency', () => import('@/service/transaction-currency/transaction-currency-service'));
this.allEntityService.set('opportunity', () => import('@/service/opportunity/opportunity-service'));
this.allEntityService.set('goal', () => import('@/service/goal/goal-service'));
this.allEntityService.set('invoice', () => import('@/service/invoice/invoice-service'));
......
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 货币服务对象基类
*
* @export
* @class TransactionCurrencyServiceBase
* @extends {EntityServie}
*/
export default class TransactionCurrencyServiceBase extends EntityService {
/**
* Creates an instance of TransactionCurrencyServiceBase.
*
* @param {*} [opts={}]
* @memberof TransactionCurrencyServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof TransactionCurrencyServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='transactioncurrency';
this.APPDEKEY = 'transactioncurrencyid';
this.APPDENAME = 'transactioncurrencies';
this.APPDETEXT = 'currencyname';
this.APPNAME = 'businesscentral';
this.SYSTEMNAME = 'ibizbusinesscentral';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TransactionCurrencyServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`/transactioncurrencies/${context.transactioncurrency}/select`,isloading);
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TransactionCurrencyServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/transactioncurrencies/${context.transactioncurrency}`,isloading);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TransactionCurrencyServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/transactioncurrencies/${context.transactioncurrency}`,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TransactionCurrencyServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/transactioncurrencies/${context.transactioncurrency}/save`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TransactionCurrencyServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/transactioncurrencies/${context.transactioncurrency}`,data,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TransactionCurrencyServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/transactioncurrencies`,data,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TransactionCurrencyServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/transactioncurrencies/getdraft`,isloading);
res.data.transactioncurrency = data.transactioncurrency;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TransactionCurrencyServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/transactioncurrencies/${context.transactioncurrency}/checkkey`,data,isloading);
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TransactionCurrencyServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/transactioncurrencies/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import TransactionCurrencyServiceBase from './transaction-currency-service-base';
/**
* 货币服务对象
*
* @export
* @class TransactionCurrencyService
* @extends {TransactionCurrencyServiceBase}
*/
export default class TransactionCurrencyService extends TransactionCurrencyServiceBase {
/**
* Creates an instance of TransactionCurrencyService.
*
* @param {*} [opts={}]
* @memberof TransactionCurrencyService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
......@@ -20,7 +20,7 @@ export const viewstate: any = {
viewdatachange: false,
refviews: [
'e404dc93e70d6284d4e1a083017625ed',
'9a96ebf2e57358b3590b9d4479edb77a',
'fcdb236b65d78c4a8ae64e74f9483a63',
],
},
{
......@@ -32,6 +32,17 @@ export const viewstate: any = {
refviews: [
],
},
{
viewtag: '0d25ba75b06acd9c995642d0a45fcd2c',
viewmodule: 'Base',
viewname: 'AccountEdit_AccountInfo',
viewaction: '',
viewdatachange: false,
refviews: [
'8b806fb12589b2fc17d1bb90f4b5422e',
'29bfcd628ab25e297248ff0524d12908',
],
},
{
viewtag: '0ff3eacd51054572cf899247b1c57018',
viewmodule: 'Sales',
......@@ -249,6 +260,15 @@ export const viewstate: any = {
'29bfcd628ab25e297248ff0524d12908',
],
},
{
viewtag: '728b69e2de09e7920b86712bc17ea963',
viewmodule: 'Base',
viewname: 'AccountEdit_Address',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
{
viewtag: '73bb9f7e653384ca09f8bbbfd580d892',
viewmodule: 'Base',
......
......@@ -80,11 +80,13 @@ export default class ContactUIServiceBase extends UIService {
*/
public initViewMap(){
this.allViewMap.set('MDATAVIEW:',{viewname:'gridview',srfappde:'contacts'});
this.allViewMap.set(':',{viewname:'detailinfoeditview9',srfappde:'contacts'});
this.allViewMap.set(':',{viewname:'pickupgridview',srfappde:'contacts'});
this.allViewMap.set(':',{viewname:'abstracteditview9',srfappde:'contacts'});
this.allViewMap.set('EDITVIEW:',{viewname:'editview',srfappde:'contacts'});
this.allViewMap.set('PICKUPVIEW:',{viewname:'pickupview',srfappde:'contacts'});
this.allViewMap.set(':',{viewname:'optionview',srfappde:'contacts'});
this.allViewMap.set(':',{viewname:'tabexpview',srfappde:'contacts'});
}
/**
......
......@@ -80,7 +80,9 @@ export default class LeadUIServiceBase extends UIService {
*/
public initViewMap(){
this.allViewMap.set('MDATAVIEW:',{viewname:'gridview',srfappde:'leads'});
this.allViewMap.set('PICKUPVIEW:',{viewname:'pickupview',srfappde:'leads'});
this.allViewMap.set('EDITVIEW:',{viewname:'editview',srfappde:'leads'});
this.allViewMap.set(':',{viewname:'pickupgridview',srfappde:'leads'});
}
/**
......
import { Environment } from '@/environments/environment';
import { UIActionTool,Util } from '@/utils';
import UIService from '../ui-service';
import { Subject } from 'rxjs';
import TransactionCurrencyService from '@/service/transaction-currency/transaction-currency-service';
/**
* 货币UI服务对象基类
*
* @export
* @class TransactionCurrencyUIServiceBase
*/
export default class TransactionCurrencyUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof TransactionCurrencyUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof TransactionCurrencyUIServiceBase
*/
public dataService:TransactionCurrencyService = new TransactionCurrencyService();
/**
* 所有关联视图
*
* @memberof TransactionCurrencyUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof TransactionCurrencyUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof TransactionCurrencyUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof TransactionCurrencyUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof TransactionCurrencyUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* Creates an instance of TransactionCurrencyUIServiceBase.
*
* @param {*} [opts={}]
* @memberof TransactionCurrencyUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.initViewMap();
this.initDeMainStateMap();
}
/**
* 初始化视图Map
*
* @memberof TransactionCurrencyUIServiceBase
*/
public initViewMap(){
this.allViewMap.set(':',{viewname:'pickupgridview',srfappde:'transactioncurrencies'});
this.allViewMap.set('PICKUPVIEW:',{viewname:'pickupview',srfappde:'transactioncurrencies'});
}
/**
* 初始化主状态集合
*
* @memberof TransactionCurrencyUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof TransactionCurrencyUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({transactioncurrency:srfkey});
const curData:any = result.data;
//判断当前数据模式,默认为true,todo
const iRealDEModel:boolean = true;
let bDataInWF:boolean = false;
let bWFMode:any = false;
// 计算数据模式
if (this.isEnableWorkflow) {
bDataInWF = await this.dataService.testDataInWF({stateValue:this.stateValue,stateField:this.stateField},curData);
if (bDataInWF) {
bDataInWF = true;
bWFMode = await this.dataService.testUserExistWorklist(null,curData);
}
}
let strPDTViewParam:string = await this.getDESDDEViewPDTParam(curData, bDataInWF, bWFMode);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return this.allViewMap.get(strPDTViewParam);
}
/**
* 获取实际的数据类型
*
* @memberof TransactionCurrencyUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof TransactionCurrencyUIServiceBase
*/
public async getDESDDEViewPDTParam(curData:any, bDataInWF:boolean, bWFMode:boolean){
let strPDTParam:string = '';
if (bDataInWF) {
// 判断数据是否在流程中
}
//多表单,todo
const isEnableMultiForm:boolean = false;
const multiFormDEField:string|null =null;
if (isEnableMultiForm && multiFormDEField) {
const objFormValue:string = curData[multiFormDEField];
if(!Environment.isAppMode){
return 'MOBEDITVIEW'+objFormValue;
}
return 'EDITVIEW'+objFormValue;
}
if(!Environment.isAppMode){
if(this.getDEMainStateTag(curData)){
return `MOBEDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof TransactionCurrencyUIServiceBase
*/
public async getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.error(`当前数据对象不包含属性singleMainField,可能会发生错误`);
}
})
let strTag:String = "";
for (let i = 0; i <= 1; i++) {
let strTag:string = (curData[this.mainStateFields[0]])?(i == 0) ? curData[this.mainStateFields[0]] : "":"";
if (this.mainStateFields.length >= 2) {
for (let j = 0; j <= 1; j++) {
let strTag2:string = (curData[this.mainStateFields[1]])?`${strTag}__${(j == 0) ? curData[this.mainStateFields[1]] : ""}`:strTag;
if (this.mainStateFields.length >= 3) {
for (let k = 0; k <= 1; k++) {
let strTag3:string = (curData[this.mainStateFields[2]])?`${strTag2}__${(k == 0) ? curData[this.mainStateFields[2]] : ""}`:strTag2;
// 判断是否存在
return this.allDeMainStateMap.get(strTag3);
}
}else{
return this.allDeMainStateMap.get(strTag2);
}
}
}else{
return this.allDeMainStateMap.get(strTag);
}
}
return null;
}
}
\ No newline at end of file
import TransactionCurrencyUIServiceBase from './transaction-currency-ui-service-base';
/**
* 货币UI服务对象
*
* @export
* @class TransactionCurrencyUIService
*/
export default class TransactionCurrencyUIService extends TransactionCurrencyUIServiceBase {
/**
* Creates an instance of TransactionCurrencyUIService.
*
* @param {*} [opts={}]
* @memberof TransactionCurrencyUIService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
......@@ -44,6 +44,7 @@ export class UIServiceRegister {
this.allUIService.set('pricelevel', () => import('@/uiservice/price-level/price-level-ui-service'));
this.allUIService.set('email', () => import('@/uiservice/email/email-ui-service'));
this.allUIService.set('serviceappointment', () => import('@/uiservice/service-appointment/service-appointment-ui-service'));
this.allUIService.set('transactioncurrency', () => import('@/uiservice/transaction-currency/transaction-currency-ui-service'));
this.allUIService.set('opportunity', () => import('@/uiservice/opportunity/opportunity-ui-service'));
this.allUIService.set('goal', () => import('@/uiservice/goal/goal-ui-service'));
this.allUIService.set('invoice', () => import('@/uiservice/invoice/invoice-ui-service'));
......
<template>
<i-form :model="this.data" class='app-form' ref='form' id='account_edit_accountinfo' style="">
<input style="display:none;" />
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.account.edit_accountinfo_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.accountname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='accountname' :itemRules="this.rules.accountname" class='' :caption="$t('entities.account.edit_accountinfo_form.details.accountname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.accountname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.accountname" @enter="onEnter($event)" unit="" :disabled="detailsModel.accountname.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.telephone1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='telephone1' :itemRules="this.rules.telephone1" class='' :caption="$t('entities.account.edit_accountinfo_form.details.telephone1')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.telephone1.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.telephone1" @enter="onEnter($event)" unit="" :disabled="detailsModel.telephone1.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.fax.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='fax' :itemRules="this.rules.fax" class='' :caption="$t('entities.account.edit_accountinfo_form.details.fax')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.fax.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.fax" @enter="onEnter($event)" unit="" :disabled="detailsModel.fax.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.websiteurl.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='websiteurl' :itemRules="this.rules.websiteurl" class='' :caption="$t('entities.account.edit_accountinfo_form.details.websiteurl')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.websiteurl.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.websiteurl" @enter="onEnter($event)" unit="" :disabled="detailsModel.websiteurl.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.parentaccountname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='parentaccountname' :itemRules="this.rules.parentaccountname" class='' :caption="$t('entities.account.edit_accountinfo_form.details.parentaccountname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.parentaccountname.error" :isEmptyCaption="false" labelPos="LEFT">
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.parentaccountname.disabled"
name='parentaccountname'
deMajorField='accountname'
deKeyField='account'
:service="service"
:acParams="{ serviceName: 'AccountService', interfaceName: 'FetchDefault'}"
valueitem='parentaccountid'
:value="data.parentaccountname"
editortype=""
:pickupView="{ viewname: 'account-pickup-view', title: $t('entities.account.views.pickupview.title'), deResParameters: [], parameters: [{ pathName: 'accounts', parameterName: 'account' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange">
</app-picker>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.tickersymbol.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='tickersymbol' :itemRules="this.rules.tickersymbol" class='' :caption="$t('entities.account.edit_accountinfo_form.details.tickersymbol')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.tickersymbol.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.tickersymbol" @enter="onEnter($event)" unit="" :disabled="detailsModel.tickersymbol.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.customertypecode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='customertypecode' :itemRules="this.rules.customertypecode" class='' :caption="$t('entities.account.edit_accountinfo_form.details.customertypecode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.customertypecode.error" :isEmptyCaption="false" labelPos="LEFT">
<dropdown-list
v-model="data.customertypecode"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.customertypecode.disabled"
tag='Account__CustomerTypeCode'
codelistType='STATIC'
placeholder='请选择...' style="">
</dropdown-list>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.defaultpricelevelname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='defaultpricelevelname' :itemRules="this.rules.defaultpricelevelname" class='' :caption="$t('entities.account.edit_accountinfo_form.details.defaultpricelevelname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.defaultpricelevelname.error" :isEmptyCaption="false" labelPos="LEFT">
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.defaultpricelevelname.disabled"
name='defaultpricelevelname'
deMajorField='pricelevelname'
deKeyField='pricelevel'
:service="service"
:acParams="{ serviceName: 'PriceLevelService', interfaceName: 'FetchDefault'}"
valueitem='defaultpricelevelid'
:value="data.defaultpricelevelname"
editortype=""
:pickupView="{ viewname: 'price-level-pickup-view', title: $t('entities.pricelevel.views.pickupview.title'), deResParameters: [], parameters: [{ pathName: 'pricelevels', parameterName: 'pricelevel' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange">
</app-picker>
</app-form-item>
</i-col>
</row>
</app-form-group>
</i-col>
</row>
</i-form>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils';
import AccountService from '@/service/account/account-service';
import Edit_AccountInfoService from './edit-account-info-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
@Component({
components: {
}
})
export default class Edit_AccountInfoBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Edit_AccountInfo
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Edit_AccountInfo
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Edit_AccountInfo
*/
@Prop() public context: any;
/**
* 视图参数
*
* @type {*}
* @memberof Edit_AccountInfo
*/
@Prop() public viewparams: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Edit_AccountInfo
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Edit_AccountInfo
*/
public getControlType(): string {
return 'FORM'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Edit_AccountInfo
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {Edit_AccountInfoService}
* @memberof Edit_AccountInfo
*/
public service: Edit_AccountInfoService = new Edit_AccountInfoService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof Edit_AccountInfo
*/
public appEntityService: AccountService = new AccountService({ $store: this.$store });
/**
* 关闭视图
*
* @param {any} args
* @memberof Edit_AccountInfo
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Edit_AccountInfo
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 工作流审批意见控件绑定值
*
* @memberof Edit_AccountInfo
*/
public srfwfmemo:string = "";
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Edit_AccountInfo
*/
public getDatas(): any[] {
return [this.data];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Edit_AccountInfo
*/
public getData(): any {
return this.data;
}
/**
* 是否默认保存
*
* @type {boolean}
* @memberof Edit_AccountInfo
*/
@Prop({ default: false }) public autosave?: boolean;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof Edit_AccountInfo
*/
@Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 部件行为--submit
*
* @type {string}
* @memberof Edit_AccountInfo
*/
@Prop() public WFSubmitAction!: string;
/**
* 部件行为--start
*
* @type {string}
* @memberof Edit_AccountInfo
*/
@Prop() public WFStartAction!: string;
/**
* 部件行为--update
*
* @type {string}
* @memberof Edit_AccountInfo
*/
@Prop() public updateAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof Edit_AccountInfo
*/
@Prop() public removeAction!: string;
/**
* 部件行为--loaddraft
*
* @type {string}
* @memberof Edit_AccountInfo
*/
@Prop() public loaddraftAction!: string;
/**
* 部件行为--load
*
* @type {string}
* @memberof Edit_AccountInfo
*/
@Prop() public loadAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof Edit_AccountInfo
*/
@Prop() public createAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof Edit_AccountInfo
*/
@Prop() public searchAction!: string;
/**
* 视图标识
*
* @type {string}
* @memberof Edit_AccountInfo
*/
@Prop() public viewtag!: string;
/**
* 表单状态
*
* @type {Subject<any>}
* @memberof Edit_AccountInfo
*/
public formState: Subject<any> = new Subject();
/**
* 忽略表单项值变化
*
* @type {boolean}
* @memberof Edit_AccountInfo
*/
public ignorefieldvaluechange: boolean = false;
/**
* 数据变化
*
* @public
* @type {Subject<any>}
* @memberof Edit_AccountInfo
*/
public dataChang: Subject<any> = new Subject();
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Edit_AccountInfo
*/
public dataChangEvent: Subscription | undefined;
/**
* 原始数据
*
* @public
* @type {*}
* @memberof Edit_AccountInfo
*/
public oldData: any = {};
/**
* 表单数据对象
*
* @type {*}
* @memberof Edit_AccountInfo
*/
public data: any = {
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
srfsourcekey: null,
accountname: null,
telephone1: null,
fax: null,
websiteurl: null,
parentaccountname: null,
tickersymbol: null,
customertypecode: null,
defaultpricelevelname: null,
defaultpricelevelid: null,
parentaccountid: null,
accountid: null,
account:null,
};
/**
* 当前执行的行为逻辑
*
* @type {string}
* @memberof Edit_AccountInfo
*/
public currentAction: string = "";
/**
* 关系界面计数器
*
* @type {number}
* @memberof Edit_AccountInfo
*/
public drcounter: number = 0;
/**
* 需要等待关系界面保存时,第一次调用save参数的备份
*
* @type {number}
* @memberof Edit_AccountInfo
*/
public drsaveopt: any = {};
/**
* 表单保存回调存储对象
*
* @type {any}
* @memberof Edit_AccountInfo
*/
public saveState:any ;
/**
* 属性值规则
*
* @type {*}
* @memberof Edit_AccountInfo
*/
public rules: any = {
srfupdatedate: [
{ type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'blur' },
],
srforikey: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfkey: [
{ type: 'string', message: '客户 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '客户 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '客户 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '客户 值不能为空', trigger: 'blur' },
],
srfmajortext: [
{ type: 'string', message: '客户名称 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '客户名称 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '客户名称 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '客户名称 值不能为空', trigger: 'blur' },
],
srftempmode: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfuf: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfdeid: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfsourcekey: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
accountname: [
{ type: 'string', message: '客户名称 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '客户名称 值必须为字符串类型', trigger: 'blur' },
{ required: true, type: 'string', message: '客户名称 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '客户名称 值不能为空', trigger: 'blur' },
],
telephone1: [
{ type: 'string', message: '主要电话 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '主要电话 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '主要电话 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '主要电话 值不能为空', trigger: 'blur' },
],
fax: [
{ type: 'string', message: '传真 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '传真 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '传真 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '传真 值不能为空', trigger: 'blur' },
],
websiteurl: [
{ type: 'string', message: '网站 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '网站 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '网站 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '网站 值不能为空', trigger: 'blur' },
],
parentaccountname: [
{ type: 'string', message: '上级单位 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '上级单位 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '上级单位 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '上级单位 值不能为空', trigger: 'blur' },
],
tickersymbol: [
{ type: 'string', message: '股票代号 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '股票代号 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '股票代号 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '股票代号 值不能为空', trigger: 'blur' },
],
customertypecode: [
{ type: 'string', message: '关系类型 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '关系类型 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '关系类型 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '关系类型 值不能为空', trigger: 'blur' },
],
defaultpricelevelname: [
{ type: 'string', message: '价目表 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '价目表 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '价目表 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '价目表 值不能为空', trigger: 'blur' },
],
defaultpricelevelid: [
{ type: 'string', message: '价目表 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '价目表 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '价目表 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '价目表 值不能为空', trigger: 'blur' },
],
parentaccountid: [
{ type: 'string', message: '上级单位 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '上级单位 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '上级单位 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '上级单位 值不能为空', trigger: 'blur' },
],
accountid: [
{ type: 'string', message: '客户 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '客户 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '客户 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '客户 值不能为空', trigger: 'blur' },
],
}
/**
* 详情模型集合
*
* @type {*}
* @memberof Edit_AccountInfo
*/
public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '客户基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: 'entities.account.edit_accountinfo_form', extractMode: 'ITEM', details: [] } })
,
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 0 })
,
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfkey: new FormItemModel({ caption: '客户', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 1 })
,
srfmajortext: new FormItemModel({ caption: '客户名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
accountname: new FormItemModel({ caption: '客户名称', detailType: 'FORMITEM', name: 'accountname', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
telephone1: new FormItemModel({ caption: '主要电话', detailType: 'FORMITEM', name: 'telephone1', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
fax: new FormItemModel({ caption: '传真', detailType: 'FORMITEM', name: 'fax', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
websiteurl: new FormItemModel({ caption: '网站', detailType: 'FORMITEM', name: 'websiteurl', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
parentaccountname: new FormItemModel({ caption: '上级单位', detailType: 'FORMITEM', name: 'parentaccountname', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
tickersymbol: new FormItemModel({ caption: '股票代号', detailType: 'FORMITEM', name: 'tickersymbol', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
customertypecode: new FormItemModel({ caption: '关系类型', detailType: 'FORMITEM', name: 'customertypecode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
defaultpricelevelname: new FormItemModel({ caption: '价目表', detailType: 'FORMITEM', name: 'defaultpricelevelname', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
defaultpricelevelid: new FormItemModel({ caption: '价目表', detailType: 'FORMITEM', name: 'defaultpricelevelid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
parentaccountid: new FormItemModel({ caption: '上级单位', detailType: 'FORMITEM', name: 'parentaccountid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
accountid: new FormItemModel({ caption: '客户', detailType: 'FORMITEM', name: 'accountid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 1 })
,
};
/**
* 监控表单属性 srfupdatedate 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.srfupdatedate')
onSrfupdatedateChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfupdatedate', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srforikey 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.srforikey')
onSrforikeyChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srforikey', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfkey 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.srfkey')
onSrfkeyChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfkey', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfmajortext 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.srfmajortext')
onSrfmajortextChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfmajortext', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srftempmode 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.srftempmode')
onSrftempmodeChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srftempmode', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfuf 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.srfuf')
onSrfufChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfuf', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfdeid 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.srfdeid')
onSrfdeidChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfdeid', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfsourcekey 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.srfsourcekey')
onSrfsourcekeyChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfsourcekey', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 accountname 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.accountname')
onAccountnameChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'accountname', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 telephone1 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.telephone1')
onTelephone1Change(newVal: any, oldVal: any) {
this.formDataChange({ name: 'telephone1', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 fax 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.fax')
onFaxChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'fax', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 websiteurl 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.websiteurl')
onWebsiteurlChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'websiteurl', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 parentaccountname 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.parentaccountname')
onParentaccountnameChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'parentaccountname', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 tickersymbol 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.tickersymbol')
onTickersymbolChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'tickersymbol', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 customertypecode 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.customertypecode')
onCustomertypecodeChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'customertypecode', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 defaultpricelevelname 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.defaultpricelevelname')
onDefaultpricelevelnameChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'defaultpricelevelname', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 defaultpricelevelid 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.defaultpricelevelid')
onDefaultpricelevelidChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'defaultpricelevelid', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 parentaccountid 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.parentaccountid')
onParentaccountidChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'parentaccountid', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 accountid 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_AccountInfo
*/
@Watch('data.accountid')
onAccountidChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'accountid', newVal: newVal, oldVal: oldVal });
}
/**
* 重置表单项值
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof Edit_AccountInfo
*/
public resetFormData({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
}
/**
* 置空对象
*
* @param {any[]} args
* @memberof EditForm
*/
public ResetData(_datas:any){
if(Object.keys(_datas).length >0){
Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) {
this.data[name] = null;
}
});
}
}
/**
* 表单逻辑
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof Edit_AccountInfo
*/
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
}
/**
* 表单值变化
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @returns {void}
* @memberof Edit_AccountInfo
*/
public formDataChange({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
if (this.ignorefieldvaluechange) {
return;
}
this.resetFormData({ name: name, newVal: newVal, oldVal: oldVal });
this.formLogic({ name: name, newVal: newVal, oldVal: oldVal });
this.dataChang.next(JSON.stringify(this.data));
}
/**
* 表单加载完成
*
* @public
* @param {*} [data={}]
* @param {string} [action]
* @memberof Edit_AccountInfo
*/
public onFormLoad(data: any = {},action:string): void {
if(Object.is(action,"save") || Object.is(action,"autoSave") || Object.is(action,"submit"))
// 更新context的实体主键
if(data.account){
Object.assign(this.context,{account:data.account})
}
this.setFormEnableCond(data);
this.fillForm(data,action);
this.oldData = {};
Object.assign(this.oldData, JSON.parse(JSON.stringify(this.data)));
this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: false });
this.formLogic({ name: '', newVal: null, oldVal: null });
}
/**
* 值填充
*
* @param {*} [_datas={}]
* @param {string} [action]
* @memberof Edit_AccountInfo
*/
public fillForm(_datas: any = {},action:string): void {
this.ignorefieldvaluechange = true;
Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) {
this.data[name] = _datas[name];
}
});
if(Object.is(action,'loadDraft')){
this.createDefault();
}
if(Object.is(action,'load')){
this.updateDefault();
}
this.$nextTick(function () {
this.ignorefieldvaluechange = false;
})
}
/**
* 设置表单项是否启用
*
* @public
* @param {*} data
* @memberof Edit_AccountInfo
*/
public setFormEnableCond(data: any): void {
Object.values(this.detailsModel).forEach((detail: any) => {
if (!Object.is(detail.detailType, 'FORMITEM')) {
return;
}
const formItem: FormItemModel = detail;
formItem.setEnableCond(data.srfuf);
});
}
/**
* 重置草稿表单状态
*
* @public
* @memberof Edit_AccountInfo
*/
public resetDraftFormStates(): void {
const form: any = this.$refs.form;
if (form) {
form.resetFields();
}
}
/**
* 重置校验结果
*
* @memberof Edit_AccountInfo
*/
public resetValidates(): void {
Object.values(this.detailsModel).forEach((detail: any) => {
if (!Object.is(detail.detailType, 'FORMITEM')) {
return;
}
const formItem: FormItemModel = detail;
formItem.setError('');
});
}
/**
* 填充校验结果 (后台)
*
* @param {any[]} fieldErrors
* @memberof Edit_AccountInfo
*/
public fillValidates(fieldErrors: any[]): void {
fieldErrors.forEach((error: any) => {
const formItem: FormItemModel = this.detailsModel[error.field];
if (!formItem) {
return;
}
this.$nextTick(() => {
formItem.setError(error.message);
});
});
}
/**
* 表单校验状态
*
* @returns {boolean}
* @memberof Edit_AccountInfo
*/
public formValidateStatus(): boolean {
const form: any = this.$refs.form;
let validatestate: boolean = true;
form.validate((valid: boolean) => {
validatestate = valid ? true : false;
});
return validatestate
}
/**
* 获取全部值
*
* @returns {*}
* @memberof Edit_AccountInfo
*/
public getValues(): any {
return this.data;
}
/**
* 表单项值变更
*
* @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof Edit_AccountInfo
*/
public onFormItemValueChange($event: { name: string, value: any }): void {
if (!$event) {
return;
}
if (!$event.name || Object.is($event.name, '') || !this.data.hasOwnProperty($event.name)) {
return;
}
this.data[$event.name] = $event.value;
}
/**
* 设置数据项值
*
* @param {string} name
* @param {*} value
* @returns {void}
* @memberof Edit_AccountInfo
*/
public setDataItemValue(name: string, value: any): void {
if (!name || Object.is(name, '') || !this.data.hasOwnProperty(name)) {
return;
}
if (Object.is(this.data[name], value)) {
return;
}
this.data[name] = value;
}
/**
* 分组界面行为事件
*
* @param {*} $event
* @memberof Edit_AccountInfo
*/
public groupUIActionClick($event: any): void {
if (!$event) {
return;
}
const item:any = $event.item;
}
/**
* Vue声明周期(处理组件的输入属性)
*
* @memberof Edit_AccountInfo
*/
public created(): void {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Edit_AccountInfo
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('autoload', action)) {
this.autoLoad(data);
}
if (Object.is('load', action)) {
this.load(data);
}
if (Object.is('loaddraft', action)) {
if(this.context.srfsourcekey){
this.copy(this.context.srfsourcekey);
}else{
this.loadDraft(data);
}
}
if (Object.is('save', action)) {
this.save(data,data.showResultInfo);
}
if (Object.is('remove', action)) {
this.remove(data);
}
if (Object.is('saveandexit', action)) {
this.saveAndExit(data);
}
if (Object.is('saveandnew', action)) {
this.saveAndNew(data);
}
if (Object.is('removeandexit', action)) {
this.removeAndExit(data);
}
if (Object.is('refresh', action)) {
this.refresh(data);
}
});
}
this.dataChang
.pipe(
debounceTime(300),
distinctUntilChanged()
).subscribe((data: any) => {
if (this.autosave) {
this.autoSave();
}
const state = !Object.is(JSON.stringify(this.oldData), JSON.stringify(this.data)) ? true : false;
this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: state });
});
}
/**
* vue 生命周期
*
* @memberof Edit_AccountInfo
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Edit_AccountInfo
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if (this.dataChangEvent) {
this.dataChangEvent.unsubscribe();
}
}
/**
* 拷贝内容
*
* @param {*} [arg={}]
* @memberof @memberof Edit_AccountInfo
*/
public copy(srfkey: string): void {
let copyData = this.$store.getters.getCopyData(srfkey);
copyData.srfkey = Util.createUUID();
copyData.account = copyData.srfkey;
copyData.accountid = copyData.srfkey;
Object.assign(this.context,{account:copyData.account})
this.data = copyData;
this.$nextTick(() => {
this.formState.next({ type: 'load', data: copyData });
this.data.srfuf = '0';
this.setFormEnableCond(this.data);
});
}
/**
*打印
*@memberof @memberof Edit_AccountInfo
*/
public print(){
let _this:any = this;
_this.$print({id:'account_edit_accountinfo',popTitle:'编辑表单_账户信息'});
}
/**
* 部件刷新
*
* @param {any[]} args
* @memberof Edit_AccountInfo
*/
public refresh(args: any[]): void {
let arg: any = {};
Object.assign(arg,args[0]);
if (this.data.srfkey && !Object.is(this.data.srfkey, '')) {
Object.assign(arg, { srfkey: this.data.srfkey });
this.load(arg);
return;
}
if (this.data.srfkeys && !Object.is(this.data.srfkeys, '')) {
Object.assign(arg, { srfkey: this.data.srfkeys });
this.load(arg);
return;
}
}
/**
* 自动加载
*
* @param {*} [arg={}]
* @returns {void}
* @memberof Edit_AccountInfo
*/
public autoLoad(arg: any = {}): void {
if (arg.srfkey && !Object.is(arg.srfkey, '')) {
Object.assign(arg, { srfkey: arg.srfkey });
this.load(arg);
return;
}
if (arg.srfkeys && !Object.is(arg.srfkeys, '')) {
Object.assign(arg, { srfkey: arg.srfkeys });
this.load(arg);
return;
}
this.loadDraft(arg);
}
/**
* 加载
*
* @public
* @param {*} [opt={}]
* @memberof Edit_AccountInfo
*/
public load(opt: any = {}): void {
if(!this.loadAction){
this.$Notice.error({ title: '错误', desc: 'AccountEdit_AccountInfo视图表单loadAction参数未配置' });
return;
}
const arg: any = { ...opt };
let viewparamResult:any = Object.assign(arg,this.viewparams);
const get: Promise<any> = this.service.get(this.loadAction,JSON.parse(JSON.stringify(this.context)),{viewparams:viewparamResult}, this.showBusyIndicator);
get.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
this.onFormLoad(data,'load');
this.$emit('load', data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
}
/**
* 加载草稿
*
* @param {*} [opt={}]
* @memberof Edit_AccountInfo
*/
public loadDraft(opt: any = {}): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: 'AccountEdit_AccountInfo视图表单loaddraftAction参数未配置' });
return;
}
const arg: any = { ...opt } ;
let viewparamResult:any = Object.assign(arg,this.viewparams);
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)),{viewparams:viewparamResult}, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
}
return;
}
const data = response.data;
if(data.account){
Object.assign(this.context,{account:data.account})
}
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
this.$emit('load', data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
setTimeout(() => {
const form: any = this.$refs.form;
if (form) {
form.fields.forEach((field: any) => {
field.validateMessage = "";
field.validateState = "";
field.validateStatus = false;
});
}
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
}
/**
* 自动保存
*
* @param {*} [opt={}]
* @memberof Edit_AccountInfo
*/
public autoSave(opt: any = {}): void {
if (!this.formValidateStatus()) {
return;
}
const arg: any = { ...opt };
const data = this.getValues();
Object.assign(arg, data);
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: '错误', desc: 'AccountEdit_AccountInfo视图表单'+actionName+'参数未配置' });
return;
}
Object.assign(arg,{viewparams:this.viewparams});
const post: Promise<any> = this.service.add(action, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
}
return;
}
const data = response.data;
this.onFormLoad(data,'autoSave');
this.$emit('save', data);
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
}
/**
* 保存
*
* @param {*} [opt={}]
* @param {boolean} [showResultInfo]
* @param {boolean} [ifStateNext] formState是否下发通知
* @returns {Promise<any>}
* @memberof Edit_AccountInfo
*/
public async save(opt: any = {}, showResultInfo?: boolean, ifStateNext: boolean = true): Promise<any> {
return new Promise((resolve: any, reject: any) => {
showResultInfo = showResultInfo === undefined ? true : false;
if (!this.formValidateStatus()) {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
return;
}
const arg: any = { ...opt };
const data = this.getValues();
Object.assign(arg, data);
Object.assign(arg, this.context);
if (ifStateNext) {
this.drcounter = 0;
if(this.drcounter !== 0){
this.drsaveopt = opt;
this.formState.next({ type: 'beforesave', data: arg });//先通知关系界面保存
this.saveState = resolve;
return;
}
}
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: '错误', desc: 'AccountEdit_AccountInfo视图表单'+actionName+'参数未配置' });
return;
}
Object.assign(arg,{viewparams:this.viewparams});
const post: Promise<any> = Object.is(data.srfuf, '1')?this.service.update(action, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator):this.service.add(action,JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
}
return;
}
const data = response.data;
this.onFormLoad(data,'save');
this.$emit('save', data);
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
});
if (showResultInfo) {
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;保存成功!' });
}
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
reject(response);
});
})
}
/**
* 删除
*
* @public
* @param {*} [opt={}]
* @memberof EditForm
*/
public remove(opt:Array<any> = [],showResultInfo?: boolean): Promise<any> {
return new Promise((resolve: any, reject: any) => {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: 'AccountEdit_AccountInfo视图表单removeAction参数未配置' });
return;
}
const arg: any = opt[0];
const _this: any = this;
Object.assign(arg,{viewparams:this.viewparams});
this.service.delete(_this.removeAction, JSON.parse(JSON.stringify(this.context)),arg, showResultInfo).then((response: any) => {
if (response) {
const data = response.data;
this.$emit('remove',data);
this.formState.next({ type: 'remove', data: data });
this.data.ismodify = false;
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;删除成功!' });
resolve(response);
}
}).catch((error: any) => {
const { data: _data } = error;
this.$Notice.error({ title: _data.title, desc: _data.message });
reject(error);
});
});
}
/**
* 工作流启动
*
* @param {*} [data={}]
* @param {*} [localdata={}]
* @returns {Promise<any>}
* @memberof Edit_AccountInfo
*/
public async wfstart(data: any,localdata?:any): Promise<any> {
return new Promise((resolve: any, reject: any) => {
const _this: any = this;
const post: Promise<any> = _this.save({},false);
post.then((response:any) =>{
const arg:any = response.data;
if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams});
}
const result: Promise<any> = this.service.wfstart(_this.WFStartAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator,localdata);
result.then((response: any) => {
if (!response || response.status !== 200) {
if(response.data){
this.$Notice.error({ title: '', desc: '工作流启动失败, ' + response.data.message });
}
return;
}
this.$Notice.info({ title: '', desc: '工作流启动成功' });
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
reject(response);
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
reject(response);
})
});
}
/**
* 工作流提交
*
* @param {*} [data={}]
* @param {*} [localdata={}]
* @returns {Promise<any>}
* @memberof Edit_AccountInfo
*/
public async wfsubmit(data: any,localdata?:any): Promise<any> {
return new Promise((resolve: any, reject: any) => {
const _this: any = this;
const arg: any = data[0];
Object.assign(arg,{viewparams:this.viewparams});
if (!arg.account || Object.is(arg.account, '')) {
return;
}
const post: Promise<any> = Object.is(arg.srfuf, '1')?this.service.update(this.updateAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator):this.service.add(this.createAction,JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
post.then((response:any) =>{
const arg:any = response.data;
// 保存完成UI处理
this.onFormLoad(arg,'save');
this.$emit('save', arg);
this.$nextTick(() => {
this.formState.next({ type: 'save', data: arg });
});
// 准备提交参数
if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams});
}
// 强制补充srfwfmemo
if(this.srfwfmemo){
Object.assign(arg,{srfwfmemo:this.srfwfmemo});
}
const result: Promise<any> = this.service.wfsubmit(_this.WFSubmitAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator,localdata);
result.then((response: any) => {
if (!response || response.status !== 200) {
if(response.data){
this.$Notice.error({ title: '', desc: '工作流提交失败, ' + response.data.message });
}
return;
}
this.onFormLoad(arg,'submit');
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$Notice.info({ title: '', desc: '工作流提交成功' });
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
reject(response);
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
reject(response);
})
})
}
/**
* 表单项更新
*
* @param {string} mode 界面行为名称
* @param {*} [data={}] 请求数据
* @param {string[]} updateDetails 更新项
* @param {boolean} [showloading] 是否显示加载状态
* @returns {void}
* @memberof Edit_AccountInfo
*/
public updateFormItems(mode: string, data: any = {}, updateDetails: string[], showloading?: boolean): void {
if (!mode || (mode && Object.is(mode, ''))) {
return;
}
const arg: any = { ...data };
Object.assign(arg,this.viewparams);
const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(this.context)),arg, showloading);
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '表单项更新失败' });
return;
}
const data = response.data;
const _data: any = {};
updateDetails.forEach((name: string) => {
if (!data.hasOwnProperty(name)) {
return;
}
Object.assign(_data, { [name]: data[name] });
});
this.setFormEnableCond(_data);
this.fillForm(_data,'updateFormItem');
this.formLogic({ name: '', newVal: null, oldVal: null });
this.dataChang.next(JSON.stringify(this.data));
this.$nextTick(() => {
this.formState.next({ type: 'updateformitem', ufimode: arg.srfufimode, data: _data });
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
}
/**
* 回车事件
*
* @param {*} $event
* @memberof Edit_AccountInfo
*/
public onEnter($event: any): void {
}
/**
* 保存并退出
*
* @param {any[]} args
* @memberof Edit_AccountInfo
*/
public saveAndExit(data:any[]):Promise<any>{
let _this = this;
return new Promise((resolve: any, reject: any) =>{
let arg: any = {};
if(data && data.length > 0){
Object.assign(arg,data[0]);
}
_this.currentAction = "saveAndExit";
_this.save([arg]).then((res) =>{
if(res){
_this.closeView(res.data);
}
resolve(res);
}).catch((error) =>{
reject(error);
})
})
}
/**
* 保存并新建
*
* @param {any[]} args
* @memberof Edit_AccountInfo
*/
public saveAndNew(data:any[]):Promise<any>{
let _this = this;
return new Promise((resolve: any, reject: any) =>{
let arg: any = {};
if(data && data.length > 0){
Object.assign(arg,data[0]);
}
_this.currentAction = "saveAndNew";
_this.save([arg]).then((res) =>{
_this.ResetData(res);
_this.loadDraft({});
}).catch((error) =>{
reject(error);
})
})
}
/**
* 删除并退出
*
* @param {any[]} args
* @memberof Edit_AccountInfo
*/
public removeAndExit(data:any[]):Promise<any>{
let _this = this;
return new Promise((resolve: any, reject: any) =>{
let arg: any = {};
if(data && data.length > 0){
Object.assign(arg,data[0]);
}
_this.remove([arg]).then((res) =>{
if(res){
_this.closeView(res.data);
}
resolve(res);
}).catch((error) =>{
reject(error);
})
})
}
/**
* 关系界面数据保存完成
*
* @param {any} $event
* @memberof Edit_AccountInfo
*/
public drdatasaved($event:any){
let _this = this;
this.drcounter--;
if(this.drcounter > 0){
return;
}
this.save(this.drsaveopt, undefined, false).then((res) =>{
this.saveState(res);
this.drsaveopt = {};
if(Object.is(_this.currentAction, "saveAndNew")){
_this.ResetData(res);
_this.loadDraft({});
}else if(Object.is(_this.currentAction, "saveAndExit")){
if(res){
_this.closeView(res.data);
}
}
});
}
/**
* 新建默认值
* @memberof Edit_AccountInfo
*/
public createDefault(){
}
/**
* 更新默认值
* @memberof Edit_AccountInfo
*/
public updateDefault(){
}
}
</script>
<style lang='less'>
@import './edit-account-info-form.less';
</style>
\ No newline at end of file
/**
* Edit_AccountInfo 部件模型
*
* @export
* @class Edit_AccountInfoModel
*/
export default class Edit_AccountInfoModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof Edit_AccountInfoModel
*/
public getDataItems(): any[] {
return [
{
name: 'srfwfmemo',
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'srfupdatedate',
prop: 'updatedate',
dataType: 'DATETIME',
},
{
name: 'srforikey',
},
{
name: 'srfkey',
prop: 'accountid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'accountname',
dataType: 'TEXT',
},
{
name: 'srftempmode',
},
{
name: 'srfuf',
},
{
name: 'srfdeid',
},
{
name: 'srfsourcekey',
},
{
name: 'accountname',
prop: 'accountname',
dataType: 'TEXT',
},
{
name: 'telephone1',
prop: 'telephone1',
dataType: 'TEXT',
},
{
name: 'fax',
prop: 'fax',
dataType: 'TEXT',
},
{
name: 'websiteurl',
prop: 'websiteurl',
dataType: 'TEXT',
},
{
name: 'parentaccountname',
prop: 'parentaccountname',
dataType: 'PICKUPTEXT',
},
{
name: 'tickersymbol',
prop: 'tickersymbol',
dataType: 'TEXT',
},
{
name: 'customertypecode',
prop: 'customertypecode',
dataType: 'SSCODELIST',
},
{
name: 'defaultpricelevelname',
prop: 'defaultpricelevelname',
dataType: 'PICKUPTEXT',
},
{
name: 'defaultpricelevelid',
prop: 'defaultpricelevelid',
dataType: 'PICKUP',
},
{
name: 'parentaccountid',
prop: 'parentaccountid',
dataType: 'PICKUP',
},
{
name: 'accountid',
prop: 'accountid',
dataType: 'GUID',
},
{
name: 'account',
prop: 'accountid',
dataType: 'FONTKEY',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import AccountService from '@/service/account/account-service';
import Edit_AccountInfoModel from './edit-account-info-form-model';
import PriceLevelService from '@/service/price-level/price-level-service';
/**
* Edit_AccountInfo 部件服务对象
*
* @export
* @class Edit_AccountInfoService
*/
export default class Edit_AccountInfoService extends ControlService {
/**
* 客户服务对象
*
* @type {AccountService}
* @memberof Edit_AccountInfoService
*/
public appEntityService: AccountService = new AccountService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof Edit_AccountInfoService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of Edit_AccountInfoService.
*
* @param {*} [opts={}]
* @memberof Edit_AccountInfoService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new Edit_AccountInfoModel();
}
/**
* 价目表服务对象
*
* @type {PriceLevelService}
* @memberof Edit_AccountInfoService
*/
public pricelevelService: PriceLevelService = new PriceLevelService();
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof Edit_AccountInfoService
*/
private doItems(promise: Promise<any>, deKeyField: string, deName: string): Promise<any> {
return new Promise((resolve, reject) => {
promise.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
data.forEach((item:any,index:number) =>{
item[deName] = item[deKeyField];
data[index] = item;
});
resolve(data);
} else {
reject([])
}
}).catch((response: any) => {
reject([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof Edit_AccountInfoService
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
if (Object.is(serviceName, 'AccountService') && Object.is(interfaceName, 'FetchDefault')) {
return this.doItems(this.appEntityService.FetchDefault(JSON.parse(JSON.stringify(context)), data, isloading), 'accountid', 'account');
}
if (Object.is(serviceName, 'PriceLevelService') && Object.is(interfaceName, 'FetchDefault')) {
return this.doItems(this.pricelevelService.FetchDefault(JSON.parse(JSON.stringify(context)),data, isloading), 'pricelevelid', 'pricelevel');
}
return Promise.reject([])
}
/**
* 启动工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof Edit_AccountInfoService
*/
@Errorlog
public wfstart(action: string,context: any = {},data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data);
context = this.handleRequestData(action,context,data).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading,localdata);
} else {
result = this.appEntityService.WFStart(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 提交工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof Edit_AccountInfoService
*/
@Errorlog
public wfsubmit(action: string,context: any = {}, data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data,true);
context = this.handleRequestData(action,context,data).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading,localdata);
} else {
result = this.appEntityService.WFSubmit(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Edit_AccountInfoService
*/
@Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Create(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Edit_AccountInfoService
*/
@Errorlog
public delete(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Remove(Context,Data, isloading);
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Edit_AccountInfoService
*/
@Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Update(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Edit_AccountInfoService
*/
@Errorlog
public get(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Get(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Edit_AccountInfoService
*/
@Errorlog
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
const PrimaryKey = Util.createUUID();
Data.accountid = PrimaryKey;
Data.account = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.accountid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Edit_AccountInfoService
*/
@Errorlog
public frontLogic(action:string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any)=>{
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
return Promise.reject({ status: 500, data: { title: '失败', message: '系统异常' } });
}
result.then((response) => {
this.handleResponse(action, response,true);
resolve(response);
}).catch(response => {
reject(response);
});
})
}
/**
* 处理请求数据
*
* @param action 行为
* @param data 数据
* @memberof Edit_AccountInfoService
*/
public handleRequestData(action: string,context:any, data: any = {}){
let mode: any = this.getMode();
if (!mode && mode.getDataItems instanceof Function) {
return data;
}
let formItemItems: any[] = mode.getDataItems();
let requestData:any = {};
formItemItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.prop){
requestData[item.prop] = data[item.name];
}
}
});
if(data && data.viewparams){
Object.assign(requestData,data.viewparams);
}
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import Edit_AccountInfoBase from './edit-account-info-form-base.vue';
@Component({
components: {
}
})
export default class Edit_AccountInfo extends Edit_AccountInfoBase {
}
</script>
\ No newline at end of file
<template>
<i-form :model="this.data" class='app-form' ref='form' id='account_edit_address' style="">
<input style="display:none;" />
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.account.edit_address_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.address1_addressid.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='address1_addressid' :itemRules="this.rules.address1_addressid" class='' :caption="$t('entities.account.edit_address_form.details.address1_addressid')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.address1_addressid.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.address1_addressid" @enter="onEnter($event)" unit="" :disabled="detailsModel.address1_addressid.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.address1_name.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='address1_name' :itemRules="this.rules.address1_name" class='' :caption="$t('entities.account.edit_address_form.details.address1_name')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.address1_name.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.address1_name" @enter="onEnter($event)" unit="" :disabled="detailsModel.address1_name.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.address1_addresstypecode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='address1_addresstypecode' :itemRules="this.rules.address1_addresstypecode" class='' :caption="$t('entities.account.edit_address_form.details.address1_addresstypecode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.address1_addresstypecode.error" :isEmptyCaption="false" labelPos="LEFT">
<dropdown-list
v-model="data.address1_addresstypecode"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.address1_addresstypecode.disabled"
tag='Account__Address1_AddressTypeCode'
codelistType='STATIC'
placeholder='请选择...' style="">
</dropdown-list>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.address1_country.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='address1_country' :itemRules="this.rules.address1_country" class='' :caption="$t('entities.account.edit_address_form.details.address1_country')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.address1_country.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.address1_country" @enter="onEnter($event)" unit="" :disabled="detailsModel.address1_country.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.address1_stateorprovince.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='address1_stateorprovince' :itemRules="this.rules.address1_stateorprovince" class='' :caption="$t('entities.account.edit_address_form.details.address1_stateorprovince')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.address1_stateorprovince.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.address1_stateorprovince" @enter="onEnter($event)" unit="" :disabled="detailsModel.address1_stateorprovince.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.address1_city.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='address1_city' :itemRules="this.rules.address1_city" class='' :caption="$t('entities.account.edit_address_form.details.address1_city')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.address1_city.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.address1_city" @enter="onEnter($event)" unit="" :disabled="detailsModel.address1_city.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.address1_county.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='address1_county' :itemRules="this.rules.address1_county" class='' :caption="$t('entities.account.edit_address_form.details.address1_county')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.address1_county.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.address1_county" @enter="onEnter($event)" unit="" :disabled="detailsModel.address1_county.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
</row>
</app-form-group>
</i-col>
</row>
</i-form>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils';
import AccountService from '@/service/account/account-service';
import Edit_AddressService from './edit-address-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
@Component({
components: {
}
})
export default class Edit_AddressBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Edit_Address
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Edit_Address
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Edit_Address
*/
@Prop() public context: any;
/**
* 视图参数
*
* @type {*}
* @memberof Edit_Address
*/
@Prop() public viewparams: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Edit_Address
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Edit_Address
*/
public getControlType(): string {
return 'FORM'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Edit_Address
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {Edit_AddressService}
* @memberof Edit_Address
*/
public service: Edit_AddressService = new Edit_AddressService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof Edit_Address
*/
public appEntityService: AccountService = new AccountService({ $store: this.$store });
/**
* 关闭视图
*
* @param {any} args
* @memberof Edit_Address
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Edit_Address
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 工作流审批意见控件绑定值
*
* @memberof Edit_Address
*/
public srfwfmemo:string = "";
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Edit_Address
*/
public getDatas(): any[] {
return [this.data];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Edit_Address
*/
public getData(): any {
return this.data;
}
/**
* 是否默认保存
*
* @type {boolean}
* @memberof Edit_Address
*/
@Prop({ default: false }) public autosave?: boolean;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof Edit_Address
*/
@Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 部件行为--submit
*
* @type {string}
* @memberof Edit_Address
*/
@Prop() public WFSubmitAction!: string;
/**
* 部件行为--start
*
* @type {string}
* @memberof Edit_Address
*/
@Prop() public WFStartAction!: string;
/**
* 部件行为--update
*
* @type {string}
* @memberof Edit_Address
*/
@Prop() public updateAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof Edit_Address
*/
@Prop() public removeAction!: string;
/**
* 部件行为--loaddraft
*
* @type {string}
* @memberof Edit_Address
*/
@Prop() public loaddraftAction!: string;
/**
* 部件行为--load
*
* @type {string}
* @memberof Edit_Address
*/
@Prop() public loadAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof Edit_Address
*/
@Prop() public createAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof Edit_Address
*/
@Prop() public searchAction!: string;
/**
* 视图标识
*
* @type {string}
* @memberof Edit_Address
*/
@Prop() public viewtag!: string;
/**
* 表单状态
*
* @type {Subject<any>}
* @memberof Edit_Address
*/
public formState: Subject<any> = new Subject();
/**
* 忽略表单项值变化
*
* @type {boolean}
* @memberof Edit_Address
*/
public ignorefieldvaluechange: boolean = false;
/**
* 数据变化
*
* @public
* @type {Subject<any>}
* @memberof Edit_Address
*/
public dataChang: Subject<any> = new Subject();
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Edit_Address
*/
public dataChangEvent: Subscription | undefined;
/**
* 原始数据
*
* @public
* @type {*}
* @memberof Edit_Address
*/
public oldData: any = {};
/**
* 表单数据对象
*
* @type {*}
* @memberof Edit_Address
*/
public data: any = {
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
srfsourcekey: null,
address1_addressid: null,
address1_name: null,
address1_addresstypecode: null,
address1_country: null,
address1_stateorprovince: null,
address1_city: null,
address1_county: null,
accountid: null,
account:null,
};
/**
* 当前执行的行为逻辑
*
* @type {string}
* @memberof Edit_Address
*/
public currentAction: string = "";
/**
* 关系界面计数器
*
* @type {number}
* @memberof Edit_Address
*/
public drcounter: number = 0;
/**
* 需要等待关系界面保存时,第一次调用save参数的备份
*
* @type {number}
* @memberof Edit_Address
*/
public drsaveopt: any = {};
/**
* 表单保存回调存储对象
*
* @type {any}
* @memberof Edit_Address
*/
public saveState:any ;
/**
* 属性值规则
*
* @type {*}
* @memberof Edit_Address
*/
public rules: any = {
srfupdatedate: [
{ type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'blur' },
],
srforikey: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfkey: [
{ type: 'string', message: '客户 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '客户 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '客户 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '客户 值不能为空', trigger: 'blur' },
],
srfmajortext: [
{ type: 'string', message: '客户名称 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '客户名称 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '客户名称 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '客户名称 值不能为空', trigger: 'blur' },
],
srftempmode: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfuf: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfdeid: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfsourcekey: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
address1_addressid: [
{ type: 'string', message: '地址 1: ID 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '地址 1: ID 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '地址 1: ID 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '地址 1: ID 值不能为空', trigger: 'blur' },
],
address1_name: [
{ type: 'string', message: '地址 1: 名称 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '地址 1: 名称 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '地址 1: 名称 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '地址 1: 名称 值不能为空', trigger: 'blur' },
],
address1_addresstypecode: [
{ type: 'string', message: '地址 1: 地址类型 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '地址 1: 地址类型 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '地址 1: 地址类型 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '地址 1: 地址类型 值不能为空', trigger: 'blur' },
],
address1_country: [
{ type: 'string', message: '地址 1: 国家/地区 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '地址 1: 国家/地区 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '地址 1: 国家/地区 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '地址 1: 国家/地区 值不能为空', trigger: 'blur' },
],
address1_stateorprovince: [
{ type: 'string', message: '地址 1: 省/市/自治区 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '地址 1: 省/市/自治区 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '地址 1: 省/市/自治区 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '地址 1: 省/市/自治区 值不能为空', trigger: 'blur' },
],
address1_city: [
{ type: 'string', message: '地址 1: 市/县 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '地址 1: 市/县 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '地址 1: 市/县 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '地址 1: 市/县 值不能为空', trigger: 'blur' },
],
address1_county: [
{ type: 'string', message: '地址 1: 县 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '地址 1: 县 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '地址 1: 县 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '地址 1: 县 值不能为空', trigger: 'blur' },
],
accountid: [
{ type: 'string', message: '客户 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '客户 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '客户 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '客户 值不能为空', trigger: 'blur' },
],
}
/**
* 详情模型集合
*
* @type {*}
* @memberof Edit_Address
*/
public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '客户基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: 'entities.account.edit_address_form', extractMode: 'ITEM', details: [] } })
,
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 0 })
,
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfkey: new FormItemModel({ caption: '客户', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 1 })
,
srfmajortext: new FormItemModel({ caption: '客户名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
address1_addressid: new FormItemModel({ caption: '地址 1: ID', detailType: 'FORMITEM', name: 'address1_addressid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
address1_name: new FormItemModel({ caption: '地址 1: 名称', detailType: 'FORMITEM', name: 'address1_name', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
address1_addresstypecode: new FormItemModel({ caption: '地址 1: 地址类型', detailType: 'FORMITEM', name: 'address1_addresstypecode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
address1_country: new FormItemModel({ caption: '地址 1: 国家/地区', detailType: 'FORMITEM', name: 'address1_country', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
address1_stateorprovince: new FormItemModel({ caption: '地址 1: 省/市/自治区', detailType: 'FORMITEM', name: 'address1_stateorprovince', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
address1_city: new FormItemModel({ caption: '地址 1: 市/县', detailType: 'FORMITEM', name: 'address1_city', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
address1_county: new FormItemModel({ caption: '地址 1: 县', detailType: 'FORMITEM', name: 'address1_county', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
accountid: new FormItemModel({ caption: '客户', detailType: 'FORMITEM', name: 'accountid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 1 })
,
};
/**
* 监控表单属性 srfupdatedate 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.srfupdatedate')
onSrfupdatedateChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfupdatedate', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srforikey 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.srforikey')
onSrforikeyChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srforikey', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfkey 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.srfkey')
onSrfkeyChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfkey', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfmajortext 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.srfmajortext')
onSrfmajortextChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfmajortext', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srftempmode 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.srftempmode')
onSrftempmodeChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srftempmode', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfuf 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.srfuf')
onSrfufChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfuf', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfdeid 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.srfdeid')
onSrfdeidChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfdeid', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfsourcekey 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.srfsourcekey')
onSrfsourcekeyChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfsourcekey', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 address1_addressid 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.address1_addressid')
onAddress1_addressidChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'address1_addressid', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 address1_name 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.address1_name')
onAddress1_nameChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'address1_name', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 address1_addresstypecode 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.address1_addresstypecode')
onAddress1_addresstypecodeChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'address1_addresstypecode', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 address1_country 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.address1_country')
onAddress1_countryChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'address1_country', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 address1_stateorprovince 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.address1_stateorprovince')
onAddress1_stateorprovinceChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'address1_stateorprovince', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 address1_city 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.address1_city')
onAddress1_cityChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'address1_city', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 address1_county 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.address1_county')
onAddress1_countyChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'address1_county', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 accountid 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Edit_Address
*/
@Watch('data.accountid')
onAccountidChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'accountid', newVal: newVal, oldVal: oldVal });
}
/**
* 重置表单项值
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof Edit_Address
*/
public resetFormData({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
}
/**
* 置空对象
*
* @param {any[]} args
* @memberof EditForm
*/
public ResetData(_datas:any){
if(Object.keys(_datas).length >0){
Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) {
this.data[name] = null;
}
});
}
}
/**
* 表单逻辑
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof Edit_Address
*/
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
}
/**
* 表单值变化
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @returns {void}
* @memberof Edit_Address
*/
public formDataChange({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
if (this.ignorefieldvaluechange) {
return;
}
this.resetFormData({ name: name, newVal: newVal, oldVal: oldVal });
this.formLogic({ name: name, newVal: newVal, oldVal: oldVal });
this.dataChang.next(JSON.stringify(this.data));
}
/**
* 表单加载完成
*
* @public
* @param {*} [data={}]
* @param {string} [action]
* @memberof Edit_Address
*/
public onFormLoad(data: any = {},action:string): void {
if(Object.is(action,"save") || Object.is(action,"autoSave") || Object.is(action,"submit"))
// 更新context的实体主键
if(data.account){
Object.assign(this.context,{account:data.account})
}
this.setFormEnableCond(data);
this.fillForm(data,action);
this.oldData = {};
Object.assign(this.oldData, JSON.parse(JSON.stringify(this.data)));
this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: false });
this.formLogic({ name: '', newVal: null, oldVal: null });
}
/**
* 值填充
*
* @param {*} [_datas={}]
* @param {string} [action]
* @memberof Edit_Address
*/
public fillForm(_datas: any = {},action:string): void {
this.ignorefieldvaluechange = true;
Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) {
this.data[name] = _datas[name];
}
});
if(Object.is(action,'loadDraft')){
this.createDefault();
}
if(Object.is(action,'load')){
this.updateDefault();
}
this.$nextTick(function () {
this.ignorefieldvaluechange = false;
})
}
/**
* 设置表单项是否启用
*
* @public
* @param {*} data
* @memberof Edit_Address
*/
public setFormEnableCond(data: any): void {
Object.values(this.detailsModel).forEach((detail: any) => {
if (!Object.is(detail.detailType, 'FORMITEM')) {
return;
}
const formItem: FormItemModel = detail;
formItem.setEnableCond(data.srfuf);
});
}
/**
* 重置草稿表单状态
*
* @public
* @memberof Edit_Address
*/
public resetDraftFormStates(): void {
const form: any = this.$refs.form;
if (form) {
form.resetFields();
}
}
/**
* 重置校验结果
*
* @memberof Edit_Address
*/
public resetValidates(): void {
Object.values(this.detailsModel).forEach((detail: any) => {
if (!Object.is(detail.detailType, 'FORMITEM')) {
return;
}
const formItem: FormItemModel = detail;
formItem.setError('');
});
}
/**
* 填充校验结果 (后台)
*
* @param {any[]} fieldErrors
* @memberof Edit_Address
*/
public fillValidates(fieldErrors: any[]): void {
fieldErrors.forEach((error: any) => {
const formItem: FormItemModel = this.detailsModel[error.field];
if (!formItem) {
return;
}
this.$nextTick(() => {
formItem.setError(error.message);
});
});
}
/**
* 表单校验状态
*
* @returns {boolean}
* @memberof Edit_Address
*/
public formValidateStatus(): boolean {
const form: any = this.$refs.form;
let validatestate: boolean = true;
form.validate((valid: boolean) => {
validatestate = valid ? true : false;
});
return validatestate
}
/**
* 获取全部值
*
* @returns {*}
* @memberof Edit_Address
*/
public getValues(): any {
return this.data;
}
/**
* 表单项值变更
*
* @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof Edit_Address
*/
public onFormItemValueChange($event: { name: string, value: any }): void {
if (!$event) {
return;
}
if (!$event.name || Object.is($event.name, '') || !this.data.hasOwnProperty($event.name)) {
return;
}
this.data[$event.name] = $event.value;
}
/**
* 设置数据项值
*
* @param {string} name
* @param {*} value
* @returns {void}
* @memberof Edit_Address
*/
public setDataItemValue(name: string, value: any): void {
if (!name || Object.is(name, '') || !this.data.hasOwnProperty(name)) {
return;
}
if (Object.is(this.data[name], value)) {
return;
}
this.data[name] = value;
}
/**
* 分组界面行为事件
*
* @param {*} $event
* @memberof Edit_Address
*/
public groupUIActionClick($event: any): void {
if (!$event) {
return;
}
const item:any = $event.item;
}
/**
* Vue声明周期(处理组件的输入属性)
*
* @memberof Edit_Address
*/
public created(): void {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Edit_Address
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('autoload', action)) {
this.autoLoad(data);
}
if (Object.is('load', action)) {
this.load(data);
}
if (Object.is('loaddraft', action)) {
if(this.context.srfsourcekey){
this.copy(this.context.srfsourcekey);
}else{
this.loadDraft(data);
}
}
if (Object.is('save', action)) {
this.save(data,data.showResultInfo);
}
if (Object.is('remove', action)) {
this.remove(data);
}
if (Object.is('saveandexit', action)) {
this.saveAndExit(data);
}
if (Object.is('saveandnew', action)) {
this.saveAndNew(data);
}
if (Object.is('removeandexit', action)) {
this.removeAndExit(data);
}
if (Object.is('refresh', action)) {
this.refresh(data);
}
});
}
this.dataChang
.pipe(
debounceTime(300),
distinctUntilChanged()
).subscribe((data: any) => {
if (this.autosave) {
this.autoSave();
}
const state = !Object.is(JSON.stringify(this.oldData), JSON.stringify(this.data)) ? true : false;
this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: state });
});
}
/**
* vue 生命周期
*
* @memberof Edit_Address
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Edit_Address
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if (this.dataChangEvent) {
this.dataChangEvent.unsubscribe();
}
}
/**
* 拷贝内容
*
* @param {*} [arg={}]
* @memberof @memberof Edit_Address
*/
public copy(srfkey: string): void {
let copyData = this.$store.getters.getCopyData(srfkey);
copyData.srfkey = Util.createUUID();
copyData.account = copyData.srfkey;
copyData.accountid = copyData.srfkey;
Object.assign(this.context,{account:copyData.account})
this.data = copyData;
this.$nextTick(() => {
this.formState.next({ type: 'load', data: copyData });
this.data.srfuf = '0';
this.setFormEnableCond(this.data);
});
}
/**
*打印
*@memberof @memberof Edit_Address
*/
public print(){
let _this:any = this;
_this.$print({id:'account_edit_address',popTitle:'编辑表单_地址'});
}
/**
* 部件刷新
*
* @param {any[]} args
* @memberof Edit_Address
*/
public refresh(args: any[]): void {
let arg: any = {};
Object.assign(arg,args[0]);
if (this.data.srfkey && !Object.is(this.data.srfkey, '')) {
Object.assign(arg, { srfkey: this.data.srfkey });
this.load(arg);
return;
}
if (this.data.srfkeys && !Object.is(this.data.srfkeys, '')) {
Object.assign(arg, { srfkey: this.data.srfkeys });
this.load(arg);
return;
}
}
/**
* 自动加载
*
* @param {*} [arg={}]
* @returns {void}
* @memberof Edit_Address
*/
public autoLoad(arg: any = {}): void {
if (arg.srfkey && !Object.is(arg.srfkey, '')) {
Object.assign(arg, { srfkey: arg.srfkey });
this.load(arg);
return;
}
if (arg.srfkeys && !Object.is(arg.srfkeys, '')) {
Object.assign(arg, { srfkey: arg.srfkeys });
this.load(arg);
return;
}
this.loadDraft(arg);
}
/**
* 加载
*
* @public
* @param {*} [opt={}]
* @memberof Edit_Address
*/
public load(opt: any = {}): void {
if(!this.loadAction){
this.$Notice.error({ title: '错误', desc: 'AccountEdit_Address视图表单loadAction参数未配置' });
return;
}
const arg: any = { ...opt };
let viewparamResult:any = Object.assign(arg,this.viewparams);
const get: Promise<any> = this.service.get(this.loadAction,JSON.parse(JSON.stringify(this.context)),{viewparams:viewparamResult}, this.showBusyIndicator);
get.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
this.onFormLoad(data,'load');
this.$emit('load', data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
}
/**
* 加载草稿
*
* @param {*} [opt={}]
* @memberof Edit_Address
*/
public loadDraft(opt: any = {}): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: 'AccountEdit_Address视图表单loaddraftAction参数未配置' });
return;
}
const arg: any = { ...opt } ;
let viewparamResult:any = Object.assign(arg,this.viewparams);
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)),{viewparams:viewparamResult}, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
}
return;
}
const data = response.data;
if(data.account){
Object.assign(this.context,{account:data.account})
}
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
this.$emit('load', data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
setTimeout(() => {
const form: any = this.$refs.form;
if (form) {
form.fields.forEach((field: any) => {
field.validateMessage = "";
field.validateState = "";
field.validateStatus = false;
});
}
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
}
/**
* 自动保存
*
* @param {*} [opt={}]
* @memberof Edit_Address
*/
public autoSave(opt: any = {}): void {
if (!this.formValidateStatus()) {
return;
}
const arg: any = { ...opt };
const data = this.getValues();
Object.assign(arg, data);
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: '错误', desc: 'AccountEdit_Address视图表单'+actionName+'参数未配置' });
return;
}
Object.assign(arg,{viewparams:this.viewparams});
const post: Promise<any> = this.service.add(action, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
}
return;
}
const data = response.data;
this.onFormLoad(data,'autoSave');
this.$emit('save', data);
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
}
/**
* 保存
*
* @param {*} [opt={}]
* @param {boolean} [showResultInfo]
* @param {boolean} [ifStateNext] formState是否下发通知
* @returns {Promise<any>}
* @memberof Edit_Address
*/
public async save(opt: any = {}, showResultInfo?: boolean, ifStateNext: boolean = true): Promise<any> {
return new Promise((resolve: any, reject: any) => {
showResultInfo = showResultInfo === undefined ? true : false;
if (!this.formValidateStatus()) {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
return;
}
const arg: any = { ...opt };
const data = this.getValues();
Object.assign(arg, data);
Object.assign(arg, this.context);
if (ifStateNext) {
this.drcounter = 0;
if(this.drcounter !== 0){
this.drsaveopt = opt;
this.formState.next({ type: 'beforesave', data: arg });//先通知关系界面保存
this.saveState = resolve;
return;
}
}
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: '错误', desc: 'AccountEdit_Address视图表单'+actionName+'参数未配置' });
return;
}
Object.assign(arg,{viewparams:this.viewparams});
const post: Promise<any> = Object.is(data.srfuf, '1')?this.service.update(action, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator):this.service.add(action,JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
}
return;
}
const data = response.data;
this.onFormLoad(data,'save');
this.$emit('save', data);
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
});
if (showResultInfo) {
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;保存成功!' });
}
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
reject(response);
});
})
}
/**
* 删除
*
* @public
* @param {*} [opt={}]
* @memberof EditForm
*/
public remove(opt:Array<any> = [],showResultInfo?: boolean): Promise<any> {
return new Promise((resolve: any, reject: any) => {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: 'AccountEdit_Address视图表单removeAction参数未配置' });
return;
}
const arg: any = opt[0];
const _this: any = this;
Object.assign(arg,{viewparams:this.viewparams});
this.service.delete(_this.removeAction, JSON.parse(JSON.stringify(this.context)),arg, showResultInfo).then((response: any) => {
if (response) {
const data = response.data;
this.$emit('remove',data);
this.formState.next({ type: 'remove', data: data });
this.data.ismodify = false;
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;删除成功!' });
resolve(response);
}
}).catch((error: any) => {
const { data: _data } = error;
this.$Notice.error({ title: _data.title, desc: _data.message });
reject(error);
});
});
}
/**
* 工作流启动
*
* @param {*} [data={}]
* @param {*} [localdata={}]
* @returns {Promise<any>}
* @memberof Edit_Address
*/
public async wfstart(data: any,localdata?:any): Promise<any> {
return new Promise((resolve: any, reject: any) => {
const _this: any = this;
const post: Promise<any> = _this.save({},false);
post.then((response:any) =>{
const arg:any = response.data;
if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams});
}
const result: Promise<any> = this.service.wfstart(_this.WFStartAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator,localdata);
result.then((response: any) => {
if (!response || response.status !== 200) {
if(response.data){
this.$Notice.error({ title: '', desc: '工作流启动失败, ' + response.data.message });
}
return;
}
this.$Notice.info({ title: '', desc: '工作流启动成功' });
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
reject(response);
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
reject(response);
})
});
}
/**
* 工作流提交
*
* @param {*} [data={}]
* @param {*} [localdata={}]
* @returns {Promise<any>}
* @memberof Edit_Address
*/
public async wfsubmit(data: any,localdata?:any): Promise<any> {
return new Promise((resolve: any, reject: any) => {
const _this: any = this;
const arg: any = data[0];
Object.assign(arg,{viewparams:this.viewparams});
if (!arg.account || Object.is(arg.account, '')) {
return;
}
const post: Promise<any> = Object.is(arg.srfuf, '1')?this.service.update(this.updateAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator):this.service.add(this.createAction,JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
post.then((response:any) =>{
const arg:any = response.data;
// 保存完成UI处理
this.onFormLoad(arg,'save');
this.$emit('save', arg);
this.$nextTick(() => {
this.formState.next({ type: 'save', data: arg });
});
// 准备提交参数
if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams});
}
// 强制补充srfwfmemo
if(this.srfwfmemo){
Object.assign(arg,{srfwfmemo:this.srfwfmemo});
}
const result: Promise<any> = this.service.wfsubmit(_this.WFSubmitAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator,localdata);
result.then((response: any) => {
if (!response || response.status !== 200) {
if(response.data){
this.$Notice.error({ title: '', desc: '工作流提交失败, ' + response.data.message });
}
return;
}
this.onFormLoad(arg,'submit');
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$Notice.info({ title: '', desc: '工作流提交成功' });
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
reject(response);
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
reject(response);
})
})
}
/**
* 表单项更新
*
* @param {string} mode 界面行为名称
* @param {*} [data={}] 请求数据
* @param {string[]} updateDetails 更新项
* @param {boolean} [showloading] 是否显示加载状态
* @returns {void}
* @memberof Edit_Address
*/
public updateFormItems(mode: string, data: any = {}, updateDetails: string[], showloading?: boolean): void {
if (!mode || (mode && Object.is(mode, ''))) {
return;
}
const arg: any = { ...data };
Object.assign(arg,this.viewparams);
const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(this.context)),arg, showloading);
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '表单项更新失败' });
return;
}
const data = response.data;
const _data: any = {};
updateDetails.forEach((name: string) => {
if (!data.hasOwnProperty(name)) {
return;
}
Object.assign(_data, { [name]: data[name] });
});
this.setFormEnableCond(_data);
this.fillForm(_data,'updateFormItem');
this.formLogic({ name: '', newVal: null, oldVal: null });
this.dataChang.next(JSON.stringify(this.data));
this.$nextTick(() => {
this.formState.next({ type: 'updateformitem', ufimode: arg.srfufimode, data: _data });
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
}
/**
* 回车事件
*
* @param {*} $event
* @memberof Edit_Address
*/
public onEnter($event: any): void {
}
/**
* 保存并退出
*
* @param {any[]} args
* @memberof Edit_Address
*/
public saveAndExit(data:any[]):Promise<any>{
let _this = this;
return new Promise((resolve: any, reject: any) =>{
let arg: any = {};
if(data && data.length > 0){
Object.assign(arg,data[0]);
}
_this.currentAction = "saveAndExit";
_this.save([arg]).then((res) =>{
if(res){
_this.closeView(res.data);
}
resolve(res);
}).catch((error) =>{
reject(error);
})
})
}
/**
* 保存并新建
*
* @param {any[]} args
* @memberof Edit_Address
*/
public saveAndNew(data:any[]):Promise<any>{
let _this = this;
return new Promise((resolve: any, reject: any) =>{
let arg: any = {};
if(data && data.length > 0){
Object.assign(arg,data[0]);
}
_this.currentAction = "saveAndNew";
_this.save([arg]).then((res) =>{
_this.ResetData(res);
_this.loadDraft({});
}).catch((error) =>{
reject(error);
})
})
}
/**
* 删除并退出
*
* @param {any[]} args
* @memberof Edit_Address
*/
public removeAndExit(data:any[]):Promise<any>{
let _this = this;
return new Promise((resolve: any, reject: any) =>{
let arg: any = {};
if(data && data.length > 0){
Object.assign(arg,data[0]);
}
_this.remove([arg]).then((res) =>{
if(res){
_this.closeView(res.data);
}
resolve(res);
}).catch((error) =>{
reject(error);
})
})
}
/**
* 关系界面数据保存完成
*
* @param {any} $event
* @memberof Edit_Address
*/
public drdatasaved($event:any){
let _this = this;
this.drcounter--;
if(this.drcounter > 0){
return;
}
this.save(this.drsaveopt, undefined, false).then((res) =>{
this.saveState(res);
this.drsaveopt = {};
if(Object.is(_this.currentAction, "saveAndNew")){
_this.ResetData(res);
_this.loadDraft({});
}else if(Object.is(_this.currentAction, "saveAndExit")){
if(res){
_this.closeView(res.data);
}
}
});
}
/**
* 新建默认值
* @memberof Edit_Address
*/
public createDefault(){
}
/**
* 更新默认值
* @memberof Edit_Address
*/
public updateDefault(){
}
}
</script>
<style lang='less'>
@import './edit-address-form.less';
</style>
\ No newline at end of file
/**
* Edit_Address 部件模型
*
* @export
* @class Edit_AddressModel
*/
export default class Edit_AddressModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof Edit_AddressModel
*/
public getDataItems(): any[] {
return [
{
name: 'srfwfmemo',
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'srfupdatedate',
prop: 'updatedate',
dataType: 'DATETIME',
},
{
name: 'srforikey',
},
{
name: 'srfkey',
prop: 'accountid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'accountname',
dataType: 'TEXT',
},
{
name: 'srftempmode',
},
{
name: 'srfuf',
},
{
name: 'srfdeid',
},
{
name: 'srfsourcekey',
},
{
name: 'address1_addressid',
prop: 'address1_addressid',
dataType: 'TEXT',
},
{
name: 'address1_name',
prop: 'address1_name',
dataType: 'TEXT',
},
{
name: 'address1_addresstypecode',
prop: 'address1_addresstypecode',
dataType: 'SSCODELIST',
},
{
name: 'address1_country',
prop: 'address1_country',
dataType: 'TEXT',
},
{
name: 'address1_stateorprovince',
prop: 'address1_stateorprovince',
dataType: 'TEXT',
},
{
name: 'address1_city',
prop: 'address1_city',
dataType: 'TEXT',
},
{
name: 'address1_county',
prop: 'address1_county',
dataType: 'TEXT',
},
{
name: 'accountid',
prop: 'accountid',
dataType: 'GUID',
},
{
name: 'account',
prop: 'accountid',
dataType: 'FONTKEY',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import AccountService from '@/service/account/account-service';
import Edit_AddressModel from './edit-address-form-model';
/**
* Edit_Address 部件服务对象
*
* @export
* @class Edit_AddressService
*/
export default class Edit_AddressService extends ControlService {
/**
* 客户服务对象
*
* @type {AccountService}
* @memberof Edit_AddressService
*/
public appEntityService: AccountService = new AccountService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof Edit_AddressService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of Edit_AddressService.
*
* @param {*} [opts={}]
* @memberof Edit_AddressService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new Edit_AddressModel();
}
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof Edit_AddressService
*/
private doItems(promise: Promise<any>, deKeyField: string, deName: string): Promise<any> {
return new Promise((resolve, reject) => {
promise.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
data.forEach((item:any,index:number) =>{
item[deName] = item[deKeyField];
data[index] = item;
});
resolve(data);
} else {
reject([])
}
}).catch((response: any) => {
reject([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof Edit_AddressService
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
return Promise.reject([])
}
/**
* 启动工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof Edit_AddressService
*/
@Errorlog
public wfstart(action: string,context: any = {},data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data);
context = this.handleRequestData(action,context,data).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading,localdata);
} else {
result = this.appEntityService.WFStart(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 提交工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof Edit_AddressService
*/
@Errorlog
public wfsubmit(action: string,context: any = {}, data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data,true);
context = this.handleRequestData(action,context,data).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading,localdata);
} else {
result = this.appEntityService.WFSubmit(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Edit_AddressService
*/
@Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Create(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Edit_AddressService
*/
@Errorlog
public delete(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Remove(Context,Data, isloading);
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Edit_AddressService
*/
@Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Update(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Edit_AddressService
*/
@Errorlog
public get(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Get(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Edit_AddressService
*/
@Errorlog
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
const PrimaryKey = Util.createUUID();
Data.accountid = PrimaryKey;
Data.account = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.accountid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Edit_AddressService
*/
@Errorlog
public frontLogic(action:string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any)=>{
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
return Promise.reject({ status: 500, data: { title: '失败', message: '系统异常' } });
}
result.then((response) => {
this.handleResponse(action, response,true);
resolve(response);
}).catch(response => {
reject(response);
});
})
}
/**
* 处理请求数据
*
* @param action 行为
* @param data 数据
* @memberof Edit_AddressService
*/
public handleRequestData(action: string,context:any, data: any = {}){
let mode: any = this.getMode();
if (!mode && mode.getDataItems instanceof Function) {
return data;
}
let formItemItems: any[] = mode.getDataItems();
let requestData:any = {};
formItemItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.prop){
requestData[item.prop] = data[item.name];
}
}
});
if(data && data.viewparams){
Object.assign(requestData,data.viewparams);
}
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import Edit_AddressBase from './edit-address-form-base.vue';
@Component({
components: {
}
})
export default class Edit_Address extends Edit_AddressBase {
}
</script>
\ No newline at end of file
......@@ -23,6 +23,10 @@ zuul:
path: /serviceappointments/**
serviceId: ibizbusinesscentral-centralapi
stripPrefix: false
transactioncurrency:
path: /transactioncurrencies/**
serviceId: ibizbusinesscentral-centralapi
stripPrefix: false
opportunity:
path: /opportunities/**
serviceId: ibizbusinesscentral-centralapi
......
......@@ -3152,7 +3152,7 @@
<!--输出实体[CONTACT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-contact-37-42">
<changeSet author="a_LAB01_e85d8801c" id="tab-contact-42-42">
<createTable tableName="CONTACT">
<column name="ADDRESS1_FREIGHTTERMSCODE" remarks="" type="VARCHAR(30)">
</column>
......@@ -6392,7 +6392,7 @@
<!--输出实体[LEAD]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-lead-17-72">
<changeSet author="a_LAB01_e85d8801c" id="tab-lead-19-72">
<createTable tableName="LEAD">
<column name="ADDRESS1_FAX" remarks="" type="VARCHAR(50)">
</column>
......@@ -9148,7 +9148,7 @@
<!--输出实体[TRANSACTIONCURRENCY]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-transactioncurrency-1-97">
<changeSet author="a_LAB01_e85d8801c" id="tab-transactioncurrency-4-97">
<createTable tableName="TRANSACTIONCURRENCY">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......@@ -10973,22 +10973,22 @@
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="MONTHLYFISCALCALENDAR" constraintName="DER1N_MONTHLYFISCALCALENDAR__T" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[CONTACT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-37-206">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-42-206">
<addForeignKeyConstraint baseColumnNames="PREFERREDEQUIPMENTID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__EQUIPMENT__PREF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EQUIPMENTID" referencedTableName="EQUIPMENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-37-207">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-42-207">
<addForeignKeyConstraint baseColumnNames="ORIGINATINGLEADID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__LEAD__ORIGINATI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="LEADID" referencedTableName="LEAD" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-37-208">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-42-208">
<addForeignKeyConstraint baseColumnNames="DEFAULTPRICELEVELID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__PRICELEVEL__DEF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-37-209">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-42-209">
<addForeignKeyConstraint baseColumnNames="PREFERREDSERVICEID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__SERVICE__PREFER" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SERVICEID" referencedTableName="SERVICE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-37-210">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-42-210">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-37-211">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-42-211">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__TRANSACTIONCURR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[TEAM]外键关系 -->
......@@ -11243,28 +11243,28 @@
</changeSet>
<!--输出实体[METRIC]外键关系 -->
<!--输出实体[LEAD]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-17-300">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-19-300">
<addForeignKeyConstraint baseColumnNames="PARENTACCOUNTID" baseTableName="LEAD" constraintName="DER1N_LEAD__ACCOUNT__PARENTACC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-17-301">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-19-301">
<addForeignKeyConstraint baseColumnNames="RELATEDOBJECTID" baseTableName="LEAD" constraintName="DER1N_LEAD__CAMPAIGNRESPONSE__" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACTIVITYID" referencedTableName="CAMPAIGNRESPONSE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-17-302">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-19-302">
<addForeignKeyConstraint baseColumnNames="CAMPAIGNID" baseTableName="LEAD" constraintName="DER1N_LEAD__CAMPAIGN__CAMPAIGN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CAMPAIGNID" referencedTableName="CAMPAIGN" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-17-303">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-19-303">
<addForeignKeyConstraint baseColumnNames="PARENTCONTACTID" baseTableName="LEAD" constraintName="DER1N_LEAD__CONTACT__PARENTCON" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-17-304">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-19-304">
<addForeignKeyConstraint baseColumnNames="ORIGINATINGCASEID" baseTableName="LEAD" constraintName="DER1N_LEAD__INCIDENT__ORIGINAT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="INCIDENTID" referencedTableName="INCIDENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-17-305">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-19-305">
<addForeignKeyConstraint baseColumnNames="QUALIFYINGOPPORTUNITYID" baseTableName="LEAD" constraintName="DER1N_LEAD__OPPORTUNITY__QUALI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OPPORTUNITYID" referencedTableName="OPPORTUNITY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-17-306">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-19-306">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="LEAD" constraintName="DER1N_LEAD__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-17-307">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-19-307">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="LEAD" constraintName="DER1N_LEAD__TRANSACTIONCURRENC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[TERRITORY]外键关系 -->
......
......@@ -44,6 +44,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"TransactionCurrency",
"delogicname":"货币",
"sysmoudle":{"id":"BASE","name":"Base"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"Opportunity",
"delogicname":"商机",
"sysmoudle":{"id":"SALES","name":"Sales"},
......
package cn.ibizlab.businesscentral.centralapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.businesscentral.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[TransactionCurrencyDTO]
*/
@Data
public class TransactionCurrencyDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [ENTITYIMAGEID]
*
*/
@JSONField(name = "entityimageid")
@JsonProperty("entityimageid")
private String entityimageid;
/**
* 属性 [TRANSACTIONCURRENCYID]
*
*/
@JSONField(name = "transactioncurrencyid")
@JsonProperty("transactioncurrencyid")
private String transactioncurrencyid;
/**
* 属性 [VERSIONNUMBER]
*
*/
@JSONField(name = "versionnumber")
@JsonProperty("versionnumber")
private BigInteger versionnumber;
/**
* 属性 [ENTITYIMAGE_URL]
*
*/
@JSONField(name = "entityimage_url")
@JsonProperty("entityimage_url")
private String entityimageUrl;
/**
* 属性 [EXCHANGERATE]
*
*/
@JSONField(name = "exchangerate")
@JsonProperty("exchangerate")
private BigDecimal exchangerate;
/**
* 属性 [OVERRIDDENCREATEDON]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "overriddencreatedon" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("overriddencreatedon")
private Timestamp overriddencreatedon;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [UNIQUEDSCID]
*
*/
@JSONField(name = "uniquedscid")
@JsonProperty("uniquedscid")
private String uniquedscid;
/**
* 属性 [STATECODE]
*
*/
@JSONField(name = "statecode")
@JsonProperty("statecode")
private Integer statecode;
/**
* 属性 [STATUSCODE]
*
*/
@JSONField(name = "statuscode")
@JsonProperty("statuscode")
private Integer statuscode;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [CURRENCYPRECISION]
*
*/
@JSONField(name = "currencyprecision")
@JsonProperty("currencyprecision")
private Integer currencyprecision;
/**
* 属性 [CURRENCYNAME]
*
*/
@JSONField(name = "currencyname")
@JsonProperty("currencyname")
private String currencyname;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [ENTITYIMAGE]
*
*/
@JSONField(name = "entityimage")
@JsonProperty("entityimage")
private String entityimage;
/**
* 属性 [ISOCURRENCYCODE]
*
*/
@JSONField(name = "isocurrencycode")
@JsonProperty("isocurrencycode")
private String isocurrencycode;
/**
* 属性 [ENTITYIMAGE_TIMESTAMP]
*
*/
@JSONField(name = "entityimage_timestamp")
@JsonProperty("entityimage_timestamp")
private BigInteger entityimageTimestamp;
/**
* 属性 [CURRENCYSYMBOL]
*
*/
@JSONField(name = "currencysymbol")
@JsonProperty("currencysymbol")
private String currencysymbol;
/**
* 属性 [IMPORTSEQUENCENUMBER]
*
*/
@JSONField(name = "importsequencenumber")
@JsonProperty("importsequencenumber")
private Integer importsequencenumber;
/**
* 设置 [ENTITYIMAGEID]
*/
public void setEntityimageid(String entityimageid){
this.entityimageid = entityimageid ;
this.modify("entityimageid",entityimageid);
}
/**
* 设置 [VERSIONNUMBER]
*/
public void setVersionnumber(BigInteger versionnumber){
this.versionnumber = versionnumber ;
this.modify("versionnumber",versionnumber);
}
/**
* 设置 [ENTITYIMAGE_URL]
*/
public void setEntityimageUrl(String entityimageUrl){
this.entityimageUrl = entityimageUrl ;
this.modify("entityimage_url",entityimageUrl);
}
/**
* 设置 [EXCHANGERATE]
*/
public void setExchangerate(BigDecimal exchangerate){
this.exchangerate = exchangerate ;
this.modify("exchangerate",exchangerate);
}
/**
* 设置 [OVERRIDDENCREATEDON]
*/
public void setOverriddencreatedon(Timestamp overriddencreatedon){
this.overriddencreatedon = overriddencreatedon ;
this.modify("overriddencreatedon",overriddencreatedon);
}
/**
* 设置 [UNIQUEDSCID]
*/
public void setUniquedscid(String uniquedscid){
this.uniquedscid = uniquedscid ;
this.modify("uniquedscid",uniquedscid);
}
/**
* 设置 [STATECODE]
*/
public void setStatecode(Integer statecode){
this.statecode = statecode ;
this.modify("statecode",statecode);
}
/**
* 设置 [STATUSCODE]
*/
public void setStatuscode(Integer statuscode){
this.statuscode = statuscode ;
this.modify("statuscode",statuscode);
}
/**
* 设置 [CURRENCYPRECISION]
*/
public void setCurrencyprecision(Integer currencyprecision){
this.currencyprecision = currencyprecision ;
this.modify("currencyprecision",currencyprecision);
}
/**
* 设置 [CURRENCYNAME]
*/
public void setCurrencyname(String currencyname){
this.currencyname = currencyname ;
this.modify("currencyname",currencyname);
}
/**
* 设置 [ENTITYIMAGE]
*/
public void setEntityimage(String entityimage){
this.entityimage = entityimage ;
this.modify("entityimage",entityimage);
}
/**
* 设置 [ISOCURRENCYCODE]
*/
public void setIsocurrencycode(String isocurrencycode){
this.isocurrencycode = isocurrencycode ;
this.modify("isocurrencycode",isocurrencycode);
}
/**
* 设置 [ENTITYIMAGE_TIMESTAMP]
*/
public void setEntityimageTimestamp(BigInteger entityimageTimestamp){
this.entityimageTimestamp = entityimageTimestamp ;
this.modify("entityimage_timestamp",entityimageTimestamp);
}
/**
* 设置 [CURRENCYSYMBOL]
*/
public void setCurrencysymbol(String currencysymbol){
this.currencysymbol = currencysymbol ;
this.modify("currencysymbol",currencysymbol);
}
/**
* 设置 [IMPORTSEQUENCENUMBER]
*/
public void setImportsequencenumber(Integer importsequencenumber){
this.importsequencenumber = importsequencenumber ;
this.modify("importsequencenumber",importsequencenumber);
}
}
package cn.ibizlab.businesscentral.centralapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.base.domain.TransactionCurrency;
import cn.ibizlab.businesscentral.centralapi.dto.TransactionCurrencyDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface TransactionCurrencyMapping extends MappingBase<TransactionCurrencyDTO, TransactionCurrency> {
}
package cn.ibizlab.businesscentral.centralapi.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.businesscentral.centralapi.dto.*;
import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.TransactionCurrency;
import cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService;
import cn.ibizlab.businesscentral.core.base.filter.TransactionCurrencySearchContext;
@Slf4j
@Api(tags = {"货币" })
@RestController("CentralApi-transactioncurrency")
@RequestMapping("")
public class TransactionCurrencyResource {
@Autowired
public ITransactionCurrencyService transactioncurrencyService;
@Autowired
@Lazy
public TransactionCurrencyMapping transactioncurrencyMapping;
@PreAuthorize("hasPermission(this.transactioncurrencyService.get(#transactioncurrency_id),'iBizBusinessCentral-TransactionCurrency-Remove')")
@ApiOperation(value = "删除货币", tags = {"货币" }, notes = "删除货币")
@RequestMapping(method = RequestMethod.DELETE, value = "/transactioncurrencies/{transactioncurrency_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("transactioncurrency_id") String transactioncurrency_id) {
return ResponseEntity.status(HttpStatus.OK).body(transactioncurrencyService.remove(transactioncurrency_id));
}
@PreAuthorize("hasPermission(this.transactioncurrencyService.getTransactioncurrencyByIds(#ids),'iBizBusinessCentral-TransactionCurrency-Remove')")
@ApiOperation(value = "批量删除货币", tags = {"货币" }, notes = "批量删除货币")
@RequestMapping(method = RequestMethod.DELETE, value = "/transactioncurrencies/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
transactioncurrencyService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.transactioncurrencyMapping.toDomain(returnObject.body),'iBizBusinessCentral-TransactionCurrency-Get')")
@ApiOperation(value = "获取货币", tags = {"货币" }, notes = "获取货币")
@RequestMapping(method = RequestMethod.GET, value = "/transactioncurrencies/{transactioncurrency_id}")
public ResponseEntity<TransactionCurrencyDTO> get(@PathVariable("transactioncurrency_id") String transactioncurrency_id) {
TransactionCurrency domain = transactioncurrencyService.get(transactioncurrency_id);
TransactionCurrencyDTO dto = transactioncurrencyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.transactioncurrencyMapping.toDomain(#transactioncurrencydto),'iBizBusinessCentral-TransactionCurrency-Save')")
@ApiOperation(value = "保存货币", tags = {"货币" }, notes = "保存货币")
@RequestMapping(method = RequestMethod.POST, value = "/transactioncurrencies/save")
public ResponseEntity<Boolean> save(@RequestBody TransactionCurrencyDTO transactioncurrencydto) {
return ResponseEntity.status(HttpStatus.OK).body(transactioncurrencyService.save(transactioncurrencyMapping.toDomain(transactioncurrencydto)));
}
@PreAuthorize("hasPermission(this.transactioncurrencyMapping.toDomain(#transactioncurrencydtos),'iBizBusinessCentral-TransactionCurrency-Save')")
@ApiOperation(value = "批量保存货币", tags = {"货币" }, notes = "批量保存货币")
@RequestMapping(method = RequestMethod.POST, value = "/transactioncurrencies/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<TransactionCurrencyDTO> transactioncurrencydtos) {
transactioncurrencyService.saveBatch(transactioncurrencyMapping.toDomain(transactioncurrencydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.transactioncurrencyService.get(#transactioncurrency_id),'iBizBusinessCentral-TransactionCurrency-Update')")
@ApiOperation(value = "更新货币", tags = {"货币" }, notes = "更新货币")
@RequestMapping(method = RequestMethod.PUT, value = "/transactioncurrencies/{transactioncurrency_id}")
@Transactional
public ResponseEntity<TransactionCurrencyDTO> update(@PathVariable("transactioncurrency_id") String transactioncurrency_id, @RequestBody TransactionCurrencyDTO transactioncurrencydto) {
TransactionCurrency domain = transactioncurrencyMapping.toDomain(transactioncurrencydto);
domain .setTransactioncurrencyid(transactioncurrency_id);
transactioncurrencyService.update(domain );
TransactionCurrencyDTO dto = transactioncurrencyMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.transactioncurrencyService.getTransactioncurrencyByEntities(this.transactioncurrencyMapping.toDomain(#transactioncurrencydtos)),'iBizBusinessCentral-TransactionCurrency-Update')")
@ApiOperation(value = "批量更新货币", tags = {"货币" }, notes = "批量更新货币")
@RequestMapping(method = RequestMethod.PUT, value = "/transactioncurrencies/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<TransactionCurrencyDTO> transactioncurrencydtos) {
transactioncurrencyService.updateBatch(transactioncurrencyMapping.toDomain(transactioncurrencydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.transactioncurrencyMapping.toDomain(#transactioncurrencydto),'iBizBusinessCentral-TransactionCurrency-Create')")
@ApiOperation(value = "新建货币", tags = {"货币" }, notes = "新建货币")
@RequestMapping(method = RequestMethod.POST, value = "/transactioncurrencies")
@Transactional
public ResponseEntity<TransactionCurrencyDTO> create(@RequestBody TransactionCurrencyDTO transactioncurrencydto) {
TransactionCurrency domain = transactioncurrencyMapping.toDomain(transactioncurrencydto);
transactioncurrencyService.create(domain);
TransactionCurrencyDTO dto = transactioncurrencyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.transactioncurrencyMapping.toDomain(#transactioncurrencydtos),'iBizBusinessCentral-TransactionCurrency-Create')")
@ApiOperation(value = "批量新建货币", tags = {"货币" }, notes = "批量新建货币")
@RequestMapping(method = RequestMethod.POST, value = "/transactioncurrencies/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<TransactionCurrencyDTO> transactioncurrencydtos) {
transactioncurrencyService.createBatch(transactioncurrencyMapping.toDomain(transactioncurrencydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取货币草稿", tags = {"货币" }, notes = "获取货币草稿")
@RequestMapping(method = RequestMethod.GET, value = "/transactioncurrencies/getdraft")
public ResponseEntity<TransactionCurrencyDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(transactioncurrencyMapping.toDto(transactioncurrencyService.getDraft(new TransactionCurrency())));
}
@ApiOperation(value = "检查货币", tags = {"货币" }, notes = "检查货币")
@RequestMapping(method = RequestMethod.POST, value = "/transactioncurrencies/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody TransactionCurrencyDTO transactioncurrencydto) {
return ResponseEntity.status(HttpStatus.OK).body(transactioncurrencyService.checkKey(transactioncurrencyMapping.toDomain(transactioncurrencydto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-TransactionCurrency-Default-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"货币" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/transactioncurrencies/fetchdefault")
public ResponseEntity<List<TransactionCurrencyDTO>> fetchDefault(TransactionCurrencySearchContext context) {
Page<TransactionCurrency> domains = transactioncurrencyService.searchDefault(context) ;
List<TransactionCurrencyDTO> list = transactioncurrencyMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-TransactionCurrency-Default-all')")
@ApiOperation(value = "查询DEFAULT", tags = {"货币" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/transactioncurrencies/searchdefault")
public ResponseEntity<Page<TransactionCurrencyDTO>> searchDefault(@RequestBody TransactionCurrencySearchContext context) {
Page<TransactionCurrency> domains = transactioncurrencyService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(transactioncurrencyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册