Commit 04886f0f by zhuzhequan

pod修改

parent 8e1db597
...@@ -183,3 +183,21 @@ export function updateRemarkApi(id: number, remark: string) { ...@@ -183,3 +183,21 @@ export function updateRemarkApi(id: number, remark: string) {
}, },
) )
} }
export function getInProductionCount(productionFileId: unknown, baseSku: unknown) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderProduct/getInProductionCount',
{
productionFileId,
baseSku
},
)
}
export function getWaitShipmentCount(productionFileId: unknown, baseSku: unknown) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderProduct/getWaitShipmentCount',
{
productionFileId,
baseSku
},
)
}
<template> <template>
<div class="table-view"> <div class="table-view">
<ElTable <ElTable
ref="tableRef"
:data="paginatedData" :data="paginatedData"
border border
:stripe="stripe" :stripe="stripe"
...@@ -10,6 +11,7 @@ ...@@ -10,6 +11,7 @@
> >
<template v-for="column in columns" :key="column.key"> <template v-for="column in columns" :key="column.key">
<ElTableColumn <ElTableColumn
v-if=" v-if="
column.type === 'index' || column.type === 'index' ||
column.type === 'selection' || column.type === 'selection' ||
...@@ -20,23 +22,26 @@ ...@@ -20,23 +22,26 @@
> >
<!-- 当type等于expand时, 配置通过h函数渲染、txs语法或者插槽自定义内容 --> <!-- 当type等于expand时, 配置通过h函数渲染、txs语法或者插槽自定义内容 -->
<template #default="scope"> <template #default="scope">
<component <div @contextmenu.prevent="(e)=>$emit('rightClick',e)">
:is="column.render" <component
v-if="column.render" :is="column.render"
:row="scope.row" v-if="column.render"
:index="scope.$index" :row="scope.row"
/> :index="scope.$index"
<slot />
v-else-if="column.slot" <slot
name="expand" v-else-if="column.slot"
:row="scope.row" name="expand"
:index="scope.$index" :row="scope.row"
></slot> :index="scope.$index"
></slot>
</div>
</template> </template>
</ElTableColumn> </ElTableColumn>
<RenderColumn v-else :col="column"> <RenderColumn v-else :col="column">
<template v-for="(_, name) of slots" #[name]="scope"> <template v-for="(_, name) of slots" #[name]="scope">
<slot :name="name" v-bind="scope" /> <slot @contextmenu.prevent="(e)=>$emit('rightClick',e)" :name="name" v-bind="scope" />
</template> </template>
</RenderColumn> </RenderColumn>
</template> </template>
...@@ -44,9 +49,11 @@ ...@@ -44,9 +49,11 @@
</div> </div>
</template> </template>
<script setup lang="tsx" generic="T"> <script setup lang="tsx" generic="T">
import { type Slot, useAttrs, useSlots, type PropType } from 'vue' 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'
const tableRef = shallowRef<InstanceType<typeof ElTable>>();
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
defineProps({ defineProps({
paginatedData: { paginatedData: {
...@@ -64,6 +71,10 @@ defineProps({ ...@@ -64,6 +71,10 @@ defineProps({
}) })
const attrs = useAttrs() const attrs = useAttrs()
const slots = useSlots() as Record<string, Slot> const slots = useSlots() as Record<string, Slot>
defineExpose({
tableRef
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<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="show_copy_shop_number" @click="$emit('change', 'copy_shopNumber')">复制选中店铺单号</button>
<button v-if="show_copy_shop_number" @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({
show_copy_shop_number:{
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>
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