1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 20:39:48 +08:00

Process the POS (#584)

* Process the POS

* fixe pos Process
This commit is contained in:
Elsio Sanchez 2021-02-16 14:06:06 -04:00 committed by GitHub
parent 737d85b0ba
commit 0b314fc8c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 139 additions and 139 deletions

View File

@ -32,6 +32,7 @@
placement="right"
width="800"
trigger="click"
@show="seeOrderList"
>
<orders-list
:parent-metadata="metadata"
@ -126,18 +127,6 @@
</el-card>
</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"
@ -148,7 +137,7 @@
{{ $t('form.pos.optionsPoinSales.salesOrder.copyOrder') }}
</p>
</el-card>
</el-col> -->
</el-col>
<el-col :span="size">
<el-card shadow="hover">
<p
@ -205,32 +194,6 @@
<el-collapse-item :title="$t('form.pos.optionsPoinSales.generalOptions.title')" name="generalOptions">
<el-row :gutter="12" style="padding-right: 10px;">
<!--
<el-col :span="size">
<el-card shadow="hover">
<el-popover
placement="right"
width="400"
trigger="click"
>
<el-form label-position="top" label-width="10px" @submit.native.prevent="notSubmitForm">
<field
:key="typeDocumentMetadata.columnName"
:metadata-field="typeDocumentMetadata"
:v-model="typeDocumentMetadata.value"
style="padding-left: 0px; padding-right: 0px;"
/>
</el-form>
<p slot="reference" :style="blockOption">
<i class="el-icon-document-copy" />
<br>
Cambiar Tipo de Documento
</p>
</el-popover>
</el-card>
</el-col>
-->
<el-col :span="size">
<el-card shadow="hover">
<el-dropdown trigger="click" style="padding-top: 8px; color: black;" @command="changePos">
@ -298,7 +261,8 @@ import {
requestCreateWithdrawal,
requestCreateNewCustomerReturnOrder,
requestCashClosing,
requestDeleteOrder
requestDeleteOrder,
requestCreateOrder
} from '@/api/ADempiere/form/point-of-sales.js'
import ModalDialog from '@/components/ADempiere/Dialog'
import posProcess from '@/utils/ADempiere/constants/posProcess'
@ -377,6 +341,9 @@ export default {
return 24 / size
}
},
created() {
this.findProcess()
},
methods: {
notSubmitForm(event) {
event.preventDefault()
@ -455,34 +422,31 @@ export default {
})
},
reverseSalesTransaction() {
const process = this.$store.getters.getProcess(posProcess[1].uuid)
this.$store.dispatch('startProcess', {
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'
}
]
})
const process = this.$store.getters.getProcess(posProcess[0].uuid)
this.showModal(process)
const parametersList = [
{
columnName: 'C_Order_ID',
value: this.$store.getters.getOrder.id
},
{
columnName: 'Bill_BPartner_ID',
value: this.$store.getters.getOrder.businessPartner.id
},
{
columnName: 'IsCancelled',
value: false
},
{
columnName: 'IsShipConfirm',
value: true
},
{
columnName: 'C_DocTypeRMA_ID',
value: 'VO'
}
]
this.$store.dispatch('addParametersProcessPos', parametersList)
},
createWithdrawal() {
const { uuid: posUuid, id: posId } = this.getCurrentPOS
@ -507,13 +471,50 @@ export default {
})
},
copyOrder() {
this.processPos = posProcess[5].uuid
const process = this.$store.getters.getProcess(posProcess[5].uuid)
this.showModal(process)
this.processPos = posProcess[1].uuid
const posUuid = this.currentPoint.uuid
const parametersList = [{
columnName: 'C_Order_ID',
value: this.$store.getters.getOrder.id
}]
this.$store.dispatch('addParametersProcessPos', parametersList)
requestCreateOrder({
posUuid,
customerUuid: this.currentPOS.businessPartner.uuid,
salesRepresentativeUuid: this.currentPOS.salesRepresentative.uuid
})
.then(order => {
this.$store.dispatch('currentOrder', order)
this.$router.push({
params: {
...this.$route.params
},
query: {
...this.$route.query,
action: order.uuid
}
}).then(() => {
}).catch(() => {})
this.$store.commit('setIsReloadListOrders')
})
.catch(error => {
console.error(error.message)
this.$message({
type: 'error',
message: error.message,
showClose: true
})
})
.finally(() => {
const process = this.$store.getters.getProcess(posProcess[1].uuid)
this.showModal(process)
})
},
copyLineOrder() {
this.processPos = posProcess[5].uuid
const process = this.$store.getters.getProcess(posProcess[5].uuid)
this.processPos = posProcess[1].uuid
const process = this.$store.getters.getProcess(posProcess[1].uuid)
this.showModal(process)
},
cashClosing() {
@ -524,6 +525,7 @@ export default {
})
},
deleteOrder() {
this.$store.dispatch('updateOrderPos', true)
requestDeleteOrder({
orderUuid: this.$route.query.action
})
@ -536,10 +538,24 @@ export default {
})
this.$message({
type: 'success',
message: 'Orden Cancelada',
message: this.$t('form.pos.optionsPoinSales.salesOrder.orderRemoved'),
showClose: true
})
this.$store.dispatch('updateOrderPos', false)
})
},
seeOrderList() {
if (this.$store.getters.getListOrder.recordCount <= 0) {
this.$store.dispatch('listOrdersFromServer', {})
}
},
findProcess() {
const findServer = this.$store.getters.getProcess('a42ad0c6-fb40-11e8-a479-7a0060f0aa01')
if (this.isEmptyValue(findServer)) {
posProcess.forEach(item => {
this.$store.dispatch('getProcessFromServer', { containerUuid: item.uuid, processId: item.id })
})
}
}
}
}

