Przeglądaj źródła

修改完善禅道的bug

ooo 1 rok temu
rodzic
commit
e6360c1166

+ 4 - 3
src/api/craft/route/index.ts

@@ -1,10 +1,11 @@
 import request from "@/utils/request";
 
 // 复制工艺路线
-export function copyRoute(id: string) {
+export function copyRoute(data: object) {
   return request({
-    url: `/api/v1/op/route/copyAdd/${id}`,
-    method: "get",
+    url: `/api/v1/op/route/copyAdd`,
+    method: "post",
+    data: data,
   });
 }
 

+ 8 - 0
src/api/material/index.ts

@@ -20,3 +20,11 @@ export function getMaterialDetailsByseqNo(seqNo: String): AxiosPromise<any> {
     method: "get",
   });
 }
+
+export function getOperationCompent(opId: String): AxiosPromise<any> {
+  return request({
+    url: "/api/v1/op/compent/get/" + opId,
+    method: "get",
+  });
+}
+

+ 24 - 22
src/views/base/craftManagement/defectMana/index.vue

@@ -116,31 +116,33 @@ const switchOp = [
 option.value = Object.assign(option.value, {
   selection: true,
   column: [
-	{
-	  label: "缺陷类型",
-	  prop: "bugType",
-	  minWidth: 200,
-	  search: true,
-	  overHidden: true,
-	  rules: [
-	    {
-	      required: true,
-	      message: "缺陷类型不能为空",
-	      trigger: "change",
-	    },
-	  ],
-	  type: "select",
-	  dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.defect_mana,
-	  props: {
-	    label: "dictLabel",
-	    value: "dictValue",
-	  },
-	},
+    {
+      label: "缺陷类型",
+      prop: "bugType",
+      minWidth: 200,
+      search: true,
+      overHidden: true,
+      rules: [
+        {
+          required: true,
+          message: "缺陷类型不能为空",
+          trigger: "change",
+        },
+      ],
+      type: "select",
+      dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.defect_mana,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+    },
     {
       label: "缺陷编码",
       prop: "bugCode",
       span: 12,
       search: true,
+      disabled: false,
+      overHidden: true,
       rules: [
         {
           required: true,
@@ -162,7 +164,7 @@ option.value = Object.assign(option.value, {
         },
       ],
     },
-	{
+    {
       label: "备注",
       prop: "remark",
       span: 12,
@@ -174,7 +176,7 @@ option.value = Object.assign(option.value, {
           trigger: "blur",
         },
       ],
-    }
+    },
   ],
 });
 </script>

+ 75 - 72
src/views/base/craftManagement/process/index.vue

@@ -229,6 +229,7 @@ option.value = Object.assign(option.value, {
     {
       label: "人工工时",
       prop: "preparationTime",
+      type: "number",
       span: 12,
       rules: [
         {
@@ -241,6 +242,7 @@ option.value = Object.assign(option.value, {
     {
       label: "标准机时",
       prop: "timeingNum",
+      type: "number",
       span: 12,
       rules: [
         {
@@ -253,6 +255,7 @@ option.value = Object.assign(option.value, {
     {
       label: "标准工时",
       prop: "standardWorktime",
+      type: "number",
       span: 12,
       rules: [
         {
@@ -302,7 +305,7 @@ option.value = Object.assign(option.value, {
       label: "是否可跳过",
       prop: "skipped",
       span: 8,
-	  hide: true,
+      hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
@@ -310,26 +313,26 @@ option.value = Object.assign(option.value, {
     {
       label: "是否禁用",
       prop: "enabled",
-	  hide: true,
+      hide: true,
       span: 8,
       type: "switch",
       dicData: switchOp,
       value: 0,
     },
-   //  {
-   //    label: "是否外协",
-   //    prop: "externalCooperation",
-   //    span: 8,
-	  // hide: true,
-   //    type: "switch",
-   //    dicData: switchOp,
-   //    value: 0,
-   //  },
+    //  {
+    //    label: "是否外协",
+    //    prop: "externalCooperation",
+    //    span: 8,
+    // hide: true,
+    //    type: "switch",
+    //    dicData: switchOp,
+    //    value: 0,
+    //  },
     {
       label: "是否首检",
       prop: "firstCheck",
       span: 8,
-	  hide: true,
+      hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
@@ -338,7 +341,7 @@ option.value = Object.assign(option.value, {
       label: "是否巡检",
       prop: "inspection",
       span: 8,
-	  hide: true,
+      hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
@@ -347,82 +350,82 @@ option.value = Object.assign(option.value, {
       label: "是否自检",
       prop: "selfCheck",
       span: 8,
-	  hide: true,
+      hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
     },
-   //  {
-   //    label: "是否工艺数量",
-   //    prop: "common",
-   //    span: 8,
-	  // hide: true,
-   //    type: "switch",
-   //    dicData: switchOp,
-   //    value: 0,
-   //  },
-   //  {
-   //    label: "是否分批",
-   //    prop: "batch",
-   //    span: 8,
-	  // hide: true,
-   //    type: "switch",
-   //    dicData: switchOp,
-   //    value: 0,
-   //  },
+    //  {
+    //    label: "是否工艺数量",
+    //    prop: "common",
+    //    span: 8,
+    // hide: true,
+    //    type: "switch",
+    //    dicData: switchOp,
+    //    value: 0,
+    //  },
+    //  {
+    //    label: "是否分批",
+    //    prop: "batch",
+    //    span: 8,
+    // hide: true,
+    //    type: "switch",
+    //    dicData: switchOp,
+    //    value: 0,
+    //  },
     {
       label: "是否合批",
       prop: "merge",
       span: 8,
-	  hide: true,
+      hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
-	  //联动隐藏
-	  control:  (val, form) =>{
-	  		  return {
-	  		  	mergeNum: {
-	  		  	  display: val == 1 ? true : false
-	  		  	}
-	  		  }
-	  }
+      //联动隐藏
+      control: (val, form) => {
+        return {
+          mergeNum: {
+            display: val == 1 ? true : false,
+          },
+        };
+      },
+    },
+    {
+      label: "是否委外",
+      prop: "outsourcing",
+      span: 8,
+      hide: true,
+      type: "switch",
+      dicData: switchOp,
+      // click: ({ column,value }) => {
+      //  if(value == 0){
+      // console.log('column',column)
+      //  }
+      // },
+      //联动隐藏
+      control: (val, form) => {
+        return {
+          outTime: {
+            display: val == 1 ? true : false,
+          },
+        };
+      },
+      value: 0,
     },
-	{
-	  label: "是否委外",
-	  prop: "outsourcing",
-	  span: 8,
-	  hide: true,
-	  type: "switch",
-	  dicData: switchOp,
-	  // click: ({ column,value }) => {
-		 //  if(value == 0){
-			// console.log('column',column)  
-		 //  }
-	  // },
-	  //联动隐藏
-	  control:  (val, form) =>{
-		  return {
-		  	outTime: {
-		  	  display: val == 1 ? true : false
-		  	}
-		  }
-	  },
-	  value: 0,
-	},
     {
       label: "合批数量",
       prop: "mergeNum",
       span: 5,
-	  hide: true,
-	  display: false,
+      hide: true,
+      display: false,
       value: 0,
     },
     {
       label: "分批数量",
       prop: "batchNum",
       span: 5,
-	  display: false,
-	  hide: true,
+      display: false,
+      hide: true,
       value: 0,
       // slot:true, // 自定义列
     },
@@ -430,15 +433,15 @@ option.value = Object.assign(option.value, {
       label: "委外时间",
       prop: "outTime",
       span: 5,
-	  display: false,
-	  hide: true,
+      display: false,
+      hide: true,
       value: 0,
       // slot:true, // 自定义列
     },
     {
       label: "前置时间",
       prop: "forceTime",
-	  hide: true,
+      hide: true,
       span: 6,
       value: 0,
       rules: [
@@ -453,14 +456,14 @@ option.value = Object.assign(option.value, {
     {
       label: "工序描述",
       prop: "operationDesc",
-	  hide: true,
+      hide: true,
       span: 24,
       type: "textarea",
     },
     {
       label: "备注",
       prop: "remark",
-	  hide: true,
+      hide: true,
       span: 24,
       type: "textarea",
     },

+ 2 - 2
src/views/base/craftManagement/route/components/configs.ts

@@ -100,8 +100,8 @@ export const getTableConfig = (id: string) => {
           hide: true,
           value: id,
         },
-        { label: "工序点检名称", prop: "checkName" },
-        { label: "工序点检编码", prop: "checkCode" },
+        { label: "点检名称", prop: "checkName" },
+        { label: "点检编码", prop: "checkCode" },
         { label: "内容", prop: "content" },
         {
           label: "单位",

+ 2 - 1
src/views/base/craftManagement/route/components/processComponent.vue

@@ -149,7 +149,8 @@ const clickToolCom = (com, index) => {
   tipTitle = '编辑'+com.compentName
   selectIndex.value = index;
   currentCom.value = com;
-  if (com.compentType === "mingpai" || com.compentType === "duomeiticaiji") {
+  if (com.compentType === "mingpai" || com.compentType === "duomeiticaiji"
+   || com.compentType === "tiaoshipipei" || com.compentType === "jingu") {
     isNoneedEdit.value = true;
   } else {
     tableType.value = com.compentType;

+ 74 - 40
src/views/base/craftManagement/route/index.vue

@@ -21,24 +21,24 @@
         <el-tag v-else type="info">未绑定</el-tag>
       </template>
 
-	  <!-- :disabled="row.usable == '1' ? false : true" -->
-		<template #menu-right="{}">
-		  <el-dropdown split-button
-		    >导入
-		    <template #dropdown>
-		      <el-dropdown-menu>
-		        <el-dropdown-item
-		          @click="downloadTemplate('/api/v1/op/route/template')"
-		        >
-		          <i-ep-download />下载模板
-		        </el-dropdown-item>
-		        <el-dropdown-item @click="importExcelData">
-		          <i-ep-top />导入数据
-		        </el-dropdown-item>
-		      </el-dropdown-menu>
-		    </template>
-		  </el-dropdown>
-		</template>
+      <!-- :disabled="row.usable == '1' ? false : true" -->
+      <template #menu-right="{}">
+        <el-dropdown split-button
+          >导入
+          <template #dropdown>
+            <el-dropdown-menu>
+              <el-dropdown-item
+                @click="downloadTemplate('/api/v1/op/route/template')"
+              >
+                <i-ep-download />下载模板
+              </el-dropdown-item>
+              <el-dropdown-item @click="importExcelData">
+                <i-ep-top />导入数据
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </template>
+        </el-dropdown>
+      </template>
       <template #menu="{ row }">
         <el-button
           link
@@ -54,11 +54,32 @@
     </avue-crud>
     <CommonTable
       ref="ctableRef"
-      tableTitle="测试title"
+      tableTitle="添加产品"
       tableType="MARTERIAL"
       @selected-sure="onSelectedFinish"
     />
     <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
+    <el-dialog
+      v-model="centerDialogVisible"
+      title="重命名"
+      width="500"
+      align-center
+    >
+      <el-form :model="tmpForm" label-width="auto" style="max-width: 600px">
+        <el-form-item label="工艺路线编号">
+          <el-input v-model="tmpForm.processRouteCode" />
+        </el-form-item>
+        <el-form-item label="工艺路线名称">
+          <el-input v-model="tmpForm.processRouteName" />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="centerDialogVisible = false">取消</el-button>
+          <el-button type="primary" @click="renameRoute()"> 确定 </el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 <script setup>
@@ -92,8 +113,9 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
 //   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
 //   menu: true,
 // });
-
+let centerDialogVisible = ref(false);
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+const tmpForm = ref({});
 
 onMounted(() => {
   // console.log("crudRef", crudRef)
@@ -119,7 +141,7 @@ const importExcelData = () => {
 const ctableRef = ref(null);
 
 const onSelectedFinish = (selectedValue) => {
-  search.value.prodtName = selectedValue.materialName;
+  // search.value.prodtName = selectedValue.materialName;
   form.value.prodtName = selectedValue.materialName;
   form.value.prodtCode = selectedValue.materialCode;
   form.value.prodtModel = selectedValue.spec;
@@ -132,23 +154,35 @@ const startChooseProduct = () => {
 
 // 已经绑定了工序的可以复制,跟后端HT商量只传id即可。
 const copyRow = (row) => {
-	if(row.usable == 0){
-		ElMessage.error("该路线未被绑定!")
-		return
-	}
-	  copyRoute(row.id).then(() => {
-		page.currentPage = 1;
-		dataList();
-	  });
+  if (row.usable == 0) {
+    ElMessage.error("该路线未被绑定!");
+    return;
+  }
+  tmpForm.value.id = row.id;
+  centerDialogVisible.value = true;
+};
+
+const renameRoute = () => {
+  tmpForm.value.id;
+  tmpForm.value.processRouteCode;
+  tmpForm.value.processRouteName;
+  copyRoute(tmpForm.value).then(() => {
+    tmpForm.value.id = undefined;
+    tmpForm.value.processRouteCode = undefined;
+    tmpForm.value.processRouteName = undefined;
+    page.currentPage = 1;
+    dataList();
+  });
+  centerDialogVisible.value = false;
 };
 
 const router = useRouter();
 // 绑定工序
 const bindProcess = (row) => {
   router.push({
-		path: `/base/craftManagement/bindProcess/${row.id}`,
-		query: {prodtCode:row.prodtCode}
-	});
+    path: `/base/craftManagement/bindProcess/${row.id}`,
+    query: { prodtCode: row.prodtCode },
+  });
 };
 
 // 设置表格列或者其他自定义的option
@@ -165,13 +199,13 @@ option.value = Object.assign(option.value, {
       addDisplay: true,
       editDisabled: true,
       overHidden: true,
-	  rules: [
-	    {
-	      required: true,
-	      message: "工艺路线名称不能为空",
-	      trigger: "blur",
-	    },
-	  ],
+      rules: [
+        {
+          required: true,
+          message: "工艺路线名称不能为空",
+          trigger: "blur",
+        },
+      ],
     },
     {
       label: "工艺路线名称",
@@ -289,7 +323,7 @@ option.value = Object.assign(option.value, {
       width: 100,
       search: false,
       filterable: true,
-	  hide: true,
+      hide: true,
       addDisplay: false,
       editDisplay: false,
       type: "radio",

+ 23 - 22
src/views/base/defectMana/index.vue

@@ -116,31 +116,32 @@ const switchOp = [
 option.value = Object.assign(option.value, {
   selection: true,
   column: [
-	{
-	  label: "缺陷类型",
-	  prop: "bugType",
-	  minWidth: 200,
-	  search: true,
-	  overHidden: true,
-	  rules: [
-	    {
-	      required: true,
-	      message: "缺陷类型不能为空",
-	      trigger: "change",
-	    },
-	  ],
-	  type: "select",
-	  dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.defect_mana,
-	  props: {
-	    label: "dictLabel",
-	    value: "dictValue",
-	  },
-	},
+    {
+      label: "缺陷类型",
+      prop: "bugType",
+      minWidth: 200,
+      search: true,
+      overHidden: true,
+      rules: [
+        {
+          required: true,
+          message: "缺陷类型不能为空",
+          trigger: "change",
+        },
+      ],
+      type: "select",
+      dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.defect_mana,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+    },
     {
       label: "缺陷编码",
       prop: "bugCode",
       span: 12,
       search: true,
+      disabled: true,
       rules: [
         {
           required: true,
@@ -162,7 +163,7 @@ option.value = Object.assign(option.value, {
         },
       ],
     },
-	{
+    {
       label: "备注",
       prop: "remark",
       span: 12,
@@ -174,7 +175,7 @@ option.value = Object.assign(option.value, {
           trigger: "blur",
         },
       ],
-    }
+    },
   ],
 });
 </script>

+ 74 - 0
src/views/demo/traceabilityComDemo.vue

@@ -0,0 +1,74 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+      ref="crudRef"
+      v-model:search="search"
+      v-model="form"
+      :data="data"
+      :option="option"
+      v-model:page="page"
+    />
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
+import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
+
+// 数据字典相关
+const { dicts } = useDictionaryStoreHook();
+
+// 传入一个url,后面不带/
+const {
+  form,
+  data,
+  option,
+  search,
+  page,
+  toDeleteIds,
+  Methords,
+  Utils,
+  commonConfig,
+} = useCrud({
+  src: "/api/v1/process/info",
+});
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+onMounted(() => {
+  commonConfig.value.params = { seqNo: "-1" };
+  dataList();
+});
+
+option.value = Object.assign(option.value, {
+  selection: false,
+  column: [
+    {
+      label: "缺陷类型",
+      prop: "bugType",
+      minWidth: 200,
+      search: true,
+      overHidden: true,
+      rules: [
+        {
+          required: true,
+          message: "缺陷类型不能为空",
+          trigger: "change",
+        },
+      ],
+      type: "select",
+      dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.defect_mana,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+    },
+  ],
+});
+</script>

+ 109 - 0
src/views/pro/traceability/components/traceabilityCom.vue

@@ -0,0 +1,109 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+      ref="crudRef2"
+      v-model:search="search"
+      v-model="form"
+      :data="data"
+      :option="option"
+      v-model:page="page"
+    />
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
+import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
+
+// 数据字典相关
+const { dicts } = useDictionaryStoreHook();
+
+// 传入一个url,后面不带/
+const {
+  form,
+  data,
+  option,
+  search,
+  page,
+  toDeleteIds,
+  Methords,
+  Utils,
+  commonConfig,
+} = useCrud({
+  src: "/api/v1/process/info",
+});
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+const refreshTra = (seqNo) => {
+  commonConfig.value.params = { seqNo: seqNo };
+  dataList();
+};
+defineExpose({ refreshTra });
+onMounted(() => {});
+
+option.value = Object.assign(option.value, {
+  selection: false,
+  border: true,
+  index: false,
+  expandLevel: 3,
+  headerAlign: "center",
+  align: "center",
+  labelWidth: 100,
+  addBtn: false,
+  menu: false,
+  header: false,
+  column: [
+    {
+      label: "工序名称",
+      prop: "operationName",
+    },
+    {
+      label: "工段",
+      prop: "workSection",
+      type: "select",
+      dicData: dicts.workshop_section,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+    },
+    {
+      label: "状态",
+      prop: "currentState",
+      search: false,
+    },
+    {
+      label: "开始时间",
+      prop: "realStartWhen",
+      search: false,
+    },
+    {
+      label: "结束时间",
+      prop: "realEndWhen",
+      search: false,
+    },
+    {
+      label: "操作人",
+      prop: "creator",
+      search: false,
+    },
+    {
+      label: "工时",
+      prop: "standardWorktime",
+      search: false,
+    },
+    {
+      label: "工步",
+      prop: "operationSort",
+      search: false,
+    },
+  ],
+});
+</script>

+ 170 - 146
src/views/pro/traceability/index.vue

@@ -1,154 +1,178 @@
 <template>
-    <div class="mainContentBox common-layout">
-        
-		<el-container>
-	    <el-aside width="600px" style="height: 800px">
-	      <avue-crud
-	              ref="crudRef"
-	              v-model:search="search"
-	              v-model="form"
-	              :data="data"
-	              :option="option"
-	              v-model:page="page"
-	      		@cell-click="handleCellClick">
-	      	<template #seqNo="{ row }">
-	      	  <el-tag :type="chooseTagType(row.seqNo,'css')">{{chooseTagType(row.seqNo,'text')}}</el-tag>
-	      	  {{row.seqNo}}
-	      	</template>
-	      </avue-crud>
-	    </el-aside>
-			<el-container>
-	            <el-header style="height: 20%;">
-					<el-descriptions title="产品信息回顾" border>
-					    <el-descriptions-item label="产品名称">{{productReviewInfo.materialName}}</el-descriptions-item>
-					    <el-descriptions-item label="序列号">{{productReviewInfo.seqNo}}</el-descriptions-item>
-					    <el-descriptions-item label="物料编号">{{productReviewInfo.materialCode}}</el-descriptions-item>
-						<el-descriptions-item label="产品规格">{{productReviewInfo.materialModel}}</el-descriptions-item>
-						<el-descriptions-item label="铭牌号">-</el-descriptions-item>
-					    <el-descriptions-item label="Remarks">
-					      <el-tag size="small">否</el-tag>
-					    </el-descriptions-item>
-					    <el-descriptions-item label="工单出站">5</el-descriptions-item>
-					    <el-descriptions-item label="交付日期">{{productReviewInfo.planStartEnd}}</el-descriptions-item>
-					</el-descriptions>
-				</el-header>
-	            <el-main>
-					<!-- <el-container>
-					      <el-header style="background-color: black;height: 30%;padding: 0%;">
-							
-						  </el-header>
-					      <el-main style="background-color: red;">Main</el-main>
-					</el-container> -->
-					<el-tabs type="border-card">
-					  <el-tab-pane label="生产履历">生产履历</el-tab-pane>
-					  <el-tab-pane label="已采物料">已采物料</el-tab-pane>
-					  <el-tab-pane label="图片采集">图片采集</el-tab-pane>
-					  <el-tab-pane label="缺陷项">缺陷项</el-tab-pane>
-					</el-tabs>
-				</el-main>
-	        </el-container>
-	  </el-container>	
-    </div>
+  <div class="mainContentBox common-layout">
+    <el-container>
+      <el-aside width="600px" style="height: 800px">
+        <avue-crud
+          ref="crudRef"
+          v-model:search="search"
+          v-model="form"
+          :data="data"
+          :option="option"
+          v-model:page="page"
+          @cell-click="handleCellClick"
+        >
+          <template #seqNo="{ row }">
+            <el-tag :type="chooseTagType(row.seqNo, 'css')">{{
+              chooseTagType(row.seqNo, "text")
+            }}</el-tag>
+            {{ row.seqNo }}
+          </template>
+        </avue-crud>
+      </el-aside>
+      <el-container>
+        <el-header style="height: 20%">
+          <el-descriptions title="产品信息回顾" border>
+            <el-descriptions-item label="产品名称">{{
+              productReviewInfo.materialName
+            }}</el-descriptions-item>
+            <el-descriptions-item label="序列号">{{
+              productReviewInfo.seqNo
+            }}</el-descriptions-item>
+            <el-descriptions-item label="物料编号">{{
+              productReviewInfo.materialCode
+            }}</el-descriptions-item>
+            <el-descriptions-item label="产品规格">{{
+              productReviewInfo.materialModel
+            }}</el-descriptions-item>
+            <el-descriptions-item label="铭牌号">-</el-descriptions-item>
+            <el-descriptions-item label="Remarks">
+              <el-tag size="small">否</el-tag>
+            </el-descriptions-item>
+            <el-descriptions-item label="工单出站">5</el-descriptions-item>
+            <el-descriptions-item label="交付日期">{{
+              productReviewInfo.planStartEnd
+            }}</el-descriptions-item>
+          </el-descriptions>
+        </el-header>
+        <el-main>
+          <el-tabs type="border-card">
+            <el-tab-pane label="生产履历">
+              <TraceabilityCom ref="traceabilityComRef" />
+            </el-tab-pane>
+            <el-tab-pane label="已采物料">
+              <template #label>
+                <span
+                  >已采物料
+                  <el-badge value="8" class="item" type="primary" />
+                </span>
+              </template>
+              已采物料
+            </el-tab-pane>
+            <el-tab-pane label="图片采集">图片采集</el-tab-pane>
+            <el-tab-pane label="缺陷项">缺陷项</el-tab-pane>
+          </el-tabs>
+        </el-main>
+      </el-container>
+    </el-container>
+  </div>
 </template>
 <script setup>
-    import { ref, getCurrentInstance } from "vue";
-    import { useCrud } from "@/hooks/userCrud";
-    import ButtonPermKeys from "@/common/configs/buttonPermission";
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
 
-    import { useCommonStoreHook } from "@/store";
-	import {
-	  getMaterialDetailsByseqNo,
-	} from "@/api/material";
-    const { isShowTable, tableType } = toRefs(useCommonStoreHook());
-    const test = () => {
-        isShowTable.value = true;
-        tableType.value = tableType.value == 1 ? 2 : 1;
-    };
+import { useCommonStoreHook } from "@/store";
+import { getMaterialDetailsByseqNo, getOperationCompent } from "@/api/material";
+import TraceabilityCom from "@/views/pro/traceability/components/traceabilityCom.vue";
 
-    // 传入一个url,后面不带/
-    const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
-            useCrud({
-                src: "/api/v1/process/web/traceability",
-            });
-    const { dataList, createRow, updateRow, deleteRow } = Methords; //增删改查
-    const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
-    const { checkBtnPerm } = Utils; //按钮权限等工具
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/process/web/traceability",
+  });
 
-    const crudRef = ref(null); //crudRef.value 获取avue-crud对象
-	const chooseTagType = (row,type) => {
-		let daynamicType = ''
-		if(type == 'text'){
-			daynamicType = row.startsWith("DD") ? '订单' : (row.startsWith("GD") ? '工单' : '序列号')
-		}else{
-			daynamicType = row.startsWith("DD") ? 'success' : (row.startsWith("GD") ? 'warning' : 'primary')
-		}
-	  return daynamicType
-	};
-	
-	let productReviewInfo = {
-		materialName:'',
-		seqNo:'',
-		materialCode:'',
-		materialModel:'',
-		planStartEnd:'',
-		workOrderCode:''
-	}
-	const handleCellClick = (row, column, event) => {
-	      // 点击行时触发的逻辑
-		  if(!row.children && row.seqNo && row.seqNo.length > 16){
-			if(row.workOrderCode == productReviewInfo.workOrderCode){
-				return
-			}
-			getMaterialDetailsByseqNo(row.seqNo).then(({ data }) => {
-				productReviewInfo = {...data}
-				productReviewInfo.workOrderCode = row.workOrderCode
-				// productReviewInfo.materialName = data.materialName
-				console.log('productReviewInfo',productReviewInfo)
-			  }
-			);
-		  }
-	};
-    // 设置表格列或者其他自定义的option
-    option.value = Object.assign(option.value, {
-        // selection: true,
-		excelBtn: true,
-		border: true,
-		index: false,
-		expandLevel: 3,
-		headerAlign: 'center',
-		align: 'center',
-		tree: true,
-		labelWidth: 100,
-		addBtn:false, 
-		menu: false, 
-		header: false,
-		searchMenuSpan: 8, 
-		rowKey: 'seqNo',
-		rowParentKey: 'seqNo',
-        column: [
-				{
-					label: "Id",
-					prop: "id",
-					search: false,
-					hide: true,
-				},
-                {
-                    label: "产品序列号",
-                    prop: "seqNo",
-                    search: true,
-					searchLabelWidth: '100',
-					searchSpan:12,
-                },
-                {
-                    label: "数量",
-                    prop: "quantity",
-                    search: false,
-					width: '100'
-                }
-        ],
-    });
+const { dataList, createRow, updateRow, deleteRow } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+const traceabilityComRef = ref(null);
 
-    onMounted(() => {
-        dataList();
+const chooseTagType = (row, type) => {
+  let daynamicType = "";
+  if (type == "text") {
+    daynamicType = row.startsWith("DD")
+      ? "订单"
+      : row.startsWith("GD")
+        ? "工单"
+        : "序列号";
+  } else {
+    daynamicType = row.startsWith("DD")
+      ? "success"
+      : row.startsWith("GD")
+        ? "warning"
+        : "primary";
+  }
+  return daynamicType;
+};
+
+let productReviewInfo = reactive({
+  materialName: "",
+  seqNo: "",
+  materialCode: "",
+  materialModel: "",
+  planStartEnd: "",
+  workOrderCode: "",
+});
+const handleCellClick = (row, column, event) => {
+  // 点击行时触发的逻辑
+  if (!row.children && row.seqNo && row.seqNo.length > 16) {
+    if (productReviewInfo.seqNo != row.seqNo) {
+      traceabilityComRef.value.refreshTra(row.seqNo);
+    }
+    if (row.workOrderCode == productReviewInfo.workOrderCode) {
+      productReviewInfo.seqNo = row.seqNo;
+      return;
+    }
+    getMaterialDetailsByseqNo(row.seqNo).then(({ data }) => {
+      productReviewInfo = Object.assign(productReviewInfo, data);
+      productReviewInfo.workOrderCode = row.workOrderCode;
     });
-</script>
+  }
+};
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  // selection: true,
+  excelBtn: true,
+  border: true,
+  index: false,
+  expandLevel: 3,
+  headerAlign: "center",
+  align: "center",
+  tree: true,
+  labelWidth: 100,
+  addBtn: false,
+  menu: false,
+  header: false,
+  searchMenuSpan: 8,
+  rowKey: "seqNo",
+  rowParentKey: "seqNo",
+  column: [
+    {
+      label: "Id",
+      prop: "id",
+      search: false,
+      hide: true,
+    },
+    {
+      label: "产品序列号",
+      prop: "seqNo",
+      search: true,
+      searchLabelWidth: "100",
+      searchSpan: 12,
+    },
+    {
+      label: "数量",
+      prop: "quantity",
+      search: false,
+      width: "100",
+    },
+  ],
+});
+
+onMounted(() => {
+  dataList();
+});
+</script>