salary
qsh 5 months ago
parent 31f028d8d8
commit fa2481ea3d
  1. 5
      src/api/mall/warehouse/index.js
  2. 1
      src/components/Echart/src/Echart.vue
  3. 63
      src/views/Clue/Order/Comp/DialogDelivery.vue
  4. 8
      src/views/Clue/Order/Comp/DialogOrder.vue
  5. 10
      src/views/Clue/Order/Comp/MallOrderList.vue
  6. 20
      src/views/Home/echarts-data.ts
  7. 11
      src/views/MiniMall/Inventory/Comp/InventoryRecord.vue

@ -38,3 +38,8 @@ export const getInventoryList = async (params) => {
export const getInventoryRecord = async (params) => { export const getInventoryRecord = async (params) => {
return await request.get({ url: '/admin-api/crm/erp-inventory-record/page', 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) => { (options) => {
if (echartRef) { if (echartRef) {
echartRef?.setOption(options) echartRef?.setOption(options)
resizeHandler()
} }
}, },
{ {

@ -36,10 +36,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="采购数量" prop="purchaseNum"> <el-form-item label="采购数量" prop="num">
<el-input-number <el-input-number
:min="form.sendTotalNum" :min="form.sendTotalNum"
v-model="form.purchaseNum" v-model="form.num"
:controls="false" :controls="false"
placeholder="请输入" placeholder="请输入"
style="width: 100%" style="width: 100%"
@ -81,17 +81,17 @@
<template v-else> <template v-else>
<el-table :data="inventoryList" @selection-change="handleSelectionChange"> <el-table :data="inventoryList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" /> <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="warehouseName" label="存放仓库" width="120px" />
<el-table-column prop="unitPrice" label="采购价" width="90px" /> <el-table-column prop="price" label="采购价" width="90px" />
<el-table-column prop="remainNum" label="剩余库存" width="90px" /> <el-table-column prop="num" label="剩余库存" width="90px" />
<el-table-column label="发货数量"> <el-table-column label="发货数量">
<template #default="{ row }"> <template #default="{ row }">
<el-input-number <el-input-number
v-model="row.sendNum" v-model="row.sendNum"
size="small" size="small"
:min="1" :min="1"
:max="row.remainNum" :max="row.num"
:controls="false" :controls="false"
/> />
</template> </template>
@ -112,7 +112,7 @@
</template> </template>
<script setup name="DialogDelivery"> <script setup name="DialogDelivery">
import { getSimpleWarehouseList } from '@/api/mall/warehouse' import { getSimpleWarehouseList, getRemainInventoryList } from '@/api/mall/warehouse'
import { createDelivery } from '@/api/clue/delivery' import { createDelivery } from '@/api/clue/delivery'
import { getConfigList } from '@/api/system/set' import { getConfigList } from '@/api/system/set'
import { getDictOptions } from '@/utils/dict' 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) const show = ref(false)
function open(id, signNum) { function open(row) {
show.value = true show.value = true
resetForm(id, signNum) resetForm(row)
getRemainInventory(row.id)
} }
defineExpose({ defineExpose({
open open
@ -140,18 +147,20 @@ const form = ref({})
const rules = ref({ const rules = ref({
supplier: { required: true, message: '供应商不可为空', trigger: 'change' }, supplier: { required: true, message: '供应商不可为空', trigger: 'change' },
warehouseId: { 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' }, unitPrice: { required: true, message: '采购单价不可为空', trigger: 'change,blur' },
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' } warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' }
}) })
function resetForm(id, num) { function resetForm(row) {
form.value = { form.value = {
sendType: 2, sendType: 2,
sendTotalNum: num, sendTotalNum: row.signNum,
signProductId: id, signProductId: row.id,
productId: row.productId,
specsId: row.specsId,
warehouseId: undefined, warehouseId: undefined,
supplier: undefined, supplier: undefined,
purchaseNum: num, num: row.signNum,
unitPrice: undefined, unitPrice: undefined,
remark: undefined remark: undefined
} }
@ -186,7 +195,25 @@ async function onSubmit() {
// //
formLoading.value = true formLoading.value = true
try { 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('发货成功!') message.success('发货成功!')
show.value = false show.value = false
emit('success') emit('success')
@ -195,11 +222,7 @@ async function onSubmit() {
} }
} }
const inventoryList = ref([ 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 deliveryArr = ref([]) const deliveryArr = ref([])
function handleSelectionChange(val) { function handleSelectionChange(val) {

@ -15,18 +15,14 @@
<el-table-column prop="productName" label="成交产品" /> <el-table-column prop="productName" label="成交产品" />
<el-table-column prop="specsName" label="产品规格" /> <el-table-column prop="specsName" label="产品规格" />
<el-table-column prop="signNum" label="成交数量" width="100px" /> <el-table-column prop="signNum" label="成交数量" width="100px" />
<el-table-column label="发货状态" width="100px"> <el-table-column label="发货状态" prop="sendState" width="100px" />
<template #default="scope">
{{ scope.row.warehouseName ? '已发货' : '待发货' }}
</template>
</el-table-column>
<el-table-column label="发货备注"> <el-table-column label="发货备注">
<template #default="scope"> <template #default="scope">
<el-popover <el-popover
placement="top" placement="top"
width="500px" width="500px"
trigger="click" trigger="click"
v-if="scope.row.warehouseName && scope.row.sendRemark" v-if="scope.row.sendRemark"
> >
<template #reference> <template #reference>
<el-button type="primary" style="padding: 0" text>点击查看</el-button> <el-button type="primary" style="padding: 0" text>点击查看</el-button>

@ -69,11 +69,7 @@
<el-table-column prop="productName" label="成交产品" /> <el-table-column prop="productName" label="成交产品" />
<el-table-column prop="specsName" label="产品规格" /> <el-table-column prop="specsName" label="产品规格" />
<el-table-column prop="signNum" label="成交数量" width="100px" /> <el-table-column prop="signNum" label="成交数量" width="100px" />
<el-table-column label="发货状态" width="100px"> <el-table-column label="发货状态" prop="sendState" width="100px" />
<template #default="scope">
{{ scope.row.warehouseName ? '已发货' : '待发货' }}
</template>
</el-table-column>
<el-table-column label="发货备注" width="100px"> <el-table-column label="发货备注" width="100px">
<template #default="scope"> <template #default="scope">
<el-popover <el-popover
@ -95,7 +91,7 @@
type="primary" type="primary"
class="mr-10px" class="mr-10px"
link link
:disabled="!!scope.row.warehouseName" :disabled="scope.row.sendState == '已发货'"
style="padding: 0; margin-left: 0" style="padding: 0; margin-left: 0"
v-hasPermi="['clue:order:send']" v-hasPermi="['clue:order:send']"
@click="handleDelivery(scope.row)" @click="handleDelivery(scope.row)"
@ -339,7 +335,7 @@ function getOptions() {
} }
const deliveryDialog = ref() const deliveryDialog = ref()
function handleDelivery(row) { function handleDelivery(row) {
deliveryDialog.value.open(row.id, row.signNum) deliveryDialog.value.open(row)
} }
const userOptions = ref([]) const userOptions = ref([])

@ -42,25 +42,7 @@ export const lineOptions: EChartsOption = {
show: false show: false
} }
}, },
series: [ 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'
}
]
} }
export const pieOptions: EChartsOption = { export const pieOptions: EChartsOption = {

@ -63,7 +63,16 @@
<el-table-column prop="changeTime" label="变动时间" :formatter="dateFormatter" /> <el-table-column prop="changeTime" label="变动时间" :formatter="dateFormatter" />
<el-table-column prop="changeUserName" label="变动人员" /> <el-table-column prop="changeUserName" label="变动人员" />
<el-table-column prop="warehouseName" 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> </el-table>
<Pagination <Pagination
v-model:limit="searchForm.pageSize" v-model:limit="searchForm.pageSize"

Loading…
Cancel
Save