| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="巡检员:" prop="inspector"> |
| | | <el-input v-model="form.inspector" placeholder="请输入巡检员" /> |
| | | <el-select v-model="form.inspector" |
| | | style="width: 100%" |
| | | placeholder="请选择巡检人员" |
| | | clearable |
| | | filterable |
| | | @focus="getUserList"> |
| | | <el-option v-for="user in userOptions" |
| | | :key="user.userId" |
| | | :label="user.userName" |
| | | :value="user.userName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="不合格订单:" prop="unqualifiedOrder"> |
| | | <el-input v-model="form.unqualifiedOrder" placeholder="请输入不合格订单" /> |
| | | <el-select v-model="form.unqualifiedOrder" |
| | | style="width: 100%" |
| | | placeholder="请选择不合格订单" |
| | | clearable |
| | | filterable |
| | | @focus="getQualityUnqualifiedWithProductionOrder"> |
| | | <el-option v-for="item in qualityUnqualifiedOptions" |
| | | :key="item.id" |
| | | :label="item.productOrderNpsNo" |
| | | :value="item.productOrderNpsNo"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | import { addProductInspectionRecord, updProductInspectionRecord, getParameterItemByProcessOrCategory } from "@/api/qualityManagement/productInspectionRecord.js"; |
| | | import { processList as getProcessList } from "@/api/productionManagement/productionProcess.js"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import {userListNoPageByTenantId} from "@/api/system/user.js"; |
| | | import {findQualityUnqualifiedWithProductionOrder} from "@/api/qualityManagement/nonconformingManagement.js"; |
| | | |
| | | const userStore = useUserStore(); |
| | | const dialogFormVisible = ref(false); |
| | |
| | | |
| | | const processList = ref([]); |
| | | const inspectionItemList = ref([]); |
| | | const userOptions = ref([]); |
| | | const qualityUnqualifiedOptions = ref([]); |
| | | |
| | | const getUserList = () => { |
| | | if (userOptions.value.length > 0) { |
| | | return userOptions.value; |
| | | } |
| | | userListNoPageByTenantId() |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | userOptions.value = res.data || []; |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.error("获取用户列表失败", err); |
| | | }); |
| | | }; |
| | | |
| | | const getQualityUnqualifiedWithProductionOrder = () => { |
| | | if (qualityUnqualifiedOptions.value.length > 0) { |
| | | return qualityUnqualifiedOptions.value; |
| | | } |
| | | findQualityUnqualifiedWithProductionOrder().then(res => { |
| | | if (res.code === 200) { |
| | | qualityUnqualifiedOptions.value = res.data || []; |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** 工序 id 与后端可能为 number/string,统一比较 */ |
| | | const sameProcessId = (a, b) => a != null && b != null && String(a) === String(b); |