Browse Source

1.齐套叫料。2.委外3.报工修改

jiaxiaoqiang 1 year ago
parent
commit
9e8bb02e2b

+ 1 - 1
src/api/auth/index.ts

@@ -54,7 +54,7 @@ export function getOrgListApi(): AxiosPromise<any[]> {
 //产线管理列表查询
 export function getProductionList(): AxiosPromise<any[]> {
   return request({
-    url: "/api/v1/base/productionLine/list",
+    url: "/api/v1/base/productionLine/list/list",
     method: "post",
     data: {},
   });

+ 18 - 0
src/api/process/callMateriel.ts

@@ -17,3 +17,21 @@ export function boxSuitDetailByBoxId(p: object) {
     data: p,
   });
 }
+
+// 未齐套叫料
+export function callNotFullSuit(p: object) {
+  return request({
+    url: `/api/v1/process/vehicleOperation/materialOut`,
+    method: "post",
+    data: p,
+  });
+}
+
+// 获取预齐套某个载具
+export function outSuitBox(p: object) {
+  return request({
+    url: `/api/v1/process/vehicleOperation/vehicleOut`,
+    method: "post",
+    data: p,
+  });
+}

+ 89 - 0
src/components/PDFView/index.vue

@@ -0,0 +1,89 @@
+<template>
+  <el-button
+    v-if="contentType === 'button'"
+    :type="btnType"
+    :link="isLink"
+    @click="showPdf"
+  >
+    {{ btnText }}
+  </el-button>
+  <VuePdfEmbed
+    v-else
+    :source="pdfSource"
+    :page="pageNumber"
+    annotation-layer
+    text-layer
+    @click="showPdf"
+  />
+  <el-drawer
+    v-if="needToShowPdf"
+    v-model="visible"
+    :footer="false"
+    :header="false"
+    :show-close="false"
+    destroy-on-close
+    direction="rtl"
+    size="972px"
+  >
+    <VuePdfEmbed
+      :source="pdfSource"
+      :page="showPdfNumber"
+      annotation-layer
+      text-layer
+    />
+  </el-drawer>
+</template>
+
+<script lang="ts" setup>
+import VuePdfEmbed from "vue-pdf-embed";
+// essential styles
+import "vue-pdf-embed/dist/style/index.css";
+
+// optional styles
+import "vue-pdf-embed/dist/style/annotationLayer.css";
+import "vue-pdf-embed/dist/style/textLayer.css";
+
+// either URL, Base64, binary, or document proxy
+const props = defineProps({
+  pdfSource: {
+    type: String,
+    required: true,
+  },
+  pageNumber: {
+    type: Number,
+    default: 0,
+  },
+  needToShowPdf: {
+    type: Boolean,
+    default: false,
+  },
+  contentType: {
+    type: String as PropType<"button" | "pdf">,
+    default: "pdf",
+  },
+  btnText: {
+    type: String,
+    default: "预览",
+  },
+  btnType: {
+    type: String,
+    default: "primary",
+  },
+  isLink: {
+    type: Boolean,
+    default: false,
+  },
+  showPdfNumber: {
+    type: Number,
+    default: 0,
+  },
+});
+
+const visible = ref(false);
+
+const showPdf = () => {
+  visible.value = true;
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 7 - 4
src/layout/index.vue

@@ -4,10 +4,13 @@
     <section class="app-main">
       <router-view>
         <template #default="{ Component, route }">
-          <transition enter-active-class="animate__animated animate__fadeIn" mode="out-in">
-            <keep-alive exclude="ProSteps">
-              <component :is="Component" />
-            </keep-alive>
+          <transition
+            enter-active-class="animate__animated animate__fadeIn"
+            mode="out-in"
+          >
+            <!--            <keep-alive exclude="ProSteps,AppointOut">-->
+            <component :is="Component" />
+            <!--            </keep-alive>-->
           </transition>
         </template>
       </router-view>

+ 8 - 4
src/views/pro-operation/appoint-out/record.vue

@@ -61,10 +61,15 @@ const page = reactive({
 const tableData = ref<any>([]);
 
 const handleClick = (row: any) => {
+  let nos = "";
+  row.details.forEach((item: any) => {
+    nos += item.seqNo + "  ";
+  });
+
   confirmMessageRef.value?.showDialog(
-    "工位上料提示",
-    "料箱:LX1321312已到达缓存位,是否立即工位上料?",
-    "工位上料",
+    "确定接收以下流转卡号吗",
+    nos + nos + nos + nos + nos + nos + nos + nos + nos + nos + nos + nos + nos,
+    "确定",
     () => {
       reveiveRecord([{ seqNo: row.details.seqNo, outsourceId: row.id }]).then(
         () => {
@@ -101,7 +106,6 @@ const getData = () => {
 };
 
 onMounted(() => {
-  console.log("onMounted");
   getData();
   emitter.on(EventsNames.APPOINT_OUT, () => {
     getData();

+ 30 - 9
src/views/pro-operation/call-materiel/complete-suit.vue

@@ -14,8 +14,14 @@
       </div>
     </div>
   </el-scrollbar>
-  <el-button class="call-btn" round type="primary" @click="toCall"
-    >叫料
+  <el-button
+    v-if="!isFull"
+    class="call-btn"
+    round
+    type="primary"
+    @click="toCall"
+  >
+    叫料
   </el-button>
 
   <MarterielBoxDetail ref="materielBoxDetailRef" />
@@ -24,12 +30,16 @@
 <script lang="ts" setup>
 import MarterielBoxDetail from "@/views/pro-operation/call-materiel/components/materiel-box-detail.vue";
 
-import { boxSuitDetailByBoxId, boxSuitList } from "@/api/process/callMateriel";
+import {
+  boxSuitDetailByBoxId,
+  boxSuitList,
+  callNotFullSuit,
+} from "@/api/process/callMateriel";
 import { useProcessStore } from "@/store/modules/processView";
 
 const processStore = useProcessStore();
 const merterielBoxes = ref<any[]>([]);
-
+const isFull = ref(false); //是否齐套了
 const isLoading = ref(false);
 
 const getList = () => {
@@ -37,12 +47,10 @@ const getList = () => {
   boxSuitList({
     operationId: processStore.odersData.operationId,
     workOrderCode: processStore.odersData.workOrderCode,
-    isFull: true,
   })
     .then((res) => {
-      merterielBoxes.value = res.data;
-      merterielBoxes.value = res.data;
-      merterielBoxes.value = res.data;
+      merterielBoxes.value = res.data.processVehicleList || [];
+      isFull.value = res.data.isFull;
     })
     .finally(() => {
       isLoading.value = false;
@@ -68,7 +76,20 @@ const getSuitDetail = (box: any) => {
     });
 };
 
-const toCall = () => {};
+const toCall = () => {
+  isLoading.value = true;
+  callNotFullSuit({
+    operationId: processStore.odersData.operationId,
+    workOrderCode: processStore.odersData.workOrderCode,
+  })
+    .then((res) => {
+      res.data && ElMessage.success(res.data);
+      // getList();
+    })
+    .finally(() => {
+      isLoading.value = false;
+    });
+};
 </script>
 
 <style lang="scss" scoped>

+ 4 - 0
src/views/pro-operation/call-materiel/components/materiel-box-detail.vue

@@ -39,6 +39,8 @@
 </template>
 
 <script lang="ts" setup>
+// import { outSuitBox } from "@/api/process/callMateriel";
+
 const visible = ref(false);
 
 let callBack: Function | null = null;
@@ -59,6 +61,8 @@ const showDialog = (
 };
 
 const sure = () => {
+  console.log(boxObj.value);
+  // outSuitBox({vehicleOperationId});
   callBack && callBack();
   visible.value = false;
 };

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

@@ -104,9 +104,11 @@ import { getProcessInfo } from "@/api/prosteps";
 
 import { CirclePlus, Remove } from "@element-plus/icons-vue";
 import { reportWork } from "@/api/process/reportBreak";
+import { useUserStore } from "@/store/modules/user";
 
 const processStore = useProcessStore();
 const dictStroe = useDictionaryStore();
+const userStore = useUserStore();
 
 const drawerVisible = ref(false);
 const formDisabled = ref(true);
@@ -118,7 +120,7 @@ const persons = ref<
     userName: string | null;
     workingHoursRate: number | null;
   }[]
->([{ userName: null, workingHoursRate: null }]);
+>([{ userName: userStore.user.username ?? "", workingHoursRate: 100 }]);
 
 const openReportWorkDrawer = () => {
   getProcessInfo(processStore.scanInfo.id).then((res) => {
@@ -155,9 +157,11 @@ const confirmClick = () => {
     processUserReportList: persons.value,
   };
 
+  const router = useRouter();
   reportWork(params).then((res: any) => {
     if (res.code === "200") {
       ElMessage.success("报工成功");
+      router.replace({ name: "ProSteps" });
       drawerVisible.value = false;
     } else {
       ElMessage.error("报工失败");