Commit 7d2db864 by wuqian

Merge branch 'dev' of 47.122.114.111:qinjianhui/factory_front into wq

parents af73c5b4 0c00b4fe
...@@ -7,10 +7,10 @@ export {} ...@@ -7,10 +7,10 @@ export {}
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
AmountInput: typeof import('./src/components/Form.vue/AmountInput.vue')['default'] AmountInput: typeof import('./src/components/Form/AmountInput.vue')['default']
CommonCard: typeof import('./src/components/CommonCard.vue')['default'] CommonCard: typeof import('./src/components/CommonCard.vue')['default']
DatePicker: typeof import('./src/components/Form.vue/DatePicker.vue')['default'] DatePicker: typeof import('./src/components/Form/DatePicker.vue')['default']
DateRangePicker: typeof import('./src/components/Form.vue/DateRangePicker.vue')['default'] DateRangePicker: typeof import('./src/components/Form/DateRangePicker.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard'] ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel'] ElCarousel: typeof import('element-plus/es')['ElCarousel']
...@@ -53,18 +53,20 @@ declare module 'vue' { ...@@ -53,18 +53,20 @@ declare module 'vue' {
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree'] ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
Icon: typeof import('./src/components/Icon.vue')['default'] Icon: typeof import('./src/components/Icon.vue')['default']
ImageView: typeof import('./src/components/ImageView.vue')['default'] ImageView: typeof import('./src/components/ImageView.vue')['default']
LogList: typeof import('./src/components/LogList.vue')['default'] LogList: typeof import('./src/components/LogList.vue')['default']
NavMenu: typeof import('./src/components/NavMenu.vue')['default'] NavMenu: typeof import('./src/components/NavMenu.vue')['default']
RenderColumn: typeof import('./src/components/RenderColumn.vue')['default'] RenderColumn: typeof import('./src/components/RenderColumn.vue')['default']
RightClickMenu: typeof import('./src/components/RightClickMenu.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']
Select: typeof import('./src/components/Form.vue/Select.vue')['default'] Select: typeof import('./src/components/Form/Select.vue')['default']
ShipmentOrderDetail: typeof import('./src/components/ShipmentOrderDetail.vue')['default'] ShipmentOrderDetail: typeof import('./src/components/ShipmentOrderDetail.vue')['default']
SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default'] SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default']
'Switch ': typeof import('./src/components/Form.vue/Switch .vue')['default'] 'Switch ': typeof import('./src/components/Form/Switch .vue')['default']
TableRightMenu: typeof import('./src/components/TableRightMenu.vue')['default'] TableRightClickMenu: typeof import('./src/components/TableRightClickMenu.vue')['default']
TableView: typeof import('./src/components/TableView.vue')['default'] TableView: typeof import('./src/components/TableView.vue')['default']
UploadExcel: typeof import('./src/components/UploadExcel.vue')['default'] UploadExcel: typeof import('./src/components/UploadExcel.vue')['default']
UploadImage: typeof import('./src/components/UploadImage.vue')['default'] UploadImage: typeof import('./src/components/UploadImage.vue')['default']
......
...@@ -4,7 +4,7 @@ import { showError } from '@/utils/ui.ts' ...@@ -4,7 +4,7 @@ import { showError } from '@/utils/ui.ts'
const axios = Axios.create({ const axios = Axios.create({
baseURL: import.meta.env.VITE_API_BASE, baseURL: import.meta.env.VITE_API_BASE,
timeout: 30000, timeout: 300000, //凯哥让改的超时时间
}) })
const TOKEN_KEY = 'token' const TOKEN_KEY = 'token'
......
...@@ -18,6 +18,38 @@ export interface LogisticsData { ...@@ -18,6 +18,38 @@ export interface LogisticsData {
partition: string // 所在分区 partition: string // 所在分区
logisticsWayId?: number | null logisticsWayId?: number | null
} }
export interface AddressInfo {
id?:string
receiverName: string,
receiverPhone: string,
receiverCountry: string,
receiverProvince: string,
receiverCity: string,
receiverDistrict: string,
receiverAddress1: string,
receiverAddress2: string,
receiverPostCode: string,
}
// 同步收货地址
export function syncReceiverAddress(data: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/syncReceiverAddress',
data,
)
}
export function refreshAddressApi(idList: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/syncReceiverAddress',
idList,
)
}
export function updateAddressApi(data: PodUsOrderListData) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/updateReceiverAddress',
data,
)
}
export function getOrderTabData() { export function getOrderTabData() {
return axios.get<never, BaseRespData<Tab[]>>( return axios.get<never, BaseRespData<Tab[]>>(
'/factory/podJomallOrderUs/findStateGroupList', '/factory/podJomallOrderUs/findStateGroupList',
...@@ -306,6 +338,14 @@ export function createLogisticsOrderApi(params: { ...@@ -306,6 +338,14 @@ export function createLogisticsOrderApi(params: {
params, params,
) )
} }
// 更改物流
export function composingDesignImages(data:number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/composingDesignImages',
data
)
}
// 转至待拣胚 // 转至待拣胚
export function updateLogisticsToPickingApi(params: { ids: string }) { export function updateLogisticsToPickingApi(params: { ids: string }) {
return axios.get<never, BaseRespData<never>>( return axios.get<never, BaseRespData<never>>(
......
...@@ -2,12 +2,12 @@ import { defineComponent, PropType, ref, computed, h } from 'vue' ...@@ -2,12 +2,12 @@ import { defineComponent, PropType, ref, computed, h } from 'vue'
import type { Component } from 'vue' import type { Component } from 'vue'
import { ElInput, ElForm, ElFormItem } from 'element-plus' import { ElInput, ElForm, ElFormItem } from 'element-plus'
import type { FormInstance } from 'element-plus' import type { FormInstance } from 'element-plus'
import AmountInput from './Form.vue/AmountInput.vue' // 金额输入框 import AmountInput from './Form/AmountInput.vue' // 金额输入框
import DateRangePicker from './Form.vue/DateRangePicker.vue' // 时间范围选择器 import DateRangePicker from './Form/DateRangePicker.vue' // 时间范围选择器
import DatePicker from './Form.vue/DatePicker.vue' // 单个日期选择器 import DatePicker from './Form/DatePicker.vue' // 单个日期选择器
import Select from './Form.vue/Select.vue' // 普通下拉选择框 import Select from './Form/Select.vue' // 普通下拉选择框
import Switch from './Form.vue/Switch .vue' import Switch from './Form/Switch .vue'
import './Form.vue/form.scss' import './Form/form.scss'
import type { FormItemRule } from 'element-plus' import type { FormItemRule } from 'element-plus'
......
<template>
<div
v-show="visible"
class="right-click-menu"
:style="{ left: position.x + 'px', top: position.y + 'px' }"
>
<div class="menu-item" @click="onChangeCopy('select-all')">全部选择</div>
<div class="menu-item" @click="onChangeCopy('cancel-select')">取消选择</div>
<div
v-if="showCopySubShopNumber"
class="menu-item"
@click="onChangeCopy('copy_code')"
>
复制生产单号
</div>
<div
v-if="showCopyShopNumber"
class="menu-item"
@click="onChangeCopy('copy_shopNumber')"
>
复制店铺单号
</div>
<div v-if="showCopyCount" class="menu-item" @click="onChangeCopy('count')">
统计数量
</div>
<slot></slot>
</div>
</template>
<script setup lang="ts">
import { ref, defineExpose, onMounted, onUnmounted } from 'vue'
const visible = ref(false)
const position = ref({ x: 0, y: 0 })
const emit = defineEmits(['onChange'])
defineProps({
showCopyShopNumber: {
type: Boolean,
default: true,
},
showCopyCount: {
type: Boolean,
default: true,
},
showCopySubShopNumber: {
type: Boolean,
default: true,
},
})
const setPosition = ({ x, y }: { x: number; y: number }) => {
position.value = { x, y }
visible.value = true
}
const onChangeCopy = (value: string) => {
emit('onChange', value)
visible.value = false
}
// 点击其他地方关闭菜单
const handleClickOutside = () => {
if (visible.value) {
visible.value = false
}
}
// 监听全局点击事件
onMounted(() => {
document.addEventListener('click', handleClickOutside)
})
onUnmounted(() => {
document.removeEventListener('click', handleClickOutside)
})
defineExpose({
setPosition,
})
</script>
<style scoped lang="scss">
.right-click-menu {
position: fixed;
background: white;
border: 1px solid #e4e7ed;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
z-index: 3000;
}
.right-click-menu {
:deep(.menu-item) {
padding: 8px 16px;
cursor: pointer;
font-size: 14px;
color: #606266;
}
}
.right-click-menu {
:deep(.menu-item):hover {
background-color: #f5f7fa;
color: #409eff;
}
}
</style>
import { defineComponent, PropType, ref, computed, watch, h } from 'vue' import { defineComponent, PropType, ref, computed, watch, h } from 'vue'
import type { Component } from 'vue' import type { Component } from 'vue'
import AmountInput from './Form.vue/AmountInput.vue' // 金额输入框 import AmountInput from './Form/AmountInput.vue' // 金额输入框
import DateRangePicker from './Form.vue/DateRangePicker.vue' // 时间范围选择器 import DateRangePicker from './Form/DateRangePicker.vue' // 时间范围选择器
import DatePicker from './Form.vue/DatePicker.vue' // 单个日期选择器 import DatePicker from './Form/DatePicker.vue' // 单个日期选择器
import Select from './Form.vue/Select.vue' // 普通下拉选择框 import Select from './Form/Select.vue' // 普通下拉选择框
import { ElInput, ElForm, ElFormItem, ElButton } from 'element-plus' import { ElInput, ElForm, ElFormItem, ElButton } from 'element-plus'
import { import {
ISearchForm, ISearchForm,
......
<template>
<div
v-if="tableRightMenuVisible"
class="table-right-menu"
:style="{
left: rightMenuOptions.contextMenuX + 'px',
top: rightMenuOptions.contextMenuY + 'px',
}"
>
<div
class="table-right-menu-item"
@click="handleChange('copy_shop_number')"
>
<span>复制店铺单号</span>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
defineProps({
tableRightMenuVisible: {
type: Boolean,
default: false,
},
})
const emit = defineEmits(['onCopyChange'])
const handleChange = (type: string) => {
emit('onCopyChange', type)
}
const rightMenuOptions = ref({
contextMenuX: 0,
contextMenuY: 0,
})
const setRightMenuOptions = (options: {
contextMenuX: number
contextMenuY: number
}) => {
rightMenuOptions.value = options
}
defineExpose({
setRightMenuOptions,
})
</script>
<style lang="scss" scoped>
.table-right-menu {
position: fixed;
z-index: 1000;
border: 1px solid #ccc;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
padding: 6px;
}
.table-right-menu-item {
padding: 5px;
cursor: pointer;
font-size: 14px;
&:hover {
background-color: #f0f0f0;
}
}
</style>
...@@ -64,7 +64,10 @@ import { type Slot, useAttrs, useSlots, type PropType, shallowRef } from 'vue' ...@@ -64,7 +64,10 @@ import { type Slot, useAttrs, useSlots, type PropType, shallowRef } from 'vue'
import type { CustomColumn } from '@/types/table' import type { CustomColumn } from '@/types/table'
import RenderColumn from './RenderColumn.vue' import RenderColumn from './RenderColumn.vue'
import { ElTable } from 'element-plus' import { ElTable } from 'element-plus'
const tableRef = shallowRef<InstanceType<typeof ElTable>>() import type { TableInstance } from 'element-plus'
const tableRef = shallowRef<TableInstance>()
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
defineProps({ defineProps({
paginatedData: { paginatedData: {
...@@ -88,23 +91,31 @@ defineProps({ ...@@ -88,23 +91,31 @@ defineProps({
default: false, default: false,
}, },
}) })
const attrs = useAttrs() const attrs = useAttrs()
const slots = useSlots() as Record<string, Slot> const slots = useSlots() as Record<string, Slot>
const setCurrentRow = (row: T) => { const setCurrentRow = (row: T) => {
tableRef.value?.setCurrentRow(row) tableRef.value?.setCurrentRow(row)
} }
const toggleRowSelection = (row: T, selected: boolean = true) => { const toggleRowSelection = (row: T, selected: boolean = true) => {
tableRef.value?.toggleRowSelection(row, selected) tableRef.value?.toggleRowSelection(row, selected)
} }
const clearSelection = () => { const clearSelection = () => {
tableRef.value?.clearSelection() tableRef.value?.clearSelection()
} }
const toggleAllSelection = () => {
tableRef.value?.toggleAllSelection()
}
defineExpose({ defineExpose({
tableRef, tableRef,
setCurrentRow, setCurrentRow,
toggleRowSelection, toggleRowSelection,
clearSelection, clearSelection,
toggleAllSelection,
}) })
</script> </script>
...@@ -112,5 +123,6 @@ defineExpose({ ...@@ -112,5 +123,6 @@ defineExpose({
.table-view { .table-view {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
position: relative;
} }
</style> </style>
...@@ -6,6 +6,7 @@ export interface Tab { ...@@ -6,6 +6,7 @@ export interface Tab {
export interface SearchForm { export interface SearchForm {
timeType: number | null timeType: number | null
shopNumber: string shopNumber: string
shipmentType: string
userMark: string userMark: string
logisticsTracking: string logisticsTracking: string
baseSku: string baseSku: string
......
...@@ -101,6 +101,7 @@ const [editForm, resetEditForm] = useValue<AddDeclarationRuleObj>({ ...@@ -101,6 +101,7 @@ const [editForm, resetEditForm] = useValue<AddDeclarationRuleObj>({
currency: 'USD', currency: 'USD',
}) })
const { const {
loading,
currentPage, currentPage,
pageSize, pageSize,
total, total,
...@@ -466,7 +467,7 @@ const tableConfig = ref<TableColumn[]>([ ...@@ -466,7 +467,7 @@ const tableConfig = ref<TableColumn[]>([
}, },
]) ])
const loading = ref(false) // const loading = ref(false)
/** /**
* @description: 取消按钮 * @description: 取消按钮
......
...@@ -436,7 +436,7 @@ onMounted(() => { ...@@ -436,7 +436,7 @@ onMounted(() => {
}) })
async function search() { async function search() {
loading.value = true // loading.value = true
const isEqual = const isEqual =
JSON.stringify(searchForm.value) === JSON.stringify({ logisticsIdList: [] }) JSON.stringify(searchForm.value) === JSON.stringify({ logisticsIdList: [] })
try { try {
...@@ -448,7 +448,7 @@ async function search() { ...@@ -448,7 +448,7 @@ async function search() {
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} finally { } finally {
loading.value = false // loading.value = false
} }
} }
...@@ -729,6 +729,7 @@ function handleSizeChange(val: number) { ...@@ -729,6 +729,7 @@ function handleSizeChange(val: number) {
} }
async function getList() { async function getList() {
loading.value = true
try { try {
const { data } = await getlogisticsQuotationPage({ const { data } = await getlogisticsQuotationPage({
...searchForm.value, ...searchForm.value,
...@@ -741,10 +742,13 @@ async function getList() { ...@@ -741,10 +742,13 @@ async function getList() {
mergeCells.value = [] mergeCells.value = []
} catch (error) { } catch (error) {
console.log(error) console.log(error)
} finally {
loading.value = false
} }
} }
const templeData = ref<LogisticsQuotation[]>([]) const templeData = ref<LogisticsQuotation[]>([])
async function getSearchList() { async function getSearchList() {
loading.value = true
try { try {
const { data } = await getlogisticsQuotationList({ const { data } = await getlogisticsQuotationList({
...searchForm.value, ...searchForm.value,
...@@ -784,6 +788,8 @@ async function getSearchList() { ...@@ -784,6 +788,8 @@ async function getSearchList() {
mergeCells.value = newMergeCells mergeCells.value = newMergeCells
} catch (error) { } catch (error) {
console.log(error) console.log(error)
} finally {
loading.value = false
} }
} }
......
...@@ -271,9 +271,11 @@ ...@@ -271,9 +271,11 @@
v-loading="loading" v-loading="loading"
element-loading-text="加载中..." element-loading-text="加载中..."
class="order-list flex-1 overflow-hidden" class="order-list flex-1 overflow-hidden"
@contextmenu.prevent="handleContextMenu"
> >
<ElTable <ElTable
v-show="statusCode !== 6" v-show="statusCode !== 6"
ref="tableRef"
:data="tableData" :data="tableData"
:span-method="arraySpanMethod" :span-method="arraySpanMethod"
default-expand-all default-expand-all
...@@ -597,6 +599,7 @@ ...@@ -597,6 +599,7 @@
</ElTable> </ElTable>
<ElTable <ElTable
v-show="statusCode === 6" v-show="statusCode === 6"
ref="tableQaRef"
:data="tableData" :data="tableData"
:span-method="arraySpanMethod" :span-method="arraySpanMethod"
default-expand-all default-expand-all
...@@ -973,6 +976,13 @@ ...@@ -973,6 +976,13 @@
> >
<OrderDetail :order-detail-data="orderDetailData" /> <OrderDetail :order-detail-data="orderDetailData" />
</ElDrawer> </ElDrawer>
<RightClickMenu
ref="rightMenuRef"
:show-copy-shop-number="true"
:show-copy-count="false"
:show-copy-sub-shop-number="true"
@on-change="rightChange"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Shipment from './Shipment.vue' import Shipment from './Shipment.vue'
...@@ -990,7 +1000,12 @@ import type { ...@@ -990,7 +1000,12 @@ import type {
} from '@/types/api/order' } from '@/types/api/order'
import { nextTick, onMounted, reactive, ref } from 'vue' import { nextTick, onMounted, reactive, ref } from 'vue'
import useElTableColumnWidth from '@/utils/hooks/useElTableColumnWidth' import useElTableColumnWidth from '@/utils/hooks/useElTableColumnWidth'
import { ArrowDown, ArrowUp, DocumentCopy, EditPen } from '@element-plus/icons-vue' import {
ArrowDown,
ArrowUp,
DocumentCopy,
EditPen,
} from '@element-plus/icons-vue'
import usePageList from '@/utils/hooks/usePageList' import usePageList from '@/utils/hooks/usePageList'
import { import {
getOrderList, getOrderList,
...@@ -1023,6 +1038,7 @@ import OrderDetail from './OrderDetail.vue' ...@@ -1023,6 +1038,7 @@ import OrderDetail from './OrderDetail.vue'
import useShipment from './hook/useShipment' import useShipment from './hook/useShipment'
import useQuarantine from './hook/useQuarantine' import useQuarantine from './hook/useQuarantine'
import Quarantine from './Quarantine.vue' import Quarantine from './Quarantine.vue'
import RightClickMenu from '@/components/RightClickMenu.vue'
const [searchForm] = useValue<SearchForm>({ const [searchForm] = useValue<SearchForm>({
mainSku: '', mainSku: '',
...@@ -1644,7 +1660,70 @@ const cancelOrder = async (id: number) => { ...@@ -1644,7 +1660,70 @@ const cancelOrder = async (id: number) => {
// showError(e) // showError(e)
} }
} }
const rightMenuRef = ref()
const handleContextMenu = (e: MouseEvent) => {
rightMenuRef.value?.setPosition({
x: e.clientX,
y: e.clientY,
cardItem: e.clientY,
el: e,
})
}
const tableQaRef = ref()
const tableRef = ref()
const rightChange = (key: string) => {
if (key === 'select-all') {
if (statusCode.value === 6) {
tableQaRef.value?.toggleAllSelection()
} else {
tableRef.value?.toggleAllSelection()
}
} else if (key === 'cancel-select') {
if (statusCode.value === 6) {
tableQaRef.value?.clearSelection()
} else {
tableRef.value?.clearSelection()
}
} else if (key === 'copy_shopNumber') {
let shopNumberList: string[] = []
if (statusCode.value === 6) {
shopNumberList = tableData.value
.map((item) => item.detailList)
.flat()
.map((e) => e?.shopNumber)
.filter((shopNumber): shopNumber is string => shopNumber !== undefined)
} else {
shopNumberList = tableData.value
.map((item) => item.productList)
.flat()
.map((e) => e?.shopNumber)
.filter((shopNumber): shopNumber is string => shopNumber !== undefined)
}
copy(shopNumberList.join(','))
} else if (key === 'copy_code') {
let subOrderNumber: string[] = []
if (statusCode.value === 6) {
subOrderNumber = tableData.value
.map((item) => item.detailList)
.flat()
.map((e) => e?.subOrderNumber)
.filter(
(subOrderNumber): subOrderNumber is string =>
subOrderNumber !== undefined,
)
} else {
subOrderNumber = tableData.value
.map((item) => item.productList)
.flat()
.map((e) => e?.subOrderNumber)
.filter(
(subOrderNumber): subOrderNumber is string =>
subOrderNumber !== undefined,
)
}
copy(subOrderNumber.join(','))
}
}
const onChangeCurrentRow = (item: ProductList) => { const onChangeCurrentRow = (item: ProductList) => {
currentRow.value = item currentRow.value = item
} }
......
...@@ -231,7 +231,12 @@ ...@@ -231,7 +231,12 @@
v-if="['TO_BE_CONFIRMED', 'IN_PRODUCTION'].includes(status)" v-if="['TO_BE_CONFIRMED', 'IN_PRODUCTION'].includes(status)"
class="item" class="item"
> >
<ElButton :loading="syncLoading" type="warning" is-dark @click="synchronousPlan"> <ElButton
:loading="syncLoading"
type="warning"
is-dark
@click="synchronousPlan"
>
同步素材图</ElButton 同步素材图</ElButton
> >
</span> </span>
...@@ -481,7 +486,7 @@ ...@@ -481,7 +486,7 @@
" "
> >
{{ cardItem?.processName }} {{ cardItem?.processName }}
</span> </span>
</el-col> </el-col>
<el-col <el-col
:span="12" :span="12"
...@@ -544,11 +549,10 @@ ...@@ -544,11 +549,10 @@
> >
<img width="20" src="@/assets/images/id.png" /> <img width="20" src="@/assets/images/id.png" />
<el-tooltip :content="cardItem?.productionFileId"> <el-tooltip :content="cardItem?.productionFileId">
<span class="over-hidden" title="素材ID"> <span class="over-hidden" title="素材ID">
{{ cardItem?.productionFileId }} {{ cardItem?.productionFileId }}
</span> </span>
</el-tooltip> </el-tooltip>
</a> </a>
</el-col> </el-col>
<el-col <el-col
...@@ -586,15 +590,17 @@ ...@@ -586,15 +590,17 @@
v-loading="loading" v-loading="loading"
element-loading-text="加载中..." element-loading-text="加载中..."
class="order-list flex-1 overflow-hidden" class="order-list flex-1 overflow-hidden"
@contextmenu.prevent="(v) => rightClick(v, null)"
> >
<TableView <TableView
ref="tableRef"
:paginated-data="tableData" :paginated-data="tableData"
:columns="tableColumns" :columns="tableColumns"
:selectionable="true" :selectionable="true"
default-expand-all default-expand-all
:span-method="arraySpanMethod" :span-method="arraySpanMethod"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@contextmenu.prevent="handleContextMenu" @on-change="onChange"
> >
<template #expand="{ row }"> <template #expand="{ row }">
<div v-if="row.productList" class="table-expand"> <div v-if="row.productList" class="table-expand">
...@@ -969,12 +975,20 @@ ...@@ -969,12 +975,20 @@
基版 <b>{{ cardItem?.baseSku }}</b> 的统计数量为:<b> {{ count }}</b> 基版 <b>{{ cardItem?.baseSku }}</b> 的统计数量为:<b> {{ count }}</b>
</p> </p>
</el-dialog> </el-dialog>
<right-menu <RightClickMenu
ref="rightMenuRef" ref="rightMenuRef"
:show-copy-shop-number=" :show-copy-shop-number="true"
['IN_PRODUCTION', 'TO_BE_CONFIRMED', 'WAIT_SHIPMENT'].includes(status) :show-copy-count="
[
'IN_PRODUCTION',
'TO_BE_CONFIRMED',
'WAIT_SHIPMENT',
'TO_BE_REPLENISHMENT',
'INVALID',
].includes(status)
" "
@change="rightChange" :show-copy-sub-shop-number="true"
@on-change="rightChange"
/> />
<fastProduction <fastProduction
v-model:detailVisible="detailVisible" v-model:detailVisible="detailVisible"
...@@ -986,11 +1000,6 @@ ...@@ -986,11 +1000,6 @@
@on-success="handleSuccess" @on-success="handleSuccess"
@close="fastClose" @close="fastClose"
></fastProduction> ></fastProduction>
<table-right-menu
ref="tableRightMenuRef"
:table-right-menu-visible="tableRightMenuVisible"
@on-copy-change="onCopyChange"
/>
<el-dialog <el-dialog
v-model="completeShipmentVisible" v-model="completeShipmentVisible"
title="完成发货" title="完成发货"
...@@ -1056,7 +1065,6 @@ ...@@ -1056,7 +1065,6 @@
</template> </template>
<script setup lang="tsx"> <script setup lang="tsx">
// refreshJMProductInfo,reasonInvalidationApi, // refreshJMProductInfo,reasonInvalidationApi,
import RightMenu from './rightMenu.vue'
import { import {
getOrderTabData, getOrderTabData,
getOrderList, getOrderList,
...@@ -1105,7 +1113,6 @@ import { ...@@ -1105,7 +1113,6 @@ import {
SearchForm, SearchForm,
Tab, Tab,
LogListData, LogListData,
PodProductList, PodProductList,
cardImages, cardImages,
imageAryInter, imageAryInter,
...@@ -1119,6 +1126,7 @@ import { filePath } from '@/api/axios' ...@@ -1119,6 +1126,7 @@ import { filePath } from '@/api/axios'
import { CustomColumn } from '@/types/table' import { CustomColumn } from '@/types/table'
import LogList from '@/components/LogList.vue' import LogList from '@/components/LogList.vue'
import CommonCard from '@/components/CommonCard.vue' import CommonCard from '@/components/CommonCard.vue'
import RightClickMenu from '@/components/RightClickMenu.vue'
const tableRef = ref() const tableRef = ref()
const loading = ref(false) const loading = ref(false)
const currentPage = ref(1) const currentPage = ref(1)
...@@ -1153,13 +1161,14 @@ const completeShipmentForm = ref({ ...@@ -1153,13 +1161,14 @@ const completeShipmentForm = ref({
logisticsTracking: '', // 物流跟踪号 logisticsTracking: '', // 物流跟踪号
carriageAmount: '', // 物流费用 carriageAmount: '', // 物流费用
}) })
const rightClick = (e: MouseEvent, item: PodProductList | CardOrderData) => { const rightClick = (
cardItem.value = item e: MouseEvent,
item: PodProductList | CardOrderData | null,
) => {
cardItem.value = item || undefined
rightMenuRef.value.setPosition({ rightMenuRef.value.setPosition({
x: e.clientX, x: e.clientX,
y: e.clientY, y: e.clientY,
cardItem: e.clientY,
el: e,
}) })
} }
const handleSizeChange = (size: number) => { const handleSizeChange = (size: number) => {
...@@ -1171,10 +1180,14 @@ const handleCurrentChange = (page: number) => { ...@@ -1171,10 +1180,14 @@ const handleCurrentChange = (page: number) => {
loadDiffList() loadDiffList()
} }
const rightChange = async (code: string) => { const rightChange = async (code: string) => {
const flag = ['IN_PRODUCTION', 'TO_BE_CONFIRMED', 'WAIT_SHIPMENT'].includes( const flag = [
status.value, 'IN_PRODUCTION',
) 'TO_BE_CONFIRMED',
if (code === 'check_all') { 'WAIT_SHIPMENT',
'TO_BE_REPLENISHMENT',
'INVALID',
].includes(status.value)
if (code === 'select-all') {
if (flag) { if (flag) {
selection.value = JSON.parse(JSON.stringify(CardOrderList.value)) selection.value = JSON.parse(JSON.stringify(CardOrderList.value))
} else { } else {
...@@ -1183,17 +1196,35 @@ const rightChange = async (code: string) => { ...@@ -1183,17 +1196,35 @@ const rightChange = async (code: string) => {
} }
// selection.value = JSON.parse(JSON.stringify(tableData.value)) // selection.value = JSON.parse(JSON.stringify(tableData.value))
} }
} else if (code === 'clear_check') { } else if (code === 'cancel-select') {
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 let str
.map((item) => item.factorySubOrderNumber || item.factoryOrderNumber) if (flag) {
.join() str = CardOrderList.value.map((item) => item.factorySubOrderNumber).join()
navigator.clipboard.writeText(str) } else {
str = tableData.value
.map((item) => item.productList)
.flat()
.map((item) => item?.factorySubOrderNumber)
.filter((item) => item)
.join()
}
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() let str
if (flag) {
str = CardOrderList.value.map((item) => item.shopNumber).join()
} else {
str = tableData.value
.map((item) => item.productList)
.flat()
.map((item) => item?.shopNumber)
.filter((item) => item)
.join()
}
navigator.clipboard.writeText(str) navigator.clipboard.writeText(str)
ElMessage.success('复制成功') ElMessage.success('复制成功')
} else if (code === 'count') { } else if (code === 'count') {
...@@ -1341,6 +1372,7 @@ const saveCompleteShipment = async () => { ...@@ -1341,6 +1372,7 @@ const saveCompleteShipment = async () => {
const CardOrderList = ref<(PodProductList | CardOrderData)[]>([]) const CardOrderList = ref<(PodProductList | CardOrderData)[]>([])
const loadCardList = async () => { const loadCardList = async () => {
loading.value = true
try { try {
const res = await getCardOrderList( const res = await getCardOrderList(
{ {
...@@ -1379,7 +1411,17 @@ const loadCardList = async () => { ...@@ -1379,7 +1411,17 @@ const loadCardList = async () => {
item.images = images item.images = images
} else { } else {
if (item.imageAry) { if (item.imageAry) {
const images = JSON.parse(item.imageAry as string) console.log(item.imageAry)
let images
if (
typeof item.imageAry === 'string' &&
item.imageAry.startsWith('https')
) {
images = []
} else {
images = JSON.parse(item.imageAry as string)
}
if (Array.isArray(images)) { if (Array.isArray(images)) {
item.images = images.map((e: imageAryInter) => { item.images = images.map((e: imageAryInter) => {
return { return {
...@@ -1395,10 +1437,14 @@ const loadCardList = async () => { ...@@ -1395,10 +1437,14 @@ const loadCardList = async () => {
}) })
total.value = res.data.total total.value = res.data.total
} catch (error) { } catch (error) {
console.error(error)
// showError(error) // showError(error)
} finally {
loading.value = false
} }
} }
const loadOrderList = async () => { const loadOrderList = async () => {
loading.value = true
try { try {
const res = await getOrderList( const res = await getOrderList(
{ {
...@@ -1421,6 +1467,8 @@ const loadOrderList = async () => { ...@@ -1421,6 +1467,8 @@ const loadOrderList = async () => {
total.value = res.data.total total.value = res.data.total
} catch (error) { } catch (error) {
// showError(error) // showError(error)
} finally {
loading.value = false
} }
} }
const currentImage = ref('') const currentImage = ref('')
...@@ -1825,7 +1873,9 @@ const synchronousPlan = async () => { ...@@ -1825,7 +1873,9 @@ const synchronousPlan = async () => {
return return
} }
try { try {
const res = await syncSubOrderDesignImages(selection.value.map(item=>item.id)) const res = await syncSubOrderDesignImages(
selection.value.map((item) => item.id),
)
await loadDiffList() await loadDiffList()
await loadTabData() await loadTabData()
syncLoading.value = false syncLoading.value = false
...@@ -2161,10 +2211,8 @@ const invalidOrder = async (row: ProductList) => { ...@@ -2161,10 +2211,8 @@ const invalidOrder = async (row: ProductList) => {
} }
}) })
} }
const tableRightMenuVisible = ref(false) const onChange = (type: string) => {
const tableRightMenuRef = ref() if (type === 'shop-numbers') {
const onCopyChange = (type: string) => {
if (type === 'copy_shop_number') {
const shopNumberList = [] const shopNumberList = []
for (const item of tableData.value) { for (const item of tableData.value) {
if (item.productList) { if (item.productList) {
...@@ -2174,16 +2222,6 @@ const onCopyChange = (type: string) => { ...@@ -2174,16 +2222,6 @@ const onCopyChange = (type: string) => {
copy(shopNumberList.join(',')) copy(shopNumberList.join(','))
} }
} }
const handleContextMenu = (e: MouseEvent) => {
tableRightMenuVisible.value = true
tableRightMenuRef.value?.setRightMenuOptions({
contextMenuX: e.clientX,
contextMenuY: e.clientY,
})
}
const listenerClick = () => {
tableRightMenuVisible.value = false
}
const getUserMark = async () => { const getUserMark = async () => {
try { try {
...@@ -2208,7 +2246,6 @@ const openMaterial = async (item: PodProductList) => { ...@@ -2208,7 +2246,6 @@ const openMaterial = async (item: PodProductList) => {
} }
onMounted(async () => { onMounted(async () => {
document.addEventListener('keydown', listenerKeydown) document.addEventListener('keydown', listenerKeydown)
document.addEventListener('click', listenerClick)
await loadTabData() await loadTabData()
getUserMark() getUserMark()
getLogisticsList() getLogisticsList()
...@@ -2216,7 +2253,6 @@ onMounted(async () => { ...@@ -2216,7 +2253,6 @@ onMounted(async () => {
}) })
onBeforeUnmount(() => { onBeforeUnmount(() => {
document.removeEventListener('keydown', listenerKeydown) document.removeEventListener('keydown', listenerKeydown)
document.removeEventListener('click', listenerClick)
}) })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -2491,9 +2527,9 @@ onBeforeUnmount(() => { ...@@ -2491,9 +2527,9 @@ onBeforeUnmount(() => {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.over-hidden{ .over-hidden {
width: 150px; width: 150px;
display:inline-block; display: inline-block;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
......
<template>
<!-- <div class="wrap" @click="close"> -->
<div v-if="show" ref="right_menu" class="right_menu">
<button @click="$emit('change', 'check_all')">
全部选择
</button>
<button @click="$emit('change', 'clear_check')">取消选择</button>
<button @click="$emit('change', 'copy_code')">复制选中生产单号</button>
<button v-if="showCopyShopNumber" @click="$emit('change', 'copy_shopNumber')">复制选中店铺单号</button>
<button v-if="showCopyShopNumber" @click="$emit('change', 'count')">统计数量</button>
</div>
<!-- </div> -->
</template>
<script setup lang="ts">
import {ref,defineProps,defineExpose} from 'vue'
interface E{
x:number
el:HTMLElement
y:number
}
defineProps({
showCopyShopNumber:{
type:Boolean,
default:true
}
})
const row = ref()
const show = ref(false)
const right_menu = ref<HTMLElement>()
const close = ()=>{
show.value = false
document.body.onclick = null
}
const setPosition = (o:E)=> {
console.log(o)
show.value = true
const clientX = o.x
const x = document.body.clientWidth - clientX
document.body.onclick = function () {
close()
}
row.value =
setTimeout(() => {
if(!right_menu.value) return
if (x < 150) {
right_menu.value.style.cssText = `top:${o.y}px;right:${x}px`
} else {
right_menu.value.style.cssText = `top:${o.y}px;left:${o.x}px`
}
}, 1)
}
defineExpose({
setPosition
})
</script>
<style scoped>
.wrap {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.right_menu {
position: fixed;
max-width: 200px;
min-height: 50px;
background: #fff;
box-shadow: 1px 1px 10px 1px rgba(0, 0, 0, 0.5);
border-radius: 5px;
overflow: hidden;
z-index: 999;
/* left: -500px; */
top: -500px;
}
.right_menu button {
display: block;
line-height: 30px;
font-size: 14px;
padding: 0 15px;
text-align: left;
width: 100%;
cursor: pointer;
}
.right_menu button:hover {
background: rgb(65, 192, 251);
color: white;
}
button{
outline: none;
border: none;
}
</style>
...@@ -74,7 +74,7 @@ const checkAll = ref(false) ...@@ -74,7 +74,7 @@ const checkAll = ref(false)
const selectedList = ref<(string | number)[]>([]) const selectedList = ref<(string | number)[]>([])
// 显示弹窗 // 显示弹窗
const showDialog = (type: string) => { const showDialog = (type?: string) => {
console.log(type) console.log(type)
resultDialog.value = true resultDialog.value = true
......
<script setup lang="ts">
import { defineModel } from 'vue'
import { updateAddressApi,AddressInfo } from '@/api/podUsOrder.ts'
const emits = defineEmits(['success'])
defineProps<{
countryList: { countryCode: string }[]
}>()
const visible = defineModel<boolean>('visible')
const form = defineModel<AddressInfo>('form', {
default: {
receiverName: '',
receiverPhone: '',
receiverCountry: '',
receiverProvince: '',
receiverCity: '',
receiverDistrict: '',
receiverAddress1: '',
receiverAddress2: '',
receiverPostCode: '',
},
})
const formRef = ref()
const rules = {
receiverName: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
receiverPhone: [{ required: true, message: '请输入电话', trigger: 'blur' }],
receiverCountry: [{ required: true, message: '请输入国家', trigger: 'blur' }],
receiverProvince: [{ required: true, message: '请输入省/州', trigger: 'blur' }],
receiverCity: [{ required: true, message: '请输入市', trigger: 'blur' }],
receiverAddress1: [{ required: true, message: '请输入地址1', trigger: 'blur' }],
receiverPostCode: [{ required: true, message: '请输入邮政编码', trigger: 'blur' }],
}
const submitForm = async () => {
formRef?.value.validate(async (valid: boolean) => {
if (valid) {
await updateAddressApi(form.value as never)
visible.value = false
emits('success')
await ElMessageBox.alert('请修改/刷新地址后取消物流重新创建物流订单、获取跟踪号、获取打印面单。', '提示', {
type: 'warning',
confirmButtonText:'确定',
cancelButtonText:'取消',
showCancelButton: true,
})
}
})
}
</script>
<template>
<el-dialog
v-model="visible"
:close-on-click-modal="false"
title="修改揽收信息"
width="50%"
>
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="姓名" prop="receiverName">
<el-input v-model="form.receiverName" clearable placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="电话" prop="receiverPhone">
<el-input v-model="form.receiverPhone" clearable placeholder="请输入电话" />
</el-form-item>
<el-form-item label="国家" prop="receiverCountry">
<el-select v-model="form.receiverCountry" clearable filterable>
<el-option
v-for="it in countryList" :key="it.countryCode" :label="it.countryCode"
:value="it.countryCode"></el-option>
</el-select>
</el-form-item>
<el-form-item label="省/州" prop="receiverProvince">
<el-input v-model="form.receiverProvince" clearable placeholder="请输入省/州" />
</el-form-item>
<el-form-item label="市" prop="receiverCity">
<el-input v-model="form.receiverCity" clearable placeholder="请输入市" />
</el-form-item>
<el-form-item label="区/县" prop="receiverDistrict">
<el-input v-model="form.receiverDistrict" clearable placeholder="请输入区/县" />
</el-form-item>
<el-form-item label="地址1" prop="receiverAddress1">
<el-input v-model="form.receiverAddress1" clearable placeholder="请输入地址1" />
</el-form-item>
<el-form-item label="地址2" prop="receiverAddress2">
<el-input v-model="form.receiverAddress2" clearable placeholder="请输入地址2" />
</el-form-item>
<el-form-item label="邮政编码" prop="receiverPostCode">
<el-input v-model="form.receiverPostCode" clearable placeholder="请输入邮政编码" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="visible=false">取消</el-button>
<el-button type="primary" @click="submitForm">提交</el-button>
</template>
</el-dialog>
</template>
<style scoped lang="scss">
</style>
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
style="width: 160px" style="width: 160px"
> >
<img <img
:src="`../../../src/assets/${item.icon}`" :src="`/images/icon/${item.icon.split('/').pop()}`"
style="height: 20px; margin: 5px 10px 0 0" style="height: 20px; margin: 5px 10px 0 0"
/> />
<span :title="item.type">{{ item.type }}</span> <span :title="item.type">{{ item.type }}</span>
...@@ -145,7 +145,21 @@ ...@@ -145,7 +145,21 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="物流类型">
<ElSelect
v-model="searchForm.shipmentType"
placeholder="物流类型"
clearable
style="width: 130px"
>
<ElOption
v-for="(item, index) in ['自有物流', '工厂物流']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem> <ElFormItem>
<ElButton type="primary" @click="search">查询</ElButton> <ElButton type="primary" @click="search">查询</ElButton>
</ElFormItem> </ElFormItem>
...@@ -230,6 +244,15 @@ ...@@ -230,6 +244,15 @@
</div> </div>
</div> </div>
<div class="operation-box mb-10"> <div class="operation-box mb-10">
<span v-if="status === 'PICKING'" class="item">
<ElButton
:loading="downloadLoading"
type="primary"
@click="downloadTif"
>
排版
</ElButton>
</span>
<span v-if="status === 'TO_BE_CONFIRMED'" class="item"> <span v-if="status === 'TO_BE_CONFIRMED'" class="item">
<ElButton type="success" @click="confirmOrder"> 确认 </ElButton> <ElButton type="success" @click="confirmOrder"> 确认 </ElButton>
</span> </span>
...@@ -237,6 +260,14 @@ ...@@ -237,6 +260,14 @@
<ElButton type="success" @click="updateOrder"> 转至待确认 </ElButton> <ElButton type="success" @click="updateOrder"> 转至待确认 </ElButton>
</span> </span>
<span <span
v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 3"
class="item"
>
<ElButton type="success" @click="asyncOrderAddress">
同步收货地址
</ElButton>
</span>
<span
v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 1" v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 1"
class="item" class="item"
> >
...@@ -354,6 +385,7 @@ ...@@ -354,6 +385,7 @@
v-loading="loading" v-loading="loading"
element-loading-text="加载中..." element-loading-text="加载中..."
class="table-wrapper flex-1 flex-column overflow-hidden" class="table-wrapper flex-1 flex-column overflow-hidden"
@contextmenu.prevent="(v) => rightClick(v)"
> >
<TableView <TableView
ref="tableRef" ref="tableRef"
...@@ -573,6 +605,12 @@ ...@@ -573,6 +605,12 @@
</el-icon> </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-value">
{{ ['自有物流', '工厂物流'][row.shipmentType] }}
</span>
</div>
<div class="order-detail-item">
<span class="order-detail-item-label">物流跟踪号:</span> <span class="order-detail-item-label">物流跟踪号:</span>
<span class="order-detail-item-value"> <span class="order-detail-item-value">
<el-button <el-button
...@@ -740,6 +778,9 @@ ...@@ -740,6 +778,9 @@
</div> </div>
</div> --> </div> -->
</template> </template>
<template #exceptionReason="{row}">
<div v-html="row.exceptionReason"></div>
</template>
<template #innerLabel="{ row }"> <template #innerLabel="{ row }">
<div v-if="row.internalMemoList" class="inner-label-box"> <div v-if="row.internalMemoList" class="inner-label-box">
<div <div
...@@ -757,7 +798,17 @@ ...@@ -757,7 +798,17 @@
</template> </template>
<template #operate="{ row }"> <template #operate="{ row }">
<div class="operate-box"> <div class="operate-box">
<span class="operate-item"> <span
class="operate-item"
style="display: flex; flex-direction: column"
>
<ElButton
link
type="primary"
@click="operationLog(row.id, null)"
>
操作日志
</ElButton>
<ElButton <ElButton
v-if="!row.expressSheet && row.status === 'TO_BE_CONFIRMED'" v-if="!row.expressSheet && row.status === 'TO_BE_CONFIRMED'"
link link
...@@ -767,11 +818,26 @@ ...@@ -767,11 +818,26 @@
确认 确认
</ElButton> </ElButton>
<ElButton <ElButton
v-if="
row.shipmentType === 1 &&
['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status)
"
link link
type="primary" type="primary"
@click="operationLog(row.id, null)" @click="handleUpdateAddress(row)"
> >
操作日志 修改地址
</ElButton>
<ElButton
v-if="
row.shipmentType === 0 &&
['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status)
"
link
type="primary"
@click="handleRefreshAddress(row)"
>
刷新地址
</ElButton> </ElButton>
</span> </span>
</div> </div>
...@@ -915,11 +981,18 @@ ...@@ -915,11 +981,18 @@
></ElPagination> ></ElPagination>
</div> </div>
</div> </div>
<right-menu <RightClickMenu
ref="rightMenuRef" ref="rightMenuRef"
:show-copy-shop-number="false" :show-copy-count="false"
@change="rightChange" :show-copy-sub-shop-number="false"
/> @on-change="rightChange"
>
<template #default
><div class="menu-item" @click="rightChange('order-number')">
复制订单号
</div>
</template>
</RightClickMenu>
<el-dialog <el-dialog
v-model="confirmDialogShow" v-model="confirmDialogShow"
:close-on-click-modal="false" :close-on-click-modal="false"
...@@ -1073,8 +1146,8 @@ ...@@ -1073,8 +1146,8 @@
:title="wayDialogTitle" :title="wayDialogTitle"
> >
<el-table <el-table
v-loading="isChangeWayLoading"
ref="changeWayRef" ref="changeWayRef"
v-loading="isChangeWayLoading"
height="400px" height="400px"
class="production-client-table" class="production-client-table"
:data="logisticsWayData" :data="logisticsWayData"
...@@ -1130,7 +1203,13 @@ ...@@ -1130,7 +1203,13 @@
</el-button> </el-button>
</template> </template>
</el-dialog> </el-dialog>
<UpdateAddress
v-if="updateAddVisible"
v-model:form="currentRow"
v-model:visible="updateAddVisible"
:country-list="countryList"
@success="search"
></UpdateAddress>
<ElDialog <ElDialog
v-model="exceptionDialogVisible" v-model="exceptionDialogVisible"
title="转为异常单" title="转为异常单"
...@@ -1219,14 +1298,19 @@ import { ...@@ -1219,14 +1298,19 @@ import {
getTrackingNumberApi, getTrackingNumberApi,
getfaceSimplexFileApi, getfaceSimplexFileApi,
cancelLogisticsOrderApi, cancelLogisticsOrderApi,
composingDesignImages,
changeLogisticsApi, changeLogisticsApi,
createLogisticsOrderApi, createLogisticsOrderApi,
updateLogisticsToPickingApi, updateLogisticsToPickingApi,
createLogisticsOrdersApi, createLogisticsOrdersApi,
syncReceiverAddress,
refreshAddressApi,
AddressInfo,
// handleExceptionOrderApi, // handleExceptionOrderApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import UpdateAddress from './components/updateAddress.vue'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
import { getAllCountryApi } from '@/api/logistics.ts'
import TableView from '@/components/TableView.vue' import TableView from '@/components/TableView.vue'
import { import {
LogListData, LogListData,
...@@ -1250,7 +1334,7 @@ import PodMakeOrder from './PodMakeOrder.vue' ...@@ -1250,7 +1334,7 @@ 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'
import rightMenu from '../pod/rightMenu.vue' import RightClickMenu from '@/components/RightClickMenu.vue'
import ResultInfo from './components/ResultInfo.vue' import ResultInfo from './components/ResultInfo.vue'
import { isArray, isString } from '@/utils/validate' import { isArray, isString } from '@/utils/validate'
import platformJson from '../../../json/platform.json' import platformJson from '../../../json/platform.json'
...@@ -1269,8 +1353,10 @@ declare global { ...@@ -1269,8 +1353,10 @@ declare global {
} }
} }
const tabsNav = ref<Tab[]>() const tabsNav = ref<Tab[]>()
const updateAddVisible = ref(false)
const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null) const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null)
const confirmDialogShow = ref(false) const confirmDialogShow = ref(false)
const downloadLoading = ref(false)
const isChangeWay = ref(false) const isChangeWay = ref(false)
const confirmData = ref([]) const confirmData = ref([])
const logisticsWayData = ref([]) const logisticsWayData = ref([])
...@@ -1281,6 +1367,7 @@ const detailData = ref({}) ...@@ -1281,6 +1367,7 @@ const detailData = ref({})
const [searchForm] = useValue<SearchForm>({ const [searchForm] = useValue<SearchForm>({
timeType: null, timeType: null,
shopNumber: '', shopNumber: '',
shipmentType: '',
userMark: '', userMark: '',
logisticsTracking: '', logisticsTracking: '',
baseSku: '', baseSku: '',
...@@ -1295,6 +1382,18 @@ const [searchForm] = useValue<SearchForm>({ ...@@ -1295,6 +1382,18 @@ const [searchForm] = useValue<SearchForm>({
platform: '', platform: '',
productionClient: '', productionClient: '',
}) })
const countryList = ref([])
const currentRow = ref<AddressInfo>({
receiverName: '',
receiverPhone: '',
receiverCountry: '',
receiverProvince: '',
receiverCity: '',
receiverDistrict: '',
receiverAddress1: '',
receiverAddress2: '',
receiverPostCode: '',
})
const exceptionStatus = ref(1) const exceptionStatus = ref(1)
const userMarkList = ref<string[]>([]) const userMarkList = ref<string[]>([])
const selection = ref<PodUsOrderListData[]>([]) const selection = ref<PodUsOrderListData[]>([])
...@@ -1353,7 +1452,34 @@ const getDateRange = (days = 0, type: 'past' | 'future' = 'past') => { ...@@ -1353,7 +1452,34 @@ const getDateRange = (days = 0, type: 'past' | 'future' = 'past') => {
type === 'past' ? end.subtract(days, 'day') : end.add(days, 'day') type === 'past' ? end.subtract(days, 'day') : end.add(days, 'day')
return [start.startOf('day').toDate(), end.endOf('day').toDate()] return [start.startOf('day').toDate(), end.endOf('day').toDate()]
} }
const handleRefreshAddress = async (row: PodUsOrderListData) => {
try {
await showConfirm('确定刷新地址吗?', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
await refreshAddressApi([row.id])
await ElMessageBox.alert(
'请修改/刷新地址后取消物流重新创建物流订单、获取跟踪号、获取打印面单。',
'提示',
{
type: 'warning',
confirmButtonText: '确定',
cancelButtonText: '取消',
showCancelButton: true,
},
)
}
const handleUpdateAddress = async (row: PodUsOrderListData) => {
const { data } = await getAllCountryApi()
countryList.value = data
currentRow.value = JSON.parse(JSON.stringify(row))
updateAddVisible.value = true
}
const getMonthRange = (months = 0, type: 'past' | 'future' = 'past') => { const getMonthRange = (months = 0, type: 'past' | 'future' = 'past') => {
const now = dayjs() const now = dayjs()
const start = const start =
...@@ -1401,6 +1527,12 @@ const tableColumns = computed(() => [ ...@@ -1401,6 +1527,12 @@ const tableColumns = computed(() => [
prop: 'innerLabel', prop: 'innerLabel',
}, },
{ {
label: '异常原因',
width: 300,
prop: 'exceptionReason',
slot: 'exceptionReason',
},
{
label: '操作', label: '操作',
slot: 'operate', slot: 'operate',
width: 180, width: 180,
...@@ -1414,8 +1546,6 @@ const rightClick = (e: MouseEvent) => { ...@@ -1414,8 +1546,6 @@ const rightClick = (e: MouseEvent) => {
rightMenuRef.value.setPosition({ rightMenuRef.value.setPosition({
x: e.clientX, x: e.clientX,
y: e.clientY, y: e.clientY,
cardItem: e.clientY,
el: e,
}) })
} }
...@@ -1426,6 +1556,44 @@ const handleSelectionChange = (val: PodUsOrderListData[]) => { ...@@ -1426,6 +1556,44 @@ const handleSelectionChange = (val: PodUsOrderListData[]) => {
stockOutSuccessIds.value = [] stockOutSuccessIds.value = []
} }
} }
const asyncOrderAddress = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
try {
await showConfirm('确定同步收货地址吗?', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
const ids = selection.value.map((item) => item.id)
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await syncReceiverAddress(ids)
if (res.code !== 200) return
await ElMessageBox.alert('同步收货地址成功,请刷新查看。', '提示', {
type: 'warning',
confirmButtonText: '确定',
cancelButtonText: '取消',
showCancelButton: true,
})
search()
await loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const changeTab = (item: Tab) => { const changeTab = (item: Tab) => {
status.value = item.status || '' status.value = item.status || ''
selection.value = [] selection.value = []
...@@ -1601,6 +1769,21 @@ const confirmOrder = async () => { ...@@ -1601,6 +1769,21 @@ const confirmOrder = async () => {
productionClientValue.value = '' productionClientValue.value = ''
productionClientVisible.value = true productionClientVisible.value = true
} }
const downloadTif = async () => {
if (!selection.value.length) {
return ElMessage.warning('请选择数据')
}
downloadLoading.value = true
try {
const res = await composingDesignImages(selection.value.map((el) => el.id))
window.open(filePath + res.message, '_blank')
downloadLoading.value = false
} catch (e) {
downloadLoading.value = false
}
}
const loadProductionClient = async () => { const loadProductionClient = async () => {
try { try {
const res = await getProductionClientApi() const res = await getProductionClientApi()
...@@ -1880,13 +2063,28 @@ const isSelectStatused = (data: ProductList) => { ...@@ -1880,13 +2063,28 @@ const isSelectStatused = (data: ProductList) => {
return index !== -1 return index !== -1
} }
const rightChange = async (code: string) => { const rightChange = async (code: string) => {
if (code === 'check_all') { const flat = status.value !== 'IN_PRODUCTION'
cardSelection.value = JSON.parse(JSON.stringify(tableData.value)) if (code === 'select-all') {
} else if (code === 'clear_check') { if (flat) {
cardSelection.value = [] tableRef.value?.toggleAllSelection()
} else if (code === 'copy_code') { } else {
const str = cardSelection.value cardSelection.value = JSON.parse(JSON.stringify(tableData.value))
.map((item) => item.factorySubOrderNumber) }
} else if (code === 'cancel-select') {
if (flat) {
tableRef.value?.clearSelection()
} else {
cardSelection.value = []
}
} else if (code === 'copy_shopNumber') {
const str = (tableData.value as ProductList[] | PodUsOrderListData[])
.map((item) => item?.shopNumber)
.join()
navigator.clipboard.writeText(str)
ElMessage.success('复制成功')
} else if (code === 'order-number') {
const str = (tableData.value as ProductList[] | PodUsOrderListData[])
.map((item) => item?.factoryOrderNumber)
.join() .join()
navigator.clipboard.writeText(str) navigator.clipboard.writeText(str)
ElMessage.success('复制成功') ElMessage.success('复制成功')
...@@ -2033,7 +2231,7 @@ const getOrderByIdApi = async (type: string) => { ...@@ -2033,7 +2231,7 @@ const getOrderByIdApi = async (type: string) => {
const res = await operation.Fn(ids) const res = await operation.Fn(ids)
if (res.code === 200) { if (res.code === 200) {
if (isArray(res.data)) { if (isArray(res.data)) {
resultInfo.value = res.data resultInfo.value = res.data || []
resultRefs.value?.showDialog(type) resultRefs.value?.showDialog(type)
} else if (isString(res.data)) { } else if (isString(res.data)) {
window.open(filePath + res.data) window.open(filePath + res.data)
...@@ -2043,6 +2241,7 @@ const getOrderByIdApi = async (type: string) => { ...@@ -2043,6 +2241,7 @@ const getOrderByIdApi = async (type: string) => {
} }
loading.close() loading.close()
} catch (e) { } catch (e) {
resultInfo.value = []
console.error(e) console.error(e)
} }
} else { } else {
...@@ -2245,10 +2444,13 @@ const logisticsToPicking = async () => { ...@@ -2245,10 +2444,13 @@ const logisticsToPicking = async () => {
ids: selection.value.map((item) => item.id).join(','), ids: selection.value.map((item) => item.id).join(','),
}) })
if (res.code !== 200) return if (res.code !== 200) return
resultInfo.value = res.data || []
resultRefs.value?.showDialog()
ElMessage.success('操作成功') ElMessage.success('操作成功')
search() search()
loadTabData() loadTabData()
} catch (e) { } catch (e) {
resultInfo.value = []
console.error(e) console.error(e)
} finally { } finally {
loading.close() loading.close()
...@@ -2756,6 +2958,13 @@ const handleExceptionCommand = (command: number) => { ...@@ -2756,6 +2958,13 @@ const handleExceptionCommand = (command: number) => {
} }
} }
} }
.operate-item {
.el-button {
margin-left: 0 !important;
margin-top: 20px !important;
}
}
</style> </style>
<style> <style>
.customize-select-style { .customize-select-style {
......
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