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

优化bug

parent 59737b8e
......@@ -47,3 +47,7 @@ export const fullBack = (params) => {
export const stayLoan = (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';
const envs = getAppEnvConfig();
const defaultConfig = {
baseURL: envs.VITE_GLOB_API_URL_PREFIX,
timeout: 1000 * 30,
timeout: 180000,
// 数组格式参数序列化(https://github.com/axios/axios/issues/5142)
paramsSerializer: {
serialize: stringify,
......
......@@ -164,6 +164,7 @@
<el-upload
class="avatar-uploader"
:action="url"
:headers="{timeout:180000}"
:on-success="handleFileSuccess"
:on-remove="handleRemove"
:disabled="props.mode !== 'handle'"
......@@ -179,6 +180,7 @@
<el-form-item label="微信图片附件:" prop="code" class="w-full">
<el-upload
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
v-model:file-list="form.images"
class="mypicture"
......@@ -196,6 +198,7 @@
<el-form-item label="短信图片附件:" prop="code" class="w-full">
<el-upload
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
class="mypicture"
v-model:file-list="form.notes"
......@@ -213,6 +216,7 @@
<el-form-item label="其他图片附件:" prop="code" class="w-full">
<el-upload
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
v-model:file-list="form.others"
:disabled="props.mode !== 'handle'"
......
......@@ -163,6 +163,7 @@
</el-icon>
<el-upload
class="avatar-uploader"
:headers="{timeout:180000}"
:action="url"
:on-success="handleFileSuccess"
:on-remove="handleRemove"
......@@ -179,6 +180,7 @@
<el-form-item label="微信图片附件:" prop="code" class="w-full">
<el-upload
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
v-model:file-list="form.images"
class="mypicture"
......@@ -196,6 +198,7 @@
<el-form-item label="短信图片附件:" prop="code" class="w-full">
<el-upload
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
class="mypicture"
v-model:file-list="form.notes"
......@@ -213,6 +216,7 @@
<el-form-item label="其他图片附件:" prop="code" class="w-full">
<el-upload
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
v-model:file-list="form.others"
:disabled="props.mode !== 'handle'"
......
......@@ -286,7 +286,7 @@
<>
{row.voices.map((item, index) => (
<el-icon>
<Download onClick={() => download(item)} />
<Download onClick={() => download(item)} style="cursor: pointer;" />
</el-icon>
))}
</>
......
......@@ -199,12 +199,14 @@
import { UserFilled } from '@element-plus/icons-vue';
import { RefreshRight } from '@element-plus/icons-vue';
import { ElInputNumber, ElMessage } from 'element-plus';
import Decimal from 'decimal.js';
import {
getLoanDistribute,
distributeLoan,
confirm,
distributeCpe,
changeDistributeCpe,
getTenantUsers
} from '@/api/allcation';
import { getTenantPage } from '@/api/tenant';
import { computed } from 'vue';
......@@ -324,21 +326,21 @@
step.value = 0;
};
const saveFrom = () => {
if (currentAllBtn.value === 'CASE') {
const sum = tabledata.value.reduce((pre, cur) => pre + cur.caseNum, 0);
if (Number(sum) !== Number(statisis.value.unCaseNum))
return ElMessage.warning({
message: '总数与待分派案件数不一致',
plain: true,
});
} else if (currentAllBtn.value === 'BORROWER') {
const sum = tabledata.value.reduce((pre, cur) => pre + cur.borrowerNum, 0);
if (Number(sum) !== Number(statisis.value.unCustomerNum))
return ElMessage.warning({
message: '总数与待分派案人数不一致',
plain: true,
});
}
// if (currentAllBtn.value === 'CASE') {
// const sum = tabledata.value.reduce((pre, cur) => pre + cur.caseNum, 0);
// if (Number(sum) !== Number(statisis.value.unCaseNum))
// return ElMessage.warning({
// message: '总数与待分派案件数不一致',
// plain: true,
// });
// } else if (currentAllBtn.value === 'BORROWER') {
// const sum = tabledata.value.reduce((pre, cur) => pre + cur.borrowerNum, 0);
// if (Number(sum) !== Number(statisis.value.unCustomerNum))
// return ElMessage.warning({
// message: '总数与待分派案人数不一致',
// plain: true,
// });
// }
changeDistributeCpe({
records: tabledata.value,
distributeType: currentAllBtn.value,
......@@ -412,21 +414,34 @@
param = { ...pageParams.value };
}
getStatisis(param, currentTenant.value);
tabledata.value = data1.users.map((v) => ({
cpe: v,
borrowerNum: null,
caseNum: null,
amount: null,
}));
alltabledata.value = data1.users;
checked1.value = true;
console.log('allTreeRef', data1.users);
console.log('allTreeRef.value', allTreeRef.value);
nextTick(() => {
setTimeout(() => {
allTreeRef.value.setCheckedNodes(data1.users);
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,
borrowerNum: null,
caseNum: null,
amount: null,
}));
nextTick(() => {
setTimeout(() => {
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 @@
});
};
const changeNum = (type, row, index) => {
// editRowIndex.value = index;
console.log('changeNum', type, row, index);
const sum = tabledata.value.reduce((pre, cur) => Decimal(pre).add(Decimal(cur[type])), 0);
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) => {
console.log(value, direction); //这个就是它包含的所有的属性以及事件,如果需要别的操作直接执行,也可以查询到
......@@ -485,8 +510,7 @@
<>
<ElInputNumber
v-model={row.borrowerNum}
onChange={() => changeNum(1, row, rowIndex)}
disabled={editRowIndex.value > -1 && editRowIndex.value !== rowIndex}
onChange={() => changeNum('borrowerNum', row, rowIndex)}
/>
</>
);
......@@ -506,8 +530,7 @@
<>
<ElInputNumber
v-model={row.caseNum}
onChange={() => changeNum(2, row, rowIndex)}
disabled={editRowIndex.value > -1 && editRowIndex.value !== rowIndex}
onChange={() => changeNum('caseNum', row, rowIndex)}
/>
</>
);
......
......@@ -156,6 +156,7 @@
<el-upload
class="avatar-uploader"
:action="url"
:headers="{timeout:180000}"
:on-success="handleFileSuccess"
:on-remove="handleRemove"
:auto-upload="true"
......@@ -168,6 +169,7 @@
<el-form-item label="微信图片附件:" prop="code" class="w-full">
<el-upload
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
class="mypicture"
:on-preview="handlePictureCardPreview"
......@@ -183,6 +185,7 @@
<el-form-item label="短信图片附件:" prop="code" class="w-full">
<el-upload
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
class="mypicture"
:on-preview="handlePictureCardPreview"
......@@ -198,6 +201,7 @@
<el-form-item label="其他图片附件:" prop="code" class="w-full">
<el-upload
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
class="mypicture"
:on-preview="handlePictureCardPreview"
......
......@@ -87,6 +87,7 @@
<el-upload
v-model:file-list="form.files"
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
class="mypicture"
:on-success="handleFileSuccess"
......
......@@ -13,6 +13,7 @@
<div>
<el-upload
class="avatar-uploader"
:headers="{timeout:180000}"
ref="uploadRef"
:action="upload.url"
:disabled="upload.isUploading"
......@@ -78,7 +79,7 @@
<el-input v-model="form.contractNo" placeholder="请输入" style="width: 100%" />
</el-form-item> -->
<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>
<div class="flex justify-end">
......
......@@ -21,6 +21,7 @@
<el-upload
class="avatar-uploader"
ref="uploadRef"
:headers="{timeout:180000}"
:action="upload.url"
:disabled="upload.isUploading"
accept=".xls, .xlsx"
......
......@@ -69,9 +69,24 @@
phone: '',
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({
name: { 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);
......
......@@ -164,6 +164,7 @@
<el-upload
class="avatar-uploader"
:action="url"
:headers="{timeout:180000}"
:on-success="handleFileSuccess"
:on-remove="handleRemove"
:disabled="props.mode !== 'handle'"
......@@ -179,6 +180,7 @@
<el-form-item label="微信图片附件:" prop="code" class="w-full">
<el-upload
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
v-model:file-list="form.images"
class="mypicture"
......@@ -196,6 +198,7 @@
<el-form-item label="短信图片附件:" prop="code" class="w-full">
<el-upload
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
class="mypicture"
v-model:file-list="form.notes"
......@@ -213,6 +216,7 @@
<el-form-item label="其他图片附件:" prop="code" class="w-full">
<el-upload
:action="url"
:headers="{timeout:180000}"
list-type="picture-card"
v-model:file-list="form.others"
: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