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

优化

parent 08c7a1b1
...@@ -8,6 +8,7 @@ import { setupDirectives } from '@/plugins/directives'; ...@@ -8,6 +8,7 @@ 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'; import { download } from '@/utils/http/index';
import './styles/element-variables.scss'
export async function bootstrapInstall() { export async function bootstrapInstall() {
const app = createApp(App); const app = createApp(App);
......
// element-variables.scss
@import "element-plus/theme-chalk/src/index.scss";
$--font-size: 13px;
\ No newline at end of file
...@@ -154,14 +154,18 @@ ...@@ -154,14 +154,18 @@
<p class="font-bold mb-2 mt-2">跟进附件:</p> <p class="font-bold mb-2 mt-2">跟进附件:</p>
<el-form inline :model="form" :rules="rules" label-width="110px" label-position="left"> <el-form inline :model="form" :rules="rules" label-width="110px" label-position="left">
<el-form-item class="w-full" label="通话录音:" prop="code"> <el-form-item class="w-full" label="通话录音:" prop="code">
<el-icon>
<Download v-for="(item, index) in form.voices" :key="index" @click="download(item)" />
</el-icon>
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
:action="url" :action="url"
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
:on-remove="handleRemove" :on-remove="handleRemove"
:disabled="props.mode !== 'handle'"
:auto-upload="true" :auto-upload="true"
> >
<el-button type="primary" plain :icon="Upload">上传录音文件</el-button> <el-button type="primary" plain :icon="Upload" :disabled="props.mode !== 'handle'">上传录音文件</el-button>
</el-upload> </el-upload>
<!-- 进度条 --> <!-- 进度条 -->
<!-- <el-progress v-if="progressFlag" :percentage="loadProgress" /> --> <!-- <el-progress v-if="progressFlag" :percentage="loadProgress" /> -->
...@@ -170,9 +174,11 @@ ...@@ -170,9 +174,11 @@
<el-upload <el-upload
:action="url" :action="url"
list-type="picture-card" list-type="picture-card"
v-model:file-list="form.images"
class="mypicture" class="mypicture"
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:on-success="handleFileSuccess1" :on-success="handleFileSuccess1"
:disabled="props.mode !== 'handle'"
:on-remove="handleRemove1" :on-remove="handleRemove1"
> >
<div class="text-center"> <div class="text-center">
...@@ -186,6 +192,8 @@ ...@@ -186,6 +192,8 @@
:action="url" :action="url"
list-type="picture-card" list-type="picture-card"
class="mypicture" class="mypicture"
v-model:file-list="form.notes"
:disabled="props.mode !== 'handle'"
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:on-success="handleFileSuccess2" :on-success="handleFileSuccess2"
:on-remove="handleRemove2" :on-remove="handleRemove2"
...@@ -200,6 +208,8 @@ ...@@ -200,6 +208,8 @@
<el-upload <el-upload
:action="url" :action="url"
list-type="picture-card" list-type="picture-card"
v-model:file-list="form.others"
:disabled="props.mode !== 'handle'"
class="mypicture" class="mypicture"
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:on-success="handleFileSuccess3" :on-success="handleFileSuccess3"
...@@ -234,14 +244,15 @@ ...@@ -234,14 +244,15 @@
</template> </template>
<script setup lang="jsx" name="reduceDrawer"> <script setup lang="jsx" name="reduceDrawer">
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { computed } from 'vue'; import { computed, inject } from 'vue';
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { ElInputNumber, ElMessage } from 'element-plus'; import { ElInputNumber, ElMessage } from 'element-plus';
import { Upload } from '@element-plus/icons-vue'; import { Upload,Download } 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';
import { auditAudit } from '@/api/audit'; import { auditAudit } from '@/api/audit';
const envs = getAppEnvConfig(); const envs = getAppEnvConfig();
const downloadfile = inject('download');
const url = envs.VITE_GLOB_API_URL_PREFIX + '/sys/upload'; const url = envs.VITE_GLOB_API_URL_PREFIX + '/sys/upload';
const showModal = ref(false); const showModal = ref(false);
const editFirst = ref(false); const editFirst = ref(false);
...@@ -373,37 +384,41 @@ ...@@ -373,37 +384,41 @@
} }
}; };
const handleFileSuccess = (response, file, fileList) => { const handleFileSuccess = (response, file, fileList) => {
form.voices.push({ if(file.uid) {
url: response.message, const item = form.voices.find((v) => v.uid === file.uid);
name: file.name, item.url = envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/' + response.message
}); }
}; };
const handleFileSuccess1 = (response, file, fileList) => { const handleFileSuccess1 = (response, file, fileList) => {
form.images.push({ if(file.uid) {
url: response.message, const item = form.images.find((v) => v.uid === file.uid);
name: file.name, item.url = envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/' + response.message
}); }
}; };
const handleRemove1 = (uploadFile, uploadFiles) => { const handleRemove1 = (uploadFile, uploadFiles) => {
const index = form.images.findIndex((v) => v.name === uploadFile.name); const index = form.images.findIndex((v) => v.name === uploadFile.name);
form.images.splice(index, 1); form.images.splice(index, 1);
}; };
const handleFileSuccess2 = (response, file, fileList) => { const handleFileSuccess2 = (response, file, fileList) => {
console.log(response, file); // console.log(response, file);
form.notes.push({ if(file.uid) {
url: response.message, const item = form.notes.find((v) => v.uid === file.uid);
name: file.name, item.url = envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/' + response.message
}); };
}; };
const handleRemove2 = (uploadFile, uploadFiles) => { const handleRemove2 = (uploadFile, uploadFiles) => {
const index = form.notes.findIndex((v) => v.name === uploadFile.name); const index = form.notes.findIndex((v) => v.name === uploadFile.name);
form.notes.splice(index, 1); form.notes.splice(index, 1);
}; };
const handleFileSuccess3 = (response, file, fileList) => { const handleFileSuccess3 = (response, file, fileList) => {
form.others.push({ if(file.uid) {
url: response.message, const item = form.others.find((v) => v.uid === file.uid);
name: file.name, item.url = envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/' + response.message
}); };
};
const download = (item) => {
const name = item.slice(item.lastIndexOf('/') + 1, item.length);
downloadfile(envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/' + item, {}, name);
}; };
const handleRemove3 = (uploadFile, uploadFiles) => { const handleRemove3 = (uploadFile, uploadFiles) => {
const index = form.others.findIndex((v) => v.name === uploadFile.name); const index = form.others.findIndex((v) => v.name === uploadFile.name);
...@@ -481,6 +496,22 @@ ...@@ -481,6 +496,22 @@
console.log('formform', form); console.log('formform', form);
}; };
const submitForm = (type) => { const submitForm = (type) => {
let voices = JSON.parse(JSON.stringify(form.voices.map(v => v.url)))
let images = JSON.parse(JSON.stringify(form.images.map(v => v.url)))
let notes = JSON.parse(JSON.stringify(form.notes.map(v => v.url)))
let others = JSON.parse(JSON.stringify(form.others.map(v => v.url)))
voices = voices.map(v => {
return v.replace(envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/', '')
})
images = images.map(v => {
return v.replace(envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/', '')
})
notes = notes.map(v => {
return v.replace(envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/', '')
})
others = others.map(v => {
return v.replace(envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/', '')
})
saveTrackRecord({ saveTrackRecord({
loans: tabledata.value, loans: tabledata.value,
id: currentInfo.value.id, id: currentInfo.value.id,
...@@ -491,10 +522,10 @@ ...@@ -491,10 +522,10 @@
auditStatus: type === 'rejected' ? 'rejected' : type === 'passed' ? 'passed' : 'complete', auditStatus: type === 'rejected' ? 'rejected' : type === 'passed' ? 'passed' : 'complete',
followStatus: resuleObj.childrenlabel, followStatus: resuleObj.childrenlabel,
remark: form.remark, remark: form.remark,
voices: form.voices.map((v) => v.url).length > 0 ? form.voices.map((v) => v.url) : null, voices: voices.length > 0 ? voices : null,
images: form.images.map((v) => v.url).length > 0 ? form.images.map((v) => v.url) : null, images: images.length > 0 ? images : null,
notes: form.notes.map((v) => v.url).length > 0 ? form.notes.map((v) => v.url) : null, notes: notes.length > 0 ? notes : null,
others: form.others.map((v) => v.url).length > 0 ? form.others.map((v) => v.url) : null, others: others.length > 0 ? others : null,
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
ElMessage.success({ ElMessage.success({
...@@ -525,12 +556,12 @@ ...@@ -525,12 +556,12 @@
} }
.mypicture { .mypicture {
:deep(.el-upload--picture-card) { :deep(.el-upload--picture-card) {
width: 100px; width: 80px;
height: 100px; height: 80px;
} }
:deep(.el-upload-list__item) { :deep(.el-upload-list__item) {
width: 100px; width: 80px;
height: 100px; height: 80px;
} }
} }
</style> </style>
...@@ -843,38 +843,38 @@ ...@@ -843,38 +843,38 @@
const id = JSON.parse(route.query.id); const id = JSON.parse(route.query.id);
const { result } = await getCredit(id); const { result } = await getCredit(id);
detail.value = result; detail.value = result;
if (14) { if (detail.value?.borrower?.id) {
if (type === '跟进') { if (type === '跟进') {
getTrackRecordList(14); getTrackRecordList(detail.value?.borrower?.id);
} else if (type === '减免') { } else if (type === '减免') {
getReduces(14).then((res) => { getReduces(detail.value?.borrower?.id).then((res) => {
if (res.result && res.result) { if (res.result && res.result) {
reduceData.value = res.result; reduceData.value = res.result;
} }
}); });
} else if (type === '分期') { } else if (type === '分期') {
getByStages(14).then((res) => { getByStages(detail.value?.borrower?.id).then((res) => {
if (res.result && res.result) { if (res.result && res.result) {
splitData.value = res.result; splitData.value = res.result;
} }
}); });
} else if (type === '还款') { } else if (type === '还款') {
getRepayRecords(14).then((res) => { getRepayRecords(detail.value?.borrower?.id).then((res) => {
if (res.result && res.result) { if (res.result && res.result) {
returnData.value = res.result; returnData.value = res.result;
} }
}); });
getByStages(14).then((res) => { getByStages(detail.value?.borrower?.id).then((res) => {
if (res.result && res.result) { if (res.result && res.result) {
splitData.value = res.result; splitData.value = res.result;
} }
}); });
getReduces(14).then((res) => { getReduces(detail.value?.borrower?.id).then((res) => {
if (res.result && res.result) { if (res.result && res.result) {
reduceData.value = res.result; reduceData.value = res.result;
} }
}); });
listByBorrower(14).then((res) => { listByBorrower(detail.value?.borrower?.id).then((res) => {
if (res.result && res.result) { if (res.result && res.result) {
caseDetailConfig.data = res.result; caseDetailConfig.data = res.result;
} }
...@@ -887,25 +887,25 @@ ...@@ -887,25 +887,25 @@
const { result } = await getCredit(id); const { result } = await getCredit(id);
console.log('result', result); console.log('result', result);
detail.value = result; detail.value = result;
if (14) { if (detail.value?.borrower?.id) {
getGuarantorsList(14); getGuarantorsList(detail.value?.borrower?.id);
getTrackRecordList(14); getTrackRecordList(detail.value?.borrower?.id);
listByBorrower(14).then((res) => { listByBorrower(detail.value?.borrower?.id).then((res) => {
if (res.result && res.result) { if (res.result && res.result) {
caseDetailConfig.data = res.result; caseDetailConfig.data = res.result;
} }
}); });
getReduces(14).then((res) => { getReduces(detail.value?.borrower?.id).then((res) => {
if (res.result && res.result) { if (res.result && res.result) {
reduceData.value = res.result; reduceData.value = res.result;
} }
}); });
getByStages(14).then((res) => { getByStages(detail.value?.borrower?.id).then((res) => {
if (res.result && res.result) { if (res.result && res.result) {
splitData.value = res.result; splitData.value = res.result;
} }
}); });
getRepayRecords(14).then((res) => { getRepayRecords(detail.value?.borrower?.id).then((res) => {
if (res.result && res.result) { if (res.result && res.result) {
returnData.value = res.result; returnData.value = res.result;
} }
......
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