项目计划管理

This commit is contained in:
Vergil
2020-03-12 15:06:27 +08:00
parent f06e221a61
commit b1a9b26591

View File

@@ -21,6 +21,7 @@
<h3 style="display: inline-block;margin: 0 0 0 20px">客户名称:</h3>
<el-input v-model="CustomerNameValue" placeholder="客户名称" size="small" clearable style="width:200px"/>
<el-button size="small" icon="el-icon-search" type="primary" plain style="margin-left: 10px" @click="pageSize=10; pageCurrent=1;searchTable()">查询</el-button>
<el-button size="small" style="margin: 0px 0px 3px 300px" type="warning" icon="el-icon-edit-outline" plain @click="editPro()">编辑</el-button>
</el-row>
<el-row v-if="false">
<h3 style="display: inline-block;margin: 0">签订日期:</h3>
@@ -35,7 +36,7 @@
<el-card style="overflow: auto">
<el-col style="width: 1400px;">
<!--<h2 style="display: inline-block;margin: 0 0 10px 0">总计划:</h2>-->
<el-table v-loading="loading" :data="tableData" height="330" highlight-current-row style="margin-top: 5px;width: 100%;" border element-loading-text="拼命加载中">
<el-table v-loading="loading" :data="tableData" height="330" highlight-current-row style="margin-top: 5px;width: 100%;" border element-loading-text="拼命加载中" @row-click="rowClick">
<el-table-column label="项目编号" align="center" width="140px" fixed="left">
<template slot-scope="scope">
<template v-if="scope.row.edit">
@@ -86,131 +87,6 @@
{{ scope.row.安装调试节点 !== '1900/1/1' ? scope.row.安装调试节点 : '' }}
</template>
</el-table-column>
<!--<el-table-column label="设计者" align="center" width="90px">-->
<!--<template slot-scope="scope">-->
<!--<template v-if="scope.row.edit">-->
<!--<el-input v-model="scope.row.机床设计者" size="mini" style="width: 100%"/>-->
<!--</template>-->
<!--<template v-else>-->
<!--{{ scope.row.机床设计者 }}-->
<!--</template>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="审图(计划开始)" align="center" width="170px">-->
<!--<template slot-scope="scope">-->
<!--<template v-if="scope.row.edit">-->
<!--<el-date-picker v-model="scope.row.审图计划开始时间" value-format="yyyy-MM-dd" size="mini" type="date" style="width: 100%"/>-->
<!--</template>-->
<!--<template v-else>-->
<!--{{ scope.row.审图计划开始时间 !== '1900/1/1' ? scope.row.审图计划开始时间 : '' }}-->
<!--</template>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="审图(计划完成)" align="center" width="170px">-->
<!--<template slot-scope="scope">-->
<!--<template v-if="scope.row.edit">-->
<!--<el-date-picker v-model="scope.row.审图计划完成时间" value-format="yyyy-MM-dd" size="mini" type="date" style="width: 100%"/>-->
<!--</template>-->
<!--<template v-else>-->
<!--{{ scope.row.审图计划完成时间 !== '1900/1/1' ? scope.row.审图计划完成时间 : '' }}-->
<!--</template>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="审图(实际完成)" align="center" width="170px">-->
<!--<template slot-scope="scope">-->
<!--<template v-if="scope.row.edit">-->
<!--<el-date-picker v-model="scope.row.审图实际完成时间" value-format="yyyy-MM-dd" size="mini" type="date" style="width: 100%"/>-->
<!--</template>-->
<!--<template v-else>-->
<!--{{ scope.row.审图实际完成时间 !== '1900/1/1' ? scope.row.审图实际完成时间 : '' }}-->
<!--</template>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="发图(计划)" align="center" width="150px">-->
<!--<template slot-scope="scope">-->
<!--<template v-if="scope.row.edit">-->
<!--<el-date-picker v-model="scope.row.机床设计完成时间" value-format="yyyy-MM-dd" size="mini" type="date" style="width: 100%"/>-->
<!--</template>-->
<!--<template v-else>-->
<!--<el-button class="bold-font" type="text" @click="code = 1;openDialog(scope.row)">{{ scope.row.机床设计完成时间 !== '1900-01-01 00:00:00' ? scope.row.机床设计完成时间 : '-' }}</el-button>-->
<!--</template>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="发图(实际)" align="center" width="150px">-->
<!--<template slot-scope="scope">-->
<!--<div class="bold-font">{{ scope.row.机床设计实际完成时间 !== '1900-01-01' ? scope.row.机床设计实际完成时间 : '-' }}</div>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="采购(计划)" align="center" width="150px">-->
<!--<template slot-scope="scope">-->
<!--<template v-if="scope.row.edit">-->
<!--<el-date-picker v-model="scope.row.采购完成时间" value-format="yyyy-MM-dd" size="mini" type="date" style="width: 100%"/>-->
<!--</template>-->
<!--<template v-else>-->
<!--<el-button class="bold-font" type="text" @click="code = 2;openDialog(scope.row)">{{ scope.row.采购完成时间 !== '1900-01-01' ? scope.row.采购完成时间 : '-' }}</el-button>-->
<!--</template>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="采购(实际)" align="center" width="150px">-->
<!--<template slot-scope="scope">-->
<!--<div class="bold-font">{{ scope.row.采购实际完成时间 !== '1900-01-01' ? scope.row.采购实际完成时间 : '-' }}</div>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="备料(计划)" align="center" width="150px">-->
<!--<template slot-scope="scope">-->
<!--<template v-if="scope.row.edit">-->
<!--<el-date-picker v-model="scope.row.备料完成时间" value-format="yyyy-MM-dd" size="mini" type="date" style="width: 100%"/>-->
<!--</template>-->
<!--<template v-else>-->
<!--<el-button class="bold-font" type="text" @click="code = 3;openDialog(scope.row)">{{ scope.row.备料完成时间 !== '1900-01-01' ? scope.row.备料完成时间 : '-' }}</el-button>-->
<!--</template>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="备料(实际)" align="center" width="150px">-->
<!--<template slot-scope="scope">-->
<!--<div class="bold-font">{{ scope.row.备料实际完成时间 !== '1900-01-01' ? scope.row.备料实际完成时间 : '-' }}</div>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="制造(计划)" align="center" width="150px">-->
<!--<template slot-scope="scope">-->
<!--<template v-if="scope.row.edit">-->
<!--<el-date-picker v-model="scope.row.机床生产完成时间" value-format="yyyy-MM-dd" size="mini" type="date" style="width: 100%"/>-->
<!--</template>-->
<!--<template v-else>-->
<!--<el-button class="bold-font" type="text" @click="code = 4;openDialog(scope.row)">{{ scope.row.机床生产完成时间 !== '1900-01-01' ? scope.row.机床生产完成时间 : '-' }}</el-button>-->
<!--</template>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="制造(实际)" align="center" width="150px">-->
<!--<template slot-scope="scope">-->
<!--<div class="bold-font">{{ scope.row.机床生产实际完成时间 !== '1900-01-01' ? scope.row.机床生产实际完成时间 : '-' }}</div>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="装配(计划)" align="center" width="150px">-->
<!--<template slot-scope="scope">-->
<!--<template v-if="scope.row.edit">-->
<!--<el-date-picker v-model="scope.row.机床装配完成时间" value-format="yyyy-MM-dd" size="mini" type="date" style="width: 100%"/>-->
<!--</template>-->
<!--<template v-else>-->
<!--<el-button class="bold-font" type="text" @click="code = 5;openDialog(scope.row)">{{ scope.row.机床装配完成时间 !== '1900-01-01' ? scope.row.机床装配完成时间 : '-' }}</el-button>-->
<!--</template>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="装配(实际)" align="center" width="150px">-->
<!--<template slot-scope="scope">-->
<!--<div class="bold-font">{{ scope.row.机床装配实际完成时间 !== '1900-01-01' ? scope.row.机床装配实际完成时间 : '-' }}</div>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="更新" align="center" width="90px">-->
<!--<template slot-scope="scope">-->
<!--<template v-if="scope.row.edit">-->
<!--<el-input v-model="scope.row.更新" size="mini"/>-->
<!--</template>-->
<!--<template v-else>-->
<!--{{ scope.row.更新 }}-->
<!--</template>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column v-if="false" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="success" size="small" @click="confirmEdit(scope.row)">确定</el-button>
@@ -234,60 +110,106 @@
<el-col style="width: 200px;">
<el-form label-position="left" label-width="90px" class="demo-ruleForm1">
<el-row>
<el-col style="width: 20px">
<!--<el-radio v-model="radio" label="1">{{ empty }}</el-radio>-->
</el-col>
<el-col style="width: 180px;margin-left: 20px">
<el-form-item label="设计者" prop="设计者" >
<el-input v-model="设计者" placeholder="设计者" clearable size="small" style="width: 150px"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col style="width: 20px">
<!--<el-radio v-model="radio" label="2">{{ empty }}</el-radio>-->
</el-col>
<el-col style="width: 180px;margin-left: 20px">
<el-form-item label="审图开始" prop="审图开始">
<el-date-picker v-model="审图开始" size="small" value-format="yyyy-MM-dd" type="date" style="width: 150px" placeholder="审图开始" class="time"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col style="width: 20px">
<!--<el-radio v-model="radio" label="3">{{ empty }}</el-radio>-->
</el-col>
<el-col style="width: 180px;margin-left: 20px">
<el-form-item label="审图结束" prop="审图结束">
<el-date-picker v-model="审图结束" size="small" value-format="yyyy-MM-dd" type="date" style="width: 150px" placeholder="审图结束" class="time"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col style="width: 20px">
<el-radio v-model="radio" label="1">{{ empty }}</el-radio>
</el-col>
<el-col style="width: 180px">
<el-form-item label="发图完成" prop="发图完成">
<el-date-picker v-model="发图完成" size="small" value-format="yyyy-MM-dd" type="date" style="width: 150px" placeholder="发图完成" class="time"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col style="width: 20px">
<el-radio v-model="radio" label="2">{{ empty }}</el-radio>
</el-col>
<el-col style="width: 180px">
<el-form-item label="采购完成" prop="采购完成">
<el-date-picker v-model="采购完成" size="small" value-format="yyyy-MM-dd" type="date" style="width: 150px" placeholder="采购完成" class="time"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col style="width: 20px">
<el-radio v-model="radio" label="3">{{ empty }}</el-radio>
</el-col>
<el-col style="width: 180px">
<el-form-item label="备料完成" prop="备料完成">
<el-date-picker v-model="备料完成" size="small" value-format="yyyy-MM-dd" type="date" style="width: 150px" placeholder="备料完成" class="time"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col style="width: 20px">
<el-radio v-model="radio" label="4">{{ empty }}</el-radio>
</el-col>
<el-col style="width: 180px">
<el-form-item label="制造完成" prop="制造完成">
<el-date-picker v-model="制造完成" size="small" value-format="yyyy-MM-dd" type="date" style="width: 150px" placeholder="制造完成" class="time"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col style="width: 20px">
<el-radio v-model="radio" label="5">{{ empty }}</el-radio>
</el-col>
<el-col style="width: 180px">
<el-form-item label="装配完成" prop="装配完成">
<el-date-picker v-model="装配完成" size="small" value-format="yyyy-MM-dd" type="date" style="width: 150px" placeholder="装配完成" class="time"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col style="width: 20px">
<!--<el-radio v-model="radio" label="9">{{ empty }}</el-radio>-->
</el-col>
<el-col style="width: 180px;margin-left: 20px">
<el-form-item label="更新时间" prop="更新时间">
<el-date-picker v-model="更新时间" size="small" value-format="yyyy-MM-dd" type="date" style="width: 150px" placeholder="更新时间" class="time"/>
<el-input v-model="更新时间" placeholder="更新时间" clearable size="small" style="width: 150px"/>
<!--<el-date-picker v-model="更新时间" size="small" value-format="yyyy-MM-dd" type="date" style="width: 150px" placeholder="更新时间" class="time"/>-->
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-col>
</el-card>
<el-card>
<h2 v-if="code===1" style="width: 400px;float:left;display: inline-block;margin: 0 0 10px 0">子计划{{ machineNum }} 发图</h2>
<h2 v-if="code===2" style="width: 400px;float:left;display: inline-block;margin: 0 0 10px 0">子计划{{ machineNum }} 采购</h2>
<h2 v-if="code===3" style="width: 400px;float:left;display: inline-block;margin: 0 0 10px 0">子计划{{ machineNum }} 备料</h2>
<h2 v-if="code===4" style="width: 400px;float:left;display: inline-block;margin: 0 0 10px 0">子计划{{ machineNum }} 制造</h2>
<h2 v-if="code===5" style="width: 400px;float:left;display: inline-block;margin: 0 0 10px 0">子计划{{ machineNum }} 装配</h2>
<h2 v-if="radio==='1'" style="width: 400px;float:left;display: inline-block;margin: 0 0 10px 0">子计划{{ machineNum }} 发图</h2>
<h2 v-if="radio==='2'" style="width: 400px;float:left;display: inline-block;margin: 0 0 10px 0">子计划{{ machineNum }} 采购</h2>
<h2 v-if="radio==='3'" style="width: 400px;float:left;display: inline-block;margin: 0 0 10px 0">子计划{{ machineNum }} 备料</h2>
<h2 v-if="radio==='4'" style="width: 400px;float:left;display: inline-block;margin: 0 0 10px 0">子计划{{ machineNum }} 制造</h2>
<h2 v-if="radio==='5'" style="width: 400px;float:left;display: inline-block;margin: 0 0 10px 0">子计划{{ machineNum }} 装配</h2>
<el-button size="small" icon="el-icon-circle-plus" type="warning" style="float:left;margin: 7px 0 0 0" plain @click="addTable()">增加</el-button>
<el-table v-loading="loading2" :data="tableData2" style="margin-top: 10px;width: 100%;" stripe border element-loading-text="拼命加载中">
<el-table-column min-width="100px" label="组号" align="center">
@@ -400,10 +322,15 @@
</template>
<script>
import { getProject, getCustomerName, getToolNum, searchtable, editTable, searchTable2, editTable2, Delete, addTable, searchgroup, searchgroupName } from '@/api/ManufacturingCenter/ProjectPlanningManagement'
import { getProject, getCustomerName, searchgroupName, getToolNum, searchtable, editTable, searchTable2, searchgroup, addTable, editTable2, Delete } from '@/api/ManufacturingCenter/ProjectPlanningManagement'
export default {
data() {
return {
empty: '',
radio: '',
项目流水号: '',
机床流水号: '',
项目编号: '',
设计者: '',
审图开始: '',
审图结束: '',
@@ -437,6 +364,15 @@ export default {
pageCurrent: 1 // 后台获取页
}
},
watch: {
radio(val) {
if (this.项目流水号) {
this.openDialog()
} else {
this.radio = ''
}
}
},
created() {
this.fetchData()
this.getCustomerName()
@@ -491,6 +427,19 @@ export default {
this.loading = true
this.tableData = []
this.tableData2 = []
this.radio = ''
this.项目流水号 = ''
this.机床流水号 = ''
this.项目编号 = ''
this.设计者 = ''
this.审图开始 = ''
this.审图结束 = ''
this.发图完成 = ''
this.采购完成 = ''
this.备料完成 = ''
this.制造完成 = ''
this.装配完成 = ''
this.更新时间 = ''
this.jichuang = ''
this.code = ''
if (this.projectValue !== '' && this.projectValue !== null) { this.projectValuecheck = 1 } else { this.projectValuecheck = 0 }
@@ -499,7 +448,6 @@ export default {
if (this.time_SignStart !== '' && this.time_SignStart !== null && this.time_SignFinish !== '' && this.time_SignFinish) { this.time_Signcheck = 1 } else { this.time_Signcheck = 0 }
if (this.time_deliveryStart !== '' && this.time_deliveryStart !== null && this.time_deliveryFinish !== '' && this.time_deliveryFinish) { this.time_deliverycheck = 1 } else { this.time_deliverycheck = 0 }
searchtable(this.projectValuecheck, this.projectValue, this.toolNumValuecheck, this.toolNumValue, this.CustomerNameValuecheck, this.CustomerNameValue, this.time_Signcheck, this.time_SignStart, this.time_SignFinish, this.time_deliverycheck, this.time_deliveryStart, this.time_deliveryFinish, this.pageCurrent, this.pageSize).then(response => {
console.log(response.data)
if (response.data.total === 0) {
this.loading = false
} else {
@@ -542,40 +490,64 @@ export default {
this.loading = false
})
},
// 表格1保存
confirmEdit(row) {
editTable(row.项目流水号, row.机床流水号, row.项目编号, row.机床设计者, row.审图计划开始时间, row.审图计划完成时间, row.审图实际完成时间, row.机床设计完成时间, row.采购完成时间, row.备料完成时间, row.机床生产完成时间, row.机床装配完成时间, row.完成顺序, row.更新).then(response => {
if (response.data[0].result === '1') {
row.edit = false
this.$notify({
title: '成功',
message: '信息修改成功',
type: 'success'
rowClick(row) {
searchtable(1, row.项目流水号, 1, row.机床流水号, 0, 0, 0, '', '', 0, '', '', 1, 100).then(response => {
if (response.data.total !== 0) {
this.machineNum = row.机床图号
this.项目流水号 = row.项目流水号
this.机床流水号 = row.机床流水号
this.项目编号 = row.项目编号
this.设计者 = response.data.rows[0].机床设计者
this.审图开始 = response.data.rows[0].审图计划开始时间
this.审图结束 = response.data.rows[0].审图计划完成时间
this.发图完成 = response.data.rows[0].机床设计完成时间
this.采购完成 = response.data.rows[0].采购完成时间
this.备料完成 = response.data.rows[0].备料完成时间
this.制造完成 = response.data.rows[0].机床生产完成时间
this.装配完成 = response.data.rows[0].机床装配完成时间
this.更新时间 = response.data.rows[0].更新
}
})
this.searchTable()
},
// 表格1保存
editPro() {
if (this.项目流水号) {
this.审图开始 ? this.审图开始 : this.审图开始 = null
this.审图结束 ? this.审图结束 : this.审图结束 = null
this.发图完成 ? this.发图完成 : this.发图完成 = null
this.采购完成 ? this.采购完成 : this.采购完成 = null
this.备料完成 ? this.备料完成 : this.备料完成 = null
this.制造完成 ? this.制造完成 : this.制造完成 = null
this.装配完成 ? this.装配完成 : this.装配完成 = null
editTable(this.项目流水号, this.机床流水号, this.项目编号, this.设计者, this.审图开始, this.审图结束, '', this.发图完成, this.采购完成, this.备料完成, this.制造完成, this.装配完成, '', this.更新时间).then(response => {
if (response.data[0].result === '1') {
console.log(response.data)
this.$message.success('保存成功')
} else {
this.$message.error('信息修改失败')
}
})
} else {
this.$message.error('请先选择项目')
}
},
// 查询表格2数据
openDialog(row) {
this.machineNum = row.机床图号
openDialog() {
this.loading2 = true
this.tableData2 = []
if (this.code === 1) {
if (this.radio === '1') {
this.title = '发图'
} else if (this.code === 2) {
} else if (this.radio === '2') {
this.title = '采购'
} else if (this.code === 3) {
} else if (this.radio === '3') {
this.title = '备料'
} else if (this.code === 4) {
} else if (this.radio === '4') {
this.title = '制造'
} else if (this.code === 5) {
} else if (this.radio === '5') {
this.title = '装配'
}
this.groupNum = []
searchgroup(row.机床流水号).then(response => {
searchgroup(this.机床流水号).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNum.push({
label: response.data[i].组号,
@@ -583,8 +555,7 @@ export default {
})
}
})
searchTable2(row.机床流水号, this.code).then(response => {
this.jichuang = row.机床流水号
searchTable2(this.机床流水号, this.radio).then(response => {
if (response.data.length === 0) {
this.loading2 = false
} else {
@@ -625,21 +596,28 @@ export default {
this.loading2 = false
})
},
// 表格2增加
addTable() {
if (this.radio === '') {
this.$message.error('请先选择一个类别')
} else {
addTable(this.机床流水号, this.radio).then(response => {
if (response.data[0].result === '1') {
this.$message({
type: 'success',
message: '添加成功!'
})
this.searchTable2()
} else {
this.$message.error('添加失败')
}
})
}
},
searchTable2() {
this.loading2 = true
this.tableData2 = []
if (this.code === 1) {
this.title = '发图'
} else if (this.code === 2) {
this.title = '采购'
} else if (this.code === 3) {
this.title = '备料'
} else if (this.code === 4) {
this.title = '制造'
} else if (this.code === 5) {
this.title = '装配'
}
searchTable2(this.jichuang, this.code).then(response => {
searchTable2(this.机床流水号, this.radio).then(response => {
if (response.data.length === 0) {
this.loading2 = false
} else {
@@ -723,24 +701,6 @@ export default {
})
})
},
// 表格2增加
addTable() {
if (this.jichuang === '') {
this.$message.error('请先选择一个类别')
} else {
addTable(this.jichuang, this.code).then(response => {
if (response.data[0].result === '1') {
this.$message({
type: 'success',
message: '添加成功!'
})
this.searchTable2()
} else {
this.$message.error('添加失败')
}
})
}
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
@@ -764,6 +724,9 @@ export default {
}
</style>
<style>
.el-radio {
margin-top: 12px !important;
}
.demo-ruleForm1 .el-form-item {
margin-bottom: 0px
}