值班计划

This commit is contained in:
cool 2024-03-23 15:08:32 +08:00
parent e9a4dd4f3f
commit f0c40c1f09
9 changed files with 382 additions and 55 deletions

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 获取当日任务列表
export function getDailyTaskList(data) {
return request({
url: '/background/back/todayTask/getToDayTaskLists',
method: 'get',
params: data
})
}

View File

@ -103,7 +103,6 @@ function genPermissionRouter(menus, level = 0) {
const loadView = (view) => {
if (process.env.NODE_ENV === 'development') {
console.log(view);
return (resolve) => require([`@/views${view}/index`], resolve)
} else {
// 使用 import 实现生产环境的路由懒加载

View File

@ -1,5 +1,5 @@
<template>
<el-select v-model="currentOption" placeholder="请选择" style="width: 100%">
<el-select v-model="currentOption" placeholder="建管单位" style="width: 100%">
<el-option
v-for="item in options"
:key="item.value"
@ -10,12 +10,15 @@
</template>
<script>
import { getBuildList } from '@/api/basic/project'
//
export default {
name: 'BuildSelect',
props: ['options', 'currentBuild', 'disabled'],
props: ['currentBuild', 'disabled'],
data() {
return {
// editClass: this.formClass
options: []
}
},
computed: {
@ -31,10 +34,22 @@ export default {
watch: {
},
mounted() {},
mounted() {
this.getList()
},
methods: {
handleChange(data) {
// console.log(data)
getList() {
getBuildList({ bidCode: this.bidCode, gtId: this.gtId || '' }).then(res => {
this.options = res.data.map(item => {
return {
label: item.name,
value: item.orgId
}
})
})
},
handleChange(value) {
}
}
}

View File

@ -126,7 +126,7 @@
label-width="120px"
>
<el-form-item label="建管单位:" prop="org">
<BuildSelect :current-build.sync="temp.org" :options="buildOptions" />
<BuildSelect :current-build.sync="temp.org" />
</el-form-item>
<el-form-item label="工程名称:" prop="proName">
<el-input v-model="temp.proName" placeholder="工程名称" :maxlength="50" />
@ -319,7 +319,7 @@ import ProcessTable from '@/views/basic/project/components/ProcessTable.vue'
import {
addProjectItem, completeProject,
deleteProjectItem, downloadProjectTemplate,
exportProject, getBuildList, getProjectItemDetail,
exportProject, getProjectItemDetail,
getProjectList, getViewImageList, updateProjectItem
} from '@/api/basic/project'
@ -421,7 +421,6 @@ export default {
},
created() {
this.getList()
this.getBuildList()
},
methods: {
//
@ -435,17 +434,6 @@ export default {
handleValidateField(name, type) {
this.$refs[name].validateField(type)
},
//
getBuildList() {
getBuildList().then(res => {
this.buildOptions = res.data.map(item => {
return {
label: item.name,
value: item.orgId
}
})
})
},
getList() {
this.listLoading = true
getProjectList(this.listQuery).then((response) => {

View File

@ -1,5 +1,5 @@
<template>
<el-select v-model="currentOption" placeholder="请选择" style="width: 100%" @change="handleChange">
<el-select v-model="currentOption" placeholder="请选择区域" style="width: 100%" @change="handleChange">
<el-option
v-for="item in options"
:key="item.value"
@ -11,7 +11,7 @@
<script>
import { getAreaSelectList } from '@/api/public'
//
export default {
name: 'AreaSelect',
props: ['bindValue', 'bidCode', 'gtId', 'disabled'],

View File

@ -110,11 +110,9 @@ export default {
methods: {
getList() {
this.listLoading = true
if (this.listQuery.time?.length) {
this.listQuery.time = this.listQuery.time?.join(' - ')
} else {
this.listQuery.time = ''
}
this.listQuery.time = (this.listQuery.time?.length) ? this.listQuery.time?.join(' - ') : ''
this.listQuery.id = this.currentId
getStaffAccessRecord(this.listQuery).then((response) => {
this.list = response.rows.map(item => {

View File

@ -0,0 +1,51 @@
<template>
<el-select v-model="currentOption" placeholder="风险等级" style="width: 100%" @change="handleChange">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
<script>
export default {
name: 'RiskLevelSelect',
props: ['bindValue', 'disabled'],
data() {
return {
options: []
}
},
computed: {
currentOption: {
get() {
return this.bindValue
},
set(val) {
this.$emit('update:bindValue', val)
}
}
},
mounted() {
this.getList()
},
methods: {
getList() {
this.options = ['一级', '二级', '三级', '四级'].map((item, index) => {
return {
value: index,
label: item
}
})
},
handleChange(value) {
}
}
}
</script>
<style scoped lang="less"></style>

View File

@ -0,0 +1,293 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyWord"
placeholder="关键字"
style="width: 200px"
class="filter-item"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
<BuildSelect :current-build.sync="listQuery.orgCode" class="filter-item ml-20" style="width: 200px" />
<RiskLevelSelect :bind-value.sync="listQuery.riskLevel" class="filter-item ml-20" style="width: 200px" />
<el-date-picker
v-model="listQuery.wordDay"
style="width: 300px"
class="filter-item ml-20"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<el-button
v-waves
style="margin-left: 40px"
class="filter-item"
type="primary"
@click="handleFilter"
>
查询
</el-button>
<el-button class="filter-item" style="margin-left: 10px" type="primary" @click="handleCreate">
新增
</el-button>
</div>
<el-table
:key="tableKey"
v-loading="listLoading"
:data="list"
border
fit
highlight-current-row
style="width: 100%"
:max-height="tableHeight"
>
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<span>{{ (listQuery.pageNum - 1) * 10 + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="班组名称" align="center" prop="teamName" />
<el-table-column label="班组长" align="center" prop="teamLeader" />
<el-table-column label="班组长手机号" align="center" prop="teamLeaderPhone" />
<el-table-column label="评价日期" align="center" prop="evalTime" />
<el-table-column label="评价人" align="center" prop="evaluator" />
<el-table-column label="评价星级" align="center" prop="score">
<template slot-scope="{ row }">
<el-rate :value="row.score" disabled :max="5" />
</template>
</el-table-column>
<el-table-column label="评价内容" align="center" prop="content" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
<template slot-scope="{ row, $index }">
<el-button type="text" size="mini" @click="handleUpdate(row, $index)">编辑</el-button>
<el-button type="text" size="mini" @click="handleDelete(row, $index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.pageNum"
:limit.sync="listQuery.pageSize"
@pagination="getList"
/>
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="630px" @closed="handleClosedModal">
<el-form
ref="dataForm"
:rules="rules"
:model="temp"
label-position="right"
label-width="120px"
>
<el-form-item label="班组:" prop="teamId">
<el-select v-model="temp.teamId" placeholder="班组" style="width: 100%" @change="handleChooseTeam">
<el-option v-for="item in teamList" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</el-form-item>
<el-form-item label="班组长:" prop="teamLeader">
<el-input v-model="temp.teamLeader" placeholder="班组长" :maxlength="50" disabled />
</el-form-item>
<el-form-item label="班组长手机号:" prop="teamLeaderPhone">
<el-input v-model="temp.teamLeaderPhone" placeholder="班组长手机号" :maxlength="50" disabled />
</el-form-item>
<el-form-item label="评价星级:" prop="score" :max="5">
<!-- <el-input v-model="temp.score" placeholder="评价星级" :maxlength="50" />-->
<el-rate v-model="temp.score" />
</el-form-item>
<el-form-item label="评级内容:" prop="content">
<el-input v-model="temp.content" placeholder="评级内容" :maxlength="50" type="textarea" :rows="2" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> 关闭 </el-button>
<el-button type="primary" @click="dialogStatus === 'create' ? createData() : updateData()">
提交
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import waves from '@/directive/waves'
import Pagination from '@/components/Pagination'
import _ from 'lodash/fp'
import {
addQualityItem,
deleteQualityItem,
getQualityItemDetail,
updateQualityItem
} from '@/api/basic/quality'
import BuildSelect from '@/views/basic/project/components/BuildSelect.vue'
import { getDailyTaskList } from '@/api/risk/dailyTask'
import RiskLevelSelect from '@/views/risk/dailyTask/components/RiskLevelSelect.vue'
const defaultTmp = {
teamId: '',
teamName: '',
teamLeader: '',
teamLeaderPhone: '',
evalTime: '',
evaluator: '',
score: 0,
content: ''
}
export default {
components: { RiskLevelSelect, BuildSelect, Pagination },
directives: { waves },
data() {
return {
tableKey: 0,
list: [],
teamList: [],
total: 0,
listLoading: false,
listQuery: {
pageNum: 1,
pageSize: 10,
keyWord: '',
orgCode: '',
riskLevel: '',
wordDay: []
},
tableHeight: 650,
temp: _.cloneDeep(defaultTmp),
dialogFormVisible: false,
dialogStatus: '',
downloadLoading: false,
textMap: {
update: '编辑',
create: '新增'
},
dialogPvVisible: false,
rules: {
teamId: [{ required: true, message: '不能为空', trigger: 'change' }],
teamName: [{ required: true, message: '不能为空', trigger: 'blur' }],
teamLeader: [{ required: true, message: '不能为空', trigger: 'blur' }],
teamLeaderPhone: [{ required: true, message: '不能为空', trigger: 'blur' }],
score: [{ required: true, message: '不能为空', trigger: 'change' }],
content: [{ required: true, message: '不能为空', trigger: 'blur' }]
}
}
},
created() {
this.getList()
},
methods: {
handleChooseTeam(val) {
const currentTeam = this.teamList.find(item => item.id === val)
this.temp.teamName = currentTeam.name
this.temp.teamLeader = currentTeam.teamLeader
this.temp.teamLeaderPhone = currentTeam.teamLeaderPhone
},
getList() {
this.listLoading = true
this.listQuery.time = (this.listQuery.time?.length) ? this.listQuery.time?.join(' - ') : ''
getDailyTaskList(this.listQuery).then((response) => {
this.list = response.rows.map(item => {
return item
})
this.total = response.total
}).finally(() => {
this.listLoading = false
})
},
//
handleFilter() {
this.listQuery.pageNum = 1
this.getList()
},
//
handleCreate() {
this.dialogStatus = 'create'
this.dialogFormVisible = true
},
createData() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addQualityItem(this.temp).then((response) => {
this.$message({
showClose: true,
message: response.msg,
type: 'success',
duration: 2000
})
this.getList()
}).finally(() => {
this.dialogFormVisible = false
})
}
})
},
//
handleUpdate(row) {
getQualityItemDetail({ evalId: row.evalId }).then((res) => {
const { score } = res.data
this.temp = Object.assign({}, res.data)
this.temp.score = Number(score)
if (this.temp.score > 5) this.temp.score = 5
this.temp.teamId = row.teamId
})
this.dialogStatus = 'update'
this.dialogFormVisible = true
},
updateData() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
updateQualityItem(this.temp).then((response) => {
this.$message({
showClose: true,
message: response.msg,
type: 'success',
duration: 2000
})
this.getList()
}).finally(() => {
this.dialogFormVisible = false
})
}
})
},
//
handleDelete(row, index) {
this.$confirm(`确定要删除该数据吗?`, {
type: 'warning',
title: '操作提示',
beforeClose: async(action, instance, done) => {
if (action === 'confirm') {
deleteQualityItem({ evalId: row.evalId }).then((response) => {
done()
this.$message({
showClose: true,
message: response.msg,
type: 'success',
duration: 2000
})
this.getList()
})
} else {
done()
}
}
})
},
handleClosedModal() {
this.$refs['dataForm'].resetFields()
this.temp = _.cloneDeep(defaultTmp)
}
}
}
</script>

View File

@ -103,10 +103,6 @@ import waves from '@/directive/waves'
import Pagination from '@/components/Pagination'
import _ from 'lodash/fp'
import {
addQualityItem,
deleteQualityItem
} from '@/api/basic/quality'
import { downloadFile } from '@/utils/download'
import { exportDutyPlan, getDutyPlan, getTimeList, updateDutyPlan } from '@/api/risk/dutyPlan'
@ -263,29 +259,6 @@ export default {
}
})
},
//
handleDelete(row, index) {
this.$confirm(`确定要删除该数据吗?`, {
type: 'warning',
title: '操作提示',
beforeClose: async(action, instance, done) => {
if (action === 'confirm') {
deleteQualityItem({ evalId: row.evalId }).then((response) => {
done()
this.$message({
showClose: true,
message: response.msg,
type: 'success',
duration: 2000
})
this.getList()
})
} else {
done()
}
}
})
},
handleClosedModal() {
this.$refs['dataForm'].resetFields()
this.temp = _.cloneDeep(defaultTmp)