春风项目四线(合箱线、总装线)
wujian
2024-01-31 238595017057e4bc67393915140507785f45b195
提交 | 用户 | 时间
2fd52d 1 <template>
H 2   <div class="app-container">
3     <el-card class="box-card" >
4       <el-form :model="queryParams" ref="queryForm" :inline="true"  v-show="showSearch" label-width="68px" >
5         <el-form-item label-width="120" label="箱体编码:" prop="sfcCode">
6           <el-input clearable
7                     v-model="queryParams.sfcCode"
8                     placeholder="请输入箱体编码"
9                     @keyup.enter.native="handleQuery"/>
10         </el-form-item>
11         <el-form-item label-width="120" label="工位号:" prop="locationCode">
12           <el-input clearable
13                     v-model="queryParams.locationCode"
14                     placeholder="请输入工位号"
15                     @keyup.enter.native="handleQuery"/>
16         </el-form-item>
17         <el-form-item label-width="130" label="保存日期" prop="dateConditions">
18           <el-date-picker
19             v-model="queryParams.dateConditions"
20             type="datetimerange"
21             :picker-options="pickerOptions"
22             value-format="yyyy-MM-dd HH:mm:ss"
23             range-separator="至"
24             start-placeholder="开始日期"
25             end-placeholder="结束日期"
26             align="right">
27           </el-date-picker>
28         </el-form-item>
29         <el-form-item style="float: right">
30           <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">查询</el-button>
31           <el-button type=""    icon="el-icon-refresh"  @click="resetQuery">重置</el-button>
32         </el-form-item>
33       </el-form>
34     </el-card> <el-card style="margin-top: 10px" class="box-card">
35     <el-table v-loading="loading" border :data="productResultReportList" @selection-change="handleSelectionChange" v-if="productResultReportList.length > 0">
36       <el-table-column type="selection" width="55" align="center" />
37       <el-table-column label="箱体编码" align="center" width="200" prop="sfcCode"></el-table-column>
38       <el-table-column label="工位" align="center" prop="locationCode"></el-table-column>
39       <el-table-column label="参数编码" align="center" prop="paramCode"></el-table-column>
40       <el-table-column label="参数名称" align="center" prop="paramName"></el-table-column>
41       <el-table-column label="参数值" align="center" prop="paramValue"></el-table-column>
42       <el-table-column label="采集时间" align="center" prop="collectionTime" width="180">
43         <template slot-scope="scope">
44           <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
45         </template>
46       </el-table-column>
47       <el-table-column label="状态" align="center" prop="state"></el-table-column>
48       <el-table-column label="单位" align="center" prop="unit"></el-table-column>
49     </el-table>
50     <el-empty v-else>
51       <span slot="description">暂无数据</span>
52     </el-empty>
53   </el-card>
54
55     <pagination
56       v-show="total>0"
57       :total="total"
58       :page.sync="queryParams.pageNum"
59       :limit.sync="queryParams.pageSize"
60       @pagination="getList"
61     />
62
63   </div>
64 </template>
65 <script>
66
67 import { listParamCollection, getParamCollection, delParamCollection, addParamCollection, updateParamCollection } from "@/api/main/da/paramCollection/paramCollection";
68
69 export default {
70   name: "productResult",
71   computed: {
72   },
73   dicts: ['sys_normal_disable','order_scheduling_produce_status','print_status'],
74   components: {
75   },
76   data(){
77     return{
78       dateRange: '',
79       // 用于存储选择的日期范围
80       total: 0,
81       ids: [],
82       productResultReportList: [],
83       loading: true,
84       single: true,
85       // 非多个禁用
86       multiple: true,
87       // 显示搜索条件
88       showSearch: true,
89       // 查询参数
90       queryParams: {
91         pageNum: 1,
92         pageSize: 10,
93         workOrderNo: null,
94         sfcCode: null,
95         productCode: null,
96         productionLine: null,
97         locationCode: null,
98         equipmentNo: null,
99         paramCode: null,
100         paramValue: null,
101         paramUpper: null,
102         paramLower: null,
103         paramStandard: null,
104         collectionTime: null,
105         spareField1: null,
106         spareField2: null,
107         createUser: null,
108         createTime: null,
109         updateUser: null,
110         updateTime: null,
111         state: null,
112         paramName: null,
113         unit: null,
114         type: '工位产品结果',
115         startDate: null,
116         endDate: null,
117         dateConditions: [],
118       },
119
120       pickerOptions: {
121         shortcuts: [{
122           text: '最近一周',
123           onClick(picker) {
124             const end = new Date();
125             const start = new Date();
126             start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
127             picker.$emit('pick', [start, end]);
128           }
129         }, {
130           text: '最近一个月',
131           onClick(picker) {
132             const end = new Date();
133             const start = new Date();
134             start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
135             picker.$emit('pick', [start, end]);
136           }
137         }, {
138           text: '最近三个月',
139           onClick(picker) {
140             const end = new Date();
141             const start = new Date();
142             start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
143             picker.$emit('pick', [start, end]);
144           }
145         }]
146       },
147
148     }
149   },
150   created() {
151     this.getList();
152   },
153   methods: {
154     reset() {
155       this.form = {
156         id: null,
157         workOrderNo: null,
158         sfcCode: null,
159         productCode: null,
160         productionLine: null,
161         locationCode: null,
162         equipmentNo: null,
163         paramCode: null,
164         paramValue: null,
165         paramUpper: null,
166         paramLower: null,
167         paramStandard: null,
168         collectionTime: null,
169         spareField1: null,
170         spareField2: null,
171         createUser: null,
172         createTime: null,
173         updateUser: null,
174         updateTime: null,
175         state: null,
176         paramName: null,
177         unit: null,
178         type: '工位产品结果',
179       };
180       this.resetForm("form");
181     },
182     /** 搜索按钮操作 */
183     handleQuery() {
184       this.queryParams.pageNum = 1;
185       this.getList();
186     },
187     /** 重置按钮操作 */
188     resetQuery() {
189       this.resetForm("queryForm");
190       this.handleQuery();
191     },
192     // 多选框选中数据
193     handleSelectionChange(selection) {
194       this.ids = selection.map(item => item.id)
195       this.single = selection.length !== 1
196       this.multiple = !selection.length
197     },
198
199     getList() {
200       this.loading = true;
201       listParamCollection(this.queryParams).then(response => {
202         this.productResultReportList = response.rows;
203         this.total = response.total;
204         this.loading = false;
205       });
206     },
207
208   },
209 }
210
211 </script>
212
213 <style scoped>
214 ::v-deep .el-form-item__label{
215   font-size: large;
216 }
217 ::v-deep .el-card__body{
218   padding: 15px 20px 0px 20px;
219 }
220 </style>