This commit is contained in:
liushuai
2018-11-27 14:39:00 +08:00
parent 0113ef27db
commit 03a1e50fa1

View File

@@ -122,10 +122,10 @@
</div>
</el-card>
<el-dialog :title="title" :visible.sync="dialogFormVisible4" center style="min-height: 300px" width="800px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-form-item label="零件状态" prop="零件状态" style="margin-left: 200px">
<el-select v-model="form.零件状态" placeholder="零件状态" size="small" clearable>
<el-dialog :title="title" :visible.sync="dialogFormVisible4" center style="min-height: 300px" width="400px">
<el-form label-position="left" label-width="110px" class="demo-ruleForm">
<el-form-item label="零件状态">
<el-select v-model="partStateValue1" placeholder="零件状态" size="small">
<el-option
v-for="item in partState"
:key="item.value"
@@ -135,8 +135,8 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel('form')">取消</el-button>
<el-button type="primary" @click="submitEdit('form')">确定</el-button>
<el-button @click="cancel()">取消</el-button>
<el-button type="primary" @click="submitEdit()">确定</el-button>
</div>
</el-dialog>
@@ -267,6 +267,7 @@ export default {
groupNum: null, // 组件流水号
partNumber: '', // 零件号
partStateValue: null, // 零件状态
partStateValue1: null,
partState: [], // 零件状态数组
partTypeValue: null, // 零件类型
num: null,
@@ -300,15 +301,7 @@ export default {
}, {
value: 2,
label: '外协生产'
}],
form: {
零件状态: null
},
rules: {
零件状态: [
{ required: true, message: '请选择零件状态', trigger: 'change' }
]
}
}]
}
},
created() {
@@ -442,34 +435,24 @@ export default {
this.dialogFormVisible3 = false
},
handleEdit(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.form = {}
console.log(row)
this.title = '编辑'
this.partStateValue1 = parseInt(row.考核状态) + 2
this.dialogFormVisible4 = true
this.num = row.工艺计划流水号
},
submitEdit(formName) { // 提交编辑
this.$refs[formName].validate((valid) => {
if (valid) {
editData(this.num, this.form.零件状态).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogFormVisible4 = false
this.pageCurrent = 1
this.searchData()
} else { this.$message.error('编辑失败') }
})
} else {
return false
}
submitEdit() { // 提交编辑
editData(this.num, this.partStateValue1).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogFormVisible4 = false
this.pageCurrent = 1
this.searchData()
} else { this.$message.error('编辑失败') }
})
},
cancel(formName) { // 取消
this.form = {}
cancel() { // 取消
this.dialogFormVisible4 = false
this.$refs[formName].resetFields()
},
handleSizeChange(val) {
this.pageSize = val