From 538cb677c7cd304bc8a348c261c74694a06ec8e6 Mon Sep 17 00:00:00 2001
From: lxp <1928192722@qq.com>
Date: 星期六, 15 三月 2025 16:59:44 +0800
Subject: [PATCH] 统计图表 、 任务展示代码搬迁
---
src/views/chart/sampleDefect/index.vue | 210 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 206 insertions(+), 4 deletions(-)
diff --git a/src/views/chart/sampleDefect/index.vue b/src/views/chart/sampleDefect/index.vue
index 3a3bd07..6a9dae6 100644
--- a/src/views/chart/sampleDefect/index.vue
+++ b/src/views/chart/sampleDefect/index.vue
@@ -1,9 +1,211 @@
+<style scoped>
+ .title {
+ height: 60px;
+ line-height: 60px;
+ }
+
+ .search {
+ background-color: #fff;
+ width: calc(100% - 40px);
+ height: 80px;
+ display: flex;
+ align-items: center;
+ }
+
+ .search_thing {
+ width: 350px;
+ display: flex;
+ align-items: center;
+ }
+
+ .search_label {
+ width: 110px;
+ font-size: 14px;
+ text-align: right;
+ }
+
+ .search_input {
+ width: calc(100% - 110px);
+ }
+
+ .table {
+ margin-top: 10px;
+ background-color: #fff;
+ width: calc(100% - 40px);
+ height: 450px;
+ padding: 20px;
+ }
+ >>>.cell{
+ display: flex;
+ align-items: center;
+ }
+ .page {
+ width: 100%;
+ height: 30px;
+ text-align: right;
+ margin-bottom: 10px;
+ }
+</style>
+
<template>
- <div>鏍峰搧缂洪櫡鎸囨暟</div>
+ <div class="role_manage bg-1">
+ <div>
+ <el-row class="title">
+ <el-col :span="12" style="padding-left: 20px;text-align: left;">鏍峰搧缂洪櫡鎸囨暟</el-col>
+ </el-row>
+ </div>
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">妫�楠岄」鐩細</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="entity.inspectionItems" @keyup.enter.native="refreshTable()"></el-input></div>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">濮旀墭缂栧彿锛�</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="entity.orderNumber" @keyup.enter.native="refreshTable()"></el-input></div>
+ </div>
+ <div class="search_thing" style="padding-left: 30px;">
+ <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
+ </div>
+ </div>
+ <div class="table">
+ <el-table
+ :data="tableData"
+ style="width: 100%;margin-bottom: 10px"
+ height="calc(100% - 40px)"
+ row-key="id"
+ v-loading="loading"
+ border
+ default-expand-all
+ :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
+ <el-table-column
+ prop="inspection_item"
+ label="妫�楠岄」鐩�"
+ sortable
+ min-width="180">
+ <template slot-scope="scope">
+ <p>
+ <el-tag style="margin-right: 10px;height: 24px;border-radius: 10px;line-height: 24px;border: 0;" :type="scope.row.level==2?'success':''">{{ '0' + scope.row.level }}</el-tag>
+ <span>{{ scope.row.inspection_item }}</span>
+ </p>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="entrust_code"
+ label="濮旀墭缂栧彿"
+ sortable
+ min-width="180">
+ </el-table-column>
+ <el-table-column
+ prop="name"
+ label="妫�楠屼汉"
+ min-width="180">
+ </el-table-column>
+ <el-table-column
+ prop="create_time"
+ label="妫�楠屾椂闂�"
+ min-width="180">
+ </el-table-column>
+ </el-table>
+ <div class="page">
+ <el-pagination @size-change="sizeChange" @current-change="currentChange" :current-page="page.current"
+ :page-sizes="[10, 20, 30, 50, 100]" :page-size="page.size" layout="total, sizes, prev, pager, next, jumper"
+ :total="total" >
+ </el-pagination>
+ </div>
+ </div>
+ </div>
</template>
<script>
-export default {};
-</script>
-<style></style>
+import {
+ selectSampleDefects
+} from "../../../api/chart/dailyBusinessStatistical";
+ export default {
+ data() {
+ return {
+ entity: {
+ orderNumber:null,
+ inspectionItems:null,
+ },
+ tableData: [],
+ page:{
+ current:1,
+ size:20,
+ },
+ total:0,
+ loading:false,
+ }
+ },
+ mounted() {
+ this.refreshTable()
+ },
+ methods: {
+ refreshTable(){
+ this.loading = true
+ selectSampleDefects({...this.page,...this.entity}).then(res => {
+ this.loading = false
+ if (res.code === 201) {
+ this.loading = false
+ return
+ }
+ this.total = res.data.total;
+ this.tableData = res.data.records.map(item=>{
+ item.level = 1;
+ item.inspection_item = item.sample
+ item.children = item.children.map(m=>{
+ m.id = Math.random(10000)
+ m.level = 2;
+ return m
+ })
+ return item
+ });
+ })
+ },
+ refresh(){
+ this.entity = {
+ orderNumber:null,
+ inspectionItems:null,
+ },
+ this.page.current = 1;
+ this.refreshTable();
+ },
+ sizeChange(val){
+ this.page.size = val
+ this.refreshTable()
+ },
+ currentChange(val){
+ this.page.current = val
+ this.refreshTable()
+ },
+ // 鏉冮檺鍒嗛厤
+ getPower(radio) {
+ let power = JSON.parse(sessionStorage.getItem('power'));
+ let up = false
+ let del = false
+ let add = false
+ for (var i = 0; i < power.length; i++) {
+ if (power[i].menuMethod == 'upParameter') {
+ up = true
+ }
+ if (power[i].menuMethod == 'delParameter') {
+ del = true
+ }
+ if (power[i].menuMethod == 'addParameter') {
+ add = true
+ }
+ }
+ if (!del) {
+ this.componentData.do.splice(1, 1)
+ }
+ if (!up) {
+ this.componentData.do.splice(0, 1)
+ }
+ this.addPower = add
+ }
+ }
+ }
+</script>
--
Gitblit v1.9.3