cuijian
2023-10-18 ca8cf61b9b31099ea843c36bf9da4740650cfbc9
src/views/eam/modules/operationCertificateApply/OperationCertificateApplyForm.vue
@@ -66,7 +66,7 @@
<script>
import { getAction } from '@/api/manage'
import { getAction,httpAction } from '@/api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@/components/jeecg/JVxeTable'
import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
@@ -82,6 +82,7 @@
  },
  data() {
    return {
      isAchievement:false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
@@ -173,7 +174,8 @@
            type: JVXETypes.input,
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
            defaultValue: '',
            disabled:false
          },
          {
            title: '实操成绩',
@@ -181,7 +183,8 @@
            type: JVXETypes.input,
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
            defaultValue: '',
            disabled:false
          },
          {
            title: '考试结论',
@@ -190,21 +193,23 @@
            customValue: ['Y', 'N'],
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
            defaultValue: '',
            disabled:false
          },
          {
            title: '状态',
            key: 'status',
            type: JVXETypes.input,
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
          }
          // {
          //   title: '状态',
          //   key: 'status',
          //   type: JVXETypes.input,
          //   width: '200px',
          //   placeholder: '请输入${title}',
          //   defaultValue: ''
          // }
        ]
      },
      url: {
        add: '/eam/operationCertificateApply/add',
        edit: '/eam/operationCertificateApply/edit',
        addOperationCertificate:'/eam/operationCertificate/addOperationCertificate',
        queryById: '/eam/operationCertificateApply/queryById',
        operationCertificateApplyDetail: {
          list: '/eam/operationCertificateApply/queryOperationCertificateApplyDetailByMainId'
@@ -218,7 +223,7 @@
      type: Boolean,
      default: false,
      required: false
    }
    },
  },
  computed: {
    formDisabled() {
@@ -270,7 +275,34 @@
    },
    validateError(msg) {
      this.$message.error(msg)
    }
    },
    request(formData) {
      let url = this.url.add, method = 'post'
      if (this.model.id) {
        url = this.url.edit
        method = 'put'
      }
      this.confirmLoading = true
      console.log("formData===>",formData);
      httpAction(url, formData, method).then((res) => {
        if (res.success) {
          httpAction(this.url.addOperationCertificate, formData.operationCertificateApplyDetailList, 'post').then((res) => {
            if (res.success) {
              this.$message.success(res.message)
            }else {
              this.$message.warning(res.message)
            }
          })
          this.$message.success(res.message)
          this.$emit('ok')
          this.close()
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
        this.confirmLoading = false
      })
    },
  }
}