chenrui
2025-02-25 4c9be188cc61f6f87827d6852dca5ca99c67c7a1
设施和环境条件代码迁移
已修改1个文件
已添加1个文件
104 ■■■■ 文件已修改
src/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment.js 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/power-supply-stability.vue 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
import request from '@/utils/request'
// è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-电源稳定性查询
export function getLaboratoryFacilityPowerStablePage(query) {
  return request({
    url: '/fePowerStable/getLaboratoryFacilityPowerStablePage',
    method: 'get',
    params: query
  })
}
// é€šè¿‡è®¾å¤‡åˆ†ç±»èŽ·å–è®¾å¤‡åˆ—è¡¨
export function deviceScopeSearch(query) {
  return request({
    url: '/deviceScope/search',
    method: 'get',
    params: query
  })
}
// è®¾å¤‡æ ‘å½¢
export function treeDevice(query) {
  return request({
    url: '/deviceScope/treeDevice',
    method: 'get',
    params: query
  })
}
//获取用户列表
export function selectUserCondition(query) {
  return request({
    url: "/system/newUser/selectUserCondition",
    method: "get",
    params: query,
  });
}
// è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶è¦æ±‚-电源稳定性新增/修改
export function addLaboratoryFacilityPowerStable(query) {
  return request({
    url: '/fePowerStable/addLaboratoryFacilityPowerStable',
    method: 'post',
    data: query
  })
}
// è®¾æ–½å’ŒçŽ¯å¢ƒæ¡ä»¶-设施和环境条件要求-电源稳定性-测定量 åˆ é™¤
export function deleteFeMeasuredQuantity(query) {
  return request({
    url: '/fePowerStable/deleteFeMeasuredQuantity',
    method: 'delete',
    params: query
  })
}
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/power-supply-stability.vue
@@ -191,11 +191,20 @@
</template>
<script>
import {
  getLaboratoryFacilityPowerStablePage,
  deviceScopeSearch,
  treeDevice,
  selectUserCondition,
  addLaboratoryFacilityPowerStable,
  deleteFeMeasuredQuantity
} from '@/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment'
export default {
  data() {
    return {
      search: {
        size: 20,
        size: 10,
        current: 1,
        total: 0
      },
@@ -235,11 +244,14 @@
  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;
      });
      getLaboratoryFacilityPowerStablePage({
        ...this.search
      }).then(res => {
        if (res.code === 200){
          this.tableData = res.data.records;
          this.search.total = res.data.total;
        }
      })
    },
    handleSizeChange(val) {
      this.search.size = val;
@@ -269,7 +281,7 @@
    // èŽ·å–æ‰€æœ‰è®¾å¤‡
    getEquipOptions() {
      this.equipOptions = []
      this.$axios.get(this.$api.deviceScope.deviceScopeSearch+'?status=0').then(res => {
      deviceScopeSearch({status:'0'}).then(res => {
        if (res.code === 200 && res.data) {
          this.equipOptions = res.data
        }
@@ -279,9 +291,9 @@
    },
    // ç”µæºç¨³å®šæ€§-打开弹框调用设备接口,查询使用的设备
    openDialog() {
      this.$axios.get(this.$api.deviceScope.treeDevice).then(res => {
      treeDevice().then(res => {
        this.cascaderList = res.data;
      });
      })
      this.$nextTick(() => {
        this.$refs['form'].clearValidate()
      })
@@ -324,11 +336,7 @@
      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 => {
          addLaboratoryFacilityPowerStable(this.form).then(res => {
            this.submitLoading = false
            if (res.code === 200) {
              this.initData()
@@ -383,9 +391,16 @@
    },
    // èŽ·å–è´Ÿè´£äººä¿¡æ¯æŽ¥å£
    getUserList() {
      this.$axios.get(this.$api.deviceScope.selectUserList).then(res => {
      selectUserCondition().then(res => {
        if (res.code == 200) {
          this.responsibleOptions = res.data
          let data = []
          res.data.forEach(a => {
            data.push({
              id: a.id,
              name: a.name
            })
          })
          this.responsibleOptions = data
        }
      })
    },