jiaxiaoqiang 7 месяцев назад
Родитель
Сommit
4e19172718

+ 27 - 0
src/api/process/appointOut.ts

@@ -46,3 +46,30 @@ export function deleteRecordById(id: string) {
     data: { id: id },
   });
 }
+
+// 新增印刷版信息
+export function addPrintInfo(data: any) {
+  return request({
+    url: "/api/v1/printing/add",
+    method: "post",
+    data: data,
+  });
+}
+
+// 印刷版分页查询
+export function getPrintInfoPage(data: any) {
+  return request({
+    url: "/api/v1/printing/page",
+    method: "post",
+    data: data,
+  });
+}
+
+// 删除印刷版信息
+export function deletePrintInfo(id: string) {
+  return request({
+    url: "/api/v1/printing/del",
+    method: "post",
+    data: { id: id },
+  });
+}

+ 9 - 0
src/router/modules/process.ts

@@ -163,6 +163,15 @@ export default {
       },
     },
     {
+      path: "printing-plate",
+      component: () => import("@/views/pro-operation/printing-plate/index.vue"),
+      name: "printing-plate",
+      meta: {
+        title: "印刷板",
+        back: true,
+      },
+    },
+    {
       path: "material-flow",
       component: () => import("@/views/material-flow/index.vue"),
       name: "material-flow",

+ 1 - 0
src/utils/common.ts

@@ -4,6 +4,7 @@ const emitter = mitt();
 
 enum EventsNames {
   APPOINT_OUT = "APPOINT_OUT",
+  PRINTING_PLATE = "PRINTING_PLATE",
   //获取当前工序状态 实现叫料按钮的disabled实时效果
   PROCESS_STEPOBJ = "PROCESS_STEPOBJ",
   PROCESS_STEPINDEX = "PROCESS_STEPINDEX",

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

@@ -47,15 +47,14 @@ import {
   deleteRecordById,
   reveiveRecord,
 } from "@/api/process/appointOut";
-import { useDictionaryStore } from "@/store";
+import { useDictionaryStore, useProcessStore } from "@/store";
 import ConfirmMessage from "@/components/CommonDialogs/ConfirmMessage.vue";
-import { useProcessStore } from "@/store";
 
 const store = useProcessStore();
 const dictS = useDictionaryStore();
 
 const page = reactive({
-  pageSize: 1,
+  pageSize: 10,
   pageNo: 1,
   total: 0,
 });
@@ -107,8 +106,8 @@ const getData = () => {
     pageSize: page.pageSize,
     operationId: store.odersData.operationId,
   }).then((res) => {
-    console.log(res);
     tableData.value = res.data.records;
+    page.total = res.data.totalCount;
   });
 };
 

+ 198 - 0
src/views/pro-operation/printing-plate/create.vue

