|
@@ -2,8 +2,8 @@
|
|
|
<div class="mainContentBox">
|
|
|
<avue-form
|
|
|
ref="formRef"
|
|
|
- v-model:search="search"
|
|
|
v-model="form"
|
|
|
+ v-model:search="search"
|
|
|
:data="data2"
|
|
|
:option="option2"
|
|
|
>
|
|
@@ -13,19 +13,19 @@
|
|
|
v-model="form"
|
|
|
:data="data"
|
|
|
:option="option"
|
|
|
- v-model:page="page"
|
|
|
@row-save="createRow"
|
|
|
@row-update="updateRow"
|
|
|
@row-del="deleteRow"
|
|
|
>
|
|
|
<template #menu-left="{ size }">
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
circle
|
|
|
+ icon="el-icon-plus"
|
|
|
+ type="primary"
|
|
|
@click="addSkill"
|
|
|
></el-button
|
|
|
- ></template>
|
|
|
+ >
|
|
|
+ </template>
|
|
|
|
|
|
</avue-crud>
|
|
|
<CommonTable
|
|
@@ -35,39 +35,41 @@
|
|
|
@selected-sure="onSelectedFinish"
|
|
|
/>
|
|
|
<div class="detail-footer">
|
|
|
- <el-button type="primary" @click="onHandle"> 确定 </el-button>
|
|
|
+ <el-button type="primary" @click="onHandle"> 确定</el-button>
|
|
|
<el-button @click="cancelWindow">取消</el-button>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { ref, getCurrentInstance } from "vue";
|
|
|
-import { useCrud } from "@/hooks/userCrud";
|
|
|
+import {ref, getCurrentInstance} from "vue";
|
|
|
+import {useCrud} from "@/hooks/userCrud";
|
|
|
import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
|
-import { useCommonStoreHook, useDictionaryStore } from "@/store";
|
|
|
+import {useCommonStoreHook, useDictionaryStore} from "@/store";
|
|
|
import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
import SingleUpload from "@/components/Upload/SingleUpload.vue";
|
|
|
-const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
-import {getPostSkill,addEmployeeSkill,getSkillDetail} from "@/api/system/skill";
|
|
|
+
|
|
|
+const {isShowTable, tableType} = toRefs(useCommonStoreHook());
|
|
|
+import {getPostSkill, addEmployeeSkill, getSkillDetail} from "@/api/system/skill";
|
|
|
// 数据字典相关
|
|
|
-const { dicts } = useDictionaryStore();
|
|
|
+const {dicts} = useDictionaryStore();
|
|
|
|
|
|
const test = () => {
|
|
|
isShowTable.value = true;
|
|
|
tableType.value = tableType.value == 1 ? 2 : 1;
|
|
|
};
|
|
|
-const data3=ref([]);
|
|
|
-const data2=ref(null);
|
|
|
+const data3 = ref([]);
|
|
|
+const data2 = ref(null);
|
|
|
// 传入一个url,后面不带/
|
|
|
-const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
+const {form, data, option, search, page, toDeleteIds, Methords, Utils} =
|
|
|
useCrud({
|
|
|
src: "/api/v1/sys/skillScore",
|
|
|
+ dataListUrl: "/api/v1/sys/skillScore/list",
|
|
|
});
|
|
|
-const { dataList, createRow, updateRow, deleteRow, searchChange, dataNoPageList } =
|
|
|
+const {dataList, createRow, updateRow, deleteRow, searchChange, dataNoPageList} =
|
|
|
Methords; //增删改查
|
|
|
-const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
-const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
+const {selectionChange, multipleDelete} = Methords; //选中和批量删除事件
|
|
|
+const {checkBtnPerm, downloadTemplate, exportData} = Utils; //按钮权限等工具
|
|
|
// checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
|
|
|
// const permission = reactive({
|
|
|
// delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
|
|
@@ -75,93 +77,91 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
|
|
|
// editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
|
|
|
// menu: true,
|
|
|
// });
|
|
|
-const option2=ref(null);
|
|
|
+const option2 = ref(null);
|
|
|
const ctableRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
const router = useRouter();
|
|
|
onMounted(() => {
|
|
|
// console.log("crudRef", crudRef)
|
|
|
getSkillDetail(props.skillId).then(
|
|
|
- (data)=>{
|
|
|
- form.value=data.data;
|
|
|
+ (data) => {
|
|
|
+ form.value = data.data;
|
|
|
}
|
|
|
)
|
|
|
- search.value.employeeSkillId=props.skillId;
|
|
|
- dataNoPageList();
|
|
|
-
|
|
|
+ search.value.employeeSkillId = props.skillId;
|
|
|
+ dataList();
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
-const skillChange=(row)=>{
|
|
|
- if(skillValue.value!==undefined&&skillValue.value!==null&&skillValue.value!==""){
|
|
|
- data.value[row.$index].skillDictValue=skillValue.value;
|
|
|
+const skillChange = (row) => {
|
|
|
+ if (skillValue.value !== undefined && skillValue.value !== null && skillValue.value !== "") {
|
|
|
+ data.value[row.$index].skillDictValue = skillValue.value;
|
|
|
}
|
|
|
}
|
|
|
-const cancelWindow=()=>{
|
|
|
- props.editDialog.visible=false;
|
|
|
+const cancelWindow = () => {
|
|
|
+ props.editDialog.visible = false;
|
|
|
}
|
|
|
const addSkill = () => {
|
|
|
- const bom=ref({
|
|
|
- $cellEdit:true,
|
|
|
+ const bom = ref({
|
|
|
+ $cellEdit: true,
|
|
|
});
|
|
|
data.value.push(bom.value);
|
|
|
};
|
|
|
-const employeeSkill=ref({});
|
|
|
-const onHandle=()=>{
|
|
|
+const employeeSkill = ref({});
|
|
|
+const onHandle = () => {
|
|
|
console.info(form.value);
|
|
|
- if(form.value.userId===null||form.value.userId===undefined||form.value.userId===""){
|
|
|
+ if (form.value.userId === null || form.value.userId === undefined || form.value.userId === "") {
|
|
|
ElMessage({
|
|
|
message: "未选择打分用户",
|
|
|
type: "error",
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
- if(form.value.postId===null||form.value.postId===undefined||form.value.postId===""){
|
|
|
+ if (form.value.postId === null || form.value.postId === undefined || form.value.postId === "") {
|
|
|
ElMessage({
|
|
|
message: "未选择岗位",
|
|
|
type: "error",
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
- if(data.value.length===0){
|
|
|
+ if (data.value.length === 0) {
|
|
|
ElMessage({
|
|
|
message: "没有要保存的打分项",
|
|
|
type: "error",
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
- if(data.value.length>0){
|
|
|
- for(let i=0;i<data.value.length;i++){
|
|
|
- if(data.value[i].skillDictValue===undefined||data.value[i].skillDictValue===null||data.value[i].skillDictValue===""){
|
|
|
+ if (data.value.length > 0) {
|
|
|
+ for (let i = 0; i < data.value.length; i++) {
|
|
|
+ if (data.value[i].skillDictValue === undefined || data.value[i].skillDictValue === null || data.value[i].skillDictValue === "") {
|
|
|
ElMessage({
|
|
|
- message: "第"+(i+1)+"项没有选择技能",
|
|
|
+ message: "第" + (i + 1) + "项没有选择技能",
|
|
|
type: "error",
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
- if(data.value[i].score===undefined||data.value[i].score===null||data.value[i].score===""){
|
|
|
+ if (data.value[i].score === undefined || data.value[i].score === null || data.value[i].score === "") {
|
|
|
ElMessage({
|
|
|
- message: "第"+(i+1)+"项没有打分",
|
|
|
+ message: "第" + (i + 1) + "项没有打分",
|
|
|
type: "error",
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- employeeSkill.value.userId=form.value.userId;
|
|
|
- employeeSkill.value.postId=form.value.postId;
|
|
|
- employeeSkill.value.skillList=Array.from(data.value);
|
|
|
- employeeSkill.value.id=form.value.id;
|
|
|
+ employeeSkill.value.userId = form.value.userId;
|
|
|
+ employeeSkill.value.postId = form.value.postId;
|
|
|
+ employeeSkill.value.skillList = Array.from(data.value);
|
|
|
+ employeeSkill.value.id = form.value.id;
|
|
|
addEmployeeSkill(employeeSkill.value).then(
|
|
|
- (data)=>{
|
|
|
- if(data.code==="200") {
|
|
|
+ (data) => {
|
|
|
+ if (data.code === "200") {
|
|
|
ElMessage({
|
|
|
message: data.msg,
|
|
|
type: "success",
|
|
|
});
|
|
|
- props.editDialog.visible=false;
|
|
|
- }
|
|
|
- else {
|
|
|
+ props.editDialog.visible = false;
|
|
|
+ } else {
|
|
|
ElMessage({
|
|
|
message: data.msg,
|
|
|
type: "error",
|
|
@@ -174,100 +174,108 @@ const onHandle=()=>{
|
|
|
// 设置表格列或者其他自定义的option
|
|
|
option2.value = {
|
|
|
selection: true,
|
|
|
- submitBtn:false,
|
|
|
- clearAbleBtn:false,
|
|
|
- emptyBtn:false,
|
|
|
+ submitBtn: false,
|
|
|
+ clearAbleBtn: false,
|
|
|
+ emptyBtn: false,
|
|
|
column: [
|
|
|
- { label: "id", prop: "id", width: 130,overHidden: true,search: true ,
|
|
|
+ {
|
|
|
+ label: "id", prop: "id", width: 130, overHidden: true, search: true,
|
|
|
filterable: true,
|
|
|
- width: 100,overHidden: true,
|
|
|
- disabled:false,
|
|
|
- display:false,
|
|
|
+ width: 100, overHidden: true,
|
|
|
+ disabled: false,
|
|
|
+ display: false,
|
|
|
|
|
|
},
|
|
|
|
|
|
- { label: "用户id", prop: "userId", width: 130,overHidden: true,search: true ,
|
|
|
+ {
|
|
|
+ label: "用户id", prop: "userId", width: 130, overHidden: true, search: true,
|
|
|
filterable: true,
|
|
|
- width: 100,overHidden: true,
|
|
|
- disabled:true,
|
|
|
- display:false,
|
|
|
+ width: 100, overHidden: true,
|
|
|
+ disabled: true,
|
|
|
+ display: false,
|
|
|
|
|
|
},
|
|
|
- { label: "用户名", prop: "userName", width: 140,overHidden: true,search: true ,rules: [{
|
|
|
+ {
|
|
|
+ label: "用户名", prop: "userName", width: 140, overHidden: true, search: true, rules: [{
|
|
|
required: true,
|
|
|
search: true,
|
|
|
message: "请选择员工姓名",
|
|
|
trigger: "blur"
|
|
|
}],
|
|
|
- click: ({ value, column }) => {
|
|
|
+ click: ({value, column}) => {
|
|
|
ctableRef.value.startSelect();
|
|
|
- },},
|
|
|
- { label: "所属机构", prop: "institution", width: 130,overHidden: true,search: true ,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "所属机构", prop: "institution", width: 130, overHidden: true, search: true,
|
|
|
filterable: true,
|
|
|
- width: 100,overHidden: true,
|
|
|
- disabled:true,
|
|
|
+ width: 100, overHidden: true,
|
|
|
+ disabled: true,
|
|
|
|
|
|
},
|
|
|
{
|
|
|
label: "员工编号",
|
|
|
prop: "employeeCode",
|
|
|
search: true,
|
|
|
- disabled:true,
|
|
|
+ disabled: true,
|
|
|
},
|
|
|
- { label: "岗位", prop: "postName",
|
|
|
+ {
|
|
|
+ label: "岗位", prop: "postName",
|
|
|
search: true,
|
|
|
filterable: true,
|
|
|
overHidden: true,
|
|
|
- disabled:true,
|
|
|
- dicUrl:dictDataUtil.post_list_url,
|
|
|
- dicMethod:"post",
|
|
|
- change:({ value, column })=>{
|
|
|
- if(value!==undefined) {
|
|
|
- props.postId = value;
|
|
|
- skillValue.value=null;
|
|
|
- optionSkill.value=null;
|
|
|
- dataNoPageList();
|
|
|
- }
|
|
|
+ disabled: true,
|
|
|
+ dicUrl: dictDataUtil.post_list_url,
|
|
|
+ dicMethod: "post",
|
|
|
+ change: ({value, column}) => {
|
|
|
+ if (value !== undefined) {
|
|
|
+ props.postId = value;
|
|
|
+ skillValue.value = null;
|
|
|
+ optionSkill.value = null;
|
|
|
+ dataNoPageList();
|
|
|
+ }
|
|
|
},
|
|
|
- props: { label: "postName", value: "id" },
|
|
|
+ props: {label: "postName", value: "id"},
|
|
|
|
|
|
},
|
|
|
- { label: "部门", prop: "deptName", overHidden: true,
|
|
|
- disabled:true, },
|
|
|
+ {
|
|
|
+ label: "部门", prop: "deptName", overHidden: true,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
|
|
|
],
|
|
|
};
|
|
|
-const postIdValue=ref({});
|
|
|
+const postIdValue = ref({});
|
|
|
|
|
|
const props = defineProps({
|
|
|
- editDialog:{
|
|
|
- type:Object,
|
|
|
- default:()=>{
|
|
|
+ editDialog: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
return {};
|
|
|
}
|
|
|
},
|
|
|
- skillId:{
|
|
|
- type:String,
|
|
|
- default:()=>{
|
|
|
+ skillId: {
|
|
|
+ type: String,
|
|
|
+ default: () => {
|
|
|
return "0";
|
|
|
}
|
|
|
},
|
|
|
- postId:{
|
|
|
- type:Number,
|
|
|
- default:()=>{
|
|
|
+ postId: {
|
|
|
+ type: Number,
|
|
|
+ default: () => {
|
|
|
return "0";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
})
|
|
|
-const postIdSkill=ref({});
|
|
|
+const postIdSkill = ref({});
|
|
|
// 设置表格列或者其他自定义的option
|
|
|
-option.value = Object.assign(option.value,{
|
|
|
+option.value = Object.assign(option.value, {
|
|
|
selection: false,
|
|
|
addBtn: false,
|
|
|
viewBtn: false,
|
|
|
- editBtn:false,
|
|
|
- saveBtn:false,
|
|
|
+ editBtn: false,
|
|
|
+ saveBtn: false,
|
|
|
|
|
|
cellBtn: true,
|
|
|
column: [{
|
|
@@ -275,10 +283,10 @@ option.value = Object.assign(option.value,{
|
|
|
prop: "skillDictValue",
|
|
|
align: 'center',
|
|
|
headerAlign: 'center',
|
|
|
- span:24,
|
|
|
+ span: 24,
|
|
|
cell: true,
|
|
|
type: 'select',
|
|
|
- dicUrl: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/postSkill/list/"+props.postId,
|
|
|
+ dicUrl: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/postSkill/list/" + props.postId,
|
|
|
props: {
|
|
|
label: "skillDictLabel", // 下拉菜单显示的字段
|
|
|
value: "skillDictValue", // 下拉菜单值的字段
|
|
@@ -290,26 +298,26 @@ option.value = Object.assign(option.value,{
|
|
|
align: 'center',
|
|
|
headerAlign: 'center',
|
|
|
cell: true,
|
|
|
- type:"number",
|
|
|
+ type: "number",
|
|
|
precision: 2,
|
|
|
- max:100,
|
|
|
- min:0,
|
|
|
- span:24,
|
|
|
+ max: 100,
|
|
|
+ min: 0,
|
|
|
+ span: 24,
|
|
|
},],
|
|
|
});
|
|
|
-const onSelectedFinish=(selectedValue)=>{
|
|
|
- form.value.userId=selectedValue.id;
|
|
|
+const onSelectedFinish = (selectedValue) => {
|
|
|
+ form.value.userId = selectedValue.id;
|
|
|
|
|
|
- form.value.userName=selectedValue.userName;
|
|
|
- form.value.deptName=selectedValue.deptName;
|
|
|
- form.value.employeeCode=selectedValue.employeeCode;
|
|
|
- form.value.institution=selectedValue.institution;
|
|
|
+ form.value.userName = selectedValue.userName;
|
|
|
+ form.value.deptName = selectedValue.deptName;
|
|
|
+ form.value.employeeCode = selectedValue.employeeCode;
|
|
|
+ form.value.institution = selectedValue.institution;
|
|
|
|
|
|
}
|
|
|
-const skillValue=ref(null);
|
|
|
-const optionSkill=ref([]);
|
|
|
-const getPostSkills=()=>{
|
|
|
- if(postIdValue.value===undefined||postIdValue.value===null||postIdValue.value===""){
|
|
|
+const skillValue = ref(null);
|
|
|
+const optionSkill = ref([]);
|
|
|
+const getPostSkills = () => {
|
|
|
+ if (postIdValue.value === undefined || postIdValue.value === null || postIdValue.value === "") {
|
|
|
ElMessage({
|
|
|
message: "未选择岗位",
|
|
|
type: "error",
|
|
@@ -317,34 +325,38 @@ const getPostSkills=()=>{
|
|
|
return false;
|
|
|
}
|
|
|
getPostSkill(postIdValue.value).then(
|
|
|
- (data)=>{
|
|
|
- optionSkill.value=Array.from(data.data);
|
|
|
+ (data) => {
|
|
|
+ optionSkill.value = Array.from(data.data);
|
|
|
}
|
|
|
)
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
<style type="text/css">
|
|
|
- .title-detail{
|
|
|
- width: 30%;
|
|
|
- height: 50px;
|
|
|
- line-height: 50px;
|
|
|
- margin: 25px 20px 25px 0;
|
|
|
- float: left;
|
|
|
- }
|
|
|
- .detail{
|
|
|
- margin: 0 auto;
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
- .avue-crud{
|
|
|
- float: left;
|
|
|
- }
|
|
|
- .detail-footer{
|
|
|
- float: right;
|
|
|
- margin-top:15px;
|
|
|
- }
|
|
|
- .el-select__selection{
|
|
|
- width: 150px;
|
|
|
- }
|
|
|
+.title-detail {
|
|
|
+ width: 30%;
|
|
|
+ height: 50px;
|
|
|
+ line-height: 50px;
|
|
|
+ margin: 25px 20px 25px 0;
|
|
|
+ float: left;
|
|
|
+}
|
|
|
+
|
|
|
+.detail {
|
|
|
+ margin: 0 auto;
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.avue-crud {
|
|
|
+ float: left;
|
|
|
+}
|
|
|
+
|
|
|
+.detail-footer {
|
|
|
+ float: right;
|
|
|
+ margin-top: 15px;
|
|
|
+}
|
|
|
+
|
|
|
+.el-select__selection {
|
|
|
+ width: 150px;
|
|
|
+}
|
|
|
|
|
|
</style>
|