dengrui 5 месяцев назад
Родитель
Сommit
d14b4a25e6

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

@@ -58,3 +58,34 @@ export function maintenanceCheck(data: any) {
     data: data,
   });
 }
+//通过工单号获取所有工位的类型
+export function getStationType(workOrderCode: any) {
+  return request({
+    url: `/api/v1/plan/task/stationType/${workOrderCode}`,
+    method: "get",
+  });
+}
+
+export function sendMsg(data: any) {
+  return request({
+    url: `/api/v1/process/info/sendMessage`,
+    method: "post",
+    data: data,
+  });
+}
+
+//通过工单检验批次号
+export function getJYNum(workOrderCode: any) {
+  return request({
+    url: `/api/v1/plan/workOrder/checkCode/${workOrderCode}`,
+    method: "get",
+  });
+}
+
+export function sendJYData(data: any) {
+  return request({
+    url: `/api/v1/plan/workOrder/updateCheckCode`,
+    method: "post",
+    data: data,
+  });
+}

Разница между файлами не показана из-за своего большого размера
+ 1 - 0
src/assets/icons/add.svg


+ 205 - 0
src/components/AddMsg/index.vue

@@ -0,0 +1,205 @@
+<template>
+  <div class="midPopUp" v-if="checkPop" @click="checkPop = false">
+    <div class="container" @click.stop>
+      <div class="title titleText" style="font-size: 38px">消息指派</div>
+      <el-scrollbar class="listBody">
+        <el-form ref="formRef" :model="form" label-width="aotu" :key="formKey">
+          <el-form-item
+            :rules="{
+              required: true,
+              message: '该选项为必选',
+              trigger: 'change',
+            }"
+            label="标题:"
+            prop="title"
+            ><el-input v-model="form.title" />
+          </el-form-item>
+          <el-form-item
+            :rules="{
+              required: true,
+              message: '该选项为必选',
+              trigger: 'change',
+            }"
+            label="批号:"
+            prop="workOrderCode"
+          >
+            <el-select
+              v-model="form.workOrderCode"
+              :disabled="route.name != 'ProcessMain'"
+              placeholder="Select"
+              @change="getType"
+            >
+              <el-option
+                v-for="item in oderList"
+                :key="item.value"
+                :label="item.workOrderCode"
+                :value="item.workOrderCode"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item
+            :rules="{
+              required: true,
+              message: '该选项为必选',
+              trigger: 'change',
+            }"
+            label="工位:"
+            prop="stationType"
+          >
+            <el-select
+              multiple
+              clearable
+              v-model="form.stationType"
+              placeholder="Select"
+            >
+              <el-option
+                v-for="item in stationList"
+                :key="item"
+                :label="dictS.getLableByValue('station_type', item)"
+                :value="item"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item
+            :rules="{
+              required: true,
+              message: '该选项为必选',
+              trigger: 'change',
+            }"
+            label="备注:"
+            prop="content"
+            ><el-input v-model="form.content" type="textarea" />
+          </el-form-item>
+        </el-form>
+      </el-scrollbar>
+      <div class="btns">
+        <el-button
+          type="primary"
+          @click="validate"
+          class="titleText"
+          style="width: 260px; height: 50px; border-radius: 16px"
+          >提 交
+        </el-button>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { sendMsg, getStationType } from "@/api/process";
+import { emitter, EventsNames } from "@/utils/common";
+import { useDictionaryStore } from "@/store";
+import { useProcessStore } from "@/store/modules/processView";
+const dictS = useDictionaryStore();
+const store = useProcessStore();
+const route = useRoute();
+//点检项数组
+const form = ref({ stationType: [] });
+const resetForm = () => {
+  form.value = reactive({ stationType: [] });
+};
+const formRef = ref(null);
+const checkPop = ref(false);
+const stationList = ref([]);
+const formKey = ref(false);
+const getType = async () => {
+  const { data } = await getStationType(form.value.workOrderCode);
+  stationList.value = data;
+  form.value.stationType = [];
+};
+const open = () => {
+  formKey.value = !formKey.value;
+  resetForm();
+  if (route.name != "ProcessMain") {
+    form.value.workOrderCode = store.odersData.workOrderCode;
+    getType();
+  }
+  checkPop.value = true;
+};
+const validate = () => {
+  formRef.value.validate((valid) => {
+    if (valid) {
+      submit();
+    } else {
+      ElMessage.error("请检查是否有未填项");
+    }
+  });
+};
+const submit = async () => {
+  const { data, code } = await sendMsg(form.value);
+  if (code == "200") {
+    ElMessage.success("提交成功!");
+    resetForm();
+    formKey.value = !formKey.value;
+    checkPop.value = false;
+  }
+};
+const oderList = ref([]);
+emitter.on(EventsNames.ORDER_LIST, (val) => {
+  oderList.value = val.value;
+});
+defineExpose({ open });
+onMounted(() => {});
+</script>
+
+<style lang="scss" scoped>
+.title {
+  width: 100%;
+  height: 50px;
+  text-align: center;
+  margin-bottom: 20px;
+}
+
+:deep(label) {
+  display: inline-block;
+}
+
+.listBody {
+  height: calc(100% - 160px);
+  padding: 0 $p20;
+
+  .item {
+    width: 100%;
+    background-color: white;
+    border-radius: 16px;
+    margin: 10px 0;
+    padding: $p10 $p20;
+
+    .showInfo {
+      .remark {
+        font-size: $f20;
+        color: red;
+        margin-right: 5px;
+      }
+    }
+  }
+}
+
+.btns {
+  width: 100%;
+  height: 50px;
+  @include flex;
+}
+
+//表单字体样式
+:deep(.el-form-item__label) {
+  font-size: $f20;
+  max-width: 600px;
+  display: inline-block;
+  height: auto;
+  padding-right: 0px;
+}
+
+:deep(.el-radio__label) {
+  font-size: $f20;
+}
+
+:deep(.el-radio) {
+  display: flex;
+  align-items: center;
+}
+
+:deep(.el-textarea__inner) {
+  font-size: $f20;
+}
+</style>

