Commit 72e50540 authored by chase's avatar chase

merge档案管理

parent a3ba953d
...@@ -705,17 +705,39 @@ public class ReportServiceImpl extends BaseService { ...@@ -705,17 +705,39 @@ public class ReportServiceImpl extends BaseService {
periodTemplateMapper.batchInsert(periodTemplateList); periodTemplateMapper.batchInsert(periodTemplateList);
} }
private String transNumber(int num,String result){
if(num==0){
return result;
}
int pre = num/26;// 取商
int res = num%26;// 取余数
if(res!=0){
result =(char)(res+'A'-1)+result;
}else{
result+='Z';
pre = pre -1;
}
return transNumber(pre,result);
}
public Workbook assembleTaxWorkBook(Template template, Workbook tWorkbook, String projectId, Integer period) { public Workbook assembleTaxWorkBook(Template template, Workbook tWorkbook, String projectId, Integer period) {
Sheet sheet = tWorkbook.getSheetAt(0); Sheet sheet = tWorkbook.getSheetAt(0);
RevenueConfigExample example = new RevenueConfigExample(); RevenueConfigExample example = new RevenueConfigExample();
List<RevenueConfig> dataList = revenueConfigMapper.selectByExample(example); List<RevenueConfig> dataList = revenueConfigMapper.selectByExample(example);
//合计项map
Map<Integer,List<String>> sumMap = new HashMap<>();
sumMap.put(TaxesCalculateReportEnum.Column.Column_5.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_6.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_7.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_8.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_10.getIndex(),new ArrayList<>());
if (CollectionUtils.isNotEmpty(dataList)) { if (CollectionUtils.isNotEmpty(dataList)) {
Project project = projectMapper.selectByPrimaryKey(projectId); Project project = projectMapper.selectByPrimaryKey(projectId);
int rowIndex = 1; int rowIndex = 1;
Row sourceRow = sheet.getRow(3); Row sourceRow = sheet.getRow(3);
for (RevenueConfig config : dataList) { for (RevenueConfig config : dataList) {
Row row = POIUtil.createAndCloneRow(tWorkbook, sheet, 1, sourceRow); Row row = POIUtil.createAndCloneRow(tWorkbook, sheet, 1, sourceRow);
row.getCell(TaxesCalculateReportEnum.Column.Column_1.getIndex()).setCellValue("1-" + rowIndex); row.getCell(TaxesCalculateReportEnum.Column.Column_1.getIndex()).setCellValue("1-" + rowIndex);
row.getCell(TaxesCalculateReportEnum.Column.Column_2.getIndex()).setCellValue(config.getName()); row.getCell(TaxesCalculateReportEnum.Column.Column_2.getIndex()).setCellValue(config.getName());
row.getCell(TaxesCalculateReportEnum.Column.Column_3.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_3.getIndex()).setCellValue("");
...@@ -724,9 +746,9 @@ public class ReportServiceImpl extends BaseService { ...@@ -724,9 +746,9 @@ public class ReportServiceImpl extends BaseService {
if (0 == config.getAccountType()) {//0值 if (0 == config.getAccountType()) {//0值
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue(0.00); row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue(0.00);
} else if (1 == config.getAccountType()) {//科目 } else if (1 == config.getAccountType()) {//科目
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")-" row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue(
+ "JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")"); "DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")-"
+ "JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")");
} else if (2 == config.getAccountType()) {//手工输入 } else if (2 == config.getAccountType()) {//手工输入
} else { } else {
...@@ -735,30 +757,31 @@ public class ReportServiceImpl extends BaseService { ...@@ -735,30 +757,31 @@ public class ReportServiceImpl extends BaseService {
row.getCell(TaxesCalculateReportEnum.Column.Column_6.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_6.getIndex()).setCellValue("");
row.getCell(TaxesCalculateReportEnum.Column.Column_7.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_7.getIndex()).setCellValue("");
if (1 == config.getTaxBase()) {//账载 if (1 == config.getTaxBase()) {//账载
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")");
// row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")");
// row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\"" + config.getName() + "\",\"E\")");
//838b9b6513422e029c38575f9b029b1fdd18dadb
} else if (2 == config.getTaxBase()) {//开票收入 } else if (2 == config.getTaxBase()) {//开票收入
} else if (3 == config.getTaxBase()) {//手工录入 } else if (3 == config.getTaxBase()) {//手工录入
} else if (4 == config.getTaxBase()) {//借方发生额 } else if (4 == config.getTaxBase()) {//借方发生额
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",,)"); row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,,)");
} else if (5 == config.getTaxBase()) {//贷方发生额 } else if (5 == config.getTaxBase()) {//贷方发生额
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",,)"); row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,,)");
}else{ }else{
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"\",\"\")"); row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("");
} }
row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue(config.getTaxRate().multiply(new BigDecimal(100)).intValue() + "%"); row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue(config.getTaxRate().multiply(new BigDecimal(100)).intValue() + "%");
// row.getCell(TaxesCalculateReportEnum.Column.Column_10.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")*" row.getCell(TaxesCalculateReportEnum.Column.Column_10.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")*"
// +"WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"I\")"); +"WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"I\")");
if(rowIndex == 3){
row.getCell(TaxesCalculateReportEnum.Column.Column_10.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"I\")");
}
row.getCell(TaxesCalculateReportEnum.Column.Column_11.getIndex()).setCellValue(RevenueConfEnum.RevenueType.MAPPING.get(config.getRevenueType())); row.getCell(TaxesCalculateReportEnum.Column.Column_11.getIndex()).setCellValue(RevenueConfEnum.RevenueType.MAPPING.get(config.getRevenueType()));
row.getCell(TaxesCalculateReportEnum.Column.Column_12.getIndex()).setCellValue(RevenueConfEnum.TaxType.MAPPING.get(config.getTaxType())); row.getCell(TaxesCalculateReportEnum.Column.Column_12.getIndex()).setCellValue(RevenueConfEnum.TaxType.MAPPING.get(config.getTaxType()));
//组装合计项
sumMap.get(TaxesCalculateReportEnum.Column.Column_5.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_5.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_6.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_6.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_7.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_7.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_8.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_8.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_10.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_10.getIndex()+1,"")+rowIndex);
rowIndex++; rowIndex++;
} }
} }
......
...@@ -59,7 +59,7 @@ public class WPNAME extends FunctionBase implements FreeRefFunction { ...@@ -59,7 +59,7 @@ public class WPNAME extends FunctionBase implements FreeRefFunction {
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL); MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
cellTemplateData = cellTemplateDataList.get(0); cellTemplateData = cellTemplateDataList.get(0);
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode()); int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
cellValue = getCellValue(index, ec, formulaContext, agent, cellTemplateData.getRowIndex(), bo.getColumnIndex(), cellValue = getCellValue(index, ec, formulaContext, agent, cellTemplateData.getRowIndex(), bo.getColumnIndex()-1,
Long.parseLong(cellTemplateData.getCellTemplateId())); Long.parseLong(cellTemplateData.getCellTemplateId()));
nullCellDto.extractFromGroup(bo, formulaContext.getPeriod(), formulaContext.getYear(), cellTemplateData); nullCellDto.extractFromGroup(bo, formulaContext.getPeriod(), formulaContext.getYear(), cellTemplateData);
nullCellDto.setAmount(cellValue); nullCellDto.setAmount(cellValue);
......
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
if (options.data.updateTime) { if (options.data.updateTime) {
$('<span '+style+'>').text($filter('date')(options.data.updateTime, 'yyyy-MM-dd')).appendTo(container); $('<span '+style+'>').text($filter('date')(options.data.updateTime, 'yyyy-MM-dd')).appendTo(container);
} else { } else {
$('<span>').text().appendTo(container); $('<span>').text('').appendTo(container);
} }
} catch (e) { } catch (e) {
$log.error(e); $log.error(e);
...@@ -281,6 +281,11 @@ ...@@ -281,6 +281,11 @@
var createDocFileType = function () { var createDocFileType = function () {
var uploadModel = angular.copy($scope.editModel); var uploadModel = angular.copy($scope.editModel);
delete uploadModel.id; //新增文档不需要上传ID delete uploadModel.id; //新增文档不需要上传ID
// 默认status为1
if(uploadModel.status === undefined
|| uploadModel.status === null) uploadModel.status = 1;
docManageService.addFileType(uploadModel).then(function (data) { docManageService.addFileType(uploadModel).then(function (data) {
if (data == true) { if (data == true) {
SweetAlert.success($translate.instant('SaveSuccess')); SweetAlert.success($translate.instant('SaveSuccess'));
......
...@@ -144,10 +144,9 @@ ...@@ -144,10 +144,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"> <label class="col-sm-3 control-label">
<span style="color:red"> * </span>
<span translate="State"></span> <span translate="State"></span>
</label> </label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%" >
<label class="col-sm-5 DM-state-label"> <label class="col-sm-5 DM-state-label">
<input type="radio" name="editModelState" <input type="radio" name="editModelState"
value=1 value=1
...@@ -159,7 +158,7 @@ ...@@ -159,7 +158,7 @@
<input type="radio" name="editModelState" <input type="radio" name="editModelState"
value=0 value=0
ng-checked="editModel.status == 0" ng-checked="editModel.status == 0"
ng-model="editModel.status" required /> ng-model="editModel.status"/>
<span translate="Disable"></span> <span translate="Disable"></span>
</label> </label>
......
...@@ -98,7 +98,7 @@ frameworkModule.controller('appUsrOperateLogController', ...@@ -98,7 +98,7 @@ frameworkModule.controller('appUsrOperateLogController',
if (options.data.createTime) { if (options.data.createTime) {
$('<span>').text($filter('date')(options.data.createTime, 'yyyy-MM-dd hh:mm')).appendTo(container); $('<span>').text($filter('date')(options.data.createTime, 'yyyy-MM-dd hh:mm')).appendTo(container);
} else { } else {
$('<span>').text().appendTo(container); $('<span>').text('').appendTo(container);
} }
} catch (e) { } catch (e) {
$log.error(e); $log.error(e);
......
...@@ -17,38 +17,24 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -17,38 +17,24 @@ taxDocumentManageModule.controller('taxDocumentListController',
$scope.queryFieldModel.pageSize = $scope.pagingOptions.pageSize; $scope.queryFieldModel.pageSize = $scope.pagingOptions.pageSize;
var params = angular.copy($scope.queryFieldModel); var params = angular.copy($scope.queryFieldModel);
params.fileBeginTime = getQueryDate(params.fileBeginTime,"-");
// 过滤时间格式 params.fileEndTTime = getQueryDate(params.fileEndTTime,"-");
params.ownTime = params.ownTime ? params.ownTime : ""; params.ownBeginTime = getQueryDate(params.ownBeginTime,"-");
var splitMark = params.ownTime.indexOf("-") > -1 ? "-" : "/"; params.ownEndTime = getQueryDate(params.ownEndTime,"-");
params.ownTime = parseInt(params.ownTime.split(splitMark).join("")); params.effectiveBeginTime = getQueryDate(params.effectiveBeginTime,"-");
params.effectiveEndTime = getQueryDate(params.effectiveEndTime,"-");
// if($scope.queryOwnTime)params.ownTime = $scope.queryOwnTime(params.ownTime,"int"); params.uploadBeginTime = getQueryDate(params.uploadBeginTime,"-");
params.fileBeginTime ? params.fileBeginTime += "-01" : ""; params.uploadEndTime = getQueryDate(params.uploadEndTime,"-");
function getQueryDate(time, mark) {
if (params.fileEndTTime) { if (!time) return "";
var fileEndTTimeDate = $scope.getMonthLastDate(params.fileEndTTime.split("-")[0], params.fileEndTTime.split("-")[1]); var theDate = new Date(time);
params.fileEndTTime += "-" + fileEndTTimeDate; var year = theDate.getFullYear();
} var mm = theDate.getMonth() + 1;
var dd = theDate.getDate();
params.ownBeginTime ? params.ownBeginTime += "-01" : ""; mm = (mm + "").length < 2 ? "0" + mm : mm;
if (params.ownEndTime) { dd = (dd + "").length < 2 ? "0" + dd : dd;
var ownEndTimeDate = $scope.getMonthLastDate(params.ownEndTime.split("-")[0], params.ownEndTime.split("-")[1]); return year + mark + mm + mark + dd;
params.ownEndTime += "-" + ownEndTimeDate;
}
params.effectiveBeginTime ? params.effectiveBeginTime += "-01" : "";
if (params.effectiveEndTime) {
var effectiveEndTimeDate = $scope.getMonthLastDate(params.effectiveEndTime.split("-")[0], params.effectiveEndTime.split("-")[1]);
params.effectiveEndTime += "-" + effectiveEndTimeDate;
}
params.uploadBeginTime ? params.uploadBeginTime += "-01" : "";
if (params.uploadEndTime) {
var uploadEndTimeDate = $scope.getMonthLastDate(params.uploadEndTime.split("-")[0], params.uploadEndTime.split("-")[1]);
params.uploadEndTime += "-" + uploadEndTimeDate;
} }
taxDocumentListService.fetchMainList(params).then(function (data, status, headers) { taxDocumentListService.fetchMainList(params).then(function (data, status, headers) {
if (status == 204) { if (status == 204) {
SweetAlert.warning($translate.instant("NoData")); SweetAlert.warning($translate.instant("NoData"));
...@@ -284,8 +270,8 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -284,8 +270,8 @@ taxDocumentManageModule.controller('taxDocumentListController',
// $scope.editFieldModel.ownTime = year + "/" + mon; // $scope.editFieldModel.ownTime = year + "/" + mon;
$scope.editFieldModel.ownTime = $scope.queryOwnTime(item.ownTime, "/"); $scope.editFieldModel.ownTime = $scope.queryOwnTime(item.ownTime, "/");
$scope.editFieldModel.fileTime = $scope.queryDate(item.fileTime, "/"); $scope.editFieldModel.fileTime = $scope.getQueryDate(item.fileTime, "/");
$scope.editFieldModel.effectiveTime = $scope.queryDate(item.effectiveTime, "/"); $scope.editFieldModel.effectiveTime = $scope.getQueryDate(item.effectiveTime, "/");
$scope.syncFileType($scope.editFieldModel.fileAttr); $scope.syncFileType($scope.editFieldModel.fileAttr);
$scope.matchFieldTypeId($scope.editFieldModel); $scope.matchFieldTypeId($scope.editFieldModel);
} }
...@@ -310,8 +296,8 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -310,8 +296,8 @@ taxDocumentManageModule.controller('taxDocumentListController',
// var splitMark = params.ownTime.indexOf("-") > -1 ? "-" : "/"; // var splitMark = params.ownTime.indexOf("-") > -1 ? "-" : "/";
// params.ownTime = parseInt(params.ownTime.split(splitMark).join("")); // params.ownTime = parseInt(params.ownTime.split(splitMark).join(""));
params.ownTime = $scope.queryOwnTime(params.ownTime, "int"); params.ownTime = $scope.queryOwnTime(params.ownTime, "int");
params.fileTime = $scope.queryDate(params.fileTime, "-"); params.fileTime = $scope.getQueryDate(params.fileTime, "-");
params.effectiveTime = $scope.queryDate(params.effectiveTime, "-"); params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "-");
params.filePositionUrl = encodeURIComponent(params.filePositionUrl); params.filePositionUrl = encodeURIComponent(params.filePositionUrl);
taxDocumentListService.verifyDuplicate(params).then(function (data) { taxDocumentListService.verifyDuplicate(params).then(function (data) {
...@@ -331,7 +317,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -331,7 +317,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
} else { } else {
if (/(createTime|updateTime|uploadTime)/.test(key)) { if (/(createTime|updateTime|uploadTime)/.test(key)) {
fields[key] = $scope.queryDate(curItemValue, "/"); fields[key] = $scope.getQueryDate(curItemValue, "/");
} else fields[key] = curItemValue; } else fields[key] = curItemValue;
} }
...@@ -415,12 +401,15 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -415,12 +401,15 @@ taxDocumentManageModule.controller('taxDocumentListController',
// params.ownTime = params.ownTime ? params.ownTime : ""; // params.ownTime = params.ownTime ? params.ownTime : "";
// var splitMark = params.ownTime.indexOf("-") > -1 ? "-" : "/"; // var splitMark = params.ownTime.indexOf("-") > -1 ? "-" : "/";
// params.ownTime = parseInt(params.ownTime.split(splitMark).join("")); // params.ownTime = parseInt(params.ownTime.split(splitMark).join(""));
Object.keys(params).forEach(function(key){
if(params[key] === undefined || params[key] === null) params[key] = "";
});
params.ownTime = $scope.queryOwnTime(params.ownTime, "int"); params.ownTime = $scope.queryOwnTime(params.ownTime, "int");
params.effectiveTime = $scope.queryDate(params.effectiveTime, "/"); params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "/");
params.fileTime = $scope.queryDate(params.fileTime, "/"); params.fileTime = $scope.getQueryDate(params.fileTime, "/");
params.createTime = $scope.queryDate(params.createTime, "/"); params.createTime = $scope.getQueryDate(params.createTime, "/");
params.updateTime = $scope.queryDate(params.updateTime, "/"); params.updateTime = $scope.getQueryDate(params.updateTime, "/");
params.uploadTime = $scope.queryDate(params.uploadTime, "/"); params.uploadTime = $scope.getQueryDate(params.uploadTime, "/");
params.filePositionUrl = encodeURIComponent(params.filePositionUrl); params.filePositionUrl = encodeURIComponent(params.filePositionUrl);
taxDocumentListService.editRecord(params).then(function (data) { taxDocumentListService.editRecord(params).then(function (data) {
if (data == true) { if (data == true) {
...@@ -492,12 +481,10 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -492,12 +481,10 @@ taxDocumentManageModule.controller('taxDocumentListController',
// console.log(data); // console.log(data);
if (data) { if (data) {
$scope.typeAndAttrMap = data; $scope.typeAndAttrMap = data;
Object.keys(data).forEach(function (item) { // 抽取每个元素的头一个字串,用于排序;
$scope.fileTypeOptions[item] = item; $scope.fileTypeOptions = $scope.sortByFirstCode(Object.keys(data));
}); $scope.fileAttrOptions = $scope.sortByFirstCode(Object.values(data));
Object.values(data).forEach(function (item) {
$scope.fileAttrOptions[item] = item;
});
} }
}); });
...@@ -799,7 +786,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -799,7 +786,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
fields[key] = $scope.queryOwnTime(curItemValue, "int"); fields[key] = $scope.queryOwnTime(curItemValue, "int");
} else { } else {
if (/(createTime|updateTime|uploadTime)/.test(key)) { if (/(createTime|updateTime|uploadTime)/.test(key)) {
fields[key] = $scope.queryDate(curItemValue, "/"); fields[key] = $scope.getQueryDate(curItemValue, "/");
} else fields[key] = curItemValue; } else fields[key] = curItemValue;
} }
fileItem.formData.push(fields); fileItem.formData.push(fields);
...@@ -812,8 +799,8 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -812,8 +799,8 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
// params.ownTime = params.ownTime ? params.ownTime : ""; // params.ownTime = params.ownTime ? params.ownTime : "";
// params.ownTime = parseInt(_editFieldModel.ownTime.split("-").join("")); // params.ownTime = parseInt(_editFieldModel.ownTime.split("-").join(""));
params.ownTime = $scope.queryOwnTime(params.ownTime, "int"); params.ownTime = $scope.queryOwnTime(params.ownTime, "int");
params.fileTime = $scope.queryDate(params.fileTime, "-"); params.fileTime = $scope.getQueryDate(params.fileTime, "-");
params.effectiveTime = $scope.queryDate(params.effectiveTime, "-"); params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "-");
_taxDocumentListService.verifyDuplicate(params).then(function (data) { _taxDocumentListService.verifyDuplicate(params).then(function (data) {
if (data == true) { if (data == true) {
_fileItem.url = "http://etms.longi-silicon.com:8180//api/v1/taxDoc/add"; _fileItem.url = "http://etms.longi-silicon.com:8180//api/v1/taxDoc/add";
...@@ -940,7 +927,9 @@ taxDocumentManageModule.directive('filePreview', function () { ...@@ -940,7 +927,9 @@ taxDocumentManageModule.directive('filePreview', function () {
} }
else if (/pdf/i.test(fileType)) { else if (/pdf/i.test(fileType)) {
$scope.openPdfPreviewPop(filePositionUrl); $scope.openPdfPreviewPop(filePositionUrl);
} else { } else if (/jpg|pig|gif|png|jpeg/i.test(fileType)) {
$scope.openImgPreviewPop(fileName, filePositionUrl);
}else {
SweetAlert.warning($translate.instant('UnFile')); SweetAlert.warning($translate.instant('UnFile'));
} }
...@@ -952,14 +941,14 @@ taxDocumentManageModule.directive('filePreview', function () { ...@@ -952,14 +941,14 @@ taxDocumentManageModule.directive('filePreview', function () {
var field_keys = Object.keys(_data[0]); var field_keys = Object.keys(_data[0]);
var field_values = Object.values(_data[0]); var field_values = Object.values(_data[0]);
_data.forEach(function (item) { // _data.forEach(function (item) {
var curRow_keys = Object.keys(item); // var curRow_keys = Object.keys(item);
var curRow_values = Object.values(item); // var curRow_values = Object.values(item);
if (curRow_keys && curRow_keys.length > field_keys.length) { // if (curRow_keys && curRow_keys.length > field_keys.length) {
field_keys = curRow_keys; // field_keys = curRow_keys;
field_values = curRow_values; // field_values = curRow_values;
} // }
}); // });
$scope.filePreview_dataGridOptions = { $scope.filePreview_dataGridOptions = {
bindingOptions: { bindingOptions: {
...@@ -1002,7 +991,7 @@ taxDocumentManageModule.directive('filePreview', function () { ...@@ -1002,7 +991,7 @@ taxDocumentManageModule.directive('filePreview', function () {
field_keys.forEach(function (field, index) { field_keys.forEach(function (field, index) {
cols.push({ cols.push({
dataField: field, dataField: field,
caption: (Object.keys(_data[0]).length == field_values.length) ? field_values[index] : index caption: field_values[index]
}); });
}); });
return cols; return cols;
...@@ -1102,6 +1091,27 @@ taxDocumentManageModule.directive('pdfPreview', function () { ...@@ -1102,6 +1091,27 @@ taxDocumentManageModule.directive('pdfPreview', function () {
}] }]
} }
}); });
taxDocumentManageModule.directive('imgPreview', function () {
return {
restrict: 'EA',
controller: ['$scope', function ($scope) {
$scope.curImgSrc = "";
$scope.curImgName = "";
$scope.openImgPreviewPop = function (fileName,url) {
if ($scope.curImgSrc !== url) {
$scope.curImgName = fileName;
$scope.curImgSrc = url;
}
$("#imgLayoutDialog").modal("show");
};
$scope.closeImgPop = function () {
$("#imgLayoutDialog").modal("hide");
};
}]
}
});
taxDocumentManageModule.directive('helpPop', function () { taxDocumentManageModule.directive('helpPop', function () {
return { return {
restrict: 'EA', restrict: 'EA',
...@@ -1117,19 +1127,25 @@ taxDocumentManageModule.directive('helpPop', function () { ...@@ -1117,19 +1127,25 @@ taxDocumentManageModule.directive('helpPop', function () {
var dataGrid = $('<div dx-data-grid="help_dataGridOptions">'); var dataGrid = $('<div dx-data-grid="help_dataGridOptions">');
$("#helpPopContainer").html("").append(dataGrid); $("#helpPopContainer").html("").append(dataGrid);
$compile(dataGrid)($scope); $compile(dataGrid)($scope);
$("#helpPopDialog").modal("show"); var helpPopDialog = $("#helpPopDialog");
helpPopDialog.modal("show");
}) })
}; };
$scope.sniffHelpPopRadio = function(){
$("input[name='helpPopRadio']").each(function (index,item) {
if(item.checked){
$scope.editFieldModel.fileAttr = item.getAttribute("data-fileAttr");
$scope.editFieldModel.fileType = item.getAttribute("data-fileType");
$scope.syncRequiredFields($scope.editFieldModel); $scope.sniffHelpPopRadio = function(){
} var checkedItem = $(".TDL-has-checked").children()[0].childNodes[0];
$scope.editFieldModel.fileAttr = checkedItem.getAttribute("data-fileAttr");
taxDocumentListService.getDocumentsAttrAndType({params: {}}).then(function (data) {
$scope.FileAttrAndTypeCache = data.items;
//根据文件属性来匹配出 文件类型下拉列表
$scope.syncFileType($scope.editFieldModel.fileAttr);
$scope.editFieldModel.fileType = checkedItem.getAttribute("data-fileType");
$scope.syncRequiredFields($scope.editFieldModel);
}); });
$("#helpPopDialog").modal("hide");
}; };
$scope.help_dataGridUpdate = function (_data) { $scope.help_dataGridUpdate = function (_data) {
$scope.help_cacheData = _data.items; $scope.help_cacheData = _data.items;
$scope.help_dataGridOptions = { $scope.help_dataGridOptions = {
...@@ -1155,25 +1171,28 @@ taxDocumentManageModule.directive('helpPop', function () { ...@@ -1155,25 +1171,28 @@ taxDocumentManageModule.directive('helpPop', function () {
allowColumnReordering: true, allowColumnReordering: true,
columns: [ columns: [
{ {
dataField: "", dataField: "fileAttr",
caption: "", caption: $translate.instant('DocumentAttr'),
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
var target = $('<input name="helpPopRadio" type="radio" ' + var target = $('<span name="helpPopRadio" type="radio" ' +
'data-id="helpPop_' + options.data.id + '" ' + 'data-id="helpPop_' + options.data.id + '" ' +
'data-fileAttr="' + options.data.fileAttr + '" ' + 'data-fileAttr="' + options.data.fileAttr + '" ' +
'data-fileType="' + options.data.fileType + 'data-fileType="' + options.data.fileType +
'" />'); '">'+ options.data.fileAttr +'</span>');
container.append(target); container.append(target);
// target.parents("tr").off('click').on('click', function () {
// $scope.sniffHelpPopRadio(options.data.id); var trs = $("#helpPopDialog").find("tr");
// }); trs.each(function (index,item) {
$(item).off("click").on("click",function(e){
trs.each(function(_index,_item){
$(_item).removeClass('TDL-has-checked');
});
$(e.currentTarget).addClass('TDL-has-checked');
})
})
} }
}, },
{
dataField: "fileAttr",
caption: $translate.instant('DocumentAttr'),
},
{ {
dataField: "fileType", dataField: "fileType",
caption: $translate.instant('DocumentType'), caption: $translate.instant('DocumentType'),
...@@ -1188,6 +1207,7 @@ taxDocumentManageModule.directive('helpPop', function () { ...@@ -1188,6 +1207,7 @@ taxDocumentManageModule.directive('helpPop', function () {
], ],
}; };
}; };
$scope.openHelpPopForEntityStorage = function () { $scope.openHelpPopForEntityStorage = function () {
window.swal($translate.instant('EntityStorageDescription')); window.swal($translate.instant('EntityStorageDescription'));
} }
...@@ -1287,7 +1307,7 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1287,7 +1307,7 @@ taxDocumentManageModule.directive('tempModule', function () {
//税种 //税种
$scope.taxTypeSelects = ["纳税申报表", "税票"]; $scope.taxTypeSelects = ["纳税申报表", "税票"];
$scope.queryDate = function (time, mark) { $scope.getQueryDate = function (time, mark) {
if (!time) return ""; if (!time) return "";
var theDate = new Date(time); var theDate = new Date(time);
var year = theDate.getFullYear(); var year = theDate.getFullYear();
...@@ -1372,6 +1392,23 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1372,6 +1392,23 @@ taxDocumentManageModule.directive('tempModule', function () {
$("#period-picker3").val(""); $("#period-picker3").val("");
$("#period-picker4").val(""); $("#period-picker4").val("");
}; };
$scope.sortByFirstCode = function(src){
var result = [];
var typeKeys = [];
var typeMap = {};
src.forEach(function(key){
typeKeys.push((key + "").substr(0,1));
typeMap[(key + "").substr(0,1)] = key;
});
typeKeys.sort().forEach(function(key){
result.push(typeMap[key]);
});
return result;
}
}] }]
} }
}); });
......
...@@ -58,8 +58,8 @@ ...@@ -58,8 +58,8 @@
} }
.TDL-query-bar .TDL-query-val .TDL-query-val-multi { .TDL-query-bar .TDL-query-val .TDL-query-val-multi {
width: 45%; width: 50%;
max-width: 45%; max-width: 50%;
display: inline-block; display: inline-block;
margin: 0; margin: 0;
position: absolute; position: absolute;
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
left: 1rem; left: 1rem;
} }
.TDL-query-bar .TDL-query-val .TDL-query-val-multi:nth-child(even){ .TDL-query-bar .TDL-query-val .TDL-query-val-multi:nth-child(even){
left: 45%; left: 50%;
border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;
} }
...@@ -113,8 +113,8 @@ ...@@ -113,8 +113,8 @@
.TDL-query-bar .TDL-query-val > input, .TDL-query-bar .TDL-query-val > input,
.TDL-query-bar .TDL-query-val > select { .TDL-query-bar .TDL-query-val > select {
width: 90%; width: 100%;
max-width: 90%; max-width: 100%;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid #E1E1E1; border: 1px solid #E1E1E1;
} }
...@@ -333,6 +333,12 @@ ...@@ -333,6 +333,12 @@
div.rangePicker.RTL > .wrap > .custom > div.calendar.from { div.rangePicker.RTL > .wrap > .custom > div.calendar.from {
float: left; float: left;
} }
tr.TDL-has-checked{
background: #337ab7;
color: #fff;
}
</style> </style>
<div class="menu-header TDL-header"> <div class="menu-header TDL-header">
<div class="TDL-query-bar" ng-init="MoreFields = false"> <div class="TDL-query-bar" ng-init="MoreFields = false">
...@@ -379,12 +385,12 @@ ...@@ -379,12 +385,12 @@
<!--<input type="text" class="form-control radius3" id="period-picker1"/>--> <!--<input type="text" class="form-control radius3" id="period-picker1"/>-->
<input type='text' placeholder="From" <input type='text' placeholder="From"
date-time-picker class="form-control TDL-query-val-multi" date-time-picker class="form-control TDL-query-val-multi"
data-date-format="yyyy-mm" ng-model="queryFieldModel.fileBeginTime" data-date-format="yyyy/mm/dd" ng-model="queryFieldModel.fileBeginTime"
data-min-view-mode="1" /> data-min-view-mode="0" />
<input type='text' placeholder="To" <input type='text' placeholder="To"
date-time-picker class="form-control TDL-query-val-multi" date-time-picker class="form-control TDL-query-val-multi"
data-date-format="yyyy-mm" ng-model="queryFieldModel.fileEndTTime" data-date-format="yyyy/mm/dd" ng-model="queryFieldModel.fileEndTTime"
data-min-view-mode="1" /> data-min-view-mode="0" />
</div> </div>
</div> </div>
...@@ -397,12 +403,12 @@ ...@@ -397,12 +403,12 @@
<!--ng-model="queryFieldModel.Duration"/>--> <!--ng-model="queryFieldModel.Duration"/>-->
<input type='text' placeholder="From" <input type='text' placeholder="From"
date-time-picker class="form-control TDL-query-val-multi" date-time-picker class="form-control TDL-query-val-multi"
data-date-format="yyyy-mm" ng-model="queryFieldModel.ownBeginTime" data-date-format="yyyy/mm/dd" ng-model="queryFieldModel.ownBeginTime"
data-min-view-mode="1"/> data-min-view-mode="0"/>
<input type='text' placeholder="To" <input type='text' placeholder="To"
date-time-picker class="form-control TDL-query-val-multi" date-time-picker class="form-control TDL-query-val-multi"
data-date-format="yyyy-mm" ng-model="queryFieldModel.ownEndTime" data-date-format="yyyy/mm/dd" ng-model="queryFieldModel.ownEndTime"
data-min-view-mode="1"/> data-min-view-mode="0"/>
<!--<input type="text" class="form-control radius3" id="period-picker2"/>--> <!--<input type="text" class="form-control radius3" id="period-picker2"/>-->
</div> </div>
...@@ -460,17 +466,12 @@ ...@@ -460,17 +466,12 @@
<!--ng-model="queryFieldModel.DueDate"/>--> <!--ng-model="queryFieldModel.DueDate"/>-->
<input type='text' placeholder="From" <input type='text' placeholder="From"
date-time-picker class="form-control TDL-query-val-multi" date-time-picker class="form-control TDL-query-val-multi"
data-date-format="yyyy-mm" ng-model="queryFieldModel.effectiveBeginTime" data-date-format="yyyy/mm/dd" ng-model="queryFieldModel.effectiveBeginTime"
data-min-view-mode="1"/> data-min-view-mode="0"/>
<input type='text' placeholder="To" <input type='text' placeholder="To"
date-time-picker class="form-control TDL-query-val-multi" date-time-picker class="form-control TDL-query-val-multi"
data-date-format="yyyy-mm" ng-model="queryFieldModel.effectiveEndTime" data-date-format="yyyy/mm/dd" ng-model="queryFieldModel.effectiveEndTime"
data-min-view-mode="1"/> data-min-view-mode="0"/>
<!--$scope.queryFieldModel.effectiveBeginTime = dateFormat(result[0].reverse());-->
<!--$scope.queryFieldModel.effectiveEndTime = dateFormat(result[1].reverse());-->
<!--<input type="text" class="form-control radius3" id="period-picker3" ng-model="queryFieldModel.DueDate" />-->
</div> </div>
</div> </div>
</div> </div>
...@@ -497,7 +498,7 @@ ...@@ -497,7 +498,7 @@
<span translate="EntityIndex"></span> <span translate="EntityIndex"></span>
</div> </div>
<div class="TDL-query-val"> <div class="TDL-query-val">
<input type="text" class="form-control radius3" <input type="number" class="form-control radius3"
ng-model="queryFieldModel.physicalIndexNumber"/> ng-model="queryFieldModel.physicalIndexNumber"/>
</div> </div>
</div> </div>
...@@ -540,12 +541,12 @@ ...@@ -540,12 +541,12 @@
<!--<input type="text" class="form-control radius3" id="period-picker4" />--> <!--<input type="text" class="form-control radius3" id="period-picker4" />-->
<input type='text' placeholder="From" <input type='text' placeholder="From"
date-time-picker class="form-control TDL-query-val-multi" date-time-picker class="form-control TDL-query-val-multi"
data-date-format="yyyy-mm" ng-model="queryFieldModel.uploadBeginTime" data-date-format="yyyy/mm/dd" ng-model="queryFieldModel.uploadBeginTime"
data-min-view-mode="1"/> data-min-view-mode="0"/>
<input type='text' placeholder="To" <input type='text' placeholder="To"
date-time-picker class="form-control TDL-query-val-multi" date-time-picker class="form-control TDL-query-val-multi"
data-date-format="yyyy-mm" ng-model="queryFieldModel.uploadEndTime" data-date-format="yyyy/mm/dd" ng-model="queryFieldModel.uploadEndTime"
data-min-view-mode="1"/> data-min-view-mode="0"/>
<!--$scope.queryFieldModel.uploadBeginTime = dateFormat(result[0].reverse());--> <!--$scope.queryFieldModel.uploadBeginTime = dateFormat(result[0].reverse());-->
<!--$scope.queryFieldModel.uploadEndTime = dateFormat(result[1].reverse());--> <!--$scope.queryFieldModel.uploadEndTime = dateFormat(result[1].reverse());-->
</div> </div>
...@@ -584,7 +585,7 @@ ...@@ -584,7 +585,7 @@
></app-usr-operate-log> ></app-usr-operate-log>
<button class="btn DTL-create-record" ng-click="openMultiUploadPop()"> <button class="btn DTL-create-record" ng-click="openMultiUploadPop()">
<i class="fa fa-plus-square"></i> <i class="fa fa-plus-square"></i>
<span>{{'MultiUpload' | translate}}</span> <span translate="MultiUpload"></span>
</button> </button>
<button class="btn DTL-create-record" ng-click="openSimpleUploadPop()"> <button class="btn DTL-create-record" ng-click="openSimpleUploadPop()">
<i class="fa fa-plus-square"></i> <i class="fa fa-plus-square"></i>
...@@ -613,7 +614,7 @@ ...@@ -613,7 +614,7 @@
<div class="modal fade" id="simpleUploadPopDialog" file-uploader tabindex="-1" role="dialog" <div class="modal fade" id="simpleUploadPopDialog" file-uploader tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false"> aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width:80%;height:200px;" role="document"> <div class="modal-dialog" style="width:80%;height:200px;max-width:1028px" role="document">
<div class="modal-content"> <div class="modal-content">
<form class="form-horizontal" name="newDocFileTypeForm" <form class="form-horizontal" name="newDocFileTypeForm"
ng-submit="simpleUploadSubmit(editFieldModel,'simple')"> ng-submit="simpleUploadSubmit(editFieldModel,'simple')">
...@@ -817,6 +818,7 @@ ...@@ -817,6 +818,7 @@
</label> </label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
<input class="form-control" <input class="form-control"
type="number"
placeholder="{{'PleaseType' | translate}}" placeholder="{{'PleaseType' | translate}}"
ng-required="isRequired('EntityIndex')" ng-required="isRequired('EntityIndex')"
ng-model="editFieldModel.physicalIndexNumber" ng-model="editFieldModel.physicalIndexNumber"
...@@ -849,7 +851,7 @@ ...@@ -849,7 +851,7 @@
<div class="modal fade" id="multiUploadPopDialog" multi-file-uploader tabindex="-1" role="dialog" <div class="modal fade" id="multiUploadPopDialog" multi-file-uploader tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false"> aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width:80%;height:200px;" role="document"> <div class="modal-dialog" style="width:80%;height:200px;max-width:1028px" role="document">
<div class="modal-content"> <div class="modal-content">
<form class="form-horizontal" name="newDocFileTypeForm" ng-submit="multiUploadSubmit()"> <form class="form-horizontal" name="newDocFileTypeForm" ng-submit="multiUploadSubmit()">
<div class="modal-header" > <div class="modal-header" >
...@@ -1053,6 +1055,7 @@ ...@@ -1053,6 +1055,7 @@
</label> </label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
<input class="form-control" <input class="form-control"
type="number"
placeholder="{{'PleaseType' | translate}}" placeholder="{{'PleaseType' | translate}}"
ng-model="editFieldItem.physicalIndexNumber" ng-model="editFieldItem.physicalIndexNumber"
ng-required="isRequired('EntityIndex')" ng-required="isRequired('EntityIndex')"
...@@ -1112,7 +1115,7 @@ ...@@ -1112,7 +1115,7 @@
<div class="modal fade" id="uploadResultPop" tabindex="-1" role="dialog" aria-labelledby="myModal" <div class="modal fade" id="uploadResultPop" tabindex="-1" role="dialog" aria-labelledby="myModal"
data-backdrop="static" data-keyboard="false"> data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width:80%;" role="document"> <div class="modal-dialog" style="width:60%;max-width:960px" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<div class="modal-title">提示讯息</div> <div class="modal-title">提示讯息</div>
...@@ -1141,7 +1144,7 @@ ...@@ -1141,7 +1144,7 @@
<div class="modal fade" id="helpPopDialog" help-pop tabindex="-1" role="dialog" aria-labelledby="myModal" <div class="modal fade" id="helpPopDialog" help-pop tabindex="-1" role="dialog" aria-labelledby="myModal"
data-backdrop="static" data-keyboard="false"> data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width:80%;" role="document"> <div class="modal-dialog" style="width:80%;max-width:1028px" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideFilePreviewPop()">×</span> <span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideFilePreviewPop()">×</span>
...@@ -1164,9 +1167,23 @@ ...@@ -1164,9 +1167,23 @@
<div class="wrapper TDL-pdf-preview-pop" id="pdfContainer"> <div class="wrapper TDL-pdf-preview-pop" id="pdfContainer">
<canvas id="the-canvas"></canvas> <canvas id="the-canvas"></canvas>
</div> </div>
<button class="TDL-pdf-preview-pop-close-btn" ng-click="closePdfPop()">x</button> <button class="TDL-pdf-preview-pop-close-btn" ng-click="closePdfPop()">×</button>
<button class="TDL-pdf-paging-btn TDL-pdf-paging-btn-prev" ng-click="prevPaging()" title="上一页">&lt;</button> <button class="TDL-pdf-paging-btn TDL-pdf-paging-btn-prev" ng-click="prevPaging()" title="上一页">&lt;</button>
<button class="TDL-pdf-paging-btn TDL-pdf-paging-btn-next" ng-click="nextPaging()" title="下一页">&gt;</button> <button class="TDL-pdf-paging-btn TDL-pdf-paging-btn-next" ng-click="nextPaging()" title="下一页">&gt;</button>
</div> </div>
<div class="modal fade" id="imgLayoutDialog" img-preview tabindex="-1" role="dialog" aria-labelledby="myModal"
data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width:80%;max-width:1028px" role="document">
<div class="modal-content">
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="closeImgPop()">×</span>
<div class="modal-title">{{curImgName}}</div>
</div>
<div class="modal-body" style="text-align: center;">
<img src="{{curImgSrc}}" alt="please try again">
</div>
</div>
</div>
</div>
</div> </div>
\ No newline at end of file
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