ttk-app-core
Version:
enterprise develop framework
310 lines (302 loc) • 11.1 kB
JavaScript
import moment from 'moment'
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'app-balancesum-rpt',
children: [{
name: 'accountQuery',
title: 'accountQuery',
component: 'SearchCard',
refName: 'accountQuery',
searchClick: '{{function(value){$searchValueChange(value)}}}',
cancelClick: '{{function(value){$searchValueChange(value)}}}',
clearClick: '{{function(value){$searchValueChange(value)}}}',
onChange: '{{function(value){$searchValueChange(value)}}}',
refreshBtn: {
name: 'refreshBtn',
component: 'Icon',
fontFamily: 'edficon',
type: 'shuaxin',
title:'刷新',
className: 'app-balancesum-rpt-reload',
onClick: '{{$refreshBtnClick}}'
},
confirmBtn: {
hidden: false,
text: '查询'
},
cancelBtn: {
hidden: false,
text: '取消'
},
clearBtn: {
hidden: true,
text: ''
},
menuBtn: [{
name: 'cbShowSubTos1',
component: 'Checkbox',
className: 'app-balancesum-rpt-header-cb',
style: '{{$checkBoxisShow("multi")}}',
checked: '{{data.showOption.currency}}',
onChange: '{{function(e){$showOptionsChange("currency", e.target.checked)}}}',
children: '外币'
}, {
name: 'cbShowSubTos',
component: 'Checkbox',
className: 'app-balancesum-rpt-header-cb',
checked: '{{data.showOption.quantity}}',
onChange: '{{function(e){$showOptionsChange("quantity", e.target.checked)}}}',
children: '数量'
}, {
name: 'common',
component: 'Dropdown',
overlay: {
name: 'menu',
component: 'Menu',
onClick: '{{$shareClick}}',
children: [{
name: 'weixinShare',
component: 'Menu.Item',
key: 'weixinShare',
children: '微信/QQ'
}, {
name: 'mailShare',
component: 'Menu.Item',
key: 'mailShare',
children: '邮件分享'
}]
},
children: {
name: 'internal',
component: 'Button',
type: 'primary',
children: ['分享', {
name: 'down',
component: 'Icon',
type: 'down'
}]
}
}, {
name: 'save',
component: 'Icon',
fontFamily: 'edficon',
className: 'dayin',
type: 'dayin',
onClick: '{{$print}}',
title: '打印'
}, {
name: 'share',
component: 'Icon',
fontFamily: 'edficon',
className: 'daochu',
type: 'daochu',
title: '导出',
onClick: '{{$export}}'
}],
normalSearchValue: `{{$getNormalSearchValue()}}`,
normalSearch: [{
name: 'date',
type: 'DateRangeMonthPicker',
format: "YYYY-MM",
allowClear: false,
startEnableDate: '{{data.other.enabledDate}}',
popupStyle: { zIndex: 10 },
mode: ['month', 'month'],
value: '{{$getNormalDateValue()}}'
}],
moreSearch: '{{data.searchValue}}',
moreSearchItem: [{
name: 'date',
range: true,
label: '会计期间',
centerContent: '到',
isTime: true,
pre: {
name: 'date_start',
type: 'DatePicker.MonthPicker',
mode: ['month', 'month'],
format: "YYYY-MM",
allowClear: false,
decoratorDate: '{{function(value, value2){ return $disabledDate(value, value2, "pre")}}}',
},
next: {
name: 'date_end',
type: 'DatePicker.MonthPicker',
mode: ['month', 'month'],
format: "YYYY-MM",
allowClear: false,
decoratorDate: '{{function(value, value2){return $disabledDate(value, value2, "next")}}}',
}
}, {
name: 'accountCode',
range: true,
label: '会计科目',
centerContent: '~',
pre: {
name: 'beginAccountCode',
type: 'Select',
childType: 'Option',
showSearch: '{{true}}',
optionFilterProp: "children",
filterOption: '{{$filterOption}}',
className: 'searchAccountMaxWidthStyle',
option: '{{data.other.startAccountList}}',
allowClear: true
},
next: {
name: 'endAccountCode',
type: 'Select',
childType: 'Option',
showSearch: '{{true}}',
optionFilterProp: "children",
filterOption: '{{$filterOption}}',
className: 'searchAccountMaxWidthStyle',
option: '{{data.other.endAccountList}}',
allowClear: true
}
}, {
name: 'currencyId',
label: '币别',
type: 'Select',
childType: 'Option',
option: '{{data.other.currencyList}}',
allowClear: false
}, {
name: 'accountDepth',
range: true,
label: '科目级次',
centerContent: '~',
pre: {
name: 'beginAccountGrade',
type: 'Select',
childType: 'Option',
disabled: "{{data.other.gradeStyleStatus}}",
option: '{{data.other.startAccountDepthList}}',
allowClear: false
},
next: {
name: 'endAccountGrade',
type: 'Select',
childType: 'Option',
disabled: "{{data.other.gradeStyleStatus}}",
option: '{{data.other.endAccountDepthList}}',
allowClear: false
}
}, {
name: 'onlyShowEndAccount',
type: 'Checkbox.Group',
render: '{{$renderCheckBox1}} '
}, {
name: 'showZero',
type: 'Checkbox.Group',
render: '{{$renderCheckBox2}} '
}, {
name: 'showAuxAccCalc',
type: 'Checkbox.Group',
render: '{{$renderCheckBox3}} '
}]
},
{
name: 'voucherItems',
component: 'Table',
pagination: false,
className: 'app-balancesum-rpt-table-tbody',
key: '{{Math.random()}}',
allowColResize: false,
enableSequenceColumn: false,
loading: '{{data.loading}}',
bordered: true,
scroll: '{{data.list.length > 0 ? data.tableOption : {} }}',
dataSource: '{{data.list}}',
noDelCheckbox: true,
columns: '{{$tableColumns()}}'
}
]
}
}
export function childVoucherItems() {
return {
name: 'childVoucherItems',
component: 'Table',
dataSource: '{{data.dataItems}}',
className: 'app-proof-of-list-child-Body',
columns: [{
title: '摘要1',
name: 'summary1',
dataIndex: 'summary1',
key: 'summary1'
}, {
title: '科目1',
name: 'accountingSubject1',
dataIndex: 'accountingSubject1',
key: 'accountingSubject1'
}, {
title: '借方金额1',
name: 'debitAmount1',
dataIndex: 'debitAmount1',
key: 'debitAmount1',
render: '{{data.content}}'
}, {
title: '贷方金额1',
name: 'creditAmount1',
key: 'creditAmount1',
dataIndex: 'creditAmount1',
render: '{{data.content}}'
}]
}
}
export function getInitState() {
return {
data: {
tableOption: {
x: 900,
y: 800
},
sort: {
userOrderField: null,
order: null
},
showOption: {
multi: false,
quantity: false,
currency: false,
},
list: [],
content: '查询条件:',
searchValue: {
beginAccountCode: '',
endAccountCode: '',
currencyId: '0',
beginAccountGrade: '1',
endAccountGrade: '5',
onlyShowEndAccount: [],
showZero: ['1'],
showAuxAccCalc: ['1'],
printType: 0,
date_end: moment().endOf('month'),
date_start: moment().endOf('month')
},
pagination: {
currentPage: 1,
totalCount: 0,
pageSize: 10,
totalPage: 0
},
other: {
gradeStyleStatus: false,
startAccountList: [],
endAccountList: [],
currencylist: [],
tmpCurrencyList: [],
startAccountDepthList: [],
endAccountDepthList: [],
enabledDate: '',
changeSipmleDate:false
},
enableDate: null,
loading: true
}
}
}