Initial import
This commit is contained in:
130
one-ui/masterdata/one-md-bidang-usaha/api/companybusiness.js
Normal file
130
one-ui/masterdata/one-md-bidang-usaha/api/companybusiness.js
Normal file
@@ -0,0 +1,130 @@
|
||||
const URL = "/one-api/v1/masterdata/";
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/addnewcompanybusiness', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/deletecompanybusiness', { id: id ,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function searchcompanytype(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/searchcompanytype',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function searchcity(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/searchcity',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function searchdistrict(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/searchdistrict',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function searchkelurahan(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/searchkelurahan',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function lookupbyname(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/lookupcompanybusinessbyname', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
262
one-ui/masterdata/one-md-bidang-usaha/api/companytype.js
Normal file
262
one-ui/masterdata/one-md-bidang-usaha/api/companytype.js
Normal file
@@ -0,0 +1,262 @@
|
||||
const URL = "/one-api/v1/masterdata/";
|
||||
|
||||
export async function lookup(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/lookup', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function lookupbycompanybusiness(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/lookupcompanytypebycompanybusiness', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function lookupbydistrict(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/lookupcompanytypebydistrict', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function lookupbykelurahan(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/lookupcompanytypebykelurahan', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function lookupbyname(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/lookupcompanytypebyname', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/addnewcompanytype', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function update(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/editcompanytype', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/deletecompanytype', { id: id, token:token });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function selectnonlab(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/selectnonlab',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function searchcompanybusiness(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/searchcompanybusiness',{token:token,search:prm});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function searchinstrument(token,tes) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/searchinstrument',{token:token,search:tes});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function searchtemplate(token,tes) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/searchtemplate',{token:token,search:tes});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function getdistrict(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/getdistrict',{id:prm.M_DoctorID,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getkelurahan(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companytype/getkelurahan',{token:token,id:prm.M_DistrictID});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,832 @@
|
||||
<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>
|
||||
@@ -0,0 +1,618 @@
|
||||
<template>
|
||||
<v-layout>
|
||||
<template>
|
||||
|
||||
<v-dialog v-model="dialogdeletealert" 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>
|
||||
{{msgalert}}
|
||||
</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="dialogdeletealert = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn color="primary" flat @click="closeDeleteAlert()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-dialog v-model="dialogcompanytype" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">FORM STATUS KEPEMILIKAN</span></v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-form ref="formcompanytype" 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="updateDialogFormCompanyType()">Tutup</v-btn>
|
||||
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormCompanyType()">Simpan</v-btn>
|
||||
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormCompanyType()">Simpan Perubahan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<v-flex xs12>
|
||||
<v-card>
|
||||
<v-toolbar color="blue lighten-3" dark height="50px">
|
||||
<v-toolbar-title>STATUS KEPEMILIKAN</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="openFormCompanyType(0)" icon>
|
||||
<v-icon>library_add</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
<v-snackbar v-model="snackbar" :timeout="5000" :multi-line="false" :vertical="false" :top="true">
|
||||
{{msgsnackbar}}
|
||||
<v-btn flat @click="updateAlert_success(false)">
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-snackbar>
|
||||
<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>
|
||||
<div>
|
||||
|
||||
<v-layout row 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="vcompanytypes" :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.namex}}</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="editCompanyType(props.item)">edit</v-icon>
|
||||
<v-icon small :disabled="props.item.used != 0" class="ml-3" color="error" @click="deleteCompanyType(props.item)">clear</v-icon>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
|
||||
<v-divider></v-divider>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</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 = {
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
dialogdeletealert: false,
|
||||
msgalert: "",
|
||||
valid: false,
|
||||
xid: 0,
|
||||
search_instrument: '',
|
||||
items: [],
|
||||
xname: '',
|
||||
xcode: '',
|
||||
xnameRules: [
|
||||
v => !!v || 'Nama harus diisi'
|
||||
],
|
||||
instrumentRules: [
|
||||
v => !!v || 'Instrument harus dipilih'
|
||||
],
|
||||
name: '',
|
||||
isdefault: false,
|
||||
scode: '',
|
||||
search_companybusiness: '',
|
||||
search_testheader: '',
|
||||
search_template: '',
|
||||
page: 1,
|
||||
headers: [{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
descending: true,
|
||||
page: 1,
|
||||
rowsPerPage: 100,
|
||||
sortBy: 'id DESC',
|
||||
totalItems: this.$store.state.companytype.total_filter_companytypes
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("companytype/lookupbyname", {
|
||||
companytype: this.xsearch,
|
||||
companybusiness: this.$store.state.companybusiness.x_search,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
this.$store.dispatch("companybusiness/lookupbyname", {
|
||||
companytype: this.xsearch,
|
||||
companybusiness: this.$store.state.companybusiness.x_search,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
xact() {
|
||||
return this.$store.state.companytype.act
|
||||
},
|
||||
xerrors() {
|
||||
return this.$store.state.companytype.errors
|
||||
},
|
||||
xshowall() {
|
||||
return this.$store.state.companytype.show_all
|
||||
},
|
||||
vcompanytypes() {
|
||||
return this.$store.state.companytype.companytypes
|
||||
},
|
||||
xtotalcompanytypes() {
|
||||
return this.$store.state.companytype.total_companytypes
|
||||
},
|
||||
xtotalfiltercompanytypes() {
|
||||
return this.$store.state.companytype.total_filter_companytypes
|
||||
},
|
||||
xsearch: {
|
||||
get() {
|
||||
return this.$store.state.companytype.x_search
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("companytype/update_x_search", val)
|
||||
}
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.companytype.current_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("companytype/update_current_page", val)
|
||||
this.$store.dispatch("companytype/lookupbyname", {
|
||||
companytype: this.xsearch,
|
||||
companybusiness: this.$store.state.companybusiness.x_search,
|
||||
current_page: val,
|
||||
lastid: -1
|
||||
})
|
||||
}
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.companytype.total_companytypes
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("companytype/update_total_companytypes", val)
|
||||
}
|
||||
},
|
||||
dialogcompanytype() {
|
||||
return this.$store.state.companytype.dialog_form_companytype
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.companytype.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("companytype/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
msgsnackbar() {
|
||||
return this.$store.state.companytype.msg_success
|
||||
},
|
||||
lookupstatus() {
|
||||
return this.$store.state.companytype.lookup_companytype
|
||||
},
|
||||
xcompanytypetypes() {
|
||||
return this.$store.state.companytype.companytypetypes
|
||||
},
|
||||
xcompanytypetype: {
|
||||
get() {
|
||||
return this.$store.state.companytype.companytypetype
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("companytype/update_companytypetype", val)
|
||||
}
|
||||
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.companytype.search_status == 1
|
||||
},
|
||||
xnonlabs() {
|
||||
return this.$store.state.companytype.nonlabs
|
||||
},
|
||||
xnonlab: {
|
||||
get() {
|
||||
return this.$store.state.companytype.selected_nonlab
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("companytype/update_selected_nonlab", val)
|
||||
}
|
||||
},
|
||||
xcities() {
|
||||
return this.$store.state.companytype.cities
|
||||
},
|
||||
companybusinessaddress: {
|
||||
get() {
|
||||
return this.$store.state.companytype.companybusiness_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("companytype/update_companybusiness_address", val)
|
||||
this.$store.dispatch("companytype/getdistrict", this.$store.state.companytype.companybusiness_address)
|
||||
}
|
||||
},
|
||||
xcompanybusinesss() {
|
||||
return this.$store.state.companytype.companybusinesss
|
||||
},
|
||||
companybusiness: {
|
||||
get() {
|
||||
return this.$store.state.companytype.companybusiness
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("companytype/update_companybusiness", val)
|
||||
}
|
||||
},
|
||||
xinstruments() {
|
||||
return this.$store.state.companytype.instruments
|
||||
},
|
||||
xinstrument: {
|
||||
get() {
|
||||
return this.$store.state.companytype.instrument
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("companytype/update_instrument", val)
|
||||
}
|
||||
},
|
||||
xautotemplates() {
|
||||
return this.$store.state.companytype.autotemplates
|
||||
},
|
||||
xautotemplate: {
|
||||
get() {
|
||||
return this.$store.state.companytype.autotemplate
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("companytype/update_autotemplate", val)
|
||||
}
|
||||
},
|
||||
xdistricts() {
|
||||
return this.$store.state.companytype.districts
|
||||
},
|
||||
districtaddress: {
|
||||
get() {
|
||||
return this.$store.state.companytype.district_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("companytype/update_district_address", val)
|
||||
this.$store.dispatch("companytype/getkelurahan", this.$store.state.companytype.district_address)
|
||||
}
|
||||
},
|
||||
xkelurahans() {
|
||||
return this.$store.state.companytype.kelurahans
|
||||
},
|
||||
kelurahanaddress: {
|
||||
get() {
|
||||
return this.$store.state.companytype.kelurahan_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("companytype/update_kelurahan_address", val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateShowAll(val) {
|
||||
this.$store.commit("companytype/update_show_all", val)
|
||||
this.$store.dispatch("companytype/lookupbyname", {
|
||||
companytype: this.xsearch,
|
||||
companybusiness: this.$store.state.companybusiness.x_search,
|
||||
current_page: this.curr_page,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
searchCompanyType() {
|
||||
this.$store.dispatch("companytype/lookup", {
|
||||
search: this.xsearch,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.id == this.$store.state.companytype.selected_companytype.id
|
||||
},
|
||||
subname(name) {
|
||||
var xname = name
|
||||
if (xname.length > 18) {
|
||||
xname = xname.substring(0, 18) + '...'
|
||||
}
|
||||
return xname
|
||||
},
|
||||
selectMe(sc) {
|
||||
this.$store.commit("companytype/update_selected_companytype", sc)
|
||||
/*
|
||||
this.$store.dispatch("companybusiness/lookupbyname", {
|
||||
companytype: this.$store.state.companytype.selected_companytype.name,
|
||||
companybusiness: this.$store.state.companybusiness.x_search,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
this.$store.commit("companybusiness/update_autocompanytypes", [{
|
||||
M_CompanyTypeID: this.$store.state.companytype.selected_companytype.id,
|
||||
M_CompanyTypeName: this.$store.state.companytype.selected_companytype.name
|
||||
}])
|
||||
this.$store.commit("companybusiness/update_autocompanytype", {
|
||||
M_CompanyTypeID: this.$store.state.companytype.selected_companytype.id,
|
||||
M_CompanyTypeName: this.$store.state.companytype.selected_companytype.name
|
||||
})
|
||||
*/
|
||||
},
|
||||
updateDialogFormCompanyType() {
|
||||
this.$store.commit("companytype/update_dialog_form_companytype", false)
|
||||
},
|
||||
openFormCompanyType() {
|
||||
this.xcode = ""
|
||||
this.xname = ""
|
||||
this.isdefault = "N"
|
||||
this.$refs.formcompanytype.reset()
|
||||
this.$refs.formcompanytype.resetValidation()
|
||||
this.$store.commit("companytype/update_act", 'new')
|
||||
this.$store.commit("companytype/update_dialog_form_companytype", true)
|
||||
},
|
||||
thr_search_instrument: _.debounce(function () {
|
||||
this.$store.dispatch("companytype/searchinstrument", {
|
||||
tes: this.search_instrument
|
||||
})
|
||||
}, 2000),
|
||||
saveFormCompanyType() {
|
||||
if (this.$refs.formcompanytype.validate()) {
|
||||
this.$store.dispatch("companytype/save", {
|
||||
name: this.xname,
|
||||
scompanytype: this.xsearch,
|
||||
scompanybusiness: this.$store.state.companybusiness.x_search
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
updateFormCompanyType() {
|
||||
if (this.$refs.formcompanytype.validate()) {
|
||||
this.$store.dispatch("companytype/update", {
|
||||
id: this.xid,
|
||||
name: this.xname,
|
||||
scompanytype: this.xsearch,
|
||||
scompanybusiness: this.$store.state.companybusiness.x_search
|
||||
})
|
||||
}
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("companytype/update_alert_success", val)
|
||||
},
|
||||
editCompanyType(data) {
|
||||
this.xid = data.id
|
||||
this.xcode = data.code
|
||||
this.xname = data.name
|
||||
this.isdefault = data.M_CompanyTypeIsDefault === 'N' ? false : true
|
||||
this.$store.commit("companytype/update_act", 'edit')
|
||||
this.$store.commit("companytype/update_dialog_form_companytype", true)
|
||||
},
|
||||
deleteCompanyType(data) {
|
||||
this.xid = data.id
|
||||
var xdata = {
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
companybusinesss: 'xxx'
|
||||
}
|
||||
this.$store.commit("companytype/update_selected_companytype", xdata)
|
||||
this.msgalert = "Yakin, mau hapus kepemilikan " + data.name + " ?"
|
||||
this.dialogdeletealert = true
|
||||
},
|
||||
changeNewCompanyTypeType(value) {
|
||||
this.readonlytypecompanytype = value === true ? true : false
|
||||
this.readonlytypecompanytypenew = value === true ? false : true
|
||||
},
|
||||
newCompanyTypeType() {
|
||||
readonlytypecompanytype: true
|
||||
readonlytypecompanytypenew: false
|
||||
},
|
||||
closeDeleteAlert() {
|
||||
this.$store.dispatch("companytype/delete", {
|
||||
companytypeid: this.$store.state.companytype.selected_companytype.id,
|
||||
xname: this.$store.state.companytype.selected_companytype.name,
|
||||
scompanytype: this.xsearch,
|
||||
scompanybusiness: this.$store.state.companybusiness.x_search
|
||||
})
|
||||
this.dialogdeletealert = false
|
||||
},
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("companytype/lookupbyname", {
|
||||
companytype: this.xsearch,
|
||||
companybusiness: this.$store.state.companybusiness.x_search,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
this.$store.dispatch("companybusiness/lookupbyname", {
|
||||
companytype: this.xsearch,
|
||||
companybusiness: this.$store.state.companybusiness.x_search,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
}, 1000)
|
||||
},
|
||||
watch: {
|
||||
xsearch(val, old) {
|
||||
console.log(val)
|
||||
this.xsearch = val
|
||||
this.thr_search()
|
||||
|
||||
},
|
||||
search_instrument(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.companytype.update_autocomplete_status == 1) return
|
||||
this.thr_search_instrument()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
75
one-ui/masterdata/one-md-bidang-usaha/index.php
Normal file
75
one-ui/masterdata/one-md-bidang-usaha/index.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>One</title>
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp" >
|
||||
<one-navbar></one-navbar>
|
||||
<v-content class="blue lighten-5" >
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs6 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-md-company-type-list></one-md-company-type-list>
|
||||
</v-flex>
|
||||
<v-flex xs6 class="right" fill-height pa-1>
|
||||
<one-md-company-business-list></one-md-company-business-list>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<script src="../../libs/vendor/moment.min.js"></script>
|
||||
<script src="../../libs/vendor/numeral.min.js"></script>
|
||||
<script src="../../libs/vendor/moment-locale-id.js"></script>
|
||||
<script src="../../libs/vendor/lodash.js"></script>
|
||||
<script src="../../libs/vendor/axios.min.js"></script>
|
||||
<script src="../../libs/vendor/vue.js"></script>
|
||||
<script src="../../libs/vendor/vuex.js"></script>
|
||||
<script src="../../libs/vendor/vuetify.js"></script>
|
||||
<script src="../../libs/vendor/httpVueLoader.js"></script>
|
||||
<script src="../../libs/one_global.js"></script>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
// window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../apps/components/oneNavbarComponentNoMenu.vue'),
|
||||
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
|
||||
'one-md-company-type-list': httpVueLoader('./components/oneMdCompanyTypeList.vue'),
|
||||
'one-md-company-business-list' : httpVueLoader('./components/oneMdCompanyBusinessList.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
430
one-ui/masterdata/one-md-bidang-usaha/modules/companybusiness.js
Normal file
430
one-ui/masterdata/one-md-bidang-usaha/modules/companybusiness.js
Normal file
@@ -0,0 +1,430 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/companybusiness.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
companybusinesss: [],
|
||||
save_status: 0,
|
||||
save_error_message: '',
|
||||
dialog_form_companybusiness: false,
|
||||
dialog_status_order: false,
|
||||
lookup_companybusiness: 0,
|
||||
search_status: 0,
|
||||
errors: [],
|
||||
startdate: moment(new Date()).format('YYYY-MM-DD'),
|
||||
enddate: moment(new Date()).format('YYYY-MM-DD'),
|
||||
bases: [],
|
||||
base: {},
|
||||
omzettypes: [],
|
||||
omzettype: {},
|
||||
companybusinesstypes: [],
|
||||
companybusinesstype: {},
|
||||
agingtypes: [],
|
||||
agingtype: {},
|
||||
statuss: [],
|
||||
autocompanytypes:[],
|
||||
autocompanytype:{},
|
||||
autocitys:[],
|
||||
autocity:{},
|
||||
autodistricts:[],
|
||||
autodistrict:{},
|
||||
autokelurahans:[],
|
||||
autokelurahan:{},
|
||||
name: '',
|
||||
minvalueR: '',
|
||||
maxvalueR: '',
|
||||
isminvalueinclusiveR: false,
|
||||
ismaxvalueinclusiveR: false,
|
||||
noteR: '',
|
||||
minvalueS: '',
|
||||
maxvalueS: '',
|
||||
isminvalueinclusiveS: true,
|
||||
ismaxvalueinclusiveS: false,
|
||||
noteS: '',
|
||||
minvalueI: '',
|
||||
maxvalueI: '',
|
||||
isminvalueinclusiveI: true,
|
||||
ismaxvalueinclusiveI: false,
|
||||
noteI: '',
|
||||
current_page:1,
|
||||
x_search: '',
|
||||
total_data: 0,
|
||||
selected_companybusiness: {
|
||||
name: ""
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
update_selected_companybusiness(state, val) {
|
||||
state.selected_companybusiness = val
|
||||
},
|
||||
update_x_search(state, val) {
|
||||
state.x_search = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_total_data(state, val) {
|
||||
state.total_data = val
|
||||
},
|
||||
update_autocompanytypes(state,data){
|
||||
state.autocompanytypes = data
|
||||
},
|
||||
update_autocompanytype(state,val){
|
||||
state.autocompanytype = val
|
||||
},
|
||||
update_autocitys(state,data){
|
||||
state.autocitys = data
|
||||
},
|
||||
update_autocity(state,val){
|
||||
state.autocity = val
|
||||
},
|
||||
update_autodistricts(state,data){
|
||||
state.autodistricts = data
|
||||
},
|
||||
update_autodistrict(state,val){
|
||||
state.autodistrict = val
|
||||
},
|
||||
update_autokelurahans(state,data){
|
||||
state.autokelurahans = data
|
||||
},
|
||||
update_autokelurahan(state,val){
|
||||
state.autokelurahan = val
|
||||
},
|
||||
update_name(state, val) {
|
||||
state.name = val
|
||||
},
|
||||
update_minvalueR(state, val) {
|
||||
state.minvalueR = val
|
||||
},
|
||||
update_maxvalueR(state, val) {
|
||||
state.maxvalueR = val
|
||||
},
|
||||
update_isminvalueinclusiveR(state, val) {
|
||||
state.isminvalueinclusiveR = val
|
||||
},
|
||||
update_ismaxvalueinclusiveR(state, val) {
|
||||
state.ismaxvalueinclusiveR = val
|
||||
},
|
||||
update_noteR(state, val) {
|
||||
state.noteR = val
|
||||
},
|
||||
update_minvalueS(state, val) {
|
||||
state.minvalueS = val
|
||||
},
|
||||
update_maxvalueS(state, val) {
|
||||
state.maxvalueS = val
|
||||
},
|
||||
update_isminvalueinclusiveS(state, val) {
|
||||
state.isminvalueinclusiveS = val
|
||||
},
|
||||
update_ismaxvalueinclusiveS(state, val) {
|
||||
state.ismaxvalueinclusiveS = val
|
||||
},
|
||||
update_noteS(state, val) {
|
||||
state.noteS = val
|
||||
},
|
||||
update_minvalueI(state, val) {
|
||||
state.minvalueI = val
|
||||
},
|
||||
update_maxvalueI(state, val) {
|
||||
state.maxvalueI = val
|
||||
},
|
||||
update_isminvalueinclusiveI(state, val) {
|
||||
state.isminvalueinclusiveI = val
|
||||
},
|
||||
update_ismaxvalueinclusiveI(state, val) {
|
||||
state.ismaxvalueinclusiveI = val
|
||||
},
|
||||
update_noteI(state, val) {
|
||||
state.noteI = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_companybusinesss(state, data) {
|
||||
state.companybusinesss = data
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_dialog_form_companybusiness(state, val) {
|
||||
state.dialog_form_companybusiness = val
|
||||
},
|
||||
update_lookup_companybusiness(state, val) {
|
||||
state.lookup_companybusiness = val
|
||||
},
|
||||
update_startdate(state, val) {
|
||||
state.startdate = val
|
||||
},
|
||||
update_enddate(state, val) {
|
||||
state.enddate = val
|
||||
},
|
||||
update_bases(state, data) {
|
||||
state.bases = data
|
||||
},
|
||||
update_base(state, val) {
|
||||
state.base = val
|
||||
},
|
||||
update_omzettypes(state, data) {
|
||||
state.omzettypes = data
|
||||
},
|
||||
update_omzettype(state, val) {
|
||||
state.omzettype = val
|
||||
},
|
||||
update_companybusinesstypes(state, data) {
|
||||
state.companybusinesstypes = data
|
||||
},
|
||||
update_companybusinesstype(state, val) {
|
||||
state.companybusinesstype = val
|
||||
},
|
||||
update_agingtypes(state, data) {
|
||||
state.agingtypes = data
|
||||
},
|
||||
update_agingtype(state, val) {
|
||||
state.agingtype = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_statuss(state, data) {
|
||||
state.statuss = data
|
||||
},
|
||||
update_dialog_status_order(state, val) {
|
||||
state.dialog_status_order = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async save(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.save(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("companytype/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
context.commit("update_dialog_form_companybusiness", false)
|
||||
var msg = "Jenis Bidang Usaha " + prm.name + " sudah disimpan dong"
|
||||
context.commit("companytype/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("companytype/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookupbyname", {
|
||||
companytype: prm.scompanytype,
|
||||
companybusiness: prm.scompanybusiness,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async lookupx(context, prm) {
|
||||
context.commit("update_lookup_companybusiness", 1)
|
||||
try {
|
||||
let resp = await api.lookupx(one_token(), prm.id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_companybusiness", 3)
|
||||
} else {
|
||||
context.commit("update_lookup_companybusiness", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_companybusinesss", data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_companybusiness", 3)
|
||||
}
|
||||
},
|
||||
async lookup(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookup(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_companybusinesss", data.records)
|
||||
console.log('status')
|
||||
console.log(data.records.statuss)
|
||||
context.commit("update_statuss", data.records.statuss)
|
||||
context.commit("update_total_data", data.total)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async lookupbyname(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookupbyname(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_companybusinesss", data.records)
|
||||
console.log(data.records)
|
||||
context.commit("update_total_data", data.total)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xdelete(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("companytype/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("companytype/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("companytype/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("companytype/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("companytype/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Jenis Bidang usaha sudah dihapus dong"
|
||||
context.commit("companytype/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("companytype/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookupbyname", {
|
||||
companytype: prm.scompanytype,
|
||||
companybusiness: prm.scompanybusiness,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async searchcompanytype(context,prm) {
|
||||
context.commit("companytype/update_autocomplete_status",1,{root: true})
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.searchcompanytype(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("companytype/update_autocomplete_status",3,{root: true})
|
||||
} else {
|
||||
context.commit("companytype/update_autocomplete_status",2,{root: true})
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_autocompanytypes",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("companytype/update_autocomplete_status",3,{root: true})
|
||||
}
|
||||
},
|
||||
async searchcity(context,prm) {
|
||||
context.commit("companytype/update_autocomplete_status",1,{root: true})
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.searchcity(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("companytype/update_autocomplete_status",3,{root: true})
|
||||
} else {
|
||||
context.commit("companytype/update_autocomplete_status",2,{root: true})
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_autocitys",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("companytype/update_autocomplete_status",3,{root: true})
|
||||
}
|
||||
},
|
||||
async searchdistrict(context,prm) {
|
||||
context.commit("companytype/update_autocomplete_status",1,{root: true})
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.searchdistrict(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("companytype/update_autocomplete_status",3,{root: true})
|
||||
} else {
|
||||
context.commit("companytype/update_autocomplete_status",2,{root: true})
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_autodistricts",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("companytype/update_autocomplete_status",3,{root: true})
|
||||
}
|
||||
},
|
||||
async searchkelurahan(context,prm) {
|
||||
context.commit("companytype/update_autocomplete_status",1,{root: true})
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.searchkelurahan(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("companytype/update_autocomplete_status",3,{root: true})
|
||||
} else {
|
||||
context.commit("companytype/update_autocomplete_status",2,{root: true})
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_autokelurahans",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("companytype/update_autocomplete_status",3,{root: true})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
531
one-ui/masterdata/one-md-bidang-usaha/modules/companytype.js
Normal file
531
one-ui/masterdata/one-md-bidang-usaha/modules/companytype.js
Normal file
@@ -0,0 +1,531 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/companytype.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
last_id: -1,
|
||||
act: 'new',
|
||||
lookup_companytype: 0,
|
||||
lookup_error_message: '',
|
||||
companytypes: [],
|
||||
total_companytypes: 0,
|
||||
total_filter_companytypes: 0,
|
||||
selected_companytype: {
|
||||
name: ""
|
||||
},
|
||||
save_status: 0,
|
||||
save_error_message: '',
|
||||
dialog_form_companytype: false,
|
||||
dialog_edit_form_companytype: false,
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
show_all: 'N',
|
||||
errors: [],
|
||||
companytypetypes: [],
|
||||
companytypetype: {},
|
||||
companybusinesss: [],
|
||||
companybusiness: {},
|
||||
get_data_status: 0,
|
||||
get_data_error_message: '',
|
||||
cities: [],
|
||||
companybusiness_address: {},
|
||||
autocomplete_status: 0,
|
||||
search_status: 0,
|
||||
districts: [],
|
||||
district_address: {},
|
||||
kelurahans: [],
|
||||
kelurahan_address: {},
|
||||
instruments: [],
|
||||
instrument: {},
|
||||
autotemplates: [],
|
||||
autotemplate: {},
|
||||
nonlabs: [],
|
||||
selected_nonlab: {},
|
||||
current_page:1,
|
||||
x_search: ''
|
||||
},
|
||||
mutations: {
|
||||
update_x_search(state, val) {
|
||||
state.x_search = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_show_all(state, val) {
|
||||
state.show_all = val
|
||||
},
|
||||
update_lookup_error_message(state, status) {
|
||||
state.lookup_error_message = status
|
||||
},
|
||||
update_lookup_companytype(state, status) {
|
||||
state.lookup_companytype = status
|
||||
},
|
||||
update_companytypes(state, data) {
|
||||
state.companytypes = data.records
|
||||
state.total_companytypes = data.total
|
||||
state.total_filter_companytypes = data.total_filter
|
||||
},
|
||||
update_selected_companytype(state, val) {
|
||||
state.selected_companytype = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_dialog_form_companytype(state, val) {
|
||||
state.dialog_form_companytype = val
|
||||
},
|
||||
update_dialog_edit_form_companytype(state, val) {
|
||||
state.dialog_edit_form_companytype = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_companytypetypes(state, data) {
|
||||
state.companytypetypes = data
|
||||
},
|
||||
update_companytypetype(state, val) {
|
||||
state.companytypetype = val
|
||||
},
|
||||
update_companybusinesss(state, data) {
|
||||
state.companybusinesss = data
|
||||
},
|
||||
update_companybusiness(state, val) {
|
||||
state.companybusiness = val
|
||||
},
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_get_data_error_message(state, val) {
|
||||
state.get_data_error_message = val
|
||||
},
|
||||
update_cities(state, val) {
|
||||
state.cities = val
|
||||
},
|
||||
update_companybusiness_address(state, val) {
|
||||
state.companybusiness_address = val
|
||||
},
|
||||
update_autocomplete_status(state, val) {
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_districts(state, val) {
|
||||
state.districts = val
|
||||
},
|
||||
update_district_address(state, val) {
|
||||
state.district_address = val
|
||||
},
|
||||
update_kelurahans(state, val) {
|
||||
state.kelurahans = val
|
||||
},
|
||||
update_kelurahan_address(state, val) {
|
||||
state.kelurahan_address = val
|
||||
},
|
||||
update_instruments(state, data) {
|
||||
state.instruments = data
|
||||
},
|
||||
update_instrument(state, val) {
|
||||
state.instrument = val
|
||||
},
|
||||
update_autotemplates(state, data) {
|
||||
state.autotemplates = data
|
||||
},
|
||||
update_autotemplate(state, val) {
|
||||
state.autotemplate = val
|
||||
},
|
||||
update_nonlabs(state, val) {
|
||||
state.nonlabs = val
|
||||
},
|
||||
update_selected_nonlab(state, val) {
|
||||
state.selected_nonlab = val
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
actions: {
|
||||
async lookup(context, prm) {
|
||||
context.commit("update_lookup_companytype", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookup(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_companytype", 3)
|
||||
context.commit("update_lookup_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_lookup_companytype", 2)
|
||||
context.commit("update_lookup_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_filter: resp.data.total_filter
|
||||
}
|
||||
context.commit("update_companytypes", data)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_companytype", 3)
|
||||
context.commit("update_lookup_error_message", e.message)
|
||||
}
|
||||
},
|
||||
async lookupbycompanybusiness(context, prm) {
|
||||
context.commit("update_lookup_companytype", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookupbycompanybusiness(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_companytype", 3)
|
||||
context.commit("update_lookup_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_lookup_companytype", 2)
|
||||
context.commit("update_lookup_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_filter: resp.data.total_filter
|
||||
}
|
||||
context.commit("update_companytypes", data)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_companytype", 3)
|
||||
context.commit("update_lookup_error_message", e.message)
|
||||
}
|
||||
},
|
||||
async lookupbydistrict(context, prm) {
|
||||
context.commit("update_lookup_companytype", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookupbydistrict(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_companytype", 3)
|
||||
context.commit("update_lookup_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_lookup_companytype", 2)
|
||||
context.commit("update_lookup_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_filter: resp.data.total_filter
|
||||
}
|
||||
context.commit("update_companytypes", data)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_companytype", 3)
|
||||
context.commit("update_lookup_error_message", e.message)
|
||||
}
|
||||
},
|
||||
async lookupbykelurahan(context, prm) {
|
||||
context.commit("update_lookup_companytype", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookupbykelurahan(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_companytype", 3)
|
||||
context.commit("update_lookup_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_lookup_companytype", 2)
|
||||
context.commit("update_lookup_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_filter: resp.data.total_filter
|
||||
}
|
||||
context.commit("update_companytypes", data)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_companytype", 3)
|
||||
context.commit("update_lookup_error_message", e.message)
|
||||
}
|
||||
},
|
||||
async lookupbyname(context, prm) {
|
||||
context.commit("update_lookup_companytype", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookupbyname(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_companytype", 3)
|
||||
context.commit("update_lookup_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_lookup_companytype", 2)
|
||||
context.commit("update_lookup_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_filter: resp.data.total_filter
|
||||
}
|
||||
context.commit("update_companytypes", data)
|
||||
var pat = data.records[0]
|
||||
if(prm.companytype != ""){
|
||||
context.commit("companybusiness/update_autocompanytypes", [{
|
||||
S_CompanyTypeID: pat.S_CompanyTypeID,
|
||||
S_CompanyTypeName: pat.S_CompanyTypeName
|
||||
}], { root: true })
|
||||
context.commit("companybusiness/update_autocompanytype", {
|
||||
S_CompanyTypeID: pat.S_CompanyTypeID,
|
||||
S_CompanyTypeName: pat.S_CompanyTypeName
|
||||
},{ root: true })
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_companytype", 3)
|
||||
context.commit("update_lookup_error_message", e.message)
|
||||
}
|
||||
},
|
||||
async save(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.save(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_errors", [])
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_dialog_form_companytype", false)
|
||||
var msg =" Status Kepemilikan " + prm.name + " sudah tersimpan dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.dispatch("lookupbyname", {
|
||||
companytype: prm.scompanytype,
|
||||
companybusiness: prm.scompanybusiness,
|
||||
district: prm.sdistrict,
|
||||
kelurahan: prm.skelurahan,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async update(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.update(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_dialog_form_companytype", false)
|
||||
var msg = " Status Kepemilikan " + prm.name + " sudah terupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.dispatch("lookupbyname", {
|
||||
companytype: prm.scompanytype,
|
||||
companybusiness: prm.scompanybusiness,
|
||||
district: prm.sdistrict,
|
||||
kelurahan: prm.skelurahan,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
}else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xdelete(one_token(), prm.companytypeid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_alert_success", true)
|
||||
|
||||
var msg = " Status Kepemilikan " + prm.name + " sudah dihapus dong"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_selected_companytype", {})
|
||||
context.dispatch("lookupbyname", {
|
||||
companytype: prm.scompanytype,
|
||||
companybusiness: prm.scompanybusiness,
|
||||
district: prm.sdistrict,
|
||||
kelurahan: prm.skelurahan,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectnonlab(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectnonlab(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_nonlabs", resp.data.records.nonlabs)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectcompanybusiness(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectcompanybusiness(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_companybusinesss", resp.data.records.companybusinesss)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async searchcompanybusiness(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchcompanybusiness(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_companybusinesss", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async searchinstrument(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchinstrument(one_token(), prm.tes)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_instruments", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async searchtemplate(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchtemplate(one_token(), prm.tes)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_autotemplates", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async getdistrict(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getdistrict(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_districts", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async getkelurahan(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getkelurahan(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_kelurahans", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
25
one-ui/masterdata/one-md-bidang-usaha/store.js
Normal file
25
one-ui/masterdata/one-md-bidang-usaha/store.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import companytype from "./modules/companytype.js";
|
||||
import companybusiness from "./modules/companybusiness.js";
|
||||
import system from "../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
companytype: companytype,
|
||||
companybusiness: companybusiness,
|
||||
system:system
|
||||
},
|
||||
state: {
|
||||
|
||||
},
|
||||
mutations: {
|
||||
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user