✨ feat(mes): 新增销售出库单行及明细相关功能和数据结构
新增销售出库单行和明细的请求和响应对象,包含分页查询、创建、更新和删除功能。实现了销售出库单行和明细的数据库映射,并提供了相应的服务接口和控制器,支持前端调用。 同时,更新了相关的 API 接口,确保前端能够正确获取和操作销售出库单行及明细数据。pull/871/MERGE
parent
48e2ed8272
commit
2242a13401
|
|
@ -0,0 +1,49 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// MES 销售出库明细 VO
|
||||
export interface WmProductSalesDetailVO {
|
||||
id: number
|
||||
lineId: number
|
||||
salesId: number
|
||||
itemId: number
|
||||
itemCode: string
|
||||
itemName: string
|
||||
quantity: number
|
||||
batchId: number
|
||||
warehouseId: number
|
||||
warehouseName: string
|
||||
locationId: number
|
||||
locationName: string
|
||||
areaId: number
|
||||
areaName: string
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// MES 销售出库明细 API
|
||||
export const WmProductSalesDetailApi = {
|
||||
// 查询销售出库明细列表(按行编号)
|
||||
getProductSalesDetailListByLineId: async (lineId: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-sales-detail/list-by-line', params: { lineId } })
|
||||
},
|
||||
|
||||
// 查询销售出库明细详情
|
||||
getProductSalesDetail: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-sales-detail/get?id=' + id })
|
||||
},
|
||||
|
||||
// 新增销售出库明细
|
||||
createProductSalesDetail: async (data: WmProductSalesDetailVO) => {
|
||||
return await request.post({ url: '/mes/wm/product-sales-detail/create', data })
|
||||
},
|
||||
|
||||
// 修改销售出库明细
|
||||
updateProductSalesDetail: async (data: WmProductSalesDetailVO) => {
|
||||
return await request.put({ url: '/mes/wm/product-sales-detail/update', data })
|
||||
},
|
||||
|
||||
// 删除销售出库明细
|
||||
deleteProductSalesDetail: async (id: number) => {
|
||||
return await request.delete({ url: '/mes/wm/product-sales-detail/delete?id=' + id })
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// MES 销售出库单 VO
|
||||
export interface WmProductSalesVO {
|
||||
id: number
|
||||
code: string
|
||||
name: string
|
||||
clientId: number
|
||||
clientName: string
|
||||
salesOrderCode: string
|
||||
shipmentDate: string
|
||||
contactName: string
|
||||
contactTelephone: string
|
||||
contactAddress: string
|
||||
status: number
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// MES 销售出库单 API
|
||||
export const WmProductSalesApi = {
|
||||
// 查询销售出库单分页
|
||||
getProductSalesPage: async (params: any) => {
|
||||
return await request.get({ url: '/mes/wm/product-sales/page', params })
|
||||
},
|
||||
|
||||
// 查询销售出库单详情
|
||||
getProductSales: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-sales/get?id=' + id })
|
||||
},
|
||||
|
||||
// 新增销售出库单
|
||||
createProductSales: async (data: WmProductSalesVO) => {
|
||||
return await request.post({ url: '/mes/wm/product-sales/create', data })
|
||||
},
|
||||
|
||||
// 修改销售出库单
|
||||
updateProductSales: async (data: WmProductSalesVO) => {
|
||||
return await request.put({ url: '/mes/wm/product-sales/update', data })
|
||||
},
|
||||
|
||||
// 删除销售出库单
|
||||
deleteProductSales: async (id: number) => {
|
||||
return await request.delete({ url: '/mes/wm/product-sales/delete?id=' + id })
|
||||
},
|
||||
|
||||
// 提交销售出库单
|
||||
submitProductSales: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/product-sales/submit?id=' + id })
|
||||
},
|
||||
|
||||
// 执行拣货
|
||||
pickProductSales: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/product-sales/pick?id=' + id })
|
||||
},
|
||||
|
||||
// 执行出库
|
||||
executeProductSales: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/product-sales/execute?id=' + id })
|
||||
},
|
||||
|
||||
// 取消销售出库单
|
||||
cancelProductSales: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/product-sales/cancel?id=' + id })
|
||||
},
|
||||
|
||||
// 导出销售出库单 Excel
|
||||
exportProductSales: async (params: any) => {
|
||||
return await request.download({ url: '/mes/wm/product-sales/export-excel', params })
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// MES 销售出库单行 VO
|
||||
export interface WmProductSalesLineVO {
|
||||
id: number
|
||||
salesId: number
|
||||
itemId: number
|
||||
itemCode: string
|
||||
itemName: string
|
||||
quantity: number
|
||||
pickedQuantity: number
|
||||
batchId: number
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// MES 销售出库单行 API
|
||||
export const WmProductSalesLineApi = {
|
||||
// 查询销售出库单行列表(按出库单编号)
|
||||
getProductSalesLineListBySalesId: async (salesId: number) => {
|
||||
return await request.get({
|
||||
url: '/mes/wm/product-sales-line/list-by-sales-id?salesId=' + salesId
|
||||
})
|
||||
},
|
||||
|
||||
// 查询销售出库单行详情
|
||||
getProductSalesLine: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-sales-line/get?id=' + id })
|
||||
},
|
||||
|
||||
// 新增销售出库单行
|
||||
createProductSalesLine: async (data: WmProductSalesLineVO) => {
|
||||
return await request.post({ url: '/mes/wm/product-sales-line/create', data })
|
||||
},
|
||||
|
||||
// 修改销售出库单行
|
||||
updateProductSalesLine: async (data: WmProductSalesLineVO) => {
|
||||
return await request.put({ url: '/mes/wm/product-sales-line/update', data })
|
||||
},
|
||||
|
||||
// 删除销售出库单行
|
||||
deleteProductSalesLine: async (id: number) => {
|
||||
return await request.delete({ url: '/mes/wm/product-sales-line/delete?id=' + id })
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
<!-- MES 销售出库拣货明细表单弹窗 -->
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="600px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="110px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="物料" prop="itemId">
|
||||
<MdItemSelect v-model="formData.itemId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="出库仓库" prop="warehouseId">
|
||||
<WmWarehouseSelect v-model="formData.warehouseId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="库区" prop="locationId" v-if="formData.warehouseId">
|
||||
<WmWarehouseLocationSelect
|
||||
v-model="formData.locationId"
|
||||
:warehouse-id="formData.warehouseId"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位" prop="areaId" v-if="formData.locationId">
|
||||
<WmWarehouseAreaSelect v-model="formData.areaId" :location-id="formData.locationId" />
|
||||
</el-form-item>
|
||||
<!-- TODO @AI:批次号 -->
|
||||
<!-- TODO @AI:拣货数量 =》 数量 -->
|
||||
<el-form-item label="拣货数量" prop="quantity">
|
||||
<el-input-number
|
||||
v-model="formData.quantity"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
controls-position="right"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { WmProductSalesDetailApi, WmProductSalesDetailVO } from '@/api/mes/wm/productsales/detail'
|
||||
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||
import WmWarehouseSelect from '@/views/mes/wm/warehouse/components/WmWarehouseSelect.vue'
|
||||
import WmWarehouseLocationSelect from '@/views/mes/wm/warehouse/components/WmWarehouseLocationSelect.vue'
|
||||
import WmWarehouseAreaSelect from '@/views/mes/wm/warehouse/components/WmWarehouseAreaSelect.vue'
|
||||
|
||||
defineOptions({ name: 'ProductSalesDetailForm' })
|
||||
|
||||
const props = defineProps<{
|
||||
salesId: number
|
||||
}>()
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formType = ref('') // 表单的类型:create / update
|
||||
const currentLineId = ref<number>() // 当前操作的行 ID
|
||||
const formRef = ref() // 表单 Ref
|
||||
const formData = ref({
|
||||
id: undefined as number | undefined,
|
||||
lineId: undefined as number | undefined,
|
||||
salesId: undefined as number | undefined,
|
||||
itemId: undefined as number | undefined,
|
||||
quantity: undefined as number | undefined,
|
||||
warehouseId: undefined as number | undefined,
|
||||
locationId: undefined as number | undefined,
|
||||
areaId: undefined as number | undefined
|
||||
})
|
||||
const formRules = reactive({
|
||||
itemId: [{ required: true, message: '物料不能为空', trigger: 'change' }],
|
||||
warehouseId: [{ required: true, message: '出库仓库不能为空', trigger: 'change' }],
|
||||
locationId: [{ required: true, message: '库区不能为空', trigger: 'change' }],
|
||||
areaId: [{ required: true, message: '库位不能为空', trigger: 'change' }],
|
||||
quantity: [{ required: true, message: '拣货数量不能为空', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, lineId: number, itemId?: number, detailId?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = type === 'create' ? '添加拣货明细' : '编辑拣货明细'
|
||||
formType.value = type
|
||||
currentLineId.value = lineId
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (detailId) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await WmProductSalesDetailApi.getProductSalesDetail(detailId)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
} else if (itemId) {
|
||||
formData.value.itemId = itemId
|
||||
}
|
||||
}
|
||||
defineExpose({ open })
|
||||
|
||||
/** 提交表单 */
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = {
|
||||
...formData.value,
|
||||
salesId: props.salesId,
|
||||
lineId: currentLineId.value
|
||||
} as unknown as WmProductSalesDetailVO
|
||||
if (formType.value === 'create') {
|
||||
await WmProductSalesDetailApi.createProductSalesDetail(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await WmProductSalesDetailApi.updateProductSalesDetail(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success', currentLineId.value)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
lineId: undefined,
|
||||
salesId: undefined,
|
||||
itemId: undefined,
|
||||
quantity: undefined,
|
||||
warehouseId: undefined,
|
||||
locationId: undefined,
|
||||
areaId: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
<!-- MES 销售出库拣货明细列表(展开行内嵌子组件) -->
|
||||
<template>
|
||||
<div class="pl-60px pr-20px py-10px">
|
||||
<el-table v-loading="loading" :data="list" border size="small">
|
||||
<el-table-column label="仓库名称" align="center" prop="warehouseName" min-width="100" />
|
||||
<el-table-column label="库区名称" align="center" prop="locationName" min-width="100" />
|
||||
<el-table-column label="库位名称" align="center" prop="areaName" min-width="100" />
|
||||
<!-- TODO @AI:批次号 -->
|
||||
<!-- TODO @AI:件货数量,改成【数量】 -->
|
||||
<el-table-column label="拣货数量" align="center" prop="quantity" width="100" />
|
||||
<el-table-column
|
||||
v-if="props.formType === 'pick'"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="120"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="emit('edit-detail', scope.row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button link type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { WmProductSalesDetailApi, WmProductSalesDetailVO } from '@/api/mes/wm/productsales/detail'
|
||||
|
||||
defineOptions({ name: 'ProductSalesDetailList' })
|
||||
|
||||
const props = defineProps<{
|
||||
salesId: number
|
||||
lineId: number
|
||||
itemId: number
|
||||
formType: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits(['edit-detail'])
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const loading = ref(false) // 列表的加载中
|
||||
const list = ref<WmProductSalesDetailVO[]>([]) // 明细列表
|
||||
|
||||
/** 查询明细列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
list.value = await WmProductSalesDetailApi.getProductSalesDetailListByLineId(props.lineId)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
defineExpose({ getList })
|
||||
|
||||
/** 删除拣货明细 */
|
||||
const handleDelete = async (detailId: number) => {
|
||||
try {
|
||||
await message.delConfirm()
|
||||
await WmProductSalesDetailApi.deleteProductSalesDetail(detailId)
|
||||
message.success(t('common.delSuccess'))
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 初始化:延迟加载,展开时才触发 */
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,257 @@
|
|||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="960px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="110px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="出库单编号" prop="code">
|
||||
<el-input
|
||||
v-model="formData.code"
|
||||
placeholder="请输入出库单编号"
|
||||
:disabled="isHeaderReadonly"
|
||||
>
|
||||
<template #append>
|
||||
<el-button @click="generateCode" :disabled="formType !== 'create'">
|
||||
生成
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="出库单名称" prop="name">
|
||||
<el-input
|
||||
v-model="formData.name"
|
||||
placeholder="请输入出库单名称"
|
||||
:disabled="isHeaderReadonly"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- TODO @AI:【发货通知单】 salesnotice 选择器;-->
|
||||
<!-- TODO @芋艿:【暂时先忽略我这个想法】销售订单编号、出库日期,是不是不用记录 -->
|
||||
<!-- TODO @AI:【销售订单编号】 -->
|
||||
<!-- TODO @AI:【发货日期】=》出库日期 shipmentDate =》salesDate 字段名也要改下; -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发货日期" prop="shipmentDate">
|
||||
<el-date-picker
|
||||
v-model="formData.shipmentDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="请选择发货日期"
|
||||
class="!w-1/1"
|
||||
:disabled="isHeaderReadonly"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户" prop="clientId">
|
||||
<MdClientSelect v-model="formData.clientId" :disabled="isHeaderReadonly" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- TODO @AI:【销售订单号】往前挪 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="销售订单号" prop="salesOrderCode">
|
||||
<el-input
|
||||
v-model="formData.salesOrderCode"
|
||||
placeholder="请输入销售订单号"
|
||||
:disabled="isHeaderReadonly"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<!-- TODO @AI:收货人;字段改成;(字段 prop 不用改) -->
|
||||
<el-form-item label="联系人" prop="contactName">
|
||||
<el-input
|
||||
v-model="formData.contactName"
|
||||
placeholder="请输入联系人"
|
||||
:disabled="isHeaderReadonly"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- TODO @AI:联系方式 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话" prop="contactTelephone">
|
||||
<el-input
|
||||
v-model="formData.contactTelephone"
|
||||
placeholder="请输入联系电话"
|
||||
:disabled="isHeaderReadonly"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<!-- TODO @AI:前后端,都删除掉 contactAddress 字段 -->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="收货地址" prop="contactAddress">
|
||||
<el-input
|
||||
v-model="formData.contactAddress"
|
||||
placeholder="请输入收货地址"
|
||||
:disabled="isHeaderReadonly"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入备注"
|
||||
:disabled="isHeaderReadonly"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- 非新建模式展示行项目信息(出库物料) -->
|
||||
<template v-if="formData.id">
|
||||
<el-divider content-position="center">物料信息</el-divider>
|
||||
<ProductSalesLineList :sales-id="formData.id" :form-type="formType" />
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button v-if="isUpdate" @click="submitForm" type="primary" :disabled="formLoading">
|
||||
确 定
|
||||
</el-button>
|
||||
<el-button v-if="isPick" @click="handlePick" type="primary" :disabled="formLoading">
|
||||
执行拣货
|
||||
</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { generateRandomStr } from '@/utils'
|
||||
import { WmProductSalesApi, WmProductSalesVO } from '@/api/mes/wm/productsales'
|
||||
import MdClientSelect from '@/views/mes/md/client/components/MdClientSelect.vue'
|
||||
import ProductSalesLineList from './ProductSalesLineList.vue'
|
||||
|
||||
defineOptions({ name: 'ProductSalesForm' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formType = ref<string>('create') // 表单的类型:create / update / pick / detail
|
||||
const formData = ref({
|
||||
id: undefined as number | undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
clientId: undefined,
|
||||
salesOrderCode: undefined,
|
||||
shipmentDate: undefined,
|
||||
contactName: undefined,
|
||||
contactTelephone: undefined,
|
||||
contactAddress: undefined,
|
||||
remark: undefined
|
||||
})
|
||||
const formRules = reactive({
|
||||
code: [{ required: true, message: '出库单编号不能为空', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '出库单名称不能为空', trigger: 'blur' }],
|
||||
shipmentDate: [{ required: true, message: '发货日期不能为空', trigger: 'change' }],
|
||||
clientId: [{ required: true, message: '客户不能为空', trigger: 'change' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const isUpdate = computed(() => ['create', 'update'].includes(formType.value)) // 是否为编辑模式
|
||||
const isPick = computed(() => formType.value === 'pick') // 是否为拣货模式
|
||||
const isHeaderReadonly = computed(() => ['pick', 'detail'].includes(formType.value)) // 是否只读
|
||||
const dialogTitle = computed(() => {
|
||||
const titles = {
|
||||
create: '新增销售出库单',
|
||||
update: '编辑销售出库单',
|
||||
pick: '执行拣货',
|
||||
detail: '销售出库单详情'
|
||||
}
|
||||
return titles[formType.value] || formType.value
|
||||
})
|
||||
|
||||
/** 生成出库单编号 */
|
||||
const generateCode = () => {
|
||||
formData.value.code = 'PS' + generateRandomStr(10)
|
||||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改/拣货/详情时,加载数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await WmProductSalesApi.getProductSales(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open })
|
||||
|
||||
/** 提交表单(create/update 模式) */
|
||||
const emit = defineEmits(['success'])
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as WmProductSalesVO
|
||||
if (formType.value === 'create') {
|
||||
const res = await WmProductSalesApi.createProductSales(data)
|
||||
message.success('新增成功')
|
||||
formData.value.id = res
|
||||
formType.value = 'update'
|
||||
} else {
|
||||
await WmProductSalesApi.updateProductSales(data)
|
||||
message.success('修改成功')
|
||||
}
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 执行拣货 */
|
||||
const handlePick = async () => {
|
||||
try {
|
||||
await message.confirm('确认执行拣货?')
|
||||
formLoading.value = true
|
||||
await WmProductSalesApi.pickProductSales(formData.value.id!)
|
||||
message.success('拣货成功')
|
||||
dialogVisible.value = false
|
||||
emit('success')
|
||||
} catch {
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
clientId: undefined,
|
||||
salesOrderCode: undefined,
|
||||
shipmentDate: undefined,
|
||||
contactName: undefined,
|
||||
contactTelephone: undefined,
|
||||
contactAddress: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,257 @@
|
|||
<!-- MES 销售出库单行列表子组件 -->
|
||||
<template>
|
||||
<div>
|
||||
<el-button v-if="isUpdate" type="primary" plain @click="openForm('create')" class="mb-10px">
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 添加物料
|
||||
</el-button>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="list"
|
||||
:stripe="true"
|
||||
:show-overflow-tooltip="true"
|
||||
border
|
||||
:row-key="(row: any) => row.id"
|
||||
>
|
||||
<el-table-column type="expand">
|
||||
<template #default="scope">
|
||||
<ProductSalesDetailList
|
||||
:ref="(el: any) => setDetailListRef(scope.row.id, el)"
|
||||
:sales-id="props.salesId"
|
||||
:line-id="scope.row.id"
|
||||
:item-id="scope.row.itemId"
|
||||
:form-type="props.formType"
|
||||
@edit-detail="
|
||||
(detailId: number) =>
|
||||
openDetailForm('update', scope.row.id, scope.row.itemId, detailId)
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品编码" align="center" prop="itemCode" min-width="120" />
|
||||
<el-table-column label="产品名称" align="center" prop="itemName" min-width="140" />
|
||||
<!-- TODO @AI:规格型号、单位 -->
|
||||
<el-table-column label="出库数量" align="center" prop="quantity" width="100" />
|
||||
<!-- TODO @AI:不展示 pickedQuantity 字段; -->
|
||||
<!-- TODO @芋艿:后端的 pickedQuantity 需要存储么? -->
|
||||
<el-table-column label="已拣货数量" align="center" prop="pickedQuantity" width="100" />
|
||||
<!-- TODO @AI:批次号 -->
|
||||
<!-- TODO @AI:是否校验 -->
|
||||
<!-- TODO @AI:备注 -->
|
||||
<el-table-column
|
||||
v-if="isUpdate || isPick"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="160"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button v-if="isUpdate" link type="primary" @click="openForm('update', scope.row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-if="isUpdate" link type="danger" @click="handleDelete(scope.row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-if="isPick" link type="success" @click="handlePick(scope.row.id)">
|
||||
拣货
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 添加/编辑行弹窗 -->
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="960px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="110px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品" prop="itemId">
|
||||
<MdItemSelect v-model="formData.itemId" placeholder="请选择产品" class="!w-1/1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- TODO @AI:批次号; -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="出库数量" prop="quantity">
|
||||
<el-input-number
|
||||
v-model="formData.quantity"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
controls-position="right"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- TODO @AI:是否校验 -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
|
||||
<!-- 拣货明细添加/编辑弹窗 -->
|
||||
<ProductSalesDetailForm
|
||||
ref="detailFormRef"
|
||||
:sales-id="props.salesId"
|
||||
@success="onDetailFormSuccess"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { WmProductSalesLineApi, WmProductSalesLineVO } from '@/api/mes/wm/productsales/line'
|
||||
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||
import ProductSalesDetailList from './ProductSalesDetailList.vue'
|
||||
import ProductSalesDetailForm from './ProductSalesDetailForm.vue'
|
||||
|
||||
defineOptions({ name: 'ProductSalesLineList' })
|
||||
|
||||
const props = defineProps<{
|
||||
salesId: number
|
||||
formType: string
|
||||
}>()
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const isUpdate = computed(() => ['create', 'update'].includes(props.formType)) // 是否为编辑模式
|
||||
const isPick = computed(() => props.formType === 'pick') // 是否为拣货模式
|
||||
|
||||
// ==================== 列表 ====================
|
||||
const loading = ref(false) // 列表的加载中
|
||||
const list = ref<WmProductSalesLineVO[]>([]) // 行列表
|
||||
|
||||
/** 查询行列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
list.value = await WmProductSalesLineApi.getProductSalesLineListBySalesId(props.salesId)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 删除 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
await message.delConfirm()
|
||||
await WmProductSalesLineApi.deleteProductSalesLine(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
// ==================== 添加/编辑表单 ====================
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const lineFormType = ref('') // 行表单的类型
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
salesId: undefined as number | undefined,
|
||||
itemId: undefined,
|
||||
quantity: undefined,
|
||||
batchId: undefined,
|
||||
remark: undefined
|
||||
})
|
||||
const formRules = reactive({
|
||||
itemId: [{ required: true, message: '物料不能为空', trigger: 'change' }],
|
||||
quantity: [{ required: true, message: '出库数量不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开表单弹窗 */
|
||||
const openForm = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = type === 'create' ? '添加物料出库单行' : '修改物料出库单行'
|
||||
lineFormType.value = type
|
||||
resetForm()
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await WmProductSalesLineApi.getProductSalesLine(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
const submitForm = async () => {
|
||||
await formRef.value.validate()
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = { ...formData.value, salesId: props.salesId } as unknown as WmProductSalesLineVO
|
||||
if (lineFormType.value === 'create') {
|
||||
await WmProductSalesLineApi.createProductSalesLine(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await WmProductSalesLineApi.updateProductSalesLine(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
await getList()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
salesId: undefined,
|
||||
itemId: undefined,
|
||||
quantity: undefined,
|
||||
batchId: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
// ==================== 展开行:拣货明细 ====================
|
||||
const detailListRefs = ref<Record<number, InstanceType<typeof ProductSalesDetailList>>>({})
|
||||
|
||||
/** 缓存子组件 ref */
|
||||
const setDetailListRef = (lineId: number, el: any) => {
|
||||
if (el) {
|
||||
detailListRefs.value[lineId] = el
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 拣货明细表单(LineList 层级持有) ====================
|
||||
const detailFormRef = ref()
|
||||
|
||||
/** 拣货:直接打开明细创建表单 */
|
||||
const handlePick = (lineId: number) => {
|
||||
const row = list.value.find((r) => r.id === lineId)
|
||||
openDetailForm('create', lineId, row?.itemId)
|
||||
}
|
||||
|
||||
/** 打开拣货明细表单 */
|
||||
const openDetailForm = (type: string, lineId: number, itemId?: number, detailId?: number) => {
|
||||
detailFormRef.value.open(type, lineId, itemId, detailId)
|
||||
}
|
||||
|
||||
/** 明细表单提交成功后,刷新已展开行的 DetailList */
|
||||
const onDetailFormSuccess = (lineId: number) => {
|
||||
detailListRefs.value[lineId]?.getList()
|
||||
}
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
await getList()
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,287 @@
|
|||
<template>
|
||||
<ContentWrap>
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="出库单编号" prop="code">
|
||||
<el-input
|
||||
v-model="queryParams.code"
|
||||
placeholder="请输入出库单编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库单名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入出库单名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- TODO @AI:增加“销售订单编号”;salesOrderCode -->
|
||||
<el-form-item label="客户" prop="clientId">
|
||||
<MdClientSelect v-model="queryParams.clientId" class="!w-240px" />
|
||||
</el-form-item>
|
||||
<!-- TODO @AI:发货日期,全部都改成“出库日期”。(包括其他地方) -->
|
||||
<el-form-item label="发货日期" prop="shipmentDate">
|
||||
<el-date-picker
|
||||
v-model="queryParams.shipmentDate"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- TODO @AI:单据状态;mes_product_sales_status(me_wm_product_sales_status) -->
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['mes:wm-product-sales:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['mes:wm-product-sales:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="出库单编号" align="center" prop="code" min-width="160" />
|
||||
<el-table-column label="出库单名称" align="center" prop="name" min-width="150" />
|
||||
<!-- TODO @AI:发货通知单号 -->
|
||||
<!-- TODO @AI:销售订单编号 -->
|
||||
<!-- TODO @AI:客户名称、客户编码;clientName、clientCode -->
|
||||
<el-table-column label="客户名称" align="center" prop="clientName" min-width="120" />
|
||||
<!-- TODO @AI:发货人、联系方式、收货地址、承运商、运货单号 -->
|
||||
<!-- TODO @AI:发货日期 =》 出货日期 -->
|
||||
<el-table-column
|
||||
label="发货日期"
|
||||
align="center"
|
||||
prop="shipmentDate"
|
||||
:formatter="dateFormatter2"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="单据状态" align="center" prop="status" min-width="100">
|
||||
<template #default="scope">
|
||||
<!-- TODO @AI:MES_WM_PRODUCT_SALES_STATUS 没枚举 -->
|
||||
<dict-tag :type="DICT_TYPE.MES_WM_PRODUCT_SALES_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="240" fixed="right">
|
||||
<template #default="scope">
|
||||
<!-- 草稿:编辑、提交、删除 -->
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['mes:wm-product-sales:update']"
|
||||
v-if="scope.row.status === MesWmProductSalesStatusEnum.PREPARE"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
@click="handleSubmit(scope.row.id)"
|
||||
v-hasPermi="['mes:wm-product-sales:submit']"
|
||||
v-if="scope.row.status === MesWmProductSalesStatusEnum.PREPARE"
|
||||
>
|
||||
提交
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['mes:wm-product-sales:delete']"
|
||||
v-if="scope.row.status === MesWmProductSalesStatusEnum.PREPARE"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<!-- TODO @AI:执行拣货;之后状态是 status = 10(填写运单) -->
|
||||
<!-- 待拣货:拣货、取消 -->
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
@click="openForm('pick', scope.row.id)"
|
||||
v-hasPermi="['mes:wm-product-sales:pick']"
|
||||
v-if="scope.row.status === MesWmProductSalesStatusEnum.APPROVING"
|
||||
>
|
||||
拣货
|
||||
</el-button>
|
||||
<!-- TODO @AI:增加【填写运单】操作:(需要增加一个 status = 10);注意,填写运单,继续搞在 /Users/yunai/Java/yudao-all-in-one/yudao-ui-admin-vue3/src/views/mes/wm/productsales/ProductSalesForm.vue 里;只允许填写(承运商、运货单号)两个字段;(单独搞个 --- --- 分栏) -->
|
||||
<!-- 待出库:执行出库、取消 -->
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleExecute(scope.row.id)"
|
||||
v-hasPermi="['mes:wm-product-sales:execute']"
|
||||
v-if="scope.row.status === MesWmProductSalesStatusEnum.APPROVED"
|
||||
>
|
||||
执行出库
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleCancel(scope.row.id)"
|
||||
v-hasPermi="['mes:wm-product-sales:cancel']"
|
||||
v-if="
|
||||
[
|
||||
MesWmProductSalesStatusEnum.APPROVING,
|
||||
MesWmProductSalesStatusEnum.APPROVED
|
||||
].includes(scope.row.status)
|
||||
"
|
||||
>
|
||||
取消
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<ProductSalesForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter2 } from '@/utils/formatTime'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import download from '@/utils/download'
|
||||
import { WmProductSalesApi, WmProductSalesVO } from '@/api/mes/wm/productsales'
|
||||
import MdClientSelect from '@/views/mes/md/client/components/MdClientSelect.vue'
|
||||
import ProductSalesForm from './ProductSalesForm.vue'
|
||||
import { MesWmProductSalesStatusEnum } from '@/views/mes/utils/constants'
|
||||
|
||||
defineOptions({ name: 'MesWmProductSales' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<WmProductSalesVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
clientId: undefined,
|
||||
shipmentDate: undefined
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const formRef = ref() // 表单弹窗
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await WmProductSalesApi.getProductSalesPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 提交按钮操作 */
|
||||
const handleSubmit = async (id: number) => {
|
||||
try {
|
||||
await message.confirm('确认提交该销售出库单?')
|
||||
await WmProductSalesApi.submitProductSales(id)
|
||||
message.success('提交成功')
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 执行出库 */
|
||||
const handleExecute = async (id: number) => {
|
||||
try {
|
||||
await message.confirm('确认执行出库?执行后将扣减库存。')
|
||||
await WmProductSalesApi.executeProductSales(id)
|
||||
message.success('出库成功')
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 取消 */
|
||||
const handleCancel = async (id: number) => {
|
||||
try {
|
||||
await message.confirm('确认取消该销售出库单?取消后不可恢复。')
|
||||
await WmProductSalesApi.cancelProductSales(id)
|
||||
message.success('取消成功')
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 删除 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
await message.delConfirm()
|
||||
await WmProductSalesApi.deleteProductSales(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
await message.exportConfirm()
|
||||
exportLoading.value = true
|
||||
const data = await WmProductSalesApi.exportProductSales(queryParams)
|
||||
download.excel(data, '销售出库单.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
Loading…
Reference in New Issue