lyh
2025-07-09 a86026e27041a0c994d0c94f0f9580d7e330e67a
用户管理新增eam中心
已添加3个文件
已修改3个文件
798 ■■■■■ 文件已修改
src/api/api.js 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/jeecgbiz/JSelectBaseFactory.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/jeecgbiz/modal/JSelectBaseFactoryModal.vue 294 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/EamMaintenanceStandardList.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/SelectEamDeviceModal.vue 231 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/UserModal.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/api.js
@@ -67,7 +67,10 @@
const queryRepairDepartTreeList = (params)=>getAction("/eam/eamBaseRepairDepart/queryTreeList",params);
const queryRepDepIdTree = (params)=>getAction("/eam/eamBaseRepairDepart/queryIdTree",params);
const deleteByRepairDepartId   = (params)=>deleteAction("/eam/eamBaseRepairDepart/delete",params);
//EAM中心
const queryEamCenterTreeList = (params)=>getAction("/eam/BaseFactory/queryTreeList",params);
const queryEamCenterIdTree = (params)=>getAction("/eam/BaseFactory/queryIdTree",params);
const deleteByEamCenterId   = (params)=>deleteAction("/eam/BaseFactory/delete",params);
//产线树
@@ -190,8 +193,10 @@
  editEquipment,
  queryRepairDepartTreeList,
  queryRepDepIdTree,
  deleteByRepairDepartId
  deleteByRepairDepartId,
  queryEamCenterTreeList,
  queryEamCenterIdTree,
  deleteByEamCenterId
}
src/components/jeecgbiz/JSelectBaseFactory.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,183 @@
<template>
  <div class="components-input-demo-presuffix">
    <!---->
    <a-input @click="openModal" placeholder="请点击选择EAM中心" v-model="textVals" readOnly :disabled="disabled">
      <a-icon slot="prefix" type="cluster" title="EAM中心选择控件"/>
      <a-icon v-if="storeVals" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
    </a-input>
    <JSelectBaseFactoryModal
      ref="innerBaseFactorySelectModal"
      :modal-width="modalWidth"
      :multi="multi"
      :rootOpened="rootOpened"
      :BaseFactoryId="value"
      :store="storeField"
      :text="textField"
      :treeBaseFactory="treeBaseFactory"
      @ok="handleOK"
      @initComp="initComp">
    </JSelectBaseFactoryModal>
  </div>
