Commit 10c1edcf by linjinhong

Merge remote-tracking branch 'origin/master' into linjinhong

parents e22d350f 84ed5778
......@@ -6,6 +6,7 @@
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const ElInput: typeof import('element-plus/es')['ElInput']
const ElLoading: typeof import('element-plus/es')['ElLoading']
const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
......
......@@ -7,10 +7,10 @@ export {}
declare module 'vue' {
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']
DatePicker: typeof import('./src/components/Form.vue/DatePicker.vue')['default']
DateRangePicker: typeof import('./src/components/Form.vue/DateRangePicker.vue')['default']
DatePicker: typeof import('./src/components/Form/DatePicker.vue')['default']
DateRangePicker: typeof import('./src/components/Form/DateRangePicker.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
......@@ -49,6 +49,8 @@ declare module 'vue' {
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
......@@ -59,11 +61,11 @@ declare module 'vue' {
RenderColumn: typeof import('./src/components/RenderColumn.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
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']
SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default']
'Switch ': typeof import('./src/components/Form.vue/Switch .vue')['default']
TableRightMenu: typeof import('./src/components/TableRightMenu.vue')['default']
'Switch ': typeof import('./src/components/Form/Switch .vue')['default']
TableRightClickMenu: typeof import('./src/components/TableRightClickMenu.vue')['default']
TableView: typeof import('./src/components/TableView.vue')['default']
UploadExcel: typeof import('./src/components/UploadExcel.vue')['default']
UploadImage: typeof import('./src/components/UploadImage.vue')['default']
......
......@@ -9,7 +9,7 @@ import { AddDeclarationRuleObj } from '@/views/logistics/types/declarationRule'
import { LogisticsQuotation } from '@/views/logistics/types/logisticsQuotation'
import { LogisticsPartitionObj } from '@/views/logistics/types/logisticsPartition'
import { ShippingAddressObj } from '@/views/logistics/types/shippingAddress'
import { IsortingInfo } from '@/types/api/logistics'
export interface ILogisticsList {
code: string
basicsName: string
......@@ -433,3 +433,37 @@ export function logisticsCompanyAllCodelist() {
'/logisticsCompany/allCodelist',
)
}
export function getsortingConfigListApi(
data: IsortingInfo,
currentPage: number,
pageSize: number,
) {
return axios.post<never, BasePaginationData<IsortingInfo>>(
'logistics/sortingConfig/list_page',
{
...data,
currentPage,
pageSize,
},
)
}
export function createSortingApi(data: IsortingInfo) {
return axios.post<never, BaseRespData<never>>(
'logistics/sortingConfig/add',
data,
)
}
export function updateSortingApi(data: IsortingInfo) {
return axios.post<never, BaseRespData<never>>(
'logistics/sortingConfig/update',
data,
)
}
export function deleteSortingApi(ids: string) {
return axios.get<never, BaseRespData<never>>(
'logistics/sortingConfig/delete',
{
params: { ids },
},
)
}
import { BasePaginationData, BaseRespData, RejectParams } from '@/types/api'
import { BasePaginationData, BaseRespData } from '@/types/api'
import axios from './axios'
import { PaymentForm } from '@/types/api/index.ts'
import {
LogListData,
OrderData,
......@@ -11,6 +10,8 @@ import {
ShipmentOrderRes,
Tab,
InspectionData,
PaymentForm,
RejectParams
} from '@/types/api/order'
import {
apiSubmitPodOrderForm,
......@@ -151,7 +152,7 @@ export function apiSetCraftData({
}: {
id: number | undefined
craftTotalPrice: number | undefined
recNumber:string|undefined
recNumber: string | undefined
craftPriceList: IUpdatePrice[]
}) {
return axios.post<never, BaseRespData<never>>(
......
......@@ -37,6 +37,12 @@ export function getOrderList(
},
)
}
export function handleExceptionOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/processExceptionOrders',
orderIds,
)
}
export function getCardOrderList(
params: SearchForm,
currentPage: number,
......@@ -80,14 +86,17 @@ export function updateExceptionOrderApi(data: number[]) {
},
)
}
export function changeExceptionOrderApi(ids: number[], value: string) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/exceptionOrders',
{
export function changeExceptionOrderApi(
url: string,
ids: number[],
type: string,
value: string,
) {
return axios.post<never, BaseRespData<never>>(url, {
orderIds: ids,
exceptionType: type,
exceptionReason: value,
},
)
})
}
export function cancelOrderApi(ids: number[], value: string) {
return axios.post<never, BaseRespData<never>>(
......
......@@ -314,9 +314,9 @@ export function InRecordBatchCheckPrintApi(ids: string) {
},
)
}
export function warehouseInRecordInventory(data: ExportInWarehouseInfo) {
export function warehouseInRecordExport(data: ExportInWarehouseInfo) {
return axios.post<never, BasePaginationData<never>>(
'factory/warehouseInRecord/inventory',
'factory/warehouseInRecord/export',
data,
)
}
......@@ -438,6 +438,20 @@ export function getInRecordLogApi(inRecordId?: number) {
)
}
// 出库单
export function warehouseOutRecordExport(data: ExportInWarehouseInfo) {
return axios.post<never, BasePaginationData<never>>(
'factory/warehouseOutRecord/export',
data,
)
}
export function OutRecordBatchCheckPrintApi(ids: string) {
return axios.get<never, BaseRespData<never[]>>(
'factory/warehouseOutRecord/batchCheckPrint',
{
params: { ids },
},
)
}
export function getOutRecordStatusTree() {
return axios.get<never, BaseRespData<InterWarehouseTree[]>>(
'factory/warehouseOutRecord/status_tree',
......
......@@ -2,12 +2,12 @@ import { defineComponent, PropType, ref, computed, h } from 'vue'
import type { Component } from 'vue'
import { ElInput, ElForm, ElFormItem } from 'element-plus'
import type { FormInstance } from 'element-plus'
import AmountInput from './Form.vue/AmountInput.vue' // 金额输入框
import DateRangePicker from './Form.vue/DateRangePicker.vue' // 时间范围选择器
import DatePicker from './Form.vue/DatePicker.vue' // 单个日期选择器
import Select from './Form.vue/Select.vue' // 普通下拉选择框
import Switch from './Form.vue/Switch .vue'
import './Form.vue/form.scss'
import AmountInput from './Form/AmountInput.vue' // 金额输入框
import DateRangePicker from './Form/DateRangePicker.vue' // 时间范围选择器
import DatePicker from './Form/DatePicker.vue' // 单个日期选择器
import Select from './Form/Select.vue' // 普通下拉选择框
import Switch from './Form/Switch .vue'
import './Form/form.scss'
import type { FormItemRule } from 'element-plus'
......
......@@ -10,6 +10,7 @@
mode="horizontal"
background-color="#001529"
text-color="#fff"
style="border-bottom: none;"
:default-active="defaultActive"
router
>
......@@ -86,8 +87,9 @@
>
<div class="nav-tabs-node_label">
<span>{{ item.title }}</span>
<!-- 首页不可删除 -->
<el-icon
v-if="tabs.length > 1"
v-if="item.path != '/dashboard' && tabs.length > 1"
class="el-icon-close"
@click.stop="removeTab(item.name)"
>
......
import { defineComponent, PropType, ref, computed, watch, h } from 'vue'
import type { Component } from 'vue'
import AmountInput from './Form.vue/AmountInput.vue' // 金额输入框
import DateRangePicker from './Form.vue/DateRangePicker.vue' // 时间范围选择器
import DatePicker from './Form.vue/DatePicker.vue' // 单个日期选择器
import Select from './Form.vue/Select.vue' // 普通下拉选择框
import AmountInput from './Form/AmountInput.vue' // 金额输入框
import DateRangePicker from './Form/DateRangePicker.vue' // 时间范围选择器
import DatePicker from './Form/DatePicker.vue' // 单个日期选择器
import Select from './Form/Select.vue' // 普通下拉选择框
import { ElInput, ElForm, ElFormItem, ElButton } from 'element-plus'
import {
ISearchForm,
......
<template>
<div
v-show="visible"
class="right-click-menu"
:style="{ left: position.x + 'px', top: position.y + 'px' }"
>
<div class="menu-item" @click="handleSelectAll">全选</div>
<div class="menu-item" @click="handleUnselectAll">取消全选</div>
<div class="menu-item" @click="onChangeCopy('shop-numbers')">
复制店铺单号
</div>
</div>
</template>
<script setup lang="ts">
import { ref, defineExpose, onMounted, onUnmounted } from 'vue'
import type { TableInstance } from 'element-plus'
const visible = ref(false)
const position = ref({ x: 0, y: 0 })
const tableRef = ref<TableInstance>()
const emit = defineEmits(['onChange'])
const setPosition = ({
x,
y,
el,
}: {
x: number
y: number
el: TableInstance
}) => {
position.value = { x, y }
visible.value = true
tableRef.value = el
}
const handleSelectAll = () => {
if (tableRef.value) {
tableRef.value.toggleAllSelection()
}
visible.value = false
}
const handleUnselectAll = () => {
if (tableRef.value) {
tableRef.value.clearSelection()
}
visible.value = false
}
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>
.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;
}
.menu-item {
padding: 8px 16px;
cursor: pointer;
font-size: 14px;
color: #606266;
}
.menu-item:hover {
background-color: #f5f7fa;
color: #409eff;
}
</style>
<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>
......@@ -8,6 +8,7 @@
v-bind="attrs"
header-align="center"
height="100%"
@contextmenu.prevent="handleContextMenu"
>
<ElTableColumn
v-if="selectionable"
......@@ -57,14 +58,20 @@
</RenderColumn>
</template>
</ElTable>
<RightClickMenu ref="rightMenuRef" @on-change="onChange" />
</div>
</template>
<script setup lang="tsx" generic="T">
import { type Slot, useAttrs, useSlots, type PropType, shallowRef } from 'vue'
import type { CustomColumn } from '@/types/table'
import RenderColumn from './RenderColumn.vue'
import RightClickMenu from './TableRightClickMenu.vue'
import { ElTable } from 'element-plus'
const tableRef = shallowRef<InstanceType<typeof ElTable>>()
import type { TableInstance } from 'element-plus'
const tableRef = shallowRef<TableInstance>()
const rightMenuRef = shallowRef<InstanceType<typeof RightClickMenu>>()
// eslint-disable-next-line @typescript-eslint/no-explicit-any
defineProps({
paginatedData: {
......@@ -88,14 +95,30 @@ defineProps({
default: false,
},
})
const attrs = useAttrs()
const slots = useSlots() as Record<string, Slot>
const emit = defineEmits(['onChange'])
const handleContextMenu = (e: MouseEvent) => {
if (rightMenuRef.value && tableRef.value) {
rightMenuRef.value.setPosition({
x: e.clientX,
y: e.clientY,
el: tableRef.value,
})
}
}
const onChange = (type: string) => {
emit('onChange', type)
}
const setCurrentRow = (row: T) => {
tableRef.value?.setCurrentRow(row)
}
const toggleRowSelection = (row: T, selected: boolean = true) => {
tableRef.value?.toggleRowSelection(row, selected)
}
const clearSelection = () => {
tableRef.value?.clearSelection()
}
......@@ -112,5 +135,6 @@ defineExpose({
.table-view {
height: 100%;
overflow: hidden;
position: relative;
}
</style>
[
{
"name": "Shopify",
"lowercase": "shopify",
"type": "SHOPIFY",
"icon": "images/icon/logo-1.png",
"cycle": "today",
"route": "store_profits_shopify"
},
{
"name": "AliExpress",
"lowercase": "aliExpress",
"type": "AE",
"icon": "./images/icon/logo-3.png",
"cycle": "today",
"route": "store_profits_aliexpress"
},
{
"name": "Amazon",
"lowercase": "amazon",
"type": "AMAZON",
"icon": "./images/icon/logo-2.png",
"cycle": "yesterday",
"route": "store_profits_amazon"
},
{
"name": "Magento",
"lowercase": "magento",
"type": "MAGENTO",
"icon": "./images/icon/logo-6.png",
"cycle": "today",
"route": "store_profits_magento"
},
{
"name": "SHOPLINE",
"lowercase": "shopline",
"type": "SHOPLINE",
"cycle": "today",
"icon": "./images/icon/logo-4.png",
"route": "store_profits_shopline"
},
{
"name": "Shoplazza",
"lowercase": "shoplazza",
"type": "SHOPLAZZA",
"cycle": "today",
"icon": "./images/icon/logo-5.png",
"route": "store_profits_shoplazza"
},
{
"name": "temu",
"lowercase": "temu",
"type": "TEMU",
"cycle": "today",
"icon": "./images/icon/temu.png",
"route": "store_profits_temu"
},
{
"name": "eBay",
"lowercase": "ebay",
"type": "EBAY",
"cycle": "today",
"icon": "./images/icon/eBay.png",
"route": "store_profits_ebay"
},
{
"name": "Etsy",
"lowercase": "etsy",
"type": "ETSY",
"cycle": "today",
"icon": "./images/icon/etsy.png",
"route": "store_profits_etsy"
},
{
"name": "Alibaba",
"lowercase": "alibaba",
"type": "ALIBABA",
"cycle": "today",
"icon": "./images/icon/alibaba.png",
"route": "store_profits_alibaba"
},
{
"name": "walmart",
"lowercase": "walmart",
"type": "WALMART",
"cycle": "today",
"icon": "images/icon/walmart.png",
"route": "store_profits_walmart"
},
{
"name": "tiktokshop",
"lowercase": "tiktok",
"type": "TIKTOK",
"cycle": "today",
"icon": "images/icon/tiktokshop.png",
"route": "store_profits_tiktokshop"
},
{
"name": "Customize",
"lowercase": "customize",
"type": "CUSTOMIZE",
"cycle": "today",
"icon": "images/icon/customize.png",
"route": "store_profits_customize"
},
{
"name": "1688",
"type": "ALIBABA_DOMESTIC",
"cycle": "today",
"icon": "images/icon/1688.png",
"route": "store_profits_1688"
}
]
......@@ -27,8 +27,8 @@ import WarehouseManage from '@/views/warehouse/manage.vue'
import WarehouseWarning from '@/views/warehouse/warning.vue'
import WarehousePosition from '@/views/warehouse/position.vue'
import receiptDoc from '@/views/warehouse/receiptDoc.vue'
import issueDoc from '@/views/warehouse/issueDoc.vue'
import ExternalAuthorisationPage from '@/views/system/externalAuthorisationPage.vue'
// import issueDoc from '@/views/warehouse/issueDoc.vue'
const router = createRouter({
history: createWebHistory(),
routes: [
......@@ -177,6 +177,13 @@ const router = createRouter({
component: () => import('@/views/logistics/logisticsCalculate.vue'),
},
{
path: '/logistics/sortingConfiguration',
meta: {
title: '分拣配置',
},
component: () => import('@/views/logistics/sortingConfiguration.vue'),
},
{
path: '/warehouse/manage',
meta: {
title: '仓库管理',
......@@ -190,13 +197,13 @@ const router = createRouter({
},
component: receiptDoc,
},
// {
// path: '/warehouse/issue-doc',
// meta: {
// title: '出库单',
// },
// component: issueDoc,
// },
{
path: '/warehouse/issue-doc',
meta: {
title: '出库单',
},
component: issueDoc,
},
{
path: '/warehouse/warning',
meta: {
......
......@@ -56,6 +56,11 @@ const menu: MenuItem[] = [
id: 6,
label: '运费试算',
},
{
index: '/logistics/sortingConfiguration',
id: 7,
label: '分拣配置',
},
],
},
{
......@@ -73,11 +78,11 @@ const menu: MenuItem[] = [
id: 123,
label: '入库单',
},
// {
// index: '/warehouse/issue-doc',
// id: 124,
// label: '出库单',
// },
{
index: '/warehouse/issue-doc',
id: 124,
label: '出库单',
},
{
index: '/warehouse/manage',
......
......@@ -35,17 +35,4 @@ export interface baseRes {
code: number
msg: string
}
export interface PaymentForm {
waterList: string
id?: number | string
actualAmount?: number | string
payableAmount?: number | string
recNumber?: number | string
}
export interface RejectParams {
id: number
description?: string
ids?: string
pass?: number
}
export interface Ilogistics {
id: number
name: string
warehouseId: number
warehouseName: string
uinuinWarehouseId: number | null
companyId: number | null
company: string | null
serviceCode: string
siteUrl: string
status: number
factoryId: number
createTime: string
updateTime: string | null
}
export interface IsortingInfo {
id?: number
sortingArea: number | null
sortingAreaName?: string | null
serviceCode: string | null
}
......@@ -81,7 +81,7 @@ export interface ProductList {
subOrderNumber?: string
shopNumber?: string
material?: string
materialPrice?: number|null
materialPrice?: number | null
count?: number
baseSku?: string
erpSubOrderNumber?: string
......@@ -277,3 +277,16 @@ export interface ICompareObjects {
lanshouPost?: string
lanshouRegion?: string
}
export interface PaymentForm {
waterList: string
id?: number | string
actualAmount?: number | string
payableAmount?: number | string
recNumber?: number | string
}
export interface RejectParams {
id: number
description?: string
ids?: string
pass?: number
}
......@@ -16,6 +16,9 @@ export interface SearchForm {
customizedQuantity: string
startTime: string | null
endTime: string | null
exceptionHandling: number | undefined
platform: string
productionClient:string
}
export interface PodUsOrderListData {
id: number
......
......@@ -5,6 +5,8 @@ export interface warehouseSearchForm {
billStatus?: string
createTimeEnd?: string
createTimeStart?: string
startTime?: string
endTime?: string
inNo?: string
outNo?: string
warehouseSku?: string
......@@ -14,6 +16,7 @@ export interface warehouseSearchForm {
export interface InterProductList {
createTime?: string
id?: number
inventoryId?: number | null
inId?: number
productNo?: string | null //custom的货号
buyStored?: number | null //入库数量
......@@ -42,6 +45,7 @@ export interface InterWarehouseBase {
total?: number
totalPrice?: number
billStatus?: string
billStatusTxt?: string
remark?: string | null
dataVersion?: number
createTime?: string | null
......@@ -86,6 +90,9 @@ export interface InterProductList {
warehouseSku?: string
locationId?: number | null
locationCode?: string | null
inventory?: {
usableInventory?: number
}
}
export interface InterskuList {
id?: number
......@@ -101,6 +108,7 @@ export interface InterskuList {
price?: number | null //出库单的
usableInventory?: number | null
warehouseSku?: string
remark?: string | null
}
export interface ILocation {
id?: number
......
......@@ -108,7 +108,6 @@ export function checkUpdateParams(
removeList = arr1.map((item) => item['id'] as IdType)
}
if (isBackKeyName) {
console.log(isBackKeyName)
// 将列表直接添加到 params 顶层
if (addList.length > 0) params['addList'] = addList || undefined
if (updateList.length > 0)
......
......@@ -271,9 +271,11 @@
v-loading="loading"
element-loading-text="加载中..."
class="order-list flex-1 overflow-hidden"
@contextmenu.prevent="handleContextMenu"
>
<ElTable
v-show="statusCode !== 6"
ref="tableRef"
:data="tableData"
:span-method="arraySpanMethod"
default-expand-all
......@@ -597,6 +599,7 @@
</ElTable>
<ElTable
v-show="statusCode === 6"
ref="tableQaRef"
:data="tableData"
:span-method="arraySpanMethod"
default-expand-all
......@@ -973,6 +976,12 @@
>
<OrderDetail :order-detail-data="orderDetailData" />
</ElDrawer>
<RightMenu
ref="rightMenuRef"
:show-copy-count="false"
:show-copy-sub-shop-number="statusCode !== 6"
@change="onChange"
/>
</template>
<script setup lang="ts">
import Shipment from './Shipment.vue'
......@@ -990,7 +999,12 @@ import type {
} from '@/types/api/order'
import { nextTick, onMounted, reactive, ref } from 'vue'
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 {
getOrderList,
......@@ -1023,6 +1037,7 @@ import OrderDetail from './OrderDetail.vue'
import useShipment from './hook/useShipment'
import useQuarantine from './hook/useQuarantine'
import Quarantine from './Quarantine.vue'
import RightMenu from './pod/rightMenu.vue'
const [searchForm] = useValue<SearchForm>({
mainSku: '',
......@@ -1644,7 +1659,65 @@ const cancelOrder = async (id: number) => {
// 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 onChange = (key: string) => {
if (key === 'check_all') {
if (statusCode.value === 6) {
tableQaRef.value?.toggleAllSelection()
} else {
tableRef.value?.toggleAllSelection()
}
} else if (key === 'clear_check') {
if (statusCode.value === 6) {
tableQaRef.value?.clearSelection()
} else {
tableRef.value?.clearSelection()
}
} else if (key === 'copy_code') {
const shopNumberList: string[] = []
for (const item of selection.value) {
item.productList?.forEach((el) => {
if (el.shopNumber) {
shopNumberList.push(el.shopNumber)
}
})
}
copy(shopNumberList.join(','))
} else if (key === 'copy_shopNumber') {
const subOrderNumber: string[] = []
if (statusCode.value === 6) {
for (const item of selection.value) {
item.detailList?.forEach((el) => {
if (el.shopNumber) {
subOrderNumber.push(el.shopNumber || '')
}
})
}
} else {
for (const item of selection.value) {
item.productList?.forEach((el) => {
if (el.subOrderNumber) {
subOrderNumber.push(el.subOrderNumber)
}
})
}
}
copy(subOrderNumber.join(','))
} else if (key === 'count') {
const count = selection.value.length
copy(count.toString())
}
}
const onChangeCurrentRow = (item: ProductList) => {
currentRow.value = item
}
......
......@@ -231,7 +231,12 @@
v-if="['TO_BE_CONFIRMED', 'IN_PRODUCTION'].includes(status)"
class="item"
>
<ElButton :loading="syncLoading" type="warning" is-dark @click="synchronousPlan">
<ElButton
:loading="syncLoading"
type="warning"
is-dark
@click="synchronousPlan"
>
同步素材图</ElButton
>
</span>
......@@ -548,7 +553,6 @@
{{ cardItem?.productionFileId }}
</span>
</el-tooltip>
</a>
</el-col>
<el-col
......@@ -594,7 +598,7 @@
default-expand-all
:span-method="arraySpanMethod"
@selection-change="handleSelectionChange"
@contextmenu.prevent="handleContextMenu"
@on-change="onChange"
>
<template #expand="{ row }">
<div v-if="row.productList" class="table-expand">
......@@ -974,6 +978,9 @@
:show-copy-shop-number="
['IN_PRODUCTION', 'TO_BE_CONFIRMED', 'WAIT_SHIPMENT'].includes(status)
"
:show-copy-count="
['IN_PRODUCTION', 'TO_BE_CONFIRMED', 'WAIT_SHIPMENT'].includes(status)
"
@change="rightChange"
/>
<fastProduction
......@@ -986,11 +993,6 @@
@on-success="handleSuccess"
@close="fastClose"
></fastProduction>
<table-right-menu
ref="tableRightMenuRef"
:table-right-menu-visible="tableRightMenuVisible"
@on-copy-change="onCopyChange"
/>
<el-dialog
v-model="completeShipmentVisible"
title="完成发货"
......@@ -1105,7 +1107,6 @@ import {
SearchForm,
Tab,
LogListData,
PodProductList,
cardImages,
imageAryInter,
......@@ -1825,7 +1826,9 @@ const synchronousPlan = async () => {
return
}
try {
const res = await syncSubOrderDesignImages(selection.value.map(item=>item.id))
const res = await syncSubOrderDesignImages(
selection.value.map((item) => item.id),
)
await loadDiffList()
await loadTabData()
syncLoading.value = false
......@@ -2161,10 +2164,8 @@ const invalidOrder = async (row: ProductList) => {
}
})
}
const tableRightMenuVisible = ref(false)
const tableRightMenuRef = ref()
const onCopyChange = (type: string) => {
if (type === 'copy_shop_number') {
const onChange = (type: string) => {
if (type === 'shop-numbers') {
const shopNumberList = []
for (const item of tableData.value) {
if (item.productList) {
......@@ -2174,16 +2175,6 @@ const onCopyChange = (type: string) => {
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 () => {
try {
......@@ -2208,7 +2199,6 @@ const openMaterial = async (item: PodProductList) => {
}
onMounted(async () => {
document.addEventListener('keydown', listenerKeydown)
document.addEventListener('click', listenerClick)
await loadTabData()
getUserMark()
getLogisticsList()
......@@ -2216,7 +2206,6 @@ onMounted(async () => {
})
onBeforeUnmount(() => {
document.removeEventListener('keydown', listenerKeydown)
document.removeEventListener('click', listenerClick)
})
</script>
<style lang="scss" scoped>
......@@ -2491,9 +2480,9 @@ onBeforeUnmount(() => {
display: flex;
align-items: center;
}
.over-hidden{
.over-hidden {
width: 150px;
display:inline-block;
display: inline-block;
white-space: nowrap;
overflow: hidden;
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', 'check_all')">全部选择</button>
<button @click="$emit('change', 'clear_check')">取消选择</button>
<button @click="$emit('change', 'copy_code')">复制选中生产单号</button>
<button v-if="showCopySubShopNumber" @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>
<button
v-if="showCopyShopNumber"
@click="$emit('change', 'copy_shopNumber')"
>
复制选中店铺单号
</button>
<button v-if="showCopyCount" @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
import { ref, defineProps, defineExpose } from 'vue'
interface E {
x: number
el: HTMLElement
y: number
}
defineProps({
showCopyShopNumber:{
type:Boolean,
default:true
}
showCopyShopNumber: {
type: Boolean,
default: true,
},
showCopyCount: {
type: Boolean,
default: true,
},
showCopySubShopNumber: {
type: Boolean,
default: true,
},
})
const row = ref()
const show = ref(false)
const right_menu = ref<HTMLElement>()
const close = ()=>{
const close = () => {
show.value = false
document.body.onclick = null
}
const setPosition = (o:E)=> {
const setPosition = (o: E) => {
console.log(o)
show.value = true
const clientX = o.x
......@@ -42,9 +57,8 @@ const setPosition = (o:E)=> {
document.body.onclick = function () {
close()
}
row.value =
setTimeout(() => {
if(!right_menu.value) return
row.value = setTimeout(() => {
if (!right_menu.value) return
if (x < 150) {
right_menu.value.style.cssText = `top:${o.y}px;right:${x}px`
} else {
......@@ -53,7 +67,7 @@ const setPosition = (o:E)=> {
}, 1)
}
defineExpose({
setPosition
setPosition,
})
</script>
<style scoped>
......@@ -89,7 +103,7 @@ defineExpose({
background: rgb(65, 192, 251);
color: white;
}
button{
button {
outline: none;
border: none;
}
......
......@@ -112,18 +112,16 @@ const submitExportForm = async () => {
return ElMessage.error('请选择导出类型')
}
exportLoading.value = true
let purchaseIds = ''
let purchaseIds: number[] = []
let exportTotal: number | undefined = undefined
const params: AnyObject = {}
const resourceType = Number(exportForm.value.resource)
if (resourceType === 0) {
purchaseIds = leftData.value.map((el: WarehouseWarning) => el.id).join(',')
purchaseIds = leftData.value.map((el: WarehouseWarning) => Number(el.id))
} else if (resourceType === 1) {
purchaseIds = selections.value
.map((el: WarehouseWarning) => el.id)
.join(',')
purchaseIds = selections.value.map((el: WarehouseWarning) => Number(el.id))
} else if (resourceType === 2) {
purchaseIds = ''
purchaseIds = []
exportTotal = pagination.value.total
}
params.idList = purchaseIds
......
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