<template>
  <div class="app-container">
    <div class="card-Table">
      <!--价格表设定-->
      <el-form ref="formSelectOpt" :model="formJGB" label-width="120px">
        <el-row>
          <el-col :span="8">
            <Select ref="areaSelect" :label="$t('elevatorModel.areaName')" prop="areaId" :labelProp="localLabel" valueProp="areaId"
              :data="areaOps" :placeholder="$t('common.pleaseSelect')" disabled labelWidth="50px" />
          </el-col>
          <el-col :span="8">
            <Select :label="$t('elevatorModel.elevatorTypeName')" prop="elevatorType" :data="dict.type.elevator_type"
              :placeholder="$t('common.pleaseSelect')" disabled />
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('elevatorModel.elevatorModel')" prop="elevatorModel">
              <el-input v-model="formJGB.elevatorModel" :placeholder="$t('common.pleaseInput')" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row style="margin-bottom: 20px">
          <el-col :span="24">
            <CustomButton icon="el-icon-download" size="mini" plain label="导出" @handleClick="handleExport" :loading="exportLoading"/>
            <ImportModal style="margin-left:10px" title="导入" icon="el-icon-upload2" :close="initData" :defaultParams="{ elevatorModelId }" :tableType="5" />
          </el-col>
        </el-row>
        <el-row>
          <el-tabs type="border-card">
            <el-tab-pane :label="$t('elevatorModel.JJManage')" style="height: 540px;overflow: auto">

              <el-col :span="12" style="padding-left: 0px;margin-bottom: 10px">
                <CustomButton icon="el-icon-plus" type="primary" size="mini" label="common.add" @handleClick="handleOpenBasic"/>
                <CustomButton icon="el-icon-edit" plain size="mini" label="关联参数设定" @handleClick="handleOpenParams"/>
              </el-col>

              <el-table ref="table" :data="basicTableList" v-loading="basicTableLoading" row-key="id" class="page-table"
                :row-style="{ 'height': '8px' }" max-height="540px" :border="true"
                :header-cell-style="{ 'background-color': '#F4F6F8', 'border-right': '1px solid #dfdcdc', 'color': '#92A2B5' }">
                <el-table-column type="index" width="55" align="center" label="No." fixed="left" />

                <template v-for="code,index in relatedParas">
                  <el-table-column :prop="`relatedPara${index+1}`" :key="code" v-if="Boolean(code)" :label="paraMap[code] || code" width="200px" show-overflow-tooltip />
                </template>

                <el-table-column prop="standardDoorWidth" :label="$t('开门宽')" width="200px" show-overflow-tooltip />
                <el-table-column prop="standardDoorHeight" :label="$t('开门高')" width="200px" show-overflow-tooltip />
                <el-table-column prop="maxLiftingHeight" :label="$t('最大提示高度')" width="200px" show-overflow-tooltip />
                <el-table-column prop="standardFloors" :label="$t('标准层站数')" width="200px" show-overflow-tooltip />
                <el-table-column prop="basicPrice" :label="$t('基础价格')" width="200px" show-overflow-tooltip />
                <el-table-column prop="addOnefloorPrice" :label="$t('层站加价')" width="200px" show-overflow-tooltip />
                <el-table-column prop="subtractOnefloorPrice" :label="$t('层站减价')" width="200px" show-overflow-tooltip />
                <el-table-column prop="sortNumber" :label="$t('排序')" width="120px" align="center"/>
                <el-table-column :label="$t('操作')" width="200px" fixed="right" align="center">
                  <template #default="{ row }">
                    <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEditBasic(row)">编辑</el-button>
                    <el-button size="mini" type="text" icon="el-icon-document-copy" @click="handleCopyBasic(row)">复制</el-button>
                    <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDeleteBasic(row)">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <pagination v-show="basicTableQueryParams.total > 0"
                :total="basicTableQueryParams.total ? basicTableQueryParams.total : 0"
                :page.sync="basicTableQueryParams.pageNum" :limit.sync="basicTableQueryParams.pageSize"
                @pagination="getBasicParaList" />

            </el-tab-pane>
            <el-tab-pane :label="$t('elevatorModel.XPManage')" style="height: 540px;overflow: auto">

              <el-col :span="24" style="padding-left: 0px;margin-bottom: 10px">
                <Form v-model="optionTableQueryParams" label-width="120px">
                  <Input :label="$t('加价项目名称')" prop="markupName" placeholder="" />
                  <Select :label="$t('状态')" prop="status" :data="dict.type.status_switch" placeholder="" />
                  <el-button style="margin-left: 20px;" @click="getOptionParaList" type="primary">{{ }}查询</el-button>
                </Form>
              </el-col>

              <el-col :span="12" style="padding-left: 0px;margin-bottom: 10px">
                <el-button type="primary" size="mini" icon="el-icon-plus" @click="handleOpen">{{ }}新增</el-button>
              </el-col>

              <el-table ref="table" :data="optionTableList" v-loading="optionTableLoading" row-key="id"
                class="page-table" :row-style="{ 'height': '8px' }" max-height="520px" :border="true"
                :header-cell-style="{ 'background-color': '#F4F6F8', 'border-right': '1px solid #dfdcdc', 'color': '#92A2B5' }">
                <el-table-column type="index" width="55" align="center" label="No." fixed="left" />
                <el-table-column prop="markupName" :label="$t('加价项目名称')" width="200px" fixed="left"
                  show-overflow-tooltip />
                <el-table-column prop="paraCode" :label="$t('选配关联参数')" width="200px" fixed="left" show-overflow-tooltip
                  :formatter="paraLabelFormatter" />
                <el-table-column v-for="index in 10" :prop="`relatedParaCode${index}`" :label="$t(`其他关联参数${index}`)" width="200px" show-overflow-tooltip
                  :formatter="paraLabelFormatter" />
                <el-table-column prop="sortIndex" :label="$t('排序')" width="120px" align="center"/>
                <el-table-column prop="status" :label="$t('状态')" width="100px" align="center" fixed="right">
                  <template #default="{ row }">
                    <el-switch v-model="row.status" active-value="0" inactive-value="1" @change="handleToggleStatus(row)">
                    </el-switch>
                  </template>
                </el-table-column>
                <el-table-column prop="optionCount" :label="$t('可选配置数量')" align="center" width="100px" fixed="right" />
                <el-table-column :label="$t('操作')" width="200px" fixed="right" align="center">
                  <template #default="{ row }">
                    <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(row)">明细</el-button>
                    <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>
                    <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(row)">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <pagination v-show="optionTableQueryParams.total > 0"
                :total="optionTableQueryParams.total ? optionTableQueryParams.total : 0"
                :page.sync="optionTableQueryParams.pageNum" :limit.sync="optionTableQueryParams.pageSize"
                @pagination="getOptionParaList" />
            </el-tab-pane>
          </el-tabs>
        </el-row>
      </el-form>
    </div>

    <DialogPage ref="paramsDialog" width="540px" @success="getRelatedParams">
      <template #default="{form}">
        <Select :label="$t('关联参数1')" prop="relatedParaCode1" :data="otherList" valueProp="key" :maxlength="500" required/>
        <Select :label="$t('关联参数2')" prop="relatedParaCode2" :data="otherList" valueProp="key" :maxlength="500" :disabled="!form.relatedParaCode1"/>
        <Select :label="$t('关联参数3')" prop="relatedParaCode3" :data="otherList" valueProp="key" :maxlength="500" :disabled="!form.relatedParaCode2"/>
        <Select :label="$t('关联参数4')" prop="relatedParaCode4" :data="otherList" valueProp="key" :maxlength="500" :disabled="!form.relatedParaCode3"/>
        <Select :label="$t('关联参数5')" prop="relatedParaCode5" :data="otherList" valueProp="key" :maxlength="500" :disabled="!form.relatedParaCode4"/>
      </template>

    </DialogPage>

    <DialogPage ref="basicDialog" :title="$t('基价项目')" width="1050px" @success="getBasicParaList">
      <template #default="{form}">
        <template v-for="code,index in relatedParas">
          <Input :label="paraMap[code] || code" v-if="Boolean(code)" :prop="`relatedPara${index+1}`" required />
        </template>
        <InputNumber prop="standardDoorWidth" :label="$t('开门宽')" required />
        <InputNumber prop="standardDoorHeight" :label="$t('开门高')" required />
        <InputNumber prop="maxLiftingHeight" :label="$t('最大提升高度')" required />
        <InputNumber prop="standardFloors" :label="$t('标准层站数')" required />
        <InputNumber prop="basicPrice" :label="$t('基础价格')" required />
        <InputNumber prop="addOnefloorPrice" :label="$t('层站加价')" required />
        <InputNumber prop="subtractOnefloorPrice" :label="$t('层站减价')" required />
        <InputNumber :label="$t('排序')" prop="sortNumber" required />
        <br/>
        <Input type="textarea" :label="$t('备注')" prop="remark" width="740px" :maxlength="500" />
      </template>

    </DialogPage>

    <DialogPage ref="optionDialog" :title="$t('选配项目')" width="800px" @success="getOptionParaList">
      <Input :label="$t('加价项目名称')" prop="markupName" required :maxlength="100" />
      <Select :label="$t('选配关联参数')" prop="paraCode" :data="optionList" valueProp="key" required />
      <Select :label="$t('其他关联参数1')" prop="relatedParaCode1" :data="otherList" valueProp="key" />
      <Select :label="$t('其他关联参数2')" prop="relatedParaCode2" :data="otherList" valueProp="key" />
      <Select :label="$t('其他关联参数3')" prop="relatedParaCode3" :data="otherList" valueProp="key" />
      <Select :label="$t('其他关联参数4')" prop="relatedParaCode4" :data="otherList" valueProp="key" />
      <Select :label="$t('其他关联参数5')" prop="relatedParaCode5" :data="otherList" valueProp="key" />
      <Select :label="$t('其他关联参数6')" prop="relatedParaCode6" :data="otherList" valueProp="key" />
      <Select :label="$t('其他关联参数7')" prop="relatedParaCode7" :data="otherList" valueProp="key" />
      <Select :label="$t('其他关联参数8')" prop="relatedParaCode8" :data="otherList" valueProp="key" />
      <Select :label="$t('其他关联参数9')" prop="relatedParaCode9" :data="otherList" valueProp="key" />
      <Select :label="$t('其他关联参数10')" prop="relatedParaCode10" :data="otherList" valueProp="key" />
      <InputNumber :label="$t('排序')" prop="sortIndex" required />
      <Select :label="$t('导出参数')" prop="exportParaCodeList" :data="optionList" valueProp="key" multiple/>
      <Input type="textarea" :label="$t('备注')" prop="remark" width="740px" :maxlength="500" />
    </DialogPage>

  </div>
