zhuliu 3 månader sedan
förälder
incheckning
8966f4ae6d

+ 379 - 46
src/views/AITools/OADefense/OADefense1.vue

@@ -3,7 +3,7 @@
       <conversationRecords v-show="showMenu" name="OA答辩" :show_add="false" :conversation="currentConversation" :confessionSessionList="confessionSessionList" @addConversation="addConversation" @changeConversation="changeConversation" @updateConversation="queryConfessionSession" ></conversationRecords>
       
        <!-- 左侧文件展示 -->
-       <div class="left" v-show="showLeft">
+       <div class="left customize_file" v-show="showLeft">
             <div class="head">
                 <div class="head_left">
                     <div class="margin-right_10">
@@ -37,8 +37,8 @@
             </div>
             <!-- 输入 -->
             <template v-if="add">
-                <div>
-                    <p>审查意见书:</p>
+                <div >
+                    <!-- <p>审查意见书:</p>
                     <div>
                         <el-upload
                             ref="upload_file"
@@ -63,12 +63,160 @@
                             1.如果上传了相关文件则优先使用上传的文件,如果不上传则系统会自动获取文件
                             <br>
                             2.上传的申请文件要包含本申请号码,对比文件包含对比文件序号或者名称
-                            <!-- <br>
-                            3. 扫描件暂时无法识别,请上传非扫描件 -->
                         </div>
                     </div>
                     <div>
                         <myUpload :file-list="patent_fileUrls" @on-change="onchangeFile" @on-remove="onRemove" style="height: 180px;" :autoUpload="true"></myUpload>
