|
|
|
|
@ -27,9 +27,7 @@ void updateProcedureForm(context,
|
|
|
|
|
String remarks,
|
|
|
|
|
ProcedureViewModel model,
|
|
|
|
|
String categoreId}) {
|
|
|
|
|
//ProcedureViewModel model2 = ProcedureViewModel();
|
|
|
|
|
TextEditingController remarksController = TextEditingController();
|
|
|
|
|
TextEditingController orderController = TextEditingController();
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
@ -119,129 +117,6 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30.0,
|
|
|
|
|
),
|
|
|
|
|
// Container(
|
|
|
|
|
// height: screenSize.height * 0.070,
|
|
|
|
|
// child: InkWell(
|
|
|
|
|
// onTap: model.categoryList != null &&
|
|
|
|
|
// model.categoryList.length > 0
|
|
|
|
|
// ? () {
|
|
|
|
|
// ListSelectDialog dialog =
|
|
|
|
|
// ListSelectDialog(
|
|
|
|
|
// list: model.categoryList,
|
|
|
|
|
// attributeName: 'categoryName',
|
|
|
|
|
// attributeValueId: 'categoryId',
|
|
|
|
|
// okText:
|
|
|
|
|
// TranslationBase.of(context).ok,
|
|
|
|
|
// okFunction: (selectedValue) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// selectedCategory =
|
|
|
|
|
// selectedValue;
|
|
|
|
|
// model.getProcedureCategory(
|
|
|
|
|
// categoryName:
|
|
|
|
|
// selectedCategory[
|
|
|
|
|
// 'categoryName'],
|
|
|
|
|
// categoryID: selectedCategory[
|
|
|
|
|
// 'categoryId'] <=
|
|
|
|
|
// 9
|
|
|
|
|
// ? "0" +
|
|
|
|
|
// selectedCategory[
|
|
|
|
|
// 'categoryId']
|
|
|
|
|
// .toString()
|
|
|
|
|
// : selectedCategory[
|
|
|
|
|
// 'categoryId']
|
|
|
|
|
// .toString());
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// );
|
|
|
|
|
// showDialog(
|
|
|
|
|
// barrierDismissible: false,
|
|
|
|
|
// context: context,
|
|
|
|
|
// builder: (BuildContext context) {
|
|
|
|
|
// return dialog;
|
|
|
|
|
// },
|
|
|
|
|
// );
|
|
|
|
|
// //model.getProcedureCategory();
|
|
|
|
|
// }
|
|
|
|
|
// : null,
|
|
|
|
|
// child: TextField(
|
|
|
|
|
// decoration: textFieldSelectorDecoration(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .procedureCategorise,
|
|
|
|
|
// selectedCategory != null
|
|
|
|
|
// ? selectedCategory['categoryName']
|
|
|
|
|
// : null,
|
|
|
|
|
// true,
|
|
|
|
|
// suffixIcon: Icon(
|
|
|
|
|
// Icons.search,
|
|
|
|
|
// color: Colors.black,
|
|
|
|
|
// )),
|
|
|
|
|
// enabled: false,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// if (widget.model.categoriesList.length != 0)
|
|
|
|
|
// NetworkBaseView(
|
|
|
|
|
// baseViewModel: model,
|
|
|
|
|
// child: selectedCategory != null
|
|
|
|
|
// ? selectedCategory['categoryId'] ==
|
|
|
|
|
// 02 ||
|
|
|
|
|
// selectedCategory[
|
|
|
|
|
// 'categoryId'] ==
|
|
|
|
|
// 03 ||
|
|
|
|
|
// selectedCategory[
|
|
|
|
|
// 'categoryId'] ==
|
|
|
|
|
// 55
|
|
|
|
|
// ? EntityListCheckboxSearchWidget(
|
|
|
|
|
// model: widget.model,
|
|
|
|
|
// masterList: widget
|
|
|
|
|
// .model
|
|
|
|
|
// .categoriesList[0]
|
|
|
|
|
// .entityList,
|
|
|
|
|
// removeHistory: (item) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// entityList.remove(item);
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// addHistory: (history) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// entityList.add(history);
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// addSelectedHistories: () {
|
|
|
|
|
// //TODO build your fun herr
|
|
|
|
|
// // widget.addSelectedHistories();
|
|
|
|
|
// },
|
|
|
|
|
// isEntityListSelected:
|
|
|
|
|
// (master) =>
|
|
|
|
|
// isEntityListSelected(
|
|
|
|
|
// master),
|
|
|
|
|
// )
|
|
|
|
|
// : ProcedureListWidget(
|
|
|
|
|
// model: widget.model,
|
|
|
|
|
// masterList: widget
|
|
|
|
|
// .model
|
|
|
|
|
// .categoriesList[0]
|
|
|
|
|
// .entityList,
|
|
|
|
|
// removeHistory: (item) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// entityList.remove(item);
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// addHistory: (history) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// entityList.add(history);
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// addSelectedHistories: () {
|
|
|
|
|
// //TODO build your fun herr
|
|
|
|
|
// // widget.addSelectedHistories();
|
|
|
|
|
// },
|
|
|
|
|
// isEntityListSelected:
|
|
|
|
|
// (master) =>
|
|
|
|
|
// isEntityListSelected(
|
|
|
|
|
// master),
|
|
|
|
|
// )
|
|
|
|
|
// : null),
|
|
|
|
|
Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
@ -294,7 +169,6 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.all(SizeConfig.widthMultiplier * 2),
|
|
|
|
|
child: Column(
|
|
|
|
|
//alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
color: AppGlobal.appGreenColor,
|
|
|
|
|
@ -302,13 +176,6 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
|
.updateProcedure
|
|
|
|
|
.toUpperCase(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// if (entityList.isEmpty == true &&
|
|
|
|
|
// widget.remarksController.text ==
|
|
|
|
|
// widget.remarks) {
|
|
|
|
|
// DrAppToastMsg.showErrorToast(
|
|
|
|
|
// "Fill the mandatory procedure details");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
updateProcedure(
|
|
|
|
|
limetNO: widget.limetNo,
|
|
|
|
|
@ -370,23 +237,6 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
|
updateProcedureReqModel.lineItemNo = limetNO;
|
|
|
|
|
updateProcedureReqModel.orderNo = orderNo;
|
|
|
|
|
|
|
|
|
|
// if (entityList.isNotEmpty) {
|
|
|
|
|
// entityList.forEach((element) {
|
|
|
|
|
// controls.add(
|
|
|
|
|
// Controls(code: "remarks", controlValue: element.remarks ?? ''),
|
|
|
|
|
// );
|
|
|
|
|
// controls.add(
|
|
|
|
|
// Controls(code: "ordertype", controlValue: '1'),
|
|
|
|
|
// );
|
|
|
|
|
//
|
|
|
|
|
// controlsProcedure.procedure = element.procedureId;
|
|
|
|
|
// controlsProcedure.category = int.parse(element.categoryID) > 9
|
|
|
|
|
// ? element.categoryID
|
|
|
|
|
// : "0" + element.categoryID;
|
|
|
|
|
// controlsProcedure.controls = controls;
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
{
|
|
|
|
|
controls.add(
|
|
|
|
|
Controls(
|
|
|
|
|
@ -401,8 +251,6 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
|
|
|
|
|
|
controlsProcedure.controls = controls;
|
|
|
|
|
}
|
|
|
|
|
// controlsProcedure.add(ProcedureDetail(
|
|
|
|
|
// category: categorieId, procedure: procedureId, controls: controls));
|
|
|
|
|
updateProcedureReqModel.procedureDetail = controlsProcedure;
|
|
|
|
|
|
|
|
|
|
await model.updateProcedure(
|
|
|
|
|
@ -418,6 +266,8 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///TODO Elham* move it to view model
|
|
|
|
|
bool isEntityListSelected(EntityList masterKey) {
|
|
|
|
|
Iterable<EntityList> history = entityList
|
|
|
|
|
.where((element) => masterKey.procedureId == element.procedureId);
|
|
|
|
|
@ -426,36 +276,4 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InputDecoration textFieldSelectorDecoration(
|
|
|
|
|
String hintText, String selectedText, bool isDropDown,
|
|
|
|
|
{Icon suffixIcon}) {
|
|
|
|
|
return InputDecoration(
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
disabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
hintText: selectedText != null ? selectedText : hintText,
|
|
|
|
|
suffixIcon: isDropDown
|
|
|
|
|
? suffixIcon != null
|
|
|
|
|
? suffixIcon
|
|
|
|
|
: Icon(
|
|
|
|
|
Icons.arrow_drop_down,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.grey.shade600,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|