Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* eslint-disable */
- import {sanitizeString} from '@@/pocket/fn';
- export const state = () => ({
- searchDossiersEnCours: '',
- selectedUserKey: '',
- tableHeaders: [
- {text: 'Dossier', align: 'left', sortable: false, value: 'id'},
- {text: 'Client', align: 'left', sortable: true, value: 'client'},
- {text: 'Mission', align: 'left', sortable: true, value: 'mission'},
- {
- text: 'Type',
- align: 'left',
- sortable: true,
- value: 'type',
- },
- {text: 'Demandeur', align: 'left', sortable: true, value: 'demandeur'},
- {
- text: 'Validateur',
- align: 'left',
- sortable: true,
- value: 'validateur',
- },
- {text: 'Associé', align: 'left', sortable: true, value: 'associe'},
- // {
- // text: 'Statut',
- // align: 'left',
- // sortable: true,
- // value: 'statut',
- // },
- {text: 'Actions', align: 'left', sortable: false, value: 'actions'},
- ],
- tableData: [
- {
- id: '37350',
- client: 'PHARMACIE VENOIX',
- mission: '2018-08',
- debutPeriode: '2018-08',
- finPeriode: '2018-08',
- type: 'Situation',
- demandeur: 'J.BOISSEL',
- validateur: 'J.BOISSEL',
- associe: 'E.BATTEUR',
- statut: 0,
- modification: '2018-11-26 à 9H57',
- actions: '',
- commentaires: '',
- documents: [],
- destinataires: [],
- juridique: {},
- facturation: {},
- suiviMission: {},
- },
- {
- id: '42263',
- client: 'ERIADIS',
- mission: '2018-08',
- debutPeriode: '2018-08',
- finPeriode: '2018-08',
- type: 'Bilan',
- demandeur: 'J.BOISSEL',
- validateur: 'A.JAN',
- associe: 'E.BATTEUR',
- statut: -1,
- modification: '2019-03-06 à 11H25',
- actions: '',
- commentaires: '',
- documents: [],
- destinataires: [],
- juridique: {},
- facturation: {},
- suiviMission: {},
- },
- {
- id: '92105',
- client: 'ENFANTILLAGE',
- mission: '2018-08',
- debutPeriode: '2018-08',
- finPeriode: '2018-08',
- type: 'Bilan',
- demandeur: 'J.AKAKPO',
- validateur: 'A.JAN',
- associe: 'E.BATTEUR',
- statut: 1,
- modification: '2019-03-25 à 09H35',
- actions: '',
- commentaires: '',
- documents: [],
- destinataires: [],
- juridique: {},
- facturation: {},
- suiviMission: {},
- },
- {
- id: '92240',
- client: 'FAVEDIST',
- mission: '2018-08',
- debutPeriode: '2018-08',
- finPeriode: '2018-08',
- type: 'Situation',
- demandeur: 'J.BOISSEL',
- validateur: 'A.JAN',
- associe: 'M.LEROUX',
- statut: 3,
- modification: '2019-03-06 à 14H12',
- actions: '',
- commentaires: '',
- documents: [],
- destinataires: [],
- juridique: {},
- facturation: {},
- suiviMission: {},
- },
- {
- id: '63660',
- client: 'HORTENSE SYLVAIN',
- mission: '2018-08',
- debutPeriode: '2018-08',
- finPeriode: '2018-08',
- type: 'Bilan',
- demandeur: 'J.AKAKPO',
- validateur: 'J.BOISSEL',
- associe: 'M.LEROUX',
- statut: 2,
- modification: '2018-12-16 à 16H18',
- actions: '',
- commentaires: '',
- documents: [],
- destinataires: [],
- juridique: {},
- facturation: {},
- suiviMission: {},
- },
- ],
- dossiersATraiter: [
- {
- id: '92105',
- client: 'ENFANTILLAGE',
- mission: '2018-08',
- debutPeriode: '2018-08',
- finPeriode: '2018-08',
- type: 'Bilan',
- demandeur: 'J.AKAKPO',
- validateur: 'A.JAN',
- associe: 'E.BATTEUR',
- statut: 1,
- modification: '2019-03-25 à 09H35',
- actions: '',
- commentaires: '',
- documents: [],
- destinataires: [],
- juridique: {},
- facturation: {},
- suiviMission: {},
- comments: "<strong class='text--danger'>180</strong> jours après l'envoi limite de la liasse fiscale <br> (Mission: août 2018)",
- },
- {
- id: '37350',
- client: 'PHARMACIE VENOIX',
- mission: '2018-08',
- debutPeriode: '2018-08',
- finPeriode: '2018-08',
- type: 'Situation',
- demandeur: 'J.BOISSEL',
- validateur: 'J.BOISSEL',
- associe: 'E.BATTEUR',
- statut: 0,
- modification: '2018-11-26 à 9H57',
- actions: '',
- commentaires: '',
- documents: [],
- destinataires: [],
- juridique: {},
- facturation: {},
- suiviMission: {},
- comments: "<strong class='text--danger'>180</strong> jours après l'envoi limite de la liasse fiscale <br> (Mission: août 2018)",
- },
- {
- id: '42263',
- client: 'ERIADIS',
- mission: '2018-08',
- debutPeriode: '2018-08',
- finPeriode: '2018-08',
- type: 'Bilan',
- demandeur: 'J.BOISSEL',
- validateur: 'A.JAN',
- associe: 'E.BATTEUR',
- statut: -1,
- modification: '2019-03-06 à 11H25',
- actions: '',
- commentaires: '',
- documents: [],
- destinataires: [],
- juridique: {},
- facturation: {},
- suiviMission: {},
- comments: "<strong class='text--danger'>180</strong> jours après l'envoi limite de la liasse fiscale <br> (Mission: août 2018)",
- },
- {
- id: '63660',
- client: 'HORTENSE SYLVAIN',
- mission: '2018-08',
- debutPeriode: '2018-08',
- finPeriode: '2018-08',
- type: 'Bilan',
- demandeur: 'J.AKAKPO',
- validateur: 'J.BOISSEL',
- associe: 'M.LEROUX',
- statut: 2,
- modification: '2018-12-16 à 16H18',
- actions: '',
- commentaires: '',
- documents: [],
- destinataires: [],
- juridique: {},
- facturation: {},
- suiviMission: {},
- comments: "<strong class='text--danger'>180</strong> jours après l'envoi limite de la liasse fiscale <br> (Mission: août 2018)",
- },
- ],
- showFoldersFrom: 'forMe',
- });
- export const actions = {};
- export const getters = {
- searchDossiersEnCours: state => state.searchDossiersEnCours,
- showFoldersFrom: state => state.showFoldersFrom,
- selectedUserKey: state => state.selectedUserKey,
- tableHeaders: state => state.tableHeaders,
- tableData: state => {
- return [
- ...state.tableData
- .filter (_ => {
- if (state.showFoldersFrom !== 'all' && !!state.selectedUserKey) {
- return [
- sanitizeString (_.demandeur),
- sanitizeString (_.validateur),
- sanitizeString (_.associe),
- ].includes (sanitizeString (state.selectedUserKey));
- }
- return true;
- })
- .filter (_ => {
- return (
- sanitizeString (_.id).includes (
- sanitizeString (state.searchDossiersEnCours)
- ) ||
- sanitizeString (_.dossier).includes (
- sanitizeString (state.searchDossiersEnCours)
- ) ||
- sanitizeString (_.client).includes (
- sanitizeString (state.searchDossiersEnCours)
- ) ||
- sanitizeString (_.mission).includes (
- sanitizeString (state.searchDossiersEnCours)
- ) ||
- sanitizeString (_.respClient).includes (
- sanitizeString (state.searchDossiersEnCours)
- )
- );
- }),
- ];
- },
- // Dossiers à traiter
- dossiersATraiter: state => {
- return [
- ...state.dossiersATraiter
- .filter (_ => {
- if (state.showFoldersFrom !== 'all' && !!state.selectedUserKey) {
- return [
- sanitizeString (_.demandeur),
- sanitizeString (_.validateur),
- sanitizeString (_.associe),
- ].includes (sanitizeString (state.selectedUserKey));
- }
- return true;
- })
- .filter (_ => {
- return (
- sanitizeString (_.id).includes (
- sanitizeString (state.searchDossiersEnCours)
- ) ||
- sanitizeString (_.dossier).includes (
- sanitizeString (state.searchDossiersEnCours)
- ) ||
- sanitizeString (_.client).includes (
- sanitizeString (state.searchDossiersEnCours)
- ) ||
- sanitizeString (_.mission).includes (
- sanitizeString (state.searchDossiersEnCours)
- ) ||
- sanitizeString (_.respClient).includes (
- sanitizeString (state.searchDossiersEnCours)
- )
- );
- })
- .concat ([{header: 'Missions à traiter'}]),
- ].reverse ();
- },
- // Avec un index du statut => le texte correspondant
- statutText: (state, statutIndex) => {
- return statutIndex => {
- const map = {
- '-1': 'A traiter',
- 0: 'Brouillon',
- 1: 'Validation',
- 2: 'Signature',
- 3: 'Finalisation',
- };
- return map[statutIndex] || '';
- };
- },
- // Avec un index du statut => la couleur correspondante
- statutColor: (state, statutIndex) => {
- return statutIndex => {
- const map = {
- '-1': 'red',
- 0: '#607D8B',
- 1: 'info',
- 2: 'warning',
- 3: 'success',
- };
- return map[statutIndex] || 'black';
- };
- },
- // Avec un index du statut => la valeur correspondante
- statutValue: (state, statutIndex) => {
- return statutIndex => {
- const map = {
- '-1': 5,
- 0: 20,
- 1: 35,
- 2: 65,
- 3: 85,
- };
- return map[statutIndex] || 0;
- };
- },
- // Get modal data
- modalData: state => {
- return id => {
- return {...state.tableData.filter (_ => _.id === id)[0]};
- };
- },
- };
- export const mutations = {
- UPDATE_SHOW_FOLDERS_FROM: (state, payload) => {
- state.showFoldersFrom = payload.showFoldersFrom;
- state.selectedUserKey = payload.selectedUserKey;
- },
- UPDATE_SEARCH_DOSSIERS_EN_COURS: (state, payload) => {
- state.searchDossiersEnCours = payload.data;
- },
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement