Browse Source

项目组成员管理

lizhenhao 2 năm trước cách đây
mục cha
commit
9002cb6b89

+ 7 - 0
src/api/cw/projectRecords/ProjectRecordsService.js

@@ -65,4 +65,11 @@ export default class ProjectRecordsService {
       params: {contractId: id, ...projectForm}
     })
   }
+  updateMembers (inputForm) {
+    return request({
+      url: `/cwProjectRecords/updateMembers`,
+      method: 'post',
+      data: inputForm
+    })
+  }
 }

+ 15 - 0
src/api/sys/UserService.js

@@ -102,4 +102,19 @@ export default class UserService {
       method: 'get'
     })
   }
+
+  queryDetailList (ids) {
+    return request({
+      url: `/sys/user/queryDetailList`,
+      method: 'get',
+      params: {ids: ids}
+    })
+  }
+  queryDetailById (id) {
+    return request({
+      url: `/sys/user/queryDetailById`,
+      method: 'get',
+      params: {id: id}
+    })
+  }
 }

+ 443 - 0
src/components/userSelectButton/UserSelectDialog.vue

@@ -0,0 +1,443 @@
+<template>
+  <div>
+    <el-dialog
+    title="用户选择"
+    width="1000px"
+    :close-on-click-modal="false"
+    :append-to-body="true"
+     v-dialogDrag
+     class="userDialog"
+    :visible.sync="visible">
+    <el-container style="height: 500px">
+      <el-aside width="200px">
+
+        <el-card class="org">
+          <div slot="header" class="clearfix">
+            <el-input
+              placeholder="请输入组织机构过滤"
+              size="small"
+              v-model="filterText">
+            </el-input>
+          </div>
+           <el-tree
+            :data="officeTreeData"
+            :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+            default-expand-all
+            highlight-current
+            node-key="id"
+            :render-content="renderContent"
+            :filter-node-method="filterNode"
+            :expand-on-click-node="false"
+            @node-click="handleNodeClick"
+            ref="officeTree">
+          </el-tree>
+        </el-card>
+      </el-aside>
+
+    <el-container>
+      <el-header style="text-align: left; font-size: 12px;height:30px">
+        <el-form size="small" :inline="true" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+            <el-form-item prop="loginName">
+              <el-input size="small" v-model="searchForm.loginName" 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>
+      </el-header>
+
+      <el-main>
+        <el-table
+          :data="dataList"
+          v-loading="loading"
+          size="small"
+          border
+          ref="userTable"
+          @selection-change="selectionChangeHandle"
+          @sort-change="sortChangeHandle"
+          height="calc(100% - 40px)"
+          style="width: 100%;">
+          <el-table-column
+            header-align="center"
+            align="center"
+            v-if="limit <= 1"
+            width="50">
+              <template slot-scope="scope">
+                  <el-radio :label="scope.row.id" :value="dataListAllSelections[0]&&dataListAllSelections[0].id" @change.native="getTemplateRow(scope.$index,scope.row)"><span></span></el-radio>
+              </template>
+          </el-table-column>
+          <el-table-column
+            type="selection"
+            header-align="center"
+            v-if="limit > 1"
+            align="center"
+            width="50">
+          </el-table-column>
+          <el-table-column
+            prop="photo"
+            header-align="center"
+            align="center"
+            label="头像">
+            <template slot-scope="scope">
+              <img :src="scope.row.photo === ''?'/static/img/avatar.png':scope.row.photo" style="height:35px"/>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="loginName"
+            header-align="center"
+            align="center"
+            sortable="custom"
+            min-width="90"
+            label="登录名">
+          </el-table-column>
+          <el-table-column
+            prop="name"
+            header-align="center"
+            align="真实姓名"
+            sortable="custom"
+            min-width="90"
+            label="用户名">
+          </el-table-column>
+          <el-table-column
+            prop="companyDTO.name"
+            header-align="center"
+            align="center"
+            sortable="custom"
+            min-width="110"
+            label="所属机构">
+          </el-table-column>
+          <el-table-column
+            prop="officeDTO.name"
+            header-align="center"
+            align="center"
+            sortable="custom"
+            min-width="110"
+            label="所属部门">
+          </el-table-column>
+          <el-table-column
+            prop="loginFlag"
+            header-align="center"
+            align="center"
+            min-width="100"
+            label="状态">
+            <template slot-scope="scope">
+              <el-tag v-if="scope.row.loginFlag === '1'" size="small" type="success">正常</el-tag>
+              <el-tag v-else-if="scope.row.loginFlag === '0'" size="small" type="danger">禁用</el-tag>
+            </template>
+          </el-table-column>
+        </el-table>
+        <el-pagination
+          @size-change="sizeChangeHandle"
+          @current-change="currentChangeHandle"
+          :current-page="pageNo"
+          :page-sizes="[5, 10, 50, 100]"
+          :page-size="pageSize"
+          :total="total"
+          layout="total, sizes, prev, pager, next, jumper">
+        </el-pagination>
+      </el-main>
+    </el-container>
+
+    <el-aside width="200px">
+      <el-tag
+        :key="tag.id"
+        v-for="tag in dataListAllSelections"
+        closable
+        :disable-transitions="false"
+        @close="del(tag)">
+        {{tag.name}}
+      </el-tag>
+  </el-aside>
+</el-container>
+     <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" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
+    </span>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+  export default {
+    data () {
+      return {
+        searchForm: {
+          loginName: '',
+          companyDTO: {
+            id: ''
+          },
+          officeDTO: {
+            id: ''
+          },
+          name: ''
+        },
+        filterText: '',
+        dataListAllSelections: [],   // 所有选中的数据包含跨页数据
+        dataListSelections: [],
+        idKey: 'id', // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
+        dataList: [],
+        dynamicTags: [],
+        officeTreeData: [],
+        pageNo: 1,
+        pageSize: 10,
+        total: 0,
+        orders: [],
+        loading: false,
+        visible: false
+      }
+    },
+    props: {
+      selectData: {
+        type: Array,
+        default: () => { return [] }
+      },
+      limit: {
+        type: Number,
+        default: 999999
+      }
+    },
+    watch: {
+      filterText (val) {
+        this.$refs.officeTree.filter(val)
+      }
+    },
+    methods: {
+      init () {
+        this.visible = true
+        this.$nextTick(() => {
+          this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData))
+          this.refreshTree()
+          this.resetSearch()
+        })
+      },
+      renderContent (h, { node, data, store }) {
+        return (
+              <span class="custom-tree-node">
+                {
+                  data.type === '1' ? <i class="fa fa-sitemap"></i> : <i class="fa fa-users"></i>
+                }
+                <span class="text">{node.label}</span>
+              </span>
+        )
+      },
+      getTemplateRow (index, row) {                                 // 获取选中数据
+        this.dataListSelections = [row]
+        this.$nextTick(() => {
+          this.changePageCoreRecordData()
+        })
+      },
+           // 设置选中的方法
+      setSelectRow () {
+        if (!this.dataListAllSelections || this.dataListAllSelections.length <= 0) {
+          this.$refs.userTable.clearSelection()
+          return
+        }
+                // 标识当前行的唯一键的名称
+        let idKey = this.idKey
+        let selectAllIds = []
+        this.dataListAllSelections.forEach(row => {
+          selectAllIds.push(row[idKey])
+        })
+        this.$refs.userTable.clearSelection()
+        for (var i = 0; i < this.dataList.length; i++) {
+          if (selectAllIds.indexOf(this.dataList[i][idKey]) >= 0) {
+                        // 设置选中,记住table组件需要使用ref="table"
+            this.$refs.userTable.toggleRowSelection(this.dataList[i], true)
+          }
+        }
+      },
+            // 记忆选择核心方法
+      changePageCoreRecordData () {
+                // 标识当前行的唯一键的名称
+        let idKey = this.idKey
+        let that = this
+              // 如果总记忆中还没有选择的数据,那么就直接取当前页选中的数据,不需要后面一系列计算
+        if (this.dataListAllSelections.length <= 0) {
+          this.dataListSelections.forEach(row => {
+            that.dataListAllSelections.push(row)
+          })
+          return
+        }
+                // 总选择里面的key集合
+        let selectAllIds = []
+        this.dataListAllSelections.forEach(row => {
+          selectAllIds.push(row[idKey])
+        })
+        let selectIds = []
+                // 获取当前页选中的id
+        this.dataListSelections.forEach(row => {
+          selectIds.push(row[idKey])
+                  // 如果总选择里面不包含当前页选中的数据,那么就加入到总选择集合里
+          if (selectAllIds.indexOf(row[idKey]) < 0) {
+            that.dataListAllSelections.push(row)
+          }
+        })
+        let noSelectIds = []
+              // 得到当前页没有选中的id
+        this.dataList.forEach(row => {
+          if (selectIds.indexOf(row[idKey]) < 0) {
+            noSelectIds.push(row[idKey])
+          }
+        })
+        noSelectIds.forEach(id => {
+          if (selectAllIds.indexOf(id) >= 0) {
+            for (let i = 0; i < that.dataListAllSelections.length; i++) {
+              if (that.dataListAllSelections[i][idKey] === id) {
+                                // 如果总选择中有未被选中的,那么就删除这条
+                that.dataListAllSelections.splice(i, 1)
+                break
+              }
+            }
+          }
+        })
+      },
+     // 得到选中的所有数据
+      getAllSelectionData () {
+         // 再执行一次记忆勾选数据匹配,目的是为了在当前页操作勾选后直接获取选中数据
+        this.changePageCoreRecordData()
+      },
+      filterNode (value, data) {
+        if (!value) return true
+        return data.name.indexOf(value) !== -1
+      },
+      del (tag) {
+        this.dataListAllSelections.splice(this.dataListAllSelections.indexOf(tag), 1)
+        this.$nextTick(() => {
+          this.setSelectRow()
+        })
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.$http({
+          url: '/sys/user/list',
+          method: 'get',
+          params: {
+            'current': this.pageNo,
+            'size': this.pageSize,
+            'orders': this.orders,
+            ...this.searchForm
+          }
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.total = data.total
+          this.pageNo = data.current
+          this.loading = false
+          this.$nextTick(() => {
+            this.setSelectRow()
+          })
+        })
+      },
+      refreshTree () {
+        this.$http({
+          url: `/sys/office/treeData`,
+          method: 'get'
+        }).then(({data}) => {
+          this.officeTreeData = data
+        })
+      },
+      // 每页数
+      sizeChangeHandle (val) {
+        this.pageSize = val
+        this.pageNo = 1
+        this.refreshList()
+        this.$nextTick(() => {
+          this.changePageCoreRecordData()
+        })
+      },
+      // 当前页
+      currentChangeHandle (val) {
+        this.pageNo = val
+        this.refreshList()
+        this.$nextTick(() => {
+          this.changePageCoreRecordData()
+        })
+      },
+      // 多选
+      selectionChangeHandle (val) {
+        this.dataListSelections = val
+        this.$nextTick(() => {
+          this.changePageCoreRecordData()
+        })
+      },
+       // 排序
+      sortChangeHandle (column) {
+        if (column.prop === 'officeDTO.name') {
+          column.prop = 'o.name'
+        }
+        if (column.prop === 'companyDTO.name') {
+          column.prop = 'c.name'
+        }
+        this.orders = []
+        if (column.order != null) {
+          this.orders.push({column: this.$utils.toLine(column.prop), asc: column.order === 'ascending'})
+        }
+        this.refreshList()
+      },
+      handleNodeClick (data) {
+        if (data.type === '1') {
+          this.searchForm.companyDTO.id = data.id
+          this.searchForm.officeDTO.id = ''
+        } else {
+          this.searchForm.companyDTO.id = ''
+          this.searchForm.officeDTO.id = data.id
+        }
+        this.refreshList()
+      },
+      resetSearch () {
+        this.searchForm.companyDTO.id = ''
+        this.searchForm.officeDTO.id = ''
+        this.$refs.officeTree.setCurrentKey(null)
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      },
+      doSubmit () {
+        if (this.limit < this.dataListAllSelections.length) {
+          this.$message.error(`你最多只能选择${this.limit}个用户`)
+          return
+        }
+        this.$emit('doSubmit', this.dataListAllSelections)
+        this.visible = false
+      },
+      close () {
+        this.$refs.userTable.clearSelection()
+        this.dataListAllSelections = []
+        this.visible = false
+      }
+    }
+  }
+</script>
+<style lang="scss">
+.org {
+  height: 100%;
+  .el-card__header {
+    padding: 10px;
+  }
+  .el-card__body {
+    padding: 10px;
+    max-height: 520px;
+    overflow: auto;
+  }
+}
+.userDialog{
+  .el-dialog__body {
+    padding: 10px 0px 0px 10px;
+    color: #606266;
+    font-size: 14px;
+    word-break: break-all;
+  }
+  .el-main {
+    padding: 20px 20px 5px 20px;
+    .el-pagination{
+      margin-top: 5px;
+    }
+  }
+}
+</style>

