Browse Source

工时管理

yejian016332 3 years ago
parent
commit
9cad67533f

+ 48 - 0
imcs-ui/src/api/statisticalAnalysis/productlineAvailability.js

@@ -0,0 +1,48 @@
+/*********************** 【质量中心-查看质检结果】API ********************/
+import axiosApi from '../AxiosApi.js'
+
+const apiList = {
+	getList: {
+	    method: 'POST',
+	    url: `/authority/productLinePerformance/query`
+	},
+  page: {
+    method: 'POST',
+    url: `/authority/productLinePerformance/page`
+  },
+  queryOperatorDetailPerformance: {
+    method: 'POST',
+    url: `/authority/productLinePerformance/queryOperatorDetailPerformance`
+  },
+  queryOperatorDetailsPerformance: {
+    method: 'POST',
+    url: `/authority/productLinePerformance/queryOperatorDetailsPerformance`
+  }
+}
+
+export default {
+	getList (data) {
+    return axiosApi({
+      ...apiList.page,
+      data
+    })
+  },
+  page (data) {
+    return axiosApi({
+        ...apiList.page,
+        data
+    })
+  },
+  queryOperatorDetailPerformance (data) {
+    return axiosApi({
+      ...apiList.queryOperatorDetailPerformance,
+      data
+    })
+  },
+  queryOperatorDetailsPerformance (data) {
+    return axiosApi({
+      ...apiList.queryOperatorDetailsPerformance,
+      data
+    })
+  }
+}

+ 162 - 0
imcs-ui/src/views/zuihou/statisticalAnalysis/operatorDetailPerformance/Index.vue

