lizhenhao 2 роки тому
батько
коміт
e57b17586f

+ 21 - 0
src/api/notify/NotifyService.js

@@ -39,4 +39,25 @@ export default class NotifyService {
       params: params
     })
   }
+  updateStatusById (data) {
+    return request({
+      url: '/notify/updateStatusById',
+      method: 'post',
+      data: data
+    })
+  }
+  pushNotifyRecord (id) {
+    return request({
+      url: '/notify/pushNotifyRecord',
+      method: 'post',
+      data: {id: id}
+    })
+  }
+  saveForm (inputForm) {
+    return request({
+      url: `/notify/saveForm`,
+      method: 'post',
+      data: inputForm
+    })
+  }
 }

+ 7 - 0
src/api/sys/OfficeService.js

@@ -40,4 +40,11 @@ export default class OfficeService {
       params: params
     })
   }
+  listTree (params) {
+    return request({
+      url: '/sys/office/list_tree',
+      method: 'get',
+      params: params
+    })
+  }
 }

+ 153 - 0
src/components/officeTreeSelect/index.vue

@@ -0,0 +1,153 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="340px"
+      append-to-body
+      height="500px"
+      @close="close"
+      @keyup.enter.native="getOffice"
+      :visible.sync="visibleChoose">
+      <div style="height: calc(100%);">
+        <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @submit.native.prevent>
+          <!-- 搜索框-->
+          <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="list()" size="small" >查询</el-button>
+<!--            <el-button @click="resetSearch()" size="small" >重置</el-button>-->
+          </el-form-item>
+        </el-form>
+
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="350px"
+          :loading="loading"
+          size="small"
+          ref="officeTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :print-config="{}"
+          @sort-change=""
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :show-header="false"
+          :row-config="{isCurrent: true}"
+          :tree-config="{transform: true, rowField: 'id', parentField: 'parentId', expandAll: true}"
+          :checkbox-config="{trigger: 'row'}">
+          <vxe-column type="checkbox" width="40px"></vxe-column>
+          <vxe-column title="部门" align="left" field="name" tree-node></vxe-column>
+        </vxe-table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="getOffice()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import InputNumber from '@/views/modules/sys/workContract/InputNumber.vue'
+  import OfficeService from '@/api/sys/OfficeService'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visibleChoose: false,
+        loading: false,
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        dataList: [],
+        searchForm: {
+          name: ''
+        }
+      }
+    },
+    officeService: null,
+    created () {
+      this.officeService = new OfficeService()
+    },
+    components: {
+      SelectUserTree,
+      InputNumber
+    },
+    methods: {
+      init (deputy) {
+        this.title = '部门选择'
+        this.visibleChoose = true
+        this.list()
+      },
+      // 表单提交
+      getOffice () {
+        let rows = this.$refs.officeTable.getCheckboxRecords()
+        if (this.commonJS.isEmpty(rows)) {
+          this.$message.error('请至少选择一条数据')
+          return
+        }
+        let list = []
+        if (!this.commonJS.isEmpty(rows)) {
+          rows.forEach(item => {
+            let p = {
+              id: item.id,
+              name: item.name
+            }
+            list.push(p)
+          })
+        }
+        this.close()
+        this.$emit('getOfficeChoose', list)
+      },
+      list () {
+        this.dataList = []
+        this.loading = true
+        this.officeService.listTree({
+          'current': 1,
+          'size': -1,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        this.$refs.searchForm.resetFields()
+        this.visibleChoose = false
+      }
+    }
+  }
+</script>
+<style scoped>
+  /deep/ .el-dialog__body {
+    padding-top: 0;
+  }
+  /deep/ .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
+    margin-bottom: 0px;
+  }
+</style>

+ 102 - 0
src/components/userSelectButton/DividerButton.vue

@@ -0,0 +1,102 @@
+<template>
+<div style="float: left">
+  <el-button style="margin-left: 20px" type="primary"  size="mini" :disabled="disabled" :readonly="readonly" @click="showUserSelect" plain>
+    选择
+  </el-button>
+    <user-select ref="userSelect" @doSubmit="selectUsersToInput" :limit="limit" ></user-select>
+</div>
+</template>
+<script>
+import userSelect from './UserSelectDialog'
+import UserService from '@/api/sys/UserService'
+export default {
+  data () {
+    return {
+      name: '',
+      labelValue: this.value,
+      selectData: []
+    }
+  },
+  props: {
+    limit: Number,
+    value: String,
+    userName: String,
+    size: {
+      type: String,
+      default: () => { return 'small' }
+    },
+    readonly: {
+      type: Boolean,
+      default: () => { return false }
+    },
+    disabled: {
+      type: Boolean,
+      default: () => { return false }
+    }
+  },
+  components: {
+    userSelect
+  },
+  userService: null,
+  beforeCreate () {
+    this.userService = new UserService()
+  },
+  watch: {
+    value: {
+      handler (newVal) {
+        this.selectData = []
+        if (newVal) {
+          newVal.split(',').forEach((id) => {
+            this.userService.queryById(id).then(({data}) => {
+              if (data && data.id !== '') {
+                this.selectData.push(data)
+              }
+            })
+          })
+        }
+      },
+      immediate: true,
+      deep: false
+    },
+    selectData: {
+      handler (newVal) {
+        this.name = newVal.map(user => { return user.name }).join(',')
+      },
+      immediate: false,
+      deep: false
+    },
+    userName: {
+      handler (newVal) {
+        this.name = newVal
+      },
+      immediate: false,
+      deep: false
+    }
+  },
+  methods: {
+    selectUsersToInput (users) {
+      this.selectData = users
+      this.labelValue = users.map(user => { return user.id }).join(',')
+      this.name = users.map(user => { return user.name }).join(',')
+      this.$emit('getValue', this.labelValue, this.name)
+    },
+    changeName () {
+      this.$emit('getValue', null, this.name)
+    },
+    showUserSelect () {
+      this.$refs.userSelect.init()
+    }
+  }
+}
+</script>
+<style>
+  .el-form-item__content .el-input-group {
+      vertical-align: middle;
+  }
+ .el-tag + .el-tag {
+    margin-left: 5px;
+    margin-bottom: 5px;
+  }
+</style>
+
+

+ 1 - 1
src/views/modules/klgBase/questions/KlgBaseQuestionsDetailForm.vue

