zhaowei
2025-07-01 32f13d15d67172b9b2dd12d8c5c661c9602c7d2e
设备管理模块设备车间管理页面新增机构类型字段以及限制条件
已修改3个文件
59 ■■■■ 文件已修改
src/views/eam/base/EamProductionUserManagement.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/modules/EamProductionModal.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/modules/EamProductionUser.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/EamProductionUserManagement.vue
@@ -5,12 +5,7 @@
        <!-- 按钮操作区域 -->
        <a-row style="margin-left: 14px">
          <a-button @click="handleAdd(1)" type="primary">添加机构</a-button>
          <a-button @click="handleAdd(2)" type="primary">添加下级</a-button>
          <!--<a-button type="primary" icon="download" @click="handleExportXls('车间信息')">导出</a-button>-->
          <!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"-->
          <!--:action="importExcelUrl" @change="handleImportExcel">-->
          <!--<a-button type="primary" icon="import">导入</a-button>-->
          <!--</a-upload>-->
          <a-button @click="handleAdd(2)" type="primary" v-if="currSelected.factoryCategory!=3">添加下级</a-button>
          <a-button @click="handleDelete" v-if="selectedKeys.length>0">删除</a-button>
          <a-button title="删除多条数据" @click="batchDel" v-if="checkedKeys.length>0">批量删除</a-button>
        </a-row>
@@ -148,15 +143,13 @@
          sm: { span: 16 }
        },
        validatorRules: {
          factoryName: [{ required: true, message: '请输入机构名称!' }]
          factoryName: [{ required: true, message: '请输入机构名称!', trigger: 'change' }]
        },
        url: {
          getProductionTreeList: '/eam/BaseFactory/queryTreeList',
          delete: '/eam/BaseFactory/delete',
          edit: '/eam/BaseFactory/edit',
          deleteBatch: '/eam/BaseFactory/deleteBatch',
          exportXlsUrl: '/eam/BaseFactory/exportXls',
          importExcelUrl: '/eam/BaseFactory/importExcel'
          deleteBatch: '/eam/BaseFactory/deleteBatch'
        },
        isIncludesNotLeaf: false,
        confirmLoading: false
@@ -304,6 +297,7 @@
        this.model = this.currSelected
        this.selectedKeys = [record.key]
        this.$refs.userList.show(record.id)
        if (this.$refs.form) this.$refs.form.clearValidate()
      },
      onClearSelected() {
@@ -348,8 +342,7 @@
      },
      emptyCurrForm() {
        this.$refs.form.resetFields()
        this.model = {}
        this.model = { parentId: this.model.parentId }
      },
      handleAdd(num) {
src/views/eam/base/modules/EamProductionModal.vue
@@ -19,8 +19,13 @@
                       v-model="model.parentId" placeholder="请选择上级机构" disabled>
        </a-tree-select>
      </a-form-model-item>
      <a-form-model-item v-if="!seen" label="机构类型" hasFeedback prop="factoryCategory">
        <j-dict-select-tag dict-code="eam_production_type" placeholder="请选择机构类型" v-model="model.factoryCategory"/>
      <a-form-model-item v-if="!seen&&(model.parentFactoryCategory==1||model.parentFactoryCategory==2)" label="机构类型"
                         hasFeedback
                         prop="factoryCategory">
        <a-select v-model="model.factoryCategory" placeholder="请选择机构类型">
          <a-select-option :value="2" v-if="model.parentFactoryCategory!=2">工区</a-select-option>
          <a-select-option :value="3">工段</a-select-option>
        </a-select>
      </a-form-model-item>
      <a-form-model-item label="排序">
        <a-input-number v-model="model.sorter"/>
@@ -55,8 +60,8 @@
        },
        confirmLoading: false,
        validatorRules: {
          factoryName: [{ required: true, message: '请输入机构名称!' }],
          factoryCategory: [{ required: true, message: '请选择机构类型!' }]
          factoryName: [{ required: true, message: '请输入机构名称!', trigger: 'change' }],
          factoryCategory: [{ required: true, message: '请选择机构类型!', trigger: 'change' }]
        },
        url: {
          queryById: '/eam/BaseFactory/queryIdTree',
@@ -80,12 +85,14 @@
      },
      add(record) {
        const factoryCategory = record ? record.factoryCategory : ''
        const parentId = record ? record.parentId : factoryCategory
        if (this.$refs.form) this.$refs.form.clearValidate()
        const parentFactoryCategory = record ? record.factoryCategory : ''
        const parentId = record ? record.id : ''
        if (parentId) this.seen = false
        else this.seen = true
        this.visible = true
        this.model = Object.assign({}, { parentId })
        this.model = Object.assign({}, { parentId, parentFactoryCategory })
        if (parentFactoryCategory == 2) this.model.factoryCategory = +parentFactoryCategory + 1
        this.loadTreeData()
      },
@@ -123,7 +130,6 @@
      close() {
        this.$emit('close')
        if (this.$refs.form) this.$refs.form.clearValidate()
        this.visible = false
      },
src/views/eam/base/modules/EamProductionUser.vue
@@ -1,6 +1,6 @@
<template>
  <a-card :bordered="false">
    <template v-if="queryParam.baseFactoryId">
    <template v-if="queryParam.factoryId">
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
@@ -114,15 +114,15 @@
        visible: false,
        url: {
          list: '/eam/BaseFactoryUser/BaseFactoryUserList',
          add: '/eam/BaseFactory/add',
          delete: '/eam/BaseFactory/delete',
          deleteBatch: '/eam/BaseFactory/deleteBatch'
          add: '/eam/BaseFactoryUser/add',
          delete: '/eam/BaseFactoryUser/delete',
          deleteBatch: '/eam/BaseFactoryUser/deleteBatch'
        }
      }
    },
    methods: {
      show(baseFactoryId) {
        this.$set(this.queryParam, 'baseFactoryId', baseFactoryId)
      show(factoryId) {
        this.$set(this.queryParam, 'factoryId', factoryId)
        this.loadData(1)
      },
@@ -132,7 +132,7 @@
      handleDelete(id) {
        const that = this
        deleteAction(that.url.delete, { id, baseFactoryId: this.queryParam.baseFactoryId })
        deleteAction(that.url.delete, { id, factoryId: this.queryParam.factoryId })
          .then((res) => {
            if (res.success) {
              //重新计算分页问题
@@ -164,7 +164,7 @@
            that.loading = true
            deleteAction(that.url.deleteBatch, {
              ids,
              baseFactoryId: that.queryParam.baseFactoryId
              factoryId: that.queryParam.factoryId
            })
              .then((res) => {
                if (res.success) {
@@ -193,7 +193,7 @@
        const that = this
        const params = {
          userId: selectedUserIdsArray.join(),
          baseFactoryId: this.queryParam.baseFactoryId
          factoryId: this.queryParam.factoryId
        }
        that.loading = true
        postAction(that.url.add, params)
@@ -224,7 +224,7 @@
      },
      searchReset() {
        this.queryParam = { baseFactoryId: this.queryParam.baseFactoryId }
        this.queryParam = { factoryId: this.queryParam.factoryId }
        this.loadData(1)
      }