<template>
  <ContainerQuery>
    <div slot="left">
      <el-dropdown
        v-if="$accessCheck($Access.AddBaseData) && systemType === 1"
        split-button
        type="primary"
        @click="$router.push('/goods/manageG/AddBaseData')"
      >
        新增商品
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>
            <div class="dropdown-div" @click="getData(1)">导出</div>
          </el-dropdown-item>
          <el-dropdown-item>
            <div
              class="dropdown-div"
              @click="$router.push('/goods/manageG/GoodsImport')"
            >
              导入
            </div>
          </el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
      <el-button v-else size="small" type="primary" @click="getData(1)">
        导出
      </el-button>
    </div>
    <div v-if="$accessCheck($Access.BaseDataListSearch)" slot="more">
      <el-form :inline="true" size="small">
        <el-form-item>
          <el-input
            v-model="searchCate.keyword"
            style="width: 220px"
            placeholder="商品名称"
            clearable
            @keyup.enter.native="pageChange(1)"
            @clear="pageChange(1)"
          >
            <el-button
              slot="append"
              icon="el-icon-search"
              @click="pageChange(1)"
            ></el-button>
          </el-input>
        </el-form-item>
        <el-form-item>
          <GoodsCategory
            v-model="searchCate.categoryPath"
            :width="150"
            check-strictly
            clearable
            size="small"
            placeholder="商品分类"
            @change="categoryChange"
          />
        </el-form-item>
        <el-form-item>
          <el-input
            v-model="form.brand"
            style="width: 150px"
            clearable
            placeholder="商品品牌"
            @blur="form.brand = ''"
            @clear="brandClear"
          >
            <i
              slot="suffix"
              class="el-input__icon el-icon-search"
              @click="sel_brand = true"
            ></i>
          </el-input>
        </el-form-item>
        <el-form-item>
          <el-select
            v-model="searchCate.enableStatus"
            placeholder="商品状态"
            style="width: 150px"
            clearable
            @change="pageChange(1)"
          >
            <el-option label="启用" :value="5"></el-option>
            <el-option label="禁用" :value="4"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <div>
            <el-input
              v-model="searchCate.Merchant"
              placeholder="商户"
              style="width: 150px"
              clearable
              @clear="merchantClear"
            >
              <i
                slot="suffix"
                class="el-input__icon el-icon-search"
                @click="selectMerchant()"
              ></i>
            </el-input>
          </div>
        </el-form-item>
      </el-form>
    </div>

    <el-table
      ref="goodstabel"
      :data="base_goods_list"
      @row-dblclick="goDetail"
      @selection-change="selectionChange"
    >
      <el-table-column
        fixed="left"
        type="selection"
        align="center"
        width="55"
      ></el-table-column>
      <el-table-column
        prop="id"
        label="ID"
        fixed="left"
        width="80"
      ></el-table-column>
      <el-table-column
        prop="code"
        label="编码"
        fixed="left"
        min-width="140"
      ></el-table-column>
      <el-table-column label="商品" fixed="left" min-width="210">
        <template slot-scope="scope">
          <div class="clearfix">
            <div class="float_left">
              <el-image :src="scope.row.images[0]" fit="cover"></el-image>
            </div>
            <div class="float_left goods-name-view">
              {{ scope.row.title }}
            </div>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        v-if="classifyFlag"
        prop="categoryTitle"
        label="商品分类"
        min-width="120"
      >
        <template slot-scope="scope">
          {{ scope.row.categoryTitle }}
          <el-button
            v-if="$accessCheck($Access.BaseDataListUpdateCategory)"
            type="text"
            icon="el-icon-edit"
            @click="openSet('转移分类', scope.row)"
          ></el-button>
        </template>
      </el-table-column>
      <el-table-column
        v-if="guaranteeFlag && shelfLifeSetUp === 5"
        prop="expireTime"
        label="保质期/天"
        min-width="100"
      ></el-table-column>
      <el-table-column
        v-if="stateFlag"
        prop="enableStatus"
        label="商品状态"
        min-width="80"
      >
        <template slot-scope="scope">
          <el-switch
            v-if="$accessCheck($Access.BaseDataListUpdateEnableStatus)"
            v-model="scope.row.enableStatus"
            class="switchStyle"
            active-color="#36B365"
            :active-value="5"
            :inactive-value="4"
            active-text="启用"
            inactive-text="禁用"
            @change="updateEnableStatus($event, scope.row)"
          ></el-switch>
          <div v-else>
            <span v-if="scope.row.enableStatus === 5" class="success-status">
              启用
            </span>
            <span v-else class="danger-status">禁用</span>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        v-if="brandFlag"
        prop="brandTitle"
        label="商品品牌"
        min-width="140"
      >
        <template slot-scope="scope">
          {{ scope.row.brandTitle || "--" }}
        </template>
      </el-table-column>
      <el-table-column
        v-if="sourceFlag && systemType === 1"
        prop="sourceMsg"
        label="发布来源"
        min-width="160"
      ></el-table-column>
      <!--      <el-table-column-->
      <!--        v-if="goodsFlag"-->
      <!--        prop="isEq"-->
      <!--        label="抄码商品"-->
      <!--        min-width="160"-->
      <!--      >-->
      <!--        <template slot-scope="scope">-->
      <!--          <span v-if="scope.row.isEq === 5" class="success-status">是</span>-->
      <!--          <span v-else class="info-status">否</span>-->
      <!--        </template>-->
      <!--      </el-table-column>-->
      <el-table-column
        v-if="timeFlag"
        prop="createTime"
        label="创建时间"
        min-width="160"
      >
        <template slot-scope="scope">
          {{ $_common.formatDate(scope.row.createTime) }}
        </template>
      </el-table-column>
      <el-table-column
        v-if="systemType === 1"
        label="操作"
        fixed="right"
        width="190"
      >
        <template slot="header" slot-scope="scope">
          <span v-if="false">{{ scope.$index }}</span>
          <span class="operation">操作</span>
          <el-popover popper-class="custom-table-checkbox" trigger="click">
            <el-checkbox-group v-model="checkList">
              <el-checkbox
                v-for="(item, index) in columns"
                :key="index"
                :label="item.label"
                @change="change"
              ></el-checkbox>
            </el-checkbox-group>
            <el-button
              slot="reference"
              icon="el-icon-setting"
              type="text"
            ></el-button>
          </el-popover>
        </template>
        <template slot-scope="scope">
          <el-button
            v-if="$accessCheck($Access.EditBaseData)"
            type="text"
            @click="goDetail(scope.row)"
          >
            编辑
          </el-button>
          <el-button
            v-if="$accessCheck($Access.delBaseData)"
            type="text"
            @click="delData(scope.row.id)"
          >
            删除
          </el-button>
          <el-button
            v-if="$accessCheck($Access.PublishGoodsAddGoods)"
            type="text"
            :disabled="scope.row.enableStatus === 4"
            @click="releaseGoods(scope.row)"
          >
            发布
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <FooterPage
      :page-size="pageSize"
      :total-page.sync="total"
      :current-page.sync="page"
      @pageChange="pageChange"
      @sizeChange="sizeChange"
    >
      <div v-if="systemType === 1" slot="btn-div" class="foot-btn-div">
        <span class="batch-checkbox">
          <el-checkbox
            v-model="checkedAll"
            @change="checkAllChange"
          ></el-checkbox>
        </span>
        <el-button
          v-if="$accessCheck($Access.BaseDataListUpdateCategory)"
          size="mini"
          @click="openSet('转移分类')"
        >
          转移分类
        </el-button>
        <el-dropdown
          v-if="$accessCheck($Access.BaseDataListUpdateEnableStatus)"
        >
          <el-button size="mini">
            批量启用/禁用
            <i class="el-icon-caret-top"></i>
          </el-button>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>
              <div class="dropdown-div" @click="statusChangeMore(5)">启用</div>
            </el-dropdown-item>
            <el-dropdown-item>
              <div class="dropdown-div" @click="statusChangeMore(4)">禁用</div>
            </el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
        <el-dropdown>
          <el-button size="mini">
            批量设置
            <i class="el-icon-caret-top"></i>
          </el-button>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item
              v-if="$accessCheck($Access.BaseDataListSetNoSalesShop)"
            >
              <div class="dropdown-div" @click="openSet('设置不可销售的店铺')">
                禁销店铺
              </div>
            </el-dropdown-item>
            <el-dropdown-item v-if="$accessCheck($Access.BaseDataListSetBrand)">
              <div class="dropdown-div" @click="openSet('设置品牌')">
                转移品牌
              </div>
            </el-dropdown-item>
            <el-dropdown-item v-if="$accessCheck($Access.BaseDataListSetSku)">
              <div class="dropdown-div" @click="openSet('设置辅助单位')">
                新增辅助单位
              </div>
            </el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
        <el-button size="mini" @click="deleteStatusChange(4)">
          批量删除
        </el-button>
      </div>
    </FooterPage>
    <!--    选择品牌-->
    <BrandSelModel
      v-if="sel_brand"
      :is-check="false"
      :dialog-visible="sel_brand"
      @close="sel_brand = false"
      @confirm="brandConfirm"
    />
    <!--    选择店铺-->
    <GoodsChooseShop
      v-if="sel_shop"
      :dialog-visible="sel_shop"
      @close="sel_shop = false"
      @confirm="shopConfirm"
    />
    <AssistUnit
      v-if="unit_show"
      :assist-form="assistForm"
      :is-edit="unit_edit"
      :is-show="unit_show"
      @confirm="unitConfirm"
      @close="unit_show = false"
    />
    <el-dialog
      :close-on-press-escape="false"
      :close-on-click-modal="false"
      :title="set_tit"
      :visible.sync="is_set"
      width="30%"
    >
      <el-form ref="set_form" :model="set_form" label-width="100px">
        <el-form-item v-if="set_tit === '转移分类'" label="转移分类：">
          <GoodsCategory v-model="set_form.category" check-strictly />
        </el-form-item>
        <el-form-item
          v-if="set_tit === '设置不可销售的店铺'"
          label="禁止销售店铺："
          label-width="120px"
        >
          <SelectShop v-model="noSalesShop" :multiple="true" :enable="true" />
        </el-form-item>
        <el-form-item v-if="set_tit === '设置品牌'" label="设置品牌：">
          <el-input
            v-model="set_form.brandName"
            readonly
            style="width: 240px"
            placeholder="请选择品牌"
          >
            <i
              slot="suffix"
              class="el-input__icon el-icon-search"
              @click="sel_brand = true"
            ></i>
          </el-input>
        </el-form-item>
        <el-form-item
          v-if="set_tit === '设置辅助单位'"
          label="辅助单位："
          prop="branchUnit"
        >
          <el-tag
            v-for="(itemA, indext) in set_form.branchUnit"
            :key="indext"
            closable
            :disable-transitions="false"
            @close="delFuUnit(indext)"
          >
            <span>1{{ itemA.unitName }}={{ itemA.conversion }}基本单位</span>
            <i class="el-icon-edit" @click="EditFuUnit(indext)"></i>
          </el-tag>
          <el-button
            type="text"
            class="button-new-tag"
            size="mini"
            @click="addFuUnit"
          >
            + 新增
          </el-button>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="is_set = false">取 消</el-button>
        <el-button :loading="more_sub_btn" type="primary" @click="moreSubData">
          确 定
        </el-button>
      </span>
    </el-dialog>
    <el-drawer
      class="edit-drawer"
      :title="goods_name"
      :visible.sync="is_release"
      size="50%"
    >
      <AddGoods
        v-if="is_release"
        :basic-goods-id="basicGoodsId"
        @subData="subData"
        @closeShop="subData"
      />
    </el-drawer>
    <!--    选择商户-->
    <MearchantList
      v-if="mearchant_show"
      :is-show="mearchant_show"
      @confirmMerchant="confirmMerchant"
      @cancelMerchant="mearchant_show = false"
    />
  </ContainerQuery>
