Commit aeb4f4a5 by wuqian

生产中优化

parent 0704a9ce
......@@ -9,12 +9,33 @@ import {
LogListData,
} from '@/types/api/podOrder'
import { OrderData, ShipmentForm } from '@/types/api/order'
import { CardOrderData } from '@/types/api/podOrder'
export function getOrderTabData() {
return axios.get<never, BaseRespData<Tab[]>>(
'factory/podJomallOrder/findStateGroupList',
)
}
export function getOrderDetail(id: number) {
return axios.get<never, BaseRespData<CardOrderData>>(
'factory/podJomallOrderProduct/getSubOrderById',
{
params: {
id,
},
},
)
}
export function getSubOrderBySubOrderNumber(factorySubOrderNumber: string) {
return axios.get<never, BaseRespData<OrderData>>(
'factory/podJomallOrderProduct/getSubOrderBySubOrderNumber',
{
params: {
factorySubOrderNumber,
},
},
)
}
export function refreshJMProductInfo(data: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrder/refreshJomallPodProduct ',
......@@ -31,12 +52,21 @@ export function getOrderList(
{ ...data, currentPage, pageSize },
)
}
// 快捷生产完成
export function productionQueryApi(id: number) {
return axios.post<never, BasePaginationData<CardOrderData>>(
'factory/podJomallOrderProduct/completeDelivery',
{
id,
},
)
}
export function getCardOrderList(
data: SearchForm,
currentPage: number,
pageSize: number,
) {
return axios.post<never, BasePaginationData<OrderData>>(
return axios.post<never, BasePaginationData<CardOrderData>>(
'/factory/podJomallOrder/getSubListPage',
{ ...data, currentPage, pageSize },
)
......
......@@ -27,18 +27,13 @@
<script setup lang="ts">
import { PropType } from 'vue'
import type { TypesettingListData } from '../types/api/typesetting'
import { PodProductList } from '@/types/api/podOrder'
defineProps({
cardItem: {
type: Object as PropType<TypesettingListData>,
type: Object as PropType<PodProductList>,
required: true,
},
})
const copy = (text: string) => {
navigator.clipboard.writeText(text)
ElMessage.success('复制成功')
}
</script>
<style lang="scss" scoped>
......
......@@ -72,38 +72,6 @@ export interface OrderData {
manuscriptStatus?: number
factoryOrderNumber?: string | undefined
}
export interface CardOrderItem {
id: number;
podOrderId: number;
thirdSubOrderNumber: string;
factorySubOrderNumber: string;
shopNumber: string;
baseSku: string;
productName: string;
variantSku: string;
variantImage: string;
imageAry?: string | null;
designImages?: null;
process: string;
processName: string;
num: number;
shipmentNum: number;
costPrice: number;
price: number;
processPrice: number;
weight?: null;
version: number;
remark?: null;
createTime: string;
updateTime: string;
subOrderNumber?: null;
[propName: string]: string | number | boolean | undefined | unknown;
}
export interface cardImages{
ename?: string | null,
cname?: string | null,
image: string,
}
export interface ProductList {
id: number
customOrderId?: number
......@@ -129,6 +97,9 @@ export interface ProductList {
updateTime?: string
version?: string | number
passNum?: number
process?: string | null
processName?: string | null
remark?: string | null
notPassNum?: number
sendOutQuantity?: number
factoryOrderNumber?: string | undefined
......
......@@ -19,7 +19,7 @@ export interface SearchForm {
endTime?: string | null
internalMemo?: string
}
export interface OrderData {
export interface CardOrderData {
id: number
moreable: boolean
thirdOrderNumber: string
......@@ -52,33 +52,68 @@ export interface OrderData {
remark: string | null
userMark: string | null
namespace: string | null
productList: ProductList[]
productList: PodProductList[]
internalMemoList: string | null
[propName: string]: string | number | boolean | undefined | unknown
}
export interface ProductList {
export interface cardImages {
ename?: string | null
cname?: string | null
image: string
}
export interface imageAryInter {
sort: number
title?: string | null
url: string
}
export interface PodProductList {
id: number
podOrderId?: number
podOrderId: number
thirdSubOrderNumber?: string
factorySubOrderNumber?: string
factoryOrderNumber?: string | null
shopNumber?: string
supplierItemNo?: string | null
baseSku?: string
productName?: string
variantSku?: string
variantImage?: string
imageAry?: string
designImages?: string
process?: string
num?: number
imageAry?: string | imageAryInter[] | null
images?: cardImages[] | null
designImages?: string | null
process?: string | null
podProcessName?: string | null
productionFileId?: string | null
customizedQuantity?: number
num?: number | string
shipmentNu?: number
costPrice?: number
price?: number
processPrice?: number
weight?: number
version?: number
remark?: string
weight?: number | null
version?: number | null
remark?: string | null
createTime?: string
updateTime?: string
[propName: string]: string | number | boolean | undefined | unknown
}
export interface ImageItemInter {
url: string
title?: string | null
sort: number
id?: number | string | null
}
export type ImgList = ImageItemInter[][]
export interface PodOrderRes extends PodProductList {
expectDeliveryTime?: string | null
startStockingTime?: string | null
userMark?: string | null
color?: string | null
size?: string | null
note?: Array<{ prop: string | number; value: string | number }>
imgList: ImgList
}
export interface ShipmentOrderRes {
factoryOrderNumber?: string
......
......@@ -13,17 +13,14 @@
</div>
<div class="order-list-expand_item_info">
<div
:title="item.productName || '--'"
:title="item?.productName || '--'"
class="order-list-expand_item_info_title"
style="font-weight: bold"
>
<span class="order-list-expand_item_label">商品名:</span>
<div class="order-list-expand_item_value">
{{ item.productName || '--' }}&emsp;
{{ item?.productName || '--' }}&emsp;
<img
src="@/assets/images/jiaji.svg"
alt=""
width="24"
v-show="
status == 4 &&
item?.num !== undefined &&
......@@ -34,6 +31,9 @@
0 &&
item.notPassNum > 0
"
src="@/assets/images/jiaji.svg"
alt=""
width="24"
/>
</div>
</div>
......@@ -131,18 +131,15 @@
>{{ item.material || '--' }}
</span>
</div>
<div
:title="(item as InterItem).remark || ''"
class="order-list-expand_item_info_title"
>
<div :title="item.remark || ''" class="order-list-expand_item_info_title">
<span class="order-list-expand_item_label">备注:</span>
<span class="order-list-expand_item_value"
>{{ (item as InterItem).remark || '--' }}
>{{ item.remark || '--' }}
</span>
<el-icon
class="icon"
style="color: #e6a23c"
@click="setRemarks(item.id, (item as InterItem).remark || '')"
@click="setRemarks(item.id, item.remark || '')"
><EditPen
/></el-icon>
</div>
......@@ -173,13 +170,13 @@
<div class="order-list-expand_item_info_title">
<span class="order-list-expand_item_label">工艺:</span>
<span class="order-list-expand_item_value">{{
item.processName || '--'
!isPod ? item?.processName || '--' : item?.process || '--'
}}</span>
</div>
<div class="order-list-expand_item_info_title">
<div v-if="!isPod" class="order-list-expand_item_info_title">
<span class="order-list-expand_item_label">工艺简称:</span>
<span class="order-list-expand_item_value">{{
item.process || '--'
item?.process || '--'
}}</span>
</div>
<div v-if="!isPod" class="order-list-expand_item_info_title">
......@@ -249,11 +246,6 @@ defineProps({
default: false,
},
})
interface InterItem {
id: number
remark?: string // 可选属性
[propName: string]: string | number | boolean | undefined | unknown // 额外属性
}
// 传递多个emit 带参数的事件
const emit = defineEmits<{
(e: 'update-remark', payload: { id: number; remark: string }): void
......
......@@ -203,26 +203,26 @@ export default function useShipment(callback?: () => void) {
try {
const res = await saveOrder(data, shipmentForm.value)
fetch(res.message || '')
.then((response) => {
// 确保响应是 OK
if (!response.ok) {
throw new Error('网络响应错误')
}
// 返回图片的二进制数据(Blob)
return response.blob()
})
.then((blob) => {
const a = document.createElement('a')
a.href = window.URL.createObjectURL(blob)
a.target = '_blank'
a.download = (res.message as string).split('/')[
(res.message as string).split('/').length - 1
]
a.click()
})
.catch((error) => {
console.error('下载图片时出错:', error)
})
// .then((response) => {
// // 确保响应是 OK
// if (!response.ok) {
// throw new Error('网络响应错误')
// }
// // 返回图片的二进制数据(Blob)
// return response.blob()
// })
// .then((blob) => {
// const a = document.createElement('a')
// a.href = window.URL.createObjectURL(blob)
// a.target = '_blank'
// a.download = (res.message as string).split('/')[
// (res.message as string).split('/').length - 1
// ]
// a.click()
// })
// .catch((error) => {
// console.error('下载图片时出错:', error)
// })
ElMessage.success('发货成功')
shipmentVisible.value = false
callback && callback()
......
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