<template>
  <div>
    <el-form :model="filterQuery" label-width="120px" ref="dataForm">
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="医疗目录编码:" prop="name">
            <el-input style="width: 90%" size="small"
                      disabled
                      v-model.trim="filterQuery.medCatalogCode"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="耗材名称:" prop="spmc">
            <el-input style="width: 90%" size="small" placeholder="请输入商品名称"
                      disabled
                      v-model.trim="filterQuery.consumableName"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="器械唯一标识码:" prop="deviceUniqueCode">
            <el-input style="width: 90%" size="small" placeholder="医疗器械唯一标识码"
                      disabled
                      v-model.trim="filterQuery.deviceUniqueCode"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="包装单位:" prop="packUnit">
            <el-input style="width: 90%" size="small" placeholder="请输入包装单位"
                      disabled
                      v-model.trim="filterQuery.insuranceGenericCode"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="制剂规格:" prop="prepnSpec">
            <el-input style="width: 90%" size="small" placeholder="请输入制剂规格"
                      disabled
                      v-model.trim="filterQuery.insuranceGenericName"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="制剂单位:" prop="prepnUnit">
            <el-input style="width: 90%" size="small" placeholder="请输入制剂单位"
                      disabled
                      v-model.trim="filterQuery.productModel"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="包装材质:" prop="packMatrial">
            <el-input style="width: 90%" size="small" placeholder="请输入包装材质"
                      disabled
                      v-model.trim="filterQuery.specCode"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="规格:" prop="packRatio">
            <el-input style="width: 90%" size="small" placeholder="请输入规格"
                      disabled
                      v-model.trim="filterQuery.specification"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="耗材分类:" prop="registerNo">
            <el-input style="width: 90%" size="small" placeholder="请输入耗材分类"
                      disabled
                      v-model.trim="filterQuery.consumableCategory"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="规格型号:" prop="specModel">
            <el-input style="width: 90%" size="small" placeholder="请输入规格型号"
                      disabled
                      v-model.trim="filterQuery.specModel"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="材质代码:" prop="materialCode">
            <el-input style="width: 90%" size="small" placeholder="请输入材质代码"
                      disabled
                      v-model.trim="filterQuery.materialCode"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="耗材材质:" prop="consumableMaterial">
            <el-input style="width: 90%" size="small" placeholder="请输入耗材材质"
                      disabled
                      v-model.trim="filterQuery.consumableMaterial"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="包装规格:" prop="packagingSpec">
            <el-input style="width: 90%" size="small" placeholder="请输入包装规格"
                      disabled
                      v-model.trim="filterQuery.packagingSpec"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="包装数量:" prop="packagingQuantity">
            <el-input style="width: 90%" size="small" placeholder="请输入包装数量"
                      disabled
                      v-model.trim="filterQuery.packagingQuantity"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="产品包装材质:" prop="packagingMaterial">
            <el-input style="width: 90%" size="small" placeholder="请输入产品包装材质"
                      disabled
                      v-model.trim="filterQuery.packagingMaterial"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="包装单位:" prop="packagingUnit">
            <el-input style="width: 90%" size="small" placeholder="请输入包装单位"
                      disabled
                      v-model.trim="filterQuery.packagingUnit"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="产品转换比:" prop="productConversionRate">
            <el-input style="width: 90%" size="small" placeholder="产品转换比"
                      disabled
                      v-model.trim="filterQuery.productConversionRate"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="使用最小单位:" prop="minUsageUnit">
            <el-input style="width: 90%" size="small" placeholder="使用最小单位"
                      disabled
                      v-model.trim="filterQuery.minUsageUnit"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>


      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="产品转换比:" prop="productConversionRate">
            <el-input style="width: 90%" size="small" placeholder="产品转换比"
                      disabled
                      v-model.trim="filterQuery.productConversionRate"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="生产地类别:" prop="productionAreaType">
            <el-input style="width: 90%" size="small" placeholder="生产地类别"
                      disabled
                      v-model.trim="filterQuery.productionAreaType"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="生产地类别名称:" prop="productionAreaName">
            <el-input style="width: 90%" size="small" placeholder="生产地类别名称"
                      disabled
                      v-model.trim="filterQuery.productionAreaName"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="产品标准:" prop="productStandard">
            <el-input style="width: 90%" size="small" placeholder="产品标准"
                      disabled
                      v-model.trim="filterQuery.productStandard"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="产品有效期:" prop="productExpiry">
            <el-input style="width: 90%" size="small" placeholder="产品有效期"
                      disabled
                      v-model.trim="filterQuery.productExpiry"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="性能结构与组成:" prop="structureComposition">
            <el-input style="width: 90%" size="small" placeholder="性能结构与组成"
                      disabled
                      v-model.trim="filterQuery.structureComposition"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="适用范围:" prop="applicableScope">
            <el-input style="width: 90%" size="small" placeholder="适用范围"
                      disabled
                      v-model.trim="filterQuery.applicableScope"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="产品使用方法:" prop="usageMethod">
            <el-input style="width: 90%" size="small" placeholder="产品使用方法"
                      disabled
                      v-model.trim="filterQuery.usageMethod"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="产品图片编号:" prop="productImageCode">
            <el-input style="width: 90%" size="small" placeholder="产品图片编号"
                      disabled
                      v-model.trim="filterQuery.productImageCode"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="产品质量标准:" prop="qualityStandard">
            <el-input style="width: 90%" size="small" placeholder="产品质量标准"
                      disabled
                      v-model.trim="filterQuery.qualityStandard"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="说明书:" prop="instructions">
            <el-input style="width: 90%" size="small" placeholder="说明书"
                      disabled
                      v-model.trim="filterQuery.instructions"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="其他证明材料:" prop="otherCertMaterials">
            <el-input style="width: 90%" size="small" placeholder="其他证明材料"
                      disabled
                      v-model.trim="filterQuery.otherCertMaterials"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="专机专用标志:" prop="dedicatedMachineFlag">
            <el-input style="width: 90%" size="small" placeholder="专机专用标志"
                      disabled
                      v-model.trim="filterQuery.dedicatedMachineFlag"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="专机名称:" prop="dedicatedMachineName">
            <el-input style="width: 90%" size="small" placeholder="专机名称"
                      disabled
                      v-model.trim="filterQuery.dedicatedMachineName"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="组套名称:" prop="setNames">
            <el-input style="width: 90%" size="small" placeholder="组套名称"
                      disabled
                      v-model.trim="filterQuery.setNames"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="机套标志:" prop="setFlag">
            <el-input style="width: 90%" size="small" placeholder="机套标志"
                      disabled
                      v-model.trim="filterQuery.setFlag"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="限制使用标志:" prop="usageRestrictionFlag">
            <el-input style="width: 90%" size="small" placeholder="限制使用标志"
                      disabled
                      v-model.trim="filterQuery.usageRestrictionFlag"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="医保限用范围:" prop="insuranceUsageScope">
            <el-input style="width: 90%" size="small" placeholder="医保限用范围"
                      disabled
                      v-model.trim="filterQuery.insuranceUsageScope"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="最小销售单位:" prop="inSalesUnit">
            <el-input style="width: 90%" size="small" placeholder="最小销售单位"
                      disabled
                      v-model.trim="filterQuery.inSalesUnit"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="高值耗材标志:" prop="highValueConsumableFlag">
            <el-input style="width: 90%" size="small" placeholder="高值耗材标志"
                      disabled
                      v-model.trim="filterQuery.highValueConsumableFlag"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex" >
        <el-col :span="11" class="el-col">
          <el-form-item label="医用材料分类代码:" prop="medicalMaterialCategoryCode">
            <el-input style="width: 90%" size="small" placeholder="医用材料分类代码"
                      disabled
                      v-model.trim="filterQuery.medicalMaterialCategoryCode"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="植入材料和人体器官标志:" prop="implantMaterialFlag">
            <el-input style="width: 90%" size="small" placeholder="植入材料和人体器官标志"
                      disabled
                      v-model.trim="filterQuery.implantMaterialFlag"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="灭菌标志:" prop="sterilizationFlag">
            <el-input style="width: 90%" size="small" placeholder="灭菌标志"
                      disabled
                      v-model.trim="filterQuery.sterilizationFlag"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="灭菌标志名称:" prop="sterilizationFlagName">
            <el-input style="width: 90%" size="small" placeholder="灭菌标志名称"
                      disabled
                      v-model.trim="filterQuery.sterilizationFlagName"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="植入或介入类标志:" prop="implantOrInterventionalFlag">
            <el-input style="width: 90%" size="small" placeholder="植入或介入类标志"
                      disabled
                      v-model.trim="filterQuery.implantOrInterventionalFlag"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="植入或介入类名称:" prop="implantOrInterventionalName">
            <el-input style="width: 90%" size="small" placeholder="植入或介入类名称"
                      disabled
                      v-model.trim="filterQuery.implantOrInterventionalName"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="一次性使用标志:" prop="singleUseFlag">
            <el-input style="width: 90%" size="small" placeholder="一次性使用标志"
                      disabled
                      v-model.trim="filterQuery.singleUseFlag"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="一次性使用标志名称:" prop="singleUseFlagName">
            <el-input style="width: 90%" size="small" placeholder="一次性使用标志名称"
                      disabled
                      v-model.trim="filterQuery.singleUseFlagName"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="注册备案人名称:" prop="regFilingPersonName">
            <el-input style="width: 90%" size="small" placeholder="注册备案人名称"
                      disabled
                      v-model.trim="filterQuery.regFilingPersonName"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="开始日期:" prop="startDate">
            <el-input style="width: 90%" size="small" placeholder="开始日期"
                      disabled
                      v-model.trim="filterQuery.startDate"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="结束日期:" prop="endDate">
            <el-input style="width: 90%" size="small" placeholder="结束日期"
                      disabled
                      v-model.trim="filterQuery.endDate"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="医疗器械管理类别:" prop="deviceManagementCategory">
            <el-input style="width: 90%" size="small" placeholder="医疗器械管理类别"
                      disabled
                      v-model.trim="filterQuery.deviceManagementCategory"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="结束日期:" prop="endDate">
            <el-input style="width: 90%" size="small" placeholder="结束日期"
                      disabled
                      v-model.trim="filterQuery.endDate"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="医疗器械管理类别名称:" prop="deviceManagementCategoryName">
            <el-input style="width: 90%" size="small" placeholder="医疗器械管理类别名称"
                      disabled
                      v-model.trim="filterQuery.deviceManagementCategoryName"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="注册备案号:" prop="regFilingNum">
            <el-input style="width: 90%" size="small" placeholder="注册备案号"
                      disabled
                      v-model.trim="filterQuery.regFilingNum"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="注册备案产品名称:" prop="regFilingProductName">
            <el-input style="width: 90%" size="small" placeholder="注册备案产品名称"
                      disabled
                      v-model.trim="filterQuery.regFilingProductName"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="结构及组成:" prop="structureCompositionDetail">
            <el-input style="width: 90%" size="small" placeholder="结构及组成"
                      disabled
                      v-model.trim="filterQuery.structureCompositionDetail"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="其他内容:" prop="otherDetails">
            <el-input style="width: 90%" size="small" placeholder="其他内容"
                      disabled
                      v-model.trim="filterQuery.otherDetails"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="批准日期:" prop="approvalDate">
            <el-input style="width: 90%" size="small" placeholder="批准日期"
                      disabled
                      v-model.trim="filterQuery.approvalDate"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="其他内容:" prop="regFilingPersonAddress">
            <el-input style="width: 90%" size="small" placeholder="注册备案人住所"
                      disabled
                      v-model.trim="filterQuery.regFilingPersonAddress"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="注册证有效期开始时间:" prop="regCertStartDate"  >
            <el-input style="width: 90%" size="small" placeholder="注册证有效期开始时间"
                      disabled
                      v-model.trim="filterQuery.regCertStartDate"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="注册证有效期结束时间:" prop="regCertEndDate">
            <el-input style="width: 90%" size="small" placeholder="注册证有效期结束时间"
                      disabled
                      v-model.trim="filterQuery.regCertEndDate"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="生产企业编号:" prop="manufacturerNum">
            <el-input style="width: 90%" size="small" placeholder="生产企业编号"
                      disabled
                      v-model.trim="filterQuery.manufacturerNum"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="生产企业名称:" prop="manufacturerName">
            <el-input style="width: 90%" size="small" placeholder="生产企业名称"
                      disabled
                      v-model.trim="filterQuery.manufacturerName"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="生产地址:" prop="manufacturingAddress">
            <el-input style="width: 90%" size="small" placeholder="生产地址"
                      disabled
                      v-model.trim="filterQuery.manufacturingAddress"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="代理人企业:" prop="agentCompany">
            <el-input style="width: 90%" size="small" placeholder="代理人企业"
                      disabled
                      v-model.trim="filterQuery.agentCompany"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="代理人企业地址:" prop="agentCompanyAddress">
            <el-input style="width: 90%" size="small" placeholder="代理人企业地址"
                      disabled
                      v-model.trim="filterQuery.agentCompanyAddress"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="生产国或地区:" prop="productionCountry">
            <el-input style="width: 90%" size="small" placeholder="生产国或地区"
                      disabled
                      v-model.trim="filterQuery.productionCountry"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="售后服务机构:" prop="afterSalesService">
            <el-input style="width: 90%" size="small" placeholder="售后服务机构"
                      disabled
                      v-model.trim="filterQuery.afterSalesService"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="注册或备案证电子档案:" prop="regOrFilingCertFile">
            <el-input style="width: 90%" size="small" placeholder="注册或备案证电子档案"
                      disabled
                      v-model.trim="filterQuery.regOrFilingCertFile"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="有效标志:" prop="activeMark">
            <el-input style="width: 90%" size="small" placeholder="有效标志"
                      disabled
                      v-model.trim="filterQuery.activeMark"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="产品影像:" prop="productImage">
            <el-input style="width: 90%" size="small" placeholder="产品影像"
                      disabled
                      v-model.trim="filterQuery.productImage"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="唯一记录号:" prop="uniqueRecordNum">
            <el-input style="width: 90%" size="small" placeholder="唯一记录号"
                      disabled
                      v-model.trim="filterQuery.uniqueRecordNum"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="11" class="el-col">
          <el-form-item label="版本号:" prop="versionNum">
            <el-input style="width: 90%" size="small" placeholder="版本号"
                      disabled
                      v-model.trim="filterQuery.versionNum"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="11" class="el-col">
          <el-form-item label="唯一版本名称记录号:" prop="versionName">
            <el-input style="width: 90%" size="small" placeholder="版本名称"
                      disabled
                      v-model.trim="filterQuery.versionName"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

    </el-form>


  </div>
