项目计划管理

This commit is contained in:
zhangdingyu
2019-03-28 18:08:55 +08:00
parent d821080f9a
commit 6989a2cc12
2 changed files with 503 additions and 96 deletions

View File

@@ -10,23 +10,24 @@ export function getProject() {
}
})
}
export function getToolNum(check, num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_机床名称_查询数据',
param: '项目流水号_check=' + check + '=int&项目流水号=' + num
}
})
}
export function getCustomerName() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_传递后_项目名称_查询数据_加工进度修改'
}
})
}
export function getToolNum() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_传递后_项目名称_查询数据_加工进度修改'
name: '客户关系管理系统_初始化查询_客户名称'
}
})
}
@@ -37,18 +38,63 @@ export function searchtable(num1, num2, num3, num4, num5, num6, num7, num8, num9
data: {
type: '1',
name: '项目计划管理_项目总计划_查询数据',
param: `项目流水号_check=` + num1 + '&项目流水号=' + num2 + '&机床流水号_check=' + num3 + '&@机床流水号=' + num4 + '&客户名称_check=' + num5 + '&客户名称=' + num6 + '&签订日期_check=' + num7 + '&签订日期开始时间=' + num8 + '&签订日期结束时间=' + num9 + '&交货期_check=' + num10 + '&交货期开始时间=' + num11 + '&交货期结束时间=' + num12,
param: `项目流水号_check=` + num1 + '&项目流水号=' + num2 + '&机床流水号_check=' + num3 + '&机床流水号=' + num4 + '&客户名称_check=' + num5 + '&客户名称=' + num6 + '&签订日期_check=' + num7 + '&签订日期开始时间=' + num8 + '&签订日期结束时间=' + num9 + '&交货期_check=' + num10 + '&交货期开始时间=' + num11 + '&交货期结束时间=' + num12,
Pagination: pageCurrent + '&' + pageSize
}
})
}
export function searchtable2() {
export function editTable(num1, num2, num3, num4, num5, num6, num7, num8, num9, num10, num11, num12) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '项目计划管理_项目总计划_编辑数据',
param: `项目流水号=` + num1 + '&机床流水号=' + num2 + '&项目编号=' + num3 + '&数量=' + num4 + '&设计者=' + num5 + '&机床设计完成时间=' + num6 + '&采购完成时间=' + num7 + '&备料完成时间=' + num8 + '&机床生产完成时间=' + num9 + '&机床装配完成时间=' + num10 + '&完成顺序=' + num11 + '&更新=' + num12
}
})
}
export function searchTable2(num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_传递后_项目名称_查询数据_加工进度修改'
name: '项目计划管理_项目详细计划_查询数据',
param: `机床流水号=` + num1 + '&计划类型=' + num2
}
})
}
export function editTable2(num1, num2, num3, num4, num5, num6, num7, num8, num9, num10) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '项目计划管理_项目详细计划_编辑数据',
param: `组件计划流水号=` + num1 + '&组号=' + num2 + '&任务名称=' + num3 + '&负责人=' + num4 + '&接收任务时间=' + num5 + '&任务开始时间=' + num6 + '&计划完成时间=' + num7 + '&货期=' + num8 + '&实际完成时间=' + num9 + '&备注=' + num10
}
})
}
export function Delete(num1) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '项目计划管理_项目详细计划_删除数据',
param: `组件计划流水号=` + num1
}
})
}
export function addTable(num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '项目计划管理_项目详细计划_增加数据',
param: `机床流水号=` + num1 + '&计划类型=' + num2
}
})
}

View File

