<template>
  <div class="content-main">
    <div class="title">距离合同完成时间提前提醒时间设置</div>
    <table class="table" cellspacing="0" border style="text-align: center">
      <tr>
        <td>项目</td>
        <td>时间（天）</td>
        <td>设置时间</td>
      </tr>
      <tr>
        <td>提前提醒时间设置</td>
        <td>
          <el-input
            v-model="sj"
            placeholder="请输入内容"
            max="7"
            clearable
          ></el-input>
        </td>
        <td>
          {{ time }}
        </td>
      </tr>
    </table>
    <div style="text-align: center">
      <el-button
        type="primary"
        class="iconfont iconbaocun"
        size="small"
        @click="preserve"
        >保存</el-button
      >
    </div>
  </div>
</template>

<script>
import { htsjtxsz, htsjtxcx } from "@/api/ReceivingDeposit/index";
export default {
  data() {
    return {
      sj: "",
      time: "",
    };
  },
  created() {
    this.getmsg();
  },
  methods: {
    // 获取信息
    getmsg() {
      htsjtxcx().then((res) => {
        if (res.infoCode == 200 && res.success) {
          this.sj = res.data.sj;
          this.time = res.data.szsj;
        }
      });
    },
    preserve() {
      htsjtxsz({ sj: this.sj }).then((res) => {
        if (res.infoCode == 200 && res.success) {
          this.$message({
            message: res.msg,
            type: "success",
          });
          this.getmsg();
        }
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.content-main {
  width: 700px;
}
.table {
  margin: 10px 0;

  td {
    text-align: center !important;
  }
}
</style>