scorpio před 2 roky
rodič
revize
b7db77ccce

+ 12 - 0
src/api/contract/index.js

@@ -47,6 +47,18 @@ export default {
       'json'
     )
   },
+  /**
+   * 删除合同
+   * @param params
+   * @returns {Promise<unknown>}
+   */
+  contractRemove(params) {
+    return fetch(
+      '/blade-project-manage-v2/contracts-manage/v2/delete-contracts',
+      params,
+      'post'
+    )
+  },
   /**
    * 删除台账
    * @param params

+ 4 - 0
src/layout/top.vue

@@ -166,6 +166,9 @@ export default {
         this.mini = false
       }
     })
+    this.$bus.on('read', () => {
+      this.msgCount = this.msgCount - 1
+    })
     this.initWebSocket()
   },
   mounted() {
@@ -218,6 +221,7 @@ export default {
       console.log(e.data)
       // 收到服务器信息,心跳重置
       this.msgCount = this.msgCount + 1
+      console.log(this.msgCount)
       this.reset()
     },
     websocketsend(Data) {

+ 56 - 39
src/views/contract/index.vue

@@ -4,53 +4,53 @@
       <div class="flex">
         <div class="flex flex-center mt-15 mr-10">
           <el-form-item
-              label="关键字"
-              class="full-width"
-              style="margin-left: -50px"
+            label="关键字"
+            class="full-width"
+            style="margin-left: -50px"
           >
             <el-input
-                v-model="params.name"
-                placeholder="输入合同关键字"
-                prefix-icon="Search"
-                clearable
+              v-model="params.name"
+              placeholder="输入合同关键字"
+              prefix-icon="Search"
+              clearable
             />
           </el-form-item>
           <el-form-item class="full-width" label="合同类别">
             <el-select v-model="params.type" clearable>
               <el-option
-                  v-for="item in typelist"
-                  :key="item.dictKey"
-                  :label="item.dictValue"
-                  :value="item.dictKey"
+                v-for="item in typelist"
+                :key="item.dictKey"
+                :label="item.dictValue"
+                :value="item.dictKey"
               />
             </el-select>
           </el-form-item>
           <el-form-item class="full-width" label="合同状态">
             <el-select v-model="params.status" clearable>
               <el-option
-                  v-for="item in dicList"
-                  :key="item.dictKey"
-                  :label="item.dictValue"
-                  :value="item.dictKey"
+                v-for="item in dicList"
+                :key="item.dictKey"
+                :label="item.dictValue"
+                :value="item.dictKey"
               />
             </el-select>
           </el-form-item>
         </div>
         <div class="flex flex-center ml-20">
-          <base-button type="0" title="重置" icon="Refresh" @click="clearUp"/>
-          <base-button class="ml-20" @click="onLoad"/>
+          <base-button type="0" title="重置" icon="Refresh" @click="clearUp" />
+          <base-button class="ml-20" @click="onLoad" />
         </div>
       </div>
     </el-form>
     <avue-crud
-        :option="option"
-        :data="data"
-        ref="crud"
-        v-model="form"
-        :before-open="beforeOpen"
-        @row-del="rowDel"
-        @row-save="rowSave"
-        @row-update="rowUpdate"
+      :option="option"
+      :data="data"
+      ref="crud"
+      v-model="form"
+      :before-open="beforeOpen"
+      @row-del="rowDel"
+      @row-save="rowSave"
+      @row-update="rowUpdate"
     >
     </avue-crud>
   </el-card>
@@ -66,7 +66,7 @@ meta: { layout: 'empty'}
 import BaseButton from '@/components/base-button.vue'
 
 export default {
-  components: {BaseButton},
+  components: { BaseButton },
   data() {
     return {
       projectId: '',
@@ -154,7 +154,7 @@ export default {
   },
   methods: {
     getDic(code) {
-      this.$api.common.dicList({code}).then(res => {
+      this.$api.common.dicList({ code }).then(res => {
         if (res.code === 200) {
           if (code === 'contract-status') {
             this.dicList = res.data
@@ -166,30 +166,47 @@ export default {
     },
     onLoad() {
       this.loading = true
-      const data = Object.assign(this.params, {projectId: this.projectId})
+      const data = Object.assign(this.params, { projectId: this.projectId })
       this.$api.contract
-          .contractList(Object.assign(this.page, data))
-          .then(res => {
-            this.data = res.data.records
-          })
-          .finally(() => {
-            this.loading = false
-          })
+        .contractList(Object.assign(this.page, data))
+        .then(res => {
+          this.data = res.data.records
+        })
+        .finally(() => {
+          this.loading = false
+        })
     },
     clearUp() {
-      this.params.name = '',
-          this.params.status = '',
-          this.params.type = ''
+      this.params.name = ''
+      this.params.status = ''
+      this.params.type = ''
       this.onLoad()
     },
     beforeOpen(done, type) {
       if (type === 'view') {
         const data = this.$router.resolve({
           path: '/contract/detail',
-          query: {id: this.form.id}
+          query: { id: this.form.id }
         })
         window.open(data.href, '_blank')
       }
+    },
+    rowDel(row, index, done) {
+      this.$confirm('确定将选择数据删除?', {
+        type: 'warning'
+      }).then(res => {
+        console.log(res)
+        if (res === 'confirm') {
+          this.$api.contract.contractRemove({ ids: row.id }).then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.onLoad()
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
+        }
+      })
     }
   }
 }

+ 5 - 4
src/views/msg/index.vue

@@ -63,16 +63,17 @@ export default {
         }
       })
     },
-    change(res) {
-      const tmp = this.data.find(ele => ele.id === res)
+    change(row) {
+      const tmp = this.data.find(ele => ele.id === row)
       if (tmp && tmp.readFlag === 1) {
         return
       }
-      this.$api.msg.markRead({ id: res }).then(res => {
+      this.$api.msg.markRead({ id: row }).then(res => {
         if (res.code === 200) {
           this.data = this.data.map(ele => {
-            if (ele.id === res) {
+            if (ele.id === row) {
               ele.readFlag = 1
+              this.$bus.emit('read')
             }
             return ele
           })

+ 14 - 0
src/views/store/component/info3.vue

@@ -192,6 +192,20 @@ export default {
           {
             label: '上传时间',
             prop: 'createTime'
+          },
+          {
+            label: '识别状态',
+            prop: 'createTime',
+            dicData: [
+              {
+                label: '识别中',
+                value: 0
+              },
+              {
+                label: '识别完成',
+                value: 1
+              }
+            ]
           }
         ]
       }