<template>
  <!-- 抽屉框表单 -->
  <el-drawer
      :title="title"
      :visible.sync="open"
      :direction="direction"
      size="90%">
    <el-divider></el-divider>

    <el-card style="padding: 20px" v-for="item in listData">
      <div slot="header">
        {{ item.feedbackName }}
        <span class="time">{{ formatDate(item.feedbackTime) }}</span>
      </div>
      <el-collapse accordion>
        <el-collapse-item name="content">
          <div slot="title">反馈内容</div>
          <div class="content">{{ item.feedback }}</div>
        </el-collapse-item>
      </el-collapse>
    </el-card>
    <el-divider></el-divider>
    <el-form ref="form" :model="form">
      <el-row style="padding: 20px">
        <Field :span="24" prop="name" v-model="form.name" :rows="6" type="textarea"/>
      </el-row>

      <el-row style="padding: 20px">
        <el-button style="float: right" type="primary" @click="submitForm">保 存</el-button>
      </el-row>

    </el-form>


  </el-drawer>
</template>

<script>
import moment from 'moment';

export default {
  name: "trackDrawerShow",

  components: {},
  created() {

    console.log(this.$route.query)

  },
  data() {
    return {
      rows: 6,
      form: {},
      // 遮罩层
      loading: true,
      // 弹出层标题
      title: "跟踪反馈数据",
      // 是否显示弹出层
      open: false,
      direction: "rtl",
      activeNames: ['content'],
      listData: [],
      toString: [],
      toDate: [],

    };
  },

  methods: {

    formatDate(value) {
      return moment(value).format("YYYY-MM-DD HH:mm:ss")
    },

    submitForm(row) {

    },

    view(row) {
      console.log("row", row)
      this.$post("/care/constraint/track/list", {"careId": row.id})
          .then((res) => {
            if (res && res.code && res.code == 1) {
              if (res.data.data.length > 0) {

                console.log(res.data.data)

                this.listData = res.data.data


              }
            }
          })
          .catch((error) => {
            this.$message.error(error.message);
          });


      this.open = true
    },
  },
};
</script>
<style scoped>
.time {
  float: right;
}

.content {
  margin-top: 10px;
}
</style>