@@ -0,0 +1,198 @@
+<template>
+  <div class="commonTitle">新增</div>
+  <el-scrollbar class="barHeight">
+    <div id="drawContent">
+      <el-form
+        ref="formRef"
+        :model="formLabelAlign"
+        :rules="rules"
+        label-position="top"
+        label-width="auto"
+        size="large"
+      >
+        <el-form-item label="基本信息">
+          <div class="base-info">
+            <div class="info-item">
+              <div class="item-label">产品名称</div>
+              <div class="item-value">
+                {{ processStore.scanInfo?.materialName }}
+              </div>
+            </div>
+            <div class="info-item">
+              <div class="item-label">产品型号</div>
+              <div class="item-value">
+                {{ processStore.scanInfo?.materialModel }}
+              </div>
+            </div>
+            <div class="info-item">
+              <div class="item-label">当前工序</div>
+              <div class="item-value">
+                {{ processStore.scanInfo?.operationName }}
+              </div>
+            </div>
+            <div class="info-item">
+              <div class="item-label">开工时间</div>
+              <div class="item-value">
+                {{ processStore.scanInfo?.realStartWhen }}
+              </div>
+            </div>
+          </div>
+        </el-form-item>
+
+        <el-form-item label="印刷板编号" prop="printingPlateCode">
+          <el-input v-model="formLabelAlign.printingPlateCode" />
+        </el-form-item>
+      </el-form>
+      <div class="bottom-btns">
+        <el-button class="cancelBtn el-button-big" @click="cancelClick"
+          >重置
+        </el-button>
+        <el-button
+          class="sureBtn el-button-big"
+          type="primary"
+          @click="confirmClick"
+          >创建
+        </el-button>
+      </div>
+    </div>
+  </el-scrollbar>
+</template>
+
+<script lang="ts" setup>
+import { useProcessStore } from "@/store/modules/processView";
+import { addPrintInfo } from "@/api/process/appointOut";
+import { emitter, EventsNames } from "@/utils/common";
+
+const processStore = useProcessStore();
+
+const formRef = ref<InstanceType<typeof ElForm>>();
+
+const formLabelAlign = reactive({
+  printingPlateCode: "",
+});
+const rules = reactive({
+  printingPlateCode: [{ required: true, message: "请输入", trigger: "blur" }],
+});
+
+const cancelClick = () => {
+  formRef.value && formRef.value.resetFields();
+};
+
+onMounted(() => {});
+
+const confirmClick = () => {
+  // drawerVisible.value = false;
+  formRef.value &&
+    formRef.value.validate((valid: boolean) => {
+      if (valid) {
+        let params = {
+          operationId: processStore.scanInfo.operationId,
+          operationName: processStore.scanInfo.operationName,
+          workOrderCode: processStore.scanInfo.workOrderCode,
+          orderCode: processStore.scanInfo.orderCode,
+
+          materialCode: processStore.scanInfo.materialCode,
+          materialName: processStore.scanInfo.materialName,
+          materialModel: processStore.scanInfo.materialModel,
+          processId: processStore.scanInfo.id,
+          printingPlateCode: formLabelAlign.printingPlateCode,
+          remark: "",
+        };
+
+        addPrintInfo(params).then(() => {
+          ElMessage.success("创建成功");
+          emitter.emit(EventsNames.PRINTING_PLATE);
+          cancelClick();
+        });
+      }
+    });
+};
+</script>
+
+<style lang="scss" scoped>
+:deep(.el-form-item__label) {
+  font-size: $f20;
+}
+
+#drawContent {
+  width: 100%;
+  //:deep(.el-form--large.el-form--label-top .el-form-item .el-form-item__label) {
+  //  font-weight: 500;
+  //  font-size: 22px;
+  //  color: rgba(0, 0, 0, 0.9);
+  //  text-align: left;
+  //}
+}
+
+.base-info {
+  width: 100%;
+  background: #e3e5e7;
+  border-radius: 16px 16px 16px 16px;
+  padding: 0 30px;
+
+  .info-item {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    height: 64px;
+
+    .item-label {
+      font-size: 20px;
+      color: rgba(0, 0, 0, 0.6);
+    }
+
+    .item-value {
+      font-weight: 500;
+      font-size: 24px;
+      color: rgba(0, 0, 0, 0.9);
+    }
+  }
+
+  .info-item:not(:last-child) {
+    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
+  }
+}
+
+.bottom-btns {
+  display: flex;
+  justify-content: space-between;
+  margin-top: 20px;
+  //margin-bottom: 20px;
+
+  .button {
+    margin-right: 20px;
+  }
+
+  .cancelBtn {
+    width: 292px;
+    height: 80px;
+    background: rgba(0, 0, 0, 0.06);
+    border-radius: 76px 76px 76px 76px;
+  }
+
+  .sureBtn {
+    width: 292px;
+    height: 80px;
+    background: #0a59f7;
+    border-radius: 76px 76px 76px 76px;
+  }
+}
+
+.barHeight {
+  height: calc(100vh - 170px);
+}
+
+.scrollbar-demo-item {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  height: 50px;
+  margin: 10px;
+  text-align: center;
+  border-radius: 4px;
+  background: var(--el-color-primary-light-9);
+  color: var(--el-color-primary);
+}
+</style>
+
+<style lang="scss" scoped></style>

