Browse Source

修改显示街道社区

zs 1 year ago
parent
commit
e0d859591a

+ 8 - 9
src/views/system/buy/index.vue

@@ -29,7 +29,8 @@
         <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
           <cForm :span="24" :fields="formFields" :form="form" :rules="rules" @save="toSave">
             <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 #is_use>
               <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 limit: number = proxy.$limit;
 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: 'accounting', custom: true },
   { 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 formFields: Ref<any[]> = ref([
-  { label: '街道/社区', model: 'office', type: 'select' },
+  { label: '街道', model: 'office', type: 'select' },
   { label: '领导', model: 'leader', custom: true },
   { label: '会计', model: 'accounting', custom: true },
   { label: '是否使用', model: 'is_use', type: 'radio' }
 ]);
 const rules = reactive<FormRules>({
-  office: [{ required: true, message: '街道/社区', trigger: 'blur' }],
+  office: [{ required: true, message: '街道', trigger: 'blur' }],
   leader: [{ required: true, message: '领导', trigger: 'blur' }],
   accounting: [{ required: true, message: '会计', trigger: 'blur' }]
 });
@@ -133,11 +134,9 @@ const toSearch = (query: any) => {
 };
 const toChange = async (val: any) => {
   let res: IQueryResult;
-  let info: any = { status: '1' };
+  let info: any = { status: '1', street: val._id };
   form.value.leader = [];
   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 });
   if (res.errcode == '0') ldList.value = res.data;
@@ -233,8 +232,8 @@ const searchOther = async () => {
   // 是否使用
   res = await dictData.query({ type: 'is_use' });
   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;
   // 领导
   res = await userAxios.query({ role: 'ld', status: '1' });

+ 6 - 8
src/views/system/money/index.vue

@@ -78,7 +78,7 @@ let total: Ref<number> = ref(0);
 let skip = 0;
 let limit: number = proxy.$limit;
 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: 'accounting', custom: true },
   { label: '是否使用', model: 'is_use', format: (i: any) => getDict(i, 'is_use') }
@@ -93,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 formFields: Ref<any[]> = ref([
-  { label: '街道/社区', model: 'office', type: 'select' },
+  { label: '街道', model: 'office', type: 'select' },
   { label: '领导', model: 'leader', custom: true },
   { label: '会计', model: 'accounting', custom: true },
   { label: '是否使用', model: 'is_use', type: 'radio' }
 ]);
 const rules = reactive<FormRules>({
-  office: [{ required: true, message: '街道/社区', trigger: 'blur' }],
+  office: [{ required: true, message: '街道', trigger: 'blur' }],
   leader: [{ required: true, message: '领导', trigger: 'blur' }],
   accounting: [{ required: true, message: '会计', trigger: 'blur' }]
 });
@@ -134,11 +134,9 @@ const toSearch = (query: any) => {
 };
 const toChange = async (val: any) => {
   let res: IQueryResult;
-  let info: any = { status: '1' };
+  let info: any = { status: '1', street: val._id };
   form.value.leader = [];
   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 });
   if (res.errcode == '0') ldList.value = res.data;
