src/views/CNAS/resourceDemand/device/component/applicationForm.vue
@@ -115,10 +115,12 @@
  addDeviceExternalApply,
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import draftSave from '@/mixins/draftSave'
export default {
  name: "applicationForm",
  // import 引入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  data() {
    // 这里存放数据
    return {
@@ -165,12 +167,17 @@
      this.getUserList()
      if (this.form.externalApplyId) {
        this.searchInfo()
      } else {
        this.$nextTick(() => {
          this.draftRestore('applicationForm', 'form', '', 'dialogVisible')
        })
      }
    },
    // 查询详情
    searchInfo() {
      getDeviceExternalApply({ externalApplyId: this.form.externalApplyId }).then(res => {
        if (res.code === 200) {
          const externalApplyId = this.form.externalApplyId
          this.form = { ...res.data }
          if (res.data.isFinish === 0) {
            if (this.form.departmentHeadUserId) {
@@ -189,6 +196,9 @@
            this.currentStep = 4
            this.showStep = 3
          }
          this.$nextTick(() => {
            this.draftRestore('applicationForm', 'form', externalApplyId, 'dialogVisible')
          })
        }
      }).catch(error => {
        console.error(error)
@@ -205,6 +215,7 @@
          addDeviceExternalApply(this.form).then(res => {
            if (res.code == 200) {
              this.$message.success('新增成功')
              this.draftClear('applicationForm')
              this.resetForm()
            }
            this.submitFormLoading = false
@@ -216,6 +227,7 @@
    },
    // 关闭弹框
    resetForm() {
      this.draftStop('applicationForm')
      this.dialogVisible = false
      this.$emit('closeDialog')
    },