|
@@ -1,29 +1,61 @@
|
|
|
|
|
|
<script>
|
|
|
import query from "@/components/query/index.vue";
|
|
|
+import OrderDetails from "@/components/order/details.vue";
|
|
|
+import PurchaseDetails from "@/components/purchase/details.vue";
|
|
|
|
|
|
import * as API from "@/api/order-management/JDReturnGoods/index.js";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
query,
|
|
|
+ OrderDetails,
|
|
|
+ PurchaseDetails,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
- selectConfig: [],
|
|
|
-
|
|
|
+ logisticsDataSourceList: [],
|
|
|
+ logisticsStatusList: [],
|
|
|
+ selectConfig: [
|
|
|
+ {
|
|
|
+ label: "数据来源",
|
|
|
+ prop: "businessType",
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ ],
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
keyword: "",
|
|
|
- inStockStatus: "",
|
|
|
+ businessType: "",
|
|
|
},
|
|
|
tableList: [],
|
|
|
total: 0,
|
|
|
+ open: false,
|
|
|
+ titleText: "",
|
|
|
+ activities: [],
|
|
|
+ message: "",
|
|
|
+ detailsDialog: false,
|
|
|
+ detailsText: "",
|
|
|
+ selectOrderId: "",
|
|
|
+ rowData: {},
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ const businessDictData = JSON.parse(
|
|
|
+ window.localStorage.getItem("businessDict")
|
|
|
+ );
|
|
|
+ this.logisticsDataSourceList = businessDictData.find(
|
|
|
+ (item) => item.code === "logisticsDataSource"
|
|
|
+ ).children;
|
|
|
+ this.logisticsStatusList = businessDictData.find(
|
|
|
+ (item) => item.code === "logisticsStatus"
|
|
|
+ ).children;
|
|
|
+ this.selectConfig[0].data = this.logisticsDataSourceList.map((item) => ({
|
|
|
+ label: item.dictValue,
|
|
|
+ value: item.dictKey,
|
|
|
+ }));
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
@@ -41,6 +73,56 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
+ handleQuery() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ async lookProgress(row) {
|
|
|
+ this.titleText = "查看物流";
|
|
|
+ const { data } = await API.queryStatus({ id: row.id });
|
|
|
+ if (data.data.length > 0) {
|
|
|
+ this.activities = data.data;
|
|
|
+ this.open = true;
|
|
|
+ } else {
|
|
|
+ this.msgInfo(data.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ lookDetails(row) {
|
|
|
+ this.rowData = {};
|
|
|
+ this.selectOrderId = "";
|
|
|
+ if (row.businessType === 1) {
|
|
|
+ // 采购出货
|
|
|
+ this.detailsText = "采购详情";
|
|
|
+ this.rowData = { id: row.businessId };
|
|
|
+ } else if (row.businessType === 2) {
|
|
|
+ // 京东订单出货
|
|
|
+ this.detailsText = "京东订单详情";
|
|
|
+ this.selectOrderId = row.businessId;
|
|
|
+ } else if (row.businessType === 3) {
|
|
|
+ // 销售订单出货
|
|
|
+ this.detailsText = "销售订单详情";
|
|
|
+ this.selectOrderId = row.businessId;
|
|
|
+ }
|
|
|
+ this.detailsDialog = true;
|
|
|
+ },
|
|
|
+ showStatus(row) {
|
|
|
+ if (row.logisticsStatus === -1) {
|
|
|
+ return "异常";
|
|
|
+ } else {
|
|
|
+ return this.dictDataEcho(row.logisticsStatus, logisticsStatusList);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.$confirm("确定更新状态?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ API.updateStatus({ id: row.id }).then((res) => {
|
|
|
+ this.msgSuccess("更新成功!");
|
|
|
+ this.handleQuery();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -58,34 +140,50 @@ export default {
|
|
|
"
|
|
|
></query>
|
|
|
<el-table :data="tableList" v-loading="loading">
|
|
|
- <el-table-column label="物流单号" align="left" prop="code" />
|
|
|
<el-table-column
|
|
|
- label="物流公司编码"
|
|
|
+ label="来源"
|
|
|
align="left"
|
|
|
- prop="logisticsCompanyCode"
|
|
|
- width="120"
|
|
|
+ prop="businessType"
|
|
|
+ :formatter="
|
|
|
+ (row) => dictDataEcho(row.businessType, logisticsDataSourceList)
|
|
|
+ "
|
|
|
/>
|
|
|
- <el-table-column label="物流状态" align="left" prop="logisticsStatus" />
|
|
|
- <el-table-column label="创建时间" align="left" prop="createTime" />
|
|
|
+ <el-table-column label="单号" align="left" prop="businessCode">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="show_underline" @click="lookDetails(scope.row)">
|
|
|
+ {{ scope.row.businessCode }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="物流/快递公司" align="left" prop="companyName" />
|
|
|
+ <el-table-column label="物流/快递单号" align="left" prop="code">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="show_underline" @click="lookProgress(scope.row)">
|
|
|
+ {{ scope.row.code }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
|
|
|
- <!-- <el-table-column
|
|
|
- label="状态"
|
|
|
- align="left"
|
|
|
- prop="status"
|
|
|
- width="100"
|
|
|
- :formatter="(row) => dictDataEcho(row.inStockStatus, inStockStatusList)"
|
|
|
- /> -->
|
|
|
- <!-- <el-table-column label="操作" align="left" width="100">
|
|
|
+ <el-table-column label="状态" align="left" prop="logisticsStatus">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div
|
|
|
+ :style="{ color: scope.row.logisticsStatus === -1 ? 'red' : '' }"
|
|
|
+ >
|
|
|
+ {{ showStatus(scope.row) }}
|
|
|
+ </div>
|
|
|
+ </template></el-table-column
|
|
|
+ >
|
|
|
+ <el-table-column label="操作" align="center" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- @click="handleInbound(scope.row)"
|
|
|
- v-if="scope.row.status < 30"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-if="scope.row.logisticsStatus === -1"
|
|
|
>
|
|
|
- 入库
|
|
|
+ 更新状态
|
|
|
</el-button>
|
|
|
</template>
|
|
|
- </el-table-column> -->
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<pagination
|
|
|
v-show="total > 0"
|
|
@@ -94,6 +192,39 @@ export default {
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :title="titleText"
|
|
|
+ :visible.sync="open"
|
|
|
+ v-if="open"
|
|
|
+ width="40%"
|
|
|
+ top="100px"
|
|
|
+ >
|
|
|
+ <el-timeline :reverse="false">
|
|
|
+ <el-timeline-item
|
|
|
+ placement="top"
|
|
|
+ v-for="(activity, index) in activities"
|
|
|
+ :key="index"
|
|
|
+ :timestamp="activity.ftime"
|
|
|
+ >
|
|
|
+ {{ activity.content }}
|
|
|
+ </el-timeline-item>
|
|
|
+ </el-timeline>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :title="detailsText"
|
|
|
+ v-if="detailsDialog"
|
|
|
+ :visible.sync="detailsDialog"
|
|
|
+ width="50%"
|
|
|
+ top="60px"
|
|
|
+ >
|
|
|
+ <OrderDetails
|
|
|
+ :orderId="selectOrderId"
|
|
|
+ v-if="selectOrderId"
|
|
|
+ ></OrderDetails>
|
|
|
+ <PurchaseDetails :rowData="rowData" v-if="rowData.id"></PurchaseDetails>
|
|
|
+ </el-dialog>
|
|
|
</el-card>
|
|
|
</template>
|
|
|
|