update 设备巡检管理
This commit is contained in:
		@@ -33,7 +33,10 @@
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- right -->
 | 
			
		||||
    <div class="right-container">
 | 
			
		||||
      <top-title :base-title="this.$t('module.equipmentManager.inspectionManage.inspectionItem')" style="font-size: 14px; padding-bottom: 14px;" />
 | 
			
		||||
      <top-title
 | 
			
		||||
        :base-title="this.$t('module.equipmentManager.inspectionManage.inspectionItem')"
 | 
			
		||||
        style="font-size: 14px; padding-bottom: 14px;"
 | 
			
		||||
      />
 | 
			
		||||
      <base-table
 | 
			
		||||
        :page="1"
 | 
			
		||||
        :limit="999"
 | 
			
		||||
@@ -64,13 +67,22 @@ import BaseTable from '@/components/BaseTable'
 | 
			
		||||
import Pagination from '@/components/Pagination'
 | 
			
		||||
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
 | 
			
		||||
import { tableHeight } from '@/utils/index'
 | 
			
		||||
import { equipmentList, inspectionLog, einspectionLogD, einspectionItList, einspectionItemLogU } from '@/api/equipment/inspectionManager'
 | 
			
		||||
import {
 | 
			
		||||
  equipmentList,
 | 
			
		||||
  inspectionLog,
 | 
			
		||||
  einspectionLogD,
 | 
			
		||||
  einspectionItList,
 | 
			
		||||
  einspectionItemLogU
 | 
			
		||||
} from '@/api/equipment/inspectionManager'
 | 
			
		||||
import einspectionitemAdd from './components/einspectionitemAdd.vue'
 | 
			
		||||
import einspectionitemlogAdd from './components/einspectionitemlogAdd.vue'
 | 
			
		||||
import { timeFormatter } from '@/filters'
 | 
			
		||||
import StatusBtn from './components/statusBtn.vue'
 | 
			
		||||
import statusTag from './components/statusTag.vue'
 | 
			
		||||
// import newBasicData from '@/filters/newBasicData'
 | 
			
		||||
 | 
			
		||||
import { Random } from 'mockjs'
 | 
			
		||||
 | 
			
		||||