@@ -0,0 +1,162 @@
+<template>
+  <div class="app-container">
+    <!-- 列表数据 -->
+    <el-table
+      :key="tableKey"
+      ref="table"
+      v-loading="loading"
+      :data="tableData"
+      border
+      fit
+      style="width: 100%;"
+      @selection-change="onSelectChange"
+      @cell-click="cellClick"
+    >
+      <!--姓名-->
+      <el-table-column
+        :label='$t("statisticalAnalysis.table.operatorPerformance.operatorName")'
+        :show-overflow-tooltip="true">
+        <template slot-scope="{ row }">
+          <a class="rowBtn" @click="queryOperatorPerformance(row)">{{row.name}}</a>
+        </template>
+      </el-table-column>
+      <!--部门-->
+      <el-table-column
+        prop="orgName"
+        :label='$t("statisticalAnalysis.table.operatorPerformance.operatorDept")'
+        :show-overflow-tooltip="true"
+      />
+
+      <!--生产总工时-->
+      <el-table-column
+        prop="statisticalHours"
+        :label='$t("statisticalAnalysis.table.operatorPerformance.operatorStatisticalHours")'
+        :show-overflow-tooltip="true"
+      >
+
+      </el-table-column>
+
+      <!--月份-->
+      <el-table-column
+        prop="statisticalDate"
+        :label='$t("statisticalAnalysis.table.operatorPerformance.operatorStatisticalDate")'
+        :show-overflow-tooltip="true"
+      />
+    </el-table>
+    <!--【用户工时月明细组件】 -->
+    <el-dialog
+      :visible.sync="operatorDetailsPerformanceVisible"
+      width="80%"
+      custom-class="dialogNoTop"
+      @close="editOperatorDetailsPerformanceClose"
+    >
+      <!--【用户工时月统计组件】 -->
+      <OperatorDetailsPerformance
+        :row-data="rowData"
+        :loading-id="loadingId"
+        :loading-date="loadingDate"
+        @close="editOperatorDetailsPerformanceClose"
+        @success="editOperatorDetailsPerformanceSuccess"
+      />
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  // 【用户工时管理】-API
+  import productlineAvailabilityApi from "@/api/statisticalAnalysis/productlineAvailability"
+  import OperatorDetailsPerformance from "@/views/zuihou/statisticalAnalysis/operatorDetailsPerformance/Index"
+  // 【弹出框】elementui组件
+  import elDragDialog from '@/directive/el-drag-dialog'
+
+  export default {
+    name: "operatorDetailsPerformance",
+    directives: {elDragDialog},
+    components: {OperatorDetailsPerformance},
+    props: {
+      productionlineId: {
+        type:String,
+        default:''
+      },
+      statisticalDate: {
+        type:String,
+        default:''
+      }
+    },
+    data() {
+      return {
+        loadingId:'',
+        loadingDate:'',
+        operatorPerformanceVisible: false, // 产线人员工时管理
+        operatorDetailsPerformanceVisible: false,
+        rowData: {}, // row数据
+        tableKey: 0,
+        selection: [],
+        loading: false,
+        tableData: []
+      }
+    },
+    computed: {
+    },
+    // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+    created() {
+      // 加载列表数据
+      this.fetch()
+    },
+    mounted() {
+    },
+    methods: {
+      fetch() {
+        this.tableKey = !this.tableKey
+        this.loading = true
+          productlineAvailabilityApi.queryOperatorDetailPerformance({"productionlineId":this.productionlineId,"statisticalDate":this.statisticalDate}).then(response => {
+          const res = response.data
+          if (res.isSuccess) {
+            this.tableData = res.data
+          }
+        }).finally(() => this.loading = false)
+
+      },
+      cellClick(row, column) {
+        if (column['columnKey'] === "operation") {
+          return
+        }
+        let flag = false
+        this.selection.forEach((item) => {
+          if (item.id === row.id) {
+            flag = true
+            this.$refs.table.toggleRowSelection(row)
+          }
+        })
+
+        if (!flag) {
+          this.$refs.table.toggleRowSelection(row, true)
+        }
+      },
+      onSelectChange(selection) {
+        this.selection = selection
+      },
+      queryOperatorPerformance(row) {
+          this.loadingId = row.loadingUserId
+          this.loadingDate = row.statisticalDate
+          this.operatorDetailsPerformanceVisible = true
+      },
+      editOperatorDetailsPerformanceClose(){
+          this.operatorDetailsPerformanceVisible = false
+      },
+      editOperatorDetailsPerformanceSuccess(){
+          this.operatorDetailsPerformanceVisible = false
+      },
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .rowBtn {
+    margin: 0 5px;
+    color: #1890ff;
+  }
+
+  .rowBtn:hover {
+    opacity: 0.7;
+  }
+</style>

+ 139 - 0
imcs-ui/src/views/zuihou/statisticalAnalysis/operatorDetailsPerformance/Index.vue

@@ -0,0 +1,139 @@
+<template>
+  <div class="app-container" ref="showDialog">
+    <!-- 列表数据 -->
+    <el-table
+      :key="tableKey"
+      ref="table"
+      v-loading="loading"
+      :data="tableData"
+      border
+      fit
+      style="width: 100%;"
+      @selection-change="onSelectChange"
+      @cell-click="cellClick"
+    >
+      <!--姓名-->
+      <el-table-column
+        prop="name"
+        :label='$t("statisticalAnalysis.table.operatorPerformance.operatorName")'
+        :show-overflow-tooltip="true">
+      </el-table-column>
+      <!--部门-->
+      <el-table-column
+        prop="orgName"
+        :label='$t("statisticalAnalysis.table.operatorPerformance.operatorDept")'
+        :show-overflow-tooltip="true"
+      />
+
+      <!--生产总工时-->
+      <el-table-column
+        prop="statisticalHours"
+        :label='$t("statisticalAnalysis.table.operatorPerformance.operatorStatisticalHours")'
+        :show-overflow-tooltip="true"
+      >
+
+      </el-table-column>
+
+      <!--日期-->
+      <el-table-column
+        prop="statisticalDate"
+        :label='$t("statisticalAnalysis.table.operatorPerformance.operatorStatisticalDate")'
+        :show-overflow-tooltip="true"
+      />
+    </el-table>
+  </div>
+</template>
+
+<script>
+    // 【用户工时管理】-API
+    import productlineAvailabilityApi from "@/api/statisticalAnalysis/productlineAvailability"
+    // 【弹出框】elementui组件
+    import elDragDialog from '@/directive/el-drag-dialog'
+
+    export default {
+        name: "operatorDetailsPerformance",
+        directives: {
+            elDragDialog,
+            trigger:{
+                inserted(el,binging){
+                    console.log("自动触发事件")
+                    el.click()
+                }
+            }},
+        components: {},
+        props: {
+            loadingId: {
+                type:String,
+                default:''
+            },
+            loadingDate: {
+                type:String,
+                default:''
+            }
+        },
+        data() {
+            return {
+                operatorPerformanceVisible: false, // 产线人员工时管理
+                rowData: {}, // row数据
+                tableKey: 0,
+                selection: [],
+                loading: false,
+                tableData: []
+            }
+        },
+        computed: {
+        },
+        // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+        created() {
+            // 加载列表数据
+            this.fetch()
+        },
+        mounted() {
+        },
+        methods: {
+            view(row) {
+                this.$refs.view.setOperatorDetailPerformance(row)
+                this.operatorViewVisible = true
+            },
+            fetch() {
+                this.tableKey = !this.tableKey
+                this.loading = true
+                productlineAvailabilityApi.queryOperatorDetailsPerformance({"loadingId":this.loadingId,"loadingDate":this.loadingDate}).then(response => {
+                    const res = response.data
+                    if (res.isSuccess) {
+                        this.tableData = res.data
+                    }
+                }).finally(() => this.loading = false)
+            },
+            cellClick(row, column) {
+                if (column['columnKey'] === "operation") {
+                    return
+                }
+                let flag = false
+                this.selection.forEach((item) => {
+                    if (item.id === row.id) {
+                        flag = true
+                        this.$refs.table.toggleRowSelection(row)
+                    }
+                })
+
+                if (!flag) {
+                    this.$refs.table.toggleRowSelection(row, true)
+                }
+            },
+            onSelectChange(selection) {
+                this.selection = selection
+            },
+        }
+    }
+</script>
+<style lang="scss" scoped>
+  .rowBtn {
+    margin: 0 5px;
+    color: #1890ff;
+  }
+
+  .rowBtn:hover {
+    opacity: 0.7;
+  }
+</style>

