<template>
  <div>

    <el-card>
      <div style="
                  float: left;
                  text-align: left;
                  font-weight: bold;
                  margin-bottom: 8px;
                ">
        <span>产品标识:</span>
      </div>

      <el-table  :data="detailList" style="width: 100%" border key="3" highlight-current-row>
        <el-table-column label="产品最小销售标识" prop="nameCode" show-overflow-tooltip></el-table-column>
        <el-table-column label="物资名称" prop="cpmctymc" show-overflow-tooltip></el-table-column>
        <el-table-column label="包装级别" prop="packLevel" show-overflow-tooltip></el-table-column>
        <el-table-column label="包装单位" prop="packUnit" show-overflow-tooltip></el-table-column>
      </el-table>
    </el-card>
    <el-card>
      <el-form
        :model="editQuery"
        :rules="rules"
        ref="editQuery"
        label-width="100px"
        style="margin-top: 20px"
      >
        <el-collapse v-model="activeNames">
          <el-collapse-item name="1">
            <template slot="title">
              <p class="form-title">产品标识基本信息</p>
            </template>
            <el-row :gutter="20" class="el-row" type="flex">

              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>产品标识:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.nameCode"
                  ></el-input>
                </div>
              </el-col>

              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>最小包装单元内包含使用单元数量:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.zxxsbzbhsydysl"
                  ></el-input>
                </div>
              </el-col>
            </el-row>

            <el-row :gutter="20" class="el-row" type="flex">
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>包含下级产品编码:&nbsp;</span>
                  </div>

                  <el-input
                    style="width: 65%"
                    size="small"
                    :disabled="true"
                    splaceholder="请输入内容"
                    v-model="editQuery.bhxjcpbm"

                  ></el-input>
                </div>
              </el-col>

              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>包含最小销售包装数量:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    size="small"
                    :disabled="true"
                    splaceholder="请输入内容"
                    v-model="editQuery.bhzxxsbzsl"
                  ></el-input>
                </div>
              </el-col>
            </el-row>

          </el-collapse-item>

          <el-collapse-item name="2">
            <template slot="title">
              <p class="form-title">产品基本信息</p>
            </template>

            <el-row :gutter="20" class="el-row" type="flex">
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>物资名称:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    size="small"
                    splaceholder="请输入内容"
                    :disabled="true"
                    v-model="editQuery.cpmctymc"
                  ></el-input>
                </div>
              </el-col>

              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>规格型号:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.ggxh"
                  ></el-input>
                </div>
              </el-col>
            </el-row>

            <el-row :gutter="20" class="el-row" type="flex">
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>产品类别:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.cplb"
                  ></el-input>
                </div>
              </el-col>
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>分类编码:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.flbm"
                  ></el-input>
                </div>
              </el-col>

            </el-row>

            <el-row :gutter="20" class="el-row" type="flex">

              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>医疗器械注册人:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="ylqxzcrbarmc"
                    v-model="editQuery.ylqxzcrbarmc"
                  ></el-input>
                </div>
              </el-col>
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>注册人英文名称:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.ylqxzcrbarywmc"
                  ></el-input>
                </div>
              </el-col>

            </el-row>

            <el-row :gutter="20" class="el-row" type="flex">

              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>器械类别:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.cplx"
                  ></el-input>
                </div>
              </el-col>

              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>生产企业:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                  ></el-input>
                </div>
              </el-col>
            </el-row>

            <el-row :gutter="20" class="el-row" type="flex">

              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>商品条码:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    size="small" :disabled="true"
                    splaceholder="请输入内容"
                    v-model="editQuery.sptm"
                  ></el-input>
                </div>
              </el-col>
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>医保编码:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%" :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.ybbm"
                  ></el-input>
                </div>
              </el-col>
            </el-row>

            <el-row :gutter="20" class="el-row" type="flex">
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>统一社会信用号:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.tyshxydm"
                  ></el-input>
                </div>
              </el-col>
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>注册证/备案号:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.zczbhhzbapzbh"
                  ></el-input>
                </div>
              </el-col>
            </el-row>

            <el-row :gutter="20" class="el-row" type="flex">
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>产品描述:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="!checked"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.cpms"
                  ></el-input>
                </div>
              </el-col>
            </el-row>
          </el-collapse-item>


          <el-collapse-item name="3">
            <template slot="title">
              <p class="form-title">生产标识基本信息</p>
            </template>

            <el-row :gutter="20" class="el-row" type="flex">
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>是否包含批号:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.scbssfbhph"
                  ></el-input>
                </div>
              </el-col>
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>是否包含序列号:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    v-model="editQuery.scbssfbhxlh"
                    splaceholder="请输入内容"
                  ></el-input>
                </div>
              </el-col>
            </el-row>
            <el-row :gutter="20" class="el-row" type="flex">
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>是否包含生产日期:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.scbssfbhscrq"
                  ></el-input>
                </div>
              </el-col>
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>是否包含失效日期:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    v-model="editQuery.scbssfbhsxrq"
                    size="small"
                    splaceholder="请输入内容"
                  ></el-input>
                </div>
              </el-col>
            </el-row>


          </el-collapse-item>

          <el-collapse-item name="4">
            <template slot="title">
              <p class="form-title">包装标识信息</p>
            </template>

            <el-row :gutter="20" class="el-row" type="flex">
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>上级产品编码:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    :disabled="true"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.sjcpbm"
                  ></el-input>
                </div>
              </el-col>

              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>包装级别:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    size="small"
                    splaceholder="请输入内容"
                    :disabled="true"
                    v-model="editQuery.packLevel"
                  ></el-input>
                </div>
              </el-col>
            </el-row>
            <el-row :gutter="20" class="el-row" type="flex">
              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>包装层级:&nbsp;</span>
                  </div>

                  <el-input
                    style="width: 65%"
                    size="small"
                    splaceholder="请输入内容"
                    v-model="editQuery.bzcj"
                    :disabled="true"

                  ></el-input>
                </div>
              </el-col>

              <el-col :span="12" class="el-col">
                <div class="text item">
                  <div class="itemTag">
                    <span>包含下级包装数量:&nbsp;</span>
                  </div>
                  <el-input
                    style="width: 65%"
                    size="small"
                    splaceholder="请输入内容"
                    :disabled="true"
                    v-model="editQuery.bhxjsl"
                  ></el-input>
                </div>
              </el-col>
            </el-row>

          </el-collapse-item>

        </el-collapse>

      </el-form>
    </el-card>
  </div>
