ttk-app-core
Version:
enterprise develop framework
184 lines (174 loc) • 6.48 kB
JavaScript
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'ttk-taxapply-app-taxlist',
children: [{
name: 'header',
component: '::div',
className: 'ttk-taxapply-app-taxlist-header',
children: [{
name: 'rpttype',
component: '::div',
className: 'ttk-taxapply-app-taxlist-header-left',
children: ['申报月份:', {
name: 'date',
component: 'DatePicker.MonthPicker',
allowClear: false,
placeholder: '请选择月份',
value: '{{$stringToMoment(data.form.date)}}',
onChange: `{{function(d){$sf('data.form.date',$momentToString(d,'YYYY-MM-DD'));
$onMonthChange(_ctrlPath, data.form.date, $momentToString(d,'YYYY-MM-DD'))}}}`,
disabledDate: `{{function(current){ var disabledDate = new Date(data.other.disabledDate)
return current && (current.valueOf() < disabledDate )
}}}`
},{
name: 'declareTax',
component: 'Button',
className: 'ttk-taxapply-app-taxlist-header-right-refresh',
children: '刷新',
onClick: '{{function(){$load(true, false)}}}'
}]
}, {
className: 'ttk-taxapply-app-taxlist-header-right',
component: '::div',
children: [{
component: '::div',
children: [{
name: 'declareTax',
component: 'Button',
className: 'ttk-taxapply-app-taxlist-header-right-declaretaxbtn',
children: '申报',
onClick: '{{$declareTaxClick}}'
}, {
name: 'cutPayment',
component: 'Button',
className: 'ttk-taxapply-app-taxlist-header-right-cutpayment',
children: '税款缴纳',
onClick: '{{$taxMoneyPayClick}}'
}]
}]
}]
}, {
id: 'taxListId',
name: 'content',
className: 'ttk-taxapply-app-taxlist-content',
component: 'Table',
pagination: false,
checkboxKey: 'id',
allowColResize: false,
enableSequenceColumn: false,
dataSource: '{{data.list}}',
rowSelection: '{{$rowSelection()}}',
checkboxChange: '{{$checkboxChange}}',
checkboxValue: '{{data.tableCheckbox.checkboxValue}}',
bordered: true,
columns: [{
title: '申报项目',
dataIndex: 'taxProjectName',
width: '24%',
key: 'taxProjectName',
render: "{{function(text, record, index){return $renderDeclareItem(text, record, index)} }}"
}, {
title: '应纳税额',
dataIndex: 'taxAmount',
width: '11%',
key: 'taxAmount'
}, {
title: '所属期起',
dataIndex: 'fromDate',
width: '8%',
key: 'fromDate'
}, {
title: '所属期止',
dataIndex: 'toDate',
width: '8%',
key: 'toDate'
}, {
title: '申报期限',
dataIndex: 'endDate',
width: '8%',
key: 'endDate'
}, {
title: '申报日期',
dataIndex: 'voucherDate',
width: '8%',
key: 'voucherDate'
}, {
title: '申报状态',
dataIndex: 'stateName',
width: '10%',
key: 'stateName',
render: "{{function(text, record, index){return $renderStatus(text, record, index)} }}"
}, {
title: '缴款状态',
dataIndex: 'payStateName',
width: '10%',
key: 'payStateName',
render: "{{function(text, record, index){return $renderChargeBackStatus(text, record, index)} }}"
}, {
title: '操作',
dataIndex: 'col9',
align: 'center',
key: 'col9',
width: '13%',
render: "{{function(text, record, index){return $operateCol(text, record, index)} }}"
}]
}]
}
}
export function getInitState(periodDate) {
return {
data: {
form: {
date: periodDate
},
tableKey: 1000,
tableOption: {
x: 900,
// y: 300
},
list: [],
current: {
dateType: 'season',
selectTimeTitle: "2018年第1季度"
},
other: {
loading: false,
editStatus: false
},
tableCheckbox: {
checkboxValue: [],
selectedOption: []
},
}
}
}
export function getLastMonth(year, month){
var nowdate = new Date(year + '-' + month + '-01')
if(month==1){
year = nowdate.getFullYear()-1;
month = 12;
} else {
month = month -1
}
month = month.toString().padStart(2, '0')
//上个月的第一天
var firstDay = year + "-" + month + "-" + "01";
var myDate = new Date(year, month, 0);
//上个月的最后一天
var lastDay = year + "-" + month + "-" + myDate.getDate();
//申报期限
var declareMonth, declareYear
if (month == 12) {
declareYear = year + 1
declareMonth = 1
} else {
declareYear = year
declareMonth = (parseInt(month) + 1).toString().padStart(2, '0')
}
var declareTime = declareYear + "-" + declareMonth + "-15"
return { firstDay, lastDay, declareTime }
}
export const PROJECT_TYPE_TAX = 0 // 税务报表
export const PROJECT_TYPE_FINANCE = 1 // 财务报表