Browse Source

feature/生产履历字段更改

dy 11 months ago
parent
commit
2000886396

+ 4 - 1
src/layout/index.vue

@@ -1,5 +1,6 @@
 <template>
-  <div class="wh-full">
+  <div class="wh-full" v-loading.fullscreen.lock="fullscreenLoading" element-loading-text="加载中..."
+    element-loading-background="rgba(122, 122, 122, 1 )">
     <Header />
     <section class="app-main">
       <router-view>
@@ -19,6 +20,8 @@
 
 <script setup>
 import Header from "@/layout/components/header.vue";
+const fullscreenLoading = ref(false);
+provide("fullscreenLoading", fullscreenLoading);
 </script>
 
 <style lang="scss" scoped>

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

@@ -13,6 +13,8 @@ export const useDictionaryStore = defineStore("dictionaryStore", () => {
     "danwei_type",
     "system_message_type",
     "plan_work_order_state",
+    "disposal_measures_type",
+    "escalation_fault_state",
   ];
   const dicts = ref<{ [key: string]: any[] }>({});
 

+ 2 - 0
src/utils/common.ts

@@ -7,6 +7,8 @@ enum EventsNames {
   //获取当前工序状态 实现叫料按钮的disabled实时效果
   PROCESS_STEPOBJ = "PROCESS_STEPOBJ",
   PROCESS_STEPINDEX = "PROCESS_STEPINDEX",
+  //通知procee界面重新加载数据
+  PROCESS_REDER = "PROCESS_REDER",
 }
 
 export { emitter, EventsNames };

+ 2 - 1
src/views/pro-operation/report-work/index.vue

@@ -101,7 +101,7 @@
 import { useProcessStore } from "@/store/modules/processView";
 import { useDictionaryStore } from "@/store/modules/dictionary";
 import { getProcessInfo } from "@/api/prosteps";
-
+import { emitter, EventsNames } from "@/utils/common";
 import { CirclePlus, Remove } from "@element-plus/icons-vue";
 import { useUserStore } from "@/store/modules/user";
 import { reportWork } from "@/api/process/reportBreak";
@@ -162,6 +162,7 @@ const confirmClick = () => {
   reportWork(params).then((res: any) => {
     if (res.code === "200") {
       ElMessage.success("报工成功");
+      emitter.emit(EventsNames.PROCESS_REDER);
       router.replace("/process");
       drawerVisible.value = false;
     } else {

+ 3 - 0
src/views/process/components/steps.vue

@@ -83,6 +83,9 @@ const emitFnc = () => {
 emitter.on(EventsNames.PROCESS_STEPINDEX, (val: any) => {
   selectStepIndex.value = val;
 });
+emitter.on(EventsNames.PROCESS_REDER, () => {
+  selectStepIndex.value = null;
+});
 // const setStepIndex = () => {
 //   for (let i = 0; i < props.opsArray.length; i++) {
 //     if (props.opsArray[i].opComplete == false) {

+ 1 - 0
src/views/process/main.vue

@@ -20,6 +20,7 @@ import Orders from "@/views/process/orders.vue";
 import Processes from "@/views/process/processes.vue";
 import CurrentProduction from "@/views/process/currentProduction.vue";
 import CheckPop from "./popUpView/checkPop.vue";
+import { ElLoading } from "element-plus";
 defineOptions({ name: "ProcessMain" });
 const checkPop = ref(false);
 //未完成订单数组

+ 18 - 1
src/views/process/orders.vue

@@ -23,15 +23,16 @@ import Order from "@/views/process/components/order.vue";
 import { useProcessStore } from "@/store";
 import { useDictionaryStore } from "@/store";
 import { getOrders } from "@/api/process";
+import { emitter, EventsNames } from "@/utils/common";
 const dictS = useDictionaryStore();
 const store = useProcessStore();
 const selectSeqIndex = inject("selectSeqIndex");
+const scanStatus = inject("scanStatus");
 const ordersSum = ref(0);
 const emit = defineEmits(["getindex"]);
 const ordersDataArray = inject("ordersDataArray");
 //获取未完成订单的参数
 const ordersQuery = ref({
-  orders: [],
   pageNo: 1,
   pageSize: 5,
   queryComplete: 0,
@@ -47,12 +48,24 @@ const getOrdersData = async () => {
     ordersQuery.value.totalPages = data.totalPages;
   }
 };
+//重新刷新当前页码数据
+const resetOrdersDataArray = async () => {
+  ordersDataArray.value = [];
+  ordersQuery.value = {
+    pageNo: 1,
+    pageSize: 5,
+    queryComplete: 0,
+    totalPages: 1,
+  };
+  getOrdersData();
+};
 const activeName = ref("false");
 //这里是存放控制当前选择工序的index
 const selectIndex = ref(null);
 const setSlectIndex = (index: number) => {
   if (index == null) {
     selectIndex.value = null;
+    scanStatus.value = false;
     return;
   }
   selectIndex.value = index;
@@ -107,6 +120,10 @@ watch(
 );
 onMounted(() => {
   getOrdersData();
+  emitter.on(EventsNames.PROCESS_REDER, () => {
+    resetOrdersDataArray();
+    setSlectIndex(null);
+  });
 });
 </script>
 

+ 21 - 12
src/views/process/popUpView/checkPop.vue

@@ -6,22 +6,18 @@
       <el-scrollbar class="listBody">
         <el-form ref="formRef" :model="checkListArray" label-width="aotu">
           <div class="item" v-for="(item, index) in checkListArray.array" :key="item.key">
-            <el-form-item :label="`${index + 1}.` + item.deviceName + ':'" :rules="{
+            <el-form-item :label="`${index + 1}.` + item.deviceName + '-' + item.deviceNo" :rules="{
               required: true,
               message: '该选项为必选',
               trigger: 'change',
             }" :prop="'array.' + index + '.result'">
-              <!-- <el-form-item
-              label="阿瓦达瓦大瓦大大啊达瓦大爱我的爱我的爱我的阿达阿达阿瓦阿达阿达大大阿达阿瓦阿达瓦滴答滴答滴答滴答滴答滴答的哒哒哒哒哒哒哒哒哒哒哒哒滴答滴答滴答滴答滴答滴答哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒哒多大"
-              :rules="{
-                required: true,
-                message: '该选项为必选',
-                trigger: 'change',
-              }" :prop="'array.' + index + '.result'"> -->
-              <el-radio-group v-model="item.result">
-                <el-radio :value="0">正常</el-radio>
-                <el-radio :value="1">异常</el-radio>
-              </el-radio-group>
+              <div class="showInfo">
+                <span class="remark">&nbsp;( {{ item.showremark }} ) :</span>
+                <el-radio-group v-model="item.result">
+                  <el-radio :value="0">正常</el-radio>
+                  <el-radio :value="1">异常</el-radio>
+                </el-radio-group>
+              </div>
             </el-form-item>
             <el-input v-if="item.result == 1" v-model="item.remark" type="textarea" placeholder="请输入异常原因" />
           </div>
@@ -45,8 +41,12 @@ const getCheckList = async () => {
   const { data } = await checkList();
   checkListArray.array = data;
   checkListArray.array.forEach((item, index) => {
+    let str = "";
     item.result = null;
     item.key = index;
+    str = JSON.parse(JSON.stringify(item.remark));
+    item.showremark = str;
+    item.remark = "";
   });
   if (checkListArray.array.length > 0) {
     checkPop.value = true;
@@ -106,6 +106,14 @@ onMounted(() => {
     border-radius: 16px;
     margin: 10px 0;
     padding: $p10 $p20;
+
+    .showInfo {
+      .remark {
+        font-size: $f20;
+        color: red;
+        margin-right: 5px;
+      }
+    }
   }
 }
 
@@ -121,6 +129,7 @@ onMounted(() => {
   max-width: 600px;
   display: inline-block;
   height: auto;
+  padding-right: 0px;
 }
 
 :deep(.el-radio__label) {

+ 3 - 5
src/views/traceability/components/record.vue

@@ -4,11 +4,9 @@
       <el-collapse accordion>
         <el-collapse-item v-for="(item, index) in materialsData" :key="index" :title="item.opName" :name="index">
           <el-table :data="item.children"  border>
-            <el-table-column prop="itemName" label="物料名称" />
-            <el-table-column prop="itemModel" label="物料规格" />
-            <el-table-column prop="itemCode" label="物料编号" />
-            <el-table-column prop="needNum" label="需求数量" />
-            <el-table-column prop="realNum" label="已采集数量" />
+            <el-table-column prop="label" label="记录项名称" />
+            <el-table-column prop="inputValue" label="记录项值" />
+            <el-table-column prop="created" label="录入时间" />
           </el-table>
         </el-collapse-item>
       </el-collapse>

+ 9 - 34
src/views/traceability/index.vue

@@ -95,27 +95,17 @@
         </el-descriptions>
       </div>
       <div id="tabBox" class="tabBox">
-        <el-tabs
-          v-model="activeName"
-          class="demo-tabs"
-          @tab-click="handleClick"
-        >
+        <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
           <el-tab-pane name="f1">
             <template #label>
-              <el-badge
-                :type="activeName == 'f1' ? 'warning' : 'primary'"
-                :value="tabCountData.traceability"
-                >生产履历
+              <el-badge :type="activeName == 'f1' ? 'warning' : 'primary'" :value="tabCountData.traceability">生产履历
               </el-badge>
             </template>
             <Traceability />
           </el-tab-pane>
           <el-tab-pane name="f2">
             <template #label>
-              <el-badge
-                :type="activeName == 'f2' ? 'warning' : 'primary'"
-                :value="tabCountData.materials"
-                >已采物料
+              <el-badge :type="activeName == 'f2' ? 'warning' : 'primary'" :value="tabCountData.materials">已采物料
               </el-badge>
             </template>
             <keep-alive>
@@ -124,10 +114,7 @@
           </el-tab-pane>
           <el-tab-pane name="f3">
             <template #label>
-              <el-badge
-                :type="activeName == 'f3' ? 'warning' : 'primary'"
-                :value="tabCountData.record"
-                >记录项
+              <el-badge :type="activeName == 'f3' ? 'warning' : 'primary'" :value="tabCountData.record">记录项
               </el-badge>
             </template>
             <keep-alive>
@@ -138,10 +125,7 @@
           </el-tab-pane>
           <el-tab-pane name="f4">
             <template #label>
-              <el-badge
-                :type="activeName == 'f4' ? 'warning' : 'primary'"
-                :value="tabCountData.checks"
-                >点检判定
+              <el-badge :type="activeName == 'f4' ? 'warning' : 'primary'" :value="tabCountData.checks">点检判定
               </el-badge>
             </template>
             <keep-alive>
@@ -152,10 +136,7 @@
           </el-tab-pane>
           <el-tab-pane name="f5">
             <template #label>
-              <el-badge
-                :type="activeName == 'f5' ? 'warning' : 'danger'"
-                :value="tabCountData.equit"
-                >设备使用
+              <el-badge :type="activeName == 'f5' ? 'warning' : 'danger'" :value="tabCountData.equit">设备使用
               </el-badge>
             </template>
             <keep-alive>
@@ -166,10 +147,7 @@
           </el-tab-pane>
           <el-tab-pane name="f6">
             <template #label>
-              <el-badge
-                :type="activeName == 'f6' ? 'warning' : 'danger'"
-                :value="tabCountData.fault"
-                >报故记录
+              <el-badge :type="activeName == 'f6' ? 'warning' : 'danger'" :value="tabCountData.fault">报故记录
               </el-badge>
             </template>
             <keep-alive>
@@ -180,10 +158,7 @@
           </el-tab-pane>
           <el-tab-pane name="f7">
             <template #label>
-              <el-badge
-                :type="activeName == 'f7' ? 'warning' : 'danger'"
-                :value="12"
-                >图片采集
+              <el-badge :type="activeName == 'f7' ? 'warning' : 'danger'" :value="tabCountData.medias">图片采集
               </el-badge>
             </template>
             <keep-alive>
@@ -214,7 +189,7 @@ const Media = defineAsyncComponent(() => import("./components/media.vue"));
 const store = useProcessStore();
 const router = useRouter();
 const activeName = ref("f1");
-const handleClick = () => {};
+const handleClick = () => { };
 const infoData = ref({});
 const tabCountData = ref({});
 //获取卡号基础信息