Commit 43607540 by wuqian

局部印对账

parent e3d872de
import { BasePaginationData, BaseRespData, RejectParams } from '@/types/api'
import axios from './axios'
import {PaymentForm} from '@/types/api/index.ts'
import { PaymentForm } from '@/types/api/index.ts'
import {
LogListData,
OrderData,
......@@ -16,9 +16,11 @@ import {
apiSubmitPodOrderForm,
DeliveryNoteData,
DeliveryNoteSearchForm,
DetailForm, LogListsData,
DetailForm,
LogListsData,
ProductionOrder,
ShipmentOrderDetailData, updatePriceForm,
ShipmentOrderDetailData,
updatePriceForm,
} from '@/types/api/deliveryNote'
import {
AccountStatementNote,
......@@ -366,11 +368,14 @@ export function exportExcelApi(ids: string) {
})
}
export function exportPodExcelApi(ids: string) {
return axios.get<never, BaseRespData<never>>('pod/podReconciliation/exportExcel', {
return axios.get<never, BaseRespData<never>>(
'pod/podReconciliation/exportExcel',
{
params: {
ids,
},
})
},
)
}
export function getShipmentDetailsById(data: DetailForm) {
return axios.post<never, BasePaginationData<BillOrderDetailData>>(
......@@ -382,12 +387,14 @@ export function apiupdateByPodExcel(formData: never) {
return axios.post('pod/podReconciliation/updateByExcel', formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
})
}
export function apiRejectedPodReconciliation(params?: RejectParams) {
return axios.post<never, BaseRespData<never>>('pod/podReconciliation/rejectedLocal', params)
return axios.post<never, BaseRespData<never>>(
'pod/podReconciliation/rejectedLocal',
params,
)
}
export function getPodShipmentDetailsById(data: DetailForm) {
return axios.post<never, BasePaginationData<BillOrderDetailData>>(
......@@ -396,27 +403,45 @@ export function getPodShipmentDetailsById(data: DetailForm) {
)
}
export function apiLogList(id?: number) {
return axios.get<never,BaseRespData<LogListsData[]>>('pod/podReconciliation/getLog', { params:{id} })
return axios.get<never, BaseRespData<LogListsData[]>>(
'pod/podReconciliation/getLog',
{ params: { id } },
)
}
export function apiItemLogList(id?: number) {
return axios.get<never,BaseRespData<LogListsData[]>>('pod/podReconciliation/getItemLog', { params:{id} })
return axios.get<never, BaseRespData<LogListsData[]>>(
'pod/podReconciliation/getItemLog',
{ params: { id } },
)
}
export function apiSubmitPodOrder(params: apiSubmitPodOrderForm) {
return axios.get<never, BaseRespData<ShipmentOrderDetailData>>('pod/podReconciliation/create', { params })
return axios.get<never, BaseRespData<ShipmentOrderDetailData>>(
'pod/podReconciliation/create',
{ params },
)
}
export function apiPodBillSubmit(ids: number[]) {
return axios.post<never, BaseRespData<ShipmentOrderDetailData>>('pod/podReconciliation/submission', {ids})
return axios.post<never, BaseRespData<ShipmentOrderDetailData>>(
'pod/podReconciliation/submission',
{ ids },
)
}
export function apiPodUpdatePrice(data:updatePriceForm) {
return axios.get<never, BaseRespData<never>>('pod/podReconciliation/updatePrice', { params:data })
export function apiPodUpdatePrice(data: updatePriceForm) {
return axios.get<never, BaseRespData<never>>(
'pod/podReconciliation/updatePrice',
{ params: data },
)
}
export function updateRecPrice(data:updatePriceForm) {
return axios.get<never, BaseRespData<never>>('pod/podReconciliation/updateRecPrice', { params:data })
export function updateRecPrice(data: updatePriceForm) {
return axios.get<never, BaseRespData<never>>(
'pod/podReconciliation/updateRecPrice',
{ params: data },
)
}
export function getLogListApi(id?: number) {
......@@ -426,9 +451,12 @@ export function getLogListApi(id?: number) {
}
export function getPodLogListApi(id?: number) {
return axios.get<never, BaseRespData<LogList[]>>('pod/podReconciliation/getLog', {
return axios.get<never, BaseRespData<LogList[]>>(
'pod/podReconciliation/getLog',
{
params: { id },
})
},
)
}
export function auditOrderApi(url: string, data: string) {
return axios.get(url, {
......@@ -453,11 +481,34 @@ export function confirmOrderApi(data: ConfirmOrderForm) {
}
export function confirmPodOrderApi(data: ConfirmOrderForm) {
return axios.post<never, BaseRespData<never>>('pod/podReconciliation/confirm', data)
return axios.post<never, BaseRespData<never>>(
'pod/podReconciliation/confirm',
data,
)
}
export function apiBillPodPayment(data:PaymentForm) {
return axios.get<never, BaseRespData<never>>('pod/podReconciliation/payment', { params:data })
export function apiRejectionOfReview({
ids,
description,
recNumbers,
}: {
ids: string
recNumbers: string
description: string
}) {
return axios.post<never, BaseRespData<never>>(
'pod/podReconciliation/rejectionOfReview',
{
ids,
description,
recNumbers,
},
)
}
export function apiBillPodPayment(data: PaymentForm) {
return axios.post<never, BaseRespData<never>>(
'pod/podReconciliation/payment',
data,
)
}
export function rejectOrderApi({
ids,
......@@ -474,4 +525,3 @@ export function rejectOrderApi({
pass,
})
}
......@@ -29,6 +29,7 @@ export interface AccountStatementNote {
pass_num?: number
factory_code?: string
total_amount?: string | number
actual_amount?: string | number
num?: number
end_time?: string
rec_number?: string
......@@ -43,6 +44,9 @@ export interface AccountStatementNote {
id?: number
erp_total_amount?: number
dataVersion: ''
water_list?: {
url: string | undefined
}[]
}
export interface BillOrderDetailData {
create_time?: string
......@@ -69,11 +73,11 @@ export interface LogList {
create_time?: string
info_id?: number
id: string
diy_id: number;
employee_account?: string;
employee_name?: string;
employee_id?: string;
description?: string;
diy_id: number
employee_account?: string
employee_name?: string
employee_id?: string
description?: string
}
export interface ItemList {
......@@ -95,5 +99,5 @@ export interface ItemList {
export interface ConfirmOrderForm {
pass?: number | null
description?: string
ids?:string
ids?: string
}
......@@ -183,21 +183,29 @@ export interface DbFactory {
status?: number
}
export interface LogListsData {
id: number;
diy_id: number;
employee_account?: string;
employee_name?: string;
employee_id?: string;
description?: string;
create_time?: string;
id: number
diy_id: number
employee_account?: string
employee_name?: string
employee_id?: string
description?: string
create_time?: string
}
export interface LogListData {
id?: string | number | null
infoId?: number
employeeId?: number
employeeAccount?: string
description?: string
createTime?: string
}
export interface DetailForm {
billNumber?: string
orderNumber?:string
shipmentNumber?:string
dateRange?:string[]
endTime?:string
startTime?:string
orderNumber?: string
shipmentNumber?: string
dateRange?: string[]
endTime?: string
startTime?: string
subOrderNumber?: string
rows?: number
page?: number
......@@ -205,15 +213,15 @@ export interface DetailForm {
infoId?: number
}
export interface BillForm {
timeRange: [string, string] | [];
timeRange: [string, string] | []
}
export interface apiSubmitPodOrderForm {
startDate?: string;
endDate?: string;
startDate?: string
endDate?: string
}
export interface updatePriceForm {
ids?: string;
infoId?: number;
price?: string;
ids?: string
infoId?: number
price?: string
}
export interface BaseRespData<D> {
code: number
message?: string
......@@ -31,19 +30,20 @@ export type BasePaginationData<D> = BaseRespData<PaginationData<D>>
export type StatisticsData<D> = BaseRespData<Statistics<D>>
export interface baseRes {
code:number
msg:string
code: number
msg: string
}
export interface PaymentForm{
export interface PaymentForm {
waterList: string
id?:number | string
actualAmount?:number | string
payableAmount?:number | 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 RejectParams {
id: number
description?: string
ids?: string
pass?: number
}
......@@ -23,13 +23,13 @@
</ElTree>
</div>
<div class="right">
<pending-reconciliation v-if="nodeId===0"></pending-reconciliation>
<div v-else class="delivery-note-page flex-column card h-100 overflow-hidden">
<!-- <pending-reconciliation></pending-reconciliation> -->
<div class="delivery-note-page flex-column card h-100 overflow-hidden">
<splitDiv size="50">
<template #top>
<div class="header-filter-form">
<ElForm :model="searchForm" inline>
<ElFormItem label="账期">
<ElFormItem label="账期(发货时间)">
<div style="display: flex">
<el-date-picker
v-model="dateRange"
......@@ -82,16 +82,15 @@
</ElForm>
</div>
<div class="btn-list">
<el-button
<!-- <el-button
v-if="nodeId === 10"
type="primary"
@click="confirmOrder"
@click="confirmOrder()"
>
确认对账单
</el-button>
确认
</el-button> -->
<el-button
v-if="nodeId === 10"
v-if="nodeId === 15"
type="warning"
@click="rejectOrder"
>
......@@ -146,7 +145,7 @@
show-overflow-tooltip
></el-table-column>
<el-table-column
label="账期"
label="账期(发货时间)"
header-align="center"
align="center"
min-width="340"
......@@ -156,7 +155,7 @@
</template>
</el-table-column>
<el-table-column
label="工厂总价格(¥)"
label="工厂结算总价(¥)"
header-align="center"
prop="product_total_amount"
width="130"
......@@ -164,15 +163,6 @@
show-overflow-tooltip
>
</el-table-column>
<!-- <el-table-column
label="ERP总价格"
header-align="center"
prop="erp_total_amount"
width="120"
align="center"
show-overflow-tooltip
>
</el-table-column> -->
<el-table-column
label="工艺总价(¥)"
header-align="center"
......@@ -219,7 +209,10 @@
style="display: flex; gap: 2px; align-items: center"
>
<div
v-for="item in row.water_list.split(',')"
v-for="item in (typeof row.water_list === 'string'
? row.water_list
: ''
).split(',')"
:key="item"
style="width: 30px"
>
......@@ -228,38 +221,6 @@
</div>
</template>
</el-table-column>
<!-- <el-table-column
label="客户"
prop="name"
width="90"
header-align="center"
align="center"
show-overflow-tooltip
/> -->
<!-- <el-table-column
label="状态"
prop="status"
width="90"
header-align="center"
align="center"
show-overflow-tooltip
>
<template #default="scope">
{{ getTabsList(scope.row.status) }}
</template>
</el-table-column> -->
<!-- <el-table-column
label="ERP状态"
prop="erp_status"
width="90"
header-align="center"
align="center"
show-overflow-tooltip
>
<template #default="scope">
{{ getTabsList(scope.row.erp_status) }}
</template>
</el-table-column> -->
<el-table-column
label="总发货(件)"
header-align="center"
......@@ -269,34 +230,6 @@
show-overflow-tooltip
>
</el-table-column>
<!-- <el-table-column
label="质检通过(件)"
header-align="center"
prop="pass_num"
width="120"
align="center"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="质检不通过(件)"
header-align="center"
prop="not_pass_num"
width="130"
align="center"
show-overflow-tooltip
>
</el-table-column> -->
<!-- <el-table-column
label="物流运费"
header-align="center"
prop="factory_total_amount"
width="120"
align="center"
show-overflow-tooltip
>
</el-table-column> -->
<el-table-column
label="创建时间"
prop="create_time"
......@@ -305,22 +238,6 @@
align="center"
show-overflow-tooltip
/>
<!-- <el-table-column
label="开始时间"
prop="start_time"
width="180"
header-align="center"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="结束时间"
prop="end_time"
width="180"
header-align="center"
align="center"
show-overflow-tooltip
/> -->
<el-table-column
label="操作"
width="100"
......@@ -331,15 +248,23 @@
<template #default="{ row }">
<div>
<el-button
v-if="row.status===20"
v-if="row.status === 10"
type="success"
size="small"
@click="confirmOrder(row)"
>
确认
</el-button>
</div>
<div>
<el-button
v-if="row.status === 20"
type="success"
link
size="small"
@click="onPayment(row)"
>付款
</el-button
>
</el-button>
</div>
</template>
</el-table-column>
</ElTable>
......@@ -406,31 +331,32 @@
<el-form-item>
<el-button type="primary" @click="searchDetail"
>查询
</el-button
>
</el-button>
</el-form-item>
<el-form-item>
<el-button
v-if="nodeId===1"
v-if="[0, 1].some((id) => id === Number(nodeId))"
type="primary"
@click="priceModification(1)"
>修改工厂价格
</el-button
>
>修改工厂结算价格
</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="nodeId===1" type="warning" @click="priceModification(3)"
<el-button
v-if="[0, 1].some((id) => id === Number(nodeId))"
type="warning"
@click="priceModification(3)"
>修改工艺价格
</el-button
>
</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="nodeId===1" type="primary" @click="priceModification(4)"
<el-button
v-if="[0, 1].some((id) => id === Number(nodeId))"
type="primary"
@click="priceModification(4)"
>修改物流价格
</el-button
>
</el-button>
</el-form-item>
</el-form>
<div class="table-wrap">
<ElTable
......@@ -438,7 +364,8 @@
:data="detailList"
height="100%"
border
@selection-change="handleDetailSelectionChange">
@selection-change="handleDetailSelectionChange"
>
<el-table-column
type="selection"
width="70"
......@@ -453,64 +380,72 @@
type="index"
/>
<el-table-column
label="发货单号"
prop="shipment_number"
label="生产单号"
prop="factory_sub_order_number"
header-align="center"
align="center"
min-width="160"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="单号"
prop="factory_order_number"
label="店铺单号"
prop="shop_number"
header-align="center"
align="center"
min-width="160"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="发货数(件)"
prop="shipment_num"
label="客户"
prop="user_mark"
header-align="center"
align="center"
min-width="160"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="工厂价格(¥)"
prop="cost_price"
label="订单号"
prop="factory_order_number"
header-align="center"
align="center"
min-width="160"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="工艺价格(¥)"
prop="craft_price"
label="发货数(件)"
prop="shipment_num"
header-align="center"
align="center"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="工厂结算单价(¥)"
prop="cost_price"
header-align="center"
align="center"
min-width="160"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="物流价格(¥)"
prop="carriage_amount"
label="工艺单价(¥)"
prop="craft_price"
header-align="center"
align="center"
min-width="160"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="生产单号"
prop="factory_sub_order_number"
label="物流单价(¥)"
prop="carriage_amount"
header-align="center"
align="center"
min-width="160"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="店铺单号"
prop="shop_number"
label="发货单号"
prop="shipment_number"
header-align="center"
align="center"
min-width="160"
......@@ -541,30 +476,6 @@
show-overflow-tooltip
></el-table-column>
<el-table-column
label="客户"
prop="user_mark"
header-align="center"
align="center"
min-width="160"
show-overflow-tooltip
></el-table-column>
<!-- <el-table-column
label="ERP订单号"
prop="erp_order_number"
header-align="center"
align="center"
min-width="160"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="erp子单号"
prop="erp_sub_order_number"
header-align="center"
align="center"
min-width="160"
show-overflow-tooltip
></el-table-column> -->
<el-table-column
label="baseSKU"
prop="base_sku"
header-align="center"
......@@ -641,8 +552,7 @@
<template #default="{ row }">
{{ row.shipping_way == 1 ? '送货上门' : '快递' }}
</template>
</el-table-column
>
</el-table-column>
<el-table-column
label="运费(¥)"
prop="carriage_amount"
......@@ -723,44 +633,6 @@
min-width="180"
show-overflow-tooltip
></el-table-column>
<el-table-column
show-overflow-tooltip
align="center"
fixed="right"
header-align="center"
label="操作"
width="120">
<template #default="{row}">
<el-button type="primary" link @click="showLog(row)">操作日志</el-button>
</template>
</el-table-column>
<!-- <ElTableColumn
show-overflow-tooltip
align="center"
header-align="center"
label="操作"
width="120"
>
<template #default="scope">
<div class="flex items-center justify-center gap-2">
<img
v-if="type === 'draft'"
@click="handleDetail(scope.row, 'edit')"
src="../../../assets/images/edit1.png"
width="24"
title="编辑"
style="cursor: pointer"
/>
<img
src="../../../assets/images/view.png"
title="查看详情"
width="24"
style="cursor: pointer"
@click="handleDetail(scope.row, 'view')"
/>
</div>
</template>
</ElTableColumn> -->
</ElTable>
</div>
......@@ -791,10 +663,10 @@
style="display: flex"
>
<span style="display: inline-block">
{{ item.create_time }}
{{ item.createTime }}
</span>
<span style="margin: 0 5px 0 20px">{{
item.employee_account
item.employeeAccount
}}</span>
<span style="display: inline-block">{{
item.description
......@@ -808,19 +680,6 @@
</div>
</div>
</div>
<el-dialog v-model="logDialogVisible" title="操作日志" width="30%">
<ul style="color: #333; font-size: 12px; height: 100%; overflow: auto">
<li v-for="(item, index) in logList" :key="index" style="display: flex">
<span style="display: inline-block; width: 23%">
{{ item.create_time }}
</span>
<div style="display: inline-block; width: 80%">
<span style="word-break: normal"> {{ item.employee_name }}:</span>
<span v-html="item.description"></span>
</div>
</li>
</ul>
</el-dialog>
<!-- 付款 -->
<el-dialog
v-model="paymentDialogVisible"
......@@ -844,7 +703,8 @@
{
required: true,
message: '请输入实付金额',
},{
},
{
type: 'number',
message: '实付金额需要为数字',
},
......@@ -881,18 +741,13 @@
class="close-bill"
@click="paymentForm.waterList.splice(index, 1)"
>
<CircleClose
/>
<CircleClose />
</el-icon>
</div>
</template>
<div class="img-item">
<el-icon
style="width: 100%; height: 100%"
@click="toUpload"
>
<Plus
/>
<el-icon style="width: 100%; height: 100%" @click="toUpload">
<Plus />
</el-icon>
</div>
</div>
......@@ -904,64 +759,84 @@
<el-button type="primary" @click="handlePayment">确定</el-button>
</template>
</el-dialog>
<ElDrawer
v-model="shipmentOrderDetailDrawerVisible"
title="发货单详情"
size="50%"
>
<shipmentOrderDetailInfo :detail="shipmentOrderDetail" />
</ElDrawer>
<ElDialog
v-model="confirmOrderVisible"
title="确认对账单"
width="500px"
width="70%"
:close-on-click-modal="false"
>
<ElForm ref="auditFormRef" :model="auditForm" label-width="80px">
<ElFormItem
label="意见"
prop="pass"
:rules="[{ required: true, message: '请选择' }]"
<el-row>
<el-col :span="6"> 对账单号:{{ currentRow?.rec_number }} </el-col>
<el-col :span="12">
账期(发货时间) {{ currentRow?.start_time }} -
{{ currentRow?.end_time }}
</el-col>
<el-col :span="6">
工厂结算总价() {{ currentRow?.product_total_amount }}
</el-col>
</el-row>
<el-row style="margin: 10px 0">
<el-col :span="6">
工艺总价(){{ currentRow?.craft_total_amount }}
</el-col>
<el-col :span="6">
物流总价() {{ currentRow?.carriage_total_amount }}
</el-col>
<el-col :span="6"> 应付金额(){{ currentRow?.total_amount }} </el-col>
<el-col :span="6"> 实付金额(){{ currentRow?.actual_amount }} </el-col>
</el-row>
<el-row style="margin: 10px 0">
<el-col :span="6" v-if="currentRow?.water_list">
水单:
<span
v-for="item in (typeof currentRow?.water_list === 'string'
? currentRow.water_list
: ''
).split(',')"
:key="item"
style="width: 30px"
>
<ElRadioGroup v-model="auditForm.pass">
<ElRadio :label="1">通过</ElRadio>
<ElRadio :label="0">不通过</ElRadio>
</ElRadioGroup>
</ElFormItem>
<ImageView :src="item" />
</span>
</el-col>
<el-col :span="6"> 总发货() {{ currentRow?.num }} </el-col>
<el-col :span="6"> 创建时间: {{ currentRow?.create_time }} </el-col>
</el-row>
<div></div>
<ElForm ref="auditFormRef" :model="auditForm" label-width="80px">
<ElFormItem
label="审核意见"
label="驳回原因"
prop="description"
:rules="
auditForm.pass === 0
? [{ required: true, message: '请输入审核意见' }]
: []
"
:rules="[{ required: true, message: '请输入驳回原因' }]"
>
<ElInput v-model="auditForm.description" type="textarea" />
</ElFormItem>
</ElForm>
<template #footer>
<span class="dialog-footer">
<el-button @click="confirmOrderVisible = false">取消</el-button>
<el-button type="primary" @click="submitConfirmOrder">确认</el-button>
<!-- <el-button @click="confirmOrderVisible = false">取消</el-button> -->
<el-button type="success" @click="submitConfirmOrder(1)"
>确认</el-button
>
<el-button type="danger" @click="submitConfirmOrder(2)">驳回</el-button>
</span>
</template>
</ElDialog>
</template>
<script setup lang="ts">
import { ElMessage, ElRadioGroup, ElTable, ElTree, TableColumnCtx } from 'element-plus'
import { ElMessage, ElTable, ElTree, TableColumnCtx } from 'element-plus'
import splitDiv from '@/components/splitDiv/splitDiv.vue'
import { CircleClose, Plus } from '@element-plus/icons-vue'
import pendingReconciliation from './pendingReconciliation.vue'
// import pendingReconciliation from './pendingReconciliation.vue'
import usePageList from '@/utils/hooks/usePageList'
import { useValue } from '@/utils/hooks/useValue'
import BigNumber from 'bignumber.js'
import {
apiBillPodPayment,
apiItemLogList,
auditOrderApi,
confirmPodOrderApi,
apiRejectionOfReview,
exportPodExcelApi,
getPodLogListApi,
getPodShipmentDetailsById,
......@@ -977,13 +852,11 @@ import {
AccountStatementNoteSearchForm,
CountStatus,
ItemList,
LogList,
} from '@/types/api/billOrder.ts'
import { DetailForm, LogListsData, ShipmentOrderDetailData } from '@/types/api/deliveryNote'
import shipmentOrderDetailInfo from '@/components/ShipmentOrderDetail.vue'
} from '@/types/api/billOrder'
import { DetailForm, LogListData } from '@/types/api/deliveryNote'
import ImageView from '@/components/ImageView.vue'
import { showConfirm } from '@/utils/ui'
import { uploadImageApi } from '@/api/common.ts'
// import { showConfirm } from '@/utils/ui'
import { uploadImageApi } from '@/api/common'
// import { getUserMarkList } from '@/api/auth.ts'
interface Tree {
......@@ -1007,15 +880,13 @@ interface PaymentForm {
payableAmount?: number | string
}
const logList = ref<(LogList | LogListsData)[]>([])
const logDialogVisible = ref<boolean>(false)
const logList = ref<LogListData[]>([])
// const nameSpaceList = ref<string[]>([])
const treeData = ref<CountStatus[]>()
const [searchForm, resetSearchForm] = useValue<AccountStatementNoteSearchForm>(
{},
)
const paymentFormRef = ref()
const uploadLoading = ref(false)
const dateRange = ref<string[]>([])
......@@ -1032,10 +903,14 @@ const paymentForm = ref<PaymentForm>({
id: '',
actualAmount: '',
payableAmount: '',
})
const nodeId = ref<number | string>(0)
const getSelectionsProperty = (property: keyof AccountStatementNote) => {
return selections.value
.map((el: AccountStatementNote) => el[property])
.join(',')
}
const nodeId = ref<number | string>(0)
const treeRef = ref<InstanceType<typeof ElTree>>()
const {
currentPage,
......@@ -1056,15 +931,19 @@ const {
},
page,
pageSize,
).then((res) => res.data) as never,
).then((res) => res.data),
})
watch(()=>tableData.value,()=>{
(tableData.value as AccountStatementNote[]).forEach((item)=>{
watch(
() => tableData.value,
() => {
;(tableData.value as AccountStatementNote[]).forEach((item) => {
item.total_amount = computedPrice(item)
})
},{immediate:true,deep:true})
},
{ immediate: true, deep: true },
)
const reset = () => {
dateRange.value =[]
dateRange.value = []
resetSearchForm()
}
const priceModification = (type: 1 | 3 | 4) => {
......@@ -1072,8 +951,7 @@ const priceModification = (type: 1 | 3 | 4) => {
ElMessage.warning('至少选择一条对账单')
return
}
const pricePrompts: Record<1 | 3 | 4, { title: string; param: string }> =
{
const pricePrompts: Record<1 | 3 | 4, { title: string; param: string }> = {
1: { title: '修改工厂价格', param: 'costPrice' },
3: { title: '修改工艺价格', param: 'craftPrice' },
4: { title: '修改物流价格', param: 'carriageAmount' },
......@@ -1088,14 +966,14 @@ const priceModification = (type: 1 | 3 | 4) => {
cancelButtonText: '取消',
inputPattern: /\d+/,
inputErrorMessage: '请输入数字',
}).then(async ({ value }) => {
}).then(async ({ value }: { value: string }) => {
const price = parseFloat(value)
if (isNaN(price) || price < 0) {
ElMessage.error('价格必须为大于等于0的数字')
return
}
await updateRecPrice({
ids: detailSelections.value.map(item => item.id).join(),
ids: detailSelections.value.map((item: ItemList) => item.id).join(),
...{ [promptConfig.param]: price },
infoId: currentRow.value?.id,
})
......@@ -1116,33 +994,29 @@ const onPayment = async (item: AccountStatementNote) => {
paymentFormRef.value && paymentFormRef.value.clearValidate()
paymentDialogVisible.value = true
}
const handlePayment = async () => {
try {
await paymentFormRef.value?.validate()
} catch {
return
}
if(Number(paymentForm.value.actualAmount)<=0){
if (Number(paymentForm.value.actualAmount) <= 0) {
return ElMessage.warning('实付金额需大于等于0')
}
await apiBillPodPayment({
...paymentForm.value,
waterList: paymentForm.value.waterList
.map((item) => item.url)
.map((item: { url: string | undefined }) => item.url)
.join(','),
id: currentRow.value?.id,
recNumber: currentRow.value?.rec_number,
})
ElMessage.success('付款成功')
paymentDialogVisible.value = false
search()
await getTreeNum()
}
const showLog = async (row: ItemList) => {
const res = await apiItemLogList(row.id)
logList.value = res.data || []
logDialogVisible.value = true
}
const handleWaterBill = async (e: Event) => {
const files = (e.target as HTMLInputElement).files || []
const request = []
......@@ -1157,7 +1031,6 @@ const handleWaterBill = async (e: Event) => {
try {
const res = await Promise.all(request)
for (const item of res) {
console.log(item)
const { filePath, code } = item
if (code === 500) {
ElMessageBox.alert('上传失败', '系统提示', { type: 'error' })
......@@ -1216,7 +1089,8 @@ const tabsClick = async () => {
const computedPrice = (row: AccountStatementNote) => {
return new BigNumber(row.product_total_amount || 0)
.plus(new BigNumber(row.carriage_total_amount || 0))
.plus(new BigNumber(row.craft_total_amount || 0)).toString()
.plus(new BigNumber(row.craft_total_amount || 0))
.toString()
}
const toUpload = () => {
const input = document.createElement('input')
......@@ -1224,7 +1098,7 @@ const toUpload = () => {
input.type = 'file'
input.multiple = true
input?.click()
input.onchange = function(e:Event) {
input.onchange = function (e: Event) {
handleWaterBill(e)
}
}
......@@ -1252,10 +1126,10 @@ const getSummaries = (param: SummaryMethodProps) => {
}
sums[index] = values
.reduce((prev: BigNumber, curr: number) => {
const value = new BigNumber(curr);
return prev.plus(value); // 直接处理 BigNumber 类型
const value = new BigNumber(curr)
return prev.plus(value) // 直接处理 BigNumber 类型
}, new BigNumber(0))
.toString();
.toString()
},
)
......@@ -1263,7 +1137,6 @@ const getSummaries = (param: SummaryMethodProps) => {
}
const confirmOrderVisible = ref<boolean>(false)
const auditForm = ref({
pass: 1,
description: '',
})
const auditFormRef = ref()
......@@ -1288,7 +1161,9 @@ const auditOrder = (key: string) => {
confirmButtonText: '确定',
type: 'warning',
}).then(async () => {
const ids = selections.value.map((el) => el.id).join(',')
const ids = selections.value
.map((el: AccountStatementNote) => el.id)
.join(',')
await auditOrderApi(url, ids)
ElMessage.success('操作成功')
search()
......@@ -1307,10 +1182,15 @@ const rejectOrder = () => {
customClass: 'reject',
inputErrorMessage: '请输入驳回原因',
inputPlaceholder: '驳回原因',
}).then(async ({ value }) => {
const ids = selections.value.map((el) => el.id).join(',')
}).then(async ({ value }: { value: string }) => {
const ids = getSelectionsProperty('id')
const recNumbers = getSelectionsProperty('rec_number')
try {
await confirmPodOrderApi({ ids: ids, description: value, pass: 0 })
await apiRejectionOfReview({
ids: ids,
description: value,
recNumbers: recNumbers,
})
ElMessage.success('操作成功')
search()
await getTreeNum()
......@@ -1319,55 +1199,40 @@ const rejectOrder = () => {
}
})
}
const confirmOrder = async () => {
if (selections.value.length === 0) {
return ElMessage.warning('请选择要操作的数据')
}
try {
await showConfirm('是否确认对账单?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
const ids = selections.value.map((el) => el.id).join(',')
try {
await confirmPodOrderApi({
ids,
})
confirmOrderVisible.value = false
ElMessage.success('操作成功')
search()
await getTreeNum()
} catch (e) {
console.error(e)
}
// confirmOrderVisible.value = true
// auditForm.value = {
// pass: 1,
// description: '',
// }
// await nextTick()
// auditFormRef.value!.clearValidate()
const confirmOrder = async (item: AccountStatementNote) => {
currentRow.value = item
confirmOrderVisible.value = true
}
interface ConfirmOrderPayload {
ids: string
description?: string
pass?: number
}
const submitConfirmOrder = async () => {
const submitConfirmOrder = async (type: number) => {
// const ids = selections.value
// .map((el: AccountStatementNote) => el.id)
// .join(',')
let apiPayload: ConfirmOrderPayload = { ids: `${currentRow.value?.id}` }
if (type === 1) {
// 确认操作
await confirmPodOrderApi(apiPayload)
} else {
// 驳回操作
try {
await auditFormRef.value?.validate()
} catch {
return
return // 验证失败,终止操作
}
const ids = selections.value.map((el) => el.id).join(',')
await confirmPodOrderApi({
...auditForm.value,
pass: auditForm.value.pass === 0 ? 0 : undefined,
description:
auditForm.value.description === ''
? undefined
: auditForm.value.description,
ids,
})
apiPayload = {
...apiPayload,
description: auditForm.value.description,
pass: 0,
}
await confirmPodOrderApi(apiPayload)
}
confirmOrderVisible.value = false
ElMessage.success('操作成功')
search()
......@@ -1392,13 +1257,10 @@ watch(
)
const nodeClick = (data: Tree) => {
nodeId.value = data.code ?? ''
if (data.code !== 0) {
// if (data.code !== 0) {
search()
}
// }
}
const shipmentOrderDetailDrawerVisible = ref(false)
const shipmentOrderDetail = ref({} as ShipmentOrderDetailData)
const detailForm = ref({} as DetailForm)
const detailPager = ref({
page: 1,
......@@ -1417,7 +1279,6 @@ const searchDetail = async () => {
})
detailList.value = res.data.records || []
detailPager.value.total = res.data.total
// logList.value = res.data.logList || []
} catch (e) {
console.error(e)
}
......@@ -1426,7 +1287,6 @@ const getLogList = async () => {
try {
const res = await getPodLogListApi(currentRow.value?.id)
logList.value = res.data
// logList.value = res.data.logList || []
} catch (e) {
console.error(e)
}
......@@ -1435,7 +1295,9 @@ const exportExcel = async () => {
if (selections.value.length !== 1) {
return ElMessage.warning('请选择一条数据')
}
const ids = selections.value.map((el) => el.id).join(',')
const ids = selections.value
.map((el: AccountStatementNote) => el.id)
.join(',')
try {
const res = await exportPodExcelApi(ids)
window.open(res.data)
......@@ -1522,7 +1384,8 @@ $border: solid 1px #ddd;
}
.dialog-footer {
text-align: center;
display: flex;
justify-content: center;
}
.delivery-note-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