Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

lizhenhao před 2 roky
rodič
revize
562cb66f90

+ 69 - 69
package-lock.json

@@ -1961,6 +1961,75 @@
         "webpack-chain": "^6.4.0",
         "webpack-dev-server": "^3.11.0",
         "webpack-merge": "^4.2.2"
+      },
+      "dependencies": {
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
+        "chalk": {
+          "version": "4.1.2",
+          "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+          "dev": true,
+          "optional": true
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+          "dev": true,
+          "optional": true
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        },
+        "vue-loader-v16": {
+          "version": "npm:vue-loader@16.8.3",
+          "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
+          "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "chalk": "^4.1.0",
+            "hash-sum": "^2.0.0",
+            "loader-utils": "^2.0.0"
+          }
+        }
       }
     },
     "@vue/cli-shared-utils": {
@@ -14794,75 +14863,6 @@
         }
       }
     },
-    "vue-loader-v16": {
-      "version": "npm:vue-loader@16.8.3",
-      "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
-      "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
-      "dev": true,
-      "optional": true,
-      "requires": {
-        "chalk": "^4.1.0",
-        "hash-sum": "^2.0.0",
-        "loader-utils": "^2.0.0"
-      },
-      "dependencies": {
-        "ansi-styles": {
-          "version": "4.3.0",
-          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
-          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-convert": "^2.0.1"
-          }
-        },
-        "chalk": {
-          "version": "4.1.2",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
-          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "ansi-styles": "^4.1.0",
-            "supports-color": "^7.1.0"
-          }
-        },
-        "color-convert": {
-          "version": "2.0.1",
-          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
-          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-name": "~1.1.4"
-          }
-        },
-        "color-name": {
-          "version": "1.1.4",
-          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
-          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
-          "dev": true,
-          "optional": true
-        },
-        "has-flag": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
-          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
-          "dev": true,
-          "optional": true
-        },
-        "supports-color": {
-          "version": "7.2.0",
-          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
-          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "has-flag": "^4.0.0"
-          }
-        }
-      }
-    },
     "vue-print-nb": {
       "version": "1.7.5",
       "resolved": "https://registry.npmjs.org/vue-print-nb/-/vue-print-nb-1.7.5.tgz",

+ 74 - 0
src/api/loginOnLine/LoginOnLineService.js

@@ -0,0 +1,74 @@
+import request from '@/utils/httpRequest'
+
+export default class PostService {
+  list (params) {
+    console.log(params)
+    return request({
+      url: '/sys/loginUserOnline/list',
+      method: 'get',
+      params: params
+    })
+  }
+  queryById (id) {
+    return request({
+      url: '/sys/project/queryById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  save (inputForm) {
+    return request({
+      url: `/sys/project/save`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+  delete (tokenId, loginName) {
+    return request({
+      url: '/sys/loginUserOnline/delete',
+      method: 'delete',
+      params: {
+        tokenId: tokenId,
+        loginName: loginName
+      }
+    })
+  }
+
+  importExcel (data) {
+    return request({
+      url: '/sys/project/import',
+      method: 'post',
+      data: data
+    })
+  }
+  exportTemplate () {
+    return request({
+      url: '/sys/project/import/template',
+      method: 'get',
+      responseType: 'blob'
+    })
+  }
+  exportExcel (params) {
+    return request({
+      url: '/sys/project/export',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
+  proportion (params) {
+    return request({
+      url: '/sys/project/proportion',
+      method: 'get',
+      params: params
+    })
+  }
+  fileUploadList (params) {
+    return request({
+      url: '/sys/project/exportFileUploadList',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
+}

+ 32 - 0
src/api/sys/WorkContractService.js

@@ -0,0 +1,32 @@
+import request from '@/utils/httpRequest'
+
+export default class WorkContractService {
+  list (param) {
+    return request({
+      url: '/workContract/workContractInfo/list',
+      method: 'get',
+      params: param
+    })
+  }
+  save (param) {
+    return request({
+      url: '/workContract/workContractInfo/save',
+      method: 'post',
+      data: param
+    })
+  }
+  remove (url) {
+    return request({
+      url: '/workContract/workContractInfo/remove',
+      method: 'get',
+      params: {id: url}
+    })
+  }
+  findById (id) {
+    return request({
+      url: '/workContract/workContractInfo/findById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+}

+ 1 - 1
src/router/index.js

@@ -30,7 +30,7 @@ const mainRoutes = {
   meta: {title: '整体布局'},
   children: [
     {path: '/redirect/:path(.*)', component: _import('modules/redirect/index')},
-    {path: '/home', redirect: '/sys/project/AssessList', name: 'home'},
+    {path: '/home', redirect: '/sys/dashboard/workBench/Pending', name: 'home'},
     {path: '/flowable/task/TaskForm', component: _import('modules/flowable/task/TaskForm'), name: 'task-form', meta: {title: '流程表单'}},
     {path: '/flowable/task/TaskFormEdit', component: _import('modules/flowable/task/TaskFormEdit'), name: 'task-form-edit', meta: {title: '流程表单'}},
     {path: '/flowable/task/TaskFormDetail', component: _import('modules/flowable/task/TaskFormDetail'), name: 'task-form-detail', meta: {title: '流程表单详情'}},

+ 20 - 4
src/views/modules/flowable/task/ApplyList.vue

@@ -108,6 +108,16 @@
   import TaskService from '@/api/flowable/TaskService'
   import ProcessService from '@/api/flowable/ProcessService'
   export default {
+    props: {
+      index: {
+        type: String,
+        default: ''
+      },
+      i: {
+        type: String,
+        default: ''
+      }
+    },
     data () {
       return {
         searchForm: {
@@ -159,10 +169,11 @@
     created () {
       this.proccessService = new ProcessService()
       this.taskService = new TaskService()
-    },
-    activated () {
       this.refreshList()
     },
+    // activated () {
+    //   this.refreshList()
+    // },
     components: {
       UrgeForm
       // FlowChart
@@ -176,6 +187,11 @@
           this.searchForm.beginDate = ''
           this.searchForm.endDate = ''
         }
+      },
+      index (index) {
+        if (index === this.i) {
+          this.refreshList()
+        }
       }
     },
     methods: {
@@ -234,7 +250,7 @@
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          this.pro.revokeProcIns(row.processInstanceId).then(({data}) => {
+          this.proccessService.revokeProcIns(row.processInstanceId).then(({data}) => {
             this.$message.success(data)
             this.refreshList()
           })
@@ -252,4 +268,4 @@
       }
     }
   }
-</script>
+</script>

+ 18 - 3
src/views/modules/flowable/task/HistoryList.vue

@@ -44,7 +44,7 @@
                 <vxe-column type="checkbox"  width="40px"></vxe-column>
                 <vxe-column  title="任务" field="name" >
                     <template slot-scope="scope">
-                      {{scope.row.name}} 
+                      {{scope.row.name}}
                       <el-button v-if="scope.row.back" type="warning" size="mini" @click="callback(scope.row)">撤销</el-button>
                     </template>
                 </vxe-column>
@@ -84,6 +84,16 @@
   import pick from 'lodash.pick'
   import TaskService from '@/api/flowable/TaskService'
   export default {
+    props: {
+      index: {
+        type: String,
+        default: ''
+      },
+      i: {
+        type: String,
+        default: ''
+      }
+    },
     data () {
       return {
         searchForm: {
@@ -132,10 +142,10 @@
     taskService: null,
     created () {
       this.taskService = new TaskService()
-    },
-    activated () {
       this.refreshList()
     },
+    // activated () {
+    // },
     watch: {
       searchDates () {
         if (this.searchDates) {
@@ -145,6 +155,11 @@
           this.searchForm.beginDate = ''
           this.searchForm.endDate = ''
         }
+      },
+      index (index) {
+        if (index === this.i) {
+          this.refreshList()
+        }
       }
     },
     methods: {

+ 44 - 9
src/views/modules/flowable/task/TaskForm.vue

@@ -103,6 +103,7 @@
   import FormService from '@/api/flowable/FormService'
   import FlowCopyService from '@/api/flowable/FlowCopyService'
   import ProcessService from '@/api/flowable/ProcessService'
+  import WorkContractForm2 from '@/views/modules/sys/workContract/WorkContractForm2'
   const _import = require('@/router/import-' + process.env.NODE_ENV)
   export default {
     taskDefExtensionService: null,
@@ -175,7 +176,8 @@
       PreviewForm,
       TaskBackNodes,
       FlowStep,
-      FlowTimeLine
+      FlowTimeLine,
+      WorkContractForm2
     },
     watch: {
       isAssign (val) {
@@ -231,8 +233,14 @@
         }
       },
       // 暂存草稿
-      save () {
-
+      async save () {
+        if (this.formType === '2' && this.status === 'startAndHold') { // 外置表单
+          this.$refs.form.saveForm1().then(() => {
+            this.$message.success('操作成功')
+            this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+            this.$router.push('../../../sys/workContract/WorkContractList')
+          })
+        }
       },
       // 启动流程
       start (vars) {
@@ -358,10 +366,15 @@
       },
       // 关闭
       close () {
-
+        if (this.status === 'startAndHold') {
+          this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+          this.$router.push('../../../sys/workContract/WorkContractList')
+        }
       },
       // 自定义按钮提交
       commit (vars) {
+        var num = this.$route.query.num
+        console.log(num)
         if (this.formType === '2') { // 外置表单
           this.$refs.form.saveForm((businessTable, businessId, inputForm) => {
             vars = {...vars, ...inputForm}
@@ -376,15 +389,35 @@
             }).then(({data}) => {
               this.$message.success('提交成功')
               this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
-              this.$router.push('/flowable/task/TodoList')
-              this.cc(data)
+              // this.$router.push('/flowable/task/TodoList')
+              // this.cc(data)
+              if (num === '2') {
+                this.$router.push('/sys/dashboard/workBench/Pending')
+                this.cc(data)
+              } else if (num === '3') {
+                this.$router.push('/sys/dashboard/workBench/PendingList')
+                this.cc(data)
+              } else {
+                this.$router.push('/flowable/task/TodoList')
+                this.cc(data)
+              }
             })
           })
         } else { // 动态表单
           this.$refs.form.submitTaskFormData(vars, this.procInsId, this.taskId, this.auditForm.assignee, this.auditForm, (data) => {
             this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
-            this.$router.push('/flowable/task/TodoList')
-            this.cc(data)
+            // this.$router.push('/flowable/task/TodoList')
+            // this.cc(data)
+            if (num === '2') {
+              this.$router.push('/sys/dashboard/workBench/Pending')
+              this.cc(data)
+            } else if (num === '3') {
+              this.$router.push('/sys/dashboard/workBench/PendingList')
+              this.cc(data)
+            } else {
+              this.$router.push('/flowable/task/TodoList')
+              this.cc(data)
+            }
           })
         }
       },
@@ -439,7 +472,7 @@
           case '_flow_print':// 打印
             this.print()
             break
-          case '_flow_close':// 打印
+          case '_flow_close':// 关闭
             this.close()
             break
           default:
@@ -448,6 +481,8 @@
       }
     },
     data () {
+      var num = this.$route.query.num
+      console.log(num)
       return {
         form: null,
         formType: '',

+ 24 - 1
src/views/modules/flowable/task/TodoList.vue

@@ -97,8 +97,23 @@
   import UserSelect from '@/components/userSelect/UserSelectDialog'
   import TaskService from '@/api/flowable/TaskService'
   export default {
+    props: {
+      index: {
+        type: String,
+        default: ''
+      },
+      i: {
+        type: String,
+        default: ''
+      },
+      num: {
+        type: String,
+        default: ''
+      }
+    },
     data () {
       return {
+        mySum: this.num,
         searchForm: {
           beginDate: '',
           endDate: ''
@@ -164,6 +179,11 @@
           this.searchForm.beginDate = ''
           this.searchForm.endDate = ''
         }
+      },
+      index (index) {
+        if (index === this.i) {
+          this.refreshList()
+        }
       }
     },
     methods: {
@@ -188,6 +208,9 @@
         this.refreshList()
       },
       todo (row) {
+        // eslint-disable-next-line no-unused-vars
+        var sum = this.mySum
+        console.log(sum)
         this.taskService.getTaskDef({
           taskId: row.task.id,
           taskName: row.task.name,
@@ -199,7 +222,7 @@
         }).then(({data}) => {
           this.$router.push({
             path: '/flowable/task/TaskForm',
-            query: {formTitle: `${row.vars.title}`, title: `审批【${row.task.name || ''}】`, ...pick(data, 'formType', 'formReadOnly', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')}
+            query: {formTitle: `${row.vars.title}`, title: `审批【${row.task.name || ''}】`, ...pick(data, 'formType', 'formReadOnly', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId'), num: sum}
           })
         })
       },

+ 197 - 0
src/views/modules/loginOnLine/LoginOnLine.vue

@@ -0,0 +1,197 @@
+<template>
+  <div class="page">
+    <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+      <!-- 搜索框-->
+      <el-form-item prop="ip">
+        <el-input size="small" v-model="searchForm.ip" placeholder="请输入登录地址" clearable></el-input>
+      </el-form-item>
+      <el-form-item prop="name">
+        <el-input size="small" v-model="searchForm.name" placeholder="请输入用户名称" clearable></el-input>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+        <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <div class="bg-white top">
+      <vxe-toolbar :refresh="{query: refreshList}" import export print custom>
+        <template #buttons>
+
+        </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 80px);">
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          :loading="loading"
+          size="small"
+          ref="projectTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :print-config="{}"
+          @sort-change="sortChangeHandle"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :checkbox-config="{}">
+          <vxe-column type="checkbox"  width="40px"></vxe-column>
+          <vxe-column width="100px"  title="用户姓名" field="userName" > </vxe-column>
+          <vxe-column width="100px"  title="部门" field="officeName" > </vxe-column>
+          <vxe-column width="120px"  title="主机" field="ip" > </vxe-column>
+          <vxe-column width="200px"  title="登陆地点" field="loginLocation" > </vxe-column>
+          <vxe-column width="120px"  title="浏览器" field="browser" > </vxe-column>
+          <vxe-column width="120px"  title="操作系统" field="os" > </vxe-column>
+          <vxe-column width="160px"  title="登陆时间" field="loginTime" > </vxe-column>
+          <vxe-column title="操作" width="200px" fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.tokenId, scope.row.loginName)">强退</el-button>
+            </template>
+          </vxe-column>
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[5, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import LoginOnLineService from '@/api/loginOnLine/LoginOnLineService'
+  export default {
+    data () {
+      return {
+        searchForm: {
+          name: '',
+          ip: ''
+        },
+        dataList: [],
+        detailData: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 5,
+          orders: []
+        },
+        loading: false,
+        proport: ''
+      }
+    },
+    loginOnLineService: null,
+    created () {
+      this.loginOnLineService = new LoginOnLineService()
+    },
+    components: {
+    },
+    activated () {
+      this.refreshList()
+    },
+
+    methods: {
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.loginOnLineService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          'itemType': '1',
+          ...this.searchForm
+        }).then(({data}) => {
+          // this.dataList = data.records
+          this.detailData = this.splitArr(
+            data.records,
+            this.tablePage.pageSize
+          )
+          this.tablePage.total = data.total
+          this.currentChangeHandle({ ...this.tablePage })
+          // this.tablePage.total = data.total
+          this.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({ currentPage, pageSize }) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.dataList = this.detailData[currentPage - 1]
+        // this.refreshList()
+      },
+      // 排序
+      sortChangeHandle (column) {
+        this.tablePage.orders = []
+        if (column.order != null) {
+          this.tablePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
+        }
+        this.refreshList()
+      },
+      // 删除
+      del (tokenId, loginName) {
+        /* let tokenIds = tokenId || this.$refs.projectTable.getCheckboxRecords().map(item => {
+          return item.tokenId
+        }).join(',') */
+        this.$confirm(`确定强退所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.loginOnLineService.delete(tokenId, loginName).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+        })
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      },
+      // 自定义服务端导出
+      exportMethod ({ options }) {
+        // 传给服务端的参数
+        const params = {
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          'itemType': '1',
+          ...this.searchForm,
+          filename: options.filename,
+          sheetName: options.sheetName,
+          isHeader: options.isHeader,
+          original: options.original,
+          mode: options.mode,
+          selectIds: options.mode === 'selected' ? options.data.map(item => item.id) : [],
+          exportFields: options.columns.map(column => column.property)
+        }
+        return this.loginOnLineService.exportExcel(params).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res.data, options.filename)
+        }).catch(function (err) {
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+      },
+      splitArr (ar, size = 1) {
+        let index = 0
+        let res = []
+        while (index < ar.length) {
+          res.push(ar.slice(index, index + size))
+          index += size
+        }
+        return res
+      }
+    }
+  }
+</script>

+ 11 - 3
src/views/modules/monitor/Server.vue

@@ -1,5 +1,5 @@
 <template>
-  <div v-loading="loading"> 
+  <div v-loading="loading">
     <el-row :gutter="12" v-if="ServerOS" >
       <el-col :span="8">
         <el-card shadow="hover" class="server-card">
@@ -57,7 +57,7 @@
                 </div>
                  </el-col>
             </el-row>
-    
+
         </el-card>
       </el-col>
       <el-col :span="8">
@@ -117,6 +117,14 @@
                   <td><div class="cell">Jvm最大可用内存</div></td>
                   <td><div class="cell">{{ServerOS.jvm.maxTotal}}M</div></td>
                 </tr>
+                <tr>
+                  <td class="cell">启动时间</td>
+                  <td class="cell">{{ ServerOS.jvm.startTime }}</td>
+                </tr>
+                <tr>
+                  <td class="cell">运行时长</td>
+                  <td class="cell">{{ ServerOS.jvm.runTime }}</td>
+                </tr>
               </tbody>
             </table>
             </div>
@@ -245,4 +253,4 @@
     margin-bottom: 18px;
     /* padding-bottom: 20px; */
   }
-</style>
+</style>

+ 2 - 2
src/views/modules/notify/MyNotifyList.vue

@@ -40,7 +40,7 @@
                  <el-link  type="primary" :underline="false" @click="view(scope.row.id)">{{scope.row.title}}</el-link>
               </template>
             </vxe-column>
-            <vxe-column  title="类型" field="type" sortable> 
+            <vxe-column  title="类型" field="type" sortable>
                 <template slot-scope="scope">
                   {{ $dictUtils.getDictLabel("oa_notify_type", scope.row.type, '-') }}
                 </template>
@@ -154,4 +154,4 @@
       }
     }
   }
-</script>
+</script>

+ 418 - 0
src/views/modules/sys/dashboard/workBench/Pending.vue

@@ -0,0 +1,418 @@
+<template>
+  <div>
+    <el-row :gutter="30">
+      <el-col :span="12">
+        <div class="page" style="height: 600px">
+          <!--<el-form size="small" :inline="true"  class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+            <el-form-item label="创建时间" prop="searchDates">
+              <el-date-picker
+                v-model="searchDates"
+                type="daterange"
+                size="small"
+                align="right"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                unlink-panels
+                range-separator="至"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期"
+                :picker-options="pickerOptions">
+              </el-date-picker>
+            </el-form-item>
+            <el-form-item>
+              <el-button  type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+              <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+            </el-form-item>
+          </el-form>-->
+          <div class="top bg-white">
+            <!--      <vxe-toolbar :refresh="{query: refreshList}" export print custom></vxe-toolbar>-->
+            <div style="height: 18px" >
+              <span>我的待办({{tablePage.total}})</span>
+
+              <div style="float:right;align-items:center;display:flex;height: 18px">
+                <el-button type="text" style="float:right" @click="toPendingList()">更多>></el-button>
+
+              </div>
+            </div>
+            <div style="height: calc(100% - 80px);margin-top: 15px">
+              <vxe-table
+                border="inner"
+                auto-resize
+                resizable
+                height="auto"
+                :loading="loading"
+                size="small"
+                ref="todoTable"
+                show-header-overflow
+                show-overflow
+                highlight-hover-row
+                :menu-config="{}"
+                :print-config="{}"
+                :import-config="{}"
+                :export-config="{}"
+                :data="dataList"
+                header-align="center"
+                :checkbox-config="{}">
+                <!--<vxe-column type="seq" width="40"></vxe-column>
+                <vxe-column type="checkbox"  width="40px"></vxe-column>-->
+                <vxe-column title="实例标题" field="vars.title">
+                  <template slot-scope="scope">
+                    <el-link type="primary" :underline="false" v-if="scope.row.status === 'todo'"
+                             @click="todo(scope.row)">{{scope.row.vars.title}}
+                    </el-link>
+                    <span v-else>{{scope.row.vars.title}}</span>
+                  </template>
+                </vxe-column>
+                <vxe-column title="流程名称" field="processDefinitionName"></vxe-column>
+                <vxe-column title="当前环节" field="task.name">
+                  <template slot-scope="scope">
+                    <el-tag>{{scope.row.task.name}}</el-tag>
+                  </template>
+                </vxe-column>
+                <vxe-column title="流程发起人" field="vars.userName"></vxe-column>
+                <vxe-column
+                  field="task.createTime"
+                  title="创建时间">
+                </vxe-column>
+                <vxe-column title="操作" width="200px" fixed="right" align="center">
+                  <template slot-scope="scope">
+                    <el-button type="text" size="small" @click="todo(scope.row)">办理</el-button>
+                                  <el-button  type="text" size="small" @click="trace(scope.row)">进度</el-button>
+                  </template>
+                </vxe-column>
+              </vxe-table>
+              <vxe-pager
+                background
+                size="small"
+                :current-page="tablePage.currentPage"
+                :page-size="tablePage.pageSize"
+                :total="tablePage.total"
+                :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+                :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+                @page-change="currentChangeHandle">
+              </vxe-pager>
+            </div>
+          </div>
+          <el-dialog
+            title="查看进度"
+            :close-on-click-modal="true"
+            :visible.sync="visible"
+            v-dialogDrag
+            width="70%"
+            height="600px">
+            <flow-chart ref="preview" :processInstanceId="processInstanceId"></flow-chart>
+          </el-dialog>
+              <user-select ref="userSelect" :limit="1" @doSubmit="selectUsersToTransferTask"></user-select>
+        </div>
+      </el-col>
+      <el-col :span="12">
+        <div class="page" style="height: 600px">
+          <!--<el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+            &lt;!&ndash; 搜索框&ndash;&gt;
+            <el-form-item prop="title">
+              <el-input size="small" v-model="searchForm.title" placeholder="标题" clearable></el-input>
+            </el-form-item>
+            <el-form-item>
+              <el-button  type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+              <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+            </el-form-item>
+          </el-form>-->
+          <div class="top bg-white">
+            <div style="height: 18px" >
+              <span>我的通告({{noticePage.total}})</span>
+
+              <div style="float:right;align-items:center;display:flex;height: 18px">
+                <el-button type="text" style="float:right" @click="toNotice()">更多>></el-button>
+
+              </div>
+            </div>
+
+<!--            <vxe-toolbar :refresh="{query: refreshList}" export print custom></vxe-toolbar>-->
+            <div style="height: calc(100% - 80px);margin-top: 15px">
+              <vxe-table
+                border="inner"
+                auto-resize
+                resizable
+                height="auto"
+                :loading="loading2"
+                size="small"
+                ref="notifyTable"
+                show-header-overflow
+                show-overflow
+                highlight-hover-row
+                :menu-config="{}"
+                :print-config="{}"
+                :import-config="{}"
+                :export-config="{}"
+                @sort-change="sortChangeHandle"
+                :sort-config="{remote:true}"
+                :data="dataLists"
+                :checkbox-config="{}">
+                <!--<vxe-column type="seq" width="40"></vxe-column>
+                <vxe-column type="checkbox"  width="40px"></vxe-column>-->
+                <vxe-column  title="标题" field="title">
+                  <template slot-scope="scope">
+                    <el-link  type="primary" :underline="false" @click="view(scope.row.id)">{{scope.row.title}}</el-link>
+                  </template>
+                </vxe-column>
+                <vxe-column  title="类型" field="type">
+                  <template slot-scope="scope">
+                    {{ $dictUtils.getDictLabel("oa_notify_type", scope.row.type, '-') }}
+                  </template>
+                </vxe-column>
+                <vxe-column  title="内容" field="content"></vxe-column>
+                <vxe-column  title="附件" field="files">
+                  <template slot-scope="scope">
+                    <a :href="item" target="_blank" :key="index" v-for="(item, index) in (scope.row.files || '').split('|')">
+                      {{decodeURIComponent(item.substring(item.lastIndexOf("/")+1))}}
+                    </a>
+                  </template>
+                </vxe-column>
+
+                <vxe-column  title="查阅状态" field="status">
+                  <template slot-scope="scope">
+                    <el-tag type="success" v-if="scope.row.readFlag === '1'"> {{ $dictUtils.getDictLabel("oa_notify_read", scope.row.readFlag, '-') }}</el-tag>
+                    <el-tag type="danger" v-if="scope.row.readFlag === '0'"> {{ $dictUtils.getDictLabel("oa_notify_read", scope.row.readFlag, '-') }}</el-tag>
+                  </template>
+                </vxe-column>
+                <vxe-column  title="发布者" field="createBy.name"></vxe-column>
+                <vxe-column title="操作" width="200px" fixed="right" align="center">
+                  <template  slot-scope="scope">
+                    <el-button  type="text" icon="el-icon-view" size="mini" @click="view(scope.row.id)">查看</el-button>
+                  </template>
+                </vxe-column>
+              </vxe-table>
+              <vxe-pager
+                background
+                size="small"
+                :current-page="noticePage.currentPage"
+                :page-size="noticePage.pageSize"
+                :total="noticePage.total"
+                :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+                :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+                @page-change="noticeChangeHandle">
+              </vxe-pager>
+            </div>
+            <!-- 弹窗, 新增 / 修改 -->
+            <NotifyForm  ref="notifyForm" @refreshDataList="refreshList"></NotifyForm>
+          </div>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+  import pick from 'lodash.pick'
+  import UserSelect from '@/components/userSelect/UserSelectDialog'
+  import TaskService from '@/api/flowable/TaskService'
+  // import NotifyForm from './NotifyForm'
+  import NotifyForm from '@/views/modules/notify/NotifyForm'
+  import NotifyService from '@/api/notify/NotifyService'
+
+  export default {
+    data () {
+      return {
+        searchForm: {
+          beginDate: '',
+          endDate: ''
+        },
+        dataList: [],
+        dataLists: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        noticePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        loading: false,
+        loading2: false,
+        visible: false,
+        currentTask: null,
+        processInstanceId: ''
+        // pickerOptions: {
+        //   shortcuts: [{
+        //     text: '最近一周',
+        //     onClick (picker) {
+        //       const end = new Date()
+        //       const start = new Date()
+        //       start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+        //       picker.$emit('pick', [start, end])
+        //     }
+        //   }, {
+        //     text: '最近一个月',
+        //     onClick (picker) {
+        //       const end = new Date()
+        //       const start = new Date()
+        //       start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
+        //       picker.$emit('pick', [start, end])
+        //     }
+        //   }, {
+        //     text: '最近三个月',
+        //     onClick (picker) {
+        //       const end = new Date()
+        //       const start = new Date()
+        //       start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
+        //       picker.$emit('pick', [start, end])
+        //     }
+        //   }]
+        // }
+      }
+    },
+    taskService: null,
+    notifyService: null,
+    created () {
+      this.taskService = new TaskService()
+      this.notifyService = new NotifyService()
+    },
+    activated () {
+      this.refreshList()
+    },
+    components: {
+      UserSelect,
+      // FlowChart
+      NotifyForm
+    },
+    // watch: {
+    // },
+    methods: {
+      toNotice () {
+        this.$router.push('/notify/MyNotifyList')
+      },
+      toPendingList () {
+        // this.$router.push('./PendingList')
+        this.$router.push({
+          path: './PendingList',
+          query: {
+            num: 3
+          }
+        })
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.taskService.todoList({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+        this.notifyService.list({
+          'current': this.noticePage.currentPage,
+          'size': this.noticePage.pageSize,
+          'orders': this.noticePage.orders,
+          isSelf: true,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataLists = data.records
+          this.noticePage.total = data.total
+          this.loading = false
+        })
+      },
+      // 排序
+      sortChangeHandle (column) {
+        this.noticePage.orders = []
+        if (column.order != null) {
+          this.noticePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
+        }
+        this.refreshList()
+      },
+      // 当前页
+      currentChangeHandle ({ currentPage, pageSize }) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        // 刷新
+        this.loading = true
+        this.taskService.todoList({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+        // this.refreshList()
+      },
+      noticeChangeHandle ({ currentPage, pageSize }) {
+        this.loading2 = true
+        this.noticePage.currentPage = currentPage
+        this.noticePage.pageSize = pageSize
+        this.notifyService.list({
+          'current': this.noticePage.currentPage,
+          'size': this.noticePage.pageSize,
+          'orders': this.noticePage.orders,
+          isSelf: true,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataLists = data.records
+          this.noticePage.total = data.total
+          this.loading2 = false
+        })
+        // this.refreshList()
+      },
+      todo (row) {
+        this.taskService.getTaskDef({
+          taskId: row.task.id,
+          taskName: row.task.name,
+          taskDefKey: row.task.taskDefinitionKey,
+          procInsId: row.task.processInstanceId,
+          procDefId: row.task.processDefinitionId,
+          procDefKey: row.task.processDefKey,
+          status: row.status
+        }).then(({data}) => {
+          this.$router.push({
+            path: '/flowable/task/TaskForm',
+            query: {
+              formTitle: `${row.vars.title}`,
+              num: 2,
+              title: `审批【${row.task.name || ''}】`,
+              ...pick(data, 'formType', 'formReadOnly', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')
+            }
+          })
+        })
+      },
+      trace (row) {
+        this.processInstanceId = row.task.processInstanceId
+        this.visible = true
+        this.$nextTick(() => {
+          this.$refs.preview.init()
+        })
+      },
+      transferTask (row) {
+        this.currentTask = row.task
+        this.$refs.userSelect.init()
+      },
+      selectUsersToTransferTask (user) {
+        this.taskService.delegate(this.currentTask.id, user[0].id).then(({data}) => {
+          this.$message.success(data)
+          this.refreshList()
+        })
+      },
+      // 查看
+      view (id) {
+        this.$refs.notifyForm.init('read', id)
+      }
+      // resetSearch () {
+      //   this.$refs.searchForm.resetFields()
+      //   this.$nextTick(() => {
+      //     this.refreshList()
+      //   })
+      // }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 54 - 0
src/views/modules/sys/dashboard/workBench/PendingList.vue

@@ -0,0 +1,54 @@
+<template>
+  <div class="el-scrollbar__wrap wrap-white padding-20">
+    <el-tabs v-model="activeName">
+      <el-tab-pane label="待办事项" name="todoList"style="height: calc(100vh - 210px)" lazy>
+        <todo-list
+          i="todoList"
+          :index="activeName"
+          :num="num"
+        />
+      </el-tab-pane>
+      <el-tab-pane label="已办" name="historyList" style="height: calc(100vh - 210px)" lazy>
+        <history-list
+          i="historyList"
+          :index="activeName"
+        />
+      </el-tab-pane>
+      <el-tab-pane label="我发起的" name="applyList" style="height: calc(100vh - 210px)" lazy>
+        <apply-list
+          i="applyList"
+          :index="activeName"
+        />
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+</template>
+<script>
+  import todoList from '../../../flowable/task/TodoList'
+  import historyList from '../../../flowable/task/HistoryList'
+  import applyList from '../../../flowable/task/ApplyList'
+
+  export default {
+    components: {
+      todoList,
+      historyList,
+      applyList
+    },
+    data () {
+      // eslint-disable-next-line no-unused-expressions,no-unused-vars
+      var num = this.$route.query.num
+      console.log(num)
+      return {
+        activeName: 'todoList',
+        num: num
+      }
+    },
+    created () {
+      if (this.$route.query.activeName) {
+        this.activeName = this.$route.query.activeName
+      }
+    },
+    methods: {
+    }
+  }
+</script>

+ 15 - 7
src/views/modules/sys/mould/SerialnumTplForm.vue

@@ -242,13 +242,17 @@
       },
       // 表单提交
       doSubmit () {
-        this.serialnumTplService.save(this.inputForm).then(({data}) => {
-          this.close()
-          this.$message.success(data)
-          this.$emit('refreshDataList')
-          this.loading = false
-        }).catch(() => {
-          this.loading = false
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.serialnumTplService.save(this.inputForm).then(({data}) => {
+              this.close()
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+          }
         })
       },
       close () {
@@ -303,8 +307,12 @@
       // 变量值处理
       variableValue (row, type) {
         if (type === '1' || type === '2') {
+          row.value = ''
           row.showType = true
         }
+        if (type === '3' || type === '4' || type === '5' || type === '6') {
+          row.showType = false
+        }
         if (type === '7') {
           row.value = new Date().getFullYear()
           row.showType = true

+ 200 - 0
src/views/modules/sys/workContract/InputNumber.vue

@@ -0,0 +1,200 @@
+<template>
+  <div>
+    <div class="input-number-range" :class="{ 'is-disabled': disabled }">
+      <div class="flex">
+        <div class="from">
+          <el-input
+            ref="input_from"
+            v-model="userInputForm"
+            :disabled="disabled"
+            placeholder="最小值"
+            @blur="handleBlurFrom"
+            @focus="handleFocusFrom"
+            @input="handleInputFrom"
+            @change="handleInputChangeFrom"
+          ></el-input>
+        </div>
+        <div class="center">
+          <span>至</span>
+        </div>
+        <div class="to">
+          <el-input
+            ref="input_to"
+            v-model="userInputTo"
+            :disabled="disabled"
+            placeholder="最大值"
+            @blur="handleBlurTo"
+            @focus="handleFocusTo"
+            @input="handleInputTo"
+            @change="handleInputChangeTo"
+          ></el-input>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  export default {
+    name: 'InputNumber',
+
+    props: {
+      // 初始化范围
+      value: { required: true },
+
+      // 是否禁用
+      disabled: {
+        type: Boolean,
+        default: false
+      },
+
+      // 精度参数
+      precision: {
+        type: Number,
+        default: 0,
+        validator (val) {
+          return val >= 0 && val === parseInt(val, 10)
+        }
+      }
+    },
+
+    data () {
+      return {
+        userInputForm: null,
+        userInputTo: null
+      }
+    },
+
+    watch: {
+      value: {
+        immediate: true,
+        handler (value) {
+          /** 初始化范围 */
+          if (value instanceof Array && this.precision !== undefined) {
+            this.userInputForm = typeof value[0] === 'number' ? value[0] : null
+            this.userInputTo = typeof value[1] === 'number' ? value[1] : null
+          }
+        }
+      }
+    },
+
+    methods: {
+      // 根据精度保留数字
+      toPrecision (num, precision) {
+        if (precision === undefined) precision = 0
+        return parseFloat(
+          Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision)
+        )
+      },
+
+      handleBlurFrom (event) {
+        this.$emit('blurfrom', event)
+      },
+
+      handleFocusFrom (event) {
+        this.$emit('focusfrom', event)
+      },
+
+      handleBlurTo (event) {
+        this.$emit('blurto', event)
+      },
+
+      handleFocusTo (event) {
+        this.$emit('focusto', event)
+      },
+
+      handleInputFrom (value) {
+        this.$emit('inputfrom', value)
+      },
+
+      handleInputTo (value) {
+        this.$emit('inputto', value)
+      },
+
+      // from输入框change事件
+      handleInputChangeFrom (value) {
+        // 如果是非数字空返回null
+        if (isNaN(value) || value === '') {
+          this.$emit('input', [null, this.userInputTo])
+          this.$emit('changefrom', this.userInputForm)
+          return
+        }
+
+        // 初始化数字精度
+        this.userInputForm = this.setPrecisionValue(value)
+
+        // 如果from > to 将from值替换成to
+        if (typeof this.userInputTo === 'number') {
+          this.userInputForm =
+            parseFloat(this.userInputForm) <= parseFloat(this.userInputTo)
+              ? this.userInputForm
+              : this.userInputTo
+        }
+        this.$emit('input', [this.userInputForm, this.userInputTo])
+        this.$emit('changefrom', this.userInputForm)
+      },
+
+      // to输入框change事件
+      handleInputChangeTo (value) {
+        // 如果是非数字空返回null
+        if (isNaN(value) || value === '') {
+          this.$emit('input', [this.userInputForm, null])
+          this.$emit('changefrom', this.userInputTo)
+          return
+        }
+
+        // 初始化数字精度
+        this.userInputTo = this.setPrecisionValue(value)
+
+        // 如果to < tfrom 将to值替换成from
+        if (typeof this.userInputForm === 'number') {
+          this.userInputTo =
+            parseFloat(this.userInputTo) >= parseFloat(this.userInputForm)
+              ? this.userInputTo
+              : this.userInputForm
+        }
+        this.$emit('input', [this.userInputForm, this.userInputTo])
+        this.$emit('changeto', this.userInputTo)
+      },
+
+      // 设置成精度数字
+      setPrecisionValue (value) {
+        if (this.precision !== undefined) {
+          const val = this.toPrecision(value, this.precision)
+          return val
+        }
+        return null
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  // 取消element原有的input框样式
+  ::v-deep .el-input--mini .el-input__inner {
+    border: 0px;
+    margin: 0;
+    padding: 0 15px;
+    background-color: transparent;
+  }
+  .input-number-range {
+    background-color: #fff;
+    /*border: 1px solid #dcdfe6;*/
+    border-radius: 4px;
+  }
+  .flex {
+    display: flex;
+    flex-direction: row;
+    width: 100%;
+    justify-content: center;
+    align-items: center;
+    .center {
+      margin-top: 1px;
+    }
+  }
+  .is-disabled {
+    background-color: #eef0f6;
+    border-color: #e4e7ed;
+    color: #c0c4cc;
+    cursor: not-allowed;
+  }
+</style>

+ 675 - 0
src/views/modules/sys/workContract/WorkContractForm.vue

@@ -0,0 +1,675 @@
+<template>
+  <div>
+    <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+             label-width="150px">
+      <el-row  :gutter="0">
+        <el-col :span="10">
+          <el-form-item label="客户名称" prop="clientName" :rules="[
+                {required: true, message:'请输入客户名称', trigger:'blur'}
+              ]">
+            <el-input v-model="inputForm.clientName" placeholder="请输入客户名称"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="2">
+          <el-popover
+            v-model="visable"
+            placement="left"
+            width="400"
+            height="800"
+            trigger="click"
+            :popper-options="{ boundariesElement: 'viewport', removeOnDestroy: true }"
+            ref="pops">
+            <vxe-table
+              border="inner"
+              auto-resize
+              resizable
+              :row-config="{isHover: true}"
+              :data="gridData"
+              :checkbox-config="{}"
+              :row-style="rowStyle"
+              @cell-click="rowClick"
+              :show-header="false"
+            >
+              <vxe-column title="" field="name" ></vxe-column>
+            </vxe-table>
+            <el-button type="info" slot="reference" @click="getPopTable" style="width: 100%" plain>查询</el-button>
+          </el-popover>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="合同名称" prop="name"
+                        :rules="[
+                 {required: true, message:'请输入合同名称', trigger:'blur'}
+               ]">
+            <el-input v-model="inputForm.name" placeholder="请输入合同名称"></el-input>
+          </el-form-item>
+        </el-col>
+
+      </el-row>
+
+      <el-row  :gutter="15">
+
+        <el-col :span="12">
+          <el-form-item label="签订日期" prop="contractDate"
+               :rules="[
+                {required: true, message:'请输入签订日期', trigger:'blur'}
+               ]">
+            <el-date-picker
+              v-model="inputForm.contractDate"
+              type="date"
+              style="width: 100%"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="合同生效日期" prop="effectiveDate"
+                        :rules="[
+                 {required: true, message:'请输入合同生效日期', trigger:'blur'}
+               ]">
+            <el-date-picker
+              v-model="inputForm.effectiveDate"
+              type="date"
+              style="width: 100%"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="合同终止日期" prop="closingDate"
+              :rules="[
+                {required: true, message:'请选择合同终止日期', trigger:'blur'}
+              ]">
+            <el-date-picker
+              v-model="inputForm.closingDate"
+              type="date"
+              style="width: 100%"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="合同类型" prop="contractType"
+              :rules="[
+                {required: true, message:'请选择合同类型', trigger:'blur'}
+              ]">
+            <el-select v-model="inputForm.contractType" placeholder="请选择" style="width:100%;">
+              <el-option
+                v-for="item in $dictUtils.getDictList('contract_type')"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="合同金额类别" prop="contractAmountType"
+               :rules="[
+                  {required: true, message:'请选择合同金额类别', trigger:'blur'}
+               ]">
+            <el-radio-group v-model="inputForm.contractAmountType">
+              <el-radio v-for="item in $dictUtils.getDictList('contract_amount_type')" :label="item.value" >{{item.label}}</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="合同/预计金额(元)" prop="contractAmount" v-if="inputForm.contractAmountType === '1'"
+                        :rules="[
+                  {required: true, message:'请输入合同/预计金额(元)', trigger:'blur'}
+               ]">
+            <el-input v-model="inputForm.contractAmount" placeholder="请输入合同/预计金额(元)"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="对方合同编号" prop="contractOpposite">
+            <el-input v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
+          </el-form-item>
+        </el-col>
+
+      </el-row>
+
+      <el-row>
+        <el-col :span="24">
+          <el-form-item label="收费标准" prop="contractFees">
+            <el-checkbox-group v-model="inputForm.contractFees">
+              <el-checkbox @change="changeContractFee" v-for="item in $dictUtils.getDictList('contract_fee')" :label="item.label" >{{item.label}}</el-checkbox>
+            </el-checkbox-group>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-row>
+        <el-col :span="24">
+          <el-form-item prop="contractFee">
+            <el-input style="width: 100%" placeholder="请选择收费标准" v-model="inputForm.contractFee"></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-row></el-row>
+
+      <el-form-item label="描述内容" prop="describes">
+        <el-input v-model="inputForm.describes"
+                  type="textarea"
+                  :rows="5"
+                  placeholder="请输入描述内容"
+                  show-word-limit>
+        </el-input>
+      </el-form-item>
+
+      <el-form-item label="合同特别条款" prop="contractSpecial">
+        <el-input v-model="inputForm.contractSpecial"
+                  type="textarea"
+                  :rows="5"
+                  placeholder="请输入合同特别条款"
+                  show-word-limit>
+        </el-input>
+      </el-form-item>
+
+      <el-form-item label="备注" prop="remarks">
+        <el-input v-model="inputForm.remarks"
+                  type="textarea"
+                  :rows="5"
+                  placeholder="请输入合同备注"
+                  show-word-limit>
+        </el-input>
+      </el-form-item>
+
+      <el-divider content-position="left"><i class="el-icon-document"></i> 合同附件信息</el-divider>
+      <el-upload  ref="upload" style="display: inline-block; margin-left: 5em; :show-header='status' ;" action=""
+                 :limit="999" :http-request="httpRequest"
+                 multiple
+                 :on-exceed="(files, fileList) =>{
+                  $message.warning(`当前限制选择 999 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
+                 }"
+                 :on-remove="handleRemove"
+                 :show-file-list="false"
+                 :on-change="changes"
+                  :on-progress="uploadVideoProcess"
+                 :file-list="filesArra2">
+        <el-button type="info" size="mini">点击上传</el-button>
+        </el-upload>
+        <div style="height: calc(100% - 80px);margin-top: 10px">
+          <!-- 进度条 -->
+          <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
+        <vxe-table
+          style="margin-left: 5em"
+          border="inner"
+          auto-resize
+          resizable
+          height="200px"
+          :loading="loading"
+          size="small"
+          ref="projectTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :print-config="{}"
+          @sort-change="sortChangeHandle"
+          :sort-config="{remote:true}"
+          :data="dataListNew"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="40"></vxe-column>
+          <vxe-column title="文件名称" field="name">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>
+            </template>
+          </vxe-column>
+          <vxe-column title="创建人" field="createBy"></vxe-column>
+          <vxe-column title="创建时间" field="createDate"></vxe-column>
+          <vxe-column title="操作" width="200px" fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button type="text"  icon="el-icon-delete" size="small" @click="deleteMsgById(scope.row, scope.$rowIndex)">删除</el-button>
+              <el-button type="text"  icon="el-icon-edit" size="small" @click="toHref(scope.row)">下载</el-button>
+            </template>
+          </vxe-column>
+        </vxe-table>
+        </div>
+      </el-form>
+      <el-image-viewer
+        v-if="showViewer"
+        :on-close="closeViewer"
+        :url-list="[url]"
+        zIndex="9999"/>
+  </div>
+</template>
+
+<script>
+  import WorkContractService from '@/api/sys/WorkContractService'
+  import WorkClientService from '@/api/sys/WorkClientService'
+  import OSSSerive, {
+    httpRequest,
+    toHref,
+    openWindowOnUrl,
+    handleRemove,
+    fileName
+  } from '@/api/sys/OSSService'
+  import moment from 'moment'
+  import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
+  export default {
+    data () {
+      return {
+        visable: false,
+        gridData: [],
+        radio: 0,
+        tableData: [],
+        dataList: [],
+        dataListNew: [],
+        title: '',
+        method: '',
+        isSubmit: false,
+        visible: false,
+        loading: false,
+        returnForm: {
+          clientId: '',
+          name: '',
+          contractDate: '',
+          effectiveDate: '',
+          closingDate: '',
+          contractType: '',
+          contractAmountType: '',
+          contractAmount: '',
+          contractOpposite: '',
+          contractFees: [],
+          contractFee: '',
+          describes: '',
+          contractSpecial: '',
+          remarks: '',
+          clientName: '',
+          status: ''
+        },
+        inputForm: {
+          clientId: '',
+          name: '',
+          contractDate: '',
+          effectiveDate: '',
+          closingDate: '',
+          contractType: '',
+          contractAmountType: '',
+          contractAmount: '',
+          contractOpposite: '',
+          contractFees: [],
+          contractFee: '',
+          describes: '',
+          contractSpecial: '',
+          remarks: '',
+          clientName: '',
+          permissionFlag: '',
+          showVi: true,
+          workAttachmentList: [],
+          status: ''
+        },
+        filesArra2: [],
+        fileList: [],
+        isFlag: true,
+        showViewer: false, // 显示查看器
+        url: '',
+        rowurl: '',
+        src: '',
+        onedit: false,
+        type: '',
+        loadProgress: 0, // 动态显示进度条
+        progressFlag: false, // 关闭进度条
+        promi: null
+      }
+    },
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      }
+    },
+    components: {
+      ElImageViewer
+    },
+    ossService: null,
+    workContractService: null,
+    workClientService: null,
+    created () {
+      this.ossService = new OSSSerive()
+      this.workContractService = new WorkContractService()
+      this.workClientService = new WorkClientService()
+    },
+    mounted () {
+      window.onPreview = this.onPreview
+    },
+    watch: {
+      'businessId': {
+        handler (newVal) {
+          if (this.businessId) {
+            this.ossService = new OSSSerive()
+            this.init('edit', this.businessId)
+          } else {
+            this.$nextTick(() => {
+              this.$refs.inputForm.resetFields()
+            })
+          }
+        },
+        immediate: true,
+        deep: false
+      }
+    },
+    methods: {
+      uploadVideoProcess (event, file, fileList) {
+        this.progressFlag = true // 显示进度条
+        this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
+        if (this.loadProgress >= 100) {
+          this.loadProgress = 100
+          setTimeout(() => { this.progressFlag = false }, 1000) // 一秒后关闭进度条
+        }
+      },
+      async toHref (row) {
+        toHref(row)
+      },
+      onPreview (url) {
+        this.url = url
+        this.showViewer = true
+      },
+      // 关闭查看器
+      closeViewer () {
+        this.url = ''
+        this.showViewer = false
+      },
+      init (method, id) {
+        this.dataList = []
+        this.dataListNew = []
+        this.ossService.findFileList(id).then(({data}) => {
+          data.forEach((item) => {
+            item.name = item.attachmentName
+            this.dataList.push(item)
+            this.dataListNew.push(item)
+          })
+        })
+        this.method = method
+        this.inputForm = {
+          clientId: '',
+          name: '',
+          contractDate: '',
+          effectiveDate: '',
+          closingDate: '',
+          contractType: '',
+          contractAmountType: '',
+          contractAmount: '',
+          contractOpposite: '',
+          contractFees: [],
+          contractFee: '',
+          describes: '',
+          contractSpecial: '',
+          remarks: '',
+          clientName: '',
+          filesArra2: [],
+          fileList: [],
+          isFlag: true,
+          showViewer: false, // 显示查看器
+          url: '',
+          rowurl: '',
+          src: '',
+          showVi: true,
+          status: ''
+        }
+        this.inputForm.id = id
+        if (method === 'add') {
+          this.inputForm.contractAmountType = '1'
+          this.title = `新建合同登记`
+        } else if (method === 'edit') {
+          this.title = '修改合同登记'
+        } else if (method === 'view') {
+          this.inputForm.showVi = false
+          this.title = '查看合同登记'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.upload.clearFiles()
+          this.$refs.inputForm.resetFields()
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.workContractService.findById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.inputForm.contractFees = []
+            })
+          }
+          this.loading = false
+        })
+      },
+      // 表单提交
+      // 暂存
+      async saveForm1 () {
+        this.$refs['inputForm'].validate(async (valid) => {
+          if (valid) {
+            this.loading = true
+            this.inputForm.workAttachmentList = []
+            this.dataListNew.forEach((item) => {
+              if (item.id === null || item.id === undefined || item.id === '') {
+                item.url = item.raw.url
+              }
+              item.attachmentFlag = 'workContract'
+              item.fileSize = item.size
+              item.attachmentName = item.name
+              this.inputForm.workAttachmentList.push(item)
+            })
+            this.inputForm.status = '1'
+            let _p = null
+            await this.workContractService.save(this.inputForm).then(({data}) => {
+              this.loading = false
+              _p = new Promise((resolve, reject) => {
+                resolve({
+                  'businessTable': data.businessTable,
+                  'businessId': data.businessId,
+                  'inputForm': this.inputForm
+                })
+                this.$refs.inputForm.resetFields()
+              })
+            }).catch(() => {
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            })
+            return _p
+          }
+        })
+      },
+      // 送审
+      saveForm (callback) {
+        this.$refs['inputForm'].validate(async (valid) => {
+          if (valid) {
+            this.loading = true
+            this.inputForm.workAttachmentList = []
+            this.dataListNew.forEach((item) => {
+              if (item.id === null || item.id === undefined || item.id === '') {
+                item.url = item.raw.url
+              }
+              item.attachmentFlag = 'workContract'
+              item.fileSize = item.size
+              item.attachmentName = item.name
+              this.inputForm.workAttachmentList.push(item)
+            })
+            this.inputForm.status = '2'
+            await this.workContractService.save(this.inputForm).then(({data}) => {
+              callback(data.businessTable, data.businessId, this.inputForm)
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            }).catch(() => {
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            })
+          }
+        })
+      },
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.visible = false
+        this.showVi = true
+      },
+      httpRequest (file) {
+        httpRequest(file, fileName(file), 'workContract')
+      },
+      handleRemove () {
+        this.fileList = handleRemove()
+      },
+      changes (file, fileList) {
+        this.dataListNew = []
+        this.dataList.forEach((item) => {
+          this.dataListNew.push(item)
+        })
+        fileList.forEach((item) => {
+          item.createDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          item.createBy = this.$store.state.user.name
+          this.dataListNew.push(item)
+        })
+        const isLt2M = file.size / 1024 / 1024 < 300
+        if (isLt2M === false) {
+          this.$message.error('文件大小不能超过 ' + 300 + 'M !')
+          this.fileList = []
+          this.filesArra2 = []
+        }
+      },
+      async showFile (row) {
+        await openWindowOnUrl(row)
+      },
+      // 排序
+      sortChangeHandle (column) {
+        this.orders = []
+        if (column.order != null) {
+          this.orders.push({column: this.$utils.toLine(column.prop), asc: column.order === 'ascending'})
+        }
+        this.refreshList()
+      },
+      deleteMsgById (row, index) {
+        this.dataListNew.splice(index, 1)
+        if (row.id !== null && row.id !== '' && row.id !== undefined) {
+          this.ossService.deleteMsgById(row.id)
+        }
+      },
+      twoDecimalPlaces (num) {
+        let str = num.toString()
+        var len1 = str.substr(0, 1)
+        var len2 = str.substr(1, 1)
+        // eslint-disable-next-line eqeqeq
+        if (str.length > 1 && len1 == 0 && len2 != '.') {
+          str = str.substr(1, 1)
+        }
+        // eslint-disable-next-line eqeqeq
+        if (len1 == '.') {
+          str = ''
+        }
+        // eslint-disable-next-line eqeqeq
+        if (str.indexOf('.') != -1) {
+          var str_ = str.substr(str.indexOf('.') + 1)
+          // eslint-disable-next-line eqeqeq
+          if (str_.indexOf('.') != -1) {
+            str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
+          }
+          if (str_.length > 4) {
+            this.$message.warning(`金额小数点后只能输入四位,请正确输入!`)
+            return (str = '')
+          }
+        }
+        // eslint-disable-next-line no-useless-escape
+        str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
+        return str
+      },
+      positiveInteger (num) {
+        let str = num.toString()
+        var len1 = str.substr(0, 1)
+        var len2 = str.substr(1, 1)
+        // eslint-disable-next-line eqeqeq
+        if (str.length > 1 && len1 == 0 && len2 != '.') {
+          str = str.substr(1, 1)
+        }
+        // eslint-disable-next-line eqeqeq
+        if (len1 == '.') {
+          str = ''
+        }
+        // eslint-disable-next-line no-useless-escape
+        str = str.replace(/[^\d^]+/g, '') // 保留数字
+        return str
+      },
+      tableRowClassName ({row, rowIndex}) {
+        row.index = rowIndex
+      },
+      handleRadioChange (val) {
+        if (val) {
+          this.radio = val.index
+        }
+      },
+      // 关闭窗口时调用
+      closeXTable () {
+        this.closePop()
+      },
+      rowStyle (event) {
+        return 'cursor:pointer;'
+      },
+      async rowClick (event) {
+        let id = this.gridData[event.rowIndex].id
+        this.inputForm.clientId = id
+        console.log('id', id)
+        await this.workClientService.findById(id).then((data) => {
+          console.log('data', data)
+          this.inputForm.clientName = data.data.workClientInfo.name
+        })
+        this.visable = false
+      },
+      async getPopTable () {
+        let name = this.inputForm.clientName
+        await this.workClientService.list(name).then(({data}) => {
+          console.log('data', data)
+          this.gridData = data.records
+        })
+        this.$refs.pops.updatePopper()
+      },
+      closePop () {
+        this.visable = false
+      },
+      changeContractFee () {
+        let fee = ''
+        let fees = this.inputForm.contractFees
+        if (fees.length > 0) {
+          fees.forEach(i => {
+            fee = fee + ';' + i
+            this.inputForm.contractFee = fee.substring(1, fee.length)
+          })
+        }
+      }
+    }
+  }
+</script>
+
+<style>
+  .tid_40 .vxe-body--column .vxe-cell{
+    padding: 1px;
+    text-align: center;
+  }
+  .tid_40 .vxe-header--row .col--last{
+    text-align: center;
+  }
+  .tid_45 .vxe-body--column .vxe-cell{
+    padding: 1px;
+    text-align: center;
+  }
+  .tid_45 .vxe-header--row .col--last{
+    text-align: center;
+  }
+</style>
+
+<style scoped>
+  .avatar{
+    height: 100px;
+  }
+  .el-divider__text {
+    font-weight: bold;
+    font-size: 16px;
+  }
+</style>

+ 633 - 0
src/views/modules/sys/workContract/WorkContractForm2.vue

@@ -0,0 +1,633 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1200px"
+      @close="close(),closeXTable()"
+      @keyup.enter.native="doSubmit"
+      :visible.sync="visible">
+        <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+           label-width="150px">
+
+          <el-row  :gutter="0">
+
+            <el-col :span="10">
+              <el-form-item label="客户名称" prop="clientName" :rules="[
+                    {required: true, message:'请输入客户名称', trigger:'blur'}
+                  ]">
+                <el-input v-model="inputForm.clientName" placeholder="请输入客户名称"></el-input>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="2">
+              <el-popover
+                v-model="visable"
+                placement="left"
+                width="400"
+                height="800"
+                trigger="click"
+                :popper-options="{ boundariesElement: 'viewport', removeOnDestroy: true }"
+                ref="pops">
+                <vxe-table
+                  border="inner"
+                  auto-resize
+                  resizable
+                  :row-config="{isHover: true}"
+                  :data="gridData"
+                  :checkbox-config="{}"
+                  :row-style="rowStyle"
+                  @cell-click="rowClick"
+                  :show-header="false"
+                >
+                  <vxe-column title="" field="entname" ></vxe-column>
+                </vxe-table>
+                <el-button type="info" slot="reference" @click="getPopTable" style="width: 100%" plain>查询</el-button>
+              </el-popover>
+            </el-col>
+
+            <el-col :span="12">
+              <el-form-item label="合同名称" prop="name"
+                            :rules="[
+                     {required: true, message:'请输入合同名称', trigger:'blur'}
+                   ]">
+                <el-input v-model="inputForm.name" placeholder="请输入合同名称"></el-input>
+              </el-form-item>
+            </el-col>
+
+          </el-row>
+
+          <el-row  :gutter="15">
+
+            <el-col :span="12">
+              <el-form-item label="签订日期" prop="contractDate"
+                   :rules="[
+                    {required: true, message:'请输入签订日期', trigger:'blur'}
+                   ]">
+                <el-date-picker
+                  v-model="inputForm.contractDate"
+                  type="date"
+                  style="width: 418px"
+                  placeholder="选择日期">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="12">
+              <el-form-item label="合同生效日期" prop="effectiveDate"
+                            :rules="[
+                     {required: true, message:'请输入合同生效日期', trigger:'blur'}
+                   ]">
+                <el-date-picker
+                  v-model="inputForm.effectiveDate"
+                  type="date"
+                  style="width: 418px"
+                  placeholder="选择日期">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="12">
+              <el-form-item label="合同终止日期" prop="closingDate"
+                  :rules="[
+                    {required: true, message:'请选择合同终止日期', trigger:'blur'}
+                  ]">
+                <el-date-picker
+                  v-model="inputForm.closingDate"
+                  type="date"
+                  style="width: 418px"
+                  placeholder="选择日期">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="12">
+              <el-form-item label="合同类型" prop="contractType"
+                  :rules="[
+                    {required: true, message:'请选择合同类型', trigger:'blur'}
+                  ]">
+                <el-select v-model="inputForm.contractType" placeholder="请选择" style="width:100%;">
+                  <el-option
+                    v-for="item in $dictUtils.getDictList('contract_type')"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="12">
+              <el-form-item label="合同金额类别" prop="contractAmountType"
+                   :rules="[
+                      {required: true, message:'请选择合同金额类别', trigger:'blur'}
+                   ]">
+                <el-radio-group v-model="inputForm.contractAmountType">
+                  <el-radio v-for="item in $dictUtils.getDictList('contract_amount_type')" :label="item.value" >{{item.label}}</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="12">
+              <el-form-item label="合同/预计金额(元)" prop="contractAmount" v-if="inputForm.contractAmountType === '1'"
+                            :rules="[
+                      {required: true, message:'请输入合同/预计金额(元)', trigger:'blur'}
+                   ]">
+                <el-input v-model="inputForm.contractAmount" placeholder="请输入合同/预计金额(元)"></el-input>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="12">
+              <el-form-item label="对方合同编号" prop="contractOpposite">
+                <el-input v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
+              </el-form-item>
+            </el-col>
+
+          </el-row>
+
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="收费标准" prop="contractFees">
+                <el-checkbox-group v-model="inputForm.contractFees" @change="changeContractFee">
+                  <el-checkbox  v-for="item in $dictUtils.getDictList('contract_fee')" :label="item.label" >{{item.label}}</el-checkbox>
+                </el-checkbox-group>
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          <el-row>
+            <el-col :span="12">
+              <el-form-item prop="contractFee">
+                <el-input style="width: 500px" placeholder="请选择收费标准" v-model="inputForm.contractFee"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          <el-row></el-row>
+
+          <el-form-item label="描述内容" prop="describes">
+            <el-input v-model="inputForm.describes"
+                      type="textarea"
+                      :rows="5"
+                      placeholder="请输入描述内容"
+                      show-word-limit>
+            </el-input>
+          </el-form-item>
+
+          <el-form-item label="合同特别条款" prop="contractSpecial">
+            <el-input v-model="inputForm.contractSpecial"
+                      type="textarea"
+                      :rows="5"
+                      placeholder="请输入合同特别条款"
+                      show-word-limit>
+            </el-input>
+          </el-form-item>
+
+          <el-form-item label="备注" prop="remarks">
+            <el-input v-model="inputForm.remarks"
+                      type="textarea"
+                      :rows="5"
+                      placeholder="请输入合同备注"
+                      show-word-limit>
+            </el-input>
+          </el-form-item>
+
+          <el-divider content-position="left"><i class="el-icon-document"></i> 合同附件信息</el-divider>
+          <el-upload  ref="upload" style="display: inline-block; margin-left: 5em; :show-header='status' ;" action=""
+                     :limit="999" :http-request="httpRequest"
+                     multiple
+                     :on-exceed="(files, fileList) =>{
+                      $message.warning(`当前限制选择 999 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
+                     }"
+                     :on-remove="handleRemove"
+                     :show-file-list="false"
+                     :on-change="changes"
+                      :on-progress="uploadVideoProcess"
+                     :file-list="filesArra2">
+            <el-button type="info" size="mini" v-if="inputForm.permissionFlag&&inputForm.showVi">点击上传</el-button>
+            </el-upload>
+            <div style="height: calc(100% - 80px);margin-top: 10px">
+              <!-- 进度条 -->
+              <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
+            <vxe-table
+              style="margin-left: 5em"
+              border="inner"
+              auto-resize
+              resizable
+              height="200px"
+              :loading="loading"
+              size="small"
+              ref="projectTable"
+              show-header-overflow
+              show-overflow
+              highlight-hover-row
+              :menu-config="{}"
+              :print-config="{}"
+              @sort-change="sortChangeHandle"
+              :sort-config="{remote:true}"
+              :data="dataListNew"
+              :checkbox-config="{}">
+              <vxe-column type="seq" width="40"></vxe-column>
+              <vxe-column title="文件名称" field="name">
+                <template slot-scope="scope">
+                  <el-link  type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>
+                </template>
+              </vxe-column>
+              <vxe-column title="创建人" field="createBy"></vxe-column>
+              <vxe-column title="创建时间" field="createDate"></vxe-column>
+              <vxe-column title="操作" width="200px" fixed="right" align="center">
+                <template  slot-scope="scope">
+                  <el-button type="text"  icon="el-icon-delete" size="small" v-if="inputForm.permissionFlag&&inputForm.showVi" @click="deleteMsgById(scope.row, scope.$rowIndex)">删除</el-button>
+                  <el-button type="text"  icon="el-icon-edit" size="small" @click="toHref(scope.row)">下载</el-button>
+                </template>
+              </vxe-column>
+            </vxe-table>
+            </div>
+          </el-form>
+        <el-image-viewer
+          v-if="showViewer"
+          :on-close="closeViewer"
+          :url-list="[url]"
+          zIndex="9999"/>
+        <span slot="footer" class="dialog-footer">
+          <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick :disabled="isSubmit">确定</el-button>
+          <el-button size="small" @click="close(),closeXTable()" icon="el-icon-circle-close">关闭</el-button>
+        </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import WorkContractService from '@/api/sys/WorkContractService'
+  import WorkClientService from '@/api/sys/WorkClientService'
+  import OSSSerive, {
+    httpRequest,
+    toHref,
+    openWindowOnUrl,
+    handleRemove,
+    fileName
+  } from '@/api/sys/OSSService'
+  import moment from 'moment'
+  import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
+  export default {
+    data () {
+      return {
+        visable: false,
+        gridData: [],
+        radio: 0,
+        tableData: [],
+        dataList: [],
+        dataListNew: [],
+        title: '',
+        method: '',
+        isSubmit: false,
+        visible: false,
+        loading: false,
+        returnForm: {
+          clientId: '',
+          name: '',
+          contractDate: '',
+          effectiveDate: '',
+          closingDate: '',
+          contractType: '',
+          contractAmountType: '',
+          contractAmount: '',
+          contractOpposite: '',
+          contractFees: [],
+          contractFee: '',
+          describes: '',
+          contractSpecial: '',
+          remarks: '',
+          clientName: '',
+          permissionFlag: '',
+          showVi: true,
+          workAttachmentList: []
+        },
+        inputForm: {
+          clientId: '',
+          name: '',
+          contractDate: '',
+          effectiveDate: '',
+          closingDate: '',
+          contractType: '',
+          contractAmountType: '',
+          contractAmount: '',
+          contractOpposite: '',
+          contractFees: [],
+          contractFee: '',
+          describes: '',
+          contractSpecial: '',
+          remarks: '',
+          clientName: '',
+          permissionFlag: '',
+          showVi: true,
+          workAttachmentList: []
+        },
+        filesArra2: [],
+        fileList: [],
+        isFlag: true,
+        showViewer: false, // 显示查看器
+        url: '',
+        rowurl: '',
+        src: '',
+        showVi: true,
+        onedit: false,
+        type: '',
+        loadProgress: 0, // 动态显示进度条
+        progressFlag: false // 关闭进度条
+      }
+    },
+    components: {
+      ElImageViewer
+    },
+    ossService: null,
+    workContractService: null,
+    workClientService: null,
+    created () {
+      this.ossService = new OSSSerive()
+      this.workContractService = new WorkContractService()
+      this.workClientService = new WorkClientService()
+    },
+    mounted () {
+      window.onPreview = this.onPreview
+    },
+    methods: {
+      uploadVideoProcess (event, file, fileList) {
+        this.progressFlag = true // 显示进度条
+        this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
+        if (this.loadProgress >= 100) {
+          this.loadProgress = 100
+          setTimeout(() => { this.progressFlag = false }, 1000) // 一秒后关闭进度条
+        }
+      },
+      async toHref (row) {
+        toHref(row)
+      },
+      onPreview (url) {
+        this.url = url
+        this.showViewer = true
+      },
+      // 关闭查看器
+      closeViewer () {
+        this.url = ''
+        this.showViewer = false
+      },
+      init (method, id) {
+        this.dataList = []
+        this.dataListNew = []
+        this.ossService.findFileList(id).then(({data}) => {
+          data.forEach((item) => {
+            item.name = item.attachmentName
+            this.dataList.push(item)
+            this.dataListNew.push(item)
+          })
+        })
+        this.method = method
+        this.inputForm = {
+          clientId: '',
+          name: '',
+          contractDate: '',
+          effectiveDate: '',
+          closingDate: '',
+          contractType: '',
+          contractAmountType: '',
+          contractAmount: '',
+          contractOpposite: '',
+          contractFees: [],
+          contractFee: '',
+          describes: '',
+          contractSpecial: '',
+          remarks: '',
+          clientName: '',
+          filesArra2: [],
+          fileList: [],
+          isFlag: true,
+          showViewer: false, // 显示查看器
+          url: '',
+          rowurl: '',
+          src: '',
+          showVi: true,
+          type: ''
+        }
+        this.inputForm.id = id
+        if (method === 'add') {
+          this.inputForm.contractAmountType = '1'
+          this.title = `新建合同登记`
+        } else if (method === 'edit') {
+          this.title = '修改合同登记'
+        } else if (method === 'view') {
+          this.inputForm.showVi = false
+          this.title = '查看合同登记'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.upload.clearFiles()
+          this.$refs.inputForm.resetFields()
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.workContractService.findById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.inputForm.contractFees = []
+            })
+          }
+          this.loading = false
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        console.log('1111')
+        if (this.progressFlag === true) {
+          this.$message.warning('文件正在上传中,请稍等')
+          return
+        }
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.inputForm.workAttachmentList = []
+            this.dataListNew.forEach((item) => {
+              if (item.id === null || item.id === undefined || item.id === '') {
+                item.url = item.raw.url
+              }
+              item.attachmentFlag = 'workContract'
+              item.fileSize = item.size
+              item.attachmentName = item.name
+              this.inputForm.workAttachmentList.push(item)
+            })
+
+            this.workContractService.save(this.inputForm).then(({data}) => {
+              this.close()
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      },
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.visible = false
+        this.inputForm.showVi = true
+      },
+      httpRequest (file) {
+        httpRequest(file, fileName(file), 'workContract')
+      },
+      handleRemove () {
+        this.fileList = handleRemove()
+      },
+      changes (file, fileList) {
+        this.dataListNew = []
+        this.dataList.forEach((item) => {
+          this.dataListNew.push(item)
+        })
+        fileList.forEach((item) => {
+          item.createDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          item.createBy = this.$store.state.user.name
+          this.dataListNew.push(item)
+        })
+        const isLt2M = file.size / 1024 / 1024 < 300
+        if (isLt2M === false) {
+          this.$message.error('文件大小不能超过 ' + 300 + 'M !')
+          this.fileList = []
+          this.filesArra2 = []
+        }
+      },
+      async showFile (row) {
+        await openWindowOnUrl(row)
+      },
+      // 排序
+      sortChangeHandle (column) {
+        this.orders = []
+        if (column.order != null) {
+          this.orders.push({column: this.$utils.toLine(column.prop), asc: column.order === 'ascending'})
+        }
+        this.refreshList()
+      },
+      deleteMsgById (row, index) {
+        this.dataListNew.splice(index, 1)
+        if (row.id !== null && row.id !== '' && row.id !== undefined) {
+          this.ossService.deleteMsgById(row.id)
+        }
+      },
+      twoDecimalPlaces (num) {
+        let str = num.toString()
+        var len1 = str.substr(0, 1)
+        var len2 = str.substr(1, 1)
+        // eslint-disable-next-line eqeqeq
+        if (str.length > 1 && len1 == 0 && len2 != '.') {
+          str = str.substr(1, 1)
+        }
+        // eslint-disable-next-line eqeqeq
+        if (len1 == '.') {
+          str = ''
+        }
+        // eslint-disable-next-line eqeqeq
+        if (str.indexOf('.') != -1) {
+          var str_ = str.substr(str.indexOf('.') + 1)
+          // eslint-disable-next-line eqeqeq
+          if (str_.indexOf('.') != -1) {
+            str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
+          }
+          if (str_.length > 4) {
+            this.$message.warning(`金额小数点后只能输入四位,请正确输入!`)
+            return (str = '')
+          }
+        }
+        // eslint-disable-next-line no-useless-escape
+        str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
+        return str
+      },
+      positiveInteger (num) {
+        let str = num.toString()
+        var len1 = str.substr(0, 1)
+        var len2 = str.substr(1, 1)
+        // eslint-disable-next-line eqeqeq
+        if (str.length > 1 && len1 == 0 && len2 != '.') {
+          str = str.substr(1, 1)
+        }
+        // eslint-disable-next-line eqeqeq
+        if (len1 == '.') {
+          str = ''
+        }
+        // eslint-disable-next-line no-useless-escape
+        str = str.replace(/[^\d^]+/g, '') // 保留数字
+        return str
+      },
+      tableRowClassName ({row, rowIndex}) {
+        row.index = rowIndex
+      },
+      handleRadioChange (val) {
+        if (val) {
+          this.radio = val.index
+        }
+      },
+      // 关闭窗口时调用
+      closeXTable () {
+        this.closePop()
+      },
+      rowStyle (event) {
+        return 'cursor:pointer;'
+      },
+      async rowClick (event) {
+        let id = this.gridData[event.rowIndex].companyid
+        await this.workClientService.enterpriseTicketInfo(id).then((data) => {
+          this.inputForm.clientName = data.data.ENTNAME
+          this.inputForm.clientId = data.data.COMPANYID
+        })
+        this.visable = false
+      },
+      async getPopTable () {
+        let name = this.inputForm.clientName
+        if (name !== null && name !== undefined && name !== '') {
+          await this.workClientService.enterpriseSearchByName(name).then(({data}) => {
+            this.gridData = data.data.items
+          })
+        }
+        this.$refs.pops.updatePopper()
+      },
+      closePop () {
+        this.visable = false
+      },
+      changeContractFee () {
+        let fee = ''
+        let fees = this.inputForm.contractFees
+        if (fees.length > 0) {
+          fees.forEach(i => {
+            fee = fee + ';' + i
+            this.inputForm.contractFee = fee.substring(1, fee.length)
+          })
+        }
+      }
+    }
+  }
+</script>
+
+<style>
+  .tid_40 .vxe-body--column .vxe-cell{
+    padding: 1px;
+    text-align: center;
+  }
+  .tid_40 .vxe-header--row .col--last{
+    text-align: center;
+  }
+  .tid_45 .vxe-body--column .vxe-cell{
+    padding: 1px;
+    text-align: center;
+  }
+  .tid_45 .vxe-header--row .col--last{
+    text-align: center;
+  }
+</style>
+
+<style scoped>
+  .avatar{
+    height: 100px;
+  }
+  .el-divider__text {
+    font-weight: bold;
+    font-size: 16px;
+  }
+</style>

+ 336 - 0
src/views/modules/sys/workContract/WorkContractList.vue

@@ -0,0 +1,336 @@
+<template>
+  <div class="page">
+      <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+       <!-- 搜索框-->
+       <el-form-item label="客户名称" prop="clientName">
+              <el-input size="small" v-model="searchForm.clientName" placeholder="请输入客户名称" clearable></el-input>
+       </el-form-item>
+
+        <el-form-item label="合同名称" prop="name">
+          <el-input size="small" v-model="searchForm.name" placeholder="请输入合同名称" clearable></el-input>
+        </el-form-item>
+
+        <el-form-item label="签订日期" prop="contractDates">
+          <el-date-picker
+            v-model="searchForm.contractDates"
+            type="datetimerange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期">
+          </el-date-picker>
+        </el-form-item>
+
+        <el-form-item label="合同状态" prop="status">
+          <el-select v-model="searchForm.status" placeholder="请选择" style="width:100%;">
+            <el-option
+              v-for="item in $dictUtils.getDictList('approval_type')"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+<!--        <el-form-item label="归档状态" prop="filedType">-->
+<!--          <el-select v-model="searchForm.filedType" placeholder="请选择" style="width:100%;">-->
+<!--            <el-option-->
+<!--              v-for="item in $dictUtils.getDictList('filed_type')"-->
+<!--              :key="item.value"-->
+<!--              :label="item.label"-->
+<!--              :value="item.value">-->
+<!--            </el-option>-->
+<!--          </el-select>-->
+<!--        </el-form-item>-->
+
+        <el-form-item label="合同金额" prop="contractAmounts">
+          <InputNumber :disabled="false" :precision="num" v-model="searchForm.contractAmounts"></InputNumber>
+        </el-form-item>
+
+        <el-form-item label="创建人" prop="createBy">
+          <SelectUserTree
+            ref="companyTree"
+            :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+            :url="`/sys/user/treeUserDataAllOffice?type=2`"
+            :value="searchForm.createBy"
+            :clearable="true"
+            :accordion="true"
+            @getValue="(value) => {searchForm.createBy=value}"/>
+        </el-form-item>
+
+        <el-form-item>
+          <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+          <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+        </el-form-item>
+      </el-form>
+
+     <div class="bg-white top">
+        <vxe-toolbar :refresh="{query: refreshList}" import export print custom>
+          <template #buttons>
+            <el-button v-if="hasPermission('sys:project:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
+            <el-button v-if="hasPermission('sys:project:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" plain>删除</el-button>
+          </template>
+        </vxe-toolbar>
+        <div style="height: calc(100% - 80px);">
+            <vxe-table
+                border="inner"
+                auto-resize
+                resizable
+                height="auto"
+                :loading="loading"
+                size="small"
+                ref="workContractTable"
+                show-header-overflow
+                show-overflow
+                highlight-hover-row
+                :menu-config="{}"
+                :print-config="{}"
+                @sort-change="sortChangeHandle"
+                :sort-config="{remote:true}"
+                :data="dataList"
+                :checkbox-config="{}">
+                <vxe-column type="seq" width="40"></vxe-column>
+                <vxe-column type="checkbox" width="40px"></vxe-column>
+
+                <vxe-column width="100px" title="合同编号" field="no"></vxe-column>
+                <vxe-column width="200px" title="合同名称" field="name">
+                  <template slot-scope="scope">
+                    <el-link  type="primary" :underline="false" v-if="hasPermission('sys:workContract:edit')" @click="view(scope.row.id)">{{scope.row.name}}</el-link>
+                    <el-link  type="primary" :underline="false" v-else-if="hasPermission('sys:workContract:view')" @click="view(scope.row.id)">{{scope.row.name}}</el-link>
+                    <span v-else>{{scope.row.name}}</span>
+                  </template>
+                </vxe-column>
+                <vxe-column width="100px" title="案卷号" field="filedNo" >
+                  <template slot-scope="scope">
+                    <el-link  type="primary" :underline="false" v-if="hasPermission('sys:workContract:edit')" @click="view(scope.row.id)">{{scope.row.filedNo}}</el-link>
+                    <el-link  type="primary" :underline="false" v-else-if="hasPermission('sys:workContract:view')" @click="view(scope.row.id)">{{scope.row.filedNo}}</el-link>
+                    <span v-else>{{scope.row.filedNo}}</span>
+                  </template>
+                </vxe-column>
+                <vxe-column width="200px" title="客户名称" field="clientName" >
+                  <template slot-scope="scope">
+                    <el-link  type="primary" :underline="false" v-if="hasPermission('sys:work_client:edit')" @click="viewInfo(scope.row.clientId)">{{scope.row.clientName}}</el-link>
+                    <el-link  type="primary" :underline="false" v-else-if="hasPermission('sys:work_client:view')" @click="viewInfo(scope.row.clientId)">{{scope.row.clientName}}</el-link>
+                    <span v-else>{{scope.row.clientName}}</span>
+                  </template>
+                </vxe-column>
+                <vxe-column width="100px" title="合同金额(元)" field="contractAmount"></vxe-column>
+                <vxe-column width="100px" title="创建人" field="createBy"></vxe-column>
+                <vxe-column width="150px" title="签订日期" field="contractDate"></vxe-column>
+                <vxe-column width="100px"  title="状态" field="status" >
+                  <template slot-scope="scope">
+                    {{ $dictUtils.getDictLabel("approval_type", scope.row.status, '-') }}
+                  </template>
+                </vxe-column>
+<!--                <vxe-column width="100px"  title="归档状态" field="filedType" >-->
+<!--                  <template slot-scope="scope">-->
+<!--                    {{ $dictUtils.getDictLabel("filed_type", scope.row.filedType, '-') }}-->
+<!--                  </template>-->
+<!--                </vxe-column>-->
+<!--                <vxe-column width="100px"  title="借用状态" field="borrowType" >-->
+<!--                  <template slot-scope="scope">-->
+<!--                    {{ $dictUtils.getDictLabel("borrow_type", scope.row.borrowType, '-') }}-->
+<!--                  </template>-->
+<!--                </vxe-column>-->
+
+                <vxe-column title="操作" width="200px" fixed="right" align="center">
+                    <template  slot-scope="scope">
+                      <el-button v-if="hasPermission('sys:workContract:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row.id)">查看</el-button>
+                      <el-button v-if="hasPermission('sys:workContract:edit') && scope.row.status === '1'" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row)">修改</el-button>
+                      <el-button v-if="hasPermission('sys:workContract:del') && scope.row.status === '1'" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+                      <el-button v-if="hasPermission('sys:workContract:back') && scope.row.status === '2'" type="text"  icon="el-icon-back" size="small" @click="del(scope.row.id)">撤回</el-button>
+                    </template>
+                </vxe-column>
+            </vxe-table>
+          <vxe-pager
+            background
+            size="small"
+            :current-page="tablePage.currentPage"
+            :page-size="tablePage.pageSize"
+            :total="tablePage.total"
+            :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+            :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+            @page-change="currentChangeHandle">
+          </vxe-pager>
+        </div>
+     </div>
+        <!-- 弹窗, 新增 / 修改 -->
+    <WorkContractForm2 ref="workContractForm2" @refreshDataList="refreshList"></WorkContractForm2>
+    <WorkClientForm ref="workClientForm" @refreshDataList="refreshList"></WorkClientForm>
+  </div>
+</template>
+
+<script>
+  import InputNumber from './InputNumber.vue'
+  import WorkContractForm2 from './WorkContractForm2'
+  import WorkClientForm from '../workClient/WorkClientForm'
+  import WorkContractService from '@/api/sys/WorkContractService'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import TaskService from '@/api/flowable/TaskService'
+  export default {
+    data () {
+      return {
+        visible: false,
+        num: 0,
+        searchForm: {
+          clientName: '',
+          name: '',
+          contractDates: [],
+          type: '',
+          filedType: '',
+          contractAmounts: [],
+          createBy: ''
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        loading: false
+      }
+    },
+    workContractService: null,
+    taskService: null,
+    created () {
+      this.workContractService = new WorkContractService()
+      this.taskService = new TaskService()
+    },
+    components: {
+      InputNumber,
+      WorkContractForm2,
+      WorkClientForm,
+      SelectUserTree
+    },
+    activated () {
+      this.refreshList()
+    },
+    computed: {
+      userName () {
+        return JSON.parse(localStorage.getItem('user')).name
+      }
+    },
+
+    methods: {
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.workContractService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          'itemType': '1',
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.refreshList()
+      },
+      // 排序
+      sortChangeHandle (column) {
+        this.tablePage.orders = []
+        if (column.order != null) {
+          this.tablePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
+        }
+        this.refreshList()
+      },
+      // 新增
+      add () {
+        this.start()
+      },
+      // 修改
+      edit (row) {
+        // row.id || this.$refs.workContractTable.getCheckboxRecords().map(item => {
+        //   return item.id
+        // })[0]
+        // this.$refs.workContractForm2.init('edit', id)
+        this.start1(row)
+      },
+      // 查看
+      view (id) {
+        this.$refs.workContractForm2.init('view', id)
+      },
+      // 客户信息查看
+      viewInfo (id) {
+        this.$refs.workClientForm2.init('view', id)
+      },
+      // 删除
+      del (id) {
+        let ids = id || this.$refs.workContractTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.workContractService.remove(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+        })
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      },
+      start () {
+        // 读取流程表单
+        let tabTitle = `发起流程【合同登记新建】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
+        this.taskService.getTaskDef({ procDefId: 'Process_1662628133027:6:582ad0be-3329-11ed-bee1-b40ede887c28',
+          status: 'startAndHold'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                procDefId: 'Process_1662628133027:6:582ad0be-3329-11ed-bee1-b40ede887c28',
+                procDefKey: 'Process_1662628133027',
+                status: 'startAndHold',
+                title: tabTitle,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle
+              }
+            })
+          })
+      },
+      start1 (row) {
+        // 读取流程表单
+        let tabTitle = `发起流程【合同登记新建】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
+        this.taskService.getTaskDef({ procDefId: 'Process_1662628133027:6:582ad0be-3329-11ed-bee1-b40ede887c28',
+          businessId: row.id,
+          businessTable: 'work_contract_info',
+          status: 'startAndHold'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                procDefId: 'Process_1662628133027:6:582ad0be-3329-11ed-bee1-b40ede887c28',
+                procDefKey: 'Process_1662628133027',
+                status: 'startAndHold',
+                title: tabTitle,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle,
+                businessTable: 'work_contract_info',
+                businessId: row.id
+              }
+            })
+          })
+      }
+    }
+  }
+</script>