新增库房验收功能和采购信息设置

- 在采购产品报价模块中添加了库房信息设置功能
- 前端增加了库房设置信息的界面和相关逻辑
- 修改了采购订单详情页面,增加了姓名、手机、地址等信息的显示
- 优化了商品明细页面,移除了不必要的操作和数据
This commit is contained in:
mkm 2024-10-17 18:01:55 +08:00
parent 761e381e58
commit 8c54f9965e
5 changed files with 270 additions and 143 deletions

View File

@ -34,7 +34,13 @@ export function apiPurchaseProductOfferSetBatchProcureInfo(params: any) {
params params
}) })
} }
// 仓库验收信息设置
export function apiPurchaseProductOffersetStoreroomInfo(params: any) {
return request.post({
url: '/purchase_product_offer/purchaseproductoffer/setStoreroomInfo',
params
})
}
// 采购供应链商品详情 // 采购供应链商品详情
export function apiPurchaseProductOfferDetail(params: any) { export function apiPurchaseProductOfferDetail(params: any) {
return request.get({ url: '/purchase_product_offer/purchaseproductoffer/detail', params }) return request.get({ url: '/purchase_product_offer/purchaseproductoffer/detail', params })

View File

@ -22,13 +22,8 @@
<el-radio :label="6">往期补单</el-radio> <el-radio :label="6">往期补单</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="门店" prop="store_id"> <el-form-item label="门店" prop="store_id" style="width: 300px">
<el-select <el-select v-model="formData.store_id" placeholder="请选择门店" size="large">
v-model="formData.store_id"
placeholder="请选择门店"
size="large"
style="width: 240px"
>
<el-option <el-option
v-for="item in storeList" v-for="item in storeList"
:key="item.id" :key="item.id"
@ -37,6 +32,27 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="送货时间" style="width: 300px">
<el-date-picker
:readonly="false"
class="flex-1 !flex"
v-model="formData.arrival_time"
clearable
type="date"
value-format="YYYY-MM-DD"
placeholder="选择生产日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="姓名" style="width: 240px">
<el-input v-model="formData.nikename" type="input" />
</el-form-item>
<el-form-item label="手机" style="width: 240px">
<el-input v-model="formData.phone" type="input" />
</el-form-item>
<el-form-item label="地址">
<el-input v-model="formData.address" type="input" />
</el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="formData.mark" type="input" rows="4" /> <el-input v-model="formData.mark" type="input" rows="4" />
</el-form-item> </el-form-item>
@ -138,6 +154,10 @@ const formData = reactive({
total_price: 0, total_price: 0,
order_type: 1, order_type: 1,
store_id: '', store_id: '',
nikename: '',
phone: '',
address: '',
arrival_time: '',
mark: '' mark: ''
}) })

View File

