ttk-app-core
Version:
enterprise develop framework
172 lines (168 loc) • 4.9 kB
JavaScript
import moment from 'moment'
import {consts} from 'edf-consts'
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'ttk-scm-voucherHabit-card',
children: {
name: 'load',
component: 'Spin',
tip: '数据处理中...',
spinning: '{{data.other.loading}}',
children:[{
name: 'tabNav',
component: 'Tabs',
_visible: '{{data.other.isTab}}',
activeKey: '{{data.form.activeKey}}',
onChange: '{{function(v){$changeTab(v)}}}',
children: [{
name: "option",
component: 'Tabs.TabPane',
tab: [{
name: 'tab',
component: '::div',
children: "{{ data.other.activeKey && data.other.activeKey[_rowIndex].name }}",
}],
key: "{{ data.other.activeKey && data.other.activeKey[_rowIndex].id }}",
_power: 'for in data.other.activeKey'
}]
},{
name: 'prompt',
component: '::span',
className: 'prompt',
children:'提示:您选择的凭证习惯,将会影响到凭证及分录的合并拆分规则'
},{
name: 'habit',
component: '::div',
className: 'habit',
_visible: '{{!data.other.isTab}}',
children:[{
name: 'title',
component: '::div',
className: 'title',
children: '{{data.other.title}}'
},{
name: 'title',
component: 'Radio.Group',
options: '{{data.other.habit}}',
value: '{{data.form.habitId}}',
onChange: '{{function(e){$changeRadio(e.target.value)}}}'
},{
name: 'settleMerge',
component: '::div',
children: '{{$renderCheck()}}'
// children: [{
// name: 'checkbox',
// component: 'Checkbox',
// checked: '{{data.form.settleMerge}}',
// children: '结算分录合并一条',
// onChange: '{{$settleMergeChange}}'
// }]
},{
name: 'date',
component: 'Form.Item',
label: '日期习惯',
className: 'date',
children: [{
name: 'select',
component: 'Select',
value: '{{data.form.dateHabitId}}',
onChange: `{{function(v){$fieldChange('data.form.dateHabitId',data.other.dateHabit.filter(function(o){return o.id == v})[0])}}}`,
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.other.dateHabit && data.other.dateHabit[_rowIndex].id}}',
children: '{{data.other.dateHabit && data.other.dateHabit[_rowIndex].name}}',
_power: 'for in data.other.dateHabit'
}
}]
},{
name: 'operations',
component: 'Form.Item',
className: 'checkboxGroups',
label: '摘要习惯',
children: '{{$renderCheckGroup()}}'
},{
name: 'text',
component: '::div',
className: 'text',
children: '{{$renterText()}}'
}]
},{
name: 'habitArr',
component: '::div',
className: 'habit',
_visible: '{{data.other.isTab}}',
children:[{
name: 'titleArr',
component: 'Radio.Group',
options: '{{data.other.habit}}',
value: '{{data.form.habitId}}',
onChange: '{{function(e){$changeRadioArr(e.target.value)}}}'
},{
name: 'settleMerge',
component: '::div',
children: '{{$renderChecks()}}'
// children: [{
// name: 'checkbox',
// component: 'Checkbox',
// checked: '{{data.form.settleMerge}}',
// children: '结算分录合并一条',
// onChange: '{{$settleMergeChange}}'
// }]
},{
name: 'date',
component: 'Form.Item',
label: '日期习惯',
className: 'date',
children: [{
name: 'select',
component: 'Select',
value: '{{data.form.dateHabitId}}',
onChange: `{{function(v){$fieldChangeArr('data.form.dateHabitId',data.other.dateHabit.filter(function(o){return o.id == v})[0])}}}`,
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.other.dateHabit && data.other.dateHabit[_rowIndex].id}}',
children: '{{data.other.dateHabit && data.other.dateHabit[_rowIndex].name}}',
_power: 'for in data.other.dateHabit'
}
}]
},{
name: 'operations',
component: 'Form.Item',
className: 'checkboxGroups',
label: '摘要习惯',
children: '{{$renderCheckGroups()}}'
},{
name: 'text',
component: '::div',
className: 'text',
children: '{{$renterTextTab()}}'
}]
}]
}
}
}
export function getInitState() {
return {
data: {
form: {
checkArr:['开票日期'],
},
other: {
error: {},
loading: false,
habit:[],
dateHabit:[],
isTab: false,
tabKey: [{
id: 1
},{
id: 2
}]
},
}
}
}