</template>
<script>
  import JSelectBaseFactoryModal from './modal/JSelectBaseFactoryModal'
  import { underLinetoHump } from '@/components/_util/StringUtil'
  export default {
    name: 'JSelectBaseFactory',
    components:{
      JSelectBaseFactoryModal
    },
    props:{
      modalWidth:{
        type:Number,
        default:500,
        required:false
      },
      multi:{
        type:Boolean,
        default:false,
        required:false
      },
      rootOpened:{
        type:Boolean,
        default:true,
        required:false
      },
      value:{
        type:String,
        required:false
      },
      disabled:{
        type: Boolean,
        required: false,
        default: false
      },
      // è‡ªå®šä¹‰è¿”回字段,默认返回 id
      customReturnField: {
        type: String,
        default: ''
      },
      backBaseFactory: {
        type: Boolean,
        default: false,
        required: false
      },
      // å­˜å‚¨å­—段 [key field]
      store: {
        type: String,
        default: 'id',
        required: false
      },
      // æ˜¾ç¤ºå­—段 [label field]
      text: {
        type: String,
        default: 'factoryName',
        required: false
      },
      treeBaseFactory: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    data(){
      return {
        visible:false,
        confirmLoading:false,
        storeVals: '', //[key values]
        textVals: '' //[label values]
      }
    },
    computed:{
      storeField(){
        let field = this.customReturnField
        if(!field){
          field = this.store;
        }
        return underLinetoHump(field)
      },
      textField(){
        return underLinetoHump(this.text)
      }
    },
    mounted(){
      this.storeVals = this.value
    },
    watch:{
      value(val){
        this.storeVals = val
      }
    },
    methods:{
      initComp(textVals){
        this.textVals = textVals
      },
      //返回选中的车间信息
      backBaseFactoryInfo(){
        if(this.backBaseFactory===true){
          //LOWCOD-2147 ã€ç”¨æˆ·ç®¡ç†ã€‘选择部门和上级以后,负责部门没有数据可选 (陶炎改造自定义返回字段导致)
          if(this.storeVals && this.storeVals.length>0){
            let arr1 = this.storeVals.split(',')
            let arr2 = this.textVals.split(',')
            let info = []
            for(let i=0;i<arr1.length;i++){
              info.push({
                value: arr1[i],
                text: arr2[i]
              })
            }
            this.$emit('back', info)
          }
        }
      },
      openModal(){
        this.$refs.innerBaseFactorySelectModal.show()
      },
      handleOK(rows) {
        if (!rows && rows.length <= 0) {
          this.textVals = ''
          this.storeVals = ''
        } else {
          let arr1 = []
          let arr2 = []
          for(let dep of rows){
            arr1.push(dep[this.storeField])
            arr2.push(dep[this.textField])
          }
          this.storeVals = arr1.join(',')
          this.textVals = arr2.join(',')
        }
        this.$emit("change", this.storeVals)
        this.backBaseFactoryInfo()
      },
      getBaseFactoryNames(){
        return this.departNames
      },
      handleEmpty(){
        this.handleOK('')
      }
    },
    model: {
      prop: 'value',
      event: 'change'
    }
  }
</script>
<style scoped>
  .components-input-demo-presuffix .anticon-close-circle {
    cursor: pointer;
    color: #ccc;
    transition: color 0.3s;
    font-size: 12px;
  }
  .components-input-demo-presuffix .anticon-close-circle:hover {
    color: #f5222d;
  }
  .components-input-demo-presuffix .anticon-close-circle:active {
    color: #666;
  }
</style>
src/components/jeecgbiz/modal/JSelectBaseFactoryModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,294 @@
<template>
  <j-modal
    title="请点击选择EAM中心"
    :width="modalWidth"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @ok="handleSubmit"
    @cancel="handleCancel"
    @update:fullscreen="isFullscreen"
    wrapClassName="j-repair-depart-select-modal"
    switchFullscreen
    cancelText="关闭">
    <a-spin tip="Loading..." :spinning="false">
      <a-input-search style="margin-bottom: 1px" placeholder="请输入中心/工区/工段名称按回车进行搜索" @search="onSearch" />
      <a-tree
        checkable
        :class="treeScreenClass"
        :treeData="treeData"
        :checkStrictly="checkStrictly"
        @check="onCheck"
        @select="onSelect"
        @expand="onExpand"
        :autoExpandParent="autoExpandParent"
        :expandedKeys="expandedKeys"
        :checkedKeys="checkedKeys">
        <template slot="title" slot-scope="{title}">
          <span v-if="title.indexOf(searchValue) > -1">
            {{title.substr(0, title.indexOf(searchValue))}}
            <span style="color: #f50">{{searchValue}}</span>
            {{title.substr(title.indexOf(searchValue) + searchValue.length)}}
          </span>
          <span v-else>{{title}}</span>
        </template>
      </a-tree>
    </a-spin>
  </j-modal>
</template>
<script>
import {queryEamCenterTreeList} from '@/api/api'
  export default {
    name: 'JSelectBaseFactoryModal',
    props:['modalWidth','multi','rootOpened','BaseFactoryId', 'store', 'text','treeBaseFactory'],
    data(){
      return {
        visible:false,
        confirmLoading:false,
        treeData:[],
        autoExpandParent:true,
        expandedKeys:[],
        dataList:[],
        checkedKeys:[],
        checkedRows:[],
        searchValue:"",
        checkStrictly: false,
        fullscreen:false
      }
    },
    created(){
      this.loadDepart();
    },
    watch:{
      BaseFactoryId(){
        this.initDepartComponent()
      },
      visible: {
        handler() {
          this.initDepartComponent(true)
        }
      }
    },
    computed:{
      treeScreenClass() {
        return {
          'my-dept-select-tree': true,
          'fullscreen': this.fullscreen,
        }
      },
    },
    methods:{
      show(){
        this.visible=true
        this.checkedRows=[]
        this.checkedKeys=[]
      },
      loadDepart(){
        // è¿™ä¸ªæ–¹æ³•是找到所有的部门信息
        queryEamCenterTreeList().then(res=>{
          if(res.success){
            let arr = [...res.result]
            this.reWriterWithSlot(arr)
            this.treeData = arr
            this.initDepartComponent()
            if(this.rootOpened){
              this.initExpandedKeys(res.result)
            }
          }
        })
      },
      initDepartComponent(flag){
        let arr = []
        //该方法两个地方用 1.visible改变事件重新设置选中项 2.组件编辑页面回显
        let fieldName = flag==true?'key':this.text
        if(this.BaseFactoryId){
          let arr2 = this.BaseFactoryId.split(',')
          for(let item of this.dataList){
            if(arr2.indexOf(item[this.store])>=0){
              arr.push(item[fieldName])
            }
          }
        }
        if(flag==true){
          this.checkedKeys = [...arr]
        }else{
          this.$emit("initComp", arr.join(','))
        }
      },
      reWriterWithSlot(arr){
        for(let item of arr){
          if(item.children && item.children.length>0){
            this.reWriterWithSlot(item.children)
            let temp = Object.assign({},item)
            temp.children = {}
            this.dataList.push(temp)
          }else{
            this.dataList.push(item)
            item.scopedSlots={ title: 'title' }
          }
        }
      },
      initExpandedKeys(arr){
        if(arr && arr.length>0){
          let keys = []
          for(let item of arr){
            if(item.children && item.children.length>0){
              keys.push(item.id)
            }
          }
          this.expandedKeys=[...keys]
          //全部keys
          //this.allTreeKeys = [...keys]
        }else{
          this.expandedKeys=[]
          //this.allTreeKeys = []
        }
      },
      onCheck (checkedKeys,info) {
        if(!this.multi){
          let arr = checkedKeys.checked.filter(item => this.checkedKeys.indexOf(item) < 0)
          this.checkedKeys = [...arr]
          this.checkedRows = (this.checkedKeys.length === 0) ? [] : [info.node.dataRef]
        }else{
          if(this.checkStrictly){
            this.checkedKeys = checkedKeys.checked
          }else{
            this.checkedKeys = checkedKeys
          }
          this.checkedRows = this.getCheckedRows(this.checkedKeys)
        }
      },
      onSelect(selectedKeys,info) {
        //取消关联的情况下才走onSelect的逻辑
        if(this.checkStrictly){
          let keys = []
          keys.push(selectedKeys[0])
          if(!this.checkedKeys || this.checkedKeys.length===0 || !this.multi){
            this.checkedKeys = [...keys]
            this.checkedRows=[info.node.dataRef]
          }else{
            let currKey = info.node.dataRef.key
            if(this.checkedKeys.indexOf(currKey)>=0){
              this.checkedKeys = this.checkedKeys.filter(item=> item !==currKey)
            }else{
              this.checkedKeys.push(...keys)
            }
          }
          this.checkedRows = this.getCheckedRows(this.checkedKeys)
        }
      },
      onExpand (expandedKeys) {
        this.expandedKeys = expandedKeys
        this.autoExpandParent = false
      },
      handleSubmit(){
        if(!this.checkedKeys || this.checkedKeys.length==0){
          this.$emit("ok",'')
        }else{
          let checkRow = this.getCheckedRows(this.checkedKeys)
          let keyStr = this.checkedKeys.join(",")
          this.$emit("ok", checkRow, keyStr)
        }
        this.handleClear()
      },
      handleCancel(){
        this.handleClear()
      },
      handleClear(){
        this.visible=false
        this.checkedKeys=[]
      },
      getParentKey(currKey,treeData){
        let parentKey
        for (let i = 0; i < treeData.length; i++) {
          const node = treeData[i]
          if (node.children) {
            if (node.children.some(item => item.key === currKey)) {
              parentKey = node.key
            } else if (this.getParentKey(currKey, node.children)) {
              parentKey = this.getParentKey(currKey, node.children)
            }
          }
        }
        return parentKey
      },
      onSearch(value){
        const expandedKeys = this.dataList.map((item) => {
          if (item.title.indexOf(value) > -1) {
            return this.getParentKey(item.key,this.treeData)
          }
          return null
        }).filter((item, i, self) => item && self.indexOf(item) === i)
        Object.assign(this, {
          expandedKeys,
          searchValue: value,
          autoExpandParent: true,
        })
      },
      // æ ¹æ® checkedKeys èŽ·å– rows
      getCheckedRows(checkedKeys) {
        const forChildren = (list, key) => {
          for (let item of list) {
            if (item.id === key) {
              return item
            }
            if (item.children instanceof Array) {
              let value = forChildren(item.children, key)
              if (value != null) {
                return value
              }
            }
          }
          return null
        }
        let rows = []
        for (let key of checkedKeys) {
          let row = forChildren(this.treeData, key)
          if (row != null) {
            rows.push(row)
          }
        }
        return rows
      },
      switchCheckStrictly (v) {
        if(v==1){
          this.checkStrictly = false
        }else if(v==2){
          this.checkStrictly = true
        }
      },
      isFullscreen(val){
        this.fullscreen=val
      }
    }
  }
</script>
<style lang="less" scoped>
// é™åˆ¶éƒ¨é—¨é€‰æ‹©æ ‘高度,避免部门太多时点击确定不便
.my-dept-select-tree{
  height:350px;
  &.fullscreen{
    height: calc(100vh - 250px);
  }
  overflow-y: scroll;
}
.drawer-bootom-button {
  position: absolute;
  bottom: 0;
  width: 100%;
  border-top: 1px solid #e8e8e8;
  padding: 10px 16px;
  text-align: right;
  left: 0;
  background: #fff;
  border-radius: 0 0 2px 2px;
}
</style>
src/views/eam/base/EamMaintenanceStandardList.vue
@@ -253,9 +253,8 @@
          secondMaintenanceImportExcel: '/eam/maintenanceStandard/importSecondMaintenanceStandard',
          thirdMaintenanceImportExcel: '/eam/maintenanceStandard/importThirdMaintenanceStandard',
          inspectionXlsDownloadUrl: '导入模板/点检标准导入模板_v1.0.xlsx',
          weekMaintenanceXlsDownloadUrl: '导入模板/周保标准导入模板_v1.0.xlsx',
          secondMaintenanceXlsDownloadUrl: '导入模板/二保标准导入模板_v1.0.xlsx',
          thirdMaintenanceXlsDownloadUrl: '导入模板/三保标准导入模板_v1.0.xlsx'
          secondMaintenanceXlsDownloadUrl: '导入模板/二保标准导入模板_v1.0.docx',
          thirdMaintenanceXlsDownloadUrl: '导入模板/三保标准导入模板_v1.0.docx'
        },
        standardId: '-1'
      }
