cuijian
2025-07-01 0211b730e5f0b1f10a8a3243e30fe599e22f2238
src/views/system/modules/UserModal.vue
@@ -139,22 +139,22 @@
          label="车间分配"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          v-show="!productionDisabled"
          v-show="!factoryDisabled"
        >
          <j-select-production
            v-model="model.selectedProduction"
          <j-select-factory
            v-model="model.selectedFactory"
            :multi="true"
            @back="backProductionInfo"
            @back="backFactoryInfo"
            :backProduction="true"
            :treeProductOpera="true"
          ></j-select-production>
          ></j-select-factory>
        </a-form-model-item>
        <!--<a-form-model-item-->
          <!--label="选择设备"-->
          <!--:labelCol="labelCol"-->
          <!--:wrapperCol="wrapperCol"-->
          <!--v-show="!productionDisabled"-->
          <!--v-show="!factoryDisabled"-->
        <!--&gt;-->
          <!--<a-input-search-->
            <!--:readOnly="true"-->
@@ -162,7 +162,7 @@
            <!--@search="deviceSearch"-->
            <!--enter-button-->
            <!--placeholder="请选择设备"-->
            <!--:disabled="!model.selectedProduction"-->
            <!--:disabled="!model.selectedFactory"-->
          <!--/>-->
        <!--</a-form-model-item>-->
@@ -350,7 +350,7 @@
  import { addUser, editUser, queryUserRole, queryall } from '@/api/api'
  import { disabledAuthFilter } from '@/utils/authFilter'
  import { duplicateCheck } from '@/api/api'
  import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction'
  import JSelectFactory from '../../../components/jeecgbiz/JSelectFactory'
  import { mapActions } from 'vuex'
  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  // import SelectDeviceModal from './SelectDeviceModal'
@@ -359,12 +359,12 @@
    name: 'UserModal',
    components: {
      // SelectDeviceModal,
      JSelectProduction
      JSelectFactory
    },
    data() {
      return {
        departDisabled: false, //是否是我的部门调用该页面
        productionDisabled: false, //是否是我的车间调用该页面
        factoryDisabled: false, //是否是我的车间调用该页面
        roleDisabled: false, //是否是角色维护调用该页面
        modalWidth: 800,
        drawerWidth: 700,
@@ -420,10 +420,10 @@
        tenantsOptions: [],
        rolesOptions: [],
        nextDepartOptions: [],
        nextProductionOptions: [],
        nextFactoryOptions: [],
        isDepartType: '',
        model: {
          selectedProduction: ''
          selectedFactory: ''
        }
      }
    },
@@ -433,7 +433,7 @@
          if (value) this.initDictData('password_length')
        }
      },
      'model.selectedProduction': {
      'model.selectedFactory': {
        handler(newVal, oldVal) {
          if (newVal) {
            // 如果车间选择前后不一致则重置选择设备
@@ -481,7 +481,7 @@
          userIdentity: 1,
          selectedroles: '',
          selecteddeparts: '',
          selectedProduction: ''
          selectedFactory: ''
        })
      },
      edit(record) {
@@ -578,19 +578,19 @@
        // 获取车间分配
        getAction(that.url.userProductionList, { userId: userid }).then((res) => {
          if (res.success) {
            let ProductionOptions = []
            let selectProductKeys = []
            let FactoryOptions = []
            let selectFactoryKeys = []
            for (let i = 0; i < res.result.length; i++) {
              selectProductKeys.push(res.result[i].key)
              selectFactoryKeys.push(res.result[i].key)
              //新增负责部门选择下拉框
              ProductionOptions.push({
              FactoryOptions.push({
                value: res.result[i].key,
                label: res.result[i].title
              })
            }
            this.$set(this.model, 'selectedProduction', selectProductKeys.join(','))
            that.nextProductionOptions = ProductionOptions
            this.$set(this.model, 'selectedFactory', selectFactoryKeys.join(','))
            that.nextFactoryOptions = FactoryOptions
          }
        })
        //车间的url
@@ -602,9 +602,9 @@
          return c
        })
      },
      backProductionInfo(info) {
        this.model.productionIds = this.model.selectedProduction
        this.nextProductionOptions = info.map((item, index, arr) => {
      backFactoryInfo(info) {
        this.model.factoryIds = this.model.selectedFactory
        this.nextFactoryOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
@@ -613,7 +613,7 @@
      refresh() {
        this.userId = ''
        this.nextDepartOptions = []
        this.nextProductionOptions = []
        this.nextFactoryOptions = []
        this.departIdShow = false
      },
      close() {
@@ -621,7 +621,7 @@
        this.visible = false
        this.disableSubmit = false
        this.nextDepartOptions = []
        this.nextProductionOptions = []
        this.nextFactoryOptions = []
        this.departIdShow = false
        this.$refs.form.resetFields()
      },