chenrui
2025-02-25 2721b8590f44d55b98bd77d5fd687ab4452358b6
设施和环境条件代码迁移
已修改1个文件
已添加11个文件
2616 ■■■■■ 文件已修改
src/api/cnas/resourceDemand/facilitiesEnvironment/internalWastes.js 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/Personnel-management-dia.vue 211 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/Personnel-management.vue 261 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/illuminance-recording.vue 414 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/lightning-protection-detection.vue 288 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/power-supply-stability.vue 403 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/temperature-humidity-record.vue 483 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/three-wastes-dialog.vue 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/three-wastes-treatment.vue 202 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/facilitiesEnvironment/index.vue 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterial/index.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/resourceDemand/facilitiesEnvironment/internalWastes.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,56 @@
import request from '@/utils/request'
// å®‰å…¨å†…务三废处理分页查询
export function pageInternalWastes(query) {
  return request({
    url: '/internalWastes/pageInternalWastes',
    method: 'get',
    params: query
  })
}
// å®‰å…¨å†…务三废处理查看详情
export function getInternalWastesOne(query) {
  return request({
    url: '/internalWastes/getInternalWastesOne',
    method: 'get',
    params: query
  })
}
// å®‰å…¨å†…务三废处理新增
export function addInternalWastes(query) {
  return request({
    url: '/internalWastes/addInternalWastes',
    method: 'post',
    data: query
  })
}
// å®‰å…¨å†…务三废处理分页修改
export function updateInternalWastes(query) {
  return request({
    url: '/internalWastes/updateInternalWastes',
    method: 'post',
    data: query
  })
}
// å¯¼å‡ºä¸‰åºŸå¤„理
export function exportInternalWastes(query) {
  return request({
    url: "/internalWastes/exportInternalWastes",
    method: "get",
    responseType: "blob",
    params: query,
  });
}
//安全内务三废处理删除
export function removeStandardSubstance(query) {
  return request({
    url: '/internalWastes/delInternalWastes',
    method: 'delete',
    params: query
  })
}
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/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/views/CNAS/resourceDemand/facilitiesEnvironment/component/Personnel-management.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,261 @@
<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 PersonnelManagementDia from '../component/Personnel-management-dia.vue';
export default {
  name: 'Personnel-management',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { PersonnelManagementDia},
  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
        const blob = new Blob([res],{ type: 'application/msword' });
        //将Blob å¯¹è±¡è½¬æ¢æˆå­—符串
        let reader = new FileReader();
        reader.readAsText(blob, 'utf-8');
        reader.onload = () => {
          try {
            let result = JSON.parse(reader.result);
            if (result.message) {
              this.$message.error(result.message);
            } else {
              const url = URL.createObjectURL(blob);
              const link = document.createElement('a');
              link.href = url;
              link.download = '外来人员登记' + '.docx';
              link.click();
              this.$message.success('导出成功')
            }
          } catch (err) {
            console.log(err);
            const url = URL.createObjectURL(blob);
            const link = document.createElement('a');
            link.href = url;
            link.download = '外来人员登记' + '.docx';
            link.click();
            this.$message.success('导出成功')
          }
        }
      })
    },
    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/views/CNAS/resourceDemand/facilitiesEnvironment/component/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/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/illuminance-recording.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,414 @@
