|
@@ -28,11 +28,8 @@
|
|
<template v-slot:info>
|
|
<template v-slot:info>
|
|
<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 #street>
|
|
|
|
- <el-option @click="toChange(i)" v-for="i in streetList" :key="i._id" :label="i.name" :value="i._id"></el-option>
|
|
|
|
- </template>
|
|
|
|
- <template #community>
|
|
|
|
- <el-option @click="toChange(i)" v-for="i in communityList" :key="i._id" :label="i.name" :value="i._id"></el-option>
|
|
|
|
|
|
+ <template #office>
|
|
|
|
+ <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>
|
|
@@ -80,8 +77,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: 'street', format: (i: any) => getDict(i, 'office') },
|
|
|
|
- { label: '所属社区', model: 'community', 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') }
|
|
@@ -96,14 +92,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: 'street', type: 'select' },
|
|
|
|
- { label: '所属社区', model: 'community', 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>({
|
|
- street: [{ 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' }]
|
|
});
|
|
});
|
|
@@ -112,8 +107,6 @@ let searchForm: Ref<any> = ref({});
|
|
// 字典表
|
|
// 字典表
|
|
let is_useList: Ref<any> = ref([]);
|
|
let is_useList: Ref<any> = ref([]);
|
|
let officeList: Ref<any> = ref([]);
|
|
let officeList: Ref<any> = ref([]);
|
|
-let streetList: Ref<any> = ref([]);
|
|
|
|
-let communityList: Ref<any> = ref([]);
|
|
|
|
let ldList: Ref<any> = ref([]);
|
|
let ldList: Ref<any> = ref([]);
|
|
let kjList: Ref<any> = ref([]);
|
|
let kjList: Ref<any> = ref([]);
|
|
|
|
|
|
@@ -149,9 +142,6 @@ const toChange = async (val: any) => {
|
|
// 会计
|
|
// 会计
|
|
res = await userAxios.query({ role: 'kj', ...info });
|
|
res = await userAxios.query({ role: 'kj', ...info });
|
|
if (res.errcode == '0') kjList.value = res.data;
|
|
if (res.errcode == '0') kjList.value = res.data;
|
|
- // 所属社区
|
|
|
|
- res = await officeAxios.query({ belong: val._id, type: '1', is_use: '0' });
|
|
|
|
- if (res.errcode == '0') communityList.value = res.data;
|
|
|
|
};
|
|
};
|
|
const getDict = (value: any, model: any) => {
|
|
const getDict = (value: any, model: any) => {
|
|
if (model == 'is_use') {
|
|
if (model == 'is_use') {
|
|
@@ -190,12 +180,8 @@ const toAdd = () => {
|
|
};
|
|
};
|
|
// 修改
|
|
// 修改
|
|
const toEdit = async (data: any) => {
|
|
const toEdit = async (data: any) => {
|
|
- let res;
|
|
|
|
form.value = data;
|
|
form.value = data;
|
|
- // 所属社区
|
|
|
|
- res = await officeAxios.query({ belong: data.street, type: '1', is_use: '0' });
|
|
|
|
- if (res.errcode == '0') communityList.value = res.data;
|
|
|
|
- toChange(data.street);
|
|
|
|
|
|
+ toChange(data.office);
|
|
dialog.value = { title: '信息管理', show: true, type: '1' };
|
|
dialog.value = { title: '信息管理', show: true, type: '1' };
|
|
};
|
|
};
|
|
// 提交保存
|
|
// 提交保存
|
|
@@ -206,7 +192,7 @@ const toSave = async (data: any) => {
|
|
if (res.errcode == 0) {
|
|
if (res.errcode == 0) {
|
|
ElMessage({ type: `success`, message: `维护信息成功` });
|
|
ElMessage({ type: `success`, message: `维护信息成功` });
|
|
toClose();
|
|
toClose();
|
|
- }
|
|
|
|
|
|
+ } else ElMessage({ type: `warning`, message: `${res.errmsg}` });
|
|
};
|
|
};
|
|
// 删除
|
|
// 删除
|
|
const toDel = async (data: any) => {
|
|
const toDel = async (data: any) => {
|
|
@@ -228,12 +214,9 @@ 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' });
|
|
if (res.errcode == '0') officeList.value = res.data;
|
|
if (res.errcode == '0') officeList.value = res.data;
|
|
- // 所属街道
|
|
|
|
- res = await officeAxios.query({ type: '0', is_use: '0' });
|
|
|
|
- if (res.errcode == '0') streetList.value = res.data;
|
|
|
|
// 领导
|
|
// 领导
|
|
res = await userAxios.query({ role: 'ld', status: '1' });
|
|
res = await userAxios.query({ role: 'ld', status: '1' });
|
|
if (res.errcode == '0') ldList.value = res.data;
|
|
if (res.errcode == '0') ldList.value = res.data;
|