mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-12 22:29:59 +08:00
Fix Customer the Point of Sales (#870)
Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
parent
70022f0f61
commit
6b927bd88f
@ -16,7 +16,6 @@
|
|||||||
along with this program. If not, see <https:www.gnu.org/licenses/>.
|
along with this program. If not, see <https:www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<template slot="label">
|
<template slot="label">
|
||||||
{{ $t('form.pos.order.BusinessPartnerCreate.businessPartner') }}
|
{{ $t('form.pos.order.BusinessPartnerCreate.businessPartner') }}
|
||||||
@ -64,7 +63,6 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-autocomplete
|
<el-autocomplete
|
||||||
v-model="displayedValue"
|
v-model="displayedValue"
|
||||||
:placeholder="$t('quickAccess.searchWithEnter')"
|
:placeholder="$t('quickAccess.searchWithEnter')"
|
||||||
@ -98,8 +96,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-autocomplete>
|
</el-autocomplete>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -169,11 +165,15 @@ export default {
|
|||||||
},
|
},
|
||||||
displayedValue: {
|
displayedValue: {
|
||||||
get() {
|
get() {
|
||||||
|
const busineesPartner = this.$store.getters.posAttributes.currentPointOfSales.currentOrder.businessPartner.name
|
||||||
|
if (this.isEmptyValue(busineesPartner)) {
|
||||||
return this.$store.getters.getValueOfField({
|
return this.$store.getters.getValueOfField({
|
||||||
containerUuid: this.parentMetadata.containerUuid,
|
containerUuid: this.parentMetadata.containerUuid,
|
||||||
// DisplayColumn_'ColumnName'
|
// DisplayColumn_'ColumnName'
|
||||||
columnName: 'DisplayColumn_C_BPartner_ID' // this.parentMetadata.displayColumnName
|
columnName: 'DisplayColumn_C_BPartner_ID' // this.parentMetadata.displayColumnName
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
return busineesPartner
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
this.$store.commit('updateValueOfField', {
|
this.$store.commit('updateValueOfField', {
|
||||||
|
@ -475,7 +475,7 @@ export default {
|
|||||||
requestCreateOrder({
|
requestCreateOrder({
|
||||||
posUuid,
|
posUuid,
|
||||||
customerUuid: this.currentOrder.businessPartner.uuid,
|
customerUuid: this.currentOrder.businessPartner.uuid,
|
||||||
salesRepresentativeUuid: this.currentPointOfSales.salesRepresentative.uuid
|
salesRepresentativeUuid: this.currentOrder.salesRepresentative.uuid
|
||||||
})
|
})
|
||||||
.then(order => {
|
.then(order => {
|
||||||
this.$store.dispatch('currentOrder', order)
|
this.$store.dispatch('currentOrder', order)
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
>
|
>
|
||||||
<el-form label-position="top" label-width="10px" @submit.native.prevent="notSubmitForm">
|
<el-form label-position="top" label-width="10px" @submit.native.prevent="notSubmitForm">
|
||||||
<el-row :gutter="24" style="display: flex;">
|
<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
|
<template
|
||||||
v-for="(field) in fieldsList"
|
v-for="(field) in fieldsList"
|
||||||
>
|
>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-col>
|
</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
|
<business-partner
|
||||||
:parent-metadata="{
|
:parent-metadata="{
|
||||||
name: panelMetadata.name,
|
name: panelMetadata.name,
|
||||||
@ -50,7 +50,10 @@
|
|||||||
:is-disabled="isDisabled"
|
:is-disabled="isDisabled"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</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
|
<el-tag
|
||||||
v-if="!isEmptyValue(currentOrder.documentStatus.value)"
|
v-if="!isEmptyValue(currentOrder.documentStatus.value)"
|
||||||
:type="tagStatus(currentOrder.documentStatus.value)"
|
:type="tagStatus(currentOrder.documentStatus.value)"
|
||||||
@ -60,12 +63,15 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-col>
|
</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">
|
<el-button type="primary" plain :disabled="isEmptyValue(this.$route.query.action)" @click="newOrder">
|
||||||
{{ $t('form.pos.optionsPoinSales.salesOrder.newOrder') }}
|
{{ $t('form.pos.optionsPoinSales.salesOrder.newOrder') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main style="background: white; padding: 0px; height: 100% !important; overflow: hidden">
|
<el-main style="background: white; padding: 0px; height: 100% !important; overflow: hidden">
|
||||||
|
@ -269,18 +269,17 @@ export default {
|
|||||||
if (this.isEmptyValue(orderUuid)) {
|
if (this.isEmptyValue(orderUuid)) {
|
||||||
const posUuid = this.currentPointOfSales.uuid
|
const posUuid = this.currentPointOfSales.uuid
|
||||||
let customerUuid = this.$store.getters.getValueOfField({
|
let customerUuid = this.$store.getters.getValueOfField({
|
||||||
containerUuid: this.containerUuid,
|
containerUuid: this.metadata.containerUuid,
|
||||||
columnName: 'C_BPartner_ID_UUID'
|
columnName: 'C_BPartner_ID_UUID'
|
||||||
})
|
})
|
||||||
const id = this.$store.getters.getValueOfField({
|
const id = this.$store.getters.getValueOfField({
|
||||||
containerUuid: this.containerUuid,
|
containerUuid: this.metadata.containerUuid,
|
||||||
columnName: 'C_BPartner_ID'
|
columnName: 'C_BPartner_ID'
|
||||||
})
|
})
|
||||||
if (this.isEmptyValue(customerUuid) || id === 1000006) {
|
if (this.isEmptyValue(customerUuid) || id === 1000006) {
|
||||||
customerUuid = this.currentPointOfSales.templateBusinessPartner.uuid
|
customerUuid = this.currentPointOfSales.templateBusinessPartner.uuid
|
||||||
}
|
}
|
||||||
// user session
|
// user session
|
||||||
// alert(name)
|
|
||||||
this.$store.dispatch('createOrder', {
|
this.$store.dispatch('createOrder', {
|
||||||
posUuid,
|
posUuid,
|
||||||
customerUuid,
|
customerUuid,
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
import {
|
import {
|
||||||
requestListOrderLines
|
requestListOrderLines
|
||||||
} from '@/api/ADempiere/form/point-of-sales.js'
|
} from '@/api/ADempiere/form/point-of-sales.js'
|
||||||
|
import { isEmptyValue } from '@/utils/ADempiere/valueUtils.js'
|
||||||
import { showMessage } from '@/utils/ADempiere/notification.js'
|
import { showMessage } from '@/utils/ADempiere/notification.js'
|
||||||
/**
|
/**
|
||||||
* Order Line Actions
|
* Order Line Actions
|
||||||
@ -26,6 +27,9 @@ export default {
|
|||||||
commit('setListOrderLine', params)
|
commit('setListOrderLine', params)
|
||||||
},
|
},
|
||||||
listOrderLinesFromServer({ commit }, orderUuid) {
|
listOrderLinesFromServer({ commit }, orderUuid) {
|
||||||
|
if (isEmptyValue(orderUuid)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
requestListOrderLines({
|
requestListOrderLines({
|
||||||
orderUuid
|
orderUuid
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user