Commit e24b3539 by qinjianhui

feat: 客户标签查询修改

parent 6c3d16b0
......@@ -574,3 +574,9 @@ export function batchCheckPrintPodOrder(ids: string) {
`/factory/podOrder/batchCheckPrintPodOrder?ids=${ids}`,
)
}
export function getCustomTagListPodOrderApi() {
return axios.get<never, BaseRespData<never>>(
`factory/podOrder/getCustomTagList`,
)
}
......@@ -28,6 +28,8 @@ export interface SearchForm {
replaceShipment?: number | string
shipmentType?: number | string
tagsIdArr?: string[]
/** list_page 查询:客户标签 id,逗号分隔(由 tagsIdArr 转换) */
tagsId?: string
source?: string
size?: string
logisticsCompanyCode?: string
......
......@@ -28,6 +28,8 @@ export interface SearchForm {
replaceShipment?: number | string
shipmentType?: number | string
tagsIdArr?: string[]
/** list_page 查询:客户标签 id,逗号分隔(由 tagsIdArr 转换) */
tagsId?: string
source?: string
size?: string
logisticsCompanyCode?: string
......@@ -91,6 +93,7 @@ export interface FactoryOrderNewListData {
totalCustomsValue?: number
statusName?: string
thirdOrderNumber?: string
customTagList?: { id: string; name: string }[]
}
export interface ProductListData {
......
import { ref } from 'vue'
import { getListCraftApi, getCustomTagListCnApi, allErpCodeListApi } from '@/api/podCnOrder'
import { getListCraftApi, allErpCodeListApi } from '@/api/podCnOrder'
import { getUserMarkList, loadWarehouseListApi } from '@/api/common'
import { getAllCountryApi } from '@/api/logistics'
import type { ProductTypeGroup } from '../component/productTypeFilterTypes'
......@@ -12,6 +12,7 @@ import {
import type { IAllList } from '@/types/api/podUsOrder'
import type { CraftListData } from '@/types/api/podCnOrder'
import type { WarehouseListData } from '@/types'
import { getCustomTagListPodOrderApi } from '@/api/factoryOrderNew'
interface LogisticsCodeItem {
code: string
......@@ -91,7 +92,7 @@ export function useOrderDictionaries() {
const getCustomTagList = async () => {
try {
const res = await getCustomTagListCnApi()
const res = await getCustomTagListPodOrderApi()
if (res.code !== 200) return
customTagList.value = res.data
} catch (_e) {
......
......@@ -59,11 +59,17 @@ export function useOrderSearchForm(refreshCurrentView: () => void) {
}
const getQueryPayload = () => {
const { productMarkList: rawProductMarks, ...rest } = searchForm.value
const { productMarkList: rawProductMarks, tagsIdArr, ...rest } =
searchForm.value
const markQuery = normalizeProductMarkListForQuery(rawProductMarks)
const tagsId =
Array.isArray(tagsIdArr) && tagsIdArr.length > 0
? tagsIdArr.join(',')
: undefined
return {
...rest,
...markQuery,
...(tagsId !== undefined ? { tagsId } : {}),
startTime: dateRange.value?.[0] || null,
endTime: dateRange.value?.[1] || null,
}
......
......@@ -255,27 +255,7 @@
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="是否代发">
<ElSelect
v-model="searchForm.replaceShipment"
placeholder="是否代发"
clearable
:teleported="false"
style="width: 150px"
@change="changeReplaceShipment"
>
<ElOption
v-for="(item, index) in ['不代发', '代发']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem
v-if="searchForm.replaceShipment === 0"
label="物流类型"
>
<ElFormItem label="物流类型">
<ElSelect
v-model="searchForm.shipmentType"
placeholder="物流类型"
......@@ -286,7 +266,7 @@
<ElOption
v-for="(item, index) in [
'自有物流',
'工厂物流',
'九猫统筹物流',
'自提',
]"
:key="index"
......@@ -295,22 +275,23 @@
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem
v-if="searchForm.replaceShipment === 1"
label="物流类型"
>
<ElFormItem label="客户标签">
<ElSelect
v-model="searchForm.shipmentType"
placeholder="物流类型"
v-model="searchForm.tagsIdArr"
placeholder="请选择客户标签"
clearable
filterable
multiple
collapse-tags
collapse-tags-tooltip
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in ['自有物流', '九猫统筹物流']"
:key="index"
:value="index"
:label="item"
v-for="item in customTagList"
:key="item.id"
:value="item.id"
:label="item.name"
></ElOption>
</ElSelect>
</ElFormItem>
......@@ -720,7 +701,7 @@
修改地址
</ElButton>
<ElButton
v-if="showPendingLogisticsRefreshAddress(row)"
v-if="showPendingLogisticsRefreshAddress()"
type="primary"
link
size="small"
......@@ -796,7 +777,7 @@
<CreateLogisticDialog
ref="createLogisticDialogRef"
:new-order-selection="selectedRows"
@show-result="handleFastProductionSuccess"
@show-result="createLogisticsSuccess"
/>
<UpdateCustomDeclarationInfoDialog
v-model="updateCustomsDialogVisible"
......@@ -965,6 +946,7 @@ import { useOrderSearchForm } from './hooks/useOrderSearchForm'
import { useOrderStatusTree } from './hooks/useOrderStatusTree'
import { useOrderListAndDetail } from './hooks/useOrderListAndDetail'
import { useOrderBatchActions } from './hooks/useOrderBatchActions'
import { ElTag } from 'element-plus'
const resultInfo = ref<ResultInfoDataItem[]>([])
const resultRefs = ref()
......@@ -976,6 +958,7 @@ const cardLayoutRef = ref<InstanceType<typeof CardLayout>>()
const {
userMarkList,
receiverCountryList,
customTagList,
allCodelist,
craftList,
warehouseList,
......@@ -1100,11 +1083,8 @@ const receiverAddressForm = ref<AddressInfo>({
const showPendingLogisticsUpdateAddress = (row: FactoryOrderNewListData) =>
status.value === 'PENDING_CREATE_LOGISTICS' && row.shipmentType === 1
const showPendingLogisticsRefreshAddress = (row: FactoryOrderNewListData) => {
const showPendingLogisticsRefreshAddress = () => {
if (status.value !== 'PENDING_CREATE_LOGISTICS') return false
if (row.replaceShipment === 1) return true
if (row.replaceShipment === 0 && row.shipmentType === 1) return true
return false
}
const submitFactoryOrderReceiverAddress = (data: AddressInfo) =>
......@@ -1200,9 +1180,22 @@ const mainColumns = [
align: 'center',
},
{
prop: 'tagsIdList',
label: '客户标签',
minWidth: 160,
minWidth: 120,
align: 'center',
render: (row: FactoryOrderNewListData) => {
return (
<div style="display: flex; flex-direction: column; gap: 5px;">
{row?.customTagList?.map((item) => {
return (
<div key={item.id} class="tag-item">
<ElTag type="success">{item.name}</ElTag>
</div>
)
})}
</div>
)
},
},
{
prop: 'logisticsWayName',
......@@ -1213,7 +1206,7 @@ const mainColumns = [
return (
<div>
{row.shipmentType === 0 && <span>自有物流</span>}
{row.shipmentType === 1 && <span>工厂物流</span>}
{row.shipmentType === 1 && <span>九猫统筹物流</span>}
{row.shipmentType === 2 && <span>自提</span>}
</div>
)
......@@ -1524,7 +1517,6 @@ const { ensureSelection, executeBatchAction } = useOrderBatchActions({
getIds: getSelectedIds,
refreshCurrentView,
})
const handleEditRemark = async (row: ProductListData) => {
try {
const { value } = await ElMessageBox.prompt('请输入备注', '提示', {
......@@ -1993,10 +1985,26 @@ const completeOperationById = (ids: number[]) => completeDeliveryApi(ids)
const downloadOperationById = (ids: number[]) =>
downloadOperationMaterialApi(ids)
const handleFastProductionSuccess = (data: ResultInfoDataItem[]) => {
const result = data[0]
if (!result.status) {
ElMessageBox.alert(
`操作单号 ${result.factoryOrderNumber} ${result.message}`,
'提示',
{
type: 'error',
},
)
return
}
}
const createLogisticsSuccess = (data: ResultInfoDataItem[]) => {
const isSuccess = data.every((item) => item.status)
if (!isSuccess) {
resultInfo.value = data.filter((item) => !item.status)
resultRefs.value?.showDialog()
} else {
ElMessage.success('操作成功')
refreshCurrentView()
}
}
const fastClose = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment