zouyu
2025-03-12 077a9af4717bed36efcf1a6fc420de2b679cf467
src/views/CNAS/resourceDemand/device/component/check-and-accept.vue
@@ -17,7 +17,7 @@
      </div>
    </div>
    <div class="tables" style="margin-top: 10px;">
      <el-table ref="table" :data="tableDataAlist" height="100%">
      <el-table ref="table" :data="tableDataAlist" height="100%" v-loading="tableLoading">
        <el-table-column label="序号" type="index" width="60">
          <template v-slot="scope">
            <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
@@ -468,12 +468,13 @@
import { dateFormat } from '@/utils/date'
import file from "@/utils/file";
import {
  deleteCNASFile,
  deleteCNASFile, deleteIncidentReport,
  deleteIncidentReportAll, getShowIncidentReport, incidentReportExport, incidentReportPage,
  saveIncidentReportData,
  selectDeviceByCode
} from "@/api/cnas/resourceDemand/device";
import {selectUserCondition} from "@/api/system/user";
import {mapGetters} from "vuex";
export default {
  props: {
@@ -488,6 +489,7 @@
    return {
      //事故设备信息
      tableDataAlist: [], // 更改变量名称
      tableLoading: false,
      dialogVisible: false,
      rules: {
        quantity: [{ required: true, message: '请输入数量', trigger: 'blur' }],
@@ -517,7 +519,8 @@
  computed: {
    action() {
      return this.javaApi + '/personBasicInfo/saveCNASFile'
    }
    },
    ...mapGetters(["nickName"]),
  },
  mounted() {
    // 获取设备事故信息
@@ -661,32 +664,31 @@
      this.$refs.form.validate((valid) => {
        if (valid === true || saveState !== '1submit') {
          // 给当前环节设置创建人与时间
          let user = JSON.parse(localStorage.getItem('user'))
          const dateTime = dateFormat(new Date())
          // 获取当前环节操作人与日期
          switch (this.currentStep) {
            case 0:
              this.form.submitOperatingPersonnel = user.name
              this.form.submitOperatingPersonnel = this.nickName
              this.form.submitDate = dateTime
              break
            case 1:
              this.form.unpackingOperatingPersonnel = user.name
              this.form.unpackingOperatingPersonnel = this.nickName
              this.form.unpackingDate = dateTime
              break
            case 2:
              this.form.installOperatingPersonnel = user.name
              this.form.installOperatingPersonnel = this.nickName
              this.form.installDate = dateTime
              break
            case 3:
              this.form.installationAcceptanceOperatingPersonnel = user.name
              this.form.installationAcceptanceOperatingPersonnel = this.nickName
              this.form.installationAcceptanceDate = dateTime
              break
            case 4:
              this.form.acceptanceCheckOperatingPersonnel = user.name
              this.form.acceptanceCheckOperatingPersonnel = this.nickName
              this.form.acceptanceCheckDate = dateTime
              break
            case 5:
              this.form.acceptanceAuditOperatingPersonnel = user.name
              this.form.acceptanceAuditOperatingPersonnel = this.nickName
              this.form.acceptanceAuditDate = dateTime
              break
            default:
@@ -765,19 +767,21 @@
    },
    // 获取设备事故信息(根据从vuex中获取到的设备名称id进行数据查询)
    getDeviceAList(deviceId) {
      this.tableLoading = true
      incidentReportPage({deviceId: deviceId, size:this.search.size, current:this.search.current, processNumber: this.search.processNumber}).then(res => {
        this.tableLoading = false
        if (res.code == 200) {
          this.tableDataAlist = res.data.records
          this.search.total = res.data.total
        }
      }).catch(err => {
        this.tableLoading = false
      })
    },
    //table 事件处理开始处
    // 下载附件
    handleAttachmentClick(row) {
      // 模拟下载附件
      const imageUrl = this.javaApi+'/img/'+row.systemFileName; // 图片 URL
      // downloadImage(imageUrl);
      file.downloadIamge(imageUrl,row.fileName)
      this.$download.saveAs(row.systemFileName, row.fileName)
    },
    handleViewClick(row) {
      getShowIncidentReport({id: row.id}).then(res => {
@@ -797,7 +801,7 @@
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteIncidentReportAll({id: row.id}).then(res => {
        deleteIncidentReport({id: row.id}).then(res => {
          if (res.code == 200) {
            this.$message.success('删除成功')
            this.getDeviceAList(this.clickNodeVal.value);
@@ -870,6 +874,7 @@
}
.search {
  margin-top: 10px;
  background-color: #fff;
  height: 40px;
  display: flex;