feat(mes): 移除收货地址字段并优化发货通知单选择器

pull/871/MERGE
YunaiV 2026-03-02 13:32:06 +08:00
parent 0e58608fe1
commit 77e25ce9d8
5 changed files with 87 additions and 14 deletions

View File

@ -11,7 +11,6 @@ export interface WmProductSalesVO {
shipmentDate: string
contactName: string
contactTelephone: string
contactAddress: string
status: number
remark: string
createTime: string

View File

@ -51,5 +51,10 @@ export const WmSalesNoticeApi = {
// 导出发货通知单 Excel
exportSalesNotice: async (params: any) => {
return await request.download({ url: '/mes/wm/sales-notice/export-excel', params })
},
// 获取发货通知单精简列表
getSalesNoticeSimpleList: async (status?: number) => {
return await request.get({ url: '/mes/wm/sales-notice/simple-list', params: { status } })
}
}

View File

@ -87,16 +87,6 @@
/>
</el-form-item>
</el-col>
<el-col :span="8">
<!-- TODO @AI前后端都删除掉 contactAddress 字段 -->
<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="8">
@ -172,7 +162,6 @@ const formData = ref({
salesDate: undefined,
contactName: undefined,
contactTelephone: undefined,
contactAddress: undefined,
carrier: undefined,
shippingNumber: undefined,
remark: undefined
@ -272,7 +261,6 @@ const resetForm = () => {
salesDate: undefined,
contactName: undefined,
contactTelephone: undefined,
contactAddress: undefined,
carrier: undefined,
shippingNumber: undefined,
remark: undefined

View File

@ -92,7 +92,6 @@
<el-table-column label="客户名称" align="center" prop="clientName" min-width="120" />
<el-table-column label="收货人" align="center" prop="contactName" min-width="100" />
<el-table-column label="联系方式" align="center" prop="contactTelephone" min-width="120" />
<el-table-column label="收货地址" align="center" prop="contactAddress" min-width="180" show-overflow-tooltip />
<el-table-column label="承运商" align="center" prop="carrier" min-width="120" />
<el-table-column label="运输单号" align="center" prop="shippingNumber" min-width="160" />
<el-table-column

View File

@ -0,0 +1,82 @@
<!-- MES 发货通知单选择器纯下拉前端过滤支持 noticeCodenoticeName -->
<template>
<el-select
v-model="selectValue"
:placeholder="placeholder"
:disabled="disabled"
:clearable="clearable"
filterable
:filter-method="handleFilter"
class="!w-1/1"
@change="handleChange"
>
<el-option v-for="item in filteredList" :key="item.id" :label="item.noticeName" :value="item.id">
<div class="flex items-center gap-8px">
<span>{{ item.noticeName }}</span>
<el-tag v-if="item.noticeCode" size="small" type="info" class="ml-4px">
编号: {{ item.noticeCode }}
</el-tag>
</div>
</el-option>
</el-select>
</template>
<script setup lang="ts">
import { WmSalesNoticeApi, WmSalesNoticeVO } from '@/api/mes/wm/salesnotice'
defineOptions({ name: 'WmSalesNoticeSelect' })
const props = withDefaults(
defineProps<{
modelValue?: number
disabled?: boolean
clearable?: boolean
placeholder?: string
status?: number
}>(),
{
disabled: false,
clearable: true,
placeholder: '请选择发货通知单'
}
)
const emit = defineEmits<{
'update:modelValue': [value: number | undefined]
change: [item: WmSalesNoticeVO | undefined]
}>()
const allList = ref<WmSalesNoticeVO[]>([])
const filteredList = ref<WmSalesNoticeVO[]>([])
const selectValue = computed({
get: () => props.modelValue,
set: (val) => emit('update:modelValue', val)
})
/** 前端过滤noticeCode + noticeName */
const handleFilter = (query: string) => {
if (!query) {
filteredList.value = allList.value
return
}
const keyword = query.toLowerCase()
filteredList.value = allList.value.filter(
(item) =>
item.noticeName?.toLowerCase().includes(keyword) ||
item.noticeCode?.toLowerCase().includes(keyword)
)
}
/** 选中变化 */
const handleChange = (val: number | undefined) => {
const item = allList.value.find((o) => o.id === val)
emit('change', item)
}
/** 加载发货通知单列表 */
onMounted(async () => {
allList.value = await WmSalesNoticeApi.getSalesNoticeSimpleList(props.status)
filteredList.value = allList.value
})
</script>