liuwb hai 2 meses
pai
achega
81741d49e5

+ 3 - 3
yudao-module-qms/src/main/java/cn/iocoder/yudao/module/qms/controller/admin/ipqc/vo/IpqcInspectRecordMainRespVO.java

@@ -63,9 +63,6 @@ public class IpqcInspectRecordMainRespVO {
     @Schema(description = "不合格数量")
     private BigDecimal jybhgsl;
 
-    @Schema(description = "处理方式")
-    private String clfs;
-
     @Schema(description = "留样数量")
     private BigDecimal lysl;
 
@@ -87,6 +84,9 @@ public class IpqcInspectRecordMainRespVO {
     @Schema(description = "备注")
     private String bz;
 
+    @Schema(description = "审核人")
+    private String jyr1;
+
     @Schema(description = "检验状态")
     private String status;
 }

+ 3 - 3
yudao-module-qms/src/main/java/cn/iocoder/yudao/module/qms/controller/admin/ipqc/vo/IpqcInspectRecordSaveReqVO.java

@@ -69,9 +69,6 @@ public class IpqcInspectRecordSaveReqVO {
     @Schema(description = "不合格数量")
     private BigDecimal jybhgsl;
 
-    @Schema(description = "处理方式")
-    private String clfs;
-
     @Schema(description = "留样数量")
     private BigDecimal lysl;
 
@@ -93,6 +90,9 @@ public class IpqcInspectRecordSaveReqVO {
     @Schema(description = "备注")
     private String bz;
 
+    @Schema(description = "审核人")
+    private String jyr1;
+
     @Schema(description = "检验状态")
     private String status;
 

+ 3 - 0
yudao-module-qms/src/main/java/cn/iocoder/yudao/module/qms/service/ipqc/IpqcTaskServiceImpl.java

@@ -143,6 +143,9 @@ public class IpqcTaskServiceImpl implements IpqcTaskService {
 
         String djbh = StrUtil.blankToDefault(reqVO.getDjbh(), String.valueOf(recordId));
         String status = StrUtil.blankToDefault(reqVO.getStatus(), "检验中");
+        if ("待检验".equals(status)) {
+            status = "检验中";
+        }
 
         if (existing == null || existing.getId() == null) {
             ipqcTaskMapper.insertInspectRecordMain(recordId, reqVO, djbh, workOrder, batch, status);

+ 10 - 10
yudao-module-qms/src/main/resources/mapper/ipqc/IpqcTaskMapper.xml

@@ -188,17 +188,17 @@
             lydjbh,
             jyrq,
             jyr,
-            jysl,
+            ybl AS jysl,
             jyhgsl,
             jybhgsl,
-            clfs,
             lysl,
             phsl,
-            pd,
+            jgpd AS pd,
             fj,
-            jgbh,
+            jygfbbm AS jgbh,
             jgbb,
             bz,
+            jyr1,
             status
         FROM qms_gcjyd
         WHERE lydjbh = #{workOrder}
@@ -245,9 +245,9 @@
 
     <insert id="insertInspectRecordMain">
         INSERT INTO qms_gcjyd
-        (id, bdbh, bbh, sxrq, djbh, cplx, scph, wlbm, wlmc, gxbm, gxmc, sczyry, lydjbh, jyrq, jyr, jysl, jyhgsl, jybhgsl, clfs, lysl, phsl, pd, fj, jgbh, jgbb, bz, status)
+        (id, bdbh, bbh, sxrq, djbh, cplx, scph, wlbm, wlmc, gxbm, gxmc, sczyry, lydjbh, jyrq, jyr, ybl, jyhgsl, jybhgsl, lysl, phsl, jgpd, fj, jygfbbm, jgbb, bz, jyr1, status)
         VALUES
-        (#{id}, #{req.bdbh}, #{req.bbh}, #{req.sxrq}, #{djbh}, #{req.cplx}, #{batch}, #{req.wlbm}, #{req.wlmc}, #{req.gxbm}, #{req.gxmc}, #{req.sczyry}, #{workOrder}, #{req.jyrq}, #{req.jyr}, #{req.jysl}, #{req.jyhgsl}, #{req.jybhgsl}, #{req.clfs}, #{req.lysl}, #{req.phsl}, #{req.pd}, #{req.fj}, #{req.jgbh}, #{req.jgbb}, #{req.bz}, #{status})
+        (#{id}, #{req.bdbh}, #{req.bbh}, #{req.sxrq}, #{djbh}, #{req.cplx}, #{batch}, #{req.wlbm}, #{req.wlmc}, #{req.gxbm}, #{req.gxmc}, #{req.sczyry}, #{workOrder}, #{req.jyrq}, #{req.jyr}, #{req.jysl}, #{req.jyhgsl}, #{req.jybhgsl}, #{req.lysl}, #{req.phsl}, #{req.pd}, #{req.fj}, #{req.jgbh}, #{req.jgbb}, #{req.bz}, #{req.jyr1}, #{status})
     </insert>
 
     <update id="updateInspectRecordMain">
@@ -267,17 +267,17 @@
             lydjbh = #{workOrder},
             jyrq = #{req.jyrq},
             jyr = #{req.jyr},
-            jysl = #{req.jysl},
+            ybl = #{req.jysl},
             jyhgsl = #{req.jyhgsl},
             jybhgsl = #{req.jybhgsl},
-            clfs = #{req.clfs},
             lysl = #{req.lysl},
             phsl = #{req.phsl},
-            pd = #{req.pd},
+            jgpd = #{req.pd},
             fj = #{req.fj},
-            jgbh = #{req.jgbh},
+            jygfbbm = #{req.jgbh},
             jgbb = #{req.jgbb},
             bz = #{req.bz},
+            jyr1 = #{req.jyr1},
             status = #{status}
         WHERE id = #{id}
     </update>

+ 1 - 1
yudao-ui/yudao-ui-admin-vue3/src/api/qms/ipqc/task/index.ts

@@ -42,10 +42,10 @@ export interface IpqcInspectRecordMainRespVO {
   lydjbh?: string
   jyrq?: string
   jyr?: string
+  jyr1?: string
   jysl?: number | string
   jyhgsl?: number | string
   jybhgsl?: number | string
-  clfs?: string
   lysl?: number | string
   phsl?: number | string
   pd?: number | string

+ 78 - 34
yudao-ui/yudao-ui-admin-vue3/src/store/modules/qms/ipqcInspectRecord.ts

@@ -14,21 +14,21 @@ const createEmptyMain = (): InspectRecordMain => ({
   bdbh: 'RS/IV-7.4-32',
   bbh: '1.2',
   sxrq: '2022.04.01',
-  djbh: '',
-  cplx: '',
-  scph: '',
-  wlbm: '',
-  wlmc: '',
-  gxbm: '',
-  gxmc: '',
-  sczyry: '',
-  lydjbh: '',
-  jyrq: '',
-  jyr: '',
-  jysl: undefined,
+  djbh: 'IPQC001',
+  cplx: '剪头垫',
+  scph: 'LOT-001',
+  wlbm: 'MAT-001',
+  wlmc: '电池模组',
+  gxbm: 'GX-001',
+  gxmc: '焊接/点焊',
+  sczyry: '芋道源码',
+  lydjbh: 'WO-202401-001',
+  jyrq: '2026-01-24 00:00:00',
+  jyr: '芋道源码',
+  jyr1: '张三',
+  jysl: 100,
   jyhgsl: undefined,
   jybhgsl: undefined,
-  clfs: '',
   lysl: undefined,
   phsl: undefined,
   pd: undefined,
@@ -39,7 +39,28 @@ const createEmptyMain = (): InspectRecordMain => ({
   status: ''
 })
 
-const createEmptyRow = (): IpqcInspectRecordDetailRespVO => {
+const DEFAULT_DETAIL_ITEMS: Array<{ jyxm: string; jybz: string }> = [
+  { jyxm: '尺寸A', jybz: '1.1±0.05' },
+  { jyxm: '尺寸B', jybz: '77.55 +0.3/-0.1' },
+  { jyxm: '尺寸C', jybz: '1.9 +0.05/0' },
+  { jyxm: '尺寸D', jybz: '0.39±0.04' },
+  { jyxm: '尺寸E', jybz: '3.1+0.15/-0.1' },
+  { jyxm: '尺寸F', jybz: '22.24+0.09/-0.05' },
+  { jyxm: '尺寸G', jybz: '56±0.05' },
+  { jyxm: '尺寸J', jybz: '0.75±0.05' },
+  { jyxm: '尺寸K', jybz: '3.8±0.05' },
+  { jyxm: '尺寸L', jybz: '11.6±0.15' },
+  { jyxm: '尺寸M', jybz: '1.175±0.05' },
+  { jyxm: '尺寸N', jybz: '2.35±0.05' },
+  { jyxm: '硬度', jybz: '抵钉座:HV130-180;抵钉座上盖:HRC41-45' },
+  { jyxm: '材质', jybz: '供方提供材质证明,化学成分符合以下要求。;抵钉座上盖30Cr13:;0.26≤C≤0.35;Si≤1;Mn≤1;P≤0.04;S≤0.03;Ni≤0.6;12≤Cr≤14。;抵钉座06Cr17Ni12Mo2:;C≤0.08;Si≤1;Mn≤2;P≤0.045;S≤0.03;10≤Ni≤14;16≤Cr≤18;2≤Mo≤3' },
+  { jyxm: '外观', jybz: '零件外观无破损、裂纹、氧化、严重碰伤,夹杂物及毛刺,重要型面无碰伤,无多余焊料、漏焊;打标清晰' },
+  { jyxm: '镀层', jybz: '厚度:0.003-0.005mm     材质:镍特氟龙3400A+plus' },
+  { jyxm: '粗糙度', jybz: '表面粗糙度Ra≤0.8μm' },
+  { jyxm: '耐腐蚀性', jybz: '符合YY/T 0149沸水实验法,试验后零件表面不低于b级规定。' }
+]
+
+const createEmptyRow = (preset?: Partial<IpqcInspectRecordDetailRespVO>): IpqcInspectRecordDetailRespVO => {
   const row: IpqcInspectRecordDetailRespVO = {
     jyxm: '',
     jybz: '',
@@ -52,10 +73,34 @@ const createEmptyRow = (): IpqcInspectRecordDetailRespVO => {
   for (let i = 1; i <= 20; i += 1) {
     ;(row as any)[`j${i}`] = ''
   }
-  return row
+  return { ...row, ...(preset || {}) }
 }
 
 const unwrapResult = <T>(result: any): T => (result && result.data !== undefined ? result.data : result)
+const normalizeDisplayValue = (value: any) => {
+  if (value === '-' || value === '自动生成') return undefined
+  return value
+}
+const isMeaningfulValue = (value: unknown) => {
+  if (value === undefined || value === null) return false
+  if (typeof value === 'string') {
+    const trimmed = value.trim()
+    if (!trimmed) return false
+    if (trimmed === '-' || trimmed === '自动生成') return false
+  }
+  return true
+}
+
+const mergeWithDefaults = (defaults: InspectRecordMain, main: Partial<InspectRecordMain>) => {
+  const merged: InspectRecordMain = { ...defaults }
+  Object.keys(main || {}).forEach((key) => {
+    const value = (main as any)[key]
+    if (isMeaningfulValue(value)) {
+      ;(merged as any)[key] = value
+    }
+  })
+  return merged
+}
 
 export const useIpqcInspectRecordStore = defineStore('ipqcInspectRecord', {
   state: () => ({
@@ -66,7 +111,7 @@ export const useIpqcInspectRecordStore = defineStore('ipqcInspectRecord', {
       if (!this.drafts[taskId]) {
         this.drafts[taskId] = {
           main: createEmptyMain(),
-          details: [createEmptyRow()]
+          details: DEFAULT_DETAIL_ITEMS.map((item) => createEmptyRow({ jyxm: item.jyxm, jybz: item.jybz }))
         }
       }
       return this.drafts[taskId]
@@ -98,11 +143,10 @@ export const useIpqcInspectRecordStore = defineStore('ipqcInspectRecord', {
       ])
       const main = unwrapResult<IpqcInspectRecordMainRespVO>(mainResult) || {}
       const details = unwrapResult<IpqcInspectRecordDetailRespVO[]>(detailResult) || []
-      draft.main = {
-        ...createEmptyMain(),
-        ...main
-      }
-      draft.details = Array.isArray(details) && details.length ? details : [createEmptyRow()]
+      draft.main = mergeWithDefaults(createEmptyMain(), main)
+      draft.details = Array.isArray(details) && details.length
+        ? details
+        : DEFAULT_DETAIL_ITEMS.map((item) => createEmptyRow({ jyxm: item.jyxm, jybz: item.jybz }))
       return draft
     },
     async save(taskId: string) {
@@ -110,24 +154,24 @@ export const useIpqcInspectRecordStore = defineStore('ipqcInspectRecord', {
       const payload: IpqcInspectRecordSaveReqVO = {
         taskId,
         id: draft.main.id,
-        bdbh: draft.main.bdbh,
-        bbh: draft.main.bbh,
-        sxrq: draft.main.sxrq,
-        djbh: draft.main.djbh,
-        cplx: draft.main.cplx,
-        scph: draft.main.scph,
-        wlbm: draft.main.wlbm,
-        wlmc: draft.main.wlmc,
-        gxbm: draft.main.gxbm,
-        gxmc: draft.main.gxmc,
-        sczyry: draft.main.sczyry,
-        lydjbh: draft.main.lydjbh,
+        bdbh: normalizeDisplayValue(draft.main.bdbh),
+        bbh: normalizeDisplayValue(draft.main.bbh),
+        sxrq: normalizeDisplayValue(draft.main.sxrq),
+        djbh: normalizeDisplayValue(draft.main.djbh),
+        cplx: normalizeDisplayValue(draft.main.cplx),
+        scph: normalizeDisplayValue(draft.main.scph),
+        wlbm: normalizeDisplayValue(draft.main.wlbm),
+        wlmc: normalizeDisplayValue(draft.main.wlmc),
+        gxbm: normalizeDisplayValue(draft.main.gxbm),
+        gxmc: normalizeDisplayValue(draft.main.gxmc),
+        sczyry: normalizeDisplayValue(draft.main.sczyry),
+        lydjbh: normalizeDisplayValue(draft.main.lydjbh),
         jyrq: draft.main.jyrq,
         jyr: draft.main.jyr,
+        jyr1: draft.main.jyr1,
         jysl: draft.main.jysl,
         jyhgsl: draft.main.jyhgsl,
         jybhgsl: draft.main.jybhgsl,
-        clfs: draft.main.clfs,
         lysl: draft.main.lysl,
         phsl: draft.main.phsl,
         pd: draft.main.pd,

+ 6 - 3
yudao-ui/yudao-ui-admin-vue3/src/views/bpm/processInstance/detail/index.vue

@@ -184,9 +184,12 @@ const detailForm = ref({
 }) // 流程实例的表单详情
 
 const writableFields: Array<string> = [] // 表单可以编辑的字段
-const showIpqcTaskSummary = computed(() =>
-  processDefinition.value?.formCustomViewPath?.includes('/qms/ipqc/task/ProcessDetailForm.vue')
-)
+const showIpqcTaskSummary = computed(() => {
+  const viewPath = processDefinition.value?.formCustomViewPath || ''
+  const defKey = processDefinition.value?.key || processInstance.value?.processDefinition?.key || ''
+  const name = processInstance.value?.name || ''
+  return viewPath.includes('/qms/ipqc/') || defKey.includes('ipqc') || name.includes('IPQC')
+})
 
 /** 获得详情 */
 const getDetail = () => {

+ 17 - 0
yudao-ui/yudao-ui-admin-vue3/src/views/qms/ipqc/task/IpqcTaskSummary.vue

@@ -1,5 +1,8 @@
 <template>
   <div class="ipqc-task-summary" v-loading="loading">
+    <div class="summary-actions" v-if="task">
+      <el-button type="primary" plain @click="goEdit">编辑检验单</el-button>
+    </div>
     <el-descriptions v-if="task" :column="2" border>
       <el-descriptions-item label="任务编号">{{ task.id ?? '-' }}</el-descriptions-item>
       <el-descriptions-item label="单据编号">{{ task.applicationId ?? '-' }}</el-descriptions-item>
@@ -22,6 +25,7 @@
 
 <script setup lang="ts">
 import { ref, watch } from 'vue'
+import { useRoute, useRouter } from 'vue-router'
 import { getIpqcTask, type IpqcTaskRespVO } from '@/api/qms/ipqc/task'
 
 const props = defineProps<{
@@ -30,6 +34,8 @@ const props = defineProps<{
 
 const loading = ref(false)
 const task = ref<IpqcTaskRespVO | null>(null)
+const route = useRoute()
+const router = useRouter()
 
 const statusLabel = (value?: string) => {
   if (value === 'processing') return '检验中'
@@ -74,6 +80,12 @@ const load = async () => {
   }
 }
 
+const goEdit = () => {
+  if (!props.taskId) return
+  const basePath = route.path.startsWith('/s6') ? '/s6/ipqc/task/edit' : '/qms/ipqc/task/edit'
+  router.push(`${basePath}/${props.taskId}`)
+}
+
 watch(() => props.taskId, () => { load() }, { immediate: true })
 </script>
 
@@ -81,4 +93,9 @@ watch(() => props.taskId, () => { load() }, { immediate: true })
 .ipqc-task-summary {
   width: 100%;
 }
+.summary-actions {
+  display: flex;
+  justify-content: flex-end;
+  margin-bottom: 12px;
+}
 </style>

+ 10 - 20
yudao-ui/yudao-ui-admin-vue3/src/views/qms/ipqc/task/ProcessDetailForm.vue

@@ -98,6 +98,11 @@
                   <el-input v-model="mainForm.jyr" readonly />
                 </el-form-item>
               </el-col>
+              <el-col :span="8">
+                <el-form-item label="审核人">
+                  <el-input v-model="mainForm.jyr1" placeholder="请输入审核人" />
+                </el-form-item>
+              </el-col>
 
               <el-col :span="8">
                 <el-form-item label="检验数量">
@@ -116,13 +121,6 @@
               </el-col>
 
               <el-col :span="8">
-                <el-form-item label="处理方式">
-                  <el-select v-model="mainForm.clfs" placeholder="请选择处理方式" style="width: 100%">
-                    <el-option v-for="option in clfsOptions" :key="option.value" :label="option.label" :value="option.value" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="8">
                 <el-form-item label="留样数量">
                   <el-input v-model="mainForm.lysl" @input="handleMainIntInput('lysl')" placeholder="请输入留样数量" />
                 </el-form-item>
@@ -292,6 +290,11 @@
                 <el-input v-model="mainForm.jyr" readonly />
               </el-form-item>
             </el-col>
+            <el-col :span="8">
+              <el-form-item label="审核人">
+                <el-input v-model="mainForm.jyr1" placeholder="请输入审核人" />
+              </el-form-item>
+            </el-col>
 
             <el-col :span="8">
               <el-form-item label="检验数量">
@@ -310,13 +313,6 @@
             </el-col>
 
             <el-col :span="8">
-              <el-form-item label="处理方式">
-                <el-select v-model="mainForm.clfs" placeholder="请选择处理方式" style="width: 100%">
-                  <el-option v-for="option in clfsOptions" :key="option.value" :label="option.label" :value="option.value" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
               <el-form-item label="留样数量">
                 <el-input v-model="mainForm.lysl" @input="handleMainIntInput('lysl')" placeholder="请输入留样数量" />
               </el-form-item>
@@ -550,12 +546,6 @@ const judgeOptions = [
   { label: '不合格', value: 0 }
 ]
 
-const clfsOptions = [
-  { label: '退货', value: '0' },
-  { label: '挑选', value: '1' },
-  { label: '让步接收', value: '2' }
-]
-
 watch(taskId, () => { fetchData() }, { immediate: true })
 </script>