Commit 3fbfaffb authored by 沈翠玲's avatar 沈翠玲

优化bug

parent 59737b8e
...@@ -47,3 +47,7 @@ export const fullBack = (params) => { ...@@ -47,3 +47,7 @@ export const fullBack = (params) => {
export const stayLoan = (params) => { export const stayLoan = (params) => {
return request.get('/LoanDistribute/stay', params); return request.get('/LoanDistribute/stay', params);
}; };
// 根据调节中心获取不同角色用户
export const getTenantUsers = (params) => {
return request.get('/tenant/getTenantUsers', params);
};
\ No newline at end of file
...@@ -10,7 +10,7 @@ import { saveAs } from 'file-saver'; ...@@ -10,7 +10,7 @@ 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,
timeout: 1000 * 30, timeout: 180000,
// 数组格式参数序列化(https://github.com/axios/axios/issues/5142) // 数组格式参数序列化(https://github.com/axios/axios/issues/5142)
paramsSerializer: { paramsSerializer: {
serialize: stringify, serialize: stringify,
......
...@@ -164,6 +164,7 @@ ...@@ -164,6 +164,7 @@
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
:action="url" :action="url"
:headers="{timeout:180000}"
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
:on-remove="handleRemove" :on-remove="handleRemove"
:disabled="props.mode !== 'handle'" :disabled="props.mode !== 'handle'"
...@@ -179,6 +180,7 @@ ...@@ -179,6 +180,7 @@
<el-form-item label="微信图片附件:" prop="code" class="w-full"> <el-form-item label="微信图片附件:" prop="code" class="w-full">
<el-upload <el-upload
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
v-model:file-list="form.images" v-model:file-list="form.images"
class="mypicture" class="mypicture"
...@@ -196,6 +198,7 @@ ...@@ -196,6 +198,7 @@
<el-form-item label="短信图片附件:" prop="code" class="w-full"> <el-form-item label="短信图片附件:" prop="code" class="w-full">
<el-upload <el-upload
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
class="mypicture" class="mypicture"
v-model:file-list="form.notes" v-model:file-list="form.notes"
...@@ -213,6 +216,7 @@ ...@@ -213,6 +216,7 @@
<el-form-item label="其他图片附件:" prop="code" class="w-full"> <el-form-item label="其他图片附件:" prop="code" class="w-full">
<el-upload <el-upload
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
v-model:file-list="form.others" v-model:file-list="form.others"
:disabled="props.mode !== 'handle'" :disabled="props.mode !== 'handle'"
......
...@@ -163,6 +163,7 @@ ...@@ -163,6 +163,7 @@
</el-icon> </el-icon>
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
:headers="{timeout:180000}"
:action="url" :action="url"
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
:on-remove="handleRemove" :on-remove="handleRemove"
...@@ -179,6 +180,7 @@ ...@@ -179,6 +180,7 @@
<el-form-item label="微信图片附件:" prop="code" class="w-full"> <el-form-item label="微信图片附件:" prop="code" class="w-full">
<el-upload <el-upload
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
v-model:file-list="form.images" v-model:file-list="form.images"
class="mypicture" class="mypicture"
...@@ -196,6 +198,7 @@ ...@@ -196,6 +198,7 @@
<el-form-item label="短信图片附件:" prop="code" class="w-full"> <el-form-item label="短信图片附件:" prop="code" class="w-full">
<el-upload <el-upload
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
class="mypicture" class="mypicture"
v-model:file-list="form.notes" v-model:file-list="form.notes"
...@@ -213,6 +216,7 @@ ...@@ -213,6 +216,7 @@
<el-form-item label="其他图片附件:" prop="code" class="w-full"> <el-form-item label="其他图片附件:" prop="code" class="w-full">
<el-upload <el-upload
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
v-model:file-list="form.others" v-model:file-list="form.others"
:disabled="props.mode !== 'handle'" :disabled="props.mode !== 'handle'"
......
...@@ -286,7 +286,7 @@ ...@@ -286,7 +286,7 @@
<> <>
{row.voices.map((item, index) => ( {row.voices.map((item, index) => (
<el-icon> <el-icon>
<Download onClick={() => download(item)} /> <Download onClick={() => download(item)} style="cursor: pointer;" />
</el-icon> </el-icon>
))} ))}
</> </>
......
...@@ -199,12 +199,14 @@ ...@@ -199,12 +199,14 @@
import { UserFilled } from '@element-plus/icons-vue'; import { UserFilled } from '@element-plus/icons-vue';
import { RefreshRight } from '@element-plus/icons-vue'; import { RefreshRight } from '@element-plus/icons-vue';
import { ElInputNumber, ElMessage } from 'element-plus'; import { ElInputNumber, ElMessage } from 'element-plus';
import Decimal from 'decimal.js';
import { import {
getLoanDistribute, getLoanDistribute,
distributeLoan, distributeLoan,
confirm, confirm,
distributeCpe, distributeCpe,
changeDistributeCpe, changeDistributeCpe,
getTenantUsers
} from '@/api/allcation'; } from '@/api/allcation';
import { getTenantPage } from '@/api/tenant'; import { getTenantPage } from '@/api/tenant';
import { computed } from 'vue'; import { computed } from 'vue';
...@@ -324,21 +326,21 @@ ...@@ -324,21 +326,21 @@
step.value = 0; step.value = 0;
}; };
const saveFrom = () => { const saveFrom = () => {
if (currentAllBtn.value === 'CASE') { // if (currentAllBtn.value === 'CASE') {
const sum = tabledata.value.reduce((pre, cur) => pre + cur.caseNum, 0); // const sum = tabledata.value.reduce((pre, cur) => pre + cur.caseNum, 0);
if (Number(sum) !== Number(statisis.value.unCaseNum)) // if (Number(sum) !== Number(statisis.value.unCaseNum))
return ElMessage.warning({ // return ElMessage.warning({
message: '总数与待分派案件数不一致', // message: '总数与待分派案件数不一致',
plain: true, // plain: true,
}); // });
} else if (currentAllBtn.value === 'BORROWER') { // } else if (currentAllBtn.value === 'BORROWER') {
const sum = tabledata.value.reduce((pre, cur) => pre + cur.borrowerNum, 0); // const sum = tabledata.value.reduce((pre, cur) => pre + cur.borrowerNum, 0);
if (Number(sum) !== Number(statisis.value.unCustomerNum)) // if (Number(sum) !== Number(statisis.value.unCustomerNum))
return ElMessage.warning({ // return ElMessage.warning({
message: '总数与待分派案人数不一致', // message: '总数与待分派案人数不一致',
plain: true, // plain: true,
}); // });
} // }
changeDistributeCpe({ changeDistributeCpe({
records: tabledata.value, records: tabledata.value,
distributeType: currentAllBtn.value, distributeType: currentAllBtn.value,
...@@ -412,21 +414,34 @@ ...@@ -412,21 +414,34 @@
param = { ...pageParams.value }; param = { ...pageParams.value };
} }
getStatisis(param, currentTenant.value); getStatisis(param, currentTenant.value);
tabledata.value = data1.users.map((v) => ({
getTenantUsers({tenantId: data1.id, roleCode: 'CPE'}).then(res => {
if (res.success && res.result) {
alltabledata.value = res.result
} else {
alltabledata.value = []
}
tabledata.value = alltabledata.value.map((v) => ({
cpe: v, cpe: v,
borrowerNum: null, borrowerNum: null,
caseNum: null, caseNum: null,
amount: null, amount: null,
})); }));
alltabledata.value = data1.users;
checked1.value = true;
console.log('allTreeRef', data1.users);
console.log('allTreeRef.value', allTreeRef.value);
nextTick(() => { nextTick(() => {
setTimeout(() => { setTimeout(() => {
allTreeRef.value.setCheckedNodes(data1.users); allTreeRef.value.setCheckedNodes(alltabledata.value);
});
});
}).catch(e => {
alltabledata.value = []
tabledata.value = []
nextTick(() => {
setTimeout(() => {
allTreeRef.value.setCheckedNodes(alltabledata.value);
}); });
}); });
})
checked1.value = true;
} }
}; };
...@@ -445,8 +460,18 @@ ...@@ -445,8 +460,18 @@
}); });
}; };
const changeNum = (type, row, index) => { const changeNum = (type, row, index) => {
// editRowIndex.value = index; const sum = tabledata.value.reduce((pre, cur) => Decimal(pre).add(Decimal(cur[type])), 0);
console.log('changeNum', type, row, index); const sta_num = type === 'borrowerNum' ? statisis.value.unCustomerNum : statisis.value.unCaseNum
const differ = Decimal(sum).sub(Decimal(sta_num))
const msg = type === 'borrowerNum' ? '总数超过待分派案人数' : '总数超过待分派案件数'
if (Number(sum) > Number(sta_num)) {
row[type] = Decimal(row[type]).sub(Decimal(differ))
return ElMessage.warning({
message: msg,
plain: true,
});
}
}; };
const leftChange = (value, direction) => { const leftChange = (value, direction) => {
console.log(value, direction); //这个就是它包含的所有的属性以及事件,如果需要别的操作直接执行,也可以查询到 console.log(value, direction); //这个就是它包含的所有的属性以及事件,如果需要别的操作直接执行,也可以查询到
...@@ -485,8 +510,7 @@ ...@@ -485,8 +510,7 @@
<> <>
<ElInputNumber <ElInputNumber
v-model={row.borrowerNum} v-model={row.borrowerNum}
onChange={() => changeNum(1, row, rowIndex)} onChange={() => changeNum('borrowerNum', row, rowIndex)}
disabled={editRowIndex.value > -1 && editRowIndex.value !== rowIndex}
/> />
</> </>
); );
...@@ -506,8 +530,7 @@ ...@@ -506,8 +530,7 @@
<> <>
<ElInputNumber <ElInputNumber
v-model={row.caseNum} v-model={row.caseNum}
onChange={() => changeNum(2, row, rowIndex)} onChange={() => changeNum('caseNum', row, rowIndex)}
disabled={editRowIndex.value > -1 && editRowIndex.value !== rowIndex}
/> />
</> </>
); );
......
...@@ -156,6 +156,7 @@ ...@@ -156,6 +156,7 @@
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
:action="url" :action="url"
:headers="{timeout:180000}"
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
:on-remove="handleRemove" :on-remove="handleRemove"
:auto-upload="true" :auto-upload="true"
...@@ -168,6 +169,7 @@ ...@@ -168,6 +169,7 @@
<el-form-item label="微信图片附件:" prop="code" class="w-full"> <el-form-item label="微信图片附件:" prop="code" class="w-full">
<el-upload <el-upload
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
class="mypicture" class="mypicture"
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
...@@ -183,6 +185,7 @@ ...@@ -183,6 +185,7 @@
<el-form-item label="短信图片附件:" prop="code" class="w-full"> <el-form-item label="短信图片附件:" prop="code" class="w-full">
<el-upload <el-upload
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
class="mypicture" class="mypicture"
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
...@@ -198,6 +201,7 @@ ...@@ -198,6 +201,7 @@
<el-form-item label="其他图片附件:" prop="code" class="w-full"> <el-form-item label="其他图片附件:" prop="code" class="w-full">
<el-upload <el-upload
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
class="mypicture" class="mypicture"
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
<el-upload <el-upload
v-model:file-list="form.files" v-model:file-list="form.files"
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
class="mypicture" class="mypicture"
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<div> <div>
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
:headers="{timeout:180000}"
ref="uploadRef" ref="uploadRef"
:action="upload.url" :action="upload.url"
:disabled="upload.isUploading" :disabled="upload.isUploading"
...@@ -78,7 +79,7 @@ ...@@ -78,7 +79,7 @@
<el-input v-model="form.contractNo" placeholder="请输入" style="width: 100%" /> <el-input v-model="form.contractNo" placeholder="请输入" style="width: 100%" />
</el-form-item> --> </el-form-item> -->
<el-form-item class="w-full" label="折扣:" prop="discount"> <el-form-item class="w-full" label="折扣:" prop="discount">
<el-input v-model="form.discount" placeholder="请输入" style="width: 100%" /> <el-input v-model.number="form.discount" placeholder="请输入" style="width: 100%" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="flex justify-end"> <div class="flex justify-end">
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
ref="uploadRef" ref="uploadRef"
:headers="{timeout:180000}"
:action="upload.url" :action="upload.url"
:disabled="upload.isUploading" :disabled="upload.isUploading"
accept=".xls, .xlsx" accept=".xls, .xlsx"
......
...@@ -69,9 +69,24 @@ ...@@ -69,9 +69,24 @@
phone: '', phone: '',
status: 'enable', status: 'enable',
}); });
const validatePhone = (rule, value, callback) => {
const reg = /^1[3-9]\d{9}$/;
if (!value) {
callback(new Error('请输入负责人手机'));
} else if (!reg.test(value)) {
callback(new Error('请输入正确的手机号'));
} else {
callback();
}
};
const rules = ref({ const rules = ref({
name: { required: true, message: '请输入调解中心名称', trigger: 'blur' }, name: { required: true, message: '请输入调解中心名称', trigger: 'blur' },
code: { required: true, message: '请输入调解中心编码', trigger: 'blur' }, code: { required: true, message: '请输入调解中心编码', trigger: 'blur' },
adminUser: { required: true, message: '请输入负责人', trigger: 'blur' },
phone: [
{ required: true, message: '请输入负责人手机', trigger: 'blur' },
{ validator: validatePhone, trigger: 'blur' }
]
}); });
const loading = ref(false); const loading = ref(false);
......
...@@ -164,6 +164,7 @@ ...@@ -164,6 +164,7 @@
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
:action="url" :action="url"
:headers="{timeout:180000}"
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
:on-remove="handleRemove" :on-remove="handleRemove"
:disabled="props.mode !== 'handle'" :disabled="props.mode !== 'handle'"
...@@ -179,6 +180,7 @@ ...@@ -179,6 +180,7 @@
<el-form-item label="微信图片附件:" prop="code" class="w-full"> <el-form-item label="微信图片附件:" prop="code" class="w-full">
<el-upload <el-upload
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
v-model:file-list="form.images" v-model:file-list="form.images"
class="mypicture" class="mypicture"
...@@ -196,6 +198,7 @@ ...@@ -196,6 +198,7 @@
<el-form-item label="短信图片附件:" prop="code" class="w-full"> <el-form-item label="短信图片附件:" prop="code" class="w-full">
<el-upload <el-upload
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
class="mypicture" class="mypicture"
v-model:file-list="form.notes" v-model:file-list="form.notes"
...@@ -213,6 +216,7 @@ ...@@ -213,6 +216,7 @@
<el-form-item label="其他图片附件:" prop="code" class="w-full"> <el-form-item label="其他图片附件:" prop="code" class="w-full">
<el-upload <el-upload
:action="url" :action="url"
:headers="{timeout:180000}"
list-type="picture-card" list-type="picture-card"
v-model:file-list="form.others" v-model:file-list="form.others"
:disabled="props.mode !== 'handle'" :disabled="props.mode !== 'handle'"
......
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