Explorar o código

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper into master

seyason %!s(int64=2) %!d(string=hai) anos
pai
achega
78a035552e

+ 3 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -103,9 +103,9 @@
           </el-select>
 
           <!-- 待审核筛选切换 -->
-          <el-radio-group v-model="stateKey" size="small" v-if="ins == 10" style="margin-left:10px;margin-top:-3.33px" @change="getAuditRateList">
-            <el-radio-button :label="0">部门待审核</el-radio-button>
+          <el-radio-group v-model="stateKey" size="small" v-if="ins == 10 && user.timeType.reportWorkflow == 1" style="margin-left:10px;margin-top:-3.33px" @change="getAuditRateList">
             <el-radio-button :label="1">项目待审核</el-radio-button>
+            <el-radio-button :label="0">部门待审核</el-radio-button>
           </el-radio-group>
           <!-- 项目阶段筛选 -->
           <el-select v-if="ins == 5" multiple v-model="stageNames" @visible-change="visibleSelcts" @clear="visibleSelcts(false)" clearable size="small" filterable collapse-tags placeholder="请选择阶段" style="margin-left:10px;">
@@ -781,7 +781,7 @@ export default {
       groupSize: 20,
       groupTotal: 0,
 
-      stateKey: 0,
+      stateKey: 1,
 
       outputValueList: [],
       outputValueTitle: []

+ 75 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/project/info.vue

@@ -13,6 +13,10 @@
                         <el-col :span="5" ><span class="gray_label">项目描述:</span></el-col><el-col :span="7" ></el-col>
                         <el-col :span="18" ><span>{{project.projectDesc}}</span></el-col>
                     </el-row>
+                    <el-row :gutter="10" >
+                        <el-col :span="5" ><span class="gray_label">所属部门:</span></el-col><el-col :span="7" ></el-col>
+                        <el-col :span="18" ><span>{{project.departmentName}}</span></el-col>
+                    </el-row>
                     <el-row :gutter="10">
                         <el-col :span="5" ><span class="gray_label">状态:</span></el-col><el-col :span="7" ><span >{{project.status==null?'-':statusTxt[project.status]}}</span></el-col>
                         <el-col :span="5" ><span class="gray_label">完成度: </span></el-col><el-col :span="7" ><span>
@@ -245,31 +249,31 @@
 
         <!-- 合同金额修改记录 -->
         <el-dialog title="合同金额修改记录" v-if="contractRecordDialog" :visible.sync="contractRecordDialog" :close-on-click-modal="false" customClass="customWidth" width="1000px">
-            <el-table :data="contractRecordData" height="400px" :loading="contractRecordLoading">
-                <el-table-column label="操作人" prop="name" min-width="150">
+            <el-table :data="contractRecordData" height="500px" :loading="contractRecordLoading" :default-sort="{prop: 'date', order: 'descending'}">
+                <el-table-column label="操作人" prop="name" min-width="100">
                     <template slot-scope="scope">
                         <!-- <span>{{users.filter(item => item.id == scope.row.editUserId)[0].name}}</span> -->
                         <span>{{filterUserContract(scope.row.editUserId)}}</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="修改时间" prop="date" min-width="180">
+                <el-table-column label="修改时间" prop="date" min-width="120">
                     <template slot-scope="scope">
                         <!-- <span>{{scope.row.updateDate[0] + '-' + scope.row.updateDate[1] + '-' + scope.row.updateDate[2] + '\u3000' + scope.row.updateDate[3] + ':' + scope.row.updateDate[4] + ':' + scope.row.updateDate[5]}}</span> -->
                         <span>{{tempDateContract(scope.row.updateDate)}}</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="原金额" prop="oldContractAmount" min-width="180">
+                <el-table-column label="原金额" prop="oldContractAmount" min-width="120">
                     <template slot-scope="scope">
                         <span>{{scope.row.oldContractAmount.toFixed(2)}} 元</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="修改情况" prop="record" min-width="180">
+                <el-table-column label="修改情况" prop="record" min-width="120">
                     <template slot-scope="scope">
                         <span>{{scope.row.oldContractAmount - scope.row.newContractAmount > 0 ? '减少' : '增加'}}</span>
                         <span>{{scope.row.oldContractAmount - scope.row.newContractAmount > 0 ? (scope.row.oldContractAmount - scope.row.newContractAmount).toFixed(2) : (scope.row.newContractAmount - scope.row.oldContractAmount).toFixed(2)}} 元</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="修改原因" prop="reason" min-width="300"></el-table-column>
+                <el-table-column label="修改原因" prop="reason" min-width="200"></el-table-column>
             </el-table>
         </el-dialog>
 
@@ -286,6 +290,13 @@
                 <el-form-item label="项目描述" prop="projectDesc">
                     <el-input type="textarea" :rows="2" v-model="addForm.projectDesc" maxlength="4000" show-word-limit  placeholder="请输入项目描述" clearable></el-input>
                 </el-form-item>
+
+                <el-form-item label="所属部门">
+                    <el-cascader v-model="addForm.deptId" :options="departmentList" placeholder="请选择部门"
+                        :props="{ checkStrictly: true }" clearable filterable @change="cascaderChange"
+                    ></el-cascader>
+                </el-form-item>
+
                 <el-form-item label="级别" >
                     <el-select v-model="addForm.level"  placeholder="请选择级别" style="width:32%;" v-if="user.timeType.projectLevelState == 1">
                         <el-option v-for="item in levelList" :key="item.id" :label="item.projectLevelName" :value="item.id"></el-option>
@@ -622,7 +633,8 @@
                 contractRecordDialog: false,
                 contractRecordLoading: false,
                 contractRecordData: [],
-                levelList: []
+                levelList: [],
+                departmentList: []
             };
         },
         filters: {
@@ -1460,6 +1472,9 @@
                         if(this.user.companyId == '428') {
                              formData.append("projectCategorySub", this.addForm.projectSeparate.projectCategorySub ? this.addForm.projectSeparate.projectCategorySub : '');
                         }
+                        if(this.addForm.deptId != null && this.addForm.deptId != '') {
+                            formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1]);
+                        }
                         // return
                         this.http.uploadFile(this.port.project.add,formData,
                         res => {
@@ -1522,7 +1537,22 @@
                     }
                 // }
                 this.auseList = arr
+                var listList = JSON.parse(JSON.stringify(this.addForm)),
+                arrList = [],
+                array = [];
+                if (listList.deptCascade != "0" && listList.deptCascade != null) {
+                if (listList.deptCascade.indexOf(",") > -1) {
+                    arrList = listList.deptCascade.split(",");
+                } else {
+                    arrList = [].concat(listList.deptCascade);
+                }
+                }
+                for (var i in arrList) {
+                    array.push(parseInt(arrList[i]));
+                }
+                this.$set(this.addForm,'deptId', array.reverse())
                 console.log(this.auseList, '看看是个什么值')
+                console.log(this.addForm, '看看是个什么值')
             },
             showEditPar() {
                 this.addForm = JSON.parse(JSON.stringify(this.project));
@@ -1725,6 +1755,43 @@
                 });
                 this.getProjectProfessionList();
             },