+ 103 - 0
src/components/userSelectButton/index.vue

@@ -0,0 +1,103 @@
+<template>
+<div>
+<!--    <el-input placeholder="请选择" :size="size" :disabled="disabled"  :readonly="readonly" style="line-hight:40px" @change="changeName" v-model="name" class="input-with-select">-->
+
+<!--    </el-input>-->
+    <el-button :disabled="disabled" size="mini" type="primary" :readonly="readonly" @click="showUserSelect">人员选择</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>
+
+

+ 454 - 0
src/views/modules/cw/projectRecords/ProjectMembersEditForm.vue

@@ -0,0 +1,454 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1100px"
+      height="500px"
+      @close="close"
+      append-to-body
+      @keyup.enter.native=""
+      :visible.sync="visible">
+    <el-row>
+      <el-col :span="24">
+        <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+                     label-width="135px" @submit.native.prevent>
+              <el-divider content-position="left"><i class="el-icon-document"></i> 项目成员信息</el-divider>
+              <el-row  :gutter="15">
+                <el-col :span="24">
+                  <el-form-item label="项目名称" prop="projectName"
+                                :rules="[
+                   ]">
+                    <el-input :disabled="true" v-model="inputForm.projectName" placeholder="请填写项目名称" clearable></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="项目编号" prop="projectNumber"
+                                :rules="[
+                   ]">
+                    <el-input :disabled="true" v-model="inputForm.projectNumber" placeholder="请填写项目编号" clearable></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="现场负责人" prop="projectLeaderId"
+                                :rules="[
+                   ]">
+                    <UserSelect size="medium" :disabled="true" :limit='1' :value="inputForm.projectLeaderId" @getValue='(value) => {inputForm.projectLeaderId = value}'></UserSelect>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="合同名称" prop="contractName"
+                                :rules="[
+                 ]">
+                    <el-input size="medium" :disabled="true" v-model="inputForm.contractName" placeholder="请选择合同"></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="委托人" prop="clientContactsName"
+                                :rules="[
+                 ]">
+                    <el-input :disabled="true" v-model="inputForm.clientContactsName" placeholder="请填写委托人"></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+        </el-form>
+          <el-divider content-position="left"><i class="el-icon-document"></i> 项目组成员明细</el-divider>
+            <el-row :gutter="15">
+<!--              <el-button type="primary" style="margin-bottom: 15px" size="mini" :disabled="method==='view'" @click="insertEvent('members')">-->
+<!--                选择成员-->
+<!--              </el-button>-->
+              <UserSelectButton ref="userSelectButton" @getValue="(value) => {addMembers(value)}"></UserSelectButton>
+            </el-row>
+            <el-row :gutter="15" style="margin-top: 15px">
+                  <el-form :disabled="method==='view'">
+                    <vxe-table
+                      border
+                      show-overflow
+                      show-footer
+                      :column-config="{resizable: true}"
+                      ref="membersTable"
+                      :key="tableKeyMembers"
+                      class="vxe-table-element"
+                      :data="inputForm.cwProjectMembersDTOList"
+                      style=""
+                      @cell-click=""
+                      @edit-closed=""
+                      highlight-current-row
+                    >
+                      <vxe-table-column min-width="120" align="center" field="name" title="姓名"></vxe-table-column>
+                      <vxe-table-column min-width="120" align="center" field="officeName" title="部门"></vxe-table-column>
+                      <vxe-table-column min-width="120" align="center" field="roleName" title="角色"></vxe-table-column>
+                      <vxe-table-column min-width="120" align="center" field="mobile" title="手机号"></vxe-table-column>
+                      <vxe-table-column min-width="120" align="center" field="status" title="状态">
+                        <template slot-scope="scope">
+                          <span v-if="scope.row.status === '0'" style="color: #67C23A">正常</span>
+                          <span v-else>移除</span>
+                        </template>
+                      </vxe-table-column>
+
+                      <vxe-table-column align="center" title="操作" min-width="120">
+                        <template v-slot="scope">
+                          <el-button v-if="scope.row.status === '0'" size="mini" type="info" @click="removeDate(scope.$rowIndex)">移除</el-button>
+                          <el-button v-if="scope.row.status === '1'" size="mini" type="primary" @click="aliveDate(scope.$rowIndex)">恢复</el-button>
+                          <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'members')">删除</el-button>
+                        </template>
+                      </vxe-table-column>
+                    </vxe-table>
+                  </el-form>
+                </el-row>
+      </el-col>
+    </el-row>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" v-if="method === 'edit' || method === 'add'" type="primary" icon="el-icon-circle-check" @click="save()">确定</el-button>
+    </span>
+    </el-dialog>
+    <WorkContractChooseCom ref="workContractChooseCom" @getContract="getContract"></WorkContractChooseCom>
+    <WorkClientChooseForm ref="workClientChooseForm" @getWorkClientChoose="getWorkClientChoose"></WorkClientChooseForm>
+    <CwProjectBusinessTypeListForm ref="cwProjectBusinessTypeListForm" @getBusinessType="getBusinessType"></CwProjectBusinessTypeListForm>
+    <ContractNameForm ref="contractNameForm"></ContractNameForm>
+  </div>
+</template>
+
+<script>
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import UserSelect from '@/components/userSelect'
+  import ProjectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
+  import EnterpriseSearchService from '@/api/cw/common/EnterpriseSearchService'
+  import WorkClientChooseForm from '../workClientInfo/WorkClientChooseForm'
+  import WorkContractChooseCom from './WorkContractChooseCom'
+  import CwProjectBusinessTypeListForm from '@/views/modules/cw/projectBusinessType/CwProjectBusinessTypeListForm'
+  import ContractNameForm from '../workContract/ContractNameForm'
+  import WorkClientService from '@/api/cw/workClientInfo/WorkClientService'
+  import ContractInfoService from '@/api/cw/workContract/ContractInfoService'
+  import UserSelectSignatory from '../workClientInfo/clientUserSelect'
+  import UserSelectButton from '@/components/userSelectButton'
+  import UserService from '@/api/sys/UserService'
+  export default {
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      }
+    },
+    data () {
+      return {
+        title: '',
+        method: '',
+        loading: false,
+        inputForm: {
+          id: '',
+          createDate: '',
+          createBy: {
+            id: '',
+            name: ''
+          },
+          remarks: '',
+          projectNumber: '',
+          projectName: '',
+          officeId: '',
+          projectMoney: '',
+          auditYear: '',
+          planStartDate: '',
+          planEndDate: '',
+          projectMasterId: '',
+          projectLeaderId: '',
+          procInsId: '',
+          processDefinitionId: '',
+          status: '',
+          workAttachmentDtoList: [],
+          cwProjectClientInfoDTOList: [],
+          contractName: '',
+          contractAmount: '',
+          contractNum: '',
+          payerSubject: '',
+          paymentMethod: '',
+          contractId: '',
+          businessType: '',
+          riskLevel: '',
+          businessTypeName: '',
+          planDate: [],
+          realHeader: '',
+          clientContactsName: '',
+          reportType: '',
+          cwProjectClientContactDTOList: [],
+          cwProjectMembersDTOList: []
+        },
+        keyWatch: '',
+        activeName: 'client',
+        tableKey: '',
+        tableKeyClient: '1',
+        tableKeyContact: '2',
+        tableKeyMembers: '3',
+        visible: false,
+        status: [
+          {label: '正常', value: '0'},
+          {label: '移除', value: '1'}
+        ]
+      }
+    },
+    projectRecordsService: null,
+    enterpriseSearchService: null,
+    workClientService: null,
+    contractInfoService: null,
+    userService: null,
+    created () {
+      this.enterpriseSearchService = new EnterpriseSearchService()
+      this.projectRecordsService = new ProjectRecordsService()
+      this.workClientService = new WorkClientService()
+      this.contractInfoService = new ContractInfoService()
+      this.userService = new UserService()
+    },
+    computed: {
+      bus: {
+        get () {
+          this.$refs.uploadComponent.setDividerName('附件', false)
+          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: {
+      SelectUserTree,
+      UpLoadComponent,
+      SelectTree,
+      UserSelect,
+      WorkClientChooseForm,
+      WorkContractChooseCom,
+      CwProjectBusinessTypeListForm,
+      ContractNameForm,
+      UserSelectSignatory,
+      UserSelectButton
+    },
+    methods: {
+      getKeyWatch (keyWatch) {
+        this.keyWatch = keyWatch
+      },
+      forUpdate () {
+        this.$forceUpdate()
+      },
+      init (method, id) {
+        if (method === 'view') {
+          this.title = '项目组成员详情'
+        } else if (method === 'edit') {
+          this.title = '项目组成员编辑'
+        }
+        this.visible = true
+        this.activeName = 'client'
+        this.projectRecordsService = new ProjectRecordsService()
+        this.method = method
+        this.inputForm = {
+          id: '',
+          createDate: '',
+          createBy: {
+            id: '',
+            name: JSON.parse(localStorage.getItem('user')).name
+          },
+          remarks: '',
+          projectNumber: '',
+          projectName: '',
+          officeId: '',
+          projectMoney: '',
+          auditYear: '',
+          planStartDate: '',
+          planEndDate: '',
+          projectMasterId: '',
+          projectLeaderId: '',
+          procInsId: '',
+          processDefinitionId: '',
+          status: '',
+          workAttachmentDtoList: [],
+          cwProjectClientInfoDTOList: [],
+          contractName: '',
+          contractAmount: '',
+          contractNum: '',
+          payerSubject: '',
+          paymentMethod: '',
+          contractId: '',
+          businessType: '',
+          riskLevel: '',
+          businessTypeName: '',
+          planDate: [],
+          realHeader: '',
+          clientContactsName: '',
+          reportType: '',
+          cwProjectClientContactDTOList: [],
+          cwProjectMembersDTOList: []
+        }
+        this.inputForm.id = id
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.inputForm.resetFields()
+          this.loading = true
+          this.projectRecordsService.queryById(this.inputForm.id).then(({data}) => {
+            this.inputForm = this.recover(this.inputForm, data)
+            this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            if (this.commonJS.isEmpty(this.inputForm.cwProjectMembersDTOList)) {
+              this.inputForm.cwProjectMembersDTOList = []
+            } else {
+              this.inputForm.cwProjectMembersDTOList.forEach((member, index) => {
+                this.userService.queryDetailById(member.userId).then(({data}) => {
+                  member.name = this.commonJS.isEmpty(data.name) ? '' : data.name
+                  member.mobile = this.commonJS.isEmpty(data.mobile) ? '' : data.mobile
+                  member.officeName = this.commonJS.isEmpty(data.officeDTO) ? '' : this.commonJS.isEmpty(data.officeDTO.name) ? '' : data.officeDTO.name
+                  member.roleName = this.commonJS.isEmpty(data.roleList) ? '' : data.roleList.map(role => { return this.commonJS.isEmpty(role.name) ? '' : role.name }).join(',')
+                  this.tableKeyMembers = Math.random()
+                })
+              })
+            }
+            this.loading = false
+          })
+        })
+      },
+      // 表单提交
+      save () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.projectRecordsService.updateMembers(this.inputForm).then(({data}) => {
+              this.$emit('refreshList')
+              this.loading = false
+              this.close()
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      },
+      close () {
+        this.inputForm = {
+          id: '',
+          createDate: '',
+          createBy: {
+            id: '',
+            name: ''
+          },
+          remarks: '',
+          projectNumber: '',
+          projectName: '',
+          officeId: '',
+          projectMoney: '',
+          auditYear: '',
+          planStartDate: '',
+          planEndDate: '',
+          projectMasterId: '',
+          projectLeaderId: '',
+          procInsId: '',
+          processDefinitionId: '',
+          status: '',
+          workAttachmentDtoList: [],
+          cwProjectClientInfoDTOList: [],
+          contractName: '',
+          contractAmount: '',
+          contractNum: '',
+          payerSubject: '',
+          paymentMethod: '',
+          contractId: '',
+          businessType: '',
+          riskLevel: '',
+          businessTypeName: '',
+          planDate: [],
+          realHeader: '',
+          clientContactsName: '',
+          reportType: '',
+          cwProjectClientContactDTOList: [],
+          cwProjectMembersDTOList: []
+        }
+        // this.$refs.uploadComponent.clearUpload()
+        this.$refs.inputForm.resetFields()
+        this.visible = false
+      },
+      tabHandleClick (event) {
+        // console.log(event)
+      },
+      // 新增
+      // eslint-disable-next-line no-dupe-keys
+      insertEvent (type) {
+        if (type === 'contact') {
+          let d = {
+            contactFirst: '',
+            contactSecond: '',
+            email: '',
+            fax: '',
+            name: '',
+            officeId: '',
+            position: '',
+            remarks: '',
+            sex: ''
+          }
+          if (this.commonJS.isEmpty(this.inputForm.cwProjectClientContactDTOList)) {
+            this.inputForm.cwProjectClientContactDTOList = []
+          }
+          this.$refs.contactTable.insertAt(d)
+          this.inputForm.cwProjectClientContactDTOList.push(d)
+          this.tableKeyContact = Math.random()
+        }
+      },
+      // 删除
+      removeEvent (row, rowIndex, type) {
+        if (type === 'members') {
+          this.$refs.membersTable.remove(row)
+          this.inputForm.cwProjectMembersDTOList.splice(rowIndex, 1)
+        }
+      },
+      removeDate (index) {
+        this.inputForm.cwProjectMembersDTOList[index].status = '1'
+      },
+      aliveDate (index) {
+        this.inputForm.cwProjectMembersDTOList[index].status = '0'
+      },
+      addMembers (value) {
+        if (this.commonJS.isNotEmpty(value)) {
+          this.userService.queryDetailList(value).then(({data}) => {
+            data.forEach(item => {
+              this.inputForm.cwProjectMembersDTOList.forEach(member => {
+                if (this.commonJS.isEmpty(item.name) || member.name === item.name) {
+                  this.$message.error('成员“ ' + item.name + ' ”已存在')
+                  throw new Error('成员“ ' + item.name + ' ”已存在')
+                }
+              })
+            })
+            data.forEach(item => {
+              let param = {
+                userId: item.id,
+                status: '0',
+                name: this.commonJS.isEmpty(item.name) ? '' : item.name,
+                mobile: this.commonJS.isEmpty(item.mobile) ? '' : item.mobile,
+                officeName: this.commonJS.isEmpty(item.officeDTO) ? '' : this.commonJS.isEmpty(item.officeDTO.name) ? '' : item.officeDTO.name,
+                roleName: this.commonJS.isEmpty(item.roleList) ? '' : item.roleList.map(role => { return this.commonJS.isEmpty(role.name) ? '' : role.name }).join(',')
+              }
+              this.inputForm.cwProjectMembersDTOList.push(param)
+            })
+          })
+        }
+      }
+    }
+  }
+</script>
+<style scoped>
+  /deep/ .el-input-number .el-input__inner {
+    text-align: left;
+  }
+</style>

+ 223 - 0
src/views/modules/cw/projectRecords/ProjectMembersList.vue

@@ -0,0 +1,223 @@
+<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="projectName">
+        <el-input size="small" v-model="searchForm.projectName" placeholder="请输入项目名称" clearable></el-input>
+      </el-form-item>
+      <el-form-item label="项目编号" prop="projectNumber">
+        <el-input size="small" v-model="searchForm.projectNumber" placeholder="请输入项目编号" clearable></el-input>
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createDates">
+        <el-date-picker
+          placement="bottom-start"
+          format="yyyy-MM-dd HH:mm:ss"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          v-model="searchForm.createDates"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </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="bg-white top" style="">
+      <vxe-toolbar :refresh="{query: refreshList}" custom>
+        <template #buttons>
+<!--          <el-button v-if="hasPermission('cwProjectRecords:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>-->
+          <!--          <el-button v-if="hasPermission('klg:question:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.questionsTable && $refs.questionsTable.getCheckboxRecords().length === 0" plain>删除</el-button>-->
+        </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 90px)">
+        <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="{}"
+          @sort-change="sortChangeHandle"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column type="checkbox" width="40" ></vxe-column>
+          <vxe-column min-width="230" align="center" title="项目名称" field="projectName">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('cwProjectRecords:view')" @click="view(scope.row.id)">{{scope.row.projectName}}</el-link>
+              <el-link  type="primary" :underline="false" v-else-if="hasPermission('cwProjectRecords:view')"  @click="view(scope.row.id,)">{{scope.row.projectName}}</el-link>
+              <span v-else>{{scope.row.projectName}}</span>
+            </template>
+          </vxe-column>
+          <vxe-column min-width="160" align="center" title="项目编号" field="projectNumber"></vxe-column>
+          <vxe-column min-width="230" align="center" title="合同名称" field="contractName">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="commonJS.isNotEmpty(scope.row.contractId)&&commonJS.isNotEmpty(scope.row.contractName)" @click="viewContract(scope.row.contractId)">{{scope.row.contractName}}</el-link>
+              <span v-else style="color: red">暂无合同</span>
+            </template>
+          </vxe-column>
+          <vxe-column min-width="160" align="center" title="委托方" field="clientContactsName"></vxe-column>
+          <vxe-column min-width="160" align="center" title="成员数量" field="memberCount"></vxe-column>
+          <vxe-column min-width="160" align="center" title="创建人" field="createBy.name"></vxe-column>
+          <vxe-column min-width="160" align="center" title="创建时间" field="createDate"></vxe-column>
+          <vxe-column title="操作" width="70px" fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button v-if="hasPermission('cwProjectRecords:edit')&&(scope.row.createBy.id === $store.state.user.id||isAdmin)" type="text"  size="small" @click="edit(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>
+    <ProjectRecordsForm ref="projectRecordsForm" @refreshList="refreshList"></ProjectRecordsForm>
+    <ContractNameForm ref="contractNameForm"></ContractNameForm>
+    <ProjectRecordsAddForm ref="projectRecordsAddForm" @refreshList="refreshList"></ProjectRecordsAddForm>
+    <ProjectMembersEditForm ref="projectMembersEditForm" @refreshList="refreshList"></ProjectMembersEditForm>
+  </div>
+</template>
+
+<script>
+  import ProjectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
+  import TaskService from '@/api/flowable/TaskService'
+  import ProcessService from '@/api/flowable/ProcessService'
+  import ProjectRecordsForm from './ProjectRecordsForm'
+  import UserService from '@/api/sys/UserService'
+  import UserSelect from '@/components/userSelect'
+  import ContractNameForm from '../workContract/ContractNameForm'
+  import ProjectRecordsAddForm from './ProjectRecordsAddForm'
+  import ProjectMembersEditForm from './ProjectMembersEditForm'
+  export default {
+    data () {
+      return {
+        searchForm: {
+          projectMasterName: '',
+          projectNumber: '',
+          projectName: '',
+          createDates: [],
+          status: ''
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        loading: false,
+        processDefinitionAuditId: '',
+        procDefAuditKey: '',
+        isAdmin: false
+      }
+    },
+    projectRecordsService: null,
+    taskService: null,
+    processService: null,
+    userService: null,
+    created () {
+      this.projectRecordsService = new ProjectRecordsService()
+      this.taskService = new TaskService()
+      this.processService = new ProcessService()
+      this.userService = new UserService()
+    },
+    components: {
+      ProjectRecordsForm,
+      UserSelect,
+      ContractNameForm,
+      ProjectRecordsAddForm,
+      ProjectMembersEditForm
+    },
+    computed: {
+      userName () {
+        return JSON.parse(localStorage.getItem('user')).name
+      },
+      user () {
+        this.createName = JSON.parse(localStorage.getItem('user')).name
+        return JSON.parse(localStorage.getItem('user'))
+      }
+    },
+    mounted () {
+      this.refreshList()
+    },
+    activated () {
+      this.refreshList()
+    },
+    methods: {
+      // 新增
+      add () {
+        this.$refs.projectRecordsAddForm.init('add', 'false')
+      },
+      // 修改
+      edit (id) {
+        id = id || this.$refs.projectTable.getCheckboxRecords().map(item => {
+          return item.id
+        })[0]
+        this.$refs.projectMembersEditForm.init('edit', id)
+      },
+      // 查看
+      view (id) {
+        this.$refs.projectRecordsForm.init('view', id)
+      },
+      viewContract (id) {
+        this.$refs.contractNameForm.init('view', id)
+      },
+      // 查询当前用户是否是管理员用户
+      checkIsAdmin () {
+        this.userService.is().then(({data}) => {
+          this.isAdmin = data
+        })
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.projectRecordsService.list({
+          '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.checkIsAdmin()
+      },
+      // 当前页
+      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()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      }
+    }
+  }
+</script>

+ 0 - 10
src/views/modules/cw/projectRecords/ProjectRecordsList.vue

@@ -24,16 +24,6 @@
           end-placeholder="结束日期">
         </el-date-picker>
       </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="searchForm.status" placeholder="请选择" style="width:100%;"clearable>
-          <el-option
-            v-for="item in $dictUtils.getDictList('cw_status')"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-          </el-option>
-        </el-select>
-      </el-form-item>
 
       <el-form-item>
         <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>