zhangjie 1 anno fa
parent
commit
76b94dedf7

+ 1 - 0
config/vite.config.dev.ts

@@ -19,6 +19,7 @@ export default mergeConfig(
       hmr: {
       hmr: {
         overlay: false,
         overlay: false,
       },
       },
+      host: '0.0.0.0',
     },
     },
     plugins: [
     plugins: [
       eslint({
       eslint({

+ 7 - 8
src/api/order.ts

@@ -13,6 +13,7 @@ import type {
   OrderRecordPrintTimeItem,
   OrderRecordPrintTimeItem,
   OrderRecordPrintParam,
   OrderRecordPrintParam,
   ExportOrderRecordDetailParam,
   ExportOrderRecordDetailParam,
+  AgentQueryParam,
 } from './types/order';
 } from './types/order';
 import { AbleParams, PageParams } from './types/common';
 import { AbleParams, PageParams } from './types/common';
 
 
@@ -22,16 +23,14 @@ export function taskQuery(): Promise<OptionItem[]> {
   return axios.post('/api/admin/apply/task/list', {});
   return axios.post('/api/admin/apply/task/list', {});
 }
 }
 // 通用查询-教学点查询
 // 通用查询-教学点查询
-export function teachingQuery(): Promise<OptionItem[]> {
-  return axios.post('/api/admin/apply/teaching/list', {});
+export function teachingQuery(params: {
+  flag?: boolean;
+}): Promise<OptionItem[]> {
+  return axios.post('/api/admin/apply/teaching/list', {}, { params });
 }
 }
 // 通用查询-考点查询
 // 通用查询-考点查询
-export function agentQuery(teachingId: number): Promise<OptionItem[]> {
-  return axios.post(
-    '/api/admin/apply/agent/list',
-    {},
-    { params: { id: teachingId } }
-  );
+export function agentQuery(params: AgentQueryParam): Promise<OptionItem[]> {
+  return axios.post('/api/admin/apply/agent/list', {}, { params });
 }
 }
 // 通用查询-城市查询
 // 通用查询-城市查询
 export function cityQuery(): Promise<OptionItem[]> {
 export function cityQuery(): Promise<OptionItem[]> {

+ 5 - 0
src/api/types/order.ts

@@ -5,6 +5,11 @@ export interface OptionItem {
   name: string;
   name: string;
 }
 }
 
 
+export interface AgentQueryParam {
+  id: number; // teachingId
+  flag?: boolean;
+}
+
 export interface TaskListFilter {
 export interface TaskListFilter {
   name: string;
   name: string;
 }
 }

+ 3 - 1
src/components/import-dialog/index.vue

@@ -305,7 +305,9 @@
     emit('validError', result.value);
     emit('validError', result.value);
   }
   }
   function handleExceededSize() {
   function handleExceededSize() {
-    const content = `文件大小不能超过${Math.floor(props.maxSize / 1024)}M`;
+    const content = `文件大小不能超过${Math.floor(
+      props.maxSize / (1024 * 1024)
+    )}M`;
     result.value = {
     result.value = {
       success: false,
       success: false,
       message: content,
       message: content,

+ 6 - 2
src/components/select-agent/index.vue

@@ -5,7 +5,7 @@
     :allow-clear="clearable"
     :allow-clear="clearable"
     :disabled="disabled"
     :disabled="disabled"
     :options="optionList"
     :options="optionList"
-    filter-option
+    allow-search
     popup-container="body"
     popup-container="body"
     v-bind="attrs"
     v-bind="attrs"
     @change="onChange"
     @change="onChange"
@@ -31,6 +31,7 @@
     multiple?: boolean;
     multiple?: boolean;
     teachingId: number | null;
     teachingId: number | null;
     prefix?: boolean;
     prefix?: boolean;
+    flag?: boolean;
   }>();
   }>();
 
 
   const emit = defineEmits(['update:modelValue', 'change']);
   const emit = defineEmits(['update:modelValue', 'change']);
@@ -47,7 +48,10 @@
     optionList.value = [];
     optionList.value = [];
     if (!props.teachingId) return;
     if (!props.teachingId) return;
 
 
-    const resData = await agentQuery(props.teachingId);
+    const resData = await agentQuery({
+      id: props.teachingId,
+      flag: props.flag ? props.flag : undefined,
+    });
 
 
     optionList.value = (resData || []).map((item) => {
     optionList.value = (resData || []).map((item) => {
       return { ...item, value: item.id, label: item.name };
       return { ...item, value: item.id, label: item.name };

+ 1 - 1
src/components/select-city/index.vue

@@ -5,7 +5,7 @@
     :allow-clear="clearable"
     :allow-clear="clearable"
     :disabled="disabled"
     :disabled="disabled"
     :options="optionList"
     :options="optionList"
-    filter-option
+    allow-search
     popup-container="body"
     popup-container="body"
     v-bind="attrs"
     v-bind="attrs"
     @change="onChange"
     @change="onChange"

+ 1 - 1
src/components/select-task/index.vue

@@ -5,7 +5,7 @@
     :allow-clear="clearable"
     :allow-clear="clearable"
     :disabled="disabled"
     :disabled="disabled"
     :options="optionList"
     :options="optionList"
-    filter-option
+    allow-search
     popup-container="body"
     popup-container="body"
     v-bind="attrs"
     v-bind="attrs"
     @change="onChange"
     @change="onChange"

+ 5 - 2
src/components/select-teaching/index.vue

@@ -5,7 +5,7 @@
     :allow-clear="clearable"
     :allow-clear="clearable"
     :disabled="disabled"
     :disabled="disabled"
     :options="optionList"
     :options="optionList"
-    filter-option
+    allow-search
     popup-container="body"
     popup-container="body"
     v-bind="attrs"
     v-bind="attrs"
     @change="onChange"
     @change="onChange"
@@ -34,6 +34,7 @@
     multiple?: boolean;
     multiple?: boolean;
     prefix?: boolean;
     prefix?: boolean;
     prefixStr?: string;
     prefixStr?: string;
+    flag?: boolean;
   }>();
   }>();
   const emit = defineEmits(['update:modelValue', 'change']);
   const emit = defineEmits(['update:modelValue', 'change']);
   const attrs = useAttrs();
   const attrs = useAttrs();
@@ -47,7 +48,9 @@
   const optionList = ref<OptionListItem[]>([]);
   const optionList = ref<OptionListItem[]>([]);
   const search = async () => {
   const search = async () => {
     optionList.value = [];
     optionList.value = [];
-    const resData = await teachingQuery();
+    const datas = { flag: props.flag ? props.flag : undefined };
+
+    const resData = await teachingQuery(datas);
 
 
     optionList.value = (resData || []).map((item) => {
     optionList.value = (resData || []).map((item) => {
       return { ...item, value: item.id, label: item.name };
       return { ...item, value: item.id, label: item.name };

+ 15 - 15
src/views/base/agent-manage/modifyAgent.vue

@@ -11,20 +11,27 @@
   >
   >
     <template #title> {{ title }} </template>
     <template #title> {{ title }} </template>
     <a-form ref="formRef" :model="formData" :rules="rules" auto-label-width>
     <a-form ref="formRef" :model="formData" :rules="rules" auto-label-width>
-      <a-form-item field="name" label="考点名称">
+      <a-form-item field="teachingId" label="所属教学点">
+        <SelectTeaching
+          v-model="formData.teachingId"
+          placeholder="请选择"
+          allow-clear
+        />
+      </a-form-item>
+      <a-form-item field="code" label="考点代码">
         <a-input
         <a-input
-          v-model.trim="formData.name"
+          v-model.trim="formData.code"
           placeholder="请输入"
           placeholder="请输入"
           allow-clear
           allow-clear
-          :max-length="50"
+          :max-length="20"
         ></a-input>
         ></a-input>
       </a-form-item>
       </a-form-item>
-      <a-form-item field="code" label="考点代码">
+      <a-form-item field="name" label="考点名称">
         <a-input
         <a-input
-          v-model.trim="formData.code"
+          v-model.trim="formData.name"
           placeholder="请输入"
           placeholder="请输入"
           allow-clear
           allow-clear
-          :max-length="30"
+          :max-length="50"
         ></a-input>
         ></a-input>
       </a-form-item>
       </a-form-item>
       <a-form-item field="address" label="考点地址">
       <a-form-item field="address" label="考点地址">
@@ -35,13 +42,6 @@
           :max-length="100"
           :max-length="100"
         ></a-input>
         ></a-input>
       </a-form-item>
       </a-form-item>
-      <a-form-item field="teachingId" label="所属教学点">
-        <SelectTeaching
-          v-model="formData.teachingId"
-          placeholder="请选择"
-          allow-clear
-        />
-      </a-form-item>
     </a-form>
     </a-form>
 
 
     <template #footer>
     <template #footer>
@@ -107,8 +107,8 @@
         message: '请输入代码',
         message: '请输入代码',
       },
       },
       {
       {
-        maxLength: 30,
-        message: '代码不能超过30字符',
+        maxLength: 20,
+        message: '代码不能超过20字符',
       },
       },
     ],
     ],
     address: [
     address: [

+ 23 - 23
src/views/base/room-manage/modifyRoom.vue

@@ -11,20 +11,35 @@
   >
   >
     <template #title> {{ title }} </template>
     <template #title> {{ title }} </template>
     <a-form ref="formRef" :model="formData" :rules="rules" auto-label-width>
     <a-form ref="formRef" :model="formData" :rules="rules" auto-label-width>
-      <a-form-item field="name" label="考场名称">
+      <a-form-item field="teachingId" label="教学点">
+        <SelectTeaching
+          v-model="formData.teachingId"
+          placeholder="请选择"
+          allow-clear
+        />
+      </a-form-item>
+      <a-form-item field="examSiteId" label="考点">
+        <SelectAgent
+          v-model="formData.examSiteId"
+          placeholder="请选择"
+          allow-clear
+          :teaching-id="formData.teachingId"
+        />
+      </a-form-item>
+      <a-form-item field="code" label="考场代码">
         <a-input
         <a-input
-          v-model.trim="formData.name"
+          v-model.trim="formData.code"
           placeholder="请输入"
           placeholder="请输入"
           allow-clear
           allow-clear
-          :max-length="50"
+          :max-length="20"
         ></a-input>
         ></a-input>
       </a-form-item>
       </a-form-item>
-      <a-form-item field="code" label="考场代码">
+      <a-form-item field="name" label="考场名称">
         <a-input
         <a-input
-          v-model.trim="formData.code"
+          v-model.trim="formData.name"
           placeholder="请输入"
           placeholder="请输入"
           allow-clear
           allow-clear
-          :max-length="30"
+          :max-length="50"
         ></a-input>
         ></a-input>
       </a-form-item>
       </a-form-item>
       <a-form-item field="address" label="考场地址">
       <a-form-item field="address" label="考场地址">
@@ -45,21 +60,6 @@
           :step="1"
           :step="1"
         />
         />
       </a-form-item>
       </a-form-item>
-      <a-form-item field="teachingId" label="教学点">
-        <SelectTeaching
-          v-model="formData.teachingId"
-          placeholder="请选择"
-          allow-clear
-        />
-      </a-form-item>
-      <a-form-item field="examSiteId" label="考点">
-        <SelectAgent
-          v-model="formData.examSiteId"
-          placeholder="请选择"
-          allow-clear
-          :teaching-id="formData.teachingId"
-        />
-      </a-form-item>
     </a-form>
     </a-form>
 
 
     <template #footer>
     <template #footer>
@@ -127,8 +127,8 @@
         message: '请输入代码',
         message: '请输入代码',
       },
       },
       {
       {
-        maxLength: 30,
-        message: '代码不能超过30字符',
+        maxLength: 20,
+        message: '代码不能超过20字符',
       },
       },
     ],
     ],
     address: [
     address: [

+ 9 - 14
src/views/base/teaching-manage/modifyTeaching.vue

@@ -11,29 +11,24 @@
   >
   >
     <template #title> {{ title }} </template>
     <template #title> {{ title }} </template>
     <a-form ref="formRef" :model="formData" :rules="rules" auto-label-width>
     <a-form ref="formRef" :model="formData" :rules="rules" auto-label-width>
-      <a-form-item field="name" label="教学点名称">
+      <a-form-item field="code" label="教学点代码">
         <a-input
         <a-input
-          v-model.trim="formData.name"
+          v-model.trim="formData.code"
           placeholder="请输入"
           placeholder="请输入"
           allow-clear
           allow-clear
-          :max-length="50"
+          :max-length="20"
         ></a-input>
         ></a-input>
       </a-form-item>
       </a-form-item>
-      <a-form-item field="code" label="教学点代码">
+      <a-form-item field="name" label="教学点名称">
         <a-input
         <a-input
-          v-model.trim="formData.code"
+          v-model.trim="formData.name"
           placeholder="请输入"
           placeholder="请输入"
           allow-clear
           allow-clear
-          :max-length="30"
+          :max-length="50"
         ></a-input>
         ></a-input>
       </a-form-item>
       </a-form-item>
       <a-form-item field="cityId" label="城市">
       <a-form-item field="cityId" label="城市">
-        <select-city
-          v-model="formData.cityId"
-          placeholder="请选择"
-          filter-option
-          allow-clear
-        >
+        <select-city v-model="formData.cityId" placeholder="请选择" allow-clear>
         </select-city>
         </select-city>
       </a-form-item>
       </a-form-item>
     </a-form>
     </a-form>
@@ -100,8 +95,8 @@
         message: '请输入代码',
         message: '请输入代码',
       },
       },
       {
       {
-        maxLength: 30,
-        message: '代码不能超过30字符',
+        maxLength: 20,
+        message: '代码不能超过20字符',
       },
       },
     ],
     ],
     cityId: [
     cityId: [

+ 1 - 1
src/views/order/order-record-manage/printDialog.vue

@@ -32,7 +32,7 @@
           placeholder="请选择"
           placeholder="请选择"
           :allow-clear="false"
           :allow-clear="false"
           :options="optionList"
           :options="optionList"
-          filter-option
+          allow-search
           popup-container="body"
           popup-container="body"
         >
         >
         </a-select>
         </a-select>