fix bug แก้ไขอัตรากำลัง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-08-15 13:10:36 +07:00
parent ecb8366e4d
commit da1bd5d937
2 changed files with 123 additions and 52 deletions

View file

@ -71,6 +71,8 @@ const personalId = ref<string>(""); //ตัวแปร id ข้อมูล
const modalSelectPerson = ref<boolean>(false); //
const rowId = ref<string>(""); //id
const actionType = ref<string>(""); //
const orgShortName = ref<string>(""); //
const orgRootIdMain = ref<string>(""); //Id
/** ListMenu Table*/
const listMenu = ref<ListMenu[]>([
{
@ -285,7 +287,12 @@ const dialogPosition = ref<boolean>(false); //ตำแหน่ง
* @param type ประเภท
* @param id id
*/
function onClickPosition(type: string, id: string) {
function onClickPosition(
type: string,
id: string,
data: PosMaster2 = {} as PosMaster2
) {
orgShortName.value = type === "EDIT" ? data?.orgShortname : "";
rowId.value = id ? id : "";
actionType.value = type;
dialogPosition.value = !dialogPosition.value;
@ -296,7 +303,12 @@ function onClickPosition(type: string, id: string) {
* @param type ประเภทการกระทำ
* @param id id องการกระทำ
*/
function onClickCopyPosition(type: string, id: string) {
function onClickCopyPosition(
type: string,
id: string,
data: PosMaster2 = {} as PosMaster2
) {
orgShortName.value = data?.orgShortname;
rowId.value = id ? id : "";
actionType.value = type;
dialogPosition.value = !dialogPosition.value;
@ -723,7 +735,7 @@ watch(
v-close-popup
@click="
item.type === 'EDIT'
? onClickPosition('EDIT', props.row.id)
? onClickPosition('EDIT', props.row.id, props.row)
: item.type === 'DEL'
? onClickDelete(props.row.id)
: item.type === 'MOVE'
@ -733,7 +745,7 @@ watch(
: item.type === 'INHERIT'
? onClickInherit(props.row.id)
: item.type === 'COPY'
? onClickCopyPosition('COPY', props.row.id)
? onClickCopyPosition('COPY', props.row.id, props.row)
: item.type === 'CONDITION'
? onClickCodition(props.row)
: null
@ -962,6 +974,7 @@ watch(
:modal="dialogPosition"
:data-tree="mainTree"
:shortName="shortName"
:orgShortName="orgShortName"
:close="onClickPosition"
:orgLevel="orgLevel"
:treeId="treeId"