<template>
|
<div class="comm-page">
|
<div class="form-content">
|
<FormList
|
:info="formInfo"
|
:isShowDetail="isShowDetail"
|
@handleClick="isShowDetail = !isShowDetail"
|
@updateValue="updateValue"
|
@onSubmit="onSubmit"
|
@setValueInfo="setValueInfo"
|
></FormList>
|
</div>
|
|
<div class="list-content">
|
<TableList
|
:pageInfo="pageInfo"
|
@doAction="doAction"
|
@handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange"
|
:isAutoIndex="true"
|
:list="records"
|
:header="tableHeader"
|
:loading="loading"
|
></TableList>
|
</div>
|
|
<el-dialog
|
width="850px"
|
:title="title"
|
:visible.sync="dialogTableVisible"
|
custom-class="comm-dialog"
|
:modal-append-to-body="false"
|
:close-on-click-modal="false"
|
center
|
>
|
<el-form :model="form" label-width="120px" inline size="small">
|
<el-form-item label="申请编号">
|
<el-input v-model="form.serialNo" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="客户名称">
|
<el-input v-model="form.customerName" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="产品名称">
|
<el-input v-model="form.productName" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="产品维度">
|
<el-input v-model="form.productDimensionname" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="业务类型">
|
<el-input v-model="form.occurTypeDesc" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="当前流程阶段">
|
<el-input v-model="form.currentPhasename" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="当前处理人">
|
<el-input v-model="form.currentUserName" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="新指派处理人" v-if="title != '退回任务池确认'">
|
<el-autocomplete
|
clearable
|
v-model="form.handler"
|
:fetch-suggestions="querySearchAsync"
|
:trigger-on-focus="false"
|
:popper-append-to-body="false"
|
:debounce='0'
|
value-key="label"
|
placeholder="请输入姓名进行选择"
|
@select="selHandler"
|
></el-autocomplete>
|
</el-form-item>
|
</el-form>
|
<span slot="footer" class="dialog-footer">
|
<el-button plain @click="dialogTableVisible = false">取消</el-button>
|
<el-button type="primary" @click="handleComfirm(form)">确定</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
<script>
|
/**
|
* 贷款任务调整
|
*/
|
import TableList from "@comprehensive/components/TableList";
|
import FormList from "@comprehensive/components/FormList";
|
import { comfirm } from '@comprehensive/utils/comm'
|
import { loanTaskAdjustmentHeader } from '@comprehensive/utils/tableHeaders'
|
import { loanTaskAdjustmentSearch } from '@comprehensive/utils/formItems'
|
import {
|
qryProdList,
|
qryDimensionList,
|
qryFlowBusinessTaskList,
|
getDictionaryList,
|
qryFlowPhaseList,
|
qryFlowUserList,
|
turnFlowUserList,
|
turnOverFlowUserList,
|
returnTaskPool
|
} from "@comprehensive/serve/public";
|
|
export default {
|
components: {
|
FormList,
|
TableList
|
},
|
data() {
|
return {
|
records:[],
|
title:'',
|
valueInfo: {},
|
form: {},
|
isShowDetail:false,
|
dialogTableVisible:false,
|
loading:false,
|
waiting:false,
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10,
|
},
|
formInfo: [...loanTaskAdjustmentSearch],
|
tableHeader: [...loanTaskAdjustmentHeader],
|
};
|
},
|
activated () {
|
this.init()
|
},
|
methods: {
|
async querySearchAsync(query, cb) {
|
if(query.length>1){
|
const { result } = await qryFlowUserList({ userName: query, serialNo: this.form.serialNo})
|
result.forEach(val => {
|
val.label = `${val.taskUserName}-${val.taskUserId}-${val.taskOrgName}`
|
});
|
cb(result);
|
}else{
|
cb([]);
|
}
|
},
|
|
// 页面初始化处理
|
init() {
|
const { formInfo } = this;
|
|
if (formInfo.some(({ name }) => name === "productId")) {
|
this.qryProdList();
|
}
|
|
if (formInfo.some(({ name }) => name === "productDimension")) {
|
this.qryDimensionList();
|
}
|
|
if (formInfo.some(({ name }) => name === "phaseNo")) {
|
this.qryFlowPhaseList();
|
}
|
|
this.qryFlowBusinessTaskList();
|
},
|
|
selHandler(obj){
|
this.form.taskOrgId = obj.taskOrgId
|
this.form.taskOrgName = obj.taskOrgName
|
this.form.taskUserId = obj.taskUserId
|
this.form.taskUserName = obj.taskUserName
|
},
|
|
// 新指派处理人
|
qryFlowUserList(serialNo){
|
return new Promise(resolve=>{
|
qryFlowUserList({ 'serialNo':serialNo }).then(res=>{
|
resolve(res.result)
|
})
|
})
|
},
|
|
// 表单事件触发
|
async doAction(name, item, { label }){
|
if (name === "lastAction") {
|
const { objectType } = item;
|
const detailInfo = { ...item, objecttype: objectType };
|
|
if(label == '详情'){
|
this.toDetail(detailInfo)
|
}
|
|
if(label == '跨地区指派'){
|
this.form = item
|
this.$set(this.form,'handler','')
|
// turnFlag是1代表跨地区指派
|
this.form.turnFlag = '1'
|
this.title = label
|
this.dialogTableVisible = true
|
}
|
|
if(label == '正常指派'){
|
this.form = item
|
this.$set(this.form,'handler','')
|
// turnFlag是0代表正常指派
|
this.form.turnFlag = '0'
|
this.title = label
|
this.dialogTableVisible = true
|
}
|
|
if(label == '退回任务池'){
|
const { serialNo } = item
|
const info = { ...item, objectNo: serialNo };
|
this.form = info
|
this.title = '退回任务池确认'
|
this.dialogTableVisible = true
|
}
|
}
|
},
|
|
// 指派
|
async handleComfirm(form){
|
let res = '';
|
if(!form.turnFlag){
|
// 退回任务池
|
res = await returnTaskPool({ objectNo: form.serialNo, objectType: form.objectType})
|
if(res.code == '00'){
|
this.$message.success('退回任务池成功')
|
}
|
}else{
|
// 正常指派
|
if(form.turnFlag == '0'){
|
res = await turnFlowUserList(form)
|
}
|
// 跨地区指派
|
if(form.turnFlag == '1'){
|
res = await turnOverFlowUserList(form)
|
}
|
if(res.code == '00'){
|
this.$message.success('指派成功')
|
}
|
}
|
this.dialogTableVisible = false
|
this.init()
|
},
|
|
// 跳转到详情页
|
toDetail(result) {
|
const {
|
serialNo,
|
flowNo,
|
customerId,
|
objectType,
|
occurType
|
} = result;
|
|
this.$router.push(
|
`/comprehensiveTransaction/loanDetail/${serialNo}?occurType=${occurType}&flowno=${flowNo}&objectType=${objectType}&customerID=${customerId}`
|
);
|
},
|
|
// 获取当前数据列表
|
async qryFlowBusinessTaskList() {
|
this.loading = true;
|
let { valueInfo, pageInfo } = this;
|
const res = await qryFlowBusinessTaskList({
|
...valueInfo,
|
...pageInfo
|
});
|
const { records = [], total } = res.result;
|
this.loading = false;
|
this.records = records.reduce((pre, curr) => {
|
let arr = [];
|
// 贷款期限处理
|
let {
|
detailFlag,
|
overAppointFlag,
|
normalAppointFlag,
|
returnPoolFlag
|
} = curr;
|
if(detailFlag == '1'){
|
arr.push({ label: "详情" });
|
}
|
if(overAppointFlag == '1'){
|
arr.push({ label: "跨地区指派" });
|
}
|
if(normalAppointFlag == '1'){
|
arr.push({ label: "正常指派" });
|
}
|
if(returnPoolFlag == '1'){
|
arr.push({ label: "退回任务池" });
|
}
|
let sortButtons = [
|
"正常指派",
|
"跨地区指派",
|
"退回任务池",
|
"详情"
|
];
|
arr = this.getSortButtons(sortButtons, arr);
|
pre.push({
|
...curr,
|
buttons: [...arr],
|
});
|
|
return pre;
|
}, []);
|
|
this.pageInfo = {
|
...pageInfo,
|
total
|
};
|
},
|
|
// 按钮顺序排序
|
getSortButtons(sortButtons, arr) {
|
return sortButtons.reduce((pre, curr) => {
|
const item = arr.find(({ label }) => label === curr);
|
if (item) {
|
pre.push({ ...item });
|
}
|
return pre;
|
}, []);
|
},
|
|
// 当前流程阶段下拉列表
|
async qryFlowPhaseList() {
|
const res = await qryFlowPhaseList({});
|
const { result } = res;
|
this.setOrGetFormInfo("phaseNo", { options: result });
|
},
|
|
// 产品名称下拉列表
|
async qryProdList() {
|
const res = await qryProdList({ productTypeNo: "" });
|
const { result } = res;
|
this.setOrGetFormInfo("productId", { options: result });
|
},
|
|
// 产品维度下拉列表
|
async qryDimensionList() {
|
const { valueInfo } = this;
|
let { productId = "" } = valueInfo;
|
const res = await qryDimensionList({ productid : productId });
|
const { result } = res;
|
this.setOrGetFormInfo("productDimension", { options: result });
|
},
|
|
// 设置表单结果数据
|
setValueInfo(info = {}) {
|
this.valueInfo = info;
|
},
|
|
// 更新数据
|
updateValue(value, item) {
|
let { name } = item;
|
this.setOrGetFormInfo(name, { value });
|
if (name === "productId") {
|
this.qryDimensionList();
|
}
|
},
|
|
// 查询
|
onSubmit(){
|
this.pageInfo.currentPage = 1;
|
this.qryFlowBusinessTaskList();
|
},
|
|
// 更新表单数据或查找某项数据
|
setOrGetFormInfo(nameKey, newInfo) {
|
let { formInfo } = this
|
let index = formInfo.findIndex(({ name }) => name === nameKey)
|
let result = {}
|
if (!isNaN(index)) {
|
this.$set(this.formInfo, index, { ...formInfo[index], ...newInfo })
|
result = this.formInfo[index]
|
}
|
if (typeof newInfo === 'undefined') {
|
return result
|
}
|
},
|
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val;
|
this.qryFlowBusinessTaskList();
|
},
|
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val;
|
this.qryFlowBusinessTaskList();
|
},
|
|
}
|
};
|
</script>
|
<style lang="postcss" scoped>
|
.comm-page {
|
& .list-content {
|
font-size: 14px;
|
}
|
& .export-excle {
|
margin: 2px 20px 30px 0;
|
& .el-button-primary {
|
font-size: 14px;
|
}
|
}
|
& .empty-section {
|
height: 50px;
|
}
|
& >>> .comm-dialog {
|
& .el-form{
|
display: flex;
|
justify-content: flex-start;
|
flex-wrap: wrap;
|
& .el-form-item{
|
display: flex;
|
width: 45%;
|
margin: 0 30px 20px 0;
|
& .el-form-item__content{
|
flex: 1;
|
& .el-autocomplete{
|
width: 100%;
|
& .el-autocomplete-suggestion{
|
position: absolute !important;
|
left: 0 !important;
|
min-width: 100%;
|
width: auto !important;
|
}
|
}
|
}
|
}
|
}
|
& .el-dialog__footer{
|
& .el-button{
|
width: 120px;
|
font-size: 14px;
|
line-height: 20px;
|
padding: 5px 0;
|
&+.el-button{
|
margin-left: 40px;
|
}
|
}
|
}
|
}
|
}
|
</style>
|