|
@@ -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,
|