ข้อมูลหลัก => รายการข้อมูลเครื่องราชอิสริยาภรณ์ => fix bug
This commit is contained in:
parent
2fc79f2c63
commit
c83df20a60
1 changed files with 106 additions and 96 deletions
|
|
@ -158,6 +158,10 @@ const visibleColumns = ref<string[]>([
|
||||||
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
dialog.value = false;
|
dialog.value = false;
|
||||||
|
name.value = "";
|
||||||
|
isActive.value = false;
|
||||||
|
shortName.value = "";
|
||||||
|
note.value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateForm() {
|
function validateForm() {
|
||||||
|
|
@ -210,7 +214,7 @@ async function addData() {
|
||||||
name: name.value,
|
name: name.value,
|
||||||
isActive: isActive.value,
|
isActive: isActive.value,
|
||||||
shortName: shortName.value,
|
shortName: shortName.value,
|
||||||
note: note.value == "" ? "-" : note.value,
|
note: note.value == "" || note.value == null ? "" : note.value,
|
||||||
insigniaTypeId: id.value,
|
insigniaTypeId: id.value,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
@ -226,12 +230,14 @@ async function addData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editData(idData: string) {
|
async function editData(idData: string) {
|
||||||
|
console.log(note.value);
|
||||||
|
|
||||||
await http
|
await http
|
||||||
.put(config.API.insigniaNewIdOrg(idData), {
|
.put(config.API.insigniaNewIdOrg(idData), {
|
||||||
name: name.value,
|
name: name.value,
|
||||||
isActive: isActive.value,
|
isActive: isActive.value,
|
||||||
shortName: shortName.value,
|
shortName: shortName.value,
|
||||||
note: note.value == "" ? "-" : note.value,
|
note: note.value == "" || note.value == null ? "" : note.value,
|
||||||
insigniaTypeId: id.value,
|
insigniaTypeId: id.value,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
@ -403,101 +409,105 @@ const dialogOrder = ref<boolean>(false);
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
|
|
||||||
<q-dialog v-model="dialog" class="dialog" persistent>
|
|
||||||
<q-card style="min-width: 350px">
|
|
||||||
<form @submit.prevent="validateForm">
|
|
||||||
<q-card-section class="flex justify-between" style="padding: 0">
|
|
||||||
<dialog-header
|
|
||||||
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
|
|
||||||
:close="closeDialog"
|
|
||||||
/>
|
|
||||||
</q-card-section>
|
|
||||||
|
|
||||||
<q-separator color="grey-4" />
|
|
||||||
<q-card-section class="q-pa-none">
|
|
||||||
<div class="col-12 q-ma-md">
|
|
||||||
<q-input
|
|
||||||
outlined
|
|
||||||
:model-value="insigniaTypeId"
|
|
||||||
label="ลำดับชั้นเครื่องราชฯ"
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
borderless
|
|
||||||
hide-bottom-space
|
|
||||||
readonly
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 q-ma-md">
|
|
||||||
<q-input
|
|
||||||
ref="nameRef"
|
|
||||||
outlined
|
|
||||||
v-model="name"
|
|
||||||
label="ชื่อเครื่องราชฯ"
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
borderless
|
|
||||||
:rules="[
|
|
||||||
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
|
||||||
]"
|
|
||||||
hide-bottom-space
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 q-ma-md">
|
|
||||||
<q-input
|
|
||||||
ref="shortNameRef"
|
|
||||||
outlined
|
|
||||||
v-model="shortName"
|
|
||||||
label="ชื่อย่อ"
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
borderless
|
|
||||||
:rules="[
|
|
||||||
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
|
||||||
]"
|
|
||||||
hide-bottom-space
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 q-ma-md">
|
|
||||||
<q-input
|
|
||||||
outlined
|
|
||||||
v-model="note"
|
|
||||||
label="หมายเหตุ"
|
|
||||||
dense
|
|
||||||
type="textarea"
|
|
||||||
borderless
|
|
||||||
hide-bottom-space
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
|
|
||||||
>
|
|
||||||
<div class="row items-center q-my-sm justify-between">
|
|
||||||
<p class="q-ma-none">สถานะการใช้งาน</p>
|
|
||||||
<label class="toggle-control">
|
|
||||||
<input type="checkbox" dense v-model="isActive" @change="" />
|
|
||||||
<span class="control"></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</q-card-section>
|
|
||||||
|
|
||||||
<q-card-actions align="right">
|
|
||||||
<q-btn
|
|
||||||
id="onSubmit"
|
|
||||||
type="submit"
|
|
||||||
dense
|
|
||||||
unelevated
|
|
||||||
label="บันทึก"
|
|
||||||
color="public"
|
|
||||||
>
|
|
||||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
|
||||||
</q-btn>
|
|
||||||
</q-card-actions>
|
|
||||||
</form>
|
|
||||||
</q-card>
|
|
||||||
</q-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<q-dialog v-model="dialog" class="dialog" persistent>
|
||||||
|
<q-card style="min-width: 350px">
|
||||||
|
<form @submit.prevent="validateForm">
|
||||||
|
<q-card-section class="flex justify-between" style="padding: 0">
|
||||||
|
<dialog-header
|
||||||
|
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
|
||||||
|
:close="closeDialog"
|
||||||
|
/>
|
||||||
|
</q-card-section>
|
||||||
|
|
||||||
|
<q-separator color="grey-4" />
|
||||||
|
<q-card-section class="q-pa-none">
|
||||||
|
<div class="col-12 q-ma-md">
|
||||||
|
<q-input
|
||||||
|
outlined
|
||||||
|
:model-value="insigniaTypeId"
|
||||||
|
label="ลำดับชั้นเครื่องราชฯ"
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
borderless
|
||||||
|
hide-bottom-space
|
||||||
|
readonly
|
||||||
|
class="inputgreen"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 q-ma-md">
|
||||||
|
<q-input
|
||||||
|
ref="nameRef"
|
||||||
|
outlined
|
||||||
|
v-model="name"
|
||||||
|
label="ชื่อเครื่องราชฯ"
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
borderless
|
||||||
|
:rules="[
|
||||||
|
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
||||||
|
]"
|
||||||
|
hide-bottom-space
|
||||||
|
class="inputgreen"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 q-ma-md">
|
||||||
|
<q-input
|
||||||
|
ref="shortNameRef"
|
||||||
|
outlined
|
||||||
|
v-model="shortName"
|
||||||
|
label="ชื่อย่อ"
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
borderless
|
||||||
|
:rules="[
|
||||||
|
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
||||||
|
]"
|
||||||
|
hide-bottom-space
|
||||||
|
class="inputgreen"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 q-ma-md">
|
||||||
|
<q-input
|
||||||
|
outlined
|
||||||
|
v-model="note"
|
||||||
|
label="หมายเหตุ"
|
||||||
|
dense
|
||||||
|
type="textarea"
|
||||||
|
borderless
|
||||||
|
hide-bottom-space
|
||||||
|
class="inputgreen"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
|
||||||
|
>
|
||||||
|
<div class="row items-center q-my-sm justify-between">
|
||||||
|
<p class="q-ma-none">สถานะการใช้งาน</p>
|
||||||
|
<label class="toggle-control">
|
||||||
|
<input type="checkbox" dense v-model="isActive" @change="" />
|
||||||
|
<span class="control"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-card-section>
|
||||||
|
|
||||||
|
<q-card-actions align="right">
|
||||||
|
<q-btn
|
||||||
|
id="onSubmit"
|
||||||
|
type="submit"
|
||||||
|
dense
|
||||||
|
unelevated
|
||||||
|
label="บันทึก"
|
||||||
|
color="public"
|
||||||
|
>
|
||||||
|
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</q-card-actions>
|
||||||
|
</form>
|
||||||
|
</q-card>
|
||||||
|
</q-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue