zhuo
2025-05-06 6fe1caffebf43b41faf8614068730d656e686b59
src/views/CNAS/resourceDemand/device/component/inspectionForm.vue
@@ -59,7 +59,8 @@
      </div>
      <div style="text-align: center">测试数据记录</div>
      <div style="margin: 10px 0">
        <el-table ref="yearTable" :data="details" height="300px" style="width: 100% ;">
        <el-table ref="yearTable" :data="details" height="300px" style="width: 100% ;"
                  :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border>
          <el-table-column align="center" header-align="center" label="序号" type="index" width="60"></el-table-column>
          <el-table-column label="测试项目" min-width="170" prop="testItems">
            <template slot-scope="scope">
@@ -136,6 +137,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 +189,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 +208,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 +218,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 +234,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 +249,8 @@
      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 => {
        if (res.code === 201) {
          return
        }
        this.userList = res.data.records
      selectUserCondition().then(res => {
        this.userList = res.data
      })
    },
  },