UNPKG

ttk-app-core

Version:
356 lines (351 loc) 9.17 kB
import moment from 'moment' export function getMeta() { return { name: 'root', component: 'Layout', className: 'app-sumaccount-rpt', children: [{ name: 'accountQuery', title: 'accountQuery', className: 'app-proof-of-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', title:'刷新', className: 'mk-normalsearch-reload', onClick: '{{$refreshBtnClick}}' }, confirmBtn:{ hidden: false, text: '查询' }, cancelBtn: { hidden: false, text: '取消' }, clearBtn: { hidden: true, text: '' }, menuBtn:[{ name: 'newAdd', component: 'Checkbox', className: 'checkboxShow-label', style: '{{$checkBoxisShow("multi")}}', checked: '{{data.showOption.currency}}', onChange: '{{function(e){$showOptionsChange("currency", e.target.checked)}}}', children: '外币' },{ name: '审核', component: 'Checkbox', children: '数量', className: 'checkboxShow-label', style: '{{$checkBoxisShow("quantity")}}', checked: '{{data.showOption.num}}', onChange: '{{function(e){$showOptionsChange("num", e.target.checked)}}}' },{ name: 'common', component: 'Dropdown', // trigger:'click', 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: '打印', component: 'Dropdown', overlay: { name: 'menu', component: 'Menu', onClick: '{{$shareClick}}', children: [{ name: 'item', component: 'Menu.Item', key: 'item', children: { component: '::span', name: '当前科目', onClick: '{{$print}}', children: '当前科目' } }, { name: 'all', component: 'Menu.Item', key: 'all', children: { component: '::span', name: '所有科目', children: '所有科目', onClick: '{{$printAllAccount}}' } }] }, children: { name: 'internal', component: 'Button', // type: 'primary', className: 'app-sumaccount-rpt-dayinBut', children: [{ name: 'save', component: 'Icon', fontFamily: 'edficon', className: 'app-sumaccount-rpt-dayin', type: 'dayin', title: '打印', }, { name: 'down', component: 'Icon', className: 'app-sumaccount-rpt-dayin-down', type: 'down' }] } }, { name: '导出', component: 'Dropdown', overlay: { name: 'menu', component: 'Menu', onClick: '{{$shareClick}}', children: [{ name: 'item', component: 'Menu.Item', key: 'item', children: { component: '::span', name: '当前科目', onClick: '{{$export}}', children: '当前科目' } }, { name: 'all', component: 'Menu.Item', key: 'all', children: { component: '::span', name: '所有科目', children: '所有科目', onClick: '{{$exportAllAccount}}' } }] }, children: { name: 'internal', component: 'Button', // type: 'primary', className: 'app-sumaccount-rpt-daochuBut', children: [{ name: 'share', component: 'Icon', fontFamily: 'edficon', className: 'app-sumaccount-rpt-daochu', type: 'daochu', title: '导出' }, { name: 'down', component: 'Icon', className: 'app-sumaccount-rpt-dayin-down app-detailaccount-rpt-dayin-down1', type: 'down' }] } }], normalSearchValue: `{{$getNormalSearchValue()}}`, normalSearcChildren: [{ name: 'selectContianer', component: '::div', className: 'app-sumaccount-rpt-normalSearch', children: [{ name: 'leftBtn', component: 'Icon', fontFamily: 'edficon', type: 'zuo', className: 'app-sumaccount-rpt-normalSearch-leftBtn', onClick: '{{function(){$accountlistBtn("left")}}}' },{ name: 'select', component: 'Select', className: 'app-sumaccount-rpt-normalSearch-input', onChange: '{{function(value){$accountlistChange(value, false)}}}', value: '{{data.searchValue.accountcode}}', optionFilterProp:"children", filterOption: '{{$filterOptionSummary}}', dropdownStyle: {zIndex: 10}, children: { name: 'option', component: 'Select.Option', className: 'app-sumaccount-rpt-account-select-item', title: '{{data.other.accountlist && data.other.accountlist[_lastIndex].codeAndName }}', value: "{{ data.other.accountlist && data.other.accountlist[_lastIndex].code }}", children: '{{data.other.accountlist && data.other.accountlist[_lastIndex].codeAndName }}', _power: 'for in data.other.accountlist' } },{ name: 'rightBtn', component: 'Icon', fontFamily: 'edficon', type: 'you', className: 'app-sumaccount-rpt-normalSearch-rightBtn', onClick: '{{function(){$accountlistBtn("right")}}}' }] }], normalSearch:[{ name: 'date', type: 'DateRangeMonthPicker', format:"YYYY-MM", allowClear: false, startEnableDate: '{{data.other.enableddate}}', popupStyle: {zIndex: 10}, mode: ['month', 'month'], onChange: '{{$onPanelChange}}', 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: 'currencyId', label: '币别', type: 'Select', childType: 'Option', option: '{{data.other.currencylist}}', allowClear: false },{ name: 'nodatanodisplay', label: '', type: 'Checkbox.Group', render: '{{$renderCheckBox}} ', allowClear: true }], }, { name: 'voucherItems', component: 'Table', pagination: false, className: 'app-sumaccount-rpt-Body', id: 'app-sumaccount-rpt-Body-id', loading: '{{data.loading}}', scroll:'{{data.list.length > 0 ? data.tableOption : {} }}', allowColResize: false, enableSequenceColumn: false, bordered: true, 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: 800, y: 300 }, showCheckbox: { quantity: false, multi: false, }, sort:{ userOrderField: null, order: null }, showOption: { num: false, currency: false }, list: [], content: '查询条件:', searchValue: { accountcode: '', currencyId: '0', nodatanodisplay: [ '1' ], date_end: moment().endOf('month'), date_start: moment().startOf('month'), }, pagination: { currentPage: 1, totalCount: 0, pageSize: 10, totalPage: 0 }, other: { accountlist: [], currencylist: [], enableddate: '' }, loading: true } } }