Ver Fonte

'个人信息绩效统计'

damon227 há 1 ano atrás
pai
commit
d9b33e3975
3 ficheiros alterados com 129 adições e 3 exclusões
  1. 9 0
      src/api/my.js
  2. 116 3
      src/views/modules/my/my-info.vue
  3. 4 0
      src/views/modules/works/work.vue

+ 9 - 0
src/api/my.js

@@ -7,3 +7,12 @@ export function getMyInfo () {
     method: 'get'
   })
 }
+
+// 绩效统计
+export function getPerformance (params) {
+  return request({
+    url: request.adornUrl(`//biz-service/personal/performance`),
+    method: 'get',
+    params: params
+  })
+}

+ 116 - 3
src/views/modules/my/my-info.vue

@@ -66,13 +66,65 @@
           </el-table-column>
         </el-table>
       </e-desc>
+      <div>
+        <div class="desc-title">绩效统计</div>
+        <el-row>
+          <el-col>
+             <el-date-picker
+              v-model="performanceMonth"
+              @change="monthChange"
+              value-format="yyyy-MM-01 00:00:00"
+              type="monthrange"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              >
+            </el-date-picker>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-table
+           :data="performanceList"
+           :span-method="arraySpanMethod"
+           border
+           style="width: 100%;">
+            <el-table-column
+              label="序号"
+              type="index"
+              width="50"
+              align="center">
+            </el-table-column>
+            <el-table-column
+              label="类目"
+              prop="type"
+              align="center">
+            </el-table-column>
+            <el-table-column
+              label="工序"
+              prop="count"
+              align="center">
+            </el-table-column>
+            <el-table-column
+              label="金额"
+              prop="amount"
+              align="center">
+            </el-table-column>
+            <el-table-column
+              label="操作"
+              align="center">
+               <template slot-scope="scope">
+            <el-button  type="text" size="small" @click="detailHandle(scope.row)">查看</el-button>
+          </template>
+            </el-table-column>
+          </el-table>
+          </el-row>
+      </div>
     </div>
 </template>
 
 <script>
   import EDesc from '../common/e-desc'
   import EDescItem from '../common/e-desc-item'
-  import { getMyInfo } from '@/api/my'
+  import { getMyInfo, getPerformance } from '@/api/my'
 
   export default {
     name: 'my-info',
@@ -84,7 +136,23 @@
         dataForm: {
           userEntity: {},
           workTypeList: []
-        }
+        },
+        performanceMonth: '',
+        performanceList: [{
+          'typeIndex': 0,
+          'type': '报工次数',
+          'count': '0',
+          'amount': '0'
+        }, {
+          'typeIndex': 1,
+          'type': '报损次数',
+          'count': '0',
+          'amount': '0'
+        }, {
+          'type': '合计金额',
+          'count': '0',
+          'amount': '0'
+        }]
       }
     },
     created () {
@@ -97,11 +165,56 @@
             this.dataForm = data.data
           }
         })
+  
+        let performanceParam = {
+          startTime: this.performanceMonth + ' 00:00:00',
+          endTime: this.performanceMonth + ' 23:59:59'
+        }
+        this.getPerformance(performanceParam)
+      },
+      arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
+        if (rowIndex === 2) {
+          if (columnIndex > 1) {
+            return [1, 3]
+          }
+        }
+      },
+      getPerformance (performanceParam) {
+        getPerformance(performanceParam).then(({data}) => {
+          if (data && data.code === '200') {
+            this.performanceList[0].count = data.data.submittedNum || '0'
+            this.performanceList[0].amount = data.data.submittedAmount || '0'
+            this.performanceList[1].count = data.data.damageNum || '0'
+            this.performanceList[1].amount = data.data.damageAmount || '0'
+            this.performanceList[2].amount = data.data.totalAmount || '0'
+          }
+        })
+      },
+      monthChange (val) {
+        let startTime = val[0]
+        let endTime = val[1]
+        this.getPerformance({
+          startTime,
+          endTime
+        })
+      },
+      detailHandle (val) {
+        if (val.typeIndex === 0) {
+          this.$router.push({ path: '/works-work', query: {state: '3'} })
+        } else if (val.typeIndex === 1) {
+          this.$router.push('/production-damage')
+        }
       }
     }
   }
 </script>
 
 <style scoped>
-
+.desc-title{
+    margin: 10px 0;
+    color: #333;
+    font-weight: 700;
+    font-size: 16px;
+    line-height: 1.5715;
+}
 </style>

+ 4 - 0
src/views/modules/works/work.vue

@@ -598,6 +598,10 @@ export default {
     }
   },
   created () {
+    let state = this.$route.query.state
+    if (state) {
+      this.dataForm.state = state
+    }
     this.getDataList()
   },
   methods: {