+ 19 - 0
src/views/pro-operation/printing-plate/index.vue

@@ -0,0 +1,19 @@
+<template>
+  <div class="mainContentBox">
+    <el-row :gutter="20">
+      <el-col :span="10" class="elColClasss">
+        <Create />
+      </el-col>
+      <el-col :span="14" class="elColClasss">
+        <Record />
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import Create from "@/views/pro-operation/printing-plate/create.vue";
+import Record from "@/views/pro-operation/printing-plate/record.vue";
+</script>
+
+<style lang="scss" scoped></style>

+ 96 - 0
src/views/pro-operation/printing-plate/record.vue

@@ -0,0 +1,96 @@
+<template>
+  <div class="commonTitle">记录</div>
+  <el-scrollbar class="barHeight">
+    <el-table :data="tableData" style="width: 100%">
+      <el-table-column label="印刷板编号" prop="printingPlateCode" />
+      <el-table-column label="物料名称" prop="materialName" />
+      <el-table-column label="委外工序" prop="operationName" />
+      <el-table-column label="工单编码" prop="workOrderCode" />
+      <el-table-column label="操作" prop="operation">
+        <template #default="{ row }">
+          <el-button round type="danger" @click="deleteRecord(row)"
+            >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+  </el-scrollbar>
+  <Pagination
+    v-model:limit="page.pageSize"
+    v-model:page="page.pageNo"
+    :total="page.total"
+    @pagination="paginationChange"
+  />
+  <ConfirmMessage ref="confirmMessageRef" />
+</template>
+
+<script lang="ts" setup>
+import { emitter, EventsNames } from "@/utils/common";
+import { deletePrintInfo, getPrintInfoPage } from "@/api/process/appointOut";
+import { useProcessStore } from "@/store";
+import ConfirmMessage from "@/components/CommonDialogs/ConfirmMessage.vue";
+
+const store = useProcessStore();
+
+const page = reactive({
+  pageSize: 10,
+  pageNo: 1,
+  total: 0,
+});
+
+const tableData = ref<any>([]);
+
+// =========确认弹窗
+const confirmMessageRef = ref<InstanceType<typeof ConfirmMessage>>();
+
+const deleteRecord = (row: any) => {
+  deletePrintInfo(row.id).then(() => {
+    ElMessage.success("删除成功");
+    getData();
+  });
+};
+
+const paginationChange = () => {
+  getData();
+};
+
+const getData = () => {
+  getPrintInfoPage({
+    pageNo: page.pageNo,
+    pageSize: page.pageSize,
+    operationId: store.odersData.operationId,
+  }).then((res) => {
+    tableData.value = res.data.records;
+    page.total = res.data.totalCount;
+  });
+};
+
+onMounted(() => {
+  getData();
+  emitter.on(EventsNames.PRINTING_PLATE, () => {
+    getData();
+  });
+});
+
+onBeforeUnmount(() => {
+  emitter.off(EventsNames.PRINTING_PLATE);
+});
+</script>
+
+<style lang="scss" scoped>
+.barHeight {
+  height: calc(100vh - 220px);
+}
+
+.scrollbar-demo-item {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  height: 50px;
+  margin: 10px;
+  text-align: center;
+  border-radius: 4px;
+  background: var(--el-color-primary-light-9);
+  color: var(--el-color-primary);
+}
+</style>

+ 7 - 0
src/views/pro-steps/components/operates.vue

@@ -62,6 +62,9 @@ const setIndex = (index: number) => {
     case "xunjian":
       router.push({ name: "checkOut" });
       break;
+    case "printboard":
+      router.push({ name: "printing-plate" });
+      break;
     default:
       break;
   }
@@ -96,6 +99,10 @@ const stepComponents = ref([
     compentName: "返工/剔除",
     compentType: "fangong",
   },
+  {
+    compentName: "印刷板",
+    compentType: "printboard",
+  },
 ]);
 
 onMounted(() => {