longyvfengyun
2023-12-25 d8d792a6842832e8f6af6604274c438b25053afe
src/pages/dataMager/battGroupMager.vue
@@ -4,9 +4,10 @@
            <div class="table-row">
                <div class="table-cell text-right">省:</div>
                <div class="table-cell">
                    <el-select
                    <el-select
                    v-model="filters.values.province"
                    @change="searchCity"
                    @change="searchCity"
                    allow-create
                    size="small" placeholder="请选择省">
                        <el-option
                        v-for="item in filters.data.province"
@@ -18,9 +19,10 @@
                </div>
                <div class="table-cell text-right">市:</div>
                <div class="table-cell">
                    <el-select
                    <el-select
                    v-model="filters.values.city"
                    @change="searchCounty"
                    @change="searchCounty"
                    allow-create
                    size="small" placeholder="请选择市">
                        <el-option
                        v-for="item in filters.data.city"
@@ -30,12 +32,12 @@
                        </el-option>
                    </el-select>
                </div>
                <div class="table-cell text-right">区/县:</div>
                <div class="table-cell text-right">区/县/班组:</div>
                <div class="table-cell">
                    <el-select
                    <el-select
                    v-model="filters.values.county"
                    @change="searchHome"
                    size="small" placeholder="请选择区/县">
                    @change="searchHome"
                    size="small" placeholder="请选择区/县/班组">
                        <el-option
                        v-for="item in filters.data.county"
                        :key="item.value"
@@ -46,10 +48,11 @@
                </div>
                <div class="table-cell text-right">机房名称:</div>
                <div class="table-cell w360">
                    <el-select
                    <el-select
                    v-model="filters.values.home"
                    @click="changeHome"
                    @change="changeHome"
                    filterable
                    allow-create
                    size="small" placeholder="请选择机房名称">
                        <el-option
                        v-for="item in filters.data.home"
@@ -86,7 +89,7 @@
                </el-table-column>
                <el-table-column
                prop="StationName5"
                label="区县"
                label="区县/班组"
                min-width="120"
                :resizable="false"
                align="center">
@@ -276,6 +279,20 @@
                align="center">
                </el-table-column>
                <el-table-column
                    prop="videoUrl"
                    label="视频监控序列号"
                    min-width="120"
                    :resizable="false"
                    align="center">
                </el-table-column>
                <el-table-column
                    prop="tmp_id"
                    label="模板名称"
                    min-width="120"
                    :resizable="false"
                    align="center">
                </el-table-column>
                <el-table-column
                fixed="right"
                label="操作"
                width="250"
@@ -294,9 +311,9 @@
                <el-button type="primary" @click="searchData" round size="mini" icon="el-icon-search">查询</el-button>
                <el-button type="primary" round size="mini" icon="el-icon-wallet" @click="exportFile">导出</el-button>
            </div>
            <el-pagination size="mini"
            :current-page="page.pageCurr"
            :page-sizes="[10, 20, 30, 50, 100]"
            <el-pagination size="mini"
            :current-page="page.pageCurr"
            :page-sizes="[10, 20, 30, 50, 100]"
            :page-size="page.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="page.pageAll"
@@ -314,7 +331,7 @@
        :close-on-click-modal="false"
        top="0"
        class="dialog-center">
            <div class="padding16161616">
            <div class="padding16161616 white-bg">
                <el-button :disabled="!isCanEdit" @click="dHandleClick()" type="primary" size="mini">电池信息编辑</el-button>
                <el-button :disabled="!isCanEdit" @click="dChangeIpClick()" type="primary" size="mini" v-if="changeIp">远程IP修改</el-button>
                <el-button :disabled="!isCanEdit" @click="dAutographClick()" type="primary" size="mini" v-if="autograph">签名编辑</el-button>
@@ -330,7 +347,7 @@
        top="0"
        class="dialog-center"
        :modal-append-to-body="false">
            <add-group-mager
            <add-group-mager
            v-if="addDialog"
            :batt="batt"
            @success="addSuccess"></add-group-mager>
