Commit 46cc61a9 authored by kevin's avatar kevin

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents 4682980b 40a16a73
...@@ -15,6 +15,7 @@ import pwc.taxtech.atms.entity.OperationLogFileType; ...@@ -15,6 +15,7 @@ import pwc.taxtech.atms.entity.OperationLogFileType;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 查询 * 查询
...@@ -99,7 +100,7 @@ public class FileTypesServiceImpl { ...@@ -99,7 +100,7 @@ public class FileTypesServiceImpl {
criteria.andFileTypeEqualTo(fileTypes.getFileType()); criteria.andFileTypeEqualTo(fileTypes.getFileType());
} }
List<FileTypes> results = fileTypesMapper.selectByExample(example); List<FileTypes> results = fileTypesMapper.selectByExample(example);
if (results.size() > 0) { if (results.size() > 0 && !results.stream().map(e->e.getId()).collect(Collectors.toList()).contains(fileTypes.getId())) {
throw new RuntimeException("filetype已存在: " + fileTypes.getFileType()); throw new RuntimeException("filetype已存在: " + fileTypes.getFileType());
} }
} }
...@@ -129,7 +130,6 @@ public class FileTypesServiceImpl { ...@@ -129,7 +130,6 @@ public class FileTypesServiceImpl {
@Transactional @Transactional
public boolean editFilesType(FileTypes fileTypes) { public boolean editFilesType(FileTypes fileTypes) {
try {
//检测添加类型是否已存在,存在则返回false先(后期改进为多异常) //检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
checkFileType(fileTypes); checkFileType(fileTypes);
//对必填字段进行转换成json对象 //对必填字段进行转换成json对象
...@@ -151,10 +151,6 @@ public class FileTypesServiceImpl { ...@@ -151,10 +151,6 @@ public class FileTypesServiceImpl {
} else { } else {
return false; return false;
} }
} catch (Exception e) {
log.error("FileTypesServiceImpl editFilesType error : " + e.getMessage());
return false;
}
} }
/** /**
......
...@@ -129,6 +129,10 @@ public class TaxDocumentServiceImpl { ...@@ -129,6 +129,10 @@ public class TaxDocumentServiceImpl {
criteria.andBusinessLineEqualTo(taxDocumentDto.getBusinessLine()); criteria.andBusinessLineEqualTo(taxDocumentDto.getBusinessLine());
} }
//公司名称 companyName //公司名称 companyName
if (StringUtils.isNotBlank(taxDocumentDto.getCompanyId())) {
criteria.andCompanyIdEqualTo(taxDocumentDto.getCompanyId());
}
//公司名称 companyName
if (StringUtils.isNotBlank(taxDocumentDto.getCompanyName())) { if (StringUtils.isNotBlank(taxDocumentDto.getCompanyName())) {
criteria.andCompanyNameEqualTo(taxDocumentDto.getCompanyName()); criteria.andCompanyNameEqualTo(taxDocumentDto.getCompanyName());
} }
...@@ -741,13 +745,6 @@ public class TaxDocumentServiceImpl { ...@@ -741,13 +745,6 @@ public class TaxDocumentServiceImpl {
*/ */
//档案类型分组:公司簡稱_档案类型_文件生效日期 //档案类型分组:公司簡稱_档案类型_文件生效日期
private final static Map<String, String> groupOfCompanyFileTypeFIleTime = Maps.newHashMap(); private final static Map<String, String> groupOfCompanyFileTypeFIleTime = Maps.newHashMap();
//档案类型分组:公司簡稱_档案类型_到期日
private final static Map<String, String> groupOfCompanyFileTypeEffectiveTime = Maps.newHashMap();
//档案类型分组:公司簡稱_档案属性_档案类型(国际档案类型,因为此处英文有重复键,所以多个分组)
private final static Map<String, String> internationalGroupOfCompanyFileAttrFileType1 = Maps.newHashMap();
private final static Map<String, String> internationalGroupOfCompanyFileAttrFileType2 = Maps.newHashMap();
private final static Map<String, String> internationalGroupOfCompanyFileAttrFileType3 = Maps.newHashMap();
private final static Map<String, String> internationalGroupOfCompanyFileAttrFileType4 = Maps.newHashMap();
/** /**
* 分组 长度为4 * 分组 长度为4
*/ */
...@@ -755,6 +752,8 @@ public class TaxDocumentServiceImpl { ...@@ -755,6 +752,8 @@ public class TaxDocumentServiceImpl {
private final static Map<String, String> groupOfCompanyFileTypeOwnTimeFileTime = Maps.newHashMap(); private final static Map<String, String> groupOfCompanyFileTypeOwnTimeFileTime = Maps.newHashMap();
//档案类型分组:公司簡稱_档案类型_所属期间_到期日 //档案类型分组:公司簡稱_档案类型_所属期间_到期日
private final static Map<String, String> groupOfCompanyFileTypeOwnTimeEffectiveTime = Maps.newHashMap(); private final static Map<String, String> groupOfCompanyFileTypeOwnTimeEffectiveTime = Maps.newHashMap();
//档案类型分组:公司簡稱_档案属性_档案类型_文件生效日期
private final static Map<String, String> internationalGroupOfCompanyFileAttrFileTypeFileTime = Maps.newHashMap();
//档案类型分组:公司簡稱_档案属性_档案类型_所属期间(国际档案类型) //档案类型分组:公司簡稱_档案属性_档案类型_所属期间(国际档案类型)
private final static Map<String, String> internationalGroupOfCompanyFileAttrFileTypeOwnTime = Maps.newHashMap(); private final static Map<String, String> internationalGroupOfCompanyFileAttrFileTypeOwnTime = Maps.newHashMap();
/** /**
...@@ -773,12 +772,10 @@ public class TaxDocumentServiceImpl { ...@@ -773,12 +772,10 @@ public class TaxDocumentServiceImpl {
//初始化档案类型-档案属性map列表(后续可做成从数据库中拿) //初始化档案类型-档案属性map列表(后续可做成从数据库中拿)
static { static {
//添加分组 //添加分组
//公司簡稱_档案类型_文件生效日期 //公司簡稱_档案类型_文件生效日期
setGroupOfCompanyFileTypeFIleTime(); setGroupOfCompanyFileTypeFIleTime();
//公司簡稱_档案类型_到期日 //公司簡稱_档案属性_档案类型_文件生效日期
setGroupOfCompanyFileTypeEffectiveTime(); setInternationalGroupOfCompanyFileAttrFileTypeFileTime();
//公司簡稱_档案属性_档案类型
setInternationalGroupOfCompanyFileAttrFileType();
//公司簡稱_档案类型_所属期间_文件生效日期 //公司簡稱_档案类型_所属期间_文件生效日期
setGroupOfCompanyFileTypeOwnTimeFileTime(); setGroupOfCompanyFileTypeOwnTimeFileTime();
//公司簡稱_档案类型_所属期间_到期日 //公司簡稱_档案类型_所属期间_到期日
...@@ -811,48 +808,38 @@ public class TaxDocumentServiceImpl { ...@@ -811,48 +808,38 @@ public class TaxDocumentServiceImpl {
groupOfCompanyFileTypeFIleTime.put("发票核销资料", "06 发票管理类"); groupOfCompanyFileTypeFIleTime.put("发票核销资料", "06 发票管理类");
groupOfCompanyFileTypeFIleTime.put("开具红字发票资料", "06 发票管理类"); groupOfCompanyFileTypeFIleTime.put("开具红字发票资料", "06 发票管理类");
groupOfCompanyFileTypeFIleTime.put("非居民享受税收协定待遇认定", "02 税务认定类"); groupOfCompanyFileTypeFIleTime.put("非居民享受税收协定待遇认定", "02 税务认定类");
groupOfCompanyFileTypeFIleTime.put("汇总(合并)纳税企业信息备案资料", "01 税务登记类");
groupOfCompanyFileTypeFIleTime.put("发票票种核定资料", "06 发票管理类");
groupOfCompanyFileTypeFIleTime.put("发票用票量调整资料", "06 发票管理类");
groupOfCompanyFileTypeFIleTime.put("增值税税收优惠资料", "03 税收优惠类");
groupOfCompanyFileTypeFIleTime.put("车辆购置税税收优惠资料", "03 税收优惠类");
groupOfCompanyFileTypeFIleTime.put("企业所得税税收优惠资料", "03 税收优惠类");
groupOfCompanyFileTypeFIleTime.put("税收减免审批资料", "03 税收优惠类");
groupOfCompanyFileTypeFIleTime.put("税收减免备案资料", "03 税收优惠类");
groupOfCompanyFileTypeFIleTime.put("纳税申报方式认定", "02 税务认定类");
groupOfCompanyFileTypeFIleTime.put("一般纳税人认定", "02 税务认定类");
groupOfCompanyFileTypeFIleTime.put("征收方式认定", "02 税务认定类");
groupOfCompanyFileTypeFIleTime.put("税种核定资料", "04 申报征收类");
} }
/** /**
* 公司簡稱_档案类型_到期日 * 公司簡稱_档案属性_档案类型_文件生效日期
*/
private static void setGroupOfCompanyFileTypeEffectiveTime() {
groupOfCompanyFileTypeEffectiveTime.put("汇总(合并)纳税企业信息备案资料", "01 税务登记类");
groupOfCompanyFileTypeEffectiveTime.put("发票票种核定资料", "06 发票管理类");
groupOfCompanyFileTypeEffectiveTime.put("发票用票量调整资料", "06 发票管理类");
groupOfCompanyFileTypeEffectiveTime.put("增值税税收优惠资料", "03 税收优惠类");
groupOfCompanyFileTypeEffectiveTime.put("车辆购置税税收优惠资料", "03 税收优惠类");
groupOfCompanyFileTypeEffectiveTime.put("企业所得税税收优惠资料", "03 税收优惠类");
groupOfCompanyFileTypeEffectiveTime.put("税收减免审批资料", "03 税收优惠类");
groupOfCompanyFileTypeEffectiveTime.put("税收减免备案资料", "03 税收优惠类");
groupOfCompanyFileTypeEffectiveTime.put("纳税申报方式认定", "02 税务认定类");
groupOfCompanyFileTypeEffectiveTime.put("一般纳税人认定", "02 税务认定类");
groupOfCompanyFileTypeEffectiveTime.put("征收方式认定", "02 税务认定类");
groupOfCompanyFileTypeEffectiveTime.put("税种核定资料", "04 申报征收类");
}
/**
* 公司簡稱_档案属性_档案类型(因为此处英文有重复键,所以多个分组)
*/ */
private static void setInternationalGroupOfCompanyFileAttrFileType() { private static void setInternationalGroupOfCompanyFileAttrFileTypeFileTime() {
//因为此处英文有重复键,所以多个分组区分开 internationalGroupOfCompanyFileAttrFileTypeFileTime.put("Legal Document - Other", "International Tax - Legal Document");
internationalGroupOfCompanyFileAttrFileType1.put("Other", "International Tax - Legal Document"); internationalGroupOfCompanyFileAttrFileTypeFileTime.put("Ruling Application documents", "International tax - Tax Rulings");
internationalGroupOfCompanyFileAttrFileType1.put("Application documents", "International tax - Tax Rulings"); internationalGroupOfCompanyFileAttrFileTypeFileTime.put("Incentive Approval documents", "International tax - Tax Incentives");
internationalGroupOfCompanyFileAttrFileType1.put("Approval documents", "International tax - Tax Incentives"); internationalGroupOfCompanyFileAttrFileTypeFileTime.put("Article of incorporation", "International Tax - Legal Document");
internationalGroupOfCompanyFileAttrFileType1.put("Article of incorporation", "International Tax - Legal Document"); internationalGroupOfCompanyFileAttrFileTypeFileTime.put("Business registration", "International Tax - Legal Document");
internationalGroupOfCompanyFileAttrFileType1.put("Business registration", "International Tax - Legal Document"); internationalGroupOfCompanyFileAttrFileTypeFileTime.put("CIT", "International Tax - Tax Registration");
internationalGroupOfCompanyFileAttrFileType1.put("CIT", "International Tax - Tax Registration"); internationalGroupOfCompanyFileAttrFileTypeFileTime.put("VAT", "International Tax - Tax Registration");
internationalGroupOfCompanyFileAttrFileType1.put("VAT", "International Tax - Tax Registration"); internationalGroupOfCompanyFileAttrFileTypeFileTime.put("Letter from Tax Authority", "International Tax - Tax Inspection");
internationalGroupOfCompanyFileAttrFileType1.put("Letter from Tax Authority", "International Tax - Tax Inspection"); internationalGroupOfCompanyFileAttrFileTypeFileTime.put("Reply letter and supporting", "International Tax - Tax Inspection");
internationalGroupOfCompanyFileAttrFileType1.put("Reply letter and supporting", "International Tax - Tax Inspection"); internationalGroupOfCompanyFileAttrFileTypeFileTime.put("Tax Registration - Other", "International Tax - Tax Registration");
internationalGroupOfCompanyFileAttrFileTypeFileTime.put("Incentive Application documents", "International tax - Tax Incentives");
internationalGroupOfCompanyFileAttrFileType2.put("Other", "International Tax - Tax Registration"); internationalGroupOfCompanyFileAttrFileTypeFileTime.put("Ruling Approval documents", "International tax - Tax Rulings");
internationalGroupOfCompanyFileAttrFileType2.put("Application documents", "International tax - Tax Incentives"); internationalGroupOfCompanyFileAttrFileTypeFileTime.put("Tax Incentives - Other", "International tax - Tax Incentives");
internationalGroupOfCompanyFileAttrFileType2.put("Approval documents", "International tax - Tax Rulings"); internationalGroupOfCompanyFileAttrFileTypeFileTime.put("Tax Inspection - Other", "International Tax - Tax Inspection");
internationalGroupOfCompanyFileAttrFileType3.put("Other", "International tax - Tax Incentives");
internationalGroupOfCompanyFileAttrFileType4.put("Other", "International Tax - Tax Inspection");
} }
/** /**
...@@ -967,107 +954,87 @@ public class TaxDocumentServiceImpl { ...@@ -967,107 +954,87 @@ public class TaxDocumentServiceImpl {
*/ */
private void matchFileTypeToInitData(ArrayList<String> errorFileNameList, ArrayList<String> successeFileNameList, ArrayList<String> existedFileNameList, Map<String, String> companyNameAndId, File file, List<String> params, String filePath) { private void matchFileTypeToInitData(ArrayList<String> errorFileNameList, ArrayList<String> successeFileNameList, ArrayList<String> existedFileNameList, Map<String, String> companyNameAndId, File file, List<String> params, String filePath) {
//长度为3(先验证是否国际类型并校验匹配,若是国际类型档案类型索引为2(国际类型第三个为档案类型),否则索引为1为档案类型 //长度为3(先验证是否国际类型并校验匹配,若是国际类型档案类型索引为2(国际类型第三个为档案类型),否则索引为1为档案类型
if (params.size() == 3 if (params.size() == 3//公司簡稱_档案类型_文件生效日期
&& (//国际类型 公司簡稱_档案属性_档案类型
(internationalGroupOfCompanyFileAttrFileType1.keySet().contains(params.get(2))
&& internationalGroupOfCompanyFileAttrFileType1.values().contains(params.get(1)))
||
(internationalGroupOfCompanyFileAttrFileType2.keySet().contains(params.get(2))
&& internationalGroupOfCompanyFileAttrFileType2.values().contains(params.get(1)))
||
(internationalGroupOfCompanyFileAttrFileType3.keySet().contains(params.get(2))
&& internationalGroupOfCompanyFileAttrFileType3.values().contains(params.get(1)))
||
(internationalGroupOfCompanyFileAttrFileType4.keySet().contains(params.get(2))
&& internationalGroupOfCompanyFileAttrFileType4.values().contains(params.get(1))))) {
//构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId, params, file.getName());
//设置档案属性 档案类型
taxDocument.setFileAttr(params.get(1));
taxDocument.setFileType(params.get(2));
//校验是否已存在
checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument, filePath);
} else if (params.size() == 3//公司簡稱_档案类型_文件生效日期
&& groupOfCompanyFileTypeFIleTime.keySet().contains(params.get(1)) && groupOfCompanyFileTypeFIleTime.keySet().contains(params.get(1))
&& null != DateUtils.stringToDate4yyyyMMdd(params.get(2))) {//文件生效日期校验 && null != DateUtils.stringToDate4yyyyMMdd(params.get(2))){//文件生效日期校验
//构建基础对象 设置基础值 公司简称 Id 文件名 //构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId, params, file.getName()); TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId,params,file.getName());
//设置档案属性 档案类型 文件生效日期 //设置档案属性 档案类型 文件生效日期
taxDocument.setFileType(params.get(1)); taxDocument.setFileType(params.get(1));
taxDocument.setFileAttr(groupOfCompanyFileTypeFIleTime.get(params.get(1))); taxDocument.setFileAttr(groupOfCompanyFileTypeFIleTime.get(params.get(1)));
taxDocument.setFileTime(DateUtils.stringToDate4yyyyMMdd(params.get(2))); taxDocument.setFileTime(DateUtils.stringToDate4yyyyMMdd(params.get(2)));
//校验是否已存在 //校验是否已存在
checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument, filePath); checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument,filePath);
} else if (params.size() == 3//公司簡稱_档案类型_到期日 }else if (params.size() == 4 //国际类型 公司簡稱_档案属性_档案类型_文件生效日期
&& groupOfCompanyFileTypeEffectiveTime.keySet().contains(params.get(1)) && (internationalGroupOfCompanyFileAttrFileTypeFileTime.keySet().contains(params.get(2))
&& null != DateUtils.stringToDate4yyyyMMdd(params.get(2))) {//到期日校验 && internationalGroupOfCompanyFileAttrFileTypeFileTime.values().contains(params.get(1)))
&& null != DateUtils.stringToDate4yyyyMMdd(params.get(3))){//文件生效日期校验
//构建基础对象 设置基础值 公司简称 Id 文件名 //构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId, params, file.getName()); TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId,params,file.getName());
//设置档案属性 档案类型 到期日 //设置档案属性 档案类型
taxDocument.setFileType(params.get(1)); taxDocument.setFileAttr(params.get(1));
taxDocument.setFileAttr(groupOfCompanyFileTypeEffectiveTime.get(params.get(1))); taxDocument.setFileType(params.get(2));
taxDocument.setEffectiveTime(DateUtils.stringToDate4yyyyMMdd(params.get(2)));
//校验是否已存在 //校验是否已存在
checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument, filePath); checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument,filePath);
} else if (params.size() == 4 //国际类型 公司簡稱_档案属性_档案类型_所属期间 }else if (params.size() == 4 //国际类型 公司簡稱_档案属性_档案类型_所属期间
&& (internationalGroupOfCompanyFileAttrFileTypeOwnTime.keySet().contains(params.get(2)) && (internationalGroupOfCompanyFileAttrFileTypeOwnTime.keySet().contains(params.get(2))
&& internationalGroupOfCompanyFileAttrFileTypeOwnTime.values().contains(params.get(1))) && internationalGroupOfCompanyFileAttrFileTypeOwnTime.values().contains(params.get(1)))
&& checkOwnTime(params.get(3))) {//所属期间校验 && checkOwnTime(params.get(3))){//所属期间校验
//构建基础对象 设置基础值 公司简称 Id 文件名 //构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId, params, file.getName()); TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId,params,file.getName());
//设置档案属性 档案类型 所属期间 //设置档案属性 档案类型 所属期间
taxDocument.setFileAttr(params.get(1)); taxDocument.setFileAttr(params.get(1));
taxDocument.setFileType(params.get(2)); taxDocument.setFileType(params.get(2));
taxDocument.setOwnTime(Integer.valueOf(params.get(3))); taxDocument.setOwnTime(Integer.valueOf(params.get(3)));
//校验是否已存在 //校验是否已存在
checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument, filePath); checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument,filePath);
} else if (params.size() == 4 //公司簡稱_档案类型_所属期间_文件生效日期 }else if (params.size() == 4 //公司簡稱_档案类型_所属期间_文件生效日期
&& groupOfCompanyFileTypeOwnTimeFileTime.keySet().contains(params.get(1)) && groupOfCompanyFileTypeOwnTimeFileTime.keySet().contains(params.get(1))
&& checkOwnTime(params.get(2))//所属期间校验 && checkOwnTime(params.get(2))//所属期间校验
&& null != DateUtils.stringToDate4yyyyMMdd(params.get(3))) {//文件生效日期校验 && null != DateUtils.stringToDate4yyyyMMdd(params.get(3))){//文件生效日期校验
//构建基础对象 设置基础值 公司简称 Id 文件名 //构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId, params, file.getName()); TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId,params,file.getName());
//设置档案类型 档案属性 所属期间 文件生效日期 //设置档案类型 档案属性 所属期间 文件生效日期
taxDocument.setFileType(params.get(1)); taxDocument.setFileType(params.get(1));
taxDocument.setFileAttr(groupOfCompanyFileTypeOwnTimeFileTime.get(params.get(1))); taxDocument.setFileAttr(groupOfCompanyFileTypeOwnTimeFileTime.get(params.get(1)));
taxDocument.setOwnTime(Integer.valueOf(params.get(2))); taxDocument.setOwnTime(Integer.valueOf(params.get(2)));
taxDocument.setFileTime(DateUtils.stringToDate4yyyyMMdd(params.get(3))); taxDocument.setFileTime(DateUtils.stringToDate4yyyyMMdd(params.get(3)));
//校验是否已存在 //校验是否已存在
checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument, filePath); checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument,filePath);
} else if (params.size() == 4 //公司簡稱_档案类型_所属期间_到期日 }else if (params.size() == 4 //公司簡稱_档案类型_所属期间_到期日
&& groupOfCompanyFileTypeOwnTimeEffectiveTime.keySet().contains(params.get(1)) && groupOfCompanyFileTypeOwnTimeEffectiveTime.keySet().contains(params.get(1))
&& checkOwnTime(params.get(2))//所属期间校验 && checkOwnTime(params.get(2))//所属期间校验
&& null != DateUtils.stringToDate4yyyyMMdd(params.get(3))) {//到期日校验 && null != DateUtils.stringToDate4yyyyMMdd(params.get(3))){//到期日校验
//构建基础对象 设置基础值 公司简称 Id 文件名 //构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId, params, file.getName()); TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId,params,file.getName());
//设置档案类型 档案属性 所属期间 到期日 //设置档案类型 档案属性 所属期间 到期日
taxDocument.setFileType(params.get(1)); taxDocument.setFileType(params.get(1));
taxDocument.setFileAttr(groupOfCompanyFileTypeOwnTimeEffectiveTime.get(params.get(1))); taxDocument.setFileAttr(groupOfCompanyFileTypeOwnTimeEffectiveTime.get(params.get(1)));
taxDocument.setOwnTime(Integer.valueOf(params.get(2))); taxDocument.setOwnTime(Integer.valueOf(params.get(2)));
taxDocument.setEffectiveTime(DateUtils.stringToDate4yyyyMMdd(params.get(3))); taxDocument.setEffectiveTime(DateUtils.stringToDate4yyyyMMdd(params.get(3)));
//校验是否已存在 //校验是否已存在
checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument, filePath); checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument,filePath);
} else if (params.size() == 5 //国际类型 公司簡稱_档案属性_档案类型_税种_所属期间 }else if (params.size() == 5 //国际类型 公司簡稱_档案属性_档案类型_税种_所属期间
&& (internationalGroupOfCompanyFileAttrFileTypeTaxTypeOwnTime.keySet().contains(params.get(2)) && (internationalGroupOfCompanyFileAttrFileTypeTaxTypeOwnTime.keySet().contains(params.get(2))
&& internationalGroupOfCompanyFileAttrFileTypeTaxTypeOwnTime.values().contains(params.get(1))) && internationalGroupOfCompanyFileAttrFileTypeTaxTypeOwnTime.values().contains(params.get(1)))
&& taxsList.contains(params.get(3))//税种校验 && taxsList.contains(params.get(3))//税种校验
&& checkOwnTime(params.get(4))) {//所属期间校验 && checkOwnTime(params.get(4))){//所属期间校验
//构建基础对象 设置基础值 公司简称 Id 文件名 //构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId, params, file.getName()); TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId,params,file.getName());
//设置档案属性 档案类型 税种 所属期间 //设置档案属性 档案类型 税种 所属期间
taxDocument.setFileAttr(params.get(1)); taxDocument.setFileAttr(params.get(1));
taxDocument.setFileType(params.get(2)); taxDocument.setFileType(params.get(2));
taxDocument.setTaxType(params.get(3)); taxDocument.setTaxType(params.get(3));
taxDocument.setOwnTime(Integer.valueOf(params.get(4))); taxDocument.setOwnTime(Integer.valueOf(params.get(4)));
//校验是否已存在 //校验是否已存在
checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument, filePath); checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument,filePath);
} else if (params.size() == 5 //公司簡稱_档案类型_税种_所属期间_文件生效日期 }else if (params.size() == 5 //公司簡稱_档案类型_税种_所属期间_文件生效日期
&& groupOfCompanyFileTypeTaxTypeOwnTimeFileTime.keySet().contains(params.get(1)) && groupOfCompanyFileTypeTaxTypeOwnTimeFileTime.keySet().contains(params.get(1))
&& taxsList.contains(params.get(2))//税种校验 && taxsList.contains(params.get(2))//税种校验
&& checkOwnTime(params.get(3))//所属期间校验 && checkOwnTime(params.get(3))//所属期间校验
&& null != DateUtils.stringToDate4yyyyMMdd(params.get(4))) {//文件生效日期校验 && null != DateUtils.stringToDate4yyyyMMdd(params.get(4))){//文件生效日期校验
//构建基础对象 设置基础值 公司简称 Id 文件名 //构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId, params, file.getName()); TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId,params,file.getName());
//设置档案类型 档案属性 税种 所属期间 文件生效日期 //设置档案类型 档案属性 税种 所属期间 文件生效日期
taxDocument.setFileType(params.get(1)); taxDocument.setFileType(params.get(1));
taxDocument.setFileAttr(groupOfCompanyFileTypeTaxTypeOwnTimeFileTime.get(params.get(1))); taxDocument.setFileAttr(groupOfCompanyFileTypeTaxTypeOwnTimeFileTime.get(params.get(1)));
...@@ -1075,13 +1042,13 @@ public class TaxDocumentServiceImpl { ...@@ -1075,13 +1042,13 @@ public class TaxDocumentServiceImpl {
taxDocument.setOwnTime(Integer.valueOf(params.get(3))); taxDocument.setOwnTime(Integer.valueOf(params.get(3)));
taxDocument.setFileTime(DateUtils.stringToDate4yyyyMMdd(params.get(4))); taxDocument.setFileTime(DateUtils.stringToDate4yyyyMMdd(params.get(4)));
//校验是否已存在 //校验是否已存在
checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument, filePath); checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument,filePath);
} else if (params.size() == 6 //公司簡稱_档案类型_所属期间_文件生效日期_实物存放地点_实物保管人 }else if (params.size() == 6 //公司簡稱_档案类型_所属期间_文件生效日期_实物存放地点_实物保管人
&& groupOfCompanyFileTypeOwnTimeFileTimeStorageAreaKeeper.keySet().contains(params.get(1)) && groupOfCompanyFileTypeOwnTimeFileTimeStorageAreaKeeper.keySet().contains(params.get(1))
&& checkOwnTime(params.get(2))//所属期间校验 && checkOwnTime(params.get(2))//所属期间校验
&& null != DateUtils.stringToDate4yyyyMMdd(params.get(3))) {//文件生效日期校验 && null != DateUtils.stringToDate4yyyyMMdd(params.get(3))){//文件生效日期校验
//构建基础对象 设置基础值 公司简称 Id 文件名 //构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId, params, file.getName()); TaxDocument taxDocument = buildBaseTaxDocument(companyNameAndId,params,file.getName());
//设置档案类型 档案属性 所属期间 文件生效日期 实物存放地点 实物保管人 //设置档案类型 档案属性 所属期间 文件生效日期 实物存放地点 实物保管人
taxDocument.setFileType(params.get(1)); taxDocument.setFileType(params.get(1));
taxDocument.setFileAttr(groupOfCompanyFileTypeOwnTimeFileTimeStorageAreaKeeper.get(params.get(1))); taxDocument.setFileAttr(groupOfCompanyFileTypeOwnTimeFileTimeStorageAreaKeeper.get(params.get(1)));
...@@ -1090,8 +1057,8 @@ public class TaxDocumentServiceImpl { ...@@ -1090,8 +1057,8 @@ public class TaxDocumentServiceImpl {
taxDocument.setStorageArea(params.get(4)); taxDocument.setStorageArea(params.get(4));
taxDocument.setKeeper(params.get(5)); taxDocument.setKeeper(params.get(5));
//校验是否已存在 //校验是否已存在
checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument, filePath); checkExistedAndInsertOrUpdate(successeFileNameList, existedFileNameList, file, taxDocument,filePath);
} else { }else {
errorFileNameList.add(filePath); errorFileNameList.add(filePath);
} }
} }
......
...@@ -237,7 +237,8 @@ grunt.initConfig({ ...@@ -237,7 +237,8 @@ grunt.initConfig({
"Scripts/viewer/viewer.js", "Scripts/viewer/viewer.js",
"Scripts/xlsx/shim.min.js", "Scripts/xlsx/shim.min.js",
"Scripts/xlsx/xlsx.full.min.js", "Scripts/xlsx/xlsx.full.min.js",
"Scripts/position-calculator/position-calculator.min.js" "Scripts/position-calculator/position-calculator.min.js",
"Scripts/bootstrp-confirm/bootstrap-confirm.js"
], ],
dest: '<%= pkg.bundleTemp %>/util.js' dest: '<%= pkg.bundleTemp %>/util.js'
}, },
......
(function ($) {
window.Ewin = function () {
var html = '<div id="[Id]" class="modal fade" role="dialog" aria-labelledby="modalLabel">' +
'<div class="modal-dialog modal-sm">' +
'<div class="modal-content">' +
'<div class="modal-header">' +
'<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>' +
'<h4 class="modal-title" id="modalLabel">[Title]</h4>' +
'</div>' +
'<div class="modal-body">' +
'<p>[Message]</p>' +
'</div>' +
'<div class="modal-footer">' +
'<button type="button" class="btn btn-default cancel" data-dismiss="modal">[BtnCancel]</button>' +
'<button type="button" class="btn btn-primary ok" data-dismiss="modal">[BtnOk]</button>' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
var dialogdHtml = '<div id="[Id]" class="modal fade" role="dialog" aria-labelledby="modalLabel">' +
'<div class="modal-dialog">' +
'<div class="modal-content">' +
'<div class="modal-header">' +
'<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>' +
'<h4 class="modal-title" id="modalLabel">[Title]</h4>' +
'</div>' +
'<div class="modal-body">' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
var reg = new RegExp("\\[([^\\[\\]]*?)\\]", 'igm');
var generateId = function () {
var date = new Date();
return 'mdl' + date.valueOf();
}
var init = function (options) {
options = $.extend({}, {
title: "操作提示",
message: "提示内容",
btnok: "确定",
btncl: "取消",
width: 200,
auto: false
}, options || {});
var modalId = generateId();
var content = html.replace(reg, function (node, key) {
return {
Id: modalId,
Title: options.title,
Message: options.message,
BtnOk: options.btnok,
BtnCancel: options.btncl
}[key];
});
$('body').append(content);
$('#' + modalId).modal({
width: options.width,
backdrop: 'static'
});
$('#' + modalId).on('hide.bs.modal', function (e) {
$('body').find('#' + modalId).remove();
});
return modalId;
}
return {
alert: function (options) {
if (typeof options == 'string') {
options = {
message: options
};
}
var id = init(options);
var modal = $('#' + id);
modal.find('.ok').removeClass('btn-success').addClass('btn-primary');
modal.find('.cancel').hide();
return {
id: id,
on: function (callback) {
if (callback && callback instanceof Function) {
modal.find('.ok').click(function () { callback(true); });
}
},
hide: function (callback) {
if (callback && callback instanceof Function) {
modal.on('hide.bs.modal', function (e) {
callback(e);
});
}
}
};
},
confirm: function (options) {
var id = init(options);
var modal = $('#' + id);
modal.find('.ok').removeClass('btn-primary').addClass('btn-success');
modal.find('.cancel').show();
return {
id: id,
on: function (callback) {
if (callback && callback instanceof Function) {
modal.find('.ok').click(function () { callback(true); });
modal.find('.cancel').click(function () { callback(false); });
}
},
hide: function (callback) {
if (callback && callback instanceof Function) {
modal.on('hide.bs.modal', function (e) {
callback(e);
});
}
}
};
},
dialog: function (options) {
options = $.extend({}, {
title: 'title',
url: '',
width: 800,
height: 550,
onReady: function () { },
onShown: function (e) { }
}, options || {});
var modalId = generateId();
var content = dialogdHtml.replace(reg, function (node, key) {
return {
Id: modalId,
Title: options.title
}[key];
});
$('body').append(content);
var target = $('#' + modalId);
target.find('.modal-body').load(options.url);
if (options.onReady())
options.onReady.call(target);
target.modal();
target.on('shown.bs.modal', function (e) {
if (options.onReady(e))
options.onReady.call(target, e);
});
target.on('hide.bs.modal', function (e) {
$('body').find(target).remove();
});
}
}
}();
})(jQuery);
\ No newline at end of file
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
}; };
$scope.dataGridUpdate = function (_data) { $scope.dataGridUpdate = function (_data) {
$scope.localData = _data.items; $scope.localData = _data.items;
$scope.queryStatusType($scope.localData); $scope.queryStatusType($scope.localData);
$scope.pagingOptions = { $scope.pagingOptions = {
totalItems: $scope.localData.length, //总数据 totalItems: $scope.localData.length, //总数据
...@@ -328,6 +327,9 @@ ...@@ -328,6 +327,9 @@
} else { } else {
SweetAlert.warning($translate.instant('SaveFail')); SweetAlert.warning($translate.instant('SaveFail'));
} }
if(data.code==-1){
SweetAlert.warning($translate.instant(data.message));
}
}); });
$('#editPopDialog').modal('hide'); $('#editPopDialog').modal('hide');
}; };
......
...@@ -2159,6 +2159,7 @@ ...@@ -2159,6 +2159,7 @@
}; };
// 取消编辑机构其他信息 // 取消编辑机构其他信息
// TODO 将这个方法添加到切换功能里
$scope.updateOrgExtraCancel = function () { $scope.updateOrgExtraCancel = function () {
$scope.selectCompanyExtra = $scope.comExtraOldData; $scope.selectCompanyExtra = $scope.comExtraOldData;
$scope.editOrgExtraModel = $scope.editOldData; $scope.editOrgExtraModel = $scope.editOldData;
...@@ -2397,6 +2398,8 @@ ...@@ -2397,6 +2398,8 @@
// 选中机构 // 选中机构
$scope.selectOrganization = function (branch) { $scope.selectOrganization = function (branch) {
var org = branch.data; var org = branch.data;
$scope.output = "You selected: " + org.id; $scope.output = "You selected: " + org.id;
...@@ -2446,6 +2449,8 @@ ...@@ -2446,6 +2449,8 @@
loadUserRoleList(org.id); loadUserRoleList(org.id);
generalSelectCompanyText(); generalSelectCompanyText();
cancelWebChange(); cancelWebChange();
$scope.updateOrgExtraCancel()
}); });
......
...@@ -19,7 +19,7 @@ frameworkModule.controller('appUsrOperateLogController', ...@@ -19,7 +19,7 @@ frameworkModule.controller('appUsrOperateLogController',
} }
}); });
} }
if($scope.thisModuleId.length===0){ if($("body[ng-controller='AppController']").length==1 && $scope.thisModuleId.length===0){
SweetAlert.warning($translate.instant("NeedChecked")); SweetAlert.warning($translate.instant("NeedChecked"));
return; return;
} }
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
*/ */
taxDocumentManageModule.controller('taxDocumentListController', taxDocumentManageModule.controller('taxDocumentListController',
['$log', '$http', '$q', '$scope', '$translate', '$timeout', ['$log', '$http', '$q', '$scope', '$translate', '$timeout',
'SweetAlert', '$compile', 'taxDocumentListService', '$filter','apiInterceptor', 'SweetAlert', '$compile', 'taxDocumentListService', '$filter', 'apiInterceptor',
function ($log, $http, $q, $scope, $translate, $timeout, function ($log, $http, $q, $scope, $translate, $timeout,
SweetAlert, $compile, taxDocumentListService, $filter,apiInterceptor) { SweetAlert, $compile, taxDocumentListService, $filter, apiInterceptor) {
$scope.queryFieldModel = {}; $scope.queryFieldModel = {};
$scope.editFieldModel = {}; $scope.editFieldModel = {};
...@@ -23,14 +23,15 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -23,14 +23,15 @@ 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.fileBeginTime = getQueryDate(params.fileBeginTime, "-");
params.fileEndTTime = getQueryDate(params.fileEndTTime,"-"); params.fileEndTTime = getQueryDate(params.fileEndTTime, "-");
// params.ownBeginTime = getQueryDate(params.ownBeginTime,"-"); // params.ownBeginTime = getQueryDate(params.ownBeginTime,"-");
// params.ownEndTime = getQueryDate(params.ownEndTime,"-"); // params.ownEndTime = getQueryDate(params.ownEndTime,"-");
params.effectiveBeginTime = getQueryDate(params.effectiveBeginTime,"-"); params.effectiveBeginTime = getQueryDate(params.effectiveBeginTime, "-");
params.effectiveEndTime = getQueryDate(params.effectiveEndTime,"-"); params.effectiveEndTime = getQueryDate(params.effectiveEndTime, "-");
params.uploadBeginTime = getQueryDate(params.uploadBeginTime,"-"); params.uploadBeginTime = getQueryDate(params.uploadBeginTime, "-");
params.uploadEndTime = getQueryDate(params.uploadEndTime,"-"); params.uploadEndTime = getQueryDate(params.uploadEndTime, "-");
function getQueryDate(time, mark) { function getQueryDate(time, mark) {
if (!time) return ""; if (!time) return "";
var theDate = new Date(time); var theDate = new Date(time);
...@@ -41,6 +42,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -41,6 +42,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
dd = (dd + "").length < 2 ? "0" + dd : dd; dd = (dd + "").length < 2 ? "0" + dd : dd;
return year + mark + mm + mark + dd; return year + mark + mm + mark + dd;
} }
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"));
...@@ -51,36 +53,34 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -51,36 +53,34 @@ taxDocumentManageModule.controller('taxDocumentListController',
}) })
}; };
function checkReminder(){
var items=$scope.queryFieldModel; function checkReminder() {
var message=""; var items = $scope.queryFieldModel;
var message = "";
if (!PWC.isNullOrEmpty(items.fileBeginTime) && !PWC.isNullOrEmpty(items.fileEndTTime) && if (!PWC.isNullOrEmpty(items.fileBeginTime) && !PWC.isNullOrEmpty(items.fileEndTTime) &&
items.fileBeginTime > items.fileEndTTime) items.fileBeginTime > items.fileEndTTime) {
{ message += $translate.instant('AvailabilityDate') + ",";
message+=$translate.instant('AvailabilityDate')+",";
} }
if (!PWC.isNullOrEmpty(items.ownBeginTime) && !PWC.isNullOrEmpty(items.ownEndTime) && if (!PWC.isNullOrEmpty(items.ownBeginTime) && !PWC.isNullOrEmpty(items.ownEndTime) &&
items.ownBeginTime > items.ownEndTime) items.ownBeginTime > items.ownEndTime) {
{ message += $translate.instant('Duration') + ",";
message+=$translate.instant('Duration')+",";
} }
if (!PWC.isNullOrEmpty(items.effectiveBeginTime) && !PWC.isNullOrEmpty(items.effectiveEndTime) && if (!PWC.isNullOrEmpty(items.effectiveBeginTime) && !PWC.isNullOrEmpty(items.effectiveEndTime) &&
items.effectiveBeginTime > items.effectiveEndTime) items.effectiveBeginTime > items.effectiveEndTime) {
{ message += $translate.instant('DueDate') + ",";
message+=$translate.instant('DueDate')+",";
} }
if (!PWC.isNullOrEmpty(items.uploadBeginTime) && !PWC.isNullOrEmpty(items.uploadEndTime) && if (!PWC.isNullOrEmpty(items.uploadBeginTime) && !PWC.isNullOrEmpty(items.uploadEndTime) &&
items.uploadBeginTime > items.uploadEndTime) items.uploadBeginTime > items.uploadEndTime) {
{ message += $translate.instant('UploadDate') + ",";
message+=$translate.instant('UploadDate')+",";
} }
if(message){ if (message) {
message = (message.substring(message.length - 1) == ',') ? message.substring(0, message.length - 1) : message; message = (message.substring(message.length - 1) == ',') ? message.substring(0, message.length - 1) : message;
message+="-"+$translate.instant('DateWarningSearch'); message += "-" + $translate.instant('DateWarningSearch');
window.swal(message); window.swal(message);
return; return;
} }
} }
$scope.dataGridUpdate = function (_data) { $scope.dataGridUpdate = function (_data) {
$scope.localData = _data.list; $scope.localData = _data.list;
$scope.pagingOptions.pageIndex = _data.pageNo; $scope.pagingOptions.pageIndex = _data.pageNo;
...@@ -307,74 +307,73 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -307,74 +307,73 @@ taxDocumentManageModule.controller('taxDocumentListController',
], ],
onCellClick: function (e) { onCellClick: function (e) {
//单元格点击— e.columnIndex=0 排除复选框列 //单元格点击— e.columnIndex=0 排除复选框列
if(e.columnIndex>0 && e.data){ if (e.columnIndex > 0 && e.data) {
$("input[name='dataGridCheckBox']").each(function (index, item) { $("input[name='dataGridCheckBox']").each(function (index, item) {
if((item.dataset) && (item.dataset.id==e.data.id)){ if ((item.dataset) && (item.dataset.id == e.data.id)) {
if(item.checked){ if (item.checked) {
item.checked=false; item.checked = false;
}else{ } else {
item.checked=true; item.checked = true;
} }
} }
}); });
} }
} }
}; };
$scope.getTableHeight=function(){ $scope.getTableHeight = function () {
var row_height=$("table").find("tr").height(); var row_height = $("table").find("tr").height();
if(row_height){ if (row_height) {
return { return {
height:(row_height*12)+"px" height: (row_height * 12) + "px"
} }
} }
}; };
}; };
$scope.changeDateRangeError=function(){ $scope.changeDateRangeError = function () {
var items=$scope.queryFieldModel; var items = $scope.queryFieldModel;
if (!PWC.isNullOrEmpty(items.fileBeginTime) && !PWC.isNullOrEmpty(items.fileEndTTime) && if (!PWC.isNullOrEmpty(items.fileBeginTime) && !PWC.isNullOrEmpty(items.fileEndTTime) &&
items.fileBeginTime > items.fileEndTTime) items.fileBeginTime > items.fileEndTTime) {
{
SweetAlert.warning($translate.instant('DateWarningSearch')); SweetAlert.warning($translate.instant('DateWarningSearch'));
} }
if (!PWC.isNullOrEmpty(items.ownBeginTime) && !PWC.isNullOrEmpty(items.ownEndTime) && if (!PWC.isNullOrEmpty(items.ownBeginTime) && !PWC.isNullOrEmpty(items.ownEndTime) &&
items.ownBeginTime > items.ownEndTime) items.ownBeginTime > items.ownEndTime) {
{
SweetAlert.warning($translate.instant('DateWarningSearch')); SweetAlert.warning($translate.instant('DateWarningSearch'));
} }
if (!PWC.isNullOrEmpty(items.effectiveBeginTime) && !PWC.isNullOrEmpty(items.effectiveEndTime) && if (!PWC.isNullOrEmpty(items.effectiveBeginTime) && !PWC.isNullOrEmpty(items.effectiveEndTime) &&
items.effectiveBeginTime > items.effectiveEndTime) items.effectiveBeginTime > items.effectiveEndTime) {
{
SweetAlert.warning($translate.instant('DateWarningSearch')); SweetAlert.warning($translate.instant('DateWarningSearch'));
} }
if (!PWC.isNullOrEmpty(items.uploadBeginTime) && !PWC.isNullOrEmpty(items.uploadEndTime) && if (!PWC.isNullOrEmpty(items.uploadBeginTime) && !PWC.isNullOrEmpty(items.uploadEndTime) &&
items.uploadBeginTime > items.uploadEndTime) items.uploadBeginTime > items.uploadEndTime) {
{
SweetAlert.warning($translate.instant('DateWarningSearch')); SweetAlert.warning($translate.instant('DateWarningSearch'));
} }
if (!PWC.isNullOrEmpty(items.fileTime) && !PWC.isNullOrEmpty(items.effectiveTime) && if (!PWC.isNullOrEmpty(items.fileTime) && !PWC.isNullOrEmpty(items.effectiveTime) &&
items.fileTime > items.effectiveTime) items.fileTime > items.effectiveTime) {
{
SweetAlert.warning($translate.instant('DateWarningSearch')); SweetAlert.warning($translate.instant('DateWarningSearch'));
} }
}; };
$scope.changeFieldModel=function(){ $scope.changeFieldModel=function(){
//新建记录 //新建记录
items=$scope.editFieldModel; var items=$scope.editFieldModel;
if (!PWC.isNullOrEmpty(items.fileTime) && !PWC.isNullOrEmpty(items.effectiveTime) && if (!PWC.isNullOrEmpty(items.fileTime) && !PWC.isNullOrEmpty(items.effectiveTime) &&
items.fileTime > items.effectiveTime) items.fileTime > items.effectiveTime)
{ {
SweetAlert.warning($translate.instant('FileTimeDateRangeError')); SweetAlert.warning($translate.instant('FileTimeDateRangeError'));
} }
}; };
$scope.changeFieldItem=function(){ $scope.changeFieldItem = function () {
//批量上传 //批量上传
items=$scope.editFieldItem; if($scope.multiUploadErrorItems){
if (!PWC.isNullOrEmpty(items.fileTime) && !PWC.isNullOrEmpty(items.effectiveTime) && for (var i = 0; i < $scope.multiUploadErrorItems.length; i++) {
items.fileTime > items.effectiveTime) var modelItem = $scope.multiUploadErrorItems[i];
{ if (!PWC.isNullOrEmpty(modelItem.fileTime) && !PWC.isNullOrEmpty(modelItem.effectiveTime) &&
SweetAlert.warning($translate.instant('FileTimeDateRangeError')); modelItem.fileTime > modelItem.effectiveTime) {
SweetAlert.warning($translate.instant("Document") + (i + 1) + "," +$translate.instant('FileTimeDateRangeError'));
break;
}
}
} }
}; };
//弹出框 //弹出框
...@@ -401,8 +400,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -401,8 +400,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
$scope.matchFieldTypeId($scope.editFieldModel); $scope.matchFieldTypeId($scope.editFieldModel);
} }
}); });
} } else {
else {
$scope.curFileTypeOptions.length = 0; $scope.curFileTypeOptions.length = 0;
$scope.isCreatePop = true; $scope.isCreatePop = true;
$scope.simpleUploadSubmit = simpleUploadSubmit; $scope.simpleUploadSubmit = simpleUploadSubmit;
...@@ -415,11 +413,10 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -415,11 +413,10 @@ taxDocumentManageModule.controller('taxDocumentListController',
$scope.isCoverOperation = false; $scope.isCoverOperation = false;
//新建档案 //新建档案
var simpleUploadSubmit = function () { var simpleUploadSubmit = function () {
$scope.matchCompanyId($scope.editFieldModel);
var params = angular.copy($scope.editFieldModel); var params = angular.copy($scope.editFieldModel);
if (!PWC.isNullOrEmpty(params.fileTime) && !PWC.isNullOrEmpty(params.effectiveTime) && if (!PWC.isNullOrEmpty(params.fileTime) && !PWC.isNullOrEmpty(params.effectiveTime) &&
params.fileTime > params.effectiveTime) params.fileTime > params.effectiveTime) {
{
window.swal($translate.instant('FileTimeDateRangeError')); window.swal($translate.instant('FileTimeDateRangeError'));
return; return;
} }
...@@ -457,7 +454,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -457,7 +454,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
// data == true,代表可以直接上传,否则属于覆盖行为 // data == true,代表可以直接上传,否则属于覆盖行为
//data.id===null|| data.id===undefined,代表可以直接上传,否则属于覆盖行为 //data.id===null|| data.id===undefined,代表可以直接上传,否则属于覆盖行为
if (data.id===null|| data.id===undefined) { if (data.id === null || data.id === undefined) {
$scope.uploader.queue[0].url = apiInterceptor.webApiHostUrl + "/taxDoc/add"; $scope.uploader.queue[0].url = apiInterceptor.webApiHostUrl + "/taxDoc/add";
$scope.uploader.uploadItem(0); $scope.uploader.uploadItem(0);
$scope.isCoverOperation = false; $scope.isCoverOperation = false;
...@@ -466,7 +463,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -466,7 +463,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
// addLogicAfterUploadFile($scope.editFieldModel,'simple'); // addLogicAfterUploadFile($scope.editFieldModel,'simple');
} else { } else {
//覆盖行为-需上传参数 //覆盖行为-需上传参数
uploadItem.formData.push({id:data.id}); uploadItem.formData.push({id: data.id});
SweetAlert.swal({ SweetAlert.swal({
title: '提示', title: '提示',
text: $translate.instant("CoverConfirm"), text: $translate.instant("CoverConfirm"),
...@@ -490,7 +487,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -490,7 +487,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
}; };
var addLogicAfterUploadFile = function (editFieldModel, type) { var addLogicAfterUploadFile = function (editFieldModel, type) {
$scope.matchCompanyId(editFieldModel);
var params = angular.copy(editFieldModel); var params = angular.copy(editFieldModel);
// params.ownTime = params.ownTime ? params.ownTime : ""; // params.ownTime = params.ownTime ? params.ownTime : "";
// var splitMark = params.ownTime.indexOf("-") > -1 ? "-" : "/"; // var splitMark = params.ownTime.indexOf("-") > -1 ? "-" : "/";
...@@ -541,11 +538,11 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -541,11 +538,11 @@ taxDocumentManageModule.controller('taxDocumentListController',
params.filePositionUrl = encodeURIComponent(params.filePositionUrl); params.filePositionUrl = encodeURIComponent(params.filePositionUrl);
taxDocumentListService.verifyDuplicate(params).then(function (result) { taxDocumentListService.verifyDuplicate(params).then(function (result) {
// 例如 修改1为1 不用弹框 修改1本身就好 但是修改1为2 ,就要去掉1并修改2(保留2的id) // 例如 修改1为1 不用弹框 修改1本身就好 但是修改1为2 ,就要去掉1并修改2(保留2的id)
if ((result.id==null|| result.id==undefined)|| (result.id==fieldModel.id)) { if ((result.id == null || result.id == undefined) || (result.id == fieldModel.id)) {
editRecord_Post(fieldModel,type); editRecord_Post(fieldModel, type);
}else{ } else {
var hisCellId=result.id; var hisCellId = result.id;
var CellId=fieldModel.id; var CellId = fieldModel.id;
SweetAlert.swal({ SweetAlert.swal({
title: '提示', title: '提示',
text: $translate.instant("CoverConfirm"), text: $translate.instant("CoverConfirm"),
...@@ -559,8 +556,8 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -559,8 +556,8 @@ taxDocumentManageModule.controller('taxDocumentListController',
}, },
function (isConfirm) { function (isConfirm) {
if (isConfirm) { if (isConfirm) {
fieldModel.id=hisCellId; fieldModel.id = hisCellId;
editRecord_Post(fieldModel,type); editRecord_Post(fieldModel, type);
delHisRecord(CellId); delHisRecord(CellId);
} }
...@@ -570,13 +567,15 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -570,13 +567,15 @@ taxDocumentManageModule.controller('taxDocumentListController',
$('#simpleUploadPopDialog').modal('hide'); $('#simpleUploadPopDialog').modal('hide');
$('#multiUploadPopDialog').modal('hide'); $('#multiUploadPopDialog').modal('hide');
}; };
function editRecord_Post(fieldModel,type){
function editRecord_Post(fieldModel, type) {
$scope.matchCompanyId(fieldModel);
var params = angular.copy(fieldModel); var params = angular.copy(fieldModel);
// 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){ Object.keys(params).forEach(function (key) {
if(params[key] === undefined || params[key] === null) params[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 ? params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "/") : delete params.effectiveTime; params.effectiveTime ? params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "/") : delete params.effectiveTime;
...@@ -617,13 +616,14 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -617,13 +616,14 @@ taxDocumentManageModule.controller('taxDocumentListController',
}); });
} }
function delHisRecord(cellId){ function delHisRecord(cellId) {
var delIDs = []; var delIDs = [];
delIDs.push(cellId); delIDs.push(cellId);
taxDocumentListService.delFileRecordItems({ taxDocumentListService.delFileRecordItems({
"ids":delIDs "ids": delIDs
}).then(function (data) { }).then(function (data) {
if (data) {} if (data) {
}
}); });
}; };
//取消 //取消
...@@ -645,9 +645,9 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -645,9 +645,9 @@ taxDocumentManageModule.controller('taxDocumentListController',
delIDs.push(cellId); delIDs.push(cellId);
} }
}); });
if(delIDs.length ==0){ if (delIDs.length == 0) {
SweetAlert.warning($translate.instant("NeedChecked")); SweetAlert.warning($translate.instant("NeedChecked"));
}else{ } else {
SweetAlert.swal({ SweetAlert.swal({
title: '提示', title: '提示',
text: $translate.instant("DeleteConfirm"), text: $translate.instant("DeleteConfirm"),
...@@ -662,7 +662,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -662,7 +662,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
function (isConfirm) { function (isConfirm) {
if (isConfirm) { if (isConfirm) {
taxDocumentListService.delFileRecordItems({ taxDocumentListService.delFileRecordItems({
"ids":delIDs "ids": delIDs
}).then(function (data) { }).then(function (data) {
if (data) { if (data) {
SweetAlert.swal({ SweetAlert.swal({
...@@ -848,7 +848,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -848,7 +848,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
$scope.multiUploadErrorItems = []; $scope.multiUploadErrorItems = [];
$scope.multiUploadSuccessItems = []; $scope.multiUploadSuccessItems = [];
$scope.multiUploader = {}; $scope.multiUploader = {};
$scope.FileItem={isSuccess:false}; $scope.FileItem = {isSuccess: false};
$scope.abandonFileCache = []; $scope.abandonFileCache = [];
$scope.uploadResultSuccessList = []; $scope.uploadResultSuccessList = [];
$scope.activeTab = function (activeIndex) { $scope.activeTab = function (activeIndex) {
...@@ -885,7 +885,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -885,7 +885,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
createFieldModel(fileItem); createFieldModel(fileItem);
}; };
function createFieldModel(fileItem){ function createFieldModel(fileItem) {
var fileNativePath = $("#multiUploadFilePlugin")[0].value || ""; var fileNativePath = $("#multiUploadFilePlugin")[0].value || "";
fileNativePath = fileNativePath.replace(/fakepath/img, "******"); fileNativePath = fileNativePath.replace(/fakepath/img, "******");
fileNativePath = fileNativePath.replace(fileItem.file.name, ""); fileNativePath = fileNativePath.replace(fileItem.file.name, "");
...@@ -893,13 +893,13 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -893,13 +893,13 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
fileNativePath: fileNativePath, fileNativePath: fileNativePath,
fileName: fileItem.file.name, fileName: fileItem.file.name,
iShow: false, iShow: false,
abandon:false, abandon: false,
}; };
$scope.autoMatchAttrAndType(fileItem.file.name, thisModel); $scope.autoMatchAttrAndType(fileItem.file.name, thisModel);
$scope.isAbandonFileItem(thisModel); $scope.isAbandonFileItem(thisModel);
if(thisModel.abandon){ if (thisModel.abandon) {
$scope.multiUploadErrorItems.push(thisModel); $scope.multiUploadErrorItems.push(thisModel);
}else{ } else {
$scope.multiUploadSuccessItems.push(thisModel); $scope.multiUploadSuccessItems.push(thisModel);
} }
} }
...@@ -907,14 +907,14 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -907,14 +907,14 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
//验证输入值是否都正确填充 //验证输入值是否都正确填充
//逻辑为:判断当前表单的必填值是否都已填充 //逻辑为:判断当前表单的必填值是否都已填充
//验证失败就推出到失败队列,首先展示失败窗口,再把失败队列显示到编辑窗口 //验证失败就推出到失败队列,首先展示失败窗口,再把失败队列显示到编辑窗口
$scope.isAbandonFileItem = function(fieldModel){ $scope.isAbandonFileItem = function (fieldModel) {
// 验证必填字段的值 // 验证必填字段的值
if(!fieldModel.companyName && fieldModel.companyName != 0 if (!fieldModel.companyName && fieldModel.companyName != 0
|| !fieldModel.fileType && fieldModel.fileType != 0 || !fieldModel.fileType && fieldModel.fileType != 0
|| !fieldModel.taxType && fieldModel.taxType != 0 || !fieldModel.taxType && fieldModel.taxType != 0
|| !fieldModel.ownTime && fieldModel.ownTime != 0 || !fieldModel.ownTime && fieldModel.ownTime != 0
|| !fieldModel.fileTime && fieldModel.fileTime != 0 || !fieldModel.fileTime && fieldModel.fileTime != 0
){ ) {
fieldModel.abandon = true; fieldModel.abandon = true;
} }
}; };
...@@ -922,7 +922,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -922,7 +922,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
$scope.multiUploader.onSuccessItem = function (fileItem, response) { $scope.multiUploader.onSuccessItem = function (fileItem, response) {
var fieldModel = {}; var fieldModel = {};
fileItem.formData.forEach(function (formItem) { fileItem.formData.forEach(function (formItem) {
Object.keys(formItem).forEach(function(key){ Object.keys(formItem).forEach(function (key) {
fieldModel[key] = formItem[key]; fieldModel[key] = formItem[key];
}) })
}); });
...@@ -935,30 +935,30 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -935,30 +935,30 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
//todo 重新构造一个editModel //todo 重新构造一个editModel
var fieldModel = {}; var fieldModel = {};
fileItem.formData.forEach(function (formItem) { fileItem.formData.forEach(function (formItem) {
Object.keys(formItem).forEach(function(key){ Object.keys(formItem).forEach(function (key) {
fieldModel[key] = formItem[key]; fieldModel[key] = formItem[key];
}) })
}); });
// fieldModel.file = fileItem; // fieldModel.file = fileItem;
if(verifyFieldModelDup(fieldModel,$scope.multiUploadErrorItems) === -1){ if (verifyFieldModelDup(fieldModel, $scope.multiUploadErrorItems) === -1) {
$scope.multiUploadErrorItems.push(fieldModel); $scope.multiUploadErrorItems.push(fieldModel);
} }
var successDupIndex = verifyFieldModelDup(fieldModel,$scope.multiUploadSuccessItems); var successDupIndex = verifyFieldModelDup(fieldModel, $scope.multiUploadSuccessItems);
if(successDupIndex > -1){ if (successDupIndex > -1) {
$scope.multiUploadSuccessItems.splice(successDupIndex,1); $scope.multiUploadSuccessItems.splice(successDupIndex, 1);
} }
$scope.abandonFileCache.push(fileItem); $scope.abandonFileCache.push(fileItem);
}; };
function verifyFieldModelDup(fieldModel,uploadModelItems){ function verifyFieldModelDup(fieldModel, uploadModelItems) {
var dupIndex = -1; var dupIndex = -1;
uploadModelItems.forEach(function (modelItem,modelIndex) { uploadModelItems.forEach(function (modelItem, modelIndex) {
if(fieldModel.companyName === modelItem.companyName if (fieldModel.companyName === modelItem.companyName
&& fieldModel.fileType === modelItem.fileType && fieldModel.fileType === modelItem.fileType
&& fieldModel.taxType === modelItem.taxType && fieldModel.taxType === modelItem.taxType
&& fieldModel.ownTime === modelItem.ownTime && fieldModel.ownTime === modelItem.ownTime
&& fieldModel.fileTime === modelItem.fileTime){ && fieldModel.fileTime === modelItem.fileTime) {
dupIndex = modelIndex; dupIndex = modelIndex;
} }
}); });
...@@ -970,15 +970,15 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -970,15 +970,15 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
// console.info('onCancelItem', fileItem, response, status, headers); // console.info('onCancelItem', fileItem, response, status, headers);
// }; // };
$scope.multiUploader.onAfterAddingAll = function(){ $scope.multiUploader.onAfterAddingAll = function () {
if($scope.multiUploadErrorItems.length){ if ($scope.multiUploadErrorItems.length) {
$scope.abandonFileCache.length = 0; $scope.abandonFileCache.length = 0;
$scope.multiUploadErrorItems.forEach(function (errItem) { $scope.multiUploadErrorItems.forEach(function (errItem) {
var queueLen = $scope.multiUploader.queue.length; var queueLen = $scope.multiUploader.queue.length;
while(queueLen--){ while (queueLen--) {
var queueItem = $scope.multiUploader.queue[queueLen]; var queueItem = $scope.multiUploader.queue[queueLen];
if(errItem.fileName === queueItem._file.name){ if (errItem.fileName === queueItem._file.name) {
$scope.abandonFileCache.push(queueItem); $scope.abandonFileCache.push(queueItem);
$scope.multiUploader.removeFromQueue(queueLen); $scope.multiUploader.removeFromQueue(queueLen);
break; break;
...@@ -987,9 +987,9 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -987,9 +987,9 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
}); });
} }
if($scope.multiUploader.queue.length){ if ($scope.multiUploader.queue.length) {
$scope.multiUploadSubmit_auto(); $scope.multiUploadSubmit_auto();
}else{ } else {
$("#uploadResultPop").modal("show"); $("#uploadResultPop").modal("show");
} }
}; };
...@@ -1002,11 +1002,12 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -1002,11 +1002,12 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
fileItem.formData = [{ fileItem.formData = [{
fileOriginName: fileItem.name ? fileItem.name : fileItem._file.name fileOriginName: fileItem.name ? fileItem.name : fileItem._file.name
}]; }];
$scope.matchCompanyId($scope.multiUploadSuccessItems[i]);
var editFieldModel = $scope.multiUploadSuccessItems[i]; var editFieldModel = $scope.multiUploadSuccessItems[i];
Object.keys(editFieldModel).forEach(function (key) { Object.keys(editFieldModel).forEach(function (key) {
var curItemValue = editFieldModel[key] ? editFieldModel[key] : ""; var curItemValue = editFieldModel[key] ? editFieldModel[key] : "";
fileItem.formData.push($scope.queryFileUploadData(key,curItemValue)); fileItem.formData.push($scope.queryFileUploadData(key, curItemValue));
}); });
(function (_i, _fileItem, _editFieldModel, _taxDocumentListService, _multiUploader) { (function (_i, _fileItem, _editFieldModel, _taxDocumentListService, _multiUploader) {
...@@ -1019,13 +1020,13 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -1019,13 +1020,13 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "-"); params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "-");
_taxDocumentListService.verifyDuplicate(params).then(function (data) { _taxDocumentListService.verifyDuplicate(params).then(function (data) {
//data.id===null|| data.id===undefined,代表可以直接上传,否则属于覆盖行为 //data.id===null|| data.id===undefined,代表可以直接上传,否则属于覆盖行为
if (data.id===null|| data.id===undefined) { if (data.id === null || data.id === undefined) {
_fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/add"; _fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/add";
_multiUploader.uploadItem(_i); _multiUploader.uploadItem(_i);
} else { } else {
//覆盖行为-需上传参数 //覆盖行为-需上传参数
_fileItem.formData.push({id:data.id}); _fileItem.formData.push({id: data.id});
var Cover_Confirm="'"+data.fileName+"' 记录已经存在,是否进行覆盖?"; var Cover_Confirm = "'" + data.fileName + "' 记录已经存在,是否进行覆盖?";
SweetAlert.swal({ SweetAlert.swal({
title: '提示', title: '提示',
text: $translate.instant(Cover_Confirm), text: $translate.instant(Cover_Confirm),
...@@ -1053,17 +1054,17 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -1053,17 +1054,17 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
$scope.multiUploader.onCompleteAll = function () { $scope.multiUploader.onCompleteAll = function () {
if($scope.multiUploadErrorItems.length) if ($scope.multiUploadErrorItems.length)
$scope.multiUploadErrorItems[0].iShow = true; $scope.multiUploadErrorItems[0].iShow = true;
if($scope.multiUploadErrorItems.length if ($scope.multiUploadErrorItems.length
|| $scope.uploadResultSuccessList.length) || $scope.uploadResultSuccessList.length)
$("#uploadResultPop").modal("show"); $("#uploadResultPop").modal("show");
//是否都上传成功 //是否都上传成功
if($scope.multiUploadErrorItems.length>0){ if ($scope.multiUploadErrorItems.length > 0) {
$scope.FileItem.isSuccess=false; $scope.FileItem.isSuccess = false;
}else{ } else {
$scope.FileItem.isSuccess=true; $scope.FileItem.isSuccess = true;
} }
$('#busy-indicator-container').hide(); $('#busy-indicator-container').hide();
...@@ -1074,17 +1075,17 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -1074,17 +1075,17 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
$scope.multiUploadSuccessItems.length = 0; $scope.multiUploadSuccessItems.length = 0;
// 默认显示第一个 // 默认显示第一个
if($scope.multiUploadErrorItems.length){ if ($scope.multiUploadErrorItems.length) {
$scope.multiUploadErrorItems.forEach(function (errorItem) { $scope.multiUploadErrorItems.forEach(function (errorItem) {
errorItem.iShow = false; errorItem.iShow = false;
}); });
$scope.multiUploadErrorItems[0].iShow = true; $scope.multiUploadErrorItems[0].iShow = true;
} }
$('#uploadResultPop').modal('hide'); $('#uploadResultPop').modal('hide');
if($scope.FileItem.isSuccess==false){ if ($scope.FileItem.isSuccess == false) {
$("#multiUploadPopDialog").modal("show"); $("#multiUploadPopDialog").modal("show");
}else{ } else {
$scope.FileItem.isSuccess=false; $scope.FileItem.isSuccess = false;
} }
}; };
...@@ -1093,7 +1094,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -1093,7 +1094,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
$("#multiUploadPopDialog").modal("hide"); $("#multiUploadPopDialog").modal("hide");
}; };
function clearCache(){ function clearCache() {
$scope.uploadResultSuccessList.length = 0; $scope.uploadResultSuccessList.length = 0;
$scope.multiUploadErrorItems.length = 0; $scope.multiUploadErrorItems.length = 0;
$scope.multiUploadSuccessItems.length = 0; $scope.multiUploadSuccessItems.length = 0;
...@@ -1103,18 +1104,18 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -1103,18 +1104,18 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
$scope.multiUploadSubmit_handmade = function () { $scope.multiUploadSubmit_handmade = function () {
var alertContent = verifyRequiredFields($scope.multiUploadErrorItems); var alertContent = verifyRequiredFields($scope.multiUploadErrorItems);
if(!alertContent){ if (!alertContent) {
exchangedFieldModel(); exchangedFieldModel();
addFileItemToQueueFromCache(); addFileItemToQueueFromCache();
$("#multiUploadPopDialog").modal("hide"); $("#multiUploadPopDialog").modal("hide");
multiUpload_handmade(); multiUpload_handmade();
}else{ } else {
swal(alertContent); swal(alertContent);
} }
}; };
function addFileItemToQueueFromCache(){ function addFileItemToQueueFromCache() {
$scope.abandonFileCache.forEach(function (fileItem) { $scope.abandonFileCache.forEach(function (fileItem) {
$scope.multiUploader.queue.push(fileItem); $scope.multiUploader.queue.push(fileItem);
...@@ -1122,66 +1123,65 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -1122,66 +1123,65 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
$scope.abandonFileCache.length = 0; $scope.abandonFileCache.length = 0;
} }
function exchangedFieldModel(){ function exchangedFieldModel() {
$scope.multiUploadErrorItems.forEach(function (errItem) { $scope.multiUploadErrorItems.forEach(function (errItem) {
$scope.multiUploadSuccessItems.push(errItem); $scope.multiUploadSuccessItems.push(errItem);
}); });
$scope.multiUploadErrorItems.length = 0; $scope.multiUploadErrorItems.length = 0;
} }
function verifyRequiredFields(multiUploadErrorItems){ function verifyRequiredFields(multiUploadErrorItems) {
var alertText = ""; var alertText = "";
if(!$scope.requiredField.length){ if (!$scope.requiredField.length) {
return $translate.instant("PleaseChecksRequired"); return $translate.instant("PleaseChecksRequired");
} }
//todo 先获取必填字段 //todo 先获取必填字段
for(var i = 0; i < multiUploadErrorItems.length; i++){ for (var i = 0; i < multiUploadErrorItems.length; i++) {
var modelItem = multiUploadErrorItems[i]; var modelItem = multiUploadErrorItems[i];
// $scope.isRequired = function (IT8nField) { // $scope.isRequired = function (IT8nField) {
// return $scope.requiredField.indexOf($translate.instant(IT8nField)) > -1; // return $scope.requiredField.indexOf($translate.instant(IT8nField)) > -1;
// }; // };
if (!PWC.isNullOrEmpty(modelItem.fileTime) && !PWC.isNullOrEmpty(modelItem.effectiveTime) && if (!PWC.isNullOrEmpty(modelItem.fileTime) && !PWC.isNullOrEmpty(modelItem.effectiveTime) &&
modelItem.fileTime > modelItem.effectiveTime) modelItem.fileTime > modelItem.effectiveTime) {
{ alertText = $translate.instant("Document") + (i + 1) + "," + "【" + $translate.instant('FileTimeDateRangeError') + "】";
alertText = $translate.instant("Document") + (i + 1) + "," + "【"+$translate.instant('FileTimeDateRangeError')+"】";
break; break;
} }
if(!modelItem.companyName && $scope.isRequired($translate.instant("CompanyName"))){ if (!modelItem.companyName && $scope.isRequired($translate.instant("CompanyName"))) {
alertText += "【"+$translate.instant("CompanyName")+"】" alertText += "【" + $translate.instant("CompanyName") + "】"
} }
if(!modelItem.fileType && $scope.isRequired($translate.instant("DocumentType"))){ if (!modelItem.fileType && $scope.isRequired($translate.instant("DocumentType"))) {
alertText += "【"+$translate.instant("DocumentType")+"】" alertText += "【" + $translate.instant("DocumentType") + "】"
} }
if(!modelItem.fileAttr && $scope.isRequired($translate.instant("DocumentAttr"))){ if (!modelItem.fileAttr && $scope.isRequired($translate.instant("DocumentAttr"))) {
alertText += "【"+$translate.instant("DocumentAttr")+"】" alertText += "【" + $translate.instant("DocumentAttr") + "】"
} }
if(!modelItem.taxType && $scope.isRequired($translate.instant("TaxType"))){ if (!modelItem.taxType && $scope.isRequired($translate.instant("TaxType"))) {
alertText += "【"+$translate.instant("TaxType")+"】" alertText += "【" + $translate.instant("TaxType") + "】"
} }
if(!modelItem.ownTime && $scope.isRequired($translate.instant("Duration"))){ if (!modelItem.ownTime && $scope.isRequired($translate.instant("Duration"))) {
alertText += "【"+$translate.instant("Duration")+"】" alertText += "【" + $translate.instant("Duration") + "】"
} }
if(!modelItem.fileTime && $scope.isRequired($translate.instant("AvailabilityDate"))){ if (!modelItem.fileTime && $scope.isRequired($translate.instant("AvailabilityDate"))) {
alertText += "【"+$translate.instant("AvailabilityDate")+"】" alertText += "【" + $translate.instant("AvailabilityDate") + "】"
} }
if(!modelItem.effectiveTime && $scope.isRequired($translate.instant("DueDate"))){ if (!modelItem.effectiveTime && $scope.isRequired($translate.instant("DueDate"))) {
alertText += "【"+$translate.instant("DueDate")+"】" alertText += "【" + $translate.instant("DueDate") + "】"
} }
if(!modelItem.keeper && $scope.isRequired($translate.instant("EntityCustodian"))){ if (!modelItem.keeper && $scope.isRequired($translate.instant("EntityCustodian"))) {
alertText += "【"+$translate.instant("EntityCustodian")+"】" alertText += "【" + $translate.instant("EntityCustodian") + "】"
} }
if(!modelItem.storageArea && $scope.isRequired($translate.instant("EntityStorageLocation"))){ if (!modelItem.storageArea && $scope.isRequired($translate.instant("EntityStorageLocation"))) {
alertText += "【"+$translate.instant("EntityStorageLocation")+"】" alertText += "【" + $translate.instant("EntityStorageLocation") + "】"
} }
if(!modelItem.physicalIndexNumber && $scope.isRequired($translate.instant("EntityIndex"))){ if (!modelItem.physicalIndexNumber && $scope.isRequired($translate.instant("EntityIndex"))) {
alertText += "【"+$translate.instant("EntityIndex")+"】" alertText += "【" + $translate.instant("EntityIndex") + "】"
} }
if(!modelItem.remark && $scope.isRequired($translate.instant("Remarks"))){ if (!modelItem.remark && $scope.isRequired($translate.instant("Remarks"))) {
alertText += "【"+$translate.instant("Remarks")+"】" alertText += "【" + $translate.instant("Remarks") + "】"
} }
if(alertText.length > 0){ if (alertText.length > 0) {
alertText = $translate.instant("Document") + (i + 1) + "," + alertText + $translate.instant("IsRequired"); alertText = $translate.instant("Document") + (i + 1) + "," + alertText + $translate.instant("IsRequired");
break; break;
} }
...@@ -1190,7 +1190,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -1190,7 +1190,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
return alertText; return alertText;
} }
function multiUpload_handmade(){ function multiUpload_handmade() {
for (var i = 0; i < $scope.multiUploader.queue.length; i++) { for (var i = 0; i < $scope.multiUploader.queue.length; i++) {
// 过滤参数格式,并把参数推进上传队列 // 过滤参数格式,并把参数推进上传队列
...@@ -1200,28 +1200,27 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -1200,28 +1200,27 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
fileItem.formData = [{ fileItem.formData = [{
fileOriginName: fileItem.name ? fileItem.name : fileItem._file.name fileOriginName: fileItem.name ? fileItem.name : fileItem._file.name
}]; }];
$scope.matchCompanyId($scope.multiUploadSuccessItems[i]);
var editFieldModel = $scope.multiUploadSuccessItems[i]; var editFieldModel = $scope.multiUploadSuccessItems[i];
Object.keys(editFieldModel).forEach(function (key) { Object.keys(editFieldModel).forEach(function (key) {
var curItemValue = editFieldModel[key] ? editFieldModel[key] : ""; var curItemValue = editFieldModel[key] ? editFieldModel[key] : "";
fileItem.formData.push($scope.queryFileUploadData(key,curItemValue)); fileItem.formData.push($scope.queryFileUploadData(key, curItemValue));
}); });
(function (_i, _fileItem, _editFieldModel, _taxDocumentListService, _multiUploader) { (function (_i, _fileItem, _editFieldModel, _taxDocumentListService, _multiUploader) {
var params = angular.copy(_editFieldModel); var params = angular.copy(_editFieldModel);
params.ownTime = $scope.queryOwnTime(params.ownTime, "int"); params.ownTime = $scope.queryOwnTime(params.ownTime, "int");
params.fileTime = $scope.getQueryDate(params.fileTime, "-"); params.fileTime = $scope.getQueryDate(params.fileTime, "-");
params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "-"); params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "-");
_taxDocumentListService.verifyDuplicate(params).then(function (data) { _taxDocumentListService.verifyDuplicate(params).then(function (data) {
//data.id===null|| data.id===undefined,代表可以直接上传,否则属于覆盖行为 //data.id===null|| data.id===undefined,代表可以直接上传,否则属于覆盖行为
if (data.id===null|| data.id===undefined) { if (data.id === null || data.id === undefined) {
_fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/add"; _fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/add";
_multiUploader.uploadItem(_i); _multiUploader.uploadItem(_i);
} else { } else {
//覆盖行为-需上传参数 //覆盖行为-需上传参数
_fileItem.formData.push({id:data.id}); _fileItem.formData.push({id: data.id});
var Cover_Confirm="'"+data.fileName+"' 记录已经存在,是否进行覆盖?"; var Cover_Confirm = "'" + data.fileName + "' 记录已经存在,是否进行覆盖?";
SweetAlert.swal({ SweetAlert.swal({
title: '提示', title: '提示',
text: $translate.instant(Cover_Confirm), text: $translate.instant(Cover_Confirm),
...@@ -1252,8 +1251,8 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -1252,8 +1251,8 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
taxDocumentManageModule.directive('filePreview', function () { taxDocumentManageModule.directive('filePreview', function () {
return { return {
restrict: 'EA', restrict: 'EA',
controller: ['$scope', '$translate', 'SweetAlert', '$compile', 'taxDocumentListService', controller: ['$scope', '$translate', 'SweetAlert', '$compile', 'taxDocumentListService', '$q',
function ($scope, $translate, SweetAlert, $compile, taxDocumentListService) { function ($scope, $translate, SweetAlert, $compile, taxDocumentListService, $q) {
$scope.previewData = []; $scope.previewData = [];
/**上传时预览的功能取消 2019/3/8*/ /**上传时预览的功能取消 2019/3/8*/
...@@ -1312,7 +1311,7 @@ taxDocumentManageModule.directive('filePreview', function () { ...@@ -1312,7 +1311,7 @@ taxDocumentManageModule.directive('filePreview', function () {
return taxDocumentListService.readXLSX({ return taxDocumentListService.readXLSX({
path:url path: url
// path: 'http://47.94.233.173:11007/static/erp_tax_system/FE9A6FCC-019E-4B93-A9B2-1DD04CDD7431?expire=1552463739&signiture=H15ovgMR4zXwiYlPe4nZMoeLMSZFhimiHFUZ4-SVVaE=' // path: 'http://47.94.233.173:11007/static/erp_tax_system/FE9A6FCC-019E-4B93-A9B2-1DD04CDD7431?expire=1552463739&signiture=H15ovgMR4zXwiYlPe4nZMoeLMSZFhimiHFUZ4-SVVaE='
}); });
} }
...@@ -1345,24 +1344,87 @@ taxDocumentManageModule.directive('filePreview', function () { ...@@ -1345,24 +1344,87 @@ taxDocumentManageModule.directive('filePreview', function () {
var fileType = fileName.split(".").pop(); var fileType = fileName.split(".").pop();
if (/xlsx|xls/i.test(fileType)) { if (/xlsx|xls/i.test(fileType)) {
if (cacheUrl !== filePositionUrl) {
cacheUrl = filePositionUrl; taxDocumentListService.viewExcelBySpread(filePositionUrl).then(function (reportSpread) {
sheetPromise = getXLS(filePositionUrl); var spreadCtrl = new GC.Spread.Sheets.Workbook(document.getElementById("excetlContainer"));
if (spreadCtrl) {
spreadCtrl.destroy();
} }
sheetPromise.then(function (resData) { spreadCtrl = null;
renderXLS(resData) if (!_.isEmpty(reportSpread)) {
}) initSpreadExcel(reportSpread).then(function (spread) {
/* return locateCell(spread, true);*/
});
} }
}, function (data) {
$log.info(data);
});
}
// sheetPromise.then(function (resData) {
// renderXLS(resData)
// })
else if (/pdf/i.test(fileType)) { else if (/pdf/i.test(fileType)) {
$scope.openPdfPreviewPop(filePositionUrl); $scope.openPdfPreviewPop(filePositionUrl);
} else if (/jpg|pig|gif|png|jpeg/i.test(fileType)) { } else if (/jpg|pig|gif|png|jpeg/i.test(fileType)) {
$scope.openImgPreviewPop(fileName, filePositionUrl); $scope.openImgPreviewPop(fileName, filePositionUrl);
}else { } else {
SweetAlert.warning($translate.instant('UnFile')); SweetAlert.warning($translate.instant('UnFile'));
} }
}; };
var initSpreadExcel = function (reportSpread) {
$("#filePreviewPop").modal("show");
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("excetlContainer"));
spread.suspendPaint();
spread.fromJSON(reportSpread);
spread.options.showVerticalScrollbar = true;
spread.options.showHorizontalScrollbar = true;
spread.options.scrollbarMaxAlign = true;
spread.options.scrollbarShowMax = true;
spread.options.tabNavigationVisible = true;
if (constant.regesterInformation.active) {
spread.options.tabEditable = false;
spread.options.tabStripVisible = false;
spread.options.newTabVisible = false;
}
spread.options.allowUndo = false;
spread.options.allowUserResize = false;
spread.options.allowUserDragDrop = false;
spread.options.allowUserDragFill = false;
spread.options.allowUserEditFormula = false;
spread.options.allowContextMenu = false;
//todo:注册之后这里去掉注释
//var sheet = spread.getActiveSheet();
var sheet;
if (constant.regesterInformation.active) {
sheet = spread.getActiveSheet();
} else {
sheet = spread.getSheet(1);
}
if (sheet != null) {
sheet.options.rowHeaderVisible = true;
sheet.options.colHeaderVisible = true;
sheet.options.gridline.showVerticalGridline = true;
sheet.options.gridline.showHorizontalGridline = true;
sheet.options.isProtected = true;
sheet.clearSelection();
}
// setColWidth(sheet);
// if(sheet.getRowCount() <= 38)
// scope.relation.addEbitRow(sheet)
// if (scope.templateId && scope.reportSource) {
// setData();
// }
sheet.setRowResizable(0, false, GC.Spread.Sheets.SheetArea.viewport);
spread.resumePaint();
return $q.when(spread);
};
$scope.filePreview_dataGridUpdate = function (_data) { $scope.filePreview_dataGridUpdate = function (_data) {
// console.info("excel:",_data); // console.info("excel:",_data);
$scope.previewData = _data || [{}]; $scope.previewData = _data || [{}];
...@@ -1487,6 +1549,7 @@ taxDocumentManageModule.directive('pdfPreview', function () { ...@@ -1487,6 +1549,7 @@ taxDocumentManageModule.directive('pdfPreview', function () {
renderPdf(pdf) renderPdf(pdf)
}) })
}; };
function getPdf(url) { function getPdf(url) {
// var url = 'http://47.94.233.173:11007/static/erp_tax_system/61063D1D-8C9E-47C1-B106-AFF696CF5D98?expire=1552466477&signiture=5IaoVIHX_pzmQgyaxdzYC2NsNOz_R0eyRUhQU1BJjiE='; // var url = 'http://47.94.233.173:11007/static/erp_tax_system/61063D1D-8C9E-47C1-B106-AFF696CF5D98?expire=1552466477&signiture=5IaoVIHX_pzmQgyaxdzYC2NsNOz_R0eyRUhQU1BJjiE=';
return window.PDFJS.getDocument(url); return window.PDFJS.getDocument(url);
...@@ -1525,7 +1588,7 @@ taxDocumentManageModule.directive('imgPreview', function () { ...@@ -1525,7 +1588,7 @@ taxDocumentManageModule.directive('imgPreview', function () {
controller: ['$scope', function ($scope) { controller: ['$scope', function ($scope) {
$scope.curImgSrc = ""; $scope.curImgSrc = "";
$scope.curImgName = ""; $scope.curImgName = "";
$scope.openImgPreviewPop = function (fileName,url) { $scope.openImgPreviewPop = function (fileName, url) {
if ($scope.curImgSrc !== url) { if ($scope.curImgSrc !== url) {
$scope.curImgName = fileName; $scope.curImgName = fileName;
$scope.curImgSrc = url; $scope.curImgSrc = url;
...@@ -1543,8 +1606,8 @@ taxDocumentManageModule.directive('imgPreview', function () { ...@@ -1543,8 +1606,8 @@ taxDocumentManageModule.directive('imgPreview', function () {
taxDocumentManageModule.directive('helpPop', function () { taxDocumentManageModule.directive('helpPop', function () {
return { return {
restrict: 'EA', restrict: 'EA',
controller: ['$scope', 'taxDocumentListService', '$translate', '$compile','SweetAlert', controller: ['$scope', 'taxDocumentListService', '$translate', '$compile', 'SweetAlert',
function ($scope, taxDocumentListService, $translate, $compile,SweetAlert) { function ($scope, taxDocumentListService, $translate, $compile, SweetAlert) {
$scope.curEditModel = null; $scope.curEditModel = null;
$scope.openHelpPop = function (curEditModel) { $scope.openHelpPop = function (curEditModel) {
$scope.curEditModel = curEditModel; $scope.curEditModel = curEditModel;
...@@ -1562,7 +1625,7 @@ taxDocumentManageModule.directive('helpPop', function () { ...@@ -1562,7 +1625,7 @@ taxDocumentManageModule.directive('helpPop', function () {
}) })
}; };
$scope.sniffHelpPopRadio = function(){ $scope.sniffHelpPopRadio = function () {
var checkedItem = $(".TDL-has-checked").children()[0].childNodes[0]; var checkedItem = $(".TDL-has-checked").children()[0].childNodes[0];
$scope.curEditModel.fileAttr = checkedItem.getAttribute("data-fileAttr"); $scope.curEditModel.fileAttr = checkedItem.getAttribute("data-fileAttr");
taxDocumentListService.getDocumentsAttrAndType({params: {}}).then(function (data) { taxDocumentListService.getDocumentsAttrAndType({params: {}}).then(function (data) {
...@@ -1608,13 +1671,13 @@ taxDocumentManageModule.directive('helpPop', function () { ...@@ -1608,13 +1671,13 @@ taxDocumentManageModule.directive('helpPop', function () {
'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>'); '">' + options.data.fileAttr + '</span>');
container.append(target); container.append(target);
var trs = $("#helpPopDialog").find("tr"); var trs = $("#helpPopDialog").find("tr");
trs.each(function (index,item) { trs.each(function (index, item) {
$(item).off("click").on("click",function(e){ $(item).off("click").on("click", function (e) {
trs.each(function(_index,_item){ trs.each(function (_index, _item) {
$(_item).removeClass('TDL-has-checked'); $(_item).removeClass('TDL-has-checked');
}); });
$(e.currentTarget).addClass('TDL-has-checked'); $(e.currentTarget).addClass('TDL-has-checked');
...@@ -1647,8 +1710,8 @@ taxDocumentManageModule.directive('helpPop', function () { ...@@ -1647,8 +1710,8 @@ taxDocumentManageModule.directive('helpPop', function () {
taxDocumentManageModule.directive('watchGroup', function () { taxDocumentManageModule.directive('watchGroup', function () {
return { return {
restrict: 'EA', restrict: 'EA',
controller: ['$scope','taxDocumentListService','$translate', controller: ['$scope', 'taxDocumentListService', '$translate',
function ($scope,taxDocumentListService,$translate) { function ($scope, taxDocumentListService, $translate) {
$scope.requiredField = []; $scope.requiredField = [];
$scope.FileAttrAndTypeCache = []; $scope.FileAttrAndTypeCache = [];
...@@ -1677,11 +1740,11 @@ taxDocumentManageModule.directive('watchGroup', function () { ...@@ -1677,11 +1740,11 @@ taxDocumentManageModule.directive('watchGroup', function () {
var fieldsArray = fileName.split("_"); var fieldsArray = fileName.split("_");
// 嘀嘀无限_增值税纳税申报表_增值税_201811_20181201 // 嘀嘀无限_增值税纳税申报表_增值税_201811_20181201
// 公司名_文档类型_税种_所属期间_到期日 // 公司名_文档类型_税种_所属期间_到期日
if(fieldsArray.length){ if (fieldsArray.length) {
//需要验证每个值在对应的下拉菜单里面有没有对应的值 //需要验证每个值在对应的下拉菜单里面有没有对应的值
fieldModel.companyName = $scope.verifyRequiredData(fieldsArray[0],"companyName"); fieldModel.companyName = $scope.verifyRequiredData(fieldsArray[0], "companyName");
fieldModel.fileType = $scope.verifyRequiredData(fieldsArray[1],"fileType"); fieldModel.fileType = $scope.verifyRequiredData(fieldsArray[1], "fileType");
fieldModel.taxType = $scope.verifyRequiredData(fieldsArray[2],"taxType"); fieldModel.taxType = $scope.verifyRequiredData(fieldsArray[2], "taxType");
fieldModel.ownTime = $scope.intToDate(fieldsArray[3]); fieldModel.ownTime = $scope.intToDate(fieldsArray[3]);
fieldModel.fileTime = $scope.intToDate(fieldsArray[4]); fieldModel.fileTime = $scope.intToDate(fieldsArray[4]);
} }
...@@ -1689,7 +1752,7 @@ taxDocumentManageModule.directive('watchGroup', function () { ...@@ -1689,7 +1752,7 @@ taxDocumentManageModule.directive('watchGroup', function () {
// 根据Type来匹配Attr; // 根据Type来匹配Attr;
Object.keys($scope.typeAndAttrMap).forEach(function (key) { Object.keys($scope.typeAndAttrMap).forEach(function (key) {
if (fieldModel.fileType === key) { if (fieldModel.fileType === key) {
fieldModel.fileAttr = $scope.verifyRequiredData($scope.typeAndAttrMap[key],"fileAttr"); fieldModel.fileAttr = $scope.verifyRequiredData($scope.typeAndAttrMap[key], "fileAttr");
} }
}); });
...@@ -1727,17 +1790,23 @@ taxDocumentManageModule.directive('watchGroup', function () { ...@@ -1727,17 +1790,23 @@ taxDocumentManageModule.directive('watchGroup', function () {
// 选了公司之后,就自动匹配公司ID // 选了公司之后,就自动匹配公司ID
$scope.matchCompanyId = function (fieldModel) { $scope.matchCompanyId = function (fieldModel) {
Object.keys($scope.companyNameOptionsMap).forEach(function (key) { angular.forEach($scope.companyNameOptionsMap, function (d) {
if ($scope.companyNameOptionsMap[key] === fieldModel.companyName) { if (d.key === fieldModel.companyName) {
fieldModel.companyId = key; fieldModel.companyId = d.val;
return;
} }
}) })
// Object.keys($scope.companyNameOptionsMap).forEach(function (key) {
// if ($scope.companyNameOptionsMap[key] === fieldModel.companyName) {
// fieldModel.companyId = key;
// }
// })
}; };
// 根据当前获取的字段值来匹配下拉菜单,如果匹配不到就返回空字符串,以使得form表单验证功能正常 // 根据当前获取的字段值来匹配下拉菜单,如果匹配不到就返回空字符串,以使得form表单验证功能正常
$scope.verifyRequiredData = function(src,type){ $scope.verifyRequiredData = function (src, type) {
var pass = false; var pass = false;
switch (type){ switch (type) {
case "taxType": case "taxType":
pass = $scope.taxTypeSelects.indexOf(src) > -1; pass = $scope.taxTypeSelects.indexOf(src) > -1;
break; break;
...@@ -1748,7 +1817,12 @@ taxDocumentManageModule.directive('watchGroup', function () { ...@@ -1748,7 +1817,12 @@ taxDocumentManageModule.directive('watchGroup', function () {
pass = $scope.fileTypeOptions.indexOf(src) > -1; pass = $scope.fileTypeOptions.indexOf(src) > -1;
break; break;
case "companyName": case "companyName":
pass = Object.values($scope.companyNameOptionsMap).indexOf(src) > -1; angular.forEach($scope.companyNameOptionsMap, function (d) {
if (d.key === src) {
pass = true;
return;
}
})
break; break;
} }
...@@ -1780,18 +1854,63 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1780,18 +1854,63 @@ taxDocumentManageModule.directive('tempModule', function () {
// ]; // ];
//审批状态 //审批状态
$scope.auditSelectsMap = { $scope.auditSelectsMap = {
"0":"待审批", "0": "待审批",
"1":"已审批", "1": "已审批",
"-1":"拒绝审批", "-1": "拒绝审批",
};
//机构下拉设置
$scope.queryOrgOptions = {
displayExpr: 'key',
valueExpr: 'key',
// width: '95%',
bindingOptions: {
value: 'queryFieldModel.companyName',
dataSource: 'companyNameOptionsMap',
readOnly: 'isOrgReadOnly'
},
// height: '30px',
placeholder: '',
showClearButton: true,
searchEnabled: true,
showSelectionControls: true
};
$scope.editOrgOptions = {
displayExpr: 'key',
valueExpr: 'key',
// width: '95%',
bindingOptions: {
value: 'editFieldModel.companyName',
dataSource: 'companyNameOptionsMap',
readOnly: 'isOrgReadOnly'
},
// height: '30px',
placeholder: '',
showClearButton: true,
searchEnabled: true,
showSelectionControls: true
};
$scope.editFieldItemOrgOptions = {
displayExpr: 'key',
valueExpr: 'key',
// width: '95%',
bindingOptions: {
value: 'editFieldItem.companyName',
dataSource: 'companyNameOptionsMap',
readOnly: 'isOrgReadOnly'
},
// height: '30px',
placeholder: '',
showClearButton: true,
searchEnabled: true,
showSelectionControls: true
}; };
$scope.typeAndAttrMap = {}; $scope.typeAndAttrMap = {};
$scope.fileTypeOptions = []; $scope.fileTypeOptions = [];
$scope.fileAttrOptions = []; $scope.fileAttrOptions = [];
$scope.fileTypeEnableOptions = []; $scope.fileTypeEnableOptions = [];
$scope.fileAttrEnableOptions = []; $scope.fileAttrEnableOptions = [];
$scope.curFileTypeOptions = []; $scope.curFileTypeOptions = [];
$scope.companyNameOptionsMap = {}; $scope.companyNameOptionsMap = [];
$scope.loadSelectMap = function () { $scope.loadSelectMap = function () {
taxDocumentListService.getFileInfoOptions().then(function (data) { taxDocumentListService.getFileInfoOptions().then(function (data) {
// console.log(data); // console.log(data);
...@@ -1806,10 +1925,10 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1806,10 +1925,10 @@ taxDocumentManageModule.directive('tempModule', function () {
// 过滤去重 // 过滤去重
var temp = $scope.fileTypeOptions; var temp = $scope.fileTypeOptions;
$scope.fileTypeOptions = (function(){ $scope.fileTypeOptions = (function () {
var result = []; var result = [];
temp.forEach(function(typeItem){ temp.forEach(function (typeItem) {
if(result.indexOf(typeItem) === -1){ if (result.indexOf(typeItem) === -1) {
result.push(typeItem); result.push(typeItem);
} }
}); });
...@@ -1817,10 +1936,10 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1817,10 +1936,10 @@ taxDocumentManageModule.directive('tempModule', function () {
})(); })();
$scope.fileTypeOptions.sort(); $scope.fileTypeOptions.sort();
temp = $scope.fileAttrOptions; temp = $scope.fileAttrOptions;
$scope.fileAttrOptions = (function(){ $scope.fileAttrOptions = (function () {
var result = []; var result = [];
temp.forEach(function(attrItem){ temp.forEach(function (attrItem) {
if(result.indexOf(attrItem) === -1){ if (result.indexOf(attrItem) === -1) {
result.push(attrItem); result.push(attrItem);
} }
}); });
...@@ -1830,10 +1949,11 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1830,10 +1949,11 @@ taxDocumentManageModule.directive('tempModule', function () {
} }
}); });
taxDocumentListService.getCompanyNameOptions().then(function(res){ taxDocumentListService.getCompanyNameOptions().then(function (res) {
if (res && 0 === res.code) { if (res && 0 === res.code) {
angular.forEach(res.data, function (item) { angular.forEach(res.data, function (item) {
$scope.companyNameOptionsMap[item.id]=item.abbreviation; $scope.companyNameOptionsMap.push({'key': item.abbreviation, 'val': item.id});
// $scope.companyNameOptionsMap[item.id] = item.abbreviation;
}); });
} else { } else {
SweetAlert.error($translate.instant('RevenueGetOrgError')); SweetAlert.error($translate.instant('RevenueGetOrgError'));
...@@ -1856,10 +1976,10 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1856,10 +1976,10 @@ taxDocumentManageModule.directive('tempModule', function () {
// 过滤去重 // 过滤去重
var temp = $scope.fileTypeEnableOptions; var temp = $scope.fileTypeEnableOptions;
$scope.fileTypeEnableOptions = (function(){ $scope.fileTypeEnableOptions = (function () {
var result = []; var result = [];
temp.forEach(function(typeItem){ temp.forEach(function (typeItem) {
if(result.indexOf(typeItem) === -1){ if (result.indexOf(typeItem) === -1) {
result.push(typeItem); result.push(typeItem);
} }
}); });
...@@ -1867,10 +1987,10 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1867,10 +1987,10 @@ taxDocumentManageModule.directive('tempModule', function () {
})(); })();
$scope.fileTypeEnableOptions.sort(); $scope.fileTypeEnableOptions.sort();
temp = $scope.fileAttrEnableOptions; temp = $scope.fileAttrEnableOptions;
$scope.fileAttrEnableOptions = (function(){ $scope.fileAttrEnableOptions = (function () {
var result = []; var result = [];
temp.forEach(function(attrItem){ temp.forEach(function (attrItem) {
if(result.indexOf(attrItem) === -1){ if (result.indexOf(attrItem) === -1) {
result.push(attrItem); result.push(attrItem);
} }
}); });
...@@ -1880,10 +2000,11 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1880,10 +2000,11 @@ taxDocumentManageModule.directive('tempModule', function () {
} }
}); });
taxDocumentListService.getCompanyNameOptions().then(function(res){ taxDocumentListService.getCompanyNameOptions().then(function (res) {
if (res && 0 === res.code) { if (res && 0 === res.code) {
angular.forEach(res.data, function (item) { angular.forEach(res.data, function (item) {
$scope.companyNameOptionsMap[item.id]=item.abbreviation; $scope.companyNameOptionsMap.push({'key': item.abbreviation, 'val': item.id});
// $scope.companyNameOptionsMap[item.id] = item.abbreviation;
}); });
} else { } else {
SweetAlert.error($translate.instant('RevenueGetOrgError')); SweetAlert.error($translate.instant('RevenueGetOrgError'));
...@@ -1894,8 +2015,8 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1894,8 +2015,8 @@ taxDocumentManageModule.directive('tempModule', function () {
$scope.loadSelectMap(); $scope.loadSelectMap();
$scope.loadSelectEnableMap(); $scope.loadSelectEnableMap();
$scope.businessLineOptions = []; $scope.businessLineOptions = [];
$scope.loadBusinessList = function(){ $scope.loadBusinessList = function () {
taxDocumentListService.getBusinessList().then(function(resData){ taxDocumentListService.getBusinessList().then(function (resData) {
$scope.businessLineOptions = resData; $scope.businessLineOptions = resData;
}); });
}; };
...@@ -1986,18 +2107,18 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1986,18 +2107,18 @@ taxDocumentManageModule.directive('tempModule', function () {
$("#period-picker4").val(""); $("#period-picker4").val("");
}; };
$scope.sortByFirstCode = function(src){ $scope.sortByFirstCode = function (src) {
var result = []; var result = [];
var firstCodesOrigin = []; var firstCodesOrigin = [];
var originValuesMapping = []; var originValuesMapping = [];
src.forEach(function(key,index){ src.forEach(function (key, index) {
// 记录原始的下标,拼在第一个字符后面 // 记录原始的下标,拼在第一个字符后面
var firstCode = (key + "").substr(0,1) + "_" + index; var firstCode = (key + "").substr(0, 1) + "_" + index;
firstCodesOrigin.push(firstCode); firstCodesOrigin.push(firstCode);
originValuesMapping.push(key); originValuesMapping.push(key);
}); });
firstCodesOrigin.sort().forEach(function(firstCodeSortedItem,sortedIndex){ firstCodesOrigin.sort().forEach(function (firstCodeSortedItem, sortedIndex) {
// 循环已排序的首字符数组,根据记录的原始下标,对换originValuesMapping的位置 // 循环已排序的首字符数组,根据记录的原始下标,对换originValuesMapping的位置
var originIndex = firstCodeSortedItem.split("_").pop(); var originIndex = firstCodeSortedItem.split("_").pop();
result[sortedIndex] = originValuesMapping[originIndex]; result[sortedIndex] = originValuesMapping[originIndex];
...@@ -2006,46 +2127,46 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -2006,46 +2127,46 @@ taxDocumentManageModule.directive('tempModule', function () {
return result; return result;
}; };
$scope.intToDate = function(src,type){ $scope.intToDate = function (src, type) {
if(!src) return ""; if (!src) return "";
src = src + ""; src = src + "";
type = type ? type : "/"; type = type ? type : "/";
var year = src.substr(0,4); var year = src.substr(0, 4);
var mon = src.substr(4,2); var mon = src.substr(4, 2);
var day = src.substr(6,2); var day = src.substr(6, 2);
if(!day) return year + type + mon; if (!day) return year + type + mon;
return year + type + mon + type + day; return year + type + mon + type + day;
}; };
$scope.transformAuditStatusToServer = function(src){ $scope.transformAuditStatusToServer = function (src) {
var result = 0; var result = 0;
if(src === $translate.instant('ApprovalStandby')){ if (src === $translate.instant('ApprovalStandby')) {
result = 0; result = 0;
}else if(src === $translate.instant('ApprovalPass')){ } else if (src === $translate.instant('ApprovalPass')) {
result = 1; result = 1;
}else if(src === $translate.instant('ApprovalReject')){ } else if (src === $translate.instant('ApprovalReject')) {
result = -1; result = -1;
}else{ } else {
result=""; result = "";
} }
return result; return result;
}; };
$scope.transformAuditStatusToView = function(src){ $scope.transformAuditStatusToView = function (src) {
var result = $translate.instant('ApprovalStandby'); var result = $translate.instant('ApprovalStandby');
if(src == 0){ if (src == 0) {
result = $translate.instant('ApprovalStandby'); result = $translate.instant('ApprovalStandby');
}else if(src == 1){ } else if (src == 1) {
result = $translate.instant('ApprovalPass'); result = $translate.instant('ApprovalPass');
}else if(src == -1){ } else if (src == -1) {
result = $translate.instant('ApprovalReject'); result = $translate.instant('ApprovalReject');
}else{ } else {
result=""; result = "";
} }
return result; return result;
}; };
$scope.queryFileUploadData = function(key,curItemValue){ $scope.queryFileUploadData = function (key, curItemValue) {
var fields = {}; var fields = {};
if (/ownTime/.test(key)) { if (/ownTime/.test(key)) {
fields[key] = $scope.queryOwnTime(curItemValue, "int"); fields[key] = $scope.queryOwnTime(curItemValue, "int");
...@@ -2062,8 +2183,8 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -2062,8 +2183,8 @@ taxDocumentManageModule.directive('tempModule', function () {
taxDocumentManageModule.directive('downLoadModule', function () { taxDocumentManageModule.directive('downLoadModule', function () {
return { return {
restrict: 'EA', restrict: 'EA',
controller: ['$scope', 'taxDocumentListService', '$translate','SweetAlert', controller: ['$scope', 'taxDocumentListService', '$translate', 'SweetAlert',
function ($scope, taxDocumentListService, $translate,SweetAlert) { function ($scope, taxDocumentListService, $translate, SweetAlert) {
$scope.downloadAttachment = function () { $scope.downloadAttachment = function () {
var checkedIDs = []; var checkedIDs = [];
...@@ -2082,20 +2203,21 @@ taxDocumentManageModule.directive('downLoadModule', function () { ...@@ -2082,20 +2203,21 @@ taxDocumentManageModule.directive('downLoadModule', function () {
} }
}); });
//是否勾选 //是否勾选
if(checkedIDs.length==0){ if (checkedIDs.length == 0) {
return SweetAlert.warning($translate.instant("NeedChecked")); return SweetAlert.warning($translate.instant("NeedChecked"));
} }
//是否含附件 //是否含附件
if((checkedUrls.length==0) || (!checkedUrls[0])){ if ((checkedUrls.length == 0) || (!checkedUrls[0])) {
return SweetAlert.warning($translate.instant('UnRecord')); return SweetAlert.warning($translate.instant('UnRecord'));
} }
if(checkedIDs.length === 1 && checkedUrls.length === 1){ if (checkedIDs.length === 1 && checkedUrls.length === 1) {
simpDownload(checkedUrls[0]); simpDownload(checkedUrls[0]);
}else{ } else {
multiDownToZip(checkedIDs); multiDownToZip(checkedIDs);
} }
}; };
function simpDownload(url){
function simpDownload(url) {
// if (!url) return SweetAlert.warning($translate.instant("NeedChecked")); // if (!url) return SweetAlert.warning($translate.instant("NeedChecked"));
// setTimeout(function () { // setTimeout(function () {
var frame = $('<iframe style="display: none;" class="multi-download"></iframe>'); var frame = $('<iframe style="display: none;" class="multi-download"></iframe>');
...@@ -2107,13 +2229,13 @@ taxDocumentManageModule.directive('downLoadModule', function () { ...@@ -2107,13 +2229,13 @@ taxDocumentManageModule.directive('downLoadModule', function () {
// }, 100); // }, 100);
} }
function multiDownToZip(ids){ function multiDownToZip(ids) {
if (!ids.length) return SweetAlert.warning($translate.instant("NeedChecked")); if (!ids.length) return SweetAlert.warning($translate.instant("NeedChecked"));
setTimeout(function(){ setTimeout(function () {
taxDocumentListService.downloadAllFile({ taxDocumentListService.downloadAllFile({
"ids":ids "ids": ids
}); });
},500); }, 500);
} }
/*$scope.downloadAttachment = function () { /*$scope.downloadAttachment = function () {
...@@ -2149,13 +2271,12 @@ taxDocumentManageModule.directive('downLoadModule', function () { ...@@ -2149,13 +2271,12 @@ taxDocumentManageModule.directive('downLoadModule', function () {
}] }]
} }
}); });
taxDocumentManageModule.directive('exportPlugin',function(){ taxDocumentManageModule.directive('exportPlugin', function () {
return{ return {
restrict:"EA", restrict: "EA",
controller:['$scope','SweetAlert','$translate','taxDocumentListService','$q','$log', controller: ['$scope', 'SweetAlert', '$translate', 'taxDocumentListService', '$q', '$log',
function($scope,SweetAlert,$translate,taxDocumentListService,$q,$log){ function ($scope, SweetAlert, $translate, taxDocumentListService, $q, $log) {
$scope.exportTableData = function () $scope.exportTableData = function () {
{
$scope.queryFieldModel.currentPage = $scope.pagingOptions.pageIndex; $scope.queryFieldModel.currentPage = $scope.pagingOptions.pageIndex;
$scope.queryFieldModel.pageSize = $scope.pagingOptions.pageSize; $scope.queryFieldModel.pageSize = $scope.pagingOptions.pageSize;
...@@ -2167,15 +2288,16 @@ taxDocumentManageModule.directive('exportPlugin',function(){ ...@@ -2167,15 +2288,16 @@ taxDocumentManageModule.directive('exportPlugin',function(){
} }
}); });
var params = angular.copy($scope.queryFieldModel); var params = angular.copy($scope.queryFieldModel);
params.ids=delIDs; params.ids = delIDs;
params.fileBeginTime = getQueryDate(params.fileBeginTime,"-"); params.fileBeginTime = getQueryDate(params.fileBeginTime, "-");
params.fileEndTTime = getQueryDate(params.fileEndTTime,"-"); params.fileEndTTime = getQueryDate(params.fileEndTTime, "-");
params.ownBeginTime = getQueryDate(params.ownBeginTime,"-"); params.ownBeginTime = getQueryDate(params.ownBeginTime, "-");
params.ownEndTime = getQueryDate(params.ownEndTime,"-"); params.ownEndTime = getQueryDate(params.ownEndTime, "-");
params.effectiveBeginTime = getQueryDate(params.effectiveBeginTime,"-"); params.effectiveBeginTime = getQueryDate(params.effectiveBeginTime, "-");
params.effectiveEndTime = getQueryDate(params.effectiveEndTime,"-"); params.effectiveEndTime = getQueryDate(params.effectiveEndTime, "-");
params.uploadBeginTime = getQueryDate(params.uploadBeginTime,"-"); params.uploadBeginTime = getQueryDate(params.uploadBeginTime, "-");
params.uploadEndTime = getQueryDate(params.uploadEndTime,"-"); params.uploadEndTime = getQueryDate(params.uploadEndTime, "-");
function getQueryDate(time, mark) { function getQueryDate(time, mark) {
if (!time) return ""; if (!time) return "";
var theDate = new Date(time); var theDate = new Date(time);
...@@ -2186,13 +2308,14 @@ taxDocumentManageModule.directive('exportPlugin',function(){ ...@@ -2186,13 +2308,14 @@ taxDocumentManageModule.directive('exportPlugin',function(){
dd = (dd + "").length < 2 ? "0" + dd : dd; dd = (dd + "").length < 2 ? "0" + dd : dd;
return year + mark + mm + mark + dd; return year + mark + mm + mark + dd;
} }
taxDocumentListService.exportTableData(params).then(function (data, status, headers) { taxDocumentListService.exportTableData(params).then(function (data, status, headers) {
if(status===204){ if (status === 204) {
SweetAlert.warning("没有数据可以下载"); SweetAlert.warning("没有数据可以下载");
return; return;
} }
exportToExcel(data, 'taxDocument.xls'); exportToExcel(data, 'taxDocument.xls');
},function () { }, function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator')); SweetAlert.error($translate.instant('PleaseContactAdministrator'));
})/*.error(function () { })/*.error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator')); SweetAlert.error($translate.instant('PleaseContactAdministrator'));
...@@ -2220,7 +2343,7 @@ taxDocumentManageModule.directive('exportPlugin',function(){ ...@@ -2220,7 +2343,7 @@ taxDocumentManageModule.directive('exportPlugin',function(){
try { try {
// Try using msSaveBlob if supported // Try using msSaveBlob if supported
//console.log("Trying saveBlob method ..."); //console.log("Trying saveBlob method ...");
var blob = new Blob([data], { type: "arraybuffer" }); var blob = new Blob([data], {type: "arraybuffer"});
if (navigator.msSaveBlob) if (navigator.msSaveBlob)
navigator.msSaveBlob(blob, filename); navigator.msSaveBlob(blob, filename);
else { else {
...@@ -2247,7 +2370,7 @@ taxDocumentManageModule.directive('exportPlugin',function(){ ...@@ -2247,7 +2370,7 @@ taxDocumentManageModule.directive('exportPlugin',function(){
try { try {
// Prepare a blob URL // Prepare a blob URL
//console.log("Trying download link method with simulated click ..."); //console.log("Trying download link method with simulated click ...");
var blobdownload = new Blob([data], { type: "arraybuffer" }); var blobdownload = new Blob([data], {type: "arraybuffer"});
var urldownload = urlCreator.createObjectURL(blobdownload); var urldownload = urlCreator.createObjectURL(blobdownload);
link.setAttribute('href', urldownload); link.setAttribute('href', urldownload);
...@@ -2274,7 +2397,7 @@ taxDocumentManageModule.directive('exportPlugin',function(){ ...@@ -2274,7 +2397,7 @@ taxDocumentManageModule.directive('exportPlugin',function(){
// Prepare a blob URL // Prepare a blob URL
// Use application/octet-stream when using window.location to force download // Use application/octet-stream when using window.location to force download
//console.log("Trying download link method with window.location ..."); //console.log("Trying download link method with window.location ...");
var blobsuccess = new Blob([data], { type: "arraybuffer" }); var blobsuccess = new Blob([data], {type: "arraybuffer"});
var urlsuccess = urlCreator.createObjectURL(blobsuccess); var urlsuccess = urlCreator.createObjectURL(blobsuccess);
window.location = urlsuccess; window.location = urlsuccess;
//console.log("Download link method with window.location succeeded"); //console.log("Download link method with window.location succeeded");
......
...@@ -478,16 +478,18 @@ ...@@ -478,16 +478,18 @@
<span translate="CorporationName"></span> <span translate="CorporationName"></span>
</div> </div>
<div class="TDL-query-val"> <div class="TDL-query-val">
<select ng-model="queryFieldModel.companyName" class="form-control radius3" <div dx-select-box="queryOrgOptions"></div>
title="{{queryFieldModel.companyName}}" required
ng-change="matchCompanyId(queryFieldModel,companyNameOptionsMap)" <!--<select ng-model="queryFieldModel.companyName" class="form-control radius3"-->
placeholder="{{'PleaseSelected' | translate}}"> <!--title="{{queryFieldModel.companyName}}" required-->
<option value=""></option> <!--ng-change="matchCompanyId(queryFieldModel,companyNameOptionsMap)"-->
<option ng-repeat="(key,companyName) in companyNameOptionsMap" <!--placeholder="{{'PleaseSelected' | translate}}">-->
ng-slected="queryFieldModel.companyName == companyName" <!--<option value=""></option>-->
value="{{companyName}}">{{companyName}} <!--<option ng-repeat="(key,companyName) in companyNameOptionsMap"-->
</option> <!--ng-slected="queryFieldModel.companyName == companyName"-->
</select> <!--value="{{companyName}}">{{companyName}}-->
<!--</option>-->
<!--</select>-->
</div> </div>
</div> </div>
<div class="TDL-query-block"> <div class="TDL-query-block">
...@@ -744,16 +746,18 @@ ...@@ -744,16 +746,18 @@
{{'CorporationName' | translate}} {{'CorporationName' | translate}}
</label> </label>
<div class="col-sm-11" style="width:61.67%" id="companyNameOptionsMap"> <div class="col-sm-11" style="width:61.67%" id="companyNameOptionsMap">
<select ng-model="editFieldModel.companyName" class="form-control" <div dx-select-box="editOrgOptions"></div>
title="{{editFieldModel.companyName}}" required
ng-change="matchCompanyId(editFieldModel,companyNameOptionsMap)" <!--<select ng-model="editFieldModel.companyName" class="form-control"-->
placeholder="{{'PleaseSelected' | translate}}"> <!--title="{{editFieldModel.companyName}}" required-->
<option value=""></option> <!--ng-change="matchCompanyId(editFieldModel,companyNameOptionsMap)"-->
<option ng-repeat="(key,companyName) in companyNameOptionsMap" <!--placeholder="{{'PleaseSelected' | translate}}">-->
ng-selected="(editFieldModel.companyName == companyName)" <!--<option value=""></option>-->
value="{{companyName}}">{{companyName}} <!--<option ng-repeat="(key,companyName) in companyNameOptionsMap"-->
</option> <!--ng-selected="(editFieldModel.companyName == companyName)"-->
</select> <!--value="{{companyName}}">{{companyName}}-->
<!--</option>-->
<!--</select>-->
</div> </div>
</div> </div>
<div class="col-sm-6 form-group"> <div class="col-sm-6 form-group">
...@@ -986,17 +990,19 @@ ...@@ -986,17 +990,19 @@
{{'CorporationName' | translate}} {{'CorporationName' | translate}}
</label> </label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
<select ng-model="editFieldItem.companyName" class="form-control" <div dx-select-box="editFieldItemOrgOptions"></div>
title="{{editFieldItem.companyName}}"
ng-class="{'upload-fail-mark':!editFieldItem.companyName}" <!--<select ng-model="editFieldItem.companyName" class="form-control"-->
ng-change="matchCompanyId(editFieldItem,companyNameOptionsMap)" <!--title="{{editFieldItem.companyName}}"-->
placeholder="{{'PleaseSelected' | translate}}"> <!--ng-class="{'upload-fail-mark':!editFieldItem.companyName}"-->
<option value=""></option> <!--ng-change="matchCompanyId(editFieldItem,companyNameOptionsMap)"-->
<option ng-repeat="(key,companyName) in companyNameOptionsMap" <!--placeholder="{{'PleaseSelected' | translate}}">-->
ng-selected="(editFieldItem.companyName == companyName)" <!--<option value=""></option>-->
value="{{companyName}}">{{companyName}} <!--<option ng-repeat="(key,companyName) in companyNameOptionsMap"-->
</option> <!--ng-selected="(editFieldItem.companyName == companyName)"-->
</select> <!--value="{{companyName}}">{{companyName}}-->
<!--</option>-->
<!--</select>-->
</div> </div>
</div> </div>
<div class="col-sm-6 form-group"> <div class="col-sm-6 form-group">
...@@ -1398,28 +1404,13 @@ ...@@ -1398,28 +1404,13 @@
</div> </div>
</div>--> </div>-->
<div class="modal fade" id="filePreviewPop" file-preview tabindex="-1" role="dialog" aria-labelledby="myModal"
data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width:80%;" role="document">
<div class="modal-content">
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideFilePreviewPop()">×</span>
<div class="modal-title">{{currentSheetName}}</div>
</div>
<div class="modal-body">
<div class="dx-viewport demo-container" id="preview_dataGrid">
</div>
</div>
<div class="TDL-pdf-layout-dialog" id="filePreviewPop" file-preview >
<div class="wrapper TDL-pdf-preview-pop" id="excetlContainer">
</div> </div>
<button class="TDL-pdf-preview-pop-close-btn" ng-click="hideFilePreviewPop()">×</button>
<button class="TDL-pdf-paging-btn TDL-pdf-paging-btn-prev" ng-click="prevPaging_xls()" title="上一页">&lt;
</button>
<button class="TDL-pdf-paging-btn TDL-pdf-paging-btn-next" ng-click="nextPaging_xls()" title="下一页">&gt;
</button>
</div> </div>
</div>
<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:60%;max-width:960px" role="document"> <div class="modal-dialog" style="width:60%;max-width:960px" role="document">
......
...@@ -165,6 +165,33 @@ taxDocumentManageModule.factory('taxDocumentListService', ...@@ -165,6 +165,33 @@ taxDocumentManageModule.factory('taxDocumentListService',
xhr.send(JSON.stringify(params)); xhr.send(JSON.stringify(params));
return defer.promise; return defer.promise;
},
viewExcelBySpread:function (url) {
var deferred = $q.defer();
var promise = deferred.promise;
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true); // 也可以使用POST方式,根据接口
xhr.responseType = "blob"; // 返回类型blob
// 定义请求完成的处理函数,请求前也可以增加加载框/禁用下载按钮逻辑
xhr.onload = function () {
// 请求完成
if (this.status === 200) {
// 返回200
var blob = this.response;
var excelIo = new GC.Spread.Excel.IO();
excelIo.open(blob, function (json) {
deferred.resolve(json);
}, function (e) {
// console.error(e.errorMessage);
//alert(e.errorMessage);
deferred.reject(e.errorMessage);
}, {});
}
};
// 发送ajax请求
xhr.send();
return promise;
} }
}; };
}]); }]);
\ 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