Skip to content

The open source simple and complete warehouse management system is derived from our many years of experience in implementing erp projects. We stripped the original commercial system wms function and opened it up for free, hoping to help the majority of small and medium-sized enterprises. At present, the system supports cross-platform。

fix(Global): Fix file case

liufu3a222ab55d74
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index d0b4801..baa93a2 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -1,83 +1,83 @@
-<template>
- <div class="appViewContainer">
- <v-dialog v-model="loadingFlag" :scrim="false" persistent max-width="200">
- <v-card color="primary">
- <v-card-text>
- Loading...
- <v-progress-linear indeterminate color="white"></v-progress-linear>
- </v-card-text>
- </v-card>
- </v-dialog>
- <div v-show="loadingFlag" class="mask"></div>
- <router-view v-if="data.isShow"></router-view>
- </div>
-</template>
-
-<script setup lang="ts">
-import { reactive, nextTick, onMounted, ref, computed, watch } from 'vue'
-import { emitter } from './utils/bus'
-import { store } from './store'
-
-const loadingFlag = ref(false)
-
-const data = reactive({
- isShow: true // Used to refresh the interface when switching languages
-})
-
-const method = reactive({
- refreshSystem: () => {
- data.isShow = false
- nextTick(() => {
- data.isShow = true
- store.commit('system/setRefreshFlag', false)
- })
- },
- getClientSize: () => {
- const clientHeight = document.documentElement.clientHeight
- const clientWidth = document.documentElement.clientWidth
- store.commit('system/setClientHeight', clientHeight)
- store.commit('system/setClientWidth', clientWidth)
- }
-})
-
-const refreshFlag = computed(() => store.getters['system/refreshFlag'])
-
-watch(
- () => refreshFlag.value,
- (flag) => {
- if (flag) {
- method.refreshSystem()
- }
- }
-)
-
-onMounted(() => {
- emitter.on('showLoading', () => {
- loadingFlag.value = true
- })
- emitter.on('closeLoading', () => {
- loadingFlag.value = false
- })
-
- method.getClientSize()
-
- window.onresize = function () {
- method.getClientSize()
- }
-})
-</script>
-
-<style scoped>
-.appViewContainer {
- height: 100%;
- width: 100%;
- background-color: #f4f5fa;
-}
-
-.mask {
- position: absolute;
- z-index: 9999;
- width: 100vw;
- height: 100vh;
-}
-</style>
+<template>
+ <div class="appViewContainer">
+ <v-dialog v-model="loadingFlag" :scrim="false" persistent max-width="200">
+ <v-card color="primary">
+ <v-card-text>
+ Loading...
+ <v-progress-linear indeterminate color="white"></v-progress-linear>
+ </v-card-text>
+ </v-card>
+ </v-dialog>
+ <div v-show="loadingFlag" class="mask"></div>
+ <router-view v-if="data.isShow"></router-view>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { reactive, nextTick, onMounted, ref, computed, watch } from 'vue'
+import { emitter } from './utils/bus'
+import { store } from './store'
+
+const loadingFlag = ref(false)
+
+const data = reactive({
+ isShow: true // Used to refresh the interface when switching languages
+})
+
+const method = reactive({
+ refreshSystem: () => {
+ data.isShow = false
+ nextTick(() => {
+ data.isShow = true
+ store.commit('system/setRefreshFlag', false)
+ })
+ },
+ getClientSize: () => {
+ const clientHeight = document.documentElement.clientHeight
+ const clientWidth = document.documentElement.clientWidth
+ store.commit('system/setClientHeight', clientHeight)
+ store.commit('system/setClientWidth', clientWidth)
+ }
+})
+
+const refreshFlag = computed(() => store.getters['system/refreshFlag'])
+
+watch(
+ () => refreshFlag.value,
+ (flag) => {
+ if (flag) {
+ method.refreshSystem()
+ }
+ }
+)
+
+onMounted(() => {
+ emitter.on('showLoading', () => {
+ loadingFlag.value = true
+ })
+ emitter.on('closeLoading', () => {
+ loadingFlag.value = false
+ })
+
+ method.getClientSize()
+
+ window.onresize = function () {
+ method.getClientSize()
+ }
+})
+</script>
+
+<style scoped>
+.appViewContainer {
+ height: 100%;
+ width: 100%;
+ background-color: #f4f5fa;
+}
+
+.mask {
+ position: absolute;
+ z-index: 9999;
+ width: 100vw;
+ height: 100vh;
+}
+</style>
diff --git a/frontend/src/api/base/commodityCategorySetting.ts b/frontend/src/api/base/commodityCategorySetting.ts
index 0fa6cd9..e7e46ca 100644
--- a/frontend/src/api/base/commodityCategorySetting.ts
+++ b/frontend/src/api/base/commodityCategorySetting.ts
@@ -1,31 +1,31 @@
-import http from '@/utils/http/request'
-import { CategoryVO } from '@/types/Base/CommodityCategorySetting'
-
-// Get all
-export const getCategoryAll = () => http({
- url: '/category/all',
- method: 'get'
- })
-
-// Add a new form
-export const addCategory = (data: CategoryVO) => http({
- url: '/category',
- method: 'post',
- data
- })
-
-// Update form
-export const updateCategory = (data: CategoryVO) => http({
- url: '/category',
- method: 'put',
- data
- })
-
-// Delete form
-export const deleteCategory = (id: number) => http({
- url: '/category',
- method: 'delete',
- params: {
- id
- }
- })
+import http from '@/utils/http/request'
+import { CategoryVO } from '@/types/Base/CommodityCategorySetting'
+
+// Get all
+export const getCategoryAll = () => http({
+ url: '/category/all',
+ method: 'get'
+ })
+
+// Add a new form
+export const addCategory = (data: CategoryVO) => http({
+ url: '/category',
+ method: 'post',
+ data
+ })
+
+// Update form
+export const updateCategory = (data: CategoryVO) => http({
+ url: '/category',
+ method: 'put',
+ data
+ })
+
+// Delete form
+export const deleteCategory = (id: number) => http({
+ url: '/category',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
diff --git a/frontend/src/api/base/commodityManagementSetting.ts b/frontend/src/api/base/commodityManagementSetting.ts
index 2a3bc2b..a05533b 100644
--- a/frontend/src/api/base/commodityManagementSetting.ts
+++ b/frontend/src/api/base/commodityManagementSetting.ts
@@ -1,33 +1,33 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { CommodityVO } from '@/types/Base/CommodityManagement'
-
-// Find Data by Pagination
-export const getSpuList = (data: PageConfigProps) => http({
- url: '/spu/list',
- method: 'post',
- data
-})
-
-// Add a new form
-export const addSpu = (data: CommodityVO) => http({
- url: '/spu',
- method: 'post',
- data
- })
-
-// Update form
-export const updateSpu = (data: CommodityVO) => http({
- url: '/spu',
- method: 'put',
- data
- })
-
-// Delete form
-export const deleteSpu = (id: number) => http({
- url: '/spu',
- method: 'delete',
- params: {
- id
- }
- })
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { CommodityVO } from '@/types/Base/CommodityManagement'
+
+// Find Data by Pagination
+export const getSpuList = (data: PageConfigProps) => http({
+ url: '/spu/list',
+ method: 'post',
+ data
+})
+
+// Add a new form
+export const addSpu = (data: CommodityVO) => http({
+ url: '/spu',
+ method: 'post',
+ data
+ })
+
+// Update form
+export const updateSpu = (data: CommodityVO) => http({
+ url: '/spu',
+ method: 'put',
+ data
+ })
+
+// Delete form
+export const deleteSpu = (id: number) => http({
+ url: '/spu',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
diff --git a/frontend/src/api/base/companySetting.ts b/frontend/src/api/base/companySetting.ts
index 9bc8a3b..86eda96 100644
--- a/frontend/src/api/base/companySetting.ts
+++ b/frontend/src/api/base/companySetting.ts
@@ -1,31 +1,31 @@
-import http from '@/utils/http/request'
-import { CompanyVO } from '@/types/Base/CompanySetting'
-
-// Get all
-export const getCompanyAll = () => http({
- url: '/company/all',
- method: 'get'
- })
-
-// Add a new form
-export const addCompany = (data: CompanyVO) => http({
- url: '/company',
- method: 'post',
- data
- })
-
-// Update form
-export const updateCompany = (data: CompanyVO) => http({
- url: '/company',
- method: 'put',
- data
- })
-
-// Delete form
-export const deleteCompany = (id: number) => http({
- url: '/company',
- method: 'delete',
- params: {
- id
- }
- })
+import http from '@/utils/http/request'
+import { CompanyVO } from '@/types/Base/CompanySetting'
+
+// Get all
+export const getCompanyAll = () => http({
+ url: '/company/all',
+ method: 'get'
+ })
+
+// Add a new form
+export const addCompany = (data: CompanyVO) => http({
+ url: '/company',
+ method: 'post',
+ data
+ })
+
+// Update form
+export const updateCompany = (data: CompanyVO) => http({
+ url: '/company',
+ method: 'put',
+ data
+ })
+
+// Delete form
+export const deleteCompany = (id: number) => http({
+ url: '/company',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
diff --git a/frontend/src/api/base/customer.ts b/frontend/src/api/base/customer.ts
index 1efaa15..44faf47 100644
--- a/frontend/src/api/base/customer.ts
+++ b/frontend/src/api/base/customer.ts
@@ -1,46 +1,46 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { CustomerVO, CustomerExcelVO } from '@/types/Base/Customer'
-
-// Get all
-export const getCustomerAll = () => http({
- url: '/customer/all',
- method: 'get'
- })
-
-// Find Data by Pagination
-export const getCustomerList = (data: PageConfigProps) => http({
- url: '/customer/list',
- method: 'post',
- data
- })
-
-// Add a new form
-export const addCustomer = (data: CustomerVO) => http({
- url: '/customer',
- method: 'post',
- data
- })
-
-// Update form
-export const updateCustomer = (data: CustomerVO) => http({
- url: '/customer',
- method: 'put',
- data
- })
-
-// Delete form
-export const deleteCustomer = (id: number) => http({
- url: '/customer',
- method: 'delete',
- params: {
- id
- }
- })
-
-// Excel Import
-export const excelImport = (data: Array<CustomerExcelVO>) => http({
- url: '/customer/excel',
- method: 'post',
- data
- })
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { CustomerVO, CustomerExcelVO } from '@/types/Base/Customer'
+
+// Get all
+export const getCustomerAll = () => http({
+ url: '/customer/all',
+ method: 'get'
+ })
+
+// Find Data by Pagination
+export const getCustomerList = (data: PageConfigProps) => http({
+ url: '/customer/list',
+ method: 'post',
+ data
+ })
+
+// Add a new form
+export const addCustomer = (data: CustomerVO) => http({
+ url: '/customer',
+ method: 'post',
+ data
+ })
+
+// Update form
+export const updateCustomer = (data: CustomerVO) => http({
+ url: '/customer',
+ method: 'put',
+ data
+ })
+
+// Delete form
+export const deleteCustomer = (id: number) => http({
+ url: '/customer',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
+
+// Excel Import
+export const excelImport = (data: Array<CustomerExcelVO>) => http({
+ url: '/customer/excel',
+ method: 'post',
+ data
+ })
diff --git a/frontend/src/api/base/freightSetting.ts b/frontend/src/api/base/freightSetting.ts
index 1ec7af9..7f5bb6a 100644
--- a/frontend/src/api/base/freightSetting.ts
+++ b/frontend/src/api/base/freightSetting.ts
@@ -1,47 +1,47 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { FreightVO } from '@/types/Base/Freight'
-
-// Find Data by Pagination
-export const getFreightList = (data: PageConfigProps) => http({
- url: '/freightfee/list',
- method: 'post',
- data
- })
-
-// get data all
-export const getFreightAll = () => http({
- url: '/freightfee/all',
- method: 'get',
- hideLoading: true
- })
-
-// Add a new freightfee
-export const addFreight = (data: FreightVO) => http({
- url: '/freightfee',
- method: 'post',
- data
- })
-
-// Update freightfee
-export const updateFreight = (data: FreightVO) => http({
- url: '/freightfee',
- method: 'put',
- data
- })
-
-// Delete freightfee
-export const deleteFreight = (id: number) => http({
- url: '/freightfee',
- method: 'delete',
- params: {
- id
- }
- })
-
-// Excel Import
-export const excelImport = (data: Array<FreightVO>) => http({
- url: '/freightfee/excel',
- method: 'post',
- data
- })
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { FreightVO } from '@/types/Base/Freight'
+
+// Find Data by Pagination
+export const getFreightList = (data: PageConfigProps) => http({
+ url: '/freightfee/list',
+ method: 'post',
+ data
+ })
+
+// get data all
+export const getFreightAll = () => http({
+ url: '/freightfee/all',
+ method: 'get',
+ hideLoading: true
+ })
+
+// Add a new freightfee
+export const addFreight = (data: FreightVO) => http({
+ url: '/freightfee',
+ method: 'post',
+ data
+ })
+
+// Update freightfee
+export const updateFreight = (data: FreightVO) => http({
+ url: '/freightfee',
+ method: 'put',
+ data
+ })
+
+// Delete freightfee
+export const deleteFreight = (id: number) => http({
+ url: '/freightfee',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
+
+// Excel Import
+export const excelImport = (data: Array<FreightVO>) => http({
+ url: '/freightfee/excel',
+ method: 'post',
+ data
+ })
diff --git a/frontend/src/api/base/ownerOfCargo.ts b/frontend/src/api/base/ownerOfCargo.ts
index 2cd19ba..7d51208 100644
--- a/frontend/src/api/base/ownerOfCargo.ts
+++ b/frontend/src/api/base/ownerOfCargo.ts
@@ -1,46 +1,46 @@
-import http from '@/utils/http/request'
-import { OwnerOfCargoVO } from '@/types/Base/OwnerOfCargo'
-import { PageConfigProps } from '@/types/System/Form'
-
-// Get all
-export const getOwnerOfCargoAll = () => http({
- url: '/goodsowner/all',
- method: 'get'
- })
-
-// Get data by page
-export const getOwnerOfCargoByPage = (data: PageConfigProps) => http({
- url: '/goodsowner/list',
- method: 'post',
- data
- })
-
-// Add a new form
-export const addOwnerOfCargo = (data: OwnerOfCargoVO) => http({
- url: '/goodsowner',
- method: 'post',
- data
- })
-
-// Update form
-export const updateOwnerOfCargo = (data: OwnerOfCargoVO) => http({
- url: '/goodsowner',
- method: 'put',
- data
- })
-
-// Delete form
-export const deleteOwnerOfCargo = (id: number) => http({
- url: '/goodsowner',
- method: 'delete',
- params: {
- id
- }
- })
-
-// import form
-export const excelImport = (data: OwnerOfCargoVO[]) => http({
- url: '/goodsowner/excel',
- method: 'post',
- data
- })
+import http from '@/utils/http/request'
+import { OwnerOfCargoVO } from '@/types/Base/OwnerOfCargo'
+import { PageConfigProps } from '@/types/System/Form'
+
+// Get all
+export const getOwnerOfCargoAll = () => http({
+ url: '/goodsowner/all',
+ method: 'get'
+ })
+
+// Get data by page
+export const getOwnerOfCargoByPage = (data: PageConfigProps) => http({
+ url: '/goodsowner/list',
+ method: 'post',
+ data
+ })
+
+// Add a new form
+export const addOwnerOfCargo = (data: OwnerOfCargoVO) => http({
+ url: '/goodsowner',
+ method: 'post',
+ data
+ })
+
+// Update form
+export const updateOwnerOfCargo = (data: OwnerOfCargoVO) => http({
+ url: '/goodsowner',
+ method: 'put',
+ data
+ })
+
+// Delete form
+export const deleteOwnerOfCargo = (id: number) => http({
+ url: '/goodsowner',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
+
+// import form
+export const excelImport = (data: OwnerOfCargoVO[]) => http({
+ url: '/goodsowner/excel',
+ method: 'post',
+ data
+ })
diff --git a/frontend/src/api/base/roleMenu.ts b/frontend/src/api/base/roleMenu.ts
index 90d9852..126686f 100644
--- a/frontend/src/api/base/roleMenu.ts
+++ b/frontend/src/api/base/roleMenu.ts
@@ -1,55 +1,55 @@
-import http from '@/utils/http/request'
-import { RoleMenuVO } from '@/types/Base/RoleMenu'
-
-// Get user authority
-export const getUserAuthority = (userrole_id: number) => http({
- url: '/rolemenu/authority',
- method: 'get',
- params: {
- userrole_id
- }
- })
-
-// Get all
-export const getRoleMenuAll = () => http({
- url: '/rolemenu/all',
- method: 'get'
- })
-
-// Get all menu setting
-export const getMenus = () => http({
- url: '/rolemenu/menus',
- method: 'get'
- })
-
-// Get form by id
-export const getRoleMenuById = (userrole_id: number) => http({
- url: '/rolemenu',
- method: 'get',
- params: {
- userrole_id
- }
- })
-
-// Get form by id
-export const addRoleMenu = (data: RoleMenuVO) => http({
- url: '/rolemenu',
- method: 'post',
- data
- })
-
-// Update form
-export const updateRoleMenu = (data: RoleMenuVO) => http({
- url: '/rolemenu',
- method: 'put',
- data
- })
-
-// Delete form
-export const deleteRoleMenu = (userrole_id: number) => http({
- url: '/rolemenu',
- method: 'delete',
- params: {
- userrole_id
- }
- })
+import http from '@/utils/http/request'
+import { RoleMenuVO } from '@/types/Base/RoleMenu'
+
+// Get user authority
+export const getUserAuthority = (userrole_id: number) => http({
+ url: '/rolemenu/authority',
+ method: 'get',
+ params: {
+ userrole_id
+ }
+ })
+
+// Get all
+export const getRoleMenuAll = () => http({
+ url: '/rolemenu/all',
+ method: 'get'
+ })
+
+// Get all menu setting
+export const getMenus = () => http({
+ url: '/rolemenu/menus',
+ method: 'get'
+ })
+
+// Get form by id
+export const getRoleMenuById = (userrole_id: number) => http({
+ url: '/rolemenu',
+ method: 'get',
+ params: {
+ userrole_id
+ }
+ })
+
+// Get form by id
+export const addRoleMenu = (data: RoleMenuVO) => http({
+ url: '/rolemenu',
+ method: 'post',
+ data
+ })
+
+// Update form
+export const updateRoleMenu = (data: RoleMenuVO) => http({
+ url: '/rolemenu',
+ method: 'put',
+ data
+ })
+
+// Delete form
+export const deleteRoleMenu = (userrole_id: number) => http({
+ url: '/rolemenu',
+ method: 'delete',
+ params: {
+ userrole_id
+ }
+ })
diff --git a/frontend/src/api/base/supplier.ts b/frontend/src/api/base/supplier.ts
index a3a03d8..1174f85 100644
--- a/frontend/src/api/base/supplier.ts
+++ b/frontend/src/api/base/supplier.ts
@@ -1,46 +1,46 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { SupplierVO, SupplierExcelVO } from '@/types/Base/Supplier'
-
-// Get all
-export const getSupplierAll = () => http({
- url: '/supplier/all',
- method: 'get'
- })
-
-// Find Data by Pagination
-export const getSupplierList = (data: PageConfigProps) => http({
- url: '/supplier/list',
- method: 'post',
- data
- })
-
-// Add a new form
-export const addSupplier = (data: SupplierVO) => http({
- url: '/supplier',
- method: 'post',
- data
- })
-
-// Update form
-export const updateSupplier = (data: SupplierVO) => http({
- url: '/supplier',
- method: 'put',
- data
- })
-
-// Delete form
-export const deleteSupplier = (id: number) => http({
- url: '/supplier',
- method: 'delete',
- params: {
- id
- }
- })
-
-// Excel Import
-export const excelImport = (data: Array<SupplierExcelVO>) => http({
- url: '/supplier/excel',
- method: 'post',
- data
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { SupplierVO, SupplierExcelVO } from '@/types/Base/Supplier'
+
+// Get all
+export const getSupplierAll = () => http({
+ url: '/supplier/all',
+ method: 'get'
+ })
+
+// Find Data by Pagination
+export const getSupplierList = (data: PageConfigProps) => http({
+ url: '/supplier/list',
+ method: 'post',
+ data
+ })
+
+// Add a new form
+export const addSupplier = (data: SupplierVO) => http({
+ url: '/supplier',
+ method: 'post',
+ data
+ })
+
+// Update form
+export const updateSupplier = (data: SupplierVO) => http({
+ url: '/supplier',
+ method: 'put',
+ data
+ })
+
+// Delete form
+export const deleteSupplier = (id: number) => http({
+ url: '/supplier',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
+
+// Excel Import
+export const excelImport = (data: Array<SupplierExcelVO>) => http({
+ url: '/supplier/excel',
+ method: 'post',
+ data
})
\ No newline at end of file
diff --git a/frontend/src/api/base/userManagement.ts b/frontend/src/api/base/userManagement.ts
index 156078c..3f1b6e7 100644
--- a/frontend/src/api/base/userManagement.ts
+++ b/frontend/src/api/base/userManagement.ts
@@ -1,69 +1,69 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { UserVO, ChangePwdAPIParams, ImportVO } from '@/types/Base/UserManagement'
-
-// Find Data by Pagination
-export const getSelectItem = () => http({
- url: '/user/select-item',
- method: 'get'
- })
-
-// Find Data by Pagination
-export const getUserList = (data: PageConfigProps) => http({
- url: '/user/list',
- method: 'post',
- data
- })
-
-// Add a new user
-export const addUser = (data: UserVO) => http({
- url: '/user',
- method: 'post',
- data
- })
-
- // Register a new user
-export const registerUser = (data: UserVO) => http({
- url: '/user/register',
- method: 'post',
- data
- })
-
-// Update user
-export const updateUser = (data: UserVO) => http({
- url: '/user',
- method: 'put',
- data
- })
-
-// Delete user
-export const deleteUser = (id: number) => http({
- url: '/user',
- method: 'delete',
- params: {
- id
- }
- })
-
-// Reset password
-export const resetPassword = (id_list: number[]) => http({
- url: '/user/reset-pwd',
- method: 'post',
- data: {
- id_list
- }
- })
-
-// Change password
-export const changePassword = (data: ChangePwdAPIParams) => http({
- url: '/user/change-pwd',
- method: 'post',
- data
- })
-
-// Import form
-export const excelImport = (data: ImportVO[]) => http({
- url: '/user/excel',
- method: 'post',
- data
- })
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { UserVO, ChangePwdAPIParams, ImportVO } from '@/types/Base/UserManagement'
+
+// Find Data by Pagination
+export const getSelectItem = () => http({
+ url: '/user/select-item',
+ method: 'get'
+ })
+
+// Find Data by Pagination
+export const getUserList = (data: PageConfigProps) => http({
+ url: '/user/list',
+ method: 'post',
+ data
+ })
+
+// Add a new user
+export const addUser = (data: UserVO) => http({
+ url: '/user',
+ method: 'post',
+ data
+ })
+
+ // Register a new user
+export const registerUser = (data: UserVO) => http({
+ url: '/user/register',
+ method: 'post',
+ data
+ })
+
+// Update user
+export const updateUser = (data: UserVO) => http({
+ url: '/user',
+ method: 'put',
+ data
+ })
+
+// Delete user
+export const deleteUser = (id: number) => http({
+ url: '/user',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
+
+// Reset password
+export const resetPassword = (id_list: number[]) => http({
+ url: '/user/reset-pwd',
+ method: 'post',
+ data: {
+ id_list
+ }
+ })
+
+// Change password
+export const changePassword = (data: ChangePwdAPIParams) => http({
+ url: '/user/change-pwd',
+ method: 'post',
+ data
+ })
+
+// Import form
+export const excelImport = (data: ImportVO[]) => http({
+ url: '/user/excel',
+ method: 'post',
+ data
+ })
diff --git a/frontend/src/api/base/userRoleSetting.ts b/frontend/src/api/base/userRoleSetting.ts
index fadc64b..7f00b2b 100644
--- a/frontend/src/api/base/userRoleSetting.ts
+++ b/frontend/src/api/base/userRoleSetting.ts
@@ -1,31 +1,31 @@
-import http from '@/utils/http/request'
-import { UserRoleVO } from '@/types/Base/UserRoleSetting'
-
-// Get all
-export const getUserRoleAll = () => http({
- url: '/userrole/all',
- method: 'get'
- })
-
-// Add a new form
-export const addUserRole = (data: UserRoleVO) => http({
- url: '/userrole',
- method: 'post',
- data
- })
-
-// Update form
-export const updateUserRole = (data: UserRoleVO) => http({
- url: '/userrole',
- method: 'put',
- data
- })
-
-// Delete form
-export const deleteUserRole = (id: number) => http({
- url: '/userrole',
- method: 'delete',
- params: {
- id
- }
- })
+import http from '@/utils/http/request'
+import { UserRoleVO } from '@/types/Base/UserRoleSetting'
+
+// Get all
+export const getUserRoleAll = () => http({
+ url: '/userrole/all',
+ method: 'get'
+ })
+
+// Add a new form
+export const addUserRole = (data: UserRoleVO) => http({
+ url: '/userrole',
+ method: 'post',
+ data
+ })
+
+// Update form
+export const updateUserRole = (data: UserRoleVO) => http({
+ url: '/userrole',
+ method: 'put',
+ data
+ })
+
+// Delete form
+export const deleteUserRole = (id: number) => http({
+ url: '/userrole',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
diff --git a/frontend/src/api/base/warehouseSetting.ts b/frontend/src/api/base/warehouseSetting.ts
index 2da30b7..53aa7b1 100644
--- a/frontend/src/api/base/warehouseSetting.ts
+++ b/frontend/src/api/base/warehouseSetting.ts
@@ -1,124 +1,124 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { GoodsLocationVO, WarehouseAreaVO, WarehouseVO } from '@/types/Base/Warehouse'
-
-/**
- * Warehouse Setting
- */
-// Find Data by Pagination
-export const getWarehouseList = (data: PageConfigProps) => http({
- url: '/warehouse/list',
- method: 'post',
- data
- })
-
-// Add a new warehouse
-export const addWarehouse = (data: WarehouseVO) => http({
- url: '/warehouse',
- method: 'post',
- data
- })
-
-// Update warehouse
-export const updateWarehouse = (data: WarehouseVO) => http({
- url: '/warehouse',
- method: 'put',
- data
- })
-
-// Delete warehouse
-export const deleteWarehouse = (id: number) => http({
- url: '/warehouse',
- method: 'delete',
- params: {
- id
- }
- })
-
- // Get the combobox item with warehouse
-export const getWarehouseSelect = () => http({
- url: '/warehouse/select-item',
- method: 'get',
- })
-
- // Excel Import
-export const excelImport = (data: Array<WarehouseVO>) => http({
- url: '/warehouse/excel',
- method: 'post',
- data
-})
-
- // Get the combobox item with warehouse area
-export const getWarehouseAreaSelect = (warehouse_id: number) => http({
- url: '/warehousearea/all',
- method: 'get',
- params: {
- warehouse_id
- }
- })
-
-/**
- * Warehouse Area Setting
- */
-// Find Data by Pagination
-export const getWarehouseAreaList = (data: PageConfigProps) => http({
- url: '/warehousearea/list',
- method: 'post',
- data
- })
-
-// Add a new warehousearea
-export const addWarehouseArea = (data: WarehouseAreaVO) => http({
- url: '/warehousearea',
- method: 'post',
- data
- })
-
-// Update warehousearea
-export const updateWarehouseArea = (data: WarehouseAreaVO) => http({
- url: '/warehousearea',
- method: 'put',
- data
- })
-
-// Delete warehousearea
-export const deleteWarehouseArea = (id: number) => http({
- url: '/warehousearea',
- method: 'delete',
- params: {
- id
- }
- })
-
-/**
- * Goods Location Setting
- */
-// Find Data by Pagination
-export const getGoodsLocationList = (data: PageConfigProps) => http({
- url: '/goodslocation/list',
- method: 'post',
- data
- })
-
-// Add a new goodslocation
-export const addGoodsLocation = (data: GoodsLocationVO) => http({
- url: '/goodslocation',
- method: 'post',
- data
- })
-
-// Update goodslocation
-export const updateGoodsLocation = (data: GoodsLocationVO) => http({
- url: '/goodslocation',
- method: 'put',
- data
- })
-
-// Delete goodslocation
-export const deleteGoodsLocation = (id: number) => http({
- url: '/goodslocation',
- method: 'delete',
- params: {
- id
- }
- })
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { GoodsLocationVO, WarehouseAreaVO, WarehouseVO } from '@/types/Base/Warehouse'
+
+/**
+ * Warehouse Setting
+ */
+// Find Data by Pagination
+export const getWarehouseList = (data: PageConfigProps) => http({
+ url: '/warehouse/list',
+ method: 'post',
+ data
+ })
+
+// Add a new warehouse
+export const addWarehouse = (data: WarehouseVO) => http({
+ url: '/warehouse',
+ method: 'post',
+ data
+ })
+
+// Update warehouse
+export const updateWarehouse = (data: WarehouseVO) => http({
+ url: '/warehouse',
+ method: 'put',
+ data
+ })
+
+// Delete warehouse
+export const deleteWarehouse = (id: number) => http({
+ url: '/warehouse',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
+
+ // Get the combobox item with warehouse
+export const getWarehouseSelect = () => http({
+ url: '/warehouse/select-item',
+ method: 'get',
+ })
+
+ // Excel Import
+export const excelImport = (data: Array<WarehouseVO>) => http({
+ url: '/warehouse/excel',
+ method: 'post',
+ data
+})
+
+ // Get the combobox item with warehouse area
+export const getWarehouseAreaSelect = (warehouse_id: number) => http({
+ url: '/warehousearea/all',
+ method: 'get',
+ params: {
+ warehouse_id
+ }
+ })
+
+/**
+ * Warehouse Area Setting
+ */
+// Find Data by Pagination
+export const getWarehouseAreaList = (data: PageConfigProps) => http({
+ url: '/warehousearea/list',
+ method: 'post',
+ data
+ })
+
+// Add a new warehousearea
+export const addWarehouseArea = (data: WarehouseAreaVO) => http({
+ url: '/warehousearea',
+ method: 'post',
+ data
+ })
+
+// Update warehousearea
+export const updateWarehouseArea = (data: WarehouseAreaVO) => http({
+ url: '/warehousearea',
+ method: 'put',
+ data
+ })
+
+// Delete warehousearea
+export const deleteWarehouseArea = (id: number) => http({
+ url: '/warehousearea',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
+
+/**
+ * Goods Location Setting
+ */
+// Find Data by Pagination
+export const getGoodsLocationList = (data: PageConfigProps) => http({
+ url: '/goodslocation/list',
+ method: 'post',
+ data
+ })
+
+// Add a new goodslocation
+export const addGoodsLocation = (data: GoodsLocationVO) => http({
+ url: '/goodslocation',
+ method: 'post',
+ data
+ })
+
+// Update goodslocation
+export const updateGoodsLocation = (data: GoodsLocationVO) => http({
+ url: '/goodslocation',
+ method: 'put',
+ data
+ })
+
+// Delete goodslocation
+export const deleteGoodsLocation = (id: number) => http({
+ url: '/goodslocation',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
diff --git a/frontend/src/api/sys/login.ts b/frontend/src/api/sys/login.ts
index ec37606..97a282a 100644
--- a/frontend/src/api/sys/login.ts
+++ b/frontend/src/api/sys/login.ts
@@ -1,17 +1,17 @@
-import http from '@/utils/http/request'
-import { LoginParams } from '../../types/System/UserModel'
-
-export const login = (data: LoginParams) => http({
- url: '/login',
- method: 'post',
- data
- })
-
-// Get user menu dynamically
-export const getUserAuthority = (userrole_id: number) => http({
- url: '/rolemenu/authority',
- method: 'get',
- params: {
- userrole_id
- }
- })
+import http from '@/utils/http/request'
+import { LoginParams } from '../../types/System/UserModel'
+
+export const login = (data: LoginParams) => http({
+ url: '/login',
+ method: 'post',
+ data
+ })
+
+// Get user menu dynamically
+export const getUserAuthority = (userrole_id: number) => http({
+ url: '/rolemenu/authority',
+ method: 'get',
+ params: {
+ userrole_id
+ }
+ })
diff --git a/frontend/src/api/sys/model/userModel.ts b/frontend/src/api/sys/model/userModel.ts
deleted file mode 100644
index fcfdabb..0000000
--- a/frontend/src/api/sys/model/userModel.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * @description: Login interface parameters
- */
-export interface LoginParams {
- userName: string
- password: string
-}
-
-/**
- * @description: Login interface return value
- */
-export interface LoginResultModel {
- userId: string | number
- token: string
-}
-
-/**
- * @description: Get user information return value
- */
-// export interface GetUserInfoModel {
-// // 用户id
-// userId: string | number;
-// // 用户名
-// username: string;
-// // 真实名字
-// realName: string;
-// // 头像
-// avatar: string;
-// // 介绍
-// desc?: string;
-// }
diff --git a/frontend/src/api/sys/test.ts b/frontend/src/api/sys/test.ts
index c0848da..2b87b54 100644
--- a/frontend/src/api/sys/test.ts
+++ b/frontend/src/api/sys/test.ts
@@ -1,13 +1,13 @@
-import http from '@/utils/http/request'
-
-interface params {
- ifall?: boolean
- iftodo?: boolean
-}
-export const getNotify = (data: params) => {
- return http({
- url: '/OA/SMNotifyBoard/home-notifyboard-todo',
- method: 'get',
- data
- })
-}
+import http from '@/utils/http/request'
+
+interface params {
+ ifall?: boolean
+ iftodo?: boolean
+}
+export const getNotify = (data: params) => {
+ return http({
+ url: '/OA/SMNotifyBoard/home-notifyboard-todo',
+ method: 'get',
+ data
+ })
+}
diff --git a/frontend/src/api/wms/deliveryManagement.ts b/frontend/src/api/wms/deliveryManagement.ts
index 8ac2d32..b5ebfa4 100644
--- a/frontend/src/api/wms/deliveryManagement.ts
+++ b/frontend/src/api/wms/deliveryManagement.ts
@@ -1,221 +1,221 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { addRequestVO, ConfirmOrderVO, PackageVO, WeighVO, DeliveryVO, SignInVO, CancleOrderVO, SetCarrierVO } from '@/types/DeliveryManagement/DeliveryManagement'
-
-// Get Pre shipment
-export const getShipment = (data: PageConfigProps) => http({
- url: '/dispatchlist/advanced-list',
- method: 'post',
- data
- })
-
-// Get Pre shipment
-export const getPreShipment = (data: PageConfigProps) => http({
- url: '/dispatchlist/advanced-list',
- method: 'post',
- data: {
- ...data,
- sqlTitle: 'dispatch_status=0'
- }
- })
-
-// Get new shipment
-export const getNewShipment = (data: PageConfigProps) => http({
- url: '/dispatchlist/advanced-list',
- method: 'post',
- data: {
- ...data,
- sqlTitle: 'dispatch_status=1'
- }
- })
-
-// Get new shipment
-export const getGoodsToBePicked = (data: PageConfigProps) => http({
- url: '/dispatchlist/list',
- method: 'post',
- data: {
- ...data,
- sqlTitle: 'dispatch_status=2'
- }
- })
-
-// Get To Be Packaged
-export const getToBePackaged = (data: PageConfigProps) => http({
- url: '/dispatchlist/list',
- method: 'post',
- data: {
- ...data,
- sqlTitle: 'to_package'
- }
- })
-
-// Get picked
-export const getPicked = (data: PageConfigProps) => http({
- url: '/dispatchlist/list',
- method: 'post',
- data: {
- ...data,
- sqlTitle: 'dispatch_status=3'
- }
- })
-
-// Get Packaged
-export const getPackaged = (data: PageConfigProps) => http({
- url: '/dispatchlist/list',
- method: 'post',
- data: {
- ...data,
- sqlTitle: 'dispatch_status=4'
- }
- })
-
-// Get To Be Weight
-export const getToBeWeighed = (data: PageConfigProps) => http({
- url: '/dispatchlist/list',
- method: 'post',
- data: {
- ...data,
- sqlTitle: 'to_weight'
- }
- })
-
-// Get Weight
-export const getWeighed = (data: PageConfigProps) => http({
- url: '/dispatchlist/list',
- method: 'post',
- data: {
- ...data,
- sqlTitle: 'dispatch_status=5'
- }
- })
-
-// Get To Be Delivery
-export const getToBeDelivery = (data: PageConfigProps) => http({
- url: '/dispatchlist/list',
- method: 'post',
- data: {
- ...data,
- sqlTitle: 'to_delivery'
- }
- })
-
-// Get Delivery
-export const getDelivery = (data: PageConfigProps) => http({
- url: '/dispatchlist/list',
- method: 'post',
- data: {
- ...data,
- sqlTitle: 'dispatch_status=6'
- }
- })
-
-// Get Sign In
-export const getSignIn = (data: PageConfigProps) => http({
- url: '/dispatchlist/list',
- method: 'post',
- data: {
- ...data,
- sqlTitle: 'dispatch_status=7'
- }
- })
-
-// Add
-export const addShipment = (data: addRequestVO[]) => http({
- url: '/dispatchlist',
- method: 'post',
- data
- })
-
-// Delete
-export const delShipment = (dispatch_no: string) => http({
- url: '/dispatchlist',
- method: 'delete',
- params: {
- dispatch_no
- }
- })
-
-// Get order confirmation information
-export const getConfirmOrderInfoAndStock = (dispatch_no: string) => http({
- url: '/dispatchlist/confirm-check',
- method: 'get',
- params: {
- dispatch_no
- }
- })
-
-// Confirm orders and create dispatchpicklist
-export const confirmOrder = (data: ConfirmOrderVO[]) => http({
- url: '/dispatchlist/confirm-order',
- method: 'post',
- data
- })
-
-// Confirm picking
-export const confirmPicking = (dispatch_no: string) => http({
- url: '/dispatchlist/confirm-pick-dispatchlistno',
- method: 'put',
- params: {
- dispatch_no
- }
- })
-
-// Pack
-export const handlePackage = (data: PackageVO[]) => http({
- url: '/dispatchlist/package',
- method: 'post',
- data
- })
-
-// Weigh
-export const handleWeigh = (data: WeighVO[]) => http({
- url: '/dispatchlist/weight',
- method: 'post',
- data
- })
-
-// Delivery
-export const handleDelivery = (data: DeliveryVO[]) => http({
- url: '/dispatchlist/delivery',
- method: 'post',
- data
- })
-
-// Sign in
-export const handleSignIn = (data: SignInVO[]) => http({
- url: '/dispatchlist/sign',
- method: 'post',
- data
- })
-
-// Undo to previous step by detail
-export const cancelOrderByDetail = (id: number) => http({
- url: '/dispatchlist/cancel-order',
- method: 'put',
- params: {
- id
- }
- })
-
-// Undo to previous step by dispatch
-export const cancelOrderByDispatch = (data: CancleOrderVO) => http({
- url: '/dispatchlist/cancel-order',
- method: 'post',
- data
- })
-
-// Set carrier
-export const setCarrier = (data: SetCarrierVO[]) => http({
- url: '/dispatchlist/freightfee',
- method: 'post',
- data
- })
-
-// Set carrier
-export const viewInventoryDetails = (dispatch_id: number) => http({
- url: '/dispatchlist/pick-list',
- method: 'get',
- params: {
- dispatch_id
- }
- })
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { addRequestVO, ConfirmOrderVO, PackageVO, WeighVO, DeliveryVO, SignInVO, CancleOrderVO, SetCarrierVO } from '@/types/DeliveryManagement/DeliveryManagement'
+
+// Get Pre shipment
+export const getShipment = (data: PageConfigProps) => http({
+ url: '/dispatchlist/advanced-list',
+ method: 'post',
+ data
+ })
+
+// Get Pre shipment
+export const getPreShipment = (data: PageConfigProps) => http({
+ url: '/dispatchlist/advanced-list',
+ method: 'post',
+ data: {
+ ...data,
+ sqlTitle: 'dispatch_status=0'
+ }
+ })
+
+// Get new shipment
+export const getNewShipment = (data: PageConfigProps) => http({
+ url: '/dispatchlist/advanced-list',
+ method: 'post',
+ data: {
+ ...data,
+ sqlTitle: 'dispatch_status=1'
+ }
+ })
+
+// Get new shipment
+export const getGoodsToBePicked = (data: PageConfigProps) => http({
+ url: '/dispatchlist/list',
+ method: 'post',
+ data: {
+ ...data,
+ sqlTitle: 'dispatch_status=2'
+ }
+ })
+
+// Get To Be Packaged
+export const getToBePackaged = (data: PageConfigProps) => http({
+ url: '/dispatchlist/list',
+ method: 'post',
+ data: {
+ ...data,
+ sqlTitle: 'to_package'
+ }
+ })
+
+// Get picked
+export const getPicked = (data: PageConfigProps) => http({
+ url: '/dispatchlist/list',
+ method: 'post',
+ data: {
+ ...data,
+ sqlTitle: 'dispatch_status=3'
+ }
+ })
+
+// Get Packaged
+export const getPackaged = (data: PageConfigProps) => http({
+ url: '/dispatchlist/list',
+ method: 'post',
+ data: {
+ ...data,
+ sqlTitle: 'dispatch_status=4'
+ }
+ })
+
+// Get To Be Weight
+export const getToBeWeighed = (data: PageConfigProps) => http({
+ url: '/dispatchlist/list',
+ method: 'post',
+ data: {
+ ...data,
+ sqlTitle: 'to_weight'
+ }
+ })
+
+// Get Weight
+export const getWeighed = (data: PageConfigProps) => http({
+ url: '/dispatchlist/list',
+ method: 'post',
+ data: {
+ ...data,
+ sqlTitle: 'dispatch_status=5'
+ }
+ })
+
+// Get To Be Delivery
+export const getToBeDelivery = (data: PageConfigProps) => http({
+ url: '/dispatchlist/list',
+ method: 'post',
+ data: {
+ ...data,
+ sqlTitle: 'to_delivery'
+ }
+ })
+
+// Get Delivery
+export const getDelivery = (data: PageConfigProps) => http({
+ url: '/dispatchlist/list',
+ method: 'post',
+ data: {
+ ...data,
+ sqlTitle: 'dispatch_status=6'
+ }
+ })
+
+// Get Sign In
+export const getSignIn = (data: PageConfigProps) => http({
+ url: '/dispatchlist/list',
+ method: 'post',
+ data: {
+ ...data,
+ sqlTitle: 'dispatch_status=7'
+ }
+ })
+
+// Add
+export const addShipment = (data: addRequestVO[]) => http({
+ url: '/dispatchlist',
+ method: 'post',
+ data
+ })
+
+// Delete
+export const delShipment = (dispatch_no: string) => http({
+ url: '/dispatchlist',
+ method: 'delete',
+ params: {
+ dispatch_no
+ }
+ })
+
+// Get order confirmation information
+export const getConfirmOrderInfoAndStock = (dispatch_no: string) => http({
+ url: '/dispatchlist/confirm-check',
+ method: 'get',
+ params: {
+ dispatch_no
+ }
+ })
+
+// Confirm orders and create dispatchpicklist
+export const confirmOrder = (data: ConfirmOrderVO[]) => http({
+ url: '/dispatchlist/confirm-order',
+ method: 'post',
+ data
+ })
+
+// Confirm picking
+export const confirmPicking = (dispatch_no: string) => http({
+ url: '/dispatchlist/confirm-pick-dispatchlistno',
+ method: 'put',
+ params: {
+ dispatch_no
+ }
+ })
+
+// Pack
+export const handlePackage = (data: PackageVO[]) => http({
+ url: '/dispatchlist/package',
+ method: 'post',
+ data
+ })
+
+// Weigh
+export const handleWeigh = (data: WeighVO[]) => http({
+ url: '/dispatchlist/weight',
+ method: 'post',
+ data
+ })
+
+// Delivery
+export const handleDelivery = (data: DeliveryVO[]) => http({
+ url: '/dispatchlist/delivery',
+ method: 'post',
+ data
+ })
+
+// Sign in
+export const handleSignIn = (data: SignInVO[]) => http({
+ url: '/dispatchlist/sign',
+ method: 'post',
+ data
+ })
+
+// Undo to previous step by detail
+export const cancelOrderByDetail = (id: number) => http({
+ url: '/dispatchlist/cancel-order',
+ method: 'put',
+ params: {
+ id
+ }
+ })
+
+// Undo to previous step by dispatch
+export const cancelOrderByDispatch = (data: CancleOrderVO) => http({
+ url: '/dispatchlist/cancel-order',
+ method: 'post',
+ data
+ })
+
+// Set carrier
+export const setCarrier = (data: SetCarrierVO[]) => http({
+ url: '/dispatchlist/freightfee',
+ method: 'post',
+ data
+ })
+
+// Set carrier
+export const viewInventoryDetails = (dispatch_id: number) => http({
+ url: '/dispatchlist/pick-list',
+ method: 'get',
+ params: {
+ dispatch_id
+ }
+ })
diff --git a/frontend/src/api/wms/stockAsn.ts b/frontend/src/api/wms/stockAsn.ts
index 57c7d1e..86f44d4 100644
--- a/frontend/src/api/wms/stockAsn.ts
+++ b/frontend/src/api/wms/stockAsn.ts
@@ -1,76 +1,76 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { StockAsnVO, SortingVo, PutawayVo } from '@/types/WMS/StockAsn'
-
-export const getStockAsnList = (data: PageConfigProps) => http({
- url: '/asn/list',
- method: 'post',
- data
- })
-
-export const addAsn = (data: StockAsnVO) => http({
- url: '/asn',
- method: 'post',
- data
- })
-
-export const updateAsn = (data: StockAsnVO) => http({
- url: '/asn',
- method: 'put',
- data
- })
-
-export const deleteAsn = (id: number) => http({
- url: '/asn',
- method: 'delete',
- params: {
- id
- }
- })
-
-export const confirmAsn = (id: number) => http({
- url: `/asn/confirm/${ id }`,
- method: 'put'
- })
-export const confirmAsnCancel = (id: number) => http({
- url: `/asn/confirm-cancel/${ id }`,
- method: 'put'
- })
-
-export const unloadAsn = (id: number) => http({
- url: `/asn/unload/${ id }`,
- method: 'put'
- })
-export const unloadAsnCancel = (id: number) => http({
- url: `/asn/unload-cancel/${ id }`,
- method: 'put'
- })
-
-export const sortedAsn = (id: number) => http({
- url: `/asn/sorted/${ id }`,
- method: 'put'
- })
-export const sortedAsnCancel = (id: number) => http({
- url: `/asn/sorted-cancel/${ id }`,
- method: 'put'
- })
-
-export const sortingAsn = (data: SortingVo) => http({
- url: '/asn/sorting',
- method: 'put',
- data
- })
-
-export const putawayAsn = (data: PutawayVo) => http({
- url: '/asn/putaway',
- method: 'put',
- data
- })
-
-export const getSkuInfo = (id: number) => http({
- url: '/spu/sku',
- method: 'get',
- params: {
- sku_id: id
- }
- })
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { StockAsnVO, SortingVo, PutawayVo } from '@/types/WMS/StockAsn'
+
+export const getStockAsnList = (data: PageConfigProps) => http({
+ url: '/asn/list',
+ method: 'post',
+ data
+ })
+
+export const addAsn = (data: StockAsnVO) => http({
+ url: '/asn',
+ method: 'post',
+ data
+ })
+
+export const updateAsn = (data: StockAsnVO) => http({
+ url: '/asn',
+ method: 'put',
+ data
+ })
+
+export const deleteAsn = (id: number) => http({
+ url: '/asn',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
+
+export const confirmAsn = (id: number) => http({
+ url: `/asn/confirm/${ id }`,
+ method: 'put'
+ })
+export const confirmAsnCancel = (id: number) => http({
+ url: `/asn/confirm-cancel/${ id }`,
+ method: 'put'
+ })
+
+export const unloadAsn = (id: number) => http({
+ url: `/asn/unload/${ id }`,
+ method: 'put'
+ })
+export const unloadAsnCancel = (id: number) => http({
+ url: `/asn/unload-cancel/${ id }`,
+ method: 'put'
+ })
+
+export const sortedAsn = (id: number) => http({
+ url: `/asn/sorted/${ id }`,
+ method: 'put'
+ })
+export const sortedAsnCancel = (id: number) => http({
+ url: `/asn/sorted-cancel/${ id }`,
+ method: 'put'
+ })
+
+export const sortingAsn = (data: SortingVo) => http({
+ url: '/asn/sorting',
+ method: 'put',
+ data
+ })
+
+export const putawayAsn = (data: PutawayVo) => http({
+ url: '/asn/putaway',
+ method: 'put',
+ data
+ })
+
+export const getSkuInfo = (id: number) => http({
+ url: '/spu/sku',
+ method: 'get',
+ params: {
+ sku_id: id
+ }
+ })
diff --git a/frontend/src/api/wms/stockManagement.ts b/frontend/src/api/wms/stockManagement.ts
index 506f7ed..6f65d87 100644
--- a/frontend/src/api/wms/stockManagement.ts
+++ b/frontend/src/api/wms/stockManagement.ts
@@ -1,29 +1,29 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-
-// Get stock select
-export const getStockSelectList = (data: PageConfigProps) => http({
- url: '/stock/select',
- method: 'post',
- data
- })
-
-// Get sku select
-export const getSkuSelectList = (data: PageConfigProps) => http({
- url: '/stock/sku-select',
- method: 'post',
- data
- })
-
- // Get stock location
-export const getStockLocationList = (data: PageConfigProps) => http({
- url: '/stock/location-list',
- method: 'post',
- data
-})
-// Get stock
-export const getStockList = (data: PageConfigProps) => http({
- url: '/stock/stock-list',
- method: 'post',
- data
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+
+// Get stock select
+export const getStockSelectList = (data: PageConfigProps) => http({
+ url: '/stock/select',
+ method: 'post',
+ data
+ })
+
+// Get sku select
+export const getSkuSelectList = (data: PageConfigProps) => http({
+ url: '/stock/sku-select',
+ method: 'post',
+ data
+ })
+
+ // Get stock location
+export const getStockLocationList = (data: PageConfigProps) => http({
+ url: '/stock/location-list',
+ method: 'post',
+ data
+})
+// Get stock
+export const getStockList = (data: PageConfigProps) => http({
+ url: '/stock/stock-list',
+ method: 'post',
+ data
})
\ No newline at end of file
diff --git a/frontend/src/api/wms/warehouseAdjust.ts b/frontend/src/api/wms/warehouseAdjust.ts
index c3513eb..5358d99 100644
--- a/frontend/src/api/wms/warehouseAdjust.ts
+++ b/frontend/src/api/wms/warehouseAdjust.ts
@@ -1,50 +1,50 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { WarehouseAdjustVO } from '@/types/WarehouseWorking/WarehouseAdjust'
-
-// Get list
-export const getStockAdjustList = (data: PageConfigProps) => http({
- url: '/stockadjust/list',
- method: 'post',
- data
- })
-
-// Get all
-export const getStockAdjustAll = () => http({
- url: '/stockadjust/all',
- method: 'get'
- })
-
-// Get one
-export const getStockAdjustOne = (id: number) => http({
- url: '/stockadjust',
- method: 'get',
- params: {
- id
- }
- })
-
-// Add a new form
-export const addStockAdjust = (data: WarehouseAdjustVO) => http({
- url: '/stockadjust',
- method: 'post',
- data
- })
-
-// Delete form
-export const deleteStockAdjust = (id: number) => http({
- url: '/stockadjust',
- method: 'delete',
- params: {
- id
- }
- })
-
- // Delete form
-export const confirmStockAdjust = (id: number) => http({
- url: '/stockadjust/confirm',
- method: 'put',
- params: {
- id
- }
- })
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { WarehouseAdjustVO } from '@/types/WarehouseWorking/WarehouseAdjust'
+
+// Get list
+export const getStockAdjustList = (data: PageConfigProps) => http({
+ url: '/stockadjust/list',
+ method: 'post',
+ data
+ })
+
+// Get all
+export const getStockAdjustAll = () => http({
+ url: '/stockadjust/all',
+ method: 'get'
+ })
+
+// Get one
+export const getStockAdjustOne = (id: number) => http({
+ url: '/stockadjust',
+ method: 'get',
+ params: {
+ id
+ }
+ })
+
+// Add a new form
+export const addStockAdjust = (data: WarehouseAdjustVO) => http({
+ url: '/stockadjust',
+ method: 'post',
+ data
+ })
+
+// Delete form
+export const deleteStockAdjust = (id: number) => http({
+ url: '/stockadjust',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
+
+ // Delete form
+export const confirmStockAdjust = (id: number) => http({
+ url: '/stockadjust/confirm',
+ method: 'put',
+ params: {
+ id
+ }
+ })
diff --git a/frontend/src/api/wms/warehouseFreeze.ts b/frontend/src/api/wms/warehouseFreeze.ts
index 8412c20..b0fa08d 100644
--- a/frontend/src/api/wms/warehouseFreeze.ts
+++ b/frontend/src/api/wms/warehouseFreeze.ts
@@ -1,41 +1,41 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { WarehouseFreezeVO } from '@/types/WarehouseWorking/WarehouseFreeze'
-
-// Get list
-export const getStockFreezeList = (data: PageConfigProps) => http({
- url: '/stockfreeze/list',
- method: 'post',
- data
- })
-
-// Get all
-export const getStockFreezeAll = () => http({
- url: '/stockfreeze/all',
- method: 'get'
- })
-
-// Get one
-export const getStockFreezeOne = (id: number) => http({
- url: '/stockfreeze',
- method: 'get',
- params: {
- id
- }
- })
-
-// Add a new form
-export const addStockFreeze = (data: WarehouseFreezeVO) => http({
- url: '/stockfreeze',
- method: 'post',
- data
- })
-
-// Delete form
-export const deleteStockFreeze = (id: number) => http({
- url: '/stockfreeze',
- method: 'delete',
- params: {
- id
- }
- })
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { WarehouseFreezeVO } from '@/types/WarehouseWorking/WarehouseFreeze'
+
+// Get list
+export const getStockFreezeList = (data: PageConfigProps) => http({
+ url: '/stockfreeze/list',
+ method: 'post',
+ data
+ })
+
+// Get all
+export const getStockFreezeAll = () => http({
+ url: '/stockfreeze/all',
+ method: 'get'
+ })
+
+// Get one
+export const getStockFreezeOne = (id: number) => http({
+ url: '/stockfreeze',
+ method: 'get',
+ params: {
+ id
+ }
+ })
+
+// Add a new form
+export const addStockFreeze = (data: WarehouseFreezeVO) => http({
+ url: '/stockfreeze',
+ method: 'post',
+ data
+ })
+
+// Delete form
+export const deleteStockFreeze = (id: number) => http({
+ url: '/stockfreeze',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
diff --git a/frontend/src/api/wms/warehouseMove.ts b/frontend/src/api/wms/warehouseMove.ts
index 15ede7c..a5939c3 100644
--- a/frontend/src/api/wms/warehouseMove.ts
+++ b/frontend/src/api/wms/warehouseMove.ts
@@ -1,50 +1,50 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { WarehouseMoveVO } from '@/types/WarehouseWorking/WarehouseMove'
-
-// Get list
-export const getStockMoveList = (data: PageConfigProps) => http({
- url: '/stockmove/list',
- method: 'post',
- data
- })
-
-// Get all
-export const getStockMoveAll = () => http({
- url: '/stockmove/all',
- method: 'get'
- })
-
-// Get one
-export const getStockMoveOne = (id: number) => http({
- url: '/stockmove',
- method: 'get',
- params: {
- id
- }
- })
-
-// Add a new form
-export const addStockMove = (data: WarehouseMoveVO) => http({
- url: '/stockmove',
- method: 'post',
- data
- })
-
-// Delete form
-export const deleteStockMove = (id: number) => http({
- url: '/stockmove',
- method: 'delete',
- params: {
- id
- }
- })
-
-// Confirm move
-export const confirmMove = (id: number) => http({
- url: '/stockmove',
- method: 'put',
- params: {
- id
- }
- })
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { WarehouseMoveVO } from '@/types/WarehouseWorking/WarehouseMove'
+
+// Get list
+export const getStockMoveList = (data: PageConfigProps) => http({
+ url: '/stockmove/list',
+ method: 'post',
+ data
+ })
+
+// Get all
+export const getStockMoveAll = () => http({
+ url: '/stockmove/all',
+ method: 'get'
+ })
+
+// Get one
+export const getStockMoveOne = (id: number) => http({
+ url: '/stockmove',
+ method: 'get',
+ params: {
+ id
+ }
+ })
+
+// Add a new form
+export const addStockMove = (data: WarehouseMoveVO) => http({
+ url: '/stockmove',
+ method: 'post',
+ data
+ })
+
+// Delete form
+export const deleteStockMove = (id: number) => http({
+ url: '/stockmove',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
+
+// Confirm move
+export const confirmMove = (id: number) => http({
+ url: '/stockmove',
+ method: 'put',
+ params: {
+ id
+ }
+ })
diff --git a/frontend/src/api/wms/warehouseProcessing.ts b/frontend/src/api/wms/warehouseProcessing.ts
index 246a65a..6ce79dd 100644
--- a/frontend/src/api/wms/warehouseProcessing.ts
+++ b/frontend/src/api/wms/warehouseProcessing.ts
@@ -1,66 +1,66 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { WarehouseProcessingVO, WarehouseProcessingDetailVO } from '@/types/WarehouseWorking/WarehouseProcessing'
-
-// Get list
-export const getStockProcessList = (data: PageConfigProps) => http({
- url: '/stockprocess/list',
- method: 'post',
- data
- })
-
-// Get all
-export const getStockProcessAll = () => http({
- url: '/stockprocess/all',
- method: 'get'
- })
-
-// Get one
-export const getStockProcessOne = (id: number) => http({
- url: '/stockprocess',
- method: 'get',
- params: {
- id
- }
- })
-
-// Add a new form
-export const addStockProcess = (data: WarehouseProcessingVO) => http({
- url: '/stockprocess',
- method: 'post',
- data
- })
-
-// Update form
-export const updateStockProcess = (data: WarehouseProcessingVO) => http({
- url: '/stockprocess',
- method: 'put',
- data
- })
-
-// Delete form
-export const deleteStockProcess = (id: number) => http({
- url: '/stockprocess',
- method: 'delete',
- params: {
- id
- }
- })
-
-// Confirm process
-export const confirmProcess = (id: number) => http({
- url: '/stockprocess/process-confirm',
- method: 'put',
- params: {
- id
- }
- })
-
-// Confirm adjustment
-export const confirmAdjustment = (id: number) => http({
- url: '/stockprocess/adjustment-confirm',
- method: 'put',
- params: {
- id
- }
- })
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { WarehouseProcessingVO, WarehouseProcessingDetailVO } from '@/types/WarehouseWorking/WarehouseProcessing'
+
+// Get list
+export const getStockProcessList = (data: PageConfigProps) => http({
+ url: '/stockprocess/list',
+ method: 'post',
+ data
+ })
+
+// Get all
+export const getStockProcessAll = () => http({
+ url: '/stockprocess/all',
+ method: 'get'
+ })
+
+// Get one
+export const getStockProcessOne = (id: number) => http({
+ url: '/stockprocess',
+ method: 'get',
+ params: {
+ id
+ }
+ })
+
+// Add a new form
+export const addStockProcess = (data: WarehouseProcessingVO) => http({
+ url: '/stockprocess',
+ method: 'post',
+ data
+ })
+
+// Update form
+export const updateStockProcess = (data: WarehouseProcessingVO) => http({
+ url: '/stockprocess',
+ method: 'put',
+ data
+ })
+
+// Delete form
+export const deleteStockProcess = (id: number) => http({
+ url: '/stockprocess',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
+
+// Confirm process
+export const confirmProcess = (id: number) => http({
+ url: '/stockprocess/process-confirm',
+ method: 'put',
+ params: {
+ id
+ }
+ })
+
+// Confirm adjustment
+export const confirmAdjustment = (id: number) => http({
+ url: '/stockprocess/adjustment-confirm',
+ method: 'put',
+ params: {
+ id
+ }
+ })
diff --git a/frontend/src/api/wms/warehouseTaking.ts b/frontend/src/api/wms/warehouseTaking.ts
index d5c19aa..1e5a79a 100644
--- a/frontend/src/api/wms/warehouseTaking.ts
+++ b/frontend/src/api/wms/warehouseTaking.ts
@@ -1,54 +1,54 @@
-import http from '@/utils/http/request'
-import { PageConfigProps } from '@/types/System/Form'
-import { WarehouseTakingVO } from '@/types/WarehouseWorking/WarehouseTaking'
-
-// Get list
-export const getStockTakingList = (data: PageConfigProps) => http({
- url: '/stocktaking/list',
- method: 'post',
- data
- })
-
-// Get one
-export const getStockTakingOne = (id: number) => http({
- url: '/stocktaking',
- method: 'get',
- params: {
- id
- }
- })
-
-// Add a new form
-export const addStockTaking = (data: WarehouseTakingVO) => http({
- url: '/stocktaking',
- method: 'post',
- data
- })
-
-// Delete form
-export const deleteStockTaking = (id: number) => http({
- url: '/stocktaking',
- method: 'delete',
- params: {
- id
- }
- })
-
-// Confirm stock taking
-export const confirmStockTaking = (data: WarehouseTakingVO) => http({
- url: '/stocktaking',
- method: 'put',
- data: {
- id: data.id,
- counted_qty: data.counted_qty
- }
- })
-
-// Confirm stock adjust
-export const confirmAdjustment = (id: number) => http({
- url: '/stocktaking/adjustment-confirm',
- method: 'put',
- params: {
- id
- }
- })
+import http from '@/utils/http/request'
+import { PageConfigProps } from '@/types/System/Form'
+import { WarehouseTakingVO } from '@/types/WarehouseWorking/WarehouseTaking'
+
+// Get list
+export const getStockTakingList = (data: PageConfigProps) => http({
+ url: '/stocktaking/list',
+ method: 'post',
+ data
+ })
+
+// Get one
+export const getStockTakingOne = (id: number) => http({
+ url: '/stocktaking',
+ method: 'get',
+ params: {
+ id
+ }
+ })
+
+// Add a new form
+export const addStockTaking = (data: WarehouseTakingVO) => http({
+ url: '/stocktaking',
+ method: 'post',
+ data
+ })
+
+// Delete form
+export const deleteStockTaking = (id: number) => http({
+ url: '/stocktaking',
+ method: 'delete',
+ params: {
+ id
+ }
+ })
+
+// Confirm stock taking
+export const confirmStockTaking = (data: WarehouseTakingVO) => http({
+ url: '/stocktaking',
+ method: 'put',
+ data: {
+ id: data.id,
+ counted_qty: data.counted_qty
+ }
+ })
+
+// Confirm stock adjust
+export const confirmAdjustment = (id: number) => http({
+ url: '/stocktaking/adjustment-confirm',
+ method: 'put',
+ params: {
+ id
+ }
+ })
diff --git a/frontend/src/assets/css/hookComponent.css b/frontend/src/assets/css/hookComponent.css
index cb04553..e47a117 100644
--- a/frontend/src/assets/css/hookComponent.css
+++ b/frontend/src/assets/css/hookComponent.css
@@ -1,8 +1,8 @@
-.messageItems {
- position: fixed;
- /* top: 10px; */
- left: 50%;
- max-width: 90%;
- transform: translate(-50%, 0);
- transition: all 0.2s;
-}
+.messageItems {
+ position: fixed;
+ /* top: 10px; */
+ left: 50%;
+ max-width: 90%;
+ transform: translate(-50%, 0);
+ transition: all 0.2s;
+}
diff --git a/frontend/src/assets/img/loginLeft2.png b/frontend/src/assets/img/loginLeft2.png
deleted file mode 100644
index 5531b27..0000000
Binary files a/frontend/src/assets/img/loginLeft2.png and /dev/null differ
diff --git a/frontend/src/assets/img/loginLeft3.png b/frontend/src/assets/img/loginLeft3.png
deleted file mode 100644
index 0257c61..0000000
Binary files a/frontend/src/assets/img/loginLeft3.png and /dev/null differ
diff --git a/frontend/src/components/common/function/index.ts b/frontend/src/components/common/function/index.ts
deleted file mode 100644
index 97cfcc8..0000000
--- a/frontend/src/components/common/function/index.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import '@/assets/css/hookComponent.css' // import hookComponent style
-
-// Use import.meta.globEager to read the files in the components folder, distinguished by the suffix ts
-const componentsList: any = import.meta.globEager('../hookComponent/**')
-
-const List: any = {}
-export default function (app: any) {
- Object.keys(componentsList).forEach((key) => {
- // Filter out ts suffix
- if (key.includes('.ts')) {
- // Assignment function component, thrown later, imported for use
- List[`$${ componentsList[key].default.name }`] = componentsList[key].default
-
- // Define function components into global variables, and use them in script in vue through proxy
- app.config.globalProperties[`$${ componentsList[key].default.name }`] = componentsList[key].default
- }
- })
-}
-
-// Export function components for import
-export const funComponentList = List
diff --git a/frontend/src/components/common/hookComponent/dialog.ts b/frontend/src/components/common/hookComponent/dialog.ts
deleted file mode 100644
index 44c9ea3..0000000
--- a/frontend/src/components/common/hookComponent/dialog.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { createApp } from 'vue'
-import DialogComponent from './dialog.vue'
-import { DialogOptions } from '@/types/system/hookComponent'
-// Use vuetify
-import { vuetify } from '@/plugins/vuetify/index'
-
-// Use the createApp of vue3 and the mount and unmount methods to create a mounted instance
-export default function dialog(options: DialogOptions) {
- const mountNode = document.createElement('div')
- document.body.appendChild(mountNode)
- const app = createApp(DialogComponent, {
- ...options,
- visible: true,
- removeComponent: () => {
- app.unmount()
- document.body.removeChild(mountNode)
- }
- }).use(vuetify)
- return app.mount(mountNode)
-}
diff --git a/frontend/src/components/common/hookComponent/dialog.vue b/frontend/src/components/common/hookComponent/dialog.vue
deleted file mode 100644
index 417b869..0000000
--- a/frontend/src/components/common/hookComponent/dialog.vue
+++ /dev/null
@@ -1,86 +0,0 @@
-<template>
- <v-dialog v-model="data.dialogVisible" persistent :width="dialogWidth">
- <v-card>
- <v-card-title class="text-h5"> {{ title }} </v-card-title>
- <v-card-text>{{ content }}</v-card-text>
- <v-card-actions>
- <v-spacer></v-spacer>
- <v-btn color="green-darken-1" variant="text" @click="data.dialogVisible = false">
- {{ cancleText }}
- </v-btn>
- <v-btn
- v-if="typeof dialogProps.handleConfirm === 'function'"
- color="green-darken-1"
- variant="text"
- @click="method._sure()"
- >
- {{ confirmText }}
- </v-btn>
- </v-card-actions>
- </v-card>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { watch, reactive } from 'vue'
-import i18n from '@/languages/i18n'
-
-const dialogProps = defineProps({
- visible: {
- type: Boolean,
- default: false
- },
- confirmText: {
- type: String,
- default: i18n.global.t('system.hookComponent.dialog.defaultConfirm')
- },
- cancleText: {
- type: String,
- default: i18n.global.t('system.hookComponent.dialog.defaultClose')
- },
- handleConfirm: {
- type: Function,
- default: null
- },
- // Remove dom function
- removeComponent: {
- type: Function,
- default: null
- },
- content: {
- type: String,
- default: ''
- },
- title: {
- type: String,
- default: i18n.global.t('system.hookComponent.dialog.defaultTitle')
- },
- dialogWidth: {
- type: [String, Number],
- default: 700
- }
-})
-
-const data = reactive({
- dialogVisible: false,
- dialogText: ''
-})
-
-// Init dialog visible
-data.dialogVisible = Boolean(dialogProps.visible) // Avoid shallow copies
-
-const method = reactive({
- _sure: async () => {
- await dialogProps.handleConfirm()
- data.dialogVisible = false
- }
-})
-
-// Shut dialog run remove function
-watch(
- () => data.dialogVisible,
- (val) => {
- !val && dialogProps.removeComponent()
- }
-)
-</script>
diff --git a/frontend/src/components/common/hookComponent/message.ts b/frontend/src/components/common/hookComponent/message.ts
deleted file mode 100644
index f650bf7..0000000
--- a/frontend/src/components/common/hookComponent/message.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-import { createApp } from 'vue'
-import MessageComponent from './message.vue'
-import { MessageOptions } from '@/types/system/hookComponent'
-// Use vuetify
-import { vuetify } from '@/plugins/vuetify/index'
-
-// Use the createApp of vue3 and the mount and unmount methods to create a mounted instance
-export default function message(options: MessageOptions) {
- const mountNode = document.createElement('div')
- mountNode.className = 'messageItems'
- mountNode.style.top = `${ getNewMsgTop() }px`
- document.body.appendChild(mountNode)
- const app = createApp(MessageComponent, {
- ...options,
- removeComponent: () => {
- setTimeout(() => {
- mountNode.style.opacity = '0'
- setTimeout(() => {
- app.unmount()
- document.body.removeChild(mountNode)
- resetMsgTop()
- }, 200)
- }, options.shutDelay ? options.shutDelay - 200 : 1300)
- }
- }).use(vuetify)
- return app.mount(mountNode)
-}
-
-// Reset message top
-function resetMsgTop() {
- const messageDomList: any = document.body.getElementsByClassName('messageItems')
- for (let i = 0; i < messageDomList.length; i++) {
- messageDomList[i].style.top = `${ getNewMsgTop(i) }px`
- }
-}
-
-// Get message top
-function getNewMsgTop(index = -1) {
- const messageDomList = document.body.querySelectorAll('.messageItems')
- let top = 10
- if (index < 0) {
- for (let i = 0; i < messageDomList.length; i++) {
- top += messageDomList[i].clientHeight + 10
- }
- } else {
- for (let i = 0; i < messageDomList.length; i++) {
- if (i < index) {
- top += messageDomList[i].clientHeight + 10
- } else {
- break
- }
- }
- }
- return top
-}
diff --git a/frontend/src/components/common/hookComponent/message.vue b/frontend/src/components/common/hookComponent/message.vue
deleted file mode 100644
index 320fb99..0000000
--- a/frontend/src/components/common/hookComponent/message.vue
+++ /dev/null
@@ -1,33 +0,0 @@
-<template>
- <v-alert
- :type="type || 'info'"
- :variant="variant || 'flat'"
- :border="border || false"
- :color="color || undefined"
- :width="messageWidth"
- :min-width="250"
- >
- <!-- :max-height="60" -->
- {{ content }}
- </v-alert>
-</template>
-
-<script lang="ts" setup>
-import { onBeforeMount } from 'vue'
-
-// Vue3 does not support external interfaces
-const messageProps = defineProps<{
- type?: 'success' | 'info' | 'warning' | 'error'
- variant?: 'flat' | 'elevated' | 'tonal' | 'outlined' | 'text' | 'plain'
- content: string
- border?: boolean | 'top' | 'end' | 'bottom' | 'start'
- color?: string
- messageWidth?: string | number // message width pixel or percentage
- removeComponent(): void
-}>()
-
-onBeforeMount(() => {
- messageProps.removeComponent()
-})
-</script>
-<style lang="less" scoped></style>
diff --git a/frontend/src/components/common/languages.vue b/frontend/src/components/common/languages.vue
deleted file mode 100644
index 1a989c6..0000000
--- a/frontend/src/components/common/languages.vue
+++ /dev/null
@@ -1,59 +0,0 @@
-<template>
- <div class="languageIcon">
- <v-menu>
- <template #activator="{ props }">
- <v-icon icon="mdi-web" v-bind="props"></v-icon>
- </template>
- <v-list>
- <v-list-item
- v-for="(item, index) in data.languageList"
- :key="index"
- :value="index"
- @click="method.changeLanguage(item.value)"
- >
- <v-list-item-title>{{ item.title }}</v-list-item-title>
- </v-list-item>
- </v-list>
- </v-menu>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { reactive } from 'vue'
-import { useI18n } from 'vue-i18n'
-import { useLocale } from 'vuetify'
-import { getSelcectedLang } from '@/languages/method/index'
-import { getSelcectedLangForVuetify } from '@/plugins/vuetify/method/index'
-import { store } from '@/store'
-
-const { locale } = useI18n()
-const { current } = useLocale()
-
-const data = reactive({
- showLanguage: false,
- languageList: [
- { title: '简体中文', value: 'zh' },
- { title: 'Englist', value: 'en' }
- ]
-})
-
-const method = reactive({
- changeLanguage: (lang: string) => {
- localStorage.setItem('language', lang)
- store.commit('system/setLanguage', lang) // set store
- locale.value = getSelcectedLang(lang) // global
- current.value = getSelcectedLangForVuetify(lang) // vuetify
- }
-})
-</script>
-
-<style lang="less" scoped>
-.languageIcon {
- height: 30px;
- width: 40px;
- font-size: 16px;
- display: flex;
- justify-content: center;
- align-items: center;
-}
-</style>
diff --git a/frontend/src/components/custom-pager.vue b/frontend/src/components/custom-pager.vue
index acc0e4b..bc77704 100644
--- a/frontend/src/components/custom-pager.vue
+++ b/frontend/src/components/custom-pager.vue
@@ -1,112 +1,112 @@
-<template>
- <div class="pagerContainer">
- <v-row>
- <v-col cols="8" class="fl-c">
- <v-pagination
- v-model="data.pageIndex"
- :total-visible="7"
- :length="PAGER_LENGTH"
- size="small"
- rounded="circle"
- :active-color="primaryColor"
- @update:modelValue="method.pageChange"
- ></v-pagination>
- </v-col>
- <v-col cols="2" class="fl-s">
- <v-select
- v-model="data.pageSizeSelect"
- hide-details
- variant="underlined"
- density="compact"
- :items="PAGER_SIZE_OPTION"
- item-title="label"
- item-value="value"
- @update:modelValue="method.changePageSizeSelect"
- ></v-select>
- </v-col>
- <v-col cols="2" class="fl-c">
- <div>{{ TOTAL_RECORD }}</div>
- </v-col>
- </v-row>
- </div>
-</template>
-<script setup lang="ts">
-import { reactive, computed } from 'vue'
-import { PAGE_SIZE, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { primaryColor } from '@/constant/style'
-import i18n from '@/languages/i18n'
-
-const emit = defineEmits(['click', 'page-change'])
-
-const props = defineProps({
- currentPage: {
- type: Number,
- default: 1
- },
- pageSize: {
- type: Number,
- default: DEFAULT_PAGE_SIZE
- },
- total: {
- type: Number,
- default: 0
- },
- pageSizes: {
- type: Array<number>,
- default: PAGE_SIZE
- },
- // !For the time being is not enabled
- layouts: {
- type: Array<string>,
- default: ['PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']
- },
- // !For the time being is not enabled
- perfect: {
- type: Boolean,
- default: false
- }
-})
-
-const data = reactive({
- pageIndex: 1,
- pageSizeSelect: DEFAULT_PAGE_SIZE
-})
-
-const method = reactive({
- pageChange: (currentPage: number) => {
- emit('page-change', { currentPage, pageSize: props.pageSize })
- },
- changePageSizeSelect: (pageSize: number) => {
- emit('page-change', { pageIndex: data.pageIndex, pageSize })
- }
-})
-
-const PAGER_SIZE_OPTION = computed(() => {
- const res = []
- for (const pageSize of props.pageSizes) {
- res.push({ label: `${ pageSize }${ i18n.global.t('system.pager.pageSizes') }`, value: pageSize })
- }
- return res
-})
-const TOTAL_RECORD = computed(() => `${ i18n.global.t('system.pager.total') } ${ props.total } ${ i18n.global.t('system.pager.record') }`)
-const PAGER_LENGTH = computed(() => {
- if (!props.total) {
- return 1
- }
- return Math.ceil(props.total / props.pageSize)
-})
-</script>
-<style lang="less" scoped>
-.pagerContainer {
- color: #666;
-}
-.fl-s{
- display: flex;
- align-items: flex-start;
-}
-.fl-c {
- display: flex;
- align-items: center;
- justify-content: flex-end;
-}
-</style>
+<template>
+ <div class="pagerContainer">
+ <v-row>
+ <v-col cols="8" class="fl-c">
+ <v-pagination
+ v-model="data.pageIndex"
+ :total-visible="7"
+ :length="PAGER_LENGTH"
+ size="small"
+ rounded="circle"
+ :active-color="primaryColor"
+ @update:modelValue="method.pageChange"
+ ></v-pagination>
+ </v-col>
+ <v-col cols="2" class="fl-s">
+ <v-select
+ v-model="data.pageSizeSelect"
+ hide-details
+ variant="underlined"
+ density="compact"
+ :items="PAGER_SIZE_OPTION"
+ item-title="label"
+ item-value="value"
+ @update:modelValue="method.changePageSizeSelect"
+ ></v-select>
+ </v-col>
+ <v-col cols="2" class="fl-c">
+ <div>{{ TOTAL_RECORD }}</div>
+ </v-col>
+ </v-row>
+ </div>
+</template>
+<script setup lang="ts">
+import { reactive, computed } from 'vue'
+import { PAGE_SIZE, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { primaryColor } from '@/constant/style'
+import i18n from '@/languages/i18n'
+
+const emit = defineEmits(['click', 'page-change'])
+
+const props = defineProps({
+ currentPage: {
+ type: Number,
+ default: 1
+ },
+ pageSize: {
+ type: Number,
+ default: DEFAULT_PAGE_SIZE
+ },
+ total: {
+ type: Number,
+ default: 0
+ },
+ pageSizes: {
+ type: Array<number>,
+ default: PAGE_SIZE
+ },
+ // !For the time being is not enabled
+ layouts: {
+ type: Array<string>,
+ default: ['PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']
+ },
+ // !For the time being is not enabled
+ perfect: {
+ type: Boolean,
+ default: false
+ }
+})
+
+const data = reactive({
+ pageIndex: 1,
+ pageSizeSelect: DEFAULT_PAGE_SIZE
+})
+
+const method = reactive({
+ pageChange: (currentPage: number) => {
+ emit('page-change', { currentPage, pageSize: props.pageSize })
+ },
+ changePageSizeSelect: (pageSize: number) => {
+ emit('page-change', { pageIndex: data.pageIndex, pageSize })
+ }
+})
+
+const PAGER_SIZE_OPTION = computed(() => {
+ const res = []
+ for (const pageSize of props.pageSizes) {
+ res.push({ label: `${ pageSize }${ i18n.global.t('system.pager.pageSizes') }`, value: pageSize })
+ }
+ return res
+})
+const TOTAL_RECORD = computed(() => `${ i18n.global.t('system.pager.total') } ${ props.total } ${ i18n.global.t('system.pager.record') }`)
+const PAGER_LENGTH = computed(() => {
+ if (!props.total) {
+ return 1
+ }
+ return Math.ceil(props.total / props.pageSize)
+})
+</script>
+<style lang="less" scoped>
+.pagerContainer {
+ color: #666;
+}
+.fl-s{
+ display: flex;
+ align-items: flex-start;
+}
+.fl-c {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+}
+</style>
diff --git a/frontend/src/components/login/login-form.vue b/frontend/src/components/login/login-form.vue
index d8bdb72..f4f429a 100644
--- a/frontend/src/components/login/login-form.vue
+++ b/frontend/src/components/login/login-form.vue
@@ -1,209 +1,213 @@
-<template>
- <div class="loginForm">
- <div class="titleText">
- <h5>{{ $t('login.welcomeTitle') }}</h5>
- </div>
- <div class="formContainer">
- <v-form ref="VFormRef" v-model="data.valid" lazy-validation @keydown.enter.prevent="method.login()">
- <v-text-field v-model="data.userName" required :rules="data.userNameVaildRules" :label="$t('login.userName')" variant="solo"></v-text-field>
- <v-text-field
- v-model="data.password"
- required
- :rules="data.passwordVaildRules"
- :autocomplete="false"
- :append-inner-icon="data.showPassword ? 'mdi-eye' : 'mdi-eye-off'"
- :type="data.showPassword ? 'text' : 'password'"
- :label="$t('login.password')"
- variant="solo"
- @click:append-inner="method.handleShowPassword()"
- ></v-text-field>
- <v-checkbox v-model="data.remember" :label="$t('login.rememberTips')"></v-checkbox>
- <v-btn color="purple" class="loginBtn" @click="method.login()">{{ $t('login.mainButtonLabel') }}</v-btn>
- <v-btn class="mt-2" color="#666" variant="plain" @click="method.openRegisterDialog">
- {{ i18n.global.t('login.registerTips') }}
- </v-btn>
- </v-form>
- </div>
- <userRegisterForm :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { reactive, ref, onMounted } from 'vue'
-import { Md5 } from 'ts-md5'
-import i18n from '@/languages/i18n'
-import { login, getUserAuthority } from '@/api/sys/login'
-import { store } from '@/store'
-import { hookComponent } from '@/components/system'
-import { router } from '@/router/index'
-import userRegisterForm from './user-register-form.vue'
-
-// Get v-form ref
-const VFormRef = ref()
-
-const data = reactive({
- showDialog: false,
- valid: true,
- showPassword: false,
- userName: '',
- password: '',
- remember: false,
- dialogForm: {
- id: 0,
- user_num: '',
- user_name: '',
- auth_string: '',
- email: '',
- sex: '',
- is_valid: true
- },
- userNameVaildRules: [(v: string) => !!v || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('login.userName') }!`],
- passwordVaildRules: [(v: string) => !!v || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('login.password') }!`]
-})
-
-const method = reactive({
- handleShowPassword: () => {
- data.showPassword = !data.showPassword
- },
- login: async () => {
- const { valid } = await VFormRef.value.validate()
- if (!valid) {
- return
- }
- const { data: loginRes } = await login({
- user_name: data.userName,
- password: Md5.hashStr(data.password)
- })
-
- if (loginRes.isSuccess) {
- const expiredTime = new Date().getTime() + loginRes.data.expire * 60 * 1000
-
- store.commit('user/setToken', loginRes.data.access_token)
- store.commit('user/setRefreshToken', loginRes.data.refresh_token)
- store.commit('user/setExpirationTime', expiredTime)
- store.commit('user/setEffectiveMinutes', loginRes.data.expire)
- store.commit('user/setUserInfo', loginRes.data)
-
- const { data: authorityRes } = await getUserAuthority(loginRes.data.userrole_id)
- if (!authorityRes.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: authorityRes.errorMessage
- })
- return
- }
- if (authorityRes.data.length <= 0) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('login.notAuthority')
- })
- return
- }
- store.commit('user/setUserMenuList', authorityRes.data)
-
- hookComponent.$message({
- type: 'success',
- content: i18n.global.t('login.loginSuccess')
- })
-
- // Remember user login info
- if (data.remember) {
- const rememberJSON = JSON.stringify({
- userName: window.btoa(encodeURIComponent(data.userName)),
- password: window.btoa(encodeURIComponent(data.password))
- })
- localStorage.setItem('userLoginInfo', rememberJSON)
- } else {
- localStorage.setItem('userLoginInfo', '')
- }
- // Jump home
- store.commit('system/setCurrentRouterPath', 'homepage')
- router.push('home')
- } else {
- hookComponent.$message({
- type: 'error',
- content: loginRes.errorMessage
- })
- }
- },
- openRegisterDialog: () => {
- data.dialogForm = {
- id: 0,
- user_num: '',
- user_name: '',
- auth_string: '',
- email: '',
- sex: '',
- is_valid: true
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // after Add or update success.
- saveSuccess: () => {
- method.closeDialog()
- }
-})
-
-onMounted(() => {
- // Get remember username and password
- const rememberJSON = localStorage.getItem('userLoginInfo')
- if (rememberJSON) {
- const obj = JSON.parse(rememberJSON)
- try {
- data.userName = decodeURIComponent(window.atob(obj.userName))
- data.password = decodeURIComponent(window.atob(obj.password))
- } catch {
- data.userName = window.atob(obj.userName)
- data.password = window.atob(obj.password)
- }
- data.remember = true
- }
-})
-</script>
-
-<style scoped lang="less">
-.loginForm {
- // min-height: ;
- height: 50%;
- width: 100%;
- box-sizing: border-box;
- padding: 16px;
- .titleText {
- box-sizing: border-box;
- padding: 20px;
- h5 {
- font-size: 1.5rem !important;
- font-weight: 500;
- line-height: 2rem;
- letter-spacing: normal !important;
- font-family: inter, sans-serif, -apple-system, blinkmacsystemfont, Segoe UI, roboto, Helvetica Neue, arial, sans-serif, 'Apple Color Emoji',
- 'Segoe UI Emoji', Segoe UI Symbol !important;
- text-transform: none !important;
- }
- }
- .formContainer {
- box-sizing: border-box;
- padding: 12px 20px;
- .v-btn {
- width: 100%;
- }
- .v-text-field {
- margin-top: 10px;
- }
- .v-checkbox {
- color: #b2b0b5;
- margin-inline-start: -0.5625rem;
- margin-top: -10px;
- height: 60px;
- }
- }
-}
-
-.loginBtn {
- height: 45px;
-}
-</style>
+<template>
+ <div class="loginForm">
+ <div class="titleText">
+ <h5>{{ $t('login.welcomeTitle') }}</h5>
+ </div>
+ <div class="formContainer">
+ <v-form ref="VFormRef" v-model="data.valid" lazy-validation @keydown.enter.prevent="method.login()">
+ <v-text-field v-model="data.userName" required :rules="data.userNameVaildRules" :label="$t('login.userName')" variant="solo"></v-text-field>
+ <v-text-field
+ v-model="data.password"
+ required
+ :rules="data.passwordVaildRules"
+ :autocomplete="false"
+ :append-inner-icon="data.showPassword ? 'mdi-eye' : 'mdi-eye-off'"
+ :type="data.showPassword ? 'text' : 'password'"
+ :label="$t('login.password')"
+ variant="solo"
+ @click:append-inner="method.handleShowPassword()"
+ ></v-text-field>
+ <v-checkbox v-model="data.remember" :label="$t('login.rememberTips')"></v-checkbox>
+ <v-btn color="purple" class="loginBtn" @click="method.login()">{{ $t('login.mainButtonLabel') }}</v-btn>
+ <v-btn class="mt-2" color="#666" variant="plain" @click="method.openRegisterDialog">
+ {{ i18n.global.t('login.registerTips') }}
+ </v-btn>
+ </v-form>
+ </div>
+ <userRegisterForm :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { reactive, ref, onMounted } from 'vue'
+import { Md5 } from 'ts-md5'
+import i18n from '@/languages/i18n'
+import { login, getUserAuthority } from '@/api/sys/login'
+import { store } from '@/store'
+import { hookComponent } from '@/components/system'
+import { router } from '@/router/index'
+import userRegisterForm from './user-register-form.vue'
+
+// Get v-form ref
+const VFormRef = ref()
+
+const data = reactive({
+ showDialog: false,
+ valid: true,
+ showPassword: false,
+ userName: '',
+ password: '',
+ remember: false,
+ dialogForm: {
+ id: 0,
+ user_num: '',
+ user_name: '',
+ auth_string: '',
+ email: '',
+ sex: '',
+ is_valid: true
+ },
+ userNameVaildRules: [(v: string) => !!v || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('login.userName') }!`],
+ passwordVaildRules: [(v: string) => !!v || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('login.password') }!`]
+})
+
+const method = reactive({
+ handleShowPassword: () => {
+ data.showPassword = !data.showPassword
+ },
+ login: async () => {
+ const { valid } = await VFormRef.value.validate()
+ if (!valid) {
+ return
+ }
+ const { data: loginRes } = await login({
+ user_name: data.userName,
+ password: Md5.hashStr(data.password)
+ })
+
+ if (loginRes.isSuccess) {
+ const expiredTime = new Date().getTime() + loginRes.data.expire * 60 * 1000
+
+ store.commit('user/setToken', loginRes.data.access_token)
+ store.commit('user/setRefreshToken', loginRes.data.refresh_token)
+ store.commit('user/setExpirationTime', expiredTime)
+ store.commit('user/setEffectiveMinutes', loginRes.data.expire)
+ store.commit('user/setUserInfo', loginRes.data)
+
+ const { data: authorityRes } = await getUserAuthority(loginRes.data.userrole_id)
+ if (!authorityRes.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: authorityRes.errorMessage
+ })
+ return
+ }
+ if (authorityRes.data.length <= 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('login.notAuthority')
+ })
+ return
+ }
+ store.commit('user/setUserMenuList', authorityRes.data)
+
+ hookComponent.$message({
+ type: 'success',
+ content: i18n.global.t('login.loginSuccess')
+ })
+
+ // Remember user login info
+ if (data.remember) {
+ const rememberJSON = JSON.stringify({
+ userName: window.btoa(encodeURIComponent(data.userName)),
+ password: window.btoa(encodeURIComponent(data.password))
+ })
+ localStorage.setItem('userLoginInfo', rememberJSON)
+ } else {
+ localStorage.setItem('userLoginInfo', '')
+ }
+ // Jump home
+ store.commit('system/setCurrentRouterPath', 'homepage')
+ router.push('home')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: loginRes.errorMessage
+ })
+ }
+ },
+ openRegisterDialog: () => {
+ data.dialogForm = {
+ id: 0,
+ user_num: '',
+ user_name: '',
+ auth_string: '',
+ email: '',
+ sex: '',
+ is_valid: true
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // after Add or update success.
+ saveSuccess: () => {
+ method.closeDialog()
+ }
+})
+
+onMounted(() => {
+ // Get remember username and password
+ const rememberJSON = localStorage.getItem('userLoginInfo')
+ if (rememberJSON) {
+ const obj = JSON.parse(rememberJSON)
+ try {
+ data.userName = decodeURIComponent(window.atob(obj.userName))
+ data.password = decodeURIComponent(window.atob(obj.password))
+ } catch {
+ data.userName = window.atob(obj.userName)
+ data.password = window.atob(obj.password)
+ }
+ data.remember = true
+ }
+})
+</script>
+
+<style scoped lang="less">
+.loginForm {
+ // min-height: ;
+ height: 50%;
+ width: 100%;
+ box-sizing: border-box;
+ padding: 16px;
+ .titleText {
+ box-sizing: border-box;
+ padding: 20px;
+ h5 {
+ font-size: 1.5rem !important;
+ font-weight: 500;
+ line-height: 2rem;
+ letter-spacing: normal !important;
+ font-family: inter, sans-serif, -apple-system, blinkmacsystemfont, Segoe UI, roboto, Helvetica Neue, arial, sans-serif, 'Apple Color Emoji',
+ 'Segoe UI Emoji', Segoe UI Symbol !important;
+ text-transform: none !important;
+ }
+ }
+ .formContainer {
+ box-sizing: border-box;
+ padding: 12px 20px;
+ .v-btn {
+ width: 100%;
+ }
+ .v-text-field {
+ margin-top: 10px;
+ }
+ .v-checkbox {
+ color: #b2b0b5;
+ margin-inline-start: -0.5625rem;
+ margin-top: -10px;
+ height: 60px;
+ }
+ }
+ // There is style pollution Or vuetify itself has problems, replace the required verification color manually
+ :deep(.v-messages) {
+ color: #b00020 !important;
+ }
+}
+
+.loginBtn {
+ height: 45px;
+}
+</style>
diff --git a/frontend/src/components/login/loginForm.vue b/frontend/src/components/login/loginForm.vue
deleted file mode 100644
index 4e047d7..0000000
--- a/frontend/src/components/login/loginForm.vue
+++ /dev/null
@@ -1,120 +0,0 @@
-<template>
- <div class="loginForm">
- <div class="titleText">
- <h5>{{ $t('login.welcomeTitle') }}</h5>
- </div>
- <div class="formContainer">
- <v-form ref="VFormRef" v-model="data.valid" lazy-validation>
- <v-text-field
- v-model="data.userName"
- required
- :rules="data.userNameVaildRules"
- :label="$t('login.userName')"
- variant="solo"
- ></v-text-field>
- <v-text-field
- v-model="data.password"
- required
- :rules="data.passwordVaildRules"
- :autocomplete="false"
- :append-inner-icon="data.showPassword ? 'mdi-eye' : 'mdi-eye-off'"
- :type="data.showPassword ? 'text' : 'password'"
- :label="$t('login.password')"
- variant="solo"
- @click:append-inner="method.handleShowPassword()"
- ></v-text-field>
- <v-checkbox v-model="data.remember" :label="$t('login.rememberTips')"></v-checkbox>
- <v-btn color="purple" @click="method.login()">{{ $t('login.mainButtonLabel') }}</v-btn>
- </v-form>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { reactive, ref } from 'vue'
-import { Md5 } from 'ts-md5'
-import i18n from '@/languages/i18n'
-import { login } from '@/api/sys/login'
-// import { getNotify } from '@/api/sys/test'
-import { store } from '@/store'
-// import { funComponentList } from '@/components/common/function/index'
-
-// Get v-form ref
-const VFormRef = ref()
-
-const data = reactive({
- valid: true,
- showPassword: false,
- userName: '',
- password: '',
- remember: false,
- userNameVaildRules: [(v: string) => !!v || i18n.global.t('login.userNameMustInput')],
- passwordVaildRules: [(v: string) => !!v || i18n.global.t('login.passwordMustInput')]
-})
-
-const method = reactive({
- handleShowPassword: () => {
- data.showPassword = !data.showPassword
- },
- login: async () => {
- const { valid } = await VFormRef.value.validate()
- if (!valid) {
- return
- }
- const { data: loginRes } = await login({
- userName: data.userName,
- password: Md5.hashStr(data.password)
- })
-
- if (loginRes.isSuccess) {
- // TODO 把用户权限信息加进来
- // let expiredTime = new Date().getTime() + loginRes.data.expire * 60 * 1000
- const expiredTime = new Date().getTime() + 1 * 60 * 1000
-
- store.commit('user/setToken', loginRes.data.accessToken)
- store.commit('user/setRefreshToken', loginRes.data.refreshToken)
- store.commit('user/setExpirationTime', expiredTime)
- store.commit('user/setEffectiveMinutes', loginRes.data.expire)
- }
- }
-})
-</script>
-
-<style scoped lang="less">
-.loginForm {
- // min-height: ;
- height: 50%;
- width: 100%;
- box-sizing: border-box;
- padding: 16px;
- .titleText {
- box-sizing: border-box;
- padding: 20px;
- h5 {
- font-size: 1.5rem !important;
- font-weight: 500;
- line-height: 2rem;
- letter-spacing: normal !important;
- font-family: inter, sans-serif, -apple-system, blinkmacsystemfont, Segoe UI, roboto, Helvetica Neue, arial,
- sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', Segoe UI Symbol !important;
- text-transform: none !important;
- }
- }
- .formContainer {
- box-sizing: border-box;
- padding: 12px 20px;
- .v-btn {
- width: 100%;
- }
- .v-text-field {
- margin-top: 10px;
- }
- .v-checkbox {
- color: #b2b0b5;
- margin-inline-start: -0.5625rem;
- margin-top: -10px;
- height: 60px;
- }
- }
-}
-</style>
diff --git a/frontend/src/components/login/user-register-form.vue b/frontend/src/components/login/user-register-form.vue
index 1f9d491..eb882a7 100644
--- a/frontend/src/components/login/user-register-form.vue
+++ b/frontend/src/components/login/user-register-form.vue
@@ -1,169 +1,169 @@
-<template>
- <v-dialog v-model="isShow" width="20%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('login.register')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.user_name"
- :label="$t('base.userManagement.user_register_name')"
- :rules="data.rules.user_name"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.auth_string"
- :label="$t('base.userManagement.auth_string')"
- :rules="data.rules.auth_string"
- variant="outlined"
- :append-icon="data.isShowPassword ? 'mdi-eye' : 'mdi-eye-off'"
- :type="data.isShowPassword ? 'text' : 'password'"
- @click:append="data.isShowPassword = !data.isShowPassword"
- ></v-text-field>
- <v-select
- v-model="data.form.sex"
- :items="data.combobox.sex"
- item-title="label"
- item-value="value"
- :rules="data.rules.sex"
- :label="$t('base.userManagement.sex')"
- variant="outlined"
- clearable
- ></v-select>
- <v-text-field
- v-model="data.form.email"
- :label="$t('base.userManagement.email')"
- :rules="data.rules.email"
- variant="outlined"
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { Md5 } from 'ts-md5'
-import { UserVO } from '@/types/Base/UserManagement'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { registerUser } from '@/api/base/userManagement'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: UserVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- isShowPassword: false,
- form: ref<UserVO>({
- id: 0,
- user_num: '',
- user_name: '',
- auth_string: '',
- email: '',
- sex: '',
- is_valid: true
- }),
- rules: {
- user_num: [],
- user_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.user_register_name') }!`
- ],
- auth_string: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.auth_string') }!`],
- email: [],
- sex: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.sex') }!`],
- contact_tel: [],
- is_valid: []
- },
- combobox: ref<{
- sex: {
- label: string
- value: string
- }[]
- }>({
- sex: []
- })
-})
-
-const method = reactive({
- // Get the options required by the drop-down box
- getCombobox: () => {
- // Static drop-down box
- const sexOptions = ['male', 'female']
- data.combobox.sex = []
- for (const sex of sexOptions) {
- data.combobox.sex.push({
- label: i18n.global.t(`system.combobox.sex.${ sex }`),
- value: sex
- })
- }
- },
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
-
- if (valid) {
- const form = {
- id: 0,
- user_num: '',
- user_name: data.form.user_name,
- auth_string: Md5.hashStr(data.form.auth_string as string),
- email: data.form.email,
- sex: data.form.sex,
- is_valid: true
- }
-
- const { data: res } = await registerUser(form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.getCombobox()
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" width="20%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('login.register')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.user_name"
+ :label="$t('base.userManagement.user_register_name')"
+ :rules="data.rules.user_name"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.auth_string"
+ :label="$t('base.userManagement.auth_string')"
+ :rules="data.rules.auth_string"
+ variant="outlined"
+ :append-icon="data.isShowPassword ? 'mdi-eye' : 'mdi-eye-off'"
+ :type="data.isShowPassword ? 'text' : 'password'"
+ @click:append="data.isShowPassword = !data.isShowPassword"
+ ></v-text-field>
+ <v-select
+ v-model="data.form.sex"
+ :items="data.combobox.sex"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.sex"
+ :label="$t('base.userManagement.sex')"
+ variant="outlined"
+ clearable
+ ></v-select>
+ <v-text-field
+ v-model="data.form.email"
+ :label="$t('base.userManagement.email')"
+ :rules="data.rules.email"
+ variant="outlined"
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { Md5 } from 'ts-md5'
+import { UserVO } from '@/types/Base/UserManagement'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { registerUser } from '@/api/base/userManagement'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: UserVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ isShowPassword: false,
+ form: ref<UserVO>({
+ id: 0,
+ user_num: '',
+ user_name: '',
+ auth_string: '',
+ email: '',
+ sex: '',
+ is_valid: true
+ }),
+ rules: {
+ user_num: [],
+ user_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.user_register_name') }!`
+ ],
+ auth_string: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.auth_string') }!`],
+ email: [],
+ sex: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.sex') }!`],
+ contact_tel: [],
+ is_valid: []
+ },
+ combobox: ref<{
+ sex: {
+ label: string
+ value: string
+ }[]
+ }>({
+ sex: []
+ })
+})
+
+const method = reactive({
+ // Get the options required by the drop-down box
+ getCombobox: () => {
+ // Static drop-down box
+ const sexOptions = ['male', 'female']
+ data.combobox.sex = []
+ for (const sex of sexOptions) {
+ data.combobox.sex.push({
+ label: i18n.global.t(`system.combobox.sex.${ sex }`),
+ value: sex
+ })
+ }
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+
+ if (valid) {
+ const form = {
+ id: 0,
+ user_num: '',
+ user_name: data.form.user_name,
+ auth_string: Md5.hashStr(data.form.auth_string as string),
+ email: data.form.email,
+ sex: data.form.sex,
+ is_valid: true
+ }
+
+ const { data: res } = await registerUser(form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.getCombobox()
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/components/lottie.vue b/frontend/src/components/lottie.vue
index db06ac5..31add09 100644
--- a/frontend/src/components/lottie.vue
+++ b/frontend/src/components/lottie.vue
@@ -1,40 +1,40 @@
-<template>
- <div ref="lottieBox"></div>
-</template>
-
-<script lang="ts" setup>
-import lottie from 'lottie-web'
-import { onMounted, ref } from 'vue'
-
-const props = defineProps({
- src: {
- type: Object,
- default: () => {}
- },
- path: {
- type: String,
- default: ''
- },
- loop: {
- type: Boolean,
- default: true
- },
- autoplay: {
- type: Boolean,
- default: true
- }
-})
-const lottieBox = ref(null)
-onMounted(() => {
- if (lottieBox.value) {
- lottie.loadAnimation({
- container: lottieBox.value,
- renderer: 'svg',
- loop: props.loop,
- autoplay: props.autoplay,
- path: props.path,
- animationData: Object.keys(props.src).length == 0 ? '' : props.src
- })
- }
-})
-</script>
+<template>
+ <div ref="lottieBox"></div>
+</template>
+
+<script lang="ts" setup>
+import lottie from 'lottie-web'
+import { onMounted, ref } from 'vue'
+
+const props = defineProps({
+ src: {
+ type: Object,
+ default: () => {}
+ },
+ path: {
+ type: String,
+ default: ''
+ },
+ loop: {
+ type: Boolean,
+ default: true
+ },
+ autoplay: {
+ type: Boolean,
+ default: true
+ }
+})
+const lottieBox = ref(null)
+onMounted(() => {
+ if (lottieBox.value) {
+ lottie.loadAnimation({
+ container: lottieBox.value,
+ renderer: 'svg',
+ loop: props.loop,
+ autoplay: props.autoplay,
+ path: props.path,
+ animationData: Object.keys(props.src).length == 0 ? '' : props.src
+ })
+ }
+})
+</script>
diff --git a/frontend/src/components/page/nav-list.vue b/frontend/src/components/page/nav-list.vue
index 21cd49a..7173858 100644
--- a/frontend/src/components/page/nav-list.vue
+++ b/frontend/src/components/page/nav-list.vue
@@ -1,126 +1,126 @@
-<template>
- <div style="height: 100%">
- <!-- title -->
- <div class="nav-list-title">{{ title }}</div>
-
- <!-- list -->
- <div class="nav-list">
- <div
- v-for="(item, index) of listData"
- :key="index"
- class="nav-item"
- :class="[indexValue === String(item[indexKey]) ? 'is-active-item' : '']"
- @click.stop="method.itemClick(item)"
- >
- <div class="nav-item__name">
- {{ item[labelKey] }}
- </div>
- <v-icon v-if="indexValue === String(item[indexKey])" class="nav-item__icon" icon="mdi-menu-left"></v-icon>
- </div>
- </div>
-
- <!-- no data -->
- <div v-if="!listData.length" class="null-data">{{ $t('system.tips.noData') }}</div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { reactive } from 'vue'
-
-const emit = defineEmits(['itemClick'])
-
-const props = defineProps<{
- title: string // Sidebar Title
- listData: any[] // Sidebar Data
- labelKey: string // Key displayed in the sidebar
- // The selected key and value in the sidebar
- // For example, if a List is [{a: 1, b: 2}, {a: 3, b: 4}], I want to activate the row with b=4. Then indexKey=b indexValue=4
- indexKey: string
- indexValue: string
-}>()
-
-const method = reactive({
- itemClick: (item: any) => {
- if (props.indexValue === String(item[props.indexKey])) {
- return
- }
- emit('itemClick', item)
- }
-})
-</script>
-
-<style lang="less" scoped>
-@normal-transition: all 0.2s ease;
-.nav-list-title {
- height: 35px;
- width: 100%;
- box-sizing: border-box;
- padding-left: 10px;
- background-color: #f8f8f9;
- color: #444;
- display: flex;
- justify-content: flex-start;
- align-items: center;
-}
-
-.nav-list {
- height: 100%;
- overflow-y: scroll;
-}
-.nav-list::-webkit-scrollbar {
- display: none;
-}
-
-.nav-item {
- box-sizing: border-box;
- width: 93%;
- min-height: 40px;
- padding: 10px 20px;
- margin: 8px auto;
- transition: @normal-transition;
- border-radius: 5px;
- display: flex;
- justify-content: flex-start;
- align-items: center;
-}
-
-.nav-item:hover {
- cursor: pointer;
- background-color: #e3ecfb;
- transition: @normal-transition;
-}
-
-.nav-item__name {
- width: 80%;
-}
-
-.is-active-item {
- background-color: #e3ecfb;
- color: #9C27B0;
- transition: @normal-transition;
- position: relative;
- // justify-content: space-between;
-
- // .nav-item__name {
- // width: 80%;
- // }
- .nav-item__icon {
- width: 20px;
- position: absolute;
- right: 5px;
- > img {
- width: 15px;
- height: 12px;
- }
- }
-}
-
-.null-data {
- font-size: 12px;
- color: #606266;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
-}
-</style>
+<template>
+ <div style="height: 100%">
+ <!-- title -->
+ <div class="nav-list-title">{{ title }}</div>
+
+ <!-- list -->
+ <div class="nav-list">
+ <div
+ v-for="(item, index) of listData"
+ :key="index"
+ class="nav-item"
+ :class="[indexValue === String(item[indexKey]) ? 'is-active-item' : '']"
+ @click.stop="method.itemClick(item)"
+ >
+ <div class="nav-item__name">
+ {{ item[labelKey] }}
+ </div>
+ <v-icon v-if="indexValue === String(item[indexKey])" class="nav-item__icon" icon="mdi-menu-left"></v-icon>
+ </div>
+ </div>
+
+ <!-- no data -->
+ <div v-if="!listData.length" class="null-data">{{ $t('system.tips.noData') }}</div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { reactive } from 'vue'
+
+const emit = defineEmits(['itemClick'])
+
+const props = defineProps<{
+ title: string // Sidebar Title
+ listData: any[] // Sidebar Data
+ labelKey: string // Key displayed in the sidebar
+ // The selected key and value in the sidebar
+ // For example, if a List is [{a: 1, b: 2}, {a: 3, b: 4}], I want to activate the row with b=4. Then indexKey=b indexValue=4
+ indexKey: string
+ indexValue: string
+}>()
+
+const method = reactive({
+ itemClick: (item: any) => {
+ if (props.indexValue === String(item[props.indexKey])) {
+ return
+ }
+ emit('itemClick', item)
+ }
+})
+</script>
+
+<style lang="less" scoped>
+@normal-transition: all 0.2s ease;
+.nav-list-title {
+ height: 35px;
+ width: 100%;
+ box-sizing: border-box;
+ padding-left: 10px;
+ background-color: #f8f8f9;
+ color: #444;
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+}
+
+.nav-list {
+ height: 100%;
+ overflow-y: scroll;
+}
+.nav-list::-webkit-scrollbar {
+ display: none;
+}
+
+.nav-item {
+ box-sizing: border-box;
+ width: 93%;
+ min-height: 40px;
+ padding: 10px 20px;
+ margin: 8px auto;
+ transition: @normal-transition;
+ border-radius: 5px;
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+}
+
+.nav-item:hover {
+ cursor: pointer;
+ background-color: #e3ecfb;
+ transition: @normal-transition;
+}
+
+.nav-item__name {
+ width: 80%;
+}
+
+.is-active-item {
+ background-color: #e3ecfb;
+ color: #9C27B0;
+ transition: @normal-transition;
+ position: relative;
+ // justify-content: space-between;
+
+ // .nav-item__name {
+ // width: 80%;
+ // }
+ .nav-item__icon {
+ width: 20px;
+ position: absolute;
+ right: 5px;
+ > img {
+ width: 15px;
+ height: 12px;
+ }
+ }
+}
+
+.null-data {
+ font-size: 12px;
+ color: #606266;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+}
+</style>
diff --git a/frontend/src/components/select/commodity-select.vue b/frontend/src/components/select/commodity-select.vue
index bcc2b4e..cc20cff 100644
--- a/frontend/src/components/select/commodity-select.vue
+++ b/frontend/src/components/select/commodity-select.vue
@@ -1,237 +1,237 @@
-<!-- Select Modal -->
-<template>
- <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('wms.stock.stockSelectModal')}`"></v-toolbar>
- <v-card-text>
- <v-row>
- <v-col cols="3">
- <div class="searchForm" :style="{ height: searchFormHeight }">
- <tooltip-btn icon="mdi-refresh" size="x-small" :tooltip-text="$t('system.page.reset')" @click="method.resetForm"></tooltip-btn>
- <tooltip-btn icon="mdi-magnify" size="x-small" :tooltip-text="$t('system.page.confirm')" @click="method.sureSearch"></tooltip-btn>
- <v-form ref="formRef" class="mt-4">
- <v-text-field
- v-model="data.searchForm.warehouse_name"
- :label="$t('wms.stock.warehouse')"
- variant="outlined"
- density="compact"
- hide-details
- clearable
- class="mb-4"
- ></v-text-field>
- <v-text-field
- v-model="data.searchForm.location_name"
- :label="$t('wms.stock.location_name')"
- variant="outlined"
- density="compact"
- hide-details
- clearable
- class="mb-4"
- ></v-text-field>
- <v-text-field
- v-model="data.searchForm.spu_name"
- :label="$t('base.commodityManagement.spu_name')"
- variant="outlined"
- density="compact"
- hide-details
- clearable
- class="mb-4"
- ></v-text-field>
- <v-text-field
- v-model="data.searchForm.sku_code"
- :label="$t('base.commodityManagement.sku_code')"
- variant="outlined"
- density="compact"
- hide-details
- clearable
- class="mb-4"
- ></v-text-field>
- </v-form>
- </div>
- </v-col>
- <v-col cols="9">
- <div class="dataTable">
- <vxe-table
- ref="xTable"
- :column-config="{ minWidth: '100px' }"
- :data="data.tableData"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- align="center"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="warehouse_name" :title="$t('wms.stock.warehouse')"></vxe-column>
- <vxe-column field="location_name" :title="$t('wms.stock.location_name')"></vxe-column>
- <vxe-column field="goods_owner_name" :title="$t('base.ownerOfCargo.goods_owner_name')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('base.commodityManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('base.commodityManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('base.commodityManagement.sku_code')"></vxe-column>
- <vxe-column field="sku_name" :title="$t('base.commodityManagement.sku_name')"></vxe-column>
- <vxe-column field="qty_available" :title="$t('wms.stock.qty_available')"></vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- </v-col>
- </v-row>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.confirm') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-/**
- * @description Select Modal
- * @example
- * <xxx-select :show-dialog="data.showDialogSelect" @close="method.closeDialogSelect" @sureSelect="method.sureSelect" />
- *
- * openSelect: () => {
- data.showDialogSelect = true
- },
- closeDialogSelect: () => {
- data.showDialogSelect = false
- },
- */
-import { reactive, computed, ref, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { hookComponent } from '@/components/system/index'
-import { getStockSelectList } from '@/api/wms/stockManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { SearchObject } from '@/types/System/Form'
-import { computedSelectTableSearchHeight, SYSTEM_HEIGHT } from '@/constant/style'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import customPager from '@/components/custom-pager.vue'
-import i18n from '@/languages/i18n'
-
-const emit = defineEmits(['close', 'sureSelect'])
-const xTable = ref()
-
-const props = defineProps<{
- showDialog: boolean
- sqlTitle?: string
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- tableData: [],
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- searchForm: {
- location_name: '',
- warehouse_name: '',
- spu_name: '',
- sku_code: ''
- },
- timer: ref<any>(null)
-})
-
-const method = reactive({
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getList()
- }),
-
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getList()
- },
-
- getList: async () => {
- const { data: res } = await getStockSelectList({
- ...data.tablePage,
- sqlTitle: props.sqlTitle
- })
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
-
- resetForm: () => {
- // Clear search input
- for (const key in data.searchForm) {
- const str = key as string
- data.searchForm[str as keyof typeof data.searchForm] = ''
- }
-
- // Clear search params
- data.tablePage.searchObjects = []
- },
-
- submit: () => {
- const checkRecords = xTable.value.getCheckboxRecords()
- emit('sureSelect', checkRecords)
- method.closeDialog()
- },
-
- closeDialog: () => {
- emit('close')
- }
-})
-
-const searchFormHeight = computed(() => computedSelectTableSearchHeight({}))
-
-watch(
- () => isShow.value,
- (newVal) => {
- newVal && method.getList()
- }
-)
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.searchForm {
- border: 1px solid #eee;
- box-sizing: border-box;
- padding: 20px;
- overflow: auto;
-}
-</style>
+<!-- Select Modal -->
+<template>
+ <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('wms.stock.stockSelectModal')}`"></v-toolbar>
+ <v-card-text>
+ <v-row>
+ <v-col cols="3">
+ <div class="searchForm" :style="{ height: searchFormHeight }">
+ <tooltip-btn icon="mdi-refresh" size="x-small" :tooltip-text="$t('system.page.reset')" @click="method.resetForm"></tooltip-btn>
+ <tooltip-btn icon="mdi-magnify" size="x-small" :tooltip-text="$t('system.page.confirm')" @click="method.sureSearch"></tooltip-btn>
+ <v-form ref="formRef" class="mt-4">
+ <v-text-field
+ v-model="data.searchForm.warehouse_name"
+ :label="$t('wms.stock.warehouse')"
+ variant="outlined"
+ density="compact"
+ hide-details
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.searchForm.location_name"
+ :label="$t('wms.stock.location_name')"
+ variant="outlined"
+ density="compact"
+ hide-details
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ :label="$t('base.commodityManagement.spu_name')"
+ variant="outlined"
+ density="compact"
+ hide-details
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.searchForm.sku_code"
+ :label="$t('base.commodityManagement.sku_code')"
+ variant="outlined"
+ density="compact"
+ hide-details
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ </v-form>
+ </div>
+ </v-col>
+ <v-col cols="9">
+ <div class="dataTable">
+ <vxe-table
+ ref="xTable"
+ :column-config="{ minWidth: '100px' }"
+ :data="data.tableData"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ align="center"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="warehouse_name" :title="$t('wms.stock.warehouse')"></vxe-column>
+ <vxe-column field="location_name" :title="$t('wms.stock.location_name')"></vxe-column>
+ <vxe-column field="goods_owner_name" :title="$t('base.ownerOfCargo.goods_owner_name')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('base.commodityManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('base.commodityManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('base.commodityManagement.sku_code')"></vxe-column>
+ <vxe-column field="sku_name" :title="$t('base.commodityManagement.sku_name')"></vxe-column>
+ <vxe-column field="qty_available" :title="$t('wms.stock.qty_available')"></vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ </v-col>
+ </v-row>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.confirm') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+/**
+ * @description Select Modal
+ * @example
+ * <xxx-select :show-dialog="data.showDialogSelect" @close="method.closeDialogSelect" @sureSelect="method.sureSelect" />
+ *
+ * openSelect: () => {
+ data.showDialogSelect = true
+ },
+ closeDialogSelect: () => {
+ data.showDialogSelect = false
+ },
+ */
+import { reactive, computed, ref, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { hookComponent } from '@/components/system/index'
+import { getStockSelectList } from '@/api/wms/stockManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { SearchObject } from '@/types/System/Form'
+import { computedSelectTableSearchHeight, SYSTEM_HEIGHT } from '@/constant/style'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import customPager from '@/components/custom-pager.vue'
+import i18n from '@/languages/i18n'
+
+const emit = defineEmits(['close', 'sureSelect'])
+const xTable = ref()
+
+const props = defineProps<{
+ showDialog: boolean
+ sqlTitle?: string
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ tableData: [],
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ searchForm: {
+ location_name: '',
+ warehouse_name: '',
+ spu_name: '',
+ sku_code: ''
+ },
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getList()
+ }),
+
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getList()
+ },
+
+ getList: async () => {
+ const { data: res } = await getStockSelectList({
+ ...data.tablePage,
+ sqlTitle: props.sqlTitle
+ })
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+
+ resetForm: () => {
+ // Clear search input
+ for (const key in data.searchForm) {
+ const str = key as string
+ data.searchForm[str as keyof typeof data.searchForm] = ''
+ }
+
+ // Clear search params
+ data.tablePage.searchObjects = []
+ },
+
+ submit: () => {
+ const checkRecords = xTable.value.getCheckboxRecords()
+ emit('sureSelect', checkRecords)
+ method.closeDialog()
+ },
+
+ closeDialog: () => {
+ emit('close')
+ }
+})
+
+const searchFormHeight = computed(() => computedSelectTableSearchHeight({}))
+
+watch(
+ () => isShow.value,
+ (newVal) => {
+ newVal && method.getList()
+ }
+)
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.searchForm {
+ border: 1px solid #eee;
+ box-sizing: border-box;
+ padding: 20px;
+ overflow: auto;
+}
+</style>
diff --git a/frontend/src/components/select/freight-select.vue b/frontend/src/components/select/freight-select.vue
index 5e1d409..da760af 100644
--- a/frontend/src/components/select/freight-select.vue
+++ b/frontend/src/components/select/freight-select.vue
@@ -1,229 +1,229 @@
-<!-- Select Modal -->
-<template>
- <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('base.freightSetting.freightSelectModal')}`"></v-toolbar>
- <v-card-text>
- <v-row>
- <v-col cols="3">
- <div class="searchForm" :style="{ height: searchFormHeight }">
- <tooltip-btn icon="mdi-refresh" size="x-small" :tooltip-text="$t('system.page.reset')" @click="method.resetForm"></tooltip-btn>
- <tooltip-btn icon="mdi-magnify" size="x-small" :tooltip-text="$t('system.page.confirm')" @click="method.sureSearch"></tooltip-btn>
- <v-form ref="formRef" class="mt-4">
- <v-text-field
- v-model="data.searchForm.carrier"
- :label="$t('base.freightSetting.carrier')"
- variant="outlined"
- density="compact"
- hide-details
- clearable
- class="mb-4"
- ></v-text-field>
- <v-text-field
- v-model="data.searchForm.departure_city"
- :label="$t('base.freightSetting.departure_city')"
- variant="outlined"
- density="compact"
- hide-details
- clearable
- class="mb-4"
- ></v-text-field>
- <v-text-field
- v-model="data.searchForm.arrival_city"
- :label="$t('base.freightSetting.arrival_city')"
- variant="outlined"
- density="compact"
- hide-details
- clearable
- class="mb-4"
- ></v-text-field>
- </v-form>
- </div>
- </v-col>
- <v-col cols="9">
- <div class="dataTable">
- <vxe-table
- ref="xTable"
- :column-config="{ minWidth: '100px' }"
- :data="data.tableData"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- align="center"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="carrier" :title="$t('base.freightSetting.carrier')"></vxe-column>
- <vxe-column field="departure_city" :title="$t('base.freightSetting.departure_city')"></vxe-column>
- <vxe-column field="arrival_city" :title="$t('base.freightSetting.arrival_city')"></vxe-column>
- <vxe-column field="price_per_weight" :title="$t('base.freightSetting.price_per_weight')"></vxe-column>
- <vxe-column field="price_per_volume" :title="$t('base.freightSetting.price_per_volume')"></vxe-column>
- <vxe-column field="min_payment" :title="$t('base.freightSetting.min_payment')"></vxe-column>
- <vxe-column field="creator" :title="$t('base.freightSetting.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('base.freightSetting.create_time')"></vxe-column>
- <vxe-column field="is_valid" :title="$t('base.warehouseSetting.is_valid')">
- <template #default="{ row, column }">
- <span>{{ formatIsValid(row[column.property]) }}</span>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- </v-col>
- </v-row>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.confirm') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-/**
- * @description Select Modal
- * @example
- * <xxx-select :show-dialog="data.showDialogSelect" @close="method.closeDialogSelect" @sureSelect="method.sureSelect" />
- *
- * openSelect: () => {
- data.showDialogSelect = true
- },
- closeDialogSelect: () => {
- data.showDialogSelect = false
- },
- */
-import { reactive, computed, ref, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { hookComponent } from '@/components/system/index'
-import { getFreightList } from '@/api/base/freightSetting'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { formatIsValid } from '@/utils/format/formatSystem'
-import { SearchObject } from '@/types/System/Form'
-import { computedSelectTableSearchHeight, SYSTEM_HEIGHT } from '@/constant/style'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import customPager from '@/components/custom-pager.vue'
-import i18n from '@/languages/i18n'
-
-const emit = defineEmits(['close', 'sureSelect'])
-const xTable = ref()
-
-const props = defineProps<{
- showDialog: boolean
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- tableData: [],
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- searchForm: {
- carrier: '',
- departure_city: '',
- arrival_city: ''
- },
- timer: ref<any>(null)
-})
-
-const method = reactive({
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getList()
- }),
-
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getList()
- },
-
- getList: async () => {
- const { data: res } = await getFreightList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
-
- resetForm: () => {
- // Clear search input
- for (const key in data.searchForm) {
- const str = key as string
- data.searchForm[str as keyof typeof data.searchForm] = ''
- }
-
- // Clear search params
- data.tablePage.searchObjects = []
- },
-
- submit: () => {
- const checkRecords = xTable.value.getCheckboxRecords()
- emit('sureSelect', checkRecords)
- method.closeDialog()
- },
-
- closeDialog: () => {
- emit('close')
- }
-})
-
-const searchFormHeight = computed(() => computedSelectTableSearchHeight({}))
-
-watch(
- () => isShow.value,
- (newVal) => {
- newVal && method.getList()
- }
-)
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.searchForm {
- border: 1px solid #eee;
- box-sizing: border-box;
- padding: 20px;
- overflow: auto;
-}
-</style>
+<!-- Select Modal -->
+<template>
+ <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('base.freightSetting.freightSelectModal')}`"></v-toolbar>
+ <v-card-text>
+ <v-row>
+ <v-col cols="3">
+ <div class="searchForm" :style="{ height: searchFormHeight }">
+ <tooltip-btn icon="mdi-refresh" size="x-small" :tooltip-text="$t('system.page.reset')" @click="method.resetForm"></tooltip-btn>
+ <tooltip-btn icon="mdi-magnify" size="x-small" :tooltip-text="$t('system.page.confirm')" @click="method.sureSearch"></tooltip-btn>
+ <v-form ref="formRef" class="mt-4">
+ <v-text-field
+ v-model="data.searchForm.carrier"
+ :label="$t('base.freightSetting.carrier')"
+ variant="outlined"
+ density="compact"
+ hide-details
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.searchForm.departure_city"
+ :label="$t('base.freightSetting.departure_city')"
+ variant="outlined"
+ density="compact"
+ hide-details
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.searchForm.arrival_city"
+ :label="$t('base.freightSetting.arrival_city')"
+ variant="outlined"
+ density="compact"
+ hide-details
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ </v-form>
+ </div>
+ </v-col>
+ <v-col cols="9">
+ <div class="dataTable">
+ <vxe-table
+ ref="xTable"
+ :column-config="{ minWidth: '100px' }"
+ :data="data.tableData"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ align="center"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="carrier" :title="$t('base.freightSetting.carrier')"></vxe-column>
+ <vxe-column field="departure_city" :title="$t('base.freightSetting.departure_city')"></vxe-column>
+ <vxe-column field="arrival_city" :title="$t('base.freightSetting.arrival_city')"></vxe-column>
+ <vxe-column field="price_per_weight" :title="$t('base.freightSetting.price_per_weight')"></vxe-column>
+ <vxe-column field="price_per_volume" :title="$t('base.freightSetting.price_per_volume')"></vxe-column>
+ <vxe-column field="min_payment" :title="$t('base.freightSetting.min_payment')"></vxe-column>
+ <vxe-column field="creator" :title="$t('base.freightSetting.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('base.freightSetting.create_time')"></vxe-column>
+ <vxe-column field="is_valid" :title="$t('base.warehouseSetting.is_valid')">
+ <template #default="{ row, column }">
+ <span>{{ formatIsValid(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ </v-col>
+ </v-row>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.confirm') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+/**
+ * @description Select Modal
+ * @example
+ * <xxx-select :show-dialog="data.showDialogSelect" @close="method.closeDialogSelect" @sureSelect="method.sureSelect" />
+ *
+ * openSelect: () => {
+ data.showDialogSelect = true
+ },
+ closeDialogSelect: () => {
+ data.showDialogSelect = false
+ },
+ */
+import { reactive, computed, ref, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { hookComponent } from '@/components/system/index'
+import { getFreightList } from '@/api/base/freightSetting'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { formatIsValid } from '@/utils/format/formatSystem'
+import { SearchObject } from '@/types/System/Form'
+import { computedSelectTableSearchHeight, SYSTEM_HEIGHT } from '@/constant/style'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import customPager from '@/components/custom-pager.vue'
+import i18n from '@/languages/i18n'
+
+const emit = defineEmits(['close', 'sureSelect'])
+const xTable = ref()
+
+const props = defineProps<{
+ showDialog: boolean
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ tableData: [],
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ searchForm: {
+ carrier: '',
+ departure_city: '',
+ arrival_city: ''
+ },
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getList()
+ }),
+
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getList()
+ },
+
+ getList: async () => {
+ const { data: res } = await getFreightList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+
+ resetForm: () => {
+ // Clear search input
+ for (const key in data.searchForm) {
+ const str = key as string
+ data.searchForm[str as keyof typeof data.searchForm] = ''
+ }
+
+ // Clear search params
+ data.tablePage.searchObjects = []
+ },
+
+ submit: () => {
+ const checkRecords = xTable.value.getCheckboxRecords()
+ emit('sureSelect', checkRecords)
+ method.closeDialog()
+ },
+
+ closeDialog: () => {
+ emit('close')
+ }
+})
+
+const searchFormHeight = computed(() => computedSelectTableSearchHeight({}))
+
+watch(
+ () => isShow.value,
+ (newVal) => {
+ newVal && method.getList()
+ }
+)
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.searchForm {
+ border: 1px solid #eee;
+ box-sizing: border-box;
+ padding: 20px;
+ overflow: auto;
+}
+</style>
diff --git a/frontend/src/components/select/location-select.vue b/frontend/src/components/select/location-select.vue
index 85b7580..98b394d 100644
--- a/frontend/src/components/select/location-select.vue
+++ b/frontend/src/components/select/location-select.vue
@@ -1,219 +1,219 @@
-<!-- Select Modal -->
-<template>
- <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('base.warehouseSetting.locationSelectModal')}`"></v-toolbar>
- <v-card-text>
- <v-row>
- <v-col cols="3">
- <div class="searchForm" :style="{ height: searchFormHeight }">
- <tooltip-btn icon="mdi-refresh" size="x-small" :tooltip-text="$t('system.page.reset')" @click="method.resetForm"></tooltip-btn>
- <tooltip-btn icon="mdi-magnify" size="x-small" :tooltip-text="$t('system.page.confirm')" @click="method.sureSearch"></tooltip-btn>
- <v-form ref="formRef" class="mt-4">
- <v-text-field
- v-model="data.searchForm.location_name"
- :label="$t('base.warehouseSetting.location_name')"
- variant="outlined"
- density="compact"
- hide-details
- clearable
- class="mb-4"
- ></v-text-field>
- </v-form>
- </div>
- </v-col>
- <v-col cols="9">
- <div class="dataTable">
- <vxe-table
- ref="xTable"
- :column-config="{ minWidth: '100px' }"
- :data="data.tableData"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- align="center"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="warehouse_name" :title="$t('base.warehouseSetting.warehouse_name')"></vxe-column>
- <vxe-column field="warehouse_area_name" :title="$t('base.warehouseSetting.area_name')"></vxe-column>
- <vxe-column field="warehouse_area_property" :title="$t('base.warehouseSetting.area_property')">
- <template #default="{ row, column }">
- <span>{{ formatAreaProperty(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="location_name" :title="$t('base.warehouseSetting.location_name')"></vxe-column>
- <vxe-column width="150px" field="location_length" :title="$t('base.warehouseSetting.location_length')"></vxe-column>
- <vxe-column width="150px" field="location_width" :title="$t('base.warehouseSetting.location_width')"></vxe-column>
- <vxe-column width="150px" field="location_heigth" :title="$t('base.warehouseSetting.location_heigth')"></vxe-column>
- <vxe-column width="150px" field="location_volume" :title="$t('base.warehouseSetting.location_volume')"></vxe-column>
- <vxe-column width="150px" field="location_load" :title="$t('base.warehouseSetting.location_load')"></vxe-column>
- <vxe-column field="roadway_number" :title="$t('base.warehouseSetting.roadway_number')"></vxe-column>
- <vxe-column field="shelf_number" :title="$t('base.warehouseSetting.shelf_number')"></vxe-column>
- <vxe-column field="layer_number" :title="$t('base.warehouseSetting.layer_number')"></vxe-column>
- <vxe-column field="tag_number" :title="$t('base.warehouseSetting.tag_number')"></vxe-column>
- <vxe-column field="is_valid" :title="$t('base.warehouseSetting.is_valid')">
- <template #default="{ row, column }">
- <span>{{ formatIsValid(row[column.property]) }}</span>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- </v-col>
- </v-row>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.confirm') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-/**
- * @description Select Modal
- * @example
- * <xxx-select :show-dialog="data.showDialogSelect" @close="method.closeDialogSelect" @sureSelect="method.sureSelect" />
- *
- * openSelect: () => {
- data.showDialogSelect = true
- },
- closeDialogSelect: () => {
- data.showDialogSelect = false
- },
- */
-import { reactive, computed, ref, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { hookComponent } from '@/components/system/index'
-import { getGoodsLocationList } from '@/api/base/warehouseSetting'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { formatIsValid } from '@/utils/format/formatSystem'
-import { formatAreaProperty } from '@/utils/format/formatWarehouse'
-import { SearchObject } from '@/types/System/Form'
-import { computedSelectTableSearchHeight, SYSTEM_HEIGHT } from '@/constant/style'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import customPager from '@/components/custom-pager.vue'
-import i18n from '@/languages/i18n'
-
-const emit = defineEmits(['close', 'sureSelect'])
-const xTable = ref()
-
-const props = defineProps<{
- showDialog: boolean
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- tableData: [],
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- searchForm: {
- location_name: ''
- },
- timer: ref<any>(null)
-})
-
-const method = reactive({
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getList()
- }),
-
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getList()
- },
-
- getList: async () => {
- const { data: res } = await getGoodsLocationList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
-
- resetForm: () => {
- // Clear search input
- for (const key in data.searchForm) {
- const str = key as string
- data.searchForm[str as keyof typeof data.searchForm] = ''
- }
-
- // Clear search params
- data.tablePage.searchObjects = []
- },
-
- submit: () => {
- const checkRecords = xTable.value.getCheckboxRecords()
- emit('sureSelect', checkRecords)
- method.closeDialog()
- },
-
- closeDialog: () => {
- emit('close')
- }
-})
-
-const searchFormHeight = computed(() => computedSelectTableSearchHeight({}))
-
-watch(
- () => isShow.value,
- (newVal) => {
- newVal && method.getList()
- }
-)
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.searchForm {
- border: 1px solid #eee;
- box-sizing: border-box;
- padding: 20px;
- overflow: auto;
-}
-</style>
+<!-- Select Modal -->
+<template>
+ <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('base.warehouseSetting.locationSelectModal')}`"></v-toolbar>
+ <v-card-text>
+ <v-row>
+ <v-col cols="3">
+ <div class="searchForm" :style="{ height: searchFormHeight }">
+ <tooltip-btn icon="mdi-refresh" size="x-small" :tooltip-text="$t('system.page.reset')" @click="method.resetForm"></tooltip-btn>
+ <tooltip-btn icon="mdi-magnify" size="x-small" :tooltip-text="$t('system.page.confirm')" @click="method.sureSearch"></tooltip-btn>
+ <v-form ref="formRef" class="mt-4">
+ <v-text-field
+ v-model="data.searchForm.location_name"
+ :label="$t('base.warehouseSetting.location_name')"
+ variant="outlined"
+ density="compact"
+ hide-details
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ </v-form>
+ </div>
+ </v-col>
+ <v-col cols="9">
+ <div class="dataTable">
+ <vxe-table
+ ref="xTable"
+ :column-config="{ minWidth: '100px' }"
+ :data="data.tableData"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ align="center"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="warehouse_name" :title="$t('base.warehouseSetting.warehouse_name')"></vxe-column>
+ <vxe-column field="warehouse_area_name" :title="$t('base.warehouseSetting.area_name')"></vxe-column>
+ <vxe-column field="warehouse_area_property" :title="$t('base.warehouseSetting.area_property')">
+ <template #default="{ row, column }">
+ <span>{{ formatAreaProperty(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="location_name" :title="$t('base.warehouseSetting.location_name')"></vxe-column>
+ <vxe-column width="150px" field="location_length" :title="$t('base.warehouseSetting.location_length')"></vxe-column>
+ <vxe-column width="150px" field="location_width" :title="$t('base.warehouseSetting.location_width')"></vxe-column>
+ <vxe-column width="150px" field="location_heigth" :title="$t('base.warehouseSetting.location_heigth')"></vxe-column>
+ <vxe-column width="150px" field="location_volume" :title="$t('base.warehouseSetting.location_volume')"></vxe-column>
+ <vxe-column width="150px" field="location_load" :title="$t('base.warehouseSetting.location_load')"></vxe-column>
+ <vxe-column field="roadway_number" :title="$t('base.warehouseSetting.roadway_number')"></vxe-column>
+ <vxe-column field="shelf_number" :title="$t('base.warehouseSetting.shelf_number')"></vxe-column>
+ <vxe-column field="layer_number" :title="$t('base.warehouseSetting.layer_number')"></vxe-column>
+ <vxe-column field="tag_number" :title="$t('base.warehouseSetting.tag_number')"></vxe-column>
+ <vxe-column field="is_valid" :title="$t('base.warehouseSetting.is_valid')">
+ <template #default="{ row, column }">
+ <span>{{ formatIsValid(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ </v-col>
+ </v-row>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.confirm') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+/**
+ * @description Select Modal
+ * @example
+ * <xxx-select :show-dialog="data.showDialogSelect" @close="method.closeDialogSelect" @sureSelect="method.sureSelect" />
+ *
+ * openSelect: () => {
+ data.showDialogSelect = true
+ },
+ closeDialogSelect: () => {
+ data.showDialogSelect = false
+ },
+ */
+import { reactive, computed, ref, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { hookComponent } from '@/components/system/index'
+import { getGoodsLocationList } from '@/api/base/warehouseSetting'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { formatIsValid } from '@/utils/format/formatSystem'
+import { formatAreaProperty } from '@/utils/format/formatWarehouse'
+import { SearchObject } from '@/types/System/Form'
+import { computedSelectTableSearchHeight, SYSTEM_HEIGHT } from '@/constant/style'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import customPager from '@/components/custom-pager.vue'
+import i18n from '@/languages/i18n'
+
+const emit = defineEmits(['close', 'sureSelect'])
+const xTable = ref()
+
+const props = defineProps<{
+ showDialog: boolean
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ tableData: [],
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ searchForm: {
+ location_name: ''
+ },
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getList()
+ }),
+
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getList()
+ },
+
+ getList: async () => {
+ const { data: res } = await getGoodsLocationList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+
+ resetForm: () => {
+ // Clear search input
+ for (const key in data.searchForm) {
+ const str = key as string
+ data.searchForm[str as keyof typeof data.searchForm] = ''
+ }
+
+ // Clear search params
+ data.tablePage.searchObjects = []
+ },
+
+ submit: () => {
+ const checkRecords = xTable.value.getCheckboxRecords()
+ emit('sureSelect', checkRecords)
+ method.closeDialog()
+ },
+
+ closeDialog: () => {
+ emit('close')
+ }
+})
+
+const searchFormHeight = computed(() => computedSelectTableSearchHeight({}))
+
+watch(
+ () => isShow.value,
+ (newVal) => {
+ newVal && method.getList()
+ }
+)
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.searchForm {
+ border: 1px solid #eee;
+ box-sizing: border-box;
+ padding: 20px;
+ overflow: auto;
+}
+</style>
diff --git a/frontend/src/components/select/sku-select.vue b/frontend/src/components/select/sku-select.vue
index 47c4544..c2edc2c 100644
--- a/frontend/src/components/select/sku-select.vue
+++ b/frontend/src/components/select/sku-select.vue
@@ -1,216 +1,216 @@
-<!-- Select Modal -->
-<template>
- <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('wms.stock.skuSelectModal')}`"></v-toolbar>
- <v-card-text>
- <v-row>
- <v-col cols="3">
- <div class="searchForm" :style="{ height: searchFormHeight }">
- <tooltip-btn icon="mdi-refresh" size="x-small" :tooltip-text="$t('system.page.reset')" @click="method.resetForm"></tooltip-btn>
- <tooltip-btn icon="mdi-magnify" size="x-small" :tooltip-text="$t('system.page.confirm')" @click="method.sureSearch"></tooltip-btn>
- <v-form ref="formRef" class="mt-4">
- <v-text-field
- v-model="data.searchForm.spu_name"
- :label="$t('base.commodityManagement.spu_name')"
- variant="outlined"
- density="compact"
- hide-details
- clearable
- class="mb-4"
- ></v-text-field>
- <v-text-field
- v-model="data.searchForm.sku_code"
- :label="$t('base.commodityManagement.sku_code')"
- variant="outlined"
- density="compact"
- hide-details
- clearable
- class="mb-4"
- ></v-text-field>
- </v-form>
- </div>
- </v-col>
- <v-col cols="9">
- <div class="dataTable">
- <vxe-table
- ref="xTable"
- :column-config="{ minWidth: '100px' }"
- :data="data.tableData"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- align="center"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="spu_code" :title="$t('base.commodityManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('base.commodityManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('base.commodityManagement.sku_code')"></vxe-column>
- <vxe-column field="sku_name" :title="$t('base.commodityManagement.sku_name')"></vxe-column>
- <vxe-column field="supplier_name" :title="$t('base.commodityManagement.supplier_name')"></vxe-column>
- <vxe-column field="brand" :title="$t('base.commodityManagement.brand')"></vxe-column>
- <vxe-column field="origin" :title="$t('base.commodityManagement.origin')"></vxe-column>
- <vxe-column field="unit" :title="$t('base.commodityManagement.unit')"></vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- </v-col>
- </v-row>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.confirm') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-/**
- * @description Select Modal
- * @example
- * <xxx-select :show-dialog="data.showDialogSelect" @close="method.closeDialogSelect" @sureSelect="method.sureSelect" />
- *
- * openSelect: () => {
- data.showDialogSelect = true
- },
- closeDialogSelect: () => {
- data.showDialogSelect = false
- },
- */
-import { reactive, computed, ref, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { hookComponent } from '@/components/system/index'
-import { getSkuSelectList } from '@/api/wms/stockManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { formatIsValid } from '@/utils/format/formatSystem'
-import { formatAreaProperty } from '@/utils/format/formatWarehouse'
-import { SearchObject } from '@/types/System/Form'
-import { computedSelectTableSearchHeight, SYSTEM_HEIGHT } from '@/constant/style'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import customPager from '@/components/custom-pager.vue'
-import i18n from '@/languages/i18n'
-
-const emit = defineEmits(['close', 'sureSelect'])
-const xTable = ref()
-
-const props = defineProps<{
- showDialog: boolean
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- tableData: [],
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- searchForm: {
- location_name: '',
- spu_name: '',
- sku_code: ''
- },
- timer: ref<any>(null)
-})
-
-const method = reactive({
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getList()
- }),
-
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getList()
- },
-
- getList: async () => {
- const { data: res } = await getSkuSelectList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
-
- resetForm: () => {
- // Clear search input
- for (const key in data.searchForm) {
- const str = key as string
- data.searchForm[str as keyof typeof data.searchForm] = ''
- }
-
- // Clear search params
- data.tablePage.searchObjects = []
- },
-
- submit: () => {
- const checkRecords = xTable.value.getCheckboxRecords()
- emit('sureSelect', checkRecords)
- method.closeDialog()
- },
-
- closeDialog: () => {
- emit('close')
- }
-})
-
-const searchFormHeight = computed(() => computedSelectTableSearchHeight({}))
-
-watch(
- () => isShow.value,
- (newVal) => {
- newVal && method.getList()
- }
-)
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.searchForm {
- border: 1px solid #eee;
- box-sizing: border-box;
- padding: 20px;
- overflow: auto;
-}
-</style>
+<!-- Select Modal -->
+<template>
+ <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('wms.stock.skuSelectModal')}`"></v-toolbar>
+ <v-card-text>
+ <v-row>
+ <v-col cols="3">
+ <div class="searchForm" :style="{ height: searchFormHeight }">
+ <tooltip-btn icon="mdi-refresh" size="x-small" :tooltip-text="$t('system.page.reset')" @click="method.resetForm"></tooltip-btn>
+ <tooltip-btn icon="mdi-magnify" size="x-small" :tooltip-text="$t('system.page.confirm')" @click="method.sureSearch"></tooltip-btn>
+ <v-form ref="formRef" class="mt-4">
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ :label="$t('base.commodityManagement.spu_name')"
+ variant="outlined"
+ density="compact"
+ hide-details
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.searchForm.sku_code"
+ :label="$t('base.commodityManagement.sku_code')"
+ variant="outlined"
+ density="compact"
+ hide-details
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ </v-form>
+ </div>
+ </v-col>
+ <v-col cols="9">
+ <div class="dataTable">
+ <vxe-table
+ ref="xTable"
+ :column-config="{ minWidth: '100px' }"
+ :data="data.tableData"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ align="center"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('base.commodityManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('base.commodityManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('base.commodityManagement.sku_code')"></vxe-column>
+ <vxe-column field="sku_name" :title="$t('base.commodityManagement.sku_name')"></vxe-column>
+ <vxe-column field="supplier_name" :title="$t('base.commodityManagement.supplier_name')"></vxe-column>
+ <vxe-column field="brand" :title="$t('base.commodityManagement.brand')"></vxe-column>
+ <vxe-column field="origin" :title="$t('base.commodityManagement.origin')"></vxe-column>
+ <vxe-column field="unit" :title="$t('base.commodityManagement.unit')"></vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ </v-col>
+ </v-row>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.confirm') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+/**
+ * @description Select Modal
+ * @example
+ * <xxx-select :show-dialog="data.showDialogSelect" @close="method.closeDialogSelect" @sureSelect="method.sureSelect" />
+ *
+ * openSelect: () => {
+ data.showDialogSelect = true
+ },
+ closeDialogSelect: () => {
+ data.showDialogSelect = false
+ },
+ */
+import { reactive, computed, ref, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { hookComponent } from '@/components/system/index'
+import { getSkuSelectList } from '@/api/wms/stockManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { formatIsValid } from '@/utils/format/formatSystem'
+import { formatAreaProperty } from '@/utils/format/formatWarehouse'
+import { SearchObject } from '@/types/System/Form'
+import { computedSelectTableSearchHeight, SYSTEM_HEIGHT } from '@/constant/style'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import customPager from '@/components/custom-pager.vue'
+import i18n from '@/languages/i18n'
+
+const emit = defineEmits(['close', 'sureSelect'])
+const xTable = ref()
+
+const props = defineProps<{
+ showDialog: boolean
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ tableData: [],
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ searchForm: {
+ location_name: '',
+ spu_name: '',
+ sku_code: ''
+ },
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getList()
+ }),
+
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getList()
+ },
+
+ getList: async () => {
+ const { data: res } = await getSkuSelectList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+
+ resetForm: () => {
+ // Clear search input
+ for (const key in data.searchForm) {
+ const str = key as string
+ data.searchForm[str as keyof typeof data.searchForm] = ''
+ }
+
+ // Clear search params
+ data.tablePage.searchObjects = []
+ },
+
+ submit: () => {
+ const checkRecords = xTable.value.getCheckboxRecords()
+ emit('sureSelect', checkRecords)
+ method.closeDialog()
+ },
+
+ closeDialog: () => {
+ emit('close')
+ }
+})
+
+const searchFormHeight = computed(() => computedSelectTableSearchHeight({}))
+
+watch(
+ () => isShow.value,
+ (newVal) => {
+ newVal && method.getList()
+ }
+)
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.searchForm {
+ border: 1px solid #eee;
+ box-sizing: border-box;
+ padding: 20px;
+ overflow: auto;
+}
+</style>
diff --git a/frontend/src/components/system/hookComponent/dialog.ts b/frontend/src/components/system/hookComponent/dialog.ts
index cce6530..666e39b 100644
--- a/frontend/src/components/system/hookComponent/dialog.ts
+++ b/frontend/src/components/system/hookComponent/dialog.ts
@@ -1,34 +1,34 @@
-import { createApp } from 'vue'
-import DialogComponent from './dialog.vue'
-import { DialogOptions } from '@/types/System/HookComponent'
-// Use vuetify
-import { vuetify } from '@/plugins/vuetify/index'
-import i18n from '@/languages/i18n'
-
-// Use the createApp of vue3 and the mount and unmount methods to create a mounted instance
-export default {
- name: 'dialog',
- dialog: (options: DialogOptions) => {
- const mountNode = document.createElement('div')
- mountNode.style.zIndex = '9000'
- document.body.appendChild(mountNode)
- if (!options.confirmText) {
- options.confirmText = i18n.global.t('system.hookComponent.dialog.defaultConfirm')
- }
- if (!options.cancleText) {
- options.cancleText = i18n.global.t('system.hookComponent.dialog.defaultClose')
- }
- if (!options.title) {
- options.title = i18n.global.t('system.hookComponent.dialog.defaultTitle')
- }
- const app = createApp(DialogComponent, {
- ...options,
- visible: true,
- removeComponent: () => {
- app.unmount()
- document.body.removeChild(mountNode)
- }
- }).use(vuetify)
- return app.mount(mountNode)
- }
-}
+import { createApp } from 'vue'
+import DialogComponent from './dialog.vue'
+import { DialogOptions } from '@/types/System/HookComponent'
+// Use vuetify
+import { vuetify } from '@/plugins/vuetify/index'
+import i18n from '@/languages/i18n'
+
+// Use the createApp of vue3 and the mount and unmount methods to create a mounted instance
+export default {
+ name: 'dialog',
+ dialog: (options: DialogOptions) => {
+ const mountNode = document.createElement('div')
+ mountNode.style.zIndex = '9000'
+ document.body.appendChild(mountNode)
+ if (!options.confirmText) {
+ options.confirmText = i18n.global.t('system.hookComponent.dialog.defaultConfirm')
+ }
+ if (!options.cancleText) {
+ options.cancleText = i18n.global.t('system.hookComponent.dialog.defaultClose')
+ }
+ if (!options.title) {
+ options.title = i18n.global.t('system.hookComponent.dialog.defaultTitle')
+ }
+ const app = createApp(DialogComponent, {
+ ...options,
+ visible: true,
+ removeComponent: () => {
+ app.unmount()
+ document.body.removeChild(mountNode)
+ }
+ }).use(vuetify)
+ return app.mount(mountNode)
+ }
+}
diff --git a/frontend/src/components/system/hookComponent/dialog.vue b/frontend/src/components/system/hookComponent/dialog.vue
index 5f4cbee..3aac5b0 100644
--- a/frontend/src/components/system/hookComponent/dialog.vue
+++ b/frontend/src/components/system/hookComponent/dialog.vue
@@ -1,80 +1,80 @@
-<template>
- <v-dialog v-model="data.dialogVisible" persistent :width="dialogWidth">
- <v-card>
- <v-card-title class="text-h5"> {{ title }} </v-card-title>
- <v-card-text>{{ content }}</v-card-text>
- <v-card-actions>
- <v-spacer></v-spacer>
- <v-btn variant="text" @click="data.dialogVisible = false">
- {{ cancleText }}
- </v-btn>
- <v-btn v-if="typeof dialogProps.handleConfirm === 'function'" color="green-darken-1" variant="text" @click="method._sure()">
- {{ confirmText }}
- </v-btn>
- </v-card-actions>
- </v-card>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { watch, reactive } from 'vue'
-
-const dialogProps = defineProps({
- visible: {
- type: Boolean,
- default: false
- },
- confirmText: {
- type: String,
- default: ''
- },
- cancleText: {
- type: String,
- default: ''
- },
- handleConfirm: {
- type: Function,
- default: null
- },
- // Remove dom function
- removeComponent: {
- type: Function,
- default: null
- },
- content: {
- type: String,
- default: ''
- },
- title: {
- type: String,
- default: ''
- },
- dialogWidth: {
- type: [String, Number],
- default: 700
- }
-})
-
-const data = reactive({
- dialogVisible: false,
- dialogText: ''
-})
-
-// Init dialog visible
-data.dialogVisible = Boolean(dialogProps.visible) // Avoid shallow copies
-
-const method = reactive({
- _sure: async () => {
- await dialogProps.handleConfirm()
- data.dialogVisible = false
- }
-})
-
-// Shut dialog run remove function
-watch(
- () => data.dialogVisible,
- (val) => {
- !val && dialogProps.removeComponent()
- }
-)
-</script>
+<template>
+ <v-dialog v-model="data.dialogVisible" persistent :width="dialogWidth">
+ <v-card>
+ <v-card-title class="text-h5"> {{ title }} </v-card-title>
+ <v-card-text>{{ content }}</v-card-text>
+ <v-card-actions>
+ <v-spacer></v-spacer>
+ <v-btn variant="text" @click="data.dialogVisible = false">
+ {{ cancleText }}
+ </v-btn>
+ <v-btn v-if="typeof dialogProps.handleConfirm === 'function'" color="green-darken-1" variant="text" @click="method._sure()">
+ {{ confirmText }}
+ </v-btn>
+ </v-card-actions>
+ </v-card>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { watch, reactive } from 'vue'
+
+const dialogProps = defineProps({
+ visible: {
+ type: Boolean,
+ default: false
+ },
+ confirmText: {
+ type: String,
+ default: ''
+ },
+ cancleText: {
+ type: String,
+ default: ''
+ },
+ handleConfirm: {
+ type: Function,
+ default: null
+ },
+ // Remove dom function
+ removeComponent: {
+ type: Function,
+ default: null
+ },
+ content: {
+ type: String,
+ default: ''
+ },
+ title: {
+ type: String,
+ default: ''
+ },
+ dialogWidth: {
+ type: [String, Number],
+ default: 700
+ }
+})
+
+const data = reactive({
+ dialogVisible: false,
+ dialogText: ''
+})
+
+// Init dialog visible
+data.dialogVisible = Boolean(dialogProps.visible) // Avoid shallow copies
+
+const method = reactive({
+ _sure: async () => {
+ await dialogProps.handleConfirm()
+ data.dialogVisible = false
+ }
+})
+
+// Shut dialog run remove function
+watch(
+ () => data.dialogVisible,
+ (val) => {
+ !val && dialogProps.removeComponent()
+ }
+)
+</script>
diff --git a/frontend/src/components/system/hookComponent/message.ts b/frontend/src/components/system/hookComponent/message.ts
index 8fbc452..55d4bbb 100644
--- a/frontend/src/components/system/hookComponent/message.ts
+++ b/frontend/src/components/system/hookComponent/message.ts
@@ -1,61 +1,61 @@
-import { createApp } from 'vue'
-import MessageComponent from './message.vue'
-import { MessageOptions } from '@/types/System/HookComponent'
-// Use vuetify
-import { vuetify } from '@/plugins/vuetify/index'
-
-// Use the createApp of vue3 and the mount and unmount methods to create a mounted instance
-export default {
- name: 'message',
- message: (options: MessageOptions) => {
- const mountNode = document.createElement('div')
- mountNode.className = 'messageItems'
- mountNode.style.top = `${ getNewMsgTop() }px`
- mountNode.style.zIndex = '9999'
- document.body.appendChild(mountNode)
- const app = createApp(MessageComponent, {
- ...options,
- removeComponent: () => {
- setTimeout(
- () => {
- mountNode.style.opacity = '0'
- setTimeout(() => {
- app.unmount()
- document.body.removeChild(mountNode)
- resetMsgTop()
- }, 200)
- },
- options.shutDelay ? options.shutDelay - 200 : 1300
- )
- }
- }).use(vuetify)
- return app.mount(mountNode)
- }
-}
-
-function resetMsgTop() {
- const messageDomList: any = document.body.getElementsByClassName('messageItems')
- for (let i = 0; i < messageDomList.length; i++) {
- messageDomList[i].style.top = `${ getNewMsgTop(i) }px`
- }
-}
-
-// Get message top
-function getNewMsgTop(index = -1) {
- const messageDomList = document.body.querySelectorAll('.messageItems')
- let top = 10
- if (index < 0) {
- for (let i = 0; i < messageDomList.length; i++) {
- top += messageDomList[i].clientHeight + 10
- }
- } else {
- for (let i = 0; i < messageDomList.length; i++) {
- if (i < index) {
- top += messageDomList[i].clientHeight + 10
- } else {
- break
- }
- }
- }
- return top
-}
+import { createApp } from 'vue'
+import MessageComponent from './message.vue'
+import { MessageOptions } from '@/types/System/HookComponent'
+// Use vuetify
+import { vuetify } from '@/plugins/vuetify/index'
+
+// Use the createApp of vue3 and the mount and unmount methods to create a mounted instance
+export default {
+ name: 'message',
+ message: (options: MessageOptions) => {
+ const mountNode = document.createElement('div')
+ mountNode.className = 'messageItems'
+ mountNode.style.top = `${ getNewMsgTop() }px`
+ mountNode.style.zIndex = '9999'
+ document.body.appendChild(mountNode)
+ const app = createApp(MessageComponent, {
+ ...options,
+ removeComponent: () => {
+ setTimeout(
+ () => {
+ mountNode.style.opacity = '0'
+ setTimeout(() => {
+ app.unmount()
+ document.body.removeChild(mountNode)
+ resetMsgTop()
+ }, 200)
+ },
+ options.shutDelay ? options.shutDelay - 200 : 1300
+ )
+ }
+ }).use(vuetify)
+ return app.mount(mountNode)
+ }
+}
+
+function resetMsgTop() {
+ const messageDomList: any = document.body.getElementsByClassName('messageItems')
+ for (let i = 0; i < messageDomList.length; i++) {
+ messageDomList[i].style.top = `${ getNewMsgTop(i) }px`
+ }
+}
+
+// Get message top
+function getNewMsgTop(index = -1) {
+ const messageDomList = document.body.querySelectorAll('.messageItems')
+ let top = 10
+ if (index < 0) {
+ for (let i = 0; i < messageDomList.length; i++) {
+ top += messageDomList[i].clientHeight + 10
+ }
+ } else {
+ for (let i = 0; i < messageDomList.length; i++) {
+ if (i < index) {
+ top += messageDomList[i].clientHeight + 10
+ } else {
+ break
+ }
+ }
+ }
+ return top
+}
diff --git a/frontend/src/components/system/hookComponent/message.vue b/frontend/src/components/system/hookComponent/message.vue
index 320fb99..2a68c8f 100644
--- a/frontend/src/components/system/hookComponent/message.vue
+++ b/frontend/src/components/system/hookComponent/message.vue
@@ -1,33 +1,33 @@
-<template>
- <v-alert
- :type="type || 'info'"
- :variant="variant || 'flat'"
- :border="border || false"
- :color="color || undefined"
- :width="messageWidth"
- :min-width="250"
- >
- <!-- :max-height="60" -->
- {{ content }}
- </v-alert>
-</template>
-
-<script lang="ts" setup>
-import { onBeforeMount } from 'vue'
-
-// Vue3 does not support external interfaces
-const messageProps = defineProps<{
- type?: 'success' | 'info' | 'warning' | 'error'
- variant?: 'flat' | 'elevated' | 'tonal' | 'outlined' | 'text' | 'plain'
- content: string
- border?: boolean | 'top' | 'end' | 'bottom' | 'start'
- color?: string
- messageWidth?: string | number // message width pixel or percentage
- removeComponent(): void
-}>()
-
-onBeforeMount(() => {
- messageProps.removeComponent()
-})
-</script>
-<style lang="less" scoped></style>
+<template>
+ <v-alert
+ :type="type || 'info'"
+ :variant="variant || 'flat'"
+ :border="border || false"
+ :color="color || undefined"
+ :width="messageWidth"
+ :min-width="250"
+ >
+ <!-- :max-height="60" -->
+ {{ content }}
+ </v-alert>
+</template>
+
+<script lang="ts" setup>
+import { onBeforeMount } from 'vue'
+
+// Vue3 does not support external interfaces
+const messageProps = defineProps<{
+ type?: 'success' | 'info' | 'warning' | 'error'
+ variant?: 'flat' | 'elevated' | 'tonal' | 'outlined' | 'text' | 'plain'
+ content: string
+ border?: boolean | 'top' | 'end' | 'bottom' | 'start'
+ color?: string
+ messageWidth?: string | number // message width pixel or percentage
+ removeComponent(): void
+}>()
+
+onBeforeMount(() => {
+ messageProps.removeComponent()
+})
+</script>
+<style lang="less" scoped></style>
diff --git a/frontend/src/components/system/index.ts b/frontend/src/components/system/index.ts
index 5e8d5a4..d72ddbe 100644
--- a/frontend/src/components/system/index.ts
+++ b/frontend/src/components/system/index.ts
@@ -1,22 +1,22 @@
-import '@/assets/css/hookComponent.css' // import hookComponent style
-import { Components } from '@/types/System/HookComponent'
-
-// Use import.meta.globEager to read the files in the components folder, distinguished by the suffix ts
-const componentsList: any = import.meta.globEager('./hookComponent/**')
-
-const List: any = {}
-export default function (app: any) {
- Object.keys(componentsList).forEach((key) => {
- // Filter out ts suffix
- if (key.includes('.ts')) {
- const hookObj = componentsList[key].default
- // Assignment function component, thrown later, imported for use
- List[`$${ hookObj.name }`] = hookObj[hookObj.name]
- // Define function components into global variables, and use them in script in vue through proxy
- app.config.globalProperties[`$${ hookObj.name }`] = hookObj[hookObj.name]
- }
- })
-}
-
-// Export function components for import
-export const hookComponent: Components = List
+import '@/assets/css/hookComponent.css' // import hookComponent style
+import { Components } from '@/types/System/HookComponent'
+
+// Use import.meta.globEager to read the files in the components folder, distinguished by the suffix ts
+const componentsList: any = import.meta.globEager('./hookComponent/**')
+
+const List: any = {}
+export default function (app: any) {
+ Object.keys(componentsList).forEach((key) => {
+ // Filter out ts suffix
+ if (key.includes('.ts')) {
+ const hookObj = componentsList[key].default
+ // Assignment function component, thrown later, imported for use
+ List[`$${ hookObj.name }`] = hookObj[hookObj.name]
+ // Define function components into global variables, and use them in script in vue through proxy
+ app.config.globalProperties[`$${ hookObj.name }`] = hookObj[hookObj.name]
+ }
+ })
+}
+
+// Export function components for import
+export const hookComponent: Components = List
diff --git a/frontend/src/components/system/languages.vue b/frontend/src/components/system/languages.vue
index bb6ed94..dae2a2b 100644
--- a/frontend/src/components/system/languages.vue
+++ b/frontend/src/components/system/languages.vue
@@ -1,71 +1,71 @@
-<template>
- <div class="languageIcon">
- <v-menu>
- <template #activator="{ props }">
- <!-- <v-icon icon="mdi-translate" color="#666666" v-bind="props"></v-icon> -->
- <v-icon icon="mdi-web" color="#666666" v-bind="props"></v-icon>
- </template>
- <v-list>
- <v-list-item v-for="(item, index) in data.languageList" :key="index" :value="index" @click="method.changeLanguage(item.value)">
- <v-list-item-title>{{ item.title }}</v-list-item-title>
- </v-list-item>
- </v-list>
- </v-menu>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { reactive } from 'vue'
-import { useI18n } from 'vue-i18n'
-import { useLocale } from 'vuetify'
-import { getSelcectedLang } from '@/languages/method/index'
-import { getSelcectedLangForVuetify } from '@/plugins/vuetify/method/index'
-import { store } from '@/store'
-import { router } from '@/router'
-
-const { locale } = useI18n()
-const { current } = useLocale()
-
-const data = reactive({
- showLanguage: false,
- languageList: [
- { title: '简体中文', value: 'zh' },
- { title: 'English', value: 'en' }
- ]
-})
-
-const method = reactive({
- changeLanguage: (lang: string) => {
- if (store.getters['system/language'] === lang) {
- return
- }
- localStorage.setItem('language', lang)
- store.commit('system/setLanguage', lang) // set store
- locale.value = getSelcectedLang(lang) // global
- current.value = getSelcectedLangForVuetify(lang) // vuetify
-
- if (!['/', '/login'].includes(router.currentRoute.value.path)) {
- store.commit('system/setRefreshFlag', true) // change language refresh page
- }
- }
-})
-</script>
-
-<style lang="less" scoped>
-.languageIcon {
- height: 40px;
- width: 40px;
- font-size: 16px;
- display: flex;
- justify-content: center;
- align-items: center;
- transition: all 0.5s;
- border-radius: 40px;
- &:hover {
- background-color: #e4e5ea;
- }
- &:active {
- background-color: #cdced3;
- }
-}
-</style>
+<template>
+ <div class="languageIcon">
+ <v-menu>
+ <template #activator="{ props }">
+ <!-- <v-icon icon="mdi-translate" color="#666666" v-bind="props"></v-icon> -->
+ <v-icon icon="mdi-web" color="#666666" v-bind="props"></v-icon>
+ </template>
+ <v-list>
+ <v-list-item v-for="(item, index) in data.languageList" :key="index" :value="index" @click="method.changeLanguage(item.value)">
+ <v-list-item-title>{{ item.title }}</v-list-item-title>
+ </v-list-item>
+ </v-list>
+ </v-menu>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { reactive } from 'vue'
+import { useI18n } from 'vue-i18n'
+import { useLocale } from 'vuetify'
+import { getSelcectedLang } from '@/languages/method/index'
+import { getSelcectedLangForVuetify } from '@/plugins/vuetify/method/index'
+import { store } from '@/store'
+import { router } from '@/router'
+
+const { locale } = useI18n()
+const { current } = useLocale()
+
+const data = reactive({
+ showLanguage: false,
+ languageList: [
+ { title: '简体中文', value: 'zh' },
+ { title: 'English', value: 'en' }
+ ]
+})
+
+const method = reactive({
+ changeLanguage: (lang: string) => {
+ if (store.getters['system/language'] === lang) {
+ return
+ }
+ localStorage.setItem('language', lang)
+ store.commit('system/setLanguage', lang) // set store
+ locale.value = getSelcectedLang(lang) // global
+ current.value = getSelcectedLangForVuetify(lang) // vuetify
+
+ if (!['/', '/login'].includes(router.currentRoute.value.path)) {
+ store.commit('system/setRefreshFlag', true) // change language refresh page
+ }
+ }
+})
+</script>
+
+<style lang="less" scoped>
+.languageIcon {
+ height: 40px;
+ width: 40px;
+ font-size: 16px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ transition: all 0.5s;
+ border-radius: 40px;
+ &:hover {
+ background-color: #e4e5ea;
+ }
+ &:active {
+ background-color: #cdced3;
+ }
+}
+</style>
diff --git a/frontend/src/components/system/logo.vue b/frontend/src/components/system/logo.vue
index 816d484..b95b110 100644
--- a/frontend/src/components/system/logo.vue
+++ b/frontend/src/components/system/logo.vue
@@ -1,28 +1,28 @@
-<template>
- <img
- class="SysTitleLogo"
- :style="{ height: height + 'px', top: top + 'px', left: left + 'px' }"
- src="@/assets/img/WMSTitle.png"
- />
-</template>
-<script setup lang="ts">
-defineProps({
- height: {
- type: Number,
- default: 80
- },
- top: {
- type: Number,
- default: 20
- },
- left: {
- type: Number,
- default: 20
- }
-})
-</script>
-<style lang="less">
-.SysTitleLogo {
- position: absolute;
-}
-</style>
+<template>
+ <img
+ class="SysTitleLogo"
+ :style="{ height: height + 'px', top: top + 'px', left: left + 'px' }"
+ src="@/assets/img/WMSTitle.png"
+ />
+</template>
+<script setup lang="ts">
+defineProps({
+ height: {
+ type: Number,
+ default: 80
+ },
+ top: {
+ type: Number,
+ default: 20
+ },
+ left: {
+ type: Number,
+ default: 20
+ }
+})
+</script>
+<style lang="less">
+.SysTitleLogo {
+ position: absolute;
+}
+</style>
diff --git a/frontend/src/components/tooltip-btn.vue b/frontend/src/components/tooltip-btn.vue
index 4efd3ef..37f4f9e 100644
--- a/frontend/src/components/tooltip-btn.vue
+++ b/frontend/src/components/tooltip-btn.vue
@@ -1,51 +1,51 @@
-<template>
- <v-tooltip location="bottom">
- <template #activator="{ props }">
- <v-btn :disabled="disabled" :flat="flat" class="mr-3" :size="size" icon v-bind="props" @click="method.clickEvent">
- <v-icon :color="iconColor"> {{ icon }} </v-icon>
- </v-btn>
- </template>
- <span>{{ tooltipText }}</span>
- </v-tooltip>
-</template>
-<script setup lang="ts">
-import { reactive } from 'vue'
-
-const emit = defineEmits(['click'])
-
-defineProps({
- icon: {
- type: String,
- default: ''
- },
- tooltipText: {
- type: String,
- default: ''
- },
- size: {
- type: String,
- default: 'small'
- },
- // Whether show button shadow.
- // It's hasn't shadow when 'flat = true'.
- flat: {
- type: Boolean,
- default: false
- },
- iconColor: {
- type: String,
- default: ''
- },
- disabled: {
- type: Boolean,
- default: false
- }
-})
-
-const method = reactive({
- clickEvent: () => {
- emit('click')
- }
-})
-</script>
-<style lang="less"></style>
+<template>
+ <v-tooltip location="bottom">
+ <template #activator="{ props }">
+ <v-btn :disabled="disabled" :flat="flat" class="mr-3" :size="size" icon v-bind="props" @click="method.clickEvent">
+ <v-icon :color="iconColor"> {{ icon }} </v-icon>
+ </v-btn>
+ </template>
+ <span>{{ tooltipText }}</span>
+ </v-tooltip>
+</template>
+<script setup lang="ts">
+import { reactive } from 'vue'
+
+const emit = defineEmits(['click'])
+
+defineProps({
+ icon: {
+ type: String,
+ default: ''
+ },
+ tooltipText: {
+ type: String,
+ default: ''
+ },
+ size: {
+ type: String,
+ default: 'small'
+ },
+ // Whether show button shadow.
+ // It's hasn't shadow when 'flat = true'.
+ flat: {
+ type: Boolean,
+ default: false
+ },
+ iconColor: {
+ type: String,
+ default: ''
+ },
+ disabled: {
+ type: Boolean,
+ default: false
+ }
+})
+
+const method = reactive({
+ clickEvent: () => {
+ emit('click')
+ }
+})
+</script>
+<style lang="less"></style>
diff --git a/frontend/src/constant/commodityManagement.ts b/frontend/src/constant/commodityManagement.ts
index 9ef539b..d465e63 100644
--- a/frontend/src/constant/commodityManagement.ts
+++ b/frontend/src/constant/commodityManagement.ts
@@ -1,11 +1,11 @@
-// Acquisition unit
-export function GetUnit(type: 'weight' | 'length' | 'volume', val: number) {
- switch (type) {
- case 'length':
- return ['mm', 'cm', 'dm', 'm'][val]
- case 'volume':
- return ['cm³', 'dm³', 'm³'][val]
- case 'weight':
- return ['mg', 'g', 'kg'][val]
- }
+// Acquisition unit
+export function GetUnit(type: 'weight' | 'length' | 'volume', val: number) {
+ switch (type) {
+ case 'length':
+ return ['mm', 'cm', 'dm', 'm'][val]
+ case 'volume':
+ return ['cm³', 'dm³', 'm³'][val]
+ case 'weight':
+ return ['mg', 'g', 'kg'][val]
+ }
}
\ No newline at end of file
diff --git a/frontend/src/constant/style.ts b/frontend/src/constant/style.ts
index d6d954b..68b462b 100644
--- a/frontend/src/constant/style.ts
+++ b/frontend/src/constant/style.ts
@@ -1,73 +1,73 @@
-import { store } from '@/store'
-
-interface pageHasElement {
- hasPager?: boolean
- hasTab?: boolean
- hasOperateBtn?: boolean
- hasToolBar?: boolean
-}
-
-export const primaryColor = '#9C27B0'
-export const primaryLightColor = '#ECE7F6'
-export const lightGrey = '#999999'
-export const errorColor = '#BA2828'
-
-export const SYSTEM_HEIGHT = {
- HEADER: 60,
- TAB: 70,
- OPERATE_BAR: 52,
- VXE_PAGER: 48,
- SELECT_TABLE: 500,
- TOOLBAR: 40
-}
-
-// The height of the content card
-export const computedCardHeight = ({ hasTab = true, hasOperateBtn = true }: pageHasElement) => {
- const clientHeight = store.getters['system/clientHeight']
- const EXTRA_MARGIN = 100
-
- let res = clientHeight - SYSTEM_HEIGHT.HEADER - EXTRA_MARGIN
-
- if (hasTab) {
- res -= SYSTEM_HEIGHT.TAB
- }
- if (hasOperateBtn) {
- res -= SYSTEM_HEIGHT.OPERATE_BAR
- }
-
- return `${ res }px`
-}
-
-// The height of the table
-export const computedTableHeight = ({ hasPager = true, hasTab = true, hasOperateBtn = true }: pageHasElement) => {
- const clientHeight = store.getters['system/clientHeight']
- const EXTRA_MARGIN = 100
-
- let res = clientHeight - SYSTEM_HEIGHT.HEADER - EXTRA_MARGIN
-
- if (hasPager) {
- res -= SYSTEM_HEIGHT.VXE_PAGER
- }
- if (hasTab) {
- res -= SYSTEM_HEIGHT.TAB
- }
- if (hasOperateBtn) {
- res -= SYSTEM_HEIGHT.OPERATE_BAR
- }
-
- return `${ res }px`
-}
-
-// The height of the table container in select modal.
-export const computedSelectTableSearchHeight = ({ hasPager = true, hasToolBar = false }: pageHasElement) => {
- let res = SYSTEM_HEIGHT.SELECT_TABLE
-
- if (hasPager) {
- res += SYSTEM_HEIGHT.VXE_PAGER
- }
- if (hasToolBar) {
- res += SYSTEM_HEIGHT.TOOLBAR
- }
-
- return `${ res }px`
-}
+import { store } from '@/store'
+
+interface pageHasElement {
+ hasPager?: boolean
+ hasTab?: boolean
+ hasOperateBtn?: boolean
+ hasToolBar?: boolean
+}
+
+export const primaryColor = '#9C27B0'
+export const primaryLightColor = '#ECE7F6'
+export const lightGrey = '#999999'
+export const errorColor = '#BA2828'
+
+export const SYSTEM_HEIGHT = {
+ HEADER: 60,
+ TAB: 70,
+ OPERATE_BAR: 52,
+ VXE_PAGER: 48,
+ SELECT_TABLE: 500,
+ TOOLBAR: 40
+}
+
+// The height of the content card
+export const computedCardHeight = ({ hasTab = true, hasOperateBtn = true }: pageHasElement) => {
+ const clientHeight = store.getters['system/clientHeight']
+ const EXTRA_MARGIN = 100
+
+ let res = clientHeight - SYSTEM_HEIGHT.HEADER - EXTRA_MARGIN
+
+ if (hasTab) {
+ res -= SYSTEM_HEIGHT.TAB
+ }
+ if (hasOperateBtn) {
+ res -= SYSTEM_HEIGHT.OPERATE_BAR
+ }
+
+ return `${ res }px`
+}
+
+// The height of the table
+export const computedTableHeight = ({ hasPager = true, hasTab = true, hasOperateBtn = true }: pageHasElement) => {
+ const clientHeight = store.getters['system/clientHeight']
+ const EXTRA_MARGIN = 100
+
+ let res = clientHeight - SYSTEM_HEIGHT.HEADER - EXTRA_MARGIN
+
+ if (hasPager) {
+ res -= SYSTEM_HEIGHT.VXE_PAGER
+ }
+ if (hasTab) {
+ res -= SYSTEM_HEIGHT.TAB
+ }
+ if (hasOperateBtn) {
+ res -= SYSTEM_HEIGHT.OPERATE_BAR
+ }
+
+ return `${ res }px`
+}
+
+// The height of the table container in select modal.
+export const computedSelectTableSearchHeight = ({ hasPager = true, hasToolBar = false }: pageHasElement) => {
+ let res = SYSTEM_HEIGHT.SELECT_TABLE
+
+ if (hasPager) {
+ res += SYSTEM_HEIGHT.VXE_PAGER
+ }
+ if (hasToolBar) {
+ res += SYSTEM_HEIGHT.TOOLBAR
+ }
+
+ return `${ res }px`
+}
diff --git a/frontend/src/constant/system.ts b/frontend/src/constant/system.ts
index 1c0f15c..9081786 100644
--- a/frontend/src/constant/system.ts
+++ b/frontend/src/constant/system.ts
@@ -1,2 +1,2 @@
-// unit: ms
-export const DEBOUNCE_TIME = 350
+// unit: ms
+export const DEBOUNCE_TIME = 350
diff --git a/frontend/src/constant/vxeTable.ts b/frontend/src/constant/vxeTable.ts
index 467eeaf..11b6813 100644
--- a/frontend/src/constant/vxeTable.ts
+++ b/frontend/src/constant/vxeTable.ts
@@ -1,14 +1,14 @@
-import { VxePagerPropTypes } from 'vxe-table'
-
-export const PAGE_SIZE = [20, 50, 100]
-export const DEFAULT_PAGE_SIZE = 20
-export const PAGE_LAYOUT: VxePagerPropTypes.Layouts = [
- 'PrevJump',
- 'PrevPage',
- 'Number',
- 'NextPage',
- 'NextJump',
- 'Sizes',
- 'FullJump',
- 'Total'
-]
+import { VxePagerPropTypes } from 'vxe-table'
+
+export const PAGE_SIZE = [20, 50, 100]
+export const DEFAULT_PAGE_SIZE = 20
+export const PAGE_LAYOUT: VxePagerPropTypes.Layouts = [
+ 'PrevJump',
+ 'PrevPage',
+ 'Number',
+ 'NextPage',
+ 'NextJump',
+ 'Sizes',
+ 'FullJump',
+ 'Total'
+]
diff --git a/frontend/src/constant/warehouseWorking.ts b/frontend/src/constant/warehouseWorking.ts
index 35c7119..ad23e92 100644
--- a/frontend/src/constant/warehouseWorking.ts
+++ b/frontend/src/constant/warehouseWorking.ts
@@ -1,8 +1,8 @@
-export const PROCESS_JOB_COMBINE = true
-export const PROCESS_JOB_SPLIT = false
-
-export const FREEZE_JOB_FREEZE = true
-export const FREEZE_JOB_UNFREEZE = false
-
-export const TAKING_JOB_FINISH = true
+export const PROCESS_JOB_COMBINE = true
+export const PROCESS_JOB_SPLIT = false
+
+export const FREEZE_JOB_FREEZE = true
+export const FREEZE_JOB_UNFREEZE = false
+
+export const TAKING_JOB_FINISH = true
export const TAKING_JOB_UNFINISH = false
\ No newline at end of file
diff --git a/frontend/src/env.d.ts b/frontend/src/env.d.ts
index 2f7d41b..f889b00 100644
--- a/frontend/src/env.d.ts
+++ b/frontend/src/env.d.ts
@@ -1,6 +1,6 @@
-declare module '*.vue' {
- import type { DefineComponent } from 'vue'
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
- const component: DefineComponent<{}, {}, any>
- export default component
-}
+declare module '*.vue' {
+ import type { DefineComponent } from 'vue'
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
+ const component: DefineComponent<{}, {}, any>
+ export default component
+}
diff --git a/frontend/src/languages/i18n.ts b/frontend/src/languages/i18n.ts
index 6e85204..2971134 100644
--- a/frontend/src/languages/i18n.ts
+++ b/frontend/src/languages/i18n.ts
@@ -1,21 +1,21 @@
-import { createI18n } from 'vue-i18n'
-import messages from './langs/index'
-import { getSelcectedLang } from './method/index'
-
-const i18n = createI18n({
- legacy: false,
- globalInjection: true,
- locale: getStorageLang(),
- messages
-})
-
-// get language in storage or default
-function getStorageLang() {
- const lang = localStorage.getItem('language')
- if (lang) {
- return getSelcectedLang(lang)
- }
- return 'en_US'
-}
-
-export default i18n
+import { createI18n } from 'vue-i18n'
+import messages from './langs/index'
+import { getSelcectedLang } from './method/index'
+
+const i18n = createI18n({
+ legacy: false,
+ globalInjection: true,
+ locale: getStorageLang(),
+ messages
+})
+
+// get language in storage or default
+function getStorageLang() {
+ const lang = localStorage.getItem('language')
+ if (lang) {
+ return getSelcectedLang(lang)
+ }
+ return 'en_US'
+}
+
+export default i18n
diff --git a/frontend/src/languages/langs/cnZh.ts b/frontend/src/languages/langs/cnZh.ts
index 1e7ee5f..3ed1515 100644
--- a/frontend/src/languages/langs/cnZh.ts
+++ b/frontend/src/languages/langs/cnZh.ts
@@ -1,536 +1,536 @@
-export default {
- system: {
- hookComponent: {
- dialog: {
- defaultClose: '关闭',
- defaultConfirm: '确认',
- defaultTitle: '提示'
- }
- },
- page: {
- add: '新增',
- update: '修改',
- refresh: '刷新',
- export: '导出',
- operate: '操作',
- edit: '编辑',
- delete: '删除',
- close: '关闭',
- submit: '提交',
- reset: '重置',
- confirm: '确认',
- insertOneRow: '新增一行',
- view: '查看',
- import: '导入',
- chooseFile: '选择文件',
- exportTemplate: '导出模板',
- noData: '暂无数据',
- },
- tips: {
- success: '成功!',
- fail: '失败!',
- beforeDeleteMessage: '您确定要删除此条数据吗?',
- beforeDeleteDetailMessage: '您确定要删除此行吗?',
- detailLengthIsZero: '请添加明细数据!',
- detailHasItemRepeat: '明细中含有重复项目!',
- noData: '暂无数据',
- beforeAsnConfirm: '确认到货?',
- beforeAsnUnload: '确认卸货?',
- beforeAsnSorted: '确认分拣完成?',
- requestTimeout: '请求超时!',
- requestFail: '接口请求失败,请重试'
- },
- checkText: {
- checkFormFail: '操作失败, 请检查数据后重试!',
- mustInput: '请填写',
- mustSelect: '请选择',
- integer: '整数',
- decimal: ' 小数',
- pleaseEnter: '请输入长度为',
- inputIntMsg: '的整数位',
- inputDecimalMsg: '的小数位',
- lengthValid: '字段长度应该在'
- },
- homeHeader: {
- logout: '注销'
- },
- combobox: {
- sex: {
- male: '男',
- female: '女'
- },
- yesOrNo: {
- yes: '是',
- no: '否'
- }
- },
- pager: {
- pageSizes: '条/页',
- goTo: '前往',
- total: '共',
- record: '条记录'
- }
- },
- router: {
- sideBar: {
- homepage: '首页',
- baseModule: '基础设置',
- ownerOfCargo: '货主信息',
- menuBasicSettings: '菜单基础设置',
- userManagement: '用户管理',
- commodityCategorySetting: '商品类别设置',
- commodityManagement: '商品管理',
- userRoleSetting: '角色设置',
- companySetting: '公司信息',
- freightSetting: '运费设置',
- warehouseSetting: '仓库设置',
- customer: '客户信息',
- supplier: '供应商信息',
- roleMenu: '菜单设置',
- stockManagement: '库存管理',
- warehouseWorkingModule: '仓内作业',
- warehouseProcessing: '仓内加工',
- warehouseMove: '库存移动',
- warehouseFreeze: '库存冻结',
- warehouseAdjust: '库存调整',
- warehouseTaking: '库存盘点',
- deliveryManagement: '发货管理',
- stockAsn: '收货管理'
- }
- },
- login: {
- welcomeTitle: '欢迎来到ModernWMS!👋🏻',
- mainButtonLabel: '登录',
- rememberTips: '记住账号密码',
- userName: '用户名',
- password: '密码',
- loginSuccess: '登录成功',
- notAuthority: '该账号未分配菜单权限,请联系管理员',
- registerTips: '没有账号?点此注册一个!',
- register: '注册'
- },
- homepage: {
- subTitle: '现代化仓库管理系统'
- },
- base: {
- freightSetting: {
- carrier: '承运商',
- departure_city: '始发城市',
- arrival_city: '到货城市',
- price_per_weight: '单公斤运费',
- price_per_volume: '单立方米运费',
- min_payment: '最小运费',
- creator: '创建人',
- create_time: '创建时间',
- last_update_time: '最后更新时间',
- is_valid: '是否有效',
- freightSelectModal: '运费选择框',
- },
- userManagement: {
- user_num: '员工编号',
- user_name: '员工名称',
- user_role: '角色',
- contact_tel: '联系方式',
- sex: '性别',
- is_valid: '是否有效',
- restPwd: '重置密码',
- checkboxIsNull: '请选中数据!',
- beforeResetPwd: '您确定要重置这些用户的密码吗?',
- afterResetPwd: '重置密码成功, 新密码为: ',
- user_register_name: '用户名',
- email: 'Email',
- auth_string: '密码'
- },
- warehouseSetting: {
- warehouseSetting: '仓库设置',
- reservoirSetting: '库区设置',
- locationSetting: '库位设置',
- locationSelectModal: '库位选择框',
- email: 'Email',
- warehouse_name: '仓库名称',
- city: '所在城市',
- address: '详细地址',
- contact_tel: '联系方式',
- manager: '负责人',
- is_valid: '是否有效',
- area_name: '库区名称',
- area_property: '库区类型',
- location_name: '库位编码',
- location_length: '库位长(m)',
- location_width: '库位宽(m)',
- location_heigth: '库位高(m)',
- location_volume: '库位容积(m³)',
- location_load: '库位承重(kg)',
- roadway_number: '巷道号',
- shelf_number: '货架号',
- layer_number: '层号',
- tag_number: '位号',
- picking_area: '拣货区',
- stocking_area: '备货区',
- receiving_area: '收货区',
- return_area: '退货区',
- defective_area: '次品区',
- inventory_area: '存货区',
- creator: '创建人',
- create_time: '创建时间',
- last_update_time: '最后更新时间'
- },
- customer: {
- customer_name: '客户名称',
- city: '所在城市',
- address: '详细地址',
- manager: '负责人',
- email: 'Email',
- contact_tel: '联系方式',
- creator: '创建人',
- create_time: '创建时间',
- last_update_time: '最后更新时间',
- is_valid: '是否有效'
- },
- supplier: {
- supplier_name: '供应商名称',
- city: '所在城市',
- address: '详细地址',
- email: 'Email',
- manager: '负责人',
- contact_tel: '联系方式',
- creator: '创建人',
- create_time: '创建时间',
- last_update_time: '最后更新时间',
- is_valid: '是否有效'
- },
- userRoleSetting: {
- role_name: '用户角色',
- is_valid: '是否有效'
- },
- companySetting: {
- company_name: '公司名称',
- city: '所在城市',
- address: '详细地址',
- manager: '负责人',
- contact_tel: '联系方式'
- },
- ownerOfCargo: {
- goods_owner_name: '货主名称',
- city: '所在城市',
- address: '详细地址',
- manager: '负责人',
- contact_tel: '联系方式',
- creator: '创建人',
- create_time: '创建时间'
- },
- commodityCategorySetting: {
- category_name: '商品类别',
- parent_name: '所属类别',
- creator: '创建人',
- create_time: '创建时间'
- },
- roleMenu: {
- role_name: '角色名称',
- menu_name: '菜单名称',
- beforeUpdateOrDel: '请先选择需要处理的数据!'
- },
- commodityManagement: {
- spu_code: '商品编码',
- spu_name: '商品名称',
- sku_code: '规格编码',
- sku_name: '规格名称',
- category_name: '商品类别',
- spu_description: '商品描述',
- bar_code: '商品条码',
- supplier_name: '供应商名称',
- brand: '品牌',
- unit: '商品单位',
- cost: '商品成本',
- price: '商品价格',
- origin: '产地',
- length_unit: '长度单位',
- volume_unit: '体积单位',
- weight_unit: '重量单位',
- weight: '商品重量',
- lenght: '商品长度',
- width: '商品宽度',
- height: '商品高度',
- volume: '商品体积'
- }
- },
- wms: {
- stock: {
- stockSelectModal: '库存选择框',
- skuSelectModal: '商品选择框',
- warehouse: '仓库名称',
- location_name: '库位编码',
- qty_available: '可用数量'
- },
- warehouseWorking: {
- warehouseProcessing: {
- job_code: '作业单号',
- job_type: '作业类型',
- process_status: '加工状态',
- processor: '操作人',
- process_time: '操作时间',
- qty: '数量',
- is_source: '是否来源商品',
- spu_code: '商品编码',
- spu_name: '商品名称',
- sku_code: '规格编码',
- sku_name: '规格名称',
- target_warehouse: '目标仓库',
- target_location: '目标库位',
- unit: '商品单位',
- is_update_stock: '是否已更新库存',
- creator: '创建人',
- create_time: '创建时间',
- last_update_time: '最后更新时间',
- adjust_status: '是否已调整',
- source: '来源',
- target: '目标',
- process_split: '拆分加工',
- process_combine: '组合加工',
- confirmProcess: '确认加工',
- confirmAdjust: '确认调整',
- qtyMoreThanAvailable: '不可超过可用数量',
- beforeConfirmProcess: '您确认对该条数据进行加工吗?',
- beforeConfirmAdjust: '您确认对该条数据进行调整吗?',
- alreadyProcess: '该数据已完成加工,不可删除',
- alreadyAdjust: '该数据已完成调整,不可删除'
- },
- warehouseMove: {
- job_code: '作业单号',
- move_status: '作业状态',
- qty: '数量',
- handler: '操作人',
- handle_time: '操作时间',
- orig_goods_warehouse: '来源仓库',
- orig_goods_location_name: '来源库位',
- dest_googs_warehouse: '目标仓库',
- dest_googs_location_name: '目标库位',
- confirmMove: '确认移库',
- creator: '创建人',
- create_time: '创建时间',
- beforeConfirmMove: '您确认对该条数据进行移库吗?',
- unadjust: '未调整',
- adjusted: '已调整'
- },
- warehouseFreeze: {
- job_code: '作业单号',
- job_type: '作业类型',
- handler: '操作人',
- handle_time: '操作时间',
- creator: '创建人',
- create_time: '创建时间',
- warehouse: '所在仓库',
- location_name: '所在库位',
- freeze: '冻结',
- unfreeze: '解冻'
- },
- warehouseAdjust: {
- job_code: '作业单号',
- job_type: '作业类型',
- warehouse: '所在仓库',
- location_name: '所在库位',
- handler: '操作人',
- handle_time: '操作时间',
- creator: '创建人',
- create_time: '创建时间',
- qty: '调整差异数量',
- warehouseTake: '盘点',
- processCombine: '仓内加工',
- processSplit: '仓内加工',
- warehouseMove: '移库',
- confirmAdjust: '确认调整',
- beforeConfirmAdjust: '您确认对该条数据进行调整吗?'
- },
- warehouseTaking: {
- job_code: '作业单号',
- job_status: '作业状态',
- warehouse: '所在仓库',
- location_name: '所在库位',
- book_qty: '账面数量',
- counted_qty: '盘点数量',
- difference_qty: '差异数量',
- confirmTaking: '确认盘点',
- handler: '操作人',
- handle_time: '操作时间',
- creator: '创建人',
- create_time: '创建时间',
- unfinish: '待作业',
- finish: '已完成',
- confirmAdjust: '确认调整',
- beforeConfirmAdjust: '您确认对该条数据进行调整吗?',
- addFromCommodity: '选择商品',
- addFromStock: '选择库存',
- addTips: '当目标库存不存在时,可通过手动选择商品和库位来新增记录'
- }
- },
- stockManagement: {
- stockLocation: '库位列表',
- stock: '库存列表'
- },
- stockLocation: {
- warehouse_name: '仓库名称',
- location_name: '库位名称',
- spu_code: '商品编码',
- spu_name: '商品名称',
- sku_id: '规格标识',
- sku_code: '规格编码',
- sku_name: '规格名称',
- qty: '数量',
- qty_available: '可用数量',
- qty_locked: '锁定数量',
- qty_frozen: '冻结数量'
- },
- stockList: {
- spu_code: '商品编码',
- spu_name: '商品名称',
- sku_code: '规格编码',
- sku_id: '规格标识',
- qty: '数量',
- qty_available: '可用数量',
- qty_locked: '锁定数量',
- qty_frozen: '冻结数量',
- qty_asn: '到货通知书数量',
- qty_to_unload: '待卸货数量',
- qty_to_sort: '待分拣数量',
- qty_sorted: '已分拣数量',
- shortage_qty: '欠货数量'
- },
- stockAsn: {
- tabNotice: '到货通知',
- tabToDoArrival: '待到货',
- tabToDoUnload: '待卸货',
- tabToDoSorting: '待分拣',
- tabToDoGrounding: '待上架',
- tabReceiptDetails: '收货明细'
- },
- stockAsnInfo: {
- id: '标识',
- asn_no: '到货通知书编号',
- asn_status: '到货通知书状态',
- spu_id: '商品spu标识',
- spu_code: '商品编码',
- spu_name: '商品名称',
- sku_id: '商品sku标识',
- sku_code: '规格编码',
- sku_name: '规格名称',
- origin: '产地',
- length_unit: '长度单位',
- volume_unit: '体积单位',
- weight_unit: '重量单位',
- asn_qty: '到货通知书数据',
- actual_qty: '上架数量',
- sorted_qty: '分拣数量',
- shortage_qty: '短少数量',
- more_qty: '超量数量',
- damage_qty: '破损数量',
- weight: '总重量',
- volume: '总体积',
- supplier_id: '供应商标识',
- supplier_name: '供应商名称',
- goods_owner_id: '货主标识',
- goods_owner_name: '货主名称',
- is_valid: '是否有效'
- },
- skuInfo: {
- spu_id: '商品spu标识',
- spu_code: '商品编码',
- spu_name: '商品名称',
- category_id: '商品类别标识',
- category_name: '商品类别',
- spu_description: '商品描述',
- bar_code: '商品条码',
- supplier_id: '供应商标识',
- supplier_name: '供应商名称',
- brand: '品牌',
- origin: '产地',
- length_unit: '长度单位',
- volume_unit: '体积单位',
- weight_unit: '重量单位',
- sku_id: '规格标识',
- sku_code: '规格编码',
- sku_name: '规格名称',
- weight: '总重量',
- lenght: '商品长度',
- width: '商品宽度',
- height: '商品高度',
- volume: '商品体积',
- unit: '商品单位',
- cost: '商品成本',
- price: '商品价格'
- },
- deliveryManagement: {
- shipment: '发货单',
- preShipment: '预发货',
- newShipment: '新发货',
- goodsToBePicked: '待拣货',
- picked: '已拣货',
- toBePackaged: '待打包',
- package: '打包',
- packaged: '已打包',
- toBeWeighed: '待称重',
- weigh: '称重',
- weighed: '已称重',
- delivery: '出库',
- toBeDelivered: '待出库',
- outOfWarehouse: '已出库',
- signIn: '签收',
- signedIn: '已签收',
- dispatch_no: '发货单号',
- dispatch_status: '发货单状态',
- qty: '总数量',
- detailQty: '数量',
- weight: '总重量',
- volume: '总体积',
- customer_name: '客户名称',
- spu_code: '商品编码',
- spu_name: '商品名称',
- sku_code: '规格编码',
- creator: '创建人',
- create_time: '创建时间',
- confirmOrder: '确认发货单',
- orderDetail: '发货单商品详情',
- quantityOverflow: '发货数量之和不能超出发货单数量',
- quantityIsZero: '请保证选择的商品至少有一项出库数量大于0!',
- NoItemSelected: '请至少选中一项商品进行出库!',
- confirmSuccess: '确认发货单成功!',
- confirmPicking: '确认拣货',
- confirmDelivery: '确认出库',
- confirmSignIn: '确认签收',
- detailWeight: '重量',
- unpackage_qty: '待打包数量',
- unweighing_qty: '待称重数量',
- validQtyMsgPackage: '请输入有效数值, 且不能超过总数量',
- validQtyMsgSignIn: '请输入有效数值, 且不能超过总数量',
- signInQty: '实际签收数量',
- incorrectStatusMsg: '操作失败, 状态应该为',
- backToThePreviousStep: '撤回到上一个流程',
- confirmBack: '确认撤回',
- or: '或',
- irreversible: '此操作不可逆',
- detailQuantityIsZero: '发货数量不能为0',
- qty_available: '可用数量',
- spu_description: '商品描述',
- bar_code: '条码',
- order_qty: '订单数量',
- unpicked_qty: '待拣货数量',
- picked_qty: '已拣货数量',
- detailVolume: '体积',
- package_qty: '已打包数量',
- package_person: '打包员',
- package_time: '打包时间',
- weighing_no: '称重单号',
- package_no: '打包流水号',
- weighing_person: '称重员',
- weighing_weight: '称重重量',
- waybill_no: '运单号',
- carrier: '承运单位',
- damagedQuantity: '到货破损数量',
- setFreight: '设置承运单位',
- departure_city: '始发城市',
- arrival_city: '到货城市',
- ViewInventoryDetails: '查看商品明细',
- invalidValue: '请输入有效数值',
- exceedingQuantity: '不能超过总数量'
- }
- }
-}
+export default {
+ system: {
+ hookComponent: {
+ dialog: {
+ defaultClose: '关闭',
+ defaultConfirm: '确认',
+ defaultTitle: '提示'
+ }
+ },
+ page: {
+ add: '新增',
+ update: '修改',
+ refresh: '刷新',
+ export: '导出',
+ operate: '操作',
+ edit: '编辑',
+ delete: '删除',
+ close: '关闭',
+ submit: '提交',
+ reset: '重置',
+ confirm: '确认',
+ insertOneRow: '新增一行',
+ view: '查看',
+ import: '导入',
+ chooseFile: '选择文件',
+ exportTemplate: '导出模板',
+ noData: '暂无数据',
+ },
+ tips: {
+ success: '成功!',
+ fail: '失败!',
+ beforeDeleteMessage: '您确定要删除此条数据吗?',
+ beforeDeleteDetailMessage: '您确定要删除此行吗?',
+ detailLengthIsZero: '请添加明细数据!',
+ detailHasItemRepeat: '明细中含有重复项目!',
+ noData: '暂无数据',
+ beforeAsnConfirm: '确认到货?',
+ beforeAsnUnload: '确认卸货?',
+ beforeAsnSorted: '确认分拣完成?',
+ requestTimeout: '请求超时!',
+ requestFail: '接口请求失败,请重试'
+ },
+ checkText: {
+ checkFormFail: '操作失败, 请检查数据后重试!',
+ mustInput: '请填写',
+ mustSelect: '请选择',
+ integer: '整数',
+ decimal: ' 小数',
+ pleaseEnter: '请输入长度为',
+ inputIntMsg: '的整数位',
+ inputDecimalMsg: '的小数位',
+ lengthValid: '字段长度应该在'
+ },
+ homeHeader: {
+ logout: '注销'
+ },
+ combobox: {
+ sex: {
+ male: '男',
+ female: '女'
+ },
+ yesOrNo: {
+ yes: '是',
+ no: '否'
+ }
+ },
+ pager: {
+ pageSizes: '条/页',
+ goTo: '前往',
+ total: '共',
+ record: '条记录'
+ }
+ },
+ router: {
+ sideBar: {
+ homepage: '首页',
+ baseModule: '基础设置',
+ ownerOfCargo: '货主信息',
+ menuBasicSettings: '菜单基础设置',
+ userManagement: '用户管理',
+ commodityCategorySetting: '商品类别设置',
+ commodityManagement: '商品管理',
+ userRoleSetting: '角色设置',
+ companySetting: '公司信息',
+ freightSetting: '运费设置',
+ warehouseSetting: '仓库设置',
+ customer: '客户信息',
+ supplier: '供应商信息',
+ roleMenu: '菜单设置',
+ stockManagement: '库存管理',
+ warehouseWorkingModule: '仓内作业',
+ warehouseProcessing: '仓内加工',
+ warehouseMove: '库存移动',
+ warehouseFreeze: '库存冻结',
+ warehouseAdjust: '库存调整',
+ warehouseTaking: '库存盘点',
+ deliveryManagement: '发货管理',
+ stockAsn: '收货管理'
+ }
+ },
+ login: {
+ welcomeTitle: '欢迎来到ModernWMS!👋🏻',
+ mainButtonLabel: '登录',
+ rememberTips: '记住账号密码',
+ userName: '用户名',
+ password: '密码',
+ loginSuccess: '登录成功',
+ notAuthority: '该账号未分配菜单权限,请联系管理员',
+ registerTips: '没有账号?点此注册一个!',
+ register: '注册'
+ },
+ homepage: {
+ subTitle: '现代化仓库管理系统'
+ },
+ base: {
+ freightSetting: {
+ carrier: '承运商',
+ departure_city: '始发城市',
+ arrival_city: '到货城市',
+ price_per_weight: '单公斤运费',
+ price_per_volume: '单立方米运费',
+ min_payment: '最小运费',
+ creator: '创建人',
+ create_time: '创建时间',
+ last_update_time: '最后更新时间',
+ is_valid: '是否有效',
+ freightSelectModal: '运费选择框',
+ },
+ userManagement: {
+ user_num: '员工编号',
+ user_name: '员工名称',
+ user_role: '角色',
+ contact_tel: '联系方式',
+ sex: '性别',
+ is_valid: '是否有效',
+ restPwd: '重置密码',
+ checkboxIsNull: '请选中数据!',
+ beforeResetPwd: '您确定要重置这些用户的密码吗?',
+ afterResetPwd: '重置密码成功, 新密码为: ',
+ user_register_name: '用户名',
+ email: 'Email',
+ auth_string: '密码'
+ },
+ warehouseSetting: {
+ warehouseSetting: '仓库设置',
+ reservoirSetting: '库区设置',
+ locationSetting: '库位设置',
+ locationSelectModal: '库位选择框',
+ email: 'Email',
+ warehouse_name: '仓库名称',
+ city: '所在城市',
+ address: '详细地址',
+ contact_tel: '联系方式',
+ manager: '负责人',
+ is_valid: '是否有效',
+ area_name: '库区名称',
+ area_property: '库区类型',
+ location_name: '库位编码',
+ location_length: '库位长(m)',
+ location_width: '库位宽(m)',
+ location_heigth: '库位高(m)',
+ location_volume: '库位容积(m³)',
+ location_load: '库位承重(kg)',
+ roadway_number: '巷道号',
+ shelf_number: '货架号',
+ layer_number: '层号',
+ tag_number: '位号',
+ picking_area: '拣货区',
+ stocking_area: '备货区',
+ receiving_area: '收货区',
+ return_area: '退货区',
+ defective_area: '次品区',
+ inventory_area: '存货区',
+ creator: '创建人',
+ create_time: '创建时间',
+ last_update_time: '最后更新时间'
+ },
+ customer: {
+ customer_name: '客户名称',
+ city: '所在城市',
+ address: '详细地址',
+ manager: '负责人',
+ email: 'Email',
+ contact_tel: '联系方式',
+ creator: '创建人',
+ create_time: '创建时间',
+ last_update_time: '最后更新时间',
+ is_valid: '是否有效'
+ },
+ supplier: {
+ supplier_name: '供应商名称',
+ city: '所在城市',
+ address: '详细地址',
+ email: 'Email',
+ manager: '负责人',
+ contact_tel: '联系方式',
+ creator: '创建人',
+ create_time: '创建时间',
+ last_update_time: '最后更新时间',
+ is_valid: '是否有效'
+ },
+ userRoleSetting: {
+ role_name: '用户角色',
+ is_valid: '是否有效'
+ },
+ companySetting: {
+ company_name: '公司名称',
+ city: '所在城市',
+ address: '详细地址',
+ manager: '负责人',
+ contact_tel: '联系方式'
+ },
+ ownerOfCargo: {
+ goods_owner_name: '货主名称',
+ city: '所在城市',
+ address: '详细地址',
+ manager: '负责人',
+ contact_tel: '联系方式',
+ creator: '创建人',
+ create_time: '创建时间'
+ },
+ commodityCategorySetting: {
+ category_name: '商品类别',
+ parent_name: '所属类别',
+ creator: '创建人',
+ create_time: '创建时间'
+ },
+ roleMenu: {
+ role_name: '角色名称',
+ menu_name: '菜单名称',
+ beforeUpdateOrDel: '请先选择需要处理的数据!'
+ },
+ commodityManagement: {
+ spu_code: '商品编码',
+ spu_name: '商品名称',
+ sku_code: '规格编码',
+ sku_name: '规格名称',
+ category_name: '商品类别',
+ spu_description: '商品描述',
+ bar_code: '商品条码',
+ supplier_name: '供应商名称',
+ brand: '品牌',
+ unit: '商品单位',
+ cost: '商品成本',
+ price: '商品价格',
+ origin: '产地',
+ length_unit: '长度单位',
+ volume_unit: '体积单位',
+ weight_unit: '重量单位',
+ weight: '商品重量',
+ lenght: '商品长度',
+ width: '商品宽度',
+ height: '商品高度',
+ volume: '商品体积'
+ }
+ },
+ wms: {
+ stock: {
+ stockSelectModal: '库存选择框',
+ skuSelectModal: '商品选择框',
+ warehouse: '仓库名称',
+ location_name: '库位编码',
+ qty_available: '可用数量'
+ },
+ warehouseWorking: {
+ warehouseProcessing: {
+ job_code: '作业单号',
+ job_type: '作业类型',
+ process_status: '加工状态',
+ processor: '操作人',
+ process_time: '操作时间',
+ qty: '数量',
+ is_source: '是否来源商品',
+ spu_code: '商品编码',
+ spu_name: '商品名称',
+ sku_code: '规格编码',
+ sku_name: '规格名称',
+ target_warehouse: '目标仓库',
+ target_location: '目标库位',
+ unit: '商品单位',
+ is_update_stock: '是否已更新库存',
+ creator: '创建人',
+ create_time: '创建时间',
+ last_update_time: '最后更新时间',
+ adjust_status: '是否已调整',
+ source: '来源',
+ target: '目标',
+ process_split: '拆分加工',
+ process_combine: '组合加工',
+ confirmProcess: '确认加工',
+ confirmAdjust: '确认调整',
+ qtyMoreThanAvailable: '不可超过可用数量',
+ beforeConfirmProcess: '您确认对该条数据进行加工吗?',
+ beforeConfirmAdjust: '您确认对该条数据进行调整吗?',
+ alreadyProcess: '该数据已完成加工,不可删除',
+ alreadyAdjust: '该数据已完成调整,不可删除'
+ },
+ warehouseMove: {
+ job_code: '作业单号',
+ move_status: '作业状态',
+ qty: '数量',
+ handler: '操作人',
+ handle_time: '操作时间',
+ orig_goods_warehouse: '来源仓库',
+ orig_goods_location_name: '来源库位',
+ dest_googs_warehouse: '目标仓库',
+ dest_googs_location_name: '目标库位',
+ confirmMove: '确认移库',
+ creator: '创建人',
+ create_time: '创建时间',
+ beforeConfirmMove: '您确认对该条数据进行移库吗?',
+ unadjust: '未调整',
+ adjusted: '已调整'
+ },
+ warehouseFreeze: {
+ job_code: '作业单号',
+ job_type: '作业类型',
+ handler: '操作人',
+ handle_time: '操作时间',
+ creator: '创建人',
+ create_time: '创建时间',
+ warehouse: '所在仓库',
+ location_name: '所在库位',
+ freeze: '冻结',
+ unfreeze: '解冻'
+ },
+ warehouseAdjust: {
+ job_code: '作业单号',
+ job_type: '作业类型',
+ warehouse: '所在仓库',
+ location_name: '所在库位',
+ handler: '操作人',
+ handle_time: '操作时间',
+ creator: '创建人',
+ create_time: '创建时间',
+ qty: '调整差异数量',
+ warehouseTake: '盘点',
+ processCombine: '仓内加工',
+ processSplit: '仓内加工',
+ warehouseMove: '移库',
+ confirmAdjust: '确认调整',
+ beforeConfirmAdjust: '您确认对该条数据进行调整吗?'
+ },
+ warehouseTaking: {
+ job_code: '作业单号',
+ job_status: '作业状态',
+ warehouse: '所在仓库',
+ location_name: '所在库位',
+ book_qty: '账面数量',
+ counted_qty: '盘点数量',
+ difference_qty: '差异数量',
+ confirmTaking: '确认盘点',
+ handler: '操作人',
+ handle_time: '操作时间',
+ creator: '创建人',
+ create_time: '创建时间',
+ unfinish: '待作业',
+ finish: '已完成',
+ confirmAdjust: '确认调整',
+ beforeConfirmAdjust: '您确认对该条数据进行调整吗?',
+ addFromCommodity: '选择商品',
+ addFromStock: '选择库存',
+ addTips: '当目标库存不存在时,可通过手动选择商品和库位来新增记录'
+ }
+ },
+ stockManagement: {
+ stockLocation: '库位列表',
+ stock: '库存列表'
+ },
+ stockLocation: {
+ warehouse_name: '仓库名称',
+ location_name: '库位名称',
+ spu_code: '商品编码',
+ spu_name: '商品名称',
+ sku_id: '规格标识',
+ sku_code: '规格编码',
+ sku_name: '规格名称',
+ qty: '数量',
+ qty_available: '可用数量',
+ qty_locked: '锁定数量',
+ qty_frozen: '冻结数量'
+ },
+ stockList: {
+ spu_code: '商品编码',
+ spu_name: '商品名称',
+ sku_code: '规格编码',
+ sku_id: '规格标识',
+ qty: '数量',
+ qty_available: '可用数量',
+ qty_locked: '锁定数量',
+ qty_frozen: '冻结数量',
+ qty_asn: '到货通知书数量',
+ qty_to_unload: '待卸货数量',
+ qty_to_sort: '待分拣数量',
+ qty_sorted: '已分拣数量',
+ shortage_qty: '欠货数量'
+ },
+ stockAsn: {
+ tabNotice: '到货通知',
+ tabToDoArrival: '待到货',
+ tabToDoUnload: '待卸货',
+ tabToDoSorting: '待分拣',
+ tabToDoGrounding: '待上架',
+ tabReceiptDetails: '收货明细'
+ },
+ stockAsnInfo: {
+ id: '标识',
+ asn_no: '到货通知书编号',
+ asn_status: '到货通知书状态',
+ spu_id: '商品spu标识',
+ spu_code: '商品编码',
+ spu_name: '商品名称',
+ sku_id: '商品sku标识',
+ sku_code: '规格编码',
+ sku_name: '规格名称',
+ origin: '产地',
+ length_unit: '长度单位',
+ volume_unit: '体积单位',
+ weight_unit: '重量单位',
+ asn_qty: '到货通知书数据',
+ actual_qty: '上架数量',
+ sorted_qty: '分拣数量',
+ shortage_qty: '短少数量',
+ more_qty: '超量数量',
+ damage_qty: '破损数量',
+ weight: '总重量',
+ volume: '总体积',
+ supplier_id: '供应商标识',
+ supplier_name: '供应商名称',
+ goods_owner_id: '货主标识',
+ goods_owner_name: '货主名称',
+ is_valid: '是否有效'
+ },
+ skuInfo: {
+ spu_id: '商品spu标识',
+ spu_code: '商品编码',
+ spu_name: '商品名称',
+ category_id: '商品类别标识',
+ category_name: '商品类别',
+ spu_description: '商品描述',
+ bar_code: '商品条码',
+ supplier_id: '供应商标识',
+ supplier_name: '供应商名称',
+ brand: '品牌',
+ origin: '产地',
+ length_unit: '长度单位',
+ volume_unit: '体积单位',
+ weight_unit: '重量单位',
+ sku_id: '规格标识',
+ sku_code: '规格编码',
+ sku_name: '规格名称',
+ weight: '总重量',
+ lenght: '商品长度',
+ width: '商品宽度',
+ height: '商品高度',
+ volume: '商品体积',
+ unit: '商品单位',
+ cost: '商品成本',
+ price: '商品价格'
+ },
+ deliveryManagement: {
+ shipment: '发货单',
+ preShipment: '预发货',
+ newShipment: '新发货',
+ goodsToBePicked: '待拣货',
+ picked: '已拣货',
+ toBePackaged: '待打包',
+ package: '打包',
+ packaged: '已打包',
+ toBeWeighed: '待称重',
+ weigh: '称重',
+ weighed: '已称重',
+ delivery: '出库',
+ toBeDelivered: '待出库',
+ outOfWarehouse: '已出库',
+ signIn: '签收',
+ signedIn: '已签收',
+ dispatch_no: '发货单号',
+ dispatch_status: '发货单状态',
+ qty: '总数量',
+ detailQty: '数量',
+ weight: '总重量',
+ volume: '总体积',
+ customer_name: '客户名称',
+ spu_code: '商品编码',
+ spu_name: '商品名称',
+ sku_code: '规格编码',
+ creator: '创建人',
+ create_time: '创建时间',
+ confirmOrder: '确认发货单',
+ orderDetail: '发货单商品详情',
+ quantityOverflow: '发货数量之和不能超出发货单数量',
+ quantityIsZero: '请保证选择的商品至少有一项出库数量大于0!',
+ NoItemSelected: '请至少选中一项商品进行出库!',
+ confirmSuccess: '确认发货单成功!',
+ confirmPicking: '确认拣货',
+ confirmDelivery: '确认出库',
+ confirmSignIn: '确认签收',
+ detailWeight: '重量',
+ unpackage_qty: '待打包数量',
+ unweighing_qty: '待称重数量',
+ validQtyMsgPackage: '请输入有效数值, 且不能超过总数量',
+ validQtyMsgSignIn: '请输入有效数值, 且不能超过总数量',
+ signInQty: '实际签收数量',
+ incorrectStatusMsg: '操作失败, 状态应该为',
+ backToThePreviousStep: '撤回到上一个流程',
+ confirmBack: '确认撤回',
+ or: '或',
+ irreversible: '此操作不可逆',
+ detailQuantityIsZero: '发货数量不能为0',
+ qty_available: '可用数量',
+ spu_description: '商品描述',
+ bar_code: '条码',
+ order_qty: '订单数量',
+ unpicked_qty: '待拣货数量',
+ picked_qty: '已拣货数量',
+ detailVolume: '体积',
+ package_qty: '已打包数量',
+ package_person: '打包员',
+ package_time: '打包时间',
+ weighing_no: '称重单号',
+ package_no: '打包流水号',
+ weighing_person: '称重员',
+ weighing_weight: '称重重量',
+ waybill_no: '运单号',
+ carrier: '承运单位',
+ damagedQuantity: '到货破损数量',
+ setFreight: '设置承运单位',
+ departure_city: '始发城市',
+ arrival_city: '到货城市',
+ ViewInventoryDetails: '查看商品明细',
+ invalidValue: '请输入有效数值',
+ exceedingQuantity: '不能超过总数量'
+ }
+ }
+}
diff --git a/frontend/src/languages/langs/enUs.ts b/frontend/src/languages/langs/enUs.ts
index 33cd86d..8e5e60a 100644
--- a/frontend/src/languages/langs/enUs.ts
+++ b/frontend/src/languages/langs/enUs.ts
@@ -1,536 +1,536 @@
-export default {
- system: {
- hookComponent: {
- dialog: {
- defaultClose: 'Close',
- defaultConfirm: 'Agree',
- defaultTitle: 'Tips'
- }
- },
- page: {
- add: 'Add',
- update: 'Update',
- refresh: 'Refresh',
- export: 'Export',
- operate: 'Operate',
- edit: 'Edit',
- delete: 'Delete',
- close: 'Colse',
- submit: 'Submit',
- reset: 'Reset',
- confirm: 'Confirm',
- insertOneRow: 'Insert One Row',
- view: 'View',
- import: 'Import',
- chooseFile: 'Choose File',
- exportTemplate: 'Export Template',
- noData: 'No data',
- },
- tips: {
- success: ' success!',
- fail: ' fail!',
- beforeDeleteMessage: 'Do you want to delete this data?',
- beforeDeleteDetailMessage: 'Are you sure you want to delete this row?',
- detailLengthIsZero: 'Details verification before document submission!',
- detailHasItemRepeat: 'The details contain duplicate items!',
- noData: 'no data',
- beforeAsnConfirm: 'Confirm Arrival?',
- beforeAsnUnload: 'Confirm Unload?',
- beforeAsnSorted: 'Confirm Sorted?',
- requestTimeout: 'Request Timeout!',
- requestFail: 'Request fail.Please try it again'
- },
- checkText: {
- checkFormFail: 'Operation failed. Please check the data and try again!',
- mustInput: 'Please fill in the ',
- mustSelect: 'Please select ',
- integer: ' integer',
- decimal: ' decimal',
- pleaseEnter: 'Please enter ',
- inputIntMsg: 'decimal places of integer part',
- inputDecimalMsg: ' decimal places of the decimal part',
- lengthValid: 'The length should be between '
- },
- homeHeader: {
- logout: 'Logout'
- },
- combobox: {
- sex: {
- male: 'Male',
- female: 'Female'
- },
- yesOrNo: {
- yes: 'yes',
- no: 'no'
- }
- },
- pager: {
- pageSizes: '/page',
- goTo: 'Go to',
- total: 'Total',
- record: 'record'
- }
- },
- router: {
- sideBar: {
- homepage: 'Home Page',
- baseModule: 'Basic Settings',
- ownerOfCargo: 'Owner Information',
- menuBasicSettings: 'Menu',
- userManagement: 'User Management',
- commodityCategorySetting: 'Commodity Category',
- commodityManagement: 'Commodity Management',
- userRoleSetting: 'User Role',
- companySetting: 'Company Information',
- freightSetting: 'Freight Setting',
- warehouseSetting: 'Warehouse Setting',
- customer: 'Customer Info',
- supplier: 'Supplier Info',
- roleMenu: 'Role Menu Settings',
- stockManagement: 'Stock Management',
- warehouseWorkingModule: 'Warehouse Working',
- warehouseProcessing: 'Warehouse Processing',
- warehouseMove: 'Inventory Move',
- warehouseFreeze: 'Inventory freeze',
- warehouseAdjust: 'Inventory Adjust',
- warehouseTaking: 'Inventory Take',
- deliveryManagement: 'Delivery Management',
- stockAsn: 'Receiving Management'
- }
- },
- login: {
- welcomeTitle: 'Welcome to ModernWMS!👋🏻',
- mainButtonLabel: 'Login',
- rememberTips: 'Remember me',
- userName: 'UserName',
- password: 'Password',
- loginSuccess: 'Login succeeded!',
- notAuthority: 'Undistributed menu access the account, please contact the administrator to add it!',
- registerTips: 'No account? Click here to register!',
- register: 'Register'
- },
- homepage: {
- subTitle: 'Modern Warehouse Management System'
- },
- base: {
- freightSetting: {
- carrier: 'carrier',
- departure_city: 'Departure City',
- arrival_city: 'Arrival City',
- price_per_weight: 'Weight Fee',
- price_per_volume: 'Volume Fee',
- min_payment: 'Min Payment',
- creator: 'Creator',
- create_time: 'Create Time',
- last_update_time: 'Last Update Time',
- is_valid: 'Valid',
- freightSelectModal: 'Freight Select Modal',
- },
- userManagement: {
- user_num: 'User Num',
- user_name: 'User Name',
- user_role: 'Role',
- contact_tel: 'Contact Information',
- sex: 'Sex',
- is_valid: 'Valid',
- restPwd: 'Reset password',
- checkboxIsNull: 'Please select data!',
- beforeResetPwd: 'Are you sure you want to reset the passwords of these users?',
- afterResetPwd: 'Password reset succeeded, The new password is ',
- user_register_name: 'User Name',
- email: 'Email',
- auth_string: 'Password'
- },
- warehouseSetting: {
- warehouseSetting: 'Warehouse Setting',
- reservoirSetting: 'Reservoir Setting',
- locationSetting: 'Location Setting',
- locationSelectModal: 'Location Select Modal',
- email: 'Email',
- warehouse_name: 'Warehouse Name',
- city: 'City',
- address: 'Address',
- contact_tel: 'Acontact Tel',
- manager: 'Manager',
- is_valid: 'Valid',
- area_name: 'Reservoir Name',
- area_property: 'Reservoir Category',
- location_name: 'Location Code',
- location_length: 'Location Length(m)',
- location_width: 'Location Width(m)',
- location_heigth: 'Location Height(m)',
- location_volume: 'Location Volume(m³)',
- location_load: 'Location Load(kg)',
- roadway_number: 'Roadway Number',
- shelf_number: 'Shelf Number',
- layer_number: 'Layer Number',
- tag_number: 'Tag Number',
- picking_area: 'Picking Area',
- stocking_area: 'Stocking Area',
- receiving_area: 'Receiving Area',
- return_area: 'Return Area',
- defective_area: 'Defective Area',
- inventory_area: 'Inventory Area',
- creator: 'Creator',
- create_time: 'Create Time',
- last_update_time: 'Last Update Time'
- },
- customer: {
- customer_name: 'Customer Name',
- city: 'City',
- address: 'Address',
- manager: 'Manager',
- email: 'Email',
- contact_tel: 'Contact Tel',
- creator: 'Creator',
- create_time: 'Create Time',
- last_update_time: 'Last Update Time',
- is_valid: 'Valid'
- },
- supplier: {
- supplier_name: 'Supplier Name',
- city: 'City',
- address: 'Address',
- email: 'Email',
- manager: 'Manager',
- contact_tel: 'Contact Tel',
- creator: 'Creator',
- create_time: 'Create Time',
- last_update_time: 'Last Update Time',
- is_valid: 'Valid'
- },
- userRoleSetting: {
- role_name: 'User Role',
- is_valid: 'Valid'
- },
- companySetting: {
- company_name: 'Corporate Name',
- city: 'City',
- address: 'Detailed Address',
- manager: 'Person In Charge',
- contact_tel: 'Contact Information'
- },
- ownerOfCargo: {
- goods_owner_name: 'Owner Of Cargo',
- city: 'City',
- address: 'Detailed Address',
- manager: 'Person In Charge',
- contact_tel: 'Contact Information',
- creator: 'Creator',
- create_time: 'Create Time'
- },
- commodityCategorySetting: {
- category_name: 'Commodity category',
- parent_name: 'Parent Category',
- creator: 'Creator',
- create_time: 'Create Time'
- },
- roleMenu: {
- role_name: 'Role Name',
- menu_name: 'Menu Name',
- beforeUpdateOrDel: 'Please select the data to be processed first!'
- },
- commodityManagement: {
- spu_code: 'Commodity Code',
- spu_name: 'Commodity Name',
- category_name: 'Commodity Category',
- spu_description: 'Commodity Description',
- bar_code: 'Specification Code',
- sku_code: 'Specification Code',
- sku_name: 'Specification Name',
- supplier_name: 'Supplier Name',
- brand: 'Brand',
- unit: 'Commodity Unit',
- cost: 'Commodity Cost',
- price: 'Commodity Price',
- origin: 'origin',
- length_unit: 'Length Unit',
- volume_unit: 'Volume Unit',
- weight_unit: 'Weight Unit',
- weight: 'Commodity Weight',
- lenght: 'Commodity Length',
- width: 'Commodity Width',
- height: 'Commodity Height',
- volume: 'Commodity Volume'
- }
- },
- wms: {
- stock: {
- stockSelectModal: 'Stock Select Modal',
- skuSelectModal: 'Commodity Select Modal',
- warehouse: 'Warehouse Name',
- location_name: 'Location Code',
- qty_available: 'Available Qty'
- },
- warehouseWorking: {
- warehouseProcessing: {
- job_code: 'Job Code',
- job_type: 'Job Type',
- process_status: 'Process Status',
- processor: 'Processor',
- process_time: 'Process Time',
- qty: 'Qty',
- is_source: 'Is Source',
- spu_code: 'Commodity Code',
- spu_name: 'Commodity Name',
- sku_code: 'Specification Code',
- sku_name: 'Specification Name',
- target_warehouse: 'Target Warehouse',
- target_location: 'Target Location',
- unit: 'Unit',
- is_update_stock: 'Is Updated Stock',
- creator: 'Creator',
- create_time: 'Create Time',
- last_update_time: 'Last Update Time',
- adjust_status: 'Is Updated Stock',
- source: 'Source',
- target: 'Target',
- process_split: 'Split Processing',
- process_combine: 'Combine Processing',
- confirmProcess: 'Confirm Process',
- confirmAdjust: 'Confirm Adjust',
- qtyMoreThanAvailable: 'Can\'t more than the number of Available',
- beforeConfirmProcess: 'Are you sure to process this data?',
- beforeConfirmAdjust: 'Are you sure to adjust this data?',
- alreadyProcess: 'The data can\'t delete because it had been processed',
- alreadyAdjust: 'The data can\'t delete because it had been adjusted'
- },
- warehouseMove: {
- job_code: 'Job No',
- move_status: 'Move Status',
- qty: 'Qty',
- handler: 'Handler',
- handle_time: 'Handle Time',
- orig_goods_warehouse: 'Origin Warehouse',
- orig_goods_location_name: 'Origin Location',
- dest_googs_warehouse: 'Target Warehouse',
- dest_googs_location_name: 'Target Location',
- confirmMove: 'Confirm Move',
- creator: 'Creator',
- create_time: 'Create Time',
- beforeConfirmMove: 'Are you sure to move this data?',
- unadjust: 'Unadjust',
- adjusted: 'Adjusted'
- },
- warehouseFreeze: {
- job_code: 'Job Code',
- job_type: 'Job Type',
- handler: 'Handler',
- handle_time: 'Handle Time',
- creator: 'Creator',
- create_time: 'Create Time',
- warehouse: 'Warehouse',
- location_name: 'Location Code',
- freeze: 'Freeze',
- unfreeze: 'Unfreeze'
- },
- warehouseAdjust: {
- job_code: 'Job Code',
- job_type: 'Job Type',
- warehouse: 'Warehouse',
- location_name: 'Location Code',
- handler: 'Handler',
- handle_time: 'Handle Time',
- creator: 'Creator',
- create_time: 'Create Time',
- qty: 'Difference Qty',
- warehouseTake: 'Warehouse Take',
- processCombine: 'Warehouse Process',
- processSplit: 'Warehouse Process',
- warehouseMove: 'Warehouse Move',
- confirmAdjust: 'Confirm Adjust',
- beforeConfirmAdjust: 'Are you sure to adjust this data?'
- },
- warehouseTaking: {
- job_code: 'Job Code',
- job_status: 'Job Status',
- warehouse: 'Warehouse',
- location_name: 'Location Code',
- book_qty: 'Book Qty',
- counted_qty: 'Actual Qty',
- difference_qty: 'Difference Qty',
- handler: 'Handler',
- handle_time: 'Handle Time',
- creator: 'Creator',
- create_time: 'Create Time',
- confirmTaking: 'Confirm Taking',
- unfinish: 'Unfinish',
- finish: 'Finish',
- confirmAdjust: 'Confirm Adjust',
- beforeConfirmAdjust: 'Are you sure to adjust this data?',
- addFromCommodity: 'Choose From Commodity',
- addFromStock: 'Choose From Inventory',
- addTips: 'You can choose goods and the location to add a new record when there is no target inventory'
- }
- },
- stockManagement: {
- stockLocation: 'Stock Location',
- stock: 'Stock'
- },
- stockLocation: {
- warehouse_name: 'Warehouse',
- location_name: 'Location Code',
- spu_code: 'Commodity code',
- spu_name: 'Trade name',
- sku_id: 'Sku Id',
- sku_code: 'Specification code',
- sku_name: 'Form Name',
- qty: 'Quantity',
- qty_available: 'Available Quantity',
- qty_locked: 'Locked Quantity',
- qty_frozen: 'Frozen Quantity'
- },
- stockList: {
- spu_code: 'Commodity code',
- spu_name: 'Trade name',
- sku_code: 'Specification code',
- sku_id: 'Sku Id',
- qty: 'Quantity',
- qty_available: 'Available Quantity',
- qty_locked: 'Locked Quantity',
- qty_frozen: 'Frozen Quantity',
- qty_asn: 'Asn Quantity',
- qty_to_unload: 'Unload Quantity',
- qty_to_sort: 'Sort Quantity',
- qty_sorted: 'Sorted Quantity',
- shortage_qty: 'Shortage Quantity'
- },
- stockAsn: {
- tabNotice: 'Notice Of Arrival',
- tabToDoArrival: 'To Be Delivered',
- tabToDoUnload: 'To Be Unloaded',
- tabToDoSorting: 'To Be Sorted',
- tabToDoGrounding: 'To Be Put On The Shelf',
- tabReceiptDetails: 'Receipt Details'
- },
- stockAsnInfo: {
- id: 'ID',
- asn_no: 'Asn No',
- asn_status: 'Asn Status',
- spu_id: 'Spu Id',
- spu_code: 'Commodity code',
- spu_name: 'Trade name',
- sku_id: 'Sku Id',
- sku_code: 'Specification code',
- sku_name: 'Form Name',
- origin: 'Origin',
- length_unit: 'Length Unit',
- volume_unit: 'Volume Unit',
- weight_unit: 'Weight Unit',
- asn_qty: 'Asn Quantity',
- actual_qty: 'Actual Quantity',
- sorted_qty: 'Sorted Quantity',
- shortage_qty: 'Shortage Quantity',
- more_qty: 'More Quantity',
- damage_qty: 'Damage Quantity',
- weight: 'Weight',
- volume: 'Volume',
- supplier_id: 'Supplier Id',
- supplier_name: 'Supplier Name',
- goods_owner_id: 'Goods Owner Id',
- goods_owner_name: 'Goods Owner Name',
- is_valid: 'Valid'
- },
- skuInfo: {
- spu_id: 'Spu Id',
- spu_code: 'Commodity code',
- spu_name: 'Trade name',
- category_id: 'Commodity Category ID',
- category_name: 'Commodity Category',
- spu_description: 'Commodity Description',
- bar_code: 'Specification Code',
- supplier_id: 'Supplier Id',
- supplier_name: 'Supplier Name',
- brand: 'Brand',
- origin: 'origin',
- length_unit: 'Length Unit',
- volume_unit: 'Volume Unit',
- weight_unit: 'Weight Unit',
- sku_id: 'Sku Id',
- sku_code: 'Specification code',
- sku_name: 'Form Name',
- weight: 'Commodity Weight',
- lenght: 'Commodity Length',
- width: 'Commodity Width',
- height: 'Commodity Height',
- volume: 'Commodity Volume',
- unit: 'Commodity Unit',
- cost: 'Commodity Cost',
- price: 'Commodity Price'
- },
- deliveryManagement: {
- shipment: 'Invoice',
- preShipment: 'Pre Shipment',
- newShipment: 'New Shipment',
- goodsToBePicked: 'To Be Picked',
- picked: 'Picked',
- toBePackaged: 'To Be Packaged',
- package: 'Pack',
- packaged: 'Packaged',
- toBeWeighed: 'To Be Weighed',
- weigh: 'Weigh',
- weighed: 'Weighed',
- delivery: 'Delivery',
- toBeDelivered: 'To Be Delivered',
- outOfWarehouse: 'Delivered',
- signIn: 'Sign In',
- signedIn: 'Signed In',
- dispatch_no: 'Shipment No',
- dispatch_status: 'Shipment Doc Status',
- qty: 'Total Quantity',
- detailQty: 'Quantity',
- weight: 'Total Weight',
- volume: 'Total Volume',
- customer_name: 'Customer Name',
- spu_code: 'Commodity Code',
- spu_name: 'Commodity Name',
- sku_code: 'Specification Code',
- creator: 'Created By',
- create_time: 'Creation Time',
- confirmOrder: 'Confirm Shipment Doc',
- orderDetail: 'Shipment Order Product Details',
- quantityOverflow: 'The sum of shipment quantity cannot exceed the shipment document quantity',
- quantityIsZero: 'Please ensure that at least one of the selected goods has an issue quantity greater than 0!',
- NoItemSelected: 'Please select at least one commodity to delivered!',
- confirmSuccess: 'Confirm the shipment order successfully!',
- confirmPicking: 'Confirm Picking',
- confirmDelivery: 'Confirm Delivery',
- confirmSignIn: 'Confirm Signing',
- detailWeight: 'Weight',
- unpackage_qty: 'Quantity to be packaged',
- unweighing_qty: 'Quantity to be weighed',
- validQtyMsgPackage: 'Please enter a valid value, which cannot exceed the total quantity',
- validQtyMsgSignIn: 'Please enter a valid value',
- signInQty: 'Actual signed in quantity',
- incorrectStatusMsg: 'Operation failed, the status should be',
- backToThePreviousStep: 'Recall to previous process',
- confirmBack: 'Confirm withdrawal',
- or: ' or ',
- irreversible: 'This operation is irreversible',
- detailQuantityIsZero: 'Shipment quantity cannot be 0',
- qty_available: 'Available Quantity',
- spu_description: 'Product Description',
- bar_code: 'Bar Code',
- order_qty: 'Order Quantity',
- unpicked_qty: 'Quantity to be picked',
- picked_qty: 'Picked Quantity',
- detailVolume: 'Volume',
- package_qty: 'Packed Quantity',
- package_person: 'Packer',
- package_time: 'Packaging Time',
- weighing_no: 'Weighing sheet No',
- package_no: 'Packaging serial No',
- weighing_person: 'Weigher',
- weighing_weight: 'Weighing Weight',
- waybill_no: 'Waybill No',
- carrier: 'Carrier',
- damagedQuantity: 'Damaged quantity upon arrival',
- setFreight: 'Set Carrier',
- departure_city: 'Originating city',
- arrival_city: 'City of arrival',
- ViewInventoryDetails: 'View product details',
- invalidValue: 'Please enter a valid value',
- exceedingQuantity: 'Cannot exceed the total quantity'
- }
- }
-}
+export default {
+ system: {
+ hookComponent: {
+ dialog: {
+ defaultClose: 'Close',
+ defaultConfirm: 'Agree',
+ defaultTitle: 'Tips'
+ }
+ },
+ page: {
+ add: 'Add',
+ update: 'Update',
+ refresh: 'Refresh',
+ export: 'Export',
+ operate: 'Operate',
+ edit: 'Edit',
+ delete: 'Delete',
+ close: 'Colse',
+ submit: 'Submit',
+ reset: 'Reset',
+ confirm: 'Confirm',
+ insertOneRow: 'Insert One Row',
+ view: 'View',
+ import: 'Import',
+ chooseFile: 'Choose File',
+ exportTemplate: 'Export Template',
+ noData: 'No data',
+ },
+ tips: {
+ success: ' success!',
+ fail: ' fail!',
+ beforeDeleteMessage: 'Do you want to delete this data?',
+ beforeDeleteDetailMessage: 'Are you sure you want to delete this row?',
+ detailLengthIsZero: 'Details verification before document submission!',
+ detailHasItemRepeat: 'The details contain duplicate items!',
+ noData: 'no data',
+ beforeAsnConfirm: 'Confirm Arrival?',
+ beforeAsnUnload: 'Confirm Unload?',
+ beforeAsnSorted: 'Confirm Sorted?',
+ requestTimeout: 'Request Timeout!',
+ requestFail: 'Request fail.Please try it again'
+ },
+ checkText: {
+ checkFormFail: 'Operation failed. Please check the data and try again!',
+ mustInput: 'Please fill in the ',
+ mustSelect: 'Please select ',
+ integer: ' integer',
+ decimal: ' decimal',
+ pleaseEnter: 'Please enter ',
+ inputIntMsg: 'decimal places of integer part',
+ inputDecimalMsg: ' decimal places of the decimal part',
+ lengthValid: 'The length should be between '
+ },
+ homeHeader: {
+ logout: 'Logout'
+ },
+ combobox: {
+ sex: {
+ male: 'Male',
+ female: 'Female'
+ },
+ yesOrNo: {
+ yes: 'yes',
+ no: 'no'
+ }
+ },
+ pager: {
+ pageSizes: '/page',
+ goTo: 'Go to',
+ total: 'Total',
+ record: 'record'
+ }
+ },
+ router: {
+ sideBar: {
+ homepage: 'Home Page',
+ baseModule: 'Basic Settings',
+ ownerOfCargo: 'Owner Information',
+ menuBasicSettings: 'Menu',
+ userManagement: 'User Management',
+ commodityCategorySetting: 'Commodity Category',
+ commodityManagement: 'Commodity Management',
+ userRoleSetting: 'User Role',
+ companySetting: 'Company Information',
+ freightSetting: 'Freight Setting',
+ warehouseSetting: 'Warehouse Setting',
+ customer: 'Customer Info',
+ supplier: 'Supplier Info',
+ roleMenu: 'Role Menu Settings',
+ stockManagement: 'Stock Management',
+ warehouseWorkingModule: 'Warehouse Working',
+ warehouseProcessing: 'Warehouse Processing',
+ warehouseMove: 'Inventory Move',
+ warehouseFreeze: 'Inventory freeze',
+ warehouseAdjust: 'Inventory Adjust',
+ warehouseTaking: 'Inventory Take',
+ deliveryManagement: 'Delivery Management',
+ stockAsn: 'Receiving Management'
+ }
+ },
+ login: {
+ welcomeTitle: 'Welcome to ModernWMS!👋🏻',
+ mainButtonLabel: 'Login',
+ rememberTips: 'Remember me',
+ userName: 'UserName',
+ password: 'Password',
+ loginSuccess: 'Login succeeded!',
+ notAuthority: 'Undistributed menu access the account, please contact the administrator to add it!',
+ registerTips: 'No account? Click here to register!',
+ register: 'Register'
+ },
+ homepage: {
+ subTitle: 'Modern Warehouse Management System'
+ },
+ base: {
+ freightSetting: {
+ carrier: 'carrier',
+ departure_city: 'Departure City',
+ arrival_city: 'Arrival City',
+ price_per_weight: 'Weight Fee',
+ price_per_volume: 'Volume Fee',
+ min_payment: 'Min Payment',
+ creator: 'Creator',
+ create_time: 'Create Time',
+ last_update_time: 'Last Update Time',
+ is_valid: 'Valid',
+ freightSelectModal: 'Freight Select Modal',
+ },
+ userManagement: {
+ user_num: 'User Num',
+ user_name: 'User Name',
+ user_role: 'Role',
+ contact_tel: 'Contact Information',
+ sex: 'Sex',
+ is_valid: 'Valid',
+ restPwd: 'Reset password',
+ checkboxIsNull: 'Please select data!',
+ beforeResetPwd: 'Are you sure you want to reset the passwords of these users?',
+ afterResetPwd: 'Password reset succeeded, The new password is ',
+ user_register_name: 'User Name',
+ email: 'Email',
+ auth_string: 'Password'
+ },
+ warehouseSetting: {
+ warehouseSetting: 'Warehouse Setting',
+ reservoirSetting: 'Reservoir Setting',
+ locationSetting: 'Location Setting',
+ locationSelectModal: 'Location Select Modal',
+ email: 'Email',
+ warehouse_name: 'Warehouse Name',
+ city: 'City',
+ address: 'Address',
+ contact_tel: 'Acontact Tel',
+ manager: 'Manager',
+ is_valid: 'Valid',
+ area_name: 'Reservoir Name',
+ area_property: 'Reservoir Category',
+ location_name: 'Location Code',
+ location_length: 'Location Length(m)',
+ location_width: 'Location Width(m)',
+ location_heigth: 'Location Height(m)',
+ location_volume: 'Location Volume(m³)',
+ location_load: 'Location Load(kg)',
+ roadway_number: 'Roadway Number',
+ shelf_number: 'Shelf Number',
+ layer_number: 'Layer Number',
+ tag_number: 'Tag Number',
+ picking_area: 'Picking Area',
+ stocking_area: 'Stocking Area',
+ receiving_area: 'Receiving Area',
+ return_area: 'Return Area',
+ defective_area: 'Defective Area',
+ inventory_area: 'Inventory Area',
+ creator: 'Creator',
+ create_time: 'Create Time',
+ last_update_time: 'Last Update Time'
+ },
+ customer: {
+ customer_name: 'Customer Name',
+ city: 'City',
+ address: 'Address',
+ manager: 'Manager',
+ email: 'Email',
+ contact_tel: 'Contact Tel',
+ creator: 'Creator',
+ create_time: 'Create Time',
+ last_update_time: 'Last Update Time',
+ is_valid: 'Valid'
+ },
+ supplier: {
+ supplier_name: 'Supplier Name',
+ city: 'City',
+ address: 'Address',
+ email: 'Email',
+ manager: 'Manager',
+ contact_tel: 'Contact Tel',
+ creator: 'Creator',
+ create_time: 'Create Time',
+ last_update_time: 'Last Update Time',
+ is_valid: 'Valid'
+ },
+ userRoleSetting: {
+ role_name: 'User Role',
+ is_valid: 'Valid'
+ },
+ companySetting: {
+ company_name: 'Corporate Name',
+ city: 'City',
+ address: 'Detailed Address',
+ manager: 'Person In Charge',
+ contact_tel: 'Contact Information'
+ },
+ ownerOfCargo: {
+ goods_owner_name: 'Owner Of Cargo',
+ city: 'City',
+ address: 'Detailed Address',
+ manager: 'Person In Charge',
+ contact_tel: 'Contact Information',
+ creator: 'Creator',
+ create_time: 'Create Time'
+ },
+ commodityCategorySetting: {
+ category_name: 'Commodity category',
+ parent_name: 'Parent Category',
+ creator: 'Creator',
+ create_time: 'Create Time'
+ },
+ roleMenu: {
+ role_name: 'Role Name',
+ menu_name: 'Menu Name',
+ beforeUpdateOrDel: 'Please select the data to be processed first!'
+ },
+ commodityManagement: {
+ spu_code: 'Commodity Code',
+ spu_name: 'Commodity Name',
+ category_name: 'Commodity Category',
+ spu_description: 'Commodity Description',
+ bar_code: 'Specification Code',
+ sku_code: 'Specification Code',
+ sku_name: 'Specification Name',
+ supplier_name: 'Supplier Name',
+ brand: 'Brand',
+ unit: 'Commodity Unit',
+ cost: 'Commodity Cost',
+ price: 'Commodity Price',
+ origin: 'origin',
+ length_unit: 'Length Unit',
+ volume_unit: 'Volume Unit',
+ weight_unit: 'Weight Unit',
+ weight: 'Commodity Weight',
+ lenght: 'Commodity Length',
+ width: 'Commodity Width',
+ height: 'Commodity Height',
+ volume: 'Commodity Volume'
+ }
+ },
+ wms: {
+ stock: {
+ stockSelectModal: 'Stock Select Modal',
+ skuSelectModal: 'Commodity Select Modal',
+ warehouse: 'Warehouse Name',
+ location_name: 'Location Code',
+ qty_available: 'Available Qty'
+ },
+ warehouseWorking: {
+ warehouseProcessing: {
+ job_code: 'Job Code',
+ job_type: 'Job Type',
+ process_status: 'Process Status',
+ processor: 'Processor',
+ process_time: 'Process Time',
+ qty: 'Qty',
+ is_source: 'Is Source',
+ spu_code: 'Commodity Code',
+ spu_name: 'Commodity Name',
+ sku_code: 'Specification Code',
+ sku_name: 'Specification Name',
+ target_warehouse: 'Target Warehouse',
+ target_location: 'Target Location',
+ unit: 'Unit',
+ is_update_stock: 'Is Updated Stock',
+ creator: 'Creator',
+ create_time: 'Create Time',
+ last_update_time: 'Last Update Time',
+ adjust_status: 'Is Updated Stock',
+ source: 'Source',
+ target: 'Target',
+ process_split: 'Split Processing',
+ process_combine: 'Combine Processing',
+ confirmProcess: 'Confirm Process',
+ confirmAdjust: 'Confirm Adjust',
+ qtyMoreThanAvailable: 'Can\'t more than the number of Available',
+ beforeConfirmProcess: 'Are you sure to process this data?',
+ beforeConfirmAdjust: 'Are you sure to adjust this data?',
+ alreadyProcess: 'The data can\'t delete because it had been processed',
+ alreadyAdjust: 'The data can\'t delete because it had been adjusted'
+ },
+ warehouseMove: {
+ job_code: 'Job No',
+ move_status: 'Move Status',
+ qty: 'Qty',
+ handler: 'Handler',
+ handle_time: 'Handle Time',
+ orig_goods_warehouse: 'Origin Warehouse',
+ orig_goods_location_name: 'Origin Location',
+ dest_googs_warehouse: 'Target Warehouse',
+ dest_googs_location_name: 'Target Location',
+ confirmMove: 'Confirm Move',
+ creator: 'Creator',
+ create_time: 'Create Time',
+ beforeConfirmMove: 'Are you sure to move this data?',
+ unadjust: 'Unadjust',
+ adjusted: 'Adjusted'
+ },
+ warehouseFreeze: {
+ job_code: 'Job Code',
+ job_type: 'Job Type',
+ handler: 'Handler',
+ handle_time: 'Handle Time',
+ creator: 'Creator',
+ create_time: 'Create Time',
+ warehouse: 'Warehouse',
+ location_name: 'Location Code',
+ freeze: 'Freeze',
+ unfreeze: 'Unfreeze'
+ },
+ warehouseAdjust: {
+ job_code: 'Job Code',
+ job_type: 'Job Type',
+ warehouse: 'Warehouse',
+ location_name: 'Location Code',
+ handler: 'Handler',
+ handle_time: 'Handle Time',
+ creator: 'Creator',
+ create_time: 'Create Time',
+ qty: 'Difference Qty',
+ warehouseTake: 'Warehouse Take',
+ processCombine: 'Warehouse Process',
+ processSplit: 'Warehouse Process',
+ warehouseMove: 'Warehouse Move',
+ confirmAdjust: 'Confirm Adjust',
+ beforeConfirmAdjust: 'Are you sure to adjust this data?'
+ },
+ warehouseTaking: {
+ job_code: 'Job Code',
+ job_status: 'Job Status',
+ warehouse: 'Warehouse',
+ location_name: 'Location Code',
+ book_qty: 'Book Qty',
+ counted_qty: 'Actual Qty',
+ difference_qty: 'Difference Qty',
+ handler: 'Handler',
+ handle_time: 'Handle Time',
+ creator: 'Creator',
+ create_time: 'Create Time',
+ confirmTaking: 'Confirm Taking',
+ unfinish: 'Unfinish',
+ finish: 'Finish',
+ confirmAdjust: 'Confirm Adjust',
+ beforeConfirmAdjust: 'Are you sure to adjust this data?',
+ addFromCommodity: 'Choose From Commodity',
+ addFromStock: 'Choose From Inventory',
+ addTips: 'You can choose goods and the location to add a new record when there is no target inventory'
+ }
+ },
+ stockManagement: {
+ stockLocation: 'Stock Location',
+ stock: 'Stock'
+ },
+ stockLocation: {
+ warehouse_name: 'Warehouse',
+ location_name: 'Location Code',
+ spu_code: 'Commodity code',
+ spu_name: 'Trade name',
+ sku_id: 'Sku Id',
+ sku_code: 'Specification code',
+ sku_name: 'Form Name',
+ qty: 'Quantity',
+ qty_available: 'Available Quantity',
+ qty_locked: 'Locked Quantity',
+ qty_frozen: 'Frozen Quantity'
+ },
+ stockList: {
+ spu_code: 'Commodity code',
+ spu_name: 'Trade name',
+ sku_code: 'Specification code',
+ sku_id: 'Sku Id',
+ qty: 'Quantity',
+ qty_available: 'Available Quantity',
+ qty_locked: 'Locked Quantity',
+ qty_frozen: 'Frozen Quantity',
+ qty_asn: 'Asn Quantity',
+ qty_to_unload: 'Unload Quantity',
+ qty_to_sort: 'Sort Quantity',
+ qty_sorted: 'Sorted Quantity',
+ shortage_qty: 'Shortage Quantity'
+ },
+ stockAsn: {
+ tabNotice: 'Notice Of Arrival',
+ tabToDoArrival: 'To Be Delivered',
+ tabToDoUnload: 'To Be Unloaded',
+ tabToDoSorting: 'To Be Sorted',
+ tabToDoGrounding: 'To Be Put On The Shelf',
+ tabReceiptDetails: 'Receipt Details'
+ },
+ stockAsnInfo: {
+ id: 'ID',
+ asn_no: 'Asn No',
+ asn_status: 'Asn Status',
+ spu_id: 'Spu Id',
+ spu_code: 'Commodity code',
+ spu_name: 'Trade name',
+ sku_id: 'Sku Id',
+ sku_code: 'Specification code',
+ sku_name: 'Form Name',
+ origin: 'Origin',
+ length_unit: 'Length Unit',
+ volume_unit: 'Volume Unit',
+ weight_unit: 'Weight Unit',
+ asn_qty: 'Asn Quantity',
+ actual_qty: 'Actual Quantity',
+ sorted_qty: 'Sorted Quantity',
+ shortage_qty: 'Shortage Quantity',
+ more_qty: 'More Quantity',
+ damage_qty: 'Damage Quantity',
+ weight: 'Weight',
+ volume: 'Volume',
+ supplier_id: 'Supplier Id',
+ supplier_name: 'Supplier Name',
+ goods_owner_id: 'Goods Owner Id',
+ goods_owner_name: 'Goods Owner Name',
+ is_valid: 'Valid'
+ },
+ skuInfo: {
+ spu_id: 'Spu Id',
+ spu_code: 'Commodity code',
+ spu_name: 'Trade name',
+ category_id: 'Commodity Category ID',
+ category_name: 'Commodity Category',
+ spu_description: 'Commodity Description',
+ bar_code: 'Specification Code',
+ supplier_id: 'Supplier Id',
+ supplier_name: 'Supplier Name',
+ brand: 'Brand',
+ origin: 'origin',
+ length_unit: 'Length Unit',
+ volume_unit: 'Volume Unit',
+ weight_unit: 'Weight Unit',
+ sku_id: 'Sku Id',
+ sku_code: 'Specification code',
+ sku_name: 'Form Name',
+ weight: 'Commodity Weight',
+ lenght: 'Commodity Length',
+ width: 'Commodity Width',
+ height: 'Commodity Height',
+ volume: 'Commodity Volume',
+ unit: 'Commodity Unit',
+ cost: 'Commodity Cost',
+ price: 'Commodity Price'
+ },
+ deliveryManagement: {
+ shipment: 'Invoice',
+ preShipment: 'Pre Shipment',
+ newShipment: 'New Shipment',
+ goodsToBePicked: 'To Be Picked',
+ picked: 'Picked',
+ toBePackaged: 'To Be Packaged',
+ package: 'Pack',
+ packaged: 'Packaged',
+ toBeWeighed: 'To Be Weighed',
+ weigh: 'Weigh',
+ weighed: 'Weighed',
+ delivery: 'Delivery',
+ toBeDelivered: 'To Be Delivered',
+ outOfWarehouse: 'Delivered',
+ signIn: 'Sign In',
+ signedIn: 'Signed In',
+ dispatch_no: 'Shipment No',
+ dispatch_status: 'Shipment Doc Status',
+ qty: 'Total Quantity',
+ detailQty: 'Quantity',
+ weight: 'Total Weight',
+ volume: 'Total Volume',
+ customer_name: 'Customer Name',
+ spu_code: 'Commodity Code',
+ spu_name: 'Commodity Name',
+ sku_code: 'Specification Code',
+ creator: 'Created By',
+ create_time: 'Creation Time',
+ confirmOrder: 'Confirm Shipment Doc',
+ orderDetail: 'Shipment Order Product Details',
+ quantityOverflow: 'The sum of shipment quantity cannot exceed the shipment document quantity',
+ quantityIsZero: 'Please ensure that at least one of the selected goods has an issue quantity greater than 0!',
+ NoItemSelected: 'Please select at least one commodity to delivered!',
+ confirmSuccess: 'Confirm the shipment order successfully!',
+ confirmPicking: 'Confirm Picking',
+ confirmDelivery: 'Confirm Delivery',
+ confirmSignIn: 'Confirm Signing',
+ detailWeight: 'Weight',
+ unpackage_qty: 'Quantity to be packaged',
+ unweighing_qty: 'Quantity to be weighed',
+ validQtyMsgPackage: 'Please enter a valid value, which cannot exceed the total quantity',
+ validQtyMsgSignIn: 'Please enter a valid value',
+ signInQty: 'Actual signed in quantity',
+ incorrectStatusMsg: 'Operation failed, the status should be',
+ backToThePreviousStep: 'Recall to previous process',
+ confirmBack: 'Confirm withdrawal',
+ or: ' or ',
+ irreversible: 'This operation is irreversible',
+ detailQuantityIsZero: 'Shipment quantity cannot be 0',
+ qty_available: 'Available Quantity',
+ spu_description: 'Product Description',
+ bar_code: 'Bar Code',
+ order_qty: 'Order Quantity',
+ unpicked_qty: 'Quantity to be picked',
+ picked_qty: 'Picked Quantity',
+ detailVolume: 'Volume',
+ package_qty: 'Packed Quantity',
+ package_person: 'Packer',
+ package_time: 'Packaging Time',
+ weighing_no: 'Weighing sheet No',
+ package_no: 'Packaging serial No',
+ weighing_person: 'Weigher',
+ weighing_weight: 'Weighing Weight',
+ waybill_no: 'Waybill No',
+ carrier: 'Carrier',
+ damagedQuantity: 'Damaged quantity upon arrival',
+ setFreight: 'Set Carrier',
+ departure_city: 'Originating city',
+ arrival_city: 'City of arrival',
+ ViewInventoryDetails: 'View product details',
+ invalidValue: 'Please enter a valid value',
+ exceedingQuantity: 'Cannot exceed the total quantity'
+ }
+ }
+}
diff --git a/frontend/src/languages/langs/index.ts b/frontend/src/languages/langs/index.ts
index 72934b0..520792a 100644
--- a/frontend/src/languages/langs/index.ts
+++ b/frontend/src/languages/langs/index.ts
@@ -1,16 +1,16 @@
-import zhCN from 'vxe-table/lib/locale/lang/zh-CN'
-import enUS from 'vxe-table/lib/locale/lang/en-US'
-
-import en from './enUs'
-import cn from './cnZh'
-
-export default {
- zh_CN: {
- ...cn,
- ...zhCN
- },
- en_US: {
- ...en,
- ...enUS
- }
-}
+import zhCN from 'vxe-table/lib/locale/lang/zh-CN'
+import enUS from 'vxe-table/lib/locale/lang/en-US'
+
+import en from './enUs'
+import cn from './cnZh'
+
+export default {
+ zh_CN: {
+ ...cn,
+ ...zhCN
+ },
+ en_US: {
+ ...en,
+ ...enUS
+ }
+}
diff --git a/frontend/src/languages/method/index.ts b/frontend/src/languages/method/index.ts
index 91a0a58..73ebbe0 100644
--- a/frontend/src/languages/method/index.ts
+++ b/frontend/src/languages/method/index.ts
@@ -1,11 +1,11 @@
-// Get different languages according to the key
-export function getSelcectedLang(lang: string) {
- switch (lang) {
- case 'zh':
- return 'zh_CN'
- case 'en':
- return 'en_US'
- default:
- return 'en_US'
- }
-}
+// Get different languages according to the key
+export function getSelcectedLang(lang: string) {
+ switch (lang) {
+ case 'zh':
+ return 'zh_CN'
+ case 'en':
+ return 'en_US'
+ default:
+ return 'en_US'
+ }
+}
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index 3a8b75c..0108050 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -1,26 +1,26 @@
-import { createApp } from 'vue'
-import './style.css' // Global Styles
-import { VXETable } from '@/plugins/VXETable/index'
-import { vuetify } from '@/plugins/vuetify/index'
-import i18n from './languages/i18n'
-import App from './App.vue'
-
-// import router
-import { router } from './router'
-import { store } from './store/index'
-import hookComponent from '@/components/system/index'
-
-const app = createApp(App)
-
-VXETable.setup({
- i18n: (key, args) => i18n.global.t(key, args)
-})
-
-app.use(router)
-app.use(store)
-app.use(vuetify)
-app.use(i18n)
-app.use(hookComponent)
-app.use(VXETable)
-
-app.mount('#app')
+import { createApp } from 'vue'
+import './style.css' // Global Styles
+import { VXETable } from '@/plugins/VXETable/index'
+import { vuetify } from '@/plugins/vuetify/index'
+import i18n from './languages/i18n'
+import App from './App.vue'
+
+// import router
+import { router } from './router'
+import { store } from './store/index'
+import hookComponent from '@/components/system/index'
+
+const app = createApp(App)
+
+VXETable.setup({
+ i18n: (key, args) => i18n.global.t(key, args)
+})
+
+app.use(router)
+app.use(store)
+app.use(vuetify)
+app.use(i18n)
+app.use(hookComponent)
+app.use(VXETable)
+
+app.mount('#app')
diff --git a/frontend/src/plugins/VXETable/index.ts b/frontend/src/plugins/VXETable/index.ts
index 7e94da1..a0497dd 100644
--- a/frontend/src/plugins/VXETable/index.ts
+++ b/frontend/src/plugins/VXETable/index.ts
@@ -1,20 +1,20 @@
-import VXETable from 'vxe-table'
-import XEUtils from 'xe-utils'
-import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
-import 'vxe-table/lib/style.css'
-
-/**
- * Format date.
- * @param {String} format: default value is 'yyyy-MM-dd HH:mm:ss'
- */
-VXETable.formats.add('formatDate', ({ cellValue }, format) => {
- const date = new Date(cellValue)
- if (!cellValue || !date || XEUtils.toDateString(date, 'yyyy-MM-dd') === '1900-01-01') {
- return ''
- }
- return XEUtils.toDateString(date, format || 'yyyy-MM-dd HH:mm:ss')
-})
-
-VXETable.use(VXETablePluginExportXLSX)
-
-export { VXETable }
+import VXETable from 'vxe-table'
+import XEUtils from 'xe-utils'
+import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
+import 'vxe-table/lib/style.css'
+
+/**
+ * Format date.
+ * @param {String} format: default value is 'yyyy-MM-dd HH:mm:ss'
+ */
+VXETable.formats.add('formatDate', ({ cellValue }, format) => {
+ const date = new Date(cellValue)
+ if (!cellValue || !date || XEUtils.toDateString(date, 'yyyy-MM-dd') === '1900-01-01') {
+ return ''
+ }
+ return XEUtils.toDateString(date, format || 'yyyy-MM-dd HH:mm:ss')
+})
+
+VXETable.use(VXETablePluginExportXLSX)
+
+export { VXETable }
diff --git a/frontend/src/plugins/vuetify/index.ts b/frontend/src/plugins/vuetify/index.ts
index b3baa32..3089903 100644
--- a/frontend/src/plugins/vuetify/index.ts
+++ b/frontend/src/plugins/vuetify/index.ts
@@ -1,40 +1,40 @@
-// Vuetify
-import 'vuetify/styles'
-import { createVuetify } from 'vuetify'
-import * as components from 'vuetify/components'
-import * as directives from 'vuetify/directives'
-import { aliases, mdi } from 'vuetify/iconsets/mdi'
-// Translations provided by Vuetify
-import { zhHans, en } from 'vuetify/locale'
-import { getSelcectedLangForVuetify } from './method/index'
-
-import 'material-design-icons-iconfont/dist/material-design-icons.css'
-import 'vuetify/dist/vuetify.min.css'
-import '@mdi/font/css/materialdesignicons.css'
-
-const vuetify = createVuetify({
- locale: {
- locale: getStorageLang(),
- messages: { zhHans, en }
- },
- components,
- directives,
- icons: {
- defaultSet: 'mdi',
- aliases,
- sets: {
- mdi
- }
- }
-})
-
-// get language in storage or default
-function getStorageLang() {
- const lang = localStorage.getItem('language')
- if (lang) {
- return getSelcectedLangForVuetify(lang)
- }
- return 'en'
-}
-
-export { vuetify }
+// Vuetify
+import 'vuetify/styles'
+import { createVuetify } from 'vuetify'
+import * as components from 'vuetify/components'
+import * as directives from 'vuetify/directives'
+import { aliases, mdi } from 'vuetify/iconsets/mdi'
+// Translations provided by Vuetify
+import { zhHans, en } from 'vuetify/locale'
+import { getSelcectedLangForVuetify } from './method/index'
+
+import 'material-design-icons-iconfont/dist/material-design-icons.css'
+import 'vuetify/dist/vuetify.min.css'
+import '@mdi/font/css/materialdesignicons.css'
+
+const vuetify = createVuetify({
+ locale: {
+ locale: getStorageLang(),
+ messages: { zhHans, en }
+ },
+ components,
+ directives,
+ icons: {
+ defaultSet: 'mdi',
+ aliases,
+ sets: {
+ mdi
+ }
+ }
+})
+
+// get language in storage or default
+function getStorageLang() {
+ const lang = localStorage.getItem('language')
+ if (lang) {
+ return getSelcectedLangForVuetify(lang)
+ }
+ return 'en'
+}
+
+export { vuetify }
diff --git a/frontend/src/plugins/vuetify/method/index.ts b/frontend/src/plugins/vuetify/method/index.ts
index 49444bd..3a54ffa 100644
--- a/frontend/src/plugins/vuetify/method/index.ts
+++ b/frontend/src/plugins/vuetify/method/index.ts
@@ -1,11 +1,11 @@
-// Get different languages according to the key
-export function getSelcectedLangForVuetify(lang: string) {
- switch (lang) {
- case 'zh':
- return 'zhHans'
- case 'en':
- return 'en'
- default:
- return 'en'
- }
-}
+// Get different languages according to the key
+export function getSelcectedLangForVuetify(lang: string) {
+ switch (lang) {
+ case 'zh':
+ return 'zhHans'
+ case 'en':
+ return 'en'
+ default:
+ return 'en'
+ }
+}
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 6e9e89d..7becb77 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -1,99 +1,99 @@
-// index.ts
-import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
-import { store } from '@/store'
-import { CustomerRouterProps } from '@/types/System/Router'
-import { menusToRouter } from '@/utils/router'
-
-// array => dynamic router
-let dynamicRouter: CustomerRouterProps[] = []
-let loadedRouter: string[] = []
-
-// default router
-const routes: RouteRecordRaw[] = [
- {
- path: '/',
- redirect: '/login'
- },
- {
- path: '/login',
- name: 'login',
- component: () => import('@/view/login/login.vue')
- },
- {
- name: 'home',
- path: '/home',
- redirect: 'homepage',
- component: () => import('@/view/home/home.vue'),
- children: []
- }
-]
-
-// create router
-const router = createRouter({
- // mode is hash
- history: createWebHashHistory(),
- routes
- // Return to top after route jump
- // scrollBehavior() {
- // return { top: 0 }
- // }
-})
-
-// vite2 dynamic import
-const modules = import.meta.glob('../view/*/*/*.vue')
-
-// load router function
-function loadRouter() {
- dynamicRouter = menusToRouter(store.getters['user/menulist'])
- dynamicRouter.push({
- name: 'homepage',
- path: '/homepage',
- directory: 'home/homepage',
- redirect: '',
- component: null
- })
- // Clear the loaded routes before creating them, mainly for logged out users
- for (const item of loadedRouter) {
- router.removeRoute(item)
- }
- loadedRouter = []
- // This works normally, but it doesn't seem right when getting router
- for (const item of dynamicRouter) {
- item.component = modules[`../view/${ item.directory }${ item.path }.vue`]
- item.meta = {
- menuModule: item.module,
- menuPath: item.name
- }
- router.addRoute('home', item)
- loadedRouter.push(item.name) // cache dynamic router
- }
-}
-
-// Set the front routing guard
-router.beforeEach((to, from, next) => {
- // join system
- if (to.path === '/login') {
- dynamicRouter = []
- return next()
- }
-
- // dont have token, back login
- if (!store.getters['user/token']) {
- return next('/login')
- }
-
- if (dynamicRouter.length === 0) {
- loadRouter()
- return next(to.path)
- }
-
- next()
-})
-
-// Route interceptor, after jump
-router.afterEach(() => {
- // disable back or forward
- window.history.pushState(null, '', window.location.href)
-})
-
-export { router }
+// index.ts
+import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
+import { store } from '@/store'
+import { CustomerRouterProps } from '@/types/System/Router'
+import { menusToRouter } from '@/utils/router'
+
+// array => dynamic router
+let dynamicRouter: CustomerRouterProps[] = []
+let loadedRouter: string[] = []
+
+// default router
+const routes: RouteRecordRaw[] = [
+ {
+ path: '/',
+ redirect: '/login'
+ },
+ {
+ path: '/login',
+ name: 'login',
+ component: () => import('@/view/login/login.vue')
+ },
+ {
+ name: 'home',
+ path: '/home',
+ redirect: 'homepage',
+ component: () => import('@/view/home/home.vue'),
+ children: []
+ }
+]
+
+// create router
+const router = createRouter({
+ // mode is hash
+ history: createWebHashHistory(),
+ routes
+ // Return to top after route jump
+ // scrollBehavior() {
+ // return { top: 0 }
+ // }
+})
+
+// vite2 dynamic import
+const modules = import.meta.glob('../view/*/*/*.vue')
+
+// load router function
+function loadRouter() {
+ dynamicRouter = menusToRouter(store.getters['user/menulist'])
+ dynamicRouter.push({
+ name: 'homepage',
+ path: '/homepage',
+ directory: 'home/homepage',
+ redirect: '',
+ component: null
+ })
+ // Clear the loaded routes before creating them, mainly for logged out users
+ for (const item of loadedRouter) {
+ router.removeRoute(item)
+ }
+ loadedRouter = []
+ // This works normally, but it doesn't seem right when getting router
+ for (const item of dynamicRouter) {
+ item.component = modules[`../view/${ item.directory }${ item.path }.vue`]
+ item.meta = {
+ menuModule: item.module,
+ menuPath: item.name
+ }
+ router.addRoute('home', item)
+ loadedRouter.push(item.name) // cache dynamic router
+ }
+}
+
+// Set the front routing guard
+router.beforeEach((to, from, next) => {
+ // join system
+ if (to.path === '/login') {
+ dynamicRouter = []
+ return next()
+ }
+
+ // dont have token, back login
+ if (!store.getters['user/token']) {
+ return next('/login')
+ }
+
+ if (dynamicRouter.length === 0) {
+ loadRouter()
+ return next(to.path)
+ }
+
+ next()
+})
+
+// Route interceptor, after jump
+router.afterEach(() => {
+ // disable back or forward
+ window.history.pushState(null, '', window.location.href)
+})
+
+export { router }
diff --git a/frontend/src/shims.axios.d.ts b/frontend/src/shims.axios.d.ts
index 057fd05..cff4423 100644
--- a/frontend/src/shims.axios.d.ts
+++ b/frontend/src/shims.axios.d.ts
@@ -1,7 +1,7 @@
-import { AxiosRequestConfig } from 'axios'
-
-declare module 'axios' {
- export interface AxiosRequestConfig {
- hideLoading?: boolean
- }
-}
+import { AxiosRequestConfig } from 'axios'
+
+declare module 'axios' {
+ export interface AxiosRequestConfig {
+ hideLoading?: boolean
+ }
+}
diff --git a/frontend/src/store/index.ts b/frontend/src/store/index.ts
index bb4f5c4..8a289e5 100644
--- a/frontend/src/store/index.ts
+++ b/frontend/src/store/index.ts
@@ -1,18 +1,18 @@
-import { createStore } from 'vuex'
-import VuexPersistence from 'vuex-persist'
-
-import { user } from '@/store/module/user'
-import { system } from '@/store/module/system'
-
-const vuexLocal = new VuexPersistence({
- storage: window.localStorage,
- modules: ['user', 'system']
-})
-
-export const store = createStore({
- modules: {
- user,
- system
- },
- plugins: [vuexLocal.plugin]
-})
+import { createStore } from 'vuex'
+import VuexPersistence from 'vuex-persist'
+
+import { user } from '@/store/module/user'
+import { system } from '@/store/module/system'
+
+const vuexLocal = new VuexPersistence({
+ storage: window.localStorage,
+ modules: ['user', 'system']
+})
+
+export const store = createStore({
+ modules: {
+ user,
+ system
+ },
+ plugins: [vuexLocal.plugin]
+})
diff --git a/frontend/src/store/module/system.ts b/frontend/src/store/module/system.ts
index bbf5196..5ed9941 100644
--- a/frontend/src/store/module/system.ts
+++ b/frontend/src/store/module/system.ts
@@ -1,66 +1,66 @@
-import { StateProps } from '@/types/System/Store'
-
-export const system = {
- namespaced: true,
- state: {
- language: '',
- openedMenus: [],
- // Window Size
- clientWidth: 0,
- clientHeight: 0,
- currentRouterPath: '',
- refreshFlag: false
- },
- mutations: {
- setCurrentRouterPath(state: StateProps, path: string) {
- state.currentRouterPath = path
- },
- setRefreshFlag(state: StateProps, flag: boolean) {
- state.refreshFlag = flag
- },
- setLanguage(state: StateProps, lang: string) {
- state.language = lang
- },
- addOpenedMenu(state: StateProps, menuName: string) {
- if (!state.openedMenus.includes(menuName)) {
- state.openedMenus.push(menuName)
- }
- },
- delOpenedMenu(state: StateProps, menuName: string) {
- const menuIndex = state.openedMenus.findIndex((item) => item === menuName)
- if (menuIndex > -1) {
- state.openedMenus.splice(menuIndex, 1)
- }
- },
- clearOpenedMenu(state: StateProps) {
- state.openedMenus = []
- },
- setClientWidth(state: StateProps, clientWidth: number) {
- state.clientWidth = clientWidth
- },
- setClientHeight(state: StateProps, clientHeight: number) {
- state.clientHeight = clientHeight
- }
- },
- actions: {},
- getters: {
- currentRouterPath(state: StateProps) {
- return state.currentRouterPath
- },
- language(state: StateProps) {
- return state.language
- },
- openedMenus(state: StateProps) {
- return state.openedMenus
- },
- clientWidth(state: StateProps) {
- return state.clientWidth
- },
- clientHeight(state: StateProps) {
- return state.clientHeight
- },
- refreshFlag(state: StateProps) {
- return state.refreshFlag
- }
- }
-}
+import { StateProps } from '@/types/System/Store'
+
+export const system = {
+ namespaced: true,
+ state: {
+ language: '',
+ openedMenus: [],
+ // Window Size
+ clientWidth: 0,
+ clientHeight: 0,
+ currentRouterPath: '',
+ refreshFlag: false
+ },
+ mutations: {
+ setCurrentRouterPath(state: StateProps, path: string) {
+ state.currentRouterPath = path
+ },
+ setRefreshFlag(state: StateProps, flag: boolean) {
+ state.refreshFlag = flag
+ },
+ setLanguage(state: StateProps, lang: string) {
+ state.language = lang
+ },
+ addOpenedMenu(state: StateProps, menuName: string) {
+ if (!state.openedMenus.includes(menuName)) {
+ state.openedMenus.push(menuName)
+ }
+ },
+ delOpenedMenu(state: StateProps, menuName: string) {
+ const menuIndex = state.openedMenus.findIndex((item) => item === menuName)
+ if (menuIndex > -1) {
+ state.openedMenus.splice(menuIndex, 1)
+ }
+ },
+ clearOpenedMenu(state: StateProps) {
+ state.openedMenus = []
+ },
+ setClientWidth(state: StateProps, clientWidth: number) {
+ state.clientWidth = clientWidth
+ },
+ setClientHeight(state: StateProps, clientHeight: number) {
+ state.clientHeight = clientHeight
+ }
+ },
+ actions: {},
+ getters: {
+ currentRouterPath(state: StateProps) {
+ return state.currentRouterPath
+ },
+ language(state: StateProps) {
+ return state.language
+ },
+ openedMenus(state: StateProps) {
+ return state.openedMenus
+ },
+ clientWidth(state: StateProps) {
+ return state.clientWidth
+ },
+ clientHeight(state: StateProps) {
+ return state.clientHeight
+ },
+ refreshFlag(state: StateProps) {
+ return state.refreshFlag
+ }
+ }
+}
diff --git a/frontend/src/store/module/user.ts b/frontend/src/store/module/user.ts
index fb7d90e..64a6aaa 100644
--- a/frontend/src/store/module/user.ts
+++ b/frontend/src/store/module/user.ts
@@ -1,75 +1,75 @@
-import { UserStateProps, MenuItem } from '@/types/System/Store'
-
-export const user = {
- namespaced: true,
- state: {
- userInfo: {},
- token: '',
- // 用于刷新token用的串
- refreshToken: '',
- // token失效的时间
- expirationTime: '',
- // token有效期
- effectiveMinutes: '',
- // 当前是否正在refreshToken
- isRefreshingToken: false,
- // 菜单权限
- menulist: [
- // {
- // name: 'testmenu',
- // path: '/testmenu',
- // directory: 'testmenu/testmenu'
- // }
- ]
- },
- mutations: {
- setUserInfo(state: UserStateProps, userInfo: any) {
- state.userInfo = userInfo
- },
- resetUserInfo(state: UserStateProps, userInfo = {}) {
- state.userInfo = { ...state.userInfo, ...userInfo }
- },
- setToken(state: UserStateProps, token: string) {
- state.token = token
- },
- setExpirationTime(state: UserStateProps, expirationTime: number) {
- state.expirationTime = expirationTime
- },
- setIsRefreshingToken(state: UserStateProps, isRefreshingToken: boolean) {
- state.isRefreshingToken = isRefreshingToken
- },
- setRefreshToken(state: UserStateProps, refreshToken: string) {
- state.refreshToken = refreshToken
- },
- setEffectiveMinutes(state: UserStateProps, effectiveMinutes: number) {
- state.effectiveMinutes = effectiveMinutes
- },
- setUserMenuList(state: UserStateProps, menulist: MenuItem[]) {
- state.menulist = menulist
- }
- },
- actions: {},
- getters: {
- userInfo(state: UserStateProps) {
- return state.userInfo
- },
- token(state: UserStateProps) {
- return state.token
- },
- expirationTime(state: UserStateProps) {
- return state.expirationTime
- },
- isRefreshingToken(state: UserStateProps) {
- return state.isRefreshingToken
- },
- refreshToken(state: UserStateProps) {
- return state.refreshToken
- },
- effectiveMinutes(state: UserStateProps) {
- return state.effectiveMinutes
- },
- menulist(state: UserStateProps) {
- return state.menulist
- }
- }
-}
+import { UserStateProps, MenuItem } from '@/types/System/Store'
+
+export const user = {
+ namespaced: true,
+ state: {
+ userInfo: {},
+ token: '',
+ // 用于刷新token用的串
+ refreshToken: '',
+ // token失效的时间
+ expirationTime: '',
+ // token有效期
+ effectiveMinutes: '',
+ // 当前是否正在refreshToken
+ isRefreshingToken: false,
+ // 菜单权限
+ menulist: [
+ // {
+ // name: 'testmenu',
+ // path: '/testmenu',
+ // directory: 'testmenu/testmenu'
+ // }
+ ]
+ },
+ mutations: {
+ setUserInfo(state: UserStateProps, userInfo: any) {
+ state.userInfo = userInfo
+ },
+ resetUserInfo(state: UserStateProps, userInfo = {}) {
+ state.userInfo = { ...state.userInfo, ...userInfo }
+ },
+ setToken(state: UserStateProps, token: string) {
+ state.token = token
+ },
+ setExpirationTime(state: UserStateProps, expirationTime: number) {
+ state.expirationTime = expirationTime
+ },
+ setIsRefreshingToken(state: UserStateProps, isRefreshingToken: boolean) {
+ state.isRefreshingToken = isRefreshingToken
+ },
+ setRefreshToken(state: UserStateProps, refreshToken: string) {
+ state.refreshToken = refreshToken
+ },
+ setEffectiveMinutes(state: UserStateProps, effectiveMinutes: number) {
+ state.effectiveMinutes = effectiveMinutes
+ },
+ setUserMenuList(state: UserStateProps, menulist: MenuItem[]) {
+ state.menulist = menulist
+ }
+ },
+ actions: {},
+ getters: {
+ userInfo(state: UserStateProps) {
+ return state.userInfo
+ },
+ token(state: UserStateProps) {
+ return state.token
+ },
+ expirationTime(state: UserStateProps) {
+ return state.expirationTime
+ },
+ isRefreshingToken(state: UserStateProps) {
+ return state.isRefreshingToken
+ },
+ refreshToken(state: UserStateProps) {
+ return state.refreshToken
+ },
+ effectiveMinutes(state: UserStateProps) {
+ return state.effectiveMinutes
+ },
+ menulist(state: UserStateProps) {
+ return state.menulist
+ }
+ }
+}
diff --git a/frontend/src/style.css b/frontend/src/style.css
index 000a44d..4943a39 100644
--- a/frontend/src/style.css
+++ b/frontend/src/style.css
@@ -1,12 +1,12 @@
-html,
-body {
- padding: 0;
- margin: 0;
- height: 100%;
- width: 100%;
-}
-
-#app {
- height: 100vh;
- width: 100vw;
-}
+html,
+body {
+ padding: 0;
+ margin: 0;
+ height: 100%;
+ width: 100%;
+}
+
+#app {
+ height: 100vh;
+ width: 100vw;
+}
diff --git a/frontend/src/types/Base/CommodityCategorySetting.ts b/frontend/src/types/Base/CommodityCategorySetting.ts
index a90dc8c..019063e 100644
--- a/frontend/src/types/Base/CommodityCategorySetting.ts
+++ b/frontend/src/types/Base/CommodityCategorySetting.ts
@@ -1,16 +1,16 @@
-import { VxeTablePropTypes } from 'vxe-table'
-import { UniformFileNaming } from '../System/Form'
-
-export interface CategoryVO extends UniformFileNaming {
- id: number
- parent_id?: number
- category_name: string
- is_valid?: boolean
-}
-
-export interface DataProps {
- tableData: CategoryVO[]
- tableTreeConfig: VxeTablePropTypes.TreeConfig
- showDialog: boolean
- dialogForm: CategoryVO
-}
+import { VxeTablePropTypes } from 'vxe-table'
+import { UniformFileNaming } from '../System/Form'
+
+export interface CategoryVO extends UniformFileNaming {
+ id: number
+ parent_id?: number
+ category_name: string
+ is_valid?: boolean
+}
+
+export interface DataProps {
+ tableData: CategoryVO[]
+ tableTreeConfig: VxeTablePropTypes.TreeConfig
+ showDialog: boolean
+ dialogForm: CategoryVO
+}
diff --git a/frontend/src/types/Base/CommodityManagement.ts b/frontend/src/types/Base/CommodityManagement.ts
index c3dba4a..b481859 100644
--- a/frontend/src/types/Base/CommodityManagement.ts
+++ b/frontend/src/types/Base/CommodityManagement.ts
@@ -1,62 +1,62 @@
-import { VxeTablePropTypes } from 'vxe-table'
-import { UniformFileNaming, TablePage } from '../System/Form'
-
-export interface CommodityVO extends UniformFileNaming {
- id: number
- spu_code: string
- spu_name: string
- category_id?: number
- category_name?: string
- spu_description: string
- bar_code: string
- supplier_id?: number
- supplier_name?: string
- brand: string
- origin?: string
- length_unit: number
- volume_unit: number
- weight_unit: number
- detailList?: CommodityDetailVO[]
-}
-
-export interface CommodityDetailVO {
- id: number
- sku_code: string
- sku_name: string
- unit: string
- cost?: number
- price?: number
- weight?: number
- lenght?: number
- width?: number
- height?: number
- volume?: number
-}
-
-export interface CommodityDetailJoinMainVO {
- sku_id: number
- spu_id: number
- spu_code: string
- spu_name: string
- sku_code: string
- sku_name: string
- supplier_id: number
- supplier_name: string
- brand: string
- origin: string
- unit: string
-}
-
-export interface DataProps {
- tableData: CommodityVO[]
- tableTreeConfig: VxeTablePropTypes.TreeConfig
- showDialog: boolean
- dialogForm: CommodityVO
- tablePage: TablePage
- searchForm: {
- spu_code: string
- spu_name: string
- category_name: string
- },
- timer: any
-}
+import { VxeTablePropTypes } from 'vxe-table'
+import { UniformFileNaming, TablePage } from '../System/Form'
+
+export interface CommodityVO extends UniformFileNaming {
+ id: number
+ spu_code: string
+ spu_name: string
+ category_id?: number
+ category_name?: string
+ spu_description: string
+ bar_code: string
+ supplier_id?: number
+ supplier_name?: string
+ brand: string
+ origin?: string
+ length_unit: number
+ volume_unit: number
+ weight_unit: number
+ detailList?: CommodityDetailVO[]
+}
+
+export interface CommodityDetailVO {
+ id: number
+ sku_code: string
+ sku_name: string
+ unit: string
+ cost?: number
+ price?: number
+ weight?: number
+ lenght?: number
+ width?: number
+ height?: number
+ volume?: number
+}
+
+export interface CommodityDetailJoinMainVO {
+ sku_id: number
+ spu_id: number
+ spu_code: string
+ spu_name: string
+ sku_code: string
+ sku_name: string
+ supplier_id: number
+ supplier_name: string
+ brand: string
+ origin: string
+ unit: string
+}
+
+export interface DataProps {
+ tableData: CommodityVO[]
+ tableTreeConfig: VxeTablePropTypes.TreeConfig
+ showDialog: boolean
+ dialogForm: CommodityVO
+ tablePage: TablePage
+ searchForm: {
+ spu_code: string
+ spu_name: string
+ category_name: string
+ },
+ timer: any
+}
diff --git a/frontend/src/types/Base/CompanySetting.ts b/frontend/src/types/Base/CompanySetting.ts
index 335dafe..b52fca1 100644
--- a/frontend/src/types/Base/CompanySetting.ts
+++ b/frontend/src/types/Base/CompanySetting.ts
@@ -1,16 +1,16 @@
-import { UniformFileNaming } from '../System/Form'
-
-export interface CompanyVO extends UniformFileNaming {
- id: number
- company_name: string
- city: string
- address: string
- manager: string
- contact_tel: string
-}
-
-export interface DataProps {
- tableData: CompanyVO[]
- showDialog: boolean
- dialogForm: CompanyVO
-}
+import { UniformFileNaming } from '../System/Form'
+
+export interface CompanyVO extends UniformFileNaming {
+ id: number
+ company_name: string
+ city: string
+ address: string
+ manager: string
+ contact_tel: string
+}
+
+export interface DataProps {
+ tableData: CompanyVO[]
+ showDialog: boolean
+ dialogForm: CompanyVO
+}
diff --git a/frontend/src/types/Base/Customer.ts b/frontend/src/types/Base/Customer.ts
index 229e7cf..c319196 100644
--- a/frontend/src/types/Base/Customer.ts
+++ b/frontend/src/types/Base/Customer.ts
@@ -1,28 +1,28 @@
-import { UniformFileNaming, TablePage } from '../System/Form'
-
-export interface CustomerVO extends UniformFileNaming {
- id: number
- customer_name: string
- city: string
- address: string
- manager: string
- email: string
- contact_tel: string
- is_valid: boolean
-}
-export interface CustomerExcelVO {
- customer_name: string
- city: string
- address: string
- manager: string
- email: string
- contact_tel: string
- _XID: string
- errorMsg: string
-}
-export interface DataProps {
- tableData: CustomerVO[]
- tablePage: TablePage
- showDialog: boolean
- dialogForm: CustomerVO
-}
+import { UniformFileNaming, TablePage } from '../System/Form'
+
+export interface CustomerVO extends UniformFileNaming {
+ id: number
+ customer_name: string
+ city: string
+ address: string
+ manager: string
+ email: string
+ contact_tel: string
+ is_valid: boolean
+}
+export interface CustomerExcelVO {
+ customer_name: string
+ city: string
+ address: string
+ manager: string
+ email: string
+ contact_tel: string
+ _XID: string
+ errorMsg: string
+}
+export interface DataProps {
+ tableData: CustomerVO[]
+ tablePage: TablePage
+ showDialog: boolean
+ dialogForm: CustomerVO
+}
diff --git a/frontend/src/types/Base/Freight.ts b/frontend/src/types/Base/Freight.ts
index ef39332..895bba2 100644
--- a/frontend/src/types/Base/Freight.ts
+++ b/frontend/src/types/Base/Freight.ts
@@ -1,12 +1,12 @@
-import { UniformFileNaming } from '../System/Form'
-
-export interface FreightVO extends UniformFileNaming{
- id?: number
- carrier: string
- departure_city: string
- arrival_city: string
- price_per_weight: number
- price_per_volume: number
- min_payment: number
- is_valid?: boolean
+import { UniformFileNaming } from '../System/Form'
+
+export interface FreightVO extends UniformFileNaming{
+ id?: number
+ carrier: string
+ departure_city: string
+ arrival_city: string
+ price_per_weight: number
+ price_per_volume: number
+ min_payment: number
+ is_valid?: boolean
}
\ No newline at end of file
diff --git a/frontend/src/types/Base/OwnerOfCargo.ts b/frontend/src/types/Base/OwnerOfCargo.ts
index c98c607..e980bd0 100644
--- a/frontend/src/types/Base/OwnerOfCargo.ts
+++ b/frontend/src/types/Base/OwnerOfCargo.ts
@@ -1,30 +1,30 @@
-import { UniformFileNaming, TablePage } from '../System/Form'
-
-export interface OwnerOfCargoVO extends UniformFileNaming {
- id: number
- goods_owner_name: string
- city: string
- address: string
- contact_tel: string
- manager: string
-}
-
-export interface ImportVO {
- goods_owner_name: string
- city: string
- address: string
- contact_tel: string
- manager: string
-}
-
-export interface DataProps {
- tableData: OwnerOfCargoVO[]
- showDialog: boolean
- showDialogImport: boolean
- dialogForm: OwnerOfCargoVO
- searchForm: {
- goods_owner_name: string
- }
- tablePage: TablePage
- timer: any
-}
+import { UniformFileNaming, TablePage } from '../System/Form'
+
+export interface OwnerOfCargoVO extends UniformFileNaming {
+ id: number
+ goods_owner_name: string
+ city: string
+ address: string
+ contact_tel: string
+ manager: string
+}
+
+export interface ImportVO {
+ goods_owner_name: string
+ city: string
+ address: string
+ contact_tel: string
+ manager: string
+}
+
+export interface DataProps {
+ tableData: OwnerOfCargoVO[]
+ showDialog: boolean
+ showDialogImport: boolean
+ dialogForm: OwnerOfCargoVO
+ searchForm: {
+ goods_owner_name: string
+ }
+ tablePage: TablePage
+ timer: any
+}
diff --git a/frontend/src/types/Base/RoleMenu.ts b/frontend/src/types/Base/RoleMenu.ts
index 8466ab7..d6b1942 100644
--- a/frontend/src/types/Base/RoleMenu.ts
+++ b/frontend/src/types/Base/RoleMenu.ts
@@ -1,21 +1,21 @@
-import { NavListOptions, UniformFileNaming, VxeTableRow } from '../System/Form'
-
-export interface RoleMenuVO extends UniformFileNaming {
- userrole_id?: number
- role_name?: string
- detailList: RoleMenuDetailVo[]
-}
-
-export interface RoleMenuDetailVo extends VxeTableRow {
- id: number
- menu_id?: number
- menu_name?: string
-}
-
-export interface DataProps {
- activeRoleMenuForm: RoleMenuVO
- roleList: RoleMenuVO[]
- showDialog: boolean
- dialogForm: RoleMenuVO
- navListOptions: NavListOptions
-}
+import { NavListOptions, UniformFileNaming, VxeTableRow } from '../System/Form'
+
+export interface RoleMenuVO extends UniformFileNaming {
+ userrole_id?: number
+ role_name?: string
+ detailList: RoleMenuDetailVo[]
+}
+
+export interface RoleMenuDetailVo extends VxeTableRow {
+ id: number
+ menu_id?: number
+ menu_name?: string
+}
+
+export interface DataProps {
+ activeRoleMenuForm: RoleMenuVO
+ roleList: RoleMenuVO[]
+ showDialog: boolean
+ dialogForm: RoleMenuVO
+ navListOptions: NavListOptions
+}
diff --git a/frontend/src/types/Base/Supplier.ts b/frontend/src/types/Base/Supplier.ts
index ddeac2a..e56928a 100644
--- a/frontend/src/types/Base/Supplier.ts
+++ b/frontend/src/types/Base/Supplier.ts
@@ -1,28 +1,28 @@
-import { UniformFileNaming, TablePage } from '../System/Form'
-
-export interface SupplierVO extends UniformFileNaming {
- id: number
- supplier_name: string
- city: string
- address: string
- manager: string
- email: string
- contact_tel: string
- is_valid: boolean
-}
-
-export interface SupplierExcelVO {
- supplier_name: string
- city: string
- address: string
- manager: string
- email: string
- contact_tel: string
-}
-
-export interface DataProps {
- tableData: SupplierVO[]
- tablePage: TablePage
- showDialog: boolean
- dialogForm: SupplierVO
-}
+import { UniformFileNaming, TablePage } from '../System/Form'
+
+export interface SupplierVO extends UniformFileNaming {
+ id: number
+ supplier_name: string
+ city: string
+ address: string
+ manager: string
+ email: string
+ contact_tel: string
+ is_valid: boolean
+}
+
+export interface SupplierExcelVO {
+ supplier_name: string
+ city: string
+ address: string
+ manager: string
+ email: string
+ contact_tel: string
+}
+
+export interface DataProps {
+ tableData: SupplierVO[]
+ tablePage: TablePage
+ showDialog: boolean
+ dialogForm: SupplierVO
+}
diff --git a/frontend/src/types/Base/UserManagement.ts b/frontend/src/types/Base/UserManagement.ts
index 999f292..9c8910e 100644
--- a/frontend/src/types/Base/UserManagement.ts
+++ b/frontend/src/types/Base/UserManagement.ts
@@ -1,42 +1,42 @@
-import { UniformFileNaming, TablePage } from '../System/Form'
-
-export interface UserVO extends UniformFileNaming {
- id: number
- user_num: string
- user_name: string
- contact_tel?: string
- user_role?: string
- sex?: string
- auth_string?: string
- email?: string
- is_valid: boolean
-}
-
-export interface ImportVO {
- user_num: string
- user_name: string
- contact_tel: string
- user_role: string
- sex: string
- is_valid: boolean
-}
-
-export interface DataProps {
- showDialogImport: boolean
- tableData: UserVO[]
- searchForm: {
- user_num: string
- user_name: string
- user_role: string
- }
- tablePage: TablePage
- showDialog: boolean
- dialogForm: UserVO
- timer: any
-}
-
-export interface ChangePwdAPIParams {
- id: number
- old_password: string
- new_password: string
-}
+import { UniformFileNaming, TablePage } from '../System/Form'
+
+export interface UserVO extends UniformFileNaming {
+ id: number
+ user_num: string
+ user_name: string
+ contact_tel?: string
+ user_role?: string
+ sex?: string
+ auth_string?: string
+ email?: string
+ is_valid: boolean
+}
+
+export interface ImportVO {
+ user_num: string
+ user_name: string
+ contact_tel: string
+ user_role: string
+ sex: string
+ is_valid: boolean
+}
+
+export interface DataProps {
+ showDialogImport: boolean
+ tableData: UserVO[]
+ searchForm: {
+ user_num: string
+ user_name: string
+ user_role: string
+ }
+ tablePage: TablePage
+ showDialog: boolean
+ dialogForm: UserVO
+ timer: any
+}
+
+export interface ChangePwdAPIParams {
+ id: number
+ old_password: string
+ new_password: string
+}
diff --git a/frontend/src/types/Base/UserRoleSetting.ts b/frontend/src/types/Base/UserRoleSetting.ts
index cb81de7..9b9f341 100644
--- a/frontend/src/types/Base/UserRoleSetting.ts
+++ b/frontend/src/types/Base/UserRoleSetting.ts
@@ -1,13 +1,13 @@
-import { UniformFileNaming } from '../System/Form'
-
-export interface UserRoleVO extends UniformFileNaming {
- id: number
- role_name: string
- is_valid: boolean
-}
-
-export interface DataProps {
- tableData: UserRoleVO[]
- showDialog: boolean
- dialogForm: UserRoleVO
-}
+import { UniformFileNaming } from '../System/Form'
+
+export interface UserRoleVO extends UniformFileNaming {
+ id: number
+ role_name: string
+ is_valid: boolean
+}
+
+export interface DataProps {
+ tableData: UserRoleVO[]
+ showDialog: boolean
+ dialogForm: UserRoleVO
+}
diff --git a/frontend/src/types/Base/Warehouse.ts b/frontend/src/types/Base/Warehouse.ts
index 2baae73..d7c8833 100644
--- a/frontend/src/types/Base/Warehouse.ts
+++ b/frontend/src/types/Base/Warehouse.ts
@@ -1,51 +1,51 @@
-import { UniformFileNaming } from '../System/Form'
-
-export interface WarehouseVO extends UniformFileNaming {
- id?: number
- warehouse_name: string
- city: string
- address: string
- contact_tel?: string
- email?: string
- manager?: string
- is_valid?: boolean
-}
-
-export interface WarehouseAreaVO extends UniformFileNaming {
- id: number
- warehouse_id?: number
- parent_id?: number
- warehouse_name: string
- area_name: string
- area_property: AreaProperty
- is_valid: boolean
-}
-
-export interface GoodsLocationVO extends UniformFileNaming {
- id: number
- warehouse_id?: number
- warehouse_area_id?: number
- warehouse_name: string
- warehouse_area_name: string
- warehouse_area_property?: number
- location_name: string
- location_length?: number
- location_width?: number
- location_heigth?: number
- location_volume?: number
- location_load?: number
- roadway_number?: string
- shelf_number?: string
- layer_number?: string
- tag_number?: string
- is_valid: boolean
-}
-
-export enum AreaProperty {
- 'picking_area' = 1,
- 'stocking_area' = 2,
- 'receiving_area' = 3,
- 'return_area' = 4,
- 'defective_area' = 5,
- 'inventory_area' = 6
-}
+import { UniformFileNaming } from '../System/Form'
+
+export interface WarehouseVO extends UniformFileNaming {
+ id?: number
+ warehouse_name: string
+ city: string
+ address: string
+ contact_tel?: string
+ email?: string
+ manager?: string
+ is_valid?: boolean
+}
+
+export interface WarehouseAreaVO extends UniformFileNaming {
+ id: number
+ warehouse_id?: number
+ parent_id?: number
+ warehouse_name: string
+ area_name: string
+ area_property: AreaProperty
+ is_valid: boolean
+}
+
+export interface GoodsLocationVO extends UniformFileNaming {
+ id: number
+ warehouse_id?: number
+ warehouse_area_id?: number
+ warehouse_name: string
+ warehouse_area_name: string
+ warehouse_area_property?: number
+ location_name: string
+ location_length?: number
+ location_width?: number
+ location_heigth?: number
+ location_volume?: number
+ location_load?: number
+ roadway_number?: string
+ shelf_number?: string
+ layer_number?: string
+ tag_number?: string
+ is_valid: boolean
+}
+
+export enum AreaProperty {
+ 'picking_area' = 1,
+ 'stocking_area' = 2,
+ 'receiving_area' = 3,
+ 'return_area' = 4,
+ 'defective_area' = 5,
+ 'inventory_area' = 6
+}
diff --git a/frontend/src/types/DeliveryManagement/DeliveryManagement.ts b/frontend/src/types/DeliveryManagement/DeliveryManagement.ts
index f22957b..994077f 100644
--- a/frontend/src/types/DeliveryManagement/DeliveryManagement.ts
+++ b/frontend/src/types/DeliveryManagement/DeliveryManagement.ts
@@ -1,121 +1,121 @@
-import { UniformFileNaming } from '../System/Form'
-
-export interface DeliveryManagementVO extends UniformFileNaming {
- id: number
- dispatch_no?: string
- dispatch_status?: number
- qty?: number
- weight?: number
- volume?: number
- customer_id?: number
- customer_name?: string
- picked_qty?: number
- detailList: DeliveryManagementDetailListVO[]
-}
-
-export interface DeliveryManagementDetailListVO {
- id: number
- qty: number
- sku_id?: number
- spu_code?: string
- spu_name?: string
- sku_code?: string
- sku_name?: string
-}
-
-export interface DeliveryManagementDetailVO extends DeliveryManagementVO {
- id: number
- spu_code?: string
- spu_name?: string
- sku_code?: string
- unpackage_qty?: number
- unweighing_qty?: number
- spu_description?: string
- bar_code?: string
- qty?: number
- unpicked_qty?: number
- picked_qty?: number
- weight?: number
- volume?: number
- weight_unit?: number
-}
-
-export interface addRequestVO {
- customer_id: number
- customer_name: string
- sku_id: number
- qty: number
-}
-
-export interface ConfirmOrderVO {
- spu_code: string
- sku_code: string
- qty: number
- confirm: boolean
- pick_list: ConfirmOrderPickListVO[]
-}
-
-export interface ConfirmOrderPickListVO {
- warehouse_name: string
- location_name: string
- pick_qty: number
-}
-
-export interface PackageVO {
- id?: number
- dispatch_no?: string
- dispatch_status?: number
- package_qty?: number
- picked_qty?: number
-}
-
-export interface WeighVO {
- id?: number
- dispatch_no?: string
- dispatch_status?: number
- weighing_qty?: number
- weighing_weight?: number
- picked_qty?: number
-}
-
-export interface DeliveryVO {
- id?: number
- dispatch_no?: string
- dispatch_status?: number
- picked_qty?: number
-}
-
-export interface SignInVO {
- id?: number
- dispatch_no?: string
- dispatch_status?: number
- damage_qty?: number
-}
-
-export interface CancleOrderVO {
- dispatch_no?: string
- dispatch_status?: number
-}
-
-export interface SetCarrierVO {
- id: number
- dispatch_no: string
- dispatch_status: number
- freightfee_id: number
- carrier: string
- waybill_no: string
-}
-
-export interface ConfirmItem {
- id: number
- dispatch_no: string
- dispatch_status: number
- spu_name: string
- spu_code: string
- sku_code: string
- maxQty: number
- qty: number
- picked_qty?: number
- weight?: number
- weight_unit?: string
-}
+import { UniformFileNaming } from '../System/Form'
+
+export interface DeliveryManagementVO extends UniformFileNaming {
+ id: number
+ dispatch_no?: string
+ dispatch_status?: number
+ qty?: number
+ weight?: number
+ volume?: number
+ customer_id?: number
+ customer_name?: string
+ picked_qty?: number
+ detailList: DeliveryManagementDetailListVO[]
+}
+
+export interface DeliveryManagementDetailListVO {
+ id: number
+ qty: number
+ sku_id?: number
+ spu_code?: string
+ spu_name?: string
+ sku_code?: string
+ sku_name?: string
+}
+
+export interface DeliveryManagementDetailVO extends DeliveryManagementVO {
+ id: number
+ spu_code?: string
+ spu_name?: string
+ sku_code?: string
+ unpackage_qty?: number
+ unweighing_qty?: number
+ spu_description?: string
+ bar_code?: string
+ qty?: number
+ unpicked_qty?: number
+ picked_qty?: number
+ weight?: number
+ volume?: number
+ weight_unit?: number
+}
+
+export interface addRequestVO {
+ customer_id: number
+ customer_name: string
+ sku_id: number
+ qty: number
+}
+
+export interface ConfirmOrderVO {
+ spu_code: string
+ sku_code: string
+ qty: number
+ confirm: boolean
+ pick_list: ConfirmOrderPickListVO[]
+}
+
+export interface ConfirmOrderPickListVO {
+ warehouse_name: string
+ location_name: string
+ pick_qty: number
+}
+
+export interface PackageVO {
+ id?: number
+ dispatch_no?: string
+ dispatch_status?: number
+ package_qty?: number
+ picked_qty?: number
+}
+
+export interface WeighVO {
+ id?: number
+ dispatch_no?: string
+ dispatch_status?: number
+ weighing_qty?: number
+ weighing_weight?: number
+ picked_qty?: number
+}
+
+export interface DeliveryVO {
+ id?: number
+ dispatch_no?: string
+ dispatch_status?: number
+ picked_qty?: number
+}
+
+export interface SignInVO {
+ id?: number
+ dispatch_no?: string
+ dispatch_status?: number
+ damage_qty?: number
+}
+
+export interface CancleOrderVO {
+ dispatch_no?: string
+ dispatch_status?: number
+}
+
+export interface SetCarrierVO {
+ id: number
+ dispatch_no: string
+ dispatch_status: number
+ freightfee_id: number
+ carrier: string
+ waybill_no: string
+}
+
+export interface ConfirmItem {
+ id: number
+ dispatch_no: string
+ dispatch_status: number
+ spu_name: string
+ spu_code: string
+ sku_code: string
+ maxQty: number
+ qty: number
+ picked_qty?: number
+ weight?: number
+ weight_unit?: string
+}
diff --git a/frontend/src/types/Home/Home.ts b/frontend/src/types/Home/Home.ts
index 437638e..7eb8140 100644
--- a/frontend/src/types/Home/Home.ts
+++ b/frontend/src/types/Home/Home.ts
@@ -1,12 +1,12 @@
-// test interface
-export interface SideBarMenu {
- icon?: string
- lable: string
- routerPath?: string
- showDetail?: boolean
- children?: SideBarMenu[]
-}
-
-export interface SideBarDataProps {
- menuList: SideBarMenu[]
+// test interface
+export interface SideBarMenu {
+ icon?: string
+ lable: string
+ routerPath?: string
+ showDetail?: boolean
+ children?: SideBarMenu[]
+}
+
+export interface SideBarDataProps {
+ menuList: SideBarMenu[]
}
\ No newline at end of file
diff --git a/frontend/src/types/Home/HomeHeader.ts b/frontend/src/types/Home/HomeHeader.ts
index 228baad..9b4d44e 100644
--- a/frontend/src/types/Home/HomeHeader.ts
+++ b/frontend/src/types/Home/HomeHeader.ts
@@ -1,9 +1,9 @@
-export interface DataProps {
- breadcrumbItems: BreadcrumbItems[]
- userOperationMenu: any
-}
-
-interface BreadcrumbItems {
- title: string
- disabled: boolean
-}
+export interface DataProps {
+ breadcrumbItems: BreadcrumbItems[]
+ userOperationMenu: any
+}
+
+interface BreadcrumbItems {
+ title: string
+ disabled: boolean
+}
diff --git a/frontend/src/types/system/Form.ts b/frontend/src/types/System/Form.ts
similarity index 94%
rename from frontend/src/types/system/Form.ts
rename to frontend/src/types/System/Form.ts
index f0e5706..4f48e84 100644
--- a/frontend/src/types/system/Form.ts
+++ b/frontend/src/types/System/Form.ts
@@ -1,45 +1,45 @@
-export interface UniformFileNaming {
- creator?: string
- create_time?: string
- last_update_time?: string
- tenant_id?: number
-}
-
-// VxeTable Required paging parameters
-export interface TablePage {
- total: number
- pageIndex: number
- pageSize: number
- searchObjects?: SearchObject[]
-}
-
-export interface NavListOptions {
- title: string
- labelKey: string
- indexKey: string
- indexValue: string
-}
-
-// API Required paging parameters
-export interface PageConfigProps {
- pageIndex: number
- pageSize: number
- sqlTitle?: string
- searchObjects?: any
-}
-
-export interface VxeTableRow {
- _X_ROW_KEY?: string
-}
-
-export interface SearchObject {
- name?: string,
- operator?: SearchOperator,
- text?: string,
- value?: string
-}
-
-export enum SearchOperator {
- INCLUDE = 6,
- EQUAL = 1
+export interface UniformFileNaming {
+ creator?: string
+ create_time?: string
+ last_update_time?: string
+ tenant_id?: number
+}
+
+// VxeTable Required paging parameters
+export interface TablePage {
+ total: number
+ pageIndex: number
+ pageSize: number
+ searchObjects?: SearchObject[]
+}
+
+export interface NavListOptions {
+ title: string
+ labelKey: string
+ indexKey: string
+ indexValue: string
+}
+
+// API Required paging parameters
+export interface PageConfigProps {
+ pageIndex: number
+ pageSize: number
+ sqlTitle?: string
+ searchObjects?: any
+}
+
+export interface VxeTableRow {
+ _X_ROW_KEY?: string
+}
+
+export interface SearchObject {
+ name?: string,
+ operator?: SearchOperator,
+ text?: string,
+ value?: string
+}
+
+export enum SearchOperator {
+ INCLUDE = 6,
+ EQUAL = 1
}
\ No newline at end of file
diff --git a/frontend/src/types/system/hookComponent.ts b/frontend/src/types/System/HookComponent.ts
similarity index 97%
rename from frontend/src/types/system/hookComponent.ts
rename to frontend/src/types/System/HookComponent.ts
index 7347aff..e24da3a 100644
--- a/frontend/src/types/system/hookComponent.ts
+++ b/frontend/src/types/System/HookComponent.ts
@@ -1,28 +1,28 @@
-// Dialog modal options
-export interface DialogOptions {
- confirmText?: string // confirm btn text
- cancleText?: string // cancle btn text
- handleConfirm?(): void // confirm trigger method
- content: string // dialog content text
- title?: string // dialog title text
- dialogWidth?: string | number // dialog width pixel or percentage
-}
-
-// System message options
-export interface MessageOptions {
- type?: 'success' | 'info' | 'warning' | 'error'
- variant?: 'flat' | 'elevated' | 'tonal' | 'outlined' | 'text' | 'plain'
- content: string
- border?: boolean | 'top' | 'end' | 'bottom' | 'start'
- shutDelay?: number
- color?: string
- messageWidth?: string | number // message width pixel or percentage
-}
-
-// Component list
-export interface Components {
- // eslint-disable-next-line no-unused-vars
- $message(prop: MessageOptions): void
- // eslint-disable-next-line no-unused-vars
- $dialog(prop: DialogOptions): void
-}
+// Dialog modal options
+export interface DialogOptions {
+ confirmText?: string // confirm btn text
+ cancleText?: string // cancle btn text
+ handleConfirm?(): void // confirm trigger method
+ content: string // dialog content text
+ title?: string // dialog title text
+ dialogWidth?: string | number // dialog width pixel or percentage
+}
+
+// System message options
+export interface MessageOptions {
+ type?: 'success' | 'info' | 'warning' | 'error'
+ variant?: 'flat' | 'elevated' | 'tonal' | 'outlined' | 'text' | 'plain'
+ content: string
+ border?: boolean | 'top' | 'end' | 'bottom' | 'start'
+ shutDelay?: number
+ color?: string
+ messageWidth?: string | number // message width pixel or percentage
+}
+
+// Component list
+export interface Components {
+ // eslint-disable-next-line no-unused-vars
+ $message(prop: MessageOptions): void
+ // eslint-disable-next-line no-unused-vars
+ $dialog(prop: DialogOptions): void
+}
diff --git a/frontend/src/types/system/router.ts b/frontend/src/types/System/Router.ts
similarity index 95%
rename from frontend/src/types/system/router.ts
rename to frontend/src/types/System/Router.ts
index ca8f595..3f1f555 100644
--- a/frontend/src/types/system/router.ts
+++ b/frontend/src/types/System/Router.ts
@@ -1,12 +1,12 @@
-import { RouteMeta } from 'vue-router'
-
-export interface CustomerRouterProps {
- name: string
- module?: string
- path: string
- directory: string
- redirect: string
- component: any
- children?: CustomerRouterProps[]
- meta?: RouteMeta
-}
+import { RouteMeta } from 'vue-router'
+
+export interface CustomerRouterProps {
+ name: string
+ module?: string
+ path: string
+ directory: string
+ redirect: string
+ component: any
+ children?: CustomerRouterProps[]
+ meta?: RouteMeta
+}
diff --git a/frontend/src/types/system/Store.ts b/frontend/src/types/System/Store.ts
similarity index 94%
rename from frontend/src/types/system/Store.ts
rename to frontend/src/types/System/Store.ts
index d3e2f50..7d1ef56 100644
--- a/frontend/src/types/system/Store.ts
+++ b/frontend/src/types/System/Store.ts
@@ -1,28 +1,28 @@
-// user
-export interface MenuItem {
- id: number
- menu_name: string
- module: string
- vue_path: string
- vue_path_detail: string
- vue_directory: string
-}
-
-export interface UserStateProps {
- userInfo: any
- token: string
- refreshToken: string
- expirationTime: number
- effectiveMinutes: number
- isRefreshingToken: boolean
- menulist: MenuItem[]
-}
-
-export interface StateProps {
- language: string
- currentRouterPath: string
- openedMenus: string[]
- clientWidth: number
- clientHeight: number
- refreshFlag: boolean
+// user
+export interface MenuItem {
+ id: number
+ menu_name: string
+ module: string
+ vue_path: string
+ vue_path_detail: string
+ vue_directory: string
+}
+
+export interface UserStateProps {
+ userInfo: any
+ token: string
+ refreshToken: string
+ expirationTime: number
+ effectiveMinutes: number
+ isRefreshingToken: boolean
+ menulist: MenuItem[]
+}
+
+export interface StateProps {
+ language: string
+ currentRouterPath: string
+ openedMenus: string[]
+ clientWidth: number
+ clientHeight: number
+ refreshFlag: boolean
}
\ No newline at end of file
diff --git a/frontend/src/types/system/UserModel.ts b/frontend/src/types/System/UserModel.ts
similarity index 94%
rename from frontend/src/types/system/UserModel.ts
rename to frontend/src/types/System/UserModel.ts
index a2b89cf..2e1733a 100644
--- a/frontend/src/types/system/UserModel.ts
+++ b/frontend/src/types/System/UserModel.ts
@@ -1,31 +1,31 @@
-/**
- * @description: Login interface parameters
- */
-export interface LoginParams {
- user_name: string
- password: string
-}
-
-/**
- * @description: Login interface return value
- */
-export interface LoginResultModel {
- userId: string | number
- token: string
-}
-
-/**
- * @description: Get user information return value
- */
-// export interface GetUserInfoModel {
-// // 用户id
-// userId: string | number;
-// // 用户名
-// username: string;
-// // 真实名字
-// realName: string;
-// // 头像
-// avatar: string;
-// // 介绍
-// desc?: string;
-// }
+/**
+ * @description: Login interface parameters
+ */
+export interface LoginParams {
+ user_name: string
+ password: string
+}
+
+/**
+ * @description: Login interface return value
+ */
+export interface LoginResultModel {
+ userId: string | number
+ token: string
+}
+
+/**
+ * @description: Get user information return value
+ */
+// export interface GetUserInfoModel {
+// // 用户id
+// userId: string | number;
+// // 用户名
+// username: string;
+// // 真实名字
+// realName: string;
+// // 头像
+// avatar: string;
+// // 介绍
+// desc?: string;
+// }
diff --git a/frontend/src/types/WMS/StockAsn.ts b/frontend/src/types/WMS/StockAsn.ts
index 1c8809d..7f2b84a 100644
--- a/frontend/src/types/WMS/StockAsn.ts
+++ b/frontend/src/types/WMS/StockAsn.ts
@@ -1,70 +1,70 @@
-import { UniformFileNaming } from '../System/Form'
-
-export interface StockAsnVO extends UniformFileNaming {
- id: number
- asn_no: string
- asn_status: number
- spu_id: number
- spu_code: string
- spu_name: string
- sku_id: number
- sku_code: string
- sku_name: string
- origin: string
- length_unit: number
- volume_unit: number
- weight_unit: number
- asn_qty: number
- actual_qty: number
- sorted_qty: number
- shortage_qty: number
- more_qty: number
- damage_qty: number
- weight: number
- volume: number
- supplier_id: number
- supplier_name: string
- goods_owner_id: number
- goods_owner_name: string
- is_valid: boolean
-}
-
-export interface PutawayVo {
- asn_id: number
- goods_location_id: number
- putaway_qty: number
- location_name: string
-}
-
-export interface SortingVo {
- asn_id: number
- sorted_qty: number
-}
-
-export interface SkuInfoVo {
- spu_id: number
- spu_code: string
- spu_name: string
- category_id: number
- category_name: string
- spu_description: string
- bar_code: string
- supplier_id: number
- supplier_name: string
- brand: string
- origin: string
- length_unit: number
- volume_unit: number
- weight_unit: number
- sku_id: number
- sku_code: string
- sku_name: string
- weight: number
- lenght: number
- width: number
- height: number
- volume: number
- unit: string
- cost: number
- price: number
-}
+import { UniformFileNaming } from '../System/Form'
+
+export interface StockAsnVO extends UniformFileNaming {
+ id: number
+ asn_no: string
+ asn_status: number
+ spu_id: number
+ spu_code: string
+ spu_name: string
+ sku_id: number
+ sku_code: string
+ sku_name: string
+ origin: string
+ length_unit: number
+ volume_unit: number
+ weight_unit: number
+ asn_qty: number
+ actual_qty: number
+ sorted_qty: number
+ shortage_qty: number
+ more_qty: number
+ damage_qty: number
+ weight: number
+ volume: number
+ supplier_id: number
+ supplier_name: string
+ goods_owner_id: number
+ goods_owner_name: string
+ is_valid: boolean
+}
+
+export interface PutawayVo {
+ asn_id: number
+ goods_location_id: number
+ putaway_qty: number
+ location_name: string
+}
+
+export interface SortingVo {
+ asn_id: number
+ sorted_qty: number
+}
+
+export interface SkuInfoVo {
+ spu_id: number
+ spu_code: string
+ spu_name: string
+ category_id: number
+ category_name: string
+ spu_description: string
+ bar_code: string
+ supplier_id: number
+ supplier_name: string
+ brand: string
+ origin: string
+ length_unit: number
+ volume_unit: number
+ weight_unit: number
+ sku_id: number
+ sku_code: string
+ sku_name: string
+ weight: number
+ lenght: number
+ width: number
+ height: number
+ volume: number
+ unit: string
+ cost: number
+ price: number
+}
diff --git a/frontend/src/types/WMS/StockManagement.ts b/frontend/src/types/WMS/StockManagement.ts
index b94fff6..7343e07 100644
--- a/frontend/src/types/WMS/StockManagement.ts
+++ b/frontend/src/types/WMS/StockManagement.ts
@@ -1,29 +1,29 @@
-export interface StockLocationVO {
- warehouse: string
- location_name: string
- spu_code: string
- spu_name: string
- sku_id: number
- sku_code: string
- sku_name: string
- qty: number
- qty_available: number
- qty_locked: number
- qty_frozen: number
-}
-
-export interface StockVO {
- spu_code: string
- spu_name: string
- sku_code: string
- sku_id: number
- qty: number
- qty_available: number
- qty_locked: number
- qty_frozen: number
- qty_asn: number
- qty_to_unload: number
- qty_to_sort: number
- qty_sorted: number
- shortage_qty: number
-}
+export interface StockLocationVO {
+ warehouse: string
+ location_name: string
+ spu_code: string
+ spu_name: string
+ sku_id: number
+ sku_code: string
+ sku_name: string
+ qty: number
+ qty_available: number
+ qty_locked: number
+ qty_frozen: number
+}
+
+export interface StockVO {
+ spu_code: string
+ spu_name: string
+ sku_code: string
+ sku_id: number
+ qty: number
+ qty_available: number
+ qty_locked: number
+ qty_frozen: number
+ qty_asn: number
+ qty_to_unload: number
+ qty_to_sort: number
+ qty_sorted: number
+ shortage_qty: number
+}
diff --git a/frontend/src/types/WarehouseWorking/WarehouseAdjust.ts b/frontend/src/types/WarehouseWorking/WarehouseAdjust.ts
index f4ae0dd..4fefaf7 100644
--- a/frontend/src/types/WarehouseWorking/WarehouseAdjust.ts
+++ b/frontend/src/types/WarehouseWorking/WarehouseAdjust.ts
@@ -1,26 +1,26 @@
-import { UniformFileNaming } from '../System/Form'
-
-export interface WarehouseAdjustVO extends UniformFileNaming {
- id: number
- job_type?: AdjustJobType
- job_code: string
- sku_id: number
- goods_owner_id: number
- goods_location_id: number
- qty: number
- is_update_stock: boolean
- source_table_id: number
- spu_code?: string
- spu_name?: string
- sku_code?: string
- warehouse_name?: string
- location_name?: string
-}
-
-export enum AdjustJobType {
- UNKNOW = 0,
- TAKE = 1,
- PROCESS_COMBINE = 2,
- PROCESS_SPLIT = 3,
- MOVE = 4
-}
+import { UniformFileNaming } from '../System/Form'
+
+export interface WarehouseAdjustVO extends UniformFileNaming {
+ id: number
+ job_type?: AdjustJobType
+ job_code: string
+ sku_id: number
+ goods_owner_id: number
+ goods_location_id: number
+ qty: number
+ is_update_stock: boolean
+ source_table_id: number
+ spu_code?: string
+ spu_name?: string
+ sku_code?: string
+ warehouse_name?: string
+ location_name?: string
+}
+
+export enum AdjustJobType {
+ UNKNOW = 0,
+ TAKE = 1,
+ PROCESS_COMBINE = 2,
+ PROCESS_SPLIT = 3,
+ MOVE = 4
+}
diff --git a/frontend/src/types/WarehouseWorking/WarehouseFreeze.ts b/frontend/src/types/WarehouseWorking/WarehouseFreeze.ts
index 09d2745..91eeca0 100644
--- a/frontend/src/types/WarehouseWorking/WarehouseFreeze.ts
+++ b/frontend/src/types/WarehouseWorking/WarehouseFreeze.ts
@@ -1,17 +1,17 @@
-import { UniformFileNaming } from '../System/Form'
-
-export interface WarehouseFreezeVO extends UniformFileNaming {
- id: number
- job_code: string
- job_type: boolean
- sku_id: number
- goods_owner_id: number
- goods_location_id: number
- handler: string
- handle_time: string
- warehouse_name: string
- location_name: string
- spu_code: string
- spu_name: string
- sku_code: string
-}
+import { UniformFileNaming } from '../System/Form'
+
+export interface WarehouseFreezeVO extends UniformFileNaming {
+ id: number
+ job_code: string
+ job_type: boolean
+ sku_id: number
+ goods_owner_id: number
+ goods_location_id: number
+ handler: string
+ handle_time: string
+ warehouse_name: string
+ location_name: string
+ spu_code: string
+ spu_name: string
+ sku_code: string
+}
diff --git a/frontend/src/types/WarehouseWorking/WarehouseMove.ts b/frontend/src/types/WarehouseWorking/WarehouseMove.ts
index 44633d8..69e530b 100644
--- a/frontend/src/types/WarehouseWorking/WarehouseMove.ts
+++ b/frontend/src/types/WarehouseWorking/WarehouseMove.ts
@@ -1,27 +1,27 @@
-import { UniformFileNaming } from '../System/Form'
-
-export interface WarehouseMoveVO extends UniformFileNaming {
- id: number
- job_code: string
- move_status: MoveStatus
- sku_id: number
- orig_goods_location_id: number
- dest_googs_location_id: number
- qty: number
- goods_owner_id: number
- handler: string
- handle_time: string
- orig_goods_warehouse: string
- orig_goods_location_name: string
- dest_googs_warehouse: string
- dest_googs_location_name: string
- spu_code: string
- spu_name: string
- sku_code: string
- sku_name: string
-}
-
-export enum MoveStatus {
- UNADJUST = 0,
- ADJUSTED = 1
-}
+import { UniformFileNaming } from '../System/Form'
+
+export interface WarehouseMoveVO extends UniformFileNaming {
+ id: number
+ job_code: string
+ move_status: MoveStatus
+ sku_id: number
+ orig_goods_location_id: number
+ dest_googs_location_id: number
+ qty: number
+ goods_owner_id: number
+ handler: string
+ handle_time: string
+ orig_goods_warehouse: string
+ orig_goods_location_name: string
+ dest_googs_warehouse: string
+ dest_googs_location_name: string
+ spu_code: string
+ spu_name: string
+ sku_code: string
+ sku_name: string
+}
+
+export enum MoveStatus {
+ UNADJUST = 0,
+ ADJUSTED = 1
+}
diff --git a/frontend/src/types/WarehouseWorking/WarehouseProcessing.ts b/frontend/src/types/WarehouseWorking/WarehouseProcessing.ts
index 111b0b0..132cad5 100644
--- a/frontend/src/types/WarehouseWorking/WarehouseProcessing.ts
+++ b/frontend/src/types/WarehouseWorking/WarehouseProcessing.ts
@@ -1,31 +1,31 @@
-import { UniformFileNaming } from '../System/Form'
-
-export interface WarehouseProcessingVO extends UniformFileNaming {
- id: number
- job_code: string
- job_type: boolean
- process_status: boolean
- processor: string
- process_time: string
- source_detail_list?: Array<WarehouseProcessingDetailVO>
- target_detail_list?: Array<WarehouseProcessingDetailVO>
- adjust_status?: boolean
- detailList?: Array<any>
-}
-
-export interface WarehouseProcessingDetailVO extends UniformFileNaming {
- id: number
- stock_process_id: number
- sku_id: number
- goods_owner_id: number
- goods_location_id: number
- qty: number | string
- is_source: boolean
- spu_code: string
- spu_name: string
- sku_code: string
- unit: string
- is_update_stock: boolean
- qty_available?: number
- location_name?: string
-}
+import { UniformFileNaming } from '../System/Form'
+
+export interface WarehouseProcessingVO extends UniformFileNaming {
+ id: number
+ job_code: string
+ job_type: boolean
+ process_status: boolean
+ processor: string
+ process_time: string
+ source_detail_list?: Array<WarehouseProcessingDetailVO>
+ target_detail_list?: Array<WarehouseProcessingDetailVO>
+ adjust_status?: boolean
+ detailList?: Array<any>
+}
+
+export interface WarehouseProcessingDetailVO extends UniformFileNaming {
+ id: number
+ stock_process_id: number
+ sku_id: number
+ goods_owner_id: number
+ goods_location_id: number
+ qty: number | string
+ is_source: boolean
+ spu_code: string
+ spu_name: string
+ sku_code: string
+ unit: string
+ is_update_stock: boolean
+ qty_available?: number
+ location_name?: string
+}
diff --git a/frontend/src/types/WarehouseWorking/WarehouseTaking.ts b/frontend/src/types/WarehouseWorking/WarehouseTaking.ts
index b4cc40a..8ec6b6b 100644
--- a/frontend/src/types/WarehouseWorking/WarehouseTaking.ts
+++ b/frontend/src/types/WarehouseWorking/WarehouseTaking.ts
@@ -1,21 +1,21 @@
-import { UniformFileNaming } from '../System/Form'
-
-export interface WarehouseTakingVO extends UniformFileNaming {
- id: number
- job_code: string
- job_status: boolean
- sku_id: number
- goods_owner_id: number
- goods_location_id: number
- book_qty: number
- counted_qty: number
- difference_qty: number
- spu_code: string
- spu_name: string
- sku_code: string
- warehouse_name: string
- location_name: string
- adjust_status: boolean
- handler: string
- handle_time: string
-}
+import { UniformFileNaming } from '../System/Form'
+
+export interface WarehouseTakingVO extends UniformFileNaming {
+ id: number
+ job_code: string
+ job_status: boolean
+ sku_id: number
+ goods_owner_id: number
+ goods_location_id: number
+ book_qty: number
+ counted_qty: number
+ difference_qty: number
+ spu_code: string
+ spu_name: string
+ sku_code: string
+ warehouse_name: string
+ location_name: string
+ adjust_status: boolean
+ handler: string
+ handle_time: string
+}
diff --git a/frontend/src/utils/bus.ts b/frontend/src/utils/bus.ts
index f2a3b92..31fb2f5 100644
--- a/frontend/src/utils/bus.ts
+++ b/frontend/src/utils/bus.ts
@@ -1,4 +1,4 @@
-// using ES6 modules
-import mitt from 'mitt'
-
-export const emitter = mitt()
+// using ES6 modules
+import mitt from 'mitt'
+
+export const emitter = mitt()
diff --git a/frontend/src/utils/common.ts b/frontend/src/utils/common.ts
index 6595c84..68dd621 100644
--- a/frontend/src/utils/common.ts
+++ b/frontend/src/utils/common.ts
@@ -1,57 +1,57 @@
-import XEUtils from 'xe-utils'
-import { SearchObject, SearchOperator } from '@/types/System/Form'
-
-export const setSearchObject = (searchForm: any, preciseSearchCols: string[] = []) => {
- const searchObjects: Array<SearchObject> = []
- try {
- for (const key in searchForm) {
- const str = key as string
- const searchValue = searchForm[str as keyof typeof searchForm]
- let operator = SearchOperator.INCLUDE
- if (preciseSearchCols.includes(key)) {
- operator = SearchOperator.EQUAL
- }
-
- if (searchValue && searchValue.trim() !== '') {
- searchObjects.push({
- name: key,
- operator,
- text: searchValue,
- value: searchValue
- })
- }
- }
- return searchObjects
- } catch (error) {
- return searchObjects
- }
-}
-
-// Remove item what value is 'null' or '' in array
-export const removeArrayNull = (array: any) => {
- for (const obj of array) {
- Object.keys(obj).forEach((item) => {
- if (XEUtils.isString(obj[item])) {
- obj[item] = obj[item].replace(/(^\s*)|(\s*$)/g, '')
- }
- if (obj[item] === '' || obj[item] === null) {
- delete obj[item]
- }
- })
- }
- return array
-}
-
-// Remove item what value is 'null' or '' in object
-export const removeObjectNull = (obj: any) => {
- const copy = JSON.parse(JSON.stringify(obj))
- Object.keys(copy).forEach((item) => {
- if (XEUtils.isString(copy[item])) {
- copy[item] = copy[item].replace(/(^\s*)|(\s*$)/g, '')
- }
- if (copy[item] === '' || copy[item] == null) {
- delete copy[item]
- }
- })
- return copy
-}
+import XEUtils from 'xe-utils'
+import { SearchObject, SearchOperator } from '@/types/System/Form'
+
+export const setSearchObject = (searchForm: any, preciseSearchCols: string[] = []) => {
+ const searchObjects: Array<SearchObject> = []
+ try {
+ for (const key in searchForm) {
+ const str = key as string
+ const searchValue = searchForm[str as keyof typeof searchForm]
+ let operator = SearchOperator.INCLUDE
+ if (preciseSearchCols.includes(key)) {
+ operator = SearchOperator.EQUAL
+ }
+
+ if (searchValue && searchValue.trim() !== '') {
+ searchObjects.push({
+ name: key,
+ operator,
+ text: searchValue,
+ value: searchValue
+ })
+ }
+ }
+ return searchObjects
+ } catch (error) {
+ return searchObjects
+ }
+}
+
+// Remove item what value is 'null' or '' in array
+export const removeArrayNull = (array: any) => {
+ for (const obj of array) {
+ Object.keys(obj).forEach((item) => {
+ if (XEUtils.isString(obj[item])) {
+ obj[item] = obj[item].replace(/(^\s*)|(\s*$)/g, '')
+ }
+ if (obj[item] === '' || obj[item] === null) {
+ delete obj[item]
+ }
+ })
+ }
+ return array
+}
+
+// Remove item what value is 'null' or '' in object
+export const removeObjectNull = (obj: any) => {
+ const copy = JSON.parse(JSON.stringify(obj))
+ Object.keys(copy).forEach((item) => {
+ if (XEUtils.isString(copy[item])) {
+ copy[item] = copy[item].replace(/(^\s*)|(\s*$)/g, '')
+ }
+ if (copy[item] === '' || copy[item] == null) {
+ delete copy[item]
+ }
+ })
+ return copy
+}
diff --git a/frontend/src/utils/dataVerification/formRule.ts b/frontend/src/utils/dataVerification/formRule.ts
index ad3cf27..97f0b5b 100644
--- a/frontend/src/utils/dataVerification/formRule.ts
+++ b/frontend/src/utils/dataVerification/formRule.ts
@@ -1,94 +1,94 @@
-import i18n from '@/languages/i18n'
-
-// Judge whether it is integer
-export function IsInteger(value: string | number, validNumerical: 'nonNegative' | 'greaterThanZero' | 'noZero', length?: number): string {
- if (typeof value === 'number') {
- value = String(value)
- }
- let validText = ''
- if (value === '' || value == null) {
- return ''
- }
- let re = /^-?[0-9]\d*$/
- let max = 2147483647
- let min = -2147483648
- length = length || 32
- if (length === 8) {
- max = 255
- min = 0
- } else if (length === 16) {
- max = 32767
- min = -32768
- }
- switch (validNumerical) {
- case 'nonNegative':
- re = /^[0-9]\d*$/
- validText = '>=0'
- break
- case 'greaterThanZero':
- re = /^[1-9]\d*$/
- validText = '>0'
- break
- case 'noZero':
- re = /^[-]?[1-9][0-9]*$/
- validText = '!=0'
- break
- }
- const rsCheck = re.test(value)
- if (!rsCheck) {
- return `${ i18n.global.t('system.checkText.mustInput') }${ validText }${ i18n.global.t('system.checkText.integer') }`
- }
- if (Number(value) > max || Number(value) < min) {
- return `${ i18n.global.t('system.checkText.mustInput') }${ min }-${ max }${ i18n.global.t('system.checkText.integer') }`
- }
- return ''
-}
-
-// Judge whether it is decimal
-export function IsDecimal(
- value: string | number,
- validNumerical: 'nonNegative' | 'greaterThanZero',
- length?: number,
- decimalLength?: number
-): string {
- if (typeof value === 'number') {
- value = String(value)
- }
- if (value === '' || value == null) {
- return ''
- }
- let validText = ''
- let reg = /^[-]?\d+(\.\d+)?$/
- switch (validNumerical) {
- case 'nonNegative':
- reg = /^\d+(\.\d+)?$/
- validText = '>=0'
- break
- case 'greaterThanZero':
- reg = /^[+]{0,1}([1-9][0-9]{0,})$|^[+]{0,1}([1-9][0-9]{0,}\.\d+)$|^[+]{0,1}([0]\.(?!0+$)\d{1,})$/
- validText = '>0'
- break
- }
- const rsCheck = reg.test(value)
- if (!rsCheck) {
- return `${ i18n.global.t('system.checkText.pleaseEnter') }${ validText }${ i18n.global.t('system.checkText.decimal') }`
- }
- length = length || 18
- decimalLength = decimalLength || 2
- const arr = value.toString().split('.')
- if (arr.length > 0 && arr[0].length > length - decimalLength) {
- return `${ i18n.global.t('system.checkText.pleaseEnter') }${ length - decimalLength }${ i18n.global.t('system.checkText.inputIntMsg') }`
- }
- if (arr.length > 1 && arr[1].length > decimalLength) {
- return `${ i18n.global.t('system.checkText.pleaseEnter') }${ decimalLength }${ i18n.global.t('system.checkText.inputDecimalMsg') }`
- }
- return ''
-}
-
-// Judge string length
-export function StringLength(value: string, min: number, max: number) {
- if (value.length < min || value.length > max) {
- return `${ i18n.global.t('system.checkText.lengthValid') }${ min }-${ max }`
- }
- return ''
+import i18n from '@/languages/i18n'
+
+// Judge whether it is integer
+export function IsInteger(value: string | number, validNumerical: 'nonNegative' | 'greaterThanZero' | 'noZero', length?: number): string {
+ if (typeof value === 'number') {
+ value = String(value)
+ }
+ let validText = ''
+ if (value === '' || value == null) {
+ return ''
+ }
+ let re = /^-?[0-9]\d*$/
+ let max = 2147483647
+ let min = -2147483648
+ length = length || 32
+ if (length === 8) {
+ max = 255
+ min = 0
+ } else if (length === 16) {
+ max = 32767
+ min = -32768
+ }
+ switch (validNumerical) {
+ case 'nonNegative':
+ re = /^[0-9]\d*$/
+ validText = '>=0'
+ break
+ case 'greaterThanZero':
+ re = /^[1-9]\d*$/
+ validText = '>0'
+ break
+ case 'noZero':
+ re = /^[-]?[1-9][0-9]*$/
+ validText = '!=0'
+ break
+ }
+ const rsCheck = re.test(value)
+ if (!rsCheck) {
+ return `${ i18n.global.t('system.checkText.mustInput') }${ validText }${ i18n.global.t('system.checkText.integer') }`
+ }
+ if (Number(value) > max || Number(value) < min) {
+ return `${ i18n.global.t('system.checkText.mustInput') }${ min }-${ max }${ i18n.global.t('system.checkText.integer') }`
+ }
+ return ''
+}
+
+// Judge whether it is decimal
+export function IsDecimal(
+ value: string | number,
+ validNumerical: 'nonNegative' | 'greaterThanZero',
+ length?: number,
+ decimalLength?: number
+): string {
+ if (typeof value === 'number') {
+ value = String(value)
+ }
+ if (value === '' || value == null) {
+ return ''
+ }
+ let validText = ''
+ let reg = /^[-]?\d+(\.\d+)?$/
+ switch (validNumerical) {
+ case 'nonNegative':
+ reg = /^\d+(\.\d+)?$/
+ validText = '>=0'
+ break
+ case 'greaterThanZero':
+ reg = /^[+]{0,1}([1-9][0-9]{0,})$|^[+]{0,1}([1-9][0-9]{0,}\.\d+)$|^[+]{0,1}([0]\.(?!0+$)\d{1,})$/
+ validText = '>0'
+ break
+ }
+ const rsCheck = reg.test(value)
+ if (!rsCheck) {
+ return `${ i18n.global.t('system.checkText.pleaseEnter') }${ validText }${ i18n.global.t('system.checkText.decimal') }`
+ }
+ length = length || 18
+ decimalLength = decimalLength || 2
+ const arr = value.toString().split('.')
+ if (arr.length > 0 && arr[0].length > length - decimalLength) {
+ return `${ i18n.global.t('system.checkText.pleaseEnter') }${ length - decimalLength }${ i18n.global.t('system.checkText.inputIntMsg') }`
+ }
+ if (arr.length > 1 && arr[1].length > decimalLength) {
+ return `${ i18n.global.t('system.checkText.pleaseEnter') }${ decimalLength }${ i18n.global.t('system.checkText.inputDecimalMsg') }`
+ }
+ return ''
+}
+
+// Judge string length
+export function StringLength(value: string, min: number, max: number) {
+ if (value.length < min || value.length > max) {
+ return `${ i18n.global.t('system.checkText.lengthValid') }${ min }-${ max }`
+ }
+ return ''
}
\ No newline at end of file
diff --git a/frontend/src/utils/dataVerification/page.ts b/frontend/src/utils/dataVerification/page.ts
index c6e6bc9..627f90d 100644
--- a/frontend/src/utils/dataVerification/page.ts
+++ b/frontend/src/utils/dataVerification/page.ts
@@ -1,41 +1,41 @@
-/**
- * Duplicate inspection details
- * @param detail Array to be verified
- * @param checkKey Collection of items to be checked in the array object
- * @returns Repeat array
- */
-export function checkDetailRepeatGetArry(detail: any[], checkKey: string[]): any[] {
- const repeatArray: any[] = []
- for (const item of detail) {
- let repeat = true
- for (const key of checkKey) {
- if (detail.filter(df => df[key] === item[key]).length === 1) {
- repeat = false
- }
- }
- if (repeat) {
- repeatArray.push(item)
- }
- }
- return repeatArray
-}
-/**
- * Duplicate inspection details
- * @param detail Array to be verified
- * @param checkKey Collection of items to be checked in the array object
- * @returns Duplicate or not
- */
-export function checkDetailRepeatGetBool(detail: any[], checkKey: string[]): boolean {
- for (const item of detail) {
- let repeat = true
- for (const key of checkKey) {
- if (detail.filter(df => df[key] === item[key]).length === 1) {
- repeat = false
- }
- }
- if (repeat) {
- return true
- }
- }
- return false
-}
+/**
+ * Duplicate inspection details
+ * @param detail Array to be verified
+ * @param checkKey Collection of items to be checked in the array object
+ * @returns Repeat array
+ */
+export function checkDetailRepeatGetArry(detail: any[], checkKey: string[]): any[] {
+ const repeatArray: any[] = []
+ for (const item of detail) {
+ let repeat = true
+ for (const key of checkKey) {
+ if (detail.filter(df => df[key] === item[key]).length === 1) {
+ repeat = false
+ }
+ }
+ if (repeat) {
+ repeatArray.push(item)
+ }
+ }
+ return repeatArray
+}
+/**
+ * Duplicate inspection details
+ * @param detail Array to be verified
+ * @param checkKey Collection of items to be checked in the array object
+ * @returns Duplicate or not
+ */
+export function checkDetailRepeatGetBool(detail: any[], checkKey: string[]): boolean {
+ for (const item of detail) {
+ let repeat = true
+ for (const key of checkKey) {
+ if (detail.filter(df => df[key] === item[key]).length === 1) {
+ repeat = false
+ }
+ }
+ if (repeat) {
+ return true
+ }
+ }
+ return false
+}
diff --git a/frontend/src/utils/dataVerification/tableRule.ts b/frontend/src/utils/dataVerification/tableRule.ts
index 4415f31..5652ec1 100644
--- a/frontend/src/utils/dataVerification/tableRule.ts
+++ b/frontend/src/utils/dataVerification/tableRule.ts
@@ -1,83 +1,83 @@
-import i18n from '@/languages/i18n'
-
-// Judge whether it is integer
-export function isInteger(rule: any, value: any) {
- if (rule.hasOwnProperty('cellValue')) {
- value = rule.cellValue
- rule = rule.rule
- }
- return new Promise((resolve, reject) => {
- let validText = ''
- if (value === '' || value == null) {
- resolve(true)
- } else {
- let re = /^-?[0-9]\d*$/
- let max = 2147483647
- let min = -2147483648
- const length = rule.length || 32
- if (length === 8) {
- max = 255
- min = 0
- } else if (length === 16) {
- max = 32767
- min = -32768
- }
- if (rule.validNumerical === 'nonNegative') {
- re = /^[0-9]\d*$/
- validText = '>=0'
- } else if (rule.validNumerical === 'greaterThanZero') {
- re = /^[1-9]\d*$/
- validText = '>0'
- } else if (rule.validNumerical === 'noZero') {
- re = /^[-]?[1-9][0-9]*$/
- validText = '!=0'
- }
- const rsCheck = re.test(value)
- if (!rsCheck) {
- reject(new Error(`${ i18n.global.t('system.checkText.mustInput') }${ validText }${ i18n.global.t('system.checkText.integer') }`))
- } else if (value > max || value < min) {
- reject(new Error(`${ i18n.global.t('system.checkText.mustInput') }${ min }-${ max }${ i18n.global.t('system.checkText.integer') }`))
- } else {
- resolve(true)
- }
- }
- })
-}
-
-// Judge whether it is decimal
-export function isDecimal(rule: any, value: any): any {
- if (rule.hasOwnProperty('cellValue')) {
- value = rule.cellValue
- rule = rule.rule
- }
- return new Promise((resolve, reject) => {
- if (value === '' || value == null) {
- resolve(true)
- } else {
- let validText = ''
- let reg = /^[-]?\d+(\.\d+)?$/
- if (rule.validNumerical === 'nonNegative') {
- reg = /^\d+(\.\d+)?$/
- validText = '>=0'
- } else if (rule.validNumerical === 'greaterThanZero') {
- reg = /^[+]{0,1}([1-9][0-9]{0,})$|^[+]{0,1}([1-9][0-9]{0,}\.\d+)$|^[+]{0,1}([0]\.(?!0+$)\d{1,})$/
- validText = '>0'
- }
- const rsCheck = reg.test(value)
- if (!rsCheck) {
- reject(new Error(`${ i18n.global.t('system.checkText.pleaseEnter') }${ validText }${ i18n.global.t('system.checkText.decimal') }`))
- } else {
- const length = rule.length || 18
- const decimalLength = rule.decimalLength || 2
- const arr = value.toString().split('.')
- if (arr.length > 0 && arr[0].length > length - decimalLength) {
- reject(new Error(`${ i18n.global.t('system.checkText.pleaseEnter') }${ length - decimalLength }${ i18n.global.t('system.checkText.inputIntMsg') }`))
- } else if (arr.length > 1 && arr[1].length > decimalLength) {
- reject(new Error(`${ i18n.global.t('system.checkText.pleaseEnter') }${ decimalLength }${ i18n.global.t('system.checkText.inputDecimalMsg') }`))
- } else {
- resolve(true)
- }
- }
- }
- })
-}
+import i18n from '@/languages/i18n'
+
+// Judge whether it is integer
+export function isInteger(rule: any, value: any) {
+ if (rule.hasOwnProperty('cellValue')) {
+ value = rule.cellValue
+ rule = rule.rule
+ }
+ return new Promise((resolve, reject) => {
+ let validText = ''
+ if (value === '' || value == null) {
+ resolve(true)
+ } else {
+ let re = /^-?[0-9]\d*$/
+ let max = 2147483647
+ let min = -2147483648
+ const length = rule.length || 32
+ if (length === 8) {
+ max = 255
+ min = 0
+ } else if (length === 16) {
+ max = 32767
+ min = -32768
+ }
+ if (rule.validNumerical === 'nonNegative') {
+ re = /^[0-9]\d*$/
+ validText = '>=0'
+ } else if (rule.validNumerical === 'greaterThanZero') {
+ re = /^[1-9]\d*$/
+ validText = '>0'
+ } else if (rule.validNumerical === 'noZero') {
+ re = /^[-]?[1-9][0-9]*$/
+ validText = '!=0'
+ }
+ const rsCheck = re.test(value)
+ if (!rsCheck) {
+ reject(new Error(`${ i18n.global.t('system.checkText.mustInput') }${ validText }${ i18n.global.t('system.checkText.integer') }`))
+ } else if (value > max || value < min) {
+ reject(new Error(`${ i18n.global.t('system.checkText.mustInput') }${ min }-${ max }${ i18n.global.t('system.checkText.integer') }`))
+ } else {
+ resolve(true)
+ }
+ }
+ })
+}
+
+// Judge whether it is decimal
+export function isDecimal(rule: any, value: any): any {
+ if (rule.hasOwnProperty('cellValue')) {
+ value = rule.cellValue
+ rule = rule.rule
+ }
+ return new Promise((resolve, reject) => {
+ if (value === '' || value == null) {
+ resolve(true)
+ } else {
+ let validText = ''
+ let reg = /^[-]?\d+(\.\d+)?$/
+ if (rule.validNumerical === 'nonNegative') {
+ reg = /^\d+(\.\d+)?$/
+ validText = '>=0'
+ } else if (rule.validNumerical === 'greaterThanZero') {
+ reg = /^[+]{0,1}([1-9][0-9]{0,})$|^[+]{0,1}([1-9][0-9]{0,}\.\d+)$|^[+]{0,1}([0]\.(?!0+$)\d{1,})$/
+ validText = '>0'
+ }
+ const rsCheck = reg.test(value)
+ if (!rsCheck) {
+ reject(new Error(`${ i18n.global.t('system.checkText.pleaseEnter') }${ validText }${ i18n.global.t('system.checkText.decimal') }`))
+ } else {
+ const length = rule.length || 18
+ const decimalLength = rule.decimalLength || 2
+ const arr = value.toString().split('.')
+ if (arr.length > 0 && arr[0].length > length - decimalLength) {
+ reject(new Error(`${ i18n.global.t('system.checkText.pleaseEnter') }${ length - decimalLength }${ i18n.global.t('system.checkText.inputIntMsg') }`))
+ } else if (arr.length > 1 && arr[1].length > decimalLength) {
+ reject(new Error(`${ i18n.global.t('system.checkText.pleaseEnter') }${ decimalLength }${ i18n.global.t('system.checkText.inputDecimalMsg') }`))
+ } else {
+ resolve(true)
+ }
+ }
+ }
+ })
+}
diff --git a/frontend/src/utils/exportTable.ts b/frontend/src/utils/exportTable.ts
index 8757af1..f8ae238 100644
--- a/frontend/src/utils/exportTable.ts
+++ b/frontend/src/utils/exportTable.ts
@@ -1,69 +1,69 @@
-import * as XLSX from 'xlsx'
-import { hookComponent } from '@/components/system'
-import i18n from '@/languages/i18n'
-/**
- * Export table
- * Default type is 'xlsx'
- */
-export const exportData = ({ table, filename, columnFilterMethod, mode = 'all' }: IExportTable): void => {
- try {
- // 1.Get table header
- const columns = table?.getColumns()
- const theadDOM = table.$el.querySelector('.body--wrapper>.vxe-table--header')
- const theadDOMCopy = theadDOM.cloneNode(true)
- const headerRow = theadDOMCopy.querySelector('.vxe-header--row')
- const headerColumn = theadDOMCopy.querySelectorAll('.vxe-header--column')
-
- // 2.Get table data
- const bodyDOM = table.$el.querySelector('.body--wrapper>.vxe-table--body')
- const bodyDOMCopy = bodyDOM.cloneNode(true)
- const rowDOMList = bodyDOMCopy.querySelectorAll('.vxe-body--row')
-
- // 3.Filter header in table
- for (let i = 0; i < columns.length; i++) {
- const column = columns[i]
- if (columnFilterMethod && !columnFilterMethod({ column })) {
- headerRow.removeChild(headerColumn[i])
- }
- }
-
- // 4.Filter table data in table
- for (let j = 0; j < rowDOMList.length; j++) {
- const row = rowDOMList[j]
- const columnDOMList = row.querySelectorAll('.vxe-body--column')
-
- for (let i = 0; i < columns.length; i++) {
- const column = columns[i]
- if (columnFilterMethod && !columnFilterMethod({ column })) {
- row.removeChild(columnDOMList[i])
- }
- }
- }
-
- // 5.Combine table header and data
- const combineDOM = document.createElement('div')
- combineDOM.appendChild(theadDOMCopy)
- if (mode === 'all') {
- combineDOM.appendChild(bodyDOMCopy)
- }
-
- // 6.Export
- const workBook = XLSX.utils.table_to_book(combineDOM as HTMLElement)
- XLSX.writeFile(workBook, `${ filename }.xlsx`)
- } catch (error) {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('system.page.export') }${ i18n.global.t('system.tips.fail') }`
- })
- }
-}
-
-interface IExportTable {
- table: any
- filename?: string
- exceptIndex?: Array<number>
- mode?: 'all' | 'header'
- columnFilterMethod?: FilterMEthod
-}
-
-type FilterMEthod = ({ column, row }: any) => boolean
+import * as XLSX from 'xlsx'
+import { hookComponent } from '@/components/system'
+import i18n from '@/languages/i18n'
+/**
+ * Export table
+ * Default type is 'xlsx'
+ */
+export const exportData = ({ table, filename, columnFilterMethod, mode = 'all' }: IExportTable): void => {
+ try {
+ // 1.Get table header
+ const columns = table?.getColumns()
+ const theadDOM = table.$el.querySelector('.body--wrapper>.vxe-table--header')
+ const theadDOMCopy = theadDOM.cloneNode(true)
+ const headerRow = theadDOMCopy.querySelector('.vxe-header--row')
+ const headerColumn = theadDOMCopy.querySelectorAll('.vxe-header--column')
+
+ // 2.Get table data
+ const bodyDOM = table.$el.querySelector('.body--wrapper>.vxe-table--body')
+ const bodyDOMCopy = bodyDOM.cloneNode(true)
+ const rowDOMList = bodyDOMCopy.querySelectorAll('.vxe-body--row')
+
+ // 3.Filter header in table
+ for (let i = 0; i < columns.length; i++) {
+ const column = columns[i]
+ if (columnFilterMethod && !columnFilterMethod({ column })) {
+ headerRow.removeChild(headerColumn[i])
+ }
+ }
+
+ // 4.Filter table data in table
+ for (let j = 0; j < rowDOMList.length; j++) {
+ const row = rowDOMList[j]
+ const columnDOMList = row.querySelectorAll('.vxe-body--column')
+
+ for (let i = 0; i < columns.length; i++) {
+ const column = columns[i]
+ if (columnFilterMethod && !columnFilterMethod({ column })) {
+ row.removeChild(columnDOMList[i])
+ }
+ }
+ }
+
+ // 5.Combine table header and data
+ const combineDOM = document.createElement('div')
+ combineDOM.appendChild(theadDOMCopy)
+ if (mode === 'all') {
+ combineDOM.appendChild(bodyDOMCopy)
+ }
+
+ // 6.Export
+ const workBook = XLSX.utils.table_to_book(combineDOM as HTMLElement)
+ XLSX.writeFile(workBook, `${ filename }.xlsx`)
+ } catch (error) {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('system.page.export') }${ i18n.global.t('system.tips.fail') }`
+ })
+ }
+}
+
+interface IExportTable {
+ table: any
+ filename?: string
+ exceptIndex?: Array<number>
+ mode?: 'all' | 'header'
+ columnFilterMethod?: FilterMEthod
+}
+
+type FilterMEthod = ({ column, row }: any) => boolean
diff --git a/frontend/src/utils/format/formatSystem.ts b/frontend/src/utils/format/formatSystem.ts
index 8af8882..7c5fac9 100644
--- a/frontend/src/utils/format/formatSystem.ts
+++ b/frontend/src/utils/format/formatSystem.ts
@@ -1,17 +1,17 @@
-import XEUtils from 'xe-utils'
-import i18n from '@/languages/i18n'
-
-export const formatIsValid = (value: boolean) => (value ? i18n.global.t('system.combobox.yesOrNo.yes') : i18n.global.t('system.combobox.yesOrNo.no'))
-
-export const formatDate = (value: string, format?: string) => {
- const date = new Date(value)
- if (!value || !date || XEUtils.toDateString(date, 'yyyy-MM-dd') === '1900-01-01') {
- return ''
- }
- return XEUtils.toDateString(date, format || 'yyyy-MM-dd HH:mm:ss')
-}
-
-export const formatString = (value: any): string => {
- if (value == null) return ''
- return value?.toString() || ''
+import XEUtils from 'xe-utils'
+import i18n from '@/languages/i18n'
+
+export const formatIsValid = (value: boolean) => (value ? i18n.global.t('system.combobox.yesOrNo.yes') : i18n.global.t('system.combobox.yesOrNo.no'))
+
+export const formatDate = (value: string, format?: string) => {
+ const date = new Date(value)
+ if (!value || !date || XEUtils.toDateString(date, 'yyyy-MM-dd') === '1900-01-01') {
+ return ''
+ }
+ return XEUtils.toDateString(date, format || 'yyyy-MM-dd HH:mm:ss')
+}
+
+export const formatString = (value: any): string => {
+ if (value == null) return ''
+ return value?.toString() || ''
}
\ No newline at end of file
diff --git a/frontend/src/utils/format/formatWarehouse.ts b/frontend/src/utils/format/formatWarehouse.ts
index 9237b49..874ba21 100644
--- a/frontend/src/utils/format/formatWarehouse.ts
+++ b/frontend/src/utils/format/formatWarehouse.ts
@@ -1,21 +1,21 @@
-import { AreaProperty } from '@/types/Base/Warehouse'
-import i18n from '@/languages/i18n'
-
-export const formatAreaProperty = (value: number) => {
- switch (value) {
- case AreaProperty.picking_area:
- return i18n.global.t('base.warehouseSetting.picking_area')
- case AreaProperty.stocking_area:
- return i18n.global.t('base.warehouseSetting.stocking_area')
- case AreaProperty.receiving_area:
- return i18n.global.t('base.warehouseSetting.receiving_area')
- case AreaProperty.return_area:
- return i18n.global.t('base.warehouseSetting.return_area')
- case AreaProperty.defective_area:
- return i18n.global.t('base.warehouseSetting.defective_area')
- case AreaProperty.inventory_area:
- return i18n.global.t('base.warehouseSetting.inventory_area')
- default:
- return ''
- }
-}
+import { AreaProperty } from '@/types/Base/Warehouse'
+import i18n from '@/languages/i18n'
+
+export const formatAreaProperty = (value: number) => {
+ switch (value) {
+ case AreaProperty.picking_area:
+ return i18n.global.t('base.warehouseSetting.picking_area')
+ case AreaProperty.stocking_area:
+ return i18n.global.t('base.warehouseSetting.stocking_area')
+ case AreaProperty.receiving_area:
+ return i18n.global.t('base.warehouseSetting.receiving_area')
+ case AreaProperty.return_area:
+ return i18n.global.t('base.warehouseSetting.return_area')
+ case AreaProperty.defective_area:
+ return i18n.global.t('base.warehouseSetting.defective_area')
+ case AreaProperty.inventory_area:
+ return i18n.global.t('base.warehouseSetting.inventory_area')
+ default:
+ return ''
+ }
+}
diff --git a/frontend/src/utils/format/formatWarehouseWorking.ts b/frontend/src/utils/format/formatWarehouseWorking.ts
index 47b91e7..d4bf2d8 100644
--- a/frontend/src/utils/format/formatWarehouseWorking.ts
+++ b/frontend/src/utils/format/formatWarehouseWorking.ts
@@ -1,35 +1,35 @@
-import i18n from '@/languages/i18n'
-import { PROCESS_JOB_COMBINE, FREEZE_JOB_FREEZE, TAKING_JOB_FINISH } from '@/constant/warehouseWorking'
-import { MoveStatus } from '@/types/WarehouseWorking/WarehouseMove'
-import { AdjustJobType } from '@/types/WarehouseWorking/WarehouseAdjust'
-
-export const formatProcessJobType = (value: boolean) => (value === PROCESS_JOB_COMBINE
- ? i18n.global.t('wms.warehouseWorking.warehouseProcessing.process_combine')
- : i18n.global.t('wms.warehouseWorking.warehouseProcessing.process_split'))
-
-export const formatFreezeJobType = (value: boolean) => (value === FREEZE_JOB_FREEZE
- ? i18n.global.t('wms.warehouseWorking.warehouseFreeze.freeze')
- : i18n.global.t('wms.warehouseWorking.warehouseFreeze.unfreeze'))
-
-export const formatMoveStatus = (value: number) => (value === MoveStatus.UNADJUST
- ? i18n.global.t('wms.warehouseWorking.warehouseMove.unadjust')
- : i18n.global.t('wms.warehouseWorking.warehouseMove.adjusted'))
-
-export const formatTakingJobStatus = (value: boolean) => (value === TAKING_JOB_FINISH
- ? i18n.global.t('wms.warehouseWorking.warehouseTaking.finish')
- : i18n.global.t('wms.warehouseWorking.warehouseTaking.unfinish'))
-
-export const formatAdjustJobType = (value: number) => {
- switch (value) {
- case AdjustJobType.TAKE:
- return i18n.global.t('wms.warehouseWorking.warehouseAdjust.warehouseTake')
- case AdjustJobType.PROCESS_COMBINE:
- return i18n.global.t('wms.warehouseWorking.warehouseAdjust.processCombine')
- case AdjustJobType.PROCESS_SPLIT:
- return i18n.global.t('wms.warehouseWorking.warehouseAdjust.processSplit')
- case AdjustJobType.MOVE:
- return i18n.global.t('wms.warehouseWorking.warehouseAdjust.warehouseMove')
- default:
- return ''
- }
-}
+import i18n from '@/languages/i18n'
+import { PROCESS_JOB_COMBINE, FREEZE_JOB_FREEZE, TAKING_JOB_FINISH } from '@/constant/warehouseWorking'
+import { MoveStatus } from '@/types/WarehouseWorking/WarehouseMove'
+import { AdjustJobType } from '@/types/WarehouseWorking/WarehouseAdjust'
+
+export const formatProcessJobType = (value: boolean) => (value === PROCESS_JOB_COMBINE
+ ? i18n.global.t('wms.warehouseWorking.warehouseProcessing.process_combine')
+ : i18n.global.t('wms.warehouseWorking.warehouseProcessing.process_split'))
+
+export const formatFreezeJobType = (value: boolean) => (value === FREEZE_JOB_FREEZE
+ ? i18n.global.t('wms.warehouseWorking.warehouseFreeze.freeze')
+ : i18n.global.t('wms.warehouseWorking.warehouseFreeze.unfreeze'))
+
+export const formatMoveStatus = (value: number) => (value === MoveStatus.UNADJUST
+ ? i18n.global.t('wms.warehouseWorking.warehouseMove.unadjust')
+ : i18n.global.t('wms.warehouseWorking.warehouseMove.adjusted'))
+
+export const formatTakingJobStatus = (value: boolean) => (value === TAKING_JOB_FINISH
+ ? i18n.global.t('wms.warehouseWorking.warehouseTaking.finish')
+ : i18n.global.t('wms.warehouseWorking.warehouseTaking.unfinish'))
+
+export const formatAdjustJobType = (value: number) => {
+ switch (value) {
+ case AdjustJobType.TAKE:
+ return i18n.global.t('wms.warehouseWorking.warehouseAdjust.warehouseTake')
+ case AdjustJobType.PROCESS_COMBINE:
+ return i18n.global.t('wms.warehouseWorking.warehouseAdjust.processCombine')
+ case AdjustJobType.PROCESS_SPLIT:
+ return i18n.global.t('wms.warehouseWorking.warehouseAdjust.processSplit')
+ case AdjustJobType.MOVE:
+ return i18n.global.t('wms.warehouseWorking.warehouseAdjust.warehouseMove')
+ default:
+ return ''
+ }
+}
diff --git a/frontend/src/utils/http/request.ts b/frontend/src/utils/http/request.ts
index a4a4fd5..cc31279 100644
--- a/frontend/src/utils/http/request.ts
+++ b/frontend/src/utils/http/request.ts
@@ -1,207 +1,207 @@
-import axios from 'axios' // 引入axios
-import { store } from '@/store'
-import { emitter } from '@/utils/bus.js'
-import { router } from '@/router'
-import { hookComponent } from '@/components/system'
-import i18n from '@/languages/i18n'
-
-// Basis of axios
-const SERVER_URL = `${ import.meta.env.VITE_BASE_PATH }:${ import.meta.env.VITE_SERVER_PORT }`
-axios.defaults.baseURL = SERVER_URL
-const http = axios.create({
- baseURL: SERVER_URL,
- timeout: 10000
-})
-
-// The interface array request failed
-let subscribesArr: Array<any> = []
-
-// The count of current request
-let acitveAxios = 0
-
-function pushSubscribeInterface(cb: any) {
- subscribesArr.push(cb)
-}
-
-function reloadSubscribesWithNewToken(token: string) {
- subscribesArr.map((cb) => cb(token))
-}
-
-function resetSubscribes() {
- subscribesArr = []
-}
-
-/**
- * expired or will expired
- * @returns {boolean}
- */
-function isTokenExpired() {
- const expiredTime = store.getters['user/expirationTime']
- if (expiredTime) {
- // Distance and x seconds is judged to be due
- const willExpiredSecond = 10 * 60
- const nowTime = new Date().getTime()
- const willExpired = (expiredTime - nowTime) / 1000 < willExpiredSecond
-
- return willExpired
- }
- return false
-}
-
-function rediretToLogin() {
- store.commit('system/clearOpenedMenu')
- store.commit('system/setCurrentRouterPath', '')
-
- router.push('/login')
-}
-
-const showLoading = () => {
- acitveAxios++
- if (acitveAxios > 0) {
- emitter.emit('showLoading')
- }
-}
-
-const closeLoading = () => {
- acitveAxios--
- if (acitveAxios <= 0) {
- emitter.emit('closeLoading')
- }
-}
-
-const handleRefreshToken = (token: string) => {
- const refreshToken = store.getters['user/refreshToken']
- store.commit('user/setIsRefreshingToken', true)
- axios
- .post('/refresh-token', {
- accessToken: token,
- refreshToken
- })
- .then(({ data: res }) => {
- if (res.isSuccess) {
- const tokenVo = res.data
- const expiredTime = new Date().getTime() + store.getters['user/effectiveMinutes'] * 60 * 1000
-
- store.commit('user/setToken', tokenVo)
- store.commit('user/setExpirationTime', expiredTime)
-
- // With the new token request those suspended interface
- reloadSubscribesWithNewToken(tokenVo)
- } else {
- return Promise.reject()
- }
- })
- .catch(() => {
- resetSubscribes()
- rediretToLogin()
- })
- .finally(() => {
- store.commit('user/setIsRefreshingToken', false)
- })
-}
-
-http.interceptors.request.use(
- (config: any) => {
- const donNeedTokenApi = ['/login', '/user/register']
- const token = store.getters['user/token']
-
- let culture = 'en-us'
- switch (store.getters['system/language']) {
- case 'zh':
- culture = 'zh-cn'
- break
- case 'en':
- culture = 'en-us'
- break
- }
- config.params ? (config.params.culture = culture) : (config.params = { culture })
-
- if (!config.hideLoading) {
- showLoading()
- }
-
- // It don't need token to request with some apis.
- if (donNeedTokenApi.includes(config.url)) {
- return config
- }
-
- // 1.Logout when token isn't exist
- if (!token) {
- rediretToLogin()
- return config
- }
-
- // 2.Request normally when token is exist and in valid date
- if (!isTokenExpired() || config.url === '/refresh-token') {
- config.headers = {
- 'Content-Type': 'application/json',
- ...config.headers
- }
- if (config.url && !donNeedTokenApi.includes(config.url)) {
- config.headers.Authorization = `Bearer ${ token }`
- }
-
- return config
- }
-
- // 3.Take a 'refresh token' request when it not in the refreshing.
- if (!store.getters['user/isRefreshingToken']) {
- handleRefreshToken(token)
- }
-
- // 4.Put the fail requests up and initiate them after refresh token
- const retry = new Promise((resolve) => {
- pushSubscribeInterface((newToken: string) => {
- config.headers.Authorization = `Bearer ${ newToken }`
- resolve(config)
- })
- })
- return retry
- },
- (error) => {
- closeLoading()
- return error
- }
-)
-
-http.interceptors.response.use(
- (response) => {
- closeLoading()
- if (response.data.code === 0 || response.headers.success === 'true') {
- if (response.headers.msg) {
- response.data.msg = decodeURI(response.headers.msg)
- }
- return response.data
- }
- return response.data.msg ? response.data : response
- },
- (error) => {
- closeLoading()
- // 1.There isn't 'error.response' object when request timeout
- if (!error.response) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.tips.requestTimeout')
- })
- return
- }
-
- // 2.There is response status when request fail but not timeout
- switch (error.response.status) {
- case 500:
- console.error('error:', 500)
- break
- case 404:
- console.error('error:', 404)
- break
- }
-
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.tips.requestFail')
- })
- return error
- }
-)
-
-export default http
+import axios from 'axios' // 引入axios
+import { store } from '@/store'
+import { emitter } from '@/utils/bus.js'
+import { router } from '@/router'
+import { hookComponent } from '@/components/system'
+import i18n from '@/languages/i18n'
+
+// Basis of axios
+const SERVER_URL = `${ import.meta.env.VITE_BASE_PATH }:${ import.meta.env.VITE_SERVER_PORT }`
+axios.defaults.baseURL = SERVER_URL
+const http = axios.create({
+ baseURL: SERVER_URL,
+ timeout: 10000
+})
+
+// The interface array request failed
+let subscribesArr: Array<any> = []
+
+// The count of current request
+let acitveAxios = 0
+
+function pushSubscribeInterface(cb: any) {
+ subscribesArr.push(cb)
+}
+
+function reloadSubscribesWithNewToken(token: string) {
+ subscribesArr.map((cb) => cb(token))
+}
+
+function resetSubscribes() {
+ subscribesArr = []
+}
+
+/**
+ * expired or will expired
+ * @returns {boolean}
+ */
+function isTokenExpired() {
+ const expiredTime = store.getters['user/expirationTime']
+ if (expiredTime) {
+ // Distance and x seconds is judged to be due
+ const willExpiredSecond = 10 * 60
+ const nowTime = new Date().getTime()
+ const willExpired = (expiredTime - nowTime) / 1000 < willExpiredSecond
+
+ return willExpired
+ }
+ return false
+}
+
+function rediretToLogin() {
+ store.commit('system/clearOpenedMenu')
+ store.commit('system/setCurrentRouterPath', '')
+
+ router.push('/login')
+}
+
+const showLoading = () => {
+ acitveAxios++
+ if (acitveAxios > 0) {
+ emitter.emit('showLoading')
+ }
+}
+
+const closeLoading = () => {
+ acitveAxios--
+ if (acitveAxios <= 0) {
+ emitter.emit('closeLoading')
+ }
+}
+
+const handleRefreshToken = (token: string) => {
+ const refreshToken = store.getters['user/refreshToken']
+ store.commit('user/setIsRefreshingToken', true)
+ axios
+ .post('/refresh-token', {
+ accessToken: token,
+ refreshToken
+ })
+ .then(({ data: res }) => {
+ if (res.isSuccess) {
+ const tokenVo = res.data
+ const expiredTime = new Date().getTime() + store.getters['user/effectiveMinutes'] * 60 * 1000
+
+ store.commit('user/setToken', tokenVo)
+ store.commit('user/setExpirationTime', expiredTime)
+
+ // With the new token request those suspended interface
+ reloadSubscribesWithNewToken(tokenVo)
+ } else {
+ return Promise.reject()
+ }
+ })
+ .catch(() => {
+ resetSubscribes()
+ rediretToLogin()
+ })
+ .finally(() => {
+ store.commit('user/setIsRefreshingToken', false)
+ })
+}
+
+http.interceptors.request.use(
+ (config: any) => {
+ const donNeedTokenApi = ['/login', '/user/register']
+ const token = store.getters['user/token']
+
+ let culture = 'en-us'
+ switch (store.getters['system/language']) {
+ case 'zh':
+ culture = 'zh-cn'
+ break
+ case 'en':
+ culture = 'en-us'
+ break
+ }
+ config.params ? (config.params.culture = culture) : (config.params = { culture })
+
+ if (!config.hideLoading) {
+ showLoading()
+ }
+
+ // It don't need token to request with some apis.
+ if (donNeedTokenApi.includes(config.url)) {
+ return config
+ }
+
+ // 1.Logout when token isn't exist
+ if (!token) {
+ rediretToLogin()
+ return config
+ }
+
+ // 2.Request normally when token is exist and in valid date
+ if (!isTokenExpired() || config.url === '/refresh-token') {
+ config.headers = {
+ 'Content-Type': 'application/json',
+ ...config.headers
+ }
+ if (config.url && !donNeedTokenApi.includes(config.url)) {
+ config.headers.Authorization = `Bearer ${ token }`
+ }
+
+ return config
+ }
+
+ // 3.Take a 'refresh token' request when it not in the refreshing.
+ if (!store.getters['user/isRefreshingToken']) {
+ handleRefreshToken(token)
+ }
+
+ // 4.Put the fail requests up and initiate them after refresh token
+ const retry = new Promise((resolve) => {
+ pushSubscribeInterface((newToken: string) => {
+ config.headers.Authorization = `Bearer ${ newToken }`
+ resolve(config)
+ })
+ })
+ return retry
+ },
+ (error) => {
+ closeLoading()
+ return error
+ }
+)
+
+http.interceptors.response.use(
+ (response) => {
+ closeLoading()
+ if (response.data.code === 0 || response.headers.success === 'true') {
+ if (response.headers.msg) {
+ response.data.msg = decodeURI(response.headers.msg)
+ }
+ return response.data
+ }
+ return response.data.msg ? response.data : response
+ },
+ (error) => {
+ closeLoading()
+ // 1.There isn't 'error.response' object when request timeout
+ if (!error.response) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.tips.requestTimeout')
+ })
+ return
+ }
+
+ // 2.There is response status when request fail but not timeout
+ switch (error.response.status) {
+ case 500:
+ console.error('error:', 500)
+ break
+ case 404:
+ console.error('error:', 404)
+ break
+ }
+
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.tips.requestFail')
+ })
+ return error
+ }
+)
+
+export default http
diff --git a/frontend/src/utils/router/index.ts b/frontend/src/utils/router/index.ts
index cde88c6..c4af8d8 100644
--- a/frontend/src/utils/router/index.ts
+++ b/frontend/src/utils/router/index.ts
@@ -1,167 +1,167 @@
-import { MenuItem } from '@/types/System/Store'
-import { CustomerRouterProps } from '@/types/System/Router'
-import { SideBarMenu } from '@/types/Home/Home'
-import { store } from '@/store'
-import i18n from '@/languages/i18n'
-
-// Convert menu permissions to data required for dynamic routing
-export function menusToRouter(menuList: MenuItem[]): CustomerRouterProps[] {
- const result: CustomerRouterProps[] = []
- for (const menu of menuList) {
- result.push({
- name: menu.vue_path,
- module: menu.module,
- path: `/${ menu.vue_path }`,
- directory: menu.vue_directory,
- redirect: '',
- component: null
- })
- }
- return result
-}
-
-// Convert the menu permission returned from the back end to the sidebar
-export function menusToSideBar(): SideBarMenu[] {
- const result: SideBarMenu[] = [
- { icon: GetModuleAndIcon('homepage'), lable: i18n.global.t('router.sideBar.homepage'), routerPath: 'homepage', showDetail: false }
- ]
- const menuList: MenuItem[] = store.getters['user/menulist']
- for (const menu of menuList) {
- // Get the module index and check whether this group exists
- const moduleIndex = result.findIndex((item) => item.lable === i18n.global.t(`router.sideBar.${ menu.module }`))
- const lable = GetMenuNameAndModule(menu.vue_path)
- if (lable) {
- // Primary menu
- if (!menu.module) {
- result.push({
- lable,
- icon: GetModuleAndIcon(menu.vue_path),
- routerPath: menu.vue_path
- })
- continue
- }
- // Secondary menu
- if (moduleIndex > -1) {
- result[moduleIndex].children?.push({
- lable,
- icon: GetModuleAndIcon(menu.vue_path),
- routerPath: menu.vue_path
- })
- } else {
- result.push({
- lable: i18n.global.t(`router.sideBar.${ menu.module }`),
- icon: GetModuleAndIcon(menu.module),
- showDetail: false,
- children: [
- {
- lable,
- icon: GetModuleAndIcon(menu.vue_path),
- routerPath: menu.vue_path
- }
- ]
- })
- }
- }
- }
- return result
-}
-
-// Get the menu name, module and icon
-function GetMenuNameAndModule(path: string): string {
- switch (path) {
- case 'homepage':
- return i18n.global.t('router.sideBar.homepage')
- case 'ownerOfCargo':
- return i18n.global.t('router.sideBar.ownerOfCargo')
- case 'menuBasicSettings':
- return i18n.global.t('router.sideBar.menuBasicSettings')
- case 'userManagement':
- return i18n.global.t('router.sideBar.userManagement')
- case 'commodityCategorySetting':
- return i18n.global.t('router.sideBar.commodityCategorySetting')
- case 'commodityManagement':
- return i18n.global.t('router.sideBar.commodityManagement')
- case 'userRoleSetting':
- return i18n.global.t('router.sideBar.userRoleSetting')
- case 'companySetting':
- return i18n.global.t('router.sideBar.companySetting')
- case 'freightSetting':
- return i18n.global.t('router.sideBar.freightSetting')
- case 'warehouseSetting':
- return i18n.global.t('router.sideBar.warehouseSetting')
- case 'customer':
- return i18n.global.t('router.sideBar.customer')
- case 'supplier':
- return i18n.global.t('router.sideBar.supplier')
- case 'roleMenu':
- return i18n.global.t('router.sideBar.roleMenu')
- case 'stockManagement':
- return i18n.global.t('router.sideBar.stockManagement')
- case 'warehouseProcessing':
- return i18n.global.t('router.sideBar.warehouseProcessing')
- case 'warehouseMove':
- return i18n.global.t('router.sideBar.warehouseMove')
- case 'warehouseFreeze':
- return i18n.global.t('router.sideBar.warehouseFreeze')
- case 'warehouseAdjust':
- return i18n.global.t('router.sideBar.warehouseAdjust')
- case 'warehouseTaking':
- return i18n.global.t('router.sideBar.warehouseTaking')
- case 'deliveryManagement':
- return i18n.global.t('router.sideBar.deliveryManagement')
- case 'stockAsn':
- return i18n.global.t('router.sideBar.stockAsn')
- default:
- return ''
- }
-}
-function GetModuleAndIcon(name: string) {
- switch (name) {
- case 'baseModule':
- return 'cog'
- case 'homepage':
- return 'home'
- case 'stockManagement':
- return 'warehouse'
- case 'stockAsn':
- return 'home-silo'
- case 'warehouseWorkingModule':
- return 'account-hard-hat-outline '
- case 'deliveryManagement':
- return 'cube-send'
- case 'companySetting':
- return 'office-building'
- case 'roleMenu':
- return 'menu'
- case 'userRoleSetting':
- return 'account-box'
- case 'userManagement':
- return 'account'
- case 'commodityCategorySetting':
- return 'format-list-bulleted-type'
- case 'commodityManagement':
- return 'cart-minus'
- case 'ownerOfCargo':
- return 'account-credit-card'
- case 'freightSetting':
- return 'cash-multiple'
- case 'warehouseSetting':
- return 'warehouse'
- case 'warehouseProcessing':
- return 'vector-combine'
- case 'warehouseMove':
- return 'file-document-arrow-right-outline'
- case 'warehouseFreeze':
- return 'lock-outline'
- case 'warehouseAdjust':
- return 'image-auto-adjust'
- case 'warehouseTaking':
- return 'ballot-recount-outline'
- case 'customer':
- return 'account-box-outline'
- case 'supplier':
- return 'account-badge'
- default:
- return ''
- }
-}
+import { MenuItem } from '@/types/System/Store'
+import { CustomerRouterProps } from '@/types/System/Router'
+import { SideBarMenu } from '@/types/Home/Home'
+import { store } from '@/store'
+import i18n from '@/languages/i18n'
+
+// Convert menu permissions to data required for dynamic routing
+export function menusToRouter(menuList: MenuItem[]): CustomerRouterProps[] {
+ const result: CustomerRouterProps[] = []
+ for (const menu of menuList) {
+ result.push({
+ name: menu.vue_path,
+ module: menu.module,
+ path: `/${ menu.vue_path }`,
+ directory: menu.vue_directory,
+ redirect: '',
+ component: null
+ })
+ }
+ return result
+}
+
+// Convert the menu permission returned from the back end to the sidebar
+export function menusToSideBar(): SideBarMenu[] {
+ const result: SideBarMenu[] = [
+ { icon: GetModuleAndIcon('homepage'), lable: i18n.global.t('router.sideBar.homepage'), routerPath: 'homepage', showDetail: false }
+ ]
+ const menuList: MenuItem[] = store.getters['user/menulist']
+ for (const menu of menuList) {
+ // Get the module index and check whether this group exists
+ const moduleIndex = result.findIndex((item) => item.lable === i18n.global.t(`router.sideBar.${ menu.module }`))
+ const lable = GetMenuNameAndModule(menu.vue_path)
+ if (lable) {
+ // Primary menu
+ if (!menu.module) {
+ result.push({
+ lable,
+ icon: GetModuleAndIcon(menu.vue_path),
+ routerPath: menu.vue_path
+ })
+ continue
+ }
+ // Secondary menu
+ if (moduleIndex > -1) {
+ result[moduleIndex].children?.push({
+ lable,
+ icon: GetModuleAndIcon(menu.vue_path),
+ routerPath: menu.vue_path
+ })
+ } else {
+ result.push({
+ lable: i18n.global.t(`router.sideBar.${ menu.module }`),
+ icon: GetModuleAndIcon(menu.module),
+ showDetail: false,
+ children: [
+ {
+ lable,
+ icon: GetModuleAndIcon(menu.vue_path),
+ routerPath: menu.vue_path
+ }
+ ]
+ })
+ }
+ }
+ }
+ return result
+}
+
+// Get the menu name, module and icon
+function GetMenuNameAndModule(path: string): string {
+ switch (path) {
+ case 'homepage':
+ return i18n.global.t('router.sideBar.homepage')
+ case 'ownerOfCargo':
+ return i18n.global.t('router.sideBar.ownerOfCargo')
+ case 'menuBasicSettings':
+ return i18n.global.t('router.sideBar.menuBasicSettings')
+ case 'userManagement':
+ return i18n.global.t('router.sideBar.userManagement')
+ case 'commodityCategorySetting':
+ return i18n.global.t('router.sideBar.commodityCategorySetting')
+ case 'commodityManagement':
+ return i18n.global.t('router.sideBar.commodityManagement')
+ case 'userRoleSetting':
+ return i18n.global.t('router.sideBar.userRoleSetting')
+ case 'companySetting':
+ return i18n.global.t('router.sideBar.companySetting')
+ case 'freightSetting':
+ return i18n.global.t('router.sideBar.freightSetting')
+ case 'warehouseSetting':
+ return i18n.global.t('router.sideBar.warehouseSetting')
+ case 'customer':
+ return i18n.global.t('router.sideBar.customer')
+ case 'supplier':
+ return i18n.global.t('router.sideBar.supplier')
+ case 'roleMenu':
+ return i18n.global.t('router.sideBar.roleMenu')
+ case 'stockManagement':
+ return i18n.global.t('router.sideBar.stockManagement')
+ case 'warehouseProcessing':
+ return i18n.global.t('router.sideBar.warehouseProcessing')
+ case 'warehouseMove':
+ return i18n.global.t('router.sideBar.warehouseMove')
+ case 'warehouseFreeze':
+ return i18n.global.t('router.sideBar.warehouseFreeze')
+ case 'warehouseAdjust':
+ return i18n.global.t('router.sideBar.warehouseAdjust')
+ case 'warehouseTaking':
+ return i18n.global.t('router.sideBar.warehouseTaking')
+ case 'deliveryManagement':
+ return i18n.global.t('router.sideBar.deliveryManagement')
+ case 'stockAsn':
+ return i18n.global.t('router.sideBar.stockAsn')
+ default:
+ return ''
+ }
+}
+function GetModuleAndIcon(name: string) {
+ switch (name) {
+ case 'baseModule':
+ return 'cog'
+ case 'homepage':
+ return 'home'
+ case 'stockManagement':
+ return 'warehouse'
+ case 'stockAsn':
+ return 'home-silo'
+ case 'warehouseWorkingModule':
+ return 'account-hard-hat-outline '
+ case 'deliveryManagement':
+ return 'cube-send'
+ case 'companySetting':
+ return 'office-building'
+ case 'roleMenu':
+ return 'menu'
+ case 'userRoleSetting':
+ return 'account-box'
+ case 'userManagement':
+ return 'account'
+ case 'commodityCategorySetting':
+ return 'format-list-bulleted-type'
+ case 'commodityManagement':
+ return 'cart-minus'
+ case 'ownerOfCargo':
+ return 'account-credit-card'
+ case 'freightSetting':
+ return 'cash-multiple'
+ case 'warehouseSetting':
+ return 'warehouse'
+ case 'warehouseProcessing':
+ return 'vector-combine'
+ case 'warehouseMove':
+ return 'file-document-arrow-right-outline'
+ case 'warehouseFreeze':
+ return 'lock-outline'
+ case 'warehouseAdjust':
+ return 'image-auto-adjust'
+ case 'warehouseTaking':
+ return 'ballot-recount-outline'
+ case 'customer':
+ return 'account-box-outline'
+ case 'supplier':
+ return 'account-badge'
+ default:
+ return ''
+ }
+}
diff --git a/frontend/src/view/base/commodityCategorySetting/add-or-update-category.vue b/frontend/src/view/base/commodityCategorySetting/add-or-update-category.vue
index 254f0f1..a5854fe 100644
--- a/frontend/src/view/base/commodityCategorySetting/add-or-update-category.vue
+++ b/frontend/src/view/base/commodityCategorySetting/add-or-update-category.vue
@@ -1,143 +1,143 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('router.sideBar.commodityCategorySetting')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.category_name"
- :label="$t('base.commodityCategorySetting.category_name')"
- :rules="data.rules.category_name"
- variant="outlined"
- ></v-text-field>
- <v-select
- v-model="data.form.parent_id"
- :items="data.combobox.parent"
- item-title="label"
- item-value="value"
- :rules="data.rules.parent_id"
- :label="$t('base.commodityCategorySetting.parent_name')"
- variant="outlined"
- clearable
- ></v-select>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { CategoryVO } from '@/types/Base/CommodityCategorySetting'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addCategory, updateCategory, getCategoryAll } from '@/api/base/commodityCategorySetting'
-import { StringLength } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: CategoryVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<CategoryVO>({
- id: 0,
- category_name: ''
- }),
- rules: {
- category_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityCategorySetting.category_name') }!`,
- (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
- ],
- parent_id: [],
- is_valid: []
- },
- combobox: ref<{
- parent: {
- label: string
- value: number
- }[]
- }>({
- parent: []
- })
-})
-
-const method = reactive({
- // Get the options required by the drop-down box
- getCombobox: async () => {
- data.combobox.parent = []
- const { data: res } = await getCategoryAll()
- if (!res.isSuccess) {
- return
- }
- for (const item of res.data) {
- data.combobox.parent.push({
- label: item.category_name,
- value: item.id
- })
- }
- },
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = dialogTitle.value === 'add' ? await addCategory(data.form) : await updateCategory(data.form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.getCombobox()
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('router.sideBar.commodityCategorySetting')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.category_name"
+ :label="$t('base.commodityCategorySetting.category_name')"
+ :rules="data.rules.category_name"
+ variant="outlined"
+ ></v-text-field>
+ <v-select
+ v-model="data.form.parent_id"
+ :items="data.combobox.parent"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.parent_id"
+ :label="$t('base.commodityCategorySetting.parent_name')"
+ variant="outlined"
+ clearable
+ ></v-select>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { CategoryVO } from '@/types/Base/CommodityCategorySetting'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addCategory, updateCategory, getCategoryAll } from '@/api/base/commodityCategorySetting'
+import { StringLength } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: CategoryVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<CategoryVO>({
+ id: 0,
+ category_name: ''
+ }),
+ rules: {
+ category_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityCategorySetting.category_name') }!`,
+ (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
+ ],
+ parent_id: [],
+ is_valid: []
+ },
+ combobox: ref<{
+ parent: {
+ label: string
+ value: number
+ }[]
+ }>({
+ parent: []
+ })
+})
+
+const method = reactive({
+ // Get the options required by the drop-down box
+ getCombobox: async () => {
+ data.combobox.parent = []
+ const { data: res } = await getCategoryAll()
+ if (!res.isSuccess) {
+ return
+ }
+ for (const item of res.data) {
+ data.combobox.parent.push({
+ label: item.category_name,
+ value: item.id
+ })
+ }
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = dialogTitle.value === 'add' ? await addCategory(data.form) : await updateCategory(data.form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.getCombobox()
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/commodityCategorySetting/commodityCategorySetting.vue b/frontend/src/view/base/commodityCategorySetting/commodityCategorySetting.vue
index 78dfdc1..fc63fbb 100644
--- a/frontend/src/view/base/commodityCategorySetting/commodityCategorySetting.vue
+++ b/frontend/src/view/base/commodityCategorySetting/commodityCategorySetting.vue
@@ -1,241 +1,241 @@
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="12" sm="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="12" sm="9">
- <!-- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.userName"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.userName1"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.userName2"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row> -->
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" :tree-config="data.tableTreeConfig" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="80"></vxe-column>
- <vxe-column field="category_name" align="left" :title="$t('base.commodityCategorySetting.category_name')" tree-node></vxe-column>
- <vxe-column field="creator" :title="$t('base.commodityCategorySetting.creator')"></vxe-column>
- <vxe-column field="create_time" :title="$t('base.commodityCategorySetting.create_time')"></vxe-column>
- <vxe-column :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-pencil-outline"
- :tooltip-text="$t('system.page.edit')"
- @click="method.editRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- </div>
- </v-card-text>
- </v-card>
- </div>
- <!-- Add or modify data mode window -->
- <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, reactive, onMounted, ref } from 'vue'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { DataProps, CategoryVO } from '@/types/Base/CommodityCategorySetting'
-import { getCategoryAll, deleteCategory } from '@/api/base/commodityCategorySetting'
-import { hookComponent } from '@/components/system'
-import addOrUpdateDialog from './add-or-update-category.vue'
-import i18n from '@/languages/i18n'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-const data: DataProps = reactive({
- // searchForm: {
- // userName: '',
- // userName1: '',
- // userName2: ''
- // },
- tableData: [],
- tableTreeConfig: {
- transform: true,
- rowField: 'id',
- parentField: 'parent_id'
- },
- // Dialog info
- showDialog: false,
- dialogForm: {
- id: 0,
- category_name: ''
- }
-})
-
-const method = reactive({
- sureSearch: () => {
- // console.log(data.searchForm)
- },
- // Find Data by Pagination
- getCommodityCategorySetting: async () => {
- const { data: res } = await getCategoryAll()
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data
- // nextTick(() => {
- // xTable.value.setAllTreeExpand(true)
- // })
- },
- // Add user
- add: () => {
- data.dialogForm = {
- id: 0,
- category_name: ''
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // after Add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Refresh data
- refresh: () => {
- method.getCommodityCategorySetting()
- },
- editRow(row: CategoryVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- // If there is no parent, the parent will not be brought in_ id
- if (data.dialogForm.parent_id === 0) {
- delete data.dialogForm.parent_id
- }
- data.showDialog = true
- },
- deleteRow(row: CategoryVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteCategory(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // Export table
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.commodityCategorySetting'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type)
- }
- })
- }
-})
-
-onMounted(async () => {
- await method.getCommodityCategorySetting()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-
-const tableHeight = computed(() => computedTableHeight({ hasTab: false, hasPager: false }))
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="12" sm="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="12" sm="9">
+ <!-- <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.userName"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.userName1"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.userName2"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row> -->
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" :tree-config="data.tableTreeConfig" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="80"></vxe-column>
+ <vxe-column field="category_name" align="left" :title="$t('base.commodityCategorySetting.category_name')" tree-node></vxe-column>
+ <vxe-column field="creator" :title="$t('base.commodityCategorySetting.creator')"></vxe-column>
+ <vxe-column field="create_time" :title="$t('base.commodityCategorySetting.create_time')"></vxe-column>
+ <vxe-column :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-pencil-outline"
+ :tooltip-text="$t('system.page.edit')"
+ @click="method.editRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ </div>
+ </v-card-text>
+ </v-card>
+ </div>
+ <!-- Add or modify data mode window -->
+ <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, reactive, onMounted, ref } from 'vue'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { DataProps, CategoryVO } from '@/types/Base/CommodityCategorySetting'
+import { getCategoryAll, deleteCategory } from '@/api/base/commodityCategorySetting'
+import { hookComponent } from '@/components/system'
+import addOrUpdateDialog from './add-or-update-category.vue'
+import i18n from '@/languages/i18n'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+const data: DataProps = reactive({
+ // searchForm: {
+ // userName: '',
+ // userName1: '',
+ // userName2: ''
+ // },
+ tableData: [],
+ tableTreeConfig: {
+ transform: true,
+ rowField: 'id',
+ parentField: 'parent_id'
+ },
+ // Dialog info
+ showDialog: false,
+ dialogForm: {
+ id: 0,
+ category_name: ''
+ }
+})
+
+const method = reactive({
+ sureSearch: () => {
+ // console.log(data.searchForm)
+ },
+ // Find Data by Pagination
+ getCommodityCategorySetting: async () => {
+ const { data: res } = await getCategoryAll()
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data
+ // nextTick(() => {
+ // xTable.value.setAllTreeExpand(true)
+ // })
+ },
+ // Add user
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ category_name: ''
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // after Add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getCommodityCategorySetting()
+ },
+ editRow(row: CategoryVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ // If there is no parent, the parent will not be brought in_ id
+ if (data.dialogForm.parent_id === 0) {
+ delete data.dialogForm.parent_id
+ }
+ data.showDialog = true
+ },
+ deleteRow(row: CategoryVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteCategory(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Export table
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.commodityCategorySetting'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type)
+ }
+ })
+ }
+})
+
+onMounted(async () => {
+ await method.getCommodityCategorySetting()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+
+const tableHeight = computed(() => computedTableHeight({ hasTab: false, hasPager: false }))
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/base/commodityManagement/add-or-update-commodity.vue b/frontend/src/view/base/commodityManagement/add-or-update-commodity.vue
index 14d25d9..643f5f5 100644
--- a/frontend/src/view/base/commodityManagement/add-or-update-commodity.vue
+++ b/frontend/src/view/base/commodityManagement/add-or-update-commodity.vue
@@ -1,631 +1,631 @@
-<template>
- <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('router.sideBar.commodityManagement')}`"></v-toolbar>
- <v-card-text>
- <v-row>
- <v-col cols="3">
- <div class="mainForm" :style="{ height: mainFormHeight }">
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.spu_code"
- :rules="data.rules.spu_code"
- :label="$t('base.commodityManagement.spu_code')"
- variant="outlined"
- density="compact"
- clearable
- class="mb-4"
- ></v-text-field>
- <v-text-field
- v-model="data.form.spu_name"
- :rules="data.rules.spu_name"
- :label="$t('base.commodityManagement.spu_name')"
- variant="outlined"
- density="compact"
- clearable
- class="mb-4"
- ></v-text-field>
- <v-select
- v-model="data.form.category_name"
- :items="data.combobox.category_name"
- item-title="label"
- item-value="label"
- :rules="data.rules.category_name"
- :label="$t('base.commodityManagement.category_name')"
- variant="outlined"
- density="compact"
- class="mb-4"
- clearable
- @update:model-value="method.categoryNameChange"
- ></v-select>
- <v-text-field
- v-model="data.form.spu_description"
- :rules="data.rules.spu_description"
- :label="$t('base.commodityManagement.spu_description')"
- variant="outlined"
- density="compact"
- clearable
- class="mb-4"
- ></v-text-field>
- <v-text-field
- v-model="data.form.bar_code"
- :rules="data.rules.bar_code"
- :label="$t('base.commodityManagement.bar_code')"
- variant="outlined"
- density="compact"
- clearable
- class="mb-4"
- ></v-text-field>
- <v-select
- v-model="data.form.supplier_name"
- :items="data.combobox.supplier_name"
- :rules="data.rules.supplier_name"
- item-title="label"
- item-value="label"
- :label="$t('base.commodityManagement.supplier_name')"
- variant="outlined"
- density="compact"
- class="mb-4"
- clearable
- @update:model-value="method.supplierNameChange"
- ></v-select>
- <v-text-field
- v-model="data.form.brand"
- :rules="data.rules.brand"
- :label="$t('base.commodityManagement.brand')"
- variant="outlined"
- density="compact"
- clearable
- class="mb-4"
- ></v-text-field>
- <v-select
- v-model="data.form.length_unit"
- :items="data.combobox.length_unit"
- item-title="label"
- item-value="value"
- :rules="data.rules.length_unit"
- :label="$t('base.commodityManagement.length_unit')"
- variant="outlined"
- density="compact"
- class="mb-4"
- clearable
- ></v-select>
- <v-select
- v-model="data.form.volume_unit"
- :items="data.combobox.volume_unit"
- item-title="label"
- item-value="value"
- :rules="data.rules.volume_unit"
- :label="$t('base.commodityManagement.volume_unit')"
- variant="outlined"
- density="compact"
- class="mb-4"
- clearable
- ></v-select>
- <v-select
- v-model="data.form.weight_unit"
- :items="data.combobox.weight_unit"
- item-title="label"
- item-value="value"
- :rules="data.rules.weight_unit"
- :label="$t('base.commodityManagement.weight_unit')"
- variant="outlined"
- density="compact"
- class="mb-4"
- clearable
- ></v-select>
- </v-form>
- </div>
- </v-col>
- <v-col cols="9">
- <div class="dataTable">
- <div class="toolbar">
- <tooltip-btn
- icon="mdi-plus"
- :tooltip-text="$t('system.page.insertOneRow')"
- size="x-small"
- @click="method.insertOneRow"
- ></tooltip-btn>
- <tooltip-btn
- icon="mdi-export-variant"
- :tooltip-text="$t('system.page.export')"
- size="x-small"
- @click="method.exportTable"
- ></tooltip-btn>
- </div>
- <vxe-table
- ref="xTable"
- keep-source
- :column-config="{ minWidth: '100px' }"
- :data="data.form.detailList"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- align="center"
- :edit-rules="data.validRules"
- :edit-config="{ trigger: 'click', mode: 'cell' }"
- :mouse-config="{ selected: true }"
- :keyboard-config="{ isArrow: true, isDel: true, isEnter: true, isTab: true, isEdit: true, isChecked: true }"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="sku_code" :title="$t('base.commodityManagement.sku_code')" :edit-render="{ autofocus: '.vxe-input--inner' }">
- <template #edit="{ row }">
- <vxe-input v-model="row.sku_code" type="text"></vxe-input>
- </template>
- </vxe-column>
- <vxe-column field="sku_name" :title="$t('base.commodityManagement.sku_name')" :edit-render="{ autofocus: '.vxe-input--inner' }">
- <template #edit="{ row }">
- <vxe-input v-model="row.sku_name" type="text"></vxe-input>
- </template>
- </vxe-column>
- <!-- <vxe-column field="supplier_name" :title="$t('base.commodityManagement.supplier_name')"></vxe-column> -->
- <!-- <vxe-column field="brand" :title="$t('base.commodityManagement.brand')"></vxe-column> -->
- <vxe-column field="unit" :title="$t('base.commodityManagement.unit')" :edit-render="{ autofocus: '.vxe-input--inner' }">
- <template #edit="{ row }">
- <vxe-input v-model="row.unit" type="text"></vxe-input>
- </template>
- </vxe-column>
- <vxe-column field="weight" :title="$t('base.commodityManagement.weight')" :edit-render="{ autofocus: '.vxe-input--inner' }">
- <template #edit="{ row }">
- <vxe-input v-model="row.weight" type="text"></vxe-input>
- </template>
- </vxe-column>
- <vxe-column field="lenght" :title="$t('base.commodityManagement.lenght')" :edit-render="{ autofocus: '.vxe-input--inner' }">
- <template #edit="{ row }">
- <vxe-input v-model="row.lenght" type="text"></vxe-input>
- </template>
- </vxe-column>
- <vxe-column field="width" :title="$t('base.commodityManagement.width')" :edit-render="{ autofocus: '.vxe-input--inner' }">
- <template #edit="{ row }">
- <vxe-input v-model="row.width" type="text"></vxe-input>
- </template>
- </vxe-column>
- <vxe-column field="height" :title="$t('base.commodityManagement.height')" :edit-render="{ autofocus: '.vxe-input--inner' }">
- <template #edit="{ row }">
- <vxe-input v-model="row.height" type="text"></vxe-input>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('base.commodityManagement.volume')"> </vxe-column>
- <vxe-column field="cost" :title="$t('base.commodityManagement.cost')" :edit-render="{ autofocus: '.vxe-input--inner' }">
- <template #edit="{ row }">
- <vxe-input v-model="row.cost" type="text"></vxe-input>
- </template>
- </vxe-column>
- <vxe-column field="price" :title="$t('base.commodityManagement.price')" :edit-render="{ autofocus: '.vxe-input--inner' }">
- <template #edit="{ row }">
- <vxe-input v-model="row.price" type="text"></vxe-input>
- </template>
- </vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="100" :resizable="false" show-overflow>
- <template #default="{ row }">
- <!-- <tooltip-btn
- :flat="true"
- icon="mdi-pencil-outline"
- :tooltip-text="$t('system.page.edit')"
- @click="method.editRow(row)"
- ></tooltip-btn> -->
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- </div>
- </v-col>
- </v-row>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { CommodityVO, CommodityDetailVO } from '@/types/Base/CommodityManagement'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addSpu, updateSpu } from '@/api/base/commodityManagementSetting'
-import { getCategoryAll } from '@/api/base/commodityCategorySetting'
-import { getSupplierAll } from '@/api/base/supplier'
-import { CategoryVO } from '@/types/Base/CommodityCategorySetting'
-import { SupplierVO } from '@/types/Base/Supplier'
-import { computedSelectTableSearchHeight, SYSTEM_HEIGHT, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { removeArrayNull } from '@/utils/common'
-import { StringLength } from '@/utils/dataVerification/formRule'
-import { isDecimal } from '@/utils/dataVerification/tableRule'
-import { exportData } from '@/utils/exportTable'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-const xTable = ref()
-
-const props = defineProps<{
- showDialog: boolean
- form: CommodityVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<CommodityVO>({
- id: 0,
- spu_code: '',
- spu_name: '',
- category_id: 0,
- category_name: '',
- spu_description: '',
- bar_code: '',
- supplier_id: 0,
- supplier_name: '',
- brand: '',
- origin: '',
- length_unit: 1,
- volume_unit: 0,
- weight_unit: 1,
- detailList: []
- }),
- tableData: [],
- rules: {
- spu_code: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_code') }!`,
- (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
- ],
- spu_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_name') }!`,
- (val: string) => StringLength(val, 0, 200) === '' || StringLength(val, 0, 200)
- ],
- spu_description: [(val: string) => StringLength(val, 0, 1000) === '' || StringLength(val, 0, 1000)],
- bar_code: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)],
- brand: [(val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)],
- category_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.category_name') }!`
- ],
- length_unit: [
- (val: number) => [0, 1, 2, 3].includes(val) || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.length_unit') }!`
- ],
- volume_unit: [
- (val: number) => [0, 1, 2].includes(val) || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.volume_unit') }!`
- ],
- weight_unit: [
- (val: number) => [0, 1, 2].includes(val) || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.weight_unit') }!`
- ],
- supplier_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.supplier_name') }!`
- ]
- },
- validRules: ref<any>({
- sku_code: [
- { required: true, message: `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_code') }` },
- {
- type: 'string',
- min: 0,
- max: 32,
- message: `${ i18n.global.t('system.checkText.lengthValid') }${ 0 }-${ 32 }`,
- trigger: 'change'
- }
- ],
- sku_name: [
- { required: true, message: `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_name') }` },
- {
- type: 'string',
- min: 0,
- max: 200,
- message: `${ i18n.global.t('system.checkText.lengthValid') }${ 0 }-${ 200 }`,
- trigger: 'change'
- }
- ],
- unit: [
- { required: true, message: `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.unit') }` },
- {
- type: 'string',
- min: 0,
- max: 5,
- message: `${ i18n.global.t('system.checkText.lengthValid') }${ 0 }-${ 5 }`,
- trigger: 'change'
- }
- ],
- weight: [
- {
- validator: isDecimal,
- validNumerical: 'nonNegative',
- length: 8,
- decimalLength: 3,
- trigger: 'change'
- }
- ],
- lenght: [
- {
- validator: isDecimal,
- validNumerical: 'nonNegative',
- length: 8,
- decimalLength: 3,
- trigger: 'change'
- }
- ],
- width: [
- {
- validator: isDecimal,
- validNumerical: 'nonNegative',
- length: 8,
- decimalLength: 3,
- trigger: 'change'
- }
- ],
- height: [
- {
- validator: isDecimal,
- validNumerical: 'nonNegative',
- length: 8,
- decimalLength: 3,
- trigger: 'change'
- }
- ],
- volume: [
- // {
- // validator: isDecimal,
- // validNumerical: 'nonNegative',
- // length: 8,
- // decimalLength: 3,
- // trigger: 'change'
- // }
- ],
- cost: [
- {
- validator: isDecimal,
- validNumerical: 'nonNegative',
- length: 10,
- decimalLength: 2,
- trigger: 'change'
- }
- ],
- price: [
- {
- validator: isDecimal,
- validNumerical: 'nonNegative',
- length: 10,
- decimalLength: 2,
- trigger: 'change'
- }
- ]
- }),
- combobox: ref<{
- length_unit: {
- label: string
- value: number
- }[]
- volume_unit: {
- label: string
- value: number
- }[]
- weight_unit: {
- label: string
- value: number
- }[]
- category_name: {
- label: string
- value: number
- }[]
- supplier_name: {
- label: string
- value: number
- }[]
- }>({
- length_unit: [
- {
- label: 'mm',
- value: 0
- },
- {
- label: 'cm',
- value: 1
- },
- {
- label: 'dm',
- value: 2
- },
- {
- label: 'm',
- value: 3
- }
- ],
- volume_unit: [
- {
- label: 'cm³',
- value: 0
- },
- {
- label: 'dm³',
- value: 1
- },
- {
- label: 'm³',
- value: 2
- }
- ],
- weight_unit: [
- {
- label: 'mg',
- value: 0
- },
- {
- label: 'g',
- value: 1
- },
- {
- label: 'kg',
- value: 2
- }
- ],
- category_name: [],
- supplier_name: []
- })
-})
-
-const method = reactive({
- // When the commodity type changes, it is mainly used to assign the ID
- categoryNameChange: (val: string) => {
- if (!val) {
- data.form.category_id = 0
- } else {
- data.form.category_id = data.combobox.category_name.filter((item) => item.label === val)[0].value
- }
- },
- supplierNameChange: (val: string) => {
- if (!val) {
- data.form.supplier_id = 0
- } else {
- data.form.supplier_id = data.combobox.supplier_name.filter((item) => item.label === val)[0].value
- }
- },
- // Get the options required by the drop-down box
- getCombobox: async () => {
- data.combobox.category_name = []
- data.combobox.supplier_name = []
- const { data: res } = await getCategoryAll()
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.combobox.category_name = res.data
- .filter((item: CategoryVO) => item.is_valid)
- .map((item: CategoryVO) => ({ value: item.id, label: item.category_name }))
- // Get supplier information
- const { data: supplierRes } = await getSupplierAll()
- if (!supplierRes.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: supplierRes.errorMessage
- })
- return
- }
- data.combobox.supplier_name = supplierRes.data
- .filter((item: SupplierVO) => item.is_valid)
- .map((item: SupplierVO) => ({ value: item.id, label: item.supplier_name }))
- },
- closeDialog: () => {
- emit('close')
- },
- insertOneRow: () => {
- xTable.value.insertAt(-1)
- },
- // Export table
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.commodityManagement'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- submit: async () => {
- const $table = xTable.value
- const errMap = await $table.validate(true)
- const { valid } = await formRef.value.validate()
- if (valid && !errMap) {
- if ($table.getTableData().fullData.length === 0) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.tips.detailLengthIsZero')
- })
- return
- }
- const form = { ...data.form }
- const insertRecords = $table.getInsertRecords()
- form.detailList = []
- // Processing detailed data
- if (dialogTitle.value === 'add') {
- form.detailList = [...insertRecords]
- } else {
- const updateRecords = $table.getUpdateRecords()
- const removeRecords = $table.getRemoveRecords()
- form.detailList = [...insertRecords, ...updateRecords]
- for (const item of removeRecords) {
- item.id = item.id > 0 ? 0 - item.id : item.id
- form.detailList.push(item)
- }
- }
- form.detailList = removeArrayNull(form.detailList)
- const { data: res } = dialogTitle.value === 'add' ? await addSpu(form) : await updateSpu(form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- },
- editRow: (row: CommodityDetailVO) => {
- const $table = xTable.value
- $table.setEditRow(row)
- },
- deleteRow: (row: CommodityDetailVO) => {
- const $table = xTable.value
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
- handleConfirm: async () => {
- $table.remove(row)
- }
- })
- }
-})
-
-const mainFormHeight = computed(() => computedSelectTableSearchHeight({ hasPager: false, hasToolBar: true }))
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.getCombobox()
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.mainForm {
- background-color: #f9f9f9;
- border-radius: 5px;
- padding: 20px;
- box-sizing: border-box;
- overflow: auto;
-}
-
-.toolbar {
- height: 40px;
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('router.sideBar.commodityManagement')}`"></v-toolbar>
+ <v-card-text>
+ <v-row>
+ <v-col cols="3">
+ <div class="mainForm" :style="{ height: mainFormHeight }">
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.spu_code"
+ :rules="data.rules.spu_code"
+ :label="$t('base.commodityManagement.spu_code')"
+ variant="outlined"
+ density="compact"
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.spu_name"
+ :rules="data.rules.spu_name"
+ :label="$t('base.commodityManagement.spu_name')"
+ variant="outlined"
+ density="compact"
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ <v-select
+ v-model="data.form.category_name"
+ :items="data.combobox.category_name"
+ item-title="label"
+ item-value="label"
+ :rules="data.rules.category_name"
+ :label="$t('base.commodityManagement.category_name')"
+ variant="outlined"
+ density="compact"
+ class="mb-4"
+ clearable
+ @update:model-value="method.categoryNameChange"
+ ></v-select>
+ <v-text-field
+ v-model="data.form.spu_description"
+ :rules="data.rules.spu_description"
+ :label="$t('base.commodityManagement.spu_description')"
+ variant="outlined"
+ density="compact"
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.bar_code"
+ :rules="data.rules.bar_code"
+ :label="$t('base.commodityManagement.bar_code')"
+ variant="outlined"
+ density="compact"
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ <v-select
+ v-model="data.form.supplier_name"
+ :items="data.combobox.supplier_name"
+ :rules="data.rules.supplier_name"
+ item-title="label"
+ item-value="label"
+ :label="$t('base.commodityManagement.supplier_name')"
+ variant="outlined"
+ density="compact"
+ class="mb-4"
+ clearable
+ @update:model-value="method.supplierNameChange"
+ ></v-select>
+ <v-text-field
+ v-model="data.form.brand"
+ :rules="data.rules.brand"
+ :label="$t('base.commodityManagement.brand')"
+ variant="outlined"
+ density="compact"
+ clearable
+ class="mb-4"
+ ></v-text-field>
+ <v-select
+ v-model="data.form.length_unit"
+ :items="data.combobox.length_unit"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.length_unit"
+ :label="$t('base.commodityManagement.length_unit')"
+ variant="outlined"
+ density="compact"
+ class="mb-4"
+ clearable
+ ></v-select>
+ <v-select
+ v-model="data.form.volume_unit"
+ :items="data.combobox.volume_unit"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.volume_unit"
+ :label="$t('base.commodityManagement.volume_unit')"
+ variant="outlined"
+ density="compact"
+ class="mb-4"
+ clearable
+ ></v-select>
+ <v-select
+ v-model="data.form.weight_unit"
+ :items="data.combobox.weight_unit"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.weight_unit"
+ :label="$t('base.commodityManagement.weight_unit')"
+ variant="outlined"
+ density="compact"
+ class="mb-4"
+ clearable
+ ></v-select>
+ </v-form>
+ </div>
+ </v-col>
+ <v-col cols="9">
+ <div class="dataTable">
+ <div class="toolbar">
+ <tooltip-btn
+ icon="mdi-plus"
+ :tooltip-text="$t('system.page.insertOneRow')"
+ size="x-small"
+ @click="method.insertOneRow"
+ ></tooltip-btn>
+ <tooltip-btn
+ icon="mdi-export-variant"
+ :tooltip-text="$t('system.page.export')"
+ size="x-small"
+ @click="method.exportTable"
+ ></tooltip-btn>
+ </div>
+ <vxe-table
+ ref="xTable"
+ keep-source
+ :column-config="{ minWidth: '100px' }"
+ :data="data.form.detailList"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ align="center"
+ :edit-rules="data.validRules"
+ :edit-config="{ trigger: 'click', mode: 'cell' }"
+ :mouse-config="{ selected: true }"
+ :keyboard-config="{ isArrow: true, isDel: true, isEnter: true, isTab: true, isEdit: true, isChecked: true }"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('base.commodityManagement.sku_code')" :edit-render="{ autofocus: '.vxe-input--inner' }">
+ <template #edit="{ row }">
+ <vxe-input v-model="row.sku_code" type="text"></vxe-input>
+ </template>
+ </vxe-column>
+ <vxe-column field="sku_name" :title="$t('base.commodityManagement.sku_name')" :edit-render="{ autofocus: '.vxe-input--inner' }">
+ <template #edit="{ row }">
+ <vxe-input v-model="row.sku_name" type="text"></vxe-input>
+ </template>
+ </vxe-column>
+ <!-- <vxe-column field="supplier_name" :title="$t('base.commodityManagement.supplier_name')"></vxe-column> -->
+ <!-- <vxe-column field="brand" :title="$t('base.commodityManagement.brand')"></vxe-column> -->
+ <vxe-column field="unit" :title="$t('base.commodityManagement.unit')" :edit-render="{ autofocus: '.vxe-input--inner' }">
+ <template #edit="{ row }">
+ <vxe-input v-model="row.unit" type="text"></vxe-input>
+ </template>
+ </vxe-column>
+ <vxe-column field="weight" :title="$t('base.commodityManagement.weight')" :edit-render="{ autofocus: '.vxe-input--inner' }">
+ <template #edit="{ row }">
+ <vxe-input v-model="row.weight" type="text"></vxe-input>
+ </template>
+ </vxe-column>
+ <vxe-column field="lenght" :title="$t('base.commodityManagement.lenght')" :edit-render="{ autofocus: '.vxe-input--inner' }">
+ <template #edit="{ row }">
+ <vxe-input v-model="row.lenght" type="text"></vxe-input>
+ </template>
+ </vxe-column>
+ <vxe-column field="width" :title="$t('base.commodityManagement.width')" :edit-render="{ autofocus: '.vxe-input--inner' }">
+ <template #edit="{ row }">
+ <vxe-input v-model="row.width" type="text"></vxe-input>
+ </template>
+ </vxe-column>
+ <vxe-column field="height" :title="$t('base.commodityManagement.height')" :edit-render="{ autofocus: '.vxe-input--inner' }">
+ <template #edit="{ row }">
+ <vxe-input v-model="row.height" type="text"></vxe-input>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('base.commodityManagement.volume')"> </vxe-column>
+ <vxe-column field="cost" :title="$t('base.commodityManagement.cost')" :edit-render="{ autofocus: '.vxe-input--inner' }">
+ <template #edit="{ row }">
+ <vxe-input v-model="row.cost" type="text"></vxe-input>
+ </template>
+ </vxe-column>
+ <vxe-column field="price" :title="$t('base.commodityManagement.price')" :edit-render="{ autofocus: '.vxe-input--inner' }">
+ <template #edit="{ row }">
+ <vxe-input v-model="row.price" type="text"></vxe-input>
+ </template>
+ </vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="100" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <!-- <tooltip-btn
+ :flat="true"
+ icon="mdi-pencil-outline"
+ :tooltip-text="$t('system.page.edit')"
+ @click="method.editRow(row)"
+ ></tooltip-btn> -->
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ </div>
+ </v-col>
+ </v-row>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { CommodityVO, CommodityDetailVO } from '@/types/Base/CommodityManagement'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addSpu, updateSpu } from '@/api/base/commodityManagementSetting'
+import { getCategoryAll } from '@/api/base/commodityCategorySetting'
+import { getSupplierAll } from '@/api/base/supplier'
+import { CategoryVO } from '@/types/Base/CommodityCategorySetting'
+import { SupplierVO } from '@/types/Base/Supplier'
+import { computedSelectTableSearchHeight, SYSTEM_HEIGHT, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { removeArrayNull } from '@/utils/common'
+import { StringLength } from '@/utils/dataVerification/formRule'
+import { isDecimal } from '@/utils/dataVerification/tableRule'
+import { exportData } from '@/utils/exportTable'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+const xTable = ref()
+
+const props = defineProps<{
+ showDialog: boolean
+ form: CommodityVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<CommodityVO>({
+ id: 0,
+ spu_code: '',
+ spu_name: '',
+ category_id: 0,
+ category_name: '',
+ spu_description: '',
+ bar_code: '',
+ supplier_id: 0,
+ supplier_name: '',
+ brand: '',
+ origin: '',
+ length_unit: 1,
+ volume_unit: 0,
+ weight_unit: 1,
+ detailList: []
+ }),
+ tableData: [],
+ rules: {
+ spu_code: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_code') }!`,
+ (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
+ ],
+ spu_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_name') }!`,
+ (val: string) => StringLength(val, 0, 200) === '' || StringLength(val, 0, 200)
+ ],
+ spu_description: [(val: string) => StringLength(val, 0, 1000) === '' || StringLength(val, 0, 1000)],
+ bar_code: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)],
+ brand: [(val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)],
+ category_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.category_name') }!`
+ ],
+ length_unit: [
+ (val: number) => [0, 1, 2, 3].includes(val) || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.length_unit') }!`
+ ],
+ volume_unit: [
+ (val: number) => [0, 1, 2].includes(val) || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.volume_unit') }!`
+ ],
+ weight_unit: [
+ (val: number) => [0, 1, 2].includes(val) || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.weight_unit') }!`
+ ],
+ supplier_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.supplier_name') }!`
+ ]
+ },
+ validRules: ref<any>({
+ sku_code: [
+ { required: true, message: `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_code') }` },
+ {
+ type: 'string',
+ min: 0,
+ max: 32,
+ message: `${ i18n.global.t('system.checkText.lengthValid') }${ 0 }-${ 32 }`,
+ trigger: 'change'
+ }
+ ],
+ sku_name: [
+ { required: true, message: `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_name') }` },
+ {
+ type: 'string',
+ min: 0,
+ max: 200,
+ message: `${ i18n.global.t('system.checkText.lengthValid') }${ 0 }-${ 200 }`,
+ trigger: 'change'
+ }
+ ],
+ unit: [
+ { required: true, message: `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.unit') }` },
+ {
+ type: 'string',
+ min: 0,
+ max: 5,
+ message: `${ i18n.global.t('system.checkText.lengthValid') }${ 0 }-${ 5 }`,
+ trigger: 'change'
+ }
+ ],
+ weight: [
+ {
+ validator: isDecimal,
+ validNumerical: 'nonNegative',
+ length: 8,
+ decimalLength: 3,
+ trigger: 'change'
+ }
+ ],
+ lenght: [
+ {
+ validator: isDecimal,
+ validNumerical: 'nonNegative',
+ length: 8,
+ decimalLength: 3,
+ trigger: 'change'
+ }
+ ],
+ width: [
+ {
+ validator: isDecimal,
+ validNumerical: 'nonNegative',
+ length: 8,
+ decimalLength: 3,
+ trigger: 'change'
+ }
+ ],
+ height: [
+ {
+ validator: isDecimal,
+ validNumerical: 'nonNegative',
+ length: 8,
+ decimalLength: 3,
+ trigger: 'change'
+ }
+ ],
+ volume: [
+ // {
+ // validator: isDecimal,
+ // validNumerical: 'nonNegative',
+ // length: 8,
+ // decimalLength: 3,
+ // trigger: 'change'
+ // }
+ ],
+ cost: [
+ {
+ validator: isDecimal,
+ validNumerical: 'nonNegative',
+ length: 10,
+ decimalLength: 2,
+ trigger: 'change'
+ }
+ ],
+ price: [
+ {
+ validator: isDecimal,
+ validNumerical: 'nonNegative',
+ length: 10,
+ decimalLength: 2,
+ trigger: 'change'
+ }
+ ]
+ }),
+ combobox: ref<{
+ length_unit: {
+ label: string
+ value: number
+ }[]
+ volume_unit: {
+ label: string
+ value: number
+ }[]
+ weight_unit: {
+ label: string
+ value: number
+ }[]
+ category_name: {
+ label: string
+ value: number
+ }[]
+ supplier_name: {
+ label: string
+ value: number
+ }[]
+ }>({
+ length_unit: [
+ {
+ label: 'mm',
+ value: 0
+ },
+ {
+ label: 'cm',
+ value: 1
+ },
+ {
+ label: 'dm',
+ value: 2
+ },
+ {
+ label: 'm',
+ value: 3
+ }
+ ],
+ volume_unit: [
+ {
+ label: 'cm³',
+ value: 0
+ },
+ {
+ label: 'dm³',
+ value: 1
+ },
+ {
+ label: 'm³',
+ value: 2
+ }
+ ],
+ weight_unit: [
+ {
+ label: 'mg',
+ value: 0
+ },
+ {
+ label: 'g',
+ value: 1
+ },
+ {
+ label: 'kg',
+ value: 2
+ }
+ ],
+ category_name: [],
+ supplier_name: []
+ })
+})
+
+const method = reactive({
+ // When the commodity type changes, it is mainly used to assign the ID
+ categoryNameChange: (val: string) => {
+ if (!val) {
+ data.form.category_id = 0
+ } else {
+ data.form.category_id = data.combobox.category_name.filter((item) => item.label === val)[0].value
+ }
+ },
+ supplierNameChange: (val: string) => {
+ if (!val) {
+ data.form.supplier_id = 0
+ } else {
+ data.form.supplier_id = data.combobox.supplier_name.filter((item) => item.label === val)[0].value
+ }
+ },
+ // Get the options required by the drop-down box
+ getCombobox: async () => {
+ data.combobox.category_name = []
+ data.combobox.supplier_name = []
+ const { data: res } = await getCategoryAll()
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.combobox.category_name = res.data
+ .filter((item: CategoryVO) => item.is_valid)
+ .map((item: CategoryVO) => ({ value: item.id, label: item.category_name }))
+ // Get supplier information
+ const { data: supplierRes } = await getSupplierAll()
+ if (!supplierRes.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: supplierRes.errorMessage
+ })
+ return
+ }
+ data.combobox.supplier_name = supplierRes.data
+ .filter((item: SupplierVO) => item.is_valid)
+ .map((item: SupplierVO) => ({ value: item.id, label: item.supplier_name }))
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ insertOneRow: () => {
+ xTable.value.insertAt(-1)
+ },
+ // Export table
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.commodityManagement'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ submit: async () => {
+ const $table = xTable.value
+ const errMap = await $table.validate(true)
+ const { valid } = await formRef.value.validate()
+ if (valid && !errMap) {
+ if ($table.getTableData().fullData.length === 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.tips.detailLengthIsZero')
+ })
+ return
+ }
+ const form = { ...data.form }
+ const insertRecords = $table.getInsertRecords()
+ form.detailList = []
+ // Processing detailed data
+ if (dialogTitle.value === 'add') {
+ form.detailList = [...insertRecords]
+ } else {
+ const updateRecords = $table.getUpdateRecords()
+ const removeRecords = $table.getRemoveRecords()
+ form.detailList = [...insertRecords, ...updateRecords]
+ for (const item of removeRecords) {
+ item.id = item.id > 0 ? 0 - item.id : item.id
+ form.detailList.push(item)
+ }
+ }
+ form.detailList = removeArrayNull(form.detailList)
+ const { data: res } = dialogTitle.value === 'add' ? await addSpu(form) : await updateSpu(form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ },
+ editRow: (row: CommodityDetailVO) => {
+ const $table = xTable.value
+ $table.setEditRow(row)
+ },
+ deleteRow: (row: CommodityDetailVO) => {
+ const $table = xTable.value
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
+ handleConfirm: async () => {
+ $table.remove(row)
+ }
+ })
+ }
+})
+
+const mainFormHeight = computed(() => computedSelectTableSearchHeight({ hasPager: false, hasToolBar: true }))
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.getCombobox()
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.mainForm {
+ background-color: #f9f9f9;
+ border-radius: 5px;
+ padding: 20px;
+ box-sizing: border-box;
+ overflow: auto;
+}
+
+.toolbar {
+ height: 40px;
+}
+</style>
diff --git a/frontend/src/view/base/commodityManagement/commodityManagement.vue b/frontend/src/view/base/commodityManagement/commodityManagement.vue
index c74f284..9c443cf 100644
--- a/frontend/src/view/base/commodityManagement/commodityManagement.vue
+++ b/frontend/src/view/base/commodityManagement/commodityManagement.vue
@@ -1,386 +1,386 @@
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="12" sm="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="12" sm="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.spu_code"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.commodityManagement.spu_code')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.spu_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.commodityManagement.spu_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.category_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.commodityManagement.category_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table
- ref="xTable"
- :data="data.tableData"
- :column-config="{
- minWidth: '100px'
- }"
- :height="tableHeight"
- align="center"
- :tree-config="data.tableTreeConfig"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="spu_code" width="150px" :title="$t('base.commodityManagement.spu_code')" tree-node>
- <template #default="{ row }">
- <span v-if="row.parent_id > 0">{{ row.sku_code }}</span>
- <span v-else>{{ row.spu_code }}</span>
- </template>
- </vxe-column>
- <vxe-column field="spu_name" :title="$t('base.commodityManagement.spu_name')">
- <template #default="{ row }">
- <span v-if="row.parent_id > 0">{{ row.sku_name }}</span>
- <span v-else>{{ row.spu_name }}</span>
- </template>
- </vxe-column>
- <vxe-column field="category_name" :title="$t('base.commodityManagement.category_name')">
- <template #default="{ row }">
- <span v-if="row.parent_id > 0">{{ row.unit }}</span>
- <span v-else>{{ row.category_name }}</span>
- </template>
- </vxe-column>
- <vxe-column field="spu_description" :title="$t('base.commodityManagement.spu_description')"> </vxe-column>
- <vxe-column field="bar_code" :title="$t('base.commodityManagement.bar_code')"> </vxe-column>
- <vxe-column field="supplier_name" :title="$t('base.commodityManagement.supplier_name')"> </vxe-column>
- <vxe-column field="brand" :title="$t('base.commodityManagement.brand')"> </vxe-column>
-
- <vxe-column field="weight" :title="$t('base.commodityManagement.weight')">
- <template #default="{ row }">
- <span v-if="row.parent_id > 0">{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="lenght" :title="$t('base.commodityManagement.lenght')">
- <template #default="{ row }">
- <span v-if="row.parent_id > 0">{{ `${row.lenght} ${GetUnit('length', row.length_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="width" :title="$t('base.commodityManagement.width')">
- <template #default="{ row }">
- <span v-if="row.parent_id > 0">{{ `${row.width} ${GetUnit('length', row.length_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="height" :title="$t('base.commodityManagement.height')">
- <template #default="{ row }">
- <span v-if="row.parent_id > 0">{{ `${row.height} ${GetUnit('length', row.length_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('base.commodityManagement.volume')">
- <template #default="{ row }">
- <span v-if="row.parent_id > 0">{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
- </template>
- </vxe-column>
-
- <vxe-column field="cost" :title="$t('base.commodityManagement.cost')">
- <template #default="{ row }">
- <span v-if="row.parent_id > 0">{{ row.cost }}</span>
- </template>
- </vxe-column>
- <vxe-column field="price" :title="$t('base.commodityManagement.price')">
- <template #default="{ row }">
- <span v-if="row.parent_id > 0">{{ row.price }}</span>
- </template>
- </vxe-column>
- <!-- <vxe-column field="sku_name" :title="$t('base.commodityManagement.sku_name')"></vxe-column> -->
- <!-- <vxe-column field="supplier_name" :title="$t('base.commodityManagement.supplier_name')"></vxe-column>
- <vxe-column field="brand" :title="$t('base.commodityManagement.brand')"></vxe-column>
- <vxe-column field="unit" :title="$t('base.commodityManagement.unit')"></vxe-column>
- <vxe-column field="cost" :title="$t('base.commodityManagement.cost')"></vxe-column> -->
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <div v-if="!row.parent_id || row.parent_id <= 0">
- <tooltip-btn
- :flat="true"
- icon="mdi-pencil-outline"
- :tooltip-text="$t('system.page.edit')"
- @click="method.editRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </div>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- </v-card-text>
- </v-card>
- </div>
- <!-- Add or modify data mode window -->
- <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, reactive, onMounted, ref, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { CommodityVO, DataProps } from '@/types/Base/CommodityManagement'
-import { getSpuList, deleteSpu } from '@/api/base/commodityManagementSetting'
-import { hookComponent } from '@/components/system'
-import addOrUpdateDialog from './add-or-update-commodity.vue'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import i18n from '@/languages/i18n'
-import { GetUnit } from '@/constant/commodityManagement'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data: DataProps = reactive({
- searchForm: {
- spu_code: '',
- spu_name: '',
- category_name: ''
- },
- timer: null,
- tableData: [],
- tablePage: {
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE
- },
- tableTreeConfig: {
- transform: true,
- rowField: 'tree_id',
- parentField: 'parent_id'
- },
- // Dialog info
- showDialog: false,
- dialogForm: {
- id: 0,
- spu_code: '',
- spu_name: '',
- category_id: 0,
- category_name: '',
- spu_description: '',
- bar_code: '',
- supplier_id: 0,
- supplier_name: '',
- brand: '',
- origin: '',
- length_unit: 1,
- volume_unit: 0,
- weight_unit: 1,
- detailList: []
- }
-})
-
-const method = reactive({
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getCompanyList()
- },
- // Find Data by Pagination
- getCompanyList: async () => {
- const { data: res } = await getSpuList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = []
- for (const item of res.data.rows) {
- item.tree_id = item.id
- data.tableData.push(item)
- for (const ditem of item.detailList) {
- ditem.tree_id = 0
- ditem.parent_id = item.id
- ditem.length_unit = item.length_unit
- ditem.volume_unit = item.volume_unit
- ditem.weight_unit = item.weight_unit
- data.tableData.push(ditem)
- }
- }
- data.tablePage.total = res.data.totals
- },
- // Add user
- add: () => {
- data.dialogForm = {
- id: 0,
- spu_code: '',
- spu_name: '',
- spu_description: '',
- bar_code: '',
- brand: '',
- length_unit: 1,
- volume_unit: 0,
- weight_unit: 1,
- detailList: []
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // after Add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Refresh data
- refresh: () => {
- method.getCompanyList()
- },
- editRow(row: CommodityVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: CommodityVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteSpu(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // Export table
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.commodityManagement'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- // When change paging
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
- method.refresh()
- })
-})
-
-onMounted(async () => {
- await method.getCompanyList()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-
-const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="12" sm="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="12" sm="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.spu_code"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.commodityManagement.spu_code')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.commodityManagement.spu_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.category_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.commodityManagement.category_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table
+ ref="xTable"
+ :data="data.tableData"
+ :column-config="{
+ minWidth: '100px'
+ }"
+ :height="tableHeight"
+ align="center"
+ :tree-config="data.tableTreeConfig"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="spu_code" width="150px" :title="$t('base.commodityManagement.spu_code')" tree-node>
+ <template #default="{ row }">
+ <span v-if="row.parent_id > 0">{{ row.sku_code }}</span>
+ <span v-else>{{ row.spu_code }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="spu_name" :title="$t('base.commodityManagement.spu_name')">
+ <template #default="{ row }">
+ <span v-if="row.parent_id > 0">{{ row.sku_name }}</span>
+ <span v-else>{{ row.spu_name }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="category_name" :title="$t('base.commodityManagement.category_name')">
+ <template #default="{ row }">
+ <span v-if="row.parent_id > 0">{{ row.unit }}</span>
+ <span v-else>{{ row.category_name }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="spu_description" :title="$t('base.commodityManagement.spu_description')"> </vxe-column>
+ <vxe-column field="bar_code" :title="$t('base.commodityManagement.bar_code')"> </vxe-column>
+ <vxe-column field="supplier_name" :title="$t('base.commodityManagement.supplier_name')"> </vxe-column>
+ <vxe-column field="brand" :title="$t('base.commodityManagement.brand')"> </vxe-column>
+
+ <vxe-column field="weight" :title="$t('base.commodityManagement.weight')">
+ <template #default="{ row }">
+ <span v-if="row.parent_id > 0">{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="lenght" :title="$t('base.commodityManagement.lenght')">
+ <template #default="{ row }">
+ <span v-if="row.parent_id > 0">{{ `${row.lenght} ${GetUnit('length', row.length_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="width" :title="$t('base.commodityManagement.width')">
+ <template #default="{ row }">
+ <span v-if="row.parent_id > 0">{{ `${row.width} ${GetUnit('length', row.length_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="height" :title="$t('base.commodityManagement.height')">
+ <template #default="{ row }">
+ <span v-if="row.parent_id > 0">{{ `${row.height} ${GetUnit('length', row.length_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('base.commodityManagement.volume')">
+ <template #default="{ row }">
+ <span v-if="row.parent_id > 0">{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
+ </template>
+ </vxe-column>
+
+ <vxe-column field="cost" :title="$t('base.commodityManagement.cost')">
+ <template #default="{ row }">
+ <span v-if="row.parent_id > 0">{{ row.cost }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="price" :title="$t('base.commodityManagement.price')">
+ <template #default="{ row }">
+ <span v-if="row.parent_id > 0">{{ row.price }}</span>
+ </template>
+ </vxe-column>
+ <!-- <vxe-column field="sku_name" :title="$t('base.commodityManagement.sku_name')"></vxe-column> -->
+ <!-- <vxe-column field="supplier_name" :title="$t('base.commodityManagement.supplier_name')"></vxe-column>
+ <vxe-column field="brand" :title="$t('base.commodityManagement.brand')"></vxe-column>
+ <vxe-column field="unit" :title="$t('base.commodityManagement.unit')"></vxe-column>
+ <vxe-column field="cost" :title="$t('base.commodityManagement.cost')"></vxe-column> -->
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <div v-if="!row.parent_id || row.parent_id <= 0">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-pencil-outline"
+ :tooltip-text="$t('system.page.edit')"
+ @click="method.editRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </div>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ </v-card-text>
+ </v-card>
+ </div>
+ <!-- Add or modify data mode window -->
+ <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, reactive, onMounted, ref, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { CommodityVO, DataProps } from '@/types/Base/CommodityManagement'
+import { getSpuList, deleteSpu } from '@/api/base/commodityManagementSetting'
+import { hookComponent } from '@/components/system'
+import addOrUpdateDialog from './add-or-update-commodity.vue'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import i18n from '@/languages/i18n'
+import { GetUnit } from '@/constant/commodityManagement'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data: DataProps = reactive({
+ searchForm: {
+ spu_code: '',
+ spu_name: '',
+ category_name: ''
+ },
+ timer: null,
+ tableData: [],
+ tablePage: {
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE
+ },
+ tableTreeConfig: {
+ transform: true,
+ rowField: 'tree_id',
+ parentField: 'parent_id'
+ },
+ // Dialog info
+ showDialog: false,
+ dialogForm: {
+ id: 0,
+ spu_code: '',
+ spu_name: '',
+ category_id: 0,
+ category_name: '',
+ spu_description: '',
+ bar_code: '',
+ supplier_id: 0,
+ supplier_name: '',
+ brand: '',
+ origin: '',
+ length_unit: 1,
+ volume_unit: 0,
+ weight_unit: 1,
+ detailList: []
+ }
+})
+
+const method = reactive({
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getCompanyList()
+ },
+ // Find Data by Pagination
+ getCompanyList: async () => {
+ const { data: res } = await getSpuList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = []
+ for (const item of res.data.rows) {
+ item.tree_id = item.id
+ data.tableData.push(item)
+ for (const ditem of item.detailList) {
+ ditem.tree_id = 0
+ ditem.parent_id = item.id
+ ditem.length_unit = item.length_unit
+ ditem.volume_unit = item.volume_unit
+ ditem.weight_unit = item.weight_unit
+ data.tableData.push(ditem)
+ }
+ }
+ data.tablePage.total = res.data.totals
+ },
+ // Add user
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ spu_code: '',
+ spu_name: '',
+ spu_description: '',
+ bar_code: '',
+ brand: '',
+ length_unit: 1,
+ volume_unit: 0,
+ weight_unit: 1,
+ detailList: []
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // after Add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getCompanyList()
+ },
+ editRow(row: CommodityVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: CommodityVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteSpu(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Export table
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.commodityManagement'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ // When change paging
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+ method.refresh()
+ })
+})
+
+onMounted(async () => {
+ await method.getCompanyList()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+
+const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/base/companySetting/add-or-update-company.vue b/frontend/src/view/base/companySetting/add-or-update-company.vue
index 80fc453..ec6c2a9 100644
--- a/frontend/src/view/base/companySetting/add-or-update-company.vue
+++ b/frontend/src/view/base/companySetting/add-or-update-company.vue
@@ -1,135 +1,135 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('router.sideBar.companySetting')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.company_name"
- :label="$t('base.companySetting.company_name')"
- :rules="data.rules.company_name"
- variant="outlined"
- ></v-text-field>
- <v-text-field v-model="data.form.city" :label="$t('base.companySetting.city')" :rules="data.rules.city" variant="outlined"></v-text-field>
- <v-text-field
- v-model="data.form.address"
- :label="$t('base.companySetting.address')"
- :rules="data.rules.address"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.manager"
- :label="$t('base.companySetting.manager')"
- :rules="data.rules.manager"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.contact_tel"
- :label="$t('base.companySetting.contact_tel')"
- :rules="data.rules.contact_tel"
- variant="outlined"
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { CompanyVO } from '@/types/Base/CompanySetting'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addCompany, updateCompany } from '@/api/base/companySetting'
-import { StringLength } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: CompanyVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<CompanyVO>({
- id: 0,
- company_name: '',
- city: '',
- address: '',
- manager: '',
- contact_tel: ''
- }),
- rules: {
- company_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.companySetting.company_name') }!`,
- (val: string) => StringLength(val, 0, 256) === '' || StringLength(val, 0, 256)
- ],
- city: [(val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)],
- address: [(val: string) => StringLength(val, 0, 256) === '' || StringLength(val, 0, 256)],
- manager: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)],
- contact_tel: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)]
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = dialogTitle.value === 'add' ? await addCompany(data.form) : await updateCompany(data.form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('router.sideBar.companySetting')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.company_name"
+ :label="$t('base.companySetting.company_name')"
+ :rules="data.rules.company_name"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field v-model="data.form.city" :label="$t('base.companySetting.city')" :rules="data.rules.city" variant="outlined"></v-text-field>
+ <v-text-field
+ v-model="data.form.address"
+ :label="$t('base.companySetting.address')"
+ :rules="data.rules.address"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.manager"
+ :label="$t('base.companySetting.manager')"
+ :rules="data.rules.manager"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.contact_tel"
+ :label="$t('base.companySetting.contact_tel')"
+ :rules="data.rules.contact_tel"
+ variant="outlined"
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { CompanyVO } from '@/types/Base/CompanySetting'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addCompany, updateCompany } from '@/api/base/companySetting'
+import { StringLength } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: CompanyVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<CompanyVO>({
+ id: 0,
+ company_name: '',
+ city: '',
+ address: '',
+ manager: '',
+ contact_tel: ''
+ }),
+ rules: {
+ company_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.companySetting.company_name') }!`,
+ (val: string) => StringLength(val, 0, 256) === '' || StringLength(val, 0, 256)
+ ],
+ city: [(val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)],
+ address: [(val: string) => StringLength(val, 0, 256) === '' || StringLength(val, 0, 256)],
+ manager: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)],
+ contact_tel: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)]
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = dialogTitle.value === 'add' ? await addCompany(data.form) : await updateCompany(data.form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/companySetting/companySetting.vue b/frontend/src/view/base/companySetting/companySetting.vue
index d6a9884..80754ac 100644
--- a/frontend/src/view/base/companySetting/companySetting.vue
+++ b/frontend/src/view/base/companySetting/companySetting.vue
@@ -1,239 +1,239 @@
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="12" sm="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="12" sm="9">
- <!-- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.userName"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.userName1"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.userName2"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row> -->
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="company_name" :title="$t('base.companySetting.company_name')"></vxe-column>
- <vxe-column field="city" :title="$t('base.companySetting.city')"></vxe-column>
- <vxe-column field="address" :title="$t('base.companySetting.address')"></vxe-column>
- <vxe-column field="manager" :title="$t('base.companySetting.manager')"></vxe-column>
- <vxe-column field="contact_tel" :title="$t('base.companySetting.contact_tel')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-pencil-outline"
- :tooltip-text="$t('system.page.edit')"
- @click="method.editRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- </div>
- </v-card-text>
- </v-card>
- </div>
- <!-- Add or modify data mode window -->
- <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, reactive, onMounted, ref } from 'vue'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { CompanyVO, DataProps } from '@/types/Base/CompanySetting'
-import { getCompanyAll, deleteCompany } from '@/api/base/companySetting'
-import { hookComponent } from '@/components/system'
-import addOrUpdateDialog from './add-or-update-company.vue'
-import i18n from '@/languages/i18n'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-const data: DataProps = reactive({
- // searchForm: {
- // userName: '',
- // userName1: '',
- // userName2: ''
- // },
- tableData: [],
- // Dialog info
- showDialog: false,
- dialogForm: {
- id: 0,
- company_name: '',
- city: '',
- address: '',
- manager: '',
- contact_tel: ''
- }
-})
-
-const method = reactive({
- sureSearch: () => {
- // console.log(data.searchForm)
- },
- // Find Data by Pagination
- getCompanyList: async () => {
- const { data: res } = await getCompanyAll()
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data
- },
- // Add user
- add: () => {
- data.dialogForm = {
- id: 0,
- company_name: '',
- city: '',
- address: '',
- manager: '',
- contact_tel: ''
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // after Add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Refresh data
- refresh: () => {
- method.getCompanyList()
- },
- editRow(row: CompanyVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: CompanyVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteCompany(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // Export table
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.companySetting'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- }
-})
-
-onMounted(async () => {
- await method.getCompanyList()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-
-const tableHeight = computed(() => computedTableHeight({ hasTab: false, hasPager: false }))
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="12" sm="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="12" sm="9">
+ <!-- <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.userName"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.userName1"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.userName2"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row> -->
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="company_name" :title="$t('base.companySetting.company_name')"></vxe-column>
+ <vxe-column field="city" :title="$t('base.companySetting.city')"></vxe-column>
+ <vxe-column field="address" :title="$t('base.companySetting.address')"></vxe-column>
+ <vxe-column field="manager" :title="$t('base.companySetting.manager')"></vxe-column>
+ <vxe-column field="contact_tel" :title="$t('base.companySetting.contact_tel')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-pencil-outline"
+ :tooltip-text="$t('system.page.edit')"
+ @click="method.editRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ </div>
+ </v-card-text>
+ </v-card>
+ </div>
+ <!-- Add or modify data mode window -->
+ <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, reactive, onMounted, ref } from 'vue'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { CompanyVO, DataProps } from '@/types/Base/CompanySetting'
+import { getCompanyAll, deleteCompany } from '@/api/base/companySetting'
+import { hookComponent } from '@/components/system'
+import addOrUpdateDialog from './add-or-update-company.vue'
+import i18n from '@/languages/i18n'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+const data: DataProps = reactive({
+ // searchForm: {
+ // userName: '',
+ // userName1: '',
+ // userName2: ''
+ // },
+ tableData: [],
+ // Dialog info
+ showDialog: false,
+ dialogForm: {
+ id: 0,
+ company_name: '',
+ city: '',
+ address: '',
+ manager: '',
+ contact_tel: ''
+ }
+})
+
+const method = reactive({
+ sureSearch: () => {
+ // console.log(data.searchForm)
+ },
+ // Find Data by Pagination
+ getCompanyList: async () => {
+ const { data: res } = await getCompanyAll()
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data
+ },
+ // Add user
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ company_name: '',
+ city: '',
+ address: '',
+ manager: '',
+ contact_tel: ''
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // after Add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getCompanyList()
+ },
+ editRow(row: CompanyVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: CompanyVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteCompany(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Export table
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.companySetting'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ }
+})
+
+onMounted(async () => {
+ await method.getCompanyList()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+
+const tableHeight = computed(() => computedTableHeight({ hasTab: false, hasPager: false }))
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/base/customer/add-or-update-customer.vue b/frontend/src/view/base/customer/add-or-update-customer.vue
index 16c0606..71e3ba2 100644
--- a/frontend/src/view/base/customer/add-or-update-customer.vue
+++ b/frontend/src/view/base/customer/add-or-update-customer.vue
@@ -1,141 +1,141 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('router.sideBar.customer')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.customer_name"
- :label="$t('base.customer.customer_name')"
- :rules="data.rules.customer_name"
- variant="outlined"
- ></v-text-field>
- <v-text-field v-model="data.form.city" :label="$t('base.customer.city')" :rules="data.rules.city" variant="outlined"></v-text-field>
- <v-text-field
- v-model="data.form.email"
- :label="$t('base.customer.email')"
- :rules="data.rules.email"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.address"
- :label="$t('base.customer.address')"
- :rules="data.rules.address"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.manager"
- :label="$t('base.customer.manager')"
- :rules="data.rules.manager"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.contact_tel"
- :label="$t('base.customer.contact_tel')"
- :rules="data.rules.contact_tel"
- variant="outlined"
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { CustomerVO } from '@/types/Base/Customer'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addCustomer, updateCustomer } from '@/api/base/customer'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: CustomerVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<CustomerVO>({
- id: 0,
- customer_name: '',
- city: '',
- address: '',
- manager: '',
- email: '',
- contact_tel: '',
- is_valid: true
- }),
- rules: {
- customer_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.customer.customer_name') }!`],
- city: [],
- address: [],
- manager: [],
- email: [],
- contact_tel: [],
- is_valid: []
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = dialogTitle.value === 'add' ? await addCustomer(data.form) : await updateCustomer(data.form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('router.sideBar.customer')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.customer_name"
+ :label="$t('base.customer.customer_name')"
+ :rules="data.rules.customer_name"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field v-model="data.form.city" :label="$t('base.customer.city')" :rules="data.rules.city" variant="outlined"></v-text-field>
+ <v-text-field
+ v-model="data.form.email"
+ :label="$t('base.customer.email')"
+ :rules="data.rules.email"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.address"
+ :label="$t('base.customer.address')"
+ :rules="data.rules.address"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.manager"
+ :label="$t('base.customer.manager')"
+ :rules="data.rules.manager"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.contact_tel"
+ :label="$t('base.customer.contact_tel')"
+ :rules="data.rules.contact_tel"
+ variant="outlined"
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { CustomerVO } from '@/types/Base/Customer'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addCustomer, updateCustomer } from '@/api/base/customer'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: CustomerVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<CustomerVO>({
+ id: 0,
+ customer_name: '',
+ city: '',
+ address: '',
+ manager: '',
+ email: '',
+ contact_tel: '',
+ is_valid: true
+ }),
+ rules: {
+ customer_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.customer.customer_name') }!`],
+ city: [],
+ address: [],
+ manager: [],
+ email: [],
+ contact_tel: [],
+ is_valid: []
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = dialogTitle.value === 'add' ? await addCustomer(data.form) : await updateCustomer(data.form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/customer/customer.vue b/frontend/src/view/base/customer/customer.vue
index a700b1e..6298874 100644
--- a/frontend/src/view/base/customer/customer.vue
+++ b/frontend/src/view/base/customer/customer.vue
@@ -1,297 +1,297 @@
-<!-- customer Setting -->
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <!-- <v-window v-model="data.activeTab">
- <v-window-item> -->
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="12" sm="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
- <tooltip-btn icon="mdi-database-import-outline" :tooltip-text="$t('system.page.import')" @click="method.openDialogImport">
- </tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="12" sm="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="12" sm="4"></v-col>
- <v-col cols="12" sm="4"></v-col>
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.customer.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="customer_name" :title="$t('base.customer.customer_name')"></vxe-column>
- <vxe-column field="city" :title="$t('base.customer.city')"></vxe-column>
- <vxe-column field="address" :title="$t('base.customer.address')"></vxe-column>
- <vxe-column field="manager" :title="$t('base.customer.manager')"></vxe-column>
- <vxe-column field="email" :title="$t('base.customer.email')"></vxe-column>
- <vxe-column field="contact_tel" :title="$t('base.customer.contact_tel')"></vxe-column>
- <vxe-column field="creator" :title="$t('base.customer.creator')"></vxe-column>
- <vxe-column field="create_time" :title="$t('base.customer.create_time')">
- <!-- :formatter="['formatDate', 'yyyy-MM-dd HH:mm:ss']" -->
- <template #default="{ row, column }">
- <span>{{ formatDate(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="last_update_time" :title="$t('base.customer.last_update_time')">
- <template #default="{ row, column }">
- <span>{{ formatDate(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-pencil-outline"
- :tooltip-text="$t('system.page.edit')"
- @click="method.editRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <!-- </v-window-item>
- </v-window> -->
- </v-card-text>
- </v-card>
- </div>
- </div>
- <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- <importCustomerTable :show-dialog="data.showDialogImport" @close="method.closeDialogImport" @saveSuccess="method.saveSuccessImport" />
-</template>
-
-<script lang="tsx" setup>
-import { computed, ref, reactive, onMounted, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { CustomerVO, DataProps } from '@/types/Base/Customer'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import addOrUpdateDialog from './add-or-update-customer.vue'
-import { hookComponent } from '@/components/system'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import i18n from '@/languages/i18n'
-import { getCustomerList, deleteCustomer } from '@/api/base/customer'
-import importCustomerTable from './import-customer-table.vue'
-import { formatDate } from '@/utils/format/formatSystem'
-import customPager from '@/components/custom-pager.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-const data = reactive({
- searchForm: {
- customer_name: ''
- },
- tableData: [],
- // activeTab: null,
- showDialog: false,
- showDialogImport: false,
- dialogForm: {
- id: 0,
- customer_name: '',
- city: '',
- address: '',
- manager: '',
- email: '',
- contact_tel: '',
- is_valid: true
- },
- tablePage: {
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- },
- timer: ref<any>(null)
-})
-
-const method = reactive({
- // Import Dialog
- openDialogImport: () => {
- data.showDialogImport = true
- },
- closeDialogImport: () => {
- data.showDialogImport = false
- },
- saveSuccessImport: () => {
- method.refresh()
- method.closeDialog()
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getData()
- },
- // Add user
- add: () => {
- data.dialogForm = {
- id: 0,
- customer_name: '',
- city: '',
- address: '',
- manager: '',
- email: '',
- contact_tel: '',
- is_valid: true
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // after Add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Refresh data
- refresh: () => {
- method.getData()
- },
- editRow(row: CustomerVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: CustomerVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteCustomer(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
- method.getData()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.customer'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- getData: async () => {
- const { data: res } = await getCustomerList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- }
-})
-onMounted(() => {
- method.getData()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<!-- customer Setting -->
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <!-- <v-window v-model="data.activeTab">
+ <v-window-item> -->
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="12" sm="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
+ <tooltip-btn icon="mdi-database-import-outline" :tooltip-text="$t('system.page.import')" @click="method.openDialogImport">
+ </tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="12" sm="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="12" sm="4"></v-col>
+ <v-col cols="12" sm="4"></v-col>
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.customer.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="customer_name" :title="$t('base.customer.customer_name')"></vxe-column>
+ <vxe-column field="city" :title="$t('base.customer.city')"></vxe-column>
+ <vxe-column field="address" :title="$t('base.customer.address')"></vxe-column>
+ <vxe-column field="manager" :title="$t('base.customer.manager')"></vxe-column>
+ <vxe-column field="email" :title="$t('base.customer.email')"></vxe-column>
+ <vxe-column field="contact_tel" :title="$t('base.customer.contact_tel')"></vxe-column>
+ <vxe-column field="creator" :title="$t('base.customer.creator')"></vxe-column>
+ <vxe-column field="create_time" :title="$t('base.customer.create_time')">
+ <!-- :formatter="['formatDate', 'yyyy-MM-dd HH:mm:ss']" -->
+ <template #default="{ row, column }">
+ <span>{{ formatDate(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="last_update_time" :title="$t('base.customer.last_update_time')">
+ <template #default="{ row, column }">
+ <span>{{ formatDate(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-pencil-outline"
+ :tooltip-text="$t('system.page.edit')"
+ @click="method.editRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <!-- </v-window-item>
+ </v-window> -->
+ </v-card-text>
+ </v-card>
+ </div>
+ </div>
+ <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ <importCustomerTable :show-dialog="data.showDialogImport" @close="method.closeDialogImport" @saveSuccess="method.saveSuccessImport" />
+</template>
+
+<script lang="tsx" setup>
+import { computed, ref, reactive, onMounted, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { CustomerVO, DataProps } from '@/types/Base/Customer'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import addOrUpdateDialog from './add-or-update-customer.vue'
+import { hookComponent } from '@/components/system'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import i18n from '@/languages/i18n'
+import { getCustomerList, deleteCustomer } from '@/api/base/customer'
+import importCustomerTable from './import-customer-table.vue'
+import { formatDate } from '@/utils/format/formatSystem'
+import customPager from '@/components/custom-pager.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+const data = reactive({
+ searchForm: {
+ customer_name: ''
+ },
+ tableData: [],
+ // activeTab: null,
+ showDialog: false,
+ showDialogImport: false,
+ dialogForm: {
+ id: 0,
+ customer_name: '',
+ city: '',
+ address: '',
+ manager: '',
+ email: '',
+ contact_tel: '',
+ is_valid: true
+ },
+ tablePage: {
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ },
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ // Import Dialog
+ openDialogImport: () => {
+ data.showDialogImport = true
+ },
+ closeDialogImport: () => {
+ data.showDialogImport = false
+ },
+ saveSuccessImport: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getData()
+ },
+ // Add user
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ customer_name: '',
+ city: '',
+ address: '',
+ manager: '',
+ email: '',
+ contact_tel: '',
+ is_valid: true
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // after Add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getData()
+ },
+ editRow(row: CustomerVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: CustomerVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteCustomer(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+ method.getData()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.customer'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ getData: async () => {
+ const { data: res } = await getCustomerList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ }
+})
+onMounted(() => {
+ method.getData()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/base/customer/import-customer-table.vue b/frontend/src/view/base/customer/import-customer-table.vue
index 0a3c6b2..ac9b06d 100644
--- a/frontend/src/view/base/customer/import-customer-table.vue
+++ b/frontend/src/view/base/customer/import-customer-table.vue
@@ -1,227 +1,227 @@
-<!-- Customer Setting Import Dialog -->
-<template>
- <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('system.page.import')}`"></v-toolbar>
- <v-card-text>
- <div class="mb-4">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.chooseFile')" size="x-small" @click="method.chooseFile"></tooltip-btn>
- <tooltip-btn
- icon="mdi-export-variant"
- :tooltip-text="$t('system.page.exportTemplate')"
- size="x-small"
- @click="method.exportTemplate"
- ></tooltip-btn>
- <input v-show="false" id="open" ref="uploadExcel" type="file" accept=".xls, .xlsx" @change="method.readExcel" />
- </div>
- <vxe-table
- ref="xTable"
- :column-config="{ minWidth: '100px' }"
- :data="data.importData"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- :edit-config="{ trigger: 'click', mode: 'cell' }"
- :edit-rules="data.validRules"
- :export-config="{}"
- align="center"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="operate" width="60" :title="$t('system.page.operate')" :resizable="false">
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- <vxe-column field="customer_name" :title="$t('base.customer.customer_name')"></vxe-column>
- <vxe-column field="city" :title="$t('base.customer.city')"></vxe-column>
- <vxe-column field="address" :title="$t('base.customer.address')"></vxe-column>
- <vxe-column field="manager" :title="$t('base.customer.manager')"></vxe-column>
- <vxe-column field="email" :title="$t('base.customer.email')"></vxe-column>
- <vxe-column field="contact_tel" :title="$t('base.customer.contact_tel')"></vxe-column>
- </vxe-table>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { VxeTablePropTypes } from 'vxe-table'
-import * as XLSX from 'xlsx'
-import i18n from '@/languages/i18n'
-import { excelImport } from '@/api/base/customer'
-import { hookComponent } from '@/components/system/index'
-import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { CustomerExcelVO } from '@/types/Base/Customer'
-import { exportData } from '@/utils/exportTable'
-
-const emit = defineEmits(['close', 'saveSuccess'])
-const uploadExcel = ref()
-const xTable = ref()
-
-const props = defineProps<{
- showDialog: boolean
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- importData: ref<Array<CustomerExcelVO>>([]),
- validRules: ref<VxeTablePropTypes.EditRules>({}),
- eMsg: ''
-})
-
-const method = reactive({
- initForm: () => {
- data.importData = []
- },
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const isValid = method.valid()
- if (!isValid) {
- return
- }
-
- const $table = xTable.value
- // It must be use 'getTableData()' to get all datas with table because it will delete row sometimes.
- const importData = $table.getTableData().fullData
-
- const { data: res } = await excelImport(importData)
- if (!res.isSuccess) {
- data.eMsg = ''
- if (res.data.length > 0) {
- for (const item of res.data) {
- if (item.errorMsg) {
- data.eMsg = data.eMsg ? data.eMsg + ',' + item.errorMsg : item.errorMsg
- }
- }
- }
- hookComponent.$message({
- type: 'error',
- content: data.eMsg
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- },
-
- valid: () => {
- const $table = xTable.value
- const importData = $table.getTableData().fullData
-
- if (importData.length <= 0) {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('system.tips.detailLengthIsZero') }`
- })
- return false
- }
- return true
- },
-
- chooseFile: async () => {
- uploadExcel.value.value = ''
- uploadExcel.value.click()
- },
-
- readExcel: async (evnt: any) => {
- const files = evnt.target.files
- if (files.length <= 0) {
- return false
- }
-
- const file = files[0]
- const fileReader = new FileReader()
-
- fileReader.onload = (ev: ProgressEvent<FileReader>) => {
- const fileData = ev?.target?.result
- if (fileData) {
- const workbook = XLSX.read(fileData, { type: 'binary' })
- const wsname = workbook.SheetNames[0]
-
- let ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname])
- let str = JSON.stringify(ws)
- str = str.replace(/(/g, '(')
- str = str.replace(/)/g, ')')
- ws = JSON.parse(str)
-
- data.importData = []
- ws.forEach((value: any, index: number, ws: any) => {
- data.importData.push({
- customer_name: ws[index][i18n.global.t('base.customer.customer_name')] ? ws[index][i18n.global.t('base.customer.customer_name')] + '' : '',
- city: ws[index][i18n.global.t('base.customer.city')] ? ws[index][i18n.global.t('base.customer.city')] + '' : '',
- address: ws[index][i18n.global.t('base.customer.address')] ? ws[index][i18n.global.t('base.customer.address')] + '' : '',
- manager: ws[index][i18n.global.t('base.customer.manager')] ? ws[index][i18n.global.t('base.customer.manager')] + '' : '',
- email: ws[index][i18n.global.t('base.customer.email')] ? ws[index][i18n.global.t('base.customer.email')] + '' : '',
- contact_tel: ws[index][i18n.global.t('base.customer.contact_tel')] ? ws[index][i18n.global.t('base.customer.contact_tel')] + '' : '',
- _XID: '',
- errorMsg: ''
- })
- })
- }
- }
- fileReader.readAsBinaryString(file)
- },
-
- exportTemplate: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.customer'),
- mode: 'header',
- columnFilterMethod({ column }: any) {
- return !['checkbox', 'seq'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
-
- deleteRow: (row: CustomerExcelVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
- handleConfirm: async () => {
- if (row) {
- const $table = xTable.value
- $table.remove(row)
- }
- }
- })
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- Customer Setting Import Dialog -->
+<template>
+ <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('system.page.import')}`"></v-toolbar>
+ <v-card-text>
+ <div class="mb-4">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.chooseFile')" size="x-small" @click="method.chooseFile"></tooltip-btn>
+ <tooltip-btn
+ icon="mdi-export-variant"
+ :tooltip-text="$t('system.page.exportTemplate')"
+ size="x-small"
+ @click="method.exportTemplate"
+ ></tooltip-btn>
+ <input v-show="false" id="open" ref="uploadExcel" type="file" accept=".xls, .xlsx" @change="method.readExcel" />
+ </div>
+ <vxe-table
+ ref="xTable"
+ :column-config="{ minWidth: '100px' }"
+ :data="data.importData"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ :edit-config="{ trigger: 'click', mode: 'cell' }"
+ :edit-rules="data.validRules"
+ :export-config="{}"
+ align="center"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="operate" width="60" :title="$t('system.page.operate')" :resizable="false">
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ <vxe-column field="customer_name" :title="$t('base.customer.customer_name')"></vxe-column>
+ <vxe-column field="city" :title="$t('base.customer.city')"></vxe-column>
+ <vxe-column field="address" :title="$t('base.customer.address')"></vxe-column>
+ <vxe-column field="manager" :title="$t('base.customer.manager')"></vxe-column>
+ <vxe-column field="email" :title="$t('base.customer.email')"></vxe-column>
+ <vxe-column field="contact_tel" :title="$t('base.customer.contact_tel')"></vxe-column>
+ </vxe-table>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { VxeTablePropTypes } from 'vxe-table'
+import * as XLSX from 'xlsx'
+import i18n from '@/languages/i18n'
+import { excelImport } from '@/api/base/customer'
+import { hookComponent } from '@/components/system/index'
+import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { CustomerExcelVO } from '@/types/Base/Customer'
+import { exportData } from '@/utils/exportTable'
+
+const emit = defineEmits(['close', 'saveSuccess'])
+const uploadExcel = ref()
+const xTable = ref()
+
+const props = defineProps<{
+ showDialog: boolean
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ importData: ref<Array<CustomerExcelVO>>([]),
+ validRules: ref<VxeTablePropTypes.EditRules>({}),
+ eMsg: ''
+})
+
+const method = reactive({
+ initForm: () => {
+ data.importData = []
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const isValid = method.valid()
+ if (!isValid) {
+ return
+ }
+
+ const $table = xTable.value
+ // It must be use 'getTableData()' to get all datas with table because it will delete row sometimes.
+ const importData = $table.getTableData().fullData
+
+ const { data: res } = await excelImport(importData)
+ if (!res.isSuccess) {
+ data.eMsg = ''
+ if (res.data.length > 0) {
+ for (const item of res.data) {
+ if (item.errorMsg) {
+ data.eMsg = data.eMsg ? data.eMsg + ',' + item.errorMsg : item.errorMsg
+ }
+ }
+ }
+ hookComponent.$message({
+ type: 'error',
+ content: data.eMsg
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ },
+
+ valid: () => {
+ const $table = xTable.value
+ const importData = $table.getTableData().fullData
+
+ if (importData.length <= 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('system.tips.detailLengthIsZero') }`
+ })
+ return false
+ }
+ return true
+ },
+
+ chooseFile: async () => {
+ uploadExcel.value.value = ''
+ uploadExcel.value.click()
+ },
+
+ readExcel: async (evnt: any) => {
+ const files = evnt.target.files
+ if (files.length <= 0) {
+ return false
+ }
+
+ const file = files[0]
+ const fileReader = new FileReader()
+
+ fileReader.onload = (ev: ProgressEvent<FileReader>) => {
+ const fileData = ev?.target?.result
+ if (fileData) {
+ const workbook = XLSX.read(fileData, { type: 'binary' })
+ const wsname = workbook.SheetNames[0]
+
+ let ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname])
+ let str = JSON.stringify(ws)
+ str = str.replace(/(/g, '(')
+ str = str.replace(/)/g, ')')
+ ws = JSON.parse(str)
+
+ data.importData = []
+ ws.forEach((value: any, index: number, ws: any) => {
+ data.importData.push({
+ customer_name: ws[index][i18n.global.t('base.customer.customer_name')] ? ws[index][i18n.global.t('base.customer.customer_name')] + '' : '',
+ city: ws[index][i18n.global.t('base.customer.city')] ? ws[index][i18n.global.t('base.customer.city')] + '' : '',
+ address: ws[index][i18n.global.t('base.customer.address')] ? ws[index][i18n.global.t('base.customer.address')] + '' : '',
+ manager: ws[index][i18n.global.t('base.customer.manager')] ? ws[index][i18n.global.t('base.customer.manager')] + '' : '',
+ email: ws[index][i18n.global.t('base.customer.email')] ? ws[index][i18n.global.t('base.customer.email')] + '' : '',
+ contact_tel: ws[index][i18n.global.t('base.customer.contact_tel')] ? ws[index][i18n.global.t('base.customer.contact_tel')] + '' : '',
+ _XID: '',
+ errorMsg: ''
+ })
+ })
+ }
+ }
+ fileReader.readAsBinaryString(file)
+ },
+
+ exportTemplate: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.customer'),
+ mode: 'header',
+ columnFilterMethod({ column }: any) {
+ return !['checkbox', 'seq'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+
+ deleteRow: (row: CustomerExcelVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
+ handleConfirm: async () => {
+ if (row) {
+ const $table = xTable.value
+ $table.remove(row)
+ }
+ }
+ })
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/freightSetting/add-or-update-freight.vue b/frontend/src/view/base/freightSetting/add-or-update-freight.vue
index c4bbe1c..55bf485 100644
--- a/frontend/src/view/base/freightSetting/add-or-update-freight.vue
+++ b/frontend/src/view/base/freightSetting/add-or-update-freight.vue
@@ -1,175 +1,175 @@
-<!-- Freight Setting Operate Dialog -->
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('router.sideBar.freightSetting')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.carrier"
- :label="$t('base.freightSetting.carrier')"
- :rules="data.rules.carrier"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.departure_city"
- :label="$t('base.freightSetting.departure_city')"
- :rules="data.rules.departure_city"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.arrival_city"
- :label="$t('base.freightSetting.arrival_city')"
- :rules="data.rules.arrival_city"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.price_per_weight"
- :label="$t('base.freightSetting.price_per_weight')"
- :rules="data.rules.price_per_weight"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.price_per_volume"
- :label="$t('base.freightSetting.price_per_volume')"
- :rules="data.rules.price_per_volume"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.min_payment"
- :label="$t('base.freightSetting.min_payment')"
- :rules="data.rules.min_payment"
- variant="outlined"
- ></v-text-field>
- <v-switch
- v-model="data.form.is_valid"
- color="primary"
- :label="$t('base.freightSetting.is_valid')"
- :rules="data.rules.is_valid"
- ></v-switch>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addFreight, updateFreight } from '@/api/base/freightSetting'
-import { FreightVO } from '@/types/Base/Freight'
-import { StringLength, IsDecimal } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: FreightVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<FreightVO>({
- id: 0,
- carrier: '',
- departure_city: '',
- arrival_city: '',
- price_per_weight: 0,
- price_per_volume: 0,
- min_payment: 0,
- is_valid: true
- }),
- rules: {
- carrier: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.freightSetting.carrier') }!`,
- (val: string) => StringLength(val, 0, 256) === '' || StringLength(val, 0, 256)
- ],
- departure_city: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.freightSetting.departure_city') }!`,
- (val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)
- ],
- arrival_city: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.freightSetting.arrival_city') }!`,
- (val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)
- ],
- price_per_weight: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.freightSetting.price_per_weight') }!`,
- (val: number) => IsDecimal(val, 'nonNegative', 6, 2) === '' || IsDecimal(val, 'nonNegative', 6, 2)
- ],
- price_per_volume: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.freightSetting.price_per_volume') }!`,
- (val: number) => IsDecimal(val, 'nonNegative', 6, 2) === '' || IsDecimal(val, 'nonNegative', 6, 2)
- ],
- min_payment: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.freightSetting.min_payment') }!`,
- (val: number) => IsDecimal(val, 'nonNegative', 8, 2) === '' || IsDecimal(val, 'nonNegative', 8, 2)
- ],
- is_valid: []
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- initForm: () => {
- data.form = props.form
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = dialogTitle.value === 'add' ? await addFreight(data.form) : await updateFreight(data.form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- Freight Setting Operate Dialog -->
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('router.sideBar.freightSetting')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.carrier"
+ :label="$t('base.freightSetting.carrier')"
+ :rules="data.rules.carrier"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.departure_city"
+ :label="$t('base.freightSetting.departure_city')"
+ :rules="data.rules.departure_city"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.arrival_city"
+ :label="$t('base.freightSetting.arrival_city')"
+ :rules="data.rules.arrival_city"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.price_per_weight"
+ :label="$t('base.freightSetting.price_per_weight')"
+ :rules="data.rules.price_per_weight"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.price_per_volume"
+ :label="$t('base.freightSetting.price_per_volume')"
+ :rules="data.rules.price_per_volume"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.min_payment"
+ :label="$t('base.freightSetting.min_payment')"
+ :rules="data.rules.min_payment"
+ variant="outlined"
+ ></v-text-field>
+ <v-switch
+ v-model="data.form.is_valid"
+ color="primary"
+ :label="$t('base.freightSetting.is_valid')"
+ :rules="data.rules.is_valid"
+ ></v-switch>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addFreight, updateFreight } from '@/api/base/freightSetting'
+import { FreightVO } from '@/types/Base/Freight'
+import { StringLength, IsDecimal } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: FreightVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<FreightVO>({
+ id: 0,
+ carrier: '',
+ departure_city: '',
+ arrival_city: '',
+ price_per_weight: 0,
+ price_per_volume: 0,
+ min_payment: 0,
+ is_valid: true
+ }),
+ rules: {
+ carrier: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.freightSetting.carrier') }!`,
+ (val: string) => StringLength(val, 0, 256) === '' || StringLength(val, 0, 256)
+ ],
+ departure_city: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.freightSetting.departure_city') }!`,
+ (val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)
+ ],
+ arrival_city: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.freightSetting.arrival_city') }!`,
+ (val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)
+ ],
+ price_per_weight: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.freightSetting.price_per_weight') }!`,
+ (val: number) => IsDecimal(val, 'nonNegative', 6, 2) === '' || IsDecimal(val, 'nonNegative', 6, 2)
+ ],
+ price_per_volume: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.freightSetting.price_per_volume') }!`,
+ (val: number) => IsDecimal(val, 'nonNegative', 6, 2) === '' || IsDecimal(val, 'nonNegative', 6, 2)
+ ],
+ min_payment: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.freightSetting.min_payment') }!`,
+ (val: number) => IsDecimal(val, 'nonNegative', 8, 2) === '' || IsDecimal(val, 'nonNegative', 8, 2)
+ ],
+ is_valid: []
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ initForm: () => {
+ data.form = props.form
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = dialogTitle.value === 'add' ? await addFreight(data.form) : await updateFreight(data.form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/freightSetting/freightSetting.vue b/frontend/src/view/base/freightSetting/freightSetting.vue
index 8ab3a00..04b7163 100644
--- a/frontend/src/view/base/freightSetting/freightSetting.vue
+++ b/frontend/src/view/base/freightSetting/freightSetting.vue
@@ -1,321 +1,321 @@
-<!-- Freight Setting -->
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <v-window v-model="data.activeTab">
- <v-window-item>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-database-import-outline" :tooltip-text="$t('system.page.import')" @click="method.openDialogImport">
- </tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.carrier"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.freightSetting.carrier')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.departure_city"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.freightSetting.departure_city')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.arrival_city"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.freightSetting.arrival_city')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="carrier" :title="$t('base.freightSetting.carrier')"></vxe-column>
- <vxe-column field="departure_city" :title="$t('base.freightSetting.departure_city')"></vxe-column>
- <vxe-column field="arrival_city" :title="$t('base.freightSetting.arrival_city')"></vxe-column>
- <vxe-column field="price_per_weight" :title="$t('base.freightSetting.price_per_weight')"></vxe-column>
- <vxe-column field="price_per_volume" :title="$t('base.freightSetting.price_per_volume')"></vxe-column>
- <vxe-column field="min_payment" :title="$t('base.freightSetting.min_payment')"></vxe-column>
- <vxe-column field="creator" :title="$t('base.freightSetting.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('base.freightSetting.create_time')"></vxe-column>
- <vxe-column field="is_valid" :title="$t('base.freightSetting.is_valid')">
- <template #default="{ row, column }">
- <span>{{ row[column.property] ? $t('system.combobox.yesOrNo.yes') : $t('system.combobox.yesOrNo.no') }}</span>
- </template>
- </vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-pencil-outline"
- :tooltip-text="$t('system.page.edit')"
- @click="method.editRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- ></custom-pager>
- </div>
- </v-window-item>
- </v-window>
- </v-card-text>
- </v-card>
- <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- <import-table :show-dialog="data.showDialogImport" @close="method.closeDialogImport" @saveSuccess="method.saveSuccessImport" />
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, onMounted, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { FreightVO } from '@/types/Base/Freight'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { deleteFreight, getFreightList } from '@/api/base/freightSetting'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import customPager from '@/components/custom-pager.vue'
-import addOrUpdateDialog from './add-or-update-freight.vue'
-import importTable from './import-table.vue'
-import i18n from '@/languages/i18n'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-const data = reactive({
- showDialog: false,
- showDialogImport: false,
-
- dialogForm: {
- id: 0,
- carrier: '',
- departure_city: '',
- arrival_city: '',
- price_per_weight: 0,
- price_per_volume: 0,
- min_payment: 0,
- is_valid: true
- },
- searchForm: {
- carrier: '',
- departure_city: '',
- arrival_city: ''
- },
- activeTab: null,
- tableData: ref<FreightVO[]>([]),
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- timer: ref<any>(null)
-})
-
-const method = reactive({
- // Open a dialog to add
- add: () => {
- data.dialogForm = {
- id: 0,
- carrier: '',
- departure_city: '',
- arrival_city: '',
- price_per_weight: 0,
- price_per_volume: 0,
- min_payment: 0,
- is_valid: true
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // After add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Import Dialog
- openDialogImport: () => {
- data.showDialogImport = true
- },
- closeDialogImport: () => {
- data.showDialogImport = false
- },
- saveSuccessImport: () => {
- method.refresh()
- method.closeDialogImport()
- },
- // Refresh data
- refresh: () => {
- method.getFreightList()
- },
- getFreightList: async () => {
- const { data: res } = await getFreightList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- editRow(row: FreightVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: FreightVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteFreight(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getFreightList()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.freightSetting'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- importTable: () => {
- const $table = xTable.value
- $table.importData()
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getFreightList()
- }
-})
-
-onMounted(() => {
- method.getFreightList()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<!-- Freight Setting -->
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <v-window v-model="data.activeTab">
+ <v-window-item>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-database-import-outline" :tooltip-text="$t('system.page.import')" @click="method.openDialogImport">
+ </tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.carrier"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.freightSetting.carrier')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.departure_city"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.freightSetting.departure_city')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.arrival_city"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.freightSetting.arrival_city')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="carrier" :title="$t('base.freightSetting.carrier')"></vxe-column>
+ <vxe-column field="departure_city" :title="$t('base.freightSetting.departure_city')"></vxe-column>
+ <vxe-column field="arrival_city" :title="$t('base.freightSetting.arrival_city')"></vxe-column>
+ <vxe-column field="price_per_weight" :title="$t('base.freightSetting.price_per_weight')"></vxe-column>
+ <vxe-column field="price_per_volume" :title="$t('base.freightSetting.price_per_volume')"></vxe-column>
+ <vxe-column field="min_payment" :title="$t('base.freightSetting.min_payment')"></vxe-column>
+ <vxe-column field="creator" :title="$t('base.freightSetting.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('base.freightSetting.create_time')"></vxe-column>
+ <vxe-column field="is_valid" :title="$t('base.freightSetting.is_valid')">
+ <template #default="{ row, column }">
+ <span>{{ row[column.property] ? $t('system.combobox.yesOrNo.yes') : $t('system.combobox.yesOrNo.no') }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-pencil-outline"
+ :tooltip-text="$t('system.page.edit')"
+ @click="method.editRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ ></custom-pager>
+ </div>
+ </v-window-item>
+ </v-window>
+ </v-card-text>
+ </v-card>
+ <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ <import-table :show-dialog="data.showDialogImport" @close="method.closeDialogImport" @saveSuccess="method.saveSuccessImport" />
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, onMounted, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { FreightVO } from '@/types/Base/Freight'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { deleteFreight, getFreightList } from '@/api/base/freightSetting'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import customPager from '@/components/custom-pager.vue'
+import addOrUpdateDialog from './add-or-update-freight.vue'
+import importTable from './import-table.vue'
+import i18n from '@/languages/i18n'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+const data = reactive({
+ showDialog: false,
+ showDialogImport: false,
+
+ dialogForm: {
+ id: 0,
+ carrier: '',
+ departure_city: '',
+ arrival_city: '',
+ price_per_weight: 0,
+ price_per_volume: 0,
+ min_payment: 0,
+ is_valid: true
+ },
+ searchForm: {
+ carrier: '',
+ departure_city: '',
+ arrival_city: ''
+ },
+ activeTab: null,
+ tableData: ref<FreightVO[]>([]),
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ // Open a dialog to add
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ carrier: '',
+ departure_city: '',
+ arrival_city: '',
+ price_per_weight: 0,
+ price_per_volume: 0,
+ min_payment: 0,
+ is_valid: true
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // After add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Import Dialog
+ openDialogImport: () => {
+ data.showDialogImport = true
+ },
+ closeDialogImport: () => {
+ data.showDialogImport = false
+ },
+ saveSuccessImport: () => {
+ method.refresh()
+ method.closeDialogImport()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getFreightList()
+ },
+ getFreightList: async () => {
+ const { data: res } = await getFreightList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ editRow(row: FreightVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: FreightVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteFreight(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getFreightList()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.freightSetting'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ importTable: () => {
+ const $table = xTable.value
+ $table.importData()
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getFreightList()
+ }
+})
+
+onMounted(() => {
+ method.getFreightList()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/base/freightSetting/import-table.vue b/frontend/src/view/base/freightSetting/import-table.vue
index 60c63f9..ac71f2b 100644
--- a/frontend/src/view/base/freightSetting/import-table.vue
+++ b/frontend/src/view/base/freightSetting/import-table.vue
@@ -1,214 +1,214 @@
-<!-- Freight Setting Import Dialog -->
-<template>
- <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('system.page.import')}`"></v-toolbar>
- <v-card-text>
- <div class="mb-4">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.chooseFile')" size="x-small" @click="method.chooseFile"></tooltip-btn>
- <tooltip-btn
- icon="mdi-export-variant"
- :tooltip-text="$t('system.page.exportTemplate')"
- size="x-small"
- @click="method.exportTemplate"
- ></tooltip-btn>
- <input v-show="false" id="open" ref="uploadExcel" type="file" accept=".xls, .xlsx" @change="method.readExcel" />
- </div>
- <vxe-table
- ref="xTable"
- :column-config="{ minWidth: '100px' }"
- :data="data.importData"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- :edit-config="{ trigger: 'click', mode: 'cell' }"
- :edit-rules="data.validRules"
- :export-config="{}"
- align="center"
- >
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="operate" width="60" :title="$t('system.page.operate')" :resizable="false">
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- <vxe-column field="carrier" :title="$t('base.freightSetting.carrier')"></vxe-column>
- <vxe-column field="departure_city" :title="$t('base.freightSetting.departure_city')"></vxe-column>
- <vxe-column field="arrival_city" :title="$t('base.freightSetting.arrival_city')"></vxe-column>
- <vxe-column field="price_per_weight" :title="$t('base.freightSetting.price_per_weight')"></vxe-column>
- <vxe-column field="price_per_volume" :title="$t('base.freightSetting.price_per_volume')"></vxe-column>
- <vxe-column field="min_payment" :title="$t('base.freightSetting.min_payment')"></vxe-column>
- </vxe-table>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { VxeTablePropTypes } from 'vxe-table'
-import * as XLSX from 'xlsx'
-import i18n from '@/languages/i18n'
-import { excelImport } from '@/api/base/freightSetting'
-import { hookComponent } from '@/components/system/index'
-import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { FreightVO } from '@/types/Base/Freight'
-import { exportData } from '@/utils/exportTable'
-import { formatString } from '@/utils/format/formatSystem'
-
-const emit = defineEmits(['close', 'saveSuccess'])
-const uploadExcel = ref()
-const xTable = ref()
-
-const props = defineProps<{
- showDialog: boolean
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- importData: ref<Array<FreightVO>>([]),
- validRules: ref<VxeTablePropTypes.EditRules>({})
-})
-
-const method = reactive({
- initForm: () => {
- data.importData = []
- },
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const isValid = method.valid()
- if (!isValid) {
- return
- }
-
- const $table = xTable.value
- // It must be use 'getTableData()' to get all datas with table because it will delete row sometimes.
- const importData = $table.getTableData().fullData
-
- const { data: res } = await excelImport(importData)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- },
-
- valid: () => {
- const $table = xTable.value
- const importData = $table.getTableData().fullData
-
- if (importData.length <= 0) {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('system.tips.detailLengthIsZero') }`
- })
- return false
- }
- return true
- },
-
- chooseFile: async () => {
- uploadExcel.value.value = ''
- uploadExcel.value.click()
- },
-
- readExcel: async (evnt: any) => {
- const files = evnt.target.files
- if (files.length <= 0) {
- return false
- }
-
- const file = files[0]
- const fileReader = new FileReader()
-
- fileReader.onload = (ev: ProgressEvent<FileReader>) => {
- const fileData = ev?.target?.result
- if (fileData) {
- const workbook = XLSX.read(fileData, { type: 'binary' })
- const wsname = workbook.SheetNames[0]
-
- let ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname])
- let str = JSON.stringify(ws)
- str = str.replace(/(/g, '(')
- str = str.replace(/)/g, ')')
- ws = JSON.parse(str)
-
- data.importData = []
- ws.forEach((value: any, index: number, ws: any) => {
- data.importData.push({
- carrier: formatString(ws[index][i18n.global.t('base.freightSetting.carrier')]),
- departure_city: formatString(ws[index][i18n.global.t('base.freightSetting.departure_city')]),
- arrival_city: formatString(ws[index][i18n.global.t('base.freightSetting.arrival_city')]),
- price_per_weight: ws[index][i18n.global.t('base.freightSetting.price_per_weight')],
- price_per_volume: ws[index][i18n.global.t('base.freightSetting.price_per_volume')],
- min_payment: ws[index][i18n.global.t('base.freightSetting.min_payment')]
- })
- })
- }
- }
- fileReader.readAsBinaryString(file)
- },
-
- exportTemplate: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.freightSetting'),
- mode: 'header',
- columnFilterMethod({ column }: any) {
- return !['checkbox', 'seq'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
-
- deleteRow: (row: FreightVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
- handleConfirm: async () => {
- if (row) {
- const $table = xTable.value
- $table.remove(row)
- }
- }
- })
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- Freight Setting Import Dialog -->
+<template>
+ <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('system.page.import')}`"></v-toolbar>
+ <v-card-text>
+ <div class="mb-4">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.chooseFile')" size="x-small" @click="method.chooseFile"></tooltip-btn>
+ <tooltip-btn
+ icon="mdi-export-variant"
+ :tooltip-text="$t('system.page.exportTemplate')"
+ size="x-small"
+ @click="method.exportTemplate"
+ ></tooltip-btn>
+ <input v-show="false" id="open" ref="uploadExcel" type="file" accept=".xls, .xlsx" @change="method.readExcel" />
+ </div>
+ <vxe-table
+ ref="xTable"
+ :column-config="{ minWidth: '100px' }"
+ :data="data.importData"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ :edit-config="{ trigger: 'click', mode: 'cell' }"
+ :edit-rules="data.validRules"
+ :export-config="{}"
+ align="center"
+ >
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="operate" width="60" :title="$t('system.page.operate')" :resizable="false">
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ <vxe-column field="carrier" :title="$t('base.freightSetting.carrier')"></vxe-column>
+ <vxe-column field="departure_city" :title="$t('base.freightSetting.departure_city')"></vxe-column>
+ <vxe-column field="arrival_city" :title="$t('base.freightSetting.arrival_city')"></vxe-column>
+ <vxe-column field="price_per_weight" :title="$t('base.freightSetting.price_per_weight')"></vxe-column>
+ <vxe-column field="price_per_volume" :title="$t('base.freightSetting.price_per_volume')"></vxe-column>
+ <vxe-column field="min_payment" :title="$t('base.freightSetting.min_payment')"></vxe-column>
+ </vxe-table>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { VxeTablePropTypes } from 'vxe-table'
+import * as XLSX from 'xlsx'
+import i18n from '@/languages/i18n'
+import { excelImport } from '@/api/base/freightSetting'
+import { hookComponent } from '@/components/system/index'
+import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { FreightVO } from '@/types/Base/Freight'
+import { exportData } from '@/utils/exportTable'
+import { formatString } from '@/utils/format/formatSystem'
+
+const emit = defineEmits(['close', 'saveSuccess'])
+const uploadExcel = ref()
+const xTable = ref()
+
+const props = defineProps<{
+ showDialog: boolean
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ importData: ref<Array<FreightVO>>([]),
+ validRules: ref<VxeTablePropTypes.EditRules>({})
+})
+
+const method = reactive({
+ initForm: () => {
+ data.importData = []
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const isValid = method.valid()
+ if (!isValid) {
+ return
+ }
+
+ const $table = xTable.value
+ // It must be use 'getTableData()' to get all datas with table because it will delete row sometimes.
+ const importData = $table.getTableData().fullData
+
+ const { data: res } = await excelImport(importData)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ },
+
+ valid: () => {
+ const $table = xTable.value
+ const importData = $table.getTableData().fullData
+
+ if (importData.length <= 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('system.tips.detailLengthIsZero') }`
+ })
+ return false
+ }
+ return true
+ },
+
+ chooseFile: async () => {
+ uploadExcel.value.value = ''
+ uploadExcel.value.click()
+ },
+
+ readExcel: async (evnt: any) => {
+ const files = evnt.target.files
+ if (files.length <= 0) {
+ return false
+ }
+
+ const file = files[0]
+ const fileReader = new FileReader()
+
+ fileReader.onload = (ev: ProgressEvent<FileReader>) => {
+ const fileData = ev?.target?.result
+ if (fileData) {
+ const workbook = XLSX.read(fileData, { type: 'binary' })
+ const wsname = workbook.SheetNames[0]
+
+ let ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname])
+ let str = JSON.stringify(ws)
+ str = str.replace(/(/g, '(')
+ str = str.replace(/)/g, ')')
+ ws = JSON.parse(str)
+
+ data.importData = []
+ ws.forEach((value: any, index: number, ws: any) => {
+ data.importData.push({
+ carrier: formatString(ws[index][i18n.global.t('base.freightSetting.carrier')]),
+ departure_city: formatString(ws[index][i18n.global.t('base.freightSetting.departure_city')]),
+ arrival_city: formatString(ws[index][i18n.global.t('base.freightSetting.arrival_city')]),
+ price_per_weight: ws[index][i18n.global.t('base.freightSetting.price_per_weight')],
+ price_per_volume: ws[index][i18n.global.t('base.freightSetting.price_per_volume')],
+ min_payment: ws[index][i18n.global.t('base.freightSetting.min_payment')]
+ })
+ })
+ }
+ }
+ fileReader.readAsBinaryString(file)
+ },
+
+ exportTemplate: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.freightSetting'),
+ mode: 'header',
+ columnFilterMethod({ column }: any) {
+ return !['checkbox', 'seq'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+
+ deleteRow: (row: FreightVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
+ handleConfirm: async () => {
+ if (row) {
+ const $table = xTable.value
+ $table.remove(row)
+ }
+ }
+ })
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/ownerOfCargo/add-or-update-owner-of-cargo.vue b/frontend/src/view/base/ownerOfCargo/add-or-update-owner-of-cargo.vue
index bd05ba5..454be0c 100644
--- a/frontend/src/view/base/ownerOfCargo/add-or-update-owner-of-cargo.vue
+++ b/frontend/src/view/base/ownerOfCargo/add-or-update-owner-of-cargo.vue
@@ -1,135 +1,135 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('router.sideBar.ownerOfCargo')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.goods_owner_name"
- :label="$t('base.ownerOfCargo.goods_owner_name')"
- :rules="data.rules.goods_owner_name"
- variant="outlined"
- ></v-text-field>
- <v-text-field v-model="data.form.city" :label="$t('base.ownerOfCargo.city')" :rules="data.rules.city" variant="outlined"></v-text-field>
- <v-text-field
- v-model="data.form.address"
- :label="$t('base.ownerOfCargo.address')"
- :rules="data.rules.address"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.manager"
- :label="$t('base.ownerOfCargo.manager')"
- :rules="data.rules.manager"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.contact_tel"
- :label="$t('base.ownerOfCargo.contact_tel')"
- :rules="data.rules.contact_tel"
- variant="outlined"
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { OwnerOfCargoVO } from '@/types/Base/OwnerOfCargo'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addOwnerOfCargo, updateOwnerOfCargo } from '@/api/base/ownerOfCargo'
-import { StringLength } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: OwnerOfCargoVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<OwnerOfCargoVO>({
- id: 0,
- goods_owner_name: '',
- city: '',
- address: '',
- manager: '',
- contact_tel: ''
- }),
- rules: {
- goods_owner_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.ownerOfCargo.goods_owner_name') }!`,
- (val: string) => StringLength(val, 0, 256) === '' || StringLength(val, 0, 256)
- ],
- city: [(val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)],
- address: [(val: string) => StringLength(val, 0, 256) === '' || StringLength(val, 0, 256)],
- manager: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)],
- contact_tel: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)]
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = dialogTitle.value === 'add' ? await addOwnerOfCargo(data.form) : await updateOwnerOfCargo(data.form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('router.sideBar.ownerOfCargo')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.goods_owner_name"
+ :label="$t('base.ownerOfCargo.goods_owner_name')"
+ :rules="data.rules.goods_owner_name"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field v-model="data.form.city" :label="$t('base.ownerOfCargo.city')" :rules="data.rules.city" variant="outlined"></v-text-field>
+ <v-text-field
+ v-model="data.form.address"
+ :label="$t('base.ownerOfCargo.address')"
+ :rules="data.rules.address"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.manager"
+ :label="$t('base.ownerOfCargo.manager')"
+ :rules="data.rules.manager"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.contact_tel"
+ :label="$t('base.ownerOfCargo.contact_tel')"
+ :rules="data.rules.contact_tel"
+ variant="outlined"
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { OwnerOfCargoVO } from '@/types/Base/OwnerOfCargo'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addOwnerOfCargo, updateOwnerOfCargo } from '@/api/base/ownerOfCargo'
+import { StringLength } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: OwnerOfCargoVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<OwnerOfCargoVO>({
+ id: 0,
+ goods_owner_name: '',
+ city: '',
+ address: '',
+ manager: '',
+ contact_tel: ''
+ }),
+ rules: {
+ goods_owner_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.ownerOfCargo.goods_owner_name') }!`,
+ (val: string) => StringLength(val, 0, 256) === '' || StringLength(val, 0, 256)
+ ],
+ city: [(val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)],
+ address: [(val: string) => StringLength(val, 0, 256) === '' || StringLength(val, 0, 256)],
+ manager: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)],
+ contact_tel: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)]
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = dialogTitle.value === 'add' ? await addOwnerOfCargo(data.form) : await updateOwnerOfCargo(data.form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/ownerOfCargo/import-table.vue b/frontend/src/view/base/ownerOfCargo/import-table.vue
index 23d3a35..225dbb0 100644
--- a/frontend/src/view/base/ownerOfCargo/import-table.vue
+++ b/frontend/src/view/base/ownerOfCargo/import-table.vue
@@ -1,215 +1,215 @@
-<!-- OwnerOfCargo Setting Import Dialog -->
-<template>
- <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('system.page.import')}`"></v-toolbar>
- <v-card-text>
- <div class="mb-4">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.chooseFile')" size="x-small" @click="method.chooseFile"></tooltip-btn>
- <tooltip-btn
- icon="mdi-export-variant"
- :tooltip-text="$t('system.page.exportTemplate')"
- size="x-small"
- @click="method.exportTemplate"
- ></tooltip-btn>
- <input v-show="false" id="open" ref="uploadExcel" type="file" accept=".xls, .xlsx" @change="method.readExcel" />
- </div>
- <vxe-table
- ref="xTable"
- :column-config="{ minWidth: '100px' }"
- :data="data.importData"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- :edit-config="{ trigger: 'click', mode: 'cell' }"
- :edit-rules="data.validRules"
- :export-config="{}"
- align="center"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="operate" width="60" :title="$t('system.page.operate')" :resizable="false">
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- <vxe-column field="goods_owner_name" :title="$t('base.ownerOfCargo.goods_owner_name')"></vxe-column>
- <vxe-column field="city" :title="$t('base.ownerOfCargo.city')"></vxe-column>
- <vxe-column field="address" :title="$t('base.ownerOfCargo.address')"></vxe-column>
- <vxe-column field="manager" :title="$t('base.ownerOfCargo.manager')"></vxe-column>
- <vxe-column field="contact_tel" :title="$t('base.ownerOfCargo.contact_tel')"></vxe-column>
- </vxe-table>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { VxeTablePropTypes } from 'vxe-table'
-import * as XLSX from 'xlsx'
-import i18n from '@/languages/i18n'
-import { excelImport } from '@/api/base/ownerOfCargo'
-import { hookComponent } from '@/components/system/index'
-import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { ImportVO } from '@/types/Base/OwnerOfCargo'
-import { exportData } from '@/utils/exportTable'
-import { formatString } from '@/utils/format/formatSystem'
-
-const emit = defineEmits(['close', 'saveSuccess'])
-const uploadExcel = ref()
-const xTable = ref()
-
-const props = defineProps<{
- showDialog: boolean
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- importData: ref<Array<ImportVO>>([]),
- validRules: ref<VxeTablePropTypes.EditRules>({})
-})
-
-const method = reactive({
- initForm: () => {
- data.importData = []
- },
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const isValid = method.valid()
- if (!isValid) {
- return
- }
-
- const $table = xTable.value
- // It must be use 'getTableData()' to get all datas with table because it will delete row sometimes.
- const importData = $table.getTableData().fullData
-
- const { data: res } = await excelImport(importData)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- },
-
- valid: () => {
- const $table = xTable.value
- const importData = $table.getTableData().fullData
-
- if (importData.length <= 0) {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('system.tips.detailLengthIsZero') }`
- })
- return false
- }
- return true
- },
-
- chooseFile: async () => {
- uploadExcel.value.value = ''
- uploadExcel.value.click()
- },
-
- readExcel: async (evnt: any) => {
- const files = evnt.target.files
- if (files.length <= 0) {
- return false
- }
-
- const file = files[0]
- const fileReader = new FileReader()
-
- fileReader.onload = (ev: ProgressEvent<FileReader>) => {
- const fileData = ev?.target?.result
- if (fileData) {
- const workbook = XLSX.read(fileData, { type: 'binary' })
- const wsname = workbook.SheetNames[0]
-
- let ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname])
- let str = JSON.stringify(ws)
- str = str.replace(/(/g, '(')
- str = str.replace(/)/g, ')')
- ws = JSON.parse(str)
-
- data.importData = []
- ws.forEach((value: any, index: number, ws: any) => {
- data.importData.push({
- goods_owner_name: formatString(ws[index][i18n.global.t('base.ownerOfCargo.goods_owner_name')]),
- city: formatString(ws[index][i18n.global.t('base.ownerOfCargo.city')]),
- address: formatString(ws[index][i18n.global.t('base.ownerOfCargo.address')]),
- manager: formatString(ws[index][i18n.global.t('base.ownerOfCargo.manager')]),
- contact_tel: formatString(ws[index][i18n.global.t('base.ownerOfCargo.contact_tel')])
- })
- })
- }
- }
- fileReader.readAsBinaryString(file)
- },
-
- exportTemplate: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.ownerOfCargo'),
- mode: 'header',
- columnFilterMethod({ column }: any) {
- return !['checkbox', 'seq'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
-
- deleteRow: (row: ImportVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
- handleConfirm: async () => {
- if (row) {
- const $table = xTable.value
- $table.remove(row)
- }
- }
- })
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- OwnerOfCargo Setting Import Dialog -->
+<template>
+ <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('system.page.import')}`"></v-toolbar>
+ <v-card-text>
+ <div class="mb-4">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.chooseFile')" size="x-small" @click="method.chooseFile"></tooltip-btn>
+ <tooltip-btn
+ icon="mdi-export-variant"
+ :tooltip-text="$t('system.page.exportTemplate')"
+ size="x-small"
+ @click="method.exportTemplate"
+ ></tooltip-btn>
+ <input v-show="false" id="open" ref="uploadExcel" type="file" accept=".xls, .xlsx" @change="method.readExcel" />
+ </div>
+ <vxe-table
+ ref="xTable"
+ :column-config="{ minWidth: '100px' }"
+ :data="data.importData"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ :edit-config="{ trigger: 'click', mode: 'cell' }"
+ :edit-rules="data.validRules"
+ :export-config="{}"
+ align="center"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="operate" width="60" :title="$t('system.page.operate')" :resizable="false">
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ <vxe-column field="goods_owner_name" :title="$t('base.ownerOfCargo.goods_owner_name')"></vxe-column>
+ <vxe-column field="city" :title="$t('base.ownerOfCargo.city')"></vxe-column>
+ <vxe-column field="address" :title="$t('base.ownerOfCargo.address')"></vxe-column>
+ <vxe-column field="manager" :title="$t('base.ownerOfCargo.manager')"></vxe-column>
+ <vxe-column field="contact_tel" :title="$t('base.ownerOfCargo.contact_tel')"></vxe-column>
+ </vxe-table>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { VxeTablePropTypes } from 'vxe-table'
+import * as XLSX from 'xlsx'
+import i18n from '@/languages/i18n'
+import { excelImport } from '@/api/base/ownerOfCargo'
+import { hookComponent } from '@/components/system/index'
+import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { ImportVO } from '@/types/Base/OwnerOfCargo'
+import { exportData } from '@/utils/exportTable'
+import { formatString } from '@/utils/format/formatSystem'
+
+const emit = defineEmits(['close', 'saveSuccess'])
+const uploadExcel = ref()
+const xTable = ref()
+
+const props = defineProps<{
+ showDialog: boolean
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ importData: ref<Array<ImportVO>>([]),
+ validRules: ref<VxeTablePropTypes.EditRules>({})
+})
+
+const method = reactive({
+ initForm: () => {
+ data.importData = []
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const isValid = method.valid()
+ if (!isValid) {
+ return
+ }
+
+ const $table = xTable.value
+ // It must be use 'getTableData()' to get all datas with table because it will delete row sometimes.
+ const importData = $table.getTableData().fullData
+
+ const { data: res } = await excelImport(importData)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ },
+
+ valid: () => {
+ const $table = xTable.value
+ const importData = $table.getTableData().fullData
+
+ if (importData.length <= 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('system.tips.detailLengthIsZero') }`
+ })
+ return false
+ }
+ return true
+ },
+
+ chooseFile: async () => {
+ uploadExcel.value.value = ''
+ uploadExcel.value.click()
+ },
+
+ readExcel: async (evnt: any) => {
+ const files = evnt.target.files
+ if (files.length <= 0) {
+ return false
+ }
+
+ const file = files[0]
+ const fileReader = new FileReader()
+
+ fileReader.onload = (ev: ProgressEvent<FileReader>) => {
+ const fileData = ev?.target?.result
+ if (fileData) {
+ const workbook = XLSX.read(fileData, { type: 'binary' })
+ const wsname = workbook.SheetNames[0]
+
+ let ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname])
+ let str = JSON.stringify(ws)
+ str = str.replace(/(/g, '(')
+ str = str.replace(/)/g, ')')
+ ws = JSON.parse(str)
+
+ data.importData = []
+ ws.forEach((value: any, index: number, ws: any) => {
+ data.importData.push({
+ goods_owner_name: formatString(ws[index][i18n.global.t('base.ownerOfCargo.goods_owner_name')]),
+ city: formatString(ws[index][i18n.global.t('base.ownerOfCargo.city')]),
+ address: formatString(ws[index][i18n.global.t('base.ownerOfCargo.address')]),
+ manager: formatString(ws[index][i18n.global.t('base.ownerOfCargo.manager')]),
+ contact_tel: formatString(ws[index][i18n.global.t('base.ownerOfCargo.contact_tel')])
+ })
+ })
+ }
+ }
+ fileReader.readAsBinaryString(file)
+ },
+
+ exportTemplate: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.ownerOfCargo'),
+ mode: 'header',
+ columnFilterMethod({ column }: any) {
+ return !['checkbox', 'seq'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+
+ deleteRow: (row: ImportVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
+ handleConfirm: async () => {
+ if (row) {
+ const $table = xTable.value
+ $table.remove(row)
+ }
+ }
+ })
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/ownerOfCargo/ownerOfCargo.vue b/frontend/src/view/base/ownerOfCargo/ownerOfCargo.vue
index 36ed0f2..6bed762 100644
--- a/frontend/src/view/base/ownerOfCargo/ownerOfCargo.vue
+++ b/frontend/src/view/base/ownerOfCargo/ownerOfCargo.vue
@@ -1,279 +1,279 @@
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="12" sm="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
- <tooltip-btn icon="mdi-database-import-outline" :tooltip-text="$t('system.page.import')" @click="method.openDialogImport">
- </tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="12" sm="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"> </v-col>
- <v-col cols="4"> </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.goods_owner_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.ownerOfCargo.goods_owner_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="goods_owner_name" :title="$t('base.ownerOfCargo.goods_owner_name')"></vxe-column>
- <vxe-column field="city" :title="$t('base.ownerOfCargo.city')"></vxe-column>
- <vxe-column field="address" :title="$t('base.ownerOfCargo.address')"></vxe-column>
- <vxe-column field="contact_tel" :title="$t('base.ownerOfCargo.contact_tel')"></vxe-column>
- <vxe-column field="manager" :title="$t('base.ownerOfCargo.manager')"></vxe-column>
- <vxe-column field="creator" :title="$t('base.ownerOfCargo.creator')"></vxe-column>
- <vxe-column field="create_time" :title="$t('base.ownerOfCargo.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-pencil-outline"
- :tooltip-text="$t('system.page.edit')"
- @click="method.editRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- </v-card-text>
- </v-card>
- </div>
- <!-- Add or modify data mode window -->
- <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- <import-table :show-dialog="data.showDialogImport" @close="method.closeDialogImport" @saveSuccess="method.saveSuccessImport" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, reactive, onMounted, ref, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { OwnerOfCargoVO, DataProps } from '@/types/Base/OwnerOfCargo'
-import { getOwnerOfCargoByPage, deleteOwnerOfCargo } from '@/api/base/ownerOfCargo'
-import { hookComponent } from '@/components/system'
-import addOrUpdateDialog from './add-or-update-owner-of-cargo.vue'
-import i18n from '@/languages/i18n'
-import importTable from './import-table.vue'
-import { setSearchObject } from '@/utils/common'
-import customPager from '@/components/custom-pager.vue'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data: DataProps = reactive({
- searchForm: {
- goods_owner_name: ''
- },
- showDialogImport: false,
- tableData: [],
- // Dialog info
- showDialog: false,
- dialogForm: {
- id: 0,
- goods_owner_name: '',
- city: '',
- address: '',
- contact_tel: '',
- manager: ''
- },
- tablePage: {
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE
- },
- timer: null
-})
-
-const method = reactive({
- // When change paging
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
- method.refresh()
- }),
- // Import Dialog
- openDialogImport: () => {
- data.showDialogImport = true
- },
- closeDialogImport: () => {
- data.showDialogImport = false
- },
- saveSuccessImport: () => {
- method.refresh()
- method.closeDialogImport()
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getOwnerOfCargoList()
- },
- // Find Data by Pagination
- getOwnerOfCargoList: async () => {
- const { data: res } = await getOwnerOfCargoByPage(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- // Add user
- add: () => {
- data.dialogForm = {
- id: 0,
- goods_owner_name: '',
- city: '',
- address: '',
- contact_tel: '',
- manager: ''
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // after Add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Refresh data
- refresh: () => {
- method.getOwnerOfCargoList()
- },
- editRow(row: OwnerOfCargoVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: OwnerOfCargoVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteOwnerOfCargo(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // Export table
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.ownerOfCargo'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- }
-})
-
-onMounted(async () => {
- await method.getOwnerOfCargoList()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-
-const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="12" sm="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
+ <tooltip-btn icon="mdi-database-import-outline" :tooltip-text="$t('system.page.import')" @click="method.openDialogImport">
+ </tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="12" sm="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"> </v-col>
+ <v-col cols="4"> </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.goods_owner_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.ownerOfCargo.goods_owner_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="goods_owner_name" :title="$t('base.ownerOfCargo.goods_owner_name')"></vxe-column>
+ <vxe-column field="city" :title="$t('base.ownerOfCargo.city')"></vxe-column>
+ <vxe-column field="address" :title="$t('base.ownerOfCargo.address')"></vxe-column>
+ <vxe-column field="contact_tel" :title="$t('base.ownerOfCargo.contact_tel')"></vxe-column>
+ <vxe-column field="manager" :title="$t('base.ownerOfCargo.manager')"></vxe-column>
+ <vxe-column field="creator" :title="$t('base.ownerOfCargo.creator')"></vxe-column>
+ <vxe-column field="create_time" :title="$t('base.ownerOfCargo.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-pencil-outline"
+ :tooltip-text="$t('system.page.edit')"
+ @click="method.editRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ </v-card-text>
+ </v-card>
+ </div>
+ <!-- Add or modify data mode window -->
+ <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ <import-table :show-dialog="data.showDialogImport" @close="method.closeDialogImport" @saveSuccess="method.saveSuccessImport" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, reactive, onMounted, ref, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { OwnerOfCargoVO, DataProps } from '@/types/Base/OwnerOfCargo'
+import { getOwnerOfCargoByPage, deleteOwnerOfCargo } from '@/api/base/ownerOfCargo'
+import { hookComponent } from '@/components/system'
+import addOrUpdateDialog from './add-or-update-owner-of-cargo.vue'
+import i18n from '@/languages/i18n'
+import importTable from './import-table.vue'
+import { setSearchObject } from '@/utils/common'
+import customPager from '@/components/custom-pager.vue'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data: DataProps = reactive({
+ searchForm: {
+ goods_owner_name: ''
+ },
+ showDialogImport: false,
+ tableData: [],
+ // Dialog info
+ showDialog: false,
+ dialogForm: {
+ id: 0,
+ goods_owner_name: '',
+ city: '',
+ address: '',
+ contact_tel: '',
+ manager: ''
+ },
+ tablePage: {
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE
+ },
+ timer: null
+})
+
+const method = reactive({
+ // When change paging
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+ method.refresh()
+ }),
+ // Import Dialog
+ openDialogImport: () => {
+ data.showDialogImport = true
+ },
+ closeDialogImport: () => {
+ data.showDialogImport = false
+ },
+ saveSuccessImport: () => {
+ method.refresh()
+ method.closeDialogImport()
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getOwnerOfCargoList()
+ },
+ // Find Data by Pagination
+ getOwnerOfCargoList: async () => {
+ const { data: res } = await getOwnerOfCargoByPage(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ // Add user
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ goods_owner_name: '',
+ city: '',
+ address: '',
+ contact_tel: '',
+ manager: ''
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // after Add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getOwnerOfCargoList()
+ },
+ editRow(row: OwnerOfCargoVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: OwnerOfCargoVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteOwnerOfCargo(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Export table
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.ownerOfCargo'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ }
+})
+
+onMounted(async () => {
+ await method.getOwnerOfCargoList()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+
+const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/base/roleMenu/add-or-update-role-menu.vue b/frontend/src/view/base/roleMenu/add-or-update-role-menu.vue
index 7d8b649..918f268 100644
--- a/frontend/src/view/base/roleMenu/add-or-update-role-menu.vue
+++ b/frontend/src/view/base/roleMenu/add-or-update-role-menu.vue
@@ -1,208 +1,209 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card class="formCard">
- <v-toolbar color="white" :title="`${$t('router.sideBar.roleMenu')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-select
- v-model="data.form.userrole_id"
- :items="data.combobox.role_name"
- item-title="label"
- item-value="value"
- :rules="data.rules.role_name"
- :label="$t('base.roleMenu.role_name')"
- variant="outlined"
- clearable
- ></v-select>
- <v-select
- v-model="data.menusSelectedList"
- :items="data.combobox.menu_name"
- item-title="label"
- item-value="value"
- :label="$t('base.roleMenu.menu_name')"
- variant="outlined"
- chips
- multiple
- clearable
- >
- </v-select>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { RoleMenuVO, RoleMenuDetailVo } from '@/types/Base/RoleMenu'
-import { UserRoleVO } from '@/types/Base/UserRoleSetting'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addRoleMenu, updateRoleMenu, getMenus } from '@/api/base/roleMenu'
-import { getUserRoleAll } from '@/api/base/userRoleSetting'
-import { MenuItem } from '@/types/System/Store'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: RoleMenuVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- dialogTitle: '',
- form: ref<RoleMenuVO>({
- userrole_id: 0,
- role_name: '',
- detailList: []
- }),
- // Multiple drop-down box values, mainly used to temporarily save the selected values
- menusSelectedList: ref<any[]>([]),
- // If it is modified, you need to pass a negative ID to the API to delete the existing details
- removeDetailList: ref<RoleMenuDetailVo[]>([]),
- // Drop down box options
- combobox: ref<{
- role_name: {
- label: string
- value: number
- }[]
- menu_name: {
- label: string
- value: number
- }[]
- }>({
- role_name: [],
- menu_name: []
- }),
- rules: {
- role_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.roleMenu.role_name') }!`],
- menu_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.roleMenu.menu_name') }!`]
- }
-})
-
-const method = reactive({
- // Get dialog type, add or update
- getDialogType: () => {
- // This is special because this document is not actually a table,
- // but the data associated with another table.
- // so directly use the details to determine whether it is a new document
- if (props.form.detailList.length > 0) {
- data.dialogTitle = 'update'
- } else {
- data.dialogTitle = 'add'
- }
- },
- // Get the options required by the drop-down box
- getCombobox: async () => {
- data.combobox.role_name = []
- const { data: res } = await getUserRoleAll()
- if (!res.isSuccess) {
- return
- }
- const roleNameList: UserRoleVO[] = res.data
- for (const role of roleNameList) {
- data.combobox.role_name.push({
- label: role.role_name,
- value: role.id
- })
- }
- data.combobox.menu_name = []
- const { data: menuRes } = await getMenus()
- if (!menuRes.isSuccess) {
- return
- }
- const menus: MenuItem[] = menuRes.data
- for (const menu of menus) {
- data.combobox.menu_name.push({
- label: i18n.global.t(`router.sideBar.${ menu.menu_name }`),
- value: menu.id
- })
- }
- },
- closeDialog: () => {
- emit('close')
- },
- // Details verification before document submission
- beforeSubmit: (): boolean => {
- let flag = true
- // Process the new dropdown options
- for (const item of data.menusSelectedList) {
- if (data.form.detailList.findIndex((dl) => dl.menu_id === item) < 0) {
- data.form.detailList.push({
- id: 0,
- menu_id: item
- })
- }
- }
- if (data.dialogTitle === 'update') {
- for (const item of data.form.detailList) {
- if (!data.menusSelectedList.includes(item.menu_id)) {
- // Delete if ID is negative
- item.id = -item.id
- }
- }
- }
- if (data.form.detailList.length === 0) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.tips.detailLengthIsZero')
- })
- flag = false
- }
- return flag
- },
- submit: async () => {
- const beforeSubmitFlag = method.beforeSubmit()
- if (!beforeSubmitFlag) {
- return
- }
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = data.dialogTitle === 'add'
- ? await addRoleMenu(data.form)
- : await updateRoleMenu({ ...data.form, detailList: [...data.form.detailList, ...data.removeDetailList] }) // Merge the deleted list and the original list
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.getDialogType()
- method.getCombobox()
- data.form = props.form
- data.menusSelectedList = data.form.detailList.map((item) => item.menu_id)
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card class="formCard">
+ <v-toolbar color="white" :title="`${$t('router.sideBar.roleMenu')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-select
+ v-model="data.form.userrole_id"
+ :items="data.combobox.role_name"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.role_name"
+ :label="$t('base.roleMenu.role_name')"
+ variant="outlined"
+ clearable
+ ></v-select>
+ <v-select
+ v-model="data.menusSelectedList"
+ :items="data.combobox.menu_name"
+ :menu-props="{ maxHeight: 400 }"
+ item-title="label"
+ item-value="value"
+ :label="$t('base.roleMenu.menu_name')"
+ variant="outlined"
+ chips
+ multiple
+ clearable
+ >
+ </v-select>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { RoleMenuVO, RoleMenuDetailVo } from '@/types/Base/RoleMenu'
+import { UserRoleVO } from '@/types/Base/UserRoleSetting'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addRoleMenu, updateRoleMenu, getMenus } from '@/api/base/roleMenu'
+import { getUserRoleAll } from '@/api/base/userRoleSetting'
+import { MenuItem } from '@/types/System/Store'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: RoleMenuVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ dialogTitle: '',
+ form: ref<RoleMenuVO>({
+ userrole_id: 0,
+ role_name: '',
+ detailList: []
+ }),
+ // Multiple drop-down box values, mainly used to temporarily save the selected values
+ menusSelectedList: ref<any[]>([]),
+ // If it is modified, you need to pass a negative ID to the API to delete the existing details
+ removeDetailList: ref<RoleMenuDetailVo[]>([]),
+ // Drop down box options
+ combobox: ref<{
+ role_name: {
+ label: string
+ value: number
+ }[]
+ menu_name: {
+ label: string
+ value: number
+ }[]
+ }>({
+ role_name: [],
+ menu_name: []
+ }),
+ rules: {
+ role_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.roleMenu.role_name') }!`],
+ menu_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.roleMenu.menu_name') }!`]
+ }
+})
+
+const method = reactive({
+ // Get dialog type, add or update
+ getDialogType: () => {
+ // This is special because this document is not actually a table,
+ // but the data associated with another table.
+ // so directly use the details to determine whether it is a new document
+ if (props.form.detailList.length > 0) {
+ data.dialogTitle = 'update'
+ } else {
+ data.dialogTitle = 'add'
+ }
+ },
+ // Get the options required by the drop-down box
+ getCombobox: async () => {
+ data.combobox.role_name = []
+ const { data: res } = await getUserRoleAll()
+ if (!res.isSuccess) {
+ return
+ }
+ const roleNameList: UserRoleVO[] = res.data
+ for (const role of roleNameList) {
+ data.combobox.role_name.push({
+ label: role.role_name,
+ value: role.id
+ })
+ }
+ data.combobox.menu_name = []
+ const { data: menuRes } = await getMenus()
+ if (!menuRes.isSuccess) {
+ return
+ }
+ const menus: MenuItem[] = menuRes.data
+ for (const menu of menus) {
+ data.combobox.menu_name.push({
+ label: i18n.global.t(`router.sideBar.${ menu.menu_name }`),
+ value: menu.id
+ })
+ }
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ // Details verification before document submission
+ beforeSubmit: (): boolean => {
+ let flag = true
+ // Process the new dropdown options
+ for (const item of data.menusSelectedList) {
+ if (data.form.detailList.findIndex((dl) => dl.menu_id === item) < 0) {
+ data.form.detailList.push({
+ id: 0,
+ menu_id: item
+ })
+ }
+ }
+ if (data.dialogTitle === 'update') {
+ for (const item of data.form.detailList) {
+ if (!data.menusSelectedList.includes(item.menu_id)) {
+ // Delete if ID is negative
+ item.id = -item.id
+ }
+ }
+ }
+ if (data.form.detailList.length === 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.tips.detailLengthIsZero')
+ })
+ flag = false
+ }
+ return flag
+ },
+ submit: async () => {
+ const beforeSubmitFlag = method.beforeSubmit()
+ if (!beforeSubmitFlag) {
+ return
+ }
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = data.dialogTitle === 'add'
+ ? await addRoleMenu(data.form)
+ : await updateRoleMenu({ ...data.form, detailList: [...data.form.detailList, ...data.removeDetailList] }) // Merge the deleted list and the original list
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.getDialogType()
+ method.getCombobox()
+ data.form = props.form
+ data.menusSelectedList = data.form.detailList.map((item) => item.menu_id)
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+</style>
diff --git a/frontend/src/view/base/roleMenu/roleMenu.vue b/frontend/src/view/base/roleMenu/roleMenu.vue
index aa526f8..35a7cb1 100644
--- a/frontend/src/view/base/roleMenu/roleMenu.vue
+++ b/frontend/src/view/base/roleMenu/roleMenu.vue
@@ -1,321 +1,321 @@
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="12" sm="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
- <tooltip-btn icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editForm()"></tooltip-btn>
- <tooltip-btn icon="mdi-delete-outline" :tooltip-text="$t('system.page.delete')" @click="method.deleteForm()"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
- <!-- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn> -->
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="12" sm="9">
- <!-- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.userName"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.userName1"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.userName2"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row> -->
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <v-row :no-gutters="true">
- <v-col :cols="3" class="dataListCol">
- <v-card :height="tableHeight">
- <NavListVue
- :list-data="data.roleList"
- :title="data.navListOptions.title"
- :label-key="data.navListOptions.labelKey"
- :index-key="data.navListOptions.indexKey"
- :index-value="data.navListOptions.indexValue"
- @item-click="method.navListClick"
- />
- </v-card>
- </v-col>
- <v-col :cols="9">
- <vxe-table ref="xTable" :data="data.activeRoleMenuForm.detailList" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="menu_name" :title="$t('base.roleMenu.menu_name')">
- <template #default="{ row }">
- <span>{{ $t(`router.sideBar.${row.menu_name}`) }}</span>
- </template>
- </vxe-column>
- </vxe-table>
- </v-col>
- </v-row>
- </div>
- </v-card-text>
- </v-card>
- </div>
- <!-- Add or modify data mode window -->
- <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, reactive, onMounted, ref } from 'vue'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { DataProps, RoleMenuVO } from '@/types/Base/RoleMenu'
-import { getRoleMenuAll, getRoleMenuById, deleteRoleMenu } from '@/api/base/roleMenu'
-import { hookComponent } from '@/components/system'
-import addOrUpdateDialog from './add-or-update-role-menu.vue'
-import i18n from '@/languages/i18n'
-import NavListVue from '@/components/page/nav-list.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-const data: DataProps = reactive({
- navListOptions: {
- title: i18n.global.t('base.roleMenu.role_name'),
- labelKey: 'role_name',
- indexKey: 'userrole_id',
- indexValue: ''
- },
- // Activation id
- activeRoleMenuForm: {
- userrole_id: 0,
- role_name: '',
- detailList: []
- },
- // searchForm: {
- // userName: '',
- // userName1: '',
- // userName2: ''
- // },
- roleList: [],
- // Dialog info
- showDialog: false,
- dialogForm: {
- detailList: []
- }
-})
-
-const method = reactive({
- sureSearch: () => {
- // console.log(data.searchForm)
- },
- // Find Data by Pagination
- getCompanyList: async () => {
- // Clear detailed data before refreshing
- method.clearDialogForm()
- const { data: res } = await getRoleMenuAll()
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.roleList = res.data
- if (data.roleList.findIndex((item) => item.userrole_id === data.activeRoleMenuForm.userrole_id) > -1 && data.activeRoleMenuForm.userrole_id) {
- method.getRoleMenus(data.activeRoleMenuForm.userrole_id)
- } else if (data.roleList.length > 0) {
- method.navListClick(data.roleList[0])
- } else {
- data.activeRoleMenuForm = {
- userrole_id: 0,
- role_name: '',
- detailList: []
- }
- }
- },
- // Add user
- add: () => {
- method.clearDialogForm()
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // after Add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Refresh data
- refresh: () => {
- method.getCompanyList()
- },
- editForm() {
- if (!data.activeRoleMenuForm.userrole_id) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('base.roleMenu.beforeUpdateOrDel')
- })
- return
- }
- data.dialogForm = JSON.parse(JSON.stringify(data.activeRoleMenuForm))
- // Delete rowid of existing data
- for (const item of data.dialogForm.detailList) {
- if (item._X_ROW_KEY) {
- delete item._X_ROW_KEY
- }
- }
- data.showDialog = true
- },
- deleteForm() {
- if (!data.activeRoleMenuForm.userrole_id) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('base.roleMenu.beforeUpdateOrDel')
- })
- return
- }
- const row = data.activeRoleMenuForm
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.userrole_id) {
- const { data: res } = await deleteRoleMenu(row.userrole_id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // Export table
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.roleMenu'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- // Get detailed data
- getRoleMenus: async (userrole_id: number) => {
- const { data: res } = await getRoleMenuById(userrole_id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.activeRoleMenuForm = res.data
- },
- // Refresh dialog data
- clearDialogForm: () => {
- data.dialogForm = {
- detailList: []
- }
- },
- // Click navList
- navListClick: (item: RoleMenuVO) => {
- if (!item.userrole_id) {
- return
- }
- data.navListOptions.indexValue = String(item.userrole_id)
- method.getRoleMenus(item.userrole_id)
- }
-})
-
-onMounted(async () => {
- await method.getCompanyList()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-
-const tableHeight = computed(() => computedTableHeight({ hasTab: false, hasPager: false }))
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-// Adjust the spacing between lists and tables
-.dataListCol {
- box-sizing: border-box;
- padding-right: 10px !important;
-}
-.roleNameCol {
- width: 100%;
- height: 100%;
- cursor: pointer;
- // &:hover: {
- // background-color: #9156fd;
- // }
-}
-.roleNameCol:hover {
- background-color: #9156fd;
- color: white;
-}
-.activeRow {
- background-color: #9156fd;
-}
-</style>
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="12" sm="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
+ <tooltip-btn icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editForm()"></tooltip-btn>
+ <tooltip-btn icon="mdi-delete-outline" :tooltip-text="$t('system.page.delete')" @click="method.deleteForm()"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
+ <!-- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn> -->
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="12" sm="9">
+ <!-- <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.userName"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.userName1"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.userName2"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row> -->
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <v-row :no-gutters="true">
+ <v-col :cols="3" class="dataListCol">
+ <v-card :height="tableHeight">
+ <NavListVue
+ :list-data="data.roleList"
+ :title="data.navListOptions.title"
+ :label-key="data.navListOptions.labelKey"
+ :index-key="data.navListOptions.indexKey"
+ :index-value="data.navListOptions.indexValue"
+ @item-click="method.navListClick"
+ />
+ </v-card>
+ </v-col>
+ <v-col :cols="9">
+ <vxe-table ref="xTable" :data="data.activeRoleMenuForm.detailList" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="menu_name" :title="$t('base.roleMenu.menu_name')">
+ <template #default="{ row }">
+ <span>{{ $t(`router.sideBar.${row.menu_name}`) }}</span>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ </v-col>
+ </v-row>
+ </div>
+ </v-card-text>
+ </v-card>
+ </div>
+ <!-- Add or modify data mode window -->
+ <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, reactive, onMounted, ref } from 'vue'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { DataProps, RoleMenuVO } from '@/types/Base/RoleMenu'
+import { getRoleMenuAll, getRoleMenuById, deleteRoleMenu } from '@/api/base/roleMenu'
+import { hookComponent } from '@/components/system'
+import addOrUpdateDialog from './add-or-update-role-menu.vue'
+import i18n from '@/languages/i18n'
+import NavListVue from '@/components/page/nav-list.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+const data: DataProps = reactive({
+ navListOptions: {
+ title: i18n.global.t('base.roleMenu.role_name'),
+ labelKey: 'role_name',
+ indexKey: 'userrole_id',
+ indexValue: ''
+ },
+ // Activation id
+ activeRoleMenuForm: {
+ userrole_id: 0,
+ role_name: '',
+ detailList: []
+ },
+ // searchForm: {
+ // userName: '',
+ // userName1: '',
+ // userName2: ''
+ // },
+ roleList: [],
+ // Dialog info
+ showDialog: false,
+ dialogForm: {
+ detailList: []
+ }
+})
+
+const method = reactive({
+ sureSearch: () => {
+ // console.log(data.searchForm)
+ },
+ // Find Data by Pagination
+ getCompanyList: async () => {
+ // Clear detailed data before refreshing
+ method.clearDialogForm()
+ const { data: res } = await getRoleMenuAll()
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.roleList = res.data
+ if (data.roleList.findIndex((item) => item.userrole_id === data.activeRoleMenuForm.userrole_id) > -1 && data.activeRoleMenuForm.userrole_id) {
+ method.getRoleMenus(data.activeRoleMenuForm.userrole_id)
+ } else if (data.roleList.length > 0) {
+ method.navListClick(data.roleList[0])
+ } else {
+ data.activeRoleMenuForm = {
+ userrole_id: 0,
+ role_name: '',
+ detailList: []
+ }
+ }
+ },
+ // Add user
+ add: () => {
+ method.clearDialogForm()
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // after Add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getCompanyList()
+ },
+ editForm() {
+ if (!data.activeRoleMenuForm.userrole_id) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('base.roleMenu.beforeUpdateOrDel')
+ })
+ return
+ }
+ data.dialogForm = JSON.parse(JSON.stringify(data.activeRoleMenuForm))
+ // Delete rowid of existing data
+ for (const item of data.dialogForm.detailList) {
+ if (item._X_ROW_KEY) {
+ delete item._X_ROW_KEY
+ }
+ }
+ data.showDialog = true
+ },
+ deleteForm() {
+ if (!data.activeRoleMenuForm.userrole_id) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('base.roleMenu.beforeUpdateOrDel')
+ })
+ return
+ }
+ const row = data.activeRoleMenuForm
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.userrole_id) {
+ const { data: res } = await deleteRoleMenu(row.userrole_id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Export table
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.roleMenu'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ // Get detailed data
+ getRoleMenus: async (userrole_id: number) => {
+ const { data: res } = await getRoleMenuById(userrole_id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.activeRoleMenuForm = res.data
+ },
+ // Refresh dialog data
+ clearDialogForm: () => {
+ data.dialogForm = {
+ detailList: []
+ }
+ },
+ // Click navList
+ navListClick: (item: RoleMenuVO) => {
+ if (!item.userrole_id) {
+ return
+ }
+ data.navListOptions.indexValue = String(item.userrole_id)
+ method.getRoleMenus(item.userrole_id)
+ }
+})
+
+onMounted(async () => {
+ await method.getCompanyList()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+
+const tableHeight = computed(() => computedTableHeight({ hasTab: false, hasPager: false }))
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+// Adjust the spacing between lists and tables
+.dataListCol {
+ box-sizing: border-box;
+ padding-right: 10px !important;
+}
+.roleNameCol {
+ width: 100%;
+ height: 100%;
+ cursor: pointer;
+ // &:hover: {
+ // background-color: #9156fd;
+ // }
+}
+.roleNameCol:hover {
+ background-color: #9156fd;
+ color: white;
+}
+.activeRow {
+ background-color: #9156fd;
+}
+</style>
diff --git a/frontend/src/view/base/supplier/add-or-update-supplier.vue b/frontend/src/view/base/supplier/add-or-update-supplier.vue
index da9ad91..47b5a0d 100644
--- a/frontend/src/view/base/supplier/add-or-update-supplier.vue
+++ b/frontend/src/view/base/supplier/add-or-update-supplier.vue
@@ -1,136 +1,136 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('router.sideBar.supplier')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.supplier_name"
- :label="$t('base.supplier.supplier_name')"
- :rules="data.rules.supplier_name"
- variant="outlined"
- ></v-text-field>
- <v-text-field v-model="data.form.city" :label="$t('base.supplier.city')" :rules="data.rules.city" variant="outlined"></v-text-field>
- <v-text-field v-model="data.form.email" :label="$t('base.supplier.email')" :rules="data.rules.email" variant="outlined"></v-text-field>
- <v-text-field
- v-model="data.form.address"
- :label="$t('base.supplier.address')"
- :rules="data.rules.address"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.manager"
- :label="$t('base.supplier.manager')"
- :rules="data.rules.manager"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.contact_tel"
- :label="$t('base.supplier.contact_tel')"
- :rules="data.rules.contact_tel"
- variant="outlined"
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { SupplierVO } from '@/types/Base/Supplier'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addSupplier, updateSupplier } from '@/api/base/supplier'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: SupplierVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<SupplierVO>({
- id: 0,
- supplier_name: '',
- city: '',
- address: '',
- manager: '',
- email: '',
- contact_tel: '',
- is_valid: true
- }),
- rules: {
- supplier_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.supplier.supplier_name') }!`],
- city: [],
- address: [],
- manager: [],
- email: [],
- contact_tel: [],
- is_valid: []
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = dialogTitle.value === 'add' ? await addSupplier(data.form) : await updateSupplier(data.form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('router.sideBar.supplier')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.supplier_name"
+ :label="$t('base.supplier.supplier_name')"
+ :rules="data.rules.supplier_name"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field v-model="data.form.city" :label="$t('base.supplier.city')" :rules="data.rules.city" variant="outlined"></v-text-field>
+ <v-text-field v-model="data.form.email" :label="$t('base.supplier.email')" :rules="data.rules.email" variant="outlined"></v-text-field>
+ <v-text-field
+ v-model="data.form.address"
+ :label="$t('base.supplier.address')"
+ :rules="data.rules.address"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.manager"
+ :label="$t('base.supplier.manager')"
+ :rules="data.rules.manager"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.contact_tel"
+ :label="$t('base.supplier.contact_tel')"
+ :rules="data.rules.contact_tel"
+ variant="outlined"
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { SupplierVO } from '@/types/Base/Supplier'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addSupplier, updateSupplier } from '@/api/base/supplier'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: SupplierVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<SupplierVO>({
+ id: 0,
+ supplier_name: '',
+ city: '',
+ address: '',
+ manager: '',
+ email: '',
+ contact_tel: '',
+ is_valid: true
+ }),
+ rules: {
+ supplier_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.supplier.supplier_name') }!`],
+ city: [],
+ address: [],
+ manager: [],
+ email: [],
+ contact_tel: [],
+ is_valid: []
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = dialogTitle.value === 'add' ? await addSupplier(data.form) : await updateSupplier(data.form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/supplier/import-supplier-table.vue b/frontend/src/view/base/supplier/import-supplier-table.vue
index a0853ab..2d5bc32 100644
--- a/frontend/src/view/base/supplier/import-supplier-table.vue
+++ b/frontend/src/view/base/supplier/import-supplier-table.vue
@@ -1,216 +1,216 @@
-<!-- Supplier Setting Import Dialog -->
-<template>
- <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('system.page.import')}`"></v-toolbar>
- <v-card-text>
- <div class="mb-4">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.chooseFile')" size="x-small" @click="method.chooseFile"></tooltip-btn>
- <tooltip-btn
- icon="mdi-export-variant"
- :tooltip-text="$t('system.page.exportTemplate')"
- size="x-small"
- @click="method.exportTemplate"
- ></tooltip-btn>
- <input v-show="false" id="open" ref="uploadExcel" type="file" accept=".xls, .xlsx" @change="method.readExcel" />
- </div>
- <vxe-table
- ref="xTable"
- :column-config="{ minWidth: '100px' }"
- :data="data.importData"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- :edit-config="{ trigger: 'click', mode: 'cell' }"
- :edit-rules="data.validRules"
- :export-config="{}"
- align="center"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="operate" width="60" :title="$t('system.page.operate')" :resizable="false">
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- <vxe-column field="supplier_name" :title="$t('base.supplier.supplier_name')"></vxe-column>
- <vxe-column field="city" :title="$t('base.supplier.city')"></vxe-column>
- <vxe-column field="address" :title="$t('base.supplier.address')"></vxe-column>
- <vxe-column field="manager" :title="$t('base.supplier.manager')"></vxe-column>
- <vxe-column field="email" :title="$t('base.supplier.email')"></vxe-column>
- <vxe-column field="contact_tel" :title="$t('base.supplier.contact_tel')"></vxe-column>
- </vxe-table>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { VxeTablePropTypes } from 'vxe-table'
-import * as XLSX from 'xlsx'
-import i18n from '@/languages/i18n'
-import { excelImport } from '@/api/base/supplier'
-import { hookComponent } from '@/components/system/index'
-import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { SupplierExcelVO } from '@/types/Base/Supplier'
-import { exportData } from '@/utils/exportTable'
-
-const emit = defineEmits(['close', 'saveSuccess'])
-const uploadExcel = ref()
-const xTable = ref()
-
-const props = defineProps<{
- showDialog: boolean
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- importData: ref<Array<SupplierExcelVO>>([]),
- validRules: ref<VxeTablePropTypes.EditRules>({})
-})
-
-const method = reactive({
- initForm: () => {
- data.importData = []
- },
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const isValid = method.valid()
- if (!isValid) {
- return
- }
-
- const $table = xTable.value
- // It must be use 'getTableData()' to get all datas with table because it will delete row sometimes.
- const importData = $table.getTableData().fullData
-
- const { data: res } = await excelImport(importData)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- },
-
- valid: () => {
- const $table = xTable.value
- const importData = $table.getTableData().fullData
-
- if (importData.length <= 0) {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('system.tips.detailLengthIsZero') }`
- })
- return false
- }
- return true
- },
-
- chooseFile: async () => {
- uploadExcel.value.value = ''
- uploadExcel.value.click()
- },
-
- readExcel: async (evnt: any) => {
- const files = evnt.target.files
- if (files.length <= 0) {
- return false
- }
-
- const file = files[0]
- const fileReader = new FileReader()
-
- fileReader.onload = (ev: ProgressEvent<FileReader>) => {
- const fileData = ev?.target?.result
- if (fileData) {
- const workbook = XLSX.read(fileData, { type: 'binary' })
- const wsname = workbook.SheetNames[0]
-
- let ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname])
- let str = JSON.stringify(ws)
- str = str.replace(/(/g, '(')
- str = str.replace(/)/g, ')')
- ws = JSON.parse(str)
-
- data.importData = []
- ws.forEach((value: any, index: number, ws: any) => {
- data.importData.push({
- supplier_name: ws[index][i18n.global.t('base.supplier.supplier_name')] ? ws[index][i18n.global.t('base.supplier.supplier_name')] + '' : '',
- city: ws[index][i18n.global.t('base.supplier.city')] ? ws[index][i18n.global.t('base.supplier.city')] + '' : '',
- address: ws[index][i18n.global.t('base.supplier.address')] ? ws[index][i18n.global.t('base.supplier.address')] + '' : '',
- manager: ws[index][i18n.global.t('base.supplier.manager')] ? ws[index][i18n.global.t('base.supplier.manager')] + '' : '',
- email: ws[index][i18n.global.t('base.supplier.email')] ? ws[index][i18n.global.t('base.supplier.email')] + '' : '',
- contact_tel: ws[index][i18n.global.t('base.supplier.contact_tel')] ? ws[index][i18n.global.t('base.supplier.contact_tel')] + '' : ''
- })
- })
- }
- }
- fileReader.readAsBinaryString(file)
- },
-
- exportTemplate: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.supplier'),
- mode: 'header',
- columnFilterMethod({ column }: any) {
- return !['checkbox', 'seq'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
-
- deleteRow: (row: SupplierExcelVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
- handleConfirm: async () => {
- if (row) {
- const $table = xTable.value
- $table.remove(row)
- }
- }
- })
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- Supplier Setting Import Dialog -->
+<template>
+ <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('system.page.import')}`"></v-toolbar>
+ <v-card-text>
+ <div class="mb-4">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.chooseFile')" size="x-small" @click="method.chooseFile"></tooltip-btn>
+ <tooltip-btn
+ icon="mdi-export-variant"
+ :tooltip-text="$t('system.page.exportTemplate')"
+ size="x-small"
+ @click="method.exportTemplate"
+ ></tooltip-btn>
+ <input v-show="false" id="open" ref="uploadExcel" type="file" accept=".xls, .xlsx" @change="method.readExcel" />
+ </div>
+ <vxe-table
+ ref="xTable"
+ :column-config="{ minWidth: '100px' }"
+ :data="data.importData"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ :edit-config="{ trigger: 'click', mode: 'cell' }"
+ :edit-rules="data.validRules"
+ :export-config="{}"
+ align="center"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="operate" width="60" :title="$t('system.page.operate')" :resizable="false">
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ <vxe-column field="supplier_name" :title="$t('base.supplier.supplier_name')"></vxe-column>
+ <vxe-column field="city" :title="$t('base.supplier.city')"></vxe-column>
+ <vxe-column field="address" :title="$t('base.supplier.address')"></vxe-column>
+ <vxe-column field="manager" :title="$t('base.supplier.manager')"></vxe-column>
+ <vxe-column field="email" :title="$t('base.supplier.email')"></vxe-column>
+ <vxe-column field="contact_tel" :title="$t('base.supplier.contact_tel')"></vxe-column>
+ </vxe-table>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { VxeTablePropTypes } from 'vxe-table'
+import * as XLSX from 'xlsx'
+import i18n from '@/languages/i18n'
+import { excelImport } from '@/api/base/supplier'
+import { hookComponent } from '@/components/system/index'
+import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { SupplierExcelVO } from '@/types/Base/Supplier'
+import { exportData } from '@/utils/exportTable'
+
+const emit = defineEmits(['close', 'saveSuccess'])
+const uploadExcel = ref()
+const xTable = ref()
+
+const props = defineProps<{
+ showDialog: boolean
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ importData: ref<Array<SupplierExcelVO>>([]),
+ validRules: ref<VxeTablePropTypes.EditRules>({})
+})
+
+const method = reactive({
+ initForm: () => {
+ data.importData = []
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const isValid = method.valid()
+ if (!isValid) {
+ return
+ }
+
+ const $table = xTable.value
+ // It must be use 'getTableData()' to get all datas with table because it will delete row sometimes.
+ const importData = $table.getTableData().fullData
+
+ const { data: res } = await excelImport(importData)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ },
+
+ valid: () => {
+ const $table = xTable.value
+ const importData = $table.getTableData().fullData
+
+ if (importData.length <= 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('system.tips.detailLengthIsZero') }`
+ })
+ return false
+ }
+ return true
+ },
+
+ chooseFile: async () => {
+ uploadExcel.value.value = ''
+ uploadExcel.value.click()
+ },
+
+ readExcel: async (evnt: any) => {
+ const files = evnt.target.files
+ if (files.length <= 0) {
+ return false
+ }
+
+ const file = files[0]
+ const fileReader = new FileReader()
+
+ fileReader.onload = (ev: ProgressEvent<FileReader>) => {
+ const fileData = ev?.target?.result
+ if (fileData) {
+ const workbook = XLSX.read(fileData, { type: 'binary' })
+ const wsname = workbook.SheetNames[0]
+
+ let ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname])
+ let str = JSON.stringify(ws)
+ str = str.replace(/(/g, '(')
+ str = str.replace(/)/g, ')')
+ ws = JSON.parse(str)
+
+ data.importData = []
+ ws.forEach((value: any, index: number, ws: any) => {
+ data.importData.push({
+ supplier_name: ws[index][i18n.global.t('base.supplier.supplier_name')] ? ws[index][i18n.global.t('base.supplier.supplier_name')] + '' : '',
+ city: ws[index][i18n.global.t('base.supplier.city')] ? ws[index][i18n.global.t('base.supplier.city')] + '' : '',
+ address: ws[index][i18n.global.t('base.supplier.address')] ? ws[index][i18n.global.t('base.supplier.address')] + '' : '',
+ manager: ws[index][i18n.global.t('base.supplier.manager')] ? ws[index][i18n.global.t('base.supplier.manager')] + '' : '',
+ email: ws[index][i18n.global.t('base.supplier.email')] ? ws[index][i18n.global.t('base.supplier.email')] + '' : '',
+ contact_tel: ws[index][i18n.global.t('base.supplier.contact_tel')] ? ws[index][i18n.global.t('base.supplier.contact_tel')] + '' : ''
+ })
+ })
+ }
+ }
+ fileReader.readAsBinaryString(file)
+ },
+
+ exportTemplate: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.supplier'),
+ mode: 'header',
+ columnFilterMethod({ column }: any) {
+ return !['checkbox', 'seq'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+
+ deleteRow: (row: SupplierExcelVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
+ handleConfirm: async () => {
+ if (row) {
+ const $table = xTable.value
+ $table.remove(row)
+ }
+ }
+ })
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/supplier/supplier.vue b/frontend/src/view/base/supplier/supplier.vue
index 6ab00b3..5f57e17 100644
--- a/frontend/src/view/base/supplier/supplier.vue
+++ b/frontend/src/view/base/supplier/supplier.vue
@@ -1,296 +1,296 @@
-<!-- supplier Setting -->
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <!-- <v-window v-model="data.activeTab">
- <v-window-item> -->
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="12" sm="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
- <tooltip-btn icon="mdi-database-import-outline" :tooltip-text="$t('system.page.import')" @click="method.openDialogImport">
- </tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="12" sm="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="12" sm="4"></v-col>
- <v-col cols="12" sm="4"></v-col>
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.supplier_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.supplier.supplier_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="supplier_name" :title="$t('base.supplier.supplier_name')"></vxe-column>
- <vxe-column field="city" :title="$t('base.supplier.city')"></vxe-column>
- <vxe-column field="address" :title="$t('base.supplier.address')"></vxe-column>
- <vxe-column field="manager" :title="$t('base.supplier.manager')"></vxe-column>
- <vxe-column field="email" :title="$t('base.supplier.email')"></vxe-column>
- <vxe-column field="contact_tel" :title="$t('base.supplier.contact_tel')"></vxe-column>
- <vxe-column field="creator" :title="$t('base.supplier.creator')"></vxe-column>
- <vxe-column field="create_time" :title="$t('base.supplier.create_time')">
- <template #default="{ row, column }">
- <span>{{ formatDate(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="last_update_time" :title="$t('base.supplier.last_update_time')">
- <template #default="{ row, column }">
- <span>{{ formatDate(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-pencil-outline"
- :tooltip-text="$t('system.page.edit')"
- @click="method.editRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <!-- </v-window-item>
- </v-window> -->
- </v-card-text>
- </v-card>
- </div>
- </div>
- <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- <importSupplierTable :show-dialog="data.showDialogImport" @close="method.closeDialogImport" @saveSuccess="method.saveSuccessImport" />
-</template>
-
-<script lang="tsx" setup>
-import { computed, ref, reactive, onMounted, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { SupplierVO, DataProps } from '@/types/Base/Supplier'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import addOrUpdateDialog from './add-or-update-supplier.vue'
-import { hookComponent } from '@/components/system'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import i18n from '@/languages/i18n'
-import { getSupplierList, deleteSupplier } from '@/api/base/supplier'
-import importSupplierTable from './import-supplier-table.vue'
-import { formatDate } from '@/utils/format/formatSystem'
-import customPager from '@/components/custom-pager.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-const data = reactive({
- searchForm: {
- supplier_name: ''
- },
- tableData: [],
- // activeTab: null,
- showDialog: false,
- showDialogImport: false,
- dialogForm: {
- id: 0,
- supplier_name: '',
- city: '',
- address: '',
- manager: '',
- email: '',
- contact_tel: '',
- is_valid: true
- },
- tablePage: {
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- },
- timer: ref<any>(null)
-})
-
-const method = reactive({
- // Import Dialog
- openDialogImport: () => {
- data.showDialogImport = true
- },
- closeDialogImport: () => {
- data.showDialogImport = false
- },
- saveSuccessImport: () => {
- method.refresh()
- method.closeDialog()
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getData()
- },
- // Add user
- add: () => {
- data.dialogForm = {
- id: 0,
- supplier_name: '',
- city: '',
- address: '',
- manager: '',
- email: '',
- contact_tel: '',
- is_valid: true
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // after Add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Refresh data
- refresh: () => {
- method.getData()
- },
- editRow(row: SupplierVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: SupplierVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteSupplier(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
- method.getData()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.supplier'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- getData: async () => {
- const { data: res } = await getSupplierList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- }
-})
-onMounted(() => {
- method.getData()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<!-- supplier Setting -->
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <!-- <v-window v-model="data.activeTab">
+ <v-window-item> -->
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="12" sm="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
+ <tooltip-btn icon="mdi-database-import-outline" :tooltip-text="$t('system.page.import')" @click="method.openDialogImport">
+ </tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="12" sm="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="12" sm="4"></v-col>
+ <v-col cols="12" sm="4"></v-col>
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.supplier_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.supplier.supplier_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="supplier_name" :title="$t('base.supplier.supplier_name')"></vxe-column>
+ <vxe-column field="city" :title="$t('base.supplier.city')"></vxe-column>
+ <vxe-column field="address" :title="$t('base.supplier.address')"></vxe-column>
+ <vxe-column field="manager" :title="$t('base.supplier.manager')"></vxe-column>
+ <vxe-column field="email" :title="$t('base.supplier.email')"></vxe-column>
+ <vxe-column field="contact_tel" :title="$t('base.supplier.contact_tel')"></vxe-column>
+ <vxe-column field="creator" :title="$t('base.supplier.creator')"></vxe-column>
+ <vxe-column field="create_time" :title="$t('base.supplier.create_time')">
+ <template #default="{ row, column }">
+ <span>{{ formatDate(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="last_update_time" :title="$t('base.supplier.last_update_time')">
+ <template #default="{ row, column }">
+ <span>{{ formatDate(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-pencil-outline"
+ :tooltip-text="$t('system.page.edit')"
+ @click="method.editRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <!-- </v-window-item>
+ </v-window> -->
+ </v-card-text>
+ </v-card>
+ </div>
+ </div>
+ <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ <importSupplierTable :show-dialog="data.showDialogImport" @close="method.closeDialogImport" @saveSuccess="method.saveSuccessImport" />
+</template>
+
+<script lang="tsx" setup>
+import { computed, ref, reactive, onMounted, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { SupplierVO, DataProps } from '@/types/Base/Supplier'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import addOrUpdateDialog from './add-or-update-supplier.vue'
+import { hookComponent } from '@/components/system'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import i18n from '@/languages/i18n'
+import { getSupplierList, deleteSupplier } from '@/api/base/supplier'
+import importSupplierTable from './import-supplier-table.vue'
+import { formatDate } from '@/utils/format/formatSystem'
+import customPager from '@/components/custom-pager.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+const data = reactive({
+ searchForm: {
+ supplier_name: ''
+ },
+ tableData: [],
+ // activeTab: null,
+ showDialog: false,
+ showDialogImport: false,
+ dialogForm: {
+ id: 0,
+ supplier_name: '',
+ city: '',
+ address: '',
+ manager: '',
+ email: '',
+ contact_tel: '',
+ is_valid: true
+ },
+ tablePage: {
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ },
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ // Import Dialog
+ openDialogImport: () => {
+ data.showDialogImport = true
+ },
+ closeDialogImport: () => {
+ data.showDialogImport = false
+ },
+ saveSuccessImport: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getData()
+ },
+ // Add user
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ supplier_name: '',
+ city: '',
+ address: '',
+ manager: '',
+ email: '',
+ contact_tel: '',
+ is_valid: true
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // after Add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getData()
+ },
+ editRow(row: SupplierVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: SupplierVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteSupplier(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+ method.getData()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.supplier'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ getData: async () => {
+ const { data: res } = await getSupplierList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ }
+})
+onMounted(() => {
+ method.getData()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/base/userManagement/add-or-update-user.vue b/frontend/src/view/base/userManagement/add-or-update-user.vue
index 5512d02..00c95a4 100644
--- a/frontend/src/view/base/userManagement/add-or-update-user.vue
+++ b/frontend/src/view/base/userManagement/add-or-update-user.vue
@@ -1,191 +1,191 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('router.sideBar.userManagement')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.user_num"
- :label="$t('base.userManagement.user_num')"
- :rules="data.rules.user_num"
- variant="outlined"
- ></v-text-field>
- <v-text-field
- v-model="data.form.user_name"
- :label="$t('base.userManagement.user_name')"
- :rules="data.rules.user_name"
- variant="outlined"
- ></v-text-field>
- <v-select
- v-model="data.form.user_role"
- :items="data.combobox.user_role"
- :rules="data.rules.user_role"
- :label="$t('base.userManagement.user_role')"
- variant="outlined"
- clearable
- ></v-select>
- <v-select
- v-model="data.form.sex"
- :items="data.combobox.sex"
- item-title="label"
- item-value="value"
- :rules="data.rules.sex"
- :label="$t('base.userManagement.sex')"
- variant="outlined"
- clearable
- ></v-select>
- <v-text-field
- v-model="data.form.contact_tel"
- :label="$t('base.userManagement.contact_tel')"
- :rules="data.rules.contact_tel"
- variant="outlined"
- ></v-text-field>
- <v-switch
- v-model="data.form.is_valid"
- color="primary"
- :label="$t('base.userManagement.is_valid')"
- :rules="data.rules.is_valid"
- ></v-switch>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { UserVO } from '@/types/Base/UserManagement'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addUser, updateUser, getSelectItem } from '@/api/base/userManagement'
-import { StringLength } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: UserVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<UserVO>({
- id: 0,
- user_num: '',
- user_name: '',
- contact_tel: '',
- is_valid: true
- }),
- rules: {
- user_num: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.user_num') }!`,
- (val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)
- ],
- user_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.user_name') }!`,
- (val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)
- ],
- user_role: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.user_role') }!`],
- sex: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.sex') }!`],
- contact_tel: [(val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 64)],
- is_valid: []
- },
- combobox: ref<{
- sex: {
- label: string
- value: string
- }[]
- user_role: string[]
- }>({
- sex: [],
- user_role: []
- })
-})
-
-const method = reactive({
- // Get the options required by the drop-down box
- getCombobox: async () => {
- // Static drop-down box
- const sexOptions = ['male', 'female']
- data.combobox.sex = []
- for (const sex of sexOptions) {
- data.combobox.sex.push({
- label: i18n.global.t(`system.combobox.sex.${ sex }`),
- value: sex
- })
- }
- // Dynamic drop-down box
- data.combobox.user_role = []
- const { data: res } = await getSelectItem()
- if (!res.isSuccess) {
- return
- }
- for (const item of res.data) {
- switch (item.code) {
- case 'user_role':
- data.combobox.user_role.push(item.name)
- break
- }
- }
- },
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = dialogTitle.value === 'add' ? await addUser(data.form) : await updateUser(data.form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.getCombobox()
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('router.sideBar.userManagement')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.user_num"
+ :label="$t('base.userManagement.user_num')"
+ :rules="data.rules.user_num"
+ variant="outlined"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.user_name"
+ :label="$t('base.userManagement.user_name')"
+ :rules="data.rules.user_name"
+ variant="outlined"
+ ></v-text-field>
+ <v-select
+ v-model="data.form.user_role"
+ :items="data.combobox.user_role"
+ :rules="data.rules.user_role"
+ :label="$t('base.userManagement.user_role')"
+ variant="outlined"
+ clearable
+ ></v-select>
+ <v-select
+ v-model="data.form.sex"
+ :items="data.combobox.sex"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.sex"
+ :label="$t('base.userManagement.sex')"
+ variant="outlined"
+ clearable
+ ></v-select>
+ <v-text-field
+ v-model="data.form.contact_tel"
+ :label="$t('base.userManagement.contact_tel')"
+ :rules="data.rules.contact_tel"
+ variant="outlined"
+ ></v-text-field>
+ <v-switch
+ v-model="data.form.is_valid"
+ color="primary"
+ :label="$t('base.userManagement.is_valid')"
+ :rules="data.rules.is_valid"
+ ></v-switch>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { UserVO } from '@/types/Base/UserManagement'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addUser, updateUser, getSelectItem } from '@/api/base/userManagement'
+import { StringLength } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: UserVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<UserVO>({
+ id: 0,
+ user_num: '',
+ user_name: '',
+ contact_tel: '',
+ is_valid: true
+ }),
+ rules: {
+ user_num: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.user_num') }!`,
+ (val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)
+ ],
+ user_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.user_name') }!`,
+ (val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)
+ ],
+ user_role: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.user_role') }!`],
+ sex: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.sex') }!`],
+ contact_tel: [(val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 64)],
+ is_valid: []
+ },
+ combobox: ref<{
+ sex: {
+ label: string
+ value: string
+ }[]
+ user_role: string[]
+ }>({
+ sex: [],
+ user_role: []
+ })
+})
+
+const method = reactive({
+ // Get the options required by the drop-down box
+ getCombobox: async () => {
+ // Static drop-down box
+ const sexOptions = ['male', 'female']
+ data.combobox.sex = []
+ for (const sex of sexOptions) {
+ data.combobox.sex.push({
+ label: i18n.global.t(`system.combobox.sex.${ sex }`),
+ value: sex
+ })
+ }
+ // Dynamic drop-down box
+ data.combobox.user_role = []
+ const { data: res } = await getSelectItem()
+ if (!res.isSuccess) {
+ return
+ }
+ for (const item of res.data) {
+ switch (item.code) {
+ case 'user_role':
+ data.combobox.user_role.push(item.name)
+ break
+ }
+ }
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = dialogTitle.value === 'add' ? await addUser(data.form) : await updateUser(data.form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.getCombobox()
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/userManagement/import-table.vue b/frontend/src/view/base/userManagement/import-table.vue
index 0b46479..6d95d65 100644
--- a/frontend/src/view/base/userManagement/import-table.vue
+++ b/frontend/src/view/base/userManagement/import-table.vue
@@ -1,231 +1,231 @@
-<!-- UserManagement Setting Import Dialog -->
-<template>
- <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('system.page.import')}`"></v-toolbar>
- <v-card-text>
- <div class="mb-4">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.chooseFile')" size="x-small" @click="method.chooseFile"></tooltip-btn>
- <tooltip-btn
- icon="mdi-export-variant"
- :tooltip-text="$t('system.page.exportTemplate')"
- size="x-small"
- @click="method.exportTemplate"
- ></tooltip-btn>
- <input v-show="false" id="open" ref="uploadExcel" type="file" accept=".xls, .xlsx" @change="method.readExcel" />
- </div>
- <vxe-table
- ref="xTable"
- :column-config="{ minWidth: '100px' }"
- :data="data.importData"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- :edit-config="{ trigger: 'click', mode: 'cell' }"
- :edit-rules="data.validRules"
- :export-config="{}"
- align="center"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="operate" width="60" :title="$t('system.page.operate')" :resizable="false">
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- <vxe-column field="user_num" :title="$t('base.userManagement.user_num')"></vxe-column>
- <vxe-column field="user_name" :title="$t('base.userManagement.user_name')"></vxe-column>
- <vxe-column field="contact_tel" :title="$t('base.userManagement.contact_tel')"></vxe-column>
- <vxe-column field="user_role" :title="$t('base.userManagement.user_role')"></vxe-column>
- <vxe-column field="sex" :title="$t('base.userManagement.sex')"></vxe-column>
- </vxe-table>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { VxeTablePropTypes } from 'vxe-table'
-import * as XLSX from 'xlsx'
-import i18n from '@/languages/i18n'
-import { excelImport } from '@/api/base/userManagement'
-import { hookComponent } from '@/components/system/index'
-import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { ImportVO } from '@/types/Base/UserManagement'
-import { exportData } from '@/utils/exportTable'
-import { formatString } from '@/utils/format/formatSystem'
-
-const emit = defineEmits(['close', 'saveSuccess'])
-const uploadExcel = ref()
-const xTable = ref()
-
-const props = defineProps<{
- showDialog: boolean
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- importData: ref<Array<ImportVO>>([]),
- validRules: ref<VxeTablePropTypes.EditRules>({})
-})
-
-const method = reactive({
- initForm: () => {
- data.importData = []
- },
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const isValid = method.valid()
- if (!isValid) {
- return
- }
-
- const $table = xTable.value
- // It must be use 'getTableData()' to get all datas with table because it will delete row sometimes.
- const importData = JSON.parse(JSON.stringify($table.getTableData().fullData))
- for (const item of importData) {
- let sex = 'male'
- if (['男', '女', 'Male', 'Female'].includes(item.sex)) {
- switch (item.sex) {
- case '男':
- case 'Male':
- sex = 'male'
- break
- case '女':
- case 'Female':
- sex = 'female'
- break
- }
- }
- item.sex = sex
- }
- const { data: res } = await excelImport(importData)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- },
-
- valid: () => {
- const $table = xTable.value
- const importData = $table.getTableData().fullData
-
- if (importData.length <= 0) {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('system.tips.detailLengthIsZero') }`
- })
- return false
- }
- return true
- },
-
- chooseFile: async () => {
- uploadExcel.value.value = ''
- uploadExcel.value.click()
- },
-
- readExcel: async (evnt: any) => {
- const files = evnt.target.files
- if (files.length <= 0) {
- return false
- }
-
- const file = files[0]
- const fileReader = new FileReader()
-
- fileReader.onload = (ev: ProgressEvent<FileReader>) => {
- const fileData = ev?.target?.result
- if (fileData) {
- const workbook = XLSX.read(fileData, { type: 'binary' })
- const wsname = workbook.SheetNames[0]
-
- let ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname])
- let str = JSON.stringify(ws)
- str = str.replace(/(/g, '(')
- str = str.replace(/)/g, ')')
- ws = JSON.parse(str)
-
- data.importData = []
- ws.forEach((value: any, index: number, ws: any) => {
- data.importData.push({
- user_num: formatString(ws[index][i18n.global.t('base.userManagement.user_num')]),
- user_name: formatString(ws[index][i18n.global.t('base.userManagement.user_name')]),
- contact_tel: formatString(ws[index][i18n.global.t('base.userManagement.contact_tel')]),
- user_role: formatString(ws[index][i18n.global.t('base.userManagement.user_role')]),
- sex: formatString(ws[index][i18n.global.t('base.userManagement.sex')]),
- is_valid: true
- })
- })
- }
- }
- fileReader.readAsBinaryString(file)
- },
-
- exportTemplate: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.userManagement'),
- mode: 'header',
- columnFilterMethod({ column }: any) {
- return !['checkbox', 'seq'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
-
- deleteRow: (row: ImportVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
- handleConfirm: async () => {
- if (row) {
- const $table = xTable.value
- $table.remove(row)
- }
- }
- })
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- UserManagement Setting Import Dialog -->
+<template>
+ <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('system.page.import')}`"></v-toolbar>
+ <v-card-text>
+ <div class="mb-4">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.chooseFile')" size="x-small" @click="method.chooseFile"></tooltip-btn>
+ <tooltip-btn
+ icon="mdi-export-variant"
+ :tooltip-text="$t('system.page.exportTemplate')"
+ size="x-small"
+ @click="method.exportTemplate"
+ ></tooltip-btn>
+ <input v-show="false" id="open" ref="uploadExcel" type="file" accept=".xls, .xlsx" @change="method.readExcel" />
+ </div>
+ <vxe-table
+ ref="xTable"
+ :column-config="{ minWidth: '100px' }"
+ :data="data.importData"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ :edit-config="{ trigger: 'click', mode: 'cell' }"
+ :edit-rules="data.validRules"
+ :export-config="{}"
+ align="center"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="operate" width="60" :title="$t('system.page.operate')" :resizable="false">
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ <vxe-column field="user_num" :title="$t('base.userManagement.user_num')"></vxe-column>
+ <vxe-column field="user_name" :title="$t('base.userManagement.user_name')"></vxe-column>
+ <vxe-column field="contact_tel" :title="$t('base.userManagement.contact_tel')"></vxe-column>
+ <vxe-column field="user_role" :title="$t('base.userManagement.user_role')"></vxe-column>
+ <vxe-column field="sex" :title="$t('base.userManagement.sex')"></vxe-column>
+ </vxe-table>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { VxeTablePropTypes } from 'vxe-table'
+import * as XLSX from 'xlsx'
+import i18n from '@/languages/i18n'
+import { excelImport } from '@/api/base/userManagement'
+import { hookComponent } from '@/components/system/index'
+import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { ImportVO } from '@/types/Base/UserManagement'
+import { exportData } from '@/utils/exportTable'
+import { formatString } from '@/utils/format/formatSystem'
+
+const emit = defineEmits(['close', 'saveSuccess'])
+const uploadExcel = ref()
+const xTable = ref()
+
+const props = defineProps<{
+ showDialog: boolean
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ importData: ref<Array<ImportVO>>([]),
+ validRules: ref<VxeTablePropTypes.EditRules>({})
+})
+
+const method = reactive({
+ initForm: () => {
+ data.importData = []
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const isValid = method.valid()
+ if (!isValid) {
+ return
+ }
+
+ const $table = xTable.value
+ // It must be use 'getTableData()' to get all datas with table because it will delete row sometimes.
+ const importData = JSON.parse(JSON.stringify($table.getTableData().fullData))
+ for (const item of importData) {
+ let sex = 'male'
+ if (['男', '女', 'Male', 'Female'].includes(item.sex)) {
+ switch (item.sex) {
+ case '男':
+ case 'Male':
+ sex = 'male'
+ break
+ case '女':
+ case 'Female':
+ sex = 'female'
+ break
+ }
+ }
+ item.sex = sex
+ }
+ const { data: res } = await excelImport(importData)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ },
+
+ valid: () => {
+ const $table = xTable.value
+ const importData = $table.getTableData().fullData
+
+ if (importData.length <= 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('system.tips.detailLengthIsZero') }`
+ })
+ return false
+ }
+ return true
+ },
+
+ chooseFile: async () => {
+ uploadExcel.value.value = ''
+ uploadExcel.value.click()
+ },
+
+ readExcel: async (evnt: any) => {
+ const files = evnt.target.files
+ if (files.length <= 0) {
+ return false
+ }
+
+ const file = files[0]
+ const fileReader = new FileReader()
+
+ fileReader.onload = (ev: ProgressEvent<FileReader>) => {
+ const fileData = ev?.target?.result
+ if (fileData) {
+ const workbook = XLSX.read(fileData, { type: 'binary' })
+ const wsname = workbook.SheetNames[0]
+
+ let ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname])
+ let str = JSON.stringify(ws)
+ str = str.replace(/(/g, '(')
+ str = str.replace(/)/g, ')')
+ ws = JSON.parse(str)
+
+ data.importData = []
+ ws.forEach((value: any, index: number, ws: any) => {
+ data.importData.push({
+ user_num: formatString(ws[index][i18n.global.t('base.userManagement.user_num')]),
+ user_name: formatString(ws[index][i18n.global.t('base.userManagement.user_name')]),
+ contact_tel: formatString(ws[index][i18n.global.t('base.userManagement.contact_tel')]),
+ user_role: formatString(ws[index][i18n.global.t('base.userManagement.user_role')]),
+ sex: formatString(ws[index][i18n.global.t('base.userManagement.sex')]),
+ is_valid: true
+ })
+ })
+ }
+ }
+ fileReader.readAsBinaryString(file)
+ },
+
+ exportTemplate: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.userManagement'),
+ mode: 'header',
+ columnFilterMethod({ column }: any) {
+ return !['checkbox', 'seq'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+
+ deleteRow: (row: ImportVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
+ handleConfirm: async () => {
+ if (row) {
+ const $table = xTable.value
+ $table.remove(row)
+ }
+ }
+ })
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/userManagement/userManagement.vue b/frontend/src/view/base/userManagement/userManagement.vue
index 88f1728..ba84957 100644
--- a/frontend/src/view/base/userManagement/userManagement.vue
+++ b/frontend/src/view/base/userManagement/userManagement.vue
@@ -1,352 +1,352 @@
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="12" sm="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
- <tooltip-btn icon="mdi-database-import-outline" :tooltip-text="$t('system.page.import')" @click="method.openDialogImport">
- </tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
- <tooltip-btn icon="mdi-lock-reset" :tooltip-text="$t('base.userManagement.restPwd')" @click="method.restPwd"></tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="12" sm="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.user_num"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.userManagement.user_num')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.user_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.userManagement.user_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.user_role"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.userManagement.user_role')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="user_num" :title="$t('base.userManagement.user_num')"></vxe-column>
- <vxe-column field="user_name" :title="$t('base.userManagement.user_name')"></vxe-column>
- <vxe-column field="user_role" :title="$t('base.userManagement.user_role')"></vxe-column>
- <vxe-column field="sex" :title="$t('base.userManagement.sex')">
- <template #default="{ row }">
- <span>{{ $t(`system.combobox.sex.${row.sex}`) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="contact_tel" :title="$t('base.userManagement.contact_tel')"></vxe-column>
- <vxe-column field="is_valid" :title="$t('base.userManagement.is_valid')">
- <template #default="{ row, column }">
- <span>{{ row[column.property] ? $t('system.combobox.yesOrNo.yes') : $t('system.combobox.yesOrNo.no') }}</span>
- </template>
- </vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-pencil-outline"
- :tooltip-text="$t('system.page.edit')"
- @click="method.editRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- <!-- <vxe-grid v-bind="data.gridOptions">
- <template #pager>
- <custom-pagerr
- v-model:current-page="data.tablePage.pageIndex"
- v-model:page-size="data.tablePage.pageSize"
- :layouts="['Sizes', 'PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']"
- :total="data.tablePage.total"
- @page-change="handlePageChange"
- >
- </custom-pagerr>
- </template>
- </vxe-grid> -->
- </div>
- </v-card-text>
- </v-card>
- </div>
- <!-- Add or modify data mode window -->
- <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- <import-table :show-dialog="data.showDialogImport" @close="method.closeDialogImport" @saveSuccess="method.saveSuccessImport" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, reactive, onMounted, ref, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { DataProps, UserVO } from '@/types/Base/UserManagement'
-import { getUserList, deleteUser, resetPassword } from '@/api/base/userManagement'
-import { hookComponent } from '@/components/system'
-import addOrUpdateDialog from './add-or-update-user.vue'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import i18n from '@/languages/i18n'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import importTable from './import-table.vue'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data: DataProps = reactive({
- showDialogImport: false,
- searchForm: {
- user_num: '',
- user_name: '',
- user_role: ''
- },
- timer: null,
- tableData: [],
- tablePage: {
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE
- },
- // Dialog info
- showDialog: false,
- dialogForm: {
- id: 0,
- user_num: '',
- user_name: '',
- contact_tel: '',
- auth_string: '',
- is_valid: true
- }
-})
-
-const method = reactive({
- // Import Dialog
- openDialogImport: () => {
- data.showDialogImport = true
- },
- closeDialogImport: () => {
- data.showDialogImport = false
- },
- saveSuccessImport: () => {
- method.refresh()
- method.closeDialogImport()
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getUserList()
- },
- // Find Data by Pagination
- getUserList: async () => {
- const { data: res } = await getUserList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- // Add user
- add: () => {
- data.dialogForm = {
- id: 0,
- user_num: '',
- user_name: '',
- contact_tel: '',
- auth_string: '',
- is_valid: true
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // after Add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Refresh data
- refresh: () => {
- method.getUserList()
- },
- editRow(row: UserVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: UserVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteUser(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // When change paging
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
- method.refresh()
- }),
- // Export table
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.userManagement'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- // Reset password
- restPwd: async () => {
- const checkRecord: UserVO[] = xTable.value.getCheckboxRecords(true)
- if (checkRecord.length > 0) {
- hookComponent.$dialog({
- content: i18n.global.t('base.userManagement.beforeResetPwd'),
- handleConfirm: async () => {
- const idList = checkRecord.map((item) => item.id)
- const { data: res } = await resetPassword(idList)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$dialog({
- content: `${ i18n.global.t('base.userManagement.afterResetPwd') } ${ res.data }`
- })
- }
- })
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('base.userManagement.checkboxIsNull')
- })
- }
- }
-})
-
-onMounted(async () => {
- await method.getUserList()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-
-const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="12" sm="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
+ <tooltip-btn icon="mdi-database-import-outline" :tooltip-text="$t('system.page.import')" @click="method.openDialogImport">
+ </tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
+ <tooltip-btn icon="mdi-lock-reset" :tooltip-text="$t('base.userManagement.restPwd')" @click="method.restPwd"></tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="12" sm="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.user_num"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.userManagement.user_num')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.user_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.userManagement.user_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.user_role"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.userManagement.user_role')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="user_num" :title="$t('base.userManagement.user_num')"></vxe-column>
+ <vxe-column field="user_name" :title="$t('base.userManagement.user_name')"></vxe-column>
+ <vxe-column field="user_role" :title="$t('base.userManagement.user_role')"></vxe-column>
+ <vxe-column field="sex" :title="$t('base.userManagement.sex')">
+ <template #default="{ row }">
+ <span>{{ $t(`system.combobox.sex.${row.sex}`) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="contact_tel" :title="$t('base.userManagement.contact_tel')"></vxe-column>
+ <vxe-column field="is_valid" :title="$t('base.userManagement.is_valid')">
+ <template #default="{ row, column }">
+ <span>{{ row[column.property] ? $t('system.combobox.yesOrNo.yes') : $t('system.combobox.yesOrNo.no') }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-pencil-outline"
+ :tooltip-text="$t('system.page.edit')"
+ @click="method.editRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ <!-- <vxe-grid v-bind="data.gridOptions">
+ <template #pager>
+ <custom-pagerr
+ v-model:current-page="data.tablePage.pageIndex"
+ v-model:page-size="data.tablePage.pageSize"
+ :layouts="['Sizes', 'PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']"
+ :total="data.tablePage.total"
+ @page-change="handlePageChange"
+ >
+ </custom-pagerr>
+ </template>
+ </vxe-grid> -->
+ </div>
+ </v-card-text>
+ </v-card>
+ </div>
+ <!-- Add or modify data mode window -->
+ <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ <import-table :show-dialog="data.showDialogImport" @close="method.closeDialogImport" @saveSuccess="method.saveSuccessImport" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, reactive, onMounted, ref, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { DataProps, UserVO } from '@/types/Base/UserManagement'
+import { getUserList, deleteUser, resetPassword } from '@/api/base/userManagement'
+import { hookComponent } from '@/components/system'
+import addOrUpdateDialog from './add-or-update-user.vue'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import i18n from '@/languages/i18n'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import importTable from './import-table.vue'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data: DataProps = reactive({
+ showDialogImport: false,
+ searchForm: {
+ user_num: '',
+ user_name: '',
+ user_role: ''
+ },
+ timer: null,
+ tableData: [],
+ tablePage: {
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE
+ },
+ // Dialog info
+ showDialog: false,
+ dialogForm: {
+ id: 0,
+ user_num: '',
+ user_name: '',
+ contact_tel: '',
+ auth_string: '',
+ is_valid: true
+ }
+})
+
+const method = reactive({
+ // Import Dialog
+ openDialogImport: () => {
+ data.showDialogImport = true
+ },
+ closeDialogImport: () => {
+ data.showDialogImport = false
+ },
+ saveSuccessImport: () => {
+ method.refresh()
+ method.closeDialogImport()
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getUserList()
+ },
+ // Find Data by Pagination
+ getUserList: async () => {
+ const { data: res } = await getUserList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ // Add user
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ user_num: '',
+ user_name: '',
+ contact_tel: '',
+ auth_string: '',
+ is_valid: true
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // after Add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getUserList()
+ },
+ editRow(row: UserVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: UserVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteUser(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // When change paging
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+ method.refresh()
+ }),
+ // Export table
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.userManagement'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ // Reset password
+ restPwd: async () => {
+ const checkRecord: UserVO[] = xTable.value.getCheckboxRecords(true)
+ if (checkRecord.length > 0) {
+ hookComponent.$dialog({
+ content: i18n.global.t('base.userManagement.beforeResetPwd'),
+ handleConfirm: async () => {
+ const idList = checkRecord.map((item) => item.id)
+ const { data: res } = await resetPassword(idList)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$dialog({
+ content: `${ i18n.global.t('base.userManagement.afterResetPwd') } ${ res.data }`
+ })
+ }
+ })
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('base.userManagement.checkboxIsNull')
+ })
+ }
+ }
+})
+
+onMounted(async () => {
+ await method.getUserList()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+
+const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/base/userRoleSetting/add-or-update-user-role.vue b/frontend/src/view/base/userRoleSetting/add-or-update-user-role.vue
index 3528b71..60cacb8 100644
--- a/frontend/src/view/base/userRoleSetting/add-or-update-user-role.vue
+++ b/frontend/src/view/base/userRoleSetting/add-or-update-user-role.vue
@@ -1,116 +1,116 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('router.sideBar.userRoleSetting')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.role_name"
- :label="$t('base.userRoleSetting.role_name')"
- :rules="data.rules.role_name"
- variant="outlined"
- ></v-text-field>
- <v-switch
- v-model="data.form.is_valid"
- color="primary"
- :label="$t('base.userRoleSetting.is_valid')"
- :rules="data.rules.is_valid"
- ></v-switch>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { UserRoleVO } from '@/types/Base/UserRoleSetting'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addUserRole, updateUserRole } from '@/api/base/userRoleSetting'
-import { StringLength } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: UserRoleVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<UserRoleVO>({
- id: 0,
- role_name: '',
- is_valid: true
- }),
- rules: {
- role_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userRoleSetting.role_name') }!`,
- (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
- ],
- is_valid: []
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = dialogTitle.value === 'add' ? await addUserRole(data.form) : await updateUserRole(data.form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('router.sideBar.userRoleSetting')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.role_name"
+ :label="$t('base.userRoleSetting.role_name')"
+ :rules="data.rules.role_name"
+ variant="outlined"
+ ></v-text-field>
+ <v-switch
+ v-model="data.form.is_valid"
+ color="primary"
+ :label="$t('base.userRoleSetting.is_valid')"
+ :rules="data.rules.is_valid"
+ ></v-switch>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { UserRoleVO } from '@/types/Base/UserRoleSetting'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addUserRole, updateUserRole } from '@/api/base/userRoleSetting'
+import { StringLength } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: UserRoleVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<UserRoleVO>({
+ id: 0,
+ role_name: '',
+ is_valid: true
+ }),
+ rules: {
+ role_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userRoleSetting.role_name') }!`,
+ (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
+ ],
+ is_valid: []
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = dialogTitle.value === 'add' ? await addUserRole(data.form) : await updateUserRole(data.form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/userRoleSetting/userRoleSetting.vue b/frontend/src/view/base/userRoleSetting/userRoleSetting.vue
index f692adf..db356c1 100644
--- a/frontend/src/view/base/userRoleSetting/userRoleSetting.vue
+++ b/frontend/src/view/base/userRoleSetting/userRoleSetting.vue
@@ -1,234 +1,234 @@
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="12" sm="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="12" sm="9">
- <!-- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.userName"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.userName1"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="12" sm="4">
- <v-text-field
- v-model="data.searchForm.userName2"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row> -->
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="role_name" :title="$t('base.userRoleSetting.role_name')"></vxe-column>
- <vxe-column field="is_valid" :title="$t('base.userRoleSetting.is_valid')">
- <template #default="{ row, column }">
- <span>{{ row[column.property] ? $t('system.combobox.yesOrNo.yes') : $t('system.combobox.yesOrNo.no') }}</span>
- </template>
- </vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-pencil-outline"
- :tooltip-text="$t('system.page.edit')"
- @click="method.editRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- </div>
- </v-card-text>
- </v-card>
- </div>
- <!-- Add or modify data mode window -->
- <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, reactive, onMounted, ref } from 'vue'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { DataProps, UserRoleVO } from '@/types/Base/UserRoleSetting'
-import { getUserRoleAll, deleteUserRole } from '@/api/base/userRoleSetting'
-import { hookComponent } from '@/components/system'
-import addOrUpdateDialog from './add-or-update-user-role.vue'
-import i18n from '@/languages/i18n'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-const data: DataProps = reactive({
- // searchForm: {
- // userName: '',
- // userName1: '',
- // userName2: ''
- // },
- tableData: [],
- // Dialog info
- showDialog: false,
- dialogForm: {
- id: 0,
- role_name: '',
- is_valid: true
- }
-})
-
-const method = reactive({
- sureSearch: () => {
- // console.log(data.searchForm)
- },
- // Find Data by Pagination
- getUserRoleList: async () => {
- const { data: res } = await getUserRoleAll()
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data
- },
- // Add user
- add: () => {
- data.dialogForm = {
- id: 0,
- role_name: '',
- is_valid: true
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // after Add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Refresh data
- refresh: () => {
- method.getUserRoleList()
- },
- editRow(row: UserRoleVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: UserRoleVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteUserRole(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // Export table
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.userRoleSetting'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- }
-})
-
-onMounted(async () => {
- await method.getUserRoleList()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-
-const tableHeight = computed(() => computedTableHeight({ hasTab: false, hasPager: false }))
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="12" sm="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh()"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="12" sm="9">
+ <!-- <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.userName"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.userName1"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="12" sm="4">
+ <v-text-field
+ v-model="data.searchForm.userName2"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row> -->
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="role_name" :title="$t('base.userRoleSetting.role_name')"></vxe-column>
+ <vxe-column field="is_valid" :title="$t('base.userRoleSetting.is_valid')">
+ <template #default="{ row, column }">
+ <span>{{ row[column.property] ? $t('system.combobox.yesOrNo.yes') : $t('system.combobox.yesOrNo.no') }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-pencil-outline"
+ :tooltip-text="$t('system.page.edit')"
+ @click="method.editRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ </div>
+ </v-card-text>
+ </v-card>
+ </div>
+ <!-- Add or modify data mode window -->
+ <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, reactive, onMounted, ref } from 'vue'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { DataProps, UserRoleVO } from '@/types/Base/UserRoleSetting'
+import { getUserRoleAll, deleteUserRole } from '@/api/base/userRoleSetting'
+import { hookComponent } from '@/components/system'
+import addOrUpdateDialog from './add-or-update-user-role.vue'
+import i18n from '@/languages/i18n'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+const data: DataProps = reactive({
+ // searchForm: {
+ // userName: '',
+ // userName1: '',
+ // userName2: ''
+ // },
+ tableData: [],
+ // Dialog info
+ showDialog: false,
+ dialogForm: {
+ id: 0,
+ role_name: '',
+ is_valid: true
+ }
+})
+
+const method = reactive({
+ sureSearch: () => {
+ // console.log(data.searchForm)
+ },
+ // Find Data by Pagination
+ getUserRoleList: async () => {
+ const { data: res } = await getUserRoleAll()
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data
+ },
+ // Add user
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ role_name: '',
+ is_valid: true
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // after Add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getUserRoleList()
+ },
+ editRow(row: UserRoleVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: UserRoleVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteUserRole(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Export table
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.userRoleSetting'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ }
+})
+
+onMounted(async () => {
+ await method.getUserRoleList()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+
+const tableHeight = computed(() => computedTableHeight({ hasTab: false, hasPager: false }))
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/base/warehouseSetting/add-or-update-location.vue b/frontend/src/view/base/warehouseSetting/add-or-update-location.vue
index bf2ea05..6dee3d9 100644
--- a/frontend/src/view/base/warehouseSetting/add-or-update-location.vue
+++ b/frontend/src/view/base/warehouseSetting/add-or-update-location.vue
@@ -1,361 +1,361 @@
-<!-- Location Setting Operate Dialog -->
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('base.warehouseSetting.locationSetting')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-select
- v-model="data.form.warehouse_id"
- :items="data.combobox.warehouse_name"
- item-title="label"
- item-value="value"
- :rules="data.rules.warehouse_name"
- :label="$t('base.warehouseSetting.warehouse_name')"
- variant="outlined"
- clearable
- @update:model-value="method.changeWarehouse"
- ></v-select>
- <v-select
- v-model="data.form.warehouse_area_id"
- :items="data.combobox.warehouse_area_name"
- item-title="label"
- item-value="value"
- :rules="data.rules.warehouse_area_name"
- :label="$t('base.warehouseSetting.area_name')"
- variant="outlined"
- clearable
- @update:model-value="method.changeWarehouseArea"
- ></v-select>
- <v-select
- v-model="data.form.warehouse_area_property"
- :items="data.combobox.area_property"
- item-title="label"
- item-value="value"
- :rules="data.rules.warehouse_area_property"
- :label="$t('base.warehouseSetting.area_property')"
- variant="outlined"
- disabled
- clearable
- ></v-select>
- <v-text-field
- v-model="data.form.location_name"
- :label="$t('base.warehouseSetting.location_name')"
- :rules="data.rules.location_name"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.location_length"
- :label="$t('base.warehouseSetting.location_length')"
- :rules="data.rules.location_length"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.location_width"
- :label="$t('base.warehouseSetting.location_width')"
- :rules="data.rules.location_width"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.location_heigth"
- :label="$t('base.warehouseSetting.location_heigth')"
- :rules="data.rules.location_heigth"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.location_volume"
- :label="$t('base.warehouseSetting.location_volume')"
- :rules="data.rules.location_volume"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.location_load"
- :label="$t('base.warehouseSetting.location_load')"
- :rules="data.rules.location_load"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.roadway_number"
- :label="$t('base.warehouseSetting.roadway_number')"
- :rules="data.rules.roadway_number"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.shelf_number"
- :label="$t('base.warehouseSetting.shelf_number')"
- :rules="data.rules.shelf_number"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.layer_number"
- :label="$t('base.warehouseSetting.layer_number')"
- :rules="data.rules.layer_number"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.tag_number"
- :label="$t('base.warehouseSetting.tag_number')"
- :rules="data.rules.tag_number"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-switch
- v-model="data.form.is_valid"
- color="primary"
- :label="$t('base.warehouseSetting.is_valid')"
- :rules="data.rules.is_valid"
- ></v-switch>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { hookComponent } from '@/components/system/index'
-import { addGoodsLocation, updateGoodsLocation, getWarehouseSelect, getWarehouseAreaSelect } from '@/api/base/warehouseSetting'
-import { GoodsLocationVO, AreaProperty } from '@/types/Base/Warehouse'
-import i18n from '@/languages/i18n'
-import { StringLength, IsDecimal } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: GoodsLocationVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<GoodsLocationVO>({
- id: 0,
- warehouse_name: '',
- warehouse_area_name: '',
- location_name: '',
- location_length: 0,
- location_width: 0,
- location_heigth: 0,
- location_volume: 0,
- location_load: 0,
- roadway_number: '',
- shelf_number: '',
- layer_number: '',
- tag_number: '',
- is_valid: true
- }),
- rules: {
- warehouse_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.warehouse_name') }!`,
- (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
- ],
- warehouse_area_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.area_name') }!`,
- (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
- ],
- warehouse_area_property: [],
- location_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.location_name') }!`,
- (val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)
- ],
- location_length: [(val: number) => IsDecimal(val, 'nonNegative', 5, 2) === '' || IsDecimal(val, 'nonNegative', 5, 2)],
- location_width: [(val: number) => IsDecimal(val, 'nonNegative', 5, 2) === '' || IsDecimal(val, 'nonNegative', 5, 2)],
- location_heigth: [(val: number) => IsDecimal(val, 'nonNegative', 5, 2) === '' || IsDecimal(val, 'nonNegative', 5, 2)],
- location_volume: [(val: number) => IsDecimal(val, 'nonNegative', 12, 2) === '' || IsDecimal(val, 'nonNegative', 12, 2)],
- location_load: [(val: number) => IsDecimal(val, 'nonNegative', 8, 2) === '' || IsDecimal(val, 'nonNegative', 8, 2)],
- roadway_number: [(val: string) => StringLength(val, 0, 10) === '' || StringLength(val, 0, 10)],
- shelf_number: [(val: string) => StringLength(val, 0, 10) === '' || StringLength(val, 0, 10)],
- layer_number: [(val: string) => StringLength(val, 0, 10) === '' || StringLength(val, 0, 10)],
- tag_number: [(val: string) => StringLength(val, 0, 10) === '' || StringLength(val, 0, 10)],
- is_valid: []
- },
- combobox: ref<{
- warehouse_name: {
- label: string
- value: number
- }[]
- warehouse_area_name: {
- label: string
- value: number
- meta: any
- }[]
- area_property: {
- label: string
- value: AreaProperty
- }[]
- }>({
- warehouse_name: [],
- warehouse_area_name: [],
- area_property: [
- {
- label: i18n.global.t('base.warehouseSetting.picking_area'),
- value: AreaProperty.picking_area
- },
- {
- label: i18n.global.t('base.warehouseSetting.stocking_area'),
- value: AreaProperty.stocking_area
- },
- {
- label: i18n.global.t('base.warehouseSetting.receiving_area'),
- value: AreaProperty.receiving_area
- },
- {
- label: i18n.global.t('base.warehouseSetting.return_area'),
- value: AreaProperty.return_area
- },
- {
- label: i18n.global.t('base.warehouseSetting.defective_area'),
- value: AreaProperty.defective_area
- },
- {
- label: i18n.global.t('base.warehouseSetting.inventory_area'),
- value: AreaProperty.inventory_area
- }
- ]
- })
-})
-
-const method = reactive({
- changeWarehouse: (warehouseID: any) => {
- data.combobox.warehouse_area_name = []
-
- if (!warehouseID) {
- method.initWarehouseArea()
- return
- }
-
- // Find the ID corresponding value
- const warehouse = data.combobox.warehouse_name.find((item) => item.value === warehouseID)
- if (warehouse) {
- data.form.warehouse_name = warehouse.label
- data.form.warehouse_id = warehouseID
-
- // Clear messages of warehouse area when warehouse changed.
- method.initWarehouseArea()
- method.getWarehouseAreaSelect(warehouseID)
- }
- },
- changeWarehouseArea: (warehouseAreaID: any) => {
- if (!warehouseAreaID) {
- method.initWarehouseArea()
- return
- }
-
- // Find the ID corresponding value
- const warehouse = data.combobox.warehouse_area_name.find((item) => item.value === warehouseAreaID)
- if (warehouse) {
- data.form.warehouse_area_name = warehouse.label
- data.form.warehouse_area_id = warehouseAreaID
- data.form.warehouse_area_property = warehouse.meta
- }
- },
- // Clear messages of warehouse area when warehouse changed.
- initWarehouseArea() {
- delete data.form.warehouse_area_id
- data.form.warehouse_area_name = ''
- delete data.form.warehouse_area_property
- },
- getWarehouseSelect: async () => {
- data.combobox.warehouse_name = []
- const { data: res } = await getWarehouseSelect()
- if (!res.isSuccess) {
- return
- }
- for (const item of res.data) {
- data.combobox.warehouse_name.push({
- label: item.name,
- // WarehouseID is a numberic type
- value: Number(item.value)
- })
- }
- },
- // Get warehouse area select when warehouse changed.
- getWarehouseAreaSelect: async (warehouseID: number) => {
- data.combobox.warehouse_area_name = []
- const { data: res } = await getWarehouseAreaSelect(warehouseID)
- if (!res.isSuccess) {
- return
- }
- for (const item of res.data) {
- data.combobox.warehouse_area_name.push({
- label: item.area_name,
- // ID: WarehouseAreaID
- value: item.id,
- // Custom Property
- meta: item.area_property
- })
- }
- },
- closeDialog: () => {
- emit('close')
- },
- initForm: () => {
- data.form = props.form
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = dialogTitle.value === 'add' ? await addGoodsLocation(data.form) : await updateGoodsLocation(data.form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- method.getWarehouseSelect()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- Location Setting Operate Dialog -->
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('base.warehouseSetting.locationSetting')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-select
+ v-model="data.form.warehouse_id"
+ :items="data.combobox.warehouse_name"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.warehouse_name"
+ :label="$t('base.warehouseSetting.warehouse_name')"
+ variant="outlined"
+ clearable
+ @update:model-value="method.changeWarehouse"
+ ></v-select>
+ <v-select
+ v-model="data.form.warehouse_area_id"
+ :items="data.combobox.warehouse_area_name"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.warehouse_area_name"
+ :label="$t('base.warehouseSetting.area_name')"
+ variant="outlined"
+ clearable
+ @update:model-value="method.changeWarehouseArea"
+ ></v-select>
+ <v-select
+ v-model="data.form.warehouse_area_property"
+ :items="data.combobox.area_property"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.warehouse_area_property"
+ :label="$t('base.warehouseSetting.area_property')"
+ variant="outlined"
+ disabled
+ clearable
+ ></v-select>
+ <v-text-field
+ v-model="data.form.location_name"
+ :label="$t('base.warehouseSetting.location_name')"
+ :rules="data.rules.location_name"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.location_length"
+ :label="$t('base.warehouseSetting.location_length')"
+ :rules="data.rules.location_length"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.location_width"
+ :label="$t('base.warehouseSetting.location_width')"
+ :rules="data.rules.location_width"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.location_heigth"
+ :label="$t('base.warehouseSetting.location_heigth')"
+ :rules="data.rules.location_heigth"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.location_volume"
+ :label="$t('base.warehouseSetting.location_volume')"
+ :rules="data.rules.location_volume"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.location_load"
+ :label="$t('base.warehouseSetting.location_load')"
+ :rules="data.rules.location_load"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.roadway_number"
+ :label="$t('base.warehouseSetting.roadway_number')"
+ :rules="data.rules.roadway_number"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.shelf_number"
+ :label="$t('base.warehouseSetting.shelf_number')"
+ :rules="data.rules.shelf_number"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.layer_number"
+ :label="$t('base.warehouseSetting.layer_number')"
+ :rules="data.rules.layer_number"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.tag_number"
+ :label="$t('base.warehouseSetting.tag_number')"
+ :rules="data.rules.tag_number"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-switch
+ v-model="data.form.is_valid"
+ color="primary"
+ :label="$t('base.warehouseSetting.is_valid')"
+ :rules="data.rules.is_valid"
+ ></v-switch>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { hookComponent } from '@/components/system/index'
+import { addGoodsLocation, updateGoodsLocation, getWarehouseSelect, getWarehouseAreaSelect } from '@/api/base/warehouseSetting'
+import { GoodsLocationVO, AreaProperty } from '@/types/Base/Warehouse'
+import i18n from '@/languages/i18n'
+import { StringLength, IsDecimal } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: GoodsLocationVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<GoodsLocationVO>({
+ id: 0,
+ warehouse_name: '',
+ warehouse_area_name: '',
+ location_name: '',
+ location_length: 0,
+ location_width: 0,
+ location_heigth: 0,
+ location_volume: 0,
+ location_load: 0,
+ roadway_number: '',
+ shelf_number: '',
+ layer_number: '',
+ tag_number: '',
+ is_valid: true
+ }),
+ rules: {
+ warehouse_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.warehouse_name') }!`,
+ (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
+ ],
+ warehouse_area_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.area_name') }!`,
+ (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
+ ],
+ warehouse_area_property: [],
+ location_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.location_name') }!`,
+ (val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)
+ ],
+ location_length: [(val: number) => IsDecimal(val, 'nonNegative', 5, 2) === '' || IsDecimal(val, 'nonNegative', 5, 2)],
+ location_width: [(val: number) => IsDecimal(val, 'nonNegative', 5, 2) === '' || IsDecimal(val, 'nonNegative', 5, 2)],
+ location_heigth: [(val: number) => IsDecimal(val, 'nonNegative', 5, 2) === '' || IsDecimal(val, 'nonNegative', 5, 2)],
+ location_volume: [(val: number) => IsDecimal(val, 'nonNegative', 12, 2) === '' || IsDecimal(val, 'nonNegative', 12, 2)],
+ location_load: [(val: number) => IsDecimal(val, 'nonNegative', 8, 2) === '' || IsDecimal(val, 'nonNegative', 8, 2)],
+ roadway_number: [(val: string) => StringLength(val, 0, 10) === '' || StringLength(val, 0, 10)],
+ shelf_number: [(val: string) => StringLength(val, 0, 10) === '' || StringLength(val, 0, 10)],
+ layer_number: [(val: string) => StringLength(val, 0, 10) === '' || StringLength(val, 0, 10)],
+ tag_number: [(val: string) => StringLength(val, 0, 10) === '' || StringLength(val, 0, 10)],
+ is_valid: []
+ },
+ combobox: ref<{
+ warehouse_name: {
+ label: string
+ value: number
+ }[]
+ warehouse_area_name: {
+ label: string
+ value: number
+ meta: any
+ }[]
+ area_property: {
+ label: string
+ value: AreaProperty
+ }[]
+ }>({
+ warehouse_name: [],
+ warehouse_area_name: [],
+ area_property: [
+ {
+ label: i18n.global.t('base.warehouseSetting.picking_area'),
+ value: AreaProperty.picking_area
+ },
+ {
+ label: i18n.global.t('base.warehouseSetting.stocking_area'),
+ value: AreaProperty.stocking_area
+ },
+ {
+ label: i18n.global.t('base.warehouseSetting.receiving_area'),
+ value: AreaProperty.receiving_area
+ },
+ {
+ label: i18n.global.t('base.warehouseSetting.return_area'),
+ value: AreaProperty.return_area
+ },
+ {
+ label: i18n.global.t('base.warehouseSetting.defective_area'),
+ value: AreaProperty.defective_area
+ },
+ {
+ label: i18n.global.t('base.warehouseSetting.inventory_area'),
+ value: AreaProperty.inventory_area
+ }
+ ]
+ })
+})
+
+const method = reactive({
+ changeWarehouse: (warehouseID: any) => {
+ data.combobox.warehouse_area_name = []
+
+ if (!warehouseID) {
+ method.initWarehouseArea()
+ return
+ }
+
+ // Find the ID corresponding value
+ const warehouse = data.combobox.warehouse_name.find((item) => item.value === warehouseID)
+ if (warehouse) {
+ data.form.warehouse_name = warehouse.label
+ data.form.warehouse_id = warehouseID
+
+ // Clear messages of warehouse area when warehouse changed.
+ method.initWarehouseArea()
+ method.getWarehouseAreaSelect(warehouseID)
+ }
+ },
+ changeWarehouseArea: (warehouseAreaID: any) => {
+ if (!warehouseAreaID) {
+ method.initWarehouseArea()
+ return
+ }
+
+ // Find the ID corresponding value
+ const warehouse = data.combobox.warehouse_area_name.find((item) => item.value === warehouseAreaID)
+ if (warehouse) {
+ data.form.warehouse_area_name = warehouse.label
+ data.form.warehouse_area_id = warehouseAreaID
+ data.form.warehouse_area_property = warehouse.meta
+ }
+ },
+ // Clear messages of warehouse area when warehouse changed.
+ initWarehouseArea() {
+ delete data.form.warehouse_area_id
+ data.form.warehouse_area_name = ''
+ delete data.form.warehouse_area_property
+ },
+ getWarehouseSelect: async () => {
+ data.combobox.warehouse_name = []
+ const { data: res } = await getWarehouseSelect()
+ if (!res.isSuccess) {
+ return
+ }
+ for (const item of res.data) {
+ data.combobox.warehouse_name.push({
+ label: item.name,
+ // WarehouseID is a numberic type
+ value: Number(item.value)
+ })
+ }
+ },
+ // Get warehouse area select when warehouse changed.
+ getWarehouseAreaSelect: async (warehouseID: number) => {
+ data.combobox.warehouse_area_name = []
+ const { data: res } = await getWarehouseAreaSelect(warehouseID)
+ if (!res.isSuccess) {
+ return
+ }
+ for (const item of res.data) {
+ data.combobox.warehouse_area_name.push({
+ label: item.area_name,
+ // ID: WarehouseAreaID
+ value: item.id,
+ // Custom Property
+ meta: item.area_property
+ })
+ }
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ initForm: () => {
+ data.form = props.form
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = dialogTitle.value === 'add' ? await addGoodsLocation(data.form) : await updateGoodsLocation(data.form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ method.getWarehouseSelect()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/warehouseSetting/add-or-update-reservoir.vue b/frontend/src/view/base/warehouseSetting/add-or-update-reservoir.vue
index 8635238..638dcf7 100644
--- a/frontend/src/view/base/warehouseSetting/add-or-update-reservoir.vue
+++ b/frontend/src/view/base/warehouseSetting/add-or-update-reservoir.vue
@@ -1,213 +1,213 @@
-<!-- Reservoir Setting Operate Dialog -->
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('base.warehouseSetting.reservoirSetting')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-select
- v-model="data.form.warehouse_id"
- :items="data.combobox.warehouse_name"
- item-title="label"
- item-value="value"
- :rules="data.rules.warehouse_name"
- :label="$t('base.warehouseSetting.warehouse_name')"
- variant="outlined"
- clearable
- @update:model-value="method.changeWarehouse"
- ></v-select>
- <v-text-field
- v-model="data.form.area_name"
- :label="$t('base.warehouseSetting.area_name')"
- :rules="data.rules.area_name"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-select
- v-model="data.form.area_property"
- :items="data.combobox.area_property"
- item-title="label"
- item-value="value"
- :rules="data.rules.area_property"
- :label="$t('base.warehouseSetting.area_property')"
- variant="outlined"
- clearable
- ></v-select>
- <v-switch
- v-model="data.form.is_valid"
- color="primary"
- :label="$t('base.warehouseSetting.is_valid')"
- :rules="data.rules.is_valid"
- ></v-switch>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addWarehouseArea, updateWarehouseArea, getWarehouseSelect } from '@/api/base/warehouseSetting'
-import { WarehouseAreaVO, AreaProperty } from '@/types/Base/Warehouse'
-import { StringLength } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: WarehouseAreaVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<WarehouseAreaVO>({
- id: 0,
- warehouse_id: 0,
- parent_id: 0,
- warehouse_name: '',
- area_name: '',
- area_property: AreaProperty.picking_area,
- is_valid: true
- }),
- rules: {
- warehouse_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.warehouse_name') }!`
- ],
- area_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.area_name') }!`,
- (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
- ],
- area_property: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.area_property') }!`
- ],
- is_valid: []
- },
- combobox: ref<{
- warehouse_name: {
- label: string
- value: number
- }[]
- area_property: {
- label: string
- value: AreaProperty
- }[]
- }>({
- warehouse_name: [],
- area_property: [
- {
- label: i18n.global.t('base.warehouseSetting.picking_area'),
- value: AreaProperty.picking_area
- },
- {
- label: i18n.global.t('base.warehouseSetting.stocking_area'),
- value: AreaProperty.stocking_area
- },
- {
- label: i18n.global.t('base.warehouseSetting.receiving_area'),
- value: AreaProperty.receiving_area
- },
- {
- label: i18n.global.t('base.warehouseSetting.return_area'),
- value: AreaProperty.return_area
- },
- {
- label: i18n.global.t('base.warehouseSetting.defective_area'),
- value: AreaProperty.defective_area
- },
- {
- label: i18n.global.t('base.warehouseSetting.inventory_area'),
- value: AreaProperty.inventory_area
- }
- ]
- })
-})
-
-const method = reactive({
- getCombobox: async () => {
- data.combobox.warehouse_name = []
- const { data: res } = await getWarehouseSelect()
- if (!res.isSuccess) {
- return
- }
- for (const item of res.data) {
- data.combobox.warehouse_name.push({
- label: item.name,
- // WarehouseID is a numberic type
- value: Number(item.value)
- })
- }
- },
- closeDialog: () => {
- emit('close')
- },
- initForm: () => {
- data.form = props.form
- },
- changeWarehouse: (warehouseID: any) => {
- // Find the ID corresponding value
- const warehouse = data.combobox.warehouse_name.find((item) => item.value === warehouseID)
- if (warehouse) {
- data.form.warehouse_name = warehouse.label
- data.form.warehouse_id = warehouseID
- }
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = dialogTitle.value === 'add' ? await addWarehouseArea(data.form) : await updateWarehouseArea(data.form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- method.getCombobox()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- Reservoir Setting Operate Dialog -->
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('base.warehouseSetting.reservoirSetting')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-select
+ v-model="data.form.warehouse_id"
+ :items="data.combobox.warehouse_name"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.warehouse_name"
+ :label="$t('base.warehouseSetting.warehouse_name')"
+ variant="outlined"
+ clearable
+ @update:model-value="method.changeWarehouse"
+ ></v-select>
+ <v-text-field
+ v-model="data.form.area_name"
+ :label="$t('base.warehouseSetting.area_name')"
+ :rules="data.rules.area_name"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-select
+ v-model="data.form.area_property"
+ :items="data.combobox.area_property"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.area_property"
+ :label="$t('base.warehouseSetting.area_property')"
+ variant="outlined"
+ clearable
+ ></v-select>
+ <v-switch
+ v-model="data.form.is_valid"
+ color="primary"
+ :label="$t('base.warehouseSetting.is_valid')"
+ :rules="data.rules.is_valid"
+ ></v-switch>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addWarehouseArea, updateWarehouseArea, getWarehouseSelect } from '@/api/base/warehouseSetting'
+import { WarehouseAreaVO, AreaProperty } from '@/types/Base/Warehouse'
+import { StringLength } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: WarehouseAreaVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<WarehouseAreaVO>({
+ id: 0,
+ warehouse_id: 0,
+ parent_id: 0,
+ warehouse_name: '',
+ area_name: '',
+ area_property: AreaProperty.picking_area,
+ is_valid: true
+ }),
+ rules: {
+ warehouse_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.warehouse_name') }!`
+ ],
+ area_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.area_name') }!`,
+ (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
+ ],
+ area_property: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.area_property') }!`
+ ],
+ is_valid: []
+ },
+ combobox: ref<{
+ warehouse_name: {
+ label: string
+ value: number
+ }[]
+ area_property: {
+ label: string
+ value: AreaProperty
+ }[]
+ }>({
+ warehouse_name: [],
+ area_property: [
+ {
+ label: i18n.global.t('base.warehouseSetting.picking_area'),
+ value: AreaProperty.picking_area
+ },
+ {
+ label: i18n.global.t('base.warehouseSetting.stocking_area'),
+ value: AreaProperty.stocking_area
+ },
+ {
+ label: i18n.global.t('base.warehouseSetting.receiving_area'),
+ value: AreaProperty.receiving_area
+ },
+ {
+ label: i18n.global.t('base.warehouseSetting.return_area'),
+ value: AreaProperty.return_area
+ },
+ {
+ label: i18n.global.t('base.warehouseSetting.defective_area'),
+ value: AreaProperty.defective_area
+ },
+ {
+ label: i18n.global.t('base.warehouseSetting.inventory_area'),
+ value: AreaProperty.inventory_area
+ }
+ ]
+ })
+})
+
+const method = reactive({
+ getCombobox: async () => {
+ data.combobox.warehouse_name = []
+ const { data: res } = await getWarehouseSelect()
+ if (!res.isSuccess) {
+ return
+ }
+ for (const item of res.data) {
+ data.combobox.warehouse_name.push({
+ label: item.name,
+ // WarehouseID is a numberic type
+ value: Number(item.value)
+ })
+ }
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ initForm: () => {
+ data.form = props.form
+ },
+ changeWarehouse: (warehouseID: any) => {
+ // Find the ID corresponding value
+ const warehouse = data.combobox.warehouse_name.find((item) => item.value === warehouseID)
+ if (warehouse) {
+ data.form.warehouse_name = warehouse.label
+ data.form.warehouse_id = warehouseID
+ }
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = dialogTitle.value === 'add' ? await addWarehouseArea(data.form) : await updateWarehouseArea(data.form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ method.getCombobox()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/warehouseSetting/add-or-update-warehouse.vue b/frontend/src/view/base/warehouseSetting/add-or-update-warehouse.vue
index fa5c25b..73eb790 100644
--- a/frontend/src/view/base/warehouseSetting/add-or-update-warehouse.vue
+++ b/frontend/src/view/base/warehouseSetting/add-or-update-warehouse.vue
@@ -1,172 +1,172 @@
-<!-- Warehouse Setting Operate Dialog -->
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('router.sideBar.warehouseSetting')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.warehouse_name"
- :label="$t('base.warehouseSetting.warehouse_name')"
- :rules="data.rules.warehouse_name"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.city"
- :label="$t('base.warehouseSetting.city')"
- :rules="data.rules.city"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.address"
- :label="$t('base.warehouseSetting.address')"
- :rules="data.rules.address"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.contact_tel"
- :label="$t('base.warehouseSetting.contact_tel')"
- :rules="data.rules.contact_tel"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.email"
- :label="$t('base.warehouseSetting.email')"
- :rules="data.rules.email"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.manager"
- :label="$t('base.warehouseSetting.manager')"
- :rules="data.rules.manager"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-switch
- v-model="data.form.is_valid"
- color="primary"
- :label="$t('base.warehouseSetting.is_valid')"
- :rules="data.rules.is_valid"
- ></v-switch>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addWarehouse, updateWarehouse } from '@/api/base/warehouseSetting'
-import { WarehouseVO } from '@/types/Base/Warehouse'
-import { StringLength } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: WarehouseVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<WarehouseVO>({
- id: 0,
- warehouse_name: '',
- city: '',
- address: '',
- contact_tel: '',
- email: '',
- manager: '',
- is_valid: true
- }),
- rules: {
- warehouse_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.warehouse_name') }!`,
- (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
- ],
- city: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.city') }!`,
- (val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)
- ],
- address: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.address') }!`,
- (val: string) => StringLength(val, 0, 256) === '' || StringLength(val, 0, 256)
- ],
- contact_tel: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)],
- email: [(val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)],
- manager: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)],
- is_valid: []
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- initForm: () => {
- data.form = props.form
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = dialogTitle.value === 'add' ? await addWarehouse(data.form) : await updateWarehouse(data.form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- Warehouse Setting Operate Dialog -->
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('router.sideBar.warehouseSetting')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.warehouse_name"
+ :label="$t('base.warehouseSetting.warehouse_name')"
+ :rules="data.rules.warehouse_name"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.city"
+ :label="$t('base.warehouseSetting.city')"
+ :rules="data.rules.city"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.address"
+ :label="$t('base.warehouseSetting.address')"
+ :rules="data.rules.address"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.contact_tel"
+ :label="$t('base.warehouseSetting.contact_tel')"
+ :rules="data.rules.contact_tel"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.email"
+ :label="$t('base.warehouseSetting.email')"
+ :rules="data.rules.email"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.manager"
+ :label="$t('base.warehouseSetting.manager')"
+ :rules="data.rules.manager"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-switch
+ v-model="data.form.is_valid"
+ color="primary"
+ :label="$t('base.warehouseSetting.is_valid')"
+ :rules="data.rules.is_valid"
+ ></v-switch>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addWarehouse, updateWarehouse } from '@/api/base/warehouseSetting'
+import { WarehouseVO } from '@/types/Base/Warehouse'
+import { StringLength } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: WarehouseVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<WarehouseVO>({
+ id: 0,
+ warehouse_name: '',
+ city: '',
+ address: '',
+ contact_tel: '',
+ email: '',
+ manager: '',
+ is_valid: true
+ }),
+ rules: {
+ warehouse_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.warehouse_name') }!`,
+ (val: string) => StringLength(val, 0, 32) === '' || StringLength(val, 0, 32)
+ ],
+ city: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.city') }!`,
+ (val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)
+ ],
+ address: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.address') }!`,
+ (val: string) => StringLength(val, 0, 256) === '' || StringLength(val, 0, 256)
+ ],
+ contact_tel: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)],
+ email: [(val: string) => StringLength(val, 0, 128) === '' || StringLength(val, 0, 128)],
+ manager: [(val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)],
+ is_valid: []
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ initForm: () => {
+ data.form = props.form
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = dialogTitle.value === 'add' ? await addWarehouse(data.form) : await updateWarehouse(data.form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/warehouseSetting/import-table.vue b/frontend/src/view/base/warehouseSetting/import-table.vue
index ae67cdc..a843b41 100644
--- a/frontend/src/view/base/warehouseSetting/import-table.vue
+++ b/frontend/src/view/base/warehouseSetting/import-table.vue
@@ -1,214 +1,214 @@
-<!-- Warehouse Setting Import Dialog -->
-<template>
- <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('system.page.import')}`"></v-toolbar>
- <v-card-text>
- <div class="mb-4">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.chooseFile')" size="x-small" @click="method.chooseFile"></tooltip-btn>
- <tooltip-btn
- icon="mdi-export-variant"
- :tooltip-text="$t('system.page.exportTemplate')"
- size="x-small"
- @click="method.exportTemplate"
- ></tooltip-btn>
- <input v-show="false" id="open" ref="uploadExcel" type="file" accept=".xls, .xlsx" @change="method.readExcel" />
- </div>
- <vxe-table
- ref="xTable"
- :column-config="{ minWidth: '100px' }"
- :data="data.importData"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- :edit-config="{ trigger: 'click', mode: 'cell' }"
- :edit-rules="data.validRules"
- :export-config="{}"
- align="center"
- >
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="operate" width="60" :title="$t('system.page.operate')" :resizable="false">
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- <vxe-column field="warehouse_name" :title="$t('base.warehouseSetting.warehouse_name')"></vxe-column>
- <vxe-column field="city" :title="$t('base.warehouseSetting.city')"></vxe-column>
- <vxe-column field="address" :title="$t('base.warehouseSetting.address')"></vxe-column>
- <vxe-column field="contact_tel" :title="$t('base.warehouseSetting.contact_tel')"></vxe-column>
- <vxe-column field="email" :title="$t('base.warehouseSetting.email')"></vxe-column>
- <vxe-column field="manager" :title="$t('base.warehouseSetting.manager')"></vxe-column>
- </vxe-table>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { VxeTablePropTypes } from 'vxe-table'
-import * as XLSX from 'xlsx'
-import i18n from '@/languages/i18n'
-import { excelImport } from '@/api/base/warehouseSetting'
-import { hookComponent } from '@/components/system/index'
-import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { WarehouseVO } from '@/types/Base/Warehouse'
-import { exportData } from '@/utils/exportTable'
-import { formatString } from '@/utils/format/formatSystem'
-
-const emit = defineEmits(['close', 'saveSuccess'])
-const uploadExcel = ref()
-const xTable = ref()
-
-const props = defineProps<{
- showDialog: boolean
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- importData: ref<Array<WarehouseVO>>([]),
- validRules: ref<VxeTablePropTypes.EditRules>({})
-})
-
-const method = reactive({
- initForm: () => {
- data.importData = []
- },
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const isValid = method.valid()
- if (!isValid) {
- return
- }
-
- const $table = xTable.value
- // It must be use 'getTableData()' to get all datas with table because it will delete row sometimes.
- const importData = $table.getTableData().fullData
-
- const { data: res } = await excelImport(importData)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- },
-
- valid: () => {
- const $table = xTable.value
- const importData = $table.getTableData().fullData
-
- if (importData.length <= 0) {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('system.tips.detailLengthIsZero') }`
- })
- return false
- }
- return true
- },
-
- chooseFile: async () => {
- uploadExcel.value.value = ''
- uploadExcel.value.click()
- },
-
- readExcel: async (evnt: any) => {
- const files = evnt.target.files
- if (files.length <= 0) {
- return false
- }
-
- const file = files[0]
- const fileReader = new FileReader()
-
- fileReader.onload = (ev: ProgressEvent<FileReader>) => {
- const fileData = ev?.target?.result
- if (fileData) {
- const workbook = XLSX.read(fileData, { type: 'binary' })
- const wsname = workbook.SheetNames[0]
-
- let ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname])
- let str = JSON.stringify(ws)
- str = str.replace(/(/g, '(')
- str = str.replace(/)/g, ')')
- ws = JSON.parse(str)
-
- data.importData = []
- ws.forEach((value: any, index: number, ws: any) => {
- data.importData.push({
- warehouse_name: formatString(ws[index][i18n.global.t('base.warehouseSetting.warehouse_name')]),
- city: formatString(ws[index][i18n.global.t('base.warehouseSetting.city')]),
- address: formatString(ws[index][i18n.global.t('base.warehouseSetting.address')]),
- contact_tel: formatString(ws[index][i18n.global.t('base.warehouseSetting.contact_tel')]),
- email: formatString(ws[index][i18n.global.t('base.warehouseSetting.email')]),
- manager: formatString(ws[index][i18n.global.t('base.warehouseSetting.manager')])
- })
- })
- }
- }
- fileReader.readAsBinaryString(file)
- },
-
- exportTemplate: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.warehouseSetting'),
- mode: 'header',
- columnFilterMethod({ column }: any) {
- return !['checkbox', 'seq'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
-
- deleteRow: (row: WarehouseVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
- handleConfirm: async () => {
- if (row) {
- const $table = xTable.value
- $table.remove(row)
- }
- }
- })
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- Warehouse Setting Import Dialog -->
+<template>
+ <v-dialog v-model="isShow" width="70%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('system.page.import')}`"></v-toolbar>
+ <v-card-text>
+ <div class="mb-4">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.chooseFile')" size="x-small" @click="method.chooseFile"></tooltip-btn>
+ <tooltip-btn
+ icon="mdi-export-variant"
+ :tooltip-text="$t('system.page.exportTemplate')"
+ size="x-small"
+ @click="method.exportTemplate"
+ ></tooltip-btn>
+ <input v-show="false" id="open" ref="uploadExcel" type="file" accept=".xls, .xlsx" @change="method.readExcel" />
+ </div>
+ <vxe-table
+ ref="xTable"
+ :column-config="{ minWidth: '100px' }"
+ :data="data.importData"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ :edit-config="{ trigger: 'click', mode: 'cell' }"
+ :edit-rules="data.validRules"
+ :export-config="{}"
+ align="center"
+ >
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="operate" width="60" :title="$t('system.page.operate')" :resizable="false">
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ <vxe-column field="warehouse_name" :title="$t('base.warehouseSetting.warehouse_name')"></vxe-column>
+ <vxe-column field="city" :title="$t('base.warehouseSetting.city')"></vxe-column>
+ <vxe-column field="address" :title="$t('base.warehouseSetting.address')"></vxe-column>
+ <vxe-column field="contact_tel" :title="$t('base.warehouseSetting.contact_tel')"></vxe-column>
+ <vxe-column field="email" :title="$t('base.warehouseSetting.email')"></vxe-column>
+ <vxe-column field="manager" :title="$t('base.warehouseSetting.manager')"></vxe-column>
+ </vxe-table>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { VxeTablePropTypes } from 'vxe-table'
+import * as XLSX from 'xlsx'
+import i18n from '@/languages/i18n'
+import { excelImport } from '@/api/base/warehouseSetting'
+import { hookComponent } from '@/components/system/index'
+import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { WarehouseVO } from '@/types/Base/Warehouse'
+import { exportData } from '@/utils/exportTable'
+import { formatString } from '@/utils/format/formatSystem'
+
+const emit = defineEmits(['close', 'saveSuccess'])
+const uploadExcel = ref()
+const xTable = ref()
+
+const props = defineProps<{
+ showDialog: boolean
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ importData: ref<Array<WarehouseVO>>([]),
+ validRules: ref<VxeTablePropTypes.EditRules>({})
+})
+
+const method = reactive({
+ initForm: () => {
+ data.importData = []
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const isValid = method.valid()
+ if (!isValid) {
+ return
+ }
+
+ const $table = xTable.value
+ // It must be use 'getTableData()' to get all datas with table because it will delete row sometimes.
+ const importData = $table.getTableData().fullData
+
+ const { data: res } = await excelImport(importData)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ },
+
+ valid: () => {
+ const $table = xTable.value
+ const importData = $table.getTableData().fullData
+
+ if (importData.length <= 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('system.tips.detailLengthIsZero') }`
+ })
+ return false
+ }
+ return true
+ },
+
+ chooseFile: async () => {
+ uploadExcel.value.value = ''
+ uploadExcel.value.click()
+ },
+
+ readExcel: async (evnt: any) => {
+ const files = evnt.target.files
+ if (files.length <= 0) {
+ return false
+ }
+
+ const file = files[0]
+ const fileReader = new FileReader()
+
+ fileReader.onload = (ev: ProgressEvent<FileReader>) => {
+ const fileData = ev?.target?.result
+ if (fileData) {
+ const workbook = XLSX.read(fileData, { type: 'binary' })
+ const wsname = workbook.SheetNames[0]
+
+ let ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname])
+ let str = JSON.stringify(ws)
+ str = str.replace(/(/g, '(')
+ str = str.replace(/)/g, ')')
+ ws = JSON.parse(str)
+
+ data.importData = []
+ ws.forEach((value: any, index: number, ws: any) => {
+ data.importData.push({
+ warehouse_name: formatString(ws[index][i18n.global.t('base.warehouseSetting.warehouse_name')]),
+ city: formatString(ws[index][i18n.global.t('base.warehouseSetting.city')]),
+ address: formatString(ws[index][i18n.global.t('base.warehouseSetting.address')]),
+ contact_tel: formatString(ws[index][i18n.global.t('base.warehouseSetting.contact_tel')]),
+ email: formatString(ws[index][i18n.global.t('base.warehouseSetting.email')]),
+ manager: formatString(ws[index][i18n.global.t('base.warehouseSetting.manager')])
+ })
+ })
+ }
+ }
+ fileReader.readAsBinaryString(file)
+ },
+
+ exportTemplate: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.warehouseSetting'),
+ mode: 'header',
+ columnFilterMethod({ column }: any) {
+ return !['checkbox', 'seq'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+
+ deleteRow: (row: WarehouseVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
+ handleConfirm: async () => {
+ if (row) {
+ const $table = xTable.value
+ $table.remove(row)
+ }
+ }
+ })
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/base/warehouseSetting/tab-location.vue b/frontend/src/view/base/warehouseSetting/tab-location.vue
index 6f014fc..9036f04 100644
--- a/frontend/src/view/base/warehouseSetting/tab-location.vue
+++ b/frontend/src/view/base/warehouseSetting/tab-location.vue
@@ -1,290 +1,290 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.warehouse_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.warehouseSetting.warehouse_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.warehouse_area_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.warehouseSetting.area_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTableGoodsLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="warehouse_name" :title="$t('base.warehouseSetting.warehouse_name')"></vxe-column>
- <vxe-column field="warehouse_area_name" :title="$t('base.warehouseSetting.area_name')"></vxe-column>
- <vxe-column field="warehouse_area_property" :title="$t('base.warehouseSetting.area_property')">
- <template #default="{ row, column }">
- <span>{{ formatAreaProperty(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="location_name" :title="$t('base.warehouseSetting.location_name')"></vxe-column>
- <vxe-column width="150px" field="location_length" :title="$t('base.warehouseSetting.location_length')"></vxe-column>
- <vxe-column width="150px" field="location_width" :title="$t('base.warehouseSetting.location_width')"></vxe-column>
- <vxe-column width="150px" field="location_heigth" :title="$t('base.warehouseSetting.location_heigth')"></vxe-column>
- <vxe-column width="150px" field="location_volume" :title="$t('base.warehouseSetting.location_volume')"></vxe-column>
- <vxe-column width="150px" field="location_load" :title="$t('base.warehouseSetting.location_load')"></vxe-column>
- <vxe-column field="roadway_number" :title="$t('base.warehouseSetting.roadway_number')"></vxe-column>
- <vxe-column field="shelf_number" :title="$t('base.warehouseSetting.shelf_number')"></vxe-column>
- <vxe-column field="layer_number" :title="$t('base.warehouseSetting.layer_number')"></vxe-column>
- <vxe-column field="tag_number" :title="$t('base.warehouseSetting.tag_number')"></vxe-column>
- <vxe-column field="is_valid" :title="$t('base.warehouseSetting.is_valid')">
- <template #default="{ row, column }">
- <span>{{ formatIsValid(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn :flat="true" icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editRow(row)"></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <add-or-update-dialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { GoodsLocationVO } from '@/types/Base/Warehouse'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { deleteGoodsLocation, getGoodsLocationList } from '@/api/base/warehouseSetting'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import addOrUpdateDialog from './add-or-update-location.vue'
-import i18n from '@/languages/i18n'
-import { formatIsValid } from '@/utils/format/formatSystem'
-import { formatAreaProperty } from '@/utils/format/formatWarehouse'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { SearchObject } from '@/types/System/Form'
-import { exportData } from '@/utils/exportTable'
-
-const xTableGoodsLocation = ref()
-
-const data = reactive({
- showDialog: false,
- dialogForm: ref<GoodsLocationVO>({
- id: 0,
- warehouse_name: '',
- warehouse_area_name: '',
- location_name: '',
- location_length: 0,
- location_width: 0,
- location_heigth: 0,
- location_volume: 0,
- location_load: 0,
- roadway_number: '',
- shelf_number: '',
- layer_number: '',
- tag_number: '',
- is_valid: true
- }),
- searchForm: {
- warehouse_name: '',
- warehouse_area_name: ''
- },
- activeTab: null,
- tableData: ref<GoodsLocationVO[]>([]),
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- timer: ref<any>(null)
-})
-
-const method = reactive({
- // Open a dialog to add
- add: () => {
- data.dialogForm = {
- id: 0,
- warehouse_name: '',
- warehouse_area_name: '',
- location_name: '',
- location_length: 0,
- location_width: 0,
- location_heigth: 0,
- location_volume: 0,
- location_load: 0,
- roadway_number: '',
- shelf_number: '',
- layer_number: '',
- tag_number: '',
- is_valid: true
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // After add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Refresh data
- refresh: () => {
- method.getGoodsLocationList()
- },
- getGoodsLocationList: async () => {
- const { data: res } = await getGoodsLocationList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- editRow(row: GoodsLocationVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: GoodsLocationVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteGoodsLocation(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getGoodsLocationList()
- }),
- exportTable: () => {
- const $table = xTableGoodsLocation.value
- exportData({
- table: $table,
- filename: i18n.global.t('base.warehouseSetting.locationSetting'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getGoodsLocationList()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getGoodsLocationList: method.getGoodsLocationList
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.warehouse_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.warehouseSetting.warehouse_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.warehouse_area_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.warehouseSetting.area_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTableGoodsLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="warehouse_name" :title="$t('base.warehouseSetting.warehouse_name')"></vxe-column>
+ <vxe-column field="warehouse_area_name" :title="$t('base.warehouseSetting.area_name')"></vxe-column>
+ <vxe-column field="warehouse_area_property" :title="$t('base.warehouseSetting.area_property')">
+ <template #default="{ row, column }">
+ <span>{{ formatAreaProperty(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="location_name" :title="$t('base.warehouseSetting.location_name')"></vxe-column>
+ <vxe-column width="150px" field="location_length" :title="$t('base.warehouseSetting.location_length')"></vxe-column>
+ <vxe-column width="150px" field="location_width" :title="$t('base.warehouseSetting.location_width')"></vxe-column>
+ <vxe-column width="150px" field="location_heigth" :title="$t('base.warehouseSetting.location_heigth')"></vxe-column>
+ <vxe-column width="150px" field="location_volume" :title="$t('base.warehouseSetting.location_volume')"></vxe-column>
+ <vxe-column width="150px" field="location_load" :title="$t('base.warehouseSetting.location_load')"></vxe-column>
+ <vxe-column field="roadway_number" :title="$t('base.warehouseSetting.roadway_number')"></vxe-column>
+ <vxe-column field="shelf_number" :title="$t('base.warehouseSetting.shelf_number')"></vxe-column>
+ <vxe-column field="layer_number" :title="$t('base.warehouseSetting.layer_number')"></vxe-column>
+ <vxe-column field="tag_number" :title="$t('base.warehouseSetting.tag_number')"></vxe-column>
+ <vxe-column field="is_valid" :title="$t('base.warehouseSetting.is_valid')">
+ <template #default="{ row, column }">
+ <span>{{ formatIsValid(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn :flat="true" icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editRow(row)"></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <add-or-update-dialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { GoodsLocationVO } from '@/types/Base/Warehouse'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { deleteGoodsLocation, getGoodsLocationList } from '@/api/base/warehouseSetting'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import addOrUpdateDialog from './add-or-update-location.vue'
+import i18n from '@/languages/i18n'
+import { formatIsValid } from '@/utils/format/formatSystem'
+import { formatAreaProperty } from '@/utils/format/formatWarehouse'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { SearchObject } from '@/types/System/Form'
+import { exportData } from '@/utils/exportTable'
+
+const xTableGoodsLocation = ref()
+
+const data = reactive({
+ showDialog: false,
+ dialogForm: ref<GoodsLocationVO>({
+ id: 0,
+ warehouse_name: '',
+ warehouse_area_name: '',
+ location_name: '',
+ location_length: 0,
+ location_width: 0,
+ location_heigth: 0,
+ location_volume: 0,
+ location_load: 0,
+ roadway_number: '',
+ shelf_number: '',
+ layer_number: '',
+ tag_number: '',
+ is_valid: true
+ }),
+ searchForm: {
+ warehouse_name: '',
+ warehouse_area_name: ''
+ },
+ activeTab: null,
+ tableData: ref<GoodsLocationVO[]>([]),
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ // Open a dialog to add
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ warehouse_name: '',
+ warehouse_area_name: '',
+ location_name: '',
+ location_length: 0,
+ location_width: 0,
+ location_heigth: 0,
+ location_volume: 0,
+ location_load: 0,
+ roadway_number: '',
+ shelf_number: '',
+ layer_number: '',
+ tag_number: '',
+ is_valid: true
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // After add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getGoodsLocationList()
+ },
+ getGoodsLocationList: async () => {
+ const { data: res } = await getGoodsLocationList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ editRow(row: GoodsLocationVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: GoodsLocationVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteGoodsLocation(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getGoodsLocationList()
+ }),
+ exportTable: () => {
+ const $table = xTableGoodsLocation.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('base.warehouseSetting.locationSetting'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getGoodsLocationList()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getGoodsLocationList: method.getGoodsLocationList
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/base/warehouseSetting/tab-reservoir.vue b/frontend/src/view/base/warehouseSetting/tab-reservoir.vue
index 55d90fe..9725fb0 100644
--- a/frontend/src/view/base/warehouseSetting/tab-reservoir.vue
+++ b/frontend/src/view/base/warehouseSetting/tab-reservoir.vue
@@ -1,265 +1,265 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.warehouse_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.warehouseSetting.warehouse_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.area_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.warehouseSetting.area_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTableWarehouseArea" :data="data.tableData" :height="tableHeight" align="center">
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="warehouse_name" :title="$t('base.warehouseSetting.warehouse_name')"></vxe-column>
- <vxe-column field="area_name" :title="$t('base.warehouseSetting.area_name')"></vxe-column>
- <vxe-column field="area_property" :title="$t('base.warehouseSetting.area_property')">
- <template #default="{ row, column }">
- <span>{{ formatAreaProperty(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="is_valid" :title="$t('base.warehouseSetting.is_valid')">
- <template #default="{ row, column }">
- <span>{{ formatIsValid(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn :flat="true" icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editRow(row)"></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <add-or-update-dialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { WarehouseAreaVO, AreaProperty } from '@/types/Base/Warehouse'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { deleteWarehouseArea, getWarehouseAreaList } from '@/api/base/warehouseSetting'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import addOrUpdateDialog from './add-or-update-reservoir.vue'
-import i18n from '@/languages/i18n'
-import { formatAreaProperty } from '@/utils/format/formatWarehouse'
-import { formatIsValid } from '@/utils/format/formatSystem'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { SearchObject } from '@/types/System/Form'
-import { exportData } from '@/utils/exportTable'
-
-const xTableWarehouseArea = ref()
-
-const data = reactive({
- showDialog: false,
- dialogForm: ref<WarehouseAreaVO>({
- id: 0,
- parent_id: 0,
- warehouse_name: '',
- area_name: '',
- area_property: AreaProperty.picking_area,
- is_valid: true
- }),
- searchForm: {
- warehouse_name: '',
- area_name: ''
- },
- activeTab: null,
- tableData: ref<WarehouseAreaVO[]>([]),
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- timer: ref<any>(null)
-})
-
-const method = reactive({
- // Open a dialog to add
- add: () => {
- data.dialogForm = {
- id: 0,
- parent_id: 0,
- warehouse_name: '',
- area_name: '',
- area_property: AreaProperty.picking_area,
- is_valid: true
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // After add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Refresh data
- refresh: () => {
- method.getWarehouseAreaList()
- },
- getWarehouseAreaList: async () => {
- const { data: res } = await getWarehouseAreaList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
-
- editRow(row: WarehouseAreaVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: WarehouseAreaVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteWarehouseArea(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getWarehouseAreaList()
- }),
- exportTable: () => {
- const $table = xTableWarehouseArea.value
- exportData({
- table: $table,
- filename: i18n.global.t('base.warehouseSetting.reservoirSetting'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getWarehouseAreaList()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getWarehouseAreaList: method.getWarehouseAreaList
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.warehouse_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.warehouseSetting.warehouse_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.area_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.warehouseSetting.area_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTableWarehouseArea" :data="data.tableData" :height="tableHeight" align="center">
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="warehouse_name" :title="$t('base.warehouseSetting.warehouse_name')"></vxe-column>
+ <vxe-column field="area_name" :title="$t('base.warehouseSetting.area_name')"></vxe-column>
+ <vxe-column field="area_property" :title="$t('base.warehouseSetting.area_property')">
+ <template #default="{ row, column }">
+ <span>{{ formatAreaProperty(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="is_valid" :title="$t('base.warehouseSetting.is_valid')">
+ <template #default="{ row, column }">
+ <span>{{ formatIsValid(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn :flat="true" icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editRow(row)"></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <add-or-update-dialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { WarehouseAreaVO, AreaProperty } from '@/types/Base/Warehouse'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { deleteWarehouseArea, getWarehouseAreaList } from '@/api/base/warehouseSetting'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import addOrUpdateDialog from './add-or-update-reservoir.vue'
+import i18n from '@/languages/i18n'
+import { formatAreaProperty } from '@/utils/format/formatWarehouse'
+import { formatIsValid } from '@/utils/format/formatSystem'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { SearchObject } from '@/types/System/Form'
+import { exportData } from '@/utils/exportTable'
+
+const xTableWarehouseArea = ref()
+
+const data = reactive({
+ showDialog: false,
+ dialogForm: ref<WarehouseAreaVO>({
+ id: 0,
+ parent_id: 0,
+ warehouse_name: '',
+ area_name: '',
+ area_property: AreaProperty.picking_area,
+ is_valid: true
+ }),
+ searchForm: {
+ warehouse_name: '',
+ area_name: ''
+ },
+ activeTab: null,
+ tableData: ref<WarehouseAreaVO[]>([]),
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ // Open a dialog to add
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ parent_id: 0,
+ warehouse_name: '',
+ area_name: '',
+ area_property: AreaProperty.picking_area,
+ is_valid: true
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // After add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getWarehouseAreaList()
+ },
+ getWarehouseAreaList: async () => {
+ const { data: res } = await getWarehouseAreaList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+
+ editRow(row: WarehouseAreaVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: WarehouseAreaVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteWarehouseArea(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getWarehouseAreaList()
+ }),
+ exportTable: () => {
+ const $table = xTableWarehouseArea.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('base.warehouseSetting.reservoirSetting'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getWarehouseAreaList()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getWarehouseAreaList: method.getWarehouseAreaList
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/base/warehouseSetting/tab-warehouse.vue b/frontend/src/view/base/warehouseSetting/tab-warehouse.vue
index f0e2073..4dbce19 100644
--- a/frontend/src/view/base/warehouseSetting/tab-warehouse.vue
+++ b/frontend/src/view/base/warehouseSetting/tab-warehouse.vue
@@ -1,296 +1,296 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-database-import-outline" :tooltip-text="$t('system.page.import')" @click="method.openDialogImport"> </tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.warehouse_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.warehouseSetting.warehouse_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.city"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.warehouseSetting.city')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.manager"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('base.warehouseSetting.manager')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTableWarehouse" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="warehouse_name" :title="$t('base.warehouseSetting.warehouse_name')"></vxe-column>
- <vxe-column field="city" :title="$t('base.warehouseSetting.city')"></vxe-column>
- <vxe-column field="address" :title="$t('base.warehouseSetting.address')"></vxe-column>
- <vxe-column field="contact_tel" :title="$t('base.warehouseSetting.contact_tel')"></vxe-column>
- <vxe-column field="email" :title="$t('base.warehouseSetting.email')"></vxe-column>
- <vxe-column field="manager" :title="$t('base.warehouseSetting.manager')"></vxe-column>
- <vxe-column field="creator" :title="$t('base.warehouseSetting.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('base.warehouseSetting.create_time')"></vxe-column>
- <vxe-column field="is_valid" :title="$t('base.warehouseSetting.is_valid')">
- <template #default="{ row, column }">
- <span>{{ formatIsValid(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn :flat="true" icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editRow(row)"></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <add-or-update-dialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- <import-table :show-dialog="data.showDialogImport" @close="method.closeDialogImport" @saveSuccess="method.saveSuccessImport" />
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { WarehouseVO } from '@/types/Base/Warehouse'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { deleteWarehouse, getWarehouseList } from '@/api/base/warehouseSetting'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import addOrUpdateDialog from './add-or-update-warehouse.vue'
-import i18n from '@/languages/i18n'
-import { formatIsValid } from '@/utils/format/formatSystem'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { SearchObject } from '@/types/System/Form'
-import importTable from './import-table.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTableWarehouse = ref()
-
-const data = reactive({
- showDialog: false,
- showDialogImport: false,
-
- dialogForm: {
- id: 0,
- warehouse_name: '',
- city: '',
- address: '',
- contact_tel: '',
- email: '',
- manager: '',
- is_valid: true
- },
- searchForm: {
- warehouse_name: '',
- city: '',
- manager: ''
- },
- activeTab: null,
- tableData: ref<WarehouseVO[]>([]),
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- timer: ref<any>(null)
-})
-
-const method = reactive({
- // Open a dialog to add
- add: () => {
- data.dialogForm = {
- id: 0,
- warehouse_name: '',
- city: '',
- address: '',
- contact_tel: '',
- email: '',
- manager: '',
- is_valid: true
- }
- data.showDialog = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // After add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Import Dialog
- openDialogImport: () => {
- data.showDialogImport = true
- },
- closeDialogImport: () => {
- data.showDialogImport = false
- },
- saveSuccessImport: () => {
- method.refresh()
- method.closeDialogImport()
- },
- // Refresh data
- refresh: () => {
- method.getWarehouseList()
- },
- getWarehouseList: async () => {
- const { data: res } = await getWarehouseList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- editRow(row: WarehouseVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: WarehouseVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteWarehouse(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getWarehouseList()
- }),
- exportTable: () => {
- const $table = xTableWarehouse.value
- exportData({
- table: $table,
- filename: i18n.global.t('base.warehouseSetting.warehouseSetting'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getWarehouseList()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getWarehouseList: method.getWarehouseList
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-database-import-outline" :tooltip-text="$t('system.page.import')" @click="method.openDialogImport"> </tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.warehouse_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.warehouseSetting.warehouse_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.city"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.warehouseSetting.city')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.manager"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('base.warehouseSetting.manager')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTableWarehouse" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="warehouse_name" :title="$t('base.warehouseSetting.warehouse_name')"></vxe-column>
+ <vxe-column field="city" :title="$t('base.warehouseSetting.city')"></vxe-column>
+ <vxe-column field="address" :title="$t('base.warehouseSetting.address')"></vxe-column>
+ <vxe-column field="contact_tel" :title="$t('base.warehouseSetting.contact_tel')"></vxe-column>
+ <vxe-column field="email" :title="$t('base.warehouseSetting.email')"></vxe-column>
+ <vxe-column field="manager" :title="$t('base.warehouseSetting.manager')"></vxe-column>
+ <vxe-column field="creator" :title="$t('base.warehouseSetting.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('base.warehouseSetting.create_time')"></vxe-column>
+ <vxe-column field="is_valid" :title="$t('base.warehouseSetting.is_valid')">
+ <template #default="{ row, column }">
+ <span>{{ formatIsValid(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn :flat="true" icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editRow(row)"></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <add-or-update-dialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ <import-table :show-dialog="data.showDialogImport" @close="method.closeDialogImport" @saveSuccess="method.saveSuccessImport" />
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { WarehouseVO } from '@/types/Base/Warehouse'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { deleteWarehouse, getWarehouseList } from '@/api/base/warehouseSetting'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import addOrUpdateDialog from './add-or-update-warehouse.vue'
+import i18n from '@/languages/i18n'
+import { formatIsValid } from '@/utils/format/formatSystem'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { SearchObject } from '@/types/System/Form'
+import importTable from './import-table.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTableWarehouse = ref()
+
+const data = reactive({
+ showDialog: false,
+ showDialogImport: false,
+
+ dialogForm: {
+ id: 0,
+ warehouse_name: '',
+ city: '',
+ address: '',
+ contact_tel: '',
+ email: '',
+ manager: '',
+ is_valid: true
+ },
+ searchForm: {
+ warehouse_name: '',
+ city: '',
+ manager: ''
+ },
+ activeTab: null,
+ tableData: ref<WarehouseVO[]>([]),
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ // Open a dialog to add
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ warehouse_name: '',
+ city: '',
+ address: '',
+ contact_tel: '',
+ email: '',
+ manager: '',
+ is_valid: true
+ }
+ data.showDialog = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // After add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Import Dialog
+ openDialogImport: () => {
+ data.showDialogImport = true
+ },
+ closeDialogImport: () => {
+ data.showDialogImport = false
+ },
+ saveSuccessImport: () => {
+ method.refresh()
+ method.closeDialogImport()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getWarehouseList()
+ },
+ getWarehouseList: async () => {
+ const { data: res } = await getWarehouseList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ editRow(row: WarehouseVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: WarehouseVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteWarehouse(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getWarehouseList()
+ }),
+ exportTable: () => {
+ const $table = xTableWarehouse.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('base.warehouseSetting.warehouseSetting'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getWarehouseList()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getWarehouseList: method.getWarehouseList
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/base/warehouseSetting/warehouseSetting.vue b/frontend/src/view/base/warehouseSetting/warehouseSetting.vue
index ffbd1d3..2f5f488 100644
--- a/frontend/src/view/base/warehouseSetting/warehouseSetting.vue
+++ b/frontend/src/view/base/warehouseSetting/warehouseSetting.vue
@@ -1,110 +1,110 @@
-<!-- Warehouse Setting -->
-<template>
- <div class="container">
- <div>
- <v-tabs v-model="data.activeTab" stacked @update:model-value="method.changeTabs">
- <v-tab v-for="(item, index) of tabsConfig" :key="index" :value="item.value">
- <v-icon>{{ item.icon }}</v-icon>
- <p class="tabItemTitle">{{ item.tabName }}</p>
- </v-tab>
- </v-tabs>
-
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <v-window v-model="data.activeTab">
- <v-window-item value="tabWarehouse">
- <tab-warehouse ref="tabWarehouseRef" />
- </v-window-item>
- <v-window-item value="tabReservoir">
- <tab-reservoir ref="tabReservoirRef" />
- </v-window-item>
- <v-window-item value="tabLocation">
- <tab-location ref="tabLocationRef" />
- </v-window-item>
- </v-window>
- </v-card-text>
- </v-card>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { ref, reactive, onMounted, watch, nextTick } from 'vue'
-import i18n from '@/languages/i18n'
-import tabWarehouse from './tab-warehouse.vue'
-import tabReservoir from './tab-reservoir.vue'
-import tabLocation from './tab-location.vue'
-
-const tabWarehouseRef = ref()
-const tabReservoirRef = ref()
-const tabLocationRef = ref()
-
-const tabsConfig = [
- {
- value: 'tabWarehouse',
- icon: 'mdi-warehouse',
- tabName: i18n.global.t('base.warehouseSetting.warehouseSetting')
- },
- {
- value: 'tabReservoir',
- icon: 'mdi-texture-box',
- tabName: i18n.global.t('base.warehouseSetting.reservoirSetting')
- },
- {
- value: 'tabLocation',
- icon: 'mdi-library-shelves ',
- tabName: i18n.global.t('base.warehouseSetting.locationSetting')
- }
-]
-
-const data = reactive({
- activeTab: '',
- isLoadWarehouseData: false,
- isLoadReservoirData: false,
- isLoadLocationData: false
-})
-
-const method = reactive({
- changeTabs: (e: any): void => {
- nextTick(() => {
- switch (e) {
- case 'tabWarehouse':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabWarehouseRef?.value?.getWarehouseList) {
- tabWarehouseRef.value.getWarehouseList()
- }
- break
- case 'tabReservoir':
- if (tabReservoirRef?.value?.getWarehouseAreaList) {
- tabReservoirRef.value.getWarehouseAreaList()
- }
- break
- case 'tabLocation':
- if (tabLocationRef?.value?.getGoodsLocationList) {
- tabLocationRef.value.getGoodsLocationList()
- }
- break
- }
- })
- }
-})
-
-onMounted(() => {})
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<!-- Warehouse Setting -->
+<template>
+ <div class="container">
+ <div>
+ <v-tabs v-model="data.activeTab" stacked @update:model-value="method.changeTabs">
+ <v-tab v-for="(item, index) of tabsConfig" :key="index" :value="item.value">
+ <v-icon>{{ item.icon }}</v-icon>
+ <p class="tabItemTitle">{{ item.tabName }}</p>
+ </v-tab>
+ </v-tabs>
+
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <v-window v-model="data.activeTab">
+ <v-window-item value="tabWarehouse">
+ <tab-warehouse ref="tabWarehouseRef" />
+ </v-window-item>
+ <v-window-item value="tabReservoir">
+ <tab-reservoir ref="tabReservoirRef" />
+ </v-window-item>
+ <v-window-item value="tabLocation">
+ <tab-location ref="tabLocationRef" />
+ </v-window-item>
+ </v-window>
+ </v-card-text>
+ </v-card>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { ref, reactive, onMounted, watch, nextTick } from 'vue'
+import i18n from '@/languages/i18n'
+import tabWarehouse from './tab-warehouse.vue'
+import tabReservoir from './tab-reservoir.vue'
+import tabLocation from './tab-location.vue'
+
+const tabWarehouseRef = ref()
+const tabReservoirRef = ref()
+const tabLocationRef = ref()
+
+const tabsConfig = [
+ {
+ value: 'tabWarehouse',
+ icon: 'mdi-warehouse',
+ tabName: i18n.global.t('base.warehouseSetting.warehouseSetting')
+ },
+ {
+ value: 'tabReservoir',
+ icon: 'mdi-texture-box',
+ tabName: i18n.global.t('base.warehouseSetting.reservoirSetting')
+ },
+ {
+ value: 'tabLocation',
+ icon: 'mdi-library-shelves ',
+ tabName: i18n.global.t('base.warehouseSetting.locationSetting')
+ }
+]
+
+const data = reactive({
+ activeTab: '',
+ isLoadWarehouseData: false,
+ isLoadReservoirData: false,
+ isLoadLocationData: false
+})
+
+const method = reactive({
+ changeTabs: (e: any): void => {
+ nextTick(() => {
+ switch (e) {
+ case 'tabWarehouse':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabWarehouseRef?.value?.getWarehouseList) {
+ tabWarehouseRef.value.getWarehouseList()
+ }
+ break
+ case 'tabReservoir':
+ if (tabReservoirRef?.value?.getWarehouseAreaList) {
+ tabReservoirRef.value.getWarehouseAreaList()
+ }
+ break
+ case 'tabLocation':
+ if (tabLocationRef?.value?.getGoodsLocationList) {
+ tabLocationRef.value.getGoodsLocationList()
+ }
+ break
+ }
+ })
+ }
+})
+
+onMounted(() => {})
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/add-or-update-shipment.vue b/frontend/src/view/deliveryManagement/deliveryManagement/add-or-update-shipment.vue
index c633cd4..c462d57 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/add-or-update-shipment.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/add-or-update-shipment.vue
@@ -1,327 +1,327 @@
-<template>
- <v-dialog v-model="isShow" :width="'70%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card class="formCard">
- <v-toolbar color="white" :title="`${$t('router.sideBar.deliveryManagement')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-select
- v-model="data.form.customer_name"
- :items="data.combobox.customer_name"
- item-title="label"
- item-value="label"
- :rules="data.rules.customer_name"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="outlined"
- clearable
- @update:model-value="method.customerNameChange"
- ></v-select>
- <v-row v-for="(item, index) of data.form.detailList" :key="index" style="margin-top: 5px">
- <!-- <v-select
- v-model="item.sku_id"
- :items="data.combobox.sku_code"
- item-title="label"
- item-value="value"
- :rules="data.rules.sku_id"
- :label="$t('wms.deliveryManagement.sku_code')"
- variant="outlined"
- clearable
- ></v-select> -->
- <v-col :cols="3">
- <v-text-field v-model="item.spu_name" :label="$t('wms.deliveryManagement.spu_name')" variant="outlined" readonly></v-text-field>
- </v-col>
- <v-col :cols="3">
- <v-text-field
- v-model="item.spu_code"
- :label="$t('wms.deliveryManagement.spu_code')"
- :rules="data.rules.spu_code"
- variant="outlined"
- readonly
- ></v-text-field>
- </v-col>
- <v-col :cols="3">
- <v-text-field v-model="item.sku_code" :label="$t('wms.deliveryManagement.sku_code')" variant="outlined" readonly></v-text-field>
- </v-col>
- <v-col :cols="2">
- <v-text-field
- v-model="item.qty"
- :rules="data.rules.qty"
- :label="$t('wms.deliveryManagement.detailQty')"
- variant="outlined"
- clearable
- ></v-text-field>
- </v-col>
- <v-col :cols="1">
- <div class="detailBtnContainer">
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.removeItem(index, item)"
- ></tooltip-btn>
- </div>
- </v-col>
- </v-row>
- <!-- <v-btn style="font-size: 20px; margin-bottom: 15px; margin-top: 10px; float: right" color="primary" :width="40" @click="method.AddDetail">
- +
- </v-btn> -->
- <v-btn
- style="font-size: 20px; margin-bottom: 15px; margin-top: 10px; float: right"
- color="primary"
- :width="40"
- @click="method.openSelect('target')"
- >
- +
- </v-btn>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- <skuSelect :show-dialog="data.showSkuDialogSelect" @close="method.closeDialogSelect('target')" @sureSelect="method.sureSelect" />
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch, nextTick } from 'vue'
-import { DeliveryManagementVO, DeliveryManagementDetailListVO, addRequestVO } from '@/types/DeliveryManagement/DeliveryManagement'
-import i18n from '@/languages/i18n'
-import { errorColor } from '@/constant/style'
-import { hookComponent } from '@/components/system/index'
-import { addShipment } from '@/api/wms/deliveryManagement'
-import { getSupplierAll } from '@/api/base/supplier'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { checkDetailRepeatGetBool } from '@/utils/dataVerification/page'
-import skuSelect from '@/components/select/sku-select.vue'
-import { CommodityDetailJoinMainVO } from '@/types/Base/CommodityManagement'
-import { IsInteger } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: DeliveryManagementVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- curSelectType: '',
- showSkuDialogSelect: false,
- dialogTitle: '',
- form: ref<DeliveryManagementVO>({
- id: 0,
- detailList: []
- }),
- removeDetailList: ref<DeliveryManagementDetailListVO[]>([]),
- combobox: ref<{
- customer_name: {
- label: string
- value: number
- }[]
- }>({
- customer_name: []
- }),
- rules: {
- customer_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.customer_name') }!`
- ],
- spu_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.sku_code') }!`],
- qty: [
- (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
- (val: number) => IsInteger(val, 'greaterThanZero') === '' || IsInteger(val, 'greaterThanZero')
- ]
- }
-})
-
-const method = reactive({
- openSelect: (type: string) => {
- data.curSelectType = type
-
- if (type === 'target') {
- data.showSkuDialogSelect = true
- }
- },
- sureSelect: (selectRecords: CommodityDetailJoinMainVO[]) => {
- if (data.curSelectType === 'target') {
- for (const item of selectRecords) {
- const index = data.form.detailList.findIndex((fi) => fi.sku_id === item.sku_id)
- if (index === -1) {
- data.form.detailList.push({
- id: 0,
- sku_id: item.sku_id,
- spu_code: item.spu_code,
- spu_name: item.spu_name,
- sku_name: item.sku_name,
- sku_code: item.sku_code,
- qty: 0
- })
- }
- }
- }
- },
- closeDialogSelect: (type: string) => {
- if (type === 'target') {
- data.showSkuDialogSelect = false
- }
- },
- clearCommodity: (item: DeliveryManagementDetailListVO) => {
- item.sku_id = 0
- item.sku_code = ''
- item.spu_code = ''
- item.spu_name = ''
- },
- // When customers change
- customerNameChange: (val: string) => {
- if (!val) {
- data.form.customer_id = 0
- } else {
- data.form.customer_id = data.combobox.customer_name.filter((item) => item.label === val)[0].value
- }
- },
- // Add a new detail
- AddDetail: () => {
- data.form.detailList.push({ id: 0, qty: 0 })
- // Let the scroll bar go to the bottom, Improve user experience
- const carText = document.querySelector('.formCard')
- if (carText && carText.scrollHeight > carText.clientHeight) {
- nextTick(() => {
- // Set scroll bar to the bottom
- carText.scrollTop = carText.scrollHeight
- })
- }
- },
- // Get dialog type, add or update
- getDialogType: () => {
- // This is special because this document is not actually a table,
- // but the data associated with another table.
- // so directly use the details to determine whether it is a new document
- if (props.form.detailList.length > 0) {
- data.dialogTitle = 'update'
- } else {
- data.dialogTitle = 'add'
- }
- },
- // Get the options required by the drop-down box
- getCombobox: async () => {
- data.combobox.customer_name = []
- const { data: supplierRes } = await getSupplierAll()
- if (!supplierRes.isSuccess) {
- return
- }
- for (const item of supplierRes.data) {
- if (item.is_valid) {
- data.combobox.customer_name.push({
- label: item.supplier_name,
- value: item.id
- })
- }
- }
- },
- closeDialog: () => {
- emit('close')
- },
- // Details verification before document submission
- beforeSubmit: (): boolean => {
- let flag = true
- if (data.form.detailList.length === 0) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.tips.detailLengthIsZero')
- })
- flag = false
- } else if (checkDetailRepeatGetBool(data.form.detailList, ['sku_id'])) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.tips.detailHasItemRepeat')
- })
- flag = false
- }
- return flag
- },
- submit: async () => {
- const beforeSubmitFlag = method.beforeSubmit()
- if (!beforeSubmitFlag) {
- return
- }
- const { valid } = await formRef.value.validate()
- if (valid) {
- const reqList: addRequestVO[] = []
- for (const item of data.form.detailList) {
- reqList.push({
- customer_id: data.form.customer_id ? data.form.customer_id : 0,
- customer_name: data.form.customer_name ? data.form.customer_name : '',
- qty: item.qty,
- sku_id: item.sku_id ? item.sku_id : 0
- })
- }
- const { data: res } = await addShipment(reqList)
- // const { data: res } = data.dialogTitle === 'add'
- // : await updateRoleMenu({ ...data.form, detailList: [...data.form.detailList, ...data.removeDetailList] }) // Merge the deleted list and the original list
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- },
- // remove detail
- removeItem: (index: number, item: DeliveryManagementDetailListVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
- handleConfirm: async () => {
- if (item.id > 0) {
- item.id = -item.id
- data.removeDetailList.push(item) // Cache remove row
- }
- data.form.detailList.splice(index, 1) // Remove row in detailList
- }
- })
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.getDialogType()
- method.getCombobox()
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-// .v-form {
-// div {
-// margin-bottom: 7px;
-// }
-// }
-.detailBtnContainer {
- height: 56px;
- display: flex;
- justify-content: center;
- align-items: center;
-}
-// .v-col {
-// padding: 0 !important;
-// }
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'70%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card class="formCard">
+ <v-toolbar color="white" :title="`${$t('router.sideBar.deliveryManagement')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-select
+ v-model="data.form.customer_name"
+ :items="data.combobox.customer_name"
+ item-title="label"
+ item-value="label"
+ :rules="data.rules.customer_name"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="outlined"
+ clearable
+ @update:model-value="method.customerNameChange"
+ ></v-select>
+ <v-row v-for="(item, index) of data.form.detailList" :key="index" style="margin-top: 5px">
+ <!-- <v-select
+ v-model="item.sku_id"
+ :items="data.combobox.sku_code"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.sku_id"
+ :label="$t('wms.deliveryManagement.sku_code')"
+ variant="outlined"
+ clearable
+ ></v-select> -->
+ <v-col :cols="3">
+ <v-text-field v-model="item.spu_name" :label="$t('wms.deliveryManagement.spu_name')" variant="outlined" readonly></v-text-field>
+ </v-col>
+ <v-col :cols="3">
+ <v-text-field
+ v-model="item.spu_code"
+ :label="$t('wms.deliveryManagement.spu_code')"
+ :rules="data.rules.spu_code"
+ variant="outlined"
+ readonly
+ ></v-text-field>
+ </v-col>
+ <v-col :cols="3">
+ <v-text-field v-model="item.sku_code" :label="$t('wms.deliveryManagement.sku_code')" variant="outlined" readonly></v-text-field>
+ </v-col>
+ <v-col :cols="2">
+ <v-text-field
+ v-model="item.qty"
+ :rules="data.rules.qty"
+ :label="$t('wms.deliveryManagement.detailQty')"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ </v-col>
+ <v-col :cols="1">
+ <div class="detailBtnContainer">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.removeItem(index, item)"
+ ></tooltip-btn>
+ </div>
+ </v-col>
+ </v-row>
+ <!-- <v-btn style="font-size: 20px; margin-bottom: 15px; margin-top: 10px; float: right" color="primary" :width="40" @click="method.AddDetail">
+ +
+ </v-btn> -->
+ <v-btn
+ style="font-size: 20px; margin-bottom: 15px; margin-top: 10px; float: right"
+ color="primary"
+ :width="40"
+ @click="method.openSelect('target')"
+ >
+ +
+ </v-btn>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ <skuSelect :show-dialog="data.showSkuDialogSelect" @close="method.closeDialogSelect('target')" @sureSelect="method.sureSelect" />
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch, nextTick } from 'vue'
+import { DeliveryManagementVO, DeliveryManagementDetailListVO, addRequestVO } from '@/types/DeliveryManagement/DeliveryManagement'
+import i18n from '@/languages/i18n'
+import { errorColor } from '@/constant/style'
+import { hookComponent } from '@/components/system/index'
+import { addShipment } from '@/api/wms/deliveryManagement'
+import { getSupplierAll } from '@/api/base/supplier'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { checkDetailRepeatGetBool } from '@/utils/dataVerification/page'
+import skuSelect from '@/components/select/sku-select.vue'
+import { CommodityDetailJoinMainVO } from '@/types/Base/CommodityManagement'
+import { IsInteger } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: DeliveryManagementVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ curSelectType: '',
+ showSkuDialogSelect: false,
+ dialogTitle: '',
+ form: ref<DeliveryManagementVO>({
+ id: 0,
+ detailList: []
+ }),
+ removeDetailList: ref<DeliveryManagementDetailListVO[]>([]),
+ combobox: ref<{
+ customer_name: {
+ label: string
+ value: number
+ }[]
+ }>({
+ customer_name: []
+ }),
+ rules: {
+ customer_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.customer_name') }!`
+ ],
+ spu_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.sku_code') }!`],
+ qty: [
+ (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
+ (val: number) => IsInteger(val, 'greaterThanZero') === '' || IsInteger(val, 'greaterThanZero')
+ ]
+ }
+})
+
+const method = reactive({
+ openSelect: (type: string) => {
+ data.curSelectType = type
+
+ if (type === 'target') {
+ data.showSkuDialogSelect = true
+ }
+ },
+ sureSelect: (selectRecords: CommodityDetailJoinMainVO[]) => {
+ if (data.curSelectType === 'target') {
+ for (const item of selectRecords) {
+ const index = data.form.detailList.findIndex((fi) => fi.sku_id === item.sku_id)
+ if (index === -1) {
+ data.form.detailList.push({
+ id: 0,
+ sku_id: item.sku_id,
+ spu_code: item.spu_code,
+ spu_name: item.spu_name,
+ sku_name: item.sku_name,
+ sku_code: item.sku_code,
+ qty: 0
+ })
+ }
+ }
+ }
+ },
+ closeDialogSelect: (type: string) => {
+ if (type === 'target') {
+ data.showSkuDialogSelect = false
+ }
+ },
+ clearCommodity: (item: DeliveryManagementDetailListVO) => {
+ item.sku_id = 0
+ item.sku_code = ''
+ item.spu_code = ''
+ item.spu_name = ''
+ },
+ // When customers change
+ customerNameChange: (val: string) => {
+ if (!val) {
+ data.form.customer_id = 0
+ } else {
+ data.form.customer_id = data.combobox.customer_name.filter((item) => item.label === val)[0].value
+ }
+ },
+ // Add a new detail
+ AddDetail: () => {
+ data.form.detailList.push({ id: 0, qty: 0 })
+ // Let the scroll bar go to the bottom, Improve user experience
+ const carText = document.querySelector('.formCard')
+ if (carText && carText.scrollHeight > carText.clientHeight) {
+ nextTick(() => {
+ // Set scroll bar to the bottom
+ carText.scrollTop = carText.scrollHeight
+ })
+ }
+ },
+ // Get dialog type, add or update
+ getDialogType: () => {
+ // This is special because this document is not actually a table,
+ // but the data associated with another table.
+ // so directly use the details to determine whether it is a new document
+ if (props.form.detailList.length > 0) {
+ data.dialogTitle = 'update'
+ } else {
+ data.dialogTitle = 'add'
+ }
+ },
+ // Get the options required by the drop-down box
+ getCombobox: async () => {
+ data.combobox.customer_name = []
+ const { data: supplierRes } = await getSupplierAll()
+ if (!supplierRes.isSuccess) {
+ return
+ }
+ for (const item of supplierRes.data) {
+ if (item.is_valid) {
+ data.combobox.customer_name.push({
+ label: item.supplier_name,
+ value: item.id
+ })
+ }
+ }
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ // Details verification before document submission
+ beforeSubmit: (): boolean => {
+ let flag = true
+ if (data.form.detailList.length === 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.tips.detailLengthIsZero')
+ })
+ flag = false
+ } else if (checkDetailRepeatGetBool(data.form.detailList, ['sku_id'])) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.tips.detailHasItemRepeat')
+ })
+ flag = false
+ }
+ return flag
+ },
+ submit: async () => {
+ const beforeSubmitFlag = method.beforeSubmit()
+ if (!beforeSubmitFlag) {
+ return
+ }
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const reqList: addRequestVO[] = []
+ for (const item of data.form.detailList) {
+ reqList.push({
+ customer_id: data.form.customer_id ? data.form.customer_id : 0,
+ customer_name: data.form.customer_name ? data.form.customer_name : '',
+ qty: item.qty,
+ sku_id: item.sku_id ? item.sku_id : 0
+ })
+ }
+ const { data: res } = await addShipment(reqList)
+ // const { data: res } = data.dialogTitle === 'add'
+ // : await updateRoleMenu({ ...data.form, detailList: [...data.form.detailList, ...data.removeDetailList] }) // Merge the deleted list and the original list
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ },
+ // remove detail
+ removeItem: (index: number, item: DeliveryManagementDetailListVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
+ handleConfirm: async () => {
+ if (item.id > 0) {
+ item.id = -item.id
+ data.removeDetailList.push(item) // Cache remove row
+ }
+ data.form.detailList.splice(index, 1) // Remove row in detailList
+ }
+ })
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.getDialogType()
+ method.getCombobox()
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+// .v-form {
+// div {
+// margin-bottom: 7px;
+// }
+// }
+.detailBtnContainer {
+ height: 56px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+// .v-col {
+// padding: 0 !important;
+// }
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/confirm-order.vue b/frontend/src/view/deliveryManagement/deliveryManagement/confirm-order.vue
index 8bbe40b..e18c22e 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/confirm-order.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/confirm-order.vue
@@ -1,254 +1,254 @@
-<template>
- <v-dialog v-model="isShow" :width="'70%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card class="formCard">
- <v-toolbar color="white" :title="`${$t('wms.deliveryManagement.confirmOrder')}`"></v-toolbar>
- <v-card-text>
- <v-row>
- <v-col :cols="5">
- <vxe-table
- ref="xTable"
- keep-source
- :column-config="{ minWidth: '100px' }"
- :data="data.treeData"
- :height="'500px'"
- align="center"
- :cell-style="method.cellStyle"
- @cell-click="method.cellClick"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="40"></vxe-column>
- <vxe-column width="40">
- <template #default="{ row }">
- <div style="height: 100%; display: flex; align-items: center; justify-content: center">
- <vxe-checkbox v-model="row.confirm"></vxe-checkbox>
- </div>
- </template>
- </vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"> </vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"> </vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')">
- <template #default="{ row }">
- <span :style="data.validList.includes(row.sku_code) ? 'color: red' : ''">{{ row.sku_code }}</span>
- </template>
- </vxe-column>
- </vxe-table>
- <!-- <v-card :height="tableHeight"> -->
- <!-- <NavListVue
- :list-data="data.treeData"
- :title="data.navListOptions.title"
- :label-key="data.navListOptions.labelKey"
- :index-key="data.navListOptions.indexKey"
- :index-value="data.navListOptions.indexValue"
- @item-click="method.navListClick"
- /> -->
- <!-- </v-card> -->
- </v-col>
- <v-col :cols="7">
- <vxe-table
- ref="detailXTable"
- keep-source
- :column-config="{ minWidth: '100px' }"
- :data="data.tableData"
- :height="'500px'"
- align="center"
- :edit-config="{ trigger: 'click', mode: 'cell' }"
- :edit-rules="data.validRules"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="warehouse_name" :title="$t('wms.stock.warehouse')"> </vxe-column>
- <vxe-column field="location_name" :title="$t('wms.stock.location_name')"> </vxe-column>
- <vxe-column field="goods_owner_name" :title="$t('base.ownerOfCargo.goods_owner_name')"> </vxe-column>
- <vxe-column field="qty_available" :title="$t('wms.deliveryManagement.qty_available')"></vxe-column>
- <vxe-column field="pick_qty" :title="$t('wms.deliveryManagement.detailQty')" :edit-render="{}">
- <template #edit="{ row }">
- <vxe-input v-model="row.pick_qty" type="text"></vxe-input>
- </template>
- </vxe-column>
- </vxe-table>
- </v-col>
- </v-row>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { ConfirmOrderVO, ConfirmOrderPickListVO } from '@/types/DeliveryManagement/DeliveryManagement'
-import i18n from '@/languages/i18n'
-import { getConfirmOrderInfoAndStock, confirmOrder } from '@/api/wms/deliveryManagement'
-import { hookComponent } from '@/components/system/index'
-import { isInteger } from '@/utils/dataVerification/tableRule'
-
-const xTable = ref()
-const detailXTable = ref()
-
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- confirmOrderNo: string
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- navListOptions: {
- title: i18n.global.t('wms.deliveryManagement.orderDetail'),
- labelKey: 'sku_code',
- indexKey: 'sku_code',
- indexValue: ''
- },
- treeData: ref<ConfirmOrderVO[]>([]),
- tableData: ref<ConfirmOrderPickListVO[]>([]),
- // List of verification results for each commodity
- validList: ref<string[]>([]),
- validRules: ref<any>({
- pick_qty: [
- {
- validator: isInteger,
- validNumerical: 'nonNegative',
- trigger: 'change'
- }
- ]
- })
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- beforeSubmit: (): boolean => {
- // let flag = true
- data.validList = []
- const msgList: string[] = []
- let orderCount = 0
- if (data.treeData.filter((fl) => fl.confirm).length <= 0) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('wms.deliveryManagement.NoItemSelected')
- })
- return false
- }
- for (const item of data.treeData) {
- if (item.confirm) {
- let count = 0
- for (const dItem of item.pick_list) {
- count += Number(dItem.pick_qty)
- }
- orderCount += count
- if (count > item.qty) {
- data.validList.push(item.sku_code)
- msgList.push(`${ item.sku_code } ${ i18n.global.t('wms.deliveryManagement.quantityOverflow') } ${ item.qty }`)
- // flag = false
- }
- if (count === 0) {
- if (!data.validList.includes(item.sku_code)) {
- data.validList.push(item.sku_code)
- }
- msgList.push(`${ item.sku_code } ${ i18n.global.t('wms.deliveryManagement.detailQuantityIsZero') }!`)
- }
- }
- }
- // return flag
- if (msgList.length > 0) {
- hookComponent.$message({
- type: 'error',
- content: msgList.join(';\n')
- })
- return false
- }
- if (orderCount <= 0) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('wms.deliveryManagement.quantityIsZero')
- })
- return false
- }
- return true
- },
- submit: async () => {
- const $table = detailXTable.value
- const errMap = await $table.validate(true)
- if (errMap) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- return
- }
- if (method.beforeSubmit()) {
- // console.log(data.treeData)
- const { data: res } = await confirmOrder(data.treeData)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: i18n.global.t('wms.deliveryManagement.confirmSuccess')
- })
- emit('saveSuccess')
- }
- },
- getInfoByNo: async () => {
- const { data: res } = await getConfirmOrderInfoAndStock(props.confirmOrderNo)
- if (!res.isSuccess) {
- return
- }
- data.treeData = res.data
- data.tableData = []
- if (data.treeData.length > 0) {
- method.cellClick({ row: data.treeData[0] })
- }
- },
- cellClick: ({ row }: { row: ConfirmOrderVO }) => {
- data.navListOptions.indexValue = row.sku_code
- data.tableData = row.pick_list
- },
- // When clicking the left tree
- navListClick: (item: ConfirmOrderVO) => {
- data.navListOptions.indexValue = item.sku_code
- data.tableData = item.pick_list
- },
- cellStyle: ({ row }: { row: ConfirmOrderVO }) => {
- const style: any = { cursor: 'pointer' }
- if (row.sku_code === data.navListOptions.indexValue) {
- style.backgroundColor = '#e6dafd'
- }
- return style
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.getInfoByNo()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.detailBtnContainer {
- height: 56px;
- display: flex;
- justify-content: center;
- align-items: center;
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'70%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card class="formCard">
+ <v-toolbar color="white" :title="`${$t('wms.deliveryManagement.confirmOrder')}`"></v-toolbar>
+ <v-card-text>
+ <v-row>
+ <v-col :cols="5">
+ <vxe-table
+ ref="xTable"
+ keep-source
+ :column-config="{ minWidth: '100px' }"
+ :data="data.treeData"
+ :height="'500px'"
+ align="center"
+ :cell-style="method.cellStyle"
+ @cell-click="method.cellClick"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="40"></vxe-column>
+ <vxe-column width="40">
+ <template #default="{ row }">
+ <div style="height: 100%; display: flex; align-items: center; justify-content: center">
+ <vxe-checkbox v-model="row.confirm"></vxe-checkbox>
+ </div>
+ </template>
+ </vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"> </vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"> </vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')">
+ <template #default="{ row }">
+ <span :style="data.validList.includes(row.sku_code) ? 'color: red' : ''">{{ row.sku_code }}</span>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <!-- <v-card :height="tableHeight"> -->
+ <!-- <NavListVue
+ :list-data="data.treeData"
+ :title="data.navListOptions.title"
+ :label-key="data.navListOptions.labelKey"
+ :index-key="data.navListOptions.indexKey"
+ :index-value="data.navListOptions.indexValue"
+ @item-click="method.navListClick"
+ /> -->
+ <!-- </v-card> -->
+ </v-col>
+ <v-col :cols="7">
+ <vxe-table
+ ref="detailXTable"
+ keep-source
+ :column-config="{ minWidth: '100px' }"
+ :data="data.tableData"
+ :height="'500px'"
+ align="center"
+ :edit-config="{ trigger: 'click', mode: 'cell' }"
+ :edit-rules="data.validRules"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="warehouse_name" :title="$t('wms.stock.warehouse')"> </vxe-column>
+ <vxe-column field="location_name" :title="$t('wms.stock.location_name')"> </vxe-column>
+ <vxe-column field="goods_owner_name" :title="$t('base.ownerOfCargo.goods_owner_name')"> </vxe-column>
+ <vxe-column field="qty_available" :title="$t('wms.deliveryManagement.qty_available')"></vxe-column>
+ <vxe-column field="pick_qty" :title="$t('wms.deliveryManagement.detailQty')" :edit-render="{}">
+ <template #edit="{ row }">
+ <vxe-input v-model="row.pick_qty" type="text"></vxe-input>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ </v-col>
+ </v-row>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { ConfirmOrderVO, ConfirmOrderPickListVO } from '@/types/DeliveryManagement/DeliveryManagement'
+import i18n from '@/languages/i18n'
+import { getConfirmOrderInfoAndStock, confirmOrder } from '@/api/wms/deliveryManagement'
+import { hookComponent } from '@/components/system/index'
+import { isInteger } from '@/utils/dataVerification/tableRule'
+
+const xTable = ref()
+const detailXTable = ref()
+
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ confirmOrderNo: string
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ navListOptions: {
+ title: i18n.global.t('wms.deliveryManagement.orderDetail'),
+ labelKey: 'sku_code',
+ indexKey: 'sku_code',
+ indexValue: ''
+ },
+ treeData: ref<ConfirmOrderVO[]>([]),
+ tableData: ref<ConfirmOrderPickListVO[]>([]),
+ // List of verification results for each commodity
+ validList: ref<string[]>([]),
+ validRules: ref<any>({
+ pick_qty: [
+ {
+ validator: isInteger,
+ validNumerical: 'nonNegative',
+ trigger: 'change'
+ }
+ ]
+ })
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ beforeSubmit: (): boolean => {
+ // let flag = true
+ data.validList = []
+ const msgList: string[] = []
+ let orderCount = 0
+ if (data.treeData.filter((fl) => fl.confirm).length <= 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('wms.deliveryManagement.NoItemSelected')
+ })
+ return false
+ }
+ for (const item of data.treeData) {
+ if (item.confirm) {
+ let count = 0
+ for (const dItem of item.pick_list) {
+ count += Number(dItem.pick_qty)
+ }
+ orderCount += count
+ if (count > item.qty) {
+ data.validList.push(item.sku_code)
+ msgList.push(`${ item.sku_code } ${ i18n.global.t('wms.deliveryManagement.quantityOverflow') } ${ item.qty }`)
+ // flag = false
+ }
+ if (count === 0) {
+ if (!data.validList.includes(item.sku_code)) {
+ data.validList.push(item.sku_code)
+ }
+ msgList.push(`${ item.sku_code } ${ i18n.global.t('wms.deliveryManagement.detailQuantityIsZero') }!`)
+ }
+ }
+ }
+ // return flag
+ if (msgList.length > 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: msgList.join(';\n')
+ })
+ return false
+ }
+ if (orderCount <= 0) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('wms.deliveryManagement.quantityIsZero')
+ })
+ return false
+ }
+ return true
+ },
+ submit: async () => {
+ const $table = detailXTable.value
+ const errMap = await $table.validate(true)
+ if (errMap) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ return
+ }
+ if (method.beforeSubmit()) {
+ // console.log(data.treeData)
+ const { data: res } = await confirmOrder(data.treeData)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: i18n.global.t('wms.deliveryManagement.confirmSuccess')
+ })
+ emit('saveSuccess')
+ }
+ },
+ getInfoByNo: async () => {
+ const { data: res } = await getConfirmOrderInfoAndStock(props.confirmOrderNo)
+ if (!res.isSuccess) {
+ return
+ }
+ data.treeData = res.data
+ data.tableData = []
+ if (data.treeData.length > 0) {
+ method.cellClick({ row: data.treeData[0] })
+ }
+ },
+ cellClick: ({ row }: { row: ConfirmOrderVO }) => {
+ data.navListOptions.indexValue = row.sku_code
+ data.tableData = row.pick_list
+ },
+ // When clicking the left tree
+ navListClick: (item: ConfirmOrderVO) => {
+ data.navListOptions.indexValue = item.sku_code
+ data.tableData = item.pick_list
+ },
+ cellStyle: ({ row }: { row: ConfirmOrderVO }) => {
+ const style: any = { cursor: 'pointer' }
+ if (row.sku_code === data.navListOptions.indexValue) {
+ style.backgroundColor = '#e6dafd'
+ }
+ return style
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.getInfoByNo()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.detailBtnContainer {
+ height: 56px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/deliveryManagement.vue b/frontend/src/view/deliveryManagement/deliveryManagement/deliveryManagement.vue
index ea018f7..0e030a6 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/deliveryManagement.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/deliveryManagement.vue
@@ -1,255 +1,254 @@
-<!-- Warehouse Setting -->
-<template>
- <div class="container">
- <div>
- <v-tabs v-model="data.activeTab" stacked @update:model-value="method.changeTabs">
- <v-tab v-for="(item, index) of tabsConfig" :key="index" :value="item.value">
- <v-icon>{{ item.icon }}</v-icon>
- <p class="tabItemTitle">{{ item.tabName }}</p>
- </v-tab>
- </v-tabs>
-
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <v-window v-model="data.activeTab">
- <v-window-item value="tabShipment">
- <tabShipment ref="tabShipmentRef" />
- </v-window-item>
- <v-window-item value="tabPreShipment">
- <tabPreShipment ref="tabPreShipmentRef" />
- </v-window-item>
- <v-window-item value="tabNewShipment">
- <tabNewShipment ref="tabNewShipmentRef" />
- </v-window-item>
- <v-window-item value="tabGoodsToBePicked">
- <tabGoodsToBePicked ref="tabGoodsToBePickedRef" />
- </v-window-item>
- <v-window-item value="tabPicked">
- <tabPicked ref="tabPickedRef" />
- </v-window-item>
- <v-window-item value="tabToBePackaged">
- <tabToBePackaged ref="tabToBePackagedRef" />
- </v-window-item>
- <v-window-item value="tabPackaged">
- <tabPackaged ref="tabPackagedRef" />
- </v-window-item>
- <v-window-item value="tabToBeWeighed">
- <tabToBeWeighed ref="tabToBeWeighedRef" />
- </v-window-item>
- <v-window-item value="tabWeighed">
- <tabWeighed ref="tabWeighedRef" />
- </v-window-item>
- <v-window-item value="tabToBeDelivered">
- <tabToBeDelivered ref="tabToBeDeliveredRef" />
- </v-window-item>
- <v-window-item value="tabDelivered">
- <tabDelivered ref="tabDeliveredRef" />
- </v-window-item>
- <v-window-item value="tabSignIn">
- <tabSignIn ref="tabSignInRef" />
- </v-window-item>
- </v-window>
- </v-card-text>
- </v-card>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { ref, reactive, onMounted, nextTick } from 'vue'
-import i18n from '@/languages/i18n'
-import tabShipment from './tabShipment.vue'
-import tabPreShipment from './tabPreShipment.vue'
-import tabNewShipment from './tabNewShipment.vue'
-import tabGoodsToBePicked from './tabGoodsToBePicked.vue'
-import tabPicked from './tabPicked.vue'
-import tabToBePackaged from './tabToBePackaged.vue'
-import tabPackaged from './tabPackaged.vue'
-import tabToBeWeighed from './tabToBeWeighed.vue'
-import tabWeighed from './tabWeighed.vue'
-import tabToBeDelivered from './tabToBeDelivered.vue'
-import tabDelivered from './tabDelivered.vue'
-import tabSignIn from './tabSignIn.vue'
-
-const tabShipmentRef = ref()
-const tabPreShipmentRef = ref()
-const tabNewShipmentRef = ref()
-const tabGoodsToBePickedRef = ref()
-const tabPickedRef = ref()
-const tabToBePackagedRef = ref()
-const tabPackagedRef = ref()
-const tabToBeWeighedRef = ref()
-const tabWeighedRef = ref()
-const tabToBeDeliveredRef = ref()
-const tabDeliveredRef = ref()
-const tabSignInRef = ref()
-
-const tabsConfig = [
- {
- value: 'tabShipment',
- icon: 'mdi-clipboard-list',
- tabName: i18n.global.t('wms.deliveryManagement.shipment')
- },
- {
- value: 'tabPreShipment',
- icon: 'mdi-list-box-outline',
- tabName: i18n.global.t('wms.deliveryManagement.preShipment')
- },
- {
- value: 'tabNewShipment',
- icon: 'mdi-list-box',
- tabName: i18n.global.t('wms.deliveryManagement.newShipment')
- },
- {
- value: 'tabGoodsToBePicked',
- icon: 'mdi-dolly',
- tabName: i18n.global.t('wms.deliveryManagement.goodsToBePicked')
- },
- {
- value: 'tabPicked',
- icon: 'mdi-human-dolly',
- tabName: i18n.global.t('wms.deliveryManagement.picked')
- },
- {
- value: 'tabToBePackaged',
- icon: 'mdi-package-variant',
- tabName: i18n.global.t('wms.deliveryManagement.toBePackaged')
- },
- {
- value: 'tabPackaged',
- icon: 'mdi-package-variant-closed-check',
- tabName: i18n.global.t('wms.deliveryManagement.packaged')
- },
- {
- value: 'tabToBeWeighed',
- icon: 'mdi-basket-fill',
- tabName: i18n.global.t('wms.deliveryManagement.toBeWeighed')
- },
- {
- value: 'tabWeighed',
- icon: 'mdi-weight',
- tabName: i18n.global.t('wms.deliveryManagement.weighed')
- },
- {
- value: 'tabToBeDelivered',
- icon: 'mdi-send-outline',
- tabName: i18n.global.t('wms.deliveryManagement.toBeDelivered')
- },
- {
- value: 'tabDelivered',
- icon: 'mdi-send',
- tabName: i18n.global.t('wms.deliveryManagement.outOfWarehouse')
- },
- {
- value: 'tabSignIn',
- icon: 'mdi-check-circle',
- tabName: i18n.global.t('wms.deliveryManagement.signedIn')
- }
-]
-
-const data = reactive({
- activeTab: '',
- isLoadstockLocation: false,
- isLoadstock: false
-})
-
-const method = reactive({
- changeTabs: (e: any): void => {
- nextTick(() => {
- switch (e) {
- case 'tabShipment':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabShipmentRef?.value?.getShipment) {
- tabShipmentRef.value.getShipment()
- }
- break
- case 'tabPreShipment':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabPreShipmentRef?.value?.getPreShipment) {
- tabPreShipmentRef.value.getPreShipment()
- }
- break
- case 'tabNewShipment':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabNewShipmentRef?.value?.getNewShipment) {
- tabNewShipmentRef.value.getNewShipment()
- }
- break
- case 'tabGoodsToBePicked':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabGoodsToBePickedRef?.value?.getGoodsToBePicked) {
- tabGoodsToBePickedRef.value.getGoodsToBePicked()
- }
- break
- case 'tabToBePackaged':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabToBePackagedRef?.value?.getToBePackaged) {
- tabToBePackagedRef.value.getToBePackaged()
- }
- break
- case 'tabPackaged':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabPackagedRef?.value?.getPackaged) {
- tabPackagedRef.value.getPackaged()
- }
- break
- case 'tabToBeWeighed':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabToBeWeighedRef?.value?.getToBeWeighed) {
- tabToBeWeighedRef.value.getToBeWeighed()
- }
- break
- case 'tabWeighed':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabWeighedRef?.value?.getWeighed) {
- tabWeighedRef.value.getWeighed()
- }
- break
- case 'tabPicked':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabPickedRef?.value?.getPicked) {
- tabPickedRef.value.getPicked()
- }
- break
- case 'tabToBeDelivered':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabToBeDeliveredRef?.value?.getToBeDelivery) {
- tabToBeDeliveredRef.value.getToBeDelivery()
- }
- break
- case 'tabDelivered':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabDeliveredRef?.value?.getDelivery) {
- tabDeliveredRef.value.getDelivery()
- }
- break
- case 'tabSignIn':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabSignInRef?.value?.getSignIn) {
- tabSignInRef.value.getSignIn()
- }
- break
- }
- })
- }
-})
-
-onMounted(() => {})
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="container">
+ <div>
+ <v-tabs v-model="data.activeTab" stacked @update:model-value="method.changeTabs">
+ <v-tab v-for="(item, index) of tabsConfig" :key="index" :value="item.value">
+ <v-icon>{{ item.icon }}</v-icon>
+ <p class="tabItemTitle">{{ item.tabName }}</p>
+ </v-tab>
+ </v-tabs>
+
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <v-window v-model="data.activeTab">
+ <v-window-item value="tabShipment">
+ <tabShipment ref="tabShipmentRef" />
+ </v-window-item>
+ <v-window-item value="tabPreShipment">
+ <tabPreShipment ref="tabPreShipmentRef" />
+ </v-window-item>
+ <v-window-item value="tabNewShipment">
+ <tabNewShipment ref="tabNewShipmentRef" />
+ </v-window-item>
+ <v-window-item value="tabGoodsToBePicked">
+ <tabGoodsToBePicked ref="tabGoodsToBePickedRef" />
+ </v-window-item>
+ <v-window-item value="tabPicked">
+ <tabPicked ref="tabPickedRef" />
+ </v-window-item>
+ <v-window-item value="tabToBePackaged">
+ <tabToBePackaged ref="tabToBePackagedRef" />
+ </v-window-item>
+ <v-window-item value="tabPackaged">
+ <tabPackaged ref="tabPackagedRef" />
+ </v-window-item>
+ <v-window-item value="tabToBeWeighed">
+ <tabToBeWeighed ref="tabToBeWeighedRef" />
+ </v-window-item>
+ <v-window-item value="tabWeighed">
+ <tabWeighed ref="tabWeighedRef" />
+ </v-window-item>
+ <v-window-item value="tabToBeDelivered">
+ <tabToBeDelivered ref="tabToBeDeliveredRef" />
+ </v-window-item>
+ <v-window-item value="tabDelivered">
+ <tabDelivered ref="tabDeliveredRef" />
+ </v-window-item>
+ <v-window-item value="tabSignIn">
+ <tabSignIn ref="tabSignInRef" />
+ </v-window-item>
+ </v-window>
+ </v-card-text>
+ </v-card>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { ref, reactive, onMounted, nextTick } from 'vue'
+import i18n from '@/languages/i18n'
+import tabShipment from './tabShipment.vue'
+import tabPreShipment from './tabPreShipment.vue'
+import tabNewShipment from './tabNewShipment.vue'
+import tabGoodsToBePicked from './tabGoodsToBePicked.vue'
+import tabPicked from './tabPicked.vue'
+import tabToBePackaged from './tabToBePackaged.vue'
+import tabPackaged from './tabPackaged.vue'
+import tabToBeWeighed from './tabToBeWeighed.vue'
+import tabWeighed from './tabWeighed.vue'
+import tabToBeDelivered from './tabToBeDelivered.vue'
+import tabDelivered from './tabDelivered.vue'
+import tabSignIn from './tabSignIn.vue'
+
+const tabShipmentRef = ref()
+const tabPreShipmentRef = ref()
+const tabNewShipmentRef = ref()
+const tabGoodsToBePickedRef = ref()
+const tabPickedRef = ref()
+const tabToBePackagedRef = ref()
+const tabPackagedRef = ref()
+const tabToBeWeighedRef = ref()
+const tabWeighedRef = ref()
+const tabToBeDeliveredRef = ref()
+const tabDeliveredRef = ref()
+const tabSignInRef = ref()
+
+const tabsConfig = [
+ {
+ value: 'tabShipment',
+ icon: 'mdi-clipboard-list',
+ tabName: i18n.global.t('wms.deliveryManagement.shipment')
+ },
+ {
+ value: 'tabPreShipment',
+ icon: 'mdi-list-box-outline',
+ tabName: i18n.global.t('wms.deliveryManagement.preShipment')
+ },
+ {
+ value: 'tabNewShipment',
+ icon: 'mdi-list-box',
+ tabName: i18n.global.t('wms.deliveryManagement.newShipment')
+ },
+ {
+ value: 'tabGoodsToBePicked',
+ icon: 'mdi-dolly',
+ tabName: i18n.global.t('wms.deliveryManagement.goodsToBePicked')
+ },
+ {
+ value: 'tabPicked',
+ icon: 'mdi-human-dolly',
+ tabName: i18n.global.t('wms.deliveryManagement.picked')
+ },
+ {
+ value: 'tabToBePackaged',
+ icon: 'mdi-package-variant',
+ tabName: i18n.global.t('wms.deliveryManagement.toBePackaged')
+ },
+ {
+ value: 'tabPackaged',
+ icon: 'mdi-package-variant-closed-check',
+ tabName: i18n.global.t('wms.deliveryManagement.packaged')
+ },
+ {
+ value: 'tabToBeWeighed',
+ icon: 'mdi-basket-fill',
+ tabName: i18n.global.t('wms.deliveryManagement.toBeWeighed')
+ },
+ {
+ value: 'tabWeighed',
+ icon: 'mdi-weight',
+ tabName: i18n.global.t('wms.deliveryManagement.weighed')
+ },
+ {
+ value: 'tabToBeDelivered',
+ icon: 'mdi-send-outline',
+ tabName: i18n.global.t('wms.deliveryManagement.toBeDelivered')
+ },
+ {
+ value: 'tabDelivered',
+ icon: 'mdi-send',
+ tabName: i18n.global.t('wms.deliveryManagement.outOfWarehouse')
+ },
+ {
+ value: 'tabSignIn',
+ icon: 'mdi-check-circle',
+ tabName: i18n.global.t('wms.deliveryManagement.signedIn')
+ }
+]
+
+const data = reactive({
+ activeTab: '',
+ isLoadstockLocation: false,
+ isLoadstock: false
+})
+
+const method = reactive({
+ changeTabs: (e: any): void => {
+ nextTick(() => {
+ switch (e) {
+ case 'tabShipment':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabShipmentRef?.value?.getShipment) {
+ tabShipmentRef.value.getShipment()
+ }
+ break
+ case 'tabPreShipment':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabPreShipmentRef?.value?.getPreShipment) {
+ tabPreShipmentRef.value.getPreShipment()
+ }
+ break
+ case 'tabNewShipment':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabNewShipmentRef?.value?.getNewShipment) {
+ tabNewShipmentRef.value.getNewShipment()
+ }
+ break
+ case 'tabGoodsToBePicked':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabGoodsToBePickedRef?.value?.getGoodsToBePicked) {
+ tabGoodsToBePickedRef.value.getGoodsToBePicked()
+ }
+ break
+ case 'tabToBePackaged':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabToBePackagedRef?.value?.getToBePackaged) {
+ tabToBePackagedRef.value.getToBePackaged()
+ }
+ break
+ case 'tabPackaged':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabPackagedRef?.value?.getPackaged) {
+ tabPackagedRef.value.getPackaged()
+ }
+ break
+ case 'tabToBeWeighed':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabToBeWeighedRef?.value?.getToBeWeighed) {
+ tabToBeWeighedRef.value.getToBeWeighed()
+ }
+ break
+ case 'tabWeighed':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabWeighedRef?.value?.getWeighed) {
+ tabWeighedRef.value.getWeighed()
+ }
+ break
+ case 'tabPicked':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabPickedRef?.value?.getPicked) {
+ tabPickedRef.value.getPicked()
+ }
+ break
+ case 'tabToBeDelivered':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabToBeDeliveredRef?.value?.getToBeDelivery) {
+ tabToBeDeliveredRef.value.getToBeDelivery()
+ }
+ break
+ case 'tabDelivered':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabDeliveredRef?.value?.getDelivery) {
+ tabDeliveredRef.value.getDelivery()
+ }
+ break
+ case 'tabSignIn':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabSignInRef?.value?.getSignIn) {
+ tabSignInRef.value.getSignIn()
+ }
+ break
+ }
+ })
+ }
+})
+
+onMounted(() => {})
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/package-confirm.vue b/frontend/src/view/deliveryManagement/deliveryManagement/package-confirm.vue
index 4625c1d..841b4fe 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/package-confirm.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/package-confirm.vue
@@ -1,140 +1,140 @@
-<template>
- <v-dialog v-model="isShow" :width="'70%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card class="formCard">
- <v-toolbar color="white" :title="dialogTitle"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-row v-for="(item, index) of data.list" :key="index">
- <v-col :cols="3">
- <v-text-field v-model="item.spu_name" :label="$t('wms.deliveryManagement.spu_name')" variant="outlined" readonly></v-text-field>
- </v-col>
- <v-col :cols="3">
- <v-text-field v-model="item.spu_code" :label="$t('wms.deliveryManagement.spu_code')" variant="outlined" readonly></v-text-field>
- </v-col>
- <v-col :cols="isWeight ? 2 : 3">
- <v-text-field v-model="item.sku_code" :label="$t('wms.deliveryManagement.sku_code')" variant="outlined" readonly></v-text-field>
- </v-col>
- <v-col :cols="isWeight ? 2 : 3">
- <v-text-field
- v-model="item.qty"
- :rules="data.rules.qty"
- :label="isSignIn ? $t('wms.deliveryManagement.damagedQuantity') : $t('wms.deliveryManagement.detailQty')"
- variant="outlined"
- clearable
- ></v-text-field>
- </v-col>
- <v-col v-if="isWeight" :cols="2">
- <v-text-field
- v-model="item.weight"
- :rules="data.rules.weight"
- :label="$t('wms.deliveryManagement.detailWeight') + '(' + item.weight_unit + ')'"
- variant="outlined"
- clearable
- ></v-text-field>
- </v-col>
- </v-row>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { ref, reactive, computed, defineEmits, watch } from 'vue'
-import { hookComponent } from '@/components/system/index'
-import i18n from '@/languages/i18n'
-import { IsInteger, IsDecimal } from '@/utils/dataVerification/formRule'
-import { ConfirmItem } from '@/types/DeliveryManagement/DeliveryManagement'
-
-const emit = defineEmits(['close', 'submit'])
-
-const props = defineProps<{
- showDialog: boolean
- dataList: ConfirmItem[]
- isWeight: boolean
- isSignIn?: boolean
- dialogTitle: string
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- list: ref<ConfirmItem[]>([]),
- rules: {
- qty: [
- (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
- (val: number) => IsInteger(val, 'greaterThanZero') === '' || IsInteger(val, 'greaterThanZero')
- ],
- weight: [
- (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
- (val: number) => IsDecimal(val, 'nonNegative', 15, 3) === '' || IsDecimal(val, 'nonNegative', 15, 3)
- ]
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- submit: () => {
- if (props.isSignIn) {
- const verificationFailedList = data.list.filter(
- (item) => IsInteger(item.qty, 'nonNegative') !== ''
- || Number(item.qty) < 0
- || Number(item.qty) > item.maxQty
- )
- if (verificationFailedList.length > 0) {
- const errMsgStrList = verificationFailedList.map(
- (item) => `${ item.sku_code }: ${ i18n.global.t('wms.deliveryManagement.exceedingQuantity') }${ item.maxQty }`
- )
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('wms.deliveryManagement.invalidValue') }; ${ errMsgStrList.join('; ') }`
- })
- } else {
- hookComponent.$dialog({
- content: `${ i18n.global.t('wms.deliveryManagement.irreversible') }, ${ i18n.global.t('wms.deliveryManagement.confirmSignIn') }?`,
- handleConfirm: async () => {
- emit('submit', data.list)
- }
- })
- }
- } else {
- const verificationFailedList = data.list.filter(
- (item) => IsInteger(item.qty, 'greaterThanZero') !== ''
- || Number(item.qty) <= 0
- || Number(item.qty) > item.maxQty
- || (item.weight && IsDecimal(item.weight, 'nonNegative', 15, 3) !== '')
- )
- if (verificationFailedList.length > 0) {
- const errMsgStrList = verificationFailedList.map(
- (item) => `${ item.sku_code }: ${ i18n.global.t('wms.deliveryManagement.exceedingQuantity') }${ item.maxQty }`
- )
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('wms.deliveryManagement.invalidValue') }; ${ errMsgStrList.join('; ') }`
- })
- } else {
- emit('submit', data.list)
- }
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.list = props.dataList
- }
- }
-)
-</script>
-
-<style scoped lang="less"></style>
+<template>
+ <v-dialog v-model="isShow" :width="'70%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card class="formCard">
+ <v-toolbar color="white" :title="dialogTitle"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-row v-for="(item, index) of data.list" :key="index">
+ <v-col :cols="3">
+ <v-text-field v-model="item.spu_name" :label="$t('wms.deliveryManagement.spu_name')" variant="outlined" readonly></v-text-field>
+ </v-col>
+ <v-col :cols="3">
+ <v-text-field v-model="item.spu_code" :label="$t('wms.deliveryManagement.spu_code')" variant="outlined" readonly></v-text-field>
+ </v-col>
+ <v-col :cols="isWeight ? 2 : 3">
+ <v-text-field v-model="item.sku_code" :label="$t('wms.deliveryManagement.sku_code')" variant="outlined" readonly></v-text-field>
+ </v-col>
+ <v-col :cols="isWeight ? 2 : 3">
+ <v-text-field
+ v-model="item.qty"
+ :rules="data.rules.qty"
+ :label="isSignIn ? $t('wms.deliveryManagement.damagedQuantity') : $t('wms.deliveryManagement.detailQty')"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ </v-col>
+ <v-col v-if="isWeight" :cols="2">
+ <v-text-field
+ v-model="item.weight"
+ :rules="data.rules.weight"
+ :label="$t('wms.deliveryManagement.detailWeight') + '(' + item.weight_unit + ')'"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ </v-col>
+ </v-row>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { ref, reactive, computed, defineEmits, watch } from 'vue'
+import { hookComponent } from '@/components/system/index'
+import i18n from '@/languages/i18n'
+import { IsInteger, IsDecimal } from '@/utils/dataVerification/formRule'
+import { ConfirmItem } from '@/types/DeliveryManagement/DeliveryManagement'
+
+const emit = defineEmits(['close', 'submit'])
+
+const props = defineProps<{
+ showDialog: boolean
+ dataList: ConfirmItem[]
+ isWeight: boolean
+ isSignIn?: boolean
+ dialogTitle: string
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ list: ref<ConfirmItem[]>([]),
+ rules: {
+ qty: [
+ (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
+ (val: number) => IsInteger(val, 'greaterThanZero') === '' || IsInteger(val, 'greaterThanZero')
+ ],
+ weight: [
+ (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
+ (val: number) => IsDecimal(val, 'nonNegative', 15, 3) === '' || IsDecimal(val, 'nonNegative', 15, 3)
+ ]
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: () => {
+ if (props.isSignIn) {
+ const verificationFailedList = data.list.filter(
+ (item) => IsInteger(item.qty, 'nonNegative') !== ''
+ || Number(item.qty) < 0
+ || Number(item.qty) > item.maxQty
+ )
+ if (verificationFailedList.length > 0) {
+ const errMsgStrList = verificationFailedList.map(
+ (item) => `${ item.sku_code }: ${ i18n.global.t('wms.deliveryManagement.exceedingQuantity') }${ item.maxQty }`
+ )
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('wms.deliveryManagement.invalidValue') }; ${ errMsgStrList.join('; ') }`
+ })
+ } else {
+ hookComponent.$dialog({
+ content: `${ i18n.global.t('wms.deliveryManagement.irreversible') }, ${ i18n.global.t('wms.deliveryManagement.confirmSignIn') }?`,
+ handleConfirm: async () => {
+ emit('submit', data.list)
+ }
+ })
+ }
+ } else {
+ const verificationFailedList = data.list.filter(
+ (item) => IsInteger(item.qty, 'greaterThanZero') !== ''
+ || Number(item.qty) <= 0
+ || Number(item.qty) > item.maxQty
+ || (item.weight && IsDecimal(item.weight, 'nonNegative', 15, 3) !== '')
+ )
+ if (verificationFailedList.length > 0) {
+ const errMsgStrList = verificationFailedList.map(
+ (item) => `${ item.sku_code }: ${ i18n.global.t('wms.deliveryManagement.exceedingQuantity') }${ item.maxQty }`
+ )
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('wms.deliveryManagement.invalidValue') }; ${ errMsgStrList.join('; ') }`
+ })
+ } else {
+ emit('submit', data.list)
+ }
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.list = props.dataList
+ }
+ }
+)
+</script>
+
+<style scoped lang="less"></style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/search-delivered-detail.vue b/frontend/src/view/deliveryManagement/deliveryManagement/search-delivered-detail.vue
index e4e7e60..842a0dc 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/search-delivered-detail.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/search-delivered-detail.vue
@@ -1,87 +1,87 @@
-<template>
- <v-dialog v-model="isShow" :width="'70%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card class="formCard">
- <v-toolbar color="white" :title="`${$t('wms.deliveryManagement.ViewInventoryDetails')}`"></v-toolbar>
- <v-card-text>
- <vxe-table
- ref="detailXTable"
- keep-source
- :column-config="{ minWidth: '100px' }"
- :data="data.tableData"
- :height="'500px'"
- align="center"
- :edit-config="{ trigger: 'click', mode: 'cell' }"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
- <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
- <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
- <vxe-column field="goods_owner_name" :title="$t('base.ownerOfCargo.goods_owner_name')"></vxe-column>
- <vxe-column field="warehouse_name" :title="$t('wms.stockLocation.warehouse_name')"></vxe-column>
- <vxe-column field="warehouse_area_name" :title="$t('base.warehouseSetting.area_name')"></vxe-column>
- <vxe-column field="location_name" :title="$t('base.warehouseSetting.location_name')"></vxe-column>
- <!-- <vxe-column field="pick_qty" :title="$t('wms.deliveryManagement.unpicked_qty')"></vxe-column> -->
- <vxe-column field="picked_qty" :title="$t('wms.deliveryManagement.picked_qty')"></vxe-column>
- </vxe-table>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, defineEmits, watch } from 'vue'
-import { hookComponent } from '@/components/system/index'
-import { viewInventoryDetails } from '@/api/wms/deliveryManagement'
-import i18n from '@/languages/i18n'
-
-const emit = defineEmits(['close', 'submit'])
-
-const props = defineProps<{
- showDialog: boolean
- id: number
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- tableData: []
-})
-
-const method = reactive({
- getTableData: async () => {
- const { data: res } = await viewInventoryDetails(props.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data
- },
- closeDialog: () => {
- emit('close')
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.getTableData()
- }
- }
-)
-</script>
-
-<style scoped lang="less"></style>
+<template>
+ <v-dialog v-model="isShow" :width="'70%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card class="formCard">
+ <v-toolbar color="white" :title="`${$t('wms.deliveryManagement.ViewInventoryDetails')}`"></v-toolbar>
+ <v-card-text>
+ <vxe-table
+ ref="detailXTable"
+ keep-source
+ :column-config="{ minWidth: '100px' }"
+ :data="data.tableData"
+ :height="'500px'"
+ align="center"
+ :edit-config="{ trigger: 'click', mode: 'cell' }"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
+ <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
+ <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
+ <vxe-column field="goods_owner_name" :title="$t('base.ownerOfCargo.goods_owner_name')"></vxe-column>
+ <vxe-column field="warehouse_name" :title="$t('wms.stockLocation.warehouse_name')"></vxe-column>
+ <vxe-column field="warehouse_area_name" :title="$t('base.warehouseSetting.area_name')"></vxe-column>
+ <vxe-column field="location_name" :title="$t('base.warehouseSetting.location_name')"></vxe-column>
+ <!-- <vxe-column field="pick_qty" :title="$t('wms.deliveryManagement.unpicked_qty')"></vxe-column> -->
+ <vxe-column field="picked_qty" :title="$t('wms.deliveryManagement.picked_qty')"></vxe-column>
+ </vxe-table>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, defineEmits, watch } from 'vue'
+import { hookComponent } from '@/components/system/index'
+import { viewInventoryDetails } from '@/api/wms/deliveryManagement'
+import i18n from '@/languages/i18n'
+
+const emit = defineEmits(['close', 'submit'])
+
+const props = defineProps<{
+ showDialog: boolean
+ id: number
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ tableData: []
+})
+
+const method = reactive({
+ getTableData: async () => {
+ const { data: res } = await viewInventoryDetails(props.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data
+ },
+ closeDialog: () => {
+ emit('close')
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.getTableData()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less"></style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/shipmentFun.ts b/frontend/src/view/deliveryManagement/deliveryManagement/shipmentFun.ts
index 19f98e6..bc442bf 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/shipmentFun.ts
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/shipmentFun.ts
@@ -1,23 +1,23 @@
-import i18n from '@/languages/i18n'
-
-// Get the status display according to the key value
-export function getShipmentState(state: number) {
- switch (state) {
- case 0:
- return i18n.global.t('wms.deliveryManagement.preShipment')
- case 1:
- return i18n.global.t('wms.deliveryManagement.newShipment')
- case 2:
- return i18n.global.t('wms.deliveryManagement.goodsToBePicked')
- case 3:
- return i18n.global.t('wms.deliveryManagement.picked')
- case 4:
- return i18n.global.t('wms.deliveryManagement.packaged')
- case 5:
- return i18n.global.t('wms.deliveryManagement.weighed')
- case 6:
- return i18n.global.t('wms.deliveryManagement.outOfWarehouse')
- case 7:
- return i18n.global.t('wms.deliveryManagement.signedIn')
- }
+import i18n from '@/languages/i18n'
+
+// Get the status display according to the key value
+export function getShipmentState(state: number) {
+ switch (state) {
+ case 0:
+ return i18n.global.t('wms.deliveryManagement.preShipment')
+ case 1:
+ return i18n.global.t('wms.deliveryManagement.newShipment')
+ case 2:
+ return i18n.global.t('wms.deliveryManagement.goodsToBePicked')
+ case 3:
+ return i18n.global.t('wms.deliveryManagement.picked')
+ case 4:
+ return i18n.global.t('wms.deliveryManagement.packaged')
+ case 5:
+ return i18n.global.t('wms.deliveryManagement.weighed')
+ case 6:
+ return i18n.global.t('wms.deliveryManagement.outOfWarehouse')
+ case 7:
+ return i18n.global.t('wms.deliveryManagement.signedIn')
+ }
}
\ No newline at end of file
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/tabDelivered.vue b/frontend/src/view/deliveryManagement/deliveryManagement/tabDelivered.vue
index f6c9673..98eebff 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/tabDelivered.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/tabDelivered.vue
@@ -1,394 +1,394 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- <tooltip-btn icon="mdi-car-cog" :tooltip-text="$t('wms.deliveryManagement.setFreight')" @click="method.setFreight"> </tooltip-btn>
- <tooltip-btn icon="mdi-email-check" :tooltip-text="$t('wms.deliveryManagement.signIn')" @click="method.handleSignIn"></tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.dispatch_no"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.dispatch_no')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.spu_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.spu_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
- <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
- <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
- <template #default="{ row }">
- <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="package_no" :title="$t('wms.deliveryManagement.package_no')"></vxe-column>
- <vxe-column field="weighing_weight" :title="$t('wms.deliveryManagement.weighing_weight')">
- <template #default="{ row }">
- <span>{{ `${row.weighing_weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="weighing_no" :title="$t('wms.deliveryManagement.weighing_no')"></vxe-column>
- <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
- <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
- <template #default="{ row }">
- <div style="width: 100%; display: flex; justify-content: center">
- <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
- <!-- <tooltip-btn
- :flat="true"
- icon="mdi-email-check"
- :tooltip-text="$t('wms.deliveryManagement.signIn')"
- @click="method.handleSignIn(row)"
- ></tooltip-btn> -->
- </div>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- <!-- <ToBeSignInConfirm
- :show-dialog="data.showDialog"
- :dialog-default-qty="data.dialogDefaultQty"
- @close="method.dialogClose"
- @submit="method.dialogSubmit"
- /> -->
- <SignInConfirm
- :dialog-title="$t('wms.deliveryManagement.signIn')"
- :show-dialog="data.showDialog"
- :is-weight="false"
- :is-sign-in="true"
- :data-list="data.confirmList"
- @close="method.dialogClose"
- @submit="method.dialogSubmit"
- />
- <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
- <ToBeFreightfee :show-dialog="data.showSetFreight" @close="method.freightfeeClose" @submit="method.freightfeeSubmit" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { DeliveryManagementDetailVO, SetCarrierVO, ConfirmItem } from '@/types/DeliveryManagement/DeliveryManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { getDelivery, handleSignIn, setCarrier } from '@/api/wms/deliveryManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-// import ToBeSignInConfirm from './to-be-sign-in-confirm.vue'
-import SignInConfirm from './package-confirm.vue'
-import { GetUnit } from '@/constant/commodityManagement'
-import ToBeFreightfee from './to-be-freightfee.vue'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { TablePage } from '@/types/System/Form'
-import SearchDeliveredDetail from './search-delivered-detail.vue'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data = reactive({
- showDeliveredDetailID: 0,
- showDeliveredDetail: false,
- showSetFreight: false,
- showDialog: false,
- dialogDefaultQty: 0,
- packageRow: ref<DeliveryManagementDetailVO>(),
- searchForm: {
- dispatch_no: '',
- customer_name: '',
- spu_name: ''
- },
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<DeliveryManagementDetailVO[]>([]),
- tablePage: ref<TablePage>({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: []
- }),
- confirmList: ref<ConfirmItem[]>([])
-})
-
-const method = reactive({
- closeDeliveredDetail: () => {
- data.showDeliveredDetail = false
- },
- viewRow: (row: DeliveryManagementDetailVO) => {
- data.showDeliveredDetailID = row.id
- data.showDeliveredDetail = true
- },
- setFreight: () => {
- const $table = xTable.value
- if ($table.getCheckboxRecords().length > 0) {
- data.showSetFreight = true
- } else {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('base.userManagement.checkboxIsNull') }`
- })
- }
- },
- freightfeeClose: () => {
- data.showSetFreight = false
- },
- freightfeeSubmit: async (form: { carrier: string; freightfee_id: number; waybill_no: string }) => {
- const reqList: SetCarrierVO[] = []
- const $table = xTable.value
- for (const item of $table.getCheckboxRecords()) {
- reqList.push({
- id: item.id,
- dispatch_no: item.dispatch_no,
- dispatch_status: item.dispatch_status,
- freightfee_id: form.freightfee_id,
- carrier: form.carrier,
- waybill_no: form.waybill_no
- })
- }
- const { data: res } = await setCarrier(reqList)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: res.data
- })
- method.freightfeeClose()
- method.refresh()
- },
- dialogClose: () => {
- data.showDialog = false
- },
- // Callback after entering packaging value
- dialogSubmit: async (list: ConfirmItem[]) => {
- const SingInList = list.map((item) => ({
- id: item.id,
- dispatch_no: item.dispatch_no,
- dispatch_status: item.dispatch_status,
- damage_qty: item.qty
- }))
-
- const { data: res } = await handleSignIn(SingInList)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: res.data
- })
- method.dialogClose()
- method.refresh()
- // if (data.packageRow) {
- // const { data: res } = await handleSignIn([
- // {
- // id: data.packageRow.id,
- // dispatch_no: data.packageRow.dispatch_no,
- // dispatch_status: data.packageRow.dispatch_status,
- // damage_qty: qty
- // }
- // ])
- // if (!res.isSuccess) {
- // hookComponent.$message({
- // type: 'error',
- // content: res.errorMessage
- // })
- // return
- // }
- // hookComponent.$message({
- // type: 'success',
- // content: res.data
- // })
- // method.dialogClose()
- // method.refresh()
- // }
- },
- handleSignIn: async () => {
- const $table = xTable.value
- const checkTableList = $table.getCheckboxRecords()
- const confirmList: ConfirmItem[] = []
- if (checkTableList.length > 0) {
- // Processing the data required by the window
- for (const item of checkTableList) {
- confirmList.push({
- id: item.id,
- spu_name: item.spu_name,
- spu_code: item.spu_code,
- sku_code: item.sku_code,
- maxQty: item.picked_qty,
- qty: 0,
- dispatch_no: item.dispatch_no,
- dispatch_status: item.dispatch_status
- })
- }
- data.confirmList = confirmList
- data.showDialog = true
- } else {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('base.userManagement.checkboxIsNull') }`
- })
- }
- // data.packageRow = row
- // data.dialogDefaultQty = row.picked_qty ? row.picked_qty : 0
- // data.showDialog = true
- },
- // Refresh data
- refresh: () => {
- method.getDelivery()
- },
- getDelivery: async () => {
- const { data: res } = await getDelivery(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getDelivery()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.deliveryManagement.outOfWarehouse'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getDelivery()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getDelivery: method.getDelivery
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ <tooltip-btn icon="mdi-car-cog" :tooltip-text="$t('wms.deliveryManagement.setFreight')" @click="method.setFreight"> </tooltip-btn>
+ <tooltip-btn icon="mdi-email-check" :tooltip-text="$t('wms.deliveryManagement.signIn')" @click="method.handleSignIn"></tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.dispatch_no"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.dispatch_no')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.spu_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
+ <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
+ <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="package_no" :title="$t('wms.deliveryManagement.package_no')"></vxe-column>
+ <vxe-column field="weighing_weight" :title="$t('wms.deliveryManagement.weighing_weight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weighing_weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="weighing_no" :title="$t('wms.deliveryManagement.weighing_no')"></vxe-column>
+ <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
+ <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <div style="width: 100%; display: flex; justify-content: center">
+ <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
+ <!-- <tooltip-btn
+ :flat="true"
+ icon="mdi-email-check"
+ :tooltip-text="$t('wms.deliveryManagement.signIn')"
+ @click="method.handleSignIn(row)"
+ ></tooltip-btn> -->
+ </div>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ <!-- <ToBeSignInConfirm
+ :show-dialog="data.showDialog"
+ :dialog-default-qty="data.dialogDefaultQty"
+ @close="method.dialogClose"
+ @submit="method.dialogSubmit"
+ /> -->
+ <SignInConfirm
+ :dialog-title="$t('wms.deliveryManagement.signIn')"
+ :show-dialog="data.showDialog"
+ :is-weight="false"
+ :is-sign-in="true"
+ :data-list="data.confirmList"
+ @close="method.dialogClose"
+ @submit="method.dialogSubmit"
+ />
+ <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
+ <ToBeFreightfee :show-dialog="data.showSetFreight" @close="method.freightfeeClose" @submit="method.freightfeeSubmit" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { DeliveryManagementDetailVO, SetCarrierVO, ConfirmItem } from '@/types/DeliveryManagement/DeliveryManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { getDelivery, handleSignIn, setCarrier } from '@/api/wms/deliveryManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+// import ToBeSignInConfirm from './to-be-sign-in-confirm.vue'
+import SignInConfirm from './package-confirm.vue'
+import { GetUnit } from '@/constant/commodityManagement'
+import ToBeFreightfee from './to-be-freightfee.vue'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { TablePage } from '@/types/System/Form'
+import SearchDeliveredDetail from './search-delivered-detail.vue'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data = reactive({
+ showDeliveredDetailID: 0,
+ showDeliveredDetail: false,
+ showSetFreight: false,
+ showDialog: false,
+ dialogDefaultQty: 0,
+ packageRow: ref<DeliveryManagementDetailVO>(),
+ searchForm: {
+ dispatch_no: '',
+ customer_name: '',
+ spu_name: ''
+ },
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<DeliveryManagementDetailVO[]>([]),
+ tablePage: ref<TablePage>({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: []
+ }),
+ confirmList: ref<ConfirmItem[]>([])
+})
+
+const method = reactive({
+ closeDeliveredDetail: () => {
+ data.showDeliveredDetail = false
+ },
+ viewRow: (row: DeliveryManagementDetailVO) => {
+ data.showDeliveredDetailID = row.id
+ data.showDeliveredDetail = true
+ },
+ setFreight: () => {
+ const $table = xTable.value
+ if ($table.getCheckboxRecords().length > 0) {
+ data.showSetFreight = true
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('base.userManagement.checkboxIsNull') }`
+ })
+ }
+ },
+ freightfeeClose: () => {
+ data.showSetFreight = false
+ },
+ freightfeeSubmit: async (form: { carrier: string; freightfee_id: number; waybill_no: string }) => {
+ const reqList: SetCarrierVO[] = []
+ const $table = xTable.value
+ for (const item of $table.getCheckboxRecords()) {
+ reqList.push({
+ id: item.id,
+ dispatch_no: item.dispatch_no,
+ dispatch_status: item.dispatch_status,
+ freightfee_id: form.freightfee_id,
+ carrier: form.carrier,
+ waybill_no: form.waybill_no
+ })
+ }
+ const { data: res } = await setCarrier(reqList)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: res.data
+ })
+ method.freightfeeClose()
+ method.refresh()
+ },
+ dialogClose: () => {
+ data.showDialog = false
+ },
+ // Callback after entering packaging value
+ dialogSubmit: async (list: ConfirmItem[]) => {
+ const SingInList = list.map((item) => ({
+ id: item.id,
+ dispatch_no: item.dispatch_no,
+ dispatch_status: item.dispatch_status,
+ damage_qty: item.qty
+ }))
+
+ const { data: res } = await handleSignIn(SingInList)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: res.data
+ })
+ method.dialogClose()
+ method.refresh()
+ // if (data.packageRow) {
+ // const { data: res } = await handleSignIn([
+ // {
+ // id: data.packageRow.id,
+ // dispatch_no: data.packageRow.dispatch_no,
+ // dispatch_status: data.packageRow.dispatch_status,
+ // damage_qty: qty
+ // }
+ // ])
+ // if (!res.isSuccess) {
+ // hookComponent.$message({
+ // type: 'error',
+ // content: res.errorMessage
+ // })
+ // return
+ // }
+ // hookComponent.$message({
+ // type: 'success',
+ // content: res.data
+ // })
+ // method.dialogClose()
+ // method.refresh()
+ // }
+ },
+ handleSignIn: async () => {
+ const $table = xTable.value
+ const checkTableList = $table.getCheckboxRecords()
+ const confirmList: ConfirmItem[] = []
+ if (checkTableList.length > 0) {
+ // Processing the data required by the window
+ for (const item of checkTableList) {
+ confirmList.push({
+ id: item.id,
+ spu_name: item.spu_name,
+ spu_code: item.spu_code,
+ sku_code: item.sku_code,
+ maxQty: item.picked_qty,
+ qty: 0,
+ dispatch_no: item.dispatch_no,
+ dispatch_status: item.dispatch_status
+ })
+ }
+ data.confirmList = confirmList
+ data.showDialog = true
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('base.userManagement.checkboxIsNull') }`
+ })
+ }
+ // data.packageRow = row
+ // data.dialogDefaultQty = row.picked_qty ? row.picked_qty : 0
+ // data.showDialog = true
+ },
+ // Refresh data
+ refresh: () => {
+ method.getDelivery()
+ },
+ getDelivery: async () => {
+ const { data: res } = await getDelivery(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getDelivery()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.deliveryManagement.outOfWarehouse'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getDelivery()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getDelivery: method.getDelivery
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/tabGoodsToBePicked.vue b/frontend/src/view/deliveryManagement/deliveryManagement/tabGoodsToBePicked.vue
index 2d16f62..d1e312a 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/tabGoodsToBePicked.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/tabGoodsToBePicked.vue
@@ -1,238 +1,238 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.dispatch_no"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.dispatch_no')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.spu_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.spu_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <!-- <vxe-column type="checkbox" width="50"></vxe-column> -->
- <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
- <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
- <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
- <vxe-column field="unpicked_qty" :title="$t('wms.deliveryManagement.unpicked_qty')"></vxe-column>
- <vxe-column field="picked_qty" :title="$t('wms.deliveryManagement.picked_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
- <template #default="{ row }">
- <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
- <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="120" :resizable="false" show-overflow>
- <template #default="{ row }">
- <div style="width: 100%; display: flex; justify-content: center">
- <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
- </div>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { DeliveryManagementDetailVO } from '@/types/DeliveryManagement/DeliveryManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { getGoodsToBePicked } from '@/api/wms/deliveryManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import { GetUnit } from '@/constant/commodityManagement'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { TablePage } from '@/types/System/Form'
-import SearchDeliveredDetail from './search-delivered-detail.vue'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data = reactive({
- showDeliveredDetailID: 0,
- showDeliveredDetail: false,
- dialogForm: {
- id: 0
- },
- searchForm: {
- dispatch_no: '',
- customer_name: '',
- spu_name: ''
- },
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<DeliveryManagementDetailVO[]>([]),
- tablePage: ref<TablePage>({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: []
- })
-})
-
-const method = reactive({
- closeDeliveredDetail: () => {
- data.showDeliveredDetail = false
- },
- viewRow: (row: DeliveryManagementDetailVO) => {
- data.showDeliveredDetailID = row.id
- data.showDeliveredDetail = true
- },
- // Refresh data
- refresh: () => {
- method.getGoodsToBePicked()
- },
- getGoodsToBePicked: async () => {
- const { data: res } = await getGoodsToBePicked(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getGoodsToBePicked()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.deliveryManagement.goodsToBePicked'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getGoodsToBePicked()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getGoodsToBePicked: method.getGoodsToBePicked
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.dispatch_no"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.dispatch_no')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.spu_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <!-- <vxe-column type="checkbox" width="50"></vxe-column> -->
+ <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
+ <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
+ <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
+ <vxe-column field="unpicked_qty" :title="$t('wms.deliveryManagement.unpicked_qty')"></vxe-column>
+ <vxe-column field="picked_qty" :title="$t('wms.deliveryManagement.picked_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
+ <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="120" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <div style="width: 100%; display: flex; justify-content: center">
+ <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
+ </div>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { DeliveryManagementDetailVO } from '@/types/DeliveryManagement/DeliveryManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { getGoodsToBePicked } from '@/api/wms/deliveryManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import { GetUnit } from '@/constant/commodityManagement'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { TablePage } from '@/types/System/Form'
+import SearchDeliveredDetail from './search-delivered-detail.vue'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data = reactive({
+ showDeliveredDetailID: 0,
+ showDeliveredDetail: false,
+ dialogForm: {
+ id: 0
+ },
+ searchForm: {
+ dispatch_no: '',
+ customer_name: '',
+ spu_name: ''
+ },
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<DeliveryManagementDetailVO[]>([]),
+ tablePage: ref<TablePage>({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: []
+ })
+})
+
+const method = reactive({
+ closeDeliveredDetail: () => {
+ data.showDeliveredDetail = false
+ },
+ viewRow: (row: DeliveryManagementDetailVO) => {
+ data.showDeliveredDetailID = row.id
+ data.showDeliveredDetail = true
+ },
+ // Refresh data
+ refresh: () => {
+ method.getGoodsToBePicked()
+ },
+ getGoodsToBePicked: async () => {
+ const { data: res } = await getGoodsToBePicked(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getGoodsToBePicked()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.deliveryManagement.goodsToBePicked'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getGoodsToBePicked()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getGoodsToBePicked: method.getGoodsToBePicked
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/tabNewShipment.vue b/frontend/src/view/deliveryManagement/deliveryManagement/tabNewShipment.vue
index c010f37..daf3eb5 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/tabNewShipment.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/tabNewShipment.vue
@@ -1,205 +1,205 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.dispatch_no"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.dispatch_no')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <!-- <vxe-column type="checkbox" width="50"></vxe-column> -->
- <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
- <!-- <vxe-column field="dispatch_status" :title="$t('wms.deliveryManagement.dispatch_status')"></vxe-column> -->
- <vxe-column field="qty" :title="$t('wms.deliveryManagement.qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.deliveryManagement.weight')">
- <template #default="{ row }">
- <span>{{ `${row.weight} ${GetUnit('weight', 2)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('wms.deliveryManagement.volume')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('volume', 1)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
- <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
- <!-- <vxe-column
- field="create_time"
- width="170px"
- :title="$t('wms.deliveryManagement.create_time')"
-
- ></vxe-column> -->
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { DeliveryManagementVO } from '@/types/DeliveryManagement/DeliveryManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { getNewShipment } from '@/api/wms/deliveryManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import { GetUnit } from '@/constant/commodityManagement'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { TablePage } from '@/types/System/Form'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data = reactive({
- showDialog: false,
- searchForm: {
- dispatch_no: '',
- customer_name: ''
- },
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<DeliveryManagementVO[]>([]),
- tablePage: ref<TablePage>({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: []
- })
-})
-
-const method = reactive({
- // Refresh data
- refresh: () => {
- method.getNewShipment()
- },
- getNewShipment: async () => {
- const { data: res } = await getNewShipment(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getNewShipment()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.deliveryManagement.newShipment'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getNewShipment()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getNewShipment: method.getNewShipment
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.dispatch_no"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.dispatch_no')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <!-- <vxe-column type="checkbox" width="50"></vxe-column> -->
+ <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
+ <!-- <vxe-column field="dispatch_status" :title="$t('wms.deliveryManagement.dispatch_status')"></vxe-column> -->
+ <vxe-column field="qty" :title="$t('wms.deliveryManagement.qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.deliveryManagement.weight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weight} ${GetUnit('weight', 2)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('wms.deliveryManagement.volume')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('volume', 1)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
+ <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
+ <!-- <vxe-column
+ field="create_time"
+ width="170px"
+ :title="$t('wms.deliveryManagement.create_time')"
+
+ ></vxe-column> -->
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { DeliveryManagementVO } from '@/types/DeliveryManagement/DeliveryManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { getNewShipment } from '@/api/wms/deliveryManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import { GetUnit } from '@/constant/commodityManagement'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { TablePage } from '@/types/System/Form'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data = reactive({
+ showDialog: false,
+ searchForm: {
+ dispatch_no: '',
+ customer_name: ''
+ },
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<DeliveryManagementVO[]>([]),
+ tablePage: ref<TablePage>({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: []
+ })
+})
+
+const method = reactive({
+ // Refresh data
+ refresh: () => {
+ method.getNewShipment()
+ },
+ getNewShipment: async () => {
+ const { data: res } = await getNewShipment(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getNewShipment()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.deliveryManagement.newShipment'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getNewShipment()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getNewShipment: method.getNewShipment
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/tabPackaged.vue b/frontend/src/view/deliveryManagement/deliveryManagement/tabPackaged.vue
index e88a649..d4d6416 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/tabPackaged.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/tabPackaged.vue
@@ -1,267 +1,267 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.dispatch_no"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.dispatch_no')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.spu_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.spu_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <!-- <vxe-column type="checkbox" width="50"></vxe-column> -->
- <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
- <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
- <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
- <vxe-column field="unpackage_qty" :title="$t('wms.deliveryManagement.unpackage_qty')"></vxe-column>
- <vxe-column field="package_qty" :title="$t('wms.deliveryManagement.package_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
- <template #default="{ row }">
- <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="package_person" :title="$t('wms.deliveryManagement.package_person')"></vxe-column>
- <vxe-column field="package_time" width="170px" :title="$t('wms.deliveryManagement.package_time')"></vxe-column>
- <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
- <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
- <template #default="{ row }">
- <div style="width: 100%; display: flex; justify-content: center">
- <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-arrow-u-left-top"
- :tooltip-text="$t('wms.deliveryManagement.backToThePreviousStep')"
- @click="method.backToThePreviousStep(row)"
- ></tooltip-btn>
- </div>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { DeliveryManagementDetailVO } from '@/types/DeliveryManagement/DeliveryManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { getPackaged, cancelOrderByDetail } from '@/api/wms/deliveryManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import { GetUnit } from '@/constant/commodityManagement'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { TablePage } from '@/types/System/Form'
-import SearchDeliveredDetail from './search-delivered-detail.vue'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data = reactive({
- showDeliveredDetailID: 0,
- showDeliveredDetail: false,
- dialogForm: {
- id: 0
- },
- searchForm: {
- dispatch_no: '',
- customer_name: '',
- spu_name: ''
- },
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<DeliveryManagementDetailVO[]>([]),
- tablePage: ref<TablePage>({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: []
- })
-})
-
-const method = reactive({
- closeDeliveredDetail: () => {
- data.showDeliveredDetail = false
- },
- viewRow: (row: DeliveryManagementDetailVO) => {
- data.showDeliveredDetailID = row.id
- data.showDeliveredDetail = true
- },
- // Back to the previous step
- backToThePreviousStep(row: DeliveryManagementDetailVO) {
- hookComponent.$dialog({
- content: `${ i18n.global.t('wms.deliveryManagement.confirmBack') }?`,
- handleConfirm: async () => {
- const { data: res } = await cancelOrderByDetail(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: res.data
- })
- method.refresh()
- }
- })
- },
- // Refresh data
- refresh: () => {
- method.getPackaged()
- },
- getPackaged: async () => {
- const { data: res } = await getPackaged(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getPackaged()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.deliveryManagement.packaged'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getPackaged()
- }
-})
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-defineExpose({
- getPackaged: method.getPackaged
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.dispatch_no"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.dispatch_no')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.spu_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <!-- <vxe-column type="checkbox" width="50"></vxe-column> -->
+ <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
+ <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
+ <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
+ <vxe-column field="unpackage_qty" :title="$t('wms.deliveryManagement.unpackage_qty')"></vxe-column>
+ <vxe-column field="package_qty" :title="$t('wms.deliveryManagement.package_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="package_person" :title="$t('wms.deliveryManagement.package_person')"></vxe-column>
+ <vxe-column field="package_time" width="170px" :title="$t('wms.deliveryManagement.package_time')"></vxe-column>
+ <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
+ <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <div style="width: 100%; display: flex; justify-content: center">
+ <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-arrow-u-left-top"
+ :tooltip-text="$t('wms.deliveryManagement.backToThePreviousStep')"
+ @click="method.backToThePreviousStep(row)"
+ ></tooltip-btn>
+ </div>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { DeliveryManagementDetailVO } from '@/types/DeliveryManagement/DeliveryManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { getPackaged, cancelOrderByDetail } from '@/api/wms/deliveryManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import { GetUnit } from '@/constant/commodityManagement'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { TablePage } from '@/types/System/Form'
+import SearchDeliveredDetail from './search-delivered-detail.vue'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data = reactive({
+ showDeliveredDetailID: 0,
+ showDeliveredDetail: false,
+ dialogForm: {
+ id: 0
+ },
+ searchForm: {
+ dispatch_no: '',
+ customer_name: '',
+ spu_name: ''
+ },
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<DeliveryManagementDetailVO[]>([]),
+ tablePage: ref<TablePage>({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: []
+ })
+})
+
+const method = reactive({
+ closeDeliveredDetail: () => {
+ data.showDeliveredDetail = false
+ },
+ viewRow: (row: DeliveryManagementDetailVO) => {
+ data.showDeliveredDetailID = row.id
+ data.showDeliveredDetail = true
+ },
+ // Back to the previous step
+ backToThePreviousStep(row: DeliveryManagementDetailVO) {
+ hookComponent.$dialog({
+ content: `${ i18n.global.t('wms.deliveryManagement.confirmBack') }?`,
+ handleConfirm: async () => {
+ const { data: res } = await cancelOrderByDetail(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: res.data
+ })
+ method.refresh()
+ }
+ })
+ },
+ // Refresh data
+ refresh: () => {
+ method.getPackaged()
+ },
+ getPackaged: async () => {
+ const { data: res } = await getPackaged(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getPackaged()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.deliveryManagement.packaged'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getPackaged()
+ }
+})
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+defineExpose({
+ getPackaged: method.getPackaged
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/tabPicked.vue b/frontend/src/view/deliveryManagement/deliveryManagement/tabPicked.vue
index e18810e..3d014df 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/tabPicked.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/tabPicked.vue
@@ -1,238 +1,238 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.dispatch_no"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.dispatch_no')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.spu_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.spu_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <!-- <vxe-column type="checkbox" width="50"></vxe-column> -->
- <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
- <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
- <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
- <vxe-column field="unpicked_qty" :title="$t('wms.deliveryManagement.unpicked_qty')"></vxe-column>
- <vxe-column field="picked_qty" :title="$t('wms.deliveryManagement.picked_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('weight', row.volume_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
- <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="120" :resizable="false" show-overflow>
- <template #default="{ row }">
- <div style="width: 100%; display: flex; justify-content: center">
- <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
- </div>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { DeliveryManagementDetailVO } from '@/types/DeliveryManagement/DeliveryManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { getPicked } from '@/api/wms/deliveryManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import { GetUnit } from '@/constant/commodityManagement'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { TablePage } from '@/types/System/Form'
-import SearchDeliveredDetail from './search-delivered-detail.vue'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data = reactive({
- showDeliveredDetailID: 0,
- showDeliveredDetail: false,
- dialogForm: {
- id: 0
- },
- searchForm: {
- dispatch_no: '',
- customer_name: '',
- spu_name: ''
- },
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<DeliveryManagementDetailVO[]>([]),
- tablePage: ref<TablePage>({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: []
- })
-})
-
-const method = reactive({
- closeDeliveredDetail: () => {
- data.showDeliveredDetail = false
- },
- viewRow: (row: DeliveryManagementDetailVO) => {
- data.showDeliveredDetailID = row.id
- data.showDeliveredDetail = true
- },
- // Refresh data
- refresh: () => {
- method.getPicked()
- },
- getPicked: async () => {
- const { data: res } = await getPicked(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getPicked()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.deliveryManagement.picked'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getPicked()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getPicked: method.getPicked
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.dispatch_no"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.dispatch_no')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.spu_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <!-- <vxe-column type="checkbox" width="50"></vxe-column> -->
+ <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
+ <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
+ <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
+ <vxe-column field="unpicked_qty" :title="$t('wms.deliveryManagement.unpicked_qty')"></vxe-column>
+ <vxe-column field="picked_qty" :title="$t('wms.deliveryManagement.picked_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('weight', row.volume_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
+ <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="120" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <div style="width: 100%; display: flex; justify-content: center">
+ <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
+ </div>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { DeliveryManagementDetailVO } from '@/types/DeliveryManagement/DeliveryManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { getPicked } from '@/api/wms/deliveryManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import { GetUnit } from '@/constant/commodityManagement'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { TablePage } from '@/types/System/Form'
+import SearchDeliveredDetail from './search-delivered-detail.vue'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data = reactive({
+ showDeliveredDetailID: 0,
+ showDeliveredDetail: false,
+ dialogForm: {
+ id: 0
+ },
+ searchForm: {
+ dispatch_no: '',
+ customer_name: '',
+ spu_name: ''
+ },
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<DeliveryManagementDetailVO[]>([]),
+ tablePage: ref<TablePage>({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: []
+ })
+})
+
+const method = reactive({
+ closeDeliveredDetail: () => {
+ data.showDeliveredDetail = false
+ },
+ viewRow: (row: DeliveryManagementDetailVO) => {
+ data.showDeliveredDetailID = row.id
+ data.showDeliveredDetail = true
+ },
+ // Refresh data
+ refresh: () => {
+ method.getPicked()
+ },
+ getPicked: async () => {
+ const { data: res } = await getPicked(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getPicked()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.deliveryManagement.picked'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getPicked()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getPicked: method.getPicked
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/tabPreShipment.vue b/frontend/src/view/deliveryManagement/deliveryManagement/tabPreShipment.vue
index 1035523..0a34c1e 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/tabPreShipment.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/tabPreShipment.vue
@@ -1,208 +1,208 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.dispatch_no"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.dispatch_no')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <!-- <vxe-column type="checkbox" width="50"></vxe-column> -->
- <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
- <!-- <vxe-column field="dispatch_status" :title="$t('wms.deliveryManagement.dispatch_status')"></vxe-column> -->
- <vxe-column field="qty" :title="$t('wms.deliveryManagement.qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.deliveryManagement.weight')">
- <template #default="{ row }">
- <span>{{ `${row.weight} ${GetUnit('weight', 2)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('wms.deliveryManagement.volume')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('volume', 1)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
- <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
- <!-- <vxe-column
- field="create_time"
- width="170px"
- :title="$t('wms.deliveryManagement.create_time')"
-
- ></vxe-column> -->
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { DeliveryManagementVO } from '@/types/DeliveryManagement/DeliveryManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { getPreShipment } from '@/api/wms/deliveryManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import { GetUnit } from '@/constant/commodityManagement'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { TablePage } from '@/types/System/Form'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data = reactive({
- showDialog: false,
- dialogForm: {
- id: 0
- },
- searchForm: {
- dispatch_no: '',
- customer_name: ''
- },
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<DeliveryManagementVO[]>([]),
- tablePage: ref<TablePage>({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: []
- })
-})
-
-const method = reactive({
- // Refresh data
- refresh: () => {
- method.getPreShipment()
- },
- getPreShipment: async () => {
- const { data: res } = await getPreShipment(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getPreShipment()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.deliveryManagement.preShipment'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getPreShipment()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getPreShipment: method.getPreShipment
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.dispatch_no"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.dispatch_no')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <!-- <vxe-column type="checkbox" width="50"></vxe-column> -->
+ <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
+ <!-- <vxe-column field="dispatch_status" :title="$t('wms.deliveryManagement.dispatch_status')"></vxe-column> -->
+ <vxe-column field="qty" :title="$t('wms.deliveryManagement.qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.deliveryManagement.weight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weight} ${GetUnit('weight', 2)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('wms.deliveryManagement.volume')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('volume', 1)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
+ <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
+ <!-- <vxe-column
+ field="create_time"
+ width="170px"
+ :title="$t('wms.deliveryManagement.create_time')"
+
+ ></vxe-column> -->
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { DeliveryManagementVO } from '@/types/DeliveryManagement/DeliveryManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { getPreShipment } from '@/api/wms/deliveryManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import { GetUnit } from '@/constant/commodityManagement'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { TablePage } from '@/types/System/Form'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data = reactive({
+ showDialog: false,
+ dialogForm: {
+ id: 0
+ },
+ searchForm: {
+ dispatch_no: '',
+ customer_name: ''
+ },
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<DeliveryManagementVO[]>([]),
+ tablePage: ref<TablePage>({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: []
+ })
+})
+
+const method = reactive({
+ // Refresh data
+ refresh: () => {
+ method.getPreShipment()
+ },
+ getPreShipment: async () => {
+ const { data: res } = await getPreShipment(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getPreShipment()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.deliveryManagement.preShipment'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getPreShipment()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getPreShipment: method.getPreShipment
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/tabShipment.vue b/frontend/src/view/deliveryManagement/deliveryManagement/tabShipment.vue
index ee6bd27..17996b9 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/tabShipment.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/tabShipment.vue
@@ -1,424 +1,424 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.dispatch_no"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.dispatch_no')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-select
- v-model="data.searchForm.dispatch_status"
- :items="data.combobox.dispatch_status"
- item-title="label"
- item-value="value"
- :label="$t('wms.deliveryManagement.dispatch_status')"
- variant="solo"
- density="comfortable"
- class="searchInput ml-5 mt-1"
- clearable
- hide-details
- ></v-select>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <!-- <vxe-column type="checkbox" width="50"></vxe-column> -->
- <vxe-column field="dispatch_no" width="120" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
- <vxe-column field="dispatch_status" :title="$t('wms.deliveryManagement.dispatch_status')">
- <template #default="{ row }">
- <span>{{ getShipmentState(row.dispatch_status) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="qty" :title="$t('wms.deliveryManagement.qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.deliveryManagement.weight')">
- <template #default="{ row }">
- <span>{{ `${row.weight} ${GetUnit('weight', 2)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('wms.deliveryManagement.volume')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('volume', 1)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
- <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
- <!-- <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column> -->
- <vxe-column field="operate" :title="$t('system.page.operate')" width="240" :resizable="false" show-overflow>
- <template #default="{ row }">
- <div style="width: 100%; display: flex; justify-content: center">
- <tooltip-btn
- :disabled="row.dispatch_status !== 0 && row.dispatch_status !== 1"
- :flat="true"
- icon="mdi-clipboard-check-outline"
- :tooltip-text="$t('wms.deliveryManagement.confirmOrder')"
- @click="method.confirmOrder(row)"
- ></tooltip-btn>
- <tooltip-btn
- :disabled="row.dispatch_status !== 2"
- :flat="true"
- icon="mdi-cart-arrow-down"
- :tooltip-text="$t('wms.deliveryManagement.confirmPicking')"
- @click="method.confirmPicking(row)"
- ></tooltip-btn>
- <tooltip-btn
- :disabled="row.dispatch_status !== 2 && row.dispatch_status !== 3"
- :flat="true"
- icon="mdi-arrow-u-left-top"
- :tooltip-text="$t('wms.deliveryManagement.backToThePreviousStep')"
- @click="method.backToThePreviousStep(row)"
- ></tooltip-btn>
- <tooltip-btn
- :disabled="row.dispatch_status !== 0 && row.dispatch_status !== 1"
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </div>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- <!-- Add or modify data mode window -->
- <addOrUpdateShipment :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- <!-- Confirm Order -->
- <ConfirmOrder
- :confirm-order-no="data.confirmOrderNo"
- :show-dialog="data.showConfirmOrder"
- @close="method.closeConfirmOrder"
- @save-success="method.confirmSuccess"
- />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { DeliveryManagementVO } from '@/types/DeliveryManagement/DeliveryManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { getShipment, delShipment, cancelOrderByDispatch, confirmPicking } from '@/api/wms/deliveryManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import addOrUpdateShipment from './add-or-update-shipment.vue'
-import { getShipmentState } from './shipmentFun'
-import ConfirmOrder from './confirm-order.vue'
-import { GetUnit } from '@/constant/commodityManagement'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { TablePage } from '@/types/System/Form'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data = reactive({
- showDialog: false,
- dialogForm: {
- id: 0,
- detailList: []
- },
- searchForm: ref<{
- dispatch_no: string
- customer_name: string
- dispatch_status?: string
- }>({
- dispatch_no: '',
- customer_name: ''
- }),
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<DeliveryManagementVO[]>([]),
- tablePage: ref<TablePage>({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: []
- }),
- showConfirmOrder: false,
- confirmOrderNo: '',
- combobox: {
- dispatch_status: [
- {
- label: i18n.global.t('wms.deliveryManagement.preShipment'),
- value: '0'
- },
- {
- label: i18n.global.t('wms.deliveryManagement.newShipment'),
- value: '1'
- },
- {
- label: i18n.global.t('wms.deliveryManagement.goodsToBePicked'),
- value: '2'
- },
- {
- label: i18n.global.t('wms.deliveryManagement.picked'),
- value: '3'
- },
- {
- label: i18n.global.t('wms.deliveryManagement.packaged'),
- value: '4'
- },
- {
- label: i18n.global.t('wms.deliveryManagement.weighed'),
- value: '5'
- },
- {
- label: i18n.global.t('wms.deliveryManagement.outOfWarehouse'),
- value: '6'
- },
- {
- label: i18n.global.t('wms.deliveryManagement.signedIn'),
- value: '7'
- }
- ]
- }
-})
-
-const method = reactive({
- // Confirm picking
- confirmPicking: async (row: DeliveryManagementVO) => {
- hookComponent.$dialog({
- content: `${ i18n.global.t('wms.deliveryManagement.confirmPicking') }?`,
- handleConfirm: async () => {
- if (row.dispatch_no) {
- const { data: res } = await confirmPicking(row.dispatch_no)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: res.data
- })
- method.refresh()
- }
- }
- })
- },
- // Back to the previous step
- backToThePreviousStep(row: DeliveryManagementVO) {
- hookComponent.$dialog({
- content: `${ i18n.global.t('wms.deliveryManagement.confirmBack') }?`,
- handleConfirm: async () => {
- const { data: res } = await cancelOrderByDispatch({
- dispatch_no: row.dispatch_no,
- dispatch_status: row.dispatch_status
- })
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: res.data
- })
- method.refresh()
- }
- })
- },
- // Close the order confirmation window
- closeConfirmOrder: () => {
- data.showConfirmOrder = false
- },
- // After confirming the shipment document
- confirmSuccess: () => {
- method.refresh()
- method.closeConfirmOrder()
- },
- // after Add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // Refresh dialog data
- clearDialogForm: () => {
- data.dialogForm = {
- id: 0,
- detailList: []
- }
- },
- add: () => {
- method.clearDialogForm()
- data.showDialog = true
- },
- confirmOrder: (row: DeliveryManagementVO) => {
- if (row.dispatch_status === undefined || ![0, 1].includes(row.dispatch_status)) {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('wms.deliveryManagement.incorrectStatusMsg') }${ getShipmentState(0) }${ i18n.global.t(
- 'wms.deliveryManagement.or'
- ) }${ getShipmentState(1) }`
- })
- return
- }
- if (row.dispatch_no) {
- data.confirmOrderNo = row.dispatch_no
- data.showConfirmOrder = true
- }
- },
- deleteRow: (row: DeliveryManagementVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.dispatch_no) {
- const { data: res } = await delShipment(row.dispatch_no)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // Refresh data
- refresh: () => {
- method.getShipment()
- },
- getShipment: async () => {
- const { data: res } = await getShipment(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getShipment()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.deliveryManagement.shipment'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm, ['dispatch_status'])
- method.getShipment()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getShipment: method.getShipment
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.dispatch_no"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.dispatch_no')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-select
+ v-model="data.searchForm.dispatch_status"
+ :items="data.combobox.dispatch_status"
+ item-title="label"
+ item-value="value"
+ :label="$t('wms.deliveryManagement.dispatch_status')"
+ variant="solo"
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ clearable
+ hide-details
+ ></v-select>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <!-- <vxe-column type="checkbox" width="50"></vxe-column> -->
+ <vxe-column field="dispatch_no" width="120" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
+ <vxe-column field="dispatch_status" :title="$t('wms.deliveryManagement.dispatch_status')">
+ <template #default="{ row }">
+ <span>{{ getShipmentState(row.dispatch_status) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="qty" :title="$t('wms.deliveryManagement.qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.deliveryManagement.weight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weight} ${GetUnit('weight', 2)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('wms.deliveryManagement.volume')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('volume', 1)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
+ <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
+ <!-- <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column> -->
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="240" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <div style="width: 100%; display: flex; justify-content: center">
+ <tooltip-btn
+ :disabled="row.dispatch_status !== 0 && row.dispatch_status !== 1"
+ :flat="true"
+ icon="mdi-clipboard-check-outline"
+ :tooltip-text="$t('wms.deliveryManagement.confirmOrder')"
+ @click="method.confirmOrder(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :disabled="row.dispatch_status !== 2"
+ :flat="true"
+ icon="mdi-cart-arrow-down"
+ :tooltip-text="$t('wms.deliveryManagement.confirmPicking')"
+ @click="method.confirmPicking(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :disabled="row.dispatch_status !== 2 && row.dispatch_status !== 3"
+ :flat="true"
+ icon="mdi-arrow-u-left-top"
+ :tooltip-text="$t('wms.deliveryManagement.backToThePreviousStep')"
+ @click="method.backToThePreviousStep(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :disabled="row.dispatch_status !== 0 && row.dispatch_status !== 1"
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </div>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ <!-- Add or modify data mode window -->
+ <addOrUpdateShipment :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ <!-- Confirm Order -->
+ <ConfirmOrder
+ :confirm-order-no="data.confirmOrderNo"
+ :show-dialog="data.showConfirmOrder"
+ @close="method.closeConfirmOrder"
+ @save-success="method.confirmSuccess"
+ />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { DeliveryManagementVO } from '@/types/DeliveryManagement/DeliveryManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { getShipment, delShipment, cancelOrderByDispatch, confirmPicking } from '@/api/wms/deliveryManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import addOrUpdateShipment from './add-or-update-shipment.vue'
+import { getShipmentState } from './shipmentFun'
+import ConfirmOrder from './confirm-order.vue'
+import { GetUnit } from '@/constant/commodityManagement'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { TablePage } from '@/types/System/Form'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data = reactive({
+ showDialog: false,
+ dialogForm: {
+ id: 0,
+ detailList: []
+ },
+ searchForm: ref<{
+ dispatch_no: string
+ customer_name: string
+ dispatch_status?: string
+ }>({
+ dispatch_no: '',
+ customer_name: ''
+ }),
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<DeliveryManagementVO[]>([]),
+ tablePage: ref<TablePage>({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: []
+ }),
+ showConfirmOrder: false,
+ confirmOrderNo: '',
+ combobox: {
+ dispatch_status: [
+ {
+ label: i18n.global.t('wms.deliveryManagement.preShipment'),
+ value: '0'
+ },
+ {
+ label: i18n.global.t('wms.deliveryManagement.newShipment'),
+ value: '1'
+ },
+ {
+ label: i18n.global.t('wms.deliveryManagement.goodsToBePicked'),
+ value: '2'
+ },
+ {
+ label: i18n.global.t('wms.deliveryManagement.picked'),
+ value: '3'
+ },
+ {
+ label: i18n.global.t('wms.deliveryManagement.packaged'),
+ value: '4'
+ },
+ {
+ label: i18n.global.t('wms.deliveryManagement.weighed'),
+ value: '5'
+ },
+ {
+ label: i18n.global.t('wms.deliveryManagement.outOfWarehouse'),
+ value: '6'
+ },
+ {
+ label: i18n.global.t('wms.deliveryManagement.signedIn'),
+ value: '7'
+ }
+ ]
+ }
+})
+
+const method = reactive({
+ // Confirm picking
+ confirmPicking: async (row: DeliveryManagementVO) => {
+ hookComponent.$dialog({
+ content: `${ i18n.global.t('wms.deliveryManagement.confirmPicking') }?`,
+ handleConfirm: async () => {
+ if (row.dispatch_no) {
+ const { data: res } = await confirmPicking(row.dispatch_no)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: res.data
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Back to the previous step
+ backToThePreviousStep(row: DeliveryManagementVO) {
+ hookComponent.$dialog({
+ content: `${ i18n.global.t('wms.deliveryManagement.confirmBack') }?`,
+ handleConfirm: async () => {
+ const { data: res } = await cancelOrderByDispatch({
+ dispatch_no: row.dispatch_no,
+ dispatch_status: row.dispatch_status
+ })
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: res.data
+ })
+ method.refresh()
+ }
+ })
+ },
+ // Close the order confirmation window
+ closeConfirmOrder: () => {
+ data.showConfirmOrder = false
+ },
+ // After confirming the shipment document
+ confirmSuccess: () => {
+ method.refresh()
+ method.closeConfirmOrder()
+ },
+ // after Add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // Refresh dialog data
+ clearDialogForm: () => {
+ data.dialogForm = {
+ id: 0,
+ detailList: []
+ }
+ },
+ add: () => {
+ method.clearDialogForm()
+ data.showDialog = true
+ },
+ confirmOrder: (row: DeliveryManagementVO) => {
+ if (row.dispatch_status === undefined || ![0, 1].includes(row.dispatch_status)) {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('wms.deliveryManagement.incorrectStatusMsg') }${ getShipmentState(0) }${ i18n.global.t(
+ 'wms.deliveryManagement.or'
+ ) }${ getShipmentState(1) }`
+ })
+ return
+ }
+ if (row.dispatch_no) {
+ data.confirmOrderNo = row.dispatch_no
+ data.showConfirmOrder = true
+ }
+ },
+ deleteRow: (row: DeliveryManagementVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.dispatch_no) {
+ const { data: res } = await delShipment(row.dispatch_no)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Refresh data
+ refresh: () => {
+ method.getShipment()
+ },
+ getShipment: async () => {
+ const { data: res } = await getShipment(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getShipment()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.deliveryManagement.shipment'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm, ['dispatch_status'])
+ method.getShipment()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getShipment: method.getShipment
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/tabSignIn.vue b/frontend/src/view/deliveryManagement/deliveryManagement/tabSignIn.vue
index 1db30c6..f82c80e 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/tabSignIn.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/tabSignIn.vue
@@ -1,252 +1,252 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.dispatch_no"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.dispatch_no')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.spu_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.spu_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
- <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
- <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
- <template #default="{ row }">
- <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="weighing_weight" :title="$t('wms.deliveryManagement.weighing_weight')">
- <template #default="{ row }">
- <span>{{ `${row.weighing_weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="package_person" :title="$t('wms.deliveryManagement.package_person')"></vxe-column>
- <vxe-column field="weighing_person" :title="$t('wms.deliveryManagement.weighing_person')"></vxe-column>
- <vxe-column field="waybill_no" :title="$t('wms.deliveryManagement.waybill_no')"></vxe-column>
- <vxe-column field="carrier" :title="$t('wms.deliveryManagement.carrier')"></vxe-column>
- <vxe-column field="damagedQuantity" :title="$t('wms.deliveryManagement.damagedQuantity')">
- <template #default="{ row }">
- <span>{{ `${XEUtils.subtract(Number(row.qty), Number(row.sign_qty))}` }}</span>
- </template>
- </vxe-column>
-
- <vxe-column field="weighing_no" :title="$t('wms.deliveryManagement.weighing_no')"></vxe-column>
- <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
- <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="120" :resizable="false" show-overflow>
- <template #default="{ row }">
- <div style="width: 100%; display: flex; justify-content: center">
- <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
- </div>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import XEUtils from 'xe-utils'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { DeliveryManagementDetailVO } from '@/types/DeliveryManagement/DeliveryManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { getSignIn } from '@/api/wms/deliveryManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import { GetUnit } from '@/constant/commodityManagement'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { TablePage } from '@/types/System/Form'
-import SearchDeliveredDetail from './search-delivered-detail.vue'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data = reactive({
- showDeliveredDetailID: 0,
- showDeliveredDetail: false,
- dialogForm: {
- id: 0
- },
- searchForm: {
- dispatch_no: '',
- customer_name: '',
- spu_name: ''
- },
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<DeliveryManagementDetailVO[]>([]),
- tablePage: ref<TablePage>({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: []
- })
-})
-
-const method = reactive({
- closeDeliveredDetail: () => {
- data.showDeliveredDetail = false
- },
- viewRow: (row: DeliveryManagementDetailVO) => {
- data.showDeliveredDetailID = row.id
- data.showDeliveredDetail = true
- },
- // Refresh data
- refresh: () => {
- method.getSignIn()
- },
- getSignIn: async () => {
- const { data: res } = await getSignIn(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getSignIn()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.deliveryManagement.signedIn'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getSignIn()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getSignIn: method.getSignIn
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.dispatch_no"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.dispatch_no')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.spu_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
+ <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
+ <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="weighing_weight" :title="$t('wms.deliveryManagement.weighing_weight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weighing_weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="package_person" :title="$t('wms.deliveryManagement.package_person')"></vxe-column>
+ <vxe-column field="weighing_person" :title="$t('wms.deliveryManagement.weighing_person')"></vxe-column>
+ <vxe-column field="waybill_no" :title="$t('wms.deliveryManagement.waybill_no')"></vxe-column>
+ <vxe-column field="carrier" :title="$t('wms.deliveryManagement.carrier')"></vxe-column>
+ <vxe-column field="damagedQuantity" :title="$t('wms.deliveryManagement.damagedQuantity')">
+ <template #default="{ row }">
+ <span>{{ `${XEUtils.subtract(Number(row.qty), Number(row.sign_qty))}` }}</span>
+ </template>
+ </vxe-column>
+
+ <vxe-column field="weighing_no" :title="$t('wms.deliveryManagement.weighing_no')"></vxe-column>
+ <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
+ <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="120" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <div style="width: 100%; display: flex; justify-content: center">
+ <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
+ </div>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import XEUtils from 'xe-utils'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { DeliveryManagementDetailVO } from '@/types/DeliveryManagement/DeliveryManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { getSignIn } from '@/api/wms/deliveryManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import { GetUnit } from '@/constant/commodityManagement'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { TablePage } from '@/types/System/Form'
+import SearchDeliveredDetail from './search-delivered-detail.vue'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data = reactive({
+ showDeliveredDetailID: 0,
+ showDeliveredDetail: false,
+ dialogForm: {
+ id: 0
+ },
+ searchForm: {
+ dispatch_no: '',
+ customer_name: '',
+ spu_name: ''
+ },
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<DeliveryManagementDetailVO[]>([]),
+ tablePage: ref<TablePage>({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: []
+ })
+})
+
+const method = reactive({
+ closeDeliveredDetail: () => {
+ data.showDeliveredDetail = false
+ },
+ viewRow: (row: DeliveryManagementDetailVO) => {
+ data.showDeliveredDetailID = row.id
+ data.showDeliveredDetail = true
+ },
+ // Refresh data
+ refresh: () => {
+ method.getSignIn()
+ },
+ getSignIn: async () => {
+ const { data: res } = await getSignIn(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getSignIn()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.deliveryManagement.signedIn'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getSignIn()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getSignIn: method.getSignIn
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/tabToBeDelivered.vue b/frontend/src/view/deliveryManagement/deliveryManagement/tabToBeDelivered.vue
index a4eec17..605440e 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/tabToBeDelivered.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/tabToBeDelivered.vue
@@ -1,285 +1,285 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- <tooltip-btn icon="mdi-cube-send" :tooltip-text="$t('wms.deliveryManagement.delivery')" @click="method.handleDeliver"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.dispatch_no"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.dispatch_no')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.spu_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.spu_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
- <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
- <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
- <template #default="{ row }">
- <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="package_no" :title="$t('wms.deliveryManagement.package_no')"></vxe-column>
- <vxe-column field="weighing_weight" :title="$t('wms.deliveryManagement.weighing_weight')">
- <template #default="{ row }">
- <span>{{ `${row.weighing_weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="weighing_no" :title="$t('wms.deliveryManagement.weighing_no')"></vxe-column>
- <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
- <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
- <template #default="{ row }">
- <div style="width: 100%; display: flex; justify-content: center">
- <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
- <!-- <tooltip-btn
- :flat="true"
- icon="mdi-cube-send"
- :tooltip-text="$t('wms.deliveryManagement.delivery')"
- @click="method.handleDeliver(row)"
- ></tooltip-btn> -->
- </div>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { DeliveryManagementDetailVO } from '@/types/DeliveryManagement/DeliveryManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { getToBeDelivery, handleDelivery } from '@/api/wms/deliveryManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import { GetUnit } from '@/constant/commodityManagement'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { TablePage } from '@/types/System/Form'
-import SearchDeliveredDetail from './search-delivered-detail.vue'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data = reactive({
- showDeliveredDetailID: 0,
- showDeliveredDetail: false,
- dialogForm: {
- id: 0
- },
- searchForm: {
- dispatch_no: '',
- customer_name: '',
- spu_name: ''
- },
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<DeliveryManagementDetailVO[]>([]),
- tablePage: ref<TablePage>({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: []
- })
-})
-
-const method = reactive({
- closeDeliveredDetail: () => {
- data.showDeliveredDetail = false
- },
- viewRow: (row: DeliveryManagementDetailVO) => {
- data.showDeliveredDetailID = row.id
- data.showDeliveredDetail = true
- },
- handleDeliver: async () => {
- const $table = xTable.value
- const checkTableList = $table.getCheckboxRecords()
- if (checkTableList.length > 0) {
- const deliveredList = checkTableList.map((row: DeliveryManagementDetailVO) => ({
- id: row.id,
- dispatch_no: row.dispatch_no,
- dispatch_status: row.dispatch_status,
- picked_qty: row.picked_qty
- }))
- hookComponent.$dialog({
- content: `${ i18n.global.t('wms.deliveryManagement.irreversible') }, ${ i18n.global.t('wms.deliveryManagement.confirmDelivery') }?`,
- handleConfirm: async () => {
- const { data: res } = await handleDelivery(deliveredList)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: res.data
- })
- method.refresh()
- }
- })
- } else {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('base.userManagement.checkboxIsNull') }`
- })
- }
- },
- // Refresh data
- refresh: () => {
- method.getToBeDelivery()
- },
- getToBeDelivery: async () => {
- const { data: res } = await getToBeDelivery(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getToBeDelivery()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.deliveryManagement.toBeDelivered'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getToBeDelivery()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getToBeDelivery: method.getToBeDelivery
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ <tooltip-btn icon="mdi-cube-send" :tooltip-text="$t('wms.deliveryManagement.delivery')" @click="method.handleDeliver"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.dispatch_no"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.dispatch_no')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.spu_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
+ <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
+ <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="package_no" :title="$t('wms.deliveryManagement.package_no')"></vxe-column>
+ <vxe-column field="weighing_weight" :title="$t('wms.deliveryManagement.weighing_weight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weighing_weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="weighing_no" :title="$t('wms.deliveryManagement.weighing_no')"></vxe-column>
+ <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
+ <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <div style="width: 100%; display: flex; justify-content: center">
+ <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
+ <!-- <tooltip-btn
+ :flat="true"
+ icon="mdi-cube-send"
+ :tooltip-text="$t('wms.deliveryManagement.delivery')"
+ @click="method.handleDeliver(row)"
+ ></tooltip-btn> -->
+ </div>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { DeliveryManagementDetailVO } from '@/types/DeliveryManagement/DeliveryManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { getToBeDelivery, handleDelivery } from '@/api/wms/deliveryManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import { GetUnit } from '@/constant/commodityManagement'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { TablePage } from '@/types/System/Form'
+import SearchDeliveredDetail from './search-delivered-detail.vue'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data = reactive({
+ showDeliveredDetailID: 0,
+ showDeliveredDetail: false,
+ dialogForm: {
+ id: 0
+ },
+ searchForm: {
+ dispatch_no: '',
+ customer_name: '',
+ spu_name: ''
+ },
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<DeliveryManagementDetailVO[]>([]),
+ tablePage: ref<TablePage>({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: []
+ })
+})
+
+const method = reactive({
+ closeDeliveredDetail: () => {
+ data.showDeliveredDetail = false
+ },
+ viewRow: (row: DeliveryManagementDetailVO) => {
+ data.showDeliveredDetailID = row.id
+ data.showDeliveredDetail = true
+ },
+ handleDeliver: async () => {
+ const $table = xTable.value
+ const checkTableList = $table.getCheckboxRecords()
+ if (checkTableList.length > 0) {
+ const deliveredList = checkTableList.map((row: DeliveryManagementDetailVO) => ({
+ id: row.id,
+ dispatch_no: row.dispatch_no,
+ dispatch_status: row.dispatch_status,
+ picked_qty: row.picked_qty
+ }))
+ hookComponent.$dialog({
+ content: `${ i18n.global.t('wms.deliveryManagement.irreversible') }, ${ i18n.global.t('wms.deliveryManagement.confirmDelivery') }?`,
+ handleConfirm: async () => {
+ const { data: res } = await handleDelivery(deliveredList)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: res.data
+ })
+ method.refresh()
+ }
+ })
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('base.userManagement.checkboxIsNull') }`
+ })
+ }
+ },
+ // Refresh data
+ refresh: () => {
+ method.getToBeDelivery()
+ },
+ getToBeDelivery: async () => {
+ const { data: res } = await getToBeDelivery(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getToBeDelivery()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.deliveryManagement.toBeDelivered'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getToBeDelivery()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getToBeDelivery: method.getToBeDelivery
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/tabToBePackaged.vue b/frontend/src/view/deliveryManagement/deliveryManagement/tabToBePackaged.vue
index 0c1c8f8..c671a2b 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/tabToBePackaged.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/tabToBePackaged.vue
@@ -1,322 +1,322 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- <tooltip-btn icon="mdi-package-down" :tooltip-text="$t('wms.deliveryManagement.package')" @click="method.handlePackage"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.dispatch_no"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.dispatch_no')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.spu_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.spu_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
- <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
- <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
- <vxe-column field="unpackage_qty" :title="$t('wms.deliveryManagement.unpackage_qty')"></vxe-column>
- <vxe-column field="package_qty" :title="$t('wms.deliveryManagement.package_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
- <template #default="{ row }">
- <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
- </template>
- </vxe-column>
- <!-- <vxe-column field="package_person" :title="$t('wms.deliveryManagement.package_person')"></vxe-column>
- <vxe-column field="package_time" width="170px" :title="$t('wms.deliveryManagement.package_time')"></vxe-column> -->
- <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
- <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
- <template #default="{ row }">
- <div style="width: 100%; display: flex; justify-content: center">
- <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
- <!-- <tooltip-btn
- :flat="true"
- icon="mdi-package-down"
- :tooltip-text="$t('wms.deliveryManagement.package')"
- @click="method.handlePackage(row)"
- ></tooltip-btn> -->
- </div>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
- <!-- <ToBePackageConfirm :show-dialog="data.showDialog" :max-qty="data.dialogMaxQty" @close="method.dialogClose" @submit="method.dialogSubmit" /> -->
- <PackageConfirm
- :dialog-title="$t('wms.deliveryManagement.package')"
- :show-dialog="data.showDialog"
- :is-weight="false"
- :data-list="data.confirmList"
- @close="method.dialogClose"
- @submit="method.dialogSubmit"
- />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { DeliveryManagementDetailVO, ConfirmItem } from '@/types/DeliveryManagement/DeliveryManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { getToBePackaged, handlePackage } from '@/api/wms/deliveryManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-// import ToBePackageConfirm from './to-be-package-confirm.vue'
-import PackageConfirm from './package-confirm.vue'
-import { GetUnit } from '@/constant/commodityManagement'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { TablePage } from '@/types/System/Form'
-import SearchDeliveredDetail from './search-delivered-detail.vue'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data = reactive({
- showDeliveredDetailID: 0,
- showDeliveredDetail: false,
- showDialog: false,
- confirmList: ref<ConfirmItem[]>([]),
- dialogMaxQty: 0,
- packageRow: ref<DeliveryManagementDetailVO>(),
- dialogForm: {
- id: 0
- },
- searchForm: {
- dispatch_no: '',
- customer_name: '',
- spu_name: ''
- },
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<DeliveryManagementDetailVO[]>([]),
- tablePage: ref<TablePage>({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: []
- })
-})
-
-const method = reactive({
- closeDeliveredDetail: () => {
- data.showDeliveredDetail = false
- },
- viewRow: (row: DeliveryManagementDetailVO) => {
- data.showDeliveredDetailID = row.id
- data.showDeliveredDetail = true
- },
- dialogClose: () => {
- data.showDialog = false
- },
- // Callback after entering packaging value
- dialogSubmit: async (list: ConfirmItem[]) => {
- const packList = list.map((item) => ({
- id: item.id,
- dispatch_no: item.dispatch_no,
- dispatch_status: item.dispatch_status,
- package_qty: item.qty,
- picked_qty: item.picked_qty
- }))
- const { data: res } = await handlePackage(packList)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: res.data
- })
- method.dialogClose()
- method.refresh()
- },
- // handlePackage: async (row: DeliveryManagementDetailVO) => {
- // data.packageRow = row
- // data.dialogMaxQty = row.unpackage_qty ? row.unpackage_qty : 0
- // data.showDialog = true
- // },
- handlePackage: async () => {
- const $table = xTable.value
- const checkTableList = $table.getCheckboxRecords()
- const confirmList: ConfirmItem[] = []
- if (checkTableList.length > 0) {
- // Processing the data required by the window
- for (const item of checkTableList) {
- confirmList.push({
- id: item.id,
- spu_name: item.spu_name,
- spu_code: item.spu_code,
- sku_code: item.sku_code,
- maxQty: item.unpackage_qty,
- qty: item.unpackage_qty,
- dispatch_no: item.dispatch_no,
- dispatch_status: item.dispatch_status,
- picked_qty: item.picked_qty
- })
- }
- data.confirmList = confirmList
- data.showDialog = true
- } else {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('base.userManagement.checkboxIsNull') }`
- })
- }
- },
- // Refresh data
- refresh: () => {
- method.getToBePackaged()
- },
- getToBePackaged: async () => {
- const { data: res } = await getToBePackaged(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getToBePackaged()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.deliveryManagement.toBePackaged'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getToBePackaged()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getToBePackaged: method.getToBePackaged
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ <tooltip-btn icon="mdi-package-down" :tooltip-text="$t('wms.deliveryManagement.package')" @click="method.handlePackage"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.dispatch_no"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.dispatch_no')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.spu_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
+ <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
+ <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
+ <vxe-column field="unpackage_qty" :title="$t('wms.deliveryManagement.unpackage_qty')"></vxe-column>
+ <vxe-column field="package_qty" :title="$t('wms.deliveryManagement.package_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <!-- <vxe-column field="package_person" :title="$t('wms.deliveryManagement.package_person')"></vxe-column>
+ <vxe-column field="package_time" width="170px" :title="$t('wms.deliveryManagement.package_time')"></vxe-column> -->
+ <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
+ <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <div style="width: 100%; display: flex; justify-content: center">
+ <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
+ <!-- <tooltip-btn
+ :flat="true"
+ icon="mdi-package-down"
+ :tooltip-text="$t('wms.deliveryManagement.package')"
+ @click="method.handlePackage(row)"
+ ></tooltip-btn> -->
+ </div>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
+ <!-- <ToBePackageConfirm :show-dialog="data.showDialog" :max-qty="data.dialogMaxQty" @close="method.dialogClose" @submit="method.dialogSubmit" /> -->
+ <PackageConfirm
+ :dialog-title="$t('wms.deliveryManagement.package')"
+ :show-dialog="data.showDialog"
+ :is-weight="false"
+ :data-list="data.confirmList"
+ @close="method.dialogClose"
+ @submit="method.dialogSubmit"
+ />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { DeliveryManagementDetailVO, ConfirmItem } from '@/types/DeliveryManagement/DeliveryManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { getToBePackaged, handlePackage } from '@/api/wms/deliveryManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+// import ToBePackageConfirm from './to-be-package-confirm.vue'
+import PackageConfirm from './package-confirm.vue'
+import { GetUnit } from '@/constant/commodityManagement'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { TablePage } from '@/types/System/Form'
+import SearchDeliveredDetail from './search-delivered-detail.vue'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data = reactive({
+ showDeliveredDetailID: 0,
+ showDeliveredDetail: false,
+ showDialog: false,
+ confirmList: ref<ConfirmItem[]>([]),
+ dialogMaxQty: 0,
+ packageRow: ref<DeliveryManagementDetailVO>(),
+ dialogForm: {
+ id: 0
+ },
+ searchForm: {
+ dispatch_no: '',
+ customer_name: '',
+ spu_name: ''
+ },
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<DeliveryManagementDetailVO[]>([]),
+ tablePage: ref<TablePage>({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: []
+ })
+})
+
+const method = reactive({
+ closeDeliveredDetail: () => {
+ data.showDeliveredDetail = false
+ },
+ viewRow: (row: DeliveryManagementDetailVO) => {
+ data.showDeliveredDetailID = row.id
+ data.showDeliveredDetail = true
+ },
+ dialogClose: () => {
+ data.showDialog = false
+ },
+ // Callback after entering packaging value
+ dialogSubmit: async (list: ConfirmItem[]) => {
+ const packList = list.map((item) => ({
+ id: item.id,
+ dispatch_no: item.dispatch_no,
+ dispatch_status: item.dispatch_status,
+ package_qty: item.qty,
+ picked_qty: item.picked_qty
+ }))
+ const { data: res } = await handlePackage(packList)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: res.data
+ })
+ method.dialogClose()
+ method.refresh()
+ },
+ // handlePackage: async (row: DeliveryManagementDetailVO) => {
+ // data.packageRow = row
+ // data.dialogMaxQty = row.unpackage_qty ? row.unpackage_qty : 0
+ // data.showDialog = true
+ // },
+ handlePackage: async () => {
+ const $table = xTable.value
+ const checkTableList = $table.getCheckboxRecords()
+ const confirmList: ConfirmItem[] = []
+ if (checkTableList.length > 0) {
+ // Processing the data required by the window
+ for (const item of checkTableList) {
+ confirmList.push({
+ id: item.id,
+ spu_name: item.spu_name,
+ spu_code: item.spu_code,
+ sku_code: item.sku_code,
+ maxQty: item.unpackage_qty,
+ qty: item.unpackage_qty,
+ dispatch_no: item.dispatch_no,
+ dispatch_status: item.dispatch_status,
+ picked_qty: item.picked_qty
+ })
+ }
+ data.confirmList = confirmList
+ data.showDialog = true
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('base.userManagement.checkboxIsNull') }`
+ })
+ }
+ },
+ // Refresh data
+ refresh: () => {
+ method.getToBePackaged()
+ },
+ getToBePackaged: async () => {
+ const { data: res } = await getToBePackaged(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getToBePackaged()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.deliveryManagement.toBePackaged'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getToBePackaged()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getToBePackaged: method.getToBePackaged
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/tabToBeWeighed.vue b/frontend/src/view/deliveryManagement/deliveryManagement/tabToBeWeighed.vue
index 326c754..88eed39 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/tabToBeWeighed.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/tabToBeWeighed.vue
@@ -1,337 +1,337 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- <tooltip-btn icon="mdi-weight" :tooltip-text="$t('wms.deliveryManagement.weigh')" @click="method.handleWeigh"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.dispatch_no"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.dispatch_no')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.spu_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.spu_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <!-- <vxe-column field="weighing_no" :title="$t('wms.deliveryManagement.weighing_no')"></vxe-column> -->
- <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
- <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
- <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
- <template #default="{ row }">
- <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="package_person" :title="$t('wms.deliveryManagement.package_person')"></vxe-column>
- <vxe-column field="package_no" :title="$t('wms.deliveryManagement.package_no')"></vxe-column>
- <!-- <vxe-column field="weighing_person" :title="$t('wms.deliveryManagement.weighing_person')"></vxe-column>
- <vxe-column field="weighing_weight" :title="$t('wms.deliveryManagement.weighing_weight')">
- <template #default="{ row }">
- <span>{{ `${row.weighing_weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column> -->
- <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
- <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
- <template #default="{ row }">
- <div style="width: 100%; display: flex; justify-content: center">
- <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
- <!-- <tooltip-btn
- :flat="true"
- icon="mdi-weight"
- :tooltip-text="$t('wms.deliveryManagement.weigh')"
- @click="method.handleWeigh(row)"
- ></tooltip-btn> -->
- </div>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- <!-- <ToBeWeighedConfirm
- :show-dialog="data.showDialog"
- :default-weight="data.defaultWeight"
- :max-qty="data.dialogMaxQty"
- :weight-unit="data.dialogWeightUnit"
- @close="method.dialogClose"
- @submit="method.dialogSubmit"
- /> -->
- <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
- <WeightConfirm
- :show-dialog="data.showDialog"
- :dialog-title="$t('wms.deliveryManagement.weigh')"
- :is-weight="true"
- :data-list="data.confirmList"
- @close="method.dialogClose"
- @submit="method.dialogSubmit"
- />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { DeliveryManagementDetailVO, ConfirmItem } from '@/types/DeliveryManagement/DeliveryManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { getToBeWeighed, handleWeigh } from '@/api/wms/deliveryManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import { GetUnit } from '@/constant/commodityManagement'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { TablePage } from '@/types/System/Form'
-import SearchDeliveredDetail from './search-delivered-detail.vue'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import WeightConfirm from './package-confirm.vue'
-
-const xTable = ref()
-
-const data = reactive({
- showDeliveredDetailID: 0,
- showDeliveredDetail: false,
- showDialog: false,
- confirmList: ref<ConfirmItem[]>([]),
- dialogMaxQty: 0,
- dialogWeightUnit: '',
- defaultWeight: 0,
- weighedRow: ref<DeliveryManagementDetailVO>(),
- searchForm: {
- dispatch_no: '',
- customer_name: '',
- spu_name: ''
- },
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<DeliveryManagementDetailVO[]>([]),
- tablePage: ref<TablePage>({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: []
- })
-})
-
-const method = reactive({
- closeDeliveredDetail: () => {
- data.showDeliveredDetail = false
- },
- viewRow: (row: DeliveryManagementDetailVO) => {
- data.showDeliveredDetailID = row.id
- data.showDeliveredDetail = true
- },
- dialogClose: () => {
- data.showDialog = false
- },
- // Callback after entering packaging value
- dialogSubmit: async (list: ConfirmItem[]) => {
- const packList = list.map((item) => ({
- id: item.id,
- dispatch_no: item.dispatch_no,
- dispatch_status: item.dispatch_status,
- weighing_qty: item.qty,
- weighing_weight: item.weight,
- picked_qty: item.picked_qty
- }))
- // if (data.weighedRow) {
- const { data: res } = await handleWeigh(packList)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: res.data
- })
- method.dialogClose()
- method.refresh()
- // }
- },
- handleWeigh: async () => {
- const $table = xTable.value
- const checkTableList = $table.getCheckboxRecords()
- const confirmList: ConfirmItem[] = []
- if (checkTableList.length > 0) {
- // Processing the data required by the window
- for (const item of checkTableList) {
- confirmList.push({
- id: item.id,
- spu_name: item.spu_name,
- spu_code: item.spu_code,
- sku_code: item.sku_code,
- maxQty: item.unweighing_qty,
- qty: item.unweighing_qty,
- weight: item.weight,
- weight_unit: GetUnit('weight', item.weight_unit),
- dispatch_no: item.dispatch_no,
- dispatch_status: item.dispatch_status,
- picked_qty: item.picked_qty
- })
- }
- data.confirmList = confirmList
- data.showDialog = true
- } else {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('base.userManagement.checkboxIsNull') }`
- })
- }
- // data.weighedRow = row
- // data.dialogWeightUnit = row.weight_unit !== undefined ? GetUnit('weight', row.weight_unit) : ''
- // data.dialogMaxQty = row.unweighing_qty ? row.unweighing_qty : 0
- // data.defaultWeight = row.weight ? row.weight : 0
- // data.showDialog = true
- },
- // Refresh data
- refresh: () => {
- method.getToBeWeighed()
- },
- getToBeWeighed: async () => {
- const { data: res } = await getToBeWeighed(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getToBeWeighed()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.deliveryManagement.toBeWeighed'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getToBeWeighed()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getToBeWeighed: method.getToBeWeighed
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ <tooltip-btn icon="mdi-weight" :tooltip-text="$t('wms.deliveryManagement.weigh')" @click="method.handleWeigh"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.dispatch_no"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.dispatch_no')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.spu_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <!-- <vxe-column field="weighing_no" :title="$t('wms.deliveryManagement.weighing_no')"></vxe-column> -->
+ <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
+ <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
+ <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="package_person" :title="$t('wms.deliveryManagement.package_person')"></vxe-column>
+ <vxe-column field="package_no" :title="$t('wms.deliveryManagement.package_no')"></vxe-column>
+ <!-- <vxe-column field="weighing_person" :title="$t('wms.deliveryManagement.weighing_person')"></vxe-column>
+ <vxe-column field="weighing_weight" :title="$t('wms.deliveryManagement.weighing_weight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weighing_weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column> -->
+ <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
+ <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <div style="width: 100%; display: flex; justify-content: center">
+ <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
+ <!-- <tooltip-btn
+ :flat="true"
+ icon="mdi-weight"
+ :tooltip-text="$t('wms.deliveryManagement.weigh')"
+ @click="method.handleWeigh(row)"
+ ></tooltip-btn> -->
+ </div>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ <!-- <ToBeWeighedConfirm
+ :show-dialog="data.showDialog"
+ :default-weight="data.defaultWeight"
+ :max-qty="data.dialogMaxQty"
+ :weight-unit="data.dialogWeightUnit"
+ @close="method.dialogClose"
+ @submit="method.dialogSubmit"
+ /> -->
+ <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
+ <WeightConfirm
+ :show-dialog="data.showDialog"
+ :dialog-title="$t('wms.deliveryManagement.weigh')"
+ :is-weight="true"
+ :data-list="data.confirmList"
+ @close="method.dialogClose"
+ @submit="method.dialogSubmit"
+ />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { DeliveryManagementDetailVO, ConfirmItem } from '@/types/DeliveryManagement/DeliveryManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { getToBeWeighed, handleWeigh } from '@/api/wms/deliveryManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import { GetUnit } from '@/constant/commodityManagement'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { TablePage } from '@/types/System/Form'
+import SearchDeliveredDetail from './search-delivered-detail.vue'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import WeightConfirm from './package-confirm.vue'
+
+const xTable = ref()
+
+const data = reactive({
+ showDeliveredDetailID: 0,
+ showDeliveredDetail: false,
+ showDialog: false,
+ confirmList: ref<ConfirmItem[]>([]),
+ dialogMaxQty: 0,
+ dialogWeightUnit: '',
+ defaultWeight: 0,
+ weighedRow: ref<DeliveryManagementDetailVO>(),
+ searchForm: {
+ dispatch_no: '',
+ customer_name: '',
+ spu_name: ''
+ },
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<DeliveryManagementDetailVO[]>([]),
+ tablePage: ref<TablePage>({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: []
+ })
+})
+
+const method = reactive({
+ closeDeliveredDetail: () => {
+ data.showDeliveredDetail = false
+ },
+ viewRow: (row: DeliveryManagementDetailVO) => {
+ data.showDeliveredDetailID = row.id
+ data.showDeliveredDetail = true
+ },
+ dialogClose: () => {
+ data.showDialog = false
+ },
+ // Callback after entering packaging value
+ dialogSubmit: async (list: ConfirmItem[]) => {
+ const packList = list.map((item) => ({
+ id: item.id,
+ dispatch_no: item.dispatch_no,
+ dispatch_status: item.dispatch_status,
+ weighing_qty: item.qty,
+ weighing_weight: item.weight,
+ picked_qty: item.picked_qty
+ }))
+ // if (data.weighedRow) {
+ const { data: res } = await handleWeigh(packList)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: res.data
+ })
+ method.dialogClose()
+ method.refresh()
+ // }
+ },
+ handleWeigh: async () => {
+ const $table = xTable.value
+ const checkTableList = $table.getCheckboxRecords()
+ const confirmList: ConfirmItem[] = []
+ if (checkTableList.length > 0) {
+ // Processing the data required by the window
+ for (const item of checkTableList) {
+ confirmList.push({
+ id: item.id,
+ spu_name: item.spu_name,
+ spu_code: item.spu_code,
+ sku_code: item.sku_code,
+ maxQty: item.unweighing_qty,
+ qty: item.unweighing_qty,
+ weight: item.weight,
+ weight_unit: GetUnit('weight', item.weight_unit),
+ dispatch_no: item.dispatch_no,
+ dispatch_status: item.dispatch_status,
+ picked_qty: item.picked_qty
+ })
+ }
+ data.confirmList = confirmList
+ data.showDialog = true
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('base.userManagement.checkboxIsNull') }`
+ })
+ }
+ // data.weighedRow = row
+ // data.dialogWeightUnit = row.weight_unit !== undefined ? GetUnit('weight', row.weight_unit) : ''
+ // data.dialogMaxQty = row.unweighing_qty ? row.unweighing_qty : 0
+ // data.defaultWeight = row.weight ? row.weight : 0
+ // data.showDialog = true
+ },
+ // Refresh data
+ refresh: () => {
+ method.getToBeWeighed()
+ },
+ getToBeWeighed: async () => {
+ const { data: res } = await getToBeWeighed(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getToBeWeighed()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.deliveryManagement.toBeWeighed'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getToBeWeighed()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getToBeWeighed: method.getToBeWeighed
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/tabWeighed.vue b/frontend/src/view/deliveryManagement/deliveryManagement/tabWeighed.vue
index 83b0574..ea8a5f8 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/tabWeighed.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/tabWeighed.vue
@@ -1,272 +1,272 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.dispatch_no"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.dispatch_no')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.customer_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.customer_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.spu_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.deliveryManagement.spu_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="weighing_no" :title="$t('wms.deliveryManagement.weighing_no')"></vxe-column>
- <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
- <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
- <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
- <template #default="{ row }">
- <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
- <template #default="{ row }">
- <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="package_person" :title="$t('wms.deliveryManagement.package_person')"></vxe-column>
- <vxe-column field="package_no" :title="$t('wms.deliveryManagement.package_no')"></vxe-column>
- <vxe-column field="weighing_person" :title="$t('wms.deliveryManagement.weighing_person')"></vxe-column>
- <vxe-column field="weighing_weight" :title="$t('wms.deliveryManagement.weighing_weight')">
- <template #default="{ row }">
- <span>{{ `${row.weighing_weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
- </template>
- </vxe-column>
- <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
- <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
- <template #default="{ row }">
- <div style="width: 100%; display: flex; justify-content: center">
- <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-arrow-u-left-top"
- :tooltip-text="$t('wms.deliveryManagement.backToThePreviousStep')"
- @click="method.backToThePreviousStep(row)"
- ></tooltip-btn>
- </div>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { DeliveryManagementDetailVO } from '@/types/DeliveryManagement/DeliveryManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { getWeighed, cancelOrderByDetail } from '@/api/wms/deliveryManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import { GetUnit } from '@/constant/commodityManagement'
-import customPager from '@/components/custom-pager.vue'
-import { setSearchObject } from '@/utils/common'
-import { TablePage } from '@/types/System/Form'
-import SearchDeliveredDetail from './search-delivered-detail.vue'
-import { exportData } from '@/utils/exportTable'
-import { DEBOUNCE_TIME } from '@/constant/system'
-
-const xTable = ref()
-
-const data = reactive({
- showDeliveredDetailID: 0,
- showDeliveredDetail: false,
- showDialog: false,
- dialogForm: {
- id: 0
- },
- searchForm: {
- dispatch_no: '',
- customer_name: '',
- spu_name: ''
- },
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<DeliveryManagementDetailVO[]>([]),
- tablePage: ref<TablePage>({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: []
- })
-})
-
-const method = reactive({
- closeDeliveredDetail: () => {
- data.showDeliveredDetail = false
- },
- viewRow: (row: DeliveryManagementDetailVO) => {
- data.showDeliveredDetailID = row.id
- data.showDeliveredDetail = true
- },
- // Back to the previous step
- backToThePreviousStep(row: DeliveryManagementDetailVO) {
- hookComponent.$dialog({
- content: `${ i18n.global.t('wms.deliveryManagement.confirmBack') }?`,
- handleConfirm: async () => {
- const { data: res } = await cancelOrderByDetail(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: res.data
- })
- method.refresh()
- }
- })
- },
- // Refresh data
- refresh: () => {
- method.getWeighed()
- },
- getWeighed: async () => {
- const { data: res } = await getWeighed(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getWeighed()
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.deliveryManagement.weighed'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getWeighed()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-
-defineExpose({
- getWeighed: method.getWeighed
-})
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.dispatch_no"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.dispatch_no')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.customer_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.customer_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.deliveryManagement.spu_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="weighing_no" :title="$t('wms.deliveryManagement.weighing_no')"></vxe-column>
+ <vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
+ <vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
+ <vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
+ <template #default="{ row }">
+ <span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="package_person" :title="$t('wms.deliveryManagement.package_person')"></vxe-column>
+ <vxe-column field="package_no" :title="$t('wms.deliveryManagement.package_no')"></vxe-column>
+ <vxe-column field="weighing_person" :title="$t('wms.deliveryManagement.weighing_person')"></vxe-column>
+ <vxe-column field="weighing_weight" :title="$t('wms.deliveryManagement.weighing_weight')">
+ <template #default="{ row }">
+ <span>{{ `${row.weighing_weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
+ <vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <div style="width: 100%; display: flex; justify-content: center">
+ <tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-arrow-u-left-top"
+ :tooltip-text="$t('wms.deliveryManagement.backToThePreviousStep')"
+ @click="method.backToThePreviousStep(row)"
+ ></tooltip-btn>
+ </div>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ <SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { DeliveryManagementDetailVO } from '@/types/DeliveryManagement/DeliveryManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { getWeighed, cancelOrderByDetail } from '@/api/wms/deliveryManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import { GetUnit } from '@/constant/commodityManagement'
+import customPager from '@/components/custom-pager.vue'
+import { setSearchObject } from '@/utils/common'
+import { TablePage } from '@/types/System/Form'
+import SearchDeliveredDetail from './search-delivered-detail.vue'
+import { exportData } from '@/utils/exportTable'
+import { DEBOUNCE_TIME } from '@/constant/system'
+
+const xTable = ref()
+
+const data = reactive({
+ showDeliveredDetailID: 0,
+ showDeliveredDetail: false,
+ showDialog: false,
+ dialogForm: {
+ id: 0
+ },
+ searchForm: {
+ dispatch_no: '',
+ customer_name: '',
+ spu_name: ''
+ },
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<DeliveryManagementDetailVO[]>([]),
+ tablePage: ref<TablePage>({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: []
+ })
+})
+
+const method = reactive({
+ closeDeliveredDetail: () => {
+ data.showDeliveredDetail = false
+ },
+ viewRow: (row: DeliveryManagementDetailVO) => {
+ data.showDeliveredDetailID = row.id
+ data.showDeliveredDetail = true
+ },
+ // Back to the previous step
+ backToThePreviousStep(row: DeliveryManagementDetailVO) {
+ hookComponent.$dialog({
+ content: `${ i18n.global.t('wms.deliveryManagement.confirmBack') }?`,
+ handleConfirm: async () => {
+ const { data: res } = await cancelOrderByDetail(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: res.data
+ })
+ method.refresh()
+ }
+ })
+ },
+ // Refresh data
+ refresh: () => {
+ method.getWeighed()
+ },
+ getWeighed: async () => {
+ const { data: res } = await getWeighed(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getWeighed()
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.deliveryManagement.weighed'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getWeighed()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+
+defineExpose({
+ getWeighed: method.getWeighed
+})
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/to-be-freightfee.vue b/frontend/src/view/deliveryManagement/deliveryManagement/to-be-freightfee.vue
index a0c6515..0ddeb00 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/to-be-freightfee.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/to-be-freightfee.vue
@@ -1,120 +1,120 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card class="formCard">
- <v-toolbar color="white" :title="`${$t('wms.deliveryManagement.setFreight')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.waybill_no"
- :rules="data.rules.waybill_no"
- :label="$t('wms.deliveryManagement.waybill_no')"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.carrier"
- :label="$t('wms.deliveryManagement.carrier')"
- variant="outlined"
- readonly
- clearable
- @click="method.openSelect()"
- @click:clear="method.valClearable"
- ></v-text-field>
- <v-text-field
- v-model="data.form.departure_city"
- :label="$t('wms.deliveryManagement.departure_city')"
- variant="outlined"
- readonly
- ></v-text-field>
- <v-text-field
- v-model="data.form.arrival_city"
- :label="$t('wms.deliveryManagement.arrival_city')"
- variant="outlined"
- readonly
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- <freight-select :show-dialog="data.dialogSelect" @close="method.closeDialogSelect()" @sureSelect="method.sureSelect" />
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, defineEmits, watch } from 'vue'
-import { hookComponent } from '@/components/system/index'
-import i18n from '@/languages/i18n'
-import freightSelect from '@/components/select/freight-select.vue'
-import { FreightVO } from '@/types/Base/Freight'
-import { StringLength } from '@/utils/dataVerification/formRule'
-
-const emit = defineEmits(['close', 'submit'])
-
-const props = defineProps<{
- showDialog: boolean
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- dialogSelect: false,
- form: { carrier: '', freightfee_id: 0, departure_city: '', arrival_city: '', waybill_no: '' },
- combobox: {
- freightfee_id: []
- },
- rules: {
- waybill_no: [
- (val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)
- ]
- }
-})
-
-const method = reactive({
- openSelect: () => {
- data.dialogSelect = true
- },
- closeDialogSelect: () => {
- data.dialogSelect = false
- },
- sureSelect: (selectRecords: FreightVO[]) => {
- if (selectRecords.length > 0) {
- data.form.carrier = selectRecords[0].carrier
- data.form.freightfee_id = selectRecords[0].id ? selectRecords[0].id : 0
- data.form.departure_city = selectRecords[0].departure_city
- data.form.arrival_city = selectRecords[0].arrival_city
- }
- },
- valClearable: () => {
- data.form = { carrier: '', freightfee_id: 0, departure_city: '', arrival_city: '', waybill_no: data.form.waybill_no }
- },
- closeDialog: () => {
- emit('close')
- },
- submit: () => {
- if (data.form.carrier) {
- emit('submit', data.form)
- } else {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('system.checkText.mustSelect') }${ i18n.global.t('wms.deliveryManagement.carrier') }!`
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.form = { carrier: '', freightfee_id: 0, departure_city: '', arrival_city: '', waybill_no: '' }
- }
- }
-)
-</script>
-
-<style scoped lang="less"></style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card class="formCard">
+ <v-toolbar color="white" :title="`${$t('wms.deliveryManagement.setFreight')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.waybill_no"
+ :rules="data.rules.waybill_no"
+ :label="$t('wms.deliveryManagement.waybill_no')"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.carrier"
+ :label="$t('wms.deliveryManagement.carrier')"
+ variant="outlined"
+ readonly
+ clearable
+ @click="method.openSelect()"
+ @click:clear="method.valClearable"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.departure_city"
+ :label="$t('wms.deliveryManagement.departure_city')"
+ variant="outlined"
+ readonly
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.arrival_city"
+ :label="$t('wms.deliveryManagement.arrival_city')"
+ variant="outlined"
+ readonly
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ <freight-select :show-dialog="data.dialogSelect" @close="method.closeDialogSelect()" @sureSelect="method.sureSelect" />
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, defineEmits, watch } from 'vue'
+import { hookComponent } from '@/components/system/index'
+import i18n from '@/languages/i18n'
+import freightSelect from '@/components/select/freight-select.vue'
+import { FreightVO } from '@/types/Base/Freight'
+import { StringLength } from '@/utils/dataVerification/formRule'
+
+const emit = defineEmits(['close', 'submit'])
+
+const props = defineProps<{
+ showDialog: boolean
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ dialogSelect: false,
+ form: { carrier: '', freightfee_id: 0, departure_city: '', arrival_city: '', waybill_no: '' },
+ combobox: {
+ freightfee_id: []
+ },
+ rules: {
+ waybill_no: [
+ (val: string) => StringLength(val, 0, 64) === '' || StringLength(val, 0, 64)
+ ]
+ }
+})
+
+const method = reactive({
+ openSelect: () => {
+ data.dialogSelect = true
+ },
+ closeDialogSelect: () => {
+ data.dialogSelect = false
+ },
+ sureSelect: (selectRecords: FreightVO[]) => {
+ if (selectRecords.length > 0) {
+ data.form.carrier = selectRecords[0].carrier
+ data.form.freightfee_id = selectRecords[0].id ? selectRecords[0].id : 0
+ data.form.departure_city = selectRecords[0].departure_city
+ data.form.arrival_city = selectRecords[0].arrival_city
+ }
+ },
+ valClearable: () => {
+ data.form = { carrier: '', freightfee_id: 0, departure_city: '', arrival_city: '', waybill_no: data.form.waybill_no }
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: () => {
+ if (data.form.carrier) {
+ emit('submit', data.form)
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('system.checkText.mustSelect') }${ i18n.global.t('wms.deliveryManagement.carrier') }!`
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.form = { carrier: '', freightfee_id: 0, departure_city: '', arrival_city: '', waybill_no: '' }
+ }
+ }
+)
+</script>
+
+<style scoped lang="less"></style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/to-be-package-confirm.vue b/frontend/src/view/deliveryManagement/deliveryManagement/to-be-package-confirm.vue
index 8479202..1edcdc9 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/to-be-package-confirm.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/to-be-package-confirm.vue
@@ -1,77 +1,77 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card class="formCard">
- <v-toolbar color="white" :title="`${$t('wms.deliveryManagement.package')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.qty"
- :rules="data.rules.qty"
- :label="$t('wms.deliveryManagement.detailQty')"
- variant="outlined"
- clearable
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, defineEmits, watch } from 'vue'
-import { hookComponent } from '@/components/system/index'
-import i18n from '@/languages/i18n'
-import { IsInteger } from '@/utils/dataVerification/formRule'
-
-const emit = defineEmits(['close', 'submit'])
-
-const props = defineProps<{
- showDialog: boolean
- maxQty: number
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- form: { qty: 0 },
- rules: {
- qty: [
- (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
- (val: number) => IsInteger(val, 'greaterThanZero') === '' || IsInteger(val, 'greaterThanZero')
- ]
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- submit: () => {
- if (IsInteger(data.form.qty, 'greaterThanZero') === '' && Number(data.form.qty) > 0 && Number(data.form.qty) <= props.maxQty) {
- emit('submit', data.form.qty)
- } else {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('wms.deliveryManagement.validQtyMsgPackage') }${ props.maxQty }!`
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.form.qty = props.maxQty
- }
- }
-)
-</script>
-
-<style scoped lang="less"></style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card class="formCard">
+ <v-toolbar color="white" :title="`${$t('wms.deliveryManagement.package')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.qty"
+ :rules="data.rules.qty"
+ :label="$t('wms.deliveryManagement.detailQty')"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, defineEmits, watch } from 'vue'
+import { hookComponent } from '@/components/system/index'
+import i18n from '@/languages/i18n'
+import { IsInteger } from '@/utils/dataVerification/formRule'
+
+const emit = defineEmits(['close', 'submit'])
+
+const props = defineProps<{
+ showDialog: boolean
+ maxQty: number
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ form: { qty: 0 },
+ rules: {
+ qty: [
+ (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
+ (val: number) => IsInteger(val, 'greaterThanZero') === '' || IsInteger(val, 'greaterThanZero')
+ ]
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: () => {
+ if (IsInteger(data.form.qty, 'greaterThanZero') === '' && Number(data.form.qty) > 0 && Number(data.form.qty) <= props.maxQty) {
+ emit('submit', data.form.qty)
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('wms.deliveryManagement.validQtyMsgPackage') }${ props.maxQty }!`
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.form.qty = props.maxQty
+ }
+ }
+)
+</script>
+
+<style scoped lang="less"></style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/to-be-sign-in-confirm.vue b/frontend/src/view/deliveryManagement/deliveryManagement/to-be-sign-in-confirm.vue
index 00bd8d1..585c0dd 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/to-be-sign-in-confirm.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/to-be-sign-in-confirm.vue
@@ -1,82 +1,82 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card class="formCard">
- <v-toolbar color="white" :title="`${$t('wms.deliveryManagement.signIn')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.qty"
- :rules="data.rules.qty"
- :label="$t('wms.deliveryManagement.damagedQuantity')"
- variant="outlined"
- clearable
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, defineEmits, watch } from 'vue'
-import { hookComponent } from '@/components/system/index'
-import i18n from '@/languages/i18n'
-import { IsInteger } from '@/utils/dataVerification/formRule'
-
-const emit = defineEmits(['close', 'submit'])
-
-const props = defineProps<{
- showDialog: boolean
- dialogDefaultQty: number
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- form: { qty: 0 },
- rules: {
- qty: [
- (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
- (val: number) => IsInteger(val, 'nonNegative') === '' || IsInteger(val, 'nonNegative')
- ]
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- submit: () => {
- if (IsInteger(data.form.qty, 'nonNegative') === '' && Number(data.form.qty) >= 0 && Number(data.form.qty) <= props.dialogDefaultQty) {
- hookComponent.$dialog({
- content: `${ i18n.global.t('wms.deliveryManagement.irreversible') }, ${ i18n.global.t('wms.deliveryManagement.confirmSignIn') }?`,
- handleConfirm: async () => {
- emit('submit', data.form.qty)
- }
- })
- } else {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('wms.deliveryManagement.validQtyMsgSignIn') }${ props.dialogDefaultQty }!`
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.form.qty = 0
- }
- }
-)
-</script>
-
-<style scoped lang="less"></style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card class="formCard">
+ <v-toolbar color="white" :title="`${$t('wms.deliveryManagement.signIn')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.qty"
+ :rules="data.rules.qty"
+ :label="$t('wms.deliveryManagement.damagedQuantity')"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, defineEmits, watch } from 'vue'
+import { hookComponent } from '@/components/system/index'
+import i18n from '@/languages/i18n'
+import { IsInteger } from '@/utils/dataVerification/formRule'
+
+const emit = defineEmits(['close', 'submit'])
+
+const props = defineProps<{
+ showDialog: boolean
+ dialogDefaultQty: number
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ form: { qty: 0 },
+ rules: {
+ qty: [
+ (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
+ (val: number) => IsInteger(val, 'nonNegative') === '' || IsInteger(val, 'nonNegative')
+ ]
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: () => {
+ if (IsInteger(data.form.qty, 'nonNegative') === '' && Number(data.form.qty) >= 0 && Number(data.form.qty) <= props.dialogDefaultQty) {
+ hookComponent.$dialog({
+ content: `${ i18n.global.t('wms.deliveryManagement.irreversible') }, ${ i18n.global.t('wms.deliveryManagement.confirmSignIn') }?`,
+ handleConfirm: async () => {
+ emit('submit', data.form.qty)
+ }
+ })
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('wms.deliveryManagement.validQtyMsgSignIn') }${ props.dialogDefaultQty }!`
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.form.qty = 0
+ }
+ }
+)
+</script>
+
+<style scoped lang="less"></style>
diff --git a/frontend/src/view/deliveryManagement/deliveryManagement/to-be-weighed-confirm.vue b/frontend/src/view/deliveryManagement/deliveryManagement/to-be-weighed-confirm.vue
index 33f1a64..fd716d0 100644
--- a/frontend/src/view/deliveryManagement/deliveryManagement/to-be-weighed-confirm.vue
+++ b/frontend/src/view/deliveryManagement/deliveryManagement/to-be-weighed-confirm.vue
@@ -1,98 +1,98 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card class="formCard">
- <v-toolbar color="white" :title="`${$t('wms.deliveryManagement.weigh')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.qty"
- style="margin-bottom: 5px"
- :rules="data.rules.qty"
- :label="$t('wms.deliveryManagement.detailQty')"
- variant="outlined"
- clearable
- ></v-text-field>
- <v-text-field
- v-model="data.form.weight"
- :label="$t('wms.deliveryManagement.detailWeight') + '(' + weightUnit + ')'"
- :rules="data.rules.weight"
- variant="outlined"
- clearable
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, defineEmits, watch } from 'vue'
-import { hookComponent } from '@/components/system/index'
-import i18n from '@/languages/i18n'
-import { IsInteger, IsDecimal } from '@/utils/dataVerification/formRule'
-
-const emit = defineEmits(['close', 'submit'])
-
-const props = defineProps<{
- showDialog: boolean
- maxQty: number
- defaultWeight: number
- weightUnit: string
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- form: { qty: 0, weight: 0 },
- rules: {
- qty: [
- (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
- (val: number) => IsInteger(val, 'greaterThanZero') === '' || IsInteger(val, 'greaterThanZero')
- ],
- weight: [
- (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
- (val: number) => IsDecimal(val, 'nonNegative', 15, 3) === '' || IsDecimal(val, 'nonNegative', 15, 3)
- ]
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- submit: () => {
- if (
- IsInteger(data.form.qty, 'greaterThanZero') === ''
- && IsDecimal(data.form.weight, 'nonNegative', 15, 3) === ''
- && Number(data.form.qty) > 0
- && Number(data.form.qty) <= props.maxQty
- && Number(data.form.weight) > 0
- ) {
- emit('submit', { weighing_qty: data.form.qty, weighing_weight: data.form.weight })
- } else {
- hookComponent.$message({
- type: 'error',
- content: `${ i18n.global.t('wms.deliveryManagement.validQtyMsgPackage') }${ props.maxQty }!`
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.form.qty = props.maxQty
- data.form.weight = props.defaultWeight
- }
- }
-)
-</script>
-
-<style scoped lang="less"></style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card class="formCard">
+ <v-toolbar color="white" :title="`${$t('wms.deliveryManagement.weigh')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.qty"
+ style="margin-bottom: 5px"
+ :rules="data.rules.qty"
+ :label="$t('wms.deliveryManagement.detailQty')"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.weight"
+ :label="$t('wms.deliveryManagement.detailWeight') + '(' + weightUnit + ')'"
+ :rules="data.rules.weight"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, defineEmits, watch } from 'vue'
+import { hookComponent } from '@/components/system/index'
+import i18n from '@/languages/i18n'
+import { IsInteger, IsDecimal } from '@/utils/dataVerification/formRule'
+
+const emit = defineEmits(['close', 'submit'])
+
+const props = defineProps<{
+ showDialog: boolean
+ maxQty: number
+ defaultWeight: number
+ weightUnit: string
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ form: { qty: 0, weight: 0 },
+ rules: {
+ qty: [
+ (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
+ (val: number) => IsInteger(val, 'greaterThanZero') === '' || IsInteger(val, 'greaterThanZero')
+ ],
+ weight: [
+ (val: number) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.deliveryManagement.detailQty') }!`,
+ (val: number) => IsDecimal(val, 'nonNegative', 15, 3) === '' || IsDecimal(val, 'nonNegative', 15, 3)
+ ]
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: () => {
+ if (
+ IsInteger(data.form.qty, 'greaterThanZero') === ''
+ && IsDecimal(data.form.weight, 'nonNegative', 15, 3) === ''
+ && Number(data.form.qty) > 0
+ && Number(data.form.qty) <= props.maxQty
+ && Number(data.form.weight) > 0
+ ) {
+ emit('submit', { weighing_qty: data.form.qty, weighing_weight: data.form.weight })
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: `${ i18n.global.t('wms.deliveryManagement.validQtyMsgPackage') }${ props.maxQty }!`
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.form.qty = props.maxQty
+ data.form.weight = props.defaultWeight
+ }
+ }
+)
+</script>
+
+<style scoped lang="less"></style>
diff --git a/frontend/src/view/Home/home.vue b/frontend/src/view/home/home.vue
similarity index 95%
rename from frontend/src/view/Home/home.vue
rename to frontend/src/view/home/home.vue
index 7a11ce2..4bb73a8 100644
--- a/frontend/src/view/Home/home.vue
+++ b/frontend/src/view/home/home.vue
@@ -1,47 +1,47 @@
-<template>
- <div class="HomeContainer">
- <HomeSideBar />
- <div class="homeRight">
- <HomeHeader />
- <div class="homeRouterContainer pt-2">
- <RouterView v-slot="{ Component }">
- <keep-alive :include="openedMenus">
- <component :is="Component"></component>
- </keep-alive>
- </RouterView>
- </div>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed } from 'vue'
-import { store } from '@/store'
-import HomeHeader from './homeHeader.vue'
-import HomeSideBar from './homeSideBar.vue'
-
-const openedMenus = computed(() => store.getters['system/openedMenus'])
-</script>
-
-<style scoped lang="less">
-@headerHeight: 60px;
-@sideBarWidth: 300px;
-@sideBarTitleHeight: 80px;
-
-.HomeContainer {
- width: 100vw;
- height: 100vh;
- display: flex;
- flex-wrap: wrap;
-
- .homeRight {
- width: calc(100% - @sideBarWidth);
- padding: 0 5%;
-
- .homeRouterContainer {
- height: calc(100% - @headerHeight);
- box-sizing: border-box;
- }
- }
-}
-</style>
+<template>
+ <div class="HomeContainer">
+ <HomeSideBar />
+ <div class="homeRight">
+ <HomeHeader />
+ <div class="homeRouterContainer pt-2">
+ <RouterView v-slot="{ Component }">
+ <keep-alive :include="openedMenus">
+ <component :is="Component"></component>
+ </keep-alive>
+ </RouterView>
+ </div>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed } from 'vue'
+import { store } from '@/store'
+import HomeHeader from './homeHeader.vue'
+import HomeSideBar from './homeSideBar.vue'
+
+const openedMenus = computed(() => store.getters['system/openedMenus'])
+</script>
+
+<style scoped lang="less">
+@headerHeight: 60px;
+@sideBarWidth: 300px;
+@sideBarTitleHeight: 80px;
+
+.HomeContainer {
+ width: 100vw;
+ height: 100vh;
+ display: flex;
+ flex-wrap: wrap;
+
+ .homeRight {
+ width: calc(100% - @sideBarWidth);
+ padding: 0 5%;
+
+ .homeRouterContainer {
+ height: calc(100% - @headerHeight);
+ box-sizing: border-box;
+ }
+ }
+}
+</style>
diff --git a/frontend/src/view/Home/homeHeader.vue b/frontend/src/view/home/homeHeader.vue
similarity index 95%
rename from frontend/src/view/Home/homeHeader.vue
rename to frontend/src/view/home/homeHeader.vue
index fc05968..be33261 100644
--- a/frontend/src/view/Home/homeHeader.vue
+++ b/frontend/src/view/home/homeHeader.vue
@@ -1,224 +1,224 @@
-<template>
- <div class="homeHeader">
- <div class="menuTitle">
- <v-breadcrumbs :items="data.breadcrumbItems">
- <template #prepend>
- <v-icon :color="lightGrey" size="small" icon="mdi-form-select"></v-icon>
- </template>
- </v-breadcrumbs>
- </div>
- <div class="toolsBar">
- <div class="gitSrc mr-4">
- <img src="@/assets/img/gitee.png" alt="Gitee" @click="method.toGit('gitee')">
- </div>
- <div class="gitSrc mr-4">
- <img src="@/assets/img/github.png" alt="Gitee" @click="method.toGit('github')">
- </div>
- <LanguagesSwitch />
- <v-menu>
- <template #activator="{ props }">
- <div class="toolItems headPortrait ml-4" v-bind="props">
- <p class="firstName">{{ firstName }}</p>
- <div class="alive"></div>
- </div>
- </template>
- <v-list>
- <v-list-item v-for="(item, index) in data.userOperationMenu" :key="index" :value="index" @click="method.operation(item.value)">
- <v-list-item-title>{{ item.title }}</v-list-item-title>
- </v-list-item>
- </v-list>
- </v-menu>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { reactive, watch, computed } from 'vue'
-import { useRouter } from 'vue-router'
-import LanguagesSwitch from '@/components/system/languages.vue'
-import { lightGrey } from '@/constant/style'
-import i18n from '@/languages/i18n'
-import { router } from '@/router'
-import { store } from '@/store'
-import { DataProps } from '@/types/Home/HomeHeader'
-
-const routerInfo = useRouter()
-
-const data: DataProps = reactive({
- breadcrumbItems: [],
- // User Action List
- userOperationMenu: [
- {
- title: i18n.global.t('system.homeHeader.logout'),
- value: 'logout'
- }
- ]
-})
-
-// Get current page route info
-watch(
- () => routerInfo,
- (newValue) => {
- const MODULE = i18n.global.t(`router.sideBar.${ newValue.currentRoute.value.meta.menuModule }`)
- const PATH = i18n.global.t(`router.sideBar.${ newValue.currentRoute.value.meta.menuPath }`)
-
- data.breadcrumbItems = [
- {
- title: PATH,
- disabled: true
- }
- ]
-
- if (newValue.currentRoute.value.meta.menuModule) {
- data.breadcrumbItems.unshift({
- title: MODULE,
- disabled: true
- })
- }
- },
- { immediate: true, deep: true }
-)
-
-const method = reactive({
- // User operation method
- operation: (value: string) => {
- if (value === 'logout') {
- store.commit('system/clearOpenedMenu')
- store.commit('system/setCurrentRouterPath', '')
-
- router.push('/login')
- }
- },
- toGit: (type: string) => {
- if (type === 'gitee') {
- window.open('https://gitee.com/modernwms/ModernWMS', '_blank')
- } else if (type === 'github') {
- window.open('https://github.com/fjykTec/ModernWMS', '_blank')
- }
- }
-})
-
-const firstName = computed(() => {
- const userInfo = store.getters['user/userInfo']
- return userInfo?.user_name?.charAt(0) || ''
-})
-</script>
-
-<style scoped lang="less">
-@headerHeight: 60px;
-
-.homeHeader {
- width: 100%;
- height: @headerHeight;
- position: relative;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 20px;
- box-sizing: border-box;
- border-radius: 0 0 10px 10px;
- transition: all 0.5s;
-
- box-shadow: 0 3px 3px -2px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)),
- 0 3px 4px 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0 1px 8px 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.12));
- background-color: rgba(255, 255, 255, 0.5);
-
- .menuTitle {
- display: flex;
-
- .v-icon {
- margin-right: 10px;
- }
-
- span {
- color: #b9b8bc;
- }
- }
-
- .gitSrc {
- display: flex;
- align-items: center;
- justify-content: flex-end;
-
- > img {
- width: 24px;
- height: 24px;
- opacity: 0.5;
- }
-
- :hover {
- cursor: pointer;
- opacity: 1;
- scale: 1.1;
- transition: all ease-in-out 0.2s;
- }
- }
- .toolsBar {
- display: flex;
- align-items: center;
- justify-content: flex-end;
-
- .toolItems {
- height: 40px;
- width: 40px;
- font-size: 16px;
- display: flex;
- justify-content: center;
- align-items: center;
- transition: all 0.5s;
- border-radius: 40px;
- margin-right: 10px;
- cursor: pointer;
-
- &:hover {
- background-color: #e4e5ea;
- }
-
- &:active {
- background-color: #cdced3;
- }
- }
-
- .bell {
- position: relative;
-
- .hasNotify {
- margin: 0;
- width: 11px;
- height: 11px;
- border-radius: 11px;
- background-color: #ff4c51;
- border: 1px solid #fff;
- position: absolute;
- top: 5px;
- right: 7px;
- }
- }
-
- .headPortrait {
- border-radius: 40px;
- width: 40px;
- height: 40px;
- background-color: #e8e2fb;
- position: relative;
-
- .alive {
- margin: 0;
- width: 11px;
- height: 11px;
- border-radius: 11px;
- background-color: #56ca00;
- border: 1px solid #fff;
- position: absolute;
- bottom: 1px;
- right: 1px;
- }
- }
- }
-}
-
-.firstName{
- font-weight: 600;
- color: #9c27b0;
-}
-</style>
+<template>
+ <div class="homeHeader">
+ <div class="menuTitle">
+ <v-breadcrumbs :items="data.breadcrumbItems">
+ <template #prepend>
+ <v-icon :color="lightGrey" size="small" icon="mdi-form-select"></v-icon>
+ </template>
+ </v-breadcrumbs>
+ </div>
+ <div class="toolsBar">
+ <div class="gitSrc mr-4">
+ <img src="@/assets/img/gitee.png" alt="Gitee" @click="method.toGit('gitee')">
+ </div>
+ <div class="gitSrc mr-4">
+ <img src="@/assets/img/github.png" alt="Gitee" @click="method.toGit('github')">
+ </div>
+ <LanguagesSwitch />
+ <v-menu>
+ <template #activator="{ props }">
+ <div class="toolItems headPortrait ml-4" v-bind="props">
+ <p class="firstName">{{ firstName }}</p>
+ <div class="alive"></div>
+ </div>
+ </template>
+ <v-list>
+ <v-list-item v-for="(item, index) in data.userOperationMenu" :key="index" :value="index" @click="method.operation(item.value)">
+ <v-list-item-title>{{ item.title }}</v-list-item-title>
+ </v-list-item>
+ </v-list>
+ </v-menu>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { reactive, watch, computed } from 'vue'
+import { useRouter } from 'vue-router'
+import LanguagesSwitch from '@/components/system/languages.vue'
+import { lightGrey } from '@/constant/style'
+import i18n from '@/languages/i18n'
+import { router } from '@/router'
+import { store } from '@/store'
+import { DataProps } from '@/types/Home/HomeHeader'
+
+const routerInfo = useRouter()
+
+const data: DataProps = reactive({
+ breadcrumbItems: [],
+ // User Action List
+ userOperationMenu: [
+ {
+ title: i18n.global.t('system.homeHeader.logout'),
+ value: 'logout'
+ }
+ ]
+})
+
+// Get current page route info
+watch(
+ () => routerInfo,
+ (newValue) => {
+ const MODULE = i18n.global.t(`router.sideBar.${ newValue.currentRoute.value.meta.menuModule }`)
+ const PATH = i18n.global.t(`router.sideBar.${ newValue.currentRoute.value.meta.menuPath }`)
+
+ data.breadcrumbItems = [
+ {
+ title: PATH,
+ disabled: true
+ }
+ ]
+
+ if (newValue.currentRoute.value.meta.menuModule) {
+ data.breadcrumbItems.unshift({
+ title: MODULE,
+ disabled: true
+ })
+ }
+ },
+ { immediate: true, deep: true }
+)
+
+const method = reactive({
+ // User operation method
+ operation: (value: string) => {
+ if (value === 'logout') {
+ store.commit('system/clearOpenedMenu')
+ store.commit('system/setCurrentRouterPath', '')
+
+ router.push('/login')
+ }
+ },
+ toGit: (type: string) => {
+ if (type === 'gitee') {
+ window.open('https://gitee.com/modernwms/ModernWMS', '_blank')
+ } else if (type === 'github') {
+ window.open('https://github.com/fjykTec/ModernWMS', '_blank')
+ }
+ }
+})
+
+const firstName = computed(() => {
+ const userInfo = store.getters['user/userInfo']
+ return userInfo?.user_name?.charAt(0) || ''
+})
+</script>
+
+<style scoped lang="less">
+@headerHeight: 60px;
+
+.homeHeader {
+ width: 100%;
+ height: @headerHeight;
+ position: relative;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0 20px;
+ box-sizing: border-box;
+ border-radius: 0 0 10px 10px;
+ transition: all 0.5s;
+
+ box-shadow: 0 3px 3px -2px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)),
+ 0 3px 4px 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0 1px 8px 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.12));
+ background-color: rgba(255, 255, 255, 0.5);
+
+ .menuTitle {
+ display: flex;
+
+ .v-icon {
+ margin-right: 10px;
+ }
+
+ span {
+ color: #b9b8bc;
+ }
+ }
+
+ .gitSrc {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+
+ > img {
+ width: 24px;
+ height: 24px;
+ opacity: 0.5;
+ }
+
+ :hover {
+ cursor: pointer;
+ opacity: 1;
+ scale: 1.1;
+ transition: all ease-in-out 0.2s;
+ }
+ }
+ .toolsBar {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+
+ .toolItems {
+ height: 40px;
+ width: 40px;
+ font-size: 16px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ transition: all 0.5s;
+ border-radius: 40px;
+ margin-right: 10px;
+ cursor: pointer;
+
+ &:hover {
+ background-color: #e4e5ea;
+ }
+
+ &:active {
+ background-color: #cdced3;
+ }
+ }
+
+ .bell {
+ position: relative;
+
+ .hasNotify {
+ margin: 0;
+ width: 11px;
+ height: 11px;
+ border-radius: 11px;
+ background-color: #ff4c51;
+ border: 1px solid #fff;
+ position: absolute;
+ top: 5px;
+ right: 7px;
+ }
+ }
+
+ .headPortrait {
+ border-radius: 40px;
+ width: 40px;
+ height: 40px;
+ background-color: #e8e2fb;
+ position: relative;
+
+ .alive {
+ margin: 0;
+ width: 11px;
+ height: 11px;
+ border-radius: 11px;
+ background-color: #56ca00;
+ border: 1px solid #fff;
+ position: absolute;
+ bottom: 1px;
+ right: 1px;
+ }
+ }
+ }
+}
+
+.firstName{
+ font-weight: 600;
+ color: #9c27b0;
+}
+</style>
diff --git a/frontend/src/view/Home/homeSideBar.vue b/frontend/src/view/home/homeSideBar.vue
similarity index 96%
rename from frontend/src/view/Home/homeSideBar.vue
rename to frontend/src/view/home/homeSideBar.vue
index 71d59ff..eed264e 100644
--- a/frontend/src/view/Home/homeSideBar.vue
+++ b/frontend/src/view/home/homeSideBar.vue
@@ -1,180 +1,180 @@
-<template>
- <div style="height: 100%">
- <div class="homeSidebar">
- <div class="sideBarTitle">
- <Logo :height="50" :top="15" :left="5" />
- </div>
- <!-- 测试数据 -->
- <div class="sideBarMenus">
- <div v-for="(item, index) in data.menuList" :key="index">
- <div class="menuItems" :class="method.getItemClass(item)" @click="method.openMenu(item)">
- <div style="display: flex; align-items: center; height: 100%">
- <div class="menuIcon">
- <v-icon
- :icon="item.icon ? 'mdi-' + item.icon : 'mdi-checkbox-blank-circle-outline'"
- :size="18"
- :color="currentRouterPath === item.routerPath ? '#fff' : '#524e59'"
- ></v-icon>
- </div>
- <div class="menuLabel">{{ item.lable }}</div>
- </div>
- <div v-if="item.children && item.children.length > 0" :class="item.showDetail && 'rotate90'">
- <v-icon icon="mdi-chevron-right" color="#524e59" :size="22"></v-icon>
- </div>
- </div>
- <!-- <Transition name="menu"> -->
- <v-expand-transition>
- <div v-show="item.showDetail">
- <div
- v-for="(detailItem, detailIndex) in item.children"
- :key="detailIndex"
- class="menuItems padding-l"
- :class="method.getItemClass(detailItem)"
- @click="method.openMenu(detailItem)"
- >
- <div style="display: flex; align-items: center; height: 100%">
- <div class="menuIcon">
- <v-icon
- :icon="detailItem.icon ? `mdi-${detailItem.icon}` : 'mdi-checkbox-blank-circle-outline'"
- :size="14"
- :color="currentRouterPath === detailItem.routerPath ? '#fff' : '#524e59'"
- ></v-icon>
- </div>
- <div class="menuLabel">{{ detailItem.lable }}</div>
- </div>
- </div>
- </div>
- </v-expand-transition>
- <!-- </Transition> -->
- </div>
- </div>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { reactive, onMounted, computed } from 'vue'
-import Logo from '@/components/system/logo.vue'
-import { SideBarMenu, SideBarDataProps } from '@/types/Home/Home'
-import { menusToSideBar } from '@/utils/router'
-import { store } from '@/store'
-import { router } from '@/router'
-
-const data: SideBarDataProps = reactive({
- menuList: []
-})
-
-const method = reactive({
- // Open menu
- openMenu: (item: SideBarMenu) => {
- if (item.children && item.children.length > 0) {
- item.showDetail = !item.showDetail
- } else if (item.routerPath && currentRouterPath.value !== item.routerPath) {
- // If the selected menu is skipped, no action will be taken
- store.commit('system/setCurrentRouterPath', item.routerPath)
- store.commit('system/addOpenedMenu', item.routerPath)
- router.push(item.routerPath)
- }
- // if (menuName === 'login') {
- // store.commit('system/clearOpenedMenu', menuName)
- // } else {
- // store.commit('system/addOpenedMenu', menuName)
- // }
- // router.push(menuName)
- },
- // Get item class
- getItemClass: (item: SideBarMenu) => {
- if (item.children && item.children.length > 0 && item.showDetail) {
- return 'openedMenuItems'
- }
- if (currentRouterPath.value === item.routerPath) {
- return 'activeMenuItems'
- }
- return ''
- }
-})
-
-// Currently selected menu
-const currentRouterPath = computed(() => store.getters['system/currentRouterPath'])
-
-onMounted(() => {
- data.menuList = menusToSideBar()
-})
-</script>
-
-<style scoped lang="less">
-@headerHeight: 60px;
-@sideBarWidth: 300px;
-@sideBarTitleHeight: 70px;
-.homeSidebar {
- width: @sideBarWidth;
- box-shadow: 5px 5px 5px #dbdce2;
- height: 100%;
- .sideBarTitle {
- height: @sideBarTitleHeight;
- position: relative;
- }
- .sideBarMenus {
- height: calc(100% - @sideBarTitleHeight);
- overflow: auto;
- .menuItems {
- // height: 42px;
- width: calc(100% - 20px);
- box-sizing: border-box;
- padding: 10px 0;
- padding-left: 22px;
- padding-right: 8px;
- border-radius: 0 50px 50px 0;
- margin-bottom: 7px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- color: #696671;
- cursor: pointer;
- .menuIcon {
- height: 100%;
- width: 20px;
- margin-right: 10px;
- display: flex;
- justify-content: center;
- align-items: center;
- .v-icon {
- width: 10px;
- height: 10px;
- }
- }
- &:hover {
- background-color: #edeef3;
- }
- }
-
- .openedMenuItems {
- background-color: #e8e9ed;
- }
- .activeMenuItems {
- background: linear-gradient(to right, #af85fc, #9155fd);
- color: #fff;
- &:hover {
- background: linear-gradient(to right, #af85fc, #9155fd);
- }
- }
-
- &::-webkit-scrollbar {
- width: 7px;
- }
-
- &::-webkit-scrollbar-thumb {
- border-radius: 20px;
- background-color: #e5e5e9;
- }
- }
-}
-
-.rotate90 {
- transform: rotate(90deg);
-}
-
-.padding-l{
- padding-left: 44px !important;
-}
-</style>
+<template>
+ <div style="height: 100%">
+ <div class="homeSidebar">
+ <div class="sideBarTitle">
+ <Logo :height="50" :top="15" :left="5" />
+ </div>
+ <!-- 测试数据 -->
+ <div class="sideBarMenus">
+ <div v-for="(item, index) in data.menuList" :key="index">
+ <div class="menuItems" :class="method.getItemClass(item)" @click="method.openMenu(item)">
+ <div style="display: flex; align-items: center; height: 100%">
+ <div class="menuIcon">
+ <v-icon
+ :icon="item.icon ? 'mdi-' + item.icon : 'mdi-checkbox-blank-circle-outline'"
+ :size="18"
+ :color="currentRouterPath === item.routerPath ? '#fff' : '#524e59'"
+ ></v-icon>
+ </div>
+ <div class="menuLabel">{{ item.lable }}</div>
+ </div>
+ <div v-if="item.children && item.children.length > 0" :class="item.showDetail && 'rotate90'">
+ <v-icon icon="mdi-chevron-right" color="#524e59" :size="22"></v-icon>
+ </div>
+ </div>
+ <!-- <Transition name="menu"> -->
+ <v-expand-transition>
+ <div v-show="item.showDetail">
+ <div
+ v-for="(detailItem, detailIndex) in item.children"
+ :key="detailIndex"
+ class="menuItems padding-l"
+ :class="method.getItemClass(detailItem)"
+ @click="method.openMenu(detailItem)"
+ >
+ <div style="display: flex; align-items: center; height: 100%">
+ <div class="menuIcon">
+ <v-icon
+ :icon="detailItem.icon ? `mdi-${detailItem.icon}` : 'mdi-checkbox-blank-circle-outline'"
+ :size="14"
+ :color="currentRouterPath === detailItem.routerPath ? '#fff' : '#524e59'"
+ ></v-icon>
+ </div>
+ <div class="menuLabel">{{ detailItem.lable }}</div>
+ </div>
+ </div>
+ </div>
+ </v-expand-transition>
+ <!-- </Transition> -->
+ </div>
+ </div>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { reactive, onMounted, computed } from 'vue'
+import Logo from '@/components/system/logo.vue'
+import { SideBarMenu, SideBarDataProps } from '@/types/Home/Home'
+import { menusToSideBar } from '@/utils/router'
+import { store } from '@/store'
+import { router } from '@/router'
+
+const data: SideBarDataProps = reactive({
+ menuList: []
+})
+
+const method = reactive({
+ // Open menu
+ openMenu: (item: SideBarMenu) => {
+ if (item.children && item.children.length > 0) {
+ item.showDetail = !item.showDetail
+ } else if (item.routerPath && currentRouterPath.value !== item.routerPath) {
+ // If the selected menu is skipped, no action will be taken
+ store.commit('system/setCurrentRouterPath', item.routerPath)
+ store.commit('system/addOpenedMenu', item.routerPath)
+ router.push(item.routerPath)
+ }
+ // if (menuName === 'login') {
+ // store.commit('system/clearOpenedMenu', menuName)
+ // } else {
+ // store.commit('system/addOpenedMenu', menuName)
+ // }
+ // router.push(menuName)
+ },
+ // Get item class
+ getItemClass: (item: SideBarMenu) => {
+ if (item.children && item.children.length > 0 && item.showDetail) {
+ return 'openedMenuItems'
+ }
+ if (currentRouterPath.value === item.routerPath) {
+ return 'activeMenuItems'
+ }
+ return ''
+ }
+})
+
+// Currently selected menu
+const currentRouterPath = computed(() => store.getters['system/currentRouterPath'])
+
+onMounted(() => {
+ data.menuList = menusToSideBar()
+})
+</script>
+
+<style scoped lang="less">
+@headerHeight: 60px;
+@sideBarWidth: 300px;
+@sideBarTitleHeight: 70px;
+.homeSidebar {
+ width: @sideBarWidth;
+ box-shadow: 5px 5px 5px #dbdce2;
+ height: 100%;
+ .sideBarTitle {
+ height: @sideBarTitleHeight;
+ position: relative;
+ }
+ .sideBarMenus {
+ height: calc(100% - @sideBarTitleHeight);
+ overflow: auto;
+ .menuItems {
+ // height: 42px;
+ width: calc(100% - 20px);
+ box-sizing: border-box;
+ padding: 10px 0;
+ padding-left: 22px;
+ padding-right: 8px;
+ border-radius: 0 50px 50px 0;
+ margin-bottom: 7px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ color: #696671;
+ cursor: pointer;
+ .menuIcon {
+ height: 100%;
+ width: 20px;
+ margin-right: 10px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ .v-icon {
+ width: 10px;
+ height: 10px;
+ }
+ }
+ &:hover {
+ background-color: #edeef3;
+ }
+ }
+
+ .openedMenuItems {
+ background-color: #e8e9ed;
+ }
+ .activeMenuItems {
+ background: linear-gradient(to right, #af85fc, #9155fd);
+ color: #fff;
+ &:hover {
+ background: linear-gradient(to right, #af85fc, #9155fd);
+ }
+ }
+
+ &::-webkit-scrollbar {
+ width: 7px;
+ }
+
+ &::-webkit-scrollbar-thumb {
+ border-radius: 20px;
+ background-color: #e5e5e9;
+ }
+ }
+}
+
+.rotate90 {
+ transform: rotate(90deg);
+}
+
+.padding-l{
+ padding-left: 44px !important;
+}
+</style>
diff --git a/frontend/src/view/Home/homepage/homepage.vue b/frontend/src/view/home/homepage/homepage.vue
similarity index 94%
rename from frontend/src/view/Home/homepage/homepage.vue
rename to frontend/src/view/home/homepage/homepage.vue
index 46e7f8e..b12fdf1 100644
--- a/frontend/src/view/Home/homepage/homepage.vue
+++ b/frontend/src/view/home/homepage/homepage.vue
@@ -1,68 +1,68 @@
-<template>
- <div class="container">
- <div class="textBox">
- <div class="mainTitle">ModernWMS</div>
- <div class="subTitle">{{ i18n.global.t('homepage.subTitle') }}</div>
- </div>
- <div class="content">
- <div class="lottieBox">
- <lottie :src="dataJson"></lottie>
- </div>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import lottie from '@/components/lottie.vue'
-import dataJson from '@/assets/warehouse.json'
-import i18n from '@/languages/i18n'
-</script>
-
-<style scoped lang="less">
-.container {
- width: 100%;
- height: 100%;
- display: flex;
- justify-content: center;
- position: relative;
- align-items: center;
-}
-
-.content {
- width: 60%;
-}
-
-.textBox {
- width: 100%;
- position: absolute;
- left: 50%;
- top: 5%;
- transform: translate(-50%, 0);
- letter-spacing: 5px;
- z-index: 999;
- font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
-}
-
-.mainTitle {
- display: flex;
- justify-content: center;
- width: 100%;
- color: #9c27b0;
- font-weight: bold;
- font-size: 120px;
-}
-
-.subTitle {
- display: flex;
- justify-content: center;
- width: 100%;
- font-size: 30px;
- letter-spacing: 5px;
- color: #c9a7cf;
-}
-
-.lottieBox {
- min-width: 100%;
- max-width: 100%;
-}
-</style>
+<template>
+ <div class="container">
+ <div class="textBox">
+ <div class="mainTitle">ModernWMS</div>
+ <div class="subTitle">{{ i18n.global.t('homepage.subTitle') }}</div>
+ </div>
+ <div class="content">
+ <div class="lottieBox">
+ <lottie :src="dataJson"></lottie>
+ </div>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import lottie from '@/components/lottie.vue'
+import dataJson from '@/assets/warehouse.json'
+import i18n from '@/languages/i18n'
+</script>
+
+<style scoped lang="less">
+.container {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ position: relative;
+ align-items: center;
+}
+
+.content {
+ width: 60%;
+}
+
+.textBox {
+ width: 100%;
+ position: absolute;
+ left: 50%;
+ top: 5%;
+ transform: translate(-50%, 0);
+ letter-spacing: 5px;
+ z-index: 999;
+ font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
+}
+
+.mainTitle {
+ display: flex;
+ justify-content: center;
+ width: 100%;
+ color: #9c27b0;
+ font-weight: bold;
+ font-size: 120px;
+}
+
+.subTitle {
+ display: flex;
+ justify-content: center;
+ width: 100%;
+ font-size: 30px;
+ letter-spacing: 5px;
+ color: #c9a7cf;
+}
+
+.lottieBox {
+ min-width: 100%;
+ max-width: 100%;
+}
+</style>
diff --git a/frontend/src/view/Login/login.vue b/frontend/src/view/login/login.vue
similarity index 95%
rename from frontend/src/view/Login/login.vue
rename to frontend/src/view/login/login.vue
index d68cf91..1e0832f 100644
--- a/frontend/src/view/Login/login.vue
+++ b/frontend/src/view/login/login.vue
@@ -1,46 +1,46 @@
-<template>
- <div class="loginContainer">
- <Logo />
- <div class="loginLeft">
- <img src="../../assets/img/loginLeft.png" style="width: 80%" />
- </div>
- <div class="loginRight">
- <div class="LanguagesSwitchContainer">
- <LanguagesSwitch />
- </div>
- <LoginForm />
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import LoginForm from '@/components/login/login-form.vue'
-import LanguagesSwitch from '@/components/system/languages.vue'
-import Logo from '@/components/system/logo.vue'
-</script>
-
-<style scoped lang="less">
-.LanguagesSwitchContainer {
- position: absolute;
- right: 10px;
- top: 10px;
-}
-.loginContainer {
- width: 100%;
- height: 100%;
- display: flex;
- background-color: #fff;
- .loginLeft {
- width: 70%;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .loginRight {
- width: 30%;
- background-color: #fafafa;
- display: flex;
- align-items: center;
- }
-}
-</style>
+<template>
+ <div class="loginContainer">
+ <Logo />
+ <div class="loginLeft">
+ <img src="../../assets/img/loginLeft.png" style="width: 80%" />
+ </div>
+ <div class="loginRight">
+ <div class="LanguagesSwitchContainer">
+ <LanguagesSwitch />
+ </div>
+ <LoginForm />
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import LoginForm from '@/components/login/login-form.vue'
+import LanguagesSwitch from '@/components/system/languages.vue'
+import Logo from '@/components/system/logo.vue'
+</script>
+
+<style scoped lang="less">
+.LanguagesSwitchContainer {
+ position: absolute;
+ right: 10px;
+ top: 10px;
+}
+.loginContainer {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ background-color: #fff;
+ .loginLeft {
+ width: 70%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ .loginRight {
+ width: 30%;
+ background-color: #fafafa;
+ display: flex;
+ align-items: center;
+ }
+}
+</style>
diff --git a/frontend/src/view/pageTemplate/PageTemplate.vue b/frontend/src/view/pageTemplate/PageTemplate.vue
index ed2dd70..9b274a0 100644
--- a/frontend/src/view/pageTemplate/PageTemplate.vue
+++ b/frontend/src/view/pageTemplate/PageTemplate.vue
@@ -1,245 +1,245 @@
-<template>
- <div class="container">
- <div>
- <!-- According to your own need to decide whether to the tab, if you don't need that you can delete <v-tabs> -->
- <v-tabs v-model="data.activeTab" stacked>
- <v-tab v-for="(item, index) of tabsConfig" :key="index" :value="item.value">
- <v-icon>{{ item.icon }}</v-icon>
- <p class="tabItemTitle">{{ item.tabName }}</p>
- </v-tab>
- </v-tabs>
-
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <v-window v-model="data.activeTab">
- <!-- If you have more than one tab, you should write more <v-window-item> and give it 'value' -->
- <v-window-item value="tabOne">
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <!--
- Don't delete v-col whether you don't need.
- If you only need one query, you should write:
-
- <v-col cols="4"></v-col>
- <v-col cols="4"></v-col>
- <v-col cols="4">Some Thing</v-col>
- -->
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.userName"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.userName1"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.userName2"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('login.userName')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-pencil-outline"
- :tooltip-text="$t('system.page.edit')"
- @click="method.editRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- </v-window-item>
- </v-window>
- </v-card-text>
- </v-card>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, onMounted } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import customPager from '@/components/custom-pager.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-/**
- * Table Model, this just a example
- * You should put it on the 'types' folder
- */
-interface UserVO {
- id: number
- name: string
- role: string
- sex: string
- age: number
- address: string
-}
-
-const tabsConfig = [
- {
- value: 'tabOne',
- icon: 'mdi-phone',
- tabName: 'tabOne'
- }
-]
-
-const data = reactive({
- // TODO Adjust the search prop what you want
- searchForm: {
- userName: '',
- userName1: '',
- userName2: ''
- },
- activeTab: null,
- tableData: ref<UserVO[]>([
- { id: 10001, name: 'Test1', role: 'Develop', sex: 'Man', age: 28, address: 'test abc' },
- { id: 10002, name: 'Test2', role: 'Test', sex: 'Women', age: 22, address: 'Guangzhou' },
- { id: 10003, name: 'Test3', role: 'PM', sex: 'Man', age: 32, address: 'Shanghai' },
- { id: 10004, name: 'Test4', role: 'Designer', sex: 'Women', age: 24, address: 'Shanghai' }
- ]),
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE
- })
-})
-
-const method = reactive({
- editRow(row: any) {
- console.log(row)
- },
- deleteRow(row: any) {
- console.log(row)
- },
- sureSearch: () => {
- console.log(data.searchForm)
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
- // TODO Get datas what you want
- }),
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- // TODO Write filename according to your file.
- filename: i18n.global.t('base.warehouseSetting.locationSetting'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- }
-})
-
-onMounted(() => {
- // TODO Get datas what you want
-})
-
-/**
- * computedCardHeight({ hasTab, hasOperate })
- * Must enter the params if you don't need tab or operate area
- * Defaultly, the 'hasTab' and 'hasOperate' are true
- */
-const cardHeight = computed(() => computedCardHeight({}))
-
-/**
- * computedTableHeight({ hasPager, hasTab, hasOperate })
- * Must enter the params if you don't need pager or tab or operate area
- * Defaultly, the 'hasPager' and 'hasTab' and 'hasOperate' are true
- */
-const tableHeight = computed(() => computedTableHeight({}))
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="container">
+ <div>
+ <!-- According to your own need to decide whether to the tab, if you don't need that you can delete <v-tabs> -->
+ <v-tabs v-model="data.activeTab" stacked>
+ <v-tab v-for="(item, index) of tabsConfig" :key="index" :value="item.value">
+ <v-icon>{{ item.icon }}</v-icon>
+ <p class="tabItemTitle">{{ item.tabName }}</p>
+ </v-tab>
+ </v-tabs>
+
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <v-window v-model="data.activeTab">
+ <!-- If you have more than one tab, you should write more <v-window-item> and give it 'value' -->
+ <v-window-item value="tabOne">
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"></tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <!--
+ Don't delete v-col whether you don't need.
+ If you only need one query, you should write:
+
+ <v-col cols="4"></v-col>
+ <v-col cols="4"></v-col>
+ <v-col cols="4">Some Thing</v-col>
+ -->
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.userName"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.userName1"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.userName2"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('login.userName')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-pencil-outline"
+ :tooltip-text="$t('system.page.edit')"
+ @click="method.editRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ </v-window-item>
+ </v-window>
+ </v-card-text>
+ </v-card>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, onMounted } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import customPager from '@/components/custom-pager.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+/**
+ * Table Model, this just a example
+ * You should put it on the 'types' folder
+ */
+interface UserVO {
+ id: number
+ name: string
+ role: string
+ sex: string
+ age: number
+ address: string
+}
+
+const tabsConfig = [
+ {
+ value: 'tabOne',
+ icon: 'mdi-phone',
+ tabName: 'tabOne'
+ }
+]
+
+const data = reactive({
+ // TODO Adjust the search prop what you want
+ searchForm: {
+ userName: '',
+ userName1: '',
+ userName2: ''
+ },
+ activeTab: null,
+ tableData: ref<UserVO[]>([
+ { id: 10001, name: 'Test1', role: 'Develop', sex: 'Man', age: 28, address: 'test abc' },
+ { id: 10002, name: 'Test2', role: 'Test', sex: 'Women', age: 22, address: 'Guangzhou' },
+ { id: 10003, name: 'Test3', role: 'PM', sex: 'Man', age: 32, address: 'Shanghai' },
+ { id: 10004, name: 'Test4', role: 'Designer', sex: 'Women', age: 24, address: 'Shanghai' }
+ ]),
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE
+ })
+})
+
+const method = reactive({
+ editRow(row: any) {
+ console.log(row)
+ },
+ deleteRow(row: any) {
+ console.log(row)
+ },
+ sureSearch: () => {
+ console.log(data.searchForm)
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+ // TODO Get datas what you want
+ }),
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ // TODO Write filename according to your file.
+ filename: i18n.global.t('base.warehouseSetting.locationSetting'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ }
+})
+
+onMounted(() => {
+ // TODO Get datas what you want
+})
+
+/**
+ * computedCardHeight({ hasTab, hasOperate })
+ * Must enter the params if you don't need tab or operate area
+ * Defaultly, the 'hasTab' and 'hasOperate' are true
+ */
+const cardHeight = computed(() => computedCardHeight({}))
+
+/**
+ * computedTableHeight({ hasPager, hasTab, hasOperate })
+ * Must enter the params if you don't need pager or tab or operate area
+ * Defaultly, the 'hasPager' and 'hasTab' and 'hasOperate' are true
+ */
+const tableHeight = computed(() => computedTableHeight({}))
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/warehouseWorking/warehouseAdjust/add-or-update-adjust.vue b/frontend/src/view/warehouseWorking/warehouseAdjust/add-or-update-adjust.vue
index fe33591..358d3ac 100644
--- a/frontend/src/view/warehouseWorking/warehouseAdjust/add-or-update-adjust.vue
+++ b/frontend/src/view/warehouseWorking/warehouseAdjust/add-or-update-adjust.vue
@@ -1,282 +1,282 @@
-<!-- Warehouse Adjust Operate Dialog -->
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar class="" color="white" :title="`${$t('router.sideBar.warehouseAdjust')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-select
- v-model="data.form.job_type"
- :items="data.combobox.job_type"
- item-title="label"
- item-value="value"
- :rules="data.rules.job_type"
- :label="$t('wms.warehouseWorking.warehouseAdjust.job_type')"
- variant="outlined"
- clearable
- :disabled="isAssociatedJobType"
- @update:model-value="method.changeJobType"
- ></v-select>
- <v-text-field
- v-model="data.form.spu_code"
- :label="$t('base.commodityManagement.spu_code')"
- :rules="data.rules.spu_code"
- variant="outlined"
- readonly
- clearable
- :disabled="isAssociatedJobType"
- @click="method.openCommoditySelect"
- @click:clear="method.clearCommodity"
- ></v-text-field>
- <v-text-field
- v-model="data.form.spu_name"
- :label="$t('base.commodityManagement.spu_name')"
- :rules="data.rules.spu_name"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.sku_code"
- :label="$t('base.commodityManagement.sku_code')"
- :rules="data.rules.sku_code"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.warehouse_name"
- :label="$t('wms.warehouseWorking.warehouseAdjust.warehouse')"
- :rules="data.rules.warehouse_name"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.location_name"
- :label="$t('wms.warehouseWorking.warehouseAdjust.location_name')"
- :rules="data.rules.location_name"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.qty"
- :label="$t('wms.warehouseWorking.warehouseAdjust.qty')"
- :rules="data.rules.qty"
- variant="outlined"
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" :disabled="operateDisabled" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-
- <commodity-select
- :show-dialog="data.showCommodityDialogSelect"
- @close="method.closeCommodityDialogSelect"
- @sureSelect="method.sureSelectCommodity"
- />
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addStockAdjust } from '@/api/wms/warehouseAdjust'
-import { WarehouseAdjustVO, AdjustJobType } from '@/types/WarehouseWorking/WarehouseAdjust'
-import { removeObjectNull } from '@/utils/common'
-import commoditySelect from '@/components/select/commodity-select.vue'
-import { IsInteger } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-const isUpdate = computed(() => props.form.id && props.form.id > 0)
-const operateDisabled = computed(() => !!isUpdate.value)
-
-const props = defineProps<{
- showDialog: boolean
- form: WarehouseAdjustVO
- // If 'associatedJobType' has value, the 'job_type' and 'sku' should be disabled.
- associatedJobType?: AdjustJobType
-}>()
-
-const isShow = computed(() => props.showDialog)
-const isAssociatedJobType = computed(() => !!(props.associatedJobType && props.associatedJobType > 0))
-
-const data = reactive({
- showCommodityDialogSelect: false,
- showLocationDialogSelect: false,
-
- form: ref<WarehouseAdjustVO>({
- id: 0,
- // job_type: AdjustJobType.UNKNOW,
- job_code: '',
- sku_id: 0,
- goods_owner_id: 0,
- goods_location_id: 0,
- qty: 0,
- is_update_stock: false,
- source_table_id: 0,
- spu_code: '',
- spu_name: '',
- sku_code: '',
- warehouse_name: '',
- location_name: '',
- creator: '',
- create_time: ''
- }),
- rules: {
- job_type: [],
- qty: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseAdjust.qty') }!`,
- (val: number) => IsInteger(val, 'greaterThanZero') === '' || IsInteger(val, 'greaterThanZero')
- ],
- warehouse_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseAdjust.warehouse') }!`
- ],
- location_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseAdjust.location_name') }!`
- ],
- spu_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_code') }!`],
- spu_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_name') }!`],
- sku_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_code') }!`],
- sku_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_name') }!`]
- },
- combobox: ref<{
- job_type: {
- label: string
- value: AdjustJobType
- }[]
- }>({
- job_type: [
- {
- label: i18n.global.t('wms.warehouseWorking.warehouseAdjust.warehouseTake'),
- value: AdjustJobType.TAKE
- },
- {
- label: i18n.global.t('wms.warehouseWorking.warehouseAdjust.processCombine'),
- value: AdjustJobType.PROCESS_COMBINE
- },
- {
- label: i18n.global.t('wms.warehouseWorking.warehouseAdjust.processSplit'),
- value: AdjustJobType.PROCESS_SPLIT
- },
- {
- label: i18n.global.t('wms.warehouseWorking.warehouseAdjust.warehouseMove'),
- value: AdjustJobType.MOVE
- }
- ]
- })
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
-
- initForm: () => {
- data.form = props.form
-
- if (isAssociatedJobType.value) {
- data.form.job_type = props.associatedJobType
- }
- },
-
- changeJobType: (value: any) => {
- // Find the ID corresponding value
- const jobType = data.combobox.job_type.find((item) => item.value === value)
- if (jobType) {
- data.form.job_type = jobType.value
- }
- },
-
- openCommoditySelect: () => {
- // Open select modal after UI rendered.
- setTimeout(() => {
- data.showCommodityDialogSelect = true
- }, 100)
- },
-
- closeCommodityDialogSelect: () => {
- data.showCommodityDialogSelect = false
- },
-
- sureSelectCommodity: (selectRecords: any) => {
- try {
- data.form.sku_id = selectRecords[0].sku_id
- data.form.goods_owner_id = selectRecords[0].goods_owner_id
- data.form.goods_location_id = selectRecords[0].goods_location_id
- data.form.warehouse_name = selectRecords[0].warehouse
- data.form.location_name = selectRecords[0].location_name
- data.form.spu_code = selectRecords[0].spu_code
- data.form.spu_name = selectRecords[0].spu_name
- data.form.sku_code = selectRecords[0].sku_code
- } catch (error) {
- // console.error(error)
- }
- },
-
- clearCommodity: () => {
- data.form.sku_id = 0
- data.form.goods_location_id = 0
- data.form.warehouse_name = ''
- data.form.location_name = ''
- data.form.spu_code = ''
- data.form.spu_name = ''
- data.form.sku_code = ''
- },
-
- submit: async () => {
- const { valid } = await formRef.value.validate()
-
- const form = method.constructFormBody()
-
- if (valid) {
- const { data: res } = await addStockAdjust(form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- },
-
- constructFormBody: () => {
- let form = { ...data.form }
- form = removeObjectNull(form)
-
- return form
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- Warehouse Adjust Operate Dialog -->
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar class="" color="white" :title="`${$t('router.sideBar.warehouseAdjust')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-select
+ v-model="data.form.job_type"
+ :items="data.combobox.job_type"
+ item-title="label"
+ item-value="value"
+ :rules="data.rules.job_type"
+ :label="$t('wms.warehouseWorking.warehouseAdjust.job_type')"
+ variant="outlined"
+ clearable
+ :disabled="isAssociatedJobType"
+ @update:model-value="method.changeJobType"
+ ></v-select>
+ <v-text-field
+ v-model="data.form.spu_code"
+ :label="$t('base.commodityManagement.spu_code')"
+ :rules="data.rules.spu_code"
+ variant="outlined"
+ readonly
+ clearable
+ :disabled="isAssociatedJobType"
+ @click="method.openCommoditySelect"
+ @click:clear="method.clearCommodity"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.spu_name"
+ :label="$t('base.commodityManagement.spu_name')"
+ :rules="data.rules.spu_name"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.sku_code"
+ :label="$t('base.commodityManagement.sku_code')"
+ :rules="data.rules.sku_code"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.warehouse_name"
+ :label="$t('wms.warehouseWorking.warehouseAdjust.warehouse')"
+ :rules="data.rules.warehouse_name"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.location_name"
+ :label="$t('wms.warehouseWorking.warehouseAdjust.location_name')"
+ :rules="data.rules.location_name"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.qty"
+ :label="$t('wms.warehouseWorking.warehouseAdjust.qty')"
+ :rules="data.rules.qty"
+ variant="outlined"
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" :disabled="operateDisabled" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+
+ <commodity-select
+ :show-dialog="data.showCommodityDialogSelect"
+ @close="method.closeCommodityDialogSelect"
+ @sureSelect="method.sureSelectCommodity"
+ />
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addStockAdjust } from '@/api/wms/warehouseAdjust'
+import { WarehouseAdjustVO, AdjustJobType } from '@/types/WarehouseWorking/WarehouseAdjust'
+import { removeObjectNull } from '@/utils/common'
+import commoditySelect from '@/components/select/commodity-select.vue'
+import { IsInteger } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+const isUpdate = computed(() => props.form.id && props.form.id > 0)
+const operateDisabled = computed(() => !!isUpdate.value)
+
+const props = defineProps<{
+ showDialog: boolean
+ form: WarehouseAdjustVO
+ // If 'associatedJobType' has value, the 'job_type' and 'sku' should be disabled.
+ associatedJobType?: AdjustJobType
+}>()
+
+const isShow = computed(() => props.showDialog)
+const isAssociatedJobType = computed(() => !!(props.associatedJobType && props.associatedJobType > 0))
+
+const data = reactive({
+ showCommodityDialogSelect: false,
+ showLocationDialogSelect: false,
+
+ form: ref<WarehouseAdjustVO>({
+ id: 0,
+ // job_type: AdjustJobType.UNKNOW,
+ job_code: '',
+ sku_id: 0,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ qty: 0,
+ is_update_stock: false,
+ source_table_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ warehouse_name: '',
+ location_name: '',
+ creator: '',
+ create_time: ''
+ }),
+ rules: {
+ job_type: [],
+ qty: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseAdjust.qty') }!`,
+ (val: number) => IsInteger(val, 'greaterThanZero') === '' || IsInteger(val, 'greaterThanZero')
+ ],
+ warehouse_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseAdjust.warehouse') }!`
+ ],
+ location_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseAdjust.location_name') }!`
+ ],
+ spu_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_code') }!`],
+ spu_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_name') }!`],
+ sku_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_code') }!`],
+ sku_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_name') }!`]
+ },
+ combobox: ref<{
+ job_type: {
+ label: string
+ value: AdjustJobType
+ }[]
+ }>({
+ job_type: [
+ {
+ label: i18n.global.t('wms.warehouseWorking.warehouseAdjust.warehouseTake'),
+ value: AdjustJobType.TAKE
+ },
+ {
+ label: i18n.global.t('wms.warehouseWorking.warehouseAdjust.processCombine'),
+ value: AdjustJobType.PROCESS_COMBINE
+ },
+ {
+ label: i18n.global.t('wms.warehouseWorking.warehouseAdjust.processSplit'),
+ value: AdjustJobType.PROCESS_SPLIT
+ },
+ {
+ label: i18n.global.t('wms.warehouseWorking.warehouseAdjust.warehouseMove'),
+ value: AdjustJobType.MOVE
+ }
+ ]
+ })
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+
+ initForm: () => {
+ data.form = props.form
+
+ if (isAssociatedJobType.value) {
+ data.form.job_type = props.associatedJobType
+ }
+ },
+
+ changeJobType: (value: any) => {
+ // Find the ID corresponding value
+ const jobType = data.combobox.job_type.find((item) => item.value === value)
+ if (jobType) {
+ data.form.job_type = jobType.value
+ }
+ },
+
+ openCommoditySelect: () => {
+ // Open select modal after UI rendered.
+ setTimeout(() => {
+ data.showCommodityDialogSelect = true
+ }, 100)
+ },
+
+ closeCommodityDialogSelect: () => {
+ data.showCommodityDialogSelect = false
+ },
+
+ sureSelectCommodity: (selectRecords: any) => {
+ try {
+ data.form.sku_id = selectRecords[0].sku_id
+ data.form.goods_owner_id = selectRecords[0].goods_owner_id
+ data.form.goods_location_id = selectRecords[0].goods_location_id
+ data.form.warehouse_name = selectRecords[0].warehouse
+ data.form.location_name = selectRecords[0].location_name
+ data.form.spu_code = selectRecords[0].spu_code
+ data.form.spu_name = selectRecords[0].spu_name
+ data.form.sku_code = selectRecords[0].sku_code
+ } catch (error) {
+ // console.error(error)
+ }
+ },
+
+ clearCommodity: () => {
+ data.form.sku_id = 0
+ data.form.goods_location_id = 0
+ data.form.warehouse_name = ''
+ data.form.location_name = ''
+ data.form.spu_code = ''
+ data.form.spu_name = ''
+ data.form.sku_code = ''
+ },
+
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+
+ const form = method.constructFormBody()
+
+ if (valid) {
+ const { data: res } = await addStockAdjust(form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ },
+
+ constructFormBody: () => {
+ let form = { ...data.form }
+ form = removeObjectNull(form)
+
+ return form
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/warehouseWorking/warehouseAdjust/warehouseAdjust.vue b/frontend/src/view/warehouseWorking/warehouseAdjust/warehouseAdjust.vue
index 6497654..0098397 100644
--- a/frontend/src/view/warehouseWorking/warehouseAdjust/warehouseAdjust.vue
+++ b/frontend/src/view/warehouseWorking/warehouseAdjust/warehouseAdjust.vue
@@ -1,365 +1,365 @@
-<!-- Warehouse Adjust -->
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <v-window v-model="data.activeTab">
- <v-window-item>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <!-- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn> -->
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.job_code"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.warehouseWorking.warehouseAdjust.job_code')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="job_code" width="150px" :title="$t('wms.warehouseWorking.warehouseAdjust.job_code')"></vxe-column>
- <vxe-column field="job_type" width="150px" :title="$t('wms.warehouseWorking.warehouseAdjust.job_type')">
- <template #default="{ row, column }">
- <span>{{ formatAdjustJobType(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="spu_code" width="150px" :title="$t('base.commodityManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_name" width="150px" :title="$t('base.commodityManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" width="150px" :title="$t('base.commodityManagement.sku_code')"></vxe-column>
- <vxe-column field="qty" width="150px" :title="$t('wms.warehouseWorking.warehouseAdjust.qty')"></vxe-column>
- <vxe-column field="warehouse_name" width="150px" :title="$t('wms.warehouseWorking.warehouseAdjust.warehouse')"></vxe-column>
- <vxe-column field="location_name" width="150px" :title="$t('wms.warehouseWorking.warehouseAdjust.location_name')"></vxe-column>
- <!-- <vxe-column field="handler" width="150px" :title="$t('wms.warehouseWorking.warehouseAdjust.handler')"></vxe-column>
- <vxe-column
- field="handle_time"
- width="170px"
- :title="$t('wms.warehouseWorking.warehouseAdjust.handle_time')"
- ></vxe-column> -->
- <vxe-column field="creator" :title="$t('wms.warehouseWorking.warehouseAdjust.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.warehouseWorking.warehouseAdjust.create_time')"></vxe-column>
- <!-- <vxe-column field="operate" :title="$t('system.page.operate')" width="200" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-eye-outline"
- :tooltip-text="$t('system.page.view')"
- @click="method.viewRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-book-open-outline"
- :tooltip-text="$t('wms.warehouseWorking.warehouseAdjust.confirmAdjust')"
- :disabled="method.confirmAdjustBtnDisabled(row)"
- @click="method.confirmAdjust(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- :disabled="method.confirmAdjustBtnDisabled(row)"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column> -->
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- </v-window-item>
- </v-window>
- </v-card-text>
- </v-card>
- <addOrUpdateDialog
- :show-dialog="data.showDialog"
- :form="data.dialogForm"
- :process-type="data.processType"
- @close="method.closeDialog"
- @saveSuccess="method.saveSuccess"
- />
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch, nextTick, onActivated } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { WarehouseAdjustVO } from '@/types/WarehouseWorking/WarehouseAdjust'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { deleteStockAdjust, getStockAdjustList, getStockAdjustOne, confirmStockAdjust } from '@/api/wms/warehouseAdjust'
-import { PROCESS_JOB_COMBINE } from '@/constant/warehouseWorking'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { formatAdjustJobType } from '@/utils/format/formatWarehouseWorking'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import addOrUpdateDialog from './add-or-update-adjust.vue'
-import i18n from '@/languages/i18n'
-import customPager from '@/components/custom-pager.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-const data = reactive({
- showDialog: false,
- processType: PROCESS_JOB_COMBINE,
- timer: ref<any>(null),
- activeTab: null,
- searchForm: {
- job_code: ''
- },
- tableData: ref<WarehouseAdjustVO[]>([]),
- dialogForm: {
- id: 0,
- // job_type: AdjustJobType.TAKE,
- job_code: '',
- sku_id: 0,
- goods_owner_id: 0,
- goods_location_id: 0,
- qty: 0,
- is_update_stock: false,
- source_table_id: 0,
- spu_code: '',
- spu_name: '',
- sku_code: '',
- warehouse_name: '',
- location_name: ''
- },
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- })
-})
-
-const method = reactive({
- // Open a dialog to add
- add: () => {
- data.dialogForm = {
- id: 0,
- // job_type: AdjustJobType.TAKE,
- job_code: '',
- sku_id: 0,
- goods_owner_id: 0,
- goods_location_id: 0,
- qty: 0,
- is_update_stock: false,
- source_table_id: 0,
- spu_code: '',
- spu_name: '',
- sku_code: '',
- warehouse_name: '',
- location_name: ''
- }
- nextTick(() => {
- data.showDialog = true
- })
- },
-
- // After add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
-
- // Refresh data
- refresh: () => {
- method.getStockProcessList()
- },
-
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
-
- getStockProcessList: async () => {
- const { data: res } = await getStockAdjustList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
-
- viewRow: async (row: WarehouseAdjustVO) => {
- await method.getOne(row.id)
- nextTick(() => {
- data.showDialog = true
- })
- },
-
- getOne: async (id: number) => {
- const { data: res } = await getStockAdjustOne(id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
-
- data.dialogForm = res.data
- },
-
- deleteRow(row: WarehouseAdjustVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteStockAdjust(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
-
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
-
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
- method.refresh()
- }),
-
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.warehouseAdjust'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
-
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.refresh()
- },
-
- // The btn will become disabled when the 'process_status' is false
- // confirmAdjustBtnDisabled: (row: WarehouseAdjustVO) => row.is_update_stock === true,
-
- confirmAdjust: async (row: WarehouseAdjustVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('wms.warehouseWorking.warehouseAdjust.beforeConfirmAdjust'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await confirmStockAdjust(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('wms.warehouseWorking.warehouseAdjust.confirmAdjust') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- }
-})
-
-onActivated(() => {
- method.refresh()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<!-- Warehouse Adjust -->
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <v-window v-model="data.activeTab">
+ <v-window-item>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <!-- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn> -->
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.job_code"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.warehouseWorking.warehouseAdjust.job_code')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="job_code" width="150px" :title="$t('wms.warehouseWorking.warehouseAdjust.job_code')"></vxe-column>
+ <vxe-column field="job_type" width="150px" :title="$t('wms.warehouseWorking.warehouseAdjust.job_type')">
+ <template #default="{ row, column }">
+ <span>{{ formatAdjustJobType(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="spu_code" width="150px" :title="$t('base.commodityManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" width="150px" :title="$t('base.commodityManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" width="150px" :title="$t('base.commodityManagement.sku_code')"></vxe-column>
+ <vxe-column field="qty" width="150px" :title="$t('wms.warehouseWorking.warehouseAdjust.qty')"></vxe-column>
+ <vxe-column field="warehouse_name" width="150px" :title="$t('wms.warehouseWorking.warehouseAdjust.warehouse')"></vxe-column>
+ <vxe-column field="location_name" width="150px" :title="$t('wms.warehouseWorking.warehouseAdjust.location_name')"></vxe-column>
+ <!-- <vxe-column field="handler" width="150px" :title="$t('wms.warehouseWorking.warehouseAdjust.handler')"></vxe-column>
+ <vxe-column
+ field="handle_time"
+ width="170px"
+ :title="$t('wms.warehouseWorking.warehouseAdjust.handle_time')"
+ ></vxe-column> -->
+ <vxe-column field="creator" :title="$t('wms.warehouseWorking.warehouseAdjust.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.warehouseWorking.warehouseAdjust.create_time')"></vxe-column>
+ <!-- <vxe-column field="operate" :title="$t('system.page.operate')" width="200" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-eye-outline"
+ :tooltip-text="$t('system.page.view')"
+ @click="method.viewRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-book-open-outline"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseAdjust.confirmAdjust')"
+ :disabled="method.confirmAdjustBtnDisabled(row)"
+ @click="method.confirmAdjust(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ :disabled="method.confirmAdjustBtnDisabled(row)"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column> -->
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ </v-window-item>
+ </v-window>
+ </v-card-text>
+ </v-card>
+ <addOrUpdateDialog
+ :show-dialog="data.showDialog"
+ :form="data.dialogForm"
+ :process-type="data.processType"
+ @close="method.closeDialog"
+ @saveSuccess="method.saveSuccess"
+ />
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch, nextTick, onActivated } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { WarehouseAdjustVO } from '@/types/WarehouseWorking/WarehouseAdjust'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { deleteStockAdjust, getStockAdjustList, getStockAdjustOne, confirmStockAdjust } from '@/api/wms/warehouseAdjust'
+import { PROCESS_JOB_COMBINE } from '@/constant/warehouseWorking'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { formatAdjustJobType } from '@/utils/format/formatWarehouseWorking'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import addOrUpdateDialog from './add-or-update-adjust.vue'
+import i18n from '@/languages/i18n'
+import customPager from '@/components/custom-pager.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+const data = reactive({
+ showDialog: false,
+ processType: PROCESS_JOB_COMBINE,
+ timer: ref<any>(null),
+ activeTab: null,
+ searchForm: {
+ job_code: ''
+ },
+ tableData: ref<WarehouseAdjustVO[]>([]),
+ dialogForm: {
+ id: 0,
+ // job_type: AdjustJobType.TAKE,
+ job_code: '',
+ sku_id: 0,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ qty: 0,
+ is_update_stock: false,
+ source_table_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ warehouse_name: '',
+ location_name: ''
+ },
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ })
+})
+
+const method = reactive({
+ // Open a dialog to add
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ // job_type: AdjustJobType.TAKE,
+ job_code: '',
+ sku_id: 0,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ qty: 0,
+ is_update_stock: false,
+ source_table_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ warehouse_name: '',
+ location_name: ''
+ }
+ nextTick(() => {
+ data.showDialog = true
+ })
+ },
+
+ // After add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+
+ // Refresh data
+ refresh: () => {
+ method.getStockProcessList()
+ },
+
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+
+ getStockProcessList: async () => {
+ const { data: res } = await getStockAdjustList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+
+ viewRow: async (row: WarehouseAdjustVO) => {
+ await method.getOne(row.id)
+ nextTick(() => {
+ data.showDialog = true
+ })
+ },
+
+ getOne: async (id: number) => {
+ const { data: res } = await getStockAdjustOne(id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+
+ data.dialogForm = res.data
+ },
+
+ deleteRow(row: WarehouseAdjustVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteStockAdjust(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+ method.refresh()
+ }),
+
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.warehouseAdjust'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.refresh()
+ },
+
+ // The btn will become disabled when the 'process_status' is false
+ // confirmAdjustBtnDisabled: (row: WarehouseAdjustVO) => row.is_update_stock === true,
+
+ confirmAdjust: async (row: WarehouseAdjustVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('wms.warehouseWorking.warehouseAdjust.beforeConfirmAdjust'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await confirmStockAdjust(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('wms.warehouseWorking.warehouseAdjust.confirmAdjust') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ }
+})
+
+onActivated(() => {
+ method.refresh()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/warehouseWorking/warehouseFreeze/add-or-update-freeze.vue b/frontend/src/view/warehouseWorking/warehouseFreeze/add-or-update-freeze.vue
index 89c4060..2024018 100644
--- a/frontend/src/view/warehouseWorking/warehouseFreeze/add-or-update-freeze.vue
+++ b/frontend/src/view/warehouseWorking/warehouseFreeze/add-or-update-freeze.vue
@@ -1,237 +1,237 @@
-<!-- Warehouse Freeze Operate Dialog -->
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar class="" color="white" :title="`${$t('router.sideBar.warehouseFreeze')}(${jobTypeComp})`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.spu_code"
- :label="$t('base.commodityManagement.spu_code')"
- :rules="data.rules.spu_code"
- variant="outlined"
- readonly
- clearable
- @click="method.openCommoditySelect"
- @click:clear="method.clearCommodity"
- ></v-text-field>
- <v-text-field
- v-model="data.form.spu_name"
- :label="$t('base.commodityManagement.spu_name')"
- :rules="data.rules.spu_name"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.sku_code"
- :label="$t('base.commodityManagement.sku_code')"
- :rules="data.rules.sku_code"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.location_name"
- :label="$t('wms.warehouseWorking.warehouseFreeze.location_name')"
- :rules="data.rules.location_name"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.warehouse_name"
- :label="$t('wms.warehouseWorking.warehouseFreeze.warehouse')"
- :rules="data.rules.warehouse_name"
- variant="outlined"
- disabled
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" :disabled="operateDisabled" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-
- <commodity-select
- :show-dialog="data.showCommodityDialogSelect"
- :sql-title="commoditySqlTitle"
- @close="method.closeCommodityDialogSelect"
- @sureSelect="method.sureSelectCommodity"
- />
- <!-- <location-select :show-dialog="data.showLocationDialogSelect" @close="method.closeLocationDialogSelect" @sureSelect="method.sureSelectLocation" /> -->
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { FREEZE_JOB_FREEZE, FREEZE_JOB_UNFREEZE } from '@/constant/warehouseWorking'
-import { hookComponent } from '@/components/system/index'
-import { addStockFreeze } from '@/api/wms/warehouseFreeze'
-import { WarehouseFreezeVO } from '@/types/WarehouseWorking/WarehouseFreeze'
-import { removeObjectNull } from '@/utils/common'
-import commoditySelect from '@/components/select/commodity-select.vue'
-import i18n from '@/languages/i18n'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-const isUpdate = computed(() => props.form.id && props.form.id > 0)
-const operateDisabled = computed(() => !!isUpdate.value)
-
-const props = defineProps<{
- showDialog: boolean
- form: WarehouseFreezeVO
- freezeType: boolean
-}>()
-
-const isShow = computed(() => props.showDialog)
-const jobTypeComp = computed(() => (data.form.job_type === FREEZE_JOB_FREEZE
- ? i18n.global.t('wms.warehouseWorking.warehouseFreeze.freeze')
- : i18n.global.t('wms.warehouseWorking.warehouseFreeze.unfreeze')))
-
-// Unfreeze should be filter freezed.
-const commoditySqlTitle = computed(() => (data.form.job_type === FREEZE_JOB_UNFREEZE ? 'frozen' : ''))
-
-const data = reactive({
- showCommodityDialogSelect: false,
- showLocationDialogSelect: false,
-
- form: ref<WarehouseFreezeVO>({
- id: 0,
- job_code: '',
- job_type: FREEZE_JOB_FREEZE,
- sku_id: 0,
- goods_owner_id: 0,
- goods_location_id: 0,
- handler: '',
- handle_time: '',
- last_update_time: '',
- tenant_id: 0,
- warehouse_name: '',
- location_name: '',
- spu_code: '',
- spu_name: '',
- sku_code: '',
- creator: '',
- create_time: ''
- }),
- rules: {
- warehouse_name: [],
- location_name: [],
- spu_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_code') }!`],
- spu_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_name') }!`],
- sku_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_code') }!`]
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- initForm: () => {
- data.form = props.form
- data.form.job_type = props.freezeType
- },
-
- openCommoditySelect: () => {
- // Open select modal after UI rendered.
- setTimeout(() => {
- data.showCommodityDialogSelect = true
- }, 100)
- },
-
- closeCommodityDialogSelect: () => {
- data.showCommodityDialogSelect = false
- },
-
- openLocationSelect: () => {
- setTimeout(() => {
- data.showLocationDialogSelect = true
- }, 100)
- },
-
- closeLocationDialogSelect: () => {
- data.showLocationDialogSelect = false
- },
-
- sureSelectCommodity: (selectRecords: any) => {
- try {
- data.form.sku_id = selectRecords[0].sku_id
- data.form.spu_code = selectRecords[0].spu_code
- data.form.spu_name = selectRecords[0].spu_name
- data.form.sku_code = selectRecords[0].sku_code
-
- data.form.goods_owner_id = selectRecords[0].goods_owner_id
- data.form.goods_location_id = selectRecords[0].goods_location_id
- data.form.warehouse_name = selectRecords[0].warehouse_name
- data.form.location_name = selectRecords[0].location_name
- } catch (error) {
- console.error(error)
- }
- },
-
- clearCommodity: () => {
- data.form.sku_id = 0
- data.form.spu_code = ''
- data.form.spu_name = ''
- data.form.sku_code = ''
- },
-
- clearLocation: () => {
- data.form.goods_location_id = 0
- data.form.warehouse_name = ''
- data.form.location_name = ''
- },
-
- submit: async () => {
- const { valid } = await formRef.value.validate()
-
- const form = method.constructFormBody()
-
- if (valid) {
- const { data: res } = await addStockFreeze(form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- },
-
- constructFormBody: () => {
- let form = { ...data.form }
- form = removeObjectNull(form)
-
- return form
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- Warehouse Freeze Operate Dialog -->
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar class="" color="white" :title="`${$t('router.sideBar.warehouseFreeze')}(${jobTypeComp})`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.spu_code"
+ :label="$t('base.commodityManagement.spu_code')"
+ :rules="data.rules.spu_code"
+ variant="outlined"
+ readonly
+ clearable
+ @click="method.openCommoditySelect"
+ @click:clear="method.clearCommodity"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.spu_name"
+ :label="$t('base.commodityManagement.spu_name')"
+ :rules="data.rules.spu_name"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.sku_code"
+ :label="$t('base.commodityManagement.sku_code')"
+ :rules="data.rules.sku_code"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.location_name"
+ :label="$t('wms.warehouseWorking.warehouseFreeze.location_name')"
+ :rules="data.rules.location_name"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.warehouse_name"
+ :label="$t('wms.warehouseWorking.warehouseFreeze.warehouse')"
+ :rules="data.rules.warehouse_name"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" :disabled="operateDisabled" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+
+ <commodity-select
+ :show-dialog="data.showCommodityDialogSelect"
+ :sql-title="commoditySqlTitle"
+ @close="method.closeCommodityDialogSelect"
+ @sureSelect="method.sureSelectCommodity"
+ />
+ <!-- <location-select :show-dialog="data.showLocationDialogSelect" @close="method.closeLocationDialogSelect" @sureSelect="method.sureSelectLocation" /> -->
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { FREEZE_JOB_FREEZE, FREEZE_JOB_UNFREEZE } from '@/constant/warehouseWorking'
+import { hookComponent } from '@/components/system/index'
+import { addStockFreeze } from '@/api/wms/warehouseFreeze'
+import { WarehouseFreezeVO } from '@/types/WarehouseWorking/WarehouseFreeze'
+import { removeObjectNull } from '@/utils/common'
+import commoditySelect from '@/components/select/commodity-select.vue'
+import i18n from '@/languages/i18n'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+const isUpdate = computed(() => props.form.id && props.form.id > 0)
+const operateDisabled = computed(() => !!isUpdate.value)
+
+const props = defineProps<{
+ showDialog: boolean
+ form: WarehouseFreezeVO
+ freezeType: boolean
+}>()
+
+const isShow = computed(() => props.showDialog)
+const jobTypeComp = computed(() => (data.form.job_type === FREEZE_JOB_FREEZE
+ ? i18n.global.t('wms.warehouseWorking.warehouseFreeze.freeze')
+ : i18n.global.t('wms.warehouseWorking.warehouseFreeze.unfreeze')))
+
+// Unfreeze should be filter freezed.
+const commoditySqlTitle = computed(() => (data.form.job_type === FREEZE_JOB_UNFREEZE ? 'frozen' : ''))
+
+const data = reactive({
+ showCommodityDialogSelect: false,
+ showLocationDialogSelect: false,
+
+ form: ref<WarehouseFreezeVO>({
+ id: 0,
+ job_code: '',
+ job_type: FREEZE_JOB_FREEZE,
+ sku_id: 0,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ handler: '',
+ handle_time: '',
+ last_update_time: '',
+ tenant_id: 0,
+ warehouse_name: '',
+ location_name: '',
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ creator: '',
+ create_time: ''
+ }),
+ rules: {
+ warehouse_name: [],
+ location_name: [],
+ spu_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_code') }!`],
+ spu_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_name') }!`],
+ sku_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_code') }!`]
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ initForm: () => {
+ data.form = props.form
+ data.form.job_type = props.freezeType
+ },
+
+ openCommoditySelect: () => {
+ // Open select modal after UI rendered.
+ setTimeout(() => {
+ data.showCommodityDialogSelect = true
+ }, 100)
+ },
+
+ closeCommodityDialogSelect: () => {
+ data.showCommodityDialogSelect = false
+ },
+
+ openLocationSelect: () => {
+ setTimeout(() => {
+ data.showLocationDialogSelect = true
+ }, 100)
+ },
+
+ closeLocationDialogSelect: () => {
+ data.showLocationDialogSelect = false
+ },
+
+ sureSelectCommodity: (selectRecords: any) => {
+ try {
+ data.form.sku_id = selectRecords[0].sku_id
+ data.form.spu_code = selectRecords[0].spu_code
+ data.form.spu_name = selectRecords[0].spu_name
+ data.form.sku_code = selectRecords[0].sku_code
+
+ data.form.goods_owner_id = selectRecords[0].goods_owner_id
+ data.form.goods_location_id = selectRecords[0].goods_location_id
+ data.form.warehouse_name = selectRecords[0].warehouse_name
+ data.form.location_name = selectRecords[0].location_name
+ } catch (error) {
+ console.error(error)
+ }
+ },
+
+ clearCommodity: () => {
+ data.form.sku_id = 0
+ data.form.spu_code = ''
+ data.form.spu_name = ''
+ data.form.sku_code = ''
+ },
+
+ clearLocation: () => {
+ data.form.goods_location_id = 0
+ data.form.warehouse_name = ''
+ data.form.location_name = ''
+ },
+
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+
+ const form = method.constructFormBody()
+
+ if (valid) {
+ const { data: res } = await addStockFreeze(form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ },
+
+ constructFormBody: () => {
+ let form = { ...data.form }
+ form = removeObjectNull(form)
+
+ return form
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/warehouseWorking/warehouseFreeze/warehouseFreeze.vue b/frontend/src/view/warehouseWorking/warehouseFreeze/warehouseFreeze.vue
index ccb6c28..5d24eb0 100644
--- a/frontend/src/view/warehouseWorking/warehouseFreeze/warehouseFreeze.vue
+++ b/frontend/src/view/warehouseWorking/warehouseFreeze/warehouseFreeze.vue
@@ -1,357 +1,357 @@
-<!-- Warehouse Freeze -->
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <v-window v-model="data.activeTab">
- <v-window-item>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn
- icon="mdi-lock-open-outline"
- :tooltip-text="$t('wms.warehouseWorking.warehouseFreeze.freeze')"
- @click="method.add(FREEZE_JOB_FREEZE)"
- ></tooltip-btn>
- <tooltip-btn
- icon="mdi-lock-open-variant-outline"
- :tooltip-text="$t('wms.warehouseWorking.warehouseFreeze.unfreeze')"
- @click="method.add(FREEZE_JOB_UNFREEZE)"
- ></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.job_code"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.warehouseWorking.warehouseFreeze.job_code')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="job_code" width="150px" :title="$t('wms.warehouseWorking.warehouseFreeze.job_code')"></vxe-column>
- <vxe-column field="job_type" width="150px" :title="$t('wms.warehouseWorking.warehouseFreeze.job_type')">
- <template #default="{ row, column }">
- <span>{{ formatFreezeJobType(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="warehouse_name" width="150px" :title="$t('wms.warehouseWorking.warehouseFreeze.warehouse')"></vxe-column>
- <vxe-column field="location_name" width="150px" :title="$t('wms.warehouseWorking.warehouseFreeze.location_name')"></vxe-column>
- <vxe-column field="spu_code" width="150px" :title="$t('base.commodityManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_name" width="150px" :title="$t('base.commodityManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" width="150px" :title="$t('base.commodityManagement.sku_code')"></vxe-column>
- <vxe-column field="handler" width="150px" :title="$t('wms.warehouseWorking.warehouseFreeze.handler')"></vxe-column>
- <vxe-column field="handle_time" width="170px" :title="$t('wms.warehouseWorking.warehouseFreeze.handle_time')">
- <template #default="{ row, column }">
- <span>{{ formatDate(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <!-- <vxe-column field="creator" :title="$t('wms.warehouseWorking.warehouseFreeze.creator')"></vxe-column>
- <vxe-column
- field="create_time"
- width="170px"
- :title="$t('wms.warehouseWorking.warehouseFreeze.create_time')"
- ></vxe-column> -->
- <vxe-column field="operate" :title="$t('system.page.operate')" width="100" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-eye-outline"
- :tooltip-text="$t('system.page.view')"
- @click="method.viewRow(row)"
- ></tooltip-btn>
- <!-- <tooltip-btn
- :flat="true"
- icon="mdi-book-open-outline"
- :tooltip-text="$t('wms.warehouseWorking.warehouseMove.confirmMove')"
- @click="method.confirmMove(row)"
- ></tooltip-btn> -->
- <!-- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn> -->
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- </v-window-item>
- </v-window>
- </v-card-text>
- </v-card>
- <addOrUpdateDialog
- :show-dialog="data.showDialog"
- :form="data.dialogForm"
- :freeze-type="data.freezeType"
- @close="method.closeDialog"
- @saveSuccess="method.saveSuccess"
- />
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, onActivated, watch, nextTick } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight } from '@/constant/style'
-import { WarehouseFreezeVO } from '@/types/WarehouseWorking/WarehouseFreeze'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { FREEZE_JOB_FREEZE, FREEZE_JOB_UNFREEZE } from '@/constant/warehouseWorking'
-import { hookComponent } from '@/components/system'
-import { formatFreezeJobType } from '@/utils/format/formatWarehouseWorking'
-import { getStockFreezeList, getStockFreezeOne } from '@/api/wms/warehouseFreeze'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { formatDate } from '@/utils/format/formatSystem'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import addOrUpdateDialog from './add-or-update-freeze.vue'
-import i18n from '@/languages/i18n'
-import customPager from '@/components/custom-pager.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-const data = reactive({
- showDialog: false,
- freezeType: FREEZE_JOB_FREEZE,
- timer: ref<any>(null),
- activeTab: null,
- searchForm: {
- job_code: ''
- },
- tableData: ref<WarehouseFreezeVO[]>([]),
- dialogForm: {
- id: 0,
- job_code: '',
- job_type: FREEZE_JOB_FREEZE,
- sku_id: 0,
- goods_owner_id: 0,
- goods_location_id: 0,
- handler: '',
- handle_time: '',
- last_update_time: '',
- tenant_id: 0,
- warehouse_name: '',
- location_name: '',
- spu_code: '',
- spu_name: '',
- sku_code: '',
- creator: '',
- create_time: ''
- },
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- })
-})
-
-const method = reactive({
- // Open a dialog to add
- add: (jobType: boolean) => {
- data.freezeType = jobType
- data.dialogForm = {
- id: 0,
- job_code: '',
- job_type: FREEZE_JOB_FREEZE,
- sku_id: 0,
- goods_owner_id: 0,
- goods_location_id: 0,
- handler: '',
- handle_time: '',
- last_update_time: '',
- tenant_id: 0,
- warehouse_name: '',
- location_name: '',
- spu_code: '',
- spu_name: '',
- sku_code: '',
- creator: '',
- create_time: ''
- }
- nextTick(() => {
- data.showDialog = true
- })
- },
-
- // After add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
-
- // Refresh data
- refresh: () => {
- method.getStockProcessList()
- },
-
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
-
- getStockProcessList: async () => {
- const { data: res } = await getStockFreezeList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
-
- viewRow: async (row: WarehouseFreezeVO) => {
- await method.getOne(row.id)
- nextTick(() => {
- data.showDialog = true
- })
- },
-
- getOne: async (id: number) => {
- const { data: res } = await getStockFreezeOne(id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
-
- data.dialogForm = res.data
- },
-
- // deleteRow(row: WarehouseFreezeVO) {
- // hookComponent.$dialog({
- // content: i18n.global.t('system.tips.beforeDeleteMessage'),
- // handleConfirm: async () => {
- // if (row.id) {
- // const { data: res } = await deleteStockFreeze(row.id)
- // if (!res.isSuccess) {
- // hookComponent.$message({
- // type: 'error',
- // content: res.errorMessage
- // })
- // return
- // }
-
- // hookComponent.$message({
- // type: 'success',
- // content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- // })
- // method.refresh()
- // }
- // }
- // })
- // },
-
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
- method.refresh()
- }),
-
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.warehouseFreeze'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
-
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.refresh()
- }
-})
-
-onActivated(() => {
- method.refresh()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<!-- Warehouse Freeze -->
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <v-window v-model="data.activeTab">
+ <v-window-item>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn
+ icon="mdi-lock-open-outline"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseFreeze.freeze')"
+ @click="method.add(FREEZE_JOB_FREEZE)"
+ ></tooltip-btn>
+ <tooltip-btn
+ icon="mdi-lock-open-variant-outline"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseFreeze.unfreeze')"
+ @click="method.add(FREEZE_JOB_UNFREEZE)"
+ ></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.job_code"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.warehouseWorking.warehouseFreeze.job_code')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="job_code" width="150px" :title="$t('wms.warehouseWorking.warehouseFreeze.job_code')"></vxe-column>
+ <vxe-column field="job_type" width="150px" :title="$t('wms.warehouseWorking.warehouseFreeze.job_type')">
+ <template #default="{ row, column }">
+ <span>{{ formatFreezeJobType(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="warehouse_name" width="150px" :title="$t('wms.warehouseWorking.warehouseFreeze.warehouse')"></vxe-column>
+ <vxe-column field="location_name" width="150px" :title="$t('wms.warehouseWorking.warehouseFreeze.location_name')"></vxe-column>
+ <vxe-column field="spu_code" width="150px" :title="$t('base.commodityManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" width="150px" :title="$t('base.commodityManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" width="150px" :title="$t('base.commodityManagement.sku_code')"></vxe-column>
+ <vxe-column field="handler" width="150px" :title="$t('wms.warehouseWorking.warehouseFreeze.handler')"></vxe-column>
+ <vxe-column field="handle_time" width="170px" :title="$t('wms.warehouseWorking.warehouseFreeze.handle_time')">
+ <template #default="{ row, column }">
+ <span>{{ formatDate(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <!-- <vxe-column field="creator" :title="$t('wms.warehouseWorking.warehouseFreeze.creator')"></vxe-column>
+ <vxe-column
+ field="create_time"
+ width="170px"
+ :title="$t('wms.warehouseWorking.warehouseFreeze.create_time')"
+ ></vxe-column> -->
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="100" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-eye-outline"
+ :tooltip-text="$t('system.page.view')"
+ @click="method.viewRow(row)"
+ ></tooltip-btn>
+ <!-- <tooltip-btn
+ :flat="true"
+ icon="mdi-book-open-outline"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseMove.confirmMove')"
+ @click="method.confirmMove(row)"
+ ></tooltip-btn> -->
+ <!-- <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn> -->
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ </v-window-item>
+ </v-window>
+ </v-card-text>
+ </v-card>
+ <addOrUpdateDialog
+ :show-dialog="data.showDialog"
+ :form="data.dialogForm"
+ :freeze-type="data.freezeType"
+ @close="method.closeDialog"
+ @saveSuccess="method.saveSuccess"
+ />
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, onActivated, watch, nextTick } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight } from '@/constant/style'
+import { WarehouseFreezeVO } from '@/types/WarehouseWorking/WarehouseFreeze'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { FREEZE_JOB_FREEZE, FREEZE_JOB_UNFREEZE } from '@/constant/warehouseWorking'
+import { hookComponent } from '@/components/system'
+import { formatFreezeJobType } from '@/utils/format/formatWarehouseWorking'
+import { getStockFreezeList, getStockFreezeOne } from '@/api/wms/warehouseFreeze'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { formatDate } from '@/utils/format/formatSystem'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import addOrUpdateDialog from './add-or-update-freeze.vue'
+import i18n from '@/languages/i18n'
+import customPager from '@/components/custom-pager.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+const data = reactive({
+ showDialog: false,
+ freezeType: FREEZE_JOB_FREEZE,
+ timer: ref<any>(null),
+ activeTab: null,
+ searchForm: {
+ job_code: ''
+ },
+ tableData: ref<WarehouseFreezeVO[]>([]),
+ dialogForm: {
+ id: 0,
+ job_code: '',
+ job_type: FREEZE_JOB_FREEZE,
+ sku_id: 0,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ handler: '',
+ handle_time: '',
+ last_update_time: '',
+ tenant_id: 0,
+ warehouse_name: '',
+ location_name: '',
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ creator: '',
+ create_time: ''
+ },
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ })
+})
+
+const method = reactive({
+ // Open a dialog to add
+ add: (jobType: boolean) => {
+ data.freezeType = jobType
+ data.dialogForm = {
+ id: 0,
+ job_code: '',
+ job_type: FREEZE_JOB_FREEZE,
+ sku_id: 0,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ handler: '',
+ handle_time: '',
+ last_update_time: '',
+ tenant_id: 0,
+ warehouse_name: '',
+ location_name: '',
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ creator: '',
+ create_time: ''
+ }
+ nextTick(() => {
+ data.showDialog = true
+ })
+ },
+
+ // After add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+
+ // Refresh data
+ refresh: () => {
+ method.getStockProcessList()
+ },
+
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+
+ getStockProcessList: async () => {
+ const { data: res } = await getStockFreezeList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+
+ viewRow: async (row: WarehouseFreezeVO) => {
+ await method.getOne(row.id)
+ nextTick(() => {
+ data.showDialog = true
+ })
+ },
+
+ getOne: async (id: number) => {
+ const { data: res } = await getStockFreezeOne(id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+
+ data.dialogForm = res.data
+ },
+
+ // deleteRow(row: WarehouseFreezeVO) {
+ // hookComponent.$dialog({
+ // content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ // handleConfirm: async () => {
+ // if (row.id) {
+ // const { data: res } = await deleteStockFreeze(row.id)
+ // if (!res.isSuccess) {
+ // hookComponent.$message({
+ // type: 'error',
+ // content: res.errorMessage
+ // })
+ // return
+ // }
+
+ // hookComponent.$message({
+ // type: 'success',
+ // content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ // })
+ // method.refresh()
+ // }
+ // }
+ // })
+ // },
+
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+ method.refresh()
+ }),
+
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.warehouseFreeze'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.refresh()
+ }
+})
+
+onActivated(() => {
+ method.refresh()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/warehouseWorking/warehouseMove/add-or-update-move.vue b/frontend/src/view/warehouseWorking/warehouseMove/add-or-update-move.vue
index e861716..77786ec 100644
--- a/frontend/src/view/warehouseWorking/warehouseMove/add-or-update-move.vue
+++ b/frontend/src/view/warehouseWorking/warehouseMove/add-or-update-move.vue
@@ -1,311 +1,311 @@
-<!-- Warehouse Move Operate Dialog -->
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar class="" color="white" :title="`${$t('router.sideBar.warehouseMove')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.spu_code"
- :label="$t('base.commodityManagement.spu_code')"
- :rules="data.rules.spu_code"
- variant="outlined"
- readonly
- clearable
- @click="method.openCommoditySelect"
- @click:clear="method.clearCommodity"
- ></v-text-field>
- <v-text-field
- v-model="data.form.spu_name"
- :label="$t('base.commodityManagement.spu_name')"
- :rules="data.rules.spu_name"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.sku_code"
- :label="$t('base.commodityManagement.sku_code')"
- :rules="data.rules.sku_code"
- variant="outlined"
- disabled
- ></v-text-field>
- <!-- <v-text-field
- v-model="data.form.sku_name"
- :label="$t('base.commodityManagement.sku_name')"
- :rules="data.rules.sku_name"
- variant="outlined"
- disabled
- ></v-text-field> -->
- <v-text-field
- v-model="data.form.orig_goods_warehouse"
- :label="$t('wms.warehouseWorking.warehouseMove.orig_goods_warehouse')"
- :rules="data.rules.orig_goods_warehouse"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.orig_goods_location_name"
- :label="$t('wms.warehouseWorking.warehouseMove.orig_goods_location_name')"
- :rules="data.rules.orig_goods_location_name"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.dest_googs_warehouse"
- :label="$t('wms.warehouseWorking.warehouseMove.dest_googs_warehouse')"
- :rules="data.rules.dest_googs_warehouse"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.dest_googs_location_name"
- :label="$t('wms.warehouseWorking.warehouseMove.dest_googs_location_name')"
- :rules="data.rules.dest_googs_location_name"
- variant="outlined"
- readonly
- clearable
- @click="method.openLocationSelect"
- @click:clear="method.clearLocation"
- ></v-text-field>
- <v-text-field
- v-model="data.form.qty"
- :label="$t('wms.warehouseWorking.warehouseMove.qty')"
- :rules="data.rules.qty"
- variant="outlined"
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" :disabled="operateDisabled" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-
- <commodity-select
- :show-dialog="data.showCommodityDialogSelect"
- @close="method.closeCommodityDialogSelect"
- @sureSelect="method.sureSelectCommodity"
- />
- <location-select :show-dialog="data.showLocationDialogSelect" @close="method.closeLocationDialogSelect" @sureSelect="method.sureSelectLocation" />
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addStockMove } from '@/api/wms/warehouseMove'
-import { WarehouseMoveVO, MoveStatus } from '@/types/WarehouseWorking/WarehouseMove'
-import { removeObjectNull } from '@/utils/common'
-import commoditySelect from '@/components/select/commodity-select.vue'
-import locationSelect from '@/components/select/location-select.vue'
-import { IsInteger } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-const isUpdate = computed(() => props.form.id && props.form.id > 0)
-const operateDisabled = computed(() => !!isUpdate.value)
-
-const props = defineProps<{
- showDialog: boolean
- form: WarehouseMoveVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- showCommodityDialogSelect: false,
- showLocationDialogSelect: false,
-
- // Available Qty
- curAvailableQty: 0,
-
- form: ref<WarehouseMoveVO>({
- id: 0,
- job_code: '',
- move_status: MoveStatus.UNADJUST,
- sku_id: 0,
- orig_goods_location_id: 0,
- dest_googs_location_id: 0,
- qty: 0,
- goods_owner_id: 0,
- handler: '',
- handle_time: '',
- orig_goods_warehouse: '',
- orig_goods_location_name: '',
- dest_googs_warehouse: '',
- dest_googs_location_name: '',
- spu_code: '',
- spu_name: '',
- sku_code: '',
- sku_name: '',
- creator: '',
- create_time: ''
- }),
- rules: {
- qty: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseMove.qty') }!`,
- (val: number) => IsInteger(val, 'greaterThanZero') === '' || IsInteger(val, 'greaterThanZero'),
- (val: string) => method.validQty(val)
- ],
- orig_goods_warehouse: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseMove.orig_goods_warehouse') }!`
- ],
- orig_goods_location_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseMove.orig_goods_location_name') }!`
- ],
- dest_googs_warehouse: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseMove.dest_googs_warehouse') }!`
- ],
- dest_googs_location_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseMove.dest_googs_location_name') }!`
- ],
- spu_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_code') }!`],
- spu_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_name') }!`],
- sku_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_code') }!`],
- sku_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_name') }!`]
- }
-})
-
-const method = reactive({
- // The 'qty' can't more than 'qty_available'
- validQty: (value: string): boolean | string => {
- let inputQty = Number(value)
- if (Number.isNaN(inputQty)) {
- inputQty = 0
- }
-
- if (inputQty > data.curAvailableQty) {
- return `${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.qtyMoreThanAvailable') }${ data.curAvailableQty }`
- }
- return true
- },
- closeDialog: () => {
- emit('close')
- },
- initForm: () => {
- data.form = props.form
- },
-
- openCommoditySelect: () => {
- // Open select modal after UI rendered.
- setTimeout(() => {
- data.showCommodityDialogSelect = true
- }, 100)
- },
-
- closeCommodityDialogSelect: () => {
- data.showCommodityDialogSelect = false
- },
-
- openLocationSelect: () => {
- setTimeout(() => {
- data.showLocationDialogSelect = true
- }, 100)
- },
-
- closeLocationDialogSelect: () => {
- data.showLocationDialogSelect = false
- },
-
- sureSelectCommodity: (selectRecords: any) => {
- try {
- data.form.sku_id = selectRecords[0].sku_id
- data.form.orig_goods_location_id = selectRecords[0].goods_location_id
- data.form.orig_goods_warehouse = selectRecords[0].warehouse_name
- data.form.orig_goods_location_name = selectRecords[0].location_name
- data.form.goods_owner_id = selectRecords[0].goods_owner_id
- data.form.spu_code = selectRecords[0].spu_code
- data.form.spu_name = selectRecords[0].spu_name
- data.form.sku_code = selectRecords[0].sku_code
- data.form.sku_name = selectRecords[0].sku_name
-
- data.curAvailableQty = selectRecords[0].qty_available
- } catch (error) {
- console.error(error)
- }
- },
-
- sureSelectLocation: (selectRecords: any) => {
- try {
- data.form.dest_googs_location_id = selectRecords[0].id
- data.form.dest_googs_warehouse = selectRecords[0].warehouse_name
- data.form.dest_googs_location_name = selectRecords[0].location_name
- } catch (error) {
- console.error(error)
- }
- },
-
- clearCommodity: () => {
- data.form.sku_id = 0
- data.form.orig_goods_location_id = 0
- data.form.orig_goods_warehouse = ''
- data.form.orig_goods_location_name = ''
- data.form.spu_code = ''
- data.form.spu_name = ''
- data.form.sku_code = ''
- data.form.sku_name = ''
-
- data.curAvailableQty = 0
- },
-
- clearLocation: () => {
- data.form.dest_googs_location_id = 0
- data.form.dest_googs_warehouse = ''
- data.form.dest_googs_location_name = ''
- },
-
- submit: async () => {
- const { valid } = await formRef.value.validate()
-
- const form = method.constructFormBody()
-
- if (valid) {
- const { data: res } = await addStockMove(form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- },
-
- constructFormBody: () => {
- let form = { ...data.form }
- form = removeObjectNull(form)
-
- return form
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- Warehouse Move Operate Dialog -->
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar class="" color="white" :title="`${$t('router.sideBar.warehouseMove')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.spu_code"
+ :label="$t('base.commodityManagement.spu_code')"
+ :rules="data.rules.spu_code"
+ variant="outlined"
+ readonly
+ clearable
+ @click="method.openCommoditySelect"
+ @click:clear="method.clearCommodity"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.spu_name"
+ :label="$t('base.commodityManagement.spu_name')"
+ :rules="data.rules.spu_name"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.sku_code"
+ :label="$t('base.commodityManagement.sku_code')"
+ :rules="data.rules.sku_code"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <!-- <v-text-field
+ v-model="data.form.sku_name"
+ :label="$t('base.commodityManagement.sku_name')"
+ :rules="data.rules.sku_name"
+ variant="outlined"
+ disabled
+ ></v-text-field> -->
+ <v-text-field
+ v-model="data.form.orig_goods_warehouse"
+ :label="$t('wms.warehouseWorking.warehouseMove.orig_goods_warehouse')"
+ :rules="data.rules.orig_goods_warehouse"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.orig_goods_location_name"
+ :label="$t('wms.warehouseWorking.warehouseMove.orig_goods_location_name')"
+ :rules="data.rules.orig_goods_location_name"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.dest_googs_warehouse"
+ :label="$t('wms.warehouseWorking.warehouseMove.dest_googs_warehouse')"
+ :rules="data.rules.dest_googs_warehouse"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.dest_googs_location_name"
+ :label="$t('wms.warehouseWorking.warehouseMove.dest_googs_location_name')"
+ :rules="data.rules.dest_googs_location_name"
+ variant="outlined"
+ readonly
+ clearable
+ @click="method.openLocationSelect"
+ @click:clear="method.clearLocation"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.qty"
+ :label="$t('wms.warehouseWorking.warehouseMove.qty')"
+ :rules="data.rules.qty"
+ variant="outlined"
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" :disabled="operateDisabled" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+
+ <commodity-select
+ :show-dialog="data.showCommodityDialogSelect"
+ @close="method.closeCommodityDialogSelect"
+ @sureSelect="method.sureSelectCommodity"
+ />
+ <location-select :show-dialog="data.showLocationDialogSelect" @close="method.closeLocationDialogSelect" @sureSelect="method.sureSelectLocation" />
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addStockMove } from '@/api/wms/warehouseMove'
+import { WarehouseMoveVO, MoveStatus } from '@/types/WarehouseWorking/WarehouseMove'
+import { removeObjectNull } from '@/utils/common'
+import commoditySelect from '@/components/select/commodity-select.vue'
+import locationSelect from '@/components/select/location-select.vue'
+import { IsInteger } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+const isUpdate = computed(() => props.form.id && props.form.id > 0)
+const operateDisabled = computed(() => !!isUpdate.value)
+
+const props = defineProps<{
+ showDialog: boolean
+ form: WarehouseMoveVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ showCommodityDialogSelect: false,
+ showLocationDialogSelect: false,
+
+ // Available Qty
+ curAvailableQty: 0,
+
+ form: ref<WarehouseMoveVO>({
+ id: 0,
+ job_code: '',
+ move_status: MoveStatus.UNADJUST,
+ sku_id: 0,
+ orig_goods_location_id: 0,
+ dest_googs_location_id: 0,
+ qty: 0,
+ goods_owner_id: 0,
+ handler: '',
+ handle_time: '',
+ orig_goods_warehouse: '',
+ orig_goods_location_name: '',
+ dest_googs_warehouse: '',
+ dest_googs_location_name: '',
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ sku_name: '',
+ creator: '',
+ create_time: ''
+ }),
+ rules: {
+ qty: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseMove.qty') }!`,
+ (val: number) => IsInteger(val, 'greaterThanZero') === '' || IsInteger(val, 'greaterThanZero'),
+ (val: string) => method.validQty(val)
+ ],
+ orig_goods_warehouse: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseMove.orig_goods_warehouse') }!`
+ ],
+ orig_goods_location_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseMove.orig_goods_location_name') }!`
+ ],
+ dest_googs_warehouse: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseMove.dest_googs_warehouse') }!`
+ ],
+ dest_googs_location_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseMove.dest_googs_location_name') }!`
+ ],
+ spu_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_code') }!`],
+ spu_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_name') }!`],
+ sku_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_code') }!`],
+ sku_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_name') }!`]
+ }
+})
+
+const method = reactive({
+ // The 'qty' can't more than 'qty_available'
+ validQty: (value: string): boolean | string => {
+ let inputQty = Number(value)
+ if (Number.isNaN(inputQty)) {
+ inputQty = 0
+ }
+
+ if (inputQty > data.curAvailableQty) {
+ return `${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.qtyMoreThanAvailable') }${ data.curAvailableQty }`
+ }
+ return true
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ initForm: () => {
+ data.form = props.form
+ },
+
+ openCommoditySelect: () => {
+ // Open select modal after UI rendered.
+ setTimeout(() => {
+ data.showCommodityDialogSelect = true
+ }, 100)
+ },
+
+ closeCommodityDialogSelect: () => {
+ data.showCommodityDialogSelect = false
+ },
+
+ openLocationSelect: () => {
+ setTimeout(() => {
+ data.showLocationDialogSelect = true
+ }, 100)
+ },
+
+ closeLocationDialogSelect: () => {
+ data.showLocationDialogSelect = false
+ },
+
+ sureSelectCommodity: (selectRecords: any) => {
+ try {
+ data.form.sku_id = selectRecords[0].sku_id
+ data.form.orig_goods_location_id = selectRecords[0].goods_location_id
+ data.form.orig_goods_warehouse = selectRecords[0].warehouse_name
+ data.form.orig_goods_location_name = selectRecords[0].location_name
+ data.form.goods_owner_id = selectRecords[0].goods_owner_id
+ data.form.spu_code = selectRecords[0].spu_code
+ data.form.spu_name = selectRecords[0].spu_name
+ data.form.sku_code = selectRecords[0].sku_code
+ data.form.sku_name = selectRecords[0].sku_name
+
+ data.curAvailableQty = selectRecords[0].qty_available
+ } catch (error) {
+ console.error(error)
+ }
+ },
+
+ sureSelectLocation: (selectRecords: any) => {
+ try {
+ data.form.dest_googs_location_id = selectRecords[0].id
+ data.form.dest_googs_warehouse = selectRecords[0].warehouse_name
+ data.form.dest_googs_location_name = selectRecords[0].location_name
+ } catch (error) {
+ console.error(error)
+ }
+ },
+
+ clearCommodity: () => {
+ data.form.sku_id = 0
+ data.form.orig_goods_location_id = 0
+ data.form.orig_goods_warehouse = ''
+ data.form.orig_goods_location_name = ''
+ data.form.spu_code = ''
+ data.form.spu_name = ''
+ data.form.sku_code = ''
+ data.form.sku_name = ''
+
+ data.curAvailableQty = 0
+ },
+
+ clearLocation: () => {
+ data.form.dest_googs_location_id = 0
+ data.form.dest_googs_warehouse = ''
+ data.form.dest_googs_location_name = ''
+ },
+
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+
+ const form = method.constructFormBody()
+
+ if (valid) {
+ const { data: res } = await addStockMove(form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ },
+
+ constructFormBody: () => {
+ let form = { ...data.form }
+ form = removeObjectNull(form)
+
+ return form
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/warehouseWorking/warehouseMove/warehouseMove.vue b/frontend/src/view/warehouseWorking/warehouseMove/warehouseMove.vue
index e041a49..1660348 100644
--- a/frontend/src/view/warehouseWorking/warehouseMove/warehouseMove.vue
+++ b/frontend/src/view/warehouseWorking/warehouseMove/warehouseMove.vue
@@ -1,397 +1,397 @@
-<!-- Warehouse Move -->
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <v-window v-model="data.activeTab">
- <v-window-item>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.job_code"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.warehouseWorking.warehouseMove.job_code')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="job_code" width="150px" :title="$t('wms.warehouseWorking.warehouseMove.job_code')"></vxe-column>
- <vxe-column field="move_status" width="150px" :title="$t('wms.warehouseWorking.warehouseMove.move_status')">
- <template #default="{ row, column }">
- <span>{{ formatMoveStatus(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="spu_code" width="150px" :title="$t('base.commodityManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_name" width="150px" :title="$t('base.commodityManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" width="150px" :title="$t('base.commodityManagement.sku_code')"></vxe-column>
- <vxe-column field="sku_name" width="150px" :title="$t('base.commodityManagement.sku_name')"></vxe-column>
- <vxe-column field="qty" width="150px" :title="$t('wms.warehouseWorking.warehouseMove.qty')"></vxe-column>
- <vxe-column
- field="orig_goods_warehouse"
- width="150px"
- :title="$t('wms.warehouseWorking.warehouseMove.orig_goods_warehouse')"
- ></vxe-column>
- <vxe-column
- field="orig_goods_location_name"
- width="150px"
- :title="$t('wms.warehouseWorking.warehouseMove.orig_goods_location_name')"
- ></vxe-column>
- <vxe-column
- field="dest_googs_warehouse"
- width="150px"
- :title="$t('wms.warehouseWorking.warehouseMove.dest_googs_warehouse')"
- ></vxe-column>
- <vxe-column
- field="dest_googs_location_name"
- width="150px"
- :title="$t('wms.warehouseWorking.warehouseMove.dest_googs_location_name')"
- ></vxe-column>
- <vxe-column field="handler" width="150px" :title="$t('wms.warehouseWorking.warehouseMove.handler')"></vxe-column>
- <vxe-column field="handle_time" width="170px" :title="$t('wms.warehouseWorking.warehouseMove.handle_time')">
- <template #default="{ row, column }">
- <span>{{ formatDate(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="creator" :title="$t('wms.warehouseWorking.warehouseMove.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.warehouseWorking.warehouseMove.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="250" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-eye-outline"
- :tooltip-text="$t('system.page.view')"
- @click="method.viewRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-book-open-outline"
- :tooltip-text="$t('wms.warehouseWorking.warehouseMove.confirmMove')"
- :disabled="method.confirmMoveBtnDisabled(row)"
- @click="method.confirmMove(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- :disabled="method.confirmMoveBtnDisabled(row)"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- </v-window-item>
- </v-window>
- </v-card-text>
- </v-card>
- <addOrUpdateDialog
- :show-dialog="data.showDialog"
- :form="data.dialogForm"
- :process-type="data.processType"
- @close="method.closeDialog"
- @saveSuccess="method.saveSuccess"
- />
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, onActivated, watch, nextTick } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { WarehouseMoveVO, MoveStatus } from '@/types/WarehouseWorking/WarehouseMove'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { deleteStockMove, getStockMoveList, getStockMoveOne, confirmMove } from '@/api/wms/warehouseMove'
-import { PROCESS_JOB_COMBINE } from '@/constant/warehouseWorking'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { formatMoveStatus } from '@/utils/format/formatWarehouseWorking'
-import { formatDate } from '@/utils/format/formatSystem'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import addOrUpdateDialog from './add-or-update-move.vue'
-import i18n from '@/languages/i18n'
-import customPager from '@/components/custom-pager.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-const data = reactive({
- showDialog: false,
- processType: PROCESS_JOB_COMBINE,
- timer: ref<any>(null),
- activeTab: null,
- searchForm: {
- job_code: ''
- },
- tableData: ref<WarehouseMoveVO[]>([]),
- dialogForm: {
- id: 0,
- job_code: '',
- move_status: MoveStatus.UNADJUST,
- sku_id: 0,
- orig_goods_location_id: 0,
- dest_googs_location_id: 0,
- qty: 0,
- goods_owner_id: 0,
- handler: '',
- handle_time: '',
- orig_goods_warehouse: '',
- orig_goods_location_name: '',
- dest_googs_warehouse: '',
- dest_googs_location_name: '',
- spu_code: '',
- spu_name: '',
- sku_code: '',
- sku_name: '',
- creator: '',
- create_time: ''
- },
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- })
-})
-
-const method = reactive({
- // Open a dialog to add
- add: () => {
- data.dialogForm = {
- id: 0,
- job_code: '',
- move_status: MoveStatus.UNADJUST,
- sku_id: 0,
- orig_goods_location_id: 0,
- dest_googs_location_id: 0,
- qty: 0,
- goods_owner_id: 0,
- handler: '',
- handle_time: '',
- orig_goods_warehouse: '',
- orig_goods_location_name: '',
- dest_googs_warehouse: '',
- dest_googs_location_name: '',
- spu_code: '',
- spu_name: '',
- sku_code: '',
- sku_name: '',
- creator: '',
- create_time: ''
- }
- nextTick(() => {
- data.showDialog = true
- })
- },
-
- // After add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
-
- // Refresh data
- refresh: () => {
- method.getStockProcessList()
- },
-
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
-
- getStockProcessList: async () => {
- const { data: res } = await getStockMoveList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
-
- viewRow: async (row: WarehouseMoveVO) => {
- await method.getOne(row.id)
- nextTick(() => {
- data.showDialog = true
- })
- },
-
- getOne: async (id: number) => {
- const { data: res } = await getStockMoveOne(id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
-
- data.dialogForm = res.data
- },
-
- deleteRow(row: WarehouseMoveVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteStockMove(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
-
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
-
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
- method.refresh()
- }),
-
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.warehouseMove'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
-
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.refresh()
- },
-
- // The btn will become disabled when the 'process_status' is false
- confirmMoveBtnDisabled: (row: WarehouseMoveVO) => row.move_status === MoveStatus.ADJUSTED,
-
- confirmMove: async (row: WarehouseMoveVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('wms.warehouseWorking.warehouseMove.beforeConfirmMove'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await confirmMove(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('wms.warehouseWorking.warehouseMove.confirmMove') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- }
-})
-
-onActivated(() => {
- method.refresh()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<!-- Warehouse Move -->
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <v-window v-model="data.activeTab">
+ <v-window-item>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.job_code"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.warehouseWorking.warehouseMove.job_code')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="job_code" width="150px" :title="$t('wms.warehouseWorking.warehouseMove.job_code')"></vxe-column>
+ <vxe-column field="move_status" width="150px" :title="$t('wms.warehouseWorking.warehouseMove.move_status')">
+ <template #default="{ row, column }">
+ <span>{{ formatMoveStatus(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="spu_code" width="150px" :title="$t('base.commodityManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" width="150px" :title="$t('base.commodityManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" width="150px" :title="$t('base.commodityManagement.sku_code')"></vxe-column>
+ <vxe-column field="sku_name" width="150px" :title="$t('base.commodityManagement.sku_name')"></vxe-column>
+ <vxe-column field="qty" width="150px" :title="$t('wms.warehouseWorking.warehouseMove.qty')"></vxe-column>
+ <vxe-column
+ field="orig_goods_warehouse"
+ width="150px"
+ :title="$t('wms.warehouseWorking.warehouseMove.orig_goods_warehouse')"
+ ></vxe-column>
+ <vxe-column
+ field="orig_goods_location_name"
+ width="150px"
+ :title="$t('wms.warehouseWorking.warehouseMove.orig_goods_location_name')"
+ ></vxe-column>
+ <vxe-column
+ field="dest_googs_warehouse"
+ width="150px"
+ :title="$t('wms.warehouseWorking.warehouseMove.dest_googs_warehouse')"
+ ></vxe-column>
+ <vxe-column
+ field="dest_googs_location_name"
+ width="150px"
+ :title="$t('wms.warehouseWorking.warehouseMove.dest_googs_location_name')"
+ ></vxe-column>
+ <vxe-column field="handler" width="150px" :title="$t('wms.warehouseWorking.warehouseMove.handler')"></vxe-column>
+ <vxe-column field="handle_time" width="170px" :title="$t('wms.warehouseWorking.warehouseMove.handle_time')">
+ <template #default="{ row, column }">
+ <span>{{ formatDate(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="creator" :title="$t('wms.warehouseWorking.warehouseMove.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.warehouseWorking.warehouseMove.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="250" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-eye-outline"
+ :tooltip-text="$t('system.page.view')"
+ @click="method.viewRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-book-open-outline"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseMove.confirmMove')"
+ :disabled="method.confirmMoveBtnDisabled(row)"
+ @click="method.confirmMove(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ :disabled="method.confirmMoveBtnDisabled(row)"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ </v-window-item>
+ </v-window>
+ </v-card-text>
+ </v-card>
+ <addOrUpdateDialog
+ :show-dialog="data.showDialog"
+ :form="data.dialogForm"
+ :process-type="data.processType"
+ @close="method.closeDialog"
+ @saveSuccess="method.saveSuccess"
+ />
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, onActivated, watch, nextTick } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { WarehouseMoveVO, MoveStatus } from '@/types/WarehouseWorking/WarehouseMove'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { deleteStockMove, getStockMoveList, getStockMoveOne, confirmMove } from '@/api/wms/warehouseMove'
+import { PROCESS_JOB_COMBINE } from '@/constant/warehouseWorking'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { formatMoveStatus } from '@/utils/format/formatWarehouseWorking'
+import { formatDate } from '@/utils/format/formatSystem'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import addOrUpdateDialog from './add-or-update-move.vue'
+import i18n from '@/languages/i18n'
+import customPager from '@/components/custom-pager.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+const data = reactive({
+ showDialog: false,
+ processType: PROCESS_JOB_COMBINE,
+ timer: ref<any>(null),
+ activeTab: null,
+ searchForm: {
+ job_code: ''
+ },
+ tableData: ref<WarehouseMoveVO[]>([]),
+ dialogForm: {
+ id: 0,
+ job_code: '',
+ move_status: MoveStatus.UNADJUST,
+ sku_id: 0,
+ orig_goods_location_id: 0,
+ dest_googs_location_id: 0,
+ qty: 0,
+ goods_owner_id: 0,
+ handler: '',
+ handle_time: '',
+ orig_goods_warehouse: '',
+ orig_goods_location_name: '',
+ dest_googs_warehouse: '',
+ dest_googs_location_name: '',
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ sku_name: '',
+ creator: '',
+ create_time: ''
+ },
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ })
+})
+
+const method = reactive({
+ // Open a dialog to add
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ job_code: '',
+ move_status: MoveStatus.UNADJUST,
+ sku_id: 0,
+ orig_goods_location_id: 0,
+ dest_googs_location_id: 0,
+ qty: 0,
+ goods_owner_id: 0,
+ handler: '',
+ handle_time: '',
+ orig_goods_warehouse: '',
+ orig_goods_location_name: '',
+ dest_googs_warehouse: '',
+ dest_googs_location_name: '',
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ sku_name: '',
+ creator: '',
+ create_time: ''
+ }
+ nextTick(() => {
+ data.showDialog = true
+ })
+ },
+
+ // After add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+
+ // Refresh data
+ refresh: () => {
+ method.getStockProcessList()
+ },
+
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+
+ getStockProcessList: async () => {
+ const { data: res } = await getStockMoveList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+
+ viewRow: async (row: WarehouseMoveVO) => {
+ await method.getOne(row.id)
+ nextTick(() => {
+ data.showDialog = true
+ })
+ },
+
+ getOne: async (id: number) => {
+ const { data: res } = await getStockMoveOne(id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+
+ data.dialogForm = res.data
+ },
+
+ deleteRow(row: WarehouseMoveVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteStockMove(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+ method.refresh()
+ }),
+
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.warehouseMove'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.refresh()
+ },
+
+ // The btn will become disabled when the 'process_status' is false
+ confirmMoveBtnDisabled: (row: WarehouseMoveVO) => row.move_status === MoveStatus.ADJUSTED,
+
+ confirmMove: async (row: WarehouseMoveVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('wms.warehouseWorking.warehouseMove.beforeConfirmMove'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await confirmMove(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('wms.warehouseWorking.warehouseMove.confirmMove') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ }
+})
+
+onActivated(() => {
+ method.refresh()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/warehouseWorking/warehouseProcessing/add-or-update-process.vue b/frontend/src/view/warehouseWorking/warehouseProcessing/add-or-update-process.vue
index 734e47f..7f018ae 100644
--- a/frontend/src/view/warehouseWorking/warehouseProcessing/add-or-update-process.vue
+++ b/frontend/src/view/warehouseWorking/warehouseProcessing/add-or-update-process.vue
@@ -1,584 +1,584 @@
-<template>
- <v-dialog v-model="isShow" width="80%" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="jobTypeComp"></v-toolbar>
- <v-card-text>
- <v-row>
- <!-- Source Table -->
- <v-col cols="6">
- <div class="dataTable">
- <div class="toolbar">
- <div class="toolbarTitle">
- <p style="color: #999">{{ $t('wms.warehouseWorking.warehouseProcessing.source') }}</p>
- </div>
- <tooltip-btn
- icon="mdi-plus"
- :tooltip-text="$t('system.page.add')"
- size="x-small"
- :disabled="operateDisabled"
- @click="method.openSelect('source')"
- ></tooltip-btn>
- </div>
- <vxe-table
- ref="xTableSource"
- :column-config="{ minWidth: '100px' }"
- :data="data.form.source_detail_list"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- :edit-config="{ trigger: 'click', mode: 'cell' }"
- :edit-rules="data.validRulesSource"
- align="center"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="operate" width="50" :title="$t('system.page.operate')" :resizable="false">
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRowSource(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.warehouseWorking.warehouseProcessing.spu_code')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.warehouseWorking.warehouseProcessing.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.warehouseWorking.warehouseProcessing.sku_code')"></vxe-column>
- <vxe-column
- field="qty"
- :title="$t('wms.warehouseWorking.warehouseProcessing.qty')"
- :edit-render="{ autofocus: '.vxe-input--inner' }"
- >
- <template #edit="{ row }">
- <vxe-input v-model="row.qty" type="text"></vxe-input>
- </template>
- </vxe-column>
- <vxe-column field="unit" :title="$t('wms.warehouseWorking.warehouseProcessing.unit')"></vxe-column>
- </vxe-table>
- </div>
- </v-col>
-
- <!-- Target Table -->
- <v-col cols="6">
- <div class="dataTable">
- <div class="toolbar">
- <div class="toolbarTitle">
- <p style="color: #999">{{ $t('wms.warehouseWorking.warehouseProcessing.target') }}</p>
- </div>
- <tooltip-btn
- icon="mdi-plus"
- :tooltip-text="$t('system.page.add')"
- size="x-small"
- :disabled="operateDisabled"
- @click="method.openSelect('target')"
- ></tooltip-btn>
- </div>
- <vxe-table
- ref="xTableTarget"
- :column-config="{ minWidth: '100px' }"
- :data="data.form.target_detail_list"
- :height="SYSTEM_HEIGHT.SELECT_TABLE"
- :edit-config="{ trigger: 'click', mode: 'cell' }"
- :edit-rules="data.validRulesTarget"
- align="center"
- >
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column field="operate" width="50" :title="$t('system.page.operate')" :resizable="false">
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRowTarget(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.warehouseWorking.warehouseProcessing.spu_code')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.warehouseWorking.warehouseProcessing.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.warehouseWorking.warehouseProcessing.sku_code')"></vxe-column>
- <vxe-column
- field="qty"
- :title="$t('wms.warehouseWorking.warehouseProcessing.qty')"
- :edit-render="{ autofocus: '.vxe-input--inner' }"
- >
- <template #edit="{ row }">
- <vxe-input v-model="row.qty" type="text"></vxe-input>
- </template>
- </vxe-column>
- <vxe-column field="unit" width="60" :title="$t('wms.warehouseWorking.warehouseProcessing.unit')"></vxe-column>
- <vxe-column field="location_name" :title="$t('wms.warehouseWorking.warehouseProcessing.target_location')" :edit-render="{}">
- <template #edit="{ row }">
- <vxe-input v-model="row.location_name" readonly type="search" @search-click="method.openLocationSelect(row)"></vxe-input>
- </template>
- </vxe-column>
- </vxe-table>
- </div>
- </v-col>
- </v-row>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" :disabled="operateDisabled" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-
- <commodity-select :show-dialog="data.showCommodityDialogSelect" @close="method.closeDialogSelect('source')" @sureSelect="method.sureSelect" />
- <sku-select :show-dialog="data.showSkuDialogSelect" @close="method.closeDialogSelect('target')" @sureSelect="method.sureSelect" />
- <location-select :show-dialog="data.showLocationDialogSelect" @close="method.closeLocationDialogSelect" @sureSelect="method.sureSelectLocation" />
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { VxeTablePropTypes } from 'vxe-table'
-import { WarehouseProcessingVO, WarehouseProcessingDetailVO } from '@/types/WarehouseWorking/WarehouseProcessing'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addStockProcess } from '@/api/wms/warehouseProcessing'
-import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
-import { removeObjectNull } from '@/utils/common'
-import { PROCESS_JOB_COMBINE, PROCESS_JOB_SPLIT } from '@/constant/warehouseWorking'
-import commoditySelect from '@/components/select/commodity-select.vue'
-import locationSelect from '@/components/select/location-select.vue'
-import skuSelect from '@/components/select/sku-select.vue'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import { exportData } from '@/utils/exportTable'
-import { isInteger } from '@/utils/dataVerification/tableRule'
-
-const emit = defineEmits(['close', 'saveSuccess'])
-const xTableSource = ref()
-const xTableTarget = ref()
-
-const props = defineProps<{
- showDialog: boolean
- form: WarehouseProcessingVO
- processType: boolean
-}>()
-
-const isShow = computed(() => props.showDialog)
-const isUpdate = computed(() => props.form.id && props.form.id > 0)
-const jobTypeComp = computed(() => (data.form.job_type === PROCESS_JOB_COMBINE
- ? i18n.global.t('wms.warehouseWorking.warehouseProcessing.process_combine')
- : i18n.global.t('wms.warehouseWorking.warehouseProcessing.process_split')))
-const operateDisabled = computed(() => !!isUpdate.value)
-
-const method = reactive({
- initForm: () => {
- data.form = props.form
- data.form.job_type = props.processType
- },
-
- closeDialog: () => {
- emit('close')
- },
-
- openSelect: (type: string) => {
- data.curSelectType = type
-
- if (type === 'source') {
- data.showCommodityDialogSelect = true
- } else if (type === 'target') {
- // Target should select the data with 'sku-select-modal'
- data.showSkuDialogSelect = true
- }
- },
-
- closeDialogSelect: (type: string) => {
- if (type === 'source') {
- data.showCommodityDialogSelect = false
- } else if (type === 'target') {
- // Target should select the data with 'sku-select-modal'
- data.showSkuDialogSelect = false
- }
- },
-
- sureSelect: (selectRecords: any) => {
- if (data.curSelectType === 'source') {
- method.insertSourceData(selectRecords)
- } else if (data.curSelectType === 'target') {
- method.insertTargetData(selectRecords)
- }
- },
-
- openLocationSelect: (row: WarehouseProcessingDetailVO) => {
- data.curSelectRow = row
- data.showLocationDialogSelect = true
- },
-
- closeLocationDialogSelect: () => {
- data.showLocationDialogSelect = false
- },
-
- sureSelectLocation: (selectRecords: any) => {
- if (selectRecords.length > 0) {
- const $table = xTableTarget.value
- const tableData = $table.getTableData().fullData
- tableData.forEach((row: WarehouseProcessingDetailVO) => {
- if (data.curSelectRow.sku_id === row.sku_id) {
- row.goods_location_id = selectRecords[0].id
- row.location_name = selectRecords[0].location_name
- }
- })
- // Tips: Must to reload!
- $table.reloadData(tableData)
- }
- },
-
- insertSourceData: (selectRecords: any) => {
- const $table = xTableSource.value
- const tableData = $table.getTableData().fullData
-
- // Combine: That can select more source commodity
- if (data.form.job_type === PROCESS_JOB_COMBINE) {
- for (const record of selectRecords) {
- const isRepeat = tableData.some((data: WarehouseProcessingDetailVO) => data.sku_id === record.sku_id)
- if (isRepeat) {
- continue
- }
-
- $table.insertAt(
- {
- id: 0,
- stock_process_id: 0,
- sku_id: record.sku_id,
- goods_owner_id: record.goods_owner_id,
- goods_location_id: record.goods_location_id,
- qty: record.qty_available || 0,
- tenant_id: 0,
- is_source: true,
- spu_code: record.spu_code,
- spu_name: record.spu_name,
- sku_code: record.sku_code,
- unit: record.unit,
- is_update_stock: false,
- qty_available: record.qty_available
- },
- -1
- )
- // })
- }
- } else if (data.form.job_type === PROCESS_JOB_SPLIT) {
- // Split: That just can select one source commodity.
- // It should remove all data before insert.
- $table.remove()
- $table.insertAt(
- {
- id: 0,
- stock_process_id: 0,
- sku_id: selectRecords[0].sku_id,
- goods_owner_id: selectRecords[0].goods_owner_id,
- goods_location_id: selectRecords[0].goods_location_id,
- qty: selectRecords[0].qty_available || 0,
- tenant_id: 0,
- is_source: true,
- spu_code: selectRecords[0].spu_code,
- spu_name: selectRecords[0].spu_name,
- sku_code: selectRecords[0].sku_code,
- unit: selectRecords[0].unit,
- is_update_stock: false,
- qty_available: selectRecords[0].qty_available
- },
- -1
- )
- }
- },
-
- insertTargetData: (selectRecords: any) => {
- const $table = xTableTarget.value
- const tableData = $table.getTableData().fullData
-
- // Combine: That just can select one target commodity
- if (data.form.job_type === PROCESS_JOB_COMBINE) {
- // It should remove all data before insert.
- $table.remove()
- $table.insertAt(
- {
- id: 0,
- stock_process_id: 0,
- sku_id: selectRecords[0].sku_id,
- goods_owner_id: 0,
- goods_location_id: 0,
- qty: 0,
- tenant_id: 0,
- is_source: false,
- spu_code: selectRecords[0].spu_code,
- spu_name: selectRecords[0].spu_name,
- sku_code: selectRecords[0].sku_code,
- unit: selectRecords[0].unit,
- is_update_stock: false
- },
- -1
- )
- } else if (data.form.job_type === PROCESS_JOB_SPLIT) {
- // Split: That can select more target commodity
- for (const record of selectRecords) {
- const isRepeat = tableData.some((data: WarehouseProcessingDetailVO) => data.sku_id === record.sku_id)
- if (isRepeat) {
- continue
- }
- $table.insertAt(
- {
- id: 0,
- stock_process_id: 0,
- sku_id: record.sku_id,
- goods_owner_id: 0,
- goods_location_id: 0,
- qty: 0,
- tenant_id: 0,
- is_source: false,
- spu_code: record.spu_code,
- spu_name: record.spu_name,
- sku_code: record.sku_code,
- unit: record.unit,
- is_update_stock: false
- },
- -1
- )
- }
- }
- },
-
- // Export table
- exportTable: (type: string) => {
- const $table = type === 'source' ? xTableSource.value : xTableTarget.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.commodityManagement'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
-
- submit: async () => {
- const validSource = await method.validSourceTable()
- const validTarget = await method.validTargetTable()
- if (!validSource || !validTarget) {
- return
- }
-
- const form = method.constructFormBody()
-
- const { data: res } = await addStockProcess(form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- },
-
- constructFormBody: () => {
- const $tableSource = xTableSource.value
- const $tableTarget = xTableTarget.value
-
- const tableSourceRecords = $tableSource.getTableData().fullData
- const tableTargetRecords = $tableTarget.getTableData().fullData
-
- // Need combine source and target to server.
- let form = { ...data.form }
- form.detailList = [...tableSourceRecords, ...tableTargetRecords]
- form = removeObjectNull(form)
-
- delete form.source_detail_list
- delete form.target_detail_list
-
- return form
- },
-
- validSourceTable: async () => {
- const $table = xTableSource.value
- const tableData = $table.getTableData().fullData
-
- // 1.The table must have data.
- if (!tableData.length) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.tips.detailLengthIsZero')
- })
- return false
- }
-
- // 2.The properties valid.
- const errMap = await $table.validate()
- if (errMap) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- return false
- }
-
- return true
- },
-
- validTargetTable: async () => {
- const $table = xTableTarget.value
- const tableData = $table.getTableData().fullData
-
- // 1.The table must have data.
- if (!tableData.length) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.tips.detailLengthIsZero')
- })
- return false
- }
-
- // 2.The properties valid.
- const errMap = await $table.validate()
- if (errMap) {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- return false
- }
-
- return true
- },
-
- // The 'qty' can't more than 'qty_available'
- validQty: ({ cellValue, row }: any) => {
- const qty = cellValue || 0
- const qtyAvailable = row.qty_available || 0
-
- if (qty > qtyAvailable) {
- return new Error(`${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.qtyMoreThanAvailable') } ${ qtyAvailable }`)
- }
- },
-
- deleteRowSource: (row: WarehouseProcessingDetailVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
- handleConfirm: async () => {
- if (row) {
- const $table = xTableSource.value
- $table.remove(row)
- }
- }
- })
- },
-
- deleteRowTarget: (row: WarehouseProcessingDetailVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
- handleConfirm: async () => {
- if (row) {
- const $table = xTableTarget.value
- $table.remove(row)
- }
- }
- })
- }
-})
-
-const data = reactive({
- tableData: [],
- // 'source' | 'target'
- curSelectType: '',
-
- showCommodityDialogSelect: false,
- showSkuDialogSelect: false,
- showLocationDialogSelect: false,
-
- form: ref<WarehouseProcessingVO>({
- id: 0,
- job_code: '',
- job_type: PROCESS_JOB_COMBINE,
- process_status: false,
- processor: '',
- process_time: '',
- source_detail_list: [],
- target_detail_list: []
- }),
- curSelectRow: ref<WarehouseProcessingDetailVO>({
- id: 0,
- stock_process_id: 0,
- sku_id: 0,
- goods_owner_id: 0,
- goods_location_id: 0,
- qty: 0,
- is_source: true,
- spu_code: '',
- spu_name: '',
- sku_code: '',
- unit: '',
- is_update_stock: false
- }),
- validRulesSource: ref<any>({
- qty: [
- { required: true, message: `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.qty') }` },
- {
- validator: method.validQty
- },
- {
- validator: isInteger,
- validNumerical: 'greaterThanZero',
- trigger: 'change'
- }
- ]
- }),
- validRulesTarget: ref<any>({
- qty: [
- { required: true, message: `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.qty') }` },
- {
- validator: isInteger,
- validNumerical: 'greaterThanZero',
- trigger: 'change'
- }
- ],
- location_name: [
- {
- required: true,
- message: `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.target_location') }`
- }
- ]
- })
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.mainForm {
- background-color: #f9f9f9;
- border-radius: 5px;
- padding: 20px;
- box-sizing: border-box;
- overflow: auto;
-}
-
-.toolbar {
- height: 40px;
- display: flex;
- justify-content: space-between;
-}
-
-.toolbarTitle {
- display: flex;
- // justify-content: center;
- // align-items: center;
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" width="80%" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="jobTypeComp"></v-toolbar>
+ <v-card-text>
+ <v-row>
+ <!-- Source Table -->
+ <v-col cols="6">
+ <div class="dataTable">
+ <div class="toolbar">
+ <div class="toolbarTitle">
+ <p style="color: #999">{{ $t('wms.warehouseWorking.warehouseProcessing.source') }}</p>
+ </div>
+ <tooltip-btn
+ icon="mdi-plus"
+ :tooltip-text="$t('system.page.add')"
+ size="x-small"
+ :disabled="operateDisabled"
+ @click="method.openSelect('source')"
+ ></tooltip-btn>
+ </div>
+ <vxe-table
+ ref="xTableSource"
+ :column-config="{ minWidth: '100px' }"
+ :data="data.form.source_detail_list"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ :edit-config="{ trigger: 'click', mode: 'cell' }"
+ :edit-rules="data.validRulesSource"
+ align="center"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="operate" width="50" :title="$t('system.page.operate')" :resizable="false">
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRowSource(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.warehouseWorking.warehouseProcessing.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.warehouseWorking.warehouseProcessing.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.warehouseWorking.warehouseProcessing.sku_code')"></vxe-column>
+ <vxe-column
+ field="qty"
+ :title="$t('wms.warehouseWorking.warehouseProcessing.qty')"
+ :edit-render="{ autofocus: '.vxe-input--inner' }"
+ >
+ <template #edit="{ row }">
+ <vxe-input v-model="row.qty" type="text"></vxe-input>
+ </template>
+ </vxe-column>
+ <vxe-column field="unit" :title="$t('wms.warehouseWorking.warehouseProcessing.unit')"></vxe-column>
+ </vxe-table>
+ </div>
+ </v-col>
+
+ <!-- Target Table -->
+ <v-col cols="6">
+ <div class="dataTable">
+ <div class="toolbar">
+ <div class="toolbarTitle">
+ <p style="color: #999">{{ $t('wms.warehouseWorking.warehouseProcessing.target') }}</p>
+ </div>
+ <tooltip-btn
+ icon="mdi-plus"
+ :tooltip-text="$t('system.page.add')"
+ size="x-small"
+ :disabled="operateDisabled"
+ @click="method.openSelect('target')"
+ ></tooltip-btn>
+ </div>
+ <vxe-table
+ ref="xTableTarget"
+ :column-config="{ minWidth: '100px' }"
+ :data="data.form.target_detail_list"
+ :height="SYSTEM_HEIGHT.SELECT_TABLE"
+ :edit-config="{ trigger: 'click', mode: 'cell' }"
+ :edit-rules="data.validRulesTarget"
+ align="center"
+ >
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column field="operate" width="50" :title="$t('system.page.operate')" :resizable="false">
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRowTarget(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.warehouseWorking.warehouseProcessing.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.warehouseWorking.warehouseProcessing.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.warehouseWorking.warehouseProcessing.sku_code')"></vxe-column>
+ <vxe-column
+ field="qty"
+ :title="$t('wms.warehouseWorking.warehouseProcessing.qty')"
+ :edit-render="{ autofocus: '.vxe-input--inner' }"
+ >
+ <template #edit="{ row }">
+ <vxe-input v-model="row.qty" type="text"></vxe-input>
+ </template>
+ </vxe-column>
+ <vxe-column field="unit" width="60" :title="$t('wms.warehouseWorking.warehouseProcessing.unit')"></vxe-column>
+ <vxe-column field="location_name" :title="$t('wms.warehouseWorking.warehouseProcessing.target_location')" :edit-render="{}">
+ <template #edit="{ row }">
+ <vxe-input v-model="row.location_name" readonly type="search" @search-click="method.openLocationSelect(row)"></vxe-input>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ </div>
+ </v-col>
+ </v-row>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" :disabled="operateDisabled" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+
+ <commodity-select :show-dialog="data.showCommodityDialogSelect" @close="method.closeDialogSelect('source')" @sureSelect="method.sureSelect" />
+ <sku-select :show-dialog="data.showSkuDialogSelect" @close="method.closeDialogSelect('target')" @sureSelect="method.sureSelect" />
+ <location-select :show-dialog="data.showLocationDialogSelect" @close="method.closeLocationDialogSelect" @sureSelect="method.sureSelectLocation" />
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { VxeTablePropTypes } from 'vxe-table'
+import { WarehouseProcessingVO, WarehouseProcessingDetailVO } from '@/types/WarehouseWorking/WarehouseProcessing'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addStockProcess } from '@/api/wms/warehouseProcessing'
+import { SYSTEM_HEIGHT, errorColor } from '@/constant/style'
+import { removeObjectNull } from '@/utils/common'
+import { PROCESS_JOB_COMBINE, PROCESS_JOB_SPLIT } from '@/constant/warehouseWorking'
+import commoditySelect from '@/components/select/commodity-select.vue'
+import locationSelect from '@/components/select/location-select.vue'
+import skuSelect from '@/components/select/sku-select.vue'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import { exportData } from '@/utils/exportTable'
+import { isInteger } from '@/utils/dataVerification/tableRule'
+
+const emit = defineEmits(['close', 'saveSuccess'])
+const xTableSource = ref()
+const xTableTarget = ref()
+
+const props = defineProps<{
+ showDialog: boolean
+ form: WarehouseProcessingVO
+ processType: boolean
+}>()
+
+const isShow = computed(() => props.showDialog)
+const isUpdate = computed(() => props.form.id && props.form.id > 0)
+const jobTypeComp = computed(() => (data.form.job_type === PROCESS_JOB_COMBINE
+ ? i18n.global.t('wms.warehouseWorking.warehouseProcessing.process_combine')
+ : i18n.global.t('wms.warehouseWorking.warehouseProcessing.process_split')))
+const operateDisabled = computed(() => !!isUpdate.value)
+
+const method = reactive({
+ initForm: () => {
+ data.form = props.form
+ data.form.job_type = props.processType
+ },
+
+ closeDialog: () => {
+ emit('close')
+ },
+
+ openSelect: (type: string) => {
+ data.curSelectType = type
+
+ if (type === 'source') {
+ data.showCommodityDialogSelect = true
+ } else if (type === 'target') {
+ // Target should select the data with 'sku-select-modal'
+ data.showSkuDialogSelect = true
+ }
+ },
+
+ closeDialogSelect: (type: string) => {
+ if (type === 'source') {
+ data.showCommodityDialogSelect = false
+ } else if (type === 'target') {
+ // Target should select the data with 'sku-select-modal'
+ data.showSkuDialogSelect = false
+ }
+ },
+
+ sureSelect: (selectRecords: any) => {
+ if (data.curSelectType === 'source') {
+ method.insertSourceData(selectRecords)
+ } else if (data.curSelectType === 'target') {
+ method.insertTargetData(selectRecords)
+ }
+ },
+
+ openLocationSelect: (row: WarehouseProcessingDetailVO) => {
+ data.curSelectRow = row
+ data.showLocationDialogSelect = true
+ },
+
+ closeLocationDialogSelect: () => {
+ data.showLocationDialogSelect = false
+ },
+
+ sureSelectLocation: (selectRecords: any) => {
+ if (selectRecords.length > 0) {
+ const $table = xTableTarget.value
+ const tableData = $table.getTableData().fullData
+ tableData.forEach((row: WarehouseProcessingDetailVO) => {
+ if (data.curSelectRow.sku_id === row.sku_id) {
+ row.goods_location_id = selectRecords[0].id
+ row.location_name = selectRecords[0].location_name
+ }
+ })
+ // Tips: Must to reload!
+ $table.reloadData(tableData)
+ }
+ },
+
+ insertSourceData: (selectRecords: any) => {
+ const $table = xTableSource.value
+ const tableData = $table.getTableData().fullData
+
+ // Combine: That can select more source commodity
+ if (data.form.job_type === PROCESS_JOB_COMBINE) {
+ for (const record of selectRecords) {
+ const isRepeat = tableData.some((data: WarehouseProcessingDetailVO) => data.sku_id === record.sku_id)
+ if (isRepeat) {
+ continue
+ }
+
+ $table.insertAt(
+ {
+ id: 0,
+ stock_process_id: 0,
+ sku_id: record.sku_id,
+ goods_owner_id: record.goods_owner_id,
+ goods_location_id: record.goods_location_id,
+ qty: record.qty_available || 0,
+ tenant_id: 0,
+ is_source: true,
+ spu_code: record.spu_code,
+ spu_name: record.spu_name,
+ sku_code: record.sku_code,
+ unit: record.unit,
+ is_update_stock: false,
+ qty_available: record.qty_available
+ },
+ -1
+ )
+ // })
+ }
+ } else if (data.form.job_type === PROCESS_JOB_SPLIT) {
+ // Split: That just can select one source commodity.
+ // It should remove all data before insert.
+ $table.remove()
+ $table.insertAt(
+ {
+ id: 0,
+ stock_process_id: 0,
+ sku_id: selectRecords[0].sku_id,
+ goods_owner_id: selectRecords[0].goods_owner_id,
+ goods_location_id: selectRecords[0].goods_location_id,
+ qty: selectRecords[0].qty_available || 0,
+ tenant_id: 0,
+ is_source: true,
+ spu_code: selectRecords[0].spu_code,
+ spu_name: selectRecords[0].spu_name,
+ sku_code: selectRecords[0].sku_code,
+ unit: selectRecords[0].unit,
+ is_update_stock: false,
+ qty_available: selectRecords[0].qty_available
+ },
+ -1
+ )
+ }
+ },
+
+ insertTargetData: (selectRecords: any) => {
+ const $table = xTableTarget.value
+ const tableData = $table.getTableData().fullData
+
+ // Combine: That just can select one target commodity
+ if (data.form.job_type === PROCESS_JOB_COMBINE) {
+ // It should remove all data before insert.
+ $table.remove()
+ $table.insertAt(
+ {
+ id: 0,
+ stock_process_id: 0,
+ sku_id: selectRecords[0].sku_id,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ qty: 0,
+ tenant_id: 0,
+ is_source: false,
+ spu_code: selectRecords[0].spu_code,
+ spu_name: selectRecords[0].spu_name,
+ sku_code: selectRecords[0].sku_code,
+ unit: selectRecords[0].unit,
+ is_update_stock: false
+ },
+ -1
+ )
+ } else if (data.form.job_type === PROCESS_JOB_SPLIT) {
+ // Split: That can select more target commodity
+ for (const record of selectRecords) {
+ const isRepeat = tableData.some((data: WarehouseProcessingDetailVO) => data.sku_id === record.sku_id)
+ if (isRepeat) {
+ continue
+ }
+ $table.insertAt(
+ {
+ id: 0,
+ stock_process_id: 0,
+ sku_id: record.sku_id,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ qty: 0,
+ tenant_id: 0,
+ is_source: false,
+ spu_code: record.spu_code,
+ spu_name: record.spu_name,
+ sku_code: record.sku_code,
+ unit: record.unit,
+ is_update_stock: false
+ },
+ -1
+ )
+ }
+ }
+ },
+
+ // Export table
+ exportTable: (type: string) => {
+ const $table = type === 'source' ? xTableSource.value : xTableTarget.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.commodityManagement'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+
+ submit: async () => {
+ const validSource = await method.validSourceTable()
+ const validTarget = await method.validTargetTable()
+ if (!validSource || !validTarget) {
+ return
+ }
+
+ const form = method.constructFormBody()
+
+ const { data: res } = await addStockProcess(form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ },
+
+ constructFormBody: () => {
+ const $tableSource = xTableSource.value
+ const $tableTarget = xTableTarget.value
+
+ const tableSourceRecords = $tableSource.getTableData().fullData
+ const tableTargetRecords = $tableTarget.getTableData().fullData
+
+ // Need combine source and target to server.
+ let form = { ...data.form }
+ form.detailList = [...tableSourceRecords, ...tableTargetRecords]
+ form = removeObjectNull(form)
+
+ delete form.source_detail_list
+ delete form.target_detail_list
+
+ return form
+ },
+
+ validSourceTable: async () => {
+ const $table = xTableSource.value
+ const tableData = $table.getTableData().fullData
+
+ // 1.The table must have data.
+ if (!tableData.length) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.tips.detailLengthIsZero')
+ })
+ return false
+ }
+
+ // 2.The properties valid.
+ const errMap = await $table.validate()
+ if (errMap) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ return false
+ }
+
+ return true
+ },
+
+ validTargetTable: async () => {
+ const $table = xTableTarget.value
+ const tableData = $table.getTableData().fullData
+
+ // 1.The table must have data.
+ if (!tableData.length) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.tips.detailLengthIsZero')
+ })
+ return false
+ }
+
+ // 2.The properties valid.
+ const errMap = await $table.validate()
+ if (errMap) {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ return false
+ }
+
+ return true
+ },
+
+ // The 'qty' can't more than 'qty_available'
+ validQty: ({ cellValue, row }: any) => {
+ const qty = cellValue || 0
+ const qtyAvailable = row.qty_available || 0
+
+ if (qty > qtyAvailable) {
+ return new Error(`${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.qtyMoreThanAvailable') } ${ qtyAvailable }`)
+ }
+ },
+
+ deleteRowSource: (row: WarehouseProcessingDetailVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
+ handleConfirm: async () => {
+ if (row) {
+ const $table = xTableSource.value
+ $table.remove(row)
+ }
+ }
+ })
+ },
+
+ deleteRowTarget: (row: WarehouseProcessingDetailVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteDetailMessage'),
+ handleConfirm: async () => {
+ if (row) {
+ const $table = xTableTarget.value
+ $table.remove(row)
+ }
+ }
+ })
+ }
+})
+
+const data = reactive({
+ tableData: [],
+ // 'source' | 'target'
+ curSelectType: '',
+
+ showCommodityDialogSelect: false,
+ showSkuDialogSelect: false,
+ showLocationDialogSelect: false,
+
+ form: ref<WarehouseProcessingVO>({
+ id: 0,
+ job_code: '',
+ job_type: PROCESS_JOB_COMBINE,
+ process_status: false,
+ processor: '',
+ process_time: '',
+ source_detail_list: [],
+ target_detail_list: []
+ }),
+ curSelectRow: ref<WarehouseProcessingDetailVO>({
+ id: 0,
+ stock_process_id: 0,
+ sku_id: 0,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ qty: 0,
+ is_source: true,
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ unit: '',
+ is_update_stock: false
+ }),
+ validRulesSource: ref<any>({
+ qty: [
+ { required: true, message: `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.qty') }` },
+ {
+ validator: method.validQty
+ },
+ {
+ validator: isInteger,
+ validNumerical: 'greaterThanZero',
+ trigger: 'change'
+ }
+ ]
+ }),
+ validRulesTarget: ref<any>({
+ qty: [
+ { required: true, message: `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.qty') }` },
+ {
+ validator: isInteger,
+ validNumerical: 'greaterThanZero',
+ trigger: 'change'
+ }
+ ],
+ location_name: [
+ {
+ required: true,
+ message: `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.target_location') }`
+ }
+ ]
+ })
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.mainForm {
+ background-color: #f9f9f9;
+ border-radius: 5px;
+ padding: 20px;
+ box-sizing: border-box;
+ overflow: auto;
+}
+
+.toolbar {
+ height: 40px;
+ display: flex;
+ justify-content: space-between;
+}
+
+.toolbarTitle {
+ display: flex;
+ // justify-content: center;
+ // align-items: center;
+}
+</style>
diff --git a/frontend/src/view/warehouseWorking/warehouseProcessing/warehouseProcessing.vue b/frontend/src/view/warehouseWorking/warehouseProcessing/warehouseProcessing.vue
index 94a87a1..952fd6c 100644
--- a/frontend/src/view/warehouseWorking/warehouseProcessing/warehouseProcessing.vue
+++ b/frontend/src/view/warehouseWorking/warehouseProcessing/warehouseProcessing.vue
@@ -1,403 +1,404 @@
-<!-- Warehouse Processing -->
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <v-window v-model="data.activeTab">
- <v-window-item>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn
- icon="mdi-arrow-split-vertical"
- :tooltip-text="$t('wms.warehouseWorking.warehouseProcessing.process_split')"
- @click="method.add(PROCESS_JOB_SPLIT)"
- ></tooltip-btn>
- <tooltip-btn
- icon="mdi-group"
- :tooltip-text="$t('wms.warehouseWorking.warehouseProcessing.process_combine')"
- @click="method.add(PROCESS_JOB_COMBINE)"
- ></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.job_code"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.warehouseWorking.warehouseProcessing.job_code')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="job_code" width="150px" :title="$t('wms.warehouseWorking.warehouseProcessing.job_code')"></vxe-column>
- <vxe-column field="job_type" :title="$t('wms.warehouseWorking.warehouseProcessing.job_type')">
- <template #default="{ row, column }">
- <span>{{ formatProcessJobType(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="adjust_status" :title="$t('wms.warehouseWorking.warehouseProcessing.adjust_status')">
- <template #default="{ row, column }">
- <span>{{ formatIsValid(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="processor" :title="$t('wms.warehouseWorking.warehouseProcessing.processor')"></vxe-column>
- <vxe-column field="process_time" width="170px" :title="$t('wms.warehouseWorking.warehouseProcessing.process_time')">
- <template #default="{ row, column }">
- <span>{{ formatDate(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="creator" :title="$t('wms.warehouseWorking.warehouseProcessing.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.warehouseWorking.warehouseProcessing.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="250" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-eye-outline"
- :tooltip-text="$t('system.page.view')"
- @click="method.viewRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-book-check-outline"
- :tooltip-text="$t('wms.warehouseWorking.warehouseProcessing.confirmProcess')"
- :disabled="method.confirmProcessBtnDisabled(row)"
- @click="method.confirmProcess(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-book-open-outline"
- :tooltip-text="$t('wms.warehouseWorking.warehouseProcessing.confirmAdjust')"
- :disabled="method.confirmAdjustBtnDisabled(row)"
- @click="method.confirmAdjust(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- :disabled="method.confirmProcessBtnDisabled(row)"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- </v-window-item>
- </v-window>
- </v-card-text>
- </v-card>
- <addOrUpdateDialog
- :show-dialog="data.showDialog"
- :form="data.dialogForm"
- :process-type="data.processType"
- @close="method.closeDialog"
- @saveSuccess="method.saveSuccess"
- />
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, onActivated, watch, nextTick } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { WarehouseProcessingVO, WarehouseProcessingDetailVO } from '@/types/WarehouseWorking/WarehouseProcessing'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { deleteStockProcess, getStockProcessList, getStockProcessOne, confirmAdjustment, confirmProcess } from '@/api/wms/warehouseProcessing'
-import { PROCESS_JOB_COMBINE, PROCESS_JOB_SPLIT } from '@/constant/warehouseWorking'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { formatIsValid, formatDate } from '@/utils/format/formatSystem'
-import { formatProcessJobType } from '@/utils/format/formatWarehouseWorking'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import addOrUpdateDialog from './add-or-update-process.vue'
-import i18n from '@/languages/i18n'
-import customPager from '@/components/custom-pager.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-const data = reactive({
- showDialog: false,
- processType: PROCESS_JOB_COMBINE,
- timer: ref<any>(null),
- activeTab: null,
- searchForm: {
- job_code: ''
- },
- tableData: ref<WarehouseProcessingVO[]>([]),
- dialogForm: {
- id: 0,
- job_code: '',
- job_type: PROCESS_JOB_COMBINE,
- process_status: false,
- processor: '',
- process_time: '',
- source_detail_list: ref<any[]>([]),
- target_detail_list: ref<any[]>([]),
- creator: '',
- create_time: '',
- adjust_status: false
- },
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- })
-})
-
-const method = reactive({
- // Open a dialog to add
- add: (jobType: boolean) => {
- data.processType = jobType
- data.dialogForm = {
- id: 0,
- job_code: '',
- job_type: jobType,
- process_status: false,
- processor: '',
- process_time: '',
- source_detail_list: [],
- target_detail_list: [],
- creator: '',
- create_time: '',
- adjust_status: false
- }
- nextTick(() => {
- data.showDialog = true
- })
- },
-
- // After add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
-
- // Refresh data
- refresh: () => {
- method.getStockProcessList()
- },
-
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
-
- getStockProcessList: async () => {
- const { data: res } = await getStockProcessList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
-
- viewRow: async (row: WarehouseProcessingVO) => {
- await method.getOne(row.id)
- nextTick(() => {
- data.showDialog = true
- })
- },
-
- getOne: async (id: number) => {
- const { data: res } = await getStockProcessOne(id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
-
- data.dialogForm = res.data
- },
-
- deleteRow(row: WarehouseProcessingVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteStockProcess(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
-
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
-
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
- method.refresh()
- }),
-
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.warehouseProcessing'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
-
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.refresh()
- },
-
- // The btn will become disabled when the 'process_status' is false
- confirmProcessBtnDisabled: (row: WarehouseProcessingVO) => !!row.process_status,
-
- // The btn will become disabled when the 'process_status' is false
- // or the 'adjust_status' is true
- confirmAdjustBtnDisabled: (row: WarehouseProcessingVO) => !row.process_status || !!row.adjust_status,
-
- confirmProcess: async (row: WarehouseProcessingDetailVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('wms.warehouseWorking.warehouseProcessing.beforeConfirmProcess'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await confirmProcess(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.confirmProcess') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
-
- confirmAdjust: async (row: WarehouseProcessingDetailVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('wms.warehouseWorking.warehouseProcessing.beforeConfirmAdjust'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await confirmAdjustment(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.confirmAdjust') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- }
-})
-
-onActivated(() => {
- method.refresh()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<!-- Warehouse Processing -->
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <v-window v-model="data.activeTab">
+ <v-window-item>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn
+ icon="mdi-arrow-split-vertical"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseProcessing.process_split')"
+ @click="method.add(PROCESS_JOB_SPLIT)"
+ ></tooltip-btn>
+ <tooltip-btn
+ icon="mdi-group"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseProcessing.process_combine')"
+ @click="method.add(PROCESS_JOB_COMBINE)"
+ ></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.job_code"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.warehouseWorking.warehouseProcessing.job_code')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="job_code" width="150px" :title="$t('wms.warehouseWorking.warehouseProcessing.job_code')"></vxe-column>
+ <vxe-column field="job_type" :title="$t('wms.warehouseWorking.warehouseProcessing.job_type')">
+ <template #default="{ row, column }">
+ <span>{{ formatProcessJobType(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="adjust_status" :title="$t('wms.warehouseWorking.warehouseProcessing.adjust_status')">
+ <template #default="{ row, column }">
+ <span>{{ formatIsValid(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="processor" :title="$t('wms.warehouseWorking.warehouseProcessing.processor')"></vxe-column>
+ <vxe-column field="process_time" width="170px" :title="$t('wms.warehouseWorking.warehouseProcessing.process_time')">
+ <template #default="{ row, column }">
+ <span>{{ formatDate(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="creator" :title="$t('wms.warehouseWorking.warehouseProcessing.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.warehouseWorking.warehouseProcessing.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="250" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-eye-outline"
+ :tooltip-text="$t('system.page.view')"
+ @click="method.viewRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-book-check-outline"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseProcessing.confirmProcess')"
+ :disabled="method.confirmProcessBtnDisabled(row)"
+ @click="method.confirmProcess(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-book-open-outline"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseProcessing.confirmAdjust')"
+ :disabled="method.confirmAdjustBtnDisabled(row)"
+ @click="method.confirmAdjust(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ :disabled="method.confirmProcessBtnDisabled(row)"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ </v-window-item>
+ </v-window>
+ </v-card-text>
+ </v-card>
+ <addOrUpdateDialog
+ :show-dialog="data.showDialog"
+ :form="data.dialogForm"
+ :process-type="data.processType"
+ @close="method.closeDialog"
+ @saveSuccess="method.saveSuccess"
+ />
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, onActivated, watch, nextTick } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { WarehouseProcessingVO, WarehouseProcessingDetailVO } from '@/types/WarehouseWorking/WarehouseProcessing'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { deleteStockProcess, getStockProcessList, getStockProcessOne, confirmAdjustment, confirmProcess } from '@/api/wms/warehouseProcessing'
+import { PROCESS_JOB_COMBINE, PROCESS_JOB_SPLIT } from '@/constant/warehouseWorking'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { formatIsValid, formatDate } from '@/utils/format/formatSystem'
+import { formatProcessJobType } from '@/utils/format/formatWarehouseWorking'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import addOrUpdateDialog from './add-or-update-process.vue'
+import i18n from '@/languages/i18n'
+import customPager from '@/components/custom-pager.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+const data = reactive({
+ showDialog: false,
+ processType: PROCESS_JOB_COMBINE,
+ timer: ref<any>(null),
+ activeTab: null,
+ searchForm: {
+ job_code: ''
+ },
+ tableData: ref<WarehouseProcessingVO[]>([]),
+ dialogForm: {
+ id: 0,
+ job_code: '',
+ job_type: PROCESS_JOB_COMBINE,
+ process_status: false,
+ processor: '',
+ process_time: '',
+ source_detail_list: ref<any[]>([]),
+ target_detail_list: ref<any[]>([]),
+ creator: '',
+ create_time: '',
+ adjust_status: false
+ },
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ })
+})
+
+const method = reactive({
+ // Open a dialog to add
+ add: (jobType: boolean) => {
+ data.processType = jobType
+ data.dialogForm = {
+ id: 0,
+ job_code: '',
+ job_type: jobType,
+ process_status: false,
+ processor: '',
+ process_time: '',
+ source_detail_list: [],
+ target_detail_list: [],
+ creator: '',
+ create_time: '',
+ adjust_status: false
+ }
+ nextTick(() => {
+ data.showDialog = true
+ })
+ },
+
+ // After add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+
+ // Refresh data
+ refresh: () => {
+ method.getStockProcessList()
+ },
+
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+
+ getStockProcessList: async () => {
+ const { data: res } = await getStockProcessList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+
+ viewRow: async (row: WarehouseProcessingVO) => {
+ await method.getOne(row.id)
+ nextTick(() => {
+ data.showDialog = true
+ })
+ },
+
+ getOne: async (id: number) => {
+ const { data: res } = await getStockProcessOne(id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+
+ data.dialogForm = res.data
+ data.processType = res.data.job_type
+ },
+
+ deleteRow(row: WarehouseProcessingVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteStockProcess(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+ method.refresh()
+ }),
+
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.warehouseProcessing'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.refresh()
+ },
+
+ // The btn will become disabled when the 'process_status' is false
+ confirmProcessBtnDisabled: (row: WarehouseProcessingVO) => !!row.process_status,
+
+ // The btn will become disabled when the 'process_status' is false
+ // or the 'adjust_status' is true
+ confirmAdjustBtnDisabled: (row: WarehouseProcessingVO) => !row.process_status || !!row.adjust_status,
+
+ confirmProcess: async (row: WarehouseProcessingDetailVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('wms.warehouseWorking.warehouseProcessing.beforeConfirmProcess'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await confirmProcess(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.confirmProcess') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+
+ confirmAdjust: async (row: WarehouseProcessingDetailVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('wms.warehouseWorking.warehouseProcessing.beforeConfirmAdjust'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await confirmAdjustment(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('wms.warehouseWorking.warehouseProcessing.confirmAdjust') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ }
+})
+
+onActivated(() => {
+ method.refresh()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/warehouseWorking/warehouseTaking/add-or-update-taking.vue b/frontend/src/view/warehouseWorking/warehouseTaking/add-or-update-taking.vue
index 47c073c..3dbb117 100644
--- a/frontend/src/view/warehouseWorking/warehouseTaking/add-or-update-taking.vue
+++ b/frontend/src/view/warehouseWorking/warehouseTaking/add-or-update-taking.vue
@@ -1,322 +1,322 @@
-<!-- Warehouse Taking Operate Dialog -->
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('router.sideBar.warehouseTaking')}`"></v-toolbar>
- <v-card-text>
- <div class="header">
- <div class="headerBtn">
- <tooltip-btn
- size="x-small"
- icon="mdi-home-plus-outline"
- :tooltip-text="$t('wms.warehouseWorking.warehouseTaking.addFromStock')"
- @click="method.openCommoditySelect()"
- ></tooltip-btn>
- <tooltip-btn
- size="x-small"
- icon="mdi-store-plus-outline"
- :tooltip-text="$t('wms.warehouseWorking.warehouseTaking.addFromCommodity')"
- :disabled="isFromStock"
- @click="method.openSkuSelect()"
- ></tooltip-btn>
- </div>
- <div class="headerTips">
- <v-tooltip :text="$t('wms.warehouseWorking.warehouseTaking.addTips')">
- <template #activator="{ props }">
- <v-btn v-bind="props" size="x-small" variant="text" icon="mdi-help-circle" color="blue-lighten-2"></v-btn>
- </template>
- </v-tooltip>
- </div>
- </div>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.spu_code"
- :label="$t('base.commodityManagement.spu_code')"
- :rules="data.rules.spu_code"
- variant="outlined"
- readonly
- clearable
- @click:clear="method.clearCommodity"
- ></v-text-field>
- <v-text-field
- v-model="data.form.spu_name"
- :label="$t('base.commodityManagement.spu_name')"
- :rules="data.rules.spu_name"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.sku_code"
- :label="$t('base.commodityManagement.sku_code')"
- :rules="data.rules.sku_code"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.warehouse_name"
- :label="$t('wms.warehouseWorking.warehouseTaking.warehouse')"
- :rules="data.rules.warehouse_name"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.location_name"
- :label="$t('wms.warehouseWorking.warehouseTaking.location_name')"
- :rules="data.rules.location_name"
- variant="outlined"
- :disabled="isFromStock"
- @click="method.openLocationSelect"
- @click:clear="method.clearLocation"
- ></v-text-field>
- <v-text-field
- v-model="data.form.book_qty"
- :label="$t('wms.warehouseWorking.warehouseTaking.book_qty')"
- :rules="data.rules.book_qty"
- variant="outlined"
- disabled
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" :disabled="operateDisabled" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-
- <commodity-select
- :show-dialog="data.showCommodityDialogSelect"
- @close="method.closeCommodityDialogSelect"
- @sureSelect="method.sureSelectCommodity"
- />
- <sku-select :show-dialog="data.showSkuDialogSelect" @close="method.closeDialogSelectSku" @sureSelect="method.sureSelectSku" />
- <location-select :show-dialog="data.showLocationDialogSelect" @close="method.closeDialogSelectLocation" @sureSelect="method.sureSelectLocation" />
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { hookComponent } from '@/components/system/index'
-import { addStockTaking } from '@/api/wms/warehouseTaking'
-import { WarehouseTakingVO } from '@/types/WarehouseWorking/WarehouseTaking'
-import { removeObjectNull } from '@/utils/common'
-import { TAKING_JOB_FINISH } from '@/constant/warehouseWorking'
-import i18n from '@/languages/i18n'
-import commoditySelect from '@/components/select/commodity-select.vue'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import locationSelect from '@/components/select/location-select.vue'
-import skuSelect from '@/components/select/sku-select.vue'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-const isUpdate = computed(() => props.form.id && props.form.id > 0)
-const operateDisabled = computed(() => !!isUpdate.value)
-const isFromStock = computed(() => data.curStockID > 0)
-
-const props = defineProps<{
- showDialog: boolean
- form: WarehouseTakingVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- showCommodityDialogSelect: false,
- showLocationDialogSelect: false,
- showSkuDialogSelect: false,
-
- // There has value when choose from stock.
- curStockID: 0,
-
- form: ref<WarehouseTakingVO>({
- id: 0,
- job_code: '',
- job_status: TAKING_JOB_FINISH,
- sku_id: 0,
- goods_owner_id: 0,
- goods_location_id: 0,
- book_qty: 0,
- counted_qty: 0,
- difference_qty: 0,
- spu_code: '',
- spu_name: '',
- sku_code: '',
- warehouse_name: '',
- location_name: '',
- handler: '',
- handle_time: '',
- adjust_status: false,
- creator: '',
- create_time: ''
- }),
- rules: {
- job_type: [],
- book_qty: [],
- warehouse_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseTaking.warehouse') }!`
- ],
- location_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseTaking.location_name') }!`
- ],
- spu_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_code') }!`],
- spu_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_name') }!`],
- sku_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_code') }!`],
- sku_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_name') }!`]
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
-
- initForm: () => {
- data.form = props.form
- },
-
- openCommoditySelect: () => {
- data.showCommodityDialogSelect = true
- },
-
- closeCommodityDialogSelect: () => {
- data.showCommodityDialogSelect = false
- },
-
- sureSelectCommodity: (selectRecords: any) => {
- try {
- data.curStockID = selectRecords[0].id
- data.form.sku_id = selectRecords[0].sku_id
- data.form.goods_owner_id = selectRecords[0].goods_owner_id
- data.form.goods_location_id = selectRecords[0].goods_location_id
- data.form.warehouse_name = selectRecords[0].warehouse_name
- data.form.location_name = selectRecords[0].location_name
- data.form.spu_code = selectRecords[0].spu_code
- data.form.spu_name = selectRecords[0].spu_name
- data.form.sku_code = selectRecords[0].sku_code
- data.form.book_qty = selectRecords[0].qty_available
- } catch (error) {
- // console.error(error)
- }
- },
-
- clearCommodity: () => {
- data.curStockID = 0
- data.form.sku_id = 0
- data.form.goods_location_id = 0
- data.form.warehouse_name = ''
- data.form.location_name = ''
- data.form.spu_code = ''
- data.form.spu_name = ''
- data.form.sku_code = ''
- data.form.book_qty = 0
- },
-
- openSkuSelect: () => {
- data.showSkuDialogSelect = true
- },
-
- closeDialogSelectSku: () => {
- data.showSkuDialogSelect = false
- },
-
- sureSelectSku: (selectRecords: any) => {
- if (selectRecords.length > 0) {
- data.form.sku_id = selectRecords[0].sku_id
- data.form.goods_owner_id = selectRecords[0].goods_owner_id
- data.form.goods_location_id = selectRecords[0].goods_location_id
- // The book qty should zero when the data from commodity.
- data.form.book_qty = 0
- data.form.spu_code = selectRecords[0].spu_code
- data.form.spu_name = selectRecords[0].spu_name
- data.form.sku_code = selectRecords[0].sku_code
- }
- },
-
- openLocationSelect: () => {
- data.showLocationDialogSelect = true
- },
-
- closeDialogSelectLocation: () => {
- data.showLocationDialogSelect = false
- },
-
- sureSelectLocation: (selectRecords: any) => {
- if (selectRecords.length > 0) {
- data.form.goods_location_id = selectRecords[0].id
- data.form.warehouse_name = selectRecords[0].warehouse_name
- data.form.location_name = selectRecords[0].location_name
- }
- },
-
- clearLocation: () => {
- data.form.goods_location_id = 0
- data.form.warehouse_name = ''
- data.form.location_name = ''
- },
-
- submit: async () => {
- const { valid } = await formRef.value.validate()
-
- const form = method.constructFormBody()
-
- if (valid) {
- const { data: res } = await addStockTaking(form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- },
-
- constructFormBody: () => {
- let form = { ...data.form }
- form = removeObjectNull(form)
-
- return form
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-
-.header {
- display: flex;
- margin-bottom: 15px;
- justify-content: space-between;
-}
-
-.headerBtn {
-}
-.headerTips {
- display: flex;
- align-items: center;
-}
-</style>
+<!-- Warehouse Taking Operate Dialog -->
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('router.sideBar.warehouseTaking')}`"></v-toolbar>
+ <v-card-text>
+ <div class="header">
+ <div class="headerBtn">
+ <tooltip-btn
+ size="x-small"
+ icon="mdi-home-plus-outline"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseTaking.addFromStock')"
+ @click="method.openCommoditySelect()"
+ ></tooltip-btn>
+ <tooltip-btn
+ size="x-small"
+ icon="mdi-store-plus-outline"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseTaking.addFromCommodity')"
+ :disabled="isFromStock"
+ @click="method.openSkuSelect()"
+ ></tooltip-btn>
+ </div>
+ <div class="headerTips">
+ <v-tooltip :text="$t('wms.warehouseWorking.warehouseTaking.addTips')">
+ <template #activator="{ props }">
+ <v-btn v-bind="props" size="x-small" variant="text" icon="mdi-help-circle" color="blue-lighten-2"></v-btn>
+ </template>
+ </v-tooltip>
+ </div>
+ </div>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.spu_code"
+ :label="$t('base.commodityManagement.spu_code')"
+ :rules="data.rules.spu_code"
+ variant="outlined"
+ readonly
+ clearable
+ @click:clear="method.clearCommodity"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.spu_name"
+ :label="$t('base.commodityManagement.spu_name')"
+ :rules="data.rules.spu_name"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.sku_code"
+ :label="$t('base.commodityManagement.sku_code')"
+ :rules="data.rules.sku_code"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.warehouse_name"
+ :label="$t('wms.warehouseWorking.warehouseTaking.warehouse')"
+ :rules="data.rules.warehouse_name"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.location_name"
+ :label="$t('wms.warehouseWorking.warehouseTaking.location_name')"
+ :rules="data.rules.location_name"
+ variant="outlined"
+ :disabled="isFromStock"
+ @click="method.openLocationSelect"
+ @click:clear="method.clearLocation"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.book_qty"
+ :label="$t('wms.warehouseWorking.warehouseTaking.book_qty')"
+ :rules="data.rules.book_qty"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" :disabled="operateDisabled" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+
+ <commodity-select
+ :show-dialog="data.showCommodityDialogSelect"
+ @close="method.closeCommodityDialogSelect"
+ @sureSelect="method.sureSelectCommodity"
+ />
+ <sku-select :show-dialog="data.showSkuDialogSelect" @close="method.closeDialogSelectSku" @sureSelect="method.sureSelectSku" />
+ <location-select :show-dialog="data.showLocationDialogSelect" @close="method.closeDialogSelectLocation" @sureSelect="method.sureSelectLocation" />
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { hookComponent } from '@/components/system/index'
+import { addStockTaking } from '@/api/wms/warehouseTaking'
+import { WarehouseTakingVO } from '@/types/WarehouseWorking/WarehouseTaking'
+import { removeObjectNull } from '@/utils/common'
+import { TAKING_JOB_FINISH } from '@/constant/warehouseWorking'
+import i18n from '@/languages/i18n'
+import commoditySelect from '@/components/select/commodity-select.vue'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import locationSelect from '@/components/select/location-select.vue'
+import skuSelect from '@/components/select/sku-select.vue'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+const isUpdate = computed(() => props.form.id && props.form.id > 0)
+const operateDisabled = computed(() => !!isUpdate.value)
+const isFromStock = computed(() => data.curStockID > 0)
+
+const props = defineProps<{
+ showDialog: boolean
+ form: WarehouseTakingVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ showCommodityDialogSelect: false,
+ showLocationDialogSelect: false,
+ showSkuDialogSelect: false,
+
+ // There has value when choose from stock.
+ curStockID: 0,
+
+ form: ref<WarehouseTakingVO>({
+ id: 0,
+ job_code: '',
+ job_status: TAKING_JOB_FINISH,
+ sku_id: 0,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ book_qty: 0,
+ counted_qty: 0,
+ difference_qty: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ warehouse_name: '',
+ location_name: '',
+ handler: '',
+ handle_time: '',
+ adjust_status: false,
+ creator: '',
+ create_time: ''
+ }),
+ rules: {
+ job_type: [],
+ book_qty: [],
+ warehouse_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseTaking.warehouse') }!`
+ ],
+ location_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseTaking.location_name') }!`
+ ],
+ spu_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_code') }!`],
+ spu_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.spu_name') }!`],
+ sku_code: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_code') }!`],
+ sku_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.commodityManagement.sku_name') }!`]
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+
+ initForm: () => {
+ data.form = props.form
+ },
+
+ openCommoditySelect: () => {
+ data.showCommodityDialogSelect = true
+ },
+
+ closeCommodityDialogSelect: () => {
+ data.showCommodityDialogSelect = false
+ },
+
+ sureSelectCommodity: (selectRecords: any) => {
+ try {
+ data.curStockID = selectRecords[0].id
+ data.form.sku_id = selectRecords[0].sku_id
+ data.form.goods_owner_id = selectRecords[0].goods_owner_id
+ data.form.goods_location_id = selectRecords[0].goods_location_id
+ data.form.warehouse_name = selectRecords[0].warehouse_name
+ data.form.location_name = selectRecords[0].location_name
+ data.form.spu_code = selectRecords[0].spu_code
+ data.form.spu_name = selectRecords[0].spu_name
+ data.form.sku_code = selectRecords[0].sku_code
+ data.form.book_qty = selectRecords[0].qty_available
+ } catch (error) {
+ // console.error(error)
+ }
+ },
+
+ clearCommodity: () => {
+ data.curStockID = 0
+ data.form.sku_id = 0
+ data.form.goods_location_id = 0
+ data.form.warehouse_name = ''
+ data.form.location_name = ''
+ data.form.spu_code = ''
+ data.form.spu_name = ''
+ data.form.sku_code = ''
+ data.form.book_qty = 0
+ },
+
+ openSkuSelect: () => {
+ data.showSkuDialogSelect = true
+ },
+
+ closeDialogSelectSku: () => {
+ data.showSkuDialogSelect = false
+ },
+
+ sureSelectSku: (selectRecords: any) => {
+ if (selectRecords.length > 0) {
+ data.form.sku_id = selectRecords[0].sku_id
+ data.form.goods_owner_id = selectRecords[0].goods_owner_id
+ data.form.goods_location_id = selectRecords[0].goods_location_id
+ // The book qty should zero when the data from commodity.
+ data.form.book_qty = 0
+ data.form.spu_code = selectRecords[0].spu_code
+ data.form.spu_name = selectRecords[0].spu_name
+ data.form.sku_code = selectRecords[0].sku_code
+ }
+ },
+
+ openLocationSelect: () => {
+ data.showLocationDialogSelect = true
+ },
+
+ closeDialogSelectLocation: () => {
+ data.showLocationDialogSelect = false
+ },
+
+ sureSelectLocation: (selectRecords: any) => {
+ if (selectRecords.length > 0) {
+ data.form.goods_location_id = selectRecords[0].id
+ data.form.warehouse_name = selectRecords[0].warehouse_name
+ data.form.location_name = selectRecords[0].location_name
+ }
+ },
+
+ clearLocation: () => {
+ data.form.goods_location_id = 0
+ data.form.warehouse_name = ''
+ data.form.location_name = ''
+ },
+
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+
+ const form = method.constructFormBody()
+
+ if (valid) {
+ const { data: res } = await addStockTaking(form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ },
+
+ constructFormBody: () => {
+ let form = { ...data.form }
+ form = removeObjectNull(form)
+
+ return form
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+
+.header {
+ display: flex;
+ margin-bottom: 15px;
+ justify-content: space-between;
+}
+
+.headerBtn {
+}
+.headerTips {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/warehouseWorking/warehouseTaking/number-input.vue b/frontend/src/view/warehouseWorking/warehouseTaking/number-input.vue
index df3e01c..81068b7 100644
--- a/frontend/src/view/warehouseWorking/warehouseTaking/number-input.vue
+++ b/frontend/src/view/warehouseWorking/warehouseTaking/number-input.vue
@@ -1,142 +1,142 @@
-<!-- Warehouse Taking Number Input -->
-<template>
- <v-dialog v-model="isShow" :width="'20%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('router.sideBar.warehouseTaking')}`"></v-toolbar>
- <v-card-text>
- <p class="mb-4" style="color: #999999">{{ $t('wms.warehouseWorking.warehouseTaking.book_qty') }}:{{ data.form.book_qty }}</p>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.counted_qty"
- :label="$t('wms.warehouseWorking.warehouseTaking.counted_qty')"
- :rules="data.rules.counted_qty"
- variant="outlined"
- clearable
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { hookComponent } from '@/components/system/index'
-import { confirmStockTaking } from '@/api/wms/warehouseTaking'
-import { WarehouseTakingVO } from '@/types/WarehouseWorking/WarehouseTaking'
-import { removeObjectNull } from '@/utils/common'
-import { TAKING_JOB_FINISH } from '@/constant/warehouseWorking'
-import i18n from '@/languages/i18n'
-import { IsInteger } from '@/utils/dataVerification/formRule'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: WarehouseTakingVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- showCommodityDialogSelect: false,
- showLocationDialogSelect: false,
-
- form: ref<WarehouseTakingVO>({
- id: 0,
- job_code: '',
- job_status: TAKING_JOB_FINISH,
- sku_id: 0,
- goods_owner_id: 0,
- goods_location_id: 0,
- book_qty: 0,
- counted_qty: 0,
- difference_qty: 0,
- spu_code: '',
- spu_name: '',
- sku_code: '',
- warehouse_name: '',
- location_name: '',
- adjust_status: false,
- handler: '',
- handle_time: ''
- }),
- rules: {
- book_qty: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseTaking.book_qty') }!`
- ],
- counted_qty: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseTaking.counted_qty') }!`,
- (val: number) => IsInteger(val, 'nonNegative') === '' || IsInteger(val, 'nonNegative')
- ]
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
-
- initForm: () => {
- data.form = props.form
- },
-
- submit: async () => {
- const { valid } = await formRef.value.validate()
-
- const form = method.constructFormBody()
-
- if (valid) {
- const { data: res } = await confirmStockTaking(form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- },
-
- constructFormBody: () => {
- let form = { ...data.form }
- form = removeObjectNull(form)
-
- return form
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.initForm()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<!-- Warehouse Taking Number Input -->
+<template>
+ <v-dialog v-model="isShow" :width="'20%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('router.sideBar.warehouseTaking')}`"></v-toolbar>
+ <v-card-text>
+ <p class="mb-4" style="color: #999999">{{ $t('wms.warehouseWorking.warehouseTaking.book_qty') }}:{{ data.form.book_qty }}</p>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.counted_qty"
+ :label="$t('wms.warehouseWorking.warehouseTaking.counted_qty')"
+ :rules="data.rules.counted_qty"
+ variant="outlined"
+ clearable
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { hookComponent } from '@/components/system/index'
+import { confirmStockTaking } from '@/api/wms/warehouseTaking'
+import { WarehouseTakingVO } from '@/types/WarehouseWorking/WarehouseTaking'
+import { removeObjectNull } from '@/utils/common'
+import { TAKING_JOB_FINISH } from '@/constant/warehouseWorking'
+import i18n from '@/languages/i18n'
+import { IsInteger } from '@/utils/dataVerification/formRule'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: WarehouseTakingVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ showCommodityDialogSelect: false,
+ showLocationDialogSelect: false,
+
+ form: ref<WarehouseTakingVO>({
+ id: 0,
+ job_code: '',
+ job_status: TAKING_JOB_FINISH,
+ sku_id: 0,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ book_qty: 0,
+ counted_qty: 0,
+ difference_qty: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ warehouse_name: '',
+ location_name: '',
+ adjust_status: false,
+ handler: '',
+ handle_time: ''
+ }),
+ rules: {
+ book_qty: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseTaking.book_qty') }!`
+ ],
+ counted_qty: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.warehouseWorking.warehouseTaking.counted_qty') }!`,
+ (val: number) => IsInteger(val, 'nonNegative') === '' || IsInteger(val, 'nonNegative')
+ ]
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+
+ initForm: () => {
+ data.form = props.form
+ },
+
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+
+ const form = method.constructFormBody()
+
+ if (valid) {
+ const { data: res } = await confirmStockTaking(form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ },
+
+ constructFormBody: () => {
+ let form = { ...data.form }
+ form = removeObjectNull(form)
+
+ return form
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.initForm()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/warehouseWorking/warehouseTaking/warehouseTaking.vue b/frontend/src/view/warehouseWorking/warehouseTaking/warehouseTaking.vue
index 1059ed0..0508234 100644
--- a/frontend/src/view/warehouseWorking/warehouseTaking/warehouseTaking.vue
+++ b/frontend/src/view/warehouseWorking/warehouseTaking/warehouseTaking.vue
@@ -1,407 +1,407 @@
-<!-- Warehouse Taking -->
-<template>
- <div class="container">
- <div>
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <v-window v-model="data.activeTab">
- <v-window-item>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.job_code"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.warehouseWorking.warehouseTaking.job_code')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="job_code" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.job_code')"></vxe-column>
- <vxe-column field="job_status" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.job_status')">
- <template #default="{ row, column }">
- <span>{{ formatTakingJobStatus(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="spu_code" width="150px" :title="$t('base.commodityManagement.spu_code')"></vxe-column>
- <vxe-column field="spu_name" width="150px" :title="$t('base.commodityManagement.spu_name')"></vxe-column>
- <vxe-column field="sku_code" width="150px" :title="$t('base.commodityManagement.sku_code')"></vxe-column>
- <vxe-column field="warehouse_name" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.warehouse')"></vxe-column>
- <vxe-column field="location_name" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.location_name')"></vxe-column>
- <vxe-column field="book_qty" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.book_qty')"></vxe-column>
- <vxe-column field="counted_qty" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.counted_qty')"></vxe-column>
- <vxe-column field="difference_qty" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.difference_qty')"></vxe-column>
- <vxe-column field="handler" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.handler')"></vxe-column>
- <vxe-column field="handle_time" width="170px" :title="$t('wms.warehouseWorking.warehouseTaking.handle_time')">
- <template #default="{ row, column }">
- <span>{{ formatDate(row[column.property]) }}</span>
- </template>
- </vxe-column>
- <vxe-column field="creator" :title="$t('wms.warehouseWorking.warehouseTaking.creator')"></vxe-column>
- <vxe-column field="create_time" width="170px" :title="$t('wms.warehouseWorking.warehouseTaking.create_time')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="250" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn
- :flat="true"
- icon="mdi-eye-outline"
- :tooltip-text="$t('system.page.view')"
- @click="method.viewRow(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-book-check-outline"
- :tooltip-text="$t('wms.warehouseWorking.warehouseTaking.confirmTaking')"
- :disabled="method.isConfirmTaking(row)"
- @click="method.confirmTaking(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-book-open-outline"
- :tooltip-text="$t('wms.warehouseWorking.warehouseProcessing.confirmAdjust')"
- :disabled="method.confirmAdjustBtnDisabled(row)"
- @click="method.confirmAdjust(row)"
- ></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- :disabled="method.isConfirmTaking(row)"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- </v-window-item>
- </v-window>
- </v-card-text>
- </v-card>
- <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- <number-input
- :show-dialog="data.showDialogNumberInput"
- :form="data.dialogForm"
- @close="method.closeDialogNumberInput"
- @saveSuccess="method.saveSuccessNumberInput"
- />
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, onActivated, watch, nextTick } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { WarehouseTakingVO } from '@/types/WarehouseWorking/WarehouseTaking'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { TAKING_JOB_FINISH, TAKING_JOB_UNFINISH } from '@/constant/warehouseWorking'
-import { deleteStockTaking, getStockTakingList, getStockTakingOne, confirmAdjustment } from '@/api/wms/warehouseTaking'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { formatTakingJobStatus } from '@/utils/format/formatWarehouseWorking'
-import { formatDate } from '@/utils/format/formatSystem'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import addOrUpdateDialog from './add-or-update-taking.vue'
-import numberInput from './number-input.vue'
-import i18n from '@/languages/i18n'
-import customPager from '@/components/custom-pager.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTable = ref()
-
-const data = reactive({
- showDialog: false,
- showDialogNumberInput: false,
- timer: ref<any>(null),
- activeTab: null,
- tableData: ref<WarehouseTakingVO[]>([]),
- dialogForm: ref<WarehouseTakingVO>({
- id: 0,
- job_code: '',
- job_status: TAKING_JOB_FINISH,
- sku_id: 0,
- goods_owner_id: 0,
- goods_location_id: 0,
- book_qty: 0,
- counted_qty: 0,
- difference_qty: 0,
- spu_code: '',
- spu_name: '',
- sku_code: '',
- warehouse_name: '',
- location_name: '',
- handler: '',
- handle_time: '',
- adjust_status: false,
- creator: '',
- create_time: ''
- }),
- searchForm: {
- job_code: ''
- },
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- })
-})
-
-const method = reactive({
- // Open a dialog to add
- add: () => {
- data.dialogForm = {
- id: 0,
- job_code: '',
- job_status: TAKING_JOB_FINISH,
- sku_id: 0,
- goods_owner_id: 0,
- goods_location_id: 0,
- book_qty: 0,
- counted_qty: 0,
- difference_qty: 0,
- spu_code: '',
- spu_name: '',
- sku_code: '',
- warehouse_name: '',
- location_name: '',
- handler: '',
- handle_time: '',
- adjust_status: false,
- creator: '',
- create_time: ''
- }
- nextTick(() => {
- data.showDialog = true
- })
- },
-
- // After add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
-
- // After confirm taking.
- saveSuccessNumberInput: () => {
- method.refresh()
- method.closeDialogNumberInput()
- },
-
- // Refresh data
- refresh: () => {
- method.getStockProcessList()
- },
-
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
-
- // Shut number input dialog
- closeDialogNumberInput: () => {
- data.showDialogNumberInput = false
- },
-
- getStockProcessList: async () => {
- const { data: res } = await getStockTakingList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
-
- viewRow: async (row: WarehouseTakingVO) => {
- await method.getOne(row.id)
- nextTick(() => {
- data.showDialog = true
- })
- },
-
- getOne: async (id: number) => {
- const { data: res } = await getStockTakingOne(id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
-
- data.dialogForm = res.data
- },
-
- deleteRow(row: WarehouseTakingVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteStockTaking(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
-
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
-
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
- method.refresh()
- }),
-
- exportTable: () => {
- const $table = xTable.value
- exportData({
- table: $table,
- filename: i18n.global.t('router.sideBar.warehouseTaking'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
-
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.refresh()
- },
-
- // The btn will become disabled when the 'job_status' is false
- confirmAdjustBtnDisabled: (row: WarehouseTakingVO) => row.job_status === TAKING_JOB_UNFINISH || !!row.adjust_status,
-
- // The btn will become disabled when the 'job_status' is true
- isConfirmTaking: (row: WarehouseTakingVO) => row.job_status === TAKING_JOB_FINISH,
-
- confirmTaking: async (row: WarehouseTakingVO) => {
- data.dialogForm = row
- nextTick(() => {
- data.showDialogNumberInput = true
- })
- },
-
- confirmAdjust: async (row: WarehouseTakingVO) => {
- hookComponent.$dialog({
- content: i18n.global.t('wms.warehouseWorking.warehouseTaking.beforeConfirmAdjust'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await confirmAdjustment(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('wms.warehouseWorking.warehouseTaking.confirmAdjust') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- }
-})
-
-onActivated(() => {
- method.refresh()
-})
-
-const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
-const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
-
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<!-- Warehouse Taking -->
+<template>
+ <div class="container">
+ <div>
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <v-window v-model="data.activeTab">
+ <v-window-item>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add()"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.job_code"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.warehouseWorking.warehouseTaking.job_code')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="job_code" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.job_code')"></vxe-column>
+ <vxe-column field="job_status" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.job_status')">
+ <template #default="{ row, column }">
+ <span>{{ formatTakingJobStatus(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="spu_code" width="150px" :title="$t('base.commodityManagement.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" width="150px" :title="$t('base.commodityManagement.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" width="150px" :title="$t('base.commodityManagement.sku_code')"></vxe-column>
+ <vxe-column field="warehouse_name" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.warehouse')"></vxe-column>
+ <vxe-column field="location_name" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.location_name')"></vxe-column>
+ <vxe-column field="book_qty" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.book_qty')"></vxe-column>
+ <vxe-column field="counted_qty" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.counted_qty')"></vxe-column>
+ <vxe-column field="difference_qty" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.difference_qty')"></vxe-column>
+ <vxe-column field="handler" width="150px" :title="$t('wms.warehouseWorking.warehouseTaking.handler')"></vxe-column>
+ <vxe-column field="handle_time" width="170px" :title="$t('wms.warehouseWorking.warehouseTaking.handle_time')">
+ <template #default="{ row, column }">
+ <span>{{ formatDate(row[column.property]) }}</span>
+ </template>
+ </vxe-column>
+ <vxe-column field="creator" :title="$t('wms.warehouseWorking.warehouseTaking.creator')"></vxe-column>
+ <vxe-column field="create_time" width="170px" :title="$t('wms.warehouseWorking.warehouseTaking.create_time')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="250" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-eye-outline"
+ :tooltip-text="$t('system.page.view')"
+ @click="method.viewRow(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-book-check-outline"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseTaking.confirmTaking')"
+ :disabled="method.isConfirmTaking(row)"
+ @click="method.confirmTaking(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-book-open-outline"
+ :tooltip-text="$t('wms.warehouseWorking.warehouseProcessing.confirmAdjust')"
+ :disabled="method.confirmAdjustBtnDisabled(row)"
+ @click="method.confirmAdjust(row)"
+ ></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ :disabled="method.isConfirmTaking(row)"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ </v-window-item>
+ </v-window>
+ </v-card-text>
+ </v-card>
+ <addOrUpdateDialog :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ <number-input
+ :show-dialog="data.showDialogNumberInput"
+ :form="data.dialogForm"
+ @close="method.closeDialogNumberInput"
+ @saveSuccess="method.saveSuccessNumberInput"
+ />
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, onActivated, watch, nextTick } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { WarehouseTakingVO } from '@/types/WarehouseWorking/WarehouseTaking'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { TAKING_JOB_FINISH, TAKING_JOB_UNFINISH } from '@/constant/warehouseWorking'
+import { deleteStockTaking, getStockTakingList, getStockTakingOne, confirmAdjustment } from '@/api/wms/warehouseTaking'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { formatTakingJobStatus } from '@/utils/format/formatWarehouseWorking'
+import { formatDate } from '@/utils/format/formatSystem'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import addOrUpdateDialog from './add-or-update-taking.vue'
+import numberInput from './number-input.vue'
+import i18n from '@/languages/i18n'
+import customPager from '@/components/custom-pager.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTable = ref()
+
+const data = reactive({
+ showDialog: false,
+ showDialogNumberInput: false,
+ timer: ref<any>(null),
+ activeTab: null,
+ tableData: ref<WarehouseTakingVO[]>([]),
+ dialogForm: ref<WarehouseTakingVO>({
+ id: 0,
+ job_code: '',
+ job_status: TAKING_JOB_FINISH,
+ sku_id: 0,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ book_qty: 0,
+ counted_qty: 0,
+ difference_qty: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ warehouse_name: '',
+ location_name: '',
+ handler: '',
+ handle_time: '',
+ adjust_status: false,
+ creator: '',
+ create_time: ''
+ }),
+ searchForm: {
+ job_code: ''
+ },
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ })
+})
+
+const method = reactive({
+ // Open a dialog to add
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ job_code: '',
+ job_status: TAKING_JOB_FINISH,
+ sku_id: 0,
+ goods_owner_id: 0,
+ goods_location_id: 0,
+ book_qty: 0,
+ counted_qty: 0,
+ difference_qty: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_code: '',
+ warehouse_name: '',
+ location_name: '',
+ handler: '',
+ handle_time: '',
+ adjust_status: false,
+ creator: '',
+ create_time: ''
+ }
+ nextTick(() => {
+ data.showDialog = true
+ })
+ },
+
+ // After add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+
+ // After confirm taking.
+ saveSuccessNumberInput: () => {
+ method.refresh()
+ method.closeDialogNumberInput()
+ },
+
+ // Refresh data
+ refresh: () => {
+ method.getStockProcessList()
+ },
+
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+
+ // Shut number input dialog
+ closeDialogNumberInput: () => {
+ data.showDialogNumberInput = false
+ },
+
+ getStockProcessList: async () => {
+ const { data: res } = await getStockTakingList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+
+ viewRow: async (row: WarehouseTakingVO) => {
+ await method.getOne(row.id)
+ nextTick(() => {
+ data.showDialog = true
+ })
+ },
+
+ getOne: async (id: number) => {
+ const { data: res } = await getStockTakingOne(id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+
+ data.dialogForm = res.data
+ },
+
+ deleteRow(row: WarehouseTakingVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteStockTaking(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+ method.refresh()
+ }),
+
+ exportTable: () => {
+ const $table = xTable.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('router.sideBar.warehouseTaking'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.refresh()
+ },
+
+ // The btn will become disabled when the 'job_status' is false
+ confirmAdjustBtnDisabled: (row: WarehouseTakingVO) => row.job_status === TAKING_JOB_UNFINISH || !!row.adjust_status,
+
+ // The btn will become disabled when the 'job_status' is true
+ isConfirmTaking: (row: WarehouseTakingVO) => row.job_status === TAKING_JOB_FINISH,
+
+ confirmTaking: async (row: WarehouseTakingVO) => {
+ data.dialogForm = row
+ nextTick(() => {
+ data.showDialogNumberInput = true
+ })
+ },
+
+ confirmAdjust: async (row: WarehouseTakingVO) => {
+ hookComponent.$dialog({
+ content: i18n.global.t('wms.warehouseWorking.warehouseTaking.beforeConfirmAdjust'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await confirmAdjustment(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('wms.warehouseWorking.warehouseTaking.confirmAdjust') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ }
+})
+
+onActivated(() => {
+ method.refresh()
+})
+
+const cardHeight = computed(() => computedCardHeight({ hasTab: false }))
+const tableHeight = computed(() => computedTableHeight({ hasTab: false }))
+
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/wms/stockAsn/add-or-update-notice.vue b/frontend/src/view/wms/stockAsn/add-or-update-notice.vue
index 98e7295..9c1262d 100644
--- a/frontend/src/view/wms/stockAsn/add-or-update-notice.vue
+++ b/frontend/src/view/wms/stockAsn/add-or-update-notice.vue
@@ -1,280 +1,280 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('wms.stockAsn.tabNotice')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-select
- v-model="data.form.supplier_name"
- :items="data.combobox.supplier_name"
- item-title="label"
- item-value="label"
- :rules="data.rules.supplier_name"
- :label="$t('wms.stockAsnInfo.supplier_name')"
- variant="outlined"
- clearable
- @update:model-value="method.supplierNameChange"
- ></v-select>
- <v-select
- v-model="data.form.goods_owner_name"
- :items="data.combobox.goods_owner_name"
- item-title="label"
- item-value="label"
- :rules="data.rules.goods_owner_name"
- :label="$t('wms.stockAsnInfo.goods_owner_name')"
- variant="outlined"
- clearable
- @update:model-value="method.goodsOwnerNameChange"
- ></v-select>
- <v-text-field
- v-model="data.form.spu_code"
- :label="$t('wms.stockAsnInfo.spu_code')"
- :rules="data.rules.spu_code"
- variant="outlined"
- readonly
- clearable
- @click="method.openSelect('target')"
- @click:clear="method.clearCommodity"
- ></v-text-field>
- <v-text-field
- v-model="data.form.spu_name"
- :label="$t('wms.stockAsnInfo.spu_name')"
- :rules="data.rules.spu_name"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.sku_code"
- :label="$t('wms.stockAsnInfo.sku_code')"
- :rules="data.rules.sku_code"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.sku_name"
- :label="$t('wms.stockAsnInfo.sku_name')"
- :rules="data.rules.sku_name"
- variant="outlined"
- disabled
- ></v-text-field>
- <v-text-field
- v-model="data.form.asn_qty"
- :label="$t('wms.stockAsnInfo.asn_qty')"
- :rules="data.rules.asn_qty"
- variant="outlined"
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
- <sku-select :show-dialog="data.showSkuDialogSelect" @close="method.closeDialogSelect('target')" @sureSelect="method.sureSelect" />
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { StockAsnVO } from '@/types/WMS/StockAsn'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { addAsn, updateAsn } from '@/api/wms/stockAsn'
-import { getSupplierAll } from '@/api/base/supplier'
-import { getOwnerOfCargoAll } from '@/api/base/ownerOfCargo'
-import skuSelect from '@/components/select/sku-select.vue'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: StockAsnVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => {
- if (props.form.id && props.form.id > 0) {
- return 'update'
- }
- return 'add'
-})
-
-const data = reactive({
- form: ref<StockAsnVO>({
- id: 0,
- asn_no: '',
- asn_status: 0,
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- asn_qty: 0,
- actual_qty: 0,
- sorted_qty: 0,
- shortage_qty: 0,
- more_qty: 0,
- damage_qty: 0,
- weight: 0,
- volume: 0,
- supplier_id: 0,
- supplier_name: '',
- goods_owner_id: 0,
- goods_owner_name: '',
- is_valid: true
- }),
- rules: {
- supplier_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.stockAsnInfo.supplier_name') }!`],
- goods_owner_name: [],
- asn_qty: [],
- spu_code: [],
- spu_name: [],
- sku_code: [],
- sku_name: []
- },
- showSkuDialogSelect: false,
- curSelectType: '',
- combobox: ref<{
- supplier_name: {
- label: string
- value: number
- }[]
- goods_owner_name: {
- label: string
- value: number
- }[]
- }>({
- supplier_name: [],
- goods_owner_name: []
- })
-})
-
-const method = reactive({
- supplierNameChange: (val: string) => {
- if (!val) {
- data.form.supplier_id = 0
- } else {
- data.form.supplier_id = data.combobox.supplier_name.filter((item) => item.label === val)[0].value
- }
- },
- goodsOwnerNameChange: (val: string) => {
- if (!val) {
- data.form.goods_owner_id = 0
- } else {
- data.form.goods_owner_id = data.combobox.goods_owner_name.filter((item) => item.label === val)[0].value
- }
- },
- getCombobox: async () => {
- data.combobox.supplier_name = []
- data.combobox.goods_owner_name = []
- const { data: supplierRes } = await getSupplierAll()
- if (!supplierRes.isSuccess) {
- return
- }
- for (const item of supplierRes.data) {
- if (item.is_valid) {
- data.combobox.supplier_name.push({
- label: item.supplier_name,
- value: item.id
- })
- }
- }
- const { data: goodsOwnerRes } = await getOwnerOfCargoAll()
- if (!goodsOwnerRes.isSuccess) {
- return
- }
- for (const item of goodsOwnerRes.data) {
- if (item.is_valid) {
- data.combobox.goods_owner_name.push({
- label: item.goods_owner_name,
- value: item.id
- })
- }
- }
- },
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- const { data: res } = dialogTitle.value === 'add' ? await addAsn(data.form) : await updateAsn(data.form)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- },
-
- clearCommodity: () => {
- data.form.spu_id = 0
- data.form.spu_code = ''
- data.form.spu_name = ''
- data.form.spu_id = 0
- data.form.sku_code = ''
- data.form.sku_name = ''
- },
- openSelect: (type: string) => {
- data.curSelectType = type
-
- if (type === 'target') {
- data.showSkuDialogSelect = true
- }
- },
- closeDialogSelect: (type: string) => {
- if (type === 'target') {
- data.showSkuDialogSelect = false
- }
- },
- sureSelect: (selectRecords: any) => {
- if (data.curSelectType === 'target') {
- data.form.spu_id = selectRecords[0].spu_id
- data.form.spu_code = selectRecords[0].spu_code
- data.form.spu_name = selectRecords[0].spu_name
- data.form.sku_id = selectRecords[0].sku_id
- data.form.sku_code = selectRecords[0].sku_code
- data.form.sku_name = selectRecords[0].sku_name
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- method.getCombobox()
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('wms.stockAsn.tabNotice')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-select
+ v-model="data.form.supplier_name"
+ :items="data.combobox.supplier_name"
+ item-title="label"
+ item-value="label"
+ :rules="data.rules.supplier_name"
+ :label="$t('wms.stockAsnInfo.supplier_name')"
+ variant="outlined"
+ clearable
+ @update:model-value="method.supplierNameChange"
+ ></v-select>
+ <v-select
+ v-model="data.form.goods_owner_name"
+ :items="data.combobox.goods_owner_name"
+ item-title="label"
+ item-value="label"
+ :rules="data.rules.goods_owner_name"
+ :label="$t('wms.stockAsnInfo.goods_owner_name')"
+ variant="outlined"
+ clearable
+ @update:model-value="method.goodsOwnerNameChange"
+ ></v-select>
+ <v-text-field
+ v-model="data.form.spu_code"
+ :label="$t('wms.stockAsnInfo.spu_code')"
+ :rules="data.rules.spu_code"
+ variant="outlined"
+ readonly
+ clearable
+ @click="method.openSelect('target')"
+ @click:clear="method.clearCommodity"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.spu_name"
+ :label="$t('wms.stockAsnInfo.spu_name')"
+ :rules="data.rules.spu_name"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.sku_code"
+ :label="$t('wms.stockAsnInfo.sku_code')"
+ :rules="data.rules.sku_code"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.sku_name"
+ :label="$t('wms.stockAsnInfo.sku_name')"
+ :rules="data.rules.sku_name"
+ variant="outlined"
+ disabled
+ ></v-text-field>
+ <v-text-field
+ v-model="data.form.asn_qty"
+ :label="$t('wms.stockAsnInfo.asn_qty')"
+ :rules="data.rules.asn_qty"
+ variant="outlined"
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+ <sku-select :show-dialog="data.showSkuDialogSelect" @close="method.closeDialogSelect('target')" @sureSelect="method.sureSelect" />
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { StockAsnVO } from '@/types/WMS/StockAsn'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { addAsn, updateAsn } from '@/api/wms/stockAsn'
+import { getSupplierAll } from '@/api/base/supplier'
+import { getOwnerOfCargoAll } from '@/api/base/ownerOfCargo'
+import skuSelect from '@/components/select/sku-select.vue'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: StockAsnVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => {
+ if (props.form.id && props.form.id > 0) {
+ return 'update'
+ }
+ return 'add'
+})
+
+const data = reactive({
+ form: ref<StockAsnVO>({
+ id: 0,
+ asn_no: '',
+ asn_status: 0,
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ asn_qty: 0,
+ actual_qty: 0,
+ sorted_qty: 0,
+ shortage_qty: 0,
+ more_qty: 0,
+ damage_qty: 0,
+ weight: 0,
+ volume: 0,
+ supplier_id: 0,
+ supplier_name: '',
+ goods_owner_id: 0,
+ goods_owner_name: '',
+ is_valid: true
+ }),
+ rules: {
+ supplier_name: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.stockAsnInfo.supplier_name') }!`],
+ goods_owner_name: [],
+ asn_qty: [],
+ spu_code: [],
+ spu_name: [],
+ sku_code: [],
+ sku_name: []
+ },
+ showSkuDialogSelect: false,
+ curSelectType: '',
+ combobox: ref<{
+ supplier_name: {
+ label: string
+ value: number
+ }[]
+ goods_owner_name: {
+ label: string
+ value: number
+ }[]
+ }>({
+ supplier_name: [],
+ goods_owner_name: []
+ })
+})
+
+const method = reactive({
+ supplierNameChange: (val: string) => {
+ if (!val) {
+ data.form.supplier_id = 0
+ } else {
+ data.form.supplier_id = data.combobox.supplier_name.filter((item) => item.label === val)[0].value
+ }
+ },
+ goodsOwnerNameChange: (val: string) => {
+ if (!val) {
+ data.form.goods_owner_id = 0
+ } else {
+ data.form.goods_owner_id = data.combobox.goods_owner_name.filter((item) => item.label === val)[0].value
+ }
+ },
+ getCombobox: async () => {
+ data.combobox.supplier_name = []
+ data.combobox.goods_owner_name = []
+ const { data: supplierRes } = await getSupplierAll()
+ if (!supplierRes.isSuccess) {
+ return
+ }
+ for (const item of supplierRes.data) {
+ if (item.is_valid) {
+ data.combobox.supplier_name.push({
+ label: item.supplier_name,
+ value: item.id
+ })
+ }
+ }
+ const { data: goodsOwnerRes } = await getOwnerOfCargoAll()
+ if (!goodsOwnerRes.isSuccess) {
+ return
+ }
+ for (const item of goodsOwnerRes.data) {
+ if (item.is_valid) {
+ data.combobox.goods_owner_name.push({
+ label: item.goods_owner_name,
+ value: item.id
+ })
+ }
+ }
+ },
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ const { data: res } = dialogTitle.value === 'add' ? await addAsn(data.form) : await updateAsn(data.form)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ },
+
+ clearCommodity: () => {
+ data.form.spu_id = 0
+ data.form.spu_code = ''
+ data.form.spu_name = ''
+ data.form.spu_id = 0
+ data.form.sku_code = ''
+ data.form.sku_name = ''
+ },
+ openSelect: (type: string) => {
+ data.curSelectType = type
+
+ if (type === 'target') {
+ data.showSkuDialogSelect = true
+ }
+ },
+ closeDialogSelect: (type: string) => {
+ if (type === 'target') {
+ data.showSkuDialogSelect = false
+ }
+ },
+ sureSelect: (selectRecords: any) => {
+ if (data.curSelectType === 'target') {
+ data.form.spu_id = selectRecords[0].spu_id
+ data.form.spu_code = selectRecords[0].spu_code
+ data.form.spu_name = selectRecords[0].spu_name
+ data.form.sku_id = selectRecords[0].sku_id
+ data.form.sku_code = selectRecords[0].sku_code
+ data.form.sku_name = selectRecords[0].sku_name
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ method.getCombobox()
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/wms/stockAsn/sku-info.vue b/frontend/src/view/wms/stockAsn/sku-info.vue
index 29d50b0..511dd5a 100644
--- a/frontend/src/view/wms/stockAsn/sku-info.vue
+++ b/frontend/src/view/wms/stockAsn/sku-info.vue
@@ -1,139 +1,139 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <!-- <v-toolbar color="white" :title="`${$t('wms.stockAsn.tabNotice')}`"></v-toolbar> -->
- <v-card-text>
- <v-list-item two-line>
- <v-list-item-content>
- <v-list-item-title>{{ i18n.global.t('wms.skuInfo.spu_name') + ':' + data.tableData.spu_name }}</v-list-item-title>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.sku_code') + ':' + data.tableData.sku_code }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.sku_name') + ':' + data.tableData.sku_name }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.spu_description') + ':' + data.tableData.spu_description }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.category_name') + ':' + data.tableData.category_name }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.brand') + ':' + data.tableData.brand }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.origin') + ':' + data.tableData.origin }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.unit') + ':' + data.tableData.unit }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.cost') + ':' + data.tableData.cost }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.bar_code') + ':' + data.tableData.bar_code }}</v-list-item-subtitle>
- </v-list-item-content>
- </v-list-item>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { StockAsnVO, SkuInfoVo } from '@/types/WMS/StockAsn'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { getSkuInfo } from '@/api/wms/stockAsn'
-
-const formRef = ref()
-const emit = defineEmits(['close'])
-
-const props = defineProps<{
- showDialog: boolean
- form: StockAsnVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- form: ref<StockAsnVO>({
- id: 0,
- asn_no: '',
- asn_status: 0,
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- asn_qty: 0,
- actual_qty: 0,
- sorted_qty: 0,
- shortage_qty: 0,
- more_qty: 0,
- damage_qty: 0,
- weight: 0,
- volume: 0,
- supplier_id: 0,
- supplier_name: '',
- goods_owner_id: 0,
- goods_owner_name: '',
- is_valid: true
- }),
- tableData: ref<SkuInfoVo>({
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- category_id: 0,
- category_name: '',
- spu_description: '',
- bar_code: '',
- supplier_id: 0,
- supplier_name: '',
- brand: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- weight: 0,
- lenght: 0,
- width: 0,
- height: 0,
- volume: 0,
- unit: '',
- cost: 0,
- price: 0
- })
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- getStockAsnList: async () => {
- const { data: res } = await getSkuInfo(data.form.sku_id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.form = props.form
- method.getStockAsnList()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <!-- <v-toolbar color="white" :title="`${$t('wms.stockAsn.tabNotice')}`"></v-toolbar> -->
+ <v-card-text>
+ <v-list-item two-line>
+ <v-list-item-content>
+ <v-list-item-title>{{ i18n.global.t('wms.skuInfo.spu_name') + ':' + data.tableData.spu_name }}</v-list-item-title>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.sku_code') + ':' + data.tableData.sku_code }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.sku_name') + ':' + data.tableData.sku_name }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.spu_description') + ':' + data.tableData.spu_description }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.category_name') + ':' + data.tableData.category_name }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.brand') + ':' + data.tableData.brand }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.origin') + ':' + data.tableData.origin }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.unit') + ':' + data.tableData.unit }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.cost') + ':' + data.tableData.cost }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.bar_code') + ':' + data.tableData.bar_code }}</v-list-item-subtitle>
+ </v-list-item-content>
+ </v-list-item>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { StockAsnVO, SkuInfoVo } from '@/types/WMS/StockAsn'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { getSkuInfo } from '@/api/wms/stockAsn'
+
+const formRef = ref()
+const emit = defineEmits(['close'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: StockAsnVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ form: ref<StockAsnVO>({
+ id: 0,
+ asn_no: '',
+ asn_status: 0,
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ asn_qty: 0,
+ actual_qty: 0,
+ sorted_qty: 0,
+ shortage_qty: 0,
+ more_qty: 0,
+ damage_qty: 0,
+ weight: 0,
+ volume: 0,
+ supplier_id: 0,
+ supplier_name: '',
+ goods_owner_id: 0,
+ goods_owner_name: '',
+ is_valid: true
+ }),
+ tableData: ref<SkuInfoVo>({
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ category_id: 0,
+ category_name: '',
+ spu_description: '',
+ bar_code: '',
+ supplier_id: 0,
+ supplier_name: '',
+ brand: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ weight: 0,
+ lenght: 0,
+ width: 0,
+ height: 0,
+ volume: 0,
+ unit: '',
+ cost: 0,
+ price: 0
+ })
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ getStockAsnList: async () => {
+ const { data: res } = await getSkuInfo(data.form.sku_id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.form = props.form
+ method.getStockAsnList()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/wms/stockAsn/stockAsn.vue b/frontend/src/view/wms/stockAsn/stockAsn.vue
index dc2007b..6f946f2 100644
--- a/frontend/src/view/wms/stockAsn/stockAsn.vue
+++ b/frontend/src/view/wms/stockAsn/stockAsn.vue
@@ -1,158 +1,158 @@
-<!-- Warehouse Setting -->
-<template>
- <div class="container">
- <div>
- <v-tabs v-model="data.activeTab" stacked @update:model-value="method.changeTabs">
- <v-tab v-for="(item, index) of tabsConfig" :key="index" :value="item.value">
- <v-icon>{{ item.icon }}</v-icon>
- <p class="tabItemTitle">{{ item.tabName }}</p>
- </v-tab>
- </v-tabs>
-
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <v-window v-model="data.activeTab">
- <v-window-item value="tabNotice">
- <tabNotice ref="tabNoticeRef" />
- </v-window-item>
- <v-window-item value="tabToDoArrival">
- <tabToDoArrival ref="tabToDoArrivalRef" />
- </v-window-item>
- <v-window-item value="tabToDoUnload">
- <tabToDoUnload ref="tabToDoUnloadRef" />
- </v-window-item>
- <v-window-item value="tabToDoSorting">
- <tabToDoSorting ref="tabToDoSortingRef" />
- </v-window-item>
- <v-window-item value="tabToDoGrounding">
- <tabToDoGrounding ref="tabToDoGroundingRef" />
- </v-window-item>
- <v-window-item value="tabReceiptDetails">
- <tabReceiptDetails ref="tabReceiptDetailsRef" />
- </v-window-item>
- </v-window>
- </v-card-text>
- </v-card>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { ref, reactive, onMounted, watch, nextTick } from 'vue'
-import i18n from '@/languages/i18n'
-import tabNotice from './tabNotice.vue'
-import tabToDoArrival from './tabToDoArrival.vue'
-import tabToDoUnload from './tabToDoUnload.vue'
-import tabToDoSorting from './tabToDoSorting.vue'
-import tabToDoGrounding from './tabToDoGrounding.vue'
-import tabReceiptDetails from './tabReceiptDetails.vue'
-
-const tabNoticeRef = ref()
-const tabToDoArrivalRef = ref()
-const tabToDoUnloadRef = ref()
-const tabToDoSortingRef = ref()
-const tabToDoGroundingRef = ref()
-const tabReceiptDetailsRef = ref()
-
-const tabsConfig = [
- {
- value: 'tabNotice',
- icon: 'mdi-checkbox-blank-badge',
- tabName: i18n.global.t('wms.stockAsn.tabNotice')
- },
- {
- value: 'tabToDoArrival',
- icon: 'mdi-truck-cargo-container',
- tabName: i18n.global.t('wms.stockAsn.tabToDoArrival')
- },
- {
- value: 'tabToDoUnload',
- icon: 'mdi-truck-outline',
- tabName: i18n.global.t('wms.stockAsn.tabToDoUnload')
- },
- {
- value: 'tabToDoSorting',
- icon: 'mdi-dolly',
- tabName: i18n.global.t('wms.stockAsn.tabToDoSorting')
- },
- {
- value: 'tabToDoGrounding',
- icon: 'mdi-grid',
- tabName: i18n.global.t('wms.stockAsn.tabToDoGrounding')
- },
- {
- value: 'tabReceiptDetails',
- icon: 'mdi-file-cabinet',
- tabName: i18n.global.t('wms.stockAsn.tabReceiptDetails')
- }
-]
-
-const data = reactive({
- activeTab: '',
- isLoadNotice: false,
- isLoadToDoArrival: false,
- isLoadToDoUnload: false,
- isLoadToDoSorting: false,
- isLoadToDoGrounding: false,
- isLoadReceiptDetails: false
-})
-
-const method = reactive({
- changeTabs: (e: any): void => {
- nextTick(() => {
- switch (e) {
- case 'tabNotice':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabNoticeRef?.value?.getStockAsnList) {
- tabNoticeRef.value.getStockAsnList()
- }
- break
- case 'tabToDoArrival':
- if (tabToDoArrivalRef?.value?.getStockAsnList) {
- tabToDoArrivalRef.value.getStockAsnList()
- }
- break
- case 'tabToDoUnload':
- if (tabToDoUnloadRef?.value?.getStockAsnList) {
- tabToDoUnloadRef.value.getStockAsnList()
- }
- break
- case 'tabToDoSorting':
- if (tabToDoSortingRef?.value?.getStockAsnList) {
- tabToDoSortingRef.value.getStockAsnList()
- }
- break
- case 'tabToDoGrounding':
- if (tabToDoGroundingRef?.value?.getStockAsnList) {
- tabToDoGroundingRef.value.getStockAsnList()
- }
- break
- case 'tabReceiptDetails':
- if (tabReceiptDetailsRef?.value?.getStockAsnList) {
- tabReceiptDetailsRef.value.getStockAsnList()
- }
- break
- }
- })
- }
-})
-
-onMounted(() => {})
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<!-- Warehouse Setting -->
+<template>
+ <div class="container">
+ <div>
+ <v-tabs v-model="data.activeTab" stacked @update:model-value="method.changeTabs">
+ <v-tab v-for="(item, index) of tabsConfig" :key="index" :value="item.value">
+ <v-icon>{{ item.icon }}</v-icon>
+ <p class="tabItemTitle">{{ item.tabName }}</p>
+ </v-tab>
+ </v-tabs>
+
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <v-window v-model="data.activeTab">
+ <v-window-item value="tabNotice">
+ <tabNotice ref="tabNoticeRef" />
+ </v-window-item>
+ <v-window-item value="tabToDoArrival">
+ <tabToDoArrival ref="tabToDoArrivalRef" />
+ </v-window-item>
+ <v-window-item value="tabToDoUnload">
+ <tabToDoUnload ref="tabToDoUnloadRef" />
+ </v-window-item>
+ <v-window-item value="tabToDoSorting">
+ <tabToDoSorting ref="tabToDoSortingRef" />
+ </v-window-item>
+ <v-window-item value="tabToDoGrounding">
+ <tabToDoGrounding ref="tabToDoGroundingRef" />
+ </v-window-item>
+ <v-window-item value="tabReceiptDetails">
+ <tabReceiptDetails ref="tabReceiptDetailsRef" />
+ </v-window-item>
+ </v-window>
+ </v-card-text>
+ </v-card>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { ref, reactive, onMounted, watch, nextTick } from 'vue'
+import i18n from '@/languages/i18n'
+import tabNotice from './tabNotice.vue'
+import tabToDoArrival from './tabToDoArrival.vue'
+import tabToDoUnload from './tabToDoUnload.vue'
+import tabToDoSorting from './tabToDoSorting.vue'
+import tabToDoGrounding from './tabToDoGrounding.vue'
+import tabReceiptDetails from './tabReceiptDetails.vue'
+
+const tabNoticeRef = ref()
+const tabToDoArrivalRef = ref()
+const tabToDoUnloadRef = ref()
+const tabToDoSortingRef = ref()
+const tabToDoGroundingRef = ref()
+const tabReceiptDetailsRef = ref()
+
+const tabsConfig = [
+ {
+ value: 'tabNotice',
+ icon: 'mdi-checkbox-blank-badge',
+ tabName: i18n.global.t('wms.stockAsn.tabNotice')
+ },
+ {
+ value: 'tabToDoArrival',
+ icon: 'mdi-truck-cargo-container',
+ tabName: i18n.global.t('wms.stockAsn.tabToDoArrival')
+ },
+ {
+ value: 'tabToDoUnload',
+ icon: 'mdi-truck-outline',
+ tabName: i18n.global.t('wms.stockAsn.tabToDoUnload')
+ },
+ {
+ value: 'tabToDoSorting',
+ icon: 'mdi-dolly',
+ tabName: i18n.global.t('wms.stockAsn.tabToDoSorting')
+ },
+ {
+ value: 'tabToDoGrounding',
+ icon: 'mdi-grid',
+ tabName: i18n.global.t('wms.stockAsn.tabToDoGrounding')
+ },
+ {
+ value: 'tabReceiptDetails',
+ icon: 'mdi-file-cabinet',
+ tabName: i18n.global.t('wms.stockAsn.tabReceiptDetails')
+ }
+]
+
+const data = reactive({
+ activeTab: '',
+ isLoadNotice: false,
+ isLoadToDoArrival: false,
+ isLoadToDoUnload: false,
+ isLoadToDoSorting: false,
+ isLoadToDoGrounding: false,
+ isLoadReceiptDetails: false
+})
+
+const method = reactive({
+ changeTabs: (e: any): void => {
+ nextTick(() => {
+ switch (e) {
+ case 'tabNotice':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabNoticeRef?.value?.getStockAsnList) {
+ tabNoticeRef.value.getStockAsnList()
+ }
+ break
+ case 'tabToDoArrival':
+ if (tabToDoArrivalRef?.value?.getStockAsnList) {
+ tabToDoArrivalRef.value.getStockAsnList()
+ }
+ break
+ case 'tabToDoUnload':
+ if (tabToDoUnloadRef?.value?.getStockAsnList) {
+ tabToDoUnloadRef.value.getStockAsnList()
+ }
+ break
+ case 'tabToDoSorting':
+ if (tabToDoSortingRef?.value?.getStockAsnList) {
+ tabToDoSortingRef.value.getStockAsnList()
+ }
+ break
+ case 'tabToDoGrounding':
+ if (tabToDoGroundingRef?.value?.getStockAsnList) {
+ tabToDoGroundingRef.value.getStockAsnList()
+ }
+ break
+ case 'tabReceiptDetails':
+ if (tabReceiptDetailsRef?.value?.getStockAsnList) {
+ tabReceiptDetailsRef.value.getStockAsnList()
+ }
+ break
+ }
+ })
+ }
+})
+
+onMounted(() => {})
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/wms/stockAsn/tabNotice.vue b/frontend/src/view/wms/stockAsn/tabNotice.vue
index 93c6ed8..4e63e7d 100644
--- a/frontend/src/view/wms/stockAsn/tabNotice.vue
+++ b/frontend/src/view/wms/stockAsn/tabNotice.vue
@@ -1,317 +1,317 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add"></tooltip-btn>
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.supplier_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockAsnInfo.supplier_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.sku_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockAsnInfo.sku_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="asn_no" :title="$t('wms.stockAsnInfo.asn_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.stockAsnInfo.spu_code')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.stockAsnInfo.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.stockAsnInfo.sku_code')">
- <template #default="{ row }">
- <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
- </template>
- </vxe-column>
- <vxe-column field="sku_name" :title="$t('wms.stockAsnInfo.sku_name')"></vxe-column>
- <vxe-column field="goods_owner_name" :title="$t('wms.stockAsnInfo.goods_owner_name')"></vxe-column>
- <vxe-column field="supplier_name" :title="$t('wms.stockAsnInfo.supplier_name')"></vxe-column>
- <vxe-column field="asn_qty" :title="$t('wms.stockAsnInfo.asn_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.stockAsnInfo.weight')"></vxe-column>
- <vxe-column field="volume" :title="$t('wms.stockAsnInfo.volume')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn :flat="true" icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editRow(row)"></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <addOrUpdateNotice :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- <skuInfo :show-dialog="data.showDialogShowInfo" :form="data.dialogForm" @close="method.closeDialogShowInfo" />
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { StockAsnVO } from '@/types/WMS/StockAsn'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { getStockAsnList, deleteAsn } from '@/api/wms/stockAsn'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import addOrUpdateNotice from './add-or-update-notice.vue'
-import customPager from '@/components/custom-pager.vue'
-import skuInfo from './sku-info.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTableStockLocation = ref()
-
-const data = reactive({
- showDialog: false,
- showDialogShowInfo: false,
- searchForm: {
- supplier_name: '',
- sku_name: ''
- },
- dialogForm: ref<StockAsnVO>({
- id: 0,
- asn_no: '',
- asn_status: 0,
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- asn_qty: 0,
- actual_qty: 0,
- sorted_qty: 0,
- shortage_qty: 0,
- more_qty: 0,
- damage_qty: 0,
- weight: 0,
- volume: 0,
- supplier_id: 0,
- supplier_name: '',
- goods_owner_id: 0,
- goods_owner_name: '',
- is_valid: true
- }),
- activeTab: null,
- tableData: ref<StockAsnVO[]>([]),
- tablePage: reactive({
- total: 0,
- sqlTitle: 'asn_status:0',
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- timer: ref<any>(null)
-})
-
-const method = reactive({
- closeDialogShowInfo: () => {
- data.showDialogShowInfo = false
- },
- showSkuInfo(row: StockAsnVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialogShowInfo = true
- },
- // Open a dialog to add
- add: () => {
- data.dialogForm = {
- id: 0,
- asn_no: '',
- asn_status: 0,
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- asn_qty: 0,
- actual_qty: 0,
- sorted_qty: 0,
- shortage_qty: 0,
- more_qty: 0,
- damage_qty: 0,
- weight: 0,
- volume: 0,
- supplier_id: 0,
- supplier_name: '',
- goods_owner_id: 0,
- goods_owner_name: '',
- is_valid: true
- }
- data.showDialog = true
- },
- editRow(row: StockAsnVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: StockAsnVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await deleteAsn(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // After add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- // Refresh data
- refresh: () => {
- method.getStockAsnList()
- },
- getStockAsnList: async () => {
- const { data: res } = await getStockAsnList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getStockAsnList()
- }),
- exportTable: () => {
- const $table = xTableStockLocation.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.stockAsn.tabNotice'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getStockAsnList()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-defineExpose({
- getStockAsnList: method.getStockAsnList
-})
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-plus" :tooltip-text="$t('system.page.add')" @click="method.add"></tooltip-btn>
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.supplier_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockAsnInfo.supplier_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.sku_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockAsnInfo.sku_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="asn_no" :title="$t('wms.stockAsnInfo.asn_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.stockAsnInfo.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.stockAsnInfo.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.stockAsnInfo.sku_code')">
+ <template #default="{ row }">
+ <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
+ </template>
+ </vxe-column>
+ <vxe-column field="sku_name" :title="$t('wms.stockAsnInfo.sku_name')"></vxe-column>
+ <vxe-column field="goods_owner_name" :title="$t('wms.stockAsnInfo.goods_owner_name')"></vxe-column>
+ <vxe-column field="supplier_name" :title="$t('wms.stockAsnInfo.supplier_name')"></vxe-column>
+ <vxe-column field="asn_qty" :title="$t('wms.stockAsnInfo.asn_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.stockAsnInfo.weight')"></vxe-column>
+ <vxe-column field="volume" :title="$t('wms.stockAsnInfo.volume')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn :flat="true" icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editRow(row)"></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <addOrUpdateNotice :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ <skuInfo :show-dialog="data.showDialogShowInfo" :form="data.dialogForm" @close="method.closeDialogShowInfo" />
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { StockAsnVO } from '@/types/WMS/StockAsn'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { getStockAsnList, deleteAsn } from '@/api/wms/stockAsn'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import addOrUpdateNotice from './add-or-update-notice.vue'
+import customPager from '@/components/custom-pager.vue'
+import skuInfo from './sku-info.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTableStockLocation = ref()
+
+const data = reactive({
+ showDialog: false,
+ showDialogShowInfo: false,
+ searchForm: {
+ supplier_name: '',
+ sku_name: ''
+ },
+ dialogForm: ref<StockAsnVO>({
+ id: 0,
+ asn_no: '',
+ asn_status: 0,
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ asn_qty: 0,
+ actual_qty: 0,
+ sorted_qty: 0,
+ shortage_qty: 0,
+ more_qty: 0,
+ damage_qty: 0,
+ weight: 0,
+ volume: 0,
+ supplier_id: 0,
+ supplier_name: '',
+ goods_owner_id: 0,
+ goods_owner_name: '',
+ is_valid: true
+ }),
+ activeTab: null,
+ tableData: ref<StockAsnVO[]>([]),
+ tablePage: reactive({
+ total: 0,
+ sqlTitle: 'asn_status:0',
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ closeDialogShowInfo: () => {
+ data.showDialogShowInfo = false
+ },
+ showSkuInfo(row: StockAsnVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialogShowInfo = true
+ },
+ // Open a dialog to add
+ add: () => {
+ data.dialogForm = {
+ id: 0,
+ asn_no: '',
+ asn_status: 0,
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ asn_qty: 0,
+ actual_qty: 0,
+ sorted_qty: 0,
+ shortage_qty: 0,
+ more_qty: 0,
+ damage_qty: 0,
+ weight: 0,
+ volume: 0,
+ supplier_id: 0,
+ supplier_name: '',
+ goods_owner_id: 0,
+ goods_owner_name: '',
+ is_valid: true
+ }
+ data.showDialog = true
+ },
+ editRow(row: StockAsnVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: StockAsnVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await deleteAsn(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // After add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ // Refresh data
+ refresh: () => {
+ method.getStockAsnList()
+ },
+ getStockAsnList: async () => {
+ const { data: res } = await getStockAsnList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getStockAsnList()
+ }),
+ exportTable: () => {
+ const $table = xTableStockLocation.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.stockAsn.tabNotice'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getStockAsnList()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+defineExpose({
+ getStockAsnList: method.getStockAsnList
+})
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/wms/stockAsn/tabReceiptDetails.vue b/frontend/src/view/wms/stockAsn/tabReceiptDetails.vue
index 84cf1ac..628c8ac 100644
--- a/frontend/src/view/wms/stockAsn/tabReceiptDetails.vue
+++ b/frontend/src/view/wms/stockAsn/tabReceiptDetails.vue
@@ -1,240 +1,240 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.supplier_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockAsnInfo.supplier_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.sku_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockAsnInfo.sku_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="asn_no" :title="$t('wms.stockAsnInfo.asn_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.stockAsnInfo.spu_code')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.stockAsnInfo.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.stockAsnInfo.sku_code')">
- <template #default="{ row }">
- <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
- </template>
- </vxe-column>
- <vxe-column field="sku_name" :title="$t('wms.stockAsnInfo.sku_name')"></vxe-column>
- <vxe-column field="goods_owner_name" :title="$t('wms.stockAsnInfo.goods_owner_name')"></vxe-column>
- <vxe-column field="supplier_name" :title="$t('wms.stockAsnInfo.supplier_name')"></vxe-column>
- <vxe-column field="asn_qty" :title="$t('wms.stockAsnInfo.asn_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.stockAsnInfo.weight')"></vxe-column>
- <vxe-column field="volume" :title="$t('wms.stockAsnInfo.volume')"></vxe-column>
- <vxe-column field="actual_qty" :title="$t('wms.stockAsnInfo.actual_qty')"></vxe-column>
- <vxe-column field="sorted_qty" :title="$t('wms.stockAsnInfo.sorted_qty')"></vxe-column>
- <vxe-column field="shortage_qty" :title="$t('wms.stockAsnInfo.shortage_qty')"></vxe-column>
- <vxe-column field="more_qty" :title="$t('wms.stockAsnInfo.more_qty')"></vxe-column>
- <vxe-column field="damage_qty" :title="$t('wms.stockAsnInfo.damage_qty')"></vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <skuInfo :show-dialog="data.showDialogShowInfo" :form="data.dialogForm" @close="method.closeDialogShowInfo" />
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { StockAsnVO } from '@/types/WMS/StockAsn'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { getStockAsnList } from '@/api/wms/stockAsn'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import customPager from '@/components/custom-pager.vue'
-import skuInfo from './sku-info.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTableStockLocation = ref()
-
-const data = reactive({
- showDialog: false,
- showDialogShowInfo: false,
- searchForm: {
- supplier_name: '',
- sku_name: ''
- },
- activeTab: null,
- tableData: ref<StockAsnVO[]>([]),
- dialogForm: ref<StockAsnVO>({
- id: 0,
- asn_no: '',
- asn_status: 0,
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- asn_qty: 0,
- actual_qty: 0,
- sorted_qty: 0,
- shortage_qty: 0,
- more_qty: 0,
- damage_qty: 0,
- weight: 0,
- volume: 0,
- supplier_id: 0,
- supplier_name: '',
- goods_owner_id: 0,
- goods_owner_name: '',
- is_valid: true
- }),
- tablePage: reactive({
- total: 0,
- sqlTitle: 'asn_status:4',
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- timer: ref<any>(null)
-})
-
-const method = reactive({
- closeDialogShowInfo: () => {
- data.showDialogShowInfo = false
- },
- showSkuInfo(row: StockAsnVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialogShowInfo = true
- },
- // Refresh data
- refresh: () => {
- method.getStockAsnList()
- },
- getStockAsnList: async () => {
- const { data: res } = await getStockAsnList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getStockAsnList()
- }),
- exportTable: () => {
- const $table = xTableStockLocation.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.stockAsn.tabReceiptDetails'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getStockAsnList()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-defineExpose({
- getStockAsnList: method.getStockAsnList
-})
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.supplier_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockAsnInfo.supplier_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.sku_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockAsnInfo.sku_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="asn_no" :title="$t('wms.stockAsnInfo.asn_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.stockAsnInfo.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.stockAsnInfo.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.stockAsnInfo.sku_code')">
+ <template #default="{ row }">
+ <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
+ </template>
+ </vxe-column>
+ <vxe-column field="sku_name" :title="$t('wms.stockAsnInfo.sku_name')"></vxe-column>
+ <vxe-column field="goods_owner_name" :title="$t('wms.stockAsnInfo.goods_owner_name')"></vxe-column>
+ <vxe-column field="supplier_name" :title="$t('wms.stockAsnInfo.supplier_name')"></vxe-column>
+ <vxe-column field="asn_qty" :title="$t('wms.stockAsnInfo.asn_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.stockAsnInfo.weight')"></vxe-column>
+ <vxe-column field="volume" :title="$t('wms.stockAsnInfo.volume')"></vxe-column>
+ <vxe-column field="actual_qty" :title="$t('wms.stockAsnInfo.actual_qty')"></vxe-column>
+ <vxe-column field="sorted_qty" :title="$t('wms.stockAsnInfo.sorted_qty')"></vxe-column>
+ <vxe-column field="shortage_qty" :title="$t('wms.stockAsnInfo.shortage_qty')"></vxe-column>
+ <vxe-column field="more_qty" :title="$t('wms.stockAsnInfo.more_qty')"></vxe-column>
+ <vxe-column field="damage_qty" :title="$t('wms.stockAsnInfo.damage_qty')"></vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <skuInfo :show-dialog="data.showDialogShowInfo" :form="data.dialogForm" @close="method.closeDialogShowInfo" />
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { StockAsnVO } from '@/types/WMS/StockAsn'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { getStockAsnList } from '@/api/wms/stockAsn'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import customPager from '@/components/custom-pager.vue'
+import skuInfo from './sku-info.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTableStockLocation = ref()
+
+const data = reactive({
+ showDialog: false,
+ showDialogShowInfo: false,
+ searchForm: {
+ supplier_name: '',
+ sku_name: ''
+ },
+ activeTab: null,
+ tableData: ref<StockAsnVO[]>([]),
+ dialogForm: ref<StockAsnVO>({
+ id: 0,
+ asn_no: '',
+ asn_status: 0,
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ asn_qty: 0,
+ actual_qty: 0,
+ sorted_qty: 0,
+ shortage_qty: 0,
+ more_qty: 0,
+ damage_qty: 0,
+ weight: 0,
+ volume: 0,
+ supplier_id: 0,
+ supplier_name: '',
+ goods_owner_id: 0,
+ goods_owner_name: '',
+ is_valid: true
+ }),
+ tablePage: reactive({
+ total: 0,
+ sqlTitle: 'asn_status:4',
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ closeDialogShowInfo: () => {
+ data.showDialogShowInfo = false
+ },
+ showSkuInfo(row: StockAsnVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialogShowInfo = true
+ },
+ // Refresh data
+ refresh: () => {
+ method.getStockAsnList()
+ },
+ getStockAsnList: async () => {
+ const { data: res } = await getStockAsnList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getStockAsnList()
+ }),
+ exportTable: () => {
+ const $table = xTableStockLocation.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.stockAsn.tabReceiptDetails'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getStockAsnList()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+defineExpose({
+ getStockAsnList: method.getStockAsnList
+})
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/wms/stockAsn/tabToDoArrival.vue b/frontend/src/view/wms/stockAsn/tabToDoArrival.vue
index a605d81..542a9c2 100644
--- a/frontend/src/view/wms/stockAsn/tabToDoArrival.vue
+++ b/frontend/src/view/wms/stockAsn/tabToDoArrival.vue
@@ -1,262 +1,262 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.supplier_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockAsnInfo.supplier_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.sku_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockAsnInfo.sku_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="asn_no" :title="$t('wms.stockAsnInfo.asn_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.stockAsnInfo.spu_code')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.stockAsnInfo.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.stockAsnInfo.sku_code')">
- <template #default="{ row }">
- <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
- </template>
- </vxe-column>
- <vxe-column field="sku_name" :title="$t('wms.stockAsnInfo.sku_name')"></vxe-column>
- <vxe-column field="goods_owner_name" :title="$t('wms.stockAsnInfo.goods_owner_name')"></vxe-column>
- <vxe-column field="supplier_name" :title="$t('wms.stockAsnInfo.supplier_name')"></vxe-column>
- <vxe-column field="asn_qty" :title="$t('wms.stockAsnInfo.asn_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.stockAsnInfo.weight')"></vxe-column>
- <vxe-column field="volume" :title="$t('wms.stockAsnInfo.volume')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn :flat="true" icon="mdi-check" :tooltip-text="$t('system.page.confirm')" @click="method.editRow(row)"></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <skuInfo :show-dialog="data.showDialogShowInfo" :form="data.dialogForm" @close="method.closeDialogShowInfo" />
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { StockAsnVO } from '@/types/WMS/StockAsn'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { getStockAsnList, confirmAsn } from '@/api/wms/stockAsn'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import customPager from '@/components/custom-pager.vue'
-import skuInfo from './sku-info.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTableStockLocation = ref()
-
-const data = reactive({
- showDialog: false,
- showDialogShowInfo: false,
- searchForm: {
- supplier_name: '',
- sku_name: ''
- },
- activeTab: null,
- tableData: ref<StockAsnVO[]>([]),
- dialogForm: ref<StockAsnVO>({
- id: 0,
- asn_no: '',
- asn_status: 0,
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- asn_qty: 0,
- actual_qty: 0,
- sorted_qty: 0,
- shortage_qty: 0,
- more_qty: 0,
- damage_qty: 0,
- weight: 0,
- volume: 0,
- supplier_id: 0,
- supplier_name: '',
- goods_owner_id: 0,
- goods_owner_name: '',
- is_valid: true
- }),
- tablePage: reactive({
- total: 0,
- sqlTitle: 'asn_status:0',
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- timer: ref<any>(null)
-})
-
-const method = reactive({
- closeDialogShowInfo: () => {
- data.showDialogShowInfo = false
- },
- showSkuInfo(row: StockAsnVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialogShowInfo = true
- },
- editRow(row: StockAsnVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeAsnConfirm'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await confirmAsn(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.confirm') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // Refresh data
- refresh: () => {
- method.getStockAsnList()
- },
- getStockAsnList: async () => {
- const { data: res } = await getStockAsnList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getStockAsnList()
- }),
- exportTable: () => {
- const $table = xTableStockLocation.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.stockAsn.tabToDoArrival'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getStockAsnList()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-defineExpose({
- getStockAsnList: method.getStockAsnList
-})
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.supplier_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockAsnInfo.supplier_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.sku_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockAsnInfo.sku_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="asn_no" :title="$t('wms.stockAsnInfo.asn_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.stockAsnInfo.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.stockAsnInfo.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.stockAsnInfo.sku_code')">
+ <template #default="{ row }">
+ <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
+ </template>
+ </vxe-column>
+ <vxe-column field="sku_name" :title="$t('wms.stockAsnInfo.sku_name')"></vxe-column>
+ <vxe-column field="goods_owner_name" :title="$t('wms.stockAsnInfo.goods_owner_name')"></vxe-column>
+ <vxe-column field="supplier_name" :title="$t('wms.stockAsnInfo.supplier_name')"></vxe-column>
+ <vxe-column field="asn_qty" :title="$t('wms.stockAsnInfo.asn_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.stockAsnInfo.weight')"></vxe-column>
+ <vxe-column field="volume" :title="$t('wms.stockAsnInfo.volume')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn :flat="true" icon="mdi-check" :tooltip-text="$t('system.page.confirm')" @click="method.editRow(row)"></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <skuInfo :show-dialog="data.showDialogShowInfo" :form="data.dialogForm" @close="method.closeDialogShowInfo" />
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { StockAsnVO } from '@/types/WMS/StockAsn'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { getStockAsnList, confirmAsn } from '@/api/wms/stockAsn'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import customPager from '@/components/custom-pager.vue'
+import skuInfo from './sku-info.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTableStockLocation = ref()
+
+const data = reactive({
+ showDialog: false,
+ showDialogShowInfo: false,
+ searchForm: {
+ supplier_name: '',
+ sku_name: ''
+ },
+ activeTab: null,
+ tableData: ref<StockAsnVO[]>([]),
+ dialogForm: ref<StockAsnVO>({
+ id: 0,
+ asn_no: '',
+ asn_status: 0,
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ asn_qty: 0,
+ actual_qty: 0,
+ sorted_qty: 0,
+ shortage_qty: 0,
+ more_qty: 0,
+ damage_qty: 0,
+ weight: 0,
+ volume: 0,
+ supplier_id: 0,
+ supplier_name: '',
+ goods_owner_id: 0,
+ goods_owner_name: '',
+ is_valid: true
+ }),
+ tablePage: reactive({
+ total: 0,
+ sqlTitle: 'asn_status:0',
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ closeDialogShowInfo: () => {
+ data.showDialogShowInfo = false
+ },
+ showSkuInfo(row: StockAsnVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialogShowInfo = true
+ },
+ editRow(row: StockAsnVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeAsnConfirm'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await confirmAsn(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.confirm') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Refresh data
+ refresh: () => {
+ method.getStockAsnList()
+ },
+ getStockAsnList: async () => {
+ const { data: res } = await getStockAsnList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getStockAsnList()
+ }),
+ exportTable: () => {
+ const $table = xTableStockLocation.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.stockAsn.tabToDoArrival'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getStockAsnList()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+defineExpose({
+ getStockAsnList: method.getStockAsnList
+})
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/wms/stockAsn/tabToDoGrounding.vue b/frontend/src/view/wms/stockAsn/tabToDoGrounding.vue
index 6b4ab63..00d4473 100644
--- a/frontend/src/view/wms/stockAsn/tabToDoGrounding.vue
+++ b/frontend/src/view/wms/stockAsn/tabToDoGrounding.vue
@@ -1,286 +1,286 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.supplier_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockAsnInfo.supplier_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.sku_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockAsnInfo.sku_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="asn_no" :title="$t('wms.stockAsnInfo.asn_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.stockAsnInfo.spu_code')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.stockAsnInfo.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.stockAsnInfo.sku_code')">
- <template #default="{ row }">
- <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
- </template>
- </vxe-column>
- <vxe-column field="sku_name" :title="$t('wms.stockAsnInfo.sku_name')"></vxe-column>
- <vxe-column field="goods_owner_name" :title="$t('wms.stockAsnInfo.goods_owner_name')"></vxe-column>
- <vxe-column field="supplier_name" :title="$t('wms.stockAsnInfo.supplier_name')"></vxe-column>
- <vxe-column field="asn_qty" :title="$t('wms.stockAsnInfo.asn_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.stockAsnInfo.weight')"></vxe-column>
- <vxe-column field="volume" :title="$t('wms.stockAsnInfo.volume')"></vxe-column>
- <vxe-column field="sorted_qty" :title="$t('wms.stockAsnInfo.sorted_qty')"></vxe-column>
- <vxe-column field="actual_qty" :title="$t('wms.stockAsnInfo.actual_qty')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn :flat="true" icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editRow(row)"></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <updateGrounding :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- <skuInfo :show-dialog="data.showDialogShowInfo" :form="data.dialogForm" @close="method.closeDialogShowInfo" />
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { StockAsnVO } from '@/types/WMS/StockAsn'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { getStockAsnList, sortedAsnCancel } from '@/api/wms/stockAsn'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import updateGrounding from './update-grounding.vue'
-import customPager from '@/components/custom-pager.vue'
-import skuInfo from './sku-info.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTableStockLocation = ref()
-
-const data = reactive({
- showDialog: false,
- showDialogShowInfo: false,
- searchForm: {
- supplier_name: '',
- sku_name: ''
- },
- activeTab: null,
- dialogForm: ref<StockAsnVO>({
- id: 0,
- asn_no: '',
- asn_status: 0,
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- asn_qty: 0,
- actual_qty: 0,
- sorted_qty: 0,
- shortage_qty: 0,
- more_qty: 0,
- damage_qty: 0,
- weight: 0,
- volume: 0,
- supplier_id: 0,
- supplier_name: '',
- goods_owner_id: 0,
- goods_owner_name: '',
- is_valid: true
- }),
- tableData: ref<StockAsnVO[]>([]),
- tablePage: reactive({
- total: 0,
- sqlTitle: 'asn_status:3',
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- timer: ref<any>(null)
-})
-
-const method = reactive({
- closeDialogShowInfo: () => {
- data.showDialogShowInfo = false
- },
- showSkuInfo(row: StockAsnVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialogShowInfo = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // After add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- editRow(row: StockAsnVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- deleteRow(row: StockAsnVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await sortedAsnCancel(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // Refresh data
- refresh: () => {
- method.getStockAsnList()
- },
- getStockAsnList: async () => {
- const { data: res } = await getStockAsnList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getStockAsnList()
- }),
- exportTable: () => {
- const $table = xTableStockLocation.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.stockAsn.tabToDoGrounding'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getStockAsnList()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-defineExpose({
- getStockAsnList: method.getStockAsnList
-})
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.supplier_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockAsnInfo.supplier_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.sku_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockAsnInfo.sku_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="asn_no" :title="$t('wms.stockAsnInfo.asn_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.stockAsnInfo.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.stockAsnInfo.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.stockAsnInfo.sku_code')">
+ <template #default="{ row }">
+ <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
+ </template>
+ </vxe-column>
+ <vxe-column field="sku_name" :title="$t('wms.stockAsnInfo.sku_name')"></vxe-column>
+ <vxe-column field="goods_owner_name" :title="$t('wms.stockAsnInfo.goods_owner_name')"></vxe-column>
+ <vxe-column field="supplier_name" :title="$t('wms.stockAsnInfo.supplier_name')"></vxe-column>
+ <vxe-column field="asn_qty" :title="$t('wms.stockAsnInfo.asn_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.stockAsnInfo.weight')"></vxe-column>
+ <vxe-column field="volume" :title="$t('wms.stockAsnInfo.volume')"></vxe-column>
+ <vxe-column field="sorted_qty" :title="$t('wms.stockAsnInfo.sorted_qty')"></vxe-column>
+ <vxe-column field="actual_qty" :title="$t('wms.stockAsnInfo.actual_qty')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn :flat="true" icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editRow(row)"></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <updateGrounding :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ <skuInfo :show-dialog="data.showDialogShowInfo" :form="data.dialogForm" @close="method.closeDialogShowInfo" />
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { StockAsnVO } from '@/types/WMS/StockAsn'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { getStockAsnList, sortedAsnCancel } from '@/api/wms/stockAsn'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import updateGrounding from './update-grounding.vue'
+import customPager from '@/components/custom-pager.vue'
+import skuInfo from './sku-info.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTableStockLocation = ref()
+
+const data = reactive({
+ showDialog: false,
+ showDialogShowInfo: false,
+ searchForm: {
+ supplier_name: '',
+ sku_name: ''
+ },
+ activeTab: null,
+ dialogForm: ref<StockAsnVO>({
+ id: 0,
+ asn_no: '',
+ asn_status: 0,
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ asn_qty: 0,
+ actual_qty: 0,
+ sorted_qty: 0,
+ shortage_qty: 0,
+ more_qty: 0,
+ damage_qty: 0,
+ weight: 0,
+ volume: 0,
+ supplier_id: 0,
+ supplier_name: '',
+ goods_owner_id: 0,
+ goods_owner_name: '',
+ is_valid: true
+ }),
+ tableData: ref<StockAsnVO[]>([]),
+ tablePage: reactive({
+ total: 0,
+ sqlTitle: 'asn_status:3',
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ closeDialogShowInfo: () => {
+ data.showDialogShowInfo = false
+ },
+ showSkuInfo(row: StockAsnVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialogShowInfo = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // After add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ editRow(row: StockAsnVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ deleteRow(row: StockAsnVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await sortedAsnCancel(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Refresh data
+ refresh: () => {
+ method.getStockAsnList()
+ },
+ getStockAsnList: async () => {
+ const { data: res } = await getStockAsnList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getStockAsnList()
+ }),
+ exportTable: () => {
+ const $table = xTableStockLocation.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.stockAsn.tabToDoGrounding'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getStockAsnList()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+defineExpose({
+ getStockAsnList: method.getStockAsnList
+})
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/wms/stockAsn/tabToDoSorting.vue b/frontend/src/view/wms/stockAsn/tabToDoSorting.vue
index ee92a6e..ad770d0 100644
--- a/frontend/src/view/wms/stockAsn/tabToDoSorting.vue
+++ b/frontend/src/view/wms/stockAsn/tabToDoSorting.vue
@@ -1,308 +1,308 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.supplier_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockAsnInfo.supplier_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.sku_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockAsnInfo.sku_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="asn_no" :title="$t('wms.stockAsnInfo.asn_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.stockAsnInfo.spu_code')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.stockAsnInfo.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.stockAsnInfo.sku_code')">
- <template #default="{ row }">
- <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
- </template>
- </vxe-column>
- <vxe-column field="sku_name" :title="$t('wms.stockAsnInfo.sku_name')"></vxe-column>
- <vxe-column field="goods_owner_name" :title="$t('wms.stockAsnInfo.goods_owner_name')"></vxe-column>
- <vxe-column field="supplier_name" :title="$t('wms.stockAsnInfo.supplier_name')"></vxe-column>
- <vxe-column field="asn_qty" :title="$t('wms.stockAsnInfo.asn_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.stockAsnInfo.weight')"></vxe-column>
- <vxe-column field="volume" :title="$t('wms.stockAsnInfo.volume')"></vxe-column>
- <vxe-column field="sorted_qty" :title="$t('wms.stockAsnInfo.sorted_qty')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="180" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn :flat="true" icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editRowEdit(row)"></tooltip-btn>
- <tooltip-btn :flat="true" icon="mdi-check" :tooltip-text="$t('system.page.confirm')" @click="method.editRow(row)"></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <updateSorting :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
- <skuInfo :show-dialog="data.showDialogShowInfo" :form="data.dialogForm" @close="method.closeDialogShowInfo" />
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { StockAsnVO } from '@/types/WMS/StockAsn'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { getStockAsnList, sortedAsn, unloadAsnCancel } from '@/api/wms/stockAsn'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import updateSorting from './update-sorting.vue'
-import customPager from '@/components/custom-pager.vue'
-import skuInfo from './sku-info.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTableStockLocation = ref()
-
-const data = reactive({
- showDialog: false,
- showDialogShowInfo: false,
- searchForm: {
- supplier_name: '',
- sku_name: ''
- },
- activeTab: null,
- dialogForm: ref<StockAsnVO>({
- id: 0,
- asn_no: '',
- asn_status: 0,
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- asn_qty: 0,
- actual_qty: 0,
- sorted_qty: 0,
- shortage_qty: 0,
- more_qty: 0,
- damage_qty: 0,
- weight: 0,
- volume: 0,
- supplier_id: 0,
- supplier_name: '',
- goods_owner_id: 0,
- goods_owner_name: '',
- is_valid: true
- }),
- tableData: ref<StockAsnVO[]>([]),
- tablePage: reactive({
- total: 0,
- sqlTitle: 'asn_status:2',
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- timer: ref<any>(null)
-})
-
-const method = reactive({
- closeDialogShowInfo: () => {
- data.showDialogShowInfo = false
- },
- showSkuInfo(row: StockAsnVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialogShowInfo = true
- },
- // Shut add or update dialog
- closeDialog: () => {
- data.showDialog = false
- },
- // After add or update success.
- saveSuccess: () => {
- method.refresh()
- method.closeDialog()
- },
- editRowEdit(row: StockAsnVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialog = true
- },
- editRow(row: StockAsnVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeAsnSorted'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await sortedAsn(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.confirm') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- deleteRow(row: StockAsnVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await unloadAsnCancel(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // Refresh data
- refresh: () => {
- method.getStockAsnList()
- },
- getStockAsnList: async () => {
- const { data: res } = await getStockAsnList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getStockAsnList()
- }),
- exportTable: () => {
- const $table = xTableStockLocation.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.stockAsn.tabToDoSorting'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getStockAsnList()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-defineExpose({
- getStockAsnList: method.getStockAsnList
-})
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.supplier_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockAsnInfo.supplier_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.sku_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockAsnInfo.sku_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="asn_no" :title="$t('wms.stockAsnInfo.asn_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.stockAsnInfo.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.stockAsnInfo.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.stockAsnInfo.sku_code')">
+ <template #default="{ row }">
+ <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
+ </template>
+ </vxe-column>
+ <vxe-column field="sku_name" :title="$t('wms.stockAsnInfo.sku_name')"></vxe-column>
+ <vxe-column field="goods_owner_name" :title="$t('wms.stockAsnInfo.goods_owner_name')"></vxe-column>
+ <vxe-column field="supplier_name" :title="$t('wms.stockAsnInfo.supplier_name')"></vxe-column>
+ <vxe-column field="asn_qty" :title="$t('wms.stockAsnInfo.asn_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.stockAsnInfo.weight')"></vxe-column>
+ <vxe-column field="volume" :title="$t('wms.stockAsnInfo.volume')"></vxe-column>
+ <vxe-column field="sorted_qty" :title="$t('wms.stockAsnInfo.sorted_qty')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="180" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn :flat="true" icon="mdi-pencil-outline" :tooltip-text="$t('system.page.edit')" @click="method.editRowEdit(row)"></tooltip-btn>
+ <tooltip-btn :flat="true" icon="mdi-check" :tooltip-text="$t('system.page.confirm')" @click="method.editRow(row)"></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <updateSorting :show-dialog="data.showDialog" :form="data.dialogForm" @close="method.closeDialog" @saveSuccess="method.saveSuccess" />
+ <skuInfo :show-dialog="data.showDialogShowInfo" :form="data.dialogForm" @close="method.closeDialogShowInfo" />
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { StockAsnVO } from '@/types/WMS/StockAsn'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { getStockAsnList, sortedAsn, unloadAsnCancel } from '@/api/wms/stockAsn'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import updateSorting from './update-sorting.vue'
+import customPager from '@/components/custom-pager.vue'
+import skuInfo from './sku-info.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTableStockLocation = ref()
+
+const data = reactive({
+ showDialog: false,
+ showDialogShowInfo: false,
+ searchForm: {
+ supplier_name: '',
+ sku_name: ''
+ },
+ activeTab: null,
+ dialogForm: ref<StockAsnVO>({
+ id: 0,
+ asn_no: '',
+ asn_status: 0,
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ asn_qty: 0,
+ actual_qty: 0,
+ sorted_qty: 0,
+ shortage_qty: 0,
+ more_qty: 0,
+ damage_qty: 0,
+ weight: 0,
+ volume: 0,
+ supplier_id: 0,
+ supplier_name: '',
+ goods_owner_id: 0,
+ goods_owner_name: '',
+ is_valid: true
+ }),
+ tableData: ref<StockAsnVO[]>([]),
+ tablePage: reactive({
+ total: 0,
+ sqlTitle: 'asn_status:2',
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ closeDialogShowInfo: () => {
+ data.showDialogShowInfo = false
+ },
+ showSkuInfo(row: StockAsnVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialogShowInfo = true
+ },
+ // Shut add or update dialog
+ closeDialog: () => {
+ data.showDialog = false
+ },
+ // After add or update success.
+ saveSuccess: () => {
+ method.refresh()
+ method.closeDialog()
+ },
+ editRowEdit(row: StockAsnVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialog = true
+ },
+ editRow(row: StockAsnVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeAsnSorted'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await sortedAsn(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.confirm') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ deleteRow(row: StockAsnVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await unloadAsnCancel(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Refresh data
+ refresh: () => {
+ method.getStockAsnList()
+ },
+ getStockAsnList: async () => {
+ const { data: res } = await getStockAsnList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getStockAsnList()
+ }),
+ exportTable: () => {
+ const $table = xTableStockLocation.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.stockAsn.tabToDoSorting'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getStockAsnList()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+defineExpose({
+ getStockAsnList: method.getStockAsnList
+})
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/wms/stockAsn/tabToDoUnload.vue b/frontend/src/view/wms/stockAsn/tabToDoUnload.vue
index 35c3db4..fb1590e 100644
--- a/frontend/src/view/wms/stockAsn/tabToDoUnload.vue
+++ b/frontend/src/view/wms/stockAsn/tabToDoUnload.vue
@@ -1,291 +1,291 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.supplier_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockAsnInfo.supplier_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.sku_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockAsnInfo.sku_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="asn_no" :title="$t('wms.stockAsnInfo.asn_no')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.stockAsnInfo.spu_code')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.stockAsnInfo.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.stockAsnInfo.sku_code')">
- <template #default="{ row }">
- <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
- </template>
- </vxe-column>
- <vxe-column field="sku_name" :title="$t('wms.stockAsnInfo.sku_name')"></vxe-column>
- <vxe-column field="goods_owner_name" :title="$t('wms.stockAsnInfo.goods_owner_name')"></vxe-column>
- <vxe-column field="supplier_name" :title="$t('wms.stockAsnInfo.supplier_name')"></vxe-column>
- <vxe-column field="asn_qty" :title="$t('wms.stockAsnInfo.asn_qty')"></vxe-column>
- <vxe-column field="weight" :title="$t('wms.stockAsnInfo.weight')"></vxe-column>
- <vxe-column field="volume" :title="$t('wms.stockAsnInfo.volume')"></vxe-column>
- <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
- <template #default="{ row }">
- <tooltip-btn :flat="true" icon="mdi-check" :tooltip-text="$t('system.page.confirm')" @click="method.editRow(row)"></tooltip-btn>
- <tooltip-btn
- :flat="true"
- icon="mdi-delete-outline"
- :tooltip-text="$t('system.page.delete')"
- :icon-color="errorColor"
- @click="method.deleteRow(row)"
- ></tooltip-btn>
- </template>
- </vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <skuInfo :show-dialog="data.showDialogShowInfo" :form="data.dialogForm" @close="method.closeDialogShowInfo" />
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { StockAsnVO } from '@/types/WMS/StockAsn'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { getStockAsnList, unloadAsn, confirmAsnCancel } from '@/api/wms/stockAsn'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import customPager from '@/components/custom-pager.vue'
-import skuInfo from './sku-info.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTableStockLocation = ref()
-
-const data = reactive({
- showDialog: false,
- showDialogShowInfo: false,
- searchForm: {
- supplier_name: '',
- sku_name: ''
- },
- activeTab: null,
- tableData: ref<StockAsnVO[]>([]),
- dialogForm: ref<StockAsnVO>({
- id: 0,
- asn_no: '',
- asn_status: 0,
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- asn_qty: 0,
- actual_qty: 0,
- sorted_qty: 0,
- shortage_qty: 0,
- more_qty: 0,
- damage_qty: 0,
- weight: 0,
- volume: 0,
- supplier_id: 0,
- supplier_name: '',
- goods_owner_id: 0,
- goods_owner_name: '',
- is_valid: true
- }),
- tablePage: reactive({
- total: 0,
- sqlTitle: 'asn_status:1',
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- timer: ref<any>(null)
-})
-
-const method = reactive({
- closeDialogShowInfo: () => {
- data.showDialogShowInfo = false
- },
- showSkuInfo(row: StockAsnVO) {
- data.dialogForm = JSON.parse(JSON.stringify(row))
- data.showDialogShowInfo = true
- },
- editRow(row: StockAsnVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeAsnUnload'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await unloadAsn(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.confirm') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- deleteRow(row: StockAsnVO) {
- hookComponent.$dialog({
- content: i18n.global.t('system.tips.beforeDeleteMessage'),
- handleConfirm: async () => {
- if (row.id) {
- const { data: res } = await confirmAsnCancel(row.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
- })
- method.refresh()
- }
- }
- })
- },
- // Refresh data
- refresh: () => {
- method.getStockAsnList()
- },
- getStockAsnList: async () => {
- const { data: res } = await getStockAsnList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getStockAsnList()
- }),
- exportTable: () => {
- const $table = xTableStockLocation.value
- $table.exportData({
- table: $table,
- filename: i18n.global.t('wms.stockAsn.tabToDoUnload'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getStockAsnList()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-defineExpose({
- getStockAsnList: method.getStockAsnList
-})
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.supplier_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockAsnInfo.supplier_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.sku_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockAsnInfo.sku_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="asn_no" :title="$t('wms.stockAsnInfo.asn_no')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.stockAsnInfo.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.stockAsnInfo.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.stockAsnInfo.sku_code')">
+ <template #default="{ row }">
+ <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
+ </template>
+ </vxe-column>
+ <vxe-column field="sku_name" :title="$t('wms.stockAsnInfo.sku_name')"></vxe-column>
+ <vxe-column field="goods_owner_name" :title="$t('wms.stockAsnInfo.goods_owner_name')"></vxe-column>
+ <vxe-column field="supplier_name" :title="$t('wms.stockAsnInfo.supplier_name')"></vxe-column>
+ <vxe-column field="asn_qty" :title="$t('wms.stockAsnInfo.asn_qty')"></vxe-column>
+ <vxe-column field="weight" :title="$t('wms.stockAsnInfo.weight')"></vxe-column>
+ <vxe-column field="volume" :title="$t('wms.stockAsnInfo.volume')"></vxe-column>
+ <vxe-column field="operate" :title="$t('system.page.operate')" width="160" :resizable="false" show-overflow>
+ <template #default="{ row }">
+ <tooltip-btn :flat="true" icon="mdi-check" :tooltip-text="$t('system.page.confirm')" @click="method.editRow(row)"></tooltip-btn>
+ <tooltip-btn
+ :flat="true"
+ icon="mdi-delete-outline"
+ :tooltip-text="$t('system.page.delete')"
+ :icon-color="errorColor"
+ @click="method.deleteRow(row)"
+ ></tooltip-btn>
+ </template>
+ </vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <skuInfo :show-dialog="data.showDialogShowInfo" :form="data.dialogForm" @close="method.closeDialogShowInfo" />
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { StockAsnVO } from '@/types/WMS/StockAsn'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { getStockAsnList, unloadAsn, confirmAsnCancel } from '@/api/wms/stockAsn'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import customPager from '@/components/custom-pager.vue'
+import skuInfo from './sku-info.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTableStockLocation = ref()
+
+const data = reactive({
+ showDialog: false,
+ showDialogShowInfo: false,
+ searchForm: {
+ supplier_name: '',
+ sku_name: ''
+ },
+ activeTab: null,
+ tableData: ref<StockAsnVO[]>([]),
+ dialogForm: ref<StockAsnVO>({
+ id: 0,
+ asn_no: '',
+ asn_status: 0,
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ asn_qty: 0,
+ actual_qty: 0,
+ sorted_qty: 0,
+ shortage_qty: 0,
+ more_qty: 0,
+ damage_qty: 0,
+ weight: 0,
+ volume: 0,
+ supplier_id: 0,
+ supplier_name: '',
+ goods_owner_id: 0,
+ goods_owner_name: '',
+ is_valid: true
+ }),
+ tablePage: reactive({
+ total: 0,
+ sqlTitle: 'asn_status:1',
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ closeDialogShowInfo: () => {
+ data.showDialogShowInfo = false
+ },
+ showSkuInfo(row: StockAsnVO) {
+ data.dialogForm = JSON.parse(JSON.stringify(row))
+ data.showDialogShowInfo = true
+ },
+ editRow(row: StockAsnVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeAsnUnload'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await unloadAsn(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.confirm') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ deleteRow(row: StockAsnVO) {
+ hookComponent.$dialog({
+ content: i18n.global.t('system.tips.beforeDeleteMessage'),
+ handleConfirm: async () => {
+ if (row.id) {
+ const { data: res } = await confirmAsnCancel(row.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.delete') }${ i18n.global.t('system.tips.success') }`
+ })
+ method.refresh()
+ }
+ }
+ })
+ },
+ // Refresh data
+ refresh: () => {
+ method.getStockAsnList()
+ },
+ getStockAsnList: async () => {
+ const { data: res } = await getStockAsnList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getStockAsnList()
+ }),
+ exportTable: () => {
+ const $table = xTableStockLocation.value
+ $table.exportData({
+ table: $table,
+ filename: i18n.global.t('wms.stockAsn.tabToDoUnload'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getStockAsnList()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+defineExpose({
+ getStockAsnList: method.getStockAsnList
+})
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/wms/stockAsn/update-grounding.vue b/frontend/src/view/wms/stockAsn/update-grounding.vue
index da89fb6..fb233d3 100644
--- a/frontend/src/view/wms/stockAsn/update-grounding.vue
+++ b/frontend/src/view/wms/stockAsn/update-grounding.vue
@@ -1,170 +1,170 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('wms.stockAsn.tabNotice')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.formPutaway.location_name"
- :label="$t('base.warehouseSetting.location_name')"
- :rules="data.rules.location_name"
- variant="outlined"
- readonly
- clearable
- @click="method.openSelect('target')"
- @click:clear="method.clearCommodity"
- ></v-text-field>
- <v-text-field
- v-model="data.formPutaway.putaway_qty"
- :label="$t('wms.stockAsnInfo.actual_qty')"
- :rules="data.rules.putaway_qty"
- variant="outlined"
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
- <locationSelect :show-dialog="data.showSkuDialogSelect" @close="method.closeDialogSelect('target')" @sureSelect="method.sureSelect" />
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { StockAsnVO, PutawayVo } from '@/types/WMS/StockAsn'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { putawayAsn } from '@/api/wms/stockAsn'
-import locationSelect from '@/components/select/location-select.vue'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: StockAsnVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => 'update')
-
-const data = reactive({
- form: ref<StockAsnVO>({
- id: 0,
- asn_no: '',
- asn_status: 0,
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- asn_qty: 0,
- actual_qty: 0,
- sorted_qty: 0,
- shortage_qty: 0,
- more_qty: 0,
- damage_qty: 0,
- weight: 0,
- volume: 0,
- supplier_id: 0,
- supplier_name: '',
- goods_owner_id: 0,
- goods_owner_name: '',
- is_valid: true
- }),
- formPutaway: ref<PutawayVo>({
- asn_id: 0,
- location_name: '',
- goods_location_id: 0,
- putaway_qty: 0
- }),
- rules: {
- putaway_qty: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.stockAsnInfo.actual_qty') }!`],
- location_name: [
- (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.location_name') }!`
- ]
- },
- showSkuDialogSelect: false,
- curSelectType: ''
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- data.formPutaway.asn_id = data.form.id
- const { data: res } = await putawayAsn(data.formPutaway)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- },
-
- clearCommodity: () => {
- data.formPutaway.goods_location_id = 0
- data.formPutaway.location_name = ''
- },
- openSelect: (type: string) => {
- data.curSelectType = type
-
- if (type === 'target') {
- data.showSkuDialogSelect = true
- }
- },
- closeDialogSelect: (type: string) => {
- if (type === 'target') {
- data.showSkuDialogSelect = false
- }
- },
- sureSelect: (selectRecords: any) => {
- if (data.curSelectType === 'target') {
- data.formPutaway.goods_location_id = selectRecords[0].id
- data.formPutaway.location_name = selectRecords[0].location_name
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('wms.stockAsn.tabNotice')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.formPutaway.location_name"
+ :label="$t('base.warehouseSetting.location_name')"
+ :rules="data.rules.location_name"
+ variant="outlined"
+ readonly
+ clearable
+ @click="method.openSelect('target')"
+ @click:clear="method.clearCommodity"
+ ></v-text-field>
+ <v-text-field
+ v-model="data.formPutaway.putaway_qty"
+ :label="$t('wms.stockAsnInfo.actual_qty')"
+ :rules="data.rules.putaway_qty"
+ variant="outlined"
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+ <locationSelect :show-dialog="data.showSkuDialogSelect" @close="method.closeDialogSelect('target')" @sureSelect="method.sureSelect" />
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { StockAsnVO, PutawayVo } from '@/types/WMS/StockAsn'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { putawayAsn } from '@/api/wms/stockAsn'
+import locationSelect from '@/components/select/location-select.vue'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: StockAsnVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => 'update')
+
+const data = reactive({
+ form: ref<StockAsnVO>({
+ id: 0,
+ asn_no: '',
+ asn_status: 0,
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ asn_qty: 0,
+ actual_qty: 0,
+ sorted_qty: 0,
+ shortage_qty: 0,
+ more_qty: 0,
+ damage_qty: 0,
+ weight: 0,
+ volume: 0,
+ supplier_id: 0,
+ supplier_name: '',
+ goods_owner_id: 0,
+ goods_owner_name: '',
+ is_valid: true
+ }),
+ formPutaway: ref<PutawayVo>({
+ asn_id: 0,
+ location_name: '',
+ goods_location_id: 0,
+ putaway_qty: 0
+ }),
+ rules: {
+ putaway_qty: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.stockAsnInfo.actual_qty') }!`],
+ location_name: [
+ (val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.warehouseSetting.location_name') }!`
+ ]
+ },
+ showSkuDialogSelect: false,
+ curSelectType: ''
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ data.formPutaway.asn_id = data.form.id
+ const { data: res } = await putawayAsn(data.formPutaway)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ },
+
+ clearCommodity: () => {
+ data.formPutaway.goods_location_id = 0
+ data.formPutaway.location_name = ''
+ },
+ openSelect: (type: string) => {
+ data.curSelectType = type
+
+ if (type === 'target') {
+ data.showSkuDialogSelect = true
+ }
+ },
+ closeDialogSelect: (type: string) => {
+ if (type === 'target') {
+ data.showSkuDialogSelect = false
+ }
+ },
+ sureSelect: (selectRecords: any) => {
+ if (data.curSelectType === 'target') {
+ data.formPutaway.goods_location_id = selectRecords[0].id
+ data.formPutaway.location_name = selectRecords[0].location_name
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/wms/stockAsn/update-sorting.vue b/frontend/src/view/wms/stockAsn/update-sorting.vue
index a150a66..2a49da3 100644
--- a/frontend/src/view/wms/stockAsn/update-sorting.vue
+++ b/frontend/src/view/wms/stockAsn/update-sorting.vue
@@ -1,129 +1,129 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <v-toolbar color="white" :title="`${$t('wms.stockAsn.tabNotice')}`"></v-toolbar>
- <v-card-text>
- <v-form ref="formRef">
- <v-text-field
- v-model="data.form.sorted_qty"
- :label="$t('wms.stockAsnInfo.sorted_qty')"
- :rules="data.rules.sorted_qty"
- variant="outlined"
- ></v-text-field>
- </v-form>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { StockAsnVO, SortingVo } from '@/types/WMS/StockAsn'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { sortingAsn } from '@/api/wms/stockAsn'
-
-const formRef = ref()
-const emit = defineEmits(['close', 'saveSuccess'])
-
-const props = defineProps<{
- showDialog: boolean
- form: StockAsnVO
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const dialogTitle = computed(() => 'update')
-
-const data = reactive({
- form: ref<StockAsnVO>({
- id: 0,
- asn_no: '',
- asn_status: 0,
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- asn_qty: 0,
- actual_qty: 0,
- sorted_qty: 0,
- shortage_qty: 0,
- more_qty: 0,
- damage_qty: 0,
- weight: 0,
- volume: 0,
- supplier_id: 0,
- supplier_name: '',
- goods_owner_id: 0,
- goods_owner_name: '',
- is_valid: true
- }),
- formSorting: ref<SortingVo>({
- asn_id: 0,
- sorted_qty: 0
- }),
- rules: {
- sorted_qty: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.stockAsnInfo.sorted_qty') }!`]
- }
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- submit: async () => {
- const { valid } = await formRef.value.validate()
- if (valid) {
- data.formSorting.asn_id = data.form.id
- data.formSorting.sorted_qty = data.form.sorted_qty
- const { data: res } = await sortingAsn(data.formSorting)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- hookComponent.$message({
- type: 'success',
- content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
- })
- emit('saveSuccess')
- } else {
- hookComponent.$message({
- type: 'error',
- content: i18n.global.t('system.checkText.checkFormFail')
- })
- }
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.form = props.form
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <v-toolbar color="white" :title="`${$t('wms.stockAsn.tabNotice')}`"></v-toolbar>
+ <v-card-text>
+ <v-form ref="formRef">
+ <v-text-field
+ v-model="data.form.sorted_qty"
+ :label="$t('wms.stockAsnInfo.sorted_qty')"
+ :rules="data.rules.sorted_qty"
+ variant="outlined"
+ ></v-text-field>
+ </v-form>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ <v-btn color="primary" variant="text" @click="method.submit">{{ $t('system.page.submit') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { StockAsnVO, SortingVo } from '@/types/WMS/StockAsn'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { sortingAsn } from '@/api/wms/stockAsn'
+
+const formRef = ref()
+const emit = defineEmits(['close', 'saveSuccess'])
+
+const props = defineProps<{
+ showDialog: boolean
+ form: StockAsnVO
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const dialogTitle = computed(() => 'update')
+
+const data = reactive({
+ form: ref<StockAsnVO>({
+ id: 0,
+ asn_no: '',
+ asn_status: 0,
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ asn_qty: 0,
+ actual_qty: 0,
+ sorted_qty: 0,
+ shortage_qty: 0,
+ more_qty: 0,
+ damage_qty: 0,
+ weight: 0,
+ volume: 0,
+ supplier_id: 0,
+ supplier_name: '',
+ goods_owner_id: 0,
+ goods_owner_name: '',
+ is_valid: true
+ }),
+ formSorting: ref<SortingVo>({
+ asn_id: 0,
+ sorted_qty: 0
+ }),
+ rules: {
+ sorted_qty: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('wms.stockAsnInfo.sorted_qty') }!`]
+ }
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ submit: async () => {
+ const { valid } = await formRef.value.validate()
+ if (valid) {
+ data.formSorting.asn_id = data.form.id
+ data.formSorting.sorted_qty = data.form.sorted_qty
+ const { data: res } = await sortingAsn(data.formSorting)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ hookComponent.$message({
+ type: 'success',
+ content: `${ i18n.global.t('system.page.submit') }${ i18n.global.t('system.tips.success') }`
+ })
+ emit('saveSuccess')
+ } else {
+ hookComponent.$message({
+ type: 'error',
+ content: i18n.global.t('system.checkText.checkFormFail')
+ })
+ }
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.form = props.form
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/wms/stockManagement/sku-info.vue b/frontend/src/view/wms/stockManagement/sku-info.vue
index abaa0a8..44d973f 100644
--- a/frontend/src/view/wms/stockManagement/sku-info.vue
+++ b/frontend/src/view/wms/stockManagement/sku-info.vue
@@ -1,112 +1,112 @@
-<template>
- <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
- <template #default>
- <v-card>
- <!-- <v-toolbar color="white" :title="`${$t('wms.stockAsn.tabNotice')}`"></v-toolbar> -->
- <v-card-text>
- <v-list-item two-line>
- <v-list-item-content>
- <v-list-item-title>{{ i18n.global.t('wms.skuInfo.spu_name') + ':' + data.tableData.spu_name }}</v-list-item-title>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.sku_code') + ':' + data.tableData.sku_code }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.sku_name') + ':' + data.tableData.sku_name }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.spu_description') + ':' + data.tableData.spu_description }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.category_name') + ':' + data.tableData.category_name }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.brand') + ':' + data.tableData.brand }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.origin') + ':' + data.tableData.origin }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.unit') + ':' + data.tableData.unit }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.cost') + ':' + data.tableData.cost }}</v-list-item-subtitle>
- <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.bar_code') + ':' + data.tableData.bar_code }}</v-list-item-subtitle>
- </v-list-item-content>
- </v-list-item>
- </v-card-text>
- <v-card-actions class="justify-end">
- <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
- </v-card-actions>
- </v-card>
- </template>
- </v-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, computed, ref, watch } from 'vue'
-import { SkuInfoVo } from '@/types/WMS/StockAsn'
-import i18n from '@/languages/i18n'
-import { hookComponent } from '@/components/system/index'
-import { getSkuInfo } from '@/api/wms/stockAsn'
-
-const formRef = ref()
-const emit = defineEmits(['close'])
-
-const props = defineProps<{
- showDialog: boolean
- sku_id: number
-}>()
-
-const isShow = computed(() => props.showDialog)
-
-const data = reactive({
- id: 0,
- tableData: ref<SkuInfoVo>({
- spu_id: 0,
- spu_code: '',
- spu_name: '',
- category_id: 0,
- category_name: '',
- spu_description: '',
- bar_code: '',
- supplier_id: 0,
- supplier_name: '',
- brand: '',
- origin: '',
- length_unit: 0,
- volume_unit: 0,
- weight_unit: 0,
- sku_id: 0,
- sku_code: '',
- sku_name: '',
- weight: 0,
- lenght: 0,
- width: 0,
- height: 0,
- volume: 0,
- unit: '',
- cost: 0,
- price: 0
- })
-})
-
-const method = reactive({
- closeDialog: () => {
- emit('close')
- },
- getStockAsnList: async () => {
- const { data: res } = await getSkuInfo(data.id)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data
- }
-})
-
-watch(
- () => isShow.value,
- (val) => {
- if (val) {
- data.id = props.sku_id
- method.getStockAsnList()
- }
- }
-)
-</script>
-
-<style scoped lang="less">
-.v-form {
- div {
- margin-bottom: 7px;
- }
-}
-</style>
+<template>
+ <v-dialog v-model="isShow" :width="'30%'" transition="dialog-top-transition" :persistent="true">
+ <template #default>
+ <v-card>
+ <!-- <v-toolbar color="white" :title="`${$t('wms.stockAsn.tabNotice')}`"></v-toolbar> -->
+ <v-card-text>
+ <v-list-item two-line>
+ <v-list-item-content>
+ <v-list-item-title>{{ i18n.global.t('wms.skuInfo.spu_name') + ':' + data.tableData.spu_name }}</v-list-item-title>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.sku_code') + ':' + data.tableData.sku_code }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.sku_name') + ':' + data.tableData.sku_name }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.spu_description') + ':' + data.tableData.spu_description }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.category_name') + ':' + data.tableData.category_name }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.brand') + ':' + data.tableData.brand }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.origin') + ':' + data.tableData.origin }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.unit') + ':' + data.tableData.unit }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.cost') + ':' + data.tableData.cost }}</v-list-item-subtitle>
+ <v-list-item-subtitle>{{ i18n.global.t('wms.skuInfo.bar_code') + ':' + data.tableData.bar_code }}</v-list-item-subtitle>
+ </v-list-item-content>
+ </v-list-item>
+ </v-card-text>
+ <v-card-actions class="justify-end">
+ <v-btn variant="text" @click="method.closeDialog">{{ $t('system.page.close') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+ </template>
+ </v-dialog>
+</template>
+
+<script lang="ts" setup>
+import { reactive, computed, ref, watch } from 'vue'
+import { SkuInfoVo } from '@/types/WMS/StockAsn'
+import i18n from '@/languages/i18n'
+import { hookComponent } from '@/components/system/index'
+import { getSkuInfo } from '@/api/wms/stockAsn'
+
+const formRef = ref()
+const emit = defineEmits(['close'])
+
+const props = defineProps<{
+ showDialog: boolean
+ sku_id: number
+}>()
+
+const isShow = computed(() => props.showDialog)
+
+const data = reactive({
+ id: 0,
+ tableData: ref<SkuInfoVo>({
+ spu_id: 0,
+ spu_code: '',
+ spu_name: '',
+ category_id: 0,
+ category_name: '',
+ spu_description: '',
+ bar_code: '',
+ supplier_id: 0,
+ supplier_name: '',
+ brand: '',
+ origin: '',
+ length_unit: 0,
+ volume_unit: 0,
+ weight_unit: 0,
+ sku_id: 0,
+ sku_code: '',
+ sku_name: '',
+ weight: 0,
+ lenght: 0,
+ width: 0,
+ height: 0,
+ volume: 0,
+ unit: '',
+ cost: 0,
+ price: 0
+ })
+})
+
+const method = reactive({
+ closeDialog: () => {
+ emit('close')
+ },
+ getStockAsnList: async () => {
+ const { data: res } = await getSkuInfo(data.id)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data
+ }
+})
+
+watch(
+ () => isShow.value,
+ (val) => {
+ if (val) {
+ data.id = props.sku_id
+ method.getStockAsnList()
+ }
+ }
+)
+</script>
+
+<style scoped lang="less">
+.v-form {
+ div {
+ margin-bottom: 7px;
+ }
+}
+</style>
diff --git a/frontend/src/view/wms/stockManagement/stockManagement.vue b/frontend/src/view/wms/stockManagement/stockManagement.vue
index 150d85c..e4621ba 100644
--- a/frontend/src/view/wms/stockManagement/stockManagement.vue
+++ b/frontend/src/view/wms/stockManagement/stockManagement.vue
@@ -1,94 +1,94 @@
-<!-- Warehouse Setting -->
-<template>
- <div class="container">
- <div>
- <v-tabs v-model="data.activeTab" stacked @update:model-value="method.changeTabs">
- <v-tab v-for="(item, index) of tabsConfig" :key="index" :value="item.value">
- <v-icon>{{ item.icon }}</v-icon>
- <p class="tabItemTitle">{{ item.tabName }}</p>
- </v-tab>
- </v-tabs>
-
- <!-- Main Content -->
- <v-card class="mt-5">
- <v-card-text>
- <v-window v-model="data.activeTab">
- <v-window-item value="tabStockLocation">
- <tabStockLocation ref="tabStockLocationRef" />
- </v-window-item>
- <v-window-item value="tabStock">
- <tabStock ref="tabStockRef" />
- </v-window-item>
- </v-window>
- </v-card-text>
- </v-card>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { ref, reactive, onMounted, watch, nextTick } from 'vue'
-import i18n from '@/languages/i18n'
-import tabStockLocation from './tabStockLocation.vue'
-import tabStock from './tabStock.vue'
-
-const tabStockLocationRef = ref()
-const tabStockRef = ref()
-
-const tabsConfig = [
- {
- value: 'tabStockLocation',
- icon: 'mdi-database',
- tabName: i18n.global.t('wms.stockManagement.stockLocation')
- },
- {
- value: 'tabStock',
- icon: 'mdi-warehouse',
- tabName: i18n.global.t('wms.stockManagement.stock')
- }
-]
-
-const data = reactive({
- activeTab: '',
- isLoadstockLocation: false,
- isLoadstock: false
-})
-
-const method = reactive({
- changeTabs: (e: any): void => {
- nextTick(() => {
- switch (e) {
- case 'tabStockLocation':
- // Tips:Must be write the nextTick so that can get DOM!!
- if (tabStockLocationRef?.value?.getStockLocationList) {
- tabStockLocationRef.value.getStockLocationList()
- }
- break
- case 'tabStock':
- if (tabStockRef?.value?.getStockList) {
- tabStockRef.value.getStockList()
- }
- break
- }
- })
- }
-})
-
-onMounted(() => { })
-</script>
-
-<style scoped lang="less">
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<!-- Warehouse Setting -->
+<template>
+ <div class="container">
+ <div>
+ <v-tabs v-model="data.activeTab" stacked @update:model-value="method.changeTabs">
+ <v-tab v-for="(item, index) of tabsConfig" :key="index" :value="item.value">
+ <v-icon>{{ item.icon }}</v-icon>
+ <p class="tabItemTitle">{{ item.tabName }}</p>
+ </v-tab>
+ </v-tabs>
+
+ <!-- Main Content -->
+ <v-card class="mt-5">
+ <v-card-text>
+ <v-window v-model="data.activeTab">
+ <v-window-item value="tabStockLocation">
+ <tabStockLocation ref="tabStockLocationRef" />
+ </v-window-item>
+ <v-window-item value="tabStock">
+ <tabStock ref="tabStockRef" />
+ </v-window-item>
+ </v-window>
+ </v-card-text>
+ </v-card>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { ref, reactive, onMounted, watch, nextTick } from 'vue'
+import i18n from '@/languages/i18n'
+import tabStockLocation from './tabStockLocation.vue'
+import tabStock from './tabStock.vue'
+
+const tabStockLocationRef = ref()
+const tabStockRef = ref()
+
+const tabsConfig = [
+ {
+ value: 'tabStockLocation',
+ icon: 'mdi-database',
+ tabName: i18n.global.t('wms.stockManagement.stockLocation')
+ },
+ {
+ value: 'tabStock',
+ icon: 'mdi-warehouse',
+ tabName: i18n.global.t('wms.stockManagement.stock')
+ }
+]
+
+const data = reactive({
+ activeTab: '',
+ isLoadstockLocation: false,
+ isLoadstock: false
+})
+
+const method = reactive({
+ changeTabs: (e: any): void => {
+ nextTick(() => {
+ switch (e) {
+ case 'tabStockLocation':
+ // Tips:Must be write the nextTick so that can get DOM!!
+ if (tabStockLocationRef?.value?.getStockLocationList) {
+ tabStockLocationRef.value.getStockLocationList()
+ }
+ break
+ case 'tabStock':
+ if (tabStockRef?.value?.getStockList) {
+ tabStockRef.value.getStockList()
+ }
+ break
+ }
+ })
+ }
+})
+
+onMounted(() => { })
+</script>
+
+<style scoped lang="less">
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/wms/stockManagement/tabStock.vue b/frontend/src/view/wms/stockManagement/tabStock.vue
index aef93a5..5f71b1f 100644
--- a/frontend/src/view/wms/stockManagement/tabStock.vue
+++ b/frontend/src/view/wms/stockManagement/tabStock.vue
@@ -1,215 +1,215 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.spu_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockList.spu_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTableWarehouse" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.stockList.spu_code')"></vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.stockList.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.stockList.sku_code')">
- <template #default="{ row }">
- <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
- </template>
- </vxe-column>
- <vxe-column field="qty" :title="$t('wms.stockList.qty')"></vxe-column>
- <vxe-column field="qty_available" :title="$t('wms.stockList.qty_available')"></vxe-column>
- <vxe-column field="qty_locked" :title="$t('wms.stockList.qty_locked')"></vxe-column>
- <vxe-column field="qty_frozen" :title="$t('wms.stockList.qty_frozen')"></vxe-column>
- <vxe-column field="qty_asn" :title="$t('wms.stockList.qty_asn')"></vxe-column>
- <vxe-column field="qty_to_unload" :title="$t('wms.stockList.qty_to_unload')"></vxe-column>
- <vxe-column field="qty_to_sort" :title="$t('wms.stockList.qty_to_sort')"></vxe-column>
- <vxe-column field="qty_sorted" :title="$t('wms.stockList.qty_sorted')"></vxe-column>
- <vxe-column field="shortage_qty" :title="$t('wms.stockList.shortage_qty')"></vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <skuInfo :show-dialog="data.showDialogShowInfo" :sku_id="data.sku_id" @close="method.closeDialogShowInfo" />
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents, VxeTablePropTypes } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { StockVO } from '@/types/WMS/StockManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { getStockList } from '@/api/wms/stockManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import customPager from '@/components/custom-pager.vue'
-import skuInfo from './sku-info.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTableWarehouse = ref()
-
-const data = reactive({
- sku_id: 0,
- showDialog: false,
- showDialogShowInfo: false,
- searchForm: {
- spu_name: ''
- },
- activeTab: null,
- tableData: ref<StockVO[]>([]),
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- timer: ref<any>(null)
-})
-
-const method = reactive({
- closeDialogShowInfo: () => {
- data.showDialogShowInfo = false
- },
- showSkuInfo(row: StockVO) {
- data.sku_id = row.sku_id
- data.showDialogShowInfo = true
- },
- sumNum: (list: any[], field: string) => {
- let count = 0
- list.forEach((item) => {
- count += Number(item[field])
- })
- return count
- },
- // footerMethod:ref<VxeTablePropTypes.FooterMethod>({ columns, data }) => {
- // columns.map((column, columnIndex) => {
- // if (columnIndex === 0) {
- // return '合计'
- // }
- // if (['qty', 'qty_available'].includes(column.field)) {
- // return method.sumNum(data, column.field)
- // }
- // return null
- // })
- // },
- // Refresh data
- refresh: () => {
- method.getStockList()
- },
- getStockList: async () => {
- const { data: res } = await getStockList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getStockList()
- }),
- exportTable: () => {
- const $table = xTableWarehouse.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.stockManagement.stock'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getStockList()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-defineExpose({
- getStockList: method.getStockList
-})
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.spu_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockList.spu_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTableWarehouse" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.stockList.spu_code')"></vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.stockList.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.stockList.sku_code')">
+ <template #default="{ row }">
+ <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
+ </template>
+ </vxe-column>
+ <vxe-column field="qty" :title="$t('wms.stockList.qty')"></vxe-column>
+ <vxe-column field="qty_available" :title="$t('wms.stockList.qty_available')"></vxe-column>
+ <vxe-column field="qty_locked" :title="$t('wms.stockList.qty_locked')"></vxe-column>
+ <vxe-column field="qty_frozen" :title="$t('wms.stockList.qty_frozen')"></vxe-column>
+ <vxe-column field="qty_asn" :title="$t('wms.stockList.qty_asn')"></vxe-column>
+ <vxe-column field="qty_to_unload" :title="$t('wms.stockList.qty_to_unload')"></vxe-column>
+ <vxe-column field="qty_to_sort" :title="$t('wms.stockList.qty_to_sort')"></vxe-column>
+ <vxe-column field="qty_sorted" :title="$t('wms.stockList.qty_sorted')"></vxe-column>
+ <vxe-column field="shortage_qty" :title="$t('wms.stockList.shortage_qty')"></vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <skuInfo :show-dialog="data.showDialogShowInfo" :sku_id="data.sku_id" @close="method.closeDialogShowInfo" />
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents, VxeTablePropTypes } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { StockVO } from '@/types/WMS/StockManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { getStockList } from '@/api/wms/stockManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import customPager from '@/components/custom-pager.vue'
+import skuInfo from './sku-info.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTableWarehouse = ref()
+
+const data = reactive({
+ sku_id: 0,
+ showDialog: false,
+ showDialogShowInfo: false,
+ searchForm: {
+ spu_name: ''
+ },
+ activeTab: null,
+ tableData: ref<StockVO[]>([]),
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ closeDialogShowInfo: () => {
+ data.showDialogShowInfo = false
+ },
+ showSkuInfo(row: StockVO) {
+ data.sku_id = row.sku_id
+ data.showDialogShowInfo = true
+ },
+ sumNum: (list: any[], field: string) => {
+ let count = 0
+ list.forEach((item) => {
+ count += Number(item[field])
+ })
+ return count
+ },
+ // footerMethod:ref<VxeTablePropTypes.FooterMethod>({ columns, data }) => {
+ // columns.map((column, columnIndex) => {
+ // if (columnIndex === 0) {
+ // return '合计'
+ // }
+ // if (['qty', 'qty_available'].includes(column.field)) {
+ // return method.sumNum(data, column.field)
+ // }
+ // return null
+ // })
+ // },
+ // Refresh data
+ refresh: () => {
+ method.getStockList()
+ },
+ getStockList: async () => {
+ const { data: res } = await getStockList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getStockList()
+ }),
+ exportTable: () => {
+ const $table = xTableWarehouse.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.stockManagement.stock'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getStockList()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+defineExpose({
+ getStockList: method.getStockList
+})
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/view/wms/stockManagement/tabStockLocation.vue b/frontend/src/view/wms/stockManagement/tabStockLocation.vue
index 7ae3408..307c5fe 100644
--- a/frontend/src/view/wms/stockManagement/tabStockLocation.vue
+++ b/frontend/src/view/wms/stockManagement/tabStockLocation.vue
@@ -1,195 +1,195 @@
-<template>
- <div class="operateArea">
- <v-row no-gutters>
- <!-- Operate Btn -->
- <v-col cols="3" class="col">
- <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
- <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
- </v-col>
-
- <!-- Search Input -->
- <v-col cols="9">
- <v-row no-gutters @keyup.enter="method.sureSearch">
- <v-col cols="4"></v-col>
- <v-col cols="4"></v-col>
- <v-col cols="4">
- <v-text-field
- v-model="data.searchForm.location_name"
- clearable
- hide-details
- density="comfortable"
- class="searchInput ml-5 mt-1"
- :label="$t('wms.stockLocation.location_name')"
- variant="solo"
- >
- </v-text-field>
- </v-col>
- </v-row>
- </v-col>
- </v-row>
- </div>
-
- <!-- Table -->
- <div
- class="mt-5"
- :style="{
- height: cardHeight
- }"
- >
- <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
- <template #empty>
- {{ i18n.global.t('system.page.noData') }}
- </template>
- <vxe-column type="seq" width="60"></vxe-column>
- <vxe-column type="checkbox" width="50"></vxe-column>
- <vxe-column field="warehouse_name" :title="$t('wms.stockLocation.warehouse_name')"></vxe-column>
- <vxe-column field="location_name" :title="$t('wms.stockLocation.location_name')"></vxe-column>
- <vxe-column field="spu_code" :title="$t('wms.stockLocation.spu_code')">
- <template #default="{ row }">
- <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
- </template>
- </vxe-column>
- <vxe-column field="spu_name" :title="$t('wms.stockLocation.spu_name')"></vxe-column>
- <vxe-column field="sku_code" :title="$t('wms.stockLocation.sku_code')"></vxe-column>
- <vxe-column field="sku_name" :title="$t('wms.stockLocation.sku_name')"></vxe-column>
- <vxe-column field="qty" :title="$t('wms.stockLocation.qty')"></vxe-column>
- <vxe-column field="qty_available" :title="$t('wms.stockLocation.qty_available')"></vxe-column>
- <vxe-column field="qty_locked" :title="$t('wms.stockLocation.qty_locked')"></vxe-column>
- <vxe-column field="qty_frozen" :title="$t('wms.stockLocation.qty_frozen')"></vxe-column>
- </vxe-table>
- <custom-pager
- :current-page="data.tablePage.pageIndex"
- :page-size="data.tablePage.pageSize"
- perfect
- :total="data.tablePage.total"
- :page-sizes="PAGE_SIZE"
- :layouts="PAGE_LAYOUT"
- @page-change="method.handlePageChange"
- >
- </custom-pager>
- </div>
- <skuInfo :show-dialog="data.showDialogShowInfo" :sku_id="data.sku_id" @close="method.closeDialogShowInfo" />
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, reactive, watch } from 'vue'
-import { VxePagerEvents } from 'vxe-table'
-import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
-import { StockLocationVO } from '@/types/WMS/StockManagement'
-import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
-import { hookComponent } from '@/components/system'
-import { DEBOUNCE_TIME } from '@/constant/system'
-import { setSearchObject } from '@/utils/common'
-import { SearchObject } from '@/types/System/Form'
-import { getStockLocationList } from '@/api/wms/stockManagement'
-import tooltipBtn from '@/components/tooltip-btn.vue'
-import i18n from '@/languages/i18n'
-import customPager from '@/components/custom-pager.vue'
-import skuInfo from './sku-info.vue'
-import { exportData } from '@/utils/exportTable'
-
-const xTableStockLocation = ref()
-
-const data = reactive({
- sku_id: 0,
- showDialog: false,
- showDialogShowInfo: false,
- searchForm: {
- location_name: ''
- },
- activeTab: null,
- tableData: ref<StockLocationVO[]>([]),
- tablePage: reactive({
- total: 0,
- pageIndex: 1,
- pageSize: DEFAULT_PAGE_SIZE,
- searchObjects: ref<Array<SearchObject>>([])
- }),
- timer: ref<any>(null)
-})
-
-const method = reactive({
- closeDialogShowInfo: () => {
- data.showDialogShowInfo = false
- },
- showSkuInfo(row: StockLocationVO) {
- data.sku_id = row.sku_id
- data.showDialogShowInfo = true
- },
- // Refresh data
- refresh: () => {
- method.getStockLocationList()
- },
- getStockLocationList: async () => {
- const { data: res } = await getStockLocationList(data.tablePage)
- if (!res.isSuccess) {
- hookComponent.$message({
- type: 'error',
- content: res.errorMessage
- })
- return
- }
- data.tableData = res.data.rows
- data.tablePage.total = res.data.totals
- },
- handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
- data.tablePage.pageIndex = currentPage
- data.tablePage.pageSize = pageSize
-
- method.getStockLocationList()
- }),
- exportTable: () => {
- const $table = xTableStockLocation.value
- exportData({
- table: $table,
- filename: i18n.global.t('wms.stockManagement.stockLocation'),
- columnFilterMethod({ column }: any) {
- return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
- }
- })
- },
- sureSearch: () => {
- data.tablePage.searchObjects = setSearchObject(data.searchForm)
- method.getStockLocationList()
- }
-})
-
-const cardHeight = computed(() => computedCardHeight({}))
-const tableHeight = computed(() => computedTableHeight({}))
-
-defineExpose({
- getStockLocationList: method.getStockLocationList
-})
-watch(
- () => data.searchForm,
- () => {
- // debounce
- if (data.timer) {
- clearTimeout(data.timer)
- }
- data.timer = setTimeout(() => {
- data.timer = null
- method.sureSearch()
- }, DEBOUNCE_TIME)
- },
- {
- deep: true
- }
-)
-</script>
-
-<style lang="less" scoped>
-.operateArea {
- width: 100%;
- min-width: 760px;
- display: flex;
- align-items: center;
- border-radius: 10px;
- padding: 0 10px;
-}
-
-.col {
- display: flex;
- align-items: center;
-}
-</style>
+<template>
+ <div class="operateArea">
+ <v-row no-gutters>
+ <!-- Operate Btn -->
+ <v-col cols="3" class="col">
+ <tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
+ <tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
+ </v-col>
+
+ <!-- Search Input -->
+ <v-col cols="9">
+ <v-row no-gutters @keyup.enter="method.sureSearch">
+ <v-col cols="4"></v-col>
+ <v-col cols="4"></v-col>
+ <v-col cols="4">
+ <v-text-field
+ v-model="data.searchForm.location_name"
+ clearable
+ hide-details
+ density="comfortable"
+ class="searchInput ml-5 mt-1"
+ :label="$t('wms.stockLocation.location_name')"
+ variant="solo"
+ >
+ </v-text-field>
+ </v-col>
+ </v-row>
+ </v-col>
+ </v-row>
+ </div>
+
+ <!-- Table -->
+ <div
+ class="mt-5"
+ :style="{
+ height: cardHeight
+ }"
+ >
+ <vxe-table ref="xTableStockLocation" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
+ <template #empty>
+ {{ i18n.global.t('system.page.noData') }}
+ </template>
+ <vxe-column type="seq" width="60"></vxe-column>
+ <vxe-column type="checkbox" width="50"></vxe-column>
+ <vxe-column field="warehouse_name" :title="$t('wms.stockLocation.warehouse_name')"></vxe-column>
+ <vxe-column field="location_name" :title="$t('wms.stockLocation.location_name')"></vxe-column>
+ <vxe-column field="spu_code" :title="$t('wms.stockLocation.spu_code')">
+ <template #default="{ row }">
+ <div :class="'text-decoration-none'" @click="method.showSkuInfo(row)"> {{ row.sku_code }}</div>
+ </template>
+ </vxe-column>
+ <vxe-column field="spu_name" :title="$t('wms.stockLocation.spu_name')"></vxe-column>
+ <vxe-column field="sku_code" :title="$t('wms.stockLocation.sku_code')"></vxe-column>
+ <vxe-column field="sku_name" :title="$t('wms.stockLocation.sku_name')"></vxe-column>
+ <vxe-column field="qty" :title="$t('wms.stockLocation.qty')"></vxe-column>
+ <vxe-column field="qty_available" :title="$t('wms.stockLocation.qty_available')"></vxe-column>
+ <vxe-column field="qty_locked" :title="$t('wms.stockLocation.qty_locked')"></vxe-column>
+ <vxe-column field="qty_frozen" :title="$t('wms.stockLocation.qty_frozen')"></vxe-column>
+ </vxe-table>
+ <custom-pager
+ :current-page="data.tablePage.pageIndex"
+ :page-size="data.tablePage.pageSize"
+ perfect
+ :total="data.tablePage.total"
+ :page-sizes="PAGE_SIZE"
+ :layouts="PAGE_LAYOUT"
+ @page-change="method.handlePageChange"
+ >
+ </custom-pager>
+ </div>
+ <skuInfo :show-dialog="data.showDialogShowInfo" :sku_id="data.sku_id" @close="method.closeDialogShowInfo" />
+</template>
+
+<script lang="ts" setup>
+import { computed, ref, reactive, watch } from 'vue'
+import { VxePagerEvents } from 'vxe-table'
+import { computedCardHeight, computedTableHeight, errorColor } from '@/constant/style'
+import { StockLocationVO } from '@/types/WMS/StockManagement'
+import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
+import { hookComponent } from '@/components/system'
+import { DEBOUNCE_TIME } from '@/constant/system'
+import { setSearchObject } from '@/utils/common'
+import { SearchObject } from '@/types/System/Form'
+import { getStockLocationList } from '@/api/wms/stockManagement'
+import tooltipBtn from '@/components/tooltip-btn.vue'
+import i18n from '@/languages/i18n'
+import customPager from '@/components/custom-pager.vue'
+import skuInfo from './sku-info.vue'
+import { exportData } from '@/utils/exportTable'
+
+const xTableStockLocation = ref()
+
+const data = reactive({
+ sku_id: 0,
+ showDialog: false,
+ showDialogShowInfo: false,
+ searchForm: {
+ location_name: ''
+ },
+ activeTab: null,
+ tableData: ref<StockLocationVO[]>([]),
+ tablePage: reactive({
+ total: 0,
+ pageIndex: 1,
+ pageSize: DEFAULT_PAGE_SIZE,
+ searchObjects: ref<Array<SearchObject>>([])
+ }),
+ timer: ref<any>(null)
+})
+
+const method = reactive({
+ closeDialogShowInfo: () => {
+ data.showDialogShowInfo = false
+ },
+ showSkuInfo(row: StockLocationVO) {
+ data.sku_id = row.sku_id
+ data.showDialogShowInfo = true
+ },
+ // Refresh data
+ refresh: () => {
+ method.getStockLocationList()
+ },
+ getStockLocationList: async () => {
+ const { data: res } = await getStockLocationList(data.tablePage)
+ if (!res.isSuccess) {
+ hookComponent.$message({
+ type: 'error',
+ content: res.errorMessage
+ })
+ return
+ }
+ data.tableData = res.data.rows
+ data.tablePage.total = res.data.totals
+ },
+ handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
+ data.tablePage.pageIndex = currentPage
+ data.tablePage.pageSize = pageSize
+
+ method.getStockLocationList()
+ }),
+ exportTable: () => {
+ const $table = xTableStockLocation.value
+ exportData({
+ table: $table,
+ filename: i18n.global.t('wms.stockManagement.stockLocation'),
+ columnFilterMethod({ column }: any) {
+ return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
+ }
+ })
+ },
+ sureSearch: () => {
+ data.tablePage.searchObjects = setSearchObject(data.searchForm)
+ method.getStockLocationList()
+ }
+})
+
+const cardHeight = computed(() => computedCardHeight({}))
+const tableHeight = computed(() => computedTableHeight({}))
+
+defineExpose({
+ getStockLocationList: method.getStockLocationList
+})
+watch(
+ () => data.searchForm,
+ () => {
+ // debounce
+ if (data.timer) {
+ clearTimeout(data.timer)
+ }
+ data.timer = setTimeout(() => {
+ data.timer = null
+ method.sureSearch()
+ }, DEBOUNCE_TIME)
+ },
+ {
+ deep: true
+ }
+)
+</script>
+
+<style lang="less" scoped>
+.operateArea {
+ width: 100%;
+ min-width: 760px;
+ display: flex;
+ align-items: center;
+ border-radius: 10px;
+ padding: 0 10px;
+}
+
+.col {
+ display: flex;
+ align-items: center;
+}
+</style>
diff --git a/frontend/src/vite-env.d.ts b/frontend/src/vite-env.d.ts
index 11f02fe..7d0ff9e 100644
--- a/frontend/src/vite-env.d.ts
+++ b/frontend/src/vite-env.d.ts
@@ -1 +1 @@
-/// <reference types="vite/client" />
+/// <reference types="vite/client" />