<template>
  <div class="cmain">
    <div class="div-mc">
      <div class="mttv">{{ form.templateName }}</div>
      <div class="message-bubble-received" v-if="form.type == 0">{{ form.op }}</div>
      <div class="items" v-for="(item, index) in op" :key="index">
        <div class="vtitle" style="font-weight: normal; font-size: 14px">
          <span class="ifnull" v-if="item.ifnull == '必填'">*</span>
          <span class="index">{{ index + 1 }},</span>
          <span class="tm">{{ item.name }} ({{ item.input }})</span>
        </div>
        <div class="mts">
          <input v-if="item.input == '填空'" v-model="item.s_value" :disabled="true" />
          <textarea v-if="item.input == '多行文本'" :disabled="true" v-model="item.s_value"></textarea>
          <input type="number" v-if="item.input == '数字'" v-model="item.s_value" :disabled="true" />
          <div class="ops">
            <div v-for="(op, i) in item.selects" :key="op.name">
              <div class="op" :class="{active:op.check}">{{ op.name }}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import selectPatient from './selectPatient';
export default {
  data() {
    return {
      form: {
        patientList: []
      },
      op: []
    };
  },
  mounted() {
    if (this.param.id) {
      this.ajax({ url: '/work/record/detail/' + this.param.id }).then((response) => {
        this.form = response.data;
        this.op = JSON.parse(response.data.op);
      });
    }
  },
  methods: {}
};
</script>
<style lang="scss" scoped></style>
