| | |
| | | <template #search> |
| | | <el-form :model="form" labelWidth="auto" inline> |
| | | <el-form-item label="菌种编号:"> |
| | | <el-input v-model="form.planName" placeholder="请输入"></el-input> |
| | | <el-input v-model="form.strainCode" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="菌种名称:"> |
| | | <el-input v-model="form.planCode" placeholder="请输入"></el-input> |
| | | <el-input v-model="form.strainName" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="起传类型"> |
| | | <el-input v-model="form.creator" placeholder="请输入"></el-input> |
| | | <el-select v-model="form.generationType" placeholder="请选择"> |
| | | <el-option label="母代" :value="1"></el-option> |
| | | <el-option label="祖代" :value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label=""> |
| | | <el-button type="default" @click="resetForm">重置</el-button> |
| | | <el-button type="primary" @click="handleSearch">查询</el-button> |
| | | <el-button style="margin-left: 10px;" type="primary" @click="handleSearch">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList } from "./service"; |
| | | export default { |
| | | name: "PedigreeChart", |
| | | components: {}, |
| | |
| | | return { |
| | | currentType: "list", // 当前显示类型:list-列表,draft-草稿箱 |
| | | form: { |
| | | planName: "", |
| | | planCode: "", |
| | | creator: "", |
| | | createTime: [], |
| | | approver: "", |
| | | status: "", |
| | | strainCode: "", |
| | | strainName: "", |
| | | generationType: "", |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | }, |
| | | tableData: [], |
| | | total: 0, |
| | |
| | | }, |
| | | resetForm() { |
| | | this.form = { |
| | | planName: "", |
| | | planCode: "", |
| | | creator: "", |
| | | createTime: [], |
| | | approver: "", |
| | | status: "", |
| | | strainCode: "", |
| | | strainName: "", |
| | | generationType: "", |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | }; |
| | | }, |
| | | handleNewStrain() { |
| | |
| | | }); |
| | | }, |
| | | handleSearch() { |
| | | // 实现查询逻辑 |
| | | console.log("查询条件:", this.form); |
| | | this.form.pageNum = 1; |
| | | this.getTableData(); |
| | | }, |
| | | getStatusType(status) { |
| | | const statusMap = { |
| | |
| | | this.getTableData(); |
| | | }, |
| | | getTableData() { |
| | | // 根据currentType请求不同的数据 |
| | | if (this.currentType === "list") { |
| | | this.tableData = this.mockListData; |
| | | this.total = this.mockListData.length; |
| | | } else { |
| | | this.tableData = this.mockDraftData; |
| | | this.total = this.mockDraftData.length; |
| | | } |
| | | getList(this.form).then(res => { |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.list; |
| | | this.total = res.data.total; |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | }; |