车间工艺管理和物料维护bug

This commit is contained in:
zhangdingyu
2018-11-24 17:09:43 +08:00
parent d1b162fa8e
commit 55601386f9
2 changed files with 25 additions and 29 deletions

View File

@@ -14,11 +14,6 @@
height="580"
highlight-current-row
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="材料名称">
<template slot-scope="scope">
{{ scope.row.材料 }}
@@ -58,7 +53,7 @@
<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-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>
<div slot="footer" class="dialog-footer">
@@ -68,14 +63,14 @@
</el-dialog>
<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-item label="材料名称" prop="MaterialName" style="display: inline-block">
<el-input v-model="form.MaterialName" size="small" style="width:200px"/>
<el-form ref="form2" :model="form2" :rules="rules" label-position="left" label-width="110px">
<el-form-item label="材料名称" prop="MaterialName2" style="display: inline-block">
<el-input v-model="form2.MaterialName2" size="small" clearable style="width:200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<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>
</el-dialog>
</div>
@@ -98,8 +93,12 @@ export default {
form: {
MaterialName: ''
},
form2: {
MaterialName2: ''
},
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) {
this.$refs['form'].resetFields()
}
this.form.MaterialName = ''
this.dialogFormVisible = true
},
addMaterial(formName) {
this.dialogFormVisible = false
this.$refs[formName].validate((valid) => {
if (valid) {
addMaterial(this.form.MaterialName).then(response => {
if (response.data[0].result === '1') {
this.featchMaterial()
this.$message.success('添加成功')
this.dialogFormVisible = false
this.form = {}
this.featchMaterial()
} else {
this.$message.error('添加失败')
this.form = {}
@@ -150,7 +150,6 @@ export default {
})
},
delMaterial(row) {
console.log(row)
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@@ -168,18 +167,18 @@ export default {
})
},
Edit(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.dialogFormVisible2 = true
this.form.MaterialName = row.材料
this.form2.MaterialName2 = row.材料
this.ID = row.材料流水号
},
editMaterial(formName) {
this.$refs[formName].validate((valid) => {
editMaterial(form2) {
this.$refs[form2].validate((valid) => {
if (valid) {
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') {
this.featchMaterial()
this.$message.success('编辑成功')
@@ -197,10 +196,4 @@ export default {
</script>
<style scoped>
.el-card{
margin-bottom:15px;
}
.el-date-editor{
width:200px;
}
</style>

View File

@@ -385,9 +385,12 @@ export default {
this.tableData2 = response.data
})
},
searchTechnologicalRequirementsOfProcessNum(row) {
this.expands = []
this.expands.push(row.工艺编号)
searchTechnologicalRequirementsOfProcessNum(row, expandedRows) {
// this.expands = []
// this.expands.push(row.工艺编号)
if (expandedRows.length > 1) {
expandedRows.shift()
}
this.loading3 = true
searchTechnologicalRequirementsOfProcessNum(row.工艺编号).then(response => {
this.loading3 = false