| | |
| | | width="70%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" |
| | | label-width="140px" |
| | | label-position="top" |
| | | label-width="100px" |
| | | label-position="left" |
| | | :rules="rules" |
| | | ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="供应商:" prop="supplier"> |
| | | <el-input v-model="form.supplier" placeholder="请输入" clearable/> |
| | | ref="formRef" |
| | | class="inspection-form"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="供应商:" |
| | | prop="supplier"> |
| | | <el-input v-model="form.supplier" |
| | | placeholder="请输入" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="产品:" |
| | | prop="productId"> |
| | | <el-button type="primary" |
| | | @click="openProductSelectDialog" |
| | | :disabled="operationType === 'edit'">选择产品</el-button> |
| | | <div class="selected-product mt-2" |
| | | v-if="form.productName"> |
| | | <el-tag closable |
| | | @close="clearProductSelection" |
| | | class="mr-2"> |
| | | {{ form.productName }} - {{ form.model }} |
| | | </el-tag> |
| | | </div> |
| | | <div v-else |
| | | class="text-gray-400">请选择产品</div> |
| | | :disabled="operationType === 'edit'" |
| | | class="product-select-btn">{{form.productName || "选择产品"}}{{form.model?(" - "+form.model):""}}</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="试样编号:" |
| | | prop="sampleCode"> |
| | | <el-input v-model="form.sampleCode" |
| | |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="车牌号:" |
| | | prop="licensePlateNumber"> |
| | | <el-input v-model="form.licensePlateNumber" |
| | |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="检测性质:" |
| | | prop="inspectNature"> |
| | | <el-select v-model="form.inspectNature"> |
| | | <el-select v-model="form.inspectNature" |
| | | style="width: 100%"> |
| | | <el-option label="日常检测" |
| | | value="日常检测" /> |
| | | <el-option label="入场验收" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="试样状态:" |
| | | prop="sampleState"> |
| | | <el-select v-model="form.sampleState"> |
| | | <el-select v-model="form.sampleState" |
| | | style="width: 100%"> |
| | | <el-option label="固体" |
| | | value="固体" /> |
| | | <el-option label="颗粒" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="单位:" |
| | | prop="unit"> |
| | | <el-input v-model="form.unit" |
| | | disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="指标选择:" |
| | | prop="testStandardId"> |
| | | <el-select v-model="form.testStandardId" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="检测单位:" |
| | | prop="checkCompany"> |
| | | <el-input v-model="form.checkCompany" |
| | |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="检测结果:" |
| | | prop="checkResult"> |
| | | <el-select v-model="form.checkResult"> |
| | | <el-select v-model="form.checkResult" |
| | | style="width: 100%"> |
| | | <el-option label="合格" |
| | | value="合格" /> |
| | | <el-option label="不合格" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="检验员:" |
| | | prop="checkName"> |
| | | <el-select v-model="form.checkName" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="检测日期:" |
| | | prop="checkTime"> |
| | | <el-date-picker v-model="form.checkTime" |
| | |
| | | style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="取样日期:" |
| | | prop="sampleTime"> |
| | | <el-date-picker v-model="form.sampleTime" |
| | |
| | | { required: false, message: "请选择试样状态", trigger: "change" }, |
| | | ], |
| | | sampleCode: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | licensePlateNumber: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | licensePlateNumber: [ |
| | | { required: false, message: "请输入", trigger: "blur" }, |
| | | ], |
| | | sampleTime: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | }, |
| | | }); |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .inspection-form { |
| | | background-color: #f9f9f9; |
| | | border-radius: 8px; |
| | | padding: 20px; |
| | | margin-bottom: 20px; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .product-select-btn { |
| | | width: 100%; |
| | | text-align: left; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .product-select-btn:hover { |
| | | box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3); |
| | | } |
| | | |
| | | /* 增加表单项间距 */ |
| | | .el-form-item { |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | /* 输入框和选择器的悬停效果 */ |
| | | :deep(.el-input__wrapper) { |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | :deep(.el-input__wrapper:hover) { |
| | | box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2) !important; |
| | | } |
| | | |
| | | :deep(.el-select) { |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | :deep(.el-select:hover .el-input__wrapper) { |
| | | box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2) !important; |
| | | } |
| | | |
| | | /* 日期选择器的悬停效果 */ |
| | | :deep(.el-date-picker) { |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | :deep(.el-date-picker:hover .el-input__wrapper) { |
| | | box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2) !important; |
| | | } |
| | | |
| | | /* 优化表格样式 */ |
| | | :deep(.el-table) { |
| | | border-radius: 8px; |
| | | overflow: hidden; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | :deep(.el-table:hover) { |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); |
| | | } |
| | | |
| | | :deep(.el-table th) { |
| | | background-color: #f5f7fa; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | :deep(.el-table tr:hover) { |
| | | background-color: #f0f9ff; |
| | | } |
| | | |
| | | /* 表格输入框样式 */ |
| | | :deep(.el-table .el-input__wrapper) { |
| | | box-shadow: none !important; |
| | | } |
| | | |
| | | :deep(.el-table .el-input__wrapper:hover) { |
| | | box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2) !important; |
| | | } |
| | | |
| | | /* 优化对话框底部按钮 */ |
| | | .dialog-footer { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | gap: 10px; |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .dialog-footer .el-button { |
| | | transition: all 0.3s ease; |
| | | padding: 8px 20px; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .dialog-footer .el-button:hover { |
| | | transform: translateY(-1px); |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); |
| | | } |
| | | |
| | | .dialog-footer .el-button--primary:hover { |
| | | box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4); |
| | | } |
| | | |
| | | /* 表单验证状态样式 */ |
| | | :deep(.el-form-item__error) { |
| | | font-size: 12px; |
| | | color: #f56c6c; |
| | | margin-top: 4px; |
| | | } |
| | | |
| | | :deep(.el-form-item.is-error .el-input__wrapper) { |
| | | box-shadow: 0 0 0 2px rgba(245, 108, 108, 0.2) !important; |
| | | } |
| | | |
| | | :deep(.el-form-item.is-success .el-input__wrapper) { |
| | | box-shadow: 0 0 0 2px rgba(103, 194, 58, 0.2) !important; |
| | | } |
| | | |
| | | /* 响应式设计 */ |
| | | @media screen and (max-width: 1200px) { |
| | | .el-col { |
| | | :deep(.el-col) { |
| | | &[class*="el-col-8"] { |
| | | flex: 0 0 50%; |
| | | max-width: 50%; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @media screen and (max-width: 768px) { |
| | | .el-col { |
| | | :deep(.el-col) { |
| | | &[class*="el-col-8"] { |
| | | flex: 0 0 100%; |
| | | max-width: 100%; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .inspection-form { |
| | | padding: 15px; |
| | | } |
| | | |
| | | .el-form { |
| | | label-width: 80px !important; |
| | | } |
| | | |
| | | .dialog-footer { |
| | | flex-direction: column; |
| | | align-items: stretch; |
| | | } |
| | | |
| | | .dialog-footer .el-button { |
| | | width: 100%; |
| | | } |
| | | } |
| | | </style> |