|
@@ -41,7 +41,7 @@
|
|
|
</div>
|
|
|
<div style="width: 80%;padding: 0;margin: 0;">
|
|
|
<ion-datetime-button datetime="jobVacancyTime" style="width: 70%;"></ion-datetime-button>
|
|
|
- <ion-modal :keep-contents-mounted="true" >
|
|
|
+ <ion-modal :keep-contents-mounted="true">
|
|
|
<ion-datetime placeholder="招聘日期" id="jobVacancyTime"
|
|
|
v-model="jobVacancyTime"
|
|
|
dataformatas="YYYY-MM-DD" presentation="date" cancel-text="取消" done-text="确定"
|
|
@@ -68,8 +68,9 @@ import {useRoute, useRouter} from "vue-router";
|
|
|
import {alertController, onIonViewDidEnter} from "@ionic/vue";
|
|
|
import {arrowBackOutline} from 'ionicons/icons';
|
|
|
import {useVuelidate} from "@vuelidate/core";
|
|
|
-import {post} from "@/api/common";
|
|
|
+import {getCurrentDate} from "@/api/company";
|
|
|
import {minLength, required} from "@vuelidate/validators";
|
|
|
+import PostList from "@/views/pages/company/postList.vue";
|
|
|
|
|
|
interface FormState {
|
|
|
dataModel: {
|
|
@@ -96,6 +97,7 @@ export default defineComponent({
|
|
|
const route = useRoute();
|
|
|
const isEdit = ref<any>(false);
|
|
|
const formState = reactive<FormState>({dataModel: {}});
|
|
|
+ const oldDataModel= reactive<FormState>({dataModel: {}});
|
|
|
const postList = ref<PostModel[]>([]);
|
|
|
const rules = computed(() => {
|
|
|
return {
|
|
@@ -127,10 +129,8 @@ export default defineComponent({
|
|
|
const jsonPostList = JSON.stringify(postList.value);
|
|
|
localStorage.removeItem("postData");
|
|
|
localStorage.setItem("postData", jsonPostList);
|
|
|
- console.log(formState.dataModel);
|
|
|
- console.log(postList.value);
|
|
|
if (route.query.id) {
|
|
|
- await router.push({path: "./postList", query: {pageStatus: 3, id: route.query.id}});
|
|
|
+ await router.push({path: "./postList", query: {pageStatus: 3, id: route.query.id,editPostStatus:1}});
|
|
|
} else {
|
|
|
await router.push({path: "./postList", query: {pageStatus: 3}});
|
|
|
}
|
|
@@ -147,16 +147,7 @@ export default defineComponent({
|
|
|
console.log(postList);
|
|
|
};
|
|
|
|
|
|
- const getCurrentDate = () => {
|
|
|
- const validDate = new Date();
|
|
|
- // 获取年月日
|
|
|
- const year = validDate.getFullYear();
|
|
|
- const month = validDate.getMonth() + 1; // 注意月份是从0开始的,需要加1
|
|
|
- const day = validDate.getDate();
|
|
|
- return `${year}-${month}-${day}`;
|
|
|
- }
|
|
|
-
|
|
|
- const initData = (id: any) => {
|
|
|
+ const initData = (id: any) => {
|
|
|
if (route.query.addStatus) {
|
|
|
formState.dataModel.recruitCount = null;
|
|
|
formState.dataModel.validTime = getCurrentDate();
|
|
@@ -168,6 +159,7 @@ export default defineComponent({
|
|
|
isEdit.value = true;
|
|
|
}
|
|
|
loadData(id);
|
|
|
+ console.log(jobVacancyTime.value);
|
|
|
};
|
|
|
|
|
|
const back = () => {
|
|
@@ -205,6 +197,7 @@ export default defineComponent({
|
|
|
router,
|
|
|
isEdit,
|
|
|
back,
|
|
|
+ oldDataModel,
|
|
|
v$
|
|
|
}
|
|
|
}
|