|
|
|
|
@ -238,6 +238,9 @@
|
|
|
|
|
@click="viewDetail(scope.row)"
|
|
|
|
|
>查看</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-popconfirm v-if="canDelete" title="确定要删除吗?" @confirm="deleteMaintenance(scope.row)">
|
|
|
|
|
<el-button type="danger" size="small" slot="reference" ghost>删除</el-button>
|
|
|
|
|
</el-popconfirm>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="scope.row.status === 0"
|
|
|
|
|
type="primary"
|
|
|
|
|
@ -524,7 +527,7 @@ import {
|
|
|
|
|
Modal,
|
|
|
|
|
Table
|
|
|
|
|
} from 'view-design'
|
|
|
|
|
import { getOperationList, saveOperation, getOperationDetail } from '@/api/maintenance/maintenance'
|
|
|
|
|
import { getOperationList, saveOperation, getOperationDetail,deleteOperation } from '@/api/maintenance/maintenance'
|
|
|
|
|
import { getStorehouseTypeList } from '@/api/system/storehouseType'
|
|
|
|
|
import { getparameteritem } from '@/api/system/dictionary.js'
|
|
|
|
|
import { index } from '@/api/system/baseForm.js'
|
|
|
|
|
@ -535,6 +538,9 @@ import qs from 'qs'
|
|
|
|
|
import * as XLSX from 'xlsx'
|
|
|
|
|
import { saveAs } from 'file-saver'
|
|
|
|
|
import Cookies from 'js-cookie'
|
|
|
|
|
import {
|
|
|
|
|
getInfo
|
|
|
|
|
} from '@/api/user.js'
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
Button,
|
|
|
|
|
@ -552,6 +558,7 @@ export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
baseUrl: process.env.VUE_APP_BASE_API || window.location.origin + '/',
|
|
|
|
|
canDelete: false,
|
|
|
|
|
select: {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
@ -789,6 +796,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getUserName()
|
|
|
|
|
this.getList()
|
|
|
|
|
this.getFenlei()
|
|
|
|
|
},
|
|
|
|
|
@ -801,6 +809,15 @@ export default {
|
|
|
|
|
window.removeEventListener('resize', this.calcTableHeight)
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async getUserName() {
|
|
|
|
|
getInfo().then(res => {
|
|
|
|
|
for (var k of res.role) {
|
|
|
|
|
if (k.name == '系统管理员' || k.name==='应急保障科') {
|
|
|
|
|
this.canDelete = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch(error => {})
|
|
|
|
|
},
|
|
|
|
|
async getList() {
|
|
|
|
|
try {
|
|
|
|
|
const params = {
|
|
|
|
|
@ -955,6 +972,13 @@ export default {
|
|
|
|
|
this.$message.error('获取维护详情失败')
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async deleteMaintenance(item) {
|
|
|
|
|
const res = await deleteOperation({ id: item.id })
|
|
|
|
|
if (res) {
|
|
|
|
|
this.$Message.success('删除成功')
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
completeMaintenance(item) {
|
|
|
|
|
this.showModal = true
|
|
|
|
|
this.currentRecord = { ...item }
|
|
|
|
|
|