Browse Source

2025-04-03

点检维保批量审核
java8
fengyuan_yang 10 months ago
parent
commit
e2e92f9527
  1. 2
      src/api/eam/eam.js
  2. 112
      src/views/modules/eam/eamWorkOrderForCheck.vue
  3. 155
      src/views/modules/eam/eamWorkOrderForMaintenance.vue

2
src/api/eam/eam.js

@ -251,3 +251,5 @@ export const updateFeedMatter = data => createAPI(`/pms/eam/updateFeedMatter`,'p
export const deleteFeedMatter = data => createAPI(`/pms/eam/deleteFeedMatter`,'post',data)
export const getOperatorListByOrder = data => createAPI(`/pms/eam/getOperatorListByOrder`,'post',data)
export const checkWorkOrders = data => createAPI(`/pms/eam/checkWorkOrders`,'post',data)

112
src/views/modules/eam/eamWorkOrderForCheck.vue

@ -23,9 +23,10 @@
<el-form-item label="计划执行人员">
<el-input v-model="searchData.planOperatorName" 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 filterable 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,7 +64,8 @@
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button v-if="!authSearch" type="primary" @click="searchClick()">查询</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()"
@ -413,7 +415,8 @@
getSiteAndBuByUserName,
getUserRoleList,
getOperatorList,
getRoleByUserName
getRoleByUserName,
checkWorkOrders, //
} from "@/api/eam/eam.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
@ -423,18 +426,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) {
@ -1074,13 +1065,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
})
},
@ -1263,6 +1256,7 @@
//
getDataList () {
this.searchLoading = true
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
eamWorkOrderSearch(this.searchData).then(({data}) => {
@ -1271,7 +1265,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
})
},
@ -1295,6 +1294,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
@ -1303,11 +1303,7 @@
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)) {
if (!this.submitData.checker.split(';').includes(mesUser)) {
this.$message.warning('审核人员与计划不符!')
return
}
@ -1333,7 +1329,6 @@
})
}
})
}).catch(() => {
})
} else if (this.submitData.status === '待审核') {
this.$confirm(`是否确认审核?`, '提示', {
@ -1357,11 +1352,68 @@
})
}
})
}).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
})
})
},
//
submitModel () {
if (this.submitData.difficultyLevel === ''||this.submitData.difficultyLevel == null) {
@ -1488,12 +1540,12 @@
})
},
selectFlag (row,index) {
if (row.status !== '未开工') {
return false
}else {
selectFlag (row, index) {
// if (row.status !== '') {
// return false
// } else {
return true
}
// }
},
changeModel () {

155
src/views/modules/eam/eamWorkOrderForMaintenance.vue

@ -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}) => {

Loading…
Cancel
Save