|
@@ -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,
|