hdy
8 天以前 b9df2fc5c64a1d989991655a9e42e4d1f2ec4075
提交 | 用户 | 时间
849473 1 <template>
A 2   <div class="app-container">
3     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
4       <el-form-item label="工位编码" prop="locationCode">
5         <el-input
6           v-model="queryParams.locationCode"
7           placeholder="请输入工位编码"
8           clearable
9           @keyup.enter.native="handleQuery"
10         />
11       </el-form-item>
12       <el-form-item label="工位名称" prop="locationName">
13         <el-input
14           v-model="queryParams.locationName"
15           placeholder="请输入工位名称"
16           clearable
17           @keyup.enter.native="handleQuery"
18         />
19       </el-form-item>
20       <el-form-item style="float: right">
21         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
22         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
23         <el-button icon="el-icon-setting" size="mini" @click="toggleAdvancedSearch">高级查询</el-button>
24       </el-form-item>
25       <transition name="fade">
26         <div v-if="advancedSearchVisible" class="advanced-search">
27           <el-form-item label="产品编码" prop="productCode">
28             <el-input
29               v-model="queryParams.productCode"
30               placeholder="请输入产品编码"
31               clearable
32               @keyup.enter.native="handleQuery"
33             />
34           </el-form-item>
35           <el-form-item label="产品名称" prop="productName">
36             <el-input
37               v-model="queryParams.productName"
38               placeholder="请输入产品名称"
39               clearable
40               @keyup.enter.native="handleQuery"
41             />
42           </el-form-item>
43           <el-form-item label="流程编码" prop="routeCode">
44             <el-input
45               v-model="queryParams.routeCode"
46               placeholder="请输入流程编码"
47               clearable
48               @keyup.enter.native="handleQuery"
49             />
50           </el-form-item>
51         </div>
52       </transition>
53     </el-form>
54
55     <el-row :gutter="10" class="mb8">
56       <el-col :span="1.5">
57         <el-button
58           type="primary"
59           plain
60           icon="el-icon-plus"
61           size="mini"
62           @click="handleAdd"
63           v-hasPermi="['bs:routeChildInfo:add']"
64         >新增</el-button>
65       </el-col>
66       <el-col :span="1.5">
67         <el-button
68           type="success"
69           plain
70           icon="el-icon-edit"
71           size="mini"
72           :disabled="single"
73           @click="handleUpdate"
74           v-hasPermi="['bs:routeChildInfo:edit']"
75         >修改</el-button>
76       </el-col>
77       <el-col :span="1.5">
78         <el-button
79           type="danger"
80           plain
81           icon="el-icon-delete"
82           size="mini"
83           :disabled="multiple"
84           @click="handleDelete"
85           v-hasPermi="['bs:routeChildInfo:remove']"
86         >删除</el-button>
87       </el-col>
88       <el-col :span="1.5">
89         <el-button
90           type="warning"
91           plain
92           icon="el-icon-download"
93           size="mini"
94           @click="handleExport"
95           v-hasPermi="['bs:routeChildInfo:export']"
96         >导出</el-button>
97       </el-col>
98       <el-col :span="1.5">
99         <el-button
100           type="warning"
101           plain
102           icon="el-icon-close"
103           size="mini"
104           @click="handleClose"
105         >关闭</el-button>
106       </el-col>
107     </el-row>
108     <el-row>
ef94dd 109 <!--      <el-descriptions class="margin-top" :column="4" label-style="font-weight: bold" content-style="font-weight: bold">-->
A 110 <!--        <el-descriptions-item label="流程编码">{{this.queryParams.routeCode}}</el-descriptions-item>-->
111 <!--        <el-descriptions-item label="流程名称">{{this.routeInfo[0].routeName}}</el-descriptions-item>-->
112 <!--        <el-descriptions-item label="产品编码">{{this.routeInfo[0].productCode}}</el-descriptions-item>-->
113 <!--        <el-descriptions-item label="产品名称">{{this.routeInfo[0].productName}}</el-descriptions-item>-->
114 <!--      </el-descriptions>-->
115       <el-descriptions class="margin-top" :contentStyle="labelStyle" :column="3" :size="size" border>
116         <el-descriptions-item>
117           <template slot="label">
118             <i class="el-icon-user"></i>
119             流程编码
120           </template>
121           {{this.queryParams.routeCode}}
122         </el-descriptions-item>
123         <el-descriptions-item>
124           <template slot="label">
125             <i class="el-icon-mobile-phone"></i>
126             流程名称
127           </template>
128           {{this.routeInfo[0].routeName}}
129         </el-descriptions-item>
130         <el-descriptions-item>
131           <template slot="label">
132             <i class="el-icon-location-outline"></i>
133             产品编码
134           </template>
135           {{this.routeInfo[0].productCode}}
136         </el-descriptions-item>
137         <el-descriptions-item>
138           <template slot="label">
139             <i class="el-icon-tickets"></i>
140             产品名称
141           </template>
142           {{this.routeInfo[0].productName}}
143         </el-descriptions-item>
849473 144       </el-descriptions>
A 145     </el-row>
146
147     <el-table border v-loading="loading" :data="routeChildInfoList" @selection-change="handleSelectionChange">
148       <el-table-column type="selection" width="55" align="center" />
149       <el-table-column show-overflow-tooltip="true" label="工位编码" align="center" prop="locationCode" />
150       <el-table-column show-overflow-tooltip="true" label="工位名称" align="center" prop="locationName" />
151       <el-table-column show-overflow-tooltip="true" label="加工顺序" align="center" prop="stepNo" />
152       <el-table-column show-overflow-tooltip="true" label="产品编码" align="center" prop="productCode" />
153       <el-table-column show-overflow-tooltip="true" label="产品名称" align="center" prop="productName" />
154       <el-table-column show-overflow-tooltip="true" label="创建用户" align="center" prop="createBy" />
155       <el-table-column label="创建时间" align="center" prop="createTime" width="180">
156       </el-table-column>
157       <el-table-column show-overflow-tooltip="true" label="更改用户" align="center" prop="updateBy" />
158       <el-table-column label="更改时间" align="center" prop="updateTime" width="180">
159       </el-table-column>
160       <el-table-column show-overflow-tooltip="true" label="流程编码" align="center" prop="routeCode" />
161     </el-table>
162
163     <pagination
164       v-show="total>0"
165       :total="total"
166       :page.sync="queryParams.pageNum"
167       :limit.sync="queryParams.pageSize"
168       @pagination="getList"
169     />
170
171     <!-- 添加或修改工艺路线子信息对话框 -->
172     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
173       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
174 <!--        <el-form-item label="主键id" prop="id">-->
175 <!--          <el-input v-model="form.id" placeholder="请输入主键id" />-->
176 <!--        </el-form-item>-->
177         <el-form-item label="流程编码" prop="routeCode">
178           <el-input :disabled="true"  v-model="form.routeCode" placeholder="请输入流程编码" />
179         </el-form-item>
180         <el-form-item label="产品编码" prop="productCode">
181           <el-input :disabled="true" v-model="form.productCode" placeholder="请输入产品编码" />
182         </el-form-item>
183         <el-form-item label="产品名称" prop="productName">
184           <el-input :disabled="true" v-model="form.productName" placeholder="请输入产品名称" />
185         </el-form-item>
186         <el-form-item label="工位编码" prop="locationCode">
187           <el-input v-model="form.locationCode" placeholder="请输入工位编码" />
188         </el-form-item>
189         <el-form-item label="工位名称" prop="locationName">
190           <el-input v-model="form.locationName" placeholder="请输入工位名称" />
191         </el-form-item>
192         <el-form-item label="加工顺序" prop="stepNo">
193           <el-input v-model="form.stepNo" placeholder="请输入加工顺序" />
194         </el-form-item>
195       </el-form>
196       <div slot="footer" class="dialog-footer">
197         <el-button type="primary" @click="submitForm">确 定</el-button>
198         <el-button @click="cancel">取 消</el-button>
199       </div>
200     </el-dialog>
201   </div>
202 </template>
203
204 <script>
205 import { listRouteChildInfo, getRouteChildInfo, delRouteChildInfo, addRouteChildInfo, updateRouteChildInfo } from "@/api/main/bs/routeChildInfo";
206 import {listRouteInfo} from "@/api/main/bs/routeInfo";
207
208 export default {
209   name: "RouteChildInfo",
210   data() {
211     return {
ef94dd 212       labelStyle: "width: 300px;",
A 213       size: 'medium',
849473 214       advancedSearchVisible: false,
A 215       // 遮罩层
216       loading: true,
217       // 选中数组
218       ids: [],
219       // 非单个禁用
220       single: true,
221       // 非多个禁用
222       multiple: true,
223       // 显示搜索条件
224       showSearch: true,
225       // 总条数
226       total: 0,
227       // 工艺路线子信息表格数据
228       routeChildInfoList: [],
229       // 弹出层标题
230       title: "",
231       // 是否显示弹出层
232       open: false,
233       // 查询参数
234       queryParams: {
235         pageNum: 1,
236         pageSize: 10,
237         productCode: null,
238         productName: null,
239         locationCode: null,
240         locationName: null,
241         routeCode: null
242       },
243       // 表单参数
244       form: {
245         routeCode: "12323",
246       },
247       // 表单校验
248       rules: {
249         id: [
250           { required: true, message: "主键id不能为空", trigger: "blur" }
251         ],
252         locationCode: [
253           { required: true, message: "工位编码不能为空", trigger: "blur" }
254         ],
255       },
256       //父页面信息
257       routeInfo: {
258       }
259     };
260   },
261   created() {
262     let routeCode = this.$route.query.routeCode;
263     this.queryParams.routeCode = routeCode;
264     this.headerInformation();
265     this.getList();
266     console.log(this.routeInfo)
267   },
268   methods: {
269     /** 工艺流程表头信息 */
270     headerInformation() {
271       listRouteInfo(this.queryParams).then(response => {
272         this.routeInfo = response.rows;
273       });
274     },
275     toggleAdvancedSearch() {
276       this.advancedSearchVisible = !this.advancedSearchVisible;
277     },
278     /** 返回按钮操作 */
279     handleClose() {
280       const obj = { path: "/main/bs/routeInfo" };
281       this.$tab.closeOpenPage(obj);
282     },
283     /** 查询工艺路线子信息列表 */
284     getList() {
285       this.loading = true;
286       listRouteChildInfo(this.queryParams).then(response => {
287         this.routeChildInfoList = response.rows;
288         this.total = response.total;
289         this.loading = false;
290       });
291     },
292     // 取消按钮
293     cancel() {
294       this.open = false;
295       this.reset();
296     },
297     // 表单重置
298     reset() {
299       this.form = {
300         id: null,
301         productCode: this.routeInfo[0].productCode,
302         productName: this.routeInfo[0].productName,
303         locationCode: null,
304         locationName: null,
305         stepNo: null,
306         createBy: null,
307         createTime: null,
308         updateBy: null,
309         updateTime: null,
310         delFlag: null,
311         routeCode: this.queryParams.routeCode
312       };
313       this.resetForm("form");
314     },
315     /** 搜索按钮操作 */
316     handleQuery() {
317       this.queryParams.pageNum = 1;
318       this.getList();
319     },
320     /** 重置按钮操作 */
321     resetQuery() {
322       this.resetForm("queryForm");
323       this.handleQuery();
324     },
325     // 多选框选中数据
326     handleSelectionChange(selection) {
327       this.ids = selection.map(item => item.id)
328       this.single = selection.length!==1
329       this.multiple = !selection.length
330     },
331     /** 新增按钮操作 */
332     handleAdd() {
333       console.log(this.routeInfo)
334       this.reset();
335       this.open = true;
336       this.title = "添加工艺路线子信息";
337     },
338     /** 修改按钮操作 */
339     handleUpdate(row) {
340       this.reset();
341       const id = row.id || this.ids
342       getRouteChildInfo(id).then(response => {
343         this.form = response.data;
344         this.open = true;
345         this.title = "修改工艺路线子信息";
346       });
347     },
348     /** 提交按钮 */
349     submitForm() {
350       this.$refs["form"].validate(valid => {
351         if (valid) {
352           if (this.form.id != null) {
353             updateRouteChildInfo(this.form).then(response => {
354               this.$modal.msgSuccess("修改成功");
355               this.open = false;
356               this.getList();
357             });
358           } else {
359             addRouteChildInfo(this.form).then(response => {
360               this.$modal.msgSuccess("新增成功");
361               this.open = false;
362               this.getList();
363             });
364           }
365         }
366       });
367     },
368     /** 删除按钮操作 */
369     handleDelete(row) {
370       const ids = row.id || this.ids;
371       this.$modal.confirm('是否确认删除').then(function() {
372         return delRouteChildInfo(ids);
373       }).then(() => {
374         this.getList();
375         this.$modal.msgSuccess("删除成功");
376       }).catch(() => {});
377     },
378     /** 导出按钮操作 */
379     handleExport() {
380       this.download('bs/routeChildInfo/export', {
381         ...this.queryParams
382       }, `routeChildInfo_${new Date().getTime()}.xlsx`)
383     }
384   }
385 };
386 </script>
ef94dd 387