ttk-app-core
Version:
enterprise develop framework
509 lines (504 loc) • 13.8 kB
JavaScript
import moment from 'moment'
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'ttk-table-app-list',
children: [{
name: 'tablesetting',
component: 'TableSettingCard',
data: '{{data.other.columnDto}}',
showTitle: '{{true}}',
positionClass:'ttk-table-app-list',
visible: '{{data.showTableSetting}}',
confirmClick: '{{function(data){$showTableSetting({value: false, data: data})}}}',
cancelClick: '{{function(){$closeTableSetting()}}}'
}, {
name: 'accountQuery',
title: 'accountQuery',
className: 'ttk-table-app-list-accountQuery',
component: 'SearchCard',
refName: 'accountQuery',
searchClick: '{{function(value){$searchValueChange(value)}}}',
onChange: '{{function(value){$searchValueChange(value)}}}',
refreshBtn: {
name: 'refreshBtn',
component: 'Icon',
fontFamily: 'edficon',
type: 'shuaxin',
className: 'mk-normalsearch-reload',
onClick: '{{$refreshBtnClick}}',
// children: {
// name: 'refreshBtnIcon',
// component: 'Icon',
// fontFamily: 'edficon',
// type: 'shuaxin',
// }
},
menuBtn: [{
name: '审核',
component: 'Button',
children: '审核',
onClick: '{{$auditClick}}'
}, {
name: 'Popover',
component: 'Popover',
trigger: 'hover',
overlayClassName: 'Popover-ttk-table-app-list',
style: { padding: '0px 10px' },
content: {
name: 'menu',
component: 'Menu',
className: 'more_btn_container',
onClick: '{{$moreActionOpeate}}',
children: [{
name: 'sort',
component: 'Menu.Item',
key: 'sortProofClick',
className: 'more_btn_item',
children: '整理账单号'
}, {
name: 'del',
component: 'Menu.Item',
key: 'delTableItemClick',
className: 'more_btn_item',
children: '删除'
}, {
name: 'versaAudit',
component: 'Menu.Item',
className: 'more_btn_item',
key: 'versaAuditClick',
children: '反审核'
}]
},
children: {
name: '更多',
component: 'Button',
className: 'ttk-table-app-list-more',
children: ['更多',{
name: 'down',
component: 'Icon',
type: 'down'
}]
}
}, {
name: 'save',
component: 'Icon',
fontFamily: 'edficon',
className: 'ttk-table-app-list-dayin',
type: 'dayin',
onClick: '{{$print}}',
title: '打印'
}, {
name: 'share',
component: 'Icon',
fontFamily: 'edficon',
className: 'ttk-table-app-list-daochu',
type: 'daochu',
title: '导出',
onClick: '{{$export}}'
}],
normalSearchValue: `{{$getNormalSearchValue()}}`,
normalSearchChange: '{{$normalSearchChange}}',
normalSearch: [{
name: 'date',
type: 'DateRangeMonthPicker',
format: "YYYY-MM",
allowClear: false,
startEnableDate: '{{data.other.enableddate}}',
// open: '{{data.showPicker}}',
// renderExtraFooter:'{{$renderDatePickerExtraFooter}}',
// disabledDate: '{{function(value){$disabledRangePicker(value)}}}',
mode: ['month', 'month'],
onPanelChange: '{{$normalSearchDateChange}}'
}, {
name: 'simpleCondition',
type: 'Input.Search',
className: 'mk-input',
onChange: '',
placeholder: "账单号"
}],
moreSearch: '{{data.searchValue}}',
moreSearchRules: '{{$checkSearchValue}}',
moreSearchItem: [{
name: 'date',
range: true,
label: '查询期间',
centerContent: '到',
isTime: true,
pre: {
name: 'date_start',
type: 'DatePicker.MonthPicker',
mode: ['month', 'month'],
format: "YYYY-MM",
allowClear: false,
noClear: true,
decoratorDate: '{{function(value, value2){return $disabledDate(value, value2, "pre")}}}',
rules: [{
type: 'object',
required: true,
message: '该项是必填项',
}],
},
next: {
name: 'date_end',
type: 'DatePicker.MonthPicker',
mode: ['month', 'month'],
format: "YYYY-MM",
allowClear: false,
noClear: true,
decoratorDate: '{{function(value, value2){return $disabledDate(value, value2, "next")}}}',
rules: [{
type: 'object',
required: true,
message: '该项是必填项',
}],
}
}, {
name: 'code',
range: true,
label: '账单号',
centerContent: '~',
pre: {
name: 'startCode',
type: 'Input',
autocomplete:"off",
allowClear: true
},
next: {
name: 'endCode',
type: 'Input',
autocomplete:"off",
allowClear: true
}
}, {
name: 'accountId',
label: '水果类型',
type: 'Select',
showSearch: '{{true}}',
childType: 'Option',
optionFilterProp:"children",
filterOption: '{{$filterOptionSummary}}',
title: '{{data.other.accountList}}',
option: '{{data.other.accountList}}',
allowClear: true
}, {
name: 'summary',
label: '摘要',
type: 'Input',
autocomplete:"off",
allowClear: true
},
// {
// name: 'sourceVoucherTypeId',
// label: '单据来源',
// type: 'Select',
// childType: 'Option',
// option: '{{data.other.sourceVoucherTypeIdOption}}',
// allowClear: true
// },
{
name: 'voucherState',
label: '状态',
type: 'Select',
childType: 'Option',
option: '{{data.other.voucherStateOption}}',
allowClear: true
}],
}, {
className: 'ttk-table-app-list-Body',
// expandedRowRender: childVoucherItems,
name: 'report',
component: 'Table',
key: '{{data.tableKey}}',
checkboxKey: 'docId',
remberName: 'ttk-table-app-list',
loading: '{{data.loading}}',
checkboxChange: '{{$checkboxChange}}',
checkboxValue: '{{data.tableCheckbox.checkboxValue}}',
pagination: false,
scroll: '{{data.list.length > 0 ? data.tableOption : {} }}',
// componentDidMount:'{{$renderDid()}}',
allowColResize: true,
enableSequenceColumn: false,
onChange: '{{$tableOnchange}}',
//loading:true,
Checkbox: false,
rowSelection: '{{$rowSelection()}}',
//mergeCells: '{{$setMergeCell()}}',
//scroll: { x: true, y: true },
bordered: true,
//width: true,
dataSource: '{{data.list}}',
columns: '{{$renderColumns()}}'
}, {
name: 'footer',
className: 'ttk-table-app-list-footer',
component: '::div',
children: [{
name: 'pagination',
component: 'Pagination',
pageSizeOptions: ['20', '50', '100', '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: 'ttk-table-app-list-child-Body',
columns: [{
title: '摘要1',
name: 'summary1',
dataIndex: 'summary1',
key: 'summary1',
render: "{{data.content}}"
}, {
title: '科目1',
name: 'accountingSubject1',
dataIndex: 'accountingSubject1',
key: 'accountingSubject1',
render: "{{data.content}}"
}, {
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: {
tableKey: 1000,
tableOption: {
x: 1500
},
showPicker: false,
showTableSetting: false,
sort: {
userOrderField: null,
order: null
},
list: [],
content: '查询条件:',
searchValue: {
accountId: null, //--科目ID
endCode: null, //--终止账单号
startCode: null, //--起始账单号
date_end: null, //期间终止
date_start: null, //期间起始
docIds: null, //--账单ID列表
summary: null, //--摘要
voucherState: null, //--单据状态
sourceVoucherTypeId: null, //--单据类型 -- 单据来源
simpleCondition: null //简单查询
},
pagination: {
currentPage: 1,
totalCount: 0,
pageSize: 20,
totalPage: 0
},
other: {
customer: ['1', '2', '3', '4'],
option: [],
accountList: [],
columnDto: [
{
"orgId": 4043128470475776,
"id": 50000100001,
"columnId": 4043950162154496,
"fieldName": "voucherDate",
"caption": "日期",
"idFieldType": 1000040001,
"width": 100,
"idAlignType": 1000050001,
"colIndex": 1,
"isFixed": false,
"isVisible": true,
"isMustSelect": true,
"isSystem": false,
"isHeader": true,
"isTotalColumn": false,
"ts": "2018-02-12 15:26:28"
}, {
"orgId": 4043128470475776,
"id": 50000100002,
"columnId": 4043950162154496,
"fieldName": "docTypeAndCode",
"caption": "账单序号",
"idFieldType": 1000040001,
"width": 100,
"idAlignType": 1000050001,
"colIndex": 2,
"isFixed": false,
"isVisible": true,
"isMustSelect": true,
"isSystem": false,
"isHeader": true,
"isTotalColumn": false,
"ts": "2018-02-12 15:26:28"
}, {
"orgId": 4043128470475776,
"id": 50000100003,
"columnId": 4043950162154496,
"fieldName": "amountSum",
"caption": "总金额",
"idFieldType": 1000040002,
"width": 100,
"idAlignType": 1000050003,
"colIndex": 3,
"isFixed": false,
"isVisible": false,
"isMustSelect": false,
"isSystem": false,
"isHeader": true,
"isTotalColumn": false,
"ts": "2018-02-12 15:26:28"
}, {
"orgId": 4043128470475776,
"id": 50000100004,
"columnId": 4043950162154496,
"fieldName": "summary",
"caption": "摘要",
"idFieldType": 1000040001,
"width": 100,
"idAlignType": 1000050001,
"colIndex": 4,
"isFixed": false,
"isVisible": true,
"isMustSelect": false,
"isSystem": false,
"isHeader": false,
"isTotalColumn": false,
"ts": "2018-02-12 15:26:28"
}, {
"orgId": 4043128470475776,
"id": 50000100005,
"columnId": 4043950162154496,
"fieldName": "accountCodeName",
"caption": "水果类型",
"idFieldType": 1000040001,
"width": 100,
"idAlignType": 1000050001,
"colIndex": 5,
"isFixed": false,
"isVisible": true,
"isMustSelect": false,
"isSystem": false,
"isHeader": false,
"isTotalColumn": false,
"ts": "2018-02-12 15:26:28"
}, {
"orgId": 4043128470475776,
"id": 50000100006,
"columnId": 4043950162154496,
"fieldName": "currencyAndExchangeRate",
"caption": "币种/汇率",
"idFieldType": 1000040001,
"width": 100,
"idAlignType": 1000050001,
"colIndex": 6,
"isFixed": false,
"isVisible": true,
"isMustSelect": false,
"isSystem": false,
"isHeader": false,
"isTotalColumn": false,
"ts": "2018-02-12 15:26:28"
}, {
"orgId": 4043128470475776,
"id": 50000100007,
"columnId": 4043950162154496,
"fieldName": "unitName",
"caption": "计量单位",
"idFieldType": 1000040001,
"width": 100,
"idAlignType": 1000050001,
"colIndex": 7,
"isFixed": false,
"isVisible": false,
"isMustSelect": false,
"isSystem": false,
"isHeader": false,
"isTotalColumn": false,
"ts": "2018-02-12 15:26:28"
}, {
"orgId": 4043128470475776,
"id": 50000100008,
"columnId": 4043950162154496,
"fieldName": "quantity",
"caption": "数量",
"idFieldType": 1000040002,
"width": 100,
"idAlignType": 1000050003,
"colIndex": 8,
"isFixed": false,
"isVisible": false,
"isMustSelect": false,
"isSystem": false,
"isHeader": false,
"isTotalColumn": false,
"ts": "2018-02-12 15:26:28"
}, {
"orgId": 4043128470475776,
"id": 50000100009,
"columnId": 4043950162154496,
"fieldName": "price",
"caption": "单价",
"idFieldType": 1000040002,
"width": 100,
"idAlignType": 1000050003,
"colIndex": 9,
"isFixed": false,
"isVisible": false,
"isMustSelect": false,
"isSystem": false,
"isHeader": false,
"isTotalColumn": false,
"ts": "2018-02-12 15:26:28"
}, {
"orgId": 4043128470475776,
"id": 50000100010,
"columnId": 4043950162154496,
"fieldName": "origAmount",
"caption": "外币金额",
"idFieldType": 1000040002,
"width": 100,
"idAlignType": 1000050003,
"colIndex": 10,
"isFixed": false,
"isVisible": false,
"isMustSelect": false,
"isSystem": false,
"isHeader": false,
"isTotalColumn": false,
"ts": "2018-02-12 15:26:28"
}
],
sourceVoucherTypeIdOption: [],
voucherStateOption: []
},
tableCheckbox: {
checkboxValue: [],
selectedOption: []
},
loading: true
}
}
}