|
@@ -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);
|
|
|
},
|