View File

@ -45,8 +45,7 @@
:highlight-current-row="highlightRow"
:height="heightTable"
@shortkey.native="keyAction"
@current-change="orderPrpcess"
@row-dblclick="handleCurrentChange"
@current-change="handleCurrentChange"
>
<el-table-column
prop="documentNo"

View File

@ -10,7 +10,7 @@ import {
formatPrice,
formatQuantity
} from '@/utils/ADempiere/valueFormat.js'
import posProcess from '@/utils/ADempiere/constants/posProcess'
// import posProcess from '@/utils/ADempiere/constants/posProcess'
export default {
name: 'POSMixin',
@ -52,8 +52,7 @@ export default {
quantityAvailable: 0
},
edit: false,
displayType: '',
process: posProcess
displayType: ''
}
},
computed: {
@ -147,9 +146,8 @@ export default {
}
},
updateOrderProcessPos(value) {
if (value) {
if (!value && !this.isEmptyValue(this.$route.query)) {
this.reloadOrder(true)
this.$store.dispatch('updateOrderPos', false)
}
}
},
@ -163,14 +161,14 @@ export default {
this.listOrderLines(this.currentOrder)
}
}
this.findProcess(this.process)
this.unsubscribe = this.subscribeChanges()
},
beforeDestroy() {
this.unsubscribe()
},
mounted() {
if (this.isEmptyValue(this.currentOrder)) {
// this.findProcess()
if (!this.isEmptyValue(this.$route.query)) {
this.reloadOrder(true, this.$route.query.action)
}
},
@ -523,11 +521,6 @@ export default {
})
break
}
},
findProcess(processPos) {
processPos.forEach(item => {
this.$store.dispatch('getProcessFromServer', { containerUuid: item.uuid })
})
}
}
}

View File

@ -347,7 +347,7 @@ export default {
createPos: 'Create Point of Sale Withdrawal',
print: 'Print Document',
cancelOrder: 'Cancel Order',
copyOrderLine: 'Copy Order Lines',
orderRemoved: 'Order Deleted',
copyOrder: 'Copy Order'
},
cashManagement: {

View File

@ -322,7 +322,7 @@ export default {
createPos: 'Crear Retiro de Punto de Venta',
print: 'Imprimir Documento',
cancelOrder: 'Cancelar Orden',
copyOrderLine: 'Copiar Lineas de la Orden',
orderRemoved: 'Orden Borrada',
copyOrder: 'Copiar Orden'
},
cashManagement: {

View File

@ -1172,8 +1172,9 @@ export default {
type: 'info'
})
}
dispatch('updateOrderPos', true)
const timeInitialized = (new Date()).getTime()
let processResult = {
const processResult = {
// panel attributes from where it was executed
parentUuid,
containerUuid,
@ -1193,35 +1194,20 @@ export default {
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
}
},
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({
@ -1282,7 +1268,7 @@ export default {
dispatch('setProcessSelect', {
finish: true
})
dispatch('updateOrderPos', true)
dispatch('updateOrderPos', false)
})
})
}

View File

@ -1,27 +1,33 @@
const posProcess = [
{
name: 'C_POS Generate Immediate Invoice',
uuid: 'a42cce58-fb40-11e8-a479-7a0060f0aa01'
},
// {
// name: 'C_POS Generate Immediate Invoice',
// uuid: 'a42cce58-fb40-11e8-a479-7a0060f0aa01',
// id: 53823
// },
{
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'
uuid: 'a42ccebc-fb40-11e8-a479-7a0060f0aa01',
id: 53824
},
// {
// name: 'C_POS CreateOrderBasedOnAnother',
// uuid: 'a42ccc46-fb40-11e8-a479-7a0060f0aa01',
// id: 53822
// },
// {
// name: 'C_POS Withdrawal',
// uuid: 'a42ce0a0-fb40-11e8-a479-7a0060f0aa01',
// id: 53846
// },
// {
// name: 'C_POS Bank Statement Close',
// uuid: 'a42ce118-fb40-11e8-a479-7a0060f0aa01',
// id: 53847
// },
{
name: 'C_Order CopyFrom',
uuid: 'a42ad0c6-fb40-11e8-a479-7a0060f0aa01'
uuid: 'a42ad0c6-fb40-11e8-a479-7a0060f0aa01',
id: 211
}
]
export default posProcess