mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-13 23:20:12 +08:00
Point of Sale Processes (#583)
* Cancel sale transaction * minimal change * Copy Order * Copy Line the Order * add Traslation
This commit is contained in:
parent
e2bbc598a7
commit
737d85b0ba
@ -125,18 +125,20 @@ export function requestGetOrder(orderUuid) {
|
|||||||
|
|
||||||
// Create order from POS
|
// Create order from POS
|
||||||
export function requestDeleteOrder({
|
export function requestDeleteOrder({
|
||||||
posUuid,
|
orderUuid
|
||||||
customerUuid,
|
// posUuid,
|
||||||
documentTypeUuid,
|
// customerUuid,
|
||||||
salesRepresentativeUuid
|
// documentTypeUuid,
|
||||||
|
// salesRepresentativeUuid
|
||||||
}) {
|
}) {
|
||||||
return requestRest({
|
return requestRest({
|
||||||
url: '/pos/delete-order',
|
url: '/pos/delete-order',
|
||||||
data: {
|
data: {
|
||||||
pos_uuid: posUuid,
|
order_uuid: orderUuid
|
||||||
customer_uuid: customerUuid,
|
// pos_uuid: posUuid,
|
||||||
document_type_uuid: documentTypeUuid,
|
// customer_uuid: customerUuid,
|
||||||
sales_representative_uuid: salesRepresentativeUuid
|
// document_type_uuid: documentTypeUuid,
|
||||||
|
// sales_representative_uuid: salesRepresentativeUuid
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(evaluateResponse)
|
.then(evaluateResponse)
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
close-on-click-modal
|
close-on-click-modal
|
||||||
>
|
>
|
||||||
{{ modalMetadata.description }}<br><br>
|
{{ modalMetadata.description }}<br><br>
|
||||||
|
<div
|
||||||
|
v-if="panelType !== 'From'"
|
||||||
|
>
|
||||||
<sequence-order
|
<sequence-order
|
||||||
v-if="modalMetadata.isSortTab"
|
v-if="modalMetadata.isSortTab"
|
||||||
key="order"
|
key="order"
|
||||||
@ -30,6 +33,7 @@
|
|||||||
:panel-type="modalMetadata.panelType"
|
:panel-type="modalMetadata.panelType"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
</div>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button
|
<el-button
|
||||||
@click="closeDialog"
|
@click="closeDialog"
|
||||||
@ -144,6 +148,20 @@ export default {
|
|||||||
this.closeDialog()
|
this.closeDialog()
|
||||||
} else if (action !== undefined) {
|
} else if (action !== undefined) {
|
||||||
const fieldNotReady = this.$store.getters.isNotReadyForSubmit(action.uuid)
|
const fieldNotReady = this.$store.getters.isNotReadyForSubmit(action.uuid)
|
||||||
|
if (this.panelType === 'From') {
|
||||||
|
this.$store.dispatch('processPos', {
|
||||||
|
action: action, // process metadata
|
||||||
|
parentUuid: this.parentUuid,
|
||||||
|
idProcess: this.$store.getters.getFindOrder.id,
|
||||||
|
containerUuid: this.containerUuid,
|
||||||
|
panelType: this.panelType, // determinate if get table name and record id (window) or selection (browser)
|
||||||
|
parametersList: this.$store.getters.getPosParameters
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.warn(error)
|
||||||
|
})
|
||||||
|
this.closeDialog()
|
||||||
|
} else {
|
||||||
if (!fieldNotReady) {
|
if (!fieldNotReady) {
|
||||||
this.closeDialog()
|
this.closeDialog()
|
||||||
const porcesTabla = this.$store.getters.getProcessSelect.processTablaSelection
|
const porcesTabla = this.$store.getters.getProcessSelect.processTablaSelection
|
||||||
@ -186,6 +204,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -5,7 +5,11 @@
|
|||||||
<br>
|
<br>
|
||||||
{{ $t('form.pos.optionsPoinSales.title') }}
|
{{ $t('form.pos.optionsPoinSales.title') }}
|
||||||
</div>
|
</div>
|
||||||
|
<modal-dialog
|
||||||
|
:parent-uuid="processPos"
|
||||||
|
:container-uuid="processPos"
|
||||||
|
panel-type="From"
|
||||||
|
/>
|
||||||
<el-collapse v-model="activeName" accordion>
|
<el-collapse v-model="activeName" accordion>
|
||||||
<el-collapse-item :title="$t('form.pos.optionsPoinSales.salesOrder.title')" name="salesOrder">
|
<el-collapse-item :title="$t('form.pos.optionsPoinSales.salesOrder.title')" name="salesOrder">
|
||||||
<el-row :gutter="12" style="padding-right: 10px;">
|
<el-row :gutter="12" style="padding-right: 10px;">
|
||||||
@ -121,6 +125,30 @@
|
|||||||
</p>
|
</p>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="size">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<p
|
||||||
|
:style="blockOption"
|
||||||
|
@click="copyLineOrder "
|
||||||
|
>
|
||||||
|
<i class="el-icon-document-copy" />
|
||||||
|
<br>
|
||||||
|
{{ $t('form.pos.optionsPoinSales.salesOrder.copyOrderLine') }}
|
||||||
|
</p>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="size">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<p
|
||||||
|
:style="blockOption"
|
||||||
|
@click="copyOrder "
|
||||||
|
>
|
||||||
|
<i class="el-icon-document-copy" />
|
||||||
|
<br>
|
||||||
|
{{ $t('form.pos.optionsPoinSales.salesOrder.copyOrder') }}
|
||||||
|
</p>
|
||||||
|
</el-card>
|
||||||
|
</el-col> -->
|
||||||
<el-col :span="size">
|
<el-col :span="size">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
@ -266,19 +294,26 @@ import {
|
|||||||
requestPrintOrder,
|
requestPrintOrder,
|
||||||
requestGenerateImmediateInvoice,
|
requestGenerateImmediateInvoice,
|
||||||
requestCompletePreparedOrder,
|
requestCompletePreparedOrder,
|
||||||
requestReverseSalesTransaction,
|
// requestReverseSalesTransaction,
|
||||||
requestCreateWithdrawal,
|
requestCreateWithdrawal,
|
||||||
requestCreateNewCustomerReturnOrder,
|
requestCreateNewCustomerReturnOrder,
|
||||||
requestCashClosing,
|
requestCashClosing,
|
||||||
requestDeleteOrder
|
requestDeleteOrder
|
||||||
} from '@/api/ADempiere/form/point-of-sales.js'
|
} from '@/api/ADempiere/form/point-of-sales.js'
|
||||||
|
import ModalDialog from '@/components/ADempiere/Dialog'
|
||||||
|
import posProcess from '@/utils/ADempiere/constants/posProcess'
|
||||||
|
import orderLineMixin from '@/components/ADempiere/Form/VPOS/Order/orderLineMixin.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Options',
|
name: 'Options',
|
||||||
components: {
|
components: {
|
||||||
ListProductPrice,
|
ListProductPrice,
|
||||||
OrdersList
|
OrdersList,
|
||||||
|
ModalDialog
|
||||||
},
|
},
|
||||||
|
mixins: [
|
||||||
|
orderLineMixin
|
||||||
|
],
|
||||||
props: {
|
props: {
|
||||||
metadata: {
|
metadata: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -287,7 +322,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName: ''
|
activeName: '',
|
||||||
|
processPos: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -318,6 +354,9 @@ export default {
|
|||||||
return this.$store.getters.getSellingPointsList
|
return this.$store.getters.getSellingPointsList
|
||||||
},
|
},
|
||||||
currentPOS() {
|
currentPOS() {
|
||||||
|
return this.$store.getters.getOrder
|
||||||
|
},
|
||||||
|
currentPoint() {
|
||||||
return this.$store.getters.getCurrentPOS
|
return this.$store.getters.getCurrentPOS
|
||||||
},
|
},
|
||||||
pointOfSalesId() {
|
pointOfSalesId() {
|
||||||
@ -361,8 +400,7 @@ export default {
|
|||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.info(`VPOS/Options component (New Order): ${error.message}`)
|
console.info(`VPOS/Options component (New Order): ${error.message}`)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
const { templateBusinessPartner } = this.currentPOS
|
// const { templateBusinessPartner } = this.currentPOS
|
||||||
|
|
||||||
this.$store.commit('updateValuesOfContainer', {
|
this.$store.commit('updateValuesOfContainer', {
|
||||||
containerUuid: this.metadata.containerUuid,
|
containerUuid: this.metadata.containerUuid,
|
||||||
attributes: [{
|
attributes: [{
|
||||||
@ -375,15 +413,15 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
columnName: 'C_BPartner_ID',
|
columnName: 'C_BPartner_ID',
|
||||||
value: templateBusinessPartner.id
|
value: 1000006
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
columnName: 'DisplayColumn_C_BPartner_ID',
|
columnName: 'DisplayColumn_C_BPartner_ID',
|
||||||
value: templateBusinessPartner.name
|
value: 'Cliente Unico'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
columnName: ' C_BPartner_ID_UUID',
|
columnName: ' C_BPartner_ID_UUID',
|
||||||
value: templateBusinessPartner.uuid
|
value: '9f6cf428-9209-11e9-8046-0242ac140002'
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -417,9 +455,33 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
reverseSalesTransaction() {
|
reverseSalesTransaction() {
|
||||||
// TODO: Add BPartner
|
const process = this.$store.getters.getProcess(posProcess[1].uuid)
|
||||||
requestReverseSalesTransaction({
|
this.$store.dispatch('startProcess', {
|
||||||
orderUuid: this.$route.query.action
|
action: process,
|
||||||
|
isProcessTableSelection: false,
|
||||||
|
containerUuid: process.containerUuid,
|
||||||
|
parametersList: [
|
||||||
|
{
|
||||||
|
columnName: 'C_Order_ID',
|
||||||
|
value: this.currentPOS.id
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnName: 'Bill_BPartner_ID',
|
||||||
|
value: this.currentPOS.businessPartner.id
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnName: 'IsCancelled',
|
||||||
|
value: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnName: 'IsShipConfirm',
|
||||||
|
value: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnName: 'C_DocTypeRMA_ID',
|
||||||
|
value: 'VO'
|
||||||
|
}
|
||||||
|
]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
createWithdrawal() {
|
createWithdrawal() {
|
||||||
@ -435,6 +497,25 @@ export default {
|
|||||||
orderUuid: this.$route.query.action
|
orderUuid: this.$route.query.action
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
showModal(action) {
|
||||||
|
this.$store.dispatch('setShowDialog', {
|
||||||
|
type: action.type,
|
||||||
|
action: {
|
||||||
|
...action,
|
||||||
|
containerUuid: action.uuid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
copyOrder() {
|
||||||
|
this.processPos = posProcess[5].uuid
|
||||||
|
const process = this.$store.getters.getProcess(posProcess[5].uuid)
|
||||||
|
this.showModal(process)
|
||||||
|
},
|
||||||
|
copyLineOrder() {
|
||||||
|
this.processPos = posProcess[5].uuid
|
||||||
|
const process = this.$store.getters.getProcess(posProcess[5].uuid)
|
||||||
|
this.showModal(process)
|
||||||
|
},
|
||||||
cashClosing() {
|
cashClosing() {
|
||||||
const { uuid: posUuid, id: posId } = this.getCurrentPOS
|
const { uuid: posUuid, id: posId } = this.getCurrentPOS
|
||||||
requestCashClosing({
|
requestCashClosing({
|
||||||
@ -446,7 +527,19 @@ export default {
|
|||||||
requestDeleteOrder({
|
requestDeleteOrder({
|
||||||
orderUuid: this.$route.query.action
|
orderUuid: this.$route.query.action
|
||||||
})
|
})
|
||||||
this.newOrder()
|
.then(response => {
|
||||||
|
this.changePos(this.$store.getters.getCurrentPOS)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.$store.dispatch('listOrdersFromServer', {
|
||||||
|
posUuid: this.$store.getters.getCurrentPOS.uuid
|
||||||
|
})
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: 'Orden Cancelada',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
<el-main style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px;">
|
<el-main style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px;">
|
||||||
<el-table
|
<el-table
|
||||||
ref="linesTable"
|
ref="linesTable"
|
||||||
|
v-loading="updateOrderProcessPos"
|
||||||
v-shortkey="shortsKey"
|
v-shortkey="shortsKey"
|
||||||
:data="allOrderLines"
|
:data="allOrderLines"
|
||||||
border
|
border
|
||||||
@ -445,10 +446,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
this.tenderTypeDisplaye()
|
// this.tenderTypeDisplaye()
|
||||||
this.currencyDisplaye()
|
// this.currencyDisplaye()
|
||||||
}, 1500)
|
// }, 1500)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changePos(posElement) {
|
changePos(posElement) {
|
||||||
|
@ -45,7 +45,8 @@
|
|||||||
:highlight-current-row="highlightRow"
|
:highlight-current-row="highlightRow"
|
||||||
:height="heightTable"
|
:height="heightTable"
|
||||||
@shortkey.native="keyAction"
|
@shortkey.native="keyAction"
|
||||||
@current-change="handleCurrentChange"
|
@current-change="orderPrpcess"
|
||||||
|
@row-dblclick="handleCurrentChange"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="documentNo"
|
prop="documentNo"
|
||||||
@ -197,11 +198,18 @@ export default {
|
|||||||
// },
|
// },
|
||||||
created() {
|
created() {
|
||||||
this.unsubscribe = this.subscribeChanges()
|
this.unsubscribe = this.subscribeChanges()
|
||||||
|
|
||||||
if (this.isReadyFromGetData) {
|
if (this.isReadyFromGetData) {
|
||||||
this.loadOrdersList()
|
this.loadOrdersList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
const listOrder = this.$store.getters.getListOrderLine
|
||||||
|
if (this.isEmptyValue(listOrder)) {
|
||||||
|
this.$store.dispatch('listOrdersFromServer', {
|
||||||
|
posUuid: this.$store.getters.getCurrentPOS.uuid
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.unsubscribe()
|
this.unsubscribe()
|
||||||
},
|
},
|
||||||
@ -315,6 +323,13 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return valuesToSend
|
return valuesToSend
|
||||||
|
},
|
||||||
|
orderPrpcess(row) {
|
||||||
|
const parametersList = [{
|
||||||
|
columnName: 'C_Order_ID',
|
||||||
|
value: row.id
|
||||||
|
}]
|
||||||
|
this.$store.dispatch('addParametersProcessPos', parametersList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ import {
|
|||||||
formatPrice,
|
formatPrice,
|
||||||
formatQuantity
|
formatQuantity
|
||||||
} from '@/utils/ADempiere/valueFormat.js'
|
} from '@/utils/ADempiere/valueFormat.js'
|
||||||
|
import posProcess from '@/utils/ADempiere/constants/posProcess'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'POSMixin',
|
name: 'POSMixin',
|
||||||
@ -51,7 +52,8 @@ export default {
|
|||||||
quantityAvailable: 0
|
quantityAvailable: 0
|
||||||
},
|
},
|
||||||
edit: false,
|
edit: false,
|
||||||
displayType: ''
|
displayType: '',
|
||||||
|
process: posProcess
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -80,7 +82,18 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.$store.getters.getFindOrder
|
return {
|
||||||
|
documentType: {},
|
||||||
|
documentStatus: {
|
||||||
|
value: ''
|
||||||
|
},
|
||||||
|
totalLines: 0,
|
||||||
|
grandTotal: 0,
|
||||||
|
salesRepresentative: {},
|
||||||
|
businessPartner: {
|
||||||
|
value: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
currentPoint() {
|
currentPoint() {
|
||||||
return this.$store.getters.getCurrentPOS
|
return this.$store.getters.getCurrentPOS
|
||||||
@ -103,6 +116,9 @@ export default {
|
|||||||
return currentPOS.templateBusinessPartner
|
return currentPOS.templateBusinessPartner
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
},
|
||||||
|
updateOrderProcessPos() {
|
||||||
|
return this.$store.getters.getUpdateOrderPos
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -129,6 +145,12 @@ export default {
|
|||||||
if (bPartnerToSet) {
|
if (bPartnerToSet) {
|
||||||
this.setBusinessPartner(bPartnerToSet)
|
this.setBusinessPartner(bPartnerToSet)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
updateOrderProcessPos(value) {
|
||||||
|
if (value) {
|
||||||
|
this.reloadOrder(true)
|
||||||
|
this.$store.dispatch('updateOrderPos', false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -141,12 +163,17 @@ export default {
|
|||||||
this.listOrderLines(this.currentOrder)
|
this.listOrderLines(this.currentOrder)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.findProcess(this.process)
|
||||||
this.unsubscribe = this.subscribeChanges()
|
this.unsubscribe = this.subscribeChanges()
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.unsubscribe()
|
this.unsubscribe()
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
if (this.isEmptyValue(this.currentOrder)) {
|
||||||
|
this.reloadOrder(true, this.$route.query.action)
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatDate,
|
formatDate,
|
||||||
formatPrice,
|
formatPrice,
|
||||||
@ -295,7 +322,6 @@ export default {
|
|||||||
|
|
||||||
// user session
|
// user session
|
||||||
const salesRepresentativeUuid = this.$store.getters['user/getUserUuid']
|
const salesRepresentativeUuid = this.$store.getters['user/getUserUuid']
|
||||||
|
|
||||||
requestCreateOrder({
|
requestCreateOrder({
|
||||||
posUuid,
|
posUuid,
|
||||||
customerUuid,
|
customerUuid,
|
||||||
@ -342,12 +368,11 @@ export default {
|
|||||||
orderUuid = this.$store.getters.getOrder.uuid // this.currentOrder.uuid
|
orderUuid = this.$store.getters.getOrder.uuid // this.currentOrder.uuid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.isEmptyValue(orderUuid)) {
|
if (!this.isEmptyValue(orderUuid)) {
|
||||||
requestGetOrder(orderUuid)
|
requestGetOrder(orderUuid)
|
||||||
.then(orderResponse => {
|
.then(orderResponse => {
|
||||||
this.fillOrder(orderResponse)
|
|
||||||
this.$store.dispatch('currentOrder', orderResponse)
|
this.$store.dispatch('currentOrder', orderResponse)
|
||||||
|
this.fillOrder(orderResponse)
|
||||||
this.listOrderLines(orderResponse)
|
this.listOrderLines(orderResponse)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
@ -449,7 +474,6 @@ export default {
|
|||||||
this.$refs.linesTable.setCurrentRow(this.listOrderLine[0])
|
this.$refs.linesTable.setCurrentRow(this.listOrderLine[0])
|
||||||
},
|
},
|
||||||
shortcutKeyMethod(event) {
|
shortcutKeyMethod(event) {
|
||||||
console.log(event.srcKey)
|
|
||||||
switch (event.srcKey) {
|
switch (event.srcKey) {
|
||||||
// case 'options':
|
// case 'options':
|
||||||
case 'up':
|
case 'up':
|
||||||
@ -499,6 +523,11 @@ export default {
|
|||||||
})
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
findProcess(processPos) {
|
||||||
|
processPos.forEach(item => {
|
||||||
|
this.$store.dispatch('getProcessFromServer', { containerUuid: item.uuid })
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -346,7 +346,9 @@ export default {
|
|||||||
cancelSaleTransaction: 'Cancel Sale Transaction',
|
cancelSaleTransaction: 'Cancel Sale Transaction',
|
||||||
createPos: 'Create Point of Sale Withdrawal',
|
createPos: 'Create Point of Sale Withdrawal',
|
||||||
print: 'Print Document',
|
print: 'Print Document',
|
||||||
cancelOrder: 'Cancel Order'
|
cancelOrder: 'Cancel Order',
|
||||||
|
copyOrderLine: 'Copy Order Lines',
|
||||||
|
copyOrder: 'Copy Order'
|
||||||
},
|
},
|
||||||
cashManagement: {
|
cashManagement: {
|
||||||
title: 'Cash Management',
|
title: 'Cash Management',
|
||||||
|
@ -321,7 +321,9 @@ export default {
|
|||||||
cancelSaleTransaction: 'Anular Transacción de Venta',
|
cancelSaleTransaction: 'Anular Transacción de Venta',
|
||||||
createPos: 'Crear Retiro de Punto de Venta',
|
createPos: 'Crear Retiro de Punto de Venta',
|
||||||
print: 'Imprimir Documento',
|
print: 'Imprimir Documento',
|
||||||
cancelOrder: 'Cancelar Orden'
|
cancelOrder: 'Cancelar Orden',
|
||||||
|
copyOrderLine: 'Copiar Lineas de la Orden',
|
||||||
|
copyOrder: 'Copiar Orden'
|
||||||
},
|
},
|
||||||
cashManagement: {
|
cashManagement: {
|
||||||
title: 'Gestión de Caja',
|
title: 'Gestión de Caja',
|
||||||
|
@ -294,11 +294,6 @@ const collection = {
|
|||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.warn(`ListPaymentsFromServer: ${error.message}. Code: ${error.code}.`)
|
console.warn(`ListPaymentsFromServer: ${error.message}. Code: ${error.code}.`)
|
||||||
showMessage({
|
|
||||||
type: 'error',
|
|
||||||
message: error.message,
|
|
||||||
showClose: true
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
tenderTypeDisplaye({ commit }, tenderType) {
|
tenderTypeDisplaye({ commit }, tenderType) {
|
||||||
|
@ -10,6 +10,7 @@ const withoutResponse = {
|
|||||||
isLoaded: false,
|
isLoaded: false,
|
||||||
isReload: true,
|
isReload: true,
|
||||||
recordCount: 0,
|
recordCount: 0,
|
||||||
|
currentPOS: {},
|
||||||
nextPageToken: undefined
|
nextPageToken: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +59,6 @@ const pointOfSales = {
|
|||||||
...response,
|
...response,
|
||||||
userUuid
|
userUuid
|
||||||
})
|
})
|
||||||
|
|
||||||
const posList = response.sellingPointsList
|
const posList = response.sellingPointsList
|
||||||
const getterPos = getters.getPointOfSalesUuid
|
const getterPos = getters.getPointOfSalesUuid
|
||||||
let pos
|
let pos
|
||||||
@ -138,14 +138,21 @@ const pointOfSales = {
|
|||||||
// current pos info
|
// current pos info
|
||||||
getCurrentPOS: (state, getters) => {
|
getCurrentPOS: (state, getters) => {
|
||||||
const userUuid = getters['user/getUserUuid']
|
const userUuid = getters['user/getUserUuid']
|
||||||
const sellingPointsList = state.pointOfSales.sellingPointsList.length
|
let currentPOS
|
||||||
if (sellingPointsList > 1) {
|
const sellingPointsList = state.pointOfSales.sellingPointsList
|
||||||
return state.pointOfSales.sellingPointsList.find(elem => elem.salesRepresentative.uuid === userUuid)
|
if (!isEmptyValue(sellingPointsList) && (sellingPointsList.length > 1)) {
|
||||||
|
currentPOS = state.pointOfSales.sellingPointsList.find(elem => elem.salesRepresentative.uuid === userUuid)
|
||||||
}
|
}
|
||||||
if (isEmptyValue(state.pointOfSales)) {
|
if (!isEmptyValue(currentPOS)) {
|
||||||
return undefined
|
return currentPOS
|
||||||
}
|
}
|
||||||
|
if (isEmptyValue(state.pointOfSales.currentPOS) && (!isEmptyValue(sellingPointsList))) {
|
||||||
|
return state.pointOfSales.sellingPointsList[0]
|
||||||
|
}
|
||||||
|
if (state.pointOfSales.currentPOS) {
|
||||||
return state.pointOfSales.currentPOS
|
return state.pointOfSales.currentPOS
|
||||||
|
}
|
||||||
|
return undefined
|
||||||
},
|
},
|
||||||
getSellingPointsList: (state, getters) => {
|
getSellingPointsList: (state, getters) => {
|
||||||
return getters.getPointOfSales.sellingPointsList
|
return getters.getPointOfSales.sellingPointsList
|
||||||
|
@ -124,8 +124,8 @@ const ordes = {
|
|||||||
setOrder({ commit }, order) {
|
setOrder({ commit }, order) {
|
||||||
commit('setOrder', order)
|
commit('setOrder', order)
|
||||||
},
|
},
|
||||||
currentOrder({ commit }, current) {
|
currentOrder({ commit }, findOrder) {
|
||||||
commit('findOrder', current)
|
commit('findOrder', findOrder)
|
||||||
},
|
},
|
||||||
findOrderServer({ commit }, orderUuid) {
|
findOrderServer({ commit }, orderUuid) {
|
||||||
if (typeof orderUuid === 'string' && !isEmptyValue(orderUuid)) {
|
if (typeof orderUuid === 'string' && !isEmptyValue(orderUuid)) {
|
||||||
|
@ -147,7 +147,7 @@ export default {
|
|||||||
processResult = {
|
processResult = {
|
||||||
...processResult,
|
...processResult,
|
||||||
menuParentUuid,
|
menuParentUuid,
|
||||||
processIdPath: routeToDelete.path,
|
processIdPath: isEmptyValue(routeToDelete) ? '' : routeToDelete.path,
|
||||||
printFormatUuid: action.printFormatUuid,
|
printFormatUuid: action.printFormatUuid,
|
||||||
// process attributes
|
// process attributes
|
||||||
action: processDefinition.name,
|
action: processDefinition.name,
|
||||||
@ -1137,5 +1137,153 @@ export default {
|
|||||||
if (!isEmptyValue(reportFormat)) {
|
if (!isEmptyValue(reportFormat)) {
|
||||||
commit('changeFormatReport', reportFormat)
|
commit('changeFormatReport', reportFormat)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Ejecutar Procesos del POS
|
||||||
|
*/
|
||||||
|
processPos({ commit, state, dispatch, getters, rootGetters }, {
|
||||||
|
parentUuid,
|
||||||
|
containerUuid,
|
||||||
|
panelType,
|
||||||
|
action,
|
||||||
|
parametersList,
|
||||||
|
idProcess,
|
||||||
|
isActionDocument,
|
||||||
|
menuParentUuid,
|
||||||
|
routeToDelete
|
||||||
|
}) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const processDefinition = !isEmptyValue(isActionDocument) ? action : rootGetters.getProcess(action.uuid)
|
||||||
|
if (isEmptyValue(parametersList)) {
|
||||||
|
parametersList = rootGetters.getParametersToServer({
|
||||||
|
containerUuid: processDefinition.uuid
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const isSession = !isEmptyValue(getToken())
|
||||||
|
let procesingMessage = {
|
||||||
|
close: () => false
|
||||||
|
}
|
||||||
|
if (isSession) {
|
||||||
|
procesingMessage = showNotification({
|
||||||
|
title: language.t('notifications.processing'),
|
||||||
|
message: processDefinition.name,
|
||||||
|
summary: processDefinition.description,
|
||||||
|
type: 'info'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const timeInitialized = (new Date()).getTime()
|
||||||
|
let processResult = {
|
||||||
|
// panel attributes from where it was executed
|
||||||
|
parentUuid,
|
||||||
|
containerUuid,
|
||||||
|
panelType,
|
||||||
|
lastRun: timeInitialized,
|
||||||
|
parametersList,
|
||||||
|
logs: [],
|
||||||
|
isError: false,
|
||||||
|
isProcessing: true,
|
||||||
|
summary: '',
|
||||||
|
resultTableName: '',
|
||||||
|
output: {
|
||||||
|
uuid: '',
|
||||||
|
name: '',
|
||||||
|
description: '',
|
||||||
|
fileName: '',
|
||||||
|
output: '',
|
||||||
|
outputStream: '',
|
||||||
|
reportType: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isEmptyValue(isActionDocument)) {
|
||||||
|
processResult = {
|
||||||
|
...processResult,
|
||||||
|
processUuid: action.uuid,
|
||||||
|
processId: action.id,
|
||||||
|
processName: 'Procesar Orden',
|
||||||
|
parameters: parametersList
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Run process on server and wait for it for notify
|
||||||
|
// uuid of process
|
||||||
|
processResult = {
|
||||||
|
...processResult,
|
||||||
|
menuParentUuid,
|
||||||
|
processIdPath: isEmptyValue(routeToDelete) ? '' : routeToDelete.path,
|
||||||
|
printFormatUuid: action.printFormatUuid,
|
||||||
|
// process attributes
|
||||||
|
action: processDefinition.name,
|
||||||
|
name: processDefinition.name,
|
||||||
|
description: processDefinition.description,
|
||||||
|
instanceUuid: '',
|
||||||
|
processUuid: processDefinition.uuid,
|
||||||
|
processId: processDefinition.id,
|
||||||
|
processName: processDefinition.processName,
|
||||||
|
parameters: parametersList,
|
||||||
|
isReport: processDefinition.isReport
|
||||||
|
}
|
||||||
|
}
|
||||||
|
commit('addInExecution', processResult)
|
||||||
|
requestRunProcess({
|
||||||
|
uuid: processDefinition.uuid,
|
||||||
|
recordId: idProcess,
|
||||||
|
parametersList
|
||||||
|
})
|
||||||
|
.then(runProcessResponse => {
|
||||||
|
const { output } = runProcessResponse
|
||||||
|
let logList = []
|
||||||
|
if (!isEmptyValue(runProcessResponse.logsList)) {
|
||||||
|
logList = runProcessResponse.logsList
|
||||||
|
}
|
||||||
|
|
||||||
|
const link = {
|
||||||
|
href: undefined,
|
||||||
|
download: undefined
|
||||||
|
}
|
||||||
|
// assign new attributes
|
||||||
|
Object.assign(processResult, {
|
||||||
|
...runProcessResponse,
|
||||||
|
url: link.href,
|
||||||
|
download: link.download,
|
||||||
|
logs: logList,
|
||||||
|
output
|
||||||
|
})
|
||||||
|
resolve(processResult)
|
||||||
|
if (!isEmptyValue(processResult.output)) {
|
||||||
|
dispatch('setReportTypeToShareLink', processResult.output.reportType)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
Object.assign(processResult, {
|
||||||
|
isError: true,
|
||||||
|
message: error.message,
|
||||||
|
isProcessing: false
|
||||||
|
})
|
||||||
|
console.warn(`Error running the process ${error.message}. Code: ${error.code}.`)
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
commit('addNotificationProcess', processResult)
|
||||||
|
dispatch('finishProcess', {
|
||||||
|
processOutput: processResult,
|
||||||
|
procesingMessage,
|
||||||
|
routeToDelete
|
||||||
|
})
|
||||||
|
|
||||||
|
commit('deleteInExecution', {
|
||||||
|
containerUuid
|
||||||
|
})
|
||||||
|
|
||||||
|
dispatch('setProcessTable', {
|
||||||
|
valueRecord: 0,
|
||||||
|
tableName: '',
|
||||||
|
processTable: false
|
||||||
|
})
|
||||||
|
dispatch('setProcessSelect', {
|
||||||
|
finish: true
|
||||||
|
})
|
||||||
|
dispatch('updateOrderPos', true)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,9 @@ const initStateUtils = {
|
|||||||
isLoaded: false
|
isLoaded: false
|
||||||
},
|
},
|
||||||
splitWidthRight: 3,
|
splitWidthRight: 3,
|
||||||
splitWidthLeft: 3
|
splitWidthLeft: 3,
|
||||||
|
parametersProcessPos: [],
|
||||||
|
updateOrder: false
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -89,6 +91,12 @@ export default {
|
|||||||
},
|
},
|
||||||
setSplitWidthLeft(state, splitWidthLeft) {
|
setSplitWidthLeft(state, splitWidthLeft) {
|
||||||
state.splitWidthLeft = splitWidthLeft
|
state.splitWidthLeft = splitWidthLeft
|
||||||
|
},
|
||||||
|
parametersProcessPos(state, params) {
|
||||||
|
state.parametersProcessPos = params
|
||||||
|
},
|
||||||
|
setUpdateOrder(state, order) {
|
||||||
|
state.updateOrder = order
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
@ -146,6 +154,12 @@ export default {
|
|||||||
},
|
},
|
||||||
changeWidthLeft({ commit }, newWidthLeft) {
|
changeWidthLeft({ commit }, newWidthLeft) {
|
||||||
commit('setSplitWidthLeft', newWidthLeft)
|
commit('setSplitWidthLeft', newWidthLeft)
|
||||||
|
},
|
||||||
|
addParametersProcessPos({ commit }, params) {
|
||||||
|
commit('parametersProcessPos', params)
|
||||||
|
},
|
||||||
|
updateOrderPos({ commit }, params) {
|
||||||
|
commit('setUpdateOrder', params)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
@ -209,6 +223,12 @@ export default {
|
|||||||
},
|
},
|
||||||
getWidthLeft: (state) => {
|
getWidthLeft: (state) => {
|
||||||
return state.splitWidthLeft
|
return state.splitWidthLeft
|
||||||
|
},
|
||||||
|
getPosParameters: (state) => {
|
||||||
|
return state.parametersProcessPos
|
||||||
|
},
|
||||||
|
getUpdateOrderPos: (state) => {
|
||||||
|
return state.updateOrder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
27
src/utils/ADempiere/constants/posProcess.js
Normal file
27
src/utils/ADempiere/constants/posProcess.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
const posProcess = [
|
||||||
|
{
|
||||||
|
name: 'C_POS Generate Immediate Invoice',
|
||||||
|
uuid: 'a42cce58-fb40-11e8-a479-7a0060f0aa01'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'C_POS ReverseTheSalesTransaction',
|
||||||
|
uuid: 'a42ccebc-fb40-11e8-a479-7a0060f0aa01'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'C_POS CreateOrderBasedOnAnother',
|
||||||
|
uuid: 'a42ccc46-fb40-11e8-a479-7a0060f0aa01'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'C_POS Withdrawal',
|
||||||
|
uuid: 'a42ce0a0-fb40-11e8-a479-7a0060f0aa01'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'C_POS Bank Statement Close',
|
||||||
|
uuid: 'a42ce118-fb40-11e8-a479-7a0060f0aa01'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'C_Order CopyFrom',
|
||||||
|
uuid: 'a42ad0c6-fb40-11e8-a479-7a0060f0aa01'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
export default posProcess
|
@ -9,6 +9,11 @@
|
|||||||
v-if="showContextMenu"
|
v-if="showContextMenu"
|
||||||
style="height: 39px; background: white;"
|
style="height: 39px; background: white;"
|
||||||
>
|
>
|
||||||
|
<modal-dialog
|
||||||
|
:parent-uuid="$route.meta.parentUuid"
|
||||||
|
:container-uuid="formUuid"
|
||||||
|
:panel-type="panelType"
|
||||||
|
/>
|
||||||
<context-menu
|
<context-menu
|
||||||
:menu-parent-uuid="$route.meta.parentUuid"
|
:menu-parent-uuid="$route.meta.parentUuid"
|
||||||
:container-uuid="formUuid"
|
:container-uuid="formUuid"
|
||||||
@ -83,12 +88,14 @@
|
|||||||
<script>
|
<script>
|
||||||
import ContextMenu from '@/components/ADempiere/ContextMenu'
|
import ContextMenu from '@/components/ADempiere/ContextMenu'
|
||||||
import FormPanel from '@/components/ADempiere/Form'
|
import FormPanel from '@/components/ADempiere/Form'
|
||||||
|
import ModalDialog from '@/components/ADempiere/Dialog'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'FormView',
|
name: 'FormView',
|
||||||
components: {
|
components: {
|
||||||
ContextMenu,
|
ContextMenu,
|
||||||
FormPanel
|
FormPanel,
|
||||||
|
ModalDialog
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user