@@ -498,7 +498,7 @@
     z-index: 1 !important;
   }
   /deep/ .w-e-menu {
-    z-index: 1 !important;
+    z-index: 2 !important;
   }
   /deep/ .wtext {
     height: 400px

+ 1 - 1
src/views/modules/klgBase/questions/KlgBaseQuestionsForm.vue

@@ -483,7 +483,7 @@
     z-index: 1 !important;
   }
   /deep/ .w-e-menu {
-    z-index: 1 !important;
+    z-index: 2 !important;
   }
   /deep/ .wtext {
     height: 400px

+ 22 - 16
src/views/modules/notify/MyNotifyList.vue

@@ -11,7 +11,7 @@
           </el-form-item>
       </el-form>
        <div class="bg-white top">
-      <vxe-toolbar :refresh="{query: refreshList}" export print custom>
+      <vxe-toolbar :refresh="{query: refreshList}"  custom>
       </vxe-toolbar>
      <div style="height: calc(100% - 80px);">
         <vxe-table
@@ -34,36 +34,42 @@
             :data="dataList"
             :checkbox-config="{}">
             <vxe-column type="seq" width="60" title="序号"></vxe-column>
-            <vxe-column type="checkbox"  width="40px"></vxe-column>
-            <vxe-column  title="标题" field="title" sortable>
+<!--            <vxe-column type="checkbox"  width="40px"></vxe-column>-->
+            <vxe-column min-width="180px" title="标题" field="title" align="center">
               <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" sortable>
+            <vxe-column min-width="180px" title="类型" field="type" align="center">
                 <template slot-scope="scope">
                   {{ $dictUtils.getDictLabel("oa_notify_type", scope.row.type, '-') }}
                 </template>
             </vxe-column>
-            <vxe-column  title="内容" field="content" sortable></vxe-column>
-            <vxe-column  title="附件" field="files" sortable>
-              <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" sortable>
+            <vxe-column min-width="180px" title="查阅状态" field="status" align="center">
               <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" sortable></vxe-column>
-            <vxe-column title="操作" width="200px" fixed="right" align="center">
+             <vxe-column min-width="180px" title="发布者" field="createBy.name" align="center"></vxe-column>
+          <vxe-column min-width="180px" title="通告时间" field="beginDate" align="center" >
+            <template slot-scope="scope">
+                 <span v-if="scope.row.notifyType === '0'">
+                   {{commonJS.isNotEmpty(scope.row.beginDate) && commonJS.isNotEmpty(scope.row.endDate)
+                   ?
+                   moment(scope.row.beginDate).format('YYYY-MM-DD') + " 至 " + moment(scope.row.endDate).format('YYYY-MM-DD')
+                   :
+                   ''}}
+                 </span>
+              <span v-else-if="scope.row.notifyType === '1'">
+                   长期通告
+                 </span>
+            </template>
+          </vxe-column>
+            <vxe-column title="操作" width="80" 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>
+                    <el-button  type="text" size="mini" @click="view(scope.row.id)">查看</el-button>
                 </template>
             </vxe-column>
         </vxe-table>

+ 526 - 151
src/views/modules/notify/NotifyForm.vue

@@ -1,205 +1,390 @@
-<template>
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
   <div>
     <el-dialog
       :title="title"
       :close-on-click-modal="false"
-      append-to-body
       v-dialogDrag
+      width="1400px"
+      height="500px"
+      @close="close"
+      append-to-body
+      @keyup.enter.native=""
       :visible.sync="visible">
-      <el-form size="small" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view' || method === 'read'?'readonly':''" :disabled="method==='view' || method === 'read'" @keyup.enter.native="doSubmit()"
-               label-width="120px" @submit.native.prevent>
-        <el-row  :gutter="15">
-          <el-col :span="24">
-            <el-form-item label="类型" prop="type"
-                          :rules="[
+      <el-form size="small" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view' || method === 'read'?'readonly':''" :disabled="method==='view' || method === 'read'"
+             label-width="80px" @submit.native.prevent>
+      <el-row  :gutter="15">
+        <el-col :span="12">
+          <el-form-item label="通告状态" prop="notifyType"
+                        :rules="[
+                  {required: true, message:'通告状态不能为空', trigger:'blur'}
+                 ]">
+            <el-select size="medium" @change="changeNotifyType" v-model="inputForm.notifyType" placeholder="请选择"  style="width: 100%;">
+              <el-option
+                v-for="item in $dictUtils.getDictList('oa_notify_status')"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12" v-if="inputForm.notifyType === '0'">
+          <el-form-item label="通告时间" prop="dates"
+                        :rules="[
+                                {required: true, message:'通告时间不能为空', trigger:'blur'}
+                   ]">
+            <el-date-picker
+              size="medium"
+              style="width: 100%"
+              placement="bottom-start"
+              format="yyyy-MM-dd HH:mm:ss"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              v-model="inputForm.dates"
+              type="datetimerange"
+              range-separator="至"
+              @input="daterangeChange"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="类型" prop="type"
+                        :rules="[
                   {required: true, message:'类型不能为空', trigger:'blur'}
                  ]">
-              <el-select v-model="inputForm.type" placeholder="请选择"  style="width: 100%;">
-                <el-option
-                  v-for="item in $dictUtils.getDictList('oa_notify_type')"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="标题" prop="title"
-                          :rules="[
+            <el-select size="medium" v-model="inputForm.type" placeholder="请选择"  style="width: 100%;">
+              <el-option
+                v-for="item in $dictUtils.getDictList('oa_notify_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="title"
+                        :rules="[
                   {required: true, message:'标题不能为空', trigger:'blur'}
                  ]">
-              <el-input v-model="inputForm.title" placeholder="请填写标题"     ></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="内容" prop="content"
-                          :rules="[
-                  {required: true, message:'内容不能为空', trigger:'blur'}
-                 ]">
-              <el-input type="textarea"   :rows="8" v-model="inputForm.content" placeholder="请填写内容"     ></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="附件" prop="files">
-              <el-upload ref="files"
-                         :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/notify/notify`"
-                         :headers="{token: $cookie.get('token')}"
-                         :on-preview="(file, fileList) => {$window.location.href = file.url}"
-                         :on-success="(response, file, fileList) => {
-                       inputForm.files = fileList.map(item => item.url || item.response.url).join('|')
-                    }"
-                         :on-error="(response) => {
-                      $message.error(response.message)
-                    }"
-                         :on-remove="(file, fileList) => {
-                      $http.delete(`/sys/file/webupload/deleteByUrl?url=${file.url}`).then(({data}) => {
-                        $message.success(data)
-                      })
-                      inputForm.files = fileList.map(item => item.url).join('|')
-                    }"
-                         :before-remove="(file, fileList) => {
-                      return $confirm(`确定移除 ${file.name}?`)
-                    }"
-                         multiple
-                         :limit="5"
-                         :on-exceed="(files, fileList) =>{
-                      $message.warning(`当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
-                    }"
-                         :file-list="filesArra">
-                <el-button size="small" type="primary">点击上传</el-button>
-                <div slot="tip" class="el-upload__tip">添加相关附件</div>
-              </el-upload>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24"  v-if="method !== 'read'">
-            <el-form-item label="状态" prop="status"
-                          :rules="[
-                  {required: true, message:'状态不能为空', trigger:'blur'}
-                 ]">
-              <el-radio-group v-model="inputForm.status">
-                <el-radio v-for="item in $dictUtils.getDictList('oa_notify_status')" :label="item.value" :key="item.id">{{item.label}}</el-radio>
-              </el-radio-group>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="接收人" prop="notifyRecordIds"
-                          :rules="[
-                  {required: true, message:'接收人不能为空', trigger:'blur'}
+            <el-input size="medium" v-model="inputForm.title" placeholder="请填写标题"     ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="文号" prop="no"
+                        :rules="[
                  ]">
-              <user-select  :value="inputForm.notifyRecordIds" @getValue='(value) => {inputForm.notifyRecordIds=value}'></user-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24" v-if="method ==='view' && inputForm.status === '1'">
-            <el-form-item label="接收人">
-              <el-table
-                size="small"
-                :data="notifyRecordDTOList"
-                style="width: 100%">
-                <el-table-column
-                  prop="userDTO.name"
-                  label="接收人"
-                  width="180">
-                </el-table-column>
-                <el-table-column
-                  prop="userDTO.officeDTO.name"
-                  label="接收部门"
-                  width="180">
-                </el-table-column>
-                <el-table-column
-                  prop="readFlag"
-                  label="阅读状态">
-                  <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>
-                </el-table-column>
-                <el-table-column
-                  prop="readDate"
-                  label="阅读时间"
-                  width="180">
-                </el-table-column>
-              </el-table>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
+            <el-input size="medium" v-model="inputForm.no" placeholder="请填写文号"     ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="创建人" prop="createBy.name"
+                        :rules="[
+                   ]">
+            <el-input size="medium" :disabled="true" v-model="inputForm.createBy.name" placeholder="请填写创建人" clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="所属部门" prop="officeId"
+                        :rules="[
+                   ]">
+            <SelectTree
+              ref="officeTree"
+              :props="{
+                          value: 'id',             // ID字段名
+                          label: 'name',         // 显示名称
+                          children: 'children'    // 子级字段名
+                        }"
+              :url="`/sys/office/treeData?type=2`"
+              :value="inputForm.officeId"
+              :accordion="true"
+              :disabled="true"
+              size="medium"
+              @getValue="(value) => {inputForm.officeId=value}"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="内容" prop="content"
+                        :rules="[
+                          {required: true, message:'内容不能为空', trigger:'blur'}
+                   ]">
+            <WangEditor ref="contentEditor" v-model="inputForm.content" @getUrl="(url, lsUrl) => {
+                        inputForm.editorFilesDTOList.push({temporaryUrl: lsUrl, url: url})
+                        }"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-divider content-position="left">
+        <div style="float:left;"><i class="el-icon-document"></i> 通告范围-部门</div>
+        <div style="float:left;">
+          <el-button style="margin-left: 20px" :disabled="true" type="primary"  size="mini" @click="openOfficeChoose" plain>
+            选择
+          </el-button>
+        </div>
+      </el-divider>
+      <el-row  :gutter="15" >
+        <el-form :disabled="true">
+          <vxe-table
+            border
+            :column-config="{resizable: true}"
+            show-overflow
+            show-footer
+            :key="tableKeyOffice"
+            ref="officeTable"
+            class="vxe-table-element"
+            :data="inputForm.pluginNotifyOfficesDTOList"
+            style=""
+            @cell-click=""
+            @edit-closed=""
+            highlight-current-row
+          >
+            <vxe-table-column align="center" field="officeName" title="部门"></vxe-table-column>
+            <vxe-table-column align="center" title="操作" width="100">
+              <template v-slot="scope">
+                <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'office')">删除</el-button>
+              </template>
+            </vxe-table-column>
+          </vxe-table>
+        </el-form>
+      </el-row>
+
+      <div style="margin-top: 30px">
+        <el-divider content-position="left" >
+          <div style="float: left"><i class="el-icon-document"></i> 通告范围-成员</div>
+          <UserSelectButton ref="userSelectButton" :disabled="true" @getValue="(value) => {openUserChoose(value)}"></UserSelectButton>
+        </el-divider>
+      </div>
+      <el-row  :gutter="15">
+        <el-form :disabled="true">
+          <vxe-table
+            border
+            :column-config="{resizable: true}"
+            show-overflow
+            show-footer
+            :key="tableKeyUser"
+            ref="userTable"
+            class="vxe-table-element"
+            :data="inputForm.pluginNotifyUserDTOList"
+            style=""
+            @cell-click=""
+            @edit-closed=""
+            highlight-current-row
+          >
+            <vxe-table-column align="center" field="userName" title="姓名"></vxe-table-column>
+            <vxe-table-column align="center" field="officeName" title="部门"></vxe-table-column>
+            <vxe-table-column align="center" title="操作" width="100">
+              <template v-slot="scope">
+                <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'user')">删除</el-button>
+              </template>
+            </vxe-table-column>
+          </vxe-table>
+        </el-form>
+      </el-row>
+    </el-form>
+      <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
       <span slot="footer" class="dialog-footer">
