This commit is contained in:
Vergil
2020-02-17 18:00:41 +08:00
parent f48bdb98a8
commit 8dd4cbf962

View File

@@ -19,8 +19,8 @@
:value="item.value"/>
</el-select>
<el-button type="primary" size="small" icon="el-icon-bangzhu" style="margin-left: 10px" plain @click="selectAll(tableData)">全选</el-button>
<el-button type="success" size="small" icon="el-icon-upload" style="margin-left: 10px" plain @click="save">保存</el-button>
<el-button type="success" size="small" icon="el-icon-upload" style="margin-left: 300px" plain @click="currency">通用件保存</el-button>
<el-button :loading="loading" type="success" size="small" icon="el-icon-upload" style="margin-left: 10px" plain @click="save">保存</el-button>
<el-button :loading="loading" type="success" size="small" icon="el-icon-upload" style="margin-left: 300px" plain @click="currency">通用件保存</el-button>
</el-card>
<el-card>
<el-table ref="multipleTable" :data="tableData" style="width: 1000px;" size="mini" height="750" highlight-current-row border @selection-change="handleSelectionChange" @row-click="rowClick">
@@ -79,6 +79,31 @@
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-dialog :visible.sync="dialogFormVisible" :title="title" center width="400px">
<el-table ref="multipleTable" :data="tableData2" size="mini" height="400" border>
<el-table-column align="center" label="序号" width="80">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column align="center" label="工艺名称">
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="单件" width="80">
<template slot-scope="scope">
{{ scope.row.单件定额工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="准结" width="80">
<template slot-scope="scope">
{{ scope.row.准结定额工时 }}
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
@@ -88,8 +113,6 @@ import { getGraphNum, getGroupNum, getTable, save, save2, initPerson, selectTech
export default {
data() {
return {
num1: '', // 工艺员中间变量
num2: '', // 工艺员流水号中间变量
loading: false,
loading0: false,
projectNameValue: '',
@@ -100,11 +123,10 @@ export default {
GroupNum: [],
tableData: [],
dialogFormVisible: false,
title: '',
tableData2: [],
dialogPerson: '',
index: '',
multipleSelection: [],
result: 0,
PageCurrent: 1,
PageSize: 50,
total: 0,
@@ -123,7 +145,6 @@ export default {
// 初始化工艺员
initPerson() {
initPerson().then(response => {
this.tableData2 = response.data
for (let i = 0; i < response.data.length; i++) {
this.Craftsmens.push({
label: response.data[i].姓名,
@@ -194,11 +215,12 @@ export default {
}
},
rowClick(row) {
this.tableData2 = []
selectTechnology(row.零件图号, row.规格).then(response => {
if (response.data[0].结果 === 1) {
console.log(1)
} else {
console.log(0)
this.title = response.data[0].机床图号
this.tableData2 = response.data
this.dialogFormVisible = true
}
})
},
@@ -219,6 +241,7 @@ export default {
} else { this.$message.error('请在第一行中填写工艺员姓名') }
},
save() {
this.loading = true
this.工艺计划流水号组 = []
this.通用件图号 = []
this.工艺员 = []
@@ -236,8 +259,10 @@ export default {
this.$message.success('保存成功')
this.PageCurrent = 1
this.getTable()
this.loading = false
})
} else {
this.loading = false
this.$message.error('请选择工艺员')
}
},
@@ -246,6 +271,7 @@ export default {
if (this.multipleSelection.length === 0) {
this.$message.error('请先选择零件')
} else {
this.loading = true
this.工艺计划流水号组 = []
this.通用件图号 = []
this.通用件规格 = []
@@ -261,20 +287,24 @@ export default {
this.工艺员.push(v.工艺员)
})
if (check === 1) {
console.log(this.工艺计划流水号组, this.通用件图号, this.通用件规格, this.工艺员)
save2(this.工艺计划流水号组, this.通用件图号, this.通用件规格, this.工艺员).then(response => {
if (response.data[0].结果 === 'success') {
this.$message.success('保存成功')
this.PageCurrent = 1
this.getTable()
this.loading = false
} else {
var messages = []
messages = response.data[0].结果.split('||||')
messages.shift()
this.$message.error(`图号${messages}无已完成工艺`)
this.loading = false
}
})
} else {
this.$message.error('请选择工艺员')
this.loading = false
}
}
},