Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
c9e60f8f
Commit
c9e60f8f
authored
May 28, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed report display issue
parent
ed7a17d0
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
550 additions
and
545 deletions
+550
-545
CellTemplateController.java
...a/pwc/taxtech/atms/controller/CellTemplateController.java
+25
-6
CellTemplateService.java
...in/java/pwc/taxtech/atms/service/CellTemplateService.java
+4
-1
CellConfigTranslater.java
...a/pwc/taxtech/atms/service/impl/CellConfigTranslater.java
+6
-6
CellTemplateServiceImpl.java
...wc/taxtech/atms/service/impl/CellTemplateServiceImpl.java
+44
-3
declaration-form-configuration.ctrl.js
...nFormConfiguration/declaration-form-configuration.ctrl.js
+119
-119
declaration-form-configuration.html
...tionFormConfiguration/declaration-form-configuration.html
+188
-174
spread-js-tip.svc.js
.../src/main/webapp/app/common/services/spread-js-tip.svc.js
+14
-14
spreadjs.svc.js
...eb/src/main/webapp/app/common/webservices/spreadjs.svc.js
+11
-11
template.svc.js
...eb/src/main/webapp/app/common/webservices/template.svc.js
+23
-95
common.js
atms-web/src/main/webapp/bundles/common.js
+0
-0
systemConfiguration.js
atms-web/src/main/webapp/bundles/systemConfiguration.js
+116
-116
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/CellTemplateController.java
View file @
c9e60f8f
...
...
@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
pwc.taxtech.atms.dto.CellTemplateConfigDto
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.service.CellTemplateService
;
import
java.util.Collections
;
...
...
@@ -21,17 +22,35 @@ public class CellTemplateController {
@RequestMapping
(
value
=
"configList/{templateID}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
@ResponseBody
List
<
CellTemplateConfigDto
>
GetConfigList
(
@PathVariable
String
templateID
)
{
if
(
StringUtils
.
isEmpty
(
templateID
)){
return
Collections
.
emptyList
();
OperationResultDto
<
List
<
CellTemplateConfigDto
>>
GetConfigList
(
@PathVariable
String
templateID
)
{
OperationResultDto
<
List
<
CellTemplateConfigDto
>>
result
=
new
OperationResultDto
<>();
if
(
StringUtils
.
isEmpty
(
templateID
))
{
result
.
setData
(
Collections
.
emptyList
());
}
try
{
return
cellTemplateService
.
getCellConfigList
(
templateID
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"CellTemplateController.GetCellConfigList"
,
e
);
}
return
result
;
}
@RequestMapping
(
value
=
"config/{cellTemplateID}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
@ResponseBody
OperationResultDto
<
CellTemplateConfigDto
>
GetConfig
(
@PathVariable
String
cellTemplateID
)
{
if
(
StringUtils
.
isEmpty
(
cellTemplateID
))
{
return
new
OperationResultDto
<>();
}
try
{
return
cellTemplateService
.
GetCellConfigList
(
t
emplateID
);
return
cellTemplateService
.
getCellConfig
(
cellT
emplateID
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"
GetCellConfigList"
,
e
);
logger
.
error
(
"
CellTemplateController.GetConfig"
,
e
);
}
return
Collections
.
emptyList
();
return
new
OperationResultDto
<>
();
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/CellTemplateService.java
View file @
c9e60f8f
package
pwc
.
taxtech
.
atms
.
service
;
import
pwc.taxtech.atms.dto.CellTemplateConfigDto
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
java.util.List
;
public
interface
CellTemplateService
{
List
<
CellTemplateConfigDto
>
GetCellConfigList
(
String
templateID
);
OperationResultDto
<
List
<
CellTemplateConfigDto
>>
getCellConfigList
(
String
templateID
);
OperationResultDto
<
CellTemplateConfigDto
>
getCellConfig
(
String
cellTemplateID
);
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/CellConfigTranslater.java
View file @
c9e60f8f
...
...
@@ -43,7 +43,7 @@ public final class CellConfigTranslater {
cellTemplateConfigDto
.
setFormulaDescription
(
description
);
Optional
<
CellTemplateConfig
>
formulaItem
=
configList
.
stream
().
filter
(
a
->
a
.
getDataSourceType
().
equals
(
CellDataSourceType
.
valueOf
(
"Formula"
))).
findFirst
();
if
(
formulaItem
!=
null
)
{
if
(
formulaItem
.
isPresent
()
)
{
cellTemplateConfigDto
.
setHasFormula
(
true
);
cellTemplateConfigDto
.
setFormula
(
formulaItem
.
get
().
getFormula
());
if
(
StringUtils
.
isEmpty
(
cellTemplateConfigDto
.
getFormulaDescription
())
...
...
@@ -55,7 +55,7 @@ public final class CellConfigTranslater {
}
Optional
<
CellTemplateConfig
>
voucherItem
=
configList
.
stream
().
filter
(
x
->
x
.
getDataSourceType
().
equals
(
CellDataSourceType
.
valueOf
(
"Voucher"
))).
findFirst
();
if
(
voucherItem
!=
null
)
{
if
(
voucherItem
.
isPresent
()
)
{
cellTemplateConfigDto
.
setHasVoucher
(
true
);
cellTemplateConfigDto
.
setVoucherKeyword
(
voucherItem
.
get
().
getVoucherKeyword
()
==
null
?
""
:
voucherItem
.
get
().
getVoucherKeyword
());
if
(!
StringUtils
.
isEmpty
(
voucherItem
.
get
().
getAccountCodes
()))
{
...
...
@@ -64,7 +64,7 @@ public final class CellConfigTranslater {
}
Optional
<
CellTemplateConfig
>
invoiceItem
=
configList
.
stream
().
filter
(
x
->
x
.
getDataSourceType
().
equals
(
CellDataSourceType
.
valueOf
(
"OutputInvoice"
))
||
x
.
getDataSourceType
().
equals
(
CellDataSourceType
.
valueOf
(
"InputInvoice"
))
||
x
.
getDataSourceType
().
equals
(
CellDataSourceType
.
valueOf
(
"CustomInvoice"
))).
findFirst
();
if
(
invoiceItem
!=
null
)
{
if
(
invoiceItem
.
isPresent
()
)
{
cellTemplateConfigDto
.
setHasInvoice
(
true
);
cellTemplateConfigDto
.
setInvoiceType
(
invoiceItem
.
get
().
getInvoiceType
());
cellTemplateConfigDto
.
setInvoiceAmountType
(
invoiceItem
.
get
().
getInvoiceAmountType
());
...
...
@@ -85,18 +85,18 @@ public final class CellConfigTranslater {
}
Optional
<
CellTemplateConfig
>
keyInItem
=
configList
.
stream
().
filter
(
x
->
x
.
getDataSourceType
().
equals
(
CellDataSourceType
.
valueOf
(
"KeyIn"
))).
findFirst
();
if
(
keyInItem
!=
null
)
{
if
(
keyInItem
.
isPresent
()
)
{
cellTemplateConfigDto
.
setHasKeyIn
(
true
);
}
Optional
<
CellTemplateConfig
>
modelItem
=
configList
.
stream
().
filter
(
x
->
x
.
getDataSourceType
().
equals
(
CellDataSourceType
.
valueOf
(
"RelatedModel"
))).
findFirst
();
if
(
modelItem
!=
null
)
{
if
(
modelItem
.
isPresent
()
)
{
cellTemplateConfigDto
.
setHasModel
(
true
);
cellTemplateConfigDto
.
setModelIDs
(
GetList
(
modelItem
.
get
().
getModelIDs
()));
}
Optional
<
CellTemplateConfig
>
validationItem
=
configList
.
stream
().
filter
(
x
->
x
.
getDataSourceType
().
equals
(
CellDataSourceType
.
valueOf
(
"Validation"
))).
findFirst
();
if
(
validationItem
!=
null
)
{
if
(
validationItem
.
isPresent
()
)
{
cellTemplateConfigDto
.
setHasValidation
(
true
);
cellTemplateConfigDto
.
setValidation
(
validationItem
.
get
().
getValidation
());
cellTemplateConfigDto
.
setValidationDescription
(
validationItem
.
get
().
getValidationDescription
());
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/CellTemplateServiceImpl.java
View file @
c9e60f8f
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.dao.CellTemplateMapper
;
import
pwc.taxtech.atms.dto.CellTemplateConfigDto
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.entitiy.CellTemplate
;
import
pwc.taxtech.atms.entitiy.CellTemplateConfig
;
import
pwc.taxtech.atms.entitiy.CellTemplateConfigExample
;
import
pwc.taxtech.atms.entitiy.CellTemplateExample
;
import
pwc.taxtech.atms.service.CellTemplateService
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -15,19 +19,56 @@ import java.util.stream.Collectors;
public
class
CellTemplateServiceImpl
extends
AbstractService
implements
CellTemplateService
{
@Override
public
List
<
CellTemplateConfigDto
>
G
etCellConfigList
(
String
templateID
)
{
List
<
CellTemplateConfigDto
>
result
=
new
ArrayList
<>();
public
OperationResultDto
<
List
<
CellTemplateConfigDto
>>
g
etCellConfigList
(
String
templateID
)
{
OperationResultDto
<
List
<
CellTemplateConfigDto
>>
result
=
new
OperationResultDto
<>();
CellTemplateExample
example
=
new
CellTemplateExample
();
example
.
createCriteria
().
andReportTemplateIDEqualTo
(
templateID
);
List
<
CellTemplate
>
cellTemplateList
=
cellTemplateMapper
.
selectByExample
(
example
);
List
<
CellTemplateConfig
>
configList
=
cellTemplateConfigMapper
.
getCellTemplateConfigByTemplateID
(
templateID
);
if
(
cellTemplateList
.
isEmpty
())
{
result
.
setData
(
Collections
.
emptyList
());
return
result
;
}
List
<
CellTemplateConfigDto
>
rData
=
new
ArrayList
<>();
for
(
CellTemplate
x
:
cellTemplateList
)
{
r
esult
.
add
(
GetConfigDto
(
x
,
configList
.
stream
().
filter
(
a
->
a
.
getCellTemplateID
().
equalsIgnoreCase
(
x
.
getID
())).
collect
(
Collectors
.
toList
())));
r
Data
.
add
(
GetConfigDto
(
x
,
configList
.
stream
().
filter
(
a
->
a
.
getCellTemplateID
().
equalsIgnoreCase
(
x
.
getID
())).
collect
(
Collectors
.
toList
())));
}
if
(
rData
.
size
()
>
0
)
{
result
.
setResult
(
true
);
result
.
setData
(
rData
);
}
else
{
result
.
setData
(
Collections
.
emptyList
());
}
return
result
;
}
@Override
public
OperationResultDto
<
CellTemplateConfigDto
>
getCellConfig
(
String
cellTemplateID
)
{
OperationResultDto
<
CellTemplateConfigDto
>
result
=
new
OperationResultDto
<>();
CellTemplate
config
=
cellTemplateMapper
.
selectByPrimaryKey
(
cellTemplateID
);
if
(
config
.
equals
(
null
))
{
result
.
setResultMsg
(
"NoData"
);
return
result
;
}
CellTemplateConfigExample
example
=
new
CellTemplateConfigExample
();
example
.
createCriteria
().
andCellTemplateIDEqualTo
(
cellTemplateID
);
List
<
CellTemplateConfig
>
configList
=
cellTemplateConfigMapper
.
selectByExample
(
example
);
result
.
setData
(
GetConfigDto
(
config
,
configList
));
if
(
result
.
getData
().
equals
(
null
))
{
result
.
setResultMsg
(
"NoData"
);
return
result
;
}
result
.
setResult
(
true
);
return
result
;
}
...
...
atms-web/src/main/webapp/app/admin/systemConfiguration/declarationFormConfiguration/declaration-form-configuration.ctrl.js
View file @
c9e60f8f
...
...
@@ -3,7 +3,7 @@
'templateService'
,
'templateFormulaService'
,
'stdAccountService'
,
'spreadJsTipService'
,
'enums'
,
'KeyValueConfigService'
,
'modelConfigurationService'
,
'industryService'
,
'formulaService'
,
'serviceTypeService'
,
'mentioUtil'
,
'region'
,
function
(
$scope
,
$log
,
$timeout
,
$translate
,
$rootScope
,
$interval
,
$compile
,
$uibModal
,
$q
,
SweetAlert
,
templateGroupService
,
templateService
,
templateFormulaService
,
stdAccountService
,
spreadJsTipService
,
enums
,
KeyValueConfigService
,
modelConfigurationService
,
industryService
,
formulaService
,
serviceTypeService
,
mentioUtil
,
region
)
{
stdAccountService
,
spreadJsTipService
,
enums
,
KeyValueConfigService
,
modelConfigurationService
,
industryService
,
formulaService
,
serviceTypeService
,
mentioUtil
,
region
)
{
'use strict'
;
var
keyValueExp
=
/@
\S
*/g
;
...
...
@@ -23,7 +23,6 @@
};
var
serviceTypeMapping
=
{
VAT
:
$translate
.
instant
(
'VAT'
),
RPT
:
$translate
.
instant
(
'RPT'
),
...
...
@@ -425,56 +424,56 @@
categoryOptions
:
[],
rateOptions
:
[],
amountTypeOptions
:
[
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
]
},
{
type
:
'Income'
,
value
:
1
,
categoryOptions
:
_
.
chain
(
enums
.
invoiceType
).
pairs
().
map
(
function
(
it
)
{
return
{
key
:
$translate
.
instant
(
it
[
0
]),
value
:
it
[
1
],
ticked
:
false
};
return
{
key
:
$translate
.
instant
(
it
[
0
]),
value
:
it
[
1
],
ticked
:
false
};
}).
value
(),
rateOptions
:
[
{
key
:
'17%'
,
value
:
'17%'
,
ticked
:
false
},
{
key
:
'13%'
,
value
:
'13%'
,
ticked
:
false
},
{
key
:
'11%'
,
value
:
'11%'
,
ticked
:
false
},
{
key
:
'6%'
,
value
:
'6%'
,
ticked
:
false
},
{
key
:
'5%'
,
value
:
'5%'
,
ticked
:
false
},
{
key
:
'4%'
,
value
:
'4%'
,
ticked
:
false
},
{
key
:
'3%'
,
value
:
'3%'
,
ticked
:
false
},
{
key
:
'1.5%'
,
value
:
'1.5%'
,
ticked
:
false
}
{
key
:
'17%'
,
value
:
'17%'
,
ticked
:
false
},
{
key
:
'13%'
,
value
:
'13%'
,
ticked
:
false
},
{
key
:
'11%'
,
value
:
'11%'
,
ticked
:
false
},
{
key
:
'6%'
,
value
:
'6%'
,
ticked
:
false
},
{
key
:
'5%'
,
value
:
'5%'
,
ticked
:
false
},
{
key
:
'4%'
,
value
:
'4%'
,
ticked
:
false
},
{
key
:
'3%'
,
value
:
'3%'
,
ticked
:
false
},
{
key
:
'1.5%'
,
value
:
'1.5%'
,
ticked
:
false
}
],
amountTypeOptions
:
[
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
]
},
{
type
:
'Output'
,
value
:
2
,
categoryOptions
:
_
.
chain
(
enums
.
outputInvoiceType
).
pairs
().
map
(
function
(
it
)
{
return
{
key
:
$translate
.
instant
(
it
[
0
]),
value
:
it
[
1
],
ticked
:
false
};
return
{
key
:
$translate
.
instant
(
it
[
0
]),
value
:
it
[
1
],
ticked
:
false
};
}).
value
(),
rateOptions
:
[
{
key
:
'17%'
,
value
:
'17%'
,
ticked
:
false
},
{
key
:
'13%'
,
value
:
'13%'
,
ticked
:
false
},
{
key
:
'11%'
,
value
:
'11%'
,
ticked
:
false
},
{
key
:
'6%'
,
value
:
'6%'
,
ticked
:
false
},
{
key
:
'5%'
,
value
:
'5%'
,
ticked
:
false
},
{
key
:
'4%'
,
value
:
'4%'
,
ticked
:
false
},
{
key
:
'3%'
,
value
:
'3%'
,
ticked
:
false
},
{
key
:
'1.5%'
,
value
:
'1.5%'
,
ticked
:
false
}
{
key
:
'17%'
,
value
:
'17%'
,
ticked
:
false
},
{
key
:
'13%'
,
value
:
'13%'
,
ticked
:
false
},
{
key
:
'11%'
,
value
:
'11%'
,
ticked
:
false
},
{
key
:
'6%'
,
value
:
'6%'
,
ticked
:
false
},
{
key
:
'5%'
,
value
:
'5%'
,
ticked
:
false
},
{
key
:
'4%'
,
value
:
'4%'
,
ticked
:
false
},
{
key
:
'3%'
,
value
:
'3%'
,
ticked
:
false
},
{
key
:
'1.5%'
,
value
:
'1.5%'
,
ticked
:
false
}
],
amountTypeOptions
:
[
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
]
},
{
...
...
@@ -483,10 +482,10 @@
categoryOptions
:
[],
rateOptions
:
[],
amountTypeOptions
:
[
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
]
}
];
...
...
@@ -496,7 +495,7 @@
// 选中某一发票类型级联更新税率与金额类型列表
var
selectInvoiceOption
=
function
(
editModel
,
invoiceType
,
isInit
)
{
var
selectedInvoice
=
_
.
where
(
$scope
.
invoiceOptions
,
{
value
:
invoiceType
});
var
selectedInvoice
=
_
.
where
(
$scope
.
invoiceOptions
,
{
value
:
invoiceType
});
var
op
=
selectedInvoice
.
length
===
0
?
$scope
.
invoiceOptions
[
0
]
:
selectedInvoice
[
0
];
// 如果获取到的editModel.invoiceCategory为[ 99 ],代表发票类型全选;
...
...
@@ -528,7 +527,7 @@
});
var
choseAmoutType
=
isInit
&&
editModel
.
invoiceAmountType
&&
editModel
.
invoiceAmountType
>
0
?
_
.
where
(
op
.
amountTypeOptions
,
{
value
:
editModel
.
invoiceAmountType
})[
0
]
:
op
.
amountTypeOptions
[
0
];
_
.
where
(
op
.
amountTypeOptions
,
{
value
:
editModel
.
invoiceAmountType
})[
0
]
:
op
.
amountTypeOptions
[
0
];
editModel
.
chosenInvoiceOption
=
{
type
:
op
.
type
,
...
...
@@ -564,12 +563,12 @@
});
_spread
=
spread
;
var
activeSheet
=
_spread
.
get
ActiveSheet
(
);
var
activeSheet
=
_spread
.
get
Sheet
(
1
);
//设置整个sheet不可编辑
activeSheet
.
setIsProtected
(
true
)
;
activeSheet
.
protectionOption
(
{
activeSheet
.
isProtected
=
true
;
activeSheet
.
options
.
protectionOption
=
{
allowEditObjects
:
false
}
)
;
};
$scope
.
activeSheet
=
activeSheet
;
...
...
@@ -644,7 +643,7 @@
if
(
isHideContextMenu
)
{
hideSpreadContextMenu
();
}
else
{
$contextMenu
.
css
({
left
:
e
.
pageX
,
top
:
e
.
pageY
});
$contextMenu
.
css
({
left
:
e
.
pageX
,
top
:
e
.
pageY
});
$contextMenu
.
show
();
$
(
document
).
on
(
"click.contextmenu"
,
function
()
{
...
...
@@ -728,7 +727,7 @@
for
(
var
i
=
0
;
i
<
spans
[
k
].
rowCount
;
i
++
)
{
for
(
var
j
=
0
;
j
<
spans
[
k
].
colCount
;
j
++
)
{
if
(
i
>
0
||
j
>
0
)
{
exceptedCells
.
push
({
rowIndex
:
spans
[
k
].
row
+
i
,
columnIndex
:
spans
[
k
].
col
+
j
});
exceptedCells
.
push
({
rowIndex
:
spans
[
k
].
row
+
i
,
columnIndex
:
spans
[
k
].
col
+
j
});
}
}
}
...
...
@@ -747,8 +746,8 @@
var
col
=
startCol
+
j
;
if
(
_
.
every
(
exceptedCells
,
function
(
c
)
{
return
c
.
rowIndex
!==
row
||
c
.
columnIndex
!==
col
;
}))
{
validPosition
.
push
({
rowIndex
:
row
,
columnIndex
:
col
});
}))
{
validPosition
.
push
({
rowIndex
:
row
,
columnIndex
:
col
});
}
}
}
...
...
@@ -761,20 +760,20 @@
var
confirmWarningWindow
=
function
(
title
,
text
)
{
var
deferred
=
$q
.
defer
();
SweetAlert
.
swal
({
title
:
title
,
text
:
text
,
type
:
"warning"
,
showCancelButton
:
true
,
confirmButtonColor
:
"#DD6B55"
,
allowOutsideClick
:
false
,
confirmButtonText
:
$translate
.
instant
(
'Confirm'
),
cancelButtonText
:
$translate
.
instant
(
'Cancel'
),
closeOnConfirm
:
true
,
closeOnCancel
:
true
},
function
(
isConfirm
)
{
deferred
.
resolve
(
isConfirm
);
});
title
:
title
,
text
:
text
,
type
:
"warning"
,
showCancelButton
:
true
,
confirmButtonColor
:
"#DD6B55"
,
allowOutsideClick
:
false
,
confirmButtonText
:
$translate
.
instant
(
'Confirm'
),
cancelButtonText
:
$translate
.
instant
(
'Cancel'
),
closeOnConfirm
:
true
,
closeOnCancel
:
true
},
function
(
isConfirm
)
{
deferred
.
resolve
(
isConfirm
);
});
return
deferred
.
promise
;
};
...
...
@@ -803,7 +802,7 @@
selectInvoiceOption
(
$scope
.
editModel
,
$scope
.
editModel
.
invoiceType
,
true
);
// invoiceOption: Used to save invoice tax rate and amount type options temporarily
$scope
.
invoiceOption
=
_
.
findWhere
(
$scope
.
invoiceOptions
,
{
type
:
$scope
.
editModel
.
chosenInvoiceOption
.
type
});
$scope
.
invoiceOption
=
_
.
findWhere
(
$scope
.
invoiceOptions
,
{
type
:
$scope
.
editModel
.
chosenInvoiceOption
.
type
});
$scope
.
mentionApi
.
triggerValidator
(
$scope
.
editModel
.
formula
,
$scope
.
editReportFormulaForm
.
formula
);
$scope
.
mentionApiForValidation
.
triggerValidator
(
$scope
.
editModel
.
validation
,
$scope
.
editReportFormulaForm
.
validation
);
...
...
@@ -865,10 +864,10 @@
}
},
columns
:
[
{
caption
:
$translate
.
instant
(
'SubjectCodeCol'
),
dataField
:
'code'
},
{
caption
:
$translate
.
instant
(
'SubjectNameCol'
),
dataField
:
'name'
},
{
caption
:
$translate
.
instant
(
'SubjectDirectionCol'
),
dataField
:
'directionName'
},
{
caption
:
$translate
.
instant
(
'SubjectTypeCol'
),
dataField
:
'AcctPropName'
},
{
caption
:
$translate
.
instant
(
'SubjectCodeCol'
),
dataField
:
'code'
},
{
caption
:
$translate
.
instant
(
'SubjectNameCol'
),
dataField
:
'name'
},
{
caption
:
$translate
.
instant
(
'SubjectDirectionCol'
),
dataField
:
'directionName'
},
{
caption
:
$translate
.
instant
(
'SubjectTypeCol'
),
dataField
:
'AcctPropName'
},
{
alignment
:
'center'
,
width
:
'40px'
,
...
...
@@ -921,12 +920,12 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasVoucher"/>');
}
},
columns
:
[
{
caption
:
$translate
.
instant
(
'ModelCode'
),
dataField
:
'code'
,
visible
:
false
},
{
caption
:
$translate
.
instant
(
'ModelName'
),
dataField
:
'name'
},
{
caption
:
$translate
.
instant
(
'ModelDescription'
),
dataField
:
'description'
},
{
caption
:
$translate
.
instant
(
'ModelFeature'
),
dataField
:
'featureName'
},
{
caption
:
$translate
.
instant
(
'ModelType'
),
dataField
:
'modelTypeName'
},
{
caption
:
$translate
.
instant
(
'ModelOrganization'
),
dataField
:
'organizationName'
},
{
caption
:
$translate
.
instant
(
'ModelCode'
),
dataField
:
'code'
,
visible
:
false
},
{
caption
:
$translate
.
instant
(
'ModelName'
),
dataField
:
'name'
},
{
caption
:
$translate
.
instant
(
'ModelDescription'
),
dataField
:
'description'
},
{
caption
:
$translate
.
instant
(
'ModelFeature'
),
dataField
:
'featureName'
},
{
caption
:
$translate
.
instant
(
'ModelType'
),
dataField
:
'modelTypeName'
},
{
caption
:
$translate
.
instant
(
'ModelOrganization'
),
dataField
:
'organizationName'
},
{
alignment
:
'center'
,
width
:
'40px'
,
...
...
@@ -1081,7 +1080,7 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
var
operatorMatches
=
ngModelValue
.
match
(
notDuplicateOperatorExp
);
if
(
_
.
any
(
operatorMatches
,
function
(
m
)
{
return
m
.
length
>
1
;
}))
{
}))
{
ngModel
.
$setValidity
(
'operatorDuplicateValidator'
,
false
);
return
false
;
}
...
...
@@ -1151,7 +1150,7 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
$scope
.
editModel
.
formula
=
$
.
trim
(
$scope
.
editModel
.
formula
)
+
e
.
formula
+
'('
+
e
.
param
;
}
}
}
,
}
};
/*********************** End Formula Editor ***********************************/
...
...
@@ -1262,7 +1261,7 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
var
operatorMatches
=
ngModelValue
.
match
(
notDuplicateOperatorExp
);
if
(
_
.
any
(
operatorMatches
,
function
(
m
)
{
return
m
.
length
>
1
;
}))
{
}))
{
ngModel
.
$setValidity
(
'operatorDuplicateValidator'
,
false
);
return
false
;
}
...
...
@@ -1337,33 +1336,33 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
/*********************** End Formula Editor ***********************************/
//模板另存为
//模板另存为
var
saveTemplateGroup
=
function
()
{
var
groupName
=
$scope
.
groupName
;
if
(
groupName
===
''
||
groupName
===
undefined
)
{
SweetAlert
.
warning
(
$translate
.
instant
(
'InputTemplateGroupNameWarning'
));
return
;
}
$scope
.
newTemplateGroup
.
Name
=
groupName
;
$scope
.
newTemplateGroup
.
ServiceTypeID
=
$scope
.
curServiceTypeId
;
$scope
.
newTemplateGroup
.
CopyFrom
=
$scope
.
curTemplateGroup
.
id
;
$scope
.
newTemplateGroup
.
groupType
=
$scope
.
curTemplateGroup
.
groupType
;
$scope
.
newTemplateGroup
.
payTaxType
=
$scope
.
curTemplateGroup
.
payTaxType
;
$scope
.
newTemplateGroup
.
industryIDs
=
$scope
.
curTemplateGroup
.
industryIDs
;
$scope
.
newTemplateGroup
.
ChangedFormulas
=
$scope
.
formulasArrayTemp
;
templateGroupService
.
addTemplateGroup
(
$scope
.
newTemplateGroup
).
success
(
function
(
or
)
{
if
(
or
&&
or
.
result
)
{
SweetAlert
.
success
(
$translate
.
instant
(
'TemplateGroupSaveAsSuccess'
));
loadTemplateGroup
();
$
(
'#templateName'
).
val
(
''
);
$
(
'.templates-save-form'
).
css
(
'display'
,
'none'
);
}
else
{
SweetAlert
.
warning
(
$translate
.
instant
(
or
.
resultMsg
));
var
groupName
=
$scope
.
groupName
;
if
(
groupName
===
''
||
groupName
===
undefined
)
{
SweetAlert
.
warning
(
$translate
.
instant
(
'InputTemplateGroupNameWarning'
));
return
;
}
});
};
$scope
.
newTemplateGroup
.
Name
=
groupName
;
$scope
.
newTemplateGroup
.
ServiceTypeID
=
$scope
.
curServiceTypeId
;
$scope
.
newTemplateGroup
.
CopyFrom
=
$scope
.
curTemplateGroup
.
id
;
$scope
.
newTemplateGroup
.
groupType
=
$scope
.
curTemplateGroup
.
groupType
;
$scope
.
newTemplateGroup
.
payTaxType
=
$scope
.
curTemplateGroup
.
payTaxType
;
$scope
.
newTemplateGroup
.
industryIDs
=
$scope
.
curTemplateGroup
.
industryIDs
;
$scope
.
newTemplateGroup
.
ChangedFormulas
=
$scope
.
formulasArrayTemp
;
templateGroupService
.
addTemplateGroup
(
$scope
.
newTemplateGroup
).
success
(
function
(
or
)
{
if
(
or
&&
or
.
result
)
{
SweetAlert
.
success
(
$translate
.
instant
(
'TemplateGroupSaveAsSuccess'
));
loadTemplateGroup
();
$
(
'#templateName'
).
val
(
''
);
$
(
'.templates-save-form'
).
css
(
'display'
,
'none'
);
}
else
{
SweetAlert
.
warning
(
$translate
.
instant
(
or
.
resultMsg
));
}
});
};
var
loadTemplateMenu
=
function
()
{
...
...
@@ -1411,21 +1410,21 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
// 如果发票类型全选,则将editModel.invoiceCategory设置为[ 99 ];
// 否则将选中的发票类型存入editModel.invoiceCategory数组,如[1, 2, 3]
if
(
$scope
.
editModel
.
chosenInvoiceOption
.
categoryOptions
.
length
>
0
&&
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
categoryOptions
,
{
ticked
:
true
}))
{
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
categoryOptions
,
{
ticked
:
true
}))
{
$scope
.
editModel
.
invoiceCategory
=
[
Number
(
constant
.
selectAllValue
)];
}
else
{
$scope
.
editModel
.
invoiceCategory
=
_
.
chain
(
$scope
.
editModel
.
chosenInvoiceOption
.
categoryOptions
)
.
where
({
ticked
:
true
}).
pluck
(
'value'
).
value
();
.
where
({
ticked
:
true
}).
pluck
(
'value'
).
value
();
}
// 如果税率全选,则将editModel.taxRate设置为[ '99' ];
// 否则将选中的税率存入editModel.taxRate数组,如['17%', '11%', '6%']
if
(
$scope
.
editModel
.
chosenInvoiceOption
.
rateOptions
.
length
>
0
&&
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
rateOptions
,
{
ticked
:
true
}))
{
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
rateOptions
,
{
ticked
:
true
}))
{
$scope
.
editModel
.
taxRate
=
[
constant
.
selectAllValue
];
}
else
{
$scope
.
editModel
.
taxRate
=
_
.
chain
(
$scope
.
editModel
.
chosenInvoiceOption
.
rateOptions
)
.
where
({
ticked
:
true
}).
pluck
(
'value'
).
value
();
.
where
({
ticked
:
true
}).
pluck
(
'value'
).
value
();
}
$scope
.
editModel
.
invoiceType
=
$scope
.
editModel
.
chosenInvoiceOption
.
value
;
...
...
@@ -1549,17 +1548,17 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
var
groupedParamList
=
_
.
groupBy
(
result
[
2
].
data
.
data
,
'formulaID'
);
var
paramList
=
result
[
1
].
data
.
data
;
_
.
each
(
groupedParamList
,
function
(
val
,
key
)
{
var
formula
=
_
.
findWhere
(
formulaList
,
{
id
:
key
});
var
formula
=
_
.
findWhere
(
formulaList
,
{
id
:
key
});
if
(
formula
)
{
formula
.
params
=
_
.
chain
(
val
)
.
map
(
function
(
p
)
{
return
{
id
:
p
.
formulaParamID
,
index
:
p
.
paramIndex
};
return
{
id
:
p
.
formulaParamID
,
index
:
p
.
paramIndex
};
})
.
sortBy
(
function
(
p
)
{
return
p
.
index
;
}).
value
();
_
.
each
(
formula
.
params
,
function
(
p
,
idx
)
{
var
param
=
_
.
findWhere
(
paramList
,
{
id
:
p
.
id
});
var
param
=
_
.
findWhere
(
paramList
,
{
id
:
p
.
id
});
_
.
extend
(
p
,
param
);
});
}
...
...
@@ -1578,14 +1577,14 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
var
modelTypes
=
_
.
invert
(
enums
.
modelType
);
_
.
each
(
data
,
function
(
m
)
{
if
(
m
.
type
.
toString
()
===
modelTypes
.
SystemCommonModel
)
{
if
(
!
_
.
some
(
rtn
,
{
id
:
m
.
id
}))
{
if
(
!
_
.
some
(
rtn
,
{
id
:
m
.
id
}))
{
m
.
orgID
=
null
;
m
.
organizationName
=
$translate
.
instant
(
'All'
);
m
.
featureName
=
$translate
.
instant
(
enums
.
modelFeature
[
m
.
feature
]);
rtn
.
push
(
m
);
}
}
else
{
var
existsModel
=
_
.
findWhere
(
rtn
,
{
id
:
m
.
id
});
var
existsModel
=
_
.
findWhere
(
rtn
,
{
id
:
m
.
id
});
if
(
!
existsModel
)
{
m
.
featureName
=
$translate
.
instant
(
enums
.
modelFeature
[
m
.
feature
]);
rtn
.
push
(
m
);
...
...
@@ -1691,8 +1690,8 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
newValue
.
value
<=
0
||
newValue
.
invoiceAmountType
.
value
<=
0
||
newValue
.
value
!==
3
&&
(
_
.
every
(
newValue
.
categoryOptions
,
{
ticked
:
false
})
||
_
.
every
(
newValue
.
rateOptions
,
{
ticked
:
false
}))))
{
(
_
.
every
(
newValue
.
categoryOptions
,
{
ticked
:
false
})
||
_
.
every
(
newValue
.
rateOptions
,
{
ticked
:
false
}))))
{
$scope
.
editReportFormulaForm
.
invoice
.
$setValidity
(
'invoiceNotSelectValidator'
,
false
);
}
else
{
$scope
.
editReportFormulaForm
.
invoice
.
$setValidity
(
'invoiceNotSelectValidator'
,
true
);
...
...
@@ -1706,8 +1705,8 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
$scope
.
editModel
.
chosenInvoiceOption
.
value
<=
0
||
$scope
.
editModel
.
chosenInvoiceOption
.
invoiceAmountType
.
value
<=
0
||
$scope
.
editModel
.
chosenInvoiceOption
.
value
!==
3
&&
(
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
rateOptions
,
{
ticked
:
false
})
||
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
categoryOptions
,
{
ticked
:
false
})))
{
(
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
rateOptions
,
{
ticked
:
false
})
||
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
categoryOptions
,
{
ticked
:
false
})))
{
$scope
.
editReportFormulaForm
.
invoice
.
$setValidity
(
'invoiceNotSelectValidator'
,
false
);
}
});
...
...
@@ -2064,7 +2063,8 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
$
(
'#'
+
dxControl
.
templateDropDownId
).
dxDropDownBox
({
value
:
selectName
,
showClearButton
:
false
,
onContentReady
:
function
(
args
)
{
},
onContentReady
:
function
(
args
)
{
},
contentTemplate
:
function
(
e
)
{
// thisData.DropDownEvent = e;
var
value
=
e
.
component
.
option
(
"value"
);
...
...
@@ -2104,7 +2104,7 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
$scope
.
selectFormula
=
null
;
$scope
.
cancelHide
=
false
;
$scope
.
firedName
=
''
;
$scope
.
firedType
=
==
'0'
;
$scope
.
firedType
=
'0'
;
$scope
.
firedParams
=
''
;
$scope
.
editFormula
=
''
;
$scope
.
editParams
=
''
;
...
...
@@ -2113,7 +2113,7 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
$scope
.
selectFormulaForValidation
=
null
;
$scope
.
cancelHideForValidation
=
false
;
$scope
.
firedValidationName
=
''
;
$scope
.
firedValidationType
=
==
'0'
;
$scope
.
firedValidationType
=
'0'
;
$scope
.
firedValidationParams
=
''
;
$scope
.
editFormulaForValidation
=
''
;
$scope
.
editParamsForValidation
=
''
;
...
...
@@ -2165,10 +2165,10 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
});
var
tabs
=
[
{
id
:
0
,
text
:
$translate
.
instant
(
'AutoCalculateTab'
)
},
{
id
:
1
,
text
:
$translate
.
instant
(
'ManualInputTab'
)
},
{
id
:
2
,
text
:
$translate
.
instant
(
'ModelTab'
)
},
{
id
:
3
,
text
:
$translate
.
instant
(
'ValidationTab'
)
}
{
id
:
0
,
text
:
$translate
.
instant
(
'AutoCalculateTab'
)
},
{
id
:
1
,
text
:
$translate
.
instant
(
'ManualInputTab'
)
},
{
id
:
2
,
text
:
$translate
.
instant
(
'ModelTab'
)
},
{
id
:
3
,
text
:
$translate
.
instant
(
'ValidationTab'
)
}
];
$scope
.
tabOptions
=
{
dataSource
:
tabs
,
...
...
atms-web/src/main/webapp/app/admin/systemConfiguration/declarationFormConfiguration/declaration-form-configuration.html
View file @
c9e60f8f
...
...
@@ -5,32 +5,38 @@
</div>
<div
class=
"menu-dropdown"
>
<div
class=
"dropdown"
>
<button
class=
"btn btn-default dropdown-toggle"
type=
"button"
id=
"dropdownMenu1"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"true"
>
<button
class=
"btn btn-default dropdown-toggle"
type=
"button"
id=
"dropdownMenu1"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"true"
>
{{curServiceTypeName}}
<span
class=
"caret"
></span>
</button>
<ul
class=
"dropdown-menu"
aria-labelledby=
"dropdownMenu1"
>
<li
ng-repeat=
"s in getServiceTypeList()"
><a
href=
"#"
ng-click=
"toggleServiceType(s)"
>
{{s.name}}
</a></li>
<li
ng-repeat=
"s in getServiceTypeList()"
>
<a
href=
"#"
ng-click=
"toggleServiceType(s)"
>
{{s.name}}
</a>
</li>
</ul>
</div>
</div>
<div
class=
"menu-log"
>
<button
class=
"btn btn-not-important log-btn"
ng-click=
"showOperateLogPop()"
><i
class=
"material-icons"
>
description
</i><span
translate=
"log"
></span></button>
<button
class=
"btn btn-not-important log-btn"
ng-click=
"showOperateLogPop()"
>
<i
class=
"material-icons"
>
description
</i>
<span
translate=
"log"
></span>
</button>
</div>
</div>
<div
class=
"tab-content-container"
>
<div
class=
"templates-top"
>
<div
class=
"form-group"
>
<span
class=
"tab-content-select-lable"
ng-show=
"curServiceTypeId !=='12'"
>
{{'IndustryColon' | translate}}
</span>
<div
id=
"dx-select-industry"
class=
"tab-content-select industry col-md-2"
ng-show=
"curServiceTypeId !=='12'"
dx-select-box=
"dataSourceIndustryList"
dx-item-alias=
"itemObj"
>
<div
id=
"dx-select-industry"
class=
"tab-content-select industry col-md-2"
ng-show=
"curServiceTypeId !=='12'"
dx-select-box=
"dataSourceIndustryList"
dx-item-alias=
"itemObj"
>
<div
data-options=
"dxTemplate: { name: 'industryItem' }"
class=
"dx-item-content dx-list-item-content"
title=
"{{itemObj.name}}"
>
{{itemObj.name}}
</div>
</div>
<span
class=
"tab-content-select-lable"
translate=
"ReportType"
ng-show=
"curServiceTypeId === '2'"
></span>
<div
class=
"tab-content-select reportType col-md-2"
id=
"dx-select-pay-tax-type"
ng-show=
"curServiceTypeId === '2'"
dx-select-box=
"dataSourcePayTaxTypeList"
dx-item-alias=
"itemObj"
>
<div
class=
"tab-content-select reportType col-md-2"
id=
"dx-select-pay-tax-type"
ng-show=
"curServiceTypeId === '2'"
dx-select-box=
"dataSourcePayTaxTypeList"
dx-item-alias=
"itemObj"
>
<div
data-options=
"dxTemplate: { name: 'filingTypeItem' }"
class=
"dx-item-content dx-list-item-content"
title=
"{{itemObj.name}}"
>
{{itemObj.name}}
</div>
...
...
@@ -40,14 +46,15 @@
</div>
<span
class=
"tab-content-select-lable"
translate=
"ReportType"
ng-show=
"curServiceTypeId === '6' || curServiceTypeId === '11' || curServiceTypeId === '99'"
></span>
<div
class=
"tab-content-select reportType col-md-2"
id=
"dx-select-report-type"
ng-show=
"curServiceTypeId === '6' || curServiceTypeId === '11' || curServiceTypeId === '99'"
dx-select-box=
"detailReportTypeList"
dx-item-alias=
"itemObj"
>
dx-select-box=
"detailReportTypeList"
dx-item-alias=
"itemObj"
>
<div
data-options=
"dxTemplate: { name: 'reportTypeItem' }"
class=
"dx-item-content dx-list-item-content"
title=
"{{itemObj.name}}"
>
{{itemObj.name}}
</div>
</div>
<span
class=
"tab-content-select-lable"
translate=
"SelectReport"
></span>
<div
class=
"tab-content-select selectReport col-md-2"
id=
"dx-select-template"
></div>
<button
id=
"btnSaveAs"
class=
"btn btn-third"
atms-permission
permission-control-type=
"ngIf"
permission-code=
"{{$root.adminPermission.systemConfiguration.declarationFormConfiguration.addCode}}"
translate=
"TemplateGroupSaveAs"
ng-click=
"toggleSaveAs();"
></button>
<button
id=
"btnSaveAs"
class=
"btn btn-third"
atms-permission
permission-control-type=
"ngIf"
permission-code=
"{{$root.adminPermission.systemConfiguration.declarationFormConfiguration.addCode}}"
translate=
"TemplateGroupSaveAs"
ng-click=
"toggleSaveAs();"
></button>
<span
export-button=
""
style=
"float: right; margin-right: 0px; margin-top: 7px"
></span>
</div>
<!--<select ng-model="curTemplate" ng-options="(t.name+ '_' + t.code) for t in templates" ng-change="loadSheet(curTemplate)"></select>-->
...
...
@@ -69,7 +76,9 @@
</div>-->
<div
id=
"report-view"
class=
"right spread-div"
></div>
<ul
id=
"spreadContextMenu"
class=
"dropdown-menu"
role=
"menu"
style=
"display: none"
>
<li><a
class=
"localize"
data-action=
"applyRowColName"
>
{{'ApplyRowColName' | translate}}
</a></li>
<li>
<a
class=
"localize"
data-action=
"applyRowColName"
>
{{'ApplyRowColName' | translate}}
</a>
</li>
</ul>
</div>
...
...
@@ -87,185 +96,183 @@
</span>
</div>
<div
id=
"editReportFormulaContent"
>
<div
class=
"modal-header editReportFormulaPop-modal-header"
>
<div
class=
"modal-title"
id=
"editReportFormulaTitle"
>
<span>
{{'ReportConfigurationEdit' | translate }}-
</span>
<span
class=
"title-info"
>
{{'Cell' | translate}}:{{editModel.cell}}
</span>
<span
class=
"title-separator"
>
|
</span>
<div
class=
"modal-header editReportFormulaPop-modal-header"
>
<div
class=
"modal-title"
id=
"editReportFormulaTitle"
>
<span>
{{'ReportConfigurationEdit' | translate }}-
</span>
<span
class=
"title-info"
>
{{'Cell' | translate}}:{{editModel.cell}}
</span>
<span
class=
"title-separator"
>
|
</span>
<span
class=
"title-info"
>
{{'CellRowName' | translate}}:
<input
type=
"text"
class=
"edit-input form-control"
ng-if=
"!editModel.isSystemType"
ng-model=
"editModel.rowName"
>
<span
ng-if=
"editModel.isSystemType"
>
{{editModel.rowName}}
</span>
</span>
<span
class=
"title-separator"
>
|
</span>
</span>
<span
class=
"title-separator"
>
|
</span>
<span
class=
"title-info"
>
{{'CellColumnName' | translate}}:
<input
type=
"text"
ng-if=
"!editModel.isSystemType"
class=
"edit-input form-control"
ng-model=
"editModel.columnName"
/>
<span
ng-if=
"editModel.isSystemType"
>
{{editModel.columnName}}
</span>
</span>
</div>
</span>
</div>
<div
class=
"modal-body editReportFormulaPop-modal-body"
>
<form
class=
"form-horizontal"
id=
"editReportFormulaForm"
name=
"editReportFormulaForm"
novalidate=
"novalidate"
style=
"padding-left:35px;"
>
<div
dx-tabs=
"tabOptions"
></div>
<div
class=
"form-group formula-group"
ng-show=
"selectedTab === 0"
>
<label
class=
"checkbox-inline bold"
ng-class=
"{ 'disabled': !hasEditPermission || !ToggleSaveAs }"
>
<input
type=
"checkbox"
ng-model=
"editModel.hasFormula"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs"
>
{{'FormulaConfig' | translate}}
</label>
<div
ng-messages=
"editReportFormulaForm.formula.$error"
class=
"has-error label bold"
>
<span
ng-message=
"requiredValidator"
>
{{'RequiredValidator' | translate}}
</span>
<span
ng-message=
"keyValueNotEmptyValidator"
>
{{'KeyValueNotEmptyValidator' | translate}}
</span>
<span
ng-message=
"keyValueSeparatorValidator"
>
{{'KeyValueSeparatorValidator' | translate}}
</span>
<span
ng-message=
"operatorDuplicateValidator"
>
{{'OperatorDuplicateValidator' | translate}}
</span>
<span
ng-message=
"missingExpressionValidator"
>
{{'MissingExpressionValidator' | translate}}
</span>
<span
ng-message=
"missingOperatorValidator"
>
{{'MissingOperatorValidator' | translate}}
</span>
<span
ng-message=
"formulaFormatValidator"
>
{{'FormulaFormatValidator' | translate}}
</span>
</div>
<mention-input
class=
"inputer"
input-class=
"form-control"
input-id=
"formula"
mention-list=
"mentionList"
display-mode=
"'textarea'"
formula-list=
"formulaList"
show-name=
"true"
mention-api=
"mentionApi"
input-readonly=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasFormula"
ng-model=
"editModel.formula"
fired-name=
"firedName"
fired-tag-type=
"firedType"
fired-formula-params=
"firedParams"
double-click=
"editFormulaParamOrKeyValue($event)"
include-btn=
"true"
btn-click=
"showSelectKeyValuePop()"
btn2-click=
"showSelectFormulaPop()"
custom-validator=
"mentionMenuValidator(value, ngModel)"
input-focus=
"cancelHideTranslator($event)"
input-blur=
"timerHideTranslator();asyncFormulaValidate();"
></mention-input>
<formula-translator
formula-list=
"formulaList"
account-data-source=
"accountDataSource"
formula-name=
"firedName"
formula-params=
"firedParams"
hide-mode=
"'notVisible'"
translator-focus=
"cancelHideTranslator()"
translator-blur=
"timerHideTranslator();"
></formula-translator>
</div>
<div
class=
"modal-body editReportFormulaPop-modal-body"
>
<form
class=
"form-horizontal"
id=
"editReportFormulaForm"
name=
"editReportFormulaForm"
novalidate=
"novalidate"
style=
"padding-left:35px;"
>
<div
dx-tabs=
"tabOptions"
></div>
<div
class=
"form-group formula-group"
ng-show=
"selectedTab === 0"
>
<label
class=
"checkbox-inline bold"
ng-class=
"{ 'disabled': !hasEditPermission || !ToggleSaveAs }"
>
<input
type=
"checkbox"
ng-model=
"editModel.hasFormula"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs"
>
{{'FormulaConfig' | translate}}
</label>
<div
ng-messages=
"editReportFormulaForm.formula.$error"
class=
"has-error label bold"
>
<span
ng-message=
"requiredValidator"
>
{{'RequiredValidator' | translate}}
</span>
<span
ng-message=
"keyValueNotEmptyValidator"
>
{{'KeyValueNotEmptyValidator' | translate}}
</span>
<span
ng-message=
"keyValueSeparatorValidator"
>
{{'KeyValueSeparatorValidator' | translate}}
</span>
<span
ng-message=
"operatorDuplicateValidator"
>
{{'OperatorDuplicateValidator' | translate}}
</span>
<span
ng-message=
"missingExpressionValidator"
>
{{'MissingExpressionValidator' | translate}}
</span>
<span
ng-message=
"missingOperatorValidator"
>
{{'MissingOperatorValidator' | translate}}
</span>
<span
ng-message=
"formulaFormatValidator"
>
{{'FormulaFormatValidator' | translate}}
</span>
</div>
<div
class=
"form-group row-instructions"
ng-show=
"selectedTab === 0"
>
<label
class=
"bold"
>
{{'FillingInstructions' | translate}}:
</label>
<textarea
class=
"form-control"
ng-model=
"editModel.formulaDescription"
ng-readonly=
"!hasEditPermission || !ToggleSaveAs"
></textarea>
<mention-input
class=
"inputer"
input-class=
"form-control"
input-id=
"formula"
mention-list=
"mentionList"
display-mode=
"'textarea'"
formula-list=
"formulaList"
show-name=
"true"
mention-api=
"mentionApi"
input-readonly=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasFormula"
ng-model=
"editModel.formula"
fired-name=
"firedName"
fired-tag-type=
"firedType"
fired-formula-params=
"firedParams"
double-click=
"editFormulaParamOrKeyValue($event)"
include-btn=
"true"
btn-click=
"showSelectKeyValuePop()"
btn2-click=
"showSelectFormulaPop()"
custom-validator=
"mentionMenuValidator(value, ngModel)"
input-focus=
"cancelHideTranslator($event)"
input-blur=
"timerHideTranslator();asyncFormulaValidate();"
></mention-input>
<formula-translator
formula-list=
"formulaList"
account-data-source=
"accountDataSource"
formula-name=
"firedName"
formula-params=
"firedParams"
hide-mode=
"'notVisible'"
translator-focus=
"cancelHideTranslator()"
translator-blur=
"timerHideTranslator();"
></formula-translator>
</div>
<div
class=
"form-group row-instructions"
ng-show=
"selectedTab === 0"
>
<label
class=
"bold"
>
{{'FillingInstructions' | translate}}:
</label>
<textarea
class=
"form-control"
ng-model=
"editModel.formulaDescription"
ng-readonly=
"!hasEditPermission || !ToggleSaveAs"
></textarea>
</div>
<div
class=
"form-group voucher-group"
ng-show=
"selectedTab === 1"
>
<label
class=
"checkbox-inline bold"
ng-class=
"{ 'disabled': !hasEditPermission || !ToggleSaveAs }"
>
<input
type=
"checkbox"
name=
"voucher"
ng-model=
"editModel.hasVoucher"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs"
>
{{'VoucherFilter' | translate}}
</label>
<div
ng-messages=
"editReportFormulaForm.voucher.$error"
class=
"has-error label bold"
>
<span
ng-message=
"voucherNotSelectValidator"
>
{{'VoucherNotSelectValidator' | translate}}
</span>
</div>
<div
class=
"form-group voucher-group"
ng-show=
"selectedTab === 1"
>
<label
class=
"checkbox-inline bold"
ng-class=
"{ 'disabled': !hasEditPermission || !ToggleSaveAs }"
>
<input
type=
"checkbox"
name=
"voucher"
ng-model=
"editModel.hasVoucher"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs"
>
{{'VoucherFilter' | translate}}
<div>
<label
class=
"radio-inline"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasVoucher"
>
<input
type=
"radio"
name=
"voucherFilterTypes"
ng-value=
"0"
ng-model=
"voucherFilterType"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasVoucher"
>
{{'Account' | translate}}
</label>
<div
ng-messages=
"editReportFormulaForm.voucher.$error"
class=
"has-error label bold"
>
<span
ng-message=
"voucherNotSelectValidator"
>
{{'VoucherNotSelectValidator' | translate}}
</span>
</div>
<div>
<label
class=
"radio-inline"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasVoucher"
>
<input
type=
"radio"
name=
"voucherFilterTypes"
ng-value=
"0"
ng-model=
"voucherFilterType"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasVoucher"
>
{{'Account' | translate}}
</label>
<label
class=
"radio-inline"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasVoucher"
>
<input
type=
"radio"
name=
"voucherFilterTypes"
ng-value=
"1"
ng-model=
"voucherFilterType"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasVoucher"
>
{{'SummaryKeyword' | translate}}
</label>
</div>
<div
class=
"options-row"
>
<button
type=
"button"
class=
"btn btn-edit"
ng-show=
"voucherFilterType === 0"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasVoucher"
data-toggle=
"modal"
ng-click=
"showSelectAccountPop()"
>
<i
class=
"material-icons"
aria-hidden=
"true"
>
add_circle_outline
</i>
{{'Add' | translate}}
</button>
<input
type=
"text"
class=
"form-control input-summary"
ng-show=
"voucherFilterType === 1"
ng-readonly=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasVoucher"
ng-model=
"editModel.voucherKeyword"
placeholder=
"{{'InputSummaryKeyword' | translate}}"
>
</div>
</div>
<div
class=
"dx-viewport grid-container"
ng-show=
"selectedTab === 1 && voucherFilterType === 0"
ng-class=
"{ 'row1': selectedAccount.length <= 1, 'row2': selectedAccount.length === 2, 'row3': selectedAccount.length >= 3 }"
>
<div
id=
"voucherGrid"
dx-data-grid=
"voucherGridOptions"
></div>
</div>
<div
class=
"checkbox"
ng-show=
"selectedTab === 1"
ng-class=
"{ 'disabled': !hasEditPermission || !ToggleSaveAs }"
>
<label
class=
"bold"
>
<input
type=
"checkbox"
name=
"invoice"
ng-model=
"editModel.hasInvoice"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs"
>
{{'InvoiceFilter' | translate}}
<label
class=
"radio-inline"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasVoucher"
>
<input
type=
"radio"
name=
"voucherFilterTypes"
ng-value=
"1"
ng-model=
"voucherFilterType"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasVoucher"
>
{{'SummaryKeyword' | translate}}
</label>
<span
ng-messages=
"editReportFormulaForm.invoice.$error"
class=
"has-error label bold"
>
<span
ng-message=
"invoiceNotSelectValidator"
>
{{'InvoiceNotSelectValidator' | translate}}
</span>
</span>
</div>
<div
class=
"form-group invoice-group"
ng-show=
"selectedTab === 1"
>
<div
class=
"select-invoice-amount-type"
id=
"dx-invoice-type-select"
data-ng-model=
"invoiceOption"
dx-select-box=
"dataSourceInvoice"
></div>
<span
isteven-multi-select
ng-if=
"!(!editModel.chosenInvoiceOption.categoryOptions || editModel.chosenInvoiceOption.categoryOptions.length === 0)"
input-model=
"editModel.chosenInvoiceOption.categoryOptions"
output-model=
"selectedCategoryOptions"
tick-property=
"ticked"
button-label=
"key"
item-label=
"key"
max-labels=
"1"
helper-elements=
"all none"
translation=
"langSetting"
is-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasInvoice"
on-item-click=
"refreshCategorySelect(data)"
class=
"invoice-category-select"
></span>
<span
isteven-multi-select
ng-hide=
"!(!editModel.chosenInvoiceOption.rateOptions || editModel.chosenInvoiceOption.rateOptions.length === 0)"
input-model=
"editModel.chosenInvoiceOption.rateOptions"
output-model=
"selectedRateOptions"
tick-property=
"ticked"
button-label=
"key"
item-label=
"key"
max-labels=
"2"
helper-elements=
"all none"
translation=
"langSetting"
is-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasInvoice"
on-item-click=
"refreshTaxRateSelect(data)"
class=
"tax-rate-select"
></span>
<div
class=
"select-invoice-amount-type"
data-ng-model=
"editModel.chosenInvoiceOption.invoiceAmountType"
dx-select-box=
"dataSourceInvoiceAmount"
></div>
<div
class=
"options-row"
>
<button
type=
"button"
class=
"btn btn-edit"
ng-show=
"voucherFilterType === 0"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasVoucher"
data-toggle=
"modal"
ng-click=
"showSelectAccountPop()"
>
<i
class=
"material-icons"
aria-hidden=
"true"
>
add_circle_outline
</i>
{{'Add' | translate}}
</button>
<input
type=
"text"
class=
"form-control input-summary"
ng-show=
"voucherFilterType === 1"
ng-readonly=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasVoucher"
ng-model=
"editModel.voucherKeyword"
placeholder=
"{{'InputSummaryKeyword' | translate}}"
>
</div>
<div
class=
"checkbox"
ng-show=
"selectedTab === 1"
ng-class=
"{ 'disabled': !hasEditPermission || !ToggleSaveAs }"
>
<label
class=
"bold"
>
<input
type=
"checkbox"
ng-model=
"editModel.hasKeyIn"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs"
>
{{'ManualInput' | translate}}
</label>
</div>
<div
class=
"dx-viewport grid-container"
ng-show=
"selectedTab === 1 && voucherFilterType === 0"
ng-class=
"{ 'row1': selectedAccount.length <= 1, 'row2': selectedAccount.length === 2, 'row3': selectedAccount.length >= 3 }"
>
<div
id=
"voucherGrid"
dx-data-grid=
"voucherGridOptions"
></div>
</div>
<div
class=
"checkbox"
ng-show=
"selectedTab === 1"
ng-class=
"{ 'disabled': !hasEditPermission || !ToggleSaveAs }"
>
<label
class=
"bold"
>
<input
type=
"checkbox"
name=
"invoice"
ng-model=
"editModel.hasInvoice"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs"
>
{{'InvoiceFilter' | translate}}
</label>
<span
ng-messages=
"editReportFormulaForm.invoice.$error"
class=
"has-error label bold"
>
<span
ng-message=
"invoiceNotSelectValidator"
>
{{'InvoiceNotSelectValidator' | translate}}
</span>
</span>
</div>
<div
class=
"form-group invoice-group"
ng-show=
"selectedTab === 1"
>
<div
class=
"select-invoice-amount-type"
id=
"dx-invoice-type-select"
data-ng-model=
"invoiceOption"
dx-select-box=
"dataSourceInvoice"
></div>
<span
isteven-multi-select
ng-if=
"!(!editModel.chosenInvoiceOption.categoryOptions || editModel.chosenInvoiceOption.categoryOptions.length === 0)"
input-model=
"editModel.chosenInvoiceOption.categoryOptions"
output-model=
"selectedCategoryOptions"
tick-property=
"ticked"
button-label=
"key"
item-label=
"key"
max-labels=
"1"
helper-elements=
"all none"
translation=
"langSetting"
is-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasInvoice"
on-item-click=
"refreshCategorySelect(data)"
class=
"invoice-category-select"
></span>
<span
isteven-multi-select
ng-hide=
"!(!editModel.chosenInvoiceOption.rateOptions || editModel.chosenInvoiceOption.rateOptions.length === 0)"
input-model=
"editModel.chosenInvoiceOption.rateOptions"
output-model=
"selectedRateOptions"
tick-property=
"ticked"
button-label=
"key"
item-label=
"key"
max-labels=
"2"
helper-elements=
"all none"
translation=
"langSetting"
is-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasInvoice"
on-item-click=
"refreshTaxRateSelect(data)"
class=
"tax-rate-select"
></span>
<div
class=
"select-invoice-amount-type"
data-ng-model=
"editModel.chosenInvoiceOption.invoiceAmountType"
dx-select-box=
"dataSourceInvoiceAmount"
></div>
</div>
<div
class=
"checkbox"
ng-show=
"selectedTab === 1"
ng-class=
"{ 'disabled': !hasEditPermission || !ToggleSaveAs }"
>
<label
class=
"bold"
>
<input
type=
"checkbox"
ng-model=
"editModel.hasKeyIn"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs"
>
{{'ManualInput' | translate}}
</label>
</div>
<div
class=
"form-group model-group"
ng-show=
"selectedTab === 2"
>
<label
class=
"checkbox-inline bold"
ng-class=
"{ 'disabled': !hasEditPermission || !ToggleSaveAs }"
>
<input
type=
"checkbox"
name=
"model"
ng-model=
"editModel.hasModel"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs"
>
{{'LinkModel' | translate}}
</label>
<div
ng-messages=
"editReportFormulaForm.model.$error"
class=
"has-error label bold"
>
<span
ng-message=
"modelNotSelectValidator"
>
{{'ModelNotSelectValidator' | translate}}
</span>
</div>
<div
class=
"form-group model-group"
ng-show=
"selectedTab === 2"
>
<label
class=
"checkbox-inline bold"
ng-class=
"{ 'disabled': !hasEditPermission || !ToggleSaveAs }"
>
<input
type=
"checkbox"
name=
"model"
ng-model=
"editModel.hasModel"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs"
>
{{'LinkModel' | translate}}
</label>
<div
ng-messages=
"editReportFormulaForm.model.$error"
class=
"has-error label bold"
>
<span
ng-message=
"modelNotSelectValidator"
>
{{'ModelNotSelectValidator' | translate}}
</span>
</div>
<div
class=
"options-row"
>
<button
type=
"button"
class=
"btn btn-edit"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasModel"
data-toggle=
"modal"
ng-click=
"showSelectModelPop()"
>
<i
class=
"material-icons"
aria-hidden=
"true"
>
add_circle_outline
</i>
{{'Add' | translate}}
</button>
</div>
<div
class=
"options-row"
>
<button
type=
"button"
class=
"btn btn-edit"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasModel"
data-toggle=
"modal"
ng-click=
"showSelectModelPop()"
>
<i
class=
"material-icons"
aria-hidden=
"true"
>
add_circle_outline
</i>
{{'Add' | translate}}
</button>
</div>
<div
class=
"dx-viewport grid-container last-grid"
ng-show=
"selectedTab === 2"
ng-class=
"{ 'row1': selectedModel.length <= 1, 'row2': selectedModel.length === 2,
</div>
<div
class=
"dx-viewport grid-container last-grid"
ng-show=
"selectedTab === 2"
ng-class=
"{ 'row1': selectedModel.length <= 1, 'row2': selectedModel.length === 2,
'row3': selectedModel.length === 3,
'row4': selectedModel.length === 4,
'row5': selectedModel.length === 5,
'row6': selectedModel.length >= 6,
}"
>
<div
id=
"modelGrid"
dx-data-grid=
"modelGridOptions"
></div>
<div
id=
"modelGrid"
dx-data-grid=
"modelGridOptions"
></div>
</div>
<div
class=
"form-group validation-group"
ng-show=
"selectedTab === 3"
>
<label
class=
"checkbox-inline bold"
ng-class=
"{ 'disabled': !hasEditPermission || !ToggleSaveAs }"
>
<input
type=
"checkbox"
ng-model=
"editModel.hasValidation"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs"
>
{{'ValidationConfig' | translate}}
</label>
<div
ng-messages=
"editReportFormulaForm.validation.$error"
class=
"has-error label bold"
>
<span
ng-message=
"requiredValidator"
>
{{'RequiredValidator' | translate}}
</span>
<span
ng-message=
"keyValueNotEmptyValidator"
>
{{'KeyValueNotEmptyValidator' | translate}}
</span>
<span
ng-message=
"keyValueSeparatorValidator"
>
{{'KeyValueSeparatorValidator' | translate}}
</span>
<span
ng-message=
"operatorDuplicateValidator"
>
{{'OperatorDuplicateValidator' | translate}}
</span>
<span
ng-message=
"missingExpressionValidator"
>
{{'MissingExpressionValidator' | translate}}
</span>
<span
ng-message=
"missingOperatorValidator"
>
{{'MissingOperatorValidator' | translate}}
</span>
<span
ng-message=
"formulaFormatValidator"
>
{{'FormulaFormatValidator' | translate}}
</span>
</div>
<div
class=
"form-group validation-group"
ng-show=
"selectedTab === 3"
>
<label
class=
"checkbox-inline bold"
ng-class=
"{ 'disabled': !hasEditPermission || !ToggleSaveAs }"
>
<input
type=
"checkbox"
ng-model=
"editModel.hasValidation"
ng-disabled=
"!hasEditPermission || !ToggleSaveAs"
>
{{'ValidationConfig' | translate}}
</label>
<div
ng-messages=
"editReportFormulaForm.validation.$error"
class=
"has-error label bold"
>
<span
ng-message=
"requiredValidator"
>
{{'RequiredValidator' | translate}}
</span>
<span
ng-message=
"keyValueNotEmptyValidator"
>
{{'KeyValueNotEmptyValidator' | translate}}
</span>
<span
ng-message=
"keyValueSeparatorValidator"
>
{{'KeyValueSeparatorValidator' | translate}}
</span>
<span
ng-message=
"operatorDuplicateValidator"
>
{{'OperatorDuplicateValidator' | translate}}
</span>
<span
ng-message=
"missingExpressionValidator"
>
{{'MissingExpressionValidator' | translate}}
</span>
<span
ng-message=
"missingOperatorValidator"
>
{{'MissingOperatorValidator' | translate}}
</span>
<span
ng-message=
"formulaFormatValidator"
>
{{'FormulaFormatValidator' | translate}}
</span>
</div>
<mention-input
class=
"inputer"
input-class=
"form-control"
input-id=
"validation"
mention-list=
"mentionList"
display-mode=
"'textarea'"
formula-list=
"formulaList"
show-name=
"true"
mention-api=
"mentionApiForValidation"
input-readonly=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasValidation"
ng-model=
"editModel.validation"
fired-name=
"firedValidationName"
fired-tag-type=
"firedValidationType"
fired-formula-params=
"firedValidationParams"
double-click=
"editFormulaParamOrKeyValueForValidation($event)"
include-btn=
"true"
btn-click=
"showSelectKeyValuePopForValidation()"
btn2-click=
"showSelectFormulaPopForValidation()"
custom-validator=
"mentionMenuValidatorForValidation(value, ngModel)"
input-focus=
"cancelHideTranslatorForValidation($event)"
input-blur=
"timerHideTranslatorForValidation();asyncFormulaValidateForValidation();"
></mention-input>
<formula-translator
formula-list=
"formulaList"
account-data-source=
"accountDataSource"
formula-name=
"firedValidationName"
formula-params=
"firedValidationParams"
hide-mode=
"'notVisible'"
translator-focus=
"cancelHideTranslatorForValidation()"
translator-blur=
"timerHideTranslatorForValidation();"
></formula-translator>
<mention-input
class=
"inputer"
input-class=
"form-control"
input-id=
"validation"
mention-list=
"mentionList"
display-mode=
"'textarea'"
formula-list=
"formulaList"
show-name=
"true"
mention-api=
"mentionApiForValidation"
input-readonly=
"!hasEditPermission || !ToggleSaveAs || !editModel.hasValidation"
ng-model=
"editModel.validation"
fired-name=
"firedValidationName"
fired-tag-type=
"firedValidationType"
fired-formula-params=
"firedValidationParams"
double-click=
"editFormulaParamOrKeyValueForValidation($event)"
include-btn=
"true"
btn-click=
"showSelectKeyValuePopForValidation()"
btn2-click=
"showSelectFormulaPopForValidation()"
custom-validator=
"mentionMenuValidatorForValidation(value, ngModel)"
input-focus=
"cancelHideTranslatorForValidation($event)"
input-blur=
"timerHideTranslatorForValidation();asyncFormulaValidateForValidation();"
></mention-input>
<formula-translator
formula-list=
"formulaList"
account-data-source=
"accountDataSource"
formula-name=
"firedValidationName"
formula-params=
"firedValidationParams"
hide-mode=
"'notVisible'"
translator-focus=
"cancelHideTranslatorForValidation()"
translator-blur=
"timerHideTranslatorForValidation();"
></formula-translator>
</div>
<div
class=
"form-group validation-instructions"
ng-show=
"selectedTab === 3"
>
<label
class=
"bold"
>
{{'ValidationInstructions' | translate}}:
</label>
<textarea
class=
"form-control"
ng-model=
"editModel.validationDescription"
ng-readonly=
"!hasEditPermission || !ToggleSaveAs"
></textarea>
</div>
<div
ng-show=
"selectedTab === 3 && hasEditPermission && ToggleSaveAs"
class=
"flex-row-start-center"
style=
"margin: 15px 0 15px -15px;"
>
<span>
{{'IsInputNecessary' | translate}}:
</span>
<div
class=
"btn-group switch-group"
data-toggle=
"buttons"
>
<label
class=
"btn btn-primary"
ng-class=
"{'active':editModel.hasFormula}"
ng-click=
"editModel.hasFormula=true;"
>
<input
type=
"radio"
autocomplete=
"off"
/>
{{'on'|translate}}
</label>
<label
class=
"btn btn-primary"
ng-class=
"{'active':!editModel.hasFormula}"
ng-click=
"editModel.hasFormula=false;"
>
<input
type=
"radio"
autocomplete=
"off"
/>
{{'off'|translate}}
</label>
</div>
<div
class=
"form-group validation-instructions"
ng-show=
"selectedTab === 3"
>
<label
class=
"bold"
>
{{'ValidationInstructions' | translate}}:
</label>
<textarea
class=
"form-control"
ng-model=
"editModel.validationDescription"
ng-readonly=
"!hasEditPermission || !ToggleSaveAs"
></textarea>
</div>
<div
ng-show=
"selectedTab === 3 && hasEditPermission && ToggleSaveAs"
class=
"flex-row-start-center"
style=
"margin: 15px 0 15px -15px;"
>
<span>
{{'IsInputNecessary' | translate}}:
</span>
<div
class=
"btn-group switch-group"
data-toggle=
"buttons"
>
<label
class=
"btn btn-primary"
ng-class=
"{'active':editModel.hasFormula}"
ng-click=
"editModel.hasFormula=true;"
>
<input
type=
"radio"
autocomplete=
"off"
/>
{{'on'|translate}}
</label>
<label
class=
"btn btn-primary"
ng-class=
"{'active':!editModel.hasFormula}"
ng-click=
"editModel.hasFormula=false;"
>
<input
type=
"radio"
autocomplete=
"off"
/>
{{'off'|translate}}
</label>
</div>
</div>
</form>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-primary"
ng-disabled=
"hasError()"
ng-show=
"hasEditPermission && ToggleSaveAs"
ng-click=
"saveFormulaToTemp()"
>
{{'Confirm' | translate }}
</button>
<button
type=
"button"
class=
"btn btn-third"
ng-show=
"hasEditPermission && ToggleSaveAs"
ng-click=
"hidePanel();"
>
{{'Cancel' | translate }}
</button>
</div>
</div>
</form>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-primary"
ng-disabled=
"hasError()"
ng-show=
"hasEditPermission && ToggleSaveAs"
ng-click=
"saveFormulaToTemp()"
>
{{'Confirm' | translate }}
</button>
<button
type=
"button"
class=
"btn btn-third"
ng-show=
"hasEditPermission && ToggleSaveAs"
ng-click=
"hidePanel();"
>
{{'Cancel' | translate }}
</button>
</div>
</div>
</div>
<div
class=
"modal fade"
id=
"selectFormulaPop"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
data-backdrop=
"static"
data-keyboard=
"false"
>
<div
class=
"modal fade"
id=
"selectFormulaPop"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
data-backdrop=
"static"
data-keyboard=
"false"
>
<div
class=
"modal-dialog"
style=
"width:570px;"
role=
"grid"
>
<div
class=
"modal-content"
>
<div
class=
"modal-body"
>
...
...
@@ -275,22 +282,28 @@
</div>
</div>
</div>
<account-multi-selector
is-show=
"isShowAccounts"
account-data-source=
"accountDataSource"
selector-api=
"accountSelectorApi"
data-title=
"accountTitle"
selected-account-codes=
"editModel.accountCodes"
selector-options=
"accountSelectorOptions"
></account-multi-selector>
<model-multi-selector
is-show=
"isShowModels"
model-data-source=
"modelDataSource"
selector-api=
"modelSelectorApi"
data-title=
"modelTitle"
selected-model-ids=
"editModel.modelIDs"
selector-options=
"modelSelectorOptions"
></model-multi-selector>
<account-multi-selector
is-show=
"isShowAccounts"
account-data-source=
"accountDataSource"
selector-api=
"accountSelectorApi"
data-title=
"accountTitle"
selected-account-codes=
"editModel.accountCodes"
selector-options=
"accountSelectorOptions"
></account-multi-selector>
<model-multi-selector
is-show=
"isShowModels"
model-data-source=
"modelDataSource"
selector-api=
"modelSelectorApi"
data-title=
"modelTitle"
selected-model-ids=
"editModel.modelIDs"
selector-options=
"modelSelectorOptions"
></model-multi-selector>
<operate-log
is-show=
"isShowLog"
></operate-log>
<!-- 编辑报表 -->
<edit-template-modal
template-model=
"templateModel"
on-closed=
"selectTemplate(model)"
is-update=
"isUpdateTemplate"
operate-type=
"operateTemplateType"
></edit-template-modal>
<!--编辑报表模板-->
<edit-templategroup-modal
object-model=
"templateGroupModel"
on-closed=
"selectTemplateGroup(model)"
is-update=
"isUpdateTemplateGroup"
operate-type=
"operateTemplateGroupType"
></edit-templategroup-modal>
<key-value-selector
is-show=
"isShowKeyValue"
selector-api=
"keyValueSelectorApi"
data-title=
"keyValueTitle"
selector-options=
"keyValueSelectorOptions"
selected-key-code=
"defaultKeyCode"
></key-value-selector>
<edit-formula-modal
operate-type=
"operateType"
account-data-source=
"accountDataSource"
select-formula=
"selectFormula"
formula-list=
"formulaList"
on-closed=
"selectParam(formula)"
></edit-formula-modal>
<formula-param-selector
is-show=
"isShowParam"
account-data-source=
"accountDataSource"
formula-list=
"formulaList"
formula-name=
"editFormula"
formula-params=
"editParams"
selector-api=
"paramSelectorApi"
selector-options=
"{ height: 430 }"
container-selector=
"body"
></formula-param-selector>
<key-value-selector
is-show=
"isShowKeyValueForValidation"
selector-api=
"keyValueSelectorApiForValidation"
data-title=
"keyValueTitleForValidation"
selector-options=
"keyValueSelectorOptionsForValidation"
selected-key-code=
"defaultKeyCodeForValidation"
></key-value-selector>
<edit-formula-modal
operate-type=
"operateTypeForValidation"
account-data-source=
"accountDataSource"
select-formula=
"selectFormulaForValidation"
formula-list=
"formulaList"
on-closed=
"selectParamForValidation(formula)"
></edit-formula-modal>
<edit-templategroup-modal
object-model=
"templateGroupModel"
on-closed=
"selectTemplateGroup(model)"
is-update=
"isUpdateTemplateGroup"
operate-type=
"operateTemplateGroupType"
></edit-templategroup-modal>
<key-value-selector
is-show=
"isShowKeyValue"
selector-api=
"keyValueSelectorApi"
data-title=
"keyValueTitle"
selector-options=
"keyValueSelectorOptions"
selected-key-code=
"defaultKeyCode"
></key-value-selector>
<edit-formula-modal
operate-type=
"operateType"
account-data-source=
"accountDataSource"
select-formula=
"selectFormula"
formula-list=
"formulaList"
on-closed=
"selectParam(formula)"
></edit-formula-modal>
<formula-param-selector
is-show=
"isShowParam"
account-data-source=
"accountDataSource"
formula-list=
"formulaList"
formula-name=
"editFormula"
formula-params=
"editParams"
selector-api=
"paramSelectorApi"
selector-options=
"{ height: 430 }"
container-selector=
"body"
></formula-param-selector>
<key-value-selector
is-show=
"isShowKeyValueForValidation"
selector-api=
"keyValueSelectorApiForValidation"
data-title=
"keyValueTitleForValidation"
selector-options=
"keyValueSelectorOptionsForValidation"
selected-key-code=
"defaultKeyCodeForValidation"
></key-value-selector>
<edit-formula-modal
operate-type=
"operateTypeForValidation"
account-data-source=
"accountDataSource"
select-formula=
"selectFormulaForValidation"
formula-list=
"formulaList"
on-closed=
"selectParamForValidation(formula)"
></edit-formula-modal>
<formula-param-selector
is-show=
"isShowParamForValidation"
account-data-source=
"accountDataSource"
formula-list=
"formulaList"
formula-name=
"editFormulaForValidation"
formula-params=
"editParams
ForValidation"
selector-api=
"paramSelectorApiForValidation"
selector-options=
"{ height: 430 }"
container-selector=
"body"
></formula-param-selector>
formula-name=
"editFormulaForValidation"
formula-params=
"editParamsForValidation"
selector-api=
"paramSelectorApi
ForValidation"
selector-options=
"{ height: 430 }"
container-selector=
"body"
></formula-param-selector>
</div>
\ No newline at end of file
atms-web/src/main/webapp/app/common/services/spread-js-tip.svc.js
View file @
c9e60f8f
...
...
@@ -14,54 +14,54 @@ function ($rootScope, $log, $uibModal, $translate) {
var
initialize
=
function
(
sheet
)
{
sheet
.
isPaintSuspended
(
true
);
sheet
.
suspendPaint
(
);
hasVoucherImg
=
new
Image
();
hasVoucherImg
.
src
=
'/app-resources/images/vat/hasVoucher.png'
;
hasVoucherImg
.
onload
=
function
()
{
sheet
.
repaint
();
}
}
;
hasInvoiceImg
=
new
Image
();
hasInvoiceImg
.
src
=
'/app-resources/images/vat/hasInvoice.png'
;
hasInvoiceImg
.
onload
=
function
()
{
sheet
.
repaint
();
}
}
;
hasKeyInImg
=
new
Image
();
hasKeyInImg
.
src
=
'/app-resources/images/vat/hasKeyIn.png'
;
hasKeyInImg
.
onload
=
function
()
{
sheet
.
repaint
();
}
}
;
hasModelImg
=
new
Image
();
hasModelImg
.
src
=
'/app-resources/images/vat/hasModel.png'
;
hasModelImg
.
onload
=
function
()
{
sheet
.
repaint
();
}
}
;
hasExceptionImg
=
new
Image
();
hasExceptionImg
.
src
=
'/app-resources/images/vat/hasException.png'
;
hasExceptionImg
.
onload
=
function
()
{
sheet
.
repaint
();
}
}
;
hasValidationImg
=
new
Image
();
hasValidationImg
.
src
=
'/app-resources/images/vat/hasValidation.png'
;
hasValidationImg
.
onload
=
function
()
{
sheet
.
repaint
();
}
}
;
};
var
paintSheet
=
function
(
sheet
)
{
sheet
.
isPaintSuspended
(
false
);
sheet
.
resumePaint
(
);
};
var
setCellTipString
=
function
(
cell
,
tip
)
{
//cell.cellType(new IconCellType(null, null, 0, null, tip));
cell
.
cellType
(
new
IconsCellType
([],
[],
tip
));
}
}
;
var
setCellTipByCellData
=
function
(
cell
,
cellData
)
{
var
tips
=
null
;
...
...
@@ -100,7 +100,7 @@ function ($rootScope, $log, $uibModal, $translate) {
}
cell
.
cellType
(
new
IconsCellType
(
icons
,
infos
,
tips
));
}
}
;
var
setCellTip
=
function
(
cell
,
config
)
{
var
tips
=
null
;
...
...
@@ -201,7 +201,7 @@ function ($rootScope, $log, $uibModal, $translate) {
this
.
count
=
0
;
this
.
Formula
=
formula
;
}
}
}
;
//var IconCellType = function (icon1, icon2, count, infos, formula) {
...
...
@@ -217,7 +217,7 @@ function ($rootScope, $log, $uibModal, $translate) {
IconsCellType
.
prototype
=
new
GC
.
Spread
.
Sheets
.
CellTypes
.
Base
();
IconsCellType
.
prototype
.
paint
=
function
(
ctx
,
value
,
x
,
y
,
w
,
h
,
style
,
context
)
{
GC
.
Spread
.
Sheets
.
CellTypes
.
Base
.
p
rototype
.
p
aint
.
call
(
this
,
ctx
,
value
,
x
,
y
,
w
,
h
,
style
,
context
);
GC
.
Spread
.
Sheets
.
CellTypes
.
Base
.
paint
.
call
(
this
,
ctx
,
value
,
x
,
y
,
w
,
h
,
style
,
context
);
for
(
var
i
=
1
;
i
<=
this
.
count
;
i
++
)
{
//距离当前单元格左侧距离,距离顶部距离 , ICON宽度,ICON高度
ctx
.
drawImage
(
this
.
Icons
[
i
-
1
],
x
+
w
-
(
h
-
3
)
*
i
+
(
h
-
6
-
18
)
*
i
,
y
+
3
+
(
h
/
2
-
3
-
9
),
18
,
18
);
...
...
@@ -232,7 +232,7 @@ function ($rootScope, $log, $uibModal, $translate) {
// ctx.drawImage(this.icon2, x + w - (h - 3) * i + (h - 6 - 18) * i, y + 3 + (h / 2 - 3 - 9), 18, 18);
//}
}
}
}
;
IconsCellType
.
prototype
.
getHitInfo
=
function
(
x
,
y
,
cellStyle
,
cellRect
,
context
)
{
var
index
=
x
-
(
cellRect
.
x
+
cellRect
.
width
-
(
cellRect
.
height
-
3
)
*
this
.
count
)
>
0
?
Math
.
floor
(
this
.
count
-
(
x
-
(
cellRect
.
x
+
cellRect
.
width
-
(
cellRect
.
height
-
3
)
*
this
.
count
))
/
(
cellRect
.
height
-
3
))
:
...
...
@@ -248,7 +248,7 @@ function ($rootScope, $log, $uibModal, $translate) {
sheetArea
:
context
.
sheetArea
,
reservedLocationIndex
:
index
};
}
}
;
IconsCellType
.
prototype
.
processMouseMove
=
function
(
hitinfo
)
{
//console.log(hitinfo);
...
...
atms-web/src/main/webapp/app/common/webservices/spreadjs.svc.js
View file @
c9e60f8f
...
...
@@ -93,7 +93,7 @@ webservices.factory('spreadJsService', ['$log', '$q', '$http', 'apiConfig', 'doc
this
.
minArgs
=
minArgs
;
};
customFunction
.
prototype
=
new
G
C
.
Spread
.
Sheets
.
Calc
.
Functions
.
Function
();
customFunction
.
prototype
=
new
G
c
Spread
.
Sheets
.
Calc
.
Functions
.
Function
();
customFunction
.
prototype
.
evaluate
=
function
(
args
)
{
var
formulaName
=
this
.
name
+
"("
;
...
...
@@ -128,7 +128,7 @@ webservices.factory('spreadJsService', ['$log', '$q', '$http', 'apiConfig', 'doc
var
deferred
=
$q
.
defer
();
var
promise
=
deferred
.
promise
;
var
spread
=
new
G
C
.
Spread
.
Sheets
.
Spread
(
document
.
getElementById
(
id
));
var
spread
=
new
G
c
Spread
.
Sheets
.
Spread
(
document
.
getElementById
(
id
));
var
sheet
=
spread
.
getActiveSheet
();
spread
.
showVerticalScrollbar
(
true
);
...
...
@@ -149,16 +149,16 @@ webservices.factory('spreadJsService', ['$log', '$q', '$http', 'apiConfig', 'doc
sheet
.
setIsProtected
(
false
);
}
spread
.
bind
(
G
C
.
Spread
.
Sheets
.
Events
.
CellClick
,
function
(
sender
,
args
)
{
if
(
args
.
sheetArea
===
G
C
.
Spread
.
Sheets
.
SheetArea
.
colHeader
)
{
spread
.
bind
(
G
c
Spread
.
Sheets
.
Events
.
CellClick
,
function
(
sender
,
args
)
{
if
(
args
.
sheetArea
===
G
c
Spread
.
Sheets
.
SheetArea
.
colHeader
)
{
$log
.
debug
(
"The column header was clicked."
);
}
if
(
args
.
sheetArea
===
G
C
.
Spread
.
Sheets
.
SheetArea
.
rowHeader
)
{
if
(
args
.
sheetArea
===
G
c
Spread
.
Sheets
.
SheetArea
.
rowHeader
)
{
$log
.
debug
(
"The row header was clicked."
);
}
if
(
args
.
sheetArea
===
G
C
.
Spread
.
Sheets
.
SheetArea
.
corner
)
{
if
(
args
.
sheetArea
===
G
c
Spread
.
Sheets
.
SheetArea
.
corner
)
{
$log
.
debug
(
"The corner header was clicked."
);
}
...
...
@@ -167,7 +167,7 @@ webservices.factory('spreadJsService', ['$log', '$q', '$http', 'apiConfig', 'doc
$log
.
debug
(
sheet
.
getTag
(
args
.
row
,
args
.
col
));
});
spread
.
bind
(
G
C
.
Spread
.
Sheets
.
Events
.
EditEnding
,
function
(
sender
,
args
)
{
spread
.
bind
(
G
c
Spread
.
Sheets
.
Events
.
EditEnding
,
function
(
sender
,
args
)
{
var
sheet
=
spread
.
getActiveSheet
();
...
...
@@ -212,7 +212,7 @@ webservices.factory('spreadJsService', ['$log', '$q', '$http', 'apiConfig', 'doc
var
customfunctions
;
//1. 获取自定义函数名及对应的计算值
//1. 获取自定义函数名及对应的计算值
getFormulaValueByDocumentCode
(
code
).
then
(
function
(
formuladata
)
{
formulaValues
=
JSON
.
parse
(
formuladata
);
$log
.
debug
(
formulaValues
);
...
...
@@ -234,7 +234,7 @@ webservices.factory('spreadJsService', ['$log', '$q', '$http', 'apiConfig', 'doc
initSpreadCustomFunction
(
sheet
,
func
.
name
,
0
,
func
.
parameterCount
);
}
//5. Get Document Cell
//5. Get Document Cell
getDocumentCellByDocumentId
(
documentObj
.
documentID
).
then
(
function
(
celldata
)
{
renderFormulaCell
(
sheet
,
celldata
.
data
);
});
...
...
@@ -281,14 +281,14 @@ webservices.factory('spreadJsService', ['$log', '$q', '$http', 'apiConfig', 'doc
};
var
initSpreadCustomFunctionAsync
=
function
(
sheet
,
name
)
{
var
asum
=
function
()
{
}
//Define a class "ASUM" that extends AsyncFunction
asum
.
prototype
=
new
G
C
.
Spread
.
Sheets
.
Calc
.
Functions
.
AsyncFunction
(
name
,
1
,
255
);
asum
.
prototype
=
new
G
c
Spread
.
Sheets
.
Calc
.
Functions
.
AsyncFunction
(
name
,
1
,
255
);
//Set default value to "Loading..."
asum
.
prototype
.
defaultValue
=
function
()
{
return
"Loading..."
;
};
//Override the evaluateAsync function
...
...
atms-web/src/main/webapp/app/common/webservices/template.svc.js
View file @
c9e60f8f
...
...
@@ -13,78 +13,37 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
return
""
;
};
var
getTemplateJson
=
function
(
templateID
)
{
//return $http.get('/template/getTemplateJson?templateID=' + templateID, apiConfig.create());
// var result = httpCacheService.get('/template/getTemplateJson?templateID=' + templateID);
// if (result.finishedCache) {
// return result;
// } else {
// var thisConfig = apiConfig.create();
// thisConfig.responseType = "blob";
// return $http.post('/template/getTemplateJson?templateID=' + templateID, {}, apiConfig.create());
// }
var
deferred
=
$q
.
defer
();
var
promise
=
deferred
.
promise
;
// var ajaxUrl = loginContext.apiHost + constant.webapi.prefix + '/template/getTemplateJson?templateID=' + templateID;
// var apiTokenObj = JSON.parse(getCookie('AtmsApiToken'));
// var apiToken = apiTokenObj.access_token;
// var tokenType = apiTokenObj.token_type;
// var ajaxSource = $.ajax({
// url: ajaxUrl,
// type: "POST",
// dataType:"blob",
// beforeSend: function (xhr) {
// xhr.setRequestHeader('Authorization', tokenType + ' ' + apiToken);
// //xhr.setRequestHeader('from', 'aabb@cn.pwc.com');
// //xhr.responseType = "blob";
// },
// success: function(data){
// deferred.resolve(data);
// },
// complete: function(data){
// deferred.resolve(data.responseText);
// }
// });
// ajaxSource.done(function (data) {
// deferred.resolve(data);
// });
return
promise
;
};
var
initSpreadExcel
=
function
(
id
,
ssjsondata
)
{
var
deferred
=
$q
.
defer
();
var
promise
=
deferred
.
promise
;
var
spread
=
new
GC
.
Spread
.
Sheets
.
Workbook
(
document
.
getElementById
(
id
));
spread
.
showVerticalScrollbar
(
true
)
;
spread
.
showHorizontalScrollbar
(
true
)
;
spread
.
scrollbarMaxAlign
(
true
)
;
spread
.
scrollbarShowMax
(
true
)
;
spread
.
tabNavigationVisible
(
true
)
;
spread
.
newTabVisible
(
false
)
;
spread
.
tabEditable
(
false
)
;
spread
.
tabStripVisible
(
false
)
;
spread
.
newTabVisible
(
false
)
;
// spread.allowUndo(false)
;
// spread.allowUserResize(false)
;
// spread.canUserDragDrop(false)
;
// spread.canUserDragFill(false)
;
// spread.canUserEditFormula(false)
;
//
// spread.isPaintSuspended(true
);
// spread.fromJSON(JSON.parse(ssjsondata)
);
// spread.isPaintSuspended(false
);
spread
.
options
.
showVerticalScrollbar
=
true
;
spread
.
options
.
showHorizontalScrollbar
=
true
;
spread
.
options
.
scrollbarMaxAlign
=
true
;
spread
.
options
.
scrollbarShowMax
=
true
;
spread
.
options
.
tabNavigationVisible
=
true
;
spread
.
options
.
newTabVisible
=
false
;
spread
.
options
.
tabEditable
=
false
;
spread
.
options
.
tabStripVisible
=
false
;
spread
.
options
.
newTabVisible
=
false
;
spread
.
options
.
allowUndo
=
false
;
spread
.
options
.
allowUserResize
=
false
;
spread
.
options
.
allowUserDragDrop
=
false
;
spread
.
options
.
allowUserDragFill
=
false
;
spread
.
options
.
allowUserEditFormula
=
false
;
spread
.
suspendPaint
(
);
spread
.
fromJSON
(
ssjsondata
);
spread
.
resumePaint
(
);
var
sheet
=
spread
.
getActiveSheet
();
if
(
sheet
!=
null
)
{
// sheet.setRowHeaderVisible(true);
// sheet.setColumnHeaderVisible(true);
// sheet.setGridlineOptions({
// showVerticalGridline: false, showHorizontalGridline: false
// });
sheet
.
options
.
rowHeaderVisible
=
true
;
sheet
.
options
.
colHeaderVisible
=
true
;
sheet
.
options
.
gridline
.
showVerticalGridline
=
false
;
sheet
.
options
.
gridline
.
showHorizontalGridline
=
false
;
}
deferred
.
resolve
(
spread
);
...
...
@@ -96,7 +55,7 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
var
promise
=
deferred
.
promise
;
var
spreadSheet
;
var
url
=
loginContext
.
apiHost
+
constant
.
webapi
.
prefix
+
'/template/getTemplateJson?templateID='
+
templateID
;
var
url
=
loginContext
.
apiHost
+
constant
.
webapi
.
prefix
+
'/template/getTemplateJson?templateID='
+
templateID
;
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'POST'
,
url
,
true
);
// 也可以使用POST方式,根据接口
xhr
.
responseType
=
"blob"
;
// 返回类型blob
...
...
@@ -104,7 +63,6 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
var
apiToken
=
apiTokenObj
.
access_token
;
var
tokenType
=
apiTokenObj
.
token_type
;
xhr
.
setRequestHeader
(
'Authorization'
,
tokenType
+
' '
+
apiToken
);
// xhr.setRequestHeader("Authorization","bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTUyNzMxNDA4NCwiaWF0IjoxNTI3MTQxMjg0LCJuYmYiOjE1MjcxNDA2ODQsImp0aSI6IjVGM0FGMTBDLTdFMEEtNDVDQy04RDVGLUREMTBFMDRCOUY4NCIsInVzZXJuYW1lIjoiYWRtaW4iLCJkYXRhYmFzZVVzZXJuYW1lIjoiQWRtaW4iLCJ1c2VyaWQiOiI2NjkzM0U3Qi1EQTc1LTRCMkUtQjdENi1BQjY1RENBMjBENTAifQ.M-dyU6W51LAPVQ66HIJZ-KAg6WjPSIt1GqpOc6etQ6XJfXp8KkUPA6A8qPZ8bhydWsKKMqpPlx-KRVhK2o5q0Q")
// 定义请求完成的处理函数,请求前也可以增加加载框/禁用下载按钮逻辑
xhr
.
onload
=
function
()
{
// 请求完成
...
...
@@ -121,39 +79,10 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
// process error
alert
(
e
.
errorMessage
);
},
{});
// var reader = new FileReader();
// reader.readAsDataURL(blob); // 转换为base64,可以直接放入a表情href
// reader.onload = function (e) {
// // 转换完成,创建一个a标签用于下载
// var a = document.createElement('a');
// a.download = 'data.xlsx';
// a.href = e.target.result;
// $("body").append(a); // 修复firefox中无法触发click
// a.click();
// $(a).remove();
// }
}
};
// 发送ajax请求
xhr
.
send
();
// getTemplateJson(templateID).then(function (result) {
// //var data = new Blob(result, {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"});
// var excelIo = new GC.Spread.Excel.IO();
// excelIo.open(result, function (json) {
// //var workbookObj = json;
// //spread.fromJSON(workbookObj);
// spreadSheet = initSpreadExcel(id, json);
// deferred.resolve(spreadSheet);
// }, function (e) {
// // process error
// alert(e.errorMessage);
// }, {});
// spreadSheet = initSpreadExcel(id, result.data === undefined ? result : result.data);
//
// deferred.resolve(spreadSheet);
// });
return
promise
;
};
...
...
@@ -162,7 +91,6 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
};
return
{
getTemplateJson
:
getTemplateJson
,
renderSpreadExcelSimple
:
renderSpreadExcelSimple
,
initSpreadExcel
:
initSpreadExcel
,
setRowColName
:
setRowColName
...
...
atms-web/src/main/webapp/bundles/common.js
View file @
c9e60f8f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
atms-web/src/main/webapp/bundles/systemConfiguration.js
View file @
c9e60f8f
...
...
@@ -3,7 +3,7 @@ systemConfigurationModule
'templateService'
,
'templateFormulaService'
,
'stdAccountService'
,
'spreadJsTipService'
,
'enums'
,
'KeyValueConfigService'
,
'modelConfigurationService'
,
'industryService'
,
'formulaService'
,
'serviceTypeService'
,
'mentioUtil'
,
'region'
,
function
(
$scope
,
$log
,
$timeout
,
$translate
,
$rootScope
,
$interval
,
$compile
,
$uibModal
,
$q
,
SweetAlert
,
templateGroupService
,
templateService
,
templateFormulaService
,
stdAccountService
,
spreadJsTipService
,
enums
,
KeyValueConfigService
,
modelConfigurationService
,
industryService
,
formulaService
,
serviceTypeService
,
mentioUtil
,
region
)
{
stdAccountService
,
spreadJsTipService
,
enums
,
KeyValueConfigService
,
modelConfigurationService
,
industryService
,
formulaService
,
serviceTypeService
,
mentioUtil
,
region
)
{
'use strict'
;
var
keyValueExp
=
/@
\S
*/g
;
...
...
@@ -23,7 +23,6 @@ systemConfigurationModule
};
var
serviceTypeMapping
=
{
VAT
:
$translate
.
instant
(
'VAT'
),
RPT
:
$translate
.
instant
(
'RPT'
),
...
...
@@ -425,56 +424,56 @@ systemConfigurationModule
categoryOptions
:
[],
rateOptions
:
[],
amountTypeOptions
:
[
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
]
},
{
type
:
'Income'
,
value
:
1
,
categoryOptions
:
_
.
chain
(
enums
.
invoiceType
).
pairs
().
map
(
function
(
it
)
{
return
{
key
:
$translate
.
instant
(
it
[
0
]),
value
:
it
[
1
],
ticked
:
false
};
return
{
key
:
$translate
.
instant
(
it
[
0
]),
value
:
it
[
1
],
ticked
:
false
};
}).
value
(),
rateOptions
:
[
{
key
:
'17%'
,
value
:
'17%'
,
ticked
:
false
},
{
key
:
'13%'
,
value
:
'13%'
,
ticked
:
false
},
{
key
:
'11%'
,
value
:
'11%'
,
ticked
:
false
},
{
key
:
'6%'
,
value
:
'6%'
,
ticked
:
false
},
{
key
:
'5%'
,
value
:
'5%'
,
ticked
:
false
},
{
key
:
'4%'
,
value
:
'4%'
,
ticked
:
false
},
{
key
:
'3%'
,
value
:
'3%'
,
ticked
:
false
},
{
key
:
'1.5%'
,
value
:
'1.5%'
,
ticked
:
false
}
{
key
:
'17%'
,
value
:
'17%'
,
ticked
:
false
},
{
key
:
'13%'
,
value
:
'13%'
,
ticked
:
false
},
{
key
:
'11%'
,
value
:
'11%'
,
ticked
:
false
},
{
key
:
'6%'
,
value
:
'6%'
,
ticked
:
false
},
{
key
:
'5%'
,
value
:
'5%'
,
ticked
:
false
},
{
key
:
'4%'
,
value
:
'4%'
,
ticked
:
false
},
{
key
:
'3%'
,
value
:
'3%'
,
ticked
:
false
},
{
key
:
'1.5%'
,
value
:
'1.5%'
,
ticked
:
false
}
],
amountTypeOptions
:
[
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
]
},
{
type
:
'Output'
,
value
:
2
,
categoryOptions
:
_
.
chain
(
enums
.
outputInvoiceType
).
pairs
().
map
(
function
(
it
)
{
return
{
key
:
$translate
.
instant
(
it
[
0
]),
value
:
it
[
1
],
ticked
:
false
};
return
{
key
:
$translate
.
instant
(
it
[
0
]),
value
:
it
[
1
],
ticked
:
false
};
}).
value
(),
rateOptions
:
[
{
key
:
'17%'
,
value
:
'17%'
,
ticked
:
false
},
{
key
:
'13%'
,
value
:
'13%'
,
ticked
:
false
},
{
key
:
'11%'
,
value
:
'11%'
,
ticked
:
false
},
{
key
:
'6%'
,
value
:
'6%'
,
ticked
:
false
},
{
key
:
'5%'
,
value
:
'5%'
,
ticked
:
false
},
{
key
:
'4%'
,
value
:
'4%'
,
ticked
:
false
},
{
key
:
'3%'
,
value
:
'3%'
,
ticked
:
false
},
{
key
:
'1.5%'
,
value
:
'1.5%'
,
ticked
:
false
}
{
key
:
'17%'
,
value
:
'17%'
,
ticked
:
false
},
{
key
:
'13%'
,
value
:
'13%'
,
ticked
:
false
},
{
key
:
'11%'
,
value
:
'11%'
,
ticked
:
false
},
{
key
:
'6%'
,
value
:
'6%'
,
ticked
:
false
},
{
key
:
'5%'
,
value
:
'5%'
,
ticked
:
false
},
{
key
:
'4%'
,
value
:
'4%'
,
ticked
:
false
},
{
key
:
'3%'
,
value
:
'3%'
,
ticked
:
false
},
{
key
:
'1.5%'
,
value
:
'1.5%'
,
ticked
:
false
}
],
amountTypeOptions
:
[
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
]
},
{
...
...
@@ -483,10 +482,10 @@ systemConfigurationModule
categoryOptions
:
[],
rateOptions
:
[],
amountTypeOptions
:
[
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
{
name
:
'PleaseSelect'
,
value
:
0
},
{
name
:
'TotalAmount'
,
value
:
1
},
{
name
:
'TaxAmount'
,
value
:
2
},
{
name
:
'CopyNumber'
,
value
:
3
}
]
}
];
...
...
@@ -496,7 +495,7 @@ systemConfigurationModule
// 选中某一发票类型级联更新税率与金额类型列表
var
selectInvoiceOption
=
function
(
editModel
,
invoiceType
,
isInit
)
{
var
selectedInvoice
=
_
.
where
(
$scope
.
invoiceOptions
,
{
value
:
invoiceType
});
var
selectedInvoice
=
_
.
where
(
$scope
.
invoiceOptions
,
{
value
:
invoiceType
});
var
op
=
selectedInvoice
.
length
===
0
?
$scope
.
invoiceOptions
[
0
]
:
selectedInvoice
[
0
];
// 如果获取到的editModel.invoiceCategory为[ 99 ],代表发票类型全选;
...
...
@@ -528,7 +527,7 @@ systemConfigurationModule
});
var
choseAmoutType
=
isInit
&&
editModel
.
invoiceAmountType
&&
editModel
.
invoiceAmountType
>
0
?
_
.
where
(
op
.
amountTypeOptions
,
{
value
:
editModel
.
invoiceAmountType
})[
0
]
:
op
.
amountTypeOptions
[
0
];
_
.
where
(
op
.
amountTypeOptions
,
{
value
:
editModel
.
invoiceAmountType
})[
0
]
:
op
.
amountTypeOptions
[
0
];
editModel
.
chosenInvoiceOption
=
{
type
:
op
.
type
,
...
...
@@ -564,12 +563,12 @@ systemConfigurationModule
});
_spread
=
spread
;
var
activeSheet
=
_spread
.
get
ActiveSheet
(
);
var
activeSheet
=
_spread
.
get
Sheet
(
1
);
//设置整个sheet不可编辑
activeSheet
.
setIsProtected
(
true
)
;
activeSheet
.
protectionOption
(
{
activeSheet
.
isProtected
=
true
;
activeSheet
.
options
.
protectionOption
=
{
allowEditObjects
:
false
}
)
;
};
$scope
.
activeSheet
=
activeSheet
;
...
...
@@ -644,7 +643,7 @@ systemConfigurationModule
if
(
isHideContextMenu
)
{
hideSpreadContextMenu
();
}
else
{
$contextMenu
.
css
({
left
:
e
.
pageX
,
top
:
e
.
pageY
});
$contextMenu
.
css
({
left
:
e
.
pageX
,
top
:
e
.
pageY
});
$contextMenu
.
show
();
$
(
document
).
on
(
"click.contextmenu"
,
function
()
{
...
...
@@ -728,7 +727,7 @@ systemConfigurationModule
for
(
var
i
=
0
;
i
<
spans
[
k
].
rowCount
;
i
++
)
{
for
(
var
j
=
0
;
j
<
spans
[
k
].
colCount
;
j
++
)
{
if
(
i
>
0
||
j
>
0
)
{
exceptedCells
.
push
({
rowIndex
:
spans
[
k
].
row
+
i
,
columnIndex
:
spans
[
k
].
col
+
j
});
exceptedCells
.
push
({
rowIndex
:
spans
[
k
].
row
+
i
,
columnIndex
:
spans
[
k
].
col
+
j
});
}
}
}
...
...
@@ -747,8 +746,8 @@ systemConfigurationModule
var
col
=
startCol
+
j
;
if
(
_
.
every
(
exceptedCells
,
function
(
c
)
{
return
c
.
rowIndex
!==
row
||
c
.
columnIndex
!==
col
;
}))
{
validPosition
.
push
({
rowIndex
:
row
,
columnIndex
:
col
});
}))
{
validPosition
.
push
({
rowIndex
:
row
,
columnIndex
:
col
});
}
}
}
...
...
@@ -761,20 +760,20 @@ systemConfigurationModule
var
confirmWarningWindow
=
function
(
title
,
text
)
{
var
deferred
=
$q
.
defer
();
SweetAlert
.
swal
({
title
:
title
,
text
:
text
,
type
:
"warning"
,
showCancelButton
:
true
,
confirmButtonColor
:
"#DD6B55"
,
allowOutsideClick
:
false
,
confirmButtonText
:
$translate
.
instant
(
'Confirm'
),
cancelButtonText
:
$translate
.
instant
(
'Cancel'
),
closeOnConfirm
:
true
,
closeOnCancel
:
true
},
function
(
isConfirm
)
{
deferred
.
resolve
(
isConfirm
);
});
title
:
title
,
text
:
text
,
type
:
"warning"
,
showCancelButton
:
true
,
confirmButtonColor
:
"#DD6B55"
,
allowOutsideClick
:
false
,
confirmButtonText
:
$translate
.
instant
(
'Confirm'
),
cancelButtonText
:
$translate
.
instant
(
'Cancel'
),
closeOnConfirm
:
true
,
closeOnCancel
:
true
},
function
(
isConfirm
)
{
deferred
.
resolve
(
isConfirm
);
});
return
deferred
.
promise
;
};
...
...
@@ -803,7 +802,7 @@ systemConfigurationModule
selectInvoiceOption
(
$scope
.
editModel
,
$scope
.
editModel
.
invoiceType
,
true
);
// invoiceOption: Used to save invoice tax rate and amount type options temporarily
$scope
.
invoiceOption
=
_
.
findWhere
(
$scope
.
invoiceOptions
,
{
type
:
$scope
.
editModel
.
chosenInvoiceOption
.
type
});
$scope
.
invoiceOption
=
_
.
findWhere
(
$scope
.
invoiceOptions
,
{
type
:
$scope
.
editModel
.
chosenInvoiceOption
.
type
});
$scope
.
mentionApi
.
triggerValidator
(
$scope
.
editModel
.
formula
,
$scope
.
editReportFormulaForm
.
formula
);
$scope
.
mentionApiForValidation
.
triggerValidator
(
$scope
.
editModel
.
validation
,
$scope
.
editReportFormulaForm
.
validation
);
...
...
@@ -865,10 +864,10 @@ systemConfigurationModule
}
},
columns
:
[
{
caption
:
$translate
.
instant
(
'SubjectCodeCol'
),
dataField
:
'code'
},
{
caption
:
$translate
.
instant
(
'SubjectNameCol'
),
dataField
:
'name'
},
{
caption
:
$translate
.
instant
(
'SubjectDirectionCol'
),
dataField
:
'directionName'
},
{
caption
:
$translate
.
instant
(
'SubjectTypeCol'
),
dataField
:
'AcctPropName'
},
{
caption
:
$translate
.
instant
(
'SubjectCodeCol'
),
dataField
:
'code'
},
{
caption
:
$translate
.
instant
(
'SubjectNameCol'
),
dataField
:
'name'
},
{
caption
:
$translate
.
instant
(
'SubjectDirectionCol'
),
dataField
:
'directionName'
},
{
caption
:
$translate
.
instant
(
'SubjectTypeCol'
),
dataField
:
'AcctPropName'
},
{
alignment
:
'center'
,
width
:
'40px'
,
...
...
@@ -921,12 +920,12 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasVoucher"/>');
}
},
columns
:
[
{
caption
:
$translate
.
instant
(
'ModelCode'
),
dataField
:
'code'
,
visible
:
false
},
{
caption
:
$translate
.
instant
(
'ModelName'
),
dataField
:
'name'
},
{
caption
:
$translate
.
instant
(
'ModelDescription'
),
dataField
:
'description'
},
{
caption
:
$translate
.
instant
(
'ModelFeature'
),
dataField
:
'featureName'
},
{
caption
:
$translate
.
instant
(
'ModelType'
),
dataField
:
'modelTypeName'
},
{
caption
:
$translate
.
instant
(
'ModelOrganization'
),
dataField
:
'organizationName'
},
{
caption
:
$translate
.
instant
(
'ModelCode'
),
dataField
:
'code'
,
visible
:
false
},
{
caption
:
$translate
.
instant
(
'ModelName'
),
dataField
:
'name'
},
{
caption
:
$translate
.
instant
(
'ModelDescription'
),
dataField
:
'description'
},
{
caption
:
$translate
.
instant
(
'ModelFeature'
),
dataField
:
'featureName'
},
{
caption
:
$translate
.
instant
(
'ModelType'
),
dataField
:
'modelTypeName'
},
{
caption
:
$translate
.
instant
(
'ModelOrganization'
),
dataField
:
'organizationName'
},
{
alignment
:
'center'
,
width
:
'40px'
,
...
...
@@ -1081,7 +1080,7 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
var
operatorMatches
=
ngModelValue
.
match
(
notDuplicateOperatorExp
);
if
(
_
.
any
(
operatorMatches
,
function
(
m
)
{
return
m
.
length
>
1
;
}))
{
}))
{
ngModel
.
$setValidity
(
'operatorDuplicateValidator'
,
false
);
return
false
;
}
...
...
@@ -1262,7 +1261,7 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
var
operatorMatches
=
ngModelValue
.
match
(
notDuplicateOperatorExp
);
if
(
_
.
any
(
operatorMatches
,
function
(
m
)
{
return
m
.
length
>
1
;
}))
{
}))
{
ngModel
.
$setValidity
(
'operatorDuplicateValidator'
,
false
);
return
false
;
}
...
...
@@ -1337,33 +1336,33 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
/*********************** End Formula Editor ***********************************/
//模板另存为
//模板另存为
var
saveTemplateGroup
=
function
()
{
var
groupName
=
$scope
.
groupName
;
if
(
groupName
===
''
||
groupName
===
undefined
)
{
SweetAlert
.
warning
(
$translate
.
instant
(
'InputTemplateGroupNameWarning'
));
return
;
}
$scope
.
newTemplateGroup
.
Name
=
groupName
;
$scope
.
newTemplateGroup
.
ServiceTypeID
=
$scope
.
curServiceTypeId
;
$scope
.
newTemplateGroup
.
CopyFrom
=
$scope
.
curTemplateGroup
.
id
;
$scope
.
newTemplateGroup
.
groupType
=
$scope
.
curTemplateGroup
.
groupType
;
$scope
.
newTemplateGroup
.
payTaxType
=
$scope
.
curTemplateGroup
.
payTaxType
;
$scope
.
newTemplateGroup
.
industryIDs
=
$scope
.
curTemplateGroup
.
industryIDs
;
$scope
.
newTemplateGroup
.
ChangedFormulas
=
$scope
.
formulasArrayTemp
;
templateGroupService
.
addTemplateGroup
(
$scope
.
newTemplateGroup
).
success
(
function
(
or
)
{
if
(
or
&&
or
.
result
)
{
SweetAlert
.
success
(
$translate
.
instant
(
'TemplateGroupSaveAsSuccess'
));
loadTemplateGroup
();
$
(
'#templateName'
).
val
(
''
);
$
(
'.templates-save-form'
).
css
(
'display'
,
'none'
);
}
else
{
SweetAlert
.
warning
(
$translate
.
instant
(
or
.
resultMsg
));
var
groupName
=
$scope
.
groupName
;
if
(
groupName
===
''
||
groupName
===
undefined
)
{
SweetAlert
.
warning
(
$translate
.
instant
(
'InputTemplateGroupNameWarning'
));
return
;
}
});
};
$scope
.
newTemplateGroup
.
Name
=
groupName
;
$scope
.
newTemplateGroup
.
ServiceTypeID
=
$scope
.
curServiceTypeId
;
$scope
.
newTemplateGroup
.
CopyFrom
=
$scope
.
curTemplateGroup
.
id
;
$scope
.
newTemplateGroup
.
groupType
=
$scope
.
curTemplateGroup
.
groupType
;
$scope
.
newTemplateGroup
.
payTaxType
=
$scope
.
curTemplateGroup
.
payTaxType
;
$scope
.
newTemplateGroup
.
industryIDs
=
$scope
.
curTemplateGroup
.
industryIDs
;
$scope
.
newTemplateGroup
.
ChangedFormulas
=
$scope
.
formulasArrayTemp
;
templateGroupService
.
addTemplateGroup
(
$scope
.
newTemplateGroup
).
success
(
function
(
or
)
{
if
(
or
&&
or
.
result
)
{
SweetAlert
.
success
(
$translate
.
instant
(
'TemplateGroupSaveAsSuccess'
));
loadTemplateGroup
();
$
(
'#templateName'
).
val
(
''
);
$
(
'.templates-save-form'
).
css
(
'display'
,
'none'
);
}
else
{
SweetAlert
.
warning
(
$translate
.
instant
(
or
.
resultMsg
));
}
});
};
var
loadTemplateMenu
=
function
()
{
...
...
@@ -1411,21 +1410,21 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
// 如果发票类型全选,则将editModel.invoiceCategory设置为[ 99 ];
// 否则将选中的发票类型存入editModel.invoiceCategory数组,如[1, 2, 3]
if
(
$scope
.
editModel
.
chosenInvoiceOption
.
categoryOptions
.
length
>
0
&&
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
categoryOptions
,
{
ticked
:
true
}))
{
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
categoryOptions
,
{
ticked
:
true
}))
{
$scope
.
editModel
.
invoiceCategory
=
[
Number
(
constant
.
selectAllValue
)];
}
else
{
$scope
.
editModel
.
invoiceCategory
=
_
.
chain
(
$scope
.
editModel
.
chosenInvoiceOption
.
categoryOptions
)
.
where
({
ticked
:
true
}).
pluck
(
'value'
).
value
();
.
where
({
ticked
:
true
}).
pluck
(
'value'
).
value
();
}
// 如果税率全选,则将editModel.taxRate设置为[ '99' ];
// 否则将选中的税率存入editModel.taxRate数组,如['17%', '11%', '6%']
if
(
$scope
.
editModel
.
chosenInvoiceOption
.
rateOptions
.
length
>
0
&&
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
rateOptions
,
{
ticked
:
true
}))
{
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
rateOptions
,
{
ticked
:
true
}))
{
$scope
.
editModel
.
taxRate
=
[
constant
.
selectAllValue
];
}
else
{
$scope
.
editModel
.
taxRate
=
_
.
chain
(
$scope
.
editModel
.
chosenInvoiceOption
.
rateOptions
)
.
where
({
ticked
:
true
}).
pluck
(
'value'
).
value
();
.
where
({
ticked
:
true
}).
pluck
(
'value'
).
value
();
}
$scope
.
editModel
.
invoiceType
=
$scope
.
editModel
.
chosenInvoiceOption
.
value
;
...
...
@@ -1549,17 +1548,17 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
var
groupedParamList
=
_
.
groupBy
(
result
[
2
].
data
.
data
,
'formulaID'
);
var
paramList
=
result
[
1
].
data
.
data
;
_
.
each
(
groupedParamList
,
function
(
val
,
key
)
{
var
formula
=
_
.
findWhere
(
formulaList
,
{
id
:
key
});
var
formula
=
_
.
findWhere
(
formulaList
,
{
id
:
key
});
if
(
formula
)
{
formula
.
params
=
_
.
chain
(
val
)
.
map
(
function
(
p
)
{
return
{
id
:
p
.
formulaParamID
,
index
:
p
.
paramIndex
};
return
{
id
:
p
.
formulaParamID
,
index
:
p
.
paramIndex
};
})
.
sortBy
(
function
(
p
)
{
return
p
.
index
;
}).
value
();
_
.
each
(
formula
.
params
,
function
(
p
,
idx
)
{
var
param
=
_
.
findWhere
(
paramList
,
{
id
:
p
.
id
});
var
param
=
_
.
findWhere
(
paramList
,
{
id
:
p
.
id
});
_
.
extend
(
p
,
param
);
});
}
...
...
@@ -1578,14 +1577,14 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
var
modelTypes
=
_
.
invert
(
enums
.
modelType
);
_
.
each
(
data
,
function
(
m
)
{
if
(
m
.
type
.
toString
()
===
modelTypes
.
SystemCommonModel
)
{
if
(
!
_
.
some
(
rtn
,
{
id
:
m
.
id
}))
{
if
(
!
_
.
some
(
rtn
,
{
id
:
m
.
id
}))
{
m
.
orgID
=
null
;
m
.
organizationName
=
$translate
.
instant
(
'All'
);
m
.
featureName
=
$translate
.
instant
(
enums
.
modelFeature
[
m
.
feature
]);
rtn
.
push
(
m
);
}
}
else
{
var
existsModel
=
_
.
findWhere
(
rtn
,
{
id
:
m
.
id
});
var
existsModel
=
_
.
findWhere
(
rtn
,
{
id
:
m
.
id
});
if
(
!
existsModel
)
{
m
.
featureName
=
$translate
.
instant
(
enums
.
modelFeature
[
m
.
feature
]);
rtn
.
push
(
m
);
...
...
@@ -1691,8 +1690,8 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
newValue
.
value
<=
0
||
newValue
.
invoiceAmountType
.
value
<=
0
||
newValue
.
value
!==
3
&&
(
_
.
every
(
newValue
.
categoryOptions
,
{
ticked
:
false
})
||
_
.
every
(
newValue
.
rateOptions
,
{
ticked
:
false
}))))
{
(
_
.
every
(
newValue
.
categoryOptions
,
{
ticked
:
false
})
||
_
.
every
(
newValue
.
rateOptions
,
{
ticked
:
false
}))))
{
$scope
.
editReportFormulaForm
.
invoice
.
$setValidity
(
'invoiceNotSelectValidator'
,
false
);
}
else
{
$scope
.
editReportFormulaForm
.
invoice
.
$setValidity
(
'invoiceNotSelectValidator'
,
true
);
...
...
@@ -1706,8 +1705,8 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
$scope
.
editModel
.
chosenInvoiceOption
.
value
<=
0
||
$scope
.
editModel
.
chosenInvoiceOption
.
invoiceAmountType
.
value
<=
0
||
$scope
.
editModel
.
chosenInvoiceOption
.
value
!==
3
&&
(
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
rateOptions
,
{
ticked
:
false
})
||
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
categoryOptions
,
{
ticked
:
false
})))
{
(
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
rateOptions
,
{
ticked
:
false
})
||
_
.
every
(
$scope
.
editModel
.
chosenInvoiceOption
.
categoryOptions
,
{
ticked
:
false
})))
{
$scope
.
editReportFormulaForm
.
invoice
.
$setValidity
(
'invoiceNotSelectValidator'
,
false
);
}
});
...
...
@@ -2064,7 +2063,8 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
$
(
'#'
+
dxControl
.
templateDropDownId
).
dxDropDownBox
({
value
:
selectName
,
showClearButton
:
false
,
onContentReady
:
function
(
args
)
{
},
onContentReady
:
function
(
args
)
{
},
contentTemplate
:
function
(
e
)
{
// thisData.DropDownEvent = e;
var
value
=
e
.
component
.
option
(
"value"
);
...
...
@@ -2165,10 +2165,10 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
});
var
tabs
=
[
{
id
:
0
,
text
:
$translate
.
instant
(
'AutoCalculateTab'
)
},
{
id
:
1
,
text
:
$translate
.
instant
(
'ManualInputTab'
)
},
{
id
:
2
,
text
:
$translate
.
instant
(
'ModelTab'
)
},
{
id
:
3
,
text
:
$translate
.
instant
(
'ValidationTab'
)
}
{
id
:
0
,
text
:
$translate
.
instant
(
'AutoCalculateTab'
)
},
{
id
:
1
,
text
:
$translate
.
instant
(
'ManualInputTab'
)
},
{
id
:
2
,
text
:
$translate
.
instant
(
'ModelTab'
)
},
{
id
:
3
,
text
:
$translate
.
instant
(
'ValidationTab'
)
}
];
$scope
.
tabOptions
=
{
dataSource
:
tabs
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment