จัดโค้ด

This commit is contained in:
setthawutttty 2023-11-15 10:53:26 +07:00
parent 72373a1259
commit c5168bd87a
3 changed files with 34 additions and 12 deletions

View file

@ -25,6 +25,7 @@ const {
dateToISO,
dialogConfirm,
} = mixin;
const route = useRoute();
const assignId = ref<string>(route.params.form.toString());
const { assign } = probationStore;
@ -42,6 +43,7 @@ const apply_level = ref<number>(0);
const success_level = ref<number>(0);
const etc = ref<any>(false);
const achievement_other = ref<any>({ text: "", level: 0 });
// part 2
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
@ -50,11 +52,13 @@ const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
const behavio_strength_desc = ref<string>("");
const behavior_improve_desc = ref<string>("");
// part 3
const orientation = ref<any>(null);
const self_learning = ref<any>(null);
const training_seminar = ref<any>(null);
const other_training = ref<any>(null);
//rules
const behavio_strengthRef = ref<any>(null);
const person = ref<any>([]);

View file

@ -40,8 +40,7 @@ const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date());
const option = ref<any>([]);
// part 1
/** part 1 */
const skill_level = ref<number>(0);
const competency_level = ref<number>(0);
const learn_level = ref<number>(0);
@ -49,7 +48,8 @@ const apply_level = ref<number>(0);
const success_level = ref<number>(0);
const etc = ref<any>(false);
const achievement_other = ref<any>({ text: "", level: 0 });
// part 2
/** part 2 */
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
@ -70,7 +70,11 @@ const list2_1 = probationStore.behavior_no1;
const list2_2 = probationStore.behavior_no2;
const list2_3 = probationStore.behavior_no3;
const fecthAssign = async (id: string) => {
/**
* get ประเม
* @param id
*/
async function fecthAssign(id: string){
showLoader();
await http
.get(config.API.evaluateCreate(id))
@ -95,7 +99,7 @@ const fecthAssign = async (id: string) => {
});
};
// part 3
/** part 3 */
const alerts = Array(20)
.fill(null)
.map(() => ref<boolean>(false));
@ -110,8 +114,8 @@ const lengthdiscipline_level = computed(() => {
return discipline_level.value.filter((item: number) => item !== 0).length;
});
//rules
/** rules */
const behavio_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
@ -190,7 +194,8 @@ const savaForm = () => {
}
};
const putformData = () => {
/** ฟังชั่น post data*/
function putformData(){
const data = {
evaluate_no: evaluate_no.value,
start_date: start_date.value,
@ -236,11 +241,13 @@ const putformData = () => {
});
};
const getBordered = (i: boolean) => {
/** ฟังชั่น คลาส css*/
function getBordered(i: boolean){
return {
border_custom: i,
};
};
variablesToWatch.forEach((variable, index) => {
watch(variable, (item: any) => {
if (item !== 0) {
@ -256,21 +263,25 @@ ArrayCountbotton.forEach((variable, index) => {
}
});
});
watch(lengthconduct, (newLength) => {
if (newLength === 4) {
alerts[6].value = false;
}
});
watch(lengthmoral_level, (newLength) => {
if (newLength === 3) {
alerts[7].value = false;
}
});
watch(lengthdiscipline_level, (newLength) => {
if (newLength === 5) {
alerts[8].value = false;
}
});
onMounted(async () => {
fecthAssign(assignId.value);
});
@ -296,12 +307,12 @@ onMounted(async () => {
</div>
</q-toolbar>
<q-separator />
<q-card-section>
<div class="row col-12 no-margin q-px-md q-pt-sm">
<div class="toptitle text-dark col-12 row items-center">
<div>แบบประเมนผล (งคบบญชา)</div>
</div>
<div class="row col-12 q-gutter-lg">
<div class="col-12 row">
<div class="col-12 text-top0 row items-center">
@ -310,19 +321,22 @@ onMounted(async () => {
ทดลองปฏหนาทราชการ {{ person.name }}
</div>
<div class="col-12 q-pl-md q-pb-md">
<!-- <div class="col-12"><span class="text-top0 q-pl-sm">ตำแหน</span> {{ person.Position }}</div> -->
<div class="col-12">
<span class="text-top0 q-pl-sm">ตำแหนงในสายงาน</span>
{{ person.PositionLineName }}
</div>
<div class="col-12">
<span class="text-top0 q-pl-sm">ระด</span>
{{ person.PositionLevelName }}
</div>
<div class="col-12">
<span class="text-top0 q-pl-sm">งก</span> {{ person.Oc }}
</div>
</div>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
การทดลองปฎหนาทราชการ<span class="text-primary q-pr-sm">{{
"ครั้งที่ " + assign.round_no
@ -336,6 +350,7 @@ onMounted(async () => {
date2Thai(assign.date_finish)
}}</span>
</div>
<div class="col-12 text-top0 row items-center">
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
ประเมนผล
@ -343,6 +358,7 @@ onMounted(async () => {
"ครั้งที่ " + round
}}</span>
</div>
<div class="col-12 text-top0 row items-center">
<div class="col-6 q-px-sm">
<datepicker
@ -383,6 +399,7 @@ onMounted(async () => {
</template>
</datepicker>
</div>
<div class="col-6 q-px-sm">
<datepicker
menu-class-name="modalfix"
@ -423,6 +440,7 @@ onMounted(async () => {
</datepicker>
</div>
</div>
<div class="col-12 q-pt-md">
<q-separator size="3px" color="grey-2" />
</div>

View file

@ -52,8 +52,8 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () =>
// filter options
const complainantoptionsMain = ref<DataOption[]>([
{ id: "0", name: "บุคคล" },
{ id: "1", name: "หน่ยงาน" },
{ id: "2", name: "กรุงเทพมานคร" },
{ id: "1", name: "หน่ยงาน" },
{ id: "2", name: "กรุงเทพานคร" },
]);
const complainantoptions = ref<DataOption[]>(complainantoptionsMain.value)
const agencytoptionsMain = ref<DataOption[]>([