上传
This commit is contained in:
@@ -38,3 +38,8 @@ export const getInventoryList = async (params) => {
|
||||
export const getInventoryRecord = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-inventory-record/page', params })
|
||||
}
|
||||
|
||||
// 获取剩余库存
|
||||
export const getRemainInventoryList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-inventory-detail/list', params })
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ watch(
|
||||
(options) => {
|
||||
if (echartRef) {
|
||||
echartRef?.setOption(options)
|
||||
resizeHandler()
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="采购数量" prop="purchaseNum">
|
||||
<el-form-item label="采购数量" prop="num">
|
||||
<el-input-number
|
||||
:min="form.sendTotalNum"
|
||||
v-model="form.purchaseNum"
|
||||
v-model="form.num"
|
||||
:controls="false"
|
||||
placeholder="请输入"
|
||||
style="width: 100%"
|
||||
@@ -81,17 +81,17 @@
|
||||
<template v-else>
|
||||
<el-table :data="inventoryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="id" label="入库批次号" width="150px" />
|
||||
<el-table-column prop="batchNo" label="入库批次号" width="150px" />
|
||||
<el-table-column prop="warehouseName" label="存放仓库" width="120px" />
|
||||
<el-table-column prop="unitPrice" label="采购价" width="90px" />
|
||||
<el-table-column prop="remainNum" label="剩余库存" width="90px" />
|
||||
<el-table-column prop="price" label="采购价" width="90px" />
|
||||
<el-table-column prop="num" label="剩余库存" width="90px" />
|
||||
<el-table-column label="发货数量">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-model="row.sendNum"
|
||||
size="small"
|
||||
:min="1"
|
||||
:max="row.remainNum"
|
||||
:max="row.num"
|
||||
:controls="false"
|
||||
/>
|
||||
</template>
|
||||
@@ -112,7 +112,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="DialogDelivery">
|
||||
import { getSimpleWarehouseList } from '@/api/mall/warehouse'
|
||||
import { getSimpleWarehouseList, getRemainInventoryList } from '@/api/mall/warehouse'
|
||||
import { createDelivery } from '@/api/clue/delivery'
|
||||
import { getConfigList } from '@/api/system/set'
|
||||
import { getDictOptions } from '@/utils/dict'
|
||||
@@ -127,10 +127,17 @@ function getOptions() {
|
||||
})
|
||||
}
|
||||
|
||||
function getRemainInventory(signProductId) {
|
||||
getRemainInventoryList({ signProductId }).then((data) => {
|
||||
inventoryList.value = data
|
||||
})
|
||||
}
|
||||
|
||||
const show = ref(false)
|
||||
function open(id, signNum) {
|
||||
function open(row) {
|
||||
show.value = true
|
||||
resetForm(id, signNum)
|
||||
resetForm(row)
|
||||
getRemainInventory(row.id)
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
@@ -140,18 +147,20 @@ const form = ref({})
|
||||
const rules = ref({
|
||||
supplier: { required: true, message: '供应商不可为空', trigger: 'change' },
|
||||
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' },
|
||||
purchaseNum: { required: true, message: '采购数量不可为空', trigger: 'change,blur' },
|
||||
num: { required: true, message: '采购数量不可为空', trigger: 'change,blur' },
|
||||
unitPrice: { required: true, message: '采购单价不可为空', trigger: 'change,blur' },
|
||||
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' }
|
||||
})
|
||||
function resetForm(id, num) {
|
||||
function resetForm(row) {
|
||||
form.value = {
|
||||
sendType: 2,
|
||||
sendTotalNum: num,
|
||||
signProductId: id,
|
||||
sendTotalNum: row.signNum,
|
||||
signProductId: row.id,
|
||||
productId: row.productId,
|
||||
specsId: row.specsId,
|
||||
warehouseId: undefined,
|
||||
supplier: undefined,
|
||||
purchaseNum: num,
|
||||
num: row.signNum,
|
||||
unitPrice: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
@@ -186,7 +195,25 @@ async function onSubmit() {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
await createDelivery(form.value)
|
||||
let params = {
|
||||
signProductId: form.value.signProductId,
|
||||
sendType: form.value.sendType,
|
||||
remark: form.value.remark
|
||||
}
|
||||
if (params.sendType == 1) {
|
||||
params.purchaseOrder = {
|
||||
productId: form.value.productId,
|
||||
specsId: form.value.specsId,
|
||||
supplier: form.value.supplier,
|
||||
num: form.value.num,
|
||||
unitPrice: form.value.unitPrice,
|
||||
warehouseId: form.value.warehouseId
|
||||
}
|
||||
} else {
|
||||
params.detailList = inventoryList.value
|
||||
}
|
||||
|
||||
await createDelivery(params)
|
||||
message.success('发货成功!')
|
||||
show.value = false
|
||||
emit('success')
|
||||
@@ -195,11 +222,7 @@ async function onSubmit() {
|
||||
}
|
||||
}
|
||||
|
||||
const inventoryList = ref([
|
||||
{ id: 123, warehouseName: '自营仓', unitPrice: 120, remainNum: 5 },
|
||||
{ id: 234, warehouseName: '自营仓', unitPrice: 100, remainNum: 5 },
|
||||
{ id: 345, warehouseName: '供应商仓', unitPrice: 110, remainNum: 999 }
|
||||
])
|
||||
const inventoryList = ref([])
|
||||
|
||||
const deliveryArr = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
|
||||
@@ -15,18 +15,14 @@
|
||||
<el-table-column prop="productName" label="成交产品" />
|
||||
<el-table-column prop="specsName" label="产品规格" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="100px" />
|
||||
<el-table-column label="发货状态" width="100px">
|
||||
<template #default="scope">
|
||||
{{ scope.row.warehouseName ? '已发货' : '待发货' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货状态" prop="sendState" width="100px" />
|
||||
<el-table-column label="发货备注">
|
||||
<template #default="scope">
|
||||
<el-popover
|
||||
placement="top"
|
||||
width="500px"
|
||||
trigger="click"
|
||||
v-if="scope.row.warehouseName && scope.row.sendRemark"
|
||||
v-if="scope.row.sendRemark"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
|
||||
@@ -69,11 +69,7 @@
|
||||
<el-table-column prop="productName" label="成交产品" />
|
||||
<el-table-column prop="specsName" label="产品规格" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="100px" />
|
||||
<el-table-column label="发货状态" width="100px">
|
||||
<template #default="scope">
|
||||
{{ scope.row.warehouseName ? '已发货' : '待发货' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货状态" prop="sendState" width="100px" />
|
||||
<el-table-column label="发货备注" width="100px">
|
||||
<template #default="scope">
|
||||
<el-popover
|
||||
@@ -95,7 +91,7 @@
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
:disabled="!!scope.row.warehouseName"
|
||||
:disabled="scope.row.sendState == '已发货'"
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:send']"
|
||||
@click="handleDelivery(scope.row)"
|
||||
@@ -339,7 +335,7 @@ function getOptions() {
|
||||
}
|
||||
const deliveryDialog = ref()
|
||||
function handleDelivery(row) {
|
||||
deliveryDialog.value.open(row.id, row.signNum)
|
||||
deliveryDialog.value.open(row)
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
|
||||
@@ -42,25 +42,7 @@ export const lineOptions: EChartsOption = {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '成交率',
|
||||
smooth: true,
|
||||
type: 'line',
|
||||
data: [100, 120, 161, 134, 105, 160, 165, 114, 163, 185, 118, 123],
|
||||
animationDuration: 2800,
|
||||
animationEasing: 'cubicInOut'
|
||||
},
|
||||
{
|
||||
name: t('analysis.actual'),
|
||||
smooth: true,
|
||||
type: 'line',
|
||||
itemStyle: {},
|
||||
data: [120, 82, 91, 154, 162, 140, 145, 250, 134, 56, 99, 123],
|
||||
animationDuration: 2800,
|
||||
animationEasing: 'quadraticOut'
|
||||
}
|
||||
]
|
||||
series: []
|
||||
}
|
||||
|
||||
export const pieOptions: EChartsOption = {
|
||||
|
||||
@@ -63,7 +63,16 @@
|
||||
<el-table-column prop="changeTime" label="变动时间" :formatter="dateFormatter" />
|
||||
<el-table-column prop="changeUserName" label="变动人员" />
|
||||
<el-table-column prop="warehouseName" label="所属仓库" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="remark" label="备注">
|
||||
<template #default="scope">
|
||||
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.remark">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.remark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
|
||||
Reference in New Issue
Block a user