浏览代码

修复bug

glglove 1 周之前
父节点
当前提交
7c9246bca1

+ 9 - 5
packages/cpt_uk/lib/modules/job/labour_request_add/labour_request_add_controller.dart

@@ -85,7 +85,7 @@ class LabourRequestAddController extends GetxController with DioCancelableMixin
       }
 
       var needNumController = state.formData['no_of_staff']!['controller'];
-      needNumController.text = state.noStaff??state.noStaff!='null'??"0";
+      needNumController.text = state.noStaff??state.noStaff =='null'??"0";
       var amountController = state.formData['amount']!['controller'];
       amountController.text = state.amount??state.amount!='null'??"0";
 
@@ -99,7 +99,7 @@ class LabourRequestAddController extends GetxController with DioCancelableMixin
       remarkController.text = state.labReqOption?.description ?? '';
       eventController.text = state.labReqOption?.eventName ?? "";
       eventTypeController.text = state.labReqOption?.eventType ?? "";
-      eventPaxController.text = state.labReqOption?.passengers.toString() ?? "";
+      eventPaxController.text = state.labReqOption?.passengers?.toString() ?? "0";
       revenueController.text = state.labReqOption?.estRevenue ?? "";
       positionController.text = state.labReqOption?.position ?? "";
       totalCostController.text = state.labReqOption?.estCost ?? "";
@@ -126,7 +126,7 @@ class LabourRequestAddController extends GetxController with DioCancelableMixin
 
     var needNumController = state.formData['no_of_staff']!['controller'];
     var amountController = state.formData['amount']!['controller'];
-    String needNum = needNumController.text.toString();
+    String needNum = needNumController.text.toString()??"0";
     String amount = amountController.text.toString();
     String? jobApplyPreId = state.preSelectedIds;
 
@@ -140,13 +140,14 @@ class LabourRequestAddController extends GetxController with DioCancelableMixin
 
     String event = eventController.text.toString();
     String eventType = eventTypeController.text.toString();
-    String eventPax = eventPaxController.text.toString();
+    String eventPax = eventPaxController.text.toString()?? "0";
     String revenue = revenueController.text.toString();
     String position = positionController.text.toString();
     String totalCost = totalCostController.text.toString();
     String remark = remarkController.text.toString();
 
-
+    // Log.d("89328392  ${state.selectedTypeId}");
+    // Log.d("89328392  ${state.selectedTypeId.runtimeType}");
     if (Utils.isEmpty(state.selectedTemplateId)) {
       ToastEngine.show("Choose Job Title".tr);
       return;
@@ -165,6 +166,9 @@ class LabourRequestAddController extends GetxController with DioCancelableMixin
     } else if (state.labReqOption?.serviceType == 1 && Utils.isEmpty(amount)) {
       ToastEngine.show("Enter Amount".tr);
       return;
+    }else if(Utils.isEmpty(state.selectedTypeId)){
+      ToastEngine.show("Choose Employment Type".tr);
+      return;
     }
 
     Future<HttpResult> taskFuture;

+ 2 - 2
packages/cpt_uk/lib/modules/job/labour_request_add/widget/lab_request_and_request_review_form.dart

@@ -195,7 +195,7 @@ class CommonLabourRequestFormFields extends StatelessWidget {
         Visibility(
           visible: isAddAction,
           child: FormRequireText(
-            text: "Pre Selectd".tr,
+            text: "Pre Selected".tr,
             isRequired: false,
           ).marginOnly(top: 15),
         ),
@@ -272,7 +272,7 @@ class CommonLabourRequestFormFields extends StatelessWidget {
         // Type 选项  employment list
         FormRequireText(
           text: "Choose Type".tr,
-          isRequired: false,
+          isRequired: true,
         ).marginOnly(top: 15),
         Container(
           padding: const EdgeInsets.only(left: 16, right: 10),

+ 5 - 2
packages/cpt_uk/lib/modules/review/labour_review_edit/labour_review_edit_controller.dart

@@ -85,7 +85,7 @@ class LabourReviewEditController extends GetxController with DioCancelableMixin
       remarkController.text = state.labReqOption?.description ?? '';
       eventController.text = state.labReqOption?.eventName ?? "";
       eventTypeController.text = state.labReqOption?.eventType ?? "";
-      eventPaxController.text = state.labReqOption?.passengers.toString() ?? "";
+      eventPaxController.text = state.labReqOption?.passengers.toString() ?? "0";
       revenueController.text = state.labReqOption?.estRevenue ?? "";
       positionController.text = state.labReqOption?.position ?? "";
       totalCostController.text = state.labReqOption?.estCost ?? "";
@@ -350,7 +350,7 @@ class LabourReviewEditController extends GetxController with DioCancelableMixin
 
     String event = eventController.text.toString();
     String eventType = eventTypeController.text.toString();
-    String eventPax = eventPaxController.text.toString();
+    String eventPax = eventPaxController.text.toString()??"0";
     String revenue = revenueController.text.toString();
     String position = positionController.text.toString();
     String totalCost = totalCostController.text.toString();
@@ -375,6 +375,9 @@ class LabourReviewEditController extends GetxController with DioCancelableMixin
     } else if (state.labReqOption?.serviceType == 1 && Utils.isEmpty(amount)) {
       ToastEngine.show("Enter Amount".tr);
       return;
+    }else if(Utils.isEmpty(state.selectedTypeId)){
+      ToastEngine.show("Choose Employment Type".tr);
+      return;
     }
 
     Future<HttpResult> taskFuture;

+ 2 - 0
packages/cs_resources/lib/local/language/en_US.dart

@@ -100,6 +100,8 @@ const Map<String, String> en_US = {
   'Job End': 'Job End',
   'No. of Staff': 'No. of Staff',
   'Enter No. of Staff': 'Enter No. of Staff',
+  'Enter Amount': 'Enter Amount',
+  'Choose Employment Type': 'Choose Employment Type',
   'Choose Start Date': 'Choose Start Date',
   'Choose End Date': 'Choose End Date',
   'Add Labour Requisition': 'Add Labour Requisition',

+ 2 - 0
packages/cs_resources/lib/local/language/zh_CN.dart

@@ -95,6 +95,8 @@ const Map<String, String> zh_CN = {
   'Job End': 'Job End',
   'No. of Staff': '需要的人员数量',
   'Enter No. of Staff': '请输入需要的人员数量',
+  'Enter Amount': '输入金额',
+  'Choose Employment Type': '选择类型',
   'Choose Start Date': '请选择开始日期',
   'Choose End Date': '请选择结束日期',
   'Add Labour Requisition': '新增用工请求',