@ -31,6 +31,9 @@
<el-button type="primary" link @click="procureClick(row)" <el-button type="primary" link @click="procureClick(row)"
>设置采购信息</el-button >设置采购信息</el-button
> >
<el-button type="primary" link @click="storeroomClick(row)"
>库房设置信息</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -155,13 +158,50 @@
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
<el-dialog v-model="storeroomShow" title="验货设置" width="600">
<el-form ref="formRef" :model="storeroom" label-width="90px">
<el-form-item label="验收数量" prop="accept_num">
<el-input
v-model="storeroom.accept_num"
clearable
placeholder="请输入验收数量"
:readonly="false"
@change="compute"
/>
</el-form-item>
<el-form-item label="毛重" prop="gross_weight">
<el-input
v-model="storeroom.gross_weight"
clearable
placeholder="请输入毛重"
:readonly="false"
@change="compute"
/>
</el-form-item>
<el-form-item label="净重" prop="net_weight">
<el-input
v-model="storeroom.net_weight"
clearable
placeholder="请输入净重"
:readonly="false"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="storeroomShow = false">取消</el-button>
<el-button type="primary" @click="setStoreroomInfo"> 确认 </el-button>
</div>
</template>
</el-dialog>
</template> </template>
<script lang="ts" setup name="subOrder"> <script lang="ts" setup name="subOrder">
import { usePaging } from '@/hooks/usePaging' import { usePaging } from '@/hooks/usePaging'
import { import {
apiPurchaseProductOfferLists, apiPurchaseProductOfferLists,
apiPurchaseProductOfferSetProcureInfo apiPurchaseProductOfferSetProcureInfo,
apiPurchaseProductOffersetStoreroomInfo
} from '@/api/purchase_product_offer' } from '@/api/purchase_product_offer'
import { apiBeforehandOrderCartInfoOneClickStorage } from '@/api/beforehand_order_cart_info' import { apiBeforehandOrderCartInfoOneClickStorage } from '@/api/beforehand_order_cart_info'
import { apiWarehouseLists } from '@/api/warehouse' import { apiWarehouseLists } from '@/api/warehouse'
@ -172,6 +212,7 @@ const order_id = ref({ id: 0 })
const outbound_lv = ref('') const outbound_lv = ref('')
const dialogBuyer = ref(false) const dialogBuyer = ref(false)
const procureShow = ref(false) const procureShow = ref(false)
const storeroomShow = ref(false)
const warehouse_list = ref([]) const warehouse_list = ref([])
const one_click_storage = ref({ const one_click_storage = ref({
@ -189,6 +230,15 @@ const formData = ref({
buyer_nums: 0, buyer_nums: 0,
pay_type: 1 pay_type: 1
}) })
const storeroom = ref({
id: '',
bhoid: order_id.value.id,
product_id: '',
accept_num: '',
gross_weight: '',
net_weight: ''
})
// //
const resetFormData = () => { const resetFormData = () => {
formData.value = { formData.value = {
@ -223,6 +273,16 @@ const setProcureInfo = () => {
getLists() getLists()
}) })
} }
/**
* 库房信息设置
*/
const setStoreroomInfo = () => {
apiPurchaseProductOffersetStoreroomInfo(storeroom.value).then((res) => {
storeroomShow.value = false
resetFormData()
getLists()
})
}
const procureClick = (data: any) => { const procureClick = (data: any) => {
formData.value.id = data.id formData.value.id = data.id
formData.value.buyer_nums = data.need_num formData.value.buyer_nums = data.need_num
@ -235,6 +295,13 @@ const procureClick = (data: any) => {
}) })
procureShow.value = true procureShow.value = true
} }
const storeroomClick = (data: any) => {
storeroom.value.id = data.id
storeroom.value.bhoid = data.order_id
storeroom.value.product_id = data.product_id
storeroom.value.accept_num = data.buyer_nums
storeroomShow.value = true
}
const compute = () => { const compute = () => {
formData.value.total_price = (formData.value.buyer_nums * formData.value.purchase).toFixed(2) formData.value.total_price = (formData.value.buyer_nums * formData.value.purchase).toFixed(2)
} }

View File

