Quellcode durchsuchen

Merge branch 'qingban' of http://maven.jgiot.com:7012/jiaxiaoqiang/JG-CLIENT-TEMP into qingban

lupeng vor 1 Monat
Ursprung
Commit
822add6665

+ 53 - 20
src/views/pro-operation/report-work/index.vue

@@ -36,12 +36,17 @@
 
             <el-row>
               <el-col :span="24">
-                <el-input v-model="formData.operateCondition" placeholder="请输入实时工艺条件" style="margin-bottom: 20px" type="textarea" /><el-form-item
+                <el-form-item
                   prop="operateCondition"
                   style="margin-bottom: 20px"
                   :rules="[{ required: true, message: '请输入实时工艺条件', trigger: 'blur' }]"
                 >
-
+                  <el-input
+                    v-model="formData.operateCondition"
+                    placeholder="请输入实时工艺条件"
+                    style="margin-bottom: 20px"
+                    type="textarea"
+                  />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -81,11 +86,11 @@
                     <template #header>
                       <div class="guanhao-header">
                         <el-checkbox v-model="per.checkAll" @change="handleCheckAll(per)"> 全选 </el-checkbox>
-                        <el-input v-model="toSelectCount" placeholder="请输入选中前面数量">
-                          <template #append
-                            ><el-button type="primary" @click="startToSelectAheads(per)">选择</el-button></template
-                          >
-                        </el-input>
+                        <span>管号数量为:{{ per.total }}</span>
+                        <el-input v-model="per.startSelect" placeholder="请输入选中前面数量" />
+                        <span>-</span>
+                        <el-input v-model="per.endSelect" placeholder="请输入选中后面数量" />
+                        <el-button type="primary" @click="startToSelectAheads(per)">选择</el-button>
                       </div>
                     </template>
                     <el-option v-for="item in process" :key="item" :label="item" :value="item" />
@@ -98,10 +103,13 @@
                     class="icon-btn"
                     @click="
                       persons.push({
-                        userName: null,
+                        userName: userStore.user.username ?? null,
                         workingHoursRate: 100,
                         selectedProcess: [],
                         checkAll: false,
+                        startSelect: null,
+                        endSelect: null,
+                        total: per.total - minusCount,
                       })
                     "
                   />
@@ -194,6 +202,9 @@ const persons = ref<
     workingHoursRate: number | null;
     selectedProcess: any;
     checkAll: boolean;
+    startSelect: number | null;
+    endSelect: number | null;
+    total: number | null;
   }[]
 >([
   {
@@ -201,6 +212,9 @@ const persons = ref<
     workingHoursRate: 100,
     selectedProcess: [],
     checkAll: false,
+    startSelect: null,
+    endSelect: null,
+    total: null,
   },
 ]);
 
@@ -212,14 +226,6 @@ const openReportWorkDrawer = () => {
   // 初始化数据
   selectedSign.value = [];
   formData.operateCondition = "";
-  persons.value = [
-    {
-      userName: userStore.user.username ?? "",
-      workingHoursRate: 100,
-      selectedProcess: [],
-      checkAll: false,
-    },
-  ];
   processList.value = [];
 
   getProcessInfo(processStore.scanInfo.id).then((res) => {
@@ -238,6 +244,17 @@ const openReportWorkDrawer = () => {
 
   getunProcessedList(processStore.scanInfo.id).then((res: any) => {
     processList.value = res.data ?? [];
+    persons.value = [
+      {
+        userName: userStore.user.username ?? "",
+        workingHoursRate: 100,
+        selectedProcess: [],
+        checkAll: false,
+        startSelect: null,
+        endSelect: null,
+        total: processList.value.length,
+      },
+    ];
   });
 
   signList({ signatureType: "3" }).then((res) => {
@@ -309,16 +326,28 @@ const queryUserList = () => {
     userList.value = data.data;
   });
 };
-onMounted(async () => queryUserList());
+
+// 每次选中流转卡号的数量
+const minusCount = ref(0);
 
 const toSelectCount = ref(null);
 const startToSelectAheads = (per) => {
-  if (Number(toSelectCount.value) && toSelectCount.value < process.value.length + 1) {
-    per.selectedProcess = process.value.slice(0, toSelectCount.value);
+  if (per.startSelect < 1 || per.endSelect < 1 || per.startSelect > per.endSelect || per.endSelect > per.total) {
+    ElMessage.error("请输入正确范围数字");
+    return;
+  }
+  per.selectedProcess = process.value.slice(per.startSelect - 1, per.endSelect);
+  minusCount.value = per.selectedProcess.length;
+  if (minusCount.value == per.total) {
+    per.checkAll = true;
   } else {
-    ElMessage.error("请输入小于管号数量的整数");
+    per.checkAll = false;
   }
 };
+
+onMounted(async () => {
+  queryUserList();
+});
 </script>
 
 <style lang="scss" scoped>
@@ -371,4 +400,8 @@ const startToSelectAheads = (per) => {
   padding: 0 20px;
   gap: 20px;
 }
+.guanhao-header .el-input {
+  width: 160px;
+  height: 30px;
+}
 </style>

+ 3 - 0
src/views/process/components/steps.vue

@@ -27,6 +27,9 @@
               <div :class="selectStepIndex == index ? 'stepStation stepStationHover' : 'stepStation'">
                 {{ item.operationCode }}
               </div>
+              <div :class="selectStepIndex == index ? 'stepStation stepStationHover' : 'stepStation'">
+                {{ item.operationLabel }}
+              </div>
             </div>
           </div>
           <div :class="selectStepIndex == index ? 'timeBox timeBoxHover' : 'timeBox'">