任务分配、杆塔管理

This commit is contained in:
cool 2024-03-28 11:17:01 +08:00
parent 8a43051799
commit c1afdc310e
11 changed files with 848 additions and 24 deletions

View File

@ -0,0 +1,46 @@
import request from '@/utils/request'
// 查询杆塔列表
export function getGtList(data) {
return request({
url: '/background/back/area/getGtList',
method: 'get',
params: data
})
}
// 新增杆塔
export function addGtItem(data) {
return request({
url: '/background/back/area/addGtData',
method: 'post',
data
})
}
// 查看杆塔详情
export function getGtItemDetail(data) {
return request({
url: '/background/back/area/getGtById',
method: 'post',
data: data
})
}
// 编辑杆塔
export function updateGtItem(data) {
return request({
url: '/background/back/area/updateGtData',
method: 'post',
data
})
}
// 批量删除杆塔
export function deleteGtItem(data) {
return request({
url: '/background/back/area/deleteGt',
method: 'post',
data
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 查询待分配用户列表
export function getUserList(data) {
return request({
url: '/background/user/pro/getUserList',
method: 'get',
params: data
})
}
// 获取用户已分配的工程信息
export function getAssignedProjectList(data) {
return request({
url: '/background/user/pro/getFpProList',
method: 'get',
params: data
})
}
// 查询待分配的工程信息
export function getUnassignedProjectList(data) {
return request({
url: '/background/user/pro/getProList',
method: 'get',
params: data
})
}
// 移除已分配的工程
export function removeAssignedProjectItem(data) {
return request({
url: '/background/user/pro/delUserPro',
method: 'post',
data
})
}
// 用户分配工程
export function assignProject(data) {
return request({
url: '/background/user/pro/addUserPro',
method: 'post',
data
})
}
// 建管单位下拉选
export function getBuildList(data) {
return request({
url: 'system/sys/select/getBuildLists',
method: 'get'
})
}

View File

@ -45,7 +45,7 @@
>
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<span>{{ (listQuery.page - 1) * 10 + scope.$index + 1 }}</span>
<span>{{ (listQuery.pageNum - 1) * 10 + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="区域名称" align="center" prop="areaName" />
@ -73,8 +73,8 @@
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
:page.sync="listQuery.pageNum"
:limit.sync="listQuery.pageSize"
@pagination="getList"
/>
@ -148,8 +148,8 @@ export default {
total: 0,
listLoading: false,
listQuery: {
page: 1,
limit: 10,
pageNum: 1,
pageSize: 10,
proName: '',
areaName: ''
},

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"

View File

@ -0,0 +1,266 @@
<template>
<el-dialog title="杆塔管理" :visible.sync="visible" width="80%" append-to-body custom-class="custom-modal" @closed="handleClosed">
<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"
/>
<el-button
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"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
/>
<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="gtName" />
<el-table-column label="工程名称" align="center" prop="proName" />
<el-table-column label="纬度" align="center" prop="lat" />
<el-table-column label="经度" align="center" prop="lon" />
<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"
/>
</div>
<el-dialog append-to-body :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="gtName">
<el-input v-model="temp.gtName" placeholder="杆塔名称" :maxlength="50" />
</el-form-item>
<el-form-item label="经度:" prop="lon">
<el-input v-model="temp.lon" placeholder="经度" :maxlength="50" />
</el-form-item>
<el-form-item label="纬度:" prop="lat">
<el-input v-model="temp.lat" placeholder="纬度" :maxlength="50" />
</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>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import _ from 'lodash/fp'
import { addGtItem, deleteGtItem, getGtItemDetail, getGtList, updateGtItem } from '@/api/basic/gt'
const defaultTmp = {
gxId: '',
gtName: '',
bidCode: '',
lon: '',
lat: ''
}
export default {
name: 'GtTable',
components: { Pagination },
props: ['currentId', 'componentVisible'],
data() {
return {
tableKey: 0,
list: [],
typeList: [],
multipleSelection: [],
total: 0,
listLoading: false,
listQuery: {
pageNum: 1,
pageSize: 10,
keyword: '',
bidCode: '',
proType: ''
},
tableHeight: 650,
showReviewer: false,
temp: _.cloneDeep(defaultTmp),
dialogFormVisible: false,
dialogStatus: '',
downloadLoading: false,
textMap: {
update: '编辑',
create: '新增'
},
processModalVisible: false,
rules: {
gxName: [{ required: true, message: '请选择', trigger: 'change' }],
planStartTime: [{ required: true, message: '不能为空', trigger: 'blur' }],
planEndTime: [{ required: true, message: '不能为空', trigger: 'blur' }],
gxWeight: [{ required: true, message: '不能为空', trigger: 'blur' }]
}
}
},
computed: {
visible: {
get() {
return this.componentVisible
},
set(val) {
this.$emit('update:componentVisible', val)
}
}
},
watch: {
visible(val) {
if (val) {
this.getList()
}
}
},
created() {
// this.getList()
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val
},
getList() {
this.listLoading = true
this.listQuery.bidCode = this.currentId
getGtList(this.listQuery).then((response) => {
this.list = response.rows
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) {
this.temp.bidCode = this.currentId
addGtItem(this.temp).then((response) => {
this.$message({
showClose: true,
message: response.msg,
type: 'success',
duration: 2000
})
this.getList()
}).finally(() => {
this.dialogFormVisible = false
})
}
})
},
//
handleUpdate(row) {
getGtItemDetail({ gtId: row.gtId }).then((res) => {
this.temp = Object.assign({}, res.data)
})
this.dialogStatus = 'update'
this.dialogFormVisible = true
},
updateData() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
updateGtItem(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') {
deleteGtItem({ gtId: row.gtId }).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)
},
handleClosed() {
this.list = []
this.multipleSelection = []
}
}
}
</script>

View File

@ -103,6 +103,7 @@
<template slot-scope="{ row, $index }">
<el-button v-if="row.status !== '完工'" v-waves type="text" size="mini" @click="handleUpdate(row, $index)">编辑</el-button>
<el-button v-waves type="text" size="mini" @click="handleProcess(row, $index)">工序计划</el-button>
<el-button v-if="row.proType === '线路'" v-waves type="text" size="mini" @click="handleGT(row, $index)">杆塔管理</el-button>
<el-button v-if="row.status !== '完工'" v-waves type="text" size="mini" @click="handleComplete(row, $index)">完工</el-button>
<el-button v-waves type="text" size="mini" @click="handleDelete(row, $index)">删除</el-button>
</template>
@ -132,13 +133,6 @@
<el-input v-model="temp.proName" placeholder="工程名称" :maxlength="50" />
</el-form-item>
<el-form-item label="工程状态:" prop="status">
<!-- <el-select v-model="temp.status" placeholder="请选择" style="width: 100%">-->
<!-- <el-option key="在建" value="在建" label="在建" />-->
<!-- <el-option key="待开工" value="待开工" label="待开工" />-->
<!-- <el-option key="停工" value="停工" label="停工" />-->
<!-- <el-option key="完工" value="完工" label="完工" />-->
<!-- <el-option key="投产" value="投产" label="投产" />-->
<!-- </el-select>-->
<ProjectStatusSelect :bind-value.sync="temp.status" />
</el-form-item>
<el-form-item label="标段编码:" prop="bidCode">
@ -309,6 +303,9 @@
<!--工序-->
<ProcessTable :component-visible.sync="processModalVisible" :process-type="processType" :bid-code="bidCode" />
<!--杆塔管理-->
<GtTable :component-visible.sync="gtModalVisible" :current-id="bidCode" />
</div>
</template>
@ -327,6 +324,7 @@ import {
import _ from 'lodash/fp'
import { downloadFile } from '@/utils/download'
import ProjectStatusSelect from '@/views/basic/project/components/ProjectStatusSelect.vue'
import GtTable from '@/views/basic/project/components/GtTable.vue'
const defaultTmp = {
org: '',
@ -357,7 +355,7 @@ const defaultCompleteTmp = {
}
export default {
components: { ProjectStatusSelect, Pagination, BuildSelect, ProcessTable },
components: { GtTable, ProjectStatusSelect, Pagination, BuildSelect, ProcessTable },
directives: { waves },
data() {
return {
@ -391,6 +389,7 @@ export default {
dialogPvVisible: false,
completeModalVisible: false,
processModalVisible: false,
gtModalVisible: false,
processType: '',
bidCode: '',
completeForm: _.cloneDeep(defaultCompleteTmp),
@ -604,6 +603,12 @@ export default {
this.bidCode = row.bidCode
this.processModalVisible = true
},
//
handleGT(row) {
this.processType = row.proType
this.bidCode = row.bidCode
this.gtModalVisible = true
},
//
handleDelete(row, index) {
this.$confirm(`确定要删除该数据吗?`, {

View File

@ -41,7 +41,7 @@
>
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<span>{{ (listQuery.page - 1) * 10 + scope.$index + 1 }}</span>
<span>{{ (listQuery.pageNum - 1) * 10 + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="设备名称" align="center" prop="deviceName" />
@ -68,8 +68,8 @@
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
:page.sync="listQuery.pageNum"
:limit.sync="listQuery.pageSize"
@pagination="getList"
/>
@ -157,8 +157,8 @@ export default {
total: 0,
listLoading: false,
listQuery: {
page: 1,
limit: 10,
pageNum: 1,
pageSize: 10,
keyWord: '',
onLine: 1
},

View File

@ -127,12 +127,7 @@ export default {
return {
tableKey: 0,
list: [],
teamList: [],
total: 0,
imageList: [],
delFiles: [],
currentImageViewList: [],
imageUploadLimit: 5,
listLoading: false,
listQuery: {
pageNum: 1,

View File

@ -0,0 +1,64 @@
<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>
import { getSidebandList } from '@/api/public'
export default {
name: 'OrgSelect',
props: ['bindValue', 'disabled', 'change'],
data() {
return {
options: []
}
},
computed: {
currentOption: {
get() {
return this.bindValue
},
set(val) {
this.$emit('update:bindValue', val)
}
}
},
mounted() {
this.getList()
},
methods: {
getList() {
getSidebandList().then(res => {
this.options = res.data.map(item => {
const { id, name, bidCode, gtId } = item
return {
value: id,
label: name,
bidCode,
gtId
}
})
this.$nextTick(() => {
if (this.options?.length && this.currentOption && this.options.find(item => item.value === this.currentOption)) {
this.handleChange(this.currentOption)
}
})
})
},
handleChange(value) {
const target = this.options.find(item => item.value === value)
this.$emit('change', target)
}
}
}
</script>
<style scoped lang="less"></style>

View File

@ -0,0 +1,242 @@
<template>
<el-dialog title="任务分配" :visible.sync="visible" width="80%" append-to-body custom-class="custom-modal" @closed="handleClosedModal">
<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 style="width: 200px" class="filter-item ml-20" :current-build.sync="listQuery.orgId" />
<el-input
v-model="listQuery.proName"
placeholder="工程名称"
style="width: 200px"
class="filter-item ml-20"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
<el-select v-model="temp.type" placeholder="请选择是否已分配" style="width: 200px" class="filter-item ml-20">
<el-option v-for="item in Object.keys(typeMap)" :key="item" :value="Number(item)" :label="typeMap[item]" />
</el-select>
<el-button
v-waves
style="margin-left: 40px"
class="filter-item"
type="primary"
@click="handleFilter"
>
查询
</el-button>
<el-button v-if="currentOperateType === 'create'" v-waves class="filter-item" style="margin-left: 10px" type="primary" @click="handleCreate">
分配
</el-button>
<el-button v-else v-waves class="filter-item" style="margin-left: 10px" type="primary" @click="handleRemove('all')">
清空
</el-button>
</div>
<el-table
:key="tableKey"
v-loading="listLoading"
:data="list"
border
fit
highlight-current-row
style="width: 100%"
:max-height="tableHeight"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
/>
<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="bidName" />
<el-table-column label="建管单位" align="center" prop="orgName" />
<el-table-column label="班组长" align="center" prop="manager" />
<el-table-column v-if="currentOperateType === 'remove'" label="操作" align="center" class-name="small-padding fixed-width" width="160">
<template slot-scope="{ row, $index }">
<el-button v-waves type="text" size="mini" @click="handleRemove(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"
/>
</div>
</el-dialog>
</template>
<script>
import waves from '@/directive/waves'
import Pagination from '@/components/Pagination'
import _ from 'lodash/fp'
import BuildSelect from '@/views/basic/project/components/BuildSelect.vue'
import {
assignProject,
getAssignedProjectList,
getUnassignedProjectList,
removeAssignedProjectItem
} from '@/api/risk/task'
const defaultTmp = {
userId: '',
bidCode: ''
}
export default {
name: 'TaskTable',
components: { BuildSelect, Pagination },
directives: { waves },
props: ['currentId', 'currentOperateType', 'componentVisible'],
data() {
return {
tableKey: 0,
list: [],
multipleSelection: [],
total: 0,
listLoading: false,
listQuery: {
type: 1,
userId: '',
pageNum: 1,
pageSize: 10,
keyword: '',
orgId: '',
proName: ''
},
typeMap: {
1: '已分配',
2: '未分配'
},
tableHeight: 650,
showReviewer: false,
temp: _.cloneDeep(defaultTmp),
dialogFormVisible: false,
dialogStatus: '',
downloadLoading: false,
textMap: {
update: '编辑',
create: '新增'
},
processModalVisible: false,
rules: {
gxName: [{ required: true, message: '请选择', trigger: 'change' }],
planStartTime: [{ required: true, message: '不能为空', trigger: 'blur' }],
planEndTime: [{ required: true, message: '不能为空', trigger: 'blur' }],
gxWeight: [{ required: true, message: '不能为空', trigger: 'blur' }]
}
}
},
computed: {
visible: {
get() {
return this.componentVisible
},
set(val) {
this.$emit('update:componentVisible', val)
}
}
},
watch: {
visible(val) {
if (val) {
this.getList()
}
}
},
created() {
// this.getList()
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val
},
getList() {
this.listLoading = true
this.listQuery.userId = this.currentId
//
if (this.currentOperateType === 'create') {
getUnassignedProjectList(this.listQuery).then((response) => {
this.list = response.rows
this.total = response.total
this.listLoading = false
})
} else { //
getAssignedProjectList(this.listQuery).then((response) => {
this.list = response.rows
this.total = response.total
this.listLoading = false
})
}
},
//
handleFilter() {
this.listQuery.pageNum = 1
this.getList()
},
//
handleCreate() {
this.temp.userId = this.currentId
this.temp.bidCode = this.multipleSelection.map(item => item.bidCode).join('@')
assignProject(this.temp).then((response) => {
this.$message({
showClose: true,
message: response.msg,
type: 'success',
duration: 2000
})
this.getList()
this.dialogFormVisible = false
})
},
//
handleRemove(row) {
if (row === 'all') {
// this.temp.bidCode = this.multipleSelection.map(item => item.bidCode).join('@')
this.temp.bidCode = ''
} else {
this.temp.bidCode = row.bidCode
}
this.temp.userId = this.currentId
this.$confirm(row === 'all' ? `确定要清空吗?` : `确定要移除吗?`, {
type: 'warning',
title: '操作提示',
beforeClose: async(action, instance, done) => {
if (action === 'confirm') {
removeAssignedProjectItem(this.temp).then((response) => {
done()
this.$message({
showClose: true,
message: response.msg,
type: 'success',
duration: 2000
})
this.getList()
})
} else {
done()
}
}
})
},
handleClosedModal() {
this.multipleSelection = []
this.list = []
}
}
}
</script>

View File

@ -0,0 +1,152 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.userName"
placeholder="用户姓名"
style="width: 200px"
class="filter-item"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
<el-input
v-model="listQuery.account"
placeholder="账号"
style="width: 200px"
class="filter-item ml-20"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
<el-button
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="userName" />
<el-table-column label="账号" align="center" prop="loginName" />
<el-table-column label="分配任务数量" align="center" prop="taskNum">
<template slot-scope="{ row }">
<el-button type="text" size="mini" @click="handleViewRecord(row)">{{ row.proNum }}</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
<template slot-scope="{ row }">
<el-button type="text" size="mini" @click="handleCreate(row)">分配</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"
/>
<TaskTable :current-id="currentId" :current-operate-type="dialogStatus" :component-visible.sync="taskModalVisible" />
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import _ from 'lodash/fp'
import { downloadFile } from '@/utils/download'
import { getUserList } from '@/api/risk/task'
import TaskTable from '@/views/risk/task/components/TaskModal.vue'
export default {
components: { TaskTable, Pagination },
data() {
return {
tableKey: 0,
list: [],
total: 0,
listLoading: false,
listQuery: {
pageNum: 1,
pageSize: 10,
userName: '',
account: ''
},
tableHeight: 650,
taskModalVisible: false,
dialogStatus: 'create',
currentId: '',
textMap: {
update: '编辑',
create: '新增'
},
rules: {
bidCode: [{ required: true, message: '不能为空', trigger: 'change' }],
userName: [{ required: true, message: '不能为空', trigger: 'blur' }],
phone: [{ required: true, message: '不能为空', trigger: 'blur' }],
carNum: [{ required: true, message: '不能为空', trigger: 'blur' }]
}
}
},
created() {
this.getList()
},
methods: {
//
handleViewRecord(row) {
this.dialogStatus = 'remove'
this.currentId = row.userId
this.taskModalVisible = true
},
//
handleExport() {
// exportCarDetail().then(res => {
// downloadFile({ fileName: '.xlsx', fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
// })
},
getList() {
this.listLoading = true
getUserList(this.listQuery).then((response) => {
this.list = response.rows.map(item => {
return item
})
this.total = response.total
this.listLoading = false
})
},
//
handleFilter() {
this.listQuery.pageNum = 1
this.getList()
},
//
handleCreate(row) {
this.dialogStatus = 'create'
this.currentId = row.userId
this.taskModalVisible = true
}
}
}
</script>