yurk 2 jaren geleden
bovenliggende
commit
12476b0377
1 gewijzigde bestanden met toevoegingen van 110 en 4 verwijderingen
  1. 110 4
      fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

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

@@ -585,6 +585,14 @@
                         :clearable="false" type="date" 
                         :placeholder="$t('optiondate')"></el-date-picker>
                     </el-form-item>
+
+                    <!-- 增加BU字段 绎维固定字段 -->
+                    <el-form-item label="BU" v-if="user.companyId == '862'">
+                        <el-cascader ref="deptCascader"  v-model="addForm.bu" style="width: 250px" @change="chooseDept"
+                            :options="buOption" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable v-show="user.userNameNeedTranslate != 1"></el-cascader>
+                        <vueCascader :size="'small'" :subjectId="addForm.bu" :widthStr="'200'" :clearable="true" :subject="option" :radios="true" :distinction="'32'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
+                    </el-form-item>
+
                     <el-form-item :label="$t('projectoutput')" prop="outputValue" v-if="user.timeType.outputValueStatus == 1">
                         <el-input id="outputValue" v-model="addForm.outputValue" style="width:32%;"
                         placeholder="" clearable  @keyup.native="restrictNumber('outputValue')">
@@ -866,8 +874,9 @@
                     </template>
             </el-table-column>
             <el-table-column prop="name" :label="$t('names')" ></el-table-column>
-            <el-table-column :label="$t('operation')" width="150">
+            <el-table-column :label="$t('operation')" :width="user.companyId == '862' ? '300px' : '180px'">
                 <template slot-scope="scope" >
+                     <el-button size="small" type="primary"  @click="auditProcess(scope.row)" v-if="user.companyId == '862'" >{{ $t('AuditProcess') }}</el-button>
                     <el-button size="small" type="primary" @click="addNewClf(scope.row)">{{ $t('bian-ji') }}</el-button>
                     <el-button size="small" type="danger" @click="deleteClf(scope.row)">{{ $t('btn.delete') }}</el-button>
                 </template>
@@ -975,6 +984,22 @@
                 <el-button type="primary" @click="submitClf" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
             </div>
         </el-dialog>
+        <!-- 分类条目有关审核流程设置 -->
+        <el-dialog :title="$t('AuditProcess')" v-if="auditProcessDialog" :visible.sync="auditProcessDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
+            <el-form ref="form2" :model="auditProcess" :rules="rules" label-width="150px">
+                <!-- <el-form-item :label="$t('mainProjectName')" prop="name"> -->
+                <el-form-item :label="$t('AuditProcess')" prop="name">
+                    <template>
+                    <el-checkbox v-model="addClf.proInchargerAudit" >项目审核人审核</el-checkbox>
+                    <el-checkbox v-model="addClf.proBuAudit" >项目所属BU负责人审核</el-checkbox>
+                    </template>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button @click.native="auditProcessDialog = false">{{ $t('btn.cancel') }}</el-button>
+                <el-button type="primary" @click="submitClf" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
+            </div>
+        </el-dialog>
         <!-- 新增/编辑主项目 -->
         <el-dialog :title="$t('modifythemainproject')" v-if="addFlgmainProjectDialog" :visible.sync="addFlgmainProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
             <el-form ref="form2" :model="addMainForm" :rules="rules" label-width="100px">