-      <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
-      <el-button size="small" type="primary" v-if="method != 'view' && method != 'read'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" v-if="method === 'edit'" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
     </span>
     </el-dialog>
+
+    <OfficeTreeSelect ref="officeTreeSelect" @getOfficeChoose="getOfficeChoose"></OfficeTreeSelect>
   </div>
 </template>
 
 <script>
   import UserSelect from '@/components/userSelect'
   import NotifyService from '@/api/notify/NotifyService'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import WangEditor from '@/components/editor/WangEditor'
+  import OfficeTreeSelect from '@/components/officeTreeSelect'
+  import UserSelectButton from '@/components/userSelectButton/DividerButton'
+  import UserService from '@/api/sys/UserService'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
   export default {
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      },
+      status: {
+        type: String,
+        default: ''
+      }
+    },
     data () {
       return {
         title: '',
         method: '',
-        visible: false,
         loading: false,
-        filesArra: [],
-        notifyRecordDTOList: [],
         inputForm: {
+          createBy: {
+            id: '',
+            name: ''
+          },
+          createDate: '',
           id: '',
           type: '',
           title: '',
           content: '',
           files: '',
           status: '',
-          notifyRecordIds: ''
+          remarks: '',
+          notifyType: '',
+          no: '',
+          beginDate: '',
+          endDate: '',
+          dates: '',
+          officeId: '',
+          workAttachmentDtoList: [],
+          pluginNotifyOfficesDTOList: [],
+          pluginNotifyUserDTOList: [],
+          editorFilesDTOList: []
+        },
+        keyWatch: '',
+        tableKeyOffice: '',
+        tableKeyUser: '',
+        visible: false
+      }
+    },
+    computed: {
+      bus: {
+        get () {
+          return this.businessId
+        },
+        set (val) {
+          this.businessId = val
+        }
+      }
+    },
+    watch: {
+      'keyWatch': {
+        handler (newVal) {
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
+          } else {
+            this.$nextTick(() => {
+              this.$refs.inputForm.resetFields()
+            })
+          }
         }
       }
     },
     components: {
-      UserSelect
+      UserSelect,
+      SelectTree,
+      WangEditor,
+      OfficeTreeSelect,
+      UserSelectButton,
+      UpLoadComponent
     },
     notifyService: null,
