Commit c194e224 authored by 11528's avatar 11528

不良定义新增

parent 10cdac96
// 不良定义api // 不良定义api
import request from '@/utils/request' import request from '@/utils/request'
import Qs from "qs"; import Qs from 'qs'
// 分页查询列表 // 分页查询列表
export function listBad(query) { export function listBad(query) {
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
> >
<el-table-column type="selection" width="50" /> <el-table-column type="selection" width="50" />
<el-table-column type="index" label="序号" width="50" /> <el-table-column type="index" label="序号" width="50" />
<el-table-column align="center" prop="rejectCode" width="120" :show-overflow-tooltip="true"> <el-table-column align="center" prop="rejectCode" width="200" :show-overflow-tooltip="true">
<template slot="header"> <template slot="header">
<div>不良编号</div> <div>不良编号</div>
<div>Reject Code</div> <div>Reject Code</div>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
{{ scope.row.rejectCode || '-' }} {{ scope.row.rejectCode || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="rejectDescription" width="200" :show-overflow-tooltip="true"> <el-table-column align="center" prop="rejectDescription" :show-overflow-tooltip="true">
<template slot="header"> <template slot="header">
<div>不良描述</div> <div>不良描述</div>
<div>Reject Description</div> <div>Reject Description</div>
...@@ -95,15 +95,15 @@ ...@@ -95,15 +95,15 @@
{{ scope.row.positionName || '-' }} {{ scope.row.positionName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="specificExplanation" :show-overflow-tooltip="true"> <!-- <el-table-column align="center" prop="specificExplanation" :show-overflow-tooltip="true">-->
<template slot="header"> <!-- <template slot="header">-->
<div>具体解释</div> <!-- <div>具体解释</div>-->
<div>Specific Explanation</div> <!-- <div>Specific Explanation</div>-->
</template> <!-- </template>-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
{{ scope.row.specificExplanation || '-' }} <!-- {{ scope.row.specificExplanation || '-' }}-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column align="center" width="100" prop="flag"> <el-table-column align="center" width="100" prop="flag">
<template slot="header"> <template slot="header">
<div>状态</div> <div>状态</div>
...@@ -166,8 +166,8 @@ ...@@ -166,8 +166,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item class="labelHeight" label="工站" prop="Position"> <el-form-item class="labelHeight" label="工站" prop="positionName">
<div slot="label" class="labelClass"> <div slot="label" class="labelClassRequired">
<div class="labelName">工站</div> <div class="labelName">工站</div>
<div class="labelName">Position</div> <div class="labelName">Position</div>
</div> </div>
...@@ -184,8 +184,8 @@ ...@@ -184,8 +184,8 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item class="labelHeight" label="不良描述" prop="phone"> <el-form-item class="labelHeight" label="不良描述" prop="rejectDescription">
<div slot="label" class="labelClass"> <div slot="label" class="labelClassRequired">
<div class="labelName">不良描述</div> <div class="labelName">不良描述</div>
<div class="labelName">Reject Description</div> <div class="labelName">Reject Description</div>
</div> </div>
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item class="labelHeight" label="状态" prop="email"> <el-form-item class="labelHeight" label="状态" prop="flag">
<div slot="label" class="labelClass"> <div slot="label" class="labelClass">
<div class="labelName">状态</div> <div class="labelName">状态</div>
<div class="labelName">Status</div> <div class="labelName">Status</div>
...@@ -212,9 +212,9 @@ ...@@ -212,9 +212,9 @@
<div class="labelName">具体解释</div> <div class="labelName">具体解释</div>
<div class="labelName">Specific Explanation</div> <div class="labelName">Specific Explanation</div>
</div> </div>
<el-col v-for="(item, index) in form.specificExplanation" :key="item.specificExplanation" :span="18" style="width: 70%"> <el-col v-for="(item, index) in form.specificExplanations" :key="item" :span="18" style="width: 70%">
<el-input v-model="item.specificExplanation" placeholder="" style="width: 70%" /> <el-input v-model="item.specificExplanation" placeholder="" style="width: 70%" />
<el-link v-if="form.specificExplanation.length > 1" style="width: 20%" @click.prevent="removeDomain(item,index)">删除</el-link> <el-link v-if="form.specificExplanations.length > 1" type="primary" style="width: 20%" @click.prevent="removeDomain(item,index)">删除</el-link>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-link type="primary" @click="addDomain">增加一行</el-link> <el-link type="primary" @click="addDomain">增加一行</el-link>
...@@ -328,27 +328,25 @@ export default { ...@@ -328,27 +328,25 @@ export default {
form: { form: {
explanationId: '', explanationId: '',
rejectCode: '', rejectCode: '',
position: '', positionId: '',
rejectDescription: '', rejectDescription: '',
flag: '', flag: '',
specificExplanation: [ specificExplanations: [
{ specificExplanation: '' } { specificExplanation: '' }
], ],
positionName: '' positionName: '',
specificExplanation1: []
}, },
// 表单校验 // 表单校验
rules: { rules: {
rejectCode: [ rejectCode: [
{ required: true, message: '请输入不良编号', trigger: 'blur' } { required: true, message: '请输入不良编号', trigger: 'blur' }
], ],
position: [ positionName: [
{ required: true, message: '请输入工站', trigger: 'blur' } { required: true, message: '请输入工站', trigger: 'blur' }
], ],
rejectDescription: [ rejectDescription: [
{ required: true, message: '请输入不良描述', trigger: 'blur' } { required: true, message: '请输入不良描述', trigger: 'blur' }
],
specificExplanation: [
{ required: false, message: '请输入具体解释', trigger: 'blur' }
] ]
}, },
title: '', title: '',
...@@ -383,7 +381,7 @@ export default { ...@@ -383,7 +381,7 @@ export default {
createBy: undefined, createBy: undefined,
updateBy: undefined, updateBy: undefined,
remark: undefined, remark: undefined,
specificExplanation: [ specificExplanations: [
{ specificExplanation: '' } { specificExplanation: '' }
] ]
} }
...@@ -479,13 +477,30 @@ export default { ...@@ -479,13 +477,30 @@ export default {
} }
}) })
} else { } else {
addBad(this.form).then(response => { console.log(this.form.specificExplanations)
this.form.specificExplanation1 = []
this.form.specificExplanations.forEach(item => {
if (this.form.specificExplanations.length < 1) {
this.form.specificExplanation1.push(item.specificExplanation)
} else {
this.form.specificExplanation1.push(item.specificExplanation)
}
})
console.log(this.form.specificExplanation1)
addBad({
rejectCode: this.form.rejectCode,
rejectDescription: this.form.rejectDescription,
flag: this.form.flag,
positionName: this.form.positionName,
specificExplanations: this.form.specificExplanation1
}).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.$message({ this.$message({
message: '新增成功', message: '新增成功',
type: 'success' type: 'success'
}) })
this.open = false this.openBad = false
this.reset()
this.getList() this.getList()
} }
}) })
...@@ -494,16 +509,16 @@ export default { ...@@ -494,16 +509,16 @@ export default {
}) })
}, },
addDomain() { addDomain() {
this.form.specificExplanation.push({ this.form.specificExplanations.push(
specificExplanation: '' { specificExplanation: '' }
}) )
}, },
/** 新增弹窗的删除按钮 */ /** 新增弹窗的删除按钮 */
removeDomain(item, index) { removeDomain(item, index) {
if (this.form.specificExplanation.length <= 1) { if (this.form.specificExplanations.length <= 1) {
return false return false
} }
this.form.specificExplanation.splice(index, 1) this.form.specificExplanations.splice(index, 1)
} }
} }
} }
...@@ -553,7 +568,7 @@ export default { ...@@ -553,7 +568,7 @@ export default {
.badDialog{ .badDialog{
.labelHeight{ .labelHeight{
.el-form-item__label{ .el-form-item__label{
height: 48px; height: 40px;
} }
} }
.el-form-item--small .el-form-item__label{ .el-form-item--small .el-form-item__label{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment