Commit 23e6429e by wuqian

feat:订单跟踪工艺筛选

parent e8b276ce
......@@ -2,6 +2,7 @@
defineOptions({
name: 'OrderTracking',
})
import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx'
import {
factoryWarehouseInfo,
warehouseInfo,
......@@ -25,6 +26,7 @@ import {
LogListData,
Tab,
ExportParams,
IAllList,
} from '@/types/api/podUsOrder'
import platformJson from '../../../json/platform.json'
import dayjs from 'dayjs'
......@@ -62,7 +64,7 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({
thirdSkuCode: '',
supplierProductNo: '',
batchArrangeNumber: '',
craftCode: '',
craftCode: [],
thirdStockSku: '',
})
const tableColumns = computed(() => {
......@@ -477,18 +479,52 @@ const getUserMark = async () => {
}
}
const craftList = ref<CraftListData[]>([])
const processType = ref([
{
label: '烫画',
value: 'TH',
},
{
label: '直喷',
value: 'ZP',
},
{
label: '刺绣',
value: 'CX',
},
{
label: '雕刻',
value: 'DK',
},
{
label: '白胚',
value: 'BP',
},
{
label: '其他',
value: 'QT',
},
])
// 获取工艺列表
const craftList = ref<IAllList[]>([])
const processTypeMap = processType.value.reduce((acc, cur) => {
acc[cur.value] = cur.label
return acc
}, {} as Record<string, string>)
const loadCraftList = async () => {
try {
const res = await getListCraftApi()
if (res.code !== 200) return
craftList.value = res.data
const data: CraftListData[] = res.data
craftList.value = data.map((item) => ({
id: item.craftCode,
name: item.craftName,
warehouseName: processTypeMap[item.craftType] ?? '其他', // craftType 对应中文
})) as IAllList[]
} catch (e) {
console.error(e)
}
}
const tableRef = ref()
const getOrderListFn = async () => {
const loading = ElLoading.service({
......@@ -869,7 +905,7 @@ onMounted(() => {
</ElFormItem>
<ElFormItem label="工艺">
<ElSelect
<!-- <ElSelect
v-model="searchForm.craftCode"
clearable
filterable
......@@ -882,7 +918,14 @@ onMounted(() => {
:label="item.craftName"
:value="item.craftCode"
></el-option>
</ElSelect>
</ElSelect> -->
<LogisticsWaySelect
v-model="searchForm.craftCode"
:company-list="craftList"
:start-width="'150px'"
search-placeholder="搜索工艺名称"
start-placeholder="请选择工艺名称"
></LogisticsWaySelect>
</ElFormItem>
<ElFormItem label="款号">
<ElInput
......
......@@ -2,6 +2,7 @@
defineOptions({
name: 'OrderTracking',
})
import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx'
import {
factoryWarehouseInfo,
warehouseInfo,
......@@ -24,6 +25,7 @@ import {
Tab,
ExportParams,
} from '@/types/api/podCnOrder'
import { IAllList } from '@/types/api/podUsOrder'
import platformJson from '../../../json/platform.json'
import dayjs from 'dayjs'
import { getUserMarkList } from '@/api/common'
......@@ -60,7 +62,7 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({
thirdSkuCode: '',
supplierProductNo: '',
batchArrangeNumber: '',
craftCode: '',
craftCode: [],
thirdStockSku: '',
})
const tableColumns = computed(() => {
......@@ -463,13 +465,48 @@ const getUserMark = async () => {
}
}
const craftList = ref<CraftListData[]>([])
const processType = ref([
{
label: '烫画',
value: 'TH',
},
{
label: '直喷',
value: 'ZP',
},
{
label: '刺绣',
value: 'CX',
},
{
label: '雕刻',
value: 'DK',
},
{
label: '白胚',
value: 'BP',
},
{
label: '其他',
value: 'QT',
},
])
// 获取工艺列表
const craftList = ref<IAllList[]>([])
const processTypeMap = processType.value.reduce((acc, cur) => {
acc[cur.value] = cur.label
return acc
}, {} as Record<string, string>)
const loadCraftList = async () => {
try {
const res = await getListCraftApi()
if (res.code !== 200) return
craftList.value = res.data
const data: CraftListData[] = res.data
craftList.value = data.map((item) => ({
id: item.craftCode,
name: item.craftName,
warehouseName: processTypeMap[item.craftType] ?? '其他', // craftType 对应中文
})) as IAllList[]
} catch (e) {
console.error(e)
}
......@@ -854,7 +891,7 @@ onMounted(() => {
</ElFormItem>
<ElFormItem label="工艺">
<ElSelect
<!-- <ElSelect
v-model="searchForm.craftCode"
clearable
filterable
......@@ -867,7 +904,14 @@ onMounted(() => {
:label="item.craftName"
:value="item.craftCode"
></el-option>
</ElSelect>
</ElSelect> -->
<LogisticsWaySelect
v-model="searchForm.craftCode"
:company-list="craftList"
:start-width="'150px'"
search-placeholder="搜索工艺名称"
start-placeholder="请选择工艺名称"
></LogisticsWaySelect>
</ElFormItem>
<ElFormItem label="款号">
<ElInput
......
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