finalised new appeal pdf to show selected dropdowns

This commit is contained in:
2024-01-19 11:57:14 +00:00
parent 2f7790e66a
commit 01f768c624
7 changed files with 138 additions and 72 deletions
+3 -1
View File
@@ -173,6 +173,7 @@ let BuildSection = (props) => {
values,
props.props.accountDetails.containerID,
props.appealType.caseReference.ticketnumber,
props.appealType,
"\n////////////////////////\n"
);
@@ -186,7 +187,8 @@ let BuildSection = (props) => {
generateAppealPDF(
pdfObj,
props.props.accountDetails.containerID,
props.appealType.caseReference.ticketnumber
props.appealType.caseReference.ticketnumber,
router.query.appealtypes
),
props.setNewAppealProgress(
getProgressObj(formXML, titleList, mandatoryFieldsData, props)
+65 -11
View File
@@ -179,6 +179,10 @@ export const AppealRow_pdf = (props) => {
var fieldtype = xpath.select("//@classid", doc);
var datafieldname = xpath.select("//@datafieldname", doc);
var datafieldcontent = xpath.select("//@datafieldcontent", doc);
console.log(datafieldname[0].value);
return (
<>
{(() => {
@@ -253,6 +257,32 @@ export const AppealRow_pdf = (props) => {
);
break;
case "{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
var fieldCopy = datafieldcontent[0].value
.split(",")
.find((a) =>
a.includes(
props.props[
datafieldname[0].value
]
)
);
fieldCopy =
typeof fieldCopy != "undefined"
? fieldCopy.split("|")[1]
: fieldCopy;
const transData = require("../../locales/en/" +
(typeof fieldCopy != "undefined"
? fieldCopy.split(":")[0]
: "common") +
".json");
let transCopy =
typeof fieldCopy != "undefined"
? transData[fieldCopy.split(":")[1]]
: fieldCopy;
return (
<View
style={{
@@ -268,20 +298,19 @@ export const AppealRow_pdf = (props) => {
}}
>
<Text
style={styles.questionText}
style={
styles.questionTextWide
}
>
{rows[0].value}
{rows[0].value}{" "}
</Text>
</View>
<View style={styles.questionAnswer}>
<Text>
{
props.props[
datafieldname[0]
.value
]
}
</Text>
<View
style={
styles.questionAnswerWide
}
>
<Text>{transCopy}</Text>
</View>
</View>
);
@@ -326,6 +355,31 @@ export const AppealRow_pdf = (props) => {
</View>
);
break;
case "{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}":
return (
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionText}>
{/* {FieldsTranslations(rows[0].value)} */}
{rows[0].value}
</Text>
<Text style={styles.questionAnswer}>
{getPickListLabel(
props.pickListData,
datafieldname[0].value,
props.props[
datafieldname[0].value
]
)}
</Text>
</View>
);
break;
default:
return (
<View
@@ -93,7 +93,7 @@ const styles = StyleSheet.create({
},
});
export const planningappeals78_pdf = ({ docProps }) => {
export const planningappeals78_pdf = ({ docProps, pickListData }) => {
//console.log("----", docProps);
function formatDates(dateObj) {
var dateObj = new Date(dateObj);
@@ -209,6 +209,7 @@ export const planningappeals78_pdf = ({ docProps }) => {
props={docProps}
key={key}
mandatoryFieldsData={null}
pickListData={pickListData}
/>
</View>
</View>