WANG 6 năm trước cách đây
mục cha
commit
c73c0ceccd
1 tập tin đã thay đổi với 94 bổ sung4 xóa
  1. 94 4
      src/modules/examwork/view/offlineExamOrgSettings.vue

+ 94 - 4
src/modules/examwork/view/offlineExamOrgSettings.vue

@@ -1,20 +1,110 @@
 <template>
   <div>
-    <section class="content"></section>
-    SB
+    <section class="content">
+      <div class="box-body">
+        <el-form
+          :model="formSearch"
+          :inline="true"
+          label-position="right"
+          label-width="80px"
+        >
+          <el-form-item label="学习中心">
+            <el-select
+              class="select"
+              :remote-method="getOrgList4Search"
+              :loading="loading4OrgSearch"
+              remote
+              filterable
+              clearable
+              v-model="formSearch.orgId"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in orgList4Search"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item class="pull-right">
+            <el-button type="primary" @click="search">查询</el-button>
+            <el-button @click="back">返 回</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </section>
   </div>
 </template>
 
 <script>
+import { CORE_API, EXAM_WORK_API } from "@/constants/constants.js";
+
 export default {
   data() {
     return {
-      examId: null
+      examId: null,
+      loading4FormSearch: false,
+      formSearch: {
+        examId: null,
+        orgId: ""
+      },
+      loading4OrgSearch: false,
+      orgList4Search: [],
+
+      tableData: [],
+      currentPage: 1,
+      pageSize: 10,
+      total: 0
     };
   },
-  methods: {},
+  methods: {
+    getOrgList4Search(name) {
+      this.loading4OrgSearch = true;
+      var url = CORE_API + "/org/query?" + new URLSearchParams({ name: name });
+      this.$http
+        .get(url)
+        .then(response => {
+          this.orgList4Search = response.data;
+          this.loading4OrgSearch = false;
+        })
+        .catch(response => {
+          console.log(response);
+          this.loading4OrgSearch = false;
+        });
+    },
+    back() {
+      this.$router.push({ path: "/examwork/examInfo" });
+    },
+    search() {
+      let param = new URLSearchParams(this.formSearch);
+      let url =
+        EXAM_WORK_API +
+        "/exam/getExamOrgSettingsList/" +
+        (this.currentPage - 1) +
+        "/" +
+        this.pageSize +
+        "?" +
+        param;
+      this.loading4FormSearch = true;
+      this.$http
+        .get(url)
+        .then(response => {
+          console.log(response);
+          this.tableData = response.data.list;
+          this.total = response.data.total;
+          this.loading4FormSearch = false;
+        })
+        .catch(response => {
+          console.log(response);
+          this.loading4FormSearch = false;
+        });
+    }
+  },
   created() {
     this.examId = this.$route.params.id;
+    this.formSearch.examId = this.examId;
   }
 };
 </script>