ttk-app-core
Version:
enterprise develop framework
71 lines (67 loc) • 2.39 kB
JavaScript
import moment from 'moment'
import {consts} from 'edf-consts'
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'ttk-scm-app-inventory-card',
children: {
name: 'load',
component: 'Spin',
tip: '数据处理中...',
spinning: '{{data.other.loading}}',
children:{
name: 'form',
component: 'Form',
className: 'ttk-scm-app-inventory-card-form',
children:[{
name:'date',
component: 'Form.Item',
className:'date',
label: '启用月份',
children: [{
name: 'date',
component: 'DatePicker.MonthPicker',
value: '{{$stringToMoment(data.other.beginDate)}}',
onChange: "{{function(d){$changeDate($momentToString(d,'YYYY-MM'))}}}",
disabledDate: '{{function(value){return $disabledBeginDate(value)}}}'
}]
},{
name:'method',
component: 'Form.Item',
label: '计价核算方式',
children:[{
name: 'method',
component: 'Select',
value: '{{data.form.methodId}}',
// onChange: `{{function(v){$selectMethod(v)}}}`,
children: {
name: 'option',
component: 'Select.Option',
value: "{{data.other.method && data.other.method[_rowIndex].id}}",
children: '{{data.other.method && data.other.method[_rowIndex].name}}',
_power: 'for in data.other.method'
}
}]
}]
}
}
}
}
export function getInitState() {
return {
data: {
other: {
loading: false,
beginDate: moment().format('YYYY-MM'),
method:[{
id: 1,
name: '移动加权平均法'
}]
},
form:{
methodId:1
}
}
}
}