ソースを参照

feat(s7): FQC检验单录入类型改由检验员当场选择,解决检规lrlx全NULL无法录入

qms_ccjygfzb 全部检规 lrlx=NULL(未定),录入页每行既无样本框也无合格/不合格数
输入框,无法录入。按业务决策不维护检规,改为检验员在录入页当场选类型:
- fqcInspDetail.vue:类型列 只读tag→可选下拉(数值型/非数值型);选非数值型→
  合格/不合格数可录,选数值型→展开样本录入区,未选→提示先选类型
- fqcInspection.ts:保存载荷带 lrlx
- FqcInspectionService.cs:SaveDetail 落 lrlx 到检验单明细快照(不回写检规主数据)+
  白名单校验(仅 NUMERIC/NON_NUMERIC,空=NULL)

DDL-free(lrlx 列已存在)。

chore: bump version Web 2.4.304 / server 1.0.371
YY968XX 2 日 前
コミット
41b02462b1

+ 1 - 1
Web/package.json

@@ -1,7 +1,7 @@
 {
 {
 	"name": "admin.net",
 	"name": "admin.net",
 	"type": "module",
 	"type": "module",
-	"version": "2.4.303",
+	"version": "2.4.304",
 	"packageManager": "pnpm@10.32.1",
 	"packageManager": "pnpm@10.32.1",
 	"lastBuildTime": "2026.03.15",
 	"lastBuildTime": "2026.03.15",
 	"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
 	"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",

+ 1 - 1
Web/src/views/aidop/s7/api/fqcInspection.ts

@@ -44,7 +44,7 @@ export function fetchInspectionDetail(inspBillId: number) {
 }
 }
 
 
 /** 保存录入(草稿,不起流) */
 /** 保存录入(草稿,不起流) */
-export function saveInspectionDetail(payload: { inspBillId: number; lines: Array<{ id: number; samples?: (string | null)[]; nonNumericalTypeOK?: number | null; nonNumericalTypeNG?: number | null; ybl?: string | null; pd?: string | null }> }) {
+export function saveInspectionDetail(payload: { inspBillId: number; lines: Array<{ id: number; lrlx?: string | null; samples?: (string | null)[]; nonNumericalTypeOK?: number | null; nonNumericalTypeNG?: number | null; ybl?: string | null; pd?: string | null }> }) {
 	return service.post('/api/S7FqcInspection/save-detail', payload).then((r: any) => r.data);
 	return service.post('/api/S7FqcInspection/save-detail', payload).then((r: any) => r.data);
 }
 }
 
 

+ 8 - 6
Web/src/views/aidop/s7/fqc/fqcInspDetail.vue

@@ -31,16 +31,18 @@
 						<el-input v-for="(s, i) in sampleSlots(row)" :key="i" v-model="row.samples[i]" size="small" class="sample" :placeholder="'样本' + (i + 1)" />
 						<el-input v-for="(s, i) in sampleSlots(row)" :key="i" v-model="row.samples[i]" size="small" class="sample" :placeholder="'样本' + (i + 1)" />
 						<el-button link type="primary" size="small" @click="addSample(row)">+样本</el-button>
 						<el-button link type="primary" size="small" @click="addSample(row)">+样本</el-button>
 					</div>
 					</div>
-					<div class="expand" v-else>非数值型项目:请在行内填「合格数 / 不合格数」,无需逐样本录入。</div>
+					<div class="expand" v-else-if="row.lrlx === 'NON_NUMERIC'">非数值型项目:请在行内填「合格数 / 不合格数」,无需逐样本录入。</div>
+					<div class="expand muted" v-else>请先在「类型」列选择 数值型 或 非数值型,再录入。</div>
 				</template>
 				</template>
 			</el-table-column>
 			</el-table-column>
 			<el-table-column prop="xh" label="序号" width="56" />
 			<el-table-column prop="xh" label="序号" width="56" />
 			<el-table-column prop="jyxm" label="检验项目" min-width="130" show-overflow-tooltip />
 			<el-table-column prop="jyxm" label="检验项目" min-width="130" show-overflow-tooltip />
-			<el-table-column label="类型" width="82">
+			<el-table-column label="类型" width="110">
 				<template #default="{ row }">
 				<template #default="{ row }">
-					<el-tag v-if="row.lrlx === 'NUMERIC'" type="success" size="small">数值</el-tag>
-					<el-tag v-else-if="row.lrlx === 'NON_NUMERIC'" type="warning" size="small">非数值</el-tag>
-					<span v-else class="muted">未定</span>
+					<el-select v-model="row.lrlx" size="small" placeholder="选择类型" style="width: 96px">
+						<el-option label="数值型" value="NUMERIC" />
+						<el-option label="非数值型" value="NON_NUMERIC" />
+					</el-select>
 				</template>
 				</template>
 			</el-table-column>
 			</el-table-column>
 			<el-table-column prop="jsyq" label="技术要求" min-width="140" show-overflow-tooltip />
 			<el-table-column prop="jsyq" label="技术要求" min-width="140" show-overflow-tooltip />
@@ -147,7 +149,7 @@ async function onSave() {
 	try {
 	try {
 		await saveInspectionDetail({
 		await saveInspectionDetail({
 			inspBillId: inspBillId.value,
 			inspBillId: inspBillId.value,
-			lines: lines.value.map((l) => ({ id: l.id, samples: l.samples, nonNumericalTypeOK: l.nonNumericalTypeOK ?? null, nonNumericalTypeNG: l.nonNumericalTypeNG ?? null, ybl: l.ybl ?? null, pd: l.pd ?? null })),
+			lines: lines.value.map((l) => ({ id: l.id, lrlx: l.lrlx ?? null, samples: l.samples, nonNumericalTypeOK: l.nonNumericalTypeOK ?? null, nonNumericalTypeNG: l.nonNumericalTypeNG ?? null, ybl: l.ybl ?? null, pd: l.pd ?? null })),
 		});
 		});
 		ElMessage.success('已保存');
 		ElMessage.success('已保存');
 	} catch (e: any) {
 	} catch (e: any) {

+ 3 - 3
server/Admin.NET.Web.Entry/Admin.NET.Web.Entry.csproj

@@ -11,9 +11,9 @@
     <GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
     <GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
     <Copyright>Admin.NET</Copyright>
     <Copyright>Admin.NET</Copyright>
     <Description>Admin.NET 通用权限开发平台</Description>
     <Description>Admin.NET 通用权限开发平台</Description>
-    <AssemblyVersion>1.0.370</AssemblyVersion>
-    <FileVersion>1.0.370</FileVersion>
-    <Version>1.0.370</Version>
+    <AssemblyVersion>1.0.371</AssemblyVersion>
+    <FileVersion>1.0.371</FileVersion>
+    <Version>1.0.371</Version>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 8 - 1
server/Plugins/Admin.NET.Plugin.AiDOP/FinishedWarehouse/FqcInspectionService.cs

@@ -96,11 +96,16 @@ public class FqcInspectionService : IDynamicApiController, ITransient
                     sets.Append($"j{i}=@j{i},");
                     sets.Append($"j{i}=@j{i},");
                     pars.Add(new SugarParameter($"@j{i}", string.IsNullOrWhiteSpace(v) ? null : v.Trim()));
                     pars.Add(new SugarParameter($"@j{i}", string.IsNullOrWhiteSpace(v) ? null : v.Trim()));
                 }
                 }
-                sets.Append("NonNumericalTypeOK=@ok, NonNumericalTypeNG=@ng, ybl=@ybl, pd=@pd");
+                // 录入类型由检验员在录入页当场选择(不依赖检规预配置):落检验单明细快照 lrlx,覆盖检规空值
+                var lrlx = ln.Lrlx?.Trim();
+                if (!string.IsNullOrEmpty(lrlx) && lrlx != "NUMERIC" && lrlx != "NON_NUMERIC")
+                    throw Oops.Oh("录入类型仅支持 数值型(NUMERIC)/非数值型(NON_NUMERIC)");
+                sets.Append("NonNumericalTypeOK=@ok, NonNumericalTypeNG=@ng, ybl=@ybl, pd=@pd, lrlx=@lrlx");
                 pars.Add(new SugarParameter("@ok", (object?)ln.NonNumericalTypeOK ?? DBNull.Value));
                 pars.Add(new SugarParameter("@ok", (object?)ln.NonNumericalTypeOK ?? DBNull.Value));
                 pars.Add(new SugarParameter("@ng", (object?)ln.NonNumericalTypeNG ?? DBNull.Value));
                 pars.Add(new SugarParameter("@ng", (object?)ln.NonNumericalTypeNG ?? DBNull.Value));
                 pars.Add(new SugarParameter("@ybl", (object?)Nz(ln.Ybl) ?? DBNull.Value));
                 pars.Add(new SugarParameter("@ybl", (object?)Nz(ln.Ybl) ?? DBNull.Value));
                 pars.Add(new SugarParameter("@pd", (object?)Nz(ln.Pd) ?? DBNull.Value));
                 pars.Add(new SugarParameter("@pd", (object?)Nz(ln.Pd) ?? DBNull.Value));
+                pars.Add(new SugarParameter("@lrlx", string.IsNullOrEmpty(lrlx) ? (object)DBNull.Value : lrlx));
                 pars.Add(new SugarParameter("@id", ln.Id));
                 pars.Add(new SugarParameter("@id", ln.Id));
                 pars.Add(new SugarParameter("@g", input.InspBillId));
                 pars.Add(new SugarParameter("@g", input.InspBillId));
                 pars.Add(new SugarParameter("@t", tenantId));
                 pars.Add(new SugarParameter("@t", tenantId));
@@ -198,6 +203,8 @@ public class FqcSaveDetailInput
 public class FqcSaveDetailLine
 public class FqcSaveDetailLine
 {
 {
     public long Id { get; set; }
     public long Id { get; set; }
+    /// <summary>录入类型(检验员在录入页当场选择):NUMERIC 数值型 / NON_NUMERIC 非数值型 / 空=未定</summary>
+    public string? Lrlx { get; set; }
     public List<string?>? Samples { get; set; }
     public List<string?>? Samples { get; set; }
     public long? NonNumericalTypeOK { get; set; }
     public long? NonNumericalTypeOK { get; set; }
     public long? NonNumericalTypeNG { get; set; }
     public long? NonNumericalTypeNG { get; set; }