Pārlūkot izejas kodu

fix:报故处理

lupeng 1 gadu atpakaļ
vecāks
revīzija
d644acaae4

+ 14 - 0
src/api/bom/index.ts

@@ -15,3 +15,17 @@ export function batchAddBom(data: any) {
     data: data,
   });
 }
+
+/*/!**
+ * 查询bom版本信息
+ *
+ * @param id
+ * @param data
+ *!/
+export function batchAddBom(data: any) {
+  return request({
+    url: "/api/v1/base/materialBom/batchAdd",
+    method: "post",
+    data: data,
+  });
+}*/

+ 32 - 0
src/api/fault/index.ts

@@ -0,0 +1,32 @@
+import request from "@/utils/request";
+import { AxiosPromise } from "axios";
+import {Fault} from "@/api/fault/types";
+
+
+/**
+ * 获取关联图片
+ *
+ * @param fault
+ */
+export function getFault(data: Fault): AxiosPromise<Fault> {
+  return request({
+    url: "/api/v1/process/escalationImg/list",
+    method: "post",
+    data: data,
+  });
+}
+
+/**
+ * 获取报故详情
+ *
+ * @param id
+ * @param data
+ */
+export function getFaultDetails(id: Number): AxiosPromise<any> {
+  return request({
+    url: "/api/v1/process/escalationFault/get/" + id,
+    method: "get",
+  });
+}
+
+

+ 3 - 0
src/api/fault/types.ts

@@ -0,0 +1,3 @@
+export interface Fault {
+  escalationFaultId?: number;
+}

+ 3 - 0
src/api/order/index.ts

