调整商品溯源
This commit is contained in:
parent
6f487dc55f
commit
6f076f6e9c
63
src/views/product_source_link/details_stock.vue
Normal file
63
src/views/product_source_link/details_stock.vue
Normal file
@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<el-drawer title="详情" :size="900" v-model="isOpen">
|
||||
<div>
|
||||
<div>
|
||||
<el-table :data="pager.lists">
|
||||
<el-table-column label="类型" prop="type_name" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="关联ID" prop="link_id" show-overflow-tooltip width="80" />
|
||||
<el-table-column label="数量" prop="nums" show-overflow-tooltip width="80" />
|
||||
<el-table-column label="单价" prop="price" show-overflow-tooltip width="80" />
|
||||
<el-table-column label="供货价" prop="purchase" show-overflow-tooltip width="80" />
|
||||
<el-table-column label="商户价" prop="cost" show-overflow-tooltip width="80" />
|
||||
<el-table-column label="会员价" prop="vip_price" show-overflow-tooltip width="80" />
|
||||
<el-table-column label="总价" prop="total_price" show-overflow-tooltip width="80" />
|
||||
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end" v-if="pager.lists.length < pager.count">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="storeProductDETAILS">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { apiProductSourceLinkInfoLists } from '@/api/product_source_link_info'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const isOpen = ref(false)
|
||||
|
||||
const getDetail = async (row : Record<string, any>) => {
|
||||
queryParams.oid = row.store_id
|
||||
getLists()
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
isOpen.value = true
|
||||
}
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
oid: '',
|
||||
})
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiProductSourceLinkInfoLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
@ -1,148 +1,111 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button
|
||||
v-perms="['product_source_link.product_source_link/add']"
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['product_source_link.product_source_link/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="id" prop="id" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="采购人"
|
||||
prop="purchase_nickname"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="商品图片" prop="image" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.image" style="width: 50px; height: 50px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="product_name" show-overflow-tooltip />
|
||||
<el-table-column label="总采购数" prop="total_nums" show-overflow-tooltip />
|
||||
<el-table-column label="当前数量" prop="nums" show-overflow-tooltip />
|
||||
<el-table-column label="仓库" prop="warehouse_name" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="仓库累计总数"
|
||||
prop="warehouse_total_nums"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="仓库实际数量"
|
||||
prop="warehouse_nums"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['product_source_link.product_source_link/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['product_source_link.product_source_link/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup
|
||||
v-if="showEdit"
|
||||
ref="editRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showEdit = false"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="id" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="采购人" prop="purchase_nickname" show-overflow-tooltip />
|
||||
<el-table-column label="商品ID" prop="product_id" show-overflow-tooltip />
|
||||
<el-table-column label="商品名称" prop="product_name" show-overflow-tooltip />
|
||||
<el-table-column label="商品图片" prop="image" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.image" style="width: 50px; height: 50px" :preview-teleported="true"
|
||||
:preview-src-list="[row.image]" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购数量" prop="total_nums" show-overflow-tooltip />
|
||||
<el-table-column label="仓库" prop="warehouse_name" show-overflow-tooltip />
|
||||
<el-table-column label="出库数量" prop="warehouse_outbound_nums" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['product_source_link.product_source_link/edit']" type="primary" link
|
||||
@click="handleStockDetai(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
<DetailsStock ref="StockDetailsRef"></DetailsStock>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="productSourceLinkLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiProductSourceLinkLists, apiProductSourceLinkDelete } from '@/api/product_source_link'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiProductSourceLinkLists, apiProductSourceLinkDelete } from '@/api/product_source_link'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import DetailsStock from './details_stock.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showStockDetails = ref(false)
|
||||
const StockDetailsRef = ref(null)
|
||||
// 库存详情
|
||||
const handleStockDetai = async (data : any) => {
|
||||
showStockDetails.value = true
|
||||
await nextTick()
|
||||
StockDetailsRef.value?.open()
|
||||
StockDetailsRef.value?.getDetail(data)
|
||||
}
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({})
|
||||
// 查询条件
|
||||
const queryParams = reactive({})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val : any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiProductSourceLinkLists,
|
||||
params: queryParams
|
||||
})
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiProductSourceLinkLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
// 编辑
|
||||
const handleEdit = async (data : any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiProductSourceLinkDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
// 删除
|
||||
const handleDelete = async (id : number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiProductSourceLinkDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
getLists()
|
||||
</script>
|
@ -1,128 +1,96 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
inline
|
||||
>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['product_source_link_info.product_source_link_info/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['product_source_link_info.product_source_link_info/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="上级关联id" prop="oid" show-overflow-tooltip />
|
||||
<el-table-column label="商品" prop="product_id" show-overflow-tooltip />
|
||||
<el-table-column label="数量" prop="nums" show-overflow-tooltip />
|
||||
<el-table-column label="1入库2出库3门店4订单" prop="types" show-overflow-tooltip />
|
||||
<el-table-column label="溯源id" prop="link_id" show-overflow-tooltip />
|
||||
<el-table-column label="总价" prop="total_price" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['product_source_link_info.product_source_link_info/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['product_source_link_info.product_source_link_info/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="商品ID" prop="product_id" show-overflow-tooltip />
|
||||
<el-table-column label="商品名称" prop="product_name" show-overflow-tooltip />
|
||||
<el-table-column label="商品图片" prop="image" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.image" style="width: 50px; height: 50px" :preview-teleported="true"
|
||||
:preview-src-list="[row.image]" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="nums" show-overflow-tooltip />
|
||||
<el-table-column label="类型" prop="type_name" show-overflow-tooltip />
|
||||
<el-table-column label="溯源id" prop="link_id" show-overflow-tooltip />
|
||||
<el-table-column label="单价" prop="price" show-overflow-tooltip />
|
||||
<el-table-column label="总价" prop="total_price" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="productSourceLinkInfoLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiProductSourceLinkInfoLists, apiProductSourceLinkInfoDelete } from '@/api/product_source_link_info'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiProductSourceLinkInfoLists, apiProductSourceLinkInfoDelete } from '@/api/product_source_link_info'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
|
||||
})
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
})
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val : any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiProductSourceLinkInfoLists,
|
||||
params: queryParams
|
||||
})
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiProductSourceLinkInfoLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiProductSourceLinkInfoDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
// 编辑
|
||||
const handleEdit = async (data : any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
// 删除
|
||||
const handleDelete = async (id : number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiProductSourceLinkInfoDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user