Commit 653ee653 authored by 沈翠玲's avatar 沈翠玲

增加全局加载

parent 809357e7
......@@ -17,6 +17,24 @@ const defaultConfig = {
},
};
let loadingRequestCount = 0
let loadingInstance
const showLoading = () => {
if (loadingRequestCount === 0) {
loadingInstance = ElLoading.service({ target: '.el-main' })
}
loadingRequestCount += 1
}
const hideLoading = () => {
if (loadingRequestCount <= 0) return
loadingRequestCount -= 1
if (loadingRequestCount === 0) {
// nextTick(() => {
loadingInstance.close()
// })
}
}
const axiosCanceler = new AxiosCanceler();
class RequestClient {
......@@ -25,11 +43,11 @@ class RequestClient {
this.instance.interceptors.request.use(
(config) => {
showLoading()
if (config.cancel == null) {
config.cancel = true;
}
config.cancel && axiosCanceler.addPending(config);
const { tenant } = useUserStore();
// 设置调解中心请求头
config.headers['tenantId'] = tenant?.id;
......@@ -47,9 +65,9 @@ class RequestClient {
this.instance.interceptors.response.use(
(response) => {
hideLoading()
const { data, config } = response;
axiosCanceler.removePending(config);
// 登录失效
if (data.code === 404) {
router.replace(LOGIN_URL);
......@@ -74,6 +92,7 @@ class RequestClient {
return data;
},
(error) => {
hideLoading()
const { response } = error;
// 请求超时 && 网络错误单独判断,没有 response
if (error.message.indexOf('timeout') !== -1)
......
......@@ -412,6 +412,7 @@
line-height: 11px;
width: 240px;
height: 40px;
padding-left: 5px;
font-size: 14px;
&.label {
background: #f6f8ff;
......
......@@ -114,6 +114,32 @@
<el-icon><Plus /></el-icon>
<div>附件</div>
</div>
<template #file="{ file }">
<img
class="el-upload-list__item-thumbnail"
:src="updataIf(file) ? getImageUrl() :file.url"
alt=""
>
<span class="el-upload-list__item-actions">
<!-- <span
class="el-upload-list__item-delete"
>
<el-icon @click="handleRemove1(file)">
<Delete />
</el-icon>
</span> -->
<span
class="el-upload-list__item-preview"
>
<el-icon v-if="updataIf(file)" @click="download(file.url)">
<Download />
</el-icon>
<el-icon v-else @click="handlePictureCardPreview(file)">
<ZoomIn />
</el-icon>
</span>
</span>
</template>
</el-upload>
</el-form-item>
</el-col>
......@@ -163,6 +189,7 @@
import { getAppEnvConfig } from '@/utils/env';
import Decimal from 'decimal.js';
import { useDict } from '@/hooks/useDict';
import { inject } from 'vue';
const { PhoneResultStatus, RepayStatus, FlowStatus, FollowStatus, AuditStatus, CaseStatus } = useDict("PhoneResultStatus","RepayStatus", "FlowStatus", "FollowStatus","AuditStatus", "CaseStatus");
const envs = getAppEnvConfig();
const url = envs.VITE_GLOB_API_URL_PREFIX + '/sys/upload';
......@@ -174,6 +201,7 @@
const splitdata = ref([]);
const dialogImageUrl = ref('');
const dialogVisible = ref(false);
const downloadfile = inject('download');
const form = reactive({
remainingAmount: 0,
images: [],
......@@ -191,7 +219,28 @@
const onHide = (done) => {
done();
};
const download = (item) => {
const name = item.slice(item.lastIndexOf('/') + 1, item.length);
downloadfile(item.replace(envs.VITE_GLOB_API_URL_PREFIX, ''), {}, name);
};
const updataIf = (e) => {
if (e.fileName) {
if (e.fileName.split('.')[1] === 'png' || e.fileName.split('.')[1] === 'jpeg' || e.fileName.split('.')[1] === 'jpg') {
return false
} else {
return true
}
} else {
if (e.name.split('.')[1] === 'png' || e.name.split('.')[1] === 'jpeg' || e.name.split('.')[1] === 'jpg') {
return false
} else {
return true
}
}
}
const getImageUrl = () => {
return new URL(`@/assets/images/file.svg`, import.meta.url).href;
}
const editOrConfirm = () => {
if (editFirst.value) {
if (!splitdata.value[0].applyAmount || isNaN(Number(splitdata.value[0].applyAmount)))
......
......@@ -439,6 +439,7 @@
line-height: 11px;
width: 240px;
height: 40px;
padding-left: 5px;
font-size: 14px;
&.label {
background: #f6f8ff;
......
......@@ -359,6 +359,7 @@
line-height: 11px;
width: 240px;
height: 40px;
padding-left: 5px;
font-size: 14px;
&.label {
background: #f6f8ff;
......
......@@ -155,13 +155,19 @@
</div>
</div>
<div class="right-idea">
<ProTable
<!-- <ProTable
:config="config"
:data="tabledata"
ref="caseLRef"
:showPagination="false"
:showToolBar="false"
/>
/> -->
<vxe-grid
v-bind="{...config, ...{data: tabledata}}"
:show-footer="true"
:footer-method="footerMethod"
ref="caseLRef"
></vxe-grid>
</div>
</div>
</template>
......@@ -502,6 +508,14 @@
const leftChange = (value, direction) => {
console.log(value, direction); //这个就是它包含的所有的属性以及事件,如果需要别的操作直接执行,也可以查询到
};
// 进行合计
const sumNum = (costForm, type) => {
let total = 0;
for (let i = 0; i < costForm.length; i++) {
total = Decimal(total).add(Decimal(costForm[i][type]))
}
return total;
};
const options = [
{
label: '以案人数均分',
......@@ -516,9 +530,28 @@
value: 'AMOUNT',
},
];
const footerMethod = ({ columns, data }) => {
const footerData = [
columns.map((column, _columnIndex) => {
if (_columnIndex === 0) {
return '合计';
}
if (
['borrowerNum', 'caseNum', 'amount'].includes(
column.field
)
) {
return sumNum(data, column.field);
}
return null;
}),
]
return footerData
}
const config = computed(() => {
// 去除分页控件,toolbar控件
return {
height: 'auto',
toolbarConfig: { enabled: false },
columns: [
{ type: 'seq', width: 50, title: '序号' },
......
......@@ -372,6 +372,7 @@
width: 240px;
height: 40px;
font-size: 14px;
padding-left: 5px;
line-height: 11px;
&.label {
width: 160px;
......
......@@ -223,7 +223,6 @@
return new URL(`@/assets/images/file.svg`, import.meta.url).href;
}
const updataIf = (e) => {
console.log('eeee', e)
if (e.fileName) {
if (e.fileName.split('.')[1] === 'png' || e.fileName.split('.')[1] === 'jpeg' || e.fileName.split('.')[1] === 'jpg') {
return false
......
......@@ -1555,6 +1555,7 @@
line-height: 11px;
width: 240px;
height: 40px;
padding-left: 5px;
font-size: 14px;
&.label {
width: 125px;
......@@ -1584,6 +1585,7 @@
line-height: 11px;
height: 40px;
font-size: 14px;
padding-left: 5px;
&.label {
text-align: center;
background: #f6f8ff;
......
......@@ -47,6 +47,11 @@
if (obj['cpeDate'][1]) obj['cpeDateEnd'] = obj['cpeDate'][1];
delete obj['cpeDate'];
}
if (obj['trackTime']) {
if (obj['trackTime'][0]) obj['trackTimeBegin'] = obj['trackTime'][0];
if (obj['trackTime'][1]) obj['trackTimeEnd'] = obj['trackTime'][1];
delete obj['trackTime'];
}
if (obj['tenantTime']) {
if (obj['tenantTime'][0]) obj['tenantTimeBegin'] = obj['tenantTime'][0];
if (obj['tenantTime'][1]) obj['tenantTimeEnd'] = obj['tenantTime'][1];
......@@ -220,6 +225,17 @@
labelWidth: 90
},
},
{
field: 'trackTime',
title: '跟进时间',
showOverflow: 'tooltip',
width: 130,
search: {
el: 'date-picker',
props: { type: 'daterange', valueFormat: 'YYYY-MM-DD' },
labelWidth: 90
},
},
{
field: 'principalBalance',
showOverflow: 'tooltip',
......
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