Commit 3b4b818b by wuqian

导出

parent 389c0c09
......@@ -196,9 +196,9 @@ export function getPodJomallOrderByFactoryNumber(factoryOrderNumber: string) {
return axios.get<never, BaseRespData<OrderData>>(
'factory/podJomallOrder/getPodJomallOrderByFactoryNumber',
{
params:{
factoryOrderNumber
}
params: {
factoryOrderNumber,
},
},
)
}
......@@ -247,3 +247,9 @@ export function completeDeliveryApi(
{ productIdList, ...data },
)
}
export function exportStatementApi(data: SearchForm, status: string) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrder/exportPodJomallReconciliation',
{ ...data, status },
)
}
......@@ -220,7 +220,7 @@
'TO_BE_CONFIRMED',
'IN_PRODUCTION',
'PART_SHIPPING',
'WAIT_SHIPMENT'
'WAIT_SHIPMENT',
].includes(status)
"
class="item"
......@@ -252,6 +252,9 @@
申请补胚</ElButton
>
</span>
<span v-if="['COMPLETE'].includes(status)" class="item">
<ElButton type="success" @click="toExport"> 导出对账单</ElButton>
</span>
<span
v-if="['TO_BE_CONFIRMED', 'IN_PRODUCTION'].includes(status)"
class="item"
......@@ -1070,6 +1073,50 @@
</template>
</el-dialog>
<el-dialog
v-model="exportVisible"
title="导出对账单"
:close-on-click-modal="false"
width="500PX"
>
<div class="margin-top-20">
<ElForm
style="margin: 20px 0"
:model="shipForm"
label-width="120px"
size="small"
>
<ElRow :gutter="20">
<ElFormItem required label="实际交货时间">
<el-date-picker
v-model="exportTime"
:default-time="[
new Date(0, 0, 0, 0, 0, 0),
new Date(0, 0, 0, 23, 59, 59),
]"
placeholder="实际交货时间"
value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange"
style="width: 280px"
:shortcuts="pickerOptions.shortcuts"
start-placeholder="开始时间"
end-placeholder="结束时间"
clearable
>
</el-date-picker>
</ElFormItem>
</ElRow>
</ElForm>
</div>
<template #footer>
<div class="dialog-footer">
<el-button size="large" @click="exportVisible = false">取消 </el-button>
<el-button size="large" type="primary" @click="exportData"
>导出
</el-button>
</div>
</template>
</el-dialog>
<el-dialog
v-model="logVisible"
title="操作日志"
width="1000px"
......@@ -1196,6 +1243,7 @@ import {
syncSubOrderDesignImages,
applyForReplenishmentApi,
completeDeliveryApi,
exportStatementApi,
} from '@/api/podOrder'
import TableView from '@/components/TableView.vue'
import {
......@@ -1475,7 +1523,40 @@ const openDetail = async (id: number) => {
//showError(e)
}
}
const shipForm = ref({})
const exportVisible = ref(false)
const exportTime = ref<string[]>([])
const toExport = () => {
exportVisible.value = true
exportTime.value = []
}
const exportData = async () => {
if (!exportTime.value || exportTime.value.length === 0) {
return ElMessage.warning('请选择时间')
}
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
const params = {
startTime: exportTime.value[0],
endTime: exportTime.value[1],
...searchForm.value,
// tagIds: searchForm.value.tagIds.length > 0 ? searchForm.value.tagIds : null,
}
try {
const res = await exportStatementApi(params, status.value)
if (res.code !== 200) return
ElMessage.success('导出成功')
window.open(filePath + res.message)
exportVisible.value = false
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const saveCompleteShipment = async () => {
try {
await completeShipmentFormRef.value.validate()
......
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