<template>
  <div>
    <div class="header">
      <div>照度记录</div>
      <div>
        <el-button size="small" type="primary" @click="clickAdd">新 å¢ž</el-button>
      </div>
    </div>
    <el-table
      :data="tableData"
      height="calc(100vh - 18em)"
      style="width: 100%">
      <el-table-column label="序号" type="index" width="120">
        <template v-slot="scope">
          <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="结论" min-width="180" prop="conclusion"></el-table-column>
      <el-table-column label="测试日期" min-width="180" prop="testDate" width="testDate"></el-table-column>
      <el-table-column label="检测者" min-width="180" prop="testerUser"></el-table-column>
      <el-table-column label="核查人" min-width="180" prop="checkerUser"></el-table-column>
      <el-table-column label="设备名称" min-width="180" prop="deviceName"></el-table-column>
      <el-table-column label="设备编号" min-width="180" prop="managementNumber"></el-table-column>
      <el-table-column label="校准日期" min-width="180" prop="lastCalibrationDate"></el-table-column>
      <el-table-column label="下次校准日期" min-width="180" prop="nextCalibrationDate"></el-table-column>
      <el-table-column label="创建时间" min-width="180" prop="createTime"></el-table-column>
      <el-table-column fixed="right" label="操作" min-width="140">
        <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 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]"
                   :total="search.total" layout="->,total, sizes, prev, pager, next, jumper"
                   @size-change="handleSizeChange"
                   @current-change="handleCurrentChange">
    </el-pagination>
    <el-dialog
      :visible.sync="dialogVisible"
      title="新增"
      width="50%"
      @open="openDialog">
      <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 :rules="[{ required: true, message: '请输入测试地点', trigger: 'change' }]" label="测试日期"
                            prop="testDate">
                <el-date-picker
                  v-model="form.testDate"
                  format="yyyy-MM-dd"
                  placeholder="选择日期"
                  size="small"
                  style="width: 100%"
                  type="date"
                  value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item :rules="[{ required: true, message: '请输入设备名称', trigger: 'change' }]" label="设备名称"
                            prop="deviceId">
                <el-select v-model="form.deviceId"
                           class="table_input"
                           clearable
                           filterable
                           placeholder="设备名称"
                           size="small" @change="getCalibrationDateFun">
                  <el-option v-for="item in equipOptions" :key="item.id"  :label="item.deviceName" :value="item.id">
                    {{item.deviceName + item.managementNumber}}
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="设备编号">
                <el-input v-model="form.managementNumber" disabled size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="最近校准日期">
                <el-input v-model="form.lastCalibrationDate" disabled size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="下次校准日期">
                <el-input v-model="form.nextCalibrationDate" disabled size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="检测者" prop="recipientUser">
                <el-select v-model="form.testerId" clearable filterable placeholder="请选择"
                           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" clearable filterable placeholder="请选择"
                           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
                  v-model="form.conclusion"
                  :rows="2"
                  placeholder="请输入内容"
                  type="textarea">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <div>
            <div style="display: flex; justify-content: flex-end; margin-bottom: 0.5em">
              <el-button size="small" type="primary" @click="feMeasuredQuantityListAdd">新增</el-button>
            </div>
            <div>
              <el-table
                :data="form.illuminationDetectionAreaList"
                height="40vh"
                style="width: 100%; margin: auto">
                <el-table-column label="序号" type="index" width="80"></el-table-column>
                <el-table-column
                  align="center"
                  label="检测区域名称"
                  min-width="180"
                  prop="detectionAreaLabel">
                  <template #default="{ row }">
                    <el-input v-model="row.detectionAreaLabel" :rows="1" type="textarea"></el-input>
                  </template>
                </el-table-column>
                <el-table-column
                  align="center"
                  label="检测值"
                  min-width="300"
                  prop="name">
                  <template>
                    <el-table-column align="center" label="第一次" min-width="100" prop="valueOne">
                      <template #default="{ row }">
                        <el-input v-model="row.valueOne" :rows="1" @blur="getAverage(row)"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column align="center" label="第二次" min-width="100" prop="valueTwo">
                      <template #default="{ row }">
                        <el-input v-model="row.valueTwo" :rows="1" @blur="getAverage(row)"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column align="center" label="第三次" min-width="100" prop="valueThree">
                      <template #default="{ row }">
                        <el-input v-model="row.valueThree" :rows="1" @blur="getAverage(row)"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column align="center" label="平均值" min-width="100" prop="average">
                      <template #default="{ row }">
                        <el-input v-model="row.average" :rows="1"></el-input>
                      </template>
                    </el-table-column>
                  </template>
                </el-table-column>
                <el-table-column
                  align="center"
                  label="备注"
                  min-width="180"
                  prop="detectionAreaLabel">
                  <template #default="{ row }">
                    <el-input v-model="row.remark" :rows="1" type="textarea"></el-input>
                  </template>
                </el-table-column>
                <el-table-column
                  fixed="right"
                  label="操作"
                  width="100">
                  <template slot-scope="scope">
                    <el-button size="small" type="text" @click="feMeasuredQuantityListDelete(scope.row, scope.$index)">
                      åˆ é™¤
                    </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" :loading="submitLoading" @click="addPowerSupplyStability">ç¡® å®š</el-button>
  </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      search: {
        size: 20,
        current: 1,
        total: 0
      },
      tableData: [],
      dialogVisible: false,
      submitLoading: false,
      form: {
        testDate: '',
        deviceId: '',
        managementNumber: '',
        lastCalibrationDate: '',
        nextCalibrationDate: '',
        testerId: '',
        checkerId: '',
        conclusion: '',
        illuminationDetectionAreaList: []
      },
      cascaderList: [],
      responsibleOptions: [],
      equipOptions: [],
    }
  },
  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
      this.getEquipOptions()
    },
    // èŽ·å–æ‰€æœ‰è®¾å¤‡
    getEquipOptions() {
      this.equipOptions = []
      this.$axios.get(this.$api.deviceScope.deviceScopeSearch+'?status=0').then(res => {
        if (res.code === 200 && res.data) {
          this.equipOptions = res.data
        }
      }).catch(error => {
        console.error(error)
      })
    },
    feMeasuredQuantityListAdd() {
      const obj = {
        detectionAreaLabel: null,
        valueOne: null,
        valueTwo: null,
        valueThree: null,
        average: null,
        remark: null,
      }
      this.form.illuminationDetectionAreaList.push(obj)
    },
    addPowerSupplyStability() {
      this.submitLoading = true
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$axios.post(this.$api.facilitiesAndEnvironment.addFeLightningProtection, this.form, {
            headers: {
              'Content-Type': 'application/json'
            }
          }).then(res => {
            this.submitLoading = false
            if (res.code === 200) {
              this.initData()
              this.dialogVisible = false
            }
          }).catch(error => {
            this.submitLoading = false
          })
        }
      });
    },
    // èŽ·å–è´Ÿè´£äººä¿¡æ¯æŽ¥å£
    getUserList() {
      this.$axios.get(this.$api.deviceScope.selectUserList).then(res => {
        if (res.code == 200) {
          this.responsibleOptions = res.data
        }
      })
    },
    getCalibrationDateFun(val) {
      const index = this.equipOptions.findIndex(item => item.id === val)
      if (index > -1) {
        this.form.managementNumber = this.equipOptions[index].managementNumber
        this.form.lastCalibrationDate = this.equipOptions[index].lastCalibrationDate
        this.form.nextCalibrationDate = this.equipOptions[index].nextCalibrationDate
      }
    },
    // å¯¼å‡º
    downLoadPost(row) {
      this.$axios.get(this.$api.facilitiesAndEnvironment.exportFeIllumination + '?intensityIlluminationId=' + row.intensityIlluminationId,{responseType: "blob"}).then(res => {
        this.outLoading = false
        const blob = new Blob([res],{ type: 'application/msword' });
        //将Blob å¯¹è±¡è½¬æ¢æˆå­—符串
        let reader = new FileReader();
        reader.readAsText(blob, 'utf-8');
        reader.onload = () => {
          try {
            let result = JSON.parse(reader.result);
            if (result.message) {
              this.$message.error(result.message);
            } else {
              const url = URL.createObjectURL(blob);
              const link = document.createElement('a');
              link.href = url;
              link.download = '照度记录' + '.docx';
              link.click();
              this.$message.success('导出成功')
            }
          } catch (err) {
            console.log(err);
            const url = URL.createObjectURL(blob);
            const link = document.createElement('a');
            link.href = url;
            link.download = '照度记录' + '.docx';
            link.click();
            this.$message.success('导出成功')
          }
        }
      })
    },
  }
}
</script>
<style scoped>
.header {
  height: 3em;
  width: 100%;
  display: flex;
  justify-content: space-between;
}
</style>
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/lightning-protection-detection.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,288 @@
<template>
  <div>
    <div class="header">
      <div>防雷检测</div>
      <div>
        <el-button size="small" type="primary" @click="clickAdd">导 å…¥</el-button>
        <el-button size="small" type="primary" @click="downLoadPost">导 å‡º</el-button>
      </div>
    </div>
    <el-table
      :data="tableData"
      height="calc(100vh - 18em)"
      style="width: 100%">
      <el-table-column label="序号" type="index" width="120">
        <template v-slot="scope">
          <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="原文件名"
        min-width="180"
        prop="fileName">
      </el-table-column>
      <el-table-column
        label="检测日期"
        min-width="180"
        prop="detectionDate">
      </el-table-column>
      <el-table-column
        label="有效期"
        min-width="180"
        prop="termValidity">
      </el-table-column>
      <el-table-column
        label="检测单位"
        min-width="180"
        prop="detectionUnit">
      </el-table-column>
      <el-table-column fixed="right" label="操作" min-width="100">
        <template v-slot="scope">
          <el-button size="small" type="text" @click="edit(scope.row)">编辑</el-button>
          <el-button size="small" type="text" @click="deleteRowFun(scope.row)">删除</el-button>
          <el-button size="small" type="text" @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
      :visible.sync="dialogVisible"
      title="新 å¢ž"
      width="50%">
      <div style="height: 50vh;">
        <el-form ref="form" :model="form" label-width="80px">
          <el-row>
            <el-col :span="12">
              <el-form-item :rules="[{ required: true, message: '请输入测试地点', trigger: 'blur' }]" label="检测日期"
                            prop="detectionDate">
                <el-date-picker
                  v-model="form.detectionDate"
                  format="yyyy-MM-dd"
                  placeholder="选择日期"
                  size="small"
                  style="width: 100%"
                  type="date"
                  value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item :rules="[{ required: true, message: '请输入测试地点', trigger: 'blur' }]" label="有效期"
                            prop="termValidity">
                <el-date-picker
                  v-model="form.termValidity"
                  format="yyyy-MM-dd"
                  placeholder="选择日期"
                  size="small"
                  style="width: 100%"
                  type="date"
                  value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item :rules="[{ required: true, message: '请输入测试地点', trigger: 'blur' }]" label="检测单位"
                            prop="detectionUnit">
                <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
                  :file-list="form.fileList"
                  :http-request="httpRequest"
                  :limit="1"
                  :on-exceed="handleExceed"
                  :on-remove="handleRemove"
                  action="#"
                  class="upload-demo"
                  drag
                  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
        const blob = new Blob([res],{ type: 'application/msword' });
        //将Blob å¯¹è±¡è½¬æ¢æˆå­—符串
        let reader = new FileReader();
        reader.readAsText(blob, 'utf-8');
        reader.onload = () => {
          try {
            let result = JSON.parse(reader.result);
            if (result.message) {
              this.$message.error(result.message);
            } else {
              const url = URL.createObjectURL(blob);
              const link = document.createElement('a');
              link.href = url;
              link.download = '防雷检测导出' + '.xlsx';
              link.click();
              this.$message.success('导出成功')
            }
          } catch (err) {
            console.log(err);
            const url = URL.createObjectURL(blob);
            const link = document.createElement('a');
            link.href = url;
            link.download = '防雷检测导出' + '.xlsx';
            link.click();
            this.$message.success('导出成功')
          }
        }
      })
    },
    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/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/power-supply-stability.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,403 @@
