12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <template>
- <el-dialog
- ref="dialog"
- title="复制考试批次"
- width="450px"
- :visible.sync="visible"
- @close="closeDialog"
- >
- <el-form
- :model="form"
- ref="form"
- :rules="rules"
- label-position="right"
- label-width="120px"
- >
- <el-row>
- <el-form-item label="批次名称" prop="name">
- <el-input
- class="pull_length"
- v-model="form.name"
- placeholder="批次名称"
- />
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item label="批次编码" prop="code">
- <el-input
- class="pull_length"
- v-model="form.code"
- placeholder="批次编码"
- disabled
- />
- </el-form-item>
- </el-row>
- <el-row class="d-flex justify-content-center">
- <el-button type="primary" @click="submitForm">保 存</el-button>
- <el-button @click="closeDialog">取 消</el-button>
- </el-row>
- </el-form>
- </el-dialog>
- </template>
- <script>
- import { copyExam } from "@/api/examwork-exam";
- export default {
- name: "CopyExamDialog",
- props: {
- exam: Object,
- },
- data() {
- return {
- visible: false,
- form: {
- name: "",
- code: "",
- },
- rules: {},
- };
- },
- watch: {
- "form.name"(val) {
- this.form.code = val;
- },
- },
- methods: {
- openDialog() {
- this.visible = true;
- },
- closeDialog() {
- this.visible = false;
- },
- async submitForm() {
- await copyExam({
- sourceId: this.exam.id,
- code: this.form.code,
- name: this.form.name,
- });
- this.$emit("reload");
- this.closeDialog();
- },
- },
- };
- </script>
- <style></style>
|