Browse Source

工时管家——项目管理修改

ZhouRuiTing 5 years ago
parent
commit
8306906f46

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/project/detailDep.vue

@@ -105,8 +105,8 @@
                     this.listLoading = false;
                     this.listLoading = false;
                     var _this = this;
                     var _this = this;
                     if (res.code == "ok") {
                     if (res.code == "ok") {
-                        var xList = [] , yList = [] , list = res.data , array = [] , series = [];
-                        this.cost = res.data.totalMoneyCost;
+                        var xList = [] , yList = [] , list = res.data.list, array = [] , series = [];
+                        this.cost = res.data.totalCostMoney;
                         var num = list[0].project.length;
                         var num = list[0].project.length;
                         for(var i in list) {
                         for(var i in list) {
                             xList.push(list[i].name);
                             xList.push(list[i].name);

+ 22 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -114,7 +114,7 @@
                     <el-input v-model.number="insertForm.cost" placeholder="请输入成本 单位:元/小时" clearable></el-input>
                     <el-input v-model.number="insertForm.cost" placeholder="请输入成本 单位:元/小时" clearable></el-input>
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="部门" prop="departmentId">
                 <el-form-item label="部门" prop="departmentId">
-                    <el-cascader v-model="insertForm.departmentId" placeholder="请选择部门" style="width: 100%" @change="handleChange"
+                    <el-cascader v-model="insertForm.departmentId" placeholder="请选择部门" style="width: 100%"
                     :options="option" :props="{ checkStrictly: true }" :show-all-levels="false" clearable></el-cascader>
                     :options="option" :props="{ checkStrictly: true }" :show-all-levels="false" clearable></el-cascader>
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="角色" prop="role">
                 <el-form-item label="角色" prop="role">
@@ -135,6 +135,10 @@
                 <el-form-item label="成本" prop="cost">
                 <el-form-item label="成本" prop="cost">
                     <el-input v-model.number="insertForm.cost" placeholder="请输入成本 单位:元/小时" clearable></el-input>
                     <el-input v-model.number="insertForm.cost" placeholder="请输入成本 单位:元/小时" clearable></el-input>
                 </el-form-item>
                 </el-form-item>
+                <el-form-item label="部门" prop="departmentId">
+                    <el-cascader v-model="insertForm.departmentId" placeholder="请选择部门" style="width: 100%"
+                    :options="option" :props="{ checkStrictly: true }" :show-all-levels="false" clearable></el-cascader>
+                </el-form-item>
             </el-form>
             </el-form>
             <span slot="footer" class="dialog-footer">
             <span slot="footer" class="dialog-footer">
                 <el-button @click="dialogVisible1=false">取消</el-button>
                 <el-button @click="dialogVisible1=false">取消</el-button>
@@ -348,7 +352,6 @@
                         }
                         }
                         if (this.insertForm.departmentId != null) {
                         if (this.insertForm.departmentId != null) {
                             form.departmentId = this.insertForm.departmentId[this.insertForm.departmentId.length-1];
                             form.departmentId = this.insertForm.departmentId[this.insertForm.departmentId.length-1];
-                            // form.departmentCascade = this.insertForm.departmentId.join(",")
                         }
                         }
                         this.http.post( this.port.manage.insert, form,
                         this.http.post( this.port.manage.insert, form,
                         res => {
                         res => {
@@ -446,12 +449,25 @@
 
 
             // 修改老板的成本
             // 修改老板的成本
             openInsertDialog1(i) {
             openInsertDialog1(i) {
+                var list = JSON.parse(JSON.stringify(this.list[i])) , arr = [] , array = [];
+                if(list.departmentCascade!='0' && list.departmentCascade!=null) {
+                    if(list.departmentCascade.indexOf(",")>-1) {
+                        arr = list.departmentCascade.split(",");
+                    } else {
+                        arr = [].concat(list.departmentCascade)
+                    }
+                }
+                    
+                for(var i in arr) {
+                    array.push(parseInt(arr[i]))
+                }
                 this.insertForm = {
                 this.insertForm = {
                     id: this.list[i].id,
                     id: this.list[i].id,
                     name: this.list[i].name,
                     name: this.list[i].name,
                     phone: this.list[i].phone,
                     phone: this.list[i].phone,
                     role: this.list[i].role,
                     role: this.list[i].role,
-                    cost: this.list[i].cost
+                    cost: this.list[i].cost,
+                    departmentId: array,
                 };
                 };
                 this.dialogVisible1 = true;
                 this.dialogVisible1 = true;
             },
             },
@@ -467,6 +483,9 @@
                             role: this.insertForm.role,
                             role: this.insertForm.role,
                             cost: this.insertForm.cost
                             cost: this.insertForm.cost
                         };
                         };
+                        if (this.insertForm.departmentId != null) {
+                            form.departmentId = this.insertForm.departmentId[this.insertForm.departmentId.length-1];
+                        }
                         this.http.post( this.port.manage.insert, form,
                         this.http.post( this.port.manage.insert, form,
                         res => {
                         res => {
                             this.listLoading = false;
                             this.listLoading = false;
@@ -657,10 +676,6 @@
                 })
                 })
                 .catch(() => {});
                 .catch(() => {});
             },
             },
-
-            handleChange(value) {
-                // console.log(value);
-            }
         },
         },
 
 
         created() {
         created() {