src/views/CNAS/resourceDemand/device/component/acceptanceForm.vue
@@ -79,12 +79,10 @@
  updateDeviceAcceptance,
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import draftSave from '@/mixins/draftSave'
export default {
  name: "acceptance-form",
  // import 引入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  data() {
    // 这里存放数据
    return {
@@ -124,19 +122,13 @@
      this.getUserList()
      if (this.form.acceptanceId) {
        this.searchInfo()
      } else if (this.operationType !== 'view') {
        this.draftRestore('acceptanceForm', 'form', this.form.deviceId, 'dialogVisible')
      }
    },
    // 查询详情
    searchInfo() {
      getDeviceAcceptance({ acceptanceId: this.form.acceptanceId }).then(res => {
        if (res.code === 200) {
          const id = this.form.acceptanceId
          this.form = { ...res.data }
          if (this.operationType !== 'view') {
            this.draftRestore('acceptanceForm', 'form', id, 'dialogVisible')
          }
        }
      }).catch(error => {
        console.error(error)
@@ -150,7 +142,6 @@
            addDeviceAcceptance(this.form).then(res => {
              if (res.code == 200) {
                this.$message.success('新增成功')
                this.draftClear('acceptanceForm')
                this.resetForm()
              }
              this.submitFormLoading = false
@@ -161,7 +152,6 @@
            updateDeviceAcceptance(this.form).then(res => {
              if (res.code == 200) {
                this.$message.success('修改成功')
                this.draftClear('acceptanceForm')
                this.resetForm()
              }
              this.submitFormLoading = false
@@ -174,7 +164,6 @@
    },
    // 关闭弹框
    resetForm() {
      this.draftStop('acceptanceForm')
      this.dialogVisible = false
      this.$emit('closeDialog')
    },