diff --git a/src/api/05_placement/api.probation.ts b/src/api/05_placement/api.probation.ts new file mode 100644 index 000000000..351a6685a --- /dev/null +++ b/src/api/05_placement/api.probation.ts @@ -0,0 +1,14 @@ +import env from "../index"; +const dataOptions = `${env.API_PROBATION_URI}/data-options`; +const personal = `${env.API_PROBATION_URI}/personal`; + +export default { + competencyOptions: () => `${dataOptions}/competency`, + competencyGroupOptions: () => `${dataOptions}/competency-group`, + knowledgeOptions: () => `${dataOptions}/knowledge`, + skillOptions: () => `${dataOptions}/skill`, + lawOptions: () => `${dataOptions}/law`, + + personalAdd: () => `${personal}/add`, + // clearPosition: (personalId:string) => `${placement}/position/clear/${personalId}` +}; diff --git a/src/api/index.ts b/src/api/index.ts index 4ca191632..660556e1d 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -26,6 +26,7 @@ const config = ref({ "https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230712_172702.json", MEET_URI: "meet.frappet.com", API_RETIREMENT_URI: "https://bma-ehr.frappet.synology.me/api/v1", + API_PROBATION_URI: "http://192.168.1.151:7776/v1", }, test: { API_URI: "http://localhost:5010/api/v1", @@ -70,6 +71,7 @@ const API_RETIREMENT_URI = ref( config.value[env.value].API_RETIREMENT_URI ); const API_URI_ORG_TREE = ref(config.value[env.value].API_URI_ORG_TREE); +const API_PROBATION_URI = ref(config.value[env.value].API_PROBATION_URI); export default { env: env.value, @@ -84,4 +86,5 @@ export default { API_URI_ORG_TREE: API_URI_ORG_TREE.value, MEET_URI: MEET_URI.value, API_RETIREMENT_URI:API_RETIREMENT_URI.value, + API_PROBATION_URI: API_PROBATION_URI.value }; diff --git a/src/app.config.ts b/src/app.config.ts index 5fe96eab7..ef0aa5f39 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -29,6 +29,7 @@ import report2 from "./api/recruiting/api.report2"; /** API ระบบการบรรจุ แต่งตั้ง ย้าย โอน List */ import placement from "./api/05_placement/api.placement"; +import probation from "./api/05_placement/api.probation"; /** API ระบบการพ้นจากราชการ List */ import retirement from "./api/06_retirement/api.retirement"; @@ -70,6 +71,7 @@ const API = { ...report2, ...placement, + ...probation, ...retirement, ...insignia, }; diff --git a/src/modules/05_placement/components/probation/MainProbation.vue b/src/modules/05_placement/components/probation/MainProbation.vue index f28af5a48..8467377f8 100644 --- a/src/modules/05_placement/components/probation/MainProbation.vue +++ b/src/modules/05_placement/components/probation/MainProbation.vue @@ -513,10 +513,10 @@ const fecthOrganiz = async () => { const findlist = async (id: string) => { let data = [ { criteriaType: "is_retire", criteriaValue: "false" }, - { criteriaType: "is_probation", criteriaValue: "true" }, + { criteriaType: "is_probation", criteriaValue: "false" }, ]; await http - .post(config.API.profileSearchNewOcIdType(id, "all"), { + .post(config.API.profileSearchNewOcIdType(id, "officer"), { criterias: data, }) .then((res) => { @@ -557,7 +557,17 @@ const clickAdd = (id: string) => { persistent: true, }) .onOk(async () => { - console.log("เพิ่ม:", id); + const postData = { + personal_id: id, + } + console.log("postData:", postData); + await http + .post(config.API.personalAdd(), postData) + .then((res) => { + console.log("res:", res); + + }); + }) .onCancel(() => {}) .onDismiss(() => {});