Commit 23e6429e by wuqian

feat:订单跟踪工艺筛选

parent e8b276ce
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
defineOptions({ defineOptions({
name: 'OrderTracking', name: 'OrderTracking',
}) })
import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx'
import { import {
factoryWarehouseInfo, factoryWarehouseInfo,
warehouseInfo, warehouseInfo,
...@@ -25,6 +26,7 @@ import { ...@@ -25,6 +26,7 @@ import {
LogListData, LogListData,
Tab, Tab,
ExportParams, ExportParams,
IAllList,
} from '@/types/api/podUsOrder' } from '@/types/api/podUsOrder'
import platformJson from '../../../json/platform.json' import platformJson from '../../../json/platform.json'
import dayjs from 'dayjs' import dayjs from 'dayjs'
...@@ -62,7 +64,7 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({ ...@@ -62,7 +64,7 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({
thirdSkuCode: '', thirdSkuCode: '',
supplierProductNo: '', supplierProductNo: '',
batchArrangeNumber: '', batchArrangeNumber: '',
craftCode: '', craftCode: [],
thirdStockSku: '', thirdStockSku: '',
}) })
const tableColumns = computed(() => { const tableColumns = computed(() => {
...@@ -477,18 +479,52 @@ const getUserMark = async () => { ...@@ -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 () => { const loadCraftList = async () => {
try { try {
const res = await getListCraftApi() const res = await getListCraftApi()
if (res.code !== 200) return 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) { } catch (e) {
console.error(e) console.error(e)
} }
} }
const tableRef = ref() const tableRef = ref()
const getOrderListFn = async () => { const getOrderListFn = async () => {
const loading = ElLoading.service({ const loading = ElLoading.service({
...@@ -869,7 +905,7 @@ onMounted(() => { ...@@ -869,7 +905,7 @@ onMounted(() => {
</ElFormItem> </ElFormItem>
<ElFormItem label="工艺"> <ElFormItem label="工艺">
<ElSelect <!-- <ElSelect
v-model="searchForm.craftCode" v-model="searchForm.craftCode"
clearable clearable
filterable filterable
...@@ -882,7 +918,14 @@ onMounted(() => { ...@@ -882,7 +918,14 @@ onMounted(() => {
:label="item.craftName" :label="item.craftName"
:value="item.craftCode" :value="item.craftCode"
></el-option> ></el-option>
</ElSelect> </ElSelect> -->
<LogisticsWaySelect
v-model="searchForm.craftCode"
:company-list="craftList"
:start-width="'150px'"
search-placeholder="搜索工艺名称"
start-placeholder="请选择工艺名称"
></LogisticsWaySelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="款号"> <ElFormItem label="款号">
<ElInput <ElInput
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
defineOptions({ defineOptions({
name: 'OrderTracking', name: 'OrderTracking',
}) })
import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx'
import { import {
factoryWarehouseInfo, factoryWarehouseInfo,
warehouseInfo, warehouseInfo,
...@@ -24,6 +25,7 @@ import { ...@@ -24,6 +25,7 @@ import {
Tab, Tab,
ExportParams, ExportParams,
} from '@/types/api/podCnOrder' } from '@/types/api/podCnOrder'
import { IAllList } from '@/types/api/podUsOrder'
import platformJson from '../../../json/platform.json' import platformJson from '../../../json/platform.json'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { getUserMarkList } from '@/api/common' import { getUserMarkList } from '@/api/common'
...@@ -60,7 +62,7 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({ ...@@ -60,7 +62,7 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({
thirdSkuCode: '', thirdSkuCode: '',
supplierProductNo: '', supplierProductNo: '',
batchArrangeNumber: '', batchArrangeNumber: '',
craftCode: '', craftCode: [],
thirdStockSku: '', thirdStockSku: '',
}) })
const tableColumns = computed(() => { const tableColumns = computed(() => {
...@@ -463,13 +465,48 @@ const getUserMark = async () => { ...@@ -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 () => { const loadCraftList = async () => {
try { try {
const res = await getListCraftApi() const res = await getListCraftApi()
if (res.code !== 200) return 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) { } catch (e) {
console.error(e) console.error(e)
} }
...@@ -854,7 +891,7 @@ onMounted(() => { ...@@ -854,7 +891,7 @@ onMounted(() => {
</ElFormItem> </ElFormItem>
<ElFormItem label="工艺"> <ElFormItem label="工艺">
<ElSelect <!-- <ElSelect
v-model="searchForm.craftCode" v-model="searchForm.craftCode"
clearable clearable
filterable filterable
...@@ -867,7 +904,14 @@ onMounted(() => { ...@@ -867,7 +904,14 @@ onMounted(() => {
:label="item.craftName" :label="item.craftName"
:value="item.craftCode" :value="item.craftCode"
></el-option> ></el-option>
</ElSelect> </ElSelect> -->
<LogisticsWaySelect
v-model="searchForm.craftCode"
:company-list="craftList"
:start-width="'150px'"
search-placeholder="搜索工艺名称"
start-placeholder="请选择工艺名称"
></LogisticsWaySelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="款号"> <ElFormItem label="款号">
<ElInput <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