src/views/system/modules/SelectEamDeviceModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,231 @@
<template>
  <a-modal
    :title="title"
    :visible="visible"
    @ok="handleOk"
    @cancel="handleCancel"
  >
    <a-spin :spinning="loading">
      <!-- showLine -->
      <a-form>
        <a-form-item label="车间层级:">
          <a-tree showLine ref="tree" :expandedKeys.sync="expandedKeys"
                  :treeData="treeDataSource" checkable @check="onCheck" v-model="checkedKeys"
                  @expand="onExpand">
          </a-tree>
        </a-form-item>
      </a-form>
    </a-spin>
    <template slot="footer">
      <div>
        <a-dropdown
          style="float: left"
          :trigger="['click']"
          placement="topCenter"
        >
          <a-menu slot="overlay">
            <a-menu-item key="1" @click="expandAll">展开所有</a-menu-item>
            <a-menu-item key="2" @click="closeAll">合并所有</a-menu-item>
            <a-menu-item key="3" @click="refreshTree">刷新</a-menu-item>
          </a-menu>
          <a-button>
            æ ‘操作
            <a-icon type="up"/>
          </a-button>
        </a-dropdown>
        <a-popconfirm title="确定放弃编辑?" @confirm="handleCancel" okText="确定" cancelText="取消">
          <a-button style="margin-right: .8rem">关闭</a-button>
        </a-popconfirm>
        <a-button
          @click="handleOk"
          type="primary"
        >确定
        </a-button>
      </div>
    </template>
  </a-modal>
