diff --git a/src/composables/useEnv.js b/src/composables/useEnv.js
new file mode 100644
index 000000000..2aa576e1e
--- /dev/null
+++ b/src/composables/useEnv.js
@@ -0,0 +1,6 @@
+export function isProduction(localAsProduction = true) {
+ return (
+ (!process.env.NODE_ENV && localAsProduction) ||
+ process.env.NODE_ENV == 'production'
+ );
+}
diff --git a/src/pages/Worker/Card/WorkerPda.vue b/src/pages/Worker/Card/WorkerPda.vue
index a6c3a03bc..57397801c 100644
--- a/src/pages/Worker/Card/WorkerPda.vue
+++ b/src/pages/Worker/Card/WorkerPda.vue
@@ -8,6 +8,7 @@ import useNotify from 'src/composables/useNotify.js';
import FetchData from 'components/FetchData.vue';
import FormModelPopup from 'src/components/FormModelPopup.vue';
import { useVnConfirm } from 'composables/useVnConfirm';
+import { isProduction } from 'composables/useEnv';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
import VnRow from 'components/ui/VnRow.vue';
@@ -18,7 +19,6 @@ const { t } = useI18n();
const { notify } = useNotify();
const paginate = ref();
-const isDocuware = ref(false);
const dialog = ref();
const route = useRoute();
const { openConfirmationModal } = useVnConfirm();
@@ -50,18 +50,50 @@ function reloadData() {
paginate.value.fetch();
}
-const handleSendToTablet = async (deviceProductionFk) => {
+const handleSendToTablet = async (row) => {
try {
- await axios.post(`Docuwares/upload`, {
- fileCabinet: 'hr',
- ids: [deviceProductionFk],
- });
- notify(t('PDA Signed'), 'positive');
+ if (isProduction(false)) {
+ const { deviceProductionFk } = row;
+ await axios.post(`Docuwares/upload`, {
+ fileCabinet: 'hr',
+ ids: [deviceProductionFk],
+ });
+ }
+ notify(t('PDF sended to signed'), 'positive');
+ row.isDocuware = true;
+ } catch (err) {
+ console.error('Error removing department');
+ }
+};
+const handleRefreshDocuware = async (row) => {
+ try {
+ if (isProduction()) {
+ const { deviceProductionFk } = row;
+ await axios.post(`Docuwares/upload`, {
+ fileCabinet: 'hr',
+ ids: [deviceProductionFk],
+ });
+ }
+ notify(t('PDA Signed'), 'positive');
+ row.isSigned = true;
+ } catch (err) {
+ console.error('Error removing department');
+ }
+};
+const handleDownloadDocuware = async (row) => {
+ try {
+ if (isProduction(false)) {
+ const { deviceProductionFk } = row;
+ await axios.post(`Docuwares/upload`, {
+ fileCabinet: 'hr',
+ ids: [deviceProductionFk],
+ });
+ }
+ notify(t('PDF downloaded'), 'positive');
} catch (err) {
console.error('Error removing department');
}
};
-const handleDownloadDocuware = async (deviceProductionFk) => {};
@@ -113,6 +145,7 @@ const handleDownloadDocuware = async (deviceProductionFk) => {};
:model-value="row?.simSerialNumber"
disable
/>
+
{};
{{ t('worker.pda.removePDA') }}
+
+
+ {{ t('worker.pda.download') }}
+
+
+
+
+ {{ t('worker.pda.refresh') }}
+
+
+ handleSendToTablet(row)
+ )
+ "
+ >
+
+ {{ t('worker.pda.sendToTablet') }}
+
+
@@ -147,10 +223,10 @@ const handleDownloadDocuware = async (deviceProductionFk) => {};
{};
es:
Model: Modelo
Serial number: Número de serie
+ SIM serial number: (SIM) Número de serie
Current SIM: SIM actual
Add new device: Añadir nuevo dispositivo
PDA deallocated: PDA desasignada
@@ -203,4 +280,9 @@ es:
Do you want to remove this PDA?: ¿Desea eliminar este PDA?
You can only have one PDA: Solo puedes tener un PDA si no eres autonomo
This PDA is already assigned to another user: Este PDA ya está asignado a otro usuario
+ Are you sure you want to send it?: ¿Estás seguro que lo quieres enviar?
+ Sign PDA: Firmar PDA
+ PDF sended to signed: PDF enviado para firmar
+ PDA signed: PDA firmado
+ PDF download: PDF descargado