update workflow
This commit is contained in:
parent
7daa163b55
commit
f0061b18c2
4 changed files with 34 additions and 25 deletions
|
|
@ -38,28 +38,19 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
name: "posExecutiveName",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
label: "ตำแหน่งทางการบริหาร",
|
||||
sortable: true,
|
||||
field: "position",
|
||||
field: "posExecutiveName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
// {
|
||||
// name: "posType",
|
||||
// align: "left",
|
||||
// label: "ประเภทตำแหน่ง",
|
||||
// sortable: true,
|
||||
// field: "posType",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
{
|
||||
name: "organization",
|
||||
name: "actFullName",
|
||||
align: "left",
|
||||
label: "สังกัด",
|
||||
field: "organization",
|
||||
label: "รักษาการ",
|
||||
field: "actFullName",
|
||||
sortable: true,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -218,7 +209,11 @@ watch(modal, (val) => {
|
|||
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
label="ส่งไปยังผู้บังคับบัญชา/ผู้มีอำนาจ"
|
||||
:label="
|
||||
props.type === 'operate'
|
||||
? 'ส่งไปยังผู้บังคับบัญชา'
|
||||
: 'ส่งไปยังผู้มีอำนาจ'
|
||||
"
|
||||
color="public"
|
||||
type="submit"
|
||||
:disable="
|
||||
|
|
|
|||
|
|
@ -22,6 +22,12 @@ const isCheckData = defineModel<boolean>("isCheckData", {
|
|||
const props = defineProps({
|
||||
id: { type: String, require: true },
|
||||
sysName: { type: String, require: true },
|
||||
onUpdateStatus: {
|
||||
type: Function,
|
||||
defult: () => {
|
||||
console.log("No Function");
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const stateId = ref<string>(""); //id state ปัจุบัน
|
||||
|
|
@ -36,6 +42,7 @@ const permission = ref<Permission>({
|
|||
isUpdate: false, //แก้ไขเอกสารได้
|
||||
isDelete: false, //ลบเอกสารได้ (ถ้ามี)
|
||||
isCancel: false, //ลบเอกสารได้ (ถ้ามี)
|
||||
isSign: false,
|
||||
});
|
||||
const itemState = ref<DataListState[]>([]);
|
||||
|
||||
|
|
@ -68,6 +75,7 @@ async function fetchCheckState() {
|
|||
isUpdate: data.can_update,
|
||||
isDelete: data.can_delete,
|
||||
isCancel: data.can_cancel,
|
||||
isSign: data.can_sign,
|
||||
};
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
@ -100,6 +108,12 @@ function onChangeState() {
|
|||
})
|
||||
.then(async () => {
|
||||
await fetchCheckState();
|
||||
if (
|
||||
props.sysName === "PLACEMENT_TRANSFER" &&
|
||||
state.value === itemState.value.length - 1
|
||||
) {
|
||||
props.onUpdateStatus?.();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -212,23 +226,21 @@ defineExpose({
|
|||
</q-list>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="permission.isOperate && state === index + 1"
|
||||
class="row q-gutter-x-sm"
|
||||
>
|
||||
<div v-if="state === index + 1" class="row q-gutter-x-sm">
|
||||
<q-btn
|
||||
v-if="permission.isOperate"
|
||||
@click.prevent="
|
||||
(modalSelectPerson = true), (typeSelectPerson = 'operate')
|
||||
"
|
||||
label="ส่งไปผู้บังคับบัญชา"
|
||||
label="ส่งยังไปผู้บังคับบัญชา"
|
||||
color="public"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
v-if="permission.isSign"
|
||||
@click.prevent="
|
||||
(modalSelectPerson = true), (typeSelectPerson = 'sign')
|
||||
"
|
||||
label="ผู้มีอำนาจ"
|
||||
label="ส่งไปยังผู้มีอำนาจ"
|
||||
color="public"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ interface Permission {
|
|||
isUpdate: boolean; //แก้ไขเอกสารได้
|
||||
isDelete: boolean; //ลบเอกสารได้ (ถ้ามี)
|
||||
isCancel: boolean; //ลบเอกสารได้ (ถ้ามี)
|
||||
isSign: boolean;
|
||||
}
|
||||
|
||||
export type { Permission };
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ async function fileDownload(no: number, type: string, fileName: string) {
|
|||
}
|
||||
|
||||
/** ฟังก์ชันยืนยันการส่งคำร้องไปยัง สกจ.*/
|
||||
function confirmMessage() {
|
||||
function onUpdateStatus() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
|
|
@ -236,7 +236,7 @@ function confirmMessage() {
|
|||
.get(config.API.transferConfirmId(transferId.value))
|
||||
.then(async () => {
|
||||
await getData();
|
||||
success($q, "ส่งคำร้องข้อมูลสำเร็จ");
|
||||
// success($q, "ส่งคำร้องข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -697,6 +697,7 @@ onMounted(async () => {
|
|||
v-model:is-check-data="isCheckData"
|
||||
:id="transferId"
|
||||
:sys-name="'PLACEMENT_TRANSFER'"
|
||||
:onUpdateStatus="onUpdateStatus"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue