UNPKG

ttk-app-core

Version:
226 lines (224 loc) 6.83 kB
import moment from 'moment' export function getMeta() { return { name: 'root', component: 'Layout', className: 'app-asset-depreciation', children: [{ name: 'tablesetting', component: 'TableSettingCard', data: '{{data.other.columnDto}}', visible: '{{data.showTableSetting}}', showTitle: '{{false}}', positionClass: 'app-asset-depreciation-content', confirmClick: '{{function(data){$showTableSetting({value: false, data: data})}}}', cancelClick: '{{function(){$closeTableSetting()}}}', resetClick: '{{function(){$resetTableSetting({data: data})}}}' },{ name: 'header', component: '::div', className: 'app-asset-depreciation-header', children: [{ name: 'right', component: '::div', className: 'app-asset-depreciation-header-left', children: [{ name: 'assetProperty', component: 'Select', showSearch: false, className: 'app-asset-depreciation-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: 'active-depreciation-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-depreciation-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: 'active-depreciation-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: 'left', component: 'Icon', fontFamily: 'edficon', type: 'zuo', className: '{{$getClassName(data.filter.period, "prev")}}', title: '上一月', onClick: '{{$prev}}' }*/, { name: 'period', component: 'DatePicker.MonthPicker', // value: '{{$getPeriodValue(data.systemDate)}}', value: '{{$stringToMoment(data.filter.period)}}', //onChange: "{{function(d){$sf('data.filter.period',$momentToString(d,'YYYY-MM'))}}}", onChange: "{{$depreciationChange}}", disabledDate: '{{function(value){return $disabledMonth(value)}}}', }/*, { name: 'right', component: 'Icon', fontFamily: 'edficon', type: 'you', className: '{{$getClassName(data.filter.period, "next")}}', title: '下一月', onClick: '{{$next}}' }*/, { name: 'refreshBtn', component: 'Icon', fontFamily: 'edficon', type: 'shuaxin', className: 'reload', onClick: '{{$refresh}}' }] }, { name: 'right', component: '::div', className: 'app-asset-depreciation-header-right', children: [{ name: 'card', component: 'Button', type: 'primary', children: '资产卡片', className: 'btn', onClick: '{{$openCardClick}}', },{ name: 'add', component: 'Button', //type: 'primary', children: '科目设置', className: 'btn subjectRight', onClick: '{{$moreMenuClick}}', _visible: true, },{ name: 'add', component: 'Button', //type: 'primary', children: '计提折旧/摊销', _visible: '{{data.other.depreciationShow}}', className: 'btn subjectRight', onClick: '{{$depreciation}}' }, { name: 'voucher', component: 'Button', //type: 'primary', children: '手工生成凭证', _visible: '{{data.other.submitShow}}', className: 'btn subjectRight', onClick: '{{$generatingVoucher}}' }, { name: 'print', component: 'Icon', fontFamily: 'edficon', className: 'btn print dayin', type: 'dayin', onClick: '{{$print}}', title: '打印', style: { fontSize: 28 }, }, { name: 'export', component: 'Icon', fontFamily: 'edficon', className: 'btn export daochu', type: 'daochu', title: '导出', onClick: '{{$exports}}', style: { fontSize: 28, lineHeight: '28px' }, }] }] }, { name: 'content', component: 'Layout', className: 'app-asset-depreciation-content', children: [{ name: 'dataGrid', component: 'DataGrid', headerHeight: 37, isColumnResizing: true, rowHeight: 37, ellipsis: true, onColumnResizeEnd: '{{$onColumnResizeEnd}}', loading: '{{data.other.loading}}', rowsCount: "{{$getListRowsCount()}}", columns: "{{$getColumns()}}", }] }, { name: 'footer', component: '::div', className: 'app-list-account-footer', // children: [{ // name: 'pagination', // component: 'Pagination', // showSizeChanger: true, // pageSize: '{{data.page.pageSize}}', // current: '{{data.page.current}}', // total: '{{data.page.total}}', // onChange: '{{$pageChanged}}', // onShowSizeChange: '{{$pageChanged}}', // }] children: [{ name: 'pagination', component: 'Pagination', showSizeChanger: true, pageSizeOptions: ['50', '100', '150', '200'], pageSize: '{{data.page.pageSize}}', current: '{{data.page.current}}', total: '{{data.page.total}}', onChange: '{{$pageChanged}}', onShowSizeChange: '{{$pageChanged}}' }] }] } } export function getInitState() { return { data: { list: [], showTableSetting:false, filter: { page: {pageSize: 50, currentPage: 1} }, systemDate: '', form: {}, other: { assetProperty: [], depreciationShow: false, submitShow: false, loading: false, //grid加载状态 columnDto: [], isColumnSolution: true, isDepreciation: true, isGeneratingVoucher: true, sort: { userOrderField: null, order: null }, }, page: { current: 1, total: 0, pageSize: 50 }, } } }