<template>
  <div>
    <el-card>
      <el-row type="flex">
        <el-col style="flex: 1" v-show="Dictionary  && vueRouteSource==1">
          <el-col v-show="showSearch" style="min-width: 200px; max-width: 100%">
            <el-tree
              :data="treeList"
              class="tree"
              :default-expand-all="true"
              @node-click="handleNodeClick"
              :expand-on-click-node="false"
            >
              <span class="custom-tree-node" slot-scope="{ node, data }">
                <span style="font-size: 14px; font-weight: 500">{{
                    node.label
                  }}</span></span
              >
            </el-tree>
          </el-col>
        </el-col>
        <el-button
          type="success"
          @click="Dictionary = !Dictionary"
          icon="el-icon-arrow-left"
          v-show="Dictionary && vueRouteSource==1"
          class="iconButton"
        >
        </el-button>
        <el-button
          type="success"
          @click="Dictionary = !Dictionary"
          icon="el-icon-arrow-right"
          v-show="!Dictionary  && vueRouteSource==1"
          class="iconButton"
        >
        </el-button>
        <el-col style="border-left: 3px solid #dddddd; overflow-y: hidden">
          <el-form
            v-if="queryList && queryList.length > 0 && showSearch"
            :model="filterQuery"
            size="mini"
            label-width="100px"
          >
            <!--            <el-row>-->
            <!--              <el-col :span="18">-->
            <!--                <el-form-item class="query-form-item" label="UDI码:">-->
            <!--                  <el-input-->
            <!--                    v-model="filterQuery.udiCode"-->
            <!--                    style="width: 97%"-->
            <!--                    placeholder="请扫描或输入UDI码"-->
            <!--                    clearable="true"-->
            <!--                    @keyup.enter.native="keyup_submit($event)"-->
            <!--                  ></el-input>-->
            <!--                </el-form-item>-->
            <!--              </el-col>-->
            <!--            </el-row>-->
            <!--            <el-row>-->
            <!--              <el-col :span="6">-->
            <!--                <el-form-item class="query-form-item" label="最小销售标识:">-->
            <!--                  <el-input-->
            <!--                    v-model="filterQuery.unionCode"-->
            <!--                    placeholder="请输入最小销售标识"-->
            <!--                    style="width: 90%"-->
            <!--                    clearable="true"-->
            <!--                  ></el-input>-->
            <!--                </el-form-item>-->
            <!--              </el-col>-->
            <!--              <el-col :span="6">-->
            <!--                <el-form-item class="query-form-item" label="物资名称:">-->
            <!--                  <el-input-->
            <!--                    v-model="filterQuery.cpmctymc"-->
            <!--                    placeholder="请输入物资名称"-->
            <!--                    clearable="true"-->
            <!--                    style="width: 90%"-->
            <!--                  ></el-input>-->
            <!--                </el-form-item>-->
            <!--              </el-col>-->
            <!--              <el-col :span="6">-->
            <!--                <el-form-item class="query-form-item" label="规格型号:">-->
            <!--                  <el-input-->
            <!--                    v-model="filterQuery.ggxh"-->
            <!--                    placeholder="请输入规格型号"-->
            <!--                    clearable="true"-->
            <!--                    style="width: 90%"-->
            <!--                  ></el-input>-->
            <!--                </el-form-item>-->
            <!--              </el-col>-->
            <!--              <el-col :span="6">-->
            <!--                <el-form-item class="query-form-item" label="对照条件:">-->
            <!--                  <el-select-->
            <!--                    v-model="filterQuery.filterType"-->
            <!--                    placeholder="请选择过滤对照条件"-->
            <!--                    style="width: 90%"-->
            <!--                  >-->
            <!--                    <el-option-->
            <!--                      v-for="item in filterList"-->
            <!--                      :key="item.filterType"-->
            <!--                      :label="item.sysName"-->
            <!--                      :value="item.filterType"-->
            <!--                    >-->
            <!--                      <span style="float: left">{{ item.sysName }}</span>-->
            <!--                    </el-option>-->
            <!--                  </el-select>-->
            <!--                </el-form-item>-->
            <!--              </el-col>-->
            <!--            </el-row>-->
            <!--            <el-row>-->
            <!--              <el-col :span="6">-->
            <!--                <el-form-item class="query-form-item" label="注册备案人:">-->
            <!--                  <el-input-->
            <!--                    v-model="filterQuery.ylqxzcrbarmc"-->
            <!--                    placeholder="请输入注册备案人"-->
            <!--                    style="width: 90%"-->
            <!--                    clearable="true"-->
            <!--                  ></el-input>-->
            <!--                </el-form-item>-->
            <!--              </el-col>-->
            <!--              <el-col :span="6">-->
            <!--                <el-form-item class="query-form-item" label="第三方编码:">-->
            <!--                  <el-input-->
            <!--                    v-model="filterQuery.thrPiId"-->
            <!--                    placeholder="请输入第三方主系统编码"-->
            <!--                    style="width: 90%"-->
            <!--                    clearable="true"-->
            <!--                  ></el-input>-->
            <!--                </el-form-item>-->
            <!--              </el-col>-->
            <!--              <el-col :span="6">-->
            <!--                <el-form-item class="query-form-item" label="集采状态:">-->
            <!--                  <el-select-->
            <!--                    v-model="filterQuery.groupBuy"-->
            <!--                    placeholder="请选择集采状态"-->
            <!--                    clearable-->
            <!--                    style="width: 90%"-->
            <!--                  >-->
            <!--                    <el-option label="全部" value=""></el-option>-->
            <!--                    <el-option label="集采" value="true"></el-option>-->
            <!--                    <el-option label="非集采" value="false"></el-option>-->
            <!--                  </el-select>-->
            <!--                </el-form-item>-->
            <!--              </el-col>-->
            <!--              <el-col :span="6">-->
            <!--                <el-form-item class="query-form-item" label="可配送状态:">-->
            <!--                  <el-select-->
            <!--                    v-model="filterQuery.dispatch"-->
            <!--                    placeholder="请选择可配送状态"-->
            <!--                    clearable-->
            <!--                    style="width: 90%"-->
            <!--                  >-->
            <!--                    <el-option label="全部" value=""></el-option>-->
            <!--                    <el-option label="可配送" value="true"></el-option>-->
            <!--                    <el-option label="不可配送" value="false"></el-option>-->
            <!--                  </el-select>-->
            <!--                </el-form-item>-->
            <!--              </el-col>-->
            <!--            </el-row>-->

            <!--            <el-row>-->
            <!--              <el-col :span="6">-->
            <!--                <el-form-item class="query-form-item" label="注册/备案号:">-->
            <!--                  <el-input-->
            <!--                    v-model="filterQuery.zczbhhzbapzbh"-->
            <!--                    placeholder="请输入注册/备案号"-->
            <!--                    style="width: 90%"-->
            <!--                    clearable="true"-->
            <!--                  ></el-input>-->
            <!--                </el-form-item>-->
            <!--              </el-col>-->
            <!--              <el-col :span="6">-->
            <!--                <el-form-item class="query-form-item" label="生产企业:">-->
            <!--                  <el-input-->
            <!--                    v-model="filterQuery.manufactory"-->
            <!--                    placeholder="请输入生产企业"-->
            <!--                    style="width: 90%"-->
            <!--                    clearable="true"-->
            <!--                  ></el-input>-->
            <!--                </el-form-item>-->
            <!--              </el-col>-->
            <!--              <el-col :span="6">-->
            <!--                <el-form-item class="query-form-item" label="是否在用:">-->
            <!--                  <el-select-->
            <!--                    v-model="filterQuery.isDisable"-->
            <!--                    placeholder="请选择是否在用"-->
            <!--                    clearable-->
            <!--                    style="width: 90%"-->
            <!--                  >-->
            <!--                    <el-option label="在用" value="false"></el-option>-->
            <!--                    <el-option label="停用" value="true"></el-option>-->
            <!--                  </el-select>-->
            <!--                </el-form-item>-->
            <!--              </el-col>-->
            <!--            </el-row>-->
            <el-row style=" display:flex;  flex-wrap: wrap; ">
              <template v-for="(item, index) in queryList">
                <el-form-item v-if="item.columnType == 'input' && executeEval(row,item.expression,true)"
                              :label="item.columnDesc+`:`" :key="item.id">
                  <el-input
                    v-model="filterQuery[item.columnName]"
                    :placeholder="item.columnDesc"
                    :disabled="executeEval(null,item.disabledFuc,false)"
                    @keyup.enter.native="executeFuc($event,'5',item.clickFuc)"
                    clearable
                  ></el-input>
                </el-form-item>
                <el-form-item v-if="item.columnType == 'select' && executeEval(row,item.expression,true)"
                              :label="item.columnDesc+`:`">
                  <el-select v-model="filterQuery[item.columnName]"
                             :placeholder="item.columnDesc"
                             :disabled="executeEval(null,item.disabledFuc,false)"
                             clearable>
                    <el-option
                      v-for="dict in item.lableRuleObj"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    />
                  </el-select>
                </el-form-item>
                <el-form-item v-if="item.columnType == 'selectServer' && executeEval(row,item.expression,true)"
                              :label="item.columnDesc+`:`">
                  <el-select
                    v-model="filterQuery[item.columnName]"
                    :placeholder="item.columnDesc"
                    :disabled="executeEval(null,item.disabledFuc,false)"
                    filterable
                    remote
                    :remote-method="(query) => executeFuc(query,'5',item.clickFuc)"
                    clearable>
                    <el-option
                      v-for="item in options[item.clickFuc]"
                      :key="item.code"
                      :label="item.label"
                      :value="item.code"
                    />
                  </el-select>
                </el-form-item>
                <el-form-item v-if="item.columnType == 'datePicker' && executeEval(row,item.expression,true)"
                              :label="item.columnDesc+`:`">
                  <el-date-picker
                    v-model="dateRange"
                    :style="`width:${item.width+'px'}`"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    :disabled="executeEval(null,item.disabledFuc,false)"
                    type="daterange"
                    range-separator="-"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期"
                    :default-time="['00:00:00', '23:59:59']"
                  ></el-date-picker>
                </el-form-item>
                <el-form-item v-if="item.columnType == 'date' && executeEval(row,item.expression,true)"
                              :label="item.columnDesc+`:`">
                  <el-date-picker
                    v-model="filterQuery[item.columnName]"
                    :style="`width:${item.width+'px'}`"
                    value-format="yyyy-MM-dd"
                    :disabled="executeEval(null,item.disabledFuc,false)"
                    type="date"
                    :placeholder="item.columnDesc"
                  ></el-date-picker>
                </el-form-item>
              </template>
            </el-row>
          </el-form>
          <div class="top-right-btn">
            <el-button-group>
              <el-button icon="el-icon-view" type="primary" @click="hideSearch"
              >显示/隐藏搜索栏
              </el-button
              >
              <el-button type="primary" icon="el-icon-refresh" @click="onReset"
              >重置
              </el-button
              >
              <el-button type="primary" icon="el-icon-search" @click="submit"
              >查询
              </el-button
              >
              <template v-if="!isChoose">
                <el-button type="primary" icon="el-icon-plus" @click="editUdiType"
                           v-if="vueRouteSource==1"
                >物资分类管理
                </el-button>
                <el-button
                  type="primary"
                  icon="el-icon-plus" v-if="vueRouteSource==1"
                  @click="intentImportUdi"
                >选入DI信息
                </el-button
                >
                <el-button
                  type="primary"
                  icon="el-icon-plus" v-if="vueRouteSource==1"
                  @click="intentImportErp"
                >添加院内字典
                </el-button
                >
                <el-button
                  type="primary"
                  icon="el-icon-plus" v-if="vueRouteSource==1"
                  @click="intentDetail"
                >关联添加
                </el-button
                >
                <el-button type="primary" icon="el-icon-plus" @click="addProducType"
                           v-if="vueRouteSource==1"
                >新增产品
                </el-button>
              </template>
            </el-button-group>
          </div>
          <el-divider style="margin: 15px"></el-divider>
          <el-table
            v-loading="loading"
            :data="list"
            style="width: 100%"
            border
            key="1"
            @selection-change="(row) => executeFuc(row,'0',tableObj.handleChangeFuc)"
          >
            <!--            <el-table-column label="序号" type="index"></el-table-column>-->
            <!--            <el-table-column-->
            <!--              label="最小销售产品标识"-->
            <!--              prop="nameCode"-->
            <!--              width="140"-->
            <!--              show-overflow-tooltip-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              label="主系统编码"-->
            <!--              prop="mainId"-->
            <!--              width="120"-->
            <!--              show-overflow-tooltip-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              label="物资名称"-->
            <!--              prop="cpmctymc"-->
            <!--              width="160"-->
            <!--              show-overflow-tooltip-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              label="规格型号"-->
            <!--              prop="ggxh"-->
            <!--              width="160"-->
            <!--              show-overflow-tooltip-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              label="商品名称"-->
            <!--              prop="spmc"-->
            <!--              width="160"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:spmc')"-->
            <!--            ></el-table-column>-->

            <!--            <el-table-column-->
            <!--              label="商品条码"-->
            <!--              prop="sptm"-->
            <!--              width="160"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:sptm')"-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              label="医保编码"-->
            <!--              prop="ybbm"-->
            <!--              width="160"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:ybbm')"-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              label="计量单位"-->
            <!--              prop="measname"-->
            <!--              width="160"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:measname')"-->
            <!--            ></el-table-column>-->

            <!--            <el-table-column-->
            <!--              label="注册/备案号"-->
            <!--              prop="zczbhhzbapzbh"-->
            <!--              width="160"-->
            <!--              show-overflow-tooltip-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              label="注册/备案人"-->
            <!--              prop="ylqxzcrbarmc"-->
            <!--              width="180"-->
            <!--              show-overflow-tooltip-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              :label="productRemarkSet.remarkTitle1"-->
            <!--              prop="basicPrductRemak1"-->
            <!--              width="180"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:basicPrductRemak1')"-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              :label="productRemarkSet.remarkTitle2"-->
            <!--              prop="basicPrductRemak2"-->
            <!--              width="180"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:basicPrductRemak2')"-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              :label="productRemarkSet.remarkTitle3"-->
            <!--              prop="basicPrductRemak3"-->
            <!--              width="180"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:basicPrductRemak3')"-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              :label="productRemarkSet.remarkTitle4"-->
            <!--              prop="basicPrductRemak4"-->
            <!--              width="180"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:basicPrductRemak4')"-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              :label="productRemarkSet.remarkTitle5"-->
            <!--              prop="basicPrductRemak5"-->
            <!--              width="180"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:basicPrductRemak5')"-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              :label="productRemarkSet.remarkTitle6"-->
            <!--              prop="basicPrductRemak6"-->
            <!--              width="180"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:basicPrductRemak6')"-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              :label="productRemarkSet.remarkTitle7"-->
            <!--              prop="basicPrductRemak7"-->
            <!--              width="180"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:basicPrductRemak7')"-->
            <!--            ></el-table-column>-->
            <!--            <el-table-column-->
            <!--              :label="productRemarkSet.remarkTitle8"-->
            <!--              prop="hslbName"-->
            <!--              width="180"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:basicPrductRemak8')"-->
            <!--            >-->
            <!--              &lt;!&ndash;              <template slot-scope="scope">&ndash;&gt;-->
            <!--              &lt;!&ndash;                {{ getHsflMethod(scope.row.basicPrductRemak8) }}&ndash;&gt;-->
            <!--              &lt;!&ndash;              </template>&ndash;&gt;-->

            <!--            </el-table-column>-->

            <!--            <el-table-column-->
            <!--              label="是否在用"-->
            <!--              prop="isDisable"-->
            <!--              width="180"-->
            <!--              show-overflow-tooltip-->
            <!--            >-->
            <!--              <template slot-scope="scope">-->
            <!--                <el-tag :type="scope.row.isDisable | isDisableFilterType">-->
            <!--                  {{ isDisableMap[scope.row.isDisable] }}-->
            <!--                </el-tag>-->
            <!--              </template>-->
            <!--            </el-table-column>-->
            <!--            <el-table-column-->
            <!--              label="集采状态"-->
            <!--              prop="groupBuy"-->
            <!--              width="120"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:groupBuy')"-->
            <!--            >-->
            <!--              <template slot-scope="scope">-->
            <!--                <el-tag :type="scope.row.groupBuy | statusFilterType">-->
            <!--                  {{ groupBuyMap[scope.row.groupBuy] }}-->
            <!--                </el-tag>-->
            <!--              </template>-->
            <!--            </el-table-column>-->
            <!--            <el-table-column-->
            <!--              label="可配送状态"-->
            <!--              prop="dispatch"-->
            <!--              width="120"-->
            <!--              show-overflow-tooltip-->
            <!--              v-if="$auth.hasPermi('basic:dispatch')"-->
            <!--            >-->
            <!--              <template slot-scope="scope">-->
            <!--                <el-tag :type="scope.row.dispatch | statusFilterType">-->
            <!--                  {{ dispatchMap[scope.row.dispatch] }}-->
            <!--                </el-tag>-->
            <!--              </template>-->
            <!--            </el-table-column>-->

            <!--            <el-table-column width="180" label="操作" fixed="right">-->
            <!--              <template slot-scope="scope">-->
            <!--                <el-button-->
            <!--                  type="text"-->
            <!--                  size="small" v-if="vueRouteSource==1"-->
            <!--                  :disabled="scope.row.originUuid != null"-->
            <!--                  @click.native.stop="intentSelectUdi(scope.row)"-->
            <!--                >关联DI-->
            <!--                </el-button>-->
            <!--                <el-button-->
            <!--                  type="text"-->
            <!--                  size="small"-->
            <!--                  @click.native.stop="handleModifyClick(scope.row)"-->
            <!--                >详情-->
            <!--                </el-button>-->

            <!--                <el-button-->
            <!--                  type="text"-->
            <!--                  size="small" v-if="vueRouteSource==1"-->
            <!--                  @click.native.stop="diEdit(scope.row)"-->
            <!--                >编辑-->
            <!--                </el-button>-->

            <!--                <el-button-->
            <!--                  type="text"-->
            <!--                  size="small" v-if="vueRouteSource==1"-->
            <!--                  @click.native.stop="deleteDialog(scope.row)"-->
            <!--                >删除-->
            <!--                </el-button>-->
            <!--                <el-button-->
            <!--                  type="text"-->
            <!--                  size="small" v-if="vueRouteSource==2"-->
            <!--                  @click.native.stop="uploadThird(scope.row)"-->
            <!--                >上传-->
            <!--                </el-button>-->
            <!--              </template>-->
            <!--            </el-table-column>-->
            <template v-for="(item, index) in tableHeader">
              <el-table-column
                v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
                type="index" :label="item.columnDesc"></el-table-column>
              <el-table-column
                v-if="item.columnType == 'selection'"
                type="selection"
                :width="item.width"
                :selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"></el-table-column>

              <el-table-column
                v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
                :prop="item.columnName"
                :label="item.columnDesc"
                :sortable="item.sort"
                :width="item.width"
                :show-overflow-tooltip="item.tooltip"
                :key="item.columnName"
              >
                <template slot-scope="scope">
                  <el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
                </template>
              </el-table-column>
              <el-table-column
                v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
                :prop="item.columnName"
                :label="item.columnDesc"
                :sortable="item.sort"
                :width="item.width"
                :show-overflow-tooltip="item.tooltip"
                :key="item.columnName"
              >
                <template slot-scope="scope">
                  <span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{
                      item.lableRuleObj[scope.row[item.columnName]]
                    }}</span>
                </template>
              </el-table-column>
              <el-table-column
                v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
                :prop="item.columnName"
                :label="item.columnDesc"
                :sortable="item.sort"
                :width="item.width"
                :show-overflow-tooltip="item.tooltip"
                :key="item.columnName"
              >
                <template slot-scope="scope">
                  <el-tag
                    :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
                    <span>{{
                        item.lableRuleObj ? item.lableRuleObj[scope.row[item.columnName]] : scope.row[item.columnName]
                      }}</span>
                  </el-tag>
                </template>
              </el-table-column>
              <el-table-column
                v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
                :prop="item.columnName"
                :label="item.columnDesc"
                :width="isChoose?50:280"
                :key="item.columnName"
                fixed="right"
              >
                <template slot-scope="scope">
                  <el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
                             :type="buttonItem.type"
                             :size="buttonItem.size"
                             :style="buttonItem.style"
                             :key="buttonItem"
                             v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
                             :disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
                             @click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
                  >{{ buttonItem.name }}
                  </el-button>
                </template>
              </el-table-column>
              <el-table-column
                v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
                :prop="item.columnName"
                :label="item.columnDesc"
                :sortable="item.sort"
                :width="item.width"
                :show-overflow-tooltip="item.tooltip"
                :key="item.columnName"
              >
                <template slot-scope="scope">
                  <span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{
                      scope.row[item.columnName]
                    }}</span>
                </template>
              </el-table-column>

            </template>
          </el-table>
          <el-dialog
            title="物资字典-详情"
            :visible.sync="editDialogVisible"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            width="70%"
            v-if="editDialogVisible"
          >
            <el-card>
              <el-table
                :data="sysList"
                style="width: 100%; margin-bottom: 8px"
                key="2"
                border
              >
                <el-table-column label="序号" type="index"></el-table-column>
                <el-table-column
                  label="第三方系统名称"
                  prop="sysName"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  label="第三方系统物资编码"
                  prop="thirdId"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  label="第三方系统物资名称"
                  prop="thirdName"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  label="第三方系统规格型号"
                  prop="spec"
                  show-overflow-tooltip
                ></el-table-column>

                <el-table-column
                  label="注册/备案号"
                  prop="registerNo"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  label="生产企业"
                  prop="manufactory"
                  show-overflow-tooltip
                ></el-table-column>
              </el-table>
            </el-card>
            <el-card>
              <div
                style="
                  float: left;
                  text-align: left;
                  font-weight: bold;
                  margin-bottom: 8px;
                "
              >
                <span>产品标识:</span>
              </div>

              <el-table
                v-loading="loading"
                :data="detailList"
                style="width: 100%"
                border
                key="3"
                highlight-current-row
                @current-change="handleDetail"
              >
                <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"
                border
                label-width="140px"
                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-select
                            v-model="editQuery.isDisable"
                            disabled
                            style="width: 65%"
                            size="small"
                          >
                            <el-option label="是" :value="true"></el-option>
                            <el-option label="否" :value="false"></el-option>
                            <el-option label="否" :value="null"></el-option>
                          </el-select>
                        </div>
                      </el-col>
                      <el-col :span="12" class="el-col">
                        <div class="text item">
                          <div class="itemTag">
                            <span>是否寄售:&nbsp;</span>
                          </div>
                          <el-select
                            v-model="editQuery.isAdavence"
                            disabled
                            style="width: 65%"
                            size="small"
                          >
                            <el-option label="是" :value="true"></el-option>
                            <el-option label="否" :value="false"></el-option>
                            <el-option label="否" :value="null"></el-option>
                          </el-select>
                        </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-select
                            v-model="editQuery.allowNoBatch"
                            disabled
                            style="width: 65%"
                            size="small"
                          >
                            <el-option label="是" :value="true"></el-option>
                            <el-option label="否" :value="false"></el-option>
                            <el-option label="否" :value="null"></el-option>
                          </el-select>
                        </div>
                      </el-col>
                      <el-col :span="12" class="el-col">
                        <div class="text item">
                          <div class="itemTag">
                            <span>允许无失效日期:&nbsp;</span>
                          </div>
                          <el-select
                            v-model="editQuery.allowNoExpire"
                            disabled
                            style="width: 65%"
                            size="small"
                          >
                            <el-option label="是" :value="true"></el-option>
                            <el-option label="否" :value="false"></el-option>
                            <el-option label="否" :value="null"></el-option>
                          </el-select>
                        </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-select
                            v-model="editQuery.allowNoProduct"
                            disabled
                            style="width: 65%"
                            size="small"
                          >
                            <el-option label="是" :value="true"></el-option>
                            <el-option label="否" :value="false"></el-option>
                            <el-option label="否" :value="null"></el-option>
                          </el-select>
                        </div>
                      </el-col>
                      <el-col :span="12" class="el-col">
                        <div class="text item">
                          <div class="itemTag">
                            <span>允许无序列号:&nbsp;</span>
                          </div>
                          <el-select
                            v-model="editQuery.allowNoSerial"
                            disabled
                            style="width: 65%"
                            size="small"
                          >
                            <el-option label="是" :value="true"></el-option>
                            <el-option label="否" :value="false"></el-option>
                            <el-option label="否" :value="null"></el-option>
                          </el-select>
                        </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-select
                            v-model="editQuery.isUseDy"
                            disabled
                            style="width: 65%"
                            size="small"
                          >
                            <el-option label="是" :value="true"></el-option>
                            <el-option label="否" :value="false"></el-option>
                            <el-option label="否" :value="null"></el-option>
                          </el-select>
                        </div>
                      </el-col>
                      <el-col :span="12" class="el-col">
                        <div class="text item">
                          <div class="itemTag">
                            <span>允许科室多次使用出库:&nbsp;</span>
                          </div>
                          <el-select
                            v-model="editQuery.useMuti"
                            disabled
                            style="width: 65%"
                            size="small"
                          >
                            <el-option label="是" :value="true"></el-option>
                            <el-option label="否" :value="false"></el-option>
                            <el-option label="否" :value="null"></el-option>
                          </el-select>
                        </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-select
                            v-model="editQuery.destinyType"
                            disabled
                            style="width: 65%"
                            size="small"
                          >
                            <el-option
                              v-for="item in destinyTypeSelectList"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value"
                            />
                          </el-select>
                        </div>
                      </el-col>
                        <el-col :span="12" class="el-col">
                          <div class="text item">
                            <div class="itemTag">
                              <span>是否需要扫码:&nbsp;</span>
                            </div>
                            <el-select
                              v-model="editQuery.requireScanCode"
                              disabled
                              style="width: 65%"
                              size="small"
                            >
                              <el-option label="是" :value=1></el-option>
                              <el-option label="否" :value=0></el-option>
                            </el-select>
                          </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="!checked"
                            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-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.packUnit"
                          ></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="useNumEnable"
                            type="number"
                            v-model="editQuery.zdcfsycs"
                          ></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.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.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="请输入内容"
                            v-model="editQuery.qxlb"
                          ></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="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%"
                            size="small"
                            :disabled="true"
                            splaceholder="请输入内容"
                            v-model="editQuery.ybbm"
                          ></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.tyshxydm"
                          ></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.catalogname1"
                          ></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.catalogname2"
                          ></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.catalogname3"
                          ></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.matrial"
                          ></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.spmc"
                          ></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.sptm"
                          ></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="请输入内容"
                            :disabled="true"
                            v-model="editQuery.measname"
                          ></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"
                            v-model="editQuery.manufactory"
                            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.cpms"
                          ></el-input>
                        </div>
                      </el-col>
                    </el-row>

                    <el-row :gutter="20" class="el-row" type="flex">
                      <el-col
                        :span="12"
                        class="el-col"
                        v-if="productRemarkSet.remarkEnable1"
                      >
                        <div class="text item">
                          <div class="itemTag">
                            <span
                            >{{ productRemarkSet.remarkTitle1 }}:&nbsp;</span
                            >
                          </div>
                          <el-input
                            style="width: 65%"
                            size="small"
                            :disabled="true"
                            splaceholder="请输入内容"
                            v-model="editQuery.basicPrductRemak1"
                          ></el-input>
                        </div>
                      </el-col>

                      <el-col
                        :span="12"
                        class="el-col"
                        v-if="productRemarkSet.remarkEnable2"
                      >
                        <div class="text item">
                          <div class="itemTag">
                            <span
                            >{{ productRemarkSet.remarkTitle2 }}:&nbsp;</span
                            >
                          </div>
                          <el-input
                            style="width: 65%"
                            size="small"
                            :disabled="true"
                            splaceholder="请输入内容"
                            v-model="editQuery.basicPrductRemak2"
                          ></el-input>
                        </div>
                      </el-col>
                    </el-row>

                    <el-row :gutter="20" class="el-row" type="flex">
                      <el-col
                        :span="12"
                        class="el-col"
                        v-if="productRemarkSet.remarkEnable3"
                      >
                        <div class="text item">
                          <div class="itemTag">
                            <span
                            >{{ productRemarkSet.remarkTitle3 }}:&nbsp;</span
                            >
                          </div>
                          <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.basicPrductRemak3"
                          ></el-input>
                        </div>
                      </el-col>

                      <el-col
                        :span="12"
                        class="el-col"
                        v-if="productRemarkSet.remarkEnable4"
                      >
                        <div class="text item">
                          <div class="itemTag">
                            <span
                            >{{ productRemarkSet.remarkTitle4 }}:&nbsp;</span
                            >
                          </div>
                          <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.basicPrductRemak4"
                          ></el-input>
                        </div>
                      </el-col>
                    </el-row>

                    <el-row :gutter="20" class="el-row" type="flex">
                      <el-col
                        :span="12"
                        class="el-col"
                        v-if="productRemarkSet.remarkEnable5"
                      >
                        <div class="text item">
                          <div class="itemTag">
                            <span
                            >{{ productRemarkSet.remarkTitle5 }}:&nbsp;</span
                            >
                          </div>
                          <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.basicPrductRemak5"
                          ></el-input>
                        </div>
                      </el-col>

                      <el-col
                        :span="12"
                        class="el-col"
                        v-if="productRemarkSet.remarkEnable6"
                      >
                        <div class="text item">
                          <div class="itemTag">
                            <span
                            >{{ productRemarkSet.remarkTitle6 }}:&nbsp;</span
                            >
                          </div>
                          <el-input
                            style="width: 65%"
                            size="small"
                            :disabled="true"
                            splaceholder="请输入内容"
                            v-model="editQuery.basicPrductRemak6"
                          ></el-input>
                        </div>
                      </el-col>
                    </el-row>

                    <el-row :gutter="20" class="el-row" type="flex">
                      <el-col
                        :span="12"
                        class="el-col"
                        v-if="productRemarkSet.remarkEnable7"
                      >
                        <div class="text item">
                          <div class="itemTag">
                            <span
                            >{{ productRemarkSet.remarkTitle7 }}:&nbsp;</span
                            >
                          </div>
                          <el-input
                            style="width: 65%"
                            size="small"
                            :disabled="true"
                            splaceholder="请输入内容"
                            v-model="editQuery.basicPrductRemak7"
                          ></el-input>
                        </div>
                      </el-col>

                      <el-col
                        :span="12"
                        class="el-col"
                        v-if="productRemarkSet.remarkEnable8"
                      >
                        <div class="text item">
                          <div class="itemTag">
                            <span
                            >{{ productRemarkSet.remarkTitle8 }}:&nbsp;</span
                            >
                          </div>
                          <el-input
                            style="width: 65%"
                            size="small"
                            :disabled="true"
                            splaceholder="请输入内容"
                            v-model="editQuery.basicPrductRemak8"
                          ></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.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="5">
                    <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-item name="6">
                    <template slot="title">
                      <p class="form-title">国家DI标识数据库版本信息</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: 35%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.versionNumber"
                          ></el-input>
                          <el-button
                            type="text"
                            size="small"
                            @click.native.stop="selectVersion()"
                            style="margin-left: 5%"
                          >切换版本
                          </el-button>
                        </div>
                      </el-col>
                    </el-row>
                  </el-collapse-item>
                </el-collapse>
              </el-form>
            </el-card>
          </el-dialog>
          <el-dialog
            title="耗材字典-编辑"
            :visible.sync="editDiDialogVisible"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            :before-close="this.cancelDialog"
            width="70%"
            v-if="editDiDialogVisible"
          >
            <product-edit
              :editQuery="editFormat"
              :relevanceEdit="relevanceEdit"
              :productRemarkSet="productRemarkSet"
              :uuid="uuid"
              :relId="relId"
              :thisData="thisData"
              :productType="productType"
              @closePre="closeUdi"
            ></product-edit>

<!--            <div style="text-align: center; margin-top: 12px">-->
<!--              <el-button-->
<!--                type="primary"-->
<!--                size="small"-->
<!--                icon="search"-->
<!--                @click="onAddSubmit(false)"-->
<!--                :loading="onAddLoading"-->
<!--              >提交-->
<!--              </el-button>-->
<!--              <el-button-->
<!--                size="small"-->
<!--                icon="search"-->
<!--                @click="cancelDialog"-->
<!--              >取消-->
<!--              </el-button>-->
<!--            </div>-->
          </el-dialog>
          <el-dialog
            title="耗材字典-编辑"
            :visible.sync="editSingleDiDialogVisible"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            width="45%"
            v-if="editSingleDiDialogVisible"
          >
            <product-single-edit
              :editQuery="editSingleFormat"
            ></product-single-edit>

            <div style="text-align: center; margin-top: 12px">
              <el-button
                type="primary"
                size="small"
                icon="search"
                @click="onAddSingleSubmit(false)"
              >提交
              </el-button>
              <el-button
                type="primary"
                size="small"
                icon="search"
                @click="cancelDialog"
              >取消
              </el-button>
            </div>
          </el-dialog>
          <el-dialog
            title="耗材字典-关联添加器械信息"
            :visible.sync="selectUdiDialogVisible"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            width="85%"
            v-if="selectUdiDialogVisible"
          >
            <selectUdi
              @closeUdi="closeUdi"
              :isImportUdi="isImportUdi"
            ></selectUdi>
          </el-dialog>

          <el-dialog
            title="新增-产品信息"
            :visible.sync="addProductDialogVisible"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            width="85%"
            v-if="addProductDialogVisible"
            @close="closeUdi"
          >
            <productAdd
              :closeDialog="closeDialog"
              @closeUdi="closeUdi">
            </productAdd>
          </el-dialog>

          <el-dialog
            title="耗材字典-从指定系统添加器械信息"
            :visible.sync="selectErpDialogVisible"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            width="85%"
            v-if="selectErpDialogVisible"
          >
            <selectErp
              :closeDialog="closeDialog"
              :uuid="uuid"
              :relId="relId"
              :isImport="isImport"
              :data="thisData"
              :defaultSys="defaultSys"
              @closeUdi="closeUdi"
              :supEnable="false"
            ></selectErp>
          </el-dialog>
          <el-dialog
            title="耗材字典-添加DI器械信息"
            :visible.sync="selectLocalVisible"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            width="85%"
            v-if="selectLocalVisible"
          >
            <selectLocalUdi
              :closeDialog="closeDialog"
              :relId="relId"
              :isImport="isImport"
              :isImportUdi="isImportUdi"
              :data="thisData"
              @closeUdi="closeUdi"
            ></selectLocalUdi>
          </el-dialog>
          <el-dialog
            title="耗材字典-选择DI版本"
            :visible.sync="selectVersionVisible"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            width="85%"
            v-if="selectVersionVisible"
          >
            <selectUdiVersion
              :closeDialog="closeDialog"
              :relId="relId"
              :uuid="uuid"
              :originUuid="originUuid"
              @closeUdi="closeUdi"
            ></selectUdiVersion>
          </el-dialog>
          <pagination
            v-show="total > 0"
            :total="total"
            :limit.sync="filterQuery.limit"
            :page.sync="filterQuery.page"
            @pagination="handleCurrentChange"
          ></pagination>

          <el-dialog
            title="编辑-耗材分类"
            :visible.sync="selectUdiTypeVisible"
            :before-close="hideForm"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            width="60%"
            v-if="selectUdiTypeVisible"
          >
            <productUdiType
              :closeDialog="closeDialog"
              @closeUdi="closeUdi"
            ></productUdiType>
          </el-dialog>

          <el-dialog
            title="绑定-耗材产品"
            :visible.sync="selectHospProductVisible"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            width="80%"
            v-if="selectHospProductVisible"
          >
            <selectHospProduct
              :closeDialog="closeDialog"
              :rId="rId"
            ></selectHospProduct>
          </el-dialog>

          <el-dialog
            title="解绑-耗材产品"
            :visible.sync="selectUnBindHospProductVisible"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            width="80%"
            v-if="selectUnBindHospProductVisible"
          >
            <selectUnBindHospProduct
              :closeDialog="closeDialog"
              :rId="rId"
            ></selectUnBindHospProduct>
          </el-dialog>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script>
