<template>
  <d2-container class="page">
    <el-tabs value="first">
      <el-tab-pane label="转入成绩查询" name="first">
        原考地准考证号：
        <el-input v-model="in_ticket_no" style="width:220px" placeholder="请输入原考地准考证号"></el-input>

        &nbsp;&nbsp;<el-button type="primary"  @click="query()">确定</el-button>
        <font style="color:red;font-size:16px;font-weight:530">&nbsp;&nbsp;&nbsp;&nbsp;提醒: 2019年下半年之前（包括2019年）转入广西区内的成绩，可在此页面查询。</font>

        <el-table
          v-loading="loading"
          :data="scoreList"
          style="width: 100%">
          <el-table-column
            type="index"
            label="序号"
            width="100">
          </el-table-column>

          <el-table-column
            prop="yuankaodanwei"
            label="原考地"
            width="220">
          </el-table-column>
          <el-table-column
            prop="kechengdaihao"
            label="课程代码"
            width="120">
          </el-table-column>
          <el-table-column
            prop="kechengmingcheng"
            label="课程名称"
            width="200">
          </el-table-column>
          <el-table-column
            prop="chengji"
            label="成绩"
            width="100">
             <template slot-scope="scope">
                <span v-if="scope.row.chengji == '998' || scope.row.chengji == '999'">
                  免考
                </span>
                <span v-if="scope.row.chengji == '887' || scope.row.chengji == '888'">
                  课程顶替
                </span>
                <span  v-if="scope.row.chengji != '887' && scope.row.chengji != '888' && scope.row.chengji != '998' && scope.row.chengji != '999'">
                  <span v-if="scope.row.chengji == '-9'">
                    缺考
                  </span>
                  <span v-else-if="scope.row.chengji == '-3'">
                    违纪
                  </span>
                  <span v-else-if="scope.row.chengji == '-2'">
                    免考
                  </span>
                  <span v-else-if="scope.row.chengji == '-1'">
                    舞弊
                  </span>
                  <span v-else-if="scope.row.chengji == '200'">
                    免考
                  </span>
                  <span v-else-if="scope.row.chengji == '201'">
                    及格
                  </span>
                  <span v-else-if="scope.row.chengji == '202'">
                    中等
                  </span>
                  <span v-else-if="scope.row.chengji == '203'">
                    良好
                  </span>
                  <span v-else-if="scope.row.chengji == '204'">
                    优秀
                  </span>
                  <span v-else>
                   {{scope.row.chengji}}
                  </span>

                </span>
              </template>
          </el-table-column>
          
        </el-table>
      </el-tab-pane>
    </el-tabs>
  </d2-container>
</template>

<script>
import { mapState, mapActions } from "vuex";
import { json } from "body-parser";

export default {
  computed: {
    ...mapState({
      stdReg: state => state.enrol.StdReg,
      StdImageArray: state => state.enrol.StdImageArray,
      FrameParam: state => state.enrol.FrameParam
    }),
   
  },

  data() {
    return {
      loading: false,
      scoreList: [],
      in_ticket_no:""
    };
  },

  async mounted() {
    this.loading = true;
    this.init();
    this.loading = false;
  },
  methods: {
    //初始化专业
    async init() {
      this.$nextTick(() => {
          // this.query();
      });
    },
    async query() {
     if(!String(this.in_ticket_no)){
       this.alert("请填写原考地准考证");
       return;
     }

      this.loading = true;
      let res = await this.$http.post(
        "/by/byTurnInApply/searchTurninOld.htm",
        this.Qs.stringify({
           in_ticket_no:this.in_ticket_no
        }),
        this.$http.headers.FORM
      );
      this.scoreList = res.data.array;
      this.loading = false;
    }
  }
};
</script>

<style lang="scss" scoped>
@import "~@/assets/style/public.scss";
</style>
