|
@@ -4,35 +4,34 @@
|
|
|
import test from "@/components/form-test/index.vue";
|
|
|
import query from "@/components/query/index.vue";
|
|
|
import purchaseInbound from "./purchaseInbound.vue";
|
|
|
+import JDbackInbound from "./JDbackInbound.vue";
|
|
|
|
|
|
-import * as API from "@/api/inbound-outbound/outbound/salesOutbound.js";
|
|
|
-import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
|
|
|
+import * as API from "@/api/inbound-outbound/treatIn.js";
|
|
|
+import {
|
|
|
+ logisticsDetails,
|
|
|
+ purchaseAdd,
|
|
|
+} from "@/api/inbound-outbound/inbound/purchaseInbound.js";
|
|
|
+import { JDreGoodsDetails } from "@/api/order-management/JDReturnGoods/index.js";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
test,
|
|
|
query,
|
|
|
purchaseInbound,
|
|
|
+ JDbackInbound,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- orderTypeList: [],
|
|
|
- warehouseTypeList: [],
|
|
|
- warehouseSelectList: [],
|
|
|
- outboundTypeList: [],
|
|
|
+ inBoundTypeList: [
|
|
|
+ { dictValue: "采购入库", dictKey: "1" },
|
|
|
+ { dictValue: "京东退货", dictKey: "4" },
|
|
|
+ ],
|
|
|
+ inStockStatusList: [],
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
keyword: "",
|
|
|
type: "",
|
|
|
- status: "",
|
|
|
- code: "",
|
|
|
- customerName: "",
|
|
|
- minAmountMoney: "",
|
|
|
- maxAmountMoney: "",
|
|
|
- countryId: "",
|
|
|
- provinceId: "",
|
|
|
- cityId: "",
|
|
|
},
|
|
|
selectConfig: [
|
|
|
{
|
|
@@ -40,7 +39,7 @@ export default {
|
|
|
prop: "type",
|
|
|
data: [
|
|
|
{ label: "采购入库", value: "1" },
|
|
|
- { label: "京东退货", value: "0" },
|
|
|
+ { label: "京东退货", value: "4" },
|
|
|
],
|
|
|
},
|
|
|
],
|
|
@@ -49,14 +48,9 @@ export default {
|
|
|
loading: false,
|
|
|
titleText: "",
|
|
|
open: false,
|
|
|
- form: {
|
|
|
- orderId: "",
|
|
|
- warehouseId: "",
|
|
|
- logisticsCode: "",
|
|
|
- logisticsCompanyCode: "",
|
|
|
- orderDetailsList: [],
|
|
|
- },
|
|
|
- addType: "",
|
|
|
+ form: {},
|
|
|
+
|
|
|
+ rowData: {},
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -64,28 +58,28 @@ export default {
|
|
|
window.localStorage.getItem("businessDict")
|
|
|
);
|
|
|
|
|
|
- this.warehouseTypeList = businessDictData.find(
|
|
|
- (item) => item.code === "warehouseType"
|
|
|
+ this.inStockStatusList = businessDictData.find(
|
|
|
+ (item) => item.code === "inStockStatus"
|
|
|
).children;
|
|
|
- this.outboundTypeList = businessDictData.find(
|
|
|
- (item) => item.code === "outboundType"
|
|
|
- ).children;
|
|
|
- warehouseSelectList().then((res) => {
|
|
|
- this.warehouseSelectList = res.data.data;
|
|
|
- });
|
|
|
+
|
|
|
+ this.selectConfig[0].data = this.inBoundTypeList.map((x) => ({
|
|
|
+ value: x.dictKey,
|
|
|
+ label: x.dictValue,
|
|
|
+ }));
|
|
|
+
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- API.salesOrderList(this.queryParams).then(
|
|
|
+ API.inList(this.queryParams).then(
|
|
|
(res) => {
|
|
|
this.tableList = res.data.data.records;
|
|
|
this.total = res.data.data.total;
|
|
|
this.loading = false;
|
|
|
},
|
|
|
(err) => {
|
|
|
- console.log("salesOrderList: " + err);
|
|
|
+ console.log("inList: " + err);
|
|
|
this.loading = false;
|
|
|
}
|
|
|
);
|
|
@@ -93,73 +87,91 @@ export default {
|
|
|
handleQuery() {
|
|
|
this.getList();
|
|
|
},
|
|
|
- handleInbound(row, type = "") {
|
|
|
- this.addType = type;
|
|
|
+ handleInbound(row) {
|
|
|
+ this.rowData = { ...row };
|
|
|
this.open = true;
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.addOutbound.loading = true;
|
|
|
- API.getOrderDetails({ id: row.id }).then(
|
|
|
- (res) => {
|
|
|
- const productDetailsList = res.data.data.map((x) => ({
|
|
|
- productCode: x.productCode,
|
|
|
- productName: x.productName,
|
|
|
- notIssuedQuantity: x.notIssuedQuantity,
|
|
|
- specs: x.productSpecs,
|
|
|
- changeQuantity: Number(x.notIssuedQuantity),
|
|
|
- productId: x.productId,
|
|
|
- orderDetailsId: x.id,
|
|
|
- }));
|
|
|
+ if (row.businessType === 1) {
|
|
|
+ this.titleText = "采购入库";
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.purchaseInbound.loading = true;
|
|
|
+ logisticsDetails({ logisticsInfoId: row.id }).then(
|
|
|
+ (res) => {
|
|
|
+ let list = res.data.data;
|
|
|
+ list = list.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ changeQuantity:
|
|
|
+ Number(x.shipmentQuantity) - Number(x.receiptQuantity),
|
|
|
+ }));
|
|
|
+ this.form = {
|
|
|
+ id: row.id,
|
|
|
+ purchaseCode: row.purchaseCode,
|
|
|
+ supplierName: row.supplierName,
|
|
|
+ logisticsCompanyName: row.logisticsCompanyName,
|
|
|
+ code: row.code,
|
|
|
+ changeDetailsList: list,
|
|
|
+ };
|
|
|
+ this.$refs.purchaseInbound.loading = false;
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log("logisticsDetails: " + err);
|
|
|
+ this.$refs.purchaseInbound.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+ } else if (row.businessType === 4) {
|
|
|
+ this.titleText = "京东退货入库";
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.JDbackInbound.loading = true;
|
|
|
+ JDreGoodsDetails({ id: row.businessId }).then((res) => {
|
|
|
this.form = {
|
|
|
- customerName: row.customerName,
|
|
|
- orderType: String(row.type),
|
|
|
- orderCode: row.code,
|
|
|
- type: "4",
|
|
|
- orderId: row.id,
|
|
|
+ logisticsId: row.id,
|
|
|
warehouseId: "",
|
|
|
- logisticsCode: "",
|
|
|
- logisticsCompanyCode: "",
|
|
|
- orderDetailsList: productDetailsList,
|
|
|
+ logisticsCompanyName: row.logisticsCompanyName,
|
|
|
+ code: row.code,
|
|
|
+ logisticsDetailsList: res.data.data,
|
|
|
};
|
|
|
- this.$refs.addOutbound.loading = false;
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- console.log("getOrderDetails: " + err);
|
|
|
- this.$refs.addOutbound.loading = false;
|
|
|
- }
|
|
|
- );
|
|
|
- });
|
|
|
+ this.$refs.JDbackInbound.loading = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
handleCancel() {
|
|
|
this.open = false;
|
|
|
},
|
|
|
handleSubmit() {
|
|
|
- API.salesOutbound(this.form).then(
|
|
|
- () => {
|
|
|
- this.msgSuccess("添加成功");
|
|
|
- this.$refs.addOutbound.loading = false;
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- console.log("outboundAdd: " + err);
|
|
|
- this.$refs.addOutbound.loading = false;
|
|
|
- }
|
|
|
- );
|
|
|
- },
|
|
|
-
|
|
|
- showAddress(row) {
|
|
|
- return (
|
|
|
- <div>
|
|
|
- {row.countryName} , {row.provinceName} , {row.cityName} ,
|
|
|
- {row.detailedAddress}
|
|
|
- </div>
|
|
|
- );
|
|
|
- },
|
|
|
- showOutboundStatus(row) {
|
|
|
- if (row.issueStatus === 1) {
|
|
|
- return "未出库";
|
|
|
- } else if (row.issueStatus === 2) {
|
|
|
- return "部分出库";
|
|
|
+ if (this.rowData.businessType === 1) {
|
|
|
+ purchaseAdd({
|
|
|
+ logisticsInfoId: this.form.id,
|
|
|
+ list: this.form.changeDetailsList,
|
|
|
+ }).then(
|
|
|
+ () => {
|
|
|
+ this.msgSuccess("入库成功");
|
|
|
+ this.$refs.purchaseInbound.loading = false;
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log("purchaseAdd: " + err);
|
|
|
+ this.$refs.purchaseInbound.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ const data = {
|
|
|
+ logisticsId: this.form.logisticsId,
|
|
|
+ warehouseId: this.form.warehouseId,
|
|
|
+ };
|
|
|
+ API.JDInBound(data).then(
|
|
|
+ () => {
|
|
|
+ this.msgSuccess("入库成功");
|
|
|
+ this.$refs.JDbackInbound.loading = false;
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log("outboundAdd: " + err);
|
|
|
+ this.$refs.JDbackInbound.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
},
|
|
|
},
|
|
@@ -185,51 +197,58 @@ export default {
|
|
|
<el-table-column
|
|
|
label="类型"
|
|
|
align="left"
|
|
|
- prop="type"
|
|
|
+ prop="businessType"
|
|
|
width="120"
|
|
|
- :formatter="(row) => dictDataEcho(row.type, orderTypeList)"
|
|
|
+ :formatter="(row) => dictDataEcho(row.businessType, inBoundTypeList)"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
label="仓库名称"
|
|
|
align="left"
|
|
|
- prop="code"
|
|
|
+ prop="warehouseName"
|
|
|
width="150"
|
|
|
/>
|
|
|
- <el-table-column label="单号" align="left" prop="customerName" />
|
|
|
- <el-table-column label="物流/快递公司" align="left" />
|
|
|
<el-table-column
|
|
|
- label="物流/快递单号"
|
|
|
+ label="单号"
|
|
|
align="left"
|
|
|
- prop="orderTime"
|
|
|
- width="160"
|
|
|
+ prop="purchaseCode"
|
|
|
+ width="180"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
+ label="物流/快递公司"
|
|
|
+ align="left"
|
|
|
+ prop="logisticsCompanyName"
|
|
|
+ width="150"
|
|
|
+ />
|
|
|
+ <el-table-column label="物流/快递单号" align="left" prop="code" />
|
|
|
+ <el-table-column
|
|
|
label="操作人"
|
|
|
align="left"
|
|
|
- prop="issueStatus"
|
|
|
- width="100"
|
|
|
+ prop="purchaseName"
|
|
|
+ width="120"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
label="操作时间"
|
|
|
align="left"
|
|
|
- prop="issueStatus"
|
|
|
- width="100"
|
|
|
+ prop="updateTime"
|
|
|
+ width="150"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
label="状态"
|
|
|
align="left"
|
|
|
- prop="issueStatus"
|
|
|
+ prop="inStockStatus"
|
|
|
width="100"
|
|
|
+ :formatter="
|
|
|
+ (row) => dictDataEcho(row.inStockStatus, inStockStatusList)
|
|
|
+ "
|
|
|
/>
|
|
|
-
|
|
|
<el-table-column label="操作" align="center" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text" @click="handleInbound(scope.row)"
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="handleInbound(scope.row)"
|
|
|
+ v-if="scope.row.status < 30"
|
|
|
>入库
|
|
|
</el-button>
|
|
|
- <!-- <el-button type="text" @click="handleInbound(scope.row, '10')"
|
|
|
- >补发货
|
|
|
- </el-button> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -250,11 +269,21 @@ export default {
|
|
|
top="60px"
|
|
|
>
|
|
|
<purchase-inbound
|
|
|
+ v-if="rowData.businessType === 1"
|
|
|
:form="form"
|
|
|
@submit="handleSubmit"
|
|
|
@cancel="handleCancel"
|
|
|
- ref="addOutbound"
|
|
|
+ ref="purchaseInbound"
|
|
|
></purchase-inbound>
|
|
|
+
|
|
|
+ <JDbackInbound
|
|
|
+ v-else
|
|
|
+ :form="form"
|
|
|
+ @submit="handleSubmit"
|
|
|
+ @cancel="handleCancel"
|
|
|
+ ref="JDbackInbound"
|
|
|
+ >
|
|
|
+ </JDbackInbound>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|