UNPKG

ttk-app-core

Version:
261 lines (259 loc) 6.53 kB
import moment from 'moment' export function getMeta() { return { name: 'root', component: 'Layout', className: 'ttk-scm-app-inventory', children: [{ name: 'accountQuery', title: 'accountQuery', className: 'ttk-scm-app-inventory-accountQuery', component: 'SearchCard', refName: 'accountQuery', searchClick: '{{function(value){$searchValueChange(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}}' }, leftMenuBtn:{ name: 'leftMenuBtn', component: 'Icon', className: 'btn setting', fontFamily: 'edficon', type: 'shezhi', onClick: '{{$setting}}' }, confirmBtn:{ hidden: false, text: '查询' }, cancelBtn: { hidden: false, text: '取消' }, clearBtn: { hidden: false, text: '清空' }, menuBtn: [{ name: 'add', component: 'Button', type: 'primary', children: '新增单据', className: 'btn', onClick: '{{$addInventory}}' },{ name: 'add', component: 'Button', type: 'primary', children: '出入库明细表', className: 'btn', onClick: '{{$detailTable}}' },{ name: 'add', component: 'Button', type: 'primary', children: '成本计算', className: 'btn', onClick: '{{$calculateCost}}' },{ name: 'batch', component: 'Dropdown', className: 'btn', overlay: { name: 'menu', component: 'Menu', // onClick: '{{$moreMenuClick}}', children: [{ name: 'temporary', component: 'Menu.Item', key: 'temporary', children: '生成暂估凭证' },{ name: 'cost', component: 'Menu.Item', key: 'cost', children: '生成成本凭证' },{ name: 'subjectSetting', component: 'Menu.Item', key: 'subjectSetting', children: '科目设置' }] }, children: { name: 'voucher', component: 'Button', children: [{ name: 'word', component: '::span', children: '生成凭证' },{ name: 'more', component: 'Icon', type: 'down' }] } },{ name: 'batch', component: 'Dropdown', className: 'btn', overlay: { name: 'menu', component: 'Menu', // onClick: '{{$moreMenuClick}}', onClick: '{{$linkToEstimateList}}', children: [{ name: 'disposal', component: 'Menu.Item', key: 'disposal', children: { name: 'name', component: '::span', // onClick: '{{$linkToEstimateList}}', children: '生成暂估' }, }] }, children: { name: 'internal', component: 'Button', children: [{ name: 'word', component: '::span', children: '更多' },{ name: 'more', component: 'Icon', type: 'down' }] } },{ name: 'print', component: 'Icon', fontFamily: 'edficon', className: 'btn print dayin', type: 'dayin', onClick: '{{$print}}', title: '打印', style: { fontSize: 28, lineHeight: '30px' }, }, { name: 'export', component: 'Icon', fontFamily: 'edficon', className: 'btn export daochu', type: 'daochu', title: '导出', onClick: '{{$export}}', style: { fontSize: 28, lineHeight: '28px' }, }], normalSearcChildren: [{ name: 'selectContianer', component: '::div', className: 'ttk-scm-app-inventory-normalSearch', children:[{ name: 'date', component: 'DatePicker.MonthPicker', value: '{{$getNormalDateValue()}}', onChange: "{{function(d){$changeDate($momentToString(d,'YYYY-MM'))}}}", disabledDate: '{{function(value){return $handleDisabledDate(value)}}}', },{ name: 'type', label: '存货分类', component: 'Select', showSearch: false, placeholder: '存货分类', allowClear: true, value: '{{data.form.typeId}}', onChange: `{{function(v){$selectType(data.other.type.filter(function(o){return o.value == v})[0])}}}`, children: { name: 'option', component: 'Select.Option', value: '{{data.other.type && data.other.type[_rowIndex].value}}', title: '{{data.other.type && data.other.type[_rowIndex].label}}', children: '{{data.other.type && data.other.type[_rowIndex].label}}', _power: 'for in data.other.type' } }] }], normalSearch:[], moreSearch: '{{data.searchValue}}', moreSearchItem: [ { name: 'startDate', label: '月份', isTime: true, type: 'DatePicker.MonthPicker', noClear: true, disabledDate: '{{function(value){return $handleDisabledDate(value)}}}', }, { name: 'type', label: '存货分类', type: 'Select', childType: 'Option', allowClear: true, optionFilterProp:"children", filterOption: '{{$filterOptionSummary}}', title: '{{data.other.type}}', option: '{{data.other.type}}', onchange: '{{function(v){$selectType(data.other.type.filter(function(o){return o.value == v})[0])}}}', }] },{ name: 'empty', component: '::div', _visible: '{{data.other.isEmpty}}', children: '{{$renderEmpty()}}', },{ name: 'manageContent', component: 'Table', pagination: false, className: 'ttk-scm-app-inventory-table', allowColResize: false, enableSequenceColumn: false, loading: '{{data.other.loading}}', bordered: true, scroll: '{{data.other.tableList.length > 0 ? data.tableOption : {} }}', dataSource: '{{data.other.tableList}}', noDelCheckbox: true, columns: '{{$tableColumns()}}', }] } } export function getInitState() { return { data: { tableOption: { x: 900, y: null }, enableDate: null, form:{ startDate: moment().format('YYYY-MM'), type: '' }, searchValue:{ startDate: moment().endOf('month'), type: '' }, other: { tableList: [], type:[], loading: true, isEmpty: false } } } }