浏览代码

Merge branch 'product' of http://1.116.113.26:8088/zhuliu/xiaoshi_system into product

zhuliu 1 年之前
父节点
当前提交
99f107ac3c

+ 44 - 38
src/api/newApi/common.js

@@ -1,42 +1,48 @@
 import axios from "@/utils/axios";
 export default {
-    /**
-     * 查询应用场景
-     * @param {*} data 
-     * @returns 
-     */
-    getScenario(data) {
-        return axios.get("/xiaoshi/common/scenario", {data});
-    },
-    /**
-     * 根据应用场景获取处理事项(调查类型)
-     * @param {*} data 
-     * @returns 
-     */
-    getMatter(data) {
-        return axios.post("/xiaoshi/common/matter", data);
-    },
+  /**
+   * 查询应用场景
+   * @param {*} data 
+   * @returns 
+   */
+  getScenario(data) {
+    return axios.get("/xiaoshi/common/scenario", { data });
+  },
+  /**
+   * 根据应用场景获取处理事项(调查类型)
+   * @param {*} data 
+   * @returns 
+   */
+  getMatter(data) {
+    return axios.post("/xiaoshi/common/matter", data);
+  },
 
-     /**
-     * 获取table栏位及分组字段
-     */
-    getParamsCommon(data) {
-        return axios.post('/xiaoshi/common/getParams', data);
-    },
-    /**
-     * 显示栏位管理(查询显示栏位)
-     * @param {*} data 
-     * @returns 
-     */
-    getCustomField(params) {
-        return axios.get("/xiaoshi/common/getCustomField", { params });
-    },
-    /**
-     * 显示栏位管理(更新显示栏位)
-     * @param {*} data 
-     * @returns 
-     */
-    setCustomField(data) {
-        return axios.post("/xiaoshi/common/setCustomField",  data );
-    },
+  /**
+  * 获取table栏位及分组字段
+  */
+  getParamsCommon(data) {
+    return axios.post('/xiaoshi/common/getParams', data);
+  },
+  /**
+   * 显示栏位管理(查询显示栏位)
+   * @param {*} data 
+   * @returns 
+   */
+  getCustomField(params) {
+    return axios.get("/xiaoshi/common/getCustomField", { params });
+  },
+  /**
+   * 显示栏位管理(更新显示栏位)
+   * @param {*} data 
+   * @returns 
+   */
+  setCustomField(data) {
+    return axios.post("/xiaoshi/common/setCustomField", data);
+  },
+  /**
+  * 获取核心结论 
+  */
+  queryCrons(params) {
+    return axios.get("/xiaoshi/common/queryCrons", { params });
+  },
 };

+ 18 - 0
src/api/newApi/patentMining.js

@@ -7,9 +7,27 @@ export default {
     return axios.post("/xiaoshi/patentDigProject/addPatentDigProject", data);
   },
   /**
+   * 查询专利挖掘项目
+   */
+  queryPatentDigProject(data) {
+    return axios.post("/xiaoshi/patentDigProject/queryPatentDigProject", data);
+  },
+  /**
    * 查询研发项目
    */
   getRdProjectByNumber(params) {
     return axios.get("/xiaoshi/patentDigProject/getRdProjectByNumber", {params});
   },
+  /**
+   * 编辑专利挖掘项目
+   */
+  updatePatentDigProject(data) {
+    return axios.post("/xiaoshi/patentDigProject/updatePatentDigProject", data);
+  },
+  /**
+   * 删除专利挖掘项目
+   */
+  deletePatentDigProject(data) {
+    return axios.post("/xiaoshi/patentDigProject/deletePatentDigProject", data);
+  },
 };

+ 13 - 0
src/api/newApi/report.js

@@ -13,4 +13,17 @@ export default {
     queryReportProject(data) {
         return axios.post("/xiaoshi/reportProject/queryReportProject", data);
     },
+    /**
+     * 删除报告 
+     */
+    deleteReportProject(data) {
+        return axios.post("/xiaoshi/reportProject/deleteReportProject", data);
+    },
+    /**
+     * 编辑报告 
+     */
+    updateReportProject(data) {
+        return axios.post("/xiaoshi/reportProject/updateReportProject", data);
+    },
+   
 };

+ 2 - 2
src/utils/model/upload/index.vue

