Commit e68f97ab authored by kevin's avatar kevin

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

# Conflicts:
#	atms-web/src/main/webapp/app/vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
parent 773b16bb
...@@ -10,13 +10,18 @@ import java.io.IOException; ...@@ -10,13 +10,18 @@ import java.io.IOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
/**
* author kevin
* target : Solve date conversion issues
* version 1.0
*/
public class CustomDateSerializer extends JsonSerializer<Date> { public class CustomDateSerializer extends JsonSerializer<Date> {
@Override @Override
public void serialize(Date value, JsonGenerator jgen, SerializerProvider arg2) public void serialize(Date value, JsonGenerator jgen, SerializerProvider arg2)
throws IOException, JsonProcessingException { throws IOException, JsonProcessingException {
// TODO Auto-generated method stub // TODO Auto-generated method stub
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String formattedDate = formatter.format(value); String formattedDate = formatter.format(value);
jgen.writeString(formattedDate); jgen.writeString(formattedDate);
......
...@@ -92,4 +92,7 @@ public class BeanUtil { ...@@ -92,4 +92,7 @@ public class BeanUtil {
return new String(ch); return new String(ch);
} }
} }
package pwc.taxtech.atms.common.util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Component;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.Project;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;
/**
* author kevin
* version 1.0
* 封装一些简单的数据处理
*/
@Component
public class DataUtil {
@Autowired
private JdbcTemplate jdbcTemplate;
//通过projectId查询project信息
public Map<String, Object> getProjectById(String projectId){
return jdbcTemplate.queryForMap("select * from project where id = ?", projectId);
}
}
...@@ -128,4 +128,30 @@ public final class Constant { ...@@ -128,4 +128,30 @@ public final class Constant {
public static String DECIMAL_FORMAT = "#,##0.00"; public static String DECIMAL_FORMAT = "#,##0.00";
public static String ZERO_STR = "0"; public static String ZERO_STR = "0";
public static class ReportDataValidateLog{
private String segment3 = null;
private String segment5 = null;
private String segment6 = null;
private static boolean status = true;
public String getResult(boolean status){
if(status){
return "校验结果失败: 科目代码: " + segment3 + ";利润中心:" + segment5 + "; 产品编号: " + segment6;
}
return "校验结果成功: 科目代码: " + segment3 + ";利润中心:" + segment5 + "; 产品编号: " + segment6;
}
public String getResult(){
return getResult(status);
}
public ReportDataValidateLog(String segment3, String segment5, String segment6){
this.segment3 = segment3;
this.segment5 = segment5;
this.segment6 = segment6;
}
}
} }
\ No newline at end of file
package pwc.taxtech.atms.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.previewData.CitSalaryDataDto;
import pwc.taxtech.atms.entity.CitSalaryAdvance;
import pwc.taxtech.atms.service.impl.CitPreviewDataServiceImpl;
@Controller
@RequestMapping("api/v1/citPreviewDataController")
public class CitPreviewDataController {
@Autowired
private CitPreviewDataServiceImpl citPreviewDataService;
@RequestMapping("getSalaryAdvaceListData")
@ResponseBody
public CamelPagingResultDto<CitSalaryAdvance> getSalaryAdvaceListData(@RequestBody CitSalaryDataDto citSalaryDataDto){
return new CamelPagingResultDto<>(citPreviewDataService.getCitSalaryAdvanceDataList(citSalaryDataDto));
}
}
...@@ -58,7 +58,7 @@ public class OperationLogController { ...@@ -58,7 +58,7 @@ public class OperationLogController {
public Boolean addOperationLog(VatOperationLog vatOperationLog) { public Boolean addOperationLog(VatOperationLog vatOperationLog) {
OperationLogDto operationLogDto = new OperationLogDto(); OperationLogDto operationLogDto = new OperationLogDto();
CommonUtils.copyProperties(vatOperationLog, operationLogDto); CommonUtils.copyProperties(vatOperationLog, operationLogDto);
// operationLogService.addOperationLog(operationLogDto); operationLogService.addOperationLog(operationLogDto);
return true; return true;
} }
} }
package pwc.taxtech.atms.dto; package pwc.taxtech.atms.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.format.annotation.DateTimeFormat;
import pwc.taxtech.atms.common.CustomDateSerializer; import pwc.taxtech.atms.common.CustomDateSerializer;
import pwc.taxtech.atms.entity.BaseEntity; import pwc.taxtech.atms.entity.BaseEntity;
......
...@@ -17,6 +17,33 @@ public class QueryOperateParamDto { ...@@ -17,6 +17,33 @@ public class QueryOperateParamDto {
private Integer logType; private Integer logType;
private PagingDto pageInfo; private PagingDto pageInfo;
private String QueryValue;
private String Period;
private String ModuleID;
public String getQueryValue() {
return QueryValue;
}
public void setQueryValue(String queryValue) {
QueryValue = queryValue;
}
public String getPeriod() {
return Period;
}
public void setPeriod(String period) {
Period = period;
}
public String getModuleID() {
return ModuleID;
}
public void setModuleID(String moduleID) {
ModuleID = moduleID;
}
public String getSearchText() { public String getSearchText() {
return searchText; return searchText;
......
...@@ -17,6 +17,7 @@ public class RevenueConfResult extends RevenueConfig { ...@@ -17,6 +17,7 @@ public class RevenueConfResult extends RevenueConfig {
} }
public String getRevenueTypeStr() { public String getRevenueTypeStr() {
return RevenueConfEnum.RevenueType.MAPPING.get(this.getRevenueType()); return RevenueConfEnum.RevenueType.MAPPING.get(this.getRevenueType());
} }
......
package pwc.taxtech.atms.service.impl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.dao.CitSalaryAdvanceMapper;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.previewData.CitSalaryDataDto;
import pwc.taxtech.atms.dto.vatdto.dd.BalanceSheetDto;
import pwc.taxtech.atms.entity.CitSalaryAdvance;
import pwc.taxtech.atms.entity.CitSalaryAdvanceExample;
import java.util.List;
@Service
public class CitPreviewDataServiceImpl {
@Autowired
private CitSalaryAdvanceMapper citSalaryAdvanceMapper;
public PageInfo<CitSalaryAdvance> getCitSalaryAdvanceDataList(CitSalaryDataDto citSalaryDataDto ){
CitSalaryAdvanceExample example = new CitSalaryAdvanceExample();
CitSalaryAdvanceExample.Criteria criteria = example.createCriteria();
if(!"".equals(citSalaryDataDto.getPoSubjectName()) && citSalaryDataDto.getPoSubjectName() != null){//根据PO主体名称进行查询
criteria.andPoSubjectNameEqualTo(citSalaryDataDto.getPoSubjectName());
}
Page page = PageHelper.startPage(citSalaryDataDto.getPageInfo().getPageIndex(), citSalaryDataDto.getPageInfo().getPageSize());
List<CitSalaryAdvance> citSalaryAdvances = citSalaryAdvanceMapper.selectByExample(example);
PageInfo<CitSalaryAdvance> pageInfo =new PageInfo<CitSalaryAdvance>(citSalaryAdvances);
pageInfo.setTotal(page.getTotal());
return pageInfo;
}
}
...@@ -104,7 +104,7 @@ public class OperationLogServiceImpl extends AbstractService { ...@@ -104,7 +104,7 @@ public class OperationLogServiceImpl extends AbstractService {
public PagingResultDto<OperationLogDto> getOperationLogList(QueryOperateParamDto queryOperateParamDto) { public PagingResultDto<OperationLogDto> getOperationLogList(QueryOperateParamDto queryOperateParamDto) {
logger.debug("OperationLogService getOperationLogList"); logger.debug("OperationLogService getOperationLogList");
// validate // validate
Assert.hasText(queryOperateParamDto.getModuleName(), "Empty moduleName"); // Assert.hasText(queryOperateParamDto.getModuleName(), "Empty moduleName");
final PagingDto pageInfo = queryOperateParamDto.getPageInfo(); final PagingDto pageInfo = queryOperateParamDto.getPageInfo();
......
...@@ -14,13 +14,12 @@ import org.apache.poi.ss.usermodel.Workbook; ...@@ -14,13 +14,12 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.util.DateUtils; import pwc.taxtech.atms.common.util.*;
import pwc.taxtech.atms.common.util.FileUploadUtil;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.*; import pwc.taxtech.atms.constant.enums.*;
import pwc.taxtech.atms.dao.*; import pwc.taxtech.atms.dao.*;
...@@ -553,7 +552,6 @@ public class ReportServiceImpl extends BaseService { ...@@ -553,7 +552,6 @@ public class ReportServiceImpl extends BaseService {
private JournalEntryMapper journalEntryMapper; private JournalEntryMapper journalEntryMapper;
/* @Autowired /* @Autowired
private CitJour*/ private CitJour*/
//数据校验 //数据校验
private void DataValidation(Integer periodParam, String projectId, PeriodJob genJob) { private void DataValidation(Integer periodParam, String projectId, PeriodJob genJob) {
setStatus(genJob,"DA004", STATUS_BEGIN); setStatus(genJob,"DA004", STATUS_BEGIN);
...@@ -590,20 +588,62 @@ public class ReportServiceImpl extends BaseService { ...@@ -590,20 +588,62 @@ public class ReportServiceImpl extends BaseService {
}else{ }else{
map2.put("period", "" + periodParam); map2.put("period", "" + periodParam);
} }
Map<String, Object> map = new HashMap<>();
map.put("period", periodParam);
map.put("projectId", projectId);
Map<String, Object> mapProject = new DataUtil().getProjectById(projectId);
map.put("companyCode", mapProject.get("code"));
map.put("companyName", mapProject.get("name"));
List<JournalEntry> journalEntries = journalEntryMapper.selectNowAdjustData(map2); List<JournalEntry> journalEntries = journalEntryMapper.selectNowAdjustData(map2);
for(int i =0; i< adjustmentTables.size(); i++){ for(int i =0; i< adjustmentTables.size(); i++){
for(int j =0; j< journalEntries.size(); j++){ for(int j =0; j< journalEntries.size(); j++){
if(journalEntries.get(j).getSegment3().equals(adjustmentTables.get(j).getSegment3()) && JournalEntry journalEntry = journalEntries.get(j);
journalEntries.get(j).getSegment5().equals(adjustmentTables.get(j).getSegment5())&& AdjustmentTable adjustmentTable = adjustmentTables.get(j);
journalEntries.get(j).getSegment6().equals(adjustmentTables.get(j).getSegment6()) && journalEntries.get(j).getPeriodJrMinDr() != adjustmentTables.get(j).getPeriodDrMixCr() ){ if(journalEntry.getSegment3().equals(adjustmentTable.getSegment3()) &&
journalEntry.getSegment5().equals(adjustmentTable.getSegment5())&&
journalEntry.getSegment6().equals(adjustmentTable.getSegment6()) && journalEntry.getPeriodJrMinDr() != adjustmentTable.getPeriodDrMixCr() ){
setStatus(genJob,STATUS_ERROR ); setStatus(genJob,STATUS_ERROR );
Constant.ReportDataValidateLog reportDataValidateLog = new Constant.ReportDataValidateLog(journalEntries.get(j).getSegment3(), journalEntries.get(j).getSegment5(), journalEntries.get(j).getSegment6());
//记录校验结果
//
map.put("result", reportDataValidateLog.getResult(false));
map.put("validateResult", "error");
map.put("tmsPeriod", journalEntry.getTmsPeriod());
map.put("organizationId", journalEntry.getOrganizationId());
insertDataValidateResult(map);
periodJobMapper.updateByPrimaryKey(genJob);
return;
} }
} }
} }
setStatus(genJob, STATUS_END); setStatus(genJob, STATUS_END);
map.put("validateResult", "success");
map.put("result", "");
map.put("tmsPeriod", journalEntries.get(0).getTmsPeriod());
map.put("organizationId", journalEntries.get(0).getOrganizationId());
insertDataValidateResult(map);
periodJobMapper.updateByPrimaryKey(genJob); periodJobMapper.updateByPrimaryKey(genJob);
} }
@Autowired
private DataValidateLogMapper dataValidateLogMapper;
public void insertDataValidateResult(Map map){
DataValidateLog dataValidateLog = new DataValidateLog();
dataValidateLog.setCreateTime(new Date());
dataValidateLog.setPeriod((String)map.get("period"));
dataValidateLog.setProjectId((String)map.get("projectId"));
dataValidateLog.setValidateResult((String)map.get("validateResult"));
dataValidateLog.setResult((String)map.get("result"));
dataValidateLog.setOrganizationId((String)map.get("organizationId"));
dataValidateLog.setCompanyCode((String)map.get("companyCode"));
dataValidateLog.setCompanyName((String)map.get("companyName"));
dataValidateLog.setTmsPeriod(Long.parseLong(map.get("tmsPeriod").toString()));
dataValidateLogMapper.insert(dataValidateLog);
}
public List<CellTemplateReferenceDto> getTemplateReferences(int period) { public List<CellTemplateReferenceDto> getTemplateReferences(int period) {
return new ArrayList<>(); return new ArrayList<>();
......
package pwc.taxtech.atms.entity; package pwc.taxtech.atms.entity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
...@@ -470,6 +472,8 @@ public class CitSalaryAdvance extends BaseEntity implements Serializable { ...@@ -470,6 +472,8 @@ public class CitSalaryAdvance extends BaseEntity implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
@JsonSerialize(using = CustomDateSerializer.class)
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
...@@ -494,6 +498,7 @@ public class CitSalaryAdvance extends BaseEntity implements Serializable { ...@@ -494,6 +498,7 @@ public class CitSalaryAdvance extends BaseEntity implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
@JsonSerialize(using = CustomDateSerializer.class)
public Date getUpdateTime() { public Date getUpdateTime() {
return updateTime; return updateTime;
} }
......
package pwc.taxtech.atms.entity;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class CustomDateSerializer extends JsonSerializer<Date> {
@Override
public void serialize(Date value, JsonGenerator jgen, SerializerProvider arg2)
throws IOException, JsonProcessingException {
// TODO Auto-generated method stub
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String formattedDate = formatter.format(value);
jgen.writeString(formattedDate);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.DataValidateLogMapper">
</mapper>
\ No newline at end of file
api.url=${api.url} api.url=${api.url}
cookie.maxAgeSeconds=${cookie.maxAgeSeconds} cookie.maxAgeSeconds=${cookie.maxAgeSeconds}
......
...@@ -250,14 +250,13 @@ ...@@ -250,14 +250,13 @@
//uses to remove expired localstorage cache after login successfully //uses to remove expired localstorage cache after login successfully
var removeExpiredLocalCache = function (data, returnUrl) { var removeExpiredLocalCache = function (data, returnUrl) {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: data.ApiHost + '/api/v1/cache/getallcache', url: data.ApiHost + '/api/v1/cache/' +
'getallcache',
data: {}, data: {},
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (cachelist) { success: function (cachelist) {
cachelist.push({ cachelist.push({
cacheKey: '/api/v1/user/getUserPermission', cacheKey: '/api/v1/user/getUserPermission',
cacheTime: '11', cacheTime: '11',
......
...@@ -1117,6 +1117,17 @@ ...@@ -1117,6 +1117,17 @@
"bsGenerateVer": "试算平衡生成版", "bsGenerateVer": "试算平衡生成版",
"bsMappingVer": "试算平衡Mapping版", "bsMappingVer": "试算平衡Mapping版",
"salaryAdvance": "预提重分类", "salaryAdvance": "预提重分类",
"eamDisposal": "EAM资产处置金额记录表" "eamDisposal": "EAM资产处置金额记录表",
"organizationId" : "机构编号",
"source" : "来源",
"poSubjectName" : "PO主体名称",
"advancePrice" : "预提金额",
"approvedPrice": "已批准标准发票金额",
"createBy": "创建人",
"createTime" : "创建时间",
"citSalaryAdvance" : "预提重分类数据源"
} }
\ No newline at end of file
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
//初始化列数据 //初始化列数据
var initColumns = function () { var initColumns = function () {
debugger;
//初始化进项发票汇总表列名 //初始化进项发票汇总表列名
$scope.incomeInvoiceTotalColumns = [ $scope.incomeInvoiceTotalColumns = [
$translate.instant('PleaseSelectColumn'), $translate.instant('PleaseSelectColumn'),
...@@ -142,14 +142,14 @@ ...@@ -142,14 +142,14 @@
//上传文件 //上传文件
var uploadfile = function (file) { var uploadfile = function (file) {
var url = uploadUrl; var url = uploadUrl;
debugger;
if (file) { if (file) {
debugger;
successCount = 0; successCount = 0;
if (!file.$error) { if (!file.$error) {
var tempFileName = PWC.newGuid() + '.dat'; var tempFileName = PWC.newGuid() + '.dat';
var token = $('input[name="__RequestVerificationToken"]').val(); var token = $('input[name="__RequestVerificationToken"]').val();
debugger;
Upload.upload({ Upload.upload({
url: uploadUrl, url: uploadUrl,
data: { data: {
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
//上传成功 //上传成功
var uploadSuccess = function (resp) { var uploadSuccess = function (resp) {
debugger;
successCount++; successCount++;
if (successCount === 1) { if (successCount === 1) {
$scope.tempFileName = resp.data; $scope.tempFileName = resp.data;
...@@ -455,7 +455,7 @@ ...@@ -455,7 +455,7 @@
//简易导入,importType来分辨是覆盖导入还是追加导入 //简易导入,importType来分辨是覆盖导入还是追加导入
$scope.importDataNew = function(importType){ $scope.importDataNew = function(importType){
debugger;
var a = projectId; var a = projectId;
if (!$scope.file || !$scope.file.name) { if (!$scope.file || !$scope.file.name) {
...@@ -483,7 +483,7 @@ ...@@ -483,7 +483,7 @@
withCredentials: true withCredentials: true
}, withCredentials: true }, withCredentials: true
}).then(function(resp){ }).then(function(resp){
debugger;
assetListService.getAssetGroupResultData(projectId).success(function (groupResultData) { assetListService.getAssetGroupResultData(projectId).success(function (groupResultData) {
$scope.assetGroupResultDataSource = groupResultData.data; $scope.assetGroupResultDataSource = groupResultData.data;
}); });
...@@ -639,6 +639,7 @@ ...@@ -639,6 +639,7 @@
$scope.ImportTotalYearDifferenceAmount = 0 $scope.ImportTotalYearDifferenceAmount = 0
assetListService.getAssetListData().success(function (rsp) { assetListService.getAssetListData().success(function (rsp) {
if (rsp && rsp.length > 0) { if (rsp && rsp.length > 0) {
$scope.isShowImportTotalBtn = false; $scope.isShowImportTotalBtn = false;
initPagingControl(rsp.length); initPagingControl(rsp.length);
...@@ -673,14 +674,14 @@ ...@@ -673,14 +674,14 @@
//根据分类获取数据 //根据分类获取数据
function getAssetResultList(assetType) { function getAssetResultList(assetType) {
debugger;
$scope.TotalCount = 0; $scope.TotalCount = 0;
$scope.TotalAccountAcquisitionValue = 0; $scope.TotalAccountAcquisitionValue = 0;
$scope.TotalAccountYearDepreciationAmount = 0; $scope.TotalAccountYearDepreciationAmount = 0;
$scope.TotalTaxCurrentYearDepreciationAmount = 0; $scope.TotalTaxCurrentYearDepreciationAmount = 0;
$scope.TotalYearDifferenceAmount = 0 $scope.TotalYearDifferenceAmount = 0
assetListService.getAssetResultList(assetType,projectId,taxAccountCompare).success(function (assetListData) { assetListService.getAssetResultList(assetType,projectId,taxAccountCompare).success(function (assetListData) {
debugger;
var data = assetListData.data; var data = assetListData.data;
if (data) { if (data) {
var index = 1; var index = 1;
...@@ -730,7 +731,6 @@ ...@@ -730,7 +731,6 @@
//初始化dx控件 //初始化dx控件
function initDxGrid() { function initDxGrid() {
debugger;
var dupColumns = [ var dupColumns = [
{ caption: $translate.instant('ImportErrorPopUpNoCol'), dataField: "index", width: 50 }, { caption: $translate.instant('ImportErrorPopUpNoCol'), dataField: "index", width: 50 },
{ caption: $translate.instant('AssetNumber'), dataField: "assetNumber" }, { caption: $translate.instant('AssetNumber'), dataField: "assetNumber" },
...@@ -816,7 +816,7 @@ ...@@ -816,7 +816,7 @@
}], }],
setCellValue: function (rowData, value) { setCellValue: function (rowData, value) {
rowData.assetGroupId = value; rowData.assetGroupId = value;
debugger;
var aseetDetailList = _.filter($scope.detailGroupListDataSource, function (item) { var aseetDetailList = _.filter($scope.detailGroupListDataSource, function (item) {
return item.assetGroupId == value; return item.assetGroupId == value;
}); });
...@@ -843,7 +843,7 @@ ...@@ -843,7 +843,7 @@
}], }],
setCellValue: function (rowData, value) { setCellValue: function (rowData, value) {
rowData.assetDetailGroupId = value; rowData.assetDetailGroupId = value;
debugger;
var aseetDetailList = _.filter($scope.detailGroupListDataSource, function (item) { var aseetDetailList = _.filter($scope.detailGroupListDataSource, function (item) {
return item.id == value; return item.id == value;
return item.id == value; return item.id == value;
...@@ -854,7 +854,7 @@ ...@@ -854,7 +854,7 @@
}, },
lookup: { lookup: {
dataSource: function (options) { dataSource: function (options) {
debugger;
return { return {
store: $scope.detailGroupListDataSource, store: $scope.detailGroupListDataSource,
filter: options.data ? ["assetGroupId", "=", options.data.assetGroupId] : null filter: options.data ? ["assetGroupId", "=", options.data.assetGroupId] : null
...@@ -887,7 +887,7 @@ ...@@ -887,7 +887,7 @@
//初始化dx控件 //初始化dx控件
function initAssetResultDxGrid() { function initAssetResultDxGrid() {
debugger;
var dupColumns = [ var dupColumns = [
{ caption: $translate.instant('ImportErrorPopUpNoCol'), dataField: "index", width: 50, allowEditing: false, fixed: true }, { caption: $translate.instant('ImportErrorPopUpNoCol'), dataField: "index", width: 50, allowEditing: false, fixed: true },
{ caption: $translate.instant('AssetNumber'), dataField: "assetNumber", width: 120, allowEditing: false, fixed: true }, { caption: $translate.instant('AssetNumber'), dataField: "assetNumber", width: 120, allowEditing: false, fixed: true },
...@@ -948,7 +948,7 @@ ...@@ -948,7 +948,7 @@
}, },
onCellPrepared: function (e) { onCellPrepared: function (e) {
if (e.rowType === "header") { if (e.rowType === "header") {
debugger;
if (e.column.caption === $translate.instant('ImportErrorPopUpNoCol') || if (e.column.caption === $translate.instant('ImportErrorPopUpNoCol') ||
e.column.caption === $translate.instant('AssetNumber') || e.column.caption === $translate.instant('AssetNumber') ||
e.column.caption === $translate.instant('AssetGroupName') || e.column.caption === $translate.instant('AssetGroupName') ||
...@@ -1048,7 +1048,7 @@ ...@@ -1048,7 +1048,7 @@
valueExpr: "key", valueExpr: "key",
displayExpr: "name", displayExpr: "name",
onValueChanged: function(data) { onValueChanged: function(data) {
debugger;
taxAccountCompare = data.value; taxAccountCompare = data.value;
getAssetResultList($scope.displayType - 1); getAssetResultList($scope.displayType - 1);
} }
...@@ -1056,10 +1056,10 @@ ...@@ -1056,10 +1056,10 @@
//获取数据服务 //获取数据服务
var getGroupList = function () { var getGroupList = function () {
debugger;
var deferred = $q.defer(); var deferred = $q.defer();
assetListService.getAssetGroupListData().success(function (data) { assetListService.getAssetGroupListData().success(function (data) {
debugger;
if (data.data) { if (data.data) {
$scope.groupListDataSource = data.data; $scope.groupListDataSource = data.data;
deferred.resolve(data.data); deferred.resolve(data.data);
...@@ -1073,10 +1073,10 @@ ...@@ -1073,10 +1073,10 @@
//获取导入后数据 //获取导入后数据
var getGroupDetailList = function () { var getGroupDetailList = function () {
debugger;
var deferred = $q.defer(); var deferred = $q.defer();
assetListService.getAssetDetailGroupListData().success(function (data) { assetListService.getAssetDetailGroupListData().success(function (data) {
debugger;
if (data.data) { if (data.data) {
$scope.detailGroupListDataSource = data.data; $scope.detailGroupListDataSource = data.data;
deferred.resolve(data.data); deferred.resolve(data.data);
...@@ -1298,13 +1298,13 @@ ...@@ -1298,13 +1298,13 @@
//保存分类信息 //保存分类信息
$scope.saveAssetGroupInfo = function () { $scope.saveAssetGroupInfo = function () {
debugger;
var dataGrid = $('#assetsGroupGrid').dxDataGrid("instance"); var dataGrid = $('#assetsGroupGrid').dxDataGrid("instance");
dataGrid.saveEditData(); dataGrid.saveEditData();
if (validationAssetGroupList()) if (validationAssetGroupList())
{ {
assetListService.saveAssetGroupInfo($scope.assetGroupResultDataSource, $scope.saveGroupType, projectId).success(function (data) { assetListService.saveAssetGroupInfo($scope.assetGroupResultDataSource, $scope.saveGroupType, projectId).success(function (data) {
debugger;
if (data) { if (data) {
SweetAlert.success($translate.instant('SaveSuccess')); SweetAlert.success($translate.instant('SaveSuccess'));
if ($scope.modalInstance) { if ($scope.modalInstance) {
...@@ -1377,13 +1377,13 @@ ...@@ -1377,13 +1377,13 @@
//控制明细信息中删除权限 //控制明细信息中删除权限
var getUserPermission = function () { var getUserPermission = function () {
debugger;
var list = []; var list = [];
$scope.editCode = constant.citPermission.dataImport.assetList.importCode; $scope.editCode = constant.citPermission.dataImport.assetList.importCode;
list.push($scope.editCode); list.push($scope.editCode);
$scope.hasEditPermission = false; $scope.hasEditPermission = false;
$scope.$root.checkUserOrganizationPermissionList(list).success(function (data) { $scope.$root.checkUserOrganizationPermissionList(list).success(function (data) {
debugger;
$scope.hasEditPermission = data[$scope.editCode]; $scope.hasEditPermission = data[$scope.editCode];
//$scope.dataGridInstance.option("editing.allowUpdating", $scope.hasEditPermission); //$scope.dataGridInstance.option("editing.allowUpdating", $scope.hasEditPermission);
//$scope.dataGridInstance.refresh(); //$scope.dataGridInstance.refresh();
......
citModule.controller('CitPreviewAssetListController', ['$scope', '$log', '$translate', '$timeout', '$compile', '$uibModal', 'apiInterceptor', 'Upload',
'assetListService', 'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatSessionService', 'citSessionService', 'vatImportService', 'loginContext',
'browserService', 'enums', 'vatOperationLogService', 'projectService', 'vatCommonService', 'ackMessageBox',
function ($scope, $log, $translate, $timeout, $compile, $uibModal, apiInterceptor, Upload, assetListService, SweetAlert, $q, uiGridConstants,
$interval, vatSessionService, citSessionService, vatImportService, loginContext, browserService, enums, vatOperationLogService, projectService,
vatCommonService, ackMessageBox) {
'use strict';
var projectId = vatSessionService.project.id;
var taxAccountCompare = 2;
var successCount = 0;
var uploadUrl = apiInterceptor.webApiHostUrl + '/asset/assetsImport';
var webHost = loginContext.apiHost;
var chunkSize = 100000;
var resumable = true;
var curYear = vatSessionService.project.year;
var comment = vatSessionService.project.name + " " + vatSessionService.project.year + "年";
var projectDbName = vatSessionService.project.dbName;
var serviceErrorMsg = $translate.instant('PleaseContactAdministrator');
var targetArray = [];
//写日志
$scope.moduleid = enums.vatModuleEnum.Import_AssetDiffData;
var logDto = {
ID: '',
OperationName: '',
ModuleID: $scope.moduleid,
OperationObject: $translate.instant('AssetListImport'),
OperationType: '',
OperationContent: '',
OriginalState: '',
UpdateState: '',
CreatorID: vatSessionService.logUser.ID,
Comment: comment,
IP: '',
Period: '',
};
//初始化ack-pagination
$scope.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
totalPages: 10, //总页数
maxSize: 5, //分页数字的限制。
pageSize: 20,
//pageSize: constant.page.pageSizeArrary[3], //每页多少条数据,100条
pageSizeString: constant.page.pageSizeArrary[3].toString(),
firstPage: $translate.instant('PagingFirstPage'),
previousPage: $translate.instant('PagingPreviousPage'),
nextPage: $translate.instant('PagingNextPage'),
lastPage: $translate.instant('PagingLastPage'),
};
//导入方式
$scope.importEnum = { Import: 0, CoverImport: 1, AddImport: 2 };
$scope.sheetData = { sheetNameList: [], dataList: [], selectedSheetIndex: 0 };
$scope.sheetInfo = { selectedSheetName: '', selectedSheetIndex: 0 };
$scope.invoiceData = [];
$scope.errorMsgMap = [];
//初始化参数
$scope.showErrorTable = false;
$scope.showInitTable = false;
$scope.showImportTable = false
$scope.isShowImportTotalBtn = true;
$scope.SelectAll = false;
//初始化列数据
var initColumns = function () {
//初始化进项发票汇总表列名
$scope.incomeInvoiceTotalColumns = [
$translate.instant('PleaseSelectColumn'),
$translate.instant('AssetNumber'),
$translate.instant('AssetGroupName'),
$translate.instant('AssetDescription'),
$translate.instant('BuyDate'),
$translate.instant('DepreciationDate'),
$translate.instant('DepreciationPeriod'),
$translate.instant('AcquisitionValue'),
$translate.instant('AdjustmentValue'),
$translate.instant('DisposedDate'),
$translate.instant('ResidualRate'),
$translate.instant('YearDepreciationAmount'),
$translate.instant('YearAdjustmentAmount'),
$translate.instant('YearEndValue'),
$translate.instant('AssetStatus')
];
$scope.initIncomeInvoiceTotalColumnsIndex = _.range(1, $scope.incomeInvoiceTotalColumns.length);
//必须进行map的列
$scope.mustMappingTotalColumns = [
$translate.instant('AssetNumber'),
$translate.instant('AssetGroupName'),
//$translate.instant('AssetDescription'),
$translate.instant('BuyDate'),
//$translate.instant('DepreciationDate'),
$translate.instant('DepreciationPeriod'),
$translate.instant('AcquisitionValue'),
//$translate.instant('AdjustmentValue'),
//$translate.instant('DisposedDate'),
$translate.instant('ResidualRate'),
$translate.instant('YearDepreciationAmount'),
//$translate.instant('YearAdjustmentAmount'),
$translate.instant('YearEndValue'),
//$translate.instant('AssetStatus')
];
};
//发票信息汇总数据表选择列名事件
//parentIndex:当前列号
//index:下拉列表中选项的序号
var mappingColumn = function (parentIndex, index, colName) {
if (colName) {
var oldColumn = $scope.selectedColumnMap[parentIndex];
var newColumn = $scope.incomeInvoiceTotalColumns[index];
//如果新的选择项与老的选择项一致,则不进行操作
if (oldColumn === newColumn) {
return;
}
else {
$scope.selectedColumnMap[parentIndex] = colName;
if (colName !== $translate.instant('PleaseSelectColumn')) {
//如果当前选择的不是"请选择列名",则将选项从数组中移除
$scope.incomeInvoiceTotalColumns.splice(index, 1);
if (oldColumn && oldColumn !== $translate.instant('PleaseSelectColumn')) {
//将老的选项追加到选项列表中
$scope.incomeInvoiceTotalColumns.push(oldColumn);
}
}
else {
//如果当前选中的是"请选择列名",则将该列原来的列名追加到选项列表中
if (oldColumn) {
$scope.incomeInvoiceTotalColumns.push(oldColumn);
}
}
}
}
//$log.debug($scope.selectedColumnMap);
};
//上传文件
var uploadfile = function (file) {
var url = uploadUrl;
if (file) {
successCount = 0;
if (!file.$error) {
var tempFileName = PWC.newGuid() + '.dat';
var token = $('input[name="__RequestVerificationToken"]').val();
Upload.upload({
url: uploadUrl,
data: {
filename: file.name,
tempFileName: tempFileName
},
file: file,
// resumeChunkSize: resumable ? chunkSize : null,
headers: {
'Access-Control-Allow-Origin': '*',
Authorization: apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken(),
__RequestVerificationToken: token,
withCredentials: true
},
__RequestVerificationToken: token,
withCredentials: true
}).then(uploadSuccess).error(function(){
SweetAlert('哪就错了,瞎报错');
});
}
}
};
//上传成功
var uploadSuccess = function (resp) {
successCount++;
if (successCount === 1) {
$scope.tempFileName = resp.data;
// changeSheet(0);
}
};
//选择sheet
function changeSheet(selectedSheet) {
var sheetIndex = _.findIndex($scope.sheetData.sheetNameList, function (num) {
return num.name === selectedSheet.name;
})
$scope.sheetInfo.selectedSheetIndex = sheetIndex === -1 ? 0 : sheetIndex;
refreshTable();
};
//刷新列表
function refreshTable() {
$scope.showErrorTable = false;
if (_.isString($scope.tempFileName)) {
$scope.selectedColumnMap = [];
//$scope.columnNum = 0;
$scope.sheetData = { sheetNameList: [], dataList: [], selectedSheetIndex: 0 };
vatImportService.getFileContent($scope.tempFileName, $scope.sheetInfo.selectedSheetIndex, 0).success(function (data) {
if (data.result === false) {
$scope.showInitTable = true;
$scope.showImportTable = false;
//initTableTitle();
SweetAlert.warning(data.resultMsg);
}
else {
$scope.showInitTable = false;
$scope.showImportTable = true
}
$scope.sheetData = data;
var sheetNameObjectArray = [];
data.sheetNameList.forEach(function (v) {
sheetNameObjectArray.push({ 'name': v });
});
$scope.sheetData.sheetNameList = sheetNameObjectArray;
$scope.sheetInfo.selectedSheetName = $scope.sheetData.sheetNameList[$scope.sheetInfo.selectedSheetIndex];
citSessionService.dataChanged = true;
$scope.invoiceData = $scope.sheetData.dataList.slice(0, $scope.sheetData.dataList.length);
initColumns();
//加入index序号
var index = 1;
$scope.invoiceData.forEach(function (v) {
v.index = index++;
});
}).error(function () {
SweetAlert.error(serviceErrorMsg);
});
}
};
//转换没有选中的列值
function undefinedToNull(inputData,type) {
if (PWC.isNullOrEmpty(inputData)) {
if (type == 0)
{
return 0;
}
if (type == 1)
{
return null;
}
else
{
return 0;
}
}
else {
return inputData;
}
}
//获取导入的Excel信息
function getImportExcelData(startRow) {
//将需要导入的数据组装到list中
var inputList = [];
for (var i = startRow - 1; i < $scope.sheetData.dataList.length; i++) {
var invoiceInfo = {
'Index': $scope.sheetData.dataList[i].index,//行号
'AssetNumber': $scope.sheetData.dataList[i][$.inArray($translate.instant('AssetNumber'), $scope.selectedColumnMap)],
'AssetGroupName': $scope.sheetData.dataList[i][$.inArray($translate.instant('AssetGroupName'), $scope.selectedColumnMap)],
'AssetDescription': undefinedToNull($scope.sheetData.dataList[i][$.inArray($translate.instant('AssetDescription'), $scope.selectedColumnMap)],1),
'BuyDate': $scope.sheetData.dataList[i][$.inArray($translate.instant('BuyDate'), $scope.selectedColumnMap)],
'DepreciationDate': undefinedToNull($scope.sheetData.dataList[i][$.inArray($translate.instant('DepreciationDate'), $scope.selectedColumnMap)],1),
'DepreciationPeriod': undefinedToNull($scope.sheetData.dataList[i][$.inArray($translate.instant('DepreciationPeriod'), $scope.selectedColumnMap)],0),
'AcquisitionValue': $scope.sheetData.dataList[i][$.inArray($translate.instant('AcquisitionValue'), $scope.selectedColumnMap)],
'AdjustmentValue': undefinedToNull($scope.sheetData.dataList[i][$.inArray($translate.instant('AdjustmentValue'), $scope.selectedColumnMap)],0),
'DisposedDate': undefinedToNull($scope.sheetData.dataList[i][$.inArray($translate.instant('DisposedDate'), $scope.selectedColumnMap)],1),
'ResidualRate': undefinedToNull($scope.sheetData.dataList[i][$.inArray($translate.instant('ResidualRate'), $scope.selectedColumnMap)],0),
'YearDepreciationAmount': undefinedToNull($scope.sheetData.dataList[i][$.inArray($translate.instant('YearDepreciationAmount'), $scope.selectedColumnMap)],0),
'YearAdjustmentAmount': undefinedToNull($scope.sheetData.dataList[i][$.inArray($translate.instant('YearAdjustmentAmount'), $scope.selectedColumnMap)],0),
'YearEndValue': undefinedToNull($scope.sheetData.dataList[i][$.inArray($translate.instant('YearEndValue'), $scope.selectedColumnMap)],0),
'Status': $scope.sheetData.dataList[i][$.inArray($translate.instant('AssetStatus'), $scope.selectedColumnMap)],
};
inputList.push(invoiceInfo);
}
return inputList;
}
//1.判断是否有没有map的必须列和起始行输入格式是否正确
var ColumnsMapCheckIncomeInvoice = function () {
var result = true;
//1:判断是否有没有map的必须列
var notMappedColumns = '';
if ($scope.selectedColumnMap.length >= 0) {
var count1 = 0;
$scope.mustMappingTotalColumns.forEach(function (m) {
if (m !== $translate.instant('PleaseSelectColumn')) {
if ($.inArray(m, $scope.selectedColumnMap) < 0) {
notMappedColumns += m + ',';
count1++;
}
}
});
if (count1) {
result = false;
//加入到错误列表中
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('ColumnsMapErrorType'),
'errorCount': count1,
'errorContent': $translate.instant('ColumnsMapErrorMsg').formatObj({ columns: notMappedColumns.substring(0, notMappedColumns.length - 1) })
});
}
}
//2:判断起始行输入框输入内容是否合理
var startNumberCheckMsg = '';
var startRowNum = $('#StartRowNum').val();
if (startRowNum === '') {
result = false;
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('StartRowError'),
'errorCount': 1,
'errorContent': $translate.instant('StartRowNull')
});
}
else if (parseInt(startRowNum) > $scope.sheetData.dataList.length) {
result = false;
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('StartRowError'),
'errorCount': 1,
'errorContent': $translate.instant('StartRowNumberCheckMsg')
});
}
return result;
};
//前端验证
function frontEndValidData(inputList) {
//4.购入日期验证,不能为空,且格式正确
var buyDateCheckMsg = '';
var count1 = 0;
//产品编号不能为空
var assetNumberCheckMsg = '';
var count2 = 0;
//资产类别不能为空
var groupNameCheckMsg = '';
var count3 = 0;
//原值不能为空
var acquisitionValueCheckMsg = '';
var count4 = 0;
//数字类型验证
var amountNumberCheckMsg = '';
var count5 = 0;
inputList.forEach(function (m) {
//购入日期为空
if (PWC.isNullOrEmpty(m.BuyDate)) {
buyDateCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('BuyDateNullMsg') + '<br />';
count1++;
}
//日期格式错误
else if (!PWC.checkDateType(m.BuyDate)) {
buyDateCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('BuyDateErrorMsg') + '<br />';
count1++;
}
if (PWC.isNullOrEmpty(m.AssetNumber)) {
assetNumberCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('AssetNumberNullMsg') + '<br />';
count2++;
}
if (PWC.isNullOrEmpty(m.AssetGroupName)) {
groupNameCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('AssetGroupNameNullMsg') + '<br />';
count3++;
}
if (PWC.isNullOrEmpty(m.AcquisitionValue)) {
acquisitionValueCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('AcquisitionValueNullMsg') + '<br />';
count4++;
}
//开始折旧日期格式错误
if (!PWC.isNullOrEmpty(m.DepreciationDate) && !PWC.checkDateType(m.DepreciationDate)) {
amountNumberCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('DepreciationDate') + $translate.instant('DataTypeErrorMsg') + '<br />';
count5++;
}
if (!PWC.isNullOrEmpty(m.DisposedDate) && !PWC.checkDateType(m.DisposedDate)) {
amountNumberCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('DisposedDate') + $translate.instant('DataTypeErrorMsg') + '<br />';
count5++;
}
//判断是否为数字
if (isNaN(Number(m.DepreciationPeriod))) {
amountNumberCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('DepreciationPeriod') + $translate.instant('DataTypeErrorMsg') + ';<br />';
count5++;
}
if (isNaN(Number(m.AcquisitionValue))) {
amountNumberCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('AcquisitionValue') + $translate.instant('DataTypeErrorMsg') + ';<br />';
count5++;
}
if (isNaN(Number(m.AdjustmentValue))) {
amountNumberCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('AdjustmentValue') + $translate.instant('DataTypeErrorMsg') + ';<br />';
count5++;
}
if (isNaN(Number(m.ResidualRate))) {
amountNumberCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('ResidualRate') + $translate.instant('DataTypeErrorMsg') + ';<br />';
count5++;
}
if (isNaN(Number(m.YearDepreciationAmount))) {
amountNumberCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('YearDepreciationAmount') + $translate.instant('DataTypeErrorMsg') + ';<br />';
count5++;
}
if (isNaN(Number(m.YearAdjustmentAmount))) {
amountNumberCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('YearDepreciationAmount') + $translate.instant('DataTypeErrorMsg') + ';<br />';
count5++;
}
if (isNaN(Number(m.YearEndValue))) {
amountNumberCheckMsg += '(' + $translate.instant('RowIndex').formatObj({ rowIndex: m.Index }) + ')' + $translate.instant('YearEndValue') + $translate.instant('DataTypeErrorMsg') + ';<br />';
count5++;
}
});
if (count1 > 0) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('BuyDateType'),
'errorCount': count1,
'errorContent': buyDateCheckMsg
});
}
if (count2 > 0) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('AssetNumberType'),
'errorCount': count2,
'errorContent': assetNumberCheckMsg
});
}
if (count3 > 0) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('AssetGroupNameType'),
'errorCount': count3,
'errorContent': groupNameCheckMsg
});
}
if (count4 > 0) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('AcquisitionValueType'),
'errorCount': count4,
'errorContent': acquisitionValueCheckMsg
});
}
if (count5 > 0) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('DataTypeError'),
'errorCount': count5,
'errorContent': amountNumberCheckMsg
});
}
}
//简易导入,importType来分辨是覆盖导入还是追加导入
$scope.importDataNew = function(importType){
var a = projectId;
if (!$scope.file || !$scope.file.name) {
SweetAlert.warning($translate.instant('SelectImportFileRequired'));
return;
}
var tempFileName = PWC.newGuid() + '.dat';
var token = $('input[name="__RequestVerificationToken"]').val();
// updateProgressToZero();
Upload.upload({
url: uploadUrl,
data: {
filename: $scope.file.name,
tempFileName: tempFileName,
projectId: projectId
},
file: $scope.file,
resumeChunkSize: resumable ? $scope.chunkSize : null,
headers: {
'Access-Control-Allow-Origin': '*',
Authorization: apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken(),
__RequestVerificationToken: token,
withCredentials: true
}, withCredentials: true
}).then(function(resp){
assetListService.getAssetGroupResultData(projectId).success(function (groupResultData) {
$scope.assetGroupResultDataSource = groupResultData.data;
});
// $scope.assetGroupResultDataSource = resp.data;
InitGrid(false);
$scope.saveGroupType = 1;
$scope.isDisabled = true;
//为方便开发暂时先改为false
$scope.isDisabled = false;
$scope.modalInstance = $uibModal.open({
animation: false,
backdrop: 'static',
keyboard: false,
ariaLabelledBy: 'modal-title',
ariaDescribedBy: 'modal-body',
templateUrl: 'set-asset-group-modal.html',
scope: $scope,
windowClass: "set-asset-list-modal"
});
});
};
//点击导入按钮时,进行导入操作---原方法
function importData(importType) {
$scope.errorMsgMap = [];
//设置数据导入时的起始行,默认设置从第一行开始
var startRowNum = 1;
if ($('#StartRowNum').val()) {
startRowNum = $('#StartRowNum').val();
}
if (!$scope.fileName) {
SweetAlert.warning($translate.instant('PleaseSelectFileFirst'));
return;
}
//判断是否有没有map的必须列和起始行输入格式是否正确
if (!ColumnsMapCheckIncomeInvoice()) {
$('#errorListModal').modal('show');
return;
}
//日志对象
logDto.ID = PWC.newGuid();
logDto.CreateTime = new Date();
logDto.UpdateTime = new Date();
logDto.OperationContent = $scope.fileName;
if (importType === $scope.importEnum.Import) {
logDto.OperationName = $translate.instant('ImportOutputInvoice');
logDto.OperationType = enums.vatLogOperationTypeEnum.Import;
}
else if (importType === $scope.importEnum.CoverImport) {
logDto.OperationName = $translate.instant('CoverImportOutputInvoice');
logDto.OperationType = enums.vatLogOperationTypeEnum.CoverImport;
}
else if (importType === $scope.importEnum.AddImport) {
logDto.OperationName = $translate.instant('AddImportOutputInvoice');
logDto.OperationType = enums.vatLogOperationTypeEnum.AddImport;
}
//获取数据
var inputList = getImportExcelData(startRowNum);
//前台数据验证
frontEndValidData(inputList);
if ($scope.errorMsgMap.length > 0) {
$('#errorListModal').modal('show');
return;
}
else {
assetListService.importAssetList(inputList, importType).success(function (or) {
//修改状态
vatCommonService.importSetProjectStatus(projectDbName, -1, constant.DictionaryDictKey.WFImportAsset, enums.FinishStatusEnum.Finished);
if (or && or.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
initDataFromDB();
$scope.fileName = '';
getValidationList();
//有没有分类的数据
if (or.data && or.data.length > 0) {
var index = 1;
or.data.forEach(function (v) {
v.index = index++;
});
$scope.assetGroupResultDataSource = or.data;
InitGrid(false);
$scope.saveGroupType = 1;
$scope.isDisabled = true;
$scope.modalInstance = $uibModal.open({
animation: false,
backdrop: 'static',
keyboard: false,
ariaLabelledBy: 'modal-title',
ariaDescribedBy: 'modal-body',
templateUrl: 'set-asset-group-modal.html',
scope: $scope,
windowClass: "set-asset-list-modal"
});
}
else {
SweetAlert.success($translate.instant('ImportSuccess'));
}
}
else {
logDto.UpdateState = $translate.instant('ImportFail');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.error($translate.instant('ImportFail'));
}
}).error(function () {
logDto.UpdateState = $translate.instant('ImportFail');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.error(serviceErrorMsg);
});
}
}
//获取后台验证信息----原方法
function getValidationList() {
vatImportService.getValidationList(enums.EnumValidationType.AssetDiffData, 0).success(function (data) {
if (data.length > 0) {
var index = 1;
data.forEach(function (v) {
v.index = index++;
});
$scope.errorList = data;
$scope.gridOptionsErrorMsg.data = data;
showErrTab();
$scope.toggleErrorTab();
$scope.showErrorTable = true;
}
else {
$scope.errorList = [];
$scope.gridOptionsErrorMsg.data = [];
$scope.showErrorTable = false;
$scope.ImportErrorTab = false;
$scope.ImportErrorTag = false;
}
}).error(function () {
SweetAlert.error(serviceErrorMsg);
});
}
//从数据库获取销项数据
function initDataFromDB() {
$scope.showInitTable = true;
$scope.showImportTable = false;
citSessionService.dataChanged = false;
$scope.sheetData = { sheetNameList: [], dataList: [], selectedSheetIndex: 0 };
$scope.invoiceData = [];
$scope.ImportTotalCount = 0;
$scope.ImportTotalAccountAcquisitionValue = 0;
$scope.ImportTotalAccountYearDepreciationAmount = 0;
$scope.ImportTotalTaxCurrentYearDepreciationAmount = 0;
$scope.ImportTotalYearDifferenceAmount = 0
assetListService.getAssetListData().success(function (rsp) {
if (rsp && rsp.length > 0) {
$scope.isShowImportTotalBtn = false;
initPagingControl(rsp.length);
var skipCount = ($scope.pagingOptions.pageIndex - 1) * $scope.pagingOptions.pageSize;
var pagingData = _.chain(rsp).rest(skipCount).first($scope.pagingOptions.pageSize).value();
getValidationList();
var dataList = pagingData;
var index = 1;
dataList.forEach(function (v) {
v.index = index++;
});
$scope.assetDBData = _.clone(dataList);
//合计列
rsp.forEach(function (v) {
$scope.ImportTotalAccountAcquisitionValue += v.accountAcquisitionValue;
$scope.ImportTotalAccountYearDepreciationAmount += v.accountYearDepreciationAmount;
$scope.ImportTotalTaxCurrentYearDepreciationAmount += v.taxCurrentYearDepreciationAmount;
if(v.isRetain == 1){
$scope.ImportTotalYearDifferenceAmount += v.yearDifferenceAmount;
}
});
$scope.ImportTotalCount = rsp.length;
$scope.ImportTotalAccountAcquisitionValue = PWC.round($scope.ImportTotalAccountAcquisitionValue, 2);
$scope.ImportTotalAccountYearDepreciationAmount = PWC.round($scope.ImportTotalAccountYearDepreciationAmount, 2);
$scope.ImportTotalTaxCurrentYearDepreciationAmount = PWC.round($scope.ImportTotalTaxCurrentYearDepreciationAmount, 2);
$scope.ImportTotalYearDifferenceAmount = PWC.round($scope.ImportTotalYearDifferenceAmount, 2);
}
}).error(function () {
SweetAlert.error(serviceErrorMsg);
});
}
//根据分类获取数据
function getAssetResultList(assetType) {
$scope.TotalCount = 0;
$scope.TotalAccountAcquisitionValue = 0;
$scope.TotalAccountYearDepreciationAmount = 0;
$scope.TotalTaxCurrentYearDepreciationAmount = 0;
$scope.TotalYearDifferenceAmount = 0
assetListService.getAssetResultList(assetType,projectId,taxAccountCompare).success(function (assetListData) {
var data = assetListData.data;
if (data) {
var index = 1;
data.forEach(function (v) {
v.index = index++;
$scope.TotalAccountAcquisitionValue += v.accountAcquisitionValue;
$scope.TotalAccountYearDepreciationAmount += v.accountYearDepreciationAmount;
$scope.TotalTaxCurrentYearDepreciationAmount += v.taxCurrentYearDepreciationAmount;
if(v.isRetain == 1){
$scope.TotalYearDifferenceAmount += v.yearDifferenceAmount;
}
});
$scope.assetsResultData = data;
$scope.TotalCount = data.length;
$scope.TotalAccountAcquisitionValue = PWC.round($scope.TotalAccountAcquisitionValue, 2);
$scope.TotalAccountYearDepreciationAmount = PWC.round($scope.TotalAccountYearDepreciationAmount, 2);
$scope.TotalTaxCurrentYearDepreciationAmount = PWC.round($scope.TotalTaxCurrentYearDepreciationAmount, 2);
$scope.TotalYearDifferenceAmount = PWC.round($scope.TotalYearDifferenceAmount, 2);
}
});
}
function setErrorWrapCssDefault() {
$('#content-resizer').css('bottom', '10px');
$('#topIcon').css({ bottom: '-501px' });
$('.error-info-wrapper').css('height', '0px');
};
function showErrTab() {
$scope.ImportErrorTab = true;
$scope.ImportErrorTag = true;
$scope.errorMsg = $translate.instant('ImportAssetErrorMsg').formatObj({ "NumberOfError": $scope.errorList.length });
};
var initPagingControl = function (totalItemsCount) {
$scope.pagingOptions.totalItems = totalItemsCount;
}
//显示明细
var dealDetail = function () {
return '<div ng-if="row.entity.isShowDetail === 1" class="ui-grid-cell-contents"><span><a ng-click="grid.appScope.openTab(row.entity.erpCheckTypeId,row.entity.validationDetails)">查看明细</a><span></div>' +
'<div ng-if="row.entity.isShowDetail !== 1" class="ui-grid-cell-contents" title="{{row.entity.validationDetails}}"><span>{{row.entity.validationDetails}}<span></div>';
}
//初始化dx控件
function initDxGrid() {
var dupColumns = [
{ caption: $translate.instant('ImportErrorPopUpNoCol'), dataField: "index", width: 50 },
{ caption: $translate.instant('AssetNumber'), dataField: "assetNumber" },
{ caption: $translate.instant('AssetGroupName'), dataField: "assetGroupName", },
{ caption: $translate.instant('AssetDescription'), dataField: "assetDescription", },
{ caption: $translate.instant('BuyDate'), dataField: "buyDate", dataType: "date", format: "yyyy-MM-dd", },
{ caption: $translate.instant('DepreciationDate'), dataField: "depreciationDate", dataType: "date", format: "yyyy-MM-dd", },
{ caption: $translate.instant('DepreciationPeriod'), dataField: "depreciationPeriod", format: { type: 'fixedPoint', precision: 0 } },
{ caption: $translate.instant('AcquisitionValue'), dataField: "acquisitionValue", format: { type: 'fixedPoint', precision: 2 } },
{ caption: $translate.instant('AdjustmentValue'), dataField: "adjustmentValue", format: { type: 'fixedPoint', precision: 2 } },
{ caption: $translate.instant('DisposedDate'), dataField: "disposedDate", dataType: "date", format: "yyyy-MM-dd", },
{ caption: $translate.instant('ResidualRate'), dataField: "residualRate", format: { type: 'fixedPoint', precision: 2 } },
{ caption: $translate.instant('YearDepreciationAmount'), dataField: "yearDepreciationAmount", format: { type: 'fixedPoint', precision: 2 } },
{ caption: $translate.instant('YearAdjustmentAmount'), dataField: "yearAdjustmentAmount", format: { type: 'fixedPoint', precision: 2 } },
{ caption: $translate.instant('YearEndValue'), dataField: "yearEndValue", format: { type: 'fixedPoint', precision: 2 } },
];
$scope.gridInitDataOption = {
columns: dupColumns,
bindingOptions: {
"dataSource": "assetDBData"
},
onInitialized: function (e) {
$scope.assetImportGridInstance = e.component;
},
hoverStateEnabled: true,
scrolling: { mode: "virtual" },
noDataText: $translate.instant('AccountVoucher_DataGrid_NoDataText'),
height: '99%',
}
}
//初始化编辑d资产分类(asset_group_result)ataGrid
var InitGrid = function (showAdd) {
$scope.assetsGridOptions = {
bindingOptions: {
dataSource: 'assetGroupResultDataSource',
},
keyExpr: "id",
paging: {
enabled: false
},
editing: {
mode: "batch",
allowUpdating: true,
},
onInitialized: function (e) {
$scope.assetGroupGridInstance = e.component;
},
showBorders: true,
hoverStateEnabled: true,
onCellPrepared: function (e) {
if (e.rowType === "header" && PWC.isNullOrEmpty(e.column.caption)) {
e.cellElement.empty();
e.cellElement.append("操作");
e.cellElement.addClass('herder-center');
}
if (e.rowType === "data" && e.column.command === "edit") {
var isEditing = e.row.isEditing,
$links = e.cellElement.find(".dx-link");
if (isEditing) {
$links.filter(".dx-link-save").addClass("column-color");
$links.filter(".dx-link-cancel").addClass("column-color");
} else {
$links.filter(".dx-link-edit").addClass("column-color");
$links.filter(".dx-link-delete").addClass("column-color");
}
}
},
columns: [
{
caption: $translate.instant('ImportErrorPopUpNoCol'), dataField: "index", width: 50, allowEditing: false,
},
{
caption: $translate.instant('AssetGroupName'), dataField: "assetName", width: 150, allowEditing: false,
},
{
caption: $translate.instant('LevelOneGroup'), dataField: "assetGroupId",
validationRules: [{
type: "required",
message: $translate.instant('LevelOneGroupValidation')
}],
setCellValue: function (rowData, value) {
rowData.assetGroupId = value;
var aseetDetailList = _.filter($scope.detailGroupListDataSource, function (item) {
return item.assetGroupId == value;
});
if (aseetDetailList.length == 0) {
rowData.assetDetailGroupId = null;
rowData.taxDepreciationPeriod = null;
}
else {
rowData.assetDetailGroupId = aseetDetailList[0].id;
rowData.taxDepreciationPeriod = aseetDetailList[0].groupYear * 12;
};
},
lookup: {
dataSource: $scope.groupListDataSource,
displayExpr: "assetGroupName",
valueExpr: "id"
}
},
{
caption: $translate.instant('LevelTwoGroup'), dataField: "assetDetailGroupId",
validationRules: [{
type: "required",
message: $translate.instant('LevelTwoGroupValidation')
}],
setCellValue: function (rowData, value) {
rowData.assetDetailGroupId = value;
var aseetDetailList = _.filter($scope.detailGroupListDataSource, function (item) {
return item.id == value;
return item.id == value;
});
if (aseetDetailList.length > 0) {
rowData.taxDepreciationPeriod = aseetDetailList[0].groupYear * 12;
}
},
lookup: {
dataSource: function (options) {
return {
store: $scope.detailGroupListDataSource,
filter: options.data ? ["assetGroupId", "=", options.data.assetGroupId] : null
};
},
displayExpr: "detailGroupName",
valueExpr: "id"
}
},
{
caption: $translate.instant('DepreciationPeriod'), dataField: "taxDepreciationPeriod", width: 100,
validationRules: [{
type: "required",
message: $translate.instant('DepreciationPeriodValidation')
}],
}
],
width: '99%',
onToolbarPreparing: function (e) {
var toolbarItems = e.toolbarOptions.items;
var toolbarItems = e.toolbarOptions.items;
_.each(toolbarItems, function (item) {
if (item.name === 'saveButton' || item.name == 'revertButton') {
item.visible = false;
}
});
}
};
}
//初始化dx控件
function initAssetResultDxGrid() {
var dupColumns = [
{ caption: $translate.instant('ImportErrorPopUpNoCol'), dataField: "index", width: 50, allowEditing: false, fixed: true },
{ caption: $translate.instant('AssetNumber'), dataField: "assetNumber", width: 120, allowEditing: false, fixed: true },
{ caption: $translate.instant('AssetGroupName'), dataField: "assetGroupName", width: 120, allowEditing: false, fixed: true },
{ caption: $translate.instant('AssetDescription'), dataField: "assetDescription", width: 200, allowEditing: false, fixed: true },
{
caption: $translate.instant('AccountData'), alignment: 'center',
columns: [
{ caption: $translate.instant('BuyDate'), dataField: "buyDate", dataType: "date", format: "yyyy-MM-dd", width: 100, allowEditing: false },
{ caption: $translate.instant('DepreciationDate'), dataField: "depreciationDate", dataType: "date", format: "yyyy-MM-dd", width: 100, allowEditing: false },
{ caption: $translate.instant('DepreciationPeriod'), dataField: "depreciationPeriod", format: { type: 'fixedPoint', precision: 0 }, width: 100, allowEditing: false },
{ caption: $translate.instant('AcquisitionValue'), dataField: "accountAcquisitionValue", format: { type: 'fixedPoint', precision: 2 }, width: 100, allowEditing: false },
//{ caption: $translate.instant('AdjustmentValue'), dataField: "adjustmentValue", format: { type: 'fixedPoint', precision: 2 } },
{ caption: $translate.instant('DisposedDate'), dataField: "disposedDate", dataType: "date", format: "yyyy-MM-dd", width: 100, allowEditing: false },
{ caption: $translate.instant('ResidualRate'), dataField: "residualRate", format: { type: 'percent', precision: 2 }, width: 80, allowEditing: false },
{ caption: $translate.instant('PerMonthDepreciationAmount'), dataField: "accountMonthDepreciationAmount", format: { type: 'fixedPoint', precision: 2 }, width: 100, allowEditing: false },
{ caption: $translate.instant('YearDepreciationAmount'), dataField: "accountYearDepreciationAmount", format: { type: 'fixedPoint', precision: 2 }, width: 100, allowEditing: false },
{ caption: $translate.instant('AccountTotalepreciationAmount'), dataField: "accountTotalepreciationAmount", format: { type: 'fixedPoint', precision: 2 }, width: 100, allowEditing: false },
{ caption: $translate.instant('YearEndValue'), dataField: "yearEndValue", format: { type: 'fixedPoint', precision: 2 }, width: 100, allowEditing: false },
]
},
{
caption: $translate.instant('TaxData'), alignment: 'center',
columns: [
{ caption: $translate.instant('TaxGroupType'), dataField: "taxGroupName", width: 200, allowEditing: false },
{ caption: $translate.instant('DepreciationPeriod'), dataField: "taxDepreciationPeriod", format: { type: 'fixedPoint', precision: 0 }, width: 100, allowEditing: true },
{ caption: $translate.instant('TaxToLastYearDepreciationPeriod'), dataField: "taxToLastYearDepreciationPeriod", format: { type: 'fixedPoint', precision: 0 }, width: 150, allowEditing: false },
{ caption: $translate.instant('TaxToCurrentYearDepreciationPeriod'), dataField: "taxToCurrentYearDepreciationPeriod", format: { type: 'fixedPoint', precision: 0 }, width: 150, allowEditing: false },
{ caption: $translate.instant('TaxYearDepreciationPeriod'), dataField: "taxYearDepreciationPeriod", format: { type: 'fixedPoint', precision: 0 }, width: 100, allowEditing: false },
{ caption: $translate.instant('PerMonthDepreciationAmount'), dataField: "taxMonthDepreciationAmount", format: { type: 'fixedPoint', precision: 2 }, width: 100, allowEditing: false },
{ caption: $translate.instant('YearDepreciationAmount'), dataField: "taxCurrentYearDepreciationAmount", format: { type: 'fixedPoint', precision: 2 }, width: 100, allowEditing: false },
{ caption: $translate.instant('AccountTotalepreciationAmount'), dataField: "taxToCurrentYearDepreciationAmount", format: { type: 'fixedPoint', precision: 2 }, width: 100, allowEditing: false },
]
},
{
caption: $translate.instant('AssetDifferent'), alignment: 'center',
columns: [
{ caption: $translate.instant('TotalDifferenceAmount'), dataField: "totalDifferenceAmount", format: { type: 'fixedPoint', precision: 2 }, width: 100, allowEditing: false },
{ caption: $translate.instant('YearDifferenceAmount'), dataField: "yearDifferenceAmount", format: { type: 'fixedPoint', precision: 2 }, width: 100, allowEditing: false },
]
},
{
caption: $translate.instant('IsRetain'), alignment: 'center', dataField: "isRetain", dataType: "boolean", width: 120, allowEditing: true
},
];
$scope.assetsResultGridOptions = {
columns: dupColumns,
bindingOptions: {
"dataSource": "assetsResultData",
},
editing: {
mode: "batch",
allowUpdating:true,
},
onInitialized: function (e) {
$scope.dataGridInstance = e.component;
},
onCellPrepared: function (e) {
if (e.rowType === "header") {
if (e.column.caption === $translate.instant('ImportErrorPopUpNoCol') ||
e.column.caption === $translate.instant('AssetNumber') ||
e.column.caption === $translate.instant('AssetGroupName') ||
e.column.caption === $translate.instant('AssetDescription'))
{
e.cellElement.addClass('herder-center');
e.cellElement.append($compile(inputElement)($scope));
}
if(e.column.caption === $translate.instant('IsRetain'))
{
e.cellElement.empty();
var inputElement = $('<input type="checkbox" ng-model="SelectAll" ng-click="selectAllAsset()">{{\'isRetainDifference\' | translate}}</input>');
e.cellElement.addClass('herder-center');
e.cellElement.append($compile(inputElement)($scope));
}
if(e.column.caption === $translate.instant('IsRetain'))
{
e.cellElement.empty();
var inputElement = $('<input type="checkbox" ng-model="SelectAll" ng-click="selectAllAsset()">{{\'isRetainDifference\' | translate}}</input>');
e.cellElement.addClass('herder-center');
e.cellElement.append($compile(inputElement)($scope));
}
}
},
loadPanel: {
enabled: true
},
paging: {
pageSize: 100,
},
searchPanel: {
visible: true,
width: 240,
placeholder: $translate.instant('SearchPlaceholder')
},
showBorders: true,
hoverStateEnabled: true,
//scrolling: { mode: "virtual" },
noDataText: $translate.instant('AccountVoucher_DataGrid_NoDataText'),
height: '99%',
filterRow: {
visible: true
},
onRowUpdating: function (e) {
var data = $.extend({}, e.oldData, e.newData);
if(data.isRetain == true)
{
data.isRetain =1;
}
else if(data.isRetain == false)
{
data.isRetain =0;
}
targetArray.push(data);
},
onToolbarPreparing: function (e) {
var toolbarItems = e.toolbarOptions.items;
var savebutton = _.find(e.toolbarOptions.items, function (m) { return m.name === "saveButton" });
var defaultFun = savebutton.options.onClick;
var saveAsset = function () {
defaultFun();
assetListService.updateAssetResultList(targetArray,projectId).success(function (data) {
if (data) {
getAssetResultList($scope.displayType - 1);
SweetAlert.success($translate.instant('SaveSuccess'));
targetArray = [];
}
else
{
SweetAlert.error(serviceErrorMsg);
targetArray = [];
}
}).error(function () {
SweetAlert.error(serviceErrorMsg);
targetArray = [];
});
}
savebutton.options.onClick = saveAsset;
}
}
}
//税会差异选项内容
$scope.applyFilterTypes = [{
key: "2",
name: $translate.instant('AllTheItems')
}, {
key: "0",
name: $translate.instant('TaxDepreciation')+"<"+$translate.instant('AccountDepreciation')
}, {
key: "1",
name: $translate.instant('TaxDepreciation')+">="+$translate.instant('AccountDepreciation')
}];
//初始化税会差异选项
$scope.taxAccountDifferenceOptions = {
items: $scope.applyFilterTypes,
value: $scope.applyFilterTypes[0].key,
valueExpr: "key",
displayExpr: "name",
onValueChanged: function(data) {
taxAccountCompare = data.value;
getAssetResultList($scope.displayType - 1);
}
};
//获取数据服务
var getGroupList = function () {
var deferred = $q.defer();
assetListService.getAssetGroupListData().success(function (data) {
if (data.data) {
$scope.groupListDataSource = data.data;
deferred.resolve(data.data);
}
}).error(function (ex) {
$log.error(ex);
SweetAlert.error(serviceErrorMsg);
});
return deferred.promise;
};
//获取导入后数据
var getGroupDetailList = function () {
var deferred = $q.defer();
assetListService.getAssetDetailGroupListData().success(function (data) {
if (data.data) {
$scope.detailGroupListDataSource = data.data;
deferred.resolve(data.data);
}
}).error(function (ex) {
$log.error(ex);
SweetAlert.error(serviceErrorMsg);
});
return deferred.promise;
};
//验证分类信息是否分类完毕
var validationAssetGroupList = function () {
var isOk = true;
_.each($scope.assetGroupResultDataSource, function (m) {
if (PWC.isNullOrEmpty(m.assetName)
|| PWC.isNullOrEmpty(m.assetGroupId)
|| PWC.isNullOrEmpty(m.assetDetailGroupId)
|| PWC.isNullOrEmpty(m.taxDepreciationPeriod)) {
isOk = false;
}
});
return isOk;
}
//选中所有行操作
$scope.selectAllAsset = function () {
var isRetain = 0;
if ($scope.SelectAll) {
isRetain = 1;
$scope.assetsResultData.forEach(function (m) {
m.isRetain = 1;
});
}
else {
isRetain = 0;
$scope.assetsResultData.forEach(function (m) {
m.isRetain = 0;
});
}
assetListService.batchUpdateIsRetain($scope.displayType -1,projectId, isRetain);
}
//验证信息
$scope.openTab = function (errorType, rowdata) {
var data = JSON.parse(rowdata);
if (errorType === 110) {
dispalyDiffDataValidation(data);
}
}
//显示本年与上年数据差异界面
var dispalyDiffDataValidation = function (data) {
//$scope.devgridDataSource = data;
$scope.gridPeriodOptions = {
columnAutoWidth: true,
columns: [
{ caption: $translate.instant('AssetNumber'), dataField: "AssetNumber", textalign: "center" },
{ caption: $translate.instant('LastYear'), dataField: "LastYear", textalign: "center" },
{
caption: $translate.instant('LastAcquisitionValue'), dataField: "LastAcquisitionValue",
textalign: "right", format: { type: 'fixedPoint', precision: 2 }
},
{ caption: $translate.instant('CurrentYear'), dataField: "CurrentYear", textalign: "center" },
{
caption: $translate.instant('CurrentAcquisitionValue'), dataField: "CurrentAcquisitionValue",
textalign: "right", format: { type: 'fixedPoint', precision: 2 }
}
],
dataSource: data,
hoverStateEnabled: true,
loadPanel: {
enabled: true
},
paging: {
pageSize: 20
},
};
$scope.validateModalInstance = $uibModal.open({
animation: false,
backdrop: 'static',
keyboard: false,
ariaLabelledBy: 'modal-title',
ariaDescribedBy: 'modal-body',
templateUrl: 'set-asset-validate-modal.html',
scope: $scope,
windowClass: "period-validation-modal"
});
}
//关闭验证详细页面
$scope.cancelValidateAsset = function () {
if ($scope.validateModalInstance) {
$scope.validateModalInstance.close();
}
}
//日志
$scope.showOperateLogPop = function () {
$scope.isShowLog = true;
};
//显示验证信息
$scope.toggleErrorTab = function () {
$scope.ImportErrorTag = !$scope.ImportErrorTag;
// topIcon and content-resize gapBottom 15px
if (!$scope.ImportErrorTag) {
setErrorWrapCssDefault();
} else {
if (parseInt($('#content-resizer').css('bottom')) < 100) {
$('#content-resizer').css('bottom', '150px');
$('#content-resizer').css('z-index', '2');
$('#topIcon').css({ bottom: '-200px' });
$('.error-info-wrapper').css('height', '150px');
}
}
};
$scope.getGridHeight = function () {
if ($scope.isLoadComplete) {
return { height: ($('.balance-ouput-grid-wrapper').height() - 20) + "px" };
}
else {
return { height: 0 + "px" };
}
};
$scope.getErrorGridHeight = function () {
if ($scope.isLoadComplete) {
var y = $("#error-info-wrapper").height();
// Enough space
if (y > constant.UIGrid.gapHeight) {
y = y - constant.UIGrid.gapHeight;
return { height: y + "px" };
} else {
return { height: '0px' };
}
}
return {};
};
//显示图标
$scope.errorLevelToString = function (errorLevel) {
if (errorLevel === 0) {
return '/app-resources/images/vat/error.png';
}
if (errorLevel === 1) {
return '/app-resources/images/vat/warning.png';
}
if (errorLevel === 2) {
return '/app-resources/images/vat/tips.png';
}
else {
return '/app-resources/images/vat/tips.png';
}
}
$scope.pagingService = {
refreshInvoiceDataGrid: function () {
$log.debug("refreshInvoiceDataGrid");
initDataFromDB();
},
};
//切换tab
$scope.switchTab = function (event, type) {
$('.nav-tab span').each(function () {
$(this).removeClass('active');
});
$(event.target).addClass('active');
if ($scope.displayType !== type)
{
$scope.displayType = type;
if (type > 1) {
getAssetResultList($scope.displayType - 1);
}
else {
$scope.assetImportGridInstance.refresh();
}
}
};
//弹出分类界面,1、先获取asset_group_result表中的数据,并赋值给数据集assetGroupResultDataSource
$scope.setAssetsGroup = function () {
assetListService.getAssetGroupResultData(projectId).success(function (groupResultData) {
var data = groupResultData.data;
if (data) {
var index = 1;
data.forEach(function (v) {
v.index = index++;
});
//orgAssetGroupList = angular.copy(data);
$scope.assetGroupResultDataSource = data;
}
//初始化资产分类Grid
InitGrid(true);
//此值传入后台用来分辨当前是导入文件时的保存资产分类或者是直接点击资产分类按钮保存资产分类
$scope.saveGroupType = 2;
$scope.isDisabled = false;
$scope.modalInstance = $uibModal.open({
animation: false,
backdrop: 'static',
keyboard: false,
ariaLabelledBy: 'modal-title',
ariaDescribedBy: 'modal-body',
templateUrl: 'set-asset-group-modal.html',
scope: $scope,
windowClass: "set-asset-list-modal"
});
}).error(function (ex) {
$log.error(ex);
SweetAlert.error(serviceErrorMsg);
});
};
//保存分类信息
$scope.saveAssetGroupInfo = function () {
var dataGrid = $('#assetsGroupGrid').dxDataGrid("instance");
dataGrid.saveEditData();
if (validationAssetGroupList())
{
assetListService.saveAssetGroupInfo($scope.assetGroupResultDataSource, $scope.saveGroupType, projectId).success(function (data) {
if (data) {
SweetAlert.success($translate.instant('SaveSuccess'));
if ($scope.modalInstance) {
$scope.modalInstance.close();
}
}
}).error(function () {
SweetAlert.error(serviceErrorMsg);
});
}
else
{
ackMessageBox.warning($translate.instant('PleaseSetAssetGroupInfo'));
}
};
//关闭弹出框
$scope.cancelAsset = function () {
if ($scope.modalInstance) {
$scope.modalInstance.close();
}
};
//是否显示星号
$scope.isNeedMappingColumn = function (col) {
if ($scope.mustMappingTotalColumns.indexOf(col) > -1) {
return true;
}
else {
return false;
}
}
//验证信息数据源
$scope.gridOptionsErrorMsg = {
rowHeight: constant.UIGrid.rowHeight,
selectionRowHeaderWidth: constant.UIGrid.selectionRowHeaderWidth,
enableSorting: false,
enableColumnMenus: false,
enableHorizontalScrollbar: uiGridConstants.scrollbars.enableHorizontalScrollbar,
enableVerticalScrollbar: uiGridConstants.scrollbars.enableVerticalScrollbar,
columnDefs: [
{
name: $translate.instant('Icon'), width: '5%', cellTemplate: '<div class="ui-grid-cell-contents"><span><img data-ng-src="{{grid.appScope.errorLevelToString(row.entity.errorLevel)}}"><span></div>'
},
{
name: $translate.instant('SequenceNo'), width: '5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.index}}<span></div>'
},
{
name: $translate.instant('ErrorResult'), width: '20%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.validationResult}}<span></div>'
},
{
name: $translate.instant('ErrorCount'), width: '10%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.number}}<span></div>'
},
{
name: $translate.instant('ErrorDetail'), width: '35%', cellTemplate: dealDetail,
},
{
name: $translate.instant('ValidationTips'), width: '25%', cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.validationTips}}"><span>{{row.entity.validationTips}}<span></div>'
},
],
onRegisterApi: function (gridApi) {
$scope.errorGridApi = gridApi;
$interval(function () {
$scope.errorGridApi.core.handleWindowResize();
}, 500, 60 * 60 * 8);
}
};
//控制明细信息中删除权限
var getUserPermission = function () {
var list = [];
$scope.editCode = constant.citPermission.dataImport.assetList.importCode;
list.push($scope.editCode);
$scope.hasEditPermission = false;
$scope.$root.checkUserOrganizationPermissionList(list).success(function (data) {
$scope.hasEditPermission = data[$scope.editCode];
//$scope.dataGridInstance.option("editing.allowUpdating", $scope.hasEditPermission);
//$scope.dataGridInstance.refresh();
//$scope.assetGroupGridInstance.option("editing.allowUpdating", $scope.hasEditPermission);
//$scope.assetGroupGridInstance.refresh();
});
};
//开始
(function initialize() {
$log.debug('ImportOutputInvoiceController.ctor()...');
/**************************************** function start*************************************************/
$scope.displayType = 2;
$scope.saveGroupType = 1;
$scope.isDisabled = false;
$scope.selectedColumnMap = [];
$scope.incomeInvoiceTotalColumns = [];
$scope.initIncomeInvoiceTotalColumnsIndex = [];
$scope.changeSheet = changeSheet;
$scope.mappingColumn = mappingColumn;
$scope.importData = importData;
initColumns();
initDxGrid();
initAssetResultDxGrid();
getAssetResultList(1);
// initDataFromDB();
getGroupList();
getGroupDetailList();
getUserPermission();
// $scope.$watch('fileNameWrapper', function (newValue, oldValue) {
// if (newValue != null && newValue !== oldValue) {
// //设置上传文件名
// var arr = newValue.name.split('.');
// if (arr[arr.length - 1] !== 'xls' && arr[arr.length - 1] !== 'xlsx' && arr[arr.length - 1] !== 'xlsm') {
// SweetAlert.warning($translate.instant('ImportFileInvalidType'));
// return;
// }
// $scope.fileName = newValue.name;
// uploadfile($scope.fileNameWrapper);
// $scope.ImportErrorTab = false;
// $scope.ImportErrorTag = false;
// $('#StartRowNum').val('2');
// }
// });
$timeout(function () {
if ($scope.dataGridInstance)
{
$scope.dataGridInstance.option("editing.allowUpdating", $scope.hasEditPermission);
$scope.dataGridInstance.refresh();
}
}, 1000);
})();
}
]);
\ No newline at end of file
<div class="cit-import-asset-list">
<div class="nav-wrapper">
<div class="nav-header">{{'AssetList' | translate}}</div>
<div class="nav-tab">
<!-- <span ng-click="switchTab($event,1)">{{'AssetListImport' | translate}}</span>&nbsp;&nbsp;-->
<span class="active" ng-click="switchTab($event,2)">{{'FixedAssets' | translate}}</span><span
ng-click="switchTab($event,3)">{{'LongTermPrepaid' | translate}}</span><span
ng-click="switchTab($event,4)">{{'InvisibleAssets' | translate}}</span>
</div>
</div>
<!--导入界面-->
<div id="tab_total" ng-show="displayType == 1">
<div class="alert alert-warning" ng-show="ImportErrorTab" ng-click="toggleErrorTab()">
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>{{errorMsg}}
</div>
<div class="pull-right operation-wrapper">
<button class="btn btn-vat-primary" translate="AssetClassification" ng-click="setAssetsGroup()"></button>
</div>
<form class="form-inline">
<!--<div class="form-group" ng-style="setButtonWrapStyle()">-->
<!--<div class="import-wrapper">-->
<!--<button type="button" ng-show="hasEditPermission" -->
<!--ngf-select="" ng-model="fileNameWrapper" ngf-drag-over-class="'dragover'" accept=".xls,.xlsx,.xlsm"-->
<!--ngf-multiple="false" ngf-allow-dir="false" class="btn btn-vat-third" style="margin-right:10px">-->
<!--{{'SelectFile' | translate}}-->
<!--</button>-->
<!--<div class="import-info-wrapper" ng-show="fileName">-->
<!--<span title="{{fileName}}">{{'FileName' | translate}}{{fileName | limitString:10}}</span>&nbsp;&nbsp;&nbsp;&nbsp;|-->
<!--<span translate="WorkSheet"></span>-->
<!--<div class="ui-select-no-border">-->
<!--<ui-select ng-model="sheetInfo.selectedSheetName" on-select="changeSheet($item)" search-enabled="false" style="width:120px;">-->
<!--<ui-select-match placeholder="{{'SelectASheet' | translate}}">{{$select.selected.name}}</ui-select-match>-->
<!--<ui-select-choices repeat="sheetName in sheetData.sheetNameList | propsFilter: {name: $select.search}">-->
<!--<div title="{{sheetName.name}}" ng-bind-html="sheetName.name | limitString:9"></div>-->
<!--</ui-select-choices>-->
<!--</ui-select>-->
<!--</div>-->
<!--&nbsp;&nbsp;&nbsp;&nbsp;|-->
<!--<span translate="StartRowNum"></span>-->
<!--<input id="StartRowNum" ng-model="StartRowNum" type="text"-->
<!--onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"-->
<!--onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" />-->
<!--</div>-->
<!--<button class="btn btn-vat-primary" style="float:right; margin-right: 10px;" ng-if="isShowImportTotalBtn && hasEditPermission" translate="ImportBtn" ng-click="importData(importEnum.Import)"></button>-->
<!--<div class="btn-wrapper" ng-if="!isShowImportTotalBtn && hasEditPermission">-->
<!--<button class="btn btn-vat-primary" translate="ConverImportBtn" ng-click="importData(importEnum.CoverImport)"></button>|<button class="btn btn-vat-primary" translate="AddImportBtn" ng-click="importData(importEnum.AddImport)"></button>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<div class="form-group">
<div class="col-sm-5">
<input class="form-control" type="text" name="fileName"
value="{{file ? file.name : '' | limitString :25}}" readonly placeholder="" required>
</div>
<div class="col-sm-4">
<button type="button" type="file" ngf-select ng-model="file" accept=".xls,.xlsx"
class="btn btn-secondary browse">{{'SelectFile' | translate}}
</button>
</div>
<div class="col-sm-3">
<button class="btn btn-vat-primary" style="height: 34px" translate="ImportBtn"
ng-click="importDataNew()"></button>
</div>
</div>
<!--分页栏-->
<!--<div class="form-group page-form-group" ng-show="!showImportTable">-->
<!--<div class="page-footer">-->
<!--<ack-pagination page-options="pagingOptions" refresh-table="pagingService.refreshInvoiceDataGrid()" hide-page-size-selector="true"></ack-pagination>-->
<!--</div>-->
<!--</div>-->
</form>
<!--导入数据界面-->
<div class="dt-import-wrapper" ng-if="showImportTable">
<div class="import-table-cont" style="padding-top:40px;">
<table class="import-table">
<thead>
<tr style="height:30px;">
<th>&nbsp;</th>
<th ng-repeat="m in sheetData.dataList[0] track by $index">{{$index + 1}}</th>
</tr>
<tr style="height:30px;">
<th>&nbsp;</th>
<th ng-repeat="i in sheetData.dataList[0] track by $index">
<div class="dropdown">
<button class="btn dropdown-toggle select-button" data-toggle="dropdown">
<span class="pull-left" ng-if="selectedColumnMap[$index]">{{selectedColumnMap[$index]}}</span>
<span class="pull-left" ng-if="!selectedColumnMap[$index]"
translate="PleaseSelectColumn"></span>
<i class="fa fa-chevron-circle-down" aria-hidden="true"></i>
</button>
<ul class="dropdown-menu">
<li ng-repeat="col in incomeInvoiceTotalColumns track by $index"
ng-click="mappingColumn($parent.$index,$index,col)">
<i class="fa fa-star" aria-hidden="true" ng-show="isNeedMappingColumn(col)"></i>
{{col}}
</li>
</ul>
</div>
</th>
</tr>
</thead>
<tbody style="margin-top:40px;">
<tr ng-repeat="thisrows in invoiceData track by $index" ng-class-even="'row-even'"
ng-class-odd="'row-odd'">
<td style="text-align: center; width: 30px;">{{$index+1}}</td>
<td ng-repeat="cells in thisrows track by $index">
{{ cells }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--初始化数据界面-->
<div class="dt-init-wrapper" ng-if="showInitTable">
<div class="total-Wrapper">
<span>{{'TotalNumber' | translate}}<span class="total_span">{{ImportTotalCount}}</span> {{'RecordCount' | translate}}</span>
<span style="margin-left:15px;">{{'TotalAccountAcquisitionValue' | translate}}<span class="total_span">{{ImportTotalAccountAcquisitionValue}}</span> {{'Yuan' | translate}}</span>
<span style="margin-left:15px;">{{'TotalAccountYearDepreciationAmount' | translate}}<span
class="total_span">{{ImportTotalAccountYearDepreciationAmount}}</span> {{'Yuan' | translate}}</span>
</div>
<div id="gridInitData" dx-data-grid="gridInitDataOption"></div>
</div>
<!--后台错误信息界面-->
<div class="error-info-wrapper" id="error-info-wrapper" ng-show="showErrorTable">
<div ui-grid="gridOptionsErrorMsg" style="width:100%;" ng-style="getErrorGridHeight()"></div>
</div>
<div>
<div ng-show="showErrorTable" id="content-resizer"
resizer="horizontal"
resizer-height="6"
bottom-min="0"
bottom-max="400"
resizer-top="#balance-ouput-grid-wrapper"
resizer-bottom="#error-info-wrapper">
<div id="topIcon" ng-click="toggleErrorTab()">
<img src="../../../../app-resources/images/collapse.png"/>
</div>
</div>
</div>
</div>
<!--计算结果显示界面-->
<div id="tab_Assets" ng-if="displayType >1">
<!--税会差异的选择-->
<div class="option">
<span>{{'TaxAccountDifference' | translate}}</span>
<div id="taxAccountDifferenceButton" dx-select-box="taxAccountDifferenceOptions"></div>
</div>
<!--计算结果-->
<div class="total-Wrapper">
<span>{{'TotalNumber' | translate}}<span class="total_span">{{TotalCount}}</span> {{'RecordCount' | translate}}</span>
<span style="margin-left:15px;">{{'TotalAccountAcquisitionValue' | translate}}<span class="total_span">{{TotalAccountAcquisitionValue}}</span> {{'Yuan' | translate}}</span>
<span style="margin-left:15px;">{{'TotalAccountYearDepreciationAmount' | translate}}<span
class="total_span">{{TotalAccountYearDepreciationAmount}}</span> {{'Yuan' | translate}}</span>
<span style="margin-left:15px;">{{'TotalTaxCurrentYearDepreciationAmount' | translate}}<span
class="total_span">{{TotalTaxCurrentYearDepreciationAmount}}</span> {{'Yuan' | translate}}</span>
<span style="margin-left:15px;">{{'TotalYearDifferenceAmount' | translate}}<span class="total_span">{{TotalYearDifferenceAmount}}</span> {{'Yuan' | translate}}</span>
</div>
<!--资产清单结果集-->
<div class="dt-asset-result">
<!--<asset-list-edit-modal asset-type="displayType-1" type="0"></asset-list-edit-modal>-->
<div id="assetsResultGrid" dx-data-grid="assetsResultGridOptions"></div>
</div>
</div>
<!--本年与上年数据差异界面-->
<script type="text/ng-template" id="set-asset-validate-modal.html">
<div class="modal-content" style="width:832px;">
<div class="modal-header">
<div class="modal-title">
{{'AssetDiffData' | translate}}
</div>
</div>
<div class="modal-body" style="margin:15px;padding:initial;">
<div style="border: 1px solid #959595;height:450px; border-radius: 3px;width:800px;"
dx-data-grid=" gridPeriodOptions"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-third" ng-click="cancelValidateAsset()">{{'ButtonCancel' |
translate }}
</button>
</div>
</div>
</script>
<!--前台错误信息界面-->
<div class="error-list-modal">
<div class="modal fade" id="errorListModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 720px; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'ImportErrorPopUpTitle' | translate}}
</div>
</div>
<div class="modal-body">
{{'ImportErrorPopUpErrorDetail' | translate}}:
<br/>
<table>
<thead>
<tr>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpNoCol' | translate}}</th>
<th width="20%">{{'ImportErrorPopUpErrorTypeCol' | translate}}</th>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpErrorCountCol' |
translate}}
</th>
<th width="60%">{{'ImportErrorPopUpErrorDescCol' | translate}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="error in errorMsgMap track by $index">
<td width="10%" style="text-align:center;">{{$index + 1}}</td>
<td width="20%">{{error.errorType}}</td>
<td width="10%" style="text-align:center;">{{error.errorCount}}</td>
<td width="60%" ng-bind-html="error.errorContent"></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="Confirm" data-dismiss="modal"></button>
</div>
</div>
</div>
</div>
</div>
<!--资产分类设置界面-->
<script type="text/ng-template" id="set-asset-group-modal.html">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'SetAssetGroup' | translate}}
</div>
</div>
<div class="modal-body">
<div class="grid-container">
<div id="assetsGroupGrid" dx-data-grid="assetsGridOptions"
style="max-width: 760px; margin-top: -40px;">
</div>
</div>
</div>
<div class="modal-footer">
<button style="margin-left: 22px;" type="button" class="btn btn-primary" ng-click="saveAssetGroupInfo()"
ng-disabled="!hasEditPermission">{{'Confirm' | translate }}
</button>
<button type="button" class="btn btn-third" ng-click="cancelAsset()" ng-if="!isDisabled"
ng-disabled="isDisabled">{{'ButtonCancel' | translate }}
</button>
</div>
</div>
</script>
<vat-operate-log period="period" module-type="moduleid" is-show="isShowLog"></vat-operate-log>
</div>
\ No newline at end of file
citModule.directive('citPreviewAssetList', ['$log', '$translate',
function ($log, $translate) {
'use strict';
$log.debug('citPreviewAssetList.ctor()...');
return {
restrict: 'E',
templateUrl: '/app/cit/preview/cit-preview-asset-list/cit-preview-asset-list.html' + '?_=' + Math.random(),
scope: {},
controller: 'CitPreviewAssetListController',
link: function (scope, element) {
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
.cit-import-asset-list {
padding-left: 20px;
height: 96%;
.sweet-alert {
background-color: #eeeeee;
}
.nav-wrapper {
padding-bottom: 10px;
border-bottom: 1px solid #DBD8D3;
.nav-header {
height: 54px;
line-height: 54px;
font-family: "Microsoft YaHei Bold", "Microsoft YaHei Regular", "Microsoft YaHei";
font-weight: 700;
font-style: normal;
font-size: 15px;
color: #333;
}
.nav-tab {
/*display: inline-block;*/
span {
display: inline-block;
height: 34px;
width: 80px;
text-align: center;
line-height: 34px;
padding: 0 10px;
background-color: #B90808;
color: #FFF;
font-family: "Microsoft YaHei";
font-weight: 400;
font-style: normal;
font-size: 14px;
cursor: pointer;
}
.active {
background-color: #F91000;
}
}
}
.alert-warning {
background-color: #FDE2DE;
cursor: pointer;
}
.alert {
color: #CF2D1B;
font-weight: bold;
display: inline-block;
padding: 5px;
float: left;
margin: -45px 0 0 350px;
i {
font-size: 20px;
vertical-align: middle;
margin-right: 5px;
}
}
.dropdown-common() {
display: inline-block;
.select-button {
background-color: #F5F5F5;
padding: 6px 0;
width: 110px;
}
.caret {
margin-top: 8px;
}
.dropdown-menu {
min-width: 140px;
max-height: 400px;
overflow-y: scroll;
li {
text-align: left;
min-height: 0px;
height: 30px;
color: #000;
font-weight: normal;
&:hover {
background-color: #F91000;
color: #FFF;
cursor: pointer;
}
i {
float: right;
font-size: 15px;
}
}
}
}
#tab_total {
display: block;
height: calc(~'100% - 80px');
position: relative;
.operation-wrapper {
margin: -40px 15px 0 0;
span {
cursor: pointer;
}
}
.import-wrapper {
margin-top: 10px;
span {
margin-left: 10px;
color: #333;
font-family: "Microsoft YaHei";
font-style: normal;
font-size: 14px;
font-weight: bold;
}
.dropdown {
.dropdown-common();
}
input {
width: 50px;
outline: none;
border-radius: 3px;
border: 1px solid #3c3a36;
padding: 2px;
text-align: center;
}
> button:last-child {
float: right;
margin-right: 20px;
}
.btn-wrapper {
border-radius: 5px;
background-color: #e0301e;
color: #FFF;
display: inline-block;
float: right;
margin-right: 10px;
.btn-vat-primary {
min-width: 80px;
}
}
.import-info-wrapper {
display: inline-block;
}
}
.dt-init-wrapper {
margin: 10px 0;
max-width: 99%;
height: calc(~'100% - 80px');
position: relative;
z-index: 1;
.dropdown {
.dropdown-common();
i {
color: #F85550;
}
}
.total-Wrapper {
width: 99%;
margin-left: 0px;
font-size: 13px;
font-family: 'Microsoft YaHei';
padding-bottom: 5px;
.total_span {
color: #B4122A !important;
background-color: #ddd !important;
font-size: 12px !important;
font-weight: bold !important;
border-radius: 10px !important;
padding-left: 8px !important;
padding-right: 8px !important;
}
}
/*.balance-ouput-grid-wrapper {
height: calc(~'100% - -10px');
overflow: hidden;
position: absolute;
top: 0;
bottom: 150px;
left: 0;
right: 0;
background-color: #FFF;
}*/
}
.dt-import-wrapper {
margin: 10px 0;
max-width: 99%;
overflow: auto;
height: calc(~"100% - 70px");
.dropdown {
.dropdown-common();
i {
color: #F85550;
}
button {
color: #333;
}
}
}
.error-info-wrapper {
position: absolute;
height: 150px;
bottom: 0;
left: 0;
right: 0;
overflow: hidden;
background-color: #FFF;
margin-left: -39px;
z-index: 2;
}
#content-resizer {
width: 110%;
position: absolute;
height: 4px;
bottom: 150px;
left: 0;
right: 0;
background-color: red;
cursor: n-resize;
margin-left: -39px;
#topIcon {
cursor: pointer;
margin-top: -19px;
width: 38px;
margin-left: 46%;
z-index: 999;
bottom: -200px;
text-align: center;
display: block !important;
}
}
}
#tab_Assets {
display: block;
height: calc(~'100% - 80px');
position: relative;
.total-Wrapper {
width: 72%;
margin-left: 0px;
font-size: 13px;
font-family: 'Microsoft YaHei';
padding-top: 5px;
position: absolute;
z-index: 9;
.total_span {
color: #B4122A !important;
background-color: #ddd !important;
font-size: 12px !important;
font-weight: bold !important;
border-radius: 10px !important;
padding-left: 8px !important;
padding-right: 8px !important;
}
}
.dt-asset-result {
margin: 0px 0;
max-width: 99%;
height: calc(~'100% - 20px');
position: relative;
margin-top: 10px;
.herder-center {
text-align: center !important;
vertical-align: middle !important;
/*font-size:13px !important;*/
}
}
}
.error-list-modal {
.modal-title {
color: #FF0000;
}
.modal-body {
max-height: 300px;
overflow-y: auto;
table {
border: 1px solid #CCC;
thead tr th {
height: 30px;
border: 1px solid #CCC;
}
tbody tr td {
height: 25px;
border: 1px solid #CCC;
}
}
}
.modal-footer {
text-align: center;
}
}
.page-form-group {
float: right;
margin-top: 10px;
.page-size {
margin: 0;
}
.pagination {
margin: 0;
}
}
#gridInitData {
border-radius: 3px;
border: 1px solid #d4d4d4;
}
}
.set-asset-list-modal .modal-dialog {
height: 500px;
width: 800px;
.modal-content {
height: 100%;
width: 100%;
}
.modal-title {
color: #333;
font-size: 16px;
font-weight: bold;
}
.modal-body {
height: 76%;
max-width: 760px !important;
margin-left: 22px;
overflow-y: auto;
.herder-center {
text-align: center !important;
}
.column-color {
color: red !important;
}
}
.modal-footer {
text-align:left;
}
}
citModule.controller('citReportLayoutController', ['$scope', '$log', '$q', '$timeout', '$compile', 'loginContext', citModule.controller('citReportLayoutController', ['$scope', '$log', '$q', '$timeout', '$compile', 'loginContext',
'$translate', '$location', 'vatSessionService', 'vatReportService', '$state', 'enums', 'checkListService', '$translate', '$location', 'vatSessionService', 'vatReportService', '$state', 'enums', /*'checkListService',*/
function ($scope, $log, $q, $timeout, $compile, loginContext, $translate, $location, vatSessionService, function ($scope, $log, $q, $timeout, $compile, loginContext, $translate, $location, vatSessionService,
vatReportService, $state, enums, checkListService) { vatReportService, $state, enums/*, checkListService*/) {
'use strict'; 'use strict';
$log.debug('citReportLayoutController.ctor()...'); $log.debug('citReportLayoutController.ctor()...');
$scope.$on('refreshCitGenerateReport', function (event, data) { $scope.$on('refreshCitGenerateReport', function (event, data) {
loadTemplateMenu(); loadTemplateMenu();
$scope.isFirstMenu = false; $scope.isFirstMenu = false;
...@@ -28,7 +27,6 @@ ...@@ -28,7 +27,6 @@
returnUrl = true; returnUrl = true;
} }
return returnUrl; return returnUrl;
}; };
var gvalue = 1; var gvalue = 1;
...@@ -53,7 +51,6 @@ ...@@ -53,7 +51,6 @@
event.preventDefault(); event.preventDefault();
} }
} }
_.each($scope.menuTreeDataSource, function (item) { _.each($scope.menuTreeDataSource, function (item) {
item.selected = false; item.selected = false;
}); });
...@@ -237,16 +234,17 @@ ...@@ -237,16 +234,17 @@
$scope.checkListModal.modalTitel = $translate.instant(cfg.titel); $scope.checkListModal.modalTitel = $translate.instant(cfg.titel);
var apiFun = checkListService.getCheckListViewData; /*var apiFun = checkListService.getCheckListViewData;
apiFun(vatSessionService.project.serviceTypeID, cfg.reportType, 0).then(function (response) { apiFun(vatSessionService.project.serviceTypeID, cfg.reportType, 0).then(function (response) {
var rst = response.data; var rst = response.data;
$scope.checkListModal.isOpen = rst.result; $scope.checkListModal.isOpen = rst.result;
$scope.checkListModal.dataSource = rst.result ? rst.data : []; $scope.checkListModal.dataSource = rst.result ? rst.data : [];
}); });*/
} }
}; };
var loadTemplateMenu = function () { var loadTemplateMenu = function () {
debugger;
var projectID = vatSessionService.project.id; var projectID = vatSessionService.project.id;
vatReportService.citGetTemplateTree(projectID).success(function (data) { vatReportService.citGetTemplateTree(projectID).success(function (data) {
if (!data || !data.data) { if (!data || !data.data) {
...@@ -418,6 +416,7 @@ ...@@ -418,6 +416,7 @@
id.selected = true; id.selected = true;
} }
} }
debugger;
$scope.menuTreeDataSource = data; $scope.menuTreeDataSource = data;
}); });
...@@ -439,6 +438,7 @@ ...@@ -439,6 +438,7 @@
//检查用户机构权限 //检查用户机构权限
var getUserPermission = function () { var getUserPermission = function () {
debugger;
var list = []; var list = [];
var reportTemp = constant.citPermission.reportView; var reportTemp = constant.citPermission.reportView;
//bspl //bspl
......
...@@ -3,39 +3,30 @@ webservices.factory('assetListService', ['$http', 'apiConfig', function ($http, ...@@ -3,39 +3,30 @@ webservices.factory('assetListService', ['$http', 'apiConfig', function ($http,
'use strict'; 'use strict';
return { return {
getAssetListData: function () { getAssetListData: function () {
debugger;
return $http.get('/asset/getAssetListData', apiConfig.create()); return $http.get('/asset/getAssetListData', apiConfig.create());
}, },
getAssetResultList: function (assetType,projectId, taxAccountCompare) { getAssetResultList: function (assetType,projectId, taxAccountCompare) {
debugger;
return $http.get('/asset/getAssetResultList?assetType=' + assetType + '&projectId=' + projectId + '&taxAccountCompare=' + taxAccountCompare, apiConfig.create()); return $http.get('/asset/getAssetResultList?assetType=' + assetType + '&projectId=' + projectId + '&taxAccountCompare=' + taxAccountCompare, apiConfig.create());
}, },
getAssetGroupResultData: function (projectId) { getAssetGroupResultData: function (projectId) {
debugger;
return $http.get('/asset/getAssetGroupResultData?projectId=' + projectId, apiConfig.create()); return $http.get('/asset/getAssetGroupResultData?projectId=' + projectId, apiConfig.create());
}, },
getAssetGroupListData: function () { getAssetGroupListData: function () {
debugger;
return $http.get('/asset/getAssetGroupListData', apiConfig.create()); return $http.get('/asset/getAssetGroupListData', apiConfig.create());
}, },
getAssetDetailGroupListData: function () { getAssetDetailGroupListData: function () {
debugger;
return $http.get('/asset/getAssetDetailGroupListData', apiConfig.create()); return $http.get('/asset/getAssetDetailGroupListData', apiConfig.create());
}, },
saveAssetGroupInfo:function (assetGroupResults,saveGroupType,projectId) { saveAssetGroupInfo:function (assetGroupResults,saveGroupType,projectId) {
debugger;
return $http.post('/asset/saveAssetGroupInfo?saveGroupType=' + saveGroupType + '&projectId=' + projectId,assetGroupResults, apiConfig.create()); return $http.post('/asset/saveAssetGroupInfo?saveGroupType=' + saveGroupType + '&projectId=' + projectId,assetGroupResults, apiConfig.create());
}, },
updateAssetResultList:function (assetsList,projectId) { updateAssetResultList:function (assetsList,projectId) {
debugger;
return $http.post('/asset/updateAssetResultList?projectId=' + projectId,assetsList, apiConfig.create()); return $http.post('/asset/updateAssetResultList?projectId=' + projectId,assetsList, apiConfig.create());
}, },
batchUpdateIsRetain:function (assetType,projectId, isRetain) { batchUpdateIsRetain:function (assetType,projectId, isRetain) {
debugger;
return $http.post('/asset/batchUpdateIsRetain?assetType=' + assetType + '&projectId=' + projectId + '&isRetain=' + isRetain, apiConfig.create()); return $http.post('/asset/batchUpdateIsRetain?assetType=' + assetType + '&projectId=' + projectId + '&isRetain=' + isRetain, apiConfig.create());
}, },
getAllFixedAssetDetailGroup: function (assetGroupType,pageIndex,pageSize) { getAllFixedAssetDetailGroup: function (assetGroupType,pageIndex,pageSize) {
debugger;
return $http.post('/asset/getFixedAssetDetailGroup',{"assetGroupType":assetGroupType,"pageIndex":pageIndex,"pageSize":pageSize}, apiConfig.create()); return $http.post('/asset/getFixedAssetDetailGroup',{"assetGroupType":assetGroupType,"pageIndex":pageIndex,"pageSize":pageSize}, apiConfig.create());
} }
}; };
......
// web service proxy for role
webservices.factory('citPreviewDataService', ['$http', 'apiConfig', function ($http, apiConfig) {
'use strict';
return {
//获取 预提分类数据源列表数据
getCitPreviewSalaryAdvanceDataList : function(params){
return $http.post('/citPreviewDataController/getSalaryAdvaceListData', {pageInfo: params.pagingOptions, poSubjectName : params.poSubjectName }, apiConfig.createVat());
}
};
}]);
\ No newline at end of file
...@@ -355,6 +355,14 @@ webservices.factory('commonWebService', ['$http', 'apiConfig', 'loginContext', ' ...@@ -355,6 +355,14 @@ webservices.factory('commonWebService', ['$http', 'apiConfig', 'loginContext', '
n = filterFunc.call(tree, match, opts); n = filterFunc.call(tree, match, opts);
} }
}).focus(); }).focus();
},
_index :function (data) {
var index = 1;
for(var i of data){
i.index = index;
index++;
}
return data;
} }
}; };
}]); }]);
\ No newline at end of file
...@@ -291,7 +291,6 @@ ...@@ -291,7 +291,6 @@
} }
function doStartCaculate2(isMergeManualDataSource) { function doStartCaculate2(isMergeManualDataSource) {
vatReportService.generateAll(vatSessionService.project.id, isMergeManualDataSource, vatSessionService.month, vatSessionService.logUser.id ? vatSessionService.logUser.id : "").success(function (data) { vatReportService.generateAll(vatSessionService.project.id, isMergeManualDataSource, vatSessionService.month, vatSessionService.logUser.id ? vatSessionService.logUser.id : "").success(function (data) {
$scope.readonly = true; $scope.readonly = true;
if(data && data.result) if(data && data.result)
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<span class="rect2"></span> <span class="rect2"></span>
<span class="rect3"></span> <span class="rect3"></span>
<span class="rect4"></span> <span class="rect4"></span>
<span class="rect5"></span> <spanmoduleType class="rect5"></spanmoduleType>
<!--<img src="/app-resources/images/loading.gif" alt="loading...">--> <!--<img src="/app-resources/images/loading.gif" alt="loading...">-->
</span> </span>
<span ng-if="task.status == 'error'" style="color:red;">{{task.text}}</span> <span ng-if="task.status == 'error'" style="color:red;">{{task.text}}</span>
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
if (!$scope.hasBsPermission) { if (!$scope.hasBsPermission) {
grps.children = _.reject(grps[0].children, {name: '资产负债表'}); grps.children = _.reject(grps[0].children, {name: '资产负债表'});
} }
if (!$scope.hasPlPermission) { if (!$scope.hasPlPermission) {
grps.children = _.reject(grps[0].children, {name: '利润表'}); grps.children = _.reject(grps[0].children, {name: '利润表'});
} }
......
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