zhangherong
2025-03-06 0b22c1255437bc6f0170355dad2a35172e0eddfd
src/views/eam/modules/projectMaintenanceOrder/ProjectMaintenanceOrderForm.vue
@@ -97,10 +97,7 @@
              :wrapperCol='wrapperCol'
              prop='annex'
            >
              <j-image-upload
                :isMultiple="false"
                v-model="model.annex"
              ></j-image-upload>
            <j-upload :returnUrl= "false" :isMultiple="false"  v-model="model.file" ></j-upload>
            </a-form-model-item>
          </a-col>
          <a-col :span='12'>
@@ -215,10 +212,10 @@
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@comp/jeecg/JVxeTable'
import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
import JFormContainer from '@/components/jeecg/JFormContainer'
import { getAction } from '@api/manage'
import { VALIDATE_FAILED, getRefPromise, validateFormAndTables,validateFormModelAndTables} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
export default {
  name: 'ProjectMaintenanceOrderForm',
@@ -310,7 +307,7 @@
              }]
          },
          {
            title: '设备编码',
            title: '统一编码',
            key: 'equipmentNum',
            type: JVXETypes.normal,
            width: '140px',
@@ -318,16 +315,7 @@
            fixed: 'left'
          },
          {
            title: '资产编码',
            key: 'assetNumber',
            type: JVXETypes.normal,
            width: '140px',
            align: "center",
            fixed: 'left',
            defaultValue: ''
          },
          {
            title: '委外单位',
            title: '外委单位',
            key: 'supplierId',
            type: JVXETypes.slot,
            disabled: true,
@@ -337,7 +325,7 @@
            defaultValue: ''
          },
          {
            title: '委外单位',
            title: '外委单位',
            key: 'supplierId',
            type: JVXETypes.hidden
          },
@@ -543,6 +531,32 @@
  },
  methods: {
    handleOk() {
      this.model['annex'] = this.model.file[0].filePath;
      /** 触发表单验证 */
      this.getAllTable().then(tables => {
        /** 一次性验证主表和所有的次表 */
        return validateFormModelAndTables(this.$refs.form,this.model, tables)
      }).then(allValues => {
        /** 一次性验证一对一的所有子表 */
        return this.validateSubForm(allValues)
      }).then(allValues => {
        if (typeof this.classifyIntoFormData !== 'function') {
          throw this.throwNotFunction('classifyIntoFormData')
        }
        let formData = this.classifyIntoFormData(allValues)
        // 发起请求
        return this.request(formData)
      }).catch(e => {
        if (e.error === VALIDATE_FAILED) {
          // 如果有未通过表单验证的子表,就自动跳转到它所在的tab
          this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
        } else {
          console.error(e)
        }
      })
    },
    getSuppler() {
      getAction(this.url.supplierVoList).then((res) => {
        if (res.success) {
@@ -661,6 +675,7 @@
    /** 调用完edit()方法之后会自动调用此方法 */
    editAfter() {
      this.$nextTick(() => {
        this.model.file = this.model.annex;
      })
      // 加载子表数据
      if (this.model.id) {