|
@@ -2,1807 +2,100 @@
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
<el-tabs v-model="activeTab">
|
|
<el-tabs v-model="activeTab">
|
|
<el-tab-pane label="用电分类" name="first">
|
|
<el-tab-pane label="用电分类" name="first">
|
|
- <el-row :gutter="20">
|
|
|
|
- <el-col :span="4" :xs="24">
|
|
|
|
- <div class="head-container">
|
|
|
|
- <el-input v-model="areaName" placeholder="请输入区域名称" clearable size="small" prefix-icon="el-icon-search"
|
|
|
|
- style="margin-bottom: 20px"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div class="head-container" style="height: 100vh; overflow: hidden; position: relative;">
|
|
|
|
- <el-tree :data="treeAreaOptions" :props="defaultProps" :expand-on-click-node="false"
|
|
|
|
- :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all highlight-current
|
|
|
|
- @node-click="handleNodeClick" style="height: calc(100vh - 50px); overflow-y: auto;"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="20" :xs="24">
|
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAttrAdd" v-hasPermi="['basecfg:price:add']">新增
|
|
|
|
- </el-button>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-table v-loading="loading" :data="attrList">
|
|
|
|
- <el-table-column label="区域" align="center" prop="areaName"/>
|
|
|
|
- <el-table-column label="状态" align="center" width="100">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-tag :type="scope.$index === attrList.length - 1 ? 'success' : 'info'" disable-transitions>
|
|
|
|
- {{ scope.$index === attrList.length - 1 ? '生效' : '继承' }}
|
|
|
|
- </el-tag>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="用电分类" align="center" prop="elecTypeName" />
|
|
|
|
- <el-table-column label="电压等级" align="center" prop="voltageLevel" />
|
|
|
|
- <el-table-column label="容(需)量策略" align="center">
|
|
|
|
- <el-table-column label="容(需)量类型" align="center" prop="reqCapacityFlag" :formatter="matchReqCapacityFlag" />
|
|
|
|
- <el-table-column label="变压器容量(千伏·安)" align="center" prop="transCapacity" />
|
|
|
|
- <el-table-column label="最大需量(千瓦)" align="center" prop="reqQuantity" />
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <!-- 修改按钮 -->
|
|
|
|
- <el-tooltip
|
|
|
|
- effect="dark"
|
|
|
|
- :content="scope.row.areaCode !== currentAreaCode ? '请到上游节点编辑' : '修改'"
|
|
|
|
- placement="top"
|
|
|
|
- :open-delay="0"
|
|
|
|
- :disabled="scope.row.areaCode === currentAreaCode">
|
|
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-edit"
|
|
|
|
- :disabled="scope.row.areaCode !== currentAreaCode"
|
|
|
|
- @click="handleAttrUpdate(scope.row)"
|
|
|
|
- v-hasPermi="['basecfg:price:edit']">
|
|
|
|
- 修改
|
|
|
|
- </el-button>
|
|
|
|
- </el-tooltip>
|
|
|
|
- <el-tooltip
|
|
|
|
- effect="dark"
|
|
|
|
- :content="scope.row.areaCode !== currentAreaCode ? '请到上游节点编辑' : '删除'"
|
|
|
|
- placement="top"
|
|
|
|
- :open-delay="0"
|
|
|
|
- :disabled="scope.row.areaCode === currentAreaCode">
|
|
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-delete"
|
|
|
|
- class="deleteBtn"
|
|
|
|
- :disabled="scope.row.areaCode !== currentAreaCode"
|
|
|
|
- @click="handleAttrDelete(scope.row)"
|
|
|
|
- v-hasPermi="['basecfg:price:remove']">
|
|
|
|
- 删除
|
|
|
|
- </el-button>
|
|
|
|
- </el-tooltip>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
-
|
|
|
|
- <pagination v-show="total > 0 || total === 0" :total="total || 0" :page.sync="queryAttrParams.pageNum" :limit.sync="queryAttrParams.pageSize"
|
|
|
|
- @pagination="refreshCurrentAreaData" />
|
|
|
|
- <!-- 添加或修改服务区用电属性对话框 -->
|
|
|
|
- <el-dialog :title="title" :visible.sync="attrOpen" width="500px" append-to-body>
|
|
|
|
- <el-form ref="attrForm" :model="attrForm" :rules="attrRules" label-width="150px">
|
|
|
|
- <el-form-item label="园区" prop="areaCode">
|
|
|
|
- <el-input v-model="currentAreaName" disabled placeholder="园区名称" />
|
|
|
|
- <input type="hidden" v-model="attrForm.areaCode" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="价格策略" prop="priceCode">
|
|
|
|
- <el-select v-model="attrForm.priceCode">
|
|
|
|
- <el-option v-for="item in gwPriceOptions" :label="`${item.elecTypeName}<${item.voltageLevel}>`" :value="item.cfgCode"
|
|
|
|
- :key="item.cfgCode" />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="容(需)量类型" prop="reqCapacityFlag">
|
|
|
|
- <el-select v-model="attrForm.reqCapacityFlag">
|
|
|
|
- <el-option v-for="item in reqCapacityOptions" :label="item.name" :value="item.code" :key="item.code" />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="变压器容量(kVA/月)" prop="transCapacity" v-if="attrForm.reqCapacityFlag === 1">
|
|
|
|
- <el-input v-model="attrForm.transCapacity" placeholder="请输入变压器容量" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="最大需量(kW·h/月)" prop="reqQuantity" v-if="attrForm.reqCapacityFlag === 2">
|
|
|
|
- <el-input v-model="attrForm.reqQuantity" placeholder="请输入最大需量" />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
- <el-button type="primary" @click="submitAttrForm">确 定</el-button>
|
|
|
|
- <el-button @click="attrCancel">取 消</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
|
|
+ <elec-classify
|
|
|
|
+ :current-area-code="currentAreaCode"
|
|
|
|
+ :current-area-name="currentAreaName"
|
|
|
|
+ @area-selected="handleAreaSelection"
|
|
|
|
+ />
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane label="国网电价" name="second">
|
|
<el-tab-pane label="国网电价" name="second">
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleGwPriceAdd" v-hasPermi="['basecfg:price:add']">新增
|
|
|
|
- </el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <right-toolbar :showSearch.sync="showSearch" :search="false" @queryTable="getGwPriceList"></right-toolbar>
|
|
|
|
- </el-row>
|
|
|
|
- <el-table v-loading="loading" :data="gwPriceList">
|
|
|
|
- <el-table-column label="用电分类" align="center" prop="elecTypeName" />
|
|
|
|
- <el-table-column label="电压等级" align="center" prop="voltageLevel" />
|
|
|
|
- <el-table-column label="峰谷电价" align="center">
|
|
|
|
- <el-table-column label="深谷" align="center" prop="dvPrice" />
|
|
|
|
- <el-table-column label="谷段" align="center" prop="vPrice" />
|
|
|
|
- <el-table-column label="平段" align="center" prop="opPrice" />
|
|
|
|
- <el-table-column label="峰段" align="center" prop="pPrice" />
|
|
|
|
- <el-table-column label="尖峰" align="center" prop="cpPrice" />
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="容(需)量用电价格" align="center">
|
|
|
|
- <el-table-column label="最大需量 (元/千瓦时·月)" align="center" prop="maxReqPrice" width="80px" />
|
|
|
|
- <el-table-column label="变压器容量(元/千伏安·月)" align="center" prop="transCapacityPrice" width="80px" />
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleGwPriceUpdate(scope.row)" v-hasPermi="['basecfg:price:edit']">
|
|
|
|
- 修改</el-button>
|
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" class="deleteBtn" @click="handleGwPriceDelete(scope.row)" v-hasPermi="['basecfg:price:remove']">
|
|
|
|
- 删除</el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
-
|
|
|
|
- <pagination v-show="total>0" :total="total" :page.sync="queryGwPriceParams.pageNum" :limit.sync="queryGwPriceParams.pageSize"
|
|
|
|
- @pagination="getGwPriceList" />
|
|
|
|
-
|
|
|
|
- <!-- 添加或修改电价配置对话框 -->
|
|
|
|
- <el-dialog :title="title" :visible.sync="gwPriceCfgOpen" width="500px" append-to-body>
|
|
|
|
- <el-form ref="gwPriceForm" :model="gwPriceForm" :rules="gwPriceRules" label-width="150px">
|
|
|
|
- <el-form-item label="配置代码" prop="cfgCode">
|
|
|
|
- <el-input v-model="gwPriceForm.cfgCode" maxlength="4" placeholder="请输入配置代码" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="用电分类" prop="elecType">
|
|
|
|
- <el-select v-model="gwPriceForm.elecType">
|
|
|
|
- <el-option v-for="item in priceTypeOptions" :label="item.name" :value="item.code" :key="item.code" />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="电压等级" prop="voltageLevel">
|
|
|
|
- <el-input v-model="gwPriceForm.voltageLevel" placeholder="请输入电压等级" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="深谷价格" prop="dvPrice">
|
|
|
|
- <el-input v-model="gwPriceForm.dvPrice" placeholder="请输入深谷价格" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="谷段价格" prop="vPrice">
|
|
|
|
- <el-input v-model="gwPriceForm.vPrice" placeholder="请输入谷段价格" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="平段价格" prop="opPrice">
|
|
|
|
- <el-input v-model="gwPriceForm.opPrice" placeholder="请输入平段价格" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="峰段价格" prop="pPrice">
|
|
|
|
- <el-input v-model="gwPriceForm.pPrice" placeholder="请输入分时峰段价格" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="尖峰价格" prop="cpPrice">
|
|
|
|
- <el-input v-model="gwPriceForm.cpPrice" placeholder="请输入分时尖时段价格" />
|
|
|
|
- </el-form-item>
|
|
|
|
-
|
|
|
|
- <el-form-item label="最大需量用电价格" prop="maxReqPrice" v-if="gwPriceForm.elecType === 4">
|
|
|
|
- <el-input v-model="gwPriceForm.maxReqPrice" placeholder="请输入最大需量用电价格" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="变压器容量用电价格" prop="transCapacityPrice" v-if="gwPriceForm.elecType === 4">
|
|
|
|
- <el-input v-model="gwPriceForm.transCapacityPrice" placeholder="请输入变压器容量用电价格" />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
- <el-button type="primary" @click="submitGwPriceForm">确 定</el-button>
|
|
|
|
- <el-button @click="gwPriceCancel">取 消</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
|
|
+ <grid-price />
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
- <el-tab-pane label="光伏电价" name="third">
|
|
|
|
- <!-- 光伏电价配置 -->
|
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
|
- <!-- <el-col :span="1.5">
|
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handlePvPriceAdd" v-hasPermi="['basecfg:price:add']">新增
|
|
|
|
- </el-button>
|
|
|
|
- </el-col> -->
|
|
|
|
- <right-toolbar :showSearch.sync="showSearch" :search="false" @queryTable="getPvPriceList"></right-toolbar>
|
|
|
|
- </el-row>
|
|
|
|
- <el-table v-loading="loading" :data="pvPriceList">
|
|
|
|
- <el-table-column label="价格名称" align="center" prop="priceName" />
|
|
|
|
- <el-table-column label="用户电价/脱硫煤电价" align="center" prop="objPrice" />
|
|
|
|
- <el-table-column label="国家补贴" align="center" prop="stateSubsidy" />
|
|
|
|
- <el-table-column label="地方补贴" align="center" prop="localSubsidy" />
|
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handlePvPriceUpdate(scope.row)" v-hasPermi="['basecfg:price:edit']">
|
|
|
|
- 修改</el-button>
|
|
|
|
-
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
-
|
|
|
|
- <!-- 添加或修改电价配置对话框 -->
|
|
|
|
- <el-dialog :title="title" :visible.sync="pvPriceOpen" width="500px" append-to-body>
|
|
|
|
- <el-form ref="pvPriceForm" :model="pvPriceForm" :rules="pvPriceRules" label-width="150px">
|
|
|
|
- <el-form-item label="配置代码" prop="cfgCode">
|
|
|
|
- <el-input v-model="pvPriceForm.cfgCode" placeholder="请输入配置代码" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="价格名称" prop="priceName">
|
|
|
|
- <el-input v-model="pvPriceForm.priceName" placeholder="请输入价格名称" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="用户/脱硫煤电价" prop="objPrice">
|
|
|
|
- <el-input v-model="pvPriceForm.objPrice" placeholder="请输入价格" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="国家补贴" prop="stateSubsidy">
|
|
|
|
- <el-input v-model="pvPriceForm.stateSubsidy" placeholder="请输入国家补贴" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="地方补贴" prop="localSubsidy">
|
|
|
|
- <el-input v-model="pvPriceForm.localSubsidy" placeholder="请输入国家补贴" />
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
|
- </el-form>
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
- <el-button type="primary" @click="submitPvPriceForm">确 定</el-button>
|
|
|
|
- <el-button @click="pvPriceCancel">取 消</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
|
|
+ <el-tab-pane label="光伏电价" name="third">
|
|
|
|
+ <pv-price />
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
- <el-tab-pane label="峰谷策略" name="fourth">
|
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleStrategyAdd" v-hasPermi="['basecfg:price:add']">新增
|
|
|
|
- </el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <right-toolbar :showSearch.sync="showSearch" :search="false" @queryTable="getStrategyList"></right-toolbar>
|
|
|
|
- </el-row>
|
|
|
|
- <el-table v-loading="strategyParams.loading" :data="strategyList">
|
|
|
|
- <el-table-column label="策略编码" align="center" prop="strategyCode" />
|
|
|
|
- <el-table-column label="策略名称" align="center" prop="strategyName" />
|
|
|
|
- <el-table-column label="执行月份" align="center" prop="execMonth" show-overflow-tooltip>
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- {{formatExecMonth(scope.row.execMonth)}}
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="执行日期" align="center" prop="execDateType">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- {{formatDict(scope.row.execDateType,'execDateTypeOptions')}}
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="策略描述" align="center" prop="strategyDesc" show-overflow-tooltip />
|
|
|
|
- <el-table-column label="分时类型" align="center" prop="supportType" show-overflow-tooltip>
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- {{formatSupportType(scope.row.supportType)}}
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="优先级" align="center" prop="priority" />
|
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-button size="mini" type="text" icon="el-icon-info" v-if="scope.row.editFlag==0" @click="handleStrategyDetail(scope.row)" v-hasPermi="['basecfg:price:edit']">
|
|
|
|
- 查看</el-button>
|
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" v-else @click="handleStrategyUpdate(scope.row)" v-hasPermi="['basecfg:price:edit']">
|
|
|
|
- 修改</el-button>
|
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" class="deleteBtn" @click="handleStrategyDelete(scope.row)" v-hasPermi="['basecfg:price:remove']" :disabled="scope.row.editFlag==0">
|
|
|
|
- 删除</el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
-
|
|
|
|
- <!-- 添加或修改峰谷电价策略配置对话框 -->
|
|
|
|
- <el-dialog :title="title" :visible.sync="strategyDialog" width="850px" append-to-body>
|
|
|
|
- <el-form ref="strategyForm" class="strategyForm" :model="strategyForm" :disabled="ifDisabled" label-width="100px">
|
|
|
|
- <el-form-item label="策略编码" prop="strategyCode" required :rules="[{required:true,message:'策略编码不能为空'}]">
|
|
|
|
- <el-input v-model="strategyForm.strategyCode" placeholder="请输入策略编码" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="策略名称" prop="strategyName" required :rules="[{required:true,message:'策略名称不能为空'}]">
|
|
|
|
- <el-input v-model="strategyForm.strategyName" placeholder="请输入策略名称" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="执行日期" prop="execDateType" required :rules="[{required:true,message:'请选择执行日期'}]">
|
|
|
|
- <el-select v-model="strategyForm.execDateType" style="width:100%" placeholder="请选择执行日期" @change="execDateTypeChange">
|
|
|
|
- <el-option v-for="item in execDateTypeOptions" :label="item.name" :value="item.value" :key="item.value" />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="执行说明" required :rules="[{required:true,message:'请选择执行说明'}]" prop="execDate"
|
|
|
|
- v-if="[1,5,6].includes(strategyForm.execDateType)">
|
|
|
|
- <el-time-picker v-if="strategyForm.execDateType==1" v-model="strategyForm.execDate" value-format="HH:mm:ss"
|
|
|
|
- :picker-options="{selectableRange: '00:00:00 - 23:59:59'}" placeholder="选择时间">
|
|
|
|
- </el-time-picker>
|
|
|
|
- <el-checkbox-group v-else-if="strategyForm.execDateType==5" v-model="strategyForm.execDate">
|
|
|
|
- <el-checkbox v-for="day in weeks.filter(item=>item.value<6)" :label="day.value" :key="day.value">
|
|
|
|
- {{day.name}}</el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- <el-checkbox-group v-else-if="strategyForm.execDateType==6" v-model="strategyForm.execDate">
|
|
|
|
- <el-checkbox v-for="day in weeks" :label="day.value" :key="day.value">{{day.name}}</el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="策略描述" prop="strategyDesc">
|
|
|
|
- <el-input v-model="strategyForm.strategyDesc" placeholder="请输入策略描述" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="执行月份" prop="execMonth" required :rules="[{required:true,message:'请选择执行月份'}]">
|
|
|
|
- <el-checkbox-group v-model="strategyForm.execMonth">
|
|
|
|
- <el-tooltip
|
|
|
|
- v-for="month in availableMonths"
|
|
|
|
- :key="month.value"
|
|
|
|
- :content="month.disabled ? '已占用' : ''"
|
|
|
|
- :disabled="!month.disabled"
|
|
|
|
- placement="top"
|
|
|
|
- effect="dark">
|
|
|
|
- <el-checkbox
|
|
|
|
- :label="month.value"
|
|
|
|
- :disabled="month.disabled">
|
|
|
|
- <span :style="{color: month.disabled ? '#c0c4cc' : ''}">
|
|
|
|
- {{month.label}}
|
|
|
|
- </span>
|
|
|
|
- </el-checkbox>
|
|
|
|
- </el-tooltip>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- <div v-if="monthConflictTip" style="color: #f56c6c; font-size: 12px; margin-top: 5px;">
|
|
|
|
- {{ monthConflictTip }}
|
|
|
|
- </div>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="分时类型" prop="supportType" required :rules="[{required:true,message:'请选择分时类型'}]">
|
|
|
|
- <el-checkbox-group v-model="strategyForm.supportType" @change="handleSupportTypeChange">
|
|
|
|
- <el-checkbox v-for="type in timeTypeOptions"
|
|
|
|
- :label="type.value"
|
|
|
|
- :key="type.value"
|
|
|
|
- :disabled="type.value === 0">
|
|
|
|
- {{type.label}}
|
|
|
|
- </el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="优先级" prop="priority" required>
|
|
|
|
- <el-input-number v-model="strategyForm.priority"
|
|
|
|
- :min="0"
|
|
|
|
- :max="100"
|
|
|
|
- @change="handlePriorityChange"
|
|
|
|
- label="描述文字"></el-input-number>
|
|
|
|
- <span style="margin-left: 10px; color: #909399; font-size: 12px;">
|
|
|
|
- 相同优先级的策略月份不能重叠
|
|
|
|
- </span>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="小时电价">
|
|
|
|
- <el-table class="sub-table" :data="strategyForm.hourList" max-height="200px">
|
|
|
|
- <el-table-column label="开始时刻" align="center" prop="startTime">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-time-picker v-model="scope.row.startTime" size="mini" value-format="HH:mm:ss"
|
|
|
|
- :picker-options="{selectableRange: '00:00:00 - 23:59:59'}" placeholder="选择时间">
|
|
|
|
- </el-time-picker>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="结束时刻" align="center" prop="endTime">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-time-picker v-model="scope.row.endTime" size="mini" value-format="HH:mm:ss"
|
|
|
|
- :picker-options="{selectableRange: '00:00:00 - 23:59:59'}" placeholder="选择时间">
|
|
|
|
- </el-time-picker>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="分时类型" align="center" prop="type">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-select v-model="scope.row.type" size="mini" style="width:100%" placeholder="请选择">
|
|
|
|
- <el-option v-for="type in filteredTimeTypes"
|
|
|
|
- :label="type.label"
|
|
|
|
- :value="type.value"
|
|
|
|
- :key="type.value" />
|
|
|
|
- </el-select>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" width="100" v-if="!ifDisabled">
|
|
|
|
- <template slot="header">
|
|
|
|
- <div class="operateBtns" @click="addSub">
|
|
|
|
- <span>操作</span><i class="el-icon-circle-plus-outline"></i>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <i class="el-icon-delete" @click="deleteSub(scope.$index)"></i>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
|
- </el-form>
|
|
|
|
- <div slot="footer" class="dialog-footer" v-if="!ifDisabled">
|
|
|
|
- <el-button type="primary" @click="submitStrategyForm">确 定</el-button>
|
|
|
|
- <el-button @click="strategyCancel">取 消</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
|
|
+ <el-tab-pane label="峰谷策略" name="fourth">
|
|
|
|
+ <peak-valley-strategy />
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
- <el-tab-pane label="非电价格" name="five">
|
|
|
|
- <el-form :model="fdPriceQueryParams" ref="fdPriceQueryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
- <el-form-item label="计量介质" prop="meterCls">
|
|
|
|
- <el-select
|
|
|
|
- v-model="fdPriceQueryParams.meterCls"
|
|
|
|
- placeholder="请选择计量介质"
|
|
|
|
- clearable
|
|
|
|
- @change="handleFdPriceQuery"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in meterClsOptions"
|
|
|
|
- :key="item.value"
|
|
|
|
- :label="item.label"
|
|
|
|
- :value="item.value"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleFdPriceQuery">搜索</el-button>
|
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetFdPriceQuery">重置</el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
-
|
|
|
|
- <el-table v-loading="fdPriceLoading" :data="fdPriceList" @selection-change="handleFdPriceSelectionChange">
|
|
|
|
- <el-table-column label="区域" align="center">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- {{ scope.row.areaName || '默认' }}
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="计量介质" align="center" prop="meterClsName" />
|
|
|
|
- <el-table-column label="单位价格" align="center" prop="unitPrice" />
|
|
|
|
- <el-table-column label="计量单位" align="center" prop="meterUnit" />
|
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-edit"
|
|
|
|
- @click="handleFdPriceUpdate(scope.row)"
|
|
|
|
- v-hasPermi="['ems:FdEnergyPriceConfig:edit']"
|
|
|
|
- >修改</el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
|
|
|
|
- <pagination
|
|
|
|
- v-show="fdPriceTotal>0"
|
|
|
|
- :total="fdPriceTotal"
|
|
|
|
- :page.sync="fdPriceQueryParams.pageNum"
|
|
|
|
- :limit.sync="fdPriceQueryParams.pageSize"
|
|
|
|
- @pagination="getFdPriceList"
|
|
|
|
- />
|
|
|
|
-
|
|
|
|
- <!-- 添加或修改非电能源价格配置对话框 -->
|
|
|
|
- <el-dialog :title="fdPriceTitle" :visible.sync="fdPriceOpen" width="500px" append-to-body>
|
|
|
|
- <el-form ref="fdPriceForm" :model="fdPriceForm" :rules="fdPriceRules" label-width="80px">
|
|
|
|
- <el-form-item label="配置代码" prop="cfgCode">
|
|
|
|
- <el-input v-model="fdPriceForm.cfgCode" placeholder="请输入配置代码" disabled />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="区域" prop="areaName">
|
|
|
|
- <el-input v-model="fdPriceForm.areaName" placeholder="园区名称" disabled />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="计量介质" prop="meterClsName">
|
|
|
|
- <el-input v-model="fdPriceForm.meterClsName" placeholder="计量介质" disabled />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="单位价格" prop="unitPrice">
|
|
|
|
- <el-input v-model="fdPriceForm.unitPrice" placeholder="请输入单位价格" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="计量单位" prop="meterUnit">
|
|
|
|
- <el-input v-model="fdPriceForm.meterUnit" placeholder="请输入计量单位" />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
- <el-button type="primary" @click="submitFdPriceForm">确 定</el-button>
|
|
|
|
- <el-button @click="fdPriceCancel">取 消</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
|
|
+ <el-tab-pane label="非电价格" name="five">
|
|
|
|
+ <non-elec-price />
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
- <el-tab-pane label="商户计价" name="six">
|
|
|
|
- <!-- 商户计费配置 -->
|
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
|
- <!-- <el-col :span="1.5">
|
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleChargingAdd" v-hasPermi="['basecfg:price:add']">新增
|
|
|
|
- </el-button>
|
|
|
|
- </el-col> -->
|
|
|
|
- <right-toolbar :showSearch.sync="showSearch" :search="false" @queryTable="getChargingList"></right-toolbar>
|
|
|
|
- </el-row>
|
|
|
|
- <el-table v-loading="chargingParams.loading" :data="chargingList">
|
|
|
|
- <el-table-column label="区域" align="center" prop="areaName" />
|
|
|
|
- <el-table-column label="电计量单价" align="center" prop="elecUnitPrice" />
|
|
|
|
- <el-table-column label="电公摊计算类型" align="center">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- {{formatDict(scope.row.elecGtComputeType,'computeTypeOptions')}}
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="电费计算说明" align="center" prop="elecComputeDesc" show-overflow-tooltip />
|
|
|
|
- <el-table-column label="水计量单价" align="center" prop="waterUnitPrice" />
|
|
|
|
- <el-table-column label="水公摊计量类型" align="center">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- {{formatDict(scope.row.waterGtComputeType,'computeTypeOptions')}}
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="水费说明" align="center" prop="waterComputeDesc" show-overflow-tooltip />
|
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleChargingUpdate(scope.row)" v-hasPermi="['basecfg:price:edit']">
|
|
|
|
- 修改</el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
-
|
|
|
|
- <!-- 添加或修改对话框 -->
|
|
|
|
- <el-dialog :title="title" :visible.sync="chargingDialog" custom-class="custom-dialog" width="650px" append-to-body>
|
|
|
|
- <el-form ref="chargingForm" :model="chargingForm" label-width="120px">
|
|
|
|
- <el-form-item label="服务区名称" prop="areaCode" required :rules="[{required:true,message:'请选择服务区名称'}]">
|
|
|
|
- <el-select v-model="chargingForm.areaCode" disabled style="width:100%">
|
|
|
|
- <el-option v-for="item in areaOptions" :label="item.label" :value="item.id" :key="item.id" />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="电计量单价" prop="elecUnitPrice" required :rules="[{required:true,message:'电计量单价不能为空'}]">
|
|
|
|
- <el-input v-model="chargingForm.elecUnitPrice" oninput="value=value.replace(/[^\d.]/g,'')" placeholder="请输入电计量单价" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="电公摊计算类型" prop="elecGtComputeType" required :rules="[{required:true,message:'请选择电公摊计算类型'}]">
|
|
|
|
- <el-select v-model="chargingForm.elecGtComputeType" style="width:100%">
|
|
|
|
- <el-option v-for="item in computeTypeOptions" :label="item.name" :value="item.value" :key="item.value" />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="电费计算说明" prop="elecComputeDesc">
|
|
|
|
- <el-input v-model="chargingForm.elecComputeDesc" placeholder="请输入电费计算说明" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="水计量单价" prop="waterUnitPrice" required :rules="[{required:true,message:'水计量单价不能为空'}]">
|
|
|
|
- <el-input v-model="chargingForm.waterUnitPrice" oninput="value=value.replace(/[^\d.]/g,'')" placeholder="请输入水计量单价" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="水公摊计算类型" prop="waterGtComputeType" required :rules="[{required:true,message:'请选择水公摊计算类型'}]">
|
|
|
|
- <el-select v-model="chargingForm.waterGtComputeType" style="width:100%">
|
|
|
|
- <el-option v-for="item in computeTypeOptions" :label="item.name" :value="item.value" :key="item.value" />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="水费说明" prop="waterComputeDesc">
|
|
|
|
- <el-input v-model="chargingForm.waterComputeDesc" placeholder="请输入水费说明" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="关联商户" prop="waterComputeDesc">
|
|
|
|
- <el-checkbox-group v-model="chargingForm.relCoList" class="custom-checkbox-group">
|
|
|
|
- <el-checkbox v-for="item in zoningList" :key="item.areaCode" :label="item.areaCode">{{item.areaName}}</el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
|
- </el-form>
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
- <el-button type="primary" @click="submitChargingForm">确 定</el-button>
|
|
|
|
- <el-button @click="chargingCancel">取 消</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
|
|
+ <el-tab-pane label="商户计价" name="six">
|
|
|
|
+ <merchant-charging />
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
</el-tabs>
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import {
|
|
|
|
- listAttr,
|
|
|
|
- getAttr,
|
|
|
|
- delAttr,
|
|
|
|
- addAttr,
|
|
|
|
- updateAttr,
|
|
|
|
- listStrategy,
|
|
|
|
- addStrategy,
|
|
|
|
- updateStrategy,
|
|
|
|
- delStrategy,
|
|
|
|
- listCharging,
|
|
|
|
- updateCharging,
|
|
|
|
- addCharging,
|
|
|
|
- delCharging,
|
|
|
|
- getEffectiveByArea,
|
|
|
|
- getEffectiveListByArea
|
|
|
|
-} from '@/api/basecfg/elecAttr'
|
|
|
|
-import {
|
|
|
|
- listGwPriceConfig,
|
|
|
|
- listGwPriceConfigAll,
|
|
|
|
- getGwPriceConfig,
|
|
|
|
- addGwPriceConfig,
|
|
|
|
- delGwPriceConfig,
|
|
|
|
- updateGwPriceConfig
|
|
|
|
-} from '@/api/basecfg/elecGwPrice'
|
|
|
|
-import { addPvPriceConfig, delPvPriceConfig, getPvPriceConfig, listPvPriceConfig, updatePvPriceConfig } from '@/api/basecfg/elecPvPrice'
|
|
|
|
-import { listFdEnergyPriceConfig, getFdEnergyPriceConfig, delFdEnergyPriceConfig, addFdEnergyPriceConfig, updateFdEnergyPriceConfig } from '@/api/basecfg/FdEnergyPriceConfig'
|
|
|
|
-import { getElecPriceType } from '@/api/commonApi'
|
|
|
|
-import { areaListByTag, areaTreeSelect } from '@/api/basecfg/area'
|
|
|
|
|
|
+// 引入各个子组件
|
|
|
|
+import ElecClassify from './components/ElecClassify'
|
|
|
|
+import GridPrice from './components/GridPrice'
|
|
|
|
+import PvPrice from './components/PvPrice'
|
|
|
|
+import PeakValleyStrategy from './components/PeakValleyStrategy'
|
|
|
|
+import NonElecPrice from './components/NonElecPrice'
|
|
|
|
+import MerchantCharging from './components/MerchantCharging'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- name: 'Attr',
|
|
|
|
|
|
+ name: 'PriceConfig',
|
|
|
|
+ components: {
|
|
|
|
+ ElecClassify,
|
|
|
|
+ GridPrice,
|
|
|
|
+ PvPrice,
|
|
|
|
+ PeakValleyStrategy,
|
|
|
|
+ NonElecPrice,
|
|
|
|
+ MerchantCharging
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
activeTab: 'first',
|
|
activeTab: 'first',
|
|
- // 遮罩层
|
|
|
|
- loading: true,
|
|
|
|
- // 选中数组
|
|
|
|
- ids: [],
|
|
|
|
- // 非单个禁用
|
|
|
|
- single: true,
|
|
|
|
- // 非多个禁用
|
|
|
|
- multiple: true,
|
|
|
|
- // 显示搜索条件
|
|
|
|
- showSearch: true,
|
|
|
|
- // 总条数
|
|
|
|
- total: 0,
|
|
|
|
- // 服务区用电属性表格数据
|
|
|
|
- attrList: [],
|
|
|
|
- // 电价表格
|
|
|
|
- gwPriceList: [],
|
|
|
|
- // 光伏电价
|
|
|
|
- pvPriceList: [],
|
|
|
|
- // 峰谷电价
|
|
|
|
- strategyList: [],
|
|
|
|
- // 商户计费
|
|
|
|
- chargingList: [],
|
|
|
|
- // 非电价格
|
|
|
|
- fdPriceList: [],
|
|
|
|
- // 弹出层标题
|
|
|
|
- title: '',
|
|
|
|
- fdPriceTitle: '',
|
|
|
|
-
|
|
|
|
- // 区域名称
|
|
|
|
- areaName: undefined,
|
|
|
|
- // 区域树选项
|
|
|
|
- treeAreaOptions: undefined,
|
|
|
|
- defaultProps: {
|
|
|
|
- children: 'children',
|
|
|
|
- label: 'label'
|
|
|
|
- },
|
|
|
|
- // 当前选中的区域代码
|
|
|
|
|
|
+ // 共享的数据
|
|
currentAreaCode: null,
|
|
currentAreaCode: null,
|
|
- // 当前选中的区域名称
|
|
|
|
- currentAreaName: '',
|
|
|
|
- // 是否显示弹出层
|
|
|
|
- attrOpen: false,
|
|
|
|
- gwPriceCfgOpen: false,
|
|
|
|
- pvPriceOpen: false,
|
|
|
|
- strategyDialog: false,
|
|
|
|
- chargingDialog: false,
|
|
|
|
- fdPriceOpen: false,
|
|
|
|
- // 选项定义
|
|
|
|
- priceTypeOptions: undefined,
|
|
|
|
- areaOptions: undefined,
|
|
|
|
- gwPriceOptions: undefined,
|
|
|
|
- // 计量介质选项
|
|
|
|
- meterClsOptions: [
|
|
|
|
- { value: 70, label: '自来水' }
|
|
|
|
- ],
|
|
|
|
- // 查询参数
|
|
|
|
- queryGwPriceParams: {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 10
|
|
|
|
- },
|
|
|
|
- queryAttrParams: {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 10
|
|
|
|
- },
|
|
|
|
- queryPvPriceParams: {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 10
|
|
|
|
- },
|
|
|
|
- strategyParams: {
|
|
|
|
- loading: false,
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 10
|
|
|
|
- },
|
|
|
|
- chargingParams: {
|
|
|
|
- loading: false,
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 10
|
|
|
|
- },
|
|
|
|
- // 非电价格查询参数
|
|
|
|
- fdPriceQueryParams: {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- cfgCode: null,
|
|
|
|
- areaCode: null,
|
|
|
|
- meterCls: null
|
|
|
|
- },
|
|
|
|
- // 非电价格表单数据
|
|
|
|
- fdPriceForm: {},
|
|
|
|
- // 非电价格表单验证规则
|
|
|
|
- fdPriceRules: {
|
|
|
|
- cfgCode: [
|
|
|
|
- { required: true, message: '配置代码不能为空', trigger: 'blur' }
|
|
|
|
- ],
|
|
|
|
- meterCls: [
|
|
|
|
- { required: true, message: '计量介质不能为空', trigger: 'blur' }
|
|
|
|
- ],
|
|
|
|
- unitPrice: [
|
|
|
|
- { required: true, message: '单位价格不能为空', trigger: 'blur' }
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- // 非电价格加载状态
|
|
|
|
- fdPriceLoading: true,
|
|
|
|
- // 非电价格总条数
|
|
|
|
- fdPriceTotal: 0,
|
|
|
|
- // 非电价格选中数组
|
|
|
|
- fdPriceIds: [],
|
|
|
|
- // 非电价格非单个禁用
|
|
|
|
- fdPriceSingle: true,
|
|
|
|
- // 非电价格非多个禁用
|
|
|
|
- fdPriceMultiple: true,
|
|
|
|
- // 表单参数
|
|
|
|
- attrForm: {},
|
|
|
|
- gwPriceForm: {},
|
|
|
|
- pvPriceForm: {},
|
|
|
|
- // 表单校验
|
|
|
|
- gwPriceRules: {
|
|
|
|
- cfgCode: [{ required: true, message: '配置代码不为空', trigger: 'blur' }],
|
|
|
|
- elecType: [{ required: true, message: '请选择用电分类', trigger: 'change' }],
|
|
|
|
- voltageLevel: [{ required: true, message: '电压等级不为空', trigger: 'blur' }],
|
|
|
|
- degreePrice: [{ required: true, message: '单位电价不为控', trigger: 'blur' }]
|
|
|
|
- },
|
|
|
|
- // 表单校验
|
|
|
|
- attrRules: {
|
|
|
|
- areaCode: [{ required: true, message: '园区代码不能为空', trigger: 'blur' }],
|
|
|
|
- elecType: [{ required: true, message: '请选择用电分类', trigger: 'change' }],
|
|
|
|
- priceCode: [{ required: true, message: '价格编码不能为空', trigger: 'blur' }]
|
|
|
|
- },
|
|
|
|
- // 表单校验
|
|
|
|
- pvPriceRules: {
|
|
|
|
- cfgCode: [{ required: true, message: '配置代码不为空', trigger: 'blur' }],
|
|
|
|
- priceName: [{ required: true, message: '价格名称不为空', trigger: 'blur' }]
|
|
|
|
- },
|
|
|
|
- reqCapacityOptions: [
|
|
|
|
- { code: 0, name: '不涉及' },
|
|
|
|
- { code: 1, name: '容量电价' },
|
|
|
|
- { code: 2, name: '需量电价' }
|
|
|
|
- ],
|
|
|
|
- // 执行日期选项(原repeatTypeOptions)
|
|
|
|
- execDateTypeOptions: [
|
|
|
|
- // { name: '执行1次', value: 1 },
|
|
|
|
- { name: '每天', value: 2 },
|
|
|
|
- // { name: '法定工作日(跳过节假日)', value: 3 },
|
|
|
|
- // { name: '法定节假日(跳过工作日)', value: 4 },
|
|
|
|
- { name: '周一至周五', value: 5 },
|
|
|
|
- { name: '自定义', value: 6 }
|
|
|
|
- ],
|
|
|
|
- weeks: [
|
|
|
|
- { name: '周一', value: '1' },
|
|
|
|
- { name: '周二', value: '2' },
|
|
|
|
- { name: '周三', value: '3' },
|
|
|
|
- { name: '周四', value: '4' },
|
|
|
|
- { name: '周五', value: '5' },
|
|
|
|
- { name: '周六', value: '6' },
|
|
|
|
- { name: '周日', value: '7' }
|
|
|
|
- ],
|
|
|
|
- // 新增月份选项
|
|
|
|
- monthOptions: [
|
|
|
|
- { value: '01', label: '一月' },
|
|
|
|
- { value: '02', label: '二月' },
|
|
|
|
- { value: '03', label: '三月' },
|
|
|
|
- { value: '04', label: '四月' },
|
|
|
|
- { value: '05', label: '五月' },
|
|
|
|
- { value: '06', label: '六月' },
|
|
|
|
- { value: '07', label: '七月' },
|
|
|
|
- { value: '08', label: '八月' },
|
|
|
|
- { value: '09', label: '九月' },
|
|
|
|
- { value: '10', label: '十月' },
|
|
|
|
- { value: '11', label: '十一月' },
|
|
|
|
- { value: '12', label: '十二月' }
|
|
|
|
- ],
|
|
|
|
- // 新增分时类型选项
|
|
|
|
- timeTypeOptions: [
|
|
|
|
- { value: -2, label: '低谷' },
|
|
|
|
- { value: -1, label: '谷段' },
|
|
|
|
- { value: 0, label: '平段' }, // 默认选中且不可取消
|
|
|
|
- { value: 1, label: '峰段' },
|
|
|
|
- { value: 2, label: '尖峰' }
|
|
|
|
- ],
|
|
|
|
- strategyForm: {
|
|
|
|
- strategyCode: '',
|
|
|
|
- strategyName: '',
|
|
|
|
- strategyDesc: '',
|
|
|
|
- execDateType: '', // 原repeatType
|
|
|
|
- execDate: [], // 原repeatParam
|
|
|
|
- execMonth: [], // 新增执行月份
|
|
|
|
- supportType: [0], // 新增分时类型,默认包含平段
|
|
|
|
- priority: 0,
|
|
|
|
- hourList: []
|
|
|
|
- },
|
|
|
|
- computeTypeOptions: [
|
|
|
|
- { name: '不计入', value: 0 },
|
|
|
|
- { name: '户数均摊', value: 1 },
|
|
|
|
- { name: '面积均摊', value: 2 }
|
|
|
|
- ],
|
|
|
|
- chargingForm: {
|
|
|
|
- areaCode: '',
|
|
|
|
- elecUnitPrice: '',
|
|
|
|
- elecGtComputeType: '',
|
|
|
|
- elecComputeDesc: '',
|
|
|
|
- waterUnitPrice: '',
|
|
|
|
- waterGtComputeType: '',
|
|
|
|
- waterComputeDesc: '',
|
|
|
|
- relCoList: []
|
|
|
|
- },
|
|
|
|
- zoningList: [],
|
|
|
|
- ifDisabled: false
|
|
|
|
|
|
+ currentAreaName: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- computed: {
|
|
|
|
- // 根据选中的分时类型过滤小时电价表格中的选项
|
|
|
|
- filteredTimeTypes() {
|
|
|
|
- return this.timeTypeOptions.filter(type =>
|
|
|
|
- this.strategyForm.supportType.includes(type.value)
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- // 获取可用月份(动态禁用已被占用的月份)
|
|
|
|
- availableMonths() {
|
|
|
|
- const currentPriority = this.strategyForm.priority
|
|
|
|
- const samePriorityStrategies = this.strategyList.filter(strategy => {
|
|
|
|
- return strategy.priority === currentPriority &&
|
|
|
|
- strategy.id !== this.strategyForm.id &&
|
|
|
|
- strategy.editFlag !== 0
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- const occupiedMonths = new Set()
|
|
|
|
- samePriorityStrategies.forEach(strategy => {
|
|
|
|
- if (strategy.execMonth) {
|
|
|
|
- strategy.execMonth.split(',').forEach(month => {
|
|
|
|
- occupiedMonths.add(month)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- return this.monthOptions.map(month => ({
|
|
|
|
- ...month,
|
|
|
|
- disabled: occupiedMonths.has(month.value)
|
|
|
|
- }))
|
|
|
|
- },
|
|
|
|
- // 月份冲突提示
|
|
|
|
- monthConflictTip() {
|
|
|
|
- const currentPriority = this.strategyForm.priority
|
|
|
|
- const samePriorityStrategies = this.strategyList.filter(strategy => {
|
|
|
|
- return strategy.priority === currentPriority &&
|
|
|
|
- strategy.id !== this.strategyForm.id &&
|
|
|
|
- strategy.editFlag !== 0
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- if (samePriorityStrategies.length > 0) {
|
|
|
|
- const strategies = samePriorityStrategies.map(s => s.strategyName).join('、')
|
|
|
|
- return `提示:优先级${currentPriority}下已存在策略:${strategies}`
|
|
|
|
- }
|
|
|
|
- return ''
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- created() {
|
|
|
|
- this.getAreaList('0', 1)
|
|
|
|
- this.getAreaTree('0', 2)
|
|
|
|
- this.getAttrList()
|
|
|
|
- this.getGwPriceList()
|
|
|
|
- this.getPvPriceList()
|
|
|
|
- this.getPriceType()
|
|
|
|
- this.getStrategyList()
|
|
|
|
- this.getChargingList()
|
|
|
|
- this.getRelateShopList('0')
|
|
|
|
- this.getFdPriceList()
|
|
|
|
- },
|
|
|
|
methods: {
|
|
methods: {
|
|
- /** 查询区域树结构 */
|
|
|
|
- getAreaTree(areaCode, layer) {
|
|
|
|
- areaTreeSelect(areaCode, layer).then(response => {
|
|
|
|
- this.treeAreaOptions = response.data
|
|
|
|
- // 自动选中并触发点击第一个节点
|
|
|
|
- if (response.data && response.data.length > 0) {
|
|
|
|
- const firstNode = response.data[0];
|
|
|
|
- this.$refs.tree.setCurrentKey(firstNode.id); // 设置当前选中节点
|
|
|
|
- this.handleNodeClick(firstNode); // 触发点击事件
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- // 筛选节点
|
|
|
|
- filterNode(value, data) {
|
|
|
|
- if (!value) return true
|
|
|
|
- return data.label.indexOf(value) !== -1
|
|
|
|
- },
|
|
|
|
- // 节点单击事件
|
|
|
|
- handleNodeClick(data) {
|
|
|
|
- this.currentAreaCode = data.id; // 更新当前选中的区域代码
|
|
|
|
- this.currentAreaName = data.label; // 更新当前选中的区域名称
|
|
|
|
- this.attrForm.areaCode = data.id; // 确保 attrForm.areaCode 被赋值
|
|
|
|
- console.log("data",data)
|
|
|
|
- this.refreshCurrentAreaData();
|
|
|
|
- },
|
|
|
|
- refreshCurrentAreaData() {
|
|
|
|
- if (this.currentAreaCode) {
|
|
|
|
- this.loading = true;
|
|
|
|
- getEffectiveListByArea(this.currentAreaCode).then(res => {
|
|
|
|
- this.attrList = res.data;
|
|
|
|
- this.loading = false;
|
|
|
|
- }).catch(error => {
|
|
|
|
- console.error("Error fetching data:", error);
|
|
|
|
- this.loading = false;
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- formatDict(value, options, key = 'value', name = 'name') {
|
|
|
|
- let text = ''
|
|
|
|
- this[options].forEach(item => {
|
|
|
|
- if (value === item[key]) {
|
|
|
|
- text = item[name]
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- return text
|
|
|
|
- },
|
|
|
|
- // 新增分时类型格式化方法
|
|
|
|
- formatSupportType(supportType) {
|
|
|
|
- if (!supportType) return '';
|
|
|
|
- const types = supportType.split(',').map(v => parseInt(v));
|
|
|
|
- const labels = types.map(type => {
|
|
|
|
- const found = this.timeTypeOptions.find(opt => opt.value === type);
|
|
|
|
- return found ? found.label : '';
|
|
|
|
- }).filter(label => label);
|
|
|
|
- return labels.join('、');
|
|
|
|
- },
|
|
|
|
- // 新增执行月份格式化方法
|
|
|
|
- formatExecMonth(execMonth) {
|
|
|
|
- if (!execMonth) return '';
|
|
|
|
- const months = execMonth.split(',');
|
|
|
|
- const labels = months.map(month => {
|
|
|
|
- const found = this.monthOptions.find(opt => opt.value === month);
|
|
|
|
- return found ? found.label : '';
|
|
|
|
- }).filter(label => label);
|
|
|
|
- return labels.join('、');
|
|
|
|
- },
|
|
|
|
- // 处理分时类型变化
|
|
|
|
- handleSupportTypeChange(values) {
|
|
|
|
- // 确保平段始终被选中
|
|
|
|
- if (!values.includes(0)) {
|
|
|
|
- values.push(0);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 处理优先级变化
|
|
|
|
- handlePriorityChange(value) {
|
|
|
|
- // 当优先级改变时,清空月份选择中的冲突月份
|
|
|
|
- const availableMonthValues = this.availableMonths
|
|
|
|
- .filter(m => !m.disabled)
|
|
|
|
- .map(m => m.value)
|
|
|
|
-
|
|
|
|
- // 过滤掉不可用的月份
|
|
|
|
- this.strategyForm.execMonth = this.strategyForm.execMonth.filter(month =>
|
|
|
|
- availableMonthValues.includes(month)
|
|
|
|
- )
|
|
|
|
- },
|
|
|
|
- /** 查询非电能源价格配置列表 */
|
|
|
|
- getFdPriceList() {
|
|
|
|
- this.fdPriceLoading = true;
|
|
|
|
- listFdEnergyPriceConfig(this.fdPriceQueryParams).then(response => {
|
|
|
|
- this.fdPriceList = response.rows;
|
|
|
|
- this.fdPriceTotal = response.total;
|
|
|
|
- this.fdPriceLoading = false;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- // 非电价格取消按钮
|
|
|
|
- fdPriceCancel() {
|
|
|
|
- this.fdPriceOpen = false;
|
|
|
|
- this.fdPriceReset();
|
|
|
|
- },
|
|
|
|
- // 非电价格表单重置
|
|
|
|
- fdPriceReset() {
|
|
|
|
- this.fdPriceForm = {
|
|
|
|
- id: null,
|
|
|
|
- cfgCode: null,
|
|
|
|
- areaCode: null,
|
|
|
|
- meterCls: null,
|
|
|
|
- unitPrice: null,
|
|
|
|
- meterUnit: null
|
|
|
|
- };
|
|
|
|
- this.resetForm("fdPriceForm");
|
|
|
|
- },
|
|
|
|
- /** 非电价格搜索按钮操作 */
|
|
|
|
- handleFdPriceQuery() {
|
|
|
|
- this.fdPriceQueryParams.pageNum = 1;
|
|
|
|
- this.getFdPriceList();
|
|
|
|
- },
|
|
|
|
- /** 非电价格重置按钮操作 */
|
|
|
|
- resetFdPriceQuery() {
|
|
|
|
- this.resetForm("fdPriceQueryForm");
|
|
|
|
- this.handleFdPriceQuery();
|
|
|
|
- },
|
|
|
|
- // 非电价格多选框选中数据
|
|
|
|
- handleFdPriceSelectionChange(selection) {
|
|
|
|
- this.fdPriceIds = selection.map(item => item.id)
|
|
|
|
- this.fdPriceSingle = selection.length !== 1
|
|
|
|
- this.fdPriceMultiple = !selection.length
|
|
|
|
- },
|
|
|
|
- /** 非电价格新增按钮操作 */
|
|
|
|
- handleFdPriceAdd() {
|
|
|
|
- this.fdPriceReset();
|
|
|
|
- this.fdPriceOpen = true;
|
|
|
|
- this.fdPriceTitle = "添加非电能源价格配置";
|
|
|
|
- },
|
|
|
|
- /** 非电价格修改按钮操作 */
|
|
|
|
- handleFdPriceUpdate(row) {
|
|
|
|
- this.fdPriceReset();
|
|
|
|
- const id = row.id || this.fdPriceIds
|
|
|
|
- getFdEnergyPriceConfig(id).then(response => {
|
|
|
|
- this.fdPriceForm = response.data;
|
|
|
|
- // 设置园区名称和计量介质名称
|
|
|
|
- this.fdPriceForm.areaName = response.data.areaName || '默认';
|
|
|
|
- // 从meterClsOptions中查找计量介质名称
|
|
|
|
- const meterClsOption = this.meterClsOptions.find(item => item.value === response.data.meterCls);
|
|
|
|
- this.fdPriceForm.meterClsName = meterClsOption ? meterClsOption.label : '';
|
|
|
|
- this.fdPriceOpen = true;
|
|
|
|
- this.fdPriceTitle = "修改非电能源价格配置";
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- /** 非电价格提交按钮 */
|
|
|
|
- submitFdPriceForm() {
|
|
|
|
- this.$refs["fdPriceForm"].validate(valid => {
|
|
|
|
- if (valid) {
|
|
|
|
- if (this.fdPriceForm.id != null) {
|
|
|
|
- updateFdEnergyPriceConfig(this.fdPriceForm).then(response => {
|
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
|
- this.fdPriceOpen = false;
|
|
|
|
- this.getFdPriceList();
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- addFdEnergyPriceConfig(this.fdPriceForm).then(response => {
|
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
|
- this.fdPriceOpen = false;
|
|
|
|
- this.getFdPriceList();
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- /** 非电价格删除按钮操作 */
|
|
|
|
- handleFdPriceDelete(row) {
|
|
|
|
- const ids = row.id || this.fdPriceIds;
|
|
|
|
- this.$modal.confirm('是否确认删除非电能源价格配置编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
- return delFdEnergyPriceConfig(ids);
|
|
|
|
- }).then(() => {
|
|
|
|
- this.getFdPriceList();
|
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
|
- }).catch(() => {});
|
|
|
|
- },
|
|
|
|
- /** 非电价格导出按钮操作 */
|
|
|
|
- handleFdPriceExport() {
|
|
|
|
- this.download('ems/FdEnergyPriceConfig/export', {
|
|
|
|
- ...this.fdPriceQueryParams
|
|
|
|
- }, `FdEnergyPriceConfig_${new Date().getTime()}.xlsx`)
|
|
|
|
- },
|
|
|
|
- getGwPriceList() {
|
|
|
|
- this.loading = true
|
|
|
|
- listGwPriceConfig(this.queryGwPriceParams).then(response => {
|
|
|
|
- this.gwPriceList = response.rows
|
|
|
|
- this.total = response.total
|
|
|
|
- this.loading = false
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 取消按钮
|
|
|
|
- gwPriceCancel() {
|
|
|
|
- this.gwPriceCfgOpen = false
|
|
|
|
- this.gwPriceReset()
|
|
|
|
- },
|
|
|
|
- // 表单重置
|
|
|
|
- gwPriceReset() {
|
|
|
|
- this.gwPriceForm = {
|
|
|
|
- id: null,
|
|
|
|
- cfgCode: null,
|
|
|
|
- elecType: null,
|
|
|
|
- voltageLevel: null,
|
|
|
|
- dvPrice: null,
|
|
|
|
- vPrice: null,
|
|
|
|
- opPrice: null,
|
|
|
|
- pPrice: null,
|
|
|
|
- cpPrice: null,
|
|
|
|
- maxReqPrice: null,
|
|
|
|
- transCapacityPrice: null
|
|
|
|
- }
|
|
|
|
- this.resetForm('gwPriceForm')
|
|
|
|
- },
|
|
|
|
- /** 新增按钮操作 */
|
|
|
|
- handleGwPriceAdd() {
|
|
|
|
- this.gwPriceReset()
|
|
|
|
- this.gwPriceCfgOpen = true
|
|
|
|
- this.title = '添加电价配置'
|
|
|
|
- },
|
|
|
|
- /** 修改按钮操作 */
|
|
|
|
- handleGwPriceUpdate(row) {
|
|
|
|
- this.gwPriceReset()
|
|
|
|
- const id = row.id || this.ids
|
|
|
|
- getGwPriceConfig(id).then(response => {
|
|
|
|
- this.gwPriceForm = response.data
|
|
|
|
- this.gwPriceCfgOpen = true
|
|
|
|
- this.title = '修改电价配置'
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 提交按钮 */
|
|
|
|
- submitGwPriceForm() {
|
|
|
|
- this.$refs['gwPriceForm'].validate(valid => {
|
|
|
|
- if (valid) {
|
|
|
|
- if (this.gwPriceForm.id != null) {
|
|
|
|
- updateGwPriceConfig(this.gwPriceForm).then(response => {
|
|
|
|
- this.$modal.msgSuccess('修改成功')
|
|
|
|
- this.gwPriceCfgOpen = false
|
|
|
|
- this.getGwPriceList()
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- addGwPriceConfig(this.gwPriceForm).then(response => {
|
|
|
|
- this.$modal.msgSuccess('新增成功')
|
|
|
|
- this.gwPriceCfgOpen = false
|
|
|
|
- this.getGwPriceList()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 删除按钮操作 */
|
|
|
|
- handleGwPriceDelete(row) {
|
|
|
|
- const ids = row.id || this.ids
|
|
|
|
- this.$modal
|
|
|
|
- .confirm('是否确认删除电价配置编号为"' + ids + '"的数据项?')
|
|
|
|
- .then(function() {
|
|
|
|
- return delGwPriceConfig(ids)
|
|
|
|
- })
|
|
|
|
- .then(() => {
|
|
|
|
- this.getGwPriceList()
|
|
|
|
- this.$modal.msgSuccess('删除成功')
|
|
|
|
- })
|
|
|
|
- .catch(() => {})
|
|
|
|
- },
|
|
|
|
- /** 查询服务区用电属性列表 */
|
|
|
|
- getAttrList() {
|
|
|
|
- this.loading = true
|
|
|
|
- listAttr(this.queryAttrParams).then(response => {
|
|
|
|
- this.attrList = response.rows
|
|
|
|
- this.total = response.total !== undefined ? response.total : 0; // 提供默认值0
|
|
|
|
- this.loading = false
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 取消按钮
|
|
|
|
- attrCancel() {
|
|
|
|
- this.attrOpen = false
|
|
|
|
- this.attrReset()
|
|
|
|
- },
|
|
|
|
- // 表单重置
|
|
|
|
- attrReset() {
|
|
|
|
- this.attrForm = {
|
|
|
|
- id: null,
|
|
|
|
- areaCode: null,
|
|
|
|
- elecType: null,
|
|
|
|
- priceCode: null,
|
|
|
|
- reqCapacityFlag: 0,
|
|
|
|
- transCapacity: null,
|
|
|
|
- reqQuantity: null,
|
|
|
|
- createTime: null,
|
|
|
|
- updateTime: null
|
|
|
|
- }
|
|
|
|
- this.resetForm('attrForm')
|
|
|
|
- },
|
|
|
|
- /** 搜索按钮操作 */
|
|
|
|
- handleAttrQuery() {
|
|
|
|
- this.queryAttrParams.pageNum = 1
|
|
|
|
- this.getAttrList()
|
|
|
|
- },
|
|
|
|
- handleGwPriceQuery() {
|
|
|
|
- this.queryGwPriceParams.pageNum = 1
|
|
|
|
- this.getGwPriceList()
|
|
|
|
- },
|
|
|
|
- /** 重置按钮操作 */
|
|
|
|
- resetQuery() {
|
|
|
|
- this.handleAttrQuery()
|
|
|
|
- this.handleGwPriceQuery()
|
|
|
|
- },
|
|
|
|
- /** 新增按钮操作 */
|
|
|
|
- handleAttrAdd() {
|
|
|
|
- this.attrReset()
|
|
|
|
- this.getGwPriceAll()
|
|
|
|
- this.attrForm.areaCode = this.currentAreaCode;
|
|
|
|
- this.attrOpen = true
|
|
|
|
- this.title = '添加服务区用电属性'
|
|
|
|
- },
|
|
|
|
- /** 修改按钮操作 */
|
|
|
|
- handleAttrUpdate(row) {
|
|
|
|
- this.attrReset()
|
|
|
|
- this.getGwPriceAll()
|
|
|
|
- const id = row.id || this.ids
|
|
|
|
- getAttr(id).then(response => {
|
|
|
|
- this.attrForm = response.data
|
|
|
|
- this.attrOpen = true
|
|
|
|
- this.title = '修改服务区用电属性'
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 提交按钮 */
|
|
|
|
- submitAttrForm() {
|
|
|
|
- this.$refs['attrForm'].validate(valid => {
|
|
|
|
- if (valid) {
|
|
|
|
- console.log("Submitting form with areaCode:", this.attrForm.areaCode);
|
|
|
|
- // 排除当前正在修改的园区
|
|
|
|
- if(this.attrList.some(item => item.areaCode === this.attrForm.areaCode && item.id !== this.attrForm.id)){
|
|
|
|
- return this.$modal.msgError('当前园区已存在')
|
|
|
|
- }
|
|
|
|
- if (this.attrForm.id != null) {
|
|
|
|
- updateAttr(this.attrForm).then(response => {
|
|
|
|
- this.$modal.msgSuccess('修改成功')
|
|
|
|
- this.attrOpen = false
|
|
|
|
- this.refreshCurrentAreaData();
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- addAttr(this.attrForm).then(response => {
|
|
|
|
- this.$modal.msgSuccess('新增成功')
|
|
|
|
- this.attrOpen = false
|
|
|
|
- this.refreshCurrentAreaData();
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 删除按钮操作 */
|
|
|
|
- handleAttrDelete(row) {
|
|
|
|
- const ids = row.id || this.ids
|
|
|
|
- this.$modal
|
|
|
|
- .confirm('是否确认删除服务区用电属性编号为"' + ids + '"的数据项?')
|
|
|
|
- .then(function() {
|
|
|
|
- return delAttr(ids)
|
|
|
|
- })
|
|
|
|
- .then(() => {
|
|
|
|
- // this.getAttrList()
|
|
|
|
- this.refreshCurrentAreaData();
|
|
|
|
- this.$modal.msgSuccess('删除成功')
|
|
|
|
- })
|
|
|
|
- .catch(() => {})
|
|
|
|
- },
|
|
|
|
- getPvPriceList() {
|
|
|
|
- this.loading = true
|
|
|
|
- listPvPriceConfig(this.queryPvPriceParams).then(response => {
|
|
|
|
- this.pvPriceList = response.rows
|
|
|
|
- this.total = response.total
|
|
|
|
- this.loading = false
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 取消按钮
|
|
|
|
- pvPriceCancel() {
|
|
|
|
- this.pvPriceOpen = false
|
|
|
|
- this.pvPriceReset()
|
|
|
|
- },
|
|
|
|
- // 表单重置
|
|
|
|
- pvPriceReset() {
|
|
|
|
- this.pvPriceForm = {
|
|
|
|
- id: null,
|
|
|
|
- cfgCode: null,
|
|
|
|
- priceName: null,
|
|
|
|
- objPrice: null,
|
|
|
|
- stateSubsidy: null,
|
|
|
|
- localSubsidy: null
|
|
|
|
- }
|
|
|
|
- this.resetForm('pvPriceForm')
|
|
|
|
- },
|
|
|
|
- /** 新增按钮操作 */
|
|
|
|
- handlePvPriceAdd() {
|
|
|
|
- this.pvPriceReset()
|
|
|
|
- this.pvPriceOpen = true
|
|
|
|
- this.title = '添加光伏电价配置'
|
|
|
|
- },
|
|
|
|
- /** 修改按钮操作 */
|
|
|
|
- handlePvPriceUpdate(row) {
|
|
|
|
- this.pvPriceReset()
|
|
|
|
- const id = row.id || this.ids
|
|
|
|
- getPvPriceConfig(id).then(response => {
|
|
|
|
- this.pvPriceForm = response.data
|
|
|
|
- this.pvPriceOpen = true
|
|
|
|
- this.title = '修改光伏电价配置'
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 提交按钮 */
|
|
|
|
- submitPvPriceForm() {
|
|
|
|
- this.$refs['pvPriceForm'].validate(valid => {
|
|
|
|
- if (valid) {
|
|
|
|
- if (this.pvPriceForm.id != null) {
|
|
|
|
- updatePvPriceConfig(this.pvPriceForm).then(response => {
|
|
|
|
- this.$modal.msgSuccess('修改成功')
|
|
|
|
- this.pvPriceOpen = false
|
|
|
|
- this.getPvPriceList()
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- addPvPriceConfig(this.pvPriceForm).then(response => {
|
|
|
|
- this.$modal.msgSuccess('新增成功')
|
|
|
|
- this.pvPriceOpen = false
|
|
|
|
- this.getPvPriceList()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 删除按钮操作 */
|
|
|
|
- handlePvPriceDelete(row) {
|
|
|
|
- const ids = row.id || this.ids
|
|
|
|
- this.$modal
|
|
|
|
- .confirm('是否确认删除电价配置编号为"' + ids + '"的数据项?')
|
|
|
|
- .then(function() {
|
|
|
|
- return delPvPriceConfig(ids)
|
|
|
|
- })
|
|
|
|
- .then(() => {
|
|
|
|
- this.getPvPriceList()
|
|
|
|
- this.$modal.msgSuccess('删除成功')
|
|
|
|
- })
|
|
|
|
- .catch(() => {})
|
|
|
|
- },
|
|
|
|
- matchReqCapacityFlag(row, column, cellValue, index) {
|
|
|
|
- const reqCapacityFlagMap = {
|
|
|
|
- 0: '不涉及',
|
|
|
|
- 1: '容量电价',
|
|
|
|
- 2: '需量电价'
|
|
|
|
- }
|
|
|
|
- return reqCapacityFlagMap[cellValue] || '未知'
|
|
|
|
- },
|
|
|
|
- getPriceType() {
|
|
|
|
- getElecPriceType().then(response => {
|
|
|
|
- this.priceTypeOptions = response.data
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 查询区域列表
|
|
|
|
- getAreaList(areaCode, layer) {
|
|
|
|
- areaTreeSelect(areaCode, layer).then(response => {
|
|
|
|
- this.areaOptions = response.data
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- getGwPriceAll() {
|
|
|
|
- listGwPriceConfigAll().then(response => {
|
|
|
|
- this.gwPriceOptions = response.data
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 修改执行日期变更方法(原repeatTypeChange)
|
|
|
|
- execDateTypeChange(val) {
|
|
|
|
- if (val == 5) {
|
|
|
|
- this.strategyForm.execDate = this.weeks.filter(item => item.value < 6).map(item => item.value)
|
|
|
|
- } else if (val == 6) {
|
|
|
|
- this.strategyForm.execDate = []
|
|
|
|
- } else {
|
|
|
|
- this.strategyForm.execDate = ''
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- /** 查询峰谷电价列表 */
|
|
|
|
- getStrategyList() {
|
|
|
|
- const { pageNum, pageSize } = this.strategyParams
|
|
|
|
- this.strategyParams.loading = true
|
|
|
|
- listStrategy({ pageNum, pageSize }).then(response => {
|
|
|
|
- this.strategyList = response.rows
|
|
|
|
- this.strategyParams.loading = false
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- handleStrategyDetail(row) {
|
|
|
|
- this.ifDisabled = true
|
|
|
|
- this.resetForm('strategyForm')
|
|
|
|
- // 深拷贝数据,避免直接修改原数据
|
|
|
|
- this.strategyForm = JSON.parse(JSON.stringify(row))
|
|
|
|
- // 处理执行日期
|
|
|
|
- if ([5, 6].includes(this.strategyForm.execDateType)) {
|
|
|
|
- this.strategyForm.execDate = this.strategyForm.execDate ?
|
|
|
|
- this.strategyForm.execDate.split(',') : []
|
|
|
|
- }
|
|
|
|
- // 处理执行月份
|
|
|
|
- this.strategyForm.execMonth = this.strategyForm.execMonth ?
|
|
|
|
- this.strategyForm.execMonth.split(',') : []
|
|
|
|
- // 处理分时类型
|
|
|
|
- this.strategyForm.supportType = this.strategyForm.supportType ?
|
|
|
|
- this.strategyForm.supportType.split(',').map(v => parseInt(v)) : [0]
|
|
|
|
- this.strategyDialog = true
|
|
|
|
- this.title = '查看峰谷电价策略'
|
|
|
|
- },
|
|
|
|
- handleStrategyAdd() {
|
|
|
|
- this.ifDisabled = false
|
|
|
|
- this.resetForm('strategyForm')
|
|
|
|
- this.strategyForm = {
|
|
|
|
- id: null, // 确保id为null
|
|
|
|
- strategyCode: '',
|
|
|
|
- strategyName: '',
|
|
|
|
- strategyDesc: '',
|
|
|
|
- execDateType: '',
|
|
|
|
- execDate: [],
|
|
|
|
- execMonth: [],
|
|
|
|
- supportType: [0], // 默认选中平段
|
|
|
|
- priority: 1, // 默认优先级为1
|
|
|
|
- hourList: []
|
|
|
|
- }
|
|
|
|
- this.strategyDialog = true
|
|
|
|
- this.title = '添加峰谷电价策略'
|
|
|
|
- },
|
|
|
|
- handleStrategyUpdate(row) {
|
|
|
|
- this.ifDisabled = false
|
|
|
|
- this.resetForm('strategyForm')
|
|
|
|
- // 深拷贝数据,避免直接修改原数据
|
|
|
|
- this.strategyForm = JSON.parse(JSON.stringify(row))
|
|
|
|
- // 处理执行日期
|
|
|
|
- if ([5, 6].includes(this.strategyForm.execDateType)) {
|
|
|
|
- this.strategyForm.execDate = this.strategyForm.execDate ?
|
|
|
|
- this.strategyForm.execDate.split(',') : []
|
|
|
|
- }
|
|
|
|
- // 处理执行月份
|
|
|
|
- this.strategyForm.execMonth = this.strategyForm.execMonth ?
|
|
|
|
- this.strategyForm.execMonth.split(',') : []
|
|
|
|
- // 处理分时类型
|
|
|
|
- this.strategyForm.supportType = this.strategyForm.supportType ?
|
|
|
|
- this.strategyForm.supportType.split(',').map(v => parseInt(v)) : [0]
|
|
|
|
- // 确保平段始终被选中
|
|
|
|
- if (!this.strategyForm.supportType.includes(0)) {
|
|
|
|
- this.strategyForm.supportType.push(0)
|
|
|
|
- }
|
|
|
|
- this.strategyDialog = true
|
|
|
|
- this.title = '修改峰谷电价策略'
|
|
|
|
- },
|
|
|
|
- handleStrategyDelete(row) {
|
|
|
|
- this.$modal.confirm('是否确认删除').then(() => {
|
|
|
|
- delStrategy(row.id).then(() => {
|
|
|
|
- this.getStrategyList()
|
|
|
|
- this.$modal.msgSuccess('删除成功')
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- strategyCancel() {
|
|
|
|
- this.strategyDialog = false
|
|
|
|
- this.resetForm('strategyForm')
|
|
|
|
- // 完全重置表单数据,确保不影响下次编辑
|
|
|
|
- this.strategyForm = {
|
|
|
|
- id: null,
|
|
|
|
- strategyCode: '',
|
|
|
|
- strategyName: '',
|
|
|
|
- strategyDesc: '',
|
|
|
|
- execDateType: '',
|
|
|
|
- execDate: [],
|
|
|
|
- execMonth: [],
|
|
|
|
- supportType: [0], // 重置时也要默认选中平段
|
|
|
|
- priority: 1,
|
|
|
|
- hourList: []
|
|
|
|
- }
|
|
|
|
- // 清除可能的验证状态
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- if (this.$refs.strategyForm) {
|
|
|
|
- this.$refs.strategyForm.clearValidate()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- submitStrategyForm() {
|
|
|
|
- this.$refs['strategyForm'].validate(valid => {
|
|
|
|
- if (valid) {
|
|
|
|
- if (this.strategyForm.hourList.length === 0) {
|
|
|
|
- return this.$modal.msgError(`请添加小时电价数据`)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 检查相同优先级的月份冲突
|
|
|
|
- const monthConflict = this.checkMonthConflict()
|
|
|
|
- if (monthConflict) {
|
|
|
|
- return this.$modal.msgError(`执行月份冲突:${monthConflict}月份已被其他相同优先级的策略使用`)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- let subFlag = false
|
|
|
|
- let dateFlag = false
|
|
|
|
- let validIndex = 0
|
|
|
|
- for (let i = 0; i < this.strategyForm.hourList.length; i++) {
|
|
|
|
- const item = this.strategyForm.hourList[i]
|
|
|
|
- if (item.startTime === '' || item.endTime === '' || item.type === '') {
|
|
|
|
- subFlag = true
|
|
|
|
- validIndex = i + 1
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
- if (this.compareTime(item.startTime, item.endTime)) {
|
|
|
|
- dateFlag = true
|
|
|
|
- validIndex = i + 1
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (subFlag) {
|
|
|
|
- return this.$modal.msgError(`请补全小时电价第${validIndex}行数据`)
|
|
|
|
- }
|
|
|
|
- if (dateFlag) {
|
|
|
|
- return this.$modal.msgError(`小时电价第${validIndex}行开始时刻不能大于结束时刻`)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 增强的时间段重叠检查
|
|
|
|
- const overlapInfo = this.checkTimeRangesOverlapEnhanced()
|
|
|
|
- if (overlapInfo) {
|
|
|
|
- return this.$modal.msgError(`小时电价时间段冲突:${overlapInfo}`)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 检查时间段完整性(改为可选的警告,不阻止提交)
|
|
|
|
- const completenessCheck = this.checkTimeCompleteness()
|
|
|
|
- if (completenessCheck) {
|
|
|
|
- // 使用confirm让用户选择是否继续
|
|
|
|
- this.$modal.confirm(`${completenessCheck},是否继续保存?`).then(() => {
|
|
|
|
- this.saveStrategyForm()
|
|
|
|
- }).catch(() => {
|
|
|
|
- // 用户选择取消,不做任何操作
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- // 没有时间段问题,直接保存
|
|
|
|
- this.saveStrategyForm()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 新增方法:保存策略表单
|
|
|
|
- saveStrategyForm() {
|
|
|
|
- // 创建表单数据的副本以避免修改原数据
|
|
|
|
- const formData = JSON.parse(JSON.stringify(this.strategyForm))
|
|
|
|
-
|
|
|
|
- // 特殊处理执行日期 - 确保是字符串
|
|
|
|
- if ([5, 6].includes(formData.execDateType)) {
|
|
|
|
- formData.execDate = Array.isArray(formData.execDate) ? formData.execDate.join(',') : formData.execDate
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 处理执行月份 - 确保是字符串
|
|
|
|
- formData.execMonth = Array.isArray(formData.execMonth) ? formData.execMonth.join(',') : formData.execMonth
|
|
|
|
-
|
|
|
|
- // 处理分时类型 - 确保是字符串
|
|
|
|
- formData.supportType = Array.isArray(formData.supportType) ? formData.supportType.join(',') : formData.supportType
|
|
|
|
-
|
|
|
|
- formData.hourList.forEach(item => {
|
|
|
|
- item.strategyCode = formData.strategyCode
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- if (formData.id) {
|
|
|
|
- updateStrategy(formData).then(() => {
|
|
|
|
- this.$modal.msgSuccess('修改成功')
|
|
|
|
- this.strategyDialog = false
|
|
|
|
- this.getStrategyList()
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- addStrategy(formData).then(() => {
|
|
|
|
- this.$modal.msgSuccess('新增成功')
|
|
|
|
- this.strategyDialog = false
|
|
|
|
- this.getStrategyList()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- compareTime(t1, t2) {
|
|
|
|
- const d = new Date()
|
|
|
|
- const ft1 = d.setHours(t1.split(':')[0], t1.split(':')[1], t1.split(':')[2])
|
|
|
|
- const ft2 = d.setHours(t2.split(':')[0], t2.split(':')[1], t2.split(':')[2])
|
|
|
|
- return ft1 > ft2
|
|
|
|
- },
|
|
|
|
- checkTimeRangesOverlap() {
|
|
|
|
- const ranges = this.strategyForm.hourList.map(item => {
|
|
|
|
- const d = new Date()
|
|
|
|
- const ft1 = d.setHours(item.startTime.split(':')[0], item.startTime.split(':')[1], item.startTime.split(':')[2])
|
|
|
|
- const ft2 = d.setHours(item.endTime.split(':')[0], item.endTime.split(':')[1], item.endTime.split(':')[2])
|
|
|
|
- return [ft1, ft2]
|
|
|
|
- })
|
|
|
|
- // 将时间段按照开始时间排序
|
|
|
|
- const sortedRanges = ranges.slice().sort((a, b) => a[0] - b[0])
|
|
|
|
- // 检查时间段是否重叠
|
|
|
|
- for (let i = 1; i < sortedRanges.length; i++) {
|
|
|
|
- if (sortedRanges[i][0] < sortedRanges[i - 1][1]) {
|
|
|
|
- return true
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // 所有时间段都没有重叠
|
|
|
|
- return false
|
|
|
|
- },
|
|
|
|
- // 增强版时间段重叠检查,返回具体的冲突信息
|
|
|
|
- checkTimeRangesOverlapEnhanced() {
|
|
|
|
- const ranges = this.strategyForm.hourList.map((item, index) => {
|
|
|
|
- const d = new Date()
|
|
|
|
- const ft1 = d.setHours(item.startTime.split(':')[0], item.startTime.split(':')[1], item.startTime.split(':')[2])
|
|
|
|
- const ft2 = d.setHours(item.endTime.split(':')[0], item.endTime.split(':')[1], item.endTime.split(':')[2])
|
|
|
|
- return {
|
|
|
|
- start: ft1,
|
|
|
|
- end: ft2,
|
|
|
|
- startStr: item.startTime,
|
|
|
|
- endStr: item.endTime,
|
|
|
|
- index: index + 1
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- // 按开始时间排序
|
|
|
|
- const sortedRanges = ranges.slice().sort((a, b) => a.start - b.start)
|
|
|
|
-
|
|
|
|
- // 检查重叠并返回详细信息
|
|
|
|
- for (let i = 1; i < sortedRanges.length; i++) {
|
|
|
|
- if (sortedRanges[i].start < sortedRanges[i - 1].end) {
|
|
|
|
- return `第${sortedRanges[i - 1].index}行(${sortedRanges[i - 1].startStr}-${sortedRanges[i - 1].endStr})与第${sortedRanges[i].index}行(${sortedRanges[i].startStr}-${sortedRanges[i].endStr})存在时间重叠`
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return null
|
|
|
|
- },
|
|
|
|
- // 检查时间完整性(24小时是否都被覆盖)
|
|
|
|
- checkTimeCompleteness() {
|
|
|
|
- if (this.strategyForm.hourList.length === 0) return null
|
|
|
|
-
|
|
|
|
- const ranges = this.strategyForm.hourList.map(item => {
|
|
|
|
- const startParts = item.startTime.split(':')
|
|
|
|
- const endParts = item.endTime.split(':')
|
|
|
|
- return {
|
|
|
|
- start: parseInt(startParts[0]) * 3600 + parseInt(startParts[1]) * 60 + parseInt(startParts[2]),
|
|
|
|
- end: parseInt(endParts[0]) * 3600 + parseInt(endParts[1]) * 60 + parseInt(endParts[2]),
|
|
|
|
- startStr: item.startTime,
|
|
|
|
- endStr: item.endTime
|
|
|
|
- }
|
|
|
|
- }).sort((a, b) => a.start - b.start)
|
|
|
|
-
|
|
|
|
- const gaps = []
|
|
|
|
- const dayInSeconds = 24 * 3600
|
|
|
|
- const tolerance = 1 // 允许1秒的容差
|
|
|
|
-
|
|
|
|
- // 检查开始是否从0点开始
|
|
|
|
- if (ranges[0].start > tolerance) {
|
|
|
|
- gaps.push(`00:00:00 - ${this.formatSeconds(ranges[0].start)}`)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 检查中间的间隙(允许1秒的连续性)
|
|
|
|
- for (let i = 1; i < ranges.length; i++) {
|
|
|
|
- const gap = ranges[i].start - ranges[i - 1].end
|
|
|
|
- // 如果间隙大于1秒,才认为是真正的间隙
|
|
|
|
- if (gap > tolerance) {
|
|
|
|
- gaps.push(`${this.formatSeconds(ranges[i - 1].end)} - ${this.formatSeconds(ranges[i].start)}`)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 检查结束是否到24点(23:59:59)
|
|
|
|
- if (ranges[ranges.length - 1].end < dayInSeconds - tolerance) {
|
|
|
|
- gaps.push(`${this.formatSeconds(ranges[ranges.length - 1].end)} - 23:59:59`)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (gaps.length > 0) {
|
|
|
|
- return `以下时间段未配置:${gaps.join('、')}`
|
|
|
|
- }
|
|
|
|
- return null
|
|
|
|
- },
|
|
|
|
- // 辅助方法:将秒数转换为时间格式
|
|
|
|
- formatSeconds(seconds) {
|
|
|
|
- const h = Math.floor(seconds / 3600)
|
|
|
|
- const m = Math.floor((seconds % 3600) / 60)
|
|
|
|
- const s = seconds % 60
|
|
|
|
- return `${h.toString().padStart(2, '0')}:${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`
|
|
|
|
- },
|
|
|
|
- // 检查相同优先级策略的月份冲突
|
|
|
|
- checkMonthConflict() {
|
|
|
|
- // 获取当前优先级
|
|
|
|
- const currentPriority = this.strategyForm.priority
|
|
|
|
-
|
|
|
|
- // 获取相同优先级的其他策略
|
|
|
|
- const samePriorityStrategies = this.strategyList.filter(strategy => {
|
|
|
|
- // 排除当前正在编辑的策略和默认策略
|
|
|
|
- return strategy.priority === currentPriority &&
|
|
|
|
- strategy.id !== this.strategyForm.id &&
|
|
|
|
- strategy.editFlag !== 0
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- // 收集已被占用的月份
|
|
|
|
- const occupiedMonths = new Set()
|
|
|
|
- samePriorityStrategies.forEach(strategy => {
|
|
|
|
- if (strategy.execMonth) {
|
|
|
|
- strategy.execMonth.split(',').forEach(month => {
|
|
|
|
- occupiedMonths.add(month)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- // 检查当前选择的月份是否有冲突
|
|
|
|
- const conflictMonths = []
|
|
|
|
- this.strategyForm.execMonth.forEach(month => {
|
|
|
|
- if (occupiedMonths.has(month)) {
|
|
|
|
- const monthLabel = this.monthOptions.find(m => m.value === month)?.label || month
|
|
|
|
- conflictMonths.push(monthLabel)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- if (conflictMonths.length > 0) {
|
|
|
|
- return conflictMonths.join('、')
|
|
|
|
- }
|
|
|
|
- return null
|
|
|
|
- },
|
|
|
|
- // 获取可用月份(用于动态禁用已被占用的月份)
|
|
|
|
- getAvailableMonths() {
|
|
|
|
- const currentPriority = this.strategyForm.priority
|
|
|
|
- const samePriorityStrategies = this.strategyList.filter(strategy => {
|
|
|
|
- return strategy.priority === currentPriority &&
|
|
|
|
- strategy.id !== this.strategyForm.id &&
|
|
|
|
- strategy.editFlag !== 0
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- const occupiedMonths = new Set()
|
|
|
|
- samePriorityStrategies.forEach(strategy => {
|
|
|
|
- if (strategy.execMonth) {
|
|
|
|
- strategy.execMonth.split(',').forEach(month => {
|
|
|
|
- occupiedMonths.add(month)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- return this.monthOptions.map(month => ({
|
|
|
|
- ...month,
|
|
|
|
- disabled: occupiedMonths.has(month.value)
|
|
|
|
- }))
|
|
|
|
- },
|
|
|
|
- addSub() {
|
|
|
|
- this.strategyForm.hourList.push({
|
|
|
|
- startTime: '',
|
|
|
|
- endTime: '',
|
|
|
|
- type: ''
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- deleteSub(index) {
|
|
|
|
- this.strategyForm.hourList.splice(index, 1)
|
|
|
|
- },
|
|
|
|
- /** 查询商户计费列表 */
|
|
|
|
- getChargingList() {
|
|
|
|
- const { pageNum, pageSize } = this.chargingParams
|
|
|
|
- this.chargingParams.loading = true
|
|
|
|
- listCharging({ pageNum, pageSize }).then(response => {
|
|
|
|
- this.chargingList = response.rows
|
|
|
|
- this.chargingParams.loading = false
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- getRelateShopList(areaCode) {
|
|
|
|
- areaListByTag(areaCode,'Area_01').then(response => {
|
|
|
|
- this.zoningList = response.data
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- handleChargingAdd() {
|
|
|
|
- this.resetForm('chargingForm')
|
|
|
|
- this.chargingForm = this.$options.data().chargingForm
|
|
|
|
- this.chargingDialog = true
|
|
|
|
- this.title = '添加商户计费配置'
|
|
|
|
- },
|
|
|
|
- handleChargingUpdate(row) {
|
|
|
|
- this.resetForm('chargingForm')
|
|
|
|
- Object.assign(this.chargingForm, row)
|
|
|
|
- this.chargingForm.relCoList = this.chargingForm.relCoList.map(item => item.areaCode)
|
|
|
|
- this.getRelateShopList(this.chargingForm.areaCode)
|
|
|
|
- this.chargingDialog = true
|
|
|
|
- this.title = '修改商户计费配置'
|
|
|
|
- },
|
|
|
|
- handleChargingDelete(row) {
|
|
|
|
- this.$modal.confirm('是否确认删除').then(() => {
|
|
|
|
- delCharging(row.id).then(() => {
|
|
|
|
- this.getChargingList()
|
|
|
|
- this.$modal.msgSuccess('删除成功')
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- chargingCancel() {
|
|
|
|
- this.chargingDialog = false
|
|
|
|
- this.resetForm('chargingForm')
|
|
|
|
- this.chargingForm = this.$options.data().chargingForm
|
|
|
|
- },
|
|
|
|
- submitChargingForm() {
|
|
|
|
- this.$refs['chargingForm'].validate(valid => {
|
|
|
|
- if (valid) {
|
|
|
|
- this.chargingForm.relCoList = this.chargingForm.relCoList.map(item => ({ priceCfgId: this.chargingForm.id, areaCode: item }))
|
|
|
|
- if (this.chargingForm.id) {
|
|
|
|
- updateCharging(this.chargingForm).then(() => {
|
|
|
|
- this.$modal.msgSuccess('修改成功')
|
|
|
|
- this.chargingDialog = false
|
|
|
|
- this.getChargingList()
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- addCharging(this.chargingForm).then(() => {
|
|
|
|
- this.$modal.msgSuccess('新增成功')
|
|
|
|
- this.chargingDialog = false
|
|
|
|
- this.getChargingList()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ // 处理区域选择
|
|
|
|
+ handleAreaSelection(data) {
|
|
|
|
+ this.currentAreaCode = data.areaCode
|
|
|
|
+ this.currentAreaName = data.areaName
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
+
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.app-container {
|
|
.app-container {
|
|
::v-deep .el-tabs__content {
|
|
::v-deep .el-tabs__content {
|
|
overflow: initial;
|
|
overflow: initial;
|
|
}
|
|
}
|
|
-}
|
|
|
|
-.sub-table {
|
|
|
|
- .el-icon-delete {
|
|
|
|
- cursor: pointer;
|
|
|
|
- }
|
|
|
|
- .operateBtns {
|
|
|
|
- cursor: pointer;
|
|
|
|
- i {
|
|
|
|
- color: #1990ff;
|
|
|
|
- margin-left: 5px;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- ::v-deep .el-date-editor {
|
|
|
|
- width: 100% !important;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-.custom-checkbox-group {
|
|
|
|
- max-height: 120px;
|
|
|
|
- overflow-y: auto;
|
|
|
|
-}
|
|
|
|
-.strategyForm {
|
|
|
|
- ::v-deep .el-input.is-disabled .el-input__inner {
|
|
|
|
- color: #606266;
|
|
|
|
- background: #fff;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
|
|
-.app-container {
|
|
|
|
- .el-button.deleteBtn:disabled {
|
|
|
|
- color: #c0c4cc !important; /* 文字颜色 */
|
|
|
|
- }
|
|
|
|
- .el-button.deleteBtn:disabled:hover {
|
|
|
|
- color: #c0c4cc !important;/*删除按钮颜色*/
|
|
|
|
|
|
+ // Tab标签栏美化
|
|
|
|
+ ::v-deep .el-tabs {
|
|
|
|
+ .el-tabs__item {
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ transition: all 0.3s;
|
|
|
|
|
|
|
|
+ &:hover {
|
|
|
|
+ color: #409EFF;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &.is-active {
|
|
|
|
+ color: #409EFF;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .el-tabs__active-bar {
|
|
|
|
+ height: 3px;
|
|
|
|
+ background: linear-gradient(to right, #409EFF, #67C23A);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|