Browse Source

解决冲突

qinhb 2 months ago
parent
commit
63eec462d7
2 changed files with 39 additions and 45 deletions
  1. 35 38
      src/views/quality/replace/index.vue
  2. 4 7
      src/views/quality/rework/index.vue

+ 35 - 38
src/views/quality/replace/index.vue

@@ -451,46 +451,43 @@ const cancel = () => {
 };
 
 const startToSelectAheads = () => {
-
-if (!Number(toSelectCount.value)) {
-ElMessage.error("请输入正确的数字");
- 	return;
-}
- const count = Number(toSelectCount.value);
+    if (!Number(toSelectCount.value)) {
+      ElMessage.error("请输入正确的数字");
+      resetInput();
+      return;
+    }
+    const count = Number(toSelectCount.value);
     const seqNoList = options.value.map((item) => item.value);
     formSeq.value.seqNoList = seqNoList.slice(0, count);
-if (options.value.length === 0) {
-    ElMessage.error("请先选择工单和工序");
-    toSelectStartCount.value = null;
-    toSelectEndCount.value = null;
-    return;
-  }
-  const start = Number(toSelectStartCount.value);
-  const end = Number(toSelectEndCount.value);
-  const seqNoList = options.value.map((item) => item.value);
-  const seqListlength = seqNoList.length;
-  if (Number.isInteger(start) && start > 0 && end === 0) {
-    form.value.seqNoList = seqNoList.slice(start - 1, seqListlength);
-    isAllChecked(form.value.seqNoList.length, seqNoList.length);
-    return;
-  }
-  if (Number.isInteger(end) && end > 0 && start === 0) {
-    form.value.seqNoList = seqNoList.slice(0, end);
-    isAllChecked(form.value.seqNoList.length, seqNoList.length);
-    return;
-  }
-  if (
-    Number.isInteger(start) &&
-    Number.isInteger(end) &&
-    start > 0 &&
-    end > 0
-  ) {
-    form.value.seqNoList = seqNoList.slice(start - 1, end);
-    isAllChecked(form.value.seqNoList.length, seqNoList.length);
-    return;
-  }
-  resetInput();
-  ElMessage.error("请输入正确的数字");
+    if (options.value.length === 0) {
+        ElMessage.error("请先选择工单和工序");
+        toSelectStartCount.value = null;
+        toSelectEndCount.value = null;
+        return;
+      }
+    const start = Number(toSelectStartCount.value);
+    const end = Number(toSelectEndCount.value);
+    const seqListlength = seqNoList.length;
+    if (Number.isInteger(start) && start > 0 && end === 0) {
+      form.value.seqNoList = seqNoList.slice(start - 1, seqListlength);
+      isAllChecked(form.value.seqNoList.length, seqNoList.length);
+      return;
+    }
+    if (Number.isInteger(end) && end > 0 && start === 0) {
+      form.value.seqNoList = seqNoList.slice(0, end);
+      isAllChecked(form.value.seqNoList.length, seqNoList.length);
+      return;
+    }
+    if (
+      Number.isInteger(start) &&
+      Number.isInteger(end) &&
+      start > 0 &&
+      end > 0
+    ) {
+      form.value.seqNoList = seqNoList.slice(start - 1, end);
+      isAllChecked(form.value.seqNoList.length, seqNoList.length);
+      return;
+    }
 };
 
 const isAllChecked = (choseLength, seqLength) => {

+ 4 - 7
src/views/quality/rework/index.vue

@@ -44,24 +44,21 @@
           link
           size="small"
           type="primary"
-          >返工工序</el-button
-        >
+          >返工工序</el-button>
         <el-button
             link
           @click="handle(row, index, 2)"
           type="primary"
           v-if="row.state === 0"
             size="small"
-          >驳回</el-button
-        >
+          >驳回</el-button>
         <el-button
             link
           @click="handle(row, index, 1)"
           type="primary"
           v-if="row.state === 0"
             size="small"
-          >确认返工</el-button
-        >
+          >确认返工</el-button>
 <!--        <el-button
             link
           v-if="row.state === 1"
@@ -77,7 +74,7 @@
           type="primary"
             size="small"
         >返工完成</el-button
-        >-->
+        >
 
         <el-button
           @click="document(row)"