فهرست منبع

fix:报故处理

lupeng 1 سال پیش
والد
کامیت
d7c31e5ae1
3فایلهای تغییر یافته به همراه91 افزوده شده و 28 حذف شده
  1. 27 1
      src/api/fault/index.ts
  2. 5 4
      src/views/base/skill/components/user-skill.vue
  3. 59 23
      src/views/quality/faultHandle/components/fault-page.vue

+ 27 - 1
src/api/fault/index.ts

@@ -50,10 +50,36 @@ export function handleEscalationFault(data: FaultHandle): AxiosPromise<any> {
    */
   export function getSeqNoList(data:Fault): AxiosPromise<any> {
     return request({
-      url: "/api/v1/process/escalationItem/list" ,
+      url: "/api/v1/process/escalationItem/list",
       method: "post",
       data: data,
     });
+  }
+
+    /**
+     * 处理结果
+     *
+     * @param id
+     * @param data
+     */
+    export function getProcessInfoList(seqNo:String) {
+      return request({
+        url: "/api/v1/process/info/list?seqNo="+seqNo ,
+        method: "get",
+      });
 }
 
+/**
+ * 返工处理
+ *
+ * @param id
+ * @param data
+ */
+export function rework(data:Object) {
+  return request({
+    url: "/api/v1/process/info/rework",
+    method: "post",
+    data:data,
+  });
+}
 

+ 5 - 4
src/views/base/skill/components/user-skill.vue

@@ -108,7 +108,7 @@ const importExcelData = () => {
     uploadRef.value.show("/api/v1/plan/order/import");
   }
 };
-
+const postId=ref({});
 // 设置表格列或者其他自定义的option
 option2.value = {
   selection: true,
@@ -153,7 +153,9 @@ option2.value = {
       dicUrl:dictDataUtil.post_list_url,
       dicMethod:"post",
       change:({ value, column })=>{
-
+        postId.value=value;
+        console.log(value);
+        console.log(postId.value);
       },
       props: { label: "postName", value: "id" },
 
@@ -180,8 +182,7 @@ option.value = Object.assign(option.value,{
     cell: true,
     span:24,
     type: 'select',
-    /*dicUrl: `${baseUrl}/getProvince?id={{key}}`,*/
-    dicData:dicts.skill_type,
+    dicUrl: `${baseUrl}/getProvince?id={{key}}`,
     props: {
       label: "dictLabel", // 下拉菜单显示的字段
       value: "dictValue" // 下拉菜单值的字

+ 59 - 23
src/views/quality/faultHandle/components/fault-page.vue

@@ -61,6 +61,17 @@
       :data="data2"
       :option="option2"
     >
+      <template #processInfo="{row,index,type}">
+        <el-select v-model="value" placeholder="请选择" @click="getFaults(row)" @change="listData(row)">
+          <el-option
+            v-for="item in optionFault"
+            :key="item.value"
+            :label="item.operationName"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+      </template>
     </avue-crud>
   </div>
   <div style="overflow: hidden">
@@ -77,7 +88,7 @@
   import ButtonPermKeys from "@/common/configs/buttonPermission";
   import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
   const { isShowTable, tableType } = toRefs(useCommonStoreHook());
-  import {getFault,getFaultDetails,getSeqNoList} from "@/api/fault"
+  import {getFault,getFaultDetails,getSeqNoList,getProcessInfoList,rework} from "@/api/fault"
   import dictDataUtil from "@/common/configs/dictDataUtil";
   // 数据字典相关
   const { dicts } = useDictionaryStoreHook();
@@ -125,6 +136,7 @@
   const formData=ref({});
   const formFault=ref({});
   const faultDetails=ref(null);
+  const postDetail=ref([]);
   onMounted(() => {
     // console.log("crudRef", crudRef)
     search.value.escalationFaultId=props.faultId;
@@ -149,32 +161,49 @@
       data2.value=data.data;
       for(let i=0;i<data2.value.length;i++){
         data2.value[i].$cellEdit=true;
-        console.info(data2);
+        postDetail.value[i].seqNo=data2.value[i].seqNo;
+
       }
     });
 
   });
 
+const listData=(row)=>{
+  for(let i=0;i<postDetail.value.length;i++){
+    if(postDetail.value[i].seqNo===row.seqNo){
+      postDetail.value[i].processId=value.value.id;
+    }
+  }
+}
 const faultHandle=ref({});
  const onHandle=()=>{
-   faultHandle.value.id=faultDetails.value.id;
-   faultHandle.value.disposalMeasures=radio1.value;
-   faultHandle.value.trackingNumber=form.value.trackingNumber;
-   /*handleEscalationFault(faultHandle.value).then((data)=>{
-     if(data.code==="200") {
+   for(let i=0;i<postDetail.value.length;i++){
+     if(null===postDetail.value[i].processId){
        ElMessage({
-         message: data.msg,
-         type: "success",
-       });
-       props.dia.visible=false;
-     }
-     else {
-       ElMessage({
-         message: data.msg,
+         message:postDetail.value[i].seqNo+"没选择返工工序",
          type: "error",
        });
+       return;
+     }
+   }
+   rework(postDetail.value).then(
+     (data)=> {
+       if (data.code === "200") {
+         ElMessage({
+           message: data.msg,
+           type: "success",
+         });
+         props.dia.visible = false;
+       }
+       else {
+         ElMessage({
+           message: data.msg,
+           type: "error",
+         });
+       }
      }
-   });*/
+   )
+
 
  }
 
@@ -185,6 +214,7 @@ const faultHandle=ref({});
     delBtn:false,
     viewBtn:false,
     menu:false,
+
     column: [
       {
         label: "缺陷大类",
@@ -198,7 +228,17 @@ const faultHandle=ref({});
       },
     ],
   });
+  const optionFault=ref([]);
+  const getFaults=(row)=>{
+    console.log("row",row);
+    getProcessInfoList(row.seqNo).then(
+      (data)=>{
+        optionFault.value=data.data;
+      }
+    )
+  }
   const option2=ref(null);
+  const value=ref(null);
   // 设置表格列或者其他自定义的option
   option2.value = {
     addBtn: false,
@@ -208,29 +248,25 @@ const faultHandle=ref({});
     submitBtn:false,
     emptyBtn:false,
     menu:false,
+    slot:true,
     column: [
       {
         label: "跟踪卡号",
         prop: "seqNo",
         labelWidth:130,
-
       },
       {
         label: "返工工序",
-        prop: "optionId",
+        prop: "processInfo",
         labelWidth:130,
         type:"select",
-        dicUrl: import.meta.env.VITE_APP_BASE_API+`/api/v1/process/info/list?seqNo={{seqNo}}`,
-        slot:true,
-        cell: true,
-
       },
 
     ],
   };
   const cancelWindow=()=>{
     console.info(props);
-    props.dia.visible=false;
+    props.dial.visible=false;
   }
 
 </script>