Commit 207adb55 authored by chase's avatar chase

merge 档案管理代码

parent 0a09390b
...@@ -9,10 +9,10 @@ public class ReportFileUploadEnum { ...@@ -9,10 +9,10 @@ public class ReportFileUploadEnum {
* 报表类型 * 报表类型
*/ */
public enum ReportType { public enum ReportType {
NORMAL_DECLARATION("NORMAL_DECLARATION", "增值税纳税申报表"), NORMAL_DECLARATION("增值税纳税申报表", "增值税纳税申报表"),
CORR_DECLARATION("CORR_DECLARATION", "增值税更正申报表"), CORR_DECLARATION("增值税更正申报表", "增值税更正申报表"),
NORMAL_TAX_RECEIPT("NORMAL_TAX_RECEIPT", "增值税纳税税票"), NORMAL_TAX_RECEIPT("增值税纳税税票", "增值税纳税税票"),
CORR_TAX_RECEIPT("CORR_TAX_RECEIPT", "增值税更正税票"); CORR_TAX_RECEIPT("增值税更正税票", "增值税更正税票");
private String code; private String code;
private String name; private String name;
public static final Map<String, String> MAPPING = new HashMap<>(); public static final Map<String, String> MAPPING = new HashMap<>();
......
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import net.sf.json.JSONNull;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -17,7 +26,10 @@ import pwc.taxtech.atms.thirdparty.ExcelUtil; ...@@ -17,7 +26,10 @@ import pwc.taxtech.atms.thirdparty.ExcelUtil;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -71,6 +83,7 @@ public class TaxDocumentController { ...@@ -71,6 +83,7 @@ public class TaxDocumentController {
return taxDocumentService.editFilesType(taxDocument); return taxDocumentService.editFilesType(taxDocument);
} }
@RequestMapping("exportExcel") @RequestMapping("exportExcel")
@ResponseBody @ResponseBody
public void exportExcelFile(HttpServletResponse response, @RequestBody TaxDocumentDto taxDocumentDto) { public void exportExcelFile(HttpServletResponse response, @RequestBody TaxDocumentDto taxDocumentDto) {
...@@ -147,4 +160,142 @@ public class TaxDocumentController { ...@@ -147,4 +160,142 @@ public class TaxDocumentController {
} }
/**
* 读取Excel转换成 Json
* @param path 文件的路径
*/
@PostMapping("/previewExcelToJson")
@ResponseBody
public String previewExcel(String path) {
try {
JSONArray dataArray = new JSONArray();
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(new FileInputStream(path));
// 循环工作表Sheet
for (int numSheet = 0; numSheet < xssfWorkbook.getNumberOfSheets(); numSheet++) {
XSSFSheet xssfSheet = xssfWorkbook.getSheetAt(numSheet);
String sheetName = xssfSheet.getSheetName();
if (xssfSheet == null) {
continue;
}
//当前sheet的json文件
JSONObject sheetJson = new JSONObject();
//当前sheet的array,作为sheetJson 的value值
JSONArray sheetArr = new JSONArray();
//sheet的第一行,获取作为json的key值
JSONArray key = new JSONArray();
int xssfLastRowNum = xssfSheet.getLastRowNum();
// 循环行Row
for (int rowNum = 0; rowNum <= xssfLastRowNum; rowNum++) {
XSSFRow xssfRow = xssfSheet.getRow(rowNum);
if (xssfRow == null) {
continue;
}
// 循环列Cell,在这里组合json文件
int firstCellNum = xssfRow.getFirstCellNum();
int lastCellNum = xssfRow.getLastCellNum();
JSONObject rowJson = new JSONObject();
for (int cellNum = firstCellNum; cellNum < lastCellNum; cellNum++) {
XSSFCell cell = null;
try {
cell = xssfRow.getCell(cellNum);
if (cell == null) {
rowJson.put(key.getString(cellNum), "");
continue;
}
if (rowNum == 0)
key.add(toString(cell));
else {
//若是列号超过了key的大小,则跳过
if (cellNum >= key.size()) continue;
rowJson.put(key.getString(cellNum), toString(cell));
}
} catch (Exception e) {
e.printStackTrace();
}
}
if (rowJson.keySet().size() > 0)
sheetArr.add(rowJson);
}
sheetJson.put(sheetName, shuffleData(sheetArr));
dataArray.add(sheetJson);
}
return dataArray.toString();
} catch (IOException e) {
e.printStackTrace();
return JSONNull.getInstance().toString();
}
}
/**
* 解析json
* @param cell
* @return
*/
private static Object toString(XSSFCell cell) {
switch (cell.getCellTypeEnum()) {
case _NONE:
cell.setCellType(CellType.STRING);
return "";
case NUMERIC:
if (DateUtil.isCellDateFormatted(cell)) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
return sdf.format(cell.getDateCellValue());
}
cell.setCellType(CellType.STRING);
return cell.getStringCellValue();
case STRING:
String val = cell.getStringCellValue();
if ("无".equalsIgnoreCase(val)) return "";
//将其中的map格式和数组格式的字符串,转化为相应的数据类型
if (val.indexOf("{") > -1) {
// JSONObject jsonObject = JSONObject.parseObject(val);
Map<String, Integer> mapJson = JSONObject.parseObject(val,HashMap.class);
return mapJson;
}
if (val.indexOf("[") > -1) {
val = val.substring(1, val.length() - 1);
String[] array = val.split(",");
return array;
}
return val;
case FORMULA:
return cell.getCellFormula();
case BLANK:
return "";
case BOOLEAN:
return cell.getBooleanCellValue() + "";
case ERROR:
return "非法字符";
default:
return "未知字符";
}
}
/**
* 输出数据
*/
private static JSONArray shuffleData(JSONArray sheetArr) {
JSONArray array = new JSONArray();
for (int i = 0; i < sheetArr.size(); i++) {
JSONObject object = sheetArr.getJSONObject(i);
int count = 0;
int length = 0;
for (Object key : object.keySet()) {
Object o = object.get((String) key);
length++;
boolean b = StringUtils.isEmpty(o.toString());
if (b) {
count++;
}
}
if (count != length) {
array.add(object);
}
}
return array;
}
} }
...@@ -23,7 +23,7 @@ public class TaxDocumentDto { ...@@ -23,7 +23,7 @@ public class TaxDocumentDto {
private String businessLine;//业务线 private String businessLine;//业务线
private Integer companyId;//公司代码Id private String companyId;//公司代码Id
private String companyName;//公司名称 private String companyName;//公司名称
...@@ -53,9 +53,7 @@ public class TaxDocumentDto { ...@@ -53,9 +53,7 @@ public class TaxDocumentDto {
private String physicalIndexNumber;//实物索引号 private String physicalIndexNumber;//实物索引号
private Date ownBeginTime;//所属期间_开始 private Integer ownTime;//所属期间
private Date ownEndTime;//所属期间_结束
private Integer auditStatus;//审核状态 private Integer auditStatus;//审核状态
...@@ -111,22 +109,6 @@ public class TaxDocumentDto { ...@@ -111,22 +109,6 @@ public class TaxDocumentDto {
this.effectiveEndTime = effectiveEndTime; this.effectiveEndTime = effectiveEndTime;
} }
public Date getOwnBeginTime() {
return ownBeginTime;
}
public void setOwnBeginTime(Date ownBeginTime) {
this.ownBeginTime = ownBeginTime;
}
public Date getOwnEndTime() {
return ownEndTime;
}
public void setOwnEndTime(Date ownEndTime) {
this.ownEndTime = ownEndTime;
}
public String getPhysicalIndexNumber() { public String getPhysicalIndexNumber() {
return physicalIndexNumber; return physicalIndexNumber;
} }
...@@ -215,14 +197,22 @@ public class TaxDocumentDto { ...@@ -215,14 +197,22 @@ public class TaxDocumentDto {
this.businessLine = businessLine; this.businessLine = businessLine;
} }
public Integer getCompanyId() { public String getCompanyId() {
return companyId; return companyId;
} }
public void setCompanyId(Integer companyId) { public void setCompanyId(String companyId) {
this.companyId = companyId; this.companyId = companyId;
} }
public Integer getOwnTime() {
return ownTime;
}
public void setOwnTime(Integer ownTime) {
this.ownTime = ownTime;
}
public String getCompanyName() { public String getCompanyName() {
return companyName; return companyName;
} }
......
...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.service.impl; ...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.service.impl;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -17,6 +18,8 @@ import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult; ...@@ -17,6 +18,8 @@ import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult;
import pwc.taxtech.atms.dto.reportFileUpload.ReportFileUploadParam; import pwc.taxtech.atms.dto.reportFileUpload.ReportFileUploadParam;
import pwc.taxtech.atms.dto.reportFileUpload.ReportFileUploadResult; import pwc.taxtech.atms.dto.reportFileUpload.ReportFileUploadResult;
import pwc.taxtech.atms.entity.Project; import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.entity.ProjectExample;
import pwc.taxtech.atms.entity.TaxDocument;
import pwc.taxtech.atms.entity.User; import pwc.taxtech.atms.entity.User;
import pwc.taxtech.atms.exception.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.vat.dao.ReportFileUploadMapper; import pwc.taxtech.atms.vat.dao.ReportFileUploadMapper;
...@@ -47,6 +50,8 @@ public class ReportFileUploadService extends BaseService { ...@@ -47,6 +50,8 @@ public class ReportFileUploadService extends BaseService {
@Autowired @Autowired
DidiFileUploadService didiFileUploadService; DidiFileUploadService didiFileUploadService;
@Autowired
TaxDocumentServiceImpl taxDocumentService;
public List<ReportFileUploadResult> queryData(ReportFileUploadParam param) { public List<ReportFileUploadResult> queryData(ReportFileUploadParam param) {
ReportFileUploadExample example = new ReportFileUploadExample(); ReportFileUploadExample example = new ReportFileUploadExample();
example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod()); example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod());
...@@ -103,12 +108,31 @@ public class ReportFileUploadService extends BaseService { ...@@ -103,12 +108,31 @@ public class ReportFileUploadService extends BaseService {
String uid = authUserHelper.getCurrentUserId(); String uid = authUserHelper.getCurrentUserId();
User user = userMapper.selectByPrimaryKey(uid); User user = userMapper.selectByPrimaryKey(uid);
data.setCreator(user.getUserName()); data.setCreator(user.getUserName());
Project project = projectMapper.selectByPrimaryKey(data.getProjectId());
data.setOrgId(project.getOrganizationId());
ReportFileUploadExample example = new ReportFileUploadExample(); ReportFileUploadExample example = new ReportFileUploadExample();
example.createCriteria().andProjectIdEqualTo(data.getProjectId()).andPeriodEqualTo(data.getPeriod()).andReportTypeEqualTo(data.getReportType()); example.createCriteria().andProjectIdEqualTo(data.getProjectId()).andPeriodEqualTo(data.getPeriod()).andReportTypeEqualTo(data.getReportType());
FileUpload fileUpload = didiFileUploadService.uploadFile(file, file.getOriginalFilename(), FileUploadEnum.BizSource.REPORT_UPLOAD.name()); if (StringUtils.isBlank(data.getFileUploadId())) {
data.setFileUploadId(fileUpload.getUid()); FileUpload fileUpload = didiFileUploadService.uploadFile(file, file.getOriginalFilename(), FileUploadEnum.BizSource.REPORT_UPLOAD.name());
data.setFileUploadId(fileUpload.getUid());
}
if (StringUtils.isBlank(data.getProjectId()) && StringUtils.isNotBlank(data.getOrgId()) && data.getPeriod() != null) {
ProjectExample projectExample = new ProjectExample();
projectExample.createCriteria().andOrganizationIdEqualTo(data.getOrgId()).andYearEqualTo(data.getPeriod()/100);
List<Project> projects = projectMapper.selectByExample(projectExample);
if(CollectionUtils.isNotEmpty(projects)){
data.setProjectId(projects.get(0).getId());
TaxDocument taxDocument = new TaxDocument();
taxDocument.setCompanyId(projects.get(0).getOrganizationId());
taxDocument.setFileUploadId(data.getFileUploadId());
taxDocument.setEnable("T");
taxDocument.setOwnTime(data.getPeriod());
taxDocument.setFileType(data.getReportType());
taxDocumentService.addTaxDocumentList(file,taxDocument);
}
}else {
Project project = projectMapper.selectByPrimaryKey(data.getProjectId());
data.setOrgId(project.getOrganizationId());
}
data.setUid(CommonUtils.getUUID()); data.setUid(CommonUtils.getUUID());
data.setCreateTime(new Date()); data.setCreateTime(new Date());
data.setReportFileName(file.getOriginalFilename()); data.setReportFileName(file.getOriginalFilename());
......
...@@ -10,6 +10,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -10,6 +10,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.AuthUserHelper; import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.constant.enums.FileUploadEnum; import pwc.taxtech.atms.constant.enums.FileUploadEnum;
import pwc.taxtech.atms.constant.enums.ReportFileUploadEnum;
import pwc.taxtech.atms.dao.TaxDocumentMapper; import pwc.taxtech.atms.dao.TaxDocumentMapper;
import pwc.taxtech.atms.dto.TaxDocumentDto; import pwc.taxtech.atms.dto.TaxDocumentDto;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam; import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam;
...@@ -18,6 +19,7 @@ import pwc.taxtech.atms.entity.OperationLogTaxDocument; ...@@ -18,6 +19,7 @@ import pwc.taxtech.atms.entity.OperationLogTaxDocument;
import pwc.taxtech.atms.entity.TaxDocument; import pwc.taxtech.atms.entity.TaxDocument;
import pwc.taxtech.atms.entity.TaxDocumentExample; import pwc.taxtech.atms.entity.TaxDocumentExample;
import pwc.taxtech.atms.vat.entity.FileUpload; import pwc.taxtech.atms.vat.entity.FileUpload;
import pwc.taxtech.atms.vat.entity.ReportFileUpload;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
...@@ -39,6 +41,8 @@ public class TaxDocumentServiceImpl { ...@@ -39,6 +41,8 @@ public class TaxDocumentServiceImpl {
@Autowired @Autowired
private OperationLogTaxDocServiceImpl operationLogTaxDocService; private OperationLogTaxDocServiceImpl operationLogTaxDocService;
@Autowired
ReportFileUploadService reportFileUploadService;
@Autowired @Autowired
DidiFileUploadService didiFileUploadService; DidiFileUploadService didiFileUploadService;
...@@ -86,8 +90,8 @@ public class TaxDocumentServiceImpl { ...@@ -86,8 +90,8 @@ public class TaxDocumentServiceImpl {
criteria.andFileTimeBetween(taxDocumentDto.getFileBeginTime(), taxDocumentDto.getFileEndTTime()); criteria.andFileTimeBetween(taxDocumentDto.getFileBeginTime(), taxDocumentDto.getFileEndTTime());
} }
//所属时间 ownTime //所属时间 ownTime
if (null != taxDocumentDto.getOwnBeginTime() && null != taxDocumentDto.getOwnEndTime()) { if (null != taxDocumentDto.getOwnTime()) {
criteria.andOwnTimeBetween(taxDocumentDto.getOwnBeginTime(), taxDocumentDto.getOwnEndTime()); criteria.andOwnTimeEqualTo(taxDocumentDto.getOwnTime());
} }
//档案名称 fileName //档案名称 fileName
if (StringUtils.isNotBlank(taxDocumentDto.getFileName())) { if (StringUtils.isNotBlank(taxDocumentDto.getFileName())) {
...@@ -140,9 +144,20 @@ public class TaxDocumentServiceImpl { ...@@ -140,9 +144,20 @@ public class TaxDocumentServiceImpl {
public synchronized boolean addTaxDocumentList(MultipartFile file, TaxDocument taxDocument) { public synchronized boolean addTaxDocumentList(MultipartFile file, TaxDocument taxDocument) {
try { try {
//上传文件 //上传文件
FileUpload fileUpload = didiFileUploadService.uploadFile(file,file.getOriginalFilename(), FileUploadEnum.BizSource.RECORD_UPLOAD.name()); if(StringUtils.isBlank(taxDocument.getFileUploadId())){
taxDocument.setFileUploadId(fileUpload.getUid()); FileUpload fileUpload = didiFileUploadService.uploadFile(file,file.getOriginalFilename(), FileUploadEnum.BizSource.RECORD_UPLOAD.name());
taxDocument.setFilePositionUrl(fileUpload.getViewHttpUrl()); taxDocument.setFileUploadId(fileUpload.getUid());
taxDocument.setFilePositionUrl(fileUpload.getViewHttpUrl());
if(ReportFileUploadEnum.ReportType.MAPPING.containsKey(taxDocument.getFileType())){
ReportFileUpload reportFileUpload = new ReportFileUpload();
reportFileUpload.setOrgId(taxDocument.getCompanyId());
reportFileUpload.setSourceType(ReportFileUploadEnum.SuorceType.RECORD.name());
reportFileUpload.setPeriod(taxDocument.getOwnTime());
reportFileUpload.setFileUploadId(fileUpload.getUid());
reportFileUpload.setReportType(taxDocument.getFileType());
reportFileUploadService.saveData(file,reportFileUpload);
}
}
//设置创建人 创建时间信息 设置年份区分 //设置创建人 创建时间信息 设置年份区分
taxDocument.setCreateTime(new Date()); taxDocument.setCreateTime(new Date());
taxDocument.setCreator(authUserHelper.getCurrentAuditor().get()); taxDocument.setCreator(authUserHelper.getCurrentAuditor().get());
......
...@@ -62,5 +62,28 @@ ...@@ -62,5 +62,28 @@
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.40</version> <version>1.2.40</version>
</dependency> </dependency>
<!--Excel to Json-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<!--Excel to Json End-->
</dependencies> </dependencies>
</project> </project>
...@@ -86,7 +86,7 @@ public class TaxDocument implements Serializable { ...@@ -86,7 +86,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
private Integer companyId; private String companyId;
/** /**
* Database Column Remarks: * Database Column Remarks:
...@@ -141,7 +141,7 @@ public class TaxDocument implements Serializable { ...@@ -141,7 +141,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
private Date ownTime; private int ownTime;
/** /**
* *
...@@ -344,11 +344,11 @@ public class TaxDocument implements Serializable { ...@@ -344,11 +344,11 @@ public class TaxDocument implements Serializable {
this.auditStatus = auditStatus; this.auditStatus = auditStatus;
} }
public Date getOwnTime() { public int getOwnTime() {
return ownTime; return ownTime;
} }
public void setOwnTime(Date ownTime) { public void setOwnTime(int ownTime) {
this.ownTime = ownTime; this.ownTime = ownTime;
} }
...@@ -520,7 +520,7 @@ public class TaxDocument implements Serializable { ...@@ -520,7 +520,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
public Integer getCompanyId() { public String getCompanyId() {
return companyId; return companyId;
} }
...@@ -532,7 +532,7 @@ public class TaxDocument implements Serializable { ...@@ -532,7 +532,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
public void setCompanyId(Integer companyId) { public void setCompanyId(String companyId) {
this.companyId = companyId; this.companyId = companyId;
} }
......
...@@ -865,6 +865,11 @@ public class TaxDocumentExample { ...@@ -865,6 +865,11 @@ public class TaxDocumentExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOwnTimeEqualTo(Integer value) {
addCriterion("own_time =", value, "ownTime");
return (Criteria) this;
}
public Criteria andFileTimeNotBetween(Date value1, Date value2) { public Criteria andFileTimeNotBetween(Date value1, Date value2) {
addCriterion("file_time not between", value1, value2, "fileTime"); addCriterion("file_time not between", value1, value2, "fileTime");
return (Criteria) this; return (Criteria) this;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<result column="file_type" jdbcType="VARCHAR" property="fileType"/> <result column="file_type" jdbcType="VARCHAR" property="fileType"/>
<result column="file_name" jdbcType="VARCHAR" property="fileName"/> <result column="file_name" jdbcType="VARCHAR" property="fileName"/>
<result column="business_line" jdbcType="VARCHAR" property="businessLine"/> <result column="business_line" jdbcType="VARCHAR" property="businessLine"/>
<result column="company_id" jdbcType="INTEGER" property="companyId"/> <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
<result column="company_name" jdbcType="VARCHAR" property="companyName"/> <result column="company_name" jdbcType="VARCHAR" property="companyName"/>
<result column="tax_type" jdbcType="VARCHAR" property="taxType"/> <result column="tax_type" jdbcType="VARCHAR" property="taxType"/>
<result column="file_time" jdbcType="TIMESTAMP" property="fileTime"/> <result column="file_time" jdbcType="TIMESTAMP" property="fileTime"/>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<result column="year_redundancy" jdbcType="INTEGER" property="yearRedundancy"/> <result column="year_redundancy" jdbcType="INTEGER" property="yearRedundancy"/>
<result column="audit_status" jdbcType="INTEGER" property="auditStatus"/> <result column="audit_status" jdbcType="INTEGER" property="auditStatus"/>
<result column="physical_index_number" jdbcType="VARCHAR" property="physicalIndexNumber"/> <result column="physical_index_number" jdbcType="VARCHAR" property="physicalIndexNumber"/>
<result column="own_time" jdbcType="TIMESTAMP" property="ownTime"/> <result column="own_time" jdbcType="INTEGER" property="ownTime"/>
<result column="enable" jdbcType="VARCHAR" property="enable"/> <result column="enable" jdbcType="VARCHAR" property="enable"/>
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
...@@ -175,14 +175,14 @@ ...@@ -175,14 +175,14 @@
year_redundancy,audit_status,physical_index_number,own_time) year_redundancy,audit_status,physical_index_number,own_time)
values (#{id,jdbcType=BIGINT}, #{fileAttr,jdbcType=VARCHAR}, #{fileTypeId,jdbcType=INTEGER}, values (#{id,jdbcType=BIGINT}, #{fileAttr,jdbcType=VARCHAR}, #{fileTypeId,jdbcType=INTEGER},
#{fileType,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, #{businessLine,jdbcType=VARCHAR}, #{fileType,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, #{businessLine,jdbcType=VARCHAR},
#{companyId,jdbcType=INTEGER}, #{companyName,jdbcType=VARCHAR}, #{taxType,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{taxType,jdbcType=VARCHAR},
#{fileTime,jdbcType=TIMESTAMP}, #{effectiveTime,jdbcType=TIMESTAMP}, #{creatorId,jdbcType=INTEGER}, #{fileTime,jdbcType=TIMESTAMP}, #{effectiveTime,jdbcType=TIMESTAMP}, #{creatorId,jdbcType=INTEGER},
#{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{uploadTime,jdbcType=TIMESTAMP}, #{storageArea,jdbcType=VARCHAR}, #{keeperId,jdbcType=INTEGER}, #{uploadTime,jdbcType=TIMESTAMP}, #{storageArea,jdbcType=VARCHAR}, #{keeperId,jdbcType=INTEGER},
#{keeper,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{fileOriginalName,jdbcType=VARCHAR}, #{keeper,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{fileOriginalName,jdbcType=VARCHAR},
#{fileUploadId,jdbcType=VARCHAR}, #{filePositionUrl,jdbcType=VARCHAR}, #{fileUploadId,jdbcType=VARCHAR}, #{filePositionUrl,jdbcType=VARCHAR},
#{yearRedundancy,jdbcType=INTEGER},#{auditStatus,jdbcType=INTEGER},#{physicalIndexNumber,jdbcType=VARCHAR}, #{yearRedundancy,jdbcType=INTEGER},#{auditStatus,jdbcType=INTEGER},#{physicalIndexNumber,jdbcType=VARCHAR},
#{ownTime,jdbcType=TIMESTAMP}) #{ownTime,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.TaxDocument"> <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.TaxDocument">
<!-- <!--
...@@ -277,8 +277,8 @@ ...@@ -277,8 +277,8 @@
<if test="businessLine != null"> <if test="businessLine != null">
#{businessLine,jdbcType=VARCHAR}, #{businessLine,jdbcType=VARCHAR},
</if> </if>
<if test="companyId != null"> <if test="companyId != null and companyId != ''">
#{companyId,jdbcType=INTEGER}, #{companyId,jdbcType=VARCHAR},
</if> </if>
<if test="companyName != null"> <if test="companyName != null">
#{companyName,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR},
...@@ -363,7 +363,7 @@ ...@@ -363,7 +363,7 @@
business_line = #{record.businessLine,jdbcType=VARCHAR}, business_line = #{record.businessLine,jdbcType=VARCHAR},
</if> </if>
<if test="record.companyId != null"> <if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=INTEGER}, company_id = #{record.companyId,jdbcType=VARCHAR},
</if> </if>
<if test="record.companyName != null"> <if test="record.companyName != null">
company_name = #{record.companyName,jdbcType=VARCHAR}, company_name = #{record.companyName,jdbcType=VARCHAR},
...@@ -427,7 +427,7 @@ ...@@ -427,7 +427,7 @@
file_type = #{record.fileType,jdbcType=VARCHAR}, file_type = #{record.fileType,jdbcType=VARCHAR},
file_name = #{record.fileName,jdbcType=VARCHAR}, file_name = #{record.fileName,jdbcType=VARCHAR},
business_line = #{record.businessLine,jdbcType=VARCHAR}, business_line = #{record.businessLine,jdbcType=VARCHAR},
company_id = #{record.companyId,jdbcType=INTEGER}, company_id = #{record.companyId,jdbcType=VARCHAR},
company_name = #{record.companyName,jdbcType=VARCHAR}, company_name = #{record.companyName,jdbcType=VARCHAR},
tax_type = #{record.taxType,jdbcType=VARCHAR}, tax_type = #{record.taxType,jdbcType=VARCHAR},
file_time = #{record.fileTime,jdbcType=TIMESTAMP}, file_time = #{record.fileTime,jdbcType=TIMESTAMP},
...@@ -445,7 +445,7 @@ ...@@ -445,7 +445,7 @@
year_redundancy = #{record.yearRedundancy,jdbcType=INTEGER}, year_redundancy = #{record.yearRedundancy,jdbcType=INTEGER},
audit_status = #{record.auditStatus,jdbcType=INTEGER}, audit_status = #{record.auditStatus,jdbcType=INTEGER},
physical_index_number = #{record.physicalIndexNumber,jdbcType=VARCHAR}, physical_index_number = #{record.physicalIndexNumber,jdbcType=VARCHAR},
own_time = #{record.ownTime,jdbcType=TIMESTAMP} own_time = #{record.ownTime,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/> <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
...@@ -473,7 +473,7 @@ ...@@ -473,7 +473,7 @@
business_line = #{businessLine,jdbcType=VARCHAR}, business_line = #{businessLine,jdbcType=VARCHAR},
</if> </if>
<if test="companyId != null"> <if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER}, company_id = #{companyId,jdbcType=VARCHAR},
</if> </if>
<if test="companyName != null"> <if test="companyName != null">
company_name = #{companyName,jdbcType=VARCHAR}, company_name = #{companyName,jdbcType=VARCHAR},
...@@ -545,8 +545,8 @@ ...@@ -545,8 +545,8 @@
<if test="null != businessLine and '' != businessLine"> <if test="null != businessLine and '' != businessLine">
business_line = #{businessLine,jdbcType=VARCHAR}, business_line = #{businessLine,jdbcType=VARCHAR},
</if> </if>
<if test="null != companyId"> <if test="null != companyId and '' != companyId">
company_id = #{companyId,jdbcType=INTEGER}, company_id = #{companyId,jdbcType=VARCHAR},
</if> </if>
<if test="null != companyName and '' != companyName"> <if test="null != companyName and '' != companyName">
company_name = #{companyName,jdbcType=VARCHAR}, company_name = #{companyName,jdbcType=VARCHAR},
...@@ -597,7 +597,7 @@ ...@@ -597,7 +597,7 @@
physical_index_number = #{physicalIndexNumber,jdbcType=VARCHAR}, physical_index_number = #{physicalIndexNumber,jdbcType=VARCHAR},
</if> </if>
<if test="null != ownTime"> <if test="null != ownTime">
own_time = #{ownTime,jdbcType=TIMESTAMP}, own_time = #{ownTime,jdbcType=INTEGER},
</if> </if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
......
...@@ -408,6 +408,7 @@ ...@@ -408,6 +408,7 @@
"MappingInvoice": "关联管理", "MappingInvoice": "关联管理",
"MenuAMVAT": "资管增值税申报", "MenuAMVAT": "资管增值税申报",
"MenuCIT": "企业所得税申报", "MenuCIT": "企业所得税申报",
"MenuRecordManage": "档案管理",
"MenuCashFlow": "税务现金流", "MenuCashFlow": "税务现金流",
"MenuDeferredTax": "递延所得税", "MenuDeferredTax": "递延所得税",
"MenuIndexAnalytics": "税务指标分析", "MenuIndexAnalytics": "税务指标分析",
......
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
if (rowId) { if (rowId) {
$scope.confirmDocFileType = editDocFileType; $scope.confirmDocFileType = editDocFileType;
$scope.localData.forEach(function(item){ $scope.localData.forEach(function(item){
if(item.id === rowId){ if(item.id == rowId){
$scope.editModel = angular.copy(item); $scope.editModel = angular.copy(item);
} }
}); });
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
var uploadModel = angular.copy($scope.editModel); var uploadModel = angular.copy($scope.editModel);
delete uploadModel.id; //新增文档不需要上传ID delete uploadModel.id; //新增文档不需要上传ID
docManageService.addFileType(uploadModel).then(function (data) { docManageService.addFileType(uploadModel).then(function (data) {
if(data === true){ if(data == true){
SweetAlert.success($translate.instant('SaveSuccess')); SweetAlert.success($translate.instant('SaveSuccess'));
$scope.loadMainData(); $scope.loadMainData();
}else{ }else{
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
var editDocFileType = function () { var editDocFileType = function () {
var uploadModel = angular.copy($scope.editModel); var uploadModel = angular.copy($scope.editModel);
docManageService.editFileType(uploadModel).then(function (data) { docManageService.editFileType(uploadModel).then(function (data) {
if(data === true){ if(data == true){
SweetAlert.success($translate.instant('SaveSuccess')); SweetAlert.success($translate.instant('SaveSuccess'));
$scope.loadMainData(); $scope.loadMainData();
}else{ }else{
......
...@@ -115,12 +115,14 @@ ...@@ -115,12 +115,14 @@
allowHeaderFiltering: true, allowHeaderFiltering: true,
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
if (!options.data.sourceType || "VAT" == options.data.sourceType) {
$("<a href='javascript:void(0)'>上传</a>").on('click', function () { $("<a href='javascript:void(0)'>上传</a>").on('click', function () {
$('#uploadBut' + options.data.reportType).click(); $('#uploadBut' + options.data.reportType).click();
}).appendTo(container); }).appendTo(container);
$('<input type="file" style="display:none;" id="uploadBut' + options.data.reportType + '" />').on('change', function () { $('<input type="file" style="display:none;" id="uploadBut' + options.data.reportType + '" />').on('change', function () {
uploadFile($('#uploadBut' + options.data.reportType)[0].files[0], options.data.reportType); uploadFile($('#uploadBut' + options.data.reportType)[0].files[0], options.data.reportType);
}).appendTo(container); }).appendTo(container);
}
} catch (e) { } catch (e) {
$log.error(e); $log.error(e);
} }
...@@ -210,12 +212,14 @@ ...@@ -210,12 +212,14 @@
allowHeaderFiltering: true, allowHeaderFiltering: true,
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
$("<a href='javascript:void(0)'>上传</a>").on('click', function () { if (!options.data.sourceType || "VAT" == options.data.sourceType) {
$('#uploadBut' + options.data.reportType).click(); $("<a href='javascript:void(0)'>上传</a>").on('click', function () {
}).appendTo(container); $('#uploadBut' + options.data.reportType).click();
$('<input type="file" style="display:none;" id="uploadBut' + options.data.reportType + '" />').on('change', function () { }).appendTo(container);
uploadFile($('#uploadBut' + options.data.reportType)[0].files[0], options.data.reportType); $('<input type="file" style="display:none;" id="uploadBut' + options.data.reportType + '" />').on('change', function () {
}).appendTo(container); uploadFile($('#uploadBut' + options.data.reportType)[0].files[0], options.data.reportType);
}).appendTo(container);
}
} catch (e) { } catch (e) {
$log.error(e); $log.error(e);
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</div> </div>
<div class="nav-element-left"> <div class="nav-element-left">
<a ui-sref="taxDocumentManage"> <a ui-sref="taxDocumentManage">
<span class="nav-icon-color">档案管理</span> <span class="nav-icon-color">{{'MenuRecordManage' | translate}}</span>
</a> </a>
</div> </div>
<!--<div class="nav-element-left">--> <!--<div class="nav-element-left">-->
......
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
* Created by Administrator on 2019/3/1 0001. * Created by Administrator on 2019/3/1 0001.
*/ */
taxDocumentManageModule.controller('taxDocumentListController', taxDocumentManageModule.controller('taxDocumentListController',
['$log', '$http', '$q', '$scope', '$translate', '$timeout', 'SweetAlert', '$compile', 'taxDocumentListService', '$filter','apiInterceptor', ['$log', '$http', '$q', '$scope', '$translate', '$timeout',
function ($log, $http, $q, $scope, $translate, $timeout, SweetAlert, $compile, taxDocumentListService, $filter,apiInterceptor) { 'SweetAlert', '$compile', 'taxDocumentListService', '$filter','apiInterceptor',
function ($log, $http, $q, $scope, $translate, $timeout,
SweetAlert, $compile, taxDocumentListService, $filter,apiInterceptor) {
$scope.queryFieldModel = {}; $scope.queryFieldModel = {};
$scope.editFieldModel = { $scope.editFieldModel = {
...@@ -18,18 +20,18 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -18,18 +20,18 @@ taxDocumentManageModule.controller('taxDocumentListController',
}; };
$scope.pagingOptions = { $scope.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
pageSize: 10, //每页多少条数据
pageSizeString: '10',
}; };
$scope.localData = null; $scope.localData = null;
$scope.loadMainData = function () { $scope.loadMainData = 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;
taxDocumentListService.fetchMainList($scope.queryFieldModel).then(function (data, status, headers) {
if (status === 204) { var params = angular.copy($scope.queryFieldModel);
params.ownTime = params.ownTime ? params.ownTime : "";
params.ownTime = parseInt(params.ownTime.split("-").join(""));
taxDocumentListService.fetchMainList(params).then(function (data, status, headers) {
if (status == 204) {
SweetAlert.warning($translate.instant("NoData")); SweetAlert.warning($translate.instant("NoData"));
return; return;
} }
...@@ -112,7 +114,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -112,7 +114,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
if (options.data.fileTime) { if (options.data.fileTime) {
$('<span>').text($filter('date')(options.data.createTime, 'yyyy-MM-dd')).appendTo(container); $('<span>').text($filter('date')(options.data.fileTime, 'yyyy-MM-dd')).appendTo(container);
} else { } else {
$('<span>').text('').appendTo(container); $('<span>').text('').appendTo(container);
} }
...@@ -127,7 +129,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -127,7 +129,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
if (options.data.ownTime) { if (options.data.ownTime) {
$('<span>').text($filter('date')(options.data.createTime, 'yyyy-MM-dd')).appendTo(container); $('<span>').text($filter('date')(options.data.ownTime, 'yyyy-MM-dd')).appendTo(container);
} else { } else {
$('<span>').text('').appendTo(container); $('<span>').text('').appendTo(container);
} }
...@@ -143,7 +145,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -143,7 +145,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
if (options.data.effectiveTime) { if (options.data.effectiveTime) {
$('<span>').text($filter('date')(options.data.createTime, 'yyyy-MM-dd')).appendTo(container); $('<span>').text($filter('date')(options.data.effectiveTime, 'yyyy-MM-dd')).appendTo(container);
} else { } else {
$('<span>').text('').appendTo(container); $('<span>').text('').appendTo(container);
} }
...@@ -178,7 +180,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -178,7 +180,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
if (options.data.uploadTime) { if (options.data.uploadTime) {
$('<span>').text($filter('date')(options.data.createTime, 'yyyy-MM-dd')).appendTo(container); $('<span>').text($filter('date')(options.data.uploadTime, 'yyyy-MM-dd')).appendTo(container);
} else { } else {
$('<span>').text('').appendTo(container); $('<span>').text('').appendTo(container);
} }
...@@ -236,13 +238,14 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -236,13 +238,14 @@ taxDocumentManageModule.controller('taxDocumentListController',
$scope.editFieldModel.ownTime = dateFormat(item.ownTime); $scope.editFieldModel.ownTime = dateFormat(item.ownTime);
$scope.editFieldModel.fileTime = dateFormat(item.fileTime); $scope.editFieldModel.fileTime = dateFormat(item.fileTime);
$scope.editFieldModel.effectiveTime = dateFormat(item.effectiveTime); $scope.editFieldModel.effectiveTime = dateFormat(item.effectiveTime);
function dateFormat(date){ function dateFormat(date){
if(!date)return ""; if(!date)return "";
var _date = new Date(date); var _date = new Date(date);
var yy = _date.getFullYear(); var yy = _date.getFullYear();
var mm = _date.getMonth() + 1; var mm = (_date.getMonth() + 1) + "";
var dd = _date.getDate(); var dd = _date.getDate() + "";
mm = mm.length < 2 ? "0" + mm : mm;
dd = dd.length < 2 ? "0" + dd : dd;
return yy + "-" + mm + "-" + dd; return yy + "-" + mm + "-" + dd;
} }
} }
...@@ -261,7 +264,10 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -261,7 +264,10 @@ taxDocumentManageModule.controller('taxDocumentListController',
//新建档案 //新建档案
var simpleUploadSubmit = function () { var simpleUploadSubmit = function () {
taxDocumentListService.verifyDuplicate($scope.editFieldModel).then(function(data){ var params = angular.copy($scope.editFieldModel);
params.ownTime = params.ownTime ? params.ownTime : "";
params.ownTime = parseInt(params.ownTime.split("-").join(""));
taxDocumentListService.verifyDuplicate(params).then(function(data){
// 先设置上传参数 // 先设置上传参数
var uploadItem = $scope.uploader.queue[0]; var uploadItem = $scope.uploader.queue[0];
...@@ -271,7 +277,10 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -271,7 +277,10 @@ taxDocumentManageModule.controller('taxDocumentListController',
]; ];
Object.keys($scope.editFieldModel).forEach(function(key){ Object.keys($scope.editFieldModel).forEach(function(key){
var fields = {}; var fields = {};
if(/(ownTime|fileTime|effectiveTime)/.test(key)){ if(/ownTime/.test(key)){
fields[key] = parseInt($scope.editFieldModel[key].split("-").join(""));
}
else if(/(fileTime|effectiveTime)/.test(key)){
fields[key] = $scope.editFieldModel[key].split("-").join("/"); fields[key] = $scope.editFieldModel[key].split("-").join("/");
}else{ }else{
fields[key] = $scope.editFieldModel[key]; fields[key] = $scope.editFieldModel[key];
...@@ -280,7 +289,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -280,7 +289,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
}); });
// data == true,代表可以直接上传,否则属于覆盖行为 // data == true,代表可以直接上传,否则属于覆盖行为
if (data === true) { if (data == true) {
$scope.uploader.url = apiInterceptor.webApiHostUrl + "/taxDoc/add"; $scope.uploader.url = apiInterceptor.webApiHostUrl + "/taxDoc/add";
$scope.uploader.uploadItem(0); $scope.uploader.uploadItem(0);
$scope.isCoverOperation = false; $scope.isCoverOperation = false;
...@@ -315,9 +324,12 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -315,9 +324,12 @@ taxDocumentManageModule.controller('taxDocumentListController',
var addLogicAfterUploadFile = function(editFieldModel,type){ var addLogicAfterUploadFile = function(editFieldModel,type){
taxDocumentListService.addNewRecord(editFieldModel).then(function (data) { var params = angular.copy(editFieldModel);
if (data === true) { params.ownTime = params.ownTime ? params.ownTime : "";
if(type === 'simp'){ params.ownTime = parseInt(params.ownTime.split("-").join(""));
taxDocumentListService.addNewRecord(params).then(function (data) {
if (data == true) {
if(type == 'simp'){
SweetAlert.swal({ SweetAlert.swal({
title:$translate.instant("Created"), title:$translate.instant("Created"),
type: "success", type: "success",
...@@ -328,7 +340,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -328,7 +340,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
if(isConfirm) $scope.loadMainData(); if(isConfirm) $scope.loadMainData();
}); });
}else{ }else{
if($scope.multiUploadSuccessItems.length === 0){ if($scope.multiUploadSuccessItems.length == 0){
SweetAlert.swal({ SweetAlert.swal({
title:$translate.instant("Uploaded"), title:$translate.instant("Uploaded"),
type: "success", type: "success",
...@@ -350,9 +362,12 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -350,9 +362,12 @@ taxDocumentManageModule.controller('taxDocumentListController',
var editDocFileRecord = function (fieldModel,type) { var editDocFileRecord = function (fieldModel,type) {
taxDocumentListService.editRecord(fieldModel).then(function (data) { var params = angular.copy(fieldModel);
if (data === true) { params.ownTime = params.ownTime ? params.ownTime : "";
if(type === 'simple'){ params.ownTime = parseInt(params.ownTime.split("-").join(""));
taxDocumentListService.editRecord(params).then(function (data) {
if (data == true) {
if(type == 'simple'){
SweetAlert.swal({ SweetAlert.swal({
title:$translate.instant("Edited"), title:$translate.instant("Edited"),
type: "success", type: "success",
...@@ -363,7 +378,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -363,7 +378,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
if(isConfirm) $scope.loadMainData(); if(isConfirm) $scope.loadMainData();
}); });
}else{ }else{
if($scope.multiUploadSuccessItems.length === 0){ if($scope.multiUploadSuccessItems.length == 0){
SweetAlert.swal({ SweetAlert.swal({
title:$translate.instant("Uploaded"), title:$translate.instant("Uploaded"),
type: "success", type: "success",
...@@ -397,7 +412,11 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -397,7 +412,11 @@ taxDocumentManageModule.controller('taxDocumentListController',
delItems.ids.push($scope.localData[index].id); delItems.ids.push($scope.localData[index].id);
} }
}); });
taxDocumentListService.delFileRecordItems(delItems).then(function(data){
var params = angular.copy(delItems);
params.ownTime = params.ownTime ? params.ownTime : "";
params.ownTime = parseInt(params.ownTime.split("-").join(""));
taxDocumentListService.delFileRecordItems(params).then(function(data){
if(data){ if(data){
SweetAlert.swal({ SweetAlert.swal({
title:$translate.instant("Deleted"), title:$translate.instant("Deleted"),
...@@ -446,6 +465,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -446,6 +465,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
taxDocumentListService.getFileInfoOptions().then(function(data){ taxDocumentListService.getFileInfoOptions().then(function(data){
// console.log(data); // console.log(data);
if(data){ if(data){
$scope.typeAndAttrMap = data;
Object.keys(data).forEach(function (item) { Object.keys(data).forEach(function (item) {
$scope.fileTypeOptions[item] = item; $scope.fileTypeOptions[item] = item;
}); });
...@@ -468,10 +488,19 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -468,10 +488,19 @@ taxDocumentManageModule.controller('taxDocumentListController',
}; };
//----------------------taxation----basic-end------------------------------- //----------------------taxation----basic-end-------------------------------
$scope.syncFileType = function(curAttr){
$scope.curFileTypeOptions.length = 0;
Object.keys($scope.typeAndAttrMap).forEach(function(key){
if(curAttr === $scope.typeAndAttrMap[key]){
$scope.curFileTypeOptions.push(key);
}
});
};
(function initialize() { (function initialize() {
$scope.typeAndAttrMap = {};
$scope.fileTypeOptions = {}; $scope.fileTypeOptions = {};
$scope.fileAttrOptions = {}; $scope.fileAttrOptions = {};
$scope.curFileTypeOptions = [];
$scope.companyNameOptionsMap = {}; $scope.companyNameOptionsMap = {};
$scope.editFieldModel = {}; $scope.editFieldModel = {};
$scope.editFieldModel_multi = []; $scope.editFieldModel_multi = [];
...@@ -490,6 +519,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -490,6 +519,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
})(); })();
}]); }]);
taxDocumentManageModule.directive("multiDatePicker", function () { taxDocumentManageModule.directive("multiDatePicker", function () {
return { return {
restrict: "EA", restrict: "EA",
...@@ -523,6 +553,7 @@ taxDocumentManageModule.directive("multiDatePicker", function () { ...@@ -523,6 +553,7 @@ taxDocumentManageModule.directive("multiDatePicker", function () {
// setDate: setDate, // setDate: setDate,
months: monthList, months: monthList,
RTL: "bottom left", RTL: "bottom left",
minView:2,
ConfirmBtnText: $translate.instant('Confirm'), ConfirmBtnText: $translate.instant('Confirm'),
CancelBtnText: $translate.instant('ButtonCancel') CancelBtnText: $translate.instant('ButtonCancel')
}; };
...@@ -551,6 +582,7 @@ taxDocumentManageModule.directive("multiDatePicker", function () { ...@@ -551,6 +582,7 @@ taxDocumentManageModule.directive("multiDatePicker", function () {
$scope.queryFieldModel.uploadBeginTime = dateFormat(result[0].reverse()); $scope.queryFieldModel.uploadBeginTime = dateFormat(result[0].reverse());
$scope.queryFieldModel.uploadEndTime = dateFormat(result[1].reverse()); $scope.queryFieldModel.uploadEndTime = dateFormat(result[1].reverse());
}); });
function dateFormat(dateArr){ function dateFormat(dateArr){
var result = []; var result = [];
dateArr.forEach(function(dateItem){ dateArr.forEach(function(dateItem){
...@@ -578,10 +610,11 @@ taxDocumentManageModule.directive('dateTimePicker', function () { ...@@ -578,10 +610,11 @@ taxDocumentManageModule.directive('dateTimePicker', function () {
$element.datepicker({ $element.datepicker({
startDate:new Date(year - 20, 1, 1), startDate:new Date(year - 20, 1, 1),
endDate:new Date(year + 20, 1, 1), endDate:new Date(year + 20, 1, 1),
minViewMode: 1, minViewMode: $attrs["minView"],
autoclose: true, autoclose: true,
language: region, language: region,
format: "yyyy-mm-dd", format: "yyyy-mm-dd",
todayBtn:true,
clearBtn: true //清除按钮 clearBtn: true //清除按钮
}).off("changeDate").on('changeDate', function(ev){ }).off("changeDate").on('changeDate', function(ev){
runCallback(ev); runCallback(ev);
...@@ -651,11 +684,7 @@ taxDocumentManageModule.directive('fileUploader',function () { ...@@ -651,11 +684,7 @@ taxDocumentManageModule.directive('fileUploader',function () {
$scope.uploader = new FileUploader({ $scope.uploader = new FileUploader({
url: apiInterceptor.webApiHostUrl + "/taxDoc/add", url: apiInterceptor.webApiHostUrl + "/taxDoc/add",
// autoUpload: true,//添加后,自动上传 // autoUpload: true,//添加后,自动上传
headers:{ headers:{"Authorization":apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken()},
'Access-Control-Allow-Origin': '*',
Authorization: apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken(),
withCredentials: true
},
removeAfterUpload:true, removeAfterUpload:true,
}); });
$scope.uploader.filters.push({//xls限制 $scope.uploader.filters.push({//xls限制
...@@ -763,7 +792,7 @@ taxDocumentManageModule.directive('multiFileUploader',function () { ...@@ -763,7 +792,7 @@ taxDocumentManageModule.directive('multiFileUploader',function () {
$scope.editFieldModel_multi.push({ $scope.editFieldModel_multi.push({
fileNativePath:fileNativePath, fileNativePath:fileNativePath,
fileName:item.name, fileName:item.name,
iShow:$scope.editFieldModel_multi.length === 0 iShow:$scope.editFieldModel_multi.length == 0
}); });
// 根据需求,改为不做类型限制 // 根据需求,改为不做类型限制
return true; return true;
...@@ -810,7 +839,10 @@ taxDocumentManageModule.directive('multiFileUploader',function () { ...@@ -810,7 +839,10 @@ taxDocumentManageModule.directive('multiFileUploader',function () {
var editFieldModel = $scope.editFieldModel_multi[i]; var editFieldModel = $scope.editFieldModel_multi[i];
Object.keys(editFieldModel).forEach(function(key){ Object.keys(editFieldModel).forEach(function(key){
var fields = {}; var fields = {};
if(/(ownTime|fileTime|effectiveTime)/.test(key)){ if(/ownTime/.test(key)){
fields[key] = parseInt(editFieldModel[key].split("-").join(""));
}
else if(/(fileTime|effectiveTime)/.test(key)){
fields[key] = editFieldModel[key].split("-").join("/"); fields[key] = editFieldModel[key].split("-").join("/");
}else{ }else{
fields[key] = editFieldModel[key]; fields[key] = editFieldModel[key];
...@@ -820,8 +852,12 @@ taxDocumentManageModule.directive('multiFileUploader',function () { ...@@ -820,8 +852,12 @@ taxDocumentManageModule.directive('multiFileUploader',function () {
(function(_i,_fileItem,_editFieldModel,_taxDocumentListService,_multiUploader){ (function(_i,_fileItem,_editFieldModel,_taxDocumentListService,_multiUploader){
_taxDocumentListService.verifyDuplicate(_editFieldModel).then(function(data){
if (data === true) { var params = angular.copy(_editFieldModel);
params.ownTime = params.ownTime ? params.ownTime : "";
params.ownTime = parseInt(_editFieldModel.ownTime.split("-").join(""));
_taxDocumentListService.verifyDuplicate(params).then(function(data){
if (data == true) {
_fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/add"; _fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/add";
} else { } else {
_fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/edit"; _fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/edit";
...@@ -843,185 +879,192 @@ taxDocumentManageModule.directive('multiFileUploader',function () { ...@@ -843,185 +879,192 @@ taxDocumentManageModule.directive('multiFileUploader',function () {
taxDocumentManageModule.directive('filePreview',function(){ taxDocumentManageModule.directive('filePreview',function(){
return{ return{
restrict:'EA', restrict:'EA',
controller:['$scope','$translate','SweetAlert','$compile','taxDocumentListService',function($scope,$translate,SweetAlert,$compile,taxDocumentListService){ controller:['$scope','$translate','SweetAlert','$compile','taxDocumentListService',
function($scope,$translate,SweetAlert,$compile,taxDocumentListService){
$scope.previewData = [];
/**上传时预览的功能取消 2019/3/8*/ $scope.previewData = [];
/* $scope.viewNativeFile = function(fileItem){ /**上传时预览的功能取消 2019/3/8*/
/* $scope.viewNativeFile = function(fileItem){
if(!fileItem) return SweetAlert.warning($translate.instant('NeedLoadUp'));
if(!fileItem) return SweetAlert.warning($translate.instant('NeedLoadUp'));
var fileType = fileItem.filePositionUrl.split(".").pop();
var fileType = fileItem.filePositionUrl.split(".").pop();
if(/xlsx|xls/i.test(fileType)){
var reader = new FileReader(); if(/xlsx|xls/i.test(fileType)){
reader.onload = function (e) { var reader = new FileReader();
/!* read workbook *!/ reader.onload = function (e) {
var wb = window.XLSX.read(e.target.result, {type:"binary"}); /!* read workbook *!/
var data = window.XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]); var wb = window.XLSX.read(e.target.result, {type:"binary"});
if(data.length){ var data = window.XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
$scope.filePreview_dataGridUpdate(data); if(data.length){
$("#filePreviewPop").modal("show"); $scope.filePreview_dataGridUpdate(data);
} $("#filePreviewPop").modal("show");
else{ }
SweetAlert.warning($translate.instant('UnReadFile')); else{
} SweetAlert.warning($translate.instant('UnReadFile'));
/!* DO SOMETHING WITH workbook HERE *!/ }
}; /!* DO SOMETHING WITH workbook HERE *!/
};
reader.readAsBinaryString(fileItem._file);
}else if(/pdf/i.test(fileType)){ reader.readAsBinaryString(fileItem._file);
$scope.openPdfPreviewPop(fileItem.filePositionUrl); }else if(/pdf/i.test(fileType)){
}else{ $scope.openPdfPreviewPop(fileItem.filePositionUrl);
SweetAlert.warning($translate.instant('UnFile')); }else{
} SweetAlert.warning($translate.instant('UnFile'));
};*/ }
$scope.currentSheetName = ''; };*/
var sheetCurPageIndex = 0; $scope.currentSheetName = '';
var sheetSumPages = 1; var sheetCurPageIndex = 0;
var sheetPromise = null; var sheetSumPages = 1;
var cacheUrl = null; var sheetPromise = null;
var cacheUrl = null;
$scope.prevPaging_xls = function(){
if(sheetCurPageIndex <= 0) return sheetCurPageIndex = 0; $scope.prevPaging_xls = function(){
sheetCurPageIndex --; if(sheetCurPageIndex <= 0) return sheetCurPageIndex = 0;
sheetPromise.then(function(resData){renderXLS(resData)}) sheetCurPageIndex --;
}; sheetPromise.then(function(resData){renderXLS(resData)})
$scope.nextPaging_xls = function(){ };
if(sheetCurPageIndex >= (sheetSumPages - 1)) return sheetCurPageIndex = sheetSumPages - 1; $scope.nextPaging_xls = function(){
sheetCurPageIndex ++; if(sheetCurPageIndex >= (sheetSumPages - 1)) return sheetCurPageIndex = sheetSumPages - 1;
sheetPromise.then(function(resData){renderXLS(resData)}) sheetCurPageIndex ++;
}; sheetPromise.then(function(resData){renderXLS(resData)})
};
function getXLS(url){
// return taxDocumentListService.getBinaryData('./bundles/MS Function list - Phase 1.xlsx');
return taxDocumentListService.getBinaryData(url);
}
function renderXLS(resData){
try{
var wb = window.XLSX.read(resData, {type:"array"}); function getXLS(url){
// return taxDocumentListService.getBinaryData('./bundles/MS Function list - Phase 1.xlsx');
return taxDocumentListService.readXLSX({
// path:url
path:'http://47.94.233.173:11007/static/erp_tax_system/FE9A6FCC-019E-4B93-A9B2-1DD04CDD7431?expire=1552463739&signiture=H15ovgMR4zXwiYlPe4nZMoeLMSZFhimiHFUZ4-SVVaE='
});
}
sheetSumPages = wb.SheetNames.length; function renderXLS(resData){
$scope.currentSheetName = wb.SheetNames[sheetCurPageIndex]; try{
var data = window.XLSX.utils.sheet_to_json(wb.Sheets[$scope.currentSheetName]);
// console.log(data); // var wb = window.XLSX.read(resData, {type:"array"});
if(data && data.length){ //
$scope.filePreview_dataGridUpdate(data); // sheetSumPages = wb.SheetNames.length;
$("#filePreviewPop").modal("show"); // $scope.currentSheetName = wb.SheetNames[sheetCurPageIndex];
// var data = window.XLSX.utils.sheet_to_json(wb.Sheets[$scope.currentSheetName]);
// console.log(data);
sheetSumPages = resData.length;
var curSheet = resData[sheetCurPageIndex];
$scope.currentSheetName = Object.keys(curSheet)[0];
if(resData && resData.length){
$scope.filePreview_dataGridUpdate(curSheet[$scope.currentSheetName]);
$("#filePreviewPop").modal("show");
}
}catch(e){
SweetAlert.warning(e.message);
} }
}catch(e){
SweetAlert.warning(e.message);
} }
} $scope.viewRemoteFile = function (fileName, filePositionUrl) {
$scope.viewRemoteFile = function (fileName, filePositionUrl) { if(typeof filePositionUrl !== 'string'
if(typeof filePositionUrl !== 'string' || filePositionUrl == 'null'
|| filePositionUrl === 'null' || filePositionUrl == 'undefined')
|| filePositionUrl === 'undefined') return SweetAlert.warning($translate.instant('UnRecord'));
return SweetAlert.warning($translate.instant('UnRecord'));
//区分文件类型
//区分文件类型 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){
if(cacheUrl !== filePositionUrl){ cacheUrl = filePositionUrl;
cacheUrl = filePositionUrl; sheetPromise = getXLS(filePositionUrl);
sheetPromise = getXLS(filePositionUrl); }
sheetPromise.then(function(resData){renderXLS(resData)})
}
else if(/pdf/i.test(fileType)){
// return SweetAlert.warning('暂时不支持PDF预览');
$scope.openPdfPreviewPop(filePositionUrl);
}else{
SweetAlert.warning($translate.instant('UnFile'));
} }
sheetPromise.then(function(resData){renderXLS(resData)})
}
else if(/pdf/i.test(fileType)){
// return SweetAlert.warning('暂时不支持PDF预览');
$scope.openPdfPreviewPop(filePositionUrl);
}else{
SweetAlert.warning($translate.instant('UnFile'));
}
}; };
$scope.filePreview_dataGridUpdate = function (_data) { $scope.filePreview_dataGridUpdate = function (_data) {
// console.info("excel:",_data); // console.info("excel:",_data);
$scope.previewData = _data || [{}]; $scope.previewData = _data || [{}];
var field_keys = Object.keys(_data[0]); var field_keys = Object.keys(_data[0]);
var field_values = Object.values(_data[0]); var field_values = Object.values(_data[0]);
_data.forEach(function(item){ _data.forEach(function(item){
var curRow_keys = Object.keys(item); var curRow_keys = Object.keys(item);
var curRow_values = Object.values(item); var curRow_values = Object.values(item);
if(curRow_keys && curRow_keys.length > field_keys.length){ if(curRow_keys && curRow_keys.length > field_keys.length){
field_keys = curRow_keys; field_keys = curRow_keys;
field_values = curRow_values; field_values = curRow_values;
} }
}); });
$scope.filePreview_dataGridOptions = { $scope.filePreview_dataGridOptions = {
bindingOptions:{ bindingOptions:{
dataSource: 'previewData', dataSource: 'previewData',
}, },
showBorders: true, showBorders: true,
paging: { paging: {
enable: true, enable: true,
pageIndex: 1, pageIndex: 1,
pageSize: 10 pageSize: 10
}, },
pager: { pager: {
allowedPageSizes: 5, allowedPageSizes: 5,
infoText: "当前 {0} / {1} ({2} )", infoText: "当前 {0} / {1} ({2} )",
showInfo: true, showInfo: true,
showNavigationButtons: true, showNavigationButtons: true,
showPageSizeSelector: true, showPageSizeSelector: true,
visible: true visible: true
}, },
searchPanel: {//查询 searchPanel: {//查询
highlightCaseSensitive: true, highlightCaseSensitive: true,
highlightSearchText: true, highlightSearchText: true,
searchVisibleColumnsOnly: false, searchVisibleColumnsOnly: false,
text: "", text: "",
width: 518, width: 518,
visible: true, visible: true,
placeholder: $translate.instant('Search'), placeholder: $translate.instant('Search'),
}, },
sorting: {//排序 sorting: {//排序
ascendingText: "Sort Ascending", ascendingText: "Sort Ascending",
clearText: "Clear Sorting", clearText: "Clear Sorting",
descendingText: "Sort Descending", descendingText: "Sort Descending",
mode: "single" mode: "single"
}, },
showRowLines: true, showRowLines: true,
columnAutoWidth: true, columnAutoWidth: true,
allowColumnReordering: true, allowColumnReordering: true,
columns: (function(){ columns: (function(){
var cols = []; var cols = [];
field_keys.forEach(function(field,index){ field_keys.forEach(function(field,index){
cols.push({ cols.push({
dataField: field, dataField: field,
caption: (Object.keys(_data[0]).length === field_values.length) ? field_values[index]:index caption: (Object.keys(_data[0]).length == field_values.length) ? field_values[index]:index
});
}); });
}); return cols;
return cols; })(),
})(), rowAlternationEnabled: true, //单双行颜色
rowAlternationEnabled: true, //单双行颜色 };
}; var dataGrid = $('<div dx-data-grid="filePreview_dataGridOptions">');
var dataGrid = $('<div dx-data-grid="filePreview_dataGridOptions">'); $("#preview_dataGrid").html("").append(dataGrid);
$("#preview_dataGrid").html("").append(dataGrid); $compile(dataGrid)($scope);
$compile(dataGrid)($scope);
}; };
$scope.hideFilePreviewPop = function(){ $scope.hideFilePreviewPop = function(){
$("#preview_dataGrid").html(""); $("#preview_dataGrid").html("");
$("#filePreviewPop").modal("hide"); $("#filePreviewPop").modal("hide");
}; };
$scope.resetDataForm = function(){ $scope.resetDataForm = function(){
$scope.previewData.length = 0; $scope.previewData.length = 0;
if($scope.filePreview_dataGridOptions) if($scope.filePreview_dataGridOptions)
$scope.filePreview_dataGridOptions.columns.length = 0; $scope.filePreview_dataGridOptions.columns.length = 0;
}; };
}] }]
} }
}); });
taxDocumentManageModule.directive('pdfPreview',function(){ taxDocumentManageModule.directive('pdfPreview',function(){
...@@ -1088,7 +1131,6 @@ taxDocumentManageModule.directive('pdfPreview',function(){ ...@@ -1088,7 +1131,6 @@ taxDocumentManageModule.directive('pdfPreview',function(){
}] }]
} }
}); });
taxDocumentManageModule.directive('helpPop',function(){ taxDocumentManageModule.directive('helpPop',function(){
return{ return{
......
...@@ -289,8 +289,8 @@ ...@@ -289,8 +289,8 @@
<select ng-model="queryFieldModel.fileAttr" <select ng-model="queryFieldModel.fileAttr"
class="form-control radius3" class="form-control radius3"
required placeholder="{{'PleaseSelected' | translate}}"> required placeholder="{{'PleaseSelected' | translate}}">
<option selected></option> <option ng-repeat="fileAttr in fileAttrOptions track by $index"
<option ng-repeat="fileAttr in fileAttrOptions track by $index" value="{{fileAttr}}">{{fileAttr}}</option> value="{{fileAttr}}">{{fileAttr}}</option>
</select> </select>
<!--<input type="text" class="form-control radius3"--> <!--<input type="text" class="form-control radius3"-->
<!--ng-model="queryFieldModel.fileAttr"/>--> <!--ng-model="queryFieldModel.fileAttr"/>-->
...@@ -360,9 +360,10 @@ ...@@ -360,9 +360,10 @@
<div class="TDL-query-val"> <div class="TDL-query-val">
<select ng-model="queryFieldModel.companyName" class="form-control radius3" <select ng-model="queryFieldModel.companyName" class="form-control radius3"
title="{{queryFieldModel.companyName}}" required placeholder="{{'PleaseSelected' | translate}}"> title="{{queryFieldModel.companyName}}" required placeholder="{{'PleaseSelected' | translate}}">
<option selected></option>
<option ng-repeat="(key,companyName) in companyNameOptionsMap" <option ng-repeat="(key,companyName) in companyNameOptionsMap"
ng-click="queryFieldModel.companyId = key" ng-click="queryFieldModel.companyId = key"
ng-slected="queryFieldModel.companyName == companyName"
value="{{companyName}}">{{companyName}}</option> value="{{companyName}}">{{companyName}}</option>
</select> </select>
</div> </div>
...@@ -553,7 +554,9 @@ ...@@ -553,7 +554,9 @@
<!--placeholder="{{'PleaseSelected' | translate}}"--> <!--placeholder="{{'PleaseSelected' | translate}}"-->
<!--ng-model="editFieldModel.fileAttr"--> <!--ng-model="editFieldModel.fileAttr"-->
<!--required style="width:320px;" />--> <!--required style="width:320px;" />-->
<select ng-model="editFieldModel.fileAttr" ng-init="editFieldModel.fileAttr = ''" class="form-control" <select ng-model="editFieldModel.fileAttr"
ng-change="syncFileType(editFieldModel.fileAttr)"
class="form-control"
style="width:320px;" required placeholder="{{'PleaseSelected' | translate}}"> style="width:320px;" required placeholder="{{'PleaseSelected' | translate}}">
<option ng-repeat="fileAttr in fileAttrOptions track by $index" <option ng-repeat="fileAttr in fileAttrOptions track by $index"
ng-selected="(editFieldModel.fileAttr == fileAttr)" ng-selected="(editFieldModel.fileAttr == fileAttr)"
...@@ -577,12 +580,13 @@ ...@@ -577,12 +580,13 @@
<!--placeholder="{{'PleaseSelected' | translate}}"--> <!--placeholder="{{'PleaseSelected' | translate}}"-->
<!--ng-model="editFieldModel.companyName"--> <!--ng-model="editFieldModel.companyName"-->
<!--required style="width:320px;" />--> <!--required style="width:320px;" />-->
<select ng-model="editFieldModel.companyName" class="form-control" ng-init="editFieldModel.companyName = ''" <select ng-model="editFieldModel.companyName" class="form-control"
title="{{editFieldModel.companyName}}" style="width:320px;" required placeholder="{{'PleaseSelected' | translate}}"> title="{{editFieldModel.companyName}}" style="width:320px;" required placeholder="{{'PleaseSelected' | translate}}">
<option ng-repeat="(key,companyName) in companyNameOptionsMap" <option ng-repeat="(key,companyName) in companyNameOptionsMap"
ng-click="editFieldModel.companyId = key"
ng-selected="(editFieldModel.companyName == companyName)" ng-selected="(editFieldModel.companyName == companyName)"
value="{{key}}">{{companyName}}</option> value="{{companyName}}">{{companyName}}</option>
</select> </select>
</div> </div>
</div> </div>
...@@ -591,15 +595,17 @@ ...@@ -591,15 +595,17 @@
<span style="color:red"> * </span> <span style="color:red"> * </span>
{{'DocumentType' | translate}} {{'DocumentType' | translate}}
</label> </label>
<div class="col-sm-11" style="width:61.67%" id="fileTypeOptions"> <div class="col-sm-11" style="width:61.67%">
<!--<input class="form-control"--> <!--<input class="form-control"-->
<!--placeholder="{{'PleaseSelected' | translate}}"--> <!--placeholder="{{'PleaseSelected' | translate}}"-->
<!--ng-model="editFieldModel.fileType"--> <!--ng-model="editFieldModel.fileType"-->
<!--required style="width:320px;" />--> <!--required style="width:320px;" />-->
<select ng-model="editFieldModel.fileType" class="form-control" ng-init="editFieldModel.fileType = ''" <select ng-model="editFieldModel.fileType"
ng-disabled="curFileTypeOptions.length === 0"
class="form-control"
style="width:320px;" required placeholder="{{'PleaseSelected' | translate}}"> style="width:320px;" required placeholder="{{'PleaseSelected' | translate}}">
<option ng-repeat="fileType in fileTypeOptions track by $index" <option ng-repeat="fileType in curFileTypeOptions track by $index"
ng-selected="(editFieldModel.fileType == fileType)" ng-selected="(editFieldModel.fileType == fileType)"
value="{{fileType}}">{{fileType}}</option> value="{{fileType}}">{{fileType}}</option>
</select> </select>
...@@ -761,8 +767,11 @@ ...@@ -761,8 +767,11 @@
<!--placeholder="{{'PleaseSelected' | translate}}"--> <!--placeholder="{{'PleaseSelected' | translate}}"-->
<!--ng-model="editFieldModel.fileAttr"--> <!--ng-model="editFieldModel.fileAttr"-->
<!--required style="width:280px;" />--> <!--required style="width:280px;" />-->
<select ng-model="editFieldItem.fileAttr" ng-init="editFieldItem.fileAttr = ''" class="form-control" <select ng-model="editFieldItem.fileAttr"
style="width:280px;" required placeholder="{{'PleaseSelected' | translate}}"> ng-change="syncFileType(editFieldItem.fileAttr)"
class="form-control"
style="width:280px;"
required placeholder="{{'PleaseSelected' | translate}}">
<option ng-repeat="fileAttr in fileAttrOptions track by $index" <option ng-repeat="fileAttr in fileAttrOptions track by $index"
ng-selected="(editFieldItem.fileAttr == fileAttr)" ng-selected="(editFieldItem.fileAttr == fileAttr)"
value="{{fileAttr}}">{{fileAttr}}</option> value="{{fileAttr}}">{{fileAttr}}</option>
...@@ -804,9 +813,12 @@ ...@@ -804,9 +813,12 @@
<!--ng-model="editFieldModel.fileType"--> <!--ng-model="editFieldModel.fileType"-->
<!--required style="width:280px;" />--> <!--required style="width:280px;" />-->
<select ng-model="editFieldItem.fileType" class="form-control" ng-init="editFieldItem.fileType = ''" <select ng-model="editFieldItem.fileType"
style="width:280px;" required placeholder="{{'PleaseSelected' | translate}}"> ng-disabled="curFileTypeOptions.length === 0"
<option ng-repeat="fileType in fileTypeOptions track by $index" class="form-control"
style="width:280px;" required
placeholder="{{'PleaseSelected' | translate}}">
<option ng-repeat="fileType in curFileTypeOptions track by $index"
ng-selected="(editFieldItem.fileType == fileType)" ng-selected="(editFieldItem.fileType == fileType)"
value="{{fileType}}">{{fileType}}</option> value="{{fileType}}">{{fileType}}</option>
</select> </select>
...@@ -829,17 +841,18 @@ ...@@ -829,17 +841,18 @@
{{'Duration' | translate}} {{'Duration' | translate}}
</label> </label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
<input type='text' placeholder="{{'PleaseSelected' | translate}}" date-time-picker data-date-format="yyyy/mm/dd" style="width:280px;" <input type='text' placeholder="{{'PleaseSelected' | translate}}"
date-time-picker data-date-format="yyyy/mm/dd" style="width:280px;"
class="form-control" ng-model="editFieldItem.ownTime" required class="form-control" ng-model="editFieldItem.ownTime" required
data-min-view="2"/> data-min-view="2"/>
</div> </div>
</div> </div>
<div class="col-sm-6 form-group"> <div class="col-sm-6 form-group">
<label class="col-sm-3 control-label"> <label class="col-sm-3 control-label" translate="AvailabilityDate">
{{'AvailabilityDate' | translate}}
</label> </label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
<input type='text' placeholder="{{'PleaseSelected' | translate}}" date-time-picker data-date-format="yyyy/mm/dd" style="width:280px;" <input type='text' placeholder="{{'PleaseSelected' | translate}}"
date-time-picker data-date-format="yyyy/mm/dd" style="width:280px;"
class="form-control" ng-model="editFieldItem.fileTime" class="form-control" ng-model="editFieldItem.fileTime"
data-min-view="2"/> data-min-view="2"/>
</div> </div>
...@@ -847,7 +860,8 @@ ...@@ -847,7 +860,8 @@
<div class="col-sm-6 form-group"> <div class="col-sm-6 form-group">
<label class="col-sm-3 control-label" translate="DueDate"></label> <label class="col-sm-3 control-label" translate="DueDate"></label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
<input type='text' placeholder="{{'PleaseSelected' | translate}}" date-time-picker data-date-format="yyyy/mm/dd" style="width:280px;" <input type='text' placeholder="{{'PleaseSelected' | translate}}"
date-time-picker data-date-format="yyyy/mm/dd" style="width:280px;"
class="form-control" ng-model="editFieldItem.effectiveTime" class="form-control" ng-model="editFieldItem.effectiveTime"
data-min-view="2"/> data-min-view="2"/>
</div> </div>
......
...@@ -30,6 +30,9 @@ taxDocumentManageModule.factory('taxDocumentListService', ...@@ -30,6 +30,9 @@ taxDocumentManageModule.factory('taxDocumentListService',
getDocumentsAttrAndType:function(params){ getDocumentsAttrAndType:function(params){
return jqFetch.post(apiInterceptor.webApiHostUrl + '/fileTypes/selectList', params); return jqFetch.post(apiInterceptor.webApiHostUrl + '/fileTypes/selectList', params);
}, },
readXLSX:function(params){
return jqFetch.post(apiInterceptor.webApiHostUrl + '/taxDoc/previewExcelToJson', params);
},
getBinaryData: function (url) { getBinaryData: function (url) {
var defer = $q.defer(); var defer = $q.defer();
var oReq = new XMLHttpRequest(); var oReq = new XMLHttpRequest();
......
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