Browse Source

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

zhuliu 1 year ago
parent
commit
22d38c0a91

+ 6 - 2
src/views/patentMining/components/details/basicMessage.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
     <basicMessage :id="id"></basicMessage>
-    <projectPath :id="id" v-on="$listeners" @on-drawer="handleDrawer"></projectPath>
-    <drawerPage ref="drawerPage" :id="id"> </drawerPage>
+    <projectPath :id="id" v-on="$listeners" @on-drawer="handleDrawer" :isClose="isClose"></projectPath>
+    <drawerPage ref="drawerPage" :id="id" @drawerClose="drawerClose" > </drawerPage>
   </div>
 </template>
 
@@ -21,6 +21,7 @@ export default {
   },
   data() {
     return {
+      isClose:false,
     };
   },
   watch: {},
@@ -28,6 +29,9 @@ export default {
   created() {},
   mounted() {},
   methods: {
+    drawerClose(val) {
+      this.isClose = !this.isClose
+    },
     handleDrawer(obj) {
       this.$refs.drawerPage.open(obj)
     },

+ 2 - 1
src/views/patentMining/components/details/components/drawer.vue

@@ -53,7 +53,8 @@ export default {
     // 关闭
     handleClose() {
       this.processId = null
-      this.activeName='ExcavateTaskIndex'
+      this.activeName = 'ExcavateTaskIndex'
+      this.$emit('drawerClose','关闭')
       this.drawer = false
     },
   },

+ 25 - 18
src/views/patentMining/components/details/components/projectPath.vue

@@ -3,7 +3,7 @@
   <div class="projectPath" style="width: 100%;height:100%;">
     <span>项目流程</span>
     <el-divider></el-divider>
-    <svg viewBox="0 0 1800 400" width="100%" height="100%">
+    <svg v-if="isShow" viewBox="0 0 1800 400" width="100%" height="100%">
 
 
       <g transform=translate(0,0) class="svgG">
@@ -13,14 +13,15 @@
         </g>
         <g @click="toFilePage('创新点梳理', 1,'任务')">
           <text x="120" y="45">任务:</text>
-          <circle cx="180" cy="40" r="16" stroke-width="1" stroke="#fff" :fill="getColor('创新点梳理',1)" />
-          <text :x="getNumber('创新点梳理',1) > 9 ? '170' : '175'" y="45" fill="#fff">{{ getNumber('创新点梳理',1, 'taskCount') }}</text>
+          <circle cx="180" cy="40" r="16" stroke-width="1" stroke="#fff" :fill="getColor('创新点梳理',1)"/>
+          <text :x="getNumber('创新点梳理',1) > 9 ? '175' : '170'" y="45" fill="#fff">{{ getNumber('创新点梳理',1, 'taskCount') }}</text>
+          
           <line x1="200" y1="60" x2="350" y2="60" stroke='#333'></line>
         </g>
         <g @click="toFilePage('创新点梳理', 1,'文件')">
           <text x="120" y="85">文件:</text>
           <circle cx="180" cy="80" r="16" stroke-width="1" stroke="#fff" :fill="getColor('创新点梳理',1)" />
-          <text :x="getNumber('创新点梳理',1) > 9 ? '170' : '175'" y="85" fill="#fff">{{ getNumber('创新点梳理',1 , 'fileCount') }}</text>
+          <text :x="getNumber('创新点梳理',1) > 9 ? '175' : '175'" y="85" fill="#fff">{{ getNumber('创新点梳理',1 , 'fileCount') }}</text>
           <line x1="200" y1="60" x2="350" y2="60" stroke='#333'></line>
         </g>
         <polygon points="350,55,360,60,350,65"></polygon>
@@ -32,13 +33,13 @@
           <rect width="200" height="120" :fill="getColor('查新检索',2)"> </rect>
           <text x="30" y="65">查新检索</text>
         </g>
-        <g>
+        <g @click="toFilePage('查新检索', 2,'任务')">
           <text x="120" y="45">任务:</text>
           <circle cx="180" cy="40" r="15" stroke-width="1" stroke="#fff" :fill="getColor('查新检索',2)" />
           <text :x="getNumber('查新检索',2) > 9 ? '170' : '175'" y="45" fill="#fff">{{ getNumber('查新检索',2,'taskCount') }}</text>
           <line x1="200" y1="60" x2="350" y2="60" stroke='#333'></line>
         </g>
-        <g>
+        <g @click="toFilePage('查新检索', 2,'文件')">
           <text x="120" y="85">文件:</text>
           <circle cx="180" cy="80" r="15" stroke-width="1" stroke="#fff" :fill="getColor('查新检索',2)" />
           <text :x="getNumber('查新检索',2) > 9 ? '170' : '175'" y="85" fill="#fff">{{ getNumber('查新检索',2,'fileCount') }}</text>
@@ -53,19 +54,18 @@
           <rect width="200" height="120" :fill="getColor('保护主题规划',3)"> </rect>
           <text x="30" y="65">保护主题规划</text>
         </g>
-        <g>
+        <g @click="toFilePage('保护主题规划', 3,'任务')">
           <text x="120" y="45">任务:</text>
           <circle cx="180" cy="40" r="15" stroke-width="1" stroke="#fff" :fill="getColor('保护主题规划',3)" />
           <text :x="getNumber('保护主题规划',3) > 9 ? '170' : '175'" y="45" fill="#fff">{{ getNumber('保护主题规划',3,'taskCount') }}</text>
           <line x1="200" y1="60" x2="350" y2="60" stroke='#333'></line>
         </g>
-        <g>
+        <g @click="toFilePage('保护主题规划', 3,'文件')">
           <text x="120" y="85">文件:</text>
           <circle cx="180" cy="80" r="15" stroke-width="1" stroke="#fff" :fill="getColor('保护主题规划',3)" />
           <text :x="getNumber('保护主题规划',3) > 9 ? '170' : '175'" y="85" fill="#fff">{{ getNumber('保护主题规划',3,'fileCount') }}</text>
           <line x1="200" y1="60" x2="350" y2="60" stroke='#333'></line>
         </g>
-
         <polygon points="350,55,360,60,350,65"></polygon>
       </g>
 
@@ -75,13 +75,13 @@
           <rect width="200" height="120" :fill="getColor('独权撰写',4)"> </rect>
           <text x="30" y="65">独权撰写</text>
         </g>
-        <g>
+        <g @click="toFilePage('独权撰写', 4,'任务')">
           <text x="120" y="45">任务:</text>
           <circle cx="180" cy="40" r="15" stroke-width="1" stroke="#fff" :fill="getColor('独权撰写',4)" />
           <text :x="getNumber('独权撰写',4) > 9 ? '170' : '175'" y="45" fill="#fff">{{ getNumber('独权撰写',4,'taskCount') }}</text>
           <line x1="200" y1="60" x2="350" y2="60" stroke='#333'></line>
         </g>
-        <g>
+        <g @click="toFilePage('独权撰写', 4,'文件')">
           <text x="120" y="85">文件:</text>
           <circle cx="180" cy="80" r="15" stroke-width="1" stroke="#fff" :fill="getColor('独权撰写',4)" />
           <text :x="getNumber('独权撰写',4) > 9 ? '170' : '175'" y="85" fill="#fff">{{ getNumber('独权撰写',4,'fileCount') }}</text>
@@ -98,13 +98,13 @@
           <rect width="200" height="120" :fill="getColor('从权撰写',5)"> </rect>
           <text x="30" y="65">从权撰写</text>
         </g>
-        <g>
+        <g @click="toFilePage('从权撰写', 5,'任务')">
           <text x="120" y="45">任务:</text>
           <circle cx="180" cy="40" r="15" stroke-width="1" stroke="#fff" :fill="getColor('从权撰写',5)" />
           <text :x="getNumber('从权撰写',5) > 9 ? '170' : '175'"  y="45" fill="#fff">{{ getNumber('从权撰写',5,'taskCount') }}</text>
           <line x1="100" y1="120" x2="100" y2="190" stroke='#333'></line>
         </g>
-        <g>
+        <g @click="toFilePage('从权撰写', 5,'文件')">
           <text x="120" y="85">文件:</text>
           <circle cx="180" cy="80" r="15" stroke-width="1" stroke="#fff" :fill="getColor('从权撰写',5)" />
           <text :x="getNumber('从权撰写',5) > 9 ? '170' : '175'"  y="85" fill="#fff">{{ getNumber('从权撰写',5,'fileCount') }}</text>
@@ -125,13 +125,13 @@
           <rect width="200" height="120" :fill="getColor('申请文件定稿',6)"> </rect>
           <text x="30" y="65">申请文件定稿</text>
         </g>
-        <g>
+        <g @click="toFilePage('申请文件定稿', 6,'任务')">
           <text x="120" y="45">任务:</text>
           <circle cx="180" cy="40" r="15" stroke-width="1" stroke="#fff" :fill="getColor('申请文件定稿',6)" />
           <text :x="getNumber('申请文件定稿',6) > 9 ? '170' : '175'" y="45" fill="#fff">{{ getNumber('申请文件定稿',6,'taskCount') }}</text>
           <line x1="0" y1="60" x2="-150" y2="60" stroke='#333'></line>
         </g>
-        <g>
+        <g @click="toFilePage('申请文件定稿', 6,'文件')">
           <text x="120" y="85">文件:</text>
           <circle cx="180" cy="80" r="15" stroke-width="1" stroke="#fff" :fill="getColor('申请文件定稿',6)" />
           <text :x="getNumber('申请文件定稿',6) > 9 ? '170' : '175'" y="85" fill="#fff">{{ getNumber('申请文件定稿',6,'fileCount') }}</text>
@@ -145,12 +145,12 @@
         <rect width="200" height="120" :fill="getColor('说明书规划撰写',7)"> </rect>
         <text x="15" y="65" xml:space='preserve'>说明书规划撰写
         </text>
-        <g>
+        <g @click="toFilePage('说明书规划撰写', 7,'任务')">
           <text x="120" y="45">任务:</text>
           <circle cx="180" cy="40" r="15" stroke-width="1" stroke="#fff" :fill="getColor('说明书规划撰写',7)" />
           <text :x="getNumber('说明书规划撰写',7) > 9 ? '170' : '175'" y="45" fill="#fff">{{ getNumber('说明书规划撰写',7,'taskCount') }}</text>
         </g>
-        <g>
+        <g @click="toFilePage('说明书规划撰写', 7,'文件')">
           <text x="120" y="85">文件:</text>
           <circle cx="180" cy="80" r="15" stroke-width="1" stroke="#fff" :fill="getColor('说明书规划撰写',7)" />
           <text :x="getNumber('说明书规划撰写',7) > 9 ? '170' : '175'" y="85" fill="#fff">{{ getNumber('说明书规划撰写',7,'fileCount') }}</text>
@@ -165,7 +165,7 @@
 import { optionsData } from '../../mixins/index2'
 export default {
   mixins: [optionsData],
-  props: ['id'],
+  props: ['id','isClose'],
   data() {
     return {
       numObj: {
@@ -177,8 +177,14 @@ export default {
         '申请文件定稿': {'task':0,'file':0},
         '说明书规划撰写': {'task':0,'file':0},
       },
+      isShow:false,
     }
   },
+  watch: {
+    isClose(val) {
+      this.getFileNumber()
+    },
+  },
   computed: {},
   async mounted() {
     await this.getFileNumber()
@@ -192,6 +198,7 @@ export default {
       await this.$api.getCountOfProcess(params).then(response => {
         if (response.code == 200) {
           this.numObj = response.data
+          this.isShow=true
         }
       }).catch(error => {
         this.numObj = {}

+ 286 - 36
src/views/report/components/reportFile/reportFileTable.vue

@@ -4,54 +4,43 @@
       <el-header style="display:flex;justify-content: space-between;">
         <div>
           <mySearch :SearchFields="searchFiled" @search="search" :searchValue="searchOption"></mySearch>
-          <!-- <el-form :inline="true">
-            <el-form-item label="名称">
-              <el-input v-model="form.fileName" size="small" placeholder="请输入文件名称"></el-input>
-            </el-form-item>
-            <el-form-item>
-              <el-button type="" size="small" @click="getList">查询</el-button>
-            </el-form-item>
-          </el-form> -->
         </div>
         <div>
           <el-button type="primary" size="small" @click="handleAdd()">新增</el-button>
         </div>
       </el-header>
       <el-main>
-        <el-table v-loading="loading" :data="tableData" border header-row-class-name="custom-table-header">
-          <el-table-column type="index" label="#" width="55" align="center"></el-table-column>
-          <el-table-column prop="name" label="名称" align="center" show-overflow-tooltip>
-            <template slot-scope="scope" v-if="scope.row.reportFiles">
-              <div>
-                <span>{{ scope.row.name }}</span>
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column prop="suffix" label="类型" align="center" show-overflow-tooltip>
-            <template slot-scope="scope" v-if="scope.row.reportFiles">
+        <el-table v-loading="loading" :data="tableData" style="width: 100%;" border
+          header-row-class-name="custom-table-header" @sort-change="sortChange">
+          <el-table-column label="#" align="center" width="80px">
+            <template slot-scope="scope">
               <div>
-                <span>{{ scope.row.reportFiles[0].suffix }}</span>
+                {{ (queryParams.current - 1) * queryParams.size + scope.$index + 1 }}
               </div>
             </template>
           </el-table-column>
-          <el-table-column prop="reportName" label="所属报告" align="center" show-overflow-tooltip></el-table-column>
-          <el-table-column prop="personName" label="创建人" align="center" show-overflow-tooltip></el-table-column>
-          <el-table-column prop="creationTime" label="创建时间" align="center" show-overflow-tooltip>
+
+          <el-table-column v-for="item in columnList" :key="item.value" :prop="item.value"
+            :render-header="$commonJS.renderHeaderMethods" :label="item.name" sortable="custom" align="center">
             <template slot-scope="scope">
-              <span>{{ scope.row.creationTime }}</span>
+              <div v-if="['name'].includes(item.value)">
+                <el-tooltip :content="$commonJS.getColumnData(scope.row, item)" placement="top">
+                  <span v-html="$commonJS.getColumnData(scope.row, item)"></span>
+                </el-tooltip>
+              </div>
+              <div v-else v-html="$commonJS.getColumnData(scope.row, item)"></div>
             </template>
           </el-table-column>
-          <el-table-column prop="remark" label="备注" align="center" show-overflow-tooltip></el-table-column>
+
           <el-table-column label="操作" align="center" width="150">
             <template slot-scope="scope">
-              <el-dropdown split-button type="primary" size="small">
-                <P @click="handleEdit(scope.row)">编辑</P>
+              <el-dropdown split-button type="primary" size="small" @command="handleCommand($event, scope.row)">
+                <P @click="handleCommand('e', scope.row)">编辑</P>
 
                 <el-dropdown-menu slot="dropdown" class="text-align_center">
-                  <el-dropdown-item @click.native="handleDownload(scope.row)">下载</el-dropdown-item>
-                  <el-dropdown-item @click.native="preview(scope.row.reportFiles[0])">预览</el-dropdown-item>
-                  <el-dropdown-item divided class="color-red"
-                    @click.native="handleDelete(scope.row)">删除</el-dropdown-item>
+                  <el-dropdown-item command="0">下载</el-dropdown-item>
+                  <el-dropdown-item command="1">预览</el-dropdown-item>
+                  <el-dropdown-item command="2" divided style="color: red;">删除</el-dropdown-item>
                 </el-dropdown-menu>
               </el-dropdown>
             </template>
@@ -62,14 +51,33 @@
             @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
         </div>
       </el-main>
-      <el-footer class="footer-common">
-        <el-button @click="close">关 闭</el-button>
-      </el-footer>
     </el-container>
+
+    <el-dialog :title="title" :visible.sync="dialogVisible" width="500px" append-to-body destroy-on-close
+      :close-on-click-modal="false" :before-close="handleClose">
+      <el-form :model="form" :rules="rules" ref="form" label-width="80px" label-position="left">
+        <el-form-item label="文件名称" prop="name">
+          <el-input v-model="ruleForm.name" placeholder="请输入文件名称"></el-input>
+        </el-form-item>
+        <el-form-item label="文件选择" class="margin-bottom_0" required>
+          <myUpload :file-list="form.systemFileList" @on-change="onchangeFile" @on-remove="onRemove"
+            style="height: 185px;" :autoUpload="true">
+          </myUpload>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="ruleForm.remark" placeholder="请输入备注" type="textarea"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="handleClose">取 消</el-button>
+        <el-button type="primary" @click="submit">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
+import { downLoad2 } from "@/utils"
 export default {
   data() {
     return {
@@ -81,19 +89,261 @@ export default {
         size: 10,
       },
       total: 0,
+      // 表格字段
+      columnList: [
+        {
+          name: "名称",
+          type: "String",
+          value: "name",
+        },
+        {
+          name: "类型",
+          type: "String",
+          value: "suffix",
+        },
+        {
+          name: "所属报告",
+          type: "String",
+          value: "reportName",
+        },
+        {
+          name: "创建人",
+          type: "String",
+          value: "personName",
+        },
+        {
+          name: "创建时间",
+          type: "String",
+          value: "DataTime",
+        },
+        {
+          name: "备注",
+          type: "String",
+          value: "remark",
+        },
+      ],
       // 检索字段
       searchFiled: [],
       // 检索字符串
       searchOption: {},
       //排序字段
       sort: [{ "orderBy": "createTime", "orderType": 1 }],
+      // 表格loading
+      loading: false,
+      // 
+      title: '',
+      // 控制弹窗显示
+      dialogVisible: false,
+      // 表单数据
+      form: {
+        systemFileList: [],
+      },
+      // 表单校验
+      rules: {
+        name: [{ required: true, message: '请输入文件名称', trigger: 'blur' },],
+      },
     }
   },
-  mounted() {
-
+  async mounted() {
+    // 获取table栏位
+    // this.columnList = await this.$commonJS.getCustomField('projectTask')
+    // 获取栏位
+    // await this.getColumn()
+    // 获取数据
+    // this.getList()
   },
   methods: {
+    //校验文件是否全部上传
+    validFile() {
+      if (this.form.systemFileList && this.form.systemFileList.length > 0) {
+        return this.form.systemFileList.filter(item => {
+          return !item.guid
+        }).length > 0
+      } else {
+        return false
+      }
+    },
+    // 弹窗确定
+    submit() {
+      // 判断文件是否都上传完毕
+      var allUpload = this.validFile()
+      if (allUpload) {
+        this.$message.warning('文件未全部上传,请耐心等待')
+        return false
+      }
+      this.form.fileGuids = this.form.systemFileList.map(item => {
+        return item.guid
+      })
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          let params = {
+            
+          }
+          if (!this.form.id) {
+            this.$api.add(params).then(res => {
+              if (res.code == 200) {
+                this.$message.success('新增成功')
+                this.getList()
+                this.handleClose()
+              }
+            }).catch(error => {
+
+            })
+          } else {
+            this.$api.edit(params).then(res => {
+              if (res.code == 200) {
+                this.$message.success('编辑成功')
+                this.getList()
+                this.handleClose()
+              }
+            }).catch(error => {
+
+            })
+          }
+        }
+      })
+
+    },
+    // 关闭弹窗
+    handleClose() {
+      this.$refs.form.resetFields()
+      this.form = {
+        systemFileList: [],
+      }
+      this.dialogVisible = false
+    },
+    // 上传的文件监听
+    onchangeFile(file, fileList) {
+      if (file.guid && this.form.systemFileList && this.form.systemFileList.length > 0) {
+        let index = this.form.systemFileList.findIndex(item => {
+          return item.uid == file.uid
+        })
+        if (index != -1) {
+          this.form.systemFileList.splice(index, 1, file)
+        } else {
+          this.form.systemFileList.push(file.raw)
+        }
+      } else {
+        this.form.systemFileList.push(file.raw)
+      }
+    },
+    // 删除上传的文件
+    onRemove(file, fileList) {
+      let index = this.form.systemFileList.findIndex(item => {
+        return item.uid == file.uid
+      })
+      if (index != -1) {
+        this.form.systemFileList.splice(index, 1)
+      }
+    },
+    // 新增
+    handleAdd() {
+      this.dialogVisible = true
+    },
+    getList() {
+      let params = {
+        reportId: null,//放在外面还是searchQuery里面??
+        ...this.queryParams,//分页信息
+        searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
+        orderDTOList: this.sort,//排序信息
+      }
+      this.loading = false
+      this.$api.query(params).then(res => {
+        if (res.code == 200) {
+          this.tableData = res.data
+          this.total = res.data.total
+          this.loading = true
+        }
+      }).catch(error => {
+        this.tableData = []
+        this.total = 0
+      })
+    },
+    // 分页
+    handleCurrentChange(val) {
+      this.queryParams.current = val
+      this.getList()
+    },
+    // 排序
+    sortChange({ column, prop, order }) {
+      //如需要多个字段排序,则不需要清空
+      var params = {
+        sort: this.sort,
+        column,
+        prop,
+        order,
+      }
+      this.sort = this.$commonJS.getSortData(params)
+      this.queryParams.current = 1
+      this.getList()
+    },
+    // 检索
+    search(val) {
+      let params = {}
+      val.forEach(item => {
+        if (item.type == 3) {
+          params[item.value] = item.searchValue.map(itemValue => {
+            return itemValue.value
+          })
+        } else {
+          params[item.value] = item.searchValue.label
+        }
+      })
+      // 返回字符串
+      this.searchOption = params
+      // 调用查询接口
+      this.queryParams.current = 1
+      this.getList()
+    },
+    // 编辑等下拉菜单
+    handleCommand(ev, row) {
+      switch (ev) {
+        case 'e'://编辑
+          this.handleEdit(row)
+          break;
+        case '0'://下载
+          this.downloads(row)
+          break;
+        case '1'://预览
+
+          break;
+        case '2'://删除
+          this.handleDelete(row)
+          break;
 
+        default:
+          break;
+      }
+    },
+    handleEdit(row) {
+      this.form = row
+      this.dialogVisible = true
+    },
+    // 删除
+    handleDelete(data) {
+      this.handleDeletes([data.id])
+    },
+    handleDeletes(ids) {
+      this.$confirm(str, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$api.delete(ids).then(response => {
+          if (response.code == 200) {
+            this.$message.success('删除成功')
+            this.queryParams.current = 1
+            this.getList()
+          }
+        })
+      }).catch(() => {
+        this.$message.info('操作已取消')
+      });
+    },
+    // 下载
+    downloads(data) {
+      downLoad2(data.guid)
+    },
   },
 }
 </script>

+ 1 - 0
src/views/task/components/index.vue

@@ -130,6 +130,7 @@ export default {
         4: '协同任务',
         5: '任务审核任务',
         6: '文件分配任务',
+        7: '文件审核任务',
       },
       // 任务状态
       taskStatus: {