+            // 获取部门
+            getDepartmentList() {
+                this.http.post( this.port.manage.depList, {},
+                    res => {
+                    if (res.code == "ok") {
+                        let dptlist = JSON.parse(JSON.stringify(res.data));
+                        this.departmentList = this.changeArr(dptlist);
+                    } 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].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;
+            },
             refreshPage() {
                 this.curProjectId = parseInt(this.$route.params.id);
                 this.getMileStoneList();
@@ -1759,6 +1826,7 @@
             this.userssHu()
             this.yanjiuzx()
             this.getProjectLevel()
+            this.getDepartmentList()
         }
     };
 </script>

+ 141 - 12
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -43,6 +43,13 @@
                         <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 >
+                    <span style="margin-left:5px;margin-right:5px;color:#606266;">部门</span>
+                    <el-cascader v-model="deptId" :options="departmentList" placeholder="请选择部门"
+                        :props="{ checkStrictly: true }" :show-all-levels="false" clearable filterable @change="searchClfList" size="small"
+                    ></el-cascader>
+                </el-form-item>
                 
                 <!-- 分类条目 -->
                 <!-- <el-form-item style="float:right;"  v-if="permissions.projectClassification">
@@ -184,6 +191,7 @@
                      </div>
                 </template>
             </el-table-column>
+            <el-table-column prop="departmentName" label="所属部门" sortable="custom" width="200"></el-table-column>
             <el-table-column prop="projectMainName" label="主项目" sortable="custom" min-width="250" v-if="user.timeType.mainProjectState == '1'">
             </el-table-column>
             <el-table-column prop="inchargerName" label="项目经理" sortable="custom" min-width="150">
@@ -246,6 +254,14 @@
                 </div>
             </template>
             </el-table-column>
+            <!-- 研究中心 -->
+            <el-table-column prop="associateDegreeNames" :label="centerNameDegree" min-width="190" v-if="user.timeType.isCro == 1" sortable="custom">
+                <template slot-scope="scope">
+                    <div>
+                        {{scope.row.associateDegreeNames}}
+                    </div>
+                </template>
+            </el-table-column>
             <!-- 级别 -->
             <el-table-column :prop="user.timeType.projectLevelState == 1 ? 'levelName' : 'level'" label="级别" min-width="190"   v-if="user.company.packageProject == 1">
                 <template slot-scope="scope">
@@ -368,6 +384,13 @@
                         </el-select>
                     </div>
                 </el-form-item>
+
+                <el-form-item label="所属部门">
+                    <el-cascader v-model="addForm.deptId" :options="departmentList" placeholder="请选择部门"
+                        :props="{ checkStrictly: true }" clearable filterable @change="cascaderChange"
+                    ></el-cascader>
+                </el-form-item>
+
                 <!-- 供应商 -->
                 <!-- <el-form-item label="供应商" v-if="user.company.packageProvider">
                     <el-select v-model="addForm.supplierId" multiple collapse-tags style="width:32%;" placeholder="请选择供应商">
@@ -419,11 +442,20 @@
                         <el-option v-for="item in importanceList" :key="item.id" :label="item.label" :value="item.id"></el-option>
                     </el-select>
                 <!-- 增加合同金额字段 -->
-                        <span style="margin-left:63px;margin-right:10px;" v-if="user.company.packageProject==1">合同金额</span>
-                        <el-input id="contractAmount" v-model="addForm.contractAmount" style="width:33%;"
-                        placeholder="整数" clearable  @keyup.native="restrictNumber('contractAmount')" :disabled="title == '新增项目' ? false : true"></el-input><span style="margin-left:10px;">元</span>
+                        <!-- <span style="margin-left:63px;margin-right:10px;" v-if="user.company.packageProject==1">合同金额</span>
+                        <el-input id="contractAmount" v-model="addForm.contractAmount" style="width:33%;" @blur="contractAmountChange(addForm.contractAmount)"
+                        placeholder="整数" clearable  @keyup.native="restrictNumber('contractAmount')" :disabled="title == '新增项目' ? false : false"></el-input><span style="margin-left:10px;">元</span> -->
+                </el-form-item>
                 <!-- 增加合同金额字段 -->
+                <el-form-item  label="合同金额" v-if="user.company.packageProject==1">
+                    <el-input id="contractAmount" v-model="addForm.contractAmount" style="width:32%;" @input="contractAmountChange(addForm.contractAmount)" placeholder="整数" clearable  @keyup.native="restrictNumber('contractAmount')"></el-input><span style="margin-left:10px;position:absolute;">元</span>
+                    <template v-if="title == '修改项目'">
+                        <span style="margin-left:63px;margin-right:10px;">修改原因</span>
+                        <el-input v-model="addForm.changeContractReason" style="width:33%" clearable placeholder="合同金额修改原因" :disabled="!contractAmountReasonShow"></el-input>
+                    </template>
                 </el-form-item>
+
+
                 <el-form-item label="开始日期" prop="planStartDate"  >
                     <el-date-picker v-model="addForm.planStartDate" 
                      :editable="false" style="width:32%;" 
@@ -1122,6 +1154,11 @@ a {
                 rowid: '',
                 phaseProjectDialog: false, // 项目阶段
                 levelList: [],  // 项目级别
+                departmentList: [],
+                deptId: [],
+                contractAmountOld: 0,
+                contractAmountReasonShow: false,
+                centerNameDegree: ''
             };
         },
         // 过滤器
