|
|
|
@ -194,11 +194,133 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
|
|
|
|
|
|
|
|
|
|
Widget parseDynamicFormatType(GetEITDFFStructureList model, int index) {
|
|
|
|
|
if (model.dISPLAYFLAG != "N") {
|
|
|
|
|
if (model.vALIDATIONTYPE == "N") {
|
|
|
|
|
if (model.fORMATTYPE == "C") {
|
|
|
|
|
return DynamicTextFieldWidget(
|
|
|
|
|
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
|
|
|
|
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
|
|
|
|
|
isReadOnly: model.rEADONLY == "Y",
|
|
|
|
|
onChange: (text) {
|
|
|
|
|
model.fieldAnswer = text;
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(bottom: 12);
|
|
|
|
|
} else if (model.fORMATTYPE == "N") {
|
|
|
|
|
return DynamicTextFieldWidget(
|
|
|
|
|
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
|
|
|
|
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
|
|
|
|
|
isReadOnly: model.rEADONLY == "Y",
|
|
|
|
|
isInputTypeNum: true,
|
|
|
|
|
onChange: (text) {
|
|
|
|
|
model.fieldAnswer = text;
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(bottom: 12);
|
|
|
|
|
} else if (model.fORMATTYPE == "X") {
|
|
|
|
|
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? "");
|
|
|
|
|
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
|
|
|
|
|
if (displayText.contains(" 00:00:00")) {
|
|
|
|
|
displayText = displayText.replaceAll(" 00:00:00", "");
|
|
|
|
|
}
|
|
|
|
|
if (!displayText.contains("-")) {
|
|
|
|
|
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return DynamicTextFieldWidget(
|
|
|
|
|
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
|
|
|
|
displayText,
|
|
|
|
|
suffixIconData: Icons.calendar_today,
|
|
|
|
|
isEnable: false,
|
|
|
|
|
onTap: () async {
|
|
|
|
|
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
|
|
|
|
|
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
|
|
|
|
|
selectedDate = DateFormat("yyyy/MM/dd").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
|
|
|
|
|
} else {
|
|
|
|
|
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DateTime date = await _selectDate(context);
|
|
|
|
|
DateTime date1 = DateTime(date.year, date.month, date.day);
|
|
|
|
|
getEitDffStructureList![index].fieldAnswer = date.toString();
|
|
|
|
|
ESERVICESDV eservicesdv = ESERVICESDV(
|
|
|
|
|
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
|
|
|
|
|
pRETURNMSG: "null",
|
|
|
|
|
pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE,
|
|
|
|
|
pVALUECOLUMNNAME: getEitDffStructureList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
|
|
|
|
|
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
|
|
|
|
|
setState(() {});
|
|
|
|
|
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
|
|
|
|
|
calGetValueSetValues(model);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(bottom: 12);
|
|
|
|
|
} else if (model.fORMATTYPE == "Y") {
|
|
|
|
|
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? "");
|
|
|
|
|
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
|
|
|
|
|
if (displayText.contains(" 00:00:00")) {
|
|
|
|
|
displayText = displayText.replaceAll(" 00:00:00", "");
|
|
|
|
|
}
|
|
|
|
|
if (!displayText.contains("-")) {
|
|
|
|
|
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return DynamicTextFieldWidget(
|
|
|
|
|
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
|
|
|
|
displayText,
|
|
|
|
|
suffixIconData: Icons.calendar_today,
|
|
|
|
|
isEnable: false,
|
|
|
|
|
onTap: () async {
|
|
|
|
|
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
|
|
|
|
|
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
|
|
|
|
|
selectedDate = DateFormat("yyyy-MM-dd").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
|
|
|
|
|
} else {
|
|
|
|
|
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DateTime date = await _selectDate(context);
|
|
|
|
|
DateTime date1 = DateTime(date.year, date.month, date.day);
|
|
|
|
|
getEitDffStructureList![index].fieldAnswer = date.toString();
|
|
|
|
|
ESERVICESDV eservicesdv = ESERVICESDV(
|
|
|
|
|
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
|
|
|
|
|
pRETURNMSG: "null",
|
|
|
|
|
pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE,
|
|
|
|
|
pVALUECOLUMNNAME: getEitDffStructureList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
|
|
|
|
|
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
|
|
|
|
|
setState(() {});
|
|
|
|
|
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
|
|
|
|
|
calGetValueSetValues(model);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(bottom: 12);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return PopupMenuButton(
|
|
|
|
|
child: DynamicTextFieldWidget(
|
|
|
|
|
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
|
|
|
|
model.eSERVICESDV?.pVALUECOLUMNNAME ?? "",
|
|
|
|
|
isEnable: false,
|
|
|
|
|
isPopup: true,
|
|
|
|
|
isInputTypeNum: true,
|
|
|
|
|
isReadOnly: model.rEADONLY == "Y",
|
|
|
|
|
).paddingOnly(bottom: 12),
|
|
|
|
|
itemBuilder: (_) => <PopupMenuItem<int>>[
|
|
|
|
|
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i),
|
|
|
|
|
],
|
|
|
|
|
onSelected: (int popipIndex) {
|
|
|
|
|
ESERVICESDV eservicesdv = ESERVICESDV(
|
|
|
|
|
pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME,
|
|
|
|
|
pRETURNMSG: "null",
|
|
|
|
|
pRETURNSTATUS: getEitDffStructureList![popipIndex].dEFAULTVALUE,
|
|
|
|
|
pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME);
|
|
|
|
|
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
|
|
|
|
|
setState(() {});
|
|
|
|
|
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
|
|
|
|
|
getDefaultValues(model);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (model.fORMATTYPE == "C") {
|
|
|
|
|
if (model.fORMATTYPE == "N") {
|
|
|
|
|
if (model.eSERVICESVS?.isNotEmpty ?? false) {
|
|
|
|
|
return PopupMenuButton(
|
|
|
|
|
child: DynamicTextFieldWidget(
|
|
|
|
@ -206,6 +328,8 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
|
|
|
|
|
model.eSERVICESDV?.pVALUECOLUMNNAME ?? "",
|
|
|
|
|
isEnable: false,
|
|
|
|
|
isPopup: true,
|
|
|
|
|
isInputTypeNum: true,
|
|
|
|
|
isReadOnly: model.rEADONLY == "Y",
|
|
|
|
|
).paddingOnly(bottom: 12),
|
|
|
|
|
itemBuilder: (_) => <PopupMenuItem<int>>[
|
|
|
|
|
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i),
|
|
|
|
@ -232,15 +356,28 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
|
|
|
|
|
model.fieldAnswer = text;
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(bottom: 12);
|
|
|
|
|
} else if (model.fORMATTYPE == "X") {
|
|
|
|
|
} else if (model.fORMATTYPE == "X" || model.fORMATTYPE == "Y") {
|
|
|
|
|
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? "");
|
|
|
|
|
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
|
|
|
|
|
if (displayText.contains(" 00:00:00")) {
|
|
|
|
|
displayText = displayText.replaceAll(" 00:00:00", "");
|
|
|
|
|
}
|
|
|
|
|
if (!displayText.contains("-")) {
|
|
|
|
|
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return DynamicTextFieldWidget(
|
|
|
|
|
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
|
|
|
|
model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? ""),
|
|
|
|
|
displayText,
|
|
|
|
|
suffixIconData: Icons.calendar_today,
|
|
|
|
|
isEnable: false,
|
|
|
|
|
onTap: () async {
|
|
|
|
|
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
|
|
|
|
|
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
|
|
|
|
|
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
|
|
|
|
|
selectedDate = DateFormat("yyyy/MM/dd").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
|
|
|
|
|
} else {
|
|
|
|
|
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DateTime date = await _selectDate(context);
|
|
|
|
|
DateTime date1 = DateTime(date.year, date.month, date.day);
|
|
|
|
@ -249,7 +386,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
|
|
|
|
|
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
|
|
|
|
|
pRETURNMSG: "null",
|
|
|
|
|
pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE,
|
|
|
|
|
pVALUECOLUMNNAME: DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
|
|
|
|
|
pVALUECOLUMNNAME: getEitDffStructureList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
|
|
|
|
|
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
|
|
|
|
|
setState(() {});
|
|
|
|
|
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
|
|
|
|
|