<template>
    <div>
        <el-card class="el-card">
            <div v-if="!isImport" style="margin-bottom: 20px">
              <el-form :model="data" size="mini" label-width="150px">

                <el-row v-if="data.isAudit==2" type="flex" justify="end">
                  <el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px;margin-top: -10px">
                    <el-button type="primary" @click="checkPass(2)">通过</el-button>
                    <el-button type="primary" @click="checkPass(3)">不通过</el-button>
                  </el-button-group>
                </el-row>

                <div style="margin-bottom: 20px">
                  <el-row>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="产品编码:">
                        <el-input style="width: 90%" size="small"   :disabled="true"  placeholder="请输入内容" v-model="data.code"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="物资名称:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.name"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>

                  <el-row>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="规格型号:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.spec"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="计量单位:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.measname"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>

                  <el-row>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="生产企业:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.manufactory"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="注册证号:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.registerNo"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>

                  <el-row>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="医疗器械注册人:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.ylqxzcrbarmc"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="注册人英文名称:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.ylqxzcrbarywmc"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>

                  <el-row>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="产品类别:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.cplb"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="分类编码:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.flbm"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>

                  <el-row>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="商品条码:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.sptm"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="医保编码:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.ybbm"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>

                  <el-row>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="统一社会信用号:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.tyshxydm"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12" class="el-col">
                      <el-form-item label="器械类别:">
                        <el-input style="width: 90%" size="small"   :disabled="true" placeholder="请输入内容" v-model.trim="data.qxlb"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>


                  <el-row v-if="data.isAudit==2">
                    <el-col :span="12">
                      <el-form-item label="审核意见:">
                        <el-input style="width: 90%"  size="small" splaceholder="请输入审核意见" v-model="remark"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12" class="el-col" >
                      <el-form-item label="产品描述:">
                        <el-input style="width: 90%" :disabled="true" type="textarea" size="small" rows="1" placeholder="请输入内容" v-model.trim="data.cpms"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>
                </div>
              </el-form>
            </div>
        </el-card>
    </div>
</template>

<script>
import { updateDiProduct } from '@/api/supplier/supProductsAddDi'

export default {
    name: "ThrProductsDetail",
    props: {
        data: {
            type: Object,
            required: true,
        },
      close:{
        type:Function,
        required: true,
      },
    },
  data() {
    return {
      remark:"",
    }
  },
  methods: {

    checkPass(val) {
      let query = {
        id: this.data.id,
        status: val,
        uuid: this.data.uuid,
        customerId: this.data.customerId,
        remark: this.remark
      }
      updateDiProduct(query).then((res) => {
        if (res.code === 20000) {
          this.close();
        } else {
          this.$message.error(res.message)
        }
      }).catch((error) => {
        this.$message.error(error.message)
      })
    },


  },

}
</script>

<style scoped>

</style>
