| | |
| | | v-model="form.supplier" |
| | | placeholder="请选择" |
| | | clearable |
| | | :disabled="supplierQuantityDisabled" |
| | | > |
| | | <el-option |
| | | v-for="item in supplierList" |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="单位:" prop="unit"> |
| | | <el-input v-model="form.unit" disabled/> |
| | | <el-input v-model="form.unit" placeholder="自动带出" readonly class="readonly-display"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="厚度:" prop="thickness"> |
| | | <el-input v-model="form.thickness" placeholder="自动带出" readonly class="readonly-display"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="数量:" prop="quantity"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入" |
| | | clearable :precision="2"/> |
| | | clearable :precision="2" :disabled="supplierQuantityDisabled"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue"; |
| | | import {ref, reactive, toRefs, computed, getCurrentInstance, nextTick} from "vue"; |
| | | import {getOptions} from "@/api/procurementManagement/procurementLedger.js"; |
| | | import {modelList, productTreeList} from "@/api/basicData/product.js"; |
| | | import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | |
| | | model: "", |
| | | testStandardId: "", |
| | | unit: "", |
| | | thickness: "", |
| | | quantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | |
| | | productModelId: [{required: true, message: "请选择产品型号", trigger: "change"}], |
| | | testStandardId: [{required: false, message: "请选择指标", trigger: "change"}], |
| | | unit: [{required: false, message: "请输入", trigger: "blur"}], |
| | | thickness: [{required: false, message: "请输入", trigger: "blur"}], |
| | | quantity: [{required: true, message: "请输入", trigger: "blur"}], |
| | | checkCompany: [{required: false, message: "请输入", trigger: "blur"}], |
| | | checkResult: [{required: true, message: "请选择检测结果", trigger: "change"}], |
| | |
| | | const modelOptions = ref([]); |
| | | const userList = ref([]); // 检验员下拉列表 |
| | | |
| | | // 编辑时:productMainId 或 purchaseLedgerId 任一有值则供应商、数量置灰 |
| | | const supplierQuantityDisabled = computed(() => { |
| | | const v = form.value || {}; |
| | | return !!(v.productMainId != null || v.purchaseLedgerId != null); |
| | | }); |
| | | |
| | | // 打开弹框 |
| | | const openDialog = async (type, row) => { |
| | | operationType.value = type; |
| | |
| | | model: "", |
| | | testStandardId: "", |
| | | unit: "", |
| | | thickness: "", |
| | | quantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | |
| | | const getModels = (value) => { |
| | | form.value.productModelId = undefined; |
| | | form.value.unit = undefined; |
| | | form.value.thickness = undefined; |
| | | modelOptions.value = []; |
| | | currentProductId.value = value |
| | | form.value.productName = findNodeById(productOptions.value, value); |
| | |
| | | }; |
| | | |
| | | const handleChangeModel = (value) => { |
| | | form.value.model = modelOptions.value.find(item => item.id == value)?.model || ''; |
| | | form.value.unit = modelOptions.value.find(item => item.id == value)?.unit || ''; |
| | | const selectedModel = modelOptions.value.find(item => item.id == value); |
| | | form.value.model = selectedModel?.model || ''; |
| | | form.value.unit = selectedModel?.unit || ''; |
| | | form.value.thickness = selectedModel?.thickness ?? ''; |
| | | } |
| | | |
| | | const findNodeById = (nodes, productId) => { |
| | |
| | | |
| | | <style scoped> |
| | | |
| | | :deep(.readonly-display .el-input__wrapper) { |
| | | background-color: var(--el-disabled-bg-color); |
| | | box-shadow: 0 0 0 1px var(--el-disabled-border-color) inset; |
| | | } |
| | | |
| | | :deep(.readonly-display .el-input__inner) { |
| | | color: var(--el-disabled-text-color); |
| | | -webkit-text-fill-color: var(--el-disabled-text-color); |
| | | cursor: not-allowed; |
| | | } |
| | | |
| | | </style> |