|
@@ -6,6 +6,9 @@ import query from "@/components/query/index.vue";
|
|
|
import addReturnGoods from "./addReturnGoods.vue";
|
|
|
import * as API from "@/api/order-management/JDReturnGoods/index.js";
|
|
|
|
|
|
+import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
test,
|
|
@@ -14,6 +17,10 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ uploadHeader: {
|
|
|
+ Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
|
|
|
+ "Blade-Auth": "bearer " + getToken(),
|
|
|
+ },
|
|
|
returnGoodsStatusList: [],
|
|
|
btnForm: {
|
|
|
otherButton: {
|
|
@@ -26,6 +33,14 @@ export default {
|
|
|
this.handleAdd();
|
|
|
},
|
|
|
},
|
|
|
+ {
|
|
|
+ name: "Excel导入",
|
|
|
+ methodsText: "excel",
|
|
|
+ type: "primary",
|
|
|
+ excel: () => {
|
|
|
+ this.excelImport();
|
|
|
+ },
|
|
|
+ },
|
|
|
],
|
|
|
},
|
|
|
},
|
|
@@ -41,6 +56,11 @@ export default {
|
|
|
prop: "jdBackStatus",
|
|
|
data: [],
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "仓库名称",
|
|
|
+ prop: "warehouseId",
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
],
|
|
|
tableList: [],
|
|
|
total: 0,
|
|
@@ -55,9 +75,22 @@ export default {
|
|
|
logisticsCompanyCode: "",
|
|
|
logisticsDetailsList: [],
|
|
|
},
|
|
|
+ showType: "",
|
|
|
+ openExcel: false,
|
|
|
+ excelForm: {},
|
|
|
+ warehouseTypeList: [],
|
|
|
+ warehouseSelectList: [],
|
|
|
+ excelLoading: false,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ warehouseSelectList().then((res) => {
|
|
|
+ this.warehouseSelectList = res.data.data;
|
|
|
+ this.selectConfig[1].data = this.warehouseSelectList.map((item) => ({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ }));
|
|
|
+ });
|
|
|
const businessDictData = JSON.parse(
|
|
|
window.localStorage.getItem("businessDict")
|
|
|
);
|
|
@@ -69,6 +102,10 @@ export default {
|
|
|
value: item.dictKey,
|
|
|
}));
|
|
|
|
|
|
+ this.warehouseTypeList = businessDictData.find(
|
|
|
+ (item) => item.code === "warehouseType"
|
|
|
+ ).children;
|
|
|
+
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
@@ -90,6 +127,7 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
handleAdd() {
|
|
|
+ this.showType = "add";
|
|
|
this.titleText = "新建退货";
|
|
|
this.form = {
|
|
|
warehouseId: "",
|
|
@@ -101,14 +139,21 @@ export default {
|
|
|
};
|
|
|
this.open = true;
|
|
|
},
|
|
|
+
|
|
|
handleEdit(row) {
|
|
|
+ this.showType = "";
|
|
|
this.titleText = "编辑退货";
|
|
|
this.open = true;
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.addReturnGoods.loading = true;
|
|
|
API.JDreGoodsDetails({ id: row.id }).then((res) => {
|
|
|
this.form = res.data.data;
|
|
|
-
|
|
|
+ if (this.form.jdBackOrderId === -1) {
|
|
|
+ this.form.jdBackOrderId = "";
|
|
|
+ }
|
|
|
+ if (this.form.jdBackOrderCode === -1) {
|
|
|
+ this.form.jdBackOrderCode = "";
|
|
|
+ }
|
|
|
this.$refs.addReturnGoods.loading = false;
|
|
|
});
|
|
|
});
|
|
@@ -159,6 +204,44 @@ export default {
|
|
|
);
|
|
|
}
|
|
|
},
|
|
|
+ handleLookDetails(row) {
|
|
|
+ this.showType = "details";
|
|
|
+ this.titleText = "退货详情";
|
|
|
+ this.open = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.addReturnGoods.loading = true;
|
|
|
+ API.JDreGoodsDetails({ id: row.id }).then((res) => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.form = {
|
|
|
+ warehouseId: row.warehouseId,
|
|
|
+ code: row.waybill,
|
|
|
+ logisticsDetailsList: res.data.data,
|
|
|
+ };
|
|
|
+ this.$refs.addReturnGoods.loading = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleProgress() {
|
|
|
+ this.excelLoading = true;
|
|
|
+ },
|
|
|
+ handleError(err) {
|
|
|
+ this.msgInfo(`${err} , 请重试`);
|
|
|
+ this.openExcel = false;
|
|
|
+ this.excelLoading = false;
|
|
|
+ },
|
|
|
+ handleSuccess() {
|
|
|
+ this.msgSuccess("导入成功! ");
|
|
|
+ setTimeout(() => {
|
|
|
+ this.excelLoading = false;
|
|
|
+ this.openExcel = false;
|
|
|
+ }, 300);
|
|
|
+ },
|
|
|
+ excelImport() {
|
|
|
+ this.openExcel = true;
|
|
|
+ this.excelForm = {
|
|
|
+ warehouseId: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -182,16 +265,29 @@ export default {
|
|
|
"
|
|
|
></query>
|
|
|
<el-table :data="tableList" v-loading="loading">
|
|
|
- <el-table-column label="订单编号" align="left" prop="jdBackOrderCode" />
|
|
|
- <el-table-column label="退货时间" align="left" prop="createTime" />
|
|
|
- <el-table-column label="物流单号" align="left" prop="code" />
|
|
|
- <el-table-column
|
|
|
+ <el-table-column label="仓库名称" align="left" prop="warehouseName" />
|
|
|
+ <el-table-column label="导入时间" align="left" prop="createTime" />
|
|
|
+ <el-table-column label="物流单号" align="left" prop="waybill">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ color: #0084ff;
|
|
|
+ cursor: pointer;
|
|
|
+ text-decoration: underline;
|
|
|
+ "
|
|
|
+ @click="handleLookDetails(scope.row)"
|
|
|
+ >
|
|
|
+ {{ scope.row.waybill }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column
|
|
|
label="物流公司编码"
|
|
|
align="left"
|
|
|
prop="logisticsCompanyCode"
|
|
|
/>
|
|
|
<el-table-column label="物流公司名称" align="left" prop="companyName" />
|
|
|
- <el-table-column label="仓库名称" align="left" prop="warehouseName" />
|
|
|
+ <el-table-column label="仓库名称" align="left" prop="warehouseName" /> -->
|
|
|
<el-table-column
|
|
|
label="状态"
|
|
|
align="left"
|
|
@@ -237,11 +333,65 @@ export default {
|
|
|
>
|
|
|
<add-return-goods
|
|
|
:form="form"
|
|
|
+ :showType="showType"
|
|
|
@submit="handleSubmit"
|
|
|
@cancel="handleCancel"
|
|
|
ref="addReturnGoods"
|
|
|
></add-return-goods>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="Excel导入(导入前请先选择仓库)"
|
|
|
+ :visible.sync="openExcel"
|
|
|
+ v-if="openExcel"
|
|
|
+ width="40%"
|
|
|
+ top="20vh"
|
|
|
+ v-loading="excelLoading"
|
|
|
+ element-loading-text="文件导入中,请稍后!"
|
|
|
+ element-loading-spinner="el-icon-loading"
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.2)"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ label-position="right"
|
|
|
+ :model="excelForm"
|
|
|
+ ref="excelForm"
|
|
|
+ label-width="80px"
|
|
|
+ >
|
|
|
+ <el-form-item label="仓库名称" prop="warehouseId">
|
|
|
+ <el-select
|
|
|
+ v-model="excelForm.warehouseId"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in warehouseSelectList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ <span style="float: left">{{
|
|
|
+ `${item.name}(${dictDataEcho(item.type, warehouseTypeList)})`
|
|
|
+ }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="Excel" v-if="excelForm.warehouseId">
|
|
|
+ <el-upload
|
|
|
+ action="/api/victoriatourist/newJdBack/excelImport"
|
|
|
+ :data="excelForm"
|
|
|
+ :headers="uploadHeader"
|
|
|
+ :on-success="handleSuccess"
|
|
|
+ :on-progress="handleProgress"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-error="handleError"
|
|
|
+ accept=".xlsx"
|
|
|
+ >
|
|
|
+ <el-button size="small" type="primary">点击导入</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -259,6 +409,7 @@ export default {
|
|
|
}
|
|
|
.body-main {
|
|
|
flex: 1;
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
}
|
|
|
</style>
|