| | |
| | | form.value.unit = "包"; // 单位默认为包 |
| | | form.value.quantity = 3; // 数量默认为3 |
| | | form.value.checkResult = "合格"; // 检验结果默认为合格 |
| | | // 产品名称默认傻老大原味瓜子(质检试压) |
| | | productTreeList({productName: '质量'}).then((res) => { |
| | | productOptions.value = convertIdToValue(res); |
| | | const target = res.find((item) => item.label === "傻老大原味瓜子(质检试压)"); |
| | | if (target) { |
| | | form.value.productId = target.id; |
| | | form.value.productName = target.label; |
| | | currentProductId.value = target.id; |
| | | // 加载规格列表 |
| | | modelList({ id: target.id }).then((modelRes) => { |
| | | modelOptions.value = modelRes; |
| | | }); |
| | | // 加载检验参数 |
| | | qualityInspectDetailByProductId(target.id).then((paramRes) => { |
| | | tableData.value = paramRes.data; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | // 默认检验员为当前登录人,检测日期默认为当天(空时填充) |
| | | if (currentUserName.value && !form.value.checkName) { |
| | | form.value.checkName = currentUserName.value; |
| | | if (!form.value.checkName) { |
| | | form.value.checkName = "侯盛杰"; |
| | | } |
| | | if (!form.value.checkTime) { |
| | | form.value.checkTime = getToday(); |