695593266@qq.com před 2 měsíci
rodič
revize
36d1a040d6

+ 12 - 0
src/api/produce/qualityInspection.js

@@ -82,3 +82,15 @@ export async function addInspectionsTerm(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+//删除首件两检质检项
+export async function deleteInspectionItems(params) {
+  const res = await request.post(
+    `/mes/firstarticledualinspectionrecord/deleteItems`,
+    params
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 67 - 5
src/views/produce/components/qualityInspection/components/selfInspectionReporting.vue

@@ -213,7 +213,10 @@
           <el-button
             type="primary"
             @click="addInspection"
-            v-if="form.items.length == 0 || clientEnvironmentId == 9"
+            v-if="
+              (form.items.length == 0 && clientEnvironmentId != 9) ||
+              clientEnvironmentId == 9
+            "
             >选择质检方案</el-button
           >
         </template>
@@ -384,7 +387,8 @@
     getDetail,
     selfInspectionReport,
     specialInspectionReport,
-    addInspectionsTerm
+    addInspectionsTerm,
+    deleteInspectionItems
   } from '@/api/produce/qualityInspection.js';
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import inspectionTemplatePop from '@/views/produce/components/bom/qualityTesting/inspectionTemplate.vue';
@@ -450,6 +454,12 @@
     computed: {
       columns() {
         return [
+          {
+            width: 50,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
           {
             width: 50,
             type: 'index',
@@ -476,21 +486,21 @@
             slot: 'toolList',
             align: 'center',
             label: '工具名称',
-            minWidth: 120
+            minWidth: 150
           },
           {
             prop: 'havePleaseEntrust',
             slot: 'havePleaseEntrust',
             align: 'center',
             label: '是否请托',
-            minWidth: 70
+            minWidth: 140
           },
           {
             prop: 'status',
             slot: 'status',
             align: 'center',
             label: '检验状态',
-            minWidth: 70
+            minWidth: 140
           },
           {
             prop: 'selfCheckDesc',
@@ -635,6 +645,58 @@
         this.$refs.inspectionTemplateRef.open('first');
       },
 
+      deleteInspection() {
+        if (this.selection.length === 0) {
+          this.$message.warning('请先选择要删除的检验项');
+          return;
+        }
+
+        this.$confirm(
+          `确定要删除选中的 ${this.selection.length} 条检验项吗?`,
+          '提示',
+          {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }
+        )
+          .then(async () => {
+            const deleteIds = this.selection
+              .map((item) => item.id)
+              .filter(Boolean);
+
+            if (deleteIds.length > 0) {
+              const loading = this.$loading({
+                lock: true,
+                text: '删除中...',
+                spinner: 'el-icon-loading',
+                background: 'rgba(0, 0, 0, 0.7)'
+              });
+
+              try {
+                await deleteInspectionItems({
+                  recordId: this.form.id,
+                  itemIds: deleteIds
+                });
+
+                this.$message.success('删除成功');
+                this.selection = [];
+                await this.getData();
+              } finally {
+                loading.close();
+              }
+            } else {
+              const selectionSet = new Set(this.selection);
+              this.form.items = this.form.items.filter(
+                (item) => !selectionSet.has(item)
+              );
+              this.selection = [];
+              this.$message.success('删除成功');
+            }
+          })
+          .catch(() => {});
+      },
+
       async changeSel({ id }) {
         const { data } = await getTemplateById(id);
 

+ 20 - 15
src/views/produce/components/qualityInspection/components/selfInspectionRequest.vue

@@ -107,7 +107,6 @@
         :columns="columns"
         :datasource="list"
         cache-key="mes-selfInspectionRequest-20251201"
-        autoAmendPage
         :need-page="false"
         :fit="false"
         @refresh="getData"
@@ -118,7 +117,10 @@
           <el-button
             type="primary"
             @click="addInspection"
-            v-if="list.length == 0 || clientEnvironmentId == 9"
+            v-if="
+              (list.length == 0 && clientEnvironmentId != 9) ||
+              clientEnvironmentId == 9
+            "
             >选择质检方案</el-button
           >
         </template>
@@ -145,15 +147,16 @@
 
         <template v-slot:defaultValue="{ row }">
           <div
-            style="width: 100%; display: flex; justify-content: space-between"
+            style="width: 100%; display: flex; align-items: center; gap: 8px"
           >
-            <div style="width: 13%">
+            <div style="width: 20%; min-width: 90px; flex-shrink: 0">
               <DictSelection
                 clearable
                 dictName="数学字符"
                 value-name="dictValue"
                 :disabled="!isAdd"
                 v-model="row.symbol"
+                style="width: 100%"
               ></DictSelection>
             </div>
             <!-- 上下限 -->
@@ -162,25 +165,26 @@
               style="
                 display: flex;
                 align-items: center;
-                justify-content: space-between;
-                width: 75%;
+                gap: 8px;
+                flex: 1;
+                min-width: 0;
               "
             >
               <el-input
-                style="width: 45%"
+                style="flex: 1; min-width: 0"
                 v-model="row.minValue"
                 :disabled="!isAdd"
               ></el-input>
-              <span>&nbsp;&nbsp;-</span>
+              <span>-</span>
 
               <el-input
-                style="width: 45%; margin-left: 10px"
+                style="flex: 1; min-width: 0"
                 v-model="row.maxValue"
                 :disabled="!isAdd"
               ></el-input>
             </div>
 
-            <div v-else style="width: 70%">
+            <div v-else style="flex: 1; min-width: 0">
               <el-input
                 v-model="row.defaultValue"
                 placeholder="请输入"
@@ -189,7 +193,7 @@
               </el-input>
             </div>
 
-            <div style="width: 13%">
+            <div style="width: 20%; min-width: 90px; flex-shrink: 0">
               <DictSelection
                 dictName="工艺参数单位"
                 value-name="dictValue"
@@ -197,6 +201,7 @@
                 filterable
                 :disabled="!isAdd"
                 v-model="row.unitName"
+                style="width: 100%"
               >
               </DictSelection>
             </div>
@@ -320,28 +325,28 @@
             slot: 'defaultValue',
             align: 'center',
             label: '工艺参数',
-            minWidth: 280
+            minWidth: 380
           },
           {
             prop: 'toolList',
             slot: 'toolList',
             align: 'center',
             label: '工具名称',
-            minWidth: 120
+            minWidth: 150
           },
           {
             prop: 'havePleaseEntrust',
             slot: 'havePleaseEntrust',
             align: 'center',
             label: '是否请托',
-            minWidth: 70
+            minWidth: 140
           },
           {
             prop: 'status',
             slot: 'status',
             align: 'center',
             label: '检验状态',
-            minWidth: 70
+            minWidth: 140
           }
         ];
       }

+ 3 - 0
src/views/produce/index.vue

@@ -1534,6 +1534,9 @@
 
       successTask() {
         this.isFinalCheckProduction = false;
+        this.$nextTick(() => {
+          this.$refs.produceOrder && this.$refs.produceOrder.reload();
+        });
       },
 
       async selfRequest(row) {