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,
......
<template>
<div class="page">
<div class="left">
<ElTree ref="treeRef" default-expand-all :expand-on-click-node="false" :default-expanded-keys="[]"
:highlight-current="true" node-key="id" :data="treeData" @node-click="nodeClick">
</ElTree>
</div>
<div class="right">
<div class="delivery-note-page flex-column card h-100 overflow-hidden">
<splitDiv :size="70">
<template #top>
<div class="header-filter-form">
<ElForm :model="searchForm" inline>
<ElFormItem label="创建时间">
<el-date-picker
v-model="dateRange"
:default-time="[new Date(0,0,0,0,0,0),new Date(0,0,0,23,59,59)]"
type="datetimerange"
start-placeholder="开始时间"
end-placeholder="结束时间"
clearable
style="width: 260px"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</ElFormItem>
<ElFormItem label="发货单号">
<ElInput
v-model="searchForm.billNumber"
clearable
placeholder="发货单号"
style="width: 160px"
/>
</ElFormItem>
<ElFormItem label="订单号">
<ElInput
v-model="searchForm.orderNumber"
clearable
placeholder="订单号"
style="width: 160px"
/>
</ElFormItem>
<ElFormItem label="物流跟踪号">
<ElInput
v-model="searchForm.logisticsTracking"
placeholder="物流跟踪号"
clearable
style="width: 160px"
></ElInput>
</ElFormItem>
<ElFormItem label="物流名称">
<ElInput
v-model="searchForm.carriageName"
placeholder="物流名称"
clearable
style="width: 160px"
></ElInput>
</ElFormItem>
<ElFormItem label="收货人">
<ElInput
v-model="searchForm.lanshouName"
placeholder="收货人"
clearable
style="width: 160px"
></ElInput>
</ElFormItem>
<ElFormItem>
<ElButton type="primary" @click="search">查询</ElButton>
</ElFormItem>
<ElFormItem>
<ElButton @click="resetSearchForm">重置</ElButton>
</ElFormItem>
</ElForm>
</div>
<div class="btn-list">
<el-button v-if="nodeId===0" type="primary" :disabled="selections.length===0" @click="sureFactory">
确认对账单
</el-button>
</div>
<div class="delivery-note-content flex-1 flex-column overflow-hidden">
<div class="delivery-note-list flex-1 overflow-hidden">
<ElTable
@current-change="rowClick"
highlight-current-row
:data="tableData"
@selection-change="handleSelectionChange"
ref="singleTableRef"
show-summary
:summary-method="getSummaries"
default-expand-all
size="small"
style="width: 100%; height: 100%"
border
>
<ElTableColumn
type="selection"
width="70"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
type="index"
label="序号"
width="60"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="发货单号"
show-overflow-tooltip
prop="billNumber"
width="200"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="订单号"
show-overflow-tooltip
prop="orderNumber"
width="200"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="质检未通过数量"
show-overflow-tooltip
width="130"
prop="notPassNum"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="发货数量"
show-overflow-tooltip
prop="shipmentNum"
header-align="center"
align="center"
width="150"
></ElTableColumn>
<ElTableColumn
label="质检通过数量"
show-overflow-tooltip
prop="passNum"
width="150"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="质检通过总价"
show-overflow-tooltip
prop="totalPrice"
width="200"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="收货人"
show-overflow-tooltip
width="200"
prop="lanshouName"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="物流跟踪号"
width="200"
show-overflow-tooltip
prop="logisticsTracking"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="物流名称"
width="200"
show-overflow-tooltip
prop="carriageName"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="收货人电话"
show-overflow-tooltip
prop="lanshouPhone"
header-align="center"
align="center"
width="180"
></ElTableColumn>
<ElTableColumn
label="揽收区域"
show-overflow-tooltip
width="200"
prop="lanshouRegion"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="揽收地址"
show-overflow-tooltip
prop="lanshouAddress"
width="200"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="揽收邮编"
show-overflow-tooltip
width="200"
prop="lanshouPost"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="创建时间"
show-overflow-tooltip
width="200"
prop="createTime"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="操作"
fixed="right"
header-align="center"
align="center"
prop="operation"
width="80"
>
<template #default="{ row }">
<div>
<ElButton v-if="nodeId===0" type="primary" link @click="onEditOrder(row)"
>编辑
</ElButton
>
</div>
</template>
</ElTableColumn>
</ElTable>
</div>
<ElPagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[100, 200, 300, 400]"
background
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin: 10px auto 0; text-align: right"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
></ElPagination>
</div>
</template>
<template #bottom>
<el-tabs @tab-change="tabsClick" v-model="tabsValue">
<el-tab-pane name="0" label="发货单详情">
<ElTable :data="detailList" height="100%" border>
<ElTableColumn show-overflow-tooltip width="60" align="center" label="序号" type="index" />
<ElTableColumn show-overflow-tooltip align="center" label="图片">
<template #default="{row}">
<el-image preview-teleported style="height: 40px;width: 40px;" :src="row.variantImage"
:preview-src-list="[row.variantImage]"></el-image>
</template>
</ElTableColumn>
<ElTableColumn show-overflow-tooltip align="center" label="商品名称" prop="productName" />
<ElTableColumn show-overflow-tooltip align="center" label="baseSku" prop="baseSku" />
<ElTableColumn show-overflow-tooltip align="center" label="变体Sku" prop="variantSku" />
<ElTableColumn show-overflow-tooltip align="center" label="生产单号" prop="subOrderNumber" />
<ElTableColumn show-overflow-tooltip align="center" label="单价" prop="price" />
<ElTableColumn show-overflow-tooltip align="center" label="发货数" prop="shipmentNum" />
<ElTableColumn show-overflow-tooltip align="center" label="质检(通过)" prop="passNum" />
<ElTableColumn show-overflow-tooltip align="center" label="质检(不通过)" prop="notPassNum" />
</ElTable>
</el-tab-pane>
<el-tab-pane name="1" label="操作日志">
<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: 13%">
{{ item.createTime }}
</span>
<span
v-html="item.description"
style="display: inline-block; width: 80%"></span>
</li>
</ul>
</el-tab-pane>
</el-tabs>
</template>
</splitDiv>
</div>
</div>
</div>
<ElDialog width="1100px" v-model="dialogVisible" draggable title="编辑">
<el-form style="width: 100%;" inline label-width="120px" v-model="editForm">
<el-form-item prop="billNumber" label="发货单号">
<el-input disabled v-model="editForm.billNumber"></el-input>
</el-form-item>
<el-form-item prop="orderNumber" label="订单号">
<el-input disabled v-model="editForm.orderNumber"></el-input>
</el-form-item>
<el-form-item prop="notPassNum" label="质检未通过数量">
<el-input disabled v-model="editForm.notPassNum"></el-input>
</el-form-item>
<el-form-item prop="lanshouName" label="收货人">
<el-input disabled v-model="editForm.lanshouName"></el-input>
</el-form-item>
<el-form-item prop="lanshouPhone" label="收货人电话">
<el-input disabled v-model="editForm.lanshouPhone"></el-input>
</el-form-item>
<el-form-item prop="lanshouRegion" label="揽收区域">
<el-input disabled v-model="editForm.lanshouRegion"></el-input>
</el-form-item>
<el-form-item prop="lanshouAddress" label="揽收地址">
<el-input disabled v-model="editForm.lanshouAddress"></el-input>
</el-form-item>
<el-form-item prop="lanshouPost" label="揽收邮编">
<el-input disabled v-model="editForm.lanshouPost"></el-input>
</el-form-item>
<el-form-item prop="passNum" label="质检通过数量">
<el-input v-model="editForm.passNum"></el-input>
</el-form-item>
<el-form-item prop="shipmentNum" label="发货数量">
<el-input v-model="editForm.shipmentNum"></el-input>
</el-form-item>
<el-form-item prop="totalPrice" label="质检通过总价">
<el-input v-model="editForm.totalPrice"></el-input>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="dialogVisible=false">取消</el-button>
<el-button @click="submitData" type="primary">确认</el-button>
</template>
</ElDialog>
</template>
<script setup lang="ts">
import { ElMessage, ElTree } from 'element-plus'
import splitDiv from '@/components/splitDiv/splitDiv.vue'
interface Tree {
label: string
id: number
}
import {
AccountStatementNote,
} from '@/types/api/deliveryNote'
import { OrderData } from '@/types/api/order'
import usePageList from '@/utils/hooks/usePageList'
import { useValue } from '@/utils/hooks/useValue'
import {
customJomallReconciliation, customJomallReconciliationLog, factoryConfirm,
getCustomJomallReconciliationById, getReconciliationAmount, getShipmentDetailsById, updateReconciliation,
} from '@/api/order'
import { ref, onMounted, watch, reactive, nextTick } from 'vue'
import { showError } from '@/utils/ui'
import 'element-plus/dist/index.css'
const treeData: Tree[] = ref([
{
label: '全部',
id: '-1',
children: [
{
label: '草稿箱',
id: 0,
},
{
label: '待确认',
id: 1,
},
{
label: '待付款',
id: 2,
}, {
label: '已付款',
id: 3,
}, {
label: '归档',
id: 4,
},
],
},
])
const [searchForm, resetSearchForm] = useValue<AccountStatementNote>({})
const dateRange = ref<string[]>([])
const selections = ref<AccountStatementNote[]>([])
const detailList = ref<any[]>([])
const tabsValue = ref<string>('0')
const singleTableRef = ref<any>(null)
const currentRow = ref<AccountStatementNote>(null)
const logList = ref<string[]>([])
const nodeId = ref<number | string>('-1')
const treeRef = ref<InstanceType<typeof ElTree>>()
const editForm = ref<AccountStatementNote>({
billNumber: '',
shipmentNum: '',
lanshouName: '',
lanshouPhone: '',
totalAmount: '',
})
const {
currentPage,
pageSize,
totalData,
total,
data: tableData,
refresh: search,
onCurrentPageChange: handleCurrentChange,
onPageSizeChange: handleSizeChange,
} = usePageList({
statistics: true,
query: (page, pageSize) => customJomallReconciliation(
{
...searchForm.value,
status: nodeId.value === '-1' ? null : nodeId.value,
startTime: dateRange.value && dateRange.value[0],
endTime: dateRange.value && dateRange.value[1],
},
page,
pageSize,
).then((res) => res.data),
})
onMounted(() => {
(treeRef as never).value.setCurrentKey(nodeId.value, true)
})
const dialogVisible = ref<boolean>(false)
const orderDetailData = ref<OrderData>({} as OrderData)
const getTreeNum = async () => {
let { data } = await getReconciliationAmount()
treeData.value = [{
label: '全部',
id: '-1',
children: [
{
label: '草稿箱',
id: 0,
},
{
label: '待确认',
id: 1,
},
{
label: '待付款',
id: 2,
}, {
label: '已付款',
id: 3,
}, {
label: '归档',
id: 4,
},
],
}]
nextTick(() => {
(treeRef as never).value.setCurrentKey(nodeId.value, true)
})
treeData.value.forEach((el) => {
el.children.forEach((it) => {
it.count = 0
})
})
treeData.value.forEach((el, index) => {
el.children.forEach((it) => {
data.forEach((item) => {
if (it.id === item.status) {
it['count'] = item.count
}
})
if (it.id !== '-1') {
it.label = it.label + `(${it.count || 0})`
}
})
})
treeData.value[0].label = ''
treeData.value[0].label = '全部' + (data.find(el => el.totalSum) ? `(${data.find(el => el.totalSum).totalSum})` : '(0)')
console.log(treeData.value)
}
const onEditOrder = async (item: AccountStatementNote) => {
try {
const res = await getCustomJomallReconciliationById(item.id)
editForm.value = (res.data) as never
dialogVisible.value = true
} catch (e) {
showError(e)
}
}
const logOrder = async (item: AccountStatementNote) => {
try {
const res = await customJomallReconciliationLog(item.id)
logList.value = (res.data) as never
} catch (e) {
showError(e)
}
}
const submitData = async () => {
try {
const res = await updateReconciliation(editForm.value)
logList.value = (res.data) as never
dialogVisible.value = false
ElMessage.success('修改成功')
search()
} catch (e) {
showError(e)
}
}
const rowClick = (row) => {
console.log(row)
currentRow.value = row
tabsValue.value = '0'
tabsClick(tabsValue.value)
}
const tabsClick = async (name: string) => {
if (!currentRow.value) return
if (name === '0') {
let { data } = await getShipmentDetailsById(currentRow.value.shipmentId)
detailList.value = data
} else if (name === '1') {
await logOrder(currentRow.value)
}
}
const handleSelectionChange = (v) => {
selections.value = v
}
const getSummaries = ({ columns, data }) => {
console.log(data)
console.log(totalData)
let sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '统计'
}
if (index === 4) {
sums[index] = totalData['sumNotPassNum']
}
if (index === 5) {
sums[index] = totalData['sumShipmentNum']
}
if (index === 6) {
sums[index] = totalData['sumPassNum']
}
if (index === 7) {
sums[index] = totalData['sumTotalPrice']
}
})
console.log([sums], ' [sums]')
return sums
}
const sureFactory = () => {
ElMessageBox.confirm(`确认对账单?`, '重要提示', {
confirmButtonText: '确定',
type: 'warning',
}).then(async res => {
await factoryConfirm(selections.value.map(el => {
return {
id: el.id,
dataVersion: el.dataVersion,
}
}))
ElMessage.success('操作成功')
search()
await getTreeNum()
})
}
watch(() => tableData.value, () => {
if (tableData.value && tableData.value.length > 0) {
if (singleTableRef.value) {
singleTableRef.value!.setCurrentRow(tableData.value[0])
currentRow.value = tableData.value[0]
}
} else {
detailList.value = []
}
}, { immediate: true })
const nodeClick = (data: Tree) => {
nodeId.value = data.id
detailList.value = []
logList.value = []
search()
}
getTreeNum()
</script>
<style lang="scss" scoped>
.header-filter-form {
margin-bottom: 20px;
:deep(.el-form-item) {
margin-right: 14px;
margin-bottom: 10px;
}
}
$border: solid 1px #ddd;
.send-order-list {
display: grid;
grid-template-columns: 2fr 1fr;
border-left: $border;
border-top: $border;
}
.send-order-column {
padding: 10px 16px;
line-height: 1.5;
}
.send-order-header {
font-weight: bold;
text-align: center;
background-color: #f8f8f9;
}
.send-order-product-item {
display: flex;
justify-content: space-between;
gap: 20px;
&:not(:first-child) {
border-top: $border;
padding: 10px 0;
}
.send-order-prop-list {
flex: 1;
}
}
.send-order-product-image {
width: 100px;
}
.dialog-footer {
text-align: center;
}
.delivery-note-list {
:deep(.vertical-align-top) {
vertical-align: top;
}
}
.page {
display: flex;
height: 100%;
.left {
min-width: 150px;
margin-right: 15px;
background: white;
background-color: white;
padding: 10px;
box-sizing: border-box;
}
.right {
flex: 1;
flex-shrink: 0;
background: white;
overflow: hidden;
}
}
::v-deep(.el-tree-node__label) {
font-size: 13px;
color: rgb(96, 98, 102);
cursor: pointer;
}
::v-deep(.el-tree-node__expand-icon) {
display: none;
}
::v-deep(.el-tree-node__label) {
display: inline-block;
width: 100%;
color: black !important;
padding: 3px 7px;
}
::v-deep(.is-current) {
.el-tree-node__label {
background-color: #ecf5ff;
color: #409eff !important;
}
.el-tree-node__children {
.el-tree-node__label {
background-color: transparent !important;
color: black !important;
}
}
}
::v-deep(.splitpanes__pane) {
display: flex;
flex-direction: column;
}
::v-deep(.splitpanes--horizontal>.splitpanes__splitter) {
min-height: 5px;
margin-top: 10px;
}
.draw-line {
width: 100%;
height: 5px;
background: #eff3f6;
}
.card {
background: transparent;
}
.btn-list {
margin-bottom: 10px;
}
::v-deep(.el-tree-node) {
cursor: pointer;
margin-bottom: 5px;
}
::v-deep(.el-tree-node__label) {
font-size: 14px;
}
::v-deep(.el-tabs) {
display: flex;
flex-direction: column;
height: 100%;
.el-tabs__content {
flex: 1;
flex-shrink: 0;
overflow: hidden;
.el-tab-pane {
height: 100%;
}
}
}
</style>
......@@ -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