+                    </div> -->
+                    <div style="height:calc(100vh - 210px);overflow-y: auto;overflow-x:hidden">
+                        <div style="display:flex;align-items: center;justify-content:space-between">
+                            <p class="file_title"><i class="el-icon-star-on"></i>本次需要答复的审查意见通知书</p>
+                            <div>
+                                <el-button size="mini" class="margin-right_10" type="primary" @click="batch_upload">批量上传</el-button>
+                            </div>
+                        </div>
+                        
+                        <div class="upload_file">
+                            <div v-if="notice_file.guid" class="file_show">
+                                <myTooltip :content="notice_file.name ? notice_file.name : notice_file.originalName">
+                                    <div class="noWrap file_name">
+                                        <i class="el-icon-document" style="margin-right: 10px"></i>
+                                        <span class="name">{{notice_file.name ? notice_file.name : notice_file.originalName}}</span>
+                                    </div>
+                                </myTooltip>
+                                <div class="type">{{ notice_file.guid ? "已上传" : "待上传" }}</div>
+                                <div class="icon" @click="notice_file = {}">
+                                    <i class="el-icon-close"></i>
+                                </div>
+                            </div>
+                            <el-upload
+                                v-else
+                                ref="upload_file"
+                                class="upload-demo"
+                                drag
+                                action="#"
+                                :auto-upload="false"
+                                :limit="1"
+                                :on-change="(file)=>onChange(file,'notice_file')"
+                                style="width: 100%"
+                            >
+                                <i class="el-icon-upload"></i>
+                                <div class="el-upload__text">
+                                    <div><em>点击上传</em></div>
+                                    <div>或将文件拖到此处上传</div>
+                                </div>
+                            </el-upload>
+                        </div>
+                        <div style="margin:25px 0;">
+                            <el-divider content-position="left">相关文件(选填)</el-divider>
+                        </div>
+                        
+                        <p class="file_title">本申请文件</p>
+                        <div class="upload_file">
+                            <div v-if="relevant_file.app_file.guid" class="file_show">
+                                <myTooltip :content="relevant_file.app_file.name ? relevant_file.app_file.name : relevant_file.app_file.originalName">
+                                    <div class="noWrap file_name">
+                                        <i class="el-icon-document" style="margin-right: 10px"></i>
+                                        <span class="name">{{relevant_file.app_file.name ? relevant_file.app_file.name : relevant_file.app_file.originalName}}</span>
+                                    </div>
+                                </myTooltip>
+                                <div class="type">{{ relevant_file.app_file.guid ? "已上传" : "待上传" }}</div>
+                                <div class="icon" @click="relevant_file.app_file = {}">
+                                    <i class="el-icon-close"></i>
+                                </div>
+                            </div>
+                            <el-upload
+                                v-else
+                                ref="upload_file"
+                                class="upload-demo"
+                                drag
+                                action="#"
+                                :auto-upload="false"
+                                :limit="1"
+                                :on-change="(file)=>onChange(file,'relevant_file.app_file')"
+                                style="width: 100%"
+                            >
+                                <i class="el-icon-upload"></i>
+                                <div class="el-upload__text">
+                                    <div><em>点击上传</em></div>
+                                    <div>或将文件拖到此处上传</div>
+                                </div>
+                            </el-upload>
+                        </div>
+                        <p class="file_title">上一次OA的修改对照页(若有)</p>
+                        <div class="upload_file">
+                            <div v-if="relevant_file.modify_file.guid" class="file_show">
+                                <myTooltip :content="relevant_file.modify_file.name ? relevant_file.modify_file.name : relevant_file.modify_file.originalName">
+                                    <div class="noWrap file_name">
+                                        <i class="el-icon-document" style="margin-right: 10px"></i>
+                                        <span class="name">{{relevant_file.modify_file.name ? relevant_file.modify_file.name : relevant_file.modify_file.originalName}}</span>
+                                    </div>
+                                </myTooltip>
+                                <div class="type">{{ relevant_file.modify_file.guid ? "已上传" : "待上传" }}</div>
+                                <div class="icon" @click="relevant_file.modify_file = {}">
+                                    <i class="el-icon-close"></i>
+                                </div>
+                            </div>
+                            <el-upload
+                                v-else
+                                ref="upload_file"
+                                class="upload-demo"
+                                drag
+                                action="#"
+                                :auto-upload="false"
+                                :limit="1"
+                                :on-change="(file)=>onChange(file,'relevant_file.modify_file')"
+                                style="width: 100%"
+                            >
+                                <i class="el-icon-upload"></i>
+                                <div class="el-upload__text">
+                                    <div><em>点击上传</em></div>
+                                    <div>或将文件拖到此处上传</div>
+                                </div>
+                            </el-upload>
+                        </div>
+                        <template v-if="relevant_file.contrast_file">
+                            <div>
+                                <div v-for="contrast_file in relevant_file.contrast_file" :key="'D'+contrast_file.order">
+                                    <p class="file_title">对比文件D{{ contrast_file.order }}</p>
+                                    <div class="upload_file">
+                                        <div v-if="contrast_file.file.guid" class="file_show">
+                                            <myTooltip :content="contrast_file.file.name ? contrast_file.file.name : contrast_file.file.originalName">
+                                                <div class="noWrap file_name">
+                                                    <i class="el-icon-document" style="margin-right: 10px"></i>
+                                                    <span class="name">{{contrast_file.file.name ? contrast_file.file.name : contrast_file.file.originalName}}</span>
+                                                </div>
+                                            </myTooltip>
+                                            <div class="type">{{ contrast_file.file.guid ? "已上传" : "待上传" }}</div>
+                                            <div class="icon" @click="contrast_file.file = {}">
+                                                <i class="el-icon-close"></i>
+                                            </div>
+                                        </div>
+                                        <el-upload
+                                            v-else
+                                            ref="upload_file"
+                                            class="upload-demo"
+                                            drag
+                                            action="#"
+                                            :auto-upload="false"
+                                            :limit="1"
+                                            :on-change="(file)=>onChange(file,'file',contrast_file)"
+                                            style="width: 100%"
+                                        >
+                                            <i class="el-icon-upload"></i>
+                                            <div class="el-upload__text">
+                                                <div><em>点击上传</em></div>
+                                                <div>或将文件拖到此处上传</div>
+                                            </div>
+                                        </el-upload>
+                                    </div>
+                                </div>
+                                <div class="addContrastFile">
+                                    <el-button size="medium" @click="add_contrast_file">添加 + </el-button>
+                                </div>
+
+                            </div>
+                        </template>
                     </div>
                     <hr style="margin:15px 0;">
                     <div class="run">
@@ -156,6 +304,8 @@
         </div>
         <!-- 错误提示以及上传文件 -->
         <errorTipDialog ref="errorTip" @submit="reLoadSubmit"></errorTipDialog>
+        <!-- 批量上传文件 -->
+        <batchFileDialog ref="batchFile" :sign="1" @get_file_obj="get_file_obj"></batchFileDialog>
     </div>
 </template>
   
@@ -167,11 +317,13 @@ import {renderMarkdown} from '@/utils/markdown'
 import { downLoad2 } from '@/utils'
 import { scrollToBottom } from '../components/mixins/scrollToBottom'
 import errorTipDialog from './dialog/errorTip.vue'
