diff --git a/user_front/components/RegistInfo/add/Employee.vue b/user_front/components/RegistInfo/add/Employee.vue index 8f47b77df..cc7110e2c 100644 --- a/user_front/components/RegistInfo/add/Employee.vue +++ b/user_front/components/RegistInfo/add/Employee.vue @@ -52,6 +52,8 @@ const addEmployee = async () => { const reset = () => { newName.value = '' newStudentId.value = '' + handleName(newName.value) + handleStudentId(newStudentId.value) } diff --git a/user_front/components/RegistInfo/add/Food.vue b/user_front/components/RegistInfo/add/Food.vue index 1b00da01c..65e0fb547 100644 --- a/user_front/components/RegistInfo/add/Food.vue +++ b/user_front/components/RegistInfo/add/Food.vue @@ -59,6 +59,9 @@ const reset = () => { numFirstDay.value = null; numSecondDay.value = null; isCooking.value = false; + handleDishName(dishName.value); + handleNumFirstDay(numFirstDay.value); + handleNumSecondDay(numSecondDay.value); }; diff --git a/user_front/components/RegistInfo/add/Item.vue b/user_front/components/RegistInfo/add/Item.vue index 922ec421d..b55d9989c 100644 --- a/user_front/components/RegistInfo/add/Item.vue +++ b/user_front/components/RegistInfo/add/Item.vue @@ -133,6 +133,8 @@ const addItem = async () => { const reset = () => { newItem.value = null; newNum.value = null; + handleName(newItem.value); + handleNum(newNum.value); }; diff --git a/user_front/components/RegistInfo/add/Power.vue b/user_front/components/RegistInfo/add/Power.vue index ac383ed49..758b5fb1e 100644 --- a/user_front/components/RegistInfo/add/Power.vue +++ b/user_front/components/RegistInfo/add/Power.vue @@ -59,6 +59,11 @@ const reset = () => { newManufacturer.value = '' newModel.value = '' newUrl.value = '' + handleItem(newItem.value) + handlePower(newPower.value) + handleManufacturer(newManufacturer.value) + handleModel(newModel.value) + handleUrl(newUrl.value) } diff --git a/user_front/components/RegistInfo/add/Purchase.vue b/user_front/components/RegistInfo/add/Purchase.vue index 8d4fc4eac..7527c09a5 100644 --- a/user_front/components/RegistInfo/add/Purchase.vue +++ b/user_front/components/RegistInfo/add/Purchase.vue @@ -88,6 +88,11 @@ const reset = () => { newShopId.value = null; newFesDateId.value = null; newIsFresh.value = false; + handleFoodProductId(newFoodProductId.value); + handleShopId(newShopId.value); + handleFesDateId(newFesDateId.value); + handleItem(newItems.value); + }; diff --git a/user_front/components/RegistInfo/edit/Employee.vue b/user_front/components/RegistInfo/edit/Employee.vue index 7719fc7d4..ee6c2683d 100644 --- a/user_front/components/RegistInfo/edit/Employee.vue +++ b/user_front/components/RegistInfo/edit/Employee.vue @@ -74,6 +74,8 @@ const editEmployee = async () => { const reset = () => { newName.value = '' newStudentId.value = null + handleName(newName.value) + handleStudentId(newStudentId.value) } diff --git a/user_front/components/RegistInfo/edit/Food.vue b/user_front/components/RegistInfo/edit/Food.vue index 31e98ba70..ba6278653 100644 --- a/user_front/components/RegistInfo/edit/Food.vue +++ b/user_front/components/RegistInfo/edit/Food.vue @@ -89,6 +89,9 @@ const reset = () => { newIsCooking.value = false; newNumFirstDay.value = null; newNumSecondDay.value = null; + handleDishName(newDishName.value); + handleNumFirstDay(newNumFirstDay.value); + handleNumSecondDay(newNumSecondDay.value); }; diff --git a/user_front/components/RegistInfo/edit/Item.vue b/user_front/components/RegistInfo/edit/Item.vue index 406cf6e14..1c2813e9d 100644 --- a/user_front/components/RegistInfo/edit/Item.vue +++ b/user_front/components/RegistInfo/edit/Item.vue @@ -118,6 +118,8 @@ const editItem = async () => { const reset = () => { newItem.value = null; newNum.value = null; + handleName(newItem.value); + handleNum(newNum.value); }; // 物品のidから物品の情報を取得し、物品の貸し出し可能数を返す diff --git a/user_front/components/RegistInfo/edit/Place.vue b/user_front/components/RegistInfo/edit/Place.vue index e1ce02657..bcc888c3d 100644 --- a/user_front/components/RegistInfo/edit/Place.vue +++ b/user_front/components/RegistInfo/edit/Place.vue @@ -2,9 +2,10 @@ import { Place, PlaceList } from "~~/types/regist/place"; import { useField, useForm } from "vee-validate"; import { placeSchema } from "~~/utils/validate"; -const config = useRuntimeConfig(); import axios from "axios"; +const config = useRuntimeConfig(); + interface Props { id: number | null; first: number | null; @@ -32,6 +33,7 @@ const { meta, isSubmitting } = useForm({ first: props.first, second: props.second, third: props.third, + remark: props.remark, }, }); const { handleChange: handleFirstPlace, errorMessage: firstPlaceError } = @@ -40,6 +42,8 @@ const { handleChange: handleSecondPlace, errorMessage: secondPlaceError } = useField("second"); const { handleChange: handleThirdPlace, errorMessage: thirdPlaceError } = useField("third"); +const { handleChange: handleRemark, errorMessage: remarkError } = + useField("remark"); const EATING_AREA = [ "事務棟エリア", @@ -52,7 +56,6 @@ const isEatingArea = (place: string) => { return EATING_AREA.includes(place); }; - const placeList = ref([]); const newFirst = ref(props.first); const newSecond = ref(props.second); @@ -60,7 +63,7 @@ const newThird = ref(props.third); const newRemark = ref(props.remark); const groupCategoryId = ref(); const isOverlapPlace = ref(false); -const group_id = ref() +const group_id = ref(); const isDuplicate = computed(() => { if ( newFirst.value === newSecond.value || @@ -83,10 +86,12 @@ const closeEditPlace = () => { onMounted(async () => { const placeData = await $fetch(config.APIURL + "/places"); - !!placeData.data && placeData.data.forEach((place) => { - placeList.value.push(place) - }) - const groupUrl = config.APIURL + "/groups/" + Number(localStorage.getItem("group_id")); + !!placeData.data && + placeData.data.forEach((place) => { + placeList.value.push(place); + }); + const groupUrl = + config.APIURL + "/groups/" + Number(localStorage.getItem("group_id")); axios.get(groupUrl).then(async (response) => { groupCategoryId.value = response.data.data.group_category_id; @@ -102,7 +107,7 @@ onMounted(async () => { } }); }); -}) +}); const editPlace = async () => { if (props.id === null) { @@ -114,10 +119,9 @@ const editPlace = async () => { second: newSecond.value, third: newThird.value, remark: newRemark.value, - } - }) - } - else{ + }, + }); + } else { await useFetch(config.APIURL + "/place_orders/" + props.id, { method: "PUT", params: { @@ -126,18 +130,22 @@ const editPlace = async () => { second: newSecond.value, third: newThird.value, remark: newRemark.value, - } - }) + }, + }); } - reloadPlace() - closeEditPlace() -} + reloadPlace(); + closeEditPlace(); +}; const reset = () => { newFirst.value = null; newSecond.value = null; newThird.value = null; newRemark.value = ""; + handleFirstPlace(newFirst.value); + handleSecondPlace(newSecond.value); + handleThirdPlace(newThird.value); + handleRemark(newRemark.value); }; @@ -154,48 +162,50 @@ const reset = () => {