| | |
| | | <TableCustom :queryForm="form" :tableData="tableData" :total="total"> |
| | | <template #search> |
| | | <el-form :model="form" labelWidth="auto" inline> |
| | | <el-form-item label="所属项目课题方案:"> |
| | | <el-input v-model="form.planName" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="实验编号:"> |
| | | <el-input v-model="form.planCode" placeholder="请输入"></el-input> |
| | | <el-input v-model="form.experimentCode" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="创建人:" v-if="isChemist"> |
| | | <el-input v-model="form.creator" placeholder="请输入"></el-input> |
| | | <el-form-item label="实验名称:"> |
| | | <el-input v-model="form.experimentName" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="所属项目课题方案:"> |
| | | <el-input v-model="form.projectName" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="创建时间:"> |
| | | <el-date-picker |
| | |
| | | value-format="yyyy-MM-dd" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="状态:" v-if="!isChemist"> |
| | | <el-input v-model="form.approver" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="实验名称:" v-if="isChemist"> |
| | | <el-input v-model="form.experimentName" placeholder="请输入"></el-input> |
| | | <el-form-item label="状态:"> |
| | | <el-select v-model="form.status" placeholder="请选择"> |
| | | <el-option label="草稿箱" :value="-1"></el-option> |
| | | <el-option label="已发送待提交" :value="1"></el-option> |
| | | <el-option label="已提交" :value="2"></el-option> |
| | | <el-option label="已封存" :value="3"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label=""> |
| | | <el-button type="default" @click="resetForm">重置</el-button> |
| | |
| | | |
| | | <script> |
| | | import ApprovalDialog from './components/approvalDialog.vue' |
| | | import { getList } from './service' |
| | | |
| | | export default { |
| | | name: "ProjectList", |
| | |
| | | userRole: 'chemist', // 用户角色 |
| | | currentType: 'list', // 当前显示类型:list-列表,draft-草稿箱 |
| | | form: { |
| | | planName: "", |
| | | planCode: "", |
| | | creator: "", |
| | | createTime: [], |
| | | approver: "", |
| | | status: "", |
| | | experimentCode: "", |
| | | experimentName: "", |
| | | sampleCount: "", |
| | | receivedStatus: "" |
| | | projectName: "", |
| | | createTime: [], |
| | | status: null, |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | }, |
| | | tableData: [], |
| | | total: 0, |
| | |
| | | }, |
| | | resetForm() { |
| | | this.form = { |
| | | planName: "", |
| | | planCode: "", |
| | | creator: "", |
| | | createTime: [], |
| | | approver: "", |
| | | status: "", |
| | | experimentCode: "", |
| | | experimentName: "", |
| | | sampleCount: "", |
| | | receivedStatus: "" |
| | | projectName: "", |
| | | createTime: [], |
| | | status: null, |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | }; |
| | | this.handleSearch(); |
| | | }, |
| | | handleSearch() { |
| | | // 实现查询逻辑 |
| | | console.log("查询条件:", this.form); |
| | | async handleSearch() { |
| | | const params = { |
| | | experimentCode: this.form.experimentCode, |
| | | experimentName: this.form.experimentName, |
| | | projectName: this.form.projectName, |
| | | startTime: this.form.createTime[0] || null, |
| | | endTime: this.form.createTime[1] || null, |
| | | status: this.form.status, |
| | | pageNum: this.form.pageNum, |
| | | pageSize: this.form.pageSize |
| | | }; |
| | | try { |
| | | const res = await getList(params) |
| | | this.tableData = res.records || []; |
| | | this.total = res.total || 0; |
| | | } catch (error) { |
| | | console.error("查询失败:", error); |
| | | } |
| | | }, |
| | | 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; |
| | | } |
| | | this.handleSearch(); |
| | | }, |
| | | }, |
| | | }; |