|
@@ -29,7 +29,8 @@
|
|
<el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
|
|
<el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
|
|
<cForm :span="24" :fields="formFields" :form="form" :rules="rules" @save="toSave">
|
|
<cForm :span="24" :fields="formFields" :form="form" :rules="rules" @save="toSave">
|
|
<template #office>
|
|
<template #office>
|
|
- <el-option @click="toChange(i)" v-for="i in officeList" :key="i._id" :label="i.name" :value="i._id"></el-option>
|
|
|
|
|
|
+ <el-option @click="toChange(i)" v-for="i in officeList" :key="i._id" :label="i.name"
|
|
|
|
+ :value="i._id"></el-option>
|
|
</template>
|
|
</template>
|
|
<template #is_use>
|
|
<template #is_use>
|
|
<el-radio v-for="(i, index) in is_useList" :key="index" :label="i.value">{{ i.label }}</el-radio>
|
|
<el-radio v-for="(i, index) in is_useList" :key="index" :label="i.value">{{ i.label }}</el-radio>
|
|
@@ -77,7 +78,7 @@ let total: Ref<number> = ref(0);
|
|
let skip = 0;
|
|
let skip = 0;
|
|
let limit: number = proxy.$limit;
|
|
let limit: number = proxy.$limit;
|
|
let fields: Ref<any[]> = ref([
|
|
let fields: Ref<any[]> = ref([
|
|
- { label: '街道/社区', model: 'office', format: (i: any) => getDict(i, 'office') },
|
|
|
|
|
|
+ { label: '街道', model: 'office', format: (i: any) => getDict(i, 'office') },
|
|
{ label: '领导', model: 'leader', custom: true },
|
|
{ label: '领导', model: 'leader', custom: true },
|
|
{ label: '会计', model: 'accounting', custom: true },
|
|
{ label: '会计', model: 'accounting', custom: true },
|
|
{ label: '是否使用', model: 'is_use', format: (i: any) => getDict(i, 'is_use') }
|
|
{ label: '是否使用', model: 'is_use', format: (i: any) => getDict(i, 'is_use') }
|
|
@@ -92,13 +93,13 @@ const dialog: Ref<{ type: string; show: boolean; title: string }> = ref({ type:
|
|
let form: Ref<{ leader: Array<any>; accounting: Array<any> }> = ref({ leader: [], accounting: [] });
|
|
let form: Ref<{ leader: Array<any>; accounting: Array<any> }> = ref({ leader: [], accounting: [] });
|
|
// 表单
|
|
// 表单
|
|
let formFields: Ref<any[]> = ref([
|
|
let formFields: Ref<any[]> = ref([
|
|
- { label: '街道/社区', model: 'office', type: 'select' },
|
|
|
|
|
|
+ { label: '街道', model: 'office', type: 'select' },
|
|
{ label: '领导', model: 'leader', custom: true },
|
|
{ label: '领导', model: 'leader', custom: true },
|
|
{ label: '会计', model: 'accounting', custom: true },
|
|
{ label: '会计', model: 'accounting', custom: true },
|
|
{ label: '是否使用', model: 'is_use', type: 'radio' }
|
|
{ label: '是否使用', model: 'is_use', type: 'radio' }
|
|
]);
|
|
]);
|
|
const rules = reactive<FormRules>({
|
|
const rules = reactive<FormRules>({
|
|
- office: [{ required: true, message: '街道/社区', trigger: 'blur' }],
|
|
|
|
|
|
+ office: [{ required: true, message: '街道', trigger: 'blur' }],
|
|
leader: [{ required: true, message: '领导', trigger: 'blur' }],
|
|
leader: [{ required: true, message: '领导', trigger: 'blur' }],
|
|
accounting: [{ required: true, message: '会计', trigger: 'blur' }]
|
|
accounting: [{ required: true, message: '会计', trigger: 'blur' }]
|
|
});
|
|
});
|
|
@@ -133,11 +134,9 @@ const toSearch = (query: any) => {
|
|
};
|
|
};
|
|
const toChange = async (val: any) => {
|
|
const toChange = async (val: any) => {
|
|
let res: IQueryResult;
|
|
let res: IQueryResult;
|
|
- let info: any = { status: '1' };
|
|
|
|
|
|
+ let info: any = { status: '1', street: val._id };
|
|
form.value.leader = [];
|
|
form.value.leader = [];
|
|
form.value.accounting = [];
|
|
form.value.accounting = [];
|
|
- if (val.type == '0') info.street = val._id;
|
|
|
|
- else if (val.type == '1') info.community = val._id;
|
|
|
|
// 领导
|
|
// 领导
|
|
res = await userAxios.query({ role: 'ld', ...info });
|
|
res = await userAxios.query({ role: 'ld', ...info });
|
|
if (res.errcode == '0') ldList.value = res.data;
|
|
if (res.errcode == '0') ldList.value = res.data;
|
|
@@ -233,8 +232,8 @@ const searchOther = async () => {
|
|
// 是否使用
|
|
// 是否使用
|
|
res = await dictData.query({ type: 'is_use' });
|
|
res = await dictData.query({ type: 'is_use' });
|
|
if (res.errcode == '0') is_useList.value = res.data;
|
|
if (res.errcode == '0') is_useList.value = res.data;
|
|
- // 街道/社区
|
|
|
|
- res = await officeAxios.query({ is_use: '0' });
|
|
|
|
|
|
+ // 街道
|
|
|
|
+ res = await officeAxios.query({ is_use: '0', type: '0' });
|
|
if (res.errcode == '0') officeList.value = res.data;
|
|
if (res.errcode == '0') officeList.value = res.data;
|
|
// 领导
|
|
// 领导
|
|
res = await userAxios.query({ role: 'ld', status: '1' });
|
|
res = await userAxios.query({ role: 'ld', status: '1' });
|