<template>
|
<el-dialog
|
:title="!dataForm.id ? '不合格处理' : '修改'"
|
:close-on-click-modal="false"
|
:visible.sync="visible"
|
>
|
<!--检测汇报关联的检验项-->
|
<el-card class="operation-capacity" header="不合格处理">
|
<el-form
|
:model="dataForm"
|
:rules="dataRule"
|
ref="dataForm"
|
label-width="120px"
|
class="l-mes"
|
>
|
<el-row>
|
<el-col :span="8">
|
<el-form-item label="编号" prop="processNo">
|
<el-input v-model="dataForm.processNo" placeholder=""></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="申请人" prop="initiatingOrganization">
|
<el-input
|
v-model="dataForm.initiatingOrganization"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="7">
|
<el-form-item label="接收人" prop="receiver">
|
<el-input v-model="dataForm.receiver" placeholder=""></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="8">
|
<el-form-item label="原因" prop="reason">
|
<el-input v-model="dataForm.reason" placeholder=""></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="原因类型" prop="causeType">
|
<el-select
|
v-model="dataForm.causeType"
|
placeholder="原因类型"
|
filterable
|
style="width: 100%"
|
>
|
<el-option
|
v-for="item in causeTypeOptions"
|
:key="item.id"
|
:label="item.label"
|
:value="item.value"
|
/>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="7">
|
<el-form-item label="整改措施" prop="correctiveMeasures">
|
<el-input
|
v-model="dataForm.correctiveMeasures"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="8">
|
<el-form-item label="申请处理方式" prop="processMode">
|
<el-select
|
v-model="dataForm.processMode"
|
placeholder="申请处理方式"
|
style="width: 100%"
|
>
|
<el-option
|
v-for="item in processModeOptions"
|
:key="item.id"
|
:label="item.label"
|
:value="item.value"
|
/>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="种类" prop="type">
|
<el-select
|
v-model="dataForm.type"
|
placeholder="种类"
|
style="width: 100%"
|
>
|
<el-option
|
v-for="item in typeOptions"
|
:key="item.id"
|
:label="item.label"
|
:value="item.value"
|
/>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="7">
|
<el-form-item label="不合格类别" prop="unqualifiedType">
|
<el-select
|
v-model="dataForm.unqualifiedType"
|
placeholder="不合格类别"
|
style="width: 100%"
|
>
|
<el-option
|
v-for="item in unqualifiedTypeOptions"
|
:key="item.id"
|
:label="item.label"
|
:value="item.value"
|
/>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="8">
|
<el-form-item label="不合格处理描述" prop="unqualifiedDesc">
|
<el-input
|
:maxlength="200"
|
v-model="dataForm.unqualifiedDesc"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="8"> </el-col>
|
<el-col :span="7"> </el-col>
|
</el-row>
|
</el-form>
|
</el-card>
|
<el-card class="operation-capacity" header="不合格零件">
|
<el-table
|
stripe
|
ref="applyPartList"
|
:data="applyPartList"
|
height="200px"
|
:row-style="{ height: '26px' }"
|
>
|
<el-table-column
|
label="系统编号"
|
prop="systemNo"
|
align="center"
|
min-width="75px"
|
:show-overflow-tooltip="true"
|
></el-table-column>
|
<el-table-column
|
label="零件批号"
|
prop="lotBatchNo"
|
align="center"
|
min-width="75px"
|
:show-overflow-tooltip="true"
|
></el-table-column>
|
<el-table-column
|
label="零件编号"
|
prop="partNo"
|
align="center"
|
min-width="75px"
|
:show-overflow-tooltip="true"
|
></el-table-column>
|
<el-table-column
|
label="零件名称"
|
prop="partDesc"
|
align="center"
|
min-width="75px"
|
:show-overflow-tooltip="true"
|
></el-table-column>
|
<el-table-column
|
label="不合格数量"
|
prop="unqualifiedArrived"
|
align="center"
|
min-width="75px"
|
:show-overflow-tooltip="true"
|
></el-table-column>
|
<el-table-column
|
label="备注"
|
prop="remark"
|
align="center"
|
min-width="75px"
|
:show-overflow-tooltip="true"
|
></el-table-column>
|
</el-table>
|
</el-card>
|
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="visible = false">取消</el-button>
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
</span>
|
</el-dialog>
|
</template>
|
|
<script>
|
import {
|
getUnqualifiedProcess,
|
addUnqualifiedProcess,
|
putUnqualifiedProcess
|
} from '@/api/quality/unqualifiedprocess'
|
import { remote } from '@/api/admin/dict'
|
import { mapGetters } from 'vuex'
|
|
export default {
|
props: {
|
applyPartList: {
|
type: Array,
|
default: () => {
|
return []
|
}
|
}
|
},
|
data() {
|
return {
|
visible: false,
|
dataForm: {
|
id: 0,
|
processNo: '',
|
reason: '',
|
processMode: '',
|
initiatingOrganization: null,
|
receiver: null,
|
correctiveMeasures: null,
|
causeType: null,
|
mainProcessNo: null,
|
unqualifiedDesc: null,
|
type: null,
|
unqualifiedType: null,
|
processResult: null
|
},
|
dataRule: {
|
causeType: [
|
{ required: true, message: '原因类型不能为空', trigger: 'blur' }
|
],
|
unqualifiedDesc: [
|
{ required: true, message: '不合格处理描述', trigger: 'blur' }
|
]
|
},
|
causeTypeOptions: [],
|
processModeOptions: [],
|
typeOptions: [],
|
unqualifiedTypeOptions: []
|
}
|
},
|
computed: {
|
...mapGetters(['userInfo'])
|
},
|
methods: {
|
getCauseType() {
|
remote('unqualified_reason_type').then((response) => {
|
if (response.data.code === 0) {
|
this.causeTypeOptions = response.data.data
|
}
|
})
|
},
|
getProcessMode() {
|
remote('unqualified_process_mode').then((response) => {
|
if (response.data.code === 0) {
|
this.processModeOptions = response.data.data
|
}
|
})
|
},
|
getType() {
|
remote('unqualified_handle_type').then((response) => {
|
if (response.data.code === 0) {
|
this.typeOptions = response.data.data
|
}
|
})
|
},
|
getUnqualifiedType() {
|
remote('unqualified_handle_category').then((response) => {
|
if (response.data.code === 0) {
|
this.unqualifiedTypeOptions = response.data.data
|
}
|
})
|
},
|
init(id) {
|
this.getCauseType()
|
this.getProcessMode()
|
this.getType()
|
this.getUnqualifiedType()
|
this.dataForm.id = id || 0
|
this.visible = true
|
this.$nextTick(() => {
|
this.$refs.dataForm.resetFields()
|
if (this.dataForm.id) {
|
getUnqualifiedProcess(this.dataForm.id).then((response) => {
|
this.dataForm = response.data.data
|
})
|
} else {
|
this.dataForm.initiatingOrganization = this.userInfo.staffName
|
}
|
})
|
},
|
// 表单提交
|
dataFormSubmit() {
|
this.$refs.dataForm.validate((valid) => {
|
if (valid) {
|
if (this.dataForm.id) {
|
/* putUnqualifiedProcess(this.dataForm).then((data) => {
|
this.$message.success('修改成功')
|
this.visible = false
|
this.$emit('refreshDataList')
|
}) */
|
} else {
|
if (this.applyPartList && this.applyPartList.length > 0) {
|
const qualityUnqualifiedProcess = []
|
|
this.applyPartList.forEach((applyPart) => {
|
qualityUnqualifiedProcess.push({
|
id: 0,
|
processNo: this.dataForm.processNo,
|
reason: this.dataForm.reason,
|
processMode: this.dataForm.processMode,
|
initiatingOrganization: this.dataForm.initiatingOrganization,
|
receiver: this.dataForm.receiver,
|
correctiveMeasures: this.dataForm.correctiveMeasures,
|
causeType: this.dataForm.causeType,
|
unqualifiedDesc: this.dataForm.unqualifiedDesc,
|
type: this.dataForm.type,
|
unqualifiedType: this.dataForm.unqualifiedType,
|
applyPartId: applyPart.id,
|
unqualifiedQuantity: applyPart.unqualifiedArrived
|
})
|
})
|
|
addUnqualifiedProcess(qualityUnqualifiedProcess).then((data) => {
|
this.$message.success('添加成功')
|
this.visible = false
|
this.$emit('refreshDataList')
|
})
|
} else {
|
this.$message.warning('请选择不合格零件')
|
}
|
}
|
}
|
})
|
}
|
}
|
}
|
</script>
|
<style>
|
.tableItems td {
|
padding: 0px 0px !important;
|
}
|
|
.testResult {
|
padding-bottom: 0px !important;
|
padding-top: 17px !important;
|
}
|
|
.testResult .el-form-item__content {
|
margin-left: 0px !important;
|
}
|
|
.testValue {
|
padding-bottom: 0px !important;
|
padding-top: 17px !important;
|
}
|
|
.testValue .el-form-item__content {
|
margin-left: 0px !important;
|
}
|
</style>
|