dengrui před 6 měsíci
rodič
revize
223d04831b

+ 2 - 2
src/api/excel/index.ts

@@ -95,9 +95,9 @@ export function setExcelData(data: any) {
   });
 }
 // 生产随工单Exceldata获取
-export function getProExcel(id: any) {
+export function getProExcel(id: any, type: any) {
   return request({
-    url: `/api/v1/ProcessFormData/getExcel/${id}`,
+    url: `/api/v1/ProcessFormData/getExcel/${id}/${type}`,
     method: "get",
   });
 }

+ 71 - 5
src/views/base/signature/components/opSignature.vue

@@ -79,6 +79,14 @@
       >
         <el-input v-model="form.middleText" />
       </el-form-item>
+      <el-form-item
+        v-if="activeName == '5' && myselfUpload == true"
+        label="质量等级字母:"
+        :rules="[{ required: true, message: '请输入' }]"
+        style="width: 400px"
+      >
+        <el-input v-model="form.ZLName" maxlength="1" />
+      </el-form-item>
       <el-form-item label="启用状态:">
         <el-switch
           v-model="form.signatureState"
@@ -356,6 +364,21 @@
             </div>
           </div>
         </div>
+        <!-- 质量等级签章 -->
+        <div
+          v-if="activeName == '5'"
+          style="display: flex; flex-direction: column; align-items: center"
+        >
+          <div class="showGJBox ZLshowGJBox">
+            <div v-if="form.ZLName" ref="ZLRef" class="ZLBox">
+              {{ form.ZLName }}
+            </div>
+            <span v-else>请先设置等级签章字母值</span>
+          </div>
+          <div class="operaBox" v-if="form.ZLName">
+            <el-button type="primary" @click="updownZLPng">下载</el-button>
+          </div>
+        </div>
       </div>
       <div v-else>
         <!-- //自定义上传 -->
@@ -473,6 +496,15 @@ const submit = async () => {
                 "data:image/png;base64," + response.data.result.entSeal
               );
               break;
+            case "5":
+              const chartContainer3 = ZLRef.value;
+              const canvas3 = await html2canvas(chartContainer3, {
+                logging: false, // 可选:关闭日志输出
+                backgroundColor: null, // 设置背景颜色为透明
+              });
+              const img3 = canvas3.toDataURL("image/png");
+              blob = base64ToBlob(img3);
+              break;
           }
 
           const file = new File([blob], "签章文件.png", {
@@ -661,6 +693,7 @@ const { GJRef, updownGJPng } = GJUseHook();
 //检验签章
 const JYUseHook = () => {
   const JYRef = ref(null);
+  const ZLRef = ref(null);
   const updownJYPng = async () => {
     const chartContainer = JYRef.value;
     const canvas = await html2canvas(chartContainer, {
@@ -670,12 +703,24 @@ const JYUseHook = () => {
     const img = canvas.toDataURL("image/png");
     const a = document.createElement("a");
     a.href = img;
-    a.download = "手写签名.png";
+    a.download = "签章.png";
     a.click();
   };
-  return { JYRef, updownJYPng };
+  const updownZLPng = async () => {
+    const chartContainer = ZLRef.value;
+    const canvas = await html2canvas(chartContainer, {
+      logging: false, // 可选:关闭日志输出
+      backgroundColor: null, // 设置背景颜色为透明
+    });
+    const img = canvas.toDataURL("image/png");
+    const a = document.createElement("a");
+    a.href = img;
+    a.download = "签章.png";
+    a.click();
+  };
+  return { JYRef, ZLRef, updownJYPng, updownZLPng };
 };
-const { JYRef, updownJYPng } = JYUseHook();
+const { JYRef, ZLRef, updownJYPng, updownZLPng } = JYUseHook();
 //公章签章
 const GZUseHook = () => {
   const GZRef = ref(null);
@@ -933,19 +978,40 @@ watch(
   display: flex;
   .GJBox {
     font-size: 20px;
+    padding: 0 3px;
     color: red;
     background-color: transparent !important;
     display: inline;
-    border: 2px solid red;
+    border: 4px solid red;
   }
   .JYBox {
     font-size: 20px;
+    padding: 0 3px;
+    color: red;
+    background-color: transparent !important;
+    display: inline;
+    border: 4px solid red;
+  }
+}
+.ZLshowGJBox {
+  width: 240px;
+  height: 140px;
+  overflow: hidden;
+  .ZLBox {
+    font-size: 120px;
+    font-weight: bolder;
+    text-align: center;
+    width: 120px;
+    height: 120px;
+    line-height: 50%;
+    padding-top: 25px;
     color: red;
     background-color: transparent !important;
     display: inline;
-    border: 2px solid red;
+    border: 4px solid red;
   }
 }
+
 .body {
   display: flex;
   justify-content: space-evenly;

+ 55 - 33
src/views/plan/workOrder/index.vue

@@ -127,15 +127,34 @@
           :size="size"
           >生产准备</el-button
         >
+
         <el-button
           icon="el-icon-setting"
           text
-          @click="showProExcel(row.id)"
+          @click="showProExcel(row.id, '0')"
           type="primary"
-          v-if="row.workOrderState > 3"
+          v-if="row.workOrderState > 3 && row.filterNumber == '1'"
           :size="size"
           >生产随工单</el-button
         >
+        <el-button
+          icon="el-icon-setting"
+          text
+          @click="showProExcel(row.id, '1')"
+          type="primary"
+          v-if="row.workOrderState > 3 && row.filterNumber == '2'"
+          :size="size"
+          >生产随工单(一筛)</el-button
+        >
+        <el-button
+          icon="el-icon-setting"
+          text
+          @click="showProExcel(row.id, '2')"
+          type="primary"
+          v-if="row.workOrderState > 3 && row.filterNumber == '2'"
+          :size="size"
+          >生产随工单(二筛)</el-button
+        >
         <!--        <el-button
           icon="el-icon-notebook"
           text
@@ -294,7 +313,11 @@
       width="950px"
       @close="dialog7.visible = false"
     >
-      <work-order-page queryType="2" @order-info="workOrderInfoClick" multipleKey="workOrderCode"/>
+      <work-order-page
+        queryType="2"
+        @order-info="workOrderInfoClick"
+        multipleKey="workOrderCode"
+      />
     </el-dialog>
   </div>
 </template>
@@ -327,8 +350,8 @@ const router = useRouter();
 const workOderShow = ref(false);
 const ExDataObj = ref({});
 const excelData = ref([]);
-const showProExcel = async (id) => {
-  const { data, code } = await getProExcel(id);
+const showProExcel = async (id, type) => {
+  const { data, code } = await getProExcel(id, type);
   if (code == "200") {
     ExDataObj.value = data;
     workOderShow.value = true;
@@ -526,8 +549,8 @@ const handleSubmit = () => {
   });
 };
 const workOrderInfoClick = (value) => {
-  if(value){
-    form.value.frontWorkOrderCode = value.join(',');
+  if (value) {
+    form.value.frontWorkOrderCode = value.join(",");
   }
   dialog7.visible = false;
 };
@@ -574,15 +597,15 @@ const routeInfo = (value) => {
   form.value.processRouteCode = value.processRouteCode;
   form.value.processRouteName = value.processRouteName;
   form.value.processRouteVersion = value.processRouteVersion;
-  option.value.column.forEach(item=>{
-    if(item.prop === 'opGroup'){
-        item.dicData = value.opGroups;
-        item.disabled = false;
+  option.value.column.forEach((item) => {
+    if (item.prop === "opGroup") {
+      item.dicData = value.opGroups;
+      item.disabled = false;
     }
-    if(item.prop === 'opType'){
+    if (item.prop === "opType") {
       item.disabled = false;
     }
-  })
+  });
   dialog1.visible = false;
 };
 // 传入一个url,后面不带/
@@ -694,7 +717,7 @@ option.value = Object.assign(option.value, {
         label: "dictLabel",
         value: "dictValue",
       },
-      value: '0',
+      value: "0",
     },
     {
       label: "优先级",
@@ -768,44 +791,43 @@ option.value = Object.assign(option.value, {
         value: "dictValue",
       },
       change: ({ value, column }) => {
-        option.value.column.forEach(item=>{
-          if(value){
+        option.value.column.forEach((item) => {
+          if (value) {
             if (column.boxType === "edit") {
-              if (item.prop === 'opGroup'){
+              if (item.prop === "opGroup") {
                 item.dicData = form.value.opGroups;
               }
-              if (item.prop === 'opType'){
-                item.disabled =false
+              if (item.prop === "opType") {
+                item.disabled = false;
               }
-
             }
-            if(item.prop === 'frontWorkOrderCode' || item.prop === 'opGroup'){
-              if(value === '2'){
+            if (item.prop === "frontWorkOrderCode" || item.prop === "opGroup") {
+              if (value === "2") {
                 item.display = false;
               }
-              if(item.prop === 'opGroup'){
-                if(value === '1'){
+              if (item.prop === "opGroup") {
+                if (value === "1") {
                   item.display = true;
-                  item.disabled = false
+                  item.disabled = false;
                 }
-                if(value === '0'){
+                if (value === "0") {
                   item.display = true;
-                  item.disabled = false
+                  item.disabled = false;
                 }
               }
-              if(item.prop === 'frontWorkOrderCode'){
-                if(value === '1'){
+              if (item.prop === "frontWorkOrderCode") {
+                if (value === "1") {
                   item.display = true;
-                  item.disabled = false
+                  item.disabled = false;
                 }
-                if(value === '0'){
+                if (value === "0") {
                   item.display = false;
-                  item.disabled = false
+                  item.disabled = false;
                 }
               }
             }
           }
-        })
+        });
       },
       rules: [
         {