<template>
|
<div class="search-form">
|
<CommForm
|
:inline="true"
|
:list="formList"
|
@updateValue="updateValue"
|
@buttonAction="buttonAction"
|
ref="form"
|
:formValues="formValues"
|
:formRules="formRules"
|
:buttons="formButtons"
|
:isShowAll="isShowAll"
|
formType="search"
|
></CommForm>
|
|
<div class="middle-button" v-if="phaseNo">
|
<span class="random-task" @click="autoTask">系统分配任务</span>
|
</div>
|
|
<CommTable
|
:pageInfo="pageInfo"
|
:total="total"
|
@doAction="doAction"
|
@handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange"
|
:loading="loading"
|
:list="records"
|
:header="tableHeader"
|
v-bind="$attrs"
|
></CommTable>
|
<!-- 修改弹窗 -->
|
<el-dialog
|
v-if="dialogModify"
|
:visible.sync="dialogModify"
|
custom-class="comm-dialog"
|
:modal-append-to-body="false"
|
width="850px"
|
>
|
<ControlModifyCus :tempRecord="tempRecord" @close="close" @submitSuccess="submitSuccess"></ControlModifyCus>
|
</el-dialog>
|
|
<!-- 审核弹窗 -->
|
<el-dialog
|
v-if="dialogApprove"
|
:visible.sync="dialogApprove"
|
custom-class="comm-dialog"
|
:modal-append-to-body="false"
|
width="850px"
|
>
|
<controlApproveCus
|
:tempRecord="tempRecord"
|
:approveInfo="approveInfo"
|
@close="close"
|
@submitSuccess="submitSuccess"
|
></controlApproveCus>
|
</el-dialog>
|
|
<Dialog
|
v-model="isShowSucc"
|
icon="succ"
|
iconText="提交成功"
|
:close="false"
|
:buttons="[{text: '确定', type: 'primary'}]"
|
@handleClick="sureSucc"
|
></Dialog>
|
|
<el-dialog
|
:visible.sync="dialogTaskAssignOrReturn"
|
custom-class="comm-dialog"
|
:modal-append-to-body="false"
|
width="850px"
|
>
|
<TaskAssignOrReturnCus
|
:taskController="taskController"
|
:info="tempRecord"
|
@close="dialogTaskAssignOrReturn = false"
|
:isShow="dialogTaskAssignOrReturn"
|
@callback="toAssignOrReturn"
|
:quotaType="quotaType"
|
></TaskAssignOrReturnCus>
|
</el-dialog>
|
|
<OperateSuccessTip :content="contentTip" v-if="isShowTip"></OperateSuccessTip>
|
</div>
|
</template>
|
|
<script>
|
// 管控额度列表
|
import CommForm from "@/components/CommForm";
|
import CommTable from "@/components/CommTable";
|
import OperateSuccessTip from "@/components/OperateSuccessTip";
|
import Dialog from "@/components/Dialog";
|
import ControlModifyCus from "@/components/dialogAssembly/controlModifyCus";
|
import TaskAssignOrReturnCus from "@/components/dialogAssembly/TaskAssignOrReturnCus";
|
|
import controlApproveCus from "@/components/dialogAssembly/controlApproveCus";
|
|
import autoClaimTask from "@/controller/autoClaimTask";
|
import queryCodeValueList from "@/controller/queryCodeValueList";
|
import getAllCityAreaList from "@/controller/getAllCityAreaList";
|
import queryProductList from "@/controller/queryProductList";
|
|
import claimCommom from "@/controller/claimCommom";
|
import continueCommom from "@/controller/continueCommom";
|
const recordButtons = [
|
{
|
text: "详情",
|
prop: "detailsButton"
|
},
|
{
|
text: "修改",
|
prop: "editButton"
|
},
|
{
|
text: "立即处理",
|
prop: "immediateAttentionButton"
|
},
|
{
|
text: "继续处理",
|
prop: "continueProcessingButton"
|
},
|
{
|
text: "任务指派",
|
prop: "turnFlowUserButton"
|
},
|
{
|
text: "退回任务池",
|
prop: "returnTaskPoolButton"
|
}
|
];
|
export default {
|
components: {
|
CommForm,
|
CommTable,
|
controlApproveCus,
|
ControlModifyCus,
|
Dialog,
|
TaskAssignOrReturnCus,
|
OperateSuccessTip
|
},
|
props: {
|
model: {
|
type: Object,
|
required: true
|
},
|
phaseNo: {
|
type: String,
|
default: ""
|
},
|
// 初始值
|
initValue: {
|
type: Object,
|
default: () => ({})
|
},
|
// 默认请求参数
|
fetchInfo: {
|
type: Object,
|
default: () => ({})
|
},
|
transCode: {
|
type: String,
|
default: ""
|
},
|
|
codeNo: {
|
type: String,
|
default: ""
|
},
|
|
pageId: {
|
type: String,
|
default: ""
|
}
|
},
|
created() {
|
this.init();
|
},
|
data() {
|
return {
|
formButtons: [
|
{ text: "重置", type: "default" },
|
{ text: "搜索" },
|
{ text: "展开", type: "fold" }
|
],
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10
|
},
|
formList: [],
|
formRules: {},
|
records: [],
|
tableHeader: [],
|
tempRecord: {},
|
approveInfo: {},
|
total: 0,
|
loading: false,
|
autoTaskModel: null,
|
isShowAll: false,
|
isShowSucc: false,
|
dialogModify: false,
|
dialogApprove: false,
|
dialogTaskAssignOrReturn: false,
|
isShowTip: false,
|
continueModel: null,
|
nowModel: null,
|
operationType: "",
|
taskController: "0", // 0 退回任务池 1 任务指派
|
quotaType: "" // 0-管控额度修改 1-客户额度修改
|
};
|
},
|
methods: {
|
init() {
|
this.$route.meta.keepAlive = true;
|
const { model, initValue } = this;
|
model.computedItem = item => {
|
const { operationOption } = item;
|
// item.detailsButton = operationOption[0].value ? "1" : "0";
|
// 按钮是否显示以operationOption内的值为准
|
operationOption.map(btn => {
|
item[btn.type] = Number(btn.value);
|
});
|
return {
|
...item,
|
action: {
|
buttons: recordButtons.filter(
|
button => Number(item[button.prop]) === 1
|
)
|
}
|
};
|
};
|
this.autoTaskModel = autoClaimTask();
|
this.formList = model.getFormList(initValue);
|
this.tableHeader = model.getTableList();
|
|
this.nowModel = claimCommom();
|
this.continueModel = continueCommom();
|
|
this.setSelectOptions();
|
this.getList();
|
},
|
setSelectOptions() {
|
const { formList, phaseNo } = this;
|
formList.forEach(({ name }) => {
|
if (name === "quotaStatus") {
|
this.queryCodeValueList(name, { codeNo: "QuotaStatus" });
|
}
|
if (name === "quotaType") {
|
this.queryCodeValueList(name, { codeNo: "QuotaType" });
|
}
|
if (name === "productArray") {
|
this.queryProductList(name, {});
|
}
|
if (name === "approveStatus" && phaseNo === '0020') {
|
this.queryCodeValueList(name, { codeNo: "QuptaApproveStatus" });
|
}
|
if (name === "approveStatus") {
|
this.queryCodeValueList(name, { codeNo: "ApproveStatus" });
|
}
|
if (name === "phaseNoArray") {
|
this.queryCodeValueList(name, { codeNo: "PhaseMap" });
|
}
|
});
|
},
|
async queryCodeValueList(name, info = {}) {
|
const tempModel = queryCodeValueList();
|
const { list } = await tempModel.request(info);
|
this.updateValue(name, { options: list });
|
},
|
async getAllCityAreaList(name, info = {}) {
|
const tempModel = getAllCityAreaList();
|
const { list } = await tempModel.request(info);
|
this.updateValue(name, { options: list });
|
},
|
async queryProductList(name, info = {}) {
|
const tempModel = queryProductList();
|
const { list } = await tempModel.request();
|
this.updateValue(name, { options: list });
|
},
|
async getList() {
|
const { model, formValues, pageInfo } = this;
|
this.loading = true;
|
const res = await model.request({
|
...formValues,
|
...pageInfo
|
});
|
this.loading = false;
|
const { list = [], total } = res;
|
this.records = list;
|
this.total = parseInt(total);
|
},
|
// 更新表单数据
|
doAction(item, record) {
|
const { prop } = item;
|
this.tempRecord = { ...record };
|
// 区别是系统分配任务还是继续处理/立即处理
|
this.approveInfo = {}
|
// 详情
|
if (prop === "detailButton" || prop === "detailsButton") {
|
this.toDetail();
|
}
|
// 修改
|
if (prop === "editButton") {
|
this.dialogModify = true;
|
}
|
// 立即处理
|
if (prop === "immediateAttentionButton") {
|
this.nowAction();
|
}
|
// 继续处理
|
if (prop === "continueProcessingButton") {
|
this.continueAction();
|
}
|
// 任务指派
|
if (prop === "turnFlowUserButton") {
|
this.TaskAssign();
|
}
|
// 退回任务池
|
if (prop === "returnTaskPoolButton") {
|
this.TaskReturn();
|
}
|
},
|
toDetail() {
|
const { tempRecord, pageId } = this;
|
const {
|
serialNo = "",
|
controlSerialNo = "",
|
quotaType,
|
quotaSerialNo = "",
|
customerId,
|
certId,
|
certType
|
} = tempRecord;
|
// 0 审批阶段 1 申请阶段
|
this.toEdit({
|
serialNo,
|
controlSerialNo,
|
quotaType, // 额度类型 基础额度-00 产品额度-01
|
quotaSerialNo,
|
pageId,
|
customerId,
|
certId,
|
certType,
|
tabId: "1001",
|
type: "1" // 0-管控额度 1-客户额度
|
});
|
},
|
toEdit(info = {}) {
|
this.$router.push({
|
path: "/comm/apply",
|
query: {
|
...info
|
}
|
});
|
},
|
async nowAction() {
|
const { tempRecord, nowModel } = this;
|
const { flowApplyType, taskId } = tempRecord;
|
const info = await nowModel.request({
|
flowApplyType,
|
taskId
|
});
|
this.operationType = "0";
|
this.dialogApprove = true;
|
},
|
async continueAction() {
|
const { tempRecord, continueModel } = this;
|
const { flowApplyType, taskId } = tempRecord;
|
const info = await continueModel.request({
|
flowApplyType,
|
taskId
|
});
|
this.operationType = "1";
|
this.dialogApprove = true;
|
},
|
close(index) {
|
const { operationType } = this;
|
// 立即处理和修改成功刷新
|
if (index === 1 && operationType === "0") {
|
this.resetList();
|
}
|
this.dialogApprove = false;
|
this.dialogModify = false;
|
},
|
submitSuccess() {
|
this.dialogApprove = false;
|
this.dialogModify = false;
|
this.isShowSucc = true;
|
},
|
sureSucc() {
|
this.isShowSucc = false;
|
this.resetList();
|
},
|
// 任务指派
|
TaskAssign() {
|
this.taskController = "0";
|
this.dialogTaskAssignOrReturn = true;
|
},
|
// 退回任务池
|
TaskReturn() {
|
this.taskController = "1";
|
this.dialogTaskAssignOrReturn = true;
|
},
|
toAssignOrReturn() {
|
const { taskController } = this;
|
this.contentTip = taskController === "1" ? "退回成功" : "指派成功";
|
this.dialogTaskAssignOrReturn = false;
|
this.isShowTip = true;
|
this.resetList();
|
},
|
updateValue(index, info) {
|
const { formList } = this;
|
if (isNaN(index)) {
|
// index is name
|
index = formList.findIndex(({ name }) => name === index);
|
}
|
if (!isNaN(index) && index > -1) {
|
const preInfo = formList[index];
|
this.$set(formList, index, { ...preInfo, ...info });
|
}
|
},
|
async autoTask() {
|
const { autoTaskModel, phaseNo } = this;
|
this.approveInfo = await autoTaskModel.request({
|
objectType: "CustomerQuotaAdjustApply",
|
phaseNo
|
});
|
this.$message.success("系统分配任务成功");
|
this.dialogApprove = true;
|
},
|
// 表单按钮事件处理
|
buttonAction(id) {
|
if (id === 0) {
|
this.resetForm();
|
}
|
if (id === 1) {
|
this.resetList();
|
}
|
if (id === 2) {
|
const { isShowAll } = this;
|
this.isShowAll = !isShowAll;
|
}
|
},
|
resetForm() {
|
const { model } = this;
|
this.formList = model.getFormList();
|
this.setSelectOptions();
|
},
|
resetList() {
|
this.pageInfo.currentPage = 1;
|
this.getList();
|
if (this.isShowTip) {
|
setTimeout(() => {
|
this.isShowTip = false;
|
}, 2000);
|
}
|
},
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val;
|
this.getList();
|
},
|
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val;
|
this.getList();
|
}
|
},
|
computed: {
|
// 表单值信息
|
formValues() {
|
const { model, formList } = this;
|
return model.getFormValues(formList);
|
}
|
}
|
};
|
</script>
|
|
<style scoped>
|
</style>
|