<template>
|
<el-dialog v-model="dialogVisible" :before-close="resetForm" :fullscreen="full" :title="titles" width="50%" draggable>
|
<el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
|
<el-form :model="form" :disabled="disabled" label-width="120px">
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="员工姓名" size="default">
|
<el-input v-model="form.personId" placeholder="请选择">
|
<template #append> <el-button :icon="Search" @click="daiInpts" /> </template
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="11">
|
<el-form-item label="奖惩名称" size="default">
|
<el-input v-model="form.rewardPunishmentStandardId" placeholder="请选择">
|
<template #append> <el-button :icon="Search" @click="daiInpt" /> </template
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<!-- <el-col :span="11" :offset="2">
|
<el-form-item label="奖惩类型" size="default">
|
<el-input disabled v-model="form.personId" />
|
</el-form-item>
|
</el-col> -->
|
</el-row>
|
<!-- <el-row>
|
<el-col :span="24">
|
<el-form-item label="奖惩内容" size="default">
|
<el-input disabled v-model="form.personId" placeholder="请填写奖惩内容" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="依据" size="default">
|
<el-input disabled v-model="form.personId" placeholder="请填写奖惩依据" />
|
</el-form-item>
|
</el-col>
|
</el-row> -->
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="备注信息">
|
<el-input v-model="form.memo" type="textarea" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
<template #footer>
|
<span class="dialog-footer">
|
<el-button @click="resetForm" size="default">关闭</el-button>
|
<el-button type="primary" @click="submitForm" size="default">确定</el-button>
|
</span>
|
</template>
|
</el-dialog>
|
<DailogSearchUser ref="Show" @SearchUser="UserId"></DailogSearchUser>
|
<DailogSearch ref="Shows" @backNum="numberId"></DailogSearch>
|
</template>
|
<script lang="ts">
|
import { defineComponent, ref, reactive } from 'vue';
|
import { Search, FullScreen } from '@element-plus/icons-vue';
|
import DailogSearch from './DailogSearch.vue';
|
import { goalManagementApi } from '/@/api/goalManagement';
|
import DailogSearchUser from '/@/components/DailogSearchUser/index.vue';
|
import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext } from 'element-plus';
|
export default defineComponent({
|
components: { DailogSearch, DailogSearchUser },
|
setup(props, { emit }) {
|
const dialogVisible = ref<boolean>(false);
|
const form = ref({
|
rewardPunishmentStandardId: '', //奖惩标准/外键
|
memo: '', ////备注信息
|
personId: "", ////员工(多个用逗号隔开)
|
});
|
const titles = ref();
|
const disabled = ref(false);
|
// 打开弹窗
|
const openDailog = (title: string, value: any, id: number) => {
|
dialogVisible.value = true;
|
titles.value = `${title}奖惩标准设定`;
|
disabled.value = title == '查看' ? true : false;
|
if (title == '查看' || title == '修改')
|
goalManagementApi()
|
.getrewardPunishmentDetail(id)
|
.then((res) => {
|
if (res.data.code == 200) {
|
form.value = res.data.data;
|
} else {
|
ElMessage.error(res.data.msg);
|
}
|
});
|
};
|
// 提交
|
const submitForm = () => {
|
dialogVisible.value = false;
|
goalManagementApi()
|
.getrewardPunishmentAddOrUpdate(form.value)
|
.then((res) => {
|
if (res.data.code == 200) {
|
ElMessage({
|
message: res.data.msg,
|
type: 'success',
|
});
|
emit('navAddorUpdata');
|
} else {
|
ElMessage.error(res.data.msg);
|
}
|
});
|
form.value = {
|
rewardPunishmentStandardId: '', //奖惩标准/外键
|
memo: '', ////备注信息
|
personId: "", ////员工(多个用逗号隔开)
|
};
|
};
|
// 取消
|
const resetForm = () => {
|
dialogVisible.value = false;
|
form.value = {
|
rewardPunishmentStandardId: '', //奖惩标准/外键
|
memo: '', ////备注信息
|
personId: "", ////员工(多个用逗号隔开)
|
};
|
};
|
|
// 安全目标指标弹窗
|
const Shows = ref();
|
const daiInpt = () => {
|
Shows.value.openDailog();
|
};
|
const Show = ref();
|
const daiInpts = () => {
|
Show.value.openDailog();
|
};
|
const numberId=(val:any)=>{
|
console.log(val)
|
form.value.rewardPunishmentStandardId=val.id
|
}
|
const UserId=(val:any)=>{
|
form.value.personId=val.id
|
}
|
//全屏
|
const full = ref(false);
|
const toggleFullscreen = () => {
|
if (full.value == false) {
|
full.value = true;
|
} else {
|
full.value = false;
|
}
|
};
|
return {
|
dialogVisible,
|
UserId,
|
form,
|
titles,
|
disabled,
|
openDailog,
|
submitForm,
|
numberId,
|
resetForm,
|
Shows,
|
daiInpt,
|
Show,
|
daiInpts,
|
full,
|
toggleFullscreen,
|
Search,
|
FullScreen,
|
};
|
},
|
});
|
</script>
|
<style scoped>
|
.el-row {
|
padding: 0 0 20px 0;
|
}
|
</style>
|