refactor(PosmasterNo): replace formatPosmasterNo
This commit is contained in:
parent
6b2d1781b0
commit
34f33e57ac
25 changed files with 152 additions and 58 deletions
|
|
@ -5,6 +5,7 @@ import { useQuasar } from "quasar";
|
|||
import { useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational";
|
||||
import { formatPosmasterNo } from "@/utils/function";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -135,11 +136,12 @@ async function fetchTable() {
|
|||
const data = res.data.result.data;
|
||||
const list = data.map((e: PosMaster) => ({
|
||||
...e,
|
||||
posMasterNo:
|
||||
(e.orgShortname !== null ? e.orgShortname : "") +
|
||||
(e.posMasterNoPrefix ? e.posMasterNoPrefix : "") +
|
||||
(e.posMasterNo !== null ? e.posMasterNo : "") +
|
||||
(e.posMasterNoSuffix !== null ? e.posMasterNoPrefix : ""),
|
||||
posMasterNo: formatPosmasterNo(
|
||||
e.orgShortname,
|
||||
e.posMasterNoPrefix,
|
||||
e.posMasterNo.toString(),
|
||||
e.posMasterNoSuffix ?? ""
|
||||
),
|
||||
}));
|
||||
rows.value = list;
|
||||
})
|
||||
|
|
@ -157,7 +159,7 @@ function updatePagination(newPagination: NewPagination) {
|
|||
reqMaster.page = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
funcion ค้นหาข้อมูลใน Table
|
||||
*/
|
||||
async function filterKeyword() {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { useQuasar } from "quasar";
|
|||
import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { updateCurrentPage } from "@/utils/function";
|
||||
import { updateCurrentPage, formatPosmasterNo } from "@/utils/function";
|
||||
import genreport from "@/plugins/genreportxlsx";
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -145,6 +145,13 @@ const columns = ref<QTableProps["columns"]>([
|
|||
label: "ตำแหน่งเลขที่",
|
||||
sortable: false,
|
||||
field: "posMasterNo",
|
||||
format: (val: any, row: any) =>
|
||||
formatPosmasterNo(
|
||||
row.orgShortname,
|
||||
row.posMasterNoPrefix,
|
||||
row.posMasterNoMain,
|
||||
row.posMasterNoSuffix
|
||||
),
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -80,6 +80,10 @@ export const usePositionEmp = defineStore("positionEmpStore", () => {
|
|||
posLevelName: e.isSit ? e.profilePoslevel : e.posLevelName,
|
||||
posExecutiveName: e.posExecutiveName,
|
||||
isSit: e.isSit,
|
||||
orgShortname: e.orgShortname,
|
||||
posMasterNoPrefix: e.posMasterNoPrefix,
|
||||
posMasterNoMain: e.posMasterNo,
|
||||
posMasterNoSuffix: e.posMasterNoSuffix,
|
||||
}));
|
||||
|
||||
return newPosMaster;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue