2024-03-15 17:45:13 +08:00
|
|
|
|
<template>
|
2024-03-19 15:32:05 +08:00
|
|
|
|
<el-dialog :title="title" :visible.sync="visible" width="80%" append-to-body custom-class="custom-modal">
|
2024-03-15 17:45:13 +08:00
|
|
|
|
<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
|
|
|
|
|
|
v-waves
|
|
|
|
|
|
style="margin-left: 40px"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handleFilter"
|
|
|
|
|
|
>
|
|
|
|
|
|
查询
|
|
|
|
|
|
</el-button>
|
2024-03-19 15:32:05 +08:00
|
|
|
|
<el-button v-waves class="filter-item" style="margin-left: 10px" type="primary" @click="handleCreate">
|
2024-03-15 17:45:13 +08:00
|
|
|
|
新增
|
|
|
|
|
|
</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="gxName" />
|
|
|
|
|
|
<el-table-column label="计划开始时间" align="center" prop="planStartTime" />
|
|
|
|
|
|
<el-table-column label="计划结束时间" align="center" prop="planEndTime" />
|
|
|
|
|
|
<el-table-column label="实际开始时间" align="center" prop="startTime" />
|
|
|
|
|
|
<el-table-column label="实际结束时间" align="center" prop="endTime" />
|
|
|
|
|
|
<el-table-column label="进度占比" align="center" prop="gxWeight" />
|
|
|
|
|
|
<el-table-column label="延迟原因" align="center" prop="delaReason" />
|
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
|
|
|
|
|
|
<template slot-scope="{ row, $index }">
|
2024-03-19 15:32:05 +08:00
|
|
|
|
<el-button v-waves type="text" size="mini" @click="handleUpdate(row, $index)">编辑</el-button>
|
|
|
|
|
|
<el-button v-waves type="text" size="mini" @click="handleDelete(row, $index)">删除</el-button>
|
2024-03-15 17:45:13 +08:00
|
|
|
|
</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"
|
|
|
|
|
|
>
|
2024-03-18 10:59:37 +08:00
|
|
|
|
<el-form-item :label="`${title}:`" prop="gxId">
|
2024-04-03 17:49:27 +08:00
|
|
|
|
<el-select v-model="temp.gxId" placeholder="请选择" style="width: 100%" clearable>
|
2024-03-18 10:59:37 +08:00
|
|
|
|
<el-option v-for="item in typeList" :key="item.id" :value="item.id" :label="item.name" />
|
|
|
|
|
|
</el-select>
|
2024-03-15 17:45:13 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="计划开始时间:" prop="planStartTime">
|
2024-03-18 10:59:37 +08:00
|
|
|
|
<el-date-picker
|
|
|
|
|
|
v-model="temp.planStartTime"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
type="date"
|
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
|
/>
|
2024-03-15 17:45:13 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="计划结束时间:" prop="planEndTime">
|
2024-03-18 10:59:37 +08:00
|
|
|
|
<el-date-picker
|
|
|
|
|
|
v-model="temp.planEndTime"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
type="date"
|
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
|
/>
|
2024-03-15 17:45:13 +08:00
|
|
|
|
</el-form-item>
|
2024-03-18 10:59:37 +08:00
|
|
|
|
<el-form-item label="作业权重(%):" prop="gxWeight">
|
2024-03-15 17:45:13 +08:00
|
|
|
|
<el-input v-model="temp.gxWeight" placeholder="进度占比" :maxlength="50" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
2024-03-19 15:32:05 +08:00
|
|
|
|
<el-button v-waves @click="dialogFormVisible = false"> 关闭 </el-button>
|
|
|
|
|
|
<el-button v-waves type="primary" @click="dialogStatus === 'create' ? createData() : updateData()">
|
2024-03-15 17:45:13 +08:00
|
|
|
|
提交
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import waves from '@/directive/waves'
|
|
|
|
|
|
import Pagination from '@/components/Pagination'
|
|
|
|
|
|
|
|
|
|
|
|
import _ from 'lodash/fp'
|
|
|
|
|
|
import {
|
|
|
|
|
|
addProcessItem,
|
|
|
|
|
|
deleteProcessItem,
|
|
|
|
|
|
getProcessItemDetail,
|
2024-03-18 10:59:37 +08:00
|
|
|
|
getProcessList, getTowerList,
|
2024-03-15 17:45:13 +08:00
|
|
|
|
updateProcessItem
|
|
|
|
|
|
} from '@/api/basic/project'
|
|
|
|
|
|
|
|
|
|
|
|
const defaultTmp = {
|
2024-03-18 10:59:37 +08:00
|
|
|
|
gxId: '',
|
|
|
|
|
|
// gxName: '',
|
2024-03-15 17:45:13 +08:00
|
|
|
|
planStartTime: '',
|
|
|
|
|
|
planEndTime: '',
|
|
|
|
|
|
startTime: '',
|
|
|
|
|
|
endTime: '',
|
2024-03-18 10:59:37 +08:00
|
|
|
|
gxWeight: '',
|
|
|
|
|
|
bidCode: ''
|
2024-03-15 17:45:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'ProcessTable',
|
|
|
|
|
|
components: { Pagination },
|
|
|
|
|
|
directives: { waves },
|
2024-03-18 10:59:37 +08:00
|
|
|
|
props: ['bidCode', 'processType', 'componentVisible', 'currentFormData'],
|
2024-03-15 17:45:13 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
tableKey: 0,
|
|
|
|
|
|
list: [],
|
2024-03-18 10:59:37 +08:00
|
|
|
|
typeList: [],
|
2024-03-15 17:45:13 +08:00
|
|
|
|
total: 0,
|
|
|
|
|
|
listLoading: false,
|
|
|
|
|
|
listQuery: {
|
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
|
pageSize: 10,
|
2024-03-18 10:59:37 +08:00
|
|
|
|
keyword: '',
|
|
|
|
|
|
bidCode: '',
|
|
|
|
|
|
proType: ''
|
2024-03-15 17:45:13 +08:00
|
|
|
|
},
|
|
|
|
|
|
tableHeight: 650,
|
|
|
|
|
|
showReviewer: false,
|
|
|
|
|
|
temp: _.cloneDeep(defaultTmp),
|
|
|
|
|
|
dialogFormVisible: false,
|
|
|
|
|
|
dialogStatus: '',
|
|
|
|
|
|
downloadLoading: false,
|
|
|
|
|
|
textMap: {
|
|
|
|
|
|
update: '编辑',
|
|
|
|
|
|
create: '新增'
|
|
|
|
|
|
},
|
|
|
|
|
|
processModalVisible: false,
|
|
|
|
|
|
rules: {
|
2024-03-18 10:59:37 +08:00
|
|
|
|
gxName: [{ required: true, message: '请选择', trigger: 'change' }],
|
2024-03-15 17:45:13 +08:00
|
|
|
|
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)
|
|
|
|
|
|
}
|
2024-03-18 10:59:37 +08:00
|
|
|
|
},
|
|
|
|
|
|
title() {
|
|
|
|
|
|
return this.processType === '线路' ? '杆塔' : '工序计划'
|
2024-03-15 17:45:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
visible(val) {
|
|
|
|
|
|
if (val) {
|
|
|
|
|
|
this.getList()
|
2024-03-18 10:59:37 +08:00
|
|
|
|
this.getTowerList()
|
2024-03-15 17:45:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
|
|
|
// this.getList()
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2024-03-18 10:59:37 +08:00
|
|
|
|
getTowerList() {
|
|
|
|
|
|
getTowerList({ param: this.processType === '线路' ? this.bidCode : '400', proType: this.processType === '线路' ? 2 : 1 }).then(res => {
|
|
|
|
|
|
this.typeList = res.data
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2024-03-15 17:45:13 +08:00
|
|
|
|
getList() {
|
|
|
|
|
|
this.listLoading = true
|
2024-03-18 10:59:37 +08:00
|
|
|
|
this.listQuery.bidCode = this.bidCode
|
|
|
|
|
|
this.listQuery.proType = this.processType
|
2024-03-15 17:45:13 +08:00
|
|
|
|
getProcessList(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) {
|
2024-03-18 10:59:37 +08:00
|
|
|
|
this.temp.bidCode = this.bidCode
|
2024-03-15 17:45:13 +08:00
|
|
|
|
addProcessItem(this.temp).then((response) => {
|
|
|
|
|
|
this.$message({
|
|
|
|
|
|
showClose: true,
|
|
|
|
|
|
message: response.msg,
|
|
|
|
|
|
type: 'success',
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
})
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
|
this.dialogFormVisible = false
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
// 编辑
|
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
|
getProcessItemDetail({ planId: row.planId, bidCode: row.bidCode }).then((res) => {
|
|
|
|
|
|
this.temp = Object.assign({}, res.data)
|
|
|
|
|
|
})
|
|
|
|
|
|
this.dialogStatus = 'update'
|
|
|
|
|
|
this.dialogFormVisible = true
|
|
|
|
|
|
},
|
|
|
|
|
|
updateData() {
|
|
|
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
updateProcessItem(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') {
|
2024-03-18 10:59:37 +08:00
|
|
|
|
deleteProcessItem({ planId: row.planId }).then((response) => {
|
2024-03-15 17:45:13 +08:00
|
|
|
|
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>
|