Ver Fonte

2022.6.2

ggooalice há 3 anos atrás
pai
commit
ba6fd74959

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -2,8 +2,8 @@ var path = require('path')
 
 //  var ip = '127.0.0.1'
 // var ip = '192.168.2.39'
-var ip = '192.168.2.10'
-// var ip = '192.168.2.39'
+// var ip = '192.168.2.10'
+var ip = '192.168.2.39'
 // var ip = '192.168.2.12'// var ip = '47.100.37.243' 
 
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip

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

@@ -42,11 +42,21 @@
     <div class="headine" ref="headine">
       <h3 ref="headHe" style="padding-left: 210px">{{shuz[ins]}}</h3>
       <div class="headScreen" v-if="ins != 6">
-        <el-select v-model="costomerId" placeholder="请选择客户" clearable filterable size="small" @change="selcts()" v-if="ins == 4" style="margin-right:20px">
-          <el-option v-for="(item) in costomerList" :key="item.id" :label="item.customerName" :value="item.id">
+      <!-- 客户项目利润表的筛选 -->
+      <template v-if="ins == 4">
+        <el-select v-model="customerId" placeholder="请选择客户" clearable filterable size="small" @change="selcts(4)" style="margin-right:20px">
+          <el-option v-for="(item) in customerList" :key="item.id" :label="item.customerName" :value="item.id">
           </el-option>
         </el-select>
-        <el-select v-model="proJuctId" placeholder="请选择项目" clearable filterable size="small" @change="selcts()">
+        <el-select v-model="cusProJuctId" placeholder="请选择项目" clearable filterable size="small" @change="selcts()">
+          <el-option v-for="(item) in cusProListOvertime" :key="item.id" :label="item.projectName + (item.projectCode ? item.projectCode : '')" :value="item.id">
+            <span style="float: left;color: #8492a6;">{{ item.projectCode }}</span>
+            <span style="float: right;font-size: 13px;margin-left: 20px">{{ item.projectName }}</span>
+          </el-option>
+        </el-select>
+      </template>
+
+        <el-select v-if="ins != 4" v-model="proJuctId" placeholder="请选择项目" clearable filterable size="small" @change="selcts()">
           <el-option v-for="(item) in proListOvertime" :key="item.id" :label="item.projectName + (item.projectCode ? item.projectCode : '')" :value="item.id">
             <span style="float: left;color: #8492a6;">{{ item.projectCode }}</span>
             <span style="float: right;font-size: 13px;margin-left: 20px">{{ item.projectName }}</span>
@@ -584,8 +594,11 @@ export default {
       baseCostColumns: [],
       proListOvertime: [], // 加班情况项目筛选
 
-      costomerList: [],
-      costomerId: ''
+      customerList: [],
+      customerId: '',
+      cusProJuctId: '',
+      cusProListOvertime: [],
+
     };
   },
   computed: {},
@@ -603,7 +616,8 @@ export default {
     this.getProjectListOvertime()
     this.getProjectList();
     this.getUserList()
-    this.getCostomerList()
+    this.getcustomerList()
+    this.getcusProjectList()
   },
   filters: {
       
@@ -766,7 +780,8 @@ export default {
                 } else if (this.ins == 3) {
                     this.getProjectInAndOut();
                 } else if (this.ins == 4) {
-                    this.getCustomerProjectInAndOut();
+                    this.getcusProjectList()
+                    
                 } else if (this.ins == 5) {
                     this.getProjectStages();
                 } else if (this.ins == 6) {
@@ -837,7 +852,8 @@ export default {
       this.list = [];
       this.page = 1;
       this.pageSize = 20;
-      this.costomerId = ''
+      this.customerId = ''
+      this.cusProJuctId = ''
       this.$forceUpdate()
       this.getList();
     },
@@ -847,7 +863,7 @@ export default {
                     pageIndex: this.page,
                     pageSize: this.size,
                     projectId: this.proJuctId,
-                    customerId: this.costomerId
+                    customerId: this.customerId
                     },
         res => {
             if (res.code == "ok") {
@@ -1133,11 +1149,11 @@ export default {
         });
     },
     // 获取客户列表
-    getCostomerList(){
+    getcustomerList(){
       this.http.post('/customer-info/getAll',{},
       res => {
         if(res.code == 'ok'){
-          this.costomerList = res.data
+          this.customerList = res.data
         }else {
           this.$message({
             message: res.msg,
@@ -1151,6 +1167,31 @@ export default {
         })
       })
     },
+    // 客户列表筛选后的项目筛选列表
+    getcusProjectList(){
+      let iii = {}
+      if(this.customerId != ''){
+        iii.customerId = this.customerId
+      }
+      this.http.post('/project/getProjectByCustomer', iii,
+        res => {
+            if (res.code == "ok") {
+                this.cusProListOvertime = res.data
+                this.getCustomerProjectInAndOut();
+            } else {
+                this.$message({
+                message: res.msg,
+                type: "error"
+                });
+            }
+        },
+        error => {
+            this.$message({
+                message: error,
+                type: "error"
+            });
+        });
+    },
     // 点击侧边栏事件
     side() {
       if(this.$refs.side.style.left < '0px') {
@@ -1184,7 +1225,7 @@ export default {
        return  _this.gettime
     },
     selcts() {
-      console.log(this.costomerId);
+      console.log(this.customerId);
       this.getList()
     },
     // 成本查看明细