+ 169 - 0
imcs-ui/src/views/zuihou/statisticalAnalysis/operatorPerformance/Index.vue

@@ -0,0 +1,169 @@
+<template>
+  <div class="app-container">
+		<!-- 搜索模块 -->
+    <div class="filter-container">
+		<span style="margin-left: 10px;">
+    		<span>{{$t("statisticalAnalysis.searchForm.agvAvailability.statisticalDate")}}:</span>
+        <el-date-picker
+          v-model="queryParams.model.statisticalDate"
+          type="datetime"
+          format="yyyy-MM"
+          value-format="yyyy-MM"
+          style="width: 20%;"
+        />
+    	</span>
+      <span style="margin-left: 10px;">
+	      <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
+	        {{ $t("table.search") }}
+	      </el-button>
+	      <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
+	        {{ $t("table.reset") }}
+	      </el-button>
+      </span>
+    </div>
+	<!-- 列表数据 -->
+    <el-table
+      :key="tableKey"
+      ref="table"
+      v-loading="loading"
+      :data="tableData.records"
+      border
+      fit
+      row-key="id"
+      style="width: 100%;margin-top:50px;"
+    >
+    	<!-- 序号 -->
+    	<el-table-column :label='$t("common.serialNo")' width="55px" align="center">
+	      <template slot-scope="scope">
+	        <div>
+	          {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
+	        </div>
+	      </template>
+      </el-table-column>
+      <el-table-column prop="productionlineName" :label='$t("statisticalAnalysis.table.operatorPerformance.productLine")' :show-overflow-tooltip="true"></el-table-column>
+      <el-table-column prop="statisticalHours" :label='$t("statisticalAnalysis.table.operatorPerformance.statisticalHours")' :show-overflow-tooltip="true"></el-table-column>
+      <el-table-column prop="statisticalDate" :label='$t("statisticalAnalysis.table.operatorPerformance.statisticalDate")' :show-overflow-tooltip="true"></el-table-column>
+      <!--操作-->
+      <el-table-column
+        :label="$t('table.operation')"
+        fixed="right"
+        align="center"
+        column-key="operation"
+        width="260px"
+      >
+        <template slot-scope="{ row }">
+          <a
+            class="rowBtn"
+            @click="queryOperatorPerformance(row)"
+          >查看人员工时详情</a>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="tableData.total > 0"
+      :limit.sync="queryParams.size"
+      :page.sync="queryParams.current"
+      :total="Number(tableData.total)"
+      @pagination="fetch"
+    />
+    <el-dialog
+      :visible.sync="operatorPerformanceVisible"
+      width="80%"
+      custom-class="dialogNoTop"
+      @close="editOperatorPerformanceClose"
+    >
+      <!--【用户工时月统计组件】 -->
+      <OperatorDetailPerformance
+        :row-data="rowData"
+        :productionline-id="productionlineId"
+        :statistical-date="statisticalDate"
+        @close="editOperatorPerformanceClose"
+        @success="editOperatorPerformanceSuccess"
+      />
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+	// 【分页】组件
+	import Pagination from "@/components/Pagination"
+	// 【产线工时管理】-API
+	import productlineAvailabilityApi from "@/api/statisticalAnalysis/productlineAvailability"
+  import OperatorDetailPerformance from "@/views/zuihou/statisticalAnalysis/operatorDetailPerformance/Index"
+	// 共通函数
+	import {initQueryParams } from '@/utils/commons'
+
+	export default {
+	  name: "agvAvailability",
+	  directives: { },
+	  components: { Pagination,OperatorDetailPerformance },
+	  props: {
+	  },
+	  data () {
+	    return {
+	      testRow: {"productionlineId":1,"statisticalDate":"2021-12"},
+        rowData: {},
+        productionlineId:'',
+        statisticalDate:'',
+	      tableKey: 0,
+        operatorPerformanceVisible: false,
+        queryParams: initQueryParams({}),
+        loading: false,
+        tableData: {
+	        total: 0
+	      }
+	    }
+	  },
+	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+	  created() {
+	  	// 加载列表数据
+	  	this.fetch()
+	  },
+	  computed: {
+	    currentUser () {
+	      return this.$store.state.account.user
+	    }
+	  },
+	  mounted () {
+	  },
+	  methods: {
+	    search () {
+	      this.fetch({
+	        ...this.queryParams
+	      })
+	    },
+	    reset () {
+	      this.queryParams = initQueryParams({})
+	      this.$refs.table.clearSort()
+	      this.$refs.table.clearFilter()
+	      this.search()
+	    },
+	    fetch (params = {}) {
+	      this.loading = true
+          this.queryParams.current = params.current ? params.current : this.queryParams.current
+          this.queryParams.size = params.size ? params.size : this.queryParams.size
+          productlineAvailabilityApi.getList(this.queryParams).then(response => {
+	        const res = response.data
+	        if (res.isSuccess) {
+	          this.tableData = res.data
+	        }
+	      }).finally(() => this.loading = false)
+	    },
+      //【设备维保记录】按钮-事件
+      queryOperatorPerformance(row){
+        this.productionlineId = row.productionlineId
+        this.statisticalDate = row.statisticalDate
+        this.rowData = row;
+        this.operatorPerformanceVisible = true
+      },
+      editOperatorPerformanceClose(){
+        this.operatorPerformanceVisible = false
+        this.search()
+      },
+      editOperatorPerformanceSuccess(){
+        this.search()
+      },
+	  }
+	}
+</script>
+<style lang="scss" scoped></style>