Forráskód Böngészése

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

zhouyy 3 hónapja
szülő
commit
f3c8be0a17

+ 6 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue

@@ -497,7 +497,7 @@
           <!-- 第一审核人 -->
           <el-form-item :label="$t('di-yi-shen-he-ren')" v-if="auditTypeItem.auditType == 2">
             <el-select v-if="user.userNameNeedTranslate != '1'" v-model="ParticularsList.firstCheckerId"
-              :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px" :disabled="ParticularsList.reviewProcess > 0"
+              :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px" :disabled="ParticularsList.reviewProcess > 0 || (flg || ParticularsList.ownerId == ParticularsList.operatorId)"
               filterable="true">
               <span v-for="(item, index) in users" :key="index">
                 <el-option :label="item.name" :value="item.id"></el-option>
@@ -505,13 +505,13 @@
             </el-select>
 
             <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'6'"
-              :subject="users" :subjectId="ParticularsList.firstCheckerId" ref="selectCat" :disabled="ParticularsList.reviewProcess > 0"
+              :subject="users" :subjectId="ParticularsList.firstCheckerId" ref="selectCat" :disabled="ParticularsList.reviewProcess > 0 || (flg || ParticularsList.ownerId == ParticularsList.operatorId)"
               @selectCal="selectCal"></selectCat>
           </el-form-item>
           <!-- 第二审核人 -->
           <el-form-item :label="$t('di-er-shen-he-ren')" v-if="auditTypeItem.auditType == 2">
             <el-select v-if="user.userNameNeedTranslate != '1'" v-model="ParticularsList.secondCheckerId"
-              :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px" :disabled="ParticularsList.reviewProcess > 1"
+              :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px" :disabled="ParticularsList.reviewProcess > 1 || (flg || ParticularsList.ownerId == ParticularsList.operatorId)"
               filterable="true">
               <span v-for="(item, index) in users" :key="index">
                 <el-option :label="item.name" :value="item.id"></el-option>
@@ -519,7 +519,7 @@
             </el-select>
 
             <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'7'"
-              :subject="users" :subjectId="ParticularsList.secondCheckerId" ref="selectCat" :disabled="ParticularsList.reviewProcess > 1"
+              :subject="users" :subjectId="ParticularsList.secondCheckerId" ref="selectCat" :disabled="ParticularsList.reviewProcess > 1 || (flg || ParticularsList.ownerId == ParticularsList.operatorId)"
               @selectCal="selectCal"></selectCat>
           </el-form-item>
 
@@ -1609,7 +1609,7 @@ export default {
     },
 
     denyReason(item) {
-      if (this.auditTypeItem.auditType == 0) {
+      if (this.auditTypeItem.auditType == 0 || this.auditTypeItem.auditType == 2) {
         this.denyForm.id = item.id
         this.denyForm.reason = ''
         // this.denyReasonDialog = true
@@ -1814,7 +1814,7 @@ export default {
             // this.users = res.data.records;
             const { id } = JSON.parse(sessionStorage.getItem('user'))
             this.users = res.data;
-            this.usersNoInfo = res.data.filter(item => item.id != id)
+            // this.usersNoInfo = res.data.filter(item => item.id != id)
             if (!this.permissions.costAudit) {
               this.addForm.ownerId = this.user.id;
               this.addForm.status = 1;

+ 107 - 44
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -38,7 +38,7 @@
                 </el-form-item>
                 <!-- 分类筛选 -->
                 <el-form-item >
-                    <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('fen-lei') }}</span>
+                    <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ user.companyId == 4811 ? '项目分类' : $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>
@@ -172,6 +172,8 @@
                     </template>
             </el-table-column> -->
             <el-table-column prop="projectCode" :label="user.companyId == '7030' ? '项目令号' : $t('Itemno')" sortable="custom" width="150"></el-table-column>
+            <el-table-column prop="projectMainName" :label="$t('zhu-xiang-mu')" sortable="custom" min-width="250" v-if="(user.timeType.mainProjectState == '1') || user.companyId == 4811">
+            </el-table-column>
             <el-table-column prop="contractCode" :label="$t('contractno')" width="200" v-if="user.companyId == '936'">
                 <template slot-scope="scope">
                     <!-- <div v-if="scope.row.projectSeparate">
@@ -241,8 +243,6 @@
                     <TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText>
                 </template>
             </el-table-column>
-            <el-table-column prop="projectMainName" :label="$t('zhu-xiang-mu')" sortable="custom" min-width="250" v-if="user.timeType.mainProjectState == '1'">
-            </el-table-column>
             <el-table-column prop="inchargerName" :label="$t('projectmanager')" sortable="custom" min-width="150">
                 <template slot-scope="scope">
                     <el-link type="primary" :underline="false" @click="showUser(scope.row.inchargerId)">
@@ -377,7 +377,7 @@
             </el-table-column>
             <el-table-column :label="$t('operation')" :width="showColumnWidth" align="left" fixed="right" v-if="showColumnWidth != '0' || permissions.projectManagement">
                 <template slot-scope="scope">
-                    <el-button v-if="(permissions.projectManagement || user.id==scope.row.creatorId) && user.timeType.mainProjectState != '1' && !user.timeType.hideSubproject" size="mini"  @click="subProject(scope.row)">{{ $t('lable.subproject') }}</el-button>
+                    <el-button v-if="((permissions.projectManagement || user.id==scope.row.creatorId) && user.timeType.mainProjectState != '1' && !user.timeType.hideSubproject) || user.companyId == 4811" size="mini"  @click="subProject(scope.row)">{{ $t('lable.subproject') }}</el-button>
                     <el-button size="mini" v-if="permissions.projectParticipator || permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId" type="primary" @click="handleAdd(scope.$index, scope.row)">{{ $t('bian-ji') }}</el-button>
                     <!-- <el-button v-if="permissions.projectManagement || user.id==scope.row.creatorId" size="mini"  @click="deletePro(scope.$index, scope.row)">删除</el-button> -->
                      <!--如果是威派格,项目经理不给权限-->
@@ -448,7 +448,7 @@
                         <!-- <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) || isShowProjectName" maxlength="50" show-word-limit="true"></el-input>
                     </el-form-item>
-                    <el-form-item :label="$t('zhu-xiang-mu')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.timeType.mainProjectState == '1'">
+                    <el-form-item :label="$t('zhu-xiang-mu')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.timeType.mainProjectState == '1'" prop="projectMainId">
                         <!-- <el-select v-model="addForm.projectMainId" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id" @change="projectManagementChange"> -->
                         <el-select v-model="addForm.projectMainId" clearable @change="projectManagementChange">
                             <el-option v-for="(item) in mainProjectList" :key="item.id" :value="item.id" :label="item.name + '\u3000' + item.code">
@@ -517,7 +517,7 @@
                     <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-input  @focus="showChooseMembTree()" v-model="addForm.userNames"></el-input>
                         </el-tooltip>
 
                         <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate == 1">
@@ -527,7 +527,7 @@
                                     <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">
+                            <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">
                                 <template v-for="(item, index) in addFormUserNames">
                                     <template v-if="index <= 13">
                                         <TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText>
@@ -538,6 +538,29 @@
                             </div>
                         </el-tooltip>
                     </el-form-item>
+                    <el-form-item label="项目参与部门">
+                        <template v-if="user.userNameNeedTranslate != 1">
+                            <div slot="content" style="width:780px">{{addForm.deptIdNames}}</div>
+                            <el-input @focus="showChooseMembTree('multipleDepartmentsSelected')" v-model="addForm.deptIdNames"></el-input>
+                        </template>
+                        <template v-if="user.userNameNeedTranslate == 1">
+                            <div slot="content" style="max-width: 780px;max-height: 400px;overflow-y: auto;">
+                                <span v-for="(item, index) in deptIdNames" :key="index">
+                                    <TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText>
+                                    <span v-if="index < deptIdNames.length - 1">,</span>
+                                </span>
+                            </div>
+                            <div @click="showChooseMembTree('multipleDepartmentsSelected')" style="width: 800px;overflow:hidden;white-space:nowrap;height:40px;border: 1px solid #DCDFE6;border-radius: 4px;box-sizing: border-box;padding: 0 10px">
+                                <template v-for="(item, index) in deptIdNames">
+                                    <template v-if="index <= 13">
+                                        <TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText>
+                                        <span v-if="index < deptIdNames.length - 1">,</span>
+                                        <span v-if="(deptIdNames || []).length > 13 && index == 13">...</span>
+                                    </template>
+                                </template>
+                            </div>
+                        </template>
+                    </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">
@@ -1229,7 +1252,7 @@
         </el-dialog>
 
         <!-- 按部门选择人员 -->
-        <el-dialog :title="$t('selectingParticipants')"  :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
+        <el-dialog :title="originallyDeptMembDataFlag == 'multipleDepartmentsSelected' ? '选择部门' : $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="$t('pleaseentercontent')" v-model.trim="filterText" class="input-with-select" @keyup.enter.native="echartDepartment()">
@@ -1263,7 +1286,7 @@
                     </el-tree>
                 </el-scrollbar>
             </div>
-            <div>{{ $t('btn.choose') }}&nbsp;{{chosenMembCount}}&nbsp;{{ $t('other.people') }}</div>
+            <div v-if="originallyDeptMembDataFlag != 'multipleDepartmentsSelected'">{{ $t('btn.choose') }}&nbsp;{{chosenMembCount}}&nbsp;{{ $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>
@@ -1908,7 +1931,8 @@ a {
                     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: this.$t('qingXuanZeSuoShuBuMen'), trigger: "blur" }]
+                    deptId: [{ required: true, message: this.$t('qingXuanZeSuoShuBuMen'), trigger: "blur" }],
+                    projectMainId: [{ required: JSON.parse(sessionStorage.getItem("user")).companyId == 4811, message: '请选择', trigger: "change" }]
                 },
                 ause: [],
                 auseList: [],
@@ -2072,7 +2096,10 @@ a {
                 participatorValue: [],
                 batchChangeStageDialogVisible: false,
                 batchChangeStageLoading: false,
-                batchProjectTaskParticipantVisible: false
+                batchProjectTaskParticipantVisible: false,
+                originallyDeptMembData: [],
+                originallyDeptMembDataTwo: [],
+                originallyDeptMembDataFlag: 'personnel'
             };
         },
         // 过滤器
@@ -3931,14 +3958,33 @@ a {
                 this.chosenMembCount = list.length;
             },
 
-            showChooseMembTree() {
-                this.deptMembData = JSON.parse(JSON.stringify(this.allMembData))
+            showChooseMembTree(type = false) {
+                if(!type) {
+                    this.originallyDeptMembDataFlag = 'personnel'
+                    this.deptMembData = JSON.parse(JSON.stringify(this.originallyDeptMembDataTwo))
+                    this.allMembData = JSON.parse(JSON.stringify(this.originallyDeptMembDataTwo))
+                    console.log(this.deptMembData, '<=== this.deptMembData')
+                    setTimeout(()=>{
+                        const numberArray = this.addForm.userId
+                        this.$refs.chooseMembTree.setCheckedKeys([...numberArray])
+                    }, 500)
+                } else {
+                    this.originallyDeptMembDataFlag = type
+                    this.deptMembData = JSON.parse(JSON.stringify(this.originallyDeptMembData))
+                    this.allMembData = JSON.parse(JSON.stringify(this.originallyDeptMembData))
+                    setTimeout(()=>{
+                        const numberArray = this.addForm.deptIds
+                        this.$refs.chooseMembTree.setCheckedKeys([...numberArray])
+                    }, 500)
+                }
+                // 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()
+                    this.getDepartment(type)
                 }
                 let that = this
                 setTimeout(()=>{    
@@ -3980,31 +4026,38 @@ a {
 
             //确定选择参与人
             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);
-                    // this.addFormUserNames = this.addFormUserNames.substring(0, this.addFormUserNames.length-1);
-                }
+                if(this.originallyDeptMembDataFlag == 'personnel') {
+                    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);
+                        // this.addFormUserNames = this.addFormUserNames.substring(0, this.addFormUserNames.length-1);
+                    }
 
-                console.log(this.addForm.userId)
-                console.log(this.addForm.userNames)
-                console.log(this.addFormUserNames)
+                    console.log(this.addForm.userId)
+                    console.log(this.addForm.userNames)
+                    console.log(this.addFormUserNames)
+                } else {
+                    this.addForm.deptIds = chosenList.map(item => item.id)
+                    this.addForm.deptIdNames = chosenList.map(item => item.label)
+                }
+                
+                this.chooseParticipVisible = false;
+                
             },
 
             //选中相关领导
@@ -4027,18 +4080,23 @@ a {
             // },
 
             // 获取部门列表
-            getDepartment() {
+            getDepartment(type = false) {
                 this.http.post("/department/listAllMemb", {},
                 res => {
                     if (res.code == "ok") {
+                        this.originallyDeptMembData = JSON.parse(JSON.stringify(res.data))
                         var list = res.data;
                         //设置员工到部门下面
                         this.setUserToDept(list);
-                        this.deptMembData = list;
-                        console.log(this.deptMembData, '看看数据')
-                        
-                        //用于筛选过滤
+                        this.originallyDeptMembDataTwo = JSON.parse(JSON.stringify(list))
+                        if(!type) {
+                            //用于筛选过滤
+                            this.deptMembData = list;
+                        } else {
+                            this.deptMembData = JSON.parse(JSON.stringify(res.data))
+                        }
                         this.allMembData = JSON.parse(JSON.stringify(this.deptMembData));
+                        
                     } else {
                         this.$message({
                             message: res.msg,
@@ -5046,7 +5104,9 @@ a {
                         bu: [],
                         manDay:0,
                         fromOutside: 0,
-                        // deptId: []
+                        // deptId: [],
+                        deptIds: [],
+                        deptIdNames: []
                     }
                     this.estimatedWorkTime=''
                     for(var i in this.dataList) {
@@ -5183,7 +5243,9 @@ a {
                         manDay:item.manDay==null?0:item.manDay,
                         manDayStartDate:item.manDayStartDate,
                         manDayDisable:item.manDay,
-                        fromOutside:item.fromOutside
+                        fromOutside:item.fromOutside,
+                        deptIds: (item.departmentList || []).map(item => item.departmentId),
+                        deptIdNames: (item.departmentList || []).map(item => item.departmentName)
                     }
                     for(var i in this.dataList) {
                         var str = 'plate' + (+i + 1)
@@ -5601,6 +5663,7 @@ a {
                         if (this.addForm.reviwerId) {
                             formData.append('reviwerId', this.addForm.reviwerId);
                         }
+                        formData.append('deptIds', this.addForm.deptIds.join(','))
                         this.http.uploadFile(this.port.project.add,formData,
                         res => {
                             this.addLoading = false;