ttk-app-core
Version:
enterprise develop framework
534 lines (531 loc) • 33.9 kB
JavaScript
import {consts} from 'edf-consts'
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'ttk-gl-app-financeinit-uploaddata',
children: [
{
name:'content',
component:'::div',
className:'ttk-gl-app-financeinit-uploaddata-body',
children: [
{
name:'content1',
component:'::div',
className:'ttk-gl-app-financeinit-uploaddata-body-content',
children: [
{
name:'header',
component:'Form',
className:'ttk-gl-app-financeinit-uploaddata-body-content-header',
children: [
{
name:'item',
component:'Form.Item',
label:'企业名称',
// value:'dazhong',
children:{
name:'title',
component:'::span',
children:'{{data.form.name}}'
}
},
{
name:'item',
component:'Form.Item',
label:'纳税人身份',
className: 'ttk-gl-app-financeinit-uploaddata-body-content-header-vatTaxpayer',
// required: true,
// help: '{{data.other.error.code}}',
// validateStatus: "{{data.other.error.code?'error':'success'}}",
children:[{
name: 'vatTaxpayer',
component: 'Select',
_visible:'{{data.other.isEdit?true:false}}',
disabled: '{{!data.other.modifyStatus}}',
getPopupContainer: '{{function(){return document.querySelector(".ttk-gl-app-financeinit-uploaddata-body-content-header-vatTaxpayer")}}}',
showSearch: false,
value: '{{data.form.vatTaxpayer=="2000010001"?"一般纳税人":"小规模纳税人"}}',
onChange: "{{function(e){$setField('data.form.vatTaxpayer',e)}}}",
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.form.vatTaxpayerEnum[_rowIndex].id}}',
children: '{{data.form.vatTaxpayerEnum[_rowIndex].name}}',
_power: 'for in data.form.vatTaxpayerEnum',
}
},
{
name:'vatTaxpayer',
component:'::div',
_visible:'{{data.other.isEdit?false:true}}',
children:'{{data.form.vatTaxpayer=="2000010001"?"一般纳税人":"小规模纳税人"}}'
}
]
},
{
name:'item',
component:'Form.Item',
label:'启用期间',
// required: true,
// help: '{{data.other.error.code}}',
// validateStatus: "{{data.other.error.code?'error':'success'}}",
children:[{
name:'monthPicker',
component:'DatePicker.MonthPicker',
// monthCellContentRender: '{{$monthCellCustom}}',
value: '{{$stringToMoment(data.form.periodDate)}}',
_visible:'{{data.other.isEdit?true:false}}',
// disabledDate: `{{function(current){ var disabledDate = new Date(data.other.disabledDate)
// return current && current.valueOf() < disabledDate
// }}}`,
onChange: `{{function(d){$setField('data.form.periodDate', $momentToString(d,'YYYY-MM'))}}}`,
},
{
name:'periodDate',
component:'::div',
_visible:'{{data.other.isEdit?false:true}}',
children:'{{data.form.periodDate}}'
}
]
},
{
name:'item',
component:'Form.Item',
label:'会计准则',
className: 'ttk-gl-app-financeinit-uploaddata-body-content-header-accountingStandards',
// required: true,
// help: '{{data.other.error.code}}',
// validateStatus: "{{data.other.error.code?'error':'success'}}",
children:[{
name: 'select',
component: 'Select',
disabled: '{{!data.other.modifyStatus}}',
getPopupContainer: '{{function(){return document.querySelector(".ttk-gl-app-financeinit-uploaddata-body-content-header-accountingStandards")}}}',
showSearch: false,
_visible:'{{data.other.isEdit?true:false}}',
value: '{{data.form.accountingStandards=="2000020001"?"企业会计准则":"小企业会计准则"}}',
onChange: "{{function(e){$setField('data.form.accountingStandards',e)}}}",
children: {
name: 'option',
component: 'Select.Option',
value: '{{data.form.accountingStandardsEnum[_rowIndex].id}}',
children: '{{data.form.accountingStandardsEnum[_rowIndex].name}}',
_power: 'for in data.form.accountingStandardsEnum',
}
},
{
name:'accountingStandards',
component:'::div',
_visible:'{{data.other.isEdit?false:true}}',
children:'{{data.form.accountingStandards=="2000020001"?"企业会计准则":"小企业会计准则"}}'
}
]
},
{
name: 'icon',
component: 'Icon',
type: 'bianji',
fontFamily: 'edficon',
className: 'itemIcon',
_visible:'{{data.other.isEdit?false:true}}',
onClick:'{{function(){$edit()}}}'
},
{
name:'btn',
component:'Button',
children:'完成',
className:'saveBtn',
_visible:'{{data.other.isEdit?true:false}}',
onClick:'{{function(){$editSave()}}}'
}
]
},
{
name:'body',
component:'::div',
className:'ttk-gl-app-financeinit-uploaddata-body-content-middle',
children:[
{
name:'item',
component:'::div',
className:'ttk-gl-app-financeinit-uploaddata-body-content-middle-item',
children: {
name:'container',
component:'::div',
className:'itemContainer',
children:[
{
name: 'div1',
component: 'Form.Item',
className:'formItem',
children: [
{
name:'sel',
component:'Select',
className:'itemSelect',
placeholder:'下拉选取财务软件',
dropdownClassName:'ttk-gl-app-financeinit-uploaddata-select',
value:'{{data.form.templateType}}',
onChange:'{{function(e){$fiSoftChange("data.form.templateType",e)}}}',
children: {
name:'option',
component:'Select.Option',
value: '{{data.form.templateData[_rowIndex].key}}',
children: '{{data.form.templateData[_rowIndex].name}}',
_power: 'for in data.form.templateData',
}
},{
name: 'div2',
component: '::div',
_visible: '{{data.downloadTempShow}}',
style:{fontSize:'12px',height:'18px',lineHeight:'18px',textAlign:'right'},
children: [{
name: 'span1',
component: '::span',
children: '请'
},{
name: 'span2',
component: '::span',
children:'下载模板' ,
onClick: '{{$leadInTemplate}}',
className:'leadInModle'
},{
name: 'span3',
component: '::span',
children: ',填好数据后导入',
}]
}
]
},
{
name: 'div2',
component: 'Form.Item',
className:'formItem',
children: [
{
name: 'sub',
component: 'Input',
style:{ width: '191px',marginRight:'5px' },
placeholder:'上传excel文件',
disabled: '{{data.other.disabled}}',
value:'{{data.fileName}}',
readonly: 'readonly',
title: '{{data.fileName}}'
},
{
name: 'upload',
component: 'Upload',
beforeUpload: '{{$beforeLoad}}',
children: [{
name: 'openingBankItem',
className:'uploadFile',
component: 'Button',
disabled: '{{data.other.disabled}}',
children: '{{data.file ? "重选文件" :"选择文件"}}'
}],
onChange: '{{$handleOnChange}}',
showUploadList: false,
action: '/v1/edf/file/upload',
headers: '{{$getAccessToken()}}',
accept:'.xls, .xlsx'
}
]
},
{
name:'tip',
component:'::div',
className:'text',
children:'支持下方3种初始化方式'
}
]
}
},
{
name:'item',
component:'::div',
className:'ttk-gl-app-financeinit-uploaddata-body-content-middle-item',
children: [
{
name: 'itemContainer',
component: '::div',
_visible: '{{ data.other.checkedResult ? false : true}}',
className: 'itemContainer',
children: [
{
name: 'nodata',
className: 'img',
component: '::img',
src: '{{$getNoDataPic()}}'
},{
name: 'nodata',
component: '::div',
className: 'fileText',
children: '上传反馈信息'
}
]
},{
name: 'checkedResult',
component: '::div',
className: 'checkedResult',
_visible: '{{ data.other.checkedResult ? true : false}}',
children: [
{
name: 'checkedItem',
component: '::div',
className: 'checkedResult-checkedItem',
children: [
{
name: 'icon',
component: 'Icon',
type: 'chenggongtishi',
fontFamily: 'edficon',
className: 'checkedResult-checkedItem-icon'
},{
name: 'templateType',
component: '::div',
className: 'checkedResult-checkedItem-content',
children: '{{ $getCheckedResultContent("excelType", data.other.checkedResult ? data.other.checkedResult.excelType : undefined) }}'
}
]
},{
name: 'checkedItem',
component: '::div',
className: 'checkedResult-checkedItem',
children: [
{
name: 'icon',
component: 'Icon',
type: '{{ data.other.checkedResult && data.other.checkedResult.checkTaxpayer == 0 ? "jinggao" : "chenggongtishi" }}',
fontFamily: 'edficon',
className: '{{ data.other.checkedResult && data.other.checkedResult.checkTaxpayer == 0 ? "checkedResult-checkedItem-icon-jinggao" : "checkedResult-checkedItem-icon" }}'
},{
name: 'templateType',
component: '::div',
className: 'checkedResult-checkedItem-content',
children: '{{ $getCheckedResultContent("checkTaxpayer", data.other.checkedResult ? data.other.checkedResult.checkTaxpayer : undefined) }}'
}
]
},{
name: 'checkedItem',
component: '::div',
className: 'checkedResult-checkedItem',
children: [
{
name: 'icon',
component: 'Icon',
type: '{{ data.other.checkedResult && data.other.checkedResult.accountStandard == -1 ? "jinggao" : "chenggongtishi" }}',
fontFamily: 'edficon',
className: '{{ data.other.checkedResult && data.other.checkedResult.accountStandard == -1 ? "checkedResult-checkedItem-icon-jinggao" : "checkedResult-checkedItem-icon" }}'
},{
name: 'templateType',
component: '::div',
className: 'checkedResult-checkedItem-content',
children: '{{ $getCheckedResultContent("accountStandard", data.other.checkedResult ? data.other.checkedResult.accountStandard : undefined) }}'
}
]
},{
name: 'checkedItem',
component: '::div',
className: 'checkedResult-checkedItem',
children: [
{
name: 'icon',
component: 'Icon',
type: '{{ data.other.checkedResult && data.other.checkedResult.checkExistDataInExcel == "导入余额表内无数据" ? "cuowutishi" : "chenggongtishi" }}',
fontFamily: 'edficon',
className: '{{ data.other.checkedResult && data.other.checkedResult.checkExistDataInExcel == "导入余额表内无数据" ? "checkedResult-checkedItem-icon-cuowutishi" : "checkedResult-checkedItem-icon" }}'
},{
name: 'templateType',
component: '::div',
className: 'checkedResult-checkedItem-content',
children: '{{ $getCheckedResultContent("checkExistDataInExcel", data.other.checkedResult ? data.other.checkedResult.checkExistDataInExcel : undefined) }}'
}
]
},{
name: 'checkedItem',
component: '::div',
className: 'checkedResult-checkedItem',
children: [
{
name: 'icon',
component: 'Icon',
type: '{{ data.other.checkedResult && data.other.checkedResult.checkSameCodeOrName.length > 0 ? "cuowutishi" : "chenggongtishi" }}',
fontFamily: 'edficon',
className: '{{ data.other.checkedResult && data.other.checkedResult.checkSameCodeOrName.length > 0 ? "checkedResult-checkedItem-icon-cuowutishi" : "checkedResult-checkedItem-icon" }}'
},{
name: 'templateType',
component: '::div',
className: 'checkedResult-checkedItem-content',
children: '{{ $getCheckedResultContent("checkSameCodeOrName", data.other.checkedResult ? data.other.checkedResult.checkSameCodeOrName : undefined) }}'
}
]
},{
name: 'checkedItem',
component: '::div',
className: 'checkedResult-checkedItem',
children: [
{
name: 'icon',
component: 'Icon',
type: '{{ data.other.checkedResult && data.other.checkedResult.checkDataFormat.length > 0 ? "cuowutishi" : "chenggongtishi" }}',
fontFamily: 'edficon',
className: '{{ data.other.checkedResult && data.other.checkedResult.checkDataFormat.length > 0 ? "checkedResult-checkedItem-icon-cuowutishi" : "checkedResult-checkedItem-icon" }}'
},{
name: 'templateType',
component: '::div',
className: 'checkedResult-checkedItem-content',
children: '{{ $getCheckedResultContent("checkDataFormat", data.other.checkedResult ? data.other.checkedResult.checkDataFormat : undefined) }}'
}
]
}
]
}
]
}
]
},
]
},
{
name:'content2',
component:'::div',
className:'ttk-gl-app-financeinit-uploaddata-body-tips',
children:[
{
name:'title',
component:'::div',
className:'title',
children:'初始化方式:'
},
{
name:'sub',
component:'::div',
className:'uploadTip',
children:[
{
name: 't1',
component: '::div',
className:'tipItem',
children: [
{
name: 't1icon',
component: 'Icon',
fontFamily: 'edficon',
type: 'dian'
},{
name:'item1',
component:'::div',
className:'tipItem',
children:'导入原账套科目余额表,生成期初科目余额。支持用友T3、T+、好会计、精斗云、KIS'
}
]
},{
name:'item3',
component:'::div',
className:'tipItem',
children:[
{
name: 't1',
component: '::div',
children: [
{
name: 't1icon',
component: 'Icon',
fontFamily: 'edficon',
type: 'dian'
},{
name:'text1',
component:'::span',
children:'模板导入,'
}
]
},{
name:'text2',
component:'::a',
children:'下载模板' ,
onClick: '{{$leadInTemplate}}'
},
{
name:'text3',
component:'::span',
children:'后,在excel内编辑数据完成后,直接导入表格,生成期初科目余额完成初始化。'
}
]
},{
name:'item2',
component:'::div',
className:'tipItem',
children: [
{
name: 't1',
component: '::div',
children: [
{
name: 't1icon',
component: 'Icon',
fontFamily: 'edficon',
type: 'dian'
},{
name:'text1',
component:'::span',
children:'发生科目较少时,您可以选择在科目期初页面'
}
]
},{
name:'text2',
component:'::a',
children:'手工录入',
onClick:'{{function(){$handwork()}}}'
},
{
name:'text3',
component:'::span',
children:'完成初始化'
}
]
}
]
}
]
}
]
},{
name:'btn',
component:'::div',
className:'ttk-gl-app-financeinit-uploaddata-footer',
children: {
component: 'Button',
children: '下一步',
type: '{{data.other.nextStepBtnType}}',
disabled: '{{data.other.isCanNotToNextStep}}',
onClick: '{{$nextStep}}'
}
}]
}
}
export function getInitState() {
return {
data: {
form: {
periodDate: '',
taxpayer:'',
vatTaxpayer:'',
vatTaxpayerEnum:[],
accountingStandardsEnum:[],
templateType:'',
templateData:[{name:'T3',key:1},{name:'T+',key:2},{name:'好会计',key:3},{name:'精斗云',key:4},{name:'Kis',key:5},{name:'标准模板',key:0}]
},
other: {
disabled: true,
isEdit: false,
isUploaded: false,
isCanNotToNextStep: true,
nextStepBtnType: ''
},
file:'',
downloadTempShow: false
}
}
}