@ -0,0 +1,149 @@
<template>
<div>
<el-button type="primary" @click="beforehand_order_cart_info">导出表格 </el-button>
<el-radio-group v-model="queryParams.top_cate_value" style="margin-left: 30px">
<el-radio
:value="0"
label="全部"
@change="topCateChange({ name: '全部', id: 0 })"
></el-radio>
<el-radio
:value="item.id"
:label="item.name"
v-for="item in formData.top_cate"
:key="item.id"
@change="topCateChange(item)"
></el-radio>
</el-radio-group>
<div>
<el-table :data="pager.lists" v-loading="pager.loading">
<el-table-column label="id" prop="id" show-overflow-tooltip />
<el-table-column label="商品信息" prop="store_name" show-overflow-tooltip>
<template #default="{ row }">
<div class="flex items-center">
<el-image
:src="row.image"
class="w-16 h-16 mr-2"
:preview-teleported="true"
></el-image>
<div>{{ row.store_name }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="单位" prop="unit_name" show-overflow-tooltip />
<el-table-column label="仓库库存" prop="warehouse_stock" show-overflow-tooltip />
<el-table-column label="需要数量" prop="cart_num" show-overflow-tooltip />
<el-table-column label="零售价" prop="price" show-overflow-tooltip />
<el-table-column label="合计" prop="total_price" show-overflow-tooltip />
<el-table-column
label="是否需采购"
prop="is_buyer"
show-overflow-tooltip
width="100"
>
<template #default="{ row }">
<div v-if="row.is_buyer == 0">
<el-button
type="danger"
round
size="small"
@click="handleBuyer(-1, row)"
></el-button
>
<el-button
type="success"
round
size="small"
@click="handleBuyer(1, row)"
></el-button
>
</div>
<div v-else>
<span v-if="row.is_buyer == 1">{{ row.status_name }}</span>
<span v-if="row.is_buyer == -1">无需采购</span>
</div>
</template>
</el-table-column>
<el-table-column label="备注" prop="mark" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['beforehand_order_cart_info.beforehand_order_cart_info/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="[
'beforehand_order_cart_info.beforehand_order_cart_info/delete'
]"
type="danger"
link
@click="handleDeletes(row.id)"
>
删除
</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>
</template>
<script lang="ts" setup name="subOrder">
import { usePaging } from '@/hooks/usePaging'
import { apiBeforehandOrderCartInfoLists } from '@/api/beforehand_order_cart_info'
import { useDictData } from '@/hooks/useDictOptions'
import { useRoute } from 'vue-router'
const route = useRoute()
const queryParams = reactive({
bhoid: route.query.id,
pay_type: '',
top_cate: '',
top_cate_value: ''
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiBeforehandOrderCartInfoLists,
params: queryParams
})
const topCateChange = (row: any) => {
if (row.id == 0) {
queryParams.top_cate = ''
queryParams.top_cate_value = '全部'
getLists()
} else {
queryParams.top_cate = row.id
queryParams.top_cate_value = row.name
getLists()
}
}
const beforehand_order_cart_info = () => {
apiBeforehandOrderCartInfoLists({
export: 2,
bhoid: formData.value.id
}).then((res) => {
window.open(res.url, '_blank')
ElMessage.success('导出成功')
})
}
function getList(id) {
order_id.value.id = id
one_click_storage.value.bhoid = id
formData.value.bhoid = id
queryParams.order_id = id
getLists()
}
defineExpose({
getList
})
</script>

View File

@ -14,6 +14,20 @@
<div style="color: black">{{ formData.system_store }}</div> <div style="color: black">{{ formData.system_store }}</div>
</div> </div>
</div> </div>
<div class="flex items-center justify-between m-4">
<div class="flex flex-col">
<div style="color: gray">姓名</div>
<div style="color: black">{{ formData.nikename }}</div>
</div>
<div class="flex flex-col">
<div style="color: gray">手机</div>
<div style="color: black">{{ formData.phone }}</div>
</div>
<div class="flex flex-col">
<div style="color: gray">送货地址</div>
<div style="color: black">{{ formData.address }}</div>
</div>
</div>
<div class="flex items-center justify-between m-4"> <div class="flex items-center justify-between m-4">
<div class="flex flex-col"> <div class="flex flex-col">
<div style="color: gray">备注</div> <div style="color: gray">备注</div>
@ -42,118 +56,7 @@
@tab-change="tabChange" @tab-change="tabChange"
> >
<el-tab-pane label="明细" name="second"> <el-tab-pane label="明细" name="second">
<el-button type="primary" @click="beforehand_order_cart_info">导出表格 </el-button> <orderCartInfo ref="orderCartInfo" />
<el-radio-group v-model="queryParams.top_cate_value" style="margin-left: 30px">
<el-radio
:value="0"
label="全部"
@change="topCateChange({ name: '全部', id: 0 })"
></el-radio>
<el-radio
:value="item.id"
:label="item.name"
v-for="item in formData.top_cate"
:key="item.id"
@change="topCateChange(item)"
></el-radio>
</el-radio-group>
<div>
<div>
<el-table :data="pager.lists" v-loading="pager.loading">
<el-table-column label="id" prop="id" show-overflow-tooltip />
<el-table-column
label="商品信息"
prop="store_name"
show-overflow-tooltip
>
<template #default="{ row }">
<div class="flex items-center">
<el-image
:src="row.image"
class="w-16 h-16 mr-2"
:preview-teleported="true"
></el-image>
<div>{{ row.store_name }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="单位" prop="unit_name" show-overflow-tooltip />
<el-table-column
label="仓库库存"
prop="warehouse_stock"
show-overflow-tooltip
/>
<el-table-column
label="需要数量"
prop="cart_num"
show-overflow-tooltip
/>
<el-table-column label="零售价" prop="price" show-overflow-tooltip />
<el-table-column
label="合计"
prop="total_price"
show-overflow-tooltip
/>
<el-table-column
label="是否需采购"
prop="is_buyer"
show-overflow-tooltip
width="100"
>
<template #default="{ row }">
<div v-if="row.is_buyer == 0">
<el-button
type="danger"
round
size="small"
@click="handleBuyer(-1, row)"
></el-button
>
<el-button
type="success"
round
size="small"
@click="handleBuyer(1, row)"
></el-button
>
</div>
<div v-else>
<span v-if="row.is_buyer == 1">{{ row.status_name }}</span>
<span v-if="row.is_buyer == -1">无需采购</span>
</div>
</template>
</el-table-column>
<el-table-column label="备注" prop="mark" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-perms="[
'beforehand_order_cart_info.beforehand_order_cart_info/edit'
]"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="[
'beforehand_order_cart_info.beforehand_order_cart_info/delete'
]"
type="danger"
link
@click="handleDeletes(row.id)"
>
删除
</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-tab-pane> </el-tab-pane>
<el-tab-pane label="采购" name="offer"> <el-tab-pane label="采购" name="offer">
<goodsOffer ref="goodsOfferRef" :order_id="formData.id" /> <goodsOffer ref="goodsOfferRef" :order_id="formData.id" />
@ -392,6 +295,7 @@ import feedback from '@/utils/feedback'
import EditPopup from './editProduct.vue' import EditPopup from './editProduct.vue'
import { apiDeliveryServiceLists } from '@/api/delivery_service' import { apiDeliveryServiceLists } from '@/api/delivery_service'
import goodsOffer from './component/goodsOffer.vue' import goodsOffer from './component/goodsOffer.vue'
import orderCartInfo from './component/orderCartInfo.vue'
import warehousing from './component/warehousing.vue' import warehousing from './component/warehousing.vue'
import outbound from './component/outbound.vue' import outbound from './component/outbound.vue'
import { apiUserLists } from '@/api/user' import { apiUserLists } from '@/api/user'
@ -409,6 +313,9 @@ const outboundRef = ref(null)
const route = useRoute() const route = useRoute()
const tabChange = (type: any) => { const tabChange = (type: any) => {
if (type == 'second') {
orderCartInfo.value?.getList(formData.value)
}
if (type == 'offer') { if (type == 'offer') {
goodsOfferRef.value?.getList(formData.value.id) goodsOfferRef.value?.getList(formData.value.id)
} }
@ -618,28 +525,6 @@ const generateOrderAdd = () => {
apiPurchaseOrderGenerateOrder(generateOrderData.value).then((res) => {}) apiPurchaseOrderGenerateOrder(generateOrderData.value).then((res) => {})
} }
const beforehand_order_cart_info = () => {
apiBeforehandOrderCartInfoLists({
export: 2,
bhoid: formData.value.id
}).then((res) => {
window.open(res.url, '_blank')
ElMessage.success('导出成功')
})
}
const topCateChange = (row: any) => {
if (row.id == 0) {
queryParams.top_cate = ''
queryParams.top_cate_value = '全部'
getLists()
} else {
queryParams.top_cate = row.id
queryParams.top_cate_value = row.name
getLists()
}
}
defineExpose({ defineExpose({
open open
}) })