小小儁爺
2026-03-13 217e6456835927d5da7d385056c0062da7436041
src/views/deviceManager/deviceList.vue
@@ -232,11 +232,20 @@
              <el-table-column
                label="操作"
                width="120"
                width="150"
                fixed="right"
              >
                <template slot-scope="{row}">
                  <div class="operationClass">
                    <el-tooltip v-del-tab-index class="item" effect="dark" content="履历" placement="top">
                      <i
                        class="el-icon-view"
                        :style="{color:$store.state.settings.theme}"
                        style="cursor: pointer;margin-right: 15px"
                        @click="view2(row)"
                      />
                    </el-tooltip>
                    <el-tooltip v-del-tab-index class="item" effect="dark" content="SOP预览" placement="top">
                      <i
                        v-if="mesSetting.device"
@@ -439,13 +448,153 @@
      </span>
    </el-dialog>
    <!--    履历-->
    <el-dialog
      v-el-drag-dialog
      title="履历查看"
      :visible.sync="dialogVisibleResume"
      width="1000px"
      :close-on-click-modal="false"
      top="7vh"
      class="dialogFormClass"
      @closed="handleCloseResume"
    >
      <div style="display: flex;justify-content: center;font-size: 18px;font-weight: bolder">设备在线信息查询</div>
      <el-descriptions class="margin-top" title=" " :column="3" size="size" border>
        <!--        <template slot="extra">-->
        <!--          <el-button type="primary" size="small">操作</el-button>-->
        <!--        </template>-->
        <el-descriptions-item>
          <template slot="label">
            设备编码
          </template>
          {{ formResume.mouldcode }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            设备名称
          </template>
          {{ formResume.mouldname }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            设备类型
          </template>
          {{ formResume.mouldspec||'/' }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            设备状态
          </template>
          <el-tag v-if="formResume.status==='Y'" size="small" type="success">正常</el-tag>
          <el-tag v-if="formResume.status==='N'" size="small" type="danger">停用</el-tag>
        </el-descriptions-item>
        <!--        <el-descriptions-item>-->
        <!--          <template slot="label">-->
        <!--            使用状态-->
        <!--          </template>-->
        <!--          &lt;!&ndash;          {{ formResume.usestatus }}&ndash;&gt;-->
        <!--          {{ formResume.usestatus?onstateArr.find(i => parseFloat(i.code) === parseFloat(formResume.usestatus)).name:'/' }}-->
        <!--        </el-descriptions-item>-->
        <!--        <el-descriptions-item>-->
        <!--          <template slot="label">-->
        <!--            预计寿命(次)-->
        <!--          </template>-->
        <!--          {{ formResume.surp_life }}-->
        <!--        </el-descriptions-item>-->
        <!--        <el-descriptions-item>-->
        <!--          <template slot="label">-->
        <!--            剩余寿命(次)-->
        <!--          </template>-->
        <!--          {{ formResume.serlife }}-->
        <!--        </el-descriptions-item>-->
        <el-descriptions-item>
          <template slot="label">
            查看人员
          </template>
          {{ formResume.username }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            查看时间
          </template>
          {{ formResume.lm_date }}
        </el-descriptions-item>
      </el-descriptions>
      <div style="display: flex;justify-content: center;font-size: 18px;font-weight: bolder;margin: 20px 0">设备流转记录</div>
      <div class="elTableDiv">
        <el-table
          ref="tableDataRef2"
          class="tableFixed"
          :data="tableResume"
          height="370px"
          border
          :row-class-name="tableRowClassName"
          :style="{width: 100+'%',height:'370px',}"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
        >
          <el-table-column
            prop="rowNum"
            width="50"
            fixed
            label="序号"
          />
          <el-table-column
            prop="opertype"
            label="操作类型"
          />
          <el-table-column
            prop="operusername"
            label="操作人员"
          />
          <el-table-column
            prop="operdate"
            label="操作时间"
          />
          <el-table-column
            prop="opertype"
            label="结果/对象"
          />
        </el-table>
      </div>
      <!--分页-->
      <pagination
        :total="totalResume"
        :page.sync="formResume.page"
        :limit.sync="formResume.rows"
        align="right"
        layout="total,prev, pager, next,sizes"
        popper-class="select_bottom"
        @pagination="getMoldResumeSearch"
      />
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button v-waves @click="dialogVisibleResume=false">返 回</el-button>
          <!--          <el-button-->
          <!--            v-waves  -->
          <!--            type="primary"-->
          <!--            :loading="$store.state.app.buttonIsDisabled"-->
          <!--            :disabled="$store.state.app.buttonIsDisabled"-->
          <!--            @click="dialogVisibleConfirm"-->
          <!--          >确 定</el-button>-->
        </div>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import waves from '@/directive/waves'
import Pagination from '@/components/Pagination'
import { validateCode } from '@/utils/global'
import { handleDatetime2, validateCode } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import arrayToTree from 'array-to-tree'
import { PrentOrganization } from '@/api/GeneralBasicData'
@@ -453,7 +602,7 @@
  AddUpdateDeviceManger,
  AddUpdateDeviceType, DeleteDeviceManger,
  DeleteDeviceType,
  DeviceMangerSearch, DeviceSopSearch,
  DeviceMangerSearch, DeviceResumeSearch, DeviceSopSearch,
  DeviceTypeSearch
} from '@/api/DeviceManager'
@@ -555,7 +704,16 @@
        sop: '',
        v: ''
      },
      sopArr: []
      sopArr: [],
      dialogVisibleResume: false,
      formResume: {
        mouldcode: '',
        page: 1,
        rows: 20
      },
      tableResume: [],
      totalResume: 10
    }
  },
@@ -577,6 +735,47 @@
    this.getPrentOrganization()
  },
  methods: {
    // 履历
    async view2(row) {
      console.log(JSON.parse(JSON.stringify(row)))
      this.formResume.mouldcode = row.code
      this.formResume.mouldname = row.name
      this.formResume.mouldspec = row.eqptype_name
      this.formResume.username = localStorage.getItem('username')
      // this.formResume.surp_life = row.surp_life
      // this.formResume.serlife = row.serlife
      this.formResume.lm_date = handleDatetime2(new Date())
      this.formResume.status = row.enable
      // this.formResume.usestatus = row.usestatus
      await this.getMoldResumeSearch()
      this.dialogVisibleResume = true
      this.$nextTick(() => {
        this.$refs.tableDataRef2.doLayout()
      })
    },
    async getMoldResumeSearch() {
      const data = {
        eqpcode: this.formResume.mouldcode,
        createdate: '',
        page: this.formResume.page,
        rows: this.formResume.rows,
        prop: 'operdate',
        order: 'desc'
      }
      const res = await DeviceResumeSearch(data)
      if (res.code === '200') {
        this.tableResume = res.data
        this.totalResume = res.count
      }
    },
    handleCloseResume() {
      this.tableResume = []
    },
    // 弹出框关闭
    handleSopClose() {
      this.SopDialogVisible = false
@@ -866,6 +1065,9 @@
        this.dialogForm.idUnitBySale = mainUnitCode
        this.dialogForm.idunitbymanufacture = mainUnitCode
      }
    },
    tableRowClassName({ row, rowIndex }) {
      return 'custom-row'
    }
  }
}
@@ -888,4 +1090,8 @@
.el-icon-plus:hover, .el-icon-edit:hover, .el-icon-delete:hover {
  color: #000 !important;
}
.dialogFormClass ::v-deep .el-form-item {
  margin-bottom: 0;
}
</style>