|
@@ -23,15 +23,24 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="服务接口默认考试ID"
|
|
|
- prop="THIRD_PARTY_API_DEFAULT_EXAM_ID"
|
|
|
- >
|
|
|
- <el-input
|
|
|
+ <el-form-item label="服务接口默认考试ID">
|
|
|
+ <el-select
|
|
|
+ class="input"
|
|
|
+ :remote-method="queryExams4Select"
|
|
|
+ remote
|
|
|
+ :loading="queryExams4SelectLoading"
|
|
|
+ filterable
|
|
|
v-model="ruleForm.THIRD_PARTY_API_DEFAULT_EXAM_ID"
|
|
|
- placeholder="请输入考试ID"
|
|
|
- class="input-width"
|
|
|
- ></el-input>
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in examList4Select"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ :key="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button
|
|
@@ -48,6 +57,7 @@
|
|
|
<script>
|
|
|
import { mapState } from "vuex";
|
|
|
import { CORE_API } from "@/constants/constants.js";
|
|
|
+import { EXAM_WORK_API } from "@/constants/constants.js";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -59,14 +69,37 @@ export default {
|
|
|
ruleForm: {
|
|
|
relatedPropertyGroupIdList: [],
|
|
|
orgId: null,
|
|
|
- THIRD_PARTY_API_DEFAULT_EXAM_ID: "",
|
|
|
+ THIRD_PARTY_API_DEFAULT_EXAM_ID: null,
|
|
|
properties: {
|
|
|
- THIRD_PARTY_API_DEFAULT_EXAM_ID: ""
|
|
|
+ THIRD_PARTY_API_DEFAULT_EXAM_ID: null
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ queryExams4SelectLoading: false,
|
|
|
+ examList4Select: [],
|
|
|
+ rules: {}
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ queryExams4Select(name) {
|
|
|
+ console.log("queryExams; name: " + name);
|
|
|
+ this.queryExams4SelectLoading = true;
|
|
|
+ this.$httpWithMsg
|
|
|
+ .get(
|
|
|
+ EXAM_WORK_API +
|
|
|
+ "/exam/queryByNameLike?rootOrgId=" +
|
|
|
+ this.ruleForm.orgId +
|
|
|
+ "&name=" +
|
|
|
+ name
|
|
|
+ )
|
|
|
+ .then(response => {
|
|
|
+ this.queryExams4SelectLoading = false;
|
|
|
+ this.examList4Select = response.data;
|
|
|
+ })
|
|
|
+ .catch(response => {
|
|
|
+ console.log(response);
|
|
|
+ this.queryExams4SelectLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
submitForm(formName) {
|
|
|
this.$refs[formName].validate(valid => {
|
|
|
if (valid) {
|
|
@@ -101,8 +134,20 @@ export default {
|
|
|
this.propertyGroupId;
|
|
|
this.$httpWithMsg.get(url).then(response => {
|
|
|
if (response) {
|
|
|
- this.ruleForm.THIRD_PARTY_API_DEFAULT_EXAM_ID =
|
|
|
- response.data.THIRD_PARTY_API_DEFAULT_EXAM_ID;
|
|
|
+ let examId = response.data.THIRD_PARTY_API_DEFAULT_EXAM_ID;
|
|
|
+ this.ruleForm.THIRD_PARTY_API_DEFAULT_EXAM_ID == examId;
|
|
|
+
|
|
|
+ this.examList4Select = [];
|
|
|
+ if (examId != null && examId != "") {
|
|
|
+ this.ruleForm.THIRD_PARTY_API_DEFAULT_EXAM_ID = parseInt(examId);
|
|
|
+ this.$httpWithMsg
|
|
|
+ .get(EXAM_WORK_API + "/exam/" + examId)
|
|
|
+ .then(response => {
|
|
|
+ this.examList4Select = [
|
|
|
+ { id: response.data.id, name: response.data.name }
|
|
|
+ ];
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
this.originalRuleForm = Object.assign({}, this.ruleForm);
|
|
|
} else {
|