<template>
|
<el-form :model="form" :disabled="disabled" label-width="130px" size="small" style="position: relative">
|
<el-card :body-style="{ height: '350px', overflow: 'auto' }">
|
<el-form-item label="责任部门">
|
<!-- <el-select v-model="form.correctiveActionId" placeholder="请选择">
|
<el-option
|
v-for="(item, index) in userList"
|
:key="index"
|
:label="item.name"
|
:value="item.id"
|
></el-option>
|
</el-select> -->
|
<el-select @change="filterUserList" v-model="form.causeAnalysisId" placeholder="请选择"
|
style="width: 100%">
|
<el-option label="通信产品实验室" :value="18"></el-option>
|
<el-option label="电力产品实验室" :value="19"></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="责任人">
|
<el-select v-model="form.correctiveActionId" placeholder="请选择">
|
<el-option v-for="(item, index) in userListTwo" :key="index" :label="item.name"
|
:value="item.id"></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="纠正措施">
|
<el-input type="textarea" v-model="form.correctiveMeasure" :rows="2" placeholder="请输入内容">
|
</el-input>
|
</el-form-item>
|
<el-form-item label="提出要求部门确认">
|
<el-input type="textarea" v-model="form.requestDepartmentConfirmation" :rows="2" placeholder="请输入内容">
|
</el-input>
|
</el-form-item>
|
</el-card>
|
<el-form-item label-width="0">
|
<div style="display: flex; width: 100%; justify-content: space-between; margin-top: 15px;">
|
<div>
|
操作人:{{ currentResponsible }}
|
</div>
|
<div v-if="step == 2">
|
<el-button :disabled="false" @click="cancel">驳回</el-button>
|
<el-button type="primary" @click="submit"
|
:disabled="(departId == 18 && ![12, 10, 16].includes(userId)) || (departId == 19 && ![35, 41, 16].includes(userId))">提交</el-button>
|
</div>
|
</div>
|
</el-form-item>
|
</el-form>
|
</template>
|
<script>
|
import { mapGetters } from "vuex";
|
export default {
|
props: {
|
departId: {
|
type: Number,
|
default: () => {
|
return null;
|
}
|
},
|
isPermission: {
|
type: Boolean,
|
default: false,
|
},
|
currentResponsible: {
|
type: String,
|
default: ''
|
},
|
measureForm: {
|
type: Object,
|
default: {}
|
},
|
userList: {
|
type: Array,
|
default: []
|
},
|
step: {
|
type: Number,
|
default: 0
|
},
|
disabled: {
|
type: Boolean,
|
default: false
|
}
|
},
|
computed: {
|
form: {
|
get() {
|
return this.measureForm
|
},
|
set(val) {
|
this.$emit('update:measureForm', val)
|
}
|
},
|
...mapGetters(["userId"]),
|
},
|
data() {
|
return {
|
userListTwo: []
|
}
|
},
|
mounted() {
|
this.userListTwo = JSON.parse(JSON.stringify(this.userList))
|
console.log('this.userListTwo', this.userListTwo);
|
},
|
methods: {
|
filterUserList() {
|
this.userListTwo = this.userList.filter(item => item.departLimsId.includes(this.form.causeAnalysisId))
|
if (!this.userListTwo.some(item => item.id == this.form.correctiveActionId)) {
|
this.form.correctiveActionId = null
|
}
|
},
|
submit() {
|
this.$emit('nextStep', 'submit')
|
},
|
save() {
|
this.$emit('nextStep', 'save')
|
},
|
cancel() {
|
this.$emit('cancel', 'cancel')
|
}
|
}
|
}
|
</script>
|