spring
2025-03-03 f01d916828cf9746a0f438d9472af9271efd9729
src/views/CNAS/resourceDemand/device/component/inspectionForm.vue
@@ -136,6 +136,13 @@
</template>
<script>
import {
  getDeviceInspectionRecord,
  addDeviceInspectionRecord,
  updateDeviceInspectionRecord,
  reviewDeviceInspectionRecord,
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
export default {
  name: "inspection-form",
  // import 引入的组件需要注入到对象中才能使用
@@ -181,7 +188,9 @@
      }
    },
    searchInfo() {
      this.$axios.get(this.$api.deviceInspectionRecord.getDeviceInspectionRecord + '?inspectionRecordId=' + this.form.inspectionRecordId).then(res => {
      getDeviceInspectionRecord({
        inspectionRecordId: this.form.inspectionRecordId
      }).then(res => {
        if (res.code === 200) {
          this.form = { ...res.data }
          this.details = this.form.details || []
@@ -198,13 +207,7 @@
      this.form.details = this.HaveJson(this.details)
      this.submitFormLoading = true
      if (this.operationType === 'add') {
        this.$axios.post(this.$api.deviceInspectionRecord.addDeviceInspectionRecord,
          this.form, {
          headers: {
            'Content-Type': 'application/json'
          },
          noQs: true
        }).then(res => {
        addDeviceInspectionRecord(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('新增成功')
            this.resetForm()
@@ -214,13 +217,7 @@
          this.submitFormLoading = false
        })
      } else {
        this.$axios.post(this.$api.deviceInspectionRecord.updateDeviceInspectionRecord,
          this.form, {
          headers: {
            'Content-Type': 'application/json'
          },
          noQs: true
        }).then(res => {
        updateDeviceInspectionRecord(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('新增成功')
            this.resetForm()
@@ -236,13 +233,7 @@
        inspectionRecordId: this.form.inspectionRecordId,
        status: status,
      }
      this.$axios.post(this.$api.deviceInspectionRecord.reviewDeviceInspectionRecord,
        params, {
        headers: {
          'Content-Type': 'application/json'
        },
        noQs: true
      }).then(res => {
      reviewDeviceInspectionRecord(params).then(res => {
        if (res.code == 200) {
          this.$message.success('审核成功')
          this.resetForm()
@@ -257,18 +248,11 @@
      this.$emit('closeDialog')
    },
    getUserList() {
      this.$axios.post(this.$api.user.selectUserList, {
        page: { current: -1, size: -1, },
        entity: { name: null }
      }, {
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(res => {
      selectUserCondition().then(res => {
        if (res.code === 201) {
          return
        }
        this.userList = res.data.records
        this.userList = res.data
      })
    },
  },