</template>
<script>
  import {
    getAction,
    postAction,
    deleteAction
  } from '@/api/manage'
  import BaseTree from '@/views/mdc/common/BaseTree'
  import DepartTree from '@/views/mdc/base/modules/DepartList/DepartListTree/DepartTree'
  export default {
    name: 'selectEamDeviceModal',
    components: {
      BaseTree, DepartTree
    },
    props: {
      editDisable: {
        type: Boolean,
        default() {
          return true
        }
      },
      title: {
        type: String
      },
      selectedProduction: {
        type: String
      }
    },
    data() {
      return {
        loading: false,
        treeDataSource: [],
        expandedKeys: [],
        checkedKeys: [],
        url: {
          getDeviceTree: '/eam/equipment/loadTreeListByEamCenterIds'
        },
        selectedWorkshopIds: '',
        dataList: [],
        allTreeKeys: [],
        visible: false,
        dataSource: []
      }
    },
    created() {
      this.closeAll()
    },
    methods: {
      onExpand(expandedKeys) {
        this.expandedKeys = expandedKeys
        this.autoExpandParent = false
      },
      queryTreeData(value) {
        this.loading = true
        this.selectedWorkshopIds = value
        getAction(this.url.getDeviceTree, { ids: value })
          .then(res => {
            if (res.success) {
              this.dataList = []
              this.allTreeKeys = []
              this.getTreeDataSouce(res.result)
              this.treeDataSource = res.result
              this.generateList(this.treeDataSource)
              this.expandedKeys = this.allTreeKeys
            } else {
              this.$notification.warning({
                message: '消息',
                description: res.message
              })
            }
          })
          .catch(err => {
            this.$notification.error({
              message: '消息',
              description: err.message
            })
          })
          .finally(() => {
            this.loading = false
          })
      },
      generateList(data) {
        for (let i = 0; i < data.length; i++) {
          const node = data[i]
          const key = node.key
          const title = node.title
          this.dataList.push({
            key,
            title: title
          })
          this.allTreeKeys.push(key)
          if (node.children) {
            this.generateList(node.children)
          }
        }
      },
      getTreeDataSouce(data) {
        data.forEach(item => {
          if (item.children && item.children.length > 0) {
            this.getTreeDataSouce(item.children)
          }
          item.key = item.equipmentId ? item.equipmentId : item.key
          item.value = item.equipmentId ? item.equipmentId : item.value
        })
      },
      expandAll() {
        this.expandedKeys = this.allTreeKeys
      },
      closeAll() {
        this.expandedKeys = ['-1']
      },
      refreshTree() {
        this.queryTreeData(this.selectedWorkshopIds)
      },
      onCheck(value, obj) {
        this.checkedKeys = value
        this.deviceNodes = obj.checkedNodes.filter(item => item.data.props.equipmentId).map(item => item.data.props.equipmentId)
      },
      handleCancel() {
        this.visible = false
      },
      handleOk() {
        this.$emit('selectFinished', this.deviceNodes)
        this.visible = false
      }
    }
  }
