Commit fed10f37 by zhuzhequan

确认

parent 68964eb2
...@@ -10,7 +10,13 @@ import { ...@@ -10,7 +10,13 @@ import {
} 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 interface LogisticsData {
logisticsWayName: string; // 物流名称
warehouseName: string; // 发货仓库
status: boolean;
logisticsWayCode: string; // 物流编码
partition: string; // 所在分区
}
export function getOrderTabData() { export function getOrderTabData() {
return axios.get<never, BaseRespData<Tab[]>>( return axios.get<never, BaseRespData<Tab[]>>(
'/factory/podJomallOrderUs/findStateGroupList', '/factory/podJomallOrderUs/findStateGroupList',
...@@ -44,11 +50,13 @@ export function getCardOrderList( ...@@ -44,11 +50,13 @@ export function getCardOrderList(
}, },
) )
} }
export function confirmOrderApi(data: number[], productionClient: string) { export function confirmOrderApi(data: number[], productionClient: string,type:string,logisticsTrialCalculation?:LogisticsData) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/confirmOrders', 'factory/podJomallOrderUs/confirmOrders',
{ {
ids: data.join(','), ids: data.join(','),
type,
logisticsTrialCalculation,
productionClient, productionClient,
}, },
) )
...@@ -226,6 +234,13 @@ export function updateRemarkApi(id: number, content: string) { ...@@ -226,6 +234,13 @@ export function updateRemarkApi(id: number, content: string) {
{ id, content }, { id, content },
) )
} }
export function getLogisticsCalculation(id: number) {
return axios.get<never, BaseRespData<never>>(
'factory/podJomallOrderUs/getLogisticsCalculation',
{ params:{id} },
)
}
export function loadWarehouseListApi() { export function loadWarehouseListApi() {
return axios.get<never, BaseRespData<WarehouseListData[]>>( return axios.get<never, BaseRespData<WarehouseListData[]>>(
'factoryWarehouseInfo/getAll', 'factoryWarehouseInfo/getAll',
......
...@@ -224,8 +224,10 @@ ...@@ -224,8 +224,10 @@
{{ item.baseSku }} {{ item.baseSku }}
</span> </span>
<el-icon class="icon" @click="copy(item.baseSku || '')" <el-icon class="icon" @click="copy(item.baseSku || '')"
><DocumentCopy >
/></el-icon> <DocumentCopy
/>
</el-icon>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">变体SKU:</span> <span class="goods-item-info-item-label">变体SKU:</span>
...@@ -233,8 +235,10 @@ ...@@ -233,8 +235,10 @@
{{ item.variantSku }} {{ item.variantSku }}
</span> </span>
<el-icon class="icon" @click="copy(item.variantSku || '')" <el-icon class="icon" @click="copy(item.variantSku || '')"
><DocumentCopy >
/></el-icon> <DocumentCopy
/>
</el-icon>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">工艺:</span> <span class="goods-item-info-item-label">工艺:</span>
...@@ -255,8 +259,10 @@ ...@@ -255,8 +259,10 @@
class="icon" class="icon"
style="color: #e6a23c" style="color: #e6a23c"
@click="handleUpdateRemark(item)" @click="handleUpdateRemark(item)"
><EditPen >
/></el-icon> <EditPen
/>
</el-icon>
</div> </div>
</div> </div>
<div class="goods-item-info"> <div class="goods-item-info">
...@@ -271,12 +277,14 @@ ...@@ -271,12 +277,14 @@
<el-icon <el-icon
class="icon" class="icon"
@click="copy(item.factorySubOrderNumber || '')" @click="copy(item.factorySubOrderNumber || '')"
><DocumentCopy >
/></el-icon> <DocumentCopy
/>
</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"
...@@ -287,8 +295,10 @@ ...@@ -287,8 +295,10 @@
<el-icon <el-icon
class="icon" class="icon"
@click="copy(item.thirdSubOrderNumber || '')" @click="copy(item.thirdSubOrderNumber || '')"
><DocumentCopy >
/></el-icon> <DocumentCopy
/>
</el-icon>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">工厂:</span> <span class="goods-item-info-item-label">工厂:</span>
...@@ -331,19 +341,19 @@ ...@@ -331,19 +341,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>
...@@ -365,8 +375,10 @@ ...@@ -365,8 +375,10 @@
<el-icon <el-icon
class="icon" class="icon"
@click="copy(row.factoryOrderNumber || '')" @click="copy(row.factoryOrderNumber || '')"
><DocumentCopy >
/></el-icon> <DocumentCopy
/>
</el-icon>
</div> </div>
<div class="order-detail-item"> <div class="order-detail-item">
<span class="order-detail-item-label">第三方订单号:</span> <span class="order-detail-item-label">第三方订单号:</span>
...@@ -377,8 +389,10 @@ ...@@ -377,8 +389,10 @@
{{ row.thirdOrderNumber }} {{ row.thirdOrderNumber }}
</span> </span>
<el-icon class="icon" @click="copy(row.thirdOrderNumber || '')" <el-icon class="icon" @click="copy(row.thirdOrderNumber || '')"
><DocumentCopy >
/></el-icon> <DocumentCopy
/>
</el-icon>
</div> </div>
<div class="order-detail-item"> <div class="order-detail-item">
<span class="order-detail-item-label">店铺单号:</span> <span class="order-detail-item-label">店铺单号:</span>
...@@ -386,8 +400,10 @@ ...@@ -386,8 +400,10 @@
{{ row.shopNumber }} {{ row.shopNumber }}
</span> </span>
<el-icon class="icon" @click="copy(row.shopNumber || '')" <el-icon class="icon" @click="copy(row.shopNumber || '')"
><DocumentCopy >
/></el-icon> <DocumentCopy
/>
</el-icon>
</div> </div>
<div class="order-detail-item"> <div class="order-detail-item">
<span class="order-detail-item-label">收货人:</span> <span class="order-detail-item-label">收货人:</span>
...@@ -483,6 +499,13 @@ ...@@ -483,6 +499,13 @@
<ElButton <ElButton
link link
type="primary" type="primary"
@click="confirm(row)"
>
确认
</ElButton>
<ElButton
link
type="primary"
@click="operationLog(row.id, null)" @click="operationLog(row.id, null)"
> >
操作日志 操作日志
...@@ -562,7 +585,7 @@ ...@@ -562,7 +585,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="未生产数量">
...@@ -630,7 +653,46 @@ ...@@ -630,7 +653,46 @@
</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="确认">
<div class="production-client" style="margin-bottom:10px;display: flex;align-items: center;gap: 8px">
<label style="white-space: nowrap;" for="">生产端:</label>
<ElSelect
v-model="productionClientValue"
clearable
placeholder="请选择生产端"
>
<ElOption
v-for="(item, index) in productionClient"
:key="index"
:value="item.code"
:label="`${item.remark}(${item.code})`"
></ElOption>
</ElSelect>
</div>
<el-table @selection-change="selectionChange" height="400px" :data="confirmData" border>
<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">
<template #default="{row}">
<b v-if="row.status" style="color: green">成功</b>
<b v-else-if="!row.status" style="color: red">失败</b>
</template>
</el-table-column>
<el-table-column label="预计运费($)" align="center" prop="payFreight">
<!-- <template #default="{row}">-->
<!-- {{row.payFreight || '0.00'}}-->
<!-- </template>-->
</el-table-column>
</el-table>
<template #footer>
<el-button @click="confirmDialogShow=false">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
</template>
</el-dialog>
<el-dialog <el-dialog
v-model="logVisible" v-model="logVisible"
title="操作日志" title="操作日志"
...@@ -660,7 +722,18 @@ ...@@ -660,7 +722,18 @@
width="600px" width="600px"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<div class="production-client"> <template #header>
<div class="dialog-header">
<span style="margin-right: 8px;font-size: 18px">确认</span>
<el-tooltip content="默认最低运费分派">
<el-icon color="red">
<WarningFilled />
</el-icon>
</el-tooltip>
</div>
</template>
<div 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
...@@ -684,6 +757,7 @@ ...@@ -684,6 +757,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getUserMarkList } from '@/api/common' import { getUserMarkList } from '@/api/common'
import { WarningFilled } from '@element-plus/icons-vue'
import { import {
getCardOrderList, getCardOrderList,
getOrderList, getOrderList,
...@@ -702,7 +776,7 @@ import { ...@@ -702,7 +776,7 @@ import {
printPrintOrderApi, printPrintOrderApi,
stockOutCheckApi, stockOutCheckApi,
toBeConfirmedApi, toBeConfirmedApi,
loadWarehouseListApi, loadWarehouseListApi, getLogisticsCalculation, LogisticsData,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import TableView from '@/components/TableView.vue' import TableView from '@/components/TableView.vue'
import { import {
...@@ -727,20 +801,26 @@ import PodMakeOrder from './PodMakeOrder.vue' ...@@ -727,20 +801,26 @@ import PodMakeOrder from './PodMakeOrder.vue'
import { OrderData } from '@/types/api/podMakeOrder' import { OrderData } from '@/types/api/podMakeOrder'
import useLodop, { LODOPObject } from '@/utils/hooks/useLodop' import useLodop, { LODOPObject } from '@/utils/hooks/useLodop'
import dayjs from 'dayjs' 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[] }
} }
} }
interface XMLHttpRequest { interface XMLHttpRequest {
responseBody?: unknown responseBody?: unknown
} }
} }
const tabsNav = ref<Tab[]>() const tabsNav = ref<Tab[]>()
const confirmDialogShow = ref(false)
const confirmData = ref([])
const confirmSelectionData = ref<LogisticsData[]>([])
const confirmRowData = ref<ProductList | null>(null)
const status = ref('TO_BE_CONFIRMED') const status = ref('TO_BE_CONFIRMED')
const detailData = ref({}) const detailData = ref({})
const [searchForm] = useValue<SearchForm>({ const [searchForm] = useValue<SearchForm>({
...@@ -970,6 +1050,36 @@ const { ...@@ -970,6 +1050,36 @@ const {
} }
}, },
}) })
const confirm = async (row: ProductList) => {
confirmDialogShow.value = true
productionClientValue.value = ''
confirmRowData.value = row
confirmData.value = []
confirmSelectionData.value = []
const { data } = await getLogisticsCalculation(row.id)
confirmData.value = data
}
const selectionChange = (data:LogisticsData[]) => {
confirmSelectionData.value = data
}
const handleConfirm = async () => {
if (!productionClientValue.value) {
return ElMessage.warning('请选择生产端')
}
if (confirmSelectionData.value.length!==1) {
return ElMessage.warning('请选择一条物流方式')
}
if(confirmSelectionData.value.some(el=>!el.status)){
return ElMessage.warning('请选择状态为成功的物流方式')
}
const id = confirmRowData.value?.id
const res = await confirmOrderApi([Number(id)], productionClientValue.value, 'customize',confirmSelectionData.value[0])
if (res.code !== 200) return
ElMessage.success('操作成功')
confirmDialogShow.value = false
search()
loadTabData()
}
const copy = (text: string) => { const copy = (text: string) => {
navigator.clipboard.writeText(text) navigator.clipboard.writeText(text)
ElMessage.success('复制成功') ElMessage.success('复制成功')
...@@ -1028,7 +1138,7 @@ const submit = async () => { ...@@ -1028,7 +1138,7 @@ 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) 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
...@@ -1568,6 +1678,7 @@ onMounted(() => { ...@@ -1568,6 +1678,7 @@ onMounted(() => {
margin-bottom: 10px; margin-bottom: 10px;
} }
} }
.tabs { .tabs {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -1593,6 +1704,7 @@ onMounted(() => { ...@@ -1593,6 +1704,7 @@ onMounted(() => {
font-weight: 600; font-weight: 600;
} }
} }
.goods-item { .goods-item {
display: grid; display: grid;
grid-template-columns: 100px 1fr minmax(180px, 1fr) 140px; grid-template-columns: 100px 1fr minmax(180px, 1fr) 140px;
...@@ -1601,16 +1713,19 @@ onMounted(() => { ...@@ -1601,16 +1713,19 @@ onMounted(() => {
.goods-item-img { .goods-item-img {
width: 100px; width: 100px;
height: 100px; height: 100px;
img { img {
width: 100%; width: 100%;
} }
} }
&:not(:last-child) { &:not(:last-child) {
padding-bottom: 10px; padding-bottom: 10px;
margin-bottom: 10px; margin-bottom: 10px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
} }
.goods-item-info-item { .goods-item-info-item {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -1623,6 +1738,7 @@ onMounted(() => { ...@@ -1623,6 +1738,7 @@ onMounted(() => {
white-space: nowrap; white-space: nowrap;
} }
} }
.order-detail-item { .order-detail-item {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -1635,6 +1751,7 @@ onMounted(() => { ...@@ -1635,6 +1751,7 @@ onMounted(() => {
white-space: nowrap; white-space: nowrap;
} }
} }
.card-list { .card-list {
display: grid; display: grid;
grid-template-columns: repeat(6, 1fr); grid-template-columns: repeat(6, 1fr);
...@@ -1643,6 +1760,7 @@ onMounted(() => { ...@@ -1643,6 +1760,7 @@ onMounted(() => {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
} }
.empty { .empty {
height: 100%; height: 100%;
display: flex; display: flex;
...@@ -1650,17 +1768,21 @@ onMounted(() => { ...@@ -1650,17 +1768,21 @@ onMounted(() => {
justify-content: center; justify-content: center;
color: #999; color: #999;
} }
.card-list-item { .card-list-item {
cursor: pointer; cursor: pointer;
} }
.images-position { .images-position {
display: flex; display: flex;
gap: 5px; gap: 5px;
.item-image { .item-image {
cursor: pointer; cursor: pointer;
border: 1px solid #eee; border: 1px solid #eee;
} }
} }
.grid-container { .grid-container {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
...@@ -1668,6 +1790,7 @@ onMounted(() => { ...@@ -1668,6 +1790,7 @@ onMounted(() => {
font-size: 12px; font-size: 12px;
margin-top: 10px; margin-top: 10px;
} }
.factory-sub-order-number { .factory-sub-order-number {
font-size: 12px; font-size: 12px;
} }
......
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