ttk-app-core
Version:
enterprise develop framework
400 lines (397 loc) • 18.4 kB
JavaScript
import moment from 'moment'
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'app-depr-detail-rpt',
children: [
{
name: 'header',
className: 'app-depr-detail-rpt-header',
component: '::div',
children: [{
name: 'tablesetting',
component: 'TableSettingCard',
data: '{{data.assetDetailList}}',
visible: '{{data.showTableSetting}}',
positionClass: 'app-depr-detail-rpt-content',
confirmClick: '{{function(data){$showTableSetting({value: false, data: data})}}}',
cancelClick: '{{function(){$closeTableSetting()}}}',
resetClick: '{{function(){$resetTableSetting({data: data})}}}'
},{
name: 'accountQuery',
title: 'accountQuery',
className: 'app-depr-detail-rpt-accountQuery',
component: 'SearchCard',
refName: 'accountQuery',
searchClick: '{{function(value){$searchValueChange(value)}}}',
cancelClick: '{{function(value){$searchCancelChange(value)}}}',
clearClick: '{{function(value){$clearValueChange(value)}}}',
onChange: '{{function(value){$searchValueChange(value)}}}',
didMount: '{{function(childrenRef){$getSearchCard(childrenRef)}}}',
refreshBtn: {
name: 'refreshBtn',
component: 'Icon',
fontFamily: 'edficon',
type: 'shuaxin',
className: 'app-depr-detail-rpt-reload',
onClick: '{{$refreshBtnClick}}'
},
confirmBtn: {
hidden: false,
text: '查询'
},
cancelBtn: {
hidden: false,
text: '取消'
},
menuBtn: [{
component: 'Checkbox',
children: '显示小计',
className: 'app-depr-detail-rpt-normalSearch-cb',
checked: '{{data.showOption.includeSum}}',
onChange: '{{function(e){$showOptionsChange("includeSum", e.target.checked)}}}'
},{
name: 'save',
component: 'Icon',
fontFamily: 'edficon',
// className: 'app-depr-detail-rpt-dayin',
className: 'btn print',
type: 'dayin',
onClick: '{{$print}}',
title: '打印'
}, {
name: 'share',
component: 'Icon',
fontFamily: 'edficon',
// className: 'app-depr-detail-rpt-daochu',
className: 'btn export',
type: 'daochu',
title: '导出',
onClick: '{{$export}}'
}],
normalSearcChildren: [{
name: 'assetProperty',
component: 'Select',
showSearch: false,
className: 'app-asset-list-header-assetProperty',
value: '{{data.form.assetProperty && data.form.assetProperty.value}}',
onChange: `{{function(v){$assetPropertyChange('data.form.assetProperty',data.other.assetProperty.filter(function(o){return o.value == v})[0])}}}`,
children: {
name: 'option',
component: 'Select.Option',
className: 'app-asset-list-header-option',
value: '{{data.other.assetProperty && data.other.assetProperty[_rowIndex].value }}',
title: '{{data.other.assetProperty && data.other.assetProperty[_rowIndex].label }}',
children: '{{data.other.assetProperty && data.other.assetProperty[_rowIndex].label }}',
_power: 'for in data.other.assetProperty'
}
}, {
name: 'assetClass',
component: 'Select',
showSearch: false,
className: 'app-asset-list-header-assetClass',
value: '{{data.form.assetClass && data.form.assetClass.value}}',
onChange: `{{function(v){$assetClassChange('data.form.assetClass',data.other.assetClass.filter(function(o){return o.value == v})[0])}}}`,
children: {
name: 'option',
component: 'Select.Option',
className: 'app-asset-list-header-option',
value: '{{data.other.assetClass && data.other.assetClass[_rowIndex].value }}',
title: '{{data.other.assetClass && data.other.assetClass[_rowIndex].label }}',
children: '{{data.other.assetClass && data.other.assetClass[_rowIndex].label }}',
_power: 'for in data.other.assetClass'
}
},{
name: 'discribte',
component: '::span',
children: '折旧/摊销期间',
className: 'app-depr-detail-rpt-discribteSpan',
},{
name: 'date',
component: 'DateRangeMonthPicker',
className: 'app-depr-detail-rpt-header-date',
format: "YYYY-MM",
allowClear: true,
popupStyle: { zIndex: 10 },
mode: ['month', 'month'],
onPanelChange: '{{$onPanelChange}}',
value: '{{$getNormalDateValue()}}',
disabledStartDate:'{{function() {return false}}}'
}],
normalSearch: [],
moreSearch: '{{data.searchValue}}',
treeSelect: [{
name: "treeSelect",
component: '::div',
className: 'select-tree',
children: [{
name: "treeSelect",
component: '::span',
className: 'select-tree-label',
children: "资产分类"
}, {
name: 'assetProperty',
component: 'Select',
className: 'app-asset-list-header-assetProperty',
value: '{{data.searchValue.assetProperty && data.searchValue.assetProperty.value}}',
onChange: `{{function(v){$assetPropertyChange('data.searchValue.assetProperty',data.other.assetProperty.filter(function(o){return o.value == v})[0])}}}`,
// onChange: `{{function(v){$assetPropertyChange('data.searchValue.assetProperty',data.other.assetProperty.filter(m => m.value==v)[0])}}}`,
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.other.assetProperty && data.other.assetProperty[_rowIndex].value}}',
children: '{{data.other.assetProperty && data.other.assetProperty[_rowIndex].label }}',
_power: 'for in data.other.assetProperty'
}
}, {
name: 'assetClass',
component: 'Select',
className: 'app-asset-list-header-assetClass',
value: '{{data.searchValue.assetClass && data.searchValue.assetClass.value}}',
onChange: `{{function(v){$assetClassChange('data.searchValue.assetClass',data.other.assetClass.filter(function(o){return o.value == v})[0])}}}`,
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.other.assetClass && data.other.assetClass[_rowIndex].value }}',
children: '{{data.other.assetClass && data.other.assetClass[_rowIndex].label }}',
_power: 'for in data.other.assetClass'
}
}]
}],
moreSearchItem: [
{
name: 'date',
range: true,
label: '折旧/摊销期间',
centerContent: '到',
isTime: true,
pre: {
name: 'startBuyData',
type: 'DatePicker.MonthPicker',
mode: ['month', 'month'],
format: "YYYY-MM",
allowClear: true,
// noClear: true,
decoratorDate: '{{function(value, value2){return $disabledDate(value, value2, "pre")}}}'
},
next: {
name: 'endBuyData',
type: 'DatePicker.MonthPicker',
mode: ['month', 'month'],
format: "YYYY-MM",
allowClear: true,
// noClear: true,
decoratorDate: '{{function(value, value2){return $disabledDate(value, value2, "next")}}}'
}
}, {
name: 'date2',
range: true,
label: '开始使用日期',
centerContent: '到',
isTime: true,
pre: {
name: 'startUseData',
type: 'DatePicker',
// mode: ['month', 'month'],
// format: "YYYY-MM",
allowClear: true,
// noClear: true,
decoratorDate: '{{function(value, value2){return $disabledDateDay(value, value2, "pre")}}}'
},
next: {
name: 'endUseData',
type: 'DatePicker',
// mode: ['month', 'month'],
// format: "YYYY-MM",
allowClear: true,
// noClear: true,
decoratorDate: '{{function(value, value2){return $disabledDateDay(value, value2, "next")}}}'
}
}, {
name: 'cardId',
label: '资产',
type: 'Select',
childType: 'Option',
showSearch: '{{true}}',
option: '{{data.other.codeAndNameList}}',
filterOption: '{{$filterOptionSummary}}',
allowClear: true
}, {
name: 'containNoDepreciation',
label: '',
type: 'Checkbox.Group',
render: '{{$renderCheckBox}} ',
allowClear: true
}],
}]
},{
name: 'content',
component: 'Layout',
className: 'app-depr-detail-rpt-content',
children:[{
name: 'dataGrid',
component: 'DataGrid',
className: 'app-depr-detail-rpt-Body',
headerHeight: 37,
isColumnResizing: true,
rowHeight: 37,
ellipsis: true,
onColumnResizeEnd: '{{$onColumnResizeEnd}}',
loading: '{{data.other.loading}}',
rowsCount: "{{data.list.length}}",
columns: '{{$tableColumns(data.assetDetailList,data.list)}}'
}]
},
{
name: 'footer',
className: 'app-depr-detail-rpt-footer',
component: '::div',
children: [{
name: 'pagination',
component: 'Pagination',
pageSizeOptions: ['50', '100', '150', '200'],
pageSize: '{{data.pagination.pageSize}}',
current: '{{data.pagination.currentPage}}',
total: '{{data.pagination.totalCount}}',
onChange: '{{$pageChanged}}',
onShowSizeChange: '{{$pageChanged}}'
}]
}]
}
}
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: 1090
},
showCheckbox: {},
sort: {
userOrderField: null,
order: null
},
showOption: {
includeSum: true
},
systemDate: {},
list: [],
form: {},
content: '查询条件:',
filter: {
startBuyData: moment().endOf('month').format('YYYY-MM'),
endBuyData: moment().endOf('month').format('YYYY-MM'),
page:{currentPage: 1, pageSize: 50}
},
searchValue: {
// assetClassId: '',
// cardId: '',
// containNoDepreciation: [],
assetClassId: null,
cardId: '',
containNoDepreciation: [],
code: null,
assetPropertyIdList:null,
startBuyData: moment().endOf('month'),
endBuyData: moment().endOf('month'),
// startUseData: moment().endOf('month'),
// endUseData: moment().endOf('month')
startUseData: null,
endUseData: null
},
pagination: {
currentPage: 1,
totalCount: 0,
pageSize: 50,
totalPage: 0
},
other: {
assetTypeList: [],
codeAndNameList: [],
assetProperty: [],
assetClass: [],
loading: false, //grid加载状态
oldSearchValue: {
startBuyData: moment().endOf('month'),
endBuyData: moment().endOf('month'),
},
columnDto: [],
isColumnSolution: true,
sort: {
userOrderField: null,
order: null
},
},
assetDetailList: [{
"id": 50000100001,
"columnId": 4043950162154496,
"fieldName": "voucherDate",
"caption": "日期",
"idFieldType": 1000040001,
"width": 100,
"defPrecision":'',
"idAlignType": 1000050001,
"colIndex": 1,
"idOrderMode": '',
"isFixed": false,
"isVisible": true,
"isMustSelect": true,
"isSystem": false,
"isHeader": true,
"isTotalColumn": false,
"createTime": "2018-02-12 15:26:28"
},{
"id": 50000100001,
"columnId": 4043950162154496,
"fieldName": "voucherDate",
"caption": "日期",
"idFieldType": 1000040001,
"width": 100,
"defPrecision":'',
"idAlignType": 1000050001,
"colIndex": 1,
"idOrderMode": '',
"isFixed": false,
"isVisible": true,
"isMustSelect": true,
"isSystem": false,
"isHeader": false,
"isTotalColumn": false,
"createTime": "2018-02-12 15:26:28"
}],
columnsNameObj: {},
showTableSetting: false,
}
}
}