浏览代码

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

zhuliu 1 年之前
父节点
当前提交
34e05c16f6

+ 3 - 1
src/api/index.js

@@ -31,6 +31,7 @@ import framework from "./newApi/framework";
 import file from "./newApi/file"
 import project from "./newApi/project"
 import common from "./newApi/common"
+import newReport from "./newApi/report"
 
 export default {
   ...report,
@@ -61,5 +62,6 @@ export default {
   ...framework,
   ...file,
   ...project,
-  ...common
+  ...common,
+  ...newReport,
 }

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

@@ -0,0 +1,16 @@
+import axios from "@/utils/axios";
+// 新系统专题库新接口
+export default {
+    /**
+     * 新增报告
+     */
+    addReportProject(data) {
+        return axios.post("/xiaoshi/reportProject/addReportProject", data);
+    },
+    /**
+     * 查询报告 
+     */
+    queryReportProject(data) {
+        return axios.post("/xiaoshi/reportProject/queryReportProject", data);
+    },
+};

+ 20 - 23
src/views/event/components/dialog/addEvent.vue

@@ -29,7 +29,7 @@
             <el-select ref="select2" v-model="formData[0].scenarioId" style="width: 100%;" placeholder="请选择事件场景">
               <el-option
                 v-for="item in commonData"
-                :key="parseInt(item.value)" :label="item.label" :value="parseInt(item.value)">
+                :key="parseInt(item.id)" :label="item.name" :value="parseInt(item.id)">
               </el-option>
             </el-select>
           </el-form-item>
@@ -175,7 +175,7 @@ export default {
   watch: {},
   computed: {
     ...mapGetters(["userinfo"]),
-    commonData(){
+    commonData() {
       return this.$store.state.dictMessage.scenario || []
     }
   },
@@ -228,27 +228,23 @@ export default {
       this.getAdminClientList()
     },
     remoteMethod(query) {
-      // this.client.isLazy = true
-      // if (query !== '') {
-      //   this.client.loading = true;
-      //   this.client.queryParams = {
-      //     current: 1,
-      //     size: 10,
-      //     searchQuery: `name=${query}`
-      //   }
-      //   this.$api.getAdminClientList(this.client.queryParams).then(response => {
-      //     if (response.code == 200) {
-      //       this.client.loading = false;
-      //       this.clientList = response.data.records
-      //     }
-      //   }).catch(error => {
-      //     this.client.loading = false;
-      //   })
-      // } else {
-      //   this.client.queryParams.name = null
-      //   this.clientList = [];
-      //   this.getAdminClientList()
-      // }
+      if (query != '') {
+        this.client.loading = true;
+        this.client.queryParams.current = 1
+        this.client.queryParams.name=query
+        this.$api.getAdminClientList(this.client.queryParams).then(response => {
+          if (response.code == 200) {
+            this.client.loading = false;
+            this.clientList = response.data.records
+          }
+        }).catch(error => {
+          this.client.loading = false;
+        })
+      } else {
+        this.client.queryParams.name = null
+        this.clientList = [];
+        this.getAdminClientList()
+      }
     },
     //获取客户信息
     getAdminClientList() {
@@ -281,6 +277,7 @@ export default {
           }
         ]
       }
+      console.log(this.formData);
       this.dialogVisible = true
     },
     //关闭弹窗

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

@@ -238,8 +238,9 @@ export default {
           params[item.value]=item.searchValue.label
         }
       })
-      // 返回字符串
-      this.searchOption.searchQuery=this.$commonJS.objectToString(params)
+      // 返回条件对象
+      this.searchOption.searchQuery=params
+      // this.searchOption.searchQuery=this.$commonJS.objectToString(params)
       // 调用查询接口
       this.queryParams.current=1
       this.isGrouping()
