mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 12:01:57 +08:00
Add option to change warehouse and price list (#913)
* Adding the option to change Warehouse and Price List * add service * support service * add Warehouse Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
parent
c467351738
commit
23aaf79007
@ -77,7 +77,8 @@ export function createOrder({
|
|||||||
posUuid,
|
posUuid,
|
||||||
customerUuid,
|
customerUuid,
|
||||||
documentTypeUuid,
|
documentTypeUuid,
|
||||||
salesRepresentativeUuid
|
salesRepresentativeUuid,
|
||||||
|
warehouseUuid
|
||||||
}) {
|
}) {
|
||||||
return request({
|
return request({
|
||||||
url: `${config.pointOfSales.endpoint}/create-order`,
|
url: `${config.pointOfSales.endpoint}/create-order`,
|
||||||
@ -86,7 +87,8 @@ export function createOrder({
|
|||||||
pos_uuid: posUuid,
|
pos_uuid: posUuid,
|
||||||
customer_uuid: customerUuid,
|
customer_uuid: customerUuid,
|
||||||
document_type_uuid: documentTypeUuid,
|
document_type_uuid: documentTypeUuid,
|
||||||
sales_representative_uuid: salesRepresentativeUuid
|
sales_representative_uuid: salesRepresentativeUuid,
|
||||||
|
warehouse_uuid: warehouseUuid
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(createOrderResponse => {
|
.then(createOrderResponse => {
|
||||||
@ -101,7 +103,8 @@ export function updateOrder({
|
|||||||
orderUuid,
|
orderUuid,
|
||||||
posUuid,
|
posUuid,
|
||||||
customerUuid,
|
customerUuid,
|
||||||
description
|
description,
|
||||||
|
warehouseUuid
|
||||||
}) {
|
}) {
|
||||||
return request({
|
return request({
|
||||||
url: `${config.pointOfSales.endpoint}/update-order`,
|
url: `${config.pointOfSales.endpoint}/update-order`,
|
||||||
@ -110,7 +113,8 @@ export function updateOrder({
|
|||||||
order_uuid: orderUuid,
|
order_uuid: orderUuid,
|
||||||
pos_uuid: posUuid,
|
pos_uuid: posUuid,
|
||||||
customer_uuid: customerUuid,
|
customer_uuid: customerUuid,
|
||||||
description
|
description,
|
||||||
|
warehouse_uuid: warehouseUuid
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(updateOrderResponse => {
|
.then(updateOrderResponse => {
|
||||||
@ -637,3 +641,79 @@ export function validatePin({
|
|||||||
return pinResponse
|
return pinResponse
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* list Warehouse
|
||||||
|
* @param {string} posUuidd - POS UUID reference
|
||||||
|
*/
|
||||||
|
export function listWarehouse({
|
||||||
|
posUuid
|
||||||
|
}) {
|
||||||
|
return request({
|
||||||
|
url: `${config.pointOfSales.endpoint}/available-warehouses`,
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
pos_uuid: posUuid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(listWarehouseResponse => {
|
||||||
|
return listWarehouseResponse
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List Prices
|
||||||
|
* @param {string} posUuidd - POS UUID reference
|
||||||
|
*/
|
||||||
|
export function listPrices({
|
||||||
|
posUuid
|
||||||
|
}) {
|
||||||
|
return request({
|
||||||
|
url: `${config.pointOfSales.endpoint}/available-price-list`,
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
pos_uuid: posUuid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(listPricesResponse => {
|
||||||
|
return listPricesResponse
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Currencies
|
||||||
|
* @param {string} posUuidd - POS UUID reference
|
||||||
|
*/
|
||||||
|
export function listCurrencies({
|
||||||
|
posUuid
|
||||||
|
}) {
|
||||||
|
return request({
|
||||||
|
url: `${config.pointOfSales.endpoint}/available-currencies`,
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
pos_uuid: posUuid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(listCurrencies => {
|
||||||
|
return listCurrencies
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tender Type
|
||||||
|
* @param {string} posUuidd - POS UUID reference
|
||||||
|
*/
|
||||||
|
export function listTenderType({
|
||||||
|
posUuid
|
||||||
|
}) {
|
||||||
|
return request({
|
||||||
|
url: `${config.pointOfSales.endpoint}/available-tender-types`,
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
pos_uuid: posUuid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(listTenderType => {
|
||||||
|
return listTenderType
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -144,22 +144,22 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.amountConvertionTotal = this.amount
|
this.amountConvertionTotal = this.amount
|
||||||
}
|
}
|
||||||
},
|
|
||||||
currencyUuid(value) {
|
|
||||||
const listCurrency = this.$store.getters.getConvertionRate.find(currency => {
|
|
||||||
if (currency.uuid === value) {
|
|
||||||
return currency
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (listCurrency === undefined) {
|
|
||||||
this.$store.dispatch('conversionDivideRate', {
|
|
||||||
conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid,
|
|
||||||
currencyFromUuid: this.pointOfSalesCurrency.uuid,
|
|
||||||
conversionDate: this.formatDate(new Date()),
|
|
||||||
currencyToUuid: value
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// currencyUuid(value) {
|
||||||
|
// const listCurrency = this.$store.getters.getConvertionRate.find(currency => {
|
||||||
|
// if (currency.uuid === value) {
|
||||||
|
// return currency
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// if (listCurrency === undefined) {
|
||||||
|
// this.$store.dispatch('conversionDivideRate', {
|
||||||
|
// conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid,
|
||||||
|
// currencyFromUuid: this.pointOfSalesCurrency.uuid,
|
||||||
|
// conversionDate: this.formatDate(new Date()),
|
||||||
|
// currencyToUuid: value
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.defaultValueCurrency()
|
this.defaultValueCurrency()
|
||||||
|
@ -63,17 +63,24 @@
|
|||||||
<b>{{ $t('form.pos.collect.dayRate') }}:</b>
|
<b>{{ $t('form.pos.collect.dayRate') }}:</b>
|
||||||
<!-- Conversion rate to date -->
|
<!-- Conversion rate to date -->
|
||||||
<b v-if="!isEmptyValue(dateRate)" style="float: right;">
|
<b v-if="!isEmptyValue(dateRate)" style="float: right;">
|
||||||
<span v-if="formatConversionCurrenty(dateRate.amountConvertion) > 100">
|
<span v-if="!isEmptyValue(dateRate.divideRate)">
|
||||||
{{
|
<span v-if="formatConversionCurrenty(dateRate.divideRate) > 1">
|
||||||
formatPrice(formatConversionCurrenty(dateRate.amountConvertion), dateRate.iSOCode)
|
{{
|
||||||
}}
|
formatPrice(formatConversionCurrenty(dateRate.divideRate), dateRate.currencyTo.iSOCode)
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
<span v-else>
|
||||||
|
{{
|
||||||
|
dateRate.currencyTo.iSOCode
|
||||||
|
}}
|
||||||
|
{{
|
||||||
|
formatConversionCurrenty(dateRate.divideRate)
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
{{
|
{{
|
||||||
dateRate.iSOCode
|
formatPrice(1, dateRate.iSOCode)
|
||||||
}}
|
|
||||||
{{
|
|
||||||
formatConversionCurrenty(dateRate.amountConvertion)
|
|
||||||
}}
|
}}
|
||||||
</span>
|
</span>
|
||||||
</b>
|
</b>
|
||||||
@ -93,10 +100,38 @@
|
|||||||
<el-col v-for="(field, index) in fieldsList" :key="index" :span="8">
|
<el-col v-for="(field, index) in fieldsList" :key="index" :span="8">
|
||||||
<!-- Add selected currency symbol -->
|
<!-- Add selected currency symbol -->
|
||||||
<field-definition
|
<field-definition
|
||||||
|
v-if="field.columnName === 'PayAmt' || field.columnName === 'TenderType'"
|
||||||
:key="field.columnName"
|
:key="field.columnName"
|
||||||
:metadata-field="field.columnName === 'PayAmt' ? {
|
:metadata-field="field.columnName === 'PayAmt' ? {
|
||||||
...field,
|
...field,
|
||||||
labelCurrency: dateRate
|
labelCurrency: isEmptyValue(dateRate.divideRate) ? dateRate : dateRate.currencyTo
|
||||||
|
} : field"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item :label="fieldsList[1].name">
|
||||||
|
<el-select
|
||||||
|
v-model="currentFieldCurrency"
|
||||||
|
:placeholder="fieldsList[1].help"
|
||||||
|
@change="changeCurrency"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in listCurrency"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.key"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col v-for="(field, index) in fieldsList" :key="index" :span="8">
|
||||||
|
<!-- Add selected currency symbol -->
|
||||||
|
<field-definition
|
||||||
|
v-if="field.columnName !== 'PayAmt' && field.columnName !== 'TenderType' && field.columnName !== 'C_Currency_ID'"
|
||||||
|
:key="field.columnName"
|
||||||
|
:metadata-field="field.columnName === 'PayAmt' ? {
|
||||||
|
...field,
|
||||||
|
labelCurrency: isEmptyValue(dateRate.divideRate) ? dateRate : dateRate.currencyTo
|
||||||
} : field"
|
} : field"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -272,10 +307,18 @@ export default {
|
|||||||
defaultLabel: '',
|
defaultLabel: '',
|
||||||
fieldsList: fieldsListCollection,
|
fieldsList: fieldsListCollection,
|
||||||
sendToServer: false,
|
sendToServer: false,
|
||||||
amontSend: 0
|
value: '',
|
||||||
|
amontSend: 0,
|
||||||
|
currentFieldCurrency: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
listCurrency() {
|
||||||
|
return this.$store.state['pointOfSales/point/index'].listCurrency
|
||||||
|
},
|
||||||
|
convertionList() {
|
||||||
|
return this.$store.state['pointOfSales/point/index'].conversionList
|
||||||
|
},
|
||||||
validateCompleteCollection() {
|
validateCompleteCollection() {
|
||||||
let collection
|
let collection
|
||||||
if (this.pay === this.currentOrder.grandTotal) {
|
if (this.pay === this.currentOrder.grandTotal) {
|
||||||
@ -488,11 +531,15 @@ export default {
|
|||||||
return this.$store.getters.getUpdatePaymentPos
|
return this.$store.getters.getUpdatePaymentPos
|
||||||
},
|
},
|
||||||
dateRate() {
|
dateRate() {
|
||||||
return this.$store.getters.getConvertionRate.find(currency => {
|
const convertion = this.convertionList.find(currency => {
|
||||||
if (currency.id === this.typeCurrency) {
|
if ((currency.currencyTo.iSOCode === this.currentFieldCurrency) && (this.pointOfSalesCurrency.iSOCode !== currency.currencyTo.iSOCode)) {
|
||||||
return currency
|
return currency
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (!this.isEmptyValue(convertion)) {
|
||||||
|
return convertion
|
||||||
|
}
|
||||||
|
return this.pointOfSalesCurrency
|
||||||
},
|
},
|
||||||
fieldsPaymentType() {
|
fieldsPaymentType() {
|
||||||
return this.fieldsList[2]
|
return this.fieldsList[2]
|
||||||
@ -503,24 +550,24 @@ export default {
|
|||||||
this.$store.commit('updateValueOfField', {
|
this.$store.commit('updateValueOfField', {
|
||||||
containerUuid: this.containerUuid,
|
containerUuid: this.containerUuid,
|
||||||
columnName: 'PayAmt',
|
columnName: 'PayAmt',
|
||||||
value
|
value: value
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
currencyUuid(value) {
|
// currencyUuid(value) {
|
||||||
const listCurrency = this.$store.getters.getConvertionRate.find(currency => {
|
// const listCurrency = this.$store.getters.getConvertionRate.find(currency => {
|
||||||
if (currency.uuid === value) {
|
// if (currency.uuid === value) {
|
||||||
return currency
|
// return currency
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
if (listCurrency === undefined) {
|
// if (listCurrency === undefined) {
|
||||||
this.$store.dispatch('conversionDivideRate', {
|
// this.$store.dispatch('conversionDivideRate', {
|
||||||
conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid,
|
// conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid,
|
||||||
currencyFromUuid: this.pointOfSalesCurrency.uuid,
|
// currencyFromUuid: this.pointOfSalesCurrency.uuid,
|
||||||
conversionDate: this.formatDate(new Date()),
|
// conversionDate: this.formatDate(new Date()),
|
||||||
currencyToUuid: value
|
// currencyToUuid: value
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
convertAllPayment(value) {
|
convertAllPayment(value) {
|
||||||
if (!this.isEmptyValue(value)) {
|
if (!this.isEmptyValue(value)) {
|
||||||
this.allPayCurrency = this.pay / value
|
this.allPayCurrency = this.pay / value
|
||||||
@ -537,11 +584,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
dateRate(value) {
|
dateRate(value) {
|
||||||
if (value && !this.isEmptyValue(value.amountConvertion)) {
|
if (!this.isEmptyValue(value.divideRate)) {
|
||||||
this.$store.commit('updateValueOfField', {
|
this.$store.commit('updateValueOfField', {
|
||||||
containerUuid: this.containerUuid,
|
containerUuid: this.containerUuid,
|
||||||
columnName: 'PayAmt',
|
columnName: 'PayAmt',
|
||||||
value: this.pending / value.amountConvertion
|
value: this.pending / value.divideRate
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$store.commit('updateValueOfField', {
|
this.$store.commit('updateValueOfField', {
|
||||||
@ -565,6 +612,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.currentFieldCurrency = this.pointOfSalesCurrency.iSOCode
|
||||||
this.$store.dispatch('addRateConvertion', this.pointOfSalesCurrency)
|
this.$store.dispatch('addRateConvertion', this.pointOfSalesCurrency)
|
||||||
this.unsubscribe = this.subscribeChanges()
|
this.unsubscribe = this.subscribeChanges()
|
||||||
this.defaultValueCurrency()
|
this.defaultValueCurrency()
|
||||||
@ -724,6 +772,7 @@ export default {
|
|||||||
this.defaultValueCurrency()
|
this.defaultValueCurrency()
|
||||||
this.$store.commit('currencyDivideRateCollection', 1)
|
this.$store.commit('currencyDivideRateCollection', 1)
|
||||||
this.$store.commit('currencyMultiplyRate', 1)
|
this.$store.commit('currencyMultiplyRate', 1)
|
||||||
|
this.currentFieldCurrency = this.pointOfSalesCurrency.iSOCode
|
||||||
},
|
},
|
||||||
exit() {
|
exit() {
|
||||||
this.$store.commit('setShowPOSCollection', false)
|
this.$store.commit('setShowPOSCollection', false)
|
||||||
@ -865,6 +914,19 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
changeCurrency(value) {
|
||||||
|
this.currentFieldCurrency = value
|
||||||
|
const currency = this.listCurrency.find(currency => currency.key === value)
|
||||||
|
const findCoventionList = this.convertionList.find(convertion => convertion.currencyTo.iSOCode === value)
|
||||||
|
if (!this.isEmptyValue(currency) && this.isEmptyValue(findCoventionList) && (value !== this.pointOfSalesCurrency.iSOCode)) {
|
||||||
|
this.$store.dispatch('searchConversion', {
|
||||||
|
conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid,
|
||||||
|
currencyFromUuid: this.pointOfSalesCurrency.uuid,
|
||||||
|
conversionDate: this.formatDate(new Date()),
|
||||||
|
currencyToUuid: currency.uuid
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<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;">
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="isEmptyValue($route.query.action) ? 'cursor: not-allowed; text-align: center !important; color: gray;' : blockOption"
|
:style="isEmptyValue($route.query.action) ? 'cursor: not-allowed; text-align: center !important; color: gray;' : blockOption"
|
||||||
@ -43,7 +43,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="right"
|
placement="right"
|
||||||
@ -69,19 +69,11 @@
|
|||||||
{{ $t('form.pos.optionsPoinSales.salesOrder.ordersHistory') }}
|
{{ $t('form.pos.optionsPoinSales.salesOrder.ordersHistory') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</p>
|
</p>
|
||||||
<!-- <p
|
|
||||||
slot="reference"
|
|
||||||
:style="blockOption"
|
|
||||||
>
|
|
||||||
<svg-icon icon-class="list" />
|
|
||||||
<br>
|
|
||||||
{{ $t('form.pos.optionsPoinSales.salesOrder.ordersHistory') }}
|
|
||||||
</p> -->
|
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@ -94,7 +86,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@ -107,7 +99,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@ -120,7 +112,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@ -133,7 +125,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@ -146,7 +138,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@ -158,7 +150,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@ -170,7 +162,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@ -187,7 +179,7 @@
|
|||||||
|
|
||||||
<el-collapse-item :title="$t('form.pos.optionsPoinSales.cashManagement.title')" name="cashManagement">
|
<el-collapse-item :title="$t('form.pos.optionsPoinSales.cashManagement.title')" name="cashManagement">
|
||||||
<el-row :gutter="12" style="padding-right: 10px;">
|
<el-row :gutter="12" style="padding-right: 10px;">
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@ -198,7 +190,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@ -209,7 +201,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="size">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@ -225,12 +217,12 @@
|
|||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
|
|
||||||
<el-collapse-item :title="$t('form.pos.optionsPoinSales.generalOptions.title')" name="generalOptions">
|
<el-collapse-item :title="$t('form.pos.optionsPoinSales.generalOptions.title')" name="generalOptions">
|
||||||
<el-row :gutter="12" style="padding-right: 10px;">
|
<el-row :gutter="24" style="padding-right: 10px;">
|
||||||
<el-col :span="size">
|
<el-col :span="size">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-dropdown trigger="click" style="padding-top: 8px; color: black;" @command="changePos">
|
<el-dropdown trigger="click" style="padding-top: 8px;color: black;display: block;" @command="changePos">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
style="cursor: pointer;text-align: center !important;color: black;min-height: 50px;margin: 0px;"
|
||||||
>
|
>
|
||||||
<i class="el-icon-mobile-phone" />
|
<i class="el-icon-mobile-phone" />
|
||||||
<br>
|
<br>
|
||||||
@ -248,8 +240,8 @@
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<!-- Product List Price -->
|
||||||
<el-col :span="8">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="right"
|
placement="right"
|
||||||
@ -272,7 +264,51 @@
|
|||||||
</el-popover>
|
</el-popover>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<!-- List Warehouse -->
|
||||||
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<el-dropdown trigger="click" style="padding-top: 8px;color: black;display: block;" @command="changePos">
|
||||||
|
<p
|
||||||
|
style="cursor: pointer;text-align: center !important;color: black;min-height: 50px;margin: 0px;"
|
||||||
|
>
|
||||||
|
<svg-icon icon-class="tree-table" />
|
||||||
|
<br>
|
||||||
|
{{ $t('form.pos.optionsPoinSales.generalOptions.changeWarehouseList') }}
|
||||||
|
</p>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item
|
||||||
|
v-for="item in warehousesListPointOfSales"
|
||||||
|
:key="item.uuid"
|
||||||
|
:command="item"
|
||||||
|
>
|
||||||
|
{{ item.name }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<!-- List Price -->
|
||||||
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<el-dropdown trigger="click" style="padding-top: 8px;color: black;display: block;" @command="changePos">
|
||||||
|
<p
|
||||||
|
style="cursor: pointer;text-align: center !important;color: black;min-height: 50px;margin: 0px;"
|
||||||
|
>
|
||||||
|
<svg-icon icon-class="list" />
|
||||||
|
<br>
|
||||||
|
{{ $t('form.pos.optionsPoinSales.generalOptions.changePriceList') }} </p>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item
|
||||||
|
v-for="item in priceListPointOfSales"
|
||||||
|
:key="item.uuid"
|
||||||
|
:command="item"
|
||||||
|
>
|
||||||
|
{{ item.name }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
@ -347,9 +383,9 @@ export default {
|
|||||||
},
|
},
|
||||||
blockOption() {
|
blockOption() {
|
||||||
if (!this.isEmptyValue(this.$route.query.pos)) {
|
if (!this.isEmptyValue(this.$route.query.pos)) {
|
||||||
return 'cursor: pointer; text-align: center !important; color: black'
|
return 'cursor: pointer; text-align: center !important; color: black;min-height: 50px;'
|
||||||
}
|
}
|
||||||
return 'cursor: not-allowed; text-align: center !important; color: gray;'
|
return 'cursor: not-allowed; text-align: center !important; color: gray;min-height: 50px;'
|
||||||
},
|
},
|
||||||
size() {
|
size() {
|
||||||
const size = this.$store.getters.getWidthLeft
|
const size = this.$store.getters.getWidthLeft
|
||||||
@ -475,7 +511,8 @@ export default {
|
|||||||
createOrder({
|
createOrder({
|
||||||
posUuid,
|
posUuid,
|
||||||
customerUuid: this.currentOrder.businessPartner.uuid,
|
customerUuid: this.currentOrder.businessPartner.uuid,
|
||||||
salesRepresentativeUuid: this.currentOrder.salesRepresentative.uuid
|
salesRepresentativeUuid: this.currentOrder.salesRepresentative.uuid,
|
||||||
|
warehouseUuid: this.$store.getters.currentWarehouse.uuid
|
||||||
})
|
})
|
||||||
.then(order => {
|
.then(order => {
|
||||||
this.$store.dispatch('currentOrder', order)
|
this.$store.dispatch('currentOrder', order)
|
||||||
|
@ -189,17 +189,17 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<br>
|
||||||
<p id="point">
|
<p id="point" style="margin-bottom: 5%;margin-top: 3%;">
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
v-if="!isEmptyValue(currentPointOfSales)"
|
v-if="!isEmptyValue(currentPointOfSales)"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
style="padding-top: 8px; color: black;"
|
class="info-pos"
|
||||||
@command="changePos"
|
@command="changePos"
|
||||||
>
|
>
|
||||||
<p>
|
<span>
|
||||||
<i class="el-icon-mobile-phone" />
|
<i class="el-icon-mobile-phone" />
|
||||||
{{ $t('form.pos.order.pointSale') }}: <b style="cursor: pointer"> {{ currentPointOfSales.name }} </b>
|
{{ $t('form.pos.order.pointSale') }}: <b style="cursor: pointer"> {{ currentPointOfSales.name }} </b>
|
||||||
</p>
|
</span>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
v-for="item in listPointOfSales"
|
v-for="item in listPointOfSales"
|
||||||
@ -210,6 +210,48 @@
|
|||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
<br>
|
||||||
|
<el-dropdown
|
||||||
|
v-if="!isEmptyValue(curretnWarehouse)"
|
||||||
|
trigger="click"
|
||||||
|
class="info-pos"
|
||||||
|
@command="changeWarehouse"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
<svg-icon icon-class="tree" />
|
||||||
|
{{ $t('route.warehouse') }}: <b style="cursor: pointer"> {{ curretnWarehouse.name }} </b>
|
||||||
|
</span>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item
|
||||||
|
v-for="item in listWarehouse"
|
||||||
|
:key="item.uuid"
|
||||||
|
:command="item"
|
||||||
|
>
|
||||||
|
{{ item.name }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
<br>
|
||||||
|
<el-dropdown
|
||||||
|
v-if="!isEmptyValue(curretnPriceList)"
|
||||||
|
trigger="click"
|
||||||
|
class="info-pos"
|
||||||
|
@command="changePriceList"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
<svg-icon icon-class="tree-table" />
|
||||||
|
{{ $t('form.pos.priceList') }}: <b style="cursor: pointer"> {{ curretnPriceList.name }} </b>
|
||||||
|
</span>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item
|
||||||
|
v-for="item in pointPriceList"
|
||||||
|
:key="item.uuid"
|
||||||
|
:command="item"
|
||||||
|
>
|
||||||
|
{{ item.name }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<span v-if="isMobile" style="float: right;padding-right: 3%;">
|
<span v-if="isMobile" style="float: right;padding-right: 3%;">
|
||||||
@ -513,6 +555,31 @@ export default {
|
|||||||
currentLineOrder() {
|
currentLineOrder() {
|
||||||
const line = this.$store.state['pointOfSales/orderLine/index'].line
|
const line = this.$store.state['pointOfSales/orderLine/index'].line
|
||||||
return line
|
return line
|
||||||
|
},
|
||||||
|
curretnPriceList() {
|
||||||
|
if (!this.isEmptyValue(this.$store.getters.currentPriceList)) {
|
||||||
|
return this.$store.getters.currentPriceList
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
pointPriceList() {
|
||||||
|
const list = this.$store.getters.posAttributes.currentPointOfSales.listPrices
|
||||||
|
if (this.isEmptyValue(list)) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return list
|
||||||
|
},
|
||||||
|
curretnWarehouse() {
|
||||||
|
if (!this.isEmptyValue(this.$store.getters['user/getWarehouse'])) {
|
||||||
|
return this.$store.getters['user/getWarehouse']
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
listWarehouse() {
|
||||||
|
if (!this.isEmptyValue(this.$store.getters.currentWarehouse)) {
|
||||||
|
return this.$store.getters.currentWarehouse
|
||||||
|
}
|
||||||
|
return []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -598,6 +665,12 @@ export default {
|
|||||||
this.$store.dispatch('setCurrentPOS', posElement)
|
this.$store.dispatch('setCurrentPOS', posElement)
|
||||||
this.newOrder()
|
this.newOrder()
|
||||||
},
|
},
|
||||||
|
changeWarehouse(warehouse) {
|
||||||
|
this.$store.commit('currentWarehouse', warehouse)
|
||||||
|
},
|
||||||
|
changePriceList(priceList) {
|
||||||
|
this.$store.commit('currentListPrices', priceList)
|
||||||
|
},
|
||||||
arrowTop() {
|
arrowTop() {
|
||||||
if (this.currentTable > 0) {
|
if (this.currentTable > 0) {
|
||||||
this.currentTable--
|
this.currentTable--
|
||||||
@ -652,12 +725,16 @@ export default {
|
|||||||
.keypad {
|
.keypad {
|
||||||
float: left;
|
float: left;
|
||||||
height: 20%;
|
height: 20%;
|
||||||
padding-top: 25px;
|
padding-top: 10px;
|
||||||
}
|
}
|
||||||
.total {
|
.total {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 10px
|
margin-bottom: 10px
|
||||||
}
|
}
|
||||||
|
.info-pos {
|
||||||
|
padding-top: 10px;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
.split {
|
.split {
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
-moz-box-sizing: border-box;
|
-moz-box-sizing: border-box;
|
||||||
|
@ -81,12 +81,33 @@ export default {
|
|||||||
uuid: '',
|
uuid: '',
|
||||||
iSOCode: '',
|
iSOCode: '',
|
||||||
curSymbol: '',
|
curSymbol: '',
|
||||||
amountConvertion: 1
|
amountConvertion: 1,
|
||||||
|
divideRate: 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
listPointOfSales() {
|
listPointOfSales() {
|
||||||
return this.$store.getters.posAttributes.listPointOfSales
|
return this.$store.getters.posAttributes.listPointOfSales
|
||||||
},
|
},
|
||||||
|
curretnPriceList() {
|
||||||
|
if (!this.isEmptyValue(this.$store.getters.currentPriceList)) {
|
||||||
|
return this.$store.getters.currentPriceList
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
priceListPointOfSales() {
|
||||||
|
const list = this.$store.getters.posAttributes.currentPointOfSales.listPrices
|
||||||
|
if (this.isEmptyValue(list)) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return list
|
||||||
|
},
|
||||||
|
warehousesListPointOfSales() {
|
||||||
|
const list = this.$store.getters.posAttributes.currentPointOfSales.listWarehouses
|
||||||
|
if (this.isEmptyValue(list)) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return list
|
||||||
|
},
|
||||||
ordersList() {
|
ordersList() {
|
||||||
if (this.isEmptyValue(this.currentPointOfSales)) {
|
if (this.isEmptyValue(this.currentPointOfSales)) {
|
||||||
return []
|
return []
|
||||||
@ -223,10 +244,12 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const searchProduct = (typeof searchValue === 'object') ? searchValue.value : searchValue
|
const searchProduct = (typeof searchValue === 'object') ? searchValue.value : searchValue
|
||||||
|
if (this.isEmptyValue(this.curretnPriceList)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
findProduct({
|
findProduct({
|
||||||
searchValue: searchProduct,
|
searchValue: searchProduct,
|
||||||
priceListUuid: this.currentPointOfSales.priceList.uuid
|
priceListUuid: this.curretnPriceList.uuid
|
||||||
})
|
})
|
||||||
.then(productPrice => {
|
.then(productPrice => {
|
||||||
this.product = productPrice.product
|
this.product = productPrice.product
|
||||||
|
@ -410,6 +410,7 @@ export default {
|
|||||||
form: {
|
form: {
|
||||||
pos: {
|
pos: {
|
||||||
title: 'POS',
|
title: 'POS',
|
||||||
|
priceList: 'Price List',
|
||||||
optionsPoinSales: {
|
optionsPoinSales: {
|
||||||
title: 'Quick Point of Sales Options',
|
title: 'Quick Point of Sales Options',
|
||||||
salesOrder: {
|
salesOrder: {
|
||||||
@ -434,7 +435,9 @@ export default {
|
|||||||
generalOptions: {
|
generalOptions: {
|
||||||
title: 'General Options',
|
title: 'General Options',
|
||||||
changePos: 'Change Point of Sale',
|
changePos: 'Change Point of Sale',
|
||||||
listProducts: 'Change Point of Sale'
|
listProducts: 'Change Point of Sale',
|
||||||
|
changeWarehouseList: 'Change Warehouse',
|
||||||
|
changePriceList: 'Change Price List'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tableProduct: {
|
tableProduct: {
|
||||||
@ -526,7 +529,7 @@ export default {
|
|||||||
description: 'Display the Point of Sale Options panel'
|
description: 'Display the Point of Sale Options panel'
|
||||||
},
|
},
|
||||||
point: {
|
point: {
|
||||||
description: 'Displays the current point of sale'
|
description: 'Current point of sale information'
|
||||||
},
|
},
|
||||||
buttonPanelRightPos: {
|
buttonPanelRightPos: {
|
||||||
title: 'Show Right Panel',
|
title: 'Show Right Panel',
|
||||||
|
@ -385,6 +385,7 @@ export default {
|
|||||||
form: {
|
form: {
|
||||||
pos: {
|
pos: {
|
||||||
title: 'Punto de Venta',
|
title: 'Punto de Venta',
|
||||||
|
priceList: 'Lista de Precio',
|
||||||
optionsPoinSales: {
|
optionsPoinSales: {
|
||||||
title: 'Opciones Rápidas del Punto de Ventas',
|
title: 'Opciones Rápidas del Punto de Ventas',
|
||||||
salesOrder: {
|
salesOrder: {
|
||||||
@ -409,7 +410,9 @@ export default {
|
|||||||
generalOptions: {
|
generalOptions: {
|
||||||
title: 'Opciones Generales',
|
title: 'Opciones Generales',
|
||||||
changePos: 'Cambiar Punto de Venta',
|
changePos: 'Cambiar Punto de Venta',
|
||||||
listProducts: 'Lista de Productos y Precios'
|
listProducts: 'Lista de Productos y Precios',
|
||||||
|
changeWarehouseList: 'Cambiar de Almacén',
|
||||||
|
changePriceList: 'Cambiar Lista de Precio'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tableProduct: {
|
tableProduct: {
|
||||||
@ -502,7 +505,7 @@ export default {
|
|||||||
description: 'Despliega el panel de Opciones del Punto de Venta'
|
description: 'Despliega el panel de Opciones del Punto de Venta'
|
||||||
},
|
},
|
||||||
point: {
|
point: {
|
||||||
description: 'Muestra el punto de venta actual'
|
description: 'Informacion del punto de venta actual'
|
||||||
},
|
},
|
||||||
buttonPanelRightPos: {
|
buttonPanelRightPos: {
|
||||||
title: 'Mostrar Panel Derecho',
|
title: 'Mostrar Panel Derecho',
|
||||||
|
@ -45,13 +45,17 @@ export default {
|
|||||||
* List Order Lines
|
* List Order Lines
|
||||||
* List Payment Order
|
* List Payment Order
|
||||||
* Lst Order
|
* Lst Order
|
||||||
|
* List Warehouses
|
||||||
|
* List Prices
|
||||||
*/
|
*/
|
||||||
posAttributes: (state, getters) => {
|
posAttributes: (state) => {
|
||||||
return {
|
return {
|
||||||
listPointOfSales: state.listPointOfSales,
|
listPointOfSales: state.listPointOfSales,
|
||||||
currentPointOfSales: {
|
currentPointOfSales: {
|
||||||
...state.currentPointOfSales,
|
...state.currentPointOfSales,
|
||||||
listOrder: state.listOrder,
|
listOrder: state.listOrder,
|
||||||
|
listWarehouses: state.listWarehouses,
|
||||||
|
listPrices: state.listPrices,
|
||||||
currentOrder: {
|
currentOrder: {
|
||||||
...state.order,
|
...state.order,
|
||||||
lineOrder: state.listOrderLine,
|
lineOrder: state.listOrderLine,
|
||||||
@ -106,5 +110,23 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return state.keyLayout
|
return state.keyLayout
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Current Price List
|
||||||
|
*/
|
||||||
|
currentPriceList: (state) => {
|
||||||
|
if (!isEmptyValue(state.currentlistPrices)) {
|
||||||
|
return state.currentlistPrices
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Current Warehouse
|
||||||
|
*/
|
||||||
|
currentWarehouse: (state) => {
|
||||||
|
if (!isEmptyValue(state.currentWarehouse)) {
|
||||||
|
return state.currentWarehouse
|
||||||
|
}
|
||||||
|
return {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ export default {
|
|||||||
* @param {string} customerUuid Customer Uuid
|
* @param {string} customerUuid Customer Uuid
|
||||||
* @param {string} salesRepresentativeUuid Sales Representative Uuid
|
* @param {string} salesRepresentativeUuid Sales Representative Uuid
|
||||||
*/
|
*/
|
||||||
createOrder({ commit, dispatch }, {
|
createOrder({ commit, dispatch, rootGetters }, {
|
||||||
posUuid,
|
posUuid,
|
||||||
customerUuid,
|
customerUuid,
|
||||||
salesRepresentativeUuid
|
salesRepresentativeUuid
|
||||||
@ -42,7 +42,8 @@ export default {
|
|||||||
return createOrder({
|
return createOrder({
|
||||||
posUuid,
|
posUuid,
|
||||||
customerUuid,
|
customerUuid,
|
||||||
salesRepresentativeUuid
|
salesRepresentativeUuid,
|
||||||
|
warehouseUuid: rootGetters.currentWarehouse.uuid
|
||||||
})
|
})
|
||||||
.then(order => {
|
.then(order => {
|
||||||
commit('setOrder', order)
|
commit('setOrder', order)
|
||||||
@ -66,7 +67,7 @@ export default {
|
|||||||
* @param {string} posUuid Order Uuid
|
* @param {string} posUuid Order Uuid
|
||||||
* @param {string} customerUuid Customer Uuid
|
* @param {string} customerUuid Customer Uuid
|
||||||
*/
|
*/
|
||||||
updateOrder({ commit, dispatch }, {
|
updateOrder({ commit, dispatch, rootGetters }, {
|
||||||
orderUuid,
|
orderUuid,
|
||||||
posUuid,
|
posUuid,
|
||||||
customerUuid
|
customerUuid
|
||||||
@ -74,7 +75,7 @@ export default {
|
|||||||
updateOrder({
|
updateOrder({
|
||||||
orderUuid,
|
orderUuid,
|
||||||
posUuid,
|
posUuid,
|
||||||
customerUuid
|
warehouseUuid: rootGetters.currentWarehouse.uuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
dispatch('reloadOrder', { orderUuid: response.uuid })
|
dispatch('reloadOrder', { orderUuid: response.uuid })
|
||||||
|
@ -111,6 +111,25 @@ export default {
|
|||||||
const payment = state.paymentBox
|
const payment = state.paymentBox
|
||||||
payment.splice(0)
|
payment.splice(0)
|
||||||
},
|
},
|
||||||
|
searchConversion({ commit }, params) {
|
||||||
|
requestGetConversionRate({
|
||||||
|
conversionTypeUuid: params.conversionTypeUuid,
|
||||||
|
currencyFromUuid: params.currencyFromUuid,
|
||||||
|
currencyToUuid: params.currencyToUuid,
|
||||||
|
conversionDate: params.conversionDate
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
commit('conversionList', response)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.warn(`conversionDivideRate: ${error.message}. Code: ${error.code}.`)
|
||||||
|
showMessage({
|
||||||
|
type: 'error',
|
||||||
|
message: error.message,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
conversionDivideRate({ commit, dispatch }, params) {
|
conversionDivideRate({ commit, dispatch }, params) {
|
||||||
return requestGetConversionRate({
|
return requestGetConversionRate({
|
||||||
conversionTypeUuid: params.conversionTypeUuid,
|
conversionTypeUuid: params.conversionTypeUuid,
|
||||||
|
@ -16,7 +16,10 @@
|
|||||||
|
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import {
|
import {
|
||||||
listPointOfSales
|
listPointOfSales,
|
||||||
|
listWarehouse,
|
||||||
|
listPrices,
|
||||||
|
listCurrencies
|
||||||
} from '@/api/ADempiere/form/point-of-sales.js'
|
} from '@/api/ADempiere/form/point-of-sales.js'
|
||||||
import { isEmptyValue } from '@/utils/ADempiere/valueUtils.js'
|
import { isEmptyValue } from '@/utils/ADempiere/valueUtils.js'
|
||||||
import { showMessage } from '@/utils/ADempiere/notification.js'
|
import { showMessage } from '@/utils/ADempiere/notification.js'
|
||||||
@ -58,7 +61,55 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
setCurrentPOS({ commit, dispatch }, posToSet) {
|
listWarehouseFromServer({ commit }, posUuid) {
|
||||||
|
listWarehouse({
|
||||||
|
posUuid
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
commit('listWarehouses', response.records)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.warn(`listWarehouseFromServer: ${error.message}. Code: ${error.code}.`)
|
||||||
|
showMessage({
|
||||||
|
type: 'error',
|
||||||
|
message: error.message,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
listPricesFromServer({ commit }, point) {
|
||||||
|
listPrices({
|
||||||
|
posUuid: point.uuid
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
commit('listPrices', response.records)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.warn(`listPricesFromServer: ${error.message}. Code: ${error.code}.`)
|
||||||
|
showMessage({
|
||||||
|
type: 'error',
|
||||||
|
message: error.message,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
listCurrenciesFromServer({ commit }, posUuid) {
|
||||||
|
listCurrencies({
|
||||||
|
posUuid
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
commit('listCurrencies', response.records)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.warn(`listPricesFromServer: ${error.message}. Code: ${error.code}.`)
|
||||||
|
showMessage({
|
||||||
|
type: 'error',
|
||||||
|
message: error.message,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
setCurrentPOS({ commit, dispatch, rootGetters }, posToSet) {
|
||||||
commit('currentPointOfSales', posToSet)
|
commit('currentPointOfSales', posToSet)
|
||||||
const oldRoute = router.app._route
|
const oldRoute = router.app._route
|
||||||
router.push({
|
router.push({
|
||||||
@ -71,7 +122,11 @@ export default {
|
|||||||
pos: posToSet.id
|
pos: posToSet.id
|
||||||
}
|
}
|
||||||
}, () => {})
|
}, () => {})
|
||||||
|
dispatch('listWarehouseFromServer', posToSet.uuid)
|
||||||
|
dispatch('listCurrenciesFromServer', posToSet.uuid)
|
||||||
|
dispatch('listPricesFromServer', posToSet)
|
||||||
|
commit('currentListPrices', posToSet.priceList)
|
||||||
|
commit('currentWarehouse', rootGetters['user/getWarehouse'])
|
||||||
commit('resetConversionRate', [])
|
commit('resetConversionRate', [])
|
||||||
commit('setIsReloadKeyLayout')
|
commit('setIsReloadKeyLayout')
|
||||||
commit('setIsReloadProductPrice')
|
commit('setIsReloadProductPrice')
|
||||||
|
@ -30,6 +30,24 @@ export default {
|
|||||||
listPointOfSales(state, listPointOfSales) {
|
listPointOfSales(state, listPointOfSales) {
|
||||||
state.listPointOfSales = listPointOfSales
|
state.listPointOfSales = listPointOfSales
|
||||||
},
|
},
|
||||||
|
listWarehouses(state, listWarehouses) {
|
||||||
|
state.listWarehouses = listWarehouses
|
||||||
|
},
|
||||||
|
currentListPrices(state, listPrices) {
|
||||||
|
state.currentlistPrices = listPrices
|
||||||
|
},
|
||||||
|
currentWarehouse(state, warehouse) {
|
||||||
|
state.currentWarehouse = warehouse
|
||||||
|
},
|
||||||
|
listPrices(state, listPrices) {
|
||||||
|
state.listPrices = listPrices
|
||||||
|
},
|
||||||
|
listCurrencies(state, listCurrency) {
|
||||||
|
state.listCurrency = listCurrency
|
||||||
|
},
|
||||||
|
conversionList(state, conversion) {
|
||||||
|
state.conversionList.push(conversion)
|
||||||
|
},
|
||||||
currentPointOfSales(state, currentPointOfSales) {
|
currentPointOfSales(state, currentPointOfSales) {
|
||||||
state.currentPointOfSales = currentPointOfSales
|
state.currentPointOfSales = currentPointOfSales
|
||||||
},
|
},
|
||||||
|
@ -28,6 +28,12 @@ export default {
|
|||||||
...withoutResponse
|
...withoutResponse
|
||||||
},
|
},
|
||||||
listPointOfSales: {},
|
listPointOfSales: {},
|
||||||
|
listWarehouses: {},
|
||||||
|
listPrices: {},
|
||||||
|
currentlistPrices: {},
|
||||||
|
currentWarehouse: {},
|
||||||
|
listCurrency: [],
|
||||||
|
conversionList: [],
|
||||||
currentPointOfSales: {},
|
currentPointOfSales: {},
|
||||||
showPOSOptions: false,
|
showPOSOptions: false,
|
||||||
showPOSKeyLayout: false,
|
showPOSKeyLayout: false,
|
||||||
|
@ -58,9 +58,8 @@ export default {
|
|||||||
pageToken = token + '-' + pageNumber
|
pageToken = token + '-' + pageNumber
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const { priceList, templateBusinessPartner } = rootGetters.posAttributes.currentPointOfSales
|
const { templateBusinessPartner } = rootGetters.posAttributes.currentPointOfSales
|
||||||
const { uuid: businessPartnerUuid } = templateBusinessPartner
|
const { uuid: businessPartnerUuid } = templateBusinessPartner
|
||||||
const { uuid: priceListUuid } = priceList
|
|
||||||
const { uuid: warehouseUuid } = rootGetters['user/getWarehouse']
|
const { uuid: warehouseUuid } = rootGetters['user/getWarehouse']
|
||||||
if (isEmptyValue(searchValue)) {
|
if (isEmptyValue(searchValue)) {
|
||||||
searchValue = rootGetters.getValueOfField({
|
searchValue = rootGetters.getValueOfField({
|
||||||
@ -71,9 +70,9 @@ export default {
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
getProductPriceList({
|
getProductPriceList({
|
||||||
searchValue,
|
searchValue,
|
||||||
priceListUuid,
|
priceListUuid: rootGetters.currentPriceList.uuid,
|
||||||
businessPartnerUuid,
|
businessPartnerUuid,
|
||||||
warehouseUuid,
|
warehouseUuid: rootGetters.currentWarehouse.uuid,
|
||||||
pageToken
|
pageToken
|
||||||
}).then(responseProductPrice => {
|
}).then(responseProductPrice => {
|
||||||
if (isEmptyValue(token) || isEmptyValue(pageToken)) {
|
if (isEmptyValue(token) || isEmptyValue(pageToken)) {
|
||||||
@ -130,9 +129,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const { priceList, templateBusinessPartner } = rootGetters.posAttributes.currentPointOfSales
|
const { templateBusinessPartner } = rootGetters.posAttributes.currentPointOfSales
|
||||||
const { uuid: businessPartnerUuid } = templateBusinessPartner
|
const { uuid: businessPartnerUuid } = templateBusinessPartner
|
||||||
const { uuid: priceListUuid } = priceList
|
|
||||||
const { uuid: warehouseUuid } = rootGetters['user/getWarehouse']
|
const { uuid: warehouseUuid } = rootGetters['user/getWarehouse']
|
||||||
|
|
||||||
if (isEmptyValue(searchValue)) {
|
if (isEmptyValue(searchValue)) {
|
||||||
@ -144,7 +142,7 @@ export default {
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
getProductPriceList({
|
getProductPriceList({
|
||||||
searchValue,
|
searchValue,
|
||||||
priceListUuid,
|
priceListUuid: rootGetters.currentPriceList.uuid,
|
||||||
businessPartnerUuid,
|
businessPartnerUuid,
|
||||||
warehouseUuid,
|
warehouseUuid,
|
||||||
pageToken
|
pageToken
|
||||||
|
Loading…
x
Reference in New Issue
Block a user