Browse Source

订单管理打印老库存出库单及老库存出库明细

lph 1 year ago
parent
commit
5b43a44d57

+ 53 - 0
zkqy-ui/src/api/system/oldRecord.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询成品出库记录(老库存)列表
+export function listOldRecord(query) {
+  return request({
+    url: '/system/oldRecord/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 老库存打印出库单接口
+export function listSaleOrderNo(query) {
+  return request({
+    url: '/system/oldRecord/listSaleOrderNo',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询成品出库记录(老库存)详细
+export function getOldRecord(id) {
+  return request({
+    url: '/system/oldRecord/' + id,
+    method: 'get'
+  })
+}
+
+// 新增成品出库记录(老库存)
+export function addOldRecord(data) {
+  return request({
+    url: '/system/oldRecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改成品出库记录(老库存)
+export function updateOldRecord(data) {
+  return request({
+    url: '/system/oldRecord',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除成品出库记录(老库存)
+export function delOldRecord(id) {
+  return request({
+    url: '/system/oldRecord/' + id,
+    method: 'delete'
+  })
+}

+ 9 - 0
zkqy-ui/src/api/system/retailMange.js

@@ -116,3 +116,12 @@ export function updateOrder(data) {
   })
 }
 
+
+// 老库存出库详情
+export function oldRecordDetails(params) {
+  return request({
+    url: '/system/oldRecord/list',
+    method: 'get',
+    params
+  })
+}

+ 94 - 0
zkqy-ui/src/utils/print/oldOutBoundPrint.js

@@ -0,0 +1,94 @@
+function oldOutBoundPrint(data, domId, isRetail = false) {
+  console.log(data);
+  let { outStockDate, remark, unitName, printUser } = data.form
+  let { tableData } = data
+  let date = new Date(outStockDate)
+  console.log(date);
+  let yy = date.getFullYear();
+  let mm = date.getMonth() + 1;
+  if (mm < 10) {
+    mm = "0" + mm;
+  }
+  let dd = date.getDate();
+  if (dd < 10) {
+    dd = "0" + dd;
+  }
+  let tableHeader = ``
+  if (isRetail) { //零售
+    tableHeader = `<td style="width: 100px;">名称</td>
+        <td style="width: 100px;">规格</td>
+        <td style="width: 100px;">单位</td>
+        <td style="width: 100px;">数量</td>
+        <td style="width: 100px;">单价</td>
+        <td style="width: 100px;">金额</td>`
+
+  } else {
+    tableHeader = `<td style="width: 100px;">名称</td>
+        <td style="width: 100px;">规格</td>
+        <td style="width: 100px;">批号</td>
+        <td style="width: 100px;">单位</td>
+        <td style="width: 100px;">数量</td>
+        <td style="width: 100px;">单价</td>
+        <td style="width: 100px;">金额</td>`
+  }
+
+  let printContent = `<div style="width: 700px;position: relative;">
+
+    <div
+      style="width: 100%;position: relative;text-align: center;display: flex;flex-direction: column;margin-bottom: 10px;">
+      <span style="font-size: 24px;font-weight: 500;">诸暨市新丝维化纤有限公司</span>
+      <span>销售出库单</span>
+    </div>
+    <div>
+      <div style="margin-bottom: 3px; padding: 0 10px;"><span>单位名称:${unitName}</span></div>
+      <div style="display: flex;justify-content: space-between;padding: 0 20px;">
+        <span>备注:${remark}</span><span>出库日期:&ensp;${yy}&ensp;年&ensp;${mm}&ensp;月&ensp;${dd}&ensp;日</span>
+      </div>
+    </div>
+    <table style="width: 100%;border-collapse:collapse;" cellpadding="10" border="1">
+      <tr style="text-align: center;">
+        ${tableHeader}
+      </tr>`;
+  let totalPrice = 0, totalWeight = 0;
+  for (let i = 0; i < tableData.length; i++) {
+    let item = tableData[i];
+    let { productName, productSpecifications, lotNumber, unit, productNumber, productUnitPrice, productAmounts, actualWeight } = item
+    if (Number(productAmounts)) {
+      totalPrice += Number(productAmounts);
+    }
+    if (Number(actualWeight)) {
+      totalWeight += Number(actualWeight);
+    }
+    printContent += `<tr style="text-align: center;">
+      <td>${productName}</td>
+      <td>${productSpecifications}</td>
+      <td>${lotNumber}</td>
+      <td>${unit}</td>
+      <td>${actualWeight}</td>
+      <td>${productUnitPrice}</td>
+      <td>${productAmounts}</td>
+      </tr>`
+  }
+  totalPrice = totalPrice.toFixed(2);
+  totalWeight = totalWeight.toFixed(2);
+  printContent += `<tr style="text-align: center;border: none;">
+        <td style="width: 100px;">合计</td>
+        <td style="width: 100px;"></td>
+        ${isRetail ? '' : '<td style="width: 100px;"></td>'}
+        <td style="width: 100px;"></td>
+        <td style="width: 100px;">${totalWeight}</td>
+        <td style="width: 100px;"></td>
+        <td style="width: 100px;">${totalPrice}</td>
+      </tr>`
+
+
+  printContent += `</table>
+    <div><span>制表人:${printUser}</span></div>
+  </div>`
+  document.body.innerHTML = document.getElementById(domId).innerHTML = printContent;
+  window.print(); //打印
+  window.location.reload();
+  return false;
+
+}
+export default oldOutBoundPrint

+ 10 - 2
zkqy-ui/src/views/orderMange/components/dialogForm/OutBound.vue

@@ -84,8 +84,10 @@ import {
   outboundOrderInfo,
   printOutsourceOrderList,
 } from "@/api/tablelist/commonTable";
+import { listOldRecord } from "@/api/system/oldRecord.js";
+import { mapState } from "vuex";
 export default {
-  name: "OutBound",
+  name: "oldOutBound",
   props: [],
   components: {},
   data() {
@@ -131,7 +133,12 @@ export default {
       ],
     };
   },
-  computed: {},
+  computed: {
+    ...mapState({
+      username: (state) => state.user.name,
+      nickName: (state) => state.user?.nickName,
+    }),
+  },
   watch: {
     isRetail(val) {
       console.log(val);
@@ -201,6 +208,7 @@ export default {
       this.$refs.form.validate(async (valid) => {
         if (valid) {
           res.flag = true;
+          this.form.printUser = this.nickName;
           res.data = {
             form: this.form,
             tableData: this.tableData,

+ 100 - 8
zkqy-ui/src/views/orderMange/components/dialogForm/OutStock.vue

@@ -1,7 +1,11 @@
 <template>
   <div class="table-container">
     <div style="float: right; margin: 0px; padding: 0px">
-      <el-button @click="exportOutInfo" type="success" icon="el-icon-download"
+      <el-button
+        @click="exportOutInfo"
+        v-show="oldInventoryState != 2"
+        type="success"
+        icon="el-icon-download"
         >导出明细</el-button
       >
     </div>
@@ -28,6 +32,7 @@
     </el-row>
 
     <el-table
+      ref="tableRef"
       :data="tableData"
       border
       stripe
@@ -35,19 +40,28 @@
       show-summary
     >
       <el-table-column type="index" width="50" />
-      <el-table-column prop="productName" label="品名"></el-table-column>
+      <el-table-column
+        v-for="col in columns"
+        :key="col.prop"
+        :prop="col.prop"
+        :label="col.label"
+      >
+      </el-table-column>
+
+      <!-- <el-table-column prop="productName" label="品名"></el-table-column>
       <el-table-column prop="productSpecifications" label="规格">
       </el-table-column>
-      <el-table-column prop="productColor" label="色泽"></el-table-column>
+      <el-table-column prop="productColor" label="色"></el-table-column>
       <el-table-column prop="lotNum" label="批号"></el-table-column>
       <el-table-column prop="levels" label="等级"></el-table-column>
       <el-table-column prop="grossWeight" label="毛重"></el-table-column>
       <el-table-column prop="suttle" label="净重"></el-table-column>
       <el-table-column prop="qrCode" label="码单号"></el-table-column>
-      <el-table-column prop="boxNum" label="箱号"></el-table-column>
-      <el-table-column label="操作" v-if="row.status!=6">
+      <el-table-column prop="boxNum" label="箱号"></el-table-column> -->
+      <el-table-column label="操作" v-if="row.status != 6">
         <template slot-scope="scope">
           <el-button
+            v-show="oldInventoryState != 2"
             size="mini"
             type="danger"
             @click="handleDelete(scope.$index, scope.row)"
@@ -68,6 +82,7 @@
 
 <script>
 import { outboundDetails } from "@/api/system/retailMange.js";
+import { listOldRecord } from "@/api/system/oldRecord.js";
 import moment from "moment";
 import { removeErrorOutboundRecord } from "@/api/system/ProductWarehousingRecord";
 
@@ -77,6 +92,7 @@ export default {
   components: {},
   data() {
     return {
+      oldInventoryState: 0,
       tableData: [],
       row: {},
       orderRow: {},
@@ -86,6 +102,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
       },
+      columns: [],
     };
   },
   computed: {},
@@ -131,6 +148,15 @@ export default {
     },
     // 自定义的小计计算方法
     getSummaries(param) {
+      if (this.oldInventoryState != 2) {
+        //原来的计算方法
+        return this.getSummary(param);
+      } else {
+        //旧库存计算方法
+        return this.getSummaryOld(param);
+      }
+    },
+    getSummary(param) {
       const { columns, data } = param;
       const sums = [];
       columns.forEach((column, index) => {
@@ -169,23 +195,89 @@ export default {
 
       return sums;
     },
+    getSummaryOld(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 2) {
+          sums[index] = "小计:";
+          return;
+        }
+        const values = data.map((item) => Number(item[column.property]));
+        if (index === 0 || index === 1 || index === 2) {
+          sums[index] = "";
+        } else if (!values.every((value) => isNaN(value))) {
+          sums[index] = values
+            .reduce((prev, curr) => {
+              const value = Number(curr);
+              if (!isNaN(value)) {
+                return prev + curr;
+              } else {
+                return prev;
+              }
+            }, 0)
+            ?.toFixed(2);
+          console.log(sums[index], index);
+        } else {
+          sums[index] = "N/A";
+        }
+      });
+
+      return sums;
+    },
     // 事件格式化工具
     formatTime(time) {
       // typeof time === "string" ? (time = new Date(time)) : time;
       return moment(time).format("YYYY-MM-DD");
     },
+    // 设置新的列
+    getColumns() {
+      if (this.oldInventoryState == 2) {
+        this.columns = [
+          { prop: "productName", label: "品名" },
+          { prop: "productSpecifications", label: "规格" },
+          { prop: "productColor", label: "颜色" },
+          { prop: "orderWeight", label: "订单重量" },
+          { prop: "actualWeight", label: "实际出库重量" },
+          { prop: "actualBoxnum", label: "实际出库箱数" },
+        ];
+      } else {
+        this.columns = [
+          { prop: "productName", label: "品名" },
+          { prop: "productSpecifications", label: "规格" },
+          { prop: "productColor", label: "颜色" },
+          { prop: "lotNum", label: "批号" },
+          { prop: "levels", label: "等级" },
+          { prop: "grossWeight", label: "毛重" },
+          { prop: "suttle", label: "净重" },
+          { prop: "qrCode", label: "码单号" },
+          { prop: "boxNum", label: "箱号" },
+        ];
+      }
+      this.$nextTick(() => {
+        this.$refs.tableRef.doLayout();
+      });
+    },
     // 获取出库详情
-    async getOutStockDetail(row) {
+    async getOutStockDetail(row, flag = true) {
+      //flag: true 零售  false 订单
+      console.log(row);
       this.orderRow = row;
       let { saleNo } = row;
       this.row = row;
-      console.log(this.row.status,"ddddd")
+      console.log(this.row.status, "ddddd");
       try {
         let payLoad = {
           ...this.queryParams,
           saleOrderNo: saleNo,
         };
-        let res = await outboundDetails(payLoad);
+        let fun = outboundDetails;
+        if (row.oldInventoryState == 2 && !flag) {
+          fun = listOldRecord;
+        }
+        this.oldInventoryState = row.oldInventoryState;
+        this.getColumns();
+        let res = await fun(payLoad);
         if (res.code == 200) {
           this.tableData = res.rows;
           this.total = res.total;

+ 234 - 0
zkqy-ui/src/views/orderMange/components/dialogForm/oldOutBound.vue

@@ -0,0 +1,234 @@
+<template>
+  <div class="container">
+    <div class="form-title">
+      <span class="main-title">诸暨市新丝维化纤有限公司</span>
+      <span class="sub-title">销售出库单</span>
+    </div>
+    <el-row :gutter="10">
+      <el-form
+        :model="form"
+        ref="form"
+        :rules="rules"
+        label-width="80px"
+        :inline="false"
+        size="normal"
+      >
+        <el-col :span="24">
+          <el-form-item label="单位名称" prop="unitName">
+            <el-input
+              v-model="form.unitName"
+              placeholder=""
+              size="normal"
+              clearable
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="备注:" prop="remark" size="normal">
+            <el-input
+              v-model="form.remark"
+              placeholder=""
+              size="normal"
+              clearable
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="出库日期:" prop="remark" size="normal">
+            <el-date-picker
+              v-model="form.outStockDate"
+              type="date"
+              size="normal"
+              placeholder="选择日期"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+      </el-form>
+    </el-row>
+    <el-table ref="tableRef" v-if="tableShow" :data="tableData" border stripe>
+      <el-table-column type="index" width="50" />
+      <el-table-column label="名称" prop="productName"></el-table-column>
+      <el-table-column
+        label="规格"
+        prop="productSpecifications"
+      ></el-table-column>
+      <el-table-column label="批号" prop="lotNumber">
+        <template slot-scope="scope">
+          <el-input
+            v-model="scope.row.lotNumber"
+            placeholder=""
+            size="normal"
+            clearable
+          ></el-input>
+        </template>
+      </el-table-column>
+      <el-table-column label="单位" prop="unit">
+        <template slot-scope="scope">
+          <el-input
+            v-model="scope.row.unit"
+            placeholder=""
+            size="normal"
+            clearable
+          ></el-input>
+        </template>
+      </el-table-column>
+      <el-table-column :label="'数量'" prop="actualWeight"></el-table-column>
+      <el-table-column label="单价" prop="productUnitPrice"></el-table-column>
+      <el-table-column label="金额" prop="productAmounts"></el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import {
+  productInvoiceInfo,
+  outboundOrderInfo,
+  printOutsourceOrderList,
+} from "@/api/tablelist/commonTable";
+import { listOldRecord, listSaleOrderNo } from "@/api/system/oldRecord.js";
+import { mapState } from "vuex";
+export default {
+  name: "OutBound",
+  props: [],
+  components: {},
+  data() {
+    return {
+      isRetail: false,
+      tableShow: true,
+      form: {
+        unitName: "",
+        remark: "",
+        outStockDate: new Date(),
+      },
+      rules: {
+        // unitName: [
+        //   { required: true, message: "请输入单位名称", trigger: "blur" },
+        // ],
+      },
+      tableData: [],
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      columns: [
+        {
+          prop: "productName",
+          label: "名称",
+        },
+        {
+          prop: "productSpecifications",
+          label: "规格",
+        },
+        {
+          prop: "lotNumber",
+          label: "批号",
+        },
+        {
+          prop: "unit",
+          label: "单位",
+        },
+        {
+          prop: "productName",
+          label: "名称",
+        },
+        {
+          prop: "productName",
+          label: "名称",
+        },
+      ],
+    };
+  },
+  computed: {
+    ...mapState({
+      username: (state) => state.user.name,
+      nickName: (state) => state.user?.nickName,
+    }),
+  },
+  watch: {
+    isRetail(val) {
+      console.log(val);
+      this.$nextTick(() => {
+        this.$refs.tableRef.doLayout();
+      });
+    },
+  },
+  methods: {
+    // 重置表单
+    resetForm() {
+      Object.assign(this.form, {
+        unitName: "",
+        remark: "",
+        outStockDate: new Date(),
+      });
+    },
+    // 获取表格数据
+    async getTableData(row, isRetail = true) {
+      this.resetForm();
+      this.row = row;
+      let { saleNo } = row;
+      try {
+        let payload = {
+          isEnablePaging: false,
+          saleOrderNo: saleNo,
+        };
+        console.log(payload);
+        let fun = listSaleOrderNo;
+        let res = await fun(payload);
+        if (res.code == 200) {
+          res.rows.forEach((item) => {
+            if (!isRetail) {
+              //非零售订单  计算金额
+              if (Number(item.actualWeight) && Number(item.productUnitPrice)) {
+                item.productAmounts = (
+                  Number(item.actualWeight) * Number(item.productUnitPrice)
+                ).toFixed(2);
+              } else {
+                item.productAmounts = 0;
+              }
+            }
+            item.unit = "";
+          });
+          this.tableData = res.rows;
+          this.isRetail = isRetail;
+        }
+      } catch (error) {}
+    },
+    // 获取打印数据
+    async getPrintData() {
+      let res = {
+        flag: false,
+      };
+      this.$refs.form.validate(async (valid) => {
+        if (valid) {
+          res.flag = true;
+          this.form.printUser = this.nickName;
+          res.data = {
+            form: this.form,
+            tableData: this.tableData,
+          };
+        }
+      });
+      return res;
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.container {
+  .form-title {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    .main-title {
+      font-size: 20px;
+      font-weight: bold;
+    }
+    .sub-title {
+      font-weight: bold;
+      margin-bottom: 10px;
+    }
+  }
+}
+</style>

+ 80 - 47
zkqy-ui/src/views/orderMange/index.vue

@@ -370,8 +370,6 @@
                 <el-date-picker
                   size="small"
                   v-model="formData.deliveryDate"
-                  value-format="yyyy-MM-dd"
-                  format="yyyy-MM-dd"
                   type="date"
                   placeholder="选择日期"
                 >
@@ -787,7 +785,12 @@
         :visible.sync="outBoundShow"
         width="1000px"
       >
-        <OutBound ref="outBoundRef" :currentRow="currentRow"></OutBound>
+        <oldOutBound
+          v-if="oldInventoryState == 2"
+          ref="oldOutBoundRef"
+          :currentRow="currentRow"
+        ></oldOutBound>
+        <OutBound v-else ref="outBoundRef" :currentRow="currentRow"></OutBound>
         <span slot="footer" class="dialog-footer">
           <el-button @click="outBoundShow = false">取 消</el-button>
           <el-button type="primary" @click="outBoundPrintHandler">
@@ -850,16 +853,27 @@ import moment from "moment";
 import Deliver from "@/views/orderMange/components/dialogForm/Deliver.vue";
 import OutBound from "@/views/orderMange/components/dialogForm/OutBound.vue";
 import outBoundPrint from "@/utils/print/outBoundPrint";
+import oldOutBoundPrint from "@/utils/print/oldOutBoundPrint";
 import { listCustomer } from "@/api/system/customer";
 import OutStock from "@/views/orderMange/components/dialogForm/OutStock.vue";
+import oldOutBound from "@/views/orderMange/components/dialogForm/oldOutBound.vue";
 import { numToCapital } from "@/utils/other";
 
 export default {
   name: "listInfo",
   dicts: ["payment_method", "direction_of_twist"],
-  components: { Queryfrom, Menu, DialogTemplate, Deliver, OutBound, OutStock },
+  components: {
+    Queryfrom,
+    Menu,
+    DialogTemplate,
+    Deliver,
+    OutBound,
+    OutStock,
+    oldOutBound,
+  },
   data() {
     return {
+      oldInventoryState: 0,
       totalMoney: "", //总金额 小写
       outStockShow: false, //出库详情
       selection: [], //勾选的数据
@@ -1226,55 +1240,70 @@ export default {
     // 出库单回调
     async myPrintOutBoundHandler(row, data) {
       console.log("row", row);
+      this.oldInventoryState = row.oldInventoryState;
       this.currentRow = row;
       this.outBoundShow = true;
       this.$nextTick(() => {
-        this.$refs.outBoundRef.getTableData(row, false);
+        if (this.oldInventoryState != 2) {
+          this.$refs.outBoundRef.getTableData(row, false);
+        } else {
+          this.$refs.oldOutBoundRef.getTableData(row, false);
+        }
       });
     },
     // 出库单打印回调
     async outBoundPrintHandler() {
-      let res = await this.$refs.outBoundRef.getPrintData();
+      let res = {};
+      if (this.oldInventoryState != 2) {
+        res = await this.$refs.outBoundRef.getPrintData();
+      } else {
+        res = await this.$refs.oldOutBoundRef.getPrintData();
+      }
       console.log(res);
       if (res.flag) {
         try {
-          let payload = res.data.tableData.map((item) => {
-            let { saleNo } = this.currentRow;
-            return {
-              accountingType: "1",
-              accountsReceivableDate: new Date(),
-              saleNo,
-              noticeNumber: item.noticeNumber,
-              // saleProductNo: item.saleProductNo,
-              productId: item.productId,
-              productName: item.productName,
-              productSpecifications: item.productSpecifications,
-              productColour: item.productColour,
-              productId: item.productId,
-              lotNumber: item.lotNumber,
-              weight: item.productNumber,
-              productPrice: item.productUnitPrice,
-              amountReceivable: Number(
-                (
-                  Number(item.productNumber) * Number(item.productUnitPrice)
-                ).toFixed(2)
-              ),
-              billingType: "1",
-              accountsReceivableRemark: res.data.form.remark,
-              receivedAmount: 0,
-              status: 1,
-              boxNum: item.boxNum,
-              productLevel: item.productLevel,
-              returnReceipt: "0",
-            };
-          });
-          let result = await printOutsourceOrder(payload);
-          // return;
-          if (result.code == 200) {
-            res.data.form.printUser = this.nickName;
-            outBoundPrint(res.data, "printDom", false);
+          if (this.oldInventoryState != 2) {
+            let payload = res.data.tableData.map((item) => {
+              let { saleNo } = this.currentRow;
+              return {
+                accountingType: "1",
+                accountsReceivableDate: new Date(),
+                saleNo,
+                noticeNumber: item.noticeNumber,
+                // saleProductNo: item.saleProductNo,
+                productId: item.productId,
+                productName: item.productName,
+                productSpecifications: item.productSpecifications,
+                productColour: item.productColour,
+                productId: item.productId,
+                lotNumber: item.lotNumber,
+                weight: item.productNumber,
+                productPrice: item.productUnitPrice,
+                amountReceivable: Number(
+                  (
+                    Number(item.productNumber) * Number(item.productUnitPrice)
+                  ).toFixed(2)
+                ),
+                billingType: "1",
+                accountsReceivableRemark: res.data.form.remark,
+                receivedAmount: 0,
+                status: 1,
+                boxNum: item.boxNum,
+                productLevel: item.productLevel,
+                returnReceipt: "0",
+              };
+            });
+            let result = await printOutsourceOrder(payload);
+            // return;
+            if (result.code == 200) {
+              res.data.form.printUser = this.nickName;
+              outBoundPrint(res.data, "printDom", false);
+            } else {
+              throw new Error(result.msg);
+            }
           } else {
-            throw new Error(result.msg);
+            res.data.form.printUser = this.nickName;
+            oldOutBoundPrint(res.data, "printDom", false);
           }
         } catch (error) {
           this.$message.error(error);
@@ -1928,11 +1957,15 @@ export default {
             saleProductsNo,
             saleOrderTechnologyNo: saleCraftNo,
             saleCustomNo,
-            saleDate: moment(new Date(saleDate)).format("YYYY-MM-DD"),
-            saleOrderEstimatedTime: moment(
-              new Date(saleOrderEstimatedTime)
-            ).format("YYYY-MM-DD"),
-            deliveryDate: moment(new Date(deliveryDate)).format("YYYY-MM-DD"),
+            saleDate: saleDate
+              ? moment(new Date(saleDate)).format("YYYY-MM-DD")
+              : "",
+            saleOrderEstimatedTime: saleOrderEstimatedTime
+              ? moment(new Date(saleOrderEstimatedTime)).format("YYYY-MM-DD")
+              : "",
+            deliveryDate: deliveryDate
+              ? moment(new Date(deliveryDate)).format("YYYY-MM-DD")
+              : "",
             saleLeadTime,
             // saleAmounts, //合计金额  小写
             saleAmountInWords,

+ 11 - 4
zkqy-ui/src/views/orderMange/oldOutStock/index.vue

@@ -165,12 +165,12 @@
                 prop="productSpecifications"
               >
               </el-table-column>
-              <el-table-column align="center" label="色" prop="productColor">
+              <el-table-column align="center" label="色" prop="colours">
               </el-table-column>
-              <el-table-column align="center" label="批号" prop="lotNum">
+              <!-- <el-table-column align="center" label="批号" prop="lotNum">
               </el-table-column>
               <el-table-column align="center" label="等级" prop="levels">
-              </el-table-column>
+              </el-table-column> -->
               <el-table-column align="center" label="通知">
                 <el-table-column
                   align="center"
@@ -363,6 +363,8 @@ export default {
               let payLoad = { ...this.form };
               payLoad.oldProductInvoiceList = this.saleProductInfoList;
               payLoad.transferWarehouse = payLoad.deliveryWarehouse;
+              payLoad.saleOrderNo =
+                this.leftTableData[this.currentIndex || 0].saleOrderNo;
               if (!this.form.id) {
                 return;
               }
@@ -531,8 +533,13 @@ export default {
             id,
           });
           this.form.deliveryClerk = this.nickName;
+        } else {
+          console.log(res);
+          this.$message.error("网络异常");
         }
-      } catch (error) {}
+      } catch (error) {
+        console.log(error);
+      }
     },
   },
   computed: {