| | |
| | | userListNoPageByTenantId().then((res) => { |
| | | userList.value = res.data; |
| | | }); |
| | | form.value = {} |
| | | // 初始化表单(新增给默认值) |
| | | form.value = { |
| | | checkTime: getToday(), |
| | | unit: "g", |
| | | quantity: 1000, |
| | | checkName: "张培", |
| | | } |
| | | getProductOptions(); |
| | | if (operationType.value === 'edit' && row) { |
| | | form.value = {...row} |
| | |
| | | } |
| | | getQualityInspectParamList(row.id) |
| | | } |
| | | // 默认检验员为当前登录人,检测日期默认为当天(空时填充) |
| | | if (currentUserName.value && !form.value.checkName) { |
| | | form.value.checkName = currentUserName.value; |
| | | } |
| | | if (!form.value.checkTime) { |
| | | form.value.checkTime = getToday(); |
| | | } |
| | | // 新增:默认单位 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) => { |