<template>
  <div>
    <div class="header">
      <div>电源稳定性</div>
      <div>
        <el-button size="small" type="primary" @click="openAddDia">新 å¢ž</el-button>
      </div>
    </div>
    <el-table
      :data="tableData"
      height="calc(100vh - 18em)"
      style="width: 100%">
      <el-table-column label="序号" type="index" width="120">
        <template v-slot="scope">
          <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="测试地点" min-width="180" prop="testLocation"></el-table-column>
      <el-table-column label="测试日期" min-width="180" prop="testDate" width="testDate"></el-table-column>
      <el-table-column label="结论" min-width="180" prop="conclusion"></el-table-column>
      <el-table-column label="检测者" min-width="180" prop="testerUser"></el-table-column>
      <el-table-column label="核查人" min-width="180" prop="checkerUser"></el-table-column>
      <el-table-column label="设备名称" min-width="180" prop="deviceName"></el-table-column>
      <el-table-column label="设备编号" min-width="180" prop="managementNumber"></el-table-column>
      <el-table-column label="校准日期" min-width="180" prop="lastCalibrationDate"></el-table-column>
      <el-table-column label="下次校准日期" min-width="180" prop="nextCalibrationDate"></el-table-column>
      <el-table-column label="创建时间" min-width="180" prop="createTime"></el-table-column>
      <el-table-column fixed="right" label="操作" min-width="140">
        <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 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]"
                   :total="search.total" layout="->,total, sizes, prev, pager, next, jumper"
                   @size-change="handleSizeChange"
                   @current-change="handleCurrentChange">
    </el-pagination>
    <el-dialog
      :visible.sync="dialogVisible"
      title="新增"
      width="50%"
      @open="openDialog">
      <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 :rules="[{ required: true, message: '请输入测试地点', trigger: 'blur' }]" label="测试地点"
                            prop="testLocation">
                <el-input v-model="form.testLocation" size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item :rules="[{ required: true, message: '请输入测试日期', trigger: 'change' }]" label="测试日期"
                            prop="testDate">
                <el-date-picker
                  v-model="form.testDate"
                  format="yyyy-MM-dd"
                  placeholder="选择日期"
                  size="small"
                  style="width: 100%"
                  type="date"
                  value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item :rules="[{ required: true, message: '请输入设备名称', trigger: 'change' }]" label="设备名称"
                            prop="deviceId">
                <el-select v-model="form.deviceId"
                           class="table_input"
                           clearable
                           filterable
                           placeholder="设备名称"
                           size="small" @change="getCalibrationDateFun">
                  <el-option v-for="item in equipOptions" :key="item.id"  :label="item.deviceName" :value="item.id">
                    {{item.deviceName + item.managementNumber}}
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="设备编号">
                <el-input v-model="form.managementNumber" disabled size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="最近校准日期">
                <el-input v-model="form.lastCalibrationDate" disabled size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="下次校准日期">
                <el-input v-model="form.nextCalibrationDate" disabled size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="检测者" prop="recipientUser">
                <el-select v-model="form.testerId" clearable filterable placeholder="请选择"
                           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" clearable filterable placeholder="请选择"
                           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
                  v-model="form.conclusion"
                  :rows="2"
                  placeholder="请输入内容"
                  type="textarea">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <div>
            <div style="display: flex; justify-content: flex-end; margin-bottom: 0.5em">
              <el-button size="small" type="primary" @click="feMeasuredQuantityListAdd">新增</el-button>
            </div>
            <div>
              <el-table
                :data="form.feMeasuredQuantityList"
                height="40vh"
                style="width: 100%; margin: auto">
                <el-table-column label="序号" type="index" width="80"></el-table-column>
                <el-table-column
                  align="center"
                  label="测定量名称"
                  min-width="180"
                  prop="measuredQuantityLabel">
                  <template #default="{ row }">
                    <el-input v-model="row.measuredQuantityLabel" :rows="1" type="textarea"></el-input>
                  </template>
                </el-table-column>
                <el-table-column
                  align="center"
                  label="值"
                  min-width="300"
                  prop="name">
                  <template>
                    <el-table-column align="center" label="A" min-width="100" prop="valueA">
                      <template #default="{ row }">
                        <el-input v-model="row.valueA" :rows="1"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column align="center" label="B" min-width="100" prop="valueB">
                      <template #default="{ row }">
                        <el-input v-model="row.valueB" :rows="1"></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column align="center" label="C" min-width="100" prop="valueC">
                      <template #default="{ row }">
                        <el-input v-model="row.valueC" :rows="1"></el-input>
                      </template>
                    </el-table-column>
                  </template>
                </el-table-column>
                <el-table-column
                  fixed="right"
                  label="操作"
                  width="100">
                  <template slot-scope="scope">
                    <el-button size="small" type="text" @click="feMeasuredQuantityListDelete(scope.row, scope.$index)">
                      åˆ é™¤
                    </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" :loading="submitLoading" @click="addPowerSupplyStability">ç¡® å®š</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      search: {
        size: 20,
        current: 1,
        total: 0
      },
      tableData: [],
      dialogVisible: false,
      submitLoading: false,
      form: {
        testLocation: '',
        testDate: '',
        deviceId: '',
        managementNumber: '',
        lastCalibrationDate: '',
        nextCalibrationDate: '',
        testerId: '',
        checkerId: '',
        conclusion: '',
        feMeasuredQuantityList: []
      },
      equipOptions: [],
      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()
        })
      })
    },
    openAddDia () {
      this.dialogVisible = true
      this.getEquipOptions()
    },
    // èŽ·å–æ‰€æœ‰è®¾å¤‡
    getEquipOptions() {
      this.equipOptions = []
      this.$axios.get(this.$api.deviceScope.deviceScopeSearch+'?status=0').then(res => {
        if (res.code === 200 && res.data) {
          this.equipOptions = res.data
        }
      }).catch(error => {
        console.error(error)
      })
    },
    // ç”µæºç¨³å®šæ€§-打开弹框调用设备接口,查询使用的设备
    openDialog() {
      this.$axios.get(this.$api.deviceScope.treeDevice).then(res => {
        this.cascaderList = res.data;
      });
      this.$nextTick(() => {
        this.$refs['form'].clearValidate()
      })
      this.getUserList()
    },
    //
    getCalibrationDateFun(val) {
      const index = this.equipOptions.findIndex(item => item.id === val)
      if (index > -1) {
        this.form.managementNumber = this.equipOptions[index].managementNumber
        this.form.lastCalibrationDate = this.equipOptions[index].lastCalibrationDate
        this.form.nextCalibrationDate = this.equipOptions[index].nextCalibrationDate
      }
    },
    // ç”µæºç¨³å®šæ€§-测定量弹框中表格的删除行
    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.submitLoading = true
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$axios.post(this.$api.facilitiesAndEnvironment.addLaboratoryFacilityPowerStable, this.form, {
            headers: {
              'Content-Type': 'application/json'
            }
          }).then(res => {
            this.submitLoading = false
            if (res.code === 200) {
              this.initData()
              this.dialogVisible = false
            }
          }).catch(error => {
            this.submitLoading = false
          })
        }
      });
    },
    // å¯¼å‡º
    downLoadPost(row) {
      this.$axios.get(this.$api.facilitiesAndEnvironment.exportFePowerStable + '?powerStableId=' + row.powerStableId,{responseType: "blob"}).then(res => {
        this.outLoading = false
        const blob = new Blob([res],{ type: 'application/msword' });
        //将Blob å¯¹è±¡è½¬æ¢æˆå­—符串
        let reader = new FileReader();
        reader.readAsText(blob, 'utf-8');
        reader.onload = () => {
          try {
            let result = JSON.parse(reader.result);
            if (result.message) {
              this.$message.error(result.message);
            } else {
              const url = URL.createObjectURL(blob);
              const link = document.createElement('a');
              link.href = url;
              link.download = '电源稳定性' + '.docx';
              link.click();
              this.$message.success('导出成功')
            }
          } catch (err) {
            console.log(err);
            const url = URL.createObjectURL(blob);
            const link = document.createElement('a');
            link.href = url;
            link.download = '电源稳定性' + '.docx';
            link.click();
            this.$message.success('导出成功')
          }
        }
      })
    },
    // ç”µæºç¨³å®šæ€§ ç‚¹å‡»è¡Œç¼–辑触发
    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/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/temperature-humidity-record.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,483 @@