@@ -254,8 +254,8 @@ export default {
       formData.append('files',file.raw)
       this.$api.uploadFile(formData).then(response=>{
         if(response.code == 200){
-          file.guid = response.data
-          file.raw.guid = response.data
+          file.guid = response.data[0]
+          file.raw.guid = response.data[0]
           this.$emit("on-change", file)
         }
       })

+ 3 - 2
src/views/event/components/index.vue

@@ -323,7 +323,7 @@ export default {
     //获取排序字段// 子组件table排序
     handleSort({ column, prop, order, str }) {
       this.sort=[]//如需要多个字段排序,则不需要清空
-      if (order == 'null') {
+      if (order == null) {
         return;
       }
       var orderType = {
@@ -387,9 +387,10 @@ export default {
       }).then(() => {
         this.$api.deleteEvent(ids).then(res => {
           if (res.code == 200) {
-            this.getList()
             if(isLast){
               this.isGrouping()
+            } else {
+              this.getList()
             }
             this.handleMessage = '删除成功'
             this.clearMessage()

+ 1 - 1
src/views/event/components/view/table.vue

@@ -250,7 +250,7 @@ export default {
     // 排序方法
     handleSort({ column, prop, order }) {
       this.sort=[]//如需要多个字段排序,则不需要清空
-      if (order == 'null') {
+      if (order == null) {
         return;
       }
       var orderType = {

+ 258 - 33
src/views/patentMining/components/dialog/addAndEditProject.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-dialog :title="title" :visible.sync="dialogVisible" width="850" :before-close="handleClose">
+    <el-dialog :title="title" :visible.sync="dialogVisible" width="850px" :before-close="handleClose">
       <el-form :model="form" status-icon :rules="rules" ref="form" label-width="120px" class="demo-ruleForm">
         <template>
           <!-- 研发项目 -->
@@ -15,7 +15,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="研发名称:" prop="rdName">
+              <el-form-item label="编号名称:" prop="rdName">
                 <el-input v-model="form.rdName" placeholder="请输入研发项目名称"></el-input>
               </el-form-item>
             </el-col>
@@ -43,7 +43,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="技术方向:">
-              <el-input v-model="form.type" placeholder="请输入技术方向"></el-input>
+              <el-input v-model="form.technicalDirection" placeholder="请输入技术方向"></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -95,7 +95,7 @@
           <el-col :span="24">
             <el-form-item label="参与人:">
               <div class="manage">
-                <el-button size="small" @click="showDialog(2)">选择</el-button>
+                <el-button size="small" @click="showDialog()">选择</el-button>
                 <div v-html="getNames(form.adminPersons)">
 
                 </div>
@@ -106,6 +106,35 @@
         </el-row>
         <el-row>
           <el-col :span="24">
+            <el-form-item label="事件:">
+              <mySelectButton size='large' style="width:100%" @click="addEvent">
+                <div style="width:100%">
+                  <el-select style="width:100%" v-model="form.eventId" @change="changeEvent" filterable remote clearable
+                    placeholder="请选择" :loading="eventList.loading" v-SelectLazyLoading="loadEvent"
+                    :remote-method="remoteEvent">
+                    <el-option v-for="item in eventList.data" :key="item.id" :label="item.name" :value="item.id">
+                    </el-option>
+                  </el-select>
+                </div>
+              </mySelectButton>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row v-if="show == true">
+          <el-col :span="24">
+            <el-form-item label="调查类型:" prop="matterIds">
+              <el-checkbox-group v-model="form.matterIds">
+                <template>
+                  <el-checkbox v-for="item in dictAssociates" :key="item.id" :label="parseInt(item.id)">
+                    {{ item.name }}
+                  </el-checkbox>
+                </template>
+              </el-checkbox-group>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
             <el-form-item label="负责人:">
               <el-select v-model="form.headId" placeholder="请选择负责人" style="width: 100%;" filterable remote
                 :remote-method="remoteMethodPerson" v-SelectLazyLoading="lazyLoadingPerson"
@@ -119,7 +148,7 @@
         <el-row>
           <el-col :span="24">
             <el-form-item label="附件:">
-              <myUpload :file-list="form.systemFileList" @on-change="onchange" @on-remove="onRemove"
+              <myUpload :file-list="form.systemFileList" @on-change="onchangeFile" @on-remove="onRemove"
                 style="height: 180px;" :autoUpload="true"></myUpload>
             </el-form-item>
           </el-col>
@@ -127,7 +156,7 @@
         <el-row>
           <el-col :span="24">
             <el-form-item label="项目备注:">
-              <el-input type="textarea" :rows="3" placeholder="请输入内容" v-model="form.remark"></el-input>
+              <el-input type="textarea" :rows="3" placeholder="请输入内容" v-model="form.description"></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -138,18 +167,26 @@
       </span>
     </el-dialog>
 
+    <choosePerson ref="choosePerson" @getPersonIds="getPersonIds"></choosePerson>
   </div>
 </template>
 
 <script>
+import choosePerson from '@/views/components/dialog/person.vue'
 export default {
-  components: {},
+  components: {
+    choosePerson,
+  },
   props: {},
   data() {
     return {
       dialogVisible: false,
       title: '',
-      form: {},
+      form: {
+        matterIds: [],
+        systemFileList: [],
+        fileGuids: [],
+      },
       rules: {
         name: [{ required: true, message: '请输入项目名称', trigger: 'blur' },],
       },
@@ -172,6 +209,18 @@ export default {
         eventInput: '',
         data: []
       },
+      //事件列表
+      eventList: {
+        queryParams: {
+          current: 1,
+          size: 10
+        },
+        data: []
+      },
+      // 控制调查类型是否显示
+      show: false,
+      //调查类型列表
+      dictAssociates: [],
     };
   },
   watch: {},
@@ -182,16 +231,101 @@ export default {
     this.getPermissionPersonnel();
   },
   methods: {
-    // 打开参与人人员弹窗
+    //打开事件弹窗
+    addEvent() {
+
+    },
+    //懒加载事件
+    loadEvent() {
+      if (this.eventList.queryParams.current * this.eventList.queryParams.size >= this.eventList.queryParams.total) {
+        return false
+      }
+      this.eventList.queryParams.current += 1
+      this.getEventList()
+    },
+    //远程搜索
+    remoteEvent(query) {
+      this.eventList.data = []
+      this.eventList.queryParams.current = 1
+      this.eventList.name = query
+      this.getEventList()
+    },
+    //获取事件列表
+    async getEventList(type) {
+      this.eventList.loading = true;
+      let params = {
+        ...this.eventList.queryParams,//分页信息
+        searchQuery: this.eventList.name ? `name=${this.eventList.name}` : '',//检索条件
+        orderDTOList: [{ orderBy: "createTime", orderType: 1 },]//排序
+      }
+      await this.$api.queryEvent(params).then(response => {
+        if (response.code == 200) {
+          this.eventList.loading = false;
+          if (!type) {
+            if (this.form.eventId) {
+              var index = response.data.data.findIndex(item => {
+                return item.id == this.form.eventId
+              })
+              if (index != -1) {
+                response.data.data.splice(index, 1)
+              }
+            }
+            this.eventList.queryParams.total = response.data.total
+          }
+          this.eventList.data.push(...response.data.data)
+          // this.eventList.queryParams.total = response.data.total
+        }
+      })
+    },
+    //切换事件
+    async changeEvent(val) {
+      if (!val) {
+        this.form.scenarioIds = []
+        this.show = false
+        this.form.matterIds = []
+        return
+      }
+      var obj = this.eventList.data.find(item => {
+        return item.id == val
+      })
+      if (obj) {
+        this.form.scenarioIds = [obj.scenarioId]
+        this.show = true
+        await this.onChange()
+      }
+    },
+    //调查类型选择切换
+    async onChange() {
+      if (this.form.scenarioIds.length != 0) {
+        await this.$api.getMatter(this.form.scenarioIds).then(response => {
+          this.show = true
+          this.dictAssociates = response.data.data
+        })
+      } else {
+        this.show = false
+      }
+    },
+    // 打开参与人 人员弹窗
     showDialog() {
-      // this.$refs.choosePerson.open(this.form.adminIds,this.form.adminPersons)
+      this.$refs.choosePerson.open(this.form.adminIds, this.form.adminPersons)
+    },
+    //获取参与人员信息
+    getPersonIds({ personIds, persons }) {
+      if (personIds.length > 0) {
+        // adminPersons存储返回的人员id数组
+        this.$set(this.form, 'adminPersons', persons)
+        this.$set(this.form, 'adminIds', personIds)
+      } else {
+        this.$set(this.form, 'adminPersons', [])
+        this.$set(this.form, 'adminIds', [])
+      }
     },
     // 处理参与人数据
-    getNames(row){
-      if(!row){
+    getNames(row) {
+      if (!row) {
         return ''
       }
-      var arr = row.map(item=>{
+      var arr = row.map(item => {
         return item.name
       })
       return arr.join('、')
@@ -243,18 +377,29 @@ export default {
       this.getPermissionPersonnel()
     },
     //获取所有人员列表(修改不要一次性获取,可以使用懒加载加远程搜索 )
-    getPermissionPersonnel() {
+    async getPermissionPersonnel(type) {
       this.personnelList.loading = true;
-      this.$api.getPermissionPersonnel(this.personnelList.queryParams).then((response) => {
+      await this.$api.getPermissionPersonnel(this.personnelList.queryParams).then((response) => {
         if (response.code == 200) {
           this.personnelList.loading = false;
+          if (!type) {
+            if (this.form.headId) {
+              var index = response.data.findIndex(item => {
+                return item.id == this.form.headId
+              })
+              if (index != -1) {
+                response.data.splice(index, 1)
+              }
+            }
+            this.personnelList.queryParams.total = response.pageColumn.total
+          }
           this.personnelList.data.push(...response.data)
-          this.personnelList.queryParams.total = response.pageColumn.total
+          // this.personnelList.queryParams.total = response.pageColumn.total
         }
       })
     },
     // 上传的文件监听
-    onchange(file, fileList) {
+    onchangeFile(file, fileList) {
       if (file.guid) {
         let index = this.form.systemFileList.findIndex(item => {
           return item.uid == file.uid
@@ -270,36 +415,86 @@ export default {
     },
     // 删除上传的文件
     onRemove(file, fileList) {
-      let index = this.form.systemFileList.findIndex(item => {
-        return item.uid == file.uid
-      })
-      if (index != -1) {
-        if (file.guid) {
-          let index2 = this.form.fileGuids.findIndex(item => {
+      if (file.guid) {
+        let index = this.form.systemFileList.findIndex(item => {
+          return item.guid == file.guid
+        })
+        if (index!=-1) {
+          this.form.systemFileList.splice(index, 1)
+        }
+        let index2 = this.form.fileGuids.findIndex(item => {
             return item == file.guid
-          })
-          if (index2 != -1) {
-            this.form.fileGuids.splice(index, 1)
-          }
+        })
+        if (index2 != -1) {
+            this.form.fileGuids.splice(index2, 1)
+        }
+      } else {
+        let index3 = this.form.systemFileList.findIndex(item => {
+          return item.uid == file.uid
+        })
+        if (index3 != -1) { 
+          this.form.fileGuids.splice(index3, 1)
         }
-        this.form.systemFileList.splice(index, 1)
       }
     },
     //打开弹窗
-    open(form) {
+    async open(form) {
       if (form && form.id) {
         this.form = JSON.parse(JSON.stringify(form))
+        // 事件
+        if (this.form.eventIds && this.form.eventIds.length > 0) {
+          this.form.eventId = this.form.eventIds[0]
+          this.onChange()
+          this.eventList.queryParams.id = this.form.eventId[0]
+          await this.getEventList(1)
+          this.eventList.queryParams.id = null
+          this.show = true
+        } else {
+          this.show = false
+        }
+        // 文件
+        if (this.form.systemFileList && this.form.systemFileList.length > 0) {
+          this.$set(this.form, 'fileGuids', [])
+          this.form.systemFileList.forEach(item => {
+            this.form.fileGuids.push(item.guid)
+          })
+        }
+        // 负责人
+        if (this.form.headId) {
+          this.personnelList.queryParams.id = this.form.headId
+          await this.getPermissionPersonnel(1)
+          this.personnelList.queryParams.id = null
+        }
+        // 参与人
+        if (this.form.involvedPersons && this.form.involvedPersons.length) {
+          this.form.adminPersons = []
+          this.form.adminIds = []
+          this.form.involvedPersons.forEach(item => {
+            let a = {
+              id: item.personId,
+              name: item.personName
+            }
+            this.form.adminPersons.push(a)
+            this.form.adminIds.push(a.id)
+          })
+        }
         this.title = '编辑专利挖掘项目'
       } else {
         this.title = '新增专利挖掘项目'
       }
+      this.getPermissionPersonnel()
+      this.getEventList()
       this.dialogVisible = true
     },
     //关闭弹窗
     handleClose() {
       // this.$refs.upload.clearFiles()
       this.$refs.form.resetFields()
-      this.form = {}
+      this.form = {
+        matterIds: [],
+        systemFileList: [],
+        fileGuids: [],
+      }
       this.dialogVisible = false
     },
     //提交数据
@@ -308,9 +503,28 @@ export default {
         if (valid) {
           // 判断文件是否全部上传完毕
           if ((this.form.fileGuids && this.form.fileGuids.length) != (this.form.systemFileList && this.form.systemFileList.length)) {
-            this.$message.error('您有文件未上传完毕,请您稍等片刻')
+            this.$message.error('您有文件未上传完毕,请您稍等片刻~~~')
             return false
           }
+          if (this.form.scenarioIds && this.form.scenarioIds.length>0) {
+            var scenarioIds = JSON.parse(JSON.stringify(this.form.scenarioIds))
+          }
+          if (this.form.eventId) {
+            this.form.events = []
+            this.form.scenarioIds = []
+            this.form.matterIds.forEach(item => {
+              this.form.events.push(
+                {
+                  matterId: item,
+                  scenarioId: scenarioIds[0],
+                  eventId: this.form.eventId
+                }
+              )
+            })
+          }
+          if (this.form.adminIds && this.form.adminIds.length > 0) {
+            this.form.involvedPersonIds = this.form.adminIds
+          }
           if (!this.form.id) {//新增
             if (this.form.examine) {//审核任务
 
@@ -325,7 +539,7 @@ export default {
             }
 
           } else {//编辑
-            this.$api.edit(this.form).then(res => {
+            this.$api.updatePatentDigProject(this.form).then(res => {
               if (res.code == 200) {
                 this.$message.success('更新专利挖掘项目成功')
                 this.$emit('isSuccess', true)
@@ -352,7 +566,18 @@ export default {
       })
     },
   },
-
+  // 组件销毁函数
+  destroyed() {
+    // 清空事件相关
+    this.form.eventIds = []
+    this.eventList.queryParams.current=1
+    // 清空负责人相关
+    this.form.involvedPersons = []
+    this.form.adminIds = []
+    this.form.adminPersons = []
+    this.personnelList.data = []
+    this.personnelList.queryParams.current=1
+  },
 };
 </script>
 <style lang="scss" scoped></style>

+ 29 - 32
src/views/patentMining/components/view/commonTable.vue

@@ -15,34 +15,13 @@
           <div v-if="['name'].includes(item.value)">
             <el-link @click="handleItem(scope.row, item.value)">{{ scope.row[item.value] }}</el-link>
           </div>
-          <div v-else-if="['scenarioId', 'eventDate'].includes(item.value)" v-html="getColumnData(scope.row, item.value)">
+          <div v-else-if="['state', 'ifSearch'].includes(item.value)" v-html="getColumnData(scope.row, item.value)">
           </div>
           <div v-else>{{ scope.row[item.value] ? scope.row[item.value] : '--' }}</div>
         </template>
       </el-table-column>
 
-
-      <!--  <el-table-column label="#" align="center" width="100px">
-        <template slot-scope="scope">
-          <div>
-            {{ (queryParams.current - 1) * queryParams.size + scope.$index + 1 }}
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column prop="name" label="项目名称" align="center">
-        <template slot-scope="scope">
-          <div>
-            <el-link type="primary" @click="toDetails(scope.row)">{{ scope.row.name }}</el-link>
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column prop="type" label="产出" align="center"></el-table-column>
-      <el-table-column prop="type" label="技术方向" align="center"></el-table-column>
-      <el-table-column prop="type" label="技术关键词" align="center"></el-table-column>
-      <el-table-column prop="type" label="相关竞争对手" align="center"></el-table-column>
-      <el-table-column prop="status" label="状态" align="center"></el-table-column>
-      <el-table-column prop="createPerson" label="创建人" align="center"></el-table-column> -->
-      <el-table-column label="操作" align="center" width="200px">
+      <el-table-column label="操作" align="center" width="120px">
         <template slot-scope="scope">
           <div>
             <el-dropdown split-button type="primary" size="small" @command="handleCommand($event, scope.row)">
@@ -68,13 +47,29 @@ export default {
     column: {
       type: Array,
       default: () => {
-        return []
+        return [
+          {
+            createType: 1,
+            ifHidden: false,
+            ifSearch: true,
+            ifShow: true,
+            name: "挖掘项目名称",
+            order: 0,
+            type: "String",
+            value: "name"
+          }
+        ]
       }
     },
   },
   data() {
     return {
-
+      statusObj: {
+        0: '审核中',
+        1: '处理中',
+        2: '已完成',
+        3: '审核不通过',
+      },
     };
   },
   watch: {},
@@ -87,16 +82,18 @@ export default {
       this.$emit('sort', { column, prop, order })
     },
     // 数据处理
-    getColumnData(row,key) {
-      if (key == 'scenarioId') {
-        if (row.scenarioName) {
-          return row.scenarioName
+    getColumnData(row, key) {
+      if (key == 'state') {
+        if (row.state) {
+          return this.statusObj[row.state]
         } else {
           return '--'
         }
-      }else if (key == 'eventDate') {
-        if (row.eventDate) {
-          return row.eventDate.slice(0, 10)
+      } else if (key == 'ifSearch') {
+        if (row.ifSearch == true) {
+          return '是'
+        } else if (row.ifSearch == false) {
+          return '否'
         } else {
           return '--'
         }

+ 38 - 23
src/views/patentMining/components/viewIndex.vue

@@ -13,9 +13,10 @@
             <el-button :type="viewType === 'commonCard' ? 'primary' : ''" @click="onChange2('commonCard')"
               size="small">卡片</el-button>
           </el-button-group>
-          <el-dropdown trigger="click" split-button type="primary" size="small">
+          <el-dropdown trigger="click" split-button type="primary" size="small" @command="handleCommand($event)">
             <span @click="handleAdd">创建项目</span>
             <el-dropdown-menu slot="dropdown" class="text-align_center">
+              <el-dropdown-item command="0">显示栏位管理</el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
         </div>
@@ -33,17 +34,19 @@
       </el-footer>
     </el-container>
     <addAndEditProject ref="addAndEditProject" @isSuccess="isSuccess"></addAndEditProject>
-
+    <fields ref="field" type="patentDigProject" @getFieldList="getFieldList"></fields>
   </div>
 </template>
   
 <script>
 import commonTable from './view/commonTable.vue';
 import addAndEditProject from './dialog/addAndEditProject.vue';
+import fields from '@/views/components/dialog/fields.vue';
 export default {
   components: {
     commonTable,
-    addAndEditProject
+    addAndEditProject,
+    fields,
   },
   props: {
     isOperate: ''
@@ -53,15 +56,7 @@ export default {
       //当前组件名称
       viewType: 'commonTable',
       //专利挖掘项目数据集合
-      dataList: [
-        {
-          name: 'xxx有限公司',
-          type: '本公司专利数据库',
-          status: '进行中',
-          createPerson: '朱豪',
-          id: 1,
-        }
-      ],
+      dataList: [],
       //分页
       queryParams: {
         size: 10,
@@ -102,14 +97,20 @@ export default {
   created() { },
   async mounted() {
     // 获取table栏位
-    // this.columnList = await this.$commonJS.getCustomField('event')
+    this.columnList = await this.$commonJS.getCustomField('patentDigProject')
     //获取检索、分组字段
     await this.getColumn()
+    // 获取table数据
+    this.getList()
   },
   methods: {
+    //显示栏位管理
+    getFieldList(data){
+      this.columnList = data
+    },
     // 获取检索及分组栏位
     async getColumn() {
-      let params = ['event']
+      let params = ['patentDigProject']
       await this.$api.getParamsCommon(params).then(res => {
         if (res.code == 200) {
           let conditionDTOList = JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
@@ -166,7 +167,7 @@ export default {
     //排序
     handleSort({ column, prop, order }) {
       this.sort=[]//如需要多个字段排序,则不需要清空
-      if (order == 'null') {
+      if (order == null) {
         return;
       }
       var orderType = {
@@ -199,7 +200,7 @@ export default {
         searchQuery: this.$commonJS.objectToString(this.searchOption.searchQuery || {}),//检索条件
         orderDTOList: this.sort,//排序
       }
-      this.$api.query(params).then(res => {
+      this.$api.queryPatentDigProject(params).then(res => {
         if (res.code == 200) {
           this.dataList = res.data.data
           this.total = res.data.total
@@ -214,6 +215,17 @@ export default {
     handleAdd() {
       this.$refs.addAndEditProject.open()
     },
+    // 创建项目按钮下拉菜单内容
+    handleCommand(ev) {
+      switch (ev) {
+        case '0'://显示栏位管理
+          this.$refs.field.open(this.columnList)
+          break;
+      
+        default:
+          break;
+      }
+    },
     //切换视图
     onChange2(val) {
       this.viewType = val
@@ -227,7 +239,7 @@ export default {
           // this.$refs.addAndEditDB.open(row, true)
           break;
         case '1'://删除
-          this.projectDelete()
+          this.projectDelete(row)
           break;
         case 'e'://编辑
           this.$refs.addAndEditProject.open(row)
@@ -235,20 +247,23 @@ export default {
       }
     },
     // 删除项目
-    projectDelete(row,isLast) {
+    projectDelete(row) {
+      this.projectDeletes([row.id])
+    },
+    // 删除项目
+    projectDeletes(ids,isLast) {
       this.$confirm('此操作将删除该项目, 是否继续?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        // 调用接口
-        let params = [ row.id ]
-        this.$api.deleteEvent(params).then(res => {
+        this.$api.deletePatentDigProject(ids).then(res => {
           if (res.code == 200) {
-            this.getList()
             // if(isLast){
             //   this.isGrouping()
-            // }
+            // }else{
+            this.getList()
+          // }
             // this.handleMessage = '删除成功'
             // this.clearMessage()
             this.$message.success('删除成功!');

+ 1 - 1
src/views/product/components/framework/viewIndex.vue

@@ -159,7 +159,7 @@ export default {
     //获取排序字段// 子组件table排序
     handleSort({ column, prop, order, }) {
       this.sort = []//如需要多个字段排序,则不需要清空
-      if (order == 'null') {
+      if (order == null) {
         return;
       }
       var orderType = {

+ 1 - 1
src/views/project/components/drawer/form.vue

@@ -384,7 +384,7 @@ export default {
       this.eventList.data=[]
       this.eventList.queryParams.current = 1
       this.eventList.name = query
-      this.getPersonnelList()
+      this.getEventList()
     },
     //获取事件列表
     async getEventList(){

+ 1 - 1
src/views/project/components/view/table.vue

@@ -267,7 +267,7 @@ export default {
     // 排序方法
     handleSort({ column, prop, order }) {
       this.sort=[]//如需要多个字段排序,则不需要清空
-      if (order == 'null') {
+      if (order == null) {
         return;
       }
       var orderType = {

+ 1 - 1
src/views/project/index.vue

@@ -308,7 +308,7 @@ export default {
     //排序
     handleSort({ column, prop, order, str }) {
       this.sort=[]//如需要多个字段排序,则不需要清空
-      if (order == 'null') {
+      if (order == null) {
         return;
       }
       var orderType = {

+ 305 - 93
src/views/report/components/dialog/addAndEditReport.vue

@@ -13,8 +13,8 @@
             </el-form-item> -->
             <el-form-item v-if="form.reportType == 3" label="标的产品" prop="signPatentNo">
               <el-select style="width:100%" v-model="form.signProjectId" placeholder="请选择产品" filterable remote
-                :popper-append-to-body="false" :remote-method="remoteMethodProduct" v-SelectLazyLoading="lazyLoadingProduct"
-                :loading="productList.loading">
+                :popper-append-to-body="false" :remote-method="remoteMethodProduct"
+                v-SelectLazyLoading="lazyLoadingProduct" :loading="productList.loading">
                 <el-option v-for="item in productList.data" :key="item.id" :label="item.name"
                   :value="item.id"></el-option>
               </el-select>
@@ -22,8 +22,8 @@
                 placeholder="请输入标的产品" @change="getPatentNo"></el-input> -->
             </el-form-item>
             <el-form-item v-else label="标的专利" prop="signPatentNo">
-              <el-input v-model="form.signPatentNo" autocomplete="off"
-                placeholder="请输入标的专利" @change="getPatentNo"></el-input>
+              <el-input v-model="form.signPatentNo" autocomplete="off" placeholder="请输入标的专利"
+                @change="getPatentNo"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -41,8 +41,10 @@
           <div>
             <el-form-item label="核心结论">
               <el-checkbox-group v-model="form.cronIds">
-                <el-checkbox v-for="item in conclusion" :key="item.dictChildValue" :label="item.dictChildValue">{{
-                  item.dictChildLabel }}</el-checkbox>
+                <el-checkbox v-for="item in conclusion" :key="item.value" :label="item.value">{{
+                  item.label }}</el-checkbox>
+                <!-- <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="结论论述">
@@ -54,7 +56,7 @@
               <span>
                 <el-popover ref="popover" placement="bottom" @hide="hidePopover" @show="showPopover" trigger="click">
                   <div>
-                    <addMatter  :type="matterType" :sign="matterSign" @value="getMatter"></addMatter>
+                    <addMatter :type="matterType" :sign="matterSign" @value="getMatter"></addMatter>
                   </div>
                   <el-button slot="reference">添加后续事项</el-button>
                 </el-popover>
@@ -132,7 +134,36 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <template v-if="form.type == 7">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="事件:">
+              <mySelectButton size='large' style="width:100%" @click="addEvent">
+                <div style="width:100%">
+                  <el-select style="width:100%" v-model="form.eventId" @change="changeEvent" filterable remote clearable
+                    placeholder="请选择" :loading="eventList.loading" v-SelectLazyLoading="loadEvent"
+                    :remote-method="remoteEvent">
+                    <el-option v-for="item in eventList.data" :key="item.id" :label="item.name" :value="item.id">
+                    </el-option>
+                  </el-select>
+                </div>
+              </mySelectButton>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row v-if="show == true">
+          <el-col :span="24">
+            <el-form-item label="调查类型:" prop="matterIds">
+              <el-checkbox-group v-model="form.matterIds">
+                <template>
+                  <el-checkbox v-for="item in dictAssociates" :key="item.id" :label="parseInt(item.id)">
+                    {{ item.name }}
+                  </el-checkbox>
+                </template>
+              </el-checkbox-group>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <template v-if="form.reportType == 7">
           <div>
             <el-row>
               <el-col :span="12">
@@ -161,7 +192,7 @@
           </div>
         </template>
         <el-form-item :label="(!form.id && form.status == 3) ? '上传报告文档' : '上传附件'">
-          <myUpload :file-list="handleConcat(form.systemFileList)" @on-change="onChange" @on-remove="onRemove"
+          <myUpload :file-list="form.systemFileList" @on-change="onchangeFile" @on-remove="onRemove"
             @on-preview="onPreview" style="height: 180px;" :autoUpload="true"></myUpload>
         </el-form-item>
         <el-form-item label="备注" prop="description">
@@ -170,7 +201,7 @@
       </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="ifNext" v-if="form.reportType == 7 && !form.id">下一步</el-button>
         <el-button type="primary" @click="submit" v-else>确 定</el-button>
       </div>
     </el-dialog>
@@ -225,8 +256,7 @@ export default {
   data() {
     const isExist = (rule, value, callback) => {
       if (!this.form.signPatentNo) {//没有专利号进入报错提示
-        this.show = 0
-        if ([3].includes(Number(this.form.type))) {
+        if ([3].includes(Number(this.form.reportType))) {
           var text = '请输入标的产品'
         } else {
           var text = '请输入标的专利号'
@@ -258,7 +288,11 @@ export default {
       //控制弹窗是否打开
       showDialog: false,
       //表单数据
-      form: {},
+      form: {
+        matterIds: [],
+        systemFileList: [],
+        fileGuids: [],
+      },
       //表单规则
       rules: {
         name: [{ required: true, message: '请输入报告名称', trigger: 'blur' },],
@@ -280,7 +314,7 @@ export default {
       copyList: [],
       //人员列表
       // personnelList: [],
-      //客户列表
+      //客户/委托方列表
       clientList: [],
       //上传文件列表
       files: [],
@@ -312,25 +346,38 @@ export default {
         loading: false,
         //是否懒加载
         isLazy: true,
+        data:[],
       },
       //人员列表懒加载
       personnelList: {
-        queryParams:{
-          current:1,
-          size:10
+        queryParams: {
+          current: 1,
+          size: 10
         },
-        data:[]
+        data: []
       },
       //产品列表懒加载
       productList: {
-        queryParams:{
-          current:1,
-          size:10
+        queryParams: {
+          current: 1,
+          size: 10
         },
-        isLazy:true,
-        data:[]
+        isLazy: true,
+        data: []
       },
       matterType: null,
+      //事件列表
+      eventList: {
+        queryParams: {
+          current: 1,
+          size: 10
+        },
+        data: []
+      },
+      // 控制调查类型是否显示
+      show: false,
+      //调查类型列表
+      dictAssociates: [],
       /*审核弹窗所需变量start*/
       showTask: false,
       // 任务表单
@@ -375,10 +422,84 @@ export default {
     this.getDepartment()
   },
   methods: {
+    //打开事件弹窗
+    addEvent() {
+
+    },
+    //懒加载事件
+    loadEvent() {
+      if (this.eventList.queryParams.current * this.eventList.queryParams.size >= this.eventList.queryParams.total) {
+        return false
+      }
+      this.eventList.queryParams.current += 1
+      this.getEventList()
+    },
+    //远程搜索
+    remoteEvent(query) {
+      this.eventList.data = []
+      this.eventList.queryParams.current = 1
+      this.eventList.name = query
+      this.getEventList()
+    },
+    //获取事件列表
+    async getEventList(type) {
+      this.eventList.loading = true;
+      let params = {
+        ...this.eventList.queryParams,//分页信息
+        searchQuery: this.eventList.name ? `name=${this.eventList.name}` : '',//检索条件
+        orderDTOList: [{ orderBy: "createTime", orderType: 1 },]//排序
+      }
+      await this.$api.queryEvent(params).then(response => {
+        if (response.code == 200) {
+          this.eventList.loading = false;
+          if (!type) {
+            if (this.form.eventId) {
+              var index = response.data.data.findIndex(item => {
+                return item.id == this.form.eventId
+              })
+              if (index != -1) {
+                response.data.data.splice(index, 1)
+              }
+            }
+            this.eventList.queryParams.total = response.data.total
+          }
+          this.eventList.data.push(...response.data.data)
+          // this.eventList.queryParams.total = response.data.total
+        }
+      })
+    },
+    //切换事件
+    async changeEvent(val) {
+      if (!val) {
+        this.form.scenarioIds = []
+        this.show = false
+        this.form.matterIds = []
+        return
+      }
+      var obj = this.eventList.data.find(item => {
+        return item.id == val
+      })
+      if (obj) {
+        this.form.scenarioIds = [obj.scenarioId]
+        this.show = true
+        await this.onChange()
+      }
+    },
+    //调查类型选择切换
+    async onChange() {
+      if (this.form.scenarioIds.length != 0) {
+        await this.$api.getMatter(this.form.scenarioIds).then(response => {
+          this.show = true
+          this.dictAssociates = response.data.data
+        })
+      } else {
+        this.show = false
+      }
+    },
     //打开弹窗
-    open(form) {
-      this.form = JSON.parse(JSON.stringify(form))
+    async open(form) {
       var a = ''
+      this.form = JSON.parse(JSON.stringify(form))
       if (this.form.id) {
         if (this.$reportPermission(this.form.id, [0, 1])) {
           a = '编辑'
@@ -386,82 +507,127 @@ export default {
           a = '查看'
         }
       } else {
+        this.$set(this.form,'matterIds',[])
+        this.$set(this.form,'systemFileList',[])
+        this.$set(this.form,'fileGuids',[])
         a = '创建'
       }
-      console.log(this.form);
       var reportType = this.dictMessage.REPORT_TYPE.filter(item => { return item.dictChildValue == this.form.reportType })[0].dictChildLabel
       this.title = a + reportType + '报告'
+      // 事件
+      if (this.form.eventIds && this.form.eventIds.length > 0) {
+        this.form.eventId = this.form.eventIds[0]
+        this.onChange()
+        this.eventList.queryParams.id = this.form.eventId[0]
+        await this.getEventList(1)
+        this.eventList.queryParams.id = null
+        this.show = true
+      } else {
+        this.show = false
+      }
+      // 文件
+      if (this.form.systemFileList && this.form.systemFileList.length > 0) {
+        this.$set(this.form, 'fileGuids', [])
+        this.form.systemFileList.forEach(item => {
+          this.form.fileGuids.push(item.guid)
+        })
+      }
+      // 负责人
+      if (this.form.headId) {
+        this.personnelList.queryParams.id = this.form.headId
+        await this.getPermissionPersonnel(1)
+        this.personnelList.queryParams.id = null
+      }
+      // 委托方
+      if (this.form.entrustId) {
+        this.personnelList.queryParams.id = this.form.headId
+        await this.getPermissionPersonnel(1)
+        this.personnelList.queryParams.id = null
+      }
+      this.getPermissionPersonnel()
+      this.getEventList()
       this.showDialog = true
     },
     // 产品列表远程搜索
-    remoteMethodProduct(query) { 
+    remoteMethodProduct(query) {
       this.productList.isLazy = true
-        if (query !== '') {
-          this.productList.loading = true;
-          this.productList.queryParams = {
-            current:1,
-            size:10,
-            searchQuery:`name=${query}`
-          }
-          this.$api.queryProductCategory(this.productList.queryParams).then(response=>{
-            if(response.code == 200){
-              this.productList.loading = false;
-              this.productList.data = response.data.data
-            }
-          }).catch(error=>{
-            this.productList.loading = false;
-          })
-        } else {
-          this.productList.queryParams.name = null
-          this.productList = [];
-          this.getAllProduct()
+      if (query !== '') {
+        this.productList.loading = true;
+        this.productList.queryParams = {
+          current: 1,
+          size: 10,
+          searchQuery: `name=${query}`
         }
+        this.$api.queryProductCategory(this.productList.queryParams).then(response => {
+          if (response.code == 200) {
+            this.productList.loading = false;
+            this.productList.data = response.data.data
+          }
+        }).catch(error => {
+          this.productList.loading = false;
+        })
+      } else {
+        this.productList.queryParams.name = null
+        this.productList = [];
+        this.getAllProduct()
+      }
     },
     // 产品列表懒加载
-    lazyLoadingProduct() { 
-      if(!this.productList.isLazy){
+    lazyLoadingProduct() {
+      if (!this.productList.isLazy) {
         return false
       }
       this.productList.queryParams.current++;
       this.getAllProduct();
     },
     getAllProduct() {
-      if(!this.productList.isLazy){
+      if (!this.productList.isLazy) {
         return false
       }
-      this.$api.queryProductCategory(this.productList.queryParams).then(response=>{
-        if(response.code == 200){
-          if(response.data.data && response.data.data.length == 0){
+      this.$api.queryProductCategory(this.productList.queryParams).then(response => {
+        if (response.code == 200) {
+          if (response.data.data && response.data.data.length == 0) {
             this.productList.isLazy = false
           }
           this.productList.data = [...this.productList.data, ...response.data.data];
         }
-      }).catch(error=>{
+      }).catch(error => {
       })
     },
     // 人员列表远程搜索
     remoteMethodPerson(query) {
-      this.personnelList.data=[]
-          this.personnelList.queryParams.current = 1
-          this.personnelList.queryParams.name = query
-          this.getPermissionPersonnel()
+      this.personnelList.data = []
+      this.personnelList.queryParams.current = 1
+      this.personnelList.queryParams.name = query
+      this.getPermissionPersonnel()
     },
     // 获取所有人员列表懒加载
     lazyLoadingPerson() {
-      if(this.personnelList.queryParams.current * this.personnelList.queryParams.size>=this.personnelList.queryParams.total){
+      if (this.personnelList.queryParams.current * this.personnelList.queryParams.size >= this.personnelList.queryParams.total) {
         return false
       }
       this.personnelList.queryParams.current += 1
       this.getPermissionPersonnel()
     },
     //获取所有人员列表(修改不要一次性获取,可以使用懒加载加远程搜索 )
-    getPermissionPersonnel() {
+    async getPermissionPersonnel(type) {
       this.personnelList.loading = true;
-      this.$api.getPermissionPersonnel(this.personnelList.queryParams).then((response) => {
-        if(response.code == 200){
+      await this.$api.getPermissionPersonnel(this.personnelList.queryParams).then((response) => {
+        if (response.code == 200) {
           this.personnelList.loading = false;
+          if (!type) {
+            if (this.form.headId) {
+              var index = response.data.findIndex(item => {
+                return item.id == this.form.headId
+              })
+              if (index != -1) {
+                response.data.splice(index, 1)
+              }
+            }
+            this.personnelList.queryParams.total = response.pageColumn.total
+          }
           this.personnelList.data.push(...response.data)
-          this.personnelList.queryParams.total=response.pageColumn.total
+          // this.personnelList.queryParams.total = response.pageColumn.total
         }
       })
     },
@@ -470,7 +636,7 @@ export default {
       if (query != '') {
         this.clientObj.loading = true;
         this.clientObj.queryParams.current = 1
-        this.clientObj.queryParams.name=query
+        this.clientObj.queryParams.name = query
         this.$api.getAllClientList(this.clientObj.queryParams).then(response => {
           if (response.code == 200) {
             this.clientObj.loading = false;
@@ -504,21 +670,32 @@ export default {
       })
     },
     //获取所有部门列表
-   //获取部门列表
+    //获取部门列表
     getDepartment() {
       this.$api.getPermissionDepartmentList().then((response) => {
         this.departmentList = response.data;
       });
     },
     //切换是否完成状态
-    changeStatus(val) {
+    async changeStatus(val) {
       if (val == 3) {
         this.rules.headId[0].required = false
         this.rules.entrustId[0].required = false
         if (!this.form.id) {
           this.$set(this.form, 'cronIds', [])
         }
-        this.conclusion = this.dictMessage[this.reportAsDicItem[this.form.type]]
+        let params = {
+          reportType:this.form.reportType
+        }
+        await this.$api.queryCrons(params).then(res => {
+          if (res.code == 200) {
+            this.conclusion=res.data.data
+          }
+        }).catch(error => {
+          this.conclusion = []
+          this.$message.error(error.message)
+        })
+        // this.conclusion = this.dictMessage[this.reportAsDicItem[this.form.reportType]]
         this.matterType = 2
       } else {
         this.rules.headId[0].required = true
@@ -559,39 +736,43 @@ export default {
         }
       }
     },
-    // 合并已上传的文件和未上传的文件
-    handleConcat(arr) {
-      let files = (arr || []).concat(this.files)
-      return files
-    },
-    //切换上传的文件
-    onChange(file, fileList) {
-      if (this.files && this.files.length > 0) {
-        let a = this.files.findIndex(item => {
-          return item.size == file.size
+    // 上传的文件监听
+    onchangeFile(file, fileList) {
+      if (file.guid) {
+        let index = this.form.systemFileList.findIndex(item => {
+          return item.uid == file.uid
         })
-        if (a != -1) {
-          this.$message.error(`${file.raw.name}文件重复`)
-          this.files.splice(a, 1, file.raw)
-        } else {
-          this.files.push(file.raw)
+        if (index != -1) {
+          this.form.systemFileList.splice(index, 1, file)
+          this.form.fileGuids.push(file.guid)
         }
       } else {
-        this.files.push(file.raw)
+        this.form.systemFileList.push(file.raw)
       }
+
     },
-    //删除未提交的附
+    // 删除上传的文
     onRemove(file, fileList) {
       if (file.guid) {
-        let a = this.form.systemFileList.findIndex(item => {
+        let index = this.form.systemFileList.findIndex(item => {
           return item.guid == file.guid
         })
-        this.form.systemFileList.splice(a, 1)
+        if (index!=-1) {
+          this.form.systemFileList.splice(index, 1)
+        }
+        let index2 = this.form.fileGuids.findIndex(item => {
+            return item == file.guid
+        })
+        if (index2 != -1) {
+            this.form.fileGuids.splice(index2, 1)
+        }
       } else {
-        let a = this.files.findIndex(item => {
-          return item.size == file.size
+        let index3 = this.form.systemFileList.findIndex(item => {
+          return item.uid == file.uid
         })
-        this.files.splice(a, 1)
+        if (index3 != -1) { 
+          this.form.fileGuids.splice(index3, 1)
+        }
       }
     },
     //上传附件时点击查看附件内容
@@ -627,7 +808,23 @@ export default {
     submit() {
       this.$refs.reportForm.validate((valid) => {
         if (valid) {
-          this.form.type=2//项目类型(1专题库 2报告 3专利挖掘项目)
+          this.form.type = 2//项目类型(1专题库 2报告 3专利挖掘项目)
+          if (this.form.scenarioIds && this.form.scenarioIds.length>0) {
+            var scenarioIds = JSON.parse(JSON.stringify(this.form.scenarioIds))
+          }
+          if (this.form.eventId) {
+            this.form.events = []
+            this.form.scenarioIds = []
+            this.form.matterIds.forEach(item => {
+              this.form.events.push(
+                {
+                  matterId: item,
+                  scenarioId: scenarioIds[0],
+                  eventId: this.form.eventId
+                }
+              )
+            })
+          }
           let formData = this.form
           if (!this.form.id) {//新增报告
             this.$confirm('是否需要进行审核?', '提示', {
@@ -640,11 +837,11 @@ export default {
               this.$set(this.taskForm, 'taskName', this.form.name + '审核')
             }).catch(action => {//不审核直接创建报告
               // 调用创建报告公用,接口
-             this.addReport(formData)
+              this.addReport(formData)
             });
 
           } else {//编辑报告
-            this.$api.UpdateReport(formData).then(response => {
+            this.$api.updateReportProject(formData).then(response => {
               if (response.code == 200) {
                 this.files = []
                 this.$message.success('报告更新成功')
@@ -658,14 +855,18 @@ export default {
     },
     //关闭弹窗
     handleClose(val) {
-      if (this.form.type == 7 && val) {
+      if (this.form.reportType == 7 && val) {
         this.showEvidenceAndRequest = true
         this.$s.setSession('params', {})
         this.reportId = val
       }
       this.personnelList.queryParams.name = ''
       this.$refs.reportForm.resetFields()
-      this.form = {}
+      this.form = {
+        matterIds: [],
+        systemFileList: [],
+        fileGuids: [],
+      }
       this.showDialog = false
     },
     // 创建报告创建接口公用
@@ -747,6 +948,17 @@ export default {
         }
       })
     },
+    
+  },
+  // 组件销毁函数
+  destroyed() {
+    // 清空事件相关
+    this.form.eventIds = []
+    this.eventList.queryParams.current=1
+    this.eventList.data=[]
+     // 清空负责人相关
+    this.personnelList.data = []
+    this.personnelList.queryParams.current=1
   },
 };
 </script>

+ 57 - 53
src/views/report/components/index.vue

@@ -37,7 +37,7 @@
       <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" :queryParams="queryParams" @option="handleOption" @sort="handleSort" :groupBy='groupingValue'
-            :groupingOption="groupingOption" :commonData="commonData" :searchOption="searchOption" :column="columnList"
+          :groupingOption="groupingOption" :commonData="commonData" :searchOption="searchOption" :column="columnList"
           @getRow="checkDetails" @params="getParams"></component>
       </el-main>
       <el-footer class="pagination" v-if="viewType != 'visual'">
@@ -121,7 +121,7 @@ export default {
         },
       ],
       // ???
-      searchFiledDictMessage:[],
+      searchFiledDictMessage: [],
       //检索条件
       searchOption: {
         name: localStorage.searchContent
@@ -151,11 +151,9 @@ export default {
       //报告数据集合
       dataList: [],
       // 报告分组数据集合
-      commonData:[],
-      //获取报告类型、报告状态、核心结论
-      reportSearch: {},
+      commonData: [],
       // 栏位信息数组
-      columnList:[],
+      columnList: [],
     };
   },
   watch: {},
@@ -217,13 +215,11 @@ export default {
     await this.getColumn()
     //获取报告清单
     this.getList()
-    // 获取报告类型、获取报告状态、 获取核心结论
-    // this.getReportSearch()
   },
   methods: {
     // 显示栏位管理组件返回数据
     getFieldList(val) {
-      this.columnList=val
+      this.columnList = val
     },
     // 显示栏位管理
     showField() {
@@ -234,31 +230,30 @@ export default {
       let params = ['reportProject']
       await this.$api.getParamsCommon(params).then(res => {
         if (res.code == 200) {
+          let conditionDTOList = JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
           // 分组字段
-          let conditionDTOList= JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
-          // this.groupingOption = conditionDTOList.filter(item => {
-          //   return item.ifGroup == true
-          // })
-          this.groupingOption = this.$commonJS.getField(conditionDTOList,(u)=> u.ifGroup == true,{
+          this.groupingOption = this.$commonJS.getField(conditionDTOList, (u) => u.ifGroup == true, {
             name: 'name',
             value: 'value',
           })
           // 搜索字段
-          this.searchFiled = this.$commonJS.getField(conditionDTOList,(u)=> u.ifSearch == true ,{
+          this.searchFiled = this.$commonJS.getField(conditionDTOList, (u) => u.ifSearch == true, {
             label: 'name',
             value: 'value',
-            type:'type',
+            type: 'type',
           })
           //先获取报告类型,报告状态,相关事件,再为报告类型,报告状态,相关事件添加选项
-          // var obj = this.searchFiled.find(item=>{return  item.label == '应用场景'})
-          // if(obj){
-          //   obj.options = this.scene.map(item=>{
-          //     return {
-          //       label:item.name,
-          //       value:item.id
-          //     }
-          //   })
-          // }
+          let arr = ['报告类型', '报告状态', '相关事件', '委托方', '负责部门']
+          arr.forEach(item => {
+            let obj=this.searchFiled.find(item2 => { 
+              return item2.label == item
+            })
+            // console.log(obj);
+            // if (obj) {
+            //   this.handleSearchArray(obj)
+            // }
+          })
+          // console.log(this.dictMessage.REPORT_TYPE.filter(item => !['6'].includes(item.dictChildValue)));
         }
       })
       this.showView = false
@@ -266,25 +261,34 @@ export default {
         this.showView = true
       })
     },
-    // 获取报告类型、获取报告状态、 获取核心结论
-    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)
-      })
+    // 处理检索字段为array类型的问题
+    handleSearchArray(obj) {
+      switch (obj.label) {
+        case '报告类型':
+            let dict=this.dictMessage.REPORT_TYPE.filter(item => !['6'].includes(item.dictChildValue))
+            obj.options = dict.map(item=>{
+              return {
+                label:item.dictChildLabel,
+                value:item.dictChildValue,
+              }
+            })
+          break;
+        case '报告状态':
+          obj.options=[]
+          break;
+        case '相关事件':
+          obj.options=[]
+          break;
+        case '委托方':
+
+          break;
+        case '负责部门':
+
+          break;
+
+        default:
+          break;
+      }
     },
     //接收检索条件
     search(val) {
@@ -328,8 +332,8 @@ export default {
       return
       let params = {
         ...this.queryParams,//分页信息
-        orderDTOList:this.sort,//排序
-        groupBy:this.groupingValue,//分组信息
+        orderDTOList: this.sort,//排序
+        groupBy: this.groupingValue,//分组信息
       }
       this.$api.query(params).then(res => {
         if (res.code == 200) {
@@ -345,7 +349,7 @@ export default {
     //排序
     handleSort({ column, prop, order }) {
       this.sort = []//如需要多个字段排序,则不需要清空
-      if (order == 'null') {
+      if (order == null) {
         return;
       }
       var orderType = {
@@ -374,7 +378,7 @@ export default {
     },
     //切换页大小
     handleSizeChange(val) {
-      this.queryParams.size=val
+      this.queryParams.size = val
       this.isGrouping()
       // this.getList()
     },
@@ -402,13 +406,13 @@ export default {
     },
     //切换分组值
     changeGrouping(val) {
-      if (val!='') {
-        this.viewSelected='mergeTable'
+      if (val != '') {
+        this.viewSelected = 'mergeTable'
       } else {
-        this.viewSelected='Table'
+        this.viewSelected = 'Table'
       }
       this.queryParams.current = 1
-      this.groupingValue=val
+      this.groupingValue = val
       this.isGrouping()
     },
     // 区分是否为分组
@@ -502,7 +506,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        this.$api.dele(ids).then(res => {
+        this.$api.deleteReportProject(ids).then(res => {
           if (res.code == 200) {
             this.$message.success('删除报告成功')
             this.getList()

+ 31 - 8
src/views/report/components/view/table.vue

@@ -13,7 +13,7 @@
             <div v-if="['name'].includes(item.value)">
               <el-link @click="handleItem(scope.row,item.value)">{{ scope.row[item.value] }}</el-link>
             </div>
-            <div v-else-if="['eventNames'].includes(item.value)" v-html="getColumnData(scope.row,item.key)"></div>
+            <div v-else-if="['reportType','status','eventNames'].includes(item.value)" v-html="getColumnData(scope.row,item.value)"></div>
             <div v-else>{{ scope.row[item.value] }}</div>
           </template>
         </el-table-column>
@@ -69,7 +69,25 @@ export default {
   },
   data() {
     return {
-      
+      // 报告类型
+      reportTypeName: {
+        '0':'无效分析报告',
+        '1':'第三方意见报告',
+        '2':'稳定性分析报告',
+        '3':'FTO调查报告',
+        '4':'侵权分析报告',
+        '5':'回避设计报告',
+        '7':'无效应对报告',
+      },
+      // 报告状态
+      statusName: {
+        0:'开卷审核',
+        1:'创建中',
+        2:'处理中',
+        3:'完成',
+        4:'取消开卷',
+        5:'补资料中',
+      },
     };
   },
   watch: {
@@ -85,13 +103,18 @@ export default {
     },
     // 获取栏位数据
     getColumnData(row,key) {
-      if (key == 'eventNames') {
+      if (key == 'reportType') {
         if (row[key]) {
-          var a=''
-          row[key].forEach(item => {
-            a+=item.name + '</br>'
-          });
-          return a
+          return this.reportTypeName[row[key]]
+        } else {
+          return '--'
+        }
+      } else if (key =='status') {
+        
+      } else if (key == 'eventNames') {
+        // console.log(row[key].length);
+        if (row[key] && row[key].length>0) {
+          return row[key][0]
         } else {
           return '--'
         }