提交 ad7dd5a7 authored 作者: wqq's avatar wqq

重点安全利用率权限问题处理

上级 0d05628d
...@@ -71,8 +71,9 @@ ...@@ -71,8 +71,9 @@
async (val: any) => { async (val: any) => {
if (val) { if (val) {
//重置表单 //重置表单
await resetFields();
await nextTick(); await nextTick();
await resetFields();
await setFieldsValue({ await setFieldsValue({
...val, ...val,
}); });
......
...@@ -111,8 +111,9 @@ ...@@ -111,8 +111,9 @@
async (val: any) => { async (val: any) => {
if (val) { if (val) {
//重置表单 //重置表单
await resetFields();
await nextTick(); await nextTick();
await resetFields();
await setFieldsValue({ await setFieldsValue({
...val, ...val,
}); });
......
...@@ -75,8 +75,9 @@ ...@@ -75,8 +75,9 @@
async (val: any) => { async (val: any) => {
if (val) { if (val) {
//重置表单 //重置表单
await resetFields();
await nextTick(); await nextTick();
await resetFields();
await setFieldsValue({ await setFieldsValue({
...val, ...val,
}); });
......
...@@ -67,41 +67,34 @@ ...@@ -67,41 +67,34 @@
}; };
}, },
}, },
// 用updateSchema更新不了
{ {
label: '区县', label: '区县',
field: 'countryCode', field: 'countryCode',
ifShow: () => { ifShow: () => {
return userStore?.userInfo?.userIdentity == '2' || userStore?.userInfo?.userIdentity == '1' ? true : false; return userStore?.userInfo?.userIdentity == '1' ? true : false;
}, },
component: 'ApiSelect', component: 'ApiSelect',
componentProps: ({ formModel, formActionType }) => { componentProps: {
console.log(formModel, 'formModel'); labelField: 'name',
if (userStore?.userInfo?.userIdentity == '2') { valueField: 'id',
const { updateSchema } = formActionType; },
updateSchema({ },
label: '区县', {
field: 'countryCode', label: '区县',
ifShow: true, field: 'countryCode',
componentProps: { ifShow: () => {
api: getTown, return userStore?.userInfo?.userIdentity == '2' ? true : false;
params: userStore?.userInfo?.codeRegion, },
labelField: 'name', component: 'ApiSelect',
valueField: 'id', componentProps: {
}, api: getTown,
}); params: userStore?.userInfo?.codeRegion,
} labelField: 'name',
return { valueField: 'id',
labelField: 'name',
valueField: 'id',
};
}, },
}, },
// {
// label: '年度',
// field: 'nd',
// component: 'InputNumber',
// },
{ {
label: '项目名称', label: '项目名称',
field: 'xmmc', field: 'xmmc',
...@@ -179,8 +172,9 @@ ...@@ -179,8 +172,9 @@
async (val: any) => { async (val: any) => {
if (val) { if (val) {
//重置表单 //重置表单
await resetFields();
await nextTick(); await nextTick();
await resetFields();
await setFieldsValue({ await setFieldsValue({
...val, ...val,
}); });
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
import cfzgForm from '../components/cfzgForm.vue'; import cfzgForm from '../components/cfzgForm.vue';
import { formSchema } from '../data'; import { formSchema } from '../data';
import { saveAdd, saveEdit } from '../api'; import { saveAdd, saveEdit } from '../api';
import { useUserStore } from '/@/store/modules/user';
// Emits声明 // Emits声明
const emit = defineEmits(['register', 'success']); const emit = defineEmits(['register', 'success']);
const activeKey = ref(['1', '2', '3', '4']); const activeKey = ref(['1', '2', '3', '4']);
...@@ -33,6 +34,7 @@ ...@@ -33,6 +34,7 @@
const jcForms = ref<any>(null); const jcForms = ref<any>(null);
const gkxfForms = ref<any>(null); const gkxfForms = ref<any>(null);
const cfzgForms = ref<any>(null); const cfzgForms = ref<any>(null);
const userStore: any = useUserStore();
//表单配置 //表单配置
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({ const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
labelWidth: 220, labelWidth: 220,
...@@ -77,6 +79,14 @@ ...@@ -77,6 +79,14 @@
let values = await validate(); let values = await validate();
const params = { ...kfForm, ...jcForm, ...gkxfForm, ...cfzgForm, ...values }; const params = { ...kfForm, ...jcForm, ...gkxfForm, ...cfzgForm, ...values };
if (userStore?.userInfo?.userIdentity != 1) {
// 获取市的值
params.cityCode = userStore?.userInfo?.codeRegion.substring(0, userStore?.userInfo?.codeRegion.length - 2) + '00';
}
// 土地使用权人4 如果有权限 再加个4
if (userStore?.userInfo?.userIdentity == '3' && !params.id) {
if (!params.countryCode) params.countryCode = userStore?.userInfo?.codeRegion;
}
setModalProps({ confirmLoading: true }); setModalProps({ confirmLoading: true });
console.log(params, 'params'); console.log(params, 'params');
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论