</script>
<style lang="less" scoped>
  /deep/ .ant-modal {
    /*transform-origin: 337px 50px;*/
  }
  .ant-card-body .table-operator {
    margin-bottom: 18px;
  }
  .ant-table-tbody .ant-table-row td {
    padding-top: 15px;
    padding-bottom: 15px;
  }
  .anty-row-operator button {
    margin: 0 5px
  }
  .ant-btn-danger {
    background-color: #ffffff
  }
  .ant-modal-cust-warp {
    height: 100%
  }
  .ant-modal-cust-warp .ant-modal-body {
    height: calc(100% - 110px) !important;
    overflow-y: auto
  }
  .ant-modal-cust-warp .ant-modal-content {
    height: 90% !important;
    overflow-y: hidden
  }
  .drawer-bottom-button {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-top: 1px solid #e8e8e8;
    padding: 10px 16px;
    text-align: right;
    left: 0;
    background: #fff;
    border-radius: 0 0 2px 2px;
  }
</style>
src/views/system/modules/UserModal.vue
@@ -74,12 +74,12 @@
          <a-input-search :readOnly="true" v-model="model.equipmentIds" @search="deviceSearch" enter-button placeholder="请选择设备" :disabled="!model.selectedProduction"/>
        </a-form-model-item>
        <a-form-model-item label="EAM中心分配" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="areaId">
          <j-multi-select-tag :triggerChange="true" v-model="model.eamFactoryIds" dictCode="mom_base_area,name,id,del_flag = 0 and type = 1" placeholder="请维护中心"/>
        <a-form-model-item label="EAM中心分配" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eamFactoryIds">
          <JSelectBaseFactory v-model="model.selectedBaseFactory" :multi="true" @back="backBaseFactoryInfo" :backProduction="true" :treeProductOpera="true"/>
        </a-form-model-item>
        <a-form-model-item label="EAM设备分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!productionDisabled">
          <a-input-search :readOnly="true" v-model="model.eamEquipmentIds" @search="deviceSearch" enter-button placeholder="请选择设备" :disabled="!model.selectedProduction"/>
          <a-input-search :readOnly="true" v-model="model.eamEquipmentIds" @search="eamDeviceSearch" enter-button placeholder="请选择EAM设备" :disabled="!model.selectedBaseFactory"/>
        </a-form-model-item>
        <a-form-model-item label="维修部门/班组分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!repairDepartDisabled">
