UNPKG

ttk-app-core

Version:
322 lines (320 loc) 14.6 kB
import moment from 'moment' export function getMeta() { return { name: 'root', component: 'Layout', className: 'app-asset-statrpt', children: [{ name: 'header', className: 'app-asset-statrpt-header', component: '::div', children: [{ name: 'tablesetting', component: 'TableSettingCard', data: '{{data.assetStatList}}', visible: '{{data.showTableSetting}}', positionClass: 'app-asset-statrpt-content', confirmClick: '{{function(data){$showTableSetting({value: false, data: data})}}}', cancelClick: '{{function(){$closeTableSetting()}}}', resetClick: '{{function(){$resetTableSetting({data: data})}}}' }, { name: 'accountQuery', title: 'accountQuery', className: 'app-asset-statrpt-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: 'mk-normalsearch-reload', onClick: '{{$refresh}}' }, confirmBtn:{ hidden: false, text: '查询' }, cancelBtn: { hidden: false, text: '取消' }, menuBtn:[{ name: 'print', component: 'Icon', fontFamily: 'edficon', className: 'btn print', type: 'dayin', onClick: '{{$print}}', title: '打印', style: { fontSize: 28, lineHeight: '30px' }, }, { name: 'export', component: 'Icon', fontFamily: 'edficon', className: 'btn export', type: 'daochu', title: '导出', onClick: '{{$exports}}', style: { fontSize: 28 }, }], normalSearcChildren: [{ name: 'assetProperty', component: 'Select', showSearch: false, className: 'app-asset-statrpt-header-assetProperty asset-header-select', 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-asset-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-statrpt-header-assetClass asset-header-select', 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-asset-option', title: '{{data.other.assetClass && data.other.assetClass[_rowIndex].label}}', value: '{{data.other.assetClass && data.other.assetClass[_rowIndex].value }}', children: '{{data.other.assetClass && data.other.assetClass[_rowIndex].label }}', _power: 'for in data.other.assetClass' } }, { name: 'discribte', component: '::span', children: '折旧/摊销期间', className: 'app-asset-statrpt-header-discribteSpan', }, { name: 'date', component: 'DateRangeMonthPicker', className: 'app-asset-statrpt-header-date', format: "YYYY-MM", allowClear: true, startEnableDate: '{{data.other.enabledDate}}', 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', showSearch: false, className: 'app-asset-statrpt-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])}}}`, children: { name: 'option', component: 'Select.Option', //className: 'active-asset-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', showSearch: false, className: 'app-asset-statrpt-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', //className: 'active-asset-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: 'date_start', type: 'DatePicker.MonthPicker', mode: ['month', 'month'], format: "YYYY-MM", allowClear: true, // noClear: true, decoratorDate: '{{function(value, value2){return $disabledDate(value, value2, "pre")}}}' }, next: { name: 'date_end', type: 'DatePicker.MonthPicker', mode: ['month', 'month'], format: "YYYY-MM", allowClear: true, // noClear: true, decoratorDate: '{{function(value, value2){return $disabledDate(value, value2, "next")}}}' } }, { name: 'date', range: true, label: '开始使用日期', centerContent: '到', isTime: true, pre: { name: 'startDate', type: 'DatePicker', // mode: ['month', 'month'], // format: "YYYY-MM", allowClear: true, // noClear: true, decoratorDate: '{{function(value, value2){return $disabledDateDay(value, value2, "pre")}}}' }, next: { name: 'endDate', type: 'DatePicker', // mode: ['month', 'month'], // format: "YYYY-MM", allowClear: true, // noClear: true, decoratorDate: '{{function(value, value2){return $disabledDateDay(value, value2, "next")}}}' } }, { name: 'hasDisposalAsset', label: '', type: 'Checkbox.Group', render: '{{$renderCheckBox}} ', allowClear: true }], }] }, { name: 'content', component: 'Layout', className: 'app-asset-statrpt-content', children:[{ name: 'dataGrid', component: 'DataGrid', className: 'app-asset-statrpt-Body', headerHeight: 37, isColumnResizing: true, rowHeight: 37, ellipsis: true, onColumnResizeEnd: '{{$onColumnResizeEnd}}', loading: '{{data.other.loading}}', rowsCount: "{{data.list.length}}", columns: '{{$tableColumns(data.assetStatList,data.list)}}' }] }] } } export function getInitState() { return { data: { list: [], showTableSetting:false, searchValue: { code: null, hasDisposalAsset: 0, endDate: null, startDate: null, date_start: moment().endOf('month'), date_end: moment().endOf('month'), }, filter: { startBuyData: moment().endOf('month').format('YYYY-MM'), endBuyData: moment().endOf('month').format('YYYY-MM'), hasDisposalAsset: 0, }, form: { }, other: { assets: [], assetAddType: [], assetClassId: [], deprMethod: [], ts: '', loading: false, //grid加载状态 oldSearchValue: { hasDisposalAsset: 0, endDate: null, startDate: null, date_start: moment().endOf('month'), date_end: moment().endOf('month'), }, isColumnSolution: true, sort: { userOrderField: null, order: null }, }, assetStatList: [{ "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" }], showTableSetting: false } } }