Kaynağa Gözat

Merge remote-tracking branch 'origin/qingban' into qingban

lupeng 10 ay önce
ebeveyn
işleme
17d76c9497

+ 1 - 1
.env.development

@@ -10,7 +10,7 @@ VITE_APP_BASE_API = '/dev-api'
 # 上传文件接口地址
 VITE_APP_UPLOAD_URL = 'http://192.168.101.4:9000'
 # 开发接口地址
- VITE_APP_API_URL = 'http://192.168.101.4:7104'
+ VITE_APP_API_URL = 'http://192.168.101.168:7104'
 
 
 # 是否启用 Mock 服务

+ 1 - 0
.gitignore

@@ -17,3 +17,4 @@ package-lock.json
 pnpm-lock.yaml
 stats.html
 /docker/.run
+/dist

+ 1 - 1
index.html

@@ -14,7 +14,7 @@
     />
 
     <script src="/sortable/Sortable.min.js"></script>
-    <title>生产线综合管控采集平台</title>
+    <title>MES系统</title>
     <link rel="stylesheet" href="/LuckExcel/pluginsCss.css" />
     <link rel="stylesheet" href="/LuckExcel/plugins.css" />
     <link rel="stylesheet" href="/LuckExcel/luckysheet.css" />

+ 0 - 26
mock/menu.mock.ts