@@ -100,6 +100,9 @@
    </div>
    <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/>
    <select-eam-device-modal ref="selectEamDeviceModal" @selectFinished="selectEamOK" :title="'选择EAM设备'"/>
  </a-drawer>
</template>
@@ -116,13 +119,17 @@
  import { mapActions } from 'vuex'
  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  import SelectDeviceModal from './SelectDeviceModal'
  import SelectEamDeviceModal from './SelectEamDeviceModal'
  import JSelectBaseFactory from "@comp/jeecgbiz/JSelectBaseFactory.vue";
  export default {
    name: 'UserModal',
    components: {
      JSelectBaseFactory,
      SelectDeviceModal,
      JSelectProduction,
      JSelectRepairDepart
      JSelectRepairDepart,
      SelectEamDeviceModal
    },
    data() {
      return {
@@ -181,17 +188,20 @@
          syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//同步用户到工作流
          queryTenantList: '/sys/tenant/queryList',
          userRepairDepartList: '/sys/user/userRepairDepartList',
          userBaseFactoryList: '/sys/user/userBaseFactoryList',
          repairDepartTreeList: '/eam/eamBaseRepairDepart/queryTreeList'
        },
        tenantsOptions: [],
        rolesOptions: [],
        nextDepartOptions: [],
        nextProductionOptions: [],
        nextBaseFactoryOptions:[],
        nextRepairDepartOptions: [],
        isDepartType: '',
        model: {
          selectedProduction: '',
          selectedRepairDeparts: ''
          selectedRepairDeparts: '',
          selectedBaseFactory:'',
        }
      }
    },
