Commit 4a7ddea5 by zhuzhequan

podus 修改

parent 9c654b70
......@@ -544,6 +544,24 @@ export function statusPushApi(params: (string | number)[]) {
)
}
// 转至已完成
export function changeToFinished(ids: string) {
return axios.get<never, BaseRespData<never>>(
`factory/podJomallOrderUs/updateToComplete`,
{ params:{ids} },
)
}
// 转至已完成
export function updateTrackingNumberAndRegister(id: number,trackingNumber:string) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderUs/updateTrackingNumberAndRegister`,
{id,trackingNumber },
)
}
// 完成发货
export function completeDeliveryApi(params: {
orderIdList: (string | number)[]
......
......@@ -181,11 +181,6 @@ const menu: MenuItem[] = [
label: '下载生产客户端',
},
{
index: '/system/external-authorisation',
id: 5,
label: '外部授权',
},
{
index: '/system/customers',
id: 6,
label: '客户管理',
......
......@@ -252,8 +252,8 @@
</ElFormItem>
<ElFormItem>
<span>
<ElButton link @click="resetSearchForm" style="font-size: 12px"
><span title="重置查询条件">重置</span></ElButton
<ElButton link style="font-size: 12px" @click="resetSearchForm"
><span title="重置查询条件">重置</span></ElButton
>
</span>
</ElFormItem>
......@@ -471,7 +471,7 @@
<ElFormItem v-if="status === 'WAIT_SHIPMENT'">
<span class="item">
<ElButton type="primary" @click="completeDelivery()"
>完成发货</ElButton
>完成发货</ElButton
>
</span>
</ElFormItem>
......@@ -491,7 +491,7 @@
selection.some((item) => item.shipmentType !== 1)
"
@click="getOrderByIdApi('createLogisticsOrder')"
>创建物流订单</ElDropdownItem
>创建物流订单</ElDropdownItem
>
<ElDropdownItem
:disabled="
......@@ -499,7 +499,7 @@
selection.some((item) => item.shipmentType !== 1)
"
@click="getOrderByIdApi('getTrackingNumber')"
>获取跟踪号</ElDropdownItem
>获取跟踪号</ElDropdownItem
>
<ElDropdownItem
:disabled="
......@@ -507,7 +507,7 @@
selection.some((item) => item.shipmentType !== 1)
"
@click="getOrderByIdApi('getPrintOrder')"
>获取打印面单</ElDropdownItem
>获取打印面单</ElDropdownItem
>
<ElDropdownItem
:disabled="
......@@ -515,7 +515,7 @@
selection.some((item) => item.shipmentType !== 1)
"
@click="getOrderByIdApi('cancelLogisticsOrder')"
>取消物流订单</ElDropdownItem
>取消物流订单</ElDropdownItem
>
<!-- <ElDropdownItem
:disabled="
......@@ -553,7 +553,7 @@
>
<span class="item">
<ElButton type="primary" @click="downloadMaterial"
>下载素材</ElButton
>下载素材</ElButton
>
</span>
</ElFormItem>
......@@ -624,7 +624,7 @@
selection.length === 0 && cardSelection.length === 0
"
@click="rejectOrder('TO_BE_CONFIRMED')"
>待确认</ElDropdownItem
>待确认</ElDropdownItem
>
<ElDropdownItem
v-if="
......@@ -636,7 +636,7 @@
selection.length === 0 && cardSelection.length === 0
"
@click="rejectOrder('CREATE_LOGISTICS')"
>待创建物流</ElDropdownItem
>待创建物流</ElDropdownItem
>
<ElDropdownItem
v-if="status === 'PICKING' || status === 'IN_PRODUCTION'"
......@@ -644,7 +644,7 @@
selection.length === 0 && cardSelection.length === 0
"
@click="rejectOrder('TO_BE_ARRANGE')"
>待排单</ElDropdownItem
>待排单</ElDropdownItem
>
<ElDropdownItem
v-if="status === 'IN_PRODUCTION'"
......@@ -652,7 +652,7 @@
selection.length === 0 && cardSelection.length === 0
"
@click="rejectOrder('PICKING')"
>待拣胚</ElDropdownItem
>待拣胚</ElDropdownItem
>
</ElDropdownMenu>
</template>
......@@ -666,6 +666,14 @@
<ElButton type="warning" @click="statusPush">状态推送</ElButton>
</span>
</ElFormItem>
<ElFormItem
v-if="['WAIT_TRACK'].includes(status)"
>
<span class="item">
<ElButton type="success" @click="setFinish">转至已完成</ElButton>
</span>
</ElFormItem>
<ElFormItem v-if="status === 'COMPLETE'">
<span class="item">
<ElButton type="success" @click="exportData">导出</ElButton>
......@@ -674,7 +682,7 @@
<ElFormItem v-if="status === 'BATCH_DOWNLOAD'">
<span class="item">
<ElButton type="danger" @click="handleBatchDelete('batch')"
>批量删除</ElButton
>批量删除</ElButton
>
</span>
</ElFormItem>
......@@ -697,7 +705,7 @@
blue: item.quantity && item.quantity > 0,
red: item.status === 'EXCEPTION_ORDER',
}"
>{{ item.quantity }}</span
>{{ item.quantity }}</span
>
</div>
<!-- <div
......@@ -769,7 +777,7 @@
<span
v-if="interceptionStatus.production['0']"
class="tabs-node_count blue"
>{{ interceptionStatus.production['0'] }}</span
>{{ interceptionStatus.production['0'] }}</span
>
</div>
<div
......@@ -781,7 +789,7 @@
<span
v-if="interceptionStatus.production['1']"
class="tabs-node_count blue"
>{{ interceptionStatus.production['1'] }}</span
>{{ interceptionStatus.production['1'] }}</span
>
</div>
<div
......@@ -793,7 +801,7 @@
<span
v-if="interceptionStatus.production['2']"
class="tabs-node_count red"
>{{ interceptionStatus.production['2'] }}</span
>{{ interceptionStatus.production['2'] }}</span
>
</div>
<div
......@@ -805,7 +813,7 @@
<span
v-if="interceptionStatus.shipment['0']"
class="tabs-node_count blue"
>{{ interceptionStatus.shipment['0'] }}</span
>{{ interceptionStatus.shipment['0'] }}</span
>
</div>
<div
......@@ -817,7 +825,7 @@
<span
v-if="interceptionStatus.shipment['1']"
class="tabs-node_count blue"
>{{ interceptionStatus.shipment['1'] }}</span
>{{ interceptionStatus.shipment['1'] }}</span
>
</div>
<div
......@@ -829,7 +837,7 @@
<span
v-if="interceptionStatus.shipment['2']"
class="tabs-node_count red"
>{{ interceptionStatus.shipment['2'] }}</span
>{{ interceptionStatus.shipment['2'] }}</span
>
</div>
</div>
......@@ -870,7 +878,9 @@
"
placement="bottom"
>
<el-icon color="#E6A23C"><InfoFilled /></el-icon>
<el-icon color="#E6A23C">
<InfoFilled />
</el-icon>
</el-tooltip>
<span class="serial-number">{{ index + 1 }}</span>
</div>
......@@ -1005,7 +1015,7 @@
</div>
<div class="goods-item-info-item">
<span class="goods-item-info-item-label"
>第三方生产单号:</span
>第三方生产单号:</span
>
<span
class="goods-item-info-item-value"
......@@ -1047,14 +1057,14 @@
>
<!-- <span class="goods-item-info-item-label">补胚状态:</span> -->
<el-tag size="small" effect="dark" type="danger"
>补胚中
>补胚中
</el-tag>
</div>
</div>
<div class="goods-item-info">
<div class="goods-item-info-item">
<span class="goods-item-info-item-label"
>商品单价($):</span
>商品单价($):</span
>
<span class="goods-item-info-item-value">
{{ item.productPrice }}
......@@ -1081,14 +1091,14 @@
<div class="goods-item-info-item">
<span class="goods-item-info-item-label">{{
status === 'EXCEPTION_ORDER' ||
status === 'PICKING' ||
status === 'TO_BE_CONFIRMED' ||
status === 'STOCK_OUT' ||
status === 'CREATE_LOGISTICS'
? '数量:'
: '已生产数量:'
}}</span>
status === 'EXCEPTION_ORDER' ||
status === 'PICKING' ||
status === 'TO_BE_CONFIRMED' ||
status === 'STOCK_OUT' ||
status === 'CREATE_LOGISTICS'
? '数量:'
: '已生产数量:'
}}</span>
<span class="goods-item-info-item-value">
{{
status === 'EXCEPTION_ORDER' ||
......@@ -1156,7 +1166,7 @@
type="success"
style="height: 23px"
@click="applyForReplenishment(item)"
>申请补胚
>申请补胚
</el-button>
</div>
......@@ -1172,7 +1182,7 @@
type="primary"
style="height: 23px; padding: 0"
@click="downloadMaterialItem(item)"
>下载素材
>下载素材
</el-button>
<el-button
link
......@@ -1180,7 +1190,7 @@
type="warning"
style="height: 23px; margin: 0"
@click="downloadTifItem('tiff', item.id)"
>TIF排版
>TIF排版
</el-button>
<el-button
link
......@@ -1188,7 +1198,7 @@
type="warning"
style="height: 23px; margin: 0"
@click="downloadTifItem('png', item.id)"
>PNG排版
>PNG排版
</el-button>
</div>
</div>
......@@ -1371,17 +1381,17 @@
<el-timeline-item
:color="row.createTime ? '#409EFF' : ''"
:timestamp="row.createTime"
>创建时间
>创建时间
</el-timeline-item>
<el-timeline-item
:color="row.startStockingTime ? '#E6A23C' : ''"
:timestamp="row.startStockingTime"
>确认时间
>确认时间
</el-timeline-item>
<el-timeline-item
:color="row.finishTime ? '#67C23A' : ''"
:timestamp="row.finishTime"
>完成时间
>完成时间
</el-timeline-item>
</el-timeline>
<!-- <div class="order-time-box">
......@@ -1446,9 +1456,9 @@
</div>
</template>
<template #failReason="{ row }">
<span v-html="row.failReason" style="white-space: pre-line"></span>
<span style="white-space: pre-line" v-html="row.failReason"></span>
</template>
<template #operate="{ row }">
<template #operate="{ row }">
<div
v-if="status === 'BATCH_DOWNLOAD'"
class="operate-box-vertical"
......@@ -1522,6 +1532,9 @@
</ElButton>
</span>
<span v-if="['WAIT_TRACK'].includes(status)" class="operate-item">
<ElButton link type="warning" @click="updateTrackingNumber">修改跟踪号</ElButton>
</span>
<!-- <span
v-if="!row.expressSheet && row.status === 'TO_BE_CONFIRMED'"
class="operate-item"
......@@ -1587,7 +1600,7 @@
class="operate-item"
>
<ElButton link type="primary" @click="logTrajectory(row)"
>物流轨迹</ElButton
>物流轨迹</ElButton
>
</span>
</div>
......@@ -1630,7 +1643,9 @@
"
placement="bottom"
>
<el-icon color="#E6A23C"><InfoFilled /></el-icon>
<el-icon color="#E6A23C">
<InfoFilled />
</el-icon>
</el-tooltip>
</template>
<template
......@@ -1668,8 +1683,8 @@
</div>
<Icon
name="caozuorizhi"
@click="(e: MouseEvent) => operationLog(cardItem.podJomallOrderUsId, e)"
style="width: 28px; height: 28px"
@click="(e: MouseEvent) => operationLog(cardItem.podJomallOrderUsId, e)"
>
<template #title>
<title>操作日志</title>
......@@ -1713,7 +1728,7 @@
:title="`商品名称:${cardItem?.productName || ''}`"
>
<span class="grid-item-value"
>{{ cardItem?.productName }}
>{{ cardItem?.productName }}
</span>
</div>
<div
......@@ -1840,7 +1855,7 @@
</div>
<div v-if="cardItem.isReplenishment" class="grid-item">
<el-tag size="small" type="danger" effect="dark"
>补胚中
>补胚中
</el-tag>
</div>
</div>
......@@ -1853,10 +1868,10 @@
<div class="pagination">
<div class="total">
<span
>已选择
>已选择
<span style="color: red">{{
selection.length || cardSelection.length
}}</span>
selection.length || cardSelection.length
}}</span>
条数据</span
>
</div>
......@@ -1873,15 +1888,15 @@
></ElPagination>
<div class="pageSize">
<span
>自定义条数
>自定义条数
<span
><el-input
v-model="pageSize"
type="number"
style="width: 100px"
clearable
@blur="inputBlur"
></el-input
><el-input
v-model="pageSize"
type="number"
style="width: 100px"
clearable
@blur="inputBlur"
></el-input
></span>
/</span
>
......@@ -1993,7 +2008,8 @@
link
style="margin-left: 10px"
@click="changeChinaTime('Asia/Shanghai')"
>北京时间</el-button
>北京时间
</el-button
>
<el-button
:type="timeType === 'America/New_York' ? 'primary' : ''"
......@@ -2001,7 +2017,8 @@
link
style="margin-left: 10px"
@click="changeChinaTime('America/New_York')"
>新泽西时间</el-button
>新泽西时间
</el-button
>
<el-button
:type="timeType === 'America/Los_Angeles' ? 'primary' : ''"
......@@ -2009,7 +2026,8 @@
link
style="margin-left: 10px"
@click="changeChinaTime('America/Los_Angeles')"
>洛杉矶时间</el-button
>洛杉矶时间
</el-button
>
</div>
</div>
......@@ -2029,7 +2047,7 @@
:print-order="printOrder"
:warehouse-list="warehouseList"
@set-printer="handlePrinterChange"
@set-warehouseId="handleWarehouseIdChange"
@set-warehouse-id="handleWarehouseIdChange"
@refresh="onFastRefresh"
/>
<InspPackagOrder
......@@ -2286,7 +2304,7 @@
:loading="exportLoading"
type="primary"
@click="submitExportForm"
>确认</el-button
>确认</el-button
>
</span>
</template>
......@@ -2294,7 +2312,7 @@
<el-dialog v-model="dialogVisible" width="35%">
<img :src="dialogImageUrl" alt="商品预览图片" />
</el-dialog>
<el-dialog title="物流轨迹" v-model="timeLineVisible" width="1000px">
<el-dialog v-model="timeLineVisible" title="物流轨迹" width="1000px">
<el-timeline>
<el-timeline-item
v-for="(item, index) in timeLine"
......@@ -2379,7 +2397,7 @@ import {
get17TrackInfoApi,
getAccountCodeByFactoryIdApi,
printPickPdfByBatchNumberApi,
printProductionPdfByBatchNumberApi,
printProductionPdfByBatchNumberApi, changeToFinished, updateTrackingNumberAndRegister,
} from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api'
......@@ -2423,16 +2441,18 @@ import { isArray, isString } from '@/utils/validate'
import platformJson from '../../../json/platform.json'
import { getToken } from '@/api/axios'
import usePermissionBtnStore from '@/store/permission'
const permissionBtns = usePermissionBtnStore()
import {
useRouter,
type NavigationGuardNext,
type RouteLocationNormalized,
} from 'vue-router'
declare global {
interface Window {
ActiveXObject: {
new (type: string): XMLHttpRequest
new(type: string): XMLHttpRequest
}
VBS_BinaryToArray: {
(data: unknown): { toArray(): number[] }
......@@ -2463,6 +2483,37 @@ const exportForm = ref({
resource: '',
})
//updateTrackingNumber
const updateTrackingNumber = async () => {
if (selection.value.length !== 1) {
return ElMessage.warning('请选择一条数据')
}
const { value } = await ElMessageBox.prompt('请输入物流跟踪号', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /.+/,
inputErrorMessage: '请输入物流跟踪号',
inputPlaceholder: '物流跟踪号',
})
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await updateTrackingNumberAndRegister(selection.value[0].id, value)
if (res.code !== 200) return
ElMessage.success('操作成功')
search()
await loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const exportData = () => {
exportVisible.value = true
}
......@@ -2800,8 +2851,9 @@ const handleReComposingDesign = async (row: PodUsOrderListData) => {
}
}
const tableColumns = computed(() => {
let arr = []
if (status.value === 'BATCH_DOWNLOAD') {
return [
arr = [
{
label: '批次号',
prop: 'batchArrangeNum',
......@@ -2870,8 +2922,9 @@ const tableColumns = computed(() => {
prop: 'operate',
},
]
return arr
}
return [
arr = [
{
label: '序号',
prop: 'serialNumber',
......@@ -2917,16 +2970,28 @@ const tableColumns = computed(() => {
prop: 'exceptionReason',
slot: 'exceptionReason',
align: 'left',
},{
label: '物流跟踪状态',
width: 220,
prop: 'track17_Status',
align: 'left',
},
{
label: '操作',
slot: 'operate',
width: 80,
width: 120,
align: 'center',
fixed: 'right',
prop: 'operate',
},
]
if(!['WAIT_TRACK','IN_TRANSIT'].includes(status.value)){
const index = arr.findIndex(item => item.prop === 'track17_Status')
if(index>=0){
arr.splice(index,1)
}
}
return arr
})
const rightMenuRef = ref()
const rightClick = (e: MouseEvent) => {
......@@ -3035,16 +3100,16 @@ const loadTabData = async () => {
// 发货拦截数量
const shipmentCount = (statusRes.data as InterceptStateGroupData)?.shipment
? Object.values(
(statusRes.data as InterceptStateGroupData).shipment,
).reduce((sum: number, value: unknown) => sum + (Number(value) || 0), 0)
(statusRes.data as InterceptStateGroupData).shipment,
).reduce((sum: number, value: unknown) => sum + (Number(value) || 0), 0)
: 0
// 生产拦截数量
const productionCount = (statusRes.data as InterceptStateGroupData)
?.production
? Object.values(
(statusRes.data as InterceptStateGroupData).production,
).reduce((sum: number, value: unknown) => sum + (Number(value) || 0), 0)
(statusRes.data as InterceptStateGroupData).production,
).reduce((sum: number, value: unknown) => sum + (Number(value) || 0), 0)
: 0
tabsNav.value.splice(completeIndex + 1, 0, {
......@@ -3370,8 +3435,8 @@ const downloadTif = async (type: string) => {
a.href = window.URL.createObjectURL(blob)
a.target = '_blank'
a.download = (res.message as string).split('/')[
(res.message as string).split('/').length - 1
]
(res.message as string).split('/').length - 1
]
a.click()
pngDownloadLoading.value = false
})
......@@ -3418,8 +3483,8 @@ const downloadTifItem = async (type: string, id: number) => {
a.href = window.URL.createObjectURL(blob)
a.target = '_blank'
a.download = (res.message as string).split('/')[
(res.message as string).split('/').length - 1
]
(res.message as string).split('/').length - 1
]
a.click()
pngDownloadLoading.value = false
})
......@@ -3924,11 +3989,13 @@ const arrangeFinish = async () => {
loading.close()
}
}
interface timeLineType {
time_iso?: string
time_utc?: string
description?: string
}
const timeLineVisible = ref(false)
const timeLine = ref<timeLineType[]>([])
const logTrajectory = async (row: { id: string }) => {
......@@ -4087,8 +4154,8 @@ const rejectOrder = async (type: string) => {
orderStatus: type,
productList: selection.value.length
? selection.value.flatMap(
(item: PodUsOrderListData) => item.productList || [],
)
(item: PodUsOrderListData) => item.productList || [],
)
: cardSelection.value,
reasonStr: value,
})
......@@ -4946,8 +5013,8 @@ const interceptChange = async (status: boolean) => {
? 1
: 3
: interceptCurrent.value === 1
? 2
: 4
? 2
: 4
try {
const res = await interceptUpdateApi({
orderIds: selection.value.map((item) => item.id),
......@@ -4998,6 +5065,34 @@ const statusPush = async () => {
}
}
// 转至已完成
const setFinish = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
await ElMessageBox.confirm('是否转至已完成?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await changeToFinished(selection.value.map((item) => item.id).join(','))
if (res.code !== 200) return
ElMessage.success('操作成功')
search()
await loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
// 完成发货
const completeDelivery = async () => {
if (selection.value.length === 0) {
......@@ -5052,6 +5147,7 @@ const completeDelivery = async () => {
const tempChinaLogs = ref<LogListData[]>([])
const timeType = ref<string>('Asia/Shanghai')
function changeChinaTime(zone: string) {
timeType.value = zone
logList.value = tempChinaLogs.value.map((el) => {
......@@ -5064,11 +5160,13 @@ function changeChinaTime(zone: string) {
}
const token = getToken() as string
async function getPermission() {
const res = await getAccountCodeByFactoryIdApi({ token })
permissionBtns.setBtn(res.data)
console.log(res)
}
getPermission()
const globalProperties =
getCurrentInstance()?.appContext.config.globalProperties // 获取全局挂载
......@@ -5134,6 +5232,7 @@ useRouter().beforeEach((to, from, next) => {
// width: 100px;
// height: 65px;
position: relative;
img {
width: 65%;
}
......@@ -5240,6 +5339,7 @@ useRouter().beforeEach((to, from, next) => {
display: flex;
overflow: hidden;
width: 100%;
.grid-item-value {
display: flex;
flex: 1;
......@@ -5367,6 +5467,7 @@ useRouter().beforeEach((to, from, next) => {
font-size: 15px;
}
}
.orderNumber {
white-space: nowrap;
overflow: hidden;
......@@ -5374,6 +5475,7 @@ useRouter().beforeEach((to, from, next) => {
flex: 1;
min-width: 0; /* 关键属性 */
}
.customizedQuantity {
height: 28px;
width: 28px;
......@@ -5387,6 +5489,7 @@ useRouter().beforeEach((to, from, next) => {
font-weight: 700;
box-sizing: border-box;
}
.triangle-box {
position: absolute;
top: 0;
......@@ -5413,6 +5516,7 @@ useRouter().beforeEach((to, from, next) => {
flex-wrap: wrap;
}
}
.el-dropdown-link {
cursor: pointer;
color: var(--el-color-success);
......@@ -5420,15 +5524,18 @@ useRouter().beforeEach((to, from, next) => {
align-items: center;
outline: none;
}
.el-timeline-item__wrapper {
padding-left: 15px;
top: -4px;
}
.el-timeline
> .el-timeline-item:first-child
.el-timeline-item__timestamp.is-top {
> .el-timeline-item:first-child
.el-timeline-item__timestamp.is-top {
color: #409eff;
}
.flex-between {
display: flex;
justify-content: space-between;
......
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