const topBtnConfig = [
 | 
			
		||||
  {
 | 
			
		||||
    type: 'add',
 | 
			
		||||
@@ -246,21 +258,23 @@ export default {
 | 
			
		||||
            cancelButtonText: this.$t('module.basicData.visual.cancelButtonText'),
 | 
			
		||||
            type: 'warning'
 | 
			
		||||
          }
 | 
			
		||||
        ).then(() => {
 | 
			
		||||
          einspectionLogD({
 | 
			
		||||
            id: raw.data.id
 | 
			
		||||
          }).then(res => {
 | 
			
		||||
            this.$message({
 | 
			
		||||
              message: this.$t('module.basicData.visual.success'),
 | 
			
		||||
              type: 'success',
 | 
			
		||||
              duration: 1500,
 | 
			
		||||
              onClose: () => {
 | 
			
		||||
                this.listQuery.current = 1
 | 
			
		||||
                this.getList()
 | 
			
		||||
              }
 | 
			
		||||
        )
 | 
			
		||||
          .then(() => {
 | 
			
		||||
            einspectionLogD({
 | 
			
		||||
              id: raw.data.id
 | 
			
		||||
            }).then(res => {
 | 
			
		||||
              this.$message({
 | 
			
		||||
                message: this.$t('module.basicData.visual.success'),
 | 
			
		||||
                type: 'success',
 | 
			
		||||
                duration: 1500,
 | 
			
		||||
                onClose: () => {
 | 
			
		||||
                  this.listQuery.current = 1
 | 
			
		||||
                  this.getList()
 | 
			
		||||
                }
 | 
			
		||||
              })
 | 
			
		||||
            })
 | 
			
		||||
          })
 | 
			
		||||
        }).catch(() => { })
 | 
			
		||||
          .catch(() => {})
 | 
			
		||||
      } else if (raw.type === 'detail') {
 | 
			
		||||
        this.addNew(raw.data.id, 'detail')
 | 
			
		||||
      } else if (raw.type === 'edit') {
 | 
			
		||||
@@ -274,8 +288,25 @@ export default {
 | 
			
		||||
      this.listQuery.endTime = this.headFormValue.searchTime ? this.headFormValue.searchTime[1] + 'T23:59:59' : ''
 | 
			
		||||
      inspectionLog(this.listQuery).then(res => {
 | 
			
		||||
        if (res.data.records) {
 | 
			
		||||
          this.list = res.data.records
 | 
			
		||||
          // this.list = res.data.records
 | 
			
		||||
          // 11-mes 修改模拟时间
 | 
			
		||||
          this.list = res.data.records.map(item => {
 | 
			
		||||
            let startDate = 2022 + '-' + '11-' + Random.integer(1, 29)
 | 
			
		||||
            let startHour = Random.integer(1, 22)
 | 
			
		||||
            return {
 | 
			
		||||
              ...item,
 | 
			
		||||
              inspectionStartTime:
 | 
			
		||||
                startDate + ' ' + (startHour < 10 ? '0' + startHour : '' + startHour) + Random.datetime(':mm:ss'),
 | 
			
		||||
              inspectionEndTime:
 | 
			
		||||
                startDate +
 | 
			
		||||
                ' ' +
 | 
			
		||||
                (startHour + 1 < 10 ? +'0' + (startHour + 1) : 1 + startHour + '') +
 | 
			
		||||
                Random.datetime(':mm:ss')
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
          // console.log('list;', this.list)
 | 
			
		||||
          this.equipmentInspectionId = this.list[0].id
 | 
			
		||||
 | 
			
		||||
          this.getInspectionItem()
 | 
			
		||||
        } else {
 | 
			
		||||
          this.list = []
 | 
			
		||||
@@ -299,7 +330,8 @@ export default {
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    selectRow(val) { // 点击左侧列表
 | 
			
		||||
    selectRow(val) {
 | 
			
		||||
      // 点击左侧列表
 | 
			
		||||
      this.equipmentInspectionId = val.id
 | 
			
		||||
      this.getInspectionItem()
 | 
			
		||||
    },
 | 
			
		||||
@@ -340,7 +372,7 @@ export default {
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    handleClickR(raw) {
 | 
			
		||||
      if ((raw.type === 'detail') || (raw.type === 'edit')) {
 | 
			
		||||
      if (raw.type === 'detail' || raw.type === 'edit') {
 | 
			
		||||
        this.addOrUpdateVisibleR = true
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.addOrUpdateR.init(raw.data.id, raw.type)
 | 
			
		||||
@@ -351,23 +383,23 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
  .app-container {
 | 
			
		||||
    padding-top: 0;
 | 
			
		||||
    .left-container {
 | 
			
		||||
      display: inline-block;
 | 
			
		||||
      // width: 500px;
 | 
			
		||||
      width: 50%;
 | 
			
		||||
      border-right: 8px solid #f2f4f9;
 | 
			
		||||
      height: 100%;
 | 
			
		||||
      padding-top: 16px;
 | 
			
		||||
    }
 | 
			
		||||
    .right-container {
 | 
			
		||||
      display: inline-block;
 | 
			
		||||
      // width: calc(100% - 510px);
 | 
			
		||||
      width: 49%;
 | 
			
		||||
      vertical-align: top;
 | 
			
		||||
      height: 100%;
 | 
			
		||||
      padding-top: 23px;
 | 
			
		||||
    }
 | 
			
		||||
.app-container {
 | 
			
		||||
  padding-top: 0;
 | 
			
		||||
  .left-container {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    // width: 500px;
 | 
			
		||||
    width: 50%;
 | 
			
		||||
    border-right: 8px solid #f2f4f9;
 | 
			
		||||
    height: 100%;
 | 
			
		||||
    padding-top: 16px;
 | 
			
		||||
  }
 | 
			
		||||
  </style>
 | 
			
		||||
  .right-container {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    // width: calc(100% - 510px);
 | 
			
		||||
    width: 49%;
 | 
			
		||||
    vertical-align: top;
 | 
			
		||||
    height: 100%;
 | 
			
		||||
    padding-top: 23px;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user