<template> <div :class="{'m-review': true, 'm-review-no-error': notShowError}"> <div class="m-review-main"> <div class="m-review-content" style="width:50%"> <businessContainer ref="business"></businessContainer> </div> <div class="m-review-control" v-if="process !== '0'"> <el-tabs v-model="activeName"> <el-tab-pane label="复核意见" name="remark"> <div class="m-review-control-detail"> <el-input v-model="remark" type="textarea" :rows="25" :disabled="process == '3'" :maxlength="200"></el-input> </div> </el-tab-pane> <el-tab-pane label="历史复核意见" name="history"> <c-content class="m-review-control-detail" :height="180"> <el-timeline> <el-timeline-item v-for="(item, index) in historyRemark" :key="index" :timestamp="item.date" placement="top"> <div> <span>{{item.role}}</span> </div> <p>复核意见: {{item.remark || '无'}}</p> </el-timeline-item> </el-timeline> </c-content> </el-tab-pane> <!-- <el-tab-pane v-if="warning !== ''" label="提示信息" name="warning"> <div class="m-review-control-detail m-review-control-warning"> {{warning}} </div> </el-tab-pane> --> </el-tabs> </div> </div> <div class="m-review-action"> <el-button v-if="show.showEdit && commitFlag ==1" type="primary" size="small" @click="handleEdit" :disabled="showMode=='normal'">编辑</el-button> <el-button v-if="show.showStart" type="primary" size="small" @click="handleStart" :loading="$store.state.Status.loading.start">提交</el-button> <el-button v-if="show.showSubmit" type="primary" size="small" @click="handleSubmit" :loading="$store.state.Status.loading.submit">提交</el-button> <el-button v-if="show.showCheck" size="small" @click="handleCheck" :loading="$store.state.Status.loading.check">检核</el-button> <el-button v-if="show.showSave && !fromDeclare && !noSave" size="small" @click="handleSave" :loading="$store.state.Status.loading.save">暂存</el-button> <el-button v-if="show.showPass" type="primary" size="small" @click="handlePass" :loading="$store.state.Status.loading.pass">通过</el-button> <el-button v-if="show.showReAcc" type="primary" size="small" @click="handleReAcc" :loading="loading.reacc">提交</el-button> <el-button v-if="show.showRefuse" type="primary" size="small" @click="handleRefuse" :loading="$store.state.Status.loading.refuse">打回</el-button> <!-- 人工确认打回 --> <el-button v-if="show.showAccRefuse" type="primary" size="small" @click="handleAccRefuse" :loading="loading.accRefuse">打回</el-button> <!-- <el-button v-if="show.showReSubmit" type="primary" size="small" @click="handleReSubmit">再经办</el-button> --> <!-- <el-button v-if="show.showCheckAcc" type="primary" size="small" @click="handleCheckAcc" :loading="loading.checkacc">勾兑</el-button> --> <el-button size="small" v-if="showCancel" @click="handleCancel">删除</el-button> <el-button size="small" @click="goBack">返回</el-button> </div> <!-- <el-dialog title="请选择打回节点" :visible.sync="dialogVisible" @close="handleDialogClose" > <m-refuse-node ref="refuseNode" :txSriNo='txSriNo' :dialogVisible="dialogVisible"></m-refuse-node> <div slot="footer" class="dialog-footer"> <el-button @click="handleDialogClose" size="small">取消</el-button> <el-button type="primary" @click="handleRefuseSure" size="small" >确定</el-button> </div> </el-dialog> --> </div> </template> <script> // import { // cancelTodo // } from "~/service/public/taskList"; import businessContainer from "../Business"; import { mapMutations } from "vuex"; // import { listTodo, isRevise, todoOpend } from "~/service/public/taskList"; // import { postReFinish, postReRefuse } from "~/service/public/reFinish"; import { TaskFlagStatusMap, ProcessStatusMap, NoSaveList } from "./btnStatusConfig" import RefuseNode from './RefuseNode' import { datetimeFormat } from "~/utils/format" // import refresh from '~/mixin/refresh' import Request from "~/utils/request"; export default { name: "Review", components: { businessContainer, //复用业务容器 'm-refuse-node': RefuseNode }, // mixins:[refresh], data: function() { return { activeName: "remark", historyRemark: [], process: '0', // 0 经办 1 复核 2 经办 + 复核 3 受理中心经办更正 4-单证中心经办更正 commitFlag: 0, // 0 是第一次提交 1 非第一次 busiTempInfoSriNo: '', // warning: '提示信息', taskFlag: '0', // 任务标识 1-由待办任务列表进入 2-由未完成任务 修改列表进入 3-未完成 详情 4- 由已完成交易列表进入 5-由草稿箱进入 taskId: '', txSriNo: '', reqSource: '03', showMode: "normal", isSearchOrigin: false, show: { showStart: false, showSubmit: false, showCheck: false, showSave: false, handlePass: false, showRefuse: false, // showReSubmit: false, showReAcc: false, showCheckAcc: false, showAccRefuse: false }, noSave: false, fromDeclare: false, showCancel: false, loading: { reacc: false, checkacc: false, accRefuse: false, }, key: 0, oldTips: [], // 经办更正需要保留复核打回时的tips,用于经办更正撤回时使用 oldChanges: [], //经办更正撤回需要保留上次的changes, 提交的时候将这次的和上次的合并 notShowError: false, // 默认展示表单报错信息,进入详情时不展示报错信息 dialogVisible: false, // 打回时选择退回节点的选择框 indexCount: 0, }; }, computed: { remark: { get: function () { return this.$store.state.Status.remark }, set: function (newValue) { this.$store.commit('setRemark', newValue) } } }, mounted: function() { this.init() }, watch: { $route: function (to, from) { this.init() } }, methods: { async init () { this.reset() this.getRouteParams() this.setDisplayMode() this.getHistoryRemark() this.updateShow() this.handleOpend() this.remark = '' console.log("进入复核界面"); let child = this.$refs["business"].$children[0]; while (child.$children.length > 0 && !child.loadData) { child = child.$children[0]; } if (child && child.loadData && !this.isSearchOrigin) { let data = await child.loadData({busiTempInfoSriNo: this.busiTempInfoSriNo}) console.log(data); if ((this.process == '1' || this.process == '2') && data && typeof data.changes != "undefined" && data.changes != null ) { // 具有复核功能的页面才展示changes this.$store.commit('setHighlightChanges', data.changes) } // 经办展示 tips if ((this.process == '0' || this.process == '3' || this.process == '2' || this.process == '4') && this.taskFlag == '1' && data && data.tips && data.tips.length > 0) { // 具有经办功能的页面才展示 tips this.$store.commit('setHighlights', data.tips) } // 经办更正 撤回修改 if ((this.process == '3' || this.process == '4') && this.taskFlag == '1' && data) { // 经办更正正常展示 tips,但是在经办撤回的时候展示 oldTips if (data.oldTips && data.oldTips.length > 0) { this.$store.commit('setHighlights', data.oldTips) this.oldTips = data.oldTips } else if (data.tips && data.tips.length > 0) { this.$store.commit('setHighlights', data.tips) this.oldTips = data.tips } if(data.changes && data.changes.length > 0) { this.oldChanges = data.changes this.$store.commit('setHighlightChanges', data.changes) } } // 只有经办更正需要展示复核意见 if (data && data.remark && this.taskFlag == '1' && (this.process == '3' || this.process == '4')) { this.remark = data.remark } // debugger if (data && data.historyRemark && this.$route.path.indexOf('declare') !== -1) { // 申报页面通过loaddata获取历史复核意见 // this.historyRemark = data.historyRemark let tempmark = [] // debugger data.historyRemark.forEach(item => { if((item.remark !== null) && (item.remark !== '')) { let temp = { role: item.role, date: item.date, remark: item.remark || '' } tempmark.push(temp) } }); this.historyRemark = tempmark } } if (child && child.searchOrigin && this.isSearchOrigin) { await child.searchOrigin() } }, getRouteParams () { if (this.$route.query.routeParams) { this.process = this.$route.query.routeParams.process || '0' this.commitFlag = this.$route.query.routeParams.commitFlag || 0 this.taskFlag = this.$route.query.routeParams.taskFlag || '1' this.isSearchOrigin = this.$route.query.routeParams.fromInfo == '1' || false this.taskId = this.$route.query.routeParams.taskId || '' this.txSriNo = this.$route.query.routeParams.txSriNo || '' this.busiTempInfoSriNo = this.$route.query.routeParams.busiTempInfoSriNo || '' this.reqSource = this.$route.query.routeParams.reqSource || '03' } this.fromDeclare = this.$route.path.indexOf('declare') !== -1 this.noSave = NoSaveList.some(item => { return this.$route.path.indexOf(item) !== -1 }) if (this.taskFlag == '4' || this.taskFlag == '3') { // 进入详情后,不展示表单校验的报错 this.notShowError = true } }, setDisplayMode () { if (!this.canEdit()) { this.$store.commit("setMode", "display"); this.showMode = 'display' } }, getHistoryRemark() { if (this.process !== '0' && this.txSriNo && this.$route.path.indexOf('declare') == -1) { // 获取历史复核意见, 申报页面不获取历史复核页面 let params = { current: 0, data: { txSriNo: this.txSriNo }, orders: [{asc: true, column: "allo_time"}], size: 0 } listTodo(params).then(res => { if (res.code == '000000' && res.data && res.data.length > 0) { // this.historyRemark = res.data.map(item => { // return { // role: item.taskDealTellerName || item.taskDealTellerNo, // date: (item.finishTime && datetimeFormat(item.finishTime.substring(0, 14))) || '', // remark: item.remark || '' // } // }) res.data.forEach(item => { if(!((item.stepCode == '0' || item.stepCode == '1') && (item.taskDealInstType == '1' || item.taskDealInstType == '2'))) { if(item.remark) { let temp = { role: item.taskDealTellerName || item.taskDealTellerNo, date: (item.finishTime && datetimeFormat(item.finishTime.substring(0, 14))) || '', remark: item.remark || '' } this.historyRemark.push(temp) } } }); } console.log(res) }).catch(err => {}) } }, updateShow () { // 根据流程和来源判断按钮的展示和隐藏 // if (this.taskFlag == '3' || this.taskFlag == '4') { // this.showMode = 'display' // } if (this.taskFlag =='3' || this.taskFlag == '4' || this.taskFlag == '5') { // 未完成详情和已完成进入 this.show = TaskFlagStatusMap[this.taskFlag] ||{ showStart: false, showSubmit: false, showCheck: false, showSave: false, handlePass: false, showRefuse: false, showAccRefuse: false, // showReSubmit: false, showReAcc: false, showCheckAcc: false, showEdit: false } // 从草稿箱进入需要判断 reqSource == '03' 从经办发起调 start 接口 否则调 submit 接口 if (this.taskFlag == '5' && (this.reqSource !== '03' || this.process !== '0')) { this.show.showStart = false this.show.showSubmit = true } } else { this.show = ProcessStatusMap[this.process] || { showStart: false, showSubmit: false, showCheck: false, showSave: false, handlePass: false, showRefuse: false, showAccRefuse: false, // showReSubmit: false, showReAcc: false, showCheckAcc: false, showEdit: false } } if (this.taskFlag == '1') { // 仅有一手经办有删除按钮 if (this.process == '0' || this.process == '3') { this.showCancel = true } if (this.$route.path.indexOf('public/aml-approve') !== -1 || this.fromDeclare) { // 反洗钱复核 申报 不能删除交易 this.showCancel = false } } //结售汇不需要暂存按钮(特判) if (this.$route.query && this.$route.query.routeParams && this.$route.query.routeParams.txCode && this.$route.query.routeParams.txCode == '010319') { this.show.showSave = false } }, handleOpend () { if (this.taskId) { todoOpend(this.taskId) } }, async handlePass() { console.log(this.remark) let data = {} if (this.process == '1' || this.process == '2' || this.process == '4') { // 复核通过需要传递参数:复核意见和tips // 通过 - 清空tips data = { remark: this.remark, tips: [] //this.$store.state.Status.highlights } } // 接口 let child = this.$refs["business"].$children[0]; while (child.$children.length > 0 && !child.handlePass) { child = child.$children[0]; } if (child && child.handlePass) { await child.handlePass(data); } }, async handleRefuse() { if (this.remark.trim() == '') { this.$message.error('请填写复核意见') return } if (this.fromDeclare) { // 单独处理,不选择打回节点 let data = { remark: this.remark, tips: this.$store.state.Status.highlights, }; console.log(data); // 接口 let child = this.$refs["business"].$children[0]; while (child.$children.length > 0 && !child.handleRefuse) { child = child.$children[0]; } if (child && child.handleRefuse) { child.handleRefuse(data); } return; } const randomKey = this.indexCount + Math.floor(Math.random() * 100).toString() const h = this.$createElement let node = h('m-refuse-node', { props: { txSriNo: this.txSriNo }, key: randomKey, ref: 'refuseNode' }, []) this.$msgbox({ title: '请选择需要打回的节点', message: node, showCancelButton: false, confirmButtonText: '确定', cancelButtonText: '取消', beforeClose: (action, instance, done) => { if (action === 'confirm') { if (this.$refs.refuseNode) { let taskDefKey = this.$refs.refuseNode.check() if (taskDefKey) { let data = { remark: this.remark, tips: this.$store.state.Status.highlights, taskDefKey: taskDefKey }; console.log(data); // 接口 let child = this.$refs["business"].$children[0]; while (child.$children.length > 0 && !child.handleRefuse) { child = child.$children[0]; } if (child && child.handleRefuse) { child.handleRefuse(data); } done() } } } else { done() } } }) }, async handleSubmit() { let data = {} if (this.process == '1' || this.process == '2' || this.process == '4') { // 复核通过需要传递参数:复核意见 // 提交 - 清空 tips data = { remark: this.remark, tips: [] //this.$store.state.Status.highlights } } if ((this.process == '3' || this.process == '4') && this.oldTips.length > 0) { data.oldTips = this.oldTips } if ((this.process == '3' || this.process == '4') && this.oldChanges.length > 0) { data.oldChanges = this.oldChanges } let child = this.$refs["business"].$children[0]; while (child.$children.length > 0 && !child.handleSubmit) { child = child.$children[0]; } if (this.taskFlag == '2' || this.taskFlag == '3') { // 已完成列表进来和未完成列表进来需要判断是否可以提交 if (this.taskId) { isRevise({ data: {taskId: this.taskId} }).then(async res => { if (res.data === true) { if (child && child.handleSubmit) { await child.handleSubmit(data); } } }).catch(error => {}) } } else { if (child && child.handleSubmit) { await child.handleSubmit(data); } } }, async handleStart() { let child = this.$refs["business"].$children[0]; while (child.$children.length > 0 && !child.handleStart) { child = child.$children[0]; } if (child && child.handleStart) { await child.handleStart(); } return // this.handleSubmit() }, async handleCheck() { let child = this.$refs["business"].$children[0]; while (child.$children.length > 0 && !child.handleCheck) { child = child.$children[0]; } if (child && child.handleCheck) { await child.handleCheck(); } }, async handleSave() { let child = this.$refs["business"].$children[0]; while (child.$children.length > 0 && !child.handleSave) { child = child.$children[0]; } if (child && child.handleSave) { await child.handleSave(); } }, // handleCancel() { // let child = this.$refs["business"].$children[0]; // while (child.$children.length > 0 && !child.handleCancel) { // child = child.$children[0]; // } // if (child && child.handleCancel) { // child.handleCancel(); // } // }, // handleReSubmit() { // this.$store.commit("setMode", "normal"); // this.show = { // showStart: false, // showSubmit: true, // showCheck: true, // showSave: false, // showPass: false, // showRefuse: false, // // showReSubmit: false, // showReAcc: false, // showCheckAcc: false, // } // }, handleReAcc() { let child = this.$refs["business"].$children[0]; let header while (child.$children.length > 0 && !child.genRequestHead) { child = child.$children[0]; } if (child && child.genRequestHead) { header = child.genRequestHead(); } this.loading.reacc = true if (header) { header.taskStatus = 1 postReFinish({head: header}).then(res => { if (res.code == '000000') { this.$message.success('重新记账成功') this.$router.push('/business/home') } this.loading.reacc = false }).catch(err => { this.loading.reacc = false }) } }, handleCheckAcc() { let child = this.$refs["business"].$children[0]; let header while (child.$children.length > 0 && !child.genRequestHead) { child = child.$children[0]; } if (child && child.genRequestHead) { header = child.genRequestHead(); } if (header) { header.taskStatus = 4 postReFinish({head: header}).then(res => { if (res.code == '000000') { this.$message.success('勾兑成功') this.$router.push('/business/home') } }) } }, handleAccRefuse() { // 人工确认中的打回 // this.dialogVisible = true const randomKey = this.indexCount + Math.floor(Math.random() * 100).toString() const h = this.$createElement let node = h('m-refuse-node', { props: { txSriNo: this.txSriNo }, key: randomKey, ref: 'refuseNode' }, []) this.$msgbox({ title: '请选择需要打回的节点', message: node, showCancelButton: false, confirmButtonText: '确定', cancelButtonText: '取消', beforeClose: (action, instance, done) => { if (action === 'confirm') { if (this.$refs.refuseNode) { let taskDefKey = this.$refs.refuseNode.check() if (taskDefKey) { let child = this.$refs["business"].$children[0]; let header while (child.$children.length > 0 && !child.genRequestHead) { child = child.$children[0]; } if (child && child.genRequestHead) { header = child.genRequestHead(); } if (header) { header.taskStatus = 2 header.taskDefKey = taskDefKey header.remark = this.remark || '' postReRefuse({head: header}).then(res => { if (res.code == '000000') { this.$message.success('操作成功') this.$router.push('/business/home') this.dialogVisible = false done() } }) } } } } else { done() } } }) }, // handleDialogClose () { // this.dialogVisible = false // }, // handleRefuseSure () { // debugger // let taskDefKey = this.$refs.refuseNode.check() // if (taskDefKey) { // // 人工确认 打回 // let child = this.$refs["business"].$children[0]; // let header // while (child.$children.length > 0 && !child.genRequestHead) { // child = child.$children[0]; // } // if (child && child.genRequestHead) { // header = child.genRequestHead(); // } // if (header) { // header.taskStatus = 2 // header.taskDefKey = taskDefKey // postReRefuse({head: header}).then(res => { // if (res.code == '000000') { // this.$message.success('操作成功') // this.$router.push('/business/home') // this.dialogVisible = false // } // }) // } // } // }, handleCancel() { //删除该交易 this.$confirm('此操作将删除该交易,是否继续', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }).then(() => { // 交易流水号 if (this.$route.query && this.$route.query.routeParams && this.$route.query.routeParams.txSriNo) { cancelTodo(this.$route.query.routeParams.txSriNo).then(res => { if (res.code == '000000') { this.$message({ type: 'success', message: '删除成功' }) this.exit() } }) } else { this.$message('此交易不存在交易流水号') } }).catch(() => { }) }, goBack () { //回到待办列表 this.$confirm('确认退出?', '', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }).then(res => { if (this.fromDeclare) { let getid = this.$route.query.key; Request.get("/v1/declare/releaseLock/" + getid); } let child = this.$refs["business"].$children[0]; while (child.$children.length > 0 && !child.handleExit) { child = child.$children[0]; } if (child && child.handleExit) { child.handleExit(); } this.exit() }).catch(() => {}) }, canEdit() { if (this.process == '1' || this.taskFlag == '3' || this.taskFlag == '4' || this.process == '5') { return false } // 非第一次经办,默认进入不可编辑,出现编辑按钮,点击后方可编辑 if (this.commitFlag == 1) { return false } return true }, exit() { this.$store.dispatch("TagsView/delView", this.$route); if (this.$route.query && this.$route.query.routeParams) { setTimeout(() => { this.$router.back() }, 500) } else { setTimeout(() => { this.$router.push('/business/home') }, 500) } }, reset() { this.$store.commit('setHighlightChanges', []) this.$store.commit('setHighlights', []) this.$store.commit("setMode", "normal") this.showMode = "normal" this.remark = '' this.$store.commit('setStartLoading', false) this.$store.commit('setSubmitLoading', false) this.$store.commit('setPassLoading', false) this.$store.commit('setRefuseLoading', false) this.$store.commit('setCheckLoading', false) this.$store.commit('setSaveLoading', false) this.loading.reacc = false this.loading.checkacc = false }, handleEdit() { this.showMode = "normal" this.$store.commit("setMode", "normal") } }, beforeDestroy: function() { // 如果跳转还是 review 页面则不执行 reset 方法,因为destroy调用在下次 create 之后 if (this.$route.path.indexOf('review') == -1) { this.reset() } } }; </script> <style> .m-review .eContainer-func { display: none; } .m-review { width: 100%; height: 100%; overflow: hidden; position: static; /* padding-bottom: 62px; */ box-sizing: border-box; display: flex; flex-direction: column; } .m-review-main { flex: 1; display: flex; /* height: 100%; */ display: -webkit-flex; flex-direction: row; justify-content: space-around; } .m-review .business_container{ position: static; } .m-review-content { height: 100%; flex: auto; position: static; } .m-review-control { box-sizing: border-box; border-left: 1px solid #efefef; padding: 0 20px; height: 100%; width: 250px; flex: initial; } .m-review-control-detail ul { padding: 0; } .m-review-control-detail .el-timeline-item { padding-right: 20px; } .m-review-action { /* position: fixed; */ /* bottom: 0; */ width: 100%; /* height: 32px; */ text-align: center; padding: 10px; background: #fff; border-top: 1px solid #efefef; z-index: 10; } .m-review-control-warning { font-size: 14px; } .m-review .highlight-change-formitem { border: 1px solid #E6A23C; } .m-review .highlight-formitem { border: 1px solid red; } .m-review .el-form-item { box-sizing: border-box; } .m-review.m-review-no-error .el-form-item__error { display: none; } </style>