Commit 538be545 by zhuzhequan

工厂对账

parent 18129ef3
......@@ -21,6 +21,7 @@ declare module 'vue' {
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
......@@ -32,14 +33,18 @@ declare module 'vue' {
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
Icon: typeof import('./src/components/Icon.vue')['default']
ImageView: typeof import('./src/components/ImageView.vue')['default']
LogList: typeof import('./src/components/LogList.vue')['default']
NavMenu: typeof import('./src/components/NavMenu.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default']
TableView: typeof import('./src/components/TableView.vue')['default']
}
export interface ComponentCustomProperties {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -15,10 +15,12 @@
"element-plus": "^2.6.0",
"lodash-es": "^4.17.21",
"pinia": "^2.1.7",
"splitpanes": "^3.1.5",
"vue": "^3.4.19",
"vue-router": "^4.3.0"
},
"devDependencies": {
"@types/splitpanes": "^2.2.6",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@vitejs/plugin-vue": "^5.0.4",
......
import router from '@/router'
import Axios from 'axios'
import { showError } from '@/utils/ui.ts'
const axios = Axios.create({
baseURL: import.meta.env.VITE_API_BASE,
......@@ -38,7 +39,10 @@ axios.interceptors.response.use((response) => {
router.replace({ path: '/user/login' })
return Promise.reject(data)
}
if (data.code !== 200) return Promise.reject(data)
if (data.code !== 200){
showError(data.message)
return Promise.reject(data)
}
}
return data
})
......
......@@ -186,6 +186,20 @@ export function getDeliveryNoteList(
},
)
}
export function customJomallReconciliation(
data: any,
currentPage: number,
pageSize: number,
) {
return axios.post<never, BasePaginationData<DeliveryNoteData>>(
'factory/customJomallReconciliation/list_page',
{
...data,
currentPage,
pageSize,
},
)
}
export function printDeliveryNote(data: string[]) {
return axios.post<never, BaseRespData<never>>(
'factory/customJomallShipment/printInvoiceStatistics',
......@@ -195,6 +209,12 @@ export function printDeliveryNote(data: string[]) {
},
)
}
export function createReconciliation(data: { shipmentIdList: number[] }) {
return axios.post<never, BaseRespData<never>>(
'factory/customJomallReconciliation/createReconciliation',
data,
)
}
export function getProductionOrderList(subOrderNumber: string) {
return axios.get<never, BaseRespData<ProductionOrder>>(
......@@ -217,3 +237,61 @@ export function getOrderByIdApi(id?: number) {
},
)
}
export function getReconciliationAmount(id?: number) {
return axios.get<never, BaseRespData<OrderData>>(
'factory/customJomallReconciliation/getReconciliationAmount',
{
params: {
id,
},
},
)
}
export function getCustomJomallReconciliationById(id?: number) {
return axios.get<never, BaseRespData<OrderData>>(
'factory/customJomallReconciliation/getById',
{
params:{
id
}
}
)
}
export function customJomallReconciliationLog(reconciliationId?: number) {
return axios.get<never, BaseRespData<OrderData>>(
'factory/customJomallReconciliationLog/getListById',
{
params: {
reconciliationId,
},
},
)
}
export function updateReconciliation(
data: any,
) {
return axios.post(
'factory/customJomallReconciliation/updateReconciliation',
data,
)
}
export function getShipmentDetailsById(shipmentId?: number) {
return axios.get<never, BaseRespData<OrderData>>(
'factory/customJomallReconciliation/getShipmentDetailsById',
{
params: {
shipmentId,
},
},
)
}
export function factoryConfirm(
data: any[],
) {
return axios.post(
'factory/customJomallReconciliation/factoryConfirm',
data
)
}
\ No newline at end of file
<script setup lang="ts">
import { Splitpanes, Pane } from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
const props = defineProps({
size: {
default: 15,
type: Number
}
})
</script>
<template>
<splitpanes horizontal style="height: 100%">
<pane :size="size">
<slot name="top"></slot>
</pane>
<pane style="flex: 1; flex-shrink: 0">
<slot name="bottom"></slot>
</pane>
</splitpanes>
</template>
<style scoped lang="scss">
::v-deep(.splitpanes__splitter) {
width: 100%;
border-left: 1px solid #eee;
margin-left: -1px;
background-color: #ececec;
cursor: row-resize;
box-sizing: border-box;
position: relative;
flex-shrink: 0;
min-width: 1px;
margin-top: 5px;
margin-bottom: 5px;
&::before{
margin-top: -2px;
background-color: #00000040;
transform: translate(-50%);
width: 30px;
height: 1px;
content: "";
position: absolute;
top: 50%;
left: 50%;
transition: background-color .3s;
}
&::after{
margin-top: 1px;
background-color: #00000040;
transform: translate(-50%);
width: 30px;
height: 1px;
content: "";
position: absolute;
top: 50%;
left: 50%;
transition: background-color .3s;
}
}
::v-deep(.splitpanes__pane) {
.el-card {
height: 100%;
}
}
</style>
......@@ -10,6 +10,7 @@ import ProductionComplete from '@/views/production/complete.vue'
import { getToken} from '@/api/axios'
import UserPage from '@/views/UserPage.vue'
import DeliveryNotePage from '@/views/DeliveryNotePage.vue'
import AccountStatementNote from '@/views/AccountStatementNote.vue'
const router = createRouter({
history: createWebHistory(),
......@@ -38,6 +39,10 @@ const router = createRouter({
{
path: '/system/delivery-note',
component: DeliveryNotePage
},
{
path: '/account/statement-note',
component: AccountStatementNote
}
],
},
......
......@@ -16,13 +16,17 @@ const menu: MenuItem[] = [
id: 2,
label: '订单',
},{
index: '/system/delivery-note',
index: '/account/statement-note',
id: 3,
label: '对账单',
},{
index: '/system/delivery-note',
id: 4,
label: '发货单',
},
{
index: '',
id: 4,
id: 5,
label: '系统设置',
children: [
{
......
......@@ -95,3 +95,11 @@ export interface ProductionOrder {
notPassNum?: number
passNum?: number
}
export interface AccountStatementNote{
billNumber:string
shipmentNum:string
lanshouName:string
lanshouPhone:string
totalAmount:string
id?:number
}
\ No newline at end of file
import { Ref, onMounted, ref } from 'vue'
import { Ref, onMounted, ref, reactive } from 'vue'
import { showError } from '../ui'
import type { PaginationData } from '@/types/api'
......@@ -19,13 +19,27 @@ export default function usePageList<T>(options: UsePageListOptions<T>) {
const pageSize = ref(options.initPageSize || 100)
const total = ref(0)
const data = ref<T[]>([]) as Ref<T[]>
const statistics = ref(options.statistics || false)
const totalData = reactive({
sumShipmentNum: 0,
sumPassNum: 0,
sumTotalPrice: 0,
sumNotPassNum: 0,
})
const loadData = async () => {
const { query } = options
try {
loading.value = true
// Promise 链式调用
const res = await query(currentPage.value, pageSize.value)
let 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
}
total.value = res.total
currentPage.value = res.current
pageSize.value = res.size
......@@ -61,6 +75,7 @@ export default function usePageList<T>(options: UsePageListOptions<T>) {
return {
loading,
currentPage,
totalData,
pageSize,
total,
data,
......
......@@ -71,7 +71,7 @@
>
<ElOption label="快递" :value="2"></ElOption>
<ElOption label="送货上门" :value="1"></ElOption>
</ElSelect>
</ElSelect>
</ElFormItem>
<ElFormItem label="物流跟踪号" prop="logisticsTracking">
......@@ -90,7 +90,14 @@
</ElFormItem>
<ElFormItem>
<ElButton v-loading="btnLoading" type="success" @click="onConfirmDateRange"
>导出发货单</ElButton
>导出发货单
</ElButton
>
</ElFormItem>
<ElFormItem>
<ElButton type="primary" @click="generateStatement"
>生成对账单
</ElButton
>
</ElFormItem>
</ElForm>
......@@ -158,8 +165,10 @@
v-if="pi.copyable"
class="icon"
@click="copy(val(od, pi.key || ''))"
><DocumentCopy
/></el-icon>
>
<DocumentCopy
/>
</el-icon>
</div>
</div>
</div>
......@@ -180,14 +189,16 @@
class="send-order-prop-item"
>
<span v-if="val(row, pi.key)"
>{{ pi.label }}{{ val(row, pi.key) }}</span
>{{ pi.label }}{{ val(row, pi.key) }}</span
>
<el-icon
v-if="pi.copyable && val(row, pi.key)"
class="icon"
@click="copy(val(row, pi.key || ''))"
><DocumentCopy
/></el-icon>
>
<DocumentCopy
/>
</el-icon>
</div>
</div>
</template>
......@@ -201,8 +212,9 @@
>
<template #default="{ row }">
<div>
<ElButton type="text" @click="onViewOrder(row)"
>查看订单</ElButton
<ElButton link @click="onViewOrder(row)"
>查看订单
</ElButton
>
</div>
</template>
......@@ -246,15 +258,16 @@ import { useValue } from '@/utils/hooks/useValue'
import {
getDeliveryNoteList,
printDeliveryNote,
getOrderByIdApi,
getOrderByIdApi, createReconciliation,
} from '@/api/order'
import { getUserMarkList } from '@/api/auth'
import { ref, onMounted } from 'vue'
import { val } from '@/utils'
import { showError } from '@/utils/ui'
import { showConfirm, showError } from '@/utils/ui'
import { filePath } from '@/api/axios'
import { type CellCls } from 'element-plus'
import { type CellCls, ElMessage } from 'element-plus'
import OrderDetail from './order/OrderDetail.vue'
const [searchForm, resetSearchForm] = useValue<DeliveryNoteSearchForm>({})
const selection = ref<DeliveryNoteData[]>([])
const dateRange = ref<string[]>([])
......@@ -353,6 +366,32 @@ const onConfirmDateRange = async () => {
btnLoading.value = false
}
}
const generateStatement = async () => {
if (selection.value.length === 0) {
return ElMessage({
message: '请选择数据后生成',
type: 'warning',
})
}
try {
await showConfirm('是否生成对账单?', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
try {
await createReconciliation({ shipmentIdList: selection.value.map(el => el.id) })
search()
ElMessage.success('操作成功')
} catch (e) {
showError(e)
btnLoading.value = false
}
}
const onCellClassName: CellCls<DeliveryNoteData> = ({ column }) => {
if (
......@@ -398,6 +437,7 @@ const copy = (text: string) => {
margin-bottom: 10px;
}
}
$border: solid 1px #ddd;
.send-order-list {
......@@ -436,6 +476,7 @@ $border: solid 1px #ddd;
.send-order-product-image {
width: 100px;
}
.dialog-footer {
text-align: center;
}
......
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