@@ -19,123 +19,156 @@
:value="item.value"/>
</el-select>
<span>客户名称:</span>
<el-select v-model="CustomerNameValue" clearable filterable size="small" style="margin-bottom:10px;width: 220px" placeholder="客户名称">
<el-option
v-for="item in CustomerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="CustomerNameValue" placeholder="客户名称" size="small" clearable style="width:200px"/>
</el-row>
<el-row>
<span>签订日期:</span>
<el-date-picker v-model="time_SignStart" size="small" type="date" style="margin-top:10px;width: 180px" placeholder="签订日期" class="time"/>~
<el-date-picker v-model="time_SignFinish" size="small" type="date" style="margin-top:10px;width: 180px" placeholder="签订日期" class="time"/>
<el-date-picker v-model="time_SignStart" size="small" value-format="yyyy-MM-dd" type="date" style="margin-top:10px;width: 180px" placeholder="签订日期" class="time"/>~
<el-date-picker v-model="time_SignFinish" size="small" value-format="yyyy-MM-dd" type="date" style="margin-top:10px;width: 180px" placeholder="签订日期" class="time"/>
<span>交货期:</span>
<el-date-picker v-model="time_deliveryStart" size="small" type="date" style="margin-top:10px;width: 180px" placeholder="交货期" class="time"/>~
<el-date-picker v-model="time_deliveryFinish" size="small" type="date" style="margin-top:10px;width: 180px" placeholder="交货期" class="time"/>
<el-date-picker v-model="time_deliveryStart" size="small" value-format="yyyy-MM-dd" type="date" style="margin-top:10px;width: 180px" placeholder="交货期" class="time"/>~
<el-date-picker v-model="time_deliveryFinish" size="small" value-format="yyyy-MM-dd" type="date" style="margin-top:10px;width: 180px" placeholder="交货期" class="time"/>
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="pageSize=10; pageCurrent=1;searchTable()">查询</el-button>
</el-row>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中">
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table v-loading="loading" :data="tableData" height="580" size="mini" style="width: 100%;" border element-loading-text="拼命加载中">
<el-table-column min-width="300px" label="项目编号" align="center" width="240px">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.项目编号" class="edit-input" size="small"/>
<el-input v-model="scope.row.项目编号" size="mini"/>
</template>
<template v-else>
{{ scope.row.项目编号 }}
</template>
<span v-else>{{ scope.row.项目编号 }}</span>
</template>
</el-table-column>
<!--<el-table-column label="项目编号" align="center" width="220px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.项目编号 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="项目名称" align="center" width="240px">
<el-table-column label="项目名称" align="center" width="250px">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" width="100px">
<el-table-column label="机床图号" align="center" width="250px">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="机床名称" align="center" width="100px">
<el-table-column label="机床名称" align="center" width="250px">
<template slot-scope="scope">
{{ scope.row.机床名称 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row.数量 }}
<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 label="签订日期" align="center">
<el-table-column label="签订日期" align="center" width="250px">
<template slot-scope="scope">
{{ scope.row.合同签订日期 }}
</template>
</el-table-column>
<el-table-column label="交货期" align="center">
<el-table-column label="交货期" align="center" width="250px">
<template slot-scope="scope">
{{ scope.row.发货节点 }}
</template>
</el-table-column>
<el-table-column label="客户名称" align="center">
<el-table-column label="客户名称" align="center" width="250px">
<template slot-scope="scope">
{{ scope.row.客户名称 }}
</template>
</el-table-column>
<el-table-column label="设计者" align="center">
<el-table-column label="设计者" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row.机床设计者 }}
<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 label="发图" align="center">
<el-table-column label="发图" align="center" width="250px">
<template slot-scope="scope">
{{ scope.row.机床设计完成时间 }}
<template v-if="scope.row.edit">
<el-date-picker v-model="scope.row.机床设计完成时间" value-format="yyyy-MM-dd" size="mini" type="date"/>
</template>
<template v-else>
<el-button type="text" @click="code = 1;openDialog(scope.row)">{{ scope.row.机床设计完成时间 }}</el-button>
</template>
</template>
</el-table-column>
<el-table-column label="采购" align="center">
<el-table-column label="采购" align="center" width="250px">
<template slot-scope="scope">
{{ scope.row.采购完成时间 }}
<template v-if="scope.row.edit">
<el-date-picker v-model="scope.row.采购完成时间" value-format="yyyy-MM-dd" size="mini" type="date"/>
</template>
<template v-else>
<el-button type="text" @click="code = 2;openDialog(scope.row)">{{ scope.row.采购完成时间 }}</el-button>
</template>
</template>
</el-table-column>
<el-table-column label="备料" align="center">
<el-table-column label="备料" align="center" width="250px">
<template slot-scope="scope">
{{ scope.row.备料完成时间 }}
<template v-if="scope.row.edit">
<el-date-picker v-model="scope.row.备料完成时间" value-format="yyyy-MM-dd" size="mini" type="date"/>
</template>
<template v-else>
<el-button type="text" @click="code = 3;openDialog(scope.row)">{{ scope.row.备料完成时间 }}</el-button>
</template>
</template>
</el-table-column>
<el-table-column label="制造" align="center">
<el-table-column label="制造" align="center" width="250px">
<template slot-scope="scope">
{{ scope.row.机床生产完成时间 }}
<template v-if="scope.row.edit">
<el-date-picker v-model="scope.row.机床生产完成时间" value-format="yyyy-MM-dd" size="mini" type="date"/>
</template>
<template v-else>
<el-button type="text" @click="code = 4;openDialog(scope.row)">{{ scope.row.机床生产完成时间 }}</el-button>
</template>
</template>
</el-table-column>
<el-table-column label="装配" align="center">
<el-table-column label="装配" align="center" width="250px">
<template slot-scope="scope">
{{ scope.row.机床装配完成时间 }}
<template v-if="scope.row.edit">
<el-date-picker v-model="scope.row.机床装配完成时间" value-format="yyyy-MM-dd" size="mini" type="date"/>
</template>
<template v-else>
<el-button type="text" @click="code = 5;openDialog(scope.row)">{{ scope.row.机床装配完成时间 }}</el-button>
</template>
</template>
</el-table-column>
<el-table-column label="顺序" align="center">
<el-table-column label="顺序" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row.完成顺序 }}
<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 label="更新" align="center">
<el-table-column label="更新" align="center" width="200px">
<template slot-scope="scope">
{{ scope.row.更新 }}
<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 label="操作" width="300px" align="center" fixed="right">
<el-table-column label="操作" width="200px" align="center" fixed="right">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="success" size="small" icon="el-icon-circle-check-outline" @click="confirmEdit(scope.row)">保存</el-button>
<el-button v-else type="primary" size="small" icon="el-icon-edit" @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="scope.row.edit" type="success" size="small" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-else type="primary" size="small" @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="scope.row.edit" type="primary" size="small" @click="scope.row.edit=!scope.row.edit">取消</el-button>
</template>
</el-table-column>
</el-table>
@@ -151,15 +184,123 @@
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-card>
<span>{{ title }}</span>
<el-button size="small" icon="el-icon-circle-plus" type="primary" style="margin-left: 10px" @click="addTable()">增加</el-button>
<el-table v-loading="loading2" :data="tableData2" size="mini" style="margin-top: 10px;width: 100%;" border element-loading-text="拼命加载中">
<el-table-column min-width="300px" label="组号" align="center" width="240px">
<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 min-width="300px" label="任务名称" align="center" width="240px">
<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 min-width="300px" label="负责人" align="center" width="240px">
<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 label="接收任务时间" align="center" width="250px">
<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"/>
</template>
<template v-else>
{{ scope.row.接收任务时间 }}
</template>
</template>
</el-table-column>
<el-table-column label="任务开始时间" align="center" width="250px">
<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"/>
</template>
<template v-else>
{{ scope.row.任务开始时间 }}
</template>
</template>
</el-table-column>
<el-table-column label="计划完成时间" align="center" width="250px">
<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"/>
</template>
<template v-else>
{{ scope.row.计划完成时间 }}
</template>
</template>
</el-table-column>
<el-table-column min-width="300px" label="货期" align="center" width="240px">
<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 label="实际完成时间" align="center" width="250px">
<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"/>
</template>
<template v-else>
{{ scope.row.实际完成时间 }}
</template>
</template>
</el-table-column>
<el-table-column min-width="300px" label="备注" align="center" width="240px">
<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 label="操作" width="200px" align="center" fixed="right">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="success" size="small" @click="confirmEdit2(scope.row)">确定</el-button>
<el-button v-else type="primary" size="small" @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="scope.row.edit" type="primary" size="small" @click="scope.row.edit=!scope.row.edit">取消</el-button>
<el-button v-else type="danger" size="small" @click="Delete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { getProject, getCustomerName, getToolNum, searchtable } from '@/api/ManufacturingCenter/ProjectPlanningManagement'
import { getProject, getCustomerName, getToolNum, searchtable, editTable, searchTable2, editTable2, Delete, addTable } from '@/api/ManufacturingCenter/ProjectPlanningManagement'
export default {
data() {
return {
jichuang: '',
title: '',
tableData2: [],
loading2: false,
code: '',
time_SignStart: '', // 签订开始
time_SignFinish: '', // 签订结束
time_deliveryStart: '', // 交货开始
@@ -183,22 +324,6 @@ export default {
this.searchTable()
},
methods: {
cancelEdit(row) {
row.title = row.originalTitle
row.edit = false
this.$message({
message: 'The title has been restored to the original value',
type: 'warning'
})
},
confirmEdit(row) {
row.edit = false
row.originalTitle = row.title
this.$message({
message: 'The title has been edited',
type: 'success'
})
},
fetchData() {
this.projectValue = ''
this.project = []
@@ -211,6 +336,21 @@ export default {
}
})
},
typeChange() {
if (this.projectValue === '' || this.projectValue === null) {
this.toolNumValue = ''
this.toolNum = []
} else {
getToolNum(1, this.projectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.toolNum.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
}
},
getCustomerName() {
this.CustomerNameValue = ''
this.CustomerName = []
@@ -223,38 +363,257 @@ export default {
}
})
},
typeChange() {
this.toolNumValue = ''
this.toolNum = []
getToolNum().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.toolNum.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
},
// 查询表格数据
searchTable() {
this.loading = true
this.tableData = []
this.tableData2 = []
this.jichuang = ''
this.code = ''
if (this.projectValue !== '' && this.projectValue !== null) { this.projectValuecheck = 1 } else { this.projectValuecheck = 0 }
if (this.CustomerNameValue !== '' && this.CustomerNameValue !== null) { this.CustomerNameValuecheck = 1 } else { this.CustomerNameValuecheck = 0 }
if (this.toolNumValue !== '' && this.toolNumValue !== null) { this.toolNumValuecheck = 1 } else { this.toolNumValuecheck = 0 }
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.CustomerNameValuecheck, this.CustomerNameValue, this.toolNumValuecheck, this.toolNumValue, this.time_Signcheck, this.time_deliveryStart, this.time_deliveryFinish, this.time_deliverycheck, this.time_deliveryStart, this.time_deliveryFinish, this.pageCurrent, this.pageSize).then(response => {
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 => {
if (response.data.total === 0) {
this.loading = false
} else {
this.tableData = response.data.rows
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].合同签订日期 !== '' && response.data.rows[i].合同签订日期 !== null) {
response.data.rows[i].合同签订日期 = response.data.rows[i].合同签订日期.split(' ')[0]
}
if (response.data.rows[i].发货节点 !== '' && response.data.rows[i].发货节点 !== null) {
response.data.rows[i].发货节点 = response.data.rows[i].发货节点.split(' ')[0]
}
if (response.data.rows[i].机床设计完成时间 !== '' && response.data.rows[i].机床设计完成时间 !== null) {
response.data.rows[i].机床设计完成时间 = response.data.rows[i].机床设计完成时间.split(' ')[0]
}
if (response.data.rows[i].采购完成时间 !== '' && response.data.rows[i].采购完成时间 !== null) {
response.data.rows[i].采购完成时间 = response.data.rows[i].采购完成时间.split(' ')[0]
}
if (response.data.rows[i].备料完成时间 !== '' && response.data.rows[i].备料完成时间 !== null) {
response.data.rows[i].备料完成时间 = response.data.rows[i].备料完成时间.split(' ')[0]
}
if (response.data.rows[i].机床生产完成时间 !== '' && response.data.rows[i].机床生产完成时间 !== null) {
response.data.rows[i].机床生产完成时间 = response.data.rows[i].机床生产完成时间.split(' ')[0]
}
if (response.data.rows[i].机床装配完成时间 !== '' && response.data.rows[i].机床装配完成时间 !== null) {
response.data.rows[i].机床装配完成时间 = response.data.rows[i].机床装配完成时间.split(' ')[0]
}
this.tableData.push({
edit: false,
项目编号: response.data.rows[i].项目编号,
项目名称: response.data.rows[i].项目名称,
机床图号: response.data.rows[i].机床图号,
机床名称: response.data.rows[i].机床名称,
数量: response.data.rows[i].数量,
合同签订日期: response.data.rows[i].合同签订日期,
发货节点: response.data.rows[i].发货节点,
客户名称: response.data.rows[i].客户名称,
机床设计者: response.data.rows[i].机床设计者,
机床设计完成时间: response.data.rows[i].机床设计完成时间,
采购完成时间: response.data.rows[i].采购完成时间,
备料完成时间: response.data.rows[i].备料完成时间,
机床生产完成时间: response.data.rows[i].机床生产完成时间,
机床装配完成时间: response.data.rows[i].机床装配完成时间,
完成顺序: response.data.rows[i].完成顺序,
更新: response.data.rows[i].更新,
项目流水号: response.data.rows[i].项目流水号,
机床流水号: response.data.rows[i].机床流水号
})
}
this.total = response.data.total
}
}).then(() => {
this.loading = false
})
},
// 表格1保存
confirmEdit(row) {
editTable(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'
})
this.searchTable()
} else {
this.$message.error('信息修改失败')
}
})
},
// 查询表格2数据
openDialog(row) {
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(row.机床流水号, this.code).then(response => {
this.jichuang = row.机床流水号
if (response.data.length === 0) {
this.loading2 = false
} else {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].接收任务时间 !== '' && response.data[i].接收任务时间 !== null) {
response.data[i].接收任务时间 = response.data[i].接收任务时间.split(' ')[0]
}
if (response.data[i].任务开始时间 !== '' && response.data[i].任务开始时间 !== null) {
response.data[i].任务开始时间 = response.data[i].任务开始时间.split(' ')[0]
}
if (response.data[i].接收任务时间 !== '' && response.data[i].接收任务时间 !== null) {
response.data[i].接收任务时间 = response.data[i].接收任务时间.split(' ')[0]
}
if (response.data[i].计划完成时间 !== '' && response.data[i].计划完成时间 !== null) {
response.data[i].计划完成时间 = response.data[i].计划完成时间.split(' ')[0]
}
if (response.data[i].实际完成时间 !== '' && response.data[i].实际完成时间 !== null) {
response.data[i].实际完成时间 = response.data[i].实际完成时间.split(' ')[0]
}
this.tableData2.push({
edit: false,
组件计划流水号: response.data[i].组件计划流水号,
机床流水号: response.data[i].机床流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
负责人: response.data[i].负责人,
接收任务时间: response.data[i].接收任务时间,
任务开始时间: response.data[i].任务开始时间,
计划完成时间: response.data[i].计划完成时间,
实际完成时间: response.data[i].实际完成时间,
备注: response.data[i].备注
})
}
}
}).then(() => {
this.loading2 = false
})
},
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 => {
if (response.data.length === 0) {
this.loading2 = false
} else {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].接收任务时间 !== '' && response.data[i].接收任务时间 !== null) {
response.data[i].接收任务时间 = response.data[i].接收任务时间.split(' ')[0]
}
if (response.data[i].任务开始时间 !== '' && response.data[i].任务开始时间 !== null) {
response.data[i].任务开始时间 = response.data[i].任务开始时间.split(' ')[0]
}
if (response.data[i].接收任务时间 !== '' && response.data[i].接收任务时间 !== null) {
response.data[i].接收任务时间 = response.data[i].接收任务时间.split(' ')[0]
}
if (response.data[i].计划完成时间 !== '' && response.data[i].计划完成时间 !== null) {
response.data[i].计划完成时间 = response.data[i].计划完成时间.split(' ')[0]
}
if (response.data[i].实际完成时间 !== '' && response.data[i].实际完成时间 !== null) {
response.data[i].实际完成时间 = response.data[i].实际完成时间.split(' ')[0]
}
this.tableData2.push({
edit: false,
组件计划流水号: response.data[i].组件计划流水号,
机床流水号: response.data[i].机床流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
负责人: response.data[i].负责人,
接收任务时间: response.data[i].接收任务时间,
任务开始时间: response.data[i].任务开始时间,
计划完成时间: response.data[i].计划完成时间,
实际完成时间: response.data[i].实际完成时间,
备注: response.data[i].备注
})
}
}
}).then(() => {
this.loading2 = false
})
},
// 表格2保存
confirmEdit2(row) {
editTable2(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'
})
this.searchTable2()
} else {
this.$message.error('信息修改失败')
}
})
},
// 表格2删除
Delete(row) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
Delete(row.组件计划流水号).then(response => {
if (response.data[0].result === '1') {
row.edit = false
this.$notify({
title: '成功',
message: '信息修改成功',
type: 'success'
})
this.searchTable2()
} else {
this.$message.error('信息修改失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 表格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
@@ -270,5 +629,7 @@ export default {
</script>
<style scoped>
.el-card {
margin-bottom: 15px;
}
</style>