Bladeren bron

编辑页面数据提交验证调整

liao-sea 11 maanden geleden
bovenliggende
commit
9d9c8b57cd

+ 14 - 1
vue/src/api/baseSettings/siteInfo.ts

@@ -56,4 +56,17 @@ export function saveSite(data: any) {
   );
 }
 
-
+export function delSite(data: any) {
+  return request<object>(
+    {
+      url: 'siteInfo/delete',
+      method: 'post',
+      data: data,
+    },
+    {
+      isNew: true,
+      successMsg: '删除成功!',
+      errorMsg: '删除失败!'
+    },
+  );
+}

+ 7 - 3
vue/src/views/baseSettings/institution/edit.vue

@@ -253,13 +253,17 @@ export default defineComponent({
           }
         });
       }
-      if (!isAllowCommit.value){
-        message.error("不允许添加相同的站点!");
-      }
     }
 
     const handleOk = () => {
       validateSameSite();
+      if (!isAllowCommit.value){
+        message.error("不允许添加相同的站点!");
+      }else  if(formData.dataModel.companyName==null||formData.dataModel.companyAddress ==null||formData.dataModel.fzrName==null||
+        formData.dataModel.fzrMobile==null||formData.dataModel.frName==null||formData.dataModel.frMobile==null||formData.dataModel.companyCode==null){
+        message.error("请填写完整的机构信息!");
+        isAllowCommit.value = false;
+      }
       if (formData.dataModel.name == "")isAllowCommit.value=false;
       if (isAllowCommit.value){
         formData.dataModel.manageSites = manageSites.value;

+ 8 - 3
vue/src/views/baseSettings/site/edit.vue

@@ -292,13 +292,18 @@ export default defineComponent({
           }
         });
       }
-      if (!isAllowCommit.value){
-        message.error("不允许添加相同的人员!");
-      }
     }
 
     const handleOk = () => {
       validateSameUser();
+      if (!isAllowCommit.value){
+        message.error("不允许添加相同的人员!");
+      }else if(formData.dataModel.siteCode==null||formData.dataModel.siteName ==null||formData.dataModel.institutionID==null||
+      formData.dataModel.regionCode==null||formData.dataModel.streetCode==null||formData.dataModel.detailAddress==null){
+        message.error("请填写完整的站点信息!");
+        isAllowCommit.value = false;
+      }
+
       if (isAllowCommit.value){
         formData.dataModel.manageUsers = manageUsers.value;
         saveSite(formData.dataModel).then(result => {

+ 4 - 2
vue/src/views/baseSettings/site/index.vue

@@ -86,7 +86,7 @@ import {reactive, ref, computed, defineComponent, createVNode} from 'vue';
 import {DownOutlined, ExclamationCircleOutlined, UpOutlined} from '@ant-design/icons-vue';
 import type {FormInstance} from 'ant-design-vue';
 import type {TableColumnsType, TableProps} from 'ant-design-vue';
-import {getSiteList} from '@/api/baseSettings/siteInfo';
+import {getSiteList,delSite} from '@/api/baseSettings/siteInfo';
 import {getRegionCodeList, getStreetCodeList} from "@/api/system/area/index";
 import SiteInfoEditForm from "@/views/baseSettings/site/edit.vue";
 import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
@@ -185,7 +185,9 @@ export default defineComponent({
         okButtonProps: {},
         cancelText: '取消',
         onOk() {
-
+          delSite(formState.selectedRowKeys).then(() => {
+            loadData();
+          });
         },
         onCancel() {
 

+ 20 - 9
vue/src/views/baseSettings/user/edit.vue

@@ -4,12 +4,13 @@
     v-model:visible="visible"
     :title="title"
     :confirm-loading="confirmLoading"
+    @ok="handleOk"
     ok-text="提交"
     @cancel="handleCancel"
     cancel-text="取消"
     :keyboard="false"
     :mask-closable="false"  >
-    <a-form :model="dataModel" autocomplete="off" @finish="handleOk">
+    <a-form :model="dataModel" autocomplete="off">
       <a-divider orientation="left">基础信息</a-divider>
       <a-row type="flex">
         <a-col :span="7">
@@ -56,6 +57,7 @@ import {getSiteUserByID, saveSiteUser} from "@/api/baseSettings/userInfo";
 import BUploadFile from "@/components/file/uploadFile.vue";
 import type {SelectProps} from "ant-design-vue";
 import {getSysDictionaryList} from "@/api/system/dictionary";
+import {message} from "ant-design-vue";
 
 interface InstitutionModel {
   dataModel: any;
@@ -75,6 +77,7 @@ export default defineComponent({
     const confirmLoading = ref<boolean>(false);
     const title = ref();
     const opCategory = ref<any>();
+    const isAllowCommit = ref<boolean>(false) ;
     const formState = reactive({
       total: 0,
       selectedRowKeys: [],
@@ -111,12 +114,19 @@ export default defineComponent({
     };
 
     const handleOk = () => {
-      saveSiteUser(formData.dataModel).then(result => {
-        if (result) {
-          visible.value = false;
-          props.loadData();
-        }
-      });
+      if(formData.dataModel.name==null||formData.dataModel.gender ==null||formData.dataModel.mobile==null|| formData.dataModel.roleID==null){
+        message.error("请填写完整的人员信息!");
+        isAllowCommit.value = false;
+      }
+      if(isAllowCommit.value){
+        saveSiteUser(formData.dataModel).then(result => {
+          if (result) {
+            visible.value = false;
+            props.loadData();
+          }
+        });
+      }
+
     };
 
     const handleCancel = () => {
@@ -126,10 +136,11 @@ export default defineComponent({
 
     return {
       ...toRefs(formData),
+      title,
+      visible,
       formState,
       opCategory,
-      visible,
-      title,
+      isAllowCommit,
       confirmLoading,
       genderList,
       roleList,

+ 2 - 2
vue/src/views/jobUserManager/jobhunt/index.vue

@@ -13,7 +13,7 @@
           </a-form-item>
         </a-col>
         <a-col :span="6">
-          <a-form-item label="求职类型" :label-col="{ span: 8 }" name="wantedJobId">
+          <a-form-item label="专业" :label-col="{ span: 8 }" name="wantedJobId">
             <a-select
               ref="select"
               v-model:value="searchParamsState.wantedJobId"
@@ -26,7 +26,7 @@
           </a-form-item>
         </a-col>
         <a-col :span="6">
-          <a-form-item label="是否完成求职" :label-col="{ span: 8 }" name="isAccomplish">
+          <a-form-item label="班级" :label-col="{ span: 8 }" name="isAccomplish">
             <a-select
               ref="select"
               v-model:value="searchParamsState.isAccomplish"