<template>
  <div>
    <el-row :gutter="20">
      <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>
        </div>
        <el-table
            :data="tableData"
            height="calc(100vh - 18em)"
            highlight-current-row
            style="width: 100%"
            @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="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 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>
            </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 v-if="saveRow.monthDate" size="small" type="primary" @click="dialogVisible1 = true">新 å¢ž</el-button>
          </div>
        </div>
        <el-table
            :data="tableData1"
            height="calc(100vh - 18em)"
            style="width: 100%">
          <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">
            <template>
              <el-table-column label="时间" min-width="110" prop="morningTestTime" show-overflow-tooltip></el-table-column>
              <el-table-column label="温度" min-width="80" prop="morningTemp" show-overflow-tooltip></el-table-column>
              <el-table-column label="湿度" min-width="80" prop="morningHum" show-overflow-tooltip></el-table-column>
            </template>
          </el-table-column>
          <el-table-column label="记录员" min-width="100" prop="morningRecorderUser"></el-table-column>
          <el-table-column align="center" label="下午" min-width="200">
            <template>
              <el-table-column label="时间" min-width="110" prop="afternoonTime" show-overflow-tooltip></el-table-column>
              <el-table-column label="温度" min-width="80" prop="afternoonTemp" show-overflow-tooltip></el-table-column>
              <el-table-column label="湿度" min-width="80" prop="afternoonHum" show-overflow-tooltip></el-table-column>
            </template>
          </el-table-column>
          <el-table-column label="记录员" min-width="100" prop="afternoonRecorderUser"></el-table-column>
          <el-table-column label="备注" min-width="100" prop="note" show-overflow-tooltip></el-table-column>
          <el-table-column fixed="right" label="操作" min-width="100">
            <template v-slot="scope">
              <el-button size="small" type="text" @click="edit1(scope.row)">编辑</el-button>
              <el-button size="small" type="text" @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
        :visible.sync="dialogVisible"
        title="提示"
        width="50%">
      <div style="height: 20vh;">
        <el-form ref="form" :model="form" label-width="80px">
          <el-row>
            <el-col :span="24">
              <el-form-item :rules="[{ required: true, message: '请输入月度时间', trigger: 'blur' }]" label="月度时间"
                            prop="monthDate">
                <el-date-picker
                    v-model="form.monthDate"
                    format="yyyy-MM"
                    placeholder="选择月份"
                    size="small"
                    style="width: 100%"
                    type="month"
                    value-format="yyyy-MM">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item :rules="[{ required: true, message: '请输入试验区域', trigger: 'blur' }]" label="试验区域"
                            prop="testAreaName">
                <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" :loading="submitLoading" @click="addPowerSupplyStability">ç¡® å®š</el-button>
  </span>
    </el-dialog>
    <el-dialog
        :visible.sync="dialogVisible1"
        title="提示"
        width="50%"
        @open="openDialog">
      <div style="height: 40vh;">
        <el-form ref="form1" :model="form1" label-width="120px">
          <el-row>
            <el-col :span="24">
              <el-form-item label="日期">
                <el-date-picker
                  v-model="form1.recordDate"
                  format="yyyy-MM-dd"
                  placeholder="请选择日期"
                  size="small"
                  style="width: 50%"
                  type="date"
                  value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="上午时间">
                <el-time-picker
                  v-model="form1.morningTestTime"
                  size="small"
                  value-format="HH:mm:ss"
                  format="HH:mm:ss"
                  style="width: 100%"
                  placeholder="请选择时间">
                </el-time-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" clearable filterable placeholder="请选择"
                           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-time-picker
                  v-model="form1.afternoonTime"
                  size="small"
                  value-format="HH:mm:ss"
                  format="HH:mm:ss"
                  style="width: 100%"
                  placeholder="请选择时间">
                </el-time-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" clearable filterable placeholder="请选择"
                           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
                    v-model="form1.note"
                    :rows="2"
                    placeholder="请输入内容"
                    type="textarea">
                </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" :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>
      <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>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      search: {
        size: 20,
        current: 1,
        total: 0,
        testAreaName: ''
      },
      search1: {
        size: 20,
        current: 1,
        total: 0
      },
      tableData: [],
      tableData1: [],
      dialogVisible: false,
      submitLoading: false,
      dialogVisible1: false,
      form: {},
      form1: {},
      saveRow: {},
      responsibleOptions: [],
      approvalDialog: false,
      approvalLoading: false,
      subjoin: '',
      approvalRow: {},
    }
  },
  mounted() {
    this.initData()
  },
  watch: {
    dialogVisible(newVal) {
      if (!newVal) {
        this.form = {
        }
      }
    },
    dialogVisible1(newVal) {
      if (!newVal) {
        this.form1 = {
        }
      }
    }
  },
  methods: {
    openApprovalDialog (row) {
      this.approvalDialog = true
      this.approvalRow = row
    },
    handleApproval () {
      this.approvalLoading = true
      const params = {
        dateId: this.approvalRow.dateId,
        subjoin: this.subjoin,
      }
      this.$axios.post(this.$api.facilitiesAndEnvironment.affirmFeTempHumDate, params, {
        headers: {
          'Content-Type': 'application/json'
        },
        noQs: true
      }).then(res => {
        this.approvalLoading = false
        if (res.code === 200) {
          this.$message.success('确认成功!')
          this.approvalDialog = false
          this.initData()
        }
      }).catch(err => {
        this.approvalDialog = false
      })
    },
    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.submitLoading = true
          this.$axios.post(this.$api.facilitiesAndEnvironment.addFeTempHumDate, this.form, {
            headers: {
              'Content-Type': 'application/json'
            }
          }).then(res => {
            if (res.code === 200) {
              this.$message.success('新增成功!')
              this.submitLoading = false
              this.initData()
              this.dialogVisible = false
            }
          }).catch(err => {
            this.submitLoading = false
          })
        }
      });
    },
    addPowerSupplyStability1() {
      if (!this.saveRow) {
        this.$message.warning("请选择试验区域!")
        return
      }
      this.$refs.form1.validate((valid) => {
        this.submitLoading = true
        if (valid) {
          this.form1.dateId = this.saveRow.dateId
          this.$axios.post(this.$api.facilitiesAndEnvironment.addFeTempHumRecord, this.form1, {
            headers: {
              'Content-Type': 'application/json'
            }
          }).then(res => {
            if (res.code === 200) {
              this.$message.success('新增成功!')
              this.submitLoading = false
              this.initData1(this.saveRow.dateId)
              this.dialogVisible1 = false
            }
          }).catch(err => {
            this.submitLoading = 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
    },
    // å¯¼å‡º
    downLoadPost(row) {
      this.$axios.get(this.$api.facilitiesAndEnvironment.exportTemperatureAndHumidityRecords + '?dateId=' + row.dateId,{responseType: "blob"}).then(res => {
        this.outLoading = false
        const blob = new Blob([res],{ type: 'application/msword' });
        //将Blob å¯¹è±¡è½¬æ¢æˆå­—符串
        let reader = new FileReader();
        reader.readAsText(blob, 'utf-8');
        reader.onload = () => {
          try {
            let result = JSON.parse(reader.result);
            if (result.message) {
              this.$message.error(result.message);
            } else {
              const url = URL.createObjectURL(blob);
              const link = document.createElement('a');
              link.href = url;
              link.download = '温湿度记录' + '.docx';
              link.click();
              this.$message.success('导出成功')
            }
          } catch (err) {
            console.log(err);
            const url = URL.createObjectURL(blob);
            const link = document.createElement('a');
            link.href = url;
            link.download = '温湿度记录' + '.docx';
            link.click();
            this.$message.success('导出成功')
          }
        }
      })
    },
    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 + '&testAreaName=' + this.search.testAreaName).then(res => {
        if (res.code === 201) return;
        this.tableData = res.data.records;
        this.search.total = res.data.total;
        if (res.data.records.length === 0) {
          this.tableData1 = []
          this.saveRow.monthDate = ''
        }
      });
    },
    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/views/CNAS/resourceDemand/facilitiesEnvironment/component/three-wastes-dialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,189 @@
<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>
import {
  getInternalWastesOne,
  addInternalWastes,
  updateInternalWastes
} from '@/api/cnas/resourceDemand/facilitiesEnvironment/internalWastes'
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
      getInternalWastesOne({wastesId: row.wastesId}).then(res => {
        this.diaLoading = false
        if (res.code === 200){
          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') {
            addInternalWastes(internalImplementDto).then(res => {
              this.loading = false
              if (res.code === 200){
                this.$message.success('操作成功')
                this.closeThreeWastesDia()
              }
            }).catch(err => {
              console.log('err---', err);
              this.loading = false
            })
          } else if (this.operationType === 'edit') {
            updateInternalWastes(internalImplementDto).then(res => {
              this.loading = false
              if (res.code === 200){
                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/views/CNAS/resourceDemand/facilitiesEnvironment/component/three-wastes-treatment.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,202 @@
<template>
  <div class="capacity-scope">
    <div class="search">
      <div>
        <el-form :model="searchForm" ref="searchForm" size="small" :inline="true">
          <el-form-item label="备注" prop="remark">
              <el-input size="small" placeholder="请输入" clearable v-model="searchForm.remark">
              </el-input>
          </el-form-item>
          <el-form-item>
              <el-button type="primary" icon="el-icon-search" size="mini" @click="searchList">查 è¯¢</el-button>
              <el-button icon="el-icon-refresh" size="mini" @click="resetSearchForm">重 ç½®</el-button>
          </el-form-item>
        </el-form>
      </div>
      <div>
        <el-button size="medium" type="primary" @click="openFormDia('add')">新 å¢ž</el-button>
      </div>
    </div>
    <div class="table">
      <lims-table :tableData="tableData" :column="tableColumn" :height="'calc(100vh - 250px)'" @pagination="pagination"
                  :page="page" :tableLoading="tableLoading"></lims-table>
    </div>
    <three-wastes-dialog v-if="threeWastesDia" ref="threeWastesDia" @closeThreeWastesDia="closeThreeWastesDia"></three-wastes-dialog>
  </div>
</template>
<script>
import ThreeWastesDialog from './three-wastes-dialog.vue';
import limsTable from '@/components/Table/lims-table.vue'
import {
  pageInternalWastes,
  removeStandardSubstance,
  exportInternalWastes
} from '@/api/cnas/resourceDemand/facilitiesEnvironment/internalWastes'
export default {
  name: 'a6-three-wastes-treatment',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {
    ThreeWastesDialog,
    limsTable
  },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      searchForm: {
        remark: '',
      },
      tableColumn: [
        {
          label: '创建时间',
          prop: 'createTime',
          minWidth: '100'
        },
        {
          label: '创建人',
          prop: 'createUserName',
          minWidth: '100'
        },
        {
          label: '备注',
          prop: 'remark',
          minWidth: '100'
        },
        {
          label: '修改时间',
          prop: 'updateTime',
          minWidth: '100'
        },
        {
          label: '修改人',
          prop: 'updateUserName',
          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: {
        total: 0,
        size: 10,
        current: 1
      },
      total: 0,
      threeWastesDia: false
    };
  },
  mounted() {
    this.searchList()
  },
  // æ–¹æ³•集合
  methods: {
    // æŸ¥è¯¢åˆ—表
    searchList () {
      this.tableLoading = true
      pageInternalWastes({...this.page,...this.searchForm}).then(res => {
        this.tableLoading = false
        if (res.code === 200){
          this.tableData = res.data.records
          this.page.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
        removeStandardSubstance({wastesId:row.wastesId}).then(res => {
          this.tableLoading = false
          if (res.code === 200){
            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) {
      exportInternalWastes({wastesId:row.wastesId}).then(res =>{
        this.outLoading = false
        const blob = new Blob([res],{ type: 'application/msword' });
        this.$download.saveAs(blob, '三废处理导出.docx')
        this.$message.success('导出成功')
      })
    },
    closeThreeWastesDia () {
      this.threeWastesDia = false
      this.searchList()
    },
    // é‡ç½®æŸ¥è¯¢æ¡ä»¶
    resetSearchForm () {
      this.searchForm.remark = '';
      this.searchList()
    },
    // åˆ†é¡µåˆ‡æ¢
    pagination(page) {
      this.page.size = page.limit
      this.searchList();
    },
  }
};
</script>
<style scoped>
.search {
  height: 46px;
  display: flex;
  justify-content: space-between;
}
</style>
src/views/CNAS/resourceDemand/facilitiesEnvironment/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,50 @@
<template>
    <div class="main">
      <el-tabs v-model="activeName" :lazy="true" type="border-card">
        <el-tab-pane label="设施和环境条件要求" name="设施和环境条件要求">
          <FacilitiesEnvironmentalConditions v-if="activeName === '设施和环境条件要求'"/>
        </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 "../facilitiesEnvironment/component/facilities-environmental-conditions.vue";
//   // å¤–来人员管理
  import ExternalPersonnelManagement from "../facilitiesEnvironment/component/Personnel-management.vue";
  import A6ThreeWastesTreatment from '../facilitiesEnvironment/component/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;
  }
  v-deep .el-tabs--border-card>.el-tabs__content {
    height: calc(100vh - 9em);
    padding: 0;
  }
  </style>
src/views/CNAS/resourceDemand/standardMaterial/index.vue
@@ -35,9 +35,6 @@
<script>
// import FormDia from '../do/a6-standard-material-list/formDia.vue';
// import BorrowDia from '../do/a6-standard-material-list/borrowDia.vue';
// import ReturnDia from '../do/a6-standard-material-list/returnDia.vue';
import limsTable from '@/components/Table/lims-table.vue'
import {
  getPageStandardSubstance,
@@ -121,11 +118,6 @@
          prop: 'remark',
          minWidth: '100'
        },
        // {
        //   label: '创建人',
        //   prop: 'createUser',
        //   minWidth: '100'
        // },
        {
          label: '创建时间',
          prop: 'createTime',