Commit e228a557 authored by 沈翠玲's avatar 沈翠玲

资产导入接口对接

parent 68d5fe62
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
"eslint-plugin-prettier": "^5.2.1", "eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-vue": "^9.31.0", "eslint-plugin-vue": "^9.31.0",
"esno": "^4.8.0", "esno": "^4.8.0",
"file-saver": "^2.0.5",
"mitt": "^3.0.1", "mitt": "^3.0.1",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"pinia": "^2.2.7", "pinia": "^2.2.7",
......
import request from '@/utils/http/index';
// 资产数据导入
export const LoanSubmit = (params) => {
return request.get('/LoanExcel/importExcel', params);
};
// 资产数据导入
export const importLoanPage = (params) => {
return request.get('/importLoan/page', params);
};
...@@ -7,7 +7,7 @@ import { setupElementPlus } from '@/plugins/element-plus'; ...@@ -7,7 +7,7 @@ import { setupElementPlus } from '@/plugins/element-plus';
import { setupDirectives } from '@/plugins/directives'; import { setupDirectives } from '@/plugins/directives';
import { setupVxeTabele } from './plugins/vxe-table'; import { setupVxeTabele } from './plugins/vxe-table';
import ProTable from '@/components/ProTable/index.vue'; import ProTable from '@/components/ProTable/index.vue';
import { download } from '@/utils/http/index';
export async function bootstrapInstall() { export async function bootstrapInstall() {
const app = createApp(App); const app = createApp(App);
...@@ -26,6 +26,7 @@ export async function bootstrapInstall() { ...@@ -26,6 +26,7 @@ export async function bootstrapInstall() {
// 挂载路由 // 挂载路由
setupRouter(app); setupRouter(app);
app.component('ProTable', ProTable); app.component('ProTable', ProTable);
app.provide('download', download);
// 路由准备就绪后挂载 APP 实例 // 路由准备就绪后挂载 APP 实例
await router.isReady(); await router.isReady();
......
import Axios from 'axios'; import Axios from 'axios';
import { ElMessage } from 'element-plus'; import { ElMessage, ElLoading } from 'element-plus';
import { getAppEnvConfig } from '../env'; import { getAppEnvConfig } from '../env';
import { AxiosCanceler } from './axiosCancel'; import { AxiosCanceler } from './axiosCancel';
import { stringify } from 'qs'; import { stringify } from 'qs';
import router from '@/router'; import router from '@/router';
import { LOGIN_URL } from '@/config'; import { LOGIN_URL } from '@/config';
import { useUserStore } from '@/stores/modules/user'; import { useUserStore } from '@/stores/modules/user';
import { saveAs } from 'file-saver';
const envs = getAppEnvConfig(); const envs = getAppEnvConfig();
const defaultConfig = { const defaultConfig = {
baseURL: envs.VITE_GLOB_API_URL_PREFIX, baseURL: envs.VITE_GLOB_API_URL_PREFIX,
...@@ -147,4 +147,28 @@ export const checkStatus = (status) => { ...@@ -147,4 +147,28 @@ export const checkStatus = (status) => {
} }
}; };
// 通用下载方法
export function download(url, params, filename) {
const downloadLoadingInstance = ElLoading.service({
text: '正在下载数据,请稍候',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
});
return new RequestClient()
.get(url, params, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob',
})
.then(async (data) => {
const blob = new Blob([data]);
saveAs(blob, filename);
downloadLoadingInstance.close();
})
.catch((r) => {
console.error(r);
ElMessage.error('下载文件出现错误,请联系管理员!');
downloadLoadingInstance.close();
});
}
export default new RequestClient(); export default new RequestClient();
...@@ -106,6 +106,11 @@ ...@@ -106,6 +106,11 @@
field: 'payOrg', field: 'payOrg',
title: '借款机构', title: '借款机构',
search: { el: 'input' }, search: { el: 'input' },
},
{
field: 'borrower.name',
title: '借款人名字',
search: { el: 'input', key: 'borrower' },
width: 80, width: 80,
}, },
{ {
......
...@@ -84,6 +84,12 @@ ...@@ -84,6 +84,12 @@
search: { el: 'input' }, search: { el: 'input' },
width: 80, width: 80,
}, },
{
field: 'borrower.name',
title: '借款人名字',
search: { el: 'input', key: 'borrower' },
width: 80,
},
{ {
field: 'reduceAmount', field: 'reduceAmount',
title: '减免金额', title: '减免金额',
......
...@@ -94,6 +94,12 @@ ...@@ -94,6 +94,12 @@
search: { el: 'input' }, search: { el: 'input' },
width: 80, width: 80,
}, },
{
field: 'borrower.name',
title: '借款人名字',
search: { el: 'input', key: 'borrower' },
width: 80,
},
{ {
field: 'id', field: 'id',
title: '还款记录ID', title: '还款记录ID',
......
...@@ -100,11 +100,11 @@ ...@@ -100,11 +100,11 @@
> >
<el-button <el-button
size="small" size="small"
:type="resuleObj.childrenlabel === item1.label ? 'primary' : null" :type="resuleObj.childrenlabel === item1.value ? 'primary' : null"
plain plain
v-for="(item1, index1) in item.children" v-for="(item1, index1) in item.children"
:key="`tabchild${index1}`" :key="`tabchild${index1}`"
@click="resuleObj.childrenlabel = item1.label" @click="resuleObj.childrenlabel = item1.value"
>{{ item1.label }}</el-button >{{ item1.label }}</el-button
> >
</el-tab-pane> </el-tab-pane>
...@@ -158,7 +158,6 @@ ...@@ -158,7 +158,6 @@
</el-form-item> </el-form-item>
<el-form-item label="微信图片附件:" prop="code" class="w-full"> <el-form-item label="微信图片附件:" prop="code" class="w-full">
<el-upload <el-upload
v-model:file-list="form.images"
:action="url" :action="url"
list-type="picture-card" list-type="picture-card"
class="mypicture" class="mypicture"
...@@ -174,7 +173,6 @@ ...@@ -174,7 +173,6 @@
</el-form-item> </el-form-item>
<el-form-item label="短信图片附件:" prop="code" class="w-full"> <el-form-item label="短信图片附件:" prop="code" class="w-full">
<el-upload <el-upload
v-model:file-list="form.notes"
:action="url" :action="url"
list-type="picture-card" list-type="picture-card"
class="mypicture" class="mypicture"
...@@ -190,7 +188,6 @@ ...@@ -190,7 +188,6 @@
</el-form-item> </el-form-item>
<el-form-item label="其他图片附件:" prop="code" class="w-full"> <el-form-item label="其他图片附件:" prop="code" class="w-full">
<el-upload <el-upload
v-model:file-list="form.others"
:action="url" :action="url"
list-type="picture-card" list-type="picture-card"
class="mypicture" class="mypicture"
...@@ -223,7 +220,7 @@ ...@@ -223,7 +220,7 @@
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { computed } from 'vue'; import { computed } from 'vue';
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { ElInputNumber } from 'element-plus'; import { ElInputNumber, ElMessage } from 'element-plus';
import { Upload } from '@element-plus/icons-vue'; import { Upload } from '@element-plus/icons-vue';
import { getAppEnvConfig } from '@/utils/env'; import { getAppEnvConfig } from '@/utils/env';
import { saveTrackRecord } from '@/api/property'; import { saveTrackRecord } from '@/api/property';
...@@ -232,15 +229,51 @@ ...@@ -232,15 +229,51 @@
const showModal = ref(false); const showModal = ref(false);
const editFirst = ref(false); const editFirst = ref(false);
const tabledata = ref([]); const tabledata = ref([]);
const splitdata = ref([]);
const progressFlag = ref(false); const progressFlag = ref(false);
const loadProgress = ref(0); const loadProgress = ref(0);
const dialogImageUrl = ref(''); const dialogImageUrl = ref('');
const dialogVisible = ref(false); const dialogVisible = ref(false);
const emits = defineEmits(['success']);
const tabObj = [ const tabObj = [
{ label: '本人可联', children: [{ label: '接听有实质沟通' }, { label: '接听后挂断' }] }, {
{ label: '联系人可联', children: [{ label: '接听有实质1' }, { label: '接听后2' }] }, label: '本人可联',
{ label: '未接听', children: [{ label: '接听有实质3' }, { label: '接听后4' }] }, children: [
{ label: '接通后挂断', value: 'hang_up' },
{ label: '接通有实质进展', value: 'progress' },
],
},
{
label: '联系人可联',
children: [
{ label: '接通有效转告', value: 'pass_on' },
{ label: '接通拒绝转告', value: 'no_pass' },
{ label: '接听后挂断', value: 'Hang_up_after_answering' },
{ label: '接通无应答', value: 'No_response_when_connected' },
{ label: '称与债人无关', value: 'Claims_unrelated_to_creditors' },
{ label: '称非本人', value: 'Claiming_not_to_be_myself' },
],
},
{
label: '未接听',
children: [
{ label: '无人接听', value: 'no_answer' },
{ label: '关机', value: 'Shutdown' },
{ label: '空号', value: 'dead_number' },
{ label: '占线/忙音/正在通话中', value: 'Busy' },
{ label: '停机', value: 'closing_down' },
{ label: '机器人回复', value: 'Robot_reply' },
],
},
{
label: '非电联',
children: [
{ label: '微信', value: 'WeChat' },
{ label: '短信', value: 'short_message' },
{ label: 'QQ', value: 'QQ' },
{ label: '飞书', value: 'fly' },
{ label: '钉钉', value: 'DING' },
],
},
]; ];
const resuleObj = reactive({ const resuleObj = reactive({
...@@ -299,28 +332,6 @@ ...@@ -299,28 +332,6 @@
value: 'repayment_others', value: 'repayment_others',
}, },
]; ];
const options = [
{
value: 'Option1',
label: 'Option1',
},
{
value: 'Option2',
label: 'Option2',
},
{
value: 'Option3',
label: 'Option3',
},
{
value: 'Option4',
label: 'Option4',
},
{
value: 'Option5',
label: 'Option5',
},
];
const selectdList = ref([]); const selectdList = ref([]);
const onCheckboxChange = (row) => { const onCheckboxChange = (row) => {
selectdList.value = row.records; selectdList.value = row.records;
...@@ -383,104 +394,69 @@ ...@@ -383,104 +394,69 @@
const config = reactive({ const config = reactive({
minHeight: 200, minHeight: 200,
columns: [ columns: [
{ type: 'checkbox', width: 50 }, // { type: 'checkbox', width: 50 },
{ {
field: 'code', field: 'caseId',
title: '案件ID', title: '案件ID',
}, },
{ {
field: 'code', field: 'product',
title: '产品', title: '产品',
}, },
{ {
field: 'code', field: 'payOrg',
title: '借款机构', title: '借款机构',
}, },
{ {
field: 'code', field: 'commissionAmount',
title: '委案金额', title: '委案金额',
}, },
{ {
field: 'code', field: 'sumReductionAmount',
title: '累计减免金额', title: '累计减免金额',
}, },
{ {
field: 'code', field: 'sumRepayAmount',
title: '累计还款金额', title: '累计还款金额',
}, },
{ {
field: 'code', field: 'remainingAmount',
title: '剩余待还金额', title: '剩余待还金额',
}, },
], ],
onCheckboxChange: onCheckboxChange, onCheckboxChange: onCheckboxChange,
toolbarConfig: { enabled: false }, toolbarConfig: { enabled: false },
}); });
const splitconfig = computed(() => { const openModal = (info, detail, caselist) => {
return {
minHeight: 200,
columns: [
{ type: 'seq', width: 50, title: '期次' },
{
field: 'code',
title: '到期日',
},
{
field: 'code',
title: '状态',
width: 70,
},
{
field: 'num',
title: '金额',
slots: {
default: ({ row, rowIndex }) => {
if (editFirst.value && rowIndex === 0) {
return (
<>
<ElInputNumber v-model={row.num} />
</>
);
} else {
return <>{row.num}</>;
}
},
},
},
],
onCheckboxChange: onCheckboxChange,
};
});
tabledata.value = [
{ name: 'admin', code: 'admin', role: 'superadmin', num: 1 },
{ name: 'account1', code: 'account1', role: 'user', num: 1 },
{ name: 'account2', code: 'account2', role: 'user', num: 1 },
{ name: 'account3', code: 'account3', role: 'user', num: 1 },
];
splitdata.value = [
{ name: 'admin', code: 'admin', role: 'superadmin', num: 1 },
{ name: 'account1', code: 'account1', role: 'user', num: 1 },
{ name: 'account2', code: 'account2', role: 'user', num: 1 },
{ name: 'account3', code: 'account3', role: 'user', num: 1 },
];
const openModal = (info, detail) => {
showModal.value = true; showModal.value = true;
currentInfo.value = info; currentInfo.value = info;
currentDetail.value = detail; currentDetail.value = detail;
console.log('currentInfo', currentInfo.value, currentDetail.value);
tabledata.value = caselist;
}; };
const submitForm = () => { const submitForm = () => {
saveTrackRecord({ saveTrackRecord({
credit: currentDetail.value, loan: currentDetail.value,
guarantor: currentInfo.value,
trackTime: form.trackTime, trackTime: form.trackTime,
nextTime: form.nextTime, nextTime: form.nextTime,
phoneResultStatus: form.phoneResultStatus, phoneResultStatus: form.phoneResultStatus,
followStatus: resuleObj.childrenlabel,
remark: form.remark, remark: form.remark,
voices: form.voices, voices: form.voices.map((v) => v.url),
images: form.images, images: form.images.map((v) => v.url),
notes: form.notes, notes: form.notes.map((v) => v.url),
others: form.others, others: form.others.map((v) => v.url),
}).then((res) => { }).then((res) => {
console.log('refsss', res); if (res.success) {
ElMessage.success({
message: '保存成功',
plain: true,
});
showModal.value = false;
emits('success');
}
}); });
}; };
defineExpose({ defineExpose({
......
...@@ -209,6 +209,7 @@ ...@@ -209,6 +209,7 @@
<reduceDrawer ref="reduceDrawerRef" @success="query('减免')"></reduceDrawer> <reduceDrawer ref="reduceDrawerRef" @success="query('减免')"></reduceDrawer>
<splitDrawer ref="splitDrawerRef" @success="query('分期')"></splitDrawer> <splitDrawer ref="splitDrawerRef" @success="query('分期')"></splitDrawer>
<callDrawer ref="callDrawerRef" @success="query('跟进')"></callDrawer> <callDrawer ref="callDrawerRef" @success="query('跟进')"></callDrawer>
<el-image-viewer :url-list="srcList" v-if="RefImage" @close="RefImage = false" />
</div> </div>
</template> </template>
...@@ -221,6 +222,7 @@ ...@@ -221,6 +222,7 @@
import reduceDrawer from './components/reduceDrawer.vue'; import reduceDrawer from './components/reduceDrawer.vue';
import splitDrawer from './components/splitDrawer.vue'; import splitDrawer from './components/splitDrawer.vue';
import callDrawer from './components/callDrawer.vue'; import callDrawer from './components/callDrawer.vue';
import { getAppEnvConfig } from '@/utils/env';
import { import {
getCredit, getCredit,
getTrackRecordPage, getTrackRecordPage,
...@@ -229,16 +231,22 @@ ...@@ -229,16 +231,22 @@
listByBorrower, listByBorrower,
getRepayRecords, getRepayRecords,
} from '@/api/property'; } from '@/api/property';
import { Picture, Download } from '@element-plus/icons-vue';
import { inject } from 'vue';
const envs = getAppEnvConfig();
const returnData = ref([]); const returnData = ref([]);
const recordData = ref([]); const recordData = ref([]);
const reduceData = ref([]); const reduceData = ref([]);
const splitData = ref([]); const splitData = ref([]);
const srcList = ref([]);
const RefImage = ref(false);
const splitDeData = ref([]); const splitDeData = ref([]);
const detail = ref({ const detail = ref({
borrower: { borrower: {
guarantors: [], guarantors: [],
}, },
}); });
const downloadfile = inject('download');
const splitRef = ref(); const splitRef = ref();
const caseDetailRef = ref(); const caseDetailRef = ref();
const returnModalRef = ref(); const returnModalRef = ref();
...@@ -260,9 +268,22 @@ ...@@ -260,9 +268,22 @@
const callTelephone = (row) => { const callTelephone = (row) => {
callDrawerRef.value.openModal( callDrawerRef.value.openModal(
JSON.parse(JSON.stringify(row)), JSON.parse(JSON.stringify(row)),
JSON.parse(JSON.stringify(detail.value)) JSON.parse(JSON.stringify(detail.value)),
JSON.parse(JSON.stringify(caseDetailConfig.data))
); );
}; };
const preview = (item, type) => {
const list = [];
item[type].forEach((v) => {
list.push(envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/' + v);
});
RefImage.value = true;
srcList.value = list;
};
const download = (item) => {
const name = item.slice(item.lastIndexOf('/') + 1, item.length);
downloadfile(envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/' + item, {}, name);
};
const followStatusOpt = [ const followStatusOpt = [
{ label: '接通后挂断', value: 'hang_up' }, { label: '接通后挂断', value: 'hang_up' },
{ label: '接通有实质进展', value: 'progress' }, { label: '接通有实质进展', value: 'progress' },
...@@ -331,6 +352,7 @@ ...@@ -331,6 +352,7 @@
], ],
toolbarConfig: { enabled: false }, toolbarConfig: { enabled: false },
}); });
const recordConfig = reactive({ const recordConfig = reactive({
columns: [ columns: [
{ {
...@@ -390,19 +412,70 @@ ...@@ -390,19 +412,70 @@
{ {
field: 'voices', field: 'voices',
title: '通话录音', title: '通话录音',
slots: {
default: ({ row, rowIndex }) => {
if (row.voices && row.voices.length > 0) {
return (
<>
{row.voices.map((item, index) => (
<el-icon>
<Download onClick={() => download(item)} />
</el-icon>
))}
</>
);
}
},
},
}, },
{ {
field: 'code', field: 'code',
title: '微信图片附件', title: '微信图片附件',
slots: { slots: {
default: ({ row, rowIndex }) => { default: ({ row, rowIndex }) => {
if (row.images && row.images.length > 0) {
return ( return (
<> <>
<ElButton type="primary" link onClick={() => callTelephone(row)}> <el-icon>
下载 <Picture onClick={() => preview(row, 'images')} />
</ElButton> </el-icon>
</> </>
); );
}
},
},
},
{
field: 'code',
title: '短信图片附件',
slots: {
default: ({ row, rowIndex }) => {
if (row.notes && row.notes.length > 0) {
return (
<>
<el-icon>
<Picture onClick={() => preview(row, 'notes')} />
</el-icon>
</>
);
}
},
},
},
{
field: 'code',
title: '其他图片附件',
slots: {
default: ({ row, rowIndex }) => {
if (row.others && row.others.length > 0) {
return (
<>
<el-icon>
<Picture onClick={() => preview(row, 'others')} />
</el-icon>
</>
);
}
}, },
}, },
}, },
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
width: 120, width: 120,
search: { search: {
el: 'input', el: 'input',
key: 'borrower.name', key: 'borrowerName',
props: { clearable: true }, props: { clearable: true },
}, },
}, },
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
search: { search: {
el: 'input', el: 'input',
props: { clearable: true }, props: { clearable: true },
key: 'borrower.idCard', key: 'borrowerIdCard',
}, },
}, },
{ {
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
search: { search: {
el: 'input', el: 'input',
props: { clearable: true }, props: { clearable: true },
key: 'borrower.phone', key: 'borrowerPhone',
}, },
}, },
{ {
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
field: 'cpe.username', field: 'cpe.username',
title: 'CPE', title: 'CPE',
width: 80, width: 80,
search: { el: 'input', props: { clearable: true }, key: 'cpe.username' }, search: { el: 'input', props: { clearable: true }, key: 'cpeName' },
}, },
{ {
field: 'cpeDate', field: 'cpeDate',
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
v-model="showModal" v-model="showModal"
title="案件明细" title="案件明细"
@hide="onHide" @hide="onHide"
width="400px" height="582"
width="1003"
show-footer show-footer
esc-closable esc-closable
> >
......
...@@ -21,37 +21,32 @@ ...@@ -21,37 +21,32 @@
<!-- 进度条 --> <!-- 进度条 -->
<!-- <el-progress v-if="progressFlag" :percentage="loadProgress" /> --> <!-- <el-progress v-if="progressFlag" :percentage="loadProgress" /> -->
<div class="mt-2 text-sm text-gray-400"> 仅支持1个文件上传,格式为xls和xlsx </div> <div class="mt-2 text-sm text-gray-400"> 仅支持1个文件上传,格式为xls和xlsx </div>
<div class="mt-1 text-blue-500 underline">下载模板</div> <div class="mt-1 text-blue-500 underline cursor-pointer" @click="downloadtemplate"
>下载模板</div
>
</div> </div>
</div> </div>
<div class="flex-1"> <div class="flex-1">
<div class="mb-1">2、检查数据</div> <div class="mb-1">2、检查数据</div>
<div> <div>
<div class="flex items-center"> <div class="flex items-center">
<el-button type="danger" :disabled="!form.path" @click="checkData">检查</el-button> <el-button type="danger" @click="checkData">检查</el-button>
<span class="ml-2"> 通过 </span> <span class="ml-2"> 通过 </span>
</div> </div>
<!-- 进度条 --> <!-- 进度条 -->
<el-progress v-if="progressFlag" :percentage="loadProgress" /> <el-progress v-if="progressFlag" :percentage="loadProgress" />
<div class="mt-2 text-sm text-gray-400">下载检查结果</div> <div class="mt-2 text-sm text-blue-500 underline cursor-pointer">下载检查结果</div>
</div> </div>
</div> </div>
<div class="flex-1"> <div class="flex-1">
<div class="mb-1 text-center">3、上传数据</div> <div class="mb-1 text-center">3、上传数据</div>
<div class="pr-4"> <div class="pr-4">
<el-form ref="formRef" inline :model="form" :rules="rules" label-width="85px"> <el-form ref="formRef" inline :model="form" :rules="rules" label-width="85px">
<el-form-item class="w-full" label="导入编号:" prop="name"> <el-form-item class="w-full" label="导入编号:" prop="code">
<el-input v-model="form.name" placeholder="请输入" style="width: 100%" /> <el-input v-model="form.code" placeholder="请输入" style="width: 100%" />
</el-form-item> </el-form-item>
<el-form-item class="w-full" label="资管公司:" prop="name"> <el-form-item class="w-full" label="委案合同:" prop="contractNo">
<el-select v-model="form.name" placeholder="请选择" style="width: 100%"> <el-input v-model="form.contractNo" placeholder="请输入" style="width: 100%" />
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button type="primary" @click="submitData">上传</el-button> <el-button type="primary" @click="submitData">上传</el-button>
...@@ -59,7 +54,7 @@ ...@@ -59,7 +54,7 @@
</div> </div>
</div> </div>
<div> <div>
<ProTable :config="config" :data="data"> <ProTable :config="config" :api="importLoanPage" ref="ProTableRef">
<!-- 表格 header 按钮 --> <!-- 表格 header 按钮 -->
<!-- <template #left_buttons> <!-- <template #left_buttons>
<el-button type="primary">新增菜单 </el-button> <el-button type="primary">新增菜单 </el-button>
...@@ -75,10 +70,15 @@ ...@@ -75,10 +70,15 @@
import caseDetailModal from './components/caseDetailModal.vue'; import caseDetailModal from './components/caseDetailModal.vue';
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { computed } from 'vue'; import { computed, onMounted } from 'vue';
import { ElButton } from 'element-plus'; import { ElButton, ElMessage } from 'element-plus';
import { Upload, Delete } from '@element-plus/icons-vue'; import { Upload } from '@element-plus/icons-vue';
import { inject } from 'vue';
import { LoanSubmit, importLoanPage } from '@/api/import';
const downloadfile = inject('download');
const envs = getAppEnvConfig(); const envs = getAppEnvConfig();
const ProTableRef = ref();
const progressFlag = ref(false); const progressFlag = ref(false);
const proTable = ref(undefined); const proTable = ref(undefined);
const options = ref([]); const options = ref([]);
...@@ -89,12 +89,12 @@ ...@@ -89,12 +89,12 @@
const config = reactive({ const config = reactive({
columns: [ columns: [
{ {
field: 'name', field: 'code',
title: '导入编号', title: '导入编号',
search: { el: 'input', span: 1.5, props: { clearable: true } }, search: { el: 'input', span: 1.5, props: { clearable: true } },
}, },
{ {
field: 'name', field: 'contractNo',
title: '委案合同', title: '委案合同',
search: { el: 'input', span: 1.5, props: { clearable: true } }, search: { el: 'input', span: 1.5, props: { clearable: true } },
}, },
...@@ -120,27 +120,27 @@ ...@@ -120,27 +120,27 @@
fieldNames: { label: 'genderLabel', value: 'genderValue' }, fieldNames: { label: 'genderLabel', value: 'genderValue' },
}, },
{ {
field: 'role', field: 'totalCaseNum',
title: '案件总数', title: '案件总数',
}, },
{ {
field: 'role', field: 'totalAmount',
title: '案件总金额', title: '案件总金额',
}, },
{ {
field: 'role', field: 'totalBorrowerNum',
title: '客户总数', title: '客户总数',
}, },
{ {
field: 'action', field: 'totalPengNum',
title: '撞库次数', title: '撞库次数',
width: 200, width: 200,
slots: { slots: {
default: ({ row }) => { default: ({ row }) => {
return ( return (
<> <>
<ElButton link type="primary" icon={Delete} onClick={() => linkZK(row)}> <ElButton link type="primary" onClick={() => linkZK(row)}>
10 {row.totalPengNum}
</ElButton> </ElButton>
</> </>
); );
...@@ -155,8 +155,8 @@ ...@@ -155,8 +155,8 @@
default: ({ row }) => { default: ({ row }) => {
return ( return (
<> <>
<ElButton link type="primary" icon={Delete} onClick={() => downfile(row)}> <ElButton link type="primary" onClick={() => downfile(row)}>
10 下载
</ElButton> </ElButton>
</> </>
); );
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
}, },
}, },
{ {
field: 'role', field: 'createTime',
title: '创建日期', title: '创建日期',
search: { search: {
el: 'date-picker', el: 'date-picker',
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
const form = reactive({ const form = reactive({
path: '', path: '',
code: '', code: '',
role: '', contractNo: '',
}); });
const upload = reactive({ const upload = reactive({
// 是否禁用上传 // 是否禁用上传
...@@ -189,14 +189,36 @@ ...@@ -189,14 +189,36 @@
const uploadVideoProcess = (event, file, fileList) => { const uploadVideoProcess = (event, file, fileList) => {
upload.isUploading = true; upload.isUploading = true;
}; };
const downloadtemplate = () => {
downloadfile('/LoanExcel/downloadTemplate', {}, '模版.xls');
};
const checkData = () => {}; const checkData = () => {};
const submitData = () => { const submitData = () => {
LoanSubmit({
file: form.path,
code: form.code,
contractNo: form.contractNo,
}).then((res) => {});
uploadRef.value.clearFiles(); uploadRef.value.clearFiles();
form.path = ''; form.path = '';
}; };
const handleFileSuccess = (response, file, fileList) => { const handleFileSuccess = (response, file, fileList) => {
if (!response.success) {
ElMessage.error({
message: response.message || '检查失败',
plain: true,
});
upload.isUploading = false;
uploadRef.value.clearFiles();
}
if (response.success) {
ElMessage.success({
message: '上传成功',
plain: true,
});
form.path = response.message; form.path = response.message;
upload.isUploading = false; upload.isUploading = false;
}
}; };
const handleRemove = () => { const handleRemove = () => {
form.path = ''; form.path = '';
...@@ -204,11 +226,13 @@ ...@@ -204,11 +226,13 @@
const linkZK = (row) => { const linkZK = (row) => {
caseDetailModalRef.value.openModal(JSON.parse(JSON.stringify(row))); caseDetailModalRef.value.openModal(JSON.parse(JSON.stringify(row)));
}; };
const downfile = (row) => {}; const downfile = (row) => {
const data = [ const name = row.file.slice(row.file.lastIndexOf('/') + 1, row.file.length);
{ name: 'admin', code: 'admin', role: 'superadmin' }, downloadfile(envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/' + row.file, {}, name);
{ name: 'account1', code: 'account1', role: 'user' }, };
{ name: 'account2', code: 'account2', role: 'user' }, const query = () => ProTableRef.value?.search();
{ name: 'account3', code: 'account3', role: 'user' },
]; onMounted(() => {
query();
});
</script> </script>
...@@ -2179,6 +2179,11 @@ file-entry-cache@^9.1.0: ...@@ -2179,6 +2179,11 @@ file-entry-cache@^9.1.0:
dependencies: dependencies:
flat-cache "^5.0.0" flat-cache "^5.0.0"
file-saver@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-2.0.5.tgz#d61cfe2ce059f414d899e9dd6d4107ee25670c38"
integrity sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==
filelist@^1.0.4: filelist@^1.0.4:
version "1.0.4" version "1.0.4"
resolved "https://registry.npmmirror.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5" resolved "https://registry.npmmirror.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5"
...@@ -3676,7 +3681,16 @@ std-env@^3.8.0: ...@@ -3676,7 +3681,16 @@ std-env@^3.8.0:
resolved "https://registry.npmmirror.com/std-env/-/std-env-3.8.0.tgz#b56ffc1baf1a29dcc80a3bdf11d7fca7c315e7d5" resolved "https://registry.npmmirror.com/std-env/-/std-env-3.8.0.tgz#b56ffc1baf1a29dcc80a3bdf11d7fca7c315e7d5"
integrity sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w== integrity sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.3: "string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"
string-width@^4.1.0, string-width@^4.2.3:
version "4.2.3" version "4.2.3"
resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
...@@ -3694,7 +3708,14 @@ string-width@^5.0.1, string-width@^5.1.2: ...@@ -3694,7 +3708,14 @@ string-width@^5.0.1, string-width@^5.1.2:
emoji-regex "^9.2.2" emoji-regex "^9.2.2"
strip-ansi "^7.0.1" strip-ansi "^7.0.1"
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: "strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1" version "6.0.1"
resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
......
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