Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hg-smart
Commits
d5219066
Commit
d5219066
authored
Jun 05, 2024
by
yukang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部分BUG处理
parent
bea43b91
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
19 deletions
+32
-19
HGCW002A.js
src/main/webapp/HG/CW/HGCW002A.js
+32
-19
No files found.
src/main/webapp/HG/CW/HGCW002A.js
View file @
d5219066
...
...
@@ -20,26 +20,15 @@ $(function() {
var
tr
,
index
;
// 获取此model元素信息
var
item
=
e
.
items
[
0
];
// 计算总金额
var
taxPoints
=
$
(
"#result-0-taxPoints"
).
val
()
?
$
(
"#result-0-taxPoints"
).
val
()
/
100
:
0
;
var
totalPriceExcluding
=
item
.
provisionalQuantity
*
item
.
unitPriceExcludingTax
;
var
totalPriceIncluding
=
totalPriceExcluding
*
(
1
+
parseFloat
(
taxPoints
));
detail1Grid
.
setCellValue
(
item
,
'totalPriceExcluding'
,
totalPriceExcluding
);
detail1Grid
.
setCellValue
(
item
,
'totalPriceIncluding'
,
totalPriceIncluding
);
console
.
log
(
grid
.
dataSource
.
_data
);
console
.
log
(
detail1Grid
.
getDataItems
());
var
allRows
=
detail1Grid
.
getDataItems
();
var
totalPriceExcluding
=
0
;
var
totalPriceIncluding
=
0
;
var
valueAddedTax
=
0
;
allRows
.
forEach
(
function
(
row
,
index
)
{
totalPriceExcluding
+=
parseFloat
(
row
.
totalPriceExcluding
);
totalPriceIncluding
+=
parseFloat
(
row
.
totalPriceIncluding
);
calculateAmount
(
item
);
}
});
valueAddedTax
=
parseFloat
(
totalPriceIncluding
)
-
parseFloat
(
totalPriceExcluding
);
$
(
"#result-0-totalContractPriceExcluding"
).
val
(
totalPriceExcluding
.
toFixed
(
3
))
$
(
"#result-0-totalContractPriceIncluding"
).
val
(
totalPriceIncluding
.
toFixed
(
3
))
$
(
"#result-0-valueAddedTax"
).
val
(
valueAddedTax
.
toFixed
(
3
))
grid
.
dataSource
.
bind
(
"change"
,
function
(
e
)
{
if
(
e
.
field
==
"provisionalQuantity"
)
{
var
tr
,
index
;
// 获取此model元素信息
var
item
=
e
.
items
[
0
];
calculateAmount
(
item
);
}
});
},
...
...
@@ -371,6 +360,30 @@ function fieldValidation() {
}
}
}
function
calculateAmount
(
item
)
{
// 计算总金额
var
taxPoints
=
$
(
"#result-0-taxPoints"
).
val
()
?
$
(
"#result-0-taxPoints"
).
val
()
/
100
:
0
;
var
provisionalQuantity
=
item
.
provisionalQuantity
||
0
;
var
unitPriceExcludingTax
=
item
.
unitPriceExcludingTax
||
0
;
var
totalPriceExcluding
=
provisionalQuantity
*
unitPriceExcludingTax
;
var
totalPriceIncluding
=
totalPriceExcluding
*
(
1
+
parseFloat
(
taxPoints
));
detail1Grid
.
setCellValue
(
item
,
'totalPriceExcluding'
,
totalPriceExcluding
);
detail1Grid
.
setCellValue
(
item
,
'totalPriceIncluding'
,
totalPriceIncluding
);
var
allRows
=
detail1Grid
.
getDataItems
();
var
totalPriceExcluding
=
0
;
var
totalPriceIncluding
=
0
;
var
valueAddedTax
=
0
;
allRows
.
forEach
(
function
(
row
,
index
)
{
totalPriceExcluding
+=
parseFloat
(
row
.
totalPriceExcluding
);
totalPriceIncluding
+=
parseFloat
(
row
.
totalPriceIncluding
);
});
valueAddedTax
=
parseFloat
(
totalPriceIncluding
)
-
parseFloat
(
totalPriceExcluding
);
$
(
"#result-0-totalContractPriceExcluding"
).
val
(
totalPriceExcluding
.
toFixed
(
3
))
$
(
"#result-0-totalContractPriceIncluding"
).
val
(
totalPriceIncluding
.
toFixed
(
3
))
$
(
"#result-0-valueAddedTax"
).
val
(
valueAddedTax
.
toFixed
(
3
))
}
$
(
window
).
load
(
function
()
{
refreshRowNo
();
});
...
...
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