1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-07 18:25:45 +08:00

change the tender type service (#1113)

* change the tender type service

* display of the fields

Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
Elsio Sanchez 2021-08-24 11:06:07 -04:00 committed by GitHub
parent 70d1ace6b8
commit 8b1e0a8345
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 123 additions and 48 deletions

View File

@ -910,7 +910,7 @@ export function listTenderTypes({
posUuid
}) {
return request({
url: `${config.pointOfSales.endpoint}/available-tender-types`,
url: `${config.pointOfSales.endpoint}/available-payment-methods`,
method: 'get',
params: {
pos_uuid: posUuid

View File

@ -61,7 +61,7 @@ export default [
handleActionKeyPerformed: true,
handleActionPerformed: true,
handleContentSelection: true,
displayLogic: `@TenderType@<>'X'`,
displayLogic: `@TenderType@<>'X'&@TenderType@<>'Z'`,
size: 24,
isActiveLogics: true,
isMandatory: true
@ -168,5 +168,21 @@ export default [
isActiveLogics: true,
isMandatory: true
}
},
{
elementColumnName: 'EMail',
columnName: 'EMail',
tableName: 'AD_user',
isFromDictionary: true,
overwriteDefinition: {
sequence: 4,
handleActionKeyPerformed: true,
handleContentSelection: true,
handleActionPerformed: true,
size: 24,
displayLogic: `@TenderType@=='Z'`,
isActiveLogics: true,
isMandatory: true
}
}
]

View File

@ -32,6 +32,52 @@
<el-radio v-model="option" :label="4"> {{ $t('form.pos.collect.overdrawnInvoice.adjustDocument') }}</el-radio>
</el-form-item>
</el-form>
<el-card v-if="option === 1" class="box-card">
<div slot="header" class="clearfix">
<span v-if="isEmptyValue(selectionTypeRefund)">{{ $t('form.pos.collect.overdrawnInvoice.above') }}</span>
<template v-else>
<span>
{{ selectionTypeRefund.name }}
</span>
<span style="float: right;text-align: end">
<b>
{{ $t('form.pos.collect.overdrawnInvoice.dailyLimit') }}: {{ formatPrice(maximumDailyRefundAllowed, refundReferenceCurrency) }}
{{ $t('form.pos.collect.overdrawnInvoice.customerLimit') }}: {{ formatPrice(maximumRefundAllowed, refundReferenceCurrency) }}
</b>
</span>
</template>
</div>
<div class="text item">
<el-row :gutter="24">
<el-col v-for="(payment, index) in paymentTypeListRefund" :key="index" :span="6">
<div @click="selectPayment(payment)">
<el-card shadow="hover">
<div slot="header" class="clearfix" style="text-align: center;">
<span>
<b>{{ payment.name }}</b> <br>
</span>
</div>
<div class="text item">
<el-image
:src="imageCard(payment.tender_type)"
tyle="width: 100px; height: 100px"
fit="contain"
/>
</div>
</el-card>
</div>
</el-col>
</el-row>
</div>
<div v-if="!isEmptyValue(selectionTypeRefund)" class="text item">
<component
:is="componentRender"
:change="change"
/>
</div>
</el-card>
</div>
<div>
<el-card v-if="option === 2" class="box-card">
<div slot="header" class="clearfix">
<span>{{ $t('form.pos.collect.overdrawnInvoice.above') }}</span>
@ -72,7 +118,7 @@
</span>
</template>
</div>
<div v-if="isEmptyValue(selectionTypeRefund)" class="text item">
<div class="text item">
<el-row :gutter="24">
<el-col v-for="(payment, index) in paymentTypeList" :key="index" :span="6">
<div @click="selectPayment(payment)">
@ -84,7 +130,7 @@
</div>
<div class="text item">
<el-image
:src="imageCard(payment.key)"
:src="imageCard(payment.tender_type)"
tyle="width: 100px; height: 100px"
fit="contain"
/>
@ -128,32 +174,17 @@
</el-card>
</div>
<span slot="footer" class="dialog-footer">
<el-button
v-if="!isEmptyValue(selectionTypeRefund)"
type="info"
class="custom-button-create-bp"
icon="el-icon-back"
@click="selectionTypeRefund = {}"
/>
<el-button
type="danger"
class="custom-button-create-bp"
icon="el-icon-close"
@click="close"
/>
<el-button
v-if="caseOrder === 1 && !isEmptyValue(selectionTypeRefund)"
type="primary"
class="custom-button-create-bp"
icon="el-icon-plus"
:disabled="!isEmptyValue(refundLoaded)"
@click="addRefund"
/>
<el-button
type="success"
class="custom-button-create-bp"
icon="el-icon-check"
@click="success"
@click="addRefund"
/>
</span>
</el-dialog>
@ -222,7 +253,7 @@ export default {
computed: {
componentRender() {
let typePay
switch (this.selectionTypeRefund.key) {
switch (this.selectionTypeRefund.tender_type) {
case 'P':
typePay = () => import('./paymentTypeChange/MobilePayment/index')
break
@ -243,7 +274,7 @@ export default {
},
renderComponentContainer() {
let container
switch (this.selectionTypeRefund.key) {
switch (this.selectionTypeRefund.tender_type) {
case 'P':
container = 'MobilePayment'
break
@ -328,12 +359,20 @@ export default {
return this.$store.getters.getFieldsListEmptyMandatory({ containerUuid: 'OverdrawnInvoice', formatReturn: 'name' })
},
paymentTypeList() {
return this.$store.getters.getPaymentTypeList.filter(type => type.is_allowed_to_refund_open)
},
paymentTypeListRefund() {
return this.$store.getters.getPaymentTypeList.filter(type => type.is_allowed_to_refund)
},
refundLoaded() {
return this.$store.getters.getRefundLoaded
}
},
watch: {
option(value) {
this.selectionTypeRefund = {}
}
},
mounted() {
this.selectionTypeRefund = {}
},
@ -342,9 +381,12 @@ export default {
imageCard(typeRefund) {
let image
switch (typeRefund) {
case 'P':
case 'D':
image = 'MobilePayment.jpg'
break
case 'P':
image = 'Mobile.jpg'
break
case 'X':
image = 'Cash.jpg'
break
@ -396,6 +438,7 @@ export default {
})
this.$store.dispatch('addRefundLoaded', values)
this.selectionTypeRefund = {}
this.success()
},
success() {
const customerDetails = []
@ -458,13 +501,6 @@ export default {
showClose: true
})
})
.catch(error => {
this.$message({
type: 'error',
message: error.message,
showClose: true
})
})
this.$store.commit('dialogoInvoce', { show: false, success: true })
} else {
this.$message({
@ -476,8 +512,22 @@ export default {
}
break
default:
this.completePreparedOrder(posUuid, orderUuid, payments)
this.$store.commit('dialogoInvoce', { show: false, success: true })
console.log(this.$store.getters.posAttributes.currentPointOfSales.isPosRequiredPin)
if (this.$store.getters.posAttributes.currentPointOfSales.isPosRequiredPin) {
const attributePin = {
posUuid,
orderUuid,
payments,
action: 'openBalanceInvoice',
type: 'actionPos',
label: this.$t('form.pos.pinMessage.invoiceOpen')
}
this.visible = true
this.$store.dispatch('changePopoverOverdrawnInvoice', { attributePin, visible: true })
} else {
this.completePreparedOrder(posUuid, orderUuid, payments)
this.$store.commit('dialogoInvoce', { show: false, success: true })
}
break
}
},

View File

@ -25,7 +25,7 @@ export default [
tabindex: '1',
isFromDictionary: true,
overwriteDefinition: {
sequence: 0,
sequence: 1,
isCustomField: true,
size: 24,
isMandatory: true
@ -38,7 +38,7 @@ export default [
isFromDictionary: true,
tabindex: '0',
overwriteDefinition: {
sequence: 1,
sequence: 0,
isCustomField: true,
size: 24,
isMandatory: true
@ -50,7 +50,7 @@ export default [
columnName: 'C_Bank_ID',
isFromDictionary: true,
overwriteDefinition: {
sequence: 6,
sequence: 3,
handleActionKeyPerformed: true,
handleActionPerformed: true,
handleContentSelection: true,
@ -66,7 +66,7 @@ export default [
columnName: 'AccountNo',
isFromDictionary: true,
overwriteDefinition: {
sequence: 8,
sequence: 4,
handleActionKeyPerformed: true,
handleContentSelection: true,
handleActionPerformed: true,
@ -81,7 +81,7 @@ export default [
tableName: 'AD_user',
isFromDictionary: true,
overwriteDefinition: {
sequence: 9,
sequence: 2,
handleActionKeyPerformed: true,
handleContentSelection: true,
handleActionPerformed: true,
@ -96,7 +96,7 @@ export default [
columnName: 'PayAmt',
isFromDictionary: true,
overwriteDefinition: {
sequence: 3,
sequence: 6,
handleContentSelection: true,
handleActionPerformed: true,
size: 24,

View File

@ -32,10 +32,11 @@
:metadata-field="field"
/>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item :label="$t('form.pos.collect.Currency')">
<el-select
v-model="currentFieldCurrency"
style="width: -webkit-fill-available;"
@change="changeCurrency"
>
<el-option

View File

@ -39,6 +39,7 @@
<el-form-item :label="$t('form.pos.collect.Currency')">
<el-select
v-model="currentFieldCurrency"
style="width: -webkit-fill-available;"
@change="changeCurrency"
>
<el-option

View File

@ -25,7 +25,7 @@ export default [
tabindex: '1',
isFromDictionary: true,
overwriteDefinition: {
sequence: 0,
sequence: 1,
isCustomField: true,
size: 24,
isMandatory: true
@ -38,7 +38,7 @@ export default [
isFromDictionary: true,
tabindex: '0',
overwriteDefinition: {
sequence: 1,
sequence: 0,
isCustomField: true,
size: 24,
isMandatory: true
@ -64,7 +64,7 @@ export default [
columnName: 'C_Bank_ID',
isFromDictionary: true,
overwriteDefinition: {
sequence: 6,
sequence: 3,
handleActionKeyPerformed: true,
handleActionPerformed: true,
handleContentSelection: true,
@ -80,7 +80,7 @@ export default [
columnName: 'PayAmt',
isFromDictionary: true,
overwriteDefinition: {
sequence: 3,
sequence: 4,
handleContentSelection: true,
handleActionPerformed: true,
size: 24,

View File

@ -36,6 +36,7 @@
<el-form-item :label="$t('form.pos.collect.Currency')">
<el-select
v-model="currentFieldCurrency"
style="width: -webkit-fill-available;"
@change="changeCurrency"
>
<el-option

View File

@ -52,10 +52,10 @@
:is-disabled="isDisabled"
/>
</el-col>
<el-col :span="4" :style="styleTab">
<el-col :span="3" :style="styleTab">
<fast-ordes-list />
</el-col>
<el-col :span="5" :style="styleTab">
<el-col :span="4" :style="styleTab">
<el-form-item>
<template slot="label" />
<el-dropdown
@ -73,6 +73,7 @@
v-for="item in listDocumentTypes"
:key="item.uuid"
:command="item"
:disabled="isDisabled"
>
{{ item.name }}
</el-dropdown-item>
@ -80,7 +81,7 @@
</el-dropdown>
</el-form-item>
</el-col>
<el-col :span="isEmptyValue(currentOrder) ? 1 : 4" :style="isShowedPOSKeyLayout ? 'padding: 0px; margin-top: 3.%;' : 'padding: 0px; margin-top: 2.4%;'">
<el-col :span="isEmptyValue(currentOrder) ? 3 : 4" :style="isShowedPOSKeyLayout ? 'padding: 0px; margin-top: 3.%;' : 'padding: 0px; margin-top: 2.4%;'">
<el-form-item>
<el-row :gutter="24">
<el-col :span="10" style="padding-left: 0px; padding-right: 0px;">
@ -174,6 +175,7 @@
{{ $t('form.productInfo.code') }}: <b>{{ scope.row.product.value }}</b><br>
{{ $t('form.productInfo.name') }}: <b>{{ scope.row.product.name }}</b><br>
{{ $t('form.productInfo.description') }}: <b>{{ scope.row.product.description }}</b><br>
{{ $t('form.productInfo.UM') }}: <b>{{ scope.row.product.uomName }}</b><br>
</el-col>
<el-col :span="8">
<div style="float: right; text-align: end;">

View File

@ -295,6 +295,8 @@ export default {
break
case 'openBalanceInvoice':
this.$store.commit('dialogoInvoce', { show: true, type: 2 })
this.$store.commit('dialogoInvoce', { show: false })
this.refundAllowed(action.posUuid, action.orderUuid, action.payments)
break
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

View File

@ -551,7 +551,8 @@ export default {
grandTotal: 'Grand Total',
grandTotalConverted: 'Grand Total Converted',
quantityAvailable: 'Available',
upc: 'UPC / EAN'
upc: 'UPC / EAN',
UM: 'UM'
},
guideSteps: {
productValue: {

View File

@ -527,7 +527,8 @@ export default {
grandTotal: 'Total General',
grandTotalConverted: 'Gran Total Convertido',
quantityAvailable: 'Disponible',
upc: 'Código de Barras'
upc: 'Código de Barras',
UM: 'UM'
},
guideSteps: {
productValue: {