feat: 新增账期价格初审列表

This commit is contained in:
lonewolfyx 2026-03-11 10:32:26 +08:00
parent 531100b20d
commit d6c01136fc
4 changed files with 175 additions and 60 deletions

View File

@ -0,0 +1,11 @@
import request from '@/utils/request'
// 获取地域列表
export const getPricePreliminaryReviewList = (data, query) => {
return request({
method: 'post',
url: '/bussiness/baseusercredithistory/credit-period-initial-review-list',
data,
params: query
})
}

View File

@ -163,6 +163,20 @@
"navigationBarTitleText": "订单综合查询",
"props": true
}
},
{
"path": "pages/work/AccountPricePreliminaryRreview/index",
"style": {
"navigationBarTitleText": "账期价格初审",
"props": true
}
},
{
"path": "pages/work/AccountPriceFinallReview/index",
"style": {
"navigationBarTitleText": "账期价格复审",
"props": true
}
}
],
"tabBar": {

View File

@ -0,0 +1,84 @@
<template>
<view class="container">
<MBCard>
<uni-forms ref="baseForm" :modelValue="queryParams">
<uni-forms-item label="地域">
<Area v-model="queryParams.deptId" @change="handleQuery"/>
</uni-forms-item>
<uni-forms-item label="商业公司">
<BusinessCompany
v-model="queryParams.businessName"
@change="handleQuery"
/>
</uni-forms-item>
</uni-forms>
</MBCard>
<uni-table ref="table" :loading="loading" emptyText="暂无更多数据" stripe>
<uni-tr>
<uni-th align="center" width="50">序号</uni-th>
<uni-th align="left" width="180">公司名称</uni-th>
<uni-th align="left" width="50">地域</uni-th>
<uni-th width="100">账期审核</uni-th>
<uni-th width="100">额度审核</uni-th>
<uni-th width="100">价格审核</uni-th>
</uni-tr>
<uni-tr v-for="(item, index) in tableData" :key="index">
<uni-td>{{ index + 1 }}</uni-td>
<uni-td>{{ item.userName }}</uni-td>
<uni-td>{{ item.areaName }}</uni-td>
<uni-td>
<view v-if="item.zhangqi > 0">
<button class="uni-button" size="mini" type="submit">编辑</button>
</view>
</uni-td>
<uni-td>
<view v-if="item.edu > 0">
<button class="uni-button" size="mini" type="submit">编辑</button>
</view>
</uni-td>
<uni-td>
<view v-if="item.bg > 0">
<button class="uni-button" size="mini" type="submit">编辑</button>
</view>
</uni-td>
</uni-tr>
</uni-table>
</view>
</template>
<script setup>
import {defineOptions, onMounted, ref} from "vue"
import Area from "../../../components/Area.vue";
import MBCard from "../../../components/MB/MBCard.vue";
import UniFormsItem from "../../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue";
import BusinessCompany from "../../../components/BusinessCompany.vue";
import UniForms from "../../../uni_modules/uni-forms/components/uni-forms/uni-forms.vue";
import {getPricePreliminaryReviewList} from "../../../api/AccountPricePreliminaryRreview";
defineOptions({
name: "AccountPricePreliminaryRreview"
})
const loading = ref(true)
const queryParams = ref({})
const tableData = ref([])
const total = ref(0)
const paging = ref({
pageNum: 1,
pageSize: 100,
})
const handleQuery = async () => {
const data = await getPricePreliminaryReviewList(queryParams.value, paging.value)
tableData.value = data.rows
total.value = data.total
loading.value = false
}
onMounted(async () => {
await handleQuery()
})
</script>

View File

@ -6,13 +6,13 @@ import {securityFileDownload} from '@/api/FileUpload/FileUpload.js'
// 移动端文件预览优化版 - H5兼容修复
export const YuLanfile = async (filePath) => {
uni.showToast({
title: '预览还在开发完善中!!',
icon: 'none',
duration: 2000
})
return false;
uni.showToast({
title: '预览还在开发完善中!!',
icon: 'none',
duration: 2000
})
return false;
console.log("预览文件:", filePath)
if (!filePath) {
uni.showToast({
@ -21,25 +21,25 @@ export const YuLanfile = async (filePath) => {
});
return;
}
try {
uni.showLoading({
title: '正在加载文件...',
mask: true
});
const response = await securityFileDownload({
fileName: filePath,
delete: false
});
const fileExtension = filePath.split('.').pop().toLowerCase();
const fileName = filePath.split('\\').pop() || 'preview.' + fileExtension;
// 判断运行环境
const platform = getPlatform();
console.log('当前平台:', platform);
// 根据平台和文件类型选择预览方式
if (['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'].includes(fileExtension)) {
await previewImage(response, fileExtension, fileName, platform);
@ -48,9 +48,9 @@ export const YuLanfile = async (filePath) => {
} else {
await handleOtherFile(response, fileName, fileExtension, platform);
}
uni.hideLoading();
} catch (error) {
console.error('预览失败:', error);
uni.hideLoading();
@ -78,10 +78,10 @@ const getPlatform = () => {
// 图片预览
const previewImage = async (response, fileExtension, fileName, platform) => {
return new Promise((resolve, reject) => {
const blob = new Blob([response], {
type: `image/${fileExtension === 'jpg' ? 'jpeg' : fileExtension}`
const blob = new Blob([response], {
type: `image/${fileExtension === 'jpg' ? 'jpeg' : fileExtension}`
});
// H5环境 - 使用简单可靠的方式
if (platform === 'h5') {
const blobUrl = URL.createObjectURL(blob);
@ -89,7 +89,7 @@ const previewImage = async (response, fileExtension, fileName, platform) => {
showImageModalH5(blobUrl, fileName, resolve);
return;
}
// App环境
if (platform === 'app') {
const reader = new FileReader();
@ -110,7 +110,7 @@ const previewImage = async (response, fileExtension, fileName, platform) => {
reader.readAsDataURL(blob);
return;
}
// 微信小程序环境
if (platform === 'weixin') {
const reader = new FileReader();
@ -143,7 +143,7 @@ const showImageModalH5 = (imageUrl, fileName, resolve) => {
if (existingModal) {
document.body.removeChild(existingModal);
}
const modal = document.createElement('div');
modal.id = 'h5-preview-modal';
modal.style.cssText = `
@ -159,7 +159,7 @@ const showImageModalH5 = (imageUrl, fileName, resolve) => {
align-items: center;
flex-direction: column;
`;
const header = document.createElement('div');
header.style.cssText = `
position: absolute;
@ -179,7 +179,7 @@ const showImageModalH5 = (imageUrl, fileName, resolve) => {
<span style="font-size: 16px; color: white;">${fileName}</span>
<span style="font-size: 30px; cursor: pointer; color: white; padding: 0 10px;">×</span>
`;
const img = document.createElement('img');
img.src = imageUrl;
img.style.cssText = `
@ -187,14 +187,14 @@ const showImageModalH5 = (imageUrl, fileName, resolve) => {
max-height: 100%;
object-fit: contain;
`;
// 关闭按钮点击
header.querySelector('span:last-child').onclick = () => {
document.body.removeChild(modal);
URL.revokeObjectURL(imageUrl);
resolve();
};
// 点击背景关闭
modal.onclick = (e) => {
if (e.target === modal) {
@ -203,7 +203,7 @@ const showImageModalH5 = (imageUrl, fileName, resolve) => {
resolve();
}
};
// 按ESC关闭
const escHandler = (e) => {
if (e.key === 'Escape') {
@ -214,7 +214,7 @@ const showImageModalH5 = (imageUrl, fileName, resolve) => {
}
};
document.addEventListener('keydown', escHandler);
modal.appendChild(header);
modal.appendChild(img);
document.body.appendChild(modal);
@ -223,26 +223,26 @@ const showImageModalH5 = (imageUrl, fileName, resolve) => {
// PDF预览
const previewPDF = async (response, fileName, platform) => {
return new Promise((resolve, reject) => {
const blob = new Blob([response], { type: 'application/pdf' });
const blob = new Blob([response], {type: 'application/pdf'});
// H5环境
if (platform === 'h5') {
const blobUrl = URL.createObjectURL(blob);
showPDFModalH5(blobUrl, fileName, resolve);
return;
}
// App环境
if (platform === 'app') {
const reader = new FileReader();
reader.onload = (e) => {
const arrayBuffer = e.target.result;
const base64Data = arrayBufferToBase64(arrayBuffer);
plus.io.requestFileSystem(plus.io.PRIVATE_DOC, function(fs) {
fs.root.getFile(fileName, {create: true}, function(fileEntry) {
fileEntry.createWriter(function(writer) {
writer.onwrite = function() {
plus.io.requestFileSystem(plus.io.PRIVATE_DOC, function (fs) {
fs.root.getFile(fileName, {create: true}, function (fileEntry) {
fileEntry.createWriter(function (writer) {
writer.onwrite = function () {
plus.runtime.openFile(fileEntry.toLocalURL());
resolve();
};
@ -255,14 +255,14 @@ const previewPDF = async (response, fileName, platform) => {
reader.readAsArrayBuffer(blob);
return;
}
// 微信小程序环境
if (platform === 'weixin') {
const reader = new FileReader();
reader.onload = (e) => {
const arrayBuffer = e.target.result;
const base64Data = arrayBufferToBase64(arrayBuffer);
wx.getFileSystemManager().writeFile({
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
data: base64Data,
@ -289,7 +289,7 @@ const showPDFModalH5 = (pdfUrl, fileName, resolve) => {
if (existingModal) {
document.body.removeChild(existingModal);
}
const modal = document.createElement('div');
modal.id = 'h5-preview-modal';
modal.style.cssText = `
@ -303,7 +303,7 @@ const showPDFModalH5 = (pdfUrl, fileName, resolve) => {
display: flex;
flex-direction: column;
`;
const header = document.createElement('div');
header.style.cssText = `
height: 50px;
@ -318,7 +318,7 @@ const showPDFModalH5 = (pdfUrl, fileName, resolve) => {
<span style="font-size: 16px; color: #333;">${fileName}</span>
<span style="font-size: 30px; color: #999; cursor: pointer; padding: 0 10px;">×</span>
`;
const iframe = document.createElement('iframe');
iframe.src = pdfUrl;
iframe.style.cssText = `
@ -326,14 +326,14 @@ const showPDFModalH5 = (pdfUrl, fileName, resolve) => {
flex: 1;
border: none;
`;
// 关闭按钮
header.querySelector('span:last-child').onclick = () => {
document.body.removeChild(modal);
URL.revokeObjectURL(pdfUrl);
resolve();
};
// 按ESC关闭
const escHandler = (e) => {
if (e.key === 'Escape') {
@ -344,7 +344,7 @@ const showPDFModalH5 = (pdfUrl, fileName, resolve) => {
}
};
document.addEventListener('keydown', escHandler);
modal.appendChild(header);
modal.appendChild(iframe);
document.body.appendChild(modal);
@ -375,7 +375,7 @@ const handleOtherFile = async (response, fileName, fileExtension, platform) => {
const openWithDefaultApp = (response, fileName, fileExtension, platform) => {
return new Promise((resolve, reject) => {
const blob = new Blob([response]);
// H5环境
if (platform === 'h5') {
const blobUrl = URL.createObjectURL(blob);
@ -391,18 +391,18 @@ const openWithDefaultApp = (response, fileName, fileExtension, platform) => {
resolve();
return;
}
// App环境
if (platform === 'app') {
const reader = new FileReader();
reader.onload = (e) => {
const arrayBuffer = e.target.result;
const base64Data = arrayBufferToBase64(arrayBuffer);
plus.io.requestFileSystem(plus.io.PRIVATE_DOC, function(fs) {
fs.root.getFile(fileName, {create: true}, function(fileEntry) {
fileEntry.createWriter(function(writer) {
writer.onwrite = function() {
plus.io.requestFileSystem(plus.io.PRIVATE_DOC, function (fs) {
fs.root.getFile(fileName, {create: true}, function (fileEntry) {
fileEntry.createWriter(function (writer) {
writer.onwrite = function () {
plus.runtime.openFile(fileEntry.toLocalURL());
resolve();
};
@ -415,14 +415,14 @@ const openWithDefaultApp = (response, fileName, fileExtension, platform) => {
reader.readAsArrayBuffer(blob);
return;
}
// 微信小程序环境
if (platform === 'weixin') {
const reader = new FileReader();
reader.onload = (e) => {
const arrayBuffer = e.target.result;
const base64Data = arrayBufferToBase64(arrayBuffer);
wx.getFileSystemManager().writeFile({
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
data: base64Data,
@ -446,7 +446,7 @@ const openWithDefaultApp = (response, fileName, fileExtension, platform) => {
const saveFile = (response, fileName, platform) => {
return new Promise((resolve, reject) => {
const blob = new Blob([response]);
// H5环境
if (platform === 'h5') {
const blobUrl = URL.createObjectURL(blob);
@ -462,18 +462,18 @@ const saveFile = (response, fileName, platform) => {
resolve();
return;
}
// App环境
if (platform === 'app') {
const reader = new FileReader();
reader.onload = (e) => {
const arrayBuffer = e.target.result;
const base64Data = arrayBufferToBase64(arrayBuffer);
plus.io.requestFileSystem(plus.io.PRIVATE_DOC, function(fs) {
fs.root.getFile(fileName, {create: true}, function(fileEntry) {
fileEntry.createWriter(function(writer) {
writer.onwrite = function() {
plus.io.requestFileSystem(plus.io.PRIVATE_DOC, function (fs) {
fs.root.getFile(fileName, {create: true}, function (fileEntry) {
fileEntry.createWriter(function (writer) {
writer.onwrite = function () {
uni.showToast({
title: '保存成功',
icon: 'success'
@ -489,14 +489,14 @@ const saveFile = (response, fileName, platform) => {
reader.readAsArrayBuffer(blob);
return;
}
// 微信小程序环境
if (platform === 'weixin') {
const reader = new FileReader();
reader.onload = (e) => {
const arrayBuffer = e.target.result;
const base64Data = arrayBufferToBase64(arrayBuffer);
wx.getFileSystemManager().writeFile({
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
data: base64Data,
@ -542,4 +542,10 @@ const getMimeType = (extension) => {
'txt': 'text/plain'
};
return mimeTypes[extension] || 'application/octet-stream';
}
export const navigateTo = (path) => {
uni.navigateTo({
url: path
})
}