浏览代码

Merge remote-tracking branch 'origin/master'

guoyujia 1 年之前
父节点
当前提交
d85cb5893f

+ 10 - 0
src/api/business/carrier.js

@@ -1,6 +1,7 @@
 import request from '@/utils/request'
 
 const baseUrl = import.meta.env.VITE_APP_BASE_API
+const baseUrlProduction = import.meta.env.VITE_APP_PRODUCTION_API
 
 // 载具类别列表
 export function listCategory(query) {
@@ -115,6 +116,15 @@ export function unAbandoned(id) {
     method: 'get'
   })
 }
+
+//是否可以打印
+export function whether(data) {
+  return request({
+    url: baseUrlProduction + '/business/carrier/whether',
+    method: 'post',
+    data: data
+  })
+}
 export function downloadQcImgs(query) {
   return request({
     url: baseUrl + '/business/carrier/downloadQcImgs',

+ 37 - 28
src/views/business/carrier/index.vue

@@ -290,6 +290,7 @@ import {
   saveCarrierReject,
   download,
   printQrcodePdf,
+  whether,
 } from "@/api/business/carrier";
 import carrierForm from "./form";
 import printJS from "print-js";
@@ -503,19 +504,23 @@ const handleUnAbandoned = (row) => {
 };
 
 const handleBatchPrintQrCode = async () => {
-  const imageGroup = document.getElementById("image-group");
-  // for (var i = 0; i < selections.value.length; i++) {
-  //   console.log(webHost + selections.value[i].qcCode);
-  //   const img = document.createElement('img');
-  //   img.src = webHost + selections.value[i].qcCode
-  //   imageGroup.appendChild(img);
-  // }
-  printJS({
-    printable: "image-group", // 这里是你要打印内容的DOM元素的id
-    type: "html",
-    style: "@page { size: auto;  margin: 0mm; }", // 可以添加打印样式
+  whether(selections.value).then((res) => {
+    if (res.code == 200) {
+      const imageGroup = document.getElementById("image-group");
+      // for (var i = 0; i < selections.value.length; i++) {
+      //   console.log(webHost + selections.value[i].qcCode);
+      //   const img = document.createElement('img');
+      //   img.src = webHost + selections.value[i].qcCode
+      //   imageGroup.appendChild(img);
+      // }
+      printJS({
+        printable: "image-group", // 这里是你要打印内容的DOM元素的id
+        type: "html",
+        style: "@page { size: auto;  margin: 0mm; }", // 可以添加打印样式
+      });
+      // window.print();
+    }
   });
-  // window.print();
 };
 
 const handleBatchPrintPdf = () => {
@@ -548,24 +553,28 @@ const handleBatchPrintPdf = () => {
 async function handleBatchDownloadQrCode() {
   console.log(selections.value);
 
-  const zip = new JSZip();
-  const zipFilename = "二维码.zip";
-
-  for (var i = 0; i < selections.value.length; i++) {
-    console.log(webHost + selections.value[i].qcCode);
-
-    // 下载二维码图片数据
-    const qrCodeResponse = await fetch(webHost + selections.value[i].qcCode);
-    const qrCodeBlob = await qrCodeResponse.blob();
+  whether(selections.value).then(async (res) => {
+    if (res.code == 200) {
+      const zip = new JSZip();
+      const zipFilename = "二维码.zip";
+      for (var i = 0; i < selections.value.length; i++) {
+        console.log(webHost + selections.value[i].qcCode);
 
-    // 将二维码图片添加到 ZIP 文件中
-    zip.file(selections.value[i].code + ".png", qrCodeBlob);
-  }
+        // 下载二维码图片数据
+        const qrCodeResponse = await fetch(
+          webHost + selections.value[i].qcCode
+        );
+        const qrCodeBlob = await qrCodeResponse.blob();
 
-  // 生成 ZIP 文件并提供下载
-  zip.generateAsync({ type: "blob" }).then((content) => {
-    // 使用 FileSaver.js 将 ZIP 文件保存到本地
-    saveAs(content, zipFilename);
+        // 将二维码图片添加到 ZIP 文件中
+        zip.file(selections.value[i].code + ".png", qrCodeBlob);
+      }
+      // 生成 ZIP 文件并提供下载
+      zip.generateAsync({ type: "blob" }).then((content) => {
+        // 使用 FileSaver.js 将 ZIP 文件保存到本地
+        saveAs(content, zipFilename);
+      });
+    }
   });
 }
 

+ 3 - 0
src/views/business/noCurrentReject/DialogRejectInfo.vue

@@ -222,6 +222,9 @@
                 v-model="detailInfo.rejectNum"
                 :min="1"
                 :max="detailInfo.productionQuantity"
+                :decimal="false"
+                :step="1"
+                step-strictly
                 label="数量"
                 style="width: 140px"
               />

+ 0 - 1
src/views/business/outsource/DialogProducts.vue

@@ -167,7 +167,6 @@ function getList() {
   queryParams.value.supplierId = props.supplierId;
   listForOutsource(queryParams.value).then((res) => {
     productList.value = res.rows;
-    console.log("productList", productList.value);
     total.value = res.total;
     loading.value = false;
   });

+ 18 - 16
src/views/business/outsource/index.vue

@@ -93,12 +93,16 @@
       >
         删除
       </el-button>
-      <!--
-			<el-button type="warning" icon="Download" @click="handleExport" v-hasPermi="['business:outsource:export']">
-				导出
-			</el-button>
-			<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
-			-->
+
+      <el-button
+        type="warning"
+        icon="Download"
+        :disabled="ids.length != 1"
+        @click="handleExport"
+        v-hasPermi="['business:outsource:export']"
+      >
+        导出
+      </el-button>
     </div>
 
     <!-- 渲染数据区 -->
@@ -239,7 +243,11 @@
 </template>
 
 <script setup name="Order">
-import { listOrder, delOrder } from "@/api/business/outsourcedOrder";
+import {
+  listOrder,
+  delOrder,
+  exportOutsource,
+} from "@/api/business/outsourcedOrder";
 import orderForm from "./form";
 const { proxy } = getCurrentInstance();
 /** 字典数组区 */
@@ -260,8 +268,8 @@ const queryParams = ref({
   pageSize: 10,
   formCode: null,
   formDate: null,
-  startTime:null,
-  endTime:null,
+  startTime: null,
+  endTime: null,
   supplierName: null,
   deliveryMethod: null,
   packagingMethod: null,
@@ -335,13 +343,7 @@ function handleDelete(row) {
 
 /** 导出按钮操作 */
 function handleExport() {
-  proxy.download(
-    "business/order/export",
-    {
-      ...queryParams.value,
-    },
-    `order_${new Date().getTime()}.xlsx`
-  );
+  exportOutsource({ id: ids.value[0] });
 }
 
 getList();