@@ -210,6 +220,17 @@
          }
          // å¦‚果清空车间值则重置选择设备
          if (newVal === '') this.model.equipmentIds = ''
        }
      },
      'model.selectedBaseFactory': {
        handler(newVal, oldVal) {
          if (newVal && this.$refs.selectEamDeviceModal) {
            // å¦‚果车间选择前后不一致则重置选择设备
            if ((oldVal && newVal !== oldVal)) this.model.eamEquipmentIds = ''
            this.$refs.selectEamDeviceModal.queryTreeData(newVal)
          }
          // å¦‚果清空车间值则重置选择设备
          if (newVal === '') this.model.eamEquipmentIds = ''
        }
      }
    },
@@ -265,6 +286,7 @@
          selectedroles: '',
          selecteddeparts: '',
          selectedProduction: '',
          selectedBaseFactory:'',
          selectedRepairDeparts: ''
        })
      },
@@ -288,6 +310,7 @@
          that.getUserDeparts(record.id)
          that.getUserProductions(record.id)
          that.getUserRepairDeparts(record.id)
          this.getUserBaseFactorys(record.id)
        }
      },
      isDisabledAuth(code) {
@@ -403,6 +426,27 @@
          }
        })
      },
      getUserBaseFactorys(userid) {
        let that = this
        // èŽ·å–EAM中心/工区/工段分配
        getAction(that.url.userBaseFactoryList, { userId: userid }).then((res) => {
          if (res.success) {
            let BaseFactoryOptions = []
            let selectedBaseFactoryOptionsKeys = []
            for (let i = 0; i < res.result.length; i++) {
              selectedBaseFactoryOptionsKeys.push(res.result[i].key)
              //新增负责维修部门/班组选择下拉框
              BaseFactoryOptions.push({
                value: res.result[i].key,
                label: res.result[i].title
              })
            }
            this.$set(this.model, 'selectedBaseFactory', selectedBaseFactoryOptionsKeys.join(','))
            that.nextBaseFactoryOptions = BaseFactoryOptions
          }
        })
      },
      backDepartInfo(info) {
        this.model.departIds = this.model.selecteddeparts
        this.nextDepartOptions = info.map((item, index, arr) => {
@@ -413,6 +457,13 @@
      backProductionInfo(info) {
        this.model.productionIds = this.model.selectedProduction
        this.nextProductionOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
      },
      backBaseFactoryInfo(info) {
        this.model.eamFactoryIds = this.model.selectedBaseFactory
        this.nextBaseFactoryOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
@@ -429,6 +480,7 @@
        this.userId = ''
        this.nextDepartOptions = []
        this.nextProductionOptions = []
        this.nextBaseFactoryOptions = []
        this.nextRepairDepartOptions = []
        this.departIdShow = false
      },
@@ -437,6 +489,7 @@
        this.visible = false
        this.disableSubmit = false
        this.nextDepartOptions = []
        this.nextProductionOptions = []
        this.nextProductionOptions = []
        this.nextRepairDepartOptions = []
        this.departIdShow = false
@@ -615,6 +668,13 @@
        this.$refs.selectDeviceModal.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : []
      },
      eamDeviceSearch(){
        this.$refs.selectEamDeviceModal.visible = true
        this.$refs.selectEamDeviceModal.selectedRowKeys = []
        this.$refs.selectEamDeviceModal.selectedRows = []
        this.$refs.selectEamDeviceModal.checkedKeys = this.model.eamEquipmentIds ? this.model.eamEquipmentIds.split(',') : []
      },
      /**
       * é€‰æ‹©å·²æœ‰è®¾å¤‡åŽç‚¹å‡»ç¡®å®šæ—¶è§¦å‘
       * @param data å·²é€‰æ‹©çš„设备数组
@@ -622,6 +682,10 @@
      selectOK(data) {
        console.log('data=', data)
        this.$set(this.model, 'equipmentIds', data.join(','))
      },
      selectEamOK(data) {
        console.log('data=', data)
        this.$set(this.model, 'eamEquipmentIds', data.join(','))
      }
    }
  }