mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 12:01:57 +08:00
Add support to list document type service (#986)
This commit is contained in:
parent
cba978916b
commit
80b9e9e95b
@ -643,10 +643,10 @@ export function validatePin({
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* list Warehouse
|
* list Warehouses
|
||||||
* @param {string} posUuidd - POS UUID reference
|
* @param {string} posUuidd - POS UUID reference
|
||||||
*/
|
*/
|
||||||
export function listWarehouse({
|
export function listWarehouses({
|
||||||
posUuid
|
posUuid
|
||||||
}) {
|
}) {
|
||||||
return request({
|
return request({
|
||||||
@ -661,6 +661,25 @@ export function listWarehouse({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* list Document Types
|
||||||
|
* @param {string} posUuidd - POS UUID reference
|
||||||
|
*/
|
||||||
|
export function listDocumentTypes({
|
||||||
|
posUuid
|
||||||
|
}) {
|
||||||
|
return request({
|
||||||
|
url: `${config.pointOfSales.endpoint}/available-document-types`,
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
pos_uuid: posUuid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
return response
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List Prices
|
* List Prices
|
||||||
* @param {string} posUuidd - POS UUID reference
|
* @param {string} posUuidd - POS UUID reference
|
||||||
|
@ -27,86 +27,5 @@ export default [
|
|||||||
handleActionPerformed: true,
|
handleActionPerformed: true,
|
||||||
handleActionKeyPerformed: true
|
handleActionKeyPerformed: true
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
elementColumnName: 'C_DocType_ID',
|
|
||||||
tabindex: '2',
|
|
||||||
isFromDictionary: true,
|
|
||||||
overwriteDefinition: {
|
|
||||||
size: 24,
|
|
||||||
handleActionPerformed: true,
|
|
||||||
handleContentSelection: true,
|
|
||||||
handleActionKeyPerformed: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
elementColumnName: 'C_DocTypeTarget_ID',
|
|
||||||
tabindex: '2',
|
|
||||||
isFromDictionary: true,
|
|
||||||
overwriteDefinition: {
|
|
||||||
size: 24,
|
|
||||||
handleFocusGained: true,
|
|
||||||
handleActionPerformed: true,
|
|
||||||
handleContentSelection: true,
|
|
||||||
handleActionKeyPerformed: true,
|
|
||||||
isReadOnly: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// {
|
|
||||||
// elementColumnName: 'PriceEntered',
|
|
||||||
// columnName: 'PriceEntered',
|
|
||||||
// tabindex: '3',
|
|
||||||
// isFromDictionary: true,
|
|
||||||
// overwriteDefinition: {
|
|
||||||
// size: 24,
|
|
||||||
// sequence: 9,
|
|
||||||
// isReadOnly: true,
|
|
||||||
// handleActionPerformed: true,
|
|
||||||
// handleContentSelection: true,
|
|
||||||
// handleActionKeyPerformed: true
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// elementColumnName: 'Discount',
|
|
||||||
// columnName: 'Discount',
|
|
||||||
// tabindex: '4',
|
|
||||||
// isFromDictionary: true,
|
|
||||||
// overwriteDefinition: {
|
|
||||||
// size: 24,
|
|
||||||
// sequence: 10,
|
|
||||||
// isReadOnly: true,
|
|
||||||
// handleActionPerformed: true,
|
|
||||||
// handleContentSelection: true,
|
|
||||||
// handleActionKeyPerformed: true
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// tableName: 'C_Order',
|
|
||||||
// columnName: 'C_Currency_ID',
|
|
||||||
// isFromDictionary: true,
|
|
||||||
// overwriteDefinition: {
|
|
||||||
// size: 24,
|
|
||||||
// handleActionKeyPerformed: true,
|
|
||||||
// handleActionPerformed: true,
|
|
||||||
// validationCode: 'C_Currency.C_Currency_ID = 100',
|
|
||||||
// isActiveLogics: false,
|
|
||||||
// isMandatory: true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // TenderType
|
|
||||||
// {
|
|
||||||
// tableName: 'C_Payment',
|
|
||||||
// elementColumnName: 'TenderType',
|
|
||||||
// columnName: 'TenderType',
|
|
||||||
// isFromDictionary: true,
|
|
||||||
// overwriteDefinition: {
|
|
||||||
// defaultValue: 'X',
|
|
||||||
// handleActionKeyPerformed: true,
|
|
||||||
// handleContentSelection: true,
|
|
||||||
// handleActionPerformed: true,
|
|
||||||
// size: 24,
|
|
||||||
// isActiveLogics: false,
|
|
||||||
// isMandatory: true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
]
|
]
|
||||||
|
@ -54,11 +54,28 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="5" :style="styleTab">
|
<el-col :span="5" :style="styleTab">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<field
|
<br>
|
||||||
:key="fieldsList[2].columnName"
|
<el-dropdown
|
||||||
:metadata-field="fieldsList[2]"
|
v-if="!isEmptyValue(currentWarehouse)"
|
||||||
:v-model="fieldsList[2].value"
|
trigger="click"
|
||||||
/>
|
class="info-pos"
|
||||||
|
@command="changeDocumentType"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
<svg-icon icon-class="tree" />
|
||||||
|
<b style="cursor: pointer"> {{ currentDocumentType.name }} </b>
|
||||||
|
</span>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item
|
||||||
|
v-for="item in listDocumentTypes"
|
||||||
|
:key="item.uuid"
|
||||||
|
:command="item"
|
||||||
|
>
|
||||||
|
{{ item.name }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
<br>
|
||||||
</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) ? 1 : 4" :style="isShowedPOSKeyLayout ? 'padding: 0px; margin-top: 3.%;' : 'padding: 0px; margin-top: 2.4%;'">
|
||||||
@ -262,7 +279,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
v-for="item in listWarehouse"
|
v-for="item in listWarehouses"
|
||||||
:key="item.uuid"
|
:key="item.uuid"
|
||||||
:command="item"
|
:command="item"
|
||||||
>
|
>
|
||||||
@ -573,7 +590,6 @@ export default {
|
|||||||
currentOrder() {
|
currentOrder() {
|
||||||
if (this.isEmptyValue(this.currentPointOfSales)) {
|
if (this.isEmptyValue(this.currentPointOfSales)) {
|
||||||
return {
|
return {
|
||||||
documentType: {},
|
|
||||||
documentStatus: {
|
documentStatus: {
|
||||||
value: ''
|
value: ''
|
||||||
},
|
},
|
||||||
@ -619,15 +635,27 @@ export default {
|
|||||||
},
|
},
|
||||||
currentWarehouse() {
|
currentWarehouse() {
|
||||||
if (!this.isEmptyValue(this.$store.getters.posAttributes.currentPointOfSales.warehouse)) {
|
if (!this.isEmptyValue(this.$store.getters.posAttributes.currentPointOfSales.warehouse)) {
|
||||||
return this.$store.getters.getcurrentWarehousePos
|
return this.$store.getters.getCurrentWarehousePos
|
||||||
}
|
}
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
listWarehouse() {
|
currentDocumentType() {
|
||||||
|
if (!this.isEmptyValue(this.$store.getters.posAttributes.currentPointOfSales.documentType)) {
|
||||||
|
return this.$store.getters.getCurrentDocumentTypePos
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
listWarehouses() {
|
||||||
if (!this.isEmptyValue(this.$store.getters.posAttributes.currentPointOfSales.warehousesList)) {
|
if (!this.isEmptyValue(this.$store.getters.posAttributes.currentPointOfSales.warehousesList)) {
|
||||||
return this.$store.getters.posAttributes.currentPointOfSales.warehousesList
|
return this.$store.getters.posAttributes.currentPointOfSales.warehousesList
|
||||||
}
|
}
|
||||||
return []
|
return []
|
||||||
|
},
|
||||||
|
listDocumentTypes() {
|
||||||
|
if (!this.isEmptyValue(this.$store.getters.posAttributes.currentPointOfSales.documentTypesList)) {
|
||||||
|
return this.$store.getters.posAttributes.currentPointOfSales.documentTypesList
|
||||||
|
}
|
||||||
|
return []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -768,6 +796,14 @@ export default {
|
|||||||
}
|
}
|
||||||
this.visible = true
|
this.visible = true
|
||||||
},
|
},
|
||||||
|
changeDocumentType(documentType) {
|
||||||
|
this.attributePin = {
|
||||||
|
...documentType,
|
||||||
|
action: 'changeDocumentType',
|
||||||
|
type: 'actionPos'
|
||||||
|
}
|
||||||
|
this.visible = true
|
||||||
|
},
|
||||||
changePriceList(priceList) {
|
changePriceList(priceList) {
|
||||||
this.attributePin = {
|
this.attributePin = {
|
||||||
...priceList,
|
...priceList,
|
||||||
|
@ -245,6 +245,9 @@ export default {
|
|||||||
case 'changeWarehouse':
|
case 'changeWarehouse':
|
||||||
this.$store.commit('setCurrentWarehousePos', action)
|
this.$store.commit('setCurrentWarehousePos', action)
|
||||||
break
|
break
|
||||||
|
case 'changeDocumentType':
|
||||||
|
this.$store.commit('setCurrentDocumentTypePos', action)
|
||||||
|
break
|
||||||
case 'changePriceList':
|
case 'changePriceList':
|
||||||
this.$store.commit('setCurrentPriceList', action)
|
this.$store.commit('setCurrentPriceList', action)
|
||||||
break
|
break
|
||||||
|
@ -55,6 +55,7 @@ export default {
|
|||||||
...state.currentPointOfSales,
|
...state.currentPointOfSales,
|
||||||
listOrder: state.listOrder,
|
listOrder: state.listOrder,
|
||||||
warehousesList: state.warehousesList,
|
warehousesList: state.warehousesList,
|
||||||
|
documentTypesList: state.documentTypesList,
|
||||||
pricesList: state.pricesList,
|
pricesList: state.pricesList,
|
||||||
currentPriceList: state.currentPriceList,
|
currentPriceList: state.currentPriceList,
|
||||||
currentOrder: {
|
currentOrder: {
|
||||||
@ -124,11 +125,21 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* Current Warehouse
|
* Current Warehouse
|
||||||
*/
|
*/
|
||||||
getcurrentWarehousePos: (state) => {
|
getCurrentWarehousePos: (state) => {
|
||||||
if (!isEmptyValue(state.currentWarehousePos)) {
|
if (!isEmptyValue(state.currentWarehousePos)) {
|
||||||
return state.currentWarehousePos
|
return state.currentWarehousePos
|
||||||
}
|
}
|
||||||
return {}
|
return {}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Current Document Type
|
||||||
|
*/
|
||||||
|
getCurrentDocumentTypePos: (state) => {
|
||||||
|
if (!isEmptyValue(state.currentDocumentTypePos)) {
|
||||||
|
return state.currentDocumentTypePos
|
||||||
|
}
|
||||||
|
return {}
|
||||||
}
|
}
|
||||||
// Current POS, it can be s
|
// Current POS, it can be s
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,8 @@
|
|||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import {
|
import {
|
||||||
listPointOfSales,
|
listPointOfSales,
|
||||||
listWarehouse,
|
listWarehouses,
|
||||||
|
listDocumentTypes,
|
||||||
listPrices,
|
listPrices,
|
||||||
listCurrencies
|
listCurrencies
|
||||||
} from '@/api/ADempiere/form/point-of-sales.js'
|
} from '@/api/ADempiere/form/point-of-sales.js'
|
||||||
@ -61,15 +62,31 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
listWarehouseFromServer({ commit }, posUuid) {
|
listWarehousesFromServer({ commit }, posUuid) {
|
||||||
listWarehouse({
|
listWarehouses({
|
||||||
posUuid
|
posUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
commit('setWarehousesList', response.records)
|
commit('setWarehousesList', response.records)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.warn(`listWarehouseFromServer: ${error.message}. Code: ${error.code}.`)
|
console.warn(`listWarehousesFromServer: ${error.message}. Code: ${error.code}.`)
|
||||||
|
showMessage({
|
||||||
|
type: 'error',
|
||||||
|
message: error.message,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
listDocumentTypesFromServer({ commit }, posUuid) {
|
||||||
|
listDocumentTypes({
|
||||||
|
posUuid
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
commit('setDocumentTypesList', response.records)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.warn(`listDocumentTypesFromServer: ${error.message}. Code: ${error.code}.`)
|
||||||
showMessage({
|
showMessage({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: error.message,
|
message: error.message,
|
||||||
@ -123,10 +140,12 @@ export default {
|
|||||||
}
|
}
|
||||||
}, () => {})
|
}, () => {})
|
||||||
state.currenciesList = []
|
state.currenciesList = []
|
||||||
dispatch('listWarehouseFromServer', posToSet.uuid)
|
dispatch('listWarehousesFromServer', posToSet.uuid)
|
||||||
|
dispatch('listDocumentTypesFromServer', posToSet.uuid)
|
||||||
dispatch('listCurrenciesFromServer', posToSet.uuid)
|
dispatch('listCurrenciesFromServer', posToSet.uuid)
|
||||||
dispatch('listPricesFromServer', posToSet)
|
dispatch('listPricesFromServer', posToSet)
|
||||||
commit('setCurrentPriceList', posToSet.priceList)
|
commit('setCurrentPriceList', posToSet.priceList)
|
||||||
|
commit('setCurrentDocumentTypePos', posToSet.documentType)
|
||||||
commit('setCurrentWarehousePos', rootGetters['user/getWarehouse'])
|
commit('setCurrentWarehousePos', rootGetters['user/getWarehouse'])
|
||||||
commit('resetConversionRate', [])
|
commit('resetConversionRate', [])
|
||||||
commit('setIsReloadKeyLayout')
|
commit('setIsReloadKeyLayout')
|
||||||
|
@ -25,12 +25,18 @@ export default {
|
|||||||
setWarehousesList(state, warehousesList) {
|
setWarehousesList(state, warehousesList) {
|
||||||
state.warehousesList = warehousesList
|
state.warehousesList = warehousesList
|
||||||
},
|
},
|
||||||
|
setDocumentTypesList(state, documentTypesList) {
|
||||||
|
state.documentTypesList = documentTypesList
|
||||||
|
},
|
||||||
setCurrentPriceList(state, currentPriceList) {
|
setCurrentPriceList(state, currentPriceList) {
|
||||||
state.currentPriceList = currentPriceList
|
state.currentPriceList = currentPriceList
|
||||||
},
|
},
|
||||||
setCurrentWarehousePos(state, warehouse) {
|
setCurrentWarehousePos(state, warehouse) {
|
||||||
state.currentWarehousePos = warehouse
|
state.currentWarehousePos = warehouse
|
||||||
},
|
},
|
||||||
|
setCurrentDocumentTypePos(state, documentType) {
|
||||||
|
state.currentDocumentTypePos = documentType
|
||||||
|
},
|
||||||
setPricesList(state, pricesList) {
|
setPricesList(state, pricesList) {
|
||||||
state.pricesList = pricesList
|
state.pricesList = pricesList
|
||||||
},
|
},
|
||||||
|
@ -29,9 +29,11 @@ export default {
|
|||||||
},
|
},
|
||||||
pointOfSalesList: {},
|
pointOfSalesList: {},
|
||||||
warehousesList: {},
|
warehousesList: {},
|
||||||
|
documentTypesList: {},
|
||||||
pricesList: {},
|
pricesList: {},
|
||||||
currentPriceList: {},
|
currentPriceList: {},
|
||||||
currentWarehousePos: {},
|
currentWarehousePos: {},
|
||||||
|
currentDocumentTypePos: {},
|
||||||
listCurrency: [],
|
listCurrency: [],
|
||||||
conversionsList: [],
|
conversionsList: [],
|
||||||
currentPointOfSales: {},
|
currentPointOfSales: {},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user