Crunchy
2025-04-29 e5454b769d44a34af423bf87ac8a740bf8c20341
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/temperature-humidity-record.vue
@@ -4,36 +4,38 @@
      <el-col :span="12">
        <div class="header">
          <div>试验区域</div>
          <div>
            名称:
            <el-input v-model="search.testAreaName" clearable size="small" style="width: 120px"></el-input>
            <el-button size="small" type="primary" @click="initData">查询</el-button>
            <el-button size="small" type="primary" @click="clickAdd">新 增</el-button>
          <div style="display: flex;">
            <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
              <span style="width: 48px;font-size: 14px;font-weight: 700;color: #606266;">名称</span>
              <el-input size="small" placeholder="请输入" clearable v-model="search.testAreaName"
                        @keyup.enter.native="initData"></el-input>
            </div>
            <div style="line-height: 30px;">
              <el-button size="mini" type="primary" @click="initData">查询</el-button>
              <el-button size="mini" type="primary" @click="clickAdd">新 增</el-button>
            </div>
          </div>
        </div>
        <el-table :data="tableData" height="calc(100vh - 18em)" highlight-current-row style="width: 100%"
                  :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
          @row-click="clickRow">
          <el-table-column label="序号" type="index" width="60" align="center"></el-table-column>
          <el-table-column label="月度时间" min-width="180" prop="monthDate"></el-table-column>
          <el-table-column label="月度时间" min-width="100" prop="monthDate"></el-table-column>
          <el-table-column label="试验区域名称" min-width="180" prop="testAreaName"></el-table-column>
          <el-table-column label="确认状态" min-width="180" prop="isAffirm">
            <template slot-scope="scope">
              <el-tag type="danger" v-if="scope.row.isAffirm == 0">未确认</el-tag>
              <el-tag type="success" v-if="scope.row.isAffirm == 1">已确认</el-tag>
            </template>
          </el-table-column>
          <el-table-column label="增补信息" min-width="180" prop="subjoin"></el-table-column>
          <el-table-column label="记录员" min-width="120" prop="registrarUserName"></el-table-column>
          <el-table-column label="温度区间" min-width="100" prop="temperatureSection"></el-table-column>
          <el-table-column label="湿度区间" min-width="100" prop="humiditySection"></el-table-column>
          <el-table-column fixed="right" label="操作" min-width="180" align="center">
            <template v-slot="scope">
              <el-button size="small" type="text" @click="downLoadPost(scope.row)">导出</el-button>
              <el-button size="small" type="text" @click="edit(scope.row)">编辑</el-button>
              <el-button :disabled="scope.row.isAffirm === '1'" size="small" type="text"
                @click="openApprovalDialog(scope.row)">确认</el-button>
              <el-button size="small" type="text" @click="deleteRowFun(scope.row)">删除</el-button>
<!--              <el-button size="small" type="text" @click="edit(scope.row)">编辑</el-button>-->
              <el-button  size="small" type="text"
                @click="openApprovalDialog(scope.row)">记录员绑定</el-button>
<!--              <el-button size="small" type="text" @click="deleteRowFun(scope.row)">删除</el-button>-->
            </template>
          </el-table-column>
        </el-table>
        <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
        <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]" background
          :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
          @current-change="handleCurrentChange">
        </el-pagination>
@@ -46,7 +48,8 @@
              增</el-button>
          </div>
        </div>
        <el-table :data="tableData1" height="calc(100vh - 18em)" style="width: 100%">
        <el-table :data="tableData1" height="calc(100vh - 18em)" style="width: 100%"  :row-class-name="tableRowClassName">
                  :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border>
          <el-table-column label="序号" type="index" width="60" align="center"></el-table-column>
          <el-table-column label="日期" min-width="100" prop="recordDate"></el-table-column>
          <el-table-column align="center" label="上午" min-width="200">
@@ -74,7 +77,7 @@
            </template>
          </el-table-column>
        </el-table>
        <el-pagination :current-page="1" :page-size="search1.size" :page-sizes="[10, 20, 30, 50, 100]"
        <el-pagination :current-page="1" :page-size="search1.size" :page-sizes="[10, 20, 30, 50, 100]" background
          :total="search1.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange1"
          @current-change="handleCurrentChange1">
        </el-pagination>
@@ -183,14 +186,19 @@
        <el-button type="primary" :loading="submitLoading" @click="addPowerSupplyStability1">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog :visible.sync="approvalDialog" title="确认" width="30%" @close="subjoin = ''">
      <span>
        增补信息:
        <el-input v-model="subjoin" type="textarea"></el-input>
      </span>
    <el-dialog :visible.sync="approvalDialog" title="记录员绑定" width="30%" @open="openDialog">
      <el-form ref="recordForm" :model="recordForm">
        <el-form-item label="记录员: ">
          <el-select v-model="recordForm.registrarUserId" clearable filterable placeholder="请选择" size="small"
                     style="width: 80%;">
            <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button :loading="approvalLoading" @click="subjoin = '', approvalDialog = false">不确认</el-button>
        <el-button :loading="approvalLoading" type="primary" @click="handleApproval">确 认</el-button>
        <el-button :loading="approvalLoading" @click="approvalDialog = false">取消</el-button>
        <el-button :loading="approvalLoading" type="primary" @click="handleApproval">保存</el-button>
      </span>
    </el-dialog>
  </div>
@@ -234,8 +242,10 @@
      responsibleOptions: [],
      approvalDialog: false,
      approvalLoading: false,
      subjoin: '',
      approvalRow: {},
      recordForm: {
        registrarUserId: ''
      }
    }
  },
  mounted() {
@@ -259,12 +269,13 @@
    openApprovalDialog(row) {
      this.approvalDialog = true
      this.approvalRow = row
      this.recordForm.registrarUserId = row.registrarUserId
    },
    handleApproval() {
      this.approvalLoading = true
      const params = {
        dateId: this.approvalRow.dateId,
        subjoin: this.subjoin,
        registrarUserId: this.recordForm.registrarUserId
      }
      affirmFeTempHumDate(params).then(res => {
        this.approvalLoading = false
@@ -325,6 +336,7 @@
    },
    clickRow(row) {
      this.saveRow = row
      this.search1.current = 1
      this.initData1(row.dateId)
    },
    edit(row) {
@@ -395,6 +407,13 @@
        }
      });
    },
    // 判断温湿度区间变色
    tableRowClassName({row, rowIndex}) {
      if (row.isIssue == 1) {
        return 'warning-row';
      }
      return '';
    },
    handleSizeChange(val) {
      this.search.size = val;
      this.initData();
@@ -405,11 +424,11 @@
    },
    handleSizeChange1(val) {
      this.search1.size = val;
      this.initData1();
      this.initData1(this.saveRow.dateId);
    },
    handleCurrentChange1(val) {
      this.search1.current = val;
      this.initData1();
      this.initData1(this.saveRow.dateId);
    },
    clickAdd() {
      this.dialogVisible = true
@@ -425,4 +444,7 @@
  display: flex;
  justify-content: space-between;
}
>>>.warning-row {
  background: #eea7ae;
}
</style>