whyczyk
2022-05-05 5a087f3a8f6db1f6344dc4a79af2e4c85d27cf1b
src/pages/alarmMager/batteryrTimequery.vue
@@ -114,7 +114,7 @@
         <van-picker show-toolbar :columns="newRoms" value-key="label" @confirm="storageBatterys" @cancel="showPicker2 = false" title="机房站点" />
      </van-popup>
      <van-popup v-model="showPicker3" round position="bottom">
         <van-picker show-toolbar :columns="options" value-key="BattGroupName" @confirm="selectBatter" @cancel="showPicker3 = false" title="蓄电池组" />
         <van-picker show-toolbar :columns="options" value-key="battGroupName" @confirm="selectBatter" @cancel="showPicker3 = false" title="蓄电池组" />
      </van-popup>
      <div class="refBtn" @click="onRefresh">
         <van-icon name="replay" />
@@ -124,9 +124,9 @@
<script>
import {
   dataType /* 维护区 */,
   searchProvince /* 维护区 */,
   roomsStation /* 机房站点 */,
   batterySeach /* 蓄电池组 */,
   batterySearch /* 蓄电池组 */,
   newsAlarm /*告警信息 */,
   deletionRecord /* 删除 */,
   reporTemergency /* 确认告警 */,
@@ -261,8 +261,8 @@
   methods: {
      /* 维护区 */
      async vindicateData() {
         const resType = await dataType();
         let typeList = JSON.parse(resType.data.result).data.map((item) => {
         const resType = await searchProvince();
         let typeList = resType.data.data.map((item) => {
            return {
               label: item,
               value: item,
@@ -276,10 +276,11 @@
      /* 机房站点 */
      async computerSite() {
         const roomsSeation = await roomsStation({
            UNote: this.selectValue1,
            stationName1: this.selectValue1,
         });
         if (roomsSeation.data.result) {
            let newRoms = JSON.parse(roomsSeation.data.result).data.map((item) => {
         let res = roomsSeation.data;
         if (res.code) {
            let newRoms = res.data.map((item) => {
               return {
                  label: item,
                  value: item,
@@ -298,13 +299,14 @@
         this.selectLable3 = "";
         this.showPicker2 = false
         // 构造查询条件
         const batteryss = await batterySeach({
            UNote: this.selectValue1,
            UName: this.selectValue2,
         const batteryss = await batterySearch({
            stationName1: this.selectValue1,
            stationName: this.selectValue2,
         });
         if (batteryss.data.result) {
            let options = JSON.parse(batteryss.data.result).data.map((item) => {
               item.BattGroupName = `${item.BattGroupName}-${item.MonCount}节`;
         let res = batteryss.data;
         if (res.code) {
            let options = res.data.map((item) => {
               item.battGroupName = `${item.battGroupName}-${item.monCount}节`;
               return item;
            });
            this.options = options;
@@ -324,8 +326,8 @@
      //选择电池组
      selectBatter(value) {
         if (value) {
            this.selectValue3 = value.BattGroupId
            this.selectLable3 = value.BattGroupName
            this.selectValue3 = value.battGroupId
            this.selectLable3 = value.battGroupName
         }
         this.showPicker3 = false
@@ -359,45 +361,33 @@
         });
         // 一级和二级告警
         params.num = this.checkbox.Level_one_warn.bol ? 1 : 0;
         params.BattGroupId = this.checkbox.Level_two_warn.bol ? 2 : 0;
         params.battGroupId = this.checkbox.Level_two_warn.bol ? 2 : 0;
         // 上限和下限告警
         params.alm_id = this.checkbox.alm_id.bol ? 1 : 100;
         params.alm_signal_id = this.checkbox.alm_signal_id.bol ? 0 : 100;
         let postData = {
            bmd: {
               page: {
                  pageSize: tab.page.pageSize,
                  pageCurr: tab.page.pageCurr,
               },
               binf: {
                  StationName1: this.selectValue1,
                  stationName: this.selectValue2,
                  BattGroupId: this.selectValue3 ? this.selectValue3 : 0,
               },
               mainf: {
                  usr_id: params.usr_id,
                  fault_type_id: params.fault_type_id,
                  uname: params.uname,
                  fault_level: params.fault_level,
                  record_uid: params.record_uid,
                  maint_type_id: params.maint_type_id,
                  maint_close: params.maint_close,
                  master_id: "0",
                  maint_done: params.maint_done,
                  num: params.num,
                  BattGroupId: params.BattGroupId,
                  master_audit: params.master_audit,
                  appoint_uid: params.appoint_uid,
                  fault_type: params.fault_type,
               },
               adata: {
                  MonNum: "0",
                  Record_Id: "0",
                  alm_id: params.alm_id,
                  alm_signal_id: params.alm_signal_id,
                  alm_is_confirmed: this.active,
               },
            almIdOne: params.usr_id,
            almIdTwo: params.fault_type_id,
            almIdThree: params.uname,
            almIdFour: params.fault_level,
            almIdFive: params.record_uid,
            almIdSix: params.maint_type_id,
            almIdSeven: params.maint_close,
            almIdEight: params.maint_done,
            almIsConfirmed: 0,
            almLevelFour: params.appoint_uid,
            almLevelOne: params.Level_one_warn,
            almLevelThree: params.master_audit,
            almLevelTwo: params.Level_two_warn,
            almSignalIdOne: params.alm_id,
            almSignalIdTwo: params.alm_signal_id,
            battGroupId: this.selectValue3 ? this.selectValue3 : 0,
            page: {
               pageSize: tab.page.pageSize,
               pageCurr: tab.page.pageCurr,
            },
            stationname: this.selectValue2,
            stationname1: this.selectValue1,
         }
         newsAlarm(postData).then((res) => {
            const resData = JSON.parse(res.data.result);
@@ -409,7 +399,7 @@
                     item.battery1 =
                        item.binf && item.binf.StationName ? item.binf.StationName : "";
                     item.tes1 =
                        item.binf && item.binf.BattGroupName ? item.binf.BattGroupName : "";
                        item.binf && item.binf.battGroupName ? item.binf.battGroupName : "";
                     item.tester1 =
                        item.binf && item.binf.StationName8 ? item.binf.StationName8 : "";
                     item.current1 =