1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 12:01:57 +08:00

Fix Customer the Point of Sales (#870)

Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
Elsio Sanchez 2021-05-25 16:26:38 -04:00 committed by GitHub
parent 70022f0f61
commit 6b927bd88f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 113 additions and 104 deletions

View File

@ -16,7 +16,6 @@
along with this program. If not, see <https:www.gnu.org/licenses/>.
-->
<template>
<div>
<el-form-item>
<template slot="label">
{{ $t('form.pos.order.BusinessPartnerCreate.businessPartner') }}
@ -64,7 +63,6 @@
</el-button>
</el-popover>
</template>
<el-autocomplete
v-model="displayedValue"
:placeholder="$t('quickAccess.searchWithEnter')"
@ -98,8 +96,6 @@
</template>
</el-autocomplete>
</el-form-item>
</div>
</template>
<script>
@ -169,11 +165,15 @@ export default {
},
displayedValue: {
get() {
const busineesPartner = this.$store.getters.posAttributes.currentPointOfSales.currentOrder.businessPartner.name
if (this.isEmptyValue(busineesPartner)) {
return this.$store.getters.getValueOfField({
containerUuid: this.parentMetadata.containerUuid,
// DisplayColumn_'ColumnName'
columnName: 'DisplayColumn_C_BPartner_ID' // this.parentMetadata.displayColumnName
})
}
return busineesPartner
},
set(value) {
this.$store.commit('updateValueOfField', {

View File

@ -475,7 +475,7 @@ export default {
requestCreateOrder({
posUuid,
customerUuid: this.currentOrder.businessPartner.uuid,
salesRepresentativeUuid: this.currentPointOfSales.salesRepresentative.uuid
salesRepresentativeUuid: this.currentOrder.salesRepresentative.uuid
})
.then(order => {
this.$store.dispatch('currentOrder', order)

View File

@ -28,7 +28,7 @@
>
<el-form label-position="top" label-width="10px" @submit.native.prevent="notSubmitForm">
<el-row :gutter="24" style="display: flex;">
<el-col :span="14" style="padding-left: 0px; padding-right: 0px;">
<el-col :span="isEmptyValue(currentOrder) ? 14 : 11 " style="padding-left: 0px; padding-right: 0px;">
<template
v-for="(field) in fieldsList"
>
@ -39,7 +39,7 @@
/>
</template>
</el-col>
<el-col :span="6" style="padding-left: 0px; padding-right: 0px;">
<el-col :span="isEmptyValue(currentOrder) ? 9 : 7" style="padding-left: 0px; padding-right: 0px;">
<business-partner
:parent-metadata="{
name: panelMetadata.name,
@ -50,7 +50,10 @@
:is-disabled="isDisabled"
/>
</el-col>
<el-col :span="2" :style="isShowedPOSKeyLayout ? 'margin-top: 3.4%;padding: 0px;' : 'padding: 0px;margin-top: 2.4%;'">
<el-col :span="isEmptyValue(currentOrder) ? 1 : 4" :style="isShowedPOSKeyLayout ? 'padding: 0px;' : 'padding: 0px;margin-top: 2.9%;'">
<el-form-item>
<el-row :gutter="24">
<el-col :span="10" style="padding-left: 0px; padding-right: 0px;">
<el-tag
v-if="!isEmptyValue(currentOrder.documentStatus.value)"
:type="tagStatus(currentOrder.documentStatus.value)"
@ -60,12 +63,15 @@
</span>
</el-tag>
</el-col>
<el-col :span="2" :style="isShowedPOSKeyLayout ? 'margin-top: 3.4%;' : 'padding: 0px;margin-top: 2.4%;'">
<el-col :span="14" style="padding-left: 0px; padding-right: 0px;">
<el-button type="primary" plain :disabled="isEmptyValue(this.$route.query.action)" @click="newOrder">
{{ $t('form.pos.optionsPoinSales.salesOrder.newOrder') }}
</el-button>
</el-col>
</el-row>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-header>
<el-main style="background: white; padding: 0px; height: 100% !important; overflow: hidden">

View File

@ -269,18 +269,17 @@ export default {
if (this.isEmptyValue(orderUuid)) {
const posUuid = this.currentPointOfSales.uuid
let customerUuid = this.$store.getters.getValueOfField({
containerUuid: this.containerUuid,
containerUuid: this.metadata.containerUuid,
columnName: 'C_BPartner_ID_UUID'
})
const id = this.$store.getters.getValueOfField({
containerUuid: this.containerUuid,
containerUuid: this.metadata.containerUuid,
columnName: 'C_BPartner_ID'
})
if (this.isEmptyValue(customerUuid) || id === 1000006) {
customerUuid = this.currentPointOfSales.templateBusinessPartner.uuid
}
// user session
// alert(name)
this.$store.dispatch('createOrder', {
posUuid,
customerUuid,

View File

@ -17,6 +17,7 @@
import {
requestListOrderLines
} from '@/api/ADempiere/form/point-of-sales.js'
import { isEmptyValue } from '@/utils/ADempiere/valueUtils.js'
import { showMessage } from '@/utils/ADempiere/notification.js'
/**
* Order Line Actions
@ -26,6 +27,9 @@ export default {
commit('setListOrderLine', params)
},
listOrderLinesFromServer({ commit }, orderUuid) {
if (isEmptyValue(orderUuid)) {
return
}
requestListOrderLines({
orderUuid
})