This commit is contained in:
liushuai
2019-10-31 08:11:24 +08:00
parent d3ce0baf0b
commit ca02868500
15 changed files with 563 additions and 435 deletions

View File

@@ -215,17 +215,17 @@
</el-table-column>
<el-table-column align="center" label="制单时间" min-width="85">
<template slot-scope="scope">
{{ scope.row.操作日期 }}
{{ scope.row.操作日期 ? scope.row.操作日期.split(' ')[0] : '-' }}
</template>
</el-table-column>
<el-table-column align="center" label="审核时间" min-width="85">
<template slot-scope="scope">
{{ scope.row.审核日期 }}
{{ scope.row.审核日期 ? scope.row.审核日期.split(' ')[0] : '-' }}
</template>
</el-table-column>
<el-table-column align="center" label="发货时间" min-width="85">
<template slot-scope="scope">
{{ scope.row.发出时间 }}
{{ scope.row.发出时间 ? scope.row.发出时间.split(' ')[0] : '-' }}
</template>
</el-table-column>
</el-table>

View File

@@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<el-row style="margin-top: 10px; margin-bottom: 10px">
<span>机床编号:</span>
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="searchTable1();machineChange()">
<el-option
@@ -13,6 +13,8 @@
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<el-button size="small" icon="el-icon-circle-plus" type="primary" style="margin-left: 25%" @click="addTable()">增加装配计划</el-button>
<el-button type="danger" plain size="small" style="float: right;margin-right: 20px" @click="deleteData()">删除</el-button>
</el-row>
</el-card>
<el-card>
@@ -31,9 +33,8 @@
</div>
</div>
</el-card>
<el-card>
<h3 style="text-align: center;">机床信息</h3>
<el-table :data="tableData1" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="200px">
<el-card style="width: 40%; float: left">
<el-table :data="tableData1" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="720px" @row-click="searchTable2">
<el-table-column label="项目名称" align="center">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
@@ -56,9 +57,8 @@
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-button size="small" icon="el-icon-circle-plus" type="primary" style="float:left;margin: 7px 0 0 0" @click="addTable()">增加装配计划</el-button>
<el-table :data="tableData2" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="380px">
<el-card style="width: 59.5%; float: left">
<el-table :data="tableData2" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="720px" @row-dblclick="changeState" @row-click="deleteData1">
<el-table-column label="组号" align="center">
<template slot-scope="scope">
<template v-if="scope.row.edit">
@@ -100,7 +100,6 @@
<el-button v-if="scope.row.edit" type="success" plain size="small" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-else type="primary" size="small" plain @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="scope.row.edit" type="warning" plain size="small" @click="cancel(scope.row)">取消</el-button>
<el-button type="danger" plain size="small" @click="deleteData(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -120,10 +119,12 @@ export default {
groupNum: [],
tableData1: [],
tableData2: [],
hadFile: []
hadFile: [],
plan: ''
}
},
created() {
this.searchTable1()
},
mounted() {
this.initProject()
@@ -155,6 +156,9 @@ export default {
})
}
},
changeState(row) {
row.edit = !row.edit
},
initProject() {
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
@@ -166,24 +170,23 @@ export default {
}
})
},
machineChange() {
this.groupNumberValue = ''
this.groupNum = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
this.getFileData(this.machineNumberValue)
},
confirmEdit(row) {
editData(row.计划流水号, row.组件流水号, this.groupNumberValue, row.任务名称, row.计划工时).then(response => {
if (response.data[0].result === '1') {
row.edit = false
this.searchTable2()
this.tableData2 = []
searchTable2(this.machineNumberValue, 1).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
计划流水号: response.data[i].计划流水号,
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
edit: false
})
}
})
this.$message.success('编辑成功')
} else {
this.$message.error('编辑失败')
@@ -192,45 +195,13 @@ export default {
},
cancel(row) {
row.edit = !row.edit
this.searchTable2()
},
deleteData(row) {
console.log(row.计划流水号)
this.deleteRow(deletedata, row.计划流水号, function() { this.searchTable2() })
deleteData1(row) {
this.plan = row.计划流水号
},
addTable() {
if (this.machineNumberValue !== '') {
addData(this.machineNumberValue, 1).then(response => {
console.log(response)
if (response.data[0].result === '1') {
this.searchTable2()
this.$message.success('增加成功')
} else {
this.$message.error('增加失败')
}
})
} else {
this.$message.warning('请选择机床')
}
},
searchTable1() {
this.tableData1 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
if (this.check2 === 0) {
this.tableData1 = []
deleteData() {
this.deleteRow(deletedata, this.plan, function() {
this.tableData2 = []
} else {
searchTable1(this.machineNumberValue, this.check2).then(response => {
this.tableData1 = response.data
}).then(() => {
this.searchTable2()
})
}
},
searchTable2() {
this.tableData2 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) {
this.check2 = 1
searchTable2(this.machineNumberValue, 1).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
@@ -243,8 +214,69 @@ export default {
})
}
})
console.log(this.tableData2, 222222)
} else { this.check2 = 0 }
})
},
addTable() {
if (this.machineNumberValue !== '') {
addData(this.machineNumberValue, 1).then(response => {
console.log(response)
if (response.data[0].result === '1') {
this.tableData2 = []
searchTable2(this.machineNumberValue, 1).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
计划流水号: response.data[i].计划流水号,
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
edit: false
})
}
})
this.$message.success('增加成功')
} else {
this.$message.error('增加失败')
}
})
} else {
this.$message.warning('请选择机床')
}
},
searchTable1() {
this.tableData1 = []
this.tableData2 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
searchTable1(this.machineNumberValue, this.check2).then(response => {
this.tableData1 = response.data
})
},
searchTable2(row) {
this.tableData2 = []
this.machineNumberValue = row.机床流水号
searchTable2(this.machineNumberValue, 1).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
计划流水号: response.data[i].计划流水号,
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
edit: false
})
}
})
this.groupNumberValue = ''
this.groupNum = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
this.getFileData(this.machineNumberValue)
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<el-row style="margin-top: 10px; margin-bottom: 10px">
<span>机床编号:</span>
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="searchTable1();machineChange()">
<el-option
@@ -13,6 +13,8 @@
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<el-button size="small" icon="el-icon-circle-plus" type="primary" style="margin-left: 25%" @click="addTable()">增加装配计划</el-button>
<el-button type="danger" plain size="small" style="float: right;margin-right: 20px" @click="deleteData()">删除</el-button>
</el-row>
</el-card>
<el-card>
@@ -31,9 +33,8 @@
</div>
</div>
</el-card>
<el-card>
<h3 style="text-align: center;">机床信息</h3>
<el-table :data="tableData1" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="200px">
<el-card style="width: 40%; float: left">
<el-table :data="tableData1" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="720px" @row-click="searchTable2">
<el-table-column label="项目名称" align="center">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
@@ -56,9 +57,8 @@
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-button size="small" icon="el-icon-circle-plus" type="primary" style="float:left;margin: 7px 0 0 0" @click="addTable()">增加冷作计划</el-button>
<el-table :data="tableData2" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="380px">
<el-card style="width: 59.5%; float: left">
<el-table :data="tableData2" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="720px" @row-dblclick="changeState" @row-click="deleteData1">
<el-table-column label="组号" align="center">
<template slot-scope="scope">
<template v-if="scope.row.edit">
@@ -98,9 +98,8 @@
<el-table-column label="操作" align="center" width="250px" fixed="right">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="success" plain size="small" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-else type="warning" plain size="small" @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="scope.row.edit" type="primary" plain size="small" @click="cancel(scope.row)">取消</el-button>
<el-button type="danger" plain size="small" @click="deleteData(scope.row)">删除</el-button>
<el-button v-else type="primary" size="small" plain @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="scope.row.edit" type="warning" plain size="small" @click="cancel(scope.row)">取消</el-button>
</template>
</el-table-column>
</el-table>
@@ -120,10 +119,12 @@ export default {
groupNum: [],
tableData1: [],
tableData2: [],
hadFile: []
hadFile: [],
plan: ''
}
},
created() {
this.searchTable1()
},
mounted() {
this.initProject()
@@ -155,6 +156,9 @@ export default {
})
}
},
changeState(row) {
row.edit = !row.edit
},
initProject() {
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
@@ -166,24 +170,23 @@ export default {
}
})
},
machineChange() {
this.groupNumberValue = ''
this.groupNum = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
this.getFileData(this.machineNumberValue)
},
confirmEdit(row) {
editData(row.计划流水号, row.组件流水号, this.groupNumberValue, row.任务名称, row.计划工时).then(response => {
if (response.data[0].result === '1') {
row.edit = false
this.searchTable2()
this.tableData2 = []
searchTable2(this.machineNumberValue, 3).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
计划流水号: response.data[i].计划流水号,
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
edit: false
})
}
})
this.$message.success('编辑成功')
} else {
this.$message.error('编辑失败')
@@ -192,45 +195,13 @@ export default {
},
cancel(row) {
row.edit = !row.edit
this.searchTable2()
},
deleteData(row) {
console.log(row.计划流水号)
this.deleteRow(deletedata, row.计划流水号, function() { this.searchTable2() })
deleteData1(row) {
this.plan = row.计划流水号
},
addTable() {
if (this.machineNumberValue !== '') {
addData(this.machineNumberValue, 3).then(response => {
console.log(response)
if (response.data[0].result === '1') {
this.searchTable2()
this.$message.success('增加成功')
} else {
this.$message.error('增加失败')
}
})
} else {
this.$message.warning('请选择机床')
}
},
searchTable1() {
this.tableData1 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
if (this.check2 === 0) {
this.tableData1 = []
deleteData() {
this.deleteRow(deletedata, this.plan, function() {
this.tableData2 = []
} else {
searchTable1(this.machineNumberValue, this.check2).then(response => {
this.tableData1 = response.data
}).then(() => {
this.searchTable2()
})
}
},
searchTable2() {
this.tableData2 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) {
this.check2 = 1
searchTable2(this.machineNumberValue, 3).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
@@ -243,8 +214,69 @@ export default {
})
}
})
console.log(this.tableData2, 222222)
} else { this.check2 = 0 }
})
},
addTable() {
if (this.machineNumberValue !== '') {
addData(this.machineNumberValue, 3).then(response => {
console.log(response)
if (response.data[0].result === '1') {
this.tableData2 = []
searchTable2(this.machineNumberValue, 3).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
计划流水号: response.data[i].计划流水号,
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
edit: false
})
}
})
this.$message.success('增加成功')
} else {
this.$message.error('增加失败')
}
})
} else {
this.$message.warning('请选择机床')
}
},
searchTable1() {
this.tableData1 = []
this.tableData2 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
searchTable1(this.machineNumberValue, this.check2).then(response => {
this.tableData1 = response.data
})
},
searchTable2(row) {
this.tableData2 = []
this.machineNumberValue = row.机床流水号
searchTable2(this.machineNumberValue, 3).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
计划流水号: response.data[i].计划流水号,
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
edit: false
})
}
})
this.groupNumberValue = ''
this.groupNum = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
this.getFileData(this.machineNumberValue)
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<el-row style="margin-top: 10px; margin-bottom: 10px">
<span>机床编号:</span>
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="searchTable1();machineChange()">
<el-option
@@ -13,6 +13,8 @@
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<el-button size="small" icon="el-icon-circle-plus" type="primary" style="margin-left: 25%" @click="addTable()">增加装配计划</el-button>
<el-button type="danger" plain size="small" style="float: right;margin-right: 20px" @click="deleteData()">删除</el-button>
</el-row>
</el-card>
<el-card>
@@ -31,9 +33,8 @@
</div>
</div>
</el-card>
<el-card>
<h3 style="text-align: center;">机床信息</h3>
<el-table :data="tableData1" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="200px">
<el-card style="width: 40%; float: left">
<el-table :data="tableData1" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="720px" @row-click="searchTable2">
<el-table-column label="项目名称" align="center">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
@@ -56,9 +57,8 @@
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-button size="small" icon="el-icon-circle-plus" type="primary" style="float:left;margin: 7px 0 0 0" @click="addTable()">新增电气计划</el-button>
<el-table :data="tableData2" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="380px">
<el-card style="width: 59.5%; float: left">
<el-table :data="tableData2" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="720px" @row-dblclick="changeState" @row-click="deleteData1">
<el-table-column label="组号" align="center">
<template slot-scope="scope">
<template v-if="scope.row.edit">
@@ -98,9 +98,8 @@
<el-table-column label="操作" align="center" width="250px" fixed="right">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="success" plain size="small" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-else type="warning" size="small" plain @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="scope.row.edit" type="primary" plain size="small" @click="cancel(scope.row)">取消</el-button>
<el-button type="danger" plain size="small" @click="deleteData(scope.row)">删除</el-button>
<el-button v-else type="primary" size="small" plain @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="scope.row.edit" type="warning" plain size="small" @click="cancel(scope.row)">取消</el-button>
</template>
</el-table-column>
</el-table>
@@ -120,10 +119,12 @@ export default {
groupNum: [],
tableData1: [],
tableData2: [],
hadFile: []
hadFile: [],
plan: ''
}
},
created() {
this.searchTable1()
},
mounted() {
this.initProject()
@@ -155,6 +156,9 @@ export default {
})
}
},
changeState(row) {
row.edit = !row.edit
},
initProject() {
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
@@ -166,24 +170,23 @@ export default {
}
})
},
machineChange() {
this.groupNumberValue = ''
this.groupNum = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
this.getFileData(this.machineNumberValue)
},
confirmEdit(row) {
editData(row.计划流水号, row.组件流水号, this.groupNumberValue, row.任务名称, row.计划工时).then(response => {
if (response.data[0].result === '1') {
row.edit = false
this.searchTable2()
this.tableData2 = []
searchTable2(this.machineNumberValue, 2).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
计划流水号: response.data[i].计划流水号,
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
edit: false
})
}
})
this.$message.success('编辑成功')
} else {
this.$message.error('编辑失败')
@@ -192,45 +195,13 @@ export default {
},
cancel(row) {
row.edit = !row.edit
this.searchTable2()
},
deleteData(row) {
console.log(row.计划流水号)
this.deleteRow(deletedata, row.计划流水号, function() { this.searchTable2() })
deleteData1(row) {
this.plan = row.计划流水号
},
addTable() {
if (this.machineNumberValue !== '') {
addData(this.machineNumberValue, 2).then(response => {
console.log(response)
if (response.data[0].result === '1') {
this.searchTable2()
this.$message.success('增加成功')
} else {
this.$message.error('增加失败')
}
})
} else {
this.$message.warning('请选择机床')
}
},
searchTable1() {
this.tableData1 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
if (this.check2 === 0) {
this.tableData1 = []
deleteData() {
this.deleteRow(deletedata, this.plan, function() {
this.tableData2 = []
} else {
searchTable1(this.machineNumberValue, this.check2).then(response => {
this.tableData1 = response.data
}).then(() => {
this.searchTable2()
})
}
},
searchTable2() {
this.tableData2 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) {
this.check2 = 1
searchTable2(this.machineNumberValue, 2).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
@@ -243,8 +214,69 @@ export default {
})
}
})
console.log(this.tableData2, 222222)
} else { this.check2 = 0 }
})
},
addTable() {
if (this.machineNumberValue !== '') {
addData(this.machineNumberValue, 2).then(response => {
console.log(response)
if (response.data[0].result === '1') {
this.tableData2 = []
searchTable2(this.machineNumberValue, 2).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
计划流水号: response.data[i].计划流水号,
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
edit: false
})
}
})
this.$message.success('增加成功')
} else {
this.$message.error('增加失败')
}
})
} else {
this.$message.warning('请选择机床')
}
},
searchTable1() {
this.tableData1 = []
this.tableData2 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
searchTable1(this.machineNumberValue, this.check2).then(response => {
this.tableData1 = response.data
})
},
searchTable2(row) {
this.tableData2 = []
this.machineNumberValue = row.机床流水号
searchTable2(this.machineNumberValue, 2).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
计划流水号: response.data[i].计划流水号,
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
edit: false
})
}
})
this.groupNumberValue = ''
this.groupNum = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
this.getFileData(this.machineNumberValue)
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<el-row style="margin-top: 10px; margin-bottom: 10px">
<span>机床编号:</span>
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="searchTable1();machineChange()">
<el-option
@@ -13,6 +13,8 @@
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<el-button size="small" icon="el-icon-circle-plus" type="primary" style="margin-left: 25%" @click="addTable()">增加装配计划</el-button>
<el-button type="danger" plain size="small" style="float: right;margin-right: 20px" @click="deleteData()">删除</el-button>
</el-row>
</el-card>
<el-card>
@@ -31,9 +33,8 @@
</div>
</div>
</el-card>
<el-card>
<h3 style="text-align: center;">机床信息</h3>
<el-table :data="tableData1" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="200px">
<el-card style="width: 40%; float: left">
<el-table :data="tableData1" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="720px" @row-click="searchTable2">
<el-table-column label="项目名称" align="center">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
@@ -56,9 +57,8 @@
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-button size="small" icon="el-icon-circle-plus" type="primary" style="float:left;margin: 7px 0 0 0" @click="addTable()">增加油漆计划</el-button>
<el-table :data="tableData2" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="380px">
<el-card style="width: 59.5%; float: left">
<el-table :data="tableData2" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="720px" @row-dblclick="changeState" @row-click="deleteData1">
<el-table-column label="组号" align="center">
<template slot-scope="scope">
<template v-if="scope.row.edit">
@@ -100,7 +100,6 @@
<el-button v-if="scope.row.edit" type="success" plain size="small" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-else type="primary" size="small" plain @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="scope.row.edit" type="warning" plain size="small" @click="cancel(scope.row)">取消</el-button>
<el-button type="danger" size="small" plain @click="deleteData(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -120,10 +119,12 @@ export default {
groupNum: [],
tableData1: [],
tableData2: [],
hadFile: []
hadFile: [],
plan: ''
}
},
created() {
this.searchTable1()
},
mounted() {
this.initProject()
@@ -155,6 +156,9 @@ export default {
})
}
},
changeState(row) {
row.edit = !row.edit
},
initProject() {
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
@@ -166,24 +170,23 @@ export default {
}
})
},
machineChange() {
this.groupNumberValue = ''
this.groupNum = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
this.getFileData(this.machineNumberValue)
},
confirmEdit(row) {
editData(row.计划流水号, row.组件流水号, this.groupNumberValue, row.任务名称, row.计划工时).then(response => {
if (response.data[0].result === '1') {
row.edit = false
this.searchTable2()
this.tableData2 = []
searchTable2(this.machineNumberValue, 4).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
计划流水号: response.data[i].计划流水号,
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
edit: false
})
}
})
this.$message.success('编辑成功')
} else {
this.$message.error('编辑失败')
@@ -192,45 +195,13 @@ export default {
},
cancel(row) {
row.edit = !row.edit
this.searchTable2()
},
deleteData(row) {
console.log(row.计划流水号)
this.deleteRow(deletedata, row.计划流水号, function() { this.searchTable2() })
deleteData1(row) {
this.plan = row.计划流水号
},
addTable() {
if (this.machineNumberValue !== '') {
addData(this.machineNumberValue, 4).then(response => {
console.log(response)
if (response.data[0].result === '1') {
this.searchTable2()
this.$message.success('增加成功')
} else {
this.$message.error('增加失败')
}
})
} else {
this.$message.warning('请选择机床')
}
},
searchTable1() {
this.tableData1 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
if (this.check2 === 0) {
this.tableData1 = []
deleteData() {
this.deleteRow(deletedata, this.plan, function() {
this.tableData2 = []
} else {
searchTable1(this.machineNumberValue, this.check2).then(response => {
this.tableData1 = response.data
}).then(() => {
this.searchTable2()
})
}
},
searchTable2() {
this.tableData2 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) {
this.check2 = 1
searchTable2(this.machineNumberValue, 4).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
@@ -243,8 +214,69 @@ export default {
})
}
})
console.log(this.tableData2, 222222)
} else { this.check2 = 0 }
})
},
addTable() {
if (this.machineNumberValue !== '') {
addData(this.machineNumberValue, 4).then(response => {
console.log(response)
if (response.data[0].result === '1') {
this.tableData2 = []
searchTable2(this.machineNumberValue, 4).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
计划流水号: response.data[i].计划流水号,
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
edit: false
})
}
})
this.$message.success('增加成功')
} else {
this.$message.error('增加失败')
}
})
} else {
this.$message.warning('请选择机床')
}
},
searchTable1() {
this.tableData1 = []
this.tableData2 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
searchTable1(this.machineNumberValue, this.check2).then(response => {
this.tableData1 = response.data
})
},
searchTable2(row) {
this.tableData2 = []
this.machineNumberValue = row.机床流水号
searchTable2(this.machineNumberValue, 4).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
计划流水号: response.data[i].计划流水号,
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
edit: false
})
}
})
this.groupNumberValue = ''
this.groupNum = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
this.getFileData(this.machineNumberValue)
}
}
}