mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 04:13:58 +00:00
- Delete function
- Set default get active list
This commit is contained in:
@@ -50,6 +50,8 @@ class ContractModule extends BaseController
|
||||
|
||||
if (!empty($status) > 0) {
|
||||
$query->whereIn('status', $status);
|
||||
}else{
|
||||
$query->whereIn('status', [config('constants.contact.status.active')]);
|
||||
}
|
||||
|
||||
$query->where('user_id', Auth::guard('user-api')->user()->id);
|
||||
|
||||
@@ -45,6 +45,8 @@ class ContractObligationDependencyModule extends BaseController
|
||||
|
||||
if (!empty($status) > 0) {
|
||||
$query->whereIn('status', $status);
|
||||
}else{
|
||||
$query->whereIn('status', [config('constants.contract_dependency.status.active')]);
|
||||
}
|
||||
|
||||
$query->where('user_id', Auth::guard('user-api')->user()->id);
|
||||
|
||||
@@ -52,6 +52,8 @@ class ContractObligationModule extends BaseController
|
||||
|
||||
if (!empty($status) > 0) {
|
||||
$query->whereIn('status', $status);
|
||||
}else{
|
||||
$query->whereIn('status',[config('constants.contact.status.active')]);
|
||||
}
|
||||
|
||||
$query->where('user_id', Auth::guard('user-api')->user()->id);
|
||||
|
||||
@@ -43,6 +43,8 @@ class ContractTemplateModule extends BaseController
|
||||
|
||||
if (!empty($status) > 0) {
|
||||
$query->whereIn('status', $status);
|
||||
}else{
|
||||
$query->whereIn('status', [config('constants.contact_template.status.active')]);
|
||||
}
|
||||
|
||||
$query->where('user_id', Auth::guard('user-api')->user()->id);
|
||||
|
||||
@@ -54,6 +54,8 @@ class ContractTemplateObligationContractTemplateDependencyModule extends BaseCon
|
||||
|
||||
if (!empty($status) > 0) {
|
||||
$query->whereIn('status', $status);
|
||||
}else{
|
||||
$query->whereIn('status', [config('constants.contract_template_obligation_contract_template_dependency.status.active')]);
|
||||
}
|
||||
|
||||
$query->where('user_id', Auth::guard('user-api')->user()->id);
|
||||
|
||||
@@ -53,6 +53,8 @@ class ContractTemplateObligationDependencyModule extends BaseController
|
||||
|
||||
if (!empty($status) > 0) {
|
||||
$query->whereIn('status', $status);
|
||||
}else{
|
||||
$query->whereIn('status', [config('constants.contract_template_obligation_dependency.status.active')]);
|
||||
}
|
||||
|
||||
$query->where('user_id', Auth::guard('user-api')->user()->id);
|
||||
|
||||
@@ -57,6 +57,8 @@ class ContractTemplateObligationModule extends BaseController
|
||||
|
||||
if (!empty($status) > 0) {
|
||||
$query->whereIn('status', $status);
|
||||
}else{
|
||||
$query->whereIn('status', [config('constants.contract_template_obligation.status.active')]);
|
||||
}
|
||||
|
||||
$query->where('user_id', Auth::guard('user-api')->user()->id);
|
||||
|
||||
@@ -43,6 +43,8 @@ class EntityModule extends BaseController
|
||||
|
||||
if (!empty($status) > 0) {
|
||||
$query->whereIn('status', $status);
|
||||
}else{
|
||||
$query->whereIn('status', [config('constants.entity.status.active')]);
|
||||
}
|
||||
|
||||
$query->where('user_id', Auth::guard('user-api')->user()->id);
|
||||
|
||||
@@ -41,6 +41,8 @@ class EntitySignatureModule extends BaseController
|
||||
|
||||
if (!empty($status) > 0) {
|
||||
$query->whereIn('status', $status);
|
||||
}else{
|
||||
$query->whereIn('status', [config('constants.entity.status.active')]);
|
||||
}
|
||||
|
||||
$user_id = Auth::guard('user-api')->user()->id;
|
||||
|
||||
Generated
-15607
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<div>
|
||||
<b-modal :id="'contract-template-obligation-delete-modal'" size="lg" scrollable>
|
||||
<template v-slot:modal-title>
|
||||
<h4 class="modal-title">Contract Template Obligation Delete</h4>
|
||||
</template>
|
||||
<p class="text-center">
|
||||
Are you sure want to delete?
|
||||
</p>
|
||||
<template v-slot:modal-footer>
|
||||
|
||||
<form @submit.prevent="onSubmit">
|
||||
<v-btn
|
||||
:loading="loading"
|
||||
:disabled="loading"
|
||||
color="primary"
|
||||
class="white--text"
|
||||
@click="onCancel"
|
||||
>
|
||||
Cancel
|
||||
</v-btn>
|
||||
<v-btn
|
||||
:loading="loading"
|
||||
:disabled="loading"
|
||||
type="submit"
|
||||
color="primary"
|
||||
class="white--text"
|
||||
@click="loader = 'loading'"
|
||||
>
|
||||
Submit
|
||||
</v-btn>
|
||||
</form>
|
||||
</template>
|
||||
</b-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
export default {
|
||||
props: {
|
||||
selected_contract_template_obligation: Object,
|
||||
},
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
let vm = this;
|
||||
return {
|
||||
form: new Form({
|
||||
selected_contract_template_obligation_id: ''
|
||||
}),
|
||||
loader: null,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getExistDataList() {
|
||||
let vm = this;
|
||||
},
|
||||
resetData() {
|
||||
let vm = this;
|
||||
vm.form.contract_template_id = '';
|
||||
vm.loader = null;
|
||||
vm.loading = false;
|
||||
},
|
||||
onCancel(){
|
||||
let vm = this;
|
||||
vm.$bvModal.hide('contract-template-obligation-delete-modal');
|
||||
},
|
||||
onSubmit() {
|
||||
let vm = this;
|
||||
|
||||
vm.form.selected_contract_template_obligation_id = vm.selected_contract_template_obligation.hash_id;
|
||||
|
||||
const l = vm.loader
|
||||
vm[l] = !vm[l];
|
||||
let method = 'delete';
|
||||
let url = 'contract-template-obligation/delete/' + vm.selected_contract_template_obligation.hash_id;
|
||||
General.onComplete(url, vm.form, method, true)
|
||||
.then(data => {
|
||||
vm[l] = false
|
||||
vm.loader = null;
|
||||
vm.$bvModal.hide('contract-template-obligation-delete-modal');
|
||||
vm.$emit('refresh');
|
||||
General.toastedMessage('edit', 'Contract Template Obligation', data.data.hash_id);
|
||||
})
|
||||
.catch(function (error) {
|
||||
vm[l] = false
|
||||
vm.loader = null;
|
||||
});
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -83,6 +83,15 @@
|
||||
>
|
||||
<i class="fa fa-edit"></i>
|
||||
</button>
|
||||
|
||||
<button
|
||||
v-if="permission_list.includes('edit contract_template_obligation')"
|
||||
class="btn btn-xs btn-light"
|
||||
tag="button"
|
||||
@click="contractTemplateObligationDeleteModalToggle(contract)"
|
||||
>
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!contract_template_obligation_list.data || !contract_template_obligation_list.data[0]">
|
||||
@@ -128,6 +137,11 @@
|
||||
:mode="mode"
|
||||
@refresh="getContractTemplateObligationList()"
|
||||
></contract-template-obligation-form-modal>
|
||||
<contract-template-obligation-delete-modal
|
||||
:selected_contract_template_obligation="selected_contract_template_obligation"
|
||||
@refresh="getContractTemplateObligationList()"
|
||||
></contract-template-obligation-delete-modal>
|
||||
|
||||
<contract-template-obligation-dependency-table-modal
|
||||
:this_contract_template_obligation="selected_contract_template_obligation"
|
||||
:permission_list="permission_list"
|
||||
@@ -141,6 +155,7 @@
|
||||
<script type="text/javascript">
|
||||
import PaginateNav from '../../components/paginations/NextPerviousPagination';
|
||||
import ContractTemplateObligationFormModal from './FormModal';
|
||||
import ContractTemplateObligationDeleteModal from './DeleteModal';
|
||||
import ContractTemplateObligationDependencyTableModal from '../contract-template-obligation-denpendencies/TableModal';
|
||||
import ContractTemplateObligationContractTemplateDependencyTableModal from '../contract-template-obligation-contract-template-denpendencies/TableModal';
|
||||
import Draggable from 'vuedraggable';
|
||||
@@ -153,6 +168,7 @@
|
||||
components: {
|
||||
PaginateNav,
|
||||
ContractTemplateObligationFormModal,
|
||||
ContractTemplateObligationDeleteModal,
|
||||
ContractTemplateObligationDependencyTableModal,
|
||||
ContractTemplateObligationContractTemplateDependencyTableModal,
|
||||
Draggable
|
||||
@@ -181,8 +197,14 @@
|
||||
contractTemplateObligationEditModalToggle(selected_contract_template_obligation) {
|
||||
let vm = this;
|
||||
vm.mode = 'edit';
|
||||
vm.selected_contract_template_obligation = selected_contract_template_obligation;
|
||||
vm.$bvModal.show('contract-template-obligation-form-modal');
|
||||
},
|
||||
contractTemplateObligationDeleteModalToggle(selected_contract_template_obligation) {
|
||||
let vm = this;
|
||||
vm.selected_contract_template_obligation = selected_contract_template_obligation;
|
||||
vm.$bvModal.show('contract-template-obligation-delete-modal');
|
||||
},
|
||||
contractTemplateObligationDependencyTableModalToggle(selected_contract_template_obligation) {
|
||||
let vm = this;
|
||||
vm.selected_contract_template_obligation = selected_contract_template_obligation;
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<div>
|
||||
<b-modal :id="'contract-template-delete-modal'" size="lg" scrollable>
|
||||
<template v-slot:modal-title>
|
||||
<h4 class="modal-title">Contract Template Delete</h4>
|
||||
</template>
|
||||
<p class="text-center">
|
||||
Are you sure want to delete?
|
||||
</p>
|
||||
<template v-slot:modal-footer>
|
||||
|
||||
<form @submit.prevent="onSubmit">
|
||||
<v-btn
|
||||
:loading="loading"
|
||||
:disabled="loading"
|
||||
color="primary"
|
||||
class="white--text"
|
||||
@click="onCancel"
|
||||
>
|
||||
Cancel
|
||||
</v-btn>
|
||||
<v-btn
|
||||
:loading="loading"
|
||||
:disabled="loading"
|
||||
type="submit"
|
||||
color="primary"
|
||||
class="white--text"
|
||||
@click="loader = 'loading'"
|
||||
>
|
||||
Submit
|
||||
</v-btn>
|
||||
</form>
|
||||
</template>
|
||||
</b-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
export default {
|
||||
props: {
|
||||
this_contract_template: Object,
|
||||
},
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
let vm = this;
|
||||
return {
|
||||
form: new Form({
|
||||
contract_template_id: ''
|
||||
}),
|
||||
loader: null,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getExistDataList() {
|
||||
let vm = this;
|
||||
},
|
||||
resetData() {
|
||||
let vm = this;
|
||||
vm.form.contract_template_id = '';
|
||||
vm.loader = null;
|
||||
vm.loading = false;
|
||||
},
|
||||
onCancel(){
|
||||
let vm = this;
|
||||
vm.$bvModal.hide('contract-template-delete-modal');
|
||||
},
|
||||
onSubmit() {
|
||||
let vm = this;
|
||||
vm.form.contract_template_id = vm.this_contract_template.hash_id;
|
||||
const l = vm.loader
|
||||
vm[l] = !vm[l];
|
||||
let method = 'delete';
|
||||
let url = 'contract-template/delete/' + vm.this_contract_template.hash_id;
|
||||
General.onComplete(url, vm.form, method, true)
|
||||
.then(data => {
|
||||
vm[l] = false
|
||||
vm.loader = null;
|
||||
vm.$bvModal.hide('contract-template-delete-modal');
|
||||
vm.$emit('refresh');
|
||||
General.toastedMessage('edit', 'Contract Template', data.data.hash_id);
|
||||
})
|
||||
.catch(function (error) {
|
||||
vm[l] = false
|
||||
vm.loader = null;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -79,6 +79,14 @@
|
||||
>
|
||||
<i class="fa fa-edit"></i>
|
||||
</router-link>
|
||||
<button
|
||||
v-if="permission_list.includes('edit contract')"
|
||||
class="btn btn-xs btn-light"
|
||||
tag="button"
|
||||
@click="contractTemplateDeleteModalToggle(contract)"
|
||||
>
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!contract_template_list.data || !contract_template_list.data[0]">
|
||||
@@ -109,6 +117,11 @@
|
||||
:permission_list="permission_list"
|
||||
@refresh="getContractTemplateList()"
|
||||
></contract-template-obligation-table-modal>
|
||||
|
||||
<contract-template-delete-modal
|
||||
:this_contract_template="this_contract_template"
|
||||
@refresh="getContractTemplateList()"
|
||||
></contract-template-delete-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -116,12 +129,14 @@
|
||||
import ContractTemplateFilter from "./Filter";
|
||||
import PaginateNav from '../../components/paginations/NextPerviousPagination';
|
||||
import ContractTemplateObligationTableModal from '../contract-template-obligations/TableModal';
|
||||
import ContractTemplateDeleteModal from './DeleteModal';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ContractTemplateFilter,
|
||||
PaginateNav,
|
||||
ContractTemplateObligationTableModal
|
||||
ContractTemplateObligationTableModal,
|
||||
ContractTemplateDeleteModal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -145,6 +160,12 @@
|
||||
vm.this_contract_template = contract_template;
|
||||
vm.$bvModal.show('contract-template-obligation-table-modal');
|
||||
},
|
||||
contractTemplateDeleteModalToggle(selected_contract_template) {
|
||||
let vm = this;
|
||||
vm.mode = 'delete';
|
||||
vm.this_contract_template = selected_contract_template;
|
||||
vm.$bvModal.show('contract-template-delete-modal');
|
||||
},
|
||||
getPermissionList() {
|
||||
let vm = this;
|
||||
let url = 'user/self';
|
||||
@@ -212,4 +233,4 @@
|
||||
vm.getContractTemplateList();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -55,4 +55,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div>
|
||||
<b-modal :id="'contract-delete-modal'" size="lg" scrollable>
|
||||
<template v-slot:modal-title>
|
||||
<h4 class="modal-title">Contract Delete</h4>
|
||||
</template>
|
||||
<p class="text-center">
|
||||
Are you sure want to delete?
|
||||
</p>
|
||||
<template v-slot:modal-footer>
|
||||
|
||||
<form @submit.prevent="onSubmit">
|
||||
<v-btn
|
||||
:loading="loading"
|
||||
:disabled="loading"
|
||||
color="primary"
|
||||
class="white--text"
|
||||
@click="onCancel"
|
||||
>
|
||||
Cancel
|
||||
</v-btn>
|
||||
<v-btn
|
||||
:loading="loading"
|
||||
:disabled="loading"
|
||||
type="submit"
|
||||
color="primary"
|
||||
class="white--text"
|
||||
@click="loader = 'loading'"
|
||||
>
|
||||
Submit
|
||||
</v-btn>
|
||||
</form>
|
||||
</template>
|
||||
</b-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
export default {
|
||||
props: {
|
||||
selected_contract: Object,
|
||||
},
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
let vm = this;
|
||||
return {
|
||||
form: new Form({
|
||||
contract_id: ''
|
||||
}),
|
||||
loader: null,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getExistDataList() {
|
||||
let vm = this;
|
||||
},
|
||||
resetData() {
|
||||
let vm = this;
|
||||
vm.form.entity_id = '';
|
||||
vm.loader = null;
|
||||
vm.loading = false;
|
||||
},
|
||||
onCancel(){
|
||||
let vm = this;
|
||||
vm.$bvModal.hide('contract-delete-modal');
|
||||
},
|
||||
onSubmit() {
|
||||
let vm = this;
|
||||
vm.form.contract_id = vm.selected_contract.hash_id;
|
||||
|
||||
const l = vm.loader
|
||||
vm[l] = !vm[l];
|
||||
let method = 'delete';
|
||||
let url = 'contract/delete/' + vm.selected_contract.hash_id;
|
||||
General.onComplete(url, vm.form, method, true)
|
||||
.then(data => {
|
||||
vm[l] = false
|
||||
vm.loader = null;
|
||||
vm.$bvModal.hide('contract-delete-modal');
|
||||
vm.$emit('refresh');
|
||||
General.toastedMessage('edit', 'Contract', data.data.hash_id);
|
||||
})
|
||||
.catch(function (error) {
|
||||
vm[l] = false
|
||||
vm.loader = null;
|
||||
});
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -56,4 +56,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -61,7 +61,7 @@
|
||||
let vm = this;
|
||||
return {
|
||||
exist_admin_status: [],
|
||||
admin_status: General.autoCompleteKeyConvert(Constants.admin_status)
|
||||
admin_status: General.autoCompleteKeyConvert(Constants.contract_status)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -48,4 +48,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -36,9 +36,8 @@
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th style="width: 25%">Details</th>
|
||||
<th>Obligation</th>
|
||||
<th>Obligation Template</th>
|
||||
<th>Contract Entity</th>
|
||||
<th>Work Status</th>
|
||||
<th>Status</th>
|
||||
<th>Created</th>
|
||||
<th>Actions</th>
|
||||
@@ -48,7 +47,6 @@
|
||||
<tr v-if="contract_list.data" v-for="(contract, $index) in contract_list.data" :key="$index">
|
||||
<td>{{ $index + 1 }}</td>
|
||||
<td>
|
||||
<div><b>Hash ID</b>: {{ contract.hash_id }}</div>
|
||||
<div><b>Name</b>: {{ contract.name }}</div>
|
||||
<div><b>Complete Day Range</b>: {{ contract.complete_day_range }}</div>
|
||||
</td>
|
||||
@@ -56,7 +54,6 @@
|
||||
<div v-if="contract.contract_obligation_list" v-for="(obligation, $index) in contract.contract_obligation_list" :key="$index">
|
||||
<div>
|
||||
-{{ obligation.name }}
|
||||
<small>({{ obligation.hash_id }})</small>
|
||||
<small>({{ obligation.sequence }})</small>
|
||||
<small>({{ obligation.contract_entity_list[0] ? obligation.contract_entity_list[0].entity_list[0].name : '-' }})</small>
|
||||
</div>
|
||||
@@ -74,10 +71,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="'badge badge-warning'">Haven't Complete</span>
|
||||
</td>
|
||||
<td>
|
||||
<span :class="'badge badge-' + contract.status[0].color">{{ contract.status[0].name }}</span>
|
||||
<span :class="'badge badge-' + contract.status[0].color">{{ contract.status[0].name }}</span>
|
||||
</td>
|
||||
<td>
|
||||
{{ contract.created_at }}
|
||||
@@ -91,6 +85,14 @@
|
||||
>
|
||||
<i class="fa fa-edit"></i>
|
||||
</router-link>
|
||||
<button
|
||||
v-if="permission_list.includes('edit contract')"
|
||||
class="btn btn-xs btn-light"
|
||||
tag="button"
|
||||
@click="contractDeleteModalToggle(contract)"
|
||||
>
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!contract_list.data || !contract_list.data[0]">
|
||||
@@ -115,6 +117,10 @@
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<contract-delete-modal
|
||||
:selected_contract="selected_contract"
|
||||
@refresh="getContractList()"
|
||||
></contract-delete-modal>
|
||||
</b-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -122,11 +128,13 @@
|
||||
<script>
|
||||
import ContractFilter from "./Filter";
|
||||
import PaginateNav from '../../components/paginations/NextPerviousPagination';
|
||||
import ContractDeleteModal from './DeleteModal';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ContractFilter,
|
||||
PaginateNav
|
||||
PaginateNav,
|
||||
ContractDeleteModal
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -135,10 +143,11 @@
|
||||
status: General.returnAray(General.getURLParam('status[]')),
|
||||
page: General.getURLParam('page')
|
||||
}),
|
||||
colspan: 8,
|
||||
colspan: 7,
|
||||
filter_status: false,
|
||||
loading: true,
|
||||
contract_list: [],
|
||||
selected_contract:{},
|
||||
permission_list: []
|
||||
}
|
||||
},
|
||||
@@ -198,7 +207,12 @@
|
||||
let vm = this;
|
||||
vm.form.reset();
|
||||
vm.filterSubmit();
|
||||
}
|
||||
},
|
||||
contractDeleteModalToggle(selected_contract) {
|
||||
let vm = this;
|
||||
vm.selected_contract = selected_contract;
|
||||
vm.$bvModal.show('contract-delete-modal');
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
let vm = this;
|
||||
@@ -210,4 +224,4 @@
|
||||
vm.getContractList();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<div>
|
||||
<b-modal :id="'entity-delete-modal'" size="lg" scrollable>
|
||||
<template v-slot:modal-title>
|
||||
<h4 class="modal-title">Entity Delete</h4>
|
||||
</template>
|
||||
<p class="text-center">Are you sure want to delete?</p>
|
||||
<template v-slot:modal-footer>
|
||||
|
||||
<form @submit.prevent="onSubmit">
|
||||
<v-btn
|
||||
:loading="loading"
|
||||
:disabled="loading"
|
||||
color="primary"
|
||||
class="white--text"
|
||||
@click="onCancel"
|
||||
>
|
||||
Cancel
|
||||
</v-btn>
|
||||
<v-btn
|
||||
:loading="loading"
|
||||
:disabled="loading"
|
||||
type="submit"
|
||||
color="primary"
|
||||
class="white--text"
|
||||
@click="loader = 'loading'"
|
||||
>
|
||||
Submit
|
||||
</v-btn>
|
||||
</form>
|
||||
</template>
|
||||
</b-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
export default {
|
||||
props: {
|
||||
selected_entity: Object,
|
||||
},
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
let vm = this;
|
||||
return {
|
||||
form: new Form({
|
||||
entity_id: ''
|
||||
}),
|
||||
loader: null,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getExistDataList() {
|
||||
let vm = this;
|
||||
},
|
||||
resetData() {
|
||||
let vm = this;
|
||||
vm.form.entity_id = '';
|
||||
vm.loader = null;
|
||||
vm.loading = false;
|
||||
},
|
||||
onCancel(){
|
||||
let vm = this;
|
||||
vm.$bvModal.hide('contract-template-delete-modal');
|
||||
},
|
||||
onSubmit() {
|
||||
let vm = this;
|
||||
vm.form.entity_id = vm.selected_entity.hash_id;
|
||||
|
||||
const l = vm.loader
|
||||
vm[l] = !vm[l];
|
||||
let method = 'delete';
|
||||
let url = 'entity/delete/'+vm.selected_entity.hash_id;
|
||||
General.onComplete(url, vm.form, method, true)
|
||||
.then(data => {
|
||||
vm[l] = false
|
||||
vm.loader = null;
|
||||
vm.$bvModal.hide('entity-delete-modal');
|
||||
vm.$emit('refresh');
|
||||
General.toastedMessage('edit', 'Entity', data.data.hash_id);
|
||||
})
|
||||
.catch(function (error) {
|
||||
vm[l] = false
|
||||
vm.loader = null;
|
||||
});
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -62,6 +62,14 @@
|
||||
>
|
||||
<i class="fa fa-edit"></i>
|
||||
</router-link>
|
||||
<button
|
||||
v-if="permission_list.includes('edit contract')"
|
||||
class="btn btn-xs btn-light"
|
||||
tag="button"
|
||||
@click="entityDeleteModalToggle(contract)"
|
||||
>
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!entity_list.data || !entity_list.data[0]">
|
||||
@@ -87,17 +95,23 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</b-card>
|
||||
<entity-delete-modal
|
||||
:selected_entity="selected_entity"
|
||||
@refresh="getContractTemplateList()"
|
||||
></entity-delete-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ContractTemplateFilter from "./Filter";
|
||||
import PaginateNav from '../../components/paginations/NextPerviousPagination';
|
||||
import EntityDeleteModal from './DeleteModal';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ContractTemplateFilter,
|
||||
PaginateNav
|
||||
PaginateNav,
|
||||
EntityDeleteModal
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -110,6 +124,7 @@
|
||||
filter_status: false,
|
||||
loading: true,
|
||||
entity_list: [],
|
||||
selected_entity:{},
|
||||
permission_list: []
|
||||
}
|
||||
},
|
||||
@@ -169,7 +184,12 @@
|
||||
let vm = this;
|
||||
vm.form.reset();
|
||||
vm.filterSubmit();
|
||||
}
|
||||
},
|
||||
entityDeleteModalToggle(selected_entity) {
|
||||
let vm = this;
|
||||
vm.selected_entity = selected_entity;
|
||||
vm.$bvModal.show('entity-delete-modal');
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
let vm = this;
|
||||
@@ -181,4 +201,4 @@
|
||||
vm.getContractTemplateList();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -315,6 +315,13 @@ Route::group(['namespace' => 'User', 'prefix' => 'user-backsys/api'], function (
|
||||
'middleware' => ['permission:add contract']
|
||||
]
|
||||
);
|
||||
Route::delete('delete/{hash_id}',
|
||||
[
|
||||
'as' => 'api.contract.delete',
|
||||
'uses' => 'ContractController@delete',
|
||||
'middleware' => ['permission:delete contract']
|
||||
]
|
||||
);
|
||||
});
|
||||
|
||||
// Contract Entity
|
||||
|
||||
Reference in New Issue
Block a user