import {
  getUdiInfos,
  deletetUdiInfos,
  updatetUdiInfos,
  updatetSingleUdiInfo,
  updateErpProduct,
  uploadSmp,
  thirdSysDetail,
  removeRl,
  sysFilterOptimize,
  spcombie,
  lockStatus,
  removeDiRl,
  disableUdi,
} from "@/api/basic/product/udiRelevance";
import {
  selectSysParamByKey,
  finProductSet,
} from "@/api/param/systemParamConfig";
import {filterByUuid} from "@/api/basic/product/udiInfo";

import selectUdi from "./UdiInfoSelectRel.vue";
import selectErp from "./udiInfoselectErpUdi";
import selectLocalUdi from "./UdiInfoSelectLocalUdi";
import selectUdiVersion from "./UdiinfoSelectVersion";
import ProductEdit from "@/views/basic/product/productEdit";
import ProductAdd from "@/views/basic/product/productAdd";
import ProductSingleEdit from "@/views/basic/product/productSingleEdit";
import productUdiType from "@/views/basic/product/productUdiType";
import selectHospProduct from "@/views/basic/product/bindHospProduct";
import selectUnBindHospProduct from "@/views/basic/product/unbindHospProduct";
import {getBasicHospType, getListTree} from "@/api/basic/basicHospType";
import {getHslbs} from "@/api/thrsys/thrHsfl";
import {postThirdProduct} from "@/api/thrsys/thrProductsExport";
import {
  getHead, executeFuc
} from "@/utils/customConfig";

