|
@@ -4,31 +4,19 @@
|
|
<!-- 查询、新增操作 -->
|
|
<!-- 查询、新增操作 -->
|
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
|
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
|
|
<el-form-item label="名称/编号">
|
|
<el-form-item label="名称/编号">
|
|
- <el-input v-model="dataForm.name" placeholder="名称/编号" clearable/>
|
|
|
|
|
|
+ <el-input v-model="dataForm.name" placeholder="名称/编号" clearable />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="报修人">
|
|
<el-form-item label="报修人">
|
|
- <user-component v-model="dataForm.creatorId"/>
|
|
|
|
|
|
+ <user-component v-model="dataForm.creatorId" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="报修日期">
|
|
<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 v-model="dataForm.date" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
|
|
|
|
+ range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="设备状态">
|
|
<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-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-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -37,126 +25,66 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</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 :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>
|
|
- <el-table-column
|
|
|
|
- prop="equipmentName"
|
|
|
|
- header-align="center"
|
|
|
|
- align="center"
|
|
|
|
- min-width="140"
|
|
|
|
- :show-overflow-tooltip="true"
|
|
|
|
- label="设备名称">
|
|
|
|
|
|
+ <el-table-column prop="equipmentName" header-align="center" align="center" min-width="140"
|
|
|
|
+ :show-overflow-tooltip="true" label="设备名称">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- prop="codeNumber"
|
|
|
|
- header-align="center"
|
|
|
|
- align="center"
|
|
|
|
- min-width="100"
|
|
|
|
- :show-overflow-tooltip="true"
|
|
|
|
- label="设备编号">
|
|
|
|
|
|
+ <el-table-column prop="codeNumber" header-align="center" align="center" min-width="100"
|
|
|
|
+ :show-overflow-tooltip="true" label="设备编号">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- prop="content"
|
|
|
|
- header-align="center"
|
|
|
|
- align="center"
|
|
|
|
- min-width="140"
|
|
|
|
- :show-overflow-tooltip="true"
|
|
|
|
- label="报修问题说明">
|
|
|
|
|
|
+ <el-table-column prop="content" header-align="center" align="center" min-width="140"
|
|
|
|
+ :show-overflow-tooltip="true" label="报修问题说明">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- header-align="center"
|
|
|
|
- align="center"
|
|
|
|
- min-width="140"
|
|
|
|
- :show-overflow-tooltip="true"
|
|
|
|
|
|
+ <el-table-column header-align="center" align="center" min-width="140" :show-overflow-tooltip="true"
|
|
label="报修附件">
|
|
label="报修附件">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div v-for="(item, index) in scope.row.attachList" style="display: inline">
|
|
<div v-for="(item, index) in scope.row.attachList" style="display: inline">
|
|
<span v-if="index > 0">,</span>
|
|
<span v-if="index > 0">,</span>
|
|
- <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
|
|
|
|
|
|
+ <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{
|
|
|
|
+ item.fileName }}</a>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- prop="createTime"
|
|
|
|
- header-align="center"
|
|
|
|
- align="center"
|
|
|
|
- min-width="160"
|
|
|
|
- :show-overflow-tooltip="true"
|
|
|
|
- label="报修时间">
|
|
|
|
|
|
+ <el-table-column prop="createTime" header-align="center" align="center" min-width="160"
|
|
|
|
+ :show-overflow-tooltip="true" label="报修时间">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- prop="repairName"
|
|
|
|
- header-align="center"
|
|
|
|
- align="center"
|
|
|
|
- label="报修人">
|
|
|
|
|
|
+ <el-table-column prop="repairName" header-align="center" align="center" label="报修人">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- prop="maintenanceRecord"
|
|
|
|
- header-align="center"
|
|
|
|
- align="center"
|
|
|
|
- min-width="140"
|
|
|
|
- :show-overflow-tooltip="true"
|
|
|
|
- label="维修说明记录">
|
|
|
|
|
|
+ <el-table-column prop="maintenanceRecord" header-align="center" align="center" min-width="140"
|
|
|
|
+ :show-overflow-tooltip="true" label="维修说明记录">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- header-align="center"
|
|
|
|
- align="center"
|
|
|
|
- min-width="140"
|
|
|
|
- :show-overflow-tooltip="true"
|
|
|
|
|
|
+ <el-table-column header-align="center" align="center" min-width="140" :show-overflow-tooltip="true"
|
|
label="维修完成记录附件">
|
|
label="维修完成记录附件">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div v-for="(item, index) in scope.row.attachListRepair" style="display: inline">
|
|
<div v-for="(item, index) in scope.row.attachListRepair" style="display: inline">
|
|
<span v-if="index > 0">,</span>
|
|
<span v-if="index > 0">,</span>
|
|
- <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
|
|
|
|
|
|
+ <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{
|
|
|
|
+ item.fileName }}</a>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- prop="updateTime"
|
|
|
|
- header-align="center"
|
|
|
|
- align="center"
|
|
|
|
- min-width="160"
|
|
|
|
- :show-overflow-tooltip="true"
|
|
|
|
- label="维修完成时间">
|
|
|
|
|
|
+ <el-table-column prop="updateTime" header-align="center" align="center" min-width="160"
|
|
|
|
+ :show-overflow-tooltip="true" label="维修完成时间">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- prop="state"
|
|
|
|
- fixed="right"
|
|
|
|
- header-align="center"
|
|
|
|
- align="center"
|
|
|
|
- label="状态">
|
|
|
|
|
|
+ <el-table-column prop="state" fixed="right" header-align="center" align="center" label="状态">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
{{optionsState.find(t => t.value === scope.row.state).label}}
|
|
{{optionsState.find(t => t.value === scope.row.state).label}}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- fixed="right"
|
|
|
|
- header-align="center"
|
|
|
|
- align="center"
|
|
|
|
- width="100"
|
|
|
|
- label="操作">
|
|
|
|
|
|
+ <el-table-column fixed="right" header-align="center" align="center" width="100" label="操作">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button v-if="isAuth('prod:equipmentRepair:info')" type="text" size="small" @click="detailHandle(scope.row.repairId)">查看</el-button>
|
|
|
|
- <el-button v-if="isAuth('prod:equipmentRepair:finish') && Number(scope.row.state) === 1 && scope.row.creatorId === userId" type="text" size="small" @click="finishHandle(scope.row.repairId)">完成</el-button>
|
|
|
|
|
|
+ <el-button v-if="isAuth('prod:equipmentRepair:info')" type="text" size="small"
|
|
|
|
+ @click="detailHandle(scope.row.repairId)">查看</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="isAuth('prod:equipmentRepair:finish') && Number(scope.row.state) === 1 && scope.row.creatorId === userId"
|
|
|
|
+ type="text" size="small" @click="finishHandle(scope.row.repairId)">完成</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
- <el-pagination
|
|
|
|
- @size-change="sizeChangeHandle"
|
|
|
|
- @current-change="currentChangeHandle"
|
|
|
|
- :current-page="pageIndex"
|
|
|
|
- :page-sizes="[10, 20, 50, 100]"
|
|
|
|
- :page-size="pageSize"
|
|
|
|
- :total="totalPage"
|
|
|
|
|
|
+ <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">
|
|
layout="total, sizes, prev, pager, next, jumper">
|
|
</el-pagination>
|
|
</el-pagination>
|
|
</template>
|
|
</template>
|
|
@@ -169,10 +97,10 @@
|
|
<script>
|
|
<script>
|
|
import Detail from './repair-detail'
|
|
import Detail from './repair-detail'
|
|
import UserComponent from '../common/user-component'
|
|
import UserComponent from '../common/user-component'
|
|
-import {optionsEquipmentRepairState} from '@/utils/enums'
|
|
|
|
-import {isAuth} from '@/utils'
|
|
|
|
|
|
+import { optionsEquipmentRepairState } from '@/utils/enums'
|
|
|
|
+import { isAuth } from '@/utils'
|
|
import DeviceInspection from '@/views/modules/device/device-inspection.vue'
|
|
import DeviceInspection from '@/views/modules/device/device-inspection.vue'
|
|
-import {getDate} from '@/utils/date-util'
|
|
|
|
|
|
+import { getDate } from '@/utils/date-util'
|
|
import PreviewComponent from '@/views/modules/common/preview-component.vue'
|
|
import PreviewComponent from '@/views/modules/common/preview-component.vue'
|
|
import RepairFinish from '@/views/modules/device/repair-finish.vue'
|
|
import RepairFinish from '@/views/modules/device/repair-finish.vue'
|
|
export default {
|
|
export default {
|
|
@@ -185,7 +113,7 @@ export default {
|
|
History,
|
|
History,
|
|
UserComponent
|
|
UserComponent
|
|
},
|
|
},
|
|
- data () {
|
|
|
|
|
|
+ data() {
|
|
return {
|
|
return {
|
|
detailVisible: false,
|
|
detailVisible: false,
|
|
finishVisible: false,
|
|
finishVisible: false,
|
|
@@ -201,23 +129,23 @@ export default {
|
|
userId: this.$store.state.user.id
|
|
userId: this.$store.state.user.id
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- created () {
|
|
|
|
|
|
+ created() {
|
|
this.getDataList()
|
|
this.getDataList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getDate,
|
|
getDate,
|
|
isAuth,
|
|
isAuth,
|
|
- onChose () {
|
|
|
|
|
|
+ onChose() {
|
|
this.detailVisible = false
|
|
this.detailVisible = false
|
|
this.finishVisible = false
|
|
this.finishVisible = false
|
|
},
|
|
},
|
|
// 查询
|
|
// 查询
|
|
- search () {
|
|
|
|
|
|
+ search() {
|
|
this.pageIndex = 1
|
|
this.pageIndex = 1
|
|
this.getDataList()
|
|
this.getDataList()
|
|
},
|
|
},
|
|
// 获取数据列表
|
|
// 获取数据列表
|
|
- getDataList () {
|
|
|
|
|
|
+ getDataList() {
|
|
this.dataListLoading = true
|
|
this.dataListLoading = true
|
|
this.addOrUpdateVisible = false
|
|
this.addOrUpdateVisible = false
|
|
this.$http({
|
|
this.$http({
|
|
@@ -232,7 +160,7 @@ export default {
|
|
'dateStart': this.dataForm.date ? this.dataForm.date[0] : null,
|
|
'dateStart': this.dataForm.date ? this.dataForm.date[0] : null,
|
|
'dateEnd': this.dataForm.date ? this.dataForm.date[1] : null
|
|
'dateEnd': this.dataForm.date ? this.dataForm.date[1] : null
|
|
})
|
|
})
|
|
- }).then(({data}) => {
|
|
|
|
|
|
+ }).then(({ data }) => {
|
|
if (data && data.code === '200') {
|
|
if (data && data.code === '200') {
|
|
this.dataList = data.data.records
|
|
this.dataList = data.data.records
|
|
this.totalPage = Number(data.data.total)
|
|
this.totalPage = Number(data.data.total)
|
|
@@ -244,42 +172,42 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 每页数
|
|
// 每页数
|
|
- sizeChangeHandle (val) {
|
|
|
|
|
|
+ sizeChangeHandle(val) {
|
|
this.pageSize = val
|
|
this.pageSize = val
|
|
this.pageIndex = 1
|
|
this.pageIndex = 1
|
|
this.getDataList()
|
|
this.getDataList()
|
|
},
|
|
},
|
|
// 当前页
|
|
// 当前页
|
|
- currentChangeHandle (val) {
|
|
|
|
|
|
+ currentChangeHandle(val) {
|
|
this.pageIndex = val
|
|
this.pageIndex = val
|
|
this.getDataList()
|
|
this.getDataList()
|
|
},
|
|
},
|
|
// 多选
|
|
// 多选
|
|
- selectionChangeHandle (val) {
|
|
|
|
|
|
+ selectionChangeHandle(val) {
|
|
this.dataListSelections = val
|
|
this.dataListSelections = val
|
|
},
|
|
},
|
|
// 新增 / 修改
|
|
// 新增 / 修改
|
|
- addOrUpdateHandle (id, disable) {
|
|
|
|
|
|
+ addOrUpdateHandle(id, disable) {
|
|
this.addOrUpdateVisible = true
|
|
this.addOrUpdateVisible = true
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.addOrUpdate.init(id, disable)
|
|
this.$refs.addOrUpdate.init(id, disable)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- detailHandle (id) {
|
|
|
|
|
|
+ detailHandle(id) {
|
|
this.detailVisible = true
|
|
this.detailVisible = true
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.detail.init(id)
|
|
this.$refs.detail.init(id)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 预览
|
|
// 预览
|
|
- previewFile (fileName, url) {
|
|
|
|
|
|
+ previewFile(fileName, url) {
|
|
this.previewVisible = true
|
|
this.previewVisible = true
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.preview.init(fileName, url)
|
|
this.$refs.preview.init(fileName, url)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 完成
|
|
// 完成
|
|
- finishHandle (id) {
|
|
|
|
|
|
+ finishHandle(id) {
|
|
this.finishVisible = true
|
|
this.finishVisible = true
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.finish.init(id)
|
|
this.$refs.finish.init(id)
|
|
@@ -289,6 +217,4 @@ export default {
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
|
-
|
|
|
|
-</style>
|
|
|
|
|
|
+<style scoped></style>
|