เพิ่มแบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ (ติดpost)
This commit is contained in:
parent
fe2adde41a
commit
c557c8711e
1 changed files with 34 additions and 47 deletions
|
|
@ -96,7 +96,7 @@
|
|||
hide-bottom-space
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="
|
||||
date_start != null ? date2Thai(date_start) : null
|
||||
date_start != null ? date2Thai(date_start) : undefined
|
||||
"
|
||||
:label="`${'ตั้งเเต่วันที่'}`"
|
||||
clearable
|
||||
|
|
@ -131,7 +131,7 @@
|
|||
readonly
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="
|
||||
date_finish != null ? date2Thai(date_finish) : null
|
||||
date_finish != null ? date2Thai(date_finish) : undefined
|
||||
"
|
||||
:label="`${'ถึงวันที่'}`"
|
||||
clearable
|
||||
|
|
@ -1214,7 +1214,7 @@
|
|||
dense
|
||||
borderless
|
||||
:outlined="routeName == 'probationWorkAdd'"
|
||||
v-model="fullnameFoot"
|
||||
v-model="fullname"
|
||||
label="ชื่อ-สกุล"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -1224,7 +1224,7 @@
|
|||
dense
|
||||
borderless
|
||||
:outlined="routeName == 'probationWorkAdd'"
|
||||
v-model="positionFoot"
|
||||
v-model="position"
|
||||
label="ตำแหน่ง"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -1285,7 +1285,7 @@
|
|||
dense
|
||||
borderless
|
||||
:outlined="routeName == 'probationWorkAdd'"
|
||||
v-model="caretakerFoot"
|
||||
v-model="caretaker1"
|
||||
label="ผู้ดูแลคนที่ 1"
|
||||
/>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
|
|
@ -1337,7 +1337,7 @@
|
|||
dense
|
||||
borderless
|
||||
:outlined="routeName == 'probationWorkAdd'"
|
||||
v-model="caretakerFoot2"
|
||||
v-model="caretaker2"
|
||||
label="ผู้ดูแลคนที่ 2"
|
||||
/>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
|
|
@ -1694,6 +1694,8 @@ const getAssignNew = async (id: string) => {
|
|||
monthSelect.value = `${data.assign_month} เดือน`;
|
||||
OPcaretaker.value = data.mentors;
|
||||
OPcommander.value = [data.commander];
|
||||
fullname.value = data.person.name
|
||||
position.value = data.person.OrganizationOrganization
|
||||
});
|
||||
};
|
||||
const getcompetency = async () => {
|
||||
|
|
@ -1748,7 +1750,7 @@ const postDateTime = async () => {
|
|||
})
|
||||
.then(async (res) => {
|
||||
const result = res.data;
|
||||
date_finish.value = result.finish_date;
|
||||
date_finish.value = result.finish_date;
|
||||
})
|
||||
.catch((e) => {})
|
||||
.finally(async () => {
|
||||
|
|
@ -1764,7 +1766,6 @@ const putData = (id: string) => {
|
|||
|
||||
if (activityDesc !== "" && goalDesc !== "") {
|
||||
return {
|
||||
id: index + 1,
|
||||
activity_desc: activityDesc,
|
||||
goal_desc: goalDesc,
|
||||
};
|
||||
|
|
@ -1773,7 +1774,6 @@ const putData = (id: string) => {
|
|||
}
|
||||
});
|
||||
const know_ledge = knowledge.value.map((item) => ({
|
||||
id: item ? item.id : null,
|
||||
level: item ? item.level : null,
|
||||
}));
|
||||
|
||||
|
|
@ -1783,7 +1783,6 @@ const putData = (id: string) => {
|
|||
|
||||
if (outputDesc !== "" && indicatorDesc !== "") {
|
||||
return {
|
||||
id: index + 1,
|
||||
output_desc: outputDesc,
|
||||
indicator_desc: indicatorDesc,
|
||||
};
|
||||
|
|
@ -1793,34 +1792,22 @@ const putData = (id: string) => {
|
|||
});
|
||||
|
||||
const allGroup = [];
|
||||
if (group.value)
|
||||
allGroup.push({ id: group.value.id, level: group.value.level });
|
||||
if (group2.value)
|
||||
allGroup.push({ id: group2.value.id, level: group2.value.level });
|
||||
if (group3.value)
|
||||
allGroup.push({ id: group3.value.id, level: group3.value.level });
|
||||
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({ id: skill.value.id, level: skill.value.level });
|
||||
if (skill2.value)
|
||||
allSkills.push({ id: skill2.value.id, level: skill2.value.level });
|
||||
if (skill3.value)
|
||||
allSkills.push({ id: skill3.value.id, level: skill3.value.level });
|
||||
if (skill4.value)
|
||||
allSkills.push({ id: skill4.value.id, level: skill4.value.level });
|
||||
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({ id: skill.value.id, level: main.value.level });
|
||||
if (main2.value)
|
||||
allCompetency.push({ id: main2.value.id, level: main2.value.level });
|
||||
if (main3.value)
|
||||
allCompetency.push({ id: main3.value.id, level: main3.value.level });
|
||||
if (main4.value)
|
||||
allCompetency.push({ id: main4.value.id, level: main4.value.level });
|
||||
if (main5.value)
|
||||
allCompetency.push({ id: main5.value.id, level: main5.value.level });
|
||||
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 = [
|
||||
{
|
||||
|
|
@ -1844,12 +1831,10 @@ const putData = (id: string) => {
|
|||
personalId: 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,
|
||||
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,
|
||||
|
|
@ -1863,12 +1848,11 @@ const putData = (id: string) => {
|
|||
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(),
|
||||
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(),
|
||||
fullname_foot: fullnameFoot.value,
|
||||
position_foot: positionFoot.value,
|
||||
// caretaker_foot: caretakerFoot.value,
|
||||
// caretaker_foot2: caretakerFoot2.value,
|
||||
assign_law: checkRule.value
|
||||
|
|
@ -1879,6 +1863,7 @@ const putData = (id: string) => {
|
|||
})),
|
||||
};
|
||||
console.log("test", data);
|
||||
|
||||
};
|
||||
|
||||
const saveData = (id: string) => {
|
||||
|
|
@ -1892,13 +1877,15 @@ const saveData = (id: string) => {
|
|||
const: "negative",
|
||||
},
|
||||
})
|
||||
.onOk(async () => {
|
||||
.onOk(() => {
|
||||
const data = putData(id);
|
||||
await http
|
||||
http
|
||||
.post(config.API.saveFinish(id), data)
|
||||
.then(async (res) => {})
|
||||
.then((res) => {
|
||||
console.log("🚀 ~ file: FormAssign.vue:1887 ~ .then ~ res:", res);
|
||||
})
|
||||
.catch((e) => {})
|
||||
.finally(async () => {
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue