车间工艺管理和物料维护bug
This commit is contained in:
@@ -14,11 +14,6 @@
|
|||||||
height="580"
|
height="580"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
border>
|
border>
|
||||||
<el-table-column align="center" label="材料编号" width="110">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.材料流水号 }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="材料名称">
|
<el-table-column align="center" label="材料名称">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.材料 }}
|
{{ scope.row.材料 }}
|
||||||
@@ -58,7 +53,7 @@
|
|||||||
<el-dialog :visible.sync="dialogFormVisible" title="新增材料" center style="min-height: 200px" width="400px">
|
<el-dialog :visible.sync="dialogFormVisible" title="新增材料" center style="min-height: 200px" width="400px">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px">
|
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px">
|
||||||
<el-form-item label="材料名称" prop="MaterialName" style="display: inline-block">
|
<el-form-item label="材料名称" prop="MaterialName" style="display: inline-block">
|
||||||
<el-input v-model="form.MaterialName" size="small" style="width:200px"/>
|
<el-input v-model="form.MaterialName" clearable size="small" style="width:200px"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@@ -68,14 +63,14 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog :visible.sync="dialogFormVisible2" title="编辑材料" center style="min-height: 200px" width="400px">
|
<el-dialog :visible.sync="dialogFormVisible2" title="编辑材料" center style="min-height: 200px" width="400px">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px">
|
<el-form ref="form2" :model="form2" :rules="rules" label-position="left" label-width="110px">
|
||||||
<el-form-item label="材料名称" prop="MaterialName" style="display: inline-block">
|
<el-form-item label="材料名称" prop="MaterialName2" style="display: inline-block">
|
||||||
<el-input v-model="form.MaterialName" size="small" style="width:200px"/>
|
<el-input v-model="form2.MaterialName2" size="small" clearable style="width:200px"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button size="small" @click="callOff()">取消</el-button>
|
<el-button size="small" @click="callOff()">取消</el-button>
|
||||||
<el-button type="primary" size="small" @click="editMaterial('form')">确定</el-button>
|
<el-button type="primary" size="small" @click="editMaterial('form2')">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
@@ -98,8 +93,12 @@ export default {
|
|||||||
form: {
|
form: {
|
||||||
MaterialName: ''
|
MaterialName: ''
|
||||||
},
|
},
|
||||||
|
form2: {
|
||||||
|
MaterialName2: ''
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
MaterialName: [{ required: true, message: '请输入材料名称', trigger: 'blur' }]
|
MaterialName: [{ required: true, message: '请输入材料名称', trigger: 'blur' }],
|
||||||
|
MaterialName2: [{ required: true, message: '请输入材料名称', trigger: 'blur' }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -130,17 +129,18 @@ export default {
|
|||||||
if (this.$refs['form'] !== undefined) {
|
if (this.$refs['form'] !== undefined) {
|
||||||
this.$refs['form'].resetFields()
|
this.$refs['form'].resetFields()
|
||||||
}
|
}
|
||||||
|
this.form.MaterialName = ''
|
||||||
this.dialogFormVisible = true
|
this.dialogFormVisible = true
|
||||||
},
|
},
|
||||||
addMaterial(formName) {
|
addMaterial(formName) {
|
||||||
this.dialogFormVisible = false
|
|
||||||
this.$refs[formName].validate((valid) => {
|
this.$refs[formName].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
addMaterial(this.form.MaterialName).then(response => {
|
addMaterial(this.form.MaterialName).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
if (response.data[0].result === '1') {
|
||||||
this.featchMaterial()
|
|
||||||
this.$message.success('添加成功')
|
this.$message.success('添加成功')
|
||||||
|
this.dialogFormVisible = false
|
||||||
this.form = {}
|
this.form = {}
|
||||||
|
this.featchMaterial()
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('添加失败')
|
this.$message.error('添加失败')
|
||||||
this.form = {}
|
this.form = {}
|
||||||
@@ -150,7 +150,6 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
delMaterial(row) {
|
delMaterial(row) {
|
||||||
console.log(row)
|
|
||||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@@ -168,18 +167,18 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
Edit(row) {
|
Edit(row) {
|
||||||
if (this.$refs['form'] !== undefined) {
|
if (this.$refs['form2'] !== undefined) {
|
||||||
this.$refs['form'].resetFields()
|
this.$refs['form2'].resetFields()
|
||||||
}
|
}
|
||||||
this.dialogFormVisible2 = true
|
this.dialogFormVisible2 = true
|
||||||
this.form.MaterialName = row.材料
|
this.form2.MaterialName2 = row.材料
|
||||||
this.ID = row.材料流水号
|
this.ID = row.材料流水号
|
||||||
},
|
},
|
||||||
editMaterial(formName) {
|
editMaterial(form2) {
|
||||||
this.$refs[formName].validate((valid) => {
|
this.$refs[form2].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.dialogFormVisible2 = false
|
this.dialogFormVisible2 = false
|
||||||
editMaterial(this.ID, this.form.MaterialName).then(response => {
|
editMaterial(this.ID, this.form2.MaterialName2).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
if (response.data[0].result === '1') {
|
||||||
this.featchMaterial()
|
this.featchMaterial()
|
||||||
this.$message.success('编辑成功')
|
this.$message.success('编辑成功')
|
||||||
@@ -197,10 +196,4 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-card{
|
|
||||||
margin-bottom:15px;
|
|
||||||
}
|
|
||||||
.el-date-editor{
|
|
||||||
width:200px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -385,9 +385,12 @@ export default {
|
|||||||
this.tableData2 = response.data
|
this.tableData2 = response.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchTechnologicalRequirementsOfProcessNum(row) {
|
searchTechnologicalRequirementsOfProcessNum(row, expandedRows) {
|
||||||
this.expands = []
|
// this.expands = []
|
||||||
this.expands.push(row.工艺编号)
|
// this.expands.push(row.工艺编号)
|
||||||
|
if (expandedRows.length > 1) {
|
||||||
|
expandedRows.shift()
|
||||||
|
}
|
||||||
this.loading3 = true
|
this.loading3 = true
|
||||||
searchTechnologicalRequirementsOfProcessNum(row.工艺编号).then(response => {
|
searchTechnologicalRequirementsOfProcessNum(row.工艺编号).then(response => {
|
||||||
this.loading3 = false
|
this.loading3 = false
|
||||||
|
|||||||
Reference in New Issue
Block a user