mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 12:01:57 +08:00
Changing service of creating business partner by point of sale (#1083)
Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
parent
d33c257f6c
commit
0bffaa6699
@ -125,6 +125,128 @@ export function updateOrder({
|
|||||||
return convertOrder(updateOrderResponse)
|
return convertOrder(updateOrderResponse)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// Create Customer
|
||||||
|
export function createCustomer({
|
||||||
|
value,
|
||||||
|
taxId,
|
||||||
|
duns,
|
||||||
|
naics,
|
||||||
|
name,
|
||||||
|
name2,
|
||||||
|
description,
|
||||||
|
contactName,
|
||||||
|
eMail,
|
||||||
|
phone,
|
||||||
|
businessPartnerGroupUuid,
|
||||||
|
// Location
|
||||||
|
address1,
|
||||||
|
address2,
|
||||||
|
address3,
|
||||||
|
address4,
|
||||||
|
cityUuid,
|
||||||
|
cityName,
|
||||||
|
postalCode,
|
||||||
|
regionUuid,
|
||||||
|
regionName,
|
||||||
|
countryUuid,
|
||||||
|
posUuid
|
||||||
|
}) {
|
||||||
|
return request({
|
||||||
|
url: 'form/addons/point-of-sales/create-customer',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
value,
|
||||||
|
tax_id: taxId,
|
||||||
|
duns,
|
||||||
|
naics,
|
||||||
|
name,
|
||||||
|
last_name: name2,
|
||||||
|
description,
|
||||||
|
contact_name: contactName,
|
||||||
|
e_mail: eMail,
|
||||||
|
phone,
|
||||||
|
business_partner_group_uid: businessPartnerGroupUuid,
|
||||||
|
// Location
|
||||||
|
address1,
|
||||||
|
address2,
|
||||||
|
address3,
|
||||||
|
address4,
|
||||||
|
city_uuid: cityUuid,
|
||||||
|
city_name: cityName,
|
||||||
|
postal_code: postalCode,
|
||||||
|
region_uuid: regionUuid,
|
||||||
|
region_name: regionName,
|
||||||
|
country_uuid: countryUuid,
|
||||||
|
pos_uuid: posUuid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(businessPartnerResponse => {
|
||||||
|
const { convertBusinessPartner } = require('@/utils/ADempiere/apiConverts/core.js')
|
||||||
|
|
||||||
|
return convertBusinessPartner(businessPartnerResponse)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// Update Customer
|
||||||
|
export function updateCustomer({
|
||||||
|
value,
|
||||||
|
taxId,
|
||||||
|
duns,
|
||||||
|
naics,
|
||||||
|
name,
|
||||||
|
name2,
|
||||||
|
description,
|
||||||
|
contactName,
|
||||||
|
eMail,
|
||||||
|
phone,
|
||||||
|
businessPartnerGroupUuid,
|
||||||
|
// Location
|
||||||
|
address1,
|
||||||
|
address2,
|
||||||
|
address3,
|
||||||
|
address4,
|
||||||
|
cityUuid,
|
||||||
|
cityName,
|
||||||
|
postalCode,
|
||||||
|
regionUuid,
|
||||||
|
regionName,
|
||||||
|
countryUuid,
|
||||||
|
posUuid
|
||||||
|
}) {
|
||||||
|
return request({
|
||||||
|
url: 'form/addons/point-of-sales/update-customer',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
value,
|
||||||
|
tax_id: taxId,
|
||||||
|
duns,
|
||||||
|
naics,
|
||||||
|
name,
|
||||||
|
last_name: name2,
|
||||||
|
description,
|
||||||
|
contact_name: contactName,
|
||||||
|
e_mail: eMail,
|
||||||
|
phone,
|
||||||
|
business_partner_group_uid: businessPartnerGroupUuid,
|
||||||
|
// Location
|
||||||
|
address1,
|
||||||
|
address2,
|
||||||
|
address3,
|
||||||
|
address4,
|
||||||
|
city_uuid: cityUuid,
|
||||||
|
city_name: cityName,
|
||||||
|
postal_code: postalCode,
|
||||||
|
region_uuid: regionUuid,
|
||||||
|
region_name: regionName,
|
||||||
|
country_uuid: countryUuid,
|
||||||
|
pos_uuid: posUuid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(businessPartnerResponse => {
|
||||||
|
const { convertBusinessPartner } = require('@/utils/ADempiere/apiConverts/core.js')
|
||||||
|
|
||||||
|
return convertBusinessPartner(businessPartnerResponse)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Get order from uuid
|
// Get order from uuid
|
||||||
export function getOrder(orderUuid) {
|
export function getOrder(orderUuid) {
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { requestCreateBusinessPartner } from '@/api/ADempiere/system-core.js'
|
import { createCustomer } from '@/api/ADempiere/form/point-of-sales.js'
|
||||||
import formMixin from '@/components/ADempiere/Form/formMixin.js'
|
import formMixin from '@/components/ADempiere/Form/formMixin.js'
|
||||||
import fieldsList from './fieldsListCreate.js'
|
import fieldsList from './fieldsListCreate.js'
|
||||||
import BParterMixin from './mixinBusinessPartner.js'
|
import BParterMixin from './mixinBusinessPartner.js'
|
||||||
@ -125,7 +125,7 @@ export default {
|
|||||||
})
|
})
|
||||||
if (this.isEmptyValue(emptyMandatoryFields)) {
|
if (this.isEmptyValue(emptyMandatoryFields)) {
|
||||||
this.isLoadingRecord = true
|
this.isLoadingRecord = true
|
||||||
requestCreateBusinessPartner(values)
|
createCustomer(values)
|
||||||
.then(responseBPartner => {
|
.then(responseBPartner => {
|
||||||
// TODO: Add new record into vuex store.
|
// TODO: Add new record into vuex store.
|
||||||
this.setBusinessPartner(responseBPartner)
|
this.setBusinessPartner(responseBPartner)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user