+import batchFileDialog from './dialog/batchFile.vue';
 export default {
     components: {
       conversationRecords,
       vabOnlyOffice,
-      errorTipDialog
+      errorTipDialog,
+      batchFileDialog
     },
     props: {},
     mixins:[mixin,scrollToBottom],
@@ -202,6 +354,24 @@ export default {
         reLoadSearch:false,//重新生成OA答辩
         add:true,//添加审查通知书
         notice_file:{},//审查通知书文件
+        relevant_file:{
+            app_file:{},
+            modify_file:{},
+            contrast_file:[
+                {
+                    order:1,
+                    file:{}
+                },
+                {
+                    order:2,
+                    file:{}
+                },
+                {
+                    order:3,
+                    file:{}
+                },
+            ]
+        },
         patent_fileUrls:[],//专利文件地址
         result_file:{},//结果文件
         app_file:{},//申请文件
@@ -225,20 +395,72 @@ export default {
         async getInit(){
             this.queryConfessionSession()
         },
-        //再次提交
-        reLoadSubmit(data){
-            if(!data || data.length==0){
-                return 
+        add_contrast_file(){
+            let order1 = this.relevant_file.contrast_file[this.relevant_file.contrast_file.length-1].order
+            this.relevant_file.contrast_file.push(
+                {
+                    order:order1 + 1,
+                    file:{}
+                }
+            )
+        },
+        //批量上传
+        batch_upload(){
+            this.$refs.batchFile.open()
+        },
+        get_file_obj(data){
+            if(data.notice_file){
+                this.$set(this,'notice_file',data.notice_file)
             }
-            for(let i = 0;i<data.length;i++){
-                let name = data[i].name
-                let index = this.patent_fileUrls.findIndex(item=>{
-                    return item.name == name
-                })
-                if(index == -1){
-                    this.patent_fileUrls.push(data[i])
+            if(data.app_file){
+                this.$set(this.relevant_file,'app_file',data.app_file)
+            }
+            if(data.modify_file){
+                this.$set(this.relevant_file,'modify_file',data.modify_file)
+            }
+            if(data.contrast_file && data.contrast_file.length>0){
+                let contrast_file = this.relevant_file.contrast_file
+                for(let i = 0;i<data.contrast_file.length;i++){
+                    let item = data.contrast_file[i]
+                    let order = item.order
+                    let obj = contrast_file.find(file=>{
+                        return file.order == order
+                    })
+                    if(obj){
+                        obj.file = item.file
+                    }else{
+                        let order1 = contrast_file[contrast_file.length-1].order
+                        if(order > order1 + 1){
+                            for(let y = order1 + 1;y < order;y++){
+                                contrast_file.push(
+                                    {
+                                        order:y,
+                                        file:{}
+                                    }
+                                )
+                            }
+                        }
+                        contrast_file.push(item)
+                    }
                 }
             }
+        },
+        //再次提交
+        reLoadSubmit(data){
+            // if(!data || data.length==0){
+            //     return 
+            // }
+            
+            // for(let i = 0;i<data.length;i++){
+            //     let name = data[i].name
+            //     let index = this.patent_fileUrls.findIndex(item=>{
+            //         return item.name == name
+            //     })
+            //     if(index == -1){
+            //         this.patent_fileUrls.push(data[i])
+            //     }
+            // }
+            this.get_file_obj(data)
             let content = this.currentConversation.content
             var params = {
                 confessionSessionId:this.currentConversation.id,
@@ -247,30 +469,39 @@ export default {
                 params.content = JSON.stringify(
                     {
                         query:{
-                            patent_fileUrls:this.patent_fileUrls,
+                            // patent_fileUrls:this.patent_fileUrls,
+                            relevant_file:this.relevant_file,
                         }
                     }
                 )
             }else{
                 try{
-                    let data = JSON.parse(content)
-                    if(data.data && data.data.code == 1001){
-                        data.data = {}
+                    let data1 = JSON.parse(content)
+                    if(data1.data && data1.data.code == 1001){
+                        data1.data = {}
                     }
-                    if(data.query && data.query.patent_fileUrls){
-                        data.query.patent_fileUrls = this.patent_fileUrls
+                    // if(data1.query && data1.query.patent_fileUrls){
+                    //     data1.query.patent_fileUrls = this.patent_fileUrls
+                    // }else{
+                    //     data1.query = {
+                    //         patent_fileUrls:this.patent_fileUrls
+                    //     }
+                    // }
+                    if(data1.query && data1.query.relevant_file){
+                        data1.query.relevant_file = this.relevant_file
                     }else{
-                        data.query = {
-                            patent_fileUrls:this.patent_fileUrls
+                        data1.query = {
+                            relevant_file:this.relevant_file
                         }
                     }
-                    params.content = JSON.stringify(data)
+                    params.content = JSON.stringify(data1)
                     
                 }catch(e){
                     params.content = JSON.stringify(
                         {
                             query:{
-                                patent_fileUrls:this.patent_fileUrls,
+                                // patent_fileUrls:this.patent_fileUrls,
+                                relevant_file:this.relevant_file
                             }
                         }
                     ) 
@@ -336,7 +567,8 @@ export default {
             content:JSON.stringify(
                 {
                     query:{
-                        patent_fileUrls:this.patent_fileUrls,
+                        // patent_fileUrls:this.patent_fileUrls,
+                        relevant_file:this.relevant_file,
                     }
                 }
             ),
@@ -356,10 +588,12 @@ export default {
       },
       //添加会话
       addConversation(){
+        this.$set(this,'currentConversation',{})
         this.$set(this,'confession',{})
         this.$set(this,'add',true)
         this.$set(this,'notice_file',{})
-        this.$set(this,'patent_fileUrls',[])
+        // this.$set(this,'patent_fileUrls',[])
+        this.set_relevant_file()
         this.$set(this,'app_file',{})
         this.$set(this,'contrast_file',[])
         this.$set(this,'result_file',{})
@@ -367,6 +601,29 @@ export default {
         this.$set(this,'result',null)
         
       },
+      //设置相关文件初始化
+      set_relevant_file(){
+        this.$set(this,'relevant_file',
+            {
+                app_file:{},
+                modify_file:{},
+                contrast_file:[
+                    {
+                        order:1,
+                        file:{}
+                    },
+                    {
+                        order:2,
+                        file:{}
+                    },
+                    {
+                        order:3,
+                        file:{}
+                    },
+                ]
+            }
+        )
+      },
       //切换左侧展示的文件
         handleOptionClick(obj,type){
             switch(type){
@@ -458,18 +715,23 @@ export default {
         }
         this.getResultOption()
         this.$set(this,'result',null)
-        this.$set(this,'patent_fileUrls',[])
+        // this.$set(this,'patent_fileUrls',[])
+        this.set_relevant_file()
         this.contrast_file = []
         this.app_file = {}
         let content = obj.content
         if(!content){
-            this.$set(this,'patent_fileUrls',[])
+            // this.$set(this,'patent_fileUrls',[])
+            this.set_relevant_file()
           return
         }
         try{
           let data = JSON.parse(content)
-          if(data.query && data.query.patent_fileUrls){
-            this.$set(this,'patent_fileUrls',data.query.patent_fileUrls)
+        //   if(data.query && data.query.patent_fileUrls){
+        //     this.$set(this,'patent_fileUrls',data.query.patent_fileUrls)
+        //   }
+          if(data.query && data.query.relevant_file){
+            this.$set(this,'relevant_file',data.query.relevant_file)
           }
           if(data.answer){
             this.$set(this,'result',data.answer)
@@ -493,7 +755,7 @@ export default {
                 }
             }else if(answer_data.code == 1001){
                 this.result = answer_data
-                this.$refs.errorTip.open(answer_data.data)
+                this.$refs.errorTip.open(answer_data)
             }else if(answer_data.code == 1002){
                 this.result = answer_data
             }
@@ -505,15 +767,32 @@ export default {
         }
       },
       openErrorTip(){
-        this.$refs.errorTip.open(this.result.data)
+        this.$refs.errorTip.open(this.result)
+      },
+      setData(row,field,value){
+        var fieldArray = field.split('.')
+        let current = row || this;  
+        // 遍历路径中的每一部分,直到最后一个属性的父对象  
+        for (let i = 0; i < fieldArray.length - 1; i++) {  
+            // 确保当前对象有下一个属性,否则创建一个空对象(或你需要的任何默认值)  
+            if (!current.hasOwnProperty(fieldArray[i])) {  
+                current[fieldArray[i]] = {};  
+            }  
+            current = current[fieldArray[i]];  
+        }  
+        
+        // 给最后一个属性赋值  
+        current[fieldArray[fieldArray.length - 1]] = value;  
       },
       //上传文件
-      onChange(file){
+      onChange(file,field,row){
         let formData = new FormData()
         formData.append('sourceId',this.$constants.sourceId)
         formData.append('files',file.raw)
-
-        var notice_file = file.raw
+        
+        var notice_file = {
+            name:file.raw.name
+        }
         var message = this.$message({
             message: '文件上传中...',
             type: 'warning',
@@ -523,10 +802,10 @@ export default {
             if(response.code == 200){
                 let guid = response.data[0]
                 notice_file.guid = guid
-                this.$set(this,'notice_file',notice_file)
+                // this.$set(this,field,notice_file)
+                this.setData(row,field,notice_file)
                 message.close()
                 this.$message.success('文件上传成功')
-                this.$refs.upload_file.clearFiles()
             }
         })
       },
@@ -615,15 +894,63 @@ export default {
 </script>
 <style lang="scss">
 .OADefense{
-    .upload-demo{
-        .el-upload{
-           width: 100% !important;  
+    .file_title{
+        font-weight: bold;
+        i{
+            color: red !important;
         }
-       
-        .el-upload-dragger {
-            width: 100% !important;
+    }
+    .file_show{
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        line-height: 100px;
+        .file_name{
+            width: calc(100% - 90px);
+        }
+        .type {
+          min-width:75px;
+          display: block;
+          color: #57a5f7;
+        }
+        .icon {
+          display: none;
         }
     }
+    .file_show:hover {
+        background: #f4f4f4;
+        .name {
+          color: #57a5f7;
+          cursor: pointer;
+        }
+        .type {
+          min-width:75px;
+          display: none;
+        }
+        .icon {
+          display: block;
+          cursor: pointer;
+        }
+      }
+      .customize_file{
+        .upload-demo{
+            .el-upload{
+            width: 100% !important;  
+            }
+        
+            .el-upload-dragger {
+                width: 100% !important;
+                height:100px !important;
+                display: flex;
+                align-items: center;
+                .el-icon-upload{
+                    font-size: 40px !important;
+                    margin: 0 25px !important;
+                }
+            }
+        }
+      }
+    
 }
     
 </style>
@@ -654,6 +981,12 @@ export default {
                 font-size: 20px;
             }
         }
+        .addContrastFile{
+            margin-top: 10px;
+            display: flex;
+            justify-content: center;
+            width: 100%;
+        }
         .run{
             display: flex;
             justify-content: space-between;

+ 145 - 0
src/views/AITools/OADefense/dialog/batchFile.vue

@@ -0,0 +1,145 @@
+<template>
+  <div>
+    <el-dialog title="批量上传" :visible.sync="visible" width="600px" :before-close="handleClose" :close-on-click-modal="false" :modal-append-to-body="false">
+      <div>
+        <div style="padding: 10px 0;">
+          <div style="font-size:16px"><b>批量上传文件规则:</b></div>
+          <div style="font-size:16px;color:red">
+            <ul>
+              <li v-if="sign == 1">上传的申请意见通知书,则文件名称需要包含"审查意见通知书",例如:"第一次审查意见通知书.pdf"</li>
+              <li>上传的本申请文件,则文件名称需要包含"本申请"或者"申请文件",例如:"本申请:CN202510519781.3.pdf"</li>
+              <li>上传的修改对照页文件,则文件名称需要包含"修改对照页",例如:"第一次审查意见修改对照页.docx"</li>
+              <li>上传的对比文件,则文件名称需要包含"D+数字"或者"对比文件+数字",例如:"D1-CN120032911A.pdf"</li>
+            </ul>
+          </div>
+        </div>
+        <div>
+         <myUpload :file-list="patent_fileUrls" @on-change="onchangeFile" @on-remove="onRemove" style="height: 180px;" :multiple="true" :autoUpload="true"></myUpload> 
+        </div>
+        
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="handleClose">取 消</el-button>
+        <el-button size="mini" type="primary" :loading="loading" @click="submit">确 认</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {
+    sign:{
+      type:Number,
+      default:null
+    }
+  },
+  data() {
+    return {
+      visible:false,
+      patent_fileUrls:[],
+      file_obj:{},
+      loading:false
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {
+    open(){
+      this.patent_fileUrls = []
+      this.file_obj = {}
+      this.visible = true
+    },
+    handleClose(){
+      this.loading = false
+      this.visible = false
+    },
+    submit(){
+      if(this.patent_fileUrls.length == 0){
+        this.handleClose()
+        return
+      }
+      this.loading = true
+      this.file_obj = {
+        contrast_file:[]
+      }
+      for(let i = 0;i<this.patent_fileUrls.length;i++){
+        let item = this.patent_fileUrls[i]
+        if(!item.guid){
+          this.$message.warning('存在文件未上传成功,请稍等...')
+          this.loading = false
+          return
+        }
+        let name = item.name
+        if(name.indexOf('审查意见通知书')!=-1){
+          this.file_obj.notice_file = item
+          continue
+        }
+        if(name.indexOf('本申请')!=-1 || name.indexOf('申请文件')!=-1){
+          this.file_obj.app_file = item
+          continue
+        }
+        if(name.indexOf('修改对照页')!=-1){
+          this.file_obj.modify_file = item
+          continue
+        }
+        const regex = /(D|对比文件)(\d+)/;
+        const match = name.match(regex);
+        let order = null
+        if (match) {
+          order = match[2]; // 返回捕获的数字部分
+        }
+        if(order){
+          this.file_obj.contrast_file.push(
+            {
+              order:order,
+              file:item
+            }
+          )
+        }
+      }
+      this.$emit('get_file_obj',this.file_obj)
+      this.handleClose()
+    },
+    /**
+     * 上传文件处理
+     *  */
+    // 上传的文件监听
+    onchangeFile(file, fileList) {
+        if(!this.patent_fileUrls){
+            this.$set(this,'patent_fileUrls',[])
+        }
+        if (file.guid) {
+            let index = this.patent_fileUrls.findIndex(item => {
+                return item.uid == file.uid
+            })
+            if (index != -1) {
+                this.patent_fileUrls.splice(index, 1, file)
+            }
+        } else {
+            this.patent_fileUrls.push(
+              {
+                name:file.raw.name,
+                uid:file.raw.uid
+              }
+            )
+        }
+
+    },
+    // 删除上传的文件
+    onRemove(file, fileList) {
+        let index = this.patent_fileUrls.findIndex(item => {
+            return item.uid == file.uid
+        })
+        if (index != -1) {
+            this.patent_fileUrls.splice(index, 1)
+        }
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 236 - 14
src/views/AITools/OADefense/dialog/errorTip.vue

@@ -1,40 +1,156 @@
 <template>
     <div>
       <el-dialog title="文件缺少提示" :visible.sync="visible" width="600px" :before-close="handleClose" :close-on-click-modal="false" :modal-append-to-body="false">
-          <div>
+          <div  class="customize_file">
             <div style="font-size:16px" v-html="tip"></div>
-            <div style="padding: 10px 0;">
+            <!-- <div style="padding: 10px 0;">
                 <div><b>请上传缺少的文件(申请文件和对比文件):</b></div>
                 <div style="font-size:16px;color:red">
                     注:上传的申请文件要包含本申请号码,对比文件包含对比文件序号或者名称
-                    <!-- <br>
-                    1. 上传的申请文件要包含本申请号码,对比文件包含对比文件序号或者名称
-                    <br>
-                    2. 扫描件暂时无法识别,请上传非扫描件 -->
                 </div>
             </div>
             <div>
                 <myUpload :file-list="patent_fileUrls" @on-change="onchangeFile" @on-remove="onRemove" style="height: 180px;" :autoUpload="true"></myUpload>
-            </div>
+            </div> -->
+            <div style="overflow-y: auto;overflow-x:hidden">
+                <template v-if="relevant_file.app_file">
+                    <div>
+                        <p class="file_title">本申请文件</p>
+                        <div class="upload_file">
+                            <div v-if="relevant_file.app_file.guid" class="file_show">
+                                <myTooltip :content="relevant_file.app_file.name ? relevant_file.app_file.name : relevant_file.app_file.originalName">
+                                    <div class="noWrap file_name">
+                                        <i class="el-icon-document" style="margin-right: 10px"></i>
+                                        <span class="name">{{relevant_file.app_file.name ? relevant_file.app_file.name : relevant_file.app_file.originalName}}</span>
+                                    </div>
+                                </myTooltip>
+                                <div class="type">{{ relevant_file.app_file.guid ? "已上传" : "待上传" }}</div>
+                                <div class="icon" @click="relevant_file.app_file = {}">
+                                    <i class="el-icon-close"></i>
+                                </div>
+                            </div>
+                            <el-upload
+                                v-else
+                                ref="upload_file"
+                                class="upload-demo"
+                                drag
+                                action="#"
+                                :auto-upload="false"
+                                :limit="1"
+                                :on-change="(file)=>onChange(file,'relevant_file.app_file')"
+                                style="width: 100%"
+                            >
+                                <i class="el-icon-upload"></i>
+                                <div class="el-upload__text">
+                                    <div><em>点击上传</em></div>
+                                    <div>或将文件拖到此处上传</div>
+                                </div>
+                            </el-upload>
+                        </div>
+                    </div>
+                </template>
+                <template v-if="relevant_file.modify_file">
+                    <div>
+                        <p class="file_title">上一次OA的修改对照页</p>
+                        <div class="upload_file">
+                            <div v-if="relevant_file.modify_file.guid" class="file_show">
+                                <myTooltip :content="relevant_file.modify_file.name ? relevant_file.modify_file.name : relevant_file.modify_file.originalName">
+                                    <div class="noWrap file_name">
+                                        <i class="el-icon-document" style="margin-right: 10px"></i>
+                                        <span class="name">{{relevant_file.modify_file.name ? relevant_file.modify_file.name : relevant_file.modify_file.originalName}}</span>
+                                    </div>
+                                </myTooltip>
+                                <div class="type">{{ relevant_file.modify_file.guid ? "已上传" : "待上传" }}</div>
+                                <div class="icon" @click="relevant_file.modify_file = {}">
+                                    <i class="el-icon-close"></i>
+                                </div>
+                            </div>
+                            <el-upload
+                                v-else
+                                ref="upload_file"
+                                class="upload-demo"
+                                drag
+                                action="#"
+                                :auto-upload="false"
+                                :limit="1"
+                                :on-change="(file)=>onChange(file,'relevant_file.modify_file')"
+                                style="width: 100%"
+                            >
+                                <i class="el-icon-upload"></i>
+                                <div class="el-upload__text">
+                                    <div><em>点击上传</em></div>
+                                    <div>或将文件拖到此处上传</div>
+                                </div>
+                            </el-upload>
+                        </div>
+                    </div>
+                </template>
+                    
+                    <template v-if="relevant_file.contrast_file">
+                        <div>
+                            <div v-for="contrast_file in relevant_file.contrast_file" :key="'D'+contrast_file.order">
+                                <p class="file_title">对比文件D{{ contrast_file.order }}</p>
+                                <div class="upload_file">
+                                    <div v-if="contrast_file.file.guid" class="file_show">
+                                        <myTooltip :content="contrast_file.file.name ? contrast_file.file.name : contrast_file.file.originalName">
+                                            <div class="noWrap file_name">
+                                                <i class="el-icon-document" style="margin-right: 10px"></i>
+                                                <span class="name">{{contrast_file.file.name ? contrast_file.file.name : contrast_file.file.originalName}}</span>
+                                            </div>
+                                        </myTooltip>
+                                        <div class="type">{{ contrast_file.file.guid ? "已上传" : "待上传" }}</div>
+                                        <div class="icon" @click="contrast_file.file = {}">
+                                            <i class="el-icon-close"></i>
+                                        </div>
+                                    </div>
+                                    <el-upload
+                                        v-else
+                                        ref="upload_file"
+                                        class="upload-demo"
+                                        drag
+                                        action="#"
+                                        :auto-upload="false"
+                                        :limit="1"
+                                        :on-change="(file)=>onChange(file,'file',contrast_file)"
+                                        style="width: 100%"
+                                    >
+                                        <i class="el-icon-upload"></i>
+                                        <div class="el-upload__text">
+                                            <div><em>点击上传</em></div>
+                                            <div>或将文件拖到此处上传</div>
+                                        </div>
+                                    </el-upload>
+                                </div>
+                            </div>
+                        </div>
+                    </template>
+                    </div>
           </div>
         <span slot="footer" class="dialog-footer">
           <el-button size="mini" @click="handleClose">取 消</el-button>
+          <el-button size="mini" type="primary" @click="batch_upload">批量上传</el-button>
           <el-button size="mini" type="primary" :loading="loading" @click="submit">再次运行</el-button>
         </span>
       </el-dialog>
+      <!-- 批量上传文件 -->
+        <batchFileDialog ref="batchFile" @get_file_obj="get_file_obj"></batchFileDialog>
     </div>
 </template>
   
 <script>
+import batchFileDialog from './batchFile.vue';
   export default {
-    components: {},
+    components: {
+        batchFileDialog
+    },
     props: {},
     data() {
       return {
           visible:false,
           loading:false,
           tip:'',
-          patent_fileUrls:[]
+          patent_fileUrls:[],
+          relevant_file:{}
       };
     },
     watch: {},
@@ -43,10 +159,95 @@
     mounted() {},
     methods: {
         open(tip){
-            this.tip = tip.replace('\n','<br>')
+            this.tip = tip.data.replace('\n','<br>')
+            let non_existent_files = tip.non_existent_files
+            this.$set(this,'relevant_file',{})
+            if(non_existent_files.appNo){
+                this.$set(this.relevant_file,'app_file',{})
+            }
+            if(non_existent_files.modify){
+                this.$set(this.relevant_file,'modify_file',{})
+            }
+            if(non_existent_files.publicNos && non_existent_files.publicNos.length){
+                this.$set(this.relevant_file,'contrast_file',[])
+                non_existent_files.publicNos.forEach(item=>{
+                    this.relevant_file.contrast_file.push(
+                        {
+                            order:item.index,
+                            publicNo:item.publicNo,
+                            file:{}
+                        }
+                    )
+                })
+            }
             this.$set(this,'patent_fileUrls',[])
             this.visible = true
         },
+        setData(row,field,value){
+            var fieldArray = field.split('.')
+            let current = row || this;  
+            // 遍历路径中的每一部分,直到最后一个属性的父对象  
+            for (let i = 0; i < fieldArray.length - 1; i++) {  
+                // 确保当前对象有下一个属性,否则创建一个空对象(或你需要的任何默认值)  
+                if (!current.hasOwnProperty(fieldArray[i])) {  
+                    current[fieldArray[i]] = {};  
+                }  
+                current = current[fieldArray[i]];  
+            }  
+            
+            // 给最后一个属性赋值  
+            current[fieldArray[fieldArray.length - 1]] = value;  
+        },
+        //上传文件
+        onChange(file,field,row){
+            let formData = new FormData()
+            formData.append('sourceId',this.$constants.sourceId)
+            formData.append('files',file.raw)
+
+            var notice_file = {
+                name:file.raw.name
+            }
+            var message = this.$message({
+                message: '文件上传中...',
+                type: 'warning',
+                duration:0
+            });
+            this.$api.uploadFile(formData).then(response=>{
+                if(response.code == 200){
+                    let guid = response.data[0]
+                    notice_file.guid = guid
+                    // this.$set(this,field,notice_file)
+                    this.setData(row,field,notice_file)
+                    message.close()
+                    this.$message.success('文件上传成功')
+                }
+            })
+        },
+        //批量上传
+        batch_upload(){
+            this.$refs.batchFile.open()
+        },
+        get_file_obj(data){
+            if(data.app_file){
+                this.$set(this.relevant_file,'app_file',data.app_file)
+            }
+            if(data.modify_file){
+                this.$set(this.relevant_file,'modify_file',data.modify_file)
+            }
+            if(data.contrast_file && data.contrast_file.length>0){
+                let contrast_file = this.relevant_file.contrast_file
+                for(let i = 0;i<data.contrast_file.length;i++){
+                    let item = data.contrast_file[i]
+                    let order = item.order
+                    let obj = contrast_file.find(file=>{
+                        return file.order == order
+                    })
+                    if(obj){
+                        obj.file = item.file
+                    }
+                }
+            }
+        },
         /**
          * 上传文件处理
          *  */
@@ -80,11 +281,32 @@
             this.visible = false
         },
         submit(){
-            if(this.patent_fileUrls.length == 0){
-                this.$message.warning('请上传缺少的相关文件后再运行!')
-                return
+            // if(this.patent_fileUrls.length == 0){
+            //     this.$message.warning('请上传缺少的相关文件后再运行!')
+            //     return
+            // }
+            // this.$emit('submit',this.patent_fileUrls)
+            if(this.relevant_file.app_file){
+                if(!this.relevant_file.app_file.guid){
+                    this.$message.warning('请上传缺少的相关文件后再运行!')
+                    return
+                }
+            }
+            if(this.relevant_file.modify_file){
+                if(!this.relevant_file.modify_file.guid){
+                    this.$message.warning('请上传缺少的相关文件后再运行!')
+                    return
+                }
+            }
+            if(this.relevant_file.contrast_file){
+                this.relevant_file.contrast_file.forEach(item=>{
+                    if(!item.file.guid){
+                        this.$message.warning('请上传缺少的相关文件后再运行!')
+                        return
+                    }
+                })
             }
-            this.$emit('submit',this.patent_fileUrls)
+            this.$emit('submit',this.relevant_file)
             this.handleClose()
         },
     },

+ 15 - 6
src/views/AITools/OADefense/mixins/index1.js

@@ -22,9 +22,16 @@ export default {
 
             this.controller = new AbortController();
             let patent_fileUrls = {}
-            if(this.patent_fileUrls && this.patent_fileUrls.length){
-                this.patent_fileUrls.forEach(item=>{
-                    patent_fileUrls[item.name] = item.guid
+            // if(this.patent_fileUrls && this.patent_fileUrls.length){
+            //     this.patent_fileUrls.forEach(item=>{
+            //         patent_fileUrls[item.name] = item.guid
+            //     })
+            // }
+            if(this.relevant_file.contrast_file && this.relevant_file.contrast_file.length){
+                this.relevant_file.contrast_file.forEach(item=>{
+                    if(item.file && item.file.guid){
+                        patent_fileUrls['D' + item.order + '-' + item.file.name] = item.file.guid
+                    }
                 })
             }
             // var params = {
@@ -50,7 +57,9 @@ export default {
             // });
             var params = {
                 confessionSessionId:this.currentConversation.id,
-                patentFileUrls:JSON.stringify(patent_fileUrls)
+                patentFileUrls:JSON.stringify(patent_fileUrls),
+                appFileGuid:this.relevant_file.app_file.guid,
+                modifyFileGuid:this.relevant_file.modify_file.guid
             }
             this.loading = true
             this.result = null
@@ -89,7 +98,7 @@ export default {
                                 let answer_json = JSON.parse(answer)
                                 if(answer_json.code == 1001){//缺少专利文件
                                     this.result = answer_json
-                                    this.$refs.errorTip.open(answer_json.data)
+                                    this.$refs.errorTip.open(answer_json)
                                 }else if(answer_json.code == 200){
                                     this.queryConfessionSession(false,false,true) 
                                 }
@@ -116,7 +125,7 @@ export default {
                                             let answer_json = JSON.parse(answer)
                                             if(answer_json.code == 1001){//缺少专利文件
                                                 this.result = answer_json
-                                                this.$refs.errorTip.open(answer_json.data)
+                                                this.$refs.errorTip.open(answer_json)
                                             }else if(answer_json.code == 1001){//请求超时
                                                 this.result = answer_json
                                             }else if(answer_json.code == 200){