zhangherong
2025-03-26 ccd5b8d5eebece61106ab8d36389d69357371ac5
art: 设备管理-设备台账-导出,导入,导入模板下载,铭牌修改
已修改4个文件
68 ■■■■ 文件已修改
src/api/manage.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/EamEquipmentList.vue 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/modules/EamEquipmentModal.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/modules/NameplateModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/manage.js
@@ -269,3 +269,10 @@
    return
  }
}
export function templateXlsDownload(fileUrl) {
  let downloadUrl = getFileAccessHttpUrl(fileUrl)
  if (downloadUrl) {
    window.open(downloadUrl)
  }
}
src/views/eam/equipment/EamEquipmentList.vue
@@ -82,6 +82,7 @@
                @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
      <a-button type="primary" icon="download" @click="handleTemplateXlsDownload">导入模板下载</a-button>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel">
@@ -167,8 +168,9 @@
import '@/assets/less/TableExpand.less'
import EamEquipmentModal from './modules/EamEquipmentModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '@api/manage'
import { getAction, templateXlsDownload } from '@api/manage'
import NameplateModal from '@views/eam/equipment/modules/NameplateModal.vue'
import { getSystemConfigValue } from '@api/api'
export default {
  name: 'EamEquipmentList',
@@ -390,6 +392,26 @@
          dataIndex: 'coordinateNum'
        },
        {
          title: '创建人',
          align: "center",
          dataIndex: 'createBy_dictText'
        },
        {
          title: '创建时间',
          align: "center",
          dataIndex: 'createTime',
        },
        {
          title: '更新人',
          align: "center",
          dataIndex: 'updateBy_dictText'
        },
        {
          title: '更新时间',
          align: "center",
          dataIndex: 'updateTime',
        },
        {
          title: '备注',
          align: 'center',
          width: 100,
@@ -410,9 +432,11 @@
        deleteBatch: '/eam/equipment/deleteBatch',
        exportXlsUrl: 'eam/equipment/exportXls',
        importExcelUrl: 'eam/equipment/importExcel',
        loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions'
        loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions',
        templateXlsDownloadUrl: '导入模板/设备台账导入模板_v1.0.xlsx',
      },
      treeData: []
      treeData: [],
      appHomeUrl: '',
    }
  },
  computed: {
@@ -421,7 +445,8 @@
    }
  },
  created() {
    this.loadAllProductionTree()
    this.loadAllProductionTree();
    this.loadAppHomeUrlConfigValue();
  },
  methods: {
    loadAllProductionTree() {
@@ -441,10 +466,21 @@
     */
    handleOpenNameplateModal(record) {
      this.$refs.nameplateModalRef.model = Object.assign({}, record)
      this.$refs.nameplateModalRef.httpUrl = 'http://www.baidu.com'
      this.$refs.nameplateModalRef.httpUrl = this.appHomeUrl + record.equipmentCode;
      this.$refs.nameplateModalRef.visible = true
    }
    },
    handleTemplateXlsDownload(){
      templateXlsDownload(this.url.templateXlsDownloadUrl);
    },
    loadAppHomeUrlConfigValue() {
      let params = {settingKey: 'app_home_url'};
      getSystemConfigValue(params).then(res => {
        if (res.success) {
          this.appHomeUrl = res.result.settingValue;
        }
      })
    },
  }
}
</script>
src/views/eam/equipment/modules/EamEquipmentModal.vue
@@ -189,7 +189,7 @@
          </a-col>
          <a-col :span="6">
            <a-form-model-item prop="mdcFlag" label="是否实施MDC">
              <lx-switch checked-children='是' un-checked-children='否' @change="handleMdcFlagChange" v-model="model.mdcFlag" :disabled="disableSubmit"/>
              <lx-switch checked-children='是' un-checked-children='否' v-model="model.mdcFlag" :disabled="disableSubmit"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6" v-if="model.mdcFlag === '1'">
@@ -238,6 +238,7 @@
import { getAction, httpAction } from '@/api/manage'
import { validateDuplicateValueInDelFlag } from '@/utils/util'
import JSelectProduction from '@comp/jeecgbiz/JSelectProduction.vue'
import { getSystemConfigValue } from '@api/api'
export default {
  name: 'EamEquipmentModal',
@@ -370,14 +371,6 @@
        }
      })
    },
    handleMdcFlagChange(checked){
      this.model.deviceType = '';
      if (checked) {
        this.validatorRules.deviceType[0].required = true
      } else {
        this.validatorRules.deviceType[0].required = false
      }
    }
  }
}
</script>
src/views/eam/equipment/modules/NameplateModal.vue
@@ -34,7 +34,7 @@
      <tr>
        <td>设备管理</td>
        <td>使用部门</td>
        <td>使用车间</td>
        <td>{{ model.orgId_dictText }}</td>
      </tr>