春风项目四线(合箱线、总装线)
wujian
2024-01-31 c74dcb8dca7b9e3eded0d20299f19a26a6b70974
提交 | 用户 | 时间
b51361 1 <template>
W 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>
8ae9df 17         <el-form-item label-width="130" label="保存日期" prop="dateConditions">
H 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>
b51361 28         </el-form-item>
W 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>
35
36     <el-card style="margin-top: 10px" class="box-card">
37       <el-table v-loading="loading" border :data="tightenReportList" @selection-change="handleSelectionChange" v-if="tightenReportList.length > 0">
38         <el-table-column type="selection" width="55" align="center" />
39         <el-table-column label="箱体编码" align="center" width="200" prop="sfcCode"></el-table-column>
40         <el-table-column label="工位" align="center" prop="locationCode"></el-table-column>
41         <el-table-column label="参数名称" align="center" prop="paramName"></el-table-column>
573023 42         <el-table-column label="参数编码" align="center" prop="paramCode"></el-table-column>
b51361 43         <el-table-column label="参数值" align="center" prop="paramValue"></el-table-column>
573023 44         <el-table-column label="单位" align="center" prop="unit"></el-table-column>
H 45         <el-table-column label="结果" align="center" prop="state"></el-table-column>
b51361 46         <el-table-column label="采集时间" align="center" prop="collectionTime" width="180">
W 47           <template slot-scope="scope">
a0aea8 48             <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
b51361 49           </template>
W 50         </el-table-column>
51       </el-table>
52       <el-empty v-else>
53         <span slot="description">暂无数据</span>
54       </el-empty>
55     </el-card>
56
57     <pagination
58       v-show="total>0"
59       :total="total"
60       :page.sync="queryParams.pageNum"
61       :limit.sync="queryParams.pageSize"
62       @pagination="getList"
63     />
64
65   </div>
66 </template>
67 <script>
68 import { listParamCollection, getParamCollection, delParamCollection, addParamCollection, updateParamCollection } from "@/api/main/da/paramCollection/paramCollection";
69 export default {
70   name: "index",
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       tightenReportList: [],
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,
8ae9df 116         endDate: null,
H 117         dateConditions: [],
118       },
119       pickerOptions: {
120         shortcuts: [{
121           text: '最近一周',
122           onClick(picker) {
123             const end = new Date();
124             const start = new Date();
125             start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
126             picker.$emit('pick', [start, end]);
573023 127           },
H 128           class: 'custom-shortcut' // 添加class属性
8ae9df 129         }, {
H 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]);
573023 136           },
H 137           class: 'custom-shortcut' // 添加class属性
8ae9df 138         }, {
H 139           text: '最近三个月',
140           onClick(picker) {
141             const end = new Date();
142             const start = new Date();
143             start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
144             picker.$emit('pick', [start, end]);
573023 145           },
8ae9df 146         }]
b51361 147       },
W 148     }
149   },
150   created() {
151     this.getList();
152   },
db8f36 153   methods: {
b51361 154
db8f36 155     reset() {
b51361 156       this.form = {
W 157         id: null,
158         workOrderNo: null,
159         sfcCode: null,
160         productCode: null,
161         productionLine: null,
162         locationCode: null,
163         equipmentNo: null,
164         paramCode: null,
165         paramValue: null,
166         paramUpper: null,
167         paramLower: null,
168         paramStandard: null,
169         collectionTime: null,
170         spareField1: null,
171         spareField2: null,
172         createUser: null,
173         createTime: null,
174         updateUser: null,
175         updateTime: null,
176         state: null,
177         paramName: null,
178         unit: null,
179         type: '拧紧数据',
180       };
181       this.resetForm("form");
182     },
183     /** 搜索按钮操作 */
184     handleQuery() {
185       this.queryParams.pageNum = 1;
186       this.getList();
187     },
188     /** 重置按钮操作 */
189     resetQuery() {
190       this.resetForm("queryForm");
191       this.handleQuery();
192     },
193     // 多选框选中数据
194     handleSelectionChange(selection) {
195       this.ids = selection.map(item => item.id)
db8f36 196       this.single = selection.length !== 1
b51361 197       this.multiple = !selection.length
W 198     },
199
200     getList() {
201       this.loading = true;
202       listParamCollection(this.queryParams).then(response => {
203         this.tightenReportList = response.rows;
204         this.total = response.total;
205         this.loading = false;
206       });
207     },
208
db8f36 209   },
b51361 210 }
db8f36 211
b51361 212 </script>
W 213
214 <style scoped>
215 ::v-deep .el-form-item__label{
216   font-size: large;
217 }
218 ::v-deep .el-card__body{
219   padding: 15px 20px 0px 20px;
220 }
573023 221
H 222 /* 添加其他样式属性 */
b51361 223 </style>