</template>

<script>

import { filterByUuid, selectOriginuuid } from '@/api/basic/product/udiInfo'

export default {
  name: "SelectDIDetailDialog",
  props: {
    editQuery: {
      type: Object,
      required: true,
    },
  },
  data() {
    return {
      activeNames: ['1'],
      detailList: []
    }
  },
  methods: {
    getDetailList(detailQuery) {
      selectOriginuuid(detailQuery)
        .then((response) => {
          this.detailList = response.data || [];
        })
        .catch(() => {
          this.detailList = [];
        });
    },
  },

  created() {
    //获取产品标识列表
    let ttquery = {
      uuid: this.editQuery.uuid,
    };
    this.getDetailList(ttquery);
  },
};
</script>

<style scoped>

.form-title {
  font-size: 16px;
  font-family: Noto Sans SC;
  font-weight: bold;
  color: #303133;
  padding-bottom: 17px;
  padding-top: 17px;
}
.itemTag {
  float: left;
  text-align: right;
  margin-top: 5px;
  padding-right: 10px;
  width: 35%;
}

.text {
  font-size: 13px;
  font-family: "Microsoft YaHei";
}



.edit-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 0px;
}

.el-row {
  display: flex;
}

/* .el-col {
  border-radius: 4px;
  flex-wrap: wrap;
} */

.el-table .cell.el-tooltip {
  white-space: pre-wrap;
}

.form-title {
  font-size: 16px;
  font-family: Noto Sans SC;
  font-weight: bold;
  color: #303133;
  padding-bottom: 17px;
  padding-top: 17px;
}
</style>
