no message
This commit is contained in:
parent
b1ed15edc4
commit
fbb6852561
2 changed files with 118 additions and 5 deletions
|
|
@ -25,7 +25,7 @@ export default {
|
|||
saveFinish: (personalId: string) =>
|
||||
`${finish}/probation-assign?personal_id=${personalId}`,
|
||||
saveEditAssign: (personalId: string) =>
|
||||
`${finish}/probation-assign/${personalId}`,
|
||||
`${finish}/probation-assign?id=${personalId}`,
|
||||
personalAdd: () => `${personal}/add`,
|
||||
probationGetAssignList: (personalId:string) =>
|
||||
`${finish}/probation-assign-list?personal_id=${personalId}`,
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="saveEdit(personalId)"
|
||||
@click="saveEdit(assignId)"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
|
|
@ -1643,7 +1643,7 @@ const val1 = ref([
|
|||
const status = ref<boolean>(true);
|
||||
|
||||
const dataEdit = async (id:string) => {
|
||||
const data = putData(id);
|
||||
const data = putDataEdit(id);
|
||||
await http
|
||||
.put(config.API.saveEditAssign(id),data)
|
||||
.then((res) =>{
|
||||
|
|
@ -1998,9 +1998,123 @@ const postDateTime = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
const putDataEdit = (id: string) => {
|
||||
const GUID = personalId;
|
||||
const assign_job = activityArray.value.map((item, index) => {
|
||||
const activityDesc = activity_desc.value[index]?.trim();
|
||||
const goalDesc = goal_desc.value[index]?.trim();
|
||||
|
||||
if (activityDesc !== "" && goalDesc !== "") {
|
||||
return {
|
||||
activity_desc: activityDesc,
|
||||
goal_desc: goalDesc,
|
||||
};
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
const know_ledge = knowledge.value.map((item) => ({
|
||||
level: item ? item.level : null,
|
||||
}));
|
||||
|
||||
const Productivity_assign = ProductivityArray.value.map((item, index) => {
|
||||
const outputDesc = output_desc.value[index]?.trim();
|
||||
const indicatorDesc = indicator_desc.value[index]?.trim();
|
||||
|
||||
if (outputDesc !== "" && indicatorDesc !== "") {
|
||||
return {
|
||||
output_desc: outputDesc,
|
||||
indicator_desc: indicatorDesc,
|
||||
};
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
const allGroup = [];
|
||||
if (group.value) allGroup.push({ level: group.value.level });
|
||||
if (group2.value) allGroup.push({ level: group2.value.level });
|
||||
if (group3.value) allGroup.push({ level: group3.value.level });
|
||||
|
||||
const allSkills = [];
|
||||
if (skill.value) allSkills.push({ level: skill.value.level });
|
||||
if (skill2.value) allSkills.push({ level: skill2.value.level });
|
||||
if (skill3.value) allSkills.push({ level: skill3.value.level });
|
||||
if (skill4.value) allSkills.push({ level: skill4.value.level });
|
||||
|
||||
const allCompetency = [];
|
||||
if (main.value) allCompetency.push({ level: main.value.level });
|
||||
if (main2.value) allCompetency.push({ level: main2.value.level });
|
||||
if (main3.value) allCompetency.push({ level: main3.value.level });
|
||||
if (main4.value) allCompetency.push({ level: main4.value.level });
|
||||
if (main5.value) allCompetency.push({ level: main5.value.level });
|
||||
|
||||
const assign_director = [
|
||||
{
|
||||
personal_id: caretaker1.value.personal_id,
|
||||
role: "mentor",
|
||||
dated: date2.value instanceof Date ? dateToISO(date2.value) : null,
|
||||
},
|
||||
{
|
||||
personal_id: caretaker2.value.personal_id,
|
||||
role: "mentor",
|
||||
dated: date3.value instanceof Date ? dateToISO(date3.value) : null,
|
||||
},
|
||||
{
|
||||
personal_id: commander.value.personal_id,
|
||||
role: "commander",
|
||||
dated: date4.value instanceof Date ? dateToISO(date4.value) : null,
|
||||
},
|
||||
{
|
||||
personal_id: chairman.value.personal_id,
|
||||
role: "chairman",
|
||||
},
|
||||
];
|
||||
const data = {
|
||||
personal_id: GUID,
|
||||
fullname: fullname.value,
|
||||
position: position.value,
|
||||
monthSelect:
|
||||
monthSelect.value !== null ? parseInt(monthSelect.value) : null,
|
||||
date_start:
|
||||
date_start.value instanceof Date
|
||||
? dateToISO(date_start.value)
|
||||
: new Date(),
|
||||
date_finish:
|
||||
date_finish.value instanceof Date
|
||||
? dateToISO(date_finish.value)
|
||||
: dateToISO(new Date(date_finish.value)),
|
||||
// caretaker_1: caretaker1.value,
|
||||
// caretaker_2: caretaker2.value,
|
||||
assign_knowledges: know_ledge,
|
||||
assign_jobs: assign_job.filter((item) => item !== null),
|
||||
other_desc: OtherLaw.value,
|
||||
assign_skill: allSkills,
|
||||
assign_competency: allCompetency,
|
||||
assign_competency_group: allGroup,
|
||||
other4_desc: Other.value,
|
||||
other5_no1_desc: Other5.value,
|
||||
assign_outputs: Productivity_assign.filter((item) => item !== null),
|
||||
// commander: commander.value,
|
||||
assign_director: assign_director,
|
||||
experimenter_dated:
|
||||
date1.value instanceof Date ? dateToISO(date1.value) : new Date(),
|
||||
// date_2: date2.value instanceof Date ? dateToISO(date2.value) : new Date(),
|
||||
// date_3: date3.value instanceof Date ? dateToISO(date3.value) : new Date(),
|
||||
// date_4: date4.value instanceof Date ? dateToISO(date4.value) : new Date(),
|
||||
// caretaker_foot: caretakerFoot.value,
|
||||
// caretaker_foot2: caretakerFoot2.value,
|
||||
assign_law: checkRule.value
|
||||
.filter((item) => item.checked === 1)
|
||||
.map((item) => ({
|
||||
id: item.id,
|
||||
checked: item.checked,
|
||||
})),
|
||||
};
|
||||
return data;
|
||||
};
|
||||
const putData = (id: string) => {
|
||||
const GUID = id;
|
||||
const GUID = personalId;
|
||||
const assign_job = activityArray.value.map((item, index) => {
|
||||
const activityDesc = activity_desc.value[index]?.trim();
|
||||
const goalDesc = goal_desc.value[index]?.trim();
|
||||
|
|
@ -2071,7 +2185,6 @@ const putData = (id: string) => {
|
|||
role: "chairman",
|
||||
},
|
||||
];
|
||||
|
||||
const data = {
|
||||
personalId: GUID,
|
||||
fullname: fullname.value,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue