Commit b39f07d4 authored by gary's avatar gary

1、剩余5个表的excel导出

2、organization_accounting_rate添加source字段
parent c1ab40d8
......@@ -11,6 +11,7 @@ public class ErrorMessage {
public static final String NoSelectSheet = "NoSelectSheet";
public static final String DIDNOTSELECTPERIOD = "You should select period!";
public static final String ImportFailed = "ImportFailed!";
public static final String ExportFailed = "ExportFailed!";
......
package pwc.taxtech.atms.constant;
/**
* @Auther: Gary J Li
* @Date: 27/02/2019 20:47
* @Description:
*/
public final class ExportTemplatePathConstant {
public static final String INVOICES_RECORD = "/vat_excel_template/invoice_record.xlsx";
public static final String CASH_FLOW = "/vat_excel_template/cash_flow.xlsx";
public static final String CERTIFIED_INVOICES_LIST = "/vat_excel_template/certified_invoices_list.xlsx";
public static final String RED_LETTER_INFO_TAB = "/vat_excel_template/red_letter_info_tab.xlsx";
public static final String COUPA_PURCHASING_REPORT = "/vat_excel_template/coupa_purchasing_report.xlsx";
public static final String INVOICE_DATA = "/vat_excel_template/invoice_data.xlsx";
}
......@@ -187,4 +187,42 @@ public class DataPreviewController extends BaseController {
logger.error(String.format("下载科目余额表-生成文件异常:%s",e.getMessage()));
}
}
@RequestMapping(value = "exportIRData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadIRQueryData(@RequestBody InvoiceRecordParam param, HttpServletResponse response) {
logger.debug("enter downloadIRQueryData");
String fileName="testFile";
dataPreviewSerivceImpl.exportInvoiceRecordList(response, param, fileName);
}
@RequestMapping(value = "exportCILData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadCILQueryData(@RequestBody CertifiedInvoicesListParam param, HttpServletResponse response) {
logger.debug("enter downloadCILQueryData");
String fileName="testFile";
dataPreviewSerivceImpl.exportCILList(response, param, fileName);
}
@RequestMapping(value = "exportRLITData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadRLITQueryData(@RequestBody RedLetterInfoTableParam param, HttpServletResponse response) {
logger.debug("enter downloadRLITQueryData");
String fileName="testFile";
dataPreviewSerivceImpl.exportRLITList(response, param, fileName);
}
@RequestMapping(value = "exportCPRData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadCPRQueryData(@RequestBody CoupaPurchasingReportParam param, HttpServletResponse response) {
logger.debug("enter downloadCPRQueryData");
String fileName="testFile";
dataPreviewSerivceImpl.exportCPRList(response, param, fileName);
}
@RequestMapping(value = "exportIDData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadIDQueryData(@RequestBody InvoiceDataParam param, HttpServletResponse response) {
logger.debug("enter downloadIDQueryData");
String fileName="testFile";
dataPreviewSerivceImpl.exportIDList(response, param, fileName);
}
}
......@@ -48,6 +48,17 @@ public class OrganizationAccountingRateDto implements Serializable {
*/
private Integer period;
/**
* Database Column Remarks:
* 来源
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.source
*
* @mbg.generated
*/
private String source;
/**
* Database Column Remarks:
* 汇率类型
......@@ -216,6 +227,30 @@ public class OrganizationAccountingRateDto implements Serializable {
this.period = period;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.source
*
* @return the value of organization_accounting_rate.source
*
* @mbg.generated
*/
public String getSource() {
return source;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization_accounting_rate.source
*
* @param source the value for organization_accounting_rate.source
*
* @mbg.generated
*/
public void setSource(String source) {
this.source = source == null ? null : source.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.convertion_type
......@@ -423,6 +458,7 @@ public class OrganizationAccountingRateDto implements Serializable {
sb.append(", id=").append(id);
sb.append(", organizationId=").append(organizationId);
sb.append(", period=").append(period);
sb.append(", source=").append(source);
sb.append(", convertionType=").append(convertionType);
sb.append(", currencyFrom=").append(currencyFrom);
sb.append(", currencyTo=").append(currencyTo);
......
package pwc.taxtech.atms.dto.vatdto.excelheader;
public class CertifiedInvoicesListHeader {
private String taxPayerNumber;
private Integer period;
private String unit;
public String getTaxPayerNumber() {
return taxPayerNumber;
}
public void setTaxPayerNumber(String taxPayerNumber) {
this.taxPayerNumber = taxPayerNumber;
}
public Integer getPeriod() {
return period;
}
public void setPeriod(Integer period) {
this.period = period;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
}
......@@ -79,5 +79,33 @@ public class CommonDocumentHelper {
return os;
}
public OutputStream toXlsxFileUsingJxls(List<?> list, String excelTemplatePathInClassPath) {
//InputStream is = Streams.fileIn(excelTemplatePathInClassPath);
InputStream is = this.getClass().getResourceAsStream(excelTemplatePathInClassPath);
OutputStream os = new ByteArrayOutputStream();
Context context = new Context();
context.putVar("list", list);
context.putVar("REPORT_DATE", new Date());
JxlsHelper jxlsHelper = JxlsHelper.getInstance();
Transformer transformer = jxlsHelper.createTransformer(is, os);
JexlExpressionEvaluator evaluator = (JexlExpressionEvaluator) transformer.getTransformationConfig()
.getExpressionEvaluator();
// evaluator.getJexlEngine().setSilent(true); // 设置静默模式,不报警告
Map<String, Object> funcs = new HashMap<String, Object>();
funcs.put("myutils", new JxlsUtils());
evaluator.getJexlEngine().setFunctions(funcs);
// jxlsHelper.setUseFastFormulaProcessor(false); //与统计函数有关
try {
jxlsHelper.processTemplate(context, transformer);
} catch (IOException e) {
logger.error("error when calling processTemplate:" + e, e);
throw Lang.wrapThrow(e);
} finally {
Streams.safeClose(is);
Streams.safeClose(os);
}
return os;
}
}
......@@ -44,6 +44,17 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
*/
private Integer period;
/**
* Database Column Remarks:
* 来源
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.source
*
* @mbg.generated
*/
private String source;
/**
* Database Column Remarks:
* 汇率类型
......@@ -212,6 +223,30 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
this.period = period;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.source
*
* @return the value of organization_accounting_rate.source
*
* @mbg.generated
*/
public String getSource() {
return source;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization_accounting_rate.source
*
* @param source the value for organization_accounting_rate.source
*
* @mbg.generated
*/
public void setSource(String source) {
this.source = source == null ? null : source.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.convertion_type
......@@ -419,6 +454,7 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
sb.append(", id=").append(id);
sb.append(", organizationId=").append(organizationId);
sb.append(", period=").append(period);
sb.append(", source=").append(source);
sb.append(", convertionType=").append(convertionType);
sb.append(", currencyFrom=").append(currencyFrom);
sb.append(", currencyTo=").append(currencyTo);
......
......@@ -385,6 +385,76 @@ public class OrganizationAccountingRateExample {
return (Criteria) this;
}
public Criteria andSourceIsNull() {
addCriterion("source is null");
return (Criteria) this;
}
public Criteria andSourceIsNotNull() {
addCriterion("source is not null");
return (Criteria) this;
}
public Criteria andSourceEqualTo(String value) {
addCriterion("source =", value, "source");
return (Criteria) this;
}
public Criteria andSourceNotEqualTo(String value) {
addCriterion("source <>", value, "source");
return (Criteria) this;
}
public Criteria andSourceGreaterThan(String value) {
addCriterion("source >", value, "source");
return (Criteria) this;
}
public Criteria andSourceGreaterThanOrEqualTo(String value) {
addCriterion("source >=", value, "source");
return (Criteria) this;
}
public Criteria andSourceLessThan(String value) {
addCriterion("source <", value, "source");
return (Criteria) this;
}
public Criteria andSourceLessThanOrEqualTo(String value) {
addCriterion("source <=", value, "source");
return (Criteria) this;
}
public Criteria andSourceLike(String value) {
addCriterion("source like", value, "source");
return (Criteria) this;
}
public Criteria andSourceNotLike(String value) {
addCriterion("source not like", value, "source");
return (Criteria) this;
}
public Criteria andSourceIn(List<String> values) {
addCriterion("source in", values, "source");
return (Criteria) this;
}
public Criteria andSourceNotIn(List<String> values) {
addCriterion("source not in", values, "source");
return (Criteria) this;
}
public Criteria andSourceBetween(String value1, String value2) {
addCriterion("source between", value1, value2, "source");
return (Criteria) this;
}
public Criteria andSourceNotBetween(String value1, String value2) {
addCriterion("source not between", value1, value2, "source");
return (Criteria) this;
}
public Criteria andConvertionTypeIsNull() {
addCriterion("convertion_type is null");
return (Criteria) this;
......
......@@ -9,6 +9,7 @@
<id column="id" jdbcType="BIGINT" property="id" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
<result column="period" jdbcType="INTEGER" property="period" />
<result column="source" jdbcType="VARCHAR" property="source" />
<result column="convertion_type" jdbcType="VARCHAR" property="convertionType" />
<result column="currency_from" jdbcType="VARCHAR" property="currencyFrom" />
<result column="currency_to" jdbcType="VARCHAR" property="currencyTo" />
......@@ -89,8 +90,8 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, organization_id, period, convertion_type, currency_from, currency_to, start_date,
end_date, rate, create_time, update_time
id, organization_id, period, source, convertion_type, currency_from, currency_to,
start_date, end_date, rate, create_time, update_time
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.OrganizationAccountingRateExample" resultMap="BaseResultMap">
<!--
......@@ -144,13 +145,15 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into organization_accounting_rate (id, organization_id, period,
convertion_type, currency_from, currency_to,
start_date, end_date, rate,
create_time, update_time)
source, convertion_type, currency_from,
currency_to, start_date, end_date,
rate, create_time, update_time
)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER},
#{convertionType,jdbcType=VARCHAR}, #{currencyFrom,jdbcType=VARCHAR}, #{currencyTo,jdbcType=VARCHAR},
#{startDate,jdbcType=TIMESTAMP}, #{endDate,jdbcType=TIMESTAMP}, #{rate,jdbcType=REAL},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
#{source,jdbcType=VARCHAR}, #{convertionType,jdbcType=VARCHAR}, #{currencyFrom,jdbcType=VARCHAR},
#{currencyTo,jdbcType=VARCHAR}, #{startDate,jdbcType=TIMESTAMP}, #{endDate,jdbcType=TIMESTAMP},
#{rate,jdbcType=REAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.OrganizationAccountingRate">
<!--
......@@ -168,6 +171,9 @@
<if test="period != null">
period,
</if>
<if test="source != null">
source,
</if>
<if test="convertionType != null">
convertion_type,
</if>
......@@ -203,6 +209,9 @@
<if test="period != null">
#{period,jdbcType=INTEGER},
</if>
<if test="source != null">
#{source,jdbcType=VARCHAR},
</if>
<if test="convertionType != null">
#{convertionType,jdbcType=VARCHAR},
</if>
......@@ -255,6 +264,9 @@
<if test="record.period != null">
period = #{record.period,jdbcType=INTEGER},
</if>
<if test="record.source != null">
source = #{record.source,jdbcType=VARCHAR},
</if>
<if test="record.convertionType != null">
convertion_type = #{record.convertionType,jdbcType=VARCHAR},
</if>
......@@ -293,6 +305,7 @@
set id = #{record.id,jdbcType=BIGINT},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
period = #{record.period,jdbcType=INTEGER},
source = #{record.source,jdbcType=VARCHAR},
convertion_type = #{record.convertionType,jdbcType=VARCHAR},
currency_from = #{record.currencyFrom,jdbcType=VARCHAR},
currency_to = #{record.currencyTo,jdbcType=VARCHAR},
......@@ -318,6 +331,9 @@
<if test="period != null">
period = #{period,jdbcType=INTEGER},
</if>
<if test="source != null">
source = #{source,jdbcType=VARCHAR},
</if>
<if test="convertionType != null">
convertion_type = #{convertionType,jdbcType=VARCHAR},
</if>
......@@ -353,6 +369,7 @@
update organization_accounting_rate
set organization_id = #{organizationId,jdbcType=VARCHAR},
period = #{period,jdbcType=INTEGER},
source = #{source,jdbcType=VARCHAR},
convertion_type = #{convertionType,jdbcType=VARCHAR},
currency_from = #{currencyFrom,jdbcType=VARCHAR},
currency_to = #{currencyTo,jdbcType=VARCHAR},
......
......@@ -1467,6 +1467,14 @@ constant.NationalEconomicIndustryList =[
constant.maxButtonTitleLength = 20;
constant.exportExcelFileName = {
invoicesRecord: "invoices_record_",
certifiedInvoicesList: "certified_invoices_list_",
redLetterInfoTab: "red_letter_info_tab_",
coupaPurchasingReport: "coupa_purchasing_report_",
invoiceData: "invoice_data_"
};
......
......@@ -219,17 +219,57 @@
getIRDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getIRDataForDisplay', queryParams, apiConfig.createVat());
},
initExportIRData: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportIRData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data, fileName + '.xlsx');
});
},
getCPRDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getCPRDataForDisplay', queryParams, apiConfig.createVat());
},
initExportCPRData: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportCPRData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data, fileName + '.xlsx');
});
},
getRLITDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getRLITDataForDisplay', queryParams, apiConfig.createVat());
},
initExportRLITData: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportRLITData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data, fileName + '.xlsx');
});
},
getCILDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getCILDataForDisplay', queryParams, apiConfig.createVat());
},
initExportCILData: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportCILData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data, fileName + '.xlsx');
});
},
getIDDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getIDDataForDisplay', queryParams, apiConfig.createVat());
},
initExportIDData: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportIDData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data, fileName + '.xlsx');
});
}
};
}]);
\ No newline at end of file
......@@ -232,13 +232,13 @@
ele2.datepicker("setDate", $scope.queryParams.certificationDateEnd);
};
var downloadInputInvoice = function () {
vatPreviewService.getExportInputInvoiceList($scope.queryParams).success(function (data, status, headers) {
if(status===204){
SweetAlert.warning("没有数据可以下载");
return;
var downloadCertifiedInvoicesList = function () {
var localDate=$filter('date')(new Date(), 'yyyyMMddHHmmss');
var fileName= constant.exportExcelFileName.certifiedInvoicesList + localDate;
vatPreviewService.initExportCILData($scope.queryParams,fileName).then(function (data) {
if (data) {
ackMessageBox.success(translate('FileExportSuccess'));
}
vatExportService.exportToExcel(data, status, headers, '进项发票信息.xls');
});
};
......@@ -298,7 +298,7 @@
$scope.doDataFilterReset = doDataFilterReset;
$scope.showPopover = showPopover;
$scope.downloadInputInvoice = downloadInputInvoice;
$scope.downloadCertifiedInvoicesList = downloadCertifiedInvoicesList;
initPeriods();
initCertifiedInvoicesListPagination();
......
......@@ -10,7 +10,7 @@
</button>-->
<span translate="CertifiedInvoicesListTitle" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 230px;" id="input-invoice-period-picker" />
<span ng-click="downloadInputInvoice()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
<span ng-click="downloadCertifiedInvoicesList()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div>
<!--<div style="margin-bottom: 8px;margin-left: 30px">
......
vatModule.controller('VatPreviewCoupaPurchasingReportController', ['$rootScope','$scope', '$log', '$translate', '$timeout', 'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatPreviewService', 'browserService', 'vatSessionService', 'region', 'enums', 'vatExportService',
function ($rootScope,$scope, $log, $translate, $timeout, SweetAlert, $q, uiGridConstants, $interval, vatPreviewService, browserService, vatSessionService, region, enums, vatExportService) {
vatModule.controller('VatPreviewCoupaPurchasingReportController', ['$rootScope','$scope', '$log','$filter', '$translate', '$timeout', 'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatPreviewService', 'browserService', 'vatSessionService', 'region', 'enums', 'vatExportService',
function ($rootScope,$scope, $log,$filter, $translate, $timeout, SweetAlert, $q, uiGridConstants, $interval, vatPreviewService, browserService, vatSessionService, region, enums, vatExportService) {
'use strict';
$scope.startDate = new Date(vatSessionService.project.year, 0, 1);
......@@ -236,14 +236,13 @@
ele2.datepicker("setDate", $scope.queryParams.certificationDateEnd);
};
//导出进项发票数据
var downloadInputInvoice = function () {
vatPreviewService.getExportInputInvoiceList($scope.queryParams).success(function (data, status, headers) {
if(status===204){
SweetAlert.warning("没有数据可以下载");
return;
var downloadCPR = function () {
var localDate = $filter('date')(new Date(), 'yyyyMMddHHmmss');
var fileName = constant.exportExcelFileName.coupaPurchasingReport + localDate;
vatPreviewService.initExportCPRData($scope.queryParams, fileName).then(function (data) {
if (data) {
ackMessageBox.success(translate('FileExportSuccess'));
}
vatExportService.exportToExcel(data, status, headers, '进项发票信息.xls');
});
};
......@@ -320,7 +319,7 @@
$scope.doDataFilterReset = doDataFilterReset;
$scope.prepareSummary = prepareSummary;
$scope.showPopover = showPopover;
$scope.downloadInputInvoice = downloadInputInvoice;
$scope.downloadCPR = downloadCPR;
initPeriods();
initCoupaPurchasingReportPagination();
......
......@@ -10,7 +10,7 @@
</button>-->
<span translate="CoupaPurchasingReportTitle" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 230px;" id="input-invoice-period-picker" />
<span ng-click="downloadInputInvoice()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
<span ng-click="downloadCPR()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div>
<!-- <div style="margin-bottom: 8px;margin-left: 30px">
......
vatModule.controller('VatPreviewInvoiceDataController', ['$rootScope','$scope', '$log', '$translate', '$timeout', 'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatPreviewService', 'browserService', 'vatSessionService', 'region', 'enums', 'vatExportService',
function ($rootScope,$scope, $log, $translate, $timeout, SweetAlert, $q, uiGridConstants, $interval, vatPreviewService, browserService, vatSessionService, region, enums, vatExportService) {
vatModule.controller('VatPreviewInvoiceDataController', ['$rootScope','$scope', '$log','$filter', '$translate', '$timeout', 'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatPreviewService', 'browserService', 'vatSessionService', 'region', 'enums', 'vatExportService',
function ($rootScope,$scope, $log,$filter, $translate, $timeout, SweetAlert, $q, uiGridConstants, $interval, vatPreviewService, browserService, vatSessionService, region, enums, vatExportService) {
'use strict';
$scope.startDate = new Date(vatSessionService.project.year, 0, 1);
......@@ -276,14 +276,12 @@
});
var downloadID = function () {
vatPreviewService.initExportIDData($scope.queryParams).success(function (data, status, headers) {
if(status===204){
SweetAlert.warning("没有数据可以下载");
return;
var localDate=$filter('date')(new Date(), 'yyyyMMddHHmmss');
var fileName= constant.exportExcelFileName.invoiceData + localDate;
vatPreviewService.initExportIDData($scope.queryParams,fileName).then(function (data) {
if (data) {
ackMessageBox.success(translate('FileExportSuccess'));
}
vatExportService.exportToExcel(data, status, headers, '日记账信息.xls');
}).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
};
......
......@@ -10,7 +10,7 @@
</button>-->
<span translate="InvoiceDataTitle" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px;" id="input-invoice-period-picker" />
<span ng-click="downloadInputInvoice()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
<span ng-click="downloadID()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div>
<!--<div style="margin-bottom: 8px;margin-left: 30px">
......
vatModule.controller('VatPreviewInvoiceRecordController', ['$rootScope','$scope', '$log', '$translate', '$timeout', 'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatPreviewService', 'browserService', 'vatSessionService', 'region', 'enums', 'vatExportService',
function ($rootScope,$scope, $log, $translate, $timeout, SweetAlert, $q, uiGridConstants, $interval, vatPreviewService, browserService, vatSessionService, region, enums, vatExportService) {
vatModule.controller('VatPreviewInvoiceRecordController', ['$rootScope','$scope', '$filter','$log', '$translate', '$timeout', 'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatPreviewService', 'browserService', 'vatSessionService', 'region', 'enums', 'vatExportService',
function ($rootScope,$scope, $filter,$log, $translate, $timeout, SweetAlert, $q, uiGridConstants, $interval, vatPreviewService, browserService, vatSessionService, region, enums, vatExportService) {
'use strict';
$scope.startDate = new Date(vatSessionService.project.year, 0, 1);
......@@ -276,14 +276,12 @@
});
var downloadIR = function () {
vatPreviewService.initExportIRData($scope.queryParams).success(function (data, status, headers) {
if(status===204){
SweetAlert.warning("没有数据可以下载");
return;
var localDate = $filter('date')(new Date(), 'yyyyMMddHHmmss');
var fileName = constant.exportExcelFileName.invoicesRecord + localDate;
vatPreviewService.initExportIRData($scope.queryParams, fileName).then(function (data) {
if (data) {
ackMessageBox.success(translate('FileExportSuccess'));
}
vatExportService.exportToExcel(data, status, headers, '日记账信息.xls');
}).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
};
......
......@@ -10,7 +10,7 @@
</button>-->
<span translate="InvoiceRecordTitle" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px;" id="input-invoice-period-picker" />
<span ng-click="downloadInputInvoice()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
<span ng-click="downloadIR()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div>
<!--<div style="margin-bottom: 8px;margin-left: 30px">
......
vatModule.controller('VatPreviewRedLetterInfoTabController', ['$rootScope','$scope', '$log', '$translate', '$timeout', 'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatPreviewService', 'browserService', 'vatSessionService', 'region', 'enums', 'vatExportService',
function ($rootScope,$scope, $log, $translate, $timeout, SweetAlert, $q, uiGridConstants, $interval, vatPreviewService, browserService, vatSessionService, region, enums, vatExportService) {
vatModule.controller('VatPreviewRedLetterInfoTabController', ['$rootScope','$scope', '$log','$filter', '$translate', '$timeout', 'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatPreviewService', 'browserService', 'vatSessionService', 'region', 'enums', 'vatExportService',
function ($rootScope,$scope, $log,$filter, $translate, $timeout, SweetAlert, $q, uiGridConstants, $interval, vatPreviewService, browserService, vatSessionService, region, enums, vatExportService) {
'use strict';
$scope.startDate = new Date(vatSessionService.project.year, 0, 1);
......@@ -245,13 +245,13 @@
})
};
var downloadInputInvoice = function () {
vatPreviewService.getExportInputInvoiceList($scope.queryParams).success(function (data, status, headers) {
if(status===204){
SweetAlert.warning("没有数据可以下载");
return;
var downloadRLIT = function () {
var localDate = $filter('date')(new Date(), 'yyyyMMddHHmmss');
var fileName = constant.exportExcelFileName.redLetterInfoTab + localDate;
vatPreviewService.initExportRLITData($scope.queryParams, fileName).then(function (data) {
if (data) {
ackMessageBox.success(translate('FileExportSuccess'));
}
vatExportService.exportToExcel(data, status, headers, '进项发票信息.xls');
});
};
......@@ -311,7 +311,7 @@
$scope.doDataFilterReset = doDataFilterReset;
$scope.showPopover = showPopover;
$scope.downloadInputInvoice = downloadInputInvoice;
$scope.downloadRLIT = downloadRLIT;
initPeriods();
initRedLetterInfoTabItemPagination();
......
......@@ -10,7 +10,7 @@
</button>-->
<span translate="RedLetterInformationTableTitle" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 230px;" id="input-invoice-period-picker" />
<span ng-click="downloadInputInvoice()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
<span ng-click="downloadRLIT()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div>
<!-- <div style="margin-bottom: 8px;margin-left: 30px">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment