Commit be7a6939 by qinjianhui

fix: 问题修改

parent 778b059e
...@@ -246,3 +246,12 @@ export function loadWarehouseListApi() { ...@@ -246,3 +246,12 @@ export function loadWarehouseListApi() {
'factoryWarehouseInfo/getAll', 'factoryWarehouseInfo/getAll',
) )
} }
export function refreshMaterialApi(data: {
orderIds: string | undefined
productIds: string | undefined
}) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderProductUs/refreshDesignImages ',
data,
)
}
...@@ -179,9 +179,15 @@ ...@@ -179,9 +179,15 @@
转至待确认 转至待确认
</ElButton> </ElButton>
</span> </span>
<span class="item"> <span class="item">
<ElButton type="primary" @click="downloadMaterial">下载素材</ElButton> <ElButton type="primary" @click="downloadMaterial">下载素材</ElButton>
</span> </span>
<span class="item">
<ElButton type="success" @click="refreshMaterial">
刷新素材图
</ElButton>
</span>
</div> </div>
<div <div
v-if="status !== 'IN_PRODUCTION'" v-if="status !== 'IN_PRODUCTION'"
...@@ -197,7 +203,6 @@ ...@@ -197,7 +203,6 @@
:selectionable="true" :selectionable="true"
:paginated-data="tableData" :paginated-data="tableData"
:cell-style="onCellStyle" :cell-style="onCellStyle"
:row-style="getRowStyle"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<template #goods="{ row }"> <template #goods="{ row }">
...@@ -223,10 +228,8 @@ ...@@ -223,10 +228,8 @@
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.baseSku }} {{ item.baseSku }}
</span> </span>
<el-icon class="icon" @click="copy(item.baseSku || '')" <el-icon class="icon" @click="copy(item.baseSku || '')">
> <DocumentCopy />
<DocumentCopy
/>
</el-icon> </el-icon>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
...@@ -234,10 +237,11 @@ ...@@ -234,10 +237,11 @@
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.variantSku }} {{ item.variantSku }}
</span> </span>
<el-icon class="icon" @click="copy(item.variantSku || '')" <el-icon
class="icon"
@click="copy(item.variantSku || '')"
> >
<DocumentCopy <DocumentCopy />
/>
</el-icon> </el-icon>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
...@@ -260,8 +264,7 @@ ...@@ -260,8 +264,7 @@
style="color: #e6a23c" style="color: #e6a23c"
@click="handleUpdateRemark(item)" @click="handleUpdateRemark(item)"
> >
<EditPen <EditPen />
/>
</el-icon> </el-icon>
</div> </div>
</div> </div>
...@@ -278,13 +281,12 @@ ...@@ -278,13 +281,12 @@
class="icon" class="icon"
@click="copy(item.factorySubOrderNumber || '')" @click="copy(item.factorySubOrderNumber || '')"
> >
<DocumentCopy <DocumentCopy />
/>
</el-icon> </el-icon>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label" <span class="goods-item-info-item-label"
>第三方生产单号:</span >第三方生产单号:</span
> >
<span <span
class="goods-item-info-item-value" class="goods-item-info-item-value"
...@@ -296,8 +298,7 @@ ...@@ -296,8 +298,7 @@
class="icon" class="icon"
@click="copy(item.thirdSubOrderNumber || '')" @click="copy(item.thirdSubOrderNumber || '')"
> >
<DocumentCopy <DocumentCopy />
/>
</el-icon> </el-icon>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
...@@ -341,19 +342,19 @@ ...@@ -341,19 +342,19 @@
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">{{ <span class="goods-item-info-item-label">{{
status === 'TO_BE_CONFIRMED' status === 'TO_BE_CONFIRMED'
? '未生产数量:' ? '未生产数量:'
: status === 'EXCEPTION_ORDER' : status === 'EXCEPTION_ORDER'
? '数量:' ? '数量:'
: '已生产数量:' : '已生产数量:'
}}</span> }}</span>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ {{
status === 'TO_BE_CONFIRMED' status === 'TO_BE_CONFIRMED'
? item.notPassNum ? item.notPassNum
: status === 'EXCEPTION_ORDER' : status === 'EXCEPTION_ORDER'
? item.num ? item.num
: item.passNum : item.passNum
}} }}
</span> </span>
</div> </div>
...@@ -376,8 +377,7 @@ ...@@ -376,8 +377,7 @@
class="icon" class="icon"
@click="copy(row.factoryOrderNumber || '')" @click="copy(row.factoryOrderNumber || '')"
> >
<DocumentCopy <DocumentCopy />
/>
</el-icon> </el-icon>
</div> </div>
<div class="order-detail-item"> <div class="order-detail-item">
...@@ -388,10 +388,8 @@ ...@@ -388,10 +388,8 @@
> >
{{ row.thirdOrderNumber }} {{ row.thirdOrderNumber }}
</span> </span>
<el-icon class="icon" @click="copy(row.thirdOrderNumber || '')" <el-icon class="icon" @click="copy(row.thirdOrderNumber || '')">
> <DocumentCopy />
<DocumentCopy
/>
</el-icon> </el-icon>
</div> </div>
<div class="order-detail-item"> <div class="order-detail-item">
...@@ -399,27 +397,49 @@ ...@@ -399,27 +397,49 @@
<span class="order-detail-item-value" :title="row.shopNumber"> <span class="order-detail-item-value" :title="row.shopNumber">
{{ row.shopNumber }} {{ row.shopNumber }}
</span> </span>
<el-icon class="icon" @click="copy(row.shopNumber || '')" <el-icon class="icon" @click="copy(row.shopNumber || '')">
> <DocumentCopy />
<DocumentCopy
/>
</el-icon> </el-icon>
</div> </div>
<div v-if="row.status!=='TO_BE_CONFIRMED'" class="order-detail-item"> <div
v-if="row.status !== 'TO_BE_CONFIRMED'"
class="order-detail-item"
>
<span class="order-detail-item-label">生产端:</span> <span class="order-detail-item-label">生产端:</span>
<span class="order-detail-item-value" :title="row.productionClient"> <span
class="order-detail-item-value"
:title="row.productionClient"
>
{{ row.productionClient }} {{ row.productionClient }}
</span> </span>
</div> </div>
<div v-if="row.productionClient==='JOMALL' && row.status!=='TO_BE_CONFIRMED'" class="order-detail-item"> <div
v-if="
row.productionClient === 'JOMALL' &&
row.status !== 'TO_BE_CONFIRMED'
"
class="order-detail-item"
>
<span class="order-detail-item-label">发货仓库:</span> <span class="order-detail-item-label">发货仓库:</span>
<span class="order-detail-item-value" :title="row.warehouseName"> <span
class="order-detail-item-value"
:title="row.warehouseName"
>
{{ row.warehouseName }} {{ row.warehouseName }}
</span> </span>
</div> </div>
<div v-if="row.productionClient==='JOMALL' && row.status!=='TO_BE_CONFIRMED'" class="order-detail-item"> <div
v-if="
row.productionClient === 'JOMALL' &&
row.status !== 'TO_BE_CONFIRMED'
"
class="order-detail-item"
>
<span class="order-detail-item-label">物流方式:</span> <span class="order-detail-item-label">物流方式:</span>
<span class="order-detail-item-value" :title="row.logisticsWayName"> <span
class="order-detail-item-value"
:title="row.logisticsWayName"
>
{{ row.logisticsWayName }} {{ row.logisticsWayName }}
</span> </span>
</div> </div>
...@@ -466,7 +486,10 @@ ...@@ -466,7 +486,10 @@
{{ row.totalAmount }}() {{ row.totalAmount }}()
</span> </span>
</div> </div>
<div v-if="row.status!=='TO_BE_CONFIRMED'" class="order-price-item"> <div
v-if="row.status !== 'TO_BE_CONFIRMED'"
class="order-price-item"
>
<span class="order-price-item-label">物流运费:</span> <span class="order-price-item-label">物流运费:</span>
<span class="order-price-item-value"> <span class="order-price-item-value">
{{ row.payFreight }}($) {{ row.payFreight }}($)
...@@ -520,11 +543,7 @@ ...@@ -520,11 +543,7 @@
<template #operate="{ row }"> <template #operate="{ row }">
<div class="operate-box"> <div class="operate-box">
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton link type="primary" @click="confirm(row)">
link
type="primary"
@click="confirm(row)"
>
确认 确认
</ElButton> </ElButton>
<ElButton <ElButton
...@@ -609,7 +628,7 @@ ...@@ -609,7 +628,7 @@
<div class="grid-container"> <div class="grid-container">
<div class="grid-item" title="商品名称"> <div class="grid-item" title="商品名称">
<span class="grid-item-value" <span class="grid-item-value"
>{{ cardItem?.productName }} >{{ cardItem?.productName }}
</span> </span>
</div> </div>
<div class="grid-item" title="未生产数量"> <div class="grid-item" title="未生产数量">
...@@ -677,9 +696,16 @@ ...@@ -677,9 +696,16 @@
</div> </div>
</div> </div>
<right-menu ref="rightMenuRef" @change="rightChange" /> <right-menu ref="rightMenuRef" @change="rightChange" />
<el-dialog v-model="confirmDialogShow" :close-on-click-modal="false" title="确认"> <el-dialog
<div class="production-client" style="margin-bottom:10px;display: flex;align-items: center;gap: 8px"> v-model="confirmDialogShow"
<label style="white-space: nowrap;" for="">生产端:</label> :close-on-click-modal="false"
title="确认"
>
<div
class="production-client"
style="margin-bottom: 10px; display: flex; align-items: center; gap: 8px"
>
<label style="white-space: nowrap" for="">生产端:</label>
<ElSelect <ElSelect
v-model="productionClientValue" v-model="productionClientValue"
clearable clearable
...@@ -693,27 +719,58 @@ ...@@ -693,27 +719,58 @@
></ElOption> ></ElOption>
</ElSelect> </ElSelect>
</div> </div>
<el-table @selection-change="selectionChange" height="400px" :data="confirmData" border> <el-table
<el-table-column label="" width="60" align="center" type="selection"></el-table-column> @selection-change="selectionChange"
<el-table-column label="序号" width="60" align="center" type="index"></el-table-column> height="400px"
<el-table-column label="物流名称" align="center" prop="logisticsWayName"></el-table-column> :data="confirmData"
<el-table-column label="发货仓库" align="center" prop="warehouseName"></el-table-column> border
<el-table-column label="物流编码" align="center" prop="logisticsWayCode"></el-table-column> >
<el-table-column label="所在分区" align="center" prop="partition"></el-table-column> <el-table-column
label=""
width="60"
align="center"
type="selection"
></el-table-column>
<el-table-column
label="序号"
width="60"
align="center"
type="index"
></el-table-column>
<el-table-column
label="物流名称"
align="center"
prop="logisticsWayName"
></el-table-column>
<el-table-column
label="发货仓库"
align="center"
prop="warehouseName"
></el-table-column>
<el-table-column
label="物流编码"
align="center"
prop="logisticsWayCode"
></el-table-column>
<el-table-column
label="所在分区"
align="center"
prop="partition"
></el-table-column>
<el-table-column label="状态" align="center"> <el-table-column label="状态" align="center">
<template #default="{row}"> <template #default="{ row }">
<b v-if="row.status" style="color: green">成功</b> <b v-if="row.status" style="color: green">成功</b>
<b v-else-if="!row.status" style="color: red">失败</b> <b v-else-if="!row.status" style="color: red">失败</b>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="预计运费($)" align="center" prop="payFreight"> <el-table-column label="预计运费($)" align="center" prop="payFreight">
<!-- <template #default="{row}">--> <!-- <template #default="{row}">-->
<!-- {{row.payFreight || '0.00'}}--> <!-- {{row.payFreight || '0.00'}}-->
<!-- </template>--> <!-- </template>-->
</el-table-column> </el-table-column>
</el-table> </el-table>
<template #footer> <template #footer>
<el-button @click="confirmDialogShow=false">取消</el-button> <el-button @click="confirmDialogShow = false">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button>
</template> </template>
</el-dialog> </el-dialog>
...@@ -748,7 +805,7 @@ ...@@ -748,7 +805,7 @@
> >
<template #header> <template #header>
<div class="dialog-header"> <div class="dialog-header">
<span style="margin-right: 8px;font-size: 18px">确认</span> <span style="margin-right: 8px; font-size: 18px">确认</span>
<el-tooltip content="默认最低运费分派"> <el-tooltip content="默认最低运费分派">
<el-icon color="red"> <el-icon color="red">
<WarningFilled /> <WarningFilled />
...@@ -756,8 +813,11 @@ ...@@ -756,8 +813,11 @@
</el-tooltip> </el-tooltip>
</div> </div>
</template> </template>
<div class="production-client" style="display: flex;align-items: center;gap: 8px"> <div
<label style="white-space: nowrap;" for="">生产端:</label> class="production-client"
style="display: flex; align-items: center; gap: 8px"
>
<label style="white-space: nowrap" for="">生产端:</label>
<ElSelect <ElSelect
v-model="productionClientValue" v-model="productionClientValue"
clearable clearable
...@@ -800,7 +860,10 @@ import { ...@@ -800,7 +860,10 @@ import {
printPrintOrderApi, printPrintOrderApi,
stockOutCheckApi, stockOutCheckApi,
toBeConfirmedApi, toBeConfirmedApi,
loadWarehouseListApi, getLogisticsCalculation, LogisticsData, loadWarehouseListApi,
getLogisticsCalculation,
LogisticsData,
refreshMaterialApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import TableView from '@/components/TableView.vue' import TableView from '@/components/TableView.vue'
import { import {
...@@ -829,7 +892,7 @@ import dayjs from 'dayjs' ...@@ -829,7 +892,7 @@ import dayjs from 'dayjs'
declare global { declare global {
interface Window { interface Window {
ActiveXObject: { ActiveXObject: {
new(type: string): XMLHttpRequest new (type: string): XMLHttpRequest
} }
VBS_BinaryToArray: { VBS_BinaryToArray: {
(data: unknown): { toArray(): number[] } (data: unknown): { toArray(): number[] }
...@@ -1083,21 +1146,26 @@ const confirm = async (row: ProductList) => { ...@@ -1083,21 +1146,26 @@ const confirm = async (row: ProductList) => {
const { data } = await getLogisticsCalculation(row.id) const { data } = await getLogisticsCalculation(row.id)
confirmData.value = data confirmData.value = data
} }
const selectionChange = (data:LogisticsData[]) => { const selectionChange = (data: LogisticsData[]) => {
confirmSelectionData.value = data confirmSelectionData.value = data
} }
const handleConfirm = async () => { const handleConfirm = async () => {
if (!productionClientValue.value) { if (!productionClientValue.value) {
return ElMessage.warning('请选择生产端') return ElMessage.warning('请选择生产端')
} }
if (confirmSelectionData.value.length!==1) { if (confirmSelectionData.value.length !== 1) {
return ElMessage.warning('请选择一条物流方式') return ElMessage.warning('请选择一条物流方式')
} }
if(confirmSelectionData.value.some(el=>!el.status)){ if (confirmSelectionData.value.some((el) => !el.status)) {
return ElMessage.warning('请选择状态为成功的物流方式') return ElMessage.warning('请选择状态为成功的物流方式')
} }
const id = confirmRowData.value?.id const id = confirmRowData.value?.id
const res = await confirmOrderApi([Number(id)], productionClientValue.value, 'customize',confirmSelectionData.value[0]) const res = await confirmOrderApi(
[Number(id)],
productionClientValue.value,
'customize',
confirmSelectionData.value[0],
)
if (res.code !== 200) return if (res.code !== 200) return
ElMessage.success('操作成功') ElMessage.success('操作成功')
confirmDialogShow.value = false confirmDialogShow.value = false
...@@ -1162,7 +1230,11 @@ const submit = async () => { ...@@ -1162,7 +1230,11 @@ const submit = async () => {
const submitConfirm = async () => { const submitConfirm = async () => {
const ids = selection.value.map((item) => item.id) const ids = selection.value.map((item) => item.id)
try { try {
const res = await confirmOrderApi(ids, productionClientValue.value, 'minimumCost') const res = await confirmOrderApi(
ids,
productionClientValue.value,
'minimumCost',
)
if (res.code !== 200) return if (res.code !== 200) return
ElMessage.success('操作成功') ElMessage.success('操作成功')
productionClientVisible.value = false productionClientVisible.value = false
...@@ -1356,11 +1428,9 @@ const downloadMaterial = async () => { ...@@ -1356,11 +1428,9 @@ const downloadMaterial = async () => {
.map((item: ProductList) => item.id) .map((item: ProductList) => item.id)
.filter((id): id is number => id !== undefined) .filter((id): id is number => id !== undefined)
} else { } else {
selectedIds = selection.value selectedIds = (tableData.value as PodUsOrderListData[]).map(
.map((item: PodUsOrderListData) => item.productList) (item) => item.id,
.flat() )
.map((e) => e?.id)
.filter((id): id is number => id !== undefined)
} }
if (selectedIds.length === 0) { if (selectedIds.length === 0) {
return ElMessage({ return ElMessage({
...@@ -1666,16 +1736,16 @@ const onFastRefresh = () => { ...@@ -1666,16 +1736,16 @@ const onFastRefresh = () => {
loadTabData() loadTabData()
search() search()
} }
// 修改行样式方法 // // 修改行样式方法
const getRowStyle = ({ row }: { row: PodUsOrderListData }) => { // const getRowStyle = ({ row }: { row: PodUsOrderListData }) => {
if (stockOutSuccessIds.value.includes(row.id)) { // if (stockOutSuccessIds.value.includes(row.id)) {
return { // return {
backgroundColor: '#f0f9eb', // backgroundColor: '#f0f9eb',
color: '#67c23a', // color: '#67c23a',
} // }
} // }
return {} // return {}
} // }
// 添加表格ref // 添加表格ref
const tableRef = ref() const tableRef = ref()
const warehouseList = ref<WarehouseListData[]>([]) const warehouseList = ref<WarehouseListData[]>([])
...@@ -1688,6 +1758,38 @@ const loadWarehouseList = async () => { ...@@ -1688,6 +1758,38 @@ const loadWarehouseList = async () => {
console.error(e) console.error(e)
} }
} }
const refreshMaterial = async () => {
let selectedIds = []
const data: {
orderIds: string | undefined
productIds: string | undefined
} = {
orderIds: undefined,
productIds: undefined,
}
if (status.value == 'IN_PRODUCTION') {
selectedIds = cardSelection.value.map((item) => item.id)
data.orderIds = selectedIds.join(',')
data.productIds = undefined
} else {
selectedIds = (selection.value as PodUsOrderListData[]).map(
(item) => item.id,
)
data.productIds = selectedIds.join(',')
data.orderIds = undefined
}
if (selectedIds.length === 0) {
return ElMessage.warning('请选择数据')
}
try {
const res = await refreshMaterialApi(data)
if (res.code !== 200) return
ElMessage.success('刷新成功')
search()
} catch (e) {
console.error(e)
}
}
onMounted(() => { onMounted(() => {
loadTabData() loadTabData()
getUserMark() getUserMark()
......
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