@@ -255,7 +256,7 @@ export default {
     getList() {
       let params = {
         ...this.queryParams,//分页信息
-        ...this.searchOption,//检索条件
+        searchQuery:this.$commonJS.objectToString(this.searchOption.searchQuery || {}),//检索条件
         orderDTOList: this.sort,//排序
       }
       this.$api.queryEvent(params).then(res => {

+ 4 - 2
src/views/event/components/view/table.vue

@@ -164,7 +164,8 @@ export default {
           this.tableData.splice(startIndex,1)
         let params = {
           ...this.params,
-          ...this.row.searchOption,//检索条件
+          // ...this.row.searchOption,//检索条件
+          searchQuery:this.$commonJS.objectToString(this.row.searchOption.searchQuery || {}),//检索条件
           orderDTOList: this.sort,//排序
           groupField: this.row.groupBy,
           groupFieldValue: this.row.row.value,
@@ -218,7 +219,8 @@ export default {
       this.params.current += 1
       let params = {
         ...this.params,
-        ...this.row.searchOption,//检索条件
+        // ...this.row.searchOption,//检索条件
+        searchQuery:this.$commonJS.objectToString(this.row.searchOption.searchQuery || {}),//检索条件
         orderDTOList: this.sort,//排序
         groupField: this.row.groupBy,
         groupFieldValue: this.row.row.value,

+ 161 - 114
src/views/report/components/dialog/addAndEditReport.vue

@@ -7,9 +7,23 @@
         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-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-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">
+                <el-option v-for="item in productList.data" :key="item.id" :label="item.name"
+                  :value="item.id"></el-option>
+              </el-select>
+              <!-- <el-input v-model="form.signProjectId" autocomplete="off"
+                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-form-item>
           </el-col>
           <el-col :span="12">
@@ -26,13 +40,13 @@
         <template v-if="!form.id && form.status == 3">
           <div>
             <el-form-item label="核心结论">
-              <el-checkbox-group v-model="form.conclusionIds">
+              <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-group>
             </el-form-item>
             <el-form-item label="结论论述">
-              <el-input v-model="form.cronConclusion" type="textarea" placeholder="请输入结论论述"></el-input>
+              <el-input v-model="form.cronDescription" 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"
@@ -40,7 +54,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>
@@ -55,11 +69,11 @@
             </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
+            <el-form-item label="负责人" prop="headId">
+              <el-select style="width:100%" v-model="form.headId" placeholder="请选择负责人" filterable remote
                 :popper-append-to-body="false" :remote-method="remoteMethodPerson" v-SelectLazyLoading="lazyLoadingPerson"
-                :loading="personObj.loading">
-                <el-option v-for="item in personnelList" :key="item.id" :label="item.personnelName"
+                :loading="personnelList.loading">
+                <el-option v-for="item in personnelList.data" :key="item.id" :label="item.name"
                   :value="item.id"></el-option>
               </el-select>
             </el-form-item>
@@ -69,8 +83,8 @@
           <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
+                <el-form-item label="委托方" prop="entrustId" v-if="userinfo.tenantType == 1">
+                  <el-select style="width:100%" v-model="form.entrustId" placeholder="请选择委托方" filterable remote
                     :popper-append-to-body="false" :remote-method="remoteMethodClient"
                     v-SelectLazyLoading="lazyLoadingClient" :loading="clientObj.loading">
                     <el-option v-for="item in clientList" :key="item.id" :label="item.name" :value="item.id"></el-option>
@@ -89,16 +103,16 @@
           </el-col>
         </el-row>
 
-        <el-form-item label="应用场景">
+        <!-- <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-form-item> -->
         <el-row>
           <el-col :span="24">
             <el-form-item label="产品/技术">
-              <el-input v-model="form.proTec" autocomplete="off" placeholder="请输入产品/技术"></el-input>
+              <el-input v-model="form.productOrTech" autocomplete="off" placeholder="请输入产品/技术"></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -148,10 +162,10 @@
         </template>
         <el-form-item :label="(!form.id && form.status == 3) ? '上传报告文档' : '上传附件'">
           <myUpload :file-list="handleConcat(form.systemFileList)" @on-change="onChange" @on-remove="onRemove"
-            @on-preview="onPreview" style="height: 180px;"></myUpload>
+            @on-preview="onPreview" style="height: 180px;" :autoUpload="true"></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 label="备注" prop="description">
+          <el-input type='textarea' v-model="form.description" autocomplete="off" placeholder="请输入备注"></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" v-if="$reportPermission(form.id, [0, 1])">
@@ -179,8 +193,8 @@
             placeholder="选择日期">
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="审核备注:" prop="remark">
-          <el-input v-model="taskForm.remark" type="textarea" placeholder="输入备注" />
+        <el-form-item label="审核备注:" prop="description">
+          <el-input v-model="taskForm.description" type="textarea" placeholder="输入备注" />
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
@@ -201,9 +215,11 @@
 <script>
 import { mapGetters } from 'vuex'
 import evidenceAndRequest from './evidenceAndRequest.vue'
+import addMatter from './addMatter.vue'
 export default {
   components: {
     evidenceAndRequest,
+    addMatter,
   },
   props: {},
   data() {
@@ -216,6 +232,8 @@ export default {
           var text = '请输入标的专利号'
         }
         callback(new Error(text))
+      } else {
+        callback()
       }
     }
     const isTime = (rule, value, callback) => {
@@ -245,8 +263,8 @@ export default {
       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' },],
+        headId: [{ required: true, message: '请选择负责人', trigger: 'change' },],
+        entrustId: [{ required: true, message: '请选择委托方', trigger: 'change' },],
       },
       //加载
       loading: false,
@@ -295,15 +313,22 @@ export default {
         //是否懒加载
         isLazy: true,
       },
-      // 人员懒加载obj
-      personObj: {
-        queryParams: {
-          current: 1,
-          size: 10,
+      //人员列表懒加载
+      personnelList: {
+        queryParams:{
+          current:1,
+          size:10
         },
-        loading: false,
-        //是否懒加载
-        isLazy: true,
+        data:[]
+      },
+      //产品列表懒加载
+      productList: {
+        queryParams:{
+          current:1,
+          size:10
+        },
+        isLazy:true,
+        data:[]
       },
       matterType: null,
       /*审核弹窗所需变量start*/
@@ -333,20 +358,21 @@ export default {
     dictMessage() {
       return this.$store.state.dictMessage.dictMessage
     },
+    scenario() {
+      console.log(this.$store.state.dictMessage);
+      return this.$store.state.dictMessage.scenario || []
+    }
   },
   created() { },
   mounted() {
-    //获取字典项(接口还是通过字典获取)
-    this.$api.getCommonData({ keys: 'QUERY_GROUP,ENTERPRISE_APPLICATION_SCENARIO,INVESTIGATION_TYPE' }).then(response => {
-      this.commonData = response.data
-    })
-    // console.log(1)
+    // 获取所有产品
+    this.getAllProduct()
     //获取所有人员列表(修改不要一次性获取,可以使用懒加载加远程搜索 )
-    this.getAllPersonnelList()
+    this.getPermissionPersonnel()
     //获取所有客户列表(修改不要一次性获取,可以使用懒加载加远程搜索 )
     this.getAllClientList()
     //获取所有部门列表
-    this.getAllDepartmentList()
+    this.getDepartment()
   },
   methods: {
     //打开弹窗
@@ -362,71 +388,102 @@ export default {
       } else {
         a = '创建'
       }
-      var reportType = this.dictMessage.REPORT_TYPE.filter(item => { return item.dictChildValue == this.form.type })[0].dictChildLabel
+      console.log(this.form);
+      var reportType = this.dictMessage.REPORT_TYPE.filter(item => { return item.dictChildValue == this.form.reportType })[0].dictChildLabel
       this.title = a + reportType + '报告'
       this.showDialog = true
     },
+    // 产品列表远程搜索
+    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()
+        }
+    },
+    // 产品列表懒加载
+    lazyLoadingProduct() { 
+      if(!this.productList.isLazy){
+        return false
+      }
+      this.productList.queryParams.current++;
+      this.getAllProduct();
+    },
+    getAllProduct() {
+      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.productList.isLazy = false
+          }
+          this.productList.data = [...this.productList.data, ...response.data.data];
+        }
+      }).catch(error=>{
+      })
+    },
     // 人员列表远程搜索
     remoteMethodPerson(query) {
-      // this.personObj.isLazy = true
-      // if (query !== '') {
-      //   this.personObj.loading = true;
-      //   let params = {
-      //     ...this.personObj.queryParams,//分页信息
-      //     searchQuery: `name=${query}`,
-      //   }
-      //   this.$api.AllPersonnelList(params).then(response => {
-      //     if (response.code == 200) {
-      //       this.personObj.loading = false;
-      //       this.personnelList = response.data.data
-      //     }
-      //   }).catch(error => {
-      //     this.personObj.loading = false;
-      //   })
-      // } else {
-      //   this.personnelList = [];
-      //   this.getProductCategory()
-      // }
+      this.personnelList.data=[]
+          this.personnelList.queryParams.current = 1
+          this.personnelList.queryParams.name = query
+          this.getPermissionPersonnel()
     },
     // 获取所有人员列表懒加载
     lazyLoadingPerson() {
-      if (this.personObj.queryParams.current * this.personObj.queryParams.size >= this.personObj.queryParams.total) {
+      if(this.personnelList.queryParams.current * this.personnelList.queryParams.size>=this.personnelList.queryParams.total){
         return false
       }
-      this.personObj.queryParams.current += 1
-      this.getAllPersonnelList()
+      this.personnelList.queryParams.current += 1
+      this.getPermissionPersonnel()
     },
     //获取所有人员列表(修改不要一次性获取,可以使用懒加载加远程搜索 )
-    getAllPersonnelList() {
-      this.$api.getAdminClientList(this.personObj.queryParams).then(response => {
-        this.personnelList.push(...response.data.records)
-        this.personObj.queryParams.total = response.data.total
-      }).catch(error => {
-        this.personnelList = []
-        this.$message.error(error.message)
+    getPermissionPersonnel() {
+      this.personnelList.loading = true;
+      this.$api.getPermissionPersonnel(this.personnelList.queryParams).then((response) => {
+        if(response.code == 200){
+          this.personnelList.loading = false;
+          this.personnelList.data.push(...response.data)
+          this.personnelList.queryParams.total=response.pageColumn.total
+        }
       })
     },
     // 客户列表远程搜索
     remoteMethodClient(query) {
-      // this.clientObj.isLazy = true
-      // if (query !== '') {
-      //   this.clientObj.loading = true;
-      //   let params = {
-      //     ...this.clientObj.queryParams,//分页信息
-      //     searchQuery: `name=${query}`,
-      //   }
-      //   this.$api.AllClientList(params).then(response => {
-      //     if (response.code == 200) {
-      //       this.clientObj.loading = false;
-      //       this.clientList = response.data.data
-      //     }
-      //   }).catch(error => {
-      //     this.clientObj.loading = false;
-      //   })
-      // } else {
-      //   this.clientList = [];
-      //   this.getAllClientList()
-      // }
+      if (query != '') {
+        this.clientObj.loading = true;
+        this.clientObj.queryParams.current = 1
+        this.clientObj.queryParams.name=query
+        this.$api.getAllClientList(this.clientObj.queryParams).then(response => {
+          if (response.code == 200) {
+            this.clientObj.loading = false;
+            this.clientList = response.data.records
+          }
+        }).catch(error => {
+          this.clientObj.loading = false;
+        })
+      } else {
+        this.clientObj.queryParams.name = null
+        this.clientList = [];
+        this.getAllClientList()
+      }
     },
     // 获取所有客户列表懒加载
     lazyLoadingClient() {
@@ -447,38 +504,32 @@ export default {
       })
     },
     //获取所有部门列表
-    getAllDepartmentList() {
-      let params = {
-        
-      }
-      this.$api.AllDepartmentList(params).then(res => {
-        if (res.code == 200) {
-          this.departmentList = res.data
-        }
-      }).catch(error => {
-        this.$message.error(error.message)
-      })
+   //获取部门列表
+    getDepartment() {
+      this.$api.getPermissionDepartmentList().then((response) => {
+        this.departmentList = response.data;
+      });
     },
     //切换是否完成状态
     changeStatus(val) {
       if (val == 3) {
-        this.rules.personId[0].required = false
-        this.rules.clientId[0].required = false
+        this.rules.headId[0].required = false
+        this.rules.entrustId[0].required = false
         if (!this.form.id) {
-          this.$set(this.form, 'conclusionIds', [])
+          this.$set(this.form, 'cronIds', [])
         }
         this.conclusion = this.dictMessage[this.reportAsDicItem[this.form.type]]
         this.matterType = 2
       } else {
-        this.rules.personId[0].required = true
-        this.rules.clientId[0].required = true
+        this.rules.headId[0].required = true
+        this.rules.entrustId[0].required = true
         this.matterType = null
       }
     },
     //获取专利号且填入报告名称
     getPatentNo() {
       if (!this.form.name) {
-        var a = this.dictMessage.REPORT_TYPE.filter(item => { return item.dictChildValue == this.form.type })[0].dictChildLabel
+        var a = this.dictMessage.REPORT_TYPE.filter(item => { return item.dictChildValue == this.form.reportType })[0].dictChildLabel
         this.$set(this.form, 'name', this.form.signPatentNo + a)
       }
     },
@@ -532,10 +583,10 @@ export default {
     //删除未提交的附件
     onRemove(file, fileList) {
       if (file.guid) {
-        let a = this.formData[0].systemFileList.findIndex(item => {
+        let a = this.form.systemFileList.findIndex(item => {
           return item.guid == file.guid
         })
-        this.formData[0].systemFileList.splice(a, 1)
+        this.form.systemFileList.splice(a, 1)
       } else {
         let a = this.files.findIndex(item => {
           return item.size == file.size
@@ -574,15 +625,10 @@ export default {
     },
     //提交填写的信息
     submit() {
-      this.$refs.reportForm.validate(valid => {
+      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)
+          this.form.type=2//项目类型(1专题库 2报告 3专利挖掘项目)
+          let formData = this.form
           if (!this.form.id) {//新增报告
             this.$confirm('是否需要进行审核?', '提示', {
               confirmButtonText: '是',
@@ -594,7 +640,7 @@ export default {
               this.$set(this.taskForm, 'taskName', this.form.name + '审核')
             }).catch(action => {//不审核直接创建报告
               // 调用创建报告公用,接口
-              this.addReport(formData)
+             this.addReport(formData)
             });
 
           } else {//编辑报告
@@ -617,13 +663,14 @@ export default {
         this.$s.setSession('params', {})
         this.reportId = val
       }
+      this.personnelList.queryParams.name = ''
       this.$refs.reportForm.resetFields()
       this.form = {}
       this.showDialog = false
     },
     // 创建报告创建接口公用
     addReport(formData) {
-      this.$api.AddReport(formData).then(response => {
+      this.$api.addReportProject(formData).then(response => {
         if (response.code == 200) {
           this.files = []
           this.$message.success('报告创建成功')
@@ -649,7 +696,7 @@ export default {
             personIds: [this.taskForm.personnelId],
             taskName: this.taskForm.taskName,
             endTime: this.taskForm.endTime,
-            remark: this.taskForm.remark,
+            description: this.taskForm.description,
             type: 0,
           }
           formData.append('taskVO', JSON.stringify(a))

+ 357 - 0
src/views/report/components/dialog/addMatter.vue

@@ -0,0 +1,357 @@
+<template>
+  <div>
+    <div v-if="type == 1">
+      <el-form
+        :model="formData[0]"
+        :rules="rules"
+        ref="ruleForm"
+        label-width="100px"
+        class="demo-ruleForm"
+      >
+        <el-form-item label="名称" prop="name">
+          <el-input
+            v-model="formData[0].name"
+            autocomplete="off"
+            placeholder="请输入后续跟进事项名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="描述" prop="remark">
+          <el-input
+            type="textarea"
+            :rows="1"
+            v-model="formData[0].remark"
+            autocomplete="off"
+            placeholder="请输入后续跟进事项描述"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="处理人" prop="handler">
+          <el-input
+            v-model="formData[0].handler"
+            placeholder="请输入后续跟进事项处理人"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="协办人" prop="synery">
+          <el-input
+            v-model="formData[0].synery"
+            placeholder="请输入后续跟进事项协办人"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="期限" prop="deadline">
+          <el-date-picker
+            style="width: 100%"
+            v-model="formData[0].deadline"
+            type="datetime"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            placeholder="选择日期时间"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item>
+            <div style="display:flex;justify-content:center" v-if="formData[0].status != '已完成'&& $reportPermission(reportId,[0,1])">
+                <el-button type="primary" @click="submitForm()" size="small" style="width:100px" :loading="btnLoading">保存</el-button>
+                <el-button  @click="resetForm()" size="small" style="width:100px">取消</el-button>
+            </div>
+          
+        </el-form-item>
+      </el-form>
+    </div>
+    <div v-else :class="reportId?'item1':'item2'" >
+      <el-table :data="formData" style="width: 100%" class="twj-table">
+        <el-table-column prop="name" label="名称" align="center" min-width="150px">
+            <template slot="header">
+                <div>
+                    <span>名称<span style="color:red;"> *</span></span>
+                </div>
+            </template>
+          <template slot-scope="scope">
+            <div>
+                <!-- <el-form :model="scope.row" :rules="rules" ref="ruleForm" class="demo-ruleForm">
+                    <el-form-item prop="name" style="margin:0"> -->
+                        <el-input
+                            v-model="scope.row.name"
+                            autocomplete="off"
+                            placeholder="请输入名称"
+                        ></el-input>
+                    <!-- </el-form-item>
+                </el-form> -->
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="remark" label="描述" align="center" width="250px">
+          <template slot-scope="scope">
+            <div>
+              <el-input
+                type="textarea"
+                :rows="1"
+                v-model="scope.row.remark"
+                autocomplete="off"
+                placeholder="请输入描述"
+              ></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="handler" label="处理人" align="center" min-width="150px">
+          <template slot-scope="scope">
+            <div>
+              <el-input
+                v-model="scope.row.handler"
+                placeholder="请输入处理人"
+              ></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="synery" label="协办人" align="center" min-width="150px">
+          <template slot-scope="scope">
+            <div>
+              <el-input
+                v-model="scope.row.synery"
+                placeholder="请输入协办人"
+              ></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="deadline" label="期限" align="center" min-width="150px">
+          <template slot-scope="scope">
+            <div>
+              <el-date-picker
+                style="width: 100%"
+                v-model="scope.row.deadline"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="选择日期时间"
+              >
+              </el-date-picker>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="" width="100px">
+          <template slot-scope="scope">
+            <div>
+              <i @click="addRow(scope)" class="el-icon-plus btn"></i>
+              <i @click="deleteRow(scope)" v-if="scope.$index!=0" class="el-icon-close btn"></i>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div style="display:flex;justify-content: center;margin-top:20px" v-if="reportId && (sign != false && sign != true)">
+        <el-button type="primary" @click="submitForm1()" size="small" style="width:100px" :loading="btnLoading">保存</el-button>
+        <el-button size="small" @click="resetForm()" style="width:100px">取消</el-button>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  props: ["type", "reportId",'sign','row'],
+  data() {
+    return {
+      btnLoading:false,
+      formData: [
+        {
+          reportId:this.reportId,
+            name:'',
+            remark:'',
+            handler:'',
+            synery:'',
+            deadline:''
+        }
+      ],
+      rules: {
+        name: [
+          {
+            required: true,
+            message:'请输入后续跟进事项名称',
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  watch:{
+    type(){
+        this.getType()
+    },
+    sign(val){
+      if(val){
+        this.$emit('value',this.formData)
+      }
+    },
+  },
+  mounted() {
+    this.getType()
+  },
+  methods: {
+    //获取type类型
+    getType(){
+      if(this.row){
+        this.formData = [this.row]
+        return false
+      }
+        if(this.type == 2){
+            for(var i = 0;i<2;i++){
+                this.formData.push(
+                  {
+                    reportId:this.reportId,
+                    name:'',
+                    remark:'',
+                    handler:'',
+                    synery:'',
+                    deadline:''
+                  }
+                )
+            }
+        }else{
+          this.formData= [ 
+            {
+              reportId:this.reportId,
+              name:'',
+              remark:'',
+              handler:'',
+              synery:'',
+              deadline:''
+            }
+          ]
+        }
+    },
+    //添加后续跟进事项
+    submitForm() {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          this.btnLoading = true
+          if(this.row){
+            this.$api.updateMatters(this.formData).then(response=>{
+              if(response.code == 200){
+                this.btnLoading = false
+                this.$message.success('后续跟进事项更新成功')
+                this.resetForm()
+              }
+            }).catch(error=>{
+              this.btnLoading = false
+                this.$message.error('后续跟进事项更新失败')
+            })
+          }else{
+            this.$api.addMatters(this.formData).then(response=>{
+              if(response.code == 200){
+                this.btnLoading = false
+                this.$message.success('后续跟进事项添加成功')
+                this.resetForm()
+              }
+            }).catch(error=>{
+              this.btnLoading = false
+                this.$message.error('后续跟进事项添加失败')
+            })
+          }
+            
+        } else {
+          return false;
+        }
+      });
+    },
+    submitForm1(){
+      try{
+          var list = []
+          var b = false
+          var keyList={
+            name:'',
+            remark:'',
+            handler:'',
+            synery:'',
+            deadline:''
+          }
+          this.formData.forEach(item=>{
+              var a = false
+              for(let key in keyList){
+                  if(item[key] !='' && item[key] != null){
+                      a = true
+                  }
+              }
+              if(a == true){
+                if(item.name!='') {
+                      b=true
+                      list.push(item)
+                }else{
+                      b=false
+                      throw new Error()
+                }
+              }
+          })
+          this.$api.addMatters(list).then(response=>{
+            if(response.code == 200){
+              this.btnLoading = false
+              this.$message.success('后续跟进事项添加成功')
+                this.resetForm()
+            }
+          }).catch(error=>{
+              this.btnLoading = false
+              this.$message.error('后续跟进事项添加失败')
+          })
+      }catch(e){
+        this.$message.error('后续跟进事项名称不能为空')
+      }
+        
+    },
+    //取消
+    resetForm() {
+        if(this.type ==1 ){
+             this.$refs.ruleForm.resetFields();
+        }
+        this.formData=[
+            {
+                name:'',
+                remark:'',
+                handler:'',
+                synery:'',
+                deadline:''
+            }
+        ]
+        this.$emit('dialog',false)
+     
+    },
+    //添加跟进事项
+    addRow() {
+        this.formData.push(
+            {
+              reportId:this.reportId,
+              name:'',
+              remark:'',
+              handler:'',
+              synery:'',
+              deadline:''
+            }
+        )
+    },
+    //删除跟进事项
+    deleteRow(row) {
+        this.formData.splice(row.$index,1)
+    },
+  },
+};
+</script>
+<style>
+.twj-table td.el-table__cell, .twj-table th.el-table__cell.is-leaf{
+    border:none
+}
+.twj-table::before {
+    background-color: transparent;
+}
+</style>
+<style lang="scss" scoped>
+.item1{
+  max-height: 500px;
+  overflow: auto;
+}
+.item2{
+  max-height: 350px;
+  overflow: auto;
+}
+.btn {
+  color: black;
+  margin-left: 10px;
+  font-size: 18px;
+  text-align: center;
+  cursor: pointer;
+}
+.btn:hover {
+  color: aqua;
+}
+</style>

+ 61 - 9
src/views/report/components/index.vue

@@ -36,7 +36,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"
+            :groupingOption="groupingOption" :commonData="commonData" :searchOption="searchOption" :column="columnList"
           @getRow="checkDetails" @params="getParams"></component>
       </el-main>
       <el-footer class="pagination" v-if="viewType != 'visual'">
@@ -116,6 +116,8 @@ export default {
           options: []
         },
       ],
+      // ???
+      searchFiledDictMessage:[],
       //检索条件
       searchOption: {
         name: localStorage.searchContent
@@ -148,6 +150,8 @@ export default {
       commonData:[],
       //获取报告类型、报告状态、核心结论
       reportSearch: {},
+      // 栏位信息数组
+      columnList:[],
     };
   },
   watch: {},
@@ -170,12 +174,14 @@ export default {
         })
       }
       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,
@@ -200,13 +206,58 @@ export default {
     }
   },
   created() { },
-  mounted() {
+  async mounted() {
+    // 获取table栏位
+    this.columnList = await this.$commonJS.getCustomField('reportProject')
+    // 获取搜索/分组
+    await this.getColumn()
     //获取报告清单
     this.getList()
     // 获取报告类型、获取报告状态、 获取核心结论
     // this.getReportSearch()
   },
   methods: {
+    //获取table栏位及分组字段、检索字段
+    async getColumn() {
+      let params = ['reportProject']
+      await this.$api.getParamsCommon(params).then(res => {
+        if (res.code == 200) {
+          // 显示栏位
+          // this.columnList = res.data[0].conditionDTOList.filter(item => {
+          //   return item.name != 'Id' && item.ifShow == true
+          // })
+          // 分组字段
+          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,{
+            name: 'name',
+            value: 'value',
+          })
+          // 搜索字段
+          this.searchFiled = this.$commonJS.getField(conditionDTOList,(u)=> u.ifSearch == true ,{
+            label: 'name',
+            value: 'value',
+            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
+          //     }
+          //   })
+          // }
+        }
+      })
+      this.showView = false
+      this.$nextTick(() => {
+        this.showView = true
+      })
+    },
     // 获取报告类型、获取报告状态、 获取核心结论
     getReportSearch() {
       this.$api.search(params).then(res => {
@@ -247,14 +298,12 @@ export default {
     },
     //获取报告列表
     getList() {
-      this.dataList = [{}]
-      return
       let params = {
         ...this.queryParams,//分页信息
         ...this.searchOption,//检索条件
         orderDTOList: this.sort,//排序信息
       }
-      this.$api.query(params).then(res => {
+      this.$api.queryReportProject(params).then(res => {
         if (res.code == 200) {
           this.dataList = res.data
           this.total = res.total
@@ -307,16 +356,19 @@ export default {
         this.sort.push(params)
       }
       this.queryParams.current = 1
-      this.getList()
+      this.isGrouping()
+      // this.getList()
     },
     //分页
     handleCurrentChange(val) {
       this.queryParams.current = val;
-      this.getList();
+      this.isGrouping()
     },
     //切换页大小
     handleSizeChange(val) {
-      this.getList()
+      this.queryParams.size=val
+      this.isGrouping()
+      // this.getList()
     },
     //切换视图
     onChange(type) {
@@ -362,7 +414,7 @@ export default {
     //打开创建报告弹窗
     handleAnalyse(id) {
       var form = {
-        type: id,
+        reportType: id,
         scenarioList: []
       }
       this.$refs.ReportForm.open(form)

+ 5 - 59
src/views/report/components/view/table.vue

@@ -10,10 +10,11 @@
 
         <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)">
+            <div v-if="['name'].includes(item.key)">
               <el-link @click="handleItem(scope.row,item.key)">{{ scope.row[item.key] }}</el-link>
             </div>
-            <div v-else v-html="getColumnData(scope.row,item.key)"></div>
+            <!-- <div v-else v-html="getColumnData(scope.row,item.key)"></div> -->
+            <div v-else>{{ scope.row[item.key] }}</div>
           </template>
         </el-table-column>
 
@@ -61,62 +62,7 @@ export default {
       type: Array,
       default: () => {
         return [
-          {
-            "key": "name",
-            "name": "名称",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
-          {
-            "key": "eventNumber",
-            "name": "标的专利/产品",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
-          {
-            "key": "projectNumber",
-            "name": "相关专题库",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
-          {
-            "key": "projectNumber1",
-            "name": "事件",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
-          {
-            "key": "projectNumber2",
-            "name": "负责人",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
-          {
-            "key": "projectNumber3",
-            "name": "状态",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
-          {
-            "key": "projectNumber4",
-            "name": "创建人",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
-          {
-            "key": "time",
-            "name": "创建时间",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
+          
         ]
       }
     }
@@ -130,7 +76,7 @@ export default {
     
   },
   mounted() {
-   
+   console.log(this.column);
   },
   methods: {
     // 排序