Explorar o código

修改工序的bug及增加了点检页面

ooo hai 1 ano
pai
achega
c60009d07f

+ 10 - 0
src/api/process/index.ts

@@ -20,4 +20,14 @@ export function updateOutSourceApply(
   });
 }
 
+export function traceabilityTabCount(
+    params: object
+): AxiosPromise<any> {
+  return request({
+    url: "/api/v1/process/web/traceability/tabCount",
+    method: "post",
+    data: params
+  });
+}
+
 

+ 4 - 2
src/views/base/craftManagement/route/components/bottomTable.vue

@@ -72,8 +72,9 @@ const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 
 const startCreat = () => {
   if (props.tableType === "wuliaocaiji") {
-	  //根据物料编码获取对应的物料BOM
-    commonTableRef.value && commonTableRef.value.startSelect({ materialCode: route.query.prodtCode });
+    //根据物料编码获取对应的物料BOM
+    commonTableRef.value &&
+      commonTableRef.value.startSelect({ materialCode: route.query.prodtCode });
   } else {
     crudRef.value && crudRef.value.rowAdd();
   }
@@ -100,6 +101,7 @@ const onSelectedFinish = (itemValue) => {
     form.value.itemName = itemValue.bomMaterialName;
     form.value.itemCode = itemValue.bomMaterialCode;
     form.value.itemModel = itemValue.bomMaterialAttribute;
+    form.value.recordVersion = itemValue.bomMaterialNumber;
     form.value.num = itemValue.bomMaterialNumber;
     form.value.traceType = "S";
     form.value.unit = itemValue.unitDictValue;

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

@@ -42,6 +42,7 @@ export const getTableConfig = (id: string) => {
           value: id,
         },
         { label: "物料名称", prop: "itemName" },
+		{ label: "物料版本号", prop: "recordVersion" },
         { label: "物料编码", prop: "itemCode" },
         { label: "物料规格", prop: "itemModel" },
         { label: "所需数量", prop: "num" },
@@ -177,6 +178,16 @@ export const getTableConfig = (id: string) => {
         },
         { label: "内容", prop: "content" },
         { label: "标题", prop: "title" },
+		{ label: "展示页数", prop: "showAppointPageNum",type: "number" },
+		{ label: "文件页数", prop: "pageNum",type: "number" },
+		{ label: "版本号", prop: "recordVersion",type: "number",
+		rules: [
+            {
+              required: true,
+              message: "版本号",
+              trigger: "blur",
+            },
+          ], },
         {
           label: "文件",
           prop: "imgUrl",

+ 128 - 0
src/views/base/defectCheck/index.vue

@@ -0,0 +1,128 @@
+<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="{ size }">
+        <el-button
+          :disabled="toDeleteIds.length < 1"
+          type="danger"
+          icon="el-icon-delete"
+          :size="size"
+          @click="multipleDelete"
+          >删除</el-button
+        >
+      </template>
+
+    </avue-crud>
+    <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
+  </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 } =
+  useCrud({
+    src: "/api/v1/op/base/check",
+  });
+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(() => {
+  // console.log("crudRef", crudRef)
+  dataList();
+});
+
+/**
+ * 上传excel相关
+ */
+const uploadRef = ref(null);
+const uploadFinished = () => {
+  // 上传完成后的刷新操作
+  page.currentPage = 1;
+  dataList();
+};
+const importExcelData = () => {
+  if (uploadRef.value) {
+    uploadRef.value.show("/api/v1/plan/order/import");
+  }
+};
+
+// 设置表格列或者其他自定义的option
+const switchOp = [
+  {
+    label: "",
+    value: 0,
+  },
+  {
+    label: "",
+    value: 1,
+  },
+];
+option.value = Object.assign(option.value, {
+  selection: true,
+  labelWidth: 110,
+  searchLabelWidth: 110,
+  column: [
+    {
+      label: "点检项名称",
+      prop: "checkName",
+      span: 12,
+      search: true,
+      editDisabled: true,
+      rules: [
+        {
+          required: true,
+          message: "点检项名称不能为空",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "点检项编码",
+      prop: "checkCode",
+	  editDisabled: true,
+      span: 12,
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "点检项编码不能为空",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "内容",
+      prop: "content",
+      span: 12,
+      search: false,
+    },
+  ],
+});
+</script>

+ 68 - 4
src/views/pro/traceability/index.vue

@@ -56,18 +56,68 @@
               <TraceabilityCom ref="traceabilityComRef" />
             </el-tab-pane>
             <el-tab-pane name="materialsComRef" label="已采物料">
+              <template #label>
+                <span
+                  >已采物料
+                  <el-badge
+                    :value="tabCount.materials"
+                    class="item"
+                    type="primary"
+                  />
+                </span>
+              </template>
               <MaterialsCom ref="materialsComRef" />
             </el-tab-pane>
             <el-tab-pane name="recordComRef" label="记录项">
+              <template #label>
+                <span
+                  >记录项
+                  <el-badge
+                    :value="tabCount.record"
+                    class="item"
+                    type="primary"
+                  />
+                </span>
+              </template>
               <RecordCom ref="recordComRef"
             /></el-tab-pane>
             <el-tab-pane name="checkComRef" label="点检判定">
+              <template #label>
+                <span
+                  >点检判定
+                  <el-badge
+                    :value="tabCount.check"
+                    class="item"
+                    type="primary"
+                  />
+                </span>
+              </template>
               <CheckCom ref="checkComRef" />
             </el-tab-pane>
-            <el-tab-pane name="equitComRef" label="设备使用"
-              ><EquitCom ref="equitComRef"
+            <el-tab-pane name="equitComRef" label="设备使用">
+              <template #label>
+                <span
+                  >设备使用
+                  <el-badge
+                    :value="tabCount.equit"
+                    class="item"
+                    type="primary"
+                  />
+                </span>
+              </template>
+              <EquitCom ref="equitComRef"
             /></el-tab-pane>
             <el-tab-pane name="faultComRef" label="报故记录">
+              <template #label>
+                <span
+                  >报故记录
+                  <el-badge
+                    :value="tabCount.fault"
+                    class="item"
+                    type="primary"
+                  />
+                </span>
+              </template>
               <FaultCom ref="faultComRef" />
             </el-tab-pane>
             <el-tab-pane name="bugComRef" label="缺陷项">缺陷项</el-tab-pane>
@@ -84,7 +134,7 @@
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
 import ButtonPermKeys from "@/common/configs/buttonPermission";
-
+import { traceabilityTabCount } from "@/api/process";
 import { useCommonStoreHook } from "@/store";
 import { getMaterialDetailsByseqNo, getOperationCompent } from "@/api/material";
 import TraceabilityCom from "@/views/pro/traceability/components/traceabilityCom.vue";
@@ -125,7 +175,9 @@ const tabNameComRef = new Map([
 let temRow = ref({});
 const tabsEvent = (pane, ev) => {
   defaultTabName.value = pane.props.name;
-  tabNameComRef.get(pane.props.name)?.value.refreshTra(temRow.value);
+  if (temRow.value.seqNo) {
+    tabNameComRef.get(pane.props.name)?.value.refreshTra(temRow.value);
+  }
 };
 
 const chooseTagType = (row, type) => {
@@ -156,6 +208,15 @@ let productReviewInfo = reactive({
   outNum: "",
 });
 
+let tabCount = reactive({
+  traceability: "",
+  materials: "",
+  record: "",
+  check: "",
+  equit: "",
+  fault: "",
+});
+
 const handleCellClick = (row, column, event) => {
   //获取出单的数量
   if (data.value) {
@@ -186,6 +247,9 @@ const handleCellClick = (row, column, event) => {
       productReviewInfo.workOrderCode = row.workOrderCode;
       // productReviewInfo.outNum =
     });
+    traceabilityTabCount({ seqNo: row.seqNo }).then(({ data }) => {
+      tabCount = Object.assign(tabCount, data);
+    });
   }
 };