123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492 |
- <template>
- <div class="device">
- <template v-if="!addOrUpdateVisible && !detailVisible && !historyVisible && !damageVisible && !checkVisible && !inspectionVisible">
- <!-- 查询、新增操作 -->
- <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
- <el-form-item label="名称/编号">
- <el-input v-model="dataForm.name" placeholder="名称/编号" clearable/>
- </el-form-item>
- <el-form-item label="点检责任人">
- <user-component v-model="dataForm.creatorId"/>
- </el-form-item>
- <el-form-item label="点检日期起">
- <el-date-picker
- v-model="dataForm.date"
- value-format="yyyy-MM-dd HH:mm:ss"
- type="daterange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="设备状态">
- <el-select
- v-model="dataForm.state"
- remote
- placeholder="请选择">
- <el-option
- v-for="item in optionsState"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button @click="search()">查询</el-button>
- </el-form-item>
- </el-form>
- <!-- 数据表格 -->
- <el-table
- :data="dataList"
- border
- v-loading="dataListLoading"
- style="width: 100%;">
- <el-table-column
- label="序号"
- type="index"
- width="50"
- align="center">
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- :show-overflow-tooltip="true"
- label="日期">
- <template slot-scope="scope">
- {{ scope.row.rowRersion ? getDate(scope.row.rowRersion) : '' }}
- </template>
- </el-table-column>
- <el-table-column
- prop="code"
- header-align="center"
- align="center"
- min-width="140"
- :show-overflow-tooltip="true"
- label="网关编码">
- </el-table-column>
- <el-table-column
- prop="codeNumber"
- header-align="center"
- align="center"
- min-width="100"
- :show-overflow-tooltip="true"
- label="设备编号">
- </el-table-column>
- <el-table-column
- prop="online"
- header-align="center"
- align="center"
- min-width="80"
- :show-overflow-tooltip="true"
- label="是否在线">
- <template slot-scope="scope">
- <el-tag v-if="Number(scope.row.online) === 0" type="danger">离线</el-tag>
- <el-tag v-else type="success">在线</el-tag>
- </template>
- </el-table-column>
- <el-table-column
- prop="spindleActualSpeed"
- header-align="center"
- align="center"
- min-width="120"
- :show-overflow-tooltip="true"
- label="设备主轴转速">
- </el-table-column>
- <el-table-column
- prop="name"
- header-align="center"
- align="center"
- min-width="140"
- :show-overflow-tooltip="true"
- label="设备名称">
- </el-table-column>
- <el-table-column
- prop="model"
- header-align="center"
- align="center"
- min-width="120"
- :show-overflow-tooltip="true"
- label="设备型号">
- </el-table-column>
- <el-table-column
- prop="specifications"
- header-align="center"
- align="center"
- min-width="120"
- :show-overflow-tooltip="true"
- label="设备规格">
- </el-table-column>
- <el-table-column
- prop="useFor"
- header-align="center"
- align="center"
- min-width="100"
- :show-overflow-tooltip="true"
- label="设备用途">
- </el-table-column>
- <el-table-column
- prop="accuracy"
- header-align="center"
- align="center"
- min-width="100"
- :show-overflow-tooltip="true"
- label="设备精度">
- </el-table-column>
- <el-table-column
- prop="manufacturers"
- header-align="center"
- align="center"
- min-width="120"
- :show-overflow-tooltip="true"
- label="制造厂家">
- </el-table-column>
- <el-table-column
- prop="manufacturingNumber"
- header-align="center"
- align="center"
- min-width="120"
- :show-overflow-tooltip="true"
- label="设备出厂编号">
- </el-table-column>
- <el-table-column
- prop="leaveFactoryDate"
- header-align="center"
- align="center"
- min-width="160"
- :show-overflow-tooltip="true"
- label="设备出厂日期">
- </el-table-column>
- <el-table-column
- prop="verificationDate"
- header-align="center"
- align="center"
- min-width="160"
- :show-overflow-tooltip="true"
- label="检定日期">
- </el-table-column>
- <el-table-column
- prop="validityDate"
- header-align="center"
- align="center"
- min-width="160"
- :show-overflow-tooltip="true"
- label="检定有效期(止)">
- </el-table-column>
- <el-table-column
- prop="attachList"
- header-align="center"
- align="center"
- min-width="120"
- :show-overflow-tooltip="true"
- label="操作说明书">
- <template slot-scope="scope">
- <div v-for="(item, index) in scope.row.attachList" style="display: inline">
- <span v-if="index > 0">,</span>
- <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="notes"
- header-align="center"
- align="center"
- min-width="180"
- :show-overflow-tooltip="true"
- label="备注">
- </el-table-column>
- <el-table-column
- prop="responsibilityUserName"
- header-align="center"
- align="center"
- min-width="80"
- :show-overflow-tooltip="true"
- label="责任人">
- </el-table-column>
- <el-table-column
- prop="userOfName"
- header-align="center"
- align="center"
- min-width="100"
- :show-overflow-tooltip="true"
- label="当前使用人">
- </el-table-column>
- <el-table-column
- prop="breakageCause"
- header-align="center"
- align="center"
- min-width="180"
- :show-overflow-tooltip="true"
- label="损坏原因">
- </el-table-column>
- <el-table-column
- prop="attachListBreakage"
- header-align="center"
- align="center"
- min-width="120"
- :show-overflow-tooltip="true"
- label="报损附件">
- <template slot-scope="scope">
- <div v-for="(item, index) in scope.row.attachListBreakage" style="display: inline">
- <span v-if="index > 0">,</span>
- <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="attachListVerification"
- header-align="center"
- align="center"
- min-width="120"
- :show-overflow-tooltip="true"
- label="检定报告附件">
- <template slot-scope="scope">
- <div v-for="(item, index) in scope.row.attachListVerification" style="display: inline">
- <span v-if="index > 0">,</span>
- <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="state"
- fixed="right"
- header-align="center"
- align="center"
- min-width="100"
- :show-overflow-tooltip="true"
- label="状态">
- <template slot-scope="scope">
- {{optionsState.find(t => t.value === scope.row.state).label}}
- </template>
- </el-table-column>
- <el-table-column
- fixed="right"
- header-align="center"
- align="center"
- width="230"
- label="操作">
- <template slot-scope="scope">
- <!-- <el-button v-if="isAuth('prod:equipment:info')" type="text" size="small" @click="detailHandle(scope.row.id)">查看</el-button>-->
- <el-button v-if="isAuth('prod:equipment:info')" type="text" size="small" @click="historyHandle(scope.row)">历史数据</el-button>
- <el-button v-if="isAuth('prod:equipment:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">编辑</el-button>
- <el-button v-if="isAuth('prod:updateVerification:update')" type="text" size="small" @click="checkHandle(scope.row)">检定</el-button>
- <el-button v-if="isAuth('prod:updateBreakage:update')" type="text" size="small" @click="damageHandle(scope.row)">报损</el-button>
- <el-button v-if="isAuth('prod:equipmentCheckRecord:updateCheck')" type="text" size="small" @click="inspectionHandle(scope.row)">点检</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="sizeChangeHandle"
- @current-change="currentChangeHandle"
- :current-page="pageIndex"
- :page-sizes="[10, 20, 50, 100]"
- :page-size="pageSize"
- :total="totalPage"
- layout="total, sizes, prev, pager, next, jumper">
- </el-pagination>
- </template>
- <!-- 弹窗, 新增 / 修改 -->
- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" @onChose="onChose"></add-or-update>
- <detail v-if="detailVisible" ref="detail" @onChose="onChose"></detail>
- <device-history v-if="historyVisible" ref="history" @onChose="onChose"></device-history>
- <preview-component v-if="previewVisible" ref="preview" @onChose="onChose"></preview-component>
- <device-damage v-if="damageVisible" ref="damage" @onChose="onChose" @refreshDataList="getDataList"></device-damage>
- <device-check v-if="checkVisible" ref="check" @onChose="onChose" @refreshDataList="getDataList"></device-check>
- <device-inspection v-if="inspectionVisible" ref="inspection" @onChose="onChose" @refreshDataList="getDataList"></device-inspection>
- </div>
- </template>
- <script>
- import AddOrUpdate from './device-add-or-update'
- import Detail from './temp-detail'
- import History from './temp-history'
- import OrgComponent from '../common/org-component'
- import UserComponent from '../common/user-component'
- import {optionsEquipmentCheckState} from '@/utils/enums'
- import {isAuth} from '@/utils'
- import PreviewComponent from '@/views/modules/common/preview-component.vue'
- import DeviceHistory from '@/views/modules/device/device-history.vue'
- import DeviceDamage from '@/views/modules/device/device-damage.vue'
- import DeviceCheck from '@/views/modules/device/device-check.vue'
- import DeviceInspection from '@/views/modules/device/device-inspection.vue'
- import {getDate} from '@/utils/date-util'
- export default {
- name: 'inspection-list',
- components: {
- DeviceInspection,
- DeviceCheck,
- DeviceDamage,
- DeviceHistory,
- PreviewComponent,
- Detail,
- History,
- AddOrUpdate,
- UserComponent,
- OrgComponent
- },
- data () {
- return {
- addOrUpdateVisible: false,
- detailVisible: false,
- historyVisible: false,
- previewVisible: false,
- damageVisible: false,
- checkVisible: false,
- inspectionVisible: false,
- dataForm: {},
- dataList: [],
- pageIndex: 1,
- pageSize: 10,
- totalPage: 0,
- dataListLoading: false,
- dataListSelections: [],
- optionsState: optionsEquipmentCheckState
- }
- },
- created () {
- this.getDataList()
- },
- methods: {
- getDate,
- isAuth,
- onChose () {
- this.addOrUpdateVisible = false
- this.detailVisible = false
- this.historyVisible = false
- this.damageVisible = false
- this.checkVisible = false
- this.inspectionVisible = false
- },
- // 查询
- search () {
- this.pageIndex = 1
- this.getDataList()
- },
- // 获取数据列表
- getDataList () {
- this.dataListLoading = true
- this.addOrUpdateVisible = false
- this.$http({
- url: this.$http.adornUrl('/biz-service/equipmentCheckRecord/list'),
- method: 'get',
- params: this.$http.adornParams({
- 'current': this.pageIndex,
- 'size': this.pageSize,
- 'creatorId': this.dataForm.creatorId ? this.dataForm.creatorId : null,
- 'name': this.dataForm.name ? this.dataForm.name : null,
- 'state': this.dataForm.state ? this.dataForm.state : null,
- 'dateStart': this.dataForm.date ? this.dataForm.date[0] : null,
- 'dateEnd': this.dataForm.date ? this.dataForm.date[1] : null
- })
- }).then(({data}) => {
- if (data && data.code === '200') {
- this.dataList = data.data.records
- this.totalPage = Number(data.data.total)
- } else {
- this.dataList = []
- this.totalPage = 0
- }
- this.dataListLoading = false
- })
- },
- // 每页数
- sizeChangeHandle (val) {
- this.pageSize = val
- this.pageIndex = 1
- this.getDataList()
- },
- // 当前页
- currentChangeHandle (val) {
- this.pageIndex = val
- this.getDataList()
- },
- // 多选
- selectionChangeHandle (val) {
- this.dataListSelections = val
- },
- // 新增 / 修改
- addOrUpdateHandle (id, disable) {
- this.addOrUpdateVisible = true
- this.$nextTick(() => {
- this.$refs.addOrUpdate.init(id, disable)
- })
- },
- detailHandle (id) {
- this.detailVisible = true
- this.$nextTick(() => {
- this.$refs.detail.init(id)
- })
- },
- // 预览
- previewFile (fileName, url) {
- this.previewVisible = true
- this.$nextTick(() => {
- this.$refs.preview.init(fileName, url)
- })
- },
- // 历史记录
- historyHandle (row) {
- this.historyVisible = true
- this.$nextTick(() => {
- this.$refs.history.init(row.codeNumber)
- })
- },
- // 报损
- damageHandle (row) {
- this.damageVisible = true
- this.$nextTick(() => {
- this.$refs.damage.init(row)
- })
- },
- // 检定
- checkHandle (row) {
- this.checkVisible = true
- this.$nextTick(() => {
- this.$refs.check.init(row)
- })
- },
- // 点检
- inspectionHandle (row) {
- this.inspectionVisible = true
- this.$nextTick(() => {
- this.$refs.inspection.init(row)
- })
- },
- // 删除
- deleteHandle (id) {
- if (!id) return
- let ids = []
- ids.push(id)
- this.$confirm(`确定删除?`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.$http({
- url: this.$http.adornUrl(`/iot-platform/temp/delete`),
- method: 'DELETE',
- data: ids
- }).then(({data}) => {
- if (data && data.code === '200') {
- this.$message({
- message: '操作成功',
- type: 'success',
- duration: 1500,
- onClose: () => {
- this.getDataList()
- }
- })
- } else {
- this.$message.error(data.msg)
- }
- })
- }).catch(() => {})
- }
- }
- }
- </script>
- <style scoped>
- </style>
|