@@ -1314,6 +1339,7 @@ a {
                 isganttshow: false,
                 deleteAlertMsg: null,
                 chosenLeaders:[],
+                baseClfList:[],
                 chooseLeaderVisible:false,
                 projectProfessionItem:null,
                 curProfessionRow:null,
@@ -1324,6 +1350,7 @@ a {
                 chosenMembCount:0,
                 chosenMembList:[],//选中的人员
                 allMembData:[],
+                auditProcessDialog: false,
 
                 deptMembData: [
                     {
@@ -1380,6 +1407,8 @@ a {
                     name: '',
                     userId: [],
                     level:1,
+                    // bu:'',
+                    bu: ['50'],
                     id: '',
                     code: '',
                     projectDesc: '',
@@ -1449,6 +1478,7 @@ a {
                 levelList: [],  // 项目级别
                 departmentList: [],
                 deptId: [],
+                buOption:[],
                 contractAmountOld: 0,
                 contractAmountReasonShow: false,
                 centerNameDegree: '',
@@ -2769,6 +2799,8 @@ a {
                         
                         //用于筛选过滤
                         this.allMembData = JSON.parse(JSON.stringify(this.deptMembData));
+                        // this.buOption = this.allMembData;
+                        console.log(this.buOption, '递归的数据')
                     } else {
                         this.$message({
                             message: res.msg,
@@ -2783,6 +2815,58 @@ a {
                     });
                 });
             },
+            // 获取部门列表
+            getDepartment2() {
+            this.http.post(
+                this.port.manage.depList,
+                {},
+                (res) => {
+                if (res.code == "ok") {
+                    var list = res.data,
+                    list1 = JSON.parse(JSON.stringify(res.data));
+                    this.data = list;
+                    this.dataRepeat = JSON.parse(JSON.stringify(list))
+                    console.log(list, "部门数据")
+                    this.option = this.changeArr(list1);
+                    this.buOption = this.dataRepeat;
+                } else {
+                    this.$message({
+                    message: res.msg,
+                    type: "error",
+                    });
+                }
+                },
+                (error) => {
+                this.$message({
+                    message: error,
+                    type: "error",
+                });
+                }
+            );
+            },
+            // 修改数组
+            changeArr(arr) {
+                for (var i = 0; i < arr.length; i++) {
+                    if(arr[i].id != -1 && arr[i].id != 0) {
+                        // if(arr[i].userList) {
+                        //     if(arr[i].userList.length > 0) {
+                        //         arr[i].children = arr[i].userList 
+                        //     }
+                        // }
+                        if (arr[i].children != null && arr[i].children.length>0) {
+                            arr[i].children = this.changeArr(arr[i].children);
+                        }
+                        arr[i].id && (arr[i].value = arr[i].id);
+                        delete arr[i].id;
+                    }
+                }
+                for(var i in arr) {
+                    if(arr[i].id == -1 || arr[i].id == 0) {
+                        arr.splice(i,1)
+                    }    
+                }
+                return arr;
+            },
             // 企业微信搜索
             echartDepartment() {
                 console.log('我点击了搜索')
@@ -2871,10 +2955,13 @@ a {
             },
             // 提交
             submitClf() {
+                this.addClf.proBuAudit ? this.addClf.proBuAudit =1 : this.addClf.proBuAudit = 0
+                this.addClf.proInchargerAudit ? this.addClf.proInchargerAudit = 1 : this.addClf.proInchargerAudit = 0
                 this.http.post('/project-category/addOrMod',this.addClf,
                     res => {
                         if (res.code == "ok") {
                             this.addClfDialog = false;
+                            this.auditProcessDialog=false;
                             this.baseClfList = res.data;
                             // this.$forceUpdate();
                             // console.log(res.data);
@@ -2915,6 +3002,17 @@ a {
                         }
                     );
             },
+            // 分类绑定审核流程设置
+            auditProcess(row) {
+                this.auditProcessDialog = true;
+                row.proBuAudit ? row.proBuAudit = true : row.proBuAudit = false
+                row.proInchargerAudit ? row.proInchargerAudit = true : row.proInchargerAudit = false
+                if (row == null) {
+                    this.addClf = {}
+                } else {
+                    this.addClf = row;
+                }
+            },
             // 提交项目阶段
             submitPanthPro() {
                 this.http.post('/project-stage/addOrMod',this.addPanthForm,
@@ -4022,7 +4120,6 @@ a {
                              formData.append("warrantyEndDate", this.addForm.warrantyEndDate ? this.addForm.warrantyEndDate : '');
                              formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
                              formData.append("region", this.addForm.region ? this.addForm.region : '');
-                             formData.append("bu", this.addForm.bu ? this.addForm.bu : '');
                             //  关键节点
                             formData.append("projectKeyNodesData", JSON.stringify(this.projectKeyNodesData));
                         }
@@ -4034,9 +4131,10 @@ a {
                                 formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1])
                             }
                         }
+                        formData.append("buId", this.addForm.bu ? this.addForm.bu : '');
                         // formData.append("associateDegreeNames", listName)
-                        // console.log("addform",this.addForm);
-                        // return
+                        //console.log("addform",this.addForm);
+                        //return
                         this.http.uploadFile(this.port.project.add,formData,
                         res => {
                             this.addLoading = false;
@@ -4249,6 +4347,13 @@ a {
                     console.log(obj)
                     this.curProfessionRow.membList[obj.other].membId = userList
                 }
+            },
+            vueCasader(obj) {
+                if(obj.distinction == '32') {
+                    let arr = []
+                    arr.push(obj.id)
+                    this.addForm.bu = arr.join(",")
+                }
             }
         },
         created() {
@@ -4262,6 +4367,7 @@ a {
         mounted() {
             this.userssHu()
             this.getDepartment();
+            this.getDepartment2();
             this.getList();
             this.getUsers();
             this.getCustomerList();