<template>
    <v-layout>
        <v-flex xs12>
            <v-card class="mb-2" color="white">
                <v-toolbar color="blue lighten-3" dark height="50px">
                    <v-toolbar-title>JENIS BIDANG USAHA</v-toolbar-title>
                    <v-spacer></v-spacer>
                    <v-btn @click="openFormCompanyBusiness(0)" icon>
                        <v-icon>library_add</v-icon>
                    </v-btn>
                </v-toolbar>
                <v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
                    <v-list-tile>
                        <input type="text" v-model="xsearch" class="textinput" label="Nama Station" placeholder="Cari ..." />
                        </v-list-tile-content>
                    </v-list-tile>
                </v-layout>
                <v-divider></v-divider>
                <v-layout row wrap class="scroll-container" style="max-height:600px;overflow: auto;">
                    <v-flex xs12 pl-2 pr-2 pt-2 pb-2>
                        <v-data-table :headers="headers" :items="companybusinesss" :loading="isLoading" hide-actions class="elevation-1">
                            <template slot="items" slot-scope="props">
                                <td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.M_CompanyBusinessName}}</td>
                                    <td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
                                        <v-icon small class="ml-3" color="primary" @click="editFormCompanyBusiness(props.item)">edit</v-icon>
                                        <v-icon small :disabled="props.item.used != 0" class="ml-3" color="error" @click="deleteFormCompanyBusiness(props.item)">clear</v-icon>
                                    </td>
                            </template>
                        </v-data-table>
                    </v-flex>
                </v-layout>
                <v-divider></v-divider>
               
                <template>
                    <v-layout row justify-center>
                        <v-dialog v-model="dialogcompanybusiness" persistent max-width="850px">
                            <v-card>
                                <v-card-title>
                                    <span class="headline">FORM JENIS BIDANG USAHA</span>
                                </v-card-title>
                                <v-card-text class="pt-0 pb-0">
                                    <v-form ref="formcompanytypecompanybusiness" v-model="valid" lazy-validation>
                                <v-layout wrap>
                                    <v-flex xs12>
                                        <v-text-field v-model="xname" label="Nama*" :rules="xnameRules" required></v-text-field>
                                    </v-flex>
                                    <v-flex>
                                        <p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
                                    </v-flex>
                                </v-layout>
                                </v-card-text>
                                <v-card-actions>
                                    <v-spacer></v-spacer>
                                    
                                    <v-btn color="blue darken-1" flat @click="updateDialogFormCompanyBusiness()">Tutup</v-btn>
                               
                                    <v-btn color="blue darken-1" flat @click="saveFormCompanyBusiness()">Simpan</v-btn>
     </v-card-actions>
                                </v-form>
                            </v-card>
                        </v-dialog>
                    </v-layout>
                </template>

            </v-card>
        </v-flex>

        <one-dialog-print :title="printtitle" :width="printwidth" :height="500" :status="openprint" :urlprint="urlprint" @close-dialog-print="closePrint"></one-dialog-print>
        <template>

            <v-dialog v-model="dialogdeletealertcompanybusiness" max-width="30%">
                <v-card>
                    <v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
                        Peringatan !
                    </v-card-title>
                    <v-card-text class="pt-2 pb-2">
                        <v-layout row>
                            <v-flex xs12 d-flex>
                                <v-layout row>
                                    <v-flex pb-1 xs12>
                                        <v-layout row>
                                            <v-flex pt-2 pr-2 xs12>
                                                {{msgalertcompanybusiness}}
                                            </v-flex>
                                        </v-layout>
                                    </v-flex>
                                </v-layout>
                            </v-flex>
                        </v-layout>
                    </v-card-text>
                    <v-divider></v-divider>
                    <v-card-actions>
                        <v-spacer></v-spacer>
                        <v-btn color="primary" flat @click="dialogdeletealertcompanybusiness = false">
                            Tutup
                        </v-btn>
                        <v-btn color="primary" flat @click="closeDeleteAlertCompanyBusiness()">
                            Yakin lah
                        </v-btn>
                    </v-card-actions>
                </v-card>
            </v-dialog>

        </template>

    </v-layout>
</template>

