Browse Source

提交项目管理的批量修改项目阶段

Lijy 10 tháng trước cách đây
mục cha
commit
e2e966d53c

+ 4 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -2161,5 +2161,8 @@
   "suoShuRenWuFenZu": "Task group to which it belongs",
   "suoShuRenWuLieBiao": "Task List",
   "tongYiGeZhiHangRenFuWuBuNengXiangTong": "The same executor cannot provide the same service",
-  "xiangMuFuWu": "Project Services"
+  "xiangMuFuWu": "Project Services",
+  "buShuYuNingDeQuanXianNei": "Not within your permission",
+  "piLiangXiuGaiXiangMuJieDuan": "Batch modification project phase",
+  "piLiangCaoZuo": "Batch operation"
 }

+ 4 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -2161,5 +2161,8 @@
   "qingXuanZeSuoShuXiangMu": "请选择所属项目",
   "qingXuanZeSuoShuRenWuFenZu": "请选择所属任务分组",
   "qingXuanZeSuoShuRenWuLieBiao": "请选择所属任务列表",
-  "tongYiGeZhiHangRenFuWuBuNengXiangTong": "同一个执行人,服务不能相同"
+  "tongYiGeZhiHangRenFuWuBuNengXiangTong": "同一个执行人,服务不能相同",
+  "piLiangXiuGaiXiangMuJieDuan": "批量修改项目阶段",
+  "buShuYuNingDeQuanXianNei": "不属于您的权限内",
+  "piLiangCaoZuo": "批量操作"
 }

+ 94 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -389,8 +389,34 @@
 
         <!--工具条-->
         <el-col :span="24" class="toolbar">
-                <el-button size="small" @click="batchSetWudulistBtn1" v-if="(user.timeType.customDegreeActive || user.company.packageProject) && (showColumnWidth != '0' || permissions.projectManagement)">{{ $t('btn.cancel') }}</el-button>
-            <template v-if="user.timeType.customDegreeActive && (showColumnWidth != '0' || permissions.projectManagement)">
+            <el-button size="small" @click="batchSetWudulistBtn1" v-if="(user.timeType.customDegreeActive || user.company.packageProject) && (showColumnWidth != '0' || permissions.projectManagement)">{{ $t('btn.cancel') }}</el-button>
+            <el-dropdown>
+                <el-button type="primary" size="small">
+                    {{ $t('piLiangCaoZuo') }}<i class="el-icon-arrow-down el-icon--right"></i>
+                </el-button>
+                <el-dropdown-menu slot="dropdown">
+                    <template v-if="user.timeType.customDegreeActive && (showColumnWidth != '0' || permissions.projectManagement)">
+                        <el-dropdown-item><el-button type="text" @click="batchSetWudulistBtn2(true)">{{ $t('volumeset') }} {{user.timeType.customDegreeName}}</el-button></el-dropdown-item>
+                        <el-dropdown-item><el-button type="text" @click="batchSetWudulistBtn2(false)">{{ $t('pi-liang-tian-jia') }} {{user.timeType.customDegreeName}}</el-button></el-dropdown-item>
+                    </template>
+                    <template v-if="user.company.packageProject && (showColumnWidth != '0' || permissions.projectManagement)">
+                        <el-dropdown-item><el-button type="text" @click="addTaskGroup()" >{{ $t('piLiangZengJiaRenWuFenZu') }}</el-button></el-dropdown-item>
+                    </template>
+                    <template v-if="user.company.packageProject && (showColumnWidth != '0' || permissions.projectManagement)">
+                        <el-dropdown-item><el-button type="text" @click="setGroupIncharger()" >{{ $t('piLiangSheZhiFenZuFuZeRen') }}</el-button></el-dropdown-item>
+                    </template>
+                    <template v-if="user.company.packageProject && (showColumnWidth != '0' || permissions.projectManagement)">
+                        <el-dropdown-item><el-button type="text" @click="addGroupPerson()" :loading="addGroupPersonBtnLoading">{{ $t('groupparticipantsinbatches') }}</el-button></el-dropdown-item>
+                    </template>
+                    <template v-if="(showColumnWidth != '0' || permissions.projectManagement)">
+                        <el-dropdown-item><el-button type="text" @click="addProPreson()">{{ $t('projectparticipantsinbatches') }}</el-button></el-dropdown-item>
+                        <el-dropdown-item><el-button type="text" v-if="permissions.projectManagement" @click="batchIncharger()">{{ $t('projectmanagersinbatches') }}</el-button></el-dropdown-item>
+                        <el-dropdown-item><el-button type="text" v-if="user.company.packageProject" @click="batchProjectStage()">{{ $t('piLiangXiuGaiXiangMuJieDuan') }}</el-button></el-dropdown-item>
+                        <el-dropdown-item><el-button type="text" v-if="user.roleName=($t('role.superAdministrator'))" @click="batchDelete()" :loading="isDeleting">{{ $t('Batchdelete') }}</el-button></el-dropdown-item>
+                    </template>
+                </el-dropdown-menu>
+            </el-dropdown>
+            <!-- <template v-if="user.timeType.customDegreeActive && (showColumnWidth != '0' || permissions.projectManagement)">
                 <el-button size="small" type="primary" @click="batchSetWudulistBtn2(true)">{{ $t('volumeset') }} {{user.timeType.customDegreeName}}</el-button>
                 <el-button size="small" type="primary" @click="batchSetWudulistBtn2(false)">{{ $t('pi-liang-tian-jia') }} {{user.timeType.customDegreeName}}</el-button>
             </template>
