update funtion

This commit is contained in:
kamoa457 2023-11-05 18:10:47 +07:00
parent c6dae715b4
commit a4a19face5
4 changed files with 167 additions and 106 deletions

View File

@ -11,7 +11,9 @@
{ {
"label": "นางสาว", "label": "นางสาว",
"value": "นางสาว" "value": "นางสาว"
}, }
],
"ranks2": [
{ {
"label": "ส.ต.ต.", "label": "ส.ต.ต.",
"value": "ส.ต.ต." "value": "ส.ต.ต."
@ -51,7 +53,9 @@
{ {
"label": "ด.ต.หญิง", "label": "ด.ต.หญิง",
"value": "ด.ต.หญิง" "value": "ด.ต.หญิง"
}, }
],
"ranks3": [
{ {
"label": "ร.ต.ต.", "label": "ร.ต.ต.",
"value": "ร.ต.ต." "value": "ร.ต.ต."
@ -154,16 +158,8 @@
], ],
"Affiliation": [ "Affiliation": [
{ {
"label": "ลูกจ้าง", "label": "บก.อก.",
"value": "ลูกจ้าง" "value": "บก.อก."
},
{
"label": "บช.ตซด.",
"value": "บช.ตซด."
},
{
"label": "บช.อก.",
"value": "บช.อก."
}, },
{ {
"label": "ฝอ.1", "label": "ฝอ.1",
@ -196,10 +192,12 @@
{ {
"label": "ฝอ.8", "label": "ฝอ.8",
"value": "ฝอ.8" "value": "ฝอ.8"
}, }
],
"Affiliation2": [
{ {
"label": "บช.สสน.", "label": "บก.สนน.",
"value": "บ.สสน." "value": "บ.สสน."
}, },
{ {
"label": "ฝสสน.1", "label": "ฝสสน.1",
@ -327,5 +325,37 @@
"roomnumber": "12,13", "roomnumber": "12,13",
"type": "ช.2" "type": "ช.2"
} }
],
"typeranks": [
{
"label": "ทั่วไป",
"value": "ทั่วไป"
},
{
"label": "ประทวน",
"value": "ประทวน"
},
{
"label": "สัญญาบัตร",
"value": "สัญญาบัตร"
}
],
"typeAffiliation": [
{
"label": "ลูกจ้าง",
"value": "ลูกจ้าง"
},
{
"label": "บช.ตซด.",
"value": "บช.ตซด."
},
{
"label": "บก.อก.",
"value": "บก.อก."
},
{
"label": "บก.สนน.",
"value": "บก.สนน."
}
] ]
} }

View File

@ -82,6 +82,7 @@ export default {
rank: "", // rank: "", //
idcard: "", idcard: "",
phone: "", phone: "",
booknumber: ""
}; };
}, },
watch: { watch: {
@ -166,8 +167,8 @@ export default {
<div class="d-flex align-items-baseline"> <div class="d-flex align-items-baseline">
<label style="margin-right: 20px">นหาช </label> <label style="margin-right: 20px">นหาช </label>
<MaterialInput <MaterialInput
style="margin-right: 20px; width:300px" style="margin-right: 20px; width: 300px"
class="input-group-dynamic " class="input-group-dynamic"
icon="search" icon="search"
type="text" type="text"
placeholder="Search" placeholder="Search"
@ -237,6 +238,17 @@ export default {
<label>อผเช</label> <label>อผเช</label>
<v-select :options="options" v-model="selectedColor"></v-select> <v-select :options="options" v-model="selectedColor"></v-select>
</div> </div>
<div class="mb-3">
<label style="margin-left: -5px">กรอกเลขลงรบหนงส</label>
<textarea
:value="booknumber"
@input="(event) => (booknumber = event.target.value)"
class="form-control"
id="exampleFormControlTextarea1"
rows="3"
placeholder="ตัวอย่าง : 11244"
></textarea>
</div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">

View File

@ -293,17 +293,7 @@ export default {
placeholder="จำนวนงวดเงินค่าประกัน" placeholder="จำนวนงวดเงินค่าประกัน"
/> />
</div> </div>
<div class="mb-3">
<label style="margin-left:-5px">กรอกเลขลงรบหนงส</label>
<textarea
:value="booknumber"
@input="(event) => (booknumber = event.target.value)"
class="form-control"
id="exampleFormControlTextarea1"
rows="3"
placeholder="ตัวอย่าง : 11244"
></textarea>
</div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
@ -489,57 +479,7 @@ export default {
</div> </div>
</div> </div>
<!-- modal -->
<div
class="modal fade"
id="addBookBackdrop"
data-bs-backdrop="static"
data-bs-keyboard="false"
tabindex="-1"
aria-labelledby="staticBackdropLabel"
aria-hidden="true"
>
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="staticBackdropLabel">เพมเลขลงรบหนงส</h5>
<button
type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"
></button>
</div>
<div class="modal-body">
<div>
<div class="mb-3">
<label style="margin-left:-5px">กรอกเลขลงรบหนงส</label>
<textarea
:value="booknumber"
@input="(event) => (booknumber = event.target.value)"
class="form-control"
id="exampleFormControlTextarea1"
rows="3"
placeholder="ตัวอย่าง : 11244"
></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
ดหนาตาง
</button>
<MaterialButton
variant="gradient"
color="success"
@click="submitForm"
html-type="submit"
>นท</MaterialButton
>
</div>
</div>
</div>
</div>
</section> </section>
</template> </template>
<style> <style>

View File

@ -93,6 +93,8 @@ export default {
selectedRanks: "ส.ต.ต.", selectedRanks: "ส.ต.ต.",
selectedAffiliation: "ฝอ.2", selectedAffiliation: "ฝอ.2",
birthday: "14/07/2534", birthday: "14/07/2534",
typeAffiliation: "ทั่วไป",
typeRanks: "ประทวน",
}; };
}, },
created() { created() {
@ -103,6 +105,20 @@ export default {
// this.updateColor(newValue) // this.updateColor(newValue)
console.log(newValue); console.log(newValue);
}, },
typeAffiliation: function (newValue) {
// this.updateColor(newValue)
console.log(newValue);
// if(newValue != undefined){
// this.typeAffiliation = newValue.value
// }
},
typeRanks: function (newValue) {
// this.updateColor(newValue)
console.log(newValue);
// if(newValue != undefined){
// this.typeRanks = newValue.value
// }
},
}, },
methods: { methods: {
changedLabel(event) { changedLabel(event) {
@ -176,7 +192,6 @@ export default {
/> />
<label class="form-check-label" for="inlineRadio2">บช.ตชด.</label> <label class="form-check-label" for="inlineRadio2">บช.ตชด.</label>
</div> </div>
</div> </div>
<div class="d-flex align-items-baseline"> <div class="d-flex align-items-baseline">
<label style="margin-right: 10px">นหาช </label> <label style="margin-right: 10px">นหาช </label>
@ -199,27 +214,27 @@ export default {
</div> </div>
<div> <div>
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<label style="margin-right: 20px">ยศ</label> <label style="margin-right: 20px">ยศ</label>
<input <input
class="form-check-input" class="form-check-input"
type="radio" type="radio"
name="inlineRadioOptions1" name="inlineRadioOptions1"
id="inlineRadio3" id="inlineRadio3"
value="Radio3" value="Radio3"
checked checked
/> />
<label class="form-check-label" for="inlineRadio3">ประทวน</label> <label class="form-check-label" for="inlineRadio3">ประทวน</label>
</div> </div>
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input <input
class="form-check-input" class="form-check-input"
type="radio" type="radio"
name="inlineRadioOptions1" name="inlineRadioOptions1"
id="inlineRadio4" id="inlineRadio4"
value="Radio4" value="Radio4"
/> />
<label class="form-check-label" for="inlineRadio4">ญญาบตร</label> <label class="form-check-label" for="inlineRadio4">ญญาบตร</label>
</div> </div>
</div> </div>
<div class="text-center pt-4 table-responsive"> <div class="text-center pt-4 table-responsive">
<table class="table border border-2 border-success"> <table class="table border border-2 border-success">
@ -286,18 +301,50 @@ export default {
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div> <div>
<div class="mb-3"> <div class="mb-1">
<label>งก</label> <label>งก</label>
<v-select
:options="masterData?.typeAffiliation"
v-model="typeAffiliation"
></v-select>
</div>
<div class="mb-3" v-if="typeAffiliation.label == 'บก.อก.'">
<label>งก {{ typeAffiliation.label }}</label>
<v-select <v-select
:options="masterData?.Affiliation" :options="masterData?.Affiliation"
v-model="selectedAffiliation" v-model="selectedAffiliation"
></v-select> ></v-select>
</div> </div>
<div class="mb-3"> <div class="mb-3" v-if="typeAffiliation.label == 'บก.สนน.'">
<label>งก {{ typeAffiliation.label }}</label>
<v-select
:options="masterData?.Affiliation2"
v-model="selectedAffiliation"
></v-select>
</div>
<div class="mb-1">
<label>ยศ</label> <label>ยศ</label>
<v-select :options="masterData?.typeranks" v-model="typeRanks"></v-select>
</div>
<div class="mb-3" v-if="typeRanks.label == 'ทั่วไป'">
<label> {{ typeRanks.label }}</label>
<v-select :options="masterData?.ranks" v-model="selectedRanks"></v-select> <v-select :options="masterData?.ranks" v-model="selectedRanks"></v-select>
</div> </div>
<div class="mb-3"> <div class="mb-3" v-if="typeRanks.label == 'ประทวน'">
<label> {{ typeRanks.label }}</label>
<v-select
:options="masterData?.ranks2"
v-model="selectedRanks"
></v-select>
</div>
<div class="mb-3" v-if="typeRanks.label == 'สัญญาบัตร'">
<label> {{ typeRanks.label }}</label>
<v-select
:options="masterData?.ranks3"
v-model="selectedRanks"
></v-select>
</div>
<div class="mb-3 pt-1">
<MaterialInput <MaterialInput
name="firstName" name="firstName"
:value="firstName" :value="firstName"
@ -383,17 +430,49 @@ export default {
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div> <div>
<div class="mb-3"> <div class="mb-1">
<label>งก</label> <label>งก</label>
<v-select
:options="masterData?.typeAffiliation"
v-model="typeAffiliation"
></v-select>
</div>
<div class="mb-3" v-if="typeAffiliation.label == 'บก.อก.'">
<label>งก {{ typeAffiliation.label }}</label>
<v-select <v-select
:options="masterData?.Affiliation" :options="masterData?.Affiliation"
v-model="selectedAffiliation" v-model="selectedAffiliation"
></v-select> ></v-select>
</div> </div>
<div class="mb-3"> <div class="mb-3" v-if="typeAffiliation.label == 'บก.สนน.'">
<label>งก {{ typeAffiliation.label }}</label>
<v-select
:options="masterData?.Affiliation2"
v-model="selectedAffiliation"
></v-select>
</div>
<div class="mb-1">
<label>ยศ</label> <label>ยศ</label>
<v-select :options="masterData?.typeranks" v-model="typeRanks"></v-select>
</div>
<div class="mb-3" v-if="typeRanks.label == 'ทั่วไป'">
<label> {{ typeRanks.label }}</label>
<v-select :options="masterData?.ranks" v-model="selectedRanks"></v-select> <v-select :options="masterData?.ranks" v-model="selectedRanks"></v-select>
</div> </div>
<div class="mb-3" v-if="typeRanks.label == 'ประทวน'">
<label> {{ typeRanks.label }}</label>
<v-select
:options="masterData?.ranks2"
v-model="selectedRanks"
></v-select>
</div>
<div class="mb-3" v-if="typeRanks.label == 'สัญญาบัตร'">
<label> {{ typeRanks.label }}</label>
<v-select
:options="masterData?.ranks3"
v-model="selectedRanks"
></v-select>
</div>
<div class="mb-3"> <div class="mb-3">
<MaterialInput <MaterialInput
name="firstName" name="firstName"