licp
2024-12-20 b6d39af78f90623f808198ef9fbb156115aff565
完成设施和环境迁移
已修改1个文件
已添加11个文件
2547 ■■■■■ 文件已修改
src/assets/api/controller.js 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a6-facilities-environment/Personnel-management-dia.vue 211 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a6-facilities-environment/Personnel-management.vue 241 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a6-facilities-environment/external-personnel-management.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a6-facilities-environment/facilities-environmental-conditions.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a6-facilities-environment/facilities-environmental-conditions/illuminance-recording.vue 375 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a6-facilities-environment/facilities-environmental-conditions/lightning-protection-detection.vue 268 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a6-facilities-environment/facilities-environmental-conditions/power-supply-stability.vue 360 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a6-facilities-environment/facilities-environmental-conditions/temperature-humidity-record.vue 390 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a6-facilities-environment/three-wastes-dialog.vue 190 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a6-facilities-environment/three-wastes-treatment.vue 218 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/a6-facilities-environment.vue 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -64,6 +64,9 @@
    processReport,
    processComplain,
    inconsistentDistribution,
    facilitiesAndEnvironment,
    internalWastes,
    foreignRegister,
  }
}
@@ -839,3 +842,53 @@
  delInconsistentDistribution:'/inconsistentDistribution/delInconsistentDistribution', // ä¸ç¬¦åˆé¡¹çš„分布删除
  exportInconsistentDistribution:'/inconsistentDistribution/exportInconsistentDistribution', // å¯¼å‡ºä¸ç¬¦åˆé¡¹çš„分布
}
// 6.3 è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶
const facilitiesAndEnvironment = {
  // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-设施和环境条件要求-照度记录表
  addFeLightningProtection: "/feIllumination/addFeLightningProtection", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-照度记录表-检测区域 æ–°å¢ž/修改
  deleteFeLightningProtection: "/feIllumination/deleteFeLightningProtection", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-照度记录表-检测区域 åˆ é™¤
  getFeLightningProtection: "/feIllumination/getFeLightningProtection", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-照度记录表-检测区域 æŸ¥è¯¢
  deleteFeIlluminationDetectionArea: "/feIllumination/deleteFeIlluminationDetectionArea", // ç…§åº¦è®°å½•表-检测区域 åˆ é™¤
  getFeIlluminationDetectionArea: "/feIllumination/getFeIlluminationDetectionArea", // ç…§åº¦è®°å½•表-检测区域 æ ¹æ®ç…§åº¦è®°å½•查询
  exportFeIllumination: "/feIllumination/exportFeIllumination", // ç…§åº¦è®°å½•表-检测区域 å¯¼å‡º
  // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶-设施和环境条件要求-防雷检测
  addLightningProtectionDetection: "/feLightningProtection/addLightningProtectionDetection", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-防雷检测新增/修改
  deleteLightningProtectionDetection: "/feLightningProtection/deleteLightningProtectionDetection", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-防雷检测删除
  getLightningProtectionDetection: "/feLightningProtection/getLightningProtectionDetection", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-防雷检测查询
  exportOfLightningProtectionDetection: "/feLightningProtection/exportOfLightningProtectionDetection", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-防雷检测导出
  // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶-设施和环境条件要求-电源稳定性
  addLaboratoryFacilityPowerStable: "/fePowerStable/addLaboratoryFacilityPowerStable", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-电源稳定性新增/修改
  deleteLaboratoryFacilityPowerStable: "/fePowerStable/deleteLaboratoryFacilityPowerStable", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-电源稳定性删除
  getLaboratoryFacilityPowerStablePage: "/fePowerStable/getLaboratoryFacilityPowerStablePage", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-电源稳定性查询
  getCalibrationDate: "/fePowerStable/getCalibrationDate", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-电源稳定性 æ–°å¢ž é€‰æ‹©è®¾å¤‡åŽæŸ¥è¯¢æœ€æ–°è®¾å¤‡ç¼–号,校准日期
  deleteFeMeasuredQuantity: "/fePowerStable/deleteFeMeasuredQuantity", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶-设施和环境条件要求-电源稳定性-测定量 åˆ é™¤
  getFeMeasuredQuantityService: "/fePowerStable/getFeMeasuredQuantityService", // ç”µæºç¨³å®šæ€§-测定量 æ ¹æ®ç”µæºç¨³å®šæ€§æŸ¥è¯¢
  exportFePowerStable: "/fePowerStable/exportFePowerStable", // ç”µæºç¨³å®šæ€§-测定量 å¯¼å‡º
  // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶-设施和环境条件要求-温湿度记录
  addFeTempHumDate: "/feTempHumDate/addFeTempHumDate", // è¯•验区域-新增/修改
  deleteFeTempHumDate: "/feTempHumDate/deleteFeTempHumDate", // è¯•验区域-删除
  getFeTempHumDate: "/feTempHumDate/getFeTempHumDate", // è¯•验区域-查询"
  addFeTempHumRecord: "/feTempHumDate/addFeTempHumRecord", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-温湿度记录新增/修改
  deleteFeTempHumRecord: "/feTempHumDate/deleteFeTempHumRecord", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-温湿度记录删除
  getFeTempHumRecordPage: "/feTempHumDate/getFeTempHumRecordPage", // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-温湿度记录查询
  exportTemperatureAndHumidityRecords: '/feTempHumDate/exportTemperatureAndHumidityRecords', // è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-温湿度记录 å¯¼å‡º
}
// 6.3三废处理
const internalWastes = {
  pageInternalWastes: '/internalWastes/pageInternalWastes', // å®‰å…¨å†…务三废处理分页查询
  getInternalWastesOne: '/internalWastes/getInternalWastesOne', // å®‰å…¨å†…务三废处理查看详情
  addInternalWastes: '/internalWastes/addInternalWastes', // å®‰å…¨å†…务三废处理新增
  updateInternalWastes: '/internalWastes/updateInternalWastes', // å®‰å…¨å†…务三废处理分页修改
  delInternalWastes: '/internalWastes/delInternalWastes', // å®‰å…¨å†…务三废处理删除
  exportInternalWastes: '/internalWastes/exportInternalWastes', // å¯¼å‡ºä¸‰åºŸå¤„理
}
// 6.3进出人员登记
const foreignRegister = {
  pageForeignRegister: '/foreignRegister/pageForeignRegister', // å¤–来人员分页查询
  getForeignRegisterOne: '/foreignRegister/getForeignRegisterOne', // å¤–来人员查看详情
  addForeignRegister: '/foreignRegister/addForeignRegister', // å¤–来人员新增
  updateForeignRegister: '/foreignRegister/updateForeignRegister', // å¤–来人员修改
  delForeignRegister: '/foreignRegister/delForeignRegister', // å¤–来人员删除
  exportForeignRegister: '/foreignRegister/exportForeignRegister', // å¯¼å‡ºå¤–来人员
}
src/components/do/a6-facilities-environment/Personnel-management-dia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,211 @@
<template>
  <div>
    <el-dialog v-loading="diaLoading" :close-on-click-modal="false"
               :close-on-press-escape="false"
               :visible.sync="formDia"
               title="外来人员管理信息"
               width="80%" @close="closeThreeWastesDia">
      <el-form ref="form" :model="form" :rules="rules" label-width="auto">
        <el-col :span="12">
          <el-form-item label="日期" prop="registerDate">
            <el-date-picker v-model="form.registerDate"
                            clearable
                            format="yyyy-MM-dd"
                            placeholder="选择日期"
                            size="small"
                            type="date"
                            value-format="yyyy-MM-dd">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="进入区域" prop="area">
            <el-input v-model="form.area" clearable size="small"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="进入人员" prop="personnel">
            <el-input v-model="form.personnel" clearable size="small"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="进入原因" prop="reason">
            <el-input v-model="form.reason" clearable size="small"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="陪同人员" prop="accompanyingId">
            <el-select v-model="form.accompanyingId" clearable filterable
                       placeholder="请选择陪同人员" size="small">
              <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="批准人签名" prop="approveId">
            <el-select v-model="form.approveId" clearable filterable
                       placeholder="请选择批准人" size="small">
              <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="保密及其它情况" prop="confidentiality">
            <el-input v-model="form.confidentiality" clearable size="small"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="备注" prop="remark">
            <el-input v-model="form.remark" clearable size="small"></el-input>
          </el-form-item>
        </el-col>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeThreeWastesDia">取 æ¶ˆ</el-button>
        <el-button :loading="loading" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: 'Personnel-management-dia',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      diaLoading: false,
      loading: false,
      form: {
        registerDate: '',
        area: '',
        personnel: '',
        reason: '',
        accompanyingId: '',
        accompanyingName: '',
        approveId: '',
        approveName: '',
        confidentiality: '',
        remark: '',
      },
      rules: {
        registerDate: [{required: true, message: '请选择日期',trigger: 'change'}],
        area: [{required: true, message: '请填写进入区域',trigger: 'blur'}],
        personnel: [{required: true, message: '请填写进入人员',trigger: 'blur'}],
        reason: [{required: true, message: '请填写进入原因',trigger: 'blur'}],
        accompanyingId: [{required: true, message: '请选择陪同人员',trigger: 'change'}],
        approveId: [{required: true, message: '请选择批准人',trigger: 'change'}],
        confidentiality: [{required: true, message: '请填写保密及其他情况',trigger: 'blur'}],
        remark: [{required: false, message: '请填写备注',trigger: 'blur'}],
      },
      operationType: '',
      personList: []
    };
  },
  mounted() {
  },
  // æ–¹æ³•集合
  methods: {
    // æ‰“开弹框
    openDia (type, row) {
      this.getAuthorizedPerson()
      this.formDia = true
      this.operationType = type
      if (type !== 'add') {
        this.searchInfo(row)
      } else {
        this.form.accompanyingId = JSON.parse(localStorage.getItem("user")).userId
      }
    },
    // æŸ¥è¯¢è¯¦æƒ…
    searchInfo (row) {
      this.diaLoading = true
      this.$axios(this.$api.foreignRegister.getForeignRegisterOne + '?registerId=' + row.registerId).then(res => {
        this.diaLoading = false
        if (res.code === 201) return
        this.form = res.data
      }).catch(err => {
        console.log(err)
        this.diaLoading = false
      })
    },
    // æäº¤å¼¹æ¡†æ•°æ®
    handleEdit () {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          this.loading = true
          const internalImplementDto = this.HaveJson(this.form)
          const index = this.personList.findIndex(item => item.value === internalImplementDto.accompanyingId)
          if (index > -1) {
            internalImplementDto.accompanyingName = this.personList[index].label
          }
          const index1 = this.personList.findIndex(item => item.value === internalImplementDto.approveId)
          if (index1 > -1) {
            internalImplementDto.approveName = this.personList[index].label
          }
          if (this.operationType === 'add') {
            this.$axios.post(this.$api.foreignRegister.addForeignRegister, internalImplementDto, {
              headers: {
                "Content-Type": "application/json"
              },
              noQs: true
            }).then(res => {
              this.loading = false
              if (res.code === 201) return
              this.$message.success('操作成功')
              this.closeThreeWastesDia()
            }).catch(err => {
              console.log('err---', err);
              this.loading = false
            })
          } else if (this.operationType === 'edit') {
            this.$axios.post(this.$api.foreignRegister.updateForeignRegister, internalImplementDto, {
              headers: {
                "Content-Type": "application/json"
              },
              noQs: true
            }).then(res => {
              this.loading = false
              if (res.code === 201) return
              this.$message.success('操作成功')
              this.closeThreeWastesDia()
            }).catch(err => {
              console.log('err---', err);
              this.loading = false
            })
          }
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    closeThreeWastesDia () {
      this.$refs.form.resetFields();
      this.formDia = false
      this.$emit('closeThreeWastesDia')
    },
    getAuthorizedPerson() {
      this.$axios.get(this.$api.user.getUserMenu).then(res => {
        let data = []
        res.data.forEach(a => {
          data.push({
            label: a.name,
            value: a.id
          })
        })
        this.personList = data
      })
    },
  }
};
</script>
<style scoped>
</style>
src/components/do/a6-facilities-environment/Personnel-management.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,241 @@
<template>
  <div>
    <div class="search-background">
      <span class="search-group">
        <span style="width: 160px">日期:</span>
        <el-date-picker v-model="searchForm.registerDate"
                        clearable
                        format="yyyy-MM-dd"
                        placeholder="选择日期"
                        size="small"
                        style="width: 100%"
                        type="date"
                        value-format="yyyy-MM-dd">
            </el-date-picker>
        <el-button size="medium"  style="margin-left: 10px" @click="resetSearchForm">重 ç½®</el-button>
        <el-button size="medium" type="primary" @click="searchList">查 è¯¢</el-button>
      </span>
      <span class="search-group">
        <el-button size="medium" @click="handleDown">导 å‡º</el-button>
        <el-button size="medium" type="primary" @click="openFormDia('add')">新 å¢ž</el-button>
      </span>
    </div>
    <div class="table">
      <ZTTable
        :column="tableColumn"
        :height="'calc(100vh - 20em)'"
        :table-data="tableData"
        :table-loading="tableLoading"
        style="padding: 0 10px;margin-bottom: 16px">
      </ZTTable>
      <el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]"
                     :total="total" layout="->,total, sizes, prev, pager, next, jumper"
                     @size-change="handleSizeChange"
                     @current-change="handleCurrentChange">
      </el-pagination>
    </div>
    <personnel-management-dia v-if="threeWastesDia" ref="threeWastesDia" @closeThreeWastesDia="closeThreeWastesDia"></personnel-management-dia>
  </div>
</template>
<script>
import ZTTable from '../../caorui/ZTTable/index.vue';
import PersonnelManagementDia from './Personnel-management-dia.vue';
import ThreeWastesDialog from './three-wastes-dialog.vue';
export default {
  name: 'Personnel-management',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { ThreeWastesDialog, PersonnelManagementDia, ZTTable },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      searchForm: {
        registerDate: '',
      },
      tableColumn: [
        {
          label: '日期',
          prop: 'registerDate',
          minWidth: '100'
        },
        {
          label: '进入区域',
          prop: 'area',
          minWidth: '100'
        },
        {
          label: '进入人员',
          prop: 'personnel',
          minWidth: '100'
        },
        {
          label: '进入原因',
          prop: 'reason',
          minWidth: '100'
        },
        {
          label: '陪同人员',
          prop: 'accompanyingName',
          minWidth: '100'
        },
        {
          label: '批准人签名',
          prop: 'approveName',
          minWidth: '100'
        },
        {
          label: '保密及其他情况',
          prop: 'confidentiality',
          minWidth: '100'
        },
        {
          label: '备注',
          prop: 'remark',
          minWidth: '100'
        },
        {
          dataType: 'action',
          fixed: 'right',
          minWidth: '220',
          label: '操作',
          operation: [
            {
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.openFormDia('edit', row);
              },
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.delPlan(row)
              },
            }
          ]
        }
      ],
      tableData: [],
      tableLoading: false,
      page: {
        size: 20,
        current: 1,
      },
      total: 0,
      threeWastesDia: false
    };
  },
  mounted() {
    this.searchList()
  },
  // æ–¹æ³•集合
  methods: {
    // æŸ¥è¯¢åˆ—表
    searchList () {
      const entity = this.searchForm
      const page = this.page
      this.tableLoading = true
      this.$axios.post(this.$api.foreignRegister.pageForeignRegister, {entity, page}, {
        headers: {
          "Content-Type": "application/json"
        },
        noQs: true
      }).then(res => {
        this.tableLoading = false
        if (res.code === 201) return
        this.tableData = res.data.records
        this.total = res.data.total
      }).catch(err => {
        console.log('err---', err);
        this.tableLoading = false
      })
    },
    // åˆ é™¤
    delPlan (row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.tableLoading = true
        this.$axios.get(this.$api.foreignRegister.delForeignRegister + '?registerId=' + row.registerId).then(res => {
          this.tableLoading = false
          if (res.code === 201) return
          this.$message.success('删除成功')
          this.searchList()
        }).catch(err => {
          this.tableLoading = false
          console.log('err---', err);
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    // æ–°å¢žï¼Œç¼–辑,批准弹框
    openFormDia (type, row) {
      this.threeWastesDia = true
      this.$nextTick(() => {
        this.$refs.threeWastesDia.openDia(type, row)
      })
    },
    // å¯¼å‡º
    handleDown (row) {
      const entity = this.searchForm
      this.$axios.post(this.$api.foreignRegister.exportForeignRegister,{entity},{
        responseType: "blob",
        headers: {
          "Content-Type": "application/json"
        },
        noQs: true}).then(res => {
        this.outLoading = false
        this.$message.success('导出成功')
        const blob = new Blob([res],{ type: 'application/msword' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = '外来人员登记' + '.docx';
        link.click();
      })
    },
    closeThreeWastesDia () {
      this.threeWastesDia = false
      this.searchList()
    },
    // é‡ç½®æŸ¥è¯¢æ¡ä»¶
    resetSearchForm () {
      this.searchForm.registerDate = '';
      this.searchList()
    },
    // åˆ†é¡µ
    handleSizeChange(val) {
      this.page.size = val;
      this.searchList();
    },
    handleCurrentChange(val) {
      this.page.current = val;
      this.searchList();
    },
  }
};
</script>
<style scoped>
.search-background {
  width: 100%;
  height: 60px;
  line-height: 60px;
  display: flex;
  justify-content: space-between;
}
.search-group {
  display: flex;
  align-items: center;
  margin: 0 20px;
}
</style>
src/components/do/a6-facilities-environment/external-personnel-management.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,124 @@
<style scoped>
  .title {
    height: 60px;
    line-height: 60px;
  }
  .search {
    background-color: #fff;
    height: 30px;
    display: flex;
    align-items: center;
  }
  .search_thing {
    display: flex;
    align-items: center;
    height: 50px;
  }
  .search_label {
    width: 80px;
    font-size: 14px;
    text-align: right;
  }
  .search_input {
    width: calc(100% - 120px);
  }
  .table {
    margin-top: 10px;
    background-color: #fff;
    height: calc(100vh - 18em);
  }
</style>
<template>
  <div class="below-standard-main">
    <div style="width: 100%;height: 100%;">
      <div>
        <el-row class="title">
          <el-col :span="12" style="padding-left: 20px;text-align: left;">外来人员管理</el-col>
          <el-col :span="12" style="text-align: right;">
                        <el-button size="small" type="primary" @click="$refs['ValueTable'].openAddDia('新增接口')" v-if="addPower">新 å¢ž</el-button>
            <el-button size="small" @click="$refs['ValueTable'].openDownDia()">导 å‡º</el-button>
                    </el-col>
        </el-row>
      </div>
      <div class="search">
        <div class="search_thing">
          <div class="search_label">日期:</div>
          <div class="search_input">
            <el-date-picker
              v-model="componentData.entity.sample"
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="date"
              size="small"
              @change="refreshTable()"
              placeholder="选择日期">
            </el-date-picker>
          </div>
        </div>
        <div class="search_thing" style="padding-left: 30px;">
          <el-button size="small" @click="refresh()">重 ç½®</el-button>
          <el-button size="small" type="primary" @click="refreshTable()">查 è¯¢</el-button>
        </div>
      </div>
      <div class="table">
          <ValueTable ref="ValueTable" :url="$api.unPass.pageInsUnPass" :componentData="componentData"
          :key="upIndex" />
      </div>
    </div>
  </div>
</template>
<script>
  import ValueTable from '../../tool/value-table.vue'
export default {
  components: {
    ValueTable,
  },
  data() {
    return {
        componentData: {
          entity: {
            sample: null,
            model: null,
            orderBy: {
              field: 'id',
              order: 'asc'
            }
          },
          isIndex: true,
          showSelect: false,
          select: false,
          do: [],
          tagField: [],
          selectField: [],
          requiredAdd: [],
          requiredUp: []
        },
        entityCopy: {},
        upIndex: 0,
        stateList: [],
        addPower:true,
      }
  },
  mounted() {
    this.entityCopy = this.HaveJson(this.componentData.entity)
    this.getPower()
  },
  methods :{
    refreshTable() {
        this.$refs['ValueTable'].selectList()
      },
    refresh() {
        this.componentData.entity = this.HaveJson(this.entityCopy)
        this.upIndex++
      },
    // æƒé™åˆ†é…
    getPower(radio) {
      let power = JSON.parse(sessionStorage.getItem('power'))
    },
  }
}
</script>
src/components/do/a6-facilities-environment/facilities-environmental-conditions.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,51 @@
<template>
  <el-row>
    <el-col :span="2">
      <el-menu style="height: 100vh;" @select="clickSelect" :default-active="activeName">
        <el-menu-item index="电源稳定性">
          <span slot="title">电源稳定性</span>
        </el-menu-item>
        <el-menu-item index="防雷检测">
          <span slot="title">防雷检测</span>
        </el-menu-item>
        <el-menu-item index="照度记录">
          <span slot="title">照度记录</span>
        </el-menu-item>
        <el-menu-item index="温湿度记录">
          <span slot="title">温湿度记录</span>
        </el-menu-item>
      </el-menu>
    </el-col>
    <el-col :span="22" style="padding: 10px">
      <power-supply-stability v-if="activeName === '电源稳定性'"/>
      <lightning-protection-detection v-if="activeName === '防雷检测'" />
      <illuminance-recording v-if="activeName === '照度记录'"/>
      <temperature-humidity-record v-if="activeName === '温湿度记录'"/>
    </el-col>
  </el-row>
</template>
<script>
// ç”µæºç¨³å®šæ€§
import PowerSupplyStability from "./facilities-environmental-conditions/power-supply-stability.vue";
// é˜²é›·æ£€æµ‹
import LightningProtectionDetection from "./facilities-environmental-conditions/lightning-protection-detection.vue";
// ç…§åº¦è®°å½•
import IlluminanceRecording from "./facilities-environmental-conditions/illuminance-recording.vue";
// æ¸©æ¹¿åº¦è®°å½•
import TemperatureHumidityRecord from "./facilities-environmental-conditions/temperature-humidity-record.vue";
export default {
  components: {TemperatureHumidityRecord, IlluminanceRecording, LightningProtectionDetection, PowerSupplyStability},
  data() {
    return {
      activeName: "电源稳定性"
    }
  },
  methods: {
    clickSelect(index) {
      this.activeName = index;
    }
  }
}
</script>
src/components/do/a6-facilities-environment/facilities-environmental-conditions/illuminance-recording.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,375 @@
<template>
  <div>
    <div class="header">
      <div>照度记录</div>
      <div>
        <el-button type="primary" size="small" @click="clickAdd">新 å¢ž</el-button>
      </div>
    </div>
    <el-table
      :data="tableData"
      style="width: 100%"
      height="calc(100vh - 18em)">
      <el-table-column type="index" label="序号" width="120">
        <template v-slot="scope">
          <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="conclusion" label="结论" min-width="180"></el-table-column>
      <el-table-column prop="testDate" label="测试日期" width="testDate" min-width="180"></el-table-column>
      <el-table-column prop="testerUser" label="检测者" min-width="180"></el-table-column>
      <el-table-column prop="checkerUser" label="核查人" min-width="180"></el-table-column>
      <el-table-column prop="deviceName" label="设备名称" min-width="180"></el-table-column>
      <el-table-column prop="managementNumber" label="设备编号" min-width="180"></el-table-column>
      <el-table-column prop="calibrationDate" label="校准日期" min-width="180"></el-table-column>
      <el-table-column prop="nextCalibrationDate" label="下次校准日期" min-width="180"></el-table-column>
      <el-table-column prop="createTime" label="创建时间" min-width="180"></el-table-column>
      <el-table-column fixed="right" label="操作" min-width="140">
        <template v-slot="scope">
          <el-button type="text" size="small" @click="downLoadPost(scope.row)">导出</el-button>
          <el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>
          <el-button type="text" size="small" @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]"
                   :total="search.total" layout="->,total, sizes, prev, pager, next, jumper"
                   @size-change="handleSizeChange"
                   @current-change="handleCurrentChange">
    </el-pagination>
    <el-dialog
      title="新增"
      :visible.sync="dialogVisible"
      @open="openDialog"
      width="50%">
      <div style="height: 50vh; overflow-y: auto">
        <el-form ref="form" :model="form" label-width="120px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="测试日期" prop="testDate"
                            :rules="[{ required: true, message: '请输入测试地点', trigger: 'change' }]">
                <el-date-picker
                  value-format="yyyy-MM-dd"
                  style="width: 100%"
                  format="yyyy-MM-dd"
                  size="small"
                  v-model="form.testDate"
                  type="date"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="设备名称" prop="deviceId"
                            :rules="[{ required: true, message: '请输入测试地点', trigger: 'change' }]">
                <el-cascader
                  size="small"
                  style="width: 100%"
                  :props="{ expandTrigger: 'hover', emitPath:false }"
                  v-model="form.deviceId"
                  :options="cascaderList"
                  filterable
                  clearable
                  @change="getCalibrationDateFun"
                ></el-cascader>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="设备编号">
                <el-input v-model="form.managementNumber" size="small" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="校准日期">
                <el-input v-model="form.calibrationDate" size="small" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="下次校准日期">
                <el-input v-model="form.nextCalibrationDate" size="small" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="检测者" prop="recipientUser">
                <el-select v-model="form.testerId" filterable placeholder="请选择" clearable
                           size="small" style="width: 100%;">
                  <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="核查人" prop="recipientUser">
                <el-select v-model="form.checkerId" filterable placeholder="请选择" clearable
                           size="small" style="width: 100%;" >
                  <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="结论">
                <el-input
                  type="textarea"
                  :rows="2"
                  placeholder="请输入内容"
                  v-model="form.conclusion">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <div>
            <div style="display: flex; justify-content: flex-end; margin-bottom: 0.5em">
              <el-button type="primary" size="small" @click="feMeasuredQuantityListAdd">新增</el-button>
            </div>
            <div>
              <el-table
                :data="form.illuminationDetectionAreaList"
                style="width: 100%; margin: auto"
                height="40vh">
                <el-table-column type="index" label="序号" width="80"></el-table-column>
                <el-table-column
                  prop="detectionAreaLabel"
                  label="检测区域名称"
                  align="center"
                  min-width="180">
                  <template #default="{ row }">
                    <el-input type="textarea" :rows="1" v-model="row.detectionAreaLabel"></el-input>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="name"
                  label="检测值"
                  align="center"
                  min-width="300">
                  <template>
                    <el-table-column label="第一次" align="center" prop="valueOne" min-width="100">
                      <template #default="{ row }">
                        <el-input :rows="1" v-model="row.valueOne" @blur="getAverage(row)"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column label="第二次" align="center" prop="valueTwo" min-width="100">
                      <template #default="{ row }">
                        <el-input :rows="1" v-model="row.valueTwo" @blur="getAverage(row)"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column label="第三次" align="center" prop="valueThree" min-width="100">
                      <template #default="{ row }">
                        <el-input :rows="1" v-model="row.valueThree" @blur="getAverage(row)"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column label="平均值" align="center" prop="average" min-width="100">
                      <template #default="{ row }">
                        <el-input :rows="1" v-model="row.average"></el-input>
                      </template>
                    </el-table-column>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="detectionAreaLabel"
                  label="备注"
                  align="center"
                  min-width="180">
                  <template #default="{ row }">
                    <el-input type="textarea" :rows="1" v-model="row.remark"></el-input>
                  </template>
                </el-table-column>
                <el-table-column
                  fixed="right"
                  label="操作"
                  width="100">
                  <template slot-scope="scope">
                    <el-button @click="feMeasuredQuantityListDelete(scope.row, scope.$index)" type="text" size="small">
                      åˆ é™¤
                    </el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
    <el-button type="primary" @click="addPowerSupplyStability">ç¡® å®š</el-button>
  </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      search: {
        size: 20,
        current: 1,
        total: 0
      },
      tableData: [],
      dialogVisible: false,
      form: {
        deviceId: null,
        illuminationDetectionAreaList: []
      },
      cascaderList: [],
      responsibleOptions: [],
    }
  },
  mounted() {
    this.initData()
  },
  watch: {
    dialogVisible(newVal) {
      if (!newVal) {
        this.form = {
          deviceId: null,
          illuminationDetectionAreaList: []
        }
      }
    }
  },
  methods: {
    getAverage(row) {
      if (row.valueOne && row.valueTwo && row.valueThree) {
        if (!isNaN(row.valueOne) && !isNaN(row.valueTwo) && !isNaN(row.valueThree)) {
          const avg = Number(row.valueOne) + Number(row.valueTwo) + Number(row.valueThree)
          console.log(avg)
          row.average = Math.round(avg/3);
        } else {
          this.$message.warning("必须为数字!")
        }
      }
    },
    edit(row) {
      this.$axios.get(this.$api.facilitiesAndEnvironment.getFeIlluminationDetectionArea + "?intensityIlluminationId=" + row.intensityIlluminationId).then(res => {
        this.form = {...row}
        this.form.illuminationDetectionAreaList = res.data;
        this.dialogVisible = true
      });
    },
    initData() {
      this.$axios.get(this.$api.facilitiesAndEnvironment.getFeLightningProtection + '?size=' + this.search.size + '&current=' + this.search.current).then(res => {
        if (res.code === 201) return;
        this.tableData = res.data.records;
        this.search.total = res.data.total;
      });
    },
    handleSizeChange(val) {
      this.search.size = val;
      this.initData();
    },
    handleCurrentChange(val) {
      this.search.current = val;
      this.initData();
    },
    deleteRowFun(row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteFeLightningProtection + '?intensityIlluminationId=' + row.intensityIlluminationId).then(res => {
          this.$message.success('删除成功!')
          this.initData()
        })
      })
    },
    feMeasuredQuantityListDelete(row, index) {
      if (row.detectionAreaId) {
        this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteFeIlluminationDetectionArea + '?detectionAreaId=' + row.detectionAreaId).then(res => {
          if (res.code === 201) return
          this.form.illuminationDetectionAreaList.splice(index, 1)
          this.$message.success('删除成功!')
        })
      } else {
        this.form.illuminationDetectionAreaList.splice(index, 1)
        this.$message.success('删除成功!')
      }
    },
    openDialog() {
      this.$axios.get(this.$api.deviceScope.treeDevice).then(res => {
        this.cascaderList = res.data;
      });
      this.$nextTick(() => {
        this.$refs['form'].clearValidate()
      })
      this.getUserList()
    },
    clickAdd() {
      this.dialogVisible = true
    },
    feMeasuredQuantityListAdd() {
      const obj = {
        detectionAreaLabel: null,
        valueOne: null,
        valueTwo: null,
        valueThree: null,
        average: null,
        remark: null,
      }
      this.form.illuminationDetectionAreaList.push(obj)
    },
    addPowerSupplyStability() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$axios.post(this.$api.facilitiesAndEnvironment.addFeLightningProtection, this.form, {
            headers: {
              'Content-Type': 'application/json'
            }
          }).then(res => {
            this.initData()
            this.dialogVisible = false
          })
        }
      });
    },
    // èŽ·å–è´Ÿè´£äººä¿¡æ¯æŽ¥å£
    getUserList() {
      this.$axios.get(this.$api.deviceScope.selectUserList).then(res => {
        if (res.code == 200) {
          this.responsibleOptions = res.data
        }
      })
    },
    getCalibrationDateFun() {
      if (this.form.deviceId) {
        this.$axios.get(this.$api.facilitiesAndEnvironment.getCalibrationDate + '?deviceId=' + this.form.deviceId).then(res => {
          if (res.code === 201) return;
          this.$set(this.form, 'deviceName', res.data.deviceName)
          this.$set(this.form, 'managementNumber', res.data.managementNumber)
          this.$set(this.form, 'calibrationDate', res.data.calibrationDate)
          this.$set(this.form, 'nextCalibrationDate', res.data.nextCalibrationDate)
        });
      } else {
        this.form.deviceName = null
        this.form.managementNumber = null
        this.form.calibrationDate = null
        this.form.nextCalibrationDate = null
      }
    },
    // å¯¼å‡º
    downLoadPost(row) {
      this.$axios.get(this.$api.facilitiesAndEnvironment.exportFeIllumination + '?intensityIlluminationId=' + row.intensityIlluminationId,{responseType: "blob"}).then(res => {
        this.outLoading = false
        this.$message.success('导出成功')
        const blob = new Blob([res],{ type: 'application/msword' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = '照度记录' + '.docx';
        link.click();
      })
    },
  }
}
</script>
<style scoped>
.header {
  height: 3em;
  width: 100%;
  display: flex;
  justify-content: space-between;
}
</style>
src/components/do/a6-facilities-environment/facilities-environmental-conditions/lightning-protection-detection.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,268 @@
<template>
  <div>
    <div class="header">
      <div>防雷检测</div>
      <div>
        <el-button type="primary" size="small" @click="clickAdd">导 å…¥</el-button>
        <el-button type="primary" size="small" @click="downLoadPost">导 å‡º</el-button>
      </div>
    </div>
    <el-table
      :data="tableData"
      style="width: 100%"
      height="calc(100vh - 18em)">
      <el-table-column type="index" label="序号" width="120">
        <template v-slot="scope">
          <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="fileName"
        label="原文件名"
        min-width="180">
      </el-table-column>
      <el-table-column
        prop="detectionDate"
        label="检测日期"
        min-width="180">
      </el-table-column>
      <el-table-column
        prop="termValidity"
        min-width="180"
        label="有效期">
      </el-table-column>
      <el-table-column
        prop="detectionUnit"
        min-width="180"
        label="检测单位">
      </el-table-column>
      <el-table-column fixed="right" label="操作" min-width="100">
        <template v-slot="scope">
          <el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>
          <el-button type="text" size="small" @click="deleteRowFun(scope.row)">删除</el-button>
          <el-button type="text" size="small" @click="download(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]"
                   :total="search.total" layout="->,total, sizes, prev, pager, next, jumper"
                   @size-change="handleSizeChange"
                   @current-change="handleCurrentChange">
    </el-pagination>
    <el-dialog
      title="新 å¢ž"
      :visible.sync="dialogVisible"
      width="50%">
      <div style="height: 50vh;">
        <el-form ref="form" :model="form" label-width="80px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="检测日期" prop="detectionDate"
                            :rules="[{ required: true, message: '请输入测试地点', trigger: 'blur' }]">
                <el-date-picker
                  value-format="yyyy-MM-dd"
                  format="yyyy-MM-dd"
                  style="width: 100%"
                  size="small"
                  v-model="form.detectionDate"
                  type="date"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="有效期" prop="termValidity"
                            :rules="[{ required: true, message: '请输入测试地点', trigger: 'blur' }]">
                <el-date-picker
                  value-format="yyyy-MM-dd"
                  format="yyyy-MM-dd"
                  style="width: 100%"
                  size="small"
                  v-model="form.termValidity"
                  type="date"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="检测单位" prop="detectionUnit"
                            :rules="[{ required: true, message: '请输入测试地点', trigger: 'blur' }]">
                <el-input v-model="form.detectionUnit" size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="检测单位" >
                <el-upload
                  class="upload-demo"
                  drag
                  action="#"
                  :on-remove="handleRemove"
                  :http-request="httpRequest"
                  :file-list="form.fileList"
                  :on-exceed="handleExceed"
                  :limit="1"
                  multiple>
                  <i class="el-icon-upload"></i>
                  <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
                </el-upload>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
    <el-button type="primary" @click="addImport">ç¡® å®š</el-button>
  </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      search: {
        size: 20,
        current: 1,
        total: 0
      },
      tableData: [],
      dialogVisible: false,
      form: {
        fileList: [],
        fileData: []
      },
    }
  },
  mounted() {
    this.initData()
  },
  watch: {
    dialogVisible(newVal) {
      if (!newVal) {
        this.form = {
          fileList: [],
          fileData: []
        }
      }
    }
  },
  methods: {
    // å¯¼å‡º
    downLoadPost() {
      this.$axios.get(this.$api.facilitiesAndEnvironment.exportOfLightningProtectionDetection,{responseType: "blob"}).then(res => {
        this.outLoading = false
        this.$message.success('导出成功')
        const blob = new Blob([res],{ type: 'application/msword' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = '防雷检测导出' + '.xlsx';
        link.click();
      })
    },
    initData() {
      this.$axios.get(this.$api.facilitiesAndEnvironment.getLightningProtectionDetection + '?size=' + this.search.size + '&current=' + this.search.current).then(res => {
        if (res.code === 201) return;
        this.tableData = res.data.records;
        this.search.total = res.data.total;
      });
    },
    handleSizeChange(val) {
      this.search.size = val;
      this.initData();
    },
    handleCurrentChange(val) {
      this.search.current = val;
      this.initData();
    },
    clickAdd() {
      this.dialogVisible = true
    },
    // æ–‡ä»¶æ•°é‡è¿‡å¤šæ—¶æé†’
    handleExceed() {
      this.$message({type: 'error', message: '最多支持1个附件上传'})
    },
    // è¦†ç›–默认的上传行为,可以自定义上传的实现,将上传的文件依次添加到fileList数组中,支持多个文件
    httpRequest(option) {
      this.form.fileData.push(option)
    },
    addImport() {
      console.log(this.form)
      this.$refs.form.validate((valid) => {
        if (valid) {
          let params = new FormData()
          if (this.form.lightningProtectionId) {
            params.append("lightningProtectionId", this.form.lightningProtectionId)
          }
          params.append("termValidity", this.form.termValidity)
          params.append("detectionUnit", this.form.detectionUnit)
          params.append("detectionDate", this.form.detectionDate)
          if (this.form.fileData.length > 0) {
            params.append("file", this.form.fileData[0].file)
          }
          this.$axios.post(this.$api.facilitiesAndEnvironment.addLightningProtectionDetection, params, {
            headers: {'Content-Type': 'multipart/form-data;'},
            noQs: true
          }).then(res => {
            if (res.code === 201) return;
            this.dialogVisible = false
            this.initData()
          });
        }
      });
    },
    edit(row) {
      this.dialogVisible = true
      this.form = {...row}
      this.form.fileList = []
      this.form.fileData = []
      this.form.fileList.push({name: row.systemFileName, url: "123434"})
      console.log(this.form)
    },
    deleteRowFun(row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteLightningProtectionDetection + '?lightningProtectionId=' + row.lightningProtectionId).then(res => {
          this.$message.success('删除成功!')
          this.initData()
        })
      })
    },
    handleRemove(file) {
      this.$axios.delete(this.$api.personnel.deleteCNASFile + "?fileName=" + file.name).then(res => {
        if (res.code === 201) return;
        this.$message.success('删除成功!')
        let index = this.form.fileList.indexOf(fileName)
        if (index != -1) {
          this.successFileList.splice(index, 1)
        }
      })
    },
    download(row) {
      let url = '';
      // fileDownload.downloadIamge(url, row.fileName)
      url = this.javaApi + 'img/' + row.systemFileName
      const link = document.createElement('a');
      link.href = url;
      link.download = row.fileName;
      link.click();
    }
  }
}
</script>
<style scoped>
.header {
  height: 3em;
  width: 100%;
  display: flex;
  justify-content: space-between;
}
</style>
src/components/do/a6-facilities-environment/facilities-environmental-conditions/power-supply-stability.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,360 @@
<template>
  <div>
    <div class="header">
      <div>电源稳定性</div>
      <div>
        <el-button type="primary" size="small" @click="dialogVisible = true">新 å¢ž</el-button>
      </div>
    </div>
    <el-table
      :data="tableData"
      style="width: 100%"
      height="calc(100vh - 18em)">
      <el-table-column type="index" label="序号" width="120">
        <template v-slot="scope">
          <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="testLocation" label="测试地点" min-width="180"></el-table-column>
      <el-table-column prop="testDate" label="测试日期" width="testDate" min-width="180"></el-table-column>
      <el-table-column prop="conclusion" label="结论" min-width="180"></el-table-column>
      <el-table-column prop="testerUser" label="检测者" min-width="180"></el-table-column>
      <el-table-column prop="checkerUser" label="核查人" min-width="180"></el-table-column>
      <el-table-column prop="deviceName" label="设备名称" min-width="180"></el-table-column>
      <el-table-column prop="managementNumber" label="设备编号" min-width="180"></el-table-column>
      <el-table-column prop="calibrationDate" label="校准日期" min-width="180"></el-table-column>
      <el-table-column prop="nextCalibrationDate" label="下次校准日期" min-width="180"></el-table-column>
      <el-table-column prop="createTime" label="创建时间" min-width="180"></el-table-column>
      <el-table-column fixed="right" label="操作" min-width="140">
        <template v-slot="scope">
          <el-button type="text" size="small" @click="downLoadPost(scope.row)">导出</el-button>
          <el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>
          <el-button type="text" size="small" @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]"
                   :total="search.total" layout="->,total, sizes, prev, pager, next, jumper"
                   @size-change="handleSizeChange"
                   @current-change="handleCurrentChange">
    </el-pagination>
    <el-dialog
      title="新增"
      :visible.sync="dialogVisible"
      @open="openDialog"
      width="50%">
      <div style="height: 50vh; overflow-y: auto">
        <el-form ref="form" :model="form" label-width="120px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="测试地点" prop="testLocation"
                            :rules="[{ required: true, message: '请输入测试地点', trigger: 'blur' }]">
                <el-input v-model="form.testLocation" size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="测试日期" prop="testDate"
                            :rules="[{ required: true, message: '请输入测试地点', trigger: 'change' }]">
                <el-date-picker
                  value-format="yyyy-MM-dd"
                  style="width: 100%"
                  format="yyyy-MM-dd"
                  size="small"
                  v-model="form.testDate"
                  type="date"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="设备名称" prop="deviceId"
                            :rules="[{ required: true, message: '请输入测试地点', trigger: 'change' }]">
                <el-cascader
                  size="small"
                  style="width: 100%"
                  :props="{ expandTrigger: 'hover', emitPath:false }"
                  v-model="form.deviceId"
                  :options="cascaderList"
                  filterable
                  clearable
                  @change="getCalibrationDateFun"
                ></el-cascader>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="设备编号">
                <el-input v-model="form.managementNumber" size="small" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="校准日期">
                <el-input v-model="form.calibrationDate" size="small" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="下次校准日期">
                <el-input v-model="form.nextCalibrationDate" size="small" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="检测者" prop="recipientUser">
                <el-select v-model="form.testerId" filterable placeholder="请选择" clearable
                           size="small" style="width: 100%;">
                  <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="核查人" prop="recipientUser">
                <el-select v-model="form.checkerId" filterable placeholder="请选择" clearable
                           size="small" style="width: 100%;" >
                  <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="结论">
                <el-input
                  type="textarea"
                  :rows="2"
                  placeholder="请输入内容"
                  v-model="form.conclusion">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <div>
            <div style="display: flex; justify-content: flex-end; margin-bottom: 0.5em">
              <el-button type="primary" size="small" @click="feMeasuredQuantityListAdd">新增</el-button>
            </div>
            <div>
              <el-table
                :data="form.feMeasuredQuantityList"
                style="width: 100%; margin: auto"
                height="40vh">
                <el-table-column type="index" label="序号" width="80"></el-table-column>
                <el-table-column
                  prop="measuredQuantityLabel"
                  label="测定量名称"
                  align="center"
                  min-width="180">
                  <template #default="{ row }">
                    <el-input type="textarea" :rows="1" v-model="row.measuredQuantityLabel"></el-input>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="name"
                  label="值"
                  align="center"
                  min-width="300">
                  <template>
                    <el-table-column label="A" align="center" prop="valueA" min-width="100">
                      <template #default="{ row }">
                        <el-input :rows="1" v-model="row.valueA"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column label="B" align="center" prop="valueB" min-width="100">
                      <template #default="{ row }">
                        <el-input :rows="1" v-model="row.valueB"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column label="C" align="center" prop="valueC" min-width="100">
                      <template #default="{ row }">
                        <el-input :rows="1" v-model="row.valueC"></el-input>
                      </template>
                    </el-table-column>
                  </template>
                </el-table-column>
                <el-table-column
                  fixed="right"
                  label="操作"
                  width="100">
                  <template slot-scope="scope">
                    <el-button @click="feMeasuredQuantityListDelete(scope.row, scope.$index)" type="text" size="small">
                      åˆ é™¤
                    </el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
    <el-button type="primary" @click="addPowerSupplyStability">ç¡® å®š</el-button>
  </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      search: {
        size: 20,
        current: 1,
        total: 0
      },
      tableData: [],
      dialogVisible: false,
      form: {
        deviceId: null,
        feMeasuredQuantityList: []
      },
      cascaderList: [],
      responsibleOptions: []
    }
  },
  mounted() {
    this.initData()
  },
  watch: {
    dialogVisible(newVal) {
      if (!newVal) {
        this.form = {
          deviceId: null,
          feMeasuredQuantityList: []
        }
      }
    }
  },
  methods: {
    // åˆå§‹åŒ–调用
    initData() {
      this.$axios.get(this.$api.facilitiesAndEnvironment.getLaboratoryFacilityPowerStablePage + '?size=' + this.search.size + '&current=' + this.search.current).then(res => {
        if (res.code === 201) return;
        this.tableData = res.data.records;
        this.search.total = res.data.total;
      });
    },
    handleSizeChange(val) {
      this.search.size = val;
      this.initData();
    },
    handleCurrentChange(val) {
      this.search.current = val;
      this.initData();
    },
    // ç”µæºç¨³å®šæ€§ è¡¨æ ¼ä¸­çš„行删除按钮
    deleteRowFun(row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteLaboratoryFacilityPowerStable + '?powerStableId=' + row.powerStableId).then(res => {
          this.$message.success('删除成功!')
          this.initData()
        })
      })
    },
    // ç”µæºç¨³å®šæ€§-打开弹框调用设备接口,查询使用的设备
    openDialog() {
      this.$axios.get(this.$api.deviceScope.treeDevice).then(res => {
        this.cascaderList = res.data;
      });
      this.$nextTick(() => {
        this.$refs['form'].clearValidate()
      })
      this.getUserList()
    },
    // ç”µæºç¨³å®šæ€§-弹框的选择设备后调用接口,查询设备编号,校准日期,下次校准日期
    getCalibrationDateFun() {
      if (this.form.deviceId) {
        this.$axios.get(this.$api.facilitiesAndEnvironment.getCalibrationDate + '?deviceId=' + this.form.deviceId).then(res => {
          if (res.code === 201) return;
          this.$set(this.form, 'deviceName', res.data.deviceName)
          this.$set(this.form, 'managementNumber', res.data.managementNumber)
          this.$set(this.form, 'calibrationDate', res.data.calibrationDate)
          this.$set(this.form, 'nextCalibrationDate', res.data.nextCalibrationDate)
        });
      } else {
        this.form.deviceName = null
        this.form.managementNumber = null
        this.form.calibrationDate = null
        this.form.nextCalibrationDate = null
      }
    },
    // ç”µæºç¨³å®šæ€§-测定量弹框中表格的删除行
    feMeasuredQuantityListDelete(row, index) {
      if (row.measuredQuantityId) {
        this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteFeMeasuredQuantity + '?measuredQuantityId=' + row.measuredQuantityId).then(res => {
          if (res.code === 201) return
          this.form.feMeasuredQuantityList.splice(index, 1)
          this.$message.success('删除成功!')
        })
      } else {
        this.form.feMeasuredQuantityList.splice(index, 1)
        this.$message.success('删除成功!')
      }
    },
    // ç”µæºç¨³å®šæ€§-测定量表格新增行
    feMeasuredQuantityListAdd() {
      const obj = {
        measuredQuantityLabel: null,
        valueA: null,
        valueB: null,
        valueC: null,
      }
      this.form.feMeasuredQuantityList.push(obj)
    },
    // ç”µæºç¨³å®šæ€§ æ–°å¢ž
    addPowerSupplyStability() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$axios.post(this.$api.facilitiesAndEnvironment.addLaboratoryFacilityPowerStable, this.form, {
            headers: {
              'Content-Type': 'application/json'
            }
          }).then(res => {
            this.initData()
            this.dialogVisible = false
          })
        }
      });
    },
    // å¯¼å‡º
    downLoadPost(row) {
      this.$axios.get(this.$api.facilitiesAndEnvironment.exportFePowerStable + '?powerStableId=' + row.powerStableId,{responseType: "blob"}).then(res => {
        this.outLoading = false
        this.$message.success('导出成功')
        const blob = new Blob([res],{ type: 'application/msword' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = '电源稳定性' + '.docx';
        link.click();
      })
    },
    // ç”µæºç¨³å®šæ€§ ç‚¹å‡»è¡Œç¼–辑触发
    edit(row) {
      this.$axios.get(this.$api.facilitiesAndEnvironment.getFeMeasuredQuantityService + "?powerStableId=" + row.powerStableId).then(res => {
        this.form = {...row}
        this.form.feMeasuredQuantityList = res.data;
        this.dialogVisible = true
      });
    },
    // èŽ·å–è´Ÿè´£äººä¿¡æ¯æŽ¥å£
    getUserList() {
      this.$axios.get(this.$api.deviceScope.selectUserList).then(res => {
        if (res.code == 200) {
          this.responsibleOptions = res.data
        }
      })
    },
  }
}
</script>
<style scoped>
.header {
  height: 3em;
  width: 100%;
  display: flex;
  justify-content: space-between;
}
</style>
src/components/do/a6-facilities-environment/facilities-environmental-conditions/temperature-humidity-record.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,390 @@
<template>
  <div>
    <el-row :gutter="20">
      <el-col :span="12">
        <div class="header">
          <div>试验区域</div>
          <div>
            <el-button type="primary" size="small" @click="clickAdd">新 å¢ž</el-button>
          </div>
        </div>
        <el-table
          :data="tableData"
          style="width: 100%"
          @row-click="clickRow"
          highlight-current-row
          height="calc(100vh - 18em)">
          <el-table-column type="index" label="序号" width="80">
            <template v-slot="scope">
              <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="monthDate" label="月度时间" min-width="180"></el-table-column>
          <el-table-column prop="testAreaName" label="试验区域名称" min-width="180"></el-table-column>
          <el-table-column prop="createTime" label="创建时间" min-width="180"></el-table-column>
          <el-table-column prop="createName" label="创建人" min-width="180"></el-table-column>
          <el-table-column fixed="right" label="操作" min-width="140">
            <template v-slot="scope">
              <el-button type="text" size="small" @click="downLoadPost(scope.row)">导出</el-button>
              <el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>
              <el-button type="text" size="small" @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]"
                       :total="search.total" layout="->,total, sizes, prev, pager, next, jumper"
                       @size-change="handleSizeChange"
                       @current-change="handleCurrentChange">
        </el-pagination>
      </el-col>
      <el-col :span="12">
        <div class="header">
          <div>温湿度记录:{{ saveRow.monthDate }}</div>
          <div>
            <el-button type="primary" size="small" v-if="saveRow.monthDate" @click="dialogVisible1 = true">新 å¢ž</el-button>
          </div>
        </div>
        <el-table
          :data="tableData1"
          style="width: 100%"
          height="calc(100vh - 18em)">
          <el-table-column type="index" label="序号" width="80">
            <template v-slot="scope">
              <span>{{ (search1.current - 1) * search1.size + scope.$index + 1 }}</span>
            </template>
          </el-table-column>
          <el-table-column label="上午" min-width="200" align="center">
            <template>
              <el-table-column prop="morningTestTime" label="时间" min-width="110" show-overflow-tooltip></el-table-column>
              <el-table-column prop="morningTemp" label="温度" min-width="80" show-overflow-tooltip></el-table-column>
              <el-table-column prop="morningHum" label="湿度" min-width="80" show-overflow-tooltip></el-table-column>
            </template>
          </el-table-column>
          <el-table-column prop="morningRecorderUser" label="记录员" min-width="100"></el-table-column>
          <el-table-column label="下午" min-width="200" align="center">
            <template>
              <el-table-column prop="afternoonTime" label="时间" min-width="110" show-overflow-tooltip></el-table-column>
              <el-table-column prop="afternoonTemp" label="温度" min-width="80" show-overflow-tooltip></el-table-column>
              <el-table-column prop="afternoonHum" label="湿度" min-width="80" show-overflow-tooltip></el-table-column>
            </template>
          </el-table-column>
          <el-table-column prop="afternoonRecorderUser" label="记录员" min-width="100"></el-table-column>
          <el-table-column prop="note" label="备注" show-overflow-tooltip min-width="100"></el-table-column>
          <el-table-column fixed="right" label="操作" min-width="100">
            <template v-slot="scope">
              <el-button type="text" size="small" @click="edit1(scope.row)">编辑</el-button>
              <el-button type="text" size="small" @click="deleteRowFun1(scope.row)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination :current-page="1" :page-size="search1.size" :page-sizes="[10, 20, 30, 50, 100]"
                       :total="search1.total" layout="->,total, sizes, prev, pager, next, jumper"
                       @size-change="handleSizeChange1"
                       @current-change="handleCurrentChange1">
        </el-pagination>
      </el-col>
    </el-row>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="50%">
      <div style="height: 20vh;">
        <el-form ref="form" :model="form" label-width="80px">
          <el-row>
            <el-col :span="24">
              <el-form-item label="月度时间" prop="monthDate"
                            :rules="[{ required: true, message: '请输入月度时间', trigger: 'blur' }]">
                <el-date-picker
                  value-format="yyyy-MM-dd"
                  style="width: 100%"
                  format="yyyy-MM-dd"
                  size="small"
                  v-model="form.monthDate"
                  type="date"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="试验区域" prop="testAreaName"
                            :rules="[{ required: true, message: '请输入试验区域', trigger: 'blur' }]">
                <el-input v-model="form.testAreaName"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
    <el-button type="primary" @click="addPowerSupplyStability">ç¡® å®š</el-button>
  </span>
    </el-dialog>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible1"
      @open="openDialog"
      width="50%">
      <div style="height: 40vh;">
        <el-form ref="form1" :model="form1" label-width="120px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="上午时间">
                <el-date-picker
                  value-format="yyyy-MM-dd hh:mm:ss"
                  style="width: 100%"
                  format="yyyy-MM-dd hh:mm:ss"
                  size="small"
                  v-model="form1.morningTestTime"
                  type="datetime"
                  placeholder="请选择时间">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="上午温度">
                <el-input v-model="form1.morningTemp" size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="上午湿度">
                <el-input v-model="form1.morningHum" size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="上午记录员">
                <el-select v-model="form1.morningRecorderId" filterable placeholder="请选择" clearable
                           size="small" style="width: 100%;">
                  <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="下午时间">
                <el-date-picker
                  value-format="yyyy-MM-dd hh:mm:ss"
                  style="width: 100%"
                  format="yyyy-MM-dd hh:mm:ss"
                  size="small"
                  v-model="form1.afternoonTime"
                  type="datetime"
                  placeholder="请选择时间">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="下午温度">
                <el-input v-model="form1.afternoonTemp" size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="下午湿度">
                <el-input v-model="form1.afternoonHum" size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="下午记录员">
                <el-select v-model="form1.afternoonRecorderId" filterable placeholder="请选择" clearable
                           size="small" style="width: 100%;">
                  <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="备注">
                <el-input
                  type="textarea"
                  :rows="2"
                  placeholder="请输入内容"
                  v-model="form1.note">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible1 = false">取 æ¶ˆ</el-button>
    <el-button type="primary" @click="addPowerSupplyStability1">ç¡® å®š</el-button>
  </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      search: {
        size: 20,
        current: 1,
        total: 0
      },
      search1: {
        size: 20,
        current: 1,
        total: 0
      },
      tableData: [],
      tableData1: [],
      dialogVisible: false,
      dialogVisible1: false,
      form: {},
      form1: {},
      saveRow: {},
      responsibleOptions: []
    }
  },
  mounted() {
    this.initData()
  },
  watch: {
    dialogVisible(newVal) {
      if (!newVal) {
        this.form = {
        }
      }
    },
    dialogVisible1(newVal) {
      if (!newVal) {
        this.form1 = {
        }
      }
    }
  },
  methods: {
    // å¯¼å‡º
    downLoadPost(row) {
      this.$axios.get(this.$api.facilitiesAndEnvironment.exportTemperatureAndHumidityRecords + '?dateId=' + row.dateId,{responseType: "blob"}).then(res => {
        this.outLoading = false
        this.$message.success('导出成功')
        const blob = new Blob([res],{ type: 'application/msword' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = '温湿度记录' + '.docx';
        link.click();
      })
    },
    openDialog() {
      this.$axios.get(this.$api.deviceScope.selectUserList).then(res => {
        if (res.code == 200) {
          this.responsibleOptions = res.data
        }
      })
    },
    addPowerSupplyStability() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$axios.post(this.$api.facilitiesAndEnvironment.addFeTempHumDate, this.form, {
            headers: {
              'Content-Type': 'application/json'
            }
          }).then(res => {
            this.initData()
            this.dialogVisible = false
          })
        }
      });
    },
    addPowerSupplyStability1() {
      if (!this.saveRow) {
        this.$message.warning("请选择试验区域!")
        return
      }
      this.$refs.form1.validate((valid) => {
        if (valid) {
          this.form1.dateId = this.saveRow.dateId
          this.$axios.post(this.$api.facilitiesAndEnvironment.addFeTempHumRecord, this.form1, {
            headers: {
              'Content-Type': 'application/json'
            }
          }).then(res => {
            this.initData1(this.saveRow.dateId)
            this.dialogVisible1 = false
          })
        }
      });
    },
    clickRow(row) {
      this.saveRow = row
      this.initData1(row.dateId)
    },
    edit(row) {
      this.form = {...row}
      this.dialogVisible = true
    },
    deleteRowFun(row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteFeTempHumDate + '?dateId=' + row.dateId).then(res => {
          this.$message.success('删除成功!')
          this.initData()
        })
      })
    },
    edit1(row) {
      this.form1 = {...row}
      this.dialogVisible1 = true
    },
    deleteRowFun1(row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteFeTempHumRecord + '?tempHumId=' + row.tempHumId).then(res => {
          this.$message.success('删除成功!')
          this.initData1(this.saveRow.dateId)
        })
      })
    },
    initData() {
      this.$axios.get(this.$api.facilitiesAndEnvironment.getFeTempHumDate + '?size=' + this.search.size + '&current=' + this.search.current).then(res => {
        if (res.code === 201) return;
        this.tableData = res.data.records;
        this.search.total = res.data.total;
      });
    },
    initData1(dateId) {
      this.$axios.get(this.$api.facilitiesAndEnvironment.getFeTempHumRecordPage + '?size=' + this.search1.size + '&current=' + this.search1.current + '&dateId=' + dateId).then(res => {
        if (res.code === 201) return;
        this.tableData1 = res.data.records;
        this.search1.total = res.data.total;
      });
    },
    handleSizeChange(val) {
      this.search.size = val;
      this.initData();
    },
    handleCurrentChange(val) {
      this.search.current = val;
      this.initData();
    },
    handleSizeChange1(val) {
      this.search1.size = val;
      this.initData1();
    },
    handleCurrentChange1(val) {
      this.search1.current = val;
      this.initData1();
    },
    clickAdd() {
      this.dialogVisible = true
    }
  }
}
</script>
<style scoped>
.header {
  height: 3em;
  width: 100%;
  display: flex;
  justify-content: space-between;
}
</style>
src/components/do/a6-facilities-environment/three-wastes-dialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,190 @@
<template>
  <div>
    <el-dialog v-loading="diaLoading" :close-on-click-modal="false"
               :close-on-press-escape="false"
               :visible.sync="formDia"
               title="三废处理信息"
               width="80%" @close="closeThreeWastesDia">
      <el-form ref="form" :model="form" :rules="rules" label-width="auto">
        <el-col :span="24">
          <el-form-item label="备注" prop="purposes">
            <el-input v-model="form.remark" clearable size="small"></el-input>
          </el-form-item>
        </el-col>
      </el-form>
      <div style="text-align: right;margin-bottom: 10px">
        <el-button size="small" type="primary" @click="addRow">添加</el-button>
        <el-button size="small" type="danger" @click="clearTable">清空</el-button>
      </div>
      <el-table :data="wastesDetailList" border height="300" style="width: 100%">
        <el-table-column align="center" label="序号" type="index" width="60" />
        <el-table-column header-align="center" label="接收人" prop="acceptor">
          <template slot-scope="{row}">
            <el-input v-model="row.acceptor" size="small"/>
          </template>
        </el-table-column>
        <el-table-column header-align="center" label="接收单位" prop="receivingUnit">
          <template slot-scope="{row}">
            <el-input v-model="row.receivingUnit" size="small"/>
          </template>
        </el-table-column>
        <el-table-column header-align="center" label="名称" prop="designation">
          <template slot-scope="{row}">
            <el-input v-model="row.designation" size="small"/>
          </template>
        </el-table-column>
        <el-table-column header-align="center" label="移交人" prop="transferPeople" width="180">
          <template slot-scope="{row}">
            <el-input v-model="row.transferPeople" size="small"/>
          </template>
        </el-table-column>
        <el-table-column header-align="center" label="体积" prop="volume" width="180">
          <template slot-scope="{row}">
            <el-input v-model="row.volume" size="small"/>
          </template>
        </el-table-column>
        <el-table-column header-align="center" label="送处理日期" prop="deliveryDate" width="180">
          <template slot-scope="{row}">
            <!-- <el-input v-model="row.deliveryDate" size="small"/> -->
            <el-date-picker
                value-format="yyyy-MM-dd"
                style="width: 100%"
                format="yyyy-MM-dd"
                size="small"
                v-model="row.deliveryDate"
                type="date"
                placeholder="选择日期">
              </el-date-picker>
          </template>
        </el-table-column>
      </el-table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeThreeWastesDia">取 æ¶ˆ</el-button>
        <el-button :loading="loading" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: 'three-wastes-dialog',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      diaLoading: false,
      loading: false,
      form: {
        remark: '',
        wastesId: '',
      },
      rules: {
        remark: [{required: false, message: '请填写备注',trigger: 'blur'}],
      },
      wastesDetailList: [],
      operationType: '',
    };
  },
  mounted() {
  },
  // æ–¹æ³•集合
  methods: {
    // æ‰“开弹框
    openDia (type, row) {
      this.formDia = true
      this.operationType = type
      if (type !== 'add') {
        this.searchInfo(row)
      }
    },
    // æŸ¥è¯¢è¯¦æƒ…
    searchInfo (row) {
      this.diaLoading = true
      this.$axios(this.$api.internalWastes.getInternalWastesOne + '?wastesId=' + row.wastesId).then(res => {
        this.diaLoading = false
        if (res.code === 201) return
        this.form = res.data
        this.wastesDetailList = this.form.wastesDetailList
      }).catch(err => {
        console.log(err)
        this.diaLoading = false
      })
    },
    // æäº¤å¼¹æ¡†æ•°æ®
    handleEdit () {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          if (this.wastesDetailList.length === 0) {
            this.$message.warning('请添加表格数据')
            return
          }
          this.loading = true
          const internalImplementDto = this.HaveJson(this.form)
          internalImplementDto.wastesDetailList = this.HaveJson(this.wastesDetailList)
          if (this.operationType === 'add') {
            this.$axios.post(this.$api.internalWastes.addInternalWastes, internalImplementDto, {
              headers: {
                "Content-Type": "application/json"
              },
              noQs: true
            }).then(res => {
              this.loading = false
              if (res.code === 201) return
              this.$message.success('操作成功')
              this.closeThreeWastesDia()
            }).catch(err => {
              console.log('err---', err);
              this.loading = false
            })
          } else if (this.operationType === 'edit') {
            this.$axios.post(this.$api.internalWastes.updateInternalWastes, internalImplementDto, {
              headers: {
                "Content-Type": "application/json"
              },
              noQs: true
            }).then(res => {
              this.loading = false
              if (res.code === 201) return
              this.$message.success('操作成功')
              this.closeThreeWastesDia()
            }).catch(err => {
              console.log('err---', err);
              this.loading = false
            })
          }
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    // å¢žåŠ è¡¨æ ¼è¡Œæ•°æ®
    addRow () {
      this.wastesDetailList.push({
        acceptor: '',
        receivingUnit: '',
        designation: '',
        transferPeople: '',
        volume: '',
        deliveryDate: '',
      })
    },
    // æ¸…空表格数据
    clearTable () {
      this.wastesDetailList = []
    },
    closeThreeWastesDia () {
      this.$refs.form.resetFields();
      this.formDia = false
      this.$emit('closeThreeWastesDia')
    },
  }
};
</script>
<style scoped>
</style>
src/components/do/a6-facilities-environment/three-wastes-treatment.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,218 @@
<template>
  <div>
    <div class="search-background">
      <span class="search-group">
        <span style="width: 160px">备注:</span>
        <el-input v-model="searchForm.remark" clearable size="small"></el-input>
        <el-button size="medium"  style="margin-left: 10px" @click="resetSearchForm">重 ç½®</el-button>
        <el-button size="medium" type="primary" @click="searchList">查 è¯¢</el-button>
      </span>
      <span class="search-group">
        <el-button size="medium" type="primary" @click="openFormDia('add')">新 å¢ž</el-button>
      </span>
    </div>
    <div class="table">
      <ZTTable
        :column="tableColumn"
        :height="'calc(100vh - 20em)'"
        :table-data="tableData"
        :table-loading="tableLoading"
        style="padding: 0 10px;margin-bottom: 16px">
      </ZTTable>
      <el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]"
                     :total="total" layout="->,total, sizes, prev, pager, next, jumper"
                     @size-change="handleSizeChange"
                     @current-change="handleCurrentChange">
      </el-pagination>
    </div>
    <three-wastes-dialog v-if="threeWastesDia" ref="threeWastesDia" @closeThreeWastesDia="closeThreeWastesDia"></three-wastes-dialog>
  </div>
</template>
<script>
import ZTTable from '../../caorui/ZTTable/index.vue';
import ThreeWastesDialog from './three-wastes-dialog.vue';
import ImplementPlanDia from '../a8-internal-audit-management/implementPlanDia.vue';
export default {
  name: 'a6-three-wastes-treatment',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { ImplementPlanDia, ThreeWastesDialog, ZTTable },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      searchForm: {
        remark: '',
      },
      tableColumn: [
        {
          label: '创建时间',
          prop: 'createTime',
          minWidth: '100'
        },
        {
          label: '创建人',
          prop: 'createUser',
          minWidth: '100'
        },
        {
          label: '备注',
          prop: 'remark',
          minWidth: '100'
        },
        {
          label: '修改时间',
          prop: 'updateTime',
          minWidth: '100'
        },
        {
          label: '修改人',
          prop: 'updateUser',
          minWidth: '100'
        },
        {
          dataType: 'action',
          fixed: 'right',
          minWidth: '220',
          label: '操作',
          operation: [
            {
              name: '导出',
              type: 'text',
              clickFun: (row) => {
                this.handleDown(row)
              }
            },
            {
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.openFormDia('edit', row);
              },
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.delPlan(row)
              },
            }
          ]
        }
      ],
      tableData: [],
      tableLoading: false,
      page: {
        size: 20,
        current: 1,
      },
      total: 0,
      threeWastesDia: false
    };
  },
  mounted() {
    this.searchList()
  },
  // æ–¹æ³•集合
  methods: {
    // æŸ¥è¯¢åˆ—表
    searchList () {
      const entity = this.searchForm
      const page = this.page
      this.tableLoading = true
      this.$axios.post(this.$api.internalWastes.pageInternalWastes, {entity, page}, {
        headers: {
          "Content-Type": "application/json"
        },
        noQs: true
      }).then(res => {
        this.tableLoading = false
        if (res.code === 201) return
        this.tableData = res.data.records
        this.total = res.data.total
      }).catch(err => {
        console.log('err---', err);
        this.tableLoading = false
      })
    },
    // åˆ é™¤
    delPlan (row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.tableLoading = true
        this.$axios.get(this.$api.internalWastes.delInternalWastes + '?wastesId=' + row.wastesId).then(res => {
          this.tableLoading = false
          if (res.code === 201) return
          this.$message.success('删除成功')
          this.searchList()
        }).catch(err => {
          this.tableLoading = false
          console.log('err---', err);
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    // æ–°å¢žï¼Œç¼–辑,批准弹框
    openFormDia (type, row) {
      this.threeWastesDia = true
      this.$nextTick(() => {
        this.$refs.threeWastesDia.openDia(type, row)
      })
    },
    // å¯¼å‡º
    handleDown (row) {
      this.$axios.get(this.$api.internalWastes.exportInternalWastes + '?wastesId=' + row.wastesId,{responseType: "blob"}).then(res => {
        this.outLoading = false
        this.$message.success('导出成功')
        const blob = new Blob([res],{ type: 'application/msword' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = '三废处理导出' + '.docx';
        link.click();
      })
    },
    closeThreeWastesDia () {
      this.threeWastesDia = false
      this.searchList()
    },
    // é‡ç½®æŸ¥è¯¢æ¡ä»¶
    resetSearchForm () {
      this.searchForm.remark = '';
      this.searchList()
    },
    // åˆ†é¡µ
    handleSizeChange(val) {
      this.page.size = val;
      this.searchList();
    },
    handleCurrentChange(val) {
      this.page.current = val;
      this.searchList();
    },
  }
};
</script>
<style scoped>
.search-background {
  width: 100%;
  height: 60px;
  line-height: 60px;
  display: flex;
  justify-content: space-between;
}
.search-group {
  display: flex;
  align-items: center;
  margin: 0 20px;
}
</style>
src/components/view/a6-facilities-environment.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,66 @@
<template>
  <div class="main">
    <el-tabs v-model="activeName" :lazy="true" type="border-card">
<!--      <el-tab-pane label="外来人员管理" name="外来人员管理">-->
<!--        <ExternalPersonnelManagement v-if="activeName === '外来人员管理'"/>-->
<!--      </el-tab-pane>-->
<!--      <el-tab-pane label="实验室设施场所信息" name="实验室设施场所信息">-->
<!--        ç©º-->
<!--      </el-tab-pane>-->
      <el-tab-pane label="设施和环境条件要求" name="设施和环境条件要求">
        <FacilitiesEnvironmentalConditions v-if="activeName === '设施和环境条件要求'"/>
      </el-tab-pane>
<!--      <el-tab-pane label="环境条件引用" name="环境条件引用">-->
<!--        ç©º-->
<!--      </el-tab-pane>-->
<!--      <el-tab-pane label="安全区代表检查" name="安全区代表检查">-->
<!--        ç©º-->
<!--      </el-tab-pane>-->
<!--      <el-tab-pane label="安全内务" name="安全内务">-->
<!--        ç©º-->
<!--      </el-tab-pane>-->
<!--      <el-tab-pane label="废物处理交接记录" name="废物处理交接记录">-->
<!--        ç©º-->
<!--      </el-tab-pane>-->
      <el-tab-pane label="三废处理" name="三废处理">
        <a6-three-wastes-treatment v-if="activeName === '三废处理'"></a6-three-wastes-treatment>
      </el-tab-pane>
      <el-tab-pane label="进出人员管理" name="进出人员管理">
        <personnel-management v-if="activeName === '进出人员管理'"></personnel-management>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import FacilitiesEnvironmentalConditions from "../do/a6-facilities-environment/facilities-environmental-conditions.vue";
// å¤–来人员管理
import ExternalPersonnelManagement from "../do/a6-facilities-environment/external-personnel-management.vue";
import A6ThreeWastesTreatment from '../do/a6-facilities-environment/three-wastes-treatment.vue';
import PersonnelManagement from '../do/a6-facilities-environment/Personnel-management.vue';
export default {
  components: {
    PersonnelManagement,
    A6ThreeWastesTreatment,
    ExternalPersonnelManagement,
    FacilitiesEnvironmentalConditions},
  data() {
    return {
      activeName: '设施和环境条件要求',
    }
  }
}
</script>
<style scoped>
.main {
  padding: 15px 0;
  width: 100%;
  border-radius: 15px;
}
/deep/ .el-tabs--border-card>.el-tabs__content {
  height: calc(100vh - 9em);
  padding: 0;
}
</style>