+    userService: null,
     created () {
       this.notifyService = new NotifyService()
+      this.userService = new UserService()
     },
     methods: {
+      getKeyWatch (keyWatch) {
+        this.keyWatch = keyWatch
+      },
       init (method, id) {
         this.method = method
+        this.inputForm = {
+          createBy: {
+            id: '',
+            name: ''
+          },
+          createDate: '',
+          id: '',
+          type: '',
+          title: '',
+          content: '',
+          files: '',
+          status: '',
+          remarks: '',
+          notifyType: '',
+          no: '',
+          beginDate: '',
+          endDate: '',
+          dates: ['', ''],
+          officeId: '',
+          workAttachmentDtoList: [],
+          pluginNotifyOfficesDTOList: [],
+          pluginNotifyUserDTOList: [],
+          editorFilesDTOList: []
+        }
         this.inputForm.id = id
         if (method === 'add') {
-          this.title = `新建通知`
+          this.title = '新建通告'
         } else if (method === 'edit') {
-          this.title = '修改通知'
+          this.title = '修改通'
         } else if (method === 'view') {
-          this.title = '查看通知'
+          this.title = '查看通'
         } else if (method === 'read') {
-          this.title = '阅读通知'
+          this.title = '阅读通'
         }
         this.visible = true
         this.loading = false
         this.$nextTick(() => {
           this.$refs.inputForm.resetFields()
-          this.$refs.files.clearFiles()
-          this.filesArra = []
-          if (method === 'edit' || method === 'view' || method === 'read') { // 修改或者查看
-            this.loading = true
-            this.notifyService.query({
-              id: this.inputForm.id,
-              isSelf: method === 'read'
-            }).then(({data}) => {
-              this.inputForm = this.recover(this.inputForm, data)
-              this.notifyRecordDTOList = data.notifyRecordDTOList
-              this.inputForm.files.split('|').forEach((item) => {
-                if (item.trim().length > 0) {
-                  this.filesArra.push({name: decodeURIComponent(item.substring(item.lastIndexOf('/') + 1)), url: item})
-                }
-              })
-              if (method === 'read') {
-                this.$emit('refreshDataList')
-              }
-              this.loading = false
-            })
-          }
+          this.loading = true
+          this.$refs.contentEditor.clear()
+          this.notifyService.query({id: this.inputForm.id, isSelf: method === 'read'}).then(({data}) => {
+            this.$refs.uploadComponent.clearUpload()
+            this.inputForm = this.recover(this.inputForm, data)
+            this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            if (this.method === 'view' || this.method === 'read') {
+              this.$refs.contentEditor.disable()
+            } else {
+              this.$refs.contentEditor.enable()
+            }
+            if (this.commonJS.isNotEmpty(this.inputForm.content)) {
+              this.$refs.contentEditor.init(this.inputForm.content)
+            }
+            if (this.commonJS.isEmpty(this.inputForm.editorFilesDTOList)) {
+              this.inputForm.editorFilesDTOList = []
+            }
+            if (this.commonJS.isEmpty(this.inputForm.createBy.id)) {
+              this.inputForm.createBy.id = JSON.parse(localStorage.getItem('user')).id
+              this.inputForm.createBy.name = JSON.parse(localStorage.getItem('user')).name
+            }
+            if (this.commonJS.isEmpty(this.inputForm.officeId)) {
+              this.inputForm.officeId = JSON.parse(localStorage.getItem('user')).officeDTO.id
+            }
+            this.inputForm.dates = ['', '']
+            if (this.commonJS.isNotEmpty(this.inputForm.beginDate) && this.commonJS.isNotEmpty(this.inputForm.endDate)) {
+              this.inputForm.dates[0] = this.inputForm.beginDate
+              this.inputForm.dates[1] = this.inputForm.endDate
+            }
+            if (this.commonJS.isEmpty(this.inputForm.notifyType)) {
+              this.inputForm.notifyType = '0'
+            }
+            if (this.commonJS.isEmpty(this.inputForm.pluginNotifyOfficesDTOList)) {
+              this.inputForm.pluginNotifyOfficesDTOList = []
+            }
+            if (this.commonJS.isEmpty(this.inputForm.pluginNotifyUserDTOList)) {
+              this.inputForm.pluginNotifyUserDTOList = []
+            }
+            if (this.method === 'view' || this.method === 'read') {
+              this.$refs.uploadComponent.newUpload('view', this.inputForm.workAttachmentDtoList, 'notify')
+            } else {
+              this.$refs.uploadComponent.newUpload('edit', this.inputForm.workAttachmentDtoList, 'notify')
+            }
+            if (this.commonJS.isEmpty(this.inputForm.workAttachmentDtoList)) {
+              this.inputForm.workAttachmentDtoList = []
+            }
+            if (method === 'read') {
+              this.$emit('refreshDataList')
+            }
+            this.loading = false
+          })
         })
       },
       // 表单提交
@@ -207,17 +392,207 @@
         this.$refs['inputForm'].validate((valid) => {
           if (valid) {
             this.loading = true
-            this.notifyService.save(this.inputForm).then(({data}) => {
+            if (this.$refs.uploadComponent.checkProgress()) {
               this.loading = false
-              this.visible = false
-              this.$message.success(data)
-              this.$emit('refreshDataList')
+              return
+            }
+            if (this.commonJS.isEmpty(this.inputForm.pluginNotifyOfficesDTOList) && this.commonJS.isEmpty(this.inputForm.pluginNotifyUserDTOList)) {
+              this.$message.error('通告范围(部门或成员),至少填写一项')
+              this.loading = false
+              throw new Error('通告范围(部门或成员),至少填写一项')
+            }
+            this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
+            if (this.commonJS.isNotEmpty(this.inputForm.dates)) {
+              this.inputForm.beginDate = this.inputForm.dates[0]
+              this.inputForm.endDate = this.inputForm.dates[1]
+              if (this.commonJS.isNotEmpty(this.inputForm.beginDate) && this.commonJS.isNotEmpty(this.inputForm.endDate)) {
+                if (this.inputForm.beginDate === this.inputForm.endDate) {
+                  if (this.inputForm.notifyType === '0') {
+                    this.$message.error('通告起止时间不可以相同')
+                    this.loading = false
+                    throw new Error('通告起止时间不可以相同')
+                  }
+                }
+              } else {
+                if (this.inputForm.notifyType === '0') {
+                  this.$message.error('请填写通告时间')
+                  this.loading = false
+                  throw new Error('请填写通告时间')
+                }
+              }
+            } else {
+              this.inputForm.beginDate = ''
+              this.inputForm.endDate = ''
+              if (this.inputForm.notifyType === '0') {
+                this.$message.error('请填写通告时间')
+                this.loading = false
+                throw new Error('请填写通告时间')
+              }
+            }
+            if (this.commonJS.isEmpty(this.inputForm.content)) {
+              this.$message.error('请填写内容')
+              this.loading = false
+              throw new Error('请填写内容')
+            }
+            this.getEditorFilesDTOList()
+            this.notifyService.saveForm(this.inputForm).then(({data}) => {
+              this.loading = false
+              this.close()
             }).catch(() => {
               this.loading = false
             })
           }
         })
+      },
+      close () {
+        this.$refs.uploadComponent.clearUpload()
+        this.$refs.contentEditor.enable()
+        this.$emit('refreshDataList')
+        this.visible = false
+        this.inputForm = {
+          createBy: {
+            id: '',
+            name: ''
+          },
+          createDate: '',
+          id: '',
+          type: '',
+          title: '',
+          content: '',
+          files: '',
+          status: '',
+          remarks: '',
+          notifyType: '',
+          no: '',
+          beginDate: '',
+          endDate: '',
+          dates: '',
+          officeId: '',
+          workAttachmentDtoList: [],
+          pluginNotifyOfficesDTOList: [],
+          pluginNotifyUserDTOList: [],
+          editorFilesDTOList: []
+        }
+      },
+      changeNotifyType () {
+        this.inputForm.beginDate = ''
+        this.inputForm.endDate = ''
+        this.inputForm.dates = ['', '']
+      },
+      daterangeChange (e) {
+        this.$nextTick(() => {
+          this.$forceUpdate()
+        })
+      },
+      getEditorFilesDTOList () {
+        let a = []
+        if (this.commonJS.isNotEmpty(this.inputForm.editorFilesDTOList)) {
+          this.inputForm.content = this.inputForm.content.replace(/&amp;/, '&')
+          console.log('content', this.inputForm.content)
+          console.log('editorFilesDTOList', this.inputForm.editorFilesDTOList)
+          this.inputForm.editorFilesDTOList.forEach((item) => {
+            console.log('尽')
+            if (this.inputForm.content.includes(item.temporaryUrl)) {
+              a.push(item)
+              console.log('a', a)
+            }
+          })
+        }
+        setTimeout(() => {
+          this.inputForm.editorFilesDTOList = []
+          a.forEach((item) => {
+            console.log('editorFilesDTOList', this.inputForm.editorFilesDTOList)
+            this.inputForm.editorFilesDTOList.push(item)
+          })
+        }, 200)
+      },
+      openOfficeChoose () {
+        this.$refs.officeTreeSelect.init()
+      },
+      getOfficeChoose (list) {
+        let _this = this
+        const wait = () => new Promise((resolve, reject) => {
+          if (_this.commonJS.isEmpty(_this.inputForm.pluginNotifyOfficesDTOList)) {
+            _this.inputForm.pluginNotifyOfficesDTOList = []
+            resolve()
+          } else if (_this.commonJS.isEmpty(list)) {
+            resolve()
+          } else {
+            list.forEach((item, index) => {
+              _this.inputForm.pluginNotifyOfficesDTOList.forEach((office, rowIndex) => {
+                if (item.id === office.officeId || item.name === office.officeName) {
+                  this.$refs.officeTable.remove(office)
+                  this.inputForm.pluginNotifyOfficesDTOList.splice(rowIndex, 1)
+                  this.tableKeyOffice = Math.random()
+                }
+              })
+            })
+            resolve()
+          }
+        })
+        wait().then(() => {
+          list.forEach((item) => {
+            let d = {
+              officeName: item.name,
+              officeId: item.id
+            }
+            this.$refs.officeTable.insertAt(d)
+            this.inputForm.pluginNotifyOfficesDTOList.push(d)
+            this.tableKeyOffice = Math.random()
+          })
+        })
+      },
+      removeEvent (row, rowIndex, type) {
+        if (type === 'office') {
+          this.$refs.officeTable.remove(row)
+          this.inputForm.pluginNotifyOfficesDTOList.splice(rowIndex, 1)
+          this.tableKeyOffice = Math.random()
+        }
+        if (type === 'user') {
+          this.$refs.userTable.remove(row)
+          this.inputForm.pluginNotifyUserDTOList.splice(rowIndex, 1)
+          this.tableKeyUser = Math.random()
+        }
+      },
+      openUserChoose (value) {
+        if (this.commonJS.isNotEmpty(value)) {
+          this.userService.queryDetailList(value).then(({data}) => {
+            if (this.commonJS.isEmpty(this.inputForm.pluginNotifyUserDTOList)) {
+              this.inputForm.pluginNotifyUserDTOList = []
+            }
+            data.forEach(item => {
+              this.inputForm.pluginNotifyUserDTOList.forEach((user, rowIndex) => {
+                if (this.commonJS.isEmpty(item.name) || user.userName === item.name || user.userId === item.id) {
+                  this.$refs.userTable.remove(user)
+                  this.inputForm.pluginNotifyUserDTOList.splice(rowIndex, 1)
+                  this.tableKeyUser = Math.random()
+                }
+              })
+            })
+            data.forEach(item => {
+              let param = {
+                userId: item.id,
+                userName: this.commonJS.isEmpty(item.name) ? '' : item.name,
+                officeName: this.commonJS.isEmpty(item.officeDTO) ? '' : this.commonJS.isEmpty(item.officeDTO.name) ? '' : item.officeDTO.name
+              }
+              this.$refs.userTable.insertAt(param)
+              this.inputForm.pluginNotifyUserDTOList.push(param)
+              this.tableKeyUser = Math.random()
+            })
+          })
+        }
       }
     }
   }
 </script>
+<style scoped>
+  /deep/ .w-e-text-container {
+    z-index: 1 !important;
+  }
+  /deep/ .w-e-menu {
+    z-index: 2 !important;
+  }
+  /deep/ .wtext {
+    height: 400px
+  }
+</style>

+ 179 - 35
src/views/modules/notify/NotifyList.vue

@@ -11,11 +11,10 @@
           </el-form-item>
       </el-form>
      <div class="bg-white top">
-      <vxe-toolbar :refresh="{query: refreshList}" export print custom>
+      <vxe-toolbar :refresh="{query: refreshList}" custom>
         <template #buttons>
