序间外协

This commit is contained in:
Vergil
2020-02-05 10:59:16 +08:00
parent bf69da3d5b
commit 55ce32d235

View File

@@ -20,13 +20,8 @@
:value="item.value"/>
</el-select>
<el-input v-model="partName" placeholder="零件图号" size="small" clearable style="width:150px"/>
<el-button size="small" icon="el-icon-search" type="success" style="" @click="pageSize1=50; pageCurrent1=1;searchTable()">查询</el-button>
<el-button size="small" icon="el-icon-search" type="primary" plain @click="pageSize1=50; pageCurrent1=1;searchTable()">查询</el-button>
<el-table v-loading="loading1" :data="tableData1" size="mini" highlight-current-row height="550px" style="width: 100%;" border element-loading-text="拼命加载中" @row-click="searchTable2">
<el-table-column
label="序号"
type="index"
align="center"
width="50"/>
<el-table-column label="零件图号" prop="零件图号" align="center" width="140px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
@@ -42,11 +37,6 @@
{{ scope.row.材料 }}
</template>
</el-table-column>
<!--<el-table-column label="种类" prop="零件类型名臣" align="center" width="80px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.零件类型名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="数量" align="center" width="60px">
<template slot-scope="scope">
{{ scope.row.批次数量 }}
@@ -68,7 +58,7 @@
</el-col>
<el-col :span="14">
<el-card>
<el-button size="small" type="primary" style="margin: 10px" @click="saveRowPrice()">保存</el-button>
<el-button size="small" type="success" plain style="margin: 10px" @click="saveRowPrice()">保存</el-button>
<el-table v-loading="loading2" :data="tableData2" :row-class-name="tableData1ClassName" height="580" style="width: 100%;" border element-loading-text="拼命加载中" size="small">
<el-table-column label="序号" type="index" align="center" width="50"/>
<el-table-column label="加工状态" width="100" align="center">
@@ -84,12 +74,6 @@
<el-checkbox :disabled="parseInt(scope.row.工序状态)!==3||parseInt(scope.row.工艺编号)===29" v-model="checkBox[scope.$index]" @change="edit(scope.$index, scope.row)"/>
</template>
</el-table-column>
<!--<el-table-column label="外协状态" width="100" align="center">-->
<!--<template slot-scope="scope">-->
<!--<span v-if="parseInt(scope.row.工序间是否外协)===2" type="success" size="small"></span>-->
<!--<span v-else size="small"></span>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="工艺名称" align="center">
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
@@ -125,6 +109,7 @@ export default {
count: 0, // 计数器 (表二是否有外协工序)
InOut: 1, // 工序间是否外协变量 1自家 2外协
index: 0, // 当前点击行(改变颜色不刷新用)
index2: 0, // 当前点击行(改变颜色不刷新用)
num1: '',
checkBox: [],
loading1: false,
@@ -217,6 +202,7 @@ export default {
this.loading2 = true
this.checkBox = []
this.tableData2 = []
this.index2 = row.index
searchTable2(row.工艺计划流水号).then(response => {
this.num1 = row.工艺计划流水号
if (response.data.length === 0) {
@@ -265,63 +251,14 @@ export default {
this.InOut = 2
edit(row.工序流水号, this.InOut).then(response => {
edit2(row.工序流水号, row.工艺计划流水号, 1).then(response => {
this.$message.success('工序外协状态更改成功')
this.tableData2[this.index].工序间是否外协 = 2
// this.loading2 = true
// this.checkBox = []
// this.tableData2 = []
// searchTable2(this.num1).then(response => {
// if (response.data.length === 0) {
// this.loading0 = false
// } else {
// for (let i = 0; i < response.data.length; i++) {
// if (response.data[i].工序间是否外协 === 1) {
// this.checkBox.push(false)
// } else {
// this.checkBox.push(true)
// }
// }
// for (let i = 0; i < response.data.length; i++) {
// response.data[i].机加工开始时间 = response.data[i].机加工开始时间.split(' ')[0]
// response.data[i].机加工结束时间 = response.data[i].机加工结束时间.split(' ')[0]
// response.data[i].计划日期 = response.data[i].计划日期.split(' ')[0]
// }
// this.tableData2 = response.data
// }
// }).then(() => {
// this.loading2 = false
// })
this.tableData1[this.index2].工序间是否外协 = 2
})
})
} else {
this.InOut = 1
edit(row.工序流水号, this.InOut).then(response => {
this.$message.success('工序外协状态更改成功')
this.tableData2[this.index].工序间是否外协 = 1
// this.loading2 = true
// this.checkBox = []
// this.tableData2 = []
// searchTable2(this.num1).then(response => {
// if (response.data.length === 0) {
// this.loading0 = false
// } else {
// for (let i = 0; i < response.data.length; i++) {
// if (response.data[i].工序间是否外协 === 1) {
// this.checkBox.push(false)
// } else {
// this.checkBox.push(true)
// }
// }
// for (let i = 0; i < response.data.length; i++) {
// response.data[i].机加工开始时间 = response.data[i].机加工开始时间.split(' ')[0]
// response.data[i].机加工结束时间 = response.data[i].机加工结束时间.split(' ')[0]
// response.data[i].计划日期 = response.data[i].计划日期.split(' ')[0]
// }
// this.tableData2 = response.data
// }
// }).then(() => {
// this.loading2 = false
// })
})
}
},