Prechádzať zdrojové kódy

1. SPC任务管理增加工序采集点数设置、工序测量中心值、上下限设置
2. SPC控制图导入数据后应增加筛选功能,按型号、批次、时间段

“luofeng” 3 mesiacov pred
rodič
commit
764a7713e2

+ 2 - 2
src/components/Search/index.vue

@@ -59,13 +59,13 @@ const props = defineProps({
     type: Array,
   },
 });
-const emit = defineEmits(["dataList"]);
+const emit = defineEmits(["resetList", "dataList"]);
 const searchForm = ref({});
 const getData = () => {
   emit("dataList");
 };
 const reset = () => {
-  console.log(searchForm.value, "222");
+  emit("resetList");
 };
 const setSearchFrom = () => {
   props.searchOptions.forEach((option) => {});

+ 72 - 42
src/views/analysis/process/index.vue

@@ -49,6 +49,14 @@
               <div class="bg"></div>
               样本数据录入
             </div>
+            <div class="header" v-show="!addStatus && !editStatus">
+              <Search
+                :searchOptions="searchForm"
+                ref="searchRef"
+                @dataList="getTableData"
+                @resetList="reset"
+              />
+            </div>
             <div class="btns">
               <!-- <el-button
                 v-if="!editStatus && !addStatus"
@@ -60,6 +68,7 @@
               <el-button
                 v-if="!addStatus && !editStatus"
                 type="primary"
+                size="small"
                 class="btn"
                 @click="changeaddstatus"
                 >新增</el-button
@@ -67,6 +76,7 @@
               <el-button
                 v-if="editStatus || addStatus"
                 type="success"
+                size="small"
                 class="btn"
                 @click="submit"
                 >确定</el-button
@@ -74,23 +84,11 @@
               <el-button
                 v-if="editStatus || addStatus"
                 type="info"
+                size="small"
                 class="btn"
                 @click="canceleOp"
                 >取消</el-button
-              ><span v-if="!addStatus && !editStatus" style="margin: 10px"
-                >年份:</span
               >
-              <el-date-picker
-                v-if="!addStatus && !editStatus"
-                v-model="year"
-                class="btn"
-                type="year"
-                style="width: 160px"
-                placeholder="Pick a year"
-                value-format="YYYY"
-                :clear-icon="''"
-                @change="getTableData"
-              />
             </div>
             <!-- 导入代码 -->
             <!-- <div class="btns">
@@ -266,6 +264,7 @@
                 <template #default="{ row }">
                   <el-button
                     type="primary"
+                    size="small"
                     class="btn"
                     @click="updataItem(row)"
                     style="height: 25px"
@@ -273,6 +272,7 @@
                   >
                   <el-button
                     type="info"
+                    size="small"
                     class="btn"
                     style="height: 25px"
                     @click="deleteSubmit(row.id)"
@@ -306,7 +306,7 @@
                 <template #default="{ row }"
                   >
                   <el-input-number
-           
+
                     v-model="row.accuracy1"
                     :precision="2"
                     :step="0.01"
@@ -323,7 +323,7 @@
                 <template #default="{ row }"
                   >
                   <el-input-number
-        
+
                     v-model="row.accuracy1"
                     :precision="2"
                     :step="0.01"
@@ -340,7 +340,7 @@
                 <template #default="{ row }"
                   >
                   <el-input-number
-     
+
                     v-model="row.accuracy1"
                     :precision="2"
                     :step="0.01"
@@ -358,7 +358,7 @@
                   <template #default="{ row }"
                     >
                     <el-input-number
-       
+
                       v-model="row.accuracy1"
                       :precision="2"
                       :step="0.01"
@@ -375,7 +375,7 @@
                   <template #default="{ row }"
                     >
                     <el-input-number
-          
+
                       v-model="row.accuracy2"
                       :precision="2"
                       :step="0.01"
@@ -391,7 +391,7 @@
                   <template #default="{ row }"
                     >
                     <el-input-number
-              
+
                       v-model="row.accuracy3"
                       :precision="2"
                       :step="0.01"
@@ -407,7 +407,7 @@
                   <template #default="{ row }"
                     >
                     <el-input-number
-          
+
                       v-model="row.accuracy4"
                       :precision="2"
                       :step="0.01"
@@ -423,7 +423,7 @@
                   <template #default="{ row }"
                     >
                     <el-input-number
-          
+
                       v-model="row.accuracy5"
                       :precision="2"
                       :step="0.01"
@@ -434,7 +434,7 @@
                 <template #default="{ row }"
                   >
                   <el-input-number
-            
+
                     v-model="row.accuracy1"
                     :precision="2"
                     :step="0.01"
@@ -445,7 +445,7 @@
                 <template #default="{ row }"
                   >
                   <el-input-number
-             
+
                     v-model="row.accuracy1"
                     :precision="2"
                     :step="0.01"
@@ -456,7 +456,7 @@
                 <template #default="{ row }"
                   >
                   <el-input-number
-              
+
                     v-model="row.accuracy1"
                     :precision="2"
                     :step="0.01"
@@ -471,7 +471,7 @@
                 <template #default="{ row }"
                   >
                   <el-input-number
-           
+
                     v-model="row.accuracy1"
                     :precision="2"
                     :step="0.01"
@@ -483,7 +483,7 @@
                 <template #default="{ row }"
                   >
                   <el-input-number
-    
+
                     v-model="row.accuracy1"
                     :precision="2"
                     :step="0.01"
@@ -495,7 +495,7 @@
                 <template #default="{ row }"
                   >
                   <el-input-number
-              
+
                     v-model="row.accuracy1"
                     :precision="2"
                     :step="0.01"
@@ -634,6 +634,7 @@
 import * as echarts from "echarts";
 import { useDictionaryStore } from "@/store";
 import { getData, addDatas, deleteData, updateData } from "@/api/analysis";
+import Search from "@/components/Search/index.vue";
 const year = ref("0");
 const currentOption = reactive({
   total: 0,
@@ -642,11 +643,13 @@ const currentOption = reactive({
   pageSizes: [12],
 });
 const lableValue = ref("");
+const searchRef = ref(null);
 const getTableData = async () => {
   const { data, code, msg } = await getData({
+    ...searchRef.value.searchForm,
     pageNo: currentOption.page,
     pageSize: currentOption.limit,
-    yearStr: year.value,
+    // yearStr: year.value,
     operation: lableValue.value,
   });
   if (code == "200") {
@@ -662,6 +665,23 @@ const getTableData = async () => {
   }
   disabled.value = false;
 };
+const searchForm = [
+  {
+    label: "创建时间",
+    prop: "created",
+    type: "daterange",
+  },
+  {
+    label: "产品型号",
+    prop: "model",
+    type: "input",
+  },
+  {
+    label: "生产批号",
+    prop: "batchNo",
+    type: "input",
+  },
+];
 //编辑状态
 const editStatus = ref(false);
 const addStatus = ref(false);
@@ -1312,6 +1332,7 @@ const reset = () => {
   addStatus.value = false;
   editStatus.value = false;
   addData.value = { ...resItem };
+  searchRef.value.searchForm = {};
   currentOption.value = {
     total: 0,
     page: 0,
@@ -1319,6 +1340,7 @@ const reset = () => {
     pageSizes: [12],
     operation: value.value,
   };
+  getTableData();
 };
 const setView = () => {
   setHeight();
@@ -1386,23 +1408,31 @@ onBeforeUnmount(() => {
         margin: 10px 0;
         padding-right: 40px;
       }
-      .title {
-        height: 30px;
+      .header {
+        margin-top: 20px;
+        //margin-left: 100px;
         display: flex;
-        align-items: center;
-        margin-bottom: 10px;
-        justify-content: space-between;
-        .btns {
-          display: flex;
-          align-items: center;
-          .btn {
-            height: 24px;
-            font-size: 14px;
-            margin: 0 5px;
-          }
-        }
+        width: 100%;
+        height: auto;
       }
+      //.title {
+      //  height: 50px;
+      //  display: flex;
+      //  align-items: center;
+      //  margin-bottom: 10px;
+      //  justify-content: space-between;
+      //  .btns {
+      //    display: flex;
+      //    align-items: center;
+      //    .btn {
+      //      height: 24px;
+      //      font-size: 14px;
+      //      margin: 0 5px;
+      //    }
+      //  }
+      //}
       .info {
+        margin-top: 20px;
         flex: 1;
         height: 300px;
       }

+ 23 - 1
src/views/analysis/spc/index.vue

@@ -35,6 +35,10 @@
             >
           </template>
         </el-table-column>
+        <el-table-column prop="processCount" label="工序采集点数" />
+        <el-table-column prop="centralValue" label="中心值" />
+        <el-table-column prop="upperLimit" label="上限" />
+        <el-table-column prop="floor" label="下限" />
         <el-table-column prop="created" label="创建时间" />
         <el-table-column
           align="center"
@@ -117,6 +121,18 @@
           <el-form-item label="控制图" prop="chart">
             <el-input :disabled="true" v-model="formData.chart" />
           </el-form-item>
+          <el-form-item label="工序采集点数" prop="processCount">
+            <el-input v-model="formData.processCount" />
+          </el-form-item>
+          <el-form-item label="中心值" prop="centralValue">
+            <el-input v-model="formData.centralValue" />
+          </el-form-item>
+          <el-form-item label="上限" prop="upperLimit">
+            <el-input v-model="formData.upperLimit" />
+          </el-form-item>
+          <el-form-item label="下限" prop="floor">
+            <el-input v-model="formData.floor" />
+          </el-form-item>
         </el-form>
         <div style="display: flex; justify-content: space-evenly">
           <el-button
@@ -143,7 +159,7 @@
 
 <script setup>
 import Search from "@/components/Search/index.vue";
-import { useSpcStore } from "@/store";
+import {useDictionaryStore, useSpcStore} from "@/store";
 import {
   getTableData,
   getBaseData,
@@ -224,6 +240,8 @@ const getData = async (obj) => {
   }
 };
 const ruleFormRef = ref(null);
+const { dicts } = useDictionaryStore();
+const opOptions = ref([...dicts.spc_operation]);
 
 const rules = {
   Index1: [
@@ -328,6 +346,10 @@ const toSubmit = async () => {
           param: formData.value.param,
 
           source: formData.value.source,
+          processCount: formData.value.processCount,
+          centralValue: formData.value.centralValue,
+          upperLimit: formData.value.upperLimit,
+          floor: formData.value.floor,
         });
         if (code == "200") {
           ElMessage.success("添加成功!");