|
|
|
@ -23,9 +23,10 @@ |
|
|
|
<el-form-item label="计划执行人员"> |
|
|
|
<el-input v-model="searchData.planOperator" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="searchData"> |
|
|
|
<el-form-item label="状态"> |
|
|
|
<el-select v-model="searchData.status" style="width: 80px"> |
|
|
|
<el-option label="全部" value=""></el-option> |
|
|
|
<el-select v-model="searchData.status" clearable style="width: 80px"> |
|
|
|
<el-option label="未开工" value="未开工"></el-option> |
|
|
|
<el-option label="待审核" value="待审核"></el-option> |
|
|
|
<el-option label="已完工" value="已完工"></el-option> |
|
|
|
@ -63,8 +64,9 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label=" "> |
|
|
|
<el-button v-if="!authSearch" @click="searchClick()">查询</el-button> |
|
|
|
<!-- <el-button type="primary" @click="changeModel()">更改机修人员</el-button>--> |
|
|
|
<el-button v-if="!authSearch" :loading="searchLoading" @click="searchClick()">查询</el-button> |
|
|
|
<el-button type="primary" :loading="checkLoading" @click="checkModals()">批量审核</el-button> |
|
|
|
<!-- <el-button type="primary" @click="changeModel()">更改机修人员</el-button>--> |
|
|
|
<download-excel |
|
|
|
:fields="fields()" |
|
|
|
:data="exportData" |
|
|
|
@ -387,7 +389,8 @@ |
|
|
|
updateWorkOrder, |
|
|
|
getSiteAndBuByUserName, |
|
|
|
getUserRoleList, |
|
|
|
getRoleByUserName |
|
|
|
getRoleByUserName, |
|
|
|
checkWorkOrders, // 批量审核 |
|
|
|
} from "@/api/eam/eam.js" |
|
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
|
|
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|
|
|
@ -397,18 +400,6 @@ |
|
|
|
Chooselist |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
searchData: { |
|
|
|
deep: true, |
|
|
|
handler: function (newV, oldV) { |
|
|
|
this.searchData.groupID = this.searchData.groupID.toUpperCase() |
|
|
|
} |
|
|
|
}, |
|
|
|
modalData: { |
|
|
|
deep: true, |
|
|
|
handler: function (newV, oldV) { |
|
|
|
this.modalData.groupID = this.modalData.groupID.toUpperCase() |
|
|
|
} |
|
|
|
}, |
|
|
|
saveData: { |
|
|
|
deep: true, |
|
|
|
handler: function (newV, oldV) { |
|
|
|
@ -1063,13 +1054,15 @@ |
|
|
|
authDetail: false, |
|
|
|
authCancel: false, |
|
|
|
menuId: this.$route.meta.menuId, |
|
|
|
detailLoading: false |
|
|
|
detailLoading: false, |
|
|
|
searchLoading: false, |
|
|
|
checkLoading: false |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
mounted () { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.height = window.innerHeight - 180 |
|
|
|
this.height = window.innerHeight - 212 |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
@ -1238,6 +1231,7 @@ |
|
|
|
|
|
|
|
// 获取数据列表 |
|
|
|
getDataList () { |
|
|
|
this.searchLoading = true |
|
|
|
this.searchData.limit = this.pageSize |
|
|
|
this.searchData.page = this.pageIndex |
|
|
|
eamWorkOrderSearch(this.searchData).then(({data}) => { |
|
|
|
@ -1246,7 +1240,12 @@ |
|
|
|
this.pageIndex = data.page.currPage |
|
|
|
this.pageSize = data.page.pageSize |
|
|
|
this.totalPage = data.page.totalCount |
|
|
|
this.searchLoading = false |
|
|
|
} else { |
|
|
|
this.searchLoading = false |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.searchLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
@ -1326,11 +1325,11 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
selectFlag (row,index) { |
|
|
|
if (row.status !== '未开工') { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
// if (row.status !== '未开工') { |
|
|
|
// return false |
|
|
|
// } else { |
|
|
|
return true |
|
|
|
} |
|
|
|
// } |
|
|
|
}, |
|
|
|
|
|
|
|
changeModel () { |
|
|
|
@ -1411,6 +1410,7 @@ |
|
|
|
|
|
|
|
// 审核按钮 |
|
|
|
checkModal () { |
|
|
|
let mesUser = this.$store.state.user.name |
|
|
|
this.submitData.site = this.saveData.site |
|
|
|
this.submitData.buNo = this.saveData.buNo |
|
|
|
this.submitData.orderNo = this.saveData.orderNo |
|
|
|
@ -1419,16 +1419,9 @@ |
|
|
|
this.submitData.checker = this.saveData.checker |
|
|
|
this.submitData.checkerName = this.saveData.checkerName |
|
|
|
this.submitData.status = this.saveData.status |
|
|
|
let tempData = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
mesUser: this.$store.state.user.name |
|
|
|
} |
|
|
|
if (!this.submitData.checker.split(';').includes(tempData.mesUser)){ |
|
|
|
this.$alert('审核人员与计划不符!', '错误', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
return false |
|
|
|
if (!this.submitData.checker.split(';').includes(mesUser)){ |
|
|
|
this.$message.warning('审核人员与计划不符!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.submitData.status === '已完工') { |
|
|
|
this.$confirm(`是否取消审核?`, '提示', { |
|
|
|
@ -1438,7 +1431,7 @@ |
|
|
|
}).then(() => { |
|
|
|
checkWorkOrder(this.submitData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.getDataList(); |
|
|
|
this.getDataList() |
|
|
|
this.saveData.status = '待审核' |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
@ -1452,7 +1445,6 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
} else if (this.submitData.status === '待审核') { |
|
|
|
this.$confirm(`是否确认审核?`, '提示', { |
|
|
|
@ -1477,45 +1469,68 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
// selectNameByMes(tempData).then(({data}) => { |
|
|
|
// if (data.rows[0].adminName != this.submitData.checkerName){ |
|
|
|
// this.$alert('审核人员与计划不符!', '错误', { |
|
|
|
// confirmButtonText: '确定', |
|
|
|
// type: 'warning' |
|
|
|
// }) |
|
|
|
// return false |
|
|
|
// }else { |
|
|
|
// this.$confirm(`是否确认审核?`, '提示', { |
|
|
|
// confirmButtonText: '确定', |
|
|
|
// cancelButtonText: '取消', |
|
|
|
// type: 'warning' |
|
|
|
// }).then(() => { |
|
|
|
// checkWorkOrder(this.submitData).then(({data}) => { |
|
|
|
// if (data && data.code === 0) { |
|
|
|
// this.getDataList(); |
|
|
|
// this.detailModelFlag = false; |
|
|
|
// this.$message({ |
|
|
|
// message: '操作成功', |
|
|
|
// type: 'success', |
|
|
|
// duration: 1500, |
|
|
|
// onClose: () => { |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } else { |
|
|
|
// this.$alert(data.msg, '错误', { |
|
|
|
// confirmButtonText: '确定' |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }).catch(() => { |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 批量审核按钮 |
|
|
|
checkModals () { |
|
|
|
let tempData1 = '' // 记录不是待审核的单号 |
|
|
|
let tempData2 = '' // 记录审核人员不符的单号 |
|
|
|
let mesUser = this.$store.state.user.name |
|
|
|
if (this.dataListSelections.length === 0) { |
|
|
|
this.$message.warning('请勾选要审核的工单!') |
|
|
|
return |
|
|
|
} |
|
|
|
for (let i = 0; i < this.dataListSelections.length; i++) { |
|
|
|
if (this.dataListSelections[i].status !== '待审核') { |
|
|
|
tempData1 = tempData1 + this.dataListSelections[i].orderNo + '、' |
|
|
|
} |
|
|
|
if (!this.dataListSelections[i].checker.split(';').includes(mesUser)) { |
|
|
|
tempData2 = tempData2 + this.dataListSelections[i].orderNo + '、' |
|
|
|
} |
|
|
|
} |
|
|
|
if (tempData1 !== '') { |
|
|
|
tempData1 = tempData1.substring(0, tempData1.length - 1) |
|
|
|
this.$message.warning('工单编码 [' + tempData1 + '] 不是待审核状态!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (tempData2 !== '') { |
|
|
|
tempData2 = tempData2.substring(0, tempData2.length - 1) |
|
|
|
this.$message.warning('工单编码 [' + tempData2 + '] 审核人员与计划不符!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.$confirm(`是否确认审核?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.checkLoading = true |
|
|
|
let tempData = { |
|
|
|
informationList: this.dataListSelections |
|
|
|
} |
|
|
|
checkWorkOrders(tempData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.getDataList() |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
this.checkLoading = false |
|
|
|
} else { |
|
|
|
this.checkLoading = false |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.checkLoading = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取用户角色 |
|
|
|
getUserRoleList () { |
|
|
|
getUserRoleList().then(({data}) => { |
|
|
|
|