1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 12:01:57 +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 posUuid
}) { }) {
return request({ return request({
url: `${config.pointOfSales.endpoint}/available-tender-types`, url: `${config.pointOfSales.endpoint}/available-payment-methods`,
method: 'get', method: 'get',
params: { params: {
pos_uuid: posUuid pos_uuid: posUuid

View File

@ -61,7 +61,7 @@ export default [
handleActionKeyPerformed: true, handleActionKeyPerformed: true,
handleActionPerformed: true, handleActionPerformed: true,
handleContentSelection: true, handleContentSelection: true,
displayLogic: `@TenderType@<>'X'`, displayLogic: `@TenderType@<>'X'&@TenderType@<>'Z'`,
size: 24, size: 24,
isActiveLogics: true, isActiveLogics: true,
isMandatory: true isMandatory: true
@ -168,5 +168,21 @@ export default [
isActiveLogics: true, isActiveLogics: true,
isMandatory: 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-radio v-model="option" :label="4"> {{ $t('form.pos.collect.overdrawnInvoice.adjustDocument') }}</el-radio>
</el-form-item> </el-form-item>
</el-form> </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"> <el-card v-if="option === 2" class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ $t('form.pos.collect.overdrawnInvoice.above') }}</span> <span>{{ $t('form.pos.collect.overdrawnInvoice.above') }}</span>
@ -72,7 +118,7 @@
</span> </span>
</template> </template>
</div> </div>
<div v-if="isEmptyValue(selectionTypeRefund)" class="text item"> <div class="text item">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col v-for="(payment, index) in paymentTypeList" :key="index" :span="6"> <el-col v-for="(payment, index) in paymentTypeList" :key="index" :span="6">
<div @click="selectPayment(payment)"> <div @click="selectPayment(payment)">
@ -84,7 +130,7 @@
</div> </div>
<div class="text item"> <div class="text item">
<el-image <el-image
:src="imageCard(payment.key)" :src="imageCard(payment.tender_type)"
tyle="width: 100px; height: 100px" tyle="width: 100px; height: 100px"
fit="contain" fit="contain"
/> />
@ -128,32 +174,17 @@
</el-card> </el-card>
</div> </div>
<span slot="footer" class="dialog-footer"> <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 <el-button
type="danger" type="danger"
class="custom-button-create-bp" class="custom-button-create-bp"
icon="el-icon-close" icon="el-icon-close"
@click="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 <el-button
type="success" type="success"
class="custom-button-create-bp" class="custom-button-create-bp"
icon="el-icon-check" icon="el-icon-check"
@click="success" @click="addRefund"
/> />
</span> </span>
</el-dialog> </el-dialog>
@ -222,7 +253,7 @@ export default {
computed: { computed: {
componentRender() { componentRender() {
let typePay let typePay
switch (this.selectionTypeRefund.key) { switch (this.selectionTypeRefund.tender_type) {
case 'P': case 'P':
typePay = () => import('./paymentTypeChange/MobilePayment/index') typePay = () => import('./paymentTypeChange/MobilePayment/index')
break break
@ -243,7 +274,7 @@ export default {
}, },
renderComponentContainer() { renderComponentContainer() {
let container let container
switch (this.selectionTypeRefund.key) { switch (this.selectionTypeRefund.tender_type) {
case 'P': case 'P':
container = 'MobilePayment' container = 'MobilePayment'
break break
@ -328,12 +359,20 @@ export default {
return this.$store.getters.getFieldsListEmptyMandatory({ containerUuid: 'OverdrawnInvoice', formatReturn: 'name' }) return this.$store.getters.getFieldsListEmptyMandatory({ containerUuid: 'OverdrawnInvoice', formatReturn: 'name' })
}, },
paymentTypeList() { 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) return this.$store.getters.getPaymentTypeList.filter(type => type.is_allowed_to_refund)
}, },
refundLoaded() { refundLoaded() {
return this.$store.getters.getRefundLoaded return this.$store.getters.getRefundLoaded
} }
}, },
watch: {
option(value) {
this.selectionTypeRefund = {}
}
},
mounted() { mounted() {
this.selectionTypeRefund = {} this.selectionTypeRefund = {}
}, },
@ -342,9 +381,12 @@ export default {
imageCard(typeRefund) { imageCard(typeRefund) {
let image let image
switch (typeRefund) { switch (typeRefund) {
case 'P': case 'D':
image = 'MobilePayment.jpg' image = 'MobilePayment.jpg'
break break
case 'P':
image = 'Mobile.jpg'
break
case 'X': case 'X':
image = 'Cash.jpg' image = 'Cash.jpg'
break break
@ -396,6 +438,7 @@ export default {
}) })
this.$store.dispatch('addRefundLoaded', values) this.$store.dispatch('addRefundLoaded', values)
this.selectionTypeRefund = {} this.selectionTypeRefund = {}
this.success()
}, },
success() { success() {
const customerDetails = [] const customerDetails = []
@ -458,13 +501,6 @@ export default {
showClose: true showClose: true
}) })
}) })
.catch(error => {
this.$message({
type: 'error',
message: error.message,
showClose: true
})
})
this.$store.commit('dialogoInvoce', { show: false, success: true }) this.$store.commit('dialogoInvoce', { show: false, success: true })
} else { } else {
this.$message({ this.$message({
@ -476,8 +512,22 @@ export default {
} }
break break
default: default:
this.completePreparedOrder(posUuid, orderUuid, payments) console.log(this.$store.getters.posAttributes.currentPointOfSales.isPosRequiredPin)
this.$store.commit('dialogoInvoce', { show: false, success: true }) 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 break
} }
}, },

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

View File

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

View File

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