| <template> | 
|   <TableLayout :permissions="['business:unqualifiedrecord:query']"> | 
|     <!-- 搜索表单 --> | 
|     <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> | 
|       <el-form-item label="工单编码" prop="code"> | 
|         <el-input v-model="searchForm.code" placeholder="请输入工单编码" @keypress.enter.native="search"></el-input> | 
|       </el-form-item> | 
|       <el-form-item label="不良项" prop="categoryId"> | 
|         <el-select v-model="searchForm.categoryId" filterable clearable placeholder="请选择"> | 
|           <el-option | 
|             v-for="(item, index) in category" | 
|             :key="index" | 
|             :label="item.name" | 
|             :value="item.id"> | 
|           </el-option> | 
|         </el-select> | 
|       </el-form-item> | 
|        | 
|       <section> | 
|         <el-button type="primary" @click="search">搜索</el-button> | 
|          | 
|         <el-button @click="reset">重置</el-button> | 
|       </section> | 
|     </el-form> | 
|     <!-- 表格和分页 --> | 
|     <template v-slot:table-wrap> | 
|       <ul class="toolbar" v-permissions="['business:unqualifiedrecord:exportExcel']"> | 
|         <el-button type="primary" :loading="isWorking.export" v-permissions="['business:unqualifiedrecord:exportExcel']" @click="exportExcel">导出</el-button> | 
|       </ul> | 
|       <el-table | 
|         v-loading="isWorking.search" | 
|         :data="tableData.list" | 
|         border | 
|         stripe | 
|       > | 
|         <el-table-column type="index" :index="customIndex" label="序号" align="center" fixed="left" min-width="80px"></el-table-column> | 
|         <el-table-column prop="workOrderCode" label="工单编码" align="center" min-width="100px"></el-table-column> | 
|         <el-table-column prop="materialName" label="物料名称" align="center" min-width="100px"></el-table-column> | 
|         <el-table-column prop="materialCode" label="物料编码" align="center" min-width="100px"></el-table-column> | 
|         <el-table-column prop="proceduresName" label="工序" align="center" min-width="100px"></el-table-column> | 
|         <el-table-column prop="categoryName" label="不良项" align="center" min-width="100px"></el-table-column> | 
|         <el-table-column prop="unqualifiedNum" label="数量" align="center" min-width="100px"></el-table-column> | 
|         <el-table-column prop="createTime" label="创建时间" align="center" min-width="100px"></el-table-column> | 
|         <el-table-column prop="createUserName" label="创建人" align="center" min-width="100px"></el-table-column> | 
|       </el-table> | 
|       <pagination | 
|         @size-change="handleSizeChange" | 
|         @current-change="handlePageChange" | 
|         :pagination="tableData.pagination" | 
|       > | 
|       </pagination> | 
|     </template> | 
|   </TableLayout> | 
| </template> | 
|   | 
| <script> | 
| import BaseTable from '@/components/base/BaseTable' | 
| import TableLayout from '@/layouts/TableLayout' | 
| import Pagination from '@/components/common/Pagination' | 
| import { checkAllList } from '@/api/ext/categoryUnionExt' | 
| export default {  | 
|   name: 'UnqualifiedRecord', | 
|   extends: BaseTable, | 
|   components: { TableLayout, Pagination }, | 
|   data () { | 
|     return { | 
|       // 搜索 | 
|       searchForm: { | 
|         code: '', | 
|         categoryId: '' | 
|       }, | 
|       category: [] | 
|     } | 
|   }, | 
|   created () { | 
|     this.config({ | 
|       module: '工单类-报工不良记录类型表', | 
|       api: '/business/unqualifiedRecord', | 
|       'field.id': 'id', | 
|       'field.main': 'id' | 
|     }) | 
|     this.search() | 
|     checkAllList({ cateType: 3 }) | 
|       .then(res => { | 
|         this.category = res | 
|       }) | 
|       .catch(err => { | 
|         console.log(err) | 
|       }) | 
|   }, | 
|   methods: { | 
|     customIndex(index) { | 
|       return (this.tableData.pagination.pageIndex-1) * this.tableData.pagination.pageSize + index + 1 | 
|     } | 
|   }, | 
| } | 
|   | 
| </script> |