<template>
|
<div class="params-container">
|
<el-form
|
ref="ruleForm"
|
size="mini"
|
label-position="top"
|
:model="params"
|
:rules="rules"
|
class="params-dialog bg-white"
|
>
|
<el-row :gutter="layout.gutter">
|
<el-col :span="layout.span">
|
<el-form-item label="省" prop="stationName1">
|
<el-select
|
v-model="params.stationName1"
|
placeholder="请选择省"
|
@change="provinceChange"
|
:filterable="true"
|
disabled
|
>
|
<el-option
|
v-for="item in linkage.provinces"
|
:key="item"
|
:label="item"
|
:value="item"
|
>
|
</el-option>
|
<el-option label="其他" value="其他"></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="市" prop="stationName2">
|
<el-select
|
v-model="params.stationName2"
|
placeholder="请选择市"
|
@change="cityChange"
|
:filterable="true"
|
disabled
|
>
|
<el-option
|
v-for="item in linkage.cities"
|
:key="item"
|
:label="item"
|
:value="item"
|
>
|
</el-option>
|
<el-option label="其他" value="其他"></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="区/县" prop="stationName5">
|
<el-select
|
v-model="params.stationName5"
|
placeholder="请选择区县"
|
@change="countyChange"
|
:filterable="true"
|
disabled
|
>
|
<el-option
|
v-for="item in linkage.counties"
|
:key="item"
|
:label="item"
|
:value="item"
|
>
|
</el-option>
|
<el-option label="其他" value="其他"></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="机房名称" prop="stationName3">
|
<el-input v-model="params.stationName3" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="设备ID" prop="fbsdeviceId">
|
<el-input v-model="params.fbsdeviceId"></el-input>
|
</el-form-item>
|
</el-col>
|
|
<el-col :span="layout.span">
|
<el-form-item label="设备名称" prop="stationName4">
|
<el-input v-model="params.stationName4"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="设备IP" prop="fbsdeviceIp">
|
<el-input v-model="params.fbsdeviceIp"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="子网掩码" prop="fbsdeviceipYm">
|
<el-input v-model="params.fbsdeviceipYm"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="网关" prop="fbsdeviceipWg">
|
<el-input v-model="params.fbsdeviceipWg"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="协议名称" prop="fbsdeviceName">
|
<el-input v-model="params.fbsdeviceName"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="FBS设备索引" prop="groupIndexInFBSDevice">
|
<el-input v-model="params.groupIndexInFBSDevice"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="电池组类型" prop="battGroupNum">
|
<el-select
|
v-model="params.battGroupNum"
|
placeholder="请选择电池类型"
|
>
|
<el-option
|
v-for="item in batteryTypes"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span" v-if="isInversion">
|
<el-form-item label="充电类型">
|
<el-select
|
v-model="params.chargeType"
|
placeholder="请选择充电类型"
|
disabled
|
>
|
<el-option
|
v-for="item in chargeTypes"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span" v-if="isInversion">
|
<el-form-item label="母联状态">
|
<el-select
|
v-model="params.buscoupleState"
|
placeholder="请选择母联状态"
|
disabled
|
>
|
<el-option
|
v-for="item in buscoupleStates"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="电池组名称" prop="battGroupName">
|
<el-input v-model="params.battGroupName"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="浮充电压阀值(V)" prop="floatVolLevel">
|
<el-input v-model="params.floatVolLevel"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="离线电压阀值(V)" prop="offlineVolLevel">
|
<el-input v-model="params.offlineVolLevel"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="浮充电流阀值(A)" prop="battFloatCurrent">
|
<el-input v-model="params.battFloatCurrent"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span" v-if="isLithiumPack">
|
<el-form-item label="锂电池包个数" prop="packCount">
|
<el-input v-model="params.packCount"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="单体数量" prop="monCount">
|
<!-- <el-select v-model="params.monCount" placeholder="请选择单体数量">-->
|
<!-- <el-option label="4" value="4"></el-option>-->
|
<!-- <el-option label="24" value="24"></el-option>-->
|
<!-- </el-select>-->
|
<el-input v-model="params.monCount"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="标称容量(AH)" prop="monCapStd">
|
<el-input v-model="params.monCapStd"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="标称单体电压(V)" prop="monVolStd">
|
<el-input v-model="params.monVolStd"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="标称单体内阻(mΩ)" prop="monResStd">
|
<el-input v-model="params.monResStd"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="标称单体电导" prop="monSerStd">
|
<el-input v-model="params.monSerStd"></el-input>
|
</el-form-item>
|
</el-col>
|
<!-- <el-col :span="layout.span">-->
|
<!-- <el-form-item label="单体电压次低偏移量(V)" prop="monVolLowToAvg">-->
|
<!-- <el-input v-model="params.monVolLowToAvg"></el-input>-->
|
<!-- </el-form-item>-->
|
<!-- </el-col>-->
|
<el-col :span="layout.span">
|
<el-form-item label="负载电流(A)" prop="loadCurr">
|
<el-input v-model="params.loadCurr"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="最大核容电流(A)" prop="disCurrMax">
|
<el-input v-model="params.disCurrMax"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="电池品牌" prop="battProducer">
|
<el-select
|
v-model="params.battProducer"
|
placeholder="请选择"
|
@change="battProducerChange"
|
:filterable="true"
|
>
|
<el-option
|
v-for="item in linkage.battProducers"
|
:key="item"
|
:label="item"
|
:value="item"
|
>
|
</el-option>
|
<el-option label="其他" value="-999"></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="电池型号" prop="battModel">
|
<el-input v-model="params.battModel"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="电池生产日期" prop="battProductDate">
|
<el-date-picker
|
v-model="params.battProductDate"
|
size="small"
|
type="date"
|
placeholder="选择日期"
|
value-format="yyyy-MM-dd"
|
></el-date-picker>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="投入使用日期" prop="battInUseDate">
|
<el-date-picker
|
v-model="params.battInUseDate"
|
size="small"
|
type="date"
|
placeholder="选择日期"
|
value-format="yyyy-MM-dd"
|
></el-date-picker>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="视频监控序列号">
|
<el-input v-model="params.videoUrl"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span" v-if="isLithium">
|
<el-form-item label="电价分布模板" prop="tmpId">
|
<el-select v-model="params.tmpId" placeholder="请选择电价分布模板">
|
<el-option
|
v-for="item in tmpList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="基站号码">
|
<el-input v-model="params.stationPhone"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="layout.span">
|
<el-form-item label="验签格式">
|
<el-select
|
v-model="params.signType"
|
placeholder="请选择">
|
<el-option
|
v-for="item in signTypes"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<div class="form-footer">
|
<three-btn @click="autoComputeIp" v-if="isDcDcBts"
|
>自动计算IP</three-btn
|
>
|
<three-btn @click="showReason">确定</three-btn>
|
</div>
|
</el-form>
|
<!-- 省 -->
|
<el-dialog
|
v-cloak
|
top="0"
|
class="dialog-center"
|
title="请选择省"
|
:visible.sync="province.dialogVisible"
|
width="280px"
|
append-to-body
|
>
|
<el-form size="small">
|
<el-form-item label="省">
|
<el-select
|
v-model="province.value"
|
placeholder="请选择省"
|
:filterable="true"
|
>
|
<el-option
|
v-for="province in province.list"
|
:key="province.name"
|
:label="province.name"
|
:value="province.name"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
</el-form>
|
<div style="text-align: right">
|
<el-button type="primary" size="mini" @click="provinceOk"
|
>确定</el-button
|
>
|
<el-button size="mini" @click="province.dialogVisible = false"
|
>取消</el-button
|
>
|
</div>
|
</el-dialog>
|
<!-- 市 -->
|
<el-dialog
|
v-cloak
|
top="0"
|
class="dialog-center"
|
title="请选择市"
|
:visible.sync="city.dialogVisible"
|
width="280px"
|
append-to-body
|
>
|
<el-form size="small">
|
<el-form-item label="市">
|
<el-select
|
v-model="city.value"
|
placeholder="请选择市"
|
:filterable="true"
|
>
|
<el-option
|
v-for="city in city.list"
|
:key="city.name"
|
:label="city.name"
|
:value="city.name"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-form>
|
<div style="text-align: right">
|
<el-button type="primary" size="mini" @click="cityOk">确定</el-button>
|
<el-button size="mini" @click="city.dialogVisible = false"
|
>取消</el-button
|
>
|
</div>
|
</el-dialog>
|
<!-- 区县 -->
|
<el-dialog
|
top="0"
|
class="dialog-center"
|
title="请选择区县"
|
:visible.sync="county.dialogVisible"
|
width="280px"
|
append-to-body
|
>
|
<el-form size="small">
|
<el-form-item label="市">
|
<el-select
|
v-model="county.value"
|
placeholder="请选择市"
|
:filterable="true"
|
>
|
<el-option
|
v-for="county in county.list"
|
:key="county.name"
|
:label="county.name"
|
:value="county.name"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
</el-form>
|
<div style="text-align: right">
|
<el-button type="primary" size="mini" @click="countyOk">确定</el-button>
|
<el-button size="mini" @click="county.dialogVisible = false"
|
>取消</el-button
|
>
|
</div>
|
</el-dialog>
|
<!-- 电池品牌 -->
|
<el-dialog
|
top="0"
|
class="dialog-center"
|
title="请输入电池品牌"
|
:visible.sync="battProducer.dialogVisible"
|
width="280px"
|
append-to-body
|
>
|
<el-form size="small">
|
<el-form-item label="电池品牌">
|
<el-input v-model="battProducer.value"></el-input>
|
</el-form-item>
|
</el-form>
|
<div style="text-align: right">
|
<el-button type="primary" size="mini" @click="battProducerOk"
|
>确定</el-button
|
>
|
<el-button size="mini" @click="battProducer.dialogVisible = false"
|
>取消</el-button
|
>
|
</div>
|
</el-dialog>
|
<!-- 编辑原因 -->
|
<el-dialog
|
top="0"
|
class="dialog-center"
|
title="请输入修改原因"
|
:visible.sync="reasonVisible"
|
width="280px"
|
append-to-body
|
>
|
<el-form size="small">
|
<el-form-item label="修改原因">
|
<el-input
|
type="textarea"
|
placeholder="必填"
|
v-model="updateReason"
|
></el-input>
|
</el-form-item>
|
</el-form>
|
<div style="text-align: right">
|
<el-button type="primary" size="mini" @click="submitFrom"
|
>确定</el-button
|
>
|
<el-button size="mini" @click="submitCancel">取消</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { testVal, extend, LinkagePlus, regEquipType } from "@/assets/js/tools";
|
|
import {
|
const_province_city_county,
|
const_battGroup,
|
const_battery_type,
|
} from "@/assets/js/const";
|
|
import { searchProvince, searchCity, searchCounty } from "@/assets/js/api.js";
|
import { searchTplAll } from "../js/eletmp";
|
import { searchBattProducer, edit } from "../js/battGroupMager";
|
import const_rules from "@/assets/js/const/const_rules";
|
import getDevIp from "@/assets/js/tools/getDevIp";
|
|
export default {
|
props: {
|
batt: {
|
type: Object,
|
required: true,
|
},
|
},
|
data() {
|
let rules = const_battGroup.rules;
|
let constRules = const_rules;
|
let batteryTypes = const_battery_type.types;
|
const subRules = {
|
validator(rule, value, callback) {
|
testVal(rule, value, callback, constRules.noSpecialChar);
|
},
|
trigger: "change",
|
};
|
return {
|
reasonVisible: false,
|
updateReason: "",
|
layout: {
|
span: 8,
|
gutter: 16,
|
},
|
params: {
|
stationId: 42000142, // 机房编号(后台自动生成最大)
|
stationName: "", // 机房名称(全称)
|
stationName1: "", // 省*
|
stationName2: "", // 市*
|
stationName5: "", // 区县*
|
stationName3: "", // 机房名称*
|
stationName4: "61850设备", // 设备名称*
|
stationIp: "192.168.0.5", // 机房ip
|
fbsdeviceId: 618500152, // 设备ID (后台自动生成最大)
|
fbsdeviceIp: "192.168.7.155", // 设备IP(重要)*
|
fbsdeviceipYm: "255.255.255.0", // 设备子网掩码(重要)*
|
fbsdeviceipWg: "192.168.7.1", // 设备网关(重要)*
|
fbsdeviceName: "ZJDYBTSE", // 协议名称(重要)*
|
groupIndexInFBSDevice: 0, // FBS设备索引
|
battGroupId: 1000547, // 电池组ID (后台自动生成最大)
|
battGroupNum: 0, // 机房内电池组编号*
|
battGroupName: "", // 电池组名称
|
floatVolLevel: "53.6", // 浮充电压阀值(V)(自动计算)
|
offlineVolLevel: "51.5", // 离线电压阀值(V)(自动计算)
|
battFloatCurrent: "5", // 浮充电流阀值(A)
|
packCount: 1, // 锂电池包个数
|
monCount: 4, // 单体数量
|
monCapStd: 150, // 标称容量(AH)
|
monVolStd: "4", // 标称单体电压(V)
|
monResStd: "0.2", // 标称单体内阻(mΩ)
|
monSerStd: "3000", // 标称单体电导
|
monVolLowToAvg: "0.05", // 单体电压次低偏移量(V)
|
loadCurr: "15", // 负载电流(A)
|
disCurrMax: "0", // 最大核容电流(A)
|
stationPhone: "", // 基站号码
|
battProducer: "", // 电池品牌
|
battModel: "", // 电池型号
|
battProductDate: "2000-01-01", // 电池生产日期
|
battInUseDate: new Date().format("yyyy-MM-dd"), // 投入使用日期
|
videoUrl: "", // 萤石云视频监控序列号
|
chargeType: 1, // 充电类型
|
buscoupleState: 0, // 母联状态
|
tmpId: 0, // 电价模板id
|
devNum: 0,
|
volGrade: 0, // 电压等级(kV)
|
manufacturers: "", // 生产厂家
|
assetequipment: "", // 是否资产级设备
|
deviceclasspath: "", // 设备分类全路径
|
deviceOperationDepartment: "", // 设备运维部门
|
propertyRightUnit: "", // 产权单位
|
propertyAttribute: "", // 产权属性
|
factoryNumber: "", // 出厂编号
|
operationTeam: "", // 运维(保管)班组
|
deviceIdentityCode: "", // 设备身份编码
|
projectType: "", // 项目类型
|
batteryApplicationType: "", // 蓄电池应用类型
|
singleRatedVoltage: 0, // 单电压额定电压
|
remotemonitor: "", // 是否实现远程监控
|
batttIndependentPlaced: "", // 是否独立蓄电池室放置
|
junChargeVoltageValue: 0, // 均充电压设定值
|
signType: 0, // 验签格式
|
},
|
signTypes: [
|
{
|
value: 0,
|
label: "常规"
|
},
|
{
|
value: 1,
|
label: "正常1拖2[61850设备有效]"
|
},
|
],
|
rules: {
|
stationName1: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
stationName2: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
stationName5: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
stationName3: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
stationName4: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
fbsdeviceId: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
],
|
fbsdeviceName: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
fbsdeviceIp: [
|
{
|
required: true,
|
validator(rule, value, callback) {
|
testVal(rule, value, callback, rules.FbsDeviceIp);
|
},
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
fbsdeviceipYm: [
|
{
|
required: true,
|
validator(rule, value, callback) {
|
testVal(rule, value, callback, rules.FbsDeviceIp_YM);
|
},
|
trigger: "change",
|
},
|
],
|
fbsdeviceipWg: [
|
{
|
required: true,
|
validator(rule, value, callback) {
|
testVal(rule, value, callback, rules.FbsDeviceIp_WG);
|
},
|
trigger: "change",
|
},
|
],
|
groupIndexInFBSDevice: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
],
|
tmpId: [
|
{
|
required: true,
|
message: "请先录入电价分布模板",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
battGroupNum: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
floatVolLevel: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
offlineVolLevel: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
battFloatCurrent: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
monResStd: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
],
|
monSerStd: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
monVolLowToAvg: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
disCurrMax: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
battGroupName: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
monVolStd: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
monCapStd: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
loadCurr: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
battProducer: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
],
|
battModel: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
battProductDate: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
battInUseDate: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
packCount: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
monCount: [
|
{
|
required: true,
|
message: "不能为空",
|
trigger: "change",
|
},
|
{ ...subRules },
|
],
|
},
|
linkage: {
|
province: "",
|
provinces: [],
|
|
city: "",
|
cities: [],
|
|
county: "",
|
counties: [],
|
|
battProducer: "",
|
battProducers: [],
|
},
|
linkagePlus: new LinkagePlus(),
|
province: {
|
dialogVisible: false,
|
value: "",
|
list: [],
|
},
|
city: {
|
dialogVisible: false,
|
value: "",
|
list: [],
|
},
|
county: {
|
dialogVisible: false,
|
value: "",
|
list: [],
|
},
|
battProducer: {
|
dialogVisible: false,
|
value: "",
|
},
|
tmpList: [],
|
batteryTypes: batteryTypes,
|
chargeTypes: [
|
{
|
label: "限流充电",
|
value: 1,
|
},
|
{
|
label: "逆变充电",
|
value: 2,
|
},
|
],
|
buscoupleStates: [
|
{
|
label: "无母联",
|
value: 0,
|
},
|
{
|
label: "有母联",
|
value: 1,
|
},
|
],
|
};
|
},
|
watch: {
|
isLithium() {
|
this.initTpl();
|
},
|
},
|
methods: {
|
searchProvince() {
|
// 省
|
// 查询后台
|
searchProvince().then((res) => {
|
res = res.data;
|
var data = [];
|
if (res.code) {
|
data = res.data;
|
}
|
|
// 设置省
|
this.linkage.provinces = data;
|
});
|
},
|
searchbattProducer() {
|
// 查询后台
|
searchBattProducer()
|
.then((res) => {
|
res = res.data;
|
let data = [];
|
if (res.code) {
|
data = res.data;
|
}
|
this.linkage.battProducers = data;
|
})
|
.catch((error) => {
|
console.log(error);
|
});
|
},
|
battProducerChange(value) {
|
// 点击其他
|
if (value == -999) {
|
// 恢复上一次选择的内容
|
this.params.battProducer = this.linkage.battProducer;
|
this.battProducer.dialogVisible = true;
|
this.battProducer.value = "";
|
} else {
|
this.linkage.battProducer = value;
|
}
|
},
|
battProducerOk() {
|
var value = this.battProducer.value.trim();
|
if (!value) {
|
this.$message.error('不能为空');
|
return false;
|
}
|
// 获取选择的值
|
this.params.battProducer = value;
|
// 记录选择的内容
|
this.linkage.battProducer = value;
|
if (this.linkage.battProducers.indexOf(value) == -1) {
|
this.linkage.battProducers.push(value);
|
}
|
// 修改面板显示状态为关闭
|
this.battProducer.dialogVisible = false;
|
},
|
// 提交表单设置参数
|
showReason() {
|
this.$refs.ruleForm.validate((valid) => {
|
// 校验通过
|
if (valid) {
|
this.reasonVisible = true;
|
} else {
|
this.$layer.msg("存在校验未通过的数据!");
|
return false;
|
}
|
});
|
},
|
submitCancel() {
|
this.updateReason = "";
|
this.reasonVisible = false;
|
},
|
submitFrom() {
|
let { updateReason } = this;
|
if ('' == updateReason.trim()) {
|
this.$message.error('请填写修改原因');
|
return false;
|
}
|
var tmp = {};
|
Object.keys(this.params).forEach((key, value) => {
|
tmp[key] = this.params[key];
|
});
|
tmp.stationName =
|
tmp.stationName1 +
|
"-" +
|
tmp.stationName2 +
|
"-" +
|
tmp.stationName5 +
|
"-" +
|
tmp.stationName3 +
|
"-" +
|
tmp.stationName4;
|
tmp.updateReason = updateReason;
|
// 编辑机房
|
this.editHome(tmp);
|
},
|
// 编辑机房
|
editHome(batt) {
|
let loading = this.$layer.loading(1);
|
// 请求后台
|
edit(batt)
|
.then((res) => {
|
res = res.data;
|
if (res.code) {
|
this.$message({
|
type: "success",
|
message: "修改" + batt.stationName + "成功!",
|
});
|
this.updateReason = "";
|
this.reasonVisible = false;
|
// 触发事件
|
this.$emit("success");
|
} else {
|
this.$message({
|
type: "error",
|
message: "修改" + batt.stationName + "失败!",
|
});
|
}
|
// 关闭加载框
|
this.$layer.close(loading);
|
})
|
.catch((error) => {
|
console.log(error);
|
this.$message({
|
type: "error",
|
message: "修改" + batt.stationName + "失败!",
|
});
|
// 触发事件
|
// this.$emit("success");
|
// 关闭加载框
|
this.$layer.close(loading);
|
});
|
},
|
provinceChange(value) {
|
// 初始化市
|
this.params.stationName2 = "";
|
this.linkage.city = "";
|
this.linkage.cities = [];
|
|
// 初始化区县
|
this.params.stationName5 = "";
|
this.linkage.county = "";
|
this.linkage.counties = [];
|
// 点击其他
|
if (value == "其他") {
|
var provinces = this.linkagePlus.getProvince();
|
this.province.dialogVisible = true;
|
this.province.value = provinces[0].name;
|
this.province.list = provinces;
|
// 恢复上一次选择的内容
|
this.params.stationName1 = this.linkage.province;
|
} else {
|
this.linkage.province = value;
|
}
|
|
// 查询市
|
this.searchCity();
|
},
|
searchCity() {
|
// 构造查询条件
|
let stationName1 = this.linkage.province;
|
// 查询后台
|
searchCity(stationName1).then((res) => {
|
res = res.data;
|
var data = [];
|
if (res.code) {
|
data = res.data;
|
}
|
// 设置市
|
this.linkage.cities = data;
|
// 查询区县
|
this.searchCounty();
|
});
|
},
|
searchCounty() {
|
// 构造查询条件
|
let stationName1 = this.linkage.province,
|
stationName2 = this.linkage.city;
|
// 查询后台
|
searchCounty(stationName1, stationName2).then((res) => {
|
res = res.data;
|
var data = [];
|
if (res.code) {
|
data = res.data;
|
}
|
// 设置区县
|
this.linkage.counties = data;
|
});
|
},
|
cityChange(value) {
|
// 初始化区县
|
this.params.stationName5 = "";
|
this.linkage.county = "";
|
this.linkage.counties = [];
|
// 获取省
|
var stationName1 = this.params.stationName1;
|
// 点击其他
|
if (value == "其他") {
|
// 恢复上一次选择的内容
|
this.params.stationName2 = this.linkage.city;
|
// 未选择省
|
if (stationName1 == "") {
|
// 提出告警
|
this.$message({
|
type: "warning",
|
message: "请先选择省",
|
});
|
return;
|
}
|
var result = this.linkagePlus.getCity(stationName1);
|
if (result.code == 1) {
|
var cities = result.data;
|
this.city.dialogVisible = true;
|
this.city.value = cities[0].name;
|
this.city.list = cities;
|
} else {
|
// 提出告警
|
this.$message({
|
type: "warning",
|
message: result.msg,
|
});
|
}
|
} else {
|
this.linkage.city = value;
|
}
|
// 查询区县
|
this.searchCounty();
|
},
|
countyChange(value) {
|
// 获取省
|
var stationName1 = this.params.StationName1;
|
// 获取市
|
var stationName2 = this.params.StationName2;
|
// 点击其他
|
if (value == "其他") {
|
// 恢复上一次选择的内容
|
this.params.stationName5 = this.linkage.county;
|
// 未选择省
|
if (stationName1 == "") {
|
// 提出告警
|
this.$message({
|
type: "warning",
|
message: "请先选择省",
|
});
|
return;
|
}
|
|
// 未选择市
|
if (stationName2 == "") {
|
// 提出告警
|
this.$message({
|
type: "warning",
|
message: "请先选择市",
|
});
|
return;
|
}
|
var result = this.linkagePlus.getCounty(stationName1, StationName2);
|
if (result.code == 1) {
|
var counties = result.data;
|
this.county.dialogVisible = true;
|
this.county.value = counties[0].name;
|
this.county.list = counties;
|
} else {
|
// 提出告警
|
this.$message({
|
type: "warning",
|
message: result.msg,
|
});
|
}
|
} else {
|
this.linkage.county = value;
|
}
|
},
|
provinceOk: function () {
|
var value = this.province.value;
|
// 获取选择的值
|
this.params.stationName1 = value;
|
// 记录选择的内容
|
this.linkage.province = value;
|
if (this.linkage.provinces.indexOf(value) == -1) {
|
this.linkage.provinces.push(value);
|
}
|
// 修改面板显示状态为关闭
|
this.province.dialogVisible = false;
|
|
// 查询市
|
this.searchCity();
|
},
|
cityOk() {
|
var value = this.city.value;
|
// 获取选择的值
|
this.params.stationName2 = value;
|
// 记录选择的内容
|
this.linkage.city = value;
|
if (this.linkage.cities.indexOf(value) == -1) {
|
this.linkage.cities.push(value);
|
}
|
// 修改面板显示状态为关闭
|
this.city.dialogVisible = false;
|
|
// 查询区县
|
this.searchCounty();
|
},
|
countyOk() {
|
var value = this.county.value;
|
// 获取选择的值
|
this.params.stationName5 = value;
|
// 记录选择的内容
|
this.linkage.county = value;
|
if (this.linkage.counties.indexOf(value) == -1) {
|
this.linkage.counties.push(value);
|
}
|
// 修改面板显示状态为关闭
|
this.county.dialogVisible = false;
|
},
|
searchTplAll() {
|
searchTplAll()
|
.then((res) => {
|
let rs = res.data;
|
let data = [];
|
if (rs.code == 1) {
|
data = rs.data;
|
}
|
|
// 更新模板列表
|
this.tmpList = data.map((item) => {
|
item.key = item.tmpId;
|
item.value = item.tmpId;
|
item.label = item.tmpName;
|
return item;
|
});
|
|
// 初始化模板id
|
this.initTpl();
|
})
|
.catch((error) => {
|
console.log(error);
|
});
|
},
|
initTpl() {
|
let tplList = this.tmpList;
|
let isLithium = this.isLithium;
|
if (tplList.length != 0 && isLithium) {
|
this.params.tmpId = this.params.tmp_id
|
? this.params.tmpId
|
: tplList[0].value;
|
} else if (tplList.length == 0 && isLithium) {
|
this.params.tmpId = "";
|
} else {
|
this.params.tmpId = 0;
|
}
|
},
|
autoComputeIp() {
|
let dev_id = this.params.fbsdeviceId;
|
let ipInfo = getDevIp(dev_id);
|
if (ipInfo.code == 1) {
|
this.$alert("设备IP:" + ipInfo.data, "系统提示", {
|
confirmButtonText: "确定",
|
});
|
} else {
|
this.$layer.msg(ipInfo.data);
|
}
|
},
|
},
|
computed: {
|
isInversion() {
|
let dev_id = this.params.fbsdeviceId;
|
return regEquipType(dev_id, "BTS9120");
|
},
|
isLithium() {
|
// 锂电BTS
|
let dev_id = this.params.fbsdeviceId;
|
return regEquipType(dev_id, ["lithium", "li9132", "kgdy"]);
|
},
|
isLithiumPack() {
|
// 锂电池包
|
let dev_id = this.params.fbsdeviceId;
|
return regEquipType(dev_id, ["lithiumPack"]);
|
},
|
isDcDcBts() {
|
// DCDC设备
|
let dev_id = this.params.fbsdeviceId;
|
return regEquipType(dev_id, ["BTS"]);
|
},
|
monCountText() {
|
let isLithiumPack = this.isLithiumPack;
|
return isLithiumPack ? "锂电池包单体个数" : "单体个数";
|
},
|
},
|
mounted() {
|
// 设置省市区县的数据
|
this.linkagePlus.setData(const_province_city_county);
|
|
// 查询省-市-区县
|
this.searchProvince();
|
|
// 查询已存在的电池品牌
|
this.searchbattProducer();
|
|
this.params = extend({}, this.batt);
|
|
// 查询所有的电价分布图模板
|
this.searchTplAll();
|
},
|
};
|
</script>
|
|
<style scoped>
|
.params-container {
|
padding: 8px;
|
background-color: #ececec;
|
}
|
|
.form-footer {
|
margin-top: 16px;
|
margin-bottom: 16px;
|
text-align: right;
|
}
|
|
.form-footer .three-btn {
|
margin-left: 12px;
|
}
|
</style>
|