Jelajahi Sumber

查询/创建报告

zhuhao 1 tahun lalu
induk
melakukan
4d61fa77bb

+ 6 - 1
src/views/event/components/index.vue

@@ -200,6 +200,12 @@ export default {
             value: 'value',
             type:'type',
           })
+          // 为3是下拉框选择
+          this.searchFiled.forEach(item => {
+            if (item.type == '3') {
+              item.options=this.scene
+            }
+          })
         }
       })
       this.showView = false
@@ -209,7 +215,6 @@ export default {
     },
     //获取检索条件检索
     search(val) {
-      console.log(val);
       let params = {}
       val.forEach(item => {
         if (item.type == 3) {

+ 453 - 275
src/views/report/components/dialog/addAndEditReport.vue

@@ -1,160 +1,164 @@
 <template>
   <div>
-    <el-dialog :title="title" :visible.sync="showDialog" width="1000px" :close-on-click-modal="false"  @close="handleClose(false)" :append-to-body="true">
-        <el-form :model="form" :rules="rules" ref="reportForm" label-width="120px" v-loading="loading" :element-loading-text="load_text" element-loading-spinner="el-icon-loading"
+    <el-dialog :title="title" :visible.sync="showDialog" width="1000px" :close-on-click-modal="false"
+      @close="handleClose(false)" :append-to-body="true">
+      <el-form :model="form" :rules="rules" ref="reportForm" label-width="120px" v-loading="loading"
+        :element-loading-text="load_text" element-loading-spinner="el-icon-loading"
         element-loading-background-color="rgba(0, 0, 0, 0.8)">
-            <el-row>
-                <el-col :span="12">
-                    <el-form-item :label="[3].includes(Number(form.type))?'标的产品':'标的专利'" prop="signPatentNo">
-                        <el-input v-model="form.signPatentNo" autocomplete="off" :placeholder="[3].includes(Number(form.type))?'请输入标的产品':'请输入标的专利'" @change="getPatentNo"></el-input>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="12">
-                    <el-form-item label="报告名称" prop="name">
-                        <el-input v-model="form.name" autocomplete="off" placeholder="请输入报告名称"></el-input>
-                    </el-form-item>
-                </el-col>
-            </el-row>
-            <el-form-item label="是否完成" v-if="!form.id"> 
-              <el-switch
-                v-model="form.status"
-                active-color="#13ce66"
-                inactive-color="#ff4949"
-                @change="changeStatus"
-                :active-value="3"
-                :inactive-value="1">
-              </el-switch>
-            </el-form-item> 
-            <template v-if="!form.id && form.status == 3">
-                <div>
-                    <el-form-item label="核心结论">
-                        <el-checkbox-group v-model="form.conclusionIds">
-                            <el-checkbox v-for="item in conclusion" :key="item.dictChildValue" :label="item.dictChildValue">{{ item.dictChildLabel }}</el-checkbox>
-                        </el-checkbox-group>
-                    </el-form-item>
-                    <el-form-item label="结论论述">
-                        <el-input v-model="form.cronConclusion" type="textarea" placeholder="请输入结论论述"></el-input>
-                    </el-form-item>
-                    <el-form-item label="后续跟进事项" v-if="$permission('/rms/matter')">
-                        <span v-if="form.followUps"><span v-for="item in form.followUps" :key="item.followUpName" style="margin-right:10px">{{ item.followUpName}}</span></span> 
-                        <span>
-                            <el-popover
-                            ref="popover"
-                            placement="bottom"
-                            @hide="hidePopover"
-                            @show="showPopover"
-                            trigger="click">
-                            <div>
-                                <addMatter :type="matterType" :sign="matterSign" @value="getMatter"></addMatter>
-                            </div>
-                            <el-button slot="reference">添加后续事项</el-button>
-                        </el-popover>
-                        </span>
-                    </el-form-item>
-                </div>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item :label="[3].includes(Number(form.type)) ? '标的产品' : '标的专利'" prop="signPatentNo">
+              <el-input v-model="form.signPatentNo" autocomplete="off"
+                :placeholder="[3].includes(Number(form.type)) ? '请输入标的产品' : '请输入标的专利'" @change="getPatentNo"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="报告名称" prop="name">
+              <el-input v-model="form.name" autocomplete="off" placeholder="请输入报告名称"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="是否完成" v-if="!form.id">
+          <el-switch v-model="form.status" active-color="#13ce66" inactive-color="#ff4949" @change="changeStatus"
+            :active-value="3" :inactive-value="1">
+          </el-switch>
+        </el-form-item>
+        <template v-if="!form.id && form.status == 3">
+          <div>
+            <el-form-item label="核心结论">
+              <el-checkbox-group v-model="form.conclusionIds">
+                <el-checkbox v-for="item in conclusion" :key="item.dictChildValue" :label="item.dictChildValue">{{
+                  item.dictChildLabel }}</el-checkbox>
+              </el-checkbox-group>
+            </el-form-item>
+            <el-form-item label="结论论述">
+              <el-input v-model="form.cronConclusion" type="textarea" placeholder="请输入结论论述"></el-input>
+            </el-form-item>
+            <el-form-item label="后续跟进事项" v-if="$permission('/rms/matter')">
+              <span v-if="form.followUps"><span v-for="item in form.followUps" :key="item.followUpName"
+                  style="margin-right:10px">{{ item.followUpName }}</span></span>
+              <span>
+                <el-popover ref="popover" placement="bottom" @hide="hidePopover" @show="showPopover" trigger="click">
+                  <div>
+                    <addMatter :type="matterType" :sign="matterSign" @value="getMatter"></addMatter>
+                  </div>
+                  <el-button slot="reference">添加后续事项</el-button>
+                </el-popover>
+              </span>
+            </el-form-item>
+          </div>
+        </template>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="承担部门" prop="departmentId">
+              <mySelectTree style="width:100%" v-model="form.departmentId" :options="departmentList"></mySelectTree>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="负责人" prop="personId">
+              <el-select style="width:100%" v-model="form.personId" placeholder="请选择负责人" filterable remote
+                :popper-append-to-body="false" :remote-method="remoteMethodPerson" v-SelectLazyLoading="lazyLoadingPerson"
+                :loading="loading">
+                <el-option v-for="item in personnelList" :key="item.id" :label="item.personnelName"
+                  :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <template>
+              <div>
+                <el-form-item label="委托方" prop="clientId" v-if="userinfo.tenantType == 1">
+                  <el-select style="width:100%" v-model="form.clientId" placeholder="请选择委托方" filterable remote
+                    :popper-append-to-body="false" :remote-method="remoteMethodClient"
+                    v-SelectLazyLoading="lazyLoadingClient" :loading="loading">
+                    <el-option v-for="item in clientList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                  </el-select>
+                </el-form-item>
+                <el-form-item label="委托部门" prop="departmentId" v-else>
+                  <mySelectTree style="width:100%" v-model="form.departmentId" :options="departmentList"></mySelectTree>
+                </el-form-item>
+              </div>
             </template>
-            <el-row>
-                <el-col :span="12">
-                    <el-form-item label="承担部门" prop="departmentId">
-                        <mySelectTree style="width:100%" v-model="form.departmentId" :options="departmentList"></mySelectTree>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="12">
-                    <el-form-item label="负责人" prop="personId">
-                        <el-select style="width:100%" v-model="form.personId" placeholder="请选择负责人" filterable  :popper-append-to-body="false">
-                            <el-option v-for="item in personnelList" :key="item.id" :label="item.personnelName" :value="item.id"></el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-            </el-row>
-            <el-row>
-                <el-col :span="12">
-                    <template>
-                        <div>
-                            <el-form-item label="委托方" prop="clientId" v-if="userinfo.tenantType == 1">
-                                <el-select style="width:100%" v-model="form.clientId" placeholder="请选择委托方" filterable :popper-append-to-body="false">
-                                    <el-option v-for="item in clientList" :key="item.id" :label="item.name" :value="item.id"></el-option>
-                                </el-select>
-                            </el-form-item>
-                            <el-form-item label="委托部门" prop="departmentId" v-else>
-                                <mySelectTree style="width:100%" v-model="form.departmentId" :options="departmentList"></mySelectTree>
-                            </el-form-item>
-                        </div>
-                    </template>
-                </el-col>
-                <el-col :span="12">
-                    <el-form-item label="卷号" prop="volumeNumber" >
-                        <el-input v-model="form.volumeNumber" autocomplete="off" placeholder="请输入卷号"></el-input>
-                    </el-form-item>
-                </el-col>
-            </el-row>
-            
-            <el-form-item label="应用场景">
-                <el-checkbox-group v-model="form.scenarioList">
-                    <el-checkbox v-for="item in commonData.ENTERPRISE_APPLICATION_SCENARIO" :key="item.value" :label="parseInt(item.value)">{{ item.label }}</el-checkbox>
-                </el-checkbox-group>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="卷号" prop="volumeNumber">
+              <el-input v-model="form.volumeNumber" autocomplete="off" placeholder="请输入卷号"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-form-item label="应用场景">
+          <el-checkbox-group v-model="form.scenarioList">
+            <el-checkbox v-for="item in commonData.ENTERPRISE_APPLICATION_SCENARIO" :key="item.value"
+              :label="parseInt(item.value)">{{ item.label }}</el-checkbox>
+          </el-checkbox-group>
+        </el-form-item>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="产品/技术">
+              <el-input v-model="form.proTec" autocomplete="off" placeholder="请输入产品/技术"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="form.track ? 12 : 24">
+            <el-form-item label="关联报告">
+              <el-input v-model="form.associateReportName" autocomplete="off" placeholder="请输入关联报告"></el-input>
             </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="需要复制的选项" v-show="form.track">
+              <el-select v-model="form.copyIds" multiple clearable placeholder="请选择需要复制的选项" :popper-append-to-body="false"
+                @change="changeCopyIds">
+                <el-option v-for="item in copyList" :key="item.dictChildValue" :label="item.dictChildLabel"
+                  :value="item.dictChildValue"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <template v-if="form.type == 7">
+          <div>
             <el-row>
-                <el-col :span="24">
-                    <el-form-item label="产品/技术">
-                        <el-input v-model="form.proTec" autocomplete="off" placeholder="请输入产品/技术"></el-input>
-                    </el-form-item>
-                </el-col>
+              <el-col :span="12">
+                <el-form-item label="案件编号">
+                  <el-input v-model="form.caseNumber" autocomplete="off" placeholder="请输入案件编号"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="发文序号">
+                  <el-input v-model="form.issueNumber" autocomplete="off" placeholder="请输入发文序号"></el-input>
+                </el-form-item>
+              </el-col>
             </el-row>
             <el-row>
-                <el-col :span="form.track?12:24">
-                    <el-form-item label="关联报告">
-                        <el-input v-model="form.associateReportName" autocomplete="off" placeholder="请输入关联报告"></el-input>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="12">
-                    <el-form-item label="需要复制的选项" v-show="form.track">
-                        <el-select v-model="form.copyIds" multiple clearable placeholder="请选择需要复制的选项" :popper-append-to-body="false" @change="changeCopyIds">
-                            <el-option v-for="item in copyList" :key="item.dictChildValue" :label="item.dictChildLabel" :value="item.dictChildValue"></el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
+              <el-col :span="12">
+                <el-form-item label="发明创造名称">
+                  <el-input v-model="form.inventionName" autocomplete="off" placeholder="请输入发明创造名称"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="无效宣告请求人">
+                  <el-input v-model="form.invalidApplication" autocomplete="off" placeholder="请输入无效宣告请求人"></el-input>
+                </el-form-item>
+              </el-col>
             </el-row>
-            <template v-if="form.type==7">
-                <div>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item label="案件编号">
-                                <el-input v-model="form.caseNumber" autocomplete="off" placeholder="请输入案件编号"></el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item label="发文序号">
-                                <el-input v-model="form.issueNumber" autocomplete="off" placeholder="请输入发文序号"></el-input>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item label="发明创造名称">
-                                <el-input v-model="form.inventionName" autocomplete="off" placeholder="请输入发明创造名称"></el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item label="无效宣告请求人">
-                                <el-input v-model="form.invalidApplication" autocomplete="off" placeholder="请输入无效宣告请求人"></el-input>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                </div>
-            </template>
-            <el-form-item :label="(!form.id &&form.status==3)?'上传报告文档':'上传附件'">
-                <myUpload></myUpload>
-            </el-form-item>
-            <el-form-item label="备注" prop="remark" >
-              <el-input type='textarea' v-model="form.remark" autocomplete="off" placeholder="请输入备注"></el-input>
-            </el-form-item>
-        </el-form>
-        <div slot="footer"  v-if="$reportPermission(form.id,[0,1])">
-              <el-button @click="handleClose(false)">取 消</el-button>
-              <el-button type="primary" @click="ifNext " v-if="form.type==7 && !form.id">下一步</el-button>
-              <el-button type="primary" @click="submit "  v-else>确 定</el-button>
-        </div>
+          </div>
+        </template>
+        <el-form-item :label="(!form.id && form.status == 3) ? '上传报告文档' : '上传附件'">
+          <myUpload :file-list="handleConcat(form[0].systemFileList)" @on-change="onChange" @on-remove="onRemove"
+            @on-preview="onPreview" style="height: 180px;"></myUpload>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input type='textarea' v-model="form.remark" autocomplete="off" placeholder="请输入备注"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" v-if="$reportPermission(form.id, [0, 1])">
+        <el-button @click="handleClose(false)">取 消</el-button>
+        <el-button type="primary" @click="ifNext" v-if="form.type == 7 && !form.id">下一步</el-button>
+        <el-button type="primary" @click="submit" v-else>确 定</el-button>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -165,62 +169,84 @@ export default {
   components: {},
   props: {},
   data() {
+    const isExist = (rule, value, callback) => {
+      if (!this.form.signPatentNo) {//没有专利号进入报错提示
+        this.show = 0
+        if ([3].includes(Number(this.form.type))) {
+          var text = '请输入标的产品'
+        } else {
+          var text = '请输入标的专利号'
+        }
+        callback(new Error(text))
+      }
+    }
     return {
-        //弹窗标题
-        title:'',
-        //控制弹窗是否打开
-        showDialog:false,
-        //表单数据
-        form:{},
-        //表单规则
-        rules:{},
-        //加载
-        loading:false,
-        //加载时显示的文字
-        load_text:'加载中',
-        //应用场景
-        commonData:{},
-        //核心结论
-        conclusion:[],
-        //部门数据
-        departmentList:[],
-        //需要复制的选项集合
-        copyList:[],
-        //人员列表
-        personnelList:[],
-        //客户列表
-        clientList:[],
-        //上传文件列表
-        file:[],
-        //核心结论类型字典
-        reportAsDicItem:{
-            "0":"INVALID_ASSESS",
-            "1":"THIRD_ASSESS",
-            "2":"STABILITY_ASSESS",
-            "3":"FTO_ASSESS",
-            "4":"TORT_ASSESS",
-            "5":"AVOID_ASSESS",
-            "7":"REINVALID_ASSESS",
-        },
-        //需要复制的内容字典
-        reportAsDicItemCopy:{
-            "0":"INVALID_COPY",
-            "1":"THIRD_COPY",
-            "2":"STABILITY_COPY",
-            "3":"FTO_COPY",
-            "4":"TORT_COPY",
-            "5":"AVOID_COPY",
-        },
+      //弹窗标题
+      title: '',
+      //控制弹窗是否打开
+      showDialog: false,
+      //表单数据
+      form: {},
+      //表单规则
+      rules: {
+        name: [{ required: true, message: '请输入报告名称', trigger: 'blur' },],
+        signPatentNo: [{ required: true, validator: isExist, trigger: 'blur' },],
+        personId: [{ required: true, message: '请选择负责人', trigger: 'change' },],
+        clientId: [{ required: true, message: '请选择委托方', trigger: 'change' },],
+      },
+      //加载
+      loading: false,
+      //加载时显示的文字
+      load_text: '加载中',
+      //应用场景
+      commonData: {},
+      //核心结论
+      conclusion: [],
+      //部门数据
+      departmentList: [],
+      //需要复制的选项集合
+      copyList: [],
+      //人员列表
+      personnelList: [],
+      //客户列表
+      clientList: [],
+      //上传文件列表
+      files: [],
+      //核心结论类型字典
+      reportAsDicItem: {
+        "0": "INVALID_ASSESS",
+        "1": "THIRD_ASSESS",
+        "2": "STABILITY_ASSESS",
+        "3": "FTO_ASSESS",
+        "4": "TORT_ASSESS",
+        "5": "AVOID_ASSESS",
+        "7": "REINVALID_ASSESS",
+      },
+      //需要复制的内容字典
+      reportAsDicItemCopy: {
+        "0": "INVALID_COPY",
+        "1": "THIRD_COPY",
+        "2": "STABILITY_COPY",
+        "3": "FTO_COPY",
+        "4": "TORT_COPY",
+        "5": "AVOID_COPY",
+      },
+      queryParams: {
+        current: 1,
+        size: 10,
+      },
+      //是否懒加载
+      isLazy: true,
     };
   },
   watch: {},
   computed: {
-    ...mapGetters(['webSocket','userinfo']),
+    ...mapGetters(['webSocket', 'userinfo']),
     dictMessage() {
       return this.$store.state.dictMessage.dictMessage
     },
   },
-  created() {},
+  created() { },
   mounted() {
     //获取字典项(接口还是通过字典获取)
     this.$api.getCommonData({ keys: 'QUERY_GROUP,ENTERPRISE_APPLICATION_SCENARIO,INVESTIGATION_TYPE' }).then(response => {
@@ -236,117 +262,269 @@ export default {
   },
   methods: {
     //打开弹窗
-    open(form){
-        this.form = JSON.parse(JSON.stringify(form))
-        var a = ''
-        if (this.form.id) {
-            if (this.$reportPermission(this.form.id,[0,1])) {
-                a = '编辑'
-            } else {
-                a = '查看'
-            }
+    open(form) {
+      this.form = JSON.parse(JSON.stringify(form))
+      var a = ''
+      if (this.form.id) {
+        if (this.$reportPermission(this.form.id, [0, 1])) {
+          a = '编辑'
         } else {
-            a = '创建'
+          a = '查看'
+        }
+      } else {
+        a = '创建'
+      }
+      var reportType = this.dictMessage.REPORT_TYPE.filter(item => { return item.dictChildValue == this.form.type })[0].dictChildLabel
+      this.title = a + reportType + '报告'
+      this.showDialog = true
+    },
+    // 人员列表远程搜索
+    remoteMethodPerson(query) {
+      this.isLazy = true
+      if (query !== '') {
+        this.loading = true;
+        let params = {
+          ...this.queryParams,//分页信息
+          searchQuery: `name=${query}`,
         }
-        var reportType = this.dictMessage.REPORT_TYPE.filter(item=>{return item.dictChildValue == this.form.type})[0].dictChildLabel
-        this.title = a + reportType + '报告'
-        this.showDialog = true
+        this.$api.AllPersonnelList(params).then(response => {
+          if (response.code == 200) {
+            this.loading = false;
+            this.personnelList = response.data.data
+          }
+        }).catch(error => {
+          this.loading = false;
+        })
+      } else {
+        this.personnelList = [];
+        this.getProductCategory()
+      }
+    },
+    // 获取所有人员列表懒加载
+    lazyLoadingPerson() {
+      if (!this.isLazy) {
+        return false
+      }
+      this.queryParams.current++;
+      this.getAllPersonnelList();
     },
     //获取所有人员列表(修改不要一次性获取,可以使用懒加载加远程搜索 )
-    getAllPersonnelList(){},
+    getAllPersonnelList() {
+      if (!this.isLazy) {
+        return false
+      }
+      let params = {
+        ...this.queryParams,//分页信息
+      }
+      this.$api.AllPersonnelList(params).then(response => {
+        if (response.code == 200) {
+          if (response.data.data && response.data.data.length == 0) {
+            this.isLazy = false
+          }
+          this.personnelList = [...this.personnelList, ...response.data.data];
+        }
+      }).catch(error => {
+        this.personnelList = []
+        this.$message.error(error.message)
+      })
+    },
+    // 客户列表远程搜索
+    remoteMethodClient(query) {
+      this.isLazy = true
+      if (query !== '') {
+        this.loading = true;
+        let params = {
+          ...this.queryParams,//分页信息
+          searchQuery: `name=${query}`,
+        }
+        this.$api.AllClientList(params).then(response => {
+          if (response.code == 200) {
+            this.loading = false;
+            this.clientList = response.data.data
+          }
+        }).catch(error => {
+          this.loading = false;
+        })
+      } else {
+        this.clientList = [];
+        this.getAllClientList()
+      }
+    },
+    // 获取所有客户列表懒加载
+    lazyLoadingClient() {
+      if (!this.isLazy) {
+        return false
+      }
+      this.queryParams.current++;
+      this.getAllClientList();
+    },
     //获取所有客户列表(修改不要一次性获取,可以使用懒加载加远程搜索 )
-    getAllClientList(){},
+    getAllClientList() {
+      if (!this.isLazy) {
+        return false
+      }
+      let params = {
+        ...this.queryParams,//分页信息
+      }
+      this.$api.AllClientList(params).then(response => {
+        if (response.code == 200) {
+          if (response.data.data && response.data.data.length == 0) {
+            this.isLazy = false
+          }
+          this.clientList = [...this.clientList, ...response.data.data];
+        }
+      }).catch(error => {
+        this.clientList = []
+        this.$message.error(error.message)
+      })
+    },
     //获取所有部门列表
-    getAllDepartmentList(){},
+    getAllDepartmentList() {
+      this.$api.AllDepartmentList(params).then(res => {
+        if (res.code == 200) {
+          this.departmentList = res.data
+        }
+      }).catch(error => {
+        this.$message.error(error.message)
+      })
+    },
     //关闭弹窗
-    handleClose(){
-        this.showDialog = false
+    handleClose() {
+      this.$refs.reportForm.resetFields()
+      this.form = {}
+      this.showDialog = false
     },
     //切换是否完成状态
-    changeStatus(val){
-      
+    changeStatus(val) {
+      this.form.status = val
     },
     //获取专利号且填入报告名称
-    getPatentNo(){
-      if(!this.form.name){
-        var a = this.dictMessage.REPORT_TYPE.filter(item=>{return item.dictChildValue == this.form.type})[0].dictChildLabel
-        this.$set(this.form,'name',this.form.signPatentNo + a)
+    getPatentNo() {
+      if (!this.form.name) {
+        var a = this.dictMessage.REPORT_TYPE.filter(item => { return item.dictChildValue == this.form.type })[0].dictChildLabel
+        this.$set(this.form, 'name', this.form.signPatentNo + a)
       }
     },
-     //修改需要复制的选项
-     changeCopyIds(val){
-      if(Object.keys(this.copyIndex).length>0){
-        var index = this.copyList.findIndex(item=>{
+    //修改需要复制的选项
+    changeCopyIds(val) {
+      if (Object.keys(this.copyIndex).length > 0) {
+        var index = this.copyList.findIndex(item => {
           return item.dictChildLabel == '对比文件'
         })
-        if(index!=-1){
+        if (index != -1) {
           var id = this.copyList[index].dictChildValue
-          var index2 = this.copyList.findIndex(item=>{
-              return item.dictChildLabel == '标引信息'
-            })
-          if(val.indexOf(id)!=-1){
-            if(index2==-1){
-              this.copyList.splice(index+1,0,this.copyIndex)
+          var index2 = this.copyList.findIndex(item => {
+            return item.dictChildLabel == '标引信息'
+          })
+          if (val.indexOf(id) != -1) {
+            if (index2 == -1) {
+              this.copyList.splice(index + 1, 0, this.copyIndex)
             }
-          }else{
-            if(index2!=-1){
-              this.copyList.splice(index2,1)
-              this.form.copyIds.splice(this.form.copyIds.indexOf(this.copyIndex.dictChildValue),1)
+          } else {
+            if (index2 != -1) {
+              this.copyList.splice(index2, 1)
+              this.form.copyIds.splice(this.form.copyIds.indexOf(this.copyIndex.dictChildValue), 1)
             }
           }
-        }else{
+        } else {
 
         }
       }
     },
+    // 合并已上传的文件和未上传的文件
+    handleConcat(arr) {
+      let files = (arr || []).concat(this.files)
+      return files
+    },
     //切换上传的文件
-    onChange(file, fileList){
-
+    onChange(file, fileList) {
+      if (this.files && this.files.length > 0) {
+        let a = this.files.findIndex(item => {
+          return item.size == file.size
+        })
+        if (a != -1) {
+          this.$message.error(`${file.raw.name}文件重复`)
+          this.files.splice(a, 1, file.raw)
+        } else {
+          this.files.push(file.raw)
+        }
+      } else {
+        this.files.push(file.raw)
+      }
     },
     //删除未提交的附件
-    handleRemove(file, fileList) {
-      var index = this.file.findIndex(item=>{
-        return item.uid == file.raw.uid
-      })
-      if(index!=-1){
-        this.file.splice(index,1)
+    onRemove(file, fileList) {
+      if (file.guid) {
+        let a = this.formData[0].systemFileList.findIndex(item => {
+          return item.guid == file.guid
+        })
+        this.formData[0].systemFileList.splice(a, 1)
+      } else {
+        let a = this.files.findIndex(item => {
+          return item.size == file.size
+        })
+        this.files.splice(a, 1)
       }
     },
-    //上传附件时查看附件内容
-    handlePreview(file) {
-          var item={
-              name:file.name,
-              suffix:'',
-              downLoad:true
-            }
-            var index = file.raw.type.lastIndexOf('/')
-            var type = file.raw.type.substring(index+1,file.raw.type.length)
-            var arr = ['png','jpeg','bmp','jpg']
-            if(arr.includes(type)){
-              var FileUrl =  URL.createObjectURL(file.raw)
-              var isPicture = 1
-            }else if(type == 'pdf'){
-              var FileUrl = URL.createObjectURL(file.raw)
-              var isPicture = 0
-            }else{
-              return false
-            }
-            const router = this.$router.resolve({
-                path: '/checkFile',
-                query: {
-                    row: JSON.stringify(item),
-                    FileUrl: FileUrl,
-                    isPicture:isPicture
-                }
-            })
-            window.open(router.href, '_blank');
+    //上传附件时点击查看附件内容
+    onPreview(file) {
+      var item = {
+        name: file.name,
+        suffix: '',
+        downLoad: true
+      }
+      var index = file.raw.type.lastIndexOf('/')
+      var type = file.raw.type.substring(index + 1, file.raw.type.length)
+      var arr = ['png', 'jpeg', 'bmp', 'jpg']
+      if (arr.includes(type)) {
+        var FileUrl = URL.createObjectURL(file.raw)
+        var isPicture = 1
+      } else if (type == 'pdf') {
+        var FileUrl = URL.createObjectURL(file.raw)
+        var isPicture = 0
+      } else {
+        return false
+      }
+      const router = this.$router.resolve({
+        path: '/checkFile',
+        query: {
+          row: JSON.stringify(item),
+          FileUrl: FileUrl,
+          isPicture: isPicture
+        }
+      })
+      window.open(router.href, '_blank');
     },
     //创建无效应对报告下一步
-    ifNext(){},
+    ifNext() { },
     //提交填写的信息
-    submit(){},
+    submit() {
+      this.$refs.reportForm.validate(valid => {
+        if (valid) {
+          let formData = new FormData()
+          if (this.files && this.files.length > 0) {
+            for (var i = 0; i < this.files.length; i++) {
+              formData.append("files", this.files[i]);
+            }
+          }
+          formData.append('report',this.form)
+          if (!this.form.id) {//新增报告
+            this.$api.AddReport(formData).then(response => {
+              if (response.code == 200) {
+                this.files = []
+                this.$message.success('报告创建成功')
+                this.$emit('getList', true)
+                this.handleClose()
+              }
+            })
+
+          } else {//编辑报告
+
+          }
+        }
+      })
+    },
   },
 };
 </script>
-<style lang="scss" scoped>
-</style>
+<style lang="scss" scoped></style>

+ 374 - 302
src/views/report/components/index.vue

@@ -1,42 +1,42 @@
 <template>
   <div class="height_100">
     <el-container>
-        <el-header>
-            <div>
-              <mySearch style="width:500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption"></mySearch>  
-            </div>
-            <div style="display:flex;">
-                <el-button-group style="display:flex;justify-content:flex-start" v-if="[2].indexOf(isOperate) == -1">
-                    <el-button v-for="item in viewTypes" :key="item.component" size="small" :type="viewType == item.component ? 'primary' : ''"  @click="onChange2(item.component)" >{{item.name}}</el-button>
-                </el-button-group>
-                <el-dropdown size="small" style="margin-right:20px" v-if="$permission('/pcs/report/add')">
-                  <el-button type="primary" size="small" >
-                      创建报告<i class="el-icon-arrow-down el-icon--right"></i>
-                  </el-button>
-                  <el-dropdown-menu slot="dropdown" style="margin-top:0px" v-if="dictMessage.REPORT_TYPE">
-                    <!-- 遍历按钮 -->
-                      <el-dropdown-item v-for="item in dictMessage.REPORT_TYPE.filter(item=>!['6'].includes(item.dictChildValue))" :key="item.dictChildLabel"  @click.native="handleAnalyse(item.dictChildValue)" v-if="$permission('/pcs/report/add/' + item.permission)">{{item.dictChildLabel}}</el-dropdown-item>
-                  </el-dropdown-menu>
-              </el-dropdown>
-            </div>
-        </el-header>
-        <el-main id="patent-list-container" class="main" v-loading="loading" >
-            <component :is="viewType" v-bind="$attrs" v-on="$listeners" :isOperate="isOperate" :tableData="dataList" :state="state" :group="group" :queryParams="queryParams"  @option="handleOption" @sort="handleSort" @getRow="checkDetails" @params="getParams"></component>
-        </el-main>
-        <el-footer class="pagination" v-if="viewType != 'visual'">
-          <el-pagination
-            background
-            layout="total,sizes, prev, pager, next, jumper"
-            :current-page.sync="queryParams.current"
-            :page-sizes="pageSize"
-            :page-size.sync="queryParams.size"
-            @current-change="handleCurrentChange"
-            @size-change="handleSizeChange"
-            :total="total">
-          </el-pagination>
-        </el-footer>
-      </el-container>
-      <CreateReport ref="ReportForm" @getList="isGetList"></CreateReport>
+      <el-header>
+        <div>
+          <mySearch style="width:500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption"> </mySearch>
+        </div>
+        <div style="display:flex;">
+          <el-button-group style="display:flex;justify-content:flex-start" v-if="[2].indexOf(isOperate) == -1">
+            <el-button v-for="item in viewTypes" :key="item.component" size="small"
+              :type="viewType == item.component ? 'primary' : ''"
+              @click="onChange2(item.component)">{{ item.name }}</el-button>
+          </el-button-group>
+          <el-dropdown size="small" style="margin-right:20px" v-if="$permission('/pcs/report/add')">
+            <el-button type="primary" size="small">
+              创建报告<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown" style="margin-top:0px" v-if="dictMessage.REPORT_TYPE">
+              <!-- 遍历按钮 -->
+              <el-dropdown-item v-for="item in dictMessage.REPORT_TYPE.filter(item => !['6'].includes(item.dictChildValue))"
+                :key="item.dictChildLabel" @click.native="handleAnalyse(item.dictChildValue)"
+                v-if="$permission('/pcs/report/add/' + item.permission)">{{ item.dictChildLabel }}</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </div>
+      </el-header>
+      <el-main id="patent-list-container" class="main" v-loading="loading">
+        <component :is="viewType" v-bind="$attrs" v-on="$listeners" :isOperate="isOperate" :tableData="dataList"
+          :state="state" :group="group" :queryParams="queryParams" @option="handleOption" @sort="handleSort"
+          @getRow="checkDetails" @params="getParams"></component>
+      </el-main>
+      <el-footer class="pagination" v-if="viewType != 'visual'">
+        <el-pagination background layout="total,sizes, prev, pager, next, jumper" :current-page.sync="queryParams.current"
+          :page-sizes="pageSize" :page-size.sync="queryParams.size" @current-change="handleCurrentChange"
+          @size-change="handleSizeChange" :total="total">
+        </el-pagination>
+      </el-footer>
+    </el-container>
+    <CreateReport ref="ReportForm" @getList="isGetList"></CreateReport>
   </div>
 </template>
 
@@ -53,333 +53,405 @@ export default {
     CreateReport
   },
   props: {
-    isOperate:''
+    isOperate: ''
   },
   data() {
     return {
-        //视图类型
-        viewTypes:[
-            {
-                name:'可视化',
-                component:'visual'
-            },
-            {
-                name:'列表',
-                component:'Table'
-            },
-            {
-                name:'卡片',
-                component:'Card'
-            },
-        ],
-        //当前视图类型
-        viewType:'Table',
-        //检索字段
-        searchFiled:[
-            {
-                label:'报告名称',
-                value:'name',
-                type:1,
-                placeholder:'请输入报告名称'
-            },
-            {
-                label:'报告类型',
-                value:'types',
-                type:3,
-                placeholder:'请选择报告类型',
-                // options:this.dictMessage.REPORT_TYPE||[]
-            },
-            {
-                label:'报告状态',
-                value:'statuses',
-                type:3,
-                placeholder:'请选择报告状态',
-                // options:this.dictMessage.REPORT_STATE||[]
-            },
-            {
-                label:'核心结论',
-                value:'cronIds',
-                type:3,
-                placeholder:'请选择核心结论',
-                options:[]
-            },
-        ],
-        //检索条件
-        searchOption:{
-            name:localStorage.searchContent
+      //视图类型
+      viewTypes: [
+        {
+          name: '可视化',
+          component: 'visual'
         },
-        //分页信息
-        queryParams:{
-            current:1,
-            size:10,
+        {
+          name: '列表',
+          component: 'Table'
         },
-        //分页数量
-        pageSize:[10,"全部"],
-        //排序字段
-        sort:[
-            {
-                "orderBy": "createTime",
-                "orderType": 1
-            }
-        ],
-        //分组
-        group:'',
-        //总数
-        total:0,
-        //加载
-        loading:false,
-        //报告数据集合
-        dataList:[]
+        {
+          name: '卡片',
+          component: 'Card'
+        },
+      ],
+      //当前视图类型
+      viewType: 'Table',
+      //检索字段
+      searchFiled: [
+        {
+          label: '报告名称',
+          value: 'name',
+          type: 1,
+          placeholder: '请输入报告名称'
+        },
+        {
+          label: '报告类型',
+          value: 'types',
+          type: 3,
+          placeholder: '请选择报告类型',
+          // options:this.dictMessage.REPORT_TYPE||[]
+        },
+        {
+          label: '报告状态',
+          value: 'statuses',
+          type: 3,
+          placeholder: '请选择报告状态',
+          // options:this.dictMessage.REPORT_STATE||[]
+        },
+        {
+          label: '核心结论',
+          value: 'cronIds',
+          type: 3,
+          placeholder: '请选择核心结论',
+          options: []
+        },
+      ],
+      //检索条件
+      searchOption: {
+        name: localStorage.searchContent
+      },
+      //分页信息
+      queryParams: {
+        current: 1,
+        size: 10,
+      },
+      //总数
+      total: 0,
+      //分页数量
+      pageSize: [10, "全部"],
+      //排序字段
+      sort: [
+        {
+          "orderBy": "createTime",
+          "orderType": 1
+        }
+      ],
+      //分组
+      group: '',
+      //加载
+      loading: false,
+      //报告数据集合
+      dataList: [],
+      //获取报告类型、报告状态、核心结论
+      reportSearch:{},
     };
   },
   watch: {},
   computed: {
     dictMessage() {
-        var a = this.$store.state.dictMessage.dictMessage
-        if(a.REPORT_TYPE){
-        a.REPORT_TYPE.forEach(item=>{
-            if(['0','1','2'].includes(item.dictChildValue)){
+      var a = this.$store.state.dictMessage.dictMessage
+      if (a.REPORT_TYPE) {
+        a.REPORT_TYPE.forEach(item => {
+          if (['0', '1', '2'].includes(item.dictChildValue)) {
             item.permission = 'invalid'
-            }else if(item.dictChildValue == 3){
+          } else if (item.dictChildValue == 3) {
             item.permission = 'FTO'
-            }else if(item.dictChildValue == 4){
+          } else if (item.dictChildValue == 4) {
             item.permission = 'tort'
-            }else if(item.dictChildValue == 5){
+          } else if (item.dictChildValue == 5) {
             item.permission = 'avoidDesign'
-            }else if (item.dictChildValue == 7) {
+          } else if (item.dictChildValue == 7) {
             item.permission = 'reInvalid'
-            }
+          }
         })
-        }
-        if(a.REPORT_TYPE){
-        this.searchFiled[1].options = a.REPORT_TYPE.map(item=>{
-            return {
-            value:item.dictChildValue,
-            label:item.dictChildLabel
-            }
+      }
+      if (a.REPORT_TYPE) {
+        this.searchFiled[1].options = a.REPORT_TYPE.map(item => {
+          return {
+            value: item.dictChildValue,
+            label: item.dictChildLabel
+          }
         })
-        this.searchFiled[2].options = a.REPORT_STATE.map(item=>{
-            return {
-            value:item.dictChildValue,
-            label:item.dictChildLabel
-            }
+        this.searchFiled[2].options = a.REPORT_STATE.map(item => {
+          return {
+            value: item.dictChildValue,
+            label: item.dictChildLabel
+          }
         })
-        }
-        
-        return a
+      }
+
+      return a
     },
-    state(){
-        var a = this.$store.state.dictMessage.dictMessage.REPORT_STATE
-        var b = {}
-        if(a){
+    state() {
+      var a = this.$store.state.dictMessage.dictMessage.REPORT_STATE
+      var b = {}
+      if (a) {
         a.forEach(item => {
-            b[item.dictChildValue] = item.dictChildLabel
+          b[item.dictChildValue] = item.dictChildLabel
         });
         return b
-        }
-    return []
-        
+      }
+      return []
+
     }
   },
-  created() {},
+  created() { },
   mounted() {
     //获取报告清单
     this.getList()
+    // 获取报告类型、获取报告状态、 获取核心结论
+    // this.getReportSearch()
   },
   methods: {
+    // 获取报告类型、获取报告状态、 获取核心结论
+    getReportSearch() {
+      this.$api.search(params).then(res => {
+        if (res.code == 200) {
+          this.reportSearch.types=res.data.types
+          this.reportSearch.statuses=res.data.statuses
+          this.reportSearch.cronIds = res.data.cronIds
+          this.searchFiled.forEach(item => {
+            if (item.type == 3) {
+              item.options=this.reportSearch[item.value]
+            }
+          })
+        }
+      }).catch(error => {
+        this.reportSearch.type=[]
+        this.reportSearch.state=[]
+        this.reportSearch.conclusion=[]
+        this.$message.error(error.message)
+      })
+    },
     //接收检索条件
-    search(val){
-
+    search(val) {
+      let params = {}
+      val.forEach(item => {
+        if (item.type == 3) {
+          params[item.value]=item.searchValue.map(itemValue => {
+            return itemValue.value
+          })
+        } else {
+          params[item.value]=item.searchValue.label
+        }
+      })
+      // 返回字符串
+      this.searchOption.searchQuery=this.$commonJS.objectToString(params)
+      // 调用查询接口
+      this.queryParams.current = 1
+      this.getList()
     },
     //获取报告列表
-    getList(){
-        this.dataList = [{}]
+    getList() {
+      this.dataList = [{}]
+      return
+      let params = {
+        ...this.queryParams,//分页信息
+        ...this.searchOption,//检索条件
+        orderDTOList:this.sort,//排序信息
+      }
+      this.$api.query(params).then(res => {
+        if (res.code == 200) {
+          this.dataList = res.data
+          this.total=res.total
+        }
+      }).catch(error => {
+        this.dataList = []
+        this.total=0
+        this.$message.error(error.message)
+      })
+    },
+    //排序
+    handleSort({ column, prop, order }) {
+      this.sort=[]//如需要多个字段排序,则不需要清空
+      if (order == 'null') {
+        return;
+      }
+      var orderType = {
+        ascending: 0,
+        descending:1
+      }
+      var params = this.sort.find(item => {
+        return item.orderBy == prop
+      })
+      if (params) {
+        params.orderType = orderType[order]
+      } else {
+        params = {}
+        params.orderBy = prop
+        params.orderType = orderType[order]
+        this.sort.push(params)
+      }
+      this.queryParams.current = 1
+      this.getList()
     },
     //分页
     handleCurrentChange(val) {
-        this.queryParams.current = val;
-        this.getList();
+      this.queryParams.current = val;
+      this.getList();
     },
     //切换页大小
     handleSizeChange(val) {
-        this.getList()
+      this.getList()
     },
     //切换视图
     onChange2(type) {
-        this.viewType = type
-        if(type == 'visual'){
-            this.$nextTick(()=>{
-                this.reportVisual() 
-            })
-            return false
-        }
-        this.queryParams.size = this.viewType === 'Table' ? 10 : 12
-        this.onChange()
+      this.viewType = type
+      if (type == 'visual') {
+        this.$nextTick(() => {
+          this.reportVisual()
+        })
+        return false
+      }
+      this.queryParams.size = this.viewType === 'Table' ? 10 : 12
+      this.onChange()
     },
     //展示报告可视化
     reportVisual() {
-        this.$api.reportVisual(this.queryParams).then(response=>{
-            if(response.code == 200){
-                this.$refs.reportVisual.open(response.data)
-            }
-        })
+      this.$api.reportVisual(this.queryParams).then(response => {
+        if (response.code == 200) {
+          this.$refs.reportVisual.open(response.data)
+        }
+      })
     },
-    //查询报告数据
+    //切换视图后查询报告数据
     onChange() {
-        this.queryParams.current = 1
-        this.getList()
+      this.queryParams.current = 1
+      this.getList()
     },
     //打开创建报告弹窗
     handleAnalyse(id) {
-        var form = {
-            type:id,
-            scenarioList:[]
-        }
-        this.$refs.ReportForm.open(form)
+      var form = {
+        type: id,
+        scenarioList: []
+      }
+      this.$refs.ReportForm.open(form)
     },
     //操作列
     handleOption({ option, row }) {
-        this.$s.setSession('params', row)
-        switch (option) {
-            case '0'://分享
-                this.share(row)
-                break
-            case '1'://导出报告
-                this.exportReport(row)
-                break
-            case '2'://报告文档
-                this.handleFile(row)
-                break
-            case '5'://拆分特征
-                this.handleDetails(row)
-                break
-            case '3'://自定义字段
-                this.handleFields(row)
-                break
-            case '4'://任务分配
-                this.handleTask(row)
-                break
-            case '6'://导入专利
-                this.handleImportPatent(row)
-                break
-            case '7':
-                this.$confirm('此操作将永久删除该报告, 是否继续?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    this.handleDelete(row)
-                
-                }).catch(() => {
-                    this.$message.info("已取消删除")         
-                });
-                break
-            case '8'://侵权分析技术特征对比
-                this.$s.setSession('reportMessage1',row)
-                var routerReport3 = this.$router.resolve({
-                        path: "/tortIndex",
-                        query: {
-                        id: row.id,
-                        patentNo:row.signPatentNo,
-                        personId:row.personId,
-                        type:8
-                        }
-                    })
-                window.open(routerReport3.href, '_blank');
-                break
-            case '9'://回避设计
-                this.handleDetails(row)
-                break;
-            case '10'://添加对比文件
-                this.addPatentList(row)
-                break
-            case '11'://完成报告
-                this.completeReport(row)
-                break
-            case '12'://追踪报告
-                this.trackReport(row)
-                break
-            case '13'://添加无效理由和证据
-                this.toInvalidIndex(row)
-                break;
-            case '14'://导入无效证据
-                this.toInvalidResponset(row)
-                break;
-            case 'e'://编辑
-                this.handleEdit(row)
-                break
-        }
+      this.$s.setSession('params', row)
+      switch (option) {
+        case '0'://分享
+          this.share(row)
+          break
+        case '1'://导出报告
+          this.exportReport(row)
+          break
+        case '2'://报告文档
+          this.handleFile(row)
+          break
+        case '5'://拆分特征
+          this.handleDetails(row)
+          break
+        case '3'://自定义字段
+          this.handleFields(row)
+          break
+        case '4'://任务分配
+          this.handleTask(row)
+          break
+        case '6'://导入专利
+          this.handleImportPatent(row)
+          break
+        case '7':
+          this.$confirm('此操作将永久删除该报告, 是否继续?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            this.handleDelete(row)
+
+          }).catch(() => {
+            this.$message.info("已取消删除")
+          });
+          break
+        case '8'://侵权分析技术特征对比
+          this.$s.setSession('reportMessage1', row)
+          var routerReport3 = this.$router.resolve({
+            path: "/tortIndex",
+            query: {
+              id: row.id,
+              patentNo: row.signPatentNo,
+              personId: row.personId,
+              type: 8
+            }
+          })
+          window.open(routerReport3.href, '_blank');
+          break
+        case '9'://回避设计
+          this.handleDetails(row)
+          break;
+        case '10'://添加对比文件
+          this.addPatentList(row)
+          break
+        case '11'://完成报告
+          this.completeReport(row)
+          break
+        case '12'://追踪报告
+          this.trackReport(row)
+          break
+        case '13'://添加无效理由和证据
+          this.toInvalidIndex(row)
+          break;
+        case '14'://导入无效证据
+          this.toInvalidResponset(row)
+          break;
+        case 'e'://编辑
+          this.handleEdit(row)
+          break
+      }
     },
     //编辑报告
-    handleEdit(row){
-        this.$refs.ReportForm.open(row)
-    },
-    //排序
-    handleSort(sort) {
-        this.sort.orderBy = sort.prop
-        this.sort.orderDesc = sort.order
-        this.onchange()
+    handleEdit(row) {
+      this.$refs.ReportForm.open(row)
     },
+   
     //查看详情(修改)
-    checkDetails(row){
-        row.dictMessage = this.dictMessage
-        row.showMenu = true
-        this.$s.setSession('row', row)
-        this.$s.setSession('params', row)
-        switch(row.type){
-            case 0://无效分析
-            case 1://稳定性分析
-            case 2://第三方意见
-                var router = this.$router.resolve({
-                    name: 'rDetails' ,
-                })
-                window.open(router.href, '_blank');
-                break;
-            case 3://FTO
-            
-            case 4://侵权
-                var router = this.$router.resolve({
-                name: 'FTOrDetails' ,
-                })
-                window.open(router.href, '_blank');
-                break;
-            case 5://回避
-                var router = this.$router.resolve({
-                    name: 'avoidAside' ,
-                })
-                window.open(router.href, '_blank');
-                break;
-            case 6://图表
-                break;
-            case 7://无效应对
-                var router = this.$router.resolve({
-                    name: 'InvalidResponse',
-                })
-                window.open(router.href, '_blank');
-                break;
-        }
+    checkDetails(row) {
+      row.dictMessage = this.dictMessage
+      row.showMenu = true
+      this.$s.setSession('row', row)
+      this.$s.setSession('params', row)
+      switch (row.type) {
+        case 0://无效分析
+        case 1://稳定性分析
+        case 2://第三方意见
+          var router = this.$router.resolve({
+            name: 'rDetails',
+          })
+          window.open(router.href, '_blank');
+          break;
+        case 3://FTO
+
+        case 4://侵权
+          var router = this.$router.resolve({
+            name: 'FTOrDetails',
+          })
+          window.open(router.href, '_blank');
+          break;
+        case 5://回避
+          var router = this.$router.resolve({
+            name: 'avoidAside',
+          })
+          window.open(router.href, '_blank');
+          break;
+        case 6://图表
+          break;
+        case 7://无效应对
+          var router = this.$router.resolve({
+            name: 'InvalidResponse',
+          })
+          window.open(router.href, '_blank');
+          break;
+      }
     },
     //接收可视化的参数
-    getParams(params){
-        if(params.conclusionType=='-1'){
-            this.searchOption.statuses=['0','1','2','4','5']
-            this.searchOption.types = [params.type]
-        }else{
-            this.searchOption.cronIds=[params.conclusionType]
-        }
-        var a = JSON.parse(JSON.stringify(this.searchOption))
-        this.searchOption = a
-        this.viewType = 'Table'
-        this.onChange()
+    getParams(params) {
+      if (params.conclusionType == '-1') {
+        this.searchOption.statuses = ['0', '1', '2', '4', '5']
+        this.searchOption.types = [params.type]
+      } else {
+        this.searchOption.cronIds = [params.conclusionType]
+      }
+      var a = JSON.parse(JSON.stringify(this.searchOption))
+      this.searchOption = a
+      this.viewType = 'Table'
+      this.onChange()
     },
     //创建报告子组件返回值
-    isGetList(val){
-        if(val){
-            this.onchange()
-        }
+    isGetList(val) {
+      if (val) {
+        this.getList()
+      }
     }
   },
 };
 </script>
-<style lang="scss" scoped>
-</style>
+<style lang="scss" scoped></style>

+ 6 - 3
src/views/report/components/view/table.vue

@@ -1,14 +1,14 @@
 <template>
   <div>
     <div>
-      <el-table :data="tableData" border style="width: 100%" header-row-class-name="custom-table-header">
+      <el-table :data="tableData" border style="width: 100%" header-row-class-name="custom-table-header" @sort-change="sortChange">
         <el-table-column label="#" width="60" type="index" align="center">
           <template slot-scope="scope">
             <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
           </template>
         </el-table-column>
 
-        <el-table-column v-for="item in column" :key="item.key" :prop="item.key" :label="item.name" align="center">
+        <el-table-column v-for="item in column" :key="item.key" :prop="item.key" :label="item.name" sortable="custom" align="center">
           <template slot-scope="scope">
             <div v-if="['name', 'eventNumber', 'projectNumber'].includes(item.key)">
               <el-link @click="handleItem(scope.row,item.key)">{{ scope.row[item.key] }}</el-link>
@@ -133,7 +133,10 @@ export default {
    
   },
   methods: {
-    
+        // 排序
+    sortChange({ column, prop, order }) {
+      this.$emit('sort', { column, prop, order })
+    },
     // 获取栏位数据
     getColumnData(row,key) {
       if (key == 'projectNumber1') {