This commit is contained in:
mkm 2024-09-06 17:53:26 +08:00
parent 812df84c2e
commit 77b6386241
6 changed files with 151 additions and 19 deletions

View File

@ -28,3 +28,7 @@ export function apiWarehouseProductDetail(params: any) {
export function apiWarehouseProductEnter(params: any) {
return request.post({ url: '/warehouse_product/warehouseproduct/enter', params })
}
//商品结算
export function apiWarehouseProductSettlement(params: any) {
return request.post({ url: '/warehouse_product/warehouseproduct/settlement', params })
}

View File

@ -172,12 +172,19 @@
</template>
</el-table-column>
<el-table-column
label="库存"
label="库存"
prop="total_stock"
min-width="100"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="价值"
prop="total_price"
min-width="100"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="采购总价"
prop="total_purchase"

View File

@ -142,7 +142,7 @@
>
</template>
</el-table-column>
<el-table-column
<!-- <el-table-column
label="会员价"
prop="vip_price"
min-width="120"
@ -155,7 +155,7 @@
>{{ row.vip_price }}</span
>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column
label="终端零售价"
prop="price"
@ -173,8 +173,10 @@
<el-table-column label="商品条码" prop="bar_code" show-overflow-tooltip />
<el-table-column label="销量" prop="sales" show-overflow-tooltip />
<el-table-column label="售卖库存" prop="stock" show-overflow-tooltip />
<el-table-column label="兑换库存" prop="swap" show-overflow-tooltip />
<!-- <el-table-column label="兑换库存" prop="swap" show-overflow-tooltip /> -->
<el-table-column label="单位" prop="unit_name" show-overflow-tooltip />
<el-table-column label="价值" prop="total_price" show-overflow-tooltip />
<el-table-column label="状态" prop="status">
<template #default="{ row }">
<el-switch

View File

@ -49,21 +49,6 @@
:readonly="false"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group
v-model="formData.status"
placeholder="请选择状态"
:disabled="false"
>
<el-radio
v-for="(item, index) in dictData.show_status"
:key="index"
:label="parseInt(item.value)"
>
{{ item.name }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</popup>
</div>

View File

@ -48,6 +48,36 @@
<el-table-column label="结算周期" prop="settle_cycle" show-overflow-tooltip />
<el-table-column label="商户地址" prop="address" show-overflow-tooltip />
<el-table-column label="商户备注" prop="mark" show-overflow-tooltip />
<el-table-column
label="已结"
prop="total_completed_amount"
min-width="100"
show-overflow-tooltip
>
<template #default="{ row }">
<el-button
type="primary"
link
@click="handleWarehouseProduct(row, 1)"
>{{ row.total_completed_amount || 0 }}</el-button
>
</template>
</el-table-column>
<el-table-column
label="未结"
prop="total_outstanding_amount"
min-width="100"
show-overflow-tooltip
>
<template #default="{ row }">
<el-button
type="primary"
link
@click="handleWarehouseProduct(row, 0)"
>{{ row.total_outstanding_amount || 0 }}</el-button
>
</template>
</el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
@ -81,6 +111,7 @@
@success="getLists"
@close="showEdit = false"
/>
<warehouseProduct ref="warehouseProductRef"></warehouseProduct>
</div>
</template>
@ -91,6 +122,10 @@ import { apiSupplierLists, apiSupplierDelete } from '@/api/supplier'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import warehouseProduct from './warehouseProduct.vue'
const showWarehouseProduct = ref(false)
const warehouseProductRef = ref(null)
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
@ -109,6 +144,13 @@ const selectData = ref<any[]>([])
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const handleWarehouseProduct = async (data: any, type = 1) => {
showWarehouseProduct.value = true
await nextTick()
warehouseProductRef.value?.open()
warehouseProductRef.value?.getDetail(data, type)
}
//
const { dictData } = useDictData('show_status')

View File

@ -0,0 +1,92 @@
<template>
<div class="edit-popup">
<el-drawer title="结算详情" :size="1000" v-model="isOpen">
<div>
<div>
<el-table :data="pager.lists">
<el-table-column label="id" prop="id" show-overflow-tooltip />
<el-table-column label="商品图片" prop="image" min-width="80">
<template #default="{ row }">
<el-image
style="width: 50px; height: 50px"
:src="row.image"
:preview-teleported="true"
/>
</template>
</el-table-column>
<el-table-column label="商品名称" prop="store_name" show-overflow-tooltip />
<el-table-column label="仓库" prop="warehouse_name" show-overflow-tooltip />
<el-table-column
label="供应商"
prop="supplier_name"
show-overflow-tooltip
/>
<el-table-column label="供货价" prop="purchase" show-overflow-tooltip />
<el-table-column label="数量" prop="nums" show-overflow-tooltip />
<el-table-column label="价值" prop="total_price" show-overflow-tooltip />
<el-table-column
label="操作"
width="120"
fixed="right"
v-if="queryParams.is_pay == 0"
>
<template #default="{ row }">
<el-button
type="primary"
link
@click="handlePay(row)"
v-if="row.is_pay == 0"
>
结算
</el-button>
</template>
</el-table-column>
</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 { apiWarehouseProductLists, apiWarehouseProductSettlement } from '@/api/warehouse_product'
import type { PropType } from 'vue'
const emit = defineEmits(['success', 'close'])
const isOpen = ref(false)
//
const queryParams = reactive({
supplier_id: '',
is_pay: 1
})
const getDetail = async (row: Record<string, any>, type: number) => {
queryParams.supplier_id = row.id
queryParams.is_pay = type
getLists()
}
//
const open = () => {
isOpen.value = true
}
const handlePay = (row: Record<string, any>) => {
apiWarehouseProductSettlement({ id: row.id }).then((res) => {
getLists()
})
}
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiWarehouseProductLists,
params: queryParams
})
defineExpose({
open,
getDetail
})
</script>