แก้ API
This commit is contained in:
parent
d78b7db124
commit
459428979b
12 changed files with 37 additions and 33 deletions
|
|
@ -33,7 +33,8 @@ export default {
|
|||
kpiEvaluation,
|
||||
kpiEvaluationUser,
|
||||
kpiPlan,
|
||||
kpiPlanById: (id: string) => `${kpiPlan}/edit/${id}`,
|
||||
kpiPlanByIdEdit: (id: string) => `${kpiPlan}/edit/${id}`,
|
||||
kpiPlanById: (id: string) => `${kpiPlan}/${id}`,
|
||||
|
||||
/** role */
|
||||
kpiRole,
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ function fetchOrganizationActive() {
|
|||
function fetchTreeStrategy() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.devStrategy)
|
||||
.get(config.API.devStrategy + `/edit`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
nodeplan.value = data;
|
||||
|
|
@ -127,7 +127,7 @@ function fetchTreeAgency(id: string) {
|
|||
function fetchDataById(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.kpiPlanById(id))
|
||||
.get(config.API.kpiPlanByIdEdit(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
year.value = Number(data.year);
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ function selectAgency() {
|
|||
/** บันทึกข้อมูล */
|
||||
function onSubmit() {
|
||||
const url = id.value
|
||||
? config.API.kpiRoleMainEdit + `/${id.value}`
|
||||
? config.API.kpiRoleMainList + `/${id.value}`
|
||||
: config.API.kpiRoleMainList;
|
||||
|
||||
const body = {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ async function fetchData() {
|
|||
await http
|
||||
.get(
|
||||
config.API.kpiGroup +
|
||||
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}`
|
||||
`/edit?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}`
|
||||
)
|
||||
.then(async (res) => {
|
||||
total.value = res.data.result.total;
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ async function getData() {
|
|||
http
|
||||
.get(
|
||||
config.API.kpiLink +
|
||||
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}`
|
||||
`/edit?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}`
|
||||
)
|
||||
.then((res) => {
|
||||
total.value = res.data.result.total;
|
||||
|
|
@ -210,7 +210,7 @@ async function onEdit(data: any) {
|
|||
function getDataEdit(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.kpiLink + `/${id}`)
|
||||
.get(config.API.kpiLink + `/edit/${id}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
groupName.value = {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ function onSubmit() {
|
|||
function getData() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.kpiEvaluation)
|
||||
.get(config.API.kpiEvaluation+`/edit`)
|
||||
.then((res) => {
|
||||
dataLevel.value = res.data.result.data;
|
||||
})
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ function onClickDelete(id: string) {
|
|||
dialogRemove($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.kpiSpecial + `/edit/${id}`)
|
||||
.delete(config.API.kpiSpecial + `/${id}`)
|
||||
.then(() => {
|
||||
fetchList();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ const titleDialog = ref<string>("");
|
|||
function fetchDataTree() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.devStrategy)
|
||||
.get(config.API.devStrategy + `/edit`)
|
||||
.then((res) => {
|
||||
const data: DataStrategic[] = res.data.result;
|
||||
nodes.value = data;
|
||||
|
|
@ -154,7 +154,7 @@ function onSubmit() {
|
|||
};
|
||||
try {
|
||||
const method = isStatusEdit.value ? "patch" : "post";
|
||||
await http[method](config.API.devStrategy+`/edit`, formData);
|
||||
await http[method](config.API.devStrategy, formData);
|
||||
fetchDataTree();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
|
|
|
|||
|
|
@ -100,8 +100,8 @@ const roundOp = ref<DataOption[]>([
|
|||
{ id: "OCT", name: "รอบตุลาคม" },
|
||||
]);
|
||||
|
||||
function fetchList() {
|
||||
http
|
||||
async function fetchList() {
|
||||
await http
|
||||
.post(config.API.kpiRoleMainList + `/search-edit`, {
|
||||
// ?page=${formFilter.page}&pageSize=${formFilter.pageSize}&period=${formFilter.round}&position=${formFilter.position}&keyword=${formFilter.keyword}&year=${formFilter.year}
|
||||
keyword: formFilter.keyword,
|
||||
|
|
@ -118,13 +118,13 @@ function fetchList() {
|
|||
total.value = res.data.result.total;
|
||||
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
||||
rows.value = data;
|
||||
hideLoader();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
function onClickAddOrView(status: boolean = false, id: string = "") {
|
||||
|
|
@ -141,7 +141,7 @@ function onClickDelete(id: number) {
|
|||
dialogRemove($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.kpiRoleMainEdit + `/${id}`)
|
||||
.delete(config.API.kpiRoleMainList + `/${id}`)
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
fetchList();
|
||||
|
|
@ -187,9 +187,9 @@ function filterOption(val: any, update: Function) {
|
|||
}
|
||||
|
||||
/** ดึงข้อมูลตำแหน่ง */
|
||||
function getOptions() {
|
||||
async function getOptions() {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.get(config.API.orgSalaryPosition)
|
||||
.then((res) => {
|
||||
const dataOp = res.data.result;
|
||||
|
|
@ -210,13 +210,13 @@ function getOptions() {
|
|||
|
||||
positionMainOp.value.push(...filteredData);
|
||||
positionOp.value.push(...filteredData);
|
||||
hideLoader();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
function setModel(val: string) {
|
||||
|
|
@ -244,8 +244,8 @@ function onClickHistory(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
function getTotal() {
|
||||
http
|
||||
async function getTotal() {
|
||||
await http
|
||||
.post(config.API.indicatorSummary)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ async function fetchAssigned() {
|
|||
|
||||
async function getCriteria() {
|
||||
await http
|
||||
.get(config.API.KpiEvaluationInfo)
|
||||
.get(config.API.KpiEvaluationInfo+`/edit`)
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result.data;
|
||||
dataListCriteria.value = data;
|
||||
|
|
|
|||
|
|
@ -257,10 +257,10 @@ function clickList(id: string, isData: boolean = false) {
|
|||
showLoader();
|
||||
const url =
|
||||
numpage.value === 1
|
||||
? config.API.kpiPlan
|
||||
? config.API.kpiPlan + `/edit`
|
||||
: numpage.value === 2
|
||||
? config.API.kpiRole
|
||||
: config.API.kpiSpecial;
|
||||
? config.API.kpiRole + `/edit`
|
||||
: config.API.kpiSpecial + `/edit`;
|
||||
http
|
||||
.get(`${url}/${id}`)
|
||||
.then((res) => {
|
||||
|
|
@ -341,7 +341,7 @@ function closeDialog() {
|
|||
formFilter.page = 1;
|
||||
formFilter.pageSize = 20;
|
||||
|
||||
isStatusEdit.value = false
|
||||
isStatusEdit.value = false;
|
||||
checkDetail.value = false;
|
||||
}
|
||||
|
||||
|
|
@ -427,7 +427,6 @@ watch(
|
|||
fetchListPlan();
|
||||
isStatusEdit.value && fetchListPlanByid(kpiUserPlannedId.value);
|
||||
checkDetail.value && fetchListPlanByid(kpiUserPlannedId.value);
|
||||
|
||||
} else if (numpage.value === 2) {
|
||||
fetchListRole();
|
||||
isStatusEdit.value && fetchRoleByid(kpiUserPlannedId.value);
|
||||
|
|
@ -992,9 +991,13 @@ const title = computed(() => {
|
|||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator v-if="!checkDetail"/>
|
||||
<q-separator v-if="!checkDetail" />
|
||||
|
||||
<q-card-actions v-if="!checkDetail" align="right" class="bg-white text-teal">
|
||||
<q-card-actions
|
||||
v-if="!checkDetail"
|
||||
align="right"
|
||||
class="bg-white text-teal"
|
||||
>
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ function fetchData() {
|
|||
function fetchTree() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.devStrategy)
|
||||
.get(config.API.devStrategy+`/edit`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
nodes.value = data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue