Commit ade84e89 by wuqian

feat:工艺筛选和工艺价格优化#ID:1000435

parent a73a0a57
......@@ -38,7 +38,7 @@ export interface SearchForm {
thirdSkuCode?: string
supplierProductNo?: string
batchArrangeNumber?: string
craftCode?: string
craftCode?: string[] | string
thirdStockSku?: string
exceptionHandling?: number | undefined
interceptStatus?: number | string
......@@ -221,6 +221,7 @@ export interface LogisticsFormData {
export interface CraftListData {
craftName: string
craftCode: string
craftType: string
}
export interface PackingData {
podProductionNo?: string // 生产单号(PSCD 开头)
......
......@@ -34,7 +34,7 @@ export interface SearchForm {
thirdSkuCode?: string
supplierProductNo?: string
batchArrangeNumber?: string
craftCode?: string
craftCode?: string | string[]
craftCodeArr?: string[]
thirdStockSku?: string
interceptStatus?: number | string
......@@ -215,6 +215,7 @@ export interface LogisticsFormData {
export interface CraftListData {
craftName: string
craftCode: string
craftType: string
}
export interface InterceptStateGroupData {
......@@ -225,3 +226,8 @@ export interface InterceptStateGroupData {
[key: string]: number
}
}
export interface IAllList {
id: string
name: string
warehouseName?: string
}
......@@ -43,7 +43,7 @@ interface IwayList {
}
interface IAllList {
factoryId?: number
id: number
id: number | string
name: string
serviceCode?: string
siteUrl?: string
......@@ -79,6 +79,14 @@ export default defineComponent({
type: Boolean,
default: false,
},
searchPlaceholder: {
type: String,
default: '请搜索承运商',
},
startPlaceholder: {
type: String,
default: '请选择物流方式',
},
},
emits: ['update:modelValue'],
setup(props, { emit }) {
......@@ -146,7 +154,20 @@ export default defineComponent({
},
{ deep: true, immediate: true },
)
const handleClearSelection = () => {
/* 1. 清空显示文本 */
waysName.value = ''
/* 2. 清空双向绑定结果 */
if (props.isRadio) {
selectedRadioList.value = '' // 单选
emit('update:modelValue', '')
} else {
selectedList.value = [] // 多选
emit('update:modelValue', [])
}
/* 3. 可选:把搜索框也重置 */
searchName.value = ''
}
function setCheckAll(company: ICompanyList, event: boolean) {
if (event) {
selectedList.value = [
......@@ -238,7 +259,9 @@ export default defineComponent({
<ElInput
modelValue={waysName.value}
style={{ width: '100%' }}
placeholder="请选择物流方式"
placeholder={props.startPlaceholder}
clearable
onClear={handleClearSelection}
/>
),
}}
......@@ -256,7 +279,7 @@ export default defineComponent({
}}
clearable
style={{ width: '200px', padding: '10px' }}
placeholder="请搜索承运商"
placeholder={props.searchPlaceholder}
/>
<ElScrollbar
class="scroll-container"
......
......@@ -52,20 +52,12 @@
</ElFormItem>
<ElFormItem label="工艺">
<ElSelect
<LogisticsWaySelect
v-model="searchForm.craftCode"
clearable
filterable
placeholder="请选择工艺"
style="width: 150px"
>
<el-option
v-for="item in craftList"
:key="item.craftCode"
:label="item.craftName"
:value="item.craftCode"
></el-option>
</ElSelect>
:company-list="craftList"
search-placeholder="搜索工艺名称"
start-placeholder="请选择工艺名称"
></LogisticsWaySelect>
</ElFormItem>
<ElFormItem label="库存SKU">
<ElInput
......@@ -2476,6 +2468,7 @@
</template>
<script setup lang="ts">
import { getUserMarkList } from '@/api/common'
import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx'
// import { AnyObject } from '@/types/api/warehouse'
import {
InfoFilled,
......@@ -2544,7 +2537,7 @@ import { BaseRespData } from '@/types/api'
import UpdateAddress from './components/updateAddress.vue'
import { getAllCountryApi } from '@/api/logistics.ts'
import { InterceptStateGroupData } from '@/types/api/podUsOrder'
import { InterceptStateGroupData,IAllList } from '@/types/api/podUsOrder'
import TableView from '@/components/TableView.vue'
import {
LogListData,
......@@ -2776,7 +2769,7 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({
thirdSkuCode: '',
supplierProductNo: '',
batchArrangeNumber: '',
craftCode: '',
craftCode: [],
thirdStockSku: '',
})
const shipmentArea = ref(0)
......@@ -4982,14 +4975,48 @@ const loadWarehouseList = async () => {
console.error(e)
}
}
const processType = ref([
{
label: '烫画',
value: 'TH',
},
{
label: '直喷',
value: 'ZP',
},
{
label: '刺绣',
value: 'CX',
},
{
label: '雕刻',
value: 'DK',
},
{
label: '白胚',
value: 'BP',
},
{
label: '其他',
value: 'QT',
},
])
// 获取工艺列表
const craftList = ref<CraftListData[]>([])
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)
}
......
......@@ -53,23 +53,12 @@
</ElFormItem>
<ElFormItem label="工艺">
<ElSelect
v-model="searchForm.craftCodeArr"
clearable
filterable
multiple
collapse-tags
collapse-tags-tooltip
placeholder="请输入工艺"
style="width: 150px"
>
<el-option
v-for="item in craftList"
:key="item.craftCode"
:label="item.craftName"
:value="item.craftCode"
></el-option>
</ElSelect>
<LogisticsWaySelect
v-model="searchForm.craftCode"
:company-list="craftList"
search-placeholder="搜索工艺名称"
start-placeholder="请选择工艺名称"
></LogisticsWaySelect>
</ElFormItem>
<ElFormItem label="库存SKU">
<ElInput
......@@ -2835,6 +2824,7 @@
</ElDialog>
</template>
<script setup lang="ts">
import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx'
import { getUserMarkList } from '@/api/common'
// import { AnyObject } from '@/types/api/warehouse'
import { convertToChinaTime } from '@/utils/index'
......@@ -2932,6 +2922,7 @@ import {
CraftListData,
ExportParams,
InterceptStateGroupData,
IAllList
} from '@/types/api/podUsOrder'
import usePageList from '@/utils/hooks/usePageList'
import { useValue } from '@/utils/hooks/useValue'
......@@ -3166,8 +3157,8 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({
thirdSkuCode: '',
supplierProductNo: '',
batchArrangeNumber: '',
craftCode: '',
craftCodeArr: [],
craftCode: [],
// craftCodeArr: [],
thirdStockSku: '',
})
const exceptionStatus = ref(1)
......@@ -3805,10 +3796,10 @@ const {
factorySubOrderNumber,
startTime: timeRange.value?.[0] || null,
endTime: timeRange.value?.[1] || null,
craftCode: searchForm.value?.craftCodeArr?.join(',') || '',
// craftCode: searchForm.value?.craftCodeArr?.join(',') || '',
tagsId: searchForm.value?.tagsIdArr?.join(',') || '',
}
baseparams.craftCodeArr && delete baseparams.craftCodeArr
// baseparams.craftCodeArr && delete baseparams.craftCodeArr
baseparams.tagsIdArr && delete baseparams.tagsIdArr
// 批量下载
if (status.value === 'BATCH_DOWNLOAD') {
......@@ -5630,14 +5621,49 @@ const loadWarehouseList = async () => {
console.error(e)
}
}
const processType = ref([
{
label: '烫画',
value: 'TH',
},
{
label: '直喷',
value: 'ZP',
},
{
label: '刺绣',
value: 'CX',
},
{
label: '雕刻',
value: 'DK',
},
{
label: '白胚',
value: 'BP',
},
{
label: '其他',
value: 'QT',
},
])
// 获取工艺列表
const craftList = ref<CraftListData[]>([])
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)
}
......
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