</template>

<script>
  import MearchantList from "@/component/common/MearchantList.vue";

  import GoodsCategory from "@/component/common/GoodsCategory.vue";
  import BrandSelModel from "@/component/goods/BrandSelModel.vue";
  import GoodsChooseShop from "@/component/goods/GoodsChooseShop.vue";
  import AssistUnit from "@/component/goods/AssistUnit.vue";
  import SelectShop from "@/component/goods/SelectShop.vue";
  import AddGoods from "../sale/AddGoods";
  import {
    setBrand,
    setSku,
    updateCategory,
    getAllGoodsBasic,
    exportGetAllGoodsBasic,
    searchBasic,
    exportSearchBasic,
    delGoodsBasic,
    updateEnableStatus,
    GoodsUpdateEnableStatus,
  } from "@/api/goods";
  import _ from "lodash";
  export default {
    name: "BaseDataList",
    components: {
      MearchantList,
      AddGoods,
      GoodsCategory,
      GoodsChooseShop,
      BrandSelModel,
      AssistUnit,
      SelectShop,
    },
    mixins: [],
    data() {
      return {
        mearchant_show: false,
        basicGoodsId: "",
        goods_name: "",
        branchData: [],
        brandId: "",
        set_tit: "",
        is_release: false,
        checkedAll: false,
        unit_show: false,
        more_sub_btn: false,
        sel_shop: false,
        set_brand: false,
        noSalesShop: [],
        unit_edit: false,
        isEdit: false,
        sel_brand: false,
        is_set: false,
        //  搜索获取的列表
        searchCate: {
          keyword: "",
          brandId: "",
          categoryPath: [],
          enableStatus: "",
          merchantId: "",
          Merchant: "",
        },
        set_form: {
          masterUnitId: "",
          shopName: "",
          brandName: "",
          category: [],
          branchUnit: [],
        },
        base_goods_list: [],
        form: {
          merchant: "",
          category: [],
          brand: "",
          enableStatus: "",
          key: "",
        },
        total: 0,
        page: 1,
        pageSize: 10,
        choose_data: [],
        assistForm: {},
        checkList: [
          "商品分类",
          "保质期/天",
          "商品状态",
          "商品品牌",
          "发布来源",
          "创建时间",
          // "超码商品",
        ],
        columns: [
          {
            label: "商品分类",
          },
          {
            label: "保质期/天",
          },
          {
            label: "商品状态",
          },
          {
            label: "商品品牌",
          },
          {
            label: "发布来源",
          },
          {
            label: "创建时间",
          },
          // {
          //   label: "超码商品",
          // },
        ],
        classifyFlag: true,
        guaranteeFlag: true,
        stateFlag: true,
        brandFlag: true,
        sourceFlag: true,
        timeFlag: true,
        goodsFlag: true,
      };
    },
    computed: {
      finallyColumns() {
        let finallyArray = [];
        this.checkList.forEach((checkItem) => {
          finallyArray.push(
            this.columns.filter((item) => item.label === checkItem)[0]
          );
        });
        return _.sortBy(finallyArray, (item) => item.order);
      },
    },
    mounted() {
      if (this.$route.params.page) {
        const page = this.$route.params.page.split("_");
        this.page = page[0] - 0;
        this.pageSize = page[1] - 0;
      }
      this.getAllGoodsBasic();
    },
    activated() {
      if (this.$_isInit()) return;
      this.getData();
    },
    methods: {
      // 发布商品
      releaseGoods(row) {
        this.basicGoodsId = row.id;
        this.goods_name = row.title;
        this.is_release = true;
      },
      subData() {
        this.is_release = false;
      },
      // 批量提交
      moreSubData() {
        if (this.set_tit === "转移分类") {
          this.updateCategory();
        }
        if (this.set_tit === "设置不可销售的店铺") {
          this.setNoSalesShop();
        }
        if (this.set_tit === "设置品牌") {
          this.setBrand();
        }
        if (this.set_tit === "启用" || this.set_tit === "禁用") {
          this.statusChangeMore();
        }
        if (this.set_tit === "设置辅助单位") {
          this.setSku();
        }
      },
      //  设置不可售店铺
      async setNoSalesShop() {
        if (!this.choose_data.length) {
          this.$message.warning("请选择要操作的商品");
          return;
        }
        if (!this.noSalesShop.length) {
          this.$message.warning("请选择不可售的店铺");
          return;
        }
        const idData = this.choose_data.map((item) => {
          return item.id;
        });
        const data = await setNoSalesShop({
          id: idData,
          noSalesShop: this.noSalesShop.join(","),
        });
        this.more_sub_btn = false;

        this.is_set = false;
        this.$message.success("操作成功");
        this.getData();
      },
      //  设置品牌
      async setBrand() {
        if (!this.choose_data.length) {
          this.$message.warning("请选择要操作的商品");
          return;
        }
        if (!this.brandId) {
          this.$message.warning("请选择要操作的品牌");
          return;
        }
        const idData = this.choose_data.map((item) => {
          return item.id;
        });
        const data = await setBrand({
          id: idData,
          brandId: this.brandId,
        });
        this.more_sub_btn = false;

        this.is_set = false;
        this.$message.success("操作成功");
        this.getData();
      },
      //  批量设置单位
      async setSku() {
        if (!this.choose_data.length) {
          this.$message.warning("请选择要操作的商品");
          return;
        }
        const idData = this.choose_data.map((item) => {
          return item.id;
        });
        this.more_sub_btn = true;
        const data = await setSku({
          id: idData, // 要移动的基础商品id
          branchData: this.set_form.branchUnit,
        });
        this.more_sub_btn = false;

        this.is_set = false;
        this.$message.success("操作成功");
        this.getData();
      },
      // 转移分类
      async updateCategory() {
        if (!this.choose_data.length) {
          this.$message.warning("请选择要操作的商品");
          return;
        }
        if (!this.set_form.category) {
          this.$message.warning("请选择要转移的分类");
          return;
        }
        const idData = this.choose_data.map((item) => {
          return item.id;
        });
        this.more_sub_btn = true;
        const data = await updateCategory({
          id: idData, // 要移动的基础商品id
          categoryId: this.set_form.category[this.set_form.category.length - 1], // 移动至商品分类id
          categoryPath: this.set_form.category.join(","), // 新的商品分类路径
        });
        this.more_sub_btn = false;

        this.is_set = false;
        this.$message.success("操作成功");
        this.set_form.category = [];
        this.getData();
      },
      // 获取列表
      async getAllGoodsBasic(exports) {
        if (exports) {
          const data = await exportGetAllGoodsBasic({
            page: this.page,
            pageSize: this.pageSize,
            export: 1,
          });
        } else {
          const data = await getAllGoodsBasic({
            page: this.page,
            pageSize: this.pageSize,
          });
          this.base_goods_list = data.data;
          this.total = data.pageTotal;
        }
      },
      // 搜索引擎 列表
      async searchBasic(exports) {
        const categoryPath = this.searchCate.categoryPath
          ? this.searchCate.categoryPath.join(",")
          : "";
        let params = {
          keyword: this.searchCate.keyword,
          brandId: this.searchCate.brandId,
          categoryPath: categoryPath,
          enableStatus: this.searchCate.enableStatus,
          page: this.page,
          pageSize: this.pageSize,
          merchantId: this.searchCate.merchantId,
        };
        if (exports) {
          const data = await exportSearchBasic({
            ...params,
            export: 1,
          });
        } else {
          const data = await searchBasic(params);

          this.base_goods_list = data.data;
          this.total = data.pageTotal;
        }
      },
      // 商户搜索
      confirmMerchant(row) {
        this.searchCate.Merchant = row.name;
        this.searchCate.merchantId = row.id;
        this.pageChange(1);
      },
      merchantClear() {
        this.searchCate.Merchant = "";
        this.searchCate.merchantId = "";
        this.pageChange(1);
      },
      selectMerchant() {
        this.mearchant_show = true;
      },
      cancelMerchant() {
        this.mearchant_show = false;
      },
      //  分类搜索 categoryChange
      categoryChange(val) {
        this.pageChange(1);
      },
      //  选择品牌
      brandConfirm(row) {
        if (this.is_set) {
          // 批量设置品牌
          this.set_form.brandName = row[0].title;
          this.brandId = row[0].id;
        } else {
          // 搜索选择品牌
          this.form.brand = row[0].title;
          this.searchCate.brandId = row[0].id;
          this.pageChange(1);
        }
      },
      // 搜索 品牌输入框清空
      brandClear() {
        this.form.brand = "";
        this.searchCate.brandId = "";
        this.pageChange(1);
      },
      // 打开批量设置弹窗
      openSet(tit, row) {
        this.is_set = true;
        this.set_tit = tit;
        if (row) {
          this.choose_data = [row];
        }
      },
      // 批量设置辅助单位
      EditFuUnit(index) {
        this.unit_show = true;
        this.unit_edit = true;
        this.assist_index = index;
        this.assistForm = this.set_form.branchUnit[index];
      },
      // 删除批量设置辅助单位
      delFuUnit(index) {
        this.set_form.branchUnit.splice(index, 1);
      },
      // 添加批量设置辅助单位
      addFuUnit() {
        this.unit_show = true;
        this.unit_edit = false;
      },
      // 选择批量设置辅助单位
      unitConfirm(row) {
        if (!this.unit_edit) {
          this.set_form.branchUnit.push(row);
        } else {
          this.set_form.branchUnit[this.assist_index] = row;
        }
      },
      // 批量选择
      selectionChange(val) {
        this.checkedAll = val.length === this.base_goods_list.length;
        this.choose_data = val;
      },
      // 删除商品
      delData(id) {
        this.$confirm("确定删除该商品吗？", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }).then(async () => {
          const data = await delGoodsBasic(id);

          this.$message({
            type: "success",
            message: "删除成功!",
          });
          this.getData();
        });
      },
      // 禁用启用
      async updateEnableStatus(val, row) {
        try {
          const data = await updateEnableStatus({
            id: row.id,
            enableStatus: val,
          });
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        } catch (e) {
          this.getData();
        }
      },
      // 判断当前使用方法为列表接口还是搜索引擎接口 获取列表数据
      getData(exports) {
        const isKey = this.$_common.isSerch(this.searchCate);
        if (isKey) {
          this.searchBasic(exports);
        } else {
          this.getAllGoodsBasic(exports);
        }
      },
      // 切页
      pageChange(val) {
        this.page = val;
        this.getData();
      },
      // 每页数据大小改变
      sizeChange(val) {
        this.page = 1;
        this.pageSize = val;
        this.getData();
      },
      goDetail(row) {
        if (this.$accessCheck(this.$Access.EditBaseData)) {
          this.$router.push(`/goods/manageG/EditBaseData/${row.id}`);
        }
      },
      statusChangeMore(enableStatus) {
        let title =
          enableStatus === 4
            ? "确定要批量禁用这些商品吗？"
            : "确定要批量启用这些商品吗？";
        this.$confirm(title, "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }).then(async () => {
          if (!this.choose_data.length) {
            this.$message.warning("请选择要操作的商品");
            return;
          }
          const idData = this.choose_data.map((item) => {
            return item.id;
          });
          const data = await updateEnableStatus({
            id: idData,
            enableStatus: enableStatus,
          });
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.getData();
        });
      },
      //批量删除
      deleteStatusChange(deleteStatus) {
        this.$confirm("确定要批量删除这些商品吗", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }).then(async () => {
          if (!this.choose_data.length) {
            this.$message.warning("请选择要操作的商品");
            return;
          }
          const idData = this.choose_data.map((item) => {
            return item.id;
          });
          const data = await updateEnableStatus({
            id: idData,
            deleteStatus: deleteStatus,
          });
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.getData();
        });
      },
      checkAllChange() {
        this.$refs.goodstabel.toggleAllSelection();
      },
      change() {
        this.classifyFlag = this.checkList.some((item) => item === "商品分类");
        this.guaranteeFlag = this.checkList.some(
          (item) => item === "保质期/天"
        );
        this.stateFlag = this.checkList.some((item) => item === "商品状态");
        this.brandFlag = this.checkList.some((item) => item === "商品品牌");
        this.sourceFlag = this.checkList.some((item) => item === "发布来源");
        this.timeFlag = this.checkList.some((item) => item === "创建时间");
        // this.goodsFlag = this.checkList.some((item) => item === "超码商品");
      },
    },
  };
</script>
<style scoped lang="scss">
  .custom-table-checkbox {
    .el-checkbox {
      display: block !important;
      margin: 0 0 $base-padding/4 0;
    }
  }
</style>
