Commit 2d1979df by linjinhong

Merge remote-tracking branch 'origin/master' into linjinhong

parents 29e68692 84eb78ce
...@@ -8,10 +8,16 @@ import { ...@@ -8,10 +8,16 @@ import {
ProductionClient, ProductionClient,
WarehouseListData, WarehouseListData,
LogisticsData, LogisticsData,
ExportParams
} from '@/types/api/podUsOrder' } from '@/types/api/podUsOrder'
import axios from './axios' import axios from './axios'
import { PodMakeOrderData } from '@/types/api/podMakeOrder' import { PodMakeOrderData } from '@/types/api/podMakeOrder'
export function exportPodUSInfo(data: ExportParams) {
return axios.post<never, BasePaginationData<never>>(
'factory/podJomallOrderUs/exportPodUsOrder',
data,
)
}
// 同步收货地址 // 同步收货地址
export function syncReceiverAddress(data: number[]) { export function syncReceiverAddress(data: number[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
......
...@@ -64,6 +64,14 @@ export interface factoryLocation { ...@@ -64,6 +64,14 @@ export interface factoryLocation {
locationId?: string locationId?: string
idList?: string | number[] idList?: string | number[]
} }
export interface productNo {
productNo?: string
idList?: string | number[]
}
export interface customSku {
customSku?: string
idList?: string | number[]
}
export interface ExportFactoryWarehouseInfo { export interface ExportFactoryWarehouseInfo {
pageSize?: number pageSize?: number
currentPage?: number currentPage?: number
...@@ -124,6 +132,8 @@ export interface WarehouseWarning { ...@@ -124,6 +132,8 @@ export interface WarehouseWarning {
number: string number: string
locationName: string locationName: string
warehouseId: string | number warehouseId: string | number
customSku?: string
productNo?: string
} }
export interface positionInfo { export interface positionInfo {
...@@ -182,12 +192,28 @@ export function getFactoryLocation(data: factoryWarehouseInfo) { ...@@ -182,12 +192,28 @@ export function getFactoryLocation(data: factoryWarehouseInfo) {
data, data,
) )
} }
// 修改库位
export function updateLocationApi(data: factoryLocation) { export function updateLocationApi(data: factoryLocation) {
return axios.post<never, BasePaginationData<never>>( return axios.post<never, BasePaginationData<never>>(
'factoryWarehouseInventory/updateLocation', 'factoryWarehouseInventory/updateLocation',
data, data,
) )
} }
// 修改款号
export function updateProductNoApi(data: productNo) {
return axios.post<never, BasePaginationData<never>>(
'factoryWarehouseInventory/updateProductNo',
data,
)
}
// 修改自定义sku
export function updateCustomSkuApi(data: customSku) {
return axios.post<never, BasePaginationData<never>>(
'factoryWarehouseInventory/updateCustomSku',
data,
)
}
export function exportWarehouseInfo(data: ExportFactoryWarehouseInfo) { export function exportWarehouseInfo(data: ExportFactoryWarehouseInfo) {
return axios.post<never, BasePaginationData<positionInfo>>( return axios.post<never, BasePaginationData<positionInfo>>(
'factoryWarehouseInventory/inventory', 'factoryWarehouseInventory/inventory',
......
...@@ -3,30 +3,34 @@ export interface Tab { ...@@ -3,30 +3,34 @@ export interface Tab {
statusName?: string statusName?: string
quantity?: number quantity?: number
} }
export interface ExportParams extends SearchForm {
idList?: number[]
exportAll: boolean
}
export interface SearchForm { export interface SearchForm {
timeType: number | null timeType?: number | null
shopNumber: string shopNumber?: string
shipmentType: string shipmentType?: string
userMark: string userMark?: string
processNumber: string processNumber?: string
baseSku: string baseSku?: string
factoryOrderNumber: string factoryOrderNumber?: string
sku: string sku?: string
factorySubOrderNumber: string factorySubOrderNumber?: string
status: string status?: string
customizedQuantity: string customizedQuantity?: string
multi: boolean | null multi?: boolean | null
startTime: string | null startTime?: string | null
endTime: string | null endTime?: string | null
exceptionHandling: number | undefined exceptionHandling?: number | undefined
platform: string platform?: string
productionClient: string productionClient?: string
warehouseId: string | number warehouseId?: string | number
thirdSkuCode: string thirdSkuCode?: string
supplierProductNo: string supplierProductNo?: string
batchArrangeNumber: string batchArrangeNumber?: string
craftCode: string craftCode?: string
thirdStockSku: string thirdStockSku?: string
} }
export interface PodUsOrderListData { export interface PodUsOrderListData {
id: number id: number
......
...@@ -470,6 +470,14 @@ ...@@ -470,6 +470,14 @@
刷新素材 刷新素材
</ElButton> </ElButton>
</span> </span>
<span v-if="status === 'COMPLETE'" class="item">
<ElButton
:loading="exportLoading"
type="success"
@click="exportData"
>导出</ElButton
>
</span>
</ElFormItem> </ElFormItem>
</ElForm> </ElForm>
</div> </div>
...@@ -1803,9 +1811,33 @@ ...@@ -1803,9 +1811,33 @@
<el-button type="primary" @click="logisticsSubmit"> 确定</el-button> <el-button type="primary" @click="logisticsSubmit"> 确定</el-button>
</template> </template>
</el-dialog> </el-dialog>
<!-- 导出 -->
<ElDialog
v-model="exportVisible"
title="导出选项"
width="500px"
:close-on-click-modal="false"
>
<el-form :model="exportForm" label-width="80px">
<el-form-item label="" prop="resource">
<el-radio-group v-model="exportForm.resource">
<el-radio :label="0">导出本页</el-radio>
<el-radio :label="1">导出选中</el-radio>
<el-radio :label="2">全部</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="exportVisible = false">取消</el-button>
<el-button type="primary" @click="submitExportForm">确认</el-button>
</span>
</template>
</ElDialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getUserMarkList } from '@/api/common' import { getUserMarkList } from '@/api/common'
// import { AnyObject } from '@/types/api/warehouse'
import { import {
ArrowDown, ArrowDown,
CaretBottom, CaretBottom,
...@@ -1861,6 +1893,7 @@ import { ...@@ -1861,6 +1893,7 @@ import {
batchDownloadDeleteApi, batchDownloadDeleteApi,
batchDownloadRecomposingApi, batchDownloadRecomposingApi,
updateToWaitShipmentApi, updateToWaitShipmentApi,
exportPodUSInfo,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
...@@ -1882,6 +1915,7 @@ import { ...@@ -1882,6 +1915,7 @@ import {
LogisticsData, LogisticsData,
LogisticsFormData, LogisticsFormData,
CraftListData, CraftListData,
ExportParams,
} from '@/types/api/podUsOrder' } from '@/types/api/podUsOrder'
import usePageList from '@/utils/hooks/usePageList' import usePageList from '@/utils/hooks/usePageList'
import { useValue } from '@/utils/hooks/useValue' import { useValue } from '@/utils/hooks/useValue'
...@@ -1928,7 +1962,54 @@ const currentRow = ref<AddressInfo>({ ...@@ -1928,7 +1962,54 @@ const currentRow = ref<AddressInfo>({
receiverAddress2: '', receiverAddress2: '',
receiverPostCode: '', receiverPostCode: '',
}) })
const exportLoading = ref(false)
const exportVisible = ref(false)
const exportForm = ref({
resource: '',
})
const exportData = () => {
exportVisible.value = true
}
const submitExportForm = async () => {
if (exportForm.value.resource === '') {
return ElMessage.error('请选择导出类型')
}
exportLoading.value = true
const resourceType = Number(exportForm.value.resource)
const params: ExportParams = {
exportAll: false,
idList: [],
}
// 使用函数封装映射逻辑
const mapIds = (items: PodUsOrderListData[]) =>
items.map((el) => Number(el.id))
switch (resourceType) {
case 0:
params.idList = mapIds(tableData.value as PodUsOrderListData[])
break
case 1:
params.idList = mapIds(selection.value)
break
case 2:
params.exportAll = true
params.idList = undefined
break
default:
console.error('未知的资源类型:', resourceType)
}
try {
const res = await exportPodUSInfo({
...params,
...(resourceType === 2 ? searchForm.value : {}),
})
window.open(filePath + res.message, '_blank')
exportVisible.value = false
exportLoading.value = false
} catch (e) {
exportVisible.value = false
exportLoading.value = false
}
}
const updateAddVisible = ref(false) const updateAddVisible = ref(false)
const initPageSize = ref(50) const initPageSize = ref(50)
const logisticsVisible = ref(false) const logisticsVisible = ref(false)
......
...@@ -4,6 +4,8 @@ import { ...@@ -4,6 +4,8 @@ import {
warehouseInfo, warehouseInfo,
warehouseInfoGetAll, warehouseInfoGetAll,
updateLocationApi, updateLocationApi,
updateProductNoApi,
updateCustomSkuApi,
LocationInfoGetAll, LocationInfoGetAll,
getWarehouseInventoryInfo, getWarehouseInventoryInfo,
factoryLogWarehouseLog, factoryLogWarehouseLog,
...@@ -11,7 +13,7 @@ import { ...@@ -11,7 +13,7 @@ import {
WarehouseWarning, WarehouseWarning,
factoryWarehouseInventoryPrint, factoryWarehouseInventoryPrint,
exportWarehouseInfo, exportWarehouseInfo,
loactionData loactionData,
} from '@/api/warehouse.ts' } from '@/api/warehouse.ts'
import { AnyObject } from '@/types/api/warehouse' import { AnyObject } from '@/types/api/warehouse'
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
...@@ -50,6 +52,10 @@ const isSameWarehouse = computed(() => { ...@@ -50,6 +52,10 @@ const isSameWarehouse = computed(() => {
) )
}) })
const modifyLocationDialog = ref(false) const modifyLocationDialog = ref(false)
const modifyProductNoDialog = ref(false)
const modifyCustomSkuDialog = ref(false)
/** 修改库位 */
const locationForm = ref({ const locationForm = ref({
warehouseId: '', warehouseId: '',
}) })
...@@ -76,6 +82,83 @@ const modifyStorageLocation = async () => { ...@@ -76,6 +82,83 @@ const modifyStorageLocation = async () => {
const { data } = await LocationInfoGetAll(selections.value[0]?.warehouseId) const { data } = await LocationInfoGetAll(selections.value[0]?.warehouseId)
LocationList.value = data LocationList.value = data
} }
/** 修改款号 */
const productNoForm = ref({
productNo: '',
})
const productNoRules = {
productNo: [{ required: true, message: '款号不能为空', trigger: 'change' }],
}
const productNoFormRef = ref()
const modifyProductNo = async () => {
productNoForm.value.productNo = ''
productNoFormRef.value?.resetFields()
modifyProductNoDialog.value = true
}
const submitProductNoForm = async () => {
productNoFormRef.value?.validate(async (valid: boolean) => {
if (!valid) return
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
const idList = selections.value.map((el: WarehouseWarning) => Number(el.id))
await updateProductNoApi({
idList: idList,
productNo: productNoForm.value.productNo,
})
.then(() => {
modifyProductNoDialog.value = false
ElMessage.success('修改成功')
getData()
})
.finally(() => {
loading.close()
})
})
}
/** 修改自定义SKU */
const customSkuForm = ref({
customSku: '',
})
const customSkuRules = {
customSku: [
{ required: true, message: '自定义SKU不能为空', trigger: 'change' },
],
}
const customSkuFormRef = ref()
const modifyCustomSku = async () => {
customSkuForm.value.customSku = selections.value[0].customSku || ''
customSkuFormRef.value?.resetFields()
modifyCustomSkuDialog.value = true
}
const submitCustomSkuForm = async () => {
customSkuFormRef.value?.validate(async (valid: boolean) => {
if (!valid) return
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
const idList = selections.value.map((el: WarehouseWarning) => Number(el.id))
updateCustomSkuApi({
idList: idList,
customSku: customSkuForm.value.customSku,
})
.then(() => {
modifyCustomSkuDialog.value = false
ElMessage.success('修改成功')
getData()
})
.finally(() => {
loading.close()
})
})
}
const showPrintDialog = ref(false) const showPrintDialog = ref(false)
const exportLoading = ref(false) const exportLoading = ref(false)
const clickItem = (row: WarehouseWarning) => { const clickItem = (row: WarehouseWarning) => {
...@@ -372,6 +455,22 @@ getWarehouse() ...@@ -372,6 +455,22 @@ getWarehouse()
>修改库位</el-button >修改库位</el-button
> >
</el-form-item> </el-form-item>
<el-form-item style="margin-top: 5px">
<el-button
type="warning"
:disabled="!selections.length"
@click="modifyProductNo"
>修改款号
</el-button>
</el-form-item>
<el-form-item style="margin-top: 5px">
<el-button
type="warning"
:disabled="selections.length !== 1"
@click="modifyCustomSku"
>修改自定义sku</el-button
>
</el-form-item>
</el-form> </el-form>
</el-card> </el-card>
</template> </template>
...@@ -401,7 +500,7 @@ getWarehouse() ...@@ -401,7 +500,7 @@ getWarehouse()
align="center" align="center"
prop="warehouseName" prop="warehouseName"
label="图片" label="图片"
width="100" width="80"
> >
<template #default="scope"> <template #default="scope">
<el-image <el-image
...@@ -416,31 +515,37 @@ getWarehouse() ...@@ -416,31 +515,37 @@ getWarehouse()
align="center" align="center"
prop="warehouseName" prop="warehouseName"
label="仓库名称" label="仓库名称"
width="180" width="140"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="locationCode" prop="locationCode"
label="库位" label="库位"
width="160" width="100"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="warehouseSku" prop="warehouseSku"
label="库存SKU" label="库存SKU"
width="180" min-width="180"
></el-table-column>
<el-table-column
align="center"
prop="customSku"
label="自定义SKU"
min-width="180"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="skuName" prop="skuName"
label="商品名称" label="商品名称"
width="250" min-width="230"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="productNo" prop="productNo"
label="款号" label="款号"
width="150" width="180"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
...@@ -451,32 +556,32 @@ getWarehouse() ...@@ -451,32 +556,32 @@ getWarehouse()
<el-table-column <el-table-column
align="center" align="center"
prop="price" prop="price"
label="商品成本价()" label="商品成本价($)"
width="160" width="140"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="usableInventory" prop="usableInventory"
label="可用数量" label="可用数量"
width="120" width="90"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="inventory" prop="inventory"
label="库存数量" label="库存数量"
width="120" width="90"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="occupyInventory" prop="occupyInventory"
label="占用数量" label="占用数量"
width="120" width="90"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="freezeInventory" prop="freezeInventory"
label="冻结数量" label="冻结数量"
width="120" width="90"
></el-table-column> ></el-table-column>
</el-table> </el-table>
</div> </div>
...@@ -520,6 +625,8 @@ getWarehouse() ...@@ -520,6 +625,8 @@ getWarehouse()
</div> </div>
</template> </template>
</split-div> </split-div>
<!-- 导出 -->
<ElDialog <ElDialog
v-model="exportVisible" v-model="exportVisible"
title="导出选项" title="导出选项"
...@@ -542,6 +649,8 @@ getWarehouse() ...@@ -542,6 +649,8 @@ getWarehouse()
</span> </span>
</template> </template>
</ElDialog> </ElDialog>
<!-- 修改库位 -->
<ElDialog <ElDialog
v-model="modifyLocationDialog" v-model="modifyLocationDialog"
title="修改库位" title="修改库位"
...@@ -572,6 +681,68 @@ getWarehouse() ...@@ -572,6 +681,68 @@ getWarehouse()
</span> </span>
</template> </template>
</ElDialog> </ElDialog>
<!-- 修改款号 -->
<ElDialog
v-model="modifyProductNoDialog"
title="修改款号"
width="500px"
:close-on-click-modal="false"
>
<el-form
ref="productNoFormRef"
:model="productNoForm"
:rules="productNoRules"
label-width="80px"
@submit.prevent
>
<el-form-item label="款号" prop="productNo">
<el-input
v-model="productNoForm.productNo"
style="width: 100%"
placeholder="请输入款号"
clearable
></el-input>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="modifyProductNoDialog = false">取消</el-button>
<el-button type="primary" @click="submitProductNoForm">确认</el-button>
</span>
</template>
</ElDialog>
<!-- 修改自定义sku -->
<ElDialog
v-model="modifyCustomSkuDialog"
title="修改自定义sku"
width="500px"
:close-on-click-modal="false"
>
<el-form
ref="customSkuFormRef"
:model="customSkuForm"
:rules="customSkuRules"
label-width="100px"
@submit.prevent
>
<el-form-item label="自定义sku" prop="customSku">
<el-input
v-model="customSkuForm.customSku"
style="width: 100%"
placeholder="请输入自定义sku"
clearable
></el-input>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="modifyCustomSkuDialog = false">取消</el-button>
<el-button type="primary" @click="submitCustomSkuForm">确认</el-button>
</span>
</template>
</ElDialog>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
......
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