+ 15 - 2
src/components/MessageBox/index.vue

@@ -2,6 +2,12 @@
   <Transition>
     <div v-if="modelValue" class="body">
       <div class="headerTittle">消息记录</div>
+      <el-switch
+        v-model="value"
+        active-text="已发送消息"
+        inactive-text="已确认消息"
+      />
+      <br />
       <el-scrollbar class="itemScrollbar">
         <div class="item" v-for="(item, index) in msgData" :key="index">
           <div>
@@ -47,6 +53,7 @@ import { userMessage } from "@/api/user";
 import { Transform } from "stream";
 import { Transition } from "vue";
 const dictS = useDictionaryStore();
+const value = ref(false);
 const props = defineProps({
   modelValue: {
     type: Boolean,
@@ -63,6 +70,7 @@ const getPageInfo = async () => {
   const { data, code } = await userMessage({
     pageNo: page.value,
     pageSize: pageSize.value,
+    isSend: value.value ? 1 : null,
   });
   if (code == "200") {
     msgData.value = data.records;
@@ -81,6 +89,7 @@ const reset = () => {
   msgData.value = [];
   totalCount.value = 0;
 };
+
 onMounted(() => {
   getPageInfo();
 });
@@ -94,11 +103,15 @@ watch(
     }
   }
 );
+watch(value, () => {
+  page.value = 1;
+  getPageInfo();
+});
 </script>
 <style scoped lang="scss">
 .body {
   width: 400px;
-  height: 60vh;
+  height: 80vh;
   position: fixed;
   right: 20px;
   top: 80px;
@@ -117,7 +130,7 @@ watch(
   }
 
   .itemScrollbar {
-    height: calc(100% - 100px);
+    height: calc(100% - 140px);
   }
 
   .item {

+ 17 - 18
src/components/RealTimeMsg/index.vue

@@ -37,21 +37,7 @@
       </el-tooltip>
     </div>
     <!-- 静电环状态样式 -->
-    <div class="staticBox">
-      <div :class="braceletState == 0 ? 'static type0' : 'static type1'">
-        <div class="titleText">静电手环状态:</div>
-        <div class="titleText state">
-          {{ braceletState == 0 ? "离线" : "在线" }}
-        </div>
-      </div>
-      <!-- <el-button
-        v-if="braceletState == 0"
-        type="primary"
-        class="staticBtn"
-        @click="submit(item, index)"
-        >重新检测</el-button
-      > -->
-    </div>
+
     <div class="lightsBox">
       <div>
         <div class="titleText">电烙铁状态:</div>
@@ -61,6 +47,21 @@
       <div :class="{ activeLight2: lightIndex == 2 }" class="light"></div>
     </div>
   </div>
+  <div class="staticBox">
+    <div :class="braceletState == 0 ? 'static type0' : 'static type1'">
+      <div class="titleText">静电手环状态:</div>
+      <div class="titleText state">
+        {{ braceletState == 0 ? "离线" : "在线" }}
+      </div>
+    </div>
+    <!-- <el-button
+        v-if="braceletState == 0"
+        type="primary"
+        class="staticBtn"
+        @click="submit(item, index)"
+        >重新检测</el-button
+      > -->
+  </div>
 </template>
 
 <script setup>
@@ -110,6 +111,7 @@ const addWebSocket = () => {
       //处理左侧弹框消息
       case "1":
         if (firstNotice.value == false) {
+          messages.value = JSON.parse(receivedMessage).content;
           if (messages.value.length > 0) {
             showStatus.value = false;
           } else {
@@ -119,9 +121,6 @@ const addWebSocket = () => {
         break;
       //回填表格数据
       case "2":
-        // window.luckysheet.setVal(
-        //   JSON.parse(JSON.parse(receivedMessage).content)
-        // );
         emitter.emit(
           EventsNames.TEST_DATA,
           JSON.parse(JSON.parse(receivedMessage).content)

+ 13 - 2
src/layout/components/header.vue

@@ -21,6 +21,13 @@
         <div>
           <svg-icon
             class="activeNotice"
+            style="margin-bottom: 5px"
+            icon-class="add"
+            size="38"
+            @click="open"
+          />
+          <svg-icon
+            class="activeNotice"
             icon-class="lingdang"
             size="48"
             @click="messageStatus = !messageStatus"
@@ -65,6 +72,7 @@
       </el-space>
     </div>
     <MessageBox v-model="messageStatus" />
+    <AddMsg ref="addMsgRef" />
   </div>
 </template>
 
@@ -76,7 +84,10 @@ import { useUserStore } from "@/store";
 import { emitter, EventsNames } from "@/utils/common";
 
 const userStore = useUserStore();
-
+const addMsgRef = ref(null);
+const open = () => {
+  addMsgRef.value.open();
+};
 const router = useRouter();
 const route = useRoute();
 const routeMeta = computed(() => {
@@ -90,7 +101,7 @@ const time = ref(dayjs().format("HH:mm:ss"));
 
 const processCount = ref(50);
 const messageStatus = ref(false);
-
+const addMessageStatus = ref(false);
 const headUrl = ref("");
 
 let timer: any = -1;

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

@@ -18,6 +18,7 @@ export const useDictionaryStore = defineStore("dictionaryStore", () => {
     "escalation_fault_state",
     "excel_type",
     "device_type",
+    "station_type",
   ];
   const dicts = ref<{ [key: string]: any[] }>({});
 

+ 1 - 1
src/styles/index.scss

@@ -138,7 +138,7 @@
   position: fixed;
   width: 100vw;
   height: 100vh;
-  z-index: 2;
+  z-index: 999;
   background-color: #00000030;
   top: 0;
   left: 0;

+ 2 - 0
src/utils/common.ts

@@ -12,6 +12,8 @@ enum EventsNames {
   PROCESS_REDER = "PROCESS_REDER",
   //   测试数据开始测试之后的事件
   TEST_DATA = "TEST_DATA",
+  //当前未完成订单数据
+  ORDER_LIST = "ORDER_LIST",
 }
 
 export { emitter, EventsNames };

+ 1 - 1
src/views/prepare-complete-suit/components/order.vue

@@ -11,7 +11,7 @@
       </div>
       <div class="productMsg">
         <span :class="hoverStatus ? 'msgName msgNameHover' : 'msgName'"
-          >工单编号</span
+          >生产批号</span
         >
         <span class="msgValue">{{ item.workOrderCode }}</span>
       </div>

+ 1 - 1
src/views/pro-operation/check-out/index.vue

@@ -27,7 +27,7 @@
         </el-tab-pane>
         <el-tab-pane
           v-if="store.scanInfo.inspection == 1"
-          label="巡检"
+          label="过程检验"
           name="second"
         >
           <RollCheck :user-name="userInfo?.userName" />

+ 143 - 0
src/views/pro-operation/jianyanpihao/index.vue

@@ -0,0 +1,143 @@
+<template>
+  <div class="midPopUp" v-if="checkPop" @click="checkPop = false">
+    <div class="container" @click.stop>
+      <div class="title titleText" style="font-size: 38px">检验批号</div>
+      <el-scrollbar class="listBody">
+        <el-form ref="formRef" :model="form" label-width="aotu" :key="formKey">
+          <el-form-item
+            :rules="{
+              required: true,
+              message: '该选项为必选',
+              trigger: 'change',
+            }"
+            label="批号:"
+            prop="no"
+            ><el-input v-model="form.no" />
+          </el-form-item>
+        </el-form>
+      </el-scrollbar>
+      <div class="btns">
+        <el-button
+          type="primary"
+          @click="validate"
+          class="titleText"
+          style="width: 260px; height: 50px; border-radius: 16px"
+          >提 交
+        </el-button>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { getJYNum, sendJYData } from "@/api/process";
+import { emitter, EventsNames } from "@/utils/common";
+import { useDictionaryStore } from "@/store";
+import { useProcessStore } from "@/store/modules/processView";
+const dictS = useDictionaryStore();
+const store = useProcessStore();
+const route = useRoute();
+//点检项数组
+const form = ref({});
+const resetForm = () => {
+  form.value = {};
+};
+const formRef = ref(null);
+const checkPop = ref(false);
+const formKey = ref(false);
+const getNumData = async () => {
+  const { data } = await getJYNum(store.odersData.workOrderCode);
+  form.value.no = data;
+};
+const open = () => {
+  formKey.value = !formKey.value;
+  resetForm();
+  getNumData();
+  checkPop.value = true;
+};
+const validate = () => {
+  formRef.value.validate((valid) => {
+    if (valid) {
+      submit();
+    } else {
+      ElMessage.error("请检查是否有未填项");
+    }
+  });
+};
+const submit = async () => {
+  const { data, code } = await sendJYData({
+    workOrderCode: store.odersData.workOrderCode,
+    checkCode: form.value.no,
+  });
+  if (code == "200") {
+    ElMessage.success("提交成功!");
+    resetForm();
+    formKey.value = !formKey.value;
+    checkPop.value = false;
+  }
+};
+
+defineExpose({ open });
+</script>
+
+<style lang="scss" scoped>
+.title {
+  width: 100%;
+  height: 50px;
+  text-align: center;
+  margin-bottom: 20px;
+}
+
+:deep(label) {
+  display: inline-block;
+}
+
+.listBody {
+  height: calc(100% - 160px);
+  padding: 0 $p20;
+
+  .item {
+    width: 100%;
+    background-color: white;
+    border-radius: 16px;
+    margin: 10px 0;
+    padding: $p10 $p20;
+
+    .showInfo {
+      .remark {
+        font-size: $f20;
+        color: red;
+        margin-right: 5px;
+      }
+    }
+  }
+}
+
+.btns {
+  width: 100%;
+  height: 50px;
+  @include flex;
+}
+
+//表单字体样式
+:deep(.el-form-item__label) {
+  font-size: $f20;
+  max-width: 600px;
+  display: inline-block;
+  height: auto;
+  padding-right: 0px;
+}
+
+:deep(.el-radio__label) {
+  font-size: $f20;
+}
+
+:deep(.el-radio) {
+  display: flex;
+  align-items: center;
+}
+
+:deep(.el-textarea__inner) {
+  font-size: $f20;
+}
+</style>

+ 13 - 3
src/views/pro-steps/components/operates.vue

@@ -14,12 +14,14 @@
 
     <ReportBreak ref="reportBreakRef" />
     <ReportWork ref="reportWorkRef" />
+    <Jianyanpihao ref="jianyanpihaoRef" />
   </div>
 </template>
 
 <script lang="ts" setup>
 import ReportBreak from "@/views/pro-operation/report-break/index.vue"; // ================ 报故
 import ReportWork from "@/views/pro-operation/report-work/index.vue";
+import Jianyanpihao from "@/views/pro-operation/jianyanpihao/index.vue";
 import { useProcessStore } from "@/store";
 
 const store = useProcessStore();
@@ -30,7 +32,7 @@ const reportBreakRef = ref<InstanceType<typeof ReportBreak>>();
 const reportWorkRef = ref<InstanceType<typeof ReportWork>>();
 
 const router = useRouter();
-
+const jianyanpihaoRef = ref(null);
 const selectIndex = ref(null);
 const setIndex = (index: number) => {
   // selectIndex.value = index;
@@ -71,6 +73,10 @@ const setIndex = (index: number) => {
     case "pdmfile":
       router.push({ name: "pdmfile" });
       break;
+    case "jianyanpihao":
+      //@ts-ignore
+      jianyanpihaoRef.value.open();
+      break;
     default:
       break;
   }
@@ -105,14 +111,18 @@ const stepComponents = ref([
     compentName: "印刷板",
     compentType: "printboard",
   },
+  {
+    compentName: "检验批号",
+    compentType: "jianyanpihao",
+  },
 ]);
 const setComponents = () => {
   if (store.scanInfo.inspection == 1 || store.scanInfo.firstCheck == 1) {
     stepComponents.value = stepComponents.value.filter(
-      (item) => item.compentName !== "检验"
+      (item) => item.compentName !== "工序通用"
     );
     stepComponents.value.push({
-      compentName: "检验",
+      compentName: "工序通用",
       compentType: "xunjian",
     });
   }

+ 1 - 1
src/views/process/components/order.vue

@@ -11,7 +11,7 @@
       </div>
       <div class="productMsg">
         <span :class="hoverStatus ? 'msgName msgNameHover' : 'msgName'"
-          >工单编号</span
+          >生产批号</span
         >
         <span class="msgValue">{{ item.workOrderCode }}</span>
       </div>

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

@@ -91,6 +91,7 @@ const getOrdersData = async () => {
     } else {
       ordersDataArray.value.push(...data.records);
     }
+    emitter.emit(EventsNames.ORDER_LIST, ordersDataArray);
     ordersSum.value = data.totalCount;
     ordersQuery.value.totalPages = data.totalPages;
   }