-          <el-button v-if="hasPermission('notify:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
-          <el-button v-if="hasPermission('notify:edit')" type="warning" size="small" icon="el-icon-edit-outline" @click="edit()" :disabled="$refs.notifyTable && $refs.notifyTable.getCheckboxRecords().length !== 1" plain>修改</el-button>
-          <el-button v-if="hasPermission('notify:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.notifyTable && $refs.notifyTable.getCheckboxRecords().length === 0" plain>删除</el-button>
+          <el-button v-if="hasPermission('notify:add')" type="primary" size="small" icon="el-icon-plus" @click="start()">新建</el-button>
+<!--          <el-button v-if="hasPermission('notify:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.notifyTable && $refs.notifyTable.getCheckboxRecords().length === 0" plain>删除</el-button>-->
         </template>
       </vxe-toolbar>
      <div style="height: calc(100% - 80px);">
@@ -39,52 +38,61 @@
             :data="dataList"
             :checkbox-config="{}">
             <vxe-column type="seq" width="60" title="序号"></vxe-column>
-            <vxe-column type="checkbox"  width="40px"></vxe-column>
-            <vxe-column  title="标题" field="title" sortable>
+<!--            <vxe-column type="checkbox"  width="40px"></vxe-column>-->
+            <vxe-column min-width="100px" title="标题" field="title" align="center" >
               <template slot-scope="scope">
-                <el-link  type="primary" :underline="false" v-if="hasPermission('notify:edit') && scope.row.status==='0'" @click="edit(scope.row.id)">{{scope.row.title}}</el-link>
-                <el-link  type="primary" :underline="false" v-else-if="hasPermission('notify:view')"  @click="view(scope.row.id)">{{scope.row.title}}</el-link>
+                <el-link  type="primary" :underline="false" v-if="hasPermission('notify:view')"  @click="view(scope.row.id)">{{scope.row.title}}</el-link>
                 <span v-else>{{scope.row.title}}</span>
+<!--                <span >{{scope.row.title}}</span>-->
               </template>
             </vxe-column>
-            <vxe-column  title="类型" field="type" sortable>
+            <vxe-column min-width="100px" title="类型" field="type" align="center" >
                 <template slot-scope="scope">
                   {{ $dictUtils.getDictLabel("oa_notify_type", scope.row.type, '-') }}
                 </template>
             </vxe-column>
-            <vxe-column  title="内容" field="content" sortable></vxe-column>
-            <vxe-column  title="附件" field="files" sortable>
-              <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>
+            <vxe-column min-width="100px" title="查阅状态" field="readNum" align="center" >
+               <template slot-scope="scope">
+                 <span v-if="scope.row.status === '5'">
+                   {{commonJS.isNotEmpty(scope.row.readNum) && commonJS.isNotEmpty(scope.row.unReadNum) ? scope.row.readNum + " / " + (parseInt(scope.row.readNum) + parseInt(scope.row.unReadNum)) : '0 / 0'}}
+                 </span>
+                 <span v-else>
+                   通告未发起
+                 </span>
               </template>
             </vxe-column>
-            <vxe-column  title="状态" field="status" sortable>
+             <vxe-column  min-width="100px"title="发布者" field="createBy.name" align="center" ></vxe-column>
+            <vxe-column min-width="180px" title="通告时间" field="beginDate" align="center" >
               <template slot-scope="scope">
-                <el-tag type="success" v-if="scope.row.status === '1'"> {{ $dictUtils.getDictLabel("oa_notify_status", scope.row.status, '-') }}</el-tag>
-                <el-tag type="danger" v-if="scope.row.status === '0'"> {{ $dictUtils.getDictLabel("oa_notify_status", scope.row.status, '-') }}</el-tag>
+                 <span v-if="scope.row.notifyType === '0'">
+                   {{commonJS.isNotEmpty(scope.row.beginDate) && commonJS.isNotEmpty(scope.row.endDate)
+                   ?
+                   moment(scope.row.beginDate).format('YYYY-MM-DD') + " 至 " + moment(scope.row.endDate).format('YYYY-MM-DD')
+                   :
+                   ''}}
+                 </span>
+                <span v-else-if="scope.row.notifyType === '1'">
+                   长期通告
+                 </span>
               </template>
             </vxe-column>
-            <vxe-column  title="查阅状态" field="status" sortable>
-               <template slot-scope="scope">
-                {{scope.row.readNum + "/" + (parseInt(scope.row.readNum) + parseInt(scope.row.unReadNum))}}
+            <vxe-column  width="100px"align="center" fixed="right" title="状态" field="status" >
+              <template slot-scope="scope">
+                <el-button  type="text" @click="detail(scope.row)" effect="dark" size="mini"
+                            :type="$dictUtils.getDictLabel('cw_status_flag', scope.row.status, '-')">
+                  {{$dictUtils.getDictLabel("cw_status", scope.row.status, '-')}}
+                </el-button>
               </template>
             </vxe-column>
-             <vxe-column  title="发布者" field="createBy.name" sortable></vxe-column>
 
-            <vxe-column title="操作" width="200px" fixed="right" align="center">
+            <vxe-column title="操作" width="120px" fixed="right" align="center">
                 <template  slot-scope="scope">
-                  <el-button v-if="hasPermission('notify:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row.id)">查看</el-button>
-                  <el-dropdown  size="small" style=" margin-left: 10px;">
-                    <el-button type="text" size="small">
-                          更多<i class="el-icon-arrow-down el-icon--right"></i>
-                    </el-button>
-                    <el-dropdown-menu slot="dropdown" >
-                      <el-dropdown-item  v-if="hasPermission('notify:edit') && scope.row.status==='0'"><el-button type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button></el-dropdown-item>
-                      <el-dropdown-item v-if="hasPermission('notify:del')">    <el-button  type="text" size="small" icon="el-icon-delete" @click="del(scope.row.id)">删除</el-button></el-dropdown-item>
-                    </el-dropdown-menu>
-                  </el-dropdown>
+
+                  <el-button v-if="hasPermission('notify:edit')&&(scope.row.status === '1' || scope.row.status === '3')&&scope.row.createBy.id === $store.state.user.id" type="text" size="small" @click="push(scope.row)">修改</el-button>
+                  <el-button v-else-if="(scope.row.status === '1' || scope.row.status === '3' || scope.row.status === '5')&&isAdmin" type="text" size="small" @click="edit(scope.row.id)">修改</el-button>
+
+                  <el-button v-if="hasPermission('notify:edit')&&(scope.row.status === '2')&&scope.row.createBy.id === $store.state.user.id" type="text" size="small" @click="reback(scope.row)">撤回</el-button>
+                  <el-button v-if="hasPermission('notify:del')&&(scope.row.status === '1' || scope.row.status === '3')&&(scope.row.createBy.id === $store.state.user.id || isAdmin)"  type="text" size="small" @click="del(scope.row.id)">删除</el-button>
                 </template>
             </vxe-column>
         </vxe-table>
@@ -108,6 +116,10 @@
 <script>
   import NotifyForm from './NotifyForm'
   import NotifyService from '@/api/notify/NotifyService'
+  import pick from 'lodash.pick'
+  import TaskService from '@/api/flowable/TaskService'
+  import ProcessService from '@/api/flowable/ProcessService'
+  import UserService from '@/api/sys/UserService'
   export default {
     data () {
       return {
@@ -121,20 +133,37 @@
           pageSize: 10,
           orders: []
         },
-        loading: false
+        loading: false,
+        processDefinitionAuditId: '',
+        procDefAuditKey: '',
+        isAdmin: false
       }
     },
     components: {
       NotifyForm
     },
     notifyService: null,
+    taskService: null,
+    processService: null,
+    userService: null,
     created () {
       this.notifyService = new NotifyService()
+      this.taskService = new TaskService()
+      this.processService = new ProcessService()
+      this.userService = new UserService()
     },
     activated () {
       this.refreshList()
     },
-
+    computed: {
+      userName () {
+        return JSON.parse(localStorage.getItem('user')).name
+      },
+      user () {
+        this.createName = JSON.parse(localStorage.getItem('user')).name
+        return JSON.parse(localStorage.getItem('user'))
+      }
+    },
     methods: {
       // 获取数据列表
       refreshList () {
@@ -148,6 +177,19 @@
           this.dataList = data.records
           this.tablePage.total = data.total
           this.loading = false
+          this.checkIsAdmin()
+          this.processService.getByName('发起通知').then(({data}) => {
+            if (!this.commonJS.isEmpty(data.id)) {
+              this.processDefinitionAuditId = data.id
+              this.procDefAuditKey = data.key
+            }
+          })
+        })
+      },
+      // 查询当前用户是否是管理员用户
+      checkIsAdmin () {
+        this.userService.is().then(({data}) => {
+          this.isAdmin = data
         })
       },
   // 当前页
