Lius
2025-08-22 79ced684c6ec28c8f6affa0ac6cd44e1a88f9cf3
src/views/mdc/base/modules/EquipmentList/UserModal.vue
@@ -120,21 +120,6 @@
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备级别">
              <j-dict-select-tag placeholder="请选择设备级别" dictCode="device_level" v-model="model.deviceLevel"
                                 :disabled="disableSubmit"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="设备种类">
              <j-dict-select-tag placeholder="请选择设备种类" dictCode="device_category" v-model="model.deviceCategory"
                                 :disabled="disableSubmit"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="排序">
              <a-input :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="请输入排序"
                       v-model="model.sortNo" style="width: 100%"/>
@@ -144,36 +129,8 @@
        <a-row :gutter="24">
          <a-col :span='12'>
            <a-form-model-item label="配送小组" prop="teamCode">
              <j-dict-select-tag placeholder="请选择配送小组" dictCode="mdc_staff_team" v-model="model.teamCode"
                                 :disabled="disableSubmit"/>
            </a-form-model-item>
          </a-col>
          <a-col :span='12'>
            <a-form-model-item label="设备图片">
              <j-image-upload v-model="model.equipmentImage" :disabled="disableSubmit"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24" v-if="systemType">
          <a-col :span='24'>
            <a-form-model-item label="系统类型" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
              <a-radio-group name="radioGroup" v-model="systemValue" :disabled="disableSubmit">
                <a-radio value="1">DNC</a-radio>
                <a-radio value="2">MDC</a-radio>
                <a-radio value="3">通用</a-radio>
              </a-radio-group>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span='12'>
            <a-form-model-item v-if="isDepartType == 0" label="系统版本号">
              <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="请输入系统版本号"
                       v-model="model.systemVersion"/>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -243,9 +200,7 @@
          driveType: '',
          systemType: '',
          deviceLevel: '',
          deviceCategory: '',
          deviceTypeDnc: '',
          deviceTypeMdc: ''
          deviceCategory: ''
        },
        labelCol: {
          xs: { span: 24 },
@@ -264,8 +219,6 @@
          sm: { span: 19 }
        },
        confirmLoading: false,
        systemType: false,
        systemValue: '3',
        url: {
          userWithDepart: '/mdc/mdcEquipment/equipmentDepartList', // 引入为指定用户查看部门信息需要的url
          //引入为指定用户查看车间信息需要的url
@@ -283,7 +236,6 @@
    created() {
      this.queryGroup()
      this.queryTreeData()
      this.getAppPlatformName()
    },
    methods: {
      ...mapActions(['QueryDepartTree']),
@@ -296,13 +248,6 @@
              message: '消息',
              description: res.message
            })
          }
        })
      },
      getAppPlatformName() {
        getAction(`/system/sysParams/query/by/settingKey?settingKey=system_type`).then(res => {
          if (res.success) {
            this.systemType = res.result.settingValue === '0'
          }
        })
      },
@@ -359,16 +304,11 @@
        //根据屏幕宽度自适应抽屉宽度
        this.resetScreenSize()
        if (record.systemValue != null) {
          this.systemValue = record.systemValue
        } else {
          this.systemValue = '3'
        }
        that.model = Object.assign({}, record)
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(that.model, 'selectedDeparts', 'selectedProduction', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort',
            'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName', 'systemValue'))
            'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName'))
        })
        if (record.hasOwnProperty('id')) {
          that.getUserDeparts(record.id)
@@ -462,17 +402,11 @@
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true
            if (this.systemValue == null) {
              this.$message.warning('请选择系统类型!')
              return false
            }
            let obj
            if (!this.model.id) {
              this.model.id = this.userId
              this.model.systemValue = this.systemValue
              obj = addEquipment(this.model)
            } else {
              this.model.systemValue = this.systemValue
              obj = editEquipment(this.model, {
                id: this.model.id
              })