This commit is contained in:
liushuai
2020-02-04 09:39:34 +08:00
parent 311e014375
commit 5f41045ae7
22 changed files with 521 additions and 161 deletions

View File

@@ -164,6 +164,15 @@
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
@click="handle(scope.row)">替换
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
@@ -339,7 +348,7 @@
<script>
import { sleep } from '../../../utils/tool'
import { unSpecificationQuery1, specificationQuery1, unSpecificationQueryWB1, specificationQueryWB1, deleteBasicParts, deleteBWParts, getMaterial, getMaterialWB, searchMaterialWB, updateRow, updateRowWB, transferMX1, update, searchOldParts, getMachineNames, transferWG1, allDelete, update1, searchMaterial1 } from '../../../api/TechnologyCenter/ImportParts'
import { unSpecificationQuery1, updateNum, specificationQuery1, unSpecificationQueryWB1, specificationQueryWB1, deleteBasicParts, deleteBWParts, getMaterial, getMaterialWB, searchMaterialWB, updateRow, updateRowWB, transferMX1, update, searchOldParts, getMachineNames, transferWG1, allDelete, update1, searchMaterial1 } from '../../../api/TechnologyCenter/ImportParts'
export default {
name: 'SpecificationData',
props: {
@@ -383,6 +392,7 @@ export default {
oldPartsValue: '',
Number: '',
Type: '',
NumId: '', // 物料流水号
PartsValue: [],
PartsValueNum: '',
type: 0, // 零件类型 暂定1为基本件2为外购件和标准件
@@ -547,6 +557,7 @@ export default {
},
searchMaterial1(row) {
console.log(row)
this.NumId = row.id
searchMaterial1(row.图号或者型号, row.名称, row.规格).then(response => {
this.tableData10 = response.data
console.log(response.data)
@@ -638,6 +649,28 @@ export default {
console.log(`编辑类型发生错误`)
}
},
handle(row) {
this.$confirm('是否替换?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateNum(row.物料流水号, this.NumId).then(response => {
if (response.data[0].result === '1') {
this.$message.success('替换成功')
this.tableData10 = []
this.fetchData()
} else {
this.$message.error('替换失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消替换'
})
})
},
cancel() {
this.dialogFormVisible = false
},