ttk-app-core
Version:
enterprise develop framework
232 lines (231 loc) • 6.55 kB
JavaScript
import moment from 'moment'
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'ttk-scm-app-warehouseDetail',
children: [{
name: 'accountQuery',
title: 'accountQuery',
className: 'ttk-scm-app-warehouseDetail-accountQuery',
component: 'SearchCard',
refName: 'accountQuery',
searchClick: '{{function(value){$searchValueChange(value)}}}',
// clearClick: '{{function(value){$clearValueChange(value)}}}',
onChange: '{{function(value){$searchValueChange(value)}}}',
refreshBtn: {
name: 'refreshBtn',
component: 'Icon',
fontFamily: 'edficon',
type: 'shuaxin',
className: 'mk-normalsearch-reload',
onClick: '{{$refresh}}'
},
confirmBtn:{
hidden: false,
text: '查询'
},
cancelBtn: {
hidden: false,
text: '取消'
},
clearBtn: {
hidden: false,
text: '清空'
},
menuBtn: [{
name: 'add',
component: 'Button',
type: 'primary',
children: '新增单据',
className: 'btn',
onClick: '{{$inventory}}'
},{
name: 'add',
component: 'Button',
type: 'primary',
children: '自动生成暂估',
className: 'btn',
onClick: '{{$linkToEstimateList}}'
},{
name: 'add',
component: 'Button',
type: 'primary',
children: '删除',
className: 'btn',
onClick: '{{$delete}}'
},{
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-warehouseDetail-normalSearch',
children:[{
name: 'date',
component: 'DateRangeMonthPicker',
format: "YYYY-MM",
allowClear: true,
popupStyle: { zIndex: 10 },
mode: ['month', 'month'],
onPanelChange: '{{$onPanelChange}}',
value: '{{$getNormalDateValue()}}',
disabledStartDate:'{{function() {return false}}}'
},{
name: 'type1',
component: 'Select',
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'
}
},{
name: 'type2',
component: 'Select',
showSearch: false,
placeholder: '单据类型',
allowClear: true,
value: '{{data.form.businessId}}',
onChange: `{{function(v){$selectBusinessType(data.other.businessList.filter(function(o){return o.value == v})[0])}}}`,
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.other.businessList && data.other.businessList[_rowIndex].value}}',
title: '{{data.other.businessList && data.other.businessList[_rowIndex].label}}',
children: '{{data.other.businessList && data.other.businessList[_rowIndex].label}}',
_power: 'for in data.other.businessList'
}
},{
name: 'inventoryName',
component: 'Input.Search',
showSearch: true,
placeholder: '名称/规格型号/编码',
className:'ttk-scm-app-warehouseDetail-selectR',
onChange: `{{function(v){$searchList(v.target.value)}}}`,
}]
}],
normalSearch:[],
moreSearch: '{{data.other.searchValue}}',
moreSearchItem: [{
name: 'date',
range: true,
label: '期间',
centerContent: '到',
isTime: true,
pre:{
name: 'beginDate',
type: 'DatePicker.MonthPicker',
allowClear: false,
noClear: true,
},
next: {
name: 'endDate',
type: 'DatePicker.MonthPicker',
allowClear: false,
noClear: true,
}
},{
name: 'type',
label: '存货分类',
type: 'Select',
childType: 'Option',
optionFilterProp:"children",
filterOption: '{{$filterOptionSummary}}',
title: '{{data.other.type}}',
option: '{{data.other.type}}',
allowClear: true,
},{
name: 'business',
label: '业务类型',
type: 'Select',
childType: 'Option',
optionFilterProp:"children",
filterOption: '{{$filterOptionSummary}}',
title: '{{data.other.businessList}}',
option: '{{data.other.businessList}}',
allowClear: true,
}]
},{
name: 'content',
className: 'ttk-scm-app-warehouseDetail-content',
component: 'Layout',
children: [{
name: 'manageContent',
component: 'Table',
pagination: false,
className: 'ttk-scm-app-warehouseDetail-table',
allowColResize: false,
enableSequenceColumn: false,
loading: '{{data.other.loading}}',
bordered: true,
scroll: '{{data.other.tableList.length > 0 ? data.tableOption : {} }}',
dataSource: '{{data.other.tableList}}',
key: '{{data.tableKey}}',
checkboxKey: 'voucherId',
checkboxChange: '{{$checkboxChange}}',
checkboxValue: '{{data.tableCheckbox.checkboxValue}}',
Checkbox: false,
rowSelection: '{{$rowSelection()}}',
columns: '{{$tableColumns()}}',
}]
}]
}
}
export function getInitState(option) {
return {
data: {
tableKey: 1000,
tableCheckbox: {
checkboxValue: [],
selectedOption: []
},
tableOption: {
x: 900,
y: null
},
enableDate: null,
filter:{},
form:{
typeId:undefined
},
other: {
tableList: [],
loading: false,
searchValue:{
endDate: moment().endOf('month'),
beginDate: moment().startOf('month'),
},
type:[]
}
}
}
}