</template>


<script>
import { getModel, addModel, updateModel, getArea, getModelParam, getModelSelecItem, getModelStandItem, getModelJgbInfo } from "@/api/business/crm/elevatorModel.js";
import { updateModelParam, listPara } from "@/api/business/crm/areaPara.js";
import { updateModelSelect } from "@/api/business/crm/areaSelectItem.js";
import { updateModelStand } from "@/api/business/crm/standard.js";
import { listOptionPara, getOptionPara, addOptionPara, updateOptionPara, delOptionPara, toggleStatusOptionPara } from "@/api/business/crm/areaOptionPara.js";
import { listBasicPara, getBasicPara, addBasicPara, updateBasicPara, delBasicPara, toggleStatusBasicPara, exportBasicPara, setParams, getParams } from "@/api/business/crm/areaBasicPara.js";

import { downloadTemplate } from '@/api/excel'

import ImportModal from "../../../components/ImportModal/index";
import { getAreaTree } from "@/api/common/common";
import InputColumn from "../../../components/element/table/InputColumn";
import InputNumberColumn from "../../../components/element/table/InputNumberColumn";
import moment, { max } from "moment";

export default {
  name: "PriceForm",
  components: { InputNumberColumn, InputColumn, ImportModal },
  dicts: ['input_type', 'para_category', 'elevator_type', 'status_switch'],
  data() {
    return {
      // 遮罩层
      loading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 【请填写功能名称】表格数据
      libraryList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        areaId: null,
        elevatorType: null,
        elevatorModel: null,
        status: null,
      },
      exportLoading: false,
      // 表单参数
      form: {
        areaId: null,
        areaName: null,
        elevatorType: null,
        elevatorModel: null,
        remark: null,
        status: null,
      },
      // 表单校验
      rules: {
        areaId: [
          { required: true, message: this.$t('common.pleaseSelect'), trigger: 'blur' }
        ],
        elevatorType: [
          { required: true, message: this.$t('common.pleaseSelect'), trigger: 'blur' }
        ],
        elevatorModel: [
          { required: true, message: this.$t('common.pleaseInput'), trigger: 'blur' }
        ],
        status: [
          { required: true, message: this.$t('common.pleaseSelect'), trigger: 'blur' }
        ],
        remark: [
          { required: true, message: this.$t('common.pleaseInput'), trigger: 'blur' }
        ],
      },
      selections: [],
      // 地区下拉
      areaOps: [],
      // 地区树
      areaTree: [],
      localLabel: "",
      localParaLabel: '',
      localSelectLabel: "",
      openJGB: false,
      formJGB: {},
      JJLoading: false,
      selectionsJGB: [],
      elevatorModelId:null,

      basicTableQueryParams: {
        pageNum: 1,
        pageSize: 10,
        total: 0,
      },
      basicTableLoading: false,
      basicTableList: [],

      optionTableQueryParams: {
        pageNum: 1,
        pageSize: 10,
        total: 0,
        markupName: '',
        status: null,
      },
      optionTableLoading: false,
      optionTableList: [],
      paraLibraryList: [],
      paraLibraryListOpt: [],
      optionList: [],
      otherList: [],
      paraMap: {},
      relatedParas: [],
      relatedParamObj: {}
    };
  },
  created() {
    this.initData()
    this.setLabel();
    this.getAreaOps();
    this.getAreaTree();
  },
  activated() {
    this.initData()
  },
  methods: {
    paraLabelFormatter(row, column, value) {
      return this.paraMap[value] || value
    },
    async initData() {
      this.elevatorModelId = this.$route.query && this.$route.query.id;

      const response = await getModelJgbInfo(this.elevatorModelId);
      //处理数据，赋值为穿梭框选中集合
      this.formJGB = response.data;
      this.openJGB = true;
      //this.title = this.$t('paraLibrary.editParameter');
      this.title = "编辑价格表"

      this.getRelatedParams()
      this.getBasicParaList()
      this.getOptionParaList()
      this.getParamLibraryList()
    },
    getRelatedParams(){
      getParams(this.elevatorModelId).then(res => {
        if (res.data) {
          const {relatedParaCode1, relatedParaCode2, relatedParaCode3, relatedParaCode4, relatedParaCode5} = res.data
          this.relatedParamObj = res.data
          this.relatedParas = [relatedParaCode1, relatedParaCode2, relatedParaCode3, relatedParaCode4, relatedParaCode5]
        }  else {
          this.relatedParamObj = {}
          this.relatedParas = []
        }

      })
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = this.$t('paraLibrary.addParameter');
    },
    /** 修改按钮操作 */
    async handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids

      const response = await getModel(id);
      this.form = response.data;
      this.open = true;
      this.title = this.$t('paraLibrary.editParameter');
    },
    getList() {

    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateModel(this.form).then(response => {
              this.$modal.msgSuccess(this.$t('common.editSuccess'));
              this.open = false;
              this.getList();
            });
          } else {
            addModel(this.form).then(response => {
              this.$modal.msgSuccess(this.$t('common.addSuccess'));
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },

    /** 导出按钮操作 */
    handleExport() {
      this.exportLoading = true;
      const areaName = this.$refs.areaSelect.getSelectValue
      downloadTemplate({ tableType: 5, elevatorModelId: this.elevatorModelId, withData: true, downloadFileName: `价格表设定_${areaName}_${this.formJGB.elevatorModel}_${moment().format('YYYYMMDD')}.xlsx` })
        .finally(() => this.exportLoading = false)
    },
    /** 导入按钮操作 */
    handleImport() { },
    /** 行link操作 */
    handleView(row) {
      this.$tab.openPage(this.$t('paraLibrary.paraSelectItems'), '/crmManagement/library-view/index/' + row.id);
    },
    // 字典值format
    formatDict(value, dictType) {
      let labelStr = '';
      for (let i = 0; i < this.dict.type[dictType].length; i++) {
        let item = this.dict.type[dictType][i]
        if (item.value == value) {
          labelStr = item.label;
          break;
        }
      }
      return labelStr;
    },

    // 获取地区树
    getAreaTree() {
      getAreaTree().then(response => {
        this.areaTree = response.data;
        console.log('allAreaList', this.areaTree)
        // 将根节点设置 isDisabled: true
        // if (this.areaTree.length > 0) {
        //   this.areaTree[0].isDisabled = true;
        // }
      });
    },
    async getAreaOps() {
      const response = await getArea();
      this.areaOps = response.data;
    },
    //设置本地语音label
    setLabel() {
      let currentLocale = window.VueI18n.locale;
      switch (currentLocale) {
        case "chinese": this.localLabel = "areaName"
          this.localParaLabel = "paraName"
          this.localSelectLabel = "label"
          break
        case "english": this.localLabel = "areaNameUS"
          this.localParaLabel = "paraNameUS"
          this.localSelectLabel = "labelUS"
          break
        case "russia": this.localLabel = "areaNameRU"
          this.localParaLabel = "paraNameRU"
          this.localSelectLabel = "labelRU"
          break
        case "spanish": this.localLabel = "areaNameES"
          this.localParaLabel = "paraNameES"
          this.localSelectLabel = "labelES"
          break
      }
    },
    //改变语言
    changeLanguage(id) {
      let res = this.selectLabelList(this.areaOps, id, this.localLabel, "areaId");
      return res ? res : "-"
    },
    //跳转
    jump() {
      let query = {
        test: 's'
      };
      this.$router.push({ path: "/system/notice", query: query });
    },
    //参数选项
    async handleSelect(row) {
      this.resetSelectOpt();
      const id = row.id || this.ids
      const response = await getModelSelecItem(id);
      //处理数据，赋值为穿梭框选中集合
      this.formSelectOpt = response.data;

      this.openSelectOpt = true;
      this.title = this.$t('paraLibrary.editParameter');

    },
    resetXP() {
      this.formXP = {
        areaId: null,
        elevatorType: null,
        elevatorModel: null,
        remark: null,
        status: null,
        paraSelect: [],
      }
      this.paraSelectList = []
    },
    resetSelectOpt() {
      this.formSelectOpt = {
        areaId: null,
        elevatorType: null,
        elevatorModel: null,
        remark: null,
        status: null,
        TabsList: [],
      }
    },
    resetStand() {
      this.formStand = {
        areaId: null,
        elevatorType: null,
        elevatorModel: null,
        remark: null,
        status: null,
        tabsList: [],
      }
    },
    //获取全部的参数列表
    getParamLibraryList() {
      let params;
      params = {
        pageNum: 0,
        pageSize: 0,
        status: 0,
        elevatorModelId: this.elevatorModelId,
      };
      listPara(params).then(response => {
        this.paraLibraryList = response.rows.map(item => ({ key: item.paraCode, label: item.paraName }))
        this.optionList = this.paraLibraryList
        this.otherList = this.paraLibraryList
        const paraMap = {}
        this.paraLibraryList.forEach(item => {
          paraMap[item.key] = item.label
        })
        this.paraMap = paraMap

      });
    },
    /**获取国际化*/
    getParaLabel(value) {
      let res = "-";
      let dicts = this.dict.type.para_category;
      dicts.some(it => {
        if (it.value == value) {
          res = it.label
        }
      })
      return res
    },
    /**改变编辑状态*/
    changeEditFlag(row) {
      //把状态变为已改变
      row.operationFlag = 2
    },
    /** 提交设置参数选项按钮 */
    submitSelectForm() {
      this.$refs["formSelectOpt"].validate(valid => {
        if (valid) {
          updateModelSelect(this.formSelectOpt).then(response => {
            this.$modal.msgSuccess(this.$t('common.editSuccess'));
            this.openSelectOpt = false;
            this.getList();
          });
        }
      });
    },


    /**改变编辑标志并且设置修改的id*/
    setSelectId(value, row) {
      //改变编辑标志
      row.operationFlag = 2
      //设置Id值
      let arrs = row.selectItemList
      arrs.some(item => {
        if (value == item.value) {
          row.paraDefaultId = item.paraSelectItemId
        }
      });
    },

    /**打开价格表编辑页面*/
    async handleJGB() {
      this.resetJGB();
      const response = await getModelJgbInfo(this.elevatorModelId);
      //处理数据，赋值为穿梭框选中集合
      this.formJGB = response.data;
      this.openJGB = true;
      //this.title = this.$t('paraLibrary.editParameter');
      this.title = "编辑价格表"
    },

    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
      this.selections = selection
    },
    // 取消按钮
    cancel() {
      this.openJGB = false;
      this.resetJGB();
    },
    resetJGB() {
      this.formJGB = {
        areaId: null,
        elevatorType: null,
        elevatorModel: null,
        remark: null,
        status: null,
        baseData: [],
        xpData: []
      }
    },
    /** 提交默认值设定 */
    submitJGB() {
      this.$refs["formStand"].validate(valid => {
        if (valid) {
          updateModelStand(this.formStand).then(response => {
            this.$modal.msgSuccess(this.$t('common.editSuccess'));
            this.openStand = false;
            this.getList();
          });
        }
      });
    },
    handleOpenBasic() {
      if (this.relatedParas.filter(code => Boolean(code)).length === 0) {
        this.$message.error('请先进行关联参数设定')
        return
      }
      this.$refs.basicDialog.open(addBasicPara, { elevatorModelId: this.elevatorModelId })
    },
    handleOpenParams() {
      this.$refs.paramsDialog.open(setParams, { elevatorModelId: this.elevatorModelId, ...this.relatedParamObj }, '关联参数设定')
    },
    handleOpen() {
      this.$refs.optionDialog.open(addOptionPara, { elevatorModelId: this.elevatorModelId })
    },
    handleEdit(row) {
      this.$refs.optionDialog.open(updateOptionPara, getOptionPara.bind(this, row.id))
    },
    handleEditBasic(row) {
      this.$refs.basicDialog.open(updateBasicPara, getBasicPara.bind(this, row.id))
    },
    handleCopyBasic(row) {
      this.$refs.basicDialog.open(addBasicPara, getBasicPara.bind(this, row.id), "复制")
    },
    getOptionParaList() {
      this.optionTableLoading = true;
      this.optionTableQueryParams.elevatorModelId = this.elevatorModelId;
      listOptionPara(this.optionTableQueryParams).then(response => {
        this.optionTableList = response.rows;
        this.optionTableQueryParams.total = response.total;
      }).finally(() => this.optionTableLoading = false);
    },
    handleDelete(row) {
      this.$modal.confirm('是否确认删除名称为"' + row.markupName + '"的数据项？').then(function () {
        return delOptionPara(row.id);
      }).then(() => {
        this.getOptionParaList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    handleDeleteBasic(row) {
      this.$modal.confirm('是否确认删除该数据项？').then(function () {
        return delBasicPara(row.id);
      }).then(() => {
        this.getBasicParaList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    handleToggleStatus(row) {
      toggleStatusOptionPara(row).then(response => {
        this.$modal.msgSuccess("修改成功");
        this.getOptionParaList();
      })
    },
    handleDetail(row) {
      this.$router.push({ path: "/para/priceFormDetail", query: { id: row.id } });
    },
    getBasicParaList() {
      this.basicTableLoading = true;
      this.basicTableQueryParams.elevatorModelId = this.elevatorModelId;
      listBasicPara(this.basicTableQueryParams).then(response => {
        this.basicTableList = response.rows;
        this.basicTableQueryParams.total = response.total;
      }).finally(() => this.basicTableLoading = false);
    }
  }
};
</script>

<style lang="scss" scoped>
.paraSelect {
  ::v-deep .el-transfer-panel {
    width: 250px;
    height: 450px;
  }

  ::v-deep .el-transfer-panel__body {
    height: 390px;

    .el-transfer-panel__list {
      height: 390px;
    }
  }

}

.search-form {
  background: #FFFFFF;
  box-shadow: 0px 2px 10px 0px #CED6DD;
  padding: 15px 0 0 0;
}

.card-Table {
  padding: 24px;
  margin-top: 0;
  background: #FFFFFF;
  box-shadow: 0 2px 10px 0 #CED6DD;
  border-radius: 6px;

  ::v-deep .el-table {
    .caret-wrapper {
      display: none !important;
    }

    .label-header .caret-wrapper {
      display: inline-block !important;
    }
  }

}
</style>