<style scoped>
    .searchbox .v-input.v-text-field .v-input__slot {
        min-height: 60px;
    }

    .searchbox .v-btn {
        min-height: 60px;
    }

    table.v-table tbody td,
    table.v-table tbody th {
        height: 40px;
    }

    table.v-table thead tr {
        height: 40px;
    }

    .textinput {
        -webkit-transition: width 0.4s ease-in-out;
        transition: width 0.4s ease-in-out;
        background-color: white;
        background-position: 10px 10px;
        background-repeat: no-repeat;
        padding-left: 40px;
        width: 100%;
        padding: 8px 10px;
        margin-bottom: 5px;
        box-sizing: border-box;
        border: 1px solid #607d8b;

    }

    .textinput:focus {
        width: 100%;
    }

    .textinput:focus::-webkit-input-placeholder {
        color: transparent;
    }

    .textinput:focus::-moz-placeholder {
        color: transparent;
    }

    .textinput:-moz-placeholder {
        color: transparent;
    }

    .boxoutline {
        color: red;
        border: 1px solid red;
        justify-content: center;
        height: 45px;
        line-height: 45px;
        padding-left: 10px;
        background: #ffffff;
        font-size: 14px;
        font-weight: 500;
        border-radius: 1px
    }

    .boxoutline:hover {
        background: rgba(0, 0, 0, 0.07) !important;
        font-size: 15px;
        font-weight: 700;
    }

    .boxsolid {
        color: #ffffff;
        border: 1px solid #ffffff;
        justify-content: center;
        height: 45px;
        line-height: 45px;
        padding-left: 10px;
        background: #f44336;
        font-size: 14px;
        font-weight: 500;
        border-radius: 1px
    }

    .boxsolid:hover {
        background: #f44336de;
        font-size: 15px;
        font-weight: 700;
    }

    .scroll-container {
        scroll-padding: 50px 0 0 50px;
    }

    ::-webkit-scrollbar {
        width: 7px;
    }

    /* this targets the default scrollbar (compulsory) */

    ::-webkit-scrollbar-track {
        background-color: #73baf3;
    }

    /* the new scrollbar will have a flat appearance with the set background color */

    ::-webkit-scrollbar-thumb {
        background-color: #2196f3;
    }

    /* this will style the thumb, ignoring the track */

    ::-webkit-scrollbar-button {
        background-color: #0079da;
    }

    /* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */

    ::-webkit-scrollbar-corner {
        background-color: black;
    }

    /* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>

<script>
    module.exports = {
        components: {
            'one-date-picker': httpVueLoader('../../common/oneDatePicker.vue'),
            'one-dialog-print': httpVueLoader('../../common/oneDialogPrintX.vue')
        },
        data() {
            return {
                query: "",
                items: [],
                openprint: false,
                urlprint: '',
                printtitle: '',
                printwidth: 600,
                formatreport: 'pdf',
                readonlydefault: true,
                page: 1,
                xphone: '',
                xcode: '',
                xaddress: '',
                xipaddress: '',
                xbasename: '',
                isdefault: false,
                search_companytype: '',
                search_city: '',
                search_district: '',
                search_kelurahan: '',
                xnameRules: [
                    v => !!v || 'Nama harus diisi'
                ],
                xcodeRules: [
                    v => !!v || 'Kode harus diisi'
                ],
                addressRules: [
                    v => !!v || 'Alamat harus diisi'
                ],
                xipaddressRules: [
                    v => !!v || 'Alamat IP harus diisi'
                ],
                companytypeRules: [
                    v => !!v || 'CompanyType harus dipilih'
                ],
                cityRules: [
                    v => !!v || 'Kota harus dipilih'
                ],
                districtRules: [
                    v => !!v || 'Kecamatan harus dipilih'
                ],
                kelurahanRules: [
                    v => !!v || 'Kelurahan harus dipilih'
                ],
                headers: [{
                        text: "NAMA",
                        align: "left",
                        sortable: false,
                        value: "name",
                        width: "15%",
                        class: "blue lighten-3 white--text"
                    },
                    {
                        text: "AKSI",
                        align: "left",
                        sortable: false,
                        value: "status",
                        width: "10%",
                        class: "blue lighten-3 white--text"
                    }
                ],
                pagination: {
                    descending: false,
                    page: 1,
                    rowsPerPage: 100,
                    sortBy: 'M_CompanyBusinessName ASC',
                    totalItems: this.$store.state.companybusiness.total_transactions
                },
                statuss: [{
                        waktu: '16-07-2019 10:00',
                        status: 'Order Dibuat',
                        companybusiness: 'Nagita Slavina'
                    },
                    {
                        waktu: '16-07-2019 11:00',
                        status: 'Order Dikirim',
                        companybusiness: 'Nagita Slavina'
                    },
                    {
                        waktu: '16-07-2019 12:00',
                        status: 'Order dikonfirmasi',
                        companybusiness: 'Chacha Frederica'
                    },
                    {
                        waktu: '16-07-2019 13:00',
                        status: 'Telah dibuat Surat Jalan',
                        companybusiness: 'Chacha Frederica'
                    },
                    {
                        waktu: '16-07-2019 14:00',
                        status: 'Kurir akan mengambil sampel',
                        companybusiness: 'Satria Subiantoro'
                    }
                ],
                color: "success",
                validcompanybusiness: false,
                xid: 0,
                isinput: "N",
                countprice: 0,
                companybusinesscompanybusinessid: 0,
                companybusinessxname: "",
                companybusinesslang: "",
                companybusinesstext: "",
                isadvance: "N",
                companybusinessformatadvance: "",
                issenttocompanytype: "N",
                menustartdate: false,
                menuenddate: false,
                date: new Date().toISOString().substr(0, 10),

                dialogdeletealertcompanybusiness: false,
                dialogverifyalertcompanybusiness: false,
                dialogreleasealertcompanybusiness: false,
                alertverify: false,
                dialogunreleasealertcompanybusiness: false,
                dialogunverifyalertcompanybusiness: false,
                msgalertcompanybusiness: ""
            };
        },
        mounted() {},
        computed: {
            companybusinesss() {
                return this.$store.state.companybusiness.companybusinesss
            },
            xcompanytype() {
                return this.$store.state.companytype.selected_companytype
            },
            dialogcompanybusiness() {
                return this.$store.state.companybusiness.dialog_form_companybusiness
            },
            xerrors() {
                return this.$store.state.companybusiness.errors
            },
            isLoading() {
                return this.$store.state.companybusiness.search_status == 1
            },
            startComputedDateFormatted() {
                return this.formatDate(this.xstartdate)
            },
            xstartdate: {
                get() {
                    return this.$store.state.companybusiness.startdate
                },
                set(val) {
                    this.$store.commit("companybusiness/update_startdate", val)
                }
            },
            endComputedDateFormatted() {
                return this.formatDate(this.xenddate)
            },
            xenddate: {
                get() {
                    return this.$store.state.companybusiness.enddate
                },
                set(val) {
                    this.$store.commit("companybusiness/update_enddate", val)
                }
            },
            xname: {
                get() {
                    return this.$store.state.companybusiness.name
                },
                set(val) {
                    this.$store.commit("companybusiness/update_name", val)
                }
            },
            xminvalueR: {
                get() {
                    return this.$store.state.companybusiness.minvalueR
                },
                set(val) {
                    this.$store.commit("companybusiness/update_minvalueR", val)
                }
            },
            xmaxvalueR: {
                get() {
                    return this.$store.state.companybusiness.maxvalueR
                },
                set(val) {
                    this.$store.commit("companybusiness/update_maxvalueR", val)
                }
            },
            isminvalueinclusiveR : {
                get() {
                    return this.$store.state.companybusiness.isminvalueinclusiveR
                },
                set(val) {
                    this.$store.commit("companybusiness/update_isminvalueinclusiveR", val)
                }
            },
            ismaxvalueinclusiveR: {
                get() {
                    return this.$store.state.companybusiness.ismaxvalueinclusiveR
                },
                set(val) {
                    this.$store.commit("companybusiness/update_ismaxvalueinclusiveR", val)
                }
            },
            xnoteR : {
                get() {
                    return this.$store.state.companybusiness.noteR
                },
                set(val) {
                    this.$store.commit("companybusiness/update_noteR", val)
                }
            },
            xminvalueS: {
                get() {
                    return this.$store.state.companybusiness.minvalueS
                },
                set(val) {
                    this.$store.commit("companybusiness/update_minvalueS", val)
                }
            },
            xmaxvalueS: {
                get() {
                    return this.$store.state.companybusiness.maxvalueS
                },
                set(val) {
                    this.$store.commit("companybusiness/update_maxvalueS", val)
                }
            },
            isminvalueinclusiveS : {
                get() {
                    return this.$store.state.companybusiness.isminvalueinclusiveS
                },
                set(val) {
                    this.$store.commit("companybusiness/update_isminvalueinclusiveS", val)
                }
            },
            ismaxvalueinclusiveS: {
                get() {
                    return this.$store.state.companybusiness.ismaxvalueinclusiveS
                },
                set(val) {
                    this.$store.commit("companybusiness/update_ismaxvalueinclusiveS", val)
                }
            },
            xnoteS : {
                get() {
                    return this.$store.state.companybusiness.noteS
                },
                set(val) {
                    this.$store.commit("companybusiness/update_noteS", val)
                }
            },
            xminvalueI: {
                get() {
                    return this.$store.state.companybusiness.minvalueI
                },
                set(val) {
                    this.$store.commit("companybusiness/update_minvalueI", val)
                }
            },
            xmaxvalueI: {
                get() {
                    return this.$store.state.companybusiness.maxvalueI
                },
                set(val) {
                    this.$store.commit("companybusiness/update_maxvalueI", val)
                }
            },
            isminvalueinclusiveI : {
                get() {
                    return this.$store.state.companybusiness.isminvalueinclusiveI
                },
                set(val) {
                    this.$store.commit("companybusiness/update_isminvalueinclusiveI", val)
                }
            },
            ismaxvalueinclusiveI: {
                get() {
                    return this.$store.state.companybusiness.ismaxvalueinclusiveI
                },
                set(val) {
                    this.$store.commit("companybusiness/update_ismaxvalueinclusiveI", val)
                }
            },
            xnoteI : {
                get() {
                    return this.$store.state.companybusiness.noteI
                },
                set(val) {
                    this.$store.commit("companybusiness/update_noteI", val)
                }
            },
            xcompanybusinesstypes() {
                return this.$store.state.companybusiness.companybusinesstypes
            },
            xcompanybusinesstype: {
                get() {
                    return this.$store.state.companybusiness.companybusinesstype
                },
                set(val) {
                    this.$store.commit("companybusiness/update_companybusinesstype", val)
                }

            },
            xagingtypes() {
                return this.$store.state.companybusiness.agingtypes
            },
            xagingtype: {
                get() {
                    return this.$store.state.companybusiness.agingtype
                },
                set(val) {
                    this.$store.commit("companybusiness/update_agingtype", val)
                }

            },
            xstatuss() {
                return this.$store.state.companybusiness.statuss
            },
            dialogstatusorder() {
                return this.$store.state.companybusiness.dialog_status_order
            },
            xautocompanytypes() {
                return this.$store.state.companybusiness.autocompanytypes
            },
            xautocompanytype: {
                get() {
                    return this.$store.state.companybusiness.autocompanytype
                },
                set(val) {
                    this.$store.commit("companybusiness/update_autocompanytype", val)
                }
            },
            xsearch: {
                get() {
                    return this.$store.state.companybusiness.x_search
                },
                set(val) {
                    this.$store.commit("companybusiness/update_x_search", val)
                }
            },
            curr_page: {
                get() {
                    return this.$store.state.companybusiness.current_page
                },
                set(val) {
                    this.$store.commit("companybusiness/update_current_page", val)
                    this.$store.dispatch("companybusiness/lookupbyname", {
                        companytype: this.$store.state.companytype.x_search,
                        companybusiness: this.xsearch,
                        current_page: val,
                        lastid: -1
                    })
                }
            },
            xtotal_page: {
                get() {
                    return this.$store.state.companybusiness.total_data
                },
                set(val) {
                    this.$store.commit("companybusiness/update_total_data", val)
                }
            }
        },
        methods: {
            isSelected(p) {
                return p.id == this.$store.state.companybusiness.selected_companybusiness.id
            },
            selectMe(sc) {
                this.$store.commit("companybusiness/update_selected_companybusiness", sc)

            },
            updateDialogFormCompanyBusiness() {
                this.$store.commit("companybusiness/update_dialog_form_companybusiness", false)
            },
            updateDialogStatusOrder() {
                this.$store.commit("companybusiness/update_dialog_status_order", false)
            },
            setStatusOrder(val) {
                this.$store.commit("companybusiness/update_companybusinesss", {})
                this.$store.commit("companybusiness/update_dialog_status_order", true)
                this.$store.commit("companybusiness/update_statuss", val.statuss)
            },
            doPriceList(val) {
                console.log(location)
                var id = val.id
                location.replace("/one-ui/companytype/vuex/one-md-price/" + "?id=" + id)
            },
            doPrice() {
                console.log(location)
                var id = this.xid
                location.replace("/one-ui/companytype/vuex/one-md-price/" + "?id=" + id)
            },
            thr_search_companytype: _.debounce(function () {
                this.$store.dispatch("companybusiness/searchcompanytype", {
                    tes: this.search_companytype
                })
            }, 2000),
            thr_search_city: _.debounce(function () {
                this.$store.dispatch("companybusiness/searchcity", {
                    search: this.search_city
                })
            }, 2000),
            thr_search_district: _.debounce(function () {
                this.$store.dispatch("companybusiness/searchdistrict", {
                    search: this.search_district,
                    id: this.xautocity.M_CityID
                })
            }, 2000),
            thr_search_kelurahan: _.debounce(function () {
                this.$store.dispatch("companybusiness/searchkelurahan", {
                    search: this.search_kelurahan,
                    id: this.xautodistrict.M_DistrictID
                })
            }, 2000),
            thr_search: _.debounce(function () {
                this.$store.dispatch("companytype/lookupbyname", {
                    companytype: this.$store.state.companytype.x_search,
                    companybusiness: this.xsearch,
                    current_page: 1,
                    lastid: -1
                })
                this.$store.dispatch("companybusiness/lookupbyname", {
                    companytype: this.$store.state.companytype.x_search,
                    companybusiness: this.xsearch,
                    current_page: 1,
                    lastid: -1
                })
            }, 1000),
            searchCompanyType() {
                this.$store.dispatch("companybusiness/lookup", {
                    id: this.xcompanytype.name === "" ? "0" : this.$store.state.companytype.selected_companytype
                        .id,
                    search: this.xsearch,
                    current_page: 1,
                    lastid: -1
                })
            },
            doPrint() {
                console.log('doprint')
                this.printwidth = 1028
                this.printtitle = ""
                let companybusiness = one_companybusiness()
                var id = this.xid
                var d = new Date();
                var n = d.getTime()
                var rptname = 'companytype_price'
                var formatrpt = this.formatreport

                this.urlprint = "/birt/run?__report=report/one/md/" + rptname +
                    ".rptdesign&__format=" +
                    formatrpt + "&PCompanyBusinessID=" + id + "&companybusinessxname=" + companybusiness.M_CompanyBusinessCompanyBusinessname +
                    "&tm=" + n

                this.openprint = true
            },
            closePrint() {
                this.openprint = false
            },
            openFormCompanyBusiness(val) {
                this.xid = val
                this.xname = ''
                this.xminvalueR = ''
                this.xmaxvalueR = ''
                this.isminvalueinclusiveR = false
                this.ismaxvalueinclusiveR = false
                this.xnoteR = ''
                this.xminvalueS = ''
                this.xmaxvalueS = ''
                this.isminvalueinclusiveS = true
                this.ismaxvalueinclusiveS = false
                this.xnoteS = ''
                this.xminvalueI = ''
                this.xmaxvalueI = ''
                this.isminvalueinclusiveI = true
                this.ismaxvalueinclusiveI = false
                this.xnoteI = ''
                this.$store.commit("companybusiness/update_dialog_form_companybusiness", true)
            },
            editFormCompanyBusiness(val) {
                this.xid = val.id
                this.xname = val.M_CompanyBusinessName
                this.xminvalueR = val.M_CompanyBusinessMinValueR
                this.xmaxvalueR = val.M_CompanyBusinessMaxValueR
                this.isminvalueinclusiveR = val.M_CompanyBusinessMinInclusiveR === 'N' ? false : true
                this.ismaxvalueinclusiveR = val.M_CompanyBusinessMaxInclusiveR === 'N' ? false : true
                this.xnoteR = val.M_CompanyBusinessNoteR
                this.xminvalueS = val.M_CompanyBusinessMinValueS
                this.xmaxvalueS = val.M_CompanyBusinessMaxValueS
                this.isminvalueinclusiveS = val.M_CompanyBusinessMinInclusiveS === 'N' ? false : true
                this.ismaxvalueinclusiveS = val.M_CompanyBusinessMaxInclusiveS === 'N' ? false : true
                this.xnoteS = val.M_CompanyBusinessNoteS
                this.xminvalueI = val.M_CompanyBusinessMinValueI
                this.xmaxvalueI = val.M_CompanyBusinessMaxValueI
                this.isminvalueinclusiveI = val.M_CompanyBusinessMinInclusiveI === 'N' ? false : true
                this.ismaxvalueinclusiveI = val.M_CompanyBusinessMaxInclusiveI === 'N' ? false : true
                this.xnoteI = val.M_CompanyBusinessNoteI
                this.$store.commit("companybusiness/update_autocompanytypes", [{
                    M_CompanyTypeID: val.M_CompanyTypeID,
                    M_CompanyTypeName: val.M_CompanyTypeName
                }])
                this.$store.commit("companybusiness/update_autocompanytype", {
                    M_CompanyTypeID: val.M_CompanyTypeID,
                    M_CompanyTypeName: val.M_CompanyTypeName
                })
                this.$store.commit("companybusiness/update_dialog_form_companybusiness", true)
            },
            checkError(value) {
                var errors = this.$store.state.companybusiness.errors
                if (errors.includes(value)) {
                    return true
                } else {
                    return false
                }
            },
            saveFormCompanyBusiness() {
                if (this.$refs.formcompanytypecompanybusiness.validate()) {
                    this.$store.dispatch("companybusiness/save", {
                        xid: this.xid,
                        name: this.xname,
                        scompanybusiness: this.xsearch
                    })
                }

            },
            set_date2(x) {
                this.startdate = x.new_date
            },
            set_date3(x) {
                this.enddate = x.new_date
            },
            formatDate(date) {
                if (!date) return null

                const [year, month, day] = date.split('-')
                return `${day}-${month}-${year}`
            },
            deFormatedDate(date) {
                if (!date) return null

                const [day, month, year] = date.split('-')
                return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
            },
            updateAlert_success(val) {
                this.$store.commit("companytype/update_alert_success", val)
            },
            deleteFormCompanyBusiness(data) {
                this.xid = data.id
                this.msgalertcompanybusiness = "Yakin, mau hapus bidang usaha " + data.name + "  ?"
                this.dialogdeletealertcompanybusiness = true
            },
            closeDeleteAlertCompanyBusiness() {
                this.$store.dispatch("companybusiness/delete", {
                    xid: this.xid,
                    name: this.xname,
                    companytypeid: this.$store.state.companybusiness.autocompanytype.M_CompanyTypeID,
                    companytypename: this.$store.state.companybusiness.autocompanytype.M_CompanyTypeName,
                    scompanytype: this.$store.state.companytype.x_search,
                    scompanybusiness: this.xsearch
                })
                this.dialogdeletealertcompanybusiness = false
            }
        },
        watch: {
            xsearch(val, old) {
                console.log(val)
                this.xsearch = val
                this.thr_search()

            },
            search_companytype(val, old) {
                if (val == old) return
                if (!val) return
                if (val.length < 1) return
                if (this.$store.state.companybusiness.update_autocomplete_status == 1) return
                this.thr_search_companytype()
            },
            search_city(val, old) {
                if (val == old) return
                if (!val) return
                if (val.length < 1) return
                if (this.$store.state.companybusiness.update_autocomplete_status == 1) return
                this.thr_search_city()
            },
            search_district(val, old) {
                if (val == old) return
                if (!val) return
                if (val.length < 1) return
                if (this.$store.state.companybusiness.update_autocomplete_status == 1) return
                this.thr_search_district()
            },
            search_kelurahan(val, old) {
                if (val == old) return
                if (!val) return
                if (val.length < 1) return
                if (this.$store.state.companybusiness.update_autocomplete_status == 1) return
                this.thr_search_kelurahan()
            }
        }
    }
</script>