</template>
<script>
import { delReceive } from '@/api/thrsys/thrOrderReceive'
import { getOrderDetail, getReceiveOrder, printOrder } from '@/api/pharmaceuticals/receiveDrugOrder'
import { getBusChange } from '@/api/basic/busTypeChange'
import { filterSubAllOptimize, findInvByUserOptimize } from '@/api/system/invSubWarehouse'
import {
  getHead, executeFuc
} from '@/utils/customConfig'

export default {
  props: {
    rowData: {
      type: Object,
      required: true,
    },
  },
  data() {
    return {
      defaultSort: { prop: 'createTime', order: 'desc' },
      showSearch: true,
      filterQuery: {},
      invList: [],
      formName: null,
      formMap: {
        add: '新增领用单据',
        update: '编辑领用单据'
      },
      statusMap: {
        1: '草稿',
        2: '未审核',
        3: '已审核',
        4: '已拒绝'
      },
      idQuery: {},
      corpList: [],
      total: 0,
      tableHeader: [],
      queryList: [],
      fromList: [],
      tableHeader2: [],
      queryList2: [],
      fromList2: [],
      options: {
        finCurInv: [],
        finCorpList: []
      },
      thirdSys: [],
      thirdSysDetail: null,
      busTypes: [],
      originTypes: [],
      list: [],
      detailList: [],
      uploadFileUrl: null,
      fileList: [],
      uploadData: {
        thirdSys: 'thirdId'
      },
      invCodebe: null,
      closeConfirm: false,
      loading: false,
      actDateRange: [],
      newSpDistributionVisible: false,
      pickerOptions: {
        shortcuts: [
          {
            text: '最近一周',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
              picker.$emit('pick', [start, end])
            }
          },
          {
            text: '最近一个月',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
              picker.$emit('pick', [start, end])
            }
          },
          {
            text: '最近三个月',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
              picker.$emit('pick', [start, end])
            }
          }
        ]
      },
      productType: null
    }
  },

  methods: {
    onReset() {
      this.$router.push({
        path: ''
      })
      this.filterQuery = {
        billNo: '',
        thirdSysFk: '',
        billFlag: null,
        billAction: null,
        startDate: null,
        endDate: null,
        page: 1,
        limit: 10,
        corpName: null,
        type: 1,
        editStatus: 1,
        thirdPartyDate: 2,
        invCode: this.invCodebe
      }
      this.actDateRange = []
      this.getList()
    },

    onSubmitFind() {
      this.filterQuery.page = 1
      this.getList()
    },
    handleSortChange(column, prop, order) {
      if (column.order === 'descending') {
        this.filterQuery.sort = 'desc'
      } else {
        this.filterQuery.sort = 'asc'
      }
      this.filterQuery.orderBy = column.prop
      this.getList()
    },

    getList() {
      if (this.actDateRange != null) {
        this.filterQuery.startTime = this.actDateRange[0]
        this.filterQuery.endTime = this.actDateRange[1]
      } else {
        this.filterQuery.startTime = null
        this.filterQuery.endTime = null
      }
      this.filterQuery.isUser = true //只查询自己
      getReceiveOrder(this.filterQuery)
        .then((response) => {
          if (response.code == 20000) {
            this.list = response.data.list || []
            this.total = response.data.total || 0
            this.detailList = []
          } else {
            this.$message.error(response.message)
          }
        })
        .catch(() => {
          this.list = []
          this.total = 0
        })
    },

    handleDetail(_this, row) {
      var query = {}
      query.orderIdFk = row.billNo
      getOrderDetail(query) //查找该单号下的所有条码
        .then((response) => {
          _this.detailList = response.data.list || []
        })
        .catch(() => {
          _this.detailList = []
        })
    },
    hideSearch() {
      this.showSearch = !this.showSearch
    },
    deleteDialog(_this, row) {
      _this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          let dQuery = {
            orderIdFk: row.billNo
          }
          delReceive(dQuery)
            .then((response) => {
              if (response.code == 20000) {
                _this.$message.success('删除成功')
                _this.getList()
                _this.detailList = null
              } else {
                _this.$message.error(response.message)
              }
            })
            .catch(() => {
            })

        })
        .catch(() => {
        })
    },

    handleCurrentChange(val) {
      this.filterQuery.page = val.page
      this.getList()
    },
    closeDialog() {
      this.newSpDistributionVisible = false
      this.getList()
      this.detailList = []
    },
    getBusType() {
      let query = {
        enable: true,
        type: 1
      }
      getBusChange(query)
        .then((response) => {
          this.originTypes = response.data.list || []
        })
        .catch(() => {
        })
    },
    newDistributionForm(_this, row) {
      if (_this == null) {
        _this = this
      }
      _this.idQuery.id = ''
      if (_this.$isNotBlank(row) && _this.$isNotBlank(row.id)) {
        _this.idQuery.id = row.id
        _this.idQuery.formData = row
        _this.formName = 'update'
        _this.productType = 2
      } else {
        _this.formName = 'add'
      }
      _this.productType = 2
      _this.newSpDistributionVisible = true
    },
    finCurInv(_this) {
      let query = {
        filter: 3
      }
      findInvByUserOptimize(query)
        .then((response) => {
          _this.options.finCurInv = response.data || []
          if (_this.options.finCurInv.length > 0) {
            _this.filterQuery.invCode = this.options.finCurInv[0].code
            _this.invCodebe = this.filterQuery.invCode
          }
          _this.getList()
        })
        .catch(() => {
          this.options.finCurInv = []
        })
    },
    printOrder(_this, row) {
      printOrder(row)
        .then((response) => {
          const binaryData = []
          binaryData.push(response)
          //获取blob链接。
          let url = window.URL.createObjectURL(
            new Blob(binaryData, { type: 'application/pdf' })
          )
          _this.loading = false
          window.open(url)//打开新标签页，预览pdf。
          _this.getList()
        })
        .catch(() => {
        })
    },
    finCorpList(_this, val) {
      let query = {
        name: val,
        page: 1,
        limit: 10
      }
      filterSubAllOptimize(query)
        .then((response) => {
          _this.loading = false
          _this.options.finCorpList = response.data || []
        })
        .catch(() => {
          _this.loading = false
          _this.options.finCorpList = []
        })
    },
    executeFuc(row, type, clickFuc, value) {
      return executeFuc(this, row, type, clickFuc, value)
    },
    executeEval(row, expression, defaultRet) {
      if (expression) {
        return eval(expression)
      }
      return defaultRet
    }
  },
  components: {},
  mounted() {
  },
  created() {
    this.filterQuery = this.rowData
    getHead('medicalSupplies-1', '1').then((re) => {
      // 处理返回的数据
      // this.tableObj = re.data;
      // this.tableHeader = re.data.tableList;
      this.fromList = re.data.queryList
      // let list = re.data.fromList[0];
      // this.fromList = list.list
      // let list = re.data.fromList[0];
      // this.fromList = list.list
      // console.log("dlldkldkdld",list)
    })

  }
}
</script>
<style scoped>
.itemTag {
  float: left;
  text-align: left;
  margin-top: 10px;
  width: 25%;
}

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


.el-row {
  display: flex;
  flex-wrap: wrap;
}

.el-col {
  border-radius: 4px;
  flex-wrap: wrap;
}
</style>

