刘洋 7 달 전
부모
커밋
4deb8ba09d

+ 1 - 0
.eslintrc.js

@@ -75,5 +75,6 @@ module.exports = {
     'no-loop-func': 0,
     'guard-for-in': 0,
     'no-restricted-syntax': 0,
+    'no-nested-ternary': 0,
   },
 };

+ 5 - 1
src/components/select-agent/index.vue

@@ -91,7 +91,11 @@
   watch(
     () => props.teachingId,
     (val, oldval) => {
-      if (val !== oldval) {
+      if (!val) {
+        optionList.value = [];
+        selected.value = undefined;
+        emit('update:modelValue', selected.value || null);
+      } else if (val !== oldval) {
         search();
       }
     },

+ 13 - 0
src/components/select-teaching/index.vue

@@ -35,6 +35,7 @@
     prefix?: boolean;
     prefixStr?: string;
     flag?: boolean;
+    taskId?: any;
   }>();
   const emit = defineEmits(['update:modelValue', 'change', 'getOptions']);
   const attrs = useAttrs();
@@ -79,4 +80,16 @@
       immediate: true,
     }
   );
+  watch(
+    () => props.taskId,
+    (val) => {
+      if (!val) {
+        optionList.value = [];
+        selected.value = undefined;
+        emit('update:modelValue', selected.value || null);
+      } else {
+        search();
+      }
+    }
+  );
 </script>

+ 21 - 6
src/views/order/reservation-set/index.vue

@@ -12,6 +12,7 @@
         placeholder="请选择"
         allow-clear
         prefix-str="所约教学点"
+        :task-id="searchModel.taskId"
         @get-options="getTeachOptions"
       />
       <SelectAgent
@@ -167,8 +168,20 @@
   };
   onMounted(() => {});
   const search = () => {
-    if (!searchModel.taskId) {
-      Message.error('请选择任务');
+    if (
+      !searchModel.taskId ||
+      !searchModel.teachingId ||
+      !searchModel.examSiteId
+    ) {
+      Message.error(
+        `请选择${
+          !searchModel.taskId
+            ? '任务'
+            : !searchModel.teachingId
+            ? '教学点'
+            : '考点'
+        }`
+      );
       tableData.value = [];
       tableKey.value = `${Date.now()}`;
       return;
@@ -233,10 +246,12 @@
   const selfYYDefaultValue = ref<any>(null);
   watch(
     () => searchModel.teachingId,
-    () => {
-      selfYYDefaultValue.value = teachOptions.find(
-        (item: any) => item.id === searchModel.teachingId
-      ).selfApplyEnable;
+    (val) => {
+      if (val) {
+        selfYYDefaultValue.value = teachOptions.find(
+          (item: any) => item.id === searchModel.teachingId
+        ).selfApplyEnable;
+      }
     }
   );
   const selfYY = (bool: string | number | boolean) => {

+ 8 - 1
src/views/order/user-manage/addUserDialog.vue

@@ -28,7 +28,11 @@
           allow-clear
         />
       </a-form-item>
-      <a-form-item field="categoryId" label="教学点">
+      <a-form-item
+        v-if="formData.roleCode !== 'ADMIN'"
+        field="categoryId"
+        label="教学点"
+      >
         <SelectTeaching
           v-model="formData.categoryId"
           placeholder="请选择"
@@ -114,6 +118,9 @@
     if (props.curRow) {
       params.id = props.curRow.id;
     }
+    if (params.roleCode === 'ADMIN') {
+      delete params.categoryId;
+    }
     addUser(params)
       .then(() => {
         Message.success('操作成功!');

+ 1 - 1
src/views/order/user-manage/index.vue

@@ -29,7 +29,7 @@
       class="page-table"
       :columns="columns"
       :data="dataList"
-      :pagination="false"
+      :pagination="pagination"
       :scroll="{ x: 1200 }"
       :bordered="false"
     >