Commit c9d64291 by qinjianhui

fix: 工厂端修改

parent 4765943b
...@@ -26,12 +26,12 @@ export function getOrderDetail(id: number) { ...@@ -26,12 +26,12 @@ export function getOrderDetail(id: number) {
}, },
) )
} }
export function getSubOrderBySubOrderNumber(factorySubOrderNumber: string) { export function getSubOrderBySubOrderNumber(thirdSubOrderNumber: string) {
return axios.get<never, BaseRespData<PodProductList>>( return axios.get<never, BaseRespData<PodProductList>>(
'factory/podJomallOrderProduct/getSubOrderBySubOrderNumber', 'factory/podJomallOrderProduct/getSubOrderByThirdSubOrderNumber',
{ {
params: { params: {
factorySubOrderNumber, thirdSubOrderNumber,
}, },
}, },
) )
......
...@@ -346,10 +346,10 @@ watch( ...@@ -346,10 +346,10 @@ watch(
isAutoSure.value = false isAutoSure.value = false
if (props.type === 1) { if (props.type === 1) {
placeholderText.value = placeholderText.value =
'扫描枪输入生产单号,录入下一单本单自动生产完成,最后一单扫两次完成生产' '扫描枪输入第三方订单号,录入下一单本单自动生产完成,最后一单扫两次完成生产'
} else if (props.type === 2) { } else if (props.type === 2) {
placeholderText.value = placeholderText.value =
'扫描枪输入生产单号,录入下一单本单自动发货完成,最后一单扫两次完成发货' '扫描枪输入第三方订单号,录入下一单本单自动发货完成,最后一单扫两次完成发货'
} }
sendNum.value = 0 sendNum.value = 0
// canlogisticsList('GNKD').then((res) => { // canlogisticsList('GNKD').then((res) => {
...@@ -625,7 +625,6 @@ const trackcodeInput = async () => { ...@@ -625,7 +625,6 @@ const trackcodeInput = async () => {
} catch (e) { } catch (e) {
console.error(e) console.error(e)
productInfo.value = {} productInfo.value = {}
playAudio('weight_search_error')
nextTick(() => { nextTick(() => {
if (trackingNumberRef.value) { if (trackingNumberRef.value) {
;(trackingNumberRef.value as HTMLInputElement).focus() ;(trackingNumberRef.value as HTMLInputElement).focus()
......
...@@ -175,11 +175,14 @@ ...@@ -175,11 +175,14 @@
<ElButton type="danger" @click="voidedBtn">作废</ElButton> <ElButton type="danger" @click="voidedBtn">作废</ElButton>
</span> --> </span> -->
</div> </div>
<template v-if="['IN_PRODUCTION', 'WAIT_SHIPMENT'].includes(status)">
<div <div
v-if="['IN_PRODUCTION', 'WAIT_SHIPMENT'].includes(status)" v-if="CardOrderList.length"
v-loading="loading"
element-loading-text="加载中..."
class="card-mode" class="card-mode"
> >
<div v-loading="loading" class="card-list"> <div class="card-list">
<div <div
v-for="cardItem in CardOrderList" v-for="cardItem in CardOrderList"
:key="cardItem.id" :key="cardItem.id"
...@@ -187,9 +190,9 @@ ...@@ -187,9 +190,9 @@
@click="cardClick(cardItem)" @click="cardClick(cardItem)"
> >
<CardWrapper <CardWrapper
@contextmenu.prevent="(v)=>rightClick(v,cardItem)"
:card-item="cardItem" :card-item="cardItem"
:class="{ active: isSelectStatused(cardItem) }" :class="{ active: isSelectStatused(cardItem) }"
@contextmenu.prevent="(v) => rightClick(v, cardItem)"
> >
<!-- <template #top_right> 工厂类型 </template> --> <!-- <template #top_right> 工厂类型 </template> -->
<template #bottom_left> <template #bottom_left>
...@@ -376,7 +379,11 @@ ...@@ -376,7 +379,11 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-top: 5px"> <el-row style="margin-top: 5px">
<el-col :span="14" :offset="0" style="white-space: nowrap"> <el-col
:span="14"
:offset="0"
style="white-space: nowrap"
>
<span <span
:title="`店铺单号:${cardItem?.shopNumber}`" :title="`店铺单号:${cardItem?.shopNumber}`"
style=" style="
...@@ -389,6 +396,26 @@ ...@@ -389,6 +396,26 @@
{{ cardItem?.shopNumber }} {{ cardItem?.shopNumber }}
</span> </span>
</el-col> </el-col>
<el-col
:span="10"
:offset="0"
style="white-space: nowrap"
>
<span
:title="`第三方订单号:${cardItem?.thirdSubOrderNumber}`"
style="
display: inline-block;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
"
@click.stop="
copy(String(cardItem?.thirdSubOrderNumber || ''))
"
>
{{ cardItem?.thirdSubOrderNumber }}
</span>
</el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
...@@ -396,6 +423,8 @@ ...@@ -396,6 +423,8 @@
</div> </div>
</div> </div>
</div> </div>
<div v-else class="empty">暂无数据</div>
</template>
<div <div
v-else v-else
ref="tableWrapperRef" ref="tableWrapperRef"
...@@ -404,13 +433,12 @@ ...@@ -404,13 +433,12 @@
class="order-list flex-1 overflow-hidden" class="order-list flex-1 overflow-hidden"
> >
<TableView <TableView
ref="tableRef"
:paginated-data="tableData" :paginated-data="tableData"
:columns="tableColumns" :columns="tableColumns"
default-expand-all default-expand-all
:span-method="arraySpanMethod" :span-method="arraySpanMethod"
@right-click="rightClick"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@right-click="rightClick"
> >
<template #expand="{ row }"> <template #expand="{ row }">
<div v-if="row.productList" class="table-expand"> <div v-if="row.productList" class="table-expand">
...@@ -726,15 +754,11 @@ ...@@ -726,15 +754,11 @@
> >
<LogList :log-list="logList" /> <LogList :log-list="logList" />
</el-dialog> </el-dialog>
<el-dialog <right-menu
v-model="countVisible" ref="rightMenuRef"
title="数据统计" :show_copy_shop_number="['IN_PRODUCTION', 'WAIT_SHIPMENT'].includes(status)"
width="400px" @change="rightChange"
:close-on-click-modal="false" />
>
<p>基版 <b>{{cardItem?.baseSku}}</b> 的统计数量为:<b> {{count}}</b></p>
</el-dialog>
<right-menu :show_copy_shop_number="['IN_PRODUCTION','WAIT_SHIPMENT'].includes(status)" ref="rightMenuRef" @change="rightChange" />
<fastProduction <fastProduction
v-model:detailVisible="detailVisible" v-model:detailVisible="detailVisible"
:title="fastTitle" :title="fastTitle"
...@@ -762,7 +786,7 @@ import { ...@@ -762,7 +786,7 @@ import {
getCardOrderList, getCardOrderList,
getOrderDetail, getOrderDetail,
getInProductionCount, getInProductionCount,
getWaitShipmentCount getWaitShipmentCount,
} from '@/api/podOrder' } from '@/api/podOrder'
import TableView from '@/components/TableView.vue' import TableView from '@/components/TableView.vue'
import { import {
...@@ -792,57 +816,64 @@ import { ...@@ -792,57 +816,64 @@ import {
imageAryInter, imageAryInter,
CardOrderData, CardOrderData,
} from '@/types/api/podOrder' } from '@/types/api/podOrder'
import {ArrowUp,ArrowDown} from '@element-plus/icons-vue' import { ArrowUp, ArrowDown } from '@element-plus/icons-vue'
import { getLogisticsCompanyList } from '@/api/common' import { getLogisticsCompanyList } from '@/api/common'
import { ElButton, type FormRules } from 'element-plus' import { ElButton, type FormRules } from 'element-plus'
import { showConfirm } from '@/utils/ui' import { showConfirm } from '@/utils/ui'
import { filePath } from '@/api/axios' import { filePath } from '@/api/axios'
import LogList from '@/components/LogList.vue' import LogList from '@/components/LogList.vue'
const tableRef = ref(); const tableRef = ref()
const countVisible = ref(false) const countVisible = ref(false)
const keyCode = ref(''); const keyCode = ref('')
const cardItem = ref<PodProductList | CardOrderData>(); const cardItem = ref<PodProductList | CardOrderData>()
const rightMenuRef = ref() const rightMenuRef = ref()
const count = ref<number>(0) const count = ref<number>(0)
const rightClick = (e:MouseEvent,item:PodProductList | CardOrderData) => { const rightClick = (e: MouseEvent, item: PodProductList | CardOrderData) => {
cardItem.value = item cardItem.value = item
rightMenuRef.value.setPosition({ rightMenuRef.value.setPosition({
x: e.clientX, x: e.clientX,
y: e.clientY, y: e.clientY,
cardItem: e.clientY, cardItem: e.clientY,
el: e el: e,
}) })
} }
const rightChange =async (code:string) => { const rightChange = async (code: string) => {
const flag = ['IN_PRODUCTION','WAIT_SHIPMENT'].includes(status.value) const flag = ['IN_PRODUCTION', 'WAIT_SHIPMENT'].includes(status.value)
if (code === 'check_all') { if (code === 'check_all') {
if(flag){ if (flag) {
selection.value = JSON.parse(JSON.stringify(CardOrderList.value)) selection.value = JSON.parse(JSON.stringify(CardOrderList.value))
} else{ } else {
if( tableRef.value && tableRef.value?.tableRef){ if (tableRef.value && tableRef.value?.tableRef) {
tableRef.value?.tableRef.toggleAllSelection() tableRef.value?.tableRef.toggleAllSelection()
} }
// selection.value = JSON.parse(JSON.stringify(tableData.value)) // selection.value = JSON.parse(JSON.stringify(tableData.value))
} }
} else if (code === 'clear_check') { } else if (code === 'clear_check') {
selection.value = [] selection.value = []
tableRef.value?.tableRef.toggleAllSelection() tableRef.value?.tableRef.toggleAllSelection()
} else if (code === 'copy_code') { } else if (code === 'copy_code') {
const str = selection.value.map(item=>item.factorySubOrderNumber || item.factoryOrderNumber).join() const str = selection.value
.map((item) => item.factorySubOrderNumber || item.factoryOrderNumber)
.join()
navigator.clipboard.writeText(str) navigator.clipboard.writeText(str)
ElMessage.success('复制成功') ElMessage.success('复制成功')
} else if (code === 'copy_shopNumber') { } else if (code === 'copy_shopNumber') {
const str = selection.value.map(item=>item.shopNumber).join() const str = selection.value.map((item) => item.shopNumber).join()
navigator.clipboard.writeText(str) navigator.clipboard.writeText(str)
ElMessage.success('复制成功') ElMessage.success('复制成功')
} else if (code === 'count') { } else if (code === 'count') {
countVisible.value = true countVisible.value = true
let res let res
if(status.value==='WAIT_SHIPMENT'){ if (status.value === 'WAIT_SHIPMENT') {
res = await getWaitShipmentCount(cardItem.value?.productionFileId,cardItem.value?.baseSku) res = await getWaitShipmentCount(
}else if(status.value==='IN_PRODUCTION'){ cardItem.value?.productionFileId,
res = await getInProductionCount(cardItem.value?.productionFileId,cardItem.value?.baseSku) 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 count.value = (res?.data || 0) as number
} }
...@@ -1039,16 +1070,17 @@ const fastToProduction = (title: string, type: number) => { ...@@ -1039,16 +1070,17 @@ const fastToProduction = (title: string, type: number) => {
} }
const cardClick = (data: PodProductList | CardOrderData) => { const cardClick = (data: PodProductList | CardOrderData) => {
const status = isSelectStatused(data) const status = isSelectStatused(data)
if(keyCode.value==='Shift'){ if (keyCode.value === 'Shift') {
if(selection.value.length){ if (selection.value.length) {
const startIndex=CardOrderList.value.findIndex(el=>el.id===selection.value[0].id) const startIndex = CardOrderList.value.findIndex(
const endIndex = CardOrderList.value.findIndex(el=>el.id===data.id) (el) => el.id === selection.value[0].id,
selection.value =[] )
for(let k =startIndex;k<=endIndex;k++ ){ 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]))) selection.value.push(JSON.parse(JSON.stringify(CardOrderList.value[k])))
} }
} }
} }
if (status) { if (status) {
selection.value = selection.value.filter( selection.value = selection.value.filter(
...@@ -1148,6 +1180,7 @@ const { ...@@ -1148,6 +1180,7 @@ const {
onPageSizeChange: handleSizeChange, onPageSizeChange: handleSizeChange,
} = usePageList<OrderData | CardOrderData>({ } = usePageList<OrderData | CardOrderData>({
query: async (page, pageSize) => { query: async (page, pageSize) => {
console.log(111111)
const commonParams = { const commonParams = {
...searchForm.value, ...searchForm.value,
status: status.value, status: status.value,
...@@ -1164,8 +1197,9 @@ const { ...@@ -1164,8 +1197,9 @@ const {
// 动态选择接口 // 动态选择接口
const fetchData = const fetchData =
status.value === 'IN_PRODUCTION' ? getCardOrderList : getOrderList status.value === 'IN_PRODUCTION' ? getCardOrderList : getOrderList
const res = await fetchData(commonParams, page, pageSize) return fetchData(commonParams, page, pageSize).then(
return res.data (res) => res.data,
) as never
}, },
}) })
// 发货 // 发货
...@@ -1391,7 +1425,11 @@ const addInternalTag = async () => { ...@@ -1391,7 +1425,11 @@ const addInternalTag = async () => {
}).then(async ({ value }: { value: string }) => { }).then(async ({ value }: { value: string }) => {
try { try {
const res = await addInternalTagApi( const res = await addInternalTagApi(
selection.value.map((item: CardOrderData | PodProductList) => item.id), selection.value.map((item: CardOrderData | PodProductList) =>
status.value === 'IN_PRODUCTION' || status.value === 'WAIT_SHIPMENT'
? (item.podOrderId as number)
: item.id,
),
value, value,
) )
ElMessage.success(res.message) ElMessage.success(res.message)
...@@ -1402,34 +1440,6 @@ const addInternalTag = async () => { ...@@ -1402,34 +1440,6 @@ const addInternalTag = async () => {
} }
}) })
} }
// const voidedBtn = async () => {
// if (selection.value.length === 0) {
// return ElMessage({
// message: '请选择订单',
// type: 'warning',
// offset: window.innerHeight / 2,
// })
// }
// ElMessageBox.prompt('', '作废', {
// confirmButtonText: '确认',
// cancelButtonText: '取消',
// inputPlaceholder: '请输入作废原因',
// inputPattern: /.+/,
// inputErrorMessage: '作废原因不能为空',
// }).then(async ({ value }) => {
// try {
// const res = await reasonInvalidationApi(
// selection.value.map((item) => item.id),
// value,
// )
// ElMessage.success(res.message)
// loadTabData()
// loadDiffList()
// } catch (e) {
// // showError(e)
// }
// })
// }
const printManuscript = async () => { const printManuscript = async () => {
if (selection.value.length === 0) { if (selection.value.length === 0) {
return ElMessage({ return ElMessage({
...@@ -1550,18 +1560,18 @@ const getSafeImages = (item: PodProductList | CardOrderData): cardImages[] => { ...@@ -1550,18 +1560,18 @@ const getSafeImages = (item: PodProductList | CardOrderData): cardImages[] => {
if (!item.images) return [] if (!item.images) return []
return item.images as cardImages[] return item.images as cardImages[]
} }
const listenerKeydown= (e:KeyboardEvent) => { const listenerKeydown = (e: KeyboardEvent) => {
console.log(e)
keyCode.value = e?.key keyCode.value = e?.key
} }
onBeforeUnmount(()=>{
document.removeEventListener('keydown', listenerKeydown)
})
onMounted(() => { onMounted(() => {
document.addEventListener('keydown', listenerKeydown) document.addEventListener('keydown', listenerKeydown)
getLogisticsList() getLogisticsList()
loadTabData() loadTabData()
}) })
onBeforeUnmount(() => {
document.removeEventListener('keydown', listenerKeydown)
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header-filter-form { .header-filter-form {
...@@ -1573,12 +1583,13 @@ onMounted(() => { ...@@ -1573,12 +1583,13 @@ onMounted(() => {
.card-mode { .card-mode {
padding-top: 10px; padding-top: 10px;
overflow: auto; overflow: auto;
.card-list {
flex: 1; flex: 1;
.card-list {
display: grid; display: grid;
grid-template-columns: repeat(6, 1fr); grid-template-columns: repeat(6, 1fr);
grid-template-rows: max-content; grid-template-rows: max-content;
gap: 10px; gap: 10px;
overflow: hidden;
.card-list_item { .card-list_item {
border: 1px solid #eee; border: 1px solid #eee;
border-top-left-radius: 10px; border-top-left-radius: 10px;
...@@ -1626,7 +1637,14 @@ onMounted(() => { ...@@ -1626,7 +1637,14 @@ onMounted(() => {
} }
} }
} }
.empty {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
color: #777;
overflow: hidden;
}
.tabs { .tabs {
display: flex; display: flex;
align-items: center; align-items: center;
......
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