zhangherong
2025-03-24 fd7c3cbc7a4116fd12a54270249ec3940b865646
art: 设备台账-新增 修改
已修改3个文件
62 ■■■■ 文件已修改
src/components/jeecg/LxSwitch.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/EamEquipmentList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/modules/EamEquipmentModal.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/jeecg/LxSwitch.vue
@@ -51,6 +51,7 @@
    }
  },
  data() {
    return {}
  },
  methods: {
    handleChange(checked) {
src/views/eam/equipment/EamEquipmentList.vue
@@ -177,7 +177,7 @@
          dataIndex: 'operationSystem'
        },
        {
          title: '使用部门',
          title: '使用车间',
          align: 'center',
          width : 100,
          dataIndex: 'orgId'
src/views/eam/equipment/modules/EamEquipmentModal.vue
@@ -161,13 +161,21 @@
        <a-row :gutter="24">
          <a-col :span="6">
            <a-form-model-item prop="orgId" label="使用部门">
              <a-input placeholder="请输入使用部门" v-model="model.orgId"/>
            <a-form-model-item prop="orgId" label="使用车间">
              <a-tree-select v-model="model.orgId"
                             style="width: 100%"
                             :tree-data="treeData"
                             :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                             placeholder="请选择使用车间"
                             allow-clear
                             tree-default-expand-all
                >
              </a-tree-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item prop="equipmentManager" label="设备管理员">
              <a-input placeholder="请输入设备管理员" v-model="model.equipmentManager"/>
              <j-search-select-tag  placeholder="请选择设备管理员" v-model="model.equipmentManager" dict="sys_user,realname, username, del_flag=0"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
@@ -178,7 +186,12 @@
          </a-col>
          <a-col :span="6">
            <a-form-model-item prop="mdcFlag" label="是否实施MDC">
              <lx-switch checked-children='是' un-checked-children='否' v-model="model.mdcFlag"/>
              <lx-switch checked-children='是' un-checked-children='否' @change="handleMdcFlagChange" v-model="model.mdcFlag"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6" v-if="model.mdcFlag === '1'">
            <a-form-model-item prop="deviceType" label="MDC设备类型">
              <j-search-select-tag placeholder="请选择设备类型" v-model="model.deviceType" dict="mdc_equipment_type,equipment_type_name, id, equipment_type_states='Y'" />
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -219,11 +232,13 @@
</template>
<script>
import { httpAction } from '@/api/manage'
import { getAction, httpAction } from '@/api/manage'
import { validateDuplicateValueInDelFlag } from '@/utils/util'
import JSelectProduction from '@comp/jeecgbiz/JSelectProduction.vue'
export default {
  name: 'EamEquipmentModal',
  components: { JSelectProduction },
  data() {
    return {
      title: '操作',
@@ -265,15 +280,27 @@
        ],
        technologyStatus: [
          { required: true, message: '请选择技术状态' }
        ],
        orgId: [
          { required: true, message: '请选择使用车间' }
        ],
        equipmentManager: [
          { required: true, message: '请选择设备管理员' }
        ],
        deviceType: [
          { required: false, message: '请选择设备类型' }
        ]
      },
      url: {
        add: '/eam/equipment/add',
        edit: '/eam/equipment/edit'
      }
        edit: '/eam/equipment/edit',
        loadProductionOptions:'/mdc/mdcProduction/loadProductionTreeOptions'
      },
      treeData: [],
    }
  },
  created() {
    this.loadAllProductionTree();
  },
  methods: {
    add() {
@@ -322,8 +349,24 @@
    },
    handleCancel() {
      this.close()
    },
    loadAllProductionTree() {
      //加载车间选择树
      getAction(this.url.loadProductionOptions).then(res => {
        if (res.success) {
          this.treeData = [...res.result]
        }else {
          that.$message.warning(res.message)
    }
      })
    },
    handleMdcFlagChange(checked){
      if (checked) {
        this.validatorRules.deviceType[0].required = true
      } else {
        this.validatorRules.deviceType[0].required = false
      }
    }
  }
}
</script>