|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="height_100 rejectionGuidanceLetter">
|
|
|
<!-- 添加 -->
|
|
|
- <div v-if="add || confessionSessionList.length==0" class="addRejectionGuidanceLetter">
|
|
|
+ <div v-show="add || confessionSessionList.length==0" class="addRejectionGuidanceLetter">
|
|
|
<div class="addRejectionGuidanceLetter_warp">
|
|
|
<div class="head">
|
|
|
生成驳回指导函
|
|
|
@@ -21,7 +21,7 @@
|
|
|
<el-input-number v-model="ruleForm.review_count" :min="1" :max="10" class="input-number_center"></el-input-number>
|
|
|
</el-form-item>
|
|
|
<div style="padding:15px 0">
|
|
|
- <b>文件上传:</b>
|
|
|
+ <b><i class="el-icon-star-on red"></i>文件上传:</b>
|
|
|
</div>
|
|
|
<div class="upload-box-container">
|
|
|
<!-- 驳回决定书 -->
|
|
|
@@ -47,7 +47,7 @@
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<div class="el-upload__text">
|
|
|
- <div><i class="el-icon-star-on red"></i>驳回决定书</div>
|
|
|
+ <div>驳回决定书</div>
|
|
|
<div>点击或拖到上传</div>
|
|
|
</div>
|
|
|
</el-upload>
|
|
|
@@ -116,16 +116,16 @@
|
|
|
</div>
|
|
|
<div class="foot">
|
|
|
<el-button size="small" v-if="confessionSessionList.length" @click="back">返 回</el-button>
|
|
|
- <el-button type="primary" size="small" :loading="btnLoading" @click="submit">执 行</el-button>
|
|
|
+ <el-button type="primary" size="small" :loading="btnLoading" @click="submit">生成驳回指导函</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
<!-- 结果界面 -->
|
|
|
- <div v-else>
|
|
|
+ <div v-show="!add && confessionSessionList.length" class="rejectionGuidanceLetterResult">
|
|
|
<!-- 历史记录 -->
|
|
|
<conversationRecords v-show="showOption.showMenu" name="OA答辩" :show_add="false" :conversation="currentConversation" :confessionSessionList="confessionSessionList" @addConversation="addConversation" @changeConversation="changeConversation" @updateConversation="queryConfessionSession" ></conversationRecords>
|
|
|
- <div>
|
|
|
+ <div class="rejectionGuidanceLetterResult_content">
|
|
|
<!-- 头部 -->
|
|
|
<div class="topMenu">
|
|
|
<div class="topMenu_left">
|
|
|
@@ -135,20 +135,173 @@
|
|
|
<el-button size="mini" :type="showOption.showRight?'success':'info'" @click="showOption.showRight = !showOption.showRight">{{showOption.showRight?"隐藏":"显示"}}右侧</el-button>
|
|
|
</div>
|
|
|
<el-button type="primary" size="mini" @click="addConversation">添加新会话</el-button>
|
|
|
+ <el-button type="primary" size="mini" v-if="!loading" @click="reSubmit({})">重新生成</el-button>
|
|
|
</div>
|
|
|
<div class="topMenu_right">
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 内容 -->
|
|
|
- <div>
|
|
|
+ <div class="mainContent">
|
|
|
<div class="left" v-show="showOption.showLeft" :style="!showOption.showRight?'width:calc(100% - 0px) !important':''">
|
|
|
+ <div v-show="show" class="showFile">
|
|
|
+ <div class="showFile_head">
|
|
|
+ <el-select v-model="currentFileGuid" size="mini" placeholder="请选择">
|
|
|
+ <el-option v-if="details.rejection_decision && details.rejection_decision.guid" :label="details.rejection_decision.name || details.rejection_decision.originalName" :value="details.rejection_decision.guid" @click.native="showPreview(1)"></el-option>
|
|
|
+ <template v-if="details.review_files && details.review_files.length>0">
|
|
|
+ <template v-for="(item,index) in details.review_files" >
|
|
|
+ <el-option
|
|
|
+ :key="'D'+item.num+'审查意见通知书'"
|
|
|
+ v-if="item.examination_opinion.guid"
|
|
|
+ :label="item.examination_opinion.name || item.examination_opinion.originalName"
|
|
|
+ :value="item.examination_opinion.guid"
|
|
|
+ @click.native="showPreview(2,index,'examination_opinion')">
|
|
|
+ </el-option>
|
|
|
+ <el-option
|
|
|
+ :key="'D'+item.num+'递交合并档'"
|
|
|
+ v-if="item.state_opinions.guid"
|
|
|
+ :label="item.state_opinions.name || item.state_opinions.originalName"
|
|
|
+ :value="item.state_opinions.guid"
|
|
|
+ @click.native="showPreview(2,index,'state_opinions')">
|
|
|
+ </el-option>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ <template v-if="contrast_files && contrast_files.length>0">
|
|
|
+ <template v-for="(item,index) in contrast_files" >
|
|
|
+ <el-option
|
|
|
+ :key="'对比文件'+item.index"
|
|
|
+ v-if="item.guid"
|
|
|
+ :label="'对比文件'+item.index + ':' +item.publicNo"
|
|
|
+ :value="item.guid"
|
|
|
+ @click.native="showPreview(3,index)">
|
|
|
+ </el-option>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="showFile_content" v-if="show">
|
|
|
+ <vabOnlyOffice class="myIframe" :option='option'></vabOnlyOffice>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-form v-show="!show" :model="details" label-width="170px" class="required_left">
|
|
|
+ <el-form-item label="客户文号/威世博卷号:" prop="case_volume">
|
|
|
+ {{ details.case_volume }}
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="复审建议:" prop="review_suggest">
|
|
|
+ {{ details.review_suggest }}
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="审通次数:" prop="review_count">
|
|
|
+ {{details.review_count}}
|
|
|
+ </el-form-item>
|
|
|
+ <div style="padding:15px 0">
|
|
|
+ <b>相关文件:</b>
|
|
|
+ </div>
|
|
|
+ <div class="upload-box-container file_type_list">
|
|
|
+ <!-- 驳回决定书 -->
|
|
|
+ <div>
|
|
|
+ <div v-if="details.rejection_decision" :class="['file-item',fileTypeOption[details.rejection_decision.type] || 'text']">
|
|
|
+ <span class="file-icon">
|
|
|
+ <svg-icon class="xiaoshiIcon" :iconClass="fileIconTypeOption[fileTypeOption[details.rejection_decision.type] || 'text']"></svg-icon>
|
|
|
+ </span>
|
|
|
+ <div class="file-info">
|
|
|
+ <div class="upload-placeholder">驳回决定书</div>
|
|
|
+ <div class="file-name">{{details.rejection_decision.name || details.rejection_decision.originalName}}</div>
|
|
|
+ <div class="file-type">
|
|
|
+ 类型: <span class="file-extension">{{details.rejection_decision.type.toUpperCase()}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <button class="preview-btn" @click="showPreview(1)">预览</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 审通文件 -->
|
|
|
+ <template v-if="details.review_files">
|
|
|
+ <template v-for="(review_files,index) in details.review_files">
|
|
|
+ <div :key="'D'+review_files.num+'审查意见通知书'" :class="['file-item',fileTypeOption[review_files.examination_opinion.type] || 'text']">
|
|
|
+ <span class="file-icon">
|
|
|
+ <svg-icon class="xiaoshiIcon" :iconClass="fileIconTypeOption[fileTypeOption[review_files.examination_opinion.type] || 'text']"></svg-icon>
|
|
|
+ </span>
|
|
|
+ <div v-if="review_files.examination_opinion" class="file-info">
|
|
|
+ <div class="upload-placeholder">第{{review_files.num}}次审查意见通知书</div>
|
|
|
+ <div class="file-name">{{review_files.examination_opinion.name || review_files.examination_opinion.originalName}}</div>
|
|
|
+ <div class="file-type">
|
|
|
+ 类型: <span class="file-extension">{{review_files.examination_opinion.type.toUpperCase()}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <button class="preview-btn" @click="showPreview(2,index,'examination_opinion')">预览</button>
|
|
|
+ </div>
|
|
|
+ <div :key="'D'+review_files.num+'递交文件合并档'" :class="['file-item',fileTypeOption[review_files.state_opinions.type] || 'text']">
|
|
|
+ <span class="file-icon">
|
|
|
+ <svg-icon class="xiaoshiIcon" :iconClass="fileIconTypeOption[fileTypeOption[review_files.state_opinions.type] || 'text']"></svg-icon>
|
|
|
+ </span>
|
|
|
+ <div v-if="review_files.state_opinions" class="file-info">
|
|
|
+ <div class="upload-placeholder">第{{review_files.num}}次递交文件合并档</div>
|
|
|
+ <div class="file-name">{{review_files.state_opinions.name || review_files.state_opinions.originalName}}</div>
|
|
|
+ <div class="file-type">
|
|
|
+ 类型: <span class="file-extension">{{review_files.state_opinions.type.toUpperCase()}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <button class="preview-btn" @click="showPreview(2,index,'examination_opinion')">预览</button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ <!-- 对比文件 -->
|
|
|
+ <template v-if="contrast_files && contrast_files.length>0">
|
|
|
+ <template v-for="(item,index) in contrast_files">
|
|
|
+ <div :key="'对比文件'+item.index" v-if="item.guid" :class="['file-item',fileTypeOption[item.type] || 'text']">
|
|
|
+ <span class="file-icon">
|
|
|
+ <svg-icon class="xiaoshiIcon" :iconClass="fileIconTypeOption[fileTypeOption[item.type] || 'text']"></svg-icon>
|
|
|
+ </span>
|
|
|
+ <div class="file-info">
|
|
|
+ <div class="upload-placeholder">对比文件{{ item.index }}</div>
|
|
|
+ <div class="file-name">{{item.publicNo}}-{{ item.title }}</div>
|
|
|
+ <div class="file-type">
|
|
|
+ 类型: <span class="file-extension">{{item.type.toUpperCase()}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <button class="preview-btn" @click="showPreview(3,index)">预览</button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
|
|
|
</div>
|
|
|
<div class="line" v-if="showOption.showLeft && showOption.showRight"></div>
|
|
|
- <div class="right" v-show="showOption.showRight" :style="!showOption.showLeft?'width:calc(100% - 0px) !important':''"></div>
|
|
|
+ <div class="right" v-show="showOption.showRight" :style="!showOption.showLeft?'width:calc(100% - 0px) !important':''">
|
|
|
+ <div v-if="loading" class="loading-container">
|
|
|
+ <div v-if="loading_text">
|
|
|
+ {{ loading_text }} <i class="el-icon-loading margin-left_10"></i>
|
|
|
+ </div>
|
|
|
+ <div v-else class="loading-text">
|
|
|
+ <span>生</span>
|
|
|
+ <span>成</span>
|
|
|
+ <span>中</span>
|
|
|
+ <span>.</span>
|
|
|
+ <span>.</span>
|
|
|
+ <span>.</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else class="height_100">
|
|
|
+ <div v-if="result && result.code == 1001">
|
|
|
+ <div v-html="result.message.replace('\n','<br>')"></div>
|
|
|
+ <div>
|
|
|
+ <el-link type="primary" @click="openErrorTip">点击上传</el-link>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="currentConversation.resultFiles && currentConversation.resultFiles.length" class="height_100">
|
|
|
+ <template v-if="result_file.show">
|
|
|
+ <vabOnlyOffice class="myIframe" :option='result_file.option'></vabOnlyOffice>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ 暂无结果
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <errorTipDialog ref="errorTipDialog" @submit="reSubmit"></errorTipDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -167,9 +320,13 @@ const defaultForm = {
|
|
|
]
|
|
|
}
|
|
|
import conversationRecords from '../components/conversationRecords.vue';
|
|
|
+import vabOnlyOffice from '@/components/VabOnlyOffice/index.vue'
|
|
|
+import errorTipDialog from './components/dialog/errorTip.vue';
|
|
|
export default {
|
|
|
components: {
|
|
|
- conversationRecords
|
|
|
+ conversationRecords,
|
|
|
+ vabOnlyOffice,
|
|
|
+ errorTipDialog
|
|
|
},
|
|
|
props: {},
|
|
|
data() {
|
|
|
@@ -217,6 +374,8 @@ export default {
|
|
|
name: this.$s.getObj('userinfo').name
|
|
|
}
|
|
|
},
|
|
|
+ confession:{},
|
|
|
+ currentFileGuid:'',
|
|
|
show:false,
|
|
|
btnLoading:false,
|
|
|
loading:false,
|
|
|
@@ -233,14 +392,28 @@ export default {
|
|
|
case_volume:[
|
|
|
{required: true, message: '请输入客户文号/威世博卷号', trigger: 'blur' }
|
|
|
],
|
|
|
+ review_suggest:[
|
|
|
+ {required: true, message: '请选择复审建议', trigger: 'change' },
|
|
|
+ ],
|
|
|
review_count:[
|
|
|
{validator: checkReview_count, trigger: 'change' },
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ details:{},
|
|
|
+ contrast_files:[],
|
|
|
+ result_file:{},
|
|
|
+ result:null
|
|
|
};
|
|
|
},
|
|
|
watch: {},
|
|
|
- computed: {},
|
|
|
+ computed: {
|
|
|
+ fileIconTypeOption(){
|
|
|
+ return this.$constants.fileIconTypeOption
|
|
|
+ },
|
|
|
+ fileTypeOption(){
|
|
|
+ return this.$constants.fileTypeOption
|
|
|
+ },
|
|
|
+ },
|
|
|
created() {
|
|
|
this.getInit()
|
|
|
},
|
|
|
@@ -249,6 +422,107 @@ export default {
|
|
|
async getInit(){
|
|
|
this.queryConfessionSession()
|
|
|
},
|
|
|
+ //上传解析失败的文件
|
|
|
+ openErrorTip(){
|
|
|
+ this.$refs.errorTipDialog.open(this.result)
|
|
|
+ },
|
|
|
+ //再次运行
|
|
|
+ reSubmit(data){
|
|
|
+ if(data.rejection_decision && data.rejection_decision.guid){
|
|
|
+ this.$set(this.details,'rejection_decision',data.rejection_decision )
|
|
|
+ }
|
|
|
+ let review_files = data.review_files
|
|
|
+ if(review_files && review_files.length){
|
|
|
+ for(let i = 0;i<review_files.length;i++){
|
|
|
+ let item = review_files[i]
|
|
|
+ let num = item.num
|
|
|
+ let obj = this.details.review_files.find(item1=>{
|
|
|
+ return item1.num == num
|
|
|
+ })
|
|
|
+ if(!obj){
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if(item.examination_opinion && item.examination_opinion.guid){
|
|
|
+ obj.examination_opinion = item.examination_opinion
|
|
|
+ }
|
|
|
+ if(item.state_opinions && item.state_opinions.guid){
|
|
|
+ obj.state_opinions = item.state_opinions
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let content_str = this.currentConversation.content
|
|
|
+ let content = JSON.parse(content_str)
|
|
|
+ content.input = this.details
|
|
|
+ content.dify_result = ''
|
|
|
+ var params = {
|
|
|
+ content:JSON.stringify(content),
|
|
|
+ confessionSessionId:this.currentConversation.id
|
|
|
+ }
|
|
|
+ this.$api.updateConfessionSession(params).then(response=>{
|
|
|
+ if(response.code == 200){
|
|
|
+ this.generateResult(1)
|
|
|
+ }
|
|
|
+ }).catch(error=>{
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //预览文件
|
|
|
+ showPreview(type,index,field){
|
|
|
+ let data = {
|
|
|
+ originalName:'',
|
|
|
+ guid:'',
|
|
|
+ type:''
|
|
|
+ }
|
|
|
+ let obj = {}
|
|
|
+ switch(type){
|
|
|
+ case 1:
|
|
|
+ obj = this.details.rejection_decision
|
|
|
+ break
|
|
|
+ case 2:
|
|
|
+ obj = this.details.review_files[index][field]
|
|
|
+ break
|
|
|
+ case 3:
|
|
|
+ let obj1 = this.contrast_files[index]
|
|
|
+ obj = {
|
|
|
+ originalName:'对比文件'+obj1.index+':'+obj1.publicNo,
|
|
|
+ guid:obj1.guid,
|
|
|
+ type:obj1.type
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ data.originalName = obj.name || obj.originalName
|
|
|
+ data.guid = obj.guid
|
|
|
+ data.type = obj.type
|
|
|
+ this.$set(this,'currentFileGuid',obj.guid)
|
|
|
+ this.getOption(data)
|
|
|
+ },
|
|
|
+ getOption(data,model='view'){
|
|
|
+ let option_data = data || this.confession
|
|
|
+ if(!option_data.guid){
|
|
|
+ this.$message.warning('文件不存在')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let option = {}
|
|
|
+ this.show = false
|
|
|
+ option.name = option_data.originalName
|
|
|
+ option.id = option_data.guid
|
|
|
+ option.title = option_data.originalName
|
|
|
+ option.url = this.$c.url+ (this.$c.env=='production'?'/api':'')+'/fileManager/downloadFile?fileId=' + option_data.guid
|
|
|
+ option.fileType = option_data.type
|
|
|
+ option.key = option_data.guid
|
|
|
+
|
|
|
+ option.model = model
|
|
|
+ this.$set(this,'option',
|
|
|
+ {
|
|
|
+ ...this.option,
|
|
|
+ ...option
|
|
|
+ }
|
|
|
+ )
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.show = true
|
|
|
+ })
|
|
|
+ },
|
|
|
//查询技术交底书会话记录
|
|
|
queryConfessionSession(onlyQuery,generate){
|
|
|
var params = {
|
|
|
@@ -301,14 +575,228 @@ export default {
|
|
|
}
|
|
|
this.currentConversation = obj
|
|
|
this.$set(this,'add',false)
|
|
|
- await this.getAssistWriteDetail()
|
|
|
+ await this.getDetail()
|
|
|
+ this.getResultContent(this.currentConversation)
|
|
|
+ // 判断当前文件是否存在于所有文件中
|
|
|
+ if(this.isChangeFile()){
|
|
|
+ this.showPreview(1)
|
|
|
+ }
|
|
|
if(generate){
|
|
|
this.generateResult()
|
|
|
}
|
|
|
},
|
|
|
+ // 判断当前文件是否存在于所有文件中
|
|
|
+ isChangeFile(){
|
|
|
+ if(!this.currentFileGuid){
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ let rejection_decision = this.details.rejection_decision
|
|
|
+ if(this.currentFileGuid == rejection_decision.guid){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let review_files = this.details.review_files
|
|
|
+ let files = review_files.filter(item=>{
|
|
|
+ return (item.examination_opinion.guid == this.currentFileGuid) || (item.state_opinions.guid == this.currentFileGuid)
|
|
|
+ })
|
|
|
+ if(files && files.length){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let files1 = this.contrast_files.filter(item=>{
|
|
|
+ return item.guid == this.currentFileGuid
|
|
|
+ })
|
|
|
+ if(files1 && files1.length){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },
|
|
|
+ //装载数据
|
|
|
+ getResultContent(obj){
|
|
|
+ if(obj.resultFiles && obj.resultFiles.length){
|
|
|
+ this.changeResultFile(obj.resultFiles[0])
|
|
|
+ }
|
|
|
+ let content = obj.content
|
|
|
+ this.$set(this,'details',{})
|
|
|
+ this.$set(this,'result',null)
|
|
|
+ this.$set(this,'contrast_files',[])
|
|
|
+ if(!content){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ try{
|
|
|
+ let data = JSON.parse(content)
|
|
|
+ if(!data.input){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$set(this,'details',data.input)
|
|
|
+ if(data.contrast_files){
|
|
|
+ this.$set(this,'contrast_files',data.contrast_files)
|
|
|
+ }
|
|
|
+ if(data.dify_result){
|
|
|
+ this.$set(this,'result',data.dify_result)
|
|
|
+ }
|
|
|
+
|
|
|
+ }catch(e){
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeResultFile(obj){
|
|
|
+ this.result_file = {
|
|
|
+ file_message:obj || {},
|
|
|
+ guid:obj.guid || '',
|
|
|
+ show:false,
|
|
|
+ showFile:true,
|
|
|
+ option:{
|
|
|
+ url: '',
|
|
|
+ isEdit: false,
|
|
|
+ fileType: '',
|
|
|
+ title: '',
|
|
|
+ lang: 'zh-CN',
|
|
|
+ isPrint: true,
|
|
|
+ user: {
|
|
|
+ id: this.$s.getObj('userinfo').id,
|
|
|
+ name: this.$s.getObj('userinfo').name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getResultOption()
|
|
|
+ },
|
|
|
+ getResultOption(model='edit'){
|
|
|
+ let option_data = this.result_file.file_message
|
|
|
+ if(!option_data.guid){
|
|
|
+ // this.$message.warning('文件不存在')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let option = this.result_file.option
|
|
|
+ // this.result_file.show = false
|
|
|
+ this.$set(this.result_file,'show',false)
|
|
|
+ option.name = option_data.originalName
|
|
|
+ option.id = option_data.guid
|
|
|
+ option.title = option_data.originalName
|
|
|
+ option.url = this.$c.url+ (this.$c.env=='production'?'/api':'')+'/fileManager/downloadFile?fileId=' + option_data.guid
|
|
|
+ option.fileType = option_data.type
|
|
|
+ option.key = option_data.guid
|
|
|
+ option.model = model
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.$set(this.result_file,'show',true)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //获取会话详情
|
|
|
+ async getDetail(){
|
|
|
+ var params = {
|
|
|
+ confessionSessionId:this.currentConversation.id
|
|
|
+ }
|
|
|
+ await this.$api.discoveryResultDetail(params).then(response=>{
|
|
|
+ if(response.code == 200){
|
|
|
+ let data = response.data || {}
|
|
|
+ this.currentConversation = {
|
|
|
+ ...this.currentConversation,
|
|
|
+ ...data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(error=>{
|
|
|
+ })
|
|
|
+ },
|
|
|
//生成驳回指导函
|
|
|
- generateResult(){
|
|
|
+ async generateResult(type){
|
|
|
+ let obj = this.ruleForm
|
|
|
+ if(type){
|
|
|
+ obj = this.details
|
|
|
+ }
|
|
|
+ var params = {
|
|
|
+ "rejectionDecision":JSON.stringify(obj.rejection_decision),
|
|
|
+ "reviewFiles":JSON.stringify(obj.review_files),
|
|
|
+ "reviewSuggest":obj.review_suggest,
|
|
|
+ "reviewCount":obj.review_count,
|
|
|
+ "caseVolume":obj.case_volume,
|
|
|
+ confessionSessionId:this.currentConversation.id,
|
|
|
+ conversationId:this.currentConversation.conversationId
|
|
|
+ }
|
|
|
+ this.loading = true
|
|
|
+ this.result = null
|
|
|
+ const response = await fetch('/api/xiaoshi/dify/generateRegection', {
|
|
|
+ method: 'POST',
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'application/json',
|
|
|
+ 'Accept': 'text/event-stream',
|
|
|
+ },
|
|
|
+ body:JSON.stringify(params)
|
|
|
+ });
|
|
|
|
|
|
+ if (!response.ok){
|
|
|
+ throw new Error('AI API 调用失败');
|
|
|
+ }
|
|
|
+ const reader = response.body.getReader();
|
|
|
+ const decoder = new TextDecoder('utf-8');
|
|
|
+ let noFinishMessage = ''
|
|
|
+ let resultType = null
|
|
|
+ while (true) {
|
|
|
+ const { done, value } = await reader.read();
|
|
|
+ if (done){
|
|
|
+ this.loading = false
|
|
|
+ if(resultType == 1){
|
|
|
+ this.changeConversation(this.currentConversation)
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ const chunk = decoder.decode(value);
|
|
|
+ const lines2 = chunk.split('\n\n').filter(line => line.trim() !== '' && line.trim() !== 'data:event: ping')
|
|
|
+ for(const line of lines2){
|
|
|
+ const jsonStr1 = line.replace(/^data:\s{0,}/, '');
|
|
|
+ const jsonStr = jsonStr1.trim()
|
|
|
+ if(jsonStr == 'event: ping' || jsonStr ==''){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ const json = JSON.parse(jsonStr);
|
|
|
+ if(json.event == 'message'){
|
|
|
+ if(!this.currentConversation.conversationId){
|
|
|
+ this.currentConversation.conversationId = json.conversation_id
|
|
|
+ }
|
|
|
+ let answer = json.answer
|
|
|
+ try{
|
|
|
+ let answer_json = JSON.parse(answer)
|
|
|
+ if(answer_json.code == 200){
|
|
|
+ resultType = 1
|
|
|
+ }else{
|
|
|
+ this.result = answer_json
|
|
|
+ this.openErrorTip()
|
|
|
+ }
|
|
|
+ }catch(e){
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (e) {
|
|
|
+ if(jsonStr.indexOf('{') == 0){
|
|
|
+ noFinishMessage = jsonStr
|
|
|
+ }else{
|
|
|
+ noFinishMessage += jsonStr
|
|
|
+ if(jsonStr.lastIndexOf('}') == jsonStr.length - 1){
|
|
|
+ try{
|
|
|
+ const json = JSON.parse(noFinishMessage);
|
|
|
+ if(json.event == 'message'){
|
|
|
+ let answer = json.answer
|
|
|
+ try{
|
|
|
+ let answer_json = JSON.parse(answer)
|
|
|
+ if(answer_json.code == 200){
|
|
|
+ resultType = 1
|
|
|
+ }else{
|
|
|
+ this.result = answer_json
|
|
|
+ this.openErrorTip()
|
|
|
+ }
|
|
|
+ }catch(e){
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch(e){
|
|
|
+ console.error('解析响应数据出错:', e);
|
|
|
+ }finally{
|
|
|
+ noFinishMessage = ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
//添加会话
|
|
|
async addConversation(){
|
|
|
@@ -324,6 +812,9 @@ export default {
|
|
|
clearConversation(){
|
|
|
this.$set(this,'currentConversation',{})
|
|
|
this.$set(this,'confession',{})
|
|
|
+ this.$set(this,'currentFileGuid','')
|
|
|
+ this.$set(this,'details',{})
|
|
|
+ this.$set(this,'contrast_files',[])
|
|
|
},
|
|
|
//上传文件
|
|
|
setData(row,field,value){
|
|
|
@@ -345,9 +836,12 @@ export default {
|
|
|
let formData = new FormData()
|
|
|
formData.append('sourceId',this.$constants.sourceId)
|
|
|
formData.append('files',file.raw)
|
|
|
-
|
|
|
+ let fileName = file.raw.name
|
|
|
+ let arr = fileName.split('.')
|
|
|
+ let type = arr[arr.length - 1]
|
|
|
var notice_file = {
|
|
|
- name:file.raw.name
|
|
|
+ name:fileName,
|
|
|
+ type:type.toLowerCase()
|
|
|
}
|
|
|
var message = this.$message({
|
|
|
message: '文件上传中...',
|
|
|
@@ -386,15 +880,18 @@ export default {
|
|
|
}
|
|
|
let review_files = this.ruleForm.review_files
|
|
|
let files = review_files.filter(item=>{
|
|
|
- return item.examination_opinion.guid || item.state_opinions.guid
|
|
|
+ return !item.examination_opinion.guid || !item.state_opinions.guid
|
|
|
})
|
|
|
if(files && files.length){
|
|
|
let str = files.map(item=>item.num).join('、')
|
|
|
this.$message(`第${str}次审通文件未全部上传`)
|
|
|
return false
|
|
|
}
|
|
|
+ let content = {
|
|
|
+ input:this.ruleForm
|
|
|
+ }
|
|
|
var params = {
|
|
|
- content:JSON.stringify(this.form),
|
|
|
+ content:JSON.stringify(content),
|
|
|
type:6
|
|
|
}
|
|
|
this.btnLoading = false
|
|
|
@@ -528,7 +1025,9 @@ export default {
|
|
|
</style>
|
|
|
<style lang="scss" scoped>
|
|
|
.rejectionGuidanceLetter{
|
|
|
- width:100%;
|
|
|
+ width:calc(100% - 20px);
|
|
|
+ height: calc(100% - 20px);
|
|
|
+ padding: 10px;
|
|
|
.red{
|
|
|
color:red;
|
|
|
}
|
|
|
@@ -571,5 +1070,96 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .rejectionGuidanceLetterResult{
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: stretch;
|
|
|
+ .rejectionGuidanceLetterResult_content{
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .topMenu{
|
|
|
+ height: 30px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ i{
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+ .topMenu_left{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .line{
|
|
|
+ width:2px;
|
|
|
+ height: 100%;
|
|
|
+ background: #e6e6e6;
|
|
|
+ }
|
|
|
+ .mainContent{
|
|
|
+ display: flex;
|
|
|
+ align-items: stretch;
|
|
|
+ width:100%;
|
|
|
+ height: calc(100% - 40px);
|
|
|
+ .left{
|
|
|
+ width:45%;
|
|
|
+ height:calc(100% - 0px);
|
|
|
+ padding-right: 10px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ .showFile{
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ .showFile_head{
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
+ .showFile_content{
|
|
|
+ height: calc(100% - 35px);
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .right{
|
|
|
+ width:calc(100% - 45% - 2px);
|
|
|
+ min-width: 450px;
|
|
|
+ padding:0 10px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ position: relative;
|
|
|
+ overflow-y: auto;
|
|
|
+ .loading-container{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ height: 100%;
|
|
|
+ .loading-text {
|
|
|
+ font-size: 24px;
|
|
|
+ font-family: Arial;
|
|
|
+ display: flex;
|
|
|
+ gap: 8px;
|
|
|
+ }
|
|
|
+ .loading-text span {
|
|
|
+ display: inline-block;
|
|
|
+ animation: bounce 1.2s infinite ease-in-out;
|
|
|
+ color: black;
|
|
|
+ }
|
|
|
+
|
|
|
+ .loading-text span:nth-child(2) { animation-delay: 0.1s; }
|
|
|
+ .loading-text span:nth-child(3) { animation-delay: 0.2s; }
|
|
|
+
|
|
|
+ @keyframes bounce {
|
|
|
+ 0%, 40%, 100% {
|
|
|
+ transform: translateY(0);
|
|
|
+ }
|
|
|
+ 20% {
|
|
|
+ transform: translateY(-15px);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|