Commit a925ab80 by zhuzhequan

ts 报错修改

parent 90b17694
import { BasePaginationData, BaseRespData } from '@/types/api'
import { BasePaginationData, BaseRespData, StatisticsData } from '@/types/api'
import axios from './axios'
import {
LogListData,
......@@ -9,9 +9,11 @@ import {
ShipmentForm,
ShipmentOrderRes,
Tab,
InspectionData,
InspectionData, CountStatus,
} from '@/types/api/order'
import {
AccountStatementNote,
AccountStatementNoteSearchForm,
DeliveryNoteData,
DeliveryNoteSearchForm,
ProductionOrder,
......@@ -187,11 +189,11 @@ export function getDeliveryNoteList(
)
}
export function customJomallReconciliation(
data: any,
data: AccountStatementNoteSearchForm,
currentPage: number,
pageSize: number,
) {
return axios.post<never, BasePaginationData<DeliveryNoteData>>(
return axios.post<never, StatisticsData<AccountStatementNote>>(
'factory/customJomallReconciliation/list_page',
{
...data,
......@@ -238,7 +240,7 @@ export function getOrderByIdApi(id?: number) {
)
}
export function getReconciliationAmount(id?: number) {
return axios.get<never, BaseRespData<OrderData>>(
return axios.get<never, BaseRespData<CountStatus[]>>(
'factory/customJomallReconciliation/getReconciliationAmount',
{
params: {
......@@ -276,7 +278,7 @@ export function updateReconciliation(
data,
)
}
export function getShipmentDetailsById(shipmentId?: number) {
export function getShipmentDetailsById(shipmentId?: string) {
return axios.get<never, BaseRespData<any>>(
'factory/customJomallReconciliation/getShipmentDetailsById',
{
......
......@@ -5,8 +5,8 @@ import 'splitpanes/dist/splitpanes.css'
defineProps({
size: {
default: 15,
type: Number
default: '15',
type: String
}
})
</script>
......
......@@ -10,6 +10,12 @@ export interface DeliveryNoteSearchForm {
namespace?: string
shippingWay?: number
}
export interface AccountStatementNoteSearchForm {
status?: string | null | number
startTime?: string
endTime?: string
}
export interface DeliveryNoteData {
id: number
......@@ -97,6 +103,7 @@ export interface ProductionOrder {
}
export interface AccountStatementNote{
billNumber?:string
shipmentId?:string
shipmentNum?:string
dataVersion?:string
carriageName?:string
......
export interface BaseRespData<D> {
code: number
message?: string
......@@ -5,10 +6,25 @@ export interface BaseRespData<D> {
}
export interface PaginationData<D> {
page?: PaginationData<D>
total: number
size: number
current: number
records: D[]
}
export interface Statistics<D> {
sumNotPassNum: number
sumPassNum: number
sumShipmentNum: number
sumTotalPrice: number
page: {
total: number
size: number
current: number
records: D[]
}
}
export type BasePaginationData<D> = BaseRespData<PaginationData<D>>
export type StatisticsData<D> = BaseRespData<Statistics<D>>
......@@ -12,6 +12,7 @@ export interface SearchForm {
status?: number
subOrderNumber: string
}
export interface Tab {
status: string
statusCode: number
......@@ -19,6 +20,12 @@ export interface Tab {
quantity: number
}
export interface CountStatus {
count?: number
status?: number
totalSum?: number
}
export interface OrderData {
id: number
namespace?: string
......@@ -64,6 +71,7 @@ export interface OrderData {
moreable?: boolean
manuscriptStatus?: number
}
export interface ProductList {
id: number
customOrderId?: number
......@@ -101,6 +109,7 @@ export interface MemoList {
remark?: string
operatorTime?: string
}
export interface SpanMethodProps {
row: OrderData
column: TableColumnCtx<OrderData>
......@@ -216,3 +225,26 @@ export interface InspectionData {
version: number | string
passCount: number | string
}
export interface Reconciliation {
status: string | number | null
startTime: string
endTime: string,
billNumber?:string
shipmentId?:string
shipmentNum?:string
dataVersion?:string
carriageName?:string
lanshouAddress?:string
totalPrice?:string
passNum?:string
lanshouPost?:string
notPassNum?:string
lanshouRegion?:string
orderNumber?:string
lanshouName?:string
lanshouPhone?:string
logisticsTracking?:string
totalAmount?:string
id?:number
}
import { Ref, onMounted, ref, reactive } from 'vue'
import { Ref, onMounted, ref } from 'vue'
import { showError } from '../ui'
import type { PaginationData } from '@/types/api'
......@@ -21,7 +21,7 @@ export default function usePageList<T>(options: UsePageListOptions<T>) {
const total = ref(0)
const data = ref<T[]>([]) as Ref<T[]>
const statistics = ref(options.statistics || false)
const totalData = reactive({
const totalData = ref({
sumShipmentNum: 0,
sumPassNum: 0,
sumTotalPrice: 0,
......@@ -32,19 +32,20 @@ export default function usePageList<T>(options: UsePageListOptions<T>) {
try {
loading.value = true
// Promise 链式调用
let res:any = await query(currentPage.value, pageSize.value)
const res = await query(currentPage.value, pageSize.value)
if (statistics.value) {
totalData.sumNotPassNum = res.sumNotPassNum
totalData.sumPassNum = res.sumPassNum
totalData.sumShipmentNum = res.sumShipmentNum
totalData.sumTotalPrice = res.sumTotalPrice
res = res.page
}
totalData.value = res as never
total.value = res.page!.total
currentPage.value = res.page!.current
pageSize.value = res.page!.size
data.value = res.page!.records
}else{
total.value = res.total
currentPage.value = res.current
pageSize.value = res.size
data.value = res.records
}
} catch (error) {
showError(error)
} finally {
......
<template>
<div class="card flex-column h-100 overflow-hidden">
<split-div size="10">
<template #top>
<div class="header-filter">
<div class="header-filter-form">
<ElForm :model="searchForm" size="default" inline>
......@@ -8,7 +10,7 @@
v-model="searchForm.mainSku"
placeholder=" SKU"
clearable
style="width: 160px"
style="width: 130px"
@blur="searchForm.mainSku = searchForm.mainSku.trim()"
></ElInput>
</ElFormItem>
......@@ -17,7 +19,7 @@
v-model="searchForm.endProductId"
placeholder="请输入成品ID"
clearable
style="width: 160px"
style="width: 130px"
@blur="searchForm.endProductId = searchForm.endProductId.trim()"
></ElInput>
</ElFormItem>
......@@ -26,7 +28,7 @@
v-model="searchForm.subOrderNumber"
placeholder="生产单号"
clearable
style="width: 160px"
style="width: 130px"
@blur="
searchForm.subOrderNumber = searchForm.subOrderNumber.trim()
"
......@@ -37,7 +39,7 @@
v-model="searchForm.orderNumber"
placeholder="订单号"
clearable
style="width: 160px"
style="width: 130px"
@blur="searchForm.orderNumber = searchForm.orderNumber.trim()"
></ElInput>
</ElFormItem>
......@@ -46,7 +48,7 @@
v-model="searchForm.shopNumber"
placeholder="店铺单号"
clearable
style="width: 160px"
style="width: 130px"
@blur="searchForm.shopNumber = searchForm.shopNumber.trim()"
></ElInput>
</ElFormItem>
......@@ -55,7 +57,7 @@
v-model="searchForm.internalMemo"
placeholder="内部标签"
clearable
style="width: 160px"
style="width: 130px"
@blur="searchForm.internalMemo = searchForm.internalMemo.trim()"
></ElInput>
</ElFormItem>
......@@ -64,7 +66,7 @@
v-model="searchForm.logisticsTracking"
placeholder="物流跟踪号"
clearable
style="width: 160px"
style="width: 130px"
@blur="
searchForm.logisticsTracking =
searchForm.logisticsTracking.trim()
......@@ -76,7 +78,7 @@
v-model="searchForm.billNumber"
placeholder="发货单号"
clearable
style="width: 160px"
style="width: 130px"
@blur="searchForm.billNumber = searchForm.billNumber.trim()"
></ElInput>
</ElFormItem>
......@@ -85,7 +87,7 @@
v-model="searchForm.lanshouName"
placeholder="收货人"
clearable
style="width: 160px"
style="width: 130px"
></ElInput>
</ElFormItem>
<ElFormItem>
......@@ -111,6 +113,8 @@
</div>
</div>
</div>
</template>
<template #bottom>
<div class="order-content flex-1 flex-column overflow-hidden">
<!-- 操作按钮 -->
<div class="order-operate-btn">
......@@ -597,11 +601,13 @@
background
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin: 10px auto 0; text-align: right"
style="margin: 10px auto 10px; text-align: right"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
</split-div>
</div>
<el-dialog
v-model="shipmentVisible"
......@@ -721,7 +727,7 @@
<el-dialog
v-model="quarantineVisible"
title="质检"
width="1600px"
width="80%"
:close-on-click-modal="false"
@opened="onQaDialogOpened"
@close="onClose"
......@@ -763,6 +769,7 @@
</template>
<script setup lang="ts">
import Shipment from './Shipment.vue'
import SplitDiv from '@/components/splitDiv/splitDiv.vue'
import type {
SearchForm,
SpanMethodProps,
......@@ -1243,6 +1250,7 @@ const onChangeCurrentRow = (item: ProductList) => {
.order-content {
margin-top: 10px;
height: 100%;
}
.order-list {
......
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