添加内勤专用 查看

This commit is contained in:
浅念
2025-10-23 10:05:13 +08:00
parent 3aa1b0f79b
commit 2ba64b94b0
5 changed files with 390 additions and 35 deletions
+94 -18
View File
@@ -41,11 +41,17 @@
<ElTableColumn label="状态" prop="approval_status">
<template #default="scope">
<div v-if="scope.row.appro_status">
<div
><span :class="statusClass(scope.row.appro_status.status)">{{ scope.row.appro_status.status_desc ? scope.row.appro_status.status_desc : '' }}</span>
<span v-if="scope.row.appro_status.name != ''"
>【{{ scope.row.appro_status.name }}】</span
>
<div>
<span :class="statusClass(scope.row.appro_status.status)">
{{
scope.row.appro_status.status_desc
? scope.row.appro_status.status_desc
: ''
}}
</span>
<span v-if="scope.row.appro_status.name != ''">
【{{ scope.row.appro_status.name }}】
</span>
</div>
</div>
<div v-else></div>
@@ -63,12 +69,30 @@
>
<i class="iconfont-sys">&#xe782;</i> 打印预览
</el-link>
<el-link type="primary" underline="never" @click="handleView1(scope.row)">
<el-link
type="primary"
underline="never"
@click="handleView1(scope.row)"
style="margin-right: 8px"
>
<i class="iconfont-sys">&#xe76c;</i> 查看终版
</el-link>
<el-link type="warning" underline="never" @click="showDialogtimeline(scope.row)">
<el-link
type="warning"
underline="never"
@click="showDialogtimeline(scope.row)"
style="margin-right: 8px"
>
<i class="iconfont-sys">&#xe728;</i> 查看审批
</el-link>
<el-link
type="primary"
underline="never"
@click="handleViewnq(scope.row)"
style="margin-right: 8px;color: #750AF8"
>
<i class="iconfont-sys">&#xe76c;</i> 内勤专用
</el-link>
</ElRow>
</template>
</ElTableColumn>
@@ -147,24 +171,39 @@
<ApprovalTimeline :records="approvalRecords" />
</div>
</el-dialog>
<!-- 内勤查看弹窗 -->
<InternalStaffView
v-model:visible="nqDialogVisible"
:vehicle-data="nqData"
:default-currency="nqCurrency"
/>
</div>
</template>
<script setup lang="ts">
import { router } from '@/router'
// import { router } from '@/router'
// import { CrmService } from '@/api/crmApi'
import { manageService } from '@/api/adminApi'
import { useAuth } from '@/composables/useAuth'
// import { useAuth } from '@/composables/useAuth'
import OrderDetailContent from '@/components/custom/OrderDetailContent.vue'
import ApprovalTimeline from '@/components/custom/ApprovalTimeline.vue'
import type { OrderData } from '@/composables/useOrderDetailDialog'
import { usePdfPreview } from '@/composables/usePdfPreview'
import FilePreview from '@/components/custom/FilePreview.vue'
import InternalStaffView from '@/components/custom/InternalStaffView.vue'
const timelineDialogVisible = ref(false)
const approvalRecords = ref<any[]>([])
const isFinites = ref(false)
// PDF 预览/打印(公共)
const { pdf, frameRef, openWithResponse, download, print, preparePreview, prepareImages } = usePdfPreview()
const {
pdf,
frameRef,
openWithResponse,
download,
/* print,*/
preparePreview,
prepareImages
} = usePdfPreview()
defineOptions({ name: 'AdminFinalListPage' })
// 订单详情弹窗
const orderDialog = reactive({
@@ -173,13 +212,18 @@
orderData: {} as OrderData
})
const { hasAuth } = useAuth()
// const { hasAuth } = useAuth()
const loading = ref(false)
const keyword = ref('')
const tableRef = ref()
const tableData = ref<any[]>([])
const pagination = reactive({ currentPage: 1, pageSize: 10, total: 0 })
// 内勤查看:币种与数据
const nqDialogVisible = ref(false)
const nqCurrency = ref('')
const nqData = ref<any[]>([])
onMounted(() => {
getList()
})
@@ -243,6 +287,36 @@
console.log(err)
})
}
const handleViewnq = async (row: any) => {
const res = await manageService.checkStock({ id: row.id })
// 默认币种来自 currency_symbol
if (res?.currency_symbol) {
nqCurrency.value = res.currency_symbol
} else {
nqCurrency.value = 'USD'
}
const list = Array.isArray(res?.veh_list) ? res.veh_list : []
nqData.value = list.map((it: any) => ({
model_snapshot: it.model_snapshot,
qty: 1,
clearance_price: it.clearance_price,
clearance_price_currency: it.clearance_price?.currency || it.clearance_price_currency,
fob_transport_fee: it.fob_transport_fee,
fob_fee_currency: it.fob_transport_fee?.currency || it.fob_fee_currency,
car_price: it.car_price,
car_price_currency: it.car_price?.currency || it.car_price_currency,
ocean_freight: it.ocean_freight,
ocean_freight_currency: it.ocean_freight?.currency || it.ocean_freight_currency,
commission: it.commission,
commission_currency: it.commission?.currency || it.commission_currency,
retention_price: it.retention_price,
retention_price_currency: it.retention_price?.currency || it.retention_price_currency,
port_misc_fee: it.port_misc_fee,
port_fee_currency: it.port_misc_fee?.currency || it.port_fee_currency,
model: it.model_snapshot
}))
nqDialogVisible.value = true
}
// 文件数据
const contractFiles = ref<Array<{ name: string; url: string; file_name: string }>>([])
const piFiles = ref<Array<{ name: string; url: string; file_name: string }>>([])
@@ -294,7 +368,7 @@
// TODO: 跳转或弹窗查看备货单
}
// 判断是否为图片文件
const isImageFile = (file: { name: string; url: string; file_name: string }) => {
/* const isImageFile = (file: { name: string; url: string; file_name: string }) => {
// 检查文件名
if (file.name && /\.(jpg|jpeg|png|gif|webp)$/i.test(file.name)) {
return true
@@ -314,10 +388,10 @@
}
return false
}
} */
// 预览图片
const previewImage = (file: { name: string; url: string; file_name: string }) => {
/* const previewImage = (file: { name: string; url: string; file_name: string }) => {
// 创建图片预览弹窗
const imagePreview = document.createElement('div')
imagePreview.style.cssText = `
@@ -380,10 +454,10 @@
}
}
document.addEventListener('keydown', handleKeydown)
}
} */
// 下载文件
const downloadFile = (file: { name: string; url: string; file_name: string }) => {
/* const downloadFile = (file: { name: string; url: string; file_name: string }) => {
try {
const link = document.createElement('a')
link.href = file.url
@@ -396,7 +470,7 @@
console.error('下载失败:', error)
ElMessage.error('下载失败,请稍后重试')
}
}
} */
//审批进度
const showDialogtimeline = async (row: any) => {
// 审批记录(兼容多种字段)
@@ -443,7 +517,9 @@
display: flex;
align-items: center;
}
.clickable { cursor: pointer; }
.clickable {
cursor: pointer;
}
.status-following {
color: #00a43f;
font-weight: bold;
+77 -15
View File
@@ -42,11 +42,15 @@
<ElTableColumn label="状态" prop="approval_status">
<template #default="scope">
<div v-if="scope.row.appro_status">
<div
><span :class="statusClass(scope.row.appro_status.status)">{{ scope.row.appro_status.status_desc ? scope.row.appro_status.status_desc : '' }}</span>
<span v-if="scope.row.appro_status.name != ''"
>【{{ scope.row.appro_status.name }}】</span
>
<div>
<span :class="statusClass(scope.row.appro_status.status)">
{{
scope.row.appro_status.status_desc
? scope.row.appro_status.status_desc
: ''
}}
</span>
<span v-if="scope.row.appro_status.name != ''">【{{ scope.row.appro_status.name }}】</span>
</div>
</div>
<div v-else></div>
@@ -68,7 +72,7 @@
type="success"
underline="never"
@click="handleView(scope.row)"
style="margin-right: 8px;color: #333333;"
style="margin-right: 8px; color: #333333"
>
<i class="iconfont-sys">&#xe76c;</i> 查看
</el-link>
@@ -77,12 +81,26 @@
type="success"
underline="never"
@click="handleView1(scope.row)"
style="margin-right: 8px"
>
<i class="iconfont-sys">&#xe76c;</i> 查看终版
</el-link>
<el-link type="warning" underline="never" @click="showDialogtimeline(scope.row)">
<el-link
type="warning"
underline="never"
@click="showDialogtimeline(scope.row)"
style="margin-right: 8px"
>
<i class="iconfont-sys">&#xe728;</i> 查看审批
</el-link>
<el-link
type="primary"
underline="never"
@click="handleViewnq(scope.row)"
style="margin-right: 8px;color: #750AF8;"
>
<i class="iconfont-sys">&#xe76c;</i> 内勤专用
</el-link>
</ElRow>
</template>
</ElTableColumn>
@@ -162,6 +180,12 @@
<ApprovalTimeline :records="approvalRecords" />
</div>
</el-dialog>
<!-- 内勤查看弹窗 -->
<InternalStaffView
v-model:visible="nqDialogVisible"
:vehicle-data="nqData"
:default-currency="nqCurrency"
/>
</div>
</template>
@@ -172,8 +196,12 @@
import ApprovalTimeline from '@/components/custom/ApprovalTimeline.vue'
import type { OrderData } from '@/composables/useOrderDetailDialog'
import FilePreview from '@/components/custom/FilePreview.vue'
import InternalStaffView from '@/components/custom/InternalStaffView.vue'
const timelineDialogVisible = ref(false)
const approvalRecords = ref<any[]>([])
const nqDialogVisible = ref(false)
const nqCurrency = ref('')
const nqData = ref<any[]>([])
const isFinites = ref(false)
defineOptions({ name: 'StockingListAdmin' })
// import { useAuth } from '@/composables/useAuth'
@@ -192,11 +220,12 @@
const pagination = reactive({ currentPage: 1, pageSize: 10, total: 0 })
// PDF 预览/打印(公共)
const { pdf, frameRef, openWithResponse, download, print, preparePreview, prepareImages } = usePdfPreview()
const { pdf, frameRef, openWithResponse, download, /* print,*/ preparePreview, prepareImages } = usePdfPreview()
onMounted(() => {
getList()
})
function statusClass(status: any) {
if (status === 'rejected' || status === 'voided') return 'status-lost'
if (status === 'approved') return 'status-following'
@@ -327,7 +356,7 @@
}
}
// 判断是否为图片文件
const isImageFile = (file: { name: string; url: string; file_name: string }) => {
/* const isImageFile = (file: { name: string; url: string; file_name: string }) => {
// 检查文件名
if (file.name && /\.(jpg|jpeg|png|gif|webp)$/i.test(file.name)) {
return true
@@ -347,10 +376,10 @@
}
return false
}
} */
// 预览图片
const previewImage = (file: { name: string; url: string; file_name: string }) => {
/* const previewImage = (file: { name: string; url: string; file_name: string }) => {
// 创建图片预览弹窗
const imagePreview = document.createElement('div')
imagePreview.style.cssText = `
@@ -413,10 +442,10 @@
}
}
document.addEventListener('keydown', handleKeydown)
}
} */
// 下载文件
const downloadFile = (file: { name: string; url: string; file_name: string }) => {
/* const downloadFile = (file: { name: string; url: string; file_name: string }) => {
try {
const link = document.createElement('a')
link.href = file.url
@@ -429,7 +458,7 @@
console.error('下载失败:', error)
ElMessage.error('下载失败,请稍后重试')
}
}
} */
//打印
const printfn = (row: any) => {
if (row.approval_status == 2) {
@@ -472,6 +501,37 @@
}
timelineDialogVisible.value = true
}
const handleViewnq = async (row: any) => {
const res = await manageService.checkStock({ id: row.id })
// 设置默认币种为数据中的 currency_symbol
if (res?.currency_symbol) {
nqCurrency.value = res.currency_symbol
} else {
nqCurrency.value = 'USD' // 兜底默认值
}
// 取车辆明细列表作为行
const list = Array.isArray(res?.veh_list) ? res.veh_list : []
nqData.value = list.map((it: any) => ({
model_snapshot: it.model_snapshot,
qty: 1,
clearance_price: it.clearance_price,
clearance_price_currency: it.clearance_price?.currency || it.clearance_price_currency,
fob_transport_fee: it.fob_transport_fee,
fob_fee_currency: it.fob_transport_fee?.currency || it.fob_fee_currency,
car_price: it.car_price,
car_price_currency: it.car_price?.currency || it.car_price_currency,
ocean_freight: it.ocean_freight,
ocean_freight_currency: it.ocean_freight?.currency || it.ocean_freight_currency,
commission: it.commission,
commission_currency: it.commission?.currency || it.commission_currency,
retention_price: it.retention_price,
retention_price_currency: it.retention_price?.currency || it.retention_price_currency,
port_misc_fee: it.port_misc_fee,
port_fee_currency: it.port_misc_fee?.currency || it.port_fee_currency,
model: it.model_snapshot
}))
nqDialogVisible.value = true
}
</script>
<style scoped lang="scss">
@@ -496,7 +556,9 @@
display: flex;
align-items: center;
}
.clickable { cursor: pointer; }
.clickable {
cursor: pointer;
}
.status-following {
color: #00a43f;
font-weight: bold;
+6 -1
View File
@@ -82,7 +82,12 @@
>
<i class="iconfont-sys">&#xe641;</i> 提交
</el-link>
<el-link type="primary" underline="never" @click="handleView1(scope.row)">
<el-link
type="primary"
underline="never"
@click="handleView1(scope.row)"
style="margin-right: 8px"
>
<i class="iconfont-sys">&#xe76c;</i> 查看终版
</el-link>
<el-link type="warning" underline="never" @click="showDialogtimeline(scope.row)">
+1 -1
View File
@@ -88,7 +88,7 @@
type="success"
underline="never"
@click="handleView(scope.row)"
style="margin-right: 8px;color: #333333;"
style="margin-right: 8px;color: #750AF8;"
>
<i class="iconfont-sys">&#xe76c;</i> 查看
</el-link>