Commit 3056680e by zhuzhequan

Merge branch 'master' of http://47.99.244.21:9999/qinjianhui/factory_front

# Conflicts:
#	src/views/order/pod/index.vue
parents 04886f0f 438a7e84
......@@ -73,7 +73,8 @@ export function getCardOrderList(
}
export function getOrderBySubOrderNumber(orderNumber: string) {
return axios.get<never, BaseRespData<OrderData>>(
'factory/podJomallOrder/getOrderBySubOrderNumber',
// 'factory/podJomallOrder/getOrderBySubOrderNumber',
'factory/podJomallOrder/getOrderProductBySubOrderNumber',
{
params: {
factorySubOrderNumber: orderNumber,
......@@ -81,7 +82,16 @@ export function getOrderBySubOrderNumber(orderNumber: string) {
},
)
}
export function applyForReplenishmentApi(productIds: string) {
return axios.get<never, BaseRespData<never>>(
'factory/podJomallOrderProduct/applyForReplenishment',
{
params: {
productIds,
},
},
)
}
// 发货保存
export function saveOrder(
sumbitSendOutList: ShipmentOrderRes[],
......
......@@ -170,13 +170,13 @@
(item.num || 0) - (item.shipmentNum || 0)
}}</span>
</div>
<div class="order-list-expand_item_info_title">
<div v-if="isPod" class="order-list-expand_item_info_title">
<span class="order-list-expand_item_label">工艺:</span>
<span class="order-list-expand_item_value">{{
!isPod ? item?.processName || '--' : item?.process || '--'
item?.processName || '--'
}}</span>
</div>
<div v-if="!isPod" class="order-list-expand_item_info_title">
<div v-if="isPod" class="order-list-expand_item_info_title">
<span class="order-list-expand_item_label">工艺简称:</span>
<span class="order-list-expand_item_value">{{
item?.process || '--'
......
......@@ -324,7 +324,7 @@ const props = defineProps({
type: String,
},
})
const emit = defineEmits(['update:detailVisible', 'close'])
const emit = defineEmits(['update:detailVisible', 'close','onSuccess'])
watch(
() => props.detailVisible,
......@@ -461,9 +461,8 @@ const changeStatus = async () => {
setData(TrackingNumber.value)
})
}
const setData = async (orderNumber: string) => {
if (detail.value && detail.value?.id) {
if (detail.value && detail.value?.id!=-1) {
try {
const id = detail.value?.id
await productionQueryApi(id)
......@@ -481,7 +480,7 @@ const setData = async (orderNumber: string) => {
localStorage.setItem('historyData', JSON.stringify(historyData.value))
}
}
emit('onSuccess')
playAudio('weight_success')
detail.value = { id: -1, podOrderId: -1, imgList: [] }
} catch (e) {
......
......@@ -73,6 +73,8 @@ export default function useShipment(callback?: () => void) {
isLock.value = false
await nextTick()
if (shipmentOrderRef.value) {
console.log("shipmentOrderRef.value",shipmentOrderRef.value);
const rowEl = shipmentOrderRef.value.listRef?.querySelector(
`div[data-id="${rowData.id}"]`,
)
......
......@@ -169,7 +169,6 @@
v-if="status === 'WAIT_SHIPMENT' || status === 'PART_SHIPPING'"
class="item"
>
<ElButton type="success" @click="confirmDelivery">发货</ElButton>
</span>
<!-- <span v-if="status === 'IN_PRODUCTION'" class="item">
......@@ -190,7 +189,6 @@
<CardWrapper
:card-item="cardItem"
:class="{ active: isSelectStatused(cardItem) }"
@contextmenu.prevent="(v)=>rightClick(v,cardItem)"
>
<!-- <template #top_right> 工厂类型 </template> -->
<template #bottom_left>
......@@ -405,12 +403,10 @@
class="order-list flex-1 overflow-hidden"
>
<TableView
ref="tableRef"
:paginated-data="tableData"
:columns="tableColumns"
:span-method="arraySpanMethod"
default-expand-all
@right-click="rightClick"
:span-method="arraySpanMethod"
@selection-change="handleSelectionChange"
>
<template #expand="{ row }">
......@@ -607,7 +603,6 @@
</template>
</TableView>
</div>
<right-menu :show_copy_shop_number="['IN_PRODUCTION','WAIT_SHIPMENT'].includes(status)" ref="rightMenuRef" @change="rightChange" />
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
......@@ -728,14 +723,6 @@
>
<LogList :log-list="logList" />
</el-dialog>
<el-dialog
v-model="countVisible"
title="数据统计"
width="400px"
:close-on-click-modal="false"
>
<p>基版 <b>{{cardItem?.baseSku}}</b> 的统计数量为:<b> {{count}}</b></p>
</el-dialog>
<fastProduction
v-model:detailVisible="detailVisible"
:title="fastTitle"
......@@ -748,8 +735,6 @@
</template>
<script setup lang="tsx">
// refreshJMProductInfo,reasonInvalidationApi,
import RightMenu from './rightMenu.vue'
import {
getOrderTabData,
getOrderList,
......@@ -763,6 +748,9 @@ import {
updateRemarkApi,
getCardOrderList,
getOrderDetail,
refreshJMProductInfo,
reasonInvalidationApi,
applyForReplenishmentApi,
getInProductionCount,
getWaitShipmentCount,
} from '@/api/podOrder'
......@@ -799,62 +787,13 @@ import { ElButton, type FormRules } from 'element-plus'
import { showConfirm } from '@/utils/ui'
import { filePath } from '@/api/axios'
import LogList from '@/components/LogList.vue'
const tableRef = ref();
const keyCode = ref('');
const cardItem = ref<PodProductList | CardOrderData>();
const rightMenuRef = ref()
const count = ref<number>(0)
const rightClick = (e:MouseEvent,item:PodProductList | CardOrderData) => {
cardItem.value = item
rightMenuRef.value.setPosition({
x: e.clientX,
y: e.clientY,
cardItem: e.clientY,
el: e
})
}
const rightChange =async (code:string) => {
const flag = ['IN_PRODUCTION','WAIT_SHIPMENT'].includes(status.value)
if (code === 'check_all') {
if(flag){
selection.value = JSON.parse(JSON.stringify(CardOrderList.value))
} else{
if( tableRef.value && tableRef.value?.tableRef){
tableRef.value?.tableRef.toggleAllSelection()
}
// selection.value = JSON.parse(JSON.stringify(tableData.value))
}
} else if (code === 'clear_check') {
selection.value = []
tableRef.value?.tableRef.toggleAllSelection()
} else if (code === 'copy_code') {
const str = selection.value.map(item=>item.factorySubOrderNumber || item.factoryOrderNumber).join()
navigator.clipboard.writeText(str)
ElMessage.success('复制成功')
} else if (code === 'copy_shopNumber') {
const str = selection.value.map(item=>item.shopNumber).join()
navigator.clipboard.writeText(str)
ElMessage.success('复制成功')
} else if (code === 'count') {
countVisible.value = true
let res
if(status.value==='WAIT_SHIPMENT'){
res = await getWaitShipmentCount(cardItem.value?.productionFileId,cardItem.value?.baseSku)
}else if(status.value==='IN_PRODUCTION'){
res = await getInProductionCount(cardItem.value?.productionFileId,cardItem.value?.baseSku)
}
count.value = (res?.data || 0) as number
}
}
// 日期工具函数
const
getDateRange = (days = 0, type: 'past' | 'future' = 'past') => {
const getDateRange = (days = 0, type: 'past' | 'future' = 'past') => {
const end = dayjs()
const start =
type === 'past' ? end.subtract(days, 'day') : end.add(days, 'day')
return [start.startOf('day').toDate(), end.endOf('day').toDate()]
}
}
const getMonthRange = (months = 0, type: 'past' | 'future' = 'past') => {
const now = dayjs()
......@@ -920,7 +859,6 @@ const pickerOptions = {
const timeRange = ref<string[]>([])
const tabsNav = ref<Tab[]>()
const status = ref('TO_BE_CONFIRMED')
const [tableWrapperRef, thOrderDetailWidth, updateColumnWidth] =
useElTableColumnWidth('table th.th-order-detail')
const loadTabData = async () => {
......@@ -1032,7 +970,6 @@ const handleChangeImages = (
const fastTitle = ref('')
const detailData = ref({})
const detailVisible = ref(false)
const countVisible = ref(false)
const fastType = ref<number>(-1)
const fastToProduction = (title: string, type: number) => {
detailData.value = {}
......@@ -1042,18 +979,6 @@ const fastToProduction = (title: string, type: number) => {
}
const cardClick = (data: PodProductList | CardOrderData) => {
const status = isSelectStatused(data)
if(keyCode.value==='Shift'){
if(selection.value.length){
const startIndex=CardOrderList.value.findIndex(el=>el.id===selection.value[0].id)
const endIndex = CardOrderList.value.findIndex(el=>el.id===data.id)
selection.value =[]
for(let k =startIndex;k<=endIndex;k++ ){
selection.value.push(JSON.parse(JSON.stringify(CardOrderList.value[k])))
}
}
}
if (status) {
selection.value = selection.value.filter(
(item: CardOrderData | PodProductList) => item.id !== data.id,
......@@ -1555,12 +1480,7 @@ const getSafeImages = (item: PodProductList | CardOrderData): cardImages[] => {
if (!item.images) return []
return item.images as cardImages[]
}
const listenerKeydown= (e:KeyboardEvent) => {
console.log(e)
keyCode.value = e?.key
}
onMounted(() => {
document.addEventListener('keydown', listenerKeydown)
getLogisticsList()
loadTabData()
})
......@@ -1572,25 +1492,21 @@ onMounted(() => {
margin-bottom: 10px;
}
}
.card-mode {
padding-top: 10px;
overflow: auto;
.card-list {
flex: 1;
display: grid;
grid-template-columns: repeat(6, 1fr);
grid-template-rows: max-content;
gap: 10px;
.card-list_item {
border: 1px solid #eee;
border-top-left-radius: 10px;
background-color: #eee;
overflow: hidden;
cursor: pointer;
.base_sku {
background: rgba(255, 255, 255, 0.699);
font-size: 12px;
......@@ -1603,24 +1519,20 @@ onMounted(() => {
padding: 3px 5px;
border-radius: 2px;
}
.flex-between {
display: flex;
justify-content: space-between;
align-items: center;
.images-position {
display: flex;
height: 30px;
gap: 10px;
padding: 10px 6px 0;
.item-image {
width: 30px;
height: 30px;
border: 1px solid #909399;
cursor: pointer;
img {
width: 100%;
height: 100%;
......@@ -1628,7 +1540,6 @@ onMounted(() => {
}
}
}
b {
margin-right: 5px;
font-size: 15px;
......@@ -1681,7 +1592,6 @@ onMounted(() => {
}
}
}
.order-list-expand {
border-right: 1px solid #eee;
font-size: 14px;
......@@ -1689,7 +1599,6 @@ onMounted(() => {
overflow: auto;
max-height: 600px;
}
.table-expand {
display: flex;
}
......@@ -1702,7 +1611,6 @@ onMounted(() => {
cursor: pointer;
}
}
.order-list {
margin-top: 10px;
flex: 1;
......@@ -1719,12 +1627,10 @@ onMounted(() => {
padding: 0;
}
}
.order-detail {
display: flex;
font-size: 14px;
}
.order-detail_item {
flex: 1;
display: flex;
......@@ -1743,12 +1649,10 @@ onMounted(() => {
white-space: nowrap;
}
}
.order-actual-payment {
width: 280px;
border-right: 1px solid #eee;
}
.order-memo {
width: 300px;
border-right: 1px solid #eee;
......@@ -1758,7 +1662,6 @@ onMounted(() => {
padding: 20px;
font-size: 14px;
}
.order-memo-item__content,
.order-memo-item__time {
white-space: nowrap;
......@@ -1780,12 +1683,10 @@ onMounted(() => {
.order-memo-item div:not(:last-child) {
margin-right: 6px;
}
.order-time {
width: 300px;
border-right: 1px solid #eee;
}
.order-operate {
width: 100px;
}
......@@ -1812,16 +1713,13 @@ onMounted(() => {
.dialog-footer {
text-align: center;
}
.order-detail_goods-info--content {
padding: 10px 0;
font-size: 14px;
:deep(.order-list-expand_item) {
padding: 10px 0;
}
}
.order-list-expand_item_info_title {
line-height: 26px;
display: flex;
......@@ -1831,7 +1729,6 @@ onMounted(() => {
.order-list-expand_item_label {
margin-right: 6px;
}
.order-operate_info {
padding: 20px;
......
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