| | |
| | | v-model="dialogFormVisible" |
| | | :title="operationType === 'add' ? '新增原材料检验' : '编辑原材料检验'" |
| | | width="70%" |
| | | draggable |
| | | @close="closeDia" |
| | | > |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="规格型号:" prop="model"> |
| | | <el-select v-model="form.modelId" placeholder="请选择" clearable @change="getProductModel"> |
| | | <el-option v-for="item in modelOptions" :key="item.id" :label="item.model" :value="item.id" /> |
| | | </el-select> |
| | | <el-input v-model="form.model" placeholder="请输入" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref} from "vue"; |
| | | import {ref, computed} 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"; |
| | |
| | | import {qualityInspectParamDel, qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js"; |
| | | import {qualityInspectDetailByProductId} from "@/api/qualityManagement/metricMaintenance.js"; |
| | | import {userListNoPageByTenantId} from "@/api/system/user.js"; |
| | | import dayjs from "dayjs"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | |
| | | const {proxy} = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | const userList = ref([ |
| | | {nickName: '候盛杰'}, |
| | | {nickName: '焦辉'}, |
| | | {nickName: '张培'}, |
| | | {nickName: '冯灵之'}, |
| | | ]) |
| | | const userList = ref([]) |
| | | const userStore = useUserStore() |
| | | const currentUserName = computed(() => userStore.nickName || userStore.name || "") |
| | | const getToday = () => dayjs().format("YYYY-MM-DD") |
| | | const dialogFormVisible = ref(false); |
| | | const operationType = ref('') |
| | | const data = reactive({ |
| | |
| | | getOptions().then((res) => { |
| | | supplierList.value = res.data; |
| | | }); |
| | | // userListNoPageByTenantId().then((res) => { |
| | | // userList.value = res.data; |
| | | // }); |
| | | form.value = {} |
| | | userListNoPageByTenantId().then((res) => { |
| | | userList.value = res.data; |
| | | }); |
| | | // 初始化表单(新增给默认值) |
| | | form.value = { |
| | | checkTime: getToday(), |
| | | unit: "g", |
| | | quantity: 1000, |
| | | checkName: "张培", |
| | | } |
| | | getProductOptions(); |
| | | if (operationType.value === 'edit' && row) { |
| | | form.value = {...row} |
| | |
| | | } |
| | | getQualityInspectParamList(row.id) |
| | | } |
| | | // 新增:默认单位 g、默认检验员张培、默认数量 1000(为空时才填充,避免覆盖编辑回显) |
| | | if (!form.value.unit) form.value.unit = "g"; |
| | | if (form.value.quantity === "" || form.value.quantity == null) form.value.quantity = 1000; |
| | | if (!form.value.checkName) form.value.checkName = "张培"; |
| | | if (!form.value.checkTime) form.value.checkTime = getToday(); |
| | | } |
| | | const getProductOptions = () => { |
| | | productTreeList({productName: '质量'}).then((res) => { |