@@ -35,6 +35,9 @@ export function getExpandAlias(tableType: String): AxiosPromise<any> {
  * @param data
  */
 export function addOrder(data: any) {
+  if(data.orderType==='2'){
+
+  }
   return request({
     url: "/api/v1/plan/order/add",
     method: "post",

+ 2 - 0
src/common/configs/dictDataUtil.ts

@@ -8,6 +8,8 @@ const DictDataUtil = {
     import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dept/parent/list",
   post_list_url: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/post/list",
 
+  img_url:import.meta.env.VITE_APP_UPLOAD_URL,
+
   TYPE_CODE: {
     //订单类型
     plan_order_type: "plan_order_type",

+ 35 - 1
src/components/CommonTable/configs/tableConfig.ts

@@ -573,4 +573,38 @@ export const tableConfig = {
 		],
 	},
 
-};
+
+  FAULT: {
+    url: "/api/v1/process/escalationFault",
+    column: [
+      {
+        label: "不合格审理单号",
+        prop: "trackingNumber",
+        search: true,
+      },
+      {
+        label: "工单号",
+        prop: "workOrderCode",
+        search: true,
+      },
+      {
+        label: "订单号",
+        prop: "orderCode",
+        search: true,
+      },
+      {
+        label: "不合格数量",
+        prop: "unqualifiedNum",
+      },
+
+      {
+        label: "序列号", prop: "seqNo", overHidden: true,
+        width:100,
+      },
+      {
+        label: "报故人", prop: "creator",
+
+      },
+    ],
+  },
+};

+ 4 - 0
src/store/modules/dictionary.ts

@@ -25,6 +25,10 @@ export const useDictionaryStore = defineStore("dictionaryStore", () => {
     "skill_type",
     "drawing_type",
     "vehicle_level",
+    "fault_current_state",
+    "escalation_fault_state",
+    "defect_mana",
+    "disposal_measures_type",
   ];
   const dicts = ref<{ [key: string]: any[] }>({});
   function checkDicts() {

+ 1 - 0
src/views/base/bom/components/version-page.vue

@@ -104,6 +104,7 @@
     highlightCurrentRow: true,
     align:'center',
     menuAlign:'center',
+    editBtn:false,
     column: [
       {
         label: "版本号",

+ 25 - 6
src/views/base/bom/index.vue

@@ -2,6 +2,9 @@
   <div class="mainContentBox">
     <!--{{dataDetail}}-->
     <!--{{dicts}}-->
+    <div class="detail-title">
+      物料信息
+    </div>
     <div class="detail">
       <div class="title-detail">物料名称:{{dataDetail.materialCode}}</div>
       <div class="title-detail">物料编码:{{dataDetail.materialName}}</div>
@@ -75,6 +78,7 @@
             </el-dropdown-menu>
           </template>
         </el-dropdown>
+        <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
       </template>
     </avue-crud>
     <CommonTable
@@ -93,15 +97,13 @@
     </el-dialog>
   </div>
 </template>
-<script setup lang="ts">
+<script setup>
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "../../../hooks/userCrud";
 import ButtonPermKeys from "../../../common/configs/buttonPermission";
 import { columns } from "./columns";
 import { useCommonStoreHook, useDictionaryStoreHook } from "../../../store/index";
-import {
-  getList,
-} from "@/api/bom";
+
 import {
   getMaterialDetails,
 } from "@/api/material";
@@ -121,6 +123,13 @@ const test = () => {
   tableType.value = tableType.value == 1 ? 2 : 1;
 };
 const openMaterial=()=>{
+  if(version.value.value===0||version.value.value===null){
+    ElMessage({
+      message: "没有选择BOM版本",
+      type: "error",
+    });
+    return;
+  }
   if (ctableRef.value) {
     ctableRef.value.startSelect();
   }
@@ -170,7 +179,7 @@ const onSelected=()=>{
     return;
   }
   batchAddBom(data.value).then(
-    (data: any)=>{
+    (data)=>{
       if(data.code==="200") {
         ElMessage({
           message: data.msg,
@@ -225,7 +234,7 @@ const uploadFinished = () => {
 const importExcelData = () => {
 
   if (uploadRef.value) {
-    uploadRef.value.show("/api/v1/base/materialBom/import?"+route.params.materialCode);
+    uploadRef.value.show("/api/v1/base/materialBom/import?materialCode="+route.params.materialCode);
   }
 };
 
@@ -253,6 +262,13 @@ const onSelectedFinish = (selectedValue) => {
       return;
     }
   }
+  if(version.value.value===0||version.value.value===null){
+    ElMessage({
+      message: "没有选择BOM版本",
+      type: "error",
+    });
+    return;
+  }
   const bom=ref({
     materialCode:route.params.materialCode,
     bomMaterialCode:selectedValue.materialCode,
@@ -307,5 +323,8 @@ const selectedFinish=(selectedValue)=> {
     float: right;
     margin-top:15px;
   }
+  .detail-title{
+    width: 100%;
 
+  }
 </style>

+ 1 - 0
src/views/base/materials/columns.ts

@@ -3,6 +3,7 @@ const { dicts } = useDictionaryStoreHook();
 export const columns = [
   { label: "物料编码", prop: "materialCode", width: 130,overHidden: true,search: true ,rules: [{
       required: true,
+      editDisabled:false,
       message: "请填写物料编码",
       trigger: "blur"
     }],},

+ 1 - 1
src/views/base/modeling/production-line/index.vue

@@ -62,7 +62,7 @@
   // 传入一个url,后面不带/
   const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
     useCrud({
-      src: "/api/v1/base/productionLine",
+      src: "/api/v1/base/productionLine/list",
     });
   const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
     Methords; //增删改查

+ 11 - 6
src/views/base/modeling/station/columns.ts

@@ -1,5 +1,7 @@
 import { useDictionaryStoreHook } from "@/store";
 const { dicts } = useDictionaryStoreHook();
+
+const ctableRef=ref(null);
 export const columns = [
   {
     label: "工位编号",
@@ -62,15 +64,18 @@ export const columns = [
       message: "请选择负责人",
       trigger: "blur"
     }],
-    type: 'select',
-    dicUrl:import.meta.env.VITE_APP_BASE_API+"/api/v1/sys/user/list",
-    dicMethod:"post",
-    props: {
-      label: "userName", // 下拉菜单显示的字段
-      value: "userName" // 下拉菜单值的字段
+    click: ({ value, column }) => {
+      ctableRef.value.startSelect();
     },
   },
   {
+    label: "负责人id",
+    prop: "managerId",
+    hide:true,
+    display:false,
+
+  },
+  {
     label: "所属产线",
     prop: "productionLineName",
     display:false

+ 121 - 3
src/views/base/modeling/station/index.vue

@@ -42,6 +42,12 @@
     >
       <station-page  :stationId="stationDevice.id"/>
     </el-dialog>
+    <CommonTable
+      ref="ctableRef"
+      tableTitle="员工选择"
+      tableType="USERS"
+      @selected-sure="onSelectedFinish"
+    />
   </div>
 </template>
 <script setup="ts">
@@ -52,7 +58,6 @@
 
   const { isShowTable, tableType } = toRefs(useCommonStoreHook());
   import { useDictionaryStoreHook } from "@/store";
-  import { columns } from "./columns";
   const test = () => {
     isShowTable.value = true;
     tableType.value = tableType.value == 1 ? 2 : 1;
@@ -85,7 +90,7 @@
     // console.log("crudRef", crudRef)
     dataList();
   });
-
+  const ctableRef=ref(null);
   /**
    * 上传excel相关
    */
@@ -112,7 +117,120 @@
   // 设置表格列或者其他自定义的option
   option.value = Object.assign(option.value, {
     selection: true,
-    column: columns,
+    column: [
+      {
+        label: "工位编号",
+        prop: "stationCode",
+        search: true,
+        rules: [{
+          required: true,
+          message: "请填写工位编号",
+          trigger: "blur"
+        }],
+      },
+      {
+        label: "工位名称",
+        prop: "name",
+        search: true,
+        rules: [{
+          required: true,
+          message: "请填写工位名称",
+          trigger: "blur"
+        }],
+      },
+      {
+        label: "工位类型",
+        prop: "stationDictValue",
+        search: true,
+        rules: [{
+          required: true,
+          message: "请选择工位类型",
+          trigger: "blur"
+        }],
+        type: 'select',
+        dicData:dicts.station_type,
+        searchClearable: false, //可清空的输入框,默认为true
+        filterable: true, //添加filterable属性即可启用搜索功能
+        props: {
+          label: "dictLabel", // 下拉菜单显示的字段
+          value: "dictValue" // 下拉菜单值的字段
+        },
+      },
+      {
+        label: "操作方式",
+        prop: "operateDictValue",
+        rules: [{
+          required: true,
+          message: "操作方式",
+          trigger: "blur"
+        }],
+        type: 'select',
+        dicData:dicts.station_operate_type,
+        props: {
+          label: "dictLabel", // 下拉菜单显示的字段
+          value: "dictValue" // 下拉菜单值的字
+        },
+      },
+      {
+        label: "负责人",
+        prop: "manager",
+        rules: [{
+          required: true,
+          message: "请选择负责人",
+          trigger: "blur"
+        }],
+        click: ({ value, column }) => {
+          ctableRef.value.startSelect();
+        },
+      },
+      {
+        label: "负责人id",
+        prop: "managerId",
+        hide:true,
+        display:false,
+
+      },
+      {
+        label: "所属产线",
+        prop: "productionLineName",
+        display:false
+      },
+      {
+        label: "工位地址",
+        prop: "position",
+        rules: [{
+          required: true,
+          message: "请填写工位地址",
+          trigger: "blur"
+        }],
+      },
+      {
+        label: "IP地址",
+        prop: "stationIp",
+        rules: [{
+          required: true,
+          message: "请填写工位IP地址",
+          trigger: "blur",
+        }],
+
+      },
+      {
+        label: "工位描述",
+        prop: "remark",
+        type: 'textarea',
+        span: 24,
+      },
+      {
+        label: "创建人",
+        prop: "creator",
+        display:false
+      },
+      {
+        label: "创建时间",
+        prop: "created",
+        display:false
+      },
+    ]
   });
 </script>
 

+ 28 - 0
src/views/plan/order/index.vue

@@ -120,6 +120,12 @@
         </div>
       </template>
     </el-dialog>
+    <CommonTable
+      ref="ctableRef"
+      tableTitle="报故单"
+      tableType="FAULT"
+      @selected-sure="onSelectedFinish"
+    />
   </div>
 </template>
 <script setup lang="ts">
@@ -148,6 +154,7 @@ const dialog = reactive({
   width: 800,
   title: "",
 });
+const ctableRef = ref(null);
 const search = ref({});
 const option = ref({});
 const pageData = ref([]);
@@ -305,6 +312,27 @@ option.value = {
           trigger: "trigger",
         },
       ],
+      change: ({ value, column }) => {
+        if(value==='2'){
+          option.value.column[8].display=true;
+        }
+        if(value==='1'){
+          option.value.column[8].display=false;
+        }
+      },
+    },
+    {
+      label: "报故单",
+      prop: "faultId",
+      width: 100,
+      display:false,
+      type:"select",
+      click:({ value, column }) => {
+        if (ctableRef.value) {
+          ctableRef.value.startSelect();
+        }
+      },
+
     },
     {
       label: "订单数量",

+ 46 - 0
src/views/quality/faultHandle/columns.ts

@@ -0,0 +1,46 @@
+import { useDictionaryStoreHook } from "../../../store/index";
+const { dicts } = useDictionaryStoreHook();
+export const columns = [
+
+  {
+    label: "审理单号",
+    prop: "trackingNumber",
+    search: true,
+  },
+  {
+    label: "工单号",
+    prop: "workOrderCode",
+    search: true,
+  },
+  {
+    label: "订单号",
+    prop: "orderCode",
+    search: true,
+  },
+  {
+    label: "不合格数量",
+    prop: "unqualifiedNum",
+  },
+
+  {
+    label: "序列号", prop: "seqNo", overHidden: true,
+    width:100,
+  },
+  {
+    label: "状态", prop: "state", overHidden: true,
+    width:100,
+    dicData:dicts.escalation_fault_state,
+    props: { label: "dictLabel", value: "dictValue" },
+  },
+  {
+    label: "跟踪状态", prop: "currentState", overHidden: true,
+    width:100,
+    dicData:dicts.fault_current_state,
+    props: { label: "dictLabel", value: "dictValue" },
+  },
+  {
+    label: "报故人", prop: "creator",
+    search: true,
+  },
+
+];

+ 196 - 0
src/views/quality/faultHandle/components/fault-detail.vue

@@ -0,0 +1,196 @@
+<template>
+  <div class="fault" v-if="faultDetails!=null">
+    <div class="title-fault" >
+      产品名称:&nbsp;&nbsp;{{faultDetails.materialName}}
+    </div>
+    <div class="title-fault">
+      产品编码:&nbsp;&nbsp;{{faultDetails.materialCode}}
+    </div>
+  </div>
+  <div class="mainContentBox">
+
+    <avue-crud
+      ref="crudRef"
+      v-model:search="search"
+      v-model="form"
+      :data="data"
+      :option="option"
+      v-model:page="page"
+      @row-save="createRow"
+      @row-update="updateRow"
+      @row-del="deleteRow"
+      @search-change="searchChange"
+      @search-reset="resetChange"
+      @selection-change="selectionChange"
+    >
+
+
+
+    </avue-crud>
+
+  </div>
+  <div class="fault">
+    <div class="image-title">图片</div>
+      <div v-for="(image, index) in faultImg" :key="index" class="fault-image">
+        <!-- 使用v-for循环渲染图片列表 -->
+        <img :src="dictDataUtil.img_url+image.fileUrl" alt="图片" width="150px" class="fault-img">
+      </div>
+
+  </div>
+  <div class="fault" v-if="faultDetails!=null">
+    <div class="fault-detail" >序列号:&nbsp;&nbsp;{{faultDetails.seqNo}}</div>
+    <div class="fault-detail">故障描述:&nbsp;&nbsp;{{faultDetails.remark}}</div>
+
+    <div class="title-fault" style="margin-top: 10px">
+      报故人:&nbsp;&nbsp;{{faultDetails.creator}}
+    </div>
+    <div class="title-fault" style="margin-top: 10px">
+      报故工位:&nbsp;&nbsp;{{faultDetails.stationName}}
+    </div>
+    <div class="title-fault" style="margin-top: 10px">
+      报故数量:&nbsp;&nbsp;{{faultDetails.unqualifiedNum}}
+    </div>
+    <div class="title-fault" style="margin-top: 10px">
+      处理结果:&nbsp;&nbsp;{{faultDetails.disposalMeasures}}
+    </div>
+  </div>
+</template>
+<script setup>
+  import { ref, getCurrentInstance } from "vue";
+  import { useCrud } from "@/hooks/userCrud";
+  import ButtonPermKeys from "@/common/configs/buttonPermission";
+  import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
+  const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+  import {getFault,getFaultDetails} from "@/api/fault"
+  import dictDataUtil from "@/common/configs/dictDataUtil";
+  // 数据字典相关
+  const { dicts } = useDictionaryStoreHook();
+
+  const test = () => {
+    isShowTable.value = true;
+    tableType.value = tableType.value == 1 ? 2 : 1;
+  };
+  const props = defineProps({
+    escalationFaultId: {
+      type: Number,
+      default: () => {
+        return 0;
+      }
+    },
+    dialog:{
+      type:Object,
+      default:()=>{
+        return {};
+      }
+    }
+  })
+  const drawingDetail=ref(null);
+  const drawing=(row)=>{
+    drawingDetail.value=row;
+    dialog.visible=true;
+  }
+  // 传入一个url,后面不带/
+  const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+    useCrud({
+      src: "/api/v1/process/escalationDefects",
+    });
+  const { dataNoPageList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+    Methords; //增删改查
+  const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+  const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+  // checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
+  // const permission = reactive({
+  //   delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
+  //   addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
+  //   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
+  //   menu: true,
+  // });
+
+  const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+  const router = useRouter();
+
+  const faultImg=ref(null);
+  const formData=ref({});
+  const faultDetails=ref(null);
+
+  onMounted(() => {
+    // console.log("crudRef", crudRef)
+    search.value.escalationFaultId=props.escalationFaultId;
+    dataNoPageList();
+    formData.value.escalationFaultId=props.escalationFaultId;
+    getFault(formData).then((data) => {
+
+      faultImg.value=data.data;
+      console.info(faultImg.value);
+    });
+    getFaultDetails(props.escalationFaultId).then((data) => {
+
+      faultDetails.value=data.data;
+      for(let i=0;i<dicts.disposal_measures_type.length;i++){
+        if(faultDetails.value.disposalMeasures===dicts.disposal_measures_type[i].dictValue){
+          faultDetails.value.disposalMeasures=dicts.disposal_measures_type[i].dictLabel;
+        }
+      }
+    });
+
+  });
+
+
+  watch(
+    () => props.escalationFaultId,
+    () => {
+      search.value.escalationFaultId=props.escalationFaultId
+      dataNoPageList();
+    }
+  );
+
+  // 设置表格列或者其他自定义的option
+  option.value = Object.assign(option.value, {
+    addBtn: false,
+    editBtn:false,
+    delBtn:false,
+    viewBtn:false,
+    menu:false,
+    column: [
+      {
+        label: "缺陷大类",
+        prop: "bugType",
+        dicData:dicts.defect_mana,
+        props: { label: "dictLabel", value: "dictValue" },
+      },
+      {
+        label: "缺陷小类",
+        prop: "bugName",
+      },
+    ],
+  });
+
+
+</script>
+<style>
+  .title-fault{
+    float: left;
+    width: 300px;
+  }
+  .fault{
+    margin-left: 15px;
+    margin-top: 10px;
+    display: block;
+    overflow: hidden;
+  }
+  .fault-image{
+    width: 150px;
+    float: left;
+    margin-left: 10px;
+    overflow: hidden;
+  }
+  .image-title{
+    margin-bottom: 15px;
+  }
+  .fault-img{
+    display: inline-block;
+  }
+  .fault-detail{
+    margin-top: 20px;
+  }
+</style>

+ 185 - 0
src/views/quality/faultHandle/components/fault-handle.vue

@@ -0,0 +1,185 @@
+<template>
+  <div class="fault" v-if="faultDetails!=null">
+    <div class="title-fault" >
+      产品名称:&nbsp;&nbsp;{{faultDetails.materialName}}
+    </div>
+    <div class="title-fault">
+      产品编码:&nbsp;&nbsp;{{faultDetails.materialCode}}
+    </div>
+  </div>
+  <div class="mainContentBox">
+
+    <avue-crud
+      ref="crudRef"
+      v-model:search="search"
+      v-model="form"
+      :data="data"
+      :option="option"
+      v-model:page="page"
+      @row-save="createRow"
+      @row-update="updateRow"
+      @row-del="deleteRow"
+      @search-change="searchChange"
+      @search-reset="resetChange"
+      @selection-change="selectionChange"
+    >
+
+
+
+    </avue-crud>
+
+  </div>
+  <div class="fault">
+    <div class="image-title">图片</div>
+      <div v-for="(image, index) in faultImg" :key="index" class="fault-image">
+        <!-- 使用v-for循环渲染图片列表 -->
+        <img :src="dictDataUtil.img_url+image.fileUrl" alt="图片" width="150px" class="fault-img">
+      </div>
+
+  </div>
+  <div class="fault" v-if="faultDetails!=null">
+    <div class="fault-detail" >序列号:&nbsp;&nbsp;{{faultDetails.seqNo}}</div>
+    <div class="fault-detail">故障描述:&nbsp;&nbsp;{{faultDetails.remark}}</div>
+
+    <div class="title-fault" style="margin-top: 10px">
+      报故人:&nbsp;&nbsp;{{faultDetails.creator}}
+    </div>
+    <div class="title-fault" style="margin-top: 10px">
+      报故工位:&nbsp;&nbsp;{{faultDetails.stationName}}
+    </div>
+    <div class="title-fault" style="margin-top: 10px">
+      报故数量:&nbsp;&nbsp;{{faultDetails.unqualifiedNum}}
+    </div>
+    <div class="title-fault" style="margin-top: 10px">
+      处理结果:&nbsp;&nbsp;{{faultDetails.disposalMeasures}}
+    </div>
+  </div>
+</template>
+<script setup>
+  import { ref, getCurrentInstance } from "vue";
+  import { useCrud } from "@/hooks/userCrud";
+  import ButtonPermKeys from "@/common/configs/buttonPermission";
+  import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
+  const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+  import {getFault,getFaultDetails} from "@/api/fault"
+  import dictDataUtil from "@/common/configs/dictDataUtil";
+  // 数据字典相关
+  const { dicts } = useDictionaryStoreHook();
+
+  const test = () => {
+    isShowTable.value = true;
+    tableType.value = tableType.value == 1 ? 2 : 1;
+  };
+  const props = defineProps({
+    escalationId: {
+      type: Number,
+      default: () => {
+        return 0;
+      }
+    },
+    dialog1:{
+      type:Object,
+      default:()=>{
+        return {};
+      }
+    }
+  })
+  // 传入一个url,后面不带/
+  const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+    useCrud({
+      src: "/api/v1/process/escalationDefects",
+    });
+  const { dataNoPageList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+    Methords; //增删改查
+  const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+  const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+  // checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
+  // const permission = reactive({
+  //   delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
+  //   addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
+  //   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
+  //   menu: true,
+  // });
+
+  const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+  const router = useRouter();
+
+  const faultImg=ref(null);
+  const formData=ref({});
+  const faultDetails=ref(null);
+  onMounted(() => {
+    // console.log("crudRef", crudRef)
+
+    search.value.escalationFaultId=props.escalationId;
+    dataNoPageList();
+    formData.value.escalationFaultId=props.escalationId;
+    getFault(formData).then((data) => {
+
+      faultImg.value=data.data;
+      console.info(faultImg.value);
+    });
+    getFaultDetails(props.escalationId).then((data) => {
+
+      faultDetails.value=data.data;
+      for(let i=0;i<dicts.disposal_measures_type.length;i++){
+        if(faultDetails.value.disposalMeasures===dicts.disposal_measures_type[i].dictValue){
+          faultDetails.value.disposalMeasures=dicts.disposal_measures_type[i].dictLabel;
+        }
+      }
+    });
+
+  });
+
+
+
+
+  // 设置表格列或者其他自定义的option
+  option.value = Object.assign(option.value, {
+    addBtn: false,
+    editBtn:false,
+    delBtn:false,
+    viewBtn:false,
+    menu:false,
+    column: [
+      {
+        label: "缺陷大类",
+        prop: "bugType",
+        dicData:dicts.defect_mana,
+        props: { label: "dictLabel", value: "dictValue" },
+      },
+      {
+        label: "缺陷小类",
+        prop: "bugName",
+      },
+    ],
+  });
+
+
+</script>
+<style>
+  .title-fault{
+    float: left;
+    width: 300px;
+  }
+  .fault{
+    margin-left: 15px;
+    margin-top: 10px;
+    display: block;
+    overflow: hidden;
+  }
+  .fault-image{
+    width: 150px;
+    float: left;
+    margin-left: 10px;
+    overflow: hidden;
+  }
+  .image-title{
+    margin-bottom: 15px;
+  }
+  .fault-img{
+    display: inline-block;
+  }
+  .fault-detail{
+    margin-top: 20px;
+  }
+</style>

+ 144 - 0
src/views/quality/faultHandle/index.vue

@@ -0,0 +1,144 @@
+<template>
+  <div class="mainContentBox">
+
+
+    <avue-crud
+      ref="crudRef"
+      v-model:search="search"
+      v-model="form"
+      :data="data"
+      :option="option"
+      v-model:page="page"
+      @row-save="createRow"
+      @row-update="updateRow"
+      @row-del="deleteRow"
+      @search-change="searchChange"
+      @search-reset="resetChange"
+      @size-change="dataList"
+      @current-change="dataList"
+      @selection-change="selectionChange"
+    >
+      <template #menu-left>
+        <el-radio-group v-model="radio1" size="large" @change="searchChangeState">
+          <el-radio-button label="未完成" value="1" />
+          <el-radio-button label="已完成" value="3" />
+        </el-radio-group>
+       </template>
+      <template #menu="{row,index,type}">
+        <el-button @click="viewFault(row)"
+                   icon="el-icon-view"
+                   text
+                   type="primary"
+        >查看</el-button>
+        <el-button @click="faultHandle(row)"
+                   icon="el-icon-link"
+                   text
+                   type="primary"
+        >处理</el-button>
+      </template>
+
+
+    </avue-crud>
+
+    <el-dialog
+      v-model="dialog.visible"
+      :title="dialog.title"
+      width="900px"
+      @close="dialog.visible = false"
+    >
+
+        <fault-detail  :escalationFaultId="fault.id" :dialog="dialog"/>
+
+
+    </el-dialog>
+
+    <el-dialog
+      v-model="dialog1.visible"
+      :title="dialog1.title"
+      width="900px"
+      @close="dialog1.visible = false"
+    >
+      <fault-handle  :escalationId="faultDetail.id" :dialog1="dialog1"/>
+    </el-dialog>
+  </div>
+</template>
+<script setup>
+  import { ref, getCurrentInstance } from "vue";
+  import { useCrud } from "@/hooks/userCrud";
+  import ButtonPermKeys from "@/common/configs/buttonPermission";
+  import { columns } from "./columns";
+  import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
+  const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+  // 数据字典相关
+  const { dicts } = useDictionaryStoreHook();
+
+  const test = () => {
+    isShowTable.value = true;
+    tableType.value = tableType.value == 1 ? 2 : 1;
+  };
+  const dialog = reactive({
+    title: "报故详情",
+    visible: false,
+  });
+  const dialog1 = reactive({
+    title: "报故处理",
+    visible: false,
+  });
+
+
+  const fault=ref(null);
+  const faultDetail=ref(null);
+  const faultHandle=(row)=>{
+
+    faultDetail.value=row;
+
+    dialog1.visible=true;
+  }
+  // 传入一个url,后面不带/
+  const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+    useCrud({
+      src: "/api/v1/process/escalationFault",
+    });
+  const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+    Methords; //增删改查
+  const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+  const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+  // checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
+  // const permission = reactive({
+  //   delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
+  //   addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
+  //   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
+  //   menu: true,
+  // });
+
+  const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+  const router = useRouter();
+  const viewFault = (row) => {
+
+    fault.value=row;;
+    dialog.visible=true;
+  };
+  onMounted(() => {
+    // console.log("crudRef", crudRef)
+    search.value.state=radio1.value;
+    dataList();
+  });
+
+  const searchChangeState=()=>{
+    search.value.state=radio1.value;
+    dataList();
+  }
+
+  const radio1 = ref('1')
+
+  // 设置表格列或者其他自定义的option
+  option.value = Object.assign(option.value, {
+    addBtn: false,
+    editBtn:false,
+    delBtn:false,
+    viewBtn:false,
+    column: columns,
+  });
+
+
+</script>