- catalogo macro, importazione dati
This commit is contained in:
@@ -78,6 +78,10 @@ export default defineComponent({
|
||||
label: 'converti da TXT seperato senza spazi',
|
||||
value: shared_consts.Cmd.CAT_NO_SPAZI
|
||||
},
|
||||
{
|
||||
label: 'Importa da JSON (ImportaMacro)',
|
||||
value: shared_consts.Cmd.MACRO_CATALOGO_JSON
|
||||
},
|
||||
]
|
||||
)
|
||||
|
||||
@@ -144,6 +148,11 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function created() {
|
||||
|
||||
// se idapp = 18
|
||||
if (tools.getIdApp() === tools.IDAPP_MACRO) {
|
||||
cosafare.value = shared_consts.Cmd.MACRO_CATALOGO_JSON
|
||||
}
|
||||
inputfile.value = ''
|
||||
|
||||
if (caricaDatiToggle.value) {
|
||||
@@ -302,6 +311,10 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
|
||||
function importMacroCatalogoJson(cmd: number, testo: string) {
|
||||
return testo
|
||||
}
|
||||
|
||||
function importNoSpazi(cmd: number, testo: string) {
|
||||
|
||||
const delim = '\n';
|
||||
@@ -343,6 +356,8 @@ export default defineComponent({
|
||||
return importCmdTxt(cmd, testo);
|
||||
} else if (cmd === shared_consts.Cmd.CAT_NO_SPAZI) {
|
||||
return importNoSpazi(cmd, testo);
|
||||
} else if (cmd === shared_consts.Cmd.MACRO_CATALOGO_JSON) {
|
||||
return importMacroCatalogoJson(cmd, testo);
|
||||
}
|
||||
|
||||
function addfield(col: number, field: string, rec: any, opt: any) {
|
||||
@@ -562,6 +577,13 @@ export default defineComponent({
|
||||
risultato.value = ''
|
||||
}
|
||||
|
||||
function eseguiCmdCatalogoJson() {
|
||||
let options = { aggiornaStockQty: checkAggiornaQta.value }
|
||||
|
||||
userStore.importToServerCmd($q, t, cosafare.value, { arrdata: risultato.value, options })
|
||||
risultato.value = ''
|
||||
}
|
||||
|
||||
function createProvLink() {
|
||||
let str = ''
|
||||
|
||||
@@ -607,6 +629,7 @@ export default defineComponent({
|
||||
eseguiCmdProduct,
|
||||
checkAggiornaQta,
|
||||
eseguiCmdInventario,
|
||||
eseguiCmdCatalogoJson,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
<br>
|
||||
|
||||
<br>
|
||||
<q-btn v-if="(cosafare !== shared_consts.Cmd.PRODUCTS && cosafare !== shared_consts.Cmd.PRODUCTS_V2)" label="Esegui" @click="eseguiCmd"></q-btn>
|
||||
<q-btn v-else-if="cosafare === shared_consts.Cmd.PRODUCTS" label="Importa Prodotti" @click="eseguiCmdProduct"></q-btn>
|
||||
<q-btn v-if="cosafare === shared_consts.Cmd.PRODUCTS" label="Importa Prodotti" @click="eseguiCmdProduct"></q-btn>
|
||||
<q-btn v-else-if="cosafare === shared_consts.Cmd.PRODUCTS_V2" label="Importa Prodotti Versione 2" @click="eseguiCmdProduct"></q-btn>
|
||||
<q-btn v-else-if="cosafare === shared_consts.Cmd.INVENTARIO" label="Importa Inventario" @click="eseguiCmdInventario"></q-btn>
|
||||
|
||||
<q-btn v-else-if="cosafare === shared_consts.Cmd.MACRO_CATALOGO_JSON" label="Importa Catalogo JSON" @click="eseguiCmdCatalogoJson"></q-btn>
|
||||
<q-btn v-else label="Esegui" @click="eseguiCmd"></q-btn>
|
||||
<br>
|
||||
<q-btn label="Genera HTML Province Territoriali" @click="createProvLink"></q-btn>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user