@@ -1352,7 +1389,7 @@ a {
                 console.log(this.addForm)
             },
             tableSort({column, prop, order}){
-                if(prop == 'inchargerName' || prop == 'customerName' || prop == 'projectCode' || prop == 'categoryName' || prop == 'projectName' || prop == 'status' || prop == 'currentStage'){
+                if(prop == 'inchargerName' || prop == 'customerName' || prop == 'projectCode' || prop == 'categoryName' || prop == 'projectName' || prop == 'status' || prop == 'currentStage' || prop == 'departmentName' || prop == 'associateDegreeNames'){
                     this.sortOrder = order
                     this.sortProp = prop
                     this.getList()
@@ -2838,6 +2875,10 @@ a {
                         parameter.sortProp = 'status'
                     }else if(this.sortProp == 'currentStage'){
                         parameter.sortProp = 'current_stage_name'
+                    }else if(this.sortProp == 'departmentName'){
+                        parameter.sortProp = 'dept_id'
+                    }else if(this.sortProp == 'associateDegreeNames'){
+                        parameter.sortProp = 'associate_degrees'
                     }
 
                     if(this.sortOrder == 'descending'){
@@ -2846,6 +2887,11 @@ a {
                         parameter.sortOrder = 1
                     }
                 }
+                if(this.deptId.length > 0) {
+                    parameter.deptId = this.deptId[this.deptId.length - 1]
+                }  else {
+                    parameter.deptId = ''
+                }
                 this.http.post(this.port.project.listPage, parameter,
                 res => {
                     this.listLoading = false;
@@ -2862,6 +2908,7 @@ a {
                             }
                             list[i].userNames = str;
                         }
+                        this.centerNameDegree = res.data.degrees
                         this.showColumnWidth = this.showColumn(list)
                         this.list = list;
                         this.total = res.data.total;
@@ -2910,8 +2957,20 @@ a {
                 }
             },
 
+            // 合同金额发生改变,需弹出修改原因的输入框
+            contractAmountChange(value){
+                
+                if(this.contractAmountOld != value){
+                    this.contractAmountReasonShow = true
+                }else{
+                    this.contractAmountReasonShow = false
+                    this.addForm.changeContractReason = ''
+                }
+            },
+
             //显示新增界面
             handleAdd(i, item) {
+                this.contractAmountReasonShow = false
                 if(i == -1) {
                     this.title = "新增项目";
                     this.addForm = {
@@ -2928,8 +2987,10 @@ a {
                         category:null,
                         creatorId: this.user.id,
                         projectMainId: '',
-                        outputValue: ''
+                        outputValue: '',
+                        deptId: []
                     }
+
                     if(this.user.companyId == '936') {
                         this.$set(this.addForm, 'contractCode', '')
                         this.$set(this.addForm, 'warrantyStartDate', '')
@@ -2961,7 +3022,21 @@ a {
                     if (names.length > 0) {
                         names = names.substring(0, names.length -1);
                     }
-                    
+                    var listList = JSON.parse(JSON.stringify(item)),
+                    arrList = [],
+                    array = [];
+                    if (listList.deptCascade != "0" && listList.deptCascade != null) {
+                    if (listList.deptCascade.indexOf(",") > -1) {
+                        arrList = listList.deptCascade.split(",");
+                    } else {
+                        arrList = [].concat(listList.deptCascade);
+                    }
+                    }
+
+                    for (var i in arrList) {
+                        array.push(parseInt(arrList[i]));
+                    }
+                    console.log(array, '转换', listList)
                     this.addForm = {
                         id: item.id,
                         name: item.projectName,
@@ -2985,8 +3060,12 @@ a {
                         projectDesc: item.projectDesc,
                         projectMainId: item.projectMainId,
                         creatorId: item.creatorId,
-                        outputValue: item.outputValue
+                        outputValue: item.outputValue,
+                        deptId: array.reverse(),
+                        changeContractReason: ''
                     }
+                    this.contractAmountOld = item.contractAmount ? item.contractAmount : 0
+                    console.log(this.addForm, '数据')
 
                     // 判断公司id是否等于936
                     if(this.user.companyId == '936') {
@@ -3219,6 +3298,9 @@ a {
                         if(this.addForm.contractAmount != null) {
                             formData.append("contractAmount", this.addForm.contractAmount);
                         }
+                        if(this.contractAmountReasonShow){
+                            formData.append("changeContractReason", this.addForm.changeContractReason);
+                        }
                         if (this.projectBaseCostData != null) {
                             formData.append("projectBaseCostData", JSON.stringify(this.projectBaseCostData));
                             //计算总预算成本
@@ -3236,7 +3318,7 @@ a {
                             formData.append("chosenLeaders", JSON.stringify(this.chosenLeaders));
                         }
                         if (this.user.timeType.outputValueStatus == 1){
-                            formData.append("outputValue",this.addForm.outputValue)
+                            formData.append("outputValue",this.addForm.outputValue ? this.addForm.outputValue : 0)
                         }
                         var listId = []
                         var listName = []
@@ -3290,9 +3372,11 @@ a {
                         if(this.user.companyId == '428') {
                              formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
                         }
-
+                        if(this.addForm.deptId != null && this.addForm.deptId != '') {
+                            formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1])
+                        }
                         // formData.append("associateDegreeNames", listName)
-                        // console.log("addform",this.addForm);
+                        console.log("addform",this.addForm);
                         // return
                         this.http.uploadFile(this.port.project.add,formData,
                         res => {
@@ -3324,7 +3408,12 @@ a {
                         }
                 });
             },
-
+            cascaderChange(e) {
+                // console.log(e)
+                // console.log(this.addForm)
+                // if(e.length )
+                console.log(e)
+            },
             // 删除
             deletePro(i, item) {
                 this.$confirm("确定要删除项目[" + item.name + "]吗?","删除项目", {
@@ -3435,7 +3524,44 @@ a {
 
             detail(i) {
                 this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
-            }
+            },
+            // 获取部门
+            getDepartmentList() {
+                this.http.post( this.port.manage.depList, {},
+                    res => {
+                    if (res.code == "ok") {
+                        let dptlist = JSON.parse(JSON.stringify(res.data));
+                        this.departmentList = this.changeArr(dptlist);
+                    } 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].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;
+            },
         },
         created() {
             let height = window.innerHeight;
@@ -3478,6 +3604,9 @@ a {
             } else {
                 this.importanceList = [{id:1,label:'正常'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}]
             }
+
+            // 获取部门
+            this.getDepartmentList()
             
         }
     };