@@ -408,6 +434,9 @@
                 <el-button size="small" type="primary" v-if="permissions.projectManagement" @click="batchIncharger()">{{ $t('projectmanagersinbatches') }}</el-button>
                 <el-button size="small" type="primary" v-if="user.roleName=($t('role.superAdministrator'))" @click="batchDelete()" :loading="isDeleting">{{ $t('Batchdelete') }}</el-button>
             </template>
+            <template v-if="showColumnWidth != '0' && user.company.packageProject == 1">
+                <el-button size="small" type="primary" @click="batchProjectStage()">{{ $t('piLiangXiuGaiXiangMuJieDuan') }}</el-button>
+            </template> -->
             
             <el-pagination :key="projectListPageComponentKey"
                 @size-change="handleSizeChange"
@@ -1431,8 +1460,8 @@
             </div>
         </el-dialog>
 
-        <el-dialog :title="$t('xiu-gai-xiang-mu-dang-qian-jie-duan')" v-if="changeStageDialogVisible" :visible.sync="changeStageDialogVisible" width="300px">
-            <el-select v-model="curChangeProject.curStageId" filterable :placeholder="$t('pleaseselecttheprojectphase')" style="margin: 0 auto;">
+        <el-dialog :title="$t('xiu-gai-xiang-mu-dang-qian-jie-duan')" v-if="changeStageDialogVisible" :visible.sync="changeStageDialogVisible" width="500px">
+            <el-select v-model="curChangeProject.curStageId" filterable :placeholder="$t('pleaseselecttheprojectphase')" style="width: 100%;">
                 <el-option v-for="(item, index) in phaseList" :key="index" :label="item.projectStageName" :value="item.id"> </el-option>
             </el-select>
             <div slot="footer" class="dialog-footer" style="text-algin:center;">
@@ -1440,6 +1469,15 @@
             </div>
         </el-dialog>
 
+        <el-dialog :title="$t('piLiangXiuGaiXiangMuJieDuan')" v-if="batchChangeStageDialogVisible" :visible.sync="batchChangeStageDialogVisible" width="500px">
+            <el-select v-model="curChangeProject.curStageId" filterable :placeholder="$t('pleaseselecttheprojectphase')" style="width: 100%">
+                <el-option v-for="(item, index) in phaseList" :key="index" :label="item.projectStageName" :value="item.id"> </el-option>
+            </el-select>
+            <div slot="footer" class="dialog-footer" style="text-algin:center;">
+                <el-button type="primary" @click="editBatchProjectStage()" :loading="batchChangeStageLoading">{{ $t('btn.determine') }}</el-button>
+            </div>
+        </el-dialog>
+
         <el-dialog append-to-body :title="$t('projectimportresult')" v-if="showImportResult" :visible.sync="showImportResult" width="40%">
                 <div >
                     {{importResultMsg}}
@@ -2044,6 +2082,8 @@ a {
                 changeParticipation:false,
                 participatorVisible: false,
                 participatorValue: [],
+                batchChangeStageDialogVisible: false,
+                batchChangeStageLoading: false
             };
         },
         // 过滤器
@@ -2222,6 +2262,55 @@ a {
                 });
 
             },
+            // 批量修改项目阶段
+            batchProjectStage() {
+                if (this.checkedProjectArr.length == 0) {
+                    this.$message(this.$t('defaultText.pleaseSelectSnItem'))
+                    return
+                }
+                const projectManagement = this.permissions.projectManagement
+                const userId = this.user.id
+                const list = this.checkedProjectArr.filter((item) => {
+                    return item.inchargerId != userId && item.creatorId != userId 
+                })
+                if(!projectManagement && list.length > 0) {
+                    const promptText = list.map(item => item.projectName)
+                    this.$message(`${this.$t('other.project')}[${promptText.join(',')}]${this.$t('buShuYuNingDeQuanXianNei')}`)
+                    return
+                }
+                this.curChangeProject = { projectId: '', curStageId: '' }
+                this.batchChangeStageDialogVisible = true
+            },
+            editBatchProjectStage() {
+                const projectIdList = this.checkedProjectArr.map(a => a.id)
+                const stageId = this.curChangeProject.curStageId
+                const stage = this.phaseList.find(item => item.id == stageId)
+                this.batchChangeStageLoading = true
+                this.http.post('/project/batchChangeStage', {
+                    projectIdArray: JSON.stringify(projectIdList),
+                    stageId: stageId,
+                    stageName: stage.projectStageName
+                },
+                res => {
+                    this.batchChangeStageLoading = false
+                    if (res.code == "ok") {
+                        this.getList()
+                        this.batchChangeStageDialogVisible = false;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.batchChangeStageLoading = false
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
             confirmChangeStage() {
                 let currentStageName = ''
                 for(var i in this.phaseList) {
@@ -2778,6 +2867,7 @@ a {
                 }
                 this.addTaskGroupDig=true
             },
+            
             // 重新定义了 addGroup 方法
             addGroup(formName) {
                 // return