|
@@ -0,0 +1,992 @@
|
|
|
+<template>
|
|
|
+ <section>
|
|
|
+ <!--工具条 top-->
|
|
|
+ <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
|
+ <el-form :inline="true">
|
|
|
+ <el-form-item >
|
|
|
+ <!-- <div style="display: flex;align-items: center;height: 40px;"> -->
|
|
|
+ <div v-if="true" style="display: flex;align-items: center;height: 40px;">
|
|
|
+ <el-input v-model="keyword" class="input-with-select" :placeholder="searchField == '1' ? $t('peaseenterthe') : $t('peaseenterthe')" clearable="true" size="small">
|
|
|
+ <el-select v-model="searchField" style="width:120px;" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')">
|
|
|
+ <el-option :label="$t('headerTop.projectName')" value=1 ></el-option>
|
|
|
+ <el-option :label="$t('Itemno')" value=2 ></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 分类筛选 -->
|
|
|
+ <el-form-item >
|
|
|
+ <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('fen-lei') }}</span>
|
|
|
+ <el-select v-model="statusClf" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="searchClfList" size="small">
|
|
|
+ <el-option v-for="item in baseClfList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="float:right;">
|
|
|
+ <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">{{'新增'}}</el-link>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ <!--列表-->
|
|
|
+ <el-table ref="projectlistOfWudulist" border @cell-mouse-enter="hoverCall" @cell-mouse-leave="handCall" :cell-class-name="tableCellClassName" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="checkedWudulist">
|
|
|
+ <el-table-column type="selection" width="60" :selectable="isSelectable">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="projectCode" :label="$t('Itemno')" width="150"></el-table-column>
|
|
|
+ <el-table-column prop="projectName" :label="$t('headerTop.projectName')" min-width="250" ></el-table-column>
|
|
|
+ <el-table-column prop="categoryName" :label="$t('projectclassification')" width="140"></el-table-column>
|
|
|
+ <el-table-column prop="isPublic" :label="'项目类型'" width="140">
|
|
|
+ <template slot-scope="scope">{{scope.row.isPublic==0?"正式项目":"非项目"}}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="inchargerName" :label="$t('projectmanager')" min-width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link type="primary" :underline="false" @click="showUser(scope.row.inchargerId)">
|
|
|
+ <span v-if="user.userNameNeedTranslate != 1">
|
|
|
+ {{scope.row.inchargerName}}
|
|
|
+ </span>
|
|
|
+ <span v-if="user.userNameNeedTranslate == 1">
|
|
|
+ <ww-open-data type='userName' :openid='scope.row.inchargerName'></ww-open-data>
|
|
|
+ </span>
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 级别 -->
|
|
|
+ <el-table-column :prop="user.timeType.projectLevelState == 1 ? 'levelName' : 'level'" :label="$t('ji-bie')" min-width="190" v-if="user.company.packageProject == 1">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="user.timeType.projectLevelState == 1">{{scope.row.levelName}}</span>
|
|
|
+ <span v-else>{{importanceListLable[scope.row.level - 1]}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="status" :label="'审核状态'" min-width="100" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.status == null?"-":approvalStatusStr[scope.row.status]}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('operation')" :width="300" align="left" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="primary" @click="handleAdd(scope.$index, scope.row)">{{'编辑'}}</el-button>
|
|
|
+ <el-button size="mini" @click="restartPro(scope.row)">{{'通过'}}</el-button>
|
|
|
+ <el-button size="mini" @click="restartPro(scope.row)">{{'驳回'}}</el-button>
|
|
|
+ <el-button size="mini" @click="restartPro(scope.row)">{{'撤销'}}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!--工具条 footer-->
|
|
|
+ <el-col :span="24" class="toolbar">
|
|
|
+ <el-pagination :key="projectListPageComponentKey"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :page-sizes="[20 , 50 , 80 , 100]"
|
|
|
+ :page-size="size"
|
|
|
+ :current-page.sync="page"
|
|
|
+ layout="total, sizes, prev, pager, next"
|
|
|
+ :total="total"
|
|
|
+ style="float:right;"
|
|
|
+ ></el-pagination>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <!--新增界面-->
|
|
|
+ <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="960px" :top="'6vh'">
|
|
|
+ <div style="height: 72vh;overflow-y: auto;overflow-x: hidden;">
|
|
|
+ <el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
|
|
|
+ <el-form-item :label="$t('Itemno')" :class="title == $t('newproject')" v-if="user.companyId!=936">
|
|
|
+ <!-- <el-input v-model="addForm.code" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目编号" clearable></el-input> -->
|
|
|
+ <el-input v-model="addForm.code" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || (!permissions.projectManagement && addForm.creatorId != user.id && !permissions.projectCodeAndName)" maxlength="50" show-word-limit="true"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('headerTop.projectName')" prop="name">
|
|
|
+ <!-- <el-input v-model="addForm.name" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目名称" clearable></el-input> -->
|
|
|
+ <el-input v-model="addForm.name" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || (!permissions.projectManagement && addForm.creatorId != user.id && !permissions.projectCodeAndName) || isShowProjectName" maxlength="255" show-word-limit="true"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('projectclassification')" v-if="user.timeType.mainProjectState != '1'">
|
|
|
+ <!-- <el-select v-model="addForm.category" style="width:32%;" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id"> -->
|
|
|
+ <el-select v-model="addForm.category" style="width:32%;" clearable filterable :disabled="canOnlyModParticipator">
|
|
|
+ <el-option v-for="(item) in baseClfList" :key="item.id" :value="item.id" :label="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('projecttype')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" prop="isPublic">
|
|
|
+ <el-select v-model="addForm.isPublic" style="width:32%;" @change="selectPublic" :disabled="canOnlyModParticipator">
|
|
|
+ <el-option :value="0" :label="$t('zheng-shi-xiang-mu')"></el-option>
|
|
|
+ <el-option :value="1" :label="$t('fei-xiang-mu')"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('other.projectDescription')" prop="projectDesc">
|
|
|
+ <!-- <el-input v-model="addForm.projectDesc" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目描述" clearable maxlength="4000"></el-input> -->
|
|
|
+ <el-input v-model="addForm.projectDesc" :placeholder="$t('peaseenterthe')" clearable maxlength="4000" :disabled="canOnlyModParticipator" show-word-limit></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('Allparticipants')" v-show="addForm.isPublic == 0" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
|
|
|
+ <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate != 1">
|
|
|
+
|
|
|
+ <div slot="content" style="width:780px">{{addForm.userNames}}</div>
|
|
|
+ <el-input @focus="showChooseMembTree" v-model="addForm.userNames"></el-input>
|
|
|
+ </el-tooltip>
|
|
|
+
|
|
|
+ <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate == 1">
|
|
|
+ <div slot="content" style="width:780px">
|
|
|
+ <span v-for="(item, index) in addFormUserNames" :key="index">
|
|
|
+ <!-- {{item}} -->
|
|
|
+ <ww-open-data type='userName' :openid='item'></ww-open-data>
|
|
|
+ <span v-if="index < addFormUserNames.length - 1">,</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div @click="showChooseMembTree" style="width: 800px;overflow:hidden;white-space:nowrap;height:40px;border: 1px solid #DCDFE6;border-radius: 4px;box-sizing: border-box;padding: 0 10px">
|
|
|
+ <span v-for="(item, index) in addFormUserNames" :key="index">
|
|
|
+ <!-- {{item}} -->
|
|
|
+ <ww-open-data type='userName' :openid='item'></ww-open-data>
|
|
|
+ <span v-if="index < addFormUserNames.length - 1">,</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('projectmanager')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0)">
|
|
|
+ <el-select v-if="user.userNameNeedTranslate != 1" v-model="addForm.inchargerId" filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:32%;" :disabled="canOnlyModParticipator || projectManagerEdit">
|
|
|
+ <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
|
|
|
+ <span style="float: left">{{ item.name }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :subject="participator" :subjectId="addForm.inchargerId" :distinction="'3'" @selectCal="selectCal" :disabled="canOnlyModParticipator || projectManagerEdit || isShowProjectName"></selectCat>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item :label="$t('newspaperauditor')">
|
|
|
+ <el-select v-if="user.userNameNeedTranslate != '1'" @change="$forceUpdate()" v-model="addForm.auditUserIds" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" filterable :placeholder="$t('defaultistheprojectleader')" style="width:100%;" :multiple="user.timeType.reportAuditType != 6" >
|
|
|
+ <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :tile="true" :widthStr="'800'" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" :subjectId="addForm.auditUserIds" :subject="participator" :clearable="false" :distinction="'10'" :multiSelect="user.timeType.reportAuditType != 6" @selectCal="selectCal"></selectCat>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('ommencementDate')" prop="planStartDate" v-if="(user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
|
|
|
+ <el-date-picker v-model="addForm.planStartDate" :disabled="canOnlyModParticipator"
|
|
|
+ :editable="false" style="width:32%;"
|
|
|
+ format="yyyy-MM-dd"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ :clearable="false" type="date"
|
|
|
+ :placeholder="$t('optiondate')"></el-date-picker>
|
|
|
+
|
|
|
+ <span style="margin-left:63px;margin-right:10px;" >{{ $t('ji-hua-jie-shu-ri-qi') }}</span>
|
|
|
+ <el-date-picker v-model="addForm.planEndDate" style="width:33%;"
|
|
|
+ :editable="false" :disabled="canOnlyModParticipator"
|
|
|
+ format="yyyy-MM-dd"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ :clearable="false" type="date"
|
|
|
+ :placeholder="$t('optiondate')"></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 项目基线 -->
|
|
|
+ <div style="margin: 10px 0 30px 0;min-height:200px;" v-if="user.company.packageProject == 1 && !canOnlyModParticipator && (user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
|
|
|
+ <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
+ <el-tab-pane :label="$t('costbaseline')" name="baseCostPanel" >
|
|
|
+ <div style="padding-top:10px;">
|
|
|
+ <!--新版 -->
|
|
|
+ <span class="rg_span" v-for="(item, index) in projectBaseCostData" :key="item.id">
|
|
|
+ <span style="width:120px;display: inline-block;" v-if="user.company.packageProject==1">{{item.baseName}}</span>
|
|
|
+ <el-input :id="'baseCost'+index" @input="addUpfun()" v-model="item.baseAmount" style="width:200px; margin-bottom: 20px"
|
|
|
+ :placeholder="$t('zheng-shu')" clearable @keyup.native="restrictNumber('baseCost'+index)"></el-input><span style="margin-left:10px;">{{ $t('yuan') }}</span>
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <!-- 合计 -->
|
|
|
+ <div style="margin-top: 10px;float:right;">
|
|
|
+ <span style="margin-right:50px;margin-right:10px;" v-if="user.company.packageProject==1">{{ $t('other.totals') }}</span>
|
|
|
+ <span v-if="addForm.budget <= 0 || addForm.budget == undefined">0</span>
|
|
|
+ <span v-else>{{addForm.budget | numberToCurrency}}</span>
|
|
|
+ <span style="margin-right:50px;margin-left:10px;">{{ $t('yuan') }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer;">
|
|
|
+ <el-button @click.native="deletePro(1, addForm)" v-if="(permissions.projectManagement || user.id==deleteVif) && addForm.id" style="float:left">{{ $t('btn.delete') }}</el-button>
|
|
|
+ <el-button @click.native="addFormVisible = false">{{ $t('btn.cancel') }}</el-button>
|
|
|
+ <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 按部门选择人员 -->
|
|
|
+ <el-dialog :title="$t('selectingParticipants')" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
+ <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
|
|
|
+ <div v-if="user.userNameNeedTranslate == '1'">
|
|
|
+ <el-input placeholder="请输入内容" v-model.trim="filterText" class="input-with-select">
|
|
|
+ <el-button slot="append" icon="el-icon-search" @click="echartDepartment()"></el-button>
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="tree" style="height:400px">
|
|
|
+ <el-scrollbar style="height:100%">
|
|
|
+ <el-input
|
|
|
+ :placeholder="$t('keywordfiltering')"
|
|
|
+ v-model="filterText" v-if="user.userNameNeedTranslate != '1'">
|
|
|
+ </el-input>
|
|
|
+ <el-tree :data="deptMembData" :key="searchPersonnelFlgnum" show-checkbox :default-expand-all="searchPersonnelFlg" :props="defaultProps" node-key="id"
|
|
|
+ ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="addForm.userId"
|
|
|
+ highlight-current :filter-node-method="filterNode">
|
|
|
+ <span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
+ <span v-if="user.userNameNeedTranslate == '1'">
|
|
|
+ <span v-if="node.data.children">
|
|
|
+ <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <ww-open-data type='userName' :openid='node.label'></ww-open-data>
|
|
|
+ </span>
|
|
|
+ </span>
|
|
|
+ <span v-if="user.userNameNeedTranslate != '1'">
|
|
|
+ {{ node.label }}
|
|
|
+ </span>
|
|
|
+ <!-- {{ node.label }} -->
|
|
|
+ </span>
|
|
|
+ </el-tree>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <div>{{ $t('btn.choose') }} {{chosenMembCount}} {{ $t('other.people') }}</div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="chooseParticipVisible = false" >{{ $t('btn.cancel') }}</el-button>
|
|
|
+ <el-button type="primary" @click="chooseParticip()" >{{ $t('btn.determine') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!--用户详细信息弹出框-->
|
|
|
+ <el-dialog :title="$t('Checkthedetails')" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
|
|
|
+ <div class="line"><span>{{ $t('lable.name') +":"}}</span>
|
|
|
+ <span v-if="user.userNameNeedTranslate != 1">{{userDetail.name}}</span>
|
|
|
+ <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='userDetail.name'></ww-open-data></span>
|
|
|
+ </div>
|
|
|
+ <div class="line"><span>{{ $t('Worknumber') +":"}}</span><span>{{userDetail.jobNumber}}</span></div>
|
|
|
+ <div class="line"><span>{{ $t('lable.phone') +":"}}</span><span>{{userDetail.phone}}</span></div>
|
|
|
+ <div class="line"><span>{{ $t('jiao-se') +":"}}</span><span>{{userDetail.roleName}}</span></div>
|
|
|
+ <div class="line"><span>{{ $t('lable.department') +":"}}</span>
|
|
|
+
|
|
|
+ <span v-if="user.userNameNeedTranslate != 1">{{userDetail.departmentName}}</span>
|
|
|
+ <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='userDetail.departmentName'></ww-open-data></span>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </section>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+name: '',
|
|
|
+components: {},
|
|
|
+props: { },
|
|
|
+data() {
|
|
|
+return {
|
|
|
+ keyword:"",
|
|
|
+ searchField:"1",
|
|
|
+ user: JSON.parse(sessionStorage.getItem("user")),
|
|
|
+ total: 0,
|
|
|
+ page: 1,
|
|
|
+ size: localStorage.getItem("projectPageSize")==null?20:parseInt(localStorage.getItem("projectPageSize")),
|
|
|
+ listLoading:false,
|
|
|
+ approvalStatusStr:["待审核","已通过","已驳回"],
|
|
|
+ importanceList:[{id:1,label:this.$t('zheng-chang')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}],
|
|
|
+ importanceListLable:[this.$t('zheng-chang'), this.$t('jin-ji'), this.$t('zhong-yao'), this.$t('zhong-yao-qie-jin-ji'), this.$t('di-feng-xian'), this.$t('zhong-feng-xian'), this.$t('gao-feng-xian')],
|
|
|
+ addFormVisible:false,
|
|
|
+ baseCostItemList:[],
|
|
|
+ permissions: JSON.parse(sessionStorage.getItem("permissions")),
|
|
|
+ addForm: {
|
|
|
+ name: '',
|
|
|
+ userId: [],
|
|
|
+ level:1,
|
|
|
+ bu:'',
|
|
|
+ id: '',
|
|
|
+ code: '',
|
|
|
+ projectDesc: '',
|
|
|
+ alarmType: 0
|
|
|
+ },
|
|
|
+ projectBaseCostData:[],
|
|
|
+ activeName:"baseCostPanel",
|
|
|
+ baseClfList:[],
|
|
|
+ addFormUserNames: [],
|
|
|
+ deptMembData: [
|
|
|
+ {
|
|
|
+ id: 0,
|
|
|
+ label: this.$t('lable.unassigned'),
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ allMembData:[],
|
|
|
+ participator:[],
|
|
|
+ chosenListBackup: [],
|
|
|
+ chooseParticipVisible:false,
|
|
|
+ rules: {
|
|
|
+ name: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
|
|
|
+ code: [{ required: true, message: this.$t('qing-shu-ru-bian-hao'), trigger: "blur" }],
|
|
|
+ projectStageName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
|
|
|
+ projectLevelName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
|
|
|
+ deptId: [{ required: true, message: '请选择所属部门', trigger: "blur" }]
|
|
|
+ },
|
|
|
+ chosenMembCount:0,
|
|
|
+ dataDetail:{},
|
|
|
+ userDetailVisible:false,
|
|
|
+ userDetail:{},
|
|
|
+}
|
|
|
+},
|
|
|
+computed: {},
|
|
|
+watch: {},
|
|
|
+created () {},
|
|
|
+mounted () {
|
|
|
+ this.getList();
|
|
|
+ this.getProjectBaseConfigList();
|
|
|
+ this.getClfConfigList();
|
|
|
+ this.getDepartment();
|
|
|
+ this.getUsers();
|
|
|
+},
|
|
|
+methods: {
|
|
|
+ isSelectable(row,index){
|
|
|
+ if(row.creatorId == this.user.id || row.inchargerId == this.user.id || this.permissions.projectApprovalEdit){
|
|
|
+ return true
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submitInsert() {
|
|
|
+ this.$refs.form1.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.addLoading = true;
|
|
|
+ let targetData = {};
|
|
|
+ targetData.projectName= this.addForm.name
|
|
|
+ if(this.addForm.projectDesc != null) {
|
|
|
+ targetData.projectDesc=this.addForm.projectDesc
|
|
|
+ }
|
|
|
+ if(this.addForm.id != null) {
|
|
|
+ targetData.id=this.addForm.id
|
|
|
+ }
|
|
|
+ if(this.addForm.isPublic != null) {
|
|
|
+ targetData.isPublic=this.addForm.isPublic
|
|
|
+ }
|
|
|
+ if(this.addForm.userId.length != 0 && this.addForm.isPublic == 0) {
|
|
|
+ let userArray=[]
|
|
|
+ for(let i in this.addForm.userId){
|
|
|
+ userArray.push({
|
|
|
+ "userId":this.addForm.userId[i]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ targetData.participationApprovalList=userArray
|
|
|
+ }
|
|
|
+ if(this.addForm.inchargerId != null) {
|
|
|
+ targetData.inchargerId=this.addForm.inchargerId
|
|
|
+ }
|
|
|
+ if(this.addForm.code != null) {
|
|
|
+ targetData.projectCode=this.addForm.code
|
|
|
+ }
|
|
|
+ if(this.addForm.planStartDate != null) {
|
|
|
+ targetData.planStartDate=this.addForm.planStartDate
|
|
|
+ }
|
|
|
+ if(this.addForm.planEndDate != null) {
|
|
|
+ targetData.planEndDate=this.addForm.planEndDate
|
|
|
+ }
|
|
|
+ if(this.addForm.level != null) {
|
|
|
+ targetData.level=this.addForm.level
|
|
|
+ }
|
|
|
+ if(this.addForm.contractAmount != null) {
|
|
|
+ targetData.contractAmount=this.addForm.contractAmount
|
|
|
+ }
|
|
|
+ if (this.projectBaseCostData != null) {
|
|
|
+ targetData.projectApprovalBasecostList=this.projectBaseCostData
|
|
|
+ //计算总预算成本
|
|
|
+ if (this.addForm.budget == null) {
|
|
|
+ this.addForm.budget = 0;
|
|
|
+ }
|
|
|
+ targetData.budget=this.addForm.budget
|
|
|
+ }
|
|
|
+ if (this.addForm.contractAmount) {
|
|
|
+ targetData.contractAmount=this.addForm.contractAmount
|
|
|
+ } else {
|
|
|
+ targetData.contractAmount=0
|
|
|
+ }
|
|
|
+ if (this.user.timeType.outputValueStatus == 1){
|
|
|
+ targetData.outputValue=this.addForm.outputValue ? this.addForm.outputValue : 0
|
|
|
+ }
|
|
|
+ //日报审核人
|
|
|
+ if (this.addForm.auditUserIds) {
|
|
|
+ targetData.auditUserIds=this.addForm.auditUserIds
|
|
|
+ }
|
|
|
+ if(this.addForm.auditUserIds.length != 0) {
|
|
|
+ let userArray=[]
|
|
|
+ for(let i in this.addForm.auditUserIds){
|
|
|
+ userArray.push({
|
|
|
+ "auditorId":this.addForm.auditUserIds[i]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ targetData.projectApprovalAuditorList=userArray
|
|
|
+ }
|
|
|
+ if(this.addForm.category != null) {
|
|
|
+ targetData.category=this.addForm.category
|
|
|
+ }
|
|
|
+ this.http.JSONPost("/project-approval/editProjectApproval",targetData,
|
|
|
+ res => {
|
|
|
+ this.addLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: (this.addForm.id!=null?this.$t('xiu-gai'):this.$t('create'))+this.$t('other.successful'),
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.addFormVisible = false;
|
|
|
+ this.getList();
|
|
|
+ if (this.user.company.packageEngineering == 1) {
|
|
|
+ this.saveProjectProfessions(res.data);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.addLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取分类条目
|
|
|
+ getClfConfigList() {
|
|
|
+ this.http.get('/project-category/list',
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.baseClfList = res.data;
|
|
|
+ // console.log("获取分类条目",res.data);
|
|
|
+ this.$forceUpdate();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ },
|
|
|
+ //分页
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.page = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.size = val;
|
|
|
+ localStorage.projectPageSize = this.size;
|
|
|
+ this.page = 1
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ getProjectBaseConfigList() {
|
|
|
+ this.http.post('/project-basecost-setting/list',{},
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.baseCostItemList = res.data;
|
|
|
+ this.$forceUpdate();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ //显示新增界面
|
|
|
+ handleAdd(i, item) {
|
|
|
+ if(i == -1) {
|
|
|
+ this.title = this.$t('newproject');
|
|
|
+ this.addForm = {
|
|
|
+ name: '',
|
|
|
+ isPublic:0,
|
|
|
+ userId: [],
|
|
|
+ userNames:'',
|
|
|
+ code:'',
|
|
|
+ inchargerId:null,
|
|
|
+ level: this.user.timeType.projectLevelState == 1 ? (this.levelList.length > 0 ? this.levelList[0].id : null) : 1,
|
|
|
+ customerId:null,
|
|
|
+ notifyUserNames:'',
|
|
|
+ chosenLeaders:[],
|
|
|
+ category:null,
|
|
|
+ creatorId: this.user.id,
|
|
|
+ projectMainId: '',
|
|
|
+ outputValue: '',
|
|
|
+ bu: [],
|
|
|
+ manDay:0,
|
|
|
+ fromOutside: 0,
|
|
|
+ }
|
|
|
+ this.projectBaseCostData = [];
|
|
|
+ this.auseList = [];
|
|
|
+ for (var m=0;m<this.baseCostItemList.length; m++) {
|
|
|
+ this.projectBaseCostData.push({baseId: this.baseCostItemList[m].id, baseName:this.baseCostItemList[m].name, baseAmount:0});
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.http.post('/project-approval/getDetail', {id: item.id},
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.dataDetail=res.data
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var arr=[]
|
|
|
+ var names=""
|
|
|
+ var auditorArr=[]
|
|
|
+ if(this.dataDetail.participationApprovalList){
|
|
|
+ for(let i in this.dataDetail.participationApprovalList){
|
|
|
+ arr.push(this.dataDetail.participationApprovalList[i].userId);
|
|
|
+ }
|
|
|
+ this.participator=this.dataDetail.participationApprovalList
|
|
|
+ }
|
|
|
+ if(this.dataDetail.participationApprovalList){
|
|
|
+ for(let i in this.dataDetail.participationApprovalList){
|
|
|
+ names+=this.dataDetail.participationApprovalList[i].userName+",";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // if (names.length > 0) {
|
|
|
+ // names = names.substring(0, names.length -1);
|
|
|
+ // }
|
|
|
+ if(this.dataDetail.projectApprovalAuditorList){
|
|
|
+ for(let i in this.dataDetail.projectApprovalAuditorList){
|
|
|
+ auditorArr.push(this.dataDetail.projectApprovalAuditorList[i].auditorId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (names.length > 0) {
|
|
|
+ names = names.substring(0, names.length -1);
|
|
|
+ }
|
|
|
+ this.addForm = {
|
|
|
+ id: item.id,
|
|
|
+ name: item.projectName,
|
|
|
+ userId: arr,
|
|
|
+ auditUserIds:auditorArr,
|
|
|
+ userNames:names,
|
|
|
+ isPublic: item.isPublic,
|
|
|
+ code:item.projectCode,
|
|
|
+ inchargerId: item.inchargerId,
|
|
|
+ level: item.level,
|
|
|
+ planStartDate: item.planStartDate,
|
|
|
+ planEndDate: item.planEndDate,
|
|
|
+ budget: item.budget,
|
|
|
+ baseMan: item.baseMan,
|
|
|
+ contractAmount: item.contractAmount,
|
|
|
+ baseFee: item.baseFee,
|
|
|
+ baseRisk1: item.baseRisk1,
|
|
|
+ baseRisk2: item.baseRisk2,
|
|
|
+ baseOutsourcing: item.baseOutsourcing,
|
|
|
+ customerId:item.customerId==0?null:item.customerId,
|
|
|
+ category:item.category,
|
|
|
+ projectDesc: item.projectDesc,
|
|
|
+ creatorId: item.creatorId,
|
|
|
+ outputValue: item.outputValue,
|
|
|
+ }
|
|
|
+ this.changeParticipator();
|
|
|
+ this.getProjectBaseData(item.id);
|
|
|
+ }
|
|
|
+ console.log('=========>',this.participator)
|
|
|
+ this.addFormVisible = true;
|
|
|
+ },
|
|
|
+ //获取项目列表
|
|
|
+ getList() {
|
|
|
+ localStorage.projectPageIndex = this.page;
|
|
|
+ this.listLoading = true;
|
|
|
+ let parameter = {
|
|
|
+ pageIndex: this.page,
|
|
|
+ pageSize: this.size,
|
|
|
+ keyword:this.keyword,
|
|
|
+ searchField: this.searchField,
|
|
|
+ category:this.statusClf,
|
|
|
+ status: this.status,
|
|
|
+ }
|
|
|
+ this.http.post("/project-approval/listByPage", parameter,
|
|
|
+ res => {
|
|
|
+ this.listLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ var list = res.data.records;
|
|
|
+ this.list = list;
|
|
|
+ this.total = res.data.total;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.listLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 项目基线合计
|
|
|
+ addUpfun() {
|
|
|
+ var total = 0;
|
|
|
+ for (var i=0;i<this.projectBaseCostData.length; i++) {
|
|
|
+ if (this.projectBaseCostData[i].baseAmount) {
|
|
|
+ total += parseFloat(this.projectBaseCostData[i].baseAmount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.addForm.budget = total;
|
|
|
+ },
|
|
|
+ restrictNumber(targetId) {
|
|
|
+ let inpu = document.getElementById(targetId);
|
|
|
+ inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
|
|
|
+ inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
|
|
|
+ inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
|
|
|
+ inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
|
|
|
+ if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
|
|
|
+ inpu.value = parseFloat(inpu.value);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ showChooseLeaderTree() {
|
|
|
+ this.chosenMembCount = this.chosenLeaders.length;
|
|
|
+ this.chooseLeaderVisible = true;
|
|
|
+ },
|
|
|
+ onLeaderTreeItemChange() {
|
|
|
+ var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
|
|
|
+ var list = chosenList.filter(item=>item.isUser == 1);
|
|
|
+ this.chosenMembCount = list.length;
|
|
|
+ },
|
|
|
+
|
|
|
+ showChooseMembTree() {
|
|
|
+ this.deptMembData = JSON.parse(JSON.stringify(this.allMembData))
|
|
|
+ this.chosenMembCount = this.participator.length;
|
|
|
+ this.chooseParticipVisible = true;
|
|
|
+ this.filterText = ''
|
|
|
+ this.wxFilterText = ''
|
|
|
+ if(this.user.userNameNeedTranslate == 1) {
|
|
|
+ this.getDepartment()
|
|
|
+ }
|
|
|
+ let that = this
|
|
|
+ setTimeout(()=>{
|
|
|
+ that.chosenListBackup = that.$refs.chooseMembTree.getCheckedNodes();
|
|
|
+ }, 500)
|
|
|
+ },
|
|
|
+ onTreeItemChange() {
|
|
|
+ var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
|
|
|
+ var list = chosenList.filter(item=>item.isUser == 1);
|
|
|
+ this.chosenMembCount = list.length;
|
|
|
+ },
|
|
|
+ findUserInTree() {
|
|
|
+ if (this.filterName == '') {
|
|
|
+ this.deptMembData = this.allMembData;
|
|
|
+ } else {
|
|
|
+ var list = this.findRecursively(this.filterName, this.allMembData);
|
|
|
+ this.deptMembData = list;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ findRecursively(username, list) {
|
|
|
+ var filterList = [];
|
|
|
+ for (var i=0;i<list.length; i++) {
|
|
|
+ if (list[i].isUser == 1) {
|
|
|
+ if (list[i].label.indexOf(username) >= 0) {
|
|
|
+ //匹配上了
|
|
|
+ filterList.push(list[i]);
|
|
|
+ }
|
|
|
+ } else if (list[i].children != null && list[i].children.length > 0) {
|
|
|
+ var subList = this.findRecursively(username, list[i].children);
|
|
|
+ if (subList.length > 0) {
|
|
|
+ subList.forEach(s=>filterList.push(s));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return filterList;
|
|
|
+ },
|
|
|
+
|
|
|
+ //确定选择参与人
|
|
|
+ chooseParticip() {
|
|
|
+ this.chooseParticipVisible = false;
|
|
|
+ var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
|
|
|
+ if(this.searchPersonnelFlg) {
|
|
|
+ chosenList = [...chosenList, ...this.chosenListBackup]
|
|
|
+ }
|
|
|
+ this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
|
|
|
+ this.addForm.userNames = '';
|
|
|
+ this.addFormUserNames = []
|
|
|
+ this.addForm.userId = [];
|
|
|
+ this.participator = [];
|
|
|
+ for (var i=0;i<this.chosenMembList.length; i++) {
|
|
|
+ this.addForm.userId.push(this.chosenMembList[i].id);
|
|
|
+ this.addForm.userNames += this.chosenMembList[i].label+',';
|
|
|
+ this.addFormUserNames.push(this.chosenMembList[i].label)
|
|
|
+ var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
|
|
|
+ this.participator.push(item);
|
|
|
+ }
|
|
|
+ if (this.addForm.userNames.length > 0) {
|
|
|
+ this.addForm.userNames = this.addForm.userNames.substring(0, this.addForm.userNames.length-1);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取部门列表
|
|
|
+ getDepartment() {
|
|
|
+ this.http.post("/department/listAllMemb", {},
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ var list = res.data;
|
|
|
+ //设置员工到部门下面
|
|
|
+ this.setUserToDept(list);
|
|
|
+ this.deptMembData = list;
|
|
|
+ console.log(this.deptMembData, '看看数据')
|
|
|
+
|
|
|
+ //用于筛选过滤
|
|
|
+ this.allMembData = JSON.parse(JSON.stringify(this.deptMembData));
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onTreeItemChange() {
|
|
|
+ var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
|
|
|
+ var list = chosenList.filter(item=>item.isUser == 1);
|
|
|
+ this.chosenMembCount = list.length;
|
|
|
+ },
|
|
|
+ findUserInTree() {
|
|
|
+ if (this.filterName == '') {
|
|
|
+ this.deptMembData = this.allMembData;
|
|
|
+ } else {
|
|
|
+ var list = this.findRecursively(this.filterName, this.allMembData);
|
|
|
+ this.deptMembData = list;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addPersonCheck(){
|
|
|
+ var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
|
|
|
+ var list = chosenList.filter(item=>item.isUser == 1);
|
|
|
+ this.chosenMembCount = list.length;
|
|
|
+ // console.log(list);
|
|
|
+ },
|
|
|
+ addPersonSure(){
|
|
|
+ this.addGroupPersonPdialog = false
|
|
|
+ let chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
|
|
|
+ let list = chosenList.filter(item=>item.isUser == 1);
|
|
|
+ let listIDs = []
|
|
|
+ let listNames = ''
|
|
|
+ let listNamesList = []
|
|
|
+ for(let i=0;i<list.length;i++){
|
|
|
+ listIDs.push(list[i].id)
|
|
|
+ listNames += list[i].label + ','
|
|
|
+ listNamesList.push(list[i].label)
|
|
|
+ }
|
|
|
+ this.addGroupPersonData.person = listIDs
|
|
|
+ this.addGroupPersonData.personNames = listNames
|
|
|
+ this.addGroupPersonDataPersonNames = listNamesList
|
|
|
+ console.log('触发', this.addGroupPersonDataPersonNames)
|
|
|
+ },
|
|
|
+ // 企业微信搜索
|
|
|
+ echartDepartment() {
|
|
|
+ console.log('我点击了搜索')
|
|
|
+ if(this.filterText != '') {
|
|
|
+ this.http.post("/user/getEmployeeList", {
|
|
|
+ keyword: this.filterText,
|
|
|
+ cursor: '',
|
|
|
+ departmentId: -1,
|
|
|
+ pageIndex: 1,
|
|
|
+ pageSize: 1000
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.filterNodePersonnel = res.data.records.map(item => item.name)
|
|
|
+ this.$refs.chooseMembTree.filter(this.filterText);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.searchPersonnelFlgnum = +this.searchPersonnelFlgnum +1
|
|
|
+ this.searchPersonnelFlg = false
|
|
|
+ this.getDepartment()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setUserToDept(list) {
|
|
|
+ for (var i in list) {
|
|
|
+ if (list[i].children != null) {
|
|
|
+ this.setUserToDept(list[i].children);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (list[i].userList != null) {
|
|
|
+ if (list[i].children == null) {
|
|
|
+ list[i].children = [];
|
|
|
+ }
|
|
|
+ list[i].userList.forEach(element => {
|
|
|
+ var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
|
|
|
+ list[i].children.push(obj);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ formDataToObject(formData) {
|
|
|
+ const object = {};
|
|
|
+ for (const [key, value] of formData.entries()) {
|
|
|
+ if (key in object) {
|
|
|
+ object[key] = [].concat(object[key], value);
|
|
|
+ } else {
|
|
|
+ object[key] = value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return object;
|
|
|
+ },
|
|
|
+ searchList() {
|
|
|
+ this.page = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ // 分类筛选
|
|
|
+ searchClfList(){
|
|
|
+ this.page = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ getUsers() {
|
|
|
+ // this.http.post(this.port.manage.list, {
|
|
|
+ // departmentId: -1,
|
|
|
+ // pageIndex: 1,
|
|
|
+ // // pageSize: 99999
|
|
|
+ // pageSize: -1
|
|
|
+ // },
|
|
|
+ this.http.post('/user/getSimpleActiveUserList', {},
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.users = res.data;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 自定义组件事件
|
|
|
+ selectCal(obj) {
|
|
|
+ if(obj.distinction == '1') {
|
|
|
+ this.inchagerId = obj.id
|
|
|
+ this.manageSelect()
|
|
|
+ } else if(obj.distinction == '2') {
|
|
|
+ this.participationId = obj.id
|
|
|
+ this.participationSelect()
|
|
|
+ } else if(obj.distinction == '3') {
|
|
|
+ this.addForm.inchargerId = obj.id
|
|
|
+ // console.log(this.participator)
|
|
|
+ this.participator = JSON.parse(JSON.stringify(this.participator))
|
|
|
+ } else if(obj.distinction =='4') {
|
|
|
+ this.projectProfessionList[obj.other].inchargerId = obj.id
|
|
|
+ } else if(obj.distinction =='5') {
|
|
|
+ this.paramInchargerId = obj.id
|
|
|
+ }else if(obj.distinction =='6') {
|
|
|
+ this.hasSetGroupInchargerId = obj.id
|
|
|
+ } else if(obj.distinction == '10') {
|
|
|
+ let userList = obj.arrUserList
|
|
|
+ let arr = []
|
|
|
+ for(var i in userList) {
|
|
|
+ arr.push(userList[i].id)
|
|
|
+ }
|
|
|
+ this.participator = JSON.parse(JSON.stringify(this.participator))
|
|
|
+ this.addForm.auditUserIds = arr
|
|
|
+ } else if(obj.distinction == '11') {
|
|
|
+ let userList = obj.id
|
|
|
+ console.log(obj)
|
|
|
+ this.curProfessionRow.membList[obj.other].membId = userList
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getProjectBaseData(projectId) {
|
|
|
+ this.http.post('//project-approval-basecost/get',{projectId: projectId},
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.projectBaseCostData = res.data;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.listLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ selectPublic() {
|
|
|
+ if (this.addForm.isPublic == 1) {
|
|
|
+ this.participator = this.users;
|
|
|
+ } else {
|
|
|
+ this.participator = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //选择参与人
|
|
|
+ changeParticipator() {
|
|
|
+ //检查是否在参与人中,如果没有需要加入到参与人中
|
|
|
+ // console.log('addform',this.addForm.userId,this.users);
|
|
|
+ this.participator = [];
|
|
|
+ this.addForm.userId.forEach(u=>{
|
|
|
+ var list = this.users.filter(au=>au.id == u);
|
|
|
+ if (list.length > 0) {
|
|
|
+ var findUser = list[0];
|
|
|
+ this.participator.push(findUser);
|
|
|
+ } else {
|
|
|
+ console.log('未找到用户: '+u);
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //显示用户详情
|
|
|
+ showUser(userId) {
|
|
|
+ this.userDetailVisible = true;
|
|
|
+ this.http.post(this.port.manage.userDetail, {
|
|
|
+ userId: userId
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.userDetail = res.data;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+},
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style scoped lang='sass'>
|
|
|
+</style>
|
|
|
+<style>
|
|
|
+.toolbar_formitem_n1{
|
|
|
+ margin-right: 0 !important;
|
|
|
+}
|
|
|
+</style>
|