|
@@ -0,0 +1,395 @@
|
|
|
+
|
|
|
+
|
|
|
+<script>
|
|
|
+import test from "@/components/form-test/index.vue";
|
|
|
+import query from "@/components/query/index.vue";
|
|
|
+import addOutbound from "@/components/inbound-outbound/addOutbound.vue";
|
|
|
+import cgOut from "./cgOut.vue";
|
|
|
+
|
|
|
+import * as API from "@/api/inbound-outbound/treatOut.js";
|
|
|
+import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
|
|
|
+import {
|
|
|
+ getOrderDetails,
|
|
|
+ salesOutbound,
|
|
|
+} from "@/api/inbound-outbound/outbound/salesOutbound.js";
|
|
|
+import { JDorderOutbound } from "@/api/inbound-outbound/outbound/JDoutbound.js";
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ test,
|
|
|
+ query,
|
|
|
+ addOutbound,
|
|
|
+ cgOut,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ orderTypeList: [
|
|
|
+ { dictValue: "销售订单", dictKey: "1" },
|
|
|
+ { dictValue: "京东订单", dictKey: "3" },
|
|
|
+ { dictValue: "采购退货", dictKey: "7" },
|
|
|
+ ],
|
|
|
+ orderTypeListData: [],
|
|
|
+ warehouseTypeList: [],
|
|
|
+ warehouseSelectList: [],
|
|
|
+ outboundTypeList: [],
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ keyword: "",
|
|
|
+ type: "",
|
|
|
+ status: "",
|
|
|
+ },
|
|
|
+ selectConfig: [
|
|
|
+ {
|
|
|
+ label: "类型",
|
|
|
+ prop: "type",
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ tableList: [],
|
|
|
+ total: 0,
|
|
|
+ loading: false,
|
|
|
+ titleText: "",
|
|
|
+ open: false,
|
|
|
+ form: {
|
|
|
+ orderId: "",
|
|
|
+ warehouseId: "",
|
|
|
+ logisticsCode: "",
|
|
|
+ logisticsCompanyCode: "",
|
|
|
+ orderDetailsList: [],
|
|
|
+ },
|
|
|
+ addType: "",
|
|
|
+
|
|
|
+ rowData: {}, //当前选中的数据
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ const businessDictData = JSON.parse(
|
|
|
+ window.localStorage.getItem("businessDict")
|
|
|
+ );
|
|
|
+
|
|
|
+ this.warehouseTypeList = businessDictData.find(
|
|
|
+ (item) => item.code === "warehouseType"
|
|
|
+ ).children;
|
|
|
+
|
|
|
+ this.outboundTypeList = businessDictData.find(
|
|
|
+ (item) => item.code === "outboundType"
|
|
|
+ ).children;
|
|
|
+
|
|
|
+ this.selectConfig[0].data = this.orderTypeList.map((x) => ({
|
|
|
+ value: x.dictKey,
|
|
|
+ label: x.dictValue,
|
|
|
+ }));
|
|
|
+
|
|
|
+ warehouseSelectList().then((res) => {
|
|
|
+ this.warehouseSelectList = res.data.data;
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ API.outList(this.queryParams).then(
|
|
|
+ (res) => {
|
|
|
+ this.tableList = res.data.data.records;
|
|
|
+ this.total = res.data.data.total;
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log("outList: " + err);
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ handleQuery() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ salesOut(row) {
|
|
|
+ this.titleText = "销售订单出库";
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.addOutbound.loading = true;
|
|
|
+ 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,
|
|
|
+ }));
|
|
|
+ this.form = {
|
|
|
+ customerName: row.customerName,
|
|
|
+ orderType: String(row.type),
|
|
|
+ orderCode: row.code,
|
|
|
+ type: "4",
|
|
|
+ orderId: row.id,
|
|
|
+ warehouseId: "",
|
|
|
+ logisticsCode: "",
|
|
|
+ logisticsCompanyCode: "",
|
|
|
+ orderDetailsList: productDetailsList,
|
|
|
+ };
|
|
|
+ this.$refs.addOutbound.loading = false;
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log("getOrderDetails: " + err);
|
|
|
+ this.$refs.addOutbound.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+ },
|
|
|
+ JDout(row) {
|
|
|
+ this.titleText = "京东订单出库";
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.addOutbound.loading = true;
|
|
|
+ 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,
|
|
|
+ }));
|
|
|
+ this.form = {
|
|
|
+ customerName: "京东",
|
|
|
+ orderType: "京东",
|
|
|
+ type: "京东订单",
|
|
|
+ orderId: row.id,
|
|
|
+ warehouseId: "",
|
|
|
+ logisticsCode: "",
|
|
|
+ logisticsCompanyCode: "",
|
|
|
+ orderDetailsList: productDetailsList,
|
|
|
+ };
|
|
|
+ this.$refs.addOutbound.loading = false;
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log("getOrderDetails: " + err);
|
|
|
+ this.$refs.addOutbound.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+ },
|
|
|
+ purchaseOut(row) {
|
|
|
+ this.titleText = "采购退货出库";
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.addOutbound.loading = true;
|
|
|
+ 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,
|
|
|
+ }));
|
|
|
+ this.form = {
|
|
|
+ type: "5", //默认选择退货
|
|
|
+ orderId: row.id,
|
|
|
+ warehouseId: "",
|
|
|
+ logisticsCode: "",
|
|
|
+ logisticsCompanyCode: "",
|
|
|
+ orderDetailsList: productDetailsList,
|
|
|
+ };
|
|
|
+ this.$refs.addOutbound.loading = false;
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log("getOrderDetails: " + err);
|
|
|
+ this.$refs.addOutbound.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleOutbound(row) {
|
|
|
+ this.rowData = { ...row };
|
|
|
+ this.open = true;
|
|
|
+ switch (row.type) {
|
|
|
+ case 1: {
|
|
|
+ this.salesOut(row);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 3: {
|
|
|
+ this.JDout(row);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 7: {
|
|
|
+ this.purchaseOut(row);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleCancel() {
|
|
|
+ this.open = false;
|
|
|
+ },
|
|
|
+ handleSubmit() {
|
|
|
+ switch (this.rowData.type) {
|
|
|
+ case 1: {
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 3: {
|
|
|
+ JDorderOutbound(this.form).then(
|
|
|
+ () => {
|
|
|
+ this.msgSuccess("出库成功");
|
|
|
+ this.$refs.addOutbound.loading = false;
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log("JDorderOutbound: " + err);
|
|
|
+ this.$refs.addOutbound.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 7: {
|
|
|
+ API.cgOut(this.form).then(
|
|
|
+ () => {
|
|
|
+ this.msgSuccess("出库成功");
|
|
|
+ this.$refs.addOutbound.loading = false;
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log("cgOut: " + err);
|
|
|
+ this.$refs.addOutbound.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ showAddress(row) {
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ {row.countryName} , {row.provinceName} , {row.cityName}
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ showOutboundStatus(row) {
|
|
|
+ if (row.status === 1) {
|
|
|
+ return "未出库";
|
|
|
+ } else if (row.status === 2) {
|
|
|
+ return "部分出库";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div class="box-card">
|
|
|
+ <el-card>
|
|
|
+ <query
|
|
|
+ :selectConfig="selectConfig"
|
|
|
+ :req="queryParams"
|
|
|
+ :isShowMore="true"
|
|
|
+ @handleQuery="handleQuery"
|
|
|
+ @handleMore="
|
|
|
+ () => {
|
|
|
+ queryDialog = true;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ ></query>
|
|
|
+ <el-table :data="tableList" v-loading="loading">
|
|
|
+ <el-table-column
|
|
|
+ label="类型"
|
|
|
+ align="left"
|
|
|
+ prop="type"
|
|
|
+ width="120"
|
|
|
+ :formatter="(row) => dictDataEcho(row.type, orderTypeList)"
|
|
|
+ />
|
|
|
+ <el-table-column label="单号" align="left" prop="code" width="150" />
|
|
|
+ <el-table-column label="收件人" align="left" prop="contacts" />
|
|
|
+ <el-table-column label="联系电话" align="left" prop="phone" />
|
|
|
+ <el-table-column
|
|
|
+ label="所在城市"
|
|
|
+ align="left"
|
|
|
+ :formatter="showAddress"
|
|
|
+ />
|
|
|
+ <el-table-column label="收件地址" align="left" prop="detailedAddress" />
|
|
|
+ <el-table-column
|
|
|
+ label="状态"
|
|
|
+ align="left"
|
|
|
+ prop="status"
|
|
|
+ width="100"
|
|
|
+ :formatter="showOutboundStatus"
|
|
|
+ />
|
|
|
+ <el-table-column label="操作" align="center" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="handleOutbound(scope.row)"
|
|
|
+ >出库
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :title="titleText"
|
|
|
+ :visible.sync="open"
|
|
|
+ v-if="open"
|
|
|
+ width="80%"
|
|
|
+ top="60px"
|
|
|
+ >
|
|
|
+ <add-outbound
|
|
|
+ v-if="rowData.type === 1 || rowData.type === 3"
|
|
|
+ :form="form"
|
|
|
+ :addType="addType"
|
|
|
+ :orderTypeList="orderTypeListData"
|
|
|
+ :warehouseSelectList="warehouseSelectList"
|
|
|
+ :warehouseTypeList="warehouseTypeList"
|
|
|
+ :outboundTypeList="outboundTypeList"
|
|
|
+ @submit="handleSubmit"
|
|
|
+ @cancel="handleCancel"
|
|
|
+ ref="addOutbound"
|
|
|
+ ></add-outbound>
|
|
|
+
|
|
|
+ <cg-out
|
|
|
+ v-else
|
|
|
+ :form="form"
|
|
|
+ :addType="addType"
|
|
|
+ :orderTypeList="orderTypeListData"
|
|
|
+ :warehouseSelectList="warehouseSelectList"
|
|
|
+ :warehouseTypeList="warehouseTypeList"
|
|
|
+ :outboundTypeList="outboundTypeList"
|
|
|
+ @submit="handleSubmit"
|
|
|
+ @cancel="handleCancel"
|
|
|
+ ref="addOutbound"
|
|
|
+ ></cg-out>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.box-card {
|
|
|
+ height: calc(100vh - 110px);
|
|
|
+ overflow-y: auto;
|
|
|
+}
|
|
|
+</style>
|