@@ -245,18 +245,6 @@ export default defineMock([
           },
           children: [
             {
-              path: "wang-editor",
-              component: "demo/wang-editor",
-              name: "WangEditor",
-              meta: {
-                title: "富文本编辑器",
-                icon: "",
-                hidden: false,
-                roles: ["ADMIN"],
-                keepAlive: true,
-              },
-            },
-            {
               path: "upload",
               component: "demo/upload",
               name: "Upload",
@@ -932,20 +920,6 @@ export default defineMock([
           perm: null,
           children: [
             {
-              id: 37,
-              parentId: 36,
-              name: "富文本编辑器",
-              type: "MENU",
-              path: "wang-editor",
-              component: "demo/wang-editor",
-              sort: 1,
-              visible: 1,
-              icon: "",
-              redirect: "",
-              perm: null,
-              children: [],
-            },
-            {
               id: 38,
               parentId: 36,
               name: "图片上传",

+ 1 - 1
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "生产线综合管控采集平台",
+  "name": "MES系统",
   "version": "1.0.0",
   "private": true,
   "type": "module",

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "version": "1.4"
+  "version": "1.7"
 }

+ 1 - 1
src/App.vue

@@ -27,7 +27,7 @@ const size = computed(
   () => appStore.size as "default" | "small" | "large" | undefined
 );
 const watermarkEnabled = computed(() => settingsStore.watermarkEnabled);
-console.log("测试提交新分支");
+
 // 明亮/暗黑主题水印字体颜色适配
 const fontColor = computed(() => {
   return settingsStore.theme === ThemeEnum.DARK

+ 16 - 0
src/api/excel/index.ts

@@ -94,3 +94,19 @@ export function setExcelData(data: any) {
     data,
   });
 }
+// 生产随工单Exceldata获取
+export function getProExcel(id: any) {
+  return request({
+    url: `/api/v1/ProcessFormData/getExcel/${id}`,
+    method: "get",
+  });
+}
+
+//生产随工单更新
+export function updateProExcel(data: any) {
+  return request({
+    url: `/api/v1/ProcessFormData/updateExcel`,
+    method: "post",
+    data,
+  });
+}

+ 10 - 15
src/layout/components/AppMain/index.vue

@@ -1,26 +1,21 @@
 <template>
   <section class="app-main">
-    <router-view>
-      <template #default="{ Component, route }">
-        <transition
-          enter-active-class="animate__animated animate__fadeIn"
-          mode="out-in"
-        >
-          <keep-alive :include="cachedViews">
-            <div class="main-container">
-              <component :is="Component" :key="route.path" />
-            </div>
-          </keep-alive>
-        </transition>
-      </template>
-    </router-view>
+    <div class="main-container">
+      <router-view v-slot="{ Component, route }">
+        <keep-alive :include="[cachedViews]">
+          <component :is="Component" :key="route.name" />
+        </keep-alive>
+      </router-view>
+    </div>
   </section>
 </template>
 
 <script setup lang="ts">
 import { useTagsViewStore } from "@/store";
 
-const cachedViews = computed(() => useTagsViewStore().cachedViews); // 缓存页面集合
+const cachedViews = computed(() =>
+  useTagsViewStore().cachedViews.concat(["CommonLayout"])
+); // 缓存页面集合
 </script>
 
 <style lang="scss" scoped>

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

@@ -32,6 +32,7 @@ export const useDictionaryStore = defineStore("dictionaryStore", () => {
     "excel_type",
     "excel_states",
     "process_state",
+    "form_params",
   ];
   const dicts = ref<{ [key: string]: any[] }>({});
 

+ 1 - 1
src/store/modules/permission.ts

@@ -142,7 +142,7 @@ export const usePermissionStore = defineStore("permission", () => {
         title: tmpRoute.menuName,
         icon: tmpRoute.icon,
         hidden: tmpRoute.visible === 1,
-        keepAlive: tmpRoute.keepAlive === 0,
+        keepAlive: tmpRoute.keepAlive === 1,
       };
 
       asyncRoutes.push(tmpRoute);

+ 4 - 4
src/views/base/craftManagement/process/index.vue

@@ -182,13 +182,13 @@ option.value = Object.assign(option.value, {
       ],
     },
     {
-      label: "加工要求",
+      label: "工艺条件",
       prop: "processAsk",
       span: 12,
       rules: [
         {
           required: true,
-          message: "加工要求不能为空",
+          message: "工艺条件不能为空",
           trigger: "blur",
         },
       ],
@@ -315,7 +315,7 @@ option.value = Object.assign(option.value, {
     //    dicData: switchOp,
     //    value: 0,
     //  },
-    {
+    /*{
       label: "是否首检",
       prop: "firstCheck",
       span: 8,
@@ -323,7 +323,7 @@ option.value = Object.assign(option.value, {
       type: "switch",
       dicData: switchOp,
       value: 0,
-    },
+    },*/
     {
       label: "是否巡检",
       prop: "inspection",

+ 7 - 2
src/views/base/craftManagement/route/bindConfig.ts

@@ -126,14 +126,14 @@ export const formOption = {
       dicData: switchOp,
       value: 0,
     },
-    {
+    /*{
       label: "是否首检",
       prop: "firstCheck",
       span: 24,
       type: "switch",
       dicData: switchOp,
       value: 0,
-    },
+    },*/
     {
       label: "是否巡检",
       prop: "inspection",
@@ -167,6 +167,11 @@ export const formOption = {
       value: 0,
     },
     {
+      label: "工艺条件",
+      prop: "processAsk",
+      span: 24,
+    },
+    {
       label: "工序描述",
       prop: "operationDesc",
       span: 24,

+ 78 - 13
src/views/base/craftManagement/route/bindProcess.vue

@@ -51,6 +51,7 @@
             @dragover="onDragOver"
             @dragleave="onDragLeave"
             @node-click="nodeClick($event)"
+            @edge-click="edgeClick($event)"
           >
             <template #edge-custom="props">
               <CustomConnectionLine v-bind="props" />
@@ -93,7 +94,15 @@
           <div v-if="!editStatus">
             <div class="btns">
               <el-button type="primary" @click="saveFlow">保存</el-button>
-              <el-button type="danger" @click="cancelFlow">取消</el-button>
+              <el-button type="danger" v-if="cancelStatus" @click="cancelFlow"
+                >取消</el-button
+              >
+              <el-button
+                type="info"
+                v-if="selectNode || selectLine"
+                @click="deleteFlow"
+                >删除</el-button
+              >
             </div>
           </div>
           <!-- 工序信息编辑模式 -->
@@ -140,6 +149,7 @@
     </div>
   </div>
 </template>
+
 <script setup>
 import {
   Back,
@@ -162,10 +172,13 @@ import {
   saveProcessInRoute,
   updateProcess,
 } from "@/api/craft/route/index";
-import { v4 as uuidv4 } from "uuid";
 import { formOption } from "./bindConfig";
 import { ElMessage } from "element-plus";
 import { useScreenshot } from "./screenshot.ts";
+defineOptions({
+  name: "bindProcess/:id?",
+});
+
 const { capture } = useScreenshot();
 const instance = useVueFlow();
 const { onConnect, addEdges, vueFlowRef, onEdgeUpdateEnd, applyEdgeChanges } =
@@ -174,18 +187,38 @@ const { onDragOver, onDrop, onDragLeave, isDragOver, onDragStart } =
   useDragAndDrop();
 const flowData = ref({ edges: [], nodes: [] });
 const flowDataCopy = ref({ edges: [], nodes: [] });
-provide("edges", flowData.value.edges);
 const currentProcess = ref({});
+const selectNode = ref(null);
+const selectLine = ref(null);
+provide("selectNode", selectNode);
 provide("currentProcess", currentProcess);
+provide("selectLine", selectLine);
+const edgeClick = (event) => {
+  if (!editStatus.value) {
+    selectLine.value = event.edge;
+    selectNode.value = null;
+  }
+};
 const nodeClick = (event) => {
-  if (!editStatus.value) return;
-  currentProcess.value = event.node;
-  if (!editStatus.value) return;
-  currentProcess.value = event.node;
-
-
+  if (!editStatus.value) {
+    selectNode.value = event.node;
+  } else {
+    currentProcess.value = event.node;
+  }
+};
+//当使用回退时清空选择的node
 
+const handleKeydown = () => {
+  if (selectNode.value != null) {
+    selectNode.value = null;
+  }
+  if (selectLine.value != null) {
+    selectLine.value = null;
+  }
 };
+onActivated(() => {
+  console.log("ac");
+});
 onConnect(addEdges);
 const getPng = () => {
   if (!vueFlowRef.value) {
@@ -196,10 +229,13 @@ const getPng = () => {
 };
 const nodeType = ref("custom");
 const editStatus = ref(false);
+provide("editStatus", editStatus);
 const changeEditStatus = () => {
   editStatus.value = !editStatus.value;
   if (editStatus.value == false) {
     currentProcess.value = {};
+  } else {
+    selectNode.value = null;
   }
 };
 const router = useRouter();
@@ -238,6 +274,25 @@ const saveFlow = async () => {
 };
 const cancelFlow = () => {
   flowData.value = JSON.parse(flowDataCopy.value);
+  if (selectNode.value != null) {
+    selectNode.value = null;
+  }
+  if (selectLine.value != null) {
+    selectLine.value = null;
+  }
+};
+const deleteFlow = () => {
+  const event = new KeyboardEvent("keydown", {
+    key: "Backspace",
+    keyCode: 8,
+    which: 8,
+    code: "Backspace",
+    bubbles: true,
+    cancelable: true,
+  });
+  document.dispatchEvent(event);
+  selectNode.value = null;
+  selectLine.value = null;
 };
 const saveInfo = async () => {
   flowData.value.nodes.forEach((item, index) => {
@@ -260,13 +315,18 @@ const loadTreeData = () => {
     list1.value = res.data ?? [];
   });
 };
-
+const cancelStatus = ref(true);
 //通过id获取现存储信息
 const loadProcessesFlow = async () => {
   const res = await processesByRouteId(route.params.id);
   if (res.data) {
-    flowData.value = JSON.parse(res.data.routeData);
-    flowDataCopy.value = res.data.routeData;
+    if (res.data.routeData && res.data.routeData != "") {
+      flowData.value = JSON.parse(res.data.routeData);
+      flowDataCopy.value = res.data.routeData;
+      cancelStatus.value = true;
+    } else {
+      cancelStatus.value = false;
+    }
   } else {
     flowDataCopy.value = JSON.stringify(flowData.value);
   }
@@ -287,11 +347,15 @@ const editProComponent = async () => {
 // 全局=======
 
 onMounted(() => {
+  console.log("mount");
   loadTreeData();
   loadProcessesFlow();
   flowBoxScreen();
+  window.addEventListener("keydown", handleKeydown);
+});
+onUnmounted(() => {
+  window.removeEventListener("keydown", handleKeydown);
 });
-
 const getNameByDictType = (dictValue) => {
   let str = "";
   dicts?.workshop_section?.forEach((element) => {
@@ -301,6 +365,7 @@ const getNameByDictType = (dictValue) => {
   });
   return str;
 };
+
 watch(
   () => flowData.value.edges,
   () => {

+ 0 - 4
src/views/base/craftManagement/route/components/CustomConnectionLine/index.vue

@@ -17,7 +17,6 @@
     />
     <!-- 箭头markEnd -->
     <path
-      :transform="transform"
       :d="`M ${targetX} ${targetY + 2} L ${targetX - 5} ${targetY - 10} L ${targetX + 5} ${targetY - 10} Z`"
       :fill="status ? 'gray' : 'black'"
       stroke="none"
@@ -51,9 +50,6 @@ watch(
   },
   { deep: true }
 );
-const transform = computed(() => {
-  return getArrowTransform(props);
-});
 function getArrowTransform(props: SmoothStepEdgeProps) {
   const { targetPosition } = props;
   if (targetPosition === "top") {

+ 1 - 0
src/views/base/excel/result/index.vue

@@ -1,4 +1,5 @@
 <template>
+  <!-- 暂未使用 -->
   <div class="mainContentBox">
     <avue-crud
       ref="crudRef"

+ 25 - 3
src/views/base/excel/template/index.vue

@@ -134,7 +134,20 @@
                   style="width: 410px"
                 >
                   <el-form-item label="数据名称" prop="paramName">
-                    <el-input v-model="addForm.paramName" />
+                    <el-select
+                      v-model="addForm.paramName"
+                      allow-create
+                      filterable
+                      default-first-option
+                      :reserve-keyword="false"
+                    >
+                      <el-option
+                        v-for="item in dicts.form_params"
+                        :key="item.dictLabel"
+                        :label="item.dictLabel"
+                        :value="item.dictValue"
+                      />
+                    </el-select>
                   </el-form-item>
                   <el-form-item label="同步坐标" prop="position">
                     <el-input :disabled="true" v-model="addForm.position" />
@@ -149,7 +162,10 @@
                     <el-input v-model="addForm.standard" />
                   </el-form-item>
                   <el-form-item label="数据来源" prop="source">
-                    <el-input v-model="addForm.source" />
+                    <el-select v-model="addForm.source">
+                      <el-option label="手动" value="手动" selected />
+                      <el-option label="自动" value="自动" />
+                    </el-select>
                   </el-form-item>
                   <el-form-item>
                     <div class="btns">
@@ -592,7 +608,7 @@ const useAddFormHook = () => {
     up: "",
     down: "",
     standard: "",
-    source: "",
+    source: "手动",
   });
   const addPage = () => {
     searchForm.value.pageNo = searchForm.value.pageNo + 1;
@@ -695,6 +711,12 @@ const useAddFormHook = () => {
         trigger: "blur",
       },
     ],
+    source: [
+      {
+        required: true,
+        trigger: "blur",
+      },
+    ],
   });
   return {
     formRef1,

+ 14 - 1
src/views/layout/index.vue

@@ -1,5 +1,18 @@
 <template>
   <div>
-    <router-view />
+    <router-view v-slot="{ Component, route }">
+      <keep-alive :include="cachedViews">
+        <component :is="Component" :key="route.fullPath" />
+      </keep-alive>
+    </router-view>
   </div>
 </template>
+<script setup lang="ts">
+import { useTagsViewStore } from "@/store";
+
+defineOptions({
+  name: "CommonLayout",
+});
+
+const cachedViews = computed(() => useTagsViewStore().cachedViews); // 缓存页面集合
+</script>

+ 5 - 6
src/views/plan/workOrder/components/check-task.vue

@@ -154,7 +154,7 @@ const getTemplate = async () => {
   const { data } = await getForm({
     pageNo: 1,
     pageSize: 9999999,
-    formType: 1
+    queryCheck: true
   });
   options.value = [];
   data.records.forEach((element) => {
@@ -167,9 +167,9 @@ const getTemplate = async () => {
 watch(
     () => props.workOrderInfo,
     () => {
-      form.value.workOrderCode = props.workOrderInfo.workOrderCode
-      info.value = props.workOrderInfo
-      search.value.workOrderCode = props.workOrderInfo.workOrderCode
+      taskForm.value.workOrderId = props.workOrderInfo.id
+      form.value.workOrderId = props.workOrderInfo.id
+      search.value.workOrderId = props.workOrderInfo.id
       dataList();
     }
 );
@@ -226,8 +226,7 @@ option.value = Object.assign(option.value, {
 });
 
 onMounted(() => {
-  info.value = props.workOrderInfo
-  taskForm.value.workOrderId = info.value.id
+  taskForm.value.workOrderId = props.workOrderInfo.id
   form.value.workOrderId = props.workOrderInfo.id
   search.value.workOrderId = props.workOrderInfo.id
   dataList();

+ 347 - 0
src/views/plan/workOrder/components/proWorkOrderExcel.vue

@@ -0,0 +1,347 @@
+<template>
+  <div class="dialogBody">
+    <!-- 生产随工单 -->
+    <div class="exView" :key="excelKey1">
+      <ExcelView
+        ref="excelViewRef"
+        :option="options"
+        @confirm="confirm"
+        v-model:data="exceldata"
+        :checkStatus="true"
+        :verifications="setting"
+      />
+    </div>
+    <div class="btns" v-if="options.edit !== false">
+      <el-button class="btn" type="success" @click="submit">确 定 </el-button>
+      <el-button class="btn" type="info" @click="cancel">取 消 </el-button>
+    </div>
+    <div class="btns" v-else>
+      <el-button class="btn" type="info" @click="cancel">返 回 </el-button>
+    </div>
+  </div>
+</template>
+<script setup lang="ts">
+import { ref } from "vue";
+import { updateProExcel } from "@/api/excel/index.ts";
+import ExcelView from "@/components/ExcelView/index.vue";
+const setting = ref([]);
+const props = defineProps({
+  data: {
+    type: Object,
+  },
+});
+const rowData = ref({});
+const emits = defineEmits(["update:modelValue", "close", "refresh"]);
+const excelKey1 = ref(false);
+const submit = async () => {
+  //@ts-ignore
+  excelViewRef.value.confirm();
+  const { data, code } = await updateProExcel({
+    excelData: JSON.stringify(exceldata.value),
+    id: rowData.value.id,
+  });
+  if (code == "200") {
+    ElMessage.success("修改成功!");
+    cancel();
+  }
+};
+const cancel = () => {
+  excelKey1.value = !excelKey1.value;
+  emits("close");
+};
+// 存放操作表格相关业务代码
+const useAddTemplateHook = () => {
+  //excelView 组件实例
+  const excelViewRef = ref(null);
+  //表格配置项
+  const options = ref({
+    //头部操作区域
+    opreaState: true,
+    //导入按钮展示
+    in: false,
+    //导出按钮展示
+    out: true,
+    print: true,
+    //编辑状态 false:为查看状态
+    edit: true,
+    //当前操作表格名称
+    inName: "",
+    opreaTitle: false,
+  });
+  //双向绑定表格data变量
+  const exceldata = ref(null);
+  //控制表格组件展示界面变量(包括表格展示页面和操作页面)
+  const excelStatus = ref(true);
+
+  //获取组件内实时数据赋值到外层
+  const confirm = (data: any) => {
+    exceldata.value = data;
+  };
+  return {
+    excelStatus,
+    options,
+    confirm,
+    exceldata,
+    excelViewRef,
+  };
+};
+const { options, confirm, exceldata, excelViewRef } = useAddTemplateHook();
+const useFormHook = () => {
+  //KEY告知组件刷新
+  const excelKey = ref(1);
+  //表单data
+  const formVlaue = reactive({ formType: null, formName: null, state: null });
+  //表单是否为编辑状态变量
+  const operaEditStatus = ref(false);
+  //选中的行id
+  const selectId = ref(null);
+  //表单ref实例
+  const formRef = ref(null);
+  //表单校验规则
+  const rules = reactive({
+    formName: [
+      {
+        required: true,
+        trigger: "blur",
+      },
+    ],
+    formType: [
+      {
+        required: true,
+        trigger: "blur",
+      },
+    ],
+    state: [
+      {
+        required: true,
+        trigger: "blur",
+      },
+    ],
+  });
+  //新增模版
+  const submitForm = async (formEl: any) => {
+    //@ts-ignore;
+    excelViewRef.value.confirm();
+    if (exceldata.value == null) return ElMessage.error("请提供表格数据!");
+    if (!formEl) return;
+    await formEl.validate(async (valid: any, fields: any) => {
+      if (valid) {
+        const { data, code } = await addExcel({
+          ...formVlaue,
+          excelData: exceldata.value,
+        });
+        if (code == "200") {
+          ElMessage.success("添加成功!");
+          resetData();
+          dataEditList();
+          editTep(data);
+        }
+      }
+    });
+  };
+  //更新行内信息
+  const updateExForm = async (formEl: any) => {
+    //@ts-ignore;
+    excelViewRef.value.saveCellData();
+    //@ts-ignore;
+    excelViewRef.value.confirm();
+    if (exceldata.value == null) return ElMessage.error("请提供表格数据!");
+    if (!formEl) return;
+    await formEl.validate(async (valid: any, fields: any) => {
+      if (valid) {
+        const { data, code } = await updateExcel({
+          ...formVlaue,
+          excelData: exceldata.value,
+          id: selectId.value,
+          settings: settings.value,
+        });
+        if (code == "200") {
+          ElMessage.success("修改成功!");
+          resetData();
+          dataEditList();
+        }
+      }
+    });
+  };
+  //表达数据重置
+  const resetForm = (formEl: any) => {
+    if (!formEl) return;
+    formEl.resetFields();
+  };
+  return {
+    formVlaue,
+    formRef,
+    rules,
+    selectId,
+    excelKey,
+    operaEditStatus,
+    submitForm,
+    resetForm,
+    updateExForm,
+  };
+};
+
+const {
+  formVlaue,
+  formRef,
+  rules,
+  selectId,
+  excelKey,
+  operaEditStatus,
+  submitForm,
+  resetForm,
+  updateExForm,
+} = useFormHook();
+//表格新增 分页
+const useAddFormHook = () => {
+  const formRef1 = ref(null);
+  const settings = ref([]);
+  const searchForm = ref({
+    pageNo: 1,
+    pageSize: 5,
+    totalPages: 0,
+  });
+  const addForm = ref({
+    paramName: "",
+    position: "",
+  });
+  const addPage = () => {
+    searchForm.value.pageNo = searchForm.value.pageNo + 1;
+    getSettingData();
+  };
+  const deletePage = () => {
+    searchForm.value.pageNo = searchForm.value.pageNo - 1;
+    getSettingData();
+  };
+  const getSettingData = async () => {
+    const { data } = await getSettingsData({
+      excelFormId: selectId.value,
+      ...searchForm.value,
+    });
+    settings.value = data.records;
+    if (settings.value.length == 0 && searchForm.value.pageNo > 1) {
+      deletePage();
+    }
+    searchForm.value.totalPages = data.totalPages;
+  };
+  const addSettings = async () => {
+    const { data, code } = await addSettingsData({
+      excelFormId: selectId.value,
+      ...addForm.value,
+    });
+    if (code == "200") {
+      ElMessage.success("添加成功");
+      resetAddForm();
+      getSettingData();
+    }
+  };
+  const deleteSettings = async (id: any) => {
+    const { data, code } = await deleteSettingsData({ id: id });
+    if (code == "200") {
+      ElMessage.success("删除成功");
+      getSettingData();
+    }
+  };
+
+  const resetAddForm = () => {
+    addForm.value = {
+      paramName: "",
+      position: "",
+    };
+    searchForm.value = {
+      pageNo: 1,
+      pageSize: 5,
+      totalPages: 0,
+    };
+    settings.value = [];
+  };
+  const creatAddForm = async () => {
+    await formRef1.value.validate(async (valid: any, fields: any) => {
+      if (valid) {
+        addSettings();
+      }
+    });
+  };
+  const addRules = reactive({
+    paramName: [
+      {
+        required: true,
+        trigger: "blur",
+      },
+    ],
+    position: [
+      {
+        required: true,
+        trigger: "blur",
+      },
+    ],
+  });
+  return {
+    formRef1,
+    addForm,
+    searchForm,
+    settings,
+    addRules,
+    creatAddForm,
+    resetAddForm,
+    getSettingData,
+    addSettings,
+    addPage,
+    deleteSettings,
+    deletePage,
+  };
+};
+
+const {
+  formRef1,
+  addForm,
+  searchForm,
+  settings,
+  addRules,
+  creatAddForm,
+  deletePage,
+  addPage,
+  resetAddForm,
+  getSettingData,
+  deleteSettings,
+} = useAddFormHook();
+watch(
+  () => props.data,
+  () => {
+    //@ts-ignore
+    rowData.value = props.data;
+    exceldata.value = JSON.parse(rowData.value.excelData);
+    excelKey1.value = !excelKey1.value;
+    if (rowData.value.lookStatus == true) {
+      options.value.edit = false;
+    }
+    setting.value = rowData.value.settings;
+  },
+  { immediate: true }
+);
+</script>
+<style lang="scss" scoped>
+.dialogBody {
+  width: 1560px;
+  height: 560px;
+  display: flex;
+  .exView {
+    width: 1330px;
+    height: 560px;
+    display: flex;
+    position: relative;
+  }
+  .btns {
+    width: 200px;
+    height: 560px;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    padding: 40px 0 0 20px;
+    .btn {
+      width: 100%;
+      margin: 10px;
+    }
+  }
+}
+</style>

+ 410 - 303
src/views/plan/workOrder/index.vue

@@ -1,22 +1,22 @@
 <template>
   <div class="mainContentBox">
     <avue-crud
-        ref="crudRef"
-        v-model:search="search"
-        v-loading="loading"
-        v-model="form"
-        :data="data"
-        :option="option"
-        v-model:page="page"
-        :permission="permission"
-        @row-save="createRow"
-        @row-update="updateRow"
-        @row-del="deleteRow"
-        @search-change="searchChange"
-        @search-reset="resetChange"
-        @size-change="dataList"
-        @current-change="dataList"
-        @selection-change="selectionChange"
+      ref="crudRef"
+      v-model:search="search"
+      v-loading="loading"
+      v-model="form"
+      :data="data"
+      :option="option"
+      v-model:page="page"
+      :permission="permission"
+      @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
@@ -28,81 +28,115 @@
           >删除</el-button
         >
         <el-button
-            :disabled="toDeleteIds.length < 1"
-            type="primary"
-            icon="el-icon-primary"
-            :size="size"
-            @click="aps1"
-        >批量排程</el-button
+          :disabled="toDeleteIds.length < 1"
+          type="primary"
+          icon="el-icon-primary"
+          :size="size"
+          @click="aps1"
+          >批量排程</el-button
         >
       </template>
-      <template #menu="{size,row,index}">
+      <template #menu="{ size, row, index }">
         <el-button
-            v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_edit]"
-            v-if="row.workOrderState === '0' ||  row.workOrderState === '1' ||  row.workOrderState === '2'"
-            type="primary"
-            link
-            size="small"
-            @click="handleEdit(row,0)"
-        ><i-ep-edit />编辑
+          v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_edit]"
+          v-if="
+            row.workOrderState === '0' ||
+            row.workOrderState === '1' ||
+            row.workOrderState === '2'
+          "
+          type="primary"
+          link
+          size="small"
+          @click="handleEdit(row, 0)"
+          ><i-ep-edit />编辑
         </el-button>
-        <el-button @click="aps(row.id)"
-                   icon="el-icon-setting"
-                   text
-                   v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_aps]"
-                   v-if="row.workOrderState === '0' ||  row.workOrderState === '1' ||  row.workOrderState === '2'"
-                   type="primary"
-                   :size="size">排程</el-button>
-          <el-button
-              icon="el-icon-setting"
-              text
-              v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_lock]"
-              v-if="row.workOrderState === '4'"
-              @click="lockOrUnLockWorkOrder(row.id,5)"
-              type="primary"
-              :size="size">冻结</el-button>
         <el-button
-            icon="el-icon-setting"
-            text
-            v-if="row.workOrderState === '5'"
-            v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_lock]"
-            @click="lockOrUnLockWorkOrder(row.id,4)"
-            type="primary"
-            :size="size">解冻</el-button>
+          @click="aps(row.id)"
+          icon="el-icon-setting"
+          text
+          v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_aps]"
+          v-if="
+            row.workOrderState === '0' ||
+            row.workOrderState === '1' ||
+            row.workOrderState === '2'
+          "
+          type="primary"
+          :size="size"
+          >排程</el-button
+        >
         <el-button
-            icon="el-icon-setting"
-            text
-            v-if="row.workOrderState === '2'"
-            @click="distribute(row.id)"
-            type="primary"
-            v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_aps]"
-            :size="size">下发</el-button>
+          icon="el-icon-setting"
+          text
+          v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_lock]"
+          v-if="row.workOrderState === '4'"
+          @click="lockOrUnLockWorkOrder(row.id, 5)"
+          type="primary"
+          :size="size"
+          >冻结</el-button
+        >
         <el-button
-            icon="el-icon-setting"
-            text
-            @click="showSeqPage(row)"
-            type="primary"
-            :size="size">流转卡号</el-button>
+          icon="el-icon-setting"
+          text
+          v-if="row.workOrderState === '5'"
+          v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_lock]"
+          @click="lockOrUnLockWorkOrder(row.id, 4)"
+          type="primary"
+          :size="size"
+          >解冻</el-button
+        >
         <el-button
-            icon="el-icon-delete"
-            text
-            v-if="row.workOrderState === '3'"
-            @click="revoke(row.id)"
-            type="primary"
-            :size="size">撤销</el-button>
+          icon="el-icon-setting"
+          text
+          v-if="row.workOrderState === '2'"
+          @click="distribute(row.id)"
+          type="primary"
+          v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_aps]"
+          :size="size"
+          >下发</el-button
+        >
         <el-button
-            icon="el-icon-setting"
-            text
-            @click="showCheckTask(row)"
-            type="primary"
-            :size="size">检验任务</el-button>
+          icon="el-icon-setting"
+          text
+          @click="showSeqPage(row)"
+          type="primary"
+          :size="size"
+          >流转卡号</el-button
+        >
         <el-button
-            icon="el-icon-setting"
-            text
-            @click="jumpPage(row.workOrderCode,2)"
-            type="primary"
-            :size="size">生产准备</el-button>
-       <!-- <el-button
+          icon="el-icon-delete"
+          text
+          v-if="row.workOrderState === '3'"
+          @click="revoke(row.id)"
+          type="primary"
+          :size="size"
+          >撤销</el-button
+        >
+        <el-button
+          icon="el-icon-setting"
+          text
+          @click="showCheckTask(row)"
+          type="primary"
+          :size="size"
+          >检验任务</el-button
+        >
+        <el-button
+          icon="el-icon-setting"
+          text
+          @click="jumpPage(row.workOrderCode, 2)"
+          type="primary"
+          :size="size"
+          >生产准备</el-button
+        >
+        <el-button
+          icon="el-icon-setting"
+          text
+          @click="showProExcel(row.id)"
+          type="primary"
+          v-if="row.isExcel == 1"
+          :size="size"
+          >生产随工单</el-button
+        >
+        <!-- <el-button
           icon="el-icon-notebook"
           text
           v-if="row.workOrderState === '6'&&row.packageUrl==='0'"
@@ -121,93 +155,118 @@
       </template>
     </avue-crud>
     <el-dialog
-        v-model="dialog.visible"
-        :title="dialog.title"
-        width="80%"
-        @close="dialog.visible = false"
+      v-model="dialog.visible"
+      :title="dialog.title"
+      width="80%"
+      @close="dialog.visible = false"
     >
-      <order-page queryType="1"  @orderInfo="orderInfo"/>
+      <order-page queryType="1" @order-info="orderInfo" />
     </el-dialog>
 
     <el-dialog
-        v-model="dialog1.visible"
-        :title="dialog1.title"
-        width="80%"
-        @close="dialog1.visible = false"
+      v-model="dialog1.visible"
+      :title="dialog1.title"
+      width="80%"
+      @close="dialog1.visible = false"
     >
-      <choice-route-page :processRouteType="processRouteType" :material-code="form.materialCode" @routeInfo="routeInfo"/>
+      <choice-route-page
+        :processRouteType="processRouteType"
+        :material-code="form.materialCode"
+        @route-info="routeInfo"
+      />
     </el-dialog>
 
     <el-dialog
-        v-model="dialog2.visible"
-        :title="dialog2.title"
-        width="80%"
-        @close="dialog2.visible = false"
+      v-model="dialog2.visible"
+      :title="dialog2.title"
+      width="80%"
+      @close="dialog2.visible = false"
     >
-      <choice-workshop-page  @workShopInfo="workShopInfo"/>
+      <choice-workshop-page @work-shop-info="workShopInfo" />
     </el-dialog>
 
     <el-dialog
-        v-model="dialog3.visible"
-        :title="dialog3.title"
-        width="80%"
-        @close="dialog3.visible = false"
+      v-model="dialog3.visible"
+      :title="dialog3.title"
+      width="80%"
+      @close="dialog3.visible = false"
     >
-      <choice-line-page :parentCode="form.workshopCode" :materialCode="form.materialCode" @lineInfo="lineInfo"/>
+      <choice-line-page
+        :parentCode="form.workshopCode"
+        :materialCode="form.materialCode"
+        @line-info="lineInfo"
+      />
     </el-dialog>
 
     <el-dialog
-        v-model="dialog4.visible"
-        :title="dialog4.title"
-        width="950px"
-        @close="dialog4.visible = false"
+      v-model="dialog4.visible"
+      :title="dialog4.title"
+      width="950px"
+      @close="dialog4.visible = false"
     >
-      <work-order-seq :workOrderInfo="form"/>
+      <work-order-seq :workOrderInfo="form" />
     </el-dialog>
     <el-dialog
-        v-model="dialog6.visible"
-        :title="dialog6.title"
-        width="1100px"
-        @close="dialog6.visible = false"
+      v-model="dialog6.visible"
+      :title="dialog6.title"
+      width="1100px"
+      @close="dialog6.visible = false"
     >
-      <check-task :workOrderInfo="form"/>
+      <check-task :workOrderInfo="form" />
     </el-dialog>
     <el-dialog
-        v-model="dialog5.visible"
-        :title="dialog5.title"
-        width="450px"
-        @close="dialog5.visible = false"
+      v-model="dialog5.visible"
+      :title="dialog5.title"
+      width="450px"
+      @close="dialog5.visible = false"
     >
       <el-form
-          ref="dataFormRef"
-          :model="formData"
-          :rules="rules"
-          label-width="150px">
-      <el-form-item label="排程时间" prop="apsTime" >
-        <el-date-picker
+        ref="dataFormRef"
+        :model="formData"
+        :rules="rules"
+        label-width="150px"
+      >
+        <el-form-item label="排程时间" prop="apsTime">
+          <el-date-picker
             v-model="formData.apsTime"
             type="date"
-            style="width:200px;"
+            style="width: 200px"
             :disabled-date="disabledDate"
             placeholder="请选择时间"
             format="YYYY/MM/DD"
             value-format="YYYY-MM-DD"
-        />
+          />
 
-<!--        <el-input width="250px" v-model="formData.apsTime" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"/>-->
-      </el-form-item>
+          <!--        <el-input width="250px" v-model="formData.apsTime" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"/>-->
+        </el-form-item>
         <el-form-item label="优先级" prop="priority" v-if="apsType === 1">
-          <el-select v-model="formData.priority" placeholder="排程类型"
-                     style="width:200px;">
-            <el-option v-for="item in apsPriority" :label="item.dictLabel" :value="item.dictValue" :key="item.dictValue"></el-option>
+          <el-select
+            v-model="formData.priority"
+            placeholder="排程类型"
+            style="width: 200px"
+          >
+            <el-option
+              v-for="item in apsPriority"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+              :key="item.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="排程类型" prop="apsModel">
+          <el-select
+            v-model="formData.apsModel"
+            placeholder="排程类型"
+            style="width: 200px"
+          >
+            <el-option
+              v-for="item in schedulingTypes"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+              :key="item.dictValue"
+            />
           </el-select>
         </el-form-item>
-      <el-form-item label="排程类型" prop="apsModel">
-        <el-select v-model="formData.apsModel" placeholder="排程类型"
-                   style="width:200px;">
-          <el-option v-for="item in schedulingTypes" :label="item.dictLabel" :value="item.dictValue" :key="item.dictValue"></el-option>
-        </el-select>
-      </el-form-item>
       </el-form>
       <template #footer>
         <div class="dialog-footer">
@@ -215,7 +274,15 @@
           <el-button @click="dialog5.visible = false">取 消</el-button>
         </div>
       </template>
-
+    </el-dialog>
+    <!-- 生产随工单 -->
+    <el-dialog
+      v-model="workOderShow"
+      :title="updateTitle"
+      @close="workOderShow = false"
+      width="1600"
+    >
+      <proWorkOrderExcel :data="ExDataObj" @close="closeShow" />
     </el-dialog>
   </div>
 </template>
@@ -223,7 +290,13 @@
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
 import buttonPermission from "@/common/configs/buttonPermission";
-import {apsWorkOrder,distributeWorkOrder,revokeWorkOrder,lockWorkOrder,zipWorkOrder} from "@/api/order"
+import {
+  apsWorkOrder,
+  distributeWorkOrder,
+  revokeWorkOrder,
+  lockWorkOrder,
+  zipWorkOrder,
+} from "@/api/order";
 import { useCommonStoreHook } from "@/store";
 import dictDataUtil from "@/common/configs/dictDataUtil";
 import ChoiceRoutePage from "./components/choice-route-page.vue";
@@ -231,31 +304,52 @@ import ChoiceWorkshopPage from "./components/choice-workshop-page.vue";
 import WorkOrderSeq from "./components/work-order-seq.vue";
 import CheckTask from "./components/check-task.vue";
 import { checkPerm } from "@/directive/permission";
-import {queryDictDataByType} from "@/api/system/dict"
+import { queryDictDataByType } from "@/api/system/dict";
+import { getProExcel } from "@/api/excel";
+import proWorkOrderExcel from "./components/proWorkOrderExcel.vue";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const updateTitle = ref("生产随工单");
 const router = useRouter();
+const workOderShow = ref(false);
+const ExDataObj = ref({});
+const excelData = ref([]);
+const showProExcel = async (id) => {
+  const { data, code } = await getProExcel(id);
+  if (code == "200") {
+    ExDataObj.value = data;
+
+    workOderShow.value = true;
+  } else {
+    ExDataObj.value = {};
+
+    workOderShow.value = false;
+  }
+};
+const closeShow = () => {
+  workOderShow.value = false;
+};
 const test = () => {
   isShowTable.value = true;
   tableType.value = tableType.value == 1 ? 2 : 1;
 };
-const processRouteType = ref('')
+const processRouteType = ref("");
 const permission = reactive({
   delBtn: checkPerm(buttonPermission.PLAN.BTNS.work_order_del),
   addBtn: checkPerm(buttonPermission.PLAN.BTNS.work_order_add),
   editBtn: checkPerm(buttonPermission.PLAN.BTNS.work_order_edit),
   menu: true,
 });
-const disabledDate = (time) =>{
+const disabledDate = (time) => {
   return time.getTime() < Date.now(); // 8.64e7 毫秒数代表一天
-}
+};
 
-const jumpPage= (workOrderCode,type) =>{
-  if(type === 1){
-    router.push('/requisition?workOrderCode=' + workOrderCode);
-  }else{
-    router.push('/plan/prepare?workOrderCode=' + workOrderCode);
+const jumpPage = (workOrderCode, type) => {
+  if (type === 1) {
+    router.push("/requisition?workOrderCode=" + workOrderCode);
+  } else {
+    router.push("/plan/prepare?workOrderCode=" + workOrderCode);
   }
-}
+};
 const dialog = reactive({
   title: "订单选择",
   visible: false,
@@ -284,103 +378,100 @@ const dialog6 = reactive({
   title: "检验任务",
   visible: false,
 });
-const apsType = ref(0)
-const aps =(id)=>{
-  apsType.value = 0
-  formData.workOrderIds = [id]
-  dialog5.visible = true
-}
-const showSeqPage =(workOrderCode)=>{
-  form.value = workOrderCode
-  dialog4.visible = true
-}
-const showCheckTask =(workOrderCode)=>{
-  form.value = workOrderCode
-  dialog6.visible = true
-}
-const distribute = (id)=>{
+const apsType = ref(0);
+const aps = (id) => {
+  apsType.value = 0;
+  formData.workOrderIds = [id];
+  dialog5.visible = true;
+};
+const showSeqPage = (workOrderCode) => {
+  form.value = workOrderCode;
+  dialog4.visible = true;
+};
+const showCheckTask = (workOrderCode) => {
+  form.value = workOrderCode;
+  dialog6.visible = true;
+};
+const distribute = (id) => {
   ElMessageBox.confirm("当前操作不可逆,确定下发工单吗?")
-      .then(() => {
-        loading.value=true;
-        distributeWorkOrder(id).then((data)=>{
-          loading.value=false;
-          ElMessage.success(data.msg);
-          dataList()
-        })
-      })
-      .catch(() => {
-        // catch error
-      });
-}
-const lockOrUnLockWorkOrder = (id,status)=>{
-  let message = status === "4" ? "解冻" : "冻结"
-  ElMessageBox.confirm("当前操作不可逆,确定"+message+"工单吗?")
-      .then(() => {
-        loading.value=true;
-        lockWorkOrder({id: id,workOrderState: status}).then((data)=>{
-          loading.value=false;
-          ElMessage.success(data.msg);
-          dataList()
-        })
-      })
-      .catch(() => {
-        // catch error
+    .then(() => {
+      loading.value = true;
+      distributeWorkOrder(id).then((data) => {
+        loading.value = false;
+        ElMessage.success(data.msg);
+        dataList();
       });
-}
-const loading=ref(false);
-const zipWork=ref({});
-const zipData=(workOrderCode)=>{
-  loading.value=true;
-  zipWork.value.workOrderCode=workOrderCode;
-  zipWorkOrder(zipWork.value).then(
-    (data)=>{
-      if(data.code === '200'){
-        loading.value=false;
+    })
+    .catch(() => {
+      // catch error
+    });
+};
+const lockOrUnLockWorkOrder = (id, status) => {
+  let message = status === "4" ? "解冻" : "冻结";
+  ElMessageBox.confirm("当前操作不可逆,确定" + message + "工单吗?")
+    .then(() => {
+      loading.value = true;
+      lockWorkOrder({ id: id, workOrderState: status }).then((data) => {
+        loading.value = false;
         ElMessage.success(data.msg);
-        dataList()
-      }else{
-        loading.value=false;
-        ElMessage.error(data.msg);
-      }
+        dataList();
+      });
+    })
+    .catch(() => {
+      // catch error
+    });
+};
+const loading = ref(false);
+const zipWork = ref({});
+const zipData = (workOrderCode) => {
+  loading.value = true;
+  zipWork.value.workOrderCode = workOrderCode;
+  zipWorkOrder(zipWork.value).then((data) => {
+    if (data.code === "200") {
+      loading.value = false;
+      ElMessage.success(data.msg);
+      dataList();
+    } else {
+      loading.value = false;
+      ElMessage.error(data.msg);
     }
-
-  )
-}
-const revoke = (id)=>{
+  });
+};
+const revoke = (id) => {
   ElMessageBox.confirm("当前操作不可逆,确定撤销工单吗?")
-      .then(() => {
-        loading.value=true;
-        revokeWorkOrder(id).then((data)=>{
-          if(data.code === '200'){
-            loading.value=false;
-            ElMessage.success(data.msg);
-            dataList()
-          }else{
-            loading.value=false;
-            ElMessage.error(data.msg)
-          }
-        })
-      })
-      .catch(() => {
-        // catch error
+    .then(() => {
+      loading.value = true;
+      revokeWorkOrder(id).then((data) => {
+        if (data.code === "200") {
+          loading.value = false;
+          ElMessage.success(data.msg);
+          dataList();
+        } else {
+          loading.value = false;
+          ElMessage.error(data.msg);
+        }
       });
-}
-const handleEdit = (row, index) =>{
+    })
+    .catch(() => {
+      // catch error
+    });
+};
+const handleEdit = (row, index) => {
   crudRef.value && crudRef.value.rowEdit(row, index);
-}
-const aps1 =()=>{
-  apsType.value = 1
-  formData.workOrderIds = toDeleteIds
-  dialog5.visible = true
-}
+};
+const aps1 = () => {
+  apsType.value = 1;
+  formData.workOrderIds = toDeleteIds;
+  dialog5.visible = true;
+};
 const dataFormRef = ref(ElForm);
-const schedulingTypes = ref([])
-const apsPriority = ref([])
+const schedulingTypes = ref([]);
+const apsPriority = ref([]);
 const formData = reactive({
   apsTime: null,
   priority: "1",
   apsModel: "0",
-  workOrderId: 0
+  workOrderId: 0,
 });
 
 const rules = reactive({
@@ -388,65 +479,66 @@ const rules = reactive({
   apsTime: [{ required: true, message: "排程时间不能为空", trigger: "blur" }],
   apsModel: [{ required: true, message: "排程类型不能为空", trigger: "blur" }],
 });
-const handleSubmit =()=>{
+const handleSubmit = () => {
   dataFormRef.value.validate((isValid) => {
     if (isValid) {
-      apsWorkOrder(formData).then((data)=>{
-        if(data.code === '200'){
+      apsWorkOrder(formData).then((data) => {
+        if (data.code === "200") {
           ElMessage.success(data.msg);
-          dialog5.visible = false
-          dataList()
-        }else{
+          dialog5.visible = false;
+          dataList();
+        } else {
           ElMessage.error(data.msg);
         }
-      })
+      });
     }
   });
-}
+};
 
 const orderInfo = (value) => {
-  form.value.orderCode = value.orderCode
-  form.value.orderName = value.orderName
-  form.value.materialCode = value.materialCode
-  form.value.materialName = value.materialName
-  form.value.materialModel = value.materialModel
-  form.value.priority = value.priority
-  form.value.orderType = value.orderType
-  form.value.processRouteId = ''
-  form.value.processRouteCode = ''
-  form.value.processRouteName = ''
-  form.value.processRouteVersion = ''
-  form.value.productLineId = ''
-  form.value.productLineName = ''
-  form.value.workshopName = ''
-  form.value.workshopCode = ''
-  form.value.workshopName = ''
-  dialog.visible = false
-}
+  form.value.orderCode = value.orderCode;
+  form.value.orderName = value.orderName;
+  form.value.materialCode = value.materialCode;
+  form.value.materialName = value.materialName;
+  form.value.materialModel = value.materialModel;
+  form.value.priority = value.priority;
+  form.value.orderType = value.orderType;
+  form.value.processRouteId = "";
+  form.value.processRouteCode = "";
+  form.value.processRouteName = "";
+  form.value.processRouteVersion = "";
+  form.value.productLineId = "";
+  form.value.productLineName = "";
+  form.value.workshopName = "";
+  form.value.workshopCode = "";
+  form.value.workshopName = "";
+  dialog.visible = false;
+};
 const lineInfo = (value) => {
-  form.value.productLineId = value.id
-  form.value.productLineName = value.name
-  dialog3.visible = false
-}
+  form.value.productLineId = value.id;
+  form.value.productLineName = value.name;
+  dialog3.visible = false;
+};
 const workShopInfo = (value) => {
-  form.value.workshopName = value.id
-  form.value.workshopCode = value.code
-  form.value.workshopName = value.name
-  dialog2.visible = false
-}
+  form.value.workshopName = value.id;
+  form.value.workshopCode = value.code;
+  form.value.workshopName = value.name;
+  dialog2.visible = false;
+};
 const routeInfo = (value) => {
-  form.value.processRouteId = value.id
-  form.value.processRouteCode = value.processRouteCode
-  form.value.processRouteName = value.processRouteName
-  form.value.processRouteVersion = value.processRouteVersion
-  dialog1.visible = false
-}
+  form.value.processRouteId = value.id;
+  form.value.processRouteCode = value.processRouteCode;
+  form.value.processRouteName = value.processRouteName;
+  form.value.processRouteVersion = value.processRouteVersion;
+  dialog1.visible = false;
+};
 // 传入一个url,后面不带/
 const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
   useCrud({
     src: "/api/v1/plan/workOrder",
   });
-const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  Methords; //增删改查
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
 
@@ -481,8 +573,8 @@ option.value = Object.assign(option.value, {
         },
       ],
       click: ({ value, column }) => {
-        if(column.boxType){
-          dialog.visible = true
+        if (column.boxType) {
+          dialog.visible = true;
         }
       },
     },
@@ -538,7 +630,7 @@ option.value = Object.assign(option.value, {
       width: "80",
       type: "select", //类型为下拉选择框
       dicUrl:
-          dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_priority,
+        dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_priority,
       props: {
         label: "dictLabel",
         value: "dictValue",
@@ -551,7 +643,7 @@ option.value = Object.assign(option.value, {
       display: false,
       type: "select", //类型为下拉选择框
       dicUrl:
-          dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_work_order_state,
+        dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_work_order_state,
       props: {
         label: "dictLabel",
         value: "dictValue",
@@ -570,30 +662,34 @@ option.value = Object.assign(option.value, {
         },
       ],
       click: ({ value, column }) => {
-        if(column.boxType){
-          if(!form.value.materialCode){
+        if (column.boxType) {
+          if (!form.value.materialCode) {
             ElMessage({
               message: "请先选择订单",
               type: "warning",
-            })
+            });
             return;
           }
-          processRouteType.value = form.value.orderType === '1' ? "ZC" : "FG"
-          dialog1.visible = true
+          processRouteType.value = form.value.orderType === "1" ? "ZC" : "FG";
+          dialog1.visible = true;
         }
       },
     },
     {
-    label: "工艺版本",
-    width: 100,
-    overHidden: true,
-    prop: "processRouteVersion",
-    display: false,
+      label: "工艺版本",
+      width: 100,
+      overHidden: true,
+      prop: "processRouteVersion",
+      display: false,
       html: true,
       formatter: (val) => {
-        return '<b class="el-tag el-tag--success el-tag--light">'+val.processRouteVersion+'</b>';
+        return (
+          '<b class="el-tag el-tag--success el-tag--light">' +
+          val.processRouteVersion +
+          "</b>"
+        );
       },
-  },
+    },
     {
       label: "生产车间",
       prop: "workshopName",
@@ -607,8 +703,8 @@ option.value = Object.assign(option.value, {
         },
       ],
       click: ({ value, column }) => {
-        if(column.boxType){
-          dialog2.visible = true
+        if (column.boxType) {
+          dialog2.visible = true;
         }
       },
     },
@@ -625,15 +721,15 @@ option.value = Object.assign(option.value, {
         },
       ],
       click: ({ value, column }) => {
-        if(column.boxType){
-          if(!form.value.workshopCode){
+        if (column.boxType) {
+          if (!form.value.workshopCode) {
             ElMessage({
               message: "请先选择生产车间",
               type: "warning",
-            })
+            });
             return;
           }
-          dialog3.visible = true
+          dialog3.visible = true;
         }
       },
     },
@@ -671,7 +767,6 @@ option.value = Object.assign(option.value, {
       width: 85,
       display: false,
       prop: "completeNum",
-
     },
     {
       label: "下线数量",
@@ -686,6 +781,18 @@ option.value = Object.assign(option.value, {
       prop: "scrapNum",
     },
     {
+      label: "首检数量",
+      width: 85,
+      prop: "firstCheckNum",
+      value: 0,
+    },
+    {
+      label: "已检数量",
+      width: 85,
+      display: false,
+      prop: "firstCheckAlreadyNum",
+    },
+    {
       label: "创建时间",
       width: 180,
       display: false,
@@ -702,7 +809,7 @@ option.value = Object.assign(option.value, {
       width: 90,
       display: false,
       prop: "packageUrl",
-      hide:true
+      hide: true,
     },
   ],
 });
@@ -710,11 +817,11 @@ option.value = Object.assign(option.value, {
 onMounted(() => {
   // console.log("crudRef", crudRef)
   dataList();
-  queryDictDataByType("order_scheduling_type").then((data)=>{
-    schedulingTypes.value = data.data
-  })
-  queryDictDataByType("aps_priority").then((data)=>{
-    apsPriority.value = data.data
-  })
+  queryDictDataByType("order_scheduling_type").then((data) => {
+    schedulingTypes.value = data.data;
+  });
+  queryDictDataByType("aps_priority").then((data) => {
+    apsPriority.value = data.data;
+  });
 });
 </script>

+ 3 - 3
src/views/pro/baseoperation/index.vue

@@ -146,7 +146,7 @@
                     search: false,
                 },*/
                 {
-                    label: "加工要求",
+                    label: "工艺条件",
                     prop: "processAsk",
                     search: false,
                 },
@@ -170,11 +170,11 @@
                     prop: "inspection",
                     search: false,
                 },
-                {
+                /*{
                     label: "是否首检",
                     prop: "firstCheck",
                     search: false,
-                },
+                },*/
                 {
                     label: "是否委外",
                     prop: "outsourcing",

+ 139 - 0
src/views/quality/reverseTraceability/index.vue

@@ -0,0 +1,139 @@
+<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"
+    />
+  </div>
+</template>
+<script setup>
+import { useCrud } from "@/hooks/userCrud";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
+import { useCommonStoreHook, useDictionaryStore } from "@/store";
+import SingleUpload from "@/components/Upload/SingleUpload.vue";
+
+// 数据字典相关
+const { dicts } = useDictionaryStore();
+
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/process/itemRecord/itemInfo",
+  });
+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(() => {
+  dataList();
+});
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  selection: false,
+  addBtn: false,
+  delBtn: false,
+  editBtn: false,
+  viewBtn: true,
+  column: [
+    {
+      label: "批次号",
+      prop: "batchNo",
+      hide: true,
+    },
+    {
+      label: "物料编码",
+      prop: "itemCode",
+      search: true,
+    },
+    {
+      label: "物料型号",
+      prop: "itemModel",
+      search: true,
+    },
+    {
+      label: "物料名称",
+      prop: "itemName",
+    },
+    {
+      label: "物料序列号",
+      prop: "itemSeq",
+    },
+    {
+      label: "旧序列号",
+      prop: "oldSeq",
+      hide: true,
+    },
+    {
+      label: "工序id",
+      prop: "operationId",
+      hide: true,
+    },
+    {
+      label: "工序名称",
+      prop: "operationName",
+      search: true,
+    },
+    {
+      label: "生产过程id",
+      prop: "processId",
+      hide: true,
+    },
+    {
+      label: "工作台名称",
+      prop: "stationName",
+    },
+    {
+      label: "步骤id",
+      prop: "stepInstanceId",
+      hide: true,
+    },
+    {
+      label: "录入数量",
+      prop: "num",
+    },
+    {
+      label: "排序号",
+      prop: "sortNum",
+    },
+    {
+      label: "采集人",
+      prop: "trackBy",
+      hide: true,
+    },
+    {
+      label: "追溯类型",
+      prop: "trackType",
+      hide: true,
+    },
+    {
+      label: "采集时间",
+      prop: "trackWhen",
+    },
+    {
+      label: "工单号",
+      prop: "workOrderCode",
+    },
+    {
+      label: "修改时间",
+      prop: "updated",
+    },
+  ],
+});
+</script>

+ 4 - 12
src/views/system/menu/index.vue

@@ -46,7 +46,7 @@
           hasChildren: 'hasChildren',
         }"
       >
-        <el-table-column label="菜单名称"  >
+        <el-table-column label="菜单名称">
           <template #default="scope">
             <svg-icon :icon-class="scope.row.icon" />
             {{ scope.row.menuName }}
@@ -70,17 +70,9 @@
           </template>
         </el-table-column>
 
-        <el-table-column
-          label="路由路径"
-          align="left"
-          prop="path"
-        />
+        <el-table-column label="路由路径" align="left" prop="path" />
 
-        <el-table-column
-          label="组件路径"
-          align="left"
-          prop="component"
-        />
+        <el-table-column label="组件路径" align="left" prop="component" />
 
         <el-table-column
           label="权限标识"
@@ -535,7 +527,7 @@ function resetForm() {
 
   formData.id = undefined;
   formData.parentId = "0";
-  formData.visible = 1;
+  formData.visible = 0;
   formData.orderNum = 1;
   formData.perms = undefined;
   formData.component = undefined;