export default {
  name: "prodcut",
  props: {isChoose: {required: false, default: false, type: Boolean}, chooseFunc: {required: false, type: Function}},
  data() {
    return {
      destinyTypeSelectList:[
        {value: 0 , label: "正常录入"},
        {value: 1 , label: "定数包"},
        {value: 2 , label: "项目组套"},
        {value: null , label: "正常录入"},
      ],
      Dictionary: false, //物资字典分类显示、隐藏
      filterQuery: {
        lockStatus: null,
        unionCode: null,
        udiCode: null,
        ylqxzcrbarmc: "",
        cpmctymc: "",
        nameCode: "",
        ggxh: null,
        page: 1,
        limit: 20,
        addType: 1,
        thrPiId: null,
        filterType: null,
        dispatch: null,
        groupBuy: null,
        zczbhhzbapzbh: null,
        productsType: 1
      },
      rId: null,
      selectUdiTypeVisible: false,
      selectHospProductVisible: false,
      selectUnBindHospProductVisible: false,
      loading: false,
      showSearch: true,
      productType: null,
      editQuery: null,
      editFormat: {},
      editSingleFormat: {
        uuid: null,
        relId: null,
        sptm: null,
        packUnit: null,
        measname: null,
        nameCode: null,
        catalogname1: "",
        catalogname2: "",
        catalogname3: "",
        matrial: "",
      },
      isDisableMap: {
        true: "停用",
        false: "在用",
      },
      groupBuyMap: {
        true: "集采",
        false: "非集采",
      },
      dispatchMap: {
        true: "可配送",
        false: "不可配送",
      },
      uploadMap: {
        null: "未上传",
        1: "已上传",
        2: "上传失败",
      },


      pId: 0,
      productRemarkSet: {
        remarkTitle1: "备注字段1",
        remarkTitle2: "备注字段2",
        remarkTitle3: "备注字段3",
        remarkTitle4: "备注字段4",
        remarkTitle5: "备注字段5",
        remarkTitle6: "备注字段6",
        remarkTitle7: "备注字段7",
        remarkTitle8: "备注字段8",
      },
      relevanceEdit: {
        id: null,
        thirdId: "",
        isDisable: null,
        isUseDy: false,
        isLock: null,
        isAdavence: null,
        allowNoBatch: null,
        allowNoExpire: null,
        allowNoProduct: null,
        allowNoSerial: null,
        pId: null,
      },
      defaultSys: null,
      isImport: false,
      isImportUdi: false,
      isUploadSmp: false,
      isSpCombine: false,
      isImportFile: false,
      uploadFileUrl: null,
      checked: false,
      list: [],
      detailList: [],
      sysList: [],
      filterList: [],
      options: {
        getSysFilter: []
      },
      total: 0,
      thirdNo: "",
      treeList: [],
      uuid: "111",
      originUuid: null,
      thirdId: null,
      relId: "",
      thisData: {
        nameCode: null,
        cpmctymc: null,
        ggxh: null,
      },
      multipleSelection: [],
      editDialogVisible: false, //详情
      editDiDialogVisible: false,
      editSingleDiDialogVisible: false,
      addProductDialogVisible: false,//新增产品
      selectUdiDialogVisible: false, //关联选入
      selectErpDialogVisible: false, //选入ERP产品
      selectVersionVisible: false,
      selectLocalVisible: false, //关联UDI
      isUseDyCheck: false,
      lockStatusMap: {1: "未提交", 2: "已提交", 3: "已锁定"},
      activeNames: ["1"],
      useNumEnable: true,
      vueRouteSource: 1,    //路由来源 1:耗材字典：2：第三方产品信息上传
      isSelect: false,
      onAddLoading: false,
    };
  },
  filters: {
    statusFilterType(status) {
      const statusMap = {
        false: "warning",
        true: "success",
      };
      return statusMap[status];
    },

    isDisableFilterType(status) {
      const statusMap = {
        false: "success",
        true: "warning",
      };
      return statusMap[status];
    },

    uploadFilterType(status) {
      const statusMap = {
        null: "warning",
        0: "warning",
        1: "success",
        2: "danger",
      };
      return statusMap[status];
    },
  },

  methods: {
    onReset() {
      this.$router.push({
        path: "",
      });
      this.filterQuery = {
        lockStatus: null,
        unionCode: null,
        udiCode: null,
        ylqxzcrbarmc: "",
        cpmctymc: "",
        thrPiId: null,
        nameCode: "",
        ggxh: null,
        page: 1,
        limit: 20,
        addType: 1,
      };
      this.getList();
    },
    submit() {
      this.loading = true;
      this.filterQuery.page = 1;
      this.getList();
    },
    getList() {
      getUdiInfos(this.filterQuery)
        .then((response) => {
          this.loading = false;
          this.list = response.data.list || [];
          this.total = response.data.total || 0;
        })
        .catch(() => {
          this.loading = false;
          this.list = [];
          this.total = 0;
        });
    },
    hideSearch() {
      this.showSearch = !this.showSearch;
    },
    keyup_submit(_this, event) {
      _this.filterQuery.page = 1;
      _this.getList();
      event.target.select();
    },
    getDetailList(detailQuery) {
      this.loading = true;
      filterByUuid(detailQuery)
        .then((response) => {
          this.isUseDyCheck = false;
          this.loading = false;
          this.detailList = response.data || [];
          this.detailList.forEach((item, index, array) => {
            // this.detailList[index].isAdavence = item.adavence
            // this.detailList[index].isDisable = item.disable
            // this.detailList[index].useMuti = item.useMuti
            if (item.zxxsbzbhsydysl > 1) {
              this.isUseDyCheck = true;
            }
          });
          this.productType = this.detailList[0].productType;
          this.editQuery.versionNumber = this.detailList[0].versionNumber
          this.editQuery.originUuid = this.detailList[0].originUuid
          this.editQuery.destinyType = this.detailList[0].destinyType
        })
        .catch(() => {
          this.loading = false;
          this.detailList = [];
        });
    },
    hideForm() {
      this.selectUdiTypeVisible = false;
      this.getTerrList();
    },
    getThirdSysDetail() {
      let query = {
        id: this.relevanceEdit.id,
      };
      thirdSysDetail(query)
        .then((response) => {
          this.loading = false;
          this.sysList = response.data.list || [];
        })
        .catch(() => {
          this.loading = false;
          this.sysList = [];
        });
    },

    handleDetail(row) {
      this.editQuery = row;
    },
    selectVersion() {
      this.selectVersionVisible = true;
      this.uuid = this.editQuery.uuid;
      this.originUuid = this.editQuery.originUuid;
      this.relId = this.editQuery.id;
    },
    deleteOrders(data) {
      this.loading = true;
      let tquery = {
        id: data.id + "",
      };

      deletetUdiInfos(tquery)
        .then((response) => {
          this.loading = false;
          if (response.code == 20000) {
            this.getList();
            this.$message({
              type: "success",
              message: "删除成功！",
            });
          } else {
            this.$message.error(response.message);
          }
        })
        .catch(() => {
        });
    },

    deleteDialog(_this, rowId) {
      _this.$confirm("此操作将永久删除该产品信息, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          _this.deleteOrders(rowId);
        })
        .catch(() => {
        });
    },

    intentDetail() {
      this.isImportUdi = false;
      this.selectUdiDialogVisible = true;
    },
    addProducType() {
      this.isImportUdi = false;
      this.addProductDialogVisible = true;
    },
    addSelectErp(row) {
      this.defaultSys = row.sysId;
      this.isImport = false;
      this.selectErpDialogVisible = true;
    },

    removeErp(row) {
      this.$confirm("此操作将解除该绑定产品信息, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          let query = {
            relId: this.pId,
            thirdSys: row.sysId,
          };
          removeRl(query)
            .then((response) => {
              if (response.code == 20000) {
                this.$message({
                  type: "success",
                  message: "删除成功！",
                });
                this.getList();
                this.cancelDialog();
                this.getThirdSysDetail();
              } else {
                this.$message.error(response.message);
              }
            })
            .catch(() => {
            });
        })
        .catch(() => {
        });
    },

    removeDi() {
      this.$confirm("此操作将解除该绑定DI器械信息, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          let query = {
            relId: this.editQuery.id,
          };
          removeDiRl(query)
            .then((response) => {
              if (response.code == 20000) {
                this.$message({
                  type: "success",
                  message: "删除成功！",
                });
                this.editDialogVisible = false;
                this.getList();
                this.cancelDialog();
              } else {
                this.$message.error(response.message);
              }
            })
            .catch(() => {
            });
        })
        .catch(() => {
        });
    },

    intentSelectErp(val) {
      this.uuid = val.uuid;
      this.relId = val.id;
      this.isImport = false;
      this.thisData = val;
      this.selectErpDialogVisible = true;
    },

    intentImportErp(val) {
      this.defaultSys = null;
      this.uuid = val.uuid;
      this.relId = val.id;
      this.isImport = true;
      this.thisData = val;
      this.selectErpDialogVisible = true;
    },
    uploadSMP() {
      var selectData = this.multipleSelection;
      var keys = [];
      selectData.forEach((obj) => {
        keys.push(obj.id);
      });
      var tquery = {
        keys: keys,
      };
      uploadSmp(tquery)
        .then((response) => {
          if (response.code == 20000) {
            this.$message({
              type: "success",
              message: "上传成功！",
            });
          } else {
            this.$message({
              type: "error",
              message: response.message,
            });
          }
        })
        .catch(() => {
          this.$message({
            type: "error",
            message: "上传失败",
          });
        });
    },
    intentSelectUdi(_this, val) {
      _this.relId = val.id;
      _this.isImportUdi = true;
      _this.isImport = true;
      _this.thisData = val;
      _this.selectLocalVisible = true;
    },

    intentImportUdi() {
      this.relId = null;
      this.thisData = {
        nameCode: null,
        cpmctymc: null,
        ggxh: null,
        ylqxzcrbarmc: null,
      };
      this.isImport = false;
      this.selectLocalVisible = true;
    },

    handleSelectionChange(_this, val) {
      _this.multipleSelection = val;
    },

    cancelDialog() {
      this.editDiDialogVisible = false;
      this.editSingleDiDialogVisible = false;
      this.getList();
    },
    handleCurrentChange(val) {
      this.filterQuery.page = val.page;
      this.getList();
    },
    handleModifyClick(_this, row) {
      _this.uuid = row.uuid;
      _this.relId = row.id;
      _this.isImport = false;
      _this.thisData = row;
      _this.editDialogVisible = true;

      _this.pId = row.id;
      _this.relevanceEdit = {
        id: row.id,
        isUseDy: row.isUseDy,
        isDisable: row.isDisable,
        isLock: row.isLock,
        isAdavence: row.isAdavence,
      };
      _this.checked = row.isUseDy == 1;
      _this.editQuery = row;
      //获取产品标识列表
      let ttquery = {
        id: row.id,
      };
      _this.getDetailList(ttquery);
      //获取关联第三方系统产品信息列表
      _this.getThirdSysDetail();
    },


    uploadMsg(_this, row) {
      _this.$alert(row.uploadMsg, '上传', {
        confirmButtonText: '确定',
        callback: action => {
          _this.$message({
            type: 'info',
            message: `action: ${action}`
          });
        }
      });
    },


    uploadThird(_this, row) {
      _this.$confirm('确定上传至第三方系统?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          postThirdProduct(row)
            .then((response) => {
              if (response.code == 20000) {
                _this.loading = false;
                _this.$message.success(response.data);
              } else {
                _this.$message.error(response.message);
              }
            })
            .catch(() => {
              _this.loading = false;
            });
        })
        .catch(() => {
        })
    },


    lockProducts(status) {
      let selectData = this.multipleSelection;
      let postQuery = {
        ids: [],
        lockStatus: status,
      };
      selectData.forEach((row) => {
        postQuery.ids.push(row.id);
      });
      lockStatus(postQuery)
        .then((response) => {
          if (response.code == 20000) {
            this.loading = false;
            this.$message.success(response.data);
            this.getList();
          } else {
            this.$message.error(response.message);
          }
        })
        .catch(() => {
          this.loading = false;
        });
    },
    closeHandler(){
      // this.visible = false;
    },
    closeUdi(val) {
      this.selectUdiDialogVisible = false;
      this.selectErpDialogVisible = false;
      this.selectLocalVisible = false;
      this.selectVersionVisible = false;
      this.selectHospProductVisible = false;
      this.addProductDialogVisible = false;
      this.getThirdSysDetail();
      let ttquery = {
        id: this.relId,
      };
      this.getDetailList(ttquery)
      if (val) {
        this.getList();
        this.cancelDialog();
      }
    },

    getSysFilter(_this, query) {
      sysFilterOptimize()
        .then((response) => {
          _this.loading = false;
          _this.options.getSysFilter = response.data.list || []
        })
        .catch(() => {
          _this.loading = false;
          _this.options.getSysFilter = []
        });
    },
    singleDiEdit() {
      let temp = JSON.parse(JSON.stringify(this.editQuery));
      this.editSingleFormat.uuid = temp.uuid;
      this.editSingleFormat.id = temp.id;
      this.editSingleFormat.sptm = temp.sptm;
      this.editSingleFormat.packUnit = temp.packUnit;
      this.editSingleFormat.measname = temp.measname;
      this.editSingleFormat.nameCode = temp.nameCode;
      this.editSingleDiDialogVisible = true;
    },
    diEdit(_this, row) {
      _this.uuid = row.uuid;
      _this.relId = row.id;
      _this.isImport = false;
      _this.thisData = row;
      _this.pId = row.id;
      _this.relevanceEdit = {
        id: row.id,
        isUseDy: row.isUseDy,
        isDisable: row.isDisable,
        isLock: row.isLock,
        isAdavence: row.isAdavence,
      };
      _this.editFormat = JSON.parse(JSON.stringify(row));
      _this.editDiDialogVisible = true;
    },
    closeDialog() {
      this.selectErpDialogVisible = false;
      this.selectLocalVisible = false;
      this.selectVersionVisible = false;
      this.selectHospProductVisible = false;
      this.addProductVisible = false;
      this.selectUnBindHospProductVisible = false;
      this.getList();
    },
    onAddSubmit(relSubmit) {
      this.editFormat.relSubmit = relSubmit;
      console.log(this.editFormat);
      this.onAddLoading = true
      updatetUdiInfos(this.editFormat)
        .then((response) => {
          this.onAddLoading = false
          if (response.code == 20000) {
            this.getList();
            this.cancelDialog();
            this.editDiDialogVisible = false;
          } else {
            this.$message.error(response.message);
          }
        })
        .catch(() => {
          this.onAddLoading = false
          this.cancelDialog();
        });
    },

    onAddSingleSubmit() {
      updatetSingleUdiInfo(this.editSingleFormat)
        .then((response) => {
          if (response.code == 20000) {
            this.getList();
            this.cancelDialog();
            this.editDialogVisible = false;
          } else {
            this.$message.error(response.message);
          }
        })
        .catch(() => {
          this.cancelDialog();
        });
    },

    findBasicProductSet() {
      finProductSet().then((response) => {
        if (response.code == 20000) {
          this.productRemarkSet = response.data;
        } else {
          //出错了
        }
      });
    },
    editUdiType() {
      this.selectUdiTypeVisible = true;
    },
    getTerrList() {
      getListTree(this.query)
        .then((response) => {
          var invlist = response.data || [];
          this.treeList = this.handleTree(invlist, "code", "parentCode");
        })
        .catch(() => {
        });
    },

    addHospProduct(data) {
      this.rId = data.code;
      if (data.code != 10000) {
        this.filterQuery.relCode = data.code;
      } else {
        this.filterQuery.relCode = null;
      }
      this.selectHospProductVisible = true;
    },
    removeHospProduct(data) {
      this.rId = data.code;
      if (data.code != 10000) {
        this.filterQuery.relCode = data.code;
      } else {
        this.filterQuery.relCode = null;
      }
      this.selectUnBindHospProductVisible = true;
    },
    handleNodeClick(data) {
      this.rId = data.code;
      if (data.code != 10000) {
        this.filterQuery.relCode = data.code;
      } else {
        this.filterQuery.relCode = null;
      }
      this.getList();
    },
    getHsflMethod(query) {
      if (query == null)
        return null;
      this.hsflOptions = [];
      let cQuery = {
        code: query,
        page: 1,
        limit: 20
      };
      getHslbs(cQuery)
        .then((response) => {
          this.loading = false;
          let result = response.data.list[0] || [];
          return result.hsmc;
        })
        .catch(() => {
          this.loading = false;
        });
    },
    executeFuc(row, type, clickFuc, value) {
      return executeFuc(this, row, type, clickFuc, value);
    },
    executeEval(row, expression, defaultRet) {
      if (expression) {
        return eval(expression);
      }
      return defaultRet;
    }
  },
  mounted() {
  },
  components: {
    ProductSingleEdit,
    ProductEdit,
    ProductAdd,
    selectUdi,
    selectErp,
    selectLocalUdi,
    selectUdiVersion,
    productUdiType,
    selectHospProduct,
    selectUnBindHospProduct,
  },
  created() {
    // if (this.isChoose != null)
    //   this.isSelect = this.isChoose;
    this.vueRouteSource = this.$route.query.vueRouteSource;

    this.findBasicProductSet();
    getHead("product", "1").then((re) => {
      // 处理返回的数据
      this.tableObj = re.data;
      this.tableHeader = re.data.tableList;
      this.queryList = re.data.queryList;
      this.fromList = re.data.fromList;
      this.getList()
    });
    this.getTerrList();
    // this.selectSysParam();
    this.getSysFilter(this, "");


    this.filterQuery.cpmctymc = this.$route.query.cpmctymc;
    if (this.filterQuery.cpmctymc != null) {
      this.getList()
    }
  },
};
</script>
<style scoped lang="scss">
.iconButton {
  margin-left: 0px;
  height: 30px;
}

.tree {
  ::v-deep .el-tree-node {
    white-space: normal;

    .el-tree-node__content {
      height: 100%;
      align-items: start;
    }
  }
}

.itemTag {
  float: left;
  text-align: right;
  margin-top: 10px;
  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;
  flex-wrap: nowrap;
}

/* .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>
