lyh
2025-07-11 75b875f7538bf7700684c2eb2582c2d8f0aa8675
src/views/eam/equipment/modules/EamEquipmentModal.vue
@@ -24,7 +24,7 @@
                </a-col>
                <a-col :span="customSpan">
                  <a-form-model-item prop="equipmentCode" label="统一编码">
                    <a-input placeholder="请输入统一编码" v-model="model.equipmentCode"/>
                    <a-input placeholder="请输入统一编码" v-model="model.equipmentCode" :disabled="!editable"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="customSpan">
@@ -35,7 +35,7 @@
                <a-col :span="customSpan">
                  <a-form-model-item prop="factoryOrgCode" label="使用部门">
                    <a-tree-select v-model="model.factoryOrgCode" style="width: 100%" show-search
                                   :tree-data="productionTreeData"
                                   :tree-data="productionTreeData" :disabled="!editable"
                                   :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                                   placeholder="请选择使用部门" allow-clear treeNodeFilterProp="title"
                                   :replaceFields="{key:'orgCode',value:'orgCode'}"
@@ -47,7 +47,7 @@
              <a-row>
                <a-col :span="customSpan">
                  <a-form-model-item prop="equipmentCategory" label="所属分类">
                    <j-dict-select-tag dict-code="equipment_category" placeholder="请选择所属分类"
                    <j-dict-select-tag dict-code="equipment_category" placeholder="请选择所属分类" :disabled="!editable"
                                       v-model="model.equipmentCategory"/>
                  </a-form-model-item>
                </a-col>
@@ -99,7 +99,7 @@
              <a-row>
                <a-col :span="customSpan">
                  <a-form-model-item label="系统">
                    <a-input placeholder="请输入系统" :disabled="Boolean(+model.operationSystem)" v-model="model.system"/>
                    <a-input placeholder="请输入系统" :disabled="!Boolean(+model.operationSystem)" v-model="model.system"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="customSpan">
@@ -216,7 +216,8 @@
              <a-row>
                <a-col :span="customSpan">
                  <a-form-model-item label="本次三保日期">
                    <a-date-picker v-model="model.latestThirdMaintenance" value-format="YYYY-MM-DD" style="width:100%"/>
                    <a-date-picker v-model="model.latestThirdMaintenance" value-format="YYYY-MM-DD"
                                   :disabled="!editable" style="width:100%"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="customSpan">
@@ -225,14 +226,15 @@
                  </a-form-model-item>
                </a-col>
                <a-col :span="customSpan">
                  <a-form-model-item label="三保周期">
                    <a-input-number placeholder="请输入三保周期" v-model="model.thirdMaintenancePeriod" :min="0"
                  <a-form-model-item label="三保周期(年)">
                    <a-input-number placeholder="请输入三保周期(年)" v-model="model.thirdMaintenancePeriod" :min="1"
                                    style="width: 100%"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="customSpan">
                  <a-form-model-item label="本次技术鉴定日期">
                    <a-date-picker v-model="model.latestTechnologyCheck" value-format="YYYY-MM-DD" style="width:100%"/>
                    <a-date-picker v-model="model.latestTechnologyCheck" value-format="YYYY-MM-DD"
                                   :disabled="!editable" style="width:100%"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
@@ -244,8 +246,8 @@
                  </a-form-model-item>
                </a-col>
                <a-col :span="customSpan">
                  <a-form-model-item label="技术鉴定周期">
                    <a-input-number placeholder="请输入技术鉴定周期" v-model="model.technologyCheckPeriod" :min="0"
                  <a-form-model-item label="技术鉴定周期(年)">
                    <a-input-number placeholder="请输入技术鉴定周期(年)" v-model="model.technologyCheckPeriod" :min="1"
                                    style="width: 100%"/>
                  </a-form-model-item>
                </a-col>
@@ -350,12 +352,9 @@
        }
      }
    },
    created() {
      this.loadAllProductionTree()
    },
    methods: {
      add() {
        this.editable = false
        this.editable = true
        //初始化默认值
        this.model = {
          operationSystem: 1,
@@ -365,7 +364,7 @@
      },
      edit(record) {
        this.editable = true
        this.editable = false
        this.model = Object.assign({}, record)
        this.visible = true
      },
@@ -376,32 +375,34 @@
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true
            let httpurl = ''
            let httpUrl = ''
            let method = ''
            if (!this.model.id) {
              httpurl += this.url.add
              httpUrl += this.url.add
              method = 'post'
            } else {
              httpurl += this.url.edit
              httpUrl += this.url.edit
              method = 'put'
            }
            httpAction(httpurl, this.model, method).then((res) => {
              if (res.success) {
                that.$notification.success({
                  message: '消息',
                  description: res.message
                })
                that.$emit('ok')
                that.close()
              } else {
                that.$notification.warning({
                  message: '消息',
                  description: res.message
                })
              }
            }).finally(() => {
              that.confirmLoading = false
            })
            httpAction(httpUrl, this.model, method)
              .then((res) => {
                if (res.success) {
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.$emit('ok')
                  that.close()
                } else {
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .finally(() => {
                that.confirmLoading = false
              })
          } else {
            return false
          }