| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工序:" prop="process"> |
| | | <el-input v-model="form.process" placeholder="请输入" clearable/> |
| | | <el-select v-model="form.process" placeholder="请选择" clearable> |
| | | <el-option label="试压" value="试压" /> |
| | | <el-option label="抽检" value="抽检" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | <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, reactive, toRefs, getCurrentInstance} 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 {qualityInspectDetailByProductId} from "@/api/qualityManagement/metricMaintenance.js"; |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js"; |
| | | import dayjs from "dayjs"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | const userStore = useUserStore() |
| | | const currentUserName = computed(() => userStore.nickName || userStore.name || "") |
| | | const getToday = () => dayjs().format("YYYY-MM-DD") |
| | | |
| | | const dialogFormVisible = ref(false); |
| | | const operationType = ref('') |
| | |
| | | checkResult: [{ required: true, message: "请输入", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const userList = ref([ |
| | | {nickName: '候盛杰'}, |
| | | {nickName: '焦辉'}, |
| | | {nickName: '张培'}, |
| | | {nickName: '冯灵之'}, |
| | | ]); |
| | | const userList = ref([]); |
| | | const { form, rules } = toRefs(data); |
| | | const supplierList = ref([]); |
| | | const productOptions = ref([]); |
| | |
| | | getOptions().then((res) => { |
| | | supplierList.value = res.data; |
| | | }); |
| | | // let userLists = await userListNoPage(); |
| | | // userList.value = userLists.data; |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data; |
| | | form.value = {} |
| | | getProductOptions(); |
| | | if (operationType.value === 'edit') { |
| | |
| | | }); |
| | | } |
| | | getQualityInspectParamList(row.id) |
| | | } else { |
| | | // 新增时设置默认值 |
| | | form.value.unit = "包"; // 单位默认为包 |
| | | form.value.quantity = 3; // 数量默认为3 |
| | | form.value.checkResult = "合格"; // 检验结果默认为合格 |
| | | } |
| | | // 默认检验员为当前登录人,检测日期默认为当天(空时填充) |
| | | if (currentUserName.value && !form.value.checkName) { |
| | | form.value.checkName = currentUserName.value; |
| | | } |
| | | if (!form.value.checkTime) { |
| | | form.value.checkTime = getToday(); |
| | | } |
| | | } |
| | | const getProductOptions = () => { |