Browse Source

生产计划标签错误解决

cz 1 year ago
parent
commit
c032f80a3d
2 changed files with 35 additions and 22 deletions
  1. 10 11
      src/lang/en.js
  2. 25 11
      src/views/MES/produce/plan/add.vue

+ 10 - 11
src/lang/en.js

@@ -1,4 +1,3 @@
-
 export const lang = {
     "login": {
         "deviceInformation": "Device Information",
@@ -58,8 +57,8 @@ export const lang = {
         "productDetails": "Product details ",
         "equipmentParameters": "Equipment parameters",
         "model": "Type",
-		'searchResults': 'Search results',
-		"noMatchingData": "No matching data",
+        'searchResults': 'Search results',
+        "noMatchingData": "No matching data",
     },
     "feedback": {
         "all": "All",
@@ -307,6 +306,7 @@ export const lang = {
         "planEndTime": "Scheduled end time",
         "selectPlanEndTime": "Please select the planned end time",
         "planEndTimeCanNotBeEmpty": "The planned end time cannot be empty",
+        'planQuantityCanNotBeEmpty': "The planned quantity cannot be empty",
         "workOrderManagement": "Workorder management",
         "productionTask": "Productive task",
         "taskQuantity": "Task QTY",
@@ -700,12 +700,12 @@ export const lang = {
         "passwordCanNotBeEmpty": "Password cannot be empty",
         "roleCanNotBeEmpty": "The role cannot be empty",
         "phoneCanNotBeEmpty": "Mobile phone number cannot be empty",
-        salesmanManagement:'业务员管理',
-		salesmanEdit:'业务员修改',
-		belongDept:'所属部门',
-		employeeName:'员工姓名',
-		businessCode:'业务代码',
-		salesmanCode:'业务员代码',
+        salesmanManagement: '业务员管理',
+        salesmanEdit: '业务员修改',
+        belongDept: '所属部门',
+        employeeName: '员工姓名',
+        businessCode: '业务代码',
+        salesmanCode: '业务员代码',
     },
     "dict": {
         "name": "Business Dictionary",
@@ -917,5 +917,4 @@ export const lang = {
         "ccc": "Storage motor",
         "ddd": "Centrifugal motor"
     }
-}
-
+}

+ 25 - 11
src/views/MES/produce/plan/add.vue

@@ -16,7 +16,9 @@
           :label="$t('plan.selectWorkOrder')"
           :placeholder="$t('plan.selectWorkOrder')"
           @click="typeModal = true"
-          :rules="[{ required: true, message: $t('plan.workOrderCanNotBeEmpty') }]"
+          :rules="[
+            { required: true, message: $t('plan.workOrderCanNotBeEmpty') },
+          ]"
           required
         />
         <van-popup v-model:show="typeModal" round position="bottom">
@@ -26,7 +28,11 @@
             @confirm="onConfirm"
           />
         </van-popup>
-        <van-field v-model="formData.productName" readonly :label="$t('plan.productName')" />
+        <van-field
+          v-model="formData.productName"
+          readonly
+          :label="$t('plan.productName')"
+        />
         <van-field
           v-model="formData.waitQuantity"
           readonly
@@ -42,7 +48,9 @@
           :label="$t('plan.planStartTime')"
           :placeholder="$t('plan.selectPlanStartTime')"
           @click="handleOpenTime(true)"
-          :rules="[{ required: true, message: $t('plan.planStartTimeCanNotBeEmpty') }]"
+          :rules="[
+            { required: true, message: $t('plan.planStartTimeCanNotBeEmpty') },
+          ]"
           required
         />
         <van-field
@@ -52,7 +60,9 @@
           :label="$t('plan.planEndTime')"
           :placeholder="$t('plan.selectPlanEndTime')"
           @click="handleOpenTime(false)"
-          :rules="[{ required: true, message: $t('plan.planEndTimeCanNotBeEmpty') }]"
+          :rules="[
+            { required: true, message: $t('plan.planEndTimeCanNotBeEmpty') },
+          ]"
           required
         />
         <van-popup v-model:show="showPicker" position="bottom">
@@ -64,17 +74,19 @@
 
         <van-field
           v-model="formData.quantity"
-          :label="$t('plan.planEndTime')"
-          :placeholder="$t('plan.selectPlanEndTime')"
+          :label="$t('plan.planQuantity')"
+          :placeholder="$t('plan.pleaseEnterThePlanQuantity')"
           type="number"
-          :rules="[{ required: true, message: $t('plan.planEndTimeCanNotBeEmpty') }]"
+          :rules="[
+            { required: true, message: $t('plan.planQuantityCanNotBeEmpty') },
+          ]"
           required
         />
       </van-cell-group>
 
       <div style="margin: 16px">
         <van-button round block type="primary" native-type="submit">
-          {{$t("common.submit")}}
+          {{ $t("common.submit") }}
         </van-button>
       </div>
     </van-form>
@@ -158,15 +170,17 @@ const onClickLeft = () => history.back();
 
 const onSubmit = () => {
   if (Number(formData.value.quantity) > Number(formData.value.waitQuantity)) {
-    return showFailToast(proxy.t('plan.planQuantityCanNotBeGreaterThanTheSchedulingQuantity'));
+    return showFailToast(
+      proxy.t("plan.planQuantityCanNotBeGreaterThanTheSchedulingQuantity")
+    );
   }
   if (proxy.compareTime(formData.value.startDate, formData.value.stopDate)) {
-    return showFailToast(proxy.t('plan.timeSelectionProblem'));
+    return showFailToast(proxy.t("plan.timeSelectionProblem"));
   }
   proxy.post("/productionPlan/add", formData.value).then(
     (res) => {
       setTimeout(() => {
-        showSuccessToast(proxy.t('common.addSuccess'));
+        showSuccessToast(proxy.t("common.addSuccess"));
         proxy.$router.push("/main/plan");
       }, 500);
     },