@@ -200,6 +242,108 @@
       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: this.processDefinitionAuditId,
+          status: 'startAndHold'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                ...pick(data.data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+                procDefId: this.processDefinitionAuditId,
+                procDefKey: this.procDefAuditKey,
+                status: 'startAndHold',
+                title: tabTitle,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle,
+                businessId: 'false',
+                isShow: false,
+                routePath: '/notify/NotifyList'
+              }
+            })
+          })
+      },
+      // 发起项目登记
+      push (row) {
+        // 读取流程表单
+        let title = `发起流程【发起通知】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[发起通知]`
+        let status = 'startAndHold'
+        if (row.status === '3') {
+          status = 'startAndClose'
+        } else if (row.status === '4') {
+          status = 'reapplyFlag'
+        }
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
+          businessId: row.id,
+          businessTable: 'plugin_notify'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                ...pick(data.data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+                procDefId: this.processDefinitionAuditId,
+                procDefKey: this.procDefAuditKey,
+                title: title,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle,
+                businessTable: 'plugin_notify',
+                businessId: row.id,
+                isShow: 'false',
+                status: status,
+                routePath: '/notify/NotifyList'
+              }
+            })
+          })
+      },
+      // 查看项目登记流程结果
+      detail (row) {
+        if (row.status !== '0' && row.status !== '1') {
+          // eslint-disable-next-line eqeqeq
+          this.taskService.getTaskDef({
+            procInsId: row.procInsId,
+            procDefId: this.processDefinitionAuditId
+          }).then(({data}) => {
+            this.$router.push({
+              path: '/flowable/task/TaskFormDetail',
+              query: {
+                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+                isShow: 'false',
+                readOnly: true,
+                title: '发起通知' + '流程详情',
+                formTitle: '发起通知' + '流程详情',
+                businessId: row.id,
+                status: 'reback'
+              }
+            })
+          })
+        }
+      },
+      // 撤回项目登记
+      reback (row) {
+        this.$confirm(`确定要撤回该申请吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          await this.notifyService.queryById(row.id).then(({data}) => {
+            if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+              this.$message.error('数据已发生改变或不存在,请刷新数据')
+              this.refreshList()
+            } else {
+              this.processService.revokeProcIns(row.procInsId).then(({data}) => {
+                let form = {status: '3', id: row.id}
+                this.notifyService.updateStatusById(form)
+                this.$message.success(data)
+                this.refreshList()
+              })
+            }
+          })
+        })
       }
     }
   }

+ 682 - 0
src/views/modules/notify/NotifyTaskForm.vue

@@ -0,0 +1,682 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+  <div>
+      <el-form size="small" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view' || method === 'read'?'readonly':''" :disabled="method==='view' || method === 'read' || status === 'audit' || status === 'taskFormDetail'"
+               label-width="120px" @submit.native.prevent>
+        <el-row  :gutter="15">
+          <el-col :span="12">
+            <el-form-item label="通告状态" prop="notifyType"
+                          :rules="[
+                  {required: true, message:'通告状态不能为空', trigger:'blur'}
+                 ]">
+              <el-select size="medium" @change="changeNotifyType" v-model="inputForm.notifyType" placeholder="请选择"  style="width: 100%;">
+                <el-option
+                  v-for="item in $dictUtils.getDictList('oa_notify_status')"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12" v-if="inputForm.notifyType === '0'">
+            <el-form-item label="通告时间" prop="dates"
+                          :rules="[
+                                {required: true, message:'通告时间不能为空', trigger:'blur'}
+                   ]">
+              <el-date-picker
+                size="medium"
+                style="width: 100%"
+                placement="bottom-start"
+                format="yyyy-MM-dd HH:mm:ss"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                v-model="inputForm.dates"
+                type="datetimerange"
+                range-separator="至"
+                @input="daterangeChange"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="类型" prop="type"
+                          :rules="[
+                  {required: true, message:'类型不能为空', trigger:'blur'}
+                 ]">
+              <el-select size="medium" v-model="inputForm.type" placeholder="请选择"  style="width: 100%;">
+                <el-option
+                  v-for="item in $dictUtils.getDictList('oa_notify_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="title"
+                          :rules="[
+                  {required: true, message:'标题不能为空', trigger:'blur'}
+                 ]">
+              <el-input size="medium" v-model="inputForm.title" placeholder="请填写标题"     ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="文号" prop="no"
+                          :rules="[
+                 ]">
+              <el-input size="medium" v-model="inputForm.no" placeholder="请填写文号"     ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="创建人" prop="createBy.name"
+                          :rules="[
+                   ]">
+              <el-input size="medium" :disabled="true" v-model="inputForm.createBy.name" placeholder="请填写创建人" clearable></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="所属部门" prop="officeId"
+                          :rules="[
+                   ]">
+              <SelectTree
+                ref="officeTree"
+                :props="{
+                          value: 'id',             // ID字段名
+                          label: 'name',         // 显示名称
+                          children: 'children'    // 子级字段名
+                        }"
+                :url="`/sys/office/treeData?type=2`"
+                :value="inputForm.officeId"
+                :accordion="true"
+                :disabled="true"
+                size="medium"
+                @getValue="(value) => {inputForm.officeId=value}"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="内容" prop="content"
+                          :rules="[
+                          {required: true, message:'内容不能为空', trigger:'blur'}
+                   ]">
+              <WangEditor ref="contentEditor" v-model="inputForm.content" @getUrl="(url, lsUrl) => {
+                        inputForm.editorFilesDTOList.push({temporaryUrl: lsUrl, url: url})
+                        }"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-divider content-position="left">
+          <div style="float:left;"><i class="el-icon-document"></i> 通告范围-部门</div>
+          <div style="float:left;">
+            <el-button style="margin-left: 20px" type="primary"  size="mini" @click="openOfficeChoose" plain>
+              选择
+            </el-button>
+          </div>
+        </el-divider>
+        <el-row  :gutter="15" >
+          <el-form :disabled="status === 'audit' || status === 'taskFormDetail'">
+            <vxe-table
+              border
+              :column-config="{resizable: true}"
+              show-overflow
+              show-footer
+              :key="tableKeyOffice"
+              ref="officeTable"
+              class="vxe-table-element"
+              :data="inputForm.pluginNotifyOfficesDTOList"
+              style=""
+              @cell-click=""
+              @edit-closed=""
+              highlight-current-row
+            >
+              <vxe-table-column align="center" field="officeName" title="部门"></vxe-table-column>
+              <vxe-table-column align="center" title="操作" width="100">
+                <template v-slot="scope">
+                  <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'office')">删除</el-button>
+                </template>
+              </vxe-table-column>
+            </vxe-table>
+          </el-form>
+        </el-row>
+
+        <div style="margin-top: 30px">
+          <el-divider content-position="left" >
+            <div style="float: left"><i class="el-icon-document"></i> 通告范围-成员</div>
+            <UserSelectButton ref="userSelectButton" :disabled="status === 'audit' || status === 'taskFormDetail'" @getValue="(value) => {openUserChoose(value)}"></UserSelectButton>
+          </el-divider>
+        </div>
+        <el-row  :gutter="15">
+          <el-form :disabled="status === 'audit' || status === 'taskFormDetail'">
+            <vxe-table
+              border
+              :column-config="{resizable: true}"
+              show-overflow
+              show-footer
+              :key="tableKeyUser"
+              ref="userTable"
+              class="vxe-table-element"
+              :data="inputForm.pluginNotifyUserDTOList"
+              style=""
+              @cell-click=""
+              @edit-closed=""
+              highlight-current-row
+            >
+              <vxe-table-column align="center" field="userName" title="姓名"></vxe-table-column>
+              <vxe-table-column align="center" field="officeName" title="部门"></vxe-table-column>
+              <vxe-table-column align="center" title="操作" width="100">
+                <template v-slot="scope">
+                  <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'user')">删除</el-button>
+                </template>
+              </vxe-table-column>
+            </vxe-table>
+          </el-form>
+        </el-row>
+      </el-form>
+    <!--        附件-->
+    <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+    <OfficeTreeSelect ref="officeTreeSelect" @getOfficeChoose="getOfficeChoose"></OfficeTreeSelect>
+  </div>
+</template>
+
+<script>
+  import UserSelect from '@/components/userSelect'
+  import NotifyService from '@/api/notify/NotifyService'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import WangEditor from '@/components/editor/WangEditor'
+  import OfficeTreeSelect from '@/components/officeTreeSelect'
+  import UserSelectButton from '@/components/userSelectButton/DividerButton'
+  import UserService from '@/api/sys/UserService'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  export default {
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      },
+      status: {
+        type: String,
+        default: ''
+      }
+    },
+    data () {
+      return {
+        title: '',
+        method: '',
+        loading: false,
+        inputForm: {
+          createBy: {
+            id: '',
+            name: ''
+          },
+          createDate: '',
+          id: '',
+          type: '',
+          title: '',
+          content: '',
+          files: '',
+          status: '',
+          remarks: '',
+          notifyType: '',
+          no: '',
+          beginDate: '',
+          endDate: '',
+          dates: '',
+          officeId: '',
+          workAttachmentDtoList: [],
+          pluginNotifyOfficesDTOList: [],
+          pluginNotifyUserDTOList: [],
+          editorFilesDTOList: []
+        },
+        keyWatch: '',
+        tableKeyOffice: '',
+        tableKeyUser: ''
+      }
+    },
+    computed: {
+      bus: {
+        get () {
+          return this.businessId
+        },
+        set (val) {
+          this.businessId = val
+        }
+      }
+    },
+    watch: {
+      'keyWatch': {
+        handler (newVal) {
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
+          } else {
+            this.$nextTick(() => {
+              this.$refs.inputForm.resetFields()
+            })
+          }
+        }
+      }
+    },
+    components: {
+      UserSelect,
+      SelectTree,
+      WangEditor,
+      OfficeTreeSelect,
+      UserSelectButton,
+      UpLoadComponent
+    },
+    notifyService: null,
+    userService: null,
+    created () {
+      this.notifyService = new NotifyService()
+      this.userService = new UserService()
+    },
+    methods: {
+      getKeyWatch (keyWatch) {
+        this.keyWatch = keyWatch
+      },
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          createBy: {
+            id: '',
+            name: ''
+          },
+          createDate: '',
+          id: '',
+          type: '',
+          title: '',
+          content: '',
+          files: '',
+          status: '',
+          remarks: '',
+          notifyType: '',
+          no: '',
+          beginDate: '',
+          endDate: '',
+          dates: ['', ''],
+          officeId: '',
+          workAttachmentDtoList: [],
+          pluginNotifyOfficesDTOList: [],
+          pluginNotifyUserDTOList: [],
+          editorFilesDTOList: []
+        }
+        this.inputForm.id = id
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.inputForm.resetFields()
+          this.loading = true
+          this.$refs.contentEditor.clear()
+          this.notifyService.query({id: this.inputForm.id, isSelf: false}).then(({data}) => {
+            this.$refs.uploadComponent.clearUpload()
+            this.inputForm = this.recover(this.inputForm, data)
+            this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            if (this.status === 'audit' || this.status === 'taskFormDetail') {
+              this.$refs.contentEditor.disable()
+            } else {
+              this.$refs.contentEditor.enable()
+            }
+            if (this.commonJS.isNotEmpty(this.inputForm.content)) {
+              this.$refs.contentEditor.init(this.inputForm.content)
+            }
+            if (this.commonJS.isEmpty(this.inputForm.editorFilesDTOList)) {
+              this.inputForm.editorFilesDTOList = []
+            }
+            if (this.commonJS.isEmpty(this.inputForm.createBy.id)) {
+              this.inputForm.createBy.id = JSON.parse(localStorage.getItem('user')).id
+              this.inputForm.createBy.name = JSON.parse(localStorage.getItem('user')).name
+            }
+            if (this.commonJS.isEmpty(this.inputForm.officeId)) {
+              this.inputForm.officeId = JSON.parse(localStorage.getItem('user')).officeDTO.id
+            }
+            this.inputForm.dates = ['', '']
+            if (this.commonJS.isNotEmpty(this.inputForm.beginDate) && this.commonJS.isNotEmpty(this.inputForm.endDate)) {
+              this.inputForm.dates[0] = this.inputForm.beginDate
+              this.inputForm.dates[1] = this.inputForm.endDate
+            }
+            if (this.commonJS.isEmpty(this.inputForm.notifyType)) {
+              this.inputForm.notifyType = '0'
+            }
+            if (this.commonJS.isEmpty(this.inputForm.pluginNotifyOfficesDTOList)) {
+              this.inputForm.pluginNotifyOfficesDTOList = []
+            }
+            if (this.commonJS.isEmpty(this.inputForm.pluginNotifyUserDTOList)) {
+              this.inputForm.pluginNotifyUserDTOList = []
+            }
+            if (this.status === 'audit' || this.status === 'taskFormDetail') {
+              this.method = 'view'
+              method = 'view'
+            }
+            if (this.commonJS.isEmpty(this.inputForm.workAttachmentDtoList)) {
+              this.inputForm.workAttachmentDtoList = []
+            }
+            this.$refs.uploadComponent.newUpload(this.method, this.inputForm.workAttachmentDtoList, 'notify')
+            this.loading = false
+          })
+        })
+      },
+      saveForm (callback) {
+        this.doSubmit('save', callback)
+      },
+      startForm (callback) {
+        this.doSubmit('start', callback)
+      },
+      agreeForm (callback) {
+        this.notifyService.query({
+          id: this.inputForm.id,
+          isSelf: false
+        }).then(({data}) => {
+          if (data.status !== '2') { // 审核状态不是“待审核”,就弹出提示
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error()
+          } else {
+            this.doSubmit('agree', callback)
+          }
+        })
+      },
+      reapplyForm (callback) {
+        this.notifyService.query({
+          id: this.inputForm.id,
+          isSelf: false
+        }).then(({data}) => {
+          if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+          } else {
+            this.doSubmit('reapply', callback)
+          }
+        })
+      },
+      // 表单提交
+      doSubmit (status, callback) {
+        if (status === 'save') {
+          // 暂存
+          this.inputForm.status = '1'
+          this.loading = true
+          if (this.$refs.uploadComponent.checkProgress()) {
+            this.loading = false
+            return
+          }
+          this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
+          if (this.commonJS.isNotEmpty(this.inputForm.dates)) {
+            this.inputForm.beginDate = this.inputForm.dates[0]
+            this.inputForm.endDate = this.inputForm.dates[1]
+          } else {
+            this.inputForm.beginDate = ''
+            this.inputForm.endDate = ''
+          }
+          this.getEditorFilesDTOList()
+          this.notifyService.saveForm(this.inputForm).then(({data}) => {
+            callback(data.businessTable, data.businessId, this.inputForm)
+            this.loading = false
+          }).catch(() => {
+            this.loading = false
+          })
+          return
+        } else if (status === 'start') {
+          // 送审  待审核
+          this.inputForm.status = '2'
+        } else if (status === 'agree') {
+          // 审核同意
+          this.inputForm.status = '5'
+        } else if (status === 'reapply') {
+          this.inputForm.status = '2'
+        }
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            if (this.$refs.uploadComponent.checkProgress()) {
+              this.loading = false
+              return
+            }
+            if (this.commonJS.isEmpty(this.inputForm.pluginNotifyOfficesDTOList) && this.commonJS.isEmpty(this.inputForm.pluginNotifyUserDTOList)) {
+              this.$message.error('通告范围(部门或成员),至少填写一项')
+              this.loading = false
+              throw new Error('通告范围(部门或成员),至少填写一项')
+            }
+            this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
+            if (this.commonJS.isNotEmpty(this.inputForm.dates)) {
+              this.inputForm.beginDate = this.inputForm.dates[0]
+              this.inputForm.endDate = this.inputForm.dates[1]
+              if (this.commonJS.isNotEmpty(this.inputForm.beginDate) && this.commonJS.isNotEmpty(this.inputForm.endDate)) {
+                if (this.inputForm.beginDate === this.inputForm.endDate) {
+                  if (this.inputForm.notifyType === '0') {
+                    this.$message.error('通告起止时间不可以相同')
+                    this.loading = false
+                    throw new Error('通告起止时间不可以相同')
+                  }
+                }
+              } else {
+                if (this.inputForm.notifyType === '0') {
+                  this.$message.error('请填写通告时间')
+                  this.loading = false
+                  throw new Error('请填写通告时间')
+                }
+              }
+            } else {
+              this.inputForm.beginDate = ''
+              this.inputForm.endDate = ''
+              if (this.inputForm.notifyType === '0') {
+                this.$message.error('请填写通告时间')
+                this.loading = false
+                throw new Error('请填写通告时间')
+              }
+            }
+            if (this.commonJS.isEmpty(this.inputForm.content)) {
+              this.$message.error('请填写内容')
+              this.loading = false
+              throw new Error('请填写内容')
+            }
+            this.getEditorFilesDTOList()
+            this.notifyService.saveForm(this.inputForm).then(({data}) => {
+              this.loading = false
+              callback(data.businessTable, data.businessId, this.inputForm)
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      },
+      updateStatusById (type, callback) {
+        if (this.$refs.uploadComponent.checkProgress()) {
+          this.loading = false
+          throw new Error()
+        } else {
+          if (type === 'reject' || type === 'reback') {
+            this.notifyService.query({
+              id: this.inputForm.id,
+              isSelf: false
+            }).then(({data}) => {
+              if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error()
+              } else {
+                if (type === 'reject') {
+                  // 驳回
+                  this.inputForm.status = '4'
+                  let param = {status: '4', id: this.inputForm.id}
+                  this.notifyService.updateStatusById(param).then(() => {
+                    callback()
+                  })
+                }
+                if (type === 'reback') {
+                  // 撤回
+                  let param = {status: '3', id: this.inputForm.id}
+                  this.notifyService.updateStatusById(param).then(() => {
+                    callback()
+                  })
+                }
+              }
+            })
+          } else if (type === 'hold') {
+            this.notifyService.query({
+              id: this.inputForm.id,
+              isSelf: false
+            }).then(({data}) => {
+              if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error()
+              } else {
+                // 终止
+                let param = {status: '1', id: this.inputForm.id}
+                this.notifyService.updateStatusById(param).then(() => {
+                  callback()
+                })
+              }
+            })
+          }
+        }
+      },
+      close () {
+        this.$refs.uploadComponent.clearUpload()
+        this.$refs.contentEditor.enable()
+        this.inputForm = {
+          createBy: {
+            id: '',
+            name: ''
+          },
+          createDate: '',
+          id: '',
+          type: '',
+          title: '',
+          content: '',
+          files: '',
+          status: '',
+          remarks: '',
+          notifyType: '',
+          no: '',
+          beginDate: '',
+          endDate: '',
+          dates: '',
+          officeId: '',
+          workAttachmentDtoList: [],
+          pluginNotifyOfficesDTOList: [],
+          pluginNotifyUserDTOList: [],
+          editorFilesDTOList: []
+        }
+      },
+      changeNotifyType () {
+        this.inputForm.beginDate = ''
+        this.inputForm.endDate = ''
+        this.inputForm.dates = ['', '']
+      },
+      daterangeChange (e) {
+        this.$nextTick(() => {
+          this.$forceUpdate()
+        })
+      },
+      getEditorFilesDTOList () {
+        let a = []
+        if (this.commonJS.isNotEmpty(this.inputForm.editorFilesDTOList)) {
+          this.inputForm.content = this.inputForm.content.replace(/&amp;/, '&')
+          console.log('content', this.inputForm.content)
+          console.log('editorFilesDTOList', this.inputForm.editorFilesDTOList)
+          this.inputForm.editorFilesDTOList.forEach((item) => {
+            console.log('尽')
+            if (this.inputForm.content.includes(item.temporaryUrl)) {
+              a.push(item)
+              console.log('a', a)
+            }
+          })
+        }
+        setTimeout(() => {
+          this.inputForm.editorFilesDTOList = []
+          a.forEach((item) => {
+            console.log('editorFilesDTOList', this.inputForm.editorFilesDTOList)
+            this.inputForm.editorFilesDTOList.push(item)
+          })
+        }, 200)
+      },
+      openOfficeChoose () {
+        this.$refs.officeTreeSelect.init()
+      },
+      getOfficeChoose (list) {
+        let _this = this
+        const wait = () => new Promise((resolve, reject) => {
+          if (_this.commonJS.isEmpty(_this.inputForm.pluginNotifyOfficesDTOList)) {
+            _this.inputForm.pluginNotifyOfficesDTOList = []
+            resolve()
+          } else if (_this.commonJS.isEmpty(list)) {
+            resolve()
+          } else {
+            list.forEach((item, index) => {
+              _this.inputForm.pluginNotifyOfficesDTOList.forEach((office, rowIndex) => {
+                if (item.id === office.officeId || item.name === office.officeName) {
+                  this.$refs.officeTable.remove(office)
+                  this.inputForm.pluginNotifyOfficesDTOList.splice(rowIndex, 1)
+                  this.tableKeyOffice = Math.random()
+                }
+              })
+            })
+            resolve()
+          }
+        })
+        wait().then(() => {
+          list.forEach((item) => {
+            let d = {
+              officeName: item.name,
+              officeId: item.id
+            }
+            this.$refs.officeTable.insertAt(d)
+            this.inputForm.pluginNotifyOfficesDTOList.push(d)
+            this.tableKeyOffice = Math.random()
+          })
+        })
+      },
+      removeEvent (row, rowIndex, type) {
+        if (type === 'office') {
+          this.$refs.officeTable.remove(row)
+          this.inputForm.pluginNotifyOfficesDTOList.splice(rowIndex, 1)
+          this.tableKeyOffice = Math.random()
+        }
+        if (type === 'user') {
+          this.$refs.userTable.remove(row)
+          this.inputForm.pluginNotifyUserDTOList.splice(rowIndex, 1)
+          this.tableKeyUser = Math.random()
+        }
+      },
+      openUserChoose (value) {
+        if (this.commonJS.isNotEmpty(value)) {
+          this.userService.queryDetailList(value).then(({data}) => {
+            if (this.commonJS.isEmpty(this.inputForm.pluginNotifyUserDTOList)) {
+              this.inputForm.pluginNotifyUserDTOList = []
+            }
+            data.forEach(item => {
+              this.inputForm.pluginNotifyUserDTOList.forEach((user, rowIndex) => {
+                if (this.commonJS.isEmpty(item.name) || user.userName === item.name || user.userId === item.id) {
+                  this.$refs.userTable.remove(user)
+                  this.inputForm.pluginNotifyUserDTOList.splice(rowIndex, 1)
+                  this.tableKeyUser = Math.random()
+                }
+              })
+            })
+            data.forEach(item => {
+              let param = {
+                userId: item.id,
+                userName: this.commonJS.isEmpty(item.name) ? '' : item.name,
+                officeName: this.commonJS.isEmpty(item.officeDTO) ? '' : this.commonJS.isEmpty(item.officeDTO.name) ? '' : item.officeDTO.name
+              }
+              this.$refs.userTable.insertAt(param)
+              this.inputForm.pluginNotifyUserDTOList.push(param)
+              this.tableKeyUser = Math.random()
+            })
+          })
+        }
+      }
+    }
+  }
+</script>
+<style scoped>
+  /deep/ .w-e-text-container {
+    z-index: 1 !important;
+  }
+  /deep/ .w-e-menu {
+    z-index: 2 !important;
+  }
+  /deep/ .wtext {
+    height: 400px
+  }
+</style>

+ 8 - 15
src/views/modules/sys/dashboard/workBench/Pending.vue

@@ -54,7 +54,7 @@
                     field="task.createTime"
                     title="创建时间">
                   </vxe-column>
-                  <vxe-column title="操作" width="200px" fixed="right" align="center">
+                  <vxe-column title="操作" width="100px" 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>
@@ -158,6 +158,7 @@
               <span>公告</span>
               <el-badge v-if="noticePage.total !== 0" class="mark" :value="noticePage.total" :max="99" style="line-height: 0"/>
               <div style="float:right;align-items:center;display:flex;height: 18px">
+                <el-button type="text" style="float:right" @click="resetSearch()">刷新</el-button>
                 <el-button type="text" style="float:right" @click="toNotice()">更多>></el-button>
               </div>
             </div>
@@ -183,35 +184,27 @@
                 :checkbox-config="{}">
                 <!--<vxe-column type="seq" width="60" title="序号"></vxe-column>
                 <vxe-column type="checkbox"  width="40px"></vxe-column>-->
-                <vxe-column  title="标题" field="title">
+                <vxe-column min-width="150px" title="标题" field="title" align="center">
                   <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">
+                <vxe-column min-width="100px" title="类型" field="type" align="center">
                   <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">
+                <vxe-column min-width="100px" title="查阅状态" field="status" align="center">
                   <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">
+                <vxe-column min-width="100px" title="发布者" field="createBy.name" align="center"></vxe-column>
+                <vxe-column title="操作" width="50px" 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>
+                    <el-button  type="text" size="mini" @click="view(scope.row.id)">查看</el-button>
                   </template>
                 </vxe-column>
               </vxe-table>