<template>
  <div class="p20">
    <h3 class="font-size-16">流动审批</h3>
    <el-form ref="form" :model="ldForm" class="ld-form" label-width="0px">
      <table class="form-table mt15" cellpadding="0" cellspacing="0">
        <tr>
          <td>
            <h3 class="font-size-14">流动教师</h3>
          </td>
          <td>
            <el-form-item prop="jwl_ldjs">
              <el-input v-model="ldForm.jwl_ldjs"></el-input>
            </el-form-item>
          </td>
          <td>
            <h3 class="font-size-14">调动生效日期</h3>
          </td>
          <td>
            <el-form-item prop="jwl_ddsxrq">
              <el-date-picker
                v-model="ldForm.jwl_ddsxrq"
                type="date"
                placeholder="选择日期"
                value-format="yyyy-MM-dd"
              >
              </el-date-picker>
            </el-form-item>
          </td>
        </tr>
        <tr>
          <td>
            <h3 class="font-size-14">调出部门</h3>
          </td>
          <td>
            <el-form-item prop="jwl_tcbm">
              <el-input v-model="ldForm.jwl_tcbm"></el-input>
            </el-form-item>
          </td>
          <td>
            <h3 class="font-size-14">调入部门</h3>
          </td>
          <td>
            <el-form-item prop="jwl_trbm">
              <el-input v-model="ldForm.jwl_trbm"></el-input>
            </el-form-item>
          </td>
        </tr>
        <tr>
          <td>
            <h3 class="font-size-14">调出岗位</h3>
          </td>
          <td>
            <el-form-item prop="jwl_tcgw">
              <el-input v-model="ldForm.jwl_tcgw"></el-input>
            </el-form-item>
          </td>
          <td>
            <h3 class="font-size-14">调入岗位</h3>
          </td>
          <td>
            <el-form-item prop="jwl_trgw">
              <el-input v-model="ldForm.jwl_trgw"></el-input>
            </el-form-item>
          </td>
        </tr>
        <tr>
          <td>
            <h3 class="font-size-14">调动前职务</h3>
          </td>
          <td>
            <el-form-item prop="jwl_thqzw">
              <el-input v-model="ldForm.jwl_thqzw"></el-input>
            </el-form-item>
          </td>
          <td>
            <h3 class="font-size-14">调动后职务</h3>
          </td>
          <td>
            <el-form-item prop="jwl_tdhzw">
              <el-input v-model="ldForm.jwl_tdhzw"></el-input>
            </el-form-item>
          </td>
        </tr>

        <tr>
          <td>
            <h3 class="font-size-14">调出原因</h3>
          </td>
          <td colspan="3">
            <el-form-item prop="jwl_tdyy">
              <el-input v-model="ldForm.jwl_tdyy"></el-input>
            </el-form-item>
          </td>
        </tr>
        <tr>
          <td>
            <h3 class="font-size-14">调出部门领导意见</h3>
          </td>
          <td colspan="3">
            <el-form-item prop="jwl_tcbmldyj">
              <el-input v-model="ldForm.jwl_tcbmldyj"></el-input>
            </el-form-item>
          </td>
        </tr>
        <tr>
          <td>
            <h3 class="font-size-14">调入部门领导意见</h3>
          </td>
          <td colspan="3">
            <el-form-item prop="jwl_trbmldyj">
              <el-input v-model="ldForm.jwl_trbmldyj"></el-input>
            </el-form-item>
          </td>
        </tr>
        <tr>
          <td>
            <h3 class="font-size-14">备注</h3>
          </td>
          <td colspan="3">
            <el-form-item prop="jwl_trczshzt">
              <el-input v-model="ldForm.jwl_trczshzt"></el-input>
            </el-form-item>
          </td>
        </tr>
      </table>
      <h3 class="font-size-16">我的审批</h3>
      <el-form
        :label-position="labelPosition"
        ref="form"
        :model="wdForm"
        label-width="80px"
      >
        <el-form-item label="操作：">
          <el-radio-group v-model="wdForm.resource">
            <el-radio label="通过"></el-radio>
            <el-radio label="不通过"></el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="处理建议:">
          <el-input type="textarea" v-model="wdForm.desc"></el-input>
        </el-form-item>
      </el-form>
      <div class="footer">
        <el-form-item>
          <el-button @click="formCancel">取 消</el-button>
          <el-button type="primary" @click="formSubmit">确 定</el-button>
        </el-form-item>
      </div>
    </el-form>
  </div>
</template>

<script>
import { ldlc_add } from "./api";

export default {
  name: "index",
  data() {
    return {
      labelPosition: "left",
      ldForm: {
        jwl_ldjs: "",
        jwl_ddsxrq: "",
        jwl_tcbm: "",
        jwl_trbm: "",
        jwl_tcgw: "",
        jwl_trgw: "",
        jwl_thqzw: "",
        jwl_tdhzw: "",
        jwl_tdyy: "",
        jwl_tcbmldyj: "",
        jwl_trbmldyj: "",
        jwl_trczshzt: "",
      },
      wdForm: {
        resource: "",
        desc: "",
      },
    };
  },
  methods: {
    formCancel() {
      this.$router.push({ name: "jsld_ldlc" });
    },
    formSubmit() {
      let data = {
        jwl_ldjs: this.ldForm.jwl_ldjs,
        jwl_ddsxrq: this.ldForm.jwl_ddsxrq,
        jwl_trbm: this.ldForm.jwl_trbm,
        jwl_trczshzt: this.ldForm.jwl_trczshzt,
      };

      ldlc_add(data).then((res) => {
        if (res.code == 1) {
          this.$message({
            message: "申请添加成功！",
            type: "success",
          });
          this.$router.push({ name: "jsld_ldlc" });
        } else {
          this.$message({
            message: res.msg,
            type: "error",
          });
        }
      });
    },
  },
  mounted() {},
};
</script>

<style lang="scss" scoped>
.form-table {
  width: 100%;
  border: 1px solid #dbdbdb;
  border-collapse: collapse;
  margin-bottom: 20px;
  td {
    padding: 8px 0;
    border: 1px solid #dbdbdb;
    &:nth-child(odd) {
      background: #f6f6f6;
      width: 20%;
      padding-left: 10px;
    }
    &:nth-child(even) {
      background: #fff;
      width: 30%;
    }
  }
  tr:nth-child(n + 5) td {
    &:nth-child(odd) {
      background: #f6f6f6;
      width: 20%;
      padding-left: 10px;
    }
    &:nth-child(even) {
      background: #fff;
      width: 80%;
    }
  }
}
.footer {
  width: 300px;
  height: 100px;
  margin: 0 auto;
  margin-top: 30px;
}
</style>

<style lang="scss">
.ld-form {
  .el-form-item {
    margin: 0;
    .el-input__inner {
      height: 25px !important;
      line-height: 25px !important;
      border: 0 !important;
      border-radius: 0 !important;
      padding: 0 15px;
    }
    .el-input__prefix {
      display: none;
      left: 0;
    }
  }
}
</style>