@@ -344,7 +361,7 @@
        top="0"
        class="dialog-center"
        :modal-append-to-body="false">
            <edit-group-mager
            <edit-group-mager
            v-if="editDialog"
            :batt="batt"
            @success="editSuccess"></edit-group-mager>
@@ -454,8 +471,12 @@
      // 导出表格
      exportFile() {
         let tHeader  = ['机房编号','省','市','区县','机房名称','设备名称','设备ID','设备IP','子网掩码','网关','协议名称','FBS设备索引','电池组ID','机房内电池组编号','电池组名称','浮充电压阀值(V)','离线电压阀值(V)','浮充电流阀值(A)','单体数量','标称容量(AH)','标称单体电压(V)','标称单体内阻(mΩ)','标称单体电导','单体电压次低偏移量(V)','负载电流(A)','最大核容电流(A)','电池品牌','电池型号','电池生产日期','投入使用日期'];
         let filterVal = ['StationId','StationName1','StationName2','StationName5','StationName3','StationName4','FBSDeviceId','FbsDeviceIp','FbsDeviceIp_YM','FbsDeviceIp_WG','FBSDeviceName','GroupIndexInFBSDevice','BattGroupId','BattGroupNum','BattGroupName','FloatVolLevel','OfflineVolLevel','BattFloatCurrent','MonCount','MonCapStd','MonVolStd','MonResStd','MonSerStd','MonVolLowToAvg','Load_curr','DisCurrMax','BattProducer','BattModel','BattProductDate','BattInUseDate'];
         let filterVal = ['StationId','StationName1','StationName2','StationName5','StationName3','StationName4','FBSDeviceId','FbsDeviceIp','FbsDeviceIp_YM','FbsDeviceIp_WG','FBSDeviceName','GroupIndexInFBSDevice','BattGroupId','BattGroupNum','BattGroupName','FloatVolLevel','OfflineVolLevel','BattFloatCurrent','MonCount','MonCapStd','MonVolStd','MonResStd','MonSerStd','MonVolLowToAvg','Load_curr','DisCurrMax','BattProducer','BattModel','BattProductDate1','BattInUseDate1'];
         let list = this.tableData;
         this.tableData.forEach(item=>{
                item.BattProductDate1 = new Date(item.BattProductDate).format('yyyy-MM-dd');
                item.BattInUseDate1 = new Date(item.BattInUseDate).format('yyyy-MM-dd');
            });
         let excelData = this.formatJson(filterVal, list);
         export_json_to_excel(tHeader, excelData, "电池信息管理数据");
      },
@@ -576,7 +597,7 @@
            if(searchParams.StationName5 == "") {
                // 设置机房
                this.filters.data.home = [{
                    label: "请选择区/县",
                    label: "请选择区/县/班组",
                    value: ''
                }];
                // 查询数据
@@ -601,7 +622,7 @@
                            };
                            data.push(tmp);
                        }
                    }
                }
                // 设置第一笔数据
@@ -611,7 +632,7 @@
                });
                // 设置机房
                this.filters.data.home = data;
                // 查询数据
                this.searchData(true);
            });
@@ -633,7 +654,7 @@
        searchData(noLoading) {
            if(!noLoading) {
                this.loading = this.$layer.loading(1);
            }
            }
            let filters= this.filters.values;
            // 构造查询条件
            let searchParams = {
@@ -664,6 +685,7 @@
                data.forEach(item=>{
                    item.batteryType = const_battery_type.getLabel(item.BattGroupNum, const_battery_type.types)
                });
                console.log(data);
                // 设置表格数据
                this.tableData = data;
@@ -721,6 +743,11 @@
                this.$layer.close(loading);
            }).catch(error=>{
                console.log(error);
                this.$message({
                  type: 'success',
                  message: '删除'+batt.StationName3+'成功!'
                });
                this.searchData();
                // 关闭等待框
                this.$layer.close(loading);
            });
@@ -777,7 +804,9 @@
</script>
<style scoped>
.white-bg {
  background-color: #fff;
}
</style>