From e5634e4d19c0967678a7cd3b9098e3254988524c Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 1 Aug 2024 14:00:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E5=95=86=E5=93=81?= =?UTF-8?q?=E4=BB=93=E5=82=A8=E4=BF=A1=E6=81=AF=E7=9A=84=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E5=B9=B6=E6=B7=BB=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=A6=82=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E6=97=A5=E6=9C=9F=E5=92=8C=E4=BF=9D=E8=B4=A8=E6=9C=9F?= =?UTF-8?q?=E7=9A=84=E9=80=89=E6=8B=A9=E3=80=82=E5=90=8C=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=92=8C=E8=A1=A8=E6=A0=BC=E6=98=BE=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/warehouse_product.ts | 6 +- src/api/warehouse_product_storege.ts | 29 ++++ src/components/productPop/index.vue | 107 +++++++++--- src/components/warehousePop/index.vue | 73 ++++++++ src/views/warehouse/import.vue | 229 +++++++++++++++++++++++++ src/views/warehouse/index.vue | 53 ++++-- src/views/warehouse/product_import.vue | 223 ++++++++++++++++++++++++ src/views/warehouse_product/edit.vue | 75 ++++++-- src/views/warehouse_product/index.vue | 29 +++- 9 files changed, 773 insertions(+), 51 deletions(-) create mode 100644 src/api/warehouse_product_storege.ts create mode 100644 src/components/warehousePop/index.vue create mode 100644 src/views/warehouse/import.vue create mode 100644 src/views/warehouse/product_import.vue diff --git a/src/api/warehouse_product.ts b/src/api/warehouse_product.ts index ad05bdcc1..302a90e84 100644 --- a/src/api/warehouse_product.ts +++ b/src/api/warehouse_product.ts @@ -23,4 +23,8 @@ export function apiWarehouseProductDelete(params: any) { // 商品仓储信息详情 export function apiWarehouseProductDetail(params: any) { return request.get({ url: '/warehouse_product/warehouseproduct/detail', params }) -} \ No newline at end of file +} +// 商品仓储信息确认 +export function apiWarehouseProductEnter(params: any) { + return request.post({ url: '/warehouse_product/warehouseproduct/enter', params }) +} diff --git a/src/api/warehouse_product_storege.ts b/src/api/warehouse_product_storege.ts new file mode 100644 index 000000000..3538f13df --- /dev/null +++ b/src/api/warehouse_product_storege.ts @@ -0,0 +1,29 @@ +import request from '@/utils/request' + +// 仓库商品存储列表 +export function apiWarehouseProductStoregeLists(params: any) { + return request.get({ url: '/warehouse_product_storege/warehouseproductstorege/lists', params }) +} + +// 添加仓库商品存储 +export function apiWarehouseProductStoregeAdd(params: any) { + return request.post({ url: '/warehouse_product_storege/warehouseproductstorege/add', params }) +} + +// 编辑仓库商品存储 +export function apiWarehouseProductStoregeEdit(params: any) { + return request.post({ url: '/warehouse_product_storege/warehouseproductstorege/edit', params }) +} + +// 删除仓库商品存储 +export function apiWarehouseProductStoregeDelete(params: any) { + return request.post({ + url: '/warehouse_product_storege/warehouseproductstorege/delete', + params + }) +} + +// 仓库商品存储详情 +export function apiWarehouseProductStoregeDetail(params: any) { + return request.get({ url: '/warehouse_product_storege/warehouseproductstorege/detail', params }) +} diff --git a/src/components/productPop/index.vue b/src/components/productPop/index.vue index ea3cf2c7c..a118d276b 100644 --- a/src/components/productPop/index.vue +++ b/src/components/productPop/index.vue @@ -2,7 +2,13 @@
- + 查询 @@ -15,18 +21,64 @@ - - - - + + + + - - - - + + + +
@@ -40,18 +92,23 @@ import { usePaging } from '@/hooks/usePaging' import { useDictData } from '@/hooks/useDictOptions' import { apiStoreProductLists } from '@/api/store_product' +import { apiWarehouseProductStoregeLists } from '@/api/warehouse_product_storege' import { timeFormat } from '@/utils/util' import feedback from '@/utils/feedback' import { ElMessage } from 'element-plus' - +const props = defineProps<{ + is_warehouse: number + code: any[] +}>() // 查询条件 const queryParams = reactive({ - store_name: '', + store_name: '' }) // 选中数据 const selectData = ref([]) +const datas = ref() // 表格选择后回调事件 const handleSelectionChange = (val: any[]) => { @@ -62,18 +119,26 @@ const handleSelectionChange = (val: any[]) => { const { dictData } = useDictData('') // 分页相关 -const { pager, getLists, resetParams, resetPage } = usePaging({ - fetchFun: apiStoreProductLists, - params: queryParams -}) +if (props.is_warehouse == 1) { + datas.value = { + fetchFun: apiWarehouseProductStoregeLists, + params: queryParams + } +} else { + datas.value = { + fetchFun: apiStoreProductLists, + params: queryParams + } +} +const { pager, getLists, resetParams, resetPage } = usePaging(datas.value) -getLists(); +getLists() -const emits = defineEmits(["onBindStore"]); +const emits = defineEmits(['onBindStore']) // 绑定用户 const bindStore = () => { - let list = pager.lists.filter(item => selectData.value.includes(item.id)); - if (!list.length) return ElMessage.error('请先选择门店'); + const list = pager.lists.filter((item) => selectData.value.includes(item.id)) + if (!list.length) return ElMessage.error('请先选择门店') emits('onBindStore', list) -}; +} diff --git a/src/components/warehousePop/index.vue b/src/components/warehousePop/index.vue new file mode 100644 index 000000000..d141d1bc4 --- /dev/null +++ b/src/components/warehousePop/index.vue @@ -0,0 +1,73 @@ + + + diff --git a/src/views/warehouse/import.vue b/src/views/warehouse/import.vue new file mode 100644 index 000000000..02a015586 --- /dev/null +++ b/src/views/warehouse/import.vue @@ -0,0 +1,229 @@ + + + diff --git a/src/views/warehouse/index.vue b/src/views/warehouse/index.vue index b61b4186a..879badb87 100644 --- a/src/views/warehouse/index.vue +++ b/src/views/warehouse/index.vue @@ -1,19 +1,30 @@ @@ -98,16 +135,24 @@ const formRef = shallowRef() const popupRef = shallowRef>() const mode = ref('add') const showWarehouse = ref(false) // 选择仓库列表是否显示 -const productList = ref([]) +const showProduct = ref(false) // 选择商品列表是否显示 +// const productList = ref([]) -const onBindProduct = (e: any[]) => { - e.forEach((item: any) => { - if (!productList.value.find((t: any) => t.id == item.id)) { - productList.value.push(item) - } - }) +const onBindWarehouse = (e: any[]) => { + formData.warehouse_name = e.name + formData.warehouse_id = e.id + // e.forEach((item: any) => { + // if (!productList.value.find((t: any) => t.id == item.id)) { + // productList.value.push(item) + // } + // }) showWarehouse.value = false } +const onBindStore = (e: any[]) => { + formData.product_name = e[0].store_name + formData.product_id = e[0].id + showProduct.value = false +} // 弹窗标题 const popupTitle = computed(() => { return mode.value == 'edit' ? '编辑商品仓储信息' : '新增商品仓储信息' @@ -124,7 +169,11 @@ const formData = reactive({ price: '', total_price: '', status: '', - warehouse_name: '' + warehouse_name: '', + product_name: '', + manufacture: '', + expiration_date: '', + code: '' }) // 表单验证 diff --git a/src/views/warehouse_product/index.vue b/src/views/warehouse_product/index.vue index 3c7b56f61..60883f8fd 100644 --- a/src/views/warehouse_product/index.vue +++ b/src/views/warehouse_product/index.vue @@ -62,8 +62,9 @@ + - + + + - + @@ -113,7 +127,11 @@