ttk-app-core
Version:
enterprise develop framework
799 lines (787 loc) • 31.9 kB
JavaScript
import moment from 'moment'
import { consts } from 'edf-consts'
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'app-asset-card',
children: [{
name: 'mail',
component: 'Spin',
tip: '{{data.other.longLoading ? "数据加载中... 该业务需要时间较长,请等待" : "数据处理中..."}}',
spinning: '{{data.other.loading}}',
children: [{
name: 'assetProperty',
component: '::div',
className: 'app-asset-card-item topnavi',
children: [{
name: 'tabNav',
component: 'Tabs',
className: `{{data.other.status == data.other.statusObj.new ? '' : 'tab-status'}}`,
activeKey: '{{data.form.assetPropertyId}}',
onChange: `{{data.other.status == data.other.statusObj.new ? $assetPropertyChange : ''}}`,
children: [{
name: "option",
component: 'Tabs.TabPane',
tab: [{
name: 'tab',
component: '::div',
children: '{{ data.other.assetProperty && data.other.assetProperty[_rowIndex].name }}'
}],
key: "{{ data.other.assetProperty && data.other.assetProperty[_rowIndex].id }}",
_power: 'for in data.other.assetProperty'
}]
}]
}, {
name: 'assetInfo',
component: '::div',
className: 'app-asset-card-item',
children: [{
name: 'assetClass',
component: 'Form.Item',
label: '资产分类',
required: true,
validateStatus: "{{data.other.error.assetClass? (data.other.assetClassTip? 'success':'error'):'success'}}",
help: '{{ !data.other.assetClassTip ? data.other.error.assetClass: ""}}',
children: [{
name: 'assetClass',
component: 'Select',
showSearch: false,
disabled: '{{data.other.status == data.other.statusObj.change || data.other.status == data.other.statusObj.query ||!data.other.assetCardIsEnable}}',
value: '{{data.form.assetClass && data.form.assetClass.id}}',
onChange: `{{$assetClass()}}`,
children: {
name: 'option',
component: 'Select.Option',
value: "{{data.other.assetClass &&data.other.assetClass[_rowIndex].id}}",
title: "{{data.other.assetClass &&data.other.assetClass[_rowIndex].name}}",
children: '{{data.other.assetClass && data.other.assetClass[_rowIndex].name}}',
_power: 'for in data.other.assetClass'
}
}]
}, {
name: 'code',
component: 'Form.Item',
label: '资产编码',
required: true,
validateStatus: "{{data.other.error.code? (data.other.codeTip ? 'success':'error'):'success'}}",
help: '{{!data.other.codeTip ? data.other.error.code: ""}}',
children: [{
name: 'code',
component: 'Input',
//maxlength: 50,
disabled: '{{data.other.status == data.other.statusObj.change || data.other.status == data.other.statusObj.query ||!data.other.assetCardIsEnable}}',
value: '{{data.form.code}}',
onChange: "{{function(e){$fieldotherChange('data.form.code',e.target.value)}}}",
onBlur: "{{function(e){$fieldotherBlur('data.form.code',e.target.value)}}}"
}]
}, {
name: 'name',
component: 'Form.Item',
label: '资产名称',
required: true,
validateStatus: "{{data.other.error.name?(data.other.nameTip? 'success':'error'):'success'}}",
help: '{{!data.other.nameTip ? data.other.error.name: ""}}',
children: [{
name: 'name',
//component: '{{data.form.assetPropertyId && (data.form.assetPropertyId == data.consts.ASSETTYPE_fixedAssets || data.form.assetPropertyId == data.consts.ASSETTYPE_immaterialAssets) ? "Select" : "Input"}}',
component: 'Input',
//maxlength: 50,
disabled: '{{(data.other.status == data.other.statusObj.query) || !data.other.assetCardIsEnable}}',
value: '{{data.form.name}}',
title: '{{data.form.name}}',
mode: 'intangible',
onChange: "{{function(e){$fieldotherChange('data.form.name',e.target.value)}}}",
onBlur: "{{function(e){$fieldotherBlur('data.form.name',e.target.value)}}}",
/*children: {
name: 'option',
component: 'Select.Option',
value: "{{ data.other.name && data.other.name[_rowIndex].id }}",
children: '{{data.other.name && data.other.name[_rowIndex].name }}',
_power: 'for in data.other.name'
}*/
}]
}, {
name: 'specification',
component: 'Form.Item',
label: '规格型号',
validateStatus: "{{data.other.error.specification?(data.other.specificationTip? 'success':'error'):'success'}}",
help: '{{!data.other.specificationTip ? data.other.error.specification: ""}}',
children: [{
name: 'specification',
component: 'Input',
//maxlength: 50,
disabled: '{{(data.other.status == data.other.statusObj.query) || !data.other.assetCardIsEnable}}',
value: '{{data.form.specification}}',
onChange: "{{function(e){$fieldotherChange('data.form.specification',e.target.value)}}}",
onBlur: "{{function(e){$fieldotherBlur('data.form.specification',e.target.value)}}}"
}]
}]
}, {
name: 'changeTitle',
component: '::div',
className: 'app-asset-card-title',
_visible: '{{data.other.status == data.other.statusObj.change}}',
children: [{
name: 'change',
component: '::span',
children: '变动信息'
}]
}, {
name: 'change',
component: '::div',
className: 'app-asset-card-item',
children: [{
component: 'Form.Item',
label: '开始变动日期',
_visible: '{{data.other.status == data.other.statusObj.change}}',
required: true,
validateStatus: "{{data.other.error.changeDate ? 'error' : 'success'}}",
help: '{{data.other.error.changeDate}}',
children: [{
name: 'changeDate',
component: 'DatePicker',
value: '{{$stringToMoment(data.form.changeDate)}}',
onChange: "{{function(d){$fieldChange('data.form.changeDate',$momentToString(d,'YYYY-MM-DD'))}}}",
disabledDate: '{{function(value){return $disabledChangeDate(value)}}}'
}]
}]
}, {
name: 'basicTitle',
component: '::div',
className: 'app-asset-card-title',
children: [{
name: 'basic',
component: '::span',
children: '基本信息'
}]
}, {
name: 'essentialInfo',
component: '::div',
className: 'app-asset-card-item',
children: [{
name: 'buyDate',
component: 'Form.Item',
label: '开始使用日期',
className: 'beginStartUseDate',
required: true,
validateStatus: "{{data.other.error.buyDate?(data.other.buyDateTip? 'success':'error'):'success'}}",
help: '{{!data.other.buyDateTip ? data.other.error.buyDate: ""}}',
children: [{
name: 'buyDate',
component: 'DatePicker',
disabled: '{{data.other.status == data.other.statusObj.change || data.other.status == data.other.statusObj.query ||!data.other.assetCardIsEnable}}',
value: '{{$stringToMoment(data.form.buyDate)}}',
onChange: "{{$useDateChange}}",
disabledDate: '{{function(value){return $disabledUseDate(value)}}}',
}]
}, {
name: 'origValue',
component: 'Form.Item',
label: '原值',
required: true,
validateStatus: "{{data.other.error.origValue?(data.other.origValueTip? 'success':'error'):'success'}}",
help: '{{!data.other.origValueTip ? data.other.error.origValue: ""}}',
children: [{
name: 'origValue',
component: 'Input.Number',
className: 'right-item',
precision: 2,
maxlength: '13',
disabled: '{{data.other.status == data.other.statusObj.change || data.other.status == data.other.statusObj.query ||!data.other.assetCardIsEnable}}',
value: '{{ $addThousandsPosition(data.form.origValue ? data.form.origValue : "" , "origValue")}}',
onBlur: "{{function(e){$getOrigValue('data.form.origValue',e)}}}"
}]
}, {
name: 'deprMonth',
component: 'Form.Item',
label: '预计使用',
className: 'use-date',
required: true,
validateStatus: "{{data.other.error.deprMonth?(data.other.deprMonthTip ? 'success':'error'):'success'}}",
help: '{{!data.other.deprMonthTip ? data.other.error.deprMonth :""}}',
children: [{
name: 'deprMonth',
component: 'Input.Number',
regex: '^[0-9]+$',
maxlength: '4',
disabled: '{{data.other.status == data.other.statusObj.change || data.other.status == data.other.statusObj.query ||!data.other.assetCardIsEnable}}',
className: 'month',
value: '{{data.form.deprMonth}}',
onBlur: "{{function(e){$getDeprMonths('data.form.deprMonth',e)}}}"
}, {
name: 'month',
component: '::span',
children: '月'
}]
}, {
name: 'uses',
component: 'Form.Item',
label: '用途',
required: true,
validateStatus: "{{data.other.error.uses?(data.other.usesTip? 'success':'error'):'success'}}",
help: '{{!data.other.usesTip ? data.other.error.uses: ""}}',
children: [{
name: 'uses',
component: 'Select',
showSearch: false,
disabled: '{{(data.other.status == data.other.statusObj.query) || !data.other.assetCardIsEnable}}',
value: '{{data.form.uses && data.form.uses.id}}',
onChange: `{{function(v){$usesChange('data.form.uses',data.other.assetUses.filter(function(o){return o.id == v})[0])}}}`,
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.other.assetUses && data.other.assetUses[_rowIndex].id }}',
children: '{{data.other.assetUses && data.other.assetUses[_rowIndex].name }}',
_power: 'for in data.other.assetUses'
}
}]
}]
}, {
name: 'hasinitTitle',
component: '::div',
className: 'app-asset-card-title',
children: [{
name: 'hasinit',
component: '::span',
children: '{{$getVisibleName(data.form.assetPropertyId) ? "折旧信息" : "摊销信息"}}'
}]
}, {
name: 'beginDeprPeriod',
component: '::div',
className: 'app-asset-card-item',
children: [{
name: 'deprMethod',
component: 'Form.Item',
className: 'depr-method-style',
label: '{{$getVisibleName(data.form.assetPropertyId) ? "折旧方法" : "摊销方法"}}',
required: true,
validateStatus: "{{data.other.error.deprMethod?(data.other.deprMethodTip? 'success':'error'):'success'}}",
help: '{{!data.other.deprMethodTip ?data.other.error.deprMethod :""}}',
children: [{
name: 'deprMethod',
component: 'Select',
showSearch: false,
disabled: '{{data.other.status == data.other.statusObj.change || data.other.status == data.other.statusObj.query ||!data.other.assetCardIsEnable}}',
value: '{{data.form.deprMethod && data.form.deprMethod.id}}',
onChange: `{{function(v){$fieldChange('data.form.deprMethod',data.other.depreciationFunction.filter(function(o){return o.id == v})[0]); $deprMethod(data.other.depreciationFunction.filter(function(o){return o.id == v})[0])}}}`,
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.other.depreciationFunction && data.other.depreciationFunction[_rowIndex].id }}',
children: '{{data.other.depreciationFunction && data.other.depreciationFunction[_rowIndex].name }}',
_power: 'for in data.other.depreciationFunction'
}
}]
}, {
name: 'salvageRate',
component: 'Form.Item',
label: '净残值率',
validateStatus: "{{data.other.error.salvageRate?(data.other.salvageRateTip? 'success':'error'):'success'}}",
help: '{{!data.other.salvageRateTip ? data.other.error.salvageRate: ""}}',
_visible: '{{$getVisibleName(data.form.assetPropertyId) ? true : false}}',
children: [{
name: 'salvageRate',
component: 'Input.Number',
className: 'right-item',
precision: 2,
// maxlength: '6',
disabled: '{{data.other.status == data.other.statusObj.change || data.other.status == data.other.statusObj.query ||!data.other.assetCardIsEnable}}',
value: '{{data.form.salvageRate ? data.form.salvageRate+"%" : ""}}',
onBlur: "{{function(e){$salvageRateChange('data.form.salvageRate',e)}}}"
}]
}, {
name: 'lineDepreciation',
component: 'Form.Item',
label: '月折旧额',
required: '{{data.other.isLineDepreciation}}',
validateStatus: "{{data.other.error.lineDepreciation?(data.other.lineDepreciationTip ? 'success':'error'):'success'}}",
help: '{{!data.other.lineDepreciationTip ? data.other.error.lineDepreciation: ""}}',
_visible: '{{data.other.isLineDepreciation}}',
children: [{
name: 'lineDepreciation',
component: 'Input.Number',
className: 'right-item',
precision: 2,
maxlength: '13',
disabled: '{{data.other.status == data.other.statusObj.change || data.other.status == data.other.statusObj.query ||!data.other.assetCardIsEnable || data.other.isDisableLineDepreciation}}',
//value: '{{data.form.lineDepreciation}}',
value: '{{$addThousandsPosition(data.form.lineDepreciation ? data.form.lineDepreciation : "", "lineDepreciation")}}',
//onChange: "{{function(e){$fieldChange('data.form.lineDepreciation',e)}}}",
onBlur: "{{function(e){$getLineDepreciation('data.form.lineDepreciation',e)}}}"
}]
}, {
name: 'isHasInit',
component: 'Form.Item',
className: 'hasinit',
label: '有原始期初值',
children: [{
name: 'select',
component: 'Checkbox',
disabled: '{{data.other.status == data.other.statusObj.change || data.other.status == data.other.statusObj.query ||!data.other.assetCardIsEnable || data.other.isDisableHasInit}}',
checked: '{{data.form.isHasInit}}',
onChange: "{{function(e){$hasInitChange('data.form.isHasInit', e.target.checked)}}}"
}, {
name: 'isHasInitValue',
component: '::span',
className: 'isHasInitValue',
children: '提示:开始使用日期为以前会计月份时,需要您确认期初信息'
}]
}, {
name: 'beginDeprPeriod',
component: 'Form.Item',
className: 'hasinit3',
_visible: '{{data.form.isHasInit ? true : false}}',
className: 'card-month-style',
label: '{{$getVisibleName(data.form.assetPropertyId) ? "在本产品折旧开始月份" : "在本产品摊销开始月份"}}',
required: true,
validateStatus: "{{data.other.error.beginDeprPeriod?(data.other.beginDeprPeriodTip? 'success':'error'):'success'}}",
help: '{{!data.other.beginDeprPeriodTip ? data.other.error.beginDeprPeriod : ""}}',
children: [{
name: 'beginDeprPeriod',
component: 'DatePicker.MonthPicker',
disabled: '{{data.other.status == data.other.statusObj.change || data.other.status == data.other.statusObj.query ||!data.other.assetCardIsEnable || data.other.disableBeginDeprPeriod}}',
value: '{{$stringToMoment(data.form.beginDeprPeriod)}}',
onChange: "{{function(d){$beginDeprPeriodChange('data.form.beginDeprPeriod',$momentToString(d,'YYYY-MM'))}}}",
disabledDate: '{{function(value){return $disabledBeginDate(value)}}}'
}]
}, {
name: 'initDeprMonths',
component: 'Form.Item',
className: 'hasinit1',
_visible: '{{data.form.isHasInit ? true : false}}',
label: '{{$getVisibleName(data.form.assetPropertyId) ? "期初已折旧期数" : "期初已摊销期数"}}',
required: true,
validateStatus: "{{data.other.error.initDeprMonths?(data.other.initDeprMonthsTip ? 'success':'error'):'success'}}",
help: '{{!data.other.initDeprMonthsTip ? data.other.error.initDeprMonths: ""}}',
children: [{
name: 'initDeprMonths',
component: 'Input.Number',
precision: 2,
maxlength: '4',
regex: '^[0-9]+$',
disabled: '{{data.other.status == data.other.statusObj.change || data.other.status == data.other.statusObj.query ||!data.other.assetCardIsEnable || data.other.initDepr}}',
value: '{{data.form.initDeprMonths}}',
onBlur: "{{function(e){$getInitDeprMonths('data.form.initDeprMonths',e)}}}",
onChange: '{{function(v){$changeInitDeprMonths(v)}}}',
}]
}, {
name: 'initAccuDepreciation',
component: 'Form.Item',
className: 'hasinit2',
_visible: '{{data.form.isHasInit ? true : false}}',
label: '{{$getVisibleName(data.form.assetPropertyId) ? "期初累计折旧" : "期初累计摊销"}}',
required: true,
validateStatus: "{{data.other.error.initAccuDepreciation?(data.other.initAccuDepreciationTip? 'success':'error'):'success'}}",
help: '{{!data.other.initAccuDepreciationTip ? data.other.error.initAccuDepreciation: ""}}',
children: [{
name: 'endDepMonth',
component: 'Input.Number',
className: 'right-item',
precision: 2,
maxlength: '13',
disabled: '{{data.other.status == data.other.statusObj.change || data.other.status == data.other.statusObj.query ||!data.other.assetCardIsEnable || data.other.initDepr}}',
value: '{{$addThousandsPosition(data.form.initAccuDepreciation ? data.form.initAccuDepreciation : "", "initAccuDepreciation")}}',
onBlur: "{{function(e){$getInitAccuDepreciation('data.form.initAccuDepreciation',e)}}}",
onChange: '{{function(v){$changeDepreciation(v)}}}'
}]
}, {
name: 'hasDeprMonths',
component: 'Form.Item',
_visible: '{{(data.other.status != data.other.statusObj.new && data.other.status != data.other.statusObj.edit) || data.other.status == data.other.statusObj.query}}',
label: '{{$getVisibleName(data.form.assetPropertyId) ? "已计提期数" : "已摊销期数"}}',
children: [{
name: 'hasDeprMonths',
component: 'Input.Number',
maxlength: '4',
//value: '{{data.form.initDeprMonths ?Number(data.form.hasDeprMonths)+Number(data.form.initDeprMonths) : data.form.hasDeprMonths}}',
value: '{{$geHasDeprMonths(data.form)}}',
disabled: true,
onChange: "{{function(e){$fieldChange('data.form.hasDeprMonths',e)}}}"
}]
}, {
name: 'accuDepreciation',
component: 'Form.Item',
_visible: '{{(data.other.status != data.other.statusObj.new && data.other.status != data.other.statusObj.edit) || data.other.status == data.other.statusObj.query}}',
label: '{{$getVisibleName(data.form.assetPropertyId) ? "累计折旧" : "累计摊销"}}',
children: [{
name: 'accuDepreciation',
component: 'Input.Number',
className: 'right-item',
precision: 2,
disabled: true,
//value: '{{data.form.accuDepreciation}}',
value: '{{$getaccuDepreciation(data.form)}}',
}]
}, {
name: 'netValue',
component: 'Form.Item',
label: '净值',
_visible: '{{(data.other.status != data.other.statusObj.new && data.other.status != data.other.statusObj.edit) || data.other.status == data.other.statusObj.query}}',
children: [{
name: 'netValue',
component: 'Input.Number',
className: 'right-item',
precision: 2,
disabled: true,
value: '{{$getNetValue()}}',
//value: '{{(data.form.origValue != undefined && data.form.accuDepreciation != undefined)' +
//' ? (data.form.origValue-data.form.accuDepreciation).toFixed(2) : 0}}',
}]
}]
}, {
name: 'title',
component: '::div',
className: 'app-asset-card-more',
children: [{
name: 'more',
component: '::span',
className: 'app-asset-card-more-ico',
children: [{
name: 'left',
component: '::span',
children: '更多'
}, {
name: 'icon',
component: 'Icon',
className: 'operation',
showStyle: 'showy',
fontFamily: 'edficon',
type: '{{data.other.moreInfo ? "shang" : "xia"}}',
style: {
fontSize: 26
},
}],
onClick: '{{$moreClick}}'
}]
}, {
name: 'more',
component: '::div',
_visible: '{{data.other.moreInfo}}',
className: 'app-asset-card-item more-last-item',
children: [{
name: 'addType',
component: 'Form.Item',
label: '增加方式',
children: [{
name: 'addType',
component: 'Select',
showSearch: false,
allowClear: true,
dropdownClassName: 'add-type',
disabled: '{{(data.other.status == data.other.statusObj.query) || !data.other.assetCardIsEnable}}',
value: '{{data.form.addType && data.form.addType.id}}',
onChange: `{{function(v){$fieldChange('data.form.addType',data.other.assetAddType.filter(function(o){return o.id == v})[0])}}}`,
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.other.assetAddType && data.other.assetAddType[_rowIndex].id }}',
children: '{{data.other.assetAddType && data.other.assetAddType[_rowIndex].name }}',
_power: 'for in data.other.assetAddType'
}
}]
}, {
name: 'quantity',
component: 'Form.Item',
label: '资产数量',
children: [{
name: 'quantity',
component: 'Input.Number',
precision: 2,
regex: '^[0-9]+$',
disabled: '{{(data.other.status == data.other.statusObj.query) || !data.other.assetCardIsEnable}}',
value: '{{data.form.quantity}}',
onBlur: "{{function(e){$getQuantity('data.form.quantity',e)}}}",
}]
}, {
name: 'unit',
component: 'Form.Item',
label: '计量单位',
children: [{
name: 'unit',
component: 'Select',
showSearch: false,
allowClear: true,
disabled: '{{(data.other.status == data.other.statusObj.query) || !data.other.assetCardIsEnable}}',
value: '{{data.form.unit && data.form.unit.id}}',
onChange: `{{function(v){$fieldChange('data.form.unit',data.other.unit.filter(function(o){return o.id == v})[0])}}}`,
onFocus: "{{ function(){$onFieldFocus('unit')} }}",
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.other.unit && data.other.unit[_rowIndex].id }}',
children: '{{data.other.unit && data.other.unit[_rowIndex].name }}',
_power: 'for in data.other.unit'
},
dropdownFooter: {
name: 'add',
type: 'primary',
component: 'Button',
style: { width: '100%', borderRadius: '0' },
children: '新增',
onClick: '{{function(){$addUnitProject("app-card-unit", "unit", "计量单位")}}}'
},
}]
}, {
name: 'department',
component: 'Form.Item',
label: '使用部门',
children: [{
name: 'project',
component: 'Select',
showSearch: false,
allowClear: true,
disabled: '{{(data.other.status == data.other.statusObj.query) || !data.other.assetCardIsEnable}}',
value: '{{data.form.department && data.form.department.name}}',
onChange: `{{function(v){$fieldChange('data.form.department',data.other.department.filter(function(o){return o.id == v})[0])}}}`,
onFocus: "{{function(){$onFieldFocus('department')} }}",
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.other.department && data.other.department[_rowIndex].id }}',
children: '{{data.other.department && data.other.department[_rowIndex].name }}',
_power: 'for in data.other.department'
},
dropdownFooter: {
name: 'add',
type: 'primary',
component: 'Button',
style: { width: '100%', borderRadius: '0' },
children: '新增',
onClick: '{{function(){$addUnitProject("app-card-department", "department", "部门")}}}'
},
}]
}/*, {
name: 'invoiceType',
component: 'Form.Item',
label: '票据类型',
children: [{
name: 'invoiceType',
component: 'Select',
value: '{{data.form.invoiceType && data.form.invoiceType.name}}',
onChange: `{{function(v){$fieldChange('data.form.invoiceType',data.other.invoiceType[v.split(",")[1]])}}}`,
children: {
name: 'option',
component: 'Select.Option',
children: '{{data.other.invoiceType && data.other.invoiceType[_rowIndex].name }}',
_power: 'for in data.other.invoiceType'
}
}]
}*/, {
name: 'inputTaxRate',
component: 'Form.Item',
label: '进项税率',
//className: 'tax',
children: [{
name: 'inputTaxRate',
component: 'Select',
showSearch: false,
//allowClear: true,
disabled: '{{(data.other.status == data.other.statusObj.query) || !data.other.assetCardIsEnable}}',
value: '{{data.form.inputTaxRate && data.form.inputTaxRate.id}}',
onChange: `{{function(v){$fieldChange('data.form.inputTaxRate',data.other.taxRate.filter(function(o){return o.id == v})[0]); $getTax("inputTaxRate", data.other.taxRate.filter(function(o){return o.id == v})[0])}}}`,
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.other.taxRate && data.other.taxRate[_rowIndex].id }}',
children: '{{data.other.taxRate && data.other.taxRate[_rowIndex].name }}',
_power: 'for in data.other.taxRate'
}
}]
}, {
name: 'inputTax',
component: 'Form.Item',
label: '进项税额',
children: [{
name: 'inputTax',
component: 'Input.Number',
className: 'right-item',
precision: 2,
//disabled: '{{data.other.status == data.other.statusObj.query}}',
disabled: true,
value: '{{$addThousandsPosition(data.form.inputTax ? data.form.inputTax : "")}}',
}]
}/*, {
name: 'isRent',
component: 'Form.Item',
label: '对外出租否',
children: [{
name: 'select',
component: 'Checkbox',
checked: '{{data.form.isRent}}',
onChange: "{{function(e){$fieldChange('data.form.isRent', e.target.checked)}}}"
}]
}*/, {
name: 'project',
component: 'Form.Item',
label: '核算项目',
children: [{
name: 'project',
component: 'Select',
showSearch: false,
allowClear: true,
disabled: '{{(data.other.status == data.other.statusObj.query) || !data.other.assetCardIsEnable}}',
value: '{{data.form.project && data.form.project.id}}',
onChange: `{{function(v){$fieldChange('data.form.project',data.other.project.filter(function(o){return o.id == v})[0])}}}`,
onFocus: "{{function(){$onFieldFocus('project')} }}",
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.other.project && data.other.project[_rowIndex].id }}',
children: '{{data.other.project && data.other.project[_rowIndex].name }}',
_power: 'for in data.other.project'
},
dropdownFooter: {
name: 'add',
component: 'Button',
type: 'primary',
style: { width: '100%', borderRadius: '0' },
children: '新增',
onClick: '{{function(){$addUnitProject("app-card-project", "project", "项目")}}}'
},
}]
}, {
name: 'memo',
component: 'Form.Item',
label: '备注',
className: 'memo',
validateStatus: "{{data.other.error.memo?(data.other.memoTip? 'success':'error'):'success'}}",
help: '{{!data.other.memoTip ? data.other.error.memo : ""}}',
children: [{
name: 'memo',
component: 'Input',
//maxlength: 200,
disabled: '{{(data.other.status == data.other.statusObj.query) || !data.other.assetCardIsEnable}}',
value: '{{data.form.memo}}',
onChange: "{{function(e){$fieldChange('data.form.memo',e.target.value)}; $memoChange()}}"
}]
}]
}]
}, {
name: 'footer',
component: '::div',
className: 'app-asset-card-footer',
children: [{
name: 'btnGroup',
component: '::div',
className: 'app-asset-card-footer-btnGroup',
children: [{
name: 'cancel',
component: 'Button',
className: 'app-asset-card-footer-btnGroup-item',
children: '取消',
onClick: '{{$onCancel}}'
}, {
name: 'confirm',
component: 'Button',
className: 'app-asset-card-footer-btnGroup-item',
type: '{{data.other.status == data.other.statusObj.new ? "Default" : "primary"}}',
children: '{{data.other.status == data.other.statusObj.new ? "保存" : "确定"}}',
onClick: "{{function(e){$onSave('save')}}}"
}, {
name: 'saveAndNew',
component: 'Button',
_visible: '{{data.other.status == data.other.statusObj.new}}',
className: 'app-asset-card-footer-btnGroup-item',
type: 'primary',
children: '保存并新增',
onClick: "{{function(e){$onSave('saveAndNew')}}}"
}]
}]
}, {
name: 'stepTips',
component: 'Tour',
run: "{{data.other.stepEnabled}}",
locale: { back: '上一步', close: '关 闭', last: '完 成', next: '下一步', skip: '忽 略' },
scrollToFirstStep: true,
disableCloseOnEsc: true,
disableOverlayClose: true,
continuous: true,
showProgress: false,
showSkipButton: true,
callback: "{{$onExit}}",
steps: [{
target: '.topnavi',
content: ['我们支持多种', {
name: 'span',
component: '::span',
className: 'ttk-rc-intro-style',
children: '资产类型'
}, '的卡片录入'],
placement: 'bottom',
disableBeacon: true,
// tooltipClass: 'myTooltipClass',
// highlightClass: 'myHighlightClass',
}, {
target: '.beginStartUseDate',
content: [{
name: 'span',
component: '::span',
className: 'ttk-rc-intro-style',
children: '开始日期'
}, '为以前会计期间时,需要您录入及确认期初数据'],
placement: 'right',
disableBeacon: true,
}, {
target: '.app-asset-card-more-ico',
content: [{
name: 'span',
component: '::span',
className: 'ttk-rc-intro-style',
children: '【更多】'
}, '点开后,有资产其他的相关信息,您可以自行选择录入'],
placement: 'top',
disableBeacon: true,
}
]
}]
}
}
export function getInitState() {
return {
data: {
form: {
deprMonth: '',
quantity: 1,
assetPropertyId: '5100010001',
buyDate: moment().format('YYYY-MM-DD'),
changeDate: moment().format('YYYY-MM-DD'),
isHasInit: false,
salvageRate: 5,
},
systemDate: '',
other: {
error: {},
assetProperty: [{
id: 5100010001,
name: '固定资产'
}, {
id: 5100010002,
name: '无形资产'
}, {
id: 5100010003,
name: '长期待摊费用'
}],
moreInfo: false,
status: 'new',
statusObj: { new: 'new', edit: 'edit', change: 'change', query: 'query' },
ok: true,
assetCardIsEnable: true, //卡片可用不可用
loading: false,
isLineDepreciation: true, //是否显示月折旧额
isDisableLineDepreciation: true, //月折旧额是否置灰
isDisableHasInit: true, //是否有原始期初值置灰情况
useDateBefore: false, //开始使用日期是否是之前月份
disableBeginDeprPeriod: false, //开始折旧月份是否置灰
initDepr: false, //期初折旧期数和期初已折旧是否置灰
currentDate: '',
lineDepreciation: 0, //月折旧额
longLoading: false,
adding: false,
isSaveAndNew: false,
stepEnabled: false
},
consts: {}
}
}
}