Forráskód Böngészése

订单管理-打印出库单添加打印数据保存接口

lph 11 hónapja
szülő
commit
ddd761f842

+ 8 - 1
zkqy-ui/src/api/tablelist/commonTable.js

@@ -415,4 +415,11 @@ export function getProductSpecificationsByProductName(data) {
   })
 }
 
-// d
+// 订单管理   打印出库单  
+export function printOutsourceOrder(data) {
+  return request({
+    url: '/system/order/printOutsourceOrder',
+    method: 'post',
+    data: data,
+  })
+}

+ 28 - 3
zkqy-ui/src/views/orderMange/index.vue

@@ -828,6 +828,7 @@ import {
   queryMaterielList,
   getSaleOrderProductionListDistinct,
   getProductSpecificationsByProductName,
+  printOutsourceOrder,
 } from "@/api/tablelist/commonTable";
 import { updateOrder } from "@/api/system/retailMange.js";
 import { listData } from "@/api/system/tenant/data";
@@ -1234,8 +1235,31 @@ export default {
       let res = await this.$refs.outBoundRef.getPrintData();
       console.log(res);
       if (res.flag) {
-        res.data.form.printUser = this.nickName;
-        outBoundPrint(res.data, "printDom", false);
+        try {
+          let payload = res.data.tableData.map((item) => {
+            let { saleNo } = this.currentRow;
+            return {
+              accountingType: 1,
+              accountsReceivableDate: new Date(),
+              saleNo,
+              // saleProductNo: item.saleProductNo,
+              productId: item.productId,
+              productName: item.productName,
+              productSpecifications: item.productSpecifications,
+              productcolour: item.productcolour,
+              lotNumber: item.lotNumber,
+            };
+          });
+          let result = await printOutsourceOrder(payload);
+          if (result.code == 200) {
+            res.data.form.printUser = this.nickName;
+            outBoundPrint(res.data, "printDom", false);
+          } else {
+            throw new Error(result.msg);
+          }
+        } catch (error) {
+          this.$message.error(error);
+        }
       }
     },
     // 产品名失焦
@@ -1713,7 +1737,8 @@ export default {
           this.queryParams.queryMap.queryParam =
             this.queryParams.queryMap.queryCriteriaValue;
           // this.queryParams.orderType = "";
-          this.queryParams.queryParam = this.queryParams.queryMap.queryCriteriaValue;
+          this.queryParams.queryParam =
+            this.queryParams.queryMap.queryCriteriaValue;
           saleOrderList(this.queryParams).then(async (res) => {
             this.tableList = [];
             // res.rows.forEach((item) => {