@@ -234,8 +232,8 @@ const searchOther = async () => {
   // 是否使用
   res = await dictData.query({ type: 'is_use' });
   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;
   // 领导
   res = await userAxios.query({ role: 'ld', status: '1' });

+ 1 - 2
src/views/users/five/index.vue

@@ -56,7 +56,6 @@ let fields: Ref<any[]> = ref([
   { label: '性别', model: 'gender', format: (i: any) => getDict(i, genderList.value, 'dict') },
   { label: '角色', model: 'role', format: (i: any) => getDict(i, roleList.value, 'role') },
   { label: '所属街道', model: 'street', format: (i: any) => getDict(i, belongList.value, 'office') },
-  { label: '所属社区', model: 'community', format: (i: any) => getDict(i, belongList.value, 'office') },
   { label: '状态', model: 'status', format: (i: any) => getDict(i, statusList.value, 'dict') }
 ]);
 // 操作
@@ -158,7 +157,7 @@ const searchOther = async () => {
   res = await roleAxios.query({ type: 'role', is_use: '0' });
   if (res.errcode == '0') roleList.value = res.data;
   // 所属
-  res = await officeAxios.query({ is_use: '0' });
+  res = await officeAxios.query({ is_use: '0', type: '0' });
   if (res.errcode == '0') belongList.value = res.data;
   // 状态
   res = await dictAxios.query({ type: 'status', is_use: '0' });

+ 1 - 2
src/views/users/one/index.vue

@@ -56,7 +56,6 @@ let fields: Ref<any[]> = ref([
   { label: '性别', model: 'gender', format: (i: any) => getDict(i, genderList.value, 'dict') },
   { label: '角色', model: 'role', format: (i: any) => getDict(i, roleList.value, 'role') },
   { label: '所属街道', model: 'street', format: (i: any) => getDict(i, belongList.value, 'office') },
-  { label: '所属社区', model: 'community', format: (i: any) => getDict(i, belongList.value, 'office') },
   { label: '状态', model: 'status', format: (i: any) => getDict(i, statusList.value, 'dict') }
 ]);
 // 操作
@@ -158,7 +157,7 @@ const searchOther = async () => {
   res = await roleAxios.query({ type: 'role', is_use: '0' });
   if (res.errcode == '0') roleList.value = res.data;
   // 所属
-  res = await officeAxios.query({ is_use: '0' });
+  res = await officeAxios.query({ is_use: '0', type: '0' });
   if (res.errcode == '0') belongList.value = res.data;
   // 状态
   res = await dictAxios.query({ type: 'status', is_use: '0' });

+ 4 - 4
src/views/users/six/index.vue

@@ -6,7 +6,8 @@
           <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch"> </cSearch>
         </el-col>
         <el-col :span="24" class="two">
-          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @exam="toExam" @edit="toEdit" @del="toDel"> </cTable>
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @exam="toExam"
+            @edit="toEdit" @del="toDel"> </cTable>
         </el-col>
       </el-col>
     </el-row>
@@ -55,8 +56,7 @@ let fields: Ref<any[]> = ref([
   { label: '姓名', model: 'name', isSearch: true },
   { label: '性别', model: 'gender', format: (i: any) => getDict(i, genderList.value, 'dict') },
   { label: '角色', model: 'role', format: (i: any) => getDict(i, roleList.value, 'role') },
- { label: '所属街道', model: 'street', format: (i: any) => getDict(i, belongList.value, 'office') },
-  { label: '所属社区', model: 'community', format: (i: any) => getDict(i, belongList.value, 'office') },
+  { label: '所属街道', model: 'street', format: (i: any) => getDict(i, belongList.value, 'office') },
   { label: '状态', model: 'status', format: (i: any) => getDict(i, statusList.value, 'dict') }
 ]);
 // 操作
@@ -158,7 +158,7 @@ const searchOther = async () => {
   res = await roleAxios.query({ type: 'role', is_use: '0' });
   if (res.errcode == '0') roleList.value = res.data;
   // 所属
-  res = await officeAxios.query({ is_use: '0' });
+  res = await officeAxios.query({ is_use: '0', type: '0' });
   if (res.errcode == '0') belongList.value = res.data;
   // 状态
   res = await dictAxios.query({ type: 'status', is_use: '0' });

+ 1 - 2
src/views/users/thr/index.vue

@@ -56,7 +56,6 @@ let fields: Ref<any[]> = ref([
   { label: '性别', model: 'gender', format: (i: any) => getDict(i, genderList.value, 'dict') },
   { label: '角色', model: 'role', format: (i: any) => getDict(i, roleList.value, 'role') },
   { label: '所属街道', model: 'street', format: (i: any) => getDict(i, belongList.value, 'office') },
-  { label: '所属社区', model: 'community', format: (i: any) => getDict(i, belongList.value, 'office') },
   { label: '状态', model: 'status', format: (i: any) => getDict(i, statusList.value, 'dict') }
 ]);
 // 操作
@@ -158,7 +157,7 @@ const searchOther = async () => {
   res = await roleAxios.query({ type: 'role', is_use: '0' });
   if (res.errcode == '0') roleList.value = res.data;
   // 所属
-  res = await officeAxios.query({ is_use: '0' });
+  res = await officeAxios.query({ is_use: '0', type: '0' });
   if (res.errcode == '0') belongList.value = res